diff --git a/.github/cfg/integration-test-core.yaml b/.github/cfg/integration-test-core.yaml index 262bcc21f6..f4433455b6 100644 --- a/.github/cfg/integration-test-core.yaml +++ b/.github/cfg/integration-test-core.yaml @@ -127,7 +127,4 @@ jobs: run: make pkg-integration-test PKG=./pkg/store - name: Run migrate tests - run: make pkg-integration-test PKG=./pkg/schema/migrate - - - name: Run netwait tests - run: make pkg-integration-test PKG=./pkg/util/netwait + run: make pkg-integration-test PKG=./pkg/schema/migrate \ No newline at end of file diff --git a/.github/workflows/integration-tests-2023.1.9-IPV4-raftschema.yaml b/.github/workflows/integration-tests-2023.1.9-IPV4-raftschema.yaml index 3910f1644e..89e543cf2a 100644 --- a/.github/workflows/integration-tests-2023.1.9-IPV4-raftschema.yaml +++ b/.github/workflows/integration-tests-2023.1.9-IPV4-raftschema.yaml @@ -99,8 +99,6 @@ jobs: run: make pkg-integration-test PKG=./pkg/store - name: Run migrate tests run: make pkg-integration-test PKG=./pkg/schema/migrate - - name: Run netwait tests - run: make pkg-integration-test PKG=./pkg/util/netwait name: integration-tests-2023.1.9-IPV4-raftschema "on": pull_request: diff --git a/.github/workflows/integration-tests-2023.1.9-IPV4.yaml b/.github/workflows/integration-tests-2023.1.9-IPV4.yaml index c167bea971..8ad91b8b29 100644 --- a/.github/workflows/integration-tests-2023.1.9-IPV4.yaml +++ b/.github/workflows/integration-tests-2023.1.9-IPV4.yaml @@ -99,8 +99,6 @@ jobs: run: make pkg-integration-test PKG=./pkg/store - name: Run migrate tests run: make pkg-integration-test PKG=./pkg/schema/migrate - - name: Run netwait tests - run: make pkg-integration-test PKG=./pkg/util/netwait name: integration-tests-2023.1.9-IPV4 "on": pull_request: diff --git a/.github/workflows/integration-tests-2023.1.9-IPV6-raftschema.yaml b/.github/workflows/integration-tests-2023.1.9-IPV6-raftschema.yaml index 7dab59a83d..0f72449694 100644 --- a/.github/workflows/integration-tests-2023.1.9-IPV6-raftschema.yaml +++ b/.github/workflows/integration-tests-2023.1.9-IPV6-raftschema.yaml @@ -99,8 +99,6 @@ jobs: run: make pkg-integration-test PKG=./pkg/store - name: Run migrate tests run: make pkg-integration-test PKG=./pkg/schema/migrate - - name: Run netwait tests - run: make pkg-integration-test PKG=./pkg/util/netwait name: integration-tests-2023.1.9-IPV6-raftschema "on": pull_request: diff --git a/.github/workflows/integration-tests-2024.1.5-IPV4.yaml b/.github/workflows/integration-tests-2024.1.5-IPV4.yaml index 3a5f56a2af..6c32f44965 100644 --- a/.github/workflows/integration-tests-2024.1.5-IPV4.yaml +++ b/.github/workflows/integration-tests-2024.1.5-IPV4.yaml @@ -99,8 +99,6 @@ jobs: run: make pkg-integration-test PKG=./pkg/store - name: Run migrate tests run: make pkg-integration-test PKG=./pkg/schema/migrate - - name: Run netwait tests - run: make pkg-integration-test PKG=./pkg/util/netwait name: integration-tests-2024.1.5-IPV4 "on": pull_request: diff --git a/.github/workflows/integration-tests-2024.1.5-IPV6.yaml b/.github/workflows/integration-tests-2024.1.5-IPV6.yaml index cf62e6e843..eae529e6dd 100644 --- a/.github/workflows/integration-tests-2024.1.5-IPV6.yaml +++ b/.github/workflows/integration-tests-2024.1.5-IPV6.yaml @@ -99,8 +99,6 @@ jobs: run: make pkg-integration-test PKG=./pkg/store - name: Run migrate tests run: make pkg-integration-test PKG=./pkg/schema/migrate - - name: Run netwait tests - run: make pkg-integration-test PKG=./pkg/util/netwait name: integration-tests-2024.1.5-IPV6 "on": pull_request: diff --git a/.github/workflows/integration-tests-6.0.1-IPV4-tablets.yaml b/.github/workflows/integration-tests-6.0.1-IPV4-tablets.yaml index 1d1b3a5bd9..4efd407346 100644 --- a/.github/workflows/integration-tests-6.0.1-IPV4-tablets.yaml +++ b/.github/workflows/integration-tests-6.0.1-IPV4-tablets.yaml @@ -99,8 +99,6 @@ jobs: run: make pkg-integration-test PKG=./pkg/store - name: Run migrate tests run: make pkg-integration-test PKG=./pkg/schema/migrate - - name: Run netwait tests - run: make pkg-integration-test PKG=./pkg/util/netwait name: integration-tests-6.0.1-IPV4-tablets "on": pull_request: diff --git a/.github/workflows/integration-tests-6.0.1-IPV4.yaml b/.github/workflows/integration-tests-6.0.1-IPV4.yaml index 2c6da14e4b..343ad59b8a 100644 --- a/.github/workflows/integration-tests-6.0.1-IPV4.yaml +++ b/.github/workflows/integration-tests-6.0.1-IPV4.yaml @@ -99,8 +99,6 @@ jobs: run: make pkg-integration-test PKG=./pkg/store - name: Run migrate tests run: make pkg-integration-test PKG=./pkg/schema/migrate - - name: Run netwait tests - run: make pkg-integration-test PKG=./pkg/util/netwait name: integration-tests-6.0.1-IPV4 "on": pull_request: diff --git a/.github/workflows/integration-tests-6.0.1-IPV6-tablets.yaml b/.github/workflows/integration-tests-6.0.1-IPV6-tablets.yaml index 842b0f4408..653fd3f46f 100644 --- a/.github/workflows/integration-tests-6.0.1-IPV6-tablets.yaml +++ b/.github/workflows/integration-tests-6.0.1-IPV6-tablets.yaml @@ -99,8 +99,6 @@ jobs: run: make pkg-integration-test PKG=./pkg/store - name: Run migrate tests run: make pkg-integration-test PKG=./pkg/schema/migrate - - name: Run netwait tests - run: make pkg-integration-test PKG=./pkg/util/netwait name: integration-tests-6.0.1-IPV6-tablets "on": pull_request: diff --git a/.github/workflows/integration-tests-latest-enterprise-IPV4-tablets.yaml b/.github/workflows/integration-tests-latest-enterprise-IPV4-tablets.yaml index 01d2012c42..cc9663318d 100644 --- a/.github/workflows/integration-tests-latest-enterprise-IPV4-tablets.yaml +++ b/.github/workflows/integration-tests-latest-enterprise-IPV4-tablets.yaml @@ -99,8 +99,6 @@ jobs: run: make pkg-integration-test PKG=./pkg/store - name: Run migrate tests run: make pkg-integration-test PKG=./pkg/schema/migrate - - name: Run netwait tests - run: make pkg-integration-test PKG=./pkg/util/netwait name: integration-tests-latest-enterprise-IPV4-tablets "on": pull_request: diff --git a/.github/workflows/integration-tests-latest-enterprise-IPV4.yaml b/.github/workflows/integration-tests-latest-enterprise-IPV4.yaml index 43a8bd8d15..9e7e64989f 100644 --- a/.github/workflows/integration-tests-latest-enterprise-IPV4.yaml +++ b/.github/workflows/integration-tests-latest-enterprise-IPV4.yaml @@ -99,8 +99,6 @@ jobs: run: make pkg-integration-test PKG=./pkg/store - name: Run migrate tests run: make pkg-integration-test PKG=./pkg/schema/migrate - - name: Run netwait tests - run: make pkg-integration-test PKG=./pkg/util/netwait name: integration-tests-latest-enterprise-IPV4 "on": pull_request: diff --git a/Makefile b/Makefile index c6978943a1..2f88740f67 100644 --- a/Makefile +++ b/Makefile @@ -105,7 +105,6 @@ integration-test: @$(MAKE) pkg-integration-test PKG=./pkg/service/scheduler @$(MAKE) pkg-integration-test PKG=./pkg/store @$(MAKE) pkg-integration-test PKG=./pkg/schema/migrate - @$(MAKE) pkg-integration-test PKG=./pkg/util/netwait # Load Minio config for INTEGRATION_TEST_ARGS include testing/.env diff --git a/go.mod b/go.mod index 89c9fd30ab..84a244179e 100644 --- a/go.mod +++ b/go.mod @@ -1,117 +1,126 @@ module github.com/scylladb/scylla-manager/v3 -go 1.21 +go 1.21.1 require ( github.com/aws/aws-sdk-go v1.35.17 - github.com/cenkalti/backoff/v4 v4.2.1 - github.com/cespare/xxhash/v2 v2.2.0 - github.com/go-chi/chi/v5 v5.0.0 + github.com/cenkalti/backoff/v4 v4.3.0 + github.com/cespare/xxhash/v2 v2.3.0 + github.com/go-chi/chi/v5 v5.1.0 github.com/go-chi/render v1.0.0 - github.com/go-openapi/errors v0.19.6 - github.com/go-openapi/runtime v0.19.20 - github.com/go-openapi/strfmt v0.19.5 - github.com/go-openapi/swag v0.19.9 - github.com/go-openapi/validate v0.19.10 - github.com/gobwas/glob v0.2.3 - github.com/gocql/gocql v1.5.2 + github.com/go-openapi/runtime v0.28.0 + github.com/go-openapi/strfmt v0.23.0 + github.com/gocql/gocql v1.6.0 github.com/golang/mock v1.6.0 - github.com/google/go-cmp v0.5.9 - github.com/google/uuid v1.3.0 + github.com/google/go-cmp v0.6.0 + github.com/google/uuid v1.6.0 github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed - github.com/hashicorp/go-version v1.2.0 - github.com/hbollon/go-edlib v1.5.0 - github.com/json-iterator/go v1.1.11 - github.com/lnquy/cron v1.1.1 - github.com/mitchellh/mapstructure v1.3.2 + github.com/hashicorp/go-version v1.7.0 + github.com/json-iterator/go v1.1.12 + github.com/mitchellh/mapstructure v1.5.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.11.1 - github.com/prometheus/client_model v0.3.0 - github.com/prometheus/common v0.26.0 - github.com/prometheus/procfs v0.6.0 + github.com/prometheus/client_golang v1.20.0 + github.com/prometheus/client_model v0.6.1 + github.com/prometheus/common v0.57.0 + github.com/prometheus/procfs v0.15.1 github.com/rclone/rclone v1.51.0 github.com/robfig/cron/v3 v3.0.1 github.com/scylladb/go-log v0.0.7 github.com/scylladb/go-reflectx v1.0.1 github.com/scylladb/go-set v1.0.2 github.com/scylladb/gocqlx/v2 v2.8.0 - github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4 + github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20240902123022-df2d6812cdb0 + github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20240902115944-7914bb0d3b80 + github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20240902115944-7914bb0d3b80 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/stoewer/go-strcase v1.3.0 - go.uber.org/atomic v1.7.0 - go.uber.org/config v1.4.0 + go.uber.org/atomic v1.11.0 go.uber.org/goleak v1.1.11 - go.uber.org/multierr v1.6.0 + go.uber.org/multierr v1.11.0 go.uber.org/zap v1.21.0 - golang.org/x/crypto v0.21.0 - golang.org/x/mod v0.10.0 - golang.org/x/sync v0.2.0 - golang.org/x/sys v0.18.0 - golang.org/x/tools v0.9.3 + golang.org/x/crypto v0.26.0 + golang.org/x/mod v0.20.0 + golang.org/x/sync v0.8.0 + golang.org/x/sys v0.24.0 gopkg.in/yaml.v2 v2.4.0 ) require ( - cloud.google.com/go/compute v1.19.1 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // indirect github.com/Azure/azure-pipeline-go v0.2.3 // indirect github.com/Azure/azure-storage-blob-go v0.13.0 // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect github.com/Azure/go-autorest/autorest/adal v0.9.8 // indirect github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect github.com/Azure/go-autorest/tracing v0.6.0 // indirect - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/Unknwon/goconfig v0.0.0-20200908083735-df7de6a44db8 // indirect github.com/aalpar/deheap v0.0.0-20200318053559-9a0c2883bd56 // indirect github.com/abbot/go-http-auth v0.4.0 // indirect - github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect + github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect - github.com/go-openapi/analysis v0.19.10 // indirect - github.com/go-openapi/jsonpointer v0.19.3 // indirect - github.com/go-openapi/jsonreference v0.19.4 // indirect - github.com/go-openapi/loads v0.19.5 // indirect - github.com/go-openapi/spec v0.19.8 // indirect - github.com/go-stack/stack v1.8.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-openapi/analysis v0.23.0 // indirect + github.com/go-openapi/errors v0.22.0 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/loads v0.22.0 // indirect + github.com/go-openapi/spec v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-openapi/validate v0.24.0 // indirect + github.com/gobwas/glob v0.2.3 // indirect github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/googleapis/gax-go/v2 v2.7.1 // indirect + github.com/hbollon/go-edlib v1.6.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/josharian/intern v1.0.0 // indirect github.com/jzelinskie/whirlpool v0.0.0-20201016144138-0675e54bb004 // indirect - github.com/mailru/easyjson v0.7.1 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/lnquy/cron v1.1.1 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.8 // indirect github.com/mattn/go-ieproxy v0.0.1 // indirect github.com/mattn/go-isatty v0.0.16 // indirect - github.com/mattn/go-runewidth v0.0.9 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/ncw/swift v1.0.52 // indirect + github.com/oklog/ulid v1.3.1 // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/rfjakob/eme v1.1.1 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4 // indirect github.com/sirupsen/logrus v1.7.0 // indirect github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect github.com/smartystreets/goconvey v1.8.1 // indirect - go.mongodb.org/mongo-driver v1.5.1 // indirect + go.mongodb.org/mongo-driver v1.14.0 // indirect go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect + go.uber.org/config v1.4.0 // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/term v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/api v0.114.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect google.golang.org/grpc v1.56.3 // indirect - google.golang.org/protobuf v1.33.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 70ccf75dd3..cbd98c616b 100644 --- a/go.sum +++ b/go.sum @@ -172,13 +172,13 @@ cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvj cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= -cloud.google.com/go/compute v1.19.1 h1:am86mquDUgjGNWxiGn+5PGLbmgiWXlE/yNWpIpNvuXY= cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE= cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= @@ -620,11 +620,6 @@ github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0 github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-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/Unknwon/goconfig v0.0.0-20200908083735-df7de6a44db8 h1:1TrMV1HmBApBbM+Hy7RCKZD6UlYWYIPPfoeXomG7+zE= github.com/Unknwon/goconfig v0.0.0-20200908083735-df7de6a44db8/go.mod h1:wngxua9XCNjvHjDiTiV26DaKDT+0c63QR6H5hjVUUxw= github.com/aalpar/deheap v0.0.0-20200318053559-9a0c2883bd56 h1:hJO00l0f92EcQn8Ygc9Y0oP++eESKvcyp+KedtfT5SQ= @@ -635,28 +630,17 @@ github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aws/aws-sdk-go v1.35.17 h1:zhahppAMdPvJ9GP302SMOPW5SNoAbnjdOyaTmxA9WJU= github.com/aws/aws-sdk-go v1.35.17/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932 h1:mXoPYz/Ul5HYEDvkta6I8/rnYM5gSdSV2tJ6XbZuEtY= @@ -671,15 +655,16 @@ github.com/buengese/sgzip v0.1.1 h1:ry+T8l1mlmiWEsDrH/YHZnCVWD2S3im1KLsyO+8ZmTU= github.com/buengese/sgzip v0.1.1/go.mod h1:i5ZiXGF3fhV7gL1xaRRL1nDnmpNj0X061FQzOS8VMas= github.com/calebcase/tmpfile v1.0.2 h1:1AGuhKiUu4J6wxz6lxuF6ck3f8G2kaV6KSEny0RGCig= github.com/calebcase/tmpfile v1.0.2/go.mod h1:iErLeG/iqJr8LaQ/gYRv4GXdqssi3jg4iSzvrA06/lw= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -708,8 +693,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dropbox/dropbox-sdk-go-unofficial v5.6.0+incompatible h1:DtumzkLk2zZ2SeElEr+VNz+zV7l+BTe509cV4sKPXbM= github.com/dropbox/dropbox-sdk-go-unofficial v5.6.0+incompatible/go.mod h1:lr+LhMM3F6Y3lW1T9j2U5l7QeuWm87N9+PPXo3yH4qY= @@ -738,10 +721,8 @@ github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoD github.com/gabriel-vasile/mimetype v1.1.1 h1:qbN9MPuRf3bstHu9zkI9jDWNfH//9+9kHxr9oRBBBOA= github.com/gabriel-vasile/mimetype v1.1.1/go.mod h1:6CDPel/o/3/s4+bp6kIbsWATq8pmgOisOPG40CJa6To= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-chi/chi/v5 v5.0.0 h1:DBPx88FjZJH3FsICfDAfIfnb7XxKIYVGG6lOPlhENAg= -github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= +github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw= +github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/render v1.0.0 h1:cLJlkaTB4xfx5rWhtoB0BSXsXVJKWFqv08Y3cR1bZKA= github.com/go-chi/render v1.0.0/go.mod h1:pq4Rr7HbnsdaeHagklXub+p6Wd16Af5l9koip1OvJns= github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= @@ -752,112 +733,38 @@ github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmn github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/analysis v0.19.10 h1:5BHISBAXOc/aJK25irLZnx2D3s6WyYaY9D4gmuz9fdE= -github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.6 h1:xZMThgv5SQ7SMbWtKFkCf9bBdvR2iEyw9k3zGZONuys= -github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.4 h1:3Vw+rh13uq2JFNxgnMTGE1rnoieU9FmyE1gvnyylsYg= -github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= -github.com/go-openapi/loads v0.19.5 h1:jZVYWawIQiA1NBnHla28ktg6hrcfTHsCE+3QLVRBIls= -github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= -github.com/go-openapi/runtime v0.19.20 h1:J/t+QIjbcoq8WJvjGxRKiFBhqUE8slS9SbmD0Oi/raQ= -github.com/go-openapi/runtime v0.19.20/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/spec v0.19.8 h1:qAdZLh1r6QF/hI/gTq+TJTvsQUodZsM7KLqkAJdiJNg= -github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= -github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.9 h1:1IxuqvBUU3S2Bi4YC7tlP9SJF1gVpCvqN0T2Qof4azE= -github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= -github.com/go-openapi/validate v0.19.10 h1:tG3SZ5DC5KF4cyt7nqLVcQXGj5A7mpaYkAcNPlDK+Yk= -github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC03zFCU= +github.com/go-openapi/analysis v0.23.0/go.mod h1:9mz9ZWaSlV8TvjQHLl2mUW2PbZtemkE8yA5v22ohupo= +github.com/go-openapi/errors v0.22.0 h1:c4xY/OLxUBSTiepAg3j/MHuAv5mJhnf53LLMWFB+u/w= +github.com/go-openapi/errors v0.22.0/go.mod h1:J3DmZScxCDufmIMsdOuDHxJbdOGC0xtUynjIx092vXE= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/loads v0.22.0 h1:ECPGd4jX1U6NApCGG1We+uEozOAvXvJSF4nnwHZ8Aco= +github.com/go-openapi/loads v0.22.0/go.mod h1:yLsaTCS92mnSAZX5WWoxszLj0u+Ojl+Zs5Stn1oF+rs= +github.com/go-openapi/runtime v0.28.0 h1:gpPPmWSNGo214l6n8hzdXYhPuJcGtziTOgUpvsFWGIQ= +github.com/go-openapi/runtime v0.28.0/go.mod h1:QN7OzcS+XuYmkQLw05akXk0jRH/eZ3kb18+1KwW9gyc= +github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY= +github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk= +github.com/go-openapi/strfmt v0.23.0 h1:nlUS6BCqcnAk0pyhi9Y+kdDVZdZMHfEKQiS4HaMgO/c= +github.com/go-openapi/strfmt v0.23.0/go.mod h1:NrtIpfKtWIygRkKVsxh7XQMDQW5HKQl6S5ik2elW+K4= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-openapi/validate v0.24.0 h1:LdfDKwNbpB6Vn40xhTdNZAnfLECL81w+VX3BumrGD58= +github.com/go-openapi/validate v0.24.0/go.mod h1:iyeX1sEufmv3nPbBdX3ieNviWnOZaJ1+zquzJEf2BAQ= github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= -github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= -github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= -github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= -github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= -github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= -github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= @@ -897,7 +804,6 @@ github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -918,8 +824,9 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -944,11 +851,11 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= @@ -977,18 +884,17 @@ github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hbollon/go-edlib v1.5.0 h1:IfyK67aiP8/Z+i1DsbT5Jwhk5xIdvCfI5xVL/6xVEts= -github.com/hbollon/go-edlib v1.5.0/go.mod h1:wnt6o6EIVEzUfgbUZY7BerzQ2uvzp354qmS2xaLkrhM= +github.com/hbollon/go-edlib v1.6.0 h1:ga7AwwVIvP8mHm9GsPueC0d71cfRU/52hmPJ7Tprv4E= +github.com/hbollon/go-edlib v1.6.0/go.mod h1:wnt6o6EIVEzUfgbUZY7BerzQ2uvzp354qmS2xaLkrhM= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/iguanesolutions/go-systemd/v5 v5.0.0 h1:E4OUiBdmlD1IsClS6cmRIdzWBW8T8UBitCqYem7A1KY= github.com/iguanesolutions/go-systemd/v5 v5.0.0/go.mod h1:VPlzL6z0rXd3HU7oLkMoEqTWBhHClInYX9rP2U/+giI= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= @@ -1009,64 +915,49 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jzelinskie/whirlpool v0.0.0-20201016144138-0675e54bb004 h1:G+9t9cEtnC9jFiTxyptEKuNIAbiN5ZCQzX2a74lj3xg= github.com/jzelinskie/whirlpool v0.0.0-20201016144138-0675e54bb004/go.mod h1:KmHnJWQrgEvbuy0vcvj00gtMqbvNn1L+3YUZLK/B92c= -github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -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/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= -github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koofr/go-httpclient v0.0.0-20200420163713-93aa7c75b348 h1:Lrn8srO9JDBCf2iPjqy62stl49UDwoOxZ9/NGVi+fnk= github.com/koofr/go-httpclient v0.0.0-20200420163713-93aa7c75b348/go.mod h1:JBLy//Q5jzU3XSMxdONTD5EIj1LhTPktosxG2Bw1iho= github.com/koofr/go-koofrclient v0.0.0-20190724113126-8e5366da203a h1:02cx9xF4W2FQ1oh8CK9dWV5BnZK2mUtcbr9xR+bZiKk= github.com/koofr/go-koofrclient v0.0.0-20190724113126-8e5366da203a/go.mod h1:MRAz4Gsxd+OzrZ0owwrUHc0zLESL+1Y5syqK/sJxK2A= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lnquy/cron v1.1.1 h1:iaDX1ublgQ9LBhA8l9BVU+FrTE1PPSPAuvAdhgdnXgA= github.com/lnquy/cron v1.1.1/go.mod h1:hu2Y7H68/8oKk6T4+K4qdbopbnaP4rGltK3ylWiiDss= github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8= -github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-ieproxy v0.0.1 h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqfI= @@ -1074,37 +965,33 @@ github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYGN7GeoRg= -github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/ncw/go-acd v0.0.0-20201019170801-fe55f33415b1 h1:nAjWYc03awJAjsozNehdGZsm5LP7AhLOvjgbS8zN1tk= github.com/ncw/go-acd v0.0.0-20201019170801-fe55f33415b1/go.mod h1:MLIrzg7gp/kzVBxRE1olT7CWYMCklcUWU+ekoxOD9x0= github.com/ncw/swift v1.0.52 h1:ACF3JufDGgeKp/9mrDgQlEgS8kRYC4XKcuzj/8EJjQU= github.com/ncw/swift v1.0.52/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= -github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pengsrc/go-shared v0.2.1-0.20190131101655-1999055a4a14 h1:XeOYlK9W1uCmhjJSsY78Mcuh7MVkNjTzmHx1yBzizSU= github.com/pengsrc/go-shared v0.2.1-0.20190131101655-1999055a4a14/go.mod h1:jVblp62SafmidSkvWrXyxAme3gaTfEtWwRPGz5cpvHg= github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= @@ -1112,7 +999,6 @@ github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1121,26 +1007,17 @@ github.com/pkg/sftp v1.13.1 h1:I2qBYMChEhIjOgazfJmV3/mZM256btk6wkCDRmW7JYs= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= 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/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.1 h1:+4eQaD7vAZ6DsfsxB15hbE0odUjGI5ARs9yskGu1v4s= -github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_golang v1.20.0 h1:jBzTZ7B099Rg24tny+qngoynol8LtVYlA2bqx3vEloI= +github.com/prometheus/client_golang v1.20.0/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.57.0 h1:Ro/rKjwdq9mZn1K5QPctzh+MA4Lp0BuYk5ZZEVhoNcY= +github.com/prometheus/common v0.57.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/psanford/memfs v0.0.0-20210214183328-a001468d78ef h1:NKxTG6GVGbfMXc2mIk+KphcH6hagbVXhcFkbTgYleTI= github.com/psanford/memfs v0.0.0-20210214183328-a001468d78ef/go.mod h1:tcaRap0jS3eifrEEllL6ZMd9dg8IlDpi2S1oARrQ+NI= github.com/putdotio/go-putio/putio v0.0.0-20200123120452-16d982cac2b8 h1:Y258uzXU/potCYnQd1r6wlAnoMB68BiCkCcCnKx1SH8= @@ -1148,15 +1025,16 @@ github.com/putdotio/go-putio/putio v0.0.0-20200123120452-16d982cac2b8/go.mod h1: github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rfjakob/eme v1.1.1 h1:t+CgvcOn+eDvj2xdglxsSnkgg8LM8jwdxnV7OnsrTn0= github.com/rfjakob/eme v1.1.1/go.mod h1:U2bmx0hDj8EyDdcxmD5t3XHDnBFnyNNc22n1R4008eM= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= @@ -1175,13 +1053,14 @@ github.com/scylladb/google-api-go-client v0.34.1-patched h1:DW+T0HA+74o6FDr3TFzV github.com/scylladb/google-api-go-client v0.34.1-patched/go.mod h1:RriRmS2wJXH+2yd9PRTEcR380U9AXmurWwznqVhzsSc= github.com/scylladb/rclone v1.54.1-0.20240312172628-afe1fd2aa65e h1:lJRphCtu+nKd+mfo8whOTeFkgjMWvk8iCSlqgibKSa8= github.com/scylladb/rclone v1.54.1-0.20240312172628-afe1fd2aa65e/go.mod h1:JGZp4EvCUK+6AM1Fe1dye5xvihTc/Bk0WnHHSCJOePM= +github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20240902123022-df2d6812cdb0 h1:du1LCxGo1ckkYuSRfvMYrlLxi1InLpIWw5dKfpsNxJU= +github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20240902123022-df2d6812cdb0/go.mod h1:AQyWEkxdYc+zAEKofGOKOTPyvW2HhoL1+iMQrESFqdY= +github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20240902115944-7914bb0d3b80 h1:M6M3mnFawPskN4nBnZ9MJ+k89Mqhd26xubww07uN72w= +github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20240902115944-7914bb0d3b80/go.mod h1:+sPCx2oaOXmMpy/ODNNEDGJ7vCghBeKP4S7xEfMI+eA= +github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20240902115944-7914bb0d3b80 h1:MS2Lir2OkmpvFzfwroJC31NLLVHc8m/76SBz7+ayj1A= +github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20240902115944-7914bb0d3b80/go.mod h1:Oxfuz1XcXi9iV4ggSGfQdn+p6gPz6djPOegRMMe/6/s= github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4 h1:8qmTC5ByIXO3GP/IzBkxcZ/99VITvnIETDhdFz/om7A= github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA= @@ -1196,17 +1075,13 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -1218,22 +1093,15 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/t3rm1n4l/go-mega v0.0.0-20200416171014-ffad7fcb44b8 h1:IGJQmLBLYBdAknj21W3JsVof0yjEXfy1Q0K3YZebDOg= github.com/t3rm1n4l/go-mega v0.0.0-20200416171014-ffad7fcb44b8/go.mod h1:XWL4vDyd3JKmJx+hZWUVgCNmmhZ2dTBcaNDcxH465s0= -github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/vivint/infectious v0.0.0-20200605153912-25a574ae18a3 h1:zMsHhfK9+Wdl1F7sIKLyx3wrOFofpb3rWFbA4HgcK5k= github.com/vivint/infectious v0.0.0-20200605153912-25a574ae18a3/go.mod h1:R0Gbuw7ElaGSLOZUSwBm/GgVwMd30jWxBDdAyMOeTuc= github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= -github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1251,12 +1119,8 @@ github.com/zeebo/errs v1.2.2/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtC github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.5.1 h1:9nOVLGDfOaZ9R0tBumx/BcuqkbFpyTCU2r/Po7A2azI= -go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw= +go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80= +go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1266,41 +1130,44 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= +go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/config v1.4.0 h1:upnMPpMm6WlbZtXoasNkK4f0FhxwS+W4Iqz5oNznehQ= go.uber.org/config v1.4.0/go.mod h1:aCyrMHmUAc/s2h9sv1koP84M9ZF/4K+g2oleyESO/Ig= go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1359,25 +1226,20 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= -golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/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-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1390,7 +1252,6 @@ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -1426,8 +1287,8 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1456,13 +1317,13 @@ golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1475,23 +1336,15 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1499,7 +1352,6 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1513,8 +1365,6 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1523,7 +1373,6 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1535,7 +1384,6 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1570,8 +1418,8 @@ golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -1580,8 +1428,8 @@ golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1598,8 +1446,8 @@ golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1609,23 +1457,16 @@ golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1678,8 +1519,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= -golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1953,30 +1794,23 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/cmd/agent/router.go b/pkg/cmd/agent/router.go index 0fbcaac028..b6d21c5a1b 100644 --- a/pkg/cmd/agent/router.go +++ b/pkg/cmd/agent/router.go @@ -13,7 +13,7 @@ import ( "github.com/scylladb/go-log" "github.com/scylladb/scylla-manager/v3/pkg/auth" "github.com/scylladb/scylla-manager/v3/pkg/config/agent" - "github.com/scylladb/scylla-manager/v3/pkg/util/httphandler" + "github.com/scylladb/scylla-manager/v3/pkg/restapi" ) var unauthorizedErrorBody = json.RawMessage(`{"message":"unauthorized","code":401}`) @@ -26,8 +26,8 @@ func newRouter(c agent.Config, metrics AgentMetrics, rclone http.Handler, logger RequestLogger(logger, metrics), ) // Common endpoints - r.Get("/ping", httphandler.Heartbeat()) - r.Get("/version", httphandler.Version()) + r.Get("/ping", restapi.Heartbeat()) + r.Get("/version", restapi.Version()) // Restricted access endpoints priv := r.With( diff --git a/pkg/cmd/scylla-manager/tasks.go b/pkg/cmd/scylla-manager/tasks.go index de0d7f7e43..c9f3177780 100644 --- a/pkg/cmd/scylla-manager/tasks.go +++ b/pkg/cmd/scylla-manager/tasks.go @@ -8,6 +8,7 @@ import ( "github.com/scylladb/scylla-manager/v3/pkg/service/healthcheck" "github.com/scylladb/scylla-manager/v3/pkg/service/scheduler" + "github.com/scylladb/scylla-manager/v3/pkg/util/schedules" "github.com/scylladb/scylla-manager/v3/pkg/util/timeutc" "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" ) @@ -35,7 +36,7 @@ func makeAutoHealthCheckTasks(clusterID uuid.UUID) []*scheduler.Task { Enabled: true, Name: "cql", Sched: scheduler.Schedule{ - Cron: scheduler.NewCronEvery(15*time.Second, time.Time{}), + Cron: schedules.NewCronEvery(15*time.Second, time.Time{}), Timezone: localTimezone(), }, Properties: healthCheckModeProperties(healthcheck.CQLMode), @@ -46,7 +47,7 @@ func makeAutoHealthCheckTasks(clusterID uuid.UUID) []*scheduler.Task { Enabled: true, Name: "rest", Sched: scheduler.Schedule{ - Cron: scheduler.NewCronEvery(1*time.Minute, time.Time{}), + Cron: schedules.NewCronEvery(1*time.Minute, time.Time{}), Timezone: localTimezone(), }, Properties: healthCheckModeProperties(healthcheck.RESTMode), @@ -57,7 +58,7 @@ func makeAutoHealthCheckTasks(clusterID uuid.UUID) []*scheduler.Task { Enabled: true, Name: "alternator", Sched: scheduler.Schedule{ - Cron: scheduler.NewCronEvery(15*time.Second, time.Time{}), + Cron: schedules.NewCronEvery(15*time.Second, time.Time{}), Timezone: localTimezone(), }, Properties: healthCheckModeProperties(healthcheck.AlternatorMode), @@ -74,7 +75,7 @@ func makeAutoRepairTask(clusterID uuid.UUID) *scheduler.Task { Enabled: true, Name: "all-weekly", Sched: scheduler.Schedule{ - Cron: scheduler.MustCron("0 23 * * SAT", time.Time{}), + Cron: schedules.MustCron("0 23 * * SAT", time.Time{}), Timezone: localTimezone(), NumRetries: 3, }, diff --git a/pkg/managerclient/backup_test.go b/pkg/managerclient/backup_test.go deleted file mode 100644 index 389e3e6365..0000000000 --- a/pkg/managerclient/backup_test.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2017 ScyllaDB - -package managerclient_test - -import ( - "testing" - - "github.com/scylladb/scylla-manager/v3/pkg/managerclient" - "github.com/scylladb/scylla-manager/v3/pkg/service/backup" -) - -func TestBackupStageName(t *testing.T) { - t.Parallel() - - for _, s := range backup.StageOrder() { - if s != backup.StageDone && managerclient.BackupStageName(string(s)) == "" { - t.Errorf("%s.Name() is empty", s) - } - } -} diff --git a/pkg/managerclient/model.go b/pkg/managerclient/model.go deleted file mode 100644 index 821250fa25..0000000000 --- a/pkg/managerclient/model.go +++ /dev/null @@ -1,1375 +0,0 @@ -// Copyright (C) 2017 ScyllaDB - -package managerclient - -import ( - "encoding/json" - "fmt" - "io" - "sort" - "strings" - "text/template" - "time" - - "github.com/go-openapi/strfmt" - "github.com/pkg/errors" - "github.com/scylladb/go-set/strset" - "github.com/scylladb/scylla-manager/v3/pkg/managerclient/table" - "github.com/scylladb/scylla-manager/v3/pkg/service/scheduler" - "github.com/scylladb/scylla-manager/v3/pkg/util/inexlist" - "github.com/scylladb/scylla-manager/v3/pkg/util/timeutc" - "github.com/scylladb/scylla-manager/v3/pkg/util/version" - "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" - "github.com/scylladb/termtables" -) - -// ErrorResponse is returned in case of an error. -type ErrorResponse = models.ErrorResponse - -// TableRenderer is the interface that components need to implement -// if they can render themselves as tables. -type TableRenderer interface { - Render(io.Writer) error -} - -// Cluster is cluster.Cluster representation. -type Cluster = models.Cluster - -// ClusterSlice is []*cluster.Cluster representation. -type ClusterSlice []*models.Cluster - -// Render renders ClusterSlice in a tabular format. -func (cs ClusterSlice) Render(w io.Writer) error { - t := table.New("ID", "Name", "Labels", "Port", "CQL credentials") - for _, c := range cs { - p := "default" - if c.Port != 0 { - p = fmt.Sprint(c.Port) - } - creds := "not set" - if c.Username != "" && c.Password != "" { - creds = "set" - } - t.AddRow(c.ID, c.Name, formatLabels(c.Labels), p, creds) - } - if _, err := w.Write([]byte(t.String())); err != nil { - return err - } - - return nil -} - -// ClusterStatus contains cluster status info. -type ClusterStatus models.ClusterStatus - -func (cs ClusterStatus) tableHeaders() []interface{} { - headers := []interface{}{"Address", "Uptime", "CPUs", "Memory", "Scylla", "Agent", "Host ID"} - apis := []interface{}{"CQL", "REST"} - - if cs.hasAnyAlternator() { - apis = append([]interface{}{"Alternator"}, apis...) - } - - return append([]interface{}{""}, append(apis, headers...)...) -} - -func (cs ClusterStatus) hasAnyAlternator() bool { - for _, s := range cs { - if s.AlternatorStatus != "" { - return true - } - } - return false -} - -func (cs ClusterStatus) addRow(t *table.Table, rows ...interface{}) { - unpacked := make([]interface{}, 0, len(rows)) - for _, r := range rows { - switch v := r.(type) { - case []interface{}: - unpacked = append(unpacked, v...) - default: - unpacked = append(unpacked, v) - } - } - headers := cs.tableHeaders() - t.AddRow(unpacked[:len(headers)]...) -} - -// Render renders ClusterStatus in a tabular format. -func (cs ClusterStatus) Render(w io.Writer) error { - if len(cs) == 0 { - return nil - } - - var ( - dc = cs[0].Dc - t = table.New(cs.tableHeaders()...) - errors []string - ) - - for _, s := range cs { - if s.Dc != dc { - fmt.Fprintf(w, "Datacenter: %s\n%s", dc, t) - dc = s.Dc - t = table.New(cs.tableHeaders()...) - - if len(errors) > 0 { - fmt.Fprintf(w, "Errors:\n- %s\n\n", strings.Join(errors, "\n- ")) - errors = nil - } - } - - var apiStatuses []interface{} - - if s.AlternatorStatus != "" { - status := s.AlternatorStatus - if s.Ssl { - status += " SSL" - } - apiStatuses = append(apiStatuses, fmt.Sprintf("%s (%.0fms)", status, s.AlternatorRttMs)) - } else if cs.hasAnyAlternator() { - apiStatuses = append(apiStatuses, "-") - } - if s.AlternatorCause != "" { - errors = append(errors, fmt.Sprintf("%s alternator: %s", s.Host, s.AlternatorCause)) - } - - if s.CqlStatus != "" { - status := s.CqlStatus - if s.Ssl { - status += " SSL" - } - apiStatuses = append(apiStatuses, fmt.Sprintf("%s (%.0fms)", status, s.CqlRttMs)) - } else { - apiStatuses = append(apiStatuses, "-") - } - if s.CqlCause != "" { - errors = append(errors, fmt.Sprintf("%s CQL: %s", s.Host, s.CqlCause)) - } - - if s.RestStatus != "" { - apiStatuses = append(apiStatuses, fmt.Sprintf("%s (%.0fms)", s.RestStatus, s.RestRttMs)) - } else { - apiStatuses = append(apiStatuses, "-") - } - if s.RestCause != "" { - errors = append(errors, fmt.Sprintf("%s REST: %s", s.Host, s.RestCause)) - } - - var ( - cpus = "-" - mem = "-" - scyllaVersion = "-" - agentVersion = "-" - uptime = "-" - ) - if s.CPUCount > 0 { - cpus = fmt.Sprintf("%d", s.CPUCount) - } - if s.TotalRAM > 0 { - mem = FormatSizeSuffix(s.TotalRAM) - } - if s.ScyllaVersion != "" { - scyllaVersion = version.Short(s.ScyllaVersion) - } - if s.AgentVersion != "" { - agentVersion = version.Short(s.AgentVersion) - } - if s.Uptime > 0 { - uptime = (time.Duration(s.Uptime) * time.Second).String() - } - - cs.addRow(t, s.Status, apiStatuses, s.Host, uptime, cpus, mem, scyllaVersion, agentVersion, s.HostID) - } - - fmt.Fprintf(w, "Datacenter: %s\n%s", dc, t) - if len(errors) > 0 { - fmt.Fprintf(w, "Errors:\n- %s\n\n", strings.Join(errors, "\n- ")) - } - return nil -} - -// Task is a scheduler.Task representation. -type Task = models.Task - -func makeTaskUpdate(t *Task) *models.TaskUpdate { - return &models.TaskUpdate{ - Type: t.Type, - Enabled: t.Enabled, - Name: t.Name, - Labels: t.Labels, - Schedule: t.Schedule, - Properties: t.Properties, - } -} - -// TaskInfo allows for rendering of Task information i.e. schedule and properties. -type TaskInfo struct { - *TaskListItem -} - -const taskInfoTemplate = `Name: {{ TaskID .TaskListItem }} -Cron: {{ CronDesc .TaskListItem }} -{{ if .Schedule.Window -}} -Window: {{ WindowDesc .Schedule.Window }} -{{ end -}} -{{ if .Schedule.Timezone -}} -Tz: {{ .Schedule.Timezone }} -{{ end -}} -{{ if .Schedule.NumRetries -}} -Retry: {{ .Schedule.NumRetries }} {{ if .Schedule.RetryWait }}(initial backoff {{ .Schedule.RetryWait }}){{ end }}{{ end -}} -{{ if .Labels }} -Labels: -{{- range $key, $val := .Labels }} -- {{ $key }}: {{ $val -}} -{{ end }} -{{ end -}} - -{{ if .Properties }} -Properties: -{{- range $key, $val := .Properties }} -- {{ FormatKey $key }}: {{ FormatValue $val -}} -{{ end }} -{{ end -}} - -` - -// Render implements Renderer interface. -func (t TaskInfo) Render(w io.Writer) error { - temp := template.Must(template.New("target").Funcs(template.FuncMap{ - "TaskID": func(i *TaskListItem) string { - if i.Name != "" { - return taskJoin(i.Type, i.Name) - } - return taskJoin(i.Type, i.ID) - }, - "CronDesc": func(i *TaskListItem) string { - s := i.Schedule.Cron - if s == "" { - s = i.Schedule.Interval - } - - d := DescribeCron(s) - if d == "" { - nextStr := FormatTimePointer(i.NextActivation) - if nextStr != "" { - d = "next activation date: " + nextStr - } else { - d = "no activations scheduled" - } - } - - if s != "" { - return s + " (" + d + ")" - } - return d - }, - "WindowDesc": func(s []string) string { - v := "" - for i := 0; i < len(s)/2; i++ { - v += fmt.Sprint(s[i*2:(i+1)*2]) + " " - } - return v - }, - "FormatKey": formatKey, - "FormatValue": formatValue, - }).Parse(taskInfoTemplate)) - return temp.Execute(w, t) -} - -func formatKey(k string) string { - return strings.ReplaceAll(k, "_", "-") -} - -func formatValue(v any) string { - switch t := v.(type) { - case []string: - return "'" + strings.Join(t, ",") + "'" - case []interface{}: - s := make([]string, len(t)) - for i := range t { - s[i] = fmt.Sprint(t[i]) - } - return "'" + strings.Join(s, ",") + "'" - default: - return fmt.Sprint(t) - } -} - -// RepairTarget is a representing results of dry running repair task. -type RepairTarget struct { - models.RepairTarget - Schedule *Schedule - ShowTables int -} - -const repairTargetTemplate = `{{ if .Schedule.Cron -}} -Cron: {{ .Schedule.Cron }} {{ CronDesc .Schedule.Cron }} -{{ if .Schedule.Timezone -}} -Tz: {{ .Schedule.Timezone }} -{{ end }} -{{ end -}} -{{ if .Host -}} - -Host: {{ .Host }} - -{{ end -}} -{{ if .IgnoreHosts -}} - -Ignore Hosts: -{{ range .IgnoreHosts -}} - - {{ . }} -{{ end }} -{{ end -}} - -Data Centers: -{{ range .Dc }} - {{ . }} -{{ end }} -Keyspaces: -{{- range .Units }} - - {{ .Keyspace }} {{ FormatTables .Tables .AllTables -}} -{{ end }} - -` - -// Render implements Renderer interface. -func (t RepairTarget) Render(w io.Writer) error { - temp := template.Must(template.New("target").Funcs(template.FuncMap{ - "FormatTables": func(tables []string, all bool) string { - return FormatTables(t.ShowTables, tables, all) - }, - "CronDesc": func(s string) string { - d := DescribeCron(s) - if d != "" { - d = "(" + d + ")" - } - return d - }, - }).Parse(repairTargetTemplate)) - return temp.Execute(w, t) -} - -// BackupTarget is a representing results of dry running backup task. -type BackupTarget struct { - models.BackupTarget - Schedule *Schedule - ShowTables int -} - -const backupTargetTemplate = `{{ if .Schedule.Cron -}} -Cron: {{ .Schedule.Cron }} {{ CronDesc .Schedule.Cron }} -{{ if .Schedule.Timezone -}} -Tz: {{ .Schedule.Timezone }} -{{ end }} -{{ end -}} -Data Centers: -{{ range .Dc }} - {{ . }} -{{ end }} -Keyspaces: -{{- range .Units }} - - {{ .Keyspace }} {{ FormatTables .Tables .AllTables }} -{{- end }} - -Disk size: ~{{ FormatSizeSuffix .Size }} - -Locations: -{{- range .Location }} - - {{ . }} -{{- end }} - -Bandwidth Limits: -{{- if .RateLimit -}} -{{ range .RateLimit }} - - {{ . }} MiB/s -{{- end }} -{{- else }} - - Unlimited -{{- end }} - -Snapshot Parallel Limits: -{{- if .SnapshotParallel -}} -{{- range .SnapshotParallel }} - - {{ . }} -{{- end }} -{{- else }} - - All hosts in parallel -{{- end }} - -Upload Parallel Limits: -{{- if .UploadParallel -}} -{{- range .UploadParallel }} - - {{ . }} -{{- end }} -{{- else }} - - All hosts in parallel -{{- end }} - -Retention Policy: -{{ FormatRetentionPolicy .Retention .RetentionDays }} -` - -// Render implements Renderer interface. -func (t BackupTarget) Render(w io.Writer) error { - temp := template.Must(template.New("target").Funcs(template.FuncMap{ - "FormatSizeSuffix": FormatSizeSuffix, - "FormatTables": func(tables []string, all bool) string { - return FormatTables(t.ShowTables, tables, all) - }, - "CronDesc": func(s string) string { - d := DescribeCron(s) - if d != "" { - d = "(" + d + ")" - } - return d - }, - "FormatRetentionPolicy": FormatRetentionPolicy, - }).Parse(backupTargetTemplate)) - return temp.Execute(w, t) -} - -// RestoreTarget is a representing results of dry running restore task. -type RestoreTarget struct { - models.RestoreTarget - Schedule *Schedule - ShowTables int -} - -const restoreTargetTemplate = `{{ if .Schedule.Cron -}} -Cron: {{ .Schedule.Cron }} {{ CronDesc .Schedule.Cron }} -{{ if .Schedule.Timezone -}} -Tz: {{ .Schedule.Timezone }} -{{ end }} -{{ end -}} -Restored tables: -{{- range .Units }} - - {{ .Keyspace }}: {{ FormatSizeSuffix .Size }} {{ FormatRestoreTables .Tables }} -{{- end }} -{{ if .Views }} -Restored views: -{{- range .Views }} - - {{ .Keyspace }}.{{ .View }} -{{- end }} -{{ end }} -Disk size: ~{{ FormatSizeSuffix .Size }} - -Locations: -{{- range .Location }} - - {{ . }} -{{- end }} - -Snapshot Tag: {{ .SnapshotTag }} -Batch Size: {{ .BatchSize }} -Parallel: {{ .Parallel }} -` - -// Render implements Renderer interface. -func (t RestoreTarget) Render(w io.Writer) error { - temp := template.Must(template.New("target").Funcs(template.FuncMap{ - "FormatSizeSuffix": FormatSizeSuffix, - "FormatRestoreTables": func(tables []*models.RestoreTable) string { - return FormatRestoreTables(t.ShowTables, tables) - }, - "CronDesc": func(s string) string { - d := DescribeCron(s) - if d != "" { - d = "(" + d + ")" - } - return d - }, - }).Parse(restoreTargetTemplate)) - return temp.Execute(w, t) -} - -// TaskListItem is a representation of scheduler.Task with additional fields from scheduler. -type TaskListItem = models.TaskListItem - -// TaskListItemSlice is a representation of a slice of scheduler.Task with additional fields from scheduler. -type TaskListItemSlice = []*models.TaskListItem - -// TaskListItems is a representation of []*scheduler.Task with additional fields from scheduler. -type TaskListItems struct { - TaskListItemSlice - All bool - ShowIDs bool - ShowProps bool -} - -// Render renders TaskListItems in a tabular format. -func (li TaskListItems) Render(w io.Writer) error { - columns := []any{"Task", "Labels", "Schedule", "Window", "Timezone", "Success", "Error", "Last Success", "Last Error", "Status", "Next"} - if li.ShowProps { - columns = append(columns, "Properties") - } - p := table.New(columns...) - for _, t := range li.TaskListItemSlice { - var id string - if t.Name != "" && !li.ShowIDs { - id = taskJoin(t.Type, t.Name) - } else { - id = taskJoin(t.Type, t.ID) - } - if li.All && !t.Enabled { - id = "*" + id - } - - emptySpec := scheduler.CronSpecification{} - bytesEmptySpec, err := json.Marshal(emptySpec) - if err != nil { - return errors.New("cannot marshall empty cron specification object") - } - - var schedule string - if t.Schedule.Cron != "" && t.Schedule.Cron != string(bytesEmptySpec) { - var cronSpec scheduler.CronSpecification - err := json.Unmarshal([]byte(t.Schedule.Cron), &cronSpec) - if err != nil { - schedule = t.Schedule.Cron - } else { - schedule = cronSpec.Spec - if cronSpec.StartDate.After(timeutc.Now()) { - c := scheduler.MustCron(cronSpec.Spec, cronSpec.StartDate) - schedule += fmt.Sprintf(" with first activation after %s", - c.Next(cronSpec.StartDate).Format("2006-01-02 15:04:05")) - } - } - } else if t.Schedule.Interval != "" { - schedule = t.Schedule.Interval - } - - status := t.Status - if status == TaskStatusError && t.Retry > 0 { - status += fmt.Sprintf(" (%d/%d)", t.Retry-1, t.Schedule.NumRetries) - } - - var next string - if t.Suspended { - next = "[SUSPENDED]" - } else { - next = FormatTimePointer(t.NextActivation) - } - - row := []any{ - id, formatLabels(t.Labels), schedule, strings.Join(t.Schedule.Window, ","), t.Schedule.Timezone, - t.SuccessCount, t.ErrorCount, FormatTimePointer(t.LastSuccess), FormatTimePointer(t.LastError), - status, next, - } - if li.ShowProps { - props, ok := t.Properties.(map[string]any) - if !ok { - return errors.New("can't cast task properties into map[string]any") - } - - var fmtProps []string - for k, v := range props { - fmtProps = append(fmtProps, formatKey(k)+": "+formatValue(v)) - } - - row = append(row, strings.Join(fmtProps, ", ")) - } - - p.AddRow(row...) - } - fmt.Fprint(w, p) - - return nil -} - -// Schedule is a scheduler.Schedule representation. -type Schedule = models.Schedule - -// TaskRun is a scheduler.TaskRun representation. -type TaskRun = models.TaskRun - -// TaskRunSlice is a []*scheduler.TaskRun representation. -type TaskRunSlice []*TaskRun - -// Render renders TaskRunSlice in a tabular format. -func (tr TaskRunSlice) Render(w io.Writer, printCause bool) error { - t := table.New("ID", "Start time", "Duration", "Status") - for _, r := range tr { - s := r.Status - if printCause && r.Cause != "" { - t.LimitColumnLength(3) - s += " " + r.Cause - } - t.AddRow(r.ID, FormatTime(r.StartTime), FormatDuration(r.StartTime, r.EndTime), s) - } - if _, err := w.Write([]byte(t.String())); err != nil { - return err - } - return nil -} - -// RepairProgress contains shard progress info. -type RepairProgress struct { - *models.TaskRunRepairProgress - Task *Task - Detailed bool - ShowTables int - - hostFilter inexlist.InExList - keyspaceFilter inexlist.InExList -} - -// SetHostFilter adds filtering rules used for rendering for host details. -func (rp *RepairProgress) SetHostFilter(filters []string) (err error) { - rp.hostFilter, err = inexlist.ParseInExList(filters) - return -} - -// SetKeyspaceFilter adds filtering rules used for rendering for keyspace details. -func (rp *RepairProgress) SetKeyspaceFilter(filters []string) (err error) { - rp.keyspaceFilter, err = inexlist.ParseInExList(filters) - return -} - -// hideKeyspace returns true if provided keyspace should be hidden. -func (rp RepairProgress) hideKeyspace(keyspace string) bool { - if rp.keyspaceFilter.Size() > 0 { - if rp.keyspaceFilter.FirstMatch(keyspace) == -1 { - return true - } - } - return false -} - -func (rp RepairProgress) hideHost(host string) bool { - if rp.hostFilter.Size() > 0 { - return rp.hostFilter.FirstMatch(host) == -1 - } - return false -} - -// Render renders *RepairProgress in a tabular format. -func (rp RepairProgress) Render(w io.Writer) error { - if err := rp.addHeader(w); err != nil { - return err - } - - if rp.Progress == nil { - return nil - } - - t := table.New() - rp.addRepairTableProgress(t) - t.SetColumnAlignment(termtables.AlignRight, 1) - if _, err := io.WriteString(w, t.String()); err != nil { - return err - } - - if rp.Detailed { - for _, h := range rp.Progress.Hosts { - if rp.hideHost(h.Host) { - continue - } - - fmt.Fprintf(w, "\nHost: %s\n", h.Host) - d := table.New() - d.AddRow("Keyspace", "Table", "Progress", "Token Ranges", "Success", "Error", "Started at", "Completed at", "Duration") - d.AddSeparator() - ks := "" - for _, t := range h.Tables { - if rp.hideKeyspace(t.Keyspace) { - continue - } - - if ks == "" { - ks = t.Keyspace - } else if ks != t.Keyspace { - ks = t.Keyspace - d.AddSeparator() - } - - rp.addRepairTableDetailedProgress(d, t) - } - d.SetColumnAlignment(termtables.AlignRight, 2, 3, 4, 5, 6, 7, 8) - if _, err := w.Write([]byte(d.String())); err != nil { - return err - } - } - } - return nil -} - -var repairProgressTemplate = `{{ with .Run -}} -Run: {{ .ID }} -Status: {{ .Status }} -{{- if .Cause }} -Cause: {{ FormatError .Cause }} - -{{- end }} -{{- if not (isZero .StartTime) }} -Start time: {{ FormatTime .StartTime }} -{{- end -}} -{{- if not (isZero .EndTime) }} -End time: {{ FormatTime .EndTime }} -{{- end }} -Duration: {{ FormatDuration .StartTime .EndTime }} -{{- end }} -{{- with .Progress }} -Progress: {{ FormatTotalRepairProgress .SuccessPercentage .ErrorPercentage }} -Intensity: {{ FormatRepairIntensity .Intensity .MaxIntensity }} -Parallel: {{ FormatRepairParallel .Parallel .MaxParallel }} -{{ if .Host }}Host: {{ .Host }} -{{ end -}} -{{ if .Dcs }}Datacenters: {{ range .Dcs }} - - {{ . }} -{{- end }} -{{ end -}} -{{ else }} -Progress: - -{{ end }} -` - -func (rp RepairProgress) addHeader(w io.Writer) error { - temp := template.Must(template.New("repair_progress").Funcs(template.FuncMap{ - "isZero": isZero, - "FormatTime": FormatTime, - "FormatDuration": FormatDuration, - "FormatError": FormatError, - "FormatRepairProgress": FormatRepairProgress, - "FormatTotalRepairProgress": FormatTotalRepairProgress, - "FormatRepairIntensity": FormatRepairIntensity, - "FormatRepairParallel": FormatRepairParallel, - }).Parse(repairProgressTemplate)) - return temp.Execute(w, rp) -} - -func (rp RepairProgress) addRepairTableProgress(d *table.Table) { - if len(rp.Progress.Tables) > 0 { - d.AddRow("Keyspace", "Table", "Progress", "Duration") - d.AddSeparator() - } - - ks := "" - for _, t := range rp.Progress.Tables { - if rp.hideKeyspace(t.Keyspace) { - continue - } - if ks == "" { - ks = t.Keyspace - } else if ks != t.Keyspace { - ks = t.Keyspace - d.AddSeparator() - } - p := "-" - if t.TokenRanges > 0 { - p = FormatRepairProgress(t.TokenRanges, t.Success, t.Error) - } - - d.AddRow(t.Keyspace, t.Table, p, FormatMsDuration(t.DurationMs)) - } -} - -func (rp RepairProgress) addRepairTableDetailedProgress(d *table.Table, t *models.TableRepairProgress) { - d.AddRow(t.Keyspace, - t.Table, - FormatRepairProgress(t.TokenRanges, t.Success, t.Error), - t.TokenRanges, - t.Success, - t.Error, - FormatTimePointer(t.StartedAt), - FormatTimePointer(t.CompletedAt), - FormatMsDuration(t.DurationMs), - ) -} - -// BackupProgress contains shard progress info. -type BackupProgress struct { - *models.TaskRunBackupProgress - Task *Task - Detailed bool - Errors []string - - hostFilter inexlist.InExList - keyspaceFilter inexlist.InExList -} - -// SetHostFilter adds filtering rules used for rendering for host details. -func (bp *BackupProgress) SetHostFilter(filters []string) (err error) { - bp.hostFilter, err = inexlist.ParseInExList(filters) - return -} - -// SetKeyspaceFilter adds filtering rules used for rendering for keyspace details. -func (bp *BackupProgress) SetKeyspaceFilter(filters []string) (err error) { - bp.keyspaceFilter, err = inexlist.ParseInExList(filters) - return -} - -// AggregateErrors collects all errors from the table progress. -func (bp *BackupProgress) AggregateErrors() { - if bp.Progress == nil || bp.Run.Status != TaskStatusError { - return - } - for i := range bp.Progress.Hosts { - for j := range bp.Progress.Hosts[i].Keyspaces { - for _, t := range bp.Progress.Hosts[i].Keyspaces[j].Tables { - if t.Error != "" { - bp.Errors = append(bp.Errors, t.Error) - } - } - } - } -} - -// Render renders *BackupProgress in a tabular format. -func (bp BackupProgress) Render(w io.Writer) error { - if err := bp.addHeader(w); err != nil { - return err - } - - if bp.Progress != nil && bp.Progress.Size > 0 { - t := table.New() - bp.addHostProgress(t) - if _, err := io.WriteString(w, t.String()); err != nil { - return err - } - } - - if bp.Detailed && bp.Progress != nil && bp.Progress.Size > 0 { - if err := bp.addKeyspaceProgress(w); err != nil { - return err - } - } - return nil -} - -func (bp BackupProgress) addHostProgress(t *table.Table) { - t.AddRow("Host", "Progress", "Size", "Success", "Deduplicated", "Failed") - t.AddSeparator() - for _, h := range bp.Progress.Hosts { - if bp.hideHost(h.Host) { - continue - } - p := "-" - if len(h.Keyspaces) > 0 { - p = FormatUploadProgress(h.Size, h.Uploaded, h.Skipped, h.Failed) - } - success := h.Uploaded + h.Skipped - t.AddRow(h.Host, p, - FormatSizeSuffix(h.Size), - FormatSizeSuffix(success), - FormatSizeSuffix(h.Skipped), - FormatSizeSuffix(h.Failed), - ) - } - t.SetColumnAlignment(termtables.AlignRight, 1, 2, 3, 4, 5) -} - -func (bp BackupProgress) addKeyspaceProgress(w io.Writer) error { - for _, h := range bp.Progress.Hosts { - if bp.hideHost(h.Host) { - continue - } - fmt.Fprintf(w, "\nHost: %s\n", h.Host) - - t := table.New("Keyspace", "Table", "Progress", "Size", "Success", "Deduplicated", "Failed", "Started at", "Completed at") - for i, ks := range h.Keyspaces { - if bp.hideKeyspace(ks.Keyspace) { - break - } - if i > 0 { - t.AddSeparator() - } - - rowAdded := false - for _, tbl := range ks.Tables { - startedAt := strfmt.DateTime{} - completedAt := strfmt.DateTime{} - if tbl.StartedAt != nil { - startedAt = *tbl.StartedAt - } - if tbl.CompletedAt != nil { - completedAt = *tbl.CompletedAt - } - success := tbl.Uploaded + tbl.Skipped - t.AddRow( - ks.Keyspace, - tbl.Table, - FormatUploadProgress(tbl.Size, - tbl.Uploaded, - tbl.Skipped, - tbl.Failed), - FormatSizeSuffix(tbl.Size), - FormatSizeSuffix(success), - FormatSizeSuffix(tbl.Skipped), - FormatSizeSuffix(tbl.Failed), - FormatTime(startedAt), - FormatTime(completedAt), - ) - rowAdded = true - } - if !rowAdded { - // Separate keyspaces with no table rows - t.AddRow("-", "-", "-", "-", "-", "-", "-", "-", "-") - } - } - t.SetColumnAlignment(termtables.AlignRight, 2, 3, 4, 5, 6) - if _, err := w.Write([]byte(t.String())); err != nil { - return err - } - } - return nil -} - -func (bp BackupProgress) hideHost(host string) bool { - if bp.hostFilter.Size() > 0 { - return bp.hostFilter.FirstMatch(host) == -1 - } - return false -} - -func (bp BackupProgress) hideKeyspace(keyspace string) bool { - if bp.keyspaceFilter.Size() > 0 { - return bp.keyspaceFilter.FirstMatch(keyspace) == -1 - } - return false -} - -var backupProgressTemplate = `{{ with .Run -}} -Run: {{ .ID }} -Status: {{ status }} -{{- if .Cause }} -Cause: {{ FormatError .Cause }} - -{{- end }} -{{- if not (isZero .StartTime) }} -Start time: {{ FormatTime .StartTime }} -{{- end -}} -{{- if not (isZero .EndTime) }} -End time: {{ FormatTime .EndTime }} -{{- end }} -Duration: {{ FormatDuration .StartTime .EndTime }} -{{ end -}} -{{ with .Progress }}Progress: {{ if ne .Size 0 }}{{ FormatUploadProgress .Size .Uploaded .Skipped .Failed }}{{else}}-{{ end }} -{{- if ne .SnapshotTag "" }} -Snapshot Tag: {{ .SnapshotTag }} -{{- end }} -{{ if .Dcs -}} -Datacenters: {{ range .Dcs }} - - {{ . }} -{{- end }} -{{ end -}} -{{ else }}Progress: 0% -{{ end }} -{{- if .Errors -}} -Errors: {{ range .Errors }} - - {{ . }} -{{- end }} -{{ end }} -` - -func (bp BackupProgress) addHeader(w io.Writer) error { - temp := template.Must(template.New("backup_progress").Funcs(template.FuncMap{ - "isZero": isZero, - "FormatTime": FormatTime, - "FormatDuration": FormatDuration, - "FormatError": FormatError, - "FormatUploadProgress": FormatUploadProgress, - "status": bp.status, - }).Parse(backupProgressTemplate)) - return temp.Execute(w, bp) -} - -// status returns task status with optional backup stage. -func (bp BackupProgress) status() string { - stage := BackupStageName(bp.Progress.Stage) - s := bp.Run.Status - if s != TaskStatusNew && s != TaskStatusDone && stage != "" { - s += " (" + stage + ")" - } - return s -} - -// RestoreProgress contains shard progress info. -type RestoreProgress struct { - *models.TaskRunRestoreProgress - Task *Task - Detailed bool - Errors []string - - KeyspaceFilter inexlist.InExList -} - -var restoreProgressTemplate = `{{ with .Run -}} -Run: {{ .ID }} -Status: {{ status }} -{{- if .Cause }} -Cause: {{ FormatError .Cause }} - -{{- end }} -{{- if not (isZero .StartTime) }} -Start time: {{ FormatTime .StartTime }} -{{- end -}} -{{- if not (isZero .EndTime) }} -End time: {{ FormatTime .EndTime }} -{{- end }} -Duration: {{ FormatDuration .StartTime .EndTime }} -{{ end -}} -{{ with .Progress }}Progress: {{ if ne .Size 0 }}{{ FormatRestoreProgress .Size .Restored .Downloaded .Failed }}{{else}}-{{ end }} -Snapshot Tag: {{ .SnapshotTag }} -{{ else }}Progress: 0% -{{ end }} -{{- if .Errors -}} -Errors: {{ range .Errors }} - - {{ . }} -{{- end }} -{{ end }} -` - -func (rp RestoreProgress) addHeader(w io.Writer) error { - temp := template.Must(template.New("restore_progress").Funcs(template.FuncMap{ - "isZero": isZero, - "FormatTime": FormatTime, - "FormatDuration": FormatDuration, - "FormatError": FormatError, - "FormatRestoreProgress": FormatRestoreProgress, - "status": rp.status, - }).Parse(restoreProgressTemplate)) - return temp.Execute(w, rp) -} - -// status returns task status with optional restore stage. -func (rp RestoreProgress) status() string { - s := rp.Run.Status - if rp.Progress == nil { - return s - } - stage := RestoreStageName(rp.Progress.Stage) - if s != TaskStatusNew && s != TaskStatusDone && stage != "" { - s += " (" + stage + ")" - } - return s -} - -func (rp RestoreProgress) hideKeyspace(keyspace string) bool { - if rp.KeyspaceFilter.Size() > 0 { - return rp.KeyspaceFilter.FirstMatch(keyspace) == -1 - } - return false -} - -// Render renders *RestoreProgress in a tabular format. -func (rp RestoreProgress) Render(w io.Writer) error { - if rp.Progress != nil { - fmt.Fprintf(w, "Restore progress\n") - } - if err := rp.addHeader(w); err != nil { - return err - } - if rp.Progress == nil { - return nil - } - - if rp.Progress.Size > 0 { - t := table.New() - rp.addKeyspaceProgress(t) - if _, err := io.WriteString(w, t.String()); err != nil { - return err - } - } - - if rp.Detailed && rp.Progress.Size > 0 { - if err := rp.addTableProgress(w); err != nil { - return err - } - } - - // Check if there is repair progress to display - if rp.Progress.RepairProgress != nil { - fmt.Fprintf(w, "\nPost-restore repair progress\n") - - repairRunPr := &models.TaskRunRepairProgress{ - Progress: rp.Progress.RepairProgress, - Run: rp.Run, - } - repairPr := RepairProgress{ - TaskRunRepairProgress: repairRunPr, - Task: rp.Task, - Detailed: rp.Detailed, - keyspaceFilter: rp.KeyspaceFilter, - } - - if err := repairPr.Render(w); err != nil { - return err - } - } - - rp.addViewProgress(w) - return nil -} - -func (rp RestoreProgress) addKeyspaceProgress(t *table.Table) { - t.AddRow("Keyspace", "Progress", "Size", "Success", "Downloaded", "Failed") - t.AddSeparator() - for _, ks := range rp.Progress.Keyspaces { - if rp.hideKeyspace(ks.Keyspace) { - continue - } - p := "-" - if len(ks.Tables) > 0 { - p = FormatRestoreProgress(ks.Size, ks.Restored, ks.Downloaded, ks.Failed) - } - t.AddRow(ks.Keyspace, p, - FormatSizeSuffix(ks.Size), - FormatSizeSuffix(ks.Restored), - FormatSizeSuffix(ks.Downloaded), - FormatSizeSuffix(ks.Failed), - ) - } - t.SetColumnAlignment(termtables.AlignRight, 1, 2, 3, 4, 5) -} - -func (rp RestoreProgress) addTableProgress(w io.Writer) error { - for _, ks := range rp.Progress.Keyspaces { - if rp.hideKeyspace(ks.Keyspace) { - continue - } - fmt.Fprintf(w, "\nKeyspace: %s\n", ks.Keyspace) - - t := table.New("Table", "Progress", "Size", "Success", "Downloaded", "Failed", "Started at", "Completed at", "tombstone_gc mode") - for i, tab := range ks.Tables { - if i > 0 { - t.AddSeparator() - } - - startedAt := strfmt.DateTime{} - completedAt := strfmt.DateTime{} - if tab.StartedAt != nil { - startedAt = *tab.StartedAt - } - if tab.CompletedAt != nil { - completedAt = *tab.CompletedAt - } - t.AddRow( - tab.Table, - FormatRestoreProgress(tab.Size, - tab.Restored, - tab.Downloaded, - tab.Failed), - FormatSizeSuffix(tab.Size), - FormatSizeSuffix(tab.Restored), - FormatSizeSuffix(tab.Downloaded), - FormatSizeSuffix(tab.Failed), - FormatTime(startedAt), - FormatTime(completedAt), - tab.TombstoneGc, - ) - } - t.SetColumnAlignment(termtables.AlignRight, 1, 2, 3, 4, 5) - if _, err := w.Write([]byte(t.String())); err != nil { - return err - } - } - return nil -} - -func (rp RestoreProgress) addViewProgress(w io.Writer) { - if len(rp.Progress.Views) == 0 { - return - } - - _, _ = fmt.Fprintf(w, "\nRestored views\n") - for _, v := range rp.Progress.Views { - if rp.Detailed { - _, _ = fmt.Fprintf(w, "View: %s.%s, Status: %s, Schema definition:\n %s\n", v.Keyspace, v.View, v.Status, v.CreateStmt) - } else { - _, _ = fmt.Fprintf(w, "View: %s.%s, Status: %s\n", v.Keyspace, v.View, v.Status) - } - } -} - -// ValidateBackupProgress prints validate_backup task progress. -type ValidateBackupProgress struct { - *models.TaskRunValidateBackupProgress - Task *Task - Detailed bool - - hostFilter inexlist.InExList -} - -// SetHostFilter adds filtering rules used for rendering for host details. -func (p *ValidateBackupProgress) SetHostFilter(filters []string) (err error) { - p.hostFilter, err = inexlist.ParseInExList(filters) - return -} - -func (p ValidateBackupProgress) hideHost(host string) bool { - if p.hostFilter.Size() > 0 { - return p.hostFilter.FirstMatch(host) == -1 - } - return false -} - -// Render implements Renderer interface. -func (p ValidateBackupProgress) Render(w io.Writer) error { - if err := p.addHeader(w); err != nil { - return err - } - if p.Detailed { - if err := p.addHostProgress(w); err != nil { - return err - } - } - - return nil -} - -var validateBackupProgressTemplate = `{{ with .Run -}} -Run: {{ .ID }} -Status: {{ .Status }} -{{- if .Cause }} -Cause: {{ FormatError .Cause }} - -{{- end }} -{{- if not (isZero .StartTime) }} -Start time: {{ FormatTime .StartTime }} -{{- end -}} -{{- if not (isZero .EndTime) }} -End time: {{ FormatTime .EndTime }} -{{- end }} -Duration: {{ FormatDuration .StartTime .EndTime }} -{{ end }} -{{ with progress -}} -Scanned files: {{ .ScannedFiles }} -Missing files: {{ .MissingFiles }} -Orphaned files: {{ .OrphanedFiles }} {{ if gt .OrphanedFiles 0 }}({{ FormatSizeSuffix .OrphanedBytes }}){{ end }} -{{- if gt .DeletedFiles 0 }} -Deleted files: {{ .DeletedFiles }} -{{- end }} -{{- if .BrokenSnapshots }} - -Broken snapshots: {{ range .BrokenSnapshots }} - - {{ . }} -{{- end }} -{{- end }} -{{- end }} -` - -func (p ValidateBackupProgress) addHeader(w io.Writer) error { - temp := template.Must(template.New("validate_backup_progress").Funcs(template.FuncMap{ - "isZero": isZero, - "FormatTime": FormatTime, - "FormatDuration": FormatDuration, - "FormatError": FormatError, - "FormatUploadProgress": FormatUploadProgress, - "FormatSizeSuffix": FormatSizeSuffix, - "progress": p.aggregatedProgress, - }).Parse(validateBackupProgressTemplate)) - return temp.Execute(w, p) -} - -func (p ValidateBackupProgress) aggregatedProgress() models.ValidateBackupProgress { - var a models.ValidateBackupProgress - - bs := strset.New() - for _, i := range p.Progress { - a.Manifests += i.Manifests - a.ScannedFiles += i.ScannedFiles - bs.Add(a.BrokenSnapshots...) - a.MissingFiles += i.MissingFiles - a.OrphanedFiles += i.OrphanedFiles - a.OrphanedBytes += i.OrphanedBytes - a.DeletedFiles += i.DeletedFiles - } - a.BrokenSnapshots = bs.List() - sort.Strings(a.BrokenSnapshots) - - return a -} - -func (p ValidateBackupProgress) addHostProgress(w io.Writer) error { - t := table.New( - "Host", - "Manifests", - "Scanned files", - "Missing files", - "Orphaned files", - "Orphaned bytes", - "Deleted files", - ) - t.SetColumnAlignment(termtables.AlignRight, 1, 2, 3, 4, 5, 6, 7) - lastLocation := "" - - fmt.Fprintln(w) - for _, hp := range p.Progress { - if hp.Location != lastLocation { - if t.Size() > 0 { - fmt.Fprintf(w, "Location: %s\n%s\n", lastLocation, t) - } - t.Reset() - lastLocation = hp.Location - } - if p.hideHost(hp.Host) { - continue - } - t.AddRow( - hp.Host, - hp.Manifests, - hp.ScannedFiles, - hp.MissingFiles, - hp.OrphanedFiles, - FormatSizeSuffix(hp.OrphanedBytes), - hp.DeletedFiles, - ) - } - if t.Size() > 0 { - fmt.Fprintf(w, "Location: %s\n%s\n", lastLocation, t) - } - - return nil -} - -// BackupListItems is a []backup.ListItem representation. -type BackupListItems struct { - items []*models.BackupListItem - AllClusters bool - ShowTables int -} - -const backupListItemTemplate = `backup/{{ .TaskID }} -Snapshots: -{{- range .SnapshotInfo }} - - {{ .SnapshotTag }} ({{ if eq .Size 0 }}n/a{{ else }}{{ FormatSizeSuffix .Size }}{{ end }}, {{ .Nodes }} nodes) -{{- end }} -Keyspaces: -{{- range .Units }} - - {{ .Keyspace }} {{ FormatTables .Tables .AllTables }} -{{- end }} - -` - -// Render implements Renderer interface. -func (bl BackupListItems) Render(w io.Writer) error { - temp := template.Must(template.New("backup_list_items").Funcs(template.FuncMap{ - "FormatTables": func(tables []string, all bool) string { - return FormatTables(bl.ShowTables, tables, all) - }, - "FormatSizeSuffix": FormatSizeSuffix, - }).Parse(backupListItemTemplate)) - - prev := "" - for _, i := range bl.items { - if bl.AllClusters { - if prev != i.ClusterID { - prev = i.ClusterID - fmt.Fprintln(w, "Cluster:", i.ClusterID) - fmt.Fprintln(w) - } - } - if err := temp.Execute(w, i); err != nil { - return err - } - } - return nil -} - -func formatLabels(labels map[string]string) string { - var out []string - for k, v := range labels { - out = append(out, k+"="+v) - } - return strings.Join(out, ", ") -} diff --git a/pkg/ping/cqlping/cqlping_test.go b/pkg/ping/cqlping/cqlping_test.go index c65faea7da..7d7cae7869 100644 --- a/pkg/ping/cqlping/cqlping_test.go +++ b/pkg/ping/cqlping/cqlping_test.go @@ -4,13 +4,14 @@ package cqlping import ( "context" - "github.com/scylladb/go-log" "net" "testing" "time" + "github.com/scylladb/go-log" + "github.com/scylladb/scylla-manager/v3/pkg/util" + "github.com/scylladb/scylla-manager/v3/pkg/ping" - "github.com/scylladb/scylla-manager/v3/pkg/testutils" ) func TestPingTimeout(t *testing.T) { @@ -47,7 +48,7 @@ func TestPingTimeout(t *testing.T) { if err != ping.ErrTimeout { t.Errorf("NativeCQLPing() error %s, expected timeout", err) } - if a, b := testutils.EpsilonRange(config.Timeout); d < a || d > b { + if a, b := util.EpsilonRange(config.Timeout); d < a || d > b { t.Errorf("NativeCQLPing() not within expected time margin %v got %v", config.Timeout, d) } }) @@ -57,7 +58,7 @@ func TestPingTimeout(t *testing.T) { if err != ping.ErrTimeout { t.Errorf("QueryPing() error %s, expected timeout", err) } - if a, b := testutils.EpsilonRange(config.Timeout); d < a || d > b { + if a, b := util.EpsilonRange(config.Timeout); d < a || d > b { t.Errorf("QueryPing() not within expected time margin %v got %v", config.Timeout, d) } }) diff --git a/pkg/restapi/error.go b/pkg/restapi/error.go index 917adc3b37..2178f98f91 100644 --- a/pkg/restapi/error.go +++ b/pkg/restapi/error.go @@ -9,7 +9,7 @@ import ( "github.com/go-chi/render" "github.com/pkg/errors" "github.com/scylladb/go-log" - "github.com/scylladb/scylla-manager/v3/pkg/service" + "github.com/scylladb/scylla-manager/v3/pkg/util" ) // httpError is a wrapper holding an error, HTTP status code and a user-facing @@ -38,14 +38,14 @@ func respondError(w http.ResponseWriter, r *http.Request, err error, details ... cause := errors.Cause(err) switch { - case cause == service.ErrNotFound: + case cause == util.ErrNotFound: render.Respond(w, r, &httpError{ StatusCode: http.StatusNotFound, Details: strings.Join(details, "\n\n"), Message: errors.Wrap(err, "get resource").Error(), TraceID: log.TraceID(r.Context()), }) - case service.IsErrValidate(cause): + case util.IsErrValidate(cause): render.Respond(w, r, &httpError{ StatusCode: http.StatusBadRequest, Details: strings.Join(details, "\n\n"), diff --git a/pkg/restapi/error_test.go b/pkg/restapi/error_test.go index 0221f78305..e33dd504fb 100644 --- a/pkg/restapi/error_test.go +++ b/pkg/restapi/error_test.go @@ -9,7 +9,7 @@ import ( "github.com/gocql/gocql" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" - "github.com/scylladb/scylla-manager/v3/pkg/service" + "github.com/scylladb/scylla-manager/v3/pkg/util" ) func TestRespondError(t *testing.T) { @@ -30,7 +30,7 @@ func TestRespondError(t *testing.T) { }) t.Run("validation", func(t *testing.T) { - err := service.ErrValidate(errors.New("some problem")) + err := util.ErrValidate(errors.New("some problem")) response := httptest.NewRecorder() respondError(response, request, errors.Wrap(err, "specific_msg")) diff --git a/pkg/util/httphandler/heartbeat.go b/pkg/restapi/heartbeat.go similarity index 91% rename from pkg/util/httphandler/heartbeat.go rename to pkg/restapi/heartbeat.go index ac14dcbca6..11cb1e906b 100644 --- a/pkg/util/httphandler/heartbeat.go +++ b/pkg/restapi/heartbeat.go @@ -1,6 +1,6 @@ // Copyright (C) 2017 ScyllaDB -package httphandler +package restapi import "net/http" diff --git a/pkg/restapi/mock_schedservice_test.go b/pkg/restapi/mock_schedservice_test.go index aa8af3c836..7f7b2c3b1c 100644 --- a/pkg/restapi/mock_schedservice_test.go +++ b/pkg/restapi/mock_schedservice_test.go @@ -6,10 +6,11 @@ package restapi import ( context "context" + reflect "reflect" + gomock "github.com/golang/mock/gomock" scheduler "github.com/scylladb/scylla-manager/v3/pkg/service/scheduler" uuid "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" - reflect "reflect" ) // MockSchedService is a mock of SchedService interface diff --git a/pkg/restapi/repair.go b/pkg/restapi/repair.go index 8930ce645e..aeb5ec808c 100644 --- a/pkg/restapi/repair.go +++ b/pkg/restapi/repair.go @@ -7,7 +7,7 @@ import ( "strconv" "github.com/go-chi/chi/v5" - "github.com/scylladb/scylla-manager/v3/pkg/service" + "github.com/scylladb/scylla-manager/v3/pkg/util" ) type repairHandler struct { @@ -35,7 +35,7 @@ func (h repairHandler) intensity(r *http.Request) (float64, error) { // Read intensity from the request if v := r.FormValue("intensity"); v != "" { if intensity, err = strconv.ParseFloat(v, 64); err != nil { - return 0, service.ErrValidate(err) + return 0, util.ErrValidate(err) } } @@ -51,7 +51,7 @@ func (h repairHandler) parallel(r *http.Request) (int64, error) { // Read parallel value from the request if v := r.FormValue("parallel"); v != "" { if parallel, err = strconv.ParseInt(v, 10, 64); err != nil { - return parallel, service.ErrValidate(err) + return parallel, util.ErrValidate(err) } } diff --git a/pkg/restapi/repair_test.go b/pkg/restapi/repair_test.go index b4455e22c7..be8042e18f 100644 --- a/pkg/restapi/repair_test.go +++ b/pkg/restapi/repair_test.go @@ -12,7 +12,7 @@ import ( "github.com/golang/mock/gomock" "github.com/scylladb/go-log" "github.com/scylladb/scylla-manager/v3/pkg/restapi" - "github.com/scylladb/scylla-manager/v3/pkg/service" + "github.com/scylladb/scylla-manager/v3/pkg/util" "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" ) @@ -70,7 +70,7 @@ func TestRepairSetIntensity(t *testing.T) { t.Run("not found when service returns not found error intensity", func(t *testing.T) { cm.EXPECT().GetCluster(gomock.Any(), cluster.ID.String()).Return(cluster, nil) - rm.EXPECT().SetIntensity(gomock.Any(), cluster.ID, intensity).Return(service.ErrNotFound) + rm.EXPECT().SetIntensity(gomock.Any(), cluster.ID, intensity).Return(util.ErrNotFound) r := updateIntensityRequest(cluster.ID, intensity) w := httptest.NewRecorder() @@ -95,7 +95,7 @@ func TestRepairSetIntensity(t *testing.T) { t.Run("not found when service returns not found error parallel", func(t *testing.T) { cm.EXPECT().GetCluster(gomock.Any(), cluster.ID.String()).Return(cluster, nil) - rm.EXPECT().SetParallel(gomock.Any(), cluster.ID, parallel).Return(service.ErrNotFound) + rm.EXPECT().SetParallel(gomock.Any(), cluster.ID, parallel).Return(util.ErrNotFound) r := updateParallelRequest(cluster.ID, parallel) w := httptest.NewRecorder() diff --git a/pkg/restapi/restapi.go b/pkg/restapi/restapi.go index 03fe42af83..2459356322 100644 --- a/pkg/restapi/restapi.go +++ b/pkg/restapi/restapi.go @@ -12,9 +12,7 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/scylladb/go-log" "github.com/scylladb/scylla-manager/v3/pkg/scyllaclient" - "github.com/scylladb/scylla-manager/v3/pkg/util/httphandler" "github.com/scylladb/scylla-manager/v3/pkg/util/httplog" - "github.com/scylladb/scylla-manager/v3/swagger-ui" ) func init() { @@ -33,13 +31,9 @@ func New(services Services, logger log.Logger) http.Handler { middleware.Recoverer, ) - // Swagger UI - r.Handle("/ui", http.RedirectHandler("/ui/", http.StatusMovedPermanently)) - r.Mount("/ui/", http.StripPrefix("/ui/", http.FileServer(http.FS(swagger.UI())))) - - r.Get("/ping", httphandler.Heartbeat()) - r.Get("/version", httphandler.Version()) - r.Get("/api/v1/version", httphandler.Version()) // For backwards compatibility + r.Get("/ping", Heartbeat()) + r.Get("/version", Version()) + r.Get("/api/v1/version", Version()) // For backwards compatibility r.Mount("/api/v1/", newClusterHandler(services.Cluster)) f := clusterFilter{svc: services.Cluster}.clusterCtx diff --git a/pkg/restapi/task.go b/pkg/restapi/task.go index e5af12e1f5..1dac5bc6f0 100644 --- a/pkg/restapi/task.go +++ b/pkg/restapi/task.go @@ -14,11 +14,11 @@ import ( "github.com/go-chi/render" "github.com/pkg/errors" "github.com/scylladb/scylla-manager/v3/pkg/scyllaclient" - "github.com/scylladb/scylla-manager/v3/pkg/service" "github.com/scylladb/scylla-manager/v3/pkg/service/backup" "github.com/scylladb/scylla-manager/v3/pkg/service/repair" "github.com/scylladb/scylla-manager/v3/pkg/service/restore" "github.com/scylladb/scylla-manager/v3/pkg/service/scheduler" + "github.com/scylladb/scylla-manager/v3/pkg/util" "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" ) @@ -453,7 +453,7 @@ func (h *taskHandler) taskRunProgress(w http.ResponseWriter, r *http.Request) { return } else if n >= 0 { prog.Run, err = h.Scheduler.GetNthLastRun(r.Context(), t, n) - if n == 0 && errors.Is(err, service.ErrNotFound) { + if n == 0 && errors.Is(err, util.ErrNotFound) { prog.Run = &scheduler.Run{ ClusterID: t.ClusterID, Type: t.Type, @@ -512,7 +512,7 @@ func (h *taskHandler) taskRunProgress(w http.ResponseWriter, r *http.Request) { // If we can't find any repair progress reference then just return what we have (prog.Run). // prog.Progress is assigned separately to force nil on the returned value instead of an empty object. // This is required for correct JSON representation and detection if Progress is empty. - if !errors.Is(err, service.ErrNotFound) { + if !errors.Is(err, util.ErrNotFound) { respondError(w, r, errors.Wrapf(err, "load progress for task %q", t.ID)) return } diff --git a/pkg/restapi/version.go b/pkg/restapi/version.go new file mode 100644 index 0000000000..ab01ea67e2 --- /dev/null +++ b/pkg/restapi/version.go @@ -0,0 +1,21 @@ +// Copyright (C) 2017 ScyllaDB + +package restapi + +import ( + "net/http" + + "github.com/go-chi/render" + "github.com/scylladb/scylla-manager/v3/pkg" +) + +type version struct { + Version string `json:"version"` +} + +// Version responds with application version. +func Version() http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + render.Respond(w, r, version{Version: pkg.Version()}) + } +} diff --git a/pkg/util/httphandler/version_test.go b/pkg/restapi/version_test.go similarity index 96% rename from pkg/util/httphandler/version_test.go rename to pkg/restapi/version_test.go index 4e0d1c11f7..112425465b 100644 --- a/pkg/util/httphandler/version_test.go +++ b/pkg/restapi/version_test.go @@ -1,6 +1,6 @@ // Copyright (C) 2017 ScyllaDB -package httphandler +package restapi import ( "encoding/json" diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go index c267857559..8f3c60f761 100644 --- a/pkg/scheduler/scheduler.go +++ b/pkg/scheduler/scheduler.go @@ -9,6 +9,7 @@ import ( "time" "github.com/scylladb/scylla-manager/v3/pkg/util/retry" + "github.com/scylladb/scylla-manager/v3/pkg/util/schedules" ) // Properties are externally defined task parameters. @@ -52,17 +53,10 @@ func newRunContext[K comparable](key K, properties Properties, stop time.Time) ( // Compatible functions can be passed to Scheduler constructor. type RunFunc[K comparable] func(ctx RunContext[K]) error -// Trigger provides the next activation date. -// Implementations must return the same values for the same now parameter. -// A zero time can be returned to indicate no more executions. -type Trigger interface { - Next(now time.Time) time.Time -} - // Details holds Properties, Trigger and auxiliary Key configuration. type Details struct { Properties Properties - Trigger Trigger + Trigger schedules.Trigger Backoff retry.Backoff Window Window Location *time.Location diff --git a/pkg/scheduler/scheduler_test.go b/pkg/scheduler/scheduler_test.go index a19c22f090..d38f63dd4e 100644 --- a/pkg/scheduler/scheduler_test.go +++ b/pkg/scheduler/scheduler_test.go @@ -11,6 +11,7 @@ import ( "github.com/scylladb/go-log" "github.com/scylladb/scylla-manager/v3/pkg/util/retry" + "github.com/scylladb/scylla-manager/v3/pkg/util/schedules" "github.com/scylladb/scylla-manager/v3/pkg/util/timeutc" "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" "go.uber.org/atomic" @@ -170,7 +171,7 @@ func (f fakeTrigger) Next(now time.Time) time.Time { return time.Time{} } -func details(t Trigger) Details { +func details(t schedules.Trigger) Details { return Details{ Trigger: t, } diff --git a/pkg/scheduler/trigger/cron.go b/pkg/scheduler/trigger/cron.go deleted file mode 100644 index 5dcb9e6547..0000000000 --- a/pkg/scheduler/trigger/cron.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2017 ScyllaDB - -package trigger - -import ( - "github.com/robfig/cron/v3" - "github.com/scylladb/scylla-manager/v3/pkg/scheduler" -) - -var cronParser = cron.NewParser(cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor) - -// NewCron returns a cron Trigger for a given spec. -func NewCron(spec string) (scheduler.Trigger, error) { - return cronParser.Parse(spec) -} diff --git a/pkg/scheduler/trigger/legacy.go b/pkg/scheduler/trigger/legacy.go deleted file mode 100644 index 6ed4e773ee..0000000000 --- a/pkg/scheduler/trigger/legacy.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2017 ScyllaDB - -package trigger - -import ( - "time" - - "github.com/scylladb/scylla-manager/v3/pkg/scheduler" -) - -type legacy struct { - startDate time.Time - interval time.Duration -} - -// NewLegacy returns Trigger based on interval duration that was used in -// Scylla Manager 2.x and before. -func NewLegacy(startDate time.Time, interval time.Duration) scheduler.Trigger { - return legacy{startDate: startDate, interval: interval} -} - -func (l legacy) Next(now time.Time) time.Time { - if l.startDate.After(now) { - return l.startDate - } - if l.interval == 0 { - return time.Time{} - } - lastStart := l.startDate.Add(now.Sub(l.startDate).Round(l.interval)) - for lastStart.Before(now) { - lastStart = lastStart.Add(l.interval) - } - return lastStart -} diff --git a/pkg/scheduler/trigger/multi.go b/pkg/scheduler/trigger/multi.go deleted file mode 100644 index 50cd0acab0..0000000000 --- a/pkg/scheduler/trigger/multi.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2017 ScyllaDB - -package trigger - -import ( - "time" - - "github.com/scylladb/scylla-manager/v3/pkg/scheduler" -) - -type multi []scheduler.Trigger - -// NewMulti returns a trigger that joins multiple triggers. -func NewMulti(t ...scheduler.Trigger) scheduler.Trigger { - return multi(t) -} - -func (m multi) Next(now time.Time) time.Time { - var min time.Time - for _, t := range m { - next := t.Next(now) - if min.IsZero() { - min = next - } else if !next.IsZero() && next.Before(min) { - min = next - } - } - return min -} diff --git a/pkg/scheduler/trigger/once.go b/pkg/scheduler/trigger/once.go deleted file mode 100644 index 6eef8ab529..0000000000 --- a/pkg/scheduler/trigger/once.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2017 ScyllaDB - -package trigger - -import ( - "time" - - "github.com/scylladb/scylla-manager/v3/pkg/scheduler" - "go.uber.org/atomic" -) - -type once struct { - v *atomic.Bool -} - -// NewOnce creates a trigger that fires once at a specified time. -// There is a sub second threshold to enable starting once now. -func NewOnce() scheduler.Trigger { - return once{ - v: atomic.NewBool(false), - } -} - -func (o once) Next(now time.Time) time.Time { - if o.v.CAS(false, true) { - return now - } - return time.Time{} -} diff --git a/pkg/service/backup/backup_test.go b/pkg/service/backup/backup_test.go index 133c2dd180..db5d342247 100644 --- a/pkg/service/backup/backup_test.go +++ b/pkg/service/backup/backup_test.go @@ -140,3 +140,13 @@ func TestFilterDCLimit(t *testing.T) { }) } } + +//func TestBackupStageName(t *testing.T) { +// t.Parallel() +// +// for _, s := range backup.StageOrder() { +// if s != backup.StageDone && managerclient.BackupStageName(string(s)) == "" { +// t.Errorf("%s.Name() is empty", s) +// } +// } +//} diff --git a/pkg/service/backup/config.go b/pkg/service/backup/config.go index f81e17775e..46ab1714b5 100644 --- a/pkg/service/backup/config.go +++ b/pkg/service/backup/config.go @@ -6,7 +6,7 @@ import ( "time" "github.com/pkg/errors" - "github.com/scylladb/scylla-manager/v3/pkg/service" + "github.com/scylladb/scylla-manager/v3/pkg/util" "go.uber.org/multierr" ) @@ -27,7 +27,7 @@ func DefaultConfig() Config { func (c *Config) Validate() error { if c == nil { - return service.ErrNilPtr + return util.ErrNilPtr } var err error diff --git a/pkg/service/backup/service.go b/pkg/service/backup/service.go index 0a7b9044e6..f16a0c2732 100644 --- a/pkg/service/backup/service.go +++ b/pkg/service/backup/service.go @@ -20,10 +20,10 @@ import ( "github.com/scylladb/scylla-manager/v3/pkg/metrics" "github.com/scylladb/scylla-manager/v3/pkg/schema/table" "github.com/scylladb/scylla-manager/v3/pkg/scyllaclient" - "github.com/scylladb/scylla-manager/v3/pkg/service" . "github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec" "github.com/scylladb/scylla-manager/v3/pkg/service/cluster" "github.com/scylladb/scylla-manager/v3/pkg/service/scheduler" + "github.com/scylladb/scylla-manager/v3/pkg/util" "github.com/scylladb/scylla-manager/v3/pkg/util/inexlist/dcfilter" "github.com/scylladb/scylla-manager/v3/pkg/util/inexlist/ksfilter" "github.com/scylladb/scylla-manager/v3/pkg/util/jsonutil" @@ -124,7 +124,7 @@ func (s *Service) targetFromProperties(ctx context.Context, clusterID uuid.UUID, p := defaultTaskProperties() if err := json.Unmarshal(properties, &p); err != nil { - return Target{}, service.ErrValidate(err) + return Target{}, util.ErrValidate(err) } client, err := s.scyllaClient(ctx, clusterID) @@ -253,7 +253,7 @@ func (s *Service) checkLocationsAvailableFromNodes(ctx context.Context, client * } // Run checkHostLocation in parallel - return service.ErrValidate(parallel.Run(len(nodes), parallel.NoLimit, f, notify)) + return util.ErrValidate(parallel.Run(len(nodes), parallel.NoLimit, f, notify)) } func (s *Service) checkHostLocation(ctx context.Context, client *scyllaclient.Client, h string, l Location) error { @@ -461,7 +461,7 @@ func (s *Service) ListFiles(ctx context.Context, clusterID uuid.UUID, locations func (s *Service) forEachManifest(ctx context.Context, clusterID uuid.UUID, locations []Location, filter ListFilter, f func(ManifestInfoWithContent) error) error { // Validate inputs if len(locations) == 0 { - return service.ErrValidate(errors.New("empty locations")) + return util.ErrValidate(errors.New("empty locations")) } // Get the cluster client @@ -815,7 +815,7 @@ func (s *Service) Backup(ctx context.Context, clusterID, taskID, runID uuid.UUID // sets PrevID on the given run. func (s *Service) decorateWithPrevRun(ctx context.Context, run *Run) error { prev, err := s.GetLastResumableRun(ctx, run.ClusterID, run.TaskID) - if errors.Is(err, service.ErrNotFound) { + if errors.Is(err, util.ErrNotFound) { return nil } if err != nil { @@ -905,7 +905,7 @@ func (s *Service) GetLastResumableRun(ctx context.Context, clusterID, taskID uui } } - return nil, service.ErrNotFound + return nil, util.ErrNotFound } // putRun upserts a backup run. @@ -1101,7 +1101,7 @@ func (s *Service) DeleteSnapshot(ctx context.Context, clusterID uuid.UUID, locat } if deletedManifests.Load() == 0 { - return service.ErrNotFound + return util.ErrNotFound } return nil diff --git a/pkg/service/backup/service_backup_integration_test.go b/pkg/service/backup/service_backup_integration_test.go index 4709fb54f6..1fc1f97679 100644 --- a/pkg/service/backup/service_backup_integration_test.go +++ b/pkg/service/backup/service_backup_integration_test.go @@ -28,13 +28,13 @@ import ( "github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v2/qb" "github.com/scylladb/scylla-manager/v3/pkg/service/cluster" + "github.com/scylladb/scylla-manager/v3/pkg/util" "go.uber.org/atomic" "go.uber.org/zap/zapcore" "github.com/scylladb/scylla-manager/v3/pkg/metrics" "github.com/scylladb/scylla-manager/v3/pkg/schema/table" "github.com/scylladb/scylla-manager/v3/pkg/scyllaclient" - "github.com/scylladb/scylla-manager/v3/pkg/service" "github.com/scylladb/scylla-manager/v3/pkg/service/backup" . "github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec" . "github.com/scylladb/scylla-manager/v3/pkg/testutils" @@ -567,7 +567,7 @@ func TestGetLastResumableRunIntegration(t *testing.T) { putRun(t, r1) _, err := h.service.GetLastResumableRun(ctx, clusterID, taskID) - if !errors.Is(err, service.ErrNotFound) { + if !errors.Is(err, util.ErrNotFound) { t.Fatal(err) } }) @@ -597,7 +597,7 @@ func TestGetLastResumableRunIntegration(t *testing.T) { putRun(t, r1) _, err := h.service.GetLastResumableRun(ctx, clusterID, taskID) - if !errors.Is(err, service.ErrNotFound) { + if !errors.Is(err, util.ErrNotFound) { t.Fatal(err) } }) diff --git a/pkg/service/backup/validation.go b/pkg/service/backup/validation.go index 21c47d3b64..a547653065 100644 --- a/pkg/service/backup/validation.go +++ b/pkg/service/backup/validation.go @@ -16,9 +16,9 @@ import ( "github.com/scylladb/go-set/strset" "github.com/scylladb/scylla-manager/v3/pkg/schema/table" "github.com/scylladb/scylla-manager/v3/pkg/scyllaclient" - "github.com/scylladb/scylla-manager/v3/pkg/service" . "github.com/scylladb/scylla-manager/v3/pkg/service/backup/backupspec" "github.com/scylladb/scylla-manager/v3/pkg/service/scheduler" + "github.com/scylladb/scylla-manager/v3/pkg/util" "github.com/scylladb/scylla-manager/v3/pkg/util/jsonutil" "github.com/scylladb/scylla-manager/v3/pkg/util/parallel" "github.com/scylladb/scylla-manager/v3/pkg/util/pointer" @@ -319,10 +319,10 @@ func (s *Service) checkValidationTarget(ctx context.Context, client *scyllaclien // Validate locations access if len(liveNodes) == 0 { - return nil, service.ErrValidate(errors.Errorf("wrong location")) + return nil, util.ErrValidate(errors.Errorf("wrong location")) } if err := s.checkLocationsAvailableFromNodes(ctx, client, liveNodes, target.Location); err != nil { - return nil, service.ErrValidate(errors.Wrap(err, "location is not accessible")) + return nil, util.ErrValidate(errors.Wrap(err, "location is not accessible")) } return liveNodes, nil diff --git a/pkg/service/cluster/model.go b/pkg/service/cluster/model.go index c916ad5d69..38e795279b 100644 --- a/pkg/service/cluster/model.go +++ b/pkg/service/cluster/model.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" "github.com/scylladb/go-set/strset" - "github.com/scylladb/scylla-manager/v3/pkg/service" + "github.com/scylladb/scylla-manager/v3/pkg/util" "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" "go.uber.org/multierr" ) @@ -45,7 +45,7 @@ func (c *Cluster) String() string { func (c *Cluster) Validate() error { if c == nil { - return errors.Wrap(service.ErrNilPtr, "invalid filter") + return errors.Wrap(util.ErrNilPtr, "invalid filter") } var errs error @@ -69,7 +69,7 @@ func (c *Cluster) Validate() error { errs = multierr.Append(errs, errors.Wrap(err, "invalid SSL user key pair")) } - return service.ErrValidate(errors.Wrap(errs, "invalid cluster")) + return util.ErrValidate(errors.Wrap(errs, "invalid cluster")) } // AllHosts returns KnownHosts with Host at the front and without duplicates. @@ -89,7 +89,7 @@ type Filter struct { func (f *Filter) Validate() error { if f == nil { - return service.ErrNilPtr + return util.ErrNilPtr } var err error diff --git a/pkg/service/cluster/service.go b/pkg/service/cluster/service.go index 19a46076cb..1bddb1db26 100644 --- a/pkg/service/cluster/service.go +++ b/pkg/service/cluster/service.go @@ -20,8 +20,8 @@ import ( "github.com/scylladb/scylla-manager/v3/pkg/schema/table" "github.com/scylladb/scylla-manager/v3/pkg/scyllaclient" "github.com/scylladb/scylla-manager/v3/pkg/secrets" - "github.com/scylladb/scylla-manager/v3/pkg/service" "github.com/scylladb/scylla-manager/v3/pkg/store" + "github.com/scylladb/scylla-manager/v3/pkg/util" "github.com/scylladb/scylla-manager/v3/pkg/util/logutil" "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" "go.uber.org/multierr" @@ -293,7 +293,7 @@ func (s *Service) GetClusterByName(ctx context.Context, name string) (*Cluster, switch len(clusters) { case 0: - return nil, service.ErrNotFound + return nil, util.ErrNotFound case 1: return clusters[0], nil default: @@ -322,7 +322,7 @@ func (s *Service) GetClusterName(ctx context.Context, id uuid.UUID) (string, err func (s *Service) PutCluster(ctx context.Context, c *Cluster) (err error) { s.logger.Debug(ctx, "PutCluster", "cluster", c) if c == nil { - return service.ErrNilPtr + return util.ErrNilPtr } t := Update @@ -337,7 +337,7 @@ func (s *Service) PutCluster(ctx context.Context, c *Cluster) (err error) { // User may set ID on his own _, err := s.GetClusterByID(ctx, c.ID) if err != nil { - if !errors.Is(err, service.ErrNotFound) { + if !errors.Is(err, util.ErrNotFound) { return err } t = Create @@ -358,12 +358,12 @@ func (s *Service) PutCluster(ctx context.Context, c *Cluster) (err error) { // Check for conflicting cluster names. if c.Name != "" { conflict, err := s.GetClusterByName(ctx, c.Name) - if !errors.Is(err, service.ErrNotFound) { + if !errors.Is(err, util.ErrNotFound) { if err != nil { return err } if conflict.ID != c.ID { - return service.ErrValidate(errors.Errorf("name %q is already taken", c.Name)) + return util.ErrValidate(errors.Errorf("name %q is already taken", c.Name)) } } } @@ -489,7 +489,7 @@ func (s *Service) validateHostsConnectivity(ctx context.Context, c *Cluster) err } live := status.Live().Hosts() if len(live) == 0 { - return service.ErrValidate(errors.New("no live nodes")) + return util.ErrValidate(errors.New("no live nodes")) } var errs error @@ -497,7 +497,7 @@ func (s *Service) validateHostsConnectivity(ctx context.Context, c *Cluster) err errs = multierr.Append(errs, errors.Wrap(err, live[i])) } if errs != nil { - return service.ErrValidate(errors.Wrap(errs, "connectivity check")) + return util.ErrValidate(errors.Wrap(errs, "connectivity check")) } return nil } @@ -657,7 +657,7 @@ func (s *Service) extendClusterConfigWithAuthentication(clusterID uuid.UUID, ni ClusterID: clusterID, } err := s.secretsStore.Get(&credentials) - if errors.Is(err, service.ErrNotFound) { + if errors.Is(err, util.ErrNotFound) { return ErrNoCQLCredentials } if err != nil { @@ -710,7 +710,7 @@ func (s *Service) loadTLSIdentity(clusterID uuid.UUID) (tls.Certificate, error) ClusterID: clusterID, } err := s.secretsStore.Get(&tlsIdentity) - if errors.Is(err, service.ErrNotFound) { + if errors.Is(err, util.ErrNotFound) { return tls.Certificate{}, errors.Wrap(err, "TLS/SSL key/cert is not registered") } if err != nil { diff --git a/pkg/service/cluster/service_integration_test.go b/pkg/service/cluster/service_integration_test.go index 5d324f8b48..10c2c9fada 100644 --- a/pkg/service/cluster/service_integration_test.go +++ b/pkg/service/cluster/service_integration_test.go @@ -18,12 +18,12 @@ import ( "github.com/scylladb/go-log" "github.com/scylladb/scylla-manager/v3/pkg/config/server" . "github.com/scylladb/scylla-manager/v3/pkg/testutils/testconfig" + "github.com/scylladb/scylla-manager/v3/pkg/util" "github.com/scylladb/scylla-manager/v3/pkg/metrics" "github.com/scylladb/scylla-manager/v3/pkg/schema/table" "github.com/scylladb/scylla-manager/v3/pkg/scyllaclient" "github.com/scylladb/scylla-manager/v3/pkg/secrets" - "github.com/scylladb/scylla-manager/v3/pkg/service" "github.com/scylladb/scylla-manager/v3/pkg/service/cluster" "github.com/scylladb/scylla-manager/v3/pkg/store" . "github.com/scylladb/scylla-manager/v3/pkg/testutils" @@ -173,7 +173,7 @@ func TestServiceStorageIntegration(t *testing.T) { setup(t) c, err := s.GetClusterByID(ctx, uuid.MustRandom()) - if !errors.Is(err, service.ErrNotFound) { + if !errors.Is(err, util.ErrNotFound) { t.Fatal("expected not found") } if c != nil { @@ -405,13 +405,13 @@ func TestServiceStorageIntegration(t *testing.T) { cqlCreds := &secrets.CQLCreds{ ClusterID: c.ID, } - if err := secretsStore.Get(cqlCreds); !errors.Is(err, service.ErrNotFound) { + if err := secretsStore.Get(cqlCreds); !errors.Is(err, util.ErrNotFound) { t.Fatal(err) } tlsIdentity := &secrets.TLSIdentity{ ClusterID: c.ID, } - if err := secretsStore.Get(tlsIdentity); !errors.Is(err, service.ErrNotFound) { + if err := secretsStore.Get(tlsIdentity); !errors.Is(err, util.ErrNotFound) { t.Fatal(err) } }) @@ -432,7 +432,7 @@ func TestServiceStorageIntegration(t *testing.T) { cqlCreds := &secrets.CQLCreds{ ClusterID: c.ID, } - if err := secretsStore.Get(cqlCreds); !errors.Is(err, service.ErrNotFound) { + if err := secretsStore.Get(cqlCreds); !errors.Is(err, util.ErrNotFound) { t.Fatal(err) } }) @@ -453,7 +453,7 @@ func TestServiceStorageIntegration(t *testing.T) { tlsIdentity := &secrets.TLSIdentity{ ClusterID: c.ID, } - if err := secretsStore.Get(tlsIdentity); !errors.Is(err, service.ErrNotFound) { + if err := secretsStore.Get(tlsIdentity); !errors.Is(err, util.ErrNotFound) { t.Fatal(err) } }) @@ -521,7 +521,7 @@ func TestServiceStorageIntegration(t *testing.T) { if err := s.DeleteCluster(ctx, c.ID); err != nil { t.Fatal(err) } - if _, err := s.GetClusterByID(ctx, c.ID); !errors.Is(err, service.ErrNotFound) { + if _, err := s.GetClusterByID(ctx, c.ID); !errors.Is(err, util.ErrNotFound) { t.Fatal(err) } if change.ID != c.ID { diff --git a/pkg/service/configcache/tlsconfig.go b/pkg/service/configcache/tlsconfig.go index 6e229ac1f4..a0d3613389 100644 --- a/pkg/service/configcache/tlsconfig.go +++ b/pkg/service/configcache/tlsconfig.go @@ -8,9 +8,9 @@ import ( "github.com/pkg/errors" "github.com/scylladb/scylla-manager/v3/pkg/scyllaclient" "github.com/scylladb/scylla-manager/v3/pkg/secrets" - "github.com/scylladb/scylla-manager/v3/pkg/service" "github.com/scylladb/scylla-manager/v3/pkg/service/cluster" "github.com/scylladb/scylla-manager/v3/pkg/store" + "github.com/scylladb/scylla-manager/v3/pkg/util" ) // TLSConfigWithAddress is a concatenation of tls.Config and Address. @@ -76,7 +76,7 @@ func prepareCertificates(c *cluster.Cluster, secretsStore store.Store) (cert tls ClusterID: c.ID, } if err := secretsStore.Get(id); err != nil { - if !errors.Is(err, service.ErrNotFound) { + if !errors.Is(err, util.ErrNotFound) { return tls.Certificate{}, errors.Wrap(err, "fetch TLS config") } return tls.Certificate{}, errors.Wrap(err, "client encryption is enabled, but certificate is missing") diff --git a/pkg/service/errors.go b/pkg/service/errors.go deleted file mode 100644 index c701ff9e14..0000000000 --- a/pkg/service/errors.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2017 ScyllaDB - -package service - -import ( - "github.com/gocql/gocql" - "github.com/pkg/errors" -) - -// Common errors. -var ( - ErrNotFound = gocql.ErrNotFound - ErrNilPtr = errors.New("nil") -) - -// errValidate is a validation error caused by inner error. -type errValidate struct { // nolint: errname - err error -} - -// ErrValidate marks error as a validation error, if err is not nil. -func ErrValidate(err error) error { - if err == nil { - return nil - } - return errValidate{err: err} -} - -// IsErrValidate checks if given error is a validation error. -func IsErrValidate(err error) bool { - _, ok := err.(errValidate) // nolint: errorlint - return ok -} - -// Error implements error. -func (e errValidate) Error() string { - return e.err.Error() -} diff --git a/pkg/service/healthcheck/runner.go b/pkg/service/healthcheck/runner.go index 38558a0c36..fb4dbff213 100644 --- a/pkg/service/healthcheck/runner.go +++ b/pkg/service/healthcheck/runner.go @@ -11,10 +11,10 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/scylladb/go-log" "github.com/scylladb/scylla-manager/v3/pkg/service/configcache" + "github.com/scylladb/scylla-manager/v3/pkg/util" "github.com/scylladb/scylla-manager/v3/pkg/util/slice" "github.com/scylladb/scylla-manager/v3/pkg/scyllaclient" - "github.com/scylladb/scylla-manager/v3/pkg/service" "github.com/scylladb/scylla-manager/v3/pkg/util/parallel" "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" ) @@ -29,7 +29,7 @@ type Runner struct { func (r Runner) Run(ctx context.Context, clusterID, taskID, runID uuid.UUID, properties json.RawMessage) error { p := taskProperties{} if err := json.Unmarshal(properties, &p); err != nil { - return service.ErrValidate(err) + return util.ErrValidate(err) } switch p.Mode { diff --git a/pkg/service/healthcheck/service.go b/pkg/service/healthcheck/service.go index ec6f9a98ff..070acda63f 100644 --- a/pkg/service/healthcheck/service.go +++ b/pkg/service/healthcheck/service.go @@ -12,6 +12,7 @@ import ( "github.com/scylladb/go-log" "github.com/scylladb/scylla-manager/v3/pkg/service/cluster" "github.com/scylladb/scylla-manager/v3/pkg/service/configcache" + "github.com/scylladb/scylla-manager/v3/pkg/util" "golang.org/x/sync/errgroup" "github.com/scylladb/scylla-manager/v3/pkg/ping" @@ -19,7 +20,6 @@ import ( "github.com/scylladb/scylla-manager/v3/pkg/ping/dynamoping" "github.com/scylladb/scylla-manager/v3/pkg/scyllaclient" "github.com/scylladb/scylla-manager/v3/pkg/secrets" - "github.com/scylladb/scylla-manager/v3/pkg/service" "github.com/scylladb/scylla-manager/v3/pkg/store" "github.com/scylladb/scylla-manager/v3/pkg/util/parallel" "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" @@ -378,7 +378,7 @@ func (s *Service) cqlCreds(ctx context.Context, clusterID uuid.UUID) *secrets.CQ err := s.secretsStore.Get(cqlCreds) if err != nil { cqlCreds = nil - if !errors.Is(err, service.ErrNotFound) { + if !errors.Is(err, util.ErrNotFound) { s.logger.Error(ctx, "Failed to load CQL credentials from secrets store", "cluster_id", clusterID, "error", err) } } diff --git a/pkg/service/repair/config.go b/pkg/service/repair/config.go index 9da05d0c67..5b909a91c7 100644 --- a/pkg/service/repair/config.go +++ b/pkg/service/repair/config.go @@ -6,7 +6,7 @@ import ( "time" "github.com/pkg/errors" - "github.com/scylladb/scylla-manager/v3/pkg/service" + "github.com/scylladb/scylla-manager/v3/pkg/util" "go.uber.org/multierr" ) @@ -44,7 +44,7 @@ func DefaultConfig() Config { func (c *Config) Validate() error { if c == nil { - return service.ErrNilPtr + return util.ErrNilPtr } var err error diff --git a/pkg/service/repair/service.go b/pkg/service/repair/service.go index c52e34933d..1d2e551c99 100644 --- a/pkg/service/repair/service.go +++ b/pkg/service/repair/service.go @@ -17,8 +17,8 @@ import ( "github.com/scylladb/scylla-manager/v3/pkg/metrics" "github.com/scylladb/scylla-manager/v3/pkg/schema/table" "github.com/scylladb/scylla-manager/v3/pkg/scyllaclient" - "github.com/scylladb/scylla-manager/v3/pkg/service" "github.com/scylladb/scylla-manager/v3/pkg/service/cluster" + "github.com/scylladb/scylla-manager/v3/pkg/util" "github.com/scylladb/scylla-manager/v3/pkg/util/inexlist/dcfilter" "github.com/scylladb/scylla-manager/v3/pkg/util/inexlist/ksfilter" "github.com/scylladb/scylla-manager/v3/pkg/util/query" @@ -80,7 +80,7 @@ func (s *Service) GetTarget(ctx context.Context, clusterID uuid.UUID, properties // Parse task properties if err := json.Unmarshal(properties, &props); err != nil { - return Target{}, service.ErrValidate(errors.Wrapf(err, "parse runner properties: %s", properties)) + return Target{}, util.ErrValidate(errors.Wrapf(err, "parse runner properties: %s", properties)) } // Copy basic properties @@ -108,7 +108,7 @@ func (s *Service) GetTarget(ctx context.Context, clusterID uuid.UUID, properties // Make it clear that repairing single node cluster does not make any sense (#1257) if len(status) < 1 { - return t, service.ErrValidate(errors.New("repairing single node cluster does not have any effect")) + return t, util.ErrValidate(errors.New("repairing single node cluster does not have any effect")) } // Filter DCs if t.DC, err = dcfilter.Apply(dcMap, props.DC); err != nil { @@ -124,7 +124,7 @@ func (s *Service) GetTarget(ctx context.Context, clusterID uuid.UUID, properties } // Ensure Host belongs to DCs if t.Host != "" && !hostBelongsToDCs(t.Host, t.DC, dcMap) { - return t, service.ErrValidate(errors.Errorf("no such host %s in DC %s", t.Host, strings.Join(t.DC, ", "))) + return t, util.ErrValidate(errors.Errorf("no such host %s in DC %s", t.Host, strings.Join(t.DC, ", "))) } // Get potential units - all tables matched by keyspace flag @@ -423,10 +423,10 @@ func (s *Service) SetIntensity(ctx context.Context, clusterID uuid.UUID, intensi ih, ok := s.intensityHandlers[clusterID] if !ok { - return errors.Wrap(service.ErrNotFound, "repair task") + return errors.Wrap(util.ErrNotFound, "repair task") } if intensity < 0 { - return service.ErrValidate(errors.Errorf("setting invalid intensity value %.2f", intensity)) + return util.ErrValidate(errors.Errorf("setting invalid intensity value %.2f", intensity)) } ih.SetIntensity(ctx, NewIntensityFromDeprecated(intensity)) // Preserve applied change in SM DB, so that it will be visible in next task runs @@ -446,10 +446,10 @@ func (s *Service) SetParallel(ctx context.Context, clusterID uuid.UUID, parallel ih, ok := s.intensityHandlers[clusterID] if !ok { - return errors.Wrap(service.ErrNotFound, "repair task") + return errors.Wrap(util.ErrNotFound, "repair task") } if parallel < 0 { - return service.ErrValidate(errors.Errorf("setting invalid parallel value %d", parallel)) + return util.ErrValidate(errors.Errorf("setting invalid parallel value %d", parallel)) } ih.SetParallel(ctx, parallel) // Preserve applied change in SM DB, so that it will be visible in next task runs diff --git a/pkg/service/repair/service_repair_integration_test.go b/pkg/service/repair/service_repair_integration_test.go index 963ad5862b..256d0bf45f 100644 --- a/pkg/service/repair/service_repair_integration_test.go +++ b/pkg/service/repair/service_repair_integration_test.go @@ -35,11 +35,11 @@ import ( "github.com/scylladb/scylla-manager/v3/pkg/service/scheduler" . "github.com/scylladb/scylla-manager/v3/pkg/testutils/testconfig" . "github.com/scylladb/scylla-manager/v3/pkg/testutils/testhelper" + "github.com/scylladb/scylla-manager/v3/pkg/util" "go.uber.org/zap/zapcore" "github.com/scylladb/scylla-manager/v3/pkg/metrics" "github.com/scylladb/scylla-manager/v3/pkg/scyllaclient" - "github.com/scylladb/scylla-manager/v3/pkg/service" "github.com/scylladb/scylla-manager/v3/pkg/service/repair" . "github.com/scylladb/scylla-manager/v3/pkg/testutils" . "github.com/scylladb/scylla-manager/v3/pkg/testutils/db" @@ -161,7 +161,7 @@ func (h *repairTestHelper) assertRunning(wait time.Duration) { WaitCond(h.T, func() bool { p, err := h.service.GetProgress(context.Background(), h.ClusterID, h.TaskID, h.RunID) if err != nil { - if errors.Is(err, service.ErrNotFound) { + if errors.Is(err, util.ErrNotFound) { return false } h.T.Fatal(err) @@ -1527,7 +1527,7 @@ func TestServiceRepairIntegration(t *testing.T) { WaitCond(h.T, func() bool { _, err := h.service.GetProgress(context.Background(), h.ClusterID, h.TaskID, h.RunID) if err != nil { - if errors.Is(err, service.ErrNotFound) { + if errors.Is(err, util.ErrNotFound) { return false } h.T.Fatal(err) diff --git a/pkg/service/restore/config.go b/pkg/service/restore/config.go index 0bdc63253b..e8e218a4bf 100644 --- a/pkg/service/restore/config.go +++ b/pkg/service/restore/config.go @@ -4,7 +4,7 @@ package restore import ( "github.com/pkg/errors" - "github.com/scylladb/scylla-manager/v3/pkg/service" + "github.com/scylladb/scylla-manager/v3/pkg/util" ) // Config specifies the backup service configuration. @@ -22,7 +22,7 @@ func DefaultConfig() Config { func (c *Config) Validate() error { if c == nil { - return service.ErrNilPtr + return util.ErrNilPtr } if c.DiskSpaceFreeMinPercent < 0 || c.DiskSpaceFreeMinPercent >= 100 { diff --git a/pkg/service/scheduler/model.go b/pkg/service/scheduler/model.go index 86773583c4..450a881cf3 100644 --- a/pkg/service/scheduler/model.go +++ b/pkg/service/scheduler/model.go @@ -11,10 +11,10 @@ import ( "github.com/pkg/errors" "github.com/scylladb/gocqlx/v2" "github.com/scylladb/scylla-manager/v3/pkg/scheduler" - "github.com/scylladb/scylla-manager/v3/pkg/scheduler/trigger" - "github.com/scylladb/scylla-manager/v3/pkg/service" + "github.com/scylladb/scylla-manager/v3/pkg/util" "github.com/scylladb/scylla-manager/v3/pkg/util/duration" "github.com/scylladb/scylla-manager/v3/pkg/util/retry" + "github.com/scylladb/scylla-manager/v3/pkg/util/schedules" "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" "go.uber.org/multierr" ) @@ -67,112 +67,6 @@ func (t *TaskType) UnmarshalText(text []byte) error { return nil } -// Cron implements a trigger based on cron expression. -// It supports the extended syntax including @monthly, @weekly, @daily, @midnight, @hourly, @every . -type Cron struct { - CronSpecification - inner scheduler.Trigger -} - -// CronSpecification combines specification for cron together with the start dates -// that defines the moment when the cron is being started. -type CronSpecification struct { - Spec string `json:"spec"` - StartDate time.Time `json:"start_date"` -} - -func NewCron(spec string, startDate time.Time) (Cron, error) { - t, err := trigger.NewCron(spec) - if err != nil { - return Cron{}, err - } - - return Cron{ - CronSpecification: CronSpecification{ - Spec: spec, - StartDate: startDate, - }, - inner: t, - }, nil -} - -func NewCronEvery(d time.Duration, startDate time.Time) Cron { - c, _ := NewCron("@every "+d.String(), startDate) // nolint: errcheck - return c -} - -// MustCron calls NewCron and panics on error. -func MustCron(spec string, startDate time.Time) Cron { - c, err := NewCron(spec, startDate) - if err != nil { - panic(err) - } - return c -} - -// Next implements scheduler.Trigger. -func (c Cron) Next(now time.Time) time.Time { - if c.inner == nil { - return time.Time{} - } - if c.StartDate.After(now) { - return c.inner.Next(c.StartDate) - } - return c.inner.Next(now) -} - -func (c Cron) MarshalText() (text []byte, err error) { - bytes, err := json.Marshal(c.CronSpecification) - if err != nil { - return nil, errors.Wrapf(err, "cannot json marshal {%v}", c.CronSpecification) - } - return bytes, nil -} - -func (c *Cron) UnmarshalText(text []byte) error { - if len(text) == 0 { - return nil - } - - var cronSpec CronSpecification - err := json.Unmarshal(text, &cronSpec) - if err != nil { - // fallback to the < 3.2.6 approach where cron was not coupled with start date - cronSpec = CronSpecification{ - Spec: string(text), - } - } - - if cronSpec.Spec == "" { - return nil - } - v, err2 := NewCron(cronSpec.Spec, cronSpec.StartDate) - if err2 != nil { - return errors.Wrap(multierr.Combine(err, err2), "cron") - } - - *c = v - return nil -} - -func (c Cron) MarshalCQL(info gocql.TypeInfo) ([]byte, error) { - if i := info.Type(); i != gocql.TypeText && i != gocql.TypeVarchar { - return nil, errors.Errorf("invalid gocql type %s expected %s", info.Type(), gocql.TypeText) - } - return c.MarshalText() -} - -func (c *Cron) UnmarshalCQL(info gocql.TypeInfo, data []byte) error { - if i := info.Type(); i != gocql.TypeText && i != gocql.TypeVarchar { - return errors.Errorf("invalid gocql type %s expected %s", info.Type(), gocql.TypeText) - } - return c.UnmarshalText(data) -} - -func (c Cron) IsZero() bool { - return c.inner == nil -} - // WeekdayTime adds CQL capabilities to scheduler.WeekdayTime. type WeekdayTime struct { scheduler.WeekdayTime @@ -290,21 +184,21 @@ func (tz Timezone) Location() *time.Location { type Schedule struct { gocqlx.UDT `json:"-"` - Cron Cron `json:"cron"` - Window Window `json:"window"` - Timezone Timezone `json:"timezone"` - StartDate time.Time `json:"start_date"` + Cron schedules.Cron `json:"cron"` + Window Window `json:"window"` + Timezone Timezone `json:"timezone"` + StartDate time.Time `json:"start_date"` // Deprecated: use cron instead Interval duration.Duration `json:"interval" db:"interval_seconds"` NumRetries int `json:"num_retries"` RetryWait duration.Duration `json:"retry_wait"` } -func (s Schedule) trigger() scheduler.Trigger { +func (s Schedule) trigger() schedules.Trigger { if !s.Cron.IsZero() { return s.Cron } - return trigger.NewLegacy(s.StartDate, s.Interval.Duration()) + return schedules.NewLegacy(s.StartDate, s.Interval.Duration()) } func (s Schedule) backoff() retry.Backoff { @@ -347,7 +241,7 @@ func (t *Task) String() string { func (t *Task) Validate() error { if t == nil { - return service.ErrNilPtr + return util.ErrNilPtr } var errs error @@ -368,7 +262,7 @@ func (t *Task) Validate() error { errs = multierr.Append(errs, tp.UnmarshalText([]byte(t.Type))) } - return service.ErrValidate(errors.Wrap(errs, "invalid task")) + return util.ErrValidate(errors.Wrap(errs, "invalid task")) } // Status specifies the status of a Task. diff --git a/pkg/service/scheduler/model_test.go b/pkg/service/scheduler/model_test.go index a8bf966b50..0c5d9e70d2 100644 --- a/pkg/service/scheduler/model_test.go +++ b/pkg/service/scheduler/model_test.go @@ -8,6 +8,7 @@ import ( "github.com/cenkalti/backoff/v4" "github.com/scylladb/scylla-manager/v3/pkg/util/duration" + "github.com/scylladb/scylla-manager/v3/pkg/util/schedules" "github.com/scylladb/scylla-manager/v3/pkg/util/timeutc" ) @@ -66,12 +67,12 @@ func TestCronMarshalUnmarshal(t *testing.T) { for _, tc := range []struct { name string data []byte - expectedSpec CronSpecification + expectedSpec schedules.CronSpecification }{ { name: "(3.2.6 backward compatibility) unmarshal spec", data: []byte("@every 15s"), - expectedSpec: CronSpecification{ + expectedSpec: schedules.CronSpecification{ Spec: "@every 15s", StartDate: time.Time{}, }, @@ -79,7 +80,7 @@ func TestCronMarshalUnmarshal(t *testing.T) { { name: "unmarshal spec full struct zero time", data: []byte(`{"spec": "@every 15s", "start_date": "0001-01-01T00:00:00Z"}`), - expectedSpec: CronSpecification{ + expectedSpec: schedules.CronSpecification{ Spec: "@every 15s", StartDate: time.Time{}, }, @@ -87,14 +88,14 @@ func TestCronMarshalUnmarshal(t *testing.T) { { name: "unmarshal spec full struct non-zero time", data: []byte(`{"spec": "@every 15s", "start_date": "` + nonZeroTimeString + `"}`), - expectedSpec: CronSpecification{ + expectedSpec: schedules.CronSpecification{ Spec: "@every 15s", StartDate: nonZeroTime, }, }, } { t.Run(tc.name, func(t *testing.T) { - var cron, finalCron Cron + var cron, finalCron schedules.Cron if err := cron.UnmarshalText(tc.data); err != nil { t.Fatal(err) } @@ -118,7 +119,7 @@ func TestCronMarshalUnmarshal(t *testing.T) { } func TestNewCronEvery(t *testing.T) { - c := NewCronEvery(15*time.Second, time.Time{}) + c := schedules.NewCronEvery(15*time.Second, time.Time{}) if c.IsZero() { t.Fatal() } @@ -159,7 +160,7 @@ func TestNewCronWithNonZeroStartDate(t *testing.T) { if err != nil { t.Fatal(err) } - c, err := NewCron(tc.cronExpression, parsedStart) + c, err := schedules.NewCron(tc.cronExpression, parsedStart) if err != nil { t.Fatal(err) } @@ -171,7 +172,7 @@ func TestNewCronWithNonZeroStartDate(t *testing.T) { } func TestEmptyCron(t *testing.T) { - var cron Cron + var cron schedules.Cron if err := cron.UnmarshalText(nil); err != nil { t.Fatal(err) } diff --git a/pkg/service/scheduler/service.go b/pkg/service/scheduler/service.go index 4cabd0c001..a53b3dd0a4 100644 --- a/pkg/service/scheduler/service.go +++ b/pkg/service/scheduler/service.go @@ -16,12 +16,12 @@ import ( "github.com/scylladb/gocqlx/v2/qb" "github.com/scylladb/scylla-manager/v3/pkg/metrics" "github.com/scylladb/scylla-manager/v3/pkg/scheduler" - "github.com/scylladb/scylla-manager/v3/pkg/scheduler/trigger" "github.com/scylladb/scylla-manager/v3/pkg/schema/table" - "github.com/scylladb/scylla-manager/v3/pkg/service" "github.com/scylladb/scylla-manager/v3/pkg/store" + "github.com/scylladb/scylla-manager/v3/pkg/util" "github.com/scylladb/scylla-manager/v3/pkg/util/jsonutil" "github.com/scylladb/scylla-manager/v3/pkg/util/pointer" + "github.com/scylladb/scylla-manager/v3/pkg/util/schedules" "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" ) @@ -153,7 +153,7 @@ func (s *Service) forEachTask(f func(t *Task) error) error { func (s *Service) markRunningAsAborted(t *Task, endTime time.Time) (bool, error) { r, err := s.getLastRun(t) if err != nil { - if errors.Is(err, service.ErrNotFound) { + if errors.Is(err, util.ErrNotFound) { return false, nil } return false, err @@ -234,7 +234,7 @@ func (s *Service) nthRunID(t *Task, n int) (uuid.UUID, error) { return uuid.Nil, err } - return uuid.Nil, service.ErrNotFound + return uuid.Nil, util.ErrNotFound } // GetRun returns a run based on ID. If nothing was found ErrNotFound is returned. @@ -311,7 +311,7 @@ func (s *Service) shouldPutTask(create bool, t *Task) error { defer s.mu.Unlock() if create && s.isSuspendedLocked(t.ClusterID) { - return service.ErrValidate(errors.New("cluster is suspended, scheduling tasks is not allowed")) + return util.ErrValidate(errors.New("cluster is suspended, scheduling tasks is not allowed")) } if t.Name != "" { @@ -346,7 +346,7 @@ func (s *Service) schedule(ctx context.Context, t *Task, run bool) { if t.Enabled { d := details(t) if run { - d.Trigger = trigger.NewMulti(trigger.NewOnce(), d.Trigger) + d.Trigger = schedules.NewMulti(schedules.NewOnce(), d.Trigger) } l.Schedule(ctx, t.ID, d) } else { @@ -407,7 +407,7 @@ func (s *Service) run(ctx RunContext) (runErr error) { } if !ok { - return service.ErrNotFound + return util.ErrNotFound } if err := s.putRunAndUpdateTask(r); err != nil { return errors.Wrap(err, "put run") @@ -580,7 +580,7 @@ func (s *Service) startTask(ctx context.Context, t *Task, noContinue bool) error s.mu.Lock() if s.isSuspendedLocked(t.ClusterID) { s.mu.Unlock() - return service.ErrValidate(errors.New("cluster is suspended")) + return util.ErrValidate(errors.New("cluster is suspended")) } l, lok := s.scheduler[t.ClusterID] if !lok { @@ -596,7 +596,7 @@ func (s *Service) startTask(ctx context.Context, t *Task, noContinue bool) error // tasks we need to reschedule them to run once. if !l.Trigger(ctx, t.ID) { d := details(t) - d.Trigger = trigger.NewOnce() + d.Trigger = schedules.NewOnce() l.Schedule(ctx, t.ID, d) } return nil diff --git a/pkg/service/scheduler/service_integration_test.go b/pkg/service/scheduler/service_integration_test.go index 0276ffa20d..749d07993d 100644 --- a/pkg/service/scheduler/service_integration_test.go +++ b/pkg/service/scheduler/service_integration_test.go @@ -21,12 +21,12 @@ import ( "github.com/scylladb/gocqlx/v2" sched "github.com/scylladb/scylla-manager/v3/pkg/scheduler" . "github.com/scylladb/scylla-manager/v3/pkg/testutils/db" + "github.com/scylladb/scylla-manager/v3/pkg/util" "go.uber.org/atomic" "go.uber.org/zap/zapcore" "github.com/scylladb/scylla-manager/v3/pkg/metrics" "github.com/scylladb/scylla-manager/v3/pkg/schema/table" - "github.com/scylladb/scylla-manager/v3/pkg/service" "github.com/scylladb/scylla-manager/v3/pkg/service/backup" "github.com/scylladb/scylla-manager/v3/pkg/service/scheduler" "github.com/scylladb/scylla-manager/v3/pkg/store" @@ -177,7 +177,7 @@ func (h *schedulerTestHelper) getStatus(task *scheduler.Task) scheduler.Status { h.t.Helper() r, err := h.service.GetLastRun(task) if err != nil { - if errors.Is(err, service.ErrNotFound) { + if errors.Is(err, util.ErrNotFound) { return "" } h.t.Fatal(err) diff --git a/pkg/service/scheduler/service_suspend.go b/pkg/service/scheduler/service_suspend.go index 39028f2e83..a0c0d9a957 100644 --- a/pkg/service/scheduler/service_suspend.go +++ b/pkg/service/scheduler/service_suspend.go @@ -12,8 +12,8 @@ import ( "github.com/scylladb/go-set/b16set" "github.com/scylladb/gocqlx/v2/qb" "github.com/scylladb/scylla-manager/v3/pkg/schema/table" - "github.com/scylladb/scylla-manager/v3/pkg/service" "github.com/scylladb/scylla-manager/v3/pkg/store" + "github.com/scylladb/scylla-manager/v3/pkg/util" "github.com/scylladb/scylla-manager/v3/pkg/util/duration" "github.com/scylladb/scylla-manager/v3/pkg/util/timeutc" "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" @@ -72,7 +72,7 @@ func (s *Service) initSuspended() error { for _, c := range clusters { si := &suspendInfo{ClusterID: c} if err := s.drawer.Get(si); err != nil { - if !errors.Is(err, service.ErrNotFound) { + if !errors.Is(err, util.ErrNotFound) { return err } } else { @@ -222,7 +222,7 @@ func (s *Service) Resume(ctx context.Context, clusterID uuid.UUID, startTasks bo } si := &suspendInfo{ClusterID: clusterID} if err := s.drawer.Get(si); err != nil { - if errors.Is(err, service.ErrNotFound) { + if errors.Is(err, util.ErrNotFound) { s.logger.Error(ctx, "Expected canceled tasks got none") } else { s.mu.Unlock() @@ -286,7 +286,7 @@ type suspendRunner struct { func (s suspendRunner) Run(ctx context.Context, clusterID, _, _ uuid.UUID, properties json.RawMessage) error { p, err := GetSuspendProperties(properties) if err != nil { - return service.ErrValidate(err) + return util.ErrValidate(err) } if p.Resume { diff --git a/pkg/store/rollback.go b/pkg/store/rollback.go index 7e0c1a6ea1..3967af144a 100644 --- a/pkg/store/rollback.go +++ b/pkg/store/rollback.go @@ -4,7 +4,7 @@ package store import ( "github.com/pkg/errors" - "github.com/scylladb/scylla-manager/v3/pkg/service" + "github.com/scylladb/scylla-manager/v3/pkg/util" ) type entryHolder struct { @@ -27,7 +27,7 @@ func PutWithRollback(store Store, e Entry) (func(), error) { Entry: e, } - if err := store.Get(old); err != nil && !errors.Is(err, service.ErrNotFound) { + if err := store.Get(old); err != nil && !errors.Is(err, util.ErrNotFound) { return nil, errors.Wrap(err, "get") } if err := store.Put(e); err != nil { diff --git a/pkg/store/rollback_test.go b/pkg/store/rollback_test.go index c03a2407b0..43d24b79d7 100644 --- a/pkg/store/rollback_test.go +++ b/pkg/store/rollback_test.go @@ -5,7 +5,7 @@ package store import ( "testing" - "github.com/scylladb/scylla-manager/v3/pkg/service" + "github.com/scylladb/scylla-manager/v3/pkg/util" "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" ) @@ -43,7 +43,7 @@ func (t *testStore) Put(e Entry) error { func (t *testStore) Get(e Entry) error { if len(*t) == 0 { - return service.ErrNotFound + return util.ErrNotFound } return e.UnmarshalBinary(*t) } diff --git a/pkg/store/store_integration_test.go b/pkg/store/store_integration_test.go index c0cd735254..7ccd652ebd 100644 --- a/pkg/store/store_integration_test.go +++ b/pkg/store/store_integration_test.go @@ -12,9 +12,9 @@ import ( "github.com/google/go-cmp/cmp" "github.com/pkg/errors" . "github.com/scylladb/scylla-manager/v3/pkg/testutils/db" + "github.com/scylladb/scylla-manager/v3/pkg/util" "github.com/scylladb/scylla-manager/v3/pkg/schema/table" - "github.com/scylladb/scylla-manager/v3/pkg/service" "github.com/scylladb/scylla-manager/v3/pkg/store" . "github.com/scylladb/scylla-manager/v3/pkg/testutils" "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" @@ -86,7 +86,7 @@ func TestStorageIntegration(t *testing.T) { t.Run("ErrNotFound is returned on non existing entry lookup", func(t *testing.T) { setup(t) - if err := s.Get(truth); err == nil || !errors.Is(err, service.ErrNotFound) { + if err := s.Get(truth); err == nil || !errors.Is(err, util.ErrNotFound) { t.Fatal("expected to get NotFound error") } }) @@ -144,7 +144,7 @@ func TestStorageIntegration(t *testing.T) { if err := s.Delete(truth); err != nil { t.Fatal(err) } - if err := s.Get(truth); err == nil || !errors.Is(err, service.ErrNotFound) { + if err := s.Get(truth); err == nil || !errors.Is(err, util.ErrNotFound) { t.Fatal("expected to get NotFound error") } }) @@ -161,7 +161,7 @@ func TestStorageIntegration(t *testing.T) { if err := s.DeleteAll(clusterID); err != nil { t.Fatal(err) } - if err := s.Get(truth); err == nil || !errors.Is(err, service.ErrNotFound) { + if err := s.Get(truth); err == nil || !errors.Is(err, util.ErrNotFound) { t.Fatal("expected to get NotFound error") } }) diff --git a/pkg/testutils/duration.go b/pkg/testutils/duration.go deleted file mode 100644 index 252ce040df..0000000000 --- a/pkg/testutils/duration.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (C) 2017 ScyllaDB - -package testutils - -import "time" - -// EpsilonRange returns start and end of range 5% close to provided value. -func EpsilonRange(d time.Duration) (a, b time.Duration) { - e := time.Duration(float64(d) * 1.05) - return d - e, d + e -} diff --git a/pkg/util/netwait/netwait_integration_test.go b/pkg/testutils/netwait_integration_test.go similarity index 90% rename from pkg/util/netwait/netwait_integration_test.go rename to pkg/testutils/netwait_integration_test.go index 7d0f2e9e80..0ce873d462 100644 --- a/pkg/util/netwait/netwait_integration_test.go +++ b/pkg/testutils/netwait_integration_test.go @@ -3,7 +3,7 @@ //go:build all || integration // +build all integration -package netwait +package testutils import ( "context" @@ -12,8 +12,8 @@ import ( "testing" "time" - . "github.com/scylladb/scylla-manager/v3/pkg/testutils" . "github.com/scylladb/scylla-manager/v3/pkg/testutils/testconfig" + "github.com/scylladb/scylla-manager/v3/pkg/util/netwait" ) func TestWaiterTimeoutIntegration(t *testing.T) { @@ -28,7 +28,7 @@ func TestWaiterTimeoutIntegration(t *testing.T) { } defer RunIptablesCommand(host, CmdUnblockScyllaCQL) - w := &Waiter{ + w := &netwait.Waiter{ DialTimeout: 5 * time.Millisecond, RetryBackoff: 10 * time.Millisecond, MaxAttempts: 10, diff --git a/pkg/util/httphandler/version.go b/pkg/util/httphandler/version.go deleted file mode 100644 index d02f0d2607..0000000000 --- a/pkg/util/httphandler/version.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2017 ScyllaDB - -package httphandler - -import ( - "net/http" - - "github.com/go-chi/render" - "github.com/scylladb/scylla-manager/v3/pkg" -) - -type version struct { - Version string `json:"version"` -} - -// Version responds with application version. -func Version() http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - render.Respond(w, r, version{Version: pkg.Version()}) - } -} diff --git a/pkg/util/inexlist/dcfilter/dcfilter.go b/pkg/util/inexlist/dcfilter/dcfilter.go deleted file mode 100644 index 37b8b58336..0000000000 --- a/pkg/util/inexlist/dcfilter/dcfilter.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (C) 2017 ScyllaDB - -package dcfilter - -import ( - "sort" - - "github.com/pkg/errors" - "github.com/scylladb/scylla-manager/v3/pkg/service" - "github.com/scylladb/scylla-manager/v3/pkg/util/inexlist" -) - -// Apply returns DCs matched by the filters. -// If no DCs are found or a filter is invalid a validation error is returned. -func Apply(dcMap map[string][]string, filters []string) ([]string, error) { - dcInclExcl, err := inexlist.ParseInExList(decorate(filters)) - if err != nil { - return nil, err - } - - dcs := make([]string, 0, len(dcMap)) - for dc := range dcMap { - dcs = append(dcs, dc) - } - - // Filter - filtered := dcInclExcl.Filter(dcs) - - // Report error if there is no match - if len(filtered) == 0 { - return nil, service.ErrValidate(errors.Errorf("no matching DCs found for filters %s", filters)) - } - - // Sort lexicographically - sort.Strings(filtered) - - return filtered, nil -} - -func decorate(filters []string) []string { - if len(filters) == 0 { - filters = append(filters, "*") - } - return filters -} diff --git a/pkg/util/inexlist/inexlist.go b/pkg/util/inexlist/inexlist.go deleted file mode 100644 index e7558b4559..0000000000 --- a/pkg/util/inexlist/inexlist.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (C) 2017 ScyllaDB - -package inexlist - -import ( - "fmt" - "strings" - - "github.com/gobwas/glob" - "github.com/pkg/errors" - "github.com/scylladb/scylla-manager/v3/pkg/service" -) - -type sign bool - -func (s sign) String() string { - if s { - return "" - } - return "!" -} - -type signedPattern struct { - Sign sign - Pattern string - g glob.Glob -} - -// InExList is an include/exclude list that can filter string slices based on -// a given set of glob patterns. -type InExList struct { - patterns []string - list []signedPattern -} - -func (sp signedPattern) String() string { - return fmt.Sprintf("%s%s", sp.Sign, sp.Pattern) -} - -// ParseInExList takes a list of patterns such as -// [keyspace_1.table_1 !keyspace_1.table_2] and parses it into executable rules. -// If any of the glob pattern is invalid an error is returned. -func ParseInExList(patterns []string) (InExList, error) { - inExList := InExList{ - patterns: patterns, - } - - parsed := make([]signedPattern, 0, len(patterns)) - - for i, p := range patterns { - p = strings.TrimSpace(p) - if p == "" { - continue - } - s := !strings.HasPrefix(p, "!") - p = strings.TrimLeft(p, "!") - g, err := glob.Compile(p) - if err != nil { - return InExList{}, service.ErrValidate(errors.Errorf("invalid glob p on position %d: %s", i, p)) - } - parsed = append(parsed, signedPattern{Sign: sign(s), Pattern: p, g: g}) - } - - inExList.list = parsed - - return inExList, nil -} - -// Filter simply applies the rules to the supplied list of strings. -// If an earlier rule excludes a given entry a succeeding rule can later add it back. -func (ie InExList) Filter(in []string) []string { - if len(ie.patterns) == 0 { - return in - } - - var out []string - - for _, v := range in { - ok := false - for _, p := range ie.list { - if p.g.Match(v) { - ok = bool(p.Sign) - } - } - if ok { - out = append(out, v) - } - } - - return out -} - -// FirstMatch takes a string and tries to find a matching rule and -// if it finds one the position of that rule is returned. -// If no matching rule is found then -1 is returned. -func (ie InExList) FirstMatch(s string) int { - for i, sp := range ie.list { - if bool(sp.Sign) && sp.g.Match(s) { - return i - } - } - - return -1 -} - -// Size returns the number of patterns. -func (ie InExList) Size() int { - return len(ie.list) -} diff --git a/pkg/util/inexlist/ksfilter/ksfilter.go b/pkg/util/inexlist/ksfilter/ksfilter.go deleted file mode 100644 index fd3b23bb8d..0000000000 --- a/pkg/util/inexlist/ksfilter/ksfilter.go +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (C) 2017 ScyllaDB - -package ksfilter - -import ( - "sort" - "strings" - - "github.com/pkg/errors" - "github.com/scylladb/scylla-manager/v3/pkg/service" - "github.com/scylladb/scylla-manager/v3/pkg/util/inexlist" - "go.uber.org/multierr" -) - -// Unit specifies keyspace and it's tables. -type Unit struct { - Keyspace string - Tables []string - AllTables bool -} - -// Filter is a builder that let's you filter keyspaces and tables by adding them -// on keyspace by keyspace basis. -type Filter struct { - filters []string - inex inexlist.InExList - units []Unit - keyspaces []string -} - -func NewFilter(filters []string) (*Filter, error) { - // Validate filters - var errs error - for i, f := range filters { - err := validate(filters[i]) - if err != nil { - errs = multierr.Append(errs, errors.Wrapf(err, "%q on position %d", f, i)) - continue - } - } - if errs != nil { - return nil, service.ErrValidate(errors.Wrap(errs, "invalid filters")) - } - - // Decorate filters and create inexlist - inex, err := inexlist.ParseInExList(decorate(filters)) - if err != nil { - return nil, err - } - - return &Filter{ - filters: filters, - inex: inex, - }, nil -} - -func validate(filter string) error { - if filter == "*" || filter == "!*" { - return nil - } - if strings.HasPrefix(filter, ".") { - return errors.New("missing keyspace") - } - return nil -} - -func decorate(filters []string) []string { - if len(filters) == 0 { - filters = append(filters, "*.*") - } - - for i, f := range filters { - if strings.Contains(f, ".") { - continue - } - if strings.HasSuffix(f, "*") { - filters[i] = strings.TrimSuffix(f, "*") + "*.*" - } else { - filters[i] += ".*" - } - } - - return filters -} - -// Add filters the keyspace and tables, if they match it adds a new unit to the -// Filter. -func (f *Filter) Add(keyspace string, tables []string) { - // Add prefix - prefix := keyspace + "." - for i := 0; i < len(tables); i++ { - tables[i] = prefix + tables[i] - } - - // Filter - filtered := f.inex.Filter(tables) - - // No data, skip the keyspace - if len(filtered) == 0 { - return - } - - // Remove prefix - for i := 0; i < len(filtered); i++ { - filtered[i] = strings.TrimPrefix(filtered[i], prefix) - } - - // Add unit - u := Unit{ - Keyspace: keyspace, - Tables: filtered, - AllTables: len(filtered) == len(tables), - } - f.units = append(f.units, u) - - f.keyspaces = append(f.keyspaces, keyspace) -} - -// Check returns true iff table matches filter. -func (f *Filter) Check(keyspace, table string) bool { - key := keyspace + "." + table - return len(f.inex.Filter([]string{key})) > 0 -} - -// Apply returns the resulting units. The units are sorted by position of a -// first match in the filters. -// If no units are found or a filter is invalid a validation error is returned. -// The validation error may be disabled by providing the force=true. -func (f *Filter) Apply(force bool) ([]Unit, error) { - if len(f.units) == 0 && !force { - return nil, service.ErrValidate(errors.Errorf("no keyspace matched criteria %s - available keyspaces are: %s", f.filters, f.keyspaces)) - } - - // Sort units by the presence - sortUnits(f.units, f.inex) - - return f.units, nil -} - -func sortUnits(units []Unit, inclExcl inexlist.InExList) { - positions := make(map[string]int) - for _, u := range units { - min := inclExcl.Size() - for _, t := range u.Tables { - if p := inclExcl.FirstMatch(u.Keyspace + "." + t); p >= 0 && p < min { - min = p - } - } - positions[u.Keyspace] = min - } - - sort.Slice(units, func(i, j int) bool { - // order by position - switch { - case positions[units[i].Keyspace] < positions[units[j].Keyspace]: - return true - case positions[units[i].Keyspace] > positions[units[j].Keyspace]: - return false - default: - // promote system keyspaces - l := strings.HasPrefix(units[i].Keyspace, "system") - r := strings.HasPrefix(units[j].Keyspace, "system") - switch { - case l && !r: - return true - case !l && r: - return false - default: - // order by name - return units[i].Keyspace < units[j].Keyspace - } - } - }) -} - -// Filters returns the original filters used to create the instance. -func (f *Filter) Filters() []string { - if f == nil { - return nil - } - return f.filters -} diff --git a/sctool b/sctool deleted file mode 120000 index f530e2279a..0000000000 --- a/sctool +++ /dev/null @@ -1 +0,0 @@ -sctool.dev \ No newline at end of file diff --git a/swagger-ui/dist/favicon-16x16.png b/swagger-ui/dist/favicon-16x16.png deleted file mode 100644 index 8b194e617a..0000000000 Binary files a/swagger-ui/dist/favicon-16x16.png and /dev/null differ diff --git a/swagger-ui/dist/favicon-32x32.png b/swagger-ui/dist/favicon-32x32.png deleted file mode 100644 index 249737fe44..0000000000 Binary files a/swagger-ui/dist/favicon-32x32.png and /dev/null differ diff --git a/swagger-ui/dist/index.html b/swagger-ui/dist/index.html deleted file mode 100644 index 094812676c..0000000000 --- a/swagger-ui/dist/index.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - Swagger UI - - - - - - - -
- - - - - - diff --git a/swagger-ui/dist/oauth2-redirect.html b/swagger-ui/dist/oauth2-redirect.html deleted file mode 100644 index 64b171f7de..0000000000 --- a/swagger-ui/dist/oauth2-redirect.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - Swagger UI: OAuth2 Redirect - - - - - diff --git a/swagger-ui/dist/scylla-manager.json b/swagger-ui/dist/scylla-manager.json deleted file mode 100644 index bf998f5b86..0000000000 --- a/swagger-ui/dist/scylla-manager.json +++ /dev/null @@ -1,1738 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Scylla Manager API", - "version": "" - }, - "basePath": "/api/v1", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "definitions": { - "Version": { - "type": "object", - "properties": { - "version": { - "type": "string" - } - } - }, - "Cluster": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "host": { - "type": "string" - }, - "auth_token": { - "type": "string" - }, - "username": { - "type": "string" - }, - "password": { - "type": "string" - }, - "ssl_user_cert_file": { - "type": "string", - "format": "byte" - }, - "ssl_user_key_file": { - "type": "string", - "format": "byte" - }, - "without_repair": { - "type": "boolean" - } - } - }, - "RepairUnit": { - "type": "object", - "properties": { - "keyspace": { - "type": "string" - }, - "tables": { - "type": "array", - "items": { - "type": "string" - } - }, - "all_tables": { - "type": "boolean" - } - } - }, - "ClusterStatus": { - "type": "array", - "items": { - "properties": { - "dc": { - "type": "string" - }, - "host_id": { - "type": "string" - }, - "host": { - "type": "string" - }, - "status": { - "type": "string" - }, - "ssl": { - "type": "boolean" - }, - "alternator_status": { - "type": "string" - }, - "alternator_rtt_ms": { - "type": "number", - "format": "float" - }, - "cql_status": { - "type": "string" - }, - "cql_rtt_ms": { - "type": "number", - "format": "float" - }, - "rest_status": { - "type": "string" - }, - "rest_rtt_ms": { - "type": "number", - "format": "float" - }, - "total_ram": { - "type": "integer" - }, - "uptime": { - "type": "integer" - }, - "cpu_count": { - "type": "integer" - }, - "scylla_version": { - "type": "string" - }, - "agent_version": { - "type": "string" - } - } - } - }, - "RepairProgress": { - "type": "object", - "properties": { - "token_ranges": { - "type": "number", - "format": "int" - }, - "success": { - "type": "number", - "format": "int" - }, - "error": { - "type": "number", - "format": "int" - }, - "started_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "completed_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "duration_ms": { - "type": "integer" - }, - "dcs": { - "type": "array", - "items": { - "type": "string" - } - }, - "intensity": { - "type": "number" - }, - "parallel": { - "type": "integer" - }, - "hosts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "host": { - "type": "string" - }, - "tables": { - "type": "array", - "items": { - "$ref": "#/definitions/TableRepairProgress" - } - } - } - } - }, - "tables": { - "type": "array", - "items": { - "$ref": "#/definitions/TableRepairProgress" - } - } - } - }, - "TableRepairProgress": { - "properties": { - "token_ranges": { - "type": "number", - "format": "int" - }, - "success": { - "type": "number", - "format": "int" - }, - "error": { - "type": "number", - "format": "int" - }, - "started_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "completed_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "duration_ms": { - "type": "integer" - }, - "keyspace": { - "type": "string" - }, - "table": { - "type": "string" - } - } - }, - "Schedule": { - "type": "object", - "properties": { - "start_date": { - "type": "string", - "format": "date-time" - }, - "interval": { - "type": "string" - }, - "num_retries": { - "type": "number", - "format": "int" - } - } - }, - "Task": { - "type": "object", - "properties": { - "cluster_id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "enabled": { - "type": "boolean" - }, - "schedule": { - "$ref": "#/definitions/Schedule" - }, - "properties": { - "type": "object", - "additionalProperties": true - } - } - }, - "ExtendedTask": { - "type": "object", - "properties": { - "cluster_id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "enabled": { - "type": "boolean" - }, - "schedule": { - "$ref": "#/definitions/Schedule" - }, - "properties": { - "type": "object", - "additionalProperties": true - }, - "status": { - "type": "string" - }, - "cause": { - "type": "string" - }, - "start_time": { - "type": "string", - "format": "date-time" - }, - "end_time": { - "type": "string", - "format": "date-time" - }, - "next_activation": { - "type": "string", - "format": "date-time" - }, - "suspended": { - "type": "boolean" - }, - "failures": { - "type": "integer" - } - } - }, - "TaskUpdate": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "enabled": { - "type": "boolean" - }, - "schedule": { - "$ref": "#/definitions/Schedule" - }, - "properties": { - "type": "object", - "additionalProperties": true - } - } - }, - "TaskRun": { - "type": "object", - "properties": { - "cluster_id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "task_id": { - "type": "string" - }, - "id": { - "type": "string" - }, - "status": { - "type": "string" - }, - "cause": { - "type": "string" - }, - "start_time": { - "type": "string", - "format": "date-time" - }, - "end_time": { - "type": "string", - "format": "date-time" - } - } - }, - "TaskRunRepairProgress": { - "type": "object", - "properties": { - "run": { - "$ref": "#/definitions/TaskRun" - }, - "progress": { - "$ref": "#/definitions/RepairProgress" - } - } - }, - "RepairTarget": { - "type": "object", - "properties": { - "cluster_id": { - "type": "string" - }, - "host": { - "type": "string" - }, - "dc": { - "type": "array", - "items": { - "type": "string" - } - }, - "with_hosts": { - "type": "array", - "items": { - "type": "string" - } - }, - "token_ranges": { - "type": "string" - }, - "units": { - "type": "array", - "items": { - "$ref": "#/definitions/RepairUnit" - } - } - } - }, - "BackupListItem": { - "type": "object", - "properties": { - "cluster_id": { - "type": "string" - }, - "units": { - "type": "array", - "items": { - "$ref": "#/definitions/BackupUnit" - } - }, - "snapshot_info": { - "type": "array", - "items": { - "$ref": "#/definitions/SnapshotInfo" - } - } - } - }, - "BackupFilesInfo": { - "type": "object", - "properties": { - "location": { - "type": "string" - }, - "schema": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "keyspace": { - "type": "string" - }, - "table": { - "type": "string" - }, - "version": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "type": "string" - } - }, - "size": { - "type": "integer" - } - } - } - } - } - }, - "BackupTarget": { - "type": "object", - "properties": { - "cluster_id": { - "type": "string" - }, - "host": { - "type": "string" - }, - "dc": { - "type": "array", - "items": { - "type": "string" - } - }, - "with_hosts": { - "type": "array", - "items": { - "type": "string" - } - }, - "location": { - "type": "array", - "items": { - "type": "string" - } - }, - "retention": { - "type": "integer" - }, - "rate_limit": { - "type": "array", - "items": { - "type": "string" - } - }, - "snapshot_parallel": { - "type": "array", - "items": { - "type": "string" - } - }, - "upload_parallel": { - "type": "array", - "items": { - "type": "string" - } - }, - "units": { - "type": "array", - "items": { - "$ref": "#/definitions/BackupUnit" - } - }, - "size": { - "type": "integer" - } - } - }, - "BackupUnit": { - "type": "object", - "properties": { - "keyspace": { - "type": "string" - }, - "tables": { - "type": "array", - "items": { - "type": "string" - } - }, - "all_tables": { - "type": "boolean" - } - } - }, - "SnapshotInfo": { - "type": "object", - "properties": { - "snapshot_tag": { - "type": "string" - }, - "size": { - "type": "integer" - } - } - }, - "TaskRunBackupProgress": { - "type": "object", - "properties": { - "run": { - "$ref": "#/definitions/TaskRun" - }, - "progress": { - "$ref": "#/definitions/BackupProgress" - } - } - }, - "BackupProgress": { - "type": "object", - "properties": { - "snapshot_tag": { - "type": "string" - }, - "dcs": { - "type": "array", - "items": { - "type": "string" - } - }, - "hosts": { - "type": "array", - "items": { - "$ref": "#/definitions/HostProgress" - } - }, - "stage": { - "type": "string" - }, - "size": { - "type": "integer" - }, - "uploaded": { - "type": "integer" - }, - "skipped": { - "type": "integer" - }, - "failed": { - "type": "integer" - }, - "started_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "completed_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - } - } - }, - "HostProgress": { - "type": "object", - "properties": { - "host": { - "type": "string" - }, - "keyspaces": { - "type": "array", - "items": { - "$ref": "#/definitions/KeyspaceProgress" - } - }, - "size": { - "type": "integer" - }, - "uploaded": { - "type": "integer" - }, - "skipped": { - "type": "integer" - }, - "failed": { - "type": "integer" - }, - "started_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "completed_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - } - } - }, - "KeyspaceProgress": { - "type": "object", - "properties": { - "keyspace": { - "type": "string" - }, - "tables": { - "type": "array", - "items": { - "$ref": "#/definitions/TableProgress" - } - }, - "size": { - "type": "integer" - }, - "uploaded": { - "type": "integer" - }, - "skipped": { - "type": "integer" - }, - "failed": { - "type": "integer" - }, - "started_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "completed_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - } - } - }, - "TableProgress": { - "type": "object", - "properties": { - "table": { - "type": "string" - }, - "error": { - "type": "string" - }, - "size": { - "type": "integer" - }, - "uploaded": { - "type": "integer" - }, - "skipped": { - "type": "integer" - }, - "failed": { - "type": "integer" - }, - "started_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "completed_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - } - } - }, - "TaskRunValidateBackupProgress": { - "type": "object", - "properties": { - "run": { - "$ref": "#/definitions/TaskRun" - }, - "progress": { - "type": "array", - "items": { - "$ref": "#/definitions/ValidateBackupProgress" - } - } - } - }, - "ValidateBackupProgress": { - "type": "object", - "properties": { - "dc": { - "type": "string" - }, - "host": { - "type": "string" - }, - "location": { - "type": "string" - }, - "manifests": { - "type": "integer" - }, - "scanned_files": { - "type": "integer" - }, - "broken_snapshots": { - "type": "array", - "items": { - "type": "string" - } - }, - "missing_files": { - "type": "integer" - }, - "orphaned_files": { - "type": "integer" - }, - "orphaned_bytes": { - "type": "integer" - }, - "deleted_files": { - "type": "integer" - }, - "delete_errors": { - "type": "integer" - }, - "started_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "completed_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - } - } - }, - "Suspended": { - "type": "boolean" - }, - "ErrorResponse": { - "type": "object", - "properties": { - "message": { - "description": "Error description", - "type": "string" - }, - "trace_id": { - "description": "Request ID for tracing in logs", - "type": "string" - } - } - } - }, - "paths": { - "/version": { - "get": { - "responses": { - "200": { - "description": "Server version", - "schema": { - "$ref": "#/definitions/Version" - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/clusters": { - "get": { - "responses": { - "200": { - "description": "List of all clusters", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Cluster" - } - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "post": { - "parameters": [ - { - "name": "cluster", - "in": "body", - "schema": { - "$ref": "#/definitions/Cluster" - } - } - ], - "responses": { - "201": { - "description": "Cluster added", - "headers": { - "Location": { - "type": "string" - } - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - } - ], - "get": { - "responses": { - "200": { - "description": "Cluster info", - "schema": { - "$ref": "#/definitions/Cluster" - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "parameters": [ - { - "name": "cluster", - "in": "body", - "schema": { - "$ref": "#/definitions/Cluster" - } - } - ], - "responses": { - "200": { - "description": "Updated cluster info", - "schema": { - "$ref": "#/definitions/Cluster" - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "parameters": [ - { - "type": "boolean", - "name": "cql_creds", - "in": "query" - }, - { - "type": "boolean", - "name": "ssl_user_cert", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Cluster deleted" - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/status": { - "get": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Cluster hosts and their statuses", - "schema": { - "$ref": "#/definitions/ClusterStatus" - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/tasks": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - } - ], - "get": { - "parameters": [ - { - "name": "all", - "in": "query", - "type": "boolean", - "required": false - }, - { - "name": "type", - "in": "query", - "type": "string", - "required": false - }, - { - "name": "status", - "in": "query", - "type": "string", - "required": false - } - ], - "responses": { - "200": { - "description": "List of tasks", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/ExtendedTask" - } - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "post": { - "parameters": [ - { - "name": "taskFields", - "in": "body", - "schema": { - "$ref": "#/definitions/TaskUpdate" - } - } - ], - "responses": { - "201": { - "description": "Task added", - "headers": { - "Location": { - "type": "string" - } - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/tasks/repair/target": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - } - ], - "get": { - "parameters": [ - { - "name": "taskFields", - "in": "body", - "schema": { - "$ref": "#/definitions/TaskUpdate" - } - } - ], - "responses": { - "200": { - "description": "Repair target", - "schema": { - "$ref": "#/definitions/RepairTarget" - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/tasks/backup/target": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - } - ], - "get": { - "parameters": [ - { - "name": "taskFields", - "in": "body", - "schema": { - "$ref": "#/definitions/TaskUpdate" - } - } - ], - "responses": { - "200": { - "description": "Backup target", - "schema": { - "$ref": "#/definitions/BackupTarget" - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/task/{task_type}/{task_id}": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "task_type", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "task_id", - "in": "path", - "required": true - } - ], - "get": { - "responses": { - "200": { - "description": "Task info", - "schema": { - "$ref": "#/definitions/Task" - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "parameters": [ - { - "name": "taskFields", - "in": "body", - "schema": { - "$ref": "#/definitions/TaskUpdate" - } - } - ], - "responses": { - "200": { - "description": "Updated task info", - "schema": { - "$ref": "#/definitions/Task" - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "responses": { - "200": { - "description": "Task deleted" - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/task/{task_type}/{task_id}/start": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "task_type", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "name": "continue", - "in": "query", - "required": true - } - ], - "put": { - "responses": { - "200": { - "description": "Task started" - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/task/{task_type}/{task_id}/stop": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "task_type", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "boolean", - "name": "disable", - "in": "query", - "required": false - } - ], - "put": { - "responses": { - "200": { - "description": "Task stopped" - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/task/{task_type}/{task_id}/history": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "task_type", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "task_id", - "in": "path", - "required": true - } - ], - "get": { - "parameters": [ - { - "name": "limit", - "in": "query", - "type": "integer", - "format": "int", - "required": false - } - ], - "responses": { - "200": { - "description": "List of task runs", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TaskRun" - } - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/task/repair/{task_id}/{run_id}": { - "get": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "run_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Repair progress", - "schema": { - "$ref": "#/definitions/TaskRunRepairProgress" - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/task/backup/{task_id}/{run_id}": { - "get": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "run_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Backup progress", - "schema": { - "$ref": "#/definitions/TaskRunBackupProgress" - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/task/validate_backup/{task_id}/{run_id}": { - "get": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "run_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Backup validation progress", - "schema": { - "$ref": "#/definitions/TaskRunValidateBackupProgress" - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/backups": { - "get": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - }, - { - "type": "array", - "items": { - "type": "string" - }, - "name": "locations", - "in": "query" - }, - { - "type": "string", - "name": "query_cluster_id", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "name": "keyspace", - "in": "query", - "required": true - }, - { - "type": "string", - "format": "date-time", - "name": "min_date", - "in": "query" - }, - { - "type": "string", - "format": "date-time", - "name": "max_date", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Backup list", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/BackupListItem" - } - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "snapshot_tag", - "in": "query", - "required": true - }, - { - "type": "array", - "items": { - "type": "string" - }, - "name": "locations", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK" - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/backups/files": { - "get": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - }, - { - "type": "array", - "items": { - "type": "string" - }, - "name": "keyspace", - "in": "query", - "required": true - }, - { - "type": "string", - "name": "snapshot_tag", - "in": "query", - "required": true - }, - { - "type": "array", - "items": { - "type": "string" - }, - "name": "locations", - "in": "query" - }, - { - "type": "string", - "name": "query_cluster_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Backup list", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/BackupFilesInfo" - } - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/repairs/intensity": { - "put": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - }, - { - "type": "number", - "name": "intensity", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/repairs/parallel": { - "put": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "name": "parallel", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Suspended" - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/cluster/{cluster_id}/suspended": { - "parameters": [ - { - "type": "string", - "name": "cluster_id", - "in": "path", - "required": true - } - ], - "get": { - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Suspended" - } - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "parameters": [ - { - "name": "suspended", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Suspended" - } - }, - { - "type": "boolean", - "name": "start_tasks", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "default": { - "description": "Error", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - } - } -} diff --git a/swagger-ui/dist/swagger-ui-bundle.js b/swagger-ui/dist/swagger-ui-bundle.js deleted file mode 100644 index 69227bd79c..0000000000 --- a/swagger-ui/dist/swagger-ui-bundle.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see swagger-ui-bundle.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(function(){try{return require("esprima")}catch(e){}}()):"function"==typeof define&&define.amd?define(["esprima"],t):"object"==typeof exports?exports.SwaggerUIBundle=t(function(){try{return require("esprima")}catch(e){}}()):e.SwaggerUIBundle=t(e.esprima)}(this,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=556)}([function(e,t,n){"use strict";e.exports=n(130)},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return i(e)?e:J(e)}function r(e){return s(e)?e:K(e)}function o(e){return u(e)?e:Y(e)}function a(e){return i(e)&&!c(e)?e:G(e)}function i(e){return!(!e||!e[p])}function s(e){return!(!e||!e[f])}function u(e){return!(!e||!e[h])}function c(e){return s(e)||u(e)}function l(e){return!(!e||!e[d])}t(r,n),t(o,n),t(a,n),n.isIterable=i,n.isKeyed=s,n.isIndexed=u,n.isAssociative=c,n.isOrdered=l,n.Keyed=r,n.Indexed=o,n.Set=a;var p="@@__IMMUTABLE_ITERABLE__@@",f="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",m="delete",v=5,g=1<>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?A(e)+t:t}function k(){return!0}function j(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function T(e,t){return P(e,t,0)}function I(e,t){return P(e,t,t)}function P(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var N=0,M=1,R=2,D="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",B=D||L;function F(e){this.next=e}function U(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function q(){return{value:void 0,done:!0}}function z(e){return!!H(e)}function V(e){return e&&"function"==typeof e.next}function W(e){var t=H(e);return t&&t.call(e)}function H(e){var t=e&&(D&&e[D]||e[L]);if("function"==typeof t)return t}function $(e){return e&&"number"==typeof e.length}function J(e){return null==e?ie():i(e)?e.toSeq():ce(e)}function K(e){return null==e?ie().toKeyedSeq():i(e)?s(e)?e.toSeq():e.fromEntrySeq():se(e)}function Y(e){return null==e?ie():i(e)?s(e)?e.entrySeq():e.toIndexedSeq():ue(e)}function G(e){return(null==e?ie():i(e)?s(e)?e.entrySeq():e:ue(e)).toSetSeq()}F.prototype.toString=function(){return"[Iterator]"},F.KEYS=N,F.VALUES=M,F.ENTRIES=R,F.prototype.inspect=F.prototype.toSource=function(){return this.toString()},F.prototype[B]=function(){return this},t(J,n),J.of=function(){return J(arguments)},J.prototype.toSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq {","}")},J.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},J.prototype.__iterate=function(e,t){return pe(this,e,t,!0)},J.prototype.__iterator=function(e,t){return fe(this,e,t,!0)},t(K,J),K.prototype.toKeyedSeq=function(){return this},t(Y,J),Y.of=function(){return Y(arguments)},Y.prototype.toIndexedSeq=function(){return this},Y.prototype.toString=function(){return this.__toString("Seq [","]")},Y.prototype.__iterate=function(e,t){return pe(this,e,t,!1)},Y.prototype.__iterator=function(e,t){return fe(this,e,t,!1)},t(G,J),G.of=function(){return G(arguments)},G.prototype.toSetSeq=function(){return this},J.isSeq=ae,J.Keyed=K,J.Set=G,J.Indexed=Y;var Z,X,Q,ee="@@__IMMUTABLE_SEQ__@@";function te(e){this._array=e,this.size=e.length}function ne(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function re(e){this._iterable=e,this.size=e.length||e.size}function oe(e){this._iterator=e,this._iteratorCache=[]}function ae(e){return!(!e||!e[ee])}function ie(){return Z||(Z=new te([]))}function se(e){var t=Array.isArray(e)?new te(e).fromEntrySeq():V(e)?new oe(e).fromEntrySeq():z(e)?new re(e).fromEntrySeq():"object"==typeof e?new ne(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function ue(e){var t=le(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function ce(e){var t=le(e)||"object"==typeof e&&new ne(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}function le(e){return $(e)?new te(e):V(e)?new oe(e):z(e)?new re(e):void 0}function pe(e,t,n,r){var o=e._cache;if(o){for(var a=o.length-1,i=0;i<=a;i++){var s=o[n?a-i:i];if(!1===t(s[1],r?s[0]:i,e))return i+1}return i}return e.__iterateUncached(t,n)}function fe(e,t,n,r){var o=e._cache;if(o){var a=o.length-1,i=0;return new F((function(){var e=o[n?a-i:i];return i++>a?q():U(t,r?e[0]:i-1,e[1])}))}return e.__iteratorUncached(t,n)}function he(e,t){return t?de(t,e,"",{"":e}):me(e)}function de(e,t,n,r){return Array.isArray(t)?e.call(r,n,Y(t).map((function(n,r){return de(e,n,r,t)}))):ve(t)?e.call(r,n,K(t).map((function(n,r){return de(e,n,r,t)}))):t}function me(e){return Array.isArray(e)?Y(e).map(me).toList():ve(e)?K(e).map(me).toMap():e}function ve(e){return e&&(e.constructor===Object||void 0===e.constructor)}function ge(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function ye(e,t){if(e===t)return!0;if(!i(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||u(e)!==u(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!c(e);if(l(e)){var r=e.entries();return t.every((function(e,t){var o=r.next().value;return o&&ge(o[1],e)&&(n||ge(o[0],t))}))&&r.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var a=e;e=t,t=a}var p=!0,f=t.__iterate((function(t,r){if(n?!e.has(t):o?!ge(t,e.get(r,b)):!ge(e.get(r,b),t))return p=!1,!1}));return p&&e.size===f}function be(e,t){if(!(this instanceof be))return new be(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(X)return X;X=this}}function _e(e,t){if(!e)throw new Error(t)}function xe(e,t,n){if(!(this instanceof xe))return new xe(e,t,n);if(_e(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),tr?q():U(e,o,n[t?r-o++:o++])}))},t(ne,K),ne.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},ne.prototype.has=function(e){return this._object.hasOwnProperty(e)},ne.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length-1,a=0;a<=o;a++){var i=r[t?o-a:a];if(!1===e(n[i],i,this))return a+1}return a},ne.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length-1,a=0;return new F((function(){var i=r[t?o-a:a];return a++>o?q():U(e,i,n[i])}))},ne.prototype[d]=!0,t(re,Y),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=W(this._iterable),r=0;if(V(n))for(var o;!(o=n.next()).done&&!1!==e(o.value,r++,this););return r},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=W(this._iterable);if(!V(n))return new F(q);var r=0;return new F((function(){var t=n.next();return t.done?t:U(e,r++,t.value)}))},t(oe,Y),oe.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,o=this._iteratorCache,a=0;a=r.length){var t=n.next();if(t.done)return t;r[o]=t.value}return U(e,o,r[o++])}))},t(be,Y),be.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},be.prototype.get=function(e,t){return this.has(e)?this._value:t},be.prototype.includes=function(e){return ge(this._value,e)},be.prototype.slice=function(e,t){var n=this.size;return j(e,t,n)?this:new be(this._value,I(t,n)-T(e,n))},be.prototype.reverse=function(){return this},be.prototype.indexOf=function(e){return ge(this._value,e)?0:-1},be.prototype.lastIndexOf=function(e){return ge(this._value,e)?this.size:-1},be.prototype.__iterate=function(e,t){for(var n=0;n=0&&t=0&&nn?q():U(e,a++,i)}))},xe.prototype.equals=function(e){return e instanceof xe?this._start===e._start&&this._end===e._end&&this._step===e._step:ye(this,e)},t(we,n),t(Ee,we),t(Se,we),t(Ce,we),we.Keyed=Ee,we.Indexed=Se,we.Set=Ce;var Ae="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function Oe(e){return e>>>1&1073741824|3221225471&e}function ke(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return Oe(n)}if("string"===t)return e.length>Fe?je(e):Te(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return Ie(e);if("function"==typeof e.toString)return Te(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function je(e){var t=ze[e];return void 0===t&&(t=Te(e),qe===Ue&&(qe=0,ze={}),qe++,ze[e]=t),t}function Te(e){for(var t=0,n=0;n0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}var Re,De="function"==typeof WeakMap;De&&(Re=new WeakMap);var Le=0,Be="__immutablehash__";"function"==typeof Symbol&&(Be=Symbol(Be));var Fe=16,Ue=255,qe=0,ze={};function Ve(e){_e(e!==1/0,"Cannot perform this action with an infinite size.")}function We(e){return null==e?ot():He(e)&&!l(e)?e:ot().withMutations((function(t){var n=r(e);Ve(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function He(e){return!(!e||!e[Je])}t(We,Ee),We.of=function(){var t=e.call(arguments,0);return ot().withMutations((function(e){for(var n=0;n=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}}))},We.prototype.toString=function(){return this.__toString("Map {","}")},We.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},We.prototype.set=function(e,t){return at(this,e,t)},We.prototype.setIn=function(e,t){return this.updateIn(e,b,(function(){return t}))},We.prototype.remove=function(e){return at(this,e,b)},We.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return b}))},We.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},We.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=vt(this,wn(e),t,n);return r===b?void 0:r},We.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):ot()},We.prototype.merge=function(){return ft(this,void 0,arguments)},We.prototype.mergeWith=function(t){return ft(this,t,e.call(arguments,1))},We.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,ot(),(function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]}))},We.prototype.mergeDeep=function(){return ft(this,ht,arguments)},We.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return ft(this,dt(t),n)},We.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,ot(),(function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]}))},We.prototype.sort=function(e){return zt(pn(this,e))},We.prototype.sortBy=function(e,t){return zt(pn(this,t,e))},We.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},We.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new S)},We.prototype.asImmutable=function(){return this.__ensureOwner()},We.prototype.wasAltered=function(){return this.__altered},We.prototype.__iterator=function(e,t){return new et(this,e,t)},We.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate((function(t){return r++,e(t[1],t[0],n)}),t),r},We.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?rt(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},We.isMap=He;var $e,Je="@@__IMMUTABLE_MAP__@@",Ke=We.prototype;function Ye(e,t){this.ownerID=e,this.entries=t}function Ge(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function Ze(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Xe(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Qe(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function et(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&nt(e._root)}function tt(e,t){return U(e,t[0],t[1])}function nt(e,t){return{node:e,index:0,__prev:t}}function rt(e,t,n,r){var o=Object.create(Ke);return o.size=e,o._root=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function ot(){return $e||($e=rt(0))}function at(e,t,n){var r,o;if(e._root){var a=w(_),i=w(x);if(r=it(e._root,e.__ownerID,0,void 0,t,n,a,i),!i.value)return e;o=e.size+(a.value?n===b?-1:1:0)}else{if(n===b)return e;o=1,r=new Ye(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=o,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?rt(o,r):ot()}function it(e,t,n,r,o,a,i,s){return e?e.update(t,n,r,o,a,i,s):a===b?e:(E(s),E(i),new Qe(t,r,[o,a]))}function st(e){return e.constructor===Qe||e.constructor===Xe}function ut(e,t,n,r,o){if(e.keyHash===r)return new Xe(t,r,[e.entry,o]);var a,i=(0===n?e.keyHash:e.keyHash>>>n)&y,s=(0===n?r:r>>>n)&y;return new Ge(t,1<>>=1)i[s]=1&n?t[a++]:void 0;return i[r]=o,new Ze(e,a+1,i)}function ft(e,t,n){for(var o=[],a=0;a>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function yt(e,t,n,r){var o=r?e:C(e);return o[t]=n,o}function bt(e,t,n,r){var o=e.length+1;if(r&&t+1===o)return e[t]=n,e;for(var a=new Array(o),i=0,s=0;s=xt)return ct(e,u,r,o);var f=e&&e===this.ownerID,h=f?u:C(u);return p?s?c===l-1?h.pop():h[c]=h.pop():h[c]=[r,o]:h.push([r,o]),f?(this.entries=h,this):new Ye(e,h)}},Ge.prototype.get=function(e,t,n,r){void 0===t&&(t=ke(n));var o=1<<((0===e?t:t>>>e)&y),a=this.bitmap;return 0==(a&o)?r:this.nodes[gt(a&o-1)].get(e+v,t,n,r)},Ge.prototype.update=function(e,t,n,r,o,a,i){void 0===n&&(n=ke(r));var s=(0===t?n:n>>>t)&y,u=1<=wt)return pt(e,f,c,s,d);if(l&&!d&&2===f.length&&st(f[1^p]))return f[1^p];if(l&&d&&1===f.length&&st(d))return d;var m=e&&e===this.ownerID,g=l?d?c:c^u:c|u,_=l?d?yt(f,p,d,m):_t(f,p,m):bt(f,p,d,m);return m?(this.bitmap=g,this.nodes=_,this):new Ge(e,g,_)},Ze.prototype.get=function(e,t,n,r){void 0===t&&(t=ke(n));var o=(0===e?t:t>>>e)&y,a=this.nodes[o];return a?a.get(e+v,t,n,r):r},Ze.prototype.update=function(e,t,n,r,o,a,i){void 0===n&&(n=ke(r));var s=(0===t?n:n>>>t)&y,u=o===b,c=this.nodes,l=c[s];if(u&&!l)return this;var p=it(l,e,t+v,n,r,o,a,i);if(p===l)return this;var f=this.count;if(l){if(!p&&--f0&&r=0&&e>>t&y;if(r>=this.array.length)return new kt([],e);var o,a=0===r;if(t>0){var i=this.array[r];if((o=i&&i.removeBefore(e,t-v,n))===i&&a)return this}if(a&&!o)return this;var s=Lt(this,e);if(!a)for(var u=0;u>>t&y;if(o>=this.array.length)return this;if(t>0){var a=this.array[o];if((r=a&&a.removeAfter(e,t-v,n))===a&&o===this.array.length-1)return this}var i=Lt(this,e);return i.array.splice(o+1),r&&(i.array[o]=r),i};var jt,Tt,It={};function Pt(e,t){var n=e._origin,r=e._capacity,o=qt(r),a=e._tail;return i(e._root,e._level,0);function i(e,t,n){return 0===t?s(e,n):u(e,t,n)}function s(e,i){var s=i===o?a&&a.array:e&&e.array,u=i>n?0:n-i,c=r-i;return c>g&&(c=g),function(){if(u===c)return It;var e=t?--c:u++;return s&&s[e]}}function u(e,o,a){var s,u=e&&e.array,c=a>n?0:n-a>>o,l=1+(r-a>>o);return l>g&&(l=g),function(){for(;;){if(s){var e=s();if(e!==It)return e;s=null}if(c===l)return It;var n=t?--l:c++;s=i(u&&u[n],o-v,a+(n<=e.size||t<0)return e.withMutations((function(e){t<0?Ft(e,t).set(0,n):Ft(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,o=e._root,a=w(x);return t>=qt(e._capacity)?r=Dt(r,e.__ownerID,0,t,n,a):o=Dt(o,e.__ownerID,e._level,t,n,a),a.value?e.__ownerID?(e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e):Nt(e._origin,e._capacity,e._level,o,r):e}function Dt(e,t,n,r,o,a){var i,s=r>>>n&y,u=e&&s0){var c=e&&e.array[s],l=Dt(c,t,n-v,r,o,a);return l===c?e:((i=Lt(e,t)).array[s]=l,i)}return u&&e.array[s]===o?e:(E(a),i=Lt(e,t),void 0===o&&s===i.array.length-1?i.array.pop():i.array[s]=o,i)}function Lt(e,t){return t&&e&&t===e.ownerID?e:new kt(e?e.array.slice():[],t)}function Bt(e,t){if(t>=qt(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&y],r-=v;return n}}function Ft(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new S,o=e._origin,a=e._capacity,i=o+t,s=void 0===n?a:n<0?a+n:o+n;if(i===o&&s===a)return e;if(i>=s)return e.clear();for(var u=e._level,c=e._root,l=0;i+l<0;)c=new kt(c&&c.array.length?[void 0,c]:[],r),l+=1<<(u+=v);l&&(i+=l,o+=l,s+=l,a+=l);for(var p=qt(a),f=qt(s);f>=1<p?new kt([],r):h;if(h&&f>p&&iv;g-=v){var b=p>>>g&y;m=m.array[b]=Lt(m.array[b],r)}m.array[p>>>v&y]=h}if(s=f)i-=f,s-=f,u=v,c=null,d=d&&d.removeBefore(r,0,i);else if(i>o||f>>u&y;if(_!==f>>>u&y)break;_&&(l+=(1<o&&(c=c.removeBefore(r,u,i-l)),c&&fa&&(a=c.size),i(u)||(c=c.map((function(e){return he(e)}))),r.push(c)}return a>e.size&&(e=e.setSize(a)),mt(e,t,r)}function qt(e){return e>>v<=g&&i.size>=2*a.size?(r=(o=i.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(r.__ownerID=o.__ownerID=e.__ownerID)):(r=a.remove(t),o=s===i.size-1?i.pop():i.set(s,void 0))}else if(u){if(n===i.get(s)[1])return e;r=a,o=i.set(s,[t,n])}else r=a.set(t,i.size),o=i.set(i.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=o,e.__hash=void 0,e):Wt(r,o)}function Jt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Kt(e){this._iter=e,this.size=e.size}function Yt(e){this._iter=e,this.size=e.size}function Gt(e){this._iter=e,this.size=e.size}function Zt(e){var t=bn(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=_n,t.__iterateUncached=function(t,n){var r=this;return e.__iterate((function(e,n){return!1!==t(n,e,r)}),n)},t.__iteratorUncached=function(t,n){if(t===R){var r=e.__iterator(t,n);return new F((function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(t===M?N:M,n)},t}function Xt(e,t,n){var r=bn(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,o){var a=e.get(r,b);return a===b?o:t.call(n,a,r,e)},r.__iterateUncached=function(r,o){var a=this;return e.__iterate((function(e,o,i){return!1!==r(t.call(n,e,o,i),o,a)}),o)},r.__iteratorUncached=function(r,o){var a=e.__iterator(R,o);return new F((function(){var o=a.next();if(o.done)return o;var i=o.value,s=i[0];return U(r,s,t.call(n,i[1],s,e),o)}))},r}function Qt(e,t){var n=bn(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Zt(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=_n,n.__iterate=function(t,n){var r=this;return e.__iterate((function(e,n){return t(e,n,r)}),!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function en(e,t,n,r){var o=bn(e);return r&&(o.has=function(r){var o=e.get(r,b);return o!==b&&!!t.call(n,o,r,e)},o.get=function(r,o){var a=e.get(r,b);return a!==b&&t.call(n,a,r,e)?a:o}),o.__iterateUncached=function(o,a){var i=this,s=0;return e.__iterate((function(e,a,u){if(t.call(n,e,a,u))return s++,o(e,r?a:s-1,i)}),a),s},o.__iteratorUncached=function(o,a){var i=e.__iterator(R,a),s=0;return new F((function(){for(;;){var a=i.next();if(a.done)return a;var u=a.value,c=u[0],l=u[1];if(t.call(n,l,c,e))return U(o,r?c:s++,l,a)}}))},o}function tn(e,t,n){var r=We().asMutable();return e.__iterate((function(o,a){r.update(t.call(n,o,a,e),0,(function(e){return e+1}))})),r.asImmutable()}function nn(e,t,n){var r=s(e),o=(l(e)?zt():We()).asMutable();e.__iterate((function(a,i){o.update(t.call(n,a,i,e),(function(e){return(e=e||[]).push(r?[i,a]:a),e}))}));var a=yn(e);return o.map((function(t){return mn(e,a(t))}))}function rn(e,t,n,r){var o=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=o:n|=0),j(t,n,o))return e;var a=T(t,o),i=I(n,o);if(a!=a||i!=i)return rn(e.toSeq().cacheResult(),t,n,r);var s,u=i-a;u==u&&(s=u<0?0:u);var c=bn(e);return c.size=0===s?s:e.size&&s||void 0,!r&&ae(e)&&s>=0&&(c.get=function(t,n){return(t=O(this,t))>=0&&ts)return q();var e=o.next();return r||t===M?e:U(t,u-1,t===N?void 0:e.value[1],e)}))},c}function on(e,t,n){var r=bn(e);return r.__iterateUncached=function(r,o){var a=this;if(o)return this.cacheResult().__iterate(r,o);var i=0;return e.__iterate((function(e,o,s){return t.call(n,e,o,s)&&++i&&r(e,o,a)})),i},r.__iteratorUncached=function(r,o){var a=this;if(o)return this.cacheResult().__iterator(r,o);var i=e.__iterator(R,o),s=!0;return new F((function(){if(!s)return q();var e=i.next();if(e.done)return e;var o=e.value,u=o[0],c=o[1];return t.call(n,c,u,a)?r===R?e:U(r,u,c,e):(s=!1,q())}))},r}function an(e,t,n,r){var o=bn(e);return o.__iterateUncached=function(o,a){var i=this;if(a)return this.cacheResult().__iterate(o,a);var s=!0,u=0;return e.__iterate((function(e,a,c){if(!s||!(s=t.call(n,e,a,c)))return u++,o(e,r?a:u-1,i)})),u},o.__iteratorUncached=function(o,a){var i=this;if(a)return this.cacheResult().__iterator(o,a);var s=e.__iterator(R,a),u=!0,c=0;return new F((function(){var e,a,l;do{if((e=s.next()).done)return r||o===M?e:U(o,c++,o===N?void 0:e.value[1],e);var p=e.value;a=p[0],l=p[1],u&&(u=t.call(n,l,a,i))}while(u);return o===R?e:U(o,a,l,e)}))},o}function sn(e,t){var n=s(e),o=[e].concat(t).map((function(e){return i(e)?n&&(e=r(e)):e=n?se(e):ue(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===o.length)return e;if(1===o.length){var a=o[0];if(a===e||n&&s(a)||u(e)&&u(a))return a}var c=new te(o);return n?c=c.toKeyedSeq():u(e)||(c=c.toSetSeq()),(c=c.flatten(!0)).size=o.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),c}function un(e,t,n){var r=bn(e);return r.__iterateUncached=function(r,o){var a=0,s=!1;function u(e,c){var l=this;e.__iterate((function(e,o){return(!t||c0}function dn(e,t,r){var o=bn(e);return o.size=new te(r).map((function(e){return e.size})).min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(M,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var a=r.map((function(e){return e=n(e),W(o?e.reverse():e)})),i=0,s=!1;return new F((function(){var n;return s||(n=a.map((function(e){return e.next()})),s=n.some((function(e){return e.done}))),s?q():U(e,i++,t.apply(null,n.map((function(e){return e.value}))))}))},o}function mn(e,t){return ae(e)?t:e.constructor(t)}function vn(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function gn(e){return Ve(e.size),A(e)}function yn(e){return s(e)?r:u(e)?o:a}function bn(e){return Object.create((s(e)?K:u(e)?Y:G).prototype)}function _n(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):J.prototype.cacheResult.call(this)}function xn(e,t){return e>t?1:e=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Kn(e,t)},Vn.prototype.pushAll=function(e){if(0===(e=o(e)).size)return this;Ve(e.size);var t=this.size,n=this._head;return e.reverse().forEach((function(e){t++,n={value:e,next:n}})),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Kn(t,n)},Vn.prototype.pop=function(){return this.slice(1)},Vn.prototype.unshift=function(){return this.push.apply(this,arguments)},Vn.prototype.unshiftAll=function(e){return this.pushAll(e)},Vn.prototype.shift=function(){return this.pop.apply(this,arguments)},Vn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Yn()},Vn.prototype.slice=function(e,t){if(j(e,t,this.size))return this;var n=T(e,this.size);if(I(t,this.size)!==this.size)return Se.prototype.slice.call(this,e,t);for(var r=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=r,this._head=o,this.__hash=void 0,this.__altered=!0,this):Kn(r,o)},Vn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Kn(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Vn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},Vn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new F((function(){if(r){var t=r.value;return r=r.next,U(e,n++,t)}return q()}))},Vn.isStack=Wn;var Hn,$n="@@__IMMUTABLE_STACK__@@",Jn=Vn.prototype;function Kn(e,t,n,r){var o=Object.create(Jn);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Yn(){return Hn||(Hn=Kn(0))}function Gn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}Jn[$n]=!0,Jn.withMutations=Ke.withMutations,Jn.asMutable=Ke.asMutable,Jn.asImmutable=Ke.asImmutable,Jn.wasAltered=Ke.wasAltered,n.Iterator=F,Gn(n,{toArray:function(){Ve(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,n){e[n]=t})),e},toIndexedSeq:function(){return new Kt(this)},toJS:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJS?e.toJS():e})).__toJS()},toJSON:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e})).__toJS()},toKeyedSeq:function(){return new Jt(this,!0)},toMap:function(){return We(this.toKeyedSeq())},toObject:function(){Ve(this.size);var e={};return this.__iterate((function(t,n){e[n]=t})),e},toOrderedMap:function(){return zt(this.toKeyedSeq())},toOrderedSet:function(){return Ln(s(this)?this.valueSeq():this)},toSet:function(){return jn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Yt(this)},toSeq:function(){return u(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Vn(s(this)?this.valueSeq():this)},toList:function(){return St(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return mn(this,sn(this,e.call(arguments,0)))},includes:function(e){return this.some((function(t){return ge(t,e)}))},entries:function(){return this.__iterator(R)},every:function(e,t){Ve(this.size);var n=!0;return this.__iterate((function(r,o,a){if(!e.call(t,r,o,a))return n=!1,!1})),n},filter:function(e,t){return mn(this,en(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return Ve(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Ve(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate((function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""})),t},keys:function(){return this.__iterator(N)},map:function(e,t){return mn(this,Xt(this,e,t))},reduce:function(e,t,n){var r,o;return Ve(this.size),arguments.length<2?o=!0:r=t,this.__iterate((function(t,a,i){o?(o=!1,r=t):r=e.call(n,r,t,a,i)})),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return mn(this,Qt(this,!0))},slice:function(e,t){return mn(this,rn(this,e,t,!0))},some:function(e,t){return!this.every(tr(e),t)},sort:function(e){return mn(this,pn(this,e))},values:function(){return this.__iterator(M)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return A(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return tn(this,e,t)},equals:function(e){return ye(this,e)},entrySeq:function(){var e=this;if(e._cache)return new te(e._cache);var t=e.toSeq().map(er).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(tr(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate((function(n,o,a){if(e.call(t,n,o,a))return r=[o,n],!1})),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(k)},flatMap:function(e,t){return mn(this,cn(this,e,t))},flatten:function(e){return mn(this,un(this,e,!0))},fromEntrySeq:function(){return new Gt(this)},get:function(e,t){return this.find((function(t,n){return ge(n,e)}),void 0,t)},getIn:function(e,t){for(var n,r=this,o=wn(e);!(n=o.next()).done;){var a=n.value;if((r=r&&r.get?r.get(a,b):b)===b)return t}return r},groupBy:function(e,t){return nn(this,e,t)},has:function(e){return this.get(e,b)!==b},hasIn:function(e){return this.getIn(e,b)!==b},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return ge(t,e)}))},keySeq:function(){return this.toSeq().map(Qn).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return fn(this,e)},maxBy:function(e,t){return fn(this,t,e)},min:function(e){return fn(this,e?nr(e):ar)},minBy:function(e,t){return fn(this,t?nr(t):ar,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return mn(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return mn(this,an(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(tr(e),t)},sortBy:function(e,t){return mn(this,pn(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return mn(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return mn(this,on(this,e,t))},takeUntil:function(e,t){return this.takeWhile(tr(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=ir(this))}});var Zn=n.prototype;Zn[p]=!0,Zn[B]=Zn.values,Zn.__toJS=Zn.toArray,Zn.__toStringMapper=rr,Zn.inspect=Zn.toSource=function(){return this.toString()},Zn.chain=Zn.flatMap,Zn.contains=Zn.includes,Gn(r,{flip:function(){return mn(this,Zt(this))},mapEntries:function(e,t){var n=this,r=0;return mn(this,this.toSeq().map((function(o,a){return e.call(t,[a,o],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return mn(this,this.toSeq().flip().map((function(r,o){return e.call(t,r,o,n)})).flip())}});var Xn=r.prototype;function Qn(e,t){return t}function er(e,t){return[t,e]}function tr(e){return function(){return!e.apply(this,arguments)}}function nr(e){return function(){return-e.apply(this,arguments)}}function rr(e){return"string"==typeof e?JSON.stringify(e):String(e)}function or(){return C(arguments)}function ar(e,t){return et?-1:0}function ir(e){if(e.size===1/0)return 0;var t=l(e),n=s(e),r=t?1:0;return sr(e.__iterate(n?t?function(e,t){r=31*r+ur(ke(e),ke(t))|0}:function(e,t){r=r+ur(ke(e),ke(t))|0}:t?function(e){r=31*r+ke(e)|0}:function(e){r=r+ke(e)|0}),r)}function sr(e,t){return t=Ae(t,3432918353),t=Ae(t<<15|t>>>-15,461845907),t=Ae(t<<13|t>>>-13,5),t=Ae((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=Oe((t=Ae(t^t>>>13,3266489909))^t>>>16)}function ur(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return Xn[f]=!0,Xn[B]=Zn.entries,Xn.__toJS=Zn.toObject,Xn.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+rr(e)},Gn(o,{toKeyedSeq:function(){return new Jt(this,!1)},filter:function(e,t){return mn(this,en(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return mn(this,Qt(this,!1))},slice:function(e,t){return mn(this,rn(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=T(e,e<0?this.count():this.size);var r=this.slice(0,e);return mn(this,1===n?r:r.concat(C(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return mn(this,un(this,e,!1))},get:function(e,t){return(e=O(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,n){return n===e}),void 0,t)},has:function(e){return(e=O(this,e))>=0&&(void 0!==this.size?this.size===1/0||e1)try{return decodeURIComponent(t[1])}catch(e){console.error(e)}return null}function Ne(e){return t=e.replace(/\.[^./]*$/,""),Y()(J()(t));var t}function Me(e,t,n,r,a){if(!t)return[];var s=[],u=t.get("nullable"),c=t.get("required"),p=t.get("maximum"),h=t.get("minimum"),d=t.get("type"),m=t.get("format"),g=t.get("maxLength"),b=t.get("minLength"),x=t.get("uniqueItems"),w=t.get("maxItems"),E=t.get("minItems"),S=t.get("pattern"),C=n||c,A=null!=e;if(u&&null===e||!d||!(C||A&&"array"===d||!(!C&&!A)))return[];var O="string"===d&&e,k="array"===d&&l()(e)&&e.length,j="array"===d&&W.a.List.isList(e)&&e.count(),T=[O,k,j,"array"===d&&"string"==typeof e&&e,"file"===d&&e instanceof se.a.File,"boolean"===d&&(e||!1===e),"number"===d&&(e||0===e),"integer"===d&&(e||0===e),"object"===d&&"object"===i()(e)&&null!==e,"object"===d&&"string"==typeof e&&e],I=P()(T).call(T,(function(e){return!!e}));if(C&&!I&&!r)return s.push("Required field is not provided"),s;if("object"===d&&(null===a||"application/json"===a)){var N,M=e;if("string"==typeof e)try{M=JSON.parse(e)}catch(e){return s.push("Parameter string value must be valid JSON"),s}if(t&&t.has("required")&&Se(c.isList)&&c.isList()&&y()(c).call(c,(function(e){void 0===M[e]&&s.push({propKey:e,error:"Required property not found"})})),t&&t.has("properties"))y()(N=t.get("properties")).call(N,(function(e,t){var n=Me(M[t],e,!1,r,a);s.push.apply(s,o()(f()(n).call(n,(function(e){return{propKey:t,error:e}}))))}))}if(S){var R=function(e,t){if(!new RegExp(t).test(e))return"Value must follow pattern "+t}(e,S);R&&s.push(R)}if(E&&"array"===d){var D=function(e,t){var n;if(!e&&t>=1||e&&e.lengtht)return v()(n="Array must not contain more then ".concat(t," item")).call(n,1===t?"":"s")}(e,w);L&&s.push({needRemove:!0,error:L})}if(x&&"array"===d){var B=function(e,t){if(e&&("true"===t||!0===t)){var n=Object(V.fromJS)(e),r=n.toSet();if(e.length>r.size){var o=Object(V.Set)();if(y()(n).call(n,(function(e,t){_()(n).call(n,(function(t){return Se(t.equals)?t.equals(e):t===e})).size>1&&(o=o.add(t))})),0!==o.size)return f()(o).call(o,(function(e){return{index:e,error:"No duplicates allowed."}})).toArray()}}}(e,x);B&&s.push.apply(s,o()(B))}if(g||0===g){var F=function(e,t){var n;if(e.length>t)return v()(n="Value must be no longer than ".concat(t," character")).call(n,1!==t?"s":"")}(e,g);F&&s.push(F)}if(b){var U=function(e,t){var n;if(e.lengtht)return"Value must be less than ".concat(t)}(e,p);q&&s.push(q)}if(h||0===h){var z=function(e,t){if(e2&&void 0!==arguments[2]?arguments[2]:{},r=n.isOAS3,o=void 0!==r&&r,a=n.bypassRequiredCheck,i=void 0!==a&&a,s=e.get("required"),u=Object(le.a)(e,{isOAS3:o}),c=u.schema,l=u.parameterContentMediaType;return Me(t,c,s,i,l)},De=function(e,t,n){if(e&&(!e.xml||!e.xml.name)){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'\n\x3c!-- XML example cannot be generated; root element name is undefined --\x3e':null;var r=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=r[1]}return Object(ie.memoizedCreateXMLExample)(e,t,n)},Le=[{when:/json/,shouldStringifyTypes:["string"]}],Be=["object"],Fe=function(e,t,n,r){var a=Object(ie.memoizedSampleFromSchema)(e,t,r),s=i()(a),u=S()(Le).call(Le,(function(e,t){var r;return t.when.test(n)?v()(r=[]).call(r,o()(e),o()(t.shouldStringifyTypes)):e}),Be);return te()(u,(function(e){return e===s}))?M()(a,null,2):a},Ue=function(e,t,n,r){var o,a=Fe(e,t,n,r);try{"\n"===(o=ve.a.safeDump(ve.a.safeLoad(a),{lineWidth:-1}))[o.length-1]&&(o=T()(o).call(o,0,o.length-1))}catch(e){return console.error(e),"error: could not generate yaml example"}return o.replace(/\t/g," ")},qe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;return e&&Se(e.toJS)&&(e=e.toJS()),r&&Se(r.toJS)&&(r=r.toJS()),/xml/.test(t)?De(e,n,r):/(yaml|yml)/.test(t)?Ue(e,n,t,r):Fe(e,n,t,r)},ze=function(){var e={},t=se.a.location.search;if(!t)return{};if(""!=t){var n=t.substr(1).split("&");for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(r=n[r].split("="),e[decodeURIComponent(r[0])]=r[1]&&decodeURIComponent(r[1])||"")}return e},Ve=function(t){return(t instanceof e?t:e.from(t.toString(),"utf-8")).toString("base64")},We={operationsSorter:{alpha:function(e,t){return e.get("path").localeCompare(t.get("path"))},method:function(e,t){return e.get("method").localeCompare(t.get("method"))}},tagsSorter:{alpha:function(e,t){return e.localeCompare(t)}}},He=function(e){var t=[];for(var n in e){var r=e[n];void 0!==r&&""!==r&&t.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return t.join("&")},$e=function(e,t,n){return!!Q()(n,(function(n){return re()(e[n],t[n])}))};function Je(e){return"string"!=typeof e||""===e?"":Object(H.sanitizeUrl)(e)}function Ke(e){return!(!e||D()(e).call(e,"localhost")>=0||D()(e).call(e,"127.0.0.1")>=0||"none"===e)}function Ye(e){if(!W.a.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;var t=B()(e).call(e,(function(e,t){return U()(t).call(t,"2")&&w()(e.get("content")||{}).length>0})),n=e.get("default")||W.a.OrderedMap(),r=(n.get("content")||W.a.OrderedMap()).keySeq().toJS().length?n:null;return t||r}var Ge=function(e){return"string"==typeof e||e instanceof String?z()(e).call(e).replace(/\s/g,"%20"):""},Ze=function(e){return ce()(Ge(e).replace(/%20/g,"_"))},Xe=function(e){return _()(e).call(e,(function(e,t){return/^x-/.test(t)}))},Qe=function(e){return _()(e).call(e,(function(e,t){return/^pattern|maxLength|minLength|maximum|minimum/.test(t)}))};function et(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0};if("object"!==i()(e)||l()(e)||null===e||!t)return e;var o=A()({},e);return y()(n=w()(o)).call(n,(function(e){e===t&&r(o[e],e)?delete o[e]:o[e]=et(o[e],t,r)})),o}function tt(e){if("string"==typeof e)return e;if(e&&e.toJS&&(e=e.toJS()),"object"===i()(e)&&null!==e)try{return M()(e,null,2)}catch(t){return String(e)}return null==e?"":e.toString()}function nt(e){return"number"==typeof e?e.toString():e}function rt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.returnAll,r=void 0!==n&&n,o=t.allowHashes,a=void 0===o||o;if(!W.a.Map.isMap(e))throw new Error("paramToIdentifier: received a non-Im.Map parameter as input");var i,s,u,c=e.get("name"),l=e.get("in"),p=[];e&&e.hashCode&&l&&c&&a&&p.push(v()(i=v()(s="".concat(l,".")).call(s,c,".hash-")).call(i,e.hashCode()));l&&c&&p.push(v()(u="".concat(l,".")).call(u,c));return p.push(c),r?p:p[0]||""}function ot(e,t){var n,r=rt(e,{returnAll:!0});return _()(n=f()(r).call(r,(function(e){return t[e]}))).call(n,(function(e){return void 0!==e}))[0]}function at(){return st(fe()(32).toString("base64"))}function it(e){return st(de()("sha256").update(e).digest("base64"))}function st(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}var ut=function(e){return!e||!(!ye(e)||!e.isEmpty())}}).call(this,n(75).Buffer)},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(246);function o(e,t){for(var n=0;n1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:r,n=null,a=null;return function(){return o(t,n,arguments)||(a=e.apply(null,arguments)),n=arguments,a}}))},function(e,t,n){e.exports=n(679)},function(e,t,n){var r=n(180),o=n(583);function a(t){return"function"==typeof r&&"symbol"==typeof o?(e.exports=a=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=a=function(e){return e&&"function"==typeof r&&e.constructor===r&&e!==r.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),a(t)}e.exports=a,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){e.exports=n(614)},function(e,t,n){e.exports=n(609)},function(e,t,n){e.exports=n(607)},function(e,t,n){"use strict";var r=n(41),o=n(107).f,a=n(367),i=n(33),s=n(110),u=n(68),c=n(54),l=function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,p,f,h,d,m,v,g,y=e.target,b=e.global,_=e.stat,x=e.proto,w=b?r:_?r[y]:(r[y]||{}).prototype,E=b?i:i[y]||(i[y]={}),S=E.prototype;for(f in t)n=!a(b?f:y+(_?".":"#")+f,e.forced)&&w&&c(w,f),d=E[f],n&&(m=e.noTargetGet?(g=o(w,f))&&g.value:w[f]),h=n&&m?m:t[f],n&&typeof d==typeof h||(v=e.bind&&n?s(h,r):e.wrap&&n?l(h):x&&"function"==typeof h?s(Function.call,h):h,(e.sham||h&&h.sham||d&&d.sham)&&u(v,"sham",!0),E[f]=v,x&&(c(i,p=y+"Prototype")||u(i,p,{}),i[p][f]=h,e.real&&S&&!S[f]&&u(S,f,h)))}},function(e,t,n){e.exports=n(612)},function(e,t,n){e.exports=n(409)},function(e,t,n){var r=n(458),o=n(459),a=n(886),i=n(460),s=n(891),u=n(893),c=n(898),l=n(246),p=n(3);function f(e,t){var n=r(e);if(o){var s=o(e);t&&(s=a(s).call(s,(function(t){return i(e,t).enumerable}))),n.push.apply(n,s)}return n}e.exports=function(e){for(var t=1;t>",i=function(){invariant(!1,"ImmutablePropTypes type checking code is stripped in production.")};i.isRequired=i;var s=function(){return i};function u(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":e instanceof o.Iterable?"Immutable."+e.toSource().split(" ")[0]:t}function c(e){function t(t,n,r,o,i,s){for(var u=arguments.length,c=Array(u>6?u-6:0),l=6;l4)}function l(e){var t=e.get("swagger");return"string"==typeof t&&i()(t).call(t,"2.0")}function p(e){return function(t,n){return function(r){return n&&n.specSelectors&&n.specSelectors.specJson?c(n.specSelectors.specJson())?u.a.createElement(e,o()({},r,n,{Ori:t})):u.a.createElement(t,r):(console.warn("OAS3 wrapper: couldn't get spec"),null)}}}},function(e,t,n){e.exports=n(603)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(41),o=n(232),a=n(54),i=n(184),s=n(234),u=n(368),c=o("wks"),l=r.Symbol,p=u?l:l&&l.withoutSetter||i;e.exports=function(e){return a(c,e)&&(s||"string"==typeof c[e])||(s&&a(l,e)?c[e]=l[e]:c[e]=p("Symbol."+e)),c[e]}},function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=i(e),c=1;c0){var o=v()(n).call(n,(function(e){return console.error(e),e.line=e.fullPath?_(x,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",y()(e,"message",{enumerable:!0,value:e.message}),e}));a.newThrownErrBatch(o)}return r.updateResolved(t)}))}},Ce=[],Ae=Z()(u()(f.a.mark((function e(){var t,n,r,o,a,i,s,c,l,p,h,m,g,b,x,E,C,O;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Ce.system){e.next=4;break}return console.error("debResolveSubtrees: don't have a system to operate on, aborting."),e.abrupt("return");case 4:if(n=t.errActions,r=t.errSelectors,o=t.fn,a=o.resolveSubtree,i=o.fetch,s=o.AST,c=void 0===s?{}:s,l=t.specSelectors,p=t.specActions,a){e.next=8;break}return console.error("Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing."),e.abrupt("return");case 8:return h=c.getLineNumberForPath?c.getLineNumberForPath:function(){},m=l.specStr(),g=t.getConfigs(),b=g.modelPropertyMacro,x=g.parameterMacro,E=g.requestInterceptor,C=g.responseInterceptor,e.prev=11,e.next=14,_()(Ce).call(Ce,function(){var e=u()(f.a.mark((function e(t,o){var s,c,p,g,_,O,j,T,I;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return s=e.sent,c=s.resultMap,p=s.specWithCurrentSubtrees,e.next=7,a(p,o,{baseDoc:l.url(),modelPropertyMacro:b,parameterMacro:x,requestInterceptor:E,responseInterceptor:C});case 7:if(g=e.sent,_=g.errors,O=g.spec,r.allErrors().size&&n.clearBy((function(e){var t;return"thrown"!==e.get("type")||"resolver"!==e.get("source")||!w()(t=e.get("fullPath")).call(t,(function(e,t){return e===o[t]||void 0===o[t]}))})),d()(_)&&_.length>0&&(j=v()(_).call(_,(function(e){return e.line=e.fullPath?h(m,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",y()(e,"message",{enumerable:!0,value:e.message}),e})),n.newThrownErrBatch(j)),!O||!l.isOAS3()||"components"!==o[0]||"securitySchemes"!==o[1]){e.next=15;break}return e.next=15,S.a.all(v()(T=A()(I=k()(O)).call(I,(function(e){return"openIdConnect"===e.type}))).call(T,function(){var e=u()(f.a.mark((function e(t){var n,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={url:t.openIdConnectUrl,requestInterceptor:E,responseInterceptor:C},e.prev=1,e.next=4,i(n);case 4:(r=e.sent)instanceof Error||r.status>=400?console.error(r.statusText+" "+n.url):t.openIdConnectData=JSON.parse(r.text),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),console.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}()));case 15:return Q()(c,o,O),Q()(p,o,O),e.abrupt("return",{resultMap:c,specWithCurrentSubtrees:p});case 18:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),S.a.resolve({resultMap:(l.specResolvedSubtree([])||Object(V.Map)()).toJS(),specWithCurrentSubtrees:l.specJson().toJS()}));case 14:O=e.sent,delete Ce.system,Ce=[],e.next=22;break;case 19:e.prev=19,e.t0=e.catch(11),console.error(e.t0);case 22:p.updateResolvedSubtree([],O.resultMap);case 23:case"end":return e.stop()}}),e,null,[[11,19]])}))),35),Oe=function(e){return function(t){var n;T()(n=v()(Ce).call(Ce,(function(e){return e.join("@@")}))).call(n,e.join("@@"))>-1||(Ce.push(e),Ce.system=t,Ae())}};function ke(e,t,n,r,o){return{type:oe,payload:{path:e,value:r,paramName:t,paramIn:n,isXml:o}}}function je(e,t,n,r){return{type:oe,payload:{path:e,param:t,value:n,isXml:r}}}var Te=function(e,t){return{type:ve,payload:{path:e,value:t}}},Ie=function(){return{type:ve,payload:{path:[],value:Object(V.Map)()}}},Pe=function(e,t){return{type:ie,payload:{pathMethod:e,isOAS3:t}}},Ne=function(e,t,n,r){return{type:ae,payload:{pathMethod:e,paramName:t,paramIn:n,includeEmptyValue:r}}};function Me(e){return{type:he,payload:{pathMethod:e}}}function Re(e,t){return{type:de,payload:{path:e,value:t,key:"consumes_value"}}}function De(e,t){return{type:de,payload:{path:e,value:t,key:"produces_value"}}}var Le=function(e,t,n){return{payload:{path:e,method:t,res:n},type:se}},Be=function(e,t,n){return{payload:{path:e,method:t,req:n},type:ue}},Fe=function(e,t,n){return{payload:{path:e,method:t,req:n},type:ce}},Ue=function(e){return{payload:e,type:le}},qe=function(e){return function(t){var n,r,o=t.fn,a=t.specActions,i=t.specSelectors,s=t.getConfigs,c=t.oas3Selectors,l=e.pathName,p=e.method,h=e.operation,m=s(),g=m.requestInterceptor,y=m.responseInterceptor,b=h.toJS();h&&h.get("parameters")&&P()(n=A()(r=h.get("parameters")).call(r,(function(e){return e&&!0===e.get("allowEmptyValue")}))).call(n,(function(t){if(i.parameterInclusionSettingFor([l,p],t.get("name"),t.get("in"))){e.parameters=e.parameters||{};var n=Object(ee.B)(t,e.parameters);(!n||n&&0===n.size)&&(e.parameters[t.get("name")]="")}}));if(e.contextUrl=H()(i.url()).toString(),b&&b.operationId?e.operationId=b.operationId:b&&l&&p&&(e.operationId=o.opId(b,l,p)),i.isOAS3()){var _,x=M()(_="".concat(l,":")).call(_,p);e.server=c.selectedServer(x)||c.selectedServer();var w=c.serverVariables({server:e.server,namespace:x}).toJS(),E=c.serverVariables({server:e.server}).toJS();e.serverVariables=D()(w).length?w:E,e.requestContentType=c.requestContentType(l,p),e.responseContentType=c.responseContentType(l,p)||"*/*";var S,C=c.requestBodyValue(l,p),O=c.requestBodyInclusionSetting(l,p);if(C&&C.toJS)e.requestBody=A()(S=v()(C).call(C,(function(e){return V.Map.isMap(e)?e.get("value"):e}))).call(S,(function(e,t){return(d()(e)?0!==e.length:!Object(ee.q)(e))||O.get(t)})).toJS();else e.requestBody=C}var k=B()({},e);k=o.buildRequest(k),a.setRequest(e.pathName,e.method,k);var j=function(){var t=u()(f.a.mark((function t(n){var r,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.apply(undefined,[n]);case 2:return r=t.sent,o=B()({},r),a.setMutatedRequest(e.pathName,e.method,o),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();e.requestInterceptor=j,e.responseInterceptor=y;var T=U()();return o.execute(e).then((function(t){t.duration=U()()-T,a.setResponse(e.pathName,e.method,t)})).catch((function(t){"Failed to fetch"===t.message&&(t.name="",t.message='**Failed to fetch.** \n**Possible Reasons:** \n - CORS \n - Network Failure \n - URL scheme must be "http" or "https" for CORS request.'),a.setResponse(e.pathName,e.method,{error:!0,err:J()(t)})}))}},ze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.path,n=e.method,r=i()(e,["path","method"]);return function(e){var a=e.fn.fetch,i=e.specSelectors,s=e.specActions,u=i.specJsonWithResolvedSubtrees().toJS(),c=i.operationScheme(t,n),l=i.contentTypeValues([t,n]).toJS(),p=l.requestContentType,f=l.responseContentType,h=/xml/i.test(p),d=i.parameterValues([t,n],h).toJS();return s.executeRequest(o()(o()({},r),{},{fetch:a,spec:u,pathName:t,method:n,parameters:d,requestContentType:p,scheme:c,responseContentType:f}))}};function Ve(e,t){return{type:pe,payload:{path:e,method:t}}}function We(e,t){return{type:fe,payload:{path:e,method:t}}}function He(e,t,n){return{type:ge,payload:{scheme:e,path:t,method:n}}}},function(e,t,n){var r=n(33),o=n(54),a=n(241),i=n(69).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});o(t,e)||i(t,e,{value:a.f(e)})}},function(e,t,n){"use strict";var r=n(166),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],a=["scalar","sequence","mapping"];e.exports=function(e,t){var n,i;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===o.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(n=t.styleAliases||null,i={},null!==n&&Object.keys(n).forEach((function(e){n[e].forEach((function(t){i[String(t)]=e}))})),i),-1===a.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},function(e,t,n){var r=n(37);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t,n){var r=n(180),o=n(655),a=n(248),i=n(406),s=n(188);e.exports=function(e,t){var n;if(void 0===r||null==o(e)){if(a(e)||(n=s(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var u=0,c=function(){};return{s:c,n:function(){return u>=e.length?{done:!0}:{done:!1,value:e[u++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,p=!0,f=!1;return{s:function(){n=i(e)},n:function(){var e=n.next();return p=e.done,e},e:function(e){f=!0,l=e},f:function(){try{p||null==n.return||n.return()}finally{if(f)throw l}}}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(45);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(459),o=n(461),a=n(903);e.exports=function(e,t){if(null==e)return{};var n,i,s=a(e,t);if(r){var u=r(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_SELECTED_SERVER",(function(){return r})),n.d(t,"UPDATE_REQUEST_BODY_VALUE",(function(){return o})),n.d(t,"UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG",(function(){return a})),n.d(t,"UPDATE_REQUEST_BODY_INCLUSION",(function(){return i})),n.d(t,"UPDATE_ACTIVE_EXAMPLES_MEMBER",(function(){return s})),n.d(t,"UPDATE_REQUEST_CONTENT_TYPE",(function(){return u})),n.d(t,"UPDATE_RESPONSE_CONTENT_TYPE",(function(){return c})),n.d(t,"UPDATE_SERVER_VARIABLE_VALUE",(function(){return l})),n.d(t,"SET_REQUEST_BODY_VALIDATE_ERROR",(function(){return p})),n.d(t,"CLEAR_REQUEST_BODY_VALIDATE_ERROR",(function(){return f})),n.d(t,"CLEAR_REQUEST_BODY_VALUE",(function(){return h})),n.d(t,"setSelectedServer",(function(){return d})),n.d(t,"setRequestBodyValue",(function(){return m})),n.d(t,"setRetainRequestBodyValueFlag",(function(){return v})),n.d(t,"setRequestBodyInclusion",(function(){return g})),n.d(t,"setActiveExamplesMember",(function(){return y})),n.d(t,"setRequestContentType",(function(){return b})),n.d(t,"setResponseContentType",(function(){return _})),n.d(t,"setServerVariableValue",(function(){return x})),n.d(t,"setRequestBodyValidateError",(function(){return w})),n.d(t,"clearRequestBodyValidateError",(function(){return E})),n.d(t,"initRequestBodyValidateError",(function(){return S})),n.d(t,"clearRequestBodyValue",(function(){return C}));var r="oas3_set_servers",o="oas3_set_request_body_value",a="oas3_set_request_body_retain_flag",i="oas3_set_request_body_inclusion",s="oas3_set_active_examples_member",u="oas3_set_request_content_type",c="oas3_set_response_content_type",l="oas3_set_server_variable_value",p="oas3_set_request_body_validate_error",f="oas3_clear_request_body_validate_error",h="oas3_clear_request_body_value";function d(e,t){return{type:r,payload:{selectedServerUrl:e,namespace:t}}}function m(e){var t=e.value,n=e.pathMethod;return{type:o,payload:{value:t,pathMethod:n}}}var v=function(e){var t=e.value,n=e.pathMethod;return{type:a,payload:{value:t,pathMethod:n}}};function g(e){var t=e.value,n=e.pathMethod,r=e.name;return{type:i,payload:{value:t,pathMethod:n,name:r}}}function y(e){var t=e.name,n=e.pathMethod,r=e.contextType,o=e.contextName;return{type:s,payload:{name:t,pathMethod:n,contextType:r,contextName:o}}}function b(e){var t=e.value,n=e.pathMethod;return{type:u,payload:{value:t,pathMethod:n}}}function _(e){var t=e.value,n=e.path,r=e.method;return{type:c,payload:{value:t,path:n,method:r}}}function x(e){var t=e.server,n=e.namespace,r=e.key,o=e.val;return{type:l,payload:{server:t,namespace:n,key:r,val:o}}}var w=function(e){var t=e.path,n=e.method,r=e.validationErrors;return{type:p,payload:{path:t,method:n,validationErrors:r}}},E=function(e){var t=e.path,n=e.method;return{type:f,payload:{path:t,method:n}}},S=function(e){var t=e.pathMethod;return{type:f,payload:{path:t[0],method:t[1]}}},C=function(e){var t=e.pathMethod;return{type:h,payload:{pathMethod:t}}}},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=o},function(e,t,n){e.exports=n(682)},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return m})),n.d(t,"e",(function(){return v})),n.d(t,"c",(function(){return y})),n.d(t,"a",(function(){return b})),n.d(t,"d",(function(){return _}));var r=n(50),o=n.n(r),a=n(18),i=n.n(a),s=n(2),u=n.n(s),c=n(59),l=n.n(c),p=n(361),f=n.n(p),h=function(e){return String.prototype.toLowerCase.call(e)},d=function(e){return e.replace(/[^\w]/gi,"_")};function m(e){var t=e.openapi;return!!t&&f()(t,"3")}function v(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.v2OperationIdCompatibilityMode;if(!e||"object"!==i()(e))return null;var a=(e.operationId||"").replace(/\s/g,"");return a.length?d(e.operationId):g(t,n,{v2OperationIdCompatibilityMode:o})}function g(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.v2OperationIdCompatibilityMode;if(o){var a,i,s=u()(a="".concat(t.toLowerCase(),"_")).call(a,e).replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return(s=s||u()(i="".concat(e.substring(1),"_")).call(i,t)).replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return u()(n="".concat(h(t))).call(n,d(e))}function y(e,t){var n;return u()(n="".concat(h(t),"-")).call(n,e)}function b(e,t){return e&&e.paths?function(e,t){return function(e,t,n){if(!e||"object"!==i()(e)||!e.paths||"object"!==i()(e.paths))return null;var r=e.paths;for(var o in r)for(var a in r[o])if("PARAMETERS"!==a.toUpperCase()){var s=r[o][a];if(s&&"object"===i()(s)){var u={spec:e,pathName:o,method:a.toUpperCase(),operation:s},c=t(u);if(n&&c)return u}}return}(e,t,!0)||null}(e,(function(e){var n=e.pathName,r=e.method,o=e.operation;if(!o||"object"!==i()(o))return!1;var a=o.operationId;return[v(o,n,r),y(n,r),a].some((function(e){return e&&e===t}))})):null}function _(e){var t=e.spec,n=t.paths,r={};if(!n||t.$$normalized)return e;for(var a in n){var i=n[a];if(l()(i)){var s=i.parameters,c=function(e){var n=i[e];if(!l()(n))return"continue";var c=v(n,a,e);if(c){r[c]?r[c].push(n):r[c]=[n];var p=r[c];if(p.length>1)p.forEach((function(e,t){var n;e.__originalOperationId=e.__originalOperationId||e.operationId,e.operationId=u()(n="".concat(c)).call(n,t+1)}));else if(void 0!==n.operationId){var f=p[0];f.__originalOperationId=f.__originalOperationId||n.operationId,f.operationId=c}}if("parameters"!==e){var h=[],d={};for(var m in t)"produces"!==m&&"consumes"!==m&&"security"!==m||(d[m]=t[m],h.push(d));if(s&&(d.parameters=s,h.push(d)),h.length){var g,y=o()(h);try{for(y.s();!(g=y.n()).done;){var b=g.value;for(var _ in b)if(n[_]){if("parameters"===_){var x,w=o()(b[_]);try{var E=function(){var e=x.value;n[_].some((function(t){return t.name&&t.name===e.name||t.$ref&&t.$ref===e.$ref||t.$$ref&&t.$$ref===e.$$ref||t===e}))||n[_].push(e)};for(w.s();!(x=w.n()).done;)E()}catch(e){w.e(e)}finally{w.f()}}}else n[_]=b[_]}}catch(e){y.e(e)}finally{y.f()}}}};for(var p in i)c(p)}}return t.$$normalized=!0,e}},function(e,t,n){"use strict";n.r(t),n.d(t,"NEW_THROWN_ERR",(function(){return a})),n.d(t,"NEW_THROWN_ERR_BATCH",(function(){return i})),n.d(t,"NEW_SPEC_ERR",(function(){return s})),n.d(t,"NEW_SPEC_ERR_BATCH",(function(){return u})),n.d(t,"NEW_AUTH_ERR",(function(){return c})),n.d(t,"CLEAR",(function(){return l})),n.d(t,"CLEAR_BY",(function(){return p})),n.d(t,"newThrownErr",(function(){return f})),n.d(t,"newThrownErrBatch",(function(){return h})),n.d(t,"newSpecErr",(function(){return d})),n.d(t,"newSpecErrBatch",(function(){return m})),n.d(t,"newAuthErr",(function(){return v})),n.d(t,"clear",(function(){return g})),n.d(t,"clearBy",(function(){return y}));var r=n(145),o=n.n(r),a="err_new_thrown_err",i="err_new_thrown_err_batch",s="err_new_spec_err",u="err_new_spec_err_batch",c="err_new_auth_err",l="err_clear",p="err_clear_by";function f(e){return{type:a,payload:o()(e)}}function h(e){return{type:i,payload:e}}function d(e){return{type:s,payload:e}}function m(e){return{type:u,payload:e}}function v(e){return{type:c,payload:e}}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:l,payload:e}}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};return{type:p,payload:e}}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){var r=n(75),o=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function i(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=i),a(o,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return q(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return k(this,t,n);case"latin1":case"binary":return j(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var a,i=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;i=2,s/=2,u/=2,n/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){var l=-1;for(a=n;as&&(n=s-u),a=n;a>=0;a--){for(var p=!0,f=0;fo&&(r=o):r=o;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var i=0;i>8,o=n%256,a.push(o),a.push(r);return a}(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function A(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:c>223?3:c>191?2:1;if(o+p<=n)switch(p){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[o+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=e[o+1],i=e[o+2],128==(192&a)&&128==(192&i)&&(u=(15&c)<<12|(63&a)<<6|63&i)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[o+1],i=e[o+2],s=e[o+3],128==(192&a)&&128==(192&i)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&i)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,p=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=p}return function(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(r>>>=0),i=(n>>>=0)-(t>>>=0),s=Math.min(a,i),c=this.slice(r,o),l=e.slice(t,n),p=0;po)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return x(this,e,t,n);case"latin1":case"binary":return w(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function k(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,o,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function M(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,a=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function R(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,a=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function D(e,t,n,r,o,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,a){return a||D(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,a){return a||D(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],o=1,a=0;++a=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,o=1,a=this[e+--r];r>0&&(o*=256);)a+=this[e+--r]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+o]=e/a&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);N(this,e,t,n,o-1,-o)}var a=0,i=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);N(this,e,t,n,o-1,-o)}var a=n-1,i=1,s=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/i>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(i+1===r){(t-=3)>-1&&a.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(53))},function(e,t,n){"use strict";var r=n(857);e.exports=r},function(e,t,n){e.exports=n(668)},function(e,t,n){var r=n(904);function o(e,t,n,o,a,i,s){try{var u=e[i](s),c=u.value}catch(e){return void n(e)}u.done?t(c):r.resolve(c).then(o,a)}e.exports=function(e){return function(){var t=this,n=arguments;return new r((function(r,a){var i=e.apply(t,n);function s(e){o(i,r,a,s,u,"next",e)}function u(e){o(i,r,a,s,u,"throw",e)}s(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,n){var r=n(129),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r,o,a,i=n(372),s=n(41),u=n(45),c=n(68),l=n(54),p=n(233),f=n(187),h=n(158),d=s.WeakMap;if(i){var m=p.state||(p.state=new d),v=m.get,g=m.has,y=m.set;r=function(e,t){return t.facade=e,y.call(m,e,t),t},o=function(e){return v.call(m,e)||{}},a=function(e){return g.call(m,e)}}else{var b=f("state");h[b]=!0,r=function(e,t){return t.facade=e,c(e,b,t),t},o=function(e){return l(e,b)?e[b]:{}},a=function(e){return l(e,b)}}e.exports={set:r,get:o,has:a,enforce:function(e){return a(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!u(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";var r=n(30),o=n(39),a=n(482),i=n(125),s=n(483),u=n(141),c=n(206),l=n(26),p=[],f=0,h=a.getPooled(),d=!1,m=null;function v(){w.ReactReconcileTransaction&&m||r("123")}var g=[{initialize:function(){this.dirtyComponentsLength=p.length},close:function(){this.dirtyComponentsLength!==p.length?(p.splice(0,this.dirtyComponentsLength),x()):p.length=0}},{initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}}];function y(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=a.getPooled(),this.reconcileTransaction=w.ReactReconcileTransaction.getPooled(!0)}function b(e,t){return e._mountOrder-t._mountOrder}function _(e){var t=e.dirtyComponentsLength;t!==p.length&&r("124",t,p.length),p.sort(b),f++;for(var n=0;n",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),p=["%","/","?",";","#"].concat(l),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(1112);function b(e,t,n){if(e&&o.isObject(e)&&e instanceof a)return e;var r=new a;return r.parse(e,t,n),r}a.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),s=-1!==a&&a127?N+="x":N+=P[M];if(!N.match(h)){var D=T.slice(0,O),L=T.slice(O+1),B=P.match(d);B&&(D.push(B[1]),L.unshift(B[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),j||(this.hostname=r.toASCII(this.hostname));var F=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+F,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[w])for(O=0,I=l.length;O0)&&n.host.split("@"))&&(n.auth=j.shift(),n.host=n.hostname=j.shift());return n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!E.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=E.slice(-1)[0],A=(n.host||e.host||E.length>1)&&("."===C||".."===C)||""===C,O=0,k=E.length;k>=0;k--)"."===(C=E[k])?E.splice(k,1):".."===C?(E.splice(k,1),O++):O&&(E.splice(k,1),O--);if(!x&&!w)for(;O--;O)E.unshift("..");!x||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),A&&"/"!==E.join("/").substr(-1)&&E.push("");var j,T=""===E[0]||E[0]&&"/"===E[0].charAt(0);S&&(n.hostname=n.host=T?"":E.length?E.shift():"",(j=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=j.shift(),n.host=n.hostname=j.shift()));return(x=x||n.host&&E.length)&&!T&&E.unshift(""),E.length?n.pathname=E.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},a.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"SHOW_AUTH_POPUP",(function(){return h})),n.d(t,"AUTHORIZE",(function(){return d})),n.d(t,"LOGOUT",(function(){return m})),n.d(t,"PRE_AUTHORIZE_OAUTH2",(function(){return v})),n.d(t,"AUTHORIZE_OAUTH2",(function(){return g})),n.d(t,"VALIDATE",(function(){return y})),n.d(t,"CONFIGURE_AUTH",(function(){return b})),n.d(t,"RESTORE_AUTHORIZATION",(function(){return _})),n.d(t,"showDefinitions",(function(){return x})),n.d(t,"authorize",(function(){return w})),n.d(t,"authorizeWithPersistOption",(function(){return E})),n.d(t,"logout",(function(){return S})),n.d(t,"logoutWithPersistOption",(function(){return C})),n.d(t,"preAuthorizeImplicit",(function(){return A})),n.d(t,"authorizeOauth2",(function(){return O})),n.d(t,"authorizeOauth2WithPersistOption",(function(){return k})),n.d(t,"authorizePassword",(function(){return j})),n.d(t,"authorizeApplication",(function(){return T})),n.d(t,"authorizeAccessCodeWithFormParams",(function(){return I})),n.d(t,"authorizeAccessCodeWithBasicAuthentication",(function(){return P})),n.d(t,"authorizeRequest",(function(){return N})),n.d(t,"configureAuth",(function(){return M})),n.d(t,"restoreAuthorization",(function(){return R})),n.d(t,"persistAuthorizationIfNeeded",(function(){return D}));var r=n(18),o=n.n(r),a=n(32),i=n.n(a),s=n(21),u=n.n(s),c=n(97),l=n.n(c),p=n(27),f=n(5),h="show_popup",d="authorize",m="logout",v="pre_authorize_oauth2",g="authorize_oauth2",y="validate",b="configure_auth",_="restore_authorization";function x(e){return{type:h,payload:e}}function w(e){return{type:d,payload:e}}var E=function(e){return function(t){var n=t.authActions;n.authorize(e),n.persistAuthorizationIfNeeded()}};function S(e){return{type:m,payload:e}}var C=function(e){return function(t){var n=t.authActions;n.logout(e),n.persistAuthorizationIfNeeded()}},A=function(e){return function(t){var n=t.authActions,r=t.errActions,o=e.auth,a=e.token,s=e.isValid,u=o.schema,c=o.name,l=u.get("flow");delete p.a.swaggerUIRedirectOauth2,"accessCode"===l||s||r.newAuthErr({authId:c,source:"auth",level:"warning",message:"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"}),a.error?r.newAuthErr({authId:c,source:"auth",level:"error",message:i()(a)}):n.authorizeOauth2WithPersistOption({auth:o,token:a})}};function O(e){return{type:g,payload:e}}var k=function(e){return function(t){var n=t.authActions;n.authorizeOauth2(e),n.persistAuthorizationIfNeeded()}},j=function(e){return function(t){var n=t.authActions,r=e.schema,o=e.name,a=e.username,i=e.password,s=e.passwordType,c=e.clientId,l=e.clientSecret,p={grant_type:"password",scope:e.scopes.join(" "),username:a,password:i},h={};switch(s){case"request-body":!function(e,t,n){t&&u()(e,{client_id:t});n&&u()(e,{client_secret:n})}(p,c,l);break;case"basic":h.Authorization="Basic "+Object(f.a)(c+":"+l);break;default:console.warn("Warning: invalid passwordType ".concat(s," was passed, not including client id and secret"))}return n.authorizeRequest({body:Object(f.b)(p),url:r.get("tokenUrl"),name:o,headers:h,query:{},auth:e})}};var T=function(e){return function(t){var n=t.authActions,r=e.schema,o=e.scopes,a=e.name,i=e.clientId,s=e.clientSecret,u={Authorization:"Basic "+Object(f.a)(i+":"+s)},c={grant_type:"client_credentials",scope:o.join(" ")};return n.authorizeRequest({body:Object(f.b)(c),name:a,url:r.get("tokenUrl"),auth:e,headers:u})}},I=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,a=t.name,i=t.clientId,s=t.clientSecret,u=t.codeVerifier,c={grant_type:"authorization_code",code:t.code,client_id:i,client_secret:s,redirect_uri:n,code_verifier:u};return r.authorizeRequest({body:Object(f.b)(c),name:a,url:o.get("tokenUrl"),auth:t})}},P=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,a=t.name,i=t.clientId,s=t.clientSecret,u=t.codeVerifier,c={Authorization:"Basic "+Object(f.a)(i+":"+s)},l={grant_type:"authorization_code",code:t.code,client_id:i,redirect_uri:n,code_verifier:u};return r.authorizeRequest({body:Object(f.b)(l),name:a,url:o.get("tokenUrl"),auth:t,headers:c})}},N=function(e){return function(t){var n,r=t.fn,a=t.getConfigs,s=t.authActions,c=t.errActions,p=t.oas3Selectors,f=t.specSelectors,h=t.authSelectors,d=e.body,m=e.query,v=void 0===m?{}:m,g=e.headers,y=void 0===g?{}:g,b=e.name,_=e.url,x=e.auth,w=(h.getConfigs()||{}).additionalQueryStringParams;if(f.isOAS3()){var E=p.serverEffectiveValue(p.selectedServer());n=l()(_,E,!0)}else n=l()(_,f.url(),!0);"object"===o()(w)&&(n.query=u()({},n.query,w));var S=n.toString(),C=u()({Accept:"application/json, text/plain, */*","Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},y);r.fetch({url:S,method:"post",headers:C,query:v,body:d,requestInterceptor:a().requestInterceptor,responseInterceptor:a().responseInterceptor}).then((function(e){var t=JSON.parse(e.data),n=t&&(t.error||""),r=t&&(t.parseError||"");e.ok?n||r?c.newAuthErr({authId:b,level:"error",source:"auth",message:i()(t)}):s.authorizeOauth2WithPersistOption({auth:x,token:t}):c.newAuthErr({authId:b,level:"error",source:"auth",message:e.statusText})})).catch((function(e){var t=new Error(e).message;if(e.response&&e.response.data){var n=e.response.data;try{var r="string"==typeof n?JSON.parse(n):n;r.error&&(t+=", error: ".concat(r.error)),r.error_description&&(t+=", description: ".concat(r.error_description))}catch(e){}}c.newAuthErr({authId:b,level:"error",source:"auth",message:t})}))}};function M(e){return{type:b,payload:e}}function R(e){return{type:_,payload:e}}var D=function(){return function(e){var t=e.authSelectors;if((0,e.getConfigs)().persistAuthorization){var n=t.authorized();localStorage.setItem("authorized",i()(n.toJS()))}}}},function(e,t,n){var r=n(1077);e.exports=function(e){for(var t=1;tS;S++)if((h||S in x)&&(b=w(y=x[S],S,_),e))if(t)A[S]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return S;case 2:u.call(A,y)}else switch(e){case 4:return!1;case 7:u.call(A,y)}return p?-1:c||l?l:A}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterOut:c(7)}},function(e,t,n){"use strict";e.exports={current:null}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t){var n,r,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,c=[],l=!1,p=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):p=-1,c.length&&h())}function h(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(u=c,c=[];++p1)for(var n=1;n0&&"/"!==t[0]}));function Se(e,t,n){var r;t=t||[];var o=xe.apply(void 0,u()(r=[e]).call(r,i()(t))).get("parameters",Object(I.List)());return w()(o).call(o,(function(e,t){var r=n&&"body"===t.get("in")?t.get("value_xml"):t.get("value");return e.set(Object(T.A)(t,{allowHashes:!1}),r)}),Object(I.fromJS)({}))}function Ce(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(I.List.isList(e))return A()(e).call(e,(function(e){return I.Map.isMap(e)&&e.get("in")===t}))}function Ae(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(I.List.isList(e))return A()(e).call(e,(function(e){return I.Map.isMap(e)&&e.get("type")===t}))}function Oe(e,t){var n,r;t=t||[];var o=z(e).getIn(u()(n=["paths"]).call(n,i()(t)),Object(I.fromJS)({})),a=e.getIn(u()(r=["meta","paths"]).call(r,i()(t)),Object(I.fromJS)({})),s=ke(e,t),c=o.get("parameters")||new I.List,l=a.get("consumes_value")?a.get("consumes_value"):Ae(c,"file")?"multipart/form-data":Ae(c,"formData")?"application/x-www-form-urlencoded":void 0;return Object(I.fromJS)({requestContentType:l,responseContentType:s})}function ke(e,t){var n,r;t=t||[];var o=z(e).getIn(u()(n=["paths"]).call(n,i()(t)),null);if(null!==o){var a=e.getIn(u()(r=["meta","paths"]).call(r,i()(t),["produces_value"]),null),s=o.getIn(["produces",0],null);return a||s||"application/json"}}function je(e,t){var n;t=t||[];var r=z(e),a=r.getIn(u()(n=["paths"]).call(n,i()(t)),null);if(null!==a){var s=t,c=o()(s,1)[0],l=a.get("produces",null),p=r.getIn(["paths",c,"produces"],null),f=r.getIn(["produces"],null);return l||p||f}}function Te(e,t){var n;t=t||[];var r=z(e),a=r.getIn(u()(n=["paths"]).call(n,i()(t)),null);if(null!==a){var s=t,c=o()(s,1)[0],l=a.get("consumes",null),p=r.getIn(["paths",c,"consumes"],null),f=r.getIn(["consumes"],null);return l||p||f}}var Ie=function(e,t,n){var r=e.get("url").match(/^([a-z][a-z0-9+\-.]*):/),o=k()(r)?r[1]:null;return e.getIn(["scheme",t,n])||e.getIn(["scheme","_defaultScheme"])||o||""},Pe=function(e,t,n){var r;return d()(r=["http","https"]).call(r,Ie(e,t,n))>-1},Ne=function(e,t){var n;t=t||[];var r=e.getIn(u()(n=["meta","paths"]).call(n,i()(t),["parameters"]),Object(I.fromJS)([])),o=!0;return f()(r).call(r,(function(e){var t=e.get("errors");t&&t.count()&&(o=!1)})),o},Me=function(e,t){var n,r,o={requestBody:!1,requestContentType:{}},a=e.getIn(u()(n=["resolvedSubtrees","paths"]).call(n,i()(t),["requestBody"]),Object(I.fromJS)([]));return a.size<1||(a.getIn(["required"])&&(o.requestBody=a.getIn(["required"])),f()(r=a.getIn(["content"]).entrySeq()).call(r,(function(e){var t=e[0];if(e[1].getIn(["schema","required"])){var n=e[1].getIn(["schema","required"]).toJS();o.requestContentType[t]=n}}))),o},Re=function(e,t,n,r){var o;if((n||r)&&n===r)return!0;var a=e.getIn(u()(o=["resolvedSubtrees","paths"]).call(o,i()(t),["requestBody","content"]),Object(I.fromJS)([]));if(a.size<2||!n||!r)return!1;var s=a.getIn([n,"schema","properties"],Object(I.fromJS)([])),c=a.getIn([r,"schema","properties"],Object(I.fromJS)([]));return!!s.equals(c)};function De(e){return I.Map.isMap(e)?e:new I.Map}},function(e,t,n){"use strict";(function(t){var r=n(924),o=n(925),a=/^[A-Za-z][A-Za-z0-9+-.]*:[\\/]+/,i=/^([a-z][a-z0-9.+-]*:)?([\\/]{1,})?([\S\s]*)/i,s=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function u(e){return(e||"").toString().replace(s,"")}var c=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};function p(e){var n,r=("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{}).location||{},o={},i=typeof(e=e||r);if("blob:"===e.protocol)o=new h(unescape(e.pathname),{});else if("string"===i)for(n in o=new h(e,{}),l)delete o[n];else if("object"===i){for(n in e)n in l||(o[n]=e[n]);void 0===o.slashes&&(o.slashes=a.test(e.href))}return o}function f(e){e=u(e);var t=i.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!(t[2]&&t[2].length>=2),rest:t[2]&&1===t[2].length?"/"+t[3]:t[3]}}function h(e,t,n){if(e=u(e),!(this instanceof h))return new h(e,t,n);var a,i,s,l,d,m,v=c.slice(),g=typeof t,y=this,b=0;for("object"!==g&&"string"!==g&&(n=t,t=null),n&&"function"!=typeof n&&(n=o.parse),t=p(t),a=!(i=f(e||"")).protocol&&!i.slashes,y.slashes=i.slashes||a&&t.slashes,y.protocol=i.protocol||t.protocol||"",e=i.rest,i.slashes||(v[3]=[/(.*)/,"pathname"]);b=4?[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]:void 0),g[r]}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter((function(e){return"token"!==e})),o=y(r);return o.reduce((function(e,t){return f()({},e,n[t])}),t)}function _(e){return e.join(" ")}function x(e){var t=e.node,n=e.stylesheet,r=e.style,o=void 0===r?{}:r,a=e.useInlineStyles,i=e.key,s=t.properties,u=t.type,c=t.tagName,l=t.value;if("text"===u)return l;if(c){var p,h=function(e,t){var n=0;return function(r){return n+=1,r.map((function(r,o){return x({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(o)})}))}}(n,a);if(a){var m=Object.keys(n).reduce((function(e,t){return t.split(".").forEach((function(t){e.includes(t)||e.push(t)})),e}),[]),g=s.className&&s.className.includes("token")?["token"]:[],y=s.className&&g.concat(s.className.filter((function(e){return!m.includes(e)})));p=f()({},s,{className:_(y)||void 0,style:b(s.className,Object.assign({},s.style,o),n)})}else p=f()({},s,{className:_(s.className)});var w=h(t.children);return d.a.createElement(c,v()({key:i},p),w)}}var w=/\n/g;function E(e){var t=e.codeString,n=e.codeStyle,r=e.containerStyle,o=void 0===r?{float:"left",paddingRight:"10px"}:r,a=e.numberStyle,i=void 0===a?{}:a,s=e.startingLineNumber;return d.a.createElement("code",{style:Object.assign({},n,o)},function(e){var t=e.lines,n=e.startingLineNumber,r=e.style;return t.map((function(e,t){var o=t+n;return d.a.createElement("span",{key:"line-".concat(t),className:"react-syntax-highlighter-line-number",style:"function"==typeof r?r(o):r},"".concat(o,"\n"))}))}({lines:t.replace(/\n$/,"").split("\n"),style:i,startingLineNumber:s}))}function S(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function C(e,t,n){var r,o={display:"inline-block",minWidth:(r=n,"".concat(r.toString().length,".25em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},a="function"==typeof e?e(t):e;return f()({},o,a)}function A(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,o=e.largestLineNumber,a=e.showInlineLineNumbers,i=e.lineProps,s=void 0===i?{}:i,u=e.className,c=void 0===u?[]:u,l=e.showLineNumbers,p=e.wrapLongLines,h="function"==typeof s?s(n):s;if(h.className=c,n&&a){var d=C(r,n,o);t.unshift(S(n,d))}return p&l&&(h.style=f()({},h.style,{display:"flex"})),{type:"element",tagName:"span",properties:h,children:t}}function O(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=0;r2&&void 0!==arguments[2]?arguments[2]:[];return A({children:e,lineNumber:t,lineNumberStyle:s,largestLineNumber:i,showInlineLineNumbers:o,lineProps:n,className:a,showLineNumbers:r,wrapLongLines:u})}function m(e,t){if(r&&t&&o){var n=C(s,t,i);e.unshift(S(t,n))}return e}function v(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?d(e,n,r):m(e,n)}for(var g=function(){var e=l[h],t=e.children[0].value;if(t.match(w)){var n=t.split("\n");n.forEach((function(t,o){var i=r&&p.length+a,s={type:"text",value:"".concat(t,"\n")};if(0===o){var u=v(l.slice(f+1,h).concat(A({children:[s],className:e.properties.className})),i);p.push(u)}else if(o===n.length-1){if(l[h+1]&&l[h+1].children&&l[h+1].children[0]){var c=A({children:[{type:"text",value:"".concat(t)}],className:e.properties.className});l.splice(h+1,0,c)}else{var d=v([s],i,e.properties.className);p.push(d)}}else{var m=v([s],i,e.properties.className);p.push(m)}})),f=h}h++};h .hljs-title":{color:"#88C0D0"},"hljs-keyword":{color:"#81A1C1"},"hljs-literal":{color:"#81A1C1"},"hljs-symbol":{color:"#81A1C1"},"hljs-number":{color:"#B48EAD"},"hljs-regexp":{color:"#EBCB8B"},"hljs-string":{color:"#A3BE8C"},"hljs-title":{color:"#8FBCBB"},"hljs-params":{color:"#D8DEE9"},"hljs-bullet":{color:"#81A1C1"},"hljs-code":{color:"#8FBCBB"},"hljs-emphasis":{fontStyle:"italic"},"hljs-formula":{color:"#8FBCBB"},"hljs-strong":{fontWeight:"bold"},"hljs-link:hover":{textDecoration:"underline"},"hljs-quote":{color:"#4C566A"},"hljs-comment":{color:"#4C566A"},"hljs-doctag":{color:"#8FBCBB"},"hljs-meta":{color:"#5E81AC"},"hljs-meta-keyword":{color:"#5E81AC"},"hljs-meta-string":{color:"#A3BE8C"},"hljs-attr":{color:"#8FBCBB"},"hljs-attribute":{color:"#D8DEE9"},"hljs-builtin-name":{color:"#81A1C1"},"hljs-name":{color:"#81A1C1"},"hljs-section":{color:"#88C0D0"},"hljs-tag":{color:"#81A1C1"},"hljs-variable":{color:"#D8DEE9"},"hljs-template-variable":{color:"#D8DEE9"},"hljs-template-tag":{color:"#5E81AC"},"abnf .hljs-attribute":{color:"#88C0D0"},"abnf .hljs-symbol":{color:"#EBCB8B"},"apache .hljs-attribute":{color:"#88C0D0"},"apache .hljs-section":{color:"#81A1C1"},"arduino .hljs-built_in":{color:"#88C0D0"},"aspectj .hljs-meta":{color:"#D08770"},"aspectj > .hljs-title":{color:"#88C0D0"},"bnf .hljs-attribute":{color:"#8FBCBB"},"clojure .hljs-name":{color:"#88C0D0"},"clojure .hljs-symbol":{color:"#EBCB8B"},"coq .hljs-built_in":{color:"#88C0D0"},"cpp .hljs-meta-string":{color:"#8FBCBB"},"css .hljs-built_in":{color:"#88C0D0"},"css .hljs-keyword":{color:"#D08770"},"diff .hljs-meta":{color:"#8FBCBB"},"ebnf .hljs-attribute":{color:"#8FBCBB"},"glsl .hljs-built_in":{color:"#88C0D0"},"groovy .hljs-meta:not(:first-child)":{color:"#D08770"},"haxe .hljs-meta":{color:"#D08770"},"java .hljs-meta":{color:"#D08770"},"ldif .hljs-attribute":{color:"#8FBCBB"},"lisp .hljs-name":{color:"#88C0D0"},"lua .hljs-built_in":{color:"#88C0D0"},"moonscript .hljs-built_in":{color:"#88C0D0"},"nginx .hljs-attribute":{color:"#88C0D0"},"nginx .hljs-section":{color:"#5E81AC"},"pf .hljs-built_in":{color:"#88C0D0"},"processing .hljs-built_in":{color:"#88C0D0"},"scss .hljs-keyword":{color:"#81A1C1"},"stylus .hljs-keyword":{color:"#81A1C1"},"swift .hljs-meta":{color:"#D08770"},"vim .hljs-built_in":{color:"#88C0D0",fontStyle:"italic"},"yaml .hljs-meta":{color:"#D08770"}},obsidian:{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:"#282b2e",color:"#e0e2e4"},"hljs-keyword":{color:"#93c763",fontWeight:"bold"},"hljs-selector-tag":{color:"#93c763",fontWeight:"bold"},"hljs-literal":{color:"#93c763",fontWeight:"bold"},"hljs-selector-id":{color:"#93c763"},"hljs-number":{color:"#ffcd22"},"hljs-attribute":{color:"#668bb0"},"hljs-code":{color:"white"},"hljs-class .hljs-title":{color:"white"},"hljs-section":{color:"white",fontWeight:"bold"},"hljs-regexp":{color:"#d39745"},"hljs-link":{color:"#d39745"},"hljs-meta":{color:"#557182"},"hljs-tag":{color:"#8cbbad"},"hljs-name":{color:"#8cbbad",fontWeight:"bold"},"hljs-bullet":{color:"#8cbbad"},"hljs-subst":{color:"#8cbbad"},"hljs-emphasis":{color:"#8cbbad"},"hljs-type":{color:"#8cbbad",fontWeight:"bold"},"hljs-built_in":{color:"#8cbbad"},"hljs-selector-attr":{color:"#8cbbad"},"hljs-selector-pseudo":{color:"#8cbbad"},"hljs-addition":{color:"#8cbbad"},"hljs-variable":{color:"#8cbbad"},"hljs-template-tag":{color:"#8cbbad"},"hljs-template-variable":{color:"#8cbbad"},"hljs-string":{color:"#ec7600"},"hljs-symbol":{color:"#ec7600"},"hljs-comment":{color:"#818e96"},"hljs-quote":{color:"#818e96"},"hljs-deletion":{color:"#818e96"},"hljs-selector-class":{color:"#A082BD"},"hljs-doctag":{fontWeight:"bold"},"hljs-title":{fontWeight:"bold"},"hljs-strong":{fontWeight:"bold"}},"tomorrow-night":{"hljs-comment":{color:"#969896"},"hljs-quote":{color:"#969896"},"hljs-variable":{color:"#cc6666"},"hljs-template-variable":{color:"#cc6666"},"hljs-tag":{color:"#cc6666"},"hljs-name":{color:"#cc6666"},"hljs-selector-id":{color:"#cc6666"},"hljs-selector-class":{color:"#cc6666"},"hljs-regexp":{color:"#cc6666"},"hljs-deletion":{color:"#cc6666"},"hljs-number":{color:"#de935f"},"hljs-built_in":{color:"#de935f"},"hljs-builtin-name":{color:"#de935f"},"hljs-literal":{color:"#de935f"},"hljs-type":{color:"#de935f"},"hljs-params":{color:"#de935f"},"hljs-meta":{color:"#de935f"},"hljs-link":{color:"#de935f"},"hljs-attribute":{color:"#f0c674"},"hljs-string":{color:"#b5bd68"},"hljs-symbol":{color:"#b5bd68"},"hljs-bullet":{color:"#b5bd68"},"hljs-addition":{color:"#b5bd68"},"hljs-title":{color:"#81a2be"},"hljs-section":{color:"#81a2be"},"hljs-keyword":{color:"#b294bb"},"hljs-selector-tag":{color:"#b294bb"},hljs:{display:"block",overflowX:"auto",background:"#1d1f21",color:"#c5c8c6",padding:"0.5em"},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}}},Q=o()(X),ee=function(e){return i()(Q).call(Q,e)?X[e]:(console.warn("Request style '".concat(e,"' is not available, returning default instead")),Z)}},function(e,t){e.exports=!0},function(e,t,n){var r=n(242),o=n(69).f,a=n(68),i=n(54),s=n(561),u=n(38)("toStringTag");e.exports=function(e,t,n,c){if(e){var l=n?e:e.prototype;i(l,u)||o(l,u,{configurable:!0,value:t}),c&&!r&&a(l,"toString",s)}}},function(e,t,n){"use strict";var r=n(375).charAt,o=n(81),a=n(243),i="String Iterator",s=o.set,u=o.getterFor(i);a(String,"String",(function(e){s(this,{type:i,string:String(e),index:0})}),(function(){var e,t=u(this),n=t.string,o=t.index;return o>=n.length?{value:void 0,done:!0}:(e=r(n,o),t.index+=e.length,{value:e,done:!1})}))},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){e.exports=n(690)},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_LAYOUT",(function(){return o})),n.d(t,"UPDATE_FILTER",(function(){return a})),n.d(t,"UPDATE_MODE",(function(){return i})),n.d(t,"SHOW",(function(){return s})),n.d(t,"updateLayout",(function(){return u})),n.d(t,"updateFilter",(function(){return c})),n.d(t,"show",(function(){return l})),n.d(t,"changeMode",(function(){return p}));var r=n(5),o="layout_update_layout",a="layout_update_filter",i="layout_update_mode",s="layout_show";function u(e){return{type:o,payload:e}}function c(e){return{type:a,payload:e}}function l(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=Object(r.v)(e),{type:s,payload:{thing:e,shown:t}}}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=Object(r.v)(e),{type:i,payload:{thing:e,mode:t}}}},function(e,t,n){var r=n(429),o=n(164),a=n(195),i=n(52),s=n(118),u=n(196),c=n(163),l=n(254),p=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||l(e)||a(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(p.call(e,n))return!1;return!0}},function(e,t,n){var r=n(49),o=n(181),a=n(108),i=n(67),s=n(183),u=n(54),c=n(366),l=Object.getOwnPropertyDescriptor;t.f=r?l:function(e,t){if(e=i(e),t=s(t,!0),c)try{return l(e,t)}catch(e){}if(u(e,t))return a(!o.f.call(e,t),e[t])}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(79);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r,o=n(51),a=n(235),i=n(238),s=n(158),u=n(371),c=n(230),l=n(187),p=l("IE_PROTO"),f=function(){},h=function(e){return" + + + + + +` +) diff --git a/vendor/github.com/go-openapi/runtime/middleware/redoc.go b/vendor/github.com/go-openapi/runtime/middleware/redoc.go index 019c854295..b96b01e7f3 100644 --- a/vendor/github.com/go-openapi/runtime/middleware/redoc.go +++ b/vendor/github.com/go-openapi/runtime/middleware/redoc.go @@ -10,67 +10,58 @@ import ( // RedocOpts configures the Redoc middlewares type RedocOpts struct { - // BasePath for the UI path, defaults to: / + // BasePath for the UI, defaults to: / BasePath string - // Path combines with BasePath for the full UI path, defaults to: docs + + // Path combines with BasePath to construct the path to the UI, defaults to: "docs". Path string - // SpecURL the url to find the spec for + + // SpecURL is the URL of the spec document. + // + // Defaults to: /swagger.json SpecURL string - // RedocURL for the js that generates the redoc site, defaults to: https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js - RedocURL string + // Title for the documentation site, default to: API documentation Title string + + // Template specifies a custom template to serve the UI + Template string + + // RedocURL points to the js that generates the redoc site. + // + // Defaults to: https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js + RedocURL string } // EnsureDefaults in case some options are missing func (r *RedocOpts) EnsureDefaults() { - if r.BasePath == "" { - r.BasePath = "/" - } - if r.Path == "" { - r.Path = "docs" - } - if r.SpecURL == "" { - r.SpecURL = "/swagger.json" - } + common := toCommonUIOptions(r) + common.EnsureDefaults() + fromCommonToAnyOptions(common, r) + + // redoc-specifics if r.RedocURL == "" { r.RedocURL = redocLatest } - if r.Title == "" { - r.Title = "API documentation" + if r.Template == "" { + r.Template = redocTemplate } } // Redoc creates a middleware to serve a documentation site for a swagger spec. -// This allows for altering the spec before starting the http listener. // +// This allows for altering the spec before starting the http listener. func Redoc(opts RedocOpts, next http.Handler) http.Handler { opts.EnsureDefaults() pth := path.Join(opts.BasePath, opts.Path) - tmpl := template.Must(template.New("redoc").Parse(redocTemplate)) - - buf := bytes.NewBuffer(nil) - _ = tmpl.Execute(buf, opts) - b := buf.Bytes() - - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if r.URL.Path == pth { - rw.Header().Set("Content-Type", "text/html; charset=utf-8") - rw.WriteHeader(http.StatusOK) - - _, _ = rw.Write(b) - return - } + tmpl := template.Must(template.New("redoc").Parse(opts.Template)) + assets := bytes.NewBuffer(nil) + if err := tmpl.Execute(assets, opts); err != nil { + panic(fmt.Errorf("cannot execute template: %w", err)) + } - if next == nil { - rw.Header().Set("Content-Type", "text/plain") - rw.WriteHeader(http.StatusNotFound) - _, _ = rw.Write([]byte(fmt.Sprintf("%q not found", pth))) - return - } - next.ServeHTTP(rw, r) - }) + return serveUI(pth, assets.Bytes(), next) } const ( diff --git a/vendor/github.com/go-openapi/runtime/middleware/request.go b/vendor/github.com/go-openapi/runtime/middleware/request.go index 760c37861d..82e1436652 100644 --- a/vendor/github.com/go-openapi/runtime/middleware/request.go +++ b/vendor/github.com/go-openapi/runtime/middleware/request.go @@ -19,10 +19,10 @@ import ( "reflect" "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/logger" "github.com/go-openapi/spec" "github.com/go-openapi/strfmt" - - "github.com/go-openapi/runtime" ) // UntypedRequestBinder binds and validates the data from a http request @@ -31,6 +31,7 @@ type UntypedRequestBinder struct { Parameters map[string]spec.Parameter Formats strfmt.Registry paramBinders map[string]*untypedParamBinder + debugLogf func(string, ...any) // a logging function to debug context and all components using it } // NewUntypedRequestBinder creates a new binder for reading a request. @@ -44,6 +45,7 @@ func NewUntypedRequestBinder(parameters map[string]spec.Parameter, spec *spec.Sw paramBinders: binders, Spec: spec, Formats: formats, + debugLogf: debugLogfFunc(nil), } } @@ -52,10 +54,10 @@ func (o *UntypedRequestBinder) Bind(request *http.Request, routeParams RoutePara val := reflect.Indirect(reflect.ValueOf(data)) isMap := val.Kind() == reflect.Map var result []error - debugLog("binding %d parameters for %s %s", len(o.Parameters), request.Method, request.URL.EscapedPath()) + o.debugLogf("binding %d parameters for %s %s", len(o.Parameters), request.Method, request.URL.EscapedPath()) for fieldName, param := range o.Parameters { binder := o.paramBinders[fieldName] - debugLog("binding parameter %s for %s %s", fieldName, request.Method, request.URL.EscapedPath()) + o.debugLogf("binding parameter %s for %s %s", fieldName, request.Method, request.URL.EscapedPath()) var target reflect.Value if !isMap { binder.Name = fieldName @@ -65,7 +67,7 @@ func (o *UntypedRequestBinder) Bind(request *http.Request, routeParams RoutePara if isMap { tpe := binder.Type() if tpe == nil { - if param.Schema.Type.Contains("array") { + if param.Schema.Type.Contains(typeArray) { tpe = reflect.TypeOf([]interface{}{}) } else { tpe = reflect.TypeOf(map[string]interface{}{}) @@ -102,3 +104,14 @@ func (o *UntypedRequestBinder) Bind(request *http.Request, routeParams RoutePara return nil } + +// SetLogger allows for injecting a logger to catch debug entries. +// +// The logger is enabled in DEBUG mode only. +func (o *UntypedRequestBinder) SetLogger(lg logger.Logger) { + o.debugLogf = debugLogfFunc(lg) +} + +func (o *UntypedRequestBinder) setDebugLogf(fn func(string, ...any)) { + o.debugLogf = fn +} diff --git a/vendor/github.com/go-openapi/runtime/middleware/router.go b/vendor/github.com/go-openapi/runtime/middleware/router.go index 02768bade2..3a6aee90e5 100644 --- a/vendor/github.com/go-openapi/runtime/middleware/router.go +++ b/vendor/github.com/go-openapi/runtime/middleware/router.go @@ -17,11 +17,14 @@ package middleware import ( "fmt" "net/http" + "net/url" fpath "path" "regexp" "strings" + "github.com/go-openapi/runtime/logger" "github.com/go-openapi/runtime/security" + "github.com/go-openapi/swag" "github.com/go-openapi/analysis" "github.com/go-openapi/errors" @@ -66,10 +69,10 @@ func (r RouteParams) GetOK(name string) ([]string, bool, bool) { return nil, false, false } -// NewRouter creates a new context aware router middleware +// NewRouter creates a new context-aware router middleware func NewRouter(ctx *Context, next http.Handler) http.Handler { if ctx.router == nil { - ctx.router = DefaultRouter(ctx.spec, ctx.api) + ctx.router = DefaultRouter(ctx.spec, ctx.api, WithDefaultRouterLoggerFunc(ctx.debugLogf)) } return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { @@ -102,41 +105,75 @@ type RoutableAPI interface { DefaultConsumes() string } -// Router represents a swagger aware router +// Router represents a swagger-aware router type Router interface { Lookup(method, path string) (*MatchedRoute, bool) OtherMethods(method, path string) []string } type defaultRouteBuilder struct { - spec *loads.Document - analyzer *analysis.Spec - api RoutableAPI - records map[string][]denco.Record + spec *loads.Document + analyzer *analysis.Spec + api RoutableAPI + records map[string][]denco.Record + debugLogf func(string, ...any) // a logging function to debug context and all components using it } type defaultRouter struct { - spec *loads.Document - routers map[string]*denco.Router + spec *loads.Document + routers map[string]*denco.Router + debugLogf func(string, ...any) // a logging function to debug context and all components using it } -func newDefaultRouteBuilder(spec *loads.Document, api RoutableAPI) *defaultRouteBuilder { +func newDefaultRouteBuilder(spec *loads.Document, api RoutableAPI, opts ...DefaultRouterOpt) *defaultRouteBuilder { + var o defaultRouterOpts + for _, apply := range opts { + apply(&o) + } + if o.debugLogf == nil { + o.debugLogf = debugLogfFunc(nil) // defaults to standard logger + } + return &defaultRouteBuilder{ - spec: spec, - analyzer: analysis.New(spec.Spec()), - api: api, - records: make(map[string][]denco.Record), + spec: spec, + analyzer: analysis.New(spec.Spec()), + api: api, + records: make(map[string][]denco.Record), + debugLogf: o.debugLogf, + } +} + +// DefaultRouterOpt allows to inject optional behavior to the default router. +type DefaultRouterOpt func(*defaultRouterOpts) + +type defaultRouterOpts struct { + debugLogf func(string, ...any) +} + +// WithDefaultRouterLogger sets the debug logger for the default router. +// +// This is enabled only in DEBUG mode. +func WithDefaultRouterLogger(lg logger.Logger) DefaultRouterOpt { + return func(o *defaultRouterOpts) { + o.debugLogf = debugLogfFunc(lg) } } -// DefaultRouter creates a default implemenation of the router -func DefaultRouter(spec *loads.Document, api RoutableAPI) Router { - builder := newDefaultRouteBuilder(spec, api) +// WithDefaultRouterLoggerFunc sets a logging debug method for the default router. +func WithDefaultRouterLoggerFunc(fn func(string, ...any)) DefaultRouterOpt { + return func(o *defaultRouterOpts) { + o.debugLogf = fn + } +} + +// DefaultRouter creates a default implementation of the router +func DefaultRouter(spec *loads.Document, api RoutableAPI, opts ...DefaultRouterOpt) Router { + builder := newDefaultRouteBuilder(spec, api, opts...) if spec != nil { for method, paths := range builder.analyzer.Operations() { for path, operation := range paths { fp := fpath.Join(spec.BasePath(), path) - debugLog("adding route %s %s %q", method, fp, operation.ID) + builder.debugLogf("adding route %s %s %q", method, fp, operation.ID) builder.AddRoute(method, fp, operation) } } @@ -318,24 +355,24 @@ func (m *MatchedRoute) NeedsAuth() bool { func (d *defaultRouter) Lookup(method, path string) (*MatchedRoute, bool) { mth := strings.ToUpper(method) - debugLog("looking up route for %s %s", method, path) + d.debugLogf("looking up route for %s %s", method, path) if Debug { if len(d.routers) == 0 { - debugLog("there are no known routers") + d.debugLogf("there are no known routers") } for meth := range d.routers { - debugLog("got a router for %s", meth) + d.debugLogf("got a router for %s", meth) } } if router, ok := d.routers[mth]; ok { if m, rp, ok := router.Lookup(fpath.Clean(path)); ok && m != nil { if entry, ok := m.(*routeEntry); ok { - debugLog("found a route for %s %s with %d parameters", method, path, len(entry.Parameters)) + d.debugLogf("found a route for %s %s with %d parameters", method, path, len(entry.Parameters)) var params RouteParams for _, p := range rp { - v, err := pathUnescape(p.Value) + v, err := url.PathUnescape(p.Value) if err != nil { - debugLog("failed to escape %q: %v", p.Value, err) + d.debugLogf("failed to escape %q: %v", p.Value, err) v = p.Value } // a workaround to handle fragment/composing parameters until they are supported in denco router @@ -355,10 +392,10 @@ func (d *defaultRouter) Lookup(method, path string) (*MatchedRoute, bool) { return &MatchedRoute{routeEntry: *entry, Params: params}, true } } else { - debugLog("couldn't find a route by path for %s %s", method, path) + d.debugLogf("couldn't find a route by path for %s %s", method, path) } } else { - debugLog("couldn't find a route by method for %s %s", method, path) + d.debugLogf("couldn't find a route by method for %s %s", method, path) } return nil, false } @@ -377,6 +414,10 @@ func (d *defaultRouter) OtherMethods(method, path string) []string { return methods } +func (d *defaultRouter) SetLogger(lg logger.Logger) { + d.debugLogf = debugLogfFunc(lg) +} + // convert swagger parameters per path segment into a denco parameter as multiple parameters per segment are not supported in denco var pathConverter = regexp.MustCompile(`{(.+?)}([^/]*)`) @@ -412,12 +453,23 @@ func (d *defaultRouteBuilder) AddRoute(method, path string, operation *spec.Oper bp = bp[:len(bp)-1] } - debugLog("operation: %#v", *operation) + d.debugLogf("operation: %#v", *operation) if handler, ok := d.api.HandlerFor(method, strings.TrimPrefix(path, bp)); ok { consumes := d.analyzer.ConsumesFor(operation) produces := d.analyzer.ProducesFor(operation) parameters := d.analyzer.ParamsFor(method, strings.TrimPrefix(path, bp)) + // add API defaults if not part of the spec + if defConsumes := d.api.DefaultConsumes(); defConsumes != "" && !swag.ContainsStringsCI(consumes, defConsumes) { + consumes = append(consumes, defConsumes) + } + + if defProduces := d.api.DefaultProduces(); defProduces != "" && !swag.ContainsStringsCI(produces, defProduces) { + produces = append(produces, defProduces) + } + + requestBinder := NewUntypedRequestBinder(parameters, d.spec.Spec(), d.api.Formats()) + requestBinder.setDebugLogf(d.debugLogf) record := denco.NewRecord(pathConverter.ReplaceAllString(path, ":$1"), &routeEntry{ BasePath: bp, PathPattern: path, @@ -429,7 +481,7 @@ func (d *defaultRouteBuilder) AddRoute(method, path string, operation *spec.Oper Producers: d.api.ProducersFor(normalizeOffers(produces)), Parameters: parameters, Formats: d.api.Formats(), - Binder: NewUntypedRequestBinder(parameters, d.spec.Spec(), d.api.Formats()), + Binder: requestBinder, Authenticators: d.buildAuthenticators(operation), Authorizer: d.api.Authorizer(), }) @@ -439,11 +491,11 @@ func (d *defaultRouteBuilder) AddRoute(method, path string, operation *spec.Oper func (d *defaultRouteBuilder) buildAuthenticators(operation *spec.Operation) RouteAuthenticators { requirements := d.analyzer.SecurityRequirementsFor(operation) - var auths []RouteAuthenticator + auths := make([]RouteAuthenticator, 0, len(requirements)) for _, reqs := range requirements { - var schemes []string + schemes := make([]string, 0, len(reqs)) scopes := make(map[string][]string, len(reqs)) - var scopeSlices [][]string + scopeSlices := make([][]string, 0, len(reqs)) for _, req := range reqs { schemes = append(schemes, req.Name) scopes[req.Name] = req.Scopes @@ -472,7 +524,8 @@ func (d *defaultRouteBuilder) Build() *defaultRouter { routers[method] = router } return &defaultRouter{ - spec: d.spec, - routers: routers, + spec: d.spec, + routers: routers, + debugLogf: d.debugLogf, } } diff --git a/vendor/github.com/go-openapi/runtime/middleware/spec.go b/vendor/github.com/go-openapi/runtime/middleware/spec.go index f029142980..87e17e3424 100644 --- a/vendor/github.com/go-openapi/runtime/middleware/spec.go +++ b/vendor/github.com/go-openapi/runtime/middleware/spec.go @@ -19,30 +19,84 @@ import ( "path" ) -// Spec creates a middleware to serve a swagger spec. +const ( + contentTypeHeader = "Content-Type" + applicationJSON = "application/json" +) + +// SpecOption can be applied to the Spec serving middleware +type SpecOption func(*specOptions) + +var defaultSpecOptions = specOptions{ + Path: "", + Document: "swagger.json", +} + +type specOptions struct { + Path string + Document string +} + +func specOptionsWithDefaults(opts []SpecOption) specOptions { + o := defaultSpecOptions + for _, apply := range opts { + apply(&o) + } + + return o +} + +// Spec creates a middleware to serve a swagger spec as a JSON document. +// // This allows for altering the spec before starting the http listener. -// This can be useful if you want to serve the swagger spec from another path than /swagger.json // -func Spec(basePath string, b []byte, next http.Handler) http.Handler { +// The basePath argument indicates the path of the spec document (defaults to "/"). +// Additional SpecOption can be used to change the name of the document (defaults to "swagger.json"). +func Spec(basePath string, b []byte, next http.Handler, opts ...SpecOption) http.Handler { if basePath == "" { basePath = "/" } - pth := path.Join(basePath, "swagger.json") + o := specOptionsWithDefaults(opts) + pth := path.Join(basePath, o.Path, o.Document) return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if r.URL.Path == pth { - rw.Header().Set("Content-Type", "application/json") + if path.Clean(r.URL.Path) == pth { + rw.Header().Set(contentTypeHeader, applicationJSON) rw.WriteHeader(http.StatusOK) - //#nosec _, _ = rw.Write(b) + return } - if next == nil { - rw.Header().Set("Content-Type", "application/json") - rw.WriteHeader(http.StatusNotFound) + if next != nil { + next.ServeHTTP(rw, r) + return } - next.ServeHTTP(rw, r) + + rw.Header().Set(contentTypeHeader, applicationJSON) + rw.WriteHeader(http.StatusNotFound) }) } + +// WithSpecPath sets the path to be joined to the base path of the Spec middleware. +// +// This is empty by default. +func WithSpecPath(pth string) SpecOption { + return func(o *specOptions) { + o.Path = pth + } +} + +// WithSpecDocument sets the name of the JSON document served as a spec. +// +// By default, this is "swagger.json" +func WithSpecDocument(doc string) SpecOption { + return func(o *specOptions) { + if doc == "" { + return + } + + o.Document = doc + } +} diff --git a/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go b/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go index 2c92f5c91f..ec3c10cbaf 100644 --- a/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go +++ b/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go @@ -8,37 +8,67 @@ import ( "path" ) -// SwaggerUIOpts configures the Swaggerui middlewares +// SwaggerUIOpts configures the SwaggerUI middleware type SwaggerUIOpts struct { - // BasePath for the UI path, defaults to: / + // BasePath for the API, defaults to: / BasePath string - // Path combines with BasePath for the full UI path, defaults to: docs + + // Path combines with BasePath to construct the path to the UI, defaults to: "docs". Path string - // SpecURL the url to find the spec for + + // SpecURL is the URL of the spec document. + // + // Defaults to: /swagger.json SpecURL string + // Title for the documentation site, default to: API documentation + Title string + + // Template specifies a custom template to serve the UI + Template string + + // OAuthCallbackURL the url called after OAuth2 login + OAuthCallbackURL string + // The three components needed to embed swagger-ui - SwaggerURL string + + // SwaggerURL points to the js that generates the SwaggerUI site. + // + // Defaults to: https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js + SwaggerURL string + SwaggerPresetURL string SwaggerStylesURL string Favicon32 string Favicon16 string - - // Title for the documentation site, default to: API documentation - Title string } // EnsureDefaults in case some options are missing func (r *SwaggerUIOpts) EnsureDefaults() { - if r.BasePath == "" { - r.BasePath = "/" + r.ensureDefaults() + + if r.Template == "" { + r.Template = swaggeruiTemplate } - if r.Path == "" { - r.Path = "docs" +} + +func (r *SwaggerUIOpts) EnsureDefaultsOauth2() { + r.ensureDefaults() + + if r.Template == "" { + r.Template = swaggerOAuthTemplate } - if r.SpecURL == "" { - r.SpecURL = "/swagger.json" +} + +func (r *SwaggerUIOpts) ensureDefaults() { + common := toCommonUIOptions(r) + common.EnsureDefaults() + fromCommonToAnyOptions(common, r) + + // swaggerui-specifics + if r.OAuthCallbackURL == "" { + r.OAuthCallbackURL = path.Join(r.BasePath, r.Path, "oauth2-callback") } if r.SwaggerURL == "" { r.SwaggerURL = swaggerLatest @@ -55,40 +85,22 @@ func (r *SwaggerUIOpts) EnsureDefaults() { if r.Favicon32 == "" { r.Favicon32 = swaggerFavicon32Latest } - if r.Title == "" { - r.Title = "API documentation" - } } // SwaggerUI creates a middleware to serve a documentation site for a swagger spec. +// // This allows for altering the spec before starting the http listener. func SwaggerUI(opts SwaggerUIOpts, next http.Handler) http.Handler { opts.EnsureDefaults() pth := path.Join(opts.BasePath, opts.Path) - tmpl := template.Must(template.New("swaggerui").Parse(swaggeruiTemplate)) - - buf := bytes.NewBuffer(nil) - _ = tmpl.Execute(buf, &opts) - b := buf.Bytes() - - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if r.URL.Path == pth { - rw.Header().Set("Content-Type", "text/html; charset=utf-8") - rw.WriteHeader(http.StatusOK) - - _, _ = rw.Write(b) - return - } - - if next == nil { - rw.Header().Set("Content-Type", "text/plain") - rw.WriteHeader(http.StatusNotFound) - _, _ = rw.Write([]byte(fmt.Sprintf("%q not found", pth))) - return - } - next.ServeHTTP(rw, r) - }) + tmpl := template.Must(template.New("swaggerui").Parse(opts.Template)) + assets := bytes.NewBuffer(nil) + if err := tmpl.Execute(assets, opts); err != nil { + panic(fmt.Errorf("cannot execute template: %w", err)) + } + + return serveUI(pth, assets.Bytes(), next) } const ( @@ -149,7 +161,8 @@ const ( plugins: [ SwaggerUIBundle.plugins.DownloadUrl ], - layout: "StandaloneLayout" + layout: "StandaloneLayout", + oauth2RedirectUrl: '{{ .OAuthCallbackURL }}' }) // End Swagger UI call region diff --git a/vendor/github.com/go-openapi/runtime/middleware/swaggerui_oauth2.go b/vendor/github.com/go-openapi/runtime/middleware/swaggerui_oauth2.go new file mode 100644 index 0000000000..e81212f71c --- /dev/null +++ b/vendor/github.com/go-openapi/runtime/middleware/swaggerui_oauth2.go @@ -0,0 +1,105 @@ +package middleware + +import ( + "bytes" + "fmt" + "net/http" + "text/template" +) + +func SwaggerUIOAuth2Callback(opts SwaggerUIOpts, next http.Handler) http.Handler { + opts.EnsureDefaultsOauth2() + + pth := opts.OAuthCallbackURL + tmpl := template.Must(template.New("swaggeroauth").Parse(opts.Template)) + assets := bytes.NewBuffer(nil) + if err := tmpl.Execute(assets, opts); err != nil { + panic(fmt.Errorf("cannot execute template: %w", err)) + } + + return serveUI(pth, assets.Bytes(), next) +} + +const ( + swaggerOAuthTemplate = ` + + + + {{ .Title }} + + + + + +` +) diff --git a/vendor/github.com/go-openapi/runtime/middleware/ui_options.go b/vendor/github.com/go-openapi/runtime/middleware/ui_options.go new file mode 100644 index 0000000000..b86efa0089 --- /dev/null +++ b/vendor/github.com/go-openapi/runtime/middleware/ui_options.go @@ -0,0 +1,173 @@ +package middleware + +import ( + "bytes" + "encoding/gob" + "fmt" + "net/http" + "path" + "strings" +) + +const ( + // constants that are common to all UI-serving middlewares + defaultDocsPath = "docs" + defaultDocsURL = "/swagger.json" + defaultDocsTitle = "API Documentation" +) + +// uiOptions defines common options for UI serving middlewares. +type uiOptions struct { + // BasePath for the UI, defaults to: / + BasePath string + + // Path combines with BasePath to construct the path to the UI, defaults to: "docs". + Path string + + // SpecURL is the URL of the spec document. + // + // Defaults to: /swagger.json + SpecURL string + + // Title for the documentation site, default to: API documentation + Title string + + // Template specifies a custom template to serve the UI + Template string +} + +// toCommonUIOptions converts any UI option type to retain the common options. +// +// This uses gob encoding/decoding to convert common fields from one struct to another. +func toCommonUIOptions(opts interface{}) uiOptions { + var buf bytes.Buffer + enc := gob.NewEncoder(&buf) + dec := gob.NewDecoder(&buf) + var o uiOptions + err := enc.Encode(opts) + if err != nil { + panic(err) + } + + err = dec.Decode(&o) + if err != nil { + panic(err) + } + + return o +} + +func fromCommonToAnyOptions[T any](source uiOptions, target *T) { + var buf bytes.Buffer + enc := gob.NewEncoder(&buf) + dec := gob.NewDecoder(&buf) + err := enc.Encode(source) + if err != nil { + panic(err) + } + + err = dec.Decode(target) + if err != nil { + panic(err) + } +} + +// UIOption can be applied to UI serving middleware, such as Context.APIHandler or +// Context.APIHandlerSwaggerUI to alter the defaut behavior. +type UIOption func(*uiOptions) + +func uiOptionsWithDefaults(opts []UIOption) uiOptions { + var o uiOptions + for _, apply := range opts { + apply(&o) + } + + return o +} + +// WithUIBasePath sets the base path from where to serve the UI assets. +// +// By default, Context middleware sets this value to the API base path. +func WithUIBasePath(base string) UIOption { + return func(o *uiOptions) { + if !strings.HasPrefix(base, "/") { + base = "/" + base + } + o.BasePath = base + } +} + +// WithUIPath sets the path from where to serve the UI assets (i.e. /{basepath}/{path}. +func WithUIPath(pth string) UIOption { + return func(o *uiOptions) { + o.Path = pth + } +} + +// WithUISpecURL sets the path from where to serve swagger spec document. +// +// This may be specified as a full URL or a path. +// +// By default, this is "/swagger.json" +func WithUISpecURL(specURL string) UIOption { + return func(o *uiOptions) { + o.SpecURL = specURL + } +} + +// WithUITitle sets the title of the UI. +// +// By default, Context middleware sets this value to the title found in the API spec. +func WithUITitle(title string) UIOption { + return func(o *uiOptions) { + o.Title = title + } +} + +// WithTemplate allows to set a custom template for the UI. +// +// UI middleware will panic if the template does not parse or execute properly. +func WithTemplate(tpl string) UIOption { + return func(o *uiOptions) { + o.Template = tpl + } +} + +// EnsureDefaults in case some options are missing +func (r *uiOptions) EnsureDefaults() { + if r.BasePath == "" { + r.BasePath = "/" + } + if r.Path == "" { + r.Path = defaultDocsPath + } + if r.SpecURL == "" { + r.SpecURL = defaultDocsURL + } + if r.Title == "" { + r.Title = defaultDocsTitle + } +} + +// serveUI creates a middleware that serves a templated asset as text/html. +func serveUI(pth string, assets []byte, next http.Handler) http.Handler { + return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { + if path.Clean(r.URL.Path) == pth { + rw.Header().Set(contentTypeHeader, "text/html; charset=utf-8") + rw.WriteHeader(http.StatusOK) + _, _ = rw.Write(assets) + + return + } + + if next != nil { + next.ServeHTTP(rw, r) + + return + } + + rw.Header().Set(contentTypeHeader, "text/plain") + rw.WriteHeader(http.StatusNotFound) + _, _ = rw.Write([]byte(fmt.Sprintf("%q not found", pth))) + }) +} diff --git a/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go b/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go index 39a85f7d9e..7b7269bd19 100644 --- a/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go +++ b/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go @@ -197,30 +197,31 @@ func (d *API) Validate() error { // validateWith validates the registrations in this API against the provided spec analyzer func (d *API) validate() error { - var consumes []string + consumes := make([]string, 0, len(d.consumers)) for k := range d.consumers { consumes = append(consumes, k) } - var produces []string + produces := make([]string, 0, len(d.producers)) for k := range d.producers { produces = append(produces, k) } - var authenticators []string + authenticators := make([]string, 0, len(d.authenticators)) for k := range d.authenticators { authenticators = append(authenticators, k) } - var operations []string + operations := make([]string, 0, len(d.operations)) for m, v := range d.operations { for p := range v { operations = append(operations, fmt.Sprintf("%s %s", strings.ToUpper(m), p)) } } - var definedAuths []string - for k := range d.spec.Spec().SecurityDefinitions { + secDefinitions := d.spec.Spec().SecurityDefinitions + definedAuths := make([]string, 0, len(secDefinitions)) + for k := range secDefinitions { definedAuths = append(definedAuths, k) } @@ -267,7 +268,7 @@ func (d *API) verify(name string, registrations []string, expectations []string) delete(expected, k) } - var unregistered []string + unregistered := make([]string, 0, len(expected)) for k := range expected { unregistered = append(unregistered, k) } diff --git a/vendor/github.com/go-openapi/runtime/middleware/validation.go b/vendor/github.com/go-openapi/runtime/middleware/validation.go index 1f0135b578..0a5356c607 100644 --- a/vendor/github.com/go-openapi/runtime/middleware/validation.go +++ b/vendor/github.com/go-openapi/runtime/middleware/validation.go @@ -35,7 +35,6 @@ type validation struct { // ContentType validates the content type of a request func validateContentType(allowed []string, actual string) error { - debugLog("validating content type for %q against [%s]", actual, strings.Join(allowed, ", ")) if len(allowed) == 0 { return nil } @@ -57,13 +56,13 @@ func validateContentType(allowed []string, actual string) error { } func validateRequest(ctx *Context, request *http.Request, route *MatchedRoute) *validation { - debugLog("validating request %s %s", request.Method, request.URL.EscapedPath()) validate := &validation{ context: ctx, request: request, route: route, bound: make(map[string]interface{}), } + validate.debugLogf("validating request %s %s", request.Method, request.URL.EscapedPath()) validate.contentType() if len(validate.result) == 0 { @@ -76,8 +75,12 @@ func validateRequest(ctx *Context, request *http.Request, route *MatchedRoute) * return validate } +func (v *validation) debugLogf(format string, args ...any) { + v.context.debugLogf(format, args...) +} + func (v *validation) parameters() { - debugLog("validating request parameters for %s %s", v.request.Method, v.request.URL.EscapedPath()) + v.debugLogf("validating request parameters for %s %s", v.request.Method, v.request.URL.EscapedPath()) if result := v.route.Binder.Bind(v.request, v.route.Params, v.route.Consumer, v.bound); result != nil { if result.Error() == "validation failure list" { for _, e := range result.(*errors.Validation).Value.([]interface{}) { @@ -91,7 +94,7 @@ func (v *validation) parameters() { func (v *validation) contentType() { if len(v.result) == 0 && runtime.HasBody(v.request) { - debugLog("validating body content type for %s %s", v.request.Method, v.request.URL.EscapedPath()) + v.debugLogf("validating body content type for %s %s", v.request.Method, v.request.URL.EscapedPath()) ct, _, req, err := v.context.ContentType(v.request) if err != nil { v.result = append(v.result, err) @@ -100,6 +103,7 @@ func (v *validation) contentType() { } if len(v.result) == 0 { + v.debugLogf("validating content type for %q against [%s]", ct, strings.Join(v.route.Consumes, ", ")) if err := validateContentType(v.route.Consumes, ct); err != nil { v.result = append(v.result, err) } diff --git a/vendor/github.com/go-openapi/runtime/request.go b/vendor/github.com/go-openapi/runtime/request.go index 9e51b42b59..9e3e1ecb14 100644 --- a/vendor/github.com/go-openapi/runtime/request.go +++ b/vendor/github.com/go-openapi/runtime/request.go @@ -16,6 +16,8 @@ package runtime import ( "bufio" + "context" + "errors" "io" "net/http" "strings" @@ -48,7 +50,7 @@ func HasBody(r *http.Request) bool { return true } - if r.Header.Get(http.CanonicalHeaderKey("content-length")) != "" { + if r.Header.Get("content-length") != "" { // in this case, no Transfer-Encoding should be present // we have a header set but it was explicitly set to 0, so we assume no body return false @@ -96,10 +98,16 @@ func (p *peekingReader) Read(d []byte) (int, error) { if p == nil { return 0, io.EOF } + if p.underlying == nil { + return 0, io.ErrUnexpectedEOF + } return p.underlying.Read(d) } func (p *peekingReader) Close() error { + if p.underlying == nil { + return errors.New("reader already closed") + } p.underlying = nil if p.orig != nil { return p.orig.Close() @@ -107,9 +115,11 @@ func (p *peekingReader) Close() error { return nil } -// JSONRequest creates a new http request with json headers set +// JSONRequest creates a new http request with json headers set. +// +// It uses context.Background. func JSONRequest(method, urlStr string, body io.Reader) (*http.Request, error) { - req, err := http.NewRequest(method, urlStr, body) + req, err := http.NewRequestWithContext(context.Background(), method, urlStr, body) if err != nil { return nil, err } diff --git a/vendor/github.com/go-openapi/runtime/security/authenticator.go b/vendor/github.com/go-openapi/runtime/security/authenticator.go index 476d26c3e7..bb30472bbe 100644 --- a/vendor/github.com/go-openapi/runtime/security/authenticator.go +++ b/vendor/github.com/go-openapi/runtime/security/authenticator.go @@ -25,12 +25,13 @@ import ( ) const ( - query = "query" - header = "header" + query = "query" + header = "header" + accessTokenParam = "access_token" ) // HttpAuthenticator is a function that authenticates a HTTP request -func HttpAuthenticator(handler func(*http.Request) (bool, interface{}, error)) runtime.Authenticator { +func HttpAuthenticator(handler func(*http.Request) (bool, interface{}, error)) runtime.Authenticator { //nolint:revive,stylecheck return runtime.AuthenticatorFunc(func(params interface{}) (bool, interface{}, error) { if request, ok := params.(*http.Request); ok { return handler(request) @@ -158,7 +159,7 @@ func APIKeyAuth(name, in string, authenticate TokenAuthentication) runtime.Authe inl := strings.ToLower(in) if inl != query && inl != header { // panic because this is most likely a typo - panic(errors.New(500, "api key auth: in value needs to be either \"query\" or \"header\".")) + panic(errors.New(500, "api key auth: in value needs to be either \"query\" or \"header\"")) } var getToken func(*http.Request) string @@ -186,7 +187,7 @@ func APIKeyAuthCtx(name, in string, authenticate TokenAuthenticationCtx) runtime inl := strings.ToLower(in) if inl != query && inl != header { // panic because this is most likely a typo - panic(errors.New(500, "api key auth: in value needs to be either \"query\" or \"header\".")) + panic(errors.New(500, "api key auth: in value needs to be either \"query\" or \"header\"")) } var getToken func(*http.Request) string @@ -220,18 +221,18 @@ func BearerAuth(name string, authenticate ScopedTokenAuthentication) runtime.Aut const prefix = "Bearer " return ScopedAuthenticator(func(r *ScopedAuthRequest) (bool, interface{}, error) { var token string - hdr := r.Request.Header.Get("Authorization") + hdr := r.Request.Header.Get(runtime.HeaderAuthorization) if strings.HasPrefix(hdr, prefix) { token = strings.TrimPrefix(hdr, prefix) } if token == "" { qs := r.Request.URL.Query() - token = qs.Get("access_token") + token = qs.Get(accessTokenParam) } //#nosec ct, _, _ := runtime.ContentType(r.Request.Header) if token == "" && (ct == "application/x-www-form-urlencoded" || ct == "multipart/form-data") { - token = r.Request.FormValue("access_token") + token = r.Request.FormValue(accessTokenParam) } if token == "" { @@ -250,18 +251,18 @@ func BearerAuthCtx(name string, authenticate ScopedTokenAuthenticationCtx) runti const prefix = "Bearer " return ScopedAuthenticator(func(r *ScopedAuthRequest) (bool, interface{}, error) { var token string - hdr := r.Request.Header.Get("Authorization") + hdr := r.Request.Header.Get(runtime.HeaderAuthorization) if strings.HasPrefix(hdr, prefix) { token = strings.TrimPrefix(hdr, prefix) } if token == "" { qs := r.Request.URL.Query() - token = qs.Get("access_token") + token = qs.Get(accessTokenParam) } //#nosec ct, _, _ := runtime.ContentType(r.Request.Header) if token == "" && (ct == "application/x-www-form-urlencoded" || ct == "multipart/form-data") { - token = r.Request.FormValue("access_token") + token = r.Request.FormValue(accessTokenParam) } if token == "" { diff --git a/vendor/github.com/go-openapi/runtime/text.go b/vendor/github.com/go-openapi/runtime/text.go index c7fd04c3c5..f33320b7dd 100644 --- a/vendor/github.com/go-openapi/runtime/text.go +++ b/vendor/github.com/go-openapi/runtime/text.go @@ -41,7 +41,6 @@ func TextConsumer() Consumer { // If the buffer is empty, no need to unmarshal it, which causes a panic. if len(b) == 0 { - data = "" return nil } diff --git a/vendor/github.com/go-openapi/runtime/yamlpc/yaml.go b/vendor/github.com/go-openapi/runtime/yamlpc/yaml.go new file mode 100644 index 0000000000..a1a0a589df --- /dev/null +++ b/vendor/github.com/go-openapi/runtime/yamlpc/yaml.go @@ -0,0 +1,39 @@ +// 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 yamlpc + +import ( + "io" + + "github.com/go-openapi/runtime" + "gopkg.in/yaml.v3" +) + +// YAMLConsumer creates a consumer for yaml data +func YAMLConsumer() runtime.Consumer { + return runtime.ConsumerFunc(func(r io.Reader, v interface{}) error { + dec := yaml.NewDecoder(r) + return dec.Decode(v) + }) +} + +// YAMLProducer creates a producer for yaml data +func YAMLProducer() runtime.Producer { + return runtime.ProducerFunc(func(w io.Writer, v interface{}) error { + enc := yaml.NewEncoder(w) + defer enc.Close() + return enc.Encode(v) + }) +} diff --git a/vendor/github.com/go-openapi/spec/.gitignore b/vendor/github.com/go-openapi/spec/.gitignore index dd91ed6a04..f47cb2045f 100644 --- a/vendor/github.com/go-openapi/spec/.gitignore +++ b/vendor/github.com/go-openapi/spec/.gitignore @@ -1,2 +1 @@ -secrets.yml -coverage.out +*.out diff --git a/vendor/github.com/go-openapi/spec/.golangci.yml b/vendor/github.com/go-openapi/spec/.golangci.yml index 4e17ed4979..22f8d21cca 100644 --- a/vendor/github.com/go-openapi/spec/.golangci.yml +++ b/vendor/github.com/go-openapi/spec/.golangci.yml @@ -11,7 +11,7 @@ linters-settings: threshold: 200 goconst: min-len: 2 - min-occurrences: 2 + min-occurrences: 3 linters: enable-all: true @@ -26,3 +26,36 @@ linters: - gocognit - whitespace - wsl + - wrapcheck + - testpackage + - nlreturn + - gomnd + - exhaustivestruct + - goerr113 + - errorlint + - nestif + - godot + - gofumpt + - paralleltest + - tparallel + - thelper + - ifshort + - exhaustruct + - varnamelen + - gci + - depguard + - errchkjson + - inamedparam + - nonamedreturns + - musttag + - ireturn + - forcetypeassert + - cyclop + # deprecated linters + - deadcode + - interfacer + - scopelint + - varcheck + - structcheck + - golint + - nosnakecase 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 f1a3f80b35..0000000000 --- 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/README.md b/vendor/github.com/go-openapi/spec/README.md index 6354742cbf..7fd2810c69 100644 --- a/vendor/github.com/go-openapi/spec/README.md +++ b/vendor/github.com/go-openapi/spec/README.md @@ -1,10 +1,54 @@ -# 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) +# OpenAPI v2 object model [![Build Status](https://github.com/go-openapi/spec/actions/workflows/go-test.yml/badge.svg)](https://github.com/go-openapi/spec/actions?query=workflow%3A"go+test") [![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 Reference](https://pkg.go.dev/badge/github.com/go-openapi/spec.svg)](https://pkg.go.dev/github.com/go-openapi/spec) [![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. +### FAQ + +* What does this do? + +> 1. This package knows how to marshal and unmarshal Swagger API specifications into a golang object model +> 2. It knows how to resolve $ref and expand them to make a single root document + +* How does it play with the rest of the go-openapi packages ? + +> 1. This package is at the core of the go-openapi suite of packages and [code generator](https://github.com/go-swagger/go-swagger) +> 2. There is a [spec loading package](https://github.com/go-openapi/loads) to fetch specs as JSON or YAML from local or remote locations +> 3. There is a [spec validation package](https://github.com/go-openapi/validate) built on top of it +> 4. There is a [spec analysis package](https://github.com/go-openapi/analysis) built on top of it, to analyze, flatten, fix and merge spec documents + +* Does this library support OpenAPI 3? + +> No. +> This package currently only supports OpenAPI 2.0 (aka Swagger 2.0). +> There is no plan to make it evolve toward supporting OpenAPI 3.x. +> This [discussion thread](https://github.com/go-openapi/spec/issues/21) relates the full story. +> +> An early attempt to support Swagger 3 may be found at: https://github.com/go-openapi/spec3 + +* Does the unmarshaling support YAML? + +> Not directly. The exposed types know only how to unmarshal from JSON. +> +> In order to load a YAML document as a Swagger spec, you need to use the loaders provided by +> github.com/go-openapi/loads +> +> Take a look at the example there: https://pkg.go.dev/github.com/go-openapi/loads#example-Spec +> +> See also https://github.com/go-openapi/spec/issues/164 + +* How can I validate a spec? + +> Validation is provided by [the validate package](http://github.com/go-openapi/validate) + +* Why do we have an `ID` field for `Schema` which is not part of the swagger spec? + +> We found jsonschema compatibility more important: since `id` in jsonschema influences +> how `$ref` are resolved. +> This `id` does not conflict with any property named `id`. +> +> See also https://github.com/go-openapi/spec/issues/23 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 66b1f32635..0000000000 --- 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 index 3fada0daef..122993b44b 100644 --- a/vendor/github.com/go-openapi/spec/cache.go +++ b/vendor/github.com/go-openapi/spec/cache.go @@ -14,7 +14,9 @@ package spec -import "sync" +import ( + "sync" +) // ResolutionCache a cache for resolving urls type ResolutionCache interface { @@ -27,12 +29,23 @@ type simpleCache struct { store map[string]interface{} } +func (s *simpleCache) ShallowClone() ResolutionCache { + store := make(map[string]interface{}, len(s.store)) + s.lock.RLock() + for k, v := range s.store { + store[k] = v + } + s.lock.RUnlock() + + return &simpleCache{ + store: store, + } +} + // 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 @@ -45,16 +58,41 @@ func (s *simpleCache) Set(uri string, data interface{}) { s.lock.Unlock() } -var resCache ResolutionCache +var ( + // resCache is a package level cache for $ref resolution and expansion. + // It is initialized lazily by methods that have the need for it: no + // memory is allocated unless some expander methods are called. + // + // It is initialized with JSON schema and swagger schema, + // which do not mutate during normal operations. + // + // All subsequent utilizations of this cache are produced from a shallow + // clone of this initial version. + resCache *simpleCache + onceCache sync.Once -func init() { - resCache = initResolutionCache() + _ ResolutionCache = &simpleCache{} +) + +// initResolutionCache initializes the URI resolution cache. To be wrapped in a sync.Once.Do call. +func initResolutionCache() { + resCache = defaultResolutionCache() } -// initResolutionCache initializes the URI resolution cache -func initResolutionCache() ResolutionCache { +func defaultResolutionCache() *simpleCache { return &simpleCache{store: map[string]interface{}{ "http://swagger.io/v2/schema.json": MustLoadSwagger20Schema(), "http://json-schema.org/draft-04/schema": MustLoadJSONSchemaDraft04(), }} } + +func cacheOrDefault(cache ResolutionCache) ResolutionCache { + onceCache.Do(initResolutionCache) + + if cache != nil { + return cache + } + + // get a shallow clone of the base cache with swagger and json schema + return resCache.ShallowClone() +} diff --git a/vendor/github.com/go-openapi/spec/contact_info.go b/vendor/github.com/go-openapi/spec/contact_info.go index f9bf42e8dd..2f7bb219b5 100644 --- a/vendor/github.com/go-openapi/spec/contact_info.go +++ b/vendor/github.com/go-openapi/spec/contact_info.go @@ -28,12 +28,14 @@ type ContactInfo struct { VendorExtensible } +// ContactInfoProps hold the properties of a ContactInfo object type ContactInfoProps struct { Name string `json:"name,omitempty"` URL string `json:"url,omitempty"` Email string `json:"email,omitempty"` } +// UnmarshalJSON hydrates ContactInfo from json func (c *ContactInfo) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &c.ContactInfoProps); err != nil { return err @@ -41,6 +43,7 @@ func (c *ContactInfo) UnmarshalJSON(data []byte) error { return json.Unmarshal(data, &c.VendorExtensible) } +// MarshalJSON produces ContactInfo as json func (c ContactInfo) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(c.ContactInfoProps) if err != nil { diff --git a/vendor/github.com/go-openapi/spec/debug.go b/vendor/github.com/go-openapi/spec/debug.go index 389c528ff6..fc889f6d0b 100644 --- a/vendor/github.com/go-openapi/spec/debug.go +++ b/vendor/github.com/go-openapi/spec/debug.go @@ -18,14 +18,16 @@ import ( "fmt" "log" "os" - "path/filepath" + "path" "runtime" ) +// Debug is true when the SWAGGER_DEBUG env var is not empty. +// +// It enables a more verbose logging of this package. +var Debug = os.Getenv("SWAGGER_DEBUG") != "" + 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 ) @@ -42,6 +44,6 @@ 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...)) + specLogger.Printf("%s:%d: %s", path.Base(file1), pos1, fmt.Sprintf(msg, args...)) } } diff --git a/vendor/github.com/go-openapi/spec/embed.go b/vendor/github.com/go-openapi/spec/embed.go new file mode 100644 index 0000000000..1f4284750a --- /dev/null +++ b/vendor/github.com/go-openapi/spec/embed.go @@ -0,0 +1,17 @@ +package spec + +import ( + "embed" + "path" +) + +//go:embed schemas/*.json schemas/*/*.json +var assets embed.FS + +func jsonschemaDraft04JSONBytes() ([]byte, error) { + return assets.ReadFile(path.Join("schemas", "jsonschema-draft-04.json")) +} + +func v2SchemaJSONBytes() ([]byte, error) { + return assets.ReadFile(path.Join("schemas", "v2", "schema.json")) +} diff --git a/vendor/github.com/go-openapi/spec/errors.go b/vendor/github.com/go-openapi/spec/errors.go new file mode 100644 index 0000000000..6992c7ba73 --- /dev/null +++ b/vendor/github.com/go-openapi/spec/errors.go @@ -0,0 +1,19 @@ +package spec + +import "errors" + +// Error codes +var ( + // ErrUnknownTypeForReference indicates that a resolved reference was found in an unsupported container type + ErrUnknownTypeForReference = errors.New("unknown type for the resolved reference") + + // ErrResolveRefNeedsAPointer indicates that a $ref target must be a valid JSON pointer + ErrResolveRefNeedsAPointer = errors.New("resolve ref: target needs to be a pointer") + + // ErrDerefUnsupportedType indicates that a resolved reference was found in an unsupported container type. + // At the moment, $ref are supported only inside: schemas, parameters, responses, path items + ErrDerefUnsupportedType = errors.New("deref: unsupported type") + + // ErrExpandUnsupportedType indicates that $ref expansion is attempted on some invalid type + ErrExpandUnsupportedType = errors.New("expand: unsupported type. Input should be of type *Parameter or *Response") +) diff --git a/vendor/github.com/go-openapi/spec/expander.go b/vendor/github.com/go-openapi/spec/expander.go index 1f30e7f8b1..b81a5699a0 100644 --- a/vendor/github.com/go-openapi/spec/expander.go +++ b/vendor/github.com/go-openapi/spec/expander.go @@ -17,152 +17,50 @@ 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. +// ExpandOptions provides options for the spec expander. // -// 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 +// RelativeBase is the path to the root document. This can be a remote URL or a path to a local file. +// +// If left empty, the root document is assumed to be located in the current working directory: +// all relative $ref's will be resolved from there. +// +// PathLoader injects a document loading method. By default, this resolves to the function provided by the SpecLoader package variable. +type ExpandOptions struct { + RelativeBase string // the path to the root document to expand. This is a file, not a directory + SkipSchemas bool // do not expand schemas, just paths, parameters and responses + ContinueOnError bool // continue expanding even after and error is found + PathLoader func(string) (json.RawMessage, error) `json:"-"` // the document loading method that takes a path as input and yields a json document + AbsoluteCircularRef bool // circular $ref remaining after expansion remain absolute URLs } -// 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 +func optionsOrDefault(opts *ExpandOptions) *ExpandOptions { + if opts != nil { + clone := *opts // shallow clone to avoid internal changes to be propagated to the caller + if clone.RelativeBase != "" { + clone.RelativeBase = normalizeBase(clone.RelativeBase) + } + // if the relative base is empty, let the schema loader choose a pseudo root document + return &clone } - return result, nil + return &ExpandOptions{} } // 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 - } + options = optionsOrDefault(options) + resolver := defaultSchemaLoader(spec, options, nil, nil) - // getting the base path of the spec to adjust all subsequent reference resolutions - specBasePath := "" - if options != nil && options.RelativeBase != "" { - specBasePath, _ = absPath(options.RelativeBase) - } + specBasePath := options.RelativeBase - if options == nil || !options.SkipSchemas { + if !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) { + parentRefs := make([]string, 0, 10) + parentRefs = append(parentRefs, "#/definitions/"+key) + + def, err := expandSchema(definition, parentRefs, resolver, specBasePath) + if resolver.shouldStopOnError(err) { return err } if def != nil { @@ -189,157 +87,154 @@ func ExpandSpec(spec *Swagger, options *ExpandOptions) error { if spec.Paths != nil { for key := range spec.Paths.Paths { - path := spec.Paths.Paths[key] - if err := expandPathItem(&path, resolver, specBasePath); resolver.shouldStopOnError(err) { + pth := spec.Paths.Paths[key] + if err := expandPathItem(&pth, resolver, specBasePath); resolver.shouldStopOnError(err) { return err } - spec.Paths.Paths[key] = path + spec.Paths.Paths[key] = pth } } return nil } -const rootBase = "root" -// baseForRoot loads in the cache the root document and produces a fake "root" base path entry +const rootBase = ".root" + +// 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 - if root != nil { - base, _ := absPath(rootBase) - normalizedBase := normalizeAbsPath(base) - debugLog("setting root doc in cache at: %s", normalizedBase) - if cache == nil { - cache = resCache + normalizedBase := normalizeBase(rootBase) + + if root == nil { + // ensure that we never leave a nil root: always cache the root base pseudo-document + cachedRoot, found := cache.Get(normalizedBase) + if found && cachedRoot != nil { + // the cache is already preloaded with a root + return normalizedBase } - cache.Set(normalizedBase, root) - return rootBase + + root = map[string]interface{}{} } - return "" + + cache.Set(normalizedBase, root) + + return normalizedBase } -// 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 +// 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 document other than root +// (use ExpandSchemaWithBasePath to resolve external references). +// +// Setting the cache is optional and this parameter may safely be left to nil. func ExpandSchema(schema *Schema, root interface{}, cache ResolutionCache) error { + cache = cacheOrDefault(cache) + if root == nil { + root = schema + } + 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 +// ExpandSchemaWithBasePath expands the refs in the schema object, base path configured through expand options. +// +// Setting the cache is optional and this parameter may safely be left to nil. func ExpandSchemaWithBasePath(schema *Schema, cache ResolutionCache, opts *ExpandOptions) error { if schema == nil { return nil } - var basePath string - if opts.RelativeBase != "" { - basePath, _ = absPath(opts.RelativeBase) - } + cache = cacheOrDefault(cache) + + opts = optionsOrDefault(opts) - resolver, err := defaultSchemaLoader(nil, opts, cache, nil) + resolver := defaultSchemaLoader(nil, opts, cache, nil) + + parentRefs := make([]string, 0, 10) + s, err := expandSchema(*schema, parentRefs, resolver, opts.RelativeBase) if err != nil { return err } - - refs := []string{""} - var s *Schema - if s, err = expandSchema(*schema, refs, resolver, basePath); err != nil { - return err + if s != nil { + // guard for when continuing on error + *schema = *s } - *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 + if target.Items == nil { + return &target, nil + } + + // array + if target.Items.Schema != nil { + t, err := expandSchema(*target.Items.Schema, parentRefs, resolver, basePath) + if err != nil { + return nil, err } - 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 + *target.Items.Schema = *t + } + + // tuple + 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) + newRef := normalizeRef(&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) + basePath, _ = resolver.setSchemaID(target, target.ID, 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 + if !resolver.options.SkipSchemas { + return expandSchemaRef(target, parentRefs, resolver, basePath) } - debugLog("basePath: %s: calling Resolve with target: %#v", basePath, target) - if err := resolver.Resolve(&target.Ref, &t, basePath); resolver.shouldStopOnError(err) { + // when "expand" with SkipSchema, we just rebase the existing $ref without replacing + // the full schema. + rebasedRef, err := NewRef(normalizeURI(target.Ref.String(), basePath)) + if err != nil { return nil, err } + target.Ref = denormalizeRef(&rebasedRef, resolver.context.basePath, resolver.context.rootID) - 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 &target, nil + } - return expandSchema(*t, parentRefs, transitiveResolver, basePath) + for k := range target.Definitions { + tt, err := expandSchema(target.Definitions[k], parentRefs, resolver, basePath) + if resolver.shouldStopOnError(err) { + return &target, err + } + if tt != nil { + target.Definitions[k] = *tt } } @@ -356,15 +251,21 @@ func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, ba if resolver.shouldStopOnError(err) { return &target, err } - target.AllOf[i] = *t + if t != nil { + 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 + if t != nil { + target.AnyOf[i] = *t + } } + for i := range target.OneOf { t, err := expandSchema(target.OneOf[i], parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { @@ -374,6 +275,7 @@ func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, ba target.OneOf[i] = *t } } + if target.Not != nil { t, err := expandSchema(*target.Not, parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { @@ -383,6 +285,7 @@ func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, ba *target.Not = *t } } + for k := range target.Properties { t, err := expandSchema(target.Properties[k], parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { @@ -392,6 +295,7 @@ func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, ba 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) { @@ -401,6 +305,7 @@ func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, ba *target.AdditionalProperties.Schema = *t } } + for k := range target.PatternProperties { t, err := expandSchema(target.PatternProperties[k], parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { @@ -410,6 +315,7 @@ func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, ba 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) @@ -421,6 +327,7 @@ func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, ba } } } + if target.AdditionalItems != nil && target.AdditionalItems.Schema != nil { t, err := expandSchema(*target.AdditionalItems.Schema, parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { @@ -430,16 +337,48 @@ func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, ba *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 expandSchemaRef(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { + // if a Ref is found, all sibling fields are skipped + // Ref also changes the resolution scope of children expandSchema + + // here the resolution scope is changed because a $ref was encountered + normalizedRef := normalizeRef(&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("short circuit circular ref: basePath: %s, normalizedPath: %s, normalized ref: %s", + basePath, normalizedBasePath, normalizedRef.String()) + if !resolver.options.AbsoluteCircularRef { + target.Ref = denormalizeRef(normalizedRef, resolver.context.basePath, resolver.context.rootID) + } else { + target.Ref = *normalizedRef } + return &target, nil } - return &target, nil + + var t *Schema + err := resolver.Resolve(&target.Ref, &t, basePath) + if resolver.shouldStopOnError(err) { + return nil, err + } + + if t == nil { + // guard for when continuing on error + return &target, nil + } + + parentRefs = append(parentRefs, normalizedRef.String()) + transitiveResolver := resolver.transitiveResolver(basePath, target.Ref) + + basePath = resolver.updateBasePath(transitiveResolver, normalizedBasePath) + + return expandSchema(*t, parentRefs, transitiveResolver, basePath) } func expandPathItem(pathItem *PathItem, resolver *schemaLoader, basePath string) error { @@ -447,25 +386,24 @@ func expandPathItem(pathItem *PathItem, resolver *schemaLoader, basePath string) return nil } - parentRefs := []string{} + parentRefs := make([]string, 0, 10) 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 - } + transitiveResolver := resolver.transitiveResolver(basePath, pathItem.Ref) 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) { + pathItem.Ref = Ref{} + for i := range pathItem.Parameters { + if err := expandParameterOrResponse(&(pathItem.Parameters[i]), resolver, basePath); resolver.shouldStopOnError(err) { return err } } + ops := []*Operation{ pathItem.Get, pathItem.Head, @@ -480,6 +418,7 @@ func expandPathItem(pathItem *PathItem, resolver *schemaLoader, basePath string) return err } } + return nil } @@ -496,71 +435,65 @@ func expandOperation(op *Operation, resolver *schemaLoader, basePath string) err op.Parameters[i] = param } - if op.Responses != nil { - responses := op.Responses - if err := expandParameterOrResponse(responses.Default, resolver, basePath); resolver.shouldStopOnError(err) { + if op.Responses == nil { + return 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 } - for code := range responses.StatusCodeResponses { - response := responses.StatusCodeResponses[code] - if err := expandParameterOrResponse(&response, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - responses.StatusCodeResponses[code] = response - } + responses.StatusCodeResponses[code] = response } + return nil } // ExpandResponseWithRoot expands a response based on a root document, not a fetchable document +// +// Notice that it is impossible to reference a json schema in a different document other than root +// (use ExpandResponse to resolve external references). +// +// Setting the cache is optional and this parameter may safely be left to nil. func ExpandResponseWithRoot(response *Response, root interface{}, cache ResolutionCache) error { + cache = cacheOrDefault(cache) 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 + RelativeBase: baseForRoot(root, cache), } + resolver := defaultSchemaLoader(root, opts, cache, nil) 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 +// +// 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 - } + opts := optionsOrDefault(&ExpandOptions{ + RelativeBase: basePath, + }) + resolver := defaultSchemaLoader(nil, opts, nil, nil) return expandParameterOrResponse(response, resolver, opts.RelativeBase) } -// ExpandParameterWithRoot expands a parameter based on a root document, not a fetchable document +// ExpandParameterWithRoot expands a parameter based on a root document, not a fetchable document. +// +// Notice that it is impossible to reference a json schema in a different document other than root +// (use ExpandParameter to resolve external references). func ExpandParameterWithRoot(parameter *Parameter, root interface{}, cache ResolutionCache) error { + cache = cacheOrDefault(cache) + 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 + RelativeBase: baseForRoot(root, cache), } + resolver := defaultSchemaLoader(root, opts, cache, nil) return expandParameterOrResponse(parameter, resolver, opts.RelativeBase) } @@ -569,24 +502,20 @@ func ExpandParameterWithRoot(parameter *Parameter, root interface{}, cache Resol // 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 - } + opts := optionsOrDefault(&ExpandOptions{ + RelativeBase: basePath, + }) + resolver := defaultSchemaLoader(nil, opts, nil, nil) return expandParameterOrResponse(parameter, resolver, opts.RelativeBase) } func getRefAndSchema(input interface{}) (*Ref, *Schema, error) { - var ref *Ref - var sch *Schema + var ( + ref *Ref + sch *Schema + ) + switch refable := input.(type) { case *Parameter: if refable == nil { @@ -601,51 +530,78 @@ func getRefAndSchema(input interface{}) (*Ref, *Schema, error) { 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 nil, nil, fmt.Errorf("unsupported type: %T: %w", input, ErrExpandUnsupportedType) } + return ref, sch, nil } func expandParameterOrResponse(input interface{}, resolver *schemaLoader, basePath string) error { - ref, _, err := getRefAndSchema(input) + ref, sch, err := getRefAndSchema(input) if err != nil { return err } - if ref == nil { + + if ref == nil && sch == nil { // nothing to do 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) { + + parentRefs := make([]string, 0, 10) + if ref != nil { + // dereference this $ref + if err = resolver.deref(input, parentRefs, basePath); resolver.shouldStopOnError(err) { return err } + + ref, sch, _ = getRefAndSchema(input) + } + + if ref.String() != "" { + transitiveResolver := resolver.transitiveResolver(basePath, *ref) 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 sch == nil { + // nothing to be expanded + if ref != nil { + *ref = Ref{} + } + + return nil + } + + if sch.Ref.String() != "" { + rebasedRef, ern := NewRef(normalizeURI(sch.Ref.String(), basePath)) if ern != nil { return ern } + + if resolver.isCircular(&rebasedRef, basePath, parentRefs...) { + // this is a circular $ref: stop expansion + if !resolver.options.AbsoluteCircularRef { + sch.Ref = denormalizeRef(&rebasedRef, resolver.context.basePath, resolver.context.rootID) + } else { + sch.Ref = rebasedRef + } + } } + + // $ref expansion or rebasing is performed by expandSchema below if ref != nil { *ref = Ref{} } - if !resolver.options.SkipSchemas && sch != nil { - s, err := expandSchema(*sch, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return err - } + // expand schema + // yes, we do it even if options.SkipSchema is true: we have to go down that rabbit hole and rebase nested $ref) + s, err := expandSchema(*sch, parentRefs, resolver, basePath) + if resolver.shouldStopOnError(err) { + return err + } + + if s != nil { // guard for when continuing on error *sch = *s } + return nil } diff --git a/vendor/github.com/go-openapi/spec/header.go b/vendor/github.com/go-openapi/spec/header.go index 39efe452bb..9dfd17b185 100644 --- a/vendor/github.com/go-openapi/spec/header.go +++ b/vendor/github.com/go-openapi/spec/header.go @@ -141,6 +141,12 @@ func (h *Header) AllowDuplicates() *Header { return h } +// WithValidations is a fluent method to set header validations +func (h *Header) WithValidations(val CommonValidations) *Header { + h.SetValidations(SchemaValidations{CommonValidations: val}) + return h +} + // MarshalJSON marshal this to JSON func (h Header) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(h.CommonValidations) diff --git a/vendor/github.com/go-openapi/spec/info.go b/vendor/github.com/go-openapi/spec/info.go index c458b49b21..582f0fd4c4 100644 --- a/vendor/github.com/go-openapi/spec/info.go +++ b/vendor/github.com/go-openapi/spec/info.go @@ -16,6 +16,7 @@ package spec import ( "encoding/json" + "strconv" "strings" "github.com/go-openapi/jsonpointer" @@ -40,6 +41,24 @@ func (e Extensions) GetString(key string) (string, bool) { return "", false } +// GetInt gets a int value from the extensions +func (e Extensions) GetInt(key string) (int, bool) { + realKey := strings.ToLower(key) + + if v, ok := e.GetString(realKey); ok { + if r, err := strconv.Atoi(v); err == nil { + return r, true + } + } + + if v, ok := e[realKey]; ok { + if r, rOk := v.(float64); rOk { + return int(r), true + } + } + return -1, 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 { diff --git a/vendor/github.com/go-openapi/spec/items.go b/vendor/github.com/go-openapi/spec/items.go index 365d163158..e2afb2133b 100644 --- a/vendor/github.com/go-openapi/spec/items.go +++ b/vendor/github.com/go-openapi/spec/items.go @@ -53,22 +53,6 @@ func (s *SimpleSchema) ItemsTypeName() string { 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". // @@ -180,6 +164,12 @@ func (i *Items) AllowDuplicates() *Items { return i } +// WithValidations is a fluent method to set Items validations +func (i *Items) WithValidations(val CommonValidations) *Items { + i.SetValidations(SchemaValidations{CommonValidations: val}) + return i +} + // UnmarshalJSON hydrates this items instance with the data from JSON func (i *Items) UnmarshalJSON(data []byte) error { var validations CommonValidations diff --git a/vendor/github.com/go-openapi/spec/license.go b/vendor/github.com/go-openapi/spec/license.go index e1529b401c..b42f80368e 100644 --- a/vendor/github.com/go-openapi/spec/license.go +++ b/vendor/github.com/go-openapi/spec/license.go @@ -28,11 +28,13 @@ type License struct { VendorExtensible } +// LicenseProps holds the properties of a License object type LicenseProps struct { Name string `json:"name,omitempty"` URL string `json:"url,omitempty"` } +// UnmarshalJSON hydrates License from json func (l *License) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &l.LicenseProps); err != nil { return err @@ -40,6 +42,7 @@ func (l *License) UnmarshalJSON(data []byte) error { return json.Unmarshal(data, &l.VendorExtensible) } +// MarshalJSON produces License as json func (l License) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(l.LicenseProps) if err != nil { diff --git a/vendor/github.com/go-openapi/spec/normalizer.go b/vendor/github.com/go-openapi/spec/normalizer.go index b8957e7c0c..e8b6009945 100644 --- a/vendor/github.com/go-openapi/spec/normalizer.go +++ b/vendor/github.com/go-openapi/spec/normalizer.go @@ -15,138 +15,188 @@ 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) +const fileScheme = "file" + +// normalizeURI ensures that all $ref paths used internally by the expander are canonicalized. +// +// NOTE(windows): there is a tolerance over the strict URI format on windows. +// +// The normalizer accepts relative file URLs like 'Path\File.JSON' as well as absolute file URLs like +// 'C:\Path\file.Yaml'. +// +// Both are canonicalized with a "file://" scheme, slashes and a lower-cased path: +// 'file:///c:/path/file.yaml' +// +// URLs can be specified with a file scheme, like in 'file:///folder/file.json' or +// 'file:///c:\folder\File.json'. +// +// URLs like file://C:\folder are considered invalid (i.e. there is no host 'c:\folder') and a "repair" +// is attempted. +// +// The base path argument is assumed to be canonicalized (e.g. using normalizeBase()). +func normalizeURI(refPath, base string) string { + refURL, err := parseURL(refPath) if err != nil { - debugLog("normalize absolute path failed: %s", err) - return path + specLogger.Printf("warning: invalid URI in $ref %q: %v", refPath, err) + refURL, refPath = repairURI(refPath) } - 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 + fixWindowsURI(refURL, refPath) // noop on non-windows OS + + refURL.Path = path.Clean(refURL.Path) + if refURL.Path == "." { + refURL.Path = "" } - // 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 - } + r := MustCreateRef(refURL.String()) + if r.IsCanonical() { + return refURL.String() + } + baseURL, _ := parseURL(base) + if path.IsAbs(refURL.Path) { + baseURL.Path = refURL.Path + } else if refURL.Path != "" { + baseURL.Path = path.Join(path.Dir(baseURL.Path), refURL.Path) } // 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. +// denormalizeRef returns the simplest notation for a normalized $ref, given the path of the original root document. +// +// When calling this, we assume that: +// * $ref is a canonical URI +// * originalRelativeBase is a canonical URI +// +// denormalizeRef is currently used when we rewrite a $ref after a circular $ref has been detected. +// In this case, expansion stops and normally renders the internal canonical $ref. +// +// This internal $ref is eventually rebased to the original RelativeBase used for the expansion. // -// 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()) +// There is a special case for schemas that are anchored with an "id": +// in that case, the rebasing is performed // against the id only if this is an anchor for the initial root document. +// All other intermediate "id"'s found along the way are ignored for the purpose of rebasing. +func denormalizeRef(ref *Ref, originalRelativeBase, id string) Ref { + debugLog("denormalizeRef called:\n$ref: %q\noriginal: %s\nroot ID:%s", ref.String(), originalRelativeBase, id) if ref.String() == "" || ref.IsRoot() || ref.HasFragmentOnly { - return ref + // short circuit: $ref to current doc + 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 id != "" { + idBaseURL, err := parseURL(id) + if err == nil { // if the schema id is not usable as a URI, ignore it + if ref, ok := rebase(ref, idBaseURL, true); ok { // rebase, but keep references to root unchaged (do not want $ref: "") + // $ref relative to the ID of the schema in the root document + return ref + } + } } - if relativeBaseURL.IsAbs() { - // other absolute URL get unchanged (i.e. with a non-empty scheme) - return ref + originalRelativeBaseURL, _ := parseURL(originalRelativeBase) + + r, _ := rebase(ref, originalRelativeBaseURL, false) + + return r +} + +func rebase(ref *Ref, v *url.URL, notEqual bool) (Ref, bool) { + var newBase url.URL + + u := ref.GetURL() + + if u.Scheme != v.Scheme || u.Host != v.Host { + return *ref, false } - // 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 + docPath := v.Path + v.Path = path.Dir(v.Path) + + if v.Path == "." { + v.Path = "" + } else if !strings.HasSuffix(v.Path, "/") { + v.Path += "/" } - // 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 + newBase.Fragment = u.Fragment + + if strings.HasPrefix(u.Path, docPath) { + newBase.Path = strings.TrimPrefix(u.Path, docPath) + } else { + newBase.Path = strings.TrimPrefix(u.Path, v.Path) } - if len(parts) == 2 { - relativePath += "#" + parts[1] + + if notEqual && newBase.Path == "" && newBase.Fragment == "" { + // do not want rebasing to end up in an empty $ref + return *ref, false } - 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 + if path.IsAbs(newBase.Path) { + // whenever we end up with an absolute path, specify the scheme and host + newBase.Scheme = v.Scheme + newBase.Host = v.Host } - debugLog("normalizing %s against %s", ref.String(), relativeBase) + return MustCreateRef(newBase.String()), true +} - s := normalizePaths(ref.String(), relativeBase) - r, _ := NewRef(s) +// normalizeRef canonicalize a Ref, using a canonical relativeBase as its absolute anchor +func normalizeRef(ref *Ref, relativeBase string) *Ref { + r := MustCreateRef(normalizeURI(ref.String(), relativeBase)) return &r } -// absPath returns the absolute path of a file -func absPath(fname string) (string, error) { - if strings.HasPrefix(fname, "http") { - return fname, nil +// normalizeBase performs a normalization of the input base path. +// +// This always yields a canonical URI (absolute), usable for the document cache. +// +// It ensures that all further internal work on basePath may safely assume +// a non-empty, cross-platform, canonical URI (i.e. absolute). +// +// This normalization tolerates windows paths (e.g. C:\x\y\File.dat) and transform this +// in a file:// URL with lower cased drive letter and path. +// +// See also: https://en.wikipedia.org/wiki/File_URI_scheme +func normalizeBase(in string) string { + u, err := parseURL(in) + if err != nil { + specLogger.Printf("warning: invalid URI in RelativeBase %q: %v", in, err) + u, in = repairURI(in) } - if filepath.IsAbs(fname) { - return fname, nil + + u.Fragment = "" // any fragment in the base is irrelevant + + fixWindowsURI(u, in) // noop on non-windows OS + + u.Path = path.Clean(u.Path) + if u.Path == "." { // empty after Clean() + u.Path = "" } - wd, err := os.Getwd() - return filepath.Join(wd, fname), err + + if u.Scheme != "" { + if path.IsAbs(u.Path) || u.Scheme != fileScheme { + // this is absolute or explicitly not a local file: we're good + return u.String() + } + } + + // no scheme or file scheme with relative path: assume file and make it absolute + // enforce scheme file://... with absolute path. + // + // If the input path is relative, we anchor the path to the current working directory. + // NOTE: we may end up with a host component. Leave it unchanged: e.g. file://host/folder/file.json + + u.Scheme = fileScheme + u.Path = absPath(u.Path) // platform-dependent + u.RawQuery = "" // any query component is irrelevant for a base + return u.String() } diff --git a/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go b/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go new file mode 100644 index 0000000000..f19f1a8fb6 --- /dev/null +++ b/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go @@ -0,0 +1,44 @@ +//go:build !windows +// +build !windows + +// 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" + "path/filepath" +) + +// absPath makes a file path absolute and compatible with a URI path component. +// +// The parameter must be a path, not an URI. +func absPath(in string) string { + anchored, err := filepath.Abs(in) + if err != nil { + specLogger.Printf("warning: could not resolve current working directory: %v", err) + return in + } + return anchored +} + +func repairURI(in string) (*url.URL, string) { + u, _ := parseURL("") + debugLog("repaired URI: original: %q, repaired: %q", in, "") + return u, "" +} + +func fixWindowsURI(_ *url.URL, _ string) { +} diff --git a/vendor/github.com/go-openapi/spec/normalizer_windows.go b/vendor/github.com/go-openapi/spec/normalizer_windows.go new file mode 100644 index 0000000000..a66c532dbc --- /dev/null +++ b/vendor/github.com/go-openapi/spec/normalizer_windows.go @@ -0,0 +1,154 @@ +// -build windows + +// 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" + "strings" +) + +// absPath makes a file path absolute and compatible with a URI path component +// +// The parameter must be a path, not an URI. +func absPath(in string) string { + // NOTE(windows): filepath.Abs exhibits a special behavior on windows for empty paths. + // See https://github.com/golang/go/issues/24441 + if in == "" { + in = "." + } + + anchored, err := filepath.Abs(in) + if err != nil { + specLogger.Printf("warning: could not resolve current working directory: %v", err) + return in + } + + pth := strings.ReplaceAll(strings.ToLower(anchored), `\`, `/`) + if !strings.HasPrefix(pth, "/") { + pth = "/" + pth + } + + return path.Clean(pth) +} + +// repairURI tolerates invalid file URIs with common typos +// such as 'file://E:\folder\file', that break the regular URL parser. +// +// Adopting the same defaults as for unixes (e.g. return an empty path) would +// result into a counter-intuitive result for that case (e.g. E:\folder\file is +// eventually resolved as the current directory). The repair will detect the missing "/". +// +// Note that this only works for the file scheme. +func repairURI(in string) (*url.URL, string) { + const prefix = fileScheme + "://" + if !strings.HasPrefix(in, prefix) { + // giving up: resolve to empty path + u, _ := parseURL("") + + return u, "" + } + + // attempt the repair, stripping the scheme should be sufficient + u, _ := parseURL(strings.TrimPrefix(in, prefix)) + debugLog("repaired URI: original: %q, repaired: %q", in, u.String()) + + return u, u.String() +} + +// fixWindowsURI tolerates an absolute file path on windows such as C:\Base\File.yaml or \\host\share\Base\File.yaml +// and makes it a canonical URI: file:///c:/base/file.yaml +// +// Catch 22 notes for Windows: +// +// * There may be a drive letter on windows (it is lower-cased) +// * There may be a share UNC, e.g. \\server\folder\data.xml +// * Paths are case insensitive +// * Paths may already contain slashes +// * Paths must be slashed +// +// NOTE: there is no escaping. "/" may be valid separators just like "\". +// We don't use ToSlash() (which escapes everything) because windows now also +// tolerates the use of "/". Hence, both C:\File.yaml and C:/File.yaml will work. +func fixWindowsURI(u *url.URL, in string) { + drive := filepath.VolumeName(in) + + if len(drive) > 0 { + if len(u.Scheme) == 1 && strings.EqualFold(u.Scheme, drive[:1]) { // a path with a drive letter + u.Scheme = fileScheme + u.Host = "" + u.Path = strings.Join([]string{drive, u.Opaque, u.Path}, `/`) // reconstruct the full path component (no fragment, no query) + } else if u.Host == "" && strings.HasPrefix(u.Path, drive) { // a path with a \\host volume + // NOTE: the special host@port syntax for UNC is not supported (yet) + u.Scheme = fileScheme + + // this is a modified version of filepath.Dir() to apply on the VolumeName itself + i := len(drive) - 1 + for i >= 0 && !os.IsPathSeparator(drive[i]) { + i-- + } + host := drive[:i] // \\host\share => host + + u.Path = strings.TrimPrefix(u.Path, host) + u.Host = strings.TrimPrefix(host, `\\`) + } + + u.Opaque = "" + u.Path = strings.ReplaceAll(strings.ToLower(u.Path), `\`, `/`) + + // ensure we form an absolute path + if !strings.HasPrefix(u.Path, "/") { + u.Path = "/" + u.Path + } + + u.Path = path.Clean(u.Path) + + return + } + + if u.Scheme == fileScheme { + // Handle dodgy cases for file://{...} URIs on windows. + // A canonical URI should always be followed by an absolute path. + // + // Examples: + // * file:///folder/file => valid, unchanged + // * file:///c:\folder\file => slashed + // * file:///./folder/file => valid, cleaned to remove the dot + // * file:///.\folder\file => remapped to cwd + // * file:///. => dodgy, remapped to / (consistent with the behavior on unix) + // * file:///.. => dodgy, remapped to / (consistent with the behavior on unix) + if (!path.IsAbs(u.Path) && !filepath.IsAbs(u.Path)) || (strings.HasPrefix(u.Path, `/.`) && strings.Contains(u.Path, `\`)) { + // ensure we form an absolute path + u.Path, _ = filepath.Abs(strings.TrimLeft(u.Path, `/`)) + if !strings.HasPrefix(u.Path, "/") { + u.Path = "/" + u.Path + } + } + u.Path = strings.ToLower(u.Path) + } + + // NOTE: lower case normalization does not propagate to inner resources, + // generated when rebasing: when joining a relative URI with a file to an absolute base, + // only the base is currently lower-cased. + // + // For now, we assume this is good enough for most use cases + // and try not to generate too many differences + // between the output produced on different platforms. + u.Path = path.Clean(strings.ReplaceAll(u.Path, `\`, `/`)) +} diff --git a/vendor/github.com/go-openapi/spec/operation.go b/vendor/github.com/go-openapi/spec/operation.go index b1ebd59945..a69cca8814 100644 --- a/vendor/github.com/go-openapi/spec/operation.go +++ b/vendor/github.com/go-openapi/spec/operation.go @@ -25,7 +25,6 @@ import ( ) func init() { - //gob.Register(map[string][]interface{}{}) gob.Register(map[string]interface{}{}) gob.Register([]interface{}{}) } @@ -218,9 +217,12 @@ func (o *Operation) AddParam(param *Parameter) *Operation { for i, p := range o.Parameters { if p.Name == param.Name && p.In == param.In { - params := append(o.Parameters[:i], *param) + params := make([]Parameter, 0, len(o.Parameters)+1) + params = append(params, o.Parameters[:i]...) + params = append(params, *param) params = append(params, o.Parameters[i+1:]...) o.Parameters = params + return o } } diff --git a/vendor/github.com/go-openapi/spec/parameter.go b/vendor/github.com/go-openapi/spec/parameter.go index cecdff5456..bd4f1cdb07 100644 --- a/vendor/github.com/go-openapi/spec/parameter.go +++ b/vendor/github.com/go-openapi/spec/parameter.go @@ -39,8 +39,7 @@ func PathParam(name string) *Parameter { // 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"}} + return &Parameter{ParamProps: ParamProps{Name: name, In: "body", Schema: schema}} } // FormDataParam creates a body parameter @@ -58,7 +57,7 @@ func FileParam(name string) *Parameter { 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}}}} + Items: &Items{SimpleSchema: SimpleSchema{Type: tpe, Format: fmt}}}} } // ParamRef creates a parameter that's a json reference @@ -85,27 +84,27 @@ type ParamProps struct { // 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. +// - 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 { @@ -278,6 +277,12 @@ func (p *Parameter) AllowDuplicates() *Parameter { return p } +// WithValidations is a fluent method to set parameter validations +func (p *Parameter) WithValidations(val CommonValidations) *Parameter { + p.SetValidations(SchemaValidations{CommonValidations: val}) + 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 { diff --git a/vendor/github.com/go-openapi/spec/properties.go b/vendor/github.com/go-openapi/spec/properties.go new file mode 100644 index 0000000000..91d2435f01 --- /dev/null +++ b/vendor/github.com/go-openapi/spec/properties.go @@ -0,0 +1,91 @@ +package spec + +import ( + "bytes" + "encoding/json" + "reflect" + "sort" +) + +// OrderSchemaItem holds a named schema (e.g. from a property of an object) +type OrderSchemaItem struct { + Name string + Schema +} + +// OrderSchemaItems is a sortable slice of named schemas. +// The ordering is defined by the x-order schema extension. +type OrderSchemaItems []OrderSchemaItem + +// MarshalJSON produces a json object with keys defined by the name schemas +// of the OrderSchemaItems slice, keeping the original order of the slice. +func (items OrderSchemaItems) MarshalJSON() ([]byte, error) { + buf := bytes.NewBuffer(nil) + buf.WriteString("{") + for i := range items { + if i > 0 { + buf.WriteString(",") + } + buf.WriteString("\"") + buf.WriteString(items[i].Name) + buf.WriteString("\":") + bs, err := json.Marshal(&items[i].Schema) + if err != nil { + return nil, err + } + buf.Write(bs) + } + buf.WriteString("}") + return buf.Bytes(), nil +} + +func (items OrderSchemaItems) Len() int { return len(items) } +func (items OrderSchemaItems) Swap(i, j int) { items[i], items[j] = items[j], items[i] } +func (items OrderSchemaItems) Less(i, j int) (ret bool) { + ii, oki := items[i].Extensions.GetInt("x-order") + ij, okj := items[j].Extensions.GetInt("x-order") + if oki { + if okj { + defer func() { + if err := recover(); err != nil { + defer func() { + if err = recover(); err != nil { + ret = items[i].Name < items[j].Name + } + }() + ret = reflect.ValueOf(ii).String() < reflect.ValueOf(ij).String() + } + }() + return ii < ij + } + return true + } else if okj { + return false + } + return items[i].Name < items[j].Name +} + +// SchemaProperties is a map representing the properties of a Schema object. +// It knows how to transform its keys into an ordered slice. +type SchemaProperties map[string]Schema + +// ToOrderedSchemaItems transforms the map of properties into a sortable slice +func (properties SchemaProperties) ToOrderedSchemaItems() OrderSchemaItems { + items := make(OrderSchemaItems, 0, len(properties)) + for k, v := range properties { + items = append(items, OrderSchemaItem{ + Name: k, + Schema: v, + }) + } + sort.Sort(items) + return items +} + +// MarshalJSON produces properties as json, keeping their order. +func (properties SchemaProperties) MarshalJSON() ([]byte, error) { + if properties == nil { + return []byte("null"), nil + } + return json.Marshal(properties.ToOrderedSchemaItems()) +} diff --git a/vendor/github.com/go-openapi/spec/ref.go b/vendor/github.com/go-openapi/spec/ref.go index 1f31a9ead0..b0ef9bd9c9 100644 --- a/vendor/github.com/go-openapi/spec/ref.go +++ b/vendor/github.com/go-openapi/spec/ref.go @@ -48,7 +48,7 @@ type Ref struct { // RemoteURI gets the remote uri part of the ref func (r *Ref) RemoteURI() string { if r.String() == "" { - return r.String() + return "" } u := *r.GetURL() @@ -68,7 +68,7 @@ func (r *Ref) IsValidURI(basepaths ...string) bool { } if r.HasFullURL { - //#nosec + //nolint:noctx,gosec rr, err := http.Get(v) if err != nil { return false diff --git a/vendor/github.com/go-openapi/spec/resolver.go b/vendor/github.com/go-openapi/spec/resolver.go new file mode 100644 index 0000000000..47d1ee13fc --- /dev/null +++ b/vendor/github.com/go-openapi/spec/resolver.go @@ -0,0 +1,127 @@ +package spec + +import ( + "fmt" + + "github.com/go-openapi/swag" +) + +func resolveAnyWithBase(root interface{}, ref *Ref, result interface{}, options *ExpandOptions) error { + options = optionsOrDefault(options) + resolver := defaultSchemaLoader(root, options, nil, nil) + + if err := resolver.Resolve(ref, result, options.RelativeBase); err != nil { + return err + } + + return nil +} + +// ResolveRefWithBase resolves a reference against a context root with preservation of base path +func ResolveRefWithBase(root interface{}, ref *Ref, options *ExpandOptions) (*Schema, error) { + result := new(Schema) + + if err := resolveAnyWithBase(root, ref, result, options); err != nil { + return nil, err + } + + return result, nil +} + +// ResolveRef resolves a reference for a schema 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 { + return nil, err + } + + switch sch := res.(type) { + case Schema: + return &sch, nil + case *Schema: + return sch, nil + case map[string]interface{}: + newSch := new(Schema) + if err = swag.DynamicJSONToStruct(sch, newSch); err != nil { + return nil, err + } + return newSch, nil + default: + return nil, fmt.Errorf("type: %T: %w", sch, ErrUnknownTypeForReference) + } +} + +// ResolveParameterWithBase resolves a parameter reference against a context root and base path +func ResolveParameterWithBase(root interface{}, ref Ref, options *ExpandOptions) (*Parameter, error) { + result := new(Parameter) + + if err := resolveAnyWithBase(root, &ref, result, options); err != nil { + return nil, err + } + + return result, nil +} + +// ResolveParameter resolves a parameter reference against a context root +func ResolveParameter(root interface{}, ref Ref) (*Parameter, error) { + return ResolveParameterWithBase(root, ref, nil) +} + +// ResolveResponseWithBase resolves response a reference against a context root and base path +func ResolveResponseWithBase(root interface{}, ref Ref, options *ExpandOptions) (*Response, error) { + result := new(Response) + + err := resolveAnyWithBase(root, &ref, result, options) + if 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) +} + +// ResolvePathItemWithBase resolves response a path item against a context root and base path +func ResolvePathItemWithBase(root interface{}, ref Ref, options *ExpandOptions) (*PathItem, error) { + result := new(PathItem) + + if err := resolveAnyWithBase(root, &ref, result, options); err != nil { + return nil, err + } + + return result, nil +} + +// ResolvePathItem resolves response a path item against a context root and base path +// +// Deprecated: use ResolvePathItemWithBase instead +func ResolvePathItem(root interface{}, ref Ref, options *ExpandOptions) (*PathItem, error) { + return ResolvePathItemWithBase(root, ref, options) +} + +// ResolveItemsWithBase 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 ResolveItemsWithBase(root interface{}, ref Ref, options *ExpandOptions) (*Items, error) { + result := new(Items) + + if err := resolveAnyWithBase(root, &ref, result, options); err != nil { + return nil, err + } + + return result, nil +} + +// ResolveItems resolves parameter items reference against a context root and base path. +// +// Deprecated: use ResolveItemsWithBase instead +func ResolveItems(root interface{}, ref Ref, options *ExpandOptions) (*Items, error) { + return ResolveItemsWithBase(root, ref, options) +} diff --git a/vendor/github.com/go-openapi/spec/response.go b/vendor/github.com/go-openapi/spec/response.go index 27729c1d93..0340b60d84 100644 --- a/vendor/github.com/go-openapi/spec/response.go +++ b/vendor/github.com/go-openapi/spec/response.go @@ -23,7 +23,7 @@ import ( // ResponseProps properties specific to a response type ResponseProps struct { - Description string `json:"description,omitempty"` + Description string `json:"description"` Schema *Schema `json:"schema,omitempty"` Headers map[string]Header `json:"headers,omitempty"` Examples map[string]interface{} `json:"examples,omitempty"` @@ -63,10 +63,31 @@ func (r *Response) UnmarshalJSON(data []byte) error { // MarshalJSON converts this items object to JSON func (r Response) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(r.ResponseProps) + var ( + b1 []byte + err error + ) + + if r.Ref.String() == "" { + // when there is no $ref, empty description is rendered as an empty string + b1, err = json.Marshal(r.ResponseProps) + } else { + // when there is $ref inside the schema, description should be omitempty-ied + b1, err = json.Marshal(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"` + }{ + Description: r.ResponseProps.Description, + Schema: r.ResponseProps.Schema, + Examples: r.ResponseProps.Examples, + }) + } if err != nil { return nil, err } + b2, err := json.Marshal(r.Refable) if err != nil { return nil, err diff --git a/vendor/github.com/go-openapi/spec/responses.go b/vendor/github.com/go-openapi/spec/responses.go index 4efb6f868b..16c3076fe8 100644 --- a/vendor/github.com/go-openapi/spec/responses.go +++ b/vendor/github.com/go-openapi/spec/responses.go @@ -19,6 +19,7 @@ import ( "fmt" "reflect" "strconv" + "strings" "github.com/go-openapi/swag" ) @@ -62,6 +63,7 @@ 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 } @@ -107,20 +109,31 @@ func (r ResponsesProps) MarshalJSON() ([]byte, error) { // UnmarshalJSON unmarshals responses from JSON func (r *ResponsesProps) UnmarshalJSON(data []byte) error { - var res map[string]Response + var res map[string]json.RawMessage if err := json.Unmarshal(data, &res); err != nil { - return nil + return err } + if v, ok := res["default"]; ok { - r.Default = &v + var defaultRes Response + if err := json.Unmarshal(v, &defaultRes); err != nil { + return err + } + r.Default = &defaultRes 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{} + if !strings.HasPrefix(k, "x-") { + var statusCodeResp Response + if err := json.Unmarshal(v, &statusCodeResp); err != nil { + return err + } + if nk, err := strconv.Atoi(k); err == nil { + if r.StatusCodeResponses == nil { + r.StatusCodeResponses = map[int]Response{} + } + r.StatusCodeResponses[nk] = statusCodeResp } - 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 index 37858ece90..4e9be8576b 100644 --- a/vendor/github.com/go-openapi/spec/schema.go +++ b/vendor/github.com/go-openapi/spec/schema.go @@ -17,7 +17,6 @@ package spec import ( "encoding/json" "fmt" - "net/url" "strings" "github.com/go-openapi/jsonpointer" @@ -145,7 +144,7 @@ func (r *SchemaURL) fromMap(v map[string]interface{}) error { } if vv, ok := v["$schema"]; ok { if str, ok := vv.(string); ok { - u, err := url.Parse(str) + u, err := parseURL(str) if err != nil { return err } @@ -158,41 +157,41 @@ func (r *SchemaURL) fromMap(v map[string]interface{}) error { // 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"` + 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 SchemaProperties `json:"properties,omitempty"` + AdditionalProperties *SchemaOrBool `json:"additionalProperties,omitempty"` + PatternProperties SchemaProperties `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) @@ -513,6 +512,56 @@ func (s *Schema) AsUnwrappedXML() *Schema { return s } +// SetValidations defines all schema validations. +// +// NOTE: Required, ReadOnly, AllOf, AnyOf, OneOf and Not are not considered. +func (s *Schema) SetValidations(val SchemaValidations) { + s.Maximum = val.Maximum + s.ExclusiveMaximum = val.ExclusiveMaximum + s.Minimum = val.Minimum + s.ExclusiveMinimum = val.ExclusiveMinimum + s.MaxLength = val.MaxLength + s.MinLength = val.MinLength + s.Pattern = val.Pattern + s.MaxItems = val.MaxItems + s.MinItems = val.MinItems + s.UniqueItems = val.UniqueItems + s.MultipleOf = val.MultipleOf + s.Enum = val.Enum + s.MinProperties = val.MinProperties + s.MaxProperties = val.MaxProperties + s.PatternProperties = val.PatternProperties +} + +// WithValidations is a fluent method to set schema validations +func (s *Schema) WithValidations(val SchemaValidations) *Schema { + s.SetValidations(val) + return s +} + +// Validations returns a clone of the validations for this schema +func (s Schema) Validations() SchemaValidations { + return SchemaValidations{ + CommonValidations: CommonValidations{ + Maximum: s.Maximum, + ExclusiveMaximum: s.ExclusiveMaximum, + Minimum: s.Minimum, + ExclusiveMinimum: s.ExclusiveMinimum, + MaxLength: s.MaxLength, + MinLength: s.MinLength, + Pattern: s.Pattern, + MaxItems: s.MaxItems, + MinItems: s.MinItems, + UniqueItems: s.UniqueItems, + MultipleOf: s.MultipleOf, + Enum: s.Enum, + }, + MinProperties: s.MinProperties, + MaxProperties: s.MaxProperties, + PatternProperties: s.PatternProperties, + } +} + // MarshalJSON marshal this to JSON func (s Schema) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(s.SchemaProps) diff --git a/vendor/github.com/go-openapi/spec/schema_loader.go b/vendor/github.com/go-openapi/spec/schema_loader.go index 02d9966c1a..0059b99aed 100644 --- a/vendor/github.com/go-openapi/spec/schema_loader.go +++ b/vendor/github.com/go-openapi/spec/schema_loader.go @@ -25,35 +25,50 @@ import ( "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 +// PathLoader is a function to use when loading remote refs. +// +// This is a package level default. It may be overridden or bypassed by +// specifying the loader in ExpandOptions. +// +// NOTE: if you are using the go-openapi/loads package, it will override +// this value with its own default (a loader to retrieve YAML documents as +// well as JSON ones). +var PathLoader = func(pth string) (json.RawMessage, error) { + data, err := swag.LoadFromFileOrHTTP(pth) + 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. + // circulars holds all visited circular references, to shortcircuit $ref resolution. + // // 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 + loadDoc func(string) (json.RawMessage, error) + rootID string } -func newResolverContext(originalBasePath string) *resolverContext { +func newResolverContext(options *ExpandOptions) *resolverContext { + expandOptions := optionsOrDefault(options) + + // path loader may be overridden by options + var loader func(string) (json.RawMessage, error) + if expandOptions.PathLoader == nil { + loader = PathLoader + } else { + loader = expandOptions.PathLoader + } + return &resolverContext{ circulars: make(map[string]bool), - basePath: originalBasePath, // keep the root base path in context + basePath: expandOptions.RelativeBase, // keep the root base path in context + loadDoc: loader, } } @@ -62,21 +77,20 @@ type schemaLoader struct { options *ExpandOptions cache ResolutionCache context *resolverContext - loadDoc func(string) (json.RawMessage, error) } -func (r *schemaLoader) transitiveResolver(basePath string, ref Ref) (*schemaLoader, error) { +func (r *schemaLoader) transitiveResolver(basePath string, ref Ref) *schemaLoader { if ref.IsRoot() || ref.HasFragmentOnly { - return r, nil + return r } - baseRef, _ := NewRef(basePath) - currentRef := normalizeFileRef(&ref, basePath) + baseRef := MustCreateRef(basePath) + currentRef := normalizeRef(&ref, basePath) if strings.HasPrefix(currentRef.String(), baseRef.String()) { - return r, nil + return r } - // Set a new root to resolve against + // set a new root against which to resolve rootURL := currentRef.GetURL() rootURL.Fragment = "" root, _ := r.cache.Get(rootURL.String()) @@ -85,35 +99,36 @@ func (r *schemaLoader) transitiveResolver(basePath string, ref Ref) (*schemaLoad // 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 normalizeBase(transitive.options.RelativeBase) } } + 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") + return ErrResolveRefNeedsAPointer } - refURL := ref.GetURL() - if refURL == nil { + if ref.GetURL() == nil { return nil } - var res interface{} - var data interface{} - var err error + var ( + res interface{} + data interface{} + 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 @@ -122,12 +137,11 @@ func (r *schemaLoader) resolveRef(ref *Ref, target interface{}, basePath string) 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()) + baseRef := normalizeRef(ref, basePath) data, _, _, err = r.load(baseRef.GetURL()) if err != nil { return err @@ -150,52 +164,53 @@ func (r *schemaLoader) load(refURL *url.URL) (interface{}, url.URL, bool, error) toFetch.Fragment = "" var err error - path := toFetch.String() - if path == rootBase { - path, err = absPath(rootBase) - if err != nil { - return nil, url.URL{}, false, err - } - } - normalized := normalizeAbsPath(path) + pth := toFetch.String() + normalized := normalizeBase(pth) + debugLog("loading doc from: %s", normalized) 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 fromCache { + return data, toFetch, fromCache, nil + } - if err := json.Unmarshal(b, &data); err != nil { - return nil, url.URL{}, false, err - } - r.cache.Set(normalized, data) + b, err := r.context.loadDoc(normalized) + if err != nil { + return nil, url.URL{}, false, err + } + + var doc interface{} + if err := json.Unmarshal(b, &doc); err != nil { + return nil, url.URL{}, false, err } + r.cache.Set(normalized, doc) - return data, toFetch, fromCache, nil + return doc, 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) + normalizedRef := normalizeURI(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) + foundCycle = swag.ContainsStrings(parentRefs, normalizedRef) // normalized windows url's are lower cased 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 +// 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 the ref is referring to holds nested refs, 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) } @@ -212,30 +227,32 @@ func (r *schemaLoader) deref(input interface{}, parentRefs []string, basePath st case *PathItem: ref = &refable.Ref default: - return fmt.Errorf("deref: unsupported type %T", input) + return fmt.Errorf("unsupported type: %T: %w", input, ErrDerefUnsupportedType) } curRef := ref.String() - if curRef != "" { - normalizedRef := normalizeFileRef(ref, basePath) - normalizedBasePath := normalizedRef.RemoteURI() + if curRef == "" { + return nil + } - if r.isCircular(normalizedRef, basePath, parentRefs...) { - return nil - } + normalizedRef := normalizeRef(ref, basePath) + normalizedBasePath := normalizedRef.RemoteURI() - if err := r.resolveRef(ref, input, basePath); r.shouldStopOnError(err) { - return err - } + if r.isCircular(normalizedRef, basePath, parentRefs...) { + return nil + } - // 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) - } + if err := r.resolveRef(ref, input, basePath); r.shouldStopOnError(err) { + return err + } + + if ref.String() == "" || ref.String() == curRef { + // done with rereferencing + return nil } - return nil + parentRefs = append(parentRefs, normalizedRef.String()) + return r.deref(input, parentRefs, normalizedBasePath) } func (r *schemaLoader) shouldStopOnError(err error) bool { @@ -250,30 +267,65 @@ func (r *schemaLoader) shouldStopOnError(err error) bool { return false } +func (r *schemaLoader) setSchemaID(target interface{}, id, basePath string) (string, string) { + debugLog("schema has ID: %s", id) + + // handling the case when id is a folder + // remember that basePath has to point to a file + var refPath string + if strings.HasSuffix(id, "/") { + // ensure this is detected as a file, not a folder + refPath = fmt.Sprintf("%s%s", id, "placeholder.json") + } else { + refPath = id + } + + // updates the current base path + // * important: ID can be a relative path + // * registers target to be fetchable from the new base proposed by this id + newBasePath := normalizeURI(refPath, basePath) + + // store found IDs for possible future reuse in $ref + r.cache.Set(newBasePath, target) + + // the root document has an ID: all $ref relative to that ID may + // be rebased relative to the root document + if basePath == r.context.basePath { + debugLog("root document is a schema with ID: %s (normalized as:%s)", id, newBasePath) + r.context.rootID = newBasePath + } + + return newBasePath, refPath +} + func defaultSchemaLoader( root interface{}, expandOptions *ExpandOptions, cache ResolutionCache, - context *resolverContext) (*schemaLoader, error) { + context *resolverContext) *schemaLoader { - if cache == nil { - cache = resCache - } if expandOptions == nil { expandOptions = &ExpandOptions{} } - absBase, _ := absPath(expandOptions.RelativeBase) + + cache = cacheOrDefault(cache) + + if expandOptions.RelativeBase == "" { + // if no relative base is provided, assume the root document + // contains all $ref, or at least, that the relative documents + // may be resolved from the current working directory. + expandOptions.RelativeBase = baseForRoot(root, cache) + } + debugLog("effective expander options: %#v", expandOptions) + if context == nil { - context = newResolverContext(absBase) + context = newResolverContext(expandOptions) } + 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/schemas/jsonschema-draft-04.json b/vendor/github.com/go-openapi/spec/schemas/jsonschema-draft-04.json new file mode 100644 index 0000000000..bcbb84743e --- /dev/null +++ b/vendor/github.com/go-openapi/spec/schemas/jsonschema-draft-04.json @@ -0,0 +1,149 @@ +{ + "id": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "positiveInteger": { + "type": "integer", + "minimum": 0 + }, + "positiveIntegerDefault0": { + "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ] + }, + "simpleTypes": { + "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "minItems": 1, + "uniqueItems": true + } + }, + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "$schema": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": {}, + "multipleOf": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { "$ref": "#/definitions/positiveInteger" }, + "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "anyOf": [ + { "type": "boolean" }, + { "$ref": "#" } + ], + "default": {} + }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": {} + }, + "maxItems": { "$ref": "#/definitions/positiveInteger" }, + "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { "$ref": "#/definitions/positiveInteger" }, + "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { + "anyOf": [ + { "type": "boolean" }, + { "$ref": "#" } + ], + "default": {} + }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { "type": "string" }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "dependencies": { + "exclusiveMaximum": [ "maximum" ], + "exclusiveMinimum": [ "minimum" ] + }, + "default": {} +} diff --git a/vendor/github.com/go-openapi/spec/schemas/v2/schema.json b/vendor/github.com/go-openapi/spec/schemas/v2/schema.json new file mode 100644 index 0000000000..ebe10ed32d --- /dev/null +++ b/vendor/github.com/go-openapi/spec/schemas/v2/schema.json @@ -0,0 +1,1607 @@ +{ + "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 responses" + }, + "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": { + "anyOf": [ + { + "$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" + } + } + } + } +} diff --git a/vendor/github.com/go-openapi/spec/security_scheme.go b/vendor/github.com/go-openapi/spec/security_scheme.go index fe353842a6..9d0bdae908 100644 --- a/vendor/github.com/go-openapi/spec/security_scheme.go +++ b/vendor/github.com/go-openapi/spec/security_scheme.go @@ -82,12 +82,12 @@ func OAuth2AccessToken(authorizationURL, tokenURL string) *SecurityScheme { 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 + Name string `json:"name,omitempty"` // api key + In string `json:"in,omitempty"` // api key + Flow string `json:"flow,omitempty"` // oauth2 + AuthorizationURL string `json:"authorizationUrl"` // oauth2 + TokenURL string `json:"tokenUrl,omitempty"` // oauth2 + Scopes map[string]string `json:"scopes,omitempty"` // oauth2 } // AddScope adds a scope to this security scheme @@ -120,10 +120,40 @@ func (s SecurityScheme) JSONLookup(token string) (interface{}, error) { // MarshalJSON marshal this to JSON func (s SecurityScheme) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(s.SecuritySchemeProps) + var ( + b1 []byte + err error + ) + + if s.Type == oauth2 && (s.Flow == "implicit" || s.Flow == "accessCode") { + // when oauth2 for implicit or accessCode flows, empty AuthorizationURL is added as empty string + b1, err = json.Marshal(s.SecuritySchemeProps) + } else { + // when not oauth2, empty AuthorizationURL should be omitted + b1, err = json.Marshal(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 + }{ + Description: s.Description, + Type: s.Type, + Name: s.Name, + In: s.In, + Flow: s.Flow, + AuthorizationURL: s.AuthorizationURL, + TokenURL: s.TokenURL, + Scopes: s.Scopes, + }) + } if err != nil { return nil, err } + b2, err := json.Marshal(s.VendorExtensible) if err != nil { return nil, err diff --git a/vendor/github.com/go-openapi/spec/spec.go b/vendor/github.com/go-openapi/spec/spec.go index 0bb045bc06..876aa12759 100644 --- a/vendor/github.com/go-openapi/spec/spec.go +++ b/vendor/github.com/go-openapi/spec/spec.go @@ -14,7 +14,9 @@ package spec -import "encoding/json" +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 @@ -24,20 +26,10 @@ import "encoding/json" 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 the url for the json 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() @@ -49,7 +41,7 @@ func MustLoadJSONSchemaDraft04() *Schema { // JSONSchemaDraft04 loads the json schema document for json shema draft04 func JSONSchemaDraft04() (*Schema, error) { - b, err := Asset("jsonschema-draft-04.json") + b, err := jsonschemaDraft04JSONBytes() if err != nil { return nil, err } @@ -73,7 +65,7 @@ func MustLoadSwagger20Schema() *Schema { // Swagger20Schema loads the swagger 2.0 schema from the embedded assets func Swagger20Schema() (*Schema, error) { - b, err := Asset("v2/schema.json") + b, err := v2SchemaJSONBytes() if err != nil { return nil, err } diff --git a/vendor/github.com/go-openapi/spec/swagger.go b/vendor/github.com/go-openapi/spec/swagger.go index 44722ffd5a..1590fd1751 100644 --- a/vendor/github.com/go-openapi/spec/swagger.go +++ b/vendor/github.com/go-openapi/spec/swagger.go @@ -253,7 +253,7 @@ func (s SchemaOrBool) MarshalJSON() ([]byte, error) { // 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 len(data) > 0 { if data[0] == '{' { var sch Schema if err := json.Unmarshal(data, &sch); err != nil { @@ -261,7 +261,7 @@ func (s *SchemaOrBool) UnmarshalJSON(data []byte) error { } nw.Schema = &sch } - nw.Allows = !(data[0] == 'f' && data[1] == 'a' && data[2] == 'l' && data[3] == 's' && data[4] == 'e') + nw.Allows = !bytes.Equal(data, []byte("false")) } *s = nw return nil 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 aa12b56f6e..0000000000 --- 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/url_go19.go b/vendor/github.com/go-openapi/spec/url_go19.go new file mode 100644 index 0000000000..5bdfe40bcc --- /dev/null +++ b/vendor/github.com/go-openapi/spec/url_go19.go @@ -0,0 +1,11 @@ +package spec + +import "net/url" + +func parseURL(s string) (*url.URL, error) { + u, err := url.Parse(s) + if err == nil { + u.OmitHost = false + } + return u, err +} diff --git a/vendor/github.com/go-openapi/spec/validations.go b/vendor/github.com/go-openapi/spec/validations.go new file mode 100644 index 0000000000..6360a8ea77 --- /dev/null +++ b/vendor/github.com/go-openapi/spec/validations.go @@ -0,0 +1,215 @@ +package spec + +// 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"` +} + +// SetValidations defines all validations for a simple schema. +// +// NOTE: the input is the larger set of validations available for schemas. +// For simple schemas, MinProperties and MaxProperties are ignored. +func (v *CommonValidations) SetValidations(val SchemaValidations) { + v.Maximum = val.Maximum + v.ExclusiveMaximum = val.ExclusiveMaximum + v.Minimum = val.Minimum + v.ExclusiveMinimum = val.ExclusiveMinimum + v.MaxLength = val.MaxLength + v.MinLength = val.MinLength + v.Pattern = val.Pattern + v.MaxItems = val.MaxItems + v.MinItems = val.MinItems + v.UniqueItems = val.UniqueItems + v.MultipleOf = val.MultipleOf + v.Enum = val.Enum +} + +type clearedValidation struct { + Validation string + Value interface{} +} + +type clearedValidations []clearedValidation + +func (c clearedValidations) apply(cbs []func(string, interface{})) { + for _, cb := range cbs { + for _, cleared := range c { + cb(cleared.Validation, cleared.Value) + } + } +} + +// ClearNumberValidations clears all number validations. +// +// Some callbacks may be set by the caller to capture changed values. +func (v *CommonValidations) ClearNumberValidations(cbs ...func(string, interface{})) { + done := make(clearedValidations, 0, 5) + defer func() { + done.apply(cbs) + }() + + if v.Minimum != nil { + done = append(done, clearedValidation{Validation: "minimum", Value: v.Minimum}) + v.Minimum = nil + } + if v.Maximum != nil { + done = append(done, clearedValidation{Validation: "maximum", Value: v.Maximum}) + v.Maximum = nil + } + if v.ExclusiveMaximum { + done = append(done, clearedValidation{Validation: "exclusiveMaximum", Value: v.ExclusiveMaximum}) + v.ExclusiveMaximum = false + } + if v.ExclusiveMinimum { + done = append(done, clearedValidation{Validation: "exclusiveMinimum", Value: v.ExclusiveMinimum}) + v.ExclusiveMinimum = false + } + if v.MultipleOf != nil { + done = append(done, clearedValidation{Validation: "multipleOf", Value: v.MultipleOf}) + v.MultipleOf = nil + } +} + +// ClearStringValidations clears all string validations. +// +// Some callbacks may be set by the caller to capture changed values. +func (v *CommonValidations) ClearStringValidations(cbs ...func(string, interface{})) { + done := make(clearedValidations, 0, 3) + defer func() { + done.apply(cbs) + }() + + if v.Pattern != "" { + done = append(done, clearedValidation{Validation: "pattern", Value: v.Pattern}) + v.Pattern = "" + } + if v.MinLength != nil { + done = append(done, clearedValidation{Validation: "minLength", Value: v.MinLength}) + v.MinLength = nil + } + if v.MaxLength != nil { + done = append(done, clearedValidation{Validation: "maxLength", Value: v.MaxLength}) + v.MaxLength = nil + } +} + +// ClearArrayValidations clears all array validations. +// +// Some callbacks may be set by the caller to capture changed values. +func (v *CommonValidations) ClearArrayValidations(cbs ...func(string, interface{})) { + done := make(clearedValidations, 0, 3) + defer func() { + done.apply(cbs) + }() + + if v.MaxItems != nil { + done = append(done, clearedValidation{Validation: "maxItems", Value: v.MaxItems}) + v.MaxItems = nil + } + if v.MinItems != nil { + done = append(done, clearedValidation{Validation: "minItems", Value: v.MinItems}) + v.MinItems = nil + } + if v.UniqueItems { + done = append(done, clearedValidation{Validation: "uniqueItems", Value: v.UniqueItems}) + v.UniqueItems = false + } +} + +// Validations returns a clone of the validations for a simple schema. +// +// NOTE: in the context of simple schema objects, MinProperties, MaxProperties +// and PatternProperties remain unset. +func (v CommonValidations) Validations() SchemaValidations { + return SchemaValidations{ + CommonValidations: v, + } +} + +// HasNumberValidations indicates if the validations are for numbers or integers +func (v CommonValidations) HasNumberValidations() bool { + return v.Maximum != nil || v.Minimum != nil || v.MultipleOf != nil +} + +// HasStringValidations indicates if the validations are for strings +func (v CommonValidations) HasStringValidations() bool { + return v.MaxLength != nil || v.MinLength != nil || v.Pattern != "" +} + +// HasArrayValidations indicates if the validations are for arrays +func (v CommonValidations) HasArrayValidations() bool { + return v.MaxItems != nil || v.MinItems != nil || v.UniqueItems +} + +// HasEnum indicates if the validation includes some enum constraint +func (v CommonValidations) HasEnum() bool { + return len(v.Enum) > 0 +} + +// SchemaValidations describes the validation properties of a schema +// +// NOTE: at this moment, this is not embedded in SchemaProps because this would induce a breaking change +// in the exported members: all initializers using litterals would fail. +type SchemaValidations struct { + CommonValidations + + PatternProperties SchemaProperties `json:"patternProperties,omitempty"` + MaxProperties *int64 `json:"maxProperties,omitempty"` + MinProperties *int64 `json:"minProperties,omitempty"` +} + +// HasObjectValidations indicates if the validations are for objects +func (v SchemaValidations) HasObjectValidations() bool { + return v.MaxProperties != nil || v.MinProperties != nil || v.PatternProperties != nil +} + +// SetValidations for schema validations +func (v *SchemaValidations) SetValidations(val SchemaValidations) { + v.CommonValidations.SetValidations(val) + v.PatternProperties = val.PatternProperties + v.MaxProperties = val.MaxProperties + v.MinProperties = val.MinProperties +} + +// Validations for a schema +func (v SchemaValidations) Validations() SchemaValidations { + val := v.CommonValidations.Validations() + val.PatternProperties = v.PatternProperties + val.MinProperties = v.MinProperties + val.MaxProperties = v.MaxProperties + return val +} + +// ClearObjectValidations returns a clone of the validations with all object validations cleared. +// +// Some callbacks may be set by the caller to capture changed values. +func (v *SchemaValidations) ClearObjectValidations(cbs ...func(string, interface{})) { + done := make(clearedValidations, 0, 3) + defer func() { + done.apply(cbs) + }() + + if v.MaxProperties != nil { + done = append(done, clearedValidation{Validation: "maxProperties", Value: v.MaxProperties}) + v.MaxProperties = nil + } + if v.MinProperties != nil { + done = append(done, clearedValidation{Validation: "minProperties", Value: v.MinProperties}) + v.MinProperties = nil + } + if v.PatternProperties != nil { + done = append(done, clearedValidation{Validation: "patternProperties", Value: v.PatternProperties}) + v.PatternProperties = nil + } +} diff --git a/vendor/github.com/go-openapi/strfmt/.gitattributes b/vendor/github.com/go-openapi/strfmt/.gitattributes new file mode 100644 index 0000000000..d020be8ea4 --- /dev/null +++ b/vendor/github.com/go-openapi/strfmt/.gitattributes @@ -0,0 +1,2 @@ +*.go text eol=lf + diff --git a/vendor/github.com/go-openapi/strfmt/.golangci.yml b/vendor/github.com/go-openapi/strfmt/.golangci.yml index 03ffa31a4e..22f8d21cca 100644 --- a/vendor/github.com/go-openapi/strfmt/.golangci.yml +++ b/vendor/github.com/go-openapi/strfmt/.golangci.yml @@ -4,33 +4,58 @@ linters-settings: golint: min-confidence: 0 gocyclo: - min-complexity: 31 + min-complexity: 45 maligned: suggest-new: true dupl: - threshold: 100 + threshold: 200 goconst: min-len: 2 - min-occurrences: 4 + min-occurrences: 3 linters: enable-all: true disable: - maligned + - unparam - lll - gochecknoinits - gochecknoglobals + - funlen - godox - gocognit - whitespace - wsl - - funlen - -issues: - exclude-rules: - - path: bson.go - text: "should be .*ObjectID" - linters: - - golint - - stylecheck - + - wrapcheck + - testpackage + - nlreturn + - gomnd + - exhaustivestruct + - goerr113 + - errorlint + - nestif + - godot + - gofumpt + - paralleltest + - tparallel + - thelper + - ifshort + - exhaustruct + - varnamelen + - gci + - depguard + - errchkjson + - inamedparam + - nonamedreturns + - musttag + - ireturn + - forcetypeassert + - cyclop + # deprecated linters + - deadcode + - interfacer + - scopelint + - varcheck + - structcheck + - golint + - nosnakecase diff --git a/vendor/github.com/go-openapi/strfmt/.travis.yml b/vendor/github.com/go-openapi/strfmt/.travis.yml deleted file mode 100644 index eb962aebcd..0000000000 --- a/vendor/github.com/go-openapi/strfmt/.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 -language: go -env: -- GO111MODULE=on -notifications: - slack: - secure: zE5AtIYTpYfQPnTzP+EaQPN7JKtfFAGv6PrJqoIZLOXa8B6zGb6+J1JRNNxWi7faWbyJOxa4FSSsuPsKZMycUK6wlLFIdhDxwqeo7Ew8r6rdZKdfUHQggfNS9wO79ARoNYUDHtmnaBUS+eWSM1YqSc4i99QxyyfuURLOeAaA/q14YbdlTlaw3lrZ0qT92ot1FnVGNOx064zuHtFeUf+jAVRMZ6Q3rvqllwIlPszE6rmHGXBt2VoJxRaBetdwd7FgkcYw9FPXKHhadwC7/75ZAdmxIukhxNMw4Tr5NuPcqNcnbYLenDP7B3lssGVIrP4BRSqekS1d/tqvdvnnFWHMwrNCkSnSc065G5+qWTlXKAemIclgiXXqE2furBNLm05MDdG8fn5epS0UNarkjD+zX336RiqwBlOX4KbF+vPyqcO98CsN0lnd+H6loc9reiTHs37orFFpQ+309av9be2GGsHUsRB9ssIyrewmhAccOmkRtr2dVTZJNFQwa5Kph5TNJuTjnZEwG/xUkEX2YSfwShOsb062JWiflV6PJdnl80pc9Tn7D5sO5Bf9DbijGRJwwP+YiiJtwtr+vsvS+n4sM0b5eqm4UoRo+JJO8ffoJtHS7ItuyRbVQCwEPJ4221WLcf5PquEEDdAPwR+K4Gj8qTXqTDdxOiES1xFUKVgmzhI= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/strfmt/README.md b/vendor/github.com/go-openapi/strfmt/README.md index b2645ce18a..f6b39c6c56 100644 --- a/vendor/github.com/go-openapi/strfmt/README.md +++ b/vendor/github.com/go-openapi/strfmt/README.md @@ -1,8 +1,7 @@ -# Strfmt [![Build Status](https://travis-ci.org/go-openapi/strfmt.svg?branch=master)](https://travis-ci.org/go-openapi/strfmt) [![codecov](https://codecov.io/gh/go-openapi/strfmt/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/strfmt) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - +# Strfmt [![Build Status](https://github.com/go-openapi/strfmt/actions/workflows/go-test.yml/badge.svg)](https://github.com/go-openapi/strfmt/actions?query=workflow%3A"go+test") [![codecov](https://codecov.io/gh/go-openapi/strfmt/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/strfmt) +[![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/strfmt/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/strfmt?status.svg)](http://godoc.org/github.com/go-openapi/strfmt) -[![GolangCI](https://golangci.com/badges/github.com/go-openapi/strfmt.svg)](https://golangci.com) [![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/strfmt)](https://goreportcard.com/report/github.com/go-openapi/strfmt) This package exposes a registry of data types to support string formats in the go-openapi toolkit. @@ -38,6 +37,7 @@ It also provides convenient extensions to go-openapi users. - ssn - uuid, uuid3, uuid4, uuid5 - cidr (e.g. "192.0.2.1/24", "2001:db8:a0b:12f0::1/32") + - ulid (e.g. "00000PP9HGSBSSDZ1JTEXBJ0PW", [spec](https://github.com/ulid/spec)) > NOTE: as the name stands for, this package is intended to support string formatting only. > It does not provide validation for numerical values with swagger format extension for JSON types "number" or @@ -84,3 +84,4 @@ List of defined types: - UUID3 - UUID4 - UUID5 +- [ULID](https://github.com/ulid/spec) diff --git a/vendor/github.com/go-openapi/strfmt/bson.go b/vendor/github.com/go-openapi/strfmt/bson.go index c149612218..cfa9a526fe 100644 --- a/vendor/github.com/go-openapi/strfmt/bson.go +++ b/vendor/github.com/go-openapi/strfmt/bson.go @@ -39,10 +39,10 @@ func IsBSONObjectID(str string) bool { // ObjectId represents a BSON object ID (alias to go.mongodb.org/mongo-driver/bson/primitive.ObjectID) // // swagger:strfmt bsonobjectid -type ObjectId bsonprim.ObjectID +type ObjectId bsonprim.ObjectID //nolint:revive,stylecheck // NewObjectId creates a ObjectId from a Hex String -func NewObjectId(hex string) ObjectId { +func NewObjectId(hex string) ObjectId { //nolint:revive,stylecheck oid, err := bsonprim.ObjectIDFromHex(hex) if err != nil { panic(err) @@ -95,7 +95,7 @@ func (id ObjectId) Value() (driver.Value, error) { } func (id ObjectId) String() string { - return bsonprim.ObjectID(id).String() + return bsonprim.ObjectID(id).Hex() } // MarshalJSON returns the ObjectId as JSON @@ -135,14 +135,14 @@ func (id *ObjectId) UnmarshalBSON(data []byte) error { // BSON document if the error is nil. func (id ObjectId) MarshalBSONValue() (bsontype.Type, []byte, error) { oid := bsonprim.ObjectID(id) - return bsontype.ObjectID, oid[:], nil + return bson.TypeObjectID, oid[:], nil } // UnmarshalBSONValue is an interface implemented by types that can unmarshal a // BSON value representation of themselves. The BSON bytes and type can be // assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it // wishes to retain the data after returning. -func (id *ObjectId) UnmarshalBSONValue(tpe bsontype.Type, data []byte) error { +func (id *ObjectId) UnmarshalBSONValue(_ bsontype.Type, data []byte) error { var oid bsonprim.ObjectID copy(oid[:], data) *id = ObjectId(oid) diff --git a/vendor/github.com/go-openapi/strfmt/date.go b/vendor/github.com/go-openapi/strfmt/date.go index 15029ffa2f..3c93381c7c 100644 --- a/vendor/github.com/go-openapi/strfmt/date.go +++ b/vendor/github.com/go-openapi/strfmt/date.go @@ -57,7 +57,7 @@ func (d *Date) UnmarshalText(text []byte) error { if len(text) == 0 { return nil } - dd, err := time.Parse(RFC3339FullDate, string(text)) + dd, err := time.ParseInLocation(RFC3339FullDate, string(text), DefaultTimeLocation) if err != nil { return err } @@ -107,7 +107,7 @@ func (d *Date) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &strdate); err != nil { return err } - tt, err := time.Parse(RFC3339FullDate, strdate) + tt, err := time.ParseInLocation(RFC3339FullDate, strdate, DefaultTimeLocation) if err != nil { return err } @@ -126,7 +126,7 @@ func (d *Date) UnmarshalBSON(data []byte) error { } if data, ok := m["data"].(string); ok { - rd, err := time.Parse(RFC3339FullDate, data) + rd, err := time.ParseInLocation(RFC3339FullDate, data, DefaultTimeLocation) if err != nil { return err } @@ -180,3 +180,8 @@ func (d *Date) UnmarshalBinary(data []byte) error { return nil } + +// Equal checks if two Date instances are equal +func (d Date) Equal(d2 Date) bool { + return time.Time(d).Equal(time.Time(d2)) +} diff --git a/vendor/github.com/go-openapi/strfmt/default.go b/vendor/github.com/go-openapi/strfmt/default.go index a89a4de3f3..2813714060 100644 --- a/vendor/github.com/go-openapi/strfmt/default.go +++ b/vendor/github.com/go-openapi/strfmt/default.go @@ -25,6 +25,7 @@ import ( "strings" "github.com/asaskevich/govalidator" + "github.com/google/uuid" "go.mongodb.org/mongo-driver/bson" ) @@ -57,24 +58,35 @@ const ( // - long top-level domain names (e.g. example.london) are permitted // - symbol unicode points are permitted (e.g. emoji) (not for top-level domain) HostnamePattern = `^([a-zA-Z0-9\p{S}\p{L}]((-?[a-zA-Z0-9\p{S}\p{L}]{0,62})?)|([a-zA-Z0-9\p{S}\p{L}](([a-zA-Z0-9-\p{S}\p{L}]{0,61}[a-zA-Z0-9\p{S}\p{L}])?)(\.)){1,}([a-zA-Z\p{L}]){2,63})$` + + // json null type + jsonNull = "null" +) + +const ( // UUIDPattern Regex for UUID that allows uppercase - UUIDPattern = `(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$` + // + // Deprecated: strfmt no longer uses regular expressions to validate UUIDs. + UUIDPattern = `(?i)(^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)|(^[0-9a-f]{32}$)` + // UUID3Pattern Regex for UUID3 that allows uppercase - UUID3Pattern = `(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?3[0-9a-f]{3}-?[0-9a-f]{4}-?[0-9a-f]{12}$` + // + // Deprecated: strfmt no longer uses regular expressions to validate UUIDs. + UUID3Pattern = `(?i)(^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$)|(^[0-9a-f]{12}3[0-9a-f]{3}?[0-9a-f]{16}$)` + // UUID4Pattern Regex for UUID4 that allows uppercase - UUID4Pattern = `(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?4[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$` + // + // Deprecated: strfmt no longer uses regular expressions to validate UUIDs. + UUID4Pattern = `(?i)(^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$)|(^[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15}$)` + // UUID5Pattern Regex for UUID5 that allows uppercase - UUID5Pattern = `(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?5[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$` - // json null type - jsonNull = "null" + // + // Deprecated: strfmt no longer uses regular expressions to validate UUIDs. + UUID5Pattern = `(?i)(^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$)|(^[0-9a-f]{12}5[0-9a-f]{3}[89ab][0-9a-f]{15}$)` ) var ( rxHostname = regexp.MustCompile(HostnamePattern) - rxUUID = regexp.MustCompile(UUIDPattern) - rxUUID3 = regexp.MustCompile(UUID3Pattern) - rxUUID4 = regexp.MustCompile(UUID4Pattern) - rxUUID5 = regexp.MustCompile(UUID5Pattern) ) // IsHostname returns true when the string is a valid hostname @@ -99,24 +111,28 @@ func IsHostname(str string) bool { return valid } -// IsUUID returns true is the string matches a UUID, upper case is allowed +// IsUUID returns true is the string matches a UUID (in any version, including v6 and v7), upper case is allowed func IsUUID(str string) bool { - return rxUUID.MatchString(str) + _, err := uuid.Parse(str) + return err == nil } -// IsUUID3 returns true is the string matches a UUID, upper case is allowed +// IsUUID3 returns true is the string matches a UUID v3, upper case is allowed func IsUUID3(str string) bool { - return rxUUID3.MatchString(str) + id, err := uuid.Parse(str) + return err == nil && id.Version() == uuid.Version(3) } -// IsUUID4 returns true is the string matches a UUID, upper case is allowed +// IsUUID4 returns true is the string matches a UUID v4, upper case is allowed func IsUUID4(str string) bool { - return rxUUID4.MatchString(str) + id, err := uuid.Parse(str) + return err == nil && id.Version() == uuid.Version(4) } -// IsUUID5 returns true is the string matches a UUID, upper case is allowed +// IsUUID5 returns true is the string matches a UUID v5, upper case is allowed func IsUUID5(str string) bool { - return rxUUID5.MatchString(str) + id, err := uuid.Parse(str) + return err == nil && id.Version() == uuid.Version(5) } // IsEmail validates an email address. diff --git a/vendor/github.com/go-openapi/strfmt/format.go b/vendor/github.com/go-openapi/strfmt/format.go index ca1cdf862e..888e107c38 100644 --- a/vendor/github.com/go-openapi/strfmt/format.go +++ b/vendor/github.com/go-openapi/strfmt/format.go @@ -16,6 +16,7 @@ package strfmt import ( "encoding" + stderrors "errors" "fmt" "reflect" "strings" @@ -65,7 +66,7 @@ type NameNormalizer func(string) string // DefaultNameNormalizer removes all dashes func DefaultNameNormalizer(name string) string { - return strings.Replace(name, "-", "", -1) + return strings.ReplaceAll(name, "-", "") } type defaultFormats struct { @@ -76,6 +77,7 @@ type defaultFormats struct { // NewFormats creates a new formats registry seeded with the values from the default func NewFormats() Registry { + //nolint:forcetypeassert return NewSeededFormats(Default.(*defaultFormats).data, nil) } @@ -94,72 +96,83 @@ func NewSeededFormats(seeds []knownFormat, normalizer NameNormalizer) Registry { // MapStructureHookFunc is a decode hook function for mapstructure func (f *defaultFormats) MapStructureHookFunc() mapstructure.DecodeHookFunc { - return func(from reflect.Type, to reflect.Type, data interface{}) (interface{}, error) { + return func(from reflect.Type, to reflect.Type, obj interface{}) (interface{}, error) { if from.Kind() != reflect.String { - return data, nil + return obj, nil } + data, ok := obj.(string) + if !ok { + return nil, fmt.Errorf("failed to cast %+v to string", obj) + } + for _, v := range f.data { tpe, _ := f.GetType(v.Name) if to == tpe { switch v.Name { case "date": - d, err := time.Parse(RFC3339FullDate, data.(string)) + d, err := time.ParseInLocation(RFC3339FullDate, data, DefaultTimeLocation) if err != nil { return nil, err } return Date(d), nil case "datetime": - input := data.(string) + input := data if len(input) == 0 { - return nil, fmt.Errorf("empty string is an invalid datetime format") + return nil, stderrors.New("empty string is an invalid datetime format") } return ParseDateTime(input) case "duration": - dur, err := ParseDuration(data.(string)) + dur, err := ParseDuration(data) if err != nil { return nil, err } return Duration(dur), nil case "uri": - return URI(data.(string)), nil + return URI(data), nil case "email": - return Email(data.(string)), nil + return Email(data), nil case "uuid": - return UUID(data.(string)), nil + return UUID(data), nil case "uuid3": - return UUID3(data.(string)), nil + return UUID3(data), nil case "uuid4": - return UUID4(data.(string)), nil + return UUID4(data), nil case "uuid5": - return UUID5(data.(string)), nil + return UUID5(data), nil case "hostname": - return Hostname(data.(string)), nil + return Hostname(data), nil case "ipv4": - return IPv4(data.(string)), nil + return IPv4(data), nil case "ipv6": - return IPv6(data.(string)), nil + return IPv6(data), nil case "cidr": - return CIDR(data.(string)), nil + return CIDR(data), nil case "mac": - return MAC(data.(string)), nil + return MAC(data), nil case "isbn": - return ISBN(data.(string)), nil + return ISBN(data), nil case "isbn10": - return ISBN10(data.(string)), nil + return ISBN10(data), nil case "isbn13": - return ISBN13(data.(string)), nil + return ISBN13(data), nil case "creditcard": - return CreditCard(data.(string)), nil + return CreditCard(data), nil case "ssn": - return SSN(data.(string)), nil + return SSN(data), nil case "hexcolor": - return HexColor(data.(string)), nil + return HexColor(data), nil case "rgbcolor": - return RGBColor(data.(string)), nil + return RGBColor(data), nil case "byte": - return Base64(data.(string)), nil + return Base64(data), nil case "password": - return Password(data.(string)), nil + return Password(data), nil + case "ulid": + ulid, err := ParseULID(data) + if err != nil { + return nil, err + } + return ulid, nil default: return nil, errors.InvalidTypeName(v.Name) } diff --git a/vendor/github.com/go-openapi/strfmt/time.go b/vendor/github.com/go-openapi/strfmt/time.go index 0b2f52d249..f08ba4da5d 100644 --- a/vendor/github.com/go-openapi/strfmt/time.go +++ b/vendor/github.com/go-openapi/strfmt/time.go @@ -18,6 +18,7 @@ import ( "database/sql/driver" "encoding/binary" "encoding/json" + "errors" "fmt" "regexp" "strings" @@ -28,6 +29,12 @@ import ( "go.mongodb.org/mongo-driver/bson/bsontype" ) +var ( + // UnixZero sets the zero unix timestamp we want to compare against. + // Unix 0 for an EST timezone is not equivalent to a UTC timezone. + UnixZero = time.Unix(0, 0).UTC() +) + func init() { dt := DateTime{} Default.Add("datetime", &dt, IsDateTime) @@ -55,23 +62,41 @@ func IsDateTime(str string) bool { const ( // RFC3339Millis represents a ISO8601 format to millis instead of to nanos RFC3339Millis = "2006-01-02T15:04:05.000Z07:00" + // RFC3339MillisNoColon represents a ISO8601 format to millis instead of to nanos + RFC3339MillisNoColon = "2006-01-02T15:04:05.000Z0700" // RFC3339Micro represents a ISO8601 format to micro instead of to nano RFC3339Micro = "2006-01-02T15:04:05.000000Z07:00" + // RFC3339MicroNoColon represents a ISO8601 format to micro instead of to nano + RFC3339MicroNoColon = "2006-01-02T15:04:05.000000Z0700" // ISO8601LocalTime represents a ISO8601 format to ISO8601 in local time (no timezone) ISO8601LocalTime = "2006-01-02T15:04:05" // ISO8601TimeWithReducedPrecision represents a ISO8601 format with reduced precision (dropped secs) ISO8601TimeWithReducedPrecision = "2006-01-02T15:04Z" - // ISO8601TimeWithReducedPrecision represents a ISO8601 format with reduced precision and no timezone (dropped seconds + no timezone) + // ISO8601TimeWithReducedPrecisionLocaltime represents a ISO8601 format with reduced precision and no timezone (dropped seconds + no timezone) ISO8601TimeWithReducedPrecisionLocaltime = "2006-01-02T15:04" + // ISO8601TimeUniversalSortableDateTimePattern represents a ISO8601 universal sortable date time pattern. + ISO8601TimeUniversalSortableDateTimePattern = "2006-01-02 15:04:05" + // short form of ISO8601TimeUniversalSortableDateTimePattern + ISO8601TimeUniversalSortableDateTimePatternShortForm = "2006-01-02" // DateTimePattern pattern to match for the date-time format from http://tools.ietf.org/html/rfc3339#section-5.6 DateTimePattern = `^([0-9]{2}):([0-9]{2}):([0-9]{2})(.[0-9]+)?(z|([+-][0-9]{2}:[0-9]{2}))$` ) var ( - dateTimeFormats = []string{RFC3339Micro, RFC3339Millis, time.RFC3339, time.RFC3339Nano, ISO8601LocalTime, ISO8601TimeWithReducedPrecision, ISO8601TimeWithReducedPrecisionLocaltime} - rxDateTime = regexp.MustCompile(DateTimePattern) + rxDateTime = regexp.MustCompile(DateTimePattern) + + // DateTimeFormats is the collection of formats used by ParseDateTime() + DateTimeFormats = []string{RFC3339Micro, RFC3339MicroNoColon, RFC3339Millis, RFC3339MillisNoColon, time.RFC3339, time.RFC3339Nano, ISO8601LocalTime, ISO8601TimeWithReducedPrecision, ISO8601TimeWithReducedPrecisionLocaltime, ISO8601TimeUniversalSortableDateTimePattern, ISO8601TimeUniversalSortableDateTimePatternShortForm} + // MarshalFormat sets the time resolution format used for marshaling time (set to milliseconds) MarshalFormat = RFC3339Millis + + // NormalizeTimeForMarshal provides a normalization function on time befeore marshalling (e.g. time.UTC). + // By default, the time value is not changed. + NormalizeTimeForMarshal = func(t time.Time) time.Time { return t } + + // DefaultTimeLocation provides a location for a time when the time zone is not encoded in the string (ex: ISO8601 Local variants). + DefaultTimeLocation = time.UTC ) // ParseDateTime parses a string that represents an ISO8601 time or a unix epoch @@ -80,8 +105,8 @@ func ParseDateTime(data string) (DateTime, error) { return NewDateTime(), nil } var lastError error - for _, layout := range dateTimeFormats { - dd, err := time.Parse(layout, data) + for _, layout := range DateTimeFormats { + dd, err := time.ParseInLocation(layout, data, DefaultTimeLocation) if err != nil { lastError = err continue @@ -106,7 +131,23 @@ func NewDateTime() DateTime { // String converts this time to a string func (t DateTime) String() string { - return time.Time(t).Format(MarshalFormat) + return NormalizeTimeForMarshal(time.Time(t)).Format(MarshalFormat) +} + +// IsZero returns whether the date time is a zero value +func (t *DateTime) IsZero() bool { + if t == nil { + return true + } + return time.Time(*t).IsZero() +} + +// IsUnixZerom returns whether the date time is equivalent to time.Unix(0, 0).UTC(). +func (t *DateTime) IsUnixZero() bool { + if t == nil { + return true + } + return time.Time(*t).Equal(UnixZero) } // MarshalText implements the text marshaller interface @@ -150,7 +191,7 @@ func (t DateTime) Value() (driver.Value, error) { // MarshalJSON returns the DateTime as JSON func (t DateTime) MarshalJSON() ([]byte, error) { - return json.Marshal(time.Time(t).Format(MarshalFormat)) + return json.Marshal(NormalizeTimeForMarshal(time.Time(t)).Format(MarshalFormat)) } // UnmarshalJSON sets the DateTime from JSON @@ -197,13 +238,16 @@ func (t *DateTime) UnmarshalBSON(data []byte) error { // Marshals a DateTime as a bsontype.DateTime, an int64 representing // milliseconds since epoch. func (t DateTime) MarshalBSONValue() (bsontype.Type, []byte, error) { - // UnixNano cannot be used, the result of calling UnixNano on the zero - // Time is undefined. - i64 := time.Time(t).Unix() * 1000 + // UnixNano cannot be used directly, the result of calling UnixNano on the zero + // Time is undefined. Thats why we use time.Nanosecond() instead. + + tNorm := NormalizeTimeForMarshal(time.Time(t)) + i64 := tNorm.Unix()*1000 + int64(tNorm.Nanosecond())/1e6 + buf := make([]byte, 8) binary.LittleEndian.PutUint64(buf, uint64(i64)) - return bsontype.DateTime, buf, nil + return bson.TypeDateTime, buf, nil } // UnmarshalBSONValue is an interface implemented by types that can unmarshal a @@ -211,6 +255,15 @@ func (t DateTime) MarshalBSONValue() (bsontype.Type, []byte, error) { // assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it // wishes to retain the data after returning. func (t *DateTime) UnmarshalBSONValue(tpe bsontype.Type, data []byte) error { + if tpe == bson.TypeNull { + *t = DateTime{} + return nil + } + + if len(data) != 8 { + return errors.New("bson date field length not exactly 8 bytes") + } + i64 := int64(binary.LittleEndian.Uint64(data)) // TODO: Use bsonprim.DateTime.Time() method *t = DateTime(time.Unix(i64/1000, i64%1000*1000000)) @@ -245,7 +298,7 @@ func (t *DateTime) GobDecode(data []byte) error { // MarshalBinary implements the encoding.BinaryMarshaler interface. func (t DateTime) MarshalBinary() ([]byte, error) { - return time.Time(t).MarshalBinary() + return NormalizeTimeForMarshal(time.Time(t)).MarshalBinary() } // UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. @@ -261,3 +314,8 @@ func (t *DateTime) UnmarshalBinary(data []byte) error { return nil } + +// Equal checks if two DateTime instances are equal using time.Time's Equal method +func (t DateTime) Equal(t2 DateTime) bool { + return time.Time(t).Equal(time.Time(t2)) +} diff --git a/vendor/github.com/go-openapi/strfmt/ulid.go b/vendor/github.com/go-openapi/strfmt/ulid.go new file mode 100644 index 0000000000..e71aff7c36 --- /dev/null +++ b/vendor/github.com/go-openapi/strfmt/ulid.go @@ -0,0 +1,230 @@ +package strfmt + +import ( + cryptorand "crypto/rand" + "database/sql/driver" + "encoding/json" + "errors" + "fmt" + "io" + "sync" + + "github.com/oklog/ulid" + "go.mongodb.org/mongo-driver/bson" +) + +// ULID represents a ulid string format +// ref: +// +// https://github.com/ulid/spec +// +// impl: +// +// https://github.com/oklog/ulid +// +// swagger:strfmt ulid +type ULID struct { + ulid.ULID +} + +var ( + ulidEntropyPool = sync.Pool{ + New: func() interface{} { + return cryptorand.Reader + }, + } + + ULIDScanDefaultFunc = func(raw interface{}) (ULID, error) { + u := NewULIDZero() + switch x := raw.(type) { + case nil: + // zerp ulid + return u, nil + case string: + if x == "" { + // zero ulid + return u, nil + } + return u, u.UnmarshalText([]byte(x)) + case []byte: + return u, u.UnmarshalText(x) + } + + return u, fmt.Errorf("cannot sql.Scan() strfmt.ULID from: %#v: %w", raw, ulid.ErrScanValue) + } + + // ULIDScanOverrideFunc allows you to override the Scan method of the ULID type + ULIDScanOverrideFunc = ULIDScanDefaultFunc + + ULIDValueDefaultFunc = func(u ULID) (driver.Value, error) { + return driver.Value(u.String()), nil + } + + // ULIDValueOverrideFunc allows you to override the Value method of the ULID type + ULIDValueOverrideFunc = ULIDValueDefaultFunc +) + +func init() { + // register formats in the default registry: + // - ulid + ulid := ULID{} + Default.Add("ulid", &ulid, IsULID) +} + +// IsULID checks if provided string is ULID format +// Be noticed that this function considers overflowed ULID as non-ulid. +// For more details see https://github.com/ulid/spec +func IsULID(str string) bool { + _, err := ulid.ParseStrict(str) + return err == nil +} + +// ParseULID parses a string that represents an valid ULID +func ParseULID(str string) (ULID, error) { + var u ULID + + return u, u.UnmarshalText([]byte(str)) +} + +// NewULIDZero returns a zero valued ULID type +func NewULIDZero() ULID { + return ULID{} +} + +// NewULID generates new unique ULID value and a error if any +func NewULID() (ULID, error) { + var u ULID + + obj := ulidEntropyPool.Get() + entropy, ok := obj.(io.Reader) + if !ok { + return u, fmt.Errorf("failed to cast %+v to io.Reader", obj) + } + + id, err := ulid.New(ulid.Now(), entropy) + if err != nil { + return u, err + } + ulidEntropyPool.Put(entropy) + + u.ULID = id + return u, nil +} + +// GetULID returns underlying instance of ULID +func (u *ULID) GetULID() interface{} { + return u.ULID +} + +// MarshalText returns this instance into text +func (u ULID) MarshalText() ([]byte, error) { + return u.ULID.MarshalText() +} + +// UnmarshalText hydrates this instance from text +func (u *ULID) UnmarshalText(data []byte) error { // validation is performed later on + return u.ULID.UnmarshalText(data) +} + +// Scan reads a value from a database driver +func (u *ULID) Scan(raw interface{}) error { + ul, err := ULIDScanOverrideFunc(raw) + if err == nil { + *u = ul + } + return err +} + +// Value converts a value to a database driver value +func (u ULID) Value() (driver.Value, error) { + return ULIDValueOverrideFunc(u) +} + +func (u ULID) String() string { + return u.ULID.String() +} + +// MarshalJSON returns the ULID as JSON +func (u ULID) MarshalJSON() ([]byte, error) { + return json.Marshal(u.String()) +} + +// UnmarshalJSON sets the ULID from JSON +func (u *ULID) UnmarshalJSON(data []byte) error { + if string(data) == jsonNull { + return nil + } + var ustr string + if err := json.Unmarshal(data, &ustr); err != nil { + return err + } + id, err := ulid.ParseStrict(ustr) + if err != nil { + return fmt.Errorf("couldn't parse JSON value as ULID: %w", err) + } + u.ULID = id + return nil +} + +// MarshalBSON document from this value +func (u ULID) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *ULID) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + id, err := ulid.ParseStrict(ud) + if err != nil { + return fmt.Errorf("couldn't parse bson bytes as ULID: %w", err) + } + u.ULID = id + return nil + } + return errors.New("couldn't unmarshal bson bytes as ULID") +} + +// DeepCopyInto copies the receiver and writes its value into out. +func (u *ULID) DeepCopyInto(out *ULID) { + *out = *u +} + +// DeepCopy copies the receiver into a new ULID. +func (u *ULID) DeepCopy() *ULID { + if u == nil { + return nil + } + out := new(ULID) + u.DeepCopyInto(out) + return out +} + +// GobEncode implements the gob.GobEncoder interface. +func (u ULID) GobEncode() ([]byte, error) { + return u.ULID.MarshalBinary() +} + +// GobDecode implements the gob.GobDecoder interface. +func (u *ULID) GobDecode(data []byte) error { + return u.ULID.UnmarshalBinary(data) +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface. +func (u ULID) MarshalBinary() ([]byte, error) { + return u.ULID.MarshalBinary() +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. +func (u *ULID) UnmarshalBinary(data []byte) error { + return u.ULID.UnmarshalBinary(data) +} + +// Equal checks if two ULID instances are equal by their underlying type +func (u ULID) Equal(other ULID) bool { + return u.ULID == other.ULID +} diff --git a/vendor/github.com/go-openapi/swag/.gitattributes b/vendor/github.com/go-openapi/swag/.gitattributes new file mode 100644 index 0000000000..49ad52766a --- /dev/null +++ b/vendor/github.com/go-openapi/swag/.gitattributes @@ -0,0 +1,2 @@ +# gofmt always uses LF, whereas Git uses CRLF on Windows. +*.go text eol=lf diff --git a/vendor/github.com/go-openapi/swag/.gitignore b/vendor/github.com/go-openapi/swag/.gitignore index d69b53accc..c4b1b64f04 100644 --- a/vendor/github.com/go-openapi/swag/.gitignore +++ b/vendor/github.com/go-openapi/swag/.gitignore @@ -2,3 +2,4 @@ secrets.yml vendor Godeps .idea +*.out diff --git a/vendor/github.com/go-openapi/swag/.golangci.yml b/vendor/github.com/go-openapi/swag/.golangci.yml index 625c3d6aff..80e2be0042 100644 --- a/vendor/github.com/go-openapi/swag/.golangci.yml +++ b/vendor/github.com/go-openapi/swag/.golangci.yml @@ -4,14 +4,14 @@ linters-settings: golint: min-confidence: 0 gocyclo: - min-complexity: 25 + min-complexity: 45 maligned: suggest-new: true dupl: - threshold: 100 + threshold: 200 goconst: min-len: 3 - min-occurrences: 2 + min-occurrences: 3 linters: enable-all: true @@ -20,3 +20,41 @@ linters: - lll - gochecknoinits - gochecknoglobals + - funlen + - godox + - gocognit + - whitespace + - wsl + - wrapcheck + - testpackage + - nlreturn + - gomnd + - exhaustivestruct + - goerr113 + - errorlint + - nestif + - godot + - gofumpt + - paralleltest + - tparallel + - thelper + - ifshort + - exhaustruct + - varnamelen + - gci + - depguard + - errchkjson + - inamedparam + - nonamedreturns + - musttag + - ireturn + - forcetypeassert + - cyclop + # deprecated linters + - deadcode + - interfacer + - scopelint + - varcheck + - structcheck + - golint + - nosnakecase 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 f1a3f80b35..0000000000 --- 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/BENCHMARK.md b/vendor/github.com/go-openapi/swag/BENCHMARK.md new file mode 100644 index 0000000000..e7f28ed6b7 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/BENCHMARK.md @@ -0,0 +1,52 @@ +# Benchmarks + +## Name mangling utilities + +```bash +go test -bench XXX -run XXX -benchtime 30s +``` + +### Benchmarks at b3e7a5386f996177e4808f11acb2aa93a0f660df + +``` +goos: linux +goarch: amd64 +pkg: github.com/go-openapi/swag +cpu: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz +BenchmarkToXXXName/ToGoName-4 862623 44101 ns/op 10450 B/op 732 allocs/op +BenchmarkToXXXName/ToVarName-4 853656 40728 ns/op 10468 B/op 734 allocs/op +BenchmarkToXXXName/ToFileName-4 1268312 27813 ns/op 9785 B/op 617 allocs/op +BenchmarkToXXXName/ToCommandName-4 1276322 27903 ns/op 9785 B/op 617 allocs/op +BenchmarkToXXXName/ToHumanNameLower-4 895334 40354 ns/op 10472 B/op 731 allocs/op +BenchmarkToXXXName/ToHumanNameTitle-4 882441 40678 ns/op 10566 B/op 749 allocs/op +``` + +### Benchmarks after PR #79 + +~ x10 performance improvement and ~ /100 memory allocations. + +``` +goos: linux +goarch: amd64 +pkg: github.com/go-openapi/swag +cpu: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz +BenchmarkToXXXName/ToGoName-4 9595830 3991 ns/op 42 B/op 5 allocs/op +BenchmarkToXXXName/ToVarName-4 9194276 3984 ns/op 62 B/op 7 allocs/op +BenchmarkToXXXName/ToFileName-4 17002711 2123 ns/op 147 B/op 7 allocs/op +BenchmarkToXXXName/ToCommandName-4 16772926 2111 ns/op 147 B/op 7 allocs/op +BenchmarkToXXXName/ToHumanNameLower-4 9788331 3749 ns/op 92 B/op 6 allocs/op +BenchmarkToXXXName/ToHumanNameTitle-4 9188260 3941 ns/op 104 B/op 6 allocs/op +``` + +``` +goos: linux +goarch: amd64 +pkg: github.com/go-openapi/swag +cpu: AMD Ryzen 7 5800X 8-Core Processor +BenchmarkToXXXName/ToGoName-16 18527378 1972 ns/op 42 B/op 5 allocs/op +BenchmarkToXXXName/ToVarName-16 15552692 2093 ns/op 62 B/op 7 allocs/op +BenchmarkToXXXName/ToFileName-16 32161176 1117 ns/op 147 B/op 7 allocs/op +BenchmarkToXXXName/ToCommandName-16 32256634 1137 ns/op 147 B/op 7 allocs/op +BenchmarkToXXXName/ToHumanNameLower-16 18599661 1946 ns/op 92 B/op 6 allocs/op +BenchmarkToXXXName/ToHumanNameTitle-16 17581353 2054 ns/op 105 B/op 6 allocs/op +``` diff --git a/vendor/github.com/go-openapi/swag/README.md b/vendor/github.com/go-openapi/swag/README.md index eb60ae80ab..a729222998 100644 --- a/vendor/github.com/go-openapi/swag/README.md +++ b/vendor/github.com/go-openapi/swag/README.md @@ -1,8 +1,8 @@ -# 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) +# Swag [![Build Status](https://github.com/go-openapi/swag/actions/workflows/go-test.yml/badge.svg)](https://github.com/go-openapi/swag/actions?query=workflow%3A"go+test") [![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 Reference](https://pkg.go.dev/badge/github.com/go-openapi/swag.svg)](https://pkg.go.dev/github.com/go-openapi/swag) [![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. @@ -19,4 +19,5 @@ You may also use it standalone for your projects. This repo has only few dependencies outside of the standard library: -* YAML utilities depend on gopkg.in/yaml.v2 +* YAML utilities depend on `gopkg.in/yaml.v3` +* `github.com/mailru/easyjson v0.7.7` diff --git a/vendor/github.com/go-openapi/swag/doc.go b/vendor/github.com/go-openapi/swag/doc.go index 8d2c8c5014..55094cb74c 100644 --- a/vendor/github.com/go-openapi/swag/doc.go +++ b/vendor/github.com/go-openapi/swag/doc.go @@ -17,16 +17,15 @@ Package swag contains a bunch of helper functions for go-openapi and go-swagger 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 - + - 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 + - YAML utilities depend on gopkg.in/yaml.v2 */ package swag diff --git a/vendor/github.com/go-openapi/swag/file.go b/vendor/github.com/go-openapi/swag/file.go new file mode 100644 index 0000000000..16accc55f8 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/file.go @@ -0,0 +1,33 @@ +// 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 "mime/multipart" + +// File represents an uploaded file. +type File struct { + Data multipart.File + Header *multipart.FileHeader +} + +// Read bytes from the file +func (f *File) Read(p []byte) (n int, err error) { + return f.Data.Read(p) +} + +// Close the file +func (f *File) Close() error { + return f.Data.Close() +} diff --git a/vendor/github.com/go-openapi/swag/initialism_index.go b/vendor/github.com/go-openapi/swag/initialism_index.go new file mode 100644 index 0000000000..20a359bb60 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/initialism_index.go @@ -0,0 +1,202 @@ +// 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 ( + "sort" + "strings" + "sync" +) + +var ( + // commonInitialisms are common acronyms that are kept as whole uppercased words. + commonInitialisms *indexOfInitialisms + + // initialisms is a slice of sorted initialisms + initialisms []string + + // a copy of initialisms pre-baked as []rune + initialismsRunes [][]rune + initialismsUpperCased [][]rune + + isInitialism func(string) bool + + maxAllocMatches int +) + +func init() { + // Taken from https://github.com/golang/lint/blob/3390df4df2787994aea98de825b964ac7944b817/lint.go#L732-L769 + 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() + initialismsRunes = asRunes(initialisms) + initialismsUpperCased = asUpperCased(initialisms) + maxAllocMatches = maxAllocHeuristic(initialismsRunes) + + // a test function + isInitialism = commonInitialisms.isInitialism +} + +func asRunes(in []string) [][]rune { + out := make([][]rune, len(in)) + for i, initialism := range in { + out[i] = []rune(initialism) + } + + return out +} + +func asUpperCased(in []string) [][]rune { + out := make([][]rune, len(in)) + + for i, initialism := range in { + out[i] = []rune(upper(trim(initialism))) + } + + return out +} + +func maxAllocHeuristic(in [][]rune) int { + heuristic := make(map[rune]int) + for _, initialism := range in { + heuristic[initialism[0]]++ + } + + var maxAlloc int + for _, val := range heuristic { + if val > maxAlloc { + maxAlloc = val + } + } + + return maxAlloc +} + +// 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() + initialismsRunes = asRunes(initialisms) + initialismsUpperCased = asUpperCased(initialisms) +} + +// 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, _ interface{}) bool { + k := key.(string) + result = append(result, k) + return true + }) + sort.Sort(sort.Reverse(byInitialism(result))) + return +} + +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 +} diff --git a/vendor/github.com/go-openapi/swag/loading.go b/vendor/github.com/go-openapi/swag/loading.go index 04160b89ba..783442fddf 100644 --- a/vendor/github.com/go-openapi/swag/loading.go +++ b/vendor/github.com/go-openapi/swag/loading.go @@ -16,10 +16,14 @@ package swag import ( "fmt" - "io/ioutil" + "io" "log" "net/http" + "net/url" + "os" + "path" "path/filepath" + "runtime" "strings" "time" ) @@ -37,26 +41,100 @@ var LoadHTTPBasicAuthPassword = "" var LoadHTTPCustomHeaders = map[string]string{} // 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) +func LoadFromFileOrHTTP(pth string) ([]byte, error) { + return LoadStrategy(pth, os.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(pth) } // 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) +func LoadFromFileOrHTTPWithTimeout(pth string, timeout time.Duration) ([]byte, error) { + return LoadStrategy(pth, os.ReadFile, loadHTTPBytes(timeout))(pth) } -// 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") { +// LoadStrategy returns a loader function for a given path or URI. +// +// The load strategy returns the remote load for any path starting with `http`. +// So this works for any URI with a scheme `http` or `https`. +// +// The fallback strategy is to call the local loader. +// +// The local loader takes a local file system path (absolute or relative) as argument, +// or alternatively a `file://...` URI, **without host** (see also below for windows). +// +// There are a few liberalities, initially intended to be tolerant regarding the URI syntax, +// especially on windows. +// +// Before the local loader is called, the given path is transformed: +// - percent-encoded characters are unescaped +// - simple paths (e.g. `./folder/file`) are passed as-is +// - on windows, occurrences of `/` are replaced by `\`, so providing a relative path such a `folder/file` works too. +// +// For paths provided as URIs with the "file" scheme, please note that: +// - `file://` is simply stripped. +// This means that the host part of the URI is not parsed at all. +// For example, `file:///folder/file" becomes "/folder/file`, +// but `file://localhost/folder/file` becomes `localhost/folder/file` on unix systems. +// Similarly, `file://./folder/file` yields `./folder/file`. +// - on windows, `file://...` can take a host so as to specify an UNC share location. +// +// Reminder about windows-specifics: +// - `file://host/folder/file` becomes an UNC path like `\\host\folder\file` (no port specification is supported) +// - `file:///c:/folder/file` becomes `C:\folder\file` +// - `file://c:/folder/file` is tolerated (without leading `/`) and becomes `c:\folder\file` +func LoadStrategy(pth string, local, remote func(string) ([]byte, error)) func(string) ([]byte, error) { + if strings.HasPrefix(pth, "http") { return remote } - return func(pth string) ([]byte, error) { - upth, err := pathUnescape(pth) + + return func(p string) ([]byte, error) { + upth, err := url.PathUnescape(p) + if err != nil { + return nil, err + } + + if !strings.HasPrefix(p, `file://`) { + // regular file path provided: just normalize slashes + return local(filepath.FromSlash(upth)) + } + + if runtime.GOOS != "windows" { + // crude processing: this leaves full URIs with a host with a (mostly) unexpected result + upth = strings.TrimPrefix(upth, `file://`) + + return local(filepath.FromSlash(upth)) + } + + // windows-only pre-processing of file://... URIs + + // support for canonical file URIs on windows. + u, err := url.Parse(filepath.ToSlash(upth)) if err != nil { return nil, err } + + if u.Host != "" { + // assume UNC name (volume share) + // NOTE: UNC port not yet supported + + // when the "host" segment is a drive letter: + // file://C:/folder/... => C:\folder + upth = path.Clean(strings.Join([]string{u.Host, u.Path}, `/`)) + if !strings.HasSuffix(u.Host, ":") && u.Host[0] != '.' { + // tolerance: if we have a leading dot, this can't be a host + // file://host/share/folder\... ==> \\host\share\path\folder + upth = "//" + upth + } + } else { + // no host, let's figure out if this is a drive letter + upth = strings.TrimPrefix(upth, `file://`) + first, _, _ := strings.Cut(strings.TrimPrefix(u.Path, "/"), "/") + if strings.HasSuffix(first, ":") { + // drive letter in the first segment: + // file:///c:/folder/... ==> strip the leading slash + upth = strings.TrimPrefix(upth, `/`) + } + } + return local(filepath.FromSlash(upth)) } } @@ -64,7 +142,7 @@ func LoadStrategy(path string, local, remote func(string) ([]byte, error)) func( 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) + req, err := http.NewRequest(http.MethodGet, path, nil) //nolint:noctx if err != nil { return nil, err } @@ -93,6 +171,6 @@ func loadHTTPBytes(timeout time.Duration) func(path string) ([]byte, error) { return nil, fmt.Errorf("could not access document at %q [%s] ", path, resp.Status) } - return ioutil.ReadAll(resp.Body) + return io.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 index aa7f6a9bb8..8bb64ac32f 100644 --- a/vendor/github.com/go-openapi/swag/name_lexem.go +++ b/vendor/github.com/go-openapi/swag/name_lexem.go @@ -14,74 +14,80 @@ package swag -import "unicode" +import ( + "unicode" + "unicode/utf8" +) type ( - nameLexem interface { - GetUnsafeGoName() string - GetOriginal() string - IsInitialism() bool - } + lexemKind uint8 - initialismNameLexem struct { + nameLexem struct { original string matchedInitialism string + kind lexemKind } +) - casualNameLexem struct { - original string - } +const ( + lexemKindCasualName lexemKind = iota + lexemKindInitialismName ) -func newInitialismNameLexem(original, matchedInitialism string) *initialismNameLexem { - return &initialismNameLexem{ +func newInitialismNameLexem(original, matchedInitialism string) nameLexem { + return nameLexem{ + kind: lexemKindInitialismName, original: original, matchedInitialism: matchedInitialism, } } -func newCasualNameLexem(original string) *casualNameLexem { - return &casualNameLexem{ +func newCasualNameLexem(original string) nameLexem { + return nameLexem{ + kind: lexemKindCasualName, original: original, } } -func (l *initialismNameLexem) GetUnsafeGoName() string { - return l.matchedInitialism -} +func (l nameLexem) GetUnsafeGoName() string { + if l.kind == lexemKindInitialismName { + return l.matchedInitialism + } + + var ( + first rune + rest string + ) -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) + b := poolOfBuffers.BorrowBuffer(utf8.UTFMax + len(rest)) + defer func() { + poolOfBuffers.RedeemBuffer(b) + }() + b.WriteRune(unicode.ToUpper(first)) + b.WriteString(lower(rest)) + return b.String() } return l.original } -func (l *initialismNameLexem) GetOriginal() string { +func (l nameLexem) 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 +func (l nameLexem) IsInitialism() bool { + return l.kind == lexemKindInitialismName } 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 c2e686d313..0000000000 --- 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 eb2f2d8bc7..0000000000 --- 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 6607f33935..0000000000 --- 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 4bae187d1e..0000000000 --- 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 index a1825fb7dc..274727a866 100644 --- a/vendor/github.com/go-openapi/swag/split.go +++ b/vendor/github.com/go-openapi/swag/split.go @@ -15,124 +15,269 @@ package swag import ( + "bytes" + "sync" "unicode" + "unicode/utf8" ) -var nameReplaceTable = map[rune]string{ - '@': "At ", - '&': "And ", - '|': "Pipe ", - '$': "Dollar ", - '!': "Bang ", - '-': "", - '_': "", -} - type ( splitter struct { - postSplitInitialismCheck bool initialisms []string + initialismsRunes [][]rune + initialismsUpperCased [][]rune // initialisms cached in their trimmed, upper-cased version + postSplitInitialismCheck bool + } + + splitterOption func(*splitter) + + initialismMatch struct { + body []rune + start, end int + complete bool + } + initialismMatches []initialismMatch +) + +type ( + // memory pools of temporary objects. + // + // These are used to recycle temporarily allocated objects + // and relieve the GC from undue pressure. + + matchesPool struct { + *sync.Pool } - splitterOption func(*splitter) *splitter + buffersPool struct { + *sync.Pool + } + + lexemsPool struct { + *sync.Pool + } + + splittersPool struct { + *sync.Pool + } ) -// split calls the splitter; splitter provides more control and post options +var ( + // poolOfMatches holds temporary slices for recycling during the initialism match process + poolOfMatches = matchesPool{ + Pool: &sync.Pool{ + New: func() any { + s := make(initialismMatches, 0, maxAllocMatches) + + return &s + }, + }, + } + + poolOfBuffers = buffersPool{ + Pool: &sync.Pool{ + New: func() any { + return new(bytes.Buffer) + }, + }, + } + + poolOfLexems = lexemsPool{ + Pool: &sync.Pool{ + New: func() any { + s := make([]nameLexem, 0, maxAllocMatches) + + return &s + }, + }, + } + + poolOfSplitters = splittersPool{ + Pool: &sync.Pool{ + New: func() any { + s := newSplitter() + + return &s + }, + }, + } +) + +// nameReplaceTable finds a word representation for special characters. +func nameReplaceTable(r rune) (string, bool) { + switch r { + case '@': + return "At ", true + case '&': + return "And ", true + case '|': + return "Pipe ", true + case '$': + return "Dollar ", true + case '!': + return "Bang ", true + case '-': + return "", true + case '_': + return "", true + default: + return "", false + } +} + +// split calls the splitter. +// +// Use newSplitter for more control and options func split(str string) []string { - lexems := newSplitter().split(str) - result := make([]string, 0, len(lexems)) + s := poolOfSplitters.BorrowSplitter() + lexems := s.split(str) + result := make([]string, 0, len(*lexems)) - for _, lexem := range lexems { + for _, lexem := range *lexems { result = append(result, lexem.GetOriginal()) } + poolOfLexems.RedeemLexems(lexems) + poolOfSplitters.RedeemSplitter(s) return result } -func (s *splitter) split(str string) []nameLexem { - return s.toNameLexems(str) -} - -func newSplitter(options ...splitterOption) *splitter { - splitter := &splitter{ +func newSplitter(options ...splitterOption) splitter { + s := splitter{ postSplitInitialismCheck: false, initialisms: initialisms, + initialismsRunes: initialismsRunes, + initialismsUpperCased: initialismsUpperCased, } for _, option := range options { - splitter = option(splitter) + option(&s) } - return splitter + return s } // withPostSplitInitialismCheck allows to catch initialisms after main split process -func withPostSplitInitialismCheck(s *splitter) *splitter { +func withPostSplitInitialismCheck(s *splitter) { s.postSplitInitialismCheck = true +} + +func (p matchesPool) BorrowMatches() *initialismMatches { + s := p.Get().(*initialismMatches) + *s = (*s)[:0] // reset slice, keep allocated capacity + return s } -type ( - initialismMatch struct { - start, end int - body []rune - complete bool +func (p buffersPool) BorrowBuffer(size int) *bytes.Buffer { + s := p.Get().(*bytes.Buffer) + s.Reset() + + if s.Cap() < size { + s.Grow(size) } - initialismMatches []*initialismMatch -) -func (s *splitter) toNameLexems(name string) []nameLexem { + return s +} + +func (p lexemsPool) BorrowLexems() *[]nameLexem { + s := p.Get().(*[]nameLexem) + *s = (*s)[:0] // reset slice, keep allocated capacity + + return s +} + +func (p splittersPool) BorrowSplitter(options ...splitterOption) *splitter { + s := p.Get().(*splitter) + s.postSplitInitialismCheck = false // reset options + for _, apply := range options { + apply(s) + } + + return s +} + +func (p matchesPool) RedeemMatches(s *initialismMatches) { + p.Put(s) +} + +func (p buffersPool) RedeemBuffer(s *bytes.Buffer) { + p.Put(s) +} + +func (p lexemsPool) RedeemLexems(s *[]nameLexem) { + p.Put(s) +} + +func (p splittersPool) RedeemSplitter(s *splitter) { + p.Put(s) +} + +func (m initialismMatch) isZero() bool { + return m.start == 0 && m.end == 0 +} + +func (s splitter) split(name string) *[]nameLexem { nameRunes := []rune(name) matches := s.gatherInitialismMatches(nameRunes) + if matches == nil { + return poolOfLexems.BorrowLexems() + } + return s.mapMatchesToNameLexems(nameRunes, matches) } -func (s *splitter) gatherInitialismMatches(nameRunes []rune) initialismMatches { - matches := make(initialismMatches, 0) +func (s splitter) gatherInitialismMatches(nameRunes []rune) *initialismMatches { + var matches *initialismMatches for currentRunePosition, currentRune := range nameRunes { - newMatches := make(initialismMatches, 0, len(matches)) + // recycle these allocations as we loop over runes + // with such recycling, only 2 slices should be allocated per call + // instead of o(n). + newMatches := poolOfMatches.BorrowMatches() // check current initialism matches - for _, match := range matches { - if keepCompleteMatch := match.complete; keepCompleteMatch { - newMatches = append(newMatches, match) - continue - } + if matches != nil { // skip first iteration + 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 - } + // drop failed match + currentMatchRune := match.body[currentRunePosition-match.start] + if 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 + // 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 } - match.complete = true - match.end = currentRunePosition + *newMatches = append(*newMatches, match) } - - 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{ + for i := range s.initialisms { + initialismRunes := s.initialismsRunes[i] + if initialismRunes[0] == currentRune { + *newMatches = append(*newMatches, initialismMatch{ start: currentRunePosition, body: initialismRunes, complete: false, @@ -140,24 +285,28 @@ func (s *splitter) gatherInitialismMatches(nameRunes []rune) initialismMatches { } } + if matches != nil { + poolOfMatches.RedeemMatches(matches) + } matches = newMatches } + // up to the caller to redeem this last slice return matches } -func (s *splitter) mapMatchesToNameLexems(nameRunes []rune, matches initialismMatches) []nameLexem { - nameLexems := make([]nameLexem, 0) +func (s splitter) mapMatchesToNameLexems(nameRunes []rune, matches *initialismMatches) *[]nameLexem { + nameLexems := poolOfLexems.BorrowLexems() - var lastAcceptedMatch *initialismMatch - for _, match := range matches { + 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))) + if firstMatch := lastAcceptedMatch.isZero(); firstMatch { + s.appendBrokenDownCasualString(nameLexems, nameRunes[:match.start]) + *nameLexems = append(*nameLexems, s.breakInitialism(string(match.body))) lastAcceptedMatch = match @@ -169,63 +318,66 @@ func (s *splitter) mapMatchesToNameLexems(nameRunes []rune, matches initialismMa } middle := nameRunes[lastAcceptedMatch.end+1 : match.start] - nameLexems = append(nameLexems, s.breakCasualString(middle)...) - nameLexems = append(nameLexems, s.breakInitialism(string(match.body))) + s.appendBrokenDownCasualString(nameLexems, 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) { + if lastAcceptedMatch.isZero() { + *nameLexems = (*nameLexems)[:0] + s.appendBrokenDownCasualString(nameLexems, nameRunes) + } else if lastAcceptedMatch.end+1 != len(nameRunes) { rest := nameRunes[lastAcceptedMatch.end+1:] - nameLexems = append(nameLexems, s.breakCasualString(rest)...) + s.appendBrokenDownCasualString(nameLexems, rest) } - return nameLexems -} + poolOfMatches.RedeemMatches(matches) -func (s *splitter) initialismRuneEqual(a, b rune) bool { - return a == b + return nameLexems } -func (s *splitter) breakInitialism(original string) nameLexem { +func (s splitter) breakInitialism(original string) nameLexem { return newInitialismNameLexem(original, original) } -func (s *splitter) breakCasualString(str []rune) []nameLexem { - segments := make([]nameLexem, 0) - currentSegment := "" +func (s splitter) appendBrokenDownCasualString(segments *[]nameLexem, str []rune) { + currentSegment := poolOfBuffers.BorrowBuffer(len(str)) // unlike strings.Builder, bytes.Buffer initial storage can reused + defer func() { + poolOfBuffers.RedeemBuffer(currentSegment) + }() addCasualNameLexem := func(original string) { - segments = append(segments, newCasualNameLexem(original)) + *segments = append(*segments, newCasualNameLexem(original)) } addInitialismNameLexem := func(original, match string) { - segments = append(segments, newInitialismNameLexem(original, match)) + *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) + var addNameLexem func(string) + if s.postSplitInitialismCheck { + addNameLexem = func(original string) { + for i := range s.initialisms { + if isEqualFoldIgnoreSpace(s.initialismsUpperCased[i], original) { + addInitialismNameLexem(original, s.initialisms[i]) + return } } - } - addCasualNameLexem(original) + addCasualNameLexem(original) + } + } else { + addNameLexem = addCasualNameLexem } - for _, rn := range string(str) { - if replace, found := nameReplaceTable[rn]; found { - if currentSegment != "" { - addNameLexem(currentSegment) - currentSegment = "" + for _, rn := range str { + if replace, found := nameReplaceTable(rn); found { + if currentSegment.Len() > 0 { + addNameLexem(currentSegment.String()) + currentSegment.Reset() } if replace != "" { @@ -236,27 +388,121 @@ func (s *splitter) breakCasualString(str []rune) []nameLexem { } if !unicode.In(rn, unicode.L, unicode.M, unicode.N, unicode.Pc) { - if currentSegment != "" { - addNameLexem(currentSegment) - currentSegment = "" + if currentSegment.Len() > 0 { + addNameLexem(currentSegment.String()) + currentSegment.Reset() } continue } if unicode.IsUpper(rn) { - if currentSegment != "" { - addNameLexem(currentSegment) + if currentSegment.Len() > 0 { + addNameLexem(currentSegment.String()) } - currentSegment = "" + currentSegment.Reset() } - currentSegment += string(rn) + currentSegment.WriteRune(rn) + } + + if currentSegment.Len() > 0 { + addNameLexem(currentSegment.String()) } +} + +// isEqualFoldIgnoreSpace is the same as strings.EqualFold, but +// it ignores leading and trailing blank spaces in the compared +// string. +// +// base is assumed to be composed of upper-cased runes, and be already +// trimmed. +// +// This code is heavily inspired from strings.EqualFold. +func isEqualFoldIgnoreSpace(base []rune, str string) bool { + var i, baseIndex int + // equivalent to b := []byte(str), but without data copy + b := hackStringBytes(str) + + for i < len(b) { + if c := b[i]; c < utf8.RuneSelf { + // fast path for ASCII + if c != ' ' && c != '\t' { + break + } + i++ + + continue + } + + // unicode case + r, size := utf8.DecodeRune(b[i:]) + if !unicode.IsSpace(r) { + break + } + i += size + } + + if i >= len(b) { + return len(base) == 0 + } + + for _, baseRune := range base { + if i >= len(b) { + break + } + + if c := b[i]; c < utf8.RuneSelf { + // single byte rune case (ASCII) + if baseRune >= utf8.RuneSelf { + return false + } + + baseChar := byte(baseRune) + if c != baseChar && + !('a' <= c && c <= 'z' && c-'a'+'A' == baseChar) { + return false + } + + baseIndex++ + i++ + + continue + } + + // unicode case + r, size := utf8.DecodeRune(b[i:]) + if unicode.ToUpper(r) != baseRune { + return false + } + baseIndex++ + i += size + } + + if baseIndex != len(base) { + return false + } + + // all passed: now we should only have blanks + for i < len(b) { + if c := b[i]; c < utf8.RuneSelf { + // fast path for ASCII + if c != ' ' && c != '\t' { + return false + } + i++ + + continue + } + + // unicode case + r, size := utf8.DecodeRune(b[i:]) + if !unicode.IsSpace(r) { + return false + } - if currentSegment != "" { - addNameLexem(currentSegment) + i += size } - return segments + return true } diff --git a/vendor/github.com/go-openapi/swag/string_bytes.go b/vendor/github.com/go-openapi/swag/string_bytes.go new file mode 100644 index 0000000000..90745d5ca9 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/string_bytes.go @@ -0,0 +1,8 @@ +package swag + +import "unsafe" + +// hackStringBytes returns the (unsafe) underlying bytes slice of a string. +func hackStringBytes(str string) []byte { + return unsafe.Slice(unsafe.StringData(str), len(str)) +} diff --git a/vendor/github.com/go-openapi/swag/util.go b/vendor/github.com/go-openapi/swag/util.go index 9eac16afb2..5051401c49 100644 --- a/vendor/github.com/go-openapi/swag/util.go +++ b/vendor/github.com/go-openapi/swag/util.go @@ -18,80 +18,29 @@ import ( "reflect" "strings" "unicode" + "unicode/utf8" ) -// 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 prefix function is assumed to return a string that starts with an upper case letter. +// +// e.g. to help convert "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, +func prefixFunc(name, in string) string { + if GoNamePrefixFunc == nil { + return "X" + in } - // a thread-safe index of initialisms - commonInitialisms = newIndexOfInitialisms().load(configuredInitialisms) - initialisms = commonInitialisms.sorted() - - // a test function - isInitialism = commonInitialisms.isInitialism + return GoNamePrefixFunc(name) + in } const ( - //collectionFormatComma = "csv" + // collectionFormatComma = "csv" collectionFormatSpace = "ssv" collectionFormatTab = "tsv" collectionFormatPipe = "pipes" @@ -99,10 +48,11 @@ const ( ) // 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) +// +// 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 @@ -124,11 +74,11 @@ func JoinByFormat(data []string, format string) []string { } // 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) // +// 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 @@ -155,25 +105,9 @@ func SplitByFormat(data, format string) []string { 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, " ") + return strings.TrimSpace(str) } // Shortcut to strings.ToUpper() @@ -187,15 +121,20 @@ func lower(str string) string { } // Camelize an uppercased word -func Camelize(word string) (camelized string) { +func Camelize(word string) string { + camelized := poolOfBuffers.BorrowBuffer(len(word)) + defer func() { + poolOfBuffers.RedeemBuffer(camelized) + }() + for pos, ru := range []rune(word) { if pos > 0 { - camelized += string(unicode.ToLower(ru)) + camelized.WriteRune(unicode.ToLower(ru)) } else { - camelized += string(unicode.ToUpper(ru)) + camelized.WriteRune(unicode.ToUpper(ru)) } } - return + return camelized.String() } // ToFileName lowercases and underscores a go type name @@ -223,33 +162,40 @@ func ToCommandName(name string) string { // 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)) + s := poolOfSplitters.BorrowSplitter(withPostSplitInitialismCheck) + in := s.split(name) + poolOfSplitters.RedeemSplitter(s) + out := make([]string, 0, len(*in)) - for _, w := range in { + for _, w := range *in { if !w.IsInitialism() { out = append(out, lower(w.GetOriginal())) } else { - out = append(out, w.GetOriginal()) + out = append(out, trim(w.GetOriginal())) } } + poolOfLexems.RedeemLexems(in) 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) + s := poolOfSplitters.BorrowSplitter(withPostSplitInitialismCheck) + in := s.split(name) + poolOfSplitters.RedeemSplitter(s) - out := make([]string, 0, len(in)) - for _, w := range in { - original := w.GetOriginal() + out := make([]string, 0, len(*in)) + for _, w := range *in { + original := trim(w.GetOriginal()) if !w.IsInitialism() { out = append(out, Camelize(original)) } else { out = append(out, original) } } + poolOfLexems.RedeemLexems(in) + return strings.Join(out, " ") } @@ -263,7 +209,7 @@ func ToJSONName(name string) string { out = append(out, lower(w)) continue } - out = append(out, Camelize(w)) + out = append(out, Camelize(trim(w))) } return strings.Join(out, "") } @@ -282,35 +228,70 @@ func ToVarName(name string) string { // 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) + s := poolOfSplitters.BorrowSplitter(withPostSplitInitialismCheck) + lexems := s.split(name) + poolOfSplitters.RedeemSplitter(s) + defer func() { + poolOfLexems.RedeemLexems(lexems) + }() + lexemes := *lexems + + if len(lexemes) == 0 { + return "" + } + + result := poolOfBuffers.BorrowBuffer(len(name)) + defer func() { + poolOfBuffers.RedeemBuffer(result) + }() + + // check if not starting with a letter, upper case + firstPart := lexemes[0].GetUnsafeGoName() + if lexemes[0].IsInitialism() { + firstPart = upper(firstPart) + } - result := "" - for _, lexem := range lexems { + if c := firstPart[0]; c < utf8.RuneSelf { + // ASCII + switch { + case 'A' <= c && c <= 'Z': + result.WriteString(firstPart) + case 'a' <= c && c <= 'z': + result.WriteByte(c - 'a' + 'A') + result.WriteString(firstPart[1:]) + default: + result.WriteString(prefixFunc(name, firstPart)) + // NOTE: no longer check if prefixFunc returns a string that starts with uppercase: + // assume this is always the case + } + } else { + // unicode + firstRune, _ := utf8.DecodeRuneInString(firstPart) + switch { + case !unicode.IsLetter(firstRune): + result.WriteString(prefixFunc(name, firstPart)) + case !unicode.IsUpper(firstRune): + result.WriteString(prefixFunc(name, firstPart)) + /* + result.WriteRune(unicode.ToUpper(firstRune)) + result.WriteString(firstPart[offset:]) + */ + default: + result.WriteString(firstPart) + } + } + + for _, lexem := range lexemes[1:] { 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:]...)) - } + result.WriteString(goName) } - return result + return result.String() } // ContainsStrings searches a slice of strings for a case-sensitive match @@ -340,13 +321,22 @@ type zeroable interface { // 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 { + v := reflect.ValueOf(data) + // check for nil data + switch v.Kind() { //nolint:exhaustive + case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: + if v.IsNil() { + return true + } + } + // 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() { + switch v.Kind() { //nolint:exhaustive case reflect.String: return v.Len() == 0 case reflect.Bool: @@ -357,24 +347,13 @@ func IsZero(data interface{}) bool { 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 + default: + return false } - 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 diff --git a/vendor/github.com/go-openapi/swag/yaml.go b/vendor/github.com/go-openapi/swag/yaml.go index ec96914405..f59e025932 100644 --- a/vendor/github.com/go-openapi/swag/yaml.go +++ b/vendor/github.com/go-openapi/swag/yaml.go @@ -16,13 +16,16 @@ package swag import ( "encoding/json" + "errors" "fmt" "path/filepath" + "reflect" + "sort" "strconv" "github.com/mailru/easyjson/jlexer" "github.com/mailru/easyjson/jwriter" - yaml "gopkg.in/yaml.v2" + yaml "gopkg.in/yaml.v3" ) // YAMLMatcher matches yaml @@ -43,16 +46,126 @@ func YAMLToJSON(data interface{}) (json.RawMessage, error) { // 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 { + var document yaml.Node // preserve order that is present in the document + if err := yaml.Unmarshal(data, &document); err != nil { return nil, err } + if document.Kind != yaml.DocumentNode || len(document.Content) != 1 || document.Content[0].Kind != yaml.MappingNode { + return nil, errors.New("only YAML documents that are objects are supported") + } + return &document, nil +} - var document yaml.MapSlice // preserve order that is present in the document - if err := yaml.Unmarshal(data, &document); err != nil { - return nil, err +func yamlNode(root *yaml.Node) (interface{}, error) { + switch root.Kind { + case yaml.DocumentNode: + return yamlDocument(root) + case yaml.SequenceNode: + return yamlSequence(root) + case yaml.MappingNode: + return yamlMapping(root) + case yaml.ScalarNode: + return yamlScalar(root) + case yaml.AliasNode: + return yamlNode(root.Alias) + default: + return nil, fmt.Errorf("unsupported YAML node type: %v", root.Kind) + } +} + +func yamlDocument(node *yaml.Node) (interface{}, error) { + if len(node.Content) != 1 { + return nil, fmt.Errorf("unexpected YAML Document node content length: %d", len(node.Content)) + } + return yamlNode(node.Content[0]) +} + +func yamlMapping(node *yaml.Node) (interface{}, error) { + m := make(JSONMapSlice, len(node.Content)/2) + + var j int + for i := 0; i < len(node.Content); i += 2 { + var nmi JSONMapItem + k, err := yamlStringScalarC(node.Content[i]) + if err != nil { + return nil, fmt.Errorf("unable to decode YAML map key: %w", err) + } + nmi.Key = k + v, err := yamlNode(node.Content[i+1]) + if err != nil { + return nil, fmt.Errorf("unable to process YAML map value for key %q: %w", k, err) + } + nmi.Value = v + m[j] = nmi + j++ + } + return m, nil +} + +func yamlSequence(node *yaml.Node) (interface{}, error) { + s := make([]interface{}, 0) + + for i := 0; i < len(node.Content); i++ { + + v, err := yamlNode(node.Content[i]) + if err != nil { + return nil, fmt.Errorf("unable to decode YAML sequence value: %w", err) + } + s = append(s, v) + } + return s, nil +} + +const ( // See https://yaml.org/type/ + yamlStringScalar = "tag:yaml.org,2002:str" + yamlIntScalar = "tag:yaml.org,2002:int" + yamlBoolScalar = "tag:yaml.org,2002:bool" + yamlFloatScalar = "tag:yaml.org,2002:float" + yamlTimestamp = "tag:yaml.org,2002:timestamp" + yamlNull = "tag:yaml.org,2002:null" +) + +func yamlScalar(node *yaml.Node) (interface{}, error) { + switch node.LongTag() { + case yamlStringScalar: + return node.Value, nil + case yamlBoolScalar: + b, err := strconv.ParseBool(node.Value) + if err != nil { + return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting bool content: %w", node.Value, err) + } + return b, nil + case yamlIntScalar: + i, err := strconv.ParseInt(node.Value, 10, 64) + if err != nil { + return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting integer content: %w", node.Value, err) + } + return i, nil + case yamlFloatScalar: + f, err := strconv.ParseFloat(node.Value, 64) + if err != nil { + return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting float content: %w", node.Value, err) + } + return f, nil + case yamlTimestamp: + return node.Value, nil + case yamlNull: + return nil, nil //nolint:nilnil + default: + return nil, fmt.Errorf("YAML tag %q is not supported", node.LongTag()) + } +} + +func yamlStringScalarC(node *yaml.Node) (string, error) { + if node.Kind != yaml.ScalarNode { + return "", fmt.Errorf("expecting a string scalar but got %q", node.Kind) + } + switch node.LongTag() { + case yamlStringScalar, yamlIntScalar, yamlFloatScalar: + return node.Value, nil + default: + return "", fmt.Errorf("YAML tag %q is not supported as map key", node.LongTag()) } - return document, nil } // JSONMapSlice represent a JSON object, with the order of keys maintained @@ -105,6 +218,141 @@ func (s *JSONMapSlice) UnmarshalEasyJSON(in *jlexer.Lexer) { *s = result } +func (s JSONMapSlice) MarshalYAML() (interface{}, error) { + var n yaml.Node + n.Kind = yaml.DocumentNode + var nodes []*yaml.Node + for _, item := range s { + nn, err := json2yaml(item.Value) + if err != nil { + return nil, err + } + ns := []*yaml.Node{ + { + Kind: yaml.ScalarNode, + Tag: yamlStringScalar, + Value: item.Key, + }, + nn, + } + nodes = append(nodes, ns...) + } + + n.Content = []*yaml.Node{ + { + Kind: yaml.MappingNode, + Content: nodes, + }, + } + + return yaml.Marshal(&n) +} + +func isNil(input interface{}) bool { + if input == nil { + return true + } + kind := reflect.TypeOf(input).Kind() + switch kind { //nolint:exhaustive + case reflect.Ptr, reflect.Map, reflect.Slice, reflect.Chan: + return reflect.ValueOf(input).IsNil() + default: + return false + } +} + +func json2yaml(item interface{}) (*yaml.Node, error) { + if isNil(item) { + return &yaml.Node{ + Kind: yaml.ScalarNode, + Value: "null", + }, nil + } + + switch val := item.(type) { + case JSONMapSlice: + var n yaml.Node + n.Kind = yaml.MappingNode + for i := range val { + childNode, err := json2yaml(&val[i].Value) + if err != nil { + return nil, err + } + n.Content = append(n.Content, &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlStringScalar, + Value: val[i].Key, + }, childNode) + } + return &n, nil + case map[string]interface{}: + var n yaml.Node + n.Kind = yaml.MappingNode + keys := make([]string, 0, len(val)) + for k := range val { + keys = append(keys, k) + } + sort.Strings(keys) + + for _, k := range keys { + v := val[k] + childNode, err := json2yaml(v) + if err != nil { + return nil, err + } + n.Content = append(n.Content, &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlStringScalar, + Value: k, + }, childNode) + } + return &n, nil + case []interface{}: + var n yaml.Node + n.Kind = yaml.SequenceNode + for i := range val { + childNode, err := json2yaml(val[i]) + if err != nil { + return nil, err + } + n.Content = append(n.Content, childNode) + } + return &n, nil + case string: + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlStringScalar, + Value: val, + }, nil + case float64: + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlFloatScalar, + Value: strconv.FormatFloat(val, 'f', -1, 64), + }, nil + case int64: + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlIntScalar, + Value: strconv.FormatInt(val, 10), + }, nil + case uint64: + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlIntScalar, + Value: strconv.FormatUint(val, 10), + }, nil + case bool: + return &yaml.Node{ + Kind: yaml.ScalarNode, + Tag: yamlBoolScalar, + Value: strconv.FormatBool(val), + }, nil + default: + return nil, fmt.Errorf("unhandled type: %T", val) + } +} + // JSONMapItem represents the value of a key in a JSON object held by JSONMapSlice type JSONMapItem struct { Key string @@ -173,23 +421,10 @@ func transformData(input interface{}) (out interface{}, err error) { } switch in := input.(type) { - case yaml.MapSlice: - - o := make(JSONMapSlice, len(in)) - for i, mi := range in { - var nmi JSONMapItem - 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 yaml.Node: + return yamlNode(&in) + case *yaml.Node: + return yamlNode(in) case map[interface{}]interface{}: o := make(JSONMapSlice, 0, len(in)) for ke, va := range in { diff --git a/vendor/github.com/go-openapi/validate/.gitattributes b/vendor/github.com/go-openapi/validate/.gitattributes new file mode 100644 index 0000000000..49ad52766a --- /dev/null +++ b/vendor/github.com/go-openapi/validate/.gitattributes @@ -0,0 +1,2 @@ +# gofmt always uses LF, whereas Git uses CRLF on Windows. +*.go text eol=lf diff --git a/vendor/github.com/go-openapi/validate/.golangci.yml b/vendor/github.com/go-openapi/validate/.golangci.yml index dc8178c809..22f8d21cca 100644 --- a/vendor/github.com/go-openapi/validate/.golangci.yml +++ b/vendor/github.com/go-openapi/validate/.golangci.yml @@ -4,11 +4,11 @@ linters-settings: golint: min-confidence: 0 gocyclo: - min-complexity: 50 + min-complexity: 45 maligned: suggest-new: true dupl: - threshold: 100 + threshold: 200 goconst: min-len: 2 min-occurrences: 3 @@ -17,12 +17,45 @@ linters: enable-all: true disable: - maligned + - unparam - lll + - gochecknoinits + - gochecknoglobals + - funlen - godox - gocognit - whitespace - wsl - - funlen - - gochecknoglobals - - gochecknoinits + - wrapcheck + - testpackage + - nlreturn + - gomnd + - exhaustivestruct + - goerr113 + - errorlint + - nestif + - godot + - gofumpt + - paralleltest + - tparallel + - thelper + - ifshort + - exhaustruct + - varnamelen + - gci + - depguard + - errchkjson + - inamedparam + - nonamedreturns + - musttag + - ireturn + - forcetypeassert + - cyclop + # deprecated linters + - deadcode + - interfacer - scopelint + - varcheck + - structcheck + - golint + - nosnakecase diff --git a/vendor/github.com/go-openapi/validate/.travis.yml b/vendor/github.com/go-openapi/validate/.travis.yml deleted file mode 100644 index db0bb78f5d..0000000000 --- a/vendor/github.com/go-openapi/validate/.travis.yml +++ /dev/null @@ -1,17 +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: EmObnQuM9Mw8J9vpFaKKHqSMN4Wsr/A9+v7ewAD5cEhA0T1P4m7MbJMiJOhxUhj/X+BFh2DamW+P2lT8mybj5wg8wnkQ2BteKA8Tawi6f9PRw2NRheO8tAi8o/npLnlmet0kc93mn+oLuqHw36w4+j5mkOl2FghkfGiUVhwrhkCP7KXQN+3TU87e+/HzQumlJ3nsE+6terVxkH3PmaUTsS5ONaODZfuxFpfb7RsoEl3skHf6d+tr+1nViLxxly7558Nc33C+W1mr0qiEvMLZ+kJ/CpGWBJ6CUJM3jm6hNe2eMuIPwEK2hxZob8c7n22VPap4K6a0bBRoydoDXaba+2sD7Ym6ivDO/DVyL44VeBBLyIiIBylDGQdZH+6SoWm90Qe/i7tnY/T5Ao5igT8f3cfQY1c3EsTfqmlDfrhmACBmwSlgkdVBLTprHL63JMY24LWmh4jhxsmMRZhCL4dze8su1w6pLN/pD1pGHtKYCEVbdTmaM3PblNRFf12XB7qosmQsgUndH4Vq3bTbU0s1pKjeDhRyLvFzvR0TBbo0pDLEoF1A/i5GVFWa7yLZNUDudQERRh7qv/xBl2excIaQ1sV4DSVm7bAE9l6Kp+yeHQJW2uN6Y3X8wu9gB9nv9l5HBze7wh8KE6PyWAOLYYqZg9/sAtsv/2GcQqXcKFF1zcA= -script: -- gotestsum -f short-verbose -- -race ./... -- gotestsum -f short-verbose -- -timeout=20m -coverprofile=coverage.txt -covermode=atomic -args -enable-long ./... -- gotestsum -f short-verbose -- -timeout=30m -args -enable-go-swagger ./... -- go get -u github.com/go-openapi/runtime@master -- gotestsum -f short-verbose -- -timeout=30m github.com/go-openapi/runtime/... diff --git a/vendor/github.com/go-openapi/validate/BENCHMARK.md b/vendor/github.com/go-openapi/validate/BENCHMARK.md new file mode 100644 index 0000000000..79cf6a077b --- /dev/null +++ b/vendor/github.com/go-openapi/validate/BENCHMARK.md @@ -0,0 +1,31 @@ +# Benchmark + +Validating the Kubernetes Swagger API + +## v0.22.6: 60,000,000 allocs +``` +goos: linux +goarch: amd64 +pkg: github.com/go-openapi/validate +cpu: AMD Ryzen 7 5800X 8-Core Processor +Benchmark_KubernetesSpec/validating_kubernetes_API-16 1 8549863982 ns/op 7067424936 B/op 59583275 allocs/op +``` + +## After refact PR: minor but noticable improvements: 25,000,000 allocs +``` +go test -bench Spec +goos: linux +goarch: amd64 +pkg: github.com/go-openapi/validate +cpu: AMD Ryzen 7 5800X 8-Core Processor +Benchmark_KubernetesSpec/validating_kubernetes_API-16 1 4064535557 ns/op 3379715592 B/op 25320330 allocs/op +``` + +## After reduce GC pressure PR: 17,000,000 allocs +``` +goos: linux +goarch: amd64 +pkg: github.com/go-openapi/validate +cpu: AMD Ryzen 7 5800X 8-Core Processor +Benchmark_KubernetesSpec/validating_kubernetes_API-16 1 3758414145 ns/op 2593881496 B/op 17111373 allocs/op +``` diff --git a/vendor/github.com/go-openapi/validate/README.md b/vendor/github.com/go-openapi/validate/README.md index 08fb352bcf..e8e1bb218d 100644 --- a/vendor/github.com/go-openapi/validate/README.md +++ b/vendor/github.com/go-openapi/validate/README.md @@ -1,6 +1,36 @@ -# Validation helpers [![Build Status](https://travis-ci.org/go-openapi/validate.svg?branch=master)](https://travis-ci.org/go-openapi/validate) [![codecov](https://codecov.io/gh/go-openapi/validate/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/validate) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) +# Validation helpers [![Build Status](https://github.com/go-openapi/validate/actions/workflows/go-test.yml/badge.svg)](https://github.com/go-openapi/validate/actions?query=workflow%3A"go+test") [![codecov](https://codecov.io/gh/go-openapi/validate/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/validate) +[![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/validate/master/LICENSE) -[![GoDoc](https://godoc.org/github.com/go-openapi/validate?status.svg)](http://godoc.org/github.com/go-openapi/validate) -[![GolangCI](https://golangci.com/badges/github.com/go-openapi/validate.svg)](https://golangci.com) +[![Go Reference](https://pkg.go.dev/badge/github.com/go-openapi/validate.svg)](https://pkg.go.dev/github.com/go-openapi/validate) [![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/validate)](https://goreportcard.com/report/github.com/go-openapi/validate) + +This package provides helpers to validate Swagger 2.0. specification (aka OpenAPI 2.0). + +Reference can be found here: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md. + +## What's inside? + +* A validator for Swagger specifications +* A validator for JSON schemas draft4 +* Helper functions to validate individual values (used by code generated by [go-swagger](https://github.com/go-swagger/go-swagger)). + * Required, RequiredNumber, RequiredString + * ReadOnly + * UniqueItems, MaxItems, MinItems + * Enum, EnumCase + * Pattern, MinLength, MaxLength + * Minimum, Maximum, MultipleOf + * FormatOf + +[Documentation](https://pkg.go.dev/github.com/go-openapi/validate) + +## FAQ + +* Does this library support OpenAPI 3? + +> No. +> This package currently only supports OpenAPI 2.0 (aka Swagger 2.0). +> There is no plan to make it evolve toward supporting OpenAPI 3.x. +> This [discussion thread](https://github.com/go-openapi/spec/issues/21) relates the full story. +> +> An early attempt to support Swagger 3 may be found at: https://github.com/go-openapi/spec3 diff --git a/vendor/github.com/go-openapi/validate/context.go b/vendor/github.com/go-openapi/validate/context.go new file mode 100644 index 0000000000..89977173b9 --- /dev/null +++ b/vendor/github.com/go-openapi/validate/context.go @@ -0,0 +1,56 @@ +package validate + +import ( + "context" +) + +// validateCtxKey is the key type of context key in this pkg +type validateCtxKey string + +const ( + operationTypeKey validateCtxKey = "operationTypeKey" +) + +type operationType string + +const ( + request operationType = "request" + response operationType = "response" + none operationType = "none" // not specified in ctx +) + +var operationTypeEnum = []operationType{request, response, none} + +// WithOperationRequest returns a new context with operationType request +// in context value +func WithOperationRequest(ctx context.Context) context.Context { + return withOperation(ctx, request) +} + +// WithOperationRequest returns a new context with operationType response +// in context value +func WithOperationResponse(ctx context.Context) context.Context { + return withOperation(ctx, response) +} + +func withOperation(ctx context.Context, operation operationType) context.Context { + return context.WithValue(ctx, operationTypeKey, operation) +} + +// extractOperationType extracts the operation type from ctx +// if not specified or of unknown value, return none operation type +func extractOperationType(ctx context.Context) operationType { + v := ctx.Value(operationTypeKey) + if v == nil { + return none + } + res, ok := v.(operationType) + if !ok { + return none + } + // validate the value is in operation enum + if err := Enum("", "", res, operationTypeEnum); err != nil { + return none + } + return res +} diff --git a/vendor/github.com/go-openapi/validate/default_validator.go b/vendor/github.com/go-openapi/validate/default_validator.go index 26d54b7c23..e0dd93839e 100644 --- a/vendor/github.com/go-openapi/validate/default_validator.go +++ b/vendor/github.com/go-openapi/validate/default_validator.go @@ -25,48 +25,55 @@ import ( // According to Swagger spec, default values MUST validate their schema. type defaultValidator struct { SpecValidator *SpecValidator - visitedSchemas map[string]bool + visitedSchemas map[string]struct{} + schemaOptions *SchemaValidatorOptions } // resetVisited resets the internal state of visited schemas func (d *defaultValidator) resetVisited() { - d.visitedSchemas = map[string]bool{} + if d.visitedSchemas == nil { + d.visitedSchemas = make(map[string]struct{}) + + return + } + + // TODO(go1.21): clear(ex.visitedSchemas) + for k := range d.visitedSchemas { + delete(d.visitedSchemas, k) + } } -func isVisited(path string, visitedSchemas map[string]bool) bool { - found := visitedSchemas[path] - if !found { - // search for overlapping paths - frags := strings.Split(path, ".") - if len(frags) < 2 { - // shortcut exit on smaller paths - return found +func isVisited(path string, visitedSchemas map[string]struct{}) bool { + _, found := visitedSchemas[path] + if found { + return true + } + + // search for overlapping paths + var ( + parent string + suffix string + ) + for i := len(path) - 2; i >= 0; i-- { + r := path[i] + if r != '.' { + continue } - last := len(frags) - 1 - var currentFragStr, parent string - for i := range frags { - if i == 0 { - currentFragStr = frags[last] - } else { - currentFragStr = strings.Join([]string{frags[last-i], currentFragStr}, ".") - } - if i < last { - parent = strings.Join(frags[0:last-i], ".") - } else { - parent = "" - } - if strings.HasSuffix(parent, currentFragStr) { - found = true - break - } + + parent = path[0:i] + suffix = path[i+1:] + + if strings.HasSuffix(parent, suffix) { + return true } } - return found + + return false } // beingVisited asserts a schema is being visited func (d *defaultValidator) beingVisited(path string) { - d.visitedSchemas[path] = true + d.visitedSchemas[path] = struct{}{} } // isVisited tells if a path has already been visited @@ -75,8 +82,9 @@ func (d *defaultValidator) isVisited(path string) bool { } // Validate validates the default values declared in the swagger spec -func (d *defaultValidator) Validate() (errs *Result) { - errs = new(Result) +func (d *defaultValidator) Validate() *Result { + errs := pools.poolOfResults.BorrowResult() // will redeem when merged + if d == nil || d.SpecValidator == nil { return errs } @@ -89,10 +97,10 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result { // every default value that is specified must validate against the schema for that property // headers, items, parameters, schema - res := new(Result) + res := pools.poolOfResults.BorrowResult() // will redeem when merged s := d.SpecValidator - for method, pathItem := range s.analyzer.Operations() { + for method, pathItem := range s.expandedAnalyzer().Operations() { for path, op := range pathItem { // parameters for _, param := range paramHelp.safeExpandedParamsFor(path, method, op.ID, res, s) { @@ -107,19 +115,23 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result { // default values provided must validate against their inline definition (no explicit schema) if param.Default != nil && param.Schema == nil { // check param default value is valid - red := NewParamValidator(¶m, s.KnownFormats).Validate(param.Default) + red := newParamValidator(¶m, s.KnownFormats, d.schemaOptions).Validate(param.Default) //#nosec if red.HasErrorsOrWarnings() { res.AddErrors(defaultValueDoesNotValidateMsg(param.Name, param.In)) res.Merge(red) + } else if red.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(red) } } // Recursively follows Items and Schemas if param.Items != nil { - red := d.validateDefaultValueItemsAgainstSchema(param.Name, param.In, ¶m, param.Items) + red := d.validateDefaultValueItemsAgainstSchema(param.Name, param.In, ¶m, param.Items) //#nosec if red.HasErrorsOrWarnings() { res.AddErrors(defaultValueItemsDoesNotValidateMsg(param.Name, param.In)) res.Merge(red) + } else if red.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(red) } } @@ -129,6 +141,8 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result { if red.HasErrorsOrWarnings() { res.AddErrors(defaultValueDoesNotValidateMsg(param.Name, param.In)) res.Merge(red) + } else if red.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(red) } } } @@ -141,7 +155,7 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result { // Same constraint on regular Responses if op.Responses.StatusCodeResponses != nil { // Safeguard for code, r := range op.Responses.StatusCodeResponses { - res.Merge(d.validateDefaultInResponse(&r, "response", path, code, op.ID)) + res.Merge(d.validateDefaultInResponse(&r, "response", path, code, op.ID)) //#nosec } } } else if op.ID != "" { @@ -154,7 +168,7 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result { // reset explored schemas to get depth-first recursive-proof exploration d.resetVisited() for nm, sch := range s.spec.Spec().Definitions { - res.Merge(d.validateDefaultValueSchemaAgainstSchema(fmt.Sprintf("definitions.%s", nm), "body", &sch)) + res.Merge(d.validateDefaultValueSchemaAgainstSchema("definitions."+nm, "body", &sch)) //#nosec } } return res @@ -170,26 +184,29 @@ func (d *defaultValidator) validateDefaultInResponse(resp *spec.Response, respon responseName, responseCodeAsStr := responseHelp.responseMsgVariants(responseType, responseCode) - // nolint: dupl if response.Headers != nil { // Safeguard for nm, h := range response.Headers { // reset explored schemas to get depth-first recursive-proof exploration d.resetVisited() if h.Default != nil { - red := NewHeaderValidator(nm, &h, s.KnownFormats).Validate(h.Default) + red := newHeaderValidator(nm, &h, s.KnownFormats, d.schemaOptions).Validate(h.Default) //#nosec if red.HasErrorsOrWarnings() { res.AddErrors(defaultValueHeaderDoesNotValidateMsg(operationID, nm, responseName)) res.Merge(red) + } else if red.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(red) } } // Headers have inline definition, like params if h.Items != nil { - red := d.validateDefaultValueItemsAgainstSchema(nm, "header", &h, h.Items) + red := d.validateDefaultValueItemsAgainstSchema(nm, "header", &h, h.Items) //#nosec if red.HasErrorsOrWarnings() { res.AddErrors(defaultValueHeaderItemsDoesNotValidateMsg(operationID, nm, responseName)) res.Merge(red) + } else if red.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(red) } } @@ -209,6 +226,8 @@ func (d *defaultValidator) validateDefaultInResponse(resp *spec.Response, respon // Additional message to make sure the context of the error is not lost res.AddErrors(defaultValueInDoesNotValidateMsg(operationID, responseName)) res.Merge(red) + } else if red.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(red) } } return res @@ -220,11 +239,13 @@ func (d *defaultValidator) validateDefaultValueSchemaAgainstSchema(path, in stri return nil } d.beingVisited(path) - res := new(Result) + res := pools.poolOfResults.BorrowResult() s := d.SpecValidator if schema.Default != nil { - res.Merge(NewSchemaValidator(schema, s.spec.Spec(), path+".default", s.KnownFormats, SwaggerSchema(true)).Validate(schema.Default)) + res.Merge( + newSchemaValidator(schema, s.spec.Spec(), path+".default", s.KnownFormats, d.schemaOptions).Validate(schema.Default), + ) } if schema.Items != nil { if schema.Items.Schema != nil { @@ -233,7 +254,7 @@ func (d *defaultValidator) validateDefaultValueSchemaAgainstSchema(path, in stri // Multiple schemas in items if schema.Items.Schemas != nil { // Safeguard for i, sch := range schema.Items.Schemas { - res.Merge(d.validateDefaultValueSchemaAgainstSchema(fmt.Sprintf("%s.items[%d].default", path, i), in, &sch)) + res.Merge(d.validateDefaultValueSchemaAgainstSchema(fmt.Sprintf("%s.items[%d].default", path, i), in, &sch)) //#nosec } } } @@ -242,33 +263,35 @@ func (d *defaultValidator) validateDefaultValueSchemaAgainstSchema(path, in stri } if schema.AdditionalItems != nil && schema.AdditionalItems.Schema != nil { // NOTE: we keep validating values, even though additionalItems is not supported by Swagger 2.0 (and 3.0 as well) - res.Merge(d.validateDefaultValueSchemaAgainstSchema(fmt.Sprintf("%s.additionalItems", path), in, schema.AdditionalItems.Schema)) + res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+".additionalItems", in, schema.AdditionalItems.Schema)) } for propName, prop := range schema.Properties { - res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+"."+propName, in, &prop)) + res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec } for propName, prop := range schema.PatternProperties { - res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+"."+propName, in, &prop)) + res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec } if schema.AdditionalProperties != nil && schema.AdditionalProperties.Schema != nil { - res.Merge(d.validateDefaultValueSchemaAgainstSchema(fmt.Sprintf("%s.additionalProperties", path), in, schema.AdditionalProperties.Schema)) + res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+".additionalProperties", in, schema.AdditionalProperties.Schema)) } if schema.AllOf != nil { for i, aoSch := range schema.AllOf { - res.Merge(d.validateDefaultValueSchemaAgainstSchema(fmt.Sprintf("%s.allOf[%d]", path, i), in, &aoSch)) + res.Merge(d.validateDefaultValueSchemaAgainstSchema(fmt.Sprintf("%s.allOf[%d]", path, i), in, &aoSch)) //#nosec } } return res } // TODO: Temporary duplicated code. Need to refactor with examples -// nolint: dupl + func (d *defaultValidator) validateDefaultValueItemsAgainstSchema(path, in string, root interface{}, items *spec.Items) *Result { - res := new(Result) + res := pools.poolOfResults.BorrowResult() s := d.SpecValidator if items != nil { if items.Default != nil { - res.Merge(newItemsValidator(path, in, items, root, s.KnownFormats).Validate(0, items.Default)) + res.Merge( + newItemsValidator(path, in, items, root, s.KnownFormats, d.schemaOptions).Validate(0, items.Default), + ) } if items.Items != nil { res.Merge(d.validateDefaultValueItemsAgainstSchema(path+"[0].default", in, root, items.Items)) diff --git a/vendor/github.com/go-openapi/validate/doc.go b/vendor/github.com/go-openapi/validate/doc.go index f5ca9a5d58..d2b901eab9 100644 --- a/vendor/github.com/go-openapi/validate/doc.go +++ b/vendor/github.com/go-openapi/validate/doc.go @@ -19,7 +19,7 @@ as well as tools to validate data against their schema. This package follows Swagger 2.0. specification (aka OpenAPI 2.0). Reference can be found here: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md. -Validating a specification +# Validating a specification Validates a spec document (from JSON or YAML) against the JSON schema for swagger, then checks a number of extra rules that can't be expressed in JSON schema. @@ -30,34 +30,36 @@ Entry points: - SpecValidator.Validate() Reported as errors: - [x] definition can't declare a property that's already defined by one of its ancestors - [x] definition's ancestor can't be a descendant of the same model - [x] path uniqueness: each api path should be non-verbatim (account for path param names) unique per method - [x] each security reference should contain only unique scopes - [x] each security scope in a security definition should be unique - [x] parameters in path must be unique - [x] each path parameter must correspond to a parameter placeholder and vice versa - [x] each referenceable definition must have references - [x] each definition property listed in the required array must be defined in the properties of the model - [x] each parameter should have a unique `name` and `type` combination - [x] each operation should have only 1 parameter of type body - [x] each reference must point to a valid object - [x] every default value that is specified must validate against the schema for that property - [x] items property is required for all schemas/definitions of type `array` - [x] path parameters must be declared a required - [x] headers must not contain $ref - [x] schema and property examples provided must validate against their respective object's schema - [x] examples provided must validate their schema + + [x] definition can't declare a property that's already defined by one of its ancestors + [x] definition's ancestor can't be a descendant of the same model + [x] path uniqueness: each api path should be non-verbatim (account for path param names) unique per method. Validation can be laxed by disabling StrictPathParamUniqueness. + [x] each security reference should contain only unique scopes + [x] each security scope in a security definition should be unique + [x] parameters in path must be unique + [x] each path parameter must correspond to a parameter placeholder and vice versa + [x] each referenceable definition must have references + [x] each definition property listed in the required array must be defined in the properties of the model + [x] each parameter should have a unique `name` and `type` combination + [x] each operation should have only 1 parameter of type body + [x] each reference must point to a valid object + [x] every default value that is specified must validate against the schema for that property + [x] items property is required for all schemas/definitions of type `array` + [x] path parameters must be declared a required + [x] headers must not contain $ref + [x] schema and property examples provided must validate against their respective object's schema + [x] examples provided must validate their schema Reported as warnings: - [x] path parameters should not contain any of [{,},\w] - [x] empty path - [x] unused definitions - [x] unsupported validation of examples on non-JSON media types - [x] examples in response without schema - [x] readOnly properties should not be required -Validating a schema + [x] path parameters should not contain any of [{,},\w] + [x] empty path + [x] unused definitions + [x] unsupported validation of examples on non-JSON media types + [x] examples in response without schema + [x] readOnly properties should not be required + +# Validating a schema The schema validation toolkit validates data against JSON-schema-draft 04 schema. @@ -70,16 +72,16 @@ Entry points: - AgainstSchema() - ... -Known limitations +# Known limitations With the current version of this package, the following aspects of swagger are not yet supported: - [ ] errors and warnings are not reported with key/line number in spec - [ ] default values and examples on responses only support application/json producer type - [ ] invalid numeric constraints (such as Minimum, etc..) are not checked except for default and example values - [ ] rules for collectionFormat are not implemented - [ ] no validation rule for polymorphism support (discriminator) [not done here] - [ ] valid js ECMA regexp not supported by Go regexp engine are considered invalid - [ ] arbitrary large numbers are not supported: max is math.MaxFloat64 + [ ] errors and warnings are not reported with key/line number in spec + [ ] default values and examples on responses only support application/json producer type + [ ] invalid numeric constraints (such as Minimum, etc..) are not checked except for default and example values + [ ] rules for collectionFormat are not implemented + [ ] no validation rule for polymorphism support (discriminator) [not done here] + [ ] valid js ECMA regexp not supported by Go regexp engine are considered invalid + [ ] arbitrary large numbers are not supported: max is math.MaxFloat64 */ package validate diff --git a/vendor/github.com/go-openapi/validate/example_validator.go b/vendor/github.com/go-openapi/validate/example_validator.go index 1303591751..d08956973c 100644 --- a/vendor/github.com/go-openapi/validate/example_validator.go +++ b/vendor/github.com/go-openapi/validate/example_validator.go @@ -23,17 +23,27 @@ import ( // ExampleValidator validates example values defined in a spec type exampleValidator struct { SpecValidator *SpecValidator - visitedSchemas map[string]bool + visitedSchemas map[string]struct{} + schemaOptions *SchemaValidatorOptions } // resetVisited resets the internal state of visited schemas func (ex *exampleValidator) resetVisited() { - ex.visitedSchemas = map[string]bool{} + if ex.visitedSchemas == nil { + ex.visitedSchemas = make(map[string]struct{}) + + return + } + + // TODO(go1.21): clear(ex.visitedSchemas) + for k := range ex.visitedSchemas { + delete(ex.visitedSchemas, k) + } } // beingVisited asserts a schema is being visited func (ex *exampleValidator) beingVisited(path string) { - ex.visitedSchemas[path] = true + ex.visitedSchemas[path] = struct{}{} } // isVisited tells if a path has already been visited @@ -48,9 +58,9 @@ func (ex *exampleValidator) isVisited(path string) bool { // - schemas // - individual property // - responses -// -func (ex *exampleValidator) Validate() (errs *Result) { - errs = new(Result) +func (ex *exampleValidator) Validate() *Result { + errs := pools.poolOfResults.BorrowResult() + if ex == nil || ex.SpecValidator == nil { return errs } @@ -65,10 +75,10 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result { // in: schemas, properties, object, items // not in: headers, parameters without schema - res := new(Result) + res := pools.poolOfResults.BorrowResult() s := ex.SpecValidator - for method, pathItem := range s.analyzer.Operations() { + for method, pathItem := range s.expandedAnalyzer().Operations() { for path, op := range pathItem { // parameters for _, param := range paramHelp.safeExpandedParamsFor(path, method, op.ID, res, s) { @@ -83,19 +93,23 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result { // default values provided must validate against their inline definition (no explicit schema) if param.Example != nil && param.Schema == nil { // check param default value is valid - red := NewParamValidator(¶m, s.KnownFormats).Validate(param.Example) + red := newParamValidator(¶m, s.KnownFormats, ex.schemaOptions).Validate(param.Example) //#nosec if red.HasErrorsOrWarnings() { res.AddWarnings(exampleValueDoesNotValidateMsg(param.Name, param.In)) res.MergeAsWarnings(red) + } else if red.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(red) } } // Recursively follows Items and Schemas if param.Items != nil { - red := ex.validateExampleValueItemsAgainstSchema(param.Name, param.In, ¶m, param.Items) + red := ex.validateExampleValueItemsAgainstSchema(param.Name, param.In, ¶m, param.Items) //#nosec if red.HasErrorsOrWarnings() { res.AddWarnings(exampleValueItemsDoesNotValidateMsg(param.Name, param.In)) res.Merge(red) + } else if red.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(red) } } @@ -105,6 +119,8 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result { if red.HasErrorsOrWarnings() { res.AddWarnings(exampleValueDoesNotValidateMsg(param.Name, param.In)) res.Merge(red) + } else if red.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(red) } } } @@ -117,7 +133,7 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result { // Same constraint on regular Responses if op.Responses.StatusCodeResponses != nil { // Safeguard for code, r := range op.Responses.StatusCodeResponses { - res.Merge(ex.validateExampleInResponse(&r, "response", path, code, op.ID)) + res.Merge(ex.validateExampleInResponse(&r, "response", path, code, op.ID)) //#nosec } } } else if op.ID != "" { @@ -130,7 +146,7 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result { // reset explored schemas to get depth-first recursive-proof exploration ex.resetVisited() for nm, sch := range s.spec.Spec().Definitions { - res.Merge(ex.validateExampleValueSchemaAgainstSchema(fmt.Sprintf("definitions.%s", nm), "body", &sch)) + res.Merge(ex.validateExampleValueSchemaAgainstSchema("definitions."+nm, "body", &sch)) //#nosec } } return res @@ -146,26 +162,29 @@ func (ex *exampleValidator) validateExampleInResponse(resp *spec.Response, respo responseName, responseCodeAsStr := responseHelp.responseMsgVariants(responseType, responseCode) - // nolint: dupl if response.Headers != nil { // Safeguard for nm, h := range response.Headers { // reset explored schemas to get depth-first recursive-proof exploration ex.resetVisited() if h.Example != nil { - red := NewHeaderValidator(nm, &h, s.KnownFormats).Validate(h.Example) + red := newHeaderValidator(nm, &h, s.KnownFormats, ex.schemaOptions).Validate(h.Example) //#nosec if red.HasErrorsOrWarnings() { res.AddWarnings(exampleValueHeaderDoesNotValidateMsg(operationID, nm, responseName)) res.MergeAsWarnings(red) + } else if red.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(red) } } // Headers have inline definition, like params if h.Items != nil { - red := ex.validateExampleValueItemsAgainstSchema(nm, "header", &h, h.Items) + red := ex.validateExampleValueItemsAgainstSchema(nm, "header", &h, h.Items) //#nosec if red.HasErrorsOrWarnings() { res.AddWarnings(exampleValueHeaderItemsDoesNotValidateMsg(operationID, nm, responseName)) res.MergeAsWarnings(red) + } else if red.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(red) } } @@ -185,13 +204,17 @@ func (ex *exampleValidator) validateExampleInResponse(resp *spec.Response, respo // Additional message to make sure the context of the error is not lost res.AddWarnings(exampleValueInDoesNotValidateMsg(operationID, responseName)) res.Merge(red) + } else if red.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(red) } } if response.Examples != nil { if response.Schema != nil { if example, ok := response.Examples["application/json"]; ok { - res.MergeAsWarnings(NewSchemaValidator(response.Schema, s.spec.Spec(), path+".examples", s.KnownFormats, SwaggerSchema(true)).Validate(example)) + res.MergeAsWarnings( + newSchemaValidator(response.Schema, s.spec.Spec(), path+".examples", s.KnownFormats, s.schemaOptions).Validate(example), + ) } else { // TODO: validate other media types too res.AddWarnings(examplesMimeNotSupportedMsg(operationID, responseName)) @@ -210,10 +233,12 @@ func (ex *exampleValidator) validateExampleValueSchemaAgainstSchema(path, in str } ex.beingVisited(path) s := ex.SpecValidator - res := new(Result) + res := pools.poolOfResults.BorrowResult() if schema.Example != nil { - res.MergeAsWarnings(NewSchemaValidator(schema, s.spec.Spec(), path+".example", s.KnownFormats, SwaggerSchema(true)).Validate(schema.Example)) + res.MergeAsWarnings( + newSchemaValidator(schema, s.spec.Spec(), path+".example", s.KnownFormats, ex.schemaOptions).Validate(schema.Example), + ) } if schema.Items != nil { if schema.Items.Schema != nil { @@ -222,7 +247,7 @@ func (ex *exampleValidator) validateExampleValueSchemaAgainstSchema(path, in str // Multiple schemas in items if schema.Items.Schemas != nil { // Safeguard for i, sch := range schema.Items.Schemas { - res.Merge(ex.validateExampleValueSchemaAgainstSchema(fmt.Sprintf("%s.items[%d].example", path, i), in, &sch)) + res.Merge(ex.validateExampleValueSchemaAgainstSchema(fmt.Sprintf("%s.items[%d].example", path, i), in, &sch)) //#nosec } } } @@ -231,33 +256,36 @@ func (ex *exampleValidator) validateExampleValueSchemaAgainstSchema(path, in str } if schema.AdditionalItems != nil && schema.AdditionalItems.Schema != nil { // NOTE: we keep validating values, even though additionalItems is unsupported in Swagger 2.0 (and 3.0 as well) - res.Merge(ex.validateExampleValueSchemaAgainstSchema(fmt.Sprintf("%s.additionalItems", path), in, schema.AdditionalItems.Schema)) + res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+".additionalItems", in, schema.AdditionalItems.Schema)) } for propName, prop := range schema.Properties { - res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+"."+propName, in, &prop)) + res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec } for propName, prop := range schema.PatternProperties { - res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+"."+propName, in, &prop)) + res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec } if schema.AdditionalProperties != nil && schema.AdditionalProperties.Schema != nil { - res.Merge(ex.validateExampleValueSchemaAgainstSchema(fmt.Sprintf("%s.additionalProperties", path), in, schema.AdditionalProperties.Schema)) + res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+".additionalProperties", in, schema.AdditionalProperties.Schema)) } if schema.AllOf != nil { for i, aoSch := range schema.AllOf { - res.Merge(ex.validateExampleValueSchemaAgainstSchema(fmt.Sprintf("%s.allOf[%d]", path, i), in, &aoSch)) + res.Merge(ex.validateExampleValueSchemaAgainstSchema(fmt.Sprintf("%s.allOf[%d]", path, i), in, &aoSch)) //#nosec } } return res } // TODO: Temporary duplicated code. Need to refactor with examples -// nolint: dupl +// + func (ex *exampleValidator) validateExampleValueItemsAgainstSchema(path, in string, root interface{}, items *spec.Items) *Result { - res := new(Result) + res := pools.poolOfResults.BorrowResult() s := ex.SpecValidator if items != nil { if items.Example != nil { - res.MergeAsWarnings(newItemsValidator(path, in, items, root, s.KnownFormats).Validate(0, items.Example)) + res.MergeAsWarnings( + newItemsValidator(path, in, items, root, s.KnownFormats, ex.schemaOptions).Validate(0, items.Example), + ) } if items.Items != nil { res.Merge(ex.validateExampleValueItemsAgainstSchema(path+"[0].example", in, root, items.Items)) @@ -266,5 +294,6 @@ func (ex *exampleValidator) validateExampleValueItemsAgainstSchema(path, in stri res.AddErrors(invalidPatternInMsg(path, in, items.Pattern)) } } + return res } diff --git a/vendor/github.com/go-openapi/validate/formats.go b/vendor/github.com/go-openapi/validate/formats.go index 0ad996cbbc..f4e3552130 100644 --- a/vendor/github.com/go-openapi/validate/formats.go +++ b/vendor/github.com/go-openapi/validate/formats.go @@ -22,10 +22,32 @@ import ( ) type formatValidator struct { - Format string Path string In string + Format string KnownFormats strfmt.Registry + Options *SchemaValidatorOptions +} + +func newFormatValidator(path, in, format string, formats strfmt.Registry, opts *SchemaValidatorOptions) *formatValidator { + if opts == nil { + opts = new(SchemaValidatorOptions) + } + + var f *formatValidator + if opts.recycleValidators { + f = pools.poolOfFormatValidators.BorrowValidator() + } else { + f = new(formatValidator) + } + + f.Path = path + f.In = in + f.Format = format + f.KnownFormats = formats + f.Options = opts + + return f } func (f *formatValidator) SetPath(path string) { @@ -33,37 +55,45 @@ func (f *formatValidator) SetPath(path string) { } func (f *formatValidator) Applies(source interface{}, kind reflect.Kind) bool { - doit := func() bool { - if source == nil { - return false - } - switch source := source.(type) { - case *spec.Items: - return kind == reflect.String && f.KnownFormats.ContainsName(source.Format) - case *spec.Parameter: - return kind == reflect.String && f.KnownFormats.ContainsName(source.Format) - case *spec.Schema: - return kind == reflect.String && f.KnownFormats.ContainsName(source.Format) - case *spec.Header: - return kind == reflect.String && f.KnownFormats.ContainsName(source.Format) - } + if source == nil || f.KnownFormats == nil { + return false + } + + switch source := source.(type) { + case *spec.Items: + return kind == reflect.String && f.KnownFormats.ContainsName(source.Format) + case *spec.Parameter: + return kind == reflect.String && f.KnownFormats.ContainsName(source.Format) + case *spec.Schema: + return kind == reflect.String && f.KnownFormats.ContainsName(source.Format) + case *spec.Header: + return kind == reflect.String && f.KnownFormats.ContainsName(source.Format) + default: return false } - r := doit() - debugLog("format validator for %q applies %t for %T (kind: %v)\n", f.Path, r, source, kind) - return r } func (f *formatValidator) Validate(val interface{}) *Result { - result := new(Result) - debugLog("validating \"%v\" against format: %s", val, f.Format) + if f.Options.recycleValidators { + defer func() { + f.redeem() + }() + } + + var result *Result + if f.Options.recycleResult { + result = pools.poolOfResults.BorrowResult() + } else { + result = new(Result) + } if err := FormatOf(f.Path, f.In, f.Format, val.(string), f.KnownFormats); err != nil { result.AddErrors(err) } - if result.HasErrors() { - return result - } - return nil + return result +} + +func (f *formatValidator) redeem() { + pools.poolOfFormatValidators.RedeemValidator(f) } diff --git a/vendor/github.com/go-openapi/validate/helpers.go b/vendor/github.com/go-openapi/validate/helpers.go index 4b77a00047..757e403d91 100644 --- a/vendor/github.com/go-openapi/validate/helpers.go +++ b/vendor/github.com/go-openapi/validate/helpers.go @@ -47,7 +47,7 @@ const ( jsonProperties = "properties" jsonItems = "items" jsonType = "type" - //jsonSchema = "schema" + // jsonSchema = "schema" jsonDefault = "default" ) @@ -56,7 +56,7 @@ const ( stringFormatDateTime = "date-time" stringFormatPassword = "password" stringFormatByte = "byte" - //stringFormatBinary = "binary" + // stringFormatBinary = "binary" stringFormatCreditCard = "creditcard" stringFormatDuration = "duration" stringFormatEmail = "email" @@ -101,9 +101,17 @@ type errorHelper struct { // A collection of unexported helpers for error construction } -func (h *errorHelper) sErr(err errors.Error) *Result { +func (h *errorHelper) sErr(err errors.Error, recycle bool) *Result { // Builds a Result from standard errors.Error - return &Result{Errors: []error{err}} + var result *Result + if recycle { + result = pools.poolOfResults.BorrowResult() + } else { + result = new(Result) + } + result.Errors = []error{err} + + return result } func (h *errorHelper) addPointerError(res *Result, err error, ref string, fromPath string) *Result { @@ -157,7 +165,7 @@ func (h *valueHelper) asInt64(val interface{}) int64 { // Number conversion function for int64, without error checking // (implements an implicit type upgrade). v := reflect.ValueOf(val) - switch v.Kind() { + switch v.Kind() { //nolint:exhaustive case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return v.Int() case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: @@ -165,7 +173,7 @@ func (h *valueHelper) asInt64(val interface{}) int64 { case reflect.Float32, reflect.Float64: return int64(v.Float()) default: - //panic("Non numeric value in asInt64()") + // panic("Non numeric value in asInt64()") return 0 } } @@ -174,7 +182,7 @@ func (h *valueHelper) asUint64(val interface{}) uint64 { // Number conversion function for uint64, without error checking // (implements an implicit type upgrade). v := reflect.ValueOf(val) - switch v.Kind() { + switch v.Kind() { //nolint:exhaustive case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return uint64(v.Int()) case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: @@ -182,7 +190,7 @@ func (h *valueHelper) asUint64(val interface{}) uint64 { case reflect.Float32, reflect.Float64: return uint64(v.Float()) default: - //panic("Non numeric value in asUint64()") + // panic("Non numeric value in asUint64()") return 0 } } @@ -192,7 +200,7 @@ func (h *valueHelper) asFloat64(val interface{}) float64 { // Number conversion function for float64, without error checking // (implements an implicit type upgrade). v := reflect.ValueOf(val) - switch v.Kind() { + switch v.Kind() { //nolint:exhaustive case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return float64(v.Int()) case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: @@ -200,7 +208,7 @@ func (h *valueHelper) asFloat64(val interface{}) float64 { case reflect.Float32, reflect.Float64: return v.Float() default: - //panic("Non numeric value in asFloat64()") + // panic("Non numeric value in asFloat64()") return 0 } } @@ -210,12 +218,12 @@ type paramHelper struct { } func (h *paramHelper) safeExpandedParamsFor(path, method, operationID string, res *Result, s *SpecValidator) (params []spec.Parameter) { - operation, ok := s.analyzer.OperationFor(method, path) + operation, ok := s.expandedAnalyzer().OperationFor(method, path) if ok { // expand parameters first if necessary resolvedParams := []spec.Parameter{} for _, ppr := range operation.Parameters { - resolvedParam, red := h.resolveParam(path, method, operationID, &ppr, s) + resolvedParam, red := h.resolveParam(path, method, operationID, &ppr, s) //#nosec res.Merge(red) if resolvedParam != nil { resolvedParams = append(resolvedParams, *resolvedParam) @@ -224,8 +232,8 @@ func (h *paramHelper) safeExpandedParamsFor(path, method, operationID string, re // remove params with invalid expansion from Slice operation.Parameters = resolvedParams - for _, ppr := range s.analyzer.SafeParamsFor(method, path, - func(p spec.Parameter, err error) bool { + for _, ppr := range s.expandedAnalyzer().SafeParamsFor(method, path, + func(_ spec.Parameter, err error) bool { // since params have already been expanded, there are few causes for error res.AddErrors(someParametersBrokenMsg(path, method, operationID)) // original error from analyzer @@ -250,7 +258,7 @@ func (h *paramHelper) resolveParam(path, method, operationID string, param *spec } if err != nil { // Safeguard - // NOTE: we may enter enter here when the whole parameter is an unresolved $ref + // NOTE: we may enter here when the whole parameter is an unresolved $ref refPath := strings.Join([]string{"\"" + path + "\"", method}, ".") errorHelp.addPointerError(res, err, param.Ref.String(), refPath) return nil, res @@ -306,6 +314,7 @@ func (r *responseHelper) expandResponseRef( errorHelp.addPointerError(res, err, response.Ref.String(), path) return nil, res } + return response, res } diff --git a/vendor/github.com/go-openapi/validate/object_validator.go b/vendor/github.com/go-openapi/validate/object_validator.go index b413ab1fa3..dff73fa98a 100644 --- a/vendor/github.com/go-openapi/validate/object_validator.go +++ b/vendor/github.com/go-openapi/validate/object_validator.go @@ -15,8 +15,8 @@ package validate import ( + "fmt" "reflect" - "regexp" "strings" "github.com/go-openapi/errors" @@ -35,62 +35,116 @@ type objectValidator struct { PatternProperties map[string]spec.Schema Root interface{} KnownFormats strfmt.Registry - Options SchemaValidatorOptions + Options *SchemaValidatorOptions + splitPath []string +} + +func newObjectValidator(path, in string, + maxProperties, minProperties *int64, required []string, properties spec.SchemaProperties, + additionalProperties *spec.SchemaOrBool, patternProperties spec.SchemaProperties, + root interface{}, formats strfmt.Registry, opts *SchemaValidatorOptions) *objectValidator { + if opts == nil { + opts = new(SchemaValidatorOptions) + } + + var v *objectValidator + if opts.recycleValidators { + v = pools.poolOfObjectValidators.BorrowValidator() + } else { + v = new(objectValidator) + } + + v.Path = path + v.In = in + v.MaxProperties = maxProperties + v.MinProperties = minProperties + v.Required = required + v.Properties = properties + v.AdditionalProperties = additionalProperties + v.PatternProperties = patternProperties + v.Root = root + v.KnownFormats = formats + v.Options = opts + v.splitPath = strings.Split(v.Path, ".") + + return v } func (o *objectValidator) SetPath(path string) { o.Path = path + o.splitPath = strings.Split(path, ".") } func (o *objectValidator) Applies(source interface{}, kind reflect.Kind) bool { // TODO: this should also work for structs // there is a problem in the type validator where it will be unhappy about null values // so that requires more testing - r := reflect.TypeOf(source) == specSchemaType && (kind == reflect.Map || kind == reflect.Struct) - debugLog("object validator for %q applies %t for %T (kind: %v)\n", o.Path, r, source, kind) - return r + _, isSchema := source.(*spec.Schema) + return isSchema && (kind == reflect.Map || kind == reflect.Struct) } func (o *objectValidator) isProperties() bool { - p := strings.Split(o.Path, ".") + p := o.splitPath return len(p) > 1 && p[len(p)-1] == jsonProperties && p[len(p)-2] != jsonProperties } func (o *objectValidator) isDefault() bool { - p := strings.Split(o.Path, ".") + p := o.splitPath return len(p) > 1 && p[len(p)-1] == jsonDefault && p[len(p)-2] != jsonDefault } func (o *objectValidator) isExample() bool { - p := strings.Split(o.Path, ".") + p := o.splitPath return len(p) > 1 && (p[len(p)-1] == swaggerExample || p[len(p)-1] == swaggerExamples) && p[len(p)-2] != swaggerExample } func (o *objectValidator) checkArrayMustHaveItems(res *Result, val map[string]interface{}) { // for swagger 2.0 schemas, there is an additional constraint to have array items defined explicitly. // with pure jsonschema draft 4, one may have arrays with undefined items (i.e. any type). - if t, typeFound := val[jsonType]; typeFound { - if tpe, ok := t.(string); ok && tpe == arrayType { - if item, itemsKeyFound := val[jsonItems]; !itemsKeyFound { - res.AddErrors(errors.Required(jsonItems, o.Path, item)) - } - } + if val == nil { + return + } + + t, typeFound := val[jsonType] + if !typeFound { + return + } + + tpe, isString := t.(string) + if !isString || tpe != arrayType { + return + } + + item, itemsKeyFound := val[jsonItems] + if itemsKeyFound { + return } + + res.AddErrors(errors.Required(jsonItems, o.Path, item)) } func (o *objectValidator) checkItemsMustBeTypeArray(res *Result, val map[string]interface{}) { - if !o.isProperties() && !o.isDefault() && !o.isExample() { - if _, itemsKeyFound := val[jsonItems]; itemsKeyFound { - t, typeFound := val[jsonType] - if typeFound { - if tpe, ok := t.(string); !ok || tpe != arrayType { - res.AddErrors(errors.InvalidType(o.Path, o.In, arrayType, nil)) - } - } else { - // there is no type - res.AddErrors(errors.Required(jsonType, o.Path, t)) - } - } + if val == nil { + return + } + + if o.isProperties() || o.isDefault() || o.isExample() { + return + } + + _, itemsKeyFound := val[jsonItems] + if !itemsKeyFound { + return + } + + t, typeFound := val[jsonType] + if !typeFound { + // there is no type + res.AddErrors(errors.Required(jsonType, o.Path, t)) + } + + if tpe, isString := t.(string); !isString || tpe != arrayType { + res.AddErrors(errors.InvalidType(o.Path, o.In, arrayType, nil)) } } @@ -104,176 +158,274 @@ func (o *objectValidator) precheck(res *Result, val map[string]interface{}) { } func (o *objectValidator) Validate(data interface{}) *Result { - val := data.(map[string]interface{}) - // TODO: guard against nil data + if o.Options.recycleValidators { + defer func() { + o.redeem() + }() + } + + var val map[string]interface{} + if data != nil { + var ok bool + val, ok = data.(map[string]interface{}) + if !ok { + return errorHelp.sErr(invalidObjectMsg(o.Path, o.In), o.Options.recycleResult) + } + } numKeys := int64(len(val)) if o.MinProperties != nil && numKeys < *o.MinProperties { - return errorHelp.sErr(errors.TooFewProperties(o.Path, o.In, *o.MinProperties)) + return errorHelp.sErr(errors.TooFewProperties(o.Path, o.In, *o.MinProperties), o.Options.recycleResult) } if o.MaxProperties != nil && numKeys > *o.MaxProperties { - return errorHelp.sErr(errors.TooManyProperties(o.Path, o.In, *o.MaxProperties)) + return errorHelp.sErr(errors.TooManyProperties(o.Path, o.In, *o.MaxProperties), o.Options.recycleResult) } - res := new(Result) + var res *Result + if o.Options.recycleResult { + res = pools.poolOfResults.BorrowResult() + } else { + res = new(Result) + } o.precheck(res, val) // check validity of field names if o.AdditionalProperties != nil && !o.AdditionalProperties.Allows { // Case: additionalProperties: false - for k := range val { - _, regularProperty := o.Properties[k] - matched := false - - for pk := range o.PatternProperties { - if matches, _ := regexp.MatchString(pk, k); matches { - matched = true - break - } + o.validateNoAdditionalProperties(val, res) + } else { + // Cases: empty additionalProperties (implying: true), or additionalProperties: true, or additionalProperties: { <> } + o.validateAdditionalProperties(val, res) + } + + o.validatePropertiesSchema(val, res) + + // Check patternProperties + // TODO: it looks like we have done that twice in many cases + for key, value := range val { + _, regularProperty := o.Properties[key] + matched, _, patterns := o.validatePatternProperty(key, value, res) // applies to regular properties as well + if regularProperty || !matched { + continue + } + + for _, pName := range patterns { + if v, ok := o.PatternProperties[pName]; ok { + r := newSchemaValidator(&v, o.Root, o.Path+"."+key, o.KnownFormats, o.Options).Validate(value) + res.mergeForField(data.(map[string]interface{}), key, r) } + } + } - if !regularProperty && k != "$schema" && k != "id" && !matched { - // Special properties "$schema" and "id" are ignored - res.AddErrors(errors.PropertyNotAllowed(o.Path, o.In, k)) - - // BUG(fredbi): This section should move to a part dedicated to spec validation as - // it will conflict with regular schemas where a property "headers" is defined. - - // - // Croaks a more explicit message on top of the standard one - // on some recognized cases. - // - // NOTE: edge cases with invalid type assertion are simply ignored here. - // NOTE: prefix your messages here by "IMPORTANT!" so there are not filtered - // by higher level callers (the IMPORTANT! tag will be eventually - // removed). - if k == "headers" && val[k] != nil { - // $ref is forbidden in header - if headers, mapOk := val[k].(map[string]interface{}); mapOk { - for headerKey, headerBody := range headers { - if headerBody != nil { - if headerSchema, mapOfMapOk := headerBody.(map[string]interface{}); mapOfMapOk { - if _, found := headerSchema["$ref"]; found { - var msg string - if refString, stringOk := headerSchema["$ref"].(string); stringOk { - msg = strings.Join([]string{", one may not use $ref=\":", refString, "\""}, "") - } - res.AddErrors(refNotAllowedInHeaderMsg(o.Path, headerKey, msg)) - } - } - } - } - } - /* - case "$ref": - if val[k] != nil { - // TODO: check context of that ref: warn about siblings, check against invalid context - } - */ - } + return res +} + +func (o *objectValidator) validateNoAdditionalProperties(val map[string]interface{}, res *Result) { + for k := range val { + if k == "$schema" || k == "id" { + // special properties "$schema" and "id" are ignored + continue + } + + _, regularProperty := o.Properties[k] + if regularProperty { + continue + } + + matched := false + for pk := range o.PatternProperties { + re, err := compileRegexp(pk) + if err != nil { + continue + } + if matches := re.MatchString(k); matches { + matched = true + break } } - } else { - // Cases: no additionalProperties (implying: true), or additionalProperties: true, or additionalProperties: { <> } - for key, value := range val { - _, regularProperty := o.Properties[key] - - // Validates property against "patternProperties" if applicable - // BUG(fredbi): succeededOnce is always false - - // NOTE: how about regular properties which do not match patternProperties? - matched, succeededOnce, _ := o.validatePatternProperty(key, value, res) - - if !(regularProperty || matched || succeededOnce) { - - // Cases: properties which are not regular properties and have not been matched by the PatternProperties validator - if o.AdditionalProperties != nil && o.AdditionalProperties.Schema != nil { - // AdditionalProperties as Schema - r := NewSchemaValidator(o.AdditionalProperties.Schema, o.Root, o.Path+"."+key, o.KnownFormats, o.Options.Options()...).Validate(value) - res.mergeForField(data.(map[string]interface{}), key, r) - } else if regularProperty && !(matched || succeededOnce) { - // TODO: this is dead code since regularProperty=false here - res.AddErrors(errors.FailedAllPatternProperties(o.Path, o.In, key)) - } + if matched { + continue + } + + res.AddErrors(errors.PropertyNotAllowed(o.Path, o.In, k)) + + // BUG(fredbi): This section should move to a part dedicated to spec validation as + // it will conflict with regular schemas where a property "headers" is defined. + + // + // Croaks a more explicit message on top of the standard one + // on some recognized cases. + // + // NOTE: edge cases with invalid type assertion are simply ignored here. + // NOTE: prefix your messages here by "IMPORTANT!" so there are not filtered + // by higher level callers (the IMPORTANT! tag will be eventually + // removed). + if k != "headers" || val[k] == nil { + continue + } + + // $ref is forbidden in header + headers, mapOk := val[k].(map[string]interface{}) + if !mapOk { + continue + } + + for headerKey, headerBody := range headers { + if headerBody == nil { + continue + } + + headerSchema, mapOfMapOk := headerBody.(map[string]interface{}) + if !mapOfMapOk { + continue + } + + _, found := headerSchema["$ref"] + if !found { + continue + } + + refString, stringOk := headerSchema["$ref"].(string) + if !stringOk { + continue } + + msg := strings.Join([]string{", one may not use $ref=\":", refString, "\""}, "") + res.AddErrors(refNotAllowedInHeaderMsg(o.Path, headerKey, msg)) + /* + case "$ref": + if val[k] != nil { + // TODO: check context of that ref: warn about siblings, check against invalid context + } + */ + } + } +} + +func (o *objectValidator) validateAdditionalProperties(val map[string]interface{}, res *Result) { + for key, value := range val { + _, regularProperty := o.Properties[key] + if regularProperty { + continue + } + + // Validates property against "patternProperties" if applicable + // BUG(fredbi): succeededOnce is always false + + // NOTE: how about regular properties which do not match patternProperties? + matched, succeededOnce, _ := o.validatePatternProperty(key, value, res) + if matched || succeededOnce { + continue + } + + if o.AdditionalProperties == nil || o.AdditionalProperties.Schema == nil { + continue } - // Valid cases: additionalProperties: true or undefined + + // Cases: properties which are not regular properties and have not been matched by the PatternProperties validator + // AdditionalProperties as Schema + r := newSchemaValidator(o.AdditionalProperties.Schema, o.Root, o.Path+"."+key, o.KnownFormats, o.Options).Validate(value) + res.mergeForField(val, key, r) } + // Valid cases: additionalProperties: true or undefined +} - createdFromDefaults := map[string]bool{} +func (o *objectValidator) validatePropertiesSchema(val map[string]interface{}, res *Result) { + createdFromDefaults := map[string]struct{}{} // Property types: // - regular Property + pSchema := pools.poolOfSchemas.BorrowSchema() // recycle a spec.Schema object which lifespan extends only to the validation of properties + defer func() { + pools.poolOfSchemas.RedeemSchema(pSchema) + }() + for pName := range o.Properties { - pSchema := o.Properties[pName] // one instance per iteration - rName := pName - if o.Path != "" { + *pSchema = o.Properties[pName] + var rName string + if o.Path == "" { + rName = pName + } else { rName = o.Path + "." + pName } // Recursively validates each property against its schema - if v, ok := val[pName]; ok { - r := NewSchemaValidator(&pSchema, o.Root, rName, o.KnownFormats, o.Options.Options()...).Validate(v) - res.mergeForField(data.(map[string]interface{}), pName, r) - } else if pSchema.Default != nil { - // If a default value is defined, creates the property from defaults - // NOTE: JSON schema does not enforce default values to be valid against schema. Swagger does. - createdFromDefaults[pName] = true - res.addPropertySchemata(data.(map[string]interface{}), pName, &pSchema) + v, ok := val[pName] + if ok { + r := newSchemaValidator(pSchema, o.Root, rName, o.KnownFormats, o.Options).Validate(v) + res.mergeForField(val, pName, r) + + continue } - } - // Check required properties - if len(o.Required) > 0 { - for _, k := range o.Required { - if v, ok := val[k]; !ok && !createdFromDefaults[k] { - res.AddErrors(errors.Required(o.Path+"."+k, o.In, v)) - continue + if pSchema.Default != nil { + // if a default value is defined, creates the property from defaults + // NOTE: JSON schema does not enforce default values to be valid against schema. Swagger does. + createdFromDefaults[pName] = struct{}{} + if !o.Options.skipSchemataResult { + res.addPropertySchemata(val, pName, pSchema) // this shallow-clones the content of the pSchema pointer } } } - // Check patternProperties - // TODO: it looks like we have done that twice in many cases - for key, value := range val { - _, regularProperty := o.Properties[key] - matched, _ /*succeededOnce*/, patterns := o.validatePatternProperty(key, value, res) - if !regularProperty && (matched /*|| succeededOnce*/) { - for _, pName := range patterns { - if v, ok := o.PatternProperties[pName]; ok { - r := NewSchemaValidator(&v, o.Root, o.Path+"."+key, o.KnownFormats, o.Options.Options()...).Validate(value) - res.mergeForField(data.(map[string]interface{}), key, r) - } - } + if len(o.Required) == 0 { + return + } + + // Check required properties + for _, k := range o.Required { + v, ok := val[k] + if ok { + continue + } + _, isCreatedFromDefaults := createdFromDefaults[k] + if isCreatedFromDefaults { + continue } + + res.AddErrors(errors.Required(fmt.Sprintf("%s.%s", o.Path, k), o.In, v)) } - return res } // TODO: succeededOnce is not used anywhere func (o *objectValidator) validatePatternProperty(key string, value interface{}, result *Result) (bool, bool, []string) { + if len(o.PatternProperties) == 0 { + return false, false, nil + } + matched := false succeededOnce := false - var patterns []string + patterns := make([]string, 0, len(o.PatternProperties)) - for k, schema := range o.PatternProperties { - sch := schema - if match, _ := regexp.MatchString(k, key); match { - patterns = append(patterns, k) - matched = true - validator := NewSchemaValidator(&sch, o.Root, o.Path+"."+key, o.KnownFormats, o.Options.Options()...) + schema := pools.poolOfSchemas.BorrowSchema() + defer func() { + pools.poolOfSchemas.RedeemSchema(schema) + }() - res := validator.Validate(value) - result.Merge(res) + for k := range o.PatternProperties { + re, err := compileRegexp(k) + if err != nil { + continue } - } - // BUG(fredbi): can't get to here. Should remove dead code (commented out). + match := re.MatchString(key) + if !match { + continue + } - //if succeededOnce { - // result.Inc() - //} + *schema = o.PatternProperties[k] + patterns = append(patterns, k) + matched = true + validator := newSchemaValidator(schema, o.Root, fmt.Sprintf("%s.%s", o.Path, key), o.KnownFormats, o.Options) + + res := validator.Validate(value) + result.Merge(res) + } return matched, succeededOnce, patterns } + +func (o *objectValidator) redeem() { + pools.poolOfObjectValidators.RedeemValidator(o) +} diff --git a/vendor/github.com/go-openapi/validate/options.go b/vendor/github.com/go-openapi/validate/options.go index deeec2f2ec..cfe9b0660f 100644 --- a/vendor/github.com/go-openapi/validate/options.go +++ b/vendor/github.com/go-openapi/validate/options.go @@ -21,10 +21,29 @@ import "sync" // NOTE: other options might be needed, for example a go-swagger specific mode. type Opts struct { ContinueOnErrors bool // true: continue reporting errors, even if spec is invalid + + // StrictPathParamUniqueness enables a strict validation of paths that include + // path parameters. When true, it will enforce that for each method, the path + // is unique, regardless of path parameters such that GET:/petstore/{id} and + // GET:/petstore/{pet} anre considered duplicate paths. + // + // Consider disabling if path parameters can include slashes such as + // GET:/v1/{shelve} and GET:/v1/{book}, where the IDs are "shelve/*" and + // /"shelve/*/book/*" respectively. + StrictPathParamUniqueness bool + SkipSchemataResult bool } var ( - defaultOpts = Opts{ContinueOnErrors: false} // default is to stop validation on errors + defaultOpts = Opts{ + // default is to stop validation on errors + ContinueOnErrors: false, + + // StrictPathParamUniqueness is defaulted to true. This maintains existing + // behavior. + StrictPathParamUniqueness: true, + } + defaultOptsMutex = &sync.Mutex{} ) diff --git a/vendor/github.com/go-openapi/validate/pools.go b/vendor/github.com/go-openapi/validate/pools.go new file mode 100644 index 0000000000..3ddce4dcc2 --- /dev/null +++ b/vendor/github.com/go-openapi/validate/pools.go @@ -0,0 +1,366 @@ +//go:build !validatedebug + +package validate + +import ( + "sync" + + "github.com/go-openapi/spec" +) + +var pools allPools + +func init() { + resetPools() +} + +func resetPools() { + // NOTE: for testing purpose, we might want to reset pools after calling Validate twice. + // The pool is corrupted in that case: calling Put twice inserts a duplicate in the pool + // and further calls to Get are mishandled. + + pools = allPools{ + poolOfSchemaValidators: schemaValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &SchemaValidator{} + + return s + }, + }, + }, + poolOfObjectValidators: objectValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &objectValidator{} + + return s + }, + }, + }, + poolOfSliceValidators: sliceValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &schemaSliceValidator{} + + return s + }, + }, + }, + poolOfItemsValidators: itemsValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &itemsValidator{} + + return s + }, + }, + }, + poolOfBasicCommonValidators: basicCommonValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &basicCommonValidator{} + + return s + }, + }, + }, + poolOfHeaderValidators: headerValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &HeaderValidator{} + + return s + }, + }, + }, + poolOfParamValidators: paramValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &ParamValidator{} + + return s + }, + }, + }, + poolOfBasicSliceValidators: basicSliceValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &basicSliceValidator{} + + return s + }, + }, + }, + poolOfNumberValidators: numberValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &numberValidator{} + + return s + }, + }, + }, + poolOfStringValidators: stringValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &stringValidator{} + + return s + }, + }, + }, + poolOfSchemaPropsValidators: schemaPropsValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &schemaPropsValidator{} + + return s + }, + }, + }, + poolOfFormatValidators: formatValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &formatValidator{} + + return s + }, + }, + }, + poolOfTypeValidators: typeValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &typeValidator{} + + return s + }, + }, + }, + poolOfSchemas: schemasPool{ + Pool: &sync.Pool{ + New: func() any { + s := &spec.Schema{} + + return s + }, + }, + }, + poolOfResults: resultsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &Result{} + + return s + }, + }, + }, + } +} + +type ( + allPools struct { + // memory pools for all validator objects. + // + // Each pool can be borrowed from and redeemed to. + poolOfSchemaValidators schemaValidatorsPool + poolOfObjectValidators objectValidatorsPool + poolOfSliceValidators sliceValidatorsPool + poolOfItemsValidators itemsValidatorsPool + poolOfBasicCommonValidators basicCommonValidatorsPool + poolOfHeaderValidators headerValidatorsPool + poolOfParamValidators paramValidatorsPool + poolOfBasicSliceValidators basicSliceValidatorsPool + poolOfNumberValidators numberValidatorsPool + poolOfStringValidators stringValidatorsPool + poolOfSchemaPropsValidators schemaPropsValidatorsPool + poolOfFormatValidators formatValidatorsPool + poolOfTypeValidators typeValidatorsPool + poolOfSchemas schemasPool + poolOfResults resultsPool + } + + schemaValidatorsPool struct { + *sync.Pool + } + + objectValidatorsPool struct { + *sync.Pool + } + + sliceValidatorsPool struct { + *sync.Pool + } + + itemsValidatorsPool struct { + *sync.Pool + } + + basicCommonValidatorsPool struct { + *sync.Pool + } + + headerValidatorsPool struct { + *sync.Pool + } + + paramValidatorsPool struct { + *sync.Pool + } + + basicSliceValidatorsPool struct { + *sync.Pool + } + + numberValidatorsPool struct { + *sync.Pool + } + + stringValidatorsPool struct { + *sync.Pool + } + + schemaPropsValidatorsPool struct { + *sync.Pool + } + + formatValidatorsPool struct { + *sync.Pool + } + + typeValidatorsPool struct { + *sync.Pool + } + + schemasPool struct { + *sync.Pool + } + + resultsPool struct { + *sync.Pool + } +) + +func (p schemaValidatorsPool) BorrowValidator() *SchemaValidator { + return p.Get().(*SchemaValidator) +} + +func (p schemaValidatorsPool) RedeemValidator(s *SchemaValidator) { + // NOTE: s might be nil. In that case, Put is a noop. + p.Put(s) +} + +func (p objectValidatorsPool) BorrowValidator() *objectValidator { + return p.Get().(*objectValidator) +} + +func (p objectValidatorsPool) RedeemValidator(s *objectValidator) { + p.Put(s) +} + +func (p sliceValidatorsPool) BorrowValidator() *schemaSliceValidator { + return p.Get().(*schemaSliceValidator) +} + +func (p sliceValidatorsPool) RedeemValidator(s *schemaSliceValidator) { + p.Put(s) +} + +func (p itemsValidatorsPool) BorrowValidator() *itemsValidator { + return p.Get().(*itemsValidator) +} + +func (p itemsValidatorsPool) RedeemValidator(s *itemsValidator) { + p.Put(s) +} + +func (p basicCommonValidatorsPool) BorrowValidator() *basicCommonValidator { + return p.Get().(*basicCommonValidator) +} + +func (p basicCommonValidatorsPool) RedeemValidator(s *basicCommonValidator) { + p.Put(s) +} + +func (p headerValidatorsPool) BorrowValidator() *HeaderValidator { + return p.Get().(*HeaderValidator) +} + +func (p headerValidatorsPool) RedeemValidator(s *HeaderValidator) { + p.Put(s) +} + +func (p paramValidatorsPool) BorrowValidator() *ParamValidator { + return p.Get().(*ParamValidator) +} + +func (p paramValidatorsPool) RedeemValidator(s *ParamValidator) { + p.Put(s) +} + +func (p basicSliceValidatorsPool) BorrowValidator() *basicSliceValidator { + return p.Get().(*basicSliceValidator) +} + +func (p basicSliceValidatorsPool) RedeemValidator(s *basicSliceValidator) { + p.Put(s) +} + +func (p numberValidatorsPool) BorrowValidator() *numberValidator { + return p.Get().(*numberValidator) +} + +func (p numberValidatorsPool) RedeemValidator(s *numberValidator) { + p.Put(s) +} + +func (p stringValidatorsPool) BorrowValidator() *stringValidator { + return p.Get().(*stringValidator) +} + +func (p stringValidatorsPool) RedeemValidator(s *stringValidator) { + p.Put(s) +} + +func (p schemaPropsValidatorsPool) BorrowValidator() *schemaPropsValidator { + return p.Get().(*schemaPropsValidator) +} + +func (p schemaPropsValidatorsPool) RedeemValidator(s *schemaPropsValidator) { + p.Put(s) +} + +func (p formatValidatorsPool) BorrowValidator() *formatValidator { + return p.Get().(*formatValidator) +} + +func (p formatValidatorsPool) RedeemValidator(s *formatValidator) { + p.Put(s) +} + +func (p typeValidatorsPool) BorrowValidator() *typeValidator { + return p.Get().(*typeValidator) +} + +func (p typeValidatorsPool) RedeemValidator(s *typeValidator) { + p.Put(s) +} + +func (p schemasPool) BorrowSchema() *spec.Schema { + return p.Get().(*spec.Schema) +} + +func (p schemasPool) RedeemSchema(s *spec.Schema) { + p.Put(s) +} + +func (p resultsPool) BorrowResult() *Result { + return p.Get().(*Result).cleared() +} + +func (p resultsPool) RedeemResult(s *Result) { + if s == emptyResult { + return + } + p.Put(s) +} diff --git a/vendor/github.com/go-openapi/validate/pools_debug.go b/vendor/github.com/go-openapi/validate/pools_debug.go new file mode 100644 index 0000000000..12949f02a7 --- /dev/null +++ b/vendor/github.com/go-openapi/validate/pools_debug.go @@ -0,0 +1,1012 @@ +//go:build validatedebug + +package validate + +import ( + "fmt" + "runtime" + "sync" + "testing" + + "github.com/go-openapi/spec" +) + +// This version of the pools is to be used for debugging and testing, with build tag "validatedebug". +// +// In this mode, the pools are tracked for allocation and redemption of borrowed objects, so we can +// verify a few behaviors of the validators. The debug pools panic when an invalid usage pattern is detected. + +var pools allPools + +func init() { + resetPools() +} + +func resetPools() { + // NOTE: for testing purpose, we might want to reset pools after calling Validate twice. + // The pool is corrupted in that case: calling Put twice inserts a duplicate in the pool + // and further calls to Get are mishandled. + + pools = allPools{ + poolOfSchemaValidators: schemaValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &SchemaValidator{} + + return s + }, + }, + debugMap: make(map[*SchemaValidator]status), + allocMap: make(map[*SchemaValidator]string), + redeemMap: make(map[*SchemaValidator]string), + }, + poolOfObjectValidators: objectValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &objectValidator{} + + return s + }, + }, + debugMap: make(map[*objectValidator]status), + allocMap: make(map[*objectValidator]string), + redeemMap: make(map[*objectValidator]string), + }, + poolOfSliceValidators: sliceValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &schemaSliceValidator{} + + return s + }, + }, + debugMap: make(map[*schemaSliceValidator]status), + allocMap: make(map[*schemaSliceValidator]string), + redeemMap: make(map[*schemaSliceValidator]string), + }, + poolOfItemsValidators: itemsValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &itemsValidator{} + + return s + }, + }, + debugMap: make(map[*itemsValidator]status), + allocMap: make(map[*itemsValidator]string), + redeemMap: make(map[*itemsValidator]string), + }, + poolOfBasicCommonValidators: basicCommonValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &basicCommonValidator{} + + return s + }, + }, + debugMap: make(map[*basicCommonValidator]status), + allocMap: make(map[*basicCommonValidator]string), + redeemMap: make(map[*basicCommonValidator]string), + }, + poolOfHeaderValidators: headerValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &HeaderValidator{} + + return s + }, + }, + debugMap: make(map[*HeaderValidator]status), + allocMap: make(map[*HeaderValidator]string), + redeemMap: make(map[*HeaderValidator]string), + }, + poolOfParamValidators: paramValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &ParamValidator{} + + return s + }, + }, + debugMap: make(map[*ParamValidator]status), + allocMap: make(map[*ParamValidator]string), + redeemMap: make(map[*ParamValidator]string), + }, + poolOfBasicSliceValidators: basicSliceValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &basicSliceValidator{} + + return s + }, + }, + debugMap: make(map[*basicSliceValidator]status), + allocMap: make(map[*basicSliceValidator]string), + redeemMap: make(map[*basicSliceValidator]string), + }, + poolOfNumberValidators: numberValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &numberValidator{} + + return s + }, + }, + debugMap: make(map[*numberValidator]status), + allocMap: make(map[*numberValidator]string), + redeemMap: make(map[*numberValidator]string), + }, + poolOfStringValidators: stringValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &stringValidator{} + + return s + }, + }, + debugMap: make(map[*stringValidator]status), + allocMap: make(map[*stringValidator]string), + redeemMap: make(map[*stringValidator]string), + }, + poolOfSchemaPropsValidators: schemaPropsValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &schemaPropsValidator{} + + return s + }, + }, + debugMap: make(map[*schemaPropsValidator]status), + allocMap: make(map[*schemaPropsValidator]string), + redeemMap: make(map[*schemaPropsValidator]string), + }, + poolOfFormatValidators: formatValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &formatValidator{} + + return s + }, + }, + debugMap: make(map[*formatValidator]status), + allocMap: make(map[*formatValidator]string), + redeemMap: make(map[*formatValidator]string), + }, + poolOfTypeValidators: typeValidatorsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &typeValidator{} + + return s + }, + }, + debugMap: make(map[*typeValidator]status), + allocMap: make(map[*typeValidator]string), + redeemMap: make(map[*typeValidator]string), + }, + poolOfSchemas: schemasPool{ + Pool: &sync.Pool{ + New: func() any { + s := &spec.Schema{} + + return s + }, + }, + debugMap: make(map[*spec.Schema]status), + allocMap: make(map[*spec.Schema]string), + redeemMap: make(map[*spec.Schema]string), + }, + poolOfResults: resultsPool{ + Pool: &sync.Pool{ + New: func() any { + s := &Result{} + + return s + }, + }, + debugMap: make(map[*Result]status), + allocMap: make(map[*Result]string), + redeemMap: make(map[*Result]string), + }, + } +} + +const ( + statusFresh status = iota + 1 + statusRecycled + statusRedeemed +) + +func (s status) String() string { + switch s { + case statusFresh: + return "fresh" + case statusRecycled: + return "recycled" + case statusRedeemed: + return "redeemed" + default: + panic(fmt.Errorf("invalid status: %d", s)) + } +} + +type ( + // Debug + status uint8 + + allPools struct { + // memory pools for all validator objects. + // + // Each pool can be borrowed from and redeemed to. + poolOfSchemaValidators schemaValidatorsPool + poolOfObjectValidators objectValidatorsPool + poolOfSliceValidators sliceValidatorsPool + poolOfItemsValidators itemsValidatorsPool + poolOfBasicCommonValidators basicCommonValidatorsPool + poolOfHeaderValidators headerValidatorsPool + poolOfParamValidators paramValidatorsPool + poolOfBasicSliceValidators basicSliceValidatorsPool + poolOfNumberValidators numberValidatorsPool + poolOfStringValidators stringValidatorsPool + poolOfSchemaPropsValidators schemaPropsValidatorsPool + poolOfFormatValidators formatValidatorsPool + poolOfTypeValidators typeValidatorsPool + poolOfSchemas schemasPool + poolOfResults resultsPool + } + + schemaValidatorsPool struct { + *sync.Pool + debugMap map[*SchemaValidator]status + allocMap map[*SchemaValidator]string + redeemMap map[*SchemaValidator]string + mx sync.Mutex + } + + objectValidatorsPool struct { + *sync.Pool + debugMap map[*objectValidator]status + allocMap map[*objectValidator]string + redeemMap map[*objectValidator]string + mx sync.Mutex + } + + sliceValidatorsPool struct { + *sync.Pool + debugMap map[*schemaSliceValidator]status + allocMap map[*schemaSliceValidator]string + redeemMap map[*schemaSliceValidator]string + mx sync.Mutex + } + + itemsValidatorsPool struct { + *sync.Pool + debugMap map[*itemsValidator]status + allocMap map[*itemsValidator]string + redeemMap map[*itemsValidator]string + mx sync.Mutex + } + + basicCommonValidatorsPool struct { + *sync.Pool + debugMap map[*basicCommonValidator]status + allocMap map[*basicCommonValidator]string + redeemMap map[*basicCommonValidator]string + mx sync.Mutex + } + + headerValidatorsPool struct { + *sync.Pool + debugMap map[*HeaderValidator]status + allocMap map[*HeaderValidator]string + redeemMap map[*HeaderValidator]string + mx sync.Mutex + } + + paramValidatorsPool struct { + *sync.Pool + debugMap map[*ParamValidator]status + allocMap map[*ParamValidator]string + redeemMap map[*ParamValidator]string + mx sync.Mutex + } + + basicSliceValidatorsPool struct { + *sync.Pool + debugMap map[*basicSliceValidator]status + allocMap map[*basicSliceValidator]string + redeemMap map[*basicSliceValidator]string + mx sync.Mutex + } + + numberValidatorsPool struct { + *sync.Pool + debugMap map[*numberValidator]status + allocMap map[*numberValidator]string + redeemMap map[*numberValidator]string + mx sync.Mutex + } + + stringValidatorsPool struct { + *sync.Pool + debugMap map[*stringValidator]status + allocMap map[*stringValidator]string + redeemMap map[*stringValidator]string + mx sync.Mutex + } + + schemaPropsValidatorsPool struct { + *sync.Pool + debugMap map[*schemaPropsValidator]status + allocMap map[*schemaPropsValidator]string + redeemMap map[*schemaPropsValidator]string + mx sync.Mutex + } + + formatValidatorsPool struct { + *sync.Pool + debugMap map[*formatValidator]status + allocMap map[*formatValidator]string + redeemMap map[*formatValidator]string + mx sync.Mutex + } + + typeValidatorsPool struct { + *sync.Pool + debugMap map[*typeValidator]status + allocMap map[*typeValidator]string + redeemMap map[*typeValidator]string + mx sync.Mutex + } + + schemasPool struct { + *sync.Pool + debugMap map[*spec.Schema]status + allocMap map[*spec.Schema]string + redeemMap map[*spec.Schema]string + mx sync.Mutex + } + + resultsPool struct { + *sync.Pool + debugMap map[*Result]status + allocMap map[*Result]string + redeemMap map[*Result]string + mx sync.Mutex + } +) + +func (p *schemaValidatorsPool) BorrowValidator() *SchemaValidator { + s := p.Get().(*SchemaValidator) + + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + p.debugMap[s] = statusFresh + } else { + if x != statusRedeemed { + panic("recycled schema should have been redeemed") + } + p.debugMap[s] = statusRecycled + } + p.allocMap[s] = caller() + + return s +} + +func (p *schemaValidatorsPool) RedeemValidator(s *SchemaValidator) { + // NOTE: s might be nil. In that case, Put is a noop. + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + panic("redeemed schema should have been allocated") + } + if x != statusRecycled && x != statusFresh { + panic("redeemed schema should have been allocated from a fresh or recycled pointer") + } + p.debugMap[s] = statusRedeemed + p.redeemMap[s] = caller() + p.Put(s) +} + +func (p *objectValidatorsPool) BorrowValidator() *objectValidator { + s := p.Get().(*objectValidator) + + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + p.debugMap[s] = statusFresh + } else { + if x != statusRedeemed { + panic("recycled object should have been redeemed") + } + p.debugMap[s] = statusRecycled + } + p.allocMap[s] = caller() + + return s +} + +func (p *objectValidatorsPool) RedeemValidator(s *objectValidator) { + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + panic("redeemed object should have been allocated") + } + if x != statusRecycled && x != statusFresh { + panic("redeemed object should have been allocated from a fresh or recycled pointer") + } + p.debugMap[s] = statusRedeemed + p.redeemMap[s] = caller() + p.Put(s) +} + +func (p *sliceValidatorsPool) BorrowValidator() *schemaSliceValidator { + s := p.Get().(*schemaSliceValidator) + + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + p.debugMap[s] = statusFresh + } else { + if x != statusRedeemed { + panic("recycled schemaSliceValidator should have been redeemed") + } + p.debugMap[s] = statusRecycled + } + p.allocMap[s] = caller() + + return s +} + +func (p *sliceValidatorsPool) RedeemValidator(s *schemaSliceValidator) { + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + panic("redeemed schemaSliceValidator should have been allocated") + } + if x != statusRecycled && x != statusFresh { + panic("redeemed schemaSliceValidator should have been allocated from a fresh or recycled pointer") + } + p.debugMap[s] = statusRedeemed + p.redeemMap[s] = caller() + p.Put(s) +} + +func (p *itemsValidatorsPool) BorrowValidator() *itemsValidator { + s := p.Get().(*itemsValidator) + + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + p.debugMap[s] = statusFresh + } else { + if x != statusRedeemed { + panic("recycled itemsValidator should have been redeemed") + } + p.debugMap[s] = statusRecycled + } + p.allocMap[s] = caller() + + return s +} + +func (p *itemsValidatorsPool) RedeemValidator(s *itemsValidator) { + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + panic("redeemed itemsValidator should have been allocated") + } + if x != statusRecycled && x != statusFresh { + panic("redeemed itemsValidator should have been allocated from a fresh or recycled pointer") + } + p.debugMap[s] = statusRedeemed + p.redeemMap[s] = caller() + p.Put(s) +} + +func (p *basicCommonValidatorsPool) BorrowValidator() *basicCommonValidator { + s := p.Get().(*basicCommonValidator) + + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + p.debugMap[s] = statusFresh + } else { + if x != statusRedeemed { + panic("recycled basicCommonValidator should have been redeemed") + } + p.debugMap[s] = statusRecycled + } + p.allocMap[s] = caller() + + return s +} + +func (p *basicCommonValidatorsPool) RedeemValidator(s *basicCommonValidator) { + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + panic("redeemed basicCommonValidator should have been allocated") + } + if x != statusRecycled && x != statusFresh { + panic("redeemed basicCommonValidator should have been allocated from a fresh or recycled pointer") + } + p.debugMap[s] = statusRedeemed + p.redeemMap[s] = caller() + p.Put(s) +} + +func (p *headerValidatorsPool) BorrowValidator() *HeaderValidator { + s := p.Get().(*HeaderValidator) + + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + p.debugMap[s] = statusFresh + } else { + if x != statusRedeemed { + panic("recycled HeaderValidator should have been redeemed") + } + p.debugMap[s] = statusRecycled + } + p.allocMap[s] = caller() + + return s +} + +func (p *headerValidatorsPool) RedeemValidator(s *HeaderValidator) { + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + panic("redeemed header should have been allocated") + } + if x != statusRecycled && x != statusFresh { + panic("redeemed header should have been allocated from a fresh or recycled pointer") + } + p.debugMap[s] = statusRedeemed + p.redeemMap[s] = caller() + p.Put(s) +} + +func (p *paramValidatorsPool) BorrowValidator() *ParamValidator { + s := p.Get().(*ParamValidator) + + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + p.debugMap[s] = statusFresh + } else { + if x != statusRedeemed { + panic("recycled param should have been redeemed") + } + p.debugMap[s] = statusRecycled + } + p.allocMap[s] = caller() + + return s +} + +func (p *paramValidatorsPool) RedeemValidator(s *ParamValidator) { + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + panic("redeemed param should have been allocated") + } + if x != statusRecycled && x != statusFresh { + panic("redeemed param should have been allocated from a fresh or recycled pointer") + } + p.debugMap[s] = statusRedeemed + p.redeemMap[s] = caller() + p.Put(s) +} + +func (p *basicSliceValidatorsPool) BorrowValidator() *basicSliceValidator { + s := p.Get().(*basicSliceValidator) + + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + p.debugMap[s] = statusFresh + } else { + if x != statusRedeemed { + panic("recycled basicSliceValidator should have been redeemed") + } + p.debugMap[s] = statusRecycled + } + p.allocMap[s] = caller() + + return s +} + +func (p *basicSliceValidatorsPool) RedeemValidator(s *basicSliceValidator) { + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + panic("redeemed basicSliceValidator should have been allocated") + } + if x != statusRecycled && x != statusFresh { + panic("redeemed basicSliceValidator should have been allocated from a fresh or recycled pointer") + } + p.debugMap[s] = statusRedeemed + p.redeemMap[s] = caller() + p.Put(s) +} + +func (p *numberValidatorsPool) BorrowValidator() *numberValidator { + s := p.Get().(*numberValidator) + + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + p.debugMap[s] = statusFresh + } else { + if x != statusRedeemed { + panic("recycled number should have been redeemed") + } + p.debugMap[s] = statusRecycled + } + p.allocMap[s] = caller() + + return s +} + +func (p *numberValidatorsPool) RedeemValidator(s *numberValidator) { + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + panic("redeemed number should have been allocated") + } + if x != statusRecycled && x != statusFresh { + panic("redeemed number should have been allocated from a fresh or recycled pointer") + } + p.debugMap[s] = statusRedeemed + p.redeemMap[s] = caller() + p.Put(s) +} + +func (p *stringValidatorsPool) BorrowValidator() *stringValidator { + s := p.Get().(*stringValidator) + + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + p.debugMap[s] = statusFresh + } else { + if x != statusRedeemed { + panic("recycled string should have been redeemed") + } + p.debugMap[s] = statusRecycled + } + p.allocMap[s] = caller() + + return s +} + +func (p *stringValidatorsPool) RedeemValidator(s *stringValidator) { + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + panic("redeemed string should have been allocated") + } + if x != statusRecycled && x != statusFresh { + panic("redeemed string should have been allocated from a fresh or recycled pointer") + } + p.debugMap[s] = statusRedeemed + p.redeemMap[s] = caller() + p.Put(s) +} + +func (p *schemaPropsValidatorsPool) BorrowValidator() *schemaPropsValidator { + s := p.Get().(*schemaPropsValidator) + + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + p.debugMap[s] = statusFresh + } else { + if x != statusRedeemed { + panic("recycled param should have been redeemed") + } + p.debugMap[s] = statusRecycled + } + p.allocMap[s] = caller() + + return s +} + +func (p *schemaPropsValidatorsPool) RedeemValidator(s *schemaPropsValidator) { + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + panic("redeemed schemaProps should have been allocated") + } + if x != statusRecycled && x != statusFresh { + panic("redeemed schemaProps should have been allocated from a fresh or recycled pointer") + } + p.debugMap[s] = statusRedeemed + p.redeemMap[s] = caller() + p.Put(s) +} + +func (p *formatValidatorsPool) BorrowValidator() *formatValidator { + s := p.Get().(*formatValidator) + + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + p.debugMap[s] = statusFresh + } else { + if x != statusRedeemed { + panic("recycled format should have been redeemed") + } + p.debugMap[s] = statusRecycled + } + p.allocMap[s] = caller() + + return s +} + +func (p *formatValidatorsPool) RedeemValidator(s *formatValidator) { + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + panic("redeemed format should have been allocated") + } + if x != statusRecycled && x != statusFresh { + panic("redeemed format should have been allocated from a fresh or recycled pointer") + } + p.debugMap[s] = statusRedeemed + p.redeemMap[s] = caller() + p.Put(s) +} + +func (p *typeValidatorsPool) BorrowValidator() *typeValidator { + s := p.Get().(*typeValidator) + + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + p.debugMap[s] = statusFresh + } else { + if x != statusRedeemed { + panic("recycled type should have been redeemed") + } + p.debugMap[s] = statusRecycled + } + p.allocMap[s] = caller() + + return s +} + +func (p *typeValidatorsPool) RedeemValidator(s *typeValidator) { + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + panic("redeemed type should have been allocated") + } + if x != statusRecycled && x != statusFresh { + panic(fmt.Errorf("redeemed type should have been allocated from a fresh or recycled pointer. Got status %s, already redeamed at: %s", x, p.redeemMap[s])) + } + p.debugMap[s] = statusRedeemed + p.redeemMap[s] = caller() + p.Put(s) +} + +func (p *schemasPool) BorrowSchema() *spec.Schema { + s := p.Get().(*spec.Schema) + + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + p.debugMap[s] = statusFresh + } else { + if x != statusRedeemed { + panic("recycled spec.Schema should have been redeemed") + } + p.debugMap[s] = statusRecycled + } + p.allocMap[s] = caller() + + return s +} + +func (p *schemasPool) RedeemSchema(s *spec.Schema) { + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + panic("redeemed spec.Schema should have been allocated") + } + if x != statusRecycled && x != statusFresh { + panic("redeemed spec.Schema should have been allocated from a fresh or recycled pointer") + } + p.debugMap[s] = statusRedeemed + p.redeemMap[s] = caller() + p.Put(s) +} + +func (p *resultsPool) BorrowResult() *Result { + s := p.Get().(*Result).cleared() + + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + p.debugMap[s] = statusFresh + } else { + if x != statusRedeemed { + panic("recycled result should have been redeemed") + } + p.debugMap[s] = statusRecycled + } + p.allocMap[s] = caller() + + return s +} + +func (p *resultsPool) RedeemResult(s *Result) { + if s == emptyResult { + if len(s.Errors) > 0 || len(s.Warnings) > 0 { + panic("empty result should not mutate") + } + return + } + p.mx.Lock() + defer p.mx.Unlock() + x, ok := p.debugMap[s] + if !ok { + panic("redeemed Result should have been allocated") + } + if x != statusRecycled && x != statusFresh { + panic("redeemed Result should have been allocated from a fresh or recycled pointer") + } + p.debugMap[s] = statusRedeemed + p.redeemMap[s] = caller() + p.Put(s) +} + +func (p *allPools) allIsRedeemed(t testing.TB) bool { + outcome := true + for k, v := range p.poolOfSchemaValidators.debugMap { + if v == statusRedeemed { + continue + } + t.Logf("schemaValidator should be redeemed. Allocated by: %s", p.poolOfSchemaValidators.allocMap[k]) + outcome = false + } + for k, v := range p.poolOfObjectValidators.debugMap { + if v == statusRedeemed { + continue + } + t.Logf("objectValidator should be redeemed. Allocated by: %s", p.poolOfObjectValidators.allocMap[k]) + outcome = false + } + for k, v := range p.poolOfSliceValidators.debugMap { + if v == statusRedeemed { + continue + } + t.Logf("sliceValidator should be redeemed. Allocated by: %s", p.poolOfSliceValidators.allocMap[k]) + outcome = false + } + for k, v := range p.poolOfItemsValidators.debugMap { + if v == statusRedeemed { + continue + } + t.Logf("itemsValidator should be redeemed. Allocated by: %s", p.poolOfItemsValidators.allocMap[k]) + outcome = false + } + for k, v := range p.poolOfBasicCommonValidators.debugMap { + if v == statusRedeemed { + continue + } + t.Logf("basicCommonValidator should be redeemed. Allocated by: %s", p.poolOfBasicCommonValidators.allocMap[k]) + outcome = false + } + for k, v := range p.poolOfHeaderValidators.debugMap { + if v == statusRedeemed { + continue + } + t.Logf("headerValidator should be redeemed. Allocated by: %s", p.poolOfHeaderValidators.allocMap[k]) + outcome = false + } + for k, v := range p.poolOfParamValidators.debugMap { + if v == statusRedeemed { + continue + } + t.Logf("paramValidator should be redeemed. Allocated by: %s", p.poolOfParamValidators.allocMap[k]) + outcome = false + } + for k, v := range p.poolOfBasicSliceValidators.debugMap { + if v == statusRedeemed { + continue + } + t.Logf("basicSliceValidator should be redeemed. Allocated by: %s", p.poolOfBasicSliceValidators.allocMap[k]) + outcome = false + } + for k, v := range p.poolOfNumberValidators.debugMap { + if v == statusRedeemed { + continue + } + t.Logf("numberValidator should be redeemed. Allocated by: %s", p.poolOfNumberValidators.allocMap[k]) + outcome = false + } + for k, v := range p.poolOfStringValidators.debugMap { + if v == statusRedeemed { + continue + } + t.Logf("stringValidator should be redeemed. Allocated by: %s", p.poolOfStringValidators.allocMap[k]) + outcome = false + } + for k, v := range p.poolOfSchemaPropsValidators.debugMap { + if v == statusRedeemed { + continue + } + t.Logf("schemaPropsValidator should be redeemed. Allocated by: %s", p.poolOfSchemaPropsValidators.allocMap[k]) + outcome = false + } + for k, v := range p.poolOfFormatValidators.debugMap { + if v == statusRedeemed { + continue + } + t.Logf("formatValidator should be redeemed. Allocated by: %s", p.poolOfFormatValidators.allocMap[k]) + outcome = false + } + for k, v := range p.poolOfTypeValidators.debugMap { + if v == statusRedeemed { + continue + } + t.Logf("typeValidator should be redeemed. Allocated by: %s", p.poolOfTypeValidators.allocMap[k]) + outcome = false + } + for k, v := range p.poolOfSchemas.debugMap { + if v == statusRedeemed { + continue + } + t.Logf("schemas should be redeemed. Allocated by: %s", p.poolOfSchemas.allocMap[k]) + outcome = false + } + for k, v := range p.poolOfResults.debugMap { + if v == statusRedeemed { + continue + } + t.Logf("result should be redeemed. Allocated by: %s", p.poolOfResults.allocMap[k]) + outcome = false + } + + return outcome +} + +func caller() string { + pc, _, _, _ := runtime.Caller(3) //nolint:dogsled + from, line := runtime.FuncForPC(pc).FileLine(pc) + + return fmt.Sprintf("%s:%d", from, line) +} diff --git a/vendor/github.com/go-openapi/validate/result.go b/vendor/github.com/go-openapi/validate/result.go index 8f5f935e5d..c80804a93d 100644 --- a/vendor/github.com/go-openapi/validate/result.go +++ b/vendor/github.com/go-openapi/validate/result.go @@ -15,7 +15,7 @@ package validate import ( - "fmt" + stderrors "errors" "reflect" "strings" @@ -23,6 +23,8 @@ import ( "github.com/go-openapi/spec" ) +var emptyResult = &Result{MatchCount: 1} + // Result represents a validation result set, composed of // errors and warnings. // @@ -50,8 +52,10 @@ type Result struct { // Schemata for slice items itemSchemata []itemSchemata - cachedFieldSchemta map[FieldKey][]*spec.Schema - cachedItemSchemata map[ItemKey][]*spec.Schema + cachedFieldSchemata map[FieldKey][]*spec.Schema + cachedItemSchemata map[ItemKey][]*spec.Schema + + wantsRedeemOnMerge bool } // FieldKey is a pair of an object and a field, usable as a key for a map. @@ -116,6 +120,9 @@ func (r *Result) Merge(others ...*Result) *Result { } r.mergeWithoutRootSchemata(other) r.rootObjectSchemata.Append(other.rootObjectSchemata) + if other.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(other) + } } return r } @@ -132,10 +139,9 @@ func (r *Result) RootObjectSchemata() []*spec.Schema { } // FieldSchemata returns the schemata which apply to fields in objects. -// nolint: dupl func (r *Result) FieldSchemata() map[FieldKey][]*spec.Schema { - if r.cachedFieldSchemta != nil { - return r.cachedFieldSchemta + if r.cachedFieldSchemata != nil { + return r.cachedFieldSchemata } ret := make(map[FieldKey][]*spec.Schema, len(r.fieldSchemata)) @@ -147,12 +153,12 @@ func (r *Result) FieldSchemata() map[FieldKey][]*spec.Schema { ret[key] = append(ret[key], fs.schemata.multiple...) } } - r.cachedFieldSchemta = ret + r.cachedFieldSchemata = ret + return ret } // ItemSchemata returns the schemata which apply to items in slices. -// nolint: dupl func (r *Result) ItemSchemata() map[ItemKey][]*spec.Schema { if r.cachedItemSchemata != nil { return r.cachedItemSchemata @@ -172,12 +178,13 @@ func (r *Result) ItemSchemata() map[ItemKey][]*spec.Schema { } func (r *Result) resetCaches() { - r.cachedFieldSchemta = nil + r.cachedFieldSchemata = nil r.cachedItemSchemata = nil } // mergeForField merges other into r, assigning other's root schemata to the given Object and field name. -// nolint: unparam +// +//nolint:unparam func (r *Result) mergeForField(obj map[string]interface{}, field string, other *Result) *Result { if other == nil { return r @@ -188,18 +195,23 @@ func (r *Result) mergeForField(obj map[string]interface{}, field string, other * if r.fieldSchemata == nil { r.fieldSchemata = make([]fieldSchemata, len(obj)) } + // clone other schemata, as other is about to be redeemed to the pool r.fieldSchemata = append(r.fieldSchemata, fieldSchemata{ obj: obj, field: field, - schemata: other.rootObjectSchemata, + schemata: other.rootObjectSchemata.Clone(), }) } + if other.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(other) + } return r } // mergeForSlice merges other into r, assigning other's root schemata to the given slice and index. -// nolint: unparam +// +//nolint:unparam func (r *Result) mergeForSlice(slice reflect.Value, i int, other *Result) *Result { if other == nil { return r @@ -210,29 +222,38 @@ func (r *Result) mergeForSlice(slice reflect.Value, i int, other *Result) *Resul if r.itemSchemata == nil { r.itemSchemata = make([]itemSchemata, slice.Len()) } + // clone other schemata, as other is about to be redeemed to the pool r.itemSchemata = append(r.itemSchemata, itemSchemata{ slice: slice, index: i, - schemata: other.rootObjectSchemata, + schemata: other.rootObjectSchemata.Clone(), }) } + if other.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(other) + } + return r } // addRootObjectSchemata adds the given schemata for the root object of the result. -// The slice schemata might be reused. I.e. do not modify it after being added to a result. +// +// Since the slice schemata might be reused, it is shallow-cloned before saving it into the result. func (r *Result) addRootObjectSchemata(s *spec.Schema) { - r.rootObjectSchemata.Append(schemata{one: s}) + clone := *s + r.rootObjectSchemata.Append(schemata{one: &clone}) } // addPropertySchemata adds the given schemata for the object and field. -// The slice schemata might be reused. I.e. do not modify it after being added to a result. +// +// Since the slice schemata might be reused, it is shallow-cloned before saving it into the result. func (r *Result) addPropertySchemata(obj map[string]interface{}, fld string, schema *spec.Schema) { if r.fieldSchemata == nil { r.fieldSchemata = make([]fieldSchemata, 0, len(obj)) } - r.fieldSchemata = append(r.fieldSchemata, fieldSchemata{obj: obj, field: fld, schemata: schemata{one: schema}}) + clone := *schema + r.fieldSchemata = append(r.fieldSchemata, fieldSchemata{obj: obj, field: fld, schemata: schemata{one: &clone}}) } /* @@ -255,17 +276,21 @@ func (r *Result) mergeWithoutRootSchemata(other *Result) { if other.fieldSchemata != nil { if r.fieldSchemata == nil { - r.fieldSchemata = other.fieldSchemata - } else { - r.fieldSchemata = append(r.fieldSchemata, other.fieldSchemata...) + r.fieldSchemata = make([]fieldSchemata, 0, len(other.fieldSchemata)) + } + for _, field := range other.fieldSchemata { + field.schemata = field.schemata.Clone() + r.fieldSchemata = append(r.fieldSchemata, field) } } if other.itemSchemata != nil { if r.itemSchemata == nil { - r.itemSchemata = other.itemSchemata - } else { - r.itemSchemata = append(r.itemSchemata, other.itemSchemata...) + r.itemSchemata = make([]itemSchemata, 0, len(other.itemSchemata)) + } + for _, field := range other.itemSchemata { + field.schemata = field.schemata.Clone() + r.itemSchemata = append(r.itemSchemata, field) } } } @@ -280,6 +305,9 @@ func (r *Result) MergeAsErrors(others ...*Result) *Result { r.AddErrors(other.Errors...) r.AddErrors(other.Warnings...) r.MatchCount += other.MatchCount + if other.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(other) + } } } return r @@ -295,6 +323,9 @@ func (r *Result) MergeAsWarnings(others ...*Result) *Result { r.AddWarnings(other.Errors...) r.AddWarnings(other.Warnings...) r.MatchCount += other.MatchCount + if other.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(other) + } } } return r @@ -356,16 +387,21 @@ func (r *Result) keepRelevantErrors() *Result { strippedErrors := []error{} for _, e := range r.Errors { if strings.HasPrefix(e.Error(), "IMPORTANT!") { - strippedErrors = append(strippedErrors, fmt.Errorf(strings.TrimPrefix(e.Error(), "IMPORTANT!"))) + strippedErrors = append(strippedErrors, stderrors.New(strings.TrimPrefix(e.Error(), "IMPORTANT!"))) } } strippedWarnings := []error{} for _, e := range r.Warnings { if strings.HasPrefix(e.Error(), "IMPORTANT!") { - strippedWarnings = append(strippedWarnings, fmt.Errorf(strings.TrimPrefix(e.Error(), "IMPORTANT!"))) + strippedWarnings = append(strippedWarnings, stderrors.New(strings.TrimPrefix(e.Error(), "IMPORTANT!"))) } } - strippedResult := new(Result) + var strippedResult *Result + if r.wantsRedeemOnMerge { + strippedResult = pools.poolOfResults.BorrowResult() + } else { + strippedResult = new(Result) + } strippedResult.Errors = strippedErrors strippedResult.Warnings = strippedWarnings return strippedResult @@ -427,6 +463,27 @@ func (r *Result) AsError() error { return errors.CompositeValidationError(r.Errors...) } +func (r *Result) cleared() *Result { + // clear the Result to be reusable. Keep allocated capacity. + r.Errors = r.Errors[:0] + r.Warnings = r.Warnings[:0] + r.MatchCount = 0 + r.data = nil + r.rootObjectSchemata.one = nil + r.rootObjectSchemata.multiple = r.rootObjectSchemata.multiple[:0] + r.fieldSchemata = r.fieldSchemata[:0] + r.itemSchemata = r.itemSchemata[:0] + for k := range r.cachedFieldSchemata { + delete(r.cachedFieldSchemata, k) + } + for k := range r.cachedItemSchemata { + delete(r.cachedItemSchemata, k) + } + r.wantsRedeemOnMerge = true // mark this result as eligible for redeem when merged into another + + return r +} + // schemata is an arbitrary number of schemata. It does a distinction between zero, // one and many schemata to avoid slice allocations. type schemata struct { @@ -453,7 +510,7 @@ func (s *schemata) Slice() []*spec.Schema { return s.multiple } -// appendSchemata appends the schemata in other to s. It mutated s in-place. +// appendSchemata appends the schemata in other to s. It mutates s in-place. func (s *schemata) Append(other schemata) { if other.one == nil && len(other.multiple) == 0 { return @@ -484,3 +541,23 @@ func (s *schemata) Append(other schemata) { } } } + +func (s schemata) Clone() schemata { + var clone schemata + + if s.one != nil { + clone.one = new(spec.Schema) + *clone.one = *s.one + } + + if len(s.multiple) > 0 { + clone.multiple = make([]*spec.Schema, len(s.multiple)) + for idx := 0; idx < len(s.multiple); idx++ { + sp := new(spec.Schema) + *sp = *s.multiple[idx] + clone.multiple[idx] = sp + } + } + + return clone +} diff --git a/vendor/github.com/go-openapi/validate/rexp.go b/vendor/github.com/go-openapi/validate/rexp.go index 5a0824395c..76de03e1f4 100644 --- a/vendor/github.com/go-openapi/validate/rexp.go +++ b/vendor/github.com/go-openapi/validate/rexp.go @@ -23,7 +23,7 @@ import ( // Cache for compiled regular expressions var ( cacheMutex = &sync.Mutex{} - reDict = atomic.Value{} //map[string]*re.Regexp + reDict = atomic.Value{} // map[string]*re.Regexp ) func compileRegexp(pattern string) (*re.Regexp, error) { diff --git a/vendor/github.com/go-openapi/validate/schema.go b/vendor/github.com/go-openapi/validate/schema.go index 55454b8522..db65264fd1 100644 --- a/vendor/github.com/go-openapi/validate/schema.go +++ b/vendor/github.com/go-openapi/validate/schema.go @@ -24,32 +24,32 @@ import ( "github.com/go-openapi/swag" ) -var ( - specSchemaType = reflect.TypeOf(&spec.Schema{}) - specParameterType = reflect.TypeOf(&spec.Parameter{}) - specHeaderType = reflect.TypeOf(&spec.Header{}) - //specItemsType = reflect.TypeOf(&spec.Items{}) -) - // SchemaValidator validates data against a JSON schema type SchemaValidator struct { Path string in string Schema *spec.Schema - validators []valueValidator + validators [8]valueValidator Root interface{} KnownFormats strfmt.Registry - Options SchemaValidatorOptions + Options *SchemaValidatorOptions } // AgainstSchema validates the specified data against the provided schema, using a registry of supported formats. // // When no pre-parsed *spec.Schema structure is provided, it uses a JSON schema as default. See example. func AgainstSchema(schema *spec.Schema, data interface{}, formats strfmt.Registry, options ...Option) error { - res := NewSchemaValidator(schema, nil, "", formats, options...).Validate(data) + res := NewSchemaValidator(schema, nil, "", formats, + append(options, WithRecycleValidators(true), withRecycleResults(true))..., + ).Validate(data) + defer func() { + pools.poolOfResults.RedeemResult(res) + }() + if res.HasErrors() { return errors.CompositeValidationError(res.Errors...) } + return nil } @@ -57,6 +57,15 @@ func AgainstSchema(schema *spec.Schema, data interface{}, formats strfmt.Registr // // Panics if the provided schema is invalid. func NewSchemaValidator(schema *spec.Schema, rootSchema interface{}, root string, formats strfmt.Registry, options ...Option) *SchemaValidator { + opts := new(SchemaValidatorOptions) + for _, o := range options { + o(opts) + } + + return newSchemaValidator(schema, rootSchema, root, formats, opts) +} + +func newSchemaValidator(schema *spec.Schema, rootSchema interface{}, root string, formats strfmt.Registry, opts *SchemaValidatorOptions) *SchemaValidator { if schema == nil { return nil } @@ -72,17 +81,26 @@ func NewSchemaValidator(schema *spec.Schema, rootSchema interface{}, root string panic(msg) } } - s := SchemaValidator{ - Path: root, - in: "body", - Schema: schema, - Root: rootSchema, - KnownFormats: formats, - Options: SchemaValidatorOptions{}} - for _, o := range options { - o(&s.Options) + + if opts == nil { + opts = new(SchemaValidatorOptions) } - s.validators = []valueValidator{ + + var s *SchemaValidator + if opts.recycleValidators { + s = pools.poolOfSchemaValidators.BorrowValidator() + } else { + s = new(SchemaValidator) + } + + s.Path = root + s.in = "body" + s.Schema = schema + s.Root = rootSchema + s.Options = opts + s.KnownFormats = formats + + s.validators = [8]valueValidator{ s.typeValidator(), s.schemaPropsValidator(), s.stringValidator(), @@ -92,7 +110,8 @@ func NewSchemaValidator(schema *spec.Schema, rootSchema interface{}, root string s.commonValidator(), s.objectValidator(), } - return &s + + return s } // SetPath sets the path for this schema valdiator @@ -101,24 +120,46 @@ func (s *SchemaValidator) SetPath(path string) { } // Applies returns true when this schema validator applies -func (s *SchemaValidator) Applies(source interface{}, kind reflect.Kind) bool { +func (s *SchemaValidator) Applies(source interface{}, _ reflect.Kind) bool { _, ok := source.(*spec.Schema) return ok } // Validate validates the data against the schema func (s *SchemaValidator) Validate(data interface{}) *Result { - result := &Result{data: data} if s == nil { - return result + return emptyResult } - if s.Schema != nil { + + if s.Options.recycleValidators { + defer func() { + s.redeemChildren() + s.redeem() // one-time use validator + }() + } + + var result *Result + if s.Options.recycleResult { + result = pools.poolOfResults.BorrowResult() + result.data = data + } else { + result = &Result{data: data} + } + + if s.Schema != nil && !s.Options.skipSchemataResult { result.addRootObjectSchemata(s.Schema) } if data == nil { + // early exit with minimal validation result.Merge(s.validators[0].Validate(data)) // type validator result.Merge(s.validators[6].Validate(data)) // common validator + + if s.Options.recycleValidators { + s.validators[0] = nil + s.validators[6] = nil + } + return result } @@ -147,6 +188,7 @@ func (s *SchemaValidator) Validate(data interface{}) *Result { if erri != nil { result.AddErrors(invalidTypeConversionMsg(s.Path, erri)) result.Inc() + return result } d = in @@ -155,6 +197,7 @@ func (s *SchemaValidator) Validate(data interface{}) *Result { if errf != nil { result.AddErrors(invalidTypeConversionMsg(s.Path, errf)) result.Inc() + return result } d = nf @@ -164,14 +207,26 @@ func (s *SchemaValidator) Validate(data interface{}) *Result { kind = tpe.Kind() } - for _, v := range s.validators { + for idx, v := range s.validators { if !v.Applies(s.Schema, kind) { - debugLog("%T does not apply for %v", v, kind) + if s.Options.recycleValidators { + // Validate won't be called, so relinquish this validator + if redeemableChildren, ok := v.(interface{ redeemChildren() }); ok { + redeemableChildren.redeemChildren() + } + if redeemable, ok := v.(interface{ redeem() }); ok { + redeemable.redeem() + } + s.validators[idx] = nil // prevents further (unsafe) usage + } + continue } - err := v.Validate(d) - result.Merge(err) + result.Merge(v.Validate(d)) + if s.Options.recycleValidators { + s.validators[idx] = nil // prevents further (unsafe) usage + } result.Inc() } result.Inc() @@ -180,81 +235,120 @@ func (s *SchemaValidator) Validate(data interface{}) *Result { } func (s *SchemaValidator) typeValidator() valueValidator { - return &typeValidator{Type: s.Schema.Type, Nullable: s.Schema.Nullable, Format: s.Schema.Format, In: s.in, Path: s.Path} + return newTypeValidator( + s.Path, + s.in, + s.Schema.Type, + s.Schema.Nullable, + s.Schema.Format, + s.Options, + ) } func (s *SchemaValidator) commonValidator() valueValidator { - return &basicCommonValidator{ - Path: s.Path, - In: s.in, - Enum: s.Schema.Enum, - } + return newBasicCommonValidator( + s.Path, + s.in, + s.Schema.Default, + s.Schema.Enum, + s.Options, + ) } func (s *SchemaValidator) sliceValidator() valueValidator { - return &schemaSliceValidator{ - Path: s.Path, - In: s.in, - MaxItems: s.Schema.MaxItems, - MinItems: s.Schema.MinItems, - UniqueItems: s.Schema.UniqueItems, - AdditionalItems: s.Schema.AdditionalItems, - Items: s.Schema.Items, - Root: s.Root, - KnownFormats: s.KnownFormats, - Options: s.Options, - } + return newSliceValidator( + s.Path, + s.in, + s.Schema.MaxItems, + s.Schema.MinItems, + s.Schema.UniqueItems, + s.Schema.AdditionalItems, + s.Schema.Items, + s.Root, + s.KnownFormats, + s.Options, + ) } func (s *SchemaValidator) numberValidator() valueValidator { - return &numberValidator{ - Path: s.Path, - In: s.in, - Default: s.Schema.Default, - MultipleOf: s.Schema.MultipleOf, - Maximum: s.Schema.Maximum, - ExclusiveMaximum: s.Schema.ExclusiveMaximum, - Minimum: s.Schema.Minimum, - ExclusiveMinimum: s.Schema.ExclusiveMinimum, - } + return newNumberValidator( + s.Path, + s.in, + s.Schema.Default, + s.Schema.MultipleOf, + s.Schema.Maximum, + s.Schema.ExclusiveMaximum, + s.Schema.Minimum, + s.Schema.ExclusiveMinimum, + "", + "", + s.Options, + ) } func (s *SchemaValidator) stringValidator() valueValidator { - return &stringValidator{ - Path: s.Path, - In: s.in, - MaxLength: s.Schema.MaxLength, - MinLength: s.Schema.MinLength, - Pattern: s.Schema.Pattern, - } + return newStringValidator( + s.Path, + s.in, + nil, + false, + false, + s.Schema.MaxLength, + s.Schema.MinLength, + s.Schema.Pattern, + s.Options, + ) } func (s *SchemaValidator) formatValidator() valueValidator { - return &formatValidator{ - Path: s.Path, - In: s.in, - Format: s.Schema.Format, - KnownFormats: s.KnownFormats, - } + return newFormatValidator( + s.Path, + s.in, + s.Schema.Format, + s.KnownFormats, + s.Options, + ) } func (s *SchemaValidator) schemaPropsValidator() valueValidator { sch := s.Schema - return newSchemaPropsValidator(s.Path, s.in, sch.AllOf, sch.OneOf, sch.AnyOf, sch.Not, sch.Dependencies, s.Root, s.KnownFormats, s.Options.Options()...) + return newSchemaPropsValidator( + s.Path, s.in, sch.AllOf, sch.OneOf, sch.AnyOf, sch.Not, sch.Dependencies, s.Root, s.KnownFormats, + s.Options, + ) } func (s *SchemaValidator) objectValidator() valueValidator { - return &objectValidator{ - Path: s.Path, - In: s.in, - MaxProperties: s.Schema.MaxProperties, - MinProperties: s.Schema.MinProperties, - Required: s.Schema.Required, - Properties: s.Schema.Properties, - AdditionalProperties: s.Schema.AdditionalProperties, - PatternProperties: s.Schema.PatternProperties, - Root: s.Root, - KnownFormats: s.KnownFormats, - Options: s.Options, + return newObjectValidator( + s.Path, + s.in, + s.Schema.MaxProperties, + s.Schema.MinProperties, + s.Schema.Required, + s.Schema.Properties, + s.Schema.AdditionalProperties, + s.Schema.PatternProperties, + s.Root, + s.KnownFormats, + s.Options, + ) +} + +func (s *SchemaValidator) redeem() { + pools.poolOfSchemaValidators.RedeemValidator(s) +} + +func (s *SchemaValidator) redeemChildren() { + for i, validator := range s.validators { + if validator == nil { + continue + } + if redeemableChildren, ok := validator.(interface{ redeemChildren() }); ok { + redeemableChildren.redeemChildren() + } + if redeemable, ok := validator.(interface{ redeem() }); ok { + redeemable.redeem() + } + s.validators[i] = nil // free up allocated children if not in pool } } diff --git a/vendor/github.com/go-openapi/validate/schema_option.go b/vendor/github.com/go-openapi/validate/schema_option.go index 4b4879de8b..65eeebeaab 100644 --- a/vendor/github.com/go-openapi/validate/schema_option.go +++ b/vendor/github.com/go-openapi/validate/schema_option.go @@ -18,6 +18,9 @@ package validate type SchemaValidatorOptions struct { EnableObjectArrayTypeCheck bool EnableArrayMustHaveItemsCheck bool + recycleValidators bool + recycleResult bool + skipSchemataResult bool } // Option sets optional rules for schema validation @@ -45,10 +48,36 @@ func SwaggerSchema(enable bool) Option { } } -// Options returns current options +// WithRecycleValidators saves memory allocations and makes validators +// available for a single use of Validate() only. +// +// When a validator is recycled, called MUST not call the Validate() method twice. +func WithRecycleValidators(enable bool) Option { + return func(svo *SchemaValidatorOptions) { + svo.recycleValidators = enable + } +} + +func withRecycleResults(enable bool) Option { + return func(svo *SchemaValidatorOptions) { + svo.recycleResult = enable + } +} + +// WithSkipSchemataResult skips the deep audit payload stored in validation Result +func WithSkipSchemataResult(enable bool) Option { + return func(svo *SchemaValidatorOptions) { + svo.skipSchemataResult = enable + } +} + +// Options returns the current set of options func (svo SchemaValidatorOptions) Options() []Option { return []Option{ EnableObjectArrayTypeCheck(svo.EnableObjectArrayTypeCheck), EnableArrayMustHaveItemsCheck(svo.EnableArrayMustHaveItemsCheck), + WithRecycleValidators(svo.recycleValidators), + withRecycleResults(svo.recycleResult), + WithSkipSchemataResult(svo.skipSchemataResult), } } diff --git a/vendor/github.com/go-openapi/validate/schema_props.go b/vendor/github.com/go-openapi/validate/schema_props.go index 5643c783cd..1ca379244d 100644 --- a/vendor/github.com/go-openapi/validate/schema_props.go +++ b/vendor/github.com/go-openapi/validate/schema_props.go @@ -30,211 +30,327 @@ type schemaPropsValidator struct { AnyOf []spec.Schema Not *spec.Schema Dependencies spec.Dependencies - anyOfValidators []SchemaValidator - allOfValidators []SchemaValidator - oneOfValidators []SchemaValidator + anyOfValidators []*SchemaValidator + allOfValidators []*SchemaValidator + oneOfValidators []*SchemaValidator notValidator *SchemaValidator Root interface{} KnownFormats strfmt.Registry - Options SchemaValidatorOptions + Options *SchemaValidatorOptions } func (s *schemaPropsValidator) SetPath(path string) { s.Path = path } -func newSchemaPropsValidator(path string, in string, allOf, oneOf, anyOf []spec.Schema, not *spec.Schema, deps spec.Dependencies, root interface{}, formats strfmt.Registry, options ...Option) *schemaPropsValidator { - anyValidators := make([]SchemaValidator, 0, len(anyOf)) - for _, v := range anyOf { - v := v - anyValidators = append(anyValidators, *NewSchemaValidator(&v, root, path, formats, options...)) +func newSchemaPropsValidator( + path string, in string, allOf, oneOf, anyOf []spec.Schema, not *spec.Schema, deps spec.Dependencies, root interface{}, formats strfmt.Registry, + opts *SchemaValidatorOptions) *schemaPropsValidator { + if opts == nil { + opts = new(SchemaValidatorOptions) } - allValidators := make([]SchemaValidator, 0, len(allOf)) - for _, v := range allOf { - v := v - allValidators = append(allValidators, *NewSchemaValidator(&v, root, path, formats, options...)) + + anyValidators := make([]*SchemaValidator, 0, len(anyOf)) + for i := range anyOf { + anyValidators = append(anyValidators, newSchemaValidator(&anyOf[i], root, path, formats, opts)) + } + allValidators := make([]*SchemaValidator, 0, len(allOf)) + for i := range allOf { + allValidators = append(allValidators, newSchemaValidator(&allOf[i], root, path, formats, opts)) } - oneValidators := make([]SchemaValidator, 0, len(oneOf)) - for _, v := range oneOf { - v := v - oneValidators = append(oneValidators, *NewSchemaValidator(&v, root, path, formats, options...)) + oneValidators := make([]*SchemaValidator, 0, len(oneOf)) + for i := range oneOf { + oneValidators = append(oneValidators, newSchemaValidator(&oneOf[i], root, path, formats, opts)) } var notValidator *SchemaValidator if not != nil { - notValidator = NewSchemaValidator(not, root, path, formats, options...) - } - - schOptions := &SchemaValidatorOptions{} - for _, o := range options { - o(schOptions) - } - return &schemaPropsValidator{ - Path: path, - In: in, - AllOf: allOf, - OneOf: oneOf, - AnyOf: anyOf, - Not: not, - Dependencies: deps, - anyOfValidators: anyValidators, - allOfValidators: allValidators, - oneOfValidators: oneValidators, - notValidator: notValidator, - Root: root, - KnownFormats: formats, - Options: *schOptions, + notValidator = newSchemaValidator(not, root, path, formats, opts) + } + + var s *schemaPropsValidator + if opts.recycleValidators { + s = pools.poolOfSchemaPropsValidators.BorrowValidator() + } else { + s = new(schemaPropsValidator) } + + s.Path = path + s.In = in + s.AllOf = allOf + s.OneOf = oneOf + s.AnyOf = anyOf + s.Not = not + s.Dependencies = deps + s.anyOfValidators = anyValidators + s.allOfValidators = allValidators + s.oneOfValidators = oneValidators + s.notValidator = notValidator + s.Root = root + s.KnownFormats = formats + s.Options = opts + + return s } -func (s *schemaPropsValidator) Applies(source interface{}, kind reflect.Kind) bool { - r := reflect.TypeOf(source) == specSchemaType - debugLog("schema props validator for %q applies %t for %T (kind: %v)\n", s.Path, r, source, kind) - return r +func (s *schemaPropsValidator) Applies(source interface{}, _ reflect.Kind) bool { + _, isSchema := source.(*spec.Schema) + return isSchema } func (s *schemaPropsValidator) Validate(data interface{}) *Result { - mainResult := new(Result) + var mainResult *Result + if s.Options.recycleResult { + mainResult = pools.poolOfResults.BorrowResult() + } else { + mainResult = new(Result) + } // Intermediary error results // IMPORTANT! messages from underlying validators - keepResultAnyOf := new(Result) - keepResultOneOf := new(Result) - keepResultAllOf := new(Result) + var keepResultAnyOf, keepResultOneOf, keepResultAllOf *Result + + if s.Options.recycleValidators { + defer func() { + s.redeemChildren() + s.redeem() + + // results are redeemed when merged + }() + } - // Validates at least one in anyOf schemas - var firstSuccess *Result if len(s.anyOfValidators) > 0 { - var bestFailures *Result - succeededOnce := false - for _, anyOfSchema := range s.anyOfValidators { - result := anyOfSchema.Validate(data) - // We keep inner IMPORTANT! errors no matter what MatchCount tells us - keepResultAnyOf.Merge(result.keepRelevantErrors()) - if result.IsValid() { - bestFailures = nil - succeededOnce = true - if firstSuccess == nil { - firstSuccess = result - } - keepResultAnyOf = new(Result) - break - } - // MatchCount is used to select errors from the schema with most positive checks - if bestFailures == nil || result.MatchCount > bestFailures.MatchCount { - bestFailures = result + keepResultAnyOf = pools.poolOfResults.BorrowResult() + s.validateAnyOf(data, mainResult, keepResultAnyOf) + } + + if len(s.oneOfValidators) > 0 { + keepResultOneOf = pools.poolOfResults.BorrowResult() + s.validateOneOf(data, mainResult, keepResultOneOf) + } + + if len(s.allOfValidators) > 0 { + keepResultAllOf = pools.poolOfResults.BorrowResult() + s.validateAllOf(data, mainResult, keepResultAllOf) + } + + if s.notValidator != nil { + s.validateNot(data, mainResult) + } + + if s.Dependencies != nil && len(s.Dependencies) > 0 && reflect.TypeOf(data).Kind() == reflect.Map { + s.validateDependencies(data, mainResult) + } + + mainResult.Inc() + + // In the end we retain best failures for schema validation + // plus, if any, composite errors which may explain special cases (tagged as IMPORTANT!). + return mainResult.Merge(keepResultAllOf, keepResultOneOf, keepResultAnyOf) +} + +func (s *schemaPropsValidator) validateAnyOf(data interface{}, mainResult, keepResultAnyOf *Result) { + // Validates at least one in anyOf schemas + var bestFailures *Result + + for i, anyOfSchema := range s.anyOfValidators { + result := anyOfSchema.Validate(data) + if s.Options.recycleValidators { + s.anyOfValidators[i] = nil + } + // We keep inner IMPORTANT! errors no matter what MatchCount tells us + keepResultAnyOf.Merge(result.keepRelevantErrors()) // merges (and redeems) a new instance of Result + + if result.IsValid() { + if bestFailures != nil && bestFailures.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(bestFailures) } + + _ = keepResultAnyOf.cleared() + mainResult.Merge(result) + + return } - if !succeededOnce { - mainResult.AddErrors(mustValidateAtLeastOneSchemaMsg(s.Path)) + // MatchCount is used to select errors from the schema with most positive checks + if bestFailures == nil || result.MatchCount > bestFailures.MatchCount { + if bestFailures != nil && bestFailures.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(bestFailures) + } + bestFailures = result + + continue } - if bestFailures != nil { - mainResult.Merge(bestFailures) - } else if firstSuccess != nil { - mainResult.Merge(firstSuccess) + + if result.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(result) // this result is ditched } } + mainResult.AddErrors(mustValidateAtLeastOneSchemaMsg(s.Path)) + mainResult.Merge(bestFailures) +} + +func (s *schemaPropsValidator) validateOneOf(data interface{}, mainResult, keepResultOneOf *Result) { // Validates exactly one in oneOf schemas - if len(s.oneOfValidators) > 0 { - var bestFailures *Result - var firstSuccess *Result - validated := 0 - - for _, oneOfSchema := range s.oneOfValidators { - result := oneOfSchema.Validate(data) - // We keep inner IMPORTANT! errors no matter what MatchCount tells us - keepResultOneOf.Merge(result.keepRelevantErrors()) - if result.IsValid() { - validated++ - bestFailures = nil - if firstSuccess == nil { - firstSuccess = result - } - keepResultOneOf = new(Result) - continue - } - // MatchCount is used to select errors from the schema with most positive checks - if validated == 0 && (bestFailures == nil || result.MatchCount > bestFailures.MatchCount) { - bestFailures = result - } + var ( + firstSuccess, bestFailures *Result + validated int + ) + + for i, oneOfSchema := range s.oneOfValidators { + result := oneOfSchema.Validate(data) + if s.Options.recycleValidators { + s.oneOfValidators[i] = nil } - if validated != 1 { - additionalMsg := "" - if validated == 0 { - additionalMsg = "Found none valid" - } else { - additionalMsg = fmt.Sprintf("Found %d valid alternatives", validated) - } + // We keep inner IMPORTANT! errors no matter what MatchCount tells us + keepResultOneOf.Merge(result.keepRelevantErrors()) // merges (and redeems) a new instance of Result - mainResult.AddErrors(mustValidateOnlyOneSchemaMsg(s.Path, additionalMsg)) - if bestFailures != nil { - mainResult.Merge(bestFailures) - } - } else if firstSuccess != nil { - mainResult.Merge(firstSuccess) - } - } + if result.IsValid() { + validated++ + _ = keepResultOneOf.cleared() - // Validates all of allOf schemas - if len(s.allOfValidators) > 0 { - validated := 0 - - for _, allOfSchema := range s.allOfValidators { - result := allOfSchema.Validate(data) - // We keep inner IMPORTANT! errors no matter what MatchCount tells us - keepResultAllOf.Merge(result.keepRelevantErrors()) - //keepResultAllOf.Merge(result) - if result.IsValid() { - validated++ + if firstSuccess == nil { + firstSuccess = result + } else if result.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(result) // this result is ditched } - mainResult.Merge(result) + + continue } - if validated != len(s.allOfValidators) { - additionalMsg := "" - if validated == 0 { - additionalMsg = ". None validated" + // MatchCount is used to select errors from the schema with most positive checks + if validated == 0 && (bestFailures == nil || result.MatchCount > bestFailures.MatchCount) { + if bestFailures != nil && bestFailures.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(bestFailures) } + bestFailures = result + } else if result.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(result) // this result is ditched + } + } - mainResult.AddErrors(mustValidateAllSchemasMsg(s.Path, additionalMsg)) + switch validated { + case 0: + mainResult.AddErrors(mustValidateOnlyOneSchemaMsg(s.Path, "Found none valid")) + mainResult.Merge(bestFailures) + // firstSucess necessarily nil + case 1: + mainResult.Merge(firstSuccess) + if bestFailures != nil && bestFailures.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(bestFailures) + } + default: + mainResult.AddErrors(mustValidateOnlyOneSchemaMsg(s.Path, fmt.Sprintf("Found %d valid alternatives", validated))) + mainResult.Merge(bestFailures) + if firstSuccess != nil && firstSuccess.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(firstSuccess) } } +} - if s.notValidator != nil { - result := s.notValidator.Validate(data) +func (s *schemaPropsValidator) validateAllOf(data interface{}, mainResult, keepResultAllOf *Result) { + // Validates all of allOf schemas + var validated int + + for i, allOfSchema := range s.allOfValidators { + result := allOfSchema.Validate(data) + if s.Options.recycleValidators { + s.allOfValidators[i] = nil + } // We keep inner IMPORTANT! errors no matter what MatchCount tells us + keepResultAllOf.Merge(result.keepRelevantErrors()) if result.IsValid() { - mainResult.AddErrors(mustNotValidatechemaMsg(s.Path)) + validated++ } + mainResult.Merge(result) } - if s.Dependencies != nil && len(s.Dependencies) > 0 && reflect.TypeOf(data).Kind() == reflect.Map { - val := data.(map[string]interface{}) - for key := range val { - if dep, ok := s.Dependencies[key]; ok { + switch validated { + case 0: + mainResult.AddErrors(mustValidateAllSchemasMsg(s.Path, ". None validated")) + case len(s.allOfValidators): + default: + mainResult.AddErrors(mustValidateAllSchemasMsg(s.Path, "")) + } +} - if dep.Schema != nil { - mainResult.Merge(NewSchemaValidator(dep.Schema, s.Root, s.Path+"."+key, s.KnownFormats, s.Options.Options()...).Validate(data)) - continue - } +func (s *schemaPropsValidator) validateNot(data interface{}, mainResult *Result) { + result := s.notValidator.Validate(data) + if s.Options.recycleValidators { + s.notValidator = nil + } + // We keep inner IMPORTANT! errors no matter what MatchCount tells us + if result.IsValid() { + mainResult.AddErrors(mustNotValidatechemaMsg(s.Path)) + } + if result.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(result) // this result is ditched + } +} + +func (s *schemaPropsValidator) validateDependencies(data interface{}, mainResult *Result) { + val := data.(map[string]interface{}) + for key := range val { + dep, ok := s.Dependencies[key] + if !ok { + continue + } + + if dep.Schema != nil { + mainResult.Merge( + newSchemaValidator(dep.Schema, s.Root, s.Path+"."+key, s.KnownFormats, s.Options).Validate(data), + ) + continue + } - if len(dep.Property) > 0 { - for _, depKey := range dep.Property { - if _, ok := val[depKey]; !ok { - mainResult.AddErrors(hasADependencyMsg(s.Path, depKey)) - } - } + if len(dep.Property) > 0 { + for _, depKey := range dep.Property { + if _, ok := val[depKey]; !ok { + mainResult.AddErrors(hasADependencyMsg(s.Path, depKey)) } } } } +} - mainResult.Inc() - // In the end we retain best failures for schema validation - // plus, if any, composite errors which may explain special cases (tagged as IMPORTANT!). - return mainResult.Merge(keepResultAllOf, keepResultOneOf, keepResultAnyOf) +func (s *schemaPropsValidator) redeem() { + pools.poolOfSchemaPropsValidators.RedeemValidator(s) +} + +func (s *schemaPropsValidator) redeemChildren() { + for _, v := range s.anyOfValidators { + if v == nil { + continue + } + v.redeemChildren() + v.redeem() + } + s.anyOfValidators = nil + + for _, v := range s.allOfValidators { + if v == nil { + continue + } + v.redeemChildren() + v.redeem() + } + s.allOfValidators = nil + + for _, v := range s.oneOfValidators { + if v == nil { + continue + } + v.redeemChildren() + v.redeem() + } + s.oneOfValidators = nil + + if s.notValidator != nil { + s.notValidator.redeemChildren() + s.notValidator.redeem() + s.notValidator = nil + } } diff --git a/vendor/github.com/go-openapi/validate/slice_validator.go b/vendor/github.com/go-openapi/validate/slice_validator.go index aa429f5184..13bb02087d 100644 --- a/vendor/github.com/go-openapi/validate/slice_validator.go +++ b/vendor/github.com/go-openapi/validate/slice_validator.go @@ -32,7 +32,36 @@ type schemaSliceValidator struct { Items *spec.SchemaOrArray Root interface{} KnownFormats strfmt.Registry - Options SchemaValidatorOptions + Options *SchemaValidatorOptions +} + +func newSliceValidator(path, in string, + maxItems, minItems *int64, uniqueItems bool, + additionalItems *spec.SchemaOrBool, items *spec.SchemaOrArray, + root interface{}, formats strfmt.Registry, opts *SchemaValidatorOptions) *schemaSliceValidator { + if opts == nil { + opts = new(SchemaValidatorOptions) + } + + var v *schemaSliceValidator + if opts.recycleValidators { + v = pools.poolOfSliceValidators.BorrowValidator() + } else { + v = new(schemaSliceValidator) + } + + v.Path = path + v.In = in + v.MaxItems = maxItems + v.MinItems = minItems + v.UniqueItems = uniqueItems + v.AdditionalItems = additionalItems + v.Items = items + v.Root = root + v.KnownFormats = formats + v.Options = opts + + return v } func (s *schemaSliceValidator) SetPath(path string) { @@ -46,7 +75,18 @@ func (s *schemaSliceValidator) Applies(source interface{}, kind reflect.Kind) bo } func (s *schemaSliceValidator) Validate(data interface{}) *Result { - result := new(Result) + if s.Options.recycleValidators { + defer func() { + s.redeem() + }() + } + + var result *Result + if s.Options.recycleResult { + result = pools.poolOfResults.BorrowResult() + } else { + result = new(Result) + } if data == nil { return result } @@ -54,8 +94,8 @@ func (s *schemaSliceValidator) Validate(data interface{}) *Result { size := val.Len() if s.Items != nil && s.Items.Schema != nil { - validator := NewSchemaValidator(s.Items.Schema, s.Root, s.Path, s.KnownFormats, s.Options.Options()...) for i := 0; i < size; i++ { + validator := newSchemaValidator(s.Items.Schema, s.Root, s.Path, s.KnownFormats, s.Options) validator.SetPath(fmt.Sprintf("%s.%d", s.Path, i)) value := val.Index(i) result.mergeForSlice(val, i, validator.Validate(value.Interface())) @@ -66,10 +106,11 @@ func (s *schemaSliceValidator) Validate(data interface{}) *Result { if s.Items != nil && len(s.Items.Schemas) > 0 { itemsSize = len(s.Items.Schemas) for i := 0; i < itemsSize; i++ { - validator := NewSchemaValidator(&s.Items.Schemas[i], s.Root, fmt.Sprintf("%s.%d", s.Path, i), s.KnownFormats, s.Options.Options()...) - if val.Len() <= i { + if size <= i { break } + + validator := newSchemaValidator(&s.Items.Schemas[i], s.Root, fmt.Sprintf("%s.%d", s.Path, i), s.KnownFormats, s.Options) result.mergeForSlice(val, i, validator.Validate(val.Index(i).Interface())) } } @@ -79,7 +120,7 @@ func (s *schemaSliceValidator) Validate(data interface{}) *Result { } if s.AdditionalItems.Schema != nil { for i := itemsSize; i < size-itemsSize+1; i++ { - validator := NewSchemaValidator(s.AdditionalItems.Schema, s.Root, fmt.Sprintf("%s.%d", s.Path, i), s.KnownFormats, s.Options.Options()...) + validator := newSchemaValidator(s.AdditionalItems.Schema, s.Root, fmt.Sprintf("%s.%d", s.Path, i), s.KnownFormats, s.Options) result.mergeForSlice(val, i, validator.Validate(val.Index(i).Interface())) } } @@ -103,3 +144,7 @@ func (s *schemaSliceValidator) Validate(data interface{}) *Result { result.Inc() return result } + +func (s *schemaSliceValidator) redeem() { + pools.poolOfSliceValidators.RedeemValidator(s) +} diff --git a/vendor/github.com/go-openapi/validate/spec.go b/vendor/github.com/go-openapi/validate/spec.go index f30dd79e38..965452566e 100644 --- a/vendor/github.com/go-openapi/validate/spec.go +++ b/vendor/github.com/go-openapi/validate/spec.go @@ -15,6 +15,8 @@ package validate import ( + "bytes" + "encoding/gob" "encoding/json" "fmt" "sort" @@ -26,23 +28,23 @@ import ( "github.com/go-openapi/loads" "github.com/go-openapi/spec" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // Spec validates an OpenAPI 2.0 specification document. // // Returns an error flattening in a single standard error, all validation messages. // -// - TODO: $ref should not have siblings -// - TODO: make sure documentation reflects all checks and warnings -// - TODO: check on discriminators -// - TODO: explicit message on unsupported keywords (better than "forbidden property"...) -// - TODO: full list of unresolved refs -// - TODO: validate numeric constraints (issue#581): this should be handled like defaults and examples -// - TODO: option to determine if we validate for go-swagger or in a more general context -// - TODO: check on required properties to support anyOf, allOf, oneOf +// - TODO: $ref should not have siblings +// - TODO: make sure documentation reflects all checks and warnings +// - TODO: check on discriminators +// - TODO: explicit message on unsupported keywords (better than "forbidden property"...) +// - TODO: full list of unresolved refs +// - TODO: validate numeric constraints (issue#581): this should be handled like defaults and examples +// - TODO: option to determine if we validate for go-swagger or in a more general context +// - TODO: check on required properties to support anyOf, allOf, oneOf // // NOTE: SecurityScopes are maps: no need to check uniqueness -// func Spec(doc *loads.Document, formats strfmt.Registry) error { errs, _ /*warns*/ := NewSpecValidator(doc.Schema(), formats).Validate(doc) if errs.HasErrors() { @@ -53,25 +55,38 @@ func Spec(doc *loads.Document, formats strfmt.Registry) error { // SpecValidator validates a swagger 2.0 spec type SpecValidator struct { - schema *spec.Schema // swagger 2.0 schema - spec *loads.Document - analyzer *analysis.Spec - expanded *loads.Document - KnownFormats strfmt.Registry - Options Opts // validation options + schema *spec.Schema // swagger 2.0 schema + spec *loads.Document + analyzer *analysis.Spec + expanded *loads.Document + KnownFormats strfmt.Registry + Options Opts // validation options + schemaOptions *SchemaValidatorOptions } // NewSpecValidator creates a new swagger spec validator instance func NewSpecValidator(schema *spec.Schema, formats strfmt.Registry) *SpecValidator { + // schema options that apply to all called validators + schemaOptions := new(SchemaValidatorOptions) + for _, o := range []Option{ + SwaggerSchema(true), + WithRecycleValidators(true), + // withRecycleResults(true), + } { + o(schemaOptions) + } + return &SpecValidator{ - schema: schema, - KnownFormats: formats, - Options: defaultOpts, + schema: schema, + KnownFormats: formats, + Options: defaultOpts, + schemaOptions: schemaOptions, } } // Validate validates the swagger spec func (s *SpecValidator) Validate(data interface{}) (*Result, *Result) { + s.schemaOptions.skipSchemataResult = s.Options.SkipSchemataResult var sd *loads.Document errs, warnings := new(Result), new(Result) @@ -85,11 +100,8 @@ func (s *SpecValidator) Validate(data interface{}) (*Result, *Result) { s.spec = sd s.analyzer = analysis.New(sd.Spec()) - // Swagger schema validator - schv := NewSchemaValidator(s.schema, nil, "", s.KnownFormats, SwaggerSchema(true)) - var obj interface{} - // Raw spec unmarshalling errors + var obj interface{} if err := json.Unmarshal(sd.Raw(), &obj); err != nil { // NOTE: under normal conditions, the *load.Document has been already unmarshalled // So this one is just a paranoid check on the behavior of the spec package @@ -103,6 +115,8 @@ func (s *SpecValidator) Validate(data interface{}) (*Result, *Result) { warnings.AddErrors(errs.Warnings...) }() + // Swagger schema validator + schv := newSchemaValidator(s.schema, nil, "", s.KnownFormats, s.schemaOptions) errs.Merge(schv.Validate(obj)) // error - // There may be a point in continuing to try and determine more accurate errors if !s.Options.ContinueOnErrors && errs.HasErrors() { @@ -130,40 +144,45 @@ func (s *SpecValidator) Validate(data interface{}) (*Result, *Result) { } // Values provided as default MUST validate their schema - df := &defaultValidator{SpecValidator: s} + df := &defaultValidator{SpecValidator: s, schemaOptions: s.schemaOptions} errs.Merge(df.Validate()) // Values provided as examples MUST validate their schema // Value provided as examples in a response without schema generate a warning // Known limitations: examples in responses for mime type not application/json are ignored (warning) - ex := &exampleValidator{SpecValidator: s} + ex := &exampleValidator{SpecValidator: s, schemaOptions: s.schemaOptions} errs.Merge(ex.Validate()) errs.Merge(s.validateNonEmptyPathParamNames()) - //errs.Merge(s.validateRefNoSibling()) // warning only + // errs.Merge(s.validateRefNoSibling()) // warning only errs.Merge(s.validateReferenced()) // warning only return errs, warnings } func (s *SpecValidator) validateNonEmptyPathParamNames() *Result { - res := new(Result) + res := pools.poolOfResults.BorrowResult() if s.spec.Spec().Paths == nil { // There is no Paths object: error res.AddErrors(noValidPathMsg()) - } else { - if s.spec.Spec().Paths.Paths == nil { - // Paths may be empty: warning - res.AddWarnings(noValidPathMsg()) - } else { - for k := range s.spec.Spec().Paths.Paths { - if strings.Contains(k, "{}") { - res.AddErrors(emptyPathParameterMsg(k)) - } - } + + return res + } + + if s.spec.Spec().Paths.Paths == nil { + // Paths may be empty: warning + res.AddWarnings(noValidPathMsg()) + + return res + } + + for k := range s.spec.Spec().Paths.Paths { + if strings.Contains(k, "{}") { + res.AddErrors(emptyPathParameterMsg(k)) } } + return res } @@ -177,7 +196,7 @@ func (s *SpecValidator) validateDuplicateOperationIDs() *Result { // fallback on possible incomplete picture because of previous errors analyzer = s.analyzer } - res := new(Result) + res := pools.poolOfResults.BorrowResult() known := make(map[string]int) for _, v := range analyzer.OperationIDs() { if v != "" { @@ -199,7 +218,7 @@ type dupProp struct { func (s *SpecValidator) validateDuplicatePropertyNames() *Result { // definition can't declare a property that's already defined by one of its ancestors - res := new(Result) + res := pools.poolOfResults.BorrowResult() for k, sch := range s.spec.Spec().Definitions { if len(sch.AllOf) == 0 { continue @@ -248,7 +267,7 @@ func (s *SpecValidator) validateSchemaPropertyNames(nm string, sch spec.Schema, schn := nm schc := &sch - res := new(Result) + res := pools.poolOfResults.BorrowResult() for schc.Ref.String() != "" { // gather property names @@ -285,7 +304,7 @@ func (s *SpecValidator) validateSchemaPropertyNames(nm string, sch spec.Schema, } func (s *SpecValidator) validateCircularAncestry(nm string, sch spec.Schema, knowns map[string]struct{}) ([]string, *Result) { - res := new(Result) + res := pools.poolOfResults.BorrowResult() if sch.Ref.String() == "" && len(sch.AllOf) == 0 { // Safeguard. We should not be able to actually get there return nil, res @@ -335,7 +354,7 @@ func (s *SpecValidator) validateCircularAncestry(nm string, sch spec.Schema, kno func (s *SpecValidator) validateItems() *Result { // validate parameter, items, schema and response objects for presence of item if type is array - res := new(Result) + res := pools.poolOfResults.BorrowResult() for method, pi := range s.analyzer.Operations() { for path, op := range pi { @@ -394,7 +413,7 @@ func (s *SpecValidator) validateItems() *Result { // Verifies constraints on array type func (s *SpecValidator) validateSchemaItems(schema spec.Schema, prefix, opID string) *Result { - res := new(Result) + res := pools.poolOfResults.BorrowResult() if !schema.Type.Contains(arrayType) { return res } @@ -418,7 +437,7 @@ func (s *SpecValidator) validateSchemaItems(schema spec.Schema, prefix, opID str func (s *SpecValidator) validatePathParamPresence(path string, fromPath, fromOperation []string) *Result { // Each defined operation path parameters must correspond to a named element in the API's path pattern. // (For example, you cannot have a path parameter named id for the following path /pets/{petId} but you must have a path parameter named petId.) - res := new(Result) + res := pools.poolOfResults.BorrowResult() for _, l := range fromPath { var matched bool for _, r := range fromOperation { @@ -456,7 +475,6 @@ func (s *SpecValidator) validateReferenced() *Result { return &res } -// nolint: dupl func (s *SpecValidator) validateReferencedParameters() *Result { // Each referenceable definition should have references. params := s.spec.Spec().Parameters @@ -475,14 +493,13 @@ func (s *SpecValidator) validateReferencedParameters() *Result { if len(expected) == 0 { return nil } - result := new(Result) + result := pools.poolOfResults.BorrowResult() for k := range expected { result.AddWarnings(unusedParamMsg(k)) } return result } -// nolint: dupl func (s *SpecValidator) validateReferencedResponses() *Result { // Each referenceable definition should have references. responses := s.spec.Spec().Responses @@ -501,14 +518,13 @@ func (s *SpecValidator) validateReferencedResponses() *Result { if len(expected) == 0 { return nil } - result := new(Result) + result := pools.poolOfResults.BorrowResult() for k := range expected { result.AddWarnings(unusedResponseMsg(k)) } return result } -// nolint: dupl func (s *SpecValidator) validateReferencedDefinitions() *Result { // Each referenceable definition must have references. defs := s.spec.Spec().Definitions @@ -537,13 +553,13 @@ func (s *SpecValidator) validateReferencedDefinitions() *Result { func (s *SpecValidator) validateRequiredDefinitions() *Result { // Each property listed in the required array must be defined in the properties of the model - res := new(Result) + res := pools.poolOfResults.BorrowResult() DEFINITIONS: for d, schema := range s.spec.Spec().Definitions { if schema.Required != nil { // Safeguard for _, pn := range schema.Required { - red := s.validateRequiredProperties(pn, d, &schema) + red := s.validateRequiredProperties(pn, d, &schema) //#nosec res.Merge(red) if !red.IsValid() && !s.Options.ContinueOnErrors { break DEFINITIONS // there is an error, let's stop that bleeding @@ -556,7 +572,7 @@ DEFINITIONS: func (s *SpecValidator) validateRequiredProperties(path, in string, v *spec.Schema) *Result { // Takes care of recursive property definitions, which may be nested in additionalProperties schemas - res := new(Result) + res := pools.poolOfResults.BorrowResult() propertyMatch := false patternMatch := false additionalPropertiesMatch := false @@ -615,40 +631,42 @@ func (s *SpecValidator) validateRequiredProperties(path, in string, v *spec.Sche func (s *SpecValidator) validateParameters() *Result { // - for each method, path is unique, regardless of path parameters // e.g. GET:/petstore/{id}, GET:/petstore/{pet}, GET:/petstore are - // considered duplicate paths + // considered duplicate paths, if StrictPathParamUniqueness is enabled. // - each parameter should have a unique `name` and `type` combination // - each operation should have only 1 parameter of type body // - there must be at most 1 parameter in body // - parameters with pattern property must specify valid patterns // - $ref in parameters must resolve // - path param must be required - res := new(Result) + res := pools.poolOfResults.BorrowResult() rexGarbledPathSegment := mustCompileRegexp(`.*[{}\s]+.*`) - for method, pi := range s.analyzer.Operations() { + for method, pi := range s.expandedAnalyzer().Operations() { methodPaths := make(map[string]map[string]string) for path, op := range pi { - pathToAdd := pathHelp.stripParametersInPath(path) + if s.Options.StrictPathParamUniqueness { + pathToAdd := pathHelp.stripParametersInPath(path) - // Warn on garbled path afer param stripping - if rexGarbledPathSegment.MatchString(pathToAdd) { - res.AddWarnings(pathStrippedParamGarbledMsg(pathToAdd)) - } + // Warn on garbled path afer param stripping + if rexGarbledPathSegment.MatchString(pathToAdd) { + res.AddWarnings(pathStrippedParamGarbledMsg(pathToAdd)) + } - // Check uniqueness of stripped paths - if _, found := methodPaths[method][pathToAdd]; found { + // Check uniqueness of stripped paths + if _, found := methodPaths[method][pathToAdd]; found { - // Sort names for stable, testable output - if strings.Compare(path, methodPaths[method][pathToAdd]) < 0 { - res.AddErrors(pathOverlapMsg(path, methodPaths[method][pathToAdd])) + // Sort names for stable, testable output + if strings.Compare(path, methodPaths[method][pathToAdd]) < 0 { + res.AddErrors(pathOverlapMsg(path, methodPaths[method][pathToAdd])) + } else { + res.AddErrors(pathOverlapMsg(methodPaths[method][pathToAdd], path)) + } } else { - res.AddErrors(pathOverlapMsg(methodPaths[method][pathToAdd], path)) - } - } else { - if _, found := methodPaths[method]; !found { - methodPaths[method] = map[string]string{} - } - methodPaths[method][pathToAdd] = path //Original non stripped path + if _, found := methodPaths[method]; !found { + methodPaths[method] = map[string]string{} + } + methodPaths[method][pathToAdd] = path // Original non stripped path + } } var bodyParams []string @@ -659,7 +677,23 @@ func (s *SpecValidator) validateParameters() *Result { // TODO: should be done after param expansion res.Merge(s.checkUniqueParams(path, method, op)) + // pick the root schema from the swagger specification which describes a parameter + origSchema, ok := s.schema.Definitions["parameter"] + if !ok { + panic("unexpected swagger schema: missing #/definitions/parameter") + } + // clone it once to avoid expanding a global schema (e.g. swagger spec) + paramSchema, err := deepCloneSchema(origSchema) + if err != nil { + panic(fmt.Errorf("can't clone schema: %v", err)) + } + for _, pr := range paramHelp.safeExpandedParamsFor(path, method, op.ID, res, s) { + // An expanded parameter must validate the Parameter schema (an unexpanded $ref always passes high-level schema validation) + schv := newSchemaValidator(¶mSchema, s.schema, fmt.Sprintf("%s.%s.parameters.%s", path, method, pr.Name), s.KnownFormats, s.schemaOptions) + obj := swag.ToDynamicJSON(pr) + res.Merge(schv.Validate(obj)) + // Validate pattern regexp for parameters with a Pattern property if _, err := compileRegexp(pr.Pattern); err != nil { res.AddErrors(invalidPatternInParamMsg(op.ID, pr.Name, pr.Pattern)) @@ -741,7 +775,7 @@ func (s *SpecValidator) validateParameters() *Result { func (s *SpecValidator) validateReferencesValid() *Result { // each reference must point to a valid object - res := new(Result) + res := pools.poolOfResults.BorrowResult() for _, r := range s.analyzer.AllRefs() { if !r.IsValidURI(s.spec.SpecFilePath()) { // Safeguard - spec should always yield a valid URI res.AddErrors(invalidRefMsg(r.String())) @@ -767,13 +801,13 @@ func (s *SpecValidator) checkUniqueParams(path, method string, op *spec.Operatio // However, there are some issues with such a factorization: // - analysis does not seem to fully expand params // - param keys may be altered by x-go-name - res := new(Result) + res := pools.poolOfResults.BorrowResult() pnames := make(map[string]struct{}) if op.Parameters != nil { // Safeguard for _, ppr := range op.Parameters { var ok bool - pr, red := paramHelp.resolveParam(path, method, op.ID, &ppr, s) + pr, red := paramHelp.resolveParam(path, method, op.ID, &ppr, s) //#nosec res.Merge(red) if pr != nil && pr.Name != "" { // params with empty name does no participate the check @@ -793,3 +827,26 @@ func (s *SpecValidator) checkUniqueParams(path, method string, op *spec.Operatio func (s *SpecValidator) SetContinueOnErrors(c bool) { s.Options.ContinueOnErrors = c } + +// expandedAnalyzer returns expanded.Analyzer when it is available. +// otherwise just analyzer. +func (s *SpecValidator) expandedAnalyzer() *analysis.Spec { + if s.expanded != nil && s.expanded.Analyzer != nil { + return s.expanded.Analyzer + } + return s.analyzer +} + +func deepCloneSchema(src spec.Schema) (spec.Schema, error) { + var b bytes.Buffer + if err := gob.NewEncoder(&b).Encode(src); err != nil { + return spec.Schema{}, err + } + + var dst spec.Schema + if err := gob.NewDecoder(&b).Decode(&dst); err != nil { + return spec.Schema{}, err + } + + return dst, nil +} diff --git a/vendor/github.com/go-openapi/validate/spec_messages.go b/vendor/github.com/go-openapi/validate/spec_messages.go index 1a5892aee4..6d1f0f819c 100644 --- a/vendor/github.com/go-openapi/validate/spec_messages.go +++ b/vendor/github.com/go-openapi/validate/spec_messages.go @@ -187,6 +187,8 @@ const ( // UnusedResponseWarning ... UnusedResponseWarning = "response %q is not used anywhere" + + InvalidObject = "expected an object in %q.%s" ) // Additional error codes @@ -347,11 +349,15 @@ func invalidParameterDefinitionAsSchemaMsg(path, method, operationID string) err func parameterValidationTypeMismatchMsg(param, path, typ string) errors.Error { return errors.New(errors.CompositeErrorCode, ParamValidationTypeMismatch, param, path, typ) } +func invalidObjectMsg(path, in string) errors.Error { + return errors.New(errors.CompositeErrorCode, InvalidObject, path, in) +} // disabled -//func invalidResponseDefinitionAsSchemaMsg(path, method string) errors.Error { -// return errors.New(errors.CompositeErrorCode, InvalidResponseDefinitionAsSchemaError, path, method) -//} +// +// func invalidResponseDefinitionAsSchemaMsg(path, method string) errors.Error { +// return errors.New(errors.CompositeErrorCode, InvalidResponseDefinitionAsSchemaError, path, method) +// } func someParametersBrokenMsg(path, method, operationID string) errors.Error { return errors.New(errors.CompositeErrorCode, SomeParametersBrokenError, path, method, operationID) } diff --git a/vendor/github.com/go-openapi/validate/type.go b/vendor/github.com/go-openapi/validate/type.go index f55140d1e5..f87abb3d56 100644 --- a/vendor/github.com/go-openapi/validate/type.go +++ b/vendor/github.com/go-openapi/validate/type.go @@ -19,18 +19,40 @@ import ( "strings" "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" "github.com/go-openapi/spec" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) type typeValidator struct { + Path string + In string Type spec.StringOrArray Nullable bool Format string - In string - Path string + Options *SchemaValidatorOptions +} + +func newTypeValidator(path, in string, typ spec.StringOrArray, nullable bool, format string, opts *SchemaValidatorOptions) *typeValidator { + if opts == nil { + opts = new(SchemaValidatorOptions) + } + + var t *typeValidator + if opts.recycleValidators { + t = pools.poolOfTypeValidators.BorrowValidator() + } else { + t = new(typeValidator) + } + + t.Path = path + t.In = in + t.Type = typ + t.Nullable = nullable + t.Format = format + t.Options = opts + + return t } func (t *typeValidator) schemaInfoForType(data interface{}) (string, string) { @@ -48,7 +70,7 @@ func (t *typeValidator) schemaInfoForType(data interface{}) (string, string) { return stringType, stringFormatDateTime case strfmt.Duration, *strfmt.Duration: return stringType, stringFormatDuration - case runtime.File, *runtime.File: + case swag.File, *swag.File: return fileType, "" case strfmt.Email, *strfmt.Email: return stringType, stringFormatEmail @@ -91,7 +113,7 @@ func (t *typeValidator) schemaInfoForType(data interface{}) (string, string) { default: val := reflect.ValueOf(data) tpe := val.Type() - switch tpe.Kind() { + switch tpe.Kind() { //nolint:exhaustive case reflect.Bool: return booleanType, "" case reflect.String: @@ -126,23 +148,33 @@ func (t *typeValidator) SetPath(path string) { t.Path = path } -func (t *typeValidator) Applies(source interface{}, kind reflect.Kind) bool { +func (t *typeValidator) Applies(source interface{}, _ reflect.Kind) bool { // typeValidator applies to Schema, Parameter and Header objects - stpe := reflect.TypeOf(source) - r := (len(t.Type) > 0 || t.Format != "") && (stpe == specSchemaType || stpe == specParameterType || stpe == specHeaderType) - debugLog("type validator for %q applies %t for %T (kind: %v)\n", t.Path, r, source, kind) - return r + switch source.(type) { + case *spec.Schema: + case *spec.Parameter: + case *spec.Header: + default: + return false + } + + return (len(t.Type) > 0 || t.Format != "") } func (t *typeValidator) Validate(data interface{}) *Result { - result := new(Result) - result.Inc() - if data == nil || reflect.DeepEqual(reflect.Zero(reflect.TypeOf(data)), reflect.ValueOf(data)) { + if t.Options.recycleValidators { + defer func() { + t.redeem() + }() + } + + if data == nil { // nil or zero value for the passed structure require Type: null if len(t.Type) > 0 && !t.Type.Contains(nullType) && !t.Nullable { // TODO: if a property is not required it also passes this - return errorHelp.sErr(errors.InvalidType(t.Path, t.In, strings.Join(t.Type, ","), nullType)) + return errorHelp.sErr(errors.InvalidType(t.Path, t.In, strings.Join(t.Type, ","), nullType), t.Options.recycleResult) } - return result + + return emptyResult } // check if the type matches, should be used in every validator chain as first item @@ -152,8 +184,6 @@ func (t *typeValidator) Validate(data interface{}) *Result { // infer schema type (JSON) and format from passed data type schType, format := t.schemaInfoForType(data) - debugLog("path: %s, schType: %s, format: %s, expType: %s, expFmt: %s, kind: %s", t.Path, schType, format, t.Type, t.Format, val.Kind().String()) - // check numerical types // TODO: check unsigned ints // TODO: check json.Number (see schema.go) @@ -164,15 +194,20 @@ func (t *typeValidator) Validate(data interface{}) *Result { if kind != reflect.String && kind != reflect.Slice && t.Format != "" && !(t.Type.Contains(schType) || format == t.Format || isFloatInt || isIntFloat || isLowerInt || isLowerFloat) { // TODO: test case - return errorHelp.sErr(errors.InvalidType(t.Path, t.In, t.Format, format)) + return errorHelp.sErr(errors.InvalidType(t.Path, t.In, t.Format, format), t.Options.recycleResult) } if !(t.Type.Contains(numberType) || t.Type.Contains(integerType)) && t.Format != "" && (kind == reflect.String || kind == reflect.Slice) { - return result + return emptyResult } if !(t.Type.Contains(schType) || isFloatInt || isIntFloat) { - return errorHelp.sErr(errors.InvalidType(t.Path, t.In, strings.Join(t.Type, ","), schType)) + return errorHelp.sErr(errors.InvalidType(t.Path, t.In, strings.Join(t.Type, ","), schType), t.Options.recycleResult) } - return result + + return emptyResult +} + +func (t *typeValidator) redeem() { + pools.poolOfTypeValidators.RedeemValidator(t) } diff --git a/vendor/github.com/go-openapi/validate/validator.go b/vendor/github.com/go-openapi/validate/validator.go index 2acb839db8..c083aecc9d 100644 --- a/vendor/github.com/go-openapi/validate/validator.go +++ b/vendor/github.com/go-openapi/validate/validator.go @@ -39,20 +39,31 @@ type itemsValidator struct { root interface{} path string in string - validators []valueValidator + validators [6]valueValidator KnownFormats strfmt.Registry + Options *SchemaValidatorOptions } -func newItemsValidator(path, in string, items *spec.Items, root interface{}, formats strfmt.Registry) *itemsValidator { - iv := &itemsValidator{path: path, in: in, items: items, root: root, KnownFormats: formats} - iv.validators = []valueValidator{ - &typeValidator{ - Type: spec.StringOrArray([]string{items.Type}), - Nullable: items.Nullable, - Format: items.Format, - In: in, - Path: path, - }, +func newItemsValidator(path, in string, items *spec.Items, root interface{}, formats strfmt.Registry, opts *SchemaValidatorOptions) *itemsValidator { + if opts == nil { + opts = new(SchemaValidatorOptions) + } + + var iv *itemsValidator + if opts.recycleValidators { + iv = pools.poolOfItemsValidators.BorrowValidator() + } else { + iv = new(itemsValidator) + } + + iv.path = path + iv.in = in + iv.items = items + iv.root = root + iv.KnownFormats = formats + iv.Options = opts + iv.validators = [6]valueValidator{ + iv.typeValidator(), iv.stringValidator(), iv.formatValidator(), iv.numberValidator(), @@ -63,77 +74,152 @@ func newItemsValidator(path, in string, items *spec.Items, root interface{}, for } func (i *itemsValidator) Validate(index int, data interface{}) *Result { + if i.Options.recycleValidators { + defer func() { + i.redeemChildren() + i.redeem() + }() + } + tpe := reflect.TypeOf(data) kind := tpe.Kind() - mainResult := new(Result) + var result *Result + if i.Options.recycleResult { + result = pools.poolOfResults.BorrowResult() + } else { + result = new(Result) + } + path := fmt.Sprintf("%s.%d", i.path, index) - for _, validator := range i.validators { + for idx, validator := range i.validators { + if !validator.Applies(i.root, kind) { + if i.Options.recycleValidators { + // Validate won't be called, so relinquish this validator + if redeemableChildren, ok := validator.(interface{ redeemChildren() }); ok { + redeemableChildren.redeemChildren() + } + if redeemable, ok := validator.(interface{ redeem() }); ok { + redeemable.redeem() + } + i.validators[idx] = nil // prevents further (unsafe) usage + } + + continue + } + validator.SetPath(path) - if validator.Applies(i.root, kind) { - result := validator.Validate(data) - mainResult.Merge(result) - mainResult.Inc() - if result != nil && result.HasErrors() { - return mainResult + err := validator.Validate(data) + if i.Options.recycleValidators { + i.validators[idx] = nil // prevents further (unsafe) usage + } + if err != nil { + result.Inc() + if err.HasErrors() { + result.Merge(err) + + break } + + result.Merge(err) } } - return mainResult + + return result +} + +func (i *itemsValidator) typeValidator() valueValidator { + return newTypeValidator( + i.path, + i.in, + spec.StringOrArray([]string{i.items.Type}), + i.items.Nullable, + i.items.Format, + i.Options, + ) } func (i *itemsValidator) commonValidator() valueValidator { - return &basicCommonValidator{ - In: i.in, - Default: i.items.Default, - Enum: i.items.Enum, - } + return newBasicCommonValidator( + "", + i.in, + i.items.Default, + i.items.Enum, + i.Options, + ) } func (i *itemsValidator) sliceValidator() valueValidator { - return &basicSliceValidator{ - In: i.in, - Default: i.items.Default, - MaxItems: i.items.MaxItems, - MinItems: i.items.MinItems, - UniqueItems: i.items.UniqueItems, - Source: i.root, - Items: i.items.Items, - KnownFormats: i.KnownFormats, - } + return newBasicSliceValidator( + "", + i.in, + i.items.Default, + i.items.MaxItems, + i.items.MinItems, + i.items.UniqueItems, + i.items.Items, + i.root, + i.KnownFormats, + i.Options, + ) } func (i *itemsValidator) numberValidator() valueValidator { - return &numberValidator{ - In: i.in, - Default: i.items.Default, - MultipleOf: i.items.MultipleOf, - Maximum: i.items.Maximum, - ExclusiveMaximum: i.items.ExclusiveMaximum, - Minimum: i.items.Minimum, - ExclusiveMinimum: i.items.ExclusiveMinimum, - Type: i.items.Type, - Format: i.items.Format, - } + return newNumberValidator( + "", + i.in, + i.items.Default, + i.items.MultipleOf, + i.items.Maximum, + i.items.ExclusiveMaximum, + i.items.Minimum, + i.items.ExclusiveMinimum, + i.items.Type, + i.items.Format, + i.Options, + ) } func (i *itemsValidator) stringValidator() valueValidator { - return &stringValidator{ - In: i.in, - Default: i.items.Default, - MaxLength: i.items.MaxLength, - MinLength: i.items.MinLength, - Pattern: i.items.Pattern, - AllowEmptyValue: false, - } + return newStringValidator( + "", + i.in, + i.items.Default, + false, // Required + false, // AllowEmpty + i.items.MaxLength, + i.items.MinLength, + i.items.Pattern, + i.Options, + ) } func (i *itemsValidator) formatValidator() valueValidator { - return &formatValidator{ - In: i.in, - //Default: i.items.Default, - Format: i.items.Format, - KnownFormats: i.KnownFormats, + return newFormatValidator( + "", + i.in, + i.items.Format, + i.KnownFormats, + i.Options, + ) +} + +func (i *itemsValidator) redeem() { + pools.poolOfItemsValidators.RedeemValidator(i) +} + +func (i *itemsValidator) redeemChildren() { + for idx, validator := range i.validators { + if validator == nil { + continue + } + if redeemableChildren, ok := validator.(interface{ redeemChildren() }); ok { + redeemableChildren.redeemChildren() + } + if redeemable, ok := validator.(interface{ redeem() }); ok { + redeemable.redeem() + } + i.validators[idx] = nil // free up allocated children if not in pool } } @@ -142,265 +228,501 @@ type basicCommonValidator struct { In string Default interface{} Enum []interface{} + Options *SchemaValidatorOptions +} + +func newBasicCommonValidator(path, in string, def interface{}, enum []interface{}, opts *SchemaValidatorOptions) *basicCommonValidator { + if opts == nil { + opts = new(SchemaValidatorOptions) + } + + var b *basicCommonValidator + if opts.recycleValidators { + b = pools.poolOfBasicCommonValidators.BorrowValidator() + } else { + b = new(basicCommonValidator) + } + + b.Path = path + b.In = in + b.Default = def + b.Enum = enum + b.Options = opts + + return b } func (b *basicCommonValidator) SetPath(path string) { b.Path = path } -func (b *basicCommonValidator) Applies(source interface{}, kind reflect.Kind) bool { +func (b *basicCommonValidator) Applies(source interface{}, _ reflect.Kind) bool { switch source.(type) { case *spec.Parameter, *spec.Schema, *spec.Header: return true + default: + return false } - return false } func (b *basicCommonValidator) Validate(data interface{}) (res *Result) { - if len(b.Enum) > 0 { - for _, enumValue := range b.Enum { - actualType := reflect.TypeOf(enumValue) - if actualType != nil { // Safeguard - expectedValue := reflect.ValueOf(data) - if expectedValue.IsValid() && expectedValue.Type().ConvertibleTo(actualType) { - if reflect.DeepEqual(expectedValue.Convert(actualType).Interface(), enumValue) { - return nil - } - } - } + if b.Options.recycleValidators { + defer func() { + b.redeem() + }() + } + + if len(b.Enum) == 0 { + return nil + } + + for _, enumValue := range b.Enum { + actualType := reflect.TypeOf(enumValue) + if actualType == nil { // Safeguard + continue + } + + expectedValue := reflect.ValueOf(data) + if expectedValue.IsValid() && + expectedValue.Type().ConvertibleTo(actualType) && + reflect.DeepEqual(expectedValue.Convert(actualType).Interface(), enumValue) { + return nil } - return errorHelp.sErr(errors.EnumFail(b.Path, b.In, data, b.Enum)) } - return nil + + return errorHelp.sErr(errors.EnumFail(b.Path, b.In, data, b.Enum), b.Options.recycleResult) +} + +func (b *basicCommonValidator) redeem() { + pools.poolOfBasicCommonValidators.RedeemValidator(b) } // A HeaderValidator has very limited subset of validations to apply type HeaderValidator struct { name string header *spec.Header - validators []valueValidator + validators [6]valueValidator KnownFormats strfmt.Registry + Options *SchemaValidatorOptions } // NewHeaderValidator creates a new header validator object -func NewHeaderValidator(name string, header *spec.Header, formats strfmt.Registry) *HeaderValidator { - p := &HeaderValidator{name: name, header: header, KnownFormats: formats} - p.validators = []valueValidator{ - &typeValidator{ - Type: spec.StringOrArray([]string{header.Type}), - Nullable: header.Nullable, - Format: header.Format, - In: "header", - Path: name, - }, +func NewHeaderValidator(name string, header *spec.Header, formats strfmt.Registry, options ...Option) *HeaderValidator { + opts := new(SchemaValidatorOptions) + for _, o := range options { + o(opts) + } + + return newHeaderValidator(name, header, formats, opts) +} + +func newHeaderValidator(name string, header *spec.Header, formats strfmt.Registry, opts *SchemaValidatorOptions) *HeaderValidator { + if opts == nil { + opts = new(SchemaValidatorOptions) + } + + var p *HeaderValidator + if opts.recycleValidators { + p = pools.poolOfHeaderValidators.BorrowValidator() + } else { + p = new(HeaderValidator) + } + + p.name = name + p.header = header + p.KnownFormats = formats + p.Options = opts + p.validators = [6]valueValidator{ + newTypeValidator( + name, + "header", + spec.StringOrArray([]string{header.Type}), + header.Nullable, + header.Format, + p.Options, + ), p.stringValidator(), p.formatValidator(), p.numberValidator(), p.sliceValidator(), p.commonValidator(), } + return p } // Validate the value of the header against its schema func (p *HeaderValidator) Validate(data interface{}) *Result { - result := new(Result) + if p.Options.recycleValidators { + defer func() { + p.redeemChildren() + p.redeem() + }() + } + + if data == nil { + return nil + } + + var result *Result + if p.Options.recycleResult { + result = pools.poolOfResults.BorrowResult() + } else { + result = new(Result) + } + tpe := reflect.TypeOf(data) kind := tpe.Kind() - for _, validator := range p.validators { - if validator.Applies(p.header, kind) { - if err := validator.Validate(data); err != nil { - result.Merge(err) - if err.HasErrors() { - return result + for idx, validator := range p.validators { + if !validator.Applies(p.header, kind) { + if p.Options.recycleValidators { + // Validate won't be called, so relinquish this validator + if redeemableChildren, ok := validator.(interface{ redeemChildren() }); ok { + redeemableChildren.redeemChildren() + } + if redeemable, ok := validator.(interface{ redeem() }); ok { + redeemable.redeem() } + p.validators[idx] = nil // prevents further (unsafe) usage } + + continue + } + + err := validator.Validate(data) + if p.Options.recycleValidators { + p.validators[idx] = nil // prevents further (unsafe) usage + } + if err != nil { + if err.HasErrors() { + result.Merge(err) + break + } + result.Merge(err) } } - return nil + + return result } func (p *HeaderValidator) commonValidator() valueValidator { - return &basicCommonValidator{ - Path: p.name, - In: "response", - Default: p.header.Default, - Enum: p.header.Enum, - } + return newBasicCommonValidator( + p.name, + "response", + p.header.Default, + p.header.Enum, + p.Options, + ) } func (p *HeaderValidator) sliceValidator() valueValidator { - return &basicSliceValidator{ - Path: p.name, - In: "response", - Default: p.header.Default, - MaxItems: p.header.MaxItems, - MinItems: p.header.MinItems, - UniqueItems: p.header.UniqueItems, - Items: p.header.Items, - Source: p.header, - KnownFormats: p.KnownFormats, - } + return newBasicSliceValidator( + p.name, + "response", + p.header.Default, + p.header.MaxItems, + p.header.MinItems, + p.header.UniqueItems, + p.header.Items, + p.header, + p.KnownFormats, + p.Options, + ) } func (p *HeaderValidator) numberValidator() valueValidator { - return &numberValidator{ - Path: p.name, - In: "response", - Default: p.header.Default, - MultipleOf: p.header.MultipleOf, - Maximum: p.header.Maximum, - ExclusiveMaximum: p.header.ExclusiveMaximum, - Minimum: p.header.Minimum, - ExclusiveMinimum: p.header.ExclusiveMinimum, - Type: p.header.Type, - Format: p.header.Format, - } + return newNumberValidator( + p.name, + "response", + p.header.Default, + p.header.MultipleOf, + p.header.Maximum, + p.header.ExclusiveMaximum, + p.header.Minimum, + p.header.ExclusiveMinimum, + p.header.Type, + p.header.Format, + p.Options, + ) } func (p *HeaderValidator) stringValidator() valueValidator { - return &stringValidator{ - Path: p.name, - In: "response", - Default: p.header.Default, - Required: true, - MaxLength: p.header.MaxLength, - MinLength: p.header.MinLength, - Pattern: p.header.Pattern, - AllowEmptyValue: false, - } + return newStringValidator( + p.name, + "response", + p.header.Default, + true, + false, + p.header.MaxLength, + p.header.MinLength, + p.header.Pattern, + p.Options, + ) } func (p *HeaderValidator) formatValidator() valueValidator { - return &formatValidator{ - Path: p.name, - In: "response", - //Default: p.header.Default, - Format: p.header.Format, - KnownFormats: p.KnownFormats, + return newFormatValidator( + p.name, + "response", + p.header.Format, + p.KnownFormats, + p.Options, + ) +} + +func (p *HeaderValidator) redeem() { + pools.poolOfHeaderValidators.RedeemValidator(p) +} + +func (p *HeaderValidator) redeemChildren() { + for idx, validator := range p.validators { + if validator == nil { + continue + } + if redeemableChildren, ok := validator.(interface{ redeemChildren() }); ok { + redeemableChildren.redeemChildren() + } + if redeemable, ok := validator.(interface{ redeem() }); ok { + redeemable.redeem() + } + p.validators[idx] = nil // free up allocated children if not in pool } } // A ParamValidator has very limited subset of validations to apply type ParamValidator struct { param *spec.Parameter - validators []valueValidator + validators [6]valueValidator KnownFormats strfmt.Registry + Options *SchemaValidatorOptions } // NewParamValidator creates a new param validator object -func NewParamValidator(param *spec.Parameter, formats strfmt.Registry) *ParamValidator { - p := &ParamValidator{param: param, KnownFormats: formats} - p.validators = []valueValidator{ - &typeValidator{ - Type: spec.StringOrArray([]string{param.Type}), - Nullable: param.Nullable, - Format: param.Format, - In: param.In, - Path: param.Name, - }, +func NewParamValidator(param *spec.Parameter, formats strfmt.Registry, options ...Option) *ParamValidator { + opts := new(SchemaValidatorOptions) + for _, o := range options { + o(opts) + } + + return newParamValidator(param, formats, opts) +} + +func newParamValidator(param *spec.Parameter, formats strfmt.Registry, opts *SchemaValidatorOptions) *ParamValidator { + if opts == nil { + opts = new(SchemaValidatorOptions) + } + + var p *ParamValidator + if opts.recycleValidators { + p = pools.poolOfParamValidators.BorrowValidator() + } else { + p = new(ParamValidator) + } + + p.param = param + p.KnownFormats = formats + p.Options = opts + p.validators = [6]valueValidator{ + newTypeValidator( + param.Name, + param.In, + spec.StringOrArray([]string{param.Type}), + param.Nullable, + param.Format, + p.Options, + ), p.stringValidator(), p.formatValidator(), p.numberValidator(), p.sliceValidator(), p.commonValidator(), } + return p } // Validate the data against the description of the parameter func (p *ParamValidator) Validate(data interface{}) *Result { - result := new(Result) + if data == nil { + return nil + } + + var result *Result + if p.Options.recycleResult { + result = pools.poolOfResults.BorrowResult() + } else { + result = new(Result) + } + tpe := reflect.TypeOf(data) kind := tpe.Kind() + if p.Options.recycleValidators { + defer func() { + p.redeemChildren() + p.redeem() + }() + } + // TODO: validate type - for _, validator := range p.validators { - if validator.Applies(p.param, kind) { - if err := validator.Validate(data); err != nil { - result.Merge(err) - if err.HasErrors() { - return result + for idx, validator := range p.validators { + if !validator.Applies(p.param, kind) { + if p.Options.recycleValidators { + // Validate won't be called, so relinquish this validator + if redeemableChildren, ok := validator.(interface{ redeemChildren() }); ok { + redeemableChildren.redeemChildren() + } + if redeemable, ok := validator.(interface{ redeem() }); ok { + redeemable.redeem() } + p.validators[idx] = nil // prevents further (unsafe) usage } + + continue + } + + err := validator.Validate(data) + if p.Options.recycleValidators { + p.validators[idx] = nil // prevents further (unsafe) usage + } + if err != nil { + if err.HasErrors() { + result.Merge(err) + break + } + result.Merge(err) } } - return nil + + return result } func (p *ParamValidator) commonValidator() valueValidator { - return &basicCommonValidator{ - Path: p.param.Name, - In: p.param.In, - Default: p.param.Default, - Enum: p.param.Enum, - } + return newBasicCommonValidator( + p.param.Name, + p.param.In, + p.param.Default, + p.param.Enum, + p.Options, + ) } func (p *ParamValidator) sliceValidator() valueValidator { - return &basicSliceValidator{ - Path: p.param.Name, - In: p.param.In, - Default: p.param.Default, - MaxItems: p.param.MaxItems, - MinItems: p.param.MinItems, - UniqueItems: p.param.UniqueItems, - Items: p.param.Items, - Source: p.param, - KnownFormats: p.KnownFormats, - } + return newBasicSliceValidator( + p.param.Name, + p.param.In, + p.param.Default, + p.param.MaxItems, + p.param.MinItems, + p.param.UniqueItems, + p.param.Items, + p.param, + p.KnownFormats, + p.Options, + ) } func (p *ParamValidator) numberValidator() valueValidator { - return &numberValidator{ - Path: p.param.Name, - In: p.param.In, - Default: p.param.Default, - MultipleOf: p.param.MultipleOf, - Maximum: p.param.Maximum, - ExclusiveMaximum: p.param.ExclusiveMaximum, - Minimum: p.param.Minimum, - ExclusiveMinimum: p.param.ExclusiveMinimum, - Type: p.param.Type, - Format: p.param.Format, - } + return newNumberValidator( + p.param.Name, + p.param.In, + p.param.Default, + p.param.MultipleOf, + p.param.Maximum, + p.param.ExclusiveMaximum, + p.param.Minimum, + p.param.ExclusiveMinimum, + p.param.Type, + p.param.Format, + p.Options, + ) } func (p *ParamValidator) stringValidator() valueValidator { - return &stringValidator{ - Path: p.param.Name, - In: p.param.In, - Default: p.param.Default, - AllowEmptyValue: p.param.AllowEmptyValue, - Required: p.param.Required, - MaxLength: p.param.MaxLength, - MinLength: p.param.MinLength, - Pattern: p.param.Pattern, - } + return newStringValidator( + p.param.Name, + p.param.In, + p.param.Default, + p.param.Required, + p.param.AllowEmptyValue, + p.param.MaxLength, + p.param.MinLength, + p.param.Pattern, + p.Options, + ) } func (p *ParamValidator) formatValidator() valueValidator { - return &formatValidator{ - Path: p.param.Name, - In: p.param.In, - //Default: p.param.Default, - Format: p.param.Format, - KnownFormats: p.KnownFormats, + return newFormatValidator( + p.param.Name, + p.param.In, + p.param.Format, + p.KnownFormats, + p.Options, + ) +} + +func (p *ParamValidator) redeem() { + pools.poolOfParamValidators.RedeemValidator(p) +} + +func (p *ParamValidator) redeemChildren() { + for idx, validator := range p.validators { + if validator == nil { + continue + } + if redeemableChildren, ok := validator.(interface{ redeemChildren() }); ok { + redeemableChildren.redeemChildren() + } + if redeemable, ok := validator.(interface{ redeem() }); ok { + redeemable.redeem() + } + p.validators[idx] = nil // free up allocated children if not in pool } } type basicSliceValidator struct { - Path string - In string - Default interface{} - MaxItems *int64 - MinItems *int64 - UniqueItems bool - Items *spec.Items - Source interface{} - itemsValidator *itemsValidator - KnownFormats strfmt.Registry + Path string + In string + Default interface{} + MaxItems *int64 + MinItems *int64 + UniqueItems bool + Items *spec.Items + Source interface{} + KnownFormats strfmt.Registry + Options *SchemaValidatorOptions +} + +func newBasicSliceValidator( + path, in string, + def interface{}, maxItems, minItems *int64, uniqueItems bool, items *spec.Items, + source interface{}, formats strfmt.Registry, + opts *SchemaValidatorOptions) *basicSliceValidator { + if opts == nil { + opts = new(SchemaValidatorOptions) + } + + var s *basicSliceValidator + if opts.recycleValidators { + s = pools.poolOfBasicSliceValidators.BorrowValidator() + } else { + s = new(basicSliceValidator) + } + + s.Path = path + s.In = in + s.Default = def + s.MaxItems = maxItems + s.MinItems = minItems + s.UniqueItems = uniqueItems + s.Items = items + s.Source = source + s.KnownFormats = formats + s.Options = opts + + return s } func (s *basicSliceValidator) SetPath(path string) { @@ -411,60 +733,61 @@ func (s *basicSliceValidator) Applies(source interface{}, kind reflect.Kind) boo switch source.(type) { case *spec.Parameter, *spec.Items, *spec.Header: return kind == reflect.Slice + default: + return false } - return false } func (s *basicSliceValidator) Validate(data interface{}) *Result { + if s.Options.recycleValidators { + defer func() { + s.redeem() + }() + } val := reflect.ValueOf(data) size := int64(val.Len()) if s.MinItems != nil { if err := MinItems(s.Path, s.In, size, *s.MinItems); err != nil { - return errorHelp.sErr(err) + return errorHelp.sErr(err, s.Options.recycleResult) } } if s.MaxItems != nil { if err := MaxItems(s.Path, s.In, size, *s.MaxItems); err != nil { - return errorHelp.sErr(err) + return errorHelp.sErr(err, s.Options.recycleResult) } } if s.UniqueItems { if err := UniqueItems(s.Path, s.In, data); err != nil { - return errorHelp.sErr(err) + return errorHelp.sErr(err, s.Options.recycleResult) } } - if s.itemsValidator == nil && s.Items != nil { - s.itemsValidator = newItemsValidator(s.Path, s.In, s.Items, s.Source, s.KnownFormats) + if s.Items == nil { + return nil } - if s.itemsValidator != nil { - for i := 0; i < int(size); i++ { - ele := val.Index(i) - if err := s.itemsValidator.Validate(i, ele.Interface()); err != nil && err.HasErrors() { + for i := 0; i < int(size); i++ { + itemsValidator := newItemsValidator(s.Path, s.In, s.Items, s.Source, s.KnownFormats, s.Options) + ele := val.Index(i) + if err := itemsValidator.Validate(i, ele.Interface()); err != nil { + if err.HasErrors() { return err } + if err.wantsRedeemOnMerge { + pools.poolOfResults.RedeemResult(err) + } } } + return nil } -/* unused -func (s *basicSliceValidator) hasDuplicates(value reflect.Value, size int) bool { - dict := make(map[interface{}]struct{}) - for i := 0; i < size; i++ { - ele := value.Index(i) - if _, ok := dict[ele.Interface()]; ok { - return true - } - dict[ele.Interface()] = struct{}{} - } - return false +func (s *basicSliceValidator) redeem() { + pools.poolOfBasicSliceValidators.RedeemValidator(s) } -*/ type numberValidator struct { Path string @@ -476,8 +799,40 @@ type numberValidator struct { Minimum *float64 ExclusiveMinimum bool // Allows for more accurate behavior regarding integers - Type string - Format string + Type string + Format string + Options *SchemaValidatorOptions +} + +func newNumberValidator( + path, in string, def interface{}, + multipleOf, maximum *float64, exclusiveMaximum bool, minimum *float64, exclusiveMinimum bool, + typ, format string, + opts *SchemaValidatorOptions) *numberValidator { + if opts == nil { + opts = new(SchemaValidatorOptions) + } + + var n *numberValidator + if opts.recycleValidators { + n = pools.poolOfNumberValidators.BorrowValidator() + } else { + n = new(numberValidator) + } + + n.Path = path + n.In = in + n.Default = def + n.MultipleOf = multipleOf + n.Maximum = maximum + n.ExclusiveMaximum = exclusiveMaximum + n.Minimum = minimum + n.ExclusiveMinimum = exclusiveMinimum + n.Type = typ + n.Format = format + n.Options = opts + + return n } func (n *numberValidator) SetPath(path string) { @@ -489,12 +844,10 @@ func (n *numberValidator) Applies(source interface{}, kind reflect.Kind) bool { case *spec.Parameter, *spec.Schema, *spec.Items, *spec.Header: isInt := kind >= reflect.Int && kind <= reflect.Uint64 isFloat := kind == reflect.Float32 || kind == reflect.Float64 - r := isInt || isFloat - debugLog("schema props validator for %q applies %t for %T (kind: %v) isInt=%t, isFloat=%t\n", n.Path, r, source, kind, isInt, isFloat) - return r + return isInt || isFloat + default: + return false } - debugLog("schema props validator for %q applies %t for %T (kind: %v)\n", n.Path, false, source, kind) - return false } // Validate provides a validator for generic JSON numbers, @@ -519,11 +872,18 @@ func (n *numberValidator) Applies(source interface{}, kind reflect.Kind) bool { // // TODO: default boundaries with MAX_SAFE_INTEGER are not checked (specific to json.Number?) func (n *numberValidator) Validate(val interface{}) *Result { - res := new(Result) + if n.Options.recycleValidators { + defer func() { + n.redeem() + }() + } - resMultiple := new(Result) - resMinimum := new(Result) - resMaximum := new(Result) + var res, resMultiple, resMinimum, resMaximum *Result + if n.Options.recycleResult { + res = pools.poolOfResults.BorrowResult() + } else { + res = new(Result) + } // Used only to attempt to validate constraint on value, // even though value or constraint specified do not match type and format @@ -532,70 +892,107 @@ func (n *numberValidator) Validate(val interface{}) *Result { // Is the provided value within the range of the specified numeric type and format? res.AddErrors(IsValueValidAgainstRange(val, n.Type, n.Format, "Checked", n.Path)) - // nolint: dupl if n.MultipleOf != nil { + resMultiple = pools.poolOfResults.BorrowResult() + // Is the constraint specifier within the range of the specific numeric type and format? resMultiple.AddErrors(IsValueValidAgainstRange(*n.MultipleOf, n.Type, n.Format, "MultipleOf", n.Path)) if resMultiple.IsValid() { // Constraint validated with compatible types if err := MultipleOfNativeType(n.Path, n.In, val, *n.MultipleOf); err != nil { - resMultiple.Merge(errorHelp.sErr(err)) + resMultiple.Merge(errorHelp.sErr(err, n.Options.recycleResult)) } } else { // Constraint nevertheless validated, converted as general number if err := MultipleOf(n.Path, n.In, data, *n.MultipleOf); err != nil { - resMultiple.Merge(errorHelp.sErr(err)) + resMultiple.Merge(errorHelp.sErr(err, n.Options.recycleResult)) } } } - // nolint: dupl if n.Maximum != nil { + resMaximum = pools.poolOfResults.BorrowResult() + // Is the constraint specifier within the range of the specific numeric type and format? resMaximum.AddErrors(IsValueValidAgainstRange(*n.Maximum, n.Type, n.Format, "Maximum boundary", n.Path)) if resMaximum.IsValid() { // Constraint validated with compatible types if err := MaximumNativeType(n.Path, n.In, val, *n.Maximum, n.ExclusiveMaximum); err != nil { - resMaximum.Merge(errorHelp.sErr(err)) + resMaximum.Merge(errorHelp.sErr(err, n.Options.recycleResult)) } } else { // Constraint nevertheless validated, converted as general number if err := Maximum(n.Path, n.In, data, *n.Maximum, n.ExclusiveMaximum); err != nil { - resMaximum.Merge(errorHelp.sErr(err)) + resMaximum.Merge(errorHelp.sErr(err, n.Options.recycleResult)) } } } - // nolint: dupl if n.Minimum != nil { + resMinimum = pools.poolOfResults.BorrowResult() + // Is the constraint specifier within the range of the specific numeric type and format? resMinimum.AddErrors(IsValueValidAgainstRange(*n.Minimum, n.Type, n.Format, "Minimum boundary", n.Path)) if resMinimum.IsValid() { // Constraint validated with compatible types if err := MinimumNativeType(n.Path, n.In, val, *n.Minimum, n.ExclusiveMinimum); err != nil { - resMinimum.Merge(errorHelp.sErr(err)) + resMinimum.Merge(errorHelp.sErr(err, n.Options.recycleResult)) } } else { // Constraint nevertheless validated, converted as general number if err := Minimum(n.Path, n.In, data, *n.Minimum, n.ExclusiveMinimum); err != nil { - resMinimum.Merge(errorHelp.sErr(err)) + resMinimum.Merge(errorHelp.sErr(err, n.Options.recycleResult)) } } } res.Merge(resMultiple, resMinimum, resMaximum) res.Inc() + return res } +func (n *numberValidator) redeem() { + pools.poolOfNumberValidators.RedeemValidator(n) +} + type stringValidator struct { + Path string + In string Default interface{} Required bool AllowEmptyValue bool MaxLength *int64 MinLength *int64 Pattern string - Path string - In string + Options *SchemaValidatorOptions +} + +func newStringValidator( + path, in string, + def interface{}, required, allowEmpty bool, maxLength, minLength *int64, pattern string, + opts *SchemaValidatorOptions) *stringValidator { + if opts == nil { + opts = new(SchemaValidatorOptions) + } + + var s *stringValidator + if opts.recycleValidators { + s = pools.poolOfStringValidators.BorrowValidator() + } else { + s = new(stringValidator) + } + + s.Path = path + s.In = in + s.Default = def + s.Required = required + s.AllowEmptyValue = allowEmpty + s.MaxLength = maxLength + s.MinLength = minLength + s.Pattern = pattern + s.Options = opts + + return s } func (s *stringValidator) SetPath(path string) { @@ -605,42 +1002,50 @@ func (s *stringValidator) SetPath(path string) { func (s *stringValidator) Applies(source interface{}, kind reflect.Kind) bool { switch source.(type) { case *spec.Parameter, *spec.Schema, *spec.Items, *spec.Header: - r := kind == reflect.String - debugLog("string validator for %q applies %t for %T (kind: %v)\n", s.Path, r, source, kind) - return r + return kind == reflect.String + default: + return false } - debugLog("string validator for %q applies %t for %T (kind: %v)\n", s.Path, false, source, kind) - return false } func (s *stringValidator) Validate(val interface{}) *Result { + if s.Options.recycleValidators { + defer func() { + s.redeem() + }() + } + data, ok := val.(string) if !ok { - return errorHelp.sErr(errors.InvalidType(s.Path, s.In, stringType, val)) + return errorHelp.sErr(errors.InvalidType(s.Path, s.In, stringType, val), s.Options.recycleResult) } if s.Required && !s.AllowEmptyValue && (s.Default == nil || s.Default == "") { if err := RequiredString(s.Path, s.In, data); err != nil { - return errorHelp.sErr(err) + return errorHelp.sErr(err, s.Options.recycleResult) } } if s.MaxLength != nil { if err := MaxLength(s.Path, s.In, data, *s.MaxLength); err != nil { - return errorHelp.sErr(err) + return errorHelp.sErr(err, s.Options.recycleResult) } } if s.MinLength != nil { if err := MinLength(s.Path, s.In, data, *s.MinLength); err != nil { - return errorHelp.sErr(err) + return errorHelp.sErr(err, s.Options.recycleResult) } } if s.Pattern != "" { if err := Pattern(s.Path, s.In, data, s.Pattern); err != nil { - return errorHelp.sErr(err) + return errorHelp.sErr(err, s.Options.recycleResult) } } return nil } + +func (s *stringValidator) redeem() { + pools.poolOfStringValidators.RedeemValidator(s) +} diff --git a/vendor/github.com/go-openapi/validate/values.go b/vendor/github.com/go-openapi/validate/values.go index 8dfe557e1a..5f6f5ee61e 100644 --- a/vendor/github.com/go-openapi/validate/values.go +++ b/vendor/github.com/go-openapi/validate/values.go @@ -15,6 +15,7 @@ package validate import ( + "context" "fmt" "reflect" "strings" @@ -119,7 +120,7 @@ func UniqueItems(path, in string, data interface{}) *errors.Validation { // MinLength validates a string for minimum length func MinLength(path, in, data string, minLength int64) *errors.Validation { - strLen := int64(utf8.RuneCount([]byte(data))) + strLen := int64(utf8.RuneCountInString(data)) if strLen < minLength { return errors.TooShort(path, in, minLength, data) } @@ -128,13 +129,34 @@ func MinLength(path, in, data string, minLength int64) *errors.Validation { // MaxLength validates a string for maximum length func MaxLength(path, in, data string, maxLength int64) *errors.Validation { - strLen := int64(utf8.RuneCount([]byte(data))) + strLen := int64(utf8.RuneCountInString(data)) if strLen > maxLength { return errors.TooLong(path, in, maxLength, data) } return nil } +// ReadOnly validates an interface for readonly +func ReadOnly(ctx context.Context, path, in string, data interface{}) *errors.Validation { + + // read only is only validated when operationType is request + if op := extractOperationType(ctx); op != request { + return nil + } + + // data must be of zero value of its type + val := reflect.ValueOf(data) + if val.IsValid() { + if reflect.DeepEqual(reflect.Zero(val.Type()).Interface(), val.Interface()) { + return nil + } + } else { + return nil + } + + return errors.ReadOnly(path, in, data) +} + // Required validates an interface for requiredness func Required(path, in string, data interface{}) *errors.Validation { val := reflect.ValueOf(data) @@ -226,7 +248,7 @@ func MinimumUint(path, in string, data, min uint64, exclusive bool) *errors.Vali // MultipleOf validates if the provided number is a multiple of the factor func MultipleOf(path, in string, data, factor float64) *errors.Validation { // multipleOf factor must be positive - if factor < 0 { + if factor <= 0 { return errors.MultipleOfMustBePositive(path, in, factor) } var mult float64 @@ -244,7 +266,7 @@ func MultipleOf(path, in string, data, factor float64) *errors.Validation { // MultipleOfInt validates if the provided integer is a multiple of the factor func MultipleOfInt(path, in string, data int64, factor int64) *errors.Validation { // multipleOf factor must be positive - if factor < 0 { + if factor <= 0 { return errors.MultipleOfMustBePositive(path, in, factor) } mult := data / factor @@ -256,6 +278,10 @@ func MultipleOfInt(path, in string, data int64, factor int64) *errors.Validation // MultipleOfUint validates if the provided unsigned integer is a multiple of the factor func MultipleOfUint(path, in string, data, factor uint64) *errors.Validation { + // multipleOf factor must be positive + if factor == 0 { + return errors.MultipleOfMustBePositive(path, in, factor) + } mult := data / factor if mult*factor != data { return errors.NotMultipleOf(path, in, factor, data) @@ -289,7 +315,7 @@ func FormatOf(path, in, format, data string, registry strfmt.Registry) *errors.V // TODO: Normally, a JSON MAX_SAFE_INTEGER check would ensure conversion remains loss-free func MaximumNativeType(path, in string, val interface{}, max float64, exclusive bool) *errors.Validation { kind := reflect.ValueOf(val).Type().Kind() - switch kind { + switch kind { //nolint:exhaustive case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: value := valueHelp.asInt64(val) return MaximumInt(path, in, value, int64(max), exclusive) @@ -319,7 +345,7 @@ func MaximumNativeType(path, in string, val interface{}, max float64, exclusive // TODO: Normally, a JSON MAX_SAFE_INTEGER check would ensure conversion remains loss-free func MinimumNativeType(path, in string, val interface{}, min float64, exclusive bool) *errors.Validation { kind := reflect.ValueOf(val).Type().Kind() - switch kind { + switch kind { //nolint:exhaustive case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: value := valueHelp.asInt64(val) return MinimumInt(path, in, value, int64(min), exclusive) @@ -349,7 +375,7 @@ func MinimumNativeType(path, in string, val interface{}, min float64, exclusive // TODO: Normally, a JSON MAX_SAFE_INTEGER check would ensure conversion remains loss-free func MultipleOfNativeType(path, in string, val interface{}, multipleOf float64) *errors.Validation { kind := reflect.ValueOf(val).Type().Kind() - switch kind { + switch kind { //nolint:exhaustive case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: value := valueHelp.asInt64(val) return MultipleOfInt(path, in, value, int64(multipleOf)) @@ -372,8 +398,8 @@ func IsValueValidAgainstRange(val interface{}, typeName, format, prefix, path st kind := reflect.ValueOf(val).Type().Kind() // What is the string representation of val - stringRep := "" - switch kind { + var stringRep string + switch kind { //nolint:exhaustive case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: stringRep = swag.FormatUint64(valueHelp.asUint64(val)) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: diff --git a/vendor/github.com/go-stack/stack/.travis.yml b/vendor/github.com/go-stack/stack/.travis.yml deleted file mode 100644 index 5c5a2b516d..0000000000 --- a/vendor/github.com/go-stack/stack/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go -sudo: false -go: - - 1.7.x - - 1.8.x - - 1.9.x - - 1.10.x - - 1.11.x - - tip - -before_install: - - go get github.com/mattn/goveralls - -script: - - goveralls -service=travis-ci diff --git a/vendor/github.com/go-stack/stack/LICENSE.md b/vendor/github.com/go-stack/stack/LICENSE.md deleted file mode 100644 index 2abf98ea83..0000000000 --- a/vendor/github.com/go-stack/stack/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Chris Hines - -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/go-stack/stack/README.md b/vendor/github.com/go-stack/stack/README.md deleted file mode 100644 index f11ccccaa4..0000000000 --- a/vendor/github.com/go-stack/stack/README.md +++ /dev/null @@ -1,38 +0,0 @@ -[![GoDoc](https://godoc.org/github.com/go-stack/stack?status.svg)](https://godoc.org/github.com/go-stack/stack) -[![Go Report Card](https://goreportcard.com/badge/go-stack/stack)](https://goreportcard.com/report/go-stack/stack) -[![TravisCI](https://travis-ci.org/go-stack/stack.svg?branch=master)](https://travis-ci.org/go-stack/stack) -[![Coverage Status](https://coveralls.io/repos/github/go-stack/stack/badge.svg?branch=master)](https://coveralls.io/github/go-stack/stack?branch=master) - -# stack - -Package stack implements utilities to capture, manipulate, and format call -stacks. It provides a simpler API than package runtime. - -The implementation takes care of the minutia and special cases of interpreting -the program counter (pc) values returned by runtime.Callers. - -## Versioning - -Package stack publishes releases via [semver](http://semver.org/) compatible Git -tags prefixed with a single 'v'. The master branch always contains the latest -release. The develop branch contains unreleased commits. - -## Formatting - -Package stack's types implement fmt.Formatter, which provides a simple and -flexible way to declaratively configure formatting when used with logging or -error tracking packages. - -```go -func DoTheThing() { - c := stack.Caller(0) - log.Print(c) // "source.go:10" - log.Printf("%+v", c) // "pkg/path/source.go:10" - log.Printf("%n", c) // "DoTheThing" - - s := stack.Trace().TrimRuntime() - log.Print(s) // "[source.go:15 caller.go:42 main.go:14]" -} -``` - -See the docs for all of the supported formatting options. diff --git a/vendor/github.com/go-stack/stack/stack.go b/vendor/github.com/go-stack/stack/stack.go deleted file mode 100644 index ac3b93b14f..0000000000 --- a/vendor/github.com/go-stack/stack/stack.go +++ /dev/null @@ -1,400 +0,0 @@ -// +build go1.7 - -// Package stack implements utilities to capture, manipulate, and format call -// stacks. It provides a simpler API than package runtime. -// -// The implementation takes care of the minutia and special cases of -// interpreting the program counter (pc) values returned by runtime.Callers. -// -// Package stack's types implement fmt.Formatter, which provides a simple and -// flexible way to declaratively configure formatting when used with logging -// or error tracking packages. -package stack - -import ( - "bytes" - "errors" - "fmt" - "io" - "runtime" - "strconv" - "strings" -) - -// Call records a single function invocation from a goroutine stack. -type Call struct { - frame runtime.Frame -} - -// Caller returns a Call from the stack of the current goroutine. The argument -// skip is the number of stack frames to ascend, with 0 identifying the -// calling function. -func Caller(skip int) Call { - // As of Go 1.9 we need room for up to three PC entries. - // - // 0. An entry for the stack frame prior to the target to check for - // special handling needed if that prior entry is runtime.sigpanic. - // 1. A possible second entry to hold metadata about skipped inlined - // functions. If inline functions were not skipped the target frame - // PC will be here. - // 2. A third entry for the target frame PC when the second entry - // is used for skipped inline functions. - var pcs [3]uintptr - n := runtime.Callers(skip+1, pcs[:]) - frames := runtime.CallersFrames(pcs[:n]) - frame, _ := frames.Next() - frame, _ = frames.Next() - - return Call{ - frame: frame, - } -} - -// String implements fmt.Stinger. It is equivalent to fmt.Sprintf("%v", c). -func (c Call) String() string { - return fmt.Sprint(c) -} - -// MarshalText implements encoding.TextMarshaler. It formats the Call the same -// as fmt.Sprintf("%v", c). -func (c Call) MarshalText() ([]byte, error) { - if c.frame == (runtime.Frame{}) { - return nil, ErrNoFunc - } - - buf := bytes.Buffer{} - fmt.Fprint(&buf, c) - return buf.Bytes(), nil -} - -// ErrNoFunc means that the Call has a nil *runtime.Func. The most likely -// cause is a Call with the zero value. -var ErrNoFunc = errors.New("no call stack information") - -// Format implements fmt.Formatter with support for the following verbs. -// -// %s source file -// %d line number -// %n function name -// %k last segment of the package path -// %v equivalent to %s:%d -// -// It accepts the '+' and '#' flags for most of the verbs as follows. -// -// %+s path of source file relative to the compile time GOPATH, -// or the module path joined to the path of source file relative -// to module root -// %#s full path of source file -// %+n import path qualified function name -// %+k full package path -// %+v equivalent to %+s:%d -// %#v equivalent to %#s:%d -func (c Call) Format(s fmt.State, verb rune) { - if c.frame == (runtime.Frame{}) { - fmt.Fprintf(s, "%%!%c(NOFUNC)", verb) - return - } - - switch verb { - case 's', 'v': - file := c.frame.File - switch { - case s.Flag('#'): - // done - case s.Flag('+'): - file = pkgFilePath(&c.frame) - default: - const sep = "/" - if i := strings.LastIndex(file, sep); i != -1 { - file = file[i+len(sep):] - } - } - io.WriteString(s, file) - if verb == 'v' { - buf := [7]byte{':'} - s.Write(strconv.AppendInt(buf[:1], int64(c.frame.Line), 10)) - } - - case 'd': - buf := [6]byte{} - s.Write(strconv.AppendInt(buf[:0], int64(c.frame.Line), 10)) - - case 'k': - name := c.frame.Function - const pathSep = "/" - start, end := 0, len(name) - if i := strings.LastIndex(name, pathSep); i != -1 { - start = i + len(pathSep) - } - const pkgSep = "." - if i := strings.Index(name[start:], pkgSep); i != -1 { - end = start + i - } - if s.Flag('+') { - start = 0 - } - io.WriteString(s, name[start:end]) - - case 'n': - name := c.frame.Function - if !s.Flag('+') { - const pathSep = "/" - if i := strings.LastIndex(name, pathSep); i != -1 { - name = name[i+len(pathSep):] - } - const pkgSep = "." - if i := strings.Index(name, pkgSep); i != -1 { - name = name[i+len(pkgSep):] - } - } - io.WriteString(s, name) - } -} - -// Frame returns the call frame infomation for the Call. -func (c Call) Frame() runtime.Frame { - return c.frame -} - -// PC returns the program counter for this call frame; multiple frames may -// have the same PC value. -// -// Deprecated: Use Call.Frame instead. -func (c Call) PC() uintptr { - return c.frame.PC -} - -// CallStack records a sequence of function invocations from a goroutine -// stack. -type CallStack []Call - -// String implements fmt.Stinger. It is equivalent to fmt.Sprintf("%v", cs). -func (cs CallStack) String() string { - return fmt.Sprint(cs) -} - -var ( - openBracketBytes = []byte("[") - closeBracketBytes = []byte("]") - spaceBytes = []byte(" ") -) - -// MarshalText implements encoding.TextMarshaler. It formats the CallStack the -// same as fmt.Sprintf("%v", cs). -func (cs CallStack) MarshalText() ([]byte, error) { - buf := bytes.Buffer{} - buf.Write(openBracketBytes) - for i, pc := range cs { - if i > 0 { - buf.Write(spaceBytes) - } - fmt.Fprint(&buf, pc) - } - buf.Write(closeBracketBytes) - return buf.Bytes(), nil -} - -// Format implements fmt.Formatter by printing the CallStack as square brackets -// ([, ]) surrounding a space separated list of Calls each formatted with the -// supplied verb and options. -func (cs CallStack) Format(s fmt.State, verb rune) { - s.Write(openBracketBytes) - for i, pc := range cs { - if i > 0 { - s.Write(spaceBytes) - } - pc.Format(s, verb) - } - s.Write(closeBracketBytes) -} - -// Trace returns a CallStack for the current goroutine with element 0 -// identifying the calling function. -func Trace() CallStack { - var pcs [512]uintptr - n := runtime.Callers(1, pcs[:]) - - frames := runtime.CallersFrames(pcs[:n]) - cs := make(CallStack, 0, n) - - // Skip extra frame retrieved just to make sure the runtime.sigpanic - // special case is handled. - frame, more := frames.Next() - - for more { - frame, more = frames.Next() - cs = append(cs, Call{frame: frame}) - } - - return cs -} - -// TrimBelow returns a slice of the CallStack with all entries below c -// removed. -func (cs CallStack) TrimBelow(c Call) CallStack { - for len(cs) > 0 && cs[0] != c { - cs = cs[1:] - } - return cs -} - -// TrimAbove returns a slice of the CallStack with all entries above c -// removed. -func (cs CallStack) TrimAbove(c Call) CallStack { - for len(cs) > 0 && cs[len(cs)-1] != c { - cs = cs[:len(cs)-1] - } - return cs -} - -// pkgIndex returns the index that results in file[index:] being the path of -// file relative to the compile time GOPATH, and file[:index] being the -// $GOPATH/src/ portion of file. funcName must be the name of a function in -// file as returned by runtime.Func.Name. -func pkgIndex(file, funcName string) int { - // As of Go 1.6.2 there is no direct way to know the compile time GOPATH - // at runtime, but we can infer the number of path segments in the GOPATH. - // We note that runtime.Func.Name() returns the function name qualified by - // the import path, which does not include the GOPATH. Thus we can trim - // segments from the beginning of the file path until the number of path - // separators remaining is one more than the number of path separators in - // the function name. For example, given: - // - // GOPATH /home/user - // file /home/user/src/pkg/sub/file.go - // fn.Name() pkg/sub.Type.Method - // - // We want to produce: - // - // file[:idx] == /home/user/src/ - // file[idx:] == pkg/sub/file.go - // - // From this we can easily see that fn.Name() has one less path separator - // than our desired result for file[idx:]. We count separators from the - // end of the file path until it finds two more than in the function name - // and then move one character forward to preserve the initial path - // segment without a leading separator. - const sep = "/" - i := len(file) - for n := strings.Count(funcName, sep) + 2; n > 0; n-- { - i = strings.LastIndex(file[:i], sep) - if i == -1 { - i = -len(sep) - break - } - } - // get back to 0 or trim the leading separator - return i + len(sep) -} - -// pkgFilePath returns the frame's filepath relative to the compile-time GOPATH, -// or its module path joined to its path relative to the module root. -// -// As of Go 1.11 there is no direct way to know the compile time GOPATH or -// module paths at runtime, but we can piece together the desired information -// from available information. We note that runtime.Frame.Function contains the -// function name qualified by the package path, which includes the module path -// but not the GOPATH. We can extract the package path from that and append the -// last segments of the file path to arrive at the desired package qualified -// file path. For example, given: -// -// GOPATH /home/user -// import path pkg/sub -// frame.File /home/user/src/pkg/sub/file.go -// frame.Function pkg/sub.Type.Method -// Desired return pkg/sub/file.go -// -// It appears that we simply need to trim ".Type.Method" from frame.Function and -// append "/" + path.Base(file). -// -// But there are other wrinkles. Although it is idiomatic to do so, the internal -// name of a package is not required to match the last segment of its import -// path. In addition, the introduction of modules in Go 1.11 allows working -// without a GOPATH. So we also must make these work right: -// -// GOPATH /home/user -// import path pkg/go-sub -// package name sub -// frame.File /home/user/src/pkg/go-sub/file.go -// frame.Function pkg/sub.Type.Method -// Desired return pkg/go-sub/file.go -// -// Module path pkg/v2 -// import path pkg/v2/go-sub -// package name sub -// frame.File /home/user/cloned-pkg/go-sub/file.go -// frame.Function pkg/v2/sub.Type.Method -// Desired return pkg/v2/go-sub/file.go -// -// We can handle all of these situations by using the package path extracted -// from frame.Function up to, but not including, the last segment as the prefix -// and the last two segments of frame.File as the suffix of the returned path. -// This preserves the existing behavior when working in a GOPATH without modules -// and a semantically equivalent behavior when used in module aware project. -func pkgFilePath(frame *runtime.Frame) string { - pre := pkgPrefix(frame.Function) - post := pathSuffix(frame.File) - if pre == "" { - return post - } - return pre + "/" + post -} - -// pkgPrefix returns the import path of the function's package with the final -// segment removed. -func pkgPrefix(funcName string) string { - const pathSep = "/" - end := strings.LastIndex(funcName, pathSep) - if end == -1 { - return "" - } - return funcName[:end] -} - -// pathSuffix returns the last two segments of path. -func pathSuffix(path string) string { - const pathSep = "/" - lastSep := strings.LastIndex(path, pathSep) - if lastSep == -1 { - return path - } - return path[strings.LastIndex(path[:lastSep], pathSep)+1:] -} - -var runtimePath string - -func init() { - var pcs [3]uintptr - runtime.Callers(0, pcs[:]) - frames := runtime.CallersFrames(pcs[:]) - frame, _ := frames.Next() - file := frame.File - - idx := pkgIndex(frame.File, frame.Function) - - runtimePath = file[:idx] - if runtime.GOOS == "windows" { - runtimePath = strings.ToLower(runtimePath) - } -} - -func inGoroot(c Call) bool { - file := c.frame.File - if len(file) == 0 || file[0] == '?' { - return true - } - if runtime.GOOS == "windows" { - file = strings.ToLower(file) - } - return strings.HasPrefix(file, runtimePath) || strings.HasSuffix(file, "/_testmain.go") -} - -// TrimRuntime returns a slice of the CallStack with the topmost entries from -// the go runtime removed. It considers any calls originating from unknown -// files, files under GOROOT, or _testmain.go as part of the runtime. -func (cs CallStack) TrimRuntime() CallStack { - for len(cs) > 0 && inGoroot(cs[len(cs)-1]) { - cs = cs[:len(cs)-1] - } - return cs -} diff --git a/vendor/github.com/google/go-cmp/cmp/cmpopts/equate.go b/vendor/github.com/google/go-cmp/cmp/cmpopts/equate.go index e54a76c7e3..3d8d0cd3ae 100644 --- a/vendor/github.com/google/go-cmp/cmp/cmpopts/equate.go +++ b/vendor/github.com/google/go-cmp/cmp/cmpopts/equate.go @@ -7,6 +7,7 @@ package cmpopts import ( "errors" + "fmt" "math" "reflect" "time" @@ -16,10 +17,10 @@ import ( func equateAlways(_, _ interface{}) bool { return true } -// EquateEmpty returns a Comparer option that determines all maps and slices +// EquateEmpty returns a [cmp.Comparer] option that determines all maps and slices // with a length of zero to be equal, regardless of whether they are nil. // -// EquateEmpty can be used in conjunction with SortSlices and SortMaps. +// EquateEmpty can be used in conjunction with [SortSlices] and [SortMaps]. func EquateEmpty() cmp.Option { return cmp.FilterValues(isEmpty, cmp.Comparer(equateAlways)) } @@ -31,7 +32,7 @@ func isEmpty(x, y interface{}) bool { (vx.Len() == 0 && vy.Len() == 0) } -// EquateApprox returns a Comparer option that determines float32 or float64 +// EquateApprox returns a [cmp.Comparer] option that determines float32 or float64 // values to be equal if they are within a relative fraction or absolute margin. // This option is not used when either x or y is NaN or infinite. // @@ -45,7 +46,7 @@ func isEmpty(x, y interface{}) bool { // // |x-y| ≤ max(fraction*min(|x|, |y|), margin) // -// EquateApprox can be used in conjunction with EquateNaNs. +// EquateApprox can be used in conjunction with [EquateNaNs]. func EquateApprox(fraction, margin float64) cmp.Option { if margin < 0 || fraction < 0 || math.IsNaN(margin) || math.IsNaN(fraction) { panic("margin or fraction must be a non-negative number") @@ -73,10 +74,10 @@ func (a approximator) compareF32(x, y float32) bool { return a.compareF64(float64(x), float64(y)) } -// EquateNaNs returns a Comparer option that determines float32 and float64 +// EquateNaNs returns a [cmp.Comparer] option that determines float32 and float64 // NaN values to be equal. // -// EquateNaNs can be used in conjunction with EquateApprox. +// EquateNaNs can be used in conjunction with [EquateApprox]. func EquateNaNs() cmp.Option { return cmp.Options{ cmp.FilterValues(areNaNsF64s, cmp.Comparer(equateAlways)), @@ -91,8 +92,8 @@ func areNaNsF32s(x, y float32) bool { return areNaNsF64s(float64(x), float64(y)) } -// EquateApproxTime returns a Comparer option that determines two non-zero -// time.Time values to be equal if they are within some margin of one another. +// EquateApproxTime returns a [cmp.Comparer] option that determines two non-zero +// [time.Time] values to be equal if they are within some margin of one another. // If both times have a monotonic clock reading, then the monotonic time // difference will be used. The margin must be non-negative. func EquateApproxTime(margin time.Duration) cmp.Option { @@ -131,8 +132,8 @@ type anyError struct{} func (anyError) Error() string { return "any error" } func (anyError) Is(err error) bool { return err != nil } -// EquateErrors returns a Comparer option that determines errors to be equal -// if errors.Is reports them to match. The AnyError error can be used to +// EquateErrors returns a [cmp.Comparer] option that determines errors to be equal +// if [errors.Is] reports them to match. The [AnyError] error can be used to // match any non-nil error. func EquateErrors() cmp.Option { return cmp.FilterValues(areConcreteErrors, cmp.Comparer(compareErrors)) @@ -154,3 +155,31 @@ func compareErrors(x, y interface{}) bool { ye := y.(error) return errors.Is(xe, ye) || errors.Is(ye, xe) } + +// EquateComparable returns a [cmp.Option] that determines equality +// of comparable types by directly comparing them using the == operator in Go. +// The types to compare are specified by passing a value of that type. +// This option should only be used on types that are documented as being +// safe for direct == comparison. For example, [net/netip.Addr] is documented +// as being semantically safe to use with ==, while [time.Time] is documented +// to discourage the use of == on time values. +func EquateComparable(typs ...interface{}) cmp.Option { + types := make(typesFilter) + for _, typ := range typs { + switch t := reflect.TypeOf(typ); { + case !t.Comparable(): + panic(fmt.Sprintf("%T is not a comparable Go type", typ)) + case types[t]: + panic(fmt.Sprintf("%T is already specified", typ)) + default: + types[t] = true + } + } + return cmp.FilterPath(types.filter, cmp.Comparer(equateAny)) +} + +type typesFilter map[reflect.Type]bool + +func (tf typesFilter) filter(p cmp.Path) bool { return tf[p.Last().Type()] } + +func equateAny(x, y interface{}) bool { return x == y } diff --git a/vendor/github.com/google/go-cmp/cmp/cmpopts/ignore.go b/vendor/github.com/google/go-cmp/cmp/cmpopts/ignore.go index 80c60617e4..fb84d11d70 100644 --- a/vendor/github.com/google/go-cmp/cmp/cmpopts/ignore.go +++ b/vendor/github.com/google/go-cmp/cmp/cmpopts/ignore.go @@ -14,7 +14,7 @@ import ( "github.com/google/go-cmp/cmp/internal/function" ) -// IgnoreFields returns an Option that ignores fields of the +// IgnoreFields returns an [cmp.Option] that ignores fields of the // given names on a single struct type. It respects the names of exported fields // that are forwarded due to struct embedding. // The struct type is specified by passing in a value of that type. @@ -26,7 +26,7 @@ func IgnoreFields(typ interface{}, names ...string) cmp.Option { return cmp.FilterPath(sf.filter, cmp.Ignore()) } -// IgnoreTypes returns an Option that ignores all values assignable to +// IgnoreTypes returns an [cmp.Option] that ignores all values assignable to // certain types, which are specified by passing in a value of each type. func IgnoreTypes(typs ...interface{}) cmp.Option { tf := newTypeFilter(typs...) @@ -59,10 +59,10 @@ func (tf typeFilter) filter(p cmp.Path) bool { return false } -// IgnoreInterfaces returns an Option that ignores all values or references of +// IgnoreInterfaces returns an [cmp.Option] that ignores all values or references of // values assignable to certain interface types. These interfaces are specified // by passing in an anonymous struct with the interface types embedded in it. -// For example, to ignore sync.Locker, pass in struct{sync.Locker}{}. +// For example, to ignore [sync.Locker], pass in struct{sync.Locker}{}. func IgnoreInterfaces(ifaces interface{}) cmp.Option { tf := newIfaceFilter(ifaces) return cmp.FilterPath(tf.filter, cmp.Ignore()) @@ -107,7 +107,7 @@ func (tf ifaceFilter) filter(p cmp.Path) bool { return false } -// IgnoreUnexported returns an Option that only ignores the immediate unexported +// IgnoreUnexported returns an [cmp.Option] that only ignores the immediate unexported // fields of a struct, including anonymous fields of unexported types. // In particular, unexported fields within the struct's exported fields // of struct types, including anonymous fields, will not be ignored unless the @@ -115,7 +115,7 @@ func (tf ifaceFilter) filter(p cmp.Path) bool { // // Avoid ignoring unexported fields of a type which you do not control (i.e. a // type from another repository), as changes to the implementation of such types -// may change how the comparison behaves. Prefer a custom Comparer instead. +// may change how the comparison behaves. Prefer a custom [cmp.Comparer] instead. func IgnoreUnexported(typs ...interface{}) cmp.Option { ux := newUnexportedFilter(typs...) return cmp.FilterPath(ux.filter, cmp.Ignore()) @@ -148,7 +148,7 @@ func isExported(id string) bool { return unicode.IsUpper(r) } -// IgnoreSliceElements returns an Option that ignores elements of []V. +// IgnoreSliceElements returns an [cmp.Option] that ignores elements of []V. // The discard function must be of the form "func(T) bool" which is used to // ignore slice elements of type V, where V is assignable to T. // Elements are ignored if the function reports true. @@ -176,7 +176,7 @@ func IgnoreSliceElements(discardFunc interface{}) cmp.Option { }, cmp.Ignore()) } -// IgnoreMapEntries returns an Option that ignores entries of map[K]V. +// IgnoreMapEntries returns an [cmp.Option] that ignores entries of map[K]V. // The discard function must be of the form "func(T, R) bool" which is used to // ignore map entries of type K and V, where K and V are assignable to T and R. // Entries are ignored if the function reports true. diff --git a/vendor/github.com/google/go-cmp/cmp/cmpopts/sort.go b/vendor/github.com/google/go-cmp/cmp/cmpopts/sort.go index 0eb2a758c2..c6d09dae40 100644 --- a/vendor/github.com/google/go-cmp/cmp/cmpopts/sort.go +++ b/vendor/github.com/google/go-cmp/cmp/cmpopts/sort.go @@ -13,7 +13,7 @@ import ( "github.com/google/go-cmp/cmp/internal/function" ) -// SortSlices returns a Transformer option that sorts all []V. +// SortSlices returns a [cmp.Transformer] option that sorts all []V. // The less function must be of the form "func(T, T) bool" which is used to // sort any slice with element type V that is assignable to T. // @@ -25,7 +25,7 @@ import ( // The less function does not have to be "total". That is, if !less(x, y) and // !less(y, x) for two elements x and y, their relative order is maintained. // -// SortSlices can be used in conjunction with EquateEmpty. +// SortSlices can be used in conjunction with [EquateEmpty]. func SortSlices(lessFunc interface{}) cmp.Option { vf := reflect.ValueOf(lessFunc) if !function.IsType(vf.Type(), function.Less) || vf.IsNil() { @@ -82,13 +82,13 @@ func (ss sliceSorter) less(v reflect.Value, i, j int) bool { return ss.fnc.Call([]reflect.Value{vx, vy})[0].Bool() } -// SortMaps returns a Transformer option that flattens map[K]V types to be a +// SortMaps returns a [cmp.Transformer] option that flattens map[K]V types to be a // sorted []struct{K, V}. The less function must be of the form // "func(T, T) bool" which is used to sort any map with key K that is // assignable to T. // -// Flattening the map into a slice has the property that cmp.Equal is able to -// use Comparers on K or the K.Equal method if it exists. +// Flattening the map into a slice has the property that [cmp.Equal] is able to +// use [cmp.Comparer] options on K or the K.Equal method if it exists. // // The less function must be: // - Deterministic: less(x, y) == less(x, y) @@ -96,7 +96,7 @@ func (ss sliceSorter) less(v reflect.Value, i, j int) bool { // - Transitive: if !less(x, y) and !less(y, z), then !less(x, z) // - Total: if x != y, then either less(x, y) or less(y, x) // -// SortMaps can be used in conjunction with EquateEmpty. +// SortMaps can be used in conjunction with [EquateEmpty]. func SortMaps(lessFunc interface{}) cmp.Option { vf := reflect.ValueOf(lessFunc) if !function.IsType(vf.Type(), function.Less) || vf.IsNil() { diff --git a/vendor/github.com/google/go-cmp/cmp/cmpopts/xform.go b/vendor/github.com/google/go-cmp/cmp/cmpopts/xform.go index 8812443a2f..25b4bd05bd 100644 --- a/vendor/github.com/google/go-cmp/cmp/cmpopts/xform.go +++ b/vendor/github.com/google/go-cmp/cmp/cmpopts/xform.go @@ -19,7 +19,7 @@ func (xf xformFilter) filter(p cmp.Path) bool { return true } -// AcyclicTransformer returns a Transformer with a filter applied that ensures +// AcyclicTransformer returns a [cmp.Transformer] with a filter applied that ensures // that the transformer cannot be recursively applied upon its own output. // // An example use case is a transformer that splits a string by lines: @@ -28,7 +28,7 @@ func (xf xformFilter) filter(p cmp.Path) bool { // return strings.Split(s, "\n") // }) // -// Had this been an unfiltered Transformer instead, this would result in an +// Had this been an unfiltered [cmp.Transformer] instead, this would result in an // infinite cycle converting a string to []string to [][]string and so on. func AcyclicTransformer(name string, xformFunc interface{}) cmp.Option { xf := xformFilter{cmp.Transformer(name, xformFunc)} diff --git a/vendor/github.com/google/go-cmp/cmp/compare.go b/vendor/github.com/google/go-cmp/cmp/compare.go index 087320da7f..0f5b8a48c6 100644 --- a/vendor/github.com/google/go-cmp/cmp/compare.go +++ b/vendor/github.com/google/go-cmp/cmp/compare.go @@ -5,7 +5,7 @@ // Package cmp determines equality of values. // // This package is intended to be a more powerful and safer alternative to -// reflect.DeepEqual for comparing whether two values are semantically equal. +// [reflect.DeepEqual] for comparing whether two values are semantically equal. // It is intended to only be used in tests, as performance is not a goal and // it may panic if it cannot compare the values. Its propensity towards // panicking means that its unsuitable for production environments where a @@ -18,16 +18,17 @@ // For example, an equality function may report floats as equal so long as // they are within some tolerance of each other. // -// - Types with an Equal method may use that method to determine equality. -// This allows package authors to determine the equality operation -// for the types that they define. +// - Types with an Equal method (e.g., [time.Time.Equal]) may use that method +// to determine equality. This allows package authors to determine +// the equality operation for the types that they define. // // - If no custom equality functions are used and no Equal method is defined, // equality is determined by recursively comparing the primitive kinds on -// both values, much like reflect.DeepEqual. Unlike reflect.DeepEqual, +// 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. +// unless suppressed by using an [Ignore] option +// (see [github.com/google/go-cmp/cmp/cmpopts.IgnoreUnexported]) +// or explicitly compared using the [Exporter] option. package cmp import ( @@ -45,14 +46,14 @@ import ( // Equal reports whether x and y are equal by recursively applying the // following rules in the given order to x and y and all of their sub-values: // -// - Let S be the set of all Ignore, Transformer, and Comparer options that +// - Let S be the set of all [Ignore], [Transformer], and [Comparer] options that // remain after applying all path filters, value filters, and type filters. -// If at least one Ignore exists in S, then the comparison is ignored. -// If the number of Transformer and Comparer options in S is non-zero, +// If at least one [Ignore] exists in S, then the comparison is ignored. +// If the number of [Transformer] and [Comparer] options in S is non-zero, // then Equal panics because it is ambiguous which option to use. -// If S contains a single Transformer, then use that to transform +// If S contains a single [Transformer], then use that to transform // the current values and recursively call Equal on the output values. -// If S contains a single Comparer, then use that to compare the current values. +// If S contains a single [Comparer], then use that to compare the current values. // Otherwise, evaluation proceeds to the next rule. // // - If the values have an Equal method of the form "(T) Equal(T) bool" or @@ -66,21 +67,22 @@ import ( // Functions are only equal if they are both nil, otherwise they are unequal. // // 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. +// If a struct contains unexported fields, Equal panics unless an [Ignore] option +// (e.g., [github.com/google/go-cmp/cmp/cmpopts.IgnoreUnexported]) ignores that field +// or the [Exporter] 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. // Empty non-nil slices and nil slices are not equal; to equate empty slices, -// consider using cmpopts.EquateEmpty. +// consider using [github.com/google/go-cmp/cmp/cmpopts.EquateEmpty]. // // Maps are equal if they are both nil or both non-nil, where recursively // calling Equal on all non-ignored map entries report equal. // Map keys are equal according to the == operator. -// To use custom comparisons for map keys, consider using cmpopts.SortMaps. +// To use custom comparisons for map keys, consider using +// [github.com/google/go-cmp/cmp/cmpopts.SortMaps]. // Empty non-nil maps and nil maps are not equal; to equate empty maps, -// consider using cmpopts.EquateEmpty. +// consider using [github.com/google/go-cmp/cmp/cmpopts.EquateEmpty]. // // Pointers and interfaces are equal if they are both nil or both non-nil, // where they have the same underlying concrete type and recursively diff --git a/vendor/github.com/google/go-cmp/cmp/export.go b/vendor/github.com/google/go-cmp/cmp/export.go new file mode 100644 index 0000000000..29f82fe6b2 --- /dev/null +++ b/vendor/github.com/google/go-cmp/cmp/export.go @@ -0,0 +1,31 @@ +// 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 cmp + +import ( + "reflect" + "unsafe" +) + +// retrieveUnexportedField uses unsafe to forcibly retrieve any field from +// a struct such that the value has read-write permissions. +// +// The parent struct, v, must be addressable, while f must be a StructField +// describing the field to retrieve. If addr is false, +// then the returned value will be shallowed copied to be non-addressable. +func retrieveUnexportedField(v reflect.Value, f reflect.StructField, addr bool) reflect.Value { + ve := reflect.NewAt(f.Type, unsafe.Pointer(uintptr(unsafe.Pointer(v.UnsafeAddr()))+f.Offset)).Elem() + if !addr { + // A field is addressable if and only if the struct is addressable. + // If the original parent value was not addressable, shallow copy the + // value to make it non-addressable to avoid leaking an implementation + // detail of how forcibly exporting a field works. + if ve.Kind() == reflect.Interface && ve.IsNil() { + return reflect.Zero(f.Type) + } + return reflect.ValueOf(ve.Interface()).Convert(f.Type) + } + return ve +} diff --git a/vendor/github.com/google/go-cmp/cmp/export_panic.go b/vendor/github.com/google/go-cmp/cmp/export_panic.go deleted file mode 100644 index ae851fe53f..0000000000 --- a/vendor/github.com/google/go-cmp/cmp/export_panic.go +++ /dev/null @@ -1,16 +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. - -//go:build purego -// +build purego - -package cmp - -import "reflect" - -const supportExporters = false - -func retrieveUnexportedField(reflect.Value, reflect.StructField, bool) reflect.Value { - panic("no support for forcibly accessing unexported fields") -} diff --git a/vendor/github.com/google/go-cmp/cmp/export_unsafe.go b/vendor/github.com/google/go-cmp/cmp/export_unsafe.go deleted file mode 100644 index e2c0f74e83..0000000000 --- a/vendor/github.com/google/go-cmp/cmp/export_unsafe.go +++ /dev/null @@ -1,36 +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. - -//go:build !purego -// +build !purego - -package cmp - -import ( - "reflect" - "unsafe" -) - -const supportExporters = true - -// retrieveUnexportedField uses unsafe to forcibly retrieve any field from -// a struct such that the value has read-write permissions. -// -// The parent struct, v, must be addressable, while f must be a StructField -// describing the field to retrieve. If addr is false, -// then the returned value will be shallowed copied to be non-addressable. -func retrieveUnexportedField(v reflect.Value, f reflect.StructField, addr bool) reflect.Value { - ve := reflect.NewAt(f.Type, unsafe.Pointer(uintptr(unsafe.Pointer(v.UnsafeAddr()))+f.Offset)).Elem() - if !addr { - // A field is addressable if and only if the struct is addressable. - // If the original parent value was not addressable, shallow copy the - // value to make it non-addressable to avoid leaking an implementation - // detail of how forcibly exporting a field works. - if ve.Kind() == reflect.Interface && ve.IsNil() { - return reflect.Zero(f.Type) - } - return reflect.ValueOf(ve.Interface()).Convert(f.Type) - } - return ve -} diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer.go b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer.go new file mode 100644 index 0000000000..e5dfff69af --- /dev/null +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer.go @@ -0,0 +1,34 @@ +// 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 value + +import ( + "reflect" + "unsafe" +) + +// Pointer is an opaque typed pointer and is guaranteed to be comparable. +type Pointer struct { + p unsafe.Pointer + t reflect.Type +} + +// PointerOf returns a Pointer from v, which must be a +// reflect.Ptr, reflect.Slice, or reflect.Map. +func PointerOf(v reflect.Value) Pointer { + // The proper representation of a pointer is unsafe.Pointer, + // which is necessary if the GC ever uses a moving collector. + return Pointer{unsafe.Pointer(v.Pointer()), v.Type()} +} + +// IsNil reports whether the pointer is nil. +func (p Pointer) IsNil() bool { + return p.p == nil +} + +// Uintptr returns the pointer as a uintptr. +func (p Pointer) Uintptr() uintptr { + return uintptr(p.p) +} diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go deleted file mode 100644 index 1a71bfcbd3..0000000000 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.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. - -//go:build purego -// +build purego - -package value - -import "reflect" - -// Pointer is an opaque typed pointer and is guaranteed to be comparable. -type Pointer struct { - p uintptr - t reflect.Type -} - -// PointerOf returns a Pointer from v, which must be a -// reflect.Ptr, reflect.Slice, or reflect.Map. -func PointerOf(v reflect.Value) Pointer { - // NOTE: Storing a pointer as an uintptr is technically incorrect as it - // assumes that the GC implementation does not use a moving collector. - return Pointer{v.Pointer(), v.Type()} -} - -// IsNil reports whether the pointer is nil. -func (p Pointer) IsNil() bool { - return p.p == 0 -} - -// Uintptr returns the pointer as a uintptr. -func (p Pointer) Uintptr() uintptr { - return p.p -} diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go deleted file mode 100644 index 16e6860af6..0000000000 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go +++ /dev/null @@ -1,37 +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. - -//go:build !purego -// +build !purego - -package value - -import ( - "reflect" - "unsafe" -) - -// Pointer is an opaque typed pointer and is guaranteed to be comparable. -type Pointer struct { - p unsafe.Pointer - t reflect.Type -} - -// PointerOf returns a Pointer from v, which must be a -// reflect.Ptr, reflect.Slice, or reflect.Map. -func PointerOf(v reflect.Value) Pointer { - // The proper representation of a pointer is unsafe.Pointer, - // which is necessary if the GC ever uses a moving collector. - return Pointer{unsafe.Pointer(v.Pointer()), v.Type()} -} - -// IsNil reports whether the pointer is nil. -func (p Pointer) IsNil() bool { - return p.p == nil -} - -// Uintptr returns the pointer as a uintptr. -func (p Pointer) Uintptr() uintptr { - return uintptr(p.p) -} diff --git a/vendor/github.com/google/go-cmp/cmp/options.go b/vendor/github.com/google/go-cmp/cmp/options.go index 1f9ca9c489..754496f3b3 100644 --- a/vendor/github.com/google/go-cmp/cmp/options.go +++ b/vendor/github.com/google/go-cmp/cmp/options.go @@ -13,15 +13,15 @@ import ( "github.com/google/go-cmp/cmp/internal/function" ) -// Option configures for specific behavior of Equal and Diff. In particular, -// the fundamental Option functions (Ignore, Transformer, and Comparer), +// Option configures for specific behavior of [Equal] and [Diff]. In particular, +// the fundamental Option functions ([Ignore], [Transformer], and [Comparer]), // configure how equality is determined. // -// The fundamental options may be composed with filters (FilterPath and -// FilterValues) to control the scope over which they are applied. +// The fundamental options may be composed with filters ([FilterPath] and +// [FilterValues]) to control the scope over which they are applied. // -// The cmp/cmpopts package provides helper functions for creating options that -// may be used with Equal and Diff. +// The [github.com/google/go-cmp/cmp/cmpopts] package provides helper functions +// for creating options that may be used with [Equal] and [Diff]. type Option interface { // filter applies all filters and returns the option that remains. // Each option may only read s.curPath and call s.callTTBFunc. @@ -56,9 +56,9 @@ type core struct{} func (core) isCore() {} -// Options is a list of Option values that also satisfies the Option interface. +// Options is a list of [Option] values that also satisfies the [Option] interface. // Helper comparison packages may return an Options value when packing multiple -// Option values into a single Option. When this package processes an Options, +// [Option] values into a single [Option]. When this package processes an Options, // it will be implicitly expanded into a flat list. // // Applying a filter on an Options is equivalent to applying that same filter @@ -105,16 +105,16 @@ func (opts Options) String() string { return fmt.Sprintf("Options{%s}", strings.Join(ss, ", ")) } -// FilterPath returns a new Option where opt is only evaluated if filter f -// returns true for the current Path in the value tree. +// FilterPath returns a new [Option] where opt is only evaluated if filter f +// returns true for the current [Path] in the value tree. // // This filter is called even if a slice element or map entry is missing and // provides an opportunity to ignore such cases. The filter function must be // symmetric such that the filter result is identical regardless of whether the // missing value is from x or y. // -// The option passed in may be an Ignore, Transformer, Comparer, Options, or -// a previously filtered Option. +// The option passed in may be an [Ignore], [Transformer], [Comparer], [Options], or +// a previously filtered [Option]. func FilterPath(f func(Path) bool, opt Option) Option { if f == nil { panic("invalid path filter function") @@ -142,7 +142,7 @@ func (f pathFilter) String() string { return fmt.Sprintf("FilterPath(%s, %v)", function.NameOf(reflect.ValueOf(f.fnc)), f.opt) } -// FilterValues returns a new Option where opt is only evaluated if filter f, +// FilterValues returns a new [Option] where opt is only evaluated if filter f, // which is a function of the form "func(T, T) bool", returns true for the // current pair of values being compared. If either value is invalid or // the type of the values is not assignable to T, then this filter implicitly @@ -154,8 +154,8 @@ func (f pathFilter) String() string { // If T is an interface, it is possible that f is called with two values with // different concrete types that both implement T. // -// The option passed in may be an Ignore, Transformer, Comparer, Options, or -// a previously filtered Option. +// The option passed in may be an [Ignore], [Transformer], [Comparer], [Options], or +// a previously filtered [Option]. func FilterValues(f interface{}, opt Option) Option { v := reflect.ValueOf(f) if !function.IsType(v.Type(), function.ValueFilter) || v.IsNil() { @@ -192,9 +192,9 @@ func (f valuesFilter) String() string { return fmt.Sprintf("FilterValues(%s, %v)", function.NameOf(f.fnc), f.opt) } -// Ignore is an Option that causes all comparisons to be ignored. -// This value is intended to be combined with FilterPath or FilterValues. -// It is an error to pass an unfiltered Ignore option to Equal. +// Ignore is an [Option] that causes all comparisons to be ignored. +// This value is intended to be combined with [FilterPath] or [FilterValues]. +// It is an error to pass an unfiltered Ignore option to [Equal]. func Ignore() Option { return ignore{} } type ignore struct{ core } @@ -234,6 +234,8 @@ func (validator) apply(s *state, vx, vy reflect.Value) { name = fmt.Sprintf("%q.%v", t.PkgPath(), t.Name()) // e.g., "path/to/package".MyType if _, ok := reflect.New(t).Interface().(error); ok { help = "consider using cmpopts.EquateErrors to compare error values" + } else if t.Comparable() { + help = "consider using cmpopts.EquateComparable to compare comparable Go types" } } else { // Unnamed type with unexported fields. Derive PkgPath from field. @@ -254,7 +256,7 @@ const identRx = `[_\p{L}][_\p{L}\p{N}]*` var identsRx = regexp.MustCompile(`^` + identRx + `(\.` + identRx + `)*$`) -// Transformer returns an Option that applies a transformation function that +// Transformer returns an [Option] that applies a transformation function that // converts values of a certain type into that of another. // // The transformer f must be a function "func(T) R" that converts values of @@ -265,13 +267,14 @@ var identsRx = regexp.MustCompile(`^` + identRx + `(\.` + identRx + `)*$`) // same transform to the output of itself (e.g., in the case where the // input and output types are the same), an implicit filter is added such that // a transformer is applicable only if that exact transformer is not already -// in the tail of the Path since the last non-Transform step. +// in the tail of the [Path] since the last non-[Transform] step. // For situations where the implicit filter is still insufficient, -// consider using cmpopts.AcyclicTransformer, which adds a filter -// to prevent the transformer from being recursively applied upon itself. +// consider using [github.com/google/go-cmp/cmp/cmpopts.AcyclicTransformer], +// which adds a filter to prevent the transformer from +// being recursively applied upon itself. // -// The name is a user provided label that is used as the Transform.Name in the -// transformation PathStep (and eventually shown in the Diff output). +// The name is a user provided label that is used as the [Transform.Name] in the +// transformation [PathStep] (and eventually shown in the [Diff] output). // The name must be a valid identifier or qualified identifier in Go syntax. // If empty, an arbitrary name is used. func Transformer(name string, f interface{}) Option { @@ -329,7 +332,7 @@ func (tr transformer) String() string { return fmt.Sprintf("Transformer(%s, %s)", tr.name, function.NameOf(tr.fnc)) } -// Comparer returns an Option that determines whether two values are equal +// Comparer returns an [Option] that determines whether two values are equal // to each other. // // The comparer f must be a function "func(T, T) bool" and is implicitly @@ -377,35 +380,32 @@ 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 +// Exporter returns an [Option] that specifies whether [Equal] is allowed to // introspect into the unexported fields of certain struct types. // // Users of this option must understand that comparing on unexported fields // from external packages is not safe since changes in the internal -// implementation of some external package may cause the result of Equal +// implementation of some external package may cause the result of [Equal] // to unexpectedly change. However, it may be valid to use this option on types // defined in an internal package where the semantic meaning of an unexported // field is in the control of the user. // -// In many cases, a custom Comparer should be used instead that defines +// In many cases, a custom [Comparer] should be used instead that defines // equality as a function of the public API of a type rather than the underlying // unexported implementation. // -// For example, the reflect.Type documentation defines equality to be determined +// For example, the [reflect.Type] documentation defines equality to be determined // by the == operator on the interface (essentially performing a shallow pointer -// comparison) and most attempts to compare *regexp.Regexp types are interested +// comparison) and most attempts to compare *[regexp.Regexp] types are interested // in only checking that the regular expression strings are equal. -// Both of these are accomplished using Comparers: +// Both of these are accomplished using [Comparer] options: // // Comparer(func(x, y reflect.Type) bool { return x == y }) // Comparer(func(x, y *regexp.Regexp) bool { return x.String() == y.String() }) // -// In other cases, the cmpopts.IgnoreUnexported option can be used to ignore -// all unexported fields on specified struct types. +// In other cases, the [github.com/google/go-cmp/cmp/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) } @@ -415,10 +415,10 @@ func (exporter) filter(_ *state, _ reflect.Type, _, _ reflect.Value) applicableO panic("not implemented") } -// AllowUnexported returns an Options that allows Equal to forcibly introspect +// AllowUnexported returns an [Option] that allows [Equal] to forcibly introspect // unexported fields of the specified struct types. // -// See Exporter for the proper use of this option. +// See [Exporter] for the proper use of this option. func AllowUnexported(types ...interface{}) Option { m := make(map[reflect.Type]bool) for _, typ := range types { @@ -432,7 +432,7 @@ func AllowUnexported(types ...interface{}) Option { } // Result represents the comparison result for a single node and -// is provided by cmp when calling Report (see Reporter). +// is provided by cmp when calling Report (see [Reporter]). type Result struct { _ [0]func() // Make Result incomparable flags resultFlags @@ -445,7 +445,7 @@ func (r Result) Equal() bool { } // ByIgnore reports whether the node is equal because it was ignored. -// This never reports true if Equal reports false. +// This never reports true if [Result.Equal] reports false. func (r Result) ByIgnore() bool { return r.flags&reportByIgnore != 0 } @@ -455,7 +455,7 @@ func (r Result) ByMethod() bool { return r.flags&reportByMethod != 0 } -// ByFunc reports whether a Comparer function determined equality. +// ByFunc reports whether a [Comparer] function determined equality. func (r Result) ByFunc() bool { return r.flags&reportByFunc != 0 } @@ -478,7 +478,7 @@ const ( reportByCycle ) -// Reporter is an Option that can be passed to Equal. When Equal traverses +// Reporter is an [Option] that can be passed to [Equal]. When [Equal] traverses // the value trees, it calls PushStep as it descends into each node in the // tree and PopStep as it ascend out of the node. The leaves of the tree are // either compared (determined to be equal or not equal) or ignored and reported diff --git a/vendor/github.com/google/go-cmp/cmp/path.go b/vendor/github.com/google/go-cmp/cmp/path.go index a0a588502e..c3c1456423 100644 --- a/vendor/github.com/google/go-cmp/cmp/path.go +++ b/vendor/github.com/google/go-cmp/cmp/path.go @@ -14,9 +14,9 @@ import ( "github.com/google/go-cmp/cmp/internal/value" ) -// Path is a list of PathSteps describing the sequence of operations to get +// Path is a list of [PathStep] describing the sequence of operations to get // from some root type to the current position in the value tree. -// The first Path element is always an operation-less PathStep that exists +// The first Path element is always an operation-less [PathStep] that exists // simply to identify the initial type. // // When traversing structs with embedded structs, the embedded struct will @@ -29,8 +29,13 @@ type Path []PathStep // a value's tree structure. Users of this package never need to implement // these types as values of this type will be returned by this package. // -// Implementations of this interface are -// StructField, SliceIndex, MapIndex, Indirect, TypeAssertion, and Transform. +// Implementations of this interface: +// - [StructField] +// - [SliceIndex] +// - [MapIndex] +// - [Indirect] +// - [TypeAssertion] +// - [Transform] type PathStep interface { String() string @@ -70,8 +75,9 @@ func (pa *Path) pop() { *pa = (*pa)[:len(*pa)-1] } -// Last returns the last PathStep in the Path. -// If the path is empty, this returns a non-nil PathStep that reports a nil Type. +// Last returns the last [PathStep] in the Path. +// If the path is empty, this returns a non-nil [PathStep] +// that reports a nil [PathStep.Type]. func (pa Path) Last() PathStep { return pa.Index(-1) } @@ -79,7 +85,8 @@ func (pa Path) Last() PathStep { // Index returns the ith step in the Path and supports negative indexing. // A negative index starts counting from the tail of the Path such that -1 // refers to the last step, -2 refers to the second-to-last step, and so on. -// If index is invalid, this returns a non-nil PathStep that reports a nil Type. +// If index is invalid, this returns a non-nil [PathStep] +// that reports a nil [PathStep.Type]. func (pa Path) Index(i int) PathStep { if i < 0 { i = len(pa) + i @@ -168,7 +175,8 @@ func (ps pathStep) String() string { return fmt.Sprintf("{%s}", s) } -// StructField represents a struct field access on a field called Name. +// StructField is a [PathStep] that represents a struct field access +// on a field called [StructField.Name]. type StructField struct{ *structField } type structField struct { pathStep @@ -204,10 +212,11 @@ func (sf StructField) String() string { return fmt.Sprintf(".%s", sf.name) } func (sf StructField) Name() string { return sf.name } // Index is the index of the field in the parent struct type. -// See reflect.Type.Field. +// See [reflect.Type.Field]. func (sf StructField) Index() int { return sf.idx } -// SliceIndex is an index operation on a slice or array at some index Key. +// SliceIndex is a [PathStep] that represents an index operation on +// a slice or array at some index [SliceIndex.Key]. type SliceIndex struct{ *sliceIndex } type sliceIndex struct { pathStep @@ -247,12 +256,12 @@ func (si SliceIndex) Key() int { // all of the indexes to be shifted. If an index is -1, then that // indicates that the element does not exist in the associated slice. // -// Key is guaranteed to return -1 if and only if the indexes returned -// by SplitKeys are not the same. SplitKeys will never return -1 for +// [SliceIndex.Key] is guaranteed to return -1 if and only if the indexes +// returned by SplitKeys are not the same. SplitKeys will never return -1 for // both indexes. func (si SliceIndex) SplitKeys() (ix, iy int) { return si.xkey, si.ykey } -// MapIndex is an index operation on a map at some index Key. +// MapIndex is a [PathStep] that represents an index operation on a map at some index Key. type MapIndex struct{ *mapIndex } type mapIndex struct { pathStep @@ -266,7 +275,7 @@ func (mi MapIndex) String() string { return fmt.Sprintf("[%#v]", // Key is the value of the map key. func (mi MapIndex) Key() reflect.Value { return mi.key } -// Indirect represents pointer indirection on the parent type. +// Indirect is a [PathStep] that represents pointer indirection on the parent type. type Indirect struct{ *indirect } type indirect struct { pathStep @@ -276,7 +285,7 @@ func (in Indirect) Type() reflect.Type { return in.typ } func (in Indirect) Values() (vx, vy reflect.Value) { return in.vx, in.vy } func (in Indirect) String() string { return "*" } -// TypeAssertion represents a type assertion on an interface. +// TypeAssertion is a [PathStep] that represents a type assertion on an interface. type TypeAssertion struct{ *typeAssertion } type typeAssertion struct { pathStep @@ -286,7 +295,8 @@ func (ta TypeAssertion) Type() reflect.Type { return ta.typ } func (ta TypeAssertion) Values() (vx, vy reflect.Value) { return ta.vx, ta.vy } func (ta TypeAssertion) String() string { return fmt.Sprintf(".(%v)", value.TypeString(ta.typ, false)) } -// Transform is a transformation from the parent type to the current type. +// Transform is a [PathStep] that represents a transformation +// from the parent type to the current type. type Transform struct{ *transform } type transform struct { pathStep @@ -297,13 +307,13 @@ func (tf Transform) Type() reflect.Type { return tf.typ } func (tf Transform) Values() (vx, vy reflect.Value) { return tf.vx, tf.vy } func (tf Transform) String() string { return fmt.Sprintf("%s()", tf.trans.name) } -// Name is the name of the Transformer. +// Name is the name of the [Transformer]. func (tf Transform) Name() string { return tf.trans.name } // Func is the function pointer to the transformer function. func (tf Transform) Func() reflect.Value { return tf.trans.fnc } -// Option returns the originally constructed Transformer option. +// Option returns the originally constructed [Transformer] option. // The == operator can be used to detect the exact option used. func (tf Transform) Option() Option { return tf.trans } 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 2ab41fad3f..e39f42284e 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_reflect.go +++ b/vendor/github.com/google/go-cmp/cmp/report_reflect.go @@ -199,7 +199,7 @@ func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind, break } sf := t.Field(i) - if supportExporters && !isExported(sf.Name) { + if !isExported(sf.Name) { vv = retrieveUnexportedField(v, sf, true) } s := opts.WithTypeMode(autoType).FormatValue(vv, t.Kind(), ptrs) diff --git a/vendor/github.com/google/uuid/.travis.yml b/vendor/github.com/google/uuid/.travis.yml deleted file mode 100644 index d8156a60ba..0000000000 --- a/vendor/github.com/google/uuid/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: go - -go: - - 1.4.3 - - 1.5.3 - - tip - -script: - - go test -v ./... diff --git a/vendor/github.com/google/uuid/CHANGELOG.md b/vendor/github.com/google/uuid/CHANGELOG.md new file mode 100644 index 0000000000..7ec5ac7ea9 --- /dev/null +++ b/vendor/github.com/google/uuid/CHANGELOG.md @@ -0,0 +1,41 @@ +# Changelog + +## [1.6.0](https://github.com/google/uuid/compare/v1.5.0...v1.6.0) (2024-01-16) + + +### Features + +* add Max UUID constant ([#149](https://github.com/google/uuid/issues/149)) ([c58770e](https://github.com/google/uuid/commit/c58770eb495f55fe2ced6284f93c5158a62e53e3)) + + +### Bug Fixes + +* fix typo in version 7 uuid documentation ([#153](https://github.com/google/uuid/issues/153)) ([016b199](https://github.com/google/uuid/commit/016b199544692f745ffc8867b914129ecb47ef06)) +* Monotonicity in UUIDv7 ([#150](https://github.com/google/uuid/issues/150)) ([a2b2b32](https://github.com/google/uuid/commit/a2b2b32373ff0b1a312b7fdf6d38a977099698a6)) + +## [1.5.0](https://github.com/google/uuid/compare/v1.4.0...v1.5.0) (2023-12-12) + + +### Features + +* Validate UUID without creating new UUID ([#141](https://github.com/google/uuid/issues/141)) ([9ee7366](https://github.com/google/uuid/commit/9ee7366e66c9ad96bab89139418a713dc584ae29)) + +## [1.4.0](https://github.com/google/uuid/compare/v1.3.1...v1.4.0) (2023-10-26) + + +### Features + +* UUIDs slice type with Strings() convenience method ([#133](https://github.com/google/uuid/issues/133)) ([cd5fbbd](https://github.com/google/uuid/commit/cd5fbbdd02f3e3467ac18940e07e062be1f864b4)) + +### Fixes + +* Clarify that Parse's job is to parse but not necessarily validate strings. (Documents current behavior) + +## [1.3.1](https://github.com/google/uuid/compare/v1.3.0...v1.3.1) (2023-08-18) + + +### Bug Fixes + +* Use .EqualFold() to parse urn prefixed UUIDs ([#118](https://github.com/google/uuid/issues/118)) ([574e687](https://github.com/google/uuid/commit/574e6874943741fb99d41764c705173ada5293f0)) + +## Changelog diff --git a/vendor/github.com/google/uuid/CONTRIBUTING.md b/vendor/github.com/google/uuid/CONTRIBUTING.md index 04fdf09f13..a502fdc515 100644 --- a/vendor/github.com/google/uuid/CONTRIBUTING.md +++ b/vendor/github.com/google/uuid/CONTRIBUTING.md @@ -2,6 +2,22 @@ We definitely welcome patches and contribution to this project! +### Tips + +Commits must be formatted according to the [Conventional Commits Specification](https://www.conventionalcommits.org). + +Always try to include a test case! If it is not possible or not necessary, +please explain why in the pull request description. + +### Releasing + +Commits that would precipitate a SemVer change, as described in the Conventional +Commits Specification, will trigger [`release-please`](https://github.com/google-github-actions/release-please-action) +to create a release candidate pull request. Once submitted, `release-please` +will create a release. + +For tips on how to work with `release-please`, see its documentation. + ### Legal requirements In order to protect both you and ourselves, you will need to sign the diff --git a/vendor/github.com/google/uuid/README.md b/vendor/github.com/google/uuid/README.md index f765a46f91..3e9a61889d 100644 --- a/vendor/github.com/google/uuid/README.md +++ b/vendor/github.com/google/uuid/README.md @@ -1,6 +1,6 @@ -# uuid ![build status](https://travis-ci.org/google/uuid.svg?branch=master) +# uuid The uuid package generates and inspects UUIDs based on -[RFC 4122](http://tools.ietf.org/html/rfc4122) +[RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122) and DCE 1.1: Authentication and Security Services. This package is based on the github.com/pborman/uuid package (previously named @@ -9,10 +9,12 @@ a UUID is a 16 byte array rather than a byte slice. One loss due to this change is the ability to represent an invalid UUID (vs a NIL UUID). ###### Install -`go get github.com/google/uuid` +```sh +go get github.com/google/uuid +``` ###### Documentation -[![GoDoc](https://godoc.org/github.com/google/uuid?status.svg)](http://godoc.org/github.com/google/uuid) +[![Go Reference](https://pkg.go.dev/badge/github.com/google/uuid.svg)](https://pkg.go.dev/github.com/google/uuid) Full `go doc` style documentation for the package can be viewed online without installing this package by using the GoDoc site here: diff --git a/vendor/github.com/google/uuid/hash.go b/vendor/github.com/google/uuid/hash.go index b404f4bec2..dc60082d3b 100644 --- a/vendor/github.com/google/uuid/hash.go +++ b/vendor/github.com/google/uuid/hash.go @@ -17,6 +17,12 @@ var ( NameSpaceOID = Must(Parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8")) NameSpaceX500 = Must(Parse("6ba7b814-9dad-11d1-80b4-00c04fd430c8")) Nil UUID // empty UUID, all zeros + + // The Max UUID is special form of UUID that is specified to have all 128 bits set to 1. + Max = UUID{ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + } ) // NewHash returns a new UUID derived from the hash of space concatenated with diff --git a/vendor/github.com/google/uuid/node_js.go b/vendor/github.com/google/uuid/node_js.go index 24b78edc90..b2a0bc8711 100644 --- a/vendor/github.com/google/uuid/node_js.go +++ b/vendor/github.com/google/uuid/node_js.go @@ -7,6 +7,6 @@ package uuid // getHardwareInterface returns nil values for the JS version of the code. -// This remvoves the "net" dependency, because it is not used in the browser. +// This removes the "net" dependency, because it is not used in the browser. // Using the "net" library inflates the size of the transpiled JS code by 673k bytes. func getHardwareInterface(name string) (string, []byte) { return "", nil } diff --git a/vendor/github.com/google/uuid/time.go b/vendor/github.com/google/uuid/time.go index e6ef06cdc8..c351129279 100644 --- a/vendor/github.com/google/uuid/time.go +++ b/vendor/github.com/google/uuid/time.go @@ -108,12 +108,23 @@ func setClockSequence(seq int) { } // Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in -// uuid. The time is only defined for version 1 and 2 UUIDs. +// uuid. The time is only defined for version 1, 2, 6 and 7 UUIDs. func (uuid UUID) Time() Time { - time := int64(binary.BigEndian.Uint32(uuid[0:4])) - time |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32 - time |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48 - return Time(time) + var t Time + switch uuid.Version() { + case 6: + time := binary.BigEndian.Uint64(uuid[:8]) // Ignore uuid[6] version b0110 + t = Time(time) + case 7: + time := binary.BigEndian.Uint64(uuid[:8]) + t = Time((time>>16)*10000 + g1582ns100) + default: // forward compatible + time := int64(binary.BigEndian.Uint32(uuid[0:4])) + time |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32 + time |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48 + t = Time(time) + } + return t } // ClockSequence returns the clock sequence encoded in uuid. diff --git a/vendor/github.com/google/uuid/uuid.go b/vendor/github.com/google/uuid/uuid.go index a57207aeb6..5232b48678 100644 --- a/vendor/github.com/google/uuid/uuid.go +++ b/vendor/github.com/google/uuid/uuid.go @@ -56,11 +56,15 @@ func IsInvalidLengthError(err error) bool { return ok } -// Parse decodes s into a UUID or returns an error. Both the standard UUID -// forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and -// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the -// Microsoft encoding {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} and the raw hex -// encoding: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. +// Parse decodes s into a UUID or returns an error if it cannot be parsed. Both +// the standard UUID forms defined in RFC 4122 +// (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and +// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) are decoded. In addition, +// Parse accepts non-standard strings such as the raw hex encoding +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx and 38 byte "Microsoft style" encodings, +// e.g. {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. Only the middle 36 bytes are +// examined in the latter case. Parse should not be used to validate strings as +// it parses non-standard encodings as indicated above. func Parse(s string) (UUID, error) { var uuid UUID switch len(s) { @@ -69,7 +73,7 @@ func Parse(s string) (UUID, error) { // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx case 36 + 9: - if strings.ToLower(s[:9]) != "urn:uuid:" { + if !strings.EqualFold(s[:9], "urn:uuid:") { return uuid, fmt.Errorf("invalid urn prefix: %q", s[:9]) } s = s[9:] @@ -101,7 +105,8 @@ func Parse(s string) (UUID, error) { 9, 11, 14, 16, 19, 21, - 24, 26, 28, 30, 32, 34} { + 24, 26, 28, 30, 32, 34, + } { v, ok := xtob(s[x], s[x+1]) if !ok { return uuid, errors.New("invalid UUID format") @@ -117,7 +122,7 @@ func ParseBytes(b []byte) (UUID, error) { switch len(b) { case 36: // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx case 36 + 9: // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - if !bytes.Equal(bytes.ToLower(b[:9]), []byte("urn:uuid:")) { + if !bytes.EqualFold(b[:9], []byte("urn:uuid:")) { return uuid, fmt.Errorf("invalid urn prefix: %q", b[:9]) } b = b[9:] @@ -145,7 +150,8 @@ func ParseBytes(b []byte) (UUID, error) { 9, 11, 14, 16, 19, 21, - 24, 26, 28, 30, 32, 34} { + 24, 26, 28, 30, 32, 34, + } { v, ok := xtob(b[x], b[x+1]) if !ok { return uuid, errors.New("invalid UUID format") @@ -180,6 +186,59 @@ func Must(uuid UUID, err error) UUID { return uuid } +// Validate returns an error if s is not a properly formatted UUID in one of the following formats: +// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +// {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} +// It returns an error if the format is invalid, otherwise nil. +func Validate(s string) error { + switch len(s) { + // Standard UUID format + case 36: + + // UUID with "urn:uuid:" prefix + case 36 + 9: + if !strings.EqualFold(s[:9], "urn:uuid:") { + return fmt.Errorf("invalid urn prefix: %q", s[:9]) + } + s = s[9:] + + // UUID enclosed in braces + case 36 + 2: + if s[0] != '{' || s[len(s)-1] != '}' { + return fmt.Errorf("invalid bracketed UUID format") + } + s = s[1 : len(s)-1] + + // UUID without hyphens + case 32: + for i := 0; i < len(s); i += 2 { + _, ok := xtob(s[i], s[i+1]) + if !ok { + return errors.New("invalid UUID format") + } + } + + default: + return invalidLengthError{len(s)} + } + + // Check for standard UUID format + if len(s) == 36 { + if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' { + return errors.New("invalid UUID format") + } + for _, x := range []int{0, 2, 4, 6, 9, 11, 14, 16, 19, 21, 24, 26, 28, 30, 32, 34} { + if _, ok := xtob(s[x], s[x+1]); !ok { + return errors.New("invalid UUID format") + } + } + } + + return nil +} + // String returns the string form of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx // , or "" if uuid is invalid. func (uuid UUID) String() string { @@ -292,3 +351,15 @@ func DisableRandPool() { poolMu.Lock() poolPos = randPoolSize } + +// UUIDs is a slice of UUID types. +type UUIDs []UUID + +// Strings returns a string slice containing the string form of each UUID in uuids. +func (uuids UUIDs) Strings() []string { + var uuidStrs = make([]string, len(uuids)) + for i, uuid := range uuids { + uuidStrs[i] = uuid.String() + } + return uuidStrs +} diff --git a/vendor/github.com/google/uuid/version6.go b/vendor/github.com/google/uuid/version6.go new file mode 100644 index 0000000000..339a959a7a --- /dev/null +++ b/vendor/github.com/google/uuid/version6.go @@ -0,0 +1,56 @@ +// Copyright 2023 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package uuid + +import "encoding/binary" + +// UUID version 6 is a field-compatible version of UUIDv1, reordered for improved DB locality. +// It is expected that UUIDv6 will primarily be used in contexts where there are existing v1 UUIDs. +// Systems that do not involve legacy UUIDv1 SHOULD consider using UUIDv7 instead. +// +// see https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-03#uuidv6 +// +// NewV6 returns a Version 6 UUID based on the current NodeID and clock +// sequence, and the current time. If the NodeID has not been set by SetNodeID +// or SetNodeInterface then it will be set automatically. If the NodeID cannot +// be set NewV6 set NodeID is random bits automatically . If clock sequence has not been set by +// SetClockSequence then it will be set automatically. If GetTime fails to +// return the current NewV6 returns Nil and an error. +func NewV6() (UUID, error) { + var uuid UUID + now, seq, err := GetTime() + if err != nil { + return uuid, err + } + + /* + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | time_high | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | time_mid | time_low_and_version | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |clk_seq_hi_res | clk_seq_low | node (0-1) | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | node (2-5) | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ + + binary.BigEndian.PutUint64(uuid[0:], uint64(now)) + binary.BigEndian.PutUint16(uuid[8:], seq) + + uuid[6] = 0x60 | (uuid[6] & 0x0F) + uuid[8] = 0x80 | (uuid[8] & 0x3F) + + nodeMu.Lock() + if nodeID == zeroID { + setNodeInterface("") + } + copy(uuid[10:], nodeID[:]) + nodeMu.Unlock() + + return uuid, nil +} diff --git a/vendor/github.com/google/uuid/version7.go b/vendor/github.com/google/uuid/version7.go new file mode 100644 index 0000000000..3167b643d4 --- /dev/null +++ b/vendor/github.com/google/uuid/version7.go @@ -0,0 +1,104 @@ +// Copyright 2023 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package uuid + +import ( + "io" +) + +// UUID version 7 features a time-ordered value field derived from the widely +// implemented and well known Unix Epoch timestamp source, +// the number of milliseconds seconds since midnight 1 Jan 1970 UTC, leap seconds excluded. +// As well as improved entropy characteristics over versions 1 or 6. +// +// see https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-03#name-uuid-version-7 +// +// Implementations SHOULD utilize UUID version 7 over UUID version 1 and 6 if possible. +// +// NewV7 returns a Version 7 UUID based on the current time(Unix Epoch). +// Uses the randomness pool if it was enabled with EnableRandPool. +// On error, NewV7 returns Nil and an error +func NewV7() (UUID, error) { + uuid, err := NewRandom() + if err != nil { + return uuid, err + } + makeV7(uuid[:]) + return uuid, nil +} + +// NewV7FromReader returns a Version 7 UUID based on the current time(Unix Epoch). +// it use NewRandomFromReader fill random bits. +// On error, NewV7FromReader returns Nil and an error. +func NewV7FromReader(r io.Reader) (UUID, error) { + uuid, err := NewRandomFromReader(r) + if err != nil { + return uuid, err + } + + makeV7(uuid[:]) + return uuid, nil +} + +// makeV7 fill 48 bits time (uuid[0] - uuid[5]), set version b0111 (uuid[6]) +// uuid[8] already has the right version number (Variant is 10) +// see function NewV7 and NewV7FromReader +func makeV7(uuid []byte) { + /* + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | unix_ts_ms | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | unix_ts_ms | ver | rand_a (12 bit seq) | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |var| rand_b | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | rand_b | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ + _ = uuid[15] // bounds check + + t, s := getV7Time() + + uuid[0] = byte(t >> 40) + uuid[1] = byte(t >> 32) + uuid[2] = byte(t >> 24) + uuid[3] = byte(t >> 16) + uuid[4] = byte(t >> 8) + uuid[5] = byte(t) + + uuid[6] = 0x70 | (0x0F & byte(s>>8)) + uuid[7] = byte(s) +} + +// lastV7time is the last time we returned stored as: +// +// 52 bits of time in milliseconds since epoch +// 12 bits of (fractional nanoseconds) >> 8 +var lastV7time int64 + +const nanoPerMilli = 1000000 + +// getV7Time returns the time in milliseconds and nanoseconds / 256. +// The returned (milli << 12 + seq) is guarenteed to be greater than +// (milli << 12 + seq) returned by any previous call to getV7Time. +func getV7Time() (milli, seq int64) { + timeMu.Lock() + defer timeMu.Unlock() + + nano := timeNow().UnixNano() + milli = nano / nanoPerMilli + // Sequence number is between 0 and 3906 (nanoPerMilli>>8) + seq = (nano - milli*nanoPerMilli) >> 8 + now := milli<<12 + seq + if now <= lastV7time { + now = lastV7time + 1 + milli = now >> 12 + seq = now & 0xfff + } + lastV7time = now + return milli, seq +} diff --git a/vendor/github.com/hashicorp/go-version/.travis.yml b/vendor/github.com/hashicorp/go-version/.travis.yml deleted file mode 100644 index 01c5dc219a..0000000000 --- a/vendor/github.com/hashicorp/go-version/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go - -go: - - 1.2 - - 1.3 - - 1.4 - - 1.9 - - "1.10" - - 1.11 - - 1.12 - -script: - - go test diff --git a/vendor/github.com/hashicorp/go-version/CHANGELOG.md b/vendor/github.com/hashicorp/go-version/CHANGELOG.md new file mode 100644 index 0000000000..6d48174bfb --- /dev/null +++ b/vendor/github.com/hashicorp/go-version/CHANGELOG.md @@ -0,0 +1,64 @@ +# 1.7.0 (May 24, 2024) + +ENHANCEMENTS: + +- Remove `reflect` dependency ([#91](https://github.com/hashicorp/go-version/pull/91)) +- Implement the `database/sql.Scanner` and `database/sql/driver.Value` interfaces for `Version` ([#133](https://github.com/hashicorp/go-version/pull/133)) + +INTERNAL: + +- [COMPLIANCE] Add Copyright and License Headers ([#115](https://github.com/hashicorp/go-version/pull/115)) +- [COMPLIANCE] Update MPL-2.0 LICENSE ([#105](https://github.com/hashicorp/go-version/pull/105)) +- Bump actions/cache from 3.0.11 to 3.2.5 ([#116](https://github.com/hashicorp/go-version/pull/116)) +- Bump actions/checkout from 3.2.0 to 3.3.0 ([#111](https://github.com/hashicorp/go-version/pull/111)) +- Bump actions/upload-artifact from 3.1.1 to 3.1.2 ([#112](https://github.com/hashicorp/go-version/pull/112)) +- GHA Migration ([#103](https://github.com/hashicorp/go-version/pull/103)) +- github: Pin external GitHub Actions to hashes ([#107](https://github.com/hashicorp/go-version/pull/107)) +- SEC-090: Automated trusted workflow pinning (2023-04-05) ([#124](https://github.com/hashicorp/go-version/pull/124)) +- update readme ([#104](https://github.com/hashicorp/go-version/pull/104)) + +# 1.6.0 (June 28, 2022) + +FEATURES: + +- Add `Prerelease` function to `Constraint` to return true if the version includes a prerelease field ([#100](https://github.com/hashicorp/go-version/pull/100)) + +# 1.5.0 (May 18, 2022) + +FEATURES: + +- Use `encoding` `TextMarshaler` & `TextUnmarshaler` instead of JSON equivalents ([#95](https://github.com/hashicorp/go-version/pull/95)) +- Add JSON handlers to allow parsing from/to JSON ([#93](https://github.com/hashicorp/go-version/pull/93)) + +# 1.4.0 (January 5, 2022) + +FEATURES: + + - Introduce `MustConstraints()` ([#87](https://github.com/hashicorp/go-version/pull/87)) + - `Constraints`: Introduce `Equals()` and `sort.Interface` methods ([#88](https://github.com/hashicorp/go-version/pull/88)) + +# 1.3.0 (March 31, 2021) + +Please note that CHANGELOG.md does not exist in the source code prior to this release. + +FEATURES: + - Add `Core` function to return a version without prerelease or metadata ([#85](https://github.com/hashicorp/go-version/pull/85)) + +# 1.2.1 (June 17, 2020) + +BUG FIXES: + - Prevent `Version.Equal` method from panicking on `nil` encounter ([#73](https://github.com/hashicorp/go-version/pull/73)) + +# 1.2.0 (April 23, 2019) + +FEATURES: + - Add `GreaterThanOrEqual` and `LessThanOrEqual` helper methods ([#53](https://github.com/hashicorp/go-version/pull/53)) + +# 1.1.0 (Jan 07, 2019) + +FEATURES: + - Add `NewSemver` constructor ([#45](https://github.com/hashicorp/go-version/pull/45)) + +# 1.0.0 (August 24, 2018) + +Initial release. diff --git a/vendor/github.com/hashicorp/go-version/LICENSE b/vendor/github.com/hashicorp/go-version/LICENSE index c33dcc7c92..1409d6ab92 100644 --- a/vendor/github.com/hashicorp/go-version/LICENSE +++ b/vendor/github.com/hashicorp/go-version/LICENSE @@ -1,3 +1,5 @@ +Copyright (c) 2014 HashiCorp, Inc. + Mozilla Public License, version 2.0 1. Definitions diff --git a/vendor/github.com/hashicorp/go-version/README.md b/vendor/github.com/hashicorp/go-version/README.md index 6f3a15ce77..4b7806cd96 100644 --- a/vendor/github.com/hashicorp/go-version/README.md +++ b/vendor/github.com/hashicorp/go-version/README.md @@ -1,5 +1,6 @@ # Versioning Library for Go -[![Build Status](https://travis-ci.org/hashicorp/go-version.svg?branch=master)](https://travis-ci.org/hashicorp/go-version) +![Build Status](https://github.com/hashicorp/go-version/actions/workflows/go-tests.yml/badge.svg) +[![GoDoc](https://godoc.org/github.com/hashicorp/go-version?status.svg)](https://godoc.org/github.com/hashicorp/go-version) go-version is a library for parsing versions and version constraints, and verifying versions against a set of constraints. go-version diff --git a/vendor/github.com/hashicorp/go-version/constraint.go b/vendor/github.com/hashicorp/go-version/constraint.go index d055759611..29bdc4d2b5 100644 --- a/vendor/github.com/hashicorp/go-version/constraint.go +++ b/vendor/github.com/hashicorp/go-version/constraint.go @@ -1,9 +1,12 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package version import ( "fmt" - "reflect" "regexp" + "sort" "strings" ) @@ -11,30 +14,40 @@ import ( // ">= 1.0". type Constraint struct { f constraintFunc + op operator check *Version original string } +func (c *Constraint) Equals(con *Constraint) bool { + return c.op == con.op && c.check.Equal(con.check) +} + // Constraints is a slice of constraints. We make a custom type so that // we can add methods to it. type Constraints []*Constraint type constraintFunc func(v, c *Version) bool -var constraintOperators map[string]constraintFunc +var constraintOperators map[string]constraintOperation + +type constraintOperation struct { + op operator + f constraintFunc +} var constraintRegexp *regexp.Regexp func init() { - constraintOperators = map[string]constraintFunc{ - "": constraintEqual, - "=": constraintEqual, - "!=": constraintNotEqual, - ">": constraintGreaterThan, - "<": constraintLessThan, - ">=": constraintGreaterThanEqual, - "<=": constraintLessThanEqual, - "~>": constraintPessimistic, + constraintOperators = map[string]constraintOperation{ + "": {op: equal, f: constraintEqual}, + "=": {op: equal, f: constraintEqual}, + "!=": {op: notEqual, f: constraintNotEqual}, + ">": {op: greaterThan, f: constraintGreaterThan}, + "<": {op: lessThan, f: constraintLessThan}, + ">=": {op: greaterThanEqual, f: constraintGreaterThanEqual}, + "<=": {op: lessThanEqual, f: constraintLessThanEqual}, + "~>": {op: pessimistic, f: constraintPessimistic}, } ops := make([]string, 0, len(constraintOperators)) @@ -66,6 +79,16 @@ func NewConstraint(v string) (Constraints, error) { return Constraints(result), nil } +// MustConstraints is a helper that wraps a call to a function +// returning (Constraints, error) and panics if error is non-nil. +func MustConstraints(c Constraints, err error) Constraints { + if err != nil { + panic(err) + } + + return c +} + // Check tests if a version satisfies all the constraints. func (cs Constraints) Check(v *Version) bool { for _, c := range cs { @@ -77,6 +100,56 @@ func (cs Constraints) Check(v *Version) bool { return true } +// Equals compares Constraints with other Constraints +// for equality. This may not represent logical equivalence +// of compared constraints. +// e.g. even though '>0.1,>0.2' is logically equivalent +// to '>0.2' it is *NOT* treated as equal. +// +// Missing operator is treated as equal to '=', whitespaces +// are ignored and constraints are sorted before comaparison. +func (cs Constraints) Equals(c Constraints) bool { + if len(cs) != len(c) { + return false + } + + // make copies to retain order of the original slices + left := make(Constraints, len(cs)) + copy(left, cs) + sort.Stable(left) + right := make(Constraints, len(c)) + copy(right, c) + sort.Stable(right) + + // compare sorted slices + for i, con := range left { + if !con.Equals(right[i]) { + return false + } + } + + return true +} + +func (cs Constraints) Len() int { + return len(cs) +} + +func (cs Constraints) Less(i, j int) bool { + if cs[i].op < cs[j].op { + return true + } + if cs[i].op > cs[j].op { + return false + } + + return cs[i].check.LessThan(cs[j].check) +} + +func (cs Constraints) Swap(i, j int) { + cs[i], cs[j] = cs[j], cs[i] +} + // Returns the string format of the constraints func (cs Constraints) String() string { csStr := make([]string, len(cs)) @@ -92,6 +165,12 @@ func (c *Constraint) Check(v *Version) bool { return c.f(v, c.check) } +// Prerelease returns true if the version underlying this constraint +// contains a prerelease field. +func (c *Constraint) Prerelease() bool { + return len(c.check.Prerelease()) > 0 +} + func (c *Constraint) String() string { return c.original } @@ -107,8 +186,11 @@ func parseSingle(v string) (*Constraint, error) { return nil, err } + cop := constraintOperators[matches[1]] + return &Constraint{ - f: constraintOperators[matches[1]], + f: cop.f, + op: cop.op, check: check, original: v, }, nil @@ -119,7 +201,7 @@ func prereleaseCheck(v, c *Version) bool { case cPre && vPre: // A constraint with a pre-release can only match a pre-release version // with the same base segments. - return reflect.DeepEqual(c.Segments64(), v.Segments64()) + return v.equalSegments(c) case !cPre && vPre: // A constraint without a pre-release can only match a version without a @@ -138,6 +220,18 @@ func prereleaseCheck(v, c *Version) bool { // Constraint functions //------------------------------------------------------------------- +type operator rune + +const ( + equal operator = '=' + notEqual operator = '≠' + greaterThan operator = '>' + lessThan operator = '<' + greaterThanEqual operator = '≥' + lessThanEqual operator = '≤' + pessimistic operator = '~' +) + func constraintEqual(v, c *Version) bool { return v.Equal(c) } diff --git a/vendor/github.com/hashicorp/go-version/version.go b/vendor/github.com/hashicorp/go-version/version.go index 1032c5606c..7c683c2813 100644 --- a/vendor/github.com/hashicorp/go-version/version.go +++ b/vendor/github.com/hashicorp/go-version/version.go @@ -1,9 +1,12 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package version import ( "bytes" + "database/sql/driver" "fmt" - "reflect" "regexp" "strconv" "strings" @@ -64,7 +67,6 @@ func newVersion(v string, pattern *regexp.Regexp) (*Version, error) { } segmentsStr := strings.Split(matches[1], ".") segments := make([]int64, len(segmentsStr)) - si := 0 for i, str := range segmentsStr { val, err := strconv.ParseInt(str, 10, 64) if err != nil { @@ -72,8 +74,7 @@ func newVersion(v string, pattern *regexp.Regexp) (*Version, error) { "Error parsing version: %s", err) } - segments[i] = int64(val) - si++ + segments[i] = val } // Even though we could support more than three segments, if we @@ -92,7 +93,7 @@ func newVersion(v string, pattern *regexp.Regexp) (*Version, error) { metadata: matches[10], pre: pre, segments: segments, - si: si, + si: len(segmentsStr), original: v, }, nil } @@ -119,11 +120,8 @@ func (v *Version) Compare(other *Version) int { return 0 } - segmentsSelf := v.Segments64() - segmentsOther := other.Segments64() - // If the segments are the same, we must compare on prerelease info - if reflect.DeepEqual(segmentsSelf, segmentsOther) { + if v.equalSegments(other) { preSelf := v.Prerelease() preOther := other.Prerelease() if preSelf == "" && preOther == "" { @@ -139,6 +137,8 @@ func (v *Version) Compare(other *Version) int { return comparePrereleases(preSelf, preOther) } + segmentsSelf := v.Segments64() + segmentsOther := other.Segments64() // Get the highest specificity (hS), or if they're equal, just use segmentSelf length lenSelf := len(segmentsSelf) lenOther := len(segmentsOther) @@ -162,7 +162,7 @@ func (v *Version) Compare(other *Version) int { // this means Other had the lower specificity // Check to see if the remaining segments in Self are all zeros - if !allZero(segmentsSelf[i:]) { - //if not, it means that Self has to be greater than Other + // if not, it means that Self has to be greater than Other return 1 } break @@ -182,6 +182,21 @@ func (v *Version) Compare(other *Version) int { return 0 } +func (v *Version) equalSegments(other *Version) bool { + segmentsSelf := v.Segments64() + segmentsOther := other.Segments64() + + if len(segmentsSelf) != len(segmentsOther) { + return false + } + for i, v := range segmentsSelf { + if v != segmentsOther[i] { + return false + } + } + return true +} + func allZero(segs []int64) bool { for _, s := range segs { if s != 0 { @@ -278,8 +293,20 @@ func comparePrereleases(v string, other string) int { return 0 } +// Core returns a new version constructed from only the MAJOR.MINOR.PATCH +// segments of the version, without prerelease or metadata. +func (v *Version) Core() *Version { + segments := v.Segments64() + segmentsOnly := fmt.Sprintf("%d.%d.%d", segments[0], segments[1], segments[2]) + return Must(NewVersion(segmentsOnly)) +} + // Equal tests if two versions are equal. func (v *Version) Equal(o *Version) bool { + if v == nil || o == nil { + return v == o + } + return v.Compare(o) == 0 } @@ -288,7 +315,7 @@ func (v *Version) GreaterThan(o *Version) bool { return v.Compare(o) > 0 } -// GreaterThanOrEqualTo tests if this version is greater than or equal to another version. +// GreaterThanOrEqual tests if this version is greater than or equal to another version. func (v *Version) GreaterThanOrEqual(o *Version) bool { return v.Compare(o) >= 0 } @@ -298,7 +325,7 @@ func (v *Version) LessThan(o *Version) bool { return v.Compare(o) < 0 } -// LessThanOrEqualTo tests if this version is less than or equal to another version. +// LessThanOrEqual tests if this version is less than or equal to another version. func (v *Version) LessThanOrEqual(o *Version) bool { return v.Compare(o) <= 0 } @@ -378,3 +405,37 @@ func (v *Version) String() string { func (v *Version) Original() string { return v.original } + +// UnmarshalText implements encoding.TextUnmarshaler interface. +func (v *Version) UnmarshalText(b []byte) error { + temp, err := NewVersion(string(b)) + if err != nil { + return err + } + + *v = *temp + + return nil +} + +// MarshalText implements encoding.TextMarshaler interface. +func (v *Version) MarshalText() ([]byte, error) { + return []byte(v.String()), nil +} + +// Scan implements the sql.Scanner interface. +func (v *Version) Scan(src interface{}) error { + switch src := src.(type) { + case string: + return v.UnmarshalText([]byte(src)) + case nil: + return nil + default: + return fmt.Errorf("cannot scan %T as Version", src) + } +} + +// Value implements the driver.Valuer interface. +func (v *Version) Value() (driver.Value, error) { + return v.String(), nil +} diff --git a/vendor/github.com/hashicorp/go-version/version_collection.go b/vendor/github.com/hashicorp/go-version/version_collection.go index cc888d43e6..83547fe13d 100644 --- a/vendor/github.com/hashicorp/go-version/version_collection.go +++ b/vendor/github.com/hashicorp/go-version/version_collection.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package version // Collection is a type that implements the sort.Interface interface diff --git a/vendor/github.com/hbollon/go-edlib/README.md b/vendor/github.com/hbollon/go-edlib/README.md index ecff68b6b3..0e2c3b201e 100644 --- a/vendor/github.com/hbollon/go-edlib/README.md +++ b/vendor/github.com/hbollon/go-edlib/README.md @@ -44,20 +44,21 @@ Designed to be fully compatible with Unicode characters!
This library is 100% test covered 😁 ## Features -- [Levenshtein](https://en.wikipedia.org/wiki/Levenshtein_distance) ✨ -- [LCS](https://en.wikipedia.org/wiki/Longest_common_subsequence_problem) (Longest common subsequence) with edit distance, backtrack and diff functions ✨ -- [Hamming](https://en.wikipedia.org/wiki/Hamming_distance) ✨ -- [Damerau-Levenshtein](https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance), with following variants : - - OSA (Optimal string alignment) ✨ - - Adjacent transpositions ✨ -- [Jaro & Jaro-Winkler](https://fr.wikipedia.org/wiki/Distance_de_Jaro-Winkler) similarity algorithms ✨ -- [Cosine Similarity](https://en.wikipedia.org/wiki/Cosine_similarity) algorithm to compare strings ✨ -- [Jaccard Index](https://en.wikipedia.org/wiki/Jaccard_index) ✨ - -- Computed similarity percentage functions based on all available edit distance algorithms in this lib ✨ -- Fuzzy search functions based on edit distance with unique or multiples strings output ✨ -- Unicode compatibility ! 🥳 -- And many more to come ! + +- [Levenshtein](https://en.wikipedia.org/wiki/Levenshtein_distance) +- [LCS](https://en.wikipedia.org/wiki/Longest_common_subsequence_problem) (Longest common subsequence) with edit distance, backtrack and diff functions +- [Hamming](https://en.wikipedia.org/wiki/Hamming_distance) +- [Damerau-Levenshtein](https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance), with following variants: + - OSA (Optimal string alignment) + - Adjacent transpositions +- [Jaro & Jaro-Winkler](https://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance) similarity algorithms +- [Cosine Similarity](https://en.wikipedia.org/wiki/Cosine_similarity) +- [Jaccard Index](https://en.wikipedia.org/wiki/Jaccard_index) +- [QGram](https://en.wikipedia.org/wiki/N-gram) +- [Sorensen-Dice](https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient) +- Computed similarity percentage functions based on all available edit distance algorithms in this lib +- Fuzzy search functions based on edit distance with unique or multiples strings output +- Unicode compatibility 🥳 ## Benchmarks You can check an interactive Google chart with few benchmark cases for all similarity algorithms in this library through **StringsSimilarity** function [here](http://benchgraph.codingberg.com/q5) diff --git a/vendor/github.com/hbollon/go-edlib/qgram.go b/vendor/github.com/hbollon/go-edlib/qgram.go new file mode 100644 index 0000000000..118cab5944 --- /dev/null +++ b/vendor/github.com/hbollon/go-edlib/qgram.go @@ -0,0 +1,56 @@ +package edlib + +import ( + "math" +) + +// QgramDistance compute the q-gram similarity between two strings +// Takes two strings as parameters, a split length which defines the k-gram shingle length +func QgramDistance(str1, str2 string, splitLength int) int { + splittedStr1 := Shingle(str1, splitLength) + splittedStr2 := Shingle(str2, splitLength) + + union := make(map[string]int) + for i := range splittedStr1 { + union[i] = 0 + } + for i := range splittedStr2 { + union[i] = 0 + } + + res := 0 + + for i := range union { + res += int(math.Abs(float64(splittedStr1[i] - splittedStr2[i]))) + } + + return res +} + +// QgramDistanceCustomNgram compute the q-gram similarity between two custom set of individuals +// Takes two n-gram map as parameters +func QgramDistanceCustomNgram(splittedStr1, splittedStr2 map[string]int) int { + union := make(map[string]int) + for i := range splittedStr1 { + union[i] = 0 + } + for i := range splittedStr2 { + union[i] = 0 + } + + res := 0 + for i := range union { + res += int(math.Abs(float64(splittedStr1[i] - splittedStr2[i]))) + } + + return res +} + +// QgramSimilarity compute a similarity index (between 0 and 1) between two strings from a Qgram distance +// Takes two strings as parameters, a split length which defines the k-gram shingle length +func QgramSimilarity(str1, str2 string, splitLength int) float32 { + splittedStr1 := Shingle(str1, splitLength) + splittedStr2 := Shingle(str2, splitLength) + res := float32(QgramDistanceCustomNgram(splittedStr1, splittedStr2)) + return 1 - (res / float32(len(splittedStr1)+len(splittedStr2))) +} diff --git a/vendor/github.com/hbollon/go-edlib/sorensen-dice.go b/vendor/github.com/hbollon/go-edlib/sorensen-dice.go new file mode 100644 index 0000000000..214f088438 --- /dev/null +++ b/vendor/github.com/hbollon/go-edlib/sorensen-dice.go @@ -0,0 +1,19 @@ +package edlib + +// SorensenDiceCoefficient computes the Sorensen-Dice coefficient between two strings +// Takes two strings as parameters, a split length which defines the k-gram shingle length +func SorensenDiceCoefficient(str1, str2 string, splitLength int) float32 { + if str1 == "" && str2 == "" { + return 0 + } + shingle1 := Shingle(str1, splitLength) + shingle2 := Shingle(str2, splitLength) + + intersection := float32(0) + for i := range shingle1 { + if _, ok := shingle2[i]; ok { + intersection++ + } + } + return 2.0 * intersection / float32(len(shingle1)+len(shingle2)) +} diff --git a/vendor/github.com/hbollon/go-edlib/string-analysis.go b/vendor/github.com/hbollon/go-edlib/string-analysis.go index a8e27956d5..6f10f820f8 100644 --- a/vendor/github.com/hbollon/go-edlib/string-analysis.go +++ b/vendor/github.com/hbollon/go-edlib/string-analysis.go @@ -20,6 +20,8 @@ const ( JaroWinkler Cosine Jaccard + SorensenDice + Qgram ) // StringsSimilarity return a similarity index [0..1] between two strings based on given edit distance algorithm in parameter. @@ -49,6 +51,10 @@ func StringsSimilarity(str1 string, str2 string, algo Algorithm) (float32, error return CosineSimilarity(str1, str2, 2), nil case Jaccard: return JaccardSimilarity(str1, str2, 2), nil + case SorensenDice: + return SorensenDiceCoefficient(str1, str2, 2), nil + case Qgram: + return QgramSimilarity(str1, str2, 2), nil default: return 0.0, errors.New("Illegal argument for algorithm method") } diff --git a/vendor/github.com/josharian/intern/README.md b/vendor/github.com/josharian/intern/README.md new file mode 100644 index 0000000000..ffc44b219b --- /dev/null +++ b/vendor/github.com/josharian/intern/README.md @@ -0,0 +1,5 @@ +Docs: https://godoc.org/github.com/josharian/intern + +See also [Go issue 5160](https://golang.org/issue/5160). + +License: MIT diff --git a/vendor/github.com/josharian/intern/intern.go b/vendor/github.com/josharian/intern/intern.go new file mode 100644 index 0000000000..7acb1fe90a --- /dev/null +++ b/vendor/github.com/josharian/intern/intern.go @@ -0,0 +1,44 @@ +// Package intern interns strings. +// Interning is best effort only. +// Interned strings may be removed automatically +// at any time without notification. +// All functions may be called concurrently +// with themselves and each other. +package intern + +import "sync" + +var ( + pool sync.Pool = sync.Pool{ + New: func() interface{} { + return make(map[string]string) + }, + } +) + +// String returns s, interned. +func String(s string) string { + m := pool.Get().(map[string]string) + c, ok := m[s] + if ok { + pool.Put(m) + return c + } + m[s] = s + pool.Put(m) + return s +} + +// Bytes returns b converted to a string, interned. +func Bytes(b []byte) string { + m := pool.Get().(map[string]string) + c, ok := m[string(b)] + if ok { + pool.Put(m) + return c + } + s := string(b) + m[s] = s + pool.Put(m) + return s +} diff --git a/vendor/github.com/josharian/intern/license.md b/vendor/github.com/josharian/intern/license.md new file mode 100644 index 0000000000..353d3055f0 --- /dev/null +++ b/vendor/github.com/josharian/intern/license.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Josh Bleecher Snyder + +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/json-iterator/go/README.md b/vendor/github.com/json-iterator/go/README.md index 52b111d5f3..c589addf98 100644 --- a/vendor/github.com/json-iterator/go/README.md +++ b/vendor/github.com/json-iterator/go/README.md @@ -8,8 +8,6 @@ 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) diff --git a/vendor/github.com/klauspost/compress/.gitattributes b/vendor/github.com/klauspost/compress/.gitattributes new file mode 100644 index 0000000000..402433593c --- /dev/null +++ b/vendor/github.com/klauspost/compress/.gitattributes @@ -0,0 +1,2 @@ +* -text +*.bin -text -diff diff --git a/vendor/github.com/klauspost/compress/.gitignore b/vendor/github.com/klauspost/compress/.gitignore new file mode 100644 index 0000000000..d31b378152 --- /dev/null +++ b/vendor/github.com/klauspost/compress/.gitignore @@ -0,0 +1,32 @@ +# 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 +/s2/cmd/_s2sx/sfx-exe + +# Linux perf files +perf.data +perf.data.old + +# gdb history +.gdb_history diff --git a/vendor/github.com/klauspost/compress/.goreleaser.yml b/vendor/github.com/klauspost/compress/.goreleaser.yml new file mode 100644 index 0000000000..a22953805c --- /dev/null +++ b/vendor/github.com/klauspost/compress/.goreleaser.yml @@ -0,0 +1,123 @@ +# This is an example goreleaser.yaml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +before: + hooks: + - ./gen.sh + +builds: + - + id: "s2c" + binary: s2c + main: ./s2/cmd/s2c/main.go + flags: + - -trimpath + env: + - CGO_ENABLED=0 + goos: + - aix + - linux + - freebsd + - netbsd + - windows + - darwin + goarch: + - 386 + - amd64 + - arm + - arm64 + - ppc64 + - ppc64le + - mips64 + - mips64le + goarm: + - 7 + - + id: "s2d" + binary: s2d + main: ./s2/cmd/s2d/main.go + flags: + - -trimpath + env: + - CGO_ENABLED=0 + goos: + - aix + - linux + - freebsd + - netbsd + - windows + - darwin + goarch: + - 386 + - amd64 + - arm + - arm64 + - ppc64 + - ppc64le + - mips64 + - mips64le + goarm: + - 7 + - + id: "s2sx" + binary: s2sx + main: ./s2/cmd/_s2sx/main.go + flags: + - -modfile=s2sx.mod + - -trimpath + env: + - CGO_ENABLED=0 + goos: + - aix + - linux + - freebsd + - netbsd + - windows + - darwin + goarch: + - 386 + - amd64 + - arm + - arm64 + - ppc64 + - ppc64le + - mips64 + - mips64le + goarm: + - 7 + +archives: + - + id: s2-binaries + name_template: "s2-{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" + format_overrides: + - goos: windows + format: zip + files: + - unpack/* + - s2/LICENSE + - s2/README.md +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^doc:' + - '^docs:' + - '^test:' + - '^tests:' + - '^Update\sREADME.md' + +nfpms: + - + file_name_template: "s2_package__{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" + vendor: Klaus Post + homepage: https://github.com/klauspost/compress + maintainer: Klaus Post + description: S2 Compression Tool + license: BSD 3-Clause + formats: + - deb + - rpm diff --git a/vendor/github.com/klauspost/compress/LICENSE b/vendor/github.com/klauspost/compress/LICENSE new file mode 100644 index 0000000000..87d5574777 --- /dev/null +++ b/vendor/github.com/klauspost/compress/LICENSE @@ -0,0 +1,304 @@ +Copyright (c) 2012 The Go Authors. All rights reserved. +Copyright (c) 2019 Klaus Post. 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. + +------------------ + +Files: gzhttp/* + + 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 2016-2017 The New York Times Company + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +------------------ + +Files: s2/cmd/internal/readahead/* + +The MIT License (MIT) + +Copyright (c) 2015 Klaus Post + +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. + +--------------------- +Files: snappy/* +Files: internal/snapref/* + +Copyright (c) 2011 The Snappy-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. + +----------------- + +Files: s2/cmd/internal/filepathx/* + +Copyright 2016 The filepathx Authors + +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/klauspost/compress/README.md b/vendor/github.com/klauspost/compress/README.md new file mode 100644 index 0000000000..05c7359e48 --- /dev/null +++ b/vendor/github.com/klauspost/compress/README.md @@ -0,0 +1,700 @@ +# compress + +This package provides various compression algorithms. + +* [zstandard](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression and decompression in pure Go. +* [S2](https://github.com/klauspost/compress/tree/master/s2#s2-compression) is a high performance replacement for Snappy. +* Optimized [deflate](https://godoc.org/github.com/klauspost/compress/flate) packages which can be used as a dropin replacement for [gzip](https://godoc.org/github.com/klauspost/compress/gzip), [zip](https://godoc.org/github.com/klauspost/compress/zip) and [zlib](https://godoc.org/github.com/klauspost/compress/zlib). +* [snappy](https://github.com/klauspost/compress/tree/master/snappy) is a drop-in replacement for `github.com/golang/snappy` offering better compression and concurrent streams. +* [huff0](https://github.com/klauspost/compress/tree/master/huff0) and [FSE](https://github.com/klauspost/compress/tree/master/fse) implementations for raw entropy encoding. +* [gzhttp](https://github.com/klauspost/compress/tree/master/gzhttp) Provides client and server wrappers for handling gzipped requests efficiently. +* [pgzip](https://github.com/klauspost/pgzip) is a separate package that provides a very fast parallel gzip implementation. + +[![Go Reference](https://pkg.go.dev/badge/klauspost/compress.svg)](https://pkg.go.dev/github.com/klauspost/compress?tab=subdirectories) +[![Go](https://github.com/klauspost/compress/actions/workflows/go.yml/badge.svg)](https://github.com/klauspost/compress/actions/workflows/go.yml) +[![Sourcegraph Badge](https://sourcegraph.com/github.com/klauspost/compress/-/badge.svg)](https://sourcegraph.com/github.com/klauspost/compress?badge) + +# changelog + +* Feb 5th, 2024 - [1.17.6](https://github.com/klauspost/compress/releases/tag/v1.17.6) + * zstd: Fix incorrect repeat coding in best mode https://github.com/klauspost/compress/pull/923 + * s2: Fix DecodeConcurrent deadlock on errors https://github.com/klauspost/compress/pull/925 + +* Jan 26th, 2024 - [v1.17.5](https://github.com/klauspost/compress/releases/tag/v1.17.5) + * flate: Fix reset with dictionary on custom window encodes https://github.com/klauspost/compress/pull/912 + * zstd: Add Frame header encoding and stripping https://github.com/klauspost/compress/pull/908 + * zstd: Limit better/best default window to 8MB https://github.com/klauspost/compress/pull/913 + * zstd: Speed improvements by @greatroar in https://github.com/klauspost/compress/pull/896 https://github.com/klauspost/compress/pull/910 + * s2: Fix callbacks for skippable blocks and disallow 0xfe (Padding) by @Jille in https://github.com/klauspost/compress/pull/916 https://github.com/klauspost/compress/pull/917 +https://github.com/klauspost/compress/pull/919 https://github.com/klauspost/compress/pull/918 + +* Dec 1st, 2023 - [v1.17.4](https://github.com/klauspost/compress/releases/tag/v1.17.4) + * huff0: Speed up symbol counting by @greatroar in https://github.com/klauspost/compress/pull/887 + * huff0: Remove byteReader by @greatroar in https://github.com/klauspost/compress/pull/886 + * gzhttp: Allow overriding decompression on transport https://github.com/klauspost/compress/pull/892 + * gzhttp: Clamp compression level https://github.com/klauspost/compress/pull/890 + * gzip: Error out if reserved bits are set https://github.com/klauspost/compress/pull/891 + +* Nov 15th, 2023 - [v1.17.3](https://github.com/klauspost/compress/releases/tag/v1.17.3) + * fse: Fix max header size https://github.com/klauspost/compress/pull/881 + * zstd: Improve better/best compression https://github.com/klauspost/compress/pull/877 + * gzhttp: Fix missing content type on Close https://github.com/klauspost/compress/pull/883 + +* Oct 22nd, 2023 - [v1.17.2](https://github.com/klauspost/compress/releases/tag/v1.17.2) + * zstd: Fix rare *CORRUPTION* output in "best" mode. See https://github.com/klauspost/compress/pull/876 + +* Oct 14th, 2023 - [v1.17.1](https://github.com/klauspost/compress/releases/tag/v1.17.1) + * s2: Fix S2 "best" dictionary wrong encoding by @klauspost in https://github.com/klauspost/compress/pull/871 + * flate: Reduce allocations in decompressor and minor code improvements by @fakefloordiv in https://github.com/klauspost/compress/pull/869 + * s2: Fix EstimateBlockSize on 6&7 length input by @klauspost in https://github.com/klauspost/compress/pull/867 + +* Sept 19th, 2023 - [v1.17.0](https://github.com/klauspost/compress/releases/tag/v1.17.0) + * Add experimental dictionary builder https://github.com/klauspost/compress/pull/853 + * Add xerial snappy read/writer https://github.com/klauspost/compress/pull/838 + * flate: Add limited window compression https://github.com/klauspost/compress/pull/843 + * s2: Do 2 overlapping match checks https://github.com/klauspost/compress/pull/839 + * flate: Add amd64 assembly matchlen https://github.com/klauspost/compress/pull/837 + * gzip: Copy bufio.Reader on Reset by @thatguystone in https://github.com/klauspost/compress/pull/860 + +
+ See changes to v1.16.x + + +* July 1st, 2023 - [v1.16.7](https://github.com/klauspost/compress/releases/tag/v1.16.7) + * zstd: Fix default level first dictionary encode https://github.com/klauspost/compress/pull/829 + * s2: add GetBufferCapacity() method by @GiedriusS in https://github.com/klauspost/compress/pull/832 + +* June 13, 2023 - [v1.16.6](https://github.com/klauspost/compress/releases/tag/v1.16.6) + * zstd: correctly ignore WithEncoderPadding(1) by @ianlancetaylor in https://github.com/klauspost/compress/pull/806 + * zstd: Add amd64 match length assembly https://github.com/klauspost/compress/pull/824 + * gzhttp: Handle informational headers by @rtribotte in https://github.com/klauspost/compress/pull/815 + * s2: Improve Better compression slightly https://github.com/klauspost/compress/pull/663 + +* Apr 16, 2023 - [v1.16.5](https://github.com/klauspost/compress/releases/tag/v1.16.5) + * zstd: readByte needs to use io.ReadFull by @jnoxon in https://github.com/klauspost/compress/pull/802 + * gzip: Fix WriterTo after initial read https://github.com/klauspost/compress/pull/804 + +* Apr 5, 2023 - [v1.16.4](https://github.com/klauspost/compress/releases/tag/v1.16.4) + * zstd: Improve zstd best efficiency by @greatroar and @klauspost in https://github.com/klauspost/compress/pull/784 + * zstd: Respect WithAllLitEntropyCompression https://github.com/klauspost/compress/pull/792 + * zstd: Fix amd64 not always detecting corrupt data https://github.com/klauspost/compress/pull/785 + * zstd: Various minor improvements by @greatroar in https://github.com/klauspost/compress/pull/788 https://github.com/klauspost/compress/pull/794 https://github.com/klauspost/compress/pull/795 + * s2: Fix huge block overflow https://github.com/klauspost/compress/pull/779 + * s2: Allow CustomEncoder fallback https://github.com/klauspost/compress/pull/780 + * gzhttp: Suppport ResponseWriter Unwrap() in gzhttp handler by @jgimenez in https://github.com/klauspost/compress/pull/799 + +* Mar 13, 2023 - [v1.16.1](https://github.com/klauspost/compress/releases/tag/v1.16.1) + * zstd: Speed up + improve best encoder by @greatroar in https://github.com/klauspost/compress/pull/776 + * gzhttp: Add optional [BREACH mitigation](https://github.com/klauspost/compress/tree/master/gzhttp#breach-mitigation). https://github.com/klauspost/compress/pull/762 https://github.com/klauspost/compress/pull/768 https://github.com/klauspost/compress/pull/769 https://github.com/klauspost/compress/pull/770 https://github.com/klauspost/compress/pull/767 + * s2: Add Intel LZ4s converter https://github.com/klauspost/compress/pull/766 + * zstd: Minor bug fixes https://github.com/klauspost/compress/pull/771 https://github.com/klauspost/compress/pull/772 https://github.com/klauspost/compress/pull/773 + * huff0: Speed up compress1xDo by @greatroar in https://github.com/klauspost/compress/pull/774 + +* Feb 26, 2023 - [v1.16.0](https://github.com/klauspost/compress/releases/tag/v1.16.0) + * s2: Add [Dictionary](https://github.com/klauspost/compress/tree/master/s2#dictionaries) support. https://github.com/klauspost/compress/pull/685 + * s2: Add Compression Size Estimate. https://github.com/klauspost/compress/pull/752 + * s2: Add support for custom stream encoder. https://github.com/klauspost/compress/pull/755 + * s2: Add LZ4 block converter. https://github.com/klauspost/compress/pull/748 + * s2: Support io.ReaderAt in ReadSeeker. https://github.com/klauspost/compress/pull/747 + * s2c/s2sx: Use concurrent decoding. https://github.com/klauspost/compress/pull/746 +
+ +
+ See changes to v1.15.x + +* Jan 21st, 2023 (v1.15.15) + * deflate: Improve level 7-9 by @klauspost in https://github.com/klauspost/compress/pull/739 + * zstd: Add delta encoding support by @greatroar in https://github.com/klauspost/compress/pull/728 + * zstd: Various speed improvements by @greatroar https://github.com/klauspost/compress/pull/741 https://github.com/klauspost/compress/pull/734 https://github.com/klauspost/compress/pull/736 https://github.com/klauspost/compress/pull/744 https://github.com/klauspost/compress/pull/743 https://github.com/klauspost/compress/pull/745 + * gzhttp: Add SuffixETag() and DropETag() options to prevent ETag collisions on compressed responses by @willbicks in https://github.com/klauspost/compress/pull/740 + +* Jan 3rd, 2023 (v1.15.14) + + * flate: Improve speed in big stateless blocks https://github.com/klauspost/compress/pull/718 + * zstd: Minor speed tweaks by @greatroar in https://github.com/klauspost/compress/pull/716 https://github.com/klauspost/compress/pull/720 + * export NoGzipResponseWriter for custom ResponseWriter wrappers by @harshavardhana in https://github.com/klauspost/compress/pull/722 + * s2: Add example for indexing and existing stream https://github.com/klauspost/compress/pull/723 + +* Dec 11, 2022 (v1.15.13) + * zstd: Add [MaxEncodedSize](https://pkg.go.dev/github.com/klauspost/compress@v1.15.13/zstd#Encoder.MaxEncodedSize) to encoder https://github.com/klauspost/compress/pull/691 + * zstd: Various tweaks and improvements https://github.com/klauspost/compress/pull/693 https://github.com/klauspost/compress/pull/695 https://github.com/klauspost/compress/pull/696 https://github.com/klauspost/compress/pull/701 https://github.com/klauspost/compress/pull/702 https://github.com/klauspost/compress/pull/703 https://github.com/klauspost/compress/pull/704 https://github.com/klauspost/compress/pull/705 https://github.com/klauspost/compress/pull/706 https://github.com/klauspost/compress/pull/707 https://github.com/klauspost/compress/pull/708 + +* Oct 26, 2022 (v1.15.12) + + * zstd: Tweak decoder allocs. https://github.com/klauspost/compress/pull/680 + * gzhttp: Always delete `HeaderNoCompression` https://github.com/klauspost/compress/pull/683 + +* Sept 26, 2022 (v1.15.11) + + * flate: Improve level 1-3 compression https://github.com/klauspost/compress/pull/678 + * zstd: Improve "best" compression by @nightwolfz in https://github.com/klauspost/compress/pull/677 + * zstd: Fix+reduce decompression allocations https://github.com/klauspost/compress/pull/668 + * zstd: Fix non-effective noescape tag https://github.com/klauspost/compress/pull/667 + +* Sept 16, 2022 (v1.15.10) + + * zstd: Add [WithDecodeAllCapLimit](https://pkg.go.dev/github.com/klauspost/compress@v1.15.10/zstd#WithDecodeAllCapLimit) https://github.com/klauspost/compress/pull/649 + * Add Go 1.19 - deprecate Go 1.16 https://github.com/klauspost/compress/pull/651 + * flate: Improve level 5+6 compression https://github.com/klauspost/compress/pull/656 + * zstd: Improve "better" compresssion https://github.com/klauspost/compress/pull/657 + * s2: Improve "best" compression https://github.com/klauspost/compress/pull/658 + * s2: Improve "better" compression. https://github.com/klauspost/compress/pull/635 + * s2: Slightly faster non-assembly decompression https://github.com/klauspost/compress/pull/646 + * Use arrays for constant size copies https://github.com/klauspost/compress/pull/659 + +* July 21, 2022 (v1.15.9) + + * zstd: Fix decoder crash on amd64 (no BMI) on invalid input https://github.com/klauspost/compress/pull/645 + * zstd: Disable decoder extended memory copies (amd64) due to possible crashes https://github.com/klauspost/compress/pull/644 + * zstd: Allow single segments up to "max decoded size" by @klauspost in https://github.com/klauspost/compress/pull/643 + +* July 13, 2022 (v1.15.8) + + * gzip: fix stack exhaustion bug in Reader.Read https://github.com/klauspost/compress/pull/641 + * s2: Add Index header trim/restore https://github.com/klauspost/compress/pull/638 + * zstd: Optimize seqdeq amd64 asm by @greatroar in https://github.com/klauspost/compress/pull/636 + * zstd: Improve decoder memcopy https://github.com/klauspost/compress/pull/637 + * huff0: Pass a single bitReader pointer to asm by @greatroar in https://github.com/klauspost/compress/pull/634 + * zstd: Branchless getBits for amd64 w/o BMI2 by @greatroar in https://github.com/klauspost/compress/pull/640 + * gzhttp: Remove header before writing https://github.com/klauspost/compress/pull/639 + +* June 29, 2022 (v1.15.7) + + * s2: Fix absolute forward seeks https://github.com/klauspost/compress/pull/633 + * zip: Merge upstream https://github.com/klauspost/compress/pull/631 + * zip: Re-add zip64 fix https://github.com/klauspost/compress/pull/624 + * zstd: translate fseDecoder.buildDtable into asm by @WojciechMula in https://github.com/klauspost/compress/pull/598 + * flate: Faster histograms https://github.com/klauspost/compress/pull/620 + * deflate: Use compound hcode https://github.com/klauspost/compress/pull/622 + +* June 3, 2022 (v1.15.6) + * s2: Improve coding for long, close matches https://github.com/klauspost/compress/pull/613 + * s2c: Add Snappy/S2 stream recompression https://github.com/klauspost/compress/pull/611 + * zstd: Always use configured block size https://github.com/klauspost/compress/pull/605 + * zstd: Fix incorrect hash table placement for dict encoding in default https://github.com/klauspost/compress/pull/606 + * zstd: Apply default config to ZipDecompressor without options https://github.com/klauspost/compress/pull/608 + * gzhttp: Exclude more common archive formats https://github.com/klauspost/compress/pull/612 + * s2: Add ReaderIgnoreCRC https://github.com/klauspost/compress/pull/609 + * s2: Remove sanity load on index creation https://github.com/klauspost/compress/pull/607 + * snappy: Use dedicated function for scoring https://github.com/klauspost/compress/pull/614 + * s2c+s2d: Use official snappy framed extension https://github.com/klauspost/compress/pull/610 + +* May 25, 2022 (v1.15.5) + * s2: Add concurrent stream decompression https://github.com/klauspost/compress/pull/602 + * s2: Fix final emit oob read crash on amd64 https://github.com/klauspost/compress/pull/601 + * huff0: asm implementation of Decompress1X by @WojciechMula https://github.com/klauspost/compress/pull/596 + * zstd: Use 1 less goroutine for stream decoding https://github.com/klauspost/compress/pull/588 + * zstd: Copy literal in 16 byte blocks when possible https://github.com/klauspost/compress/pull/592 + * zstd: Speed up when WithDecoderLowmem(false) https://github.com/klauspost/compress/pull/599 + * zstd: faster next state update in BMI2 version of decode by @WojciechMula in https://github.com/klauspost/compress/pull/593 + * huff0: Do not check max size when reading table. https://github.com/klauspost/compress/pull/586 + * flate: Inplace hashing for level 7-9 by @klauspost in https://github.com/klauspost/compress/pull/590 + + +* May 11, 2022 (v1.15.4) + * huff0: decompress directly into output by @WojciechMula in [#577](https://github.com/klauspost/compress/pull/577) + * inflate: Keep dict on stack [#581](https://github.com/klauspost/compress/pull/581) + * zstd: Faster decoding memcopy in asm [#583](https://github.com/klauspost/compress/pull/583) + * zstd: Fix ignored crc [#580](https://github.com/klauspost/compress/pull/580) + +* May 5, 2022 (v1.15.3) + * zstd: Allow to ignore checksum checking by @WojciechMula [#572](https://github.com/klauspost/compress/pull/572) + * s2: Fix incorrect seek for io.SeekEnd in [#575](https://github.com/klauspost/compress/pull/575) + +* Apr 26, 2022 (v1.15.2) + * zstd: Add x86-64 assembly for decompression on streams and blocks. Contributed by [@WojciechMula](https://github.com/WojciechMula). Typically 2x faster. [#528](https://github.com/klauspost/compress/pull/528) [#531](https://github.com/klauspost/compress/pull/531) [#545](https://github.com/klauspost/compress/pull/545) [#537](https://github.com/klauspost/compress/pull/537) + * zstd: Add options to ZipDecompressor and fixes [#539](https://github.com/klauspost/compress/pull/539) + * s2: Use sorted search for index [#555](https://github.com/klauspost/compress/pull/555) + * Minimum version is Go 1.16, added CI test on 1.18. + +* Mar 11, 2022 (v1.15.1) + * huff0: Add x86 assembly of Decode4X by @WojciechMula in [#512](https://github.com/klauspost/compress/pull/512) + * zstd: Reuse zip decoders in [#514](https://github.com/klauspost/compress/pull/514) + * zstd: Detect extra block data and report as corrupted in [#520](https://github.com/klauspost/compress/pull/520) + * zstd: Handle zero sized frame content size stricter in [#521](https://github.com/klauspost/compress/pull/521) + * zstd: Add stricter block size checks in [#523](https://github.com/klauspost/compress/pull/523) + +* Mar 3, 2022 (v1.15.0) + * zstd: Refactor decoder by @klauspost in [#498](https://github.com/klauspost/compress/pull/498) + * zstd: Add stream encoding without goroutines by @klauspost in [#505](https://github.com/klauspost/compress/pull/505) + * huff0: Prevent single blocks exceeding 16 bits by @klauspost in[#507](https://github.com/klauspost/compress/pull/507) + * flate: Inline literal emission by @klauspost in [#509](https://github.com/klauspost/compress/pull/509) + * gzhttp: Add zstd to transport by @klauspost in [#400](https://github.com/klauspost/compress/pull/400) + * gzhttp: Make content-type optional by @klauspost in [#510](https://github.com/klauspost/compress/pull/510) + +Both compression and decompression now supports "synchronous" stream operations. This means that whenever "concurrency" is set to 1, they will operate without spawning goroutines. + +Stream decompression is now faster on asynchronous, since the goroutine allocation much more effectively splits the workload. On typical streams this will typically use 2 cores fully for decompression. When a stream has finished decoding no goroutines will be left over, so decoders can now safely be pooled and still be garbage collected. + +While the release has been extensively tested, it is recommended to testing when upgrading. + +
+ +
+ See changes to v1.14.x + +* Feb 22, 2022 (v1.14.4) + * flate: Fix rare huffman only (-2) corruption. [#503](https://github.com/klauspost/compress/pull/503) + * zip: Update deprecated CreateHeaderRaw to correctly call CreateRaw by @saracen in [#502](https://github.com/klauspost/compress/pull/502) + * zip: don't read data descriptor early by @saracen in [#501](https://github.com/klauspost/compress/pull/501) #501 + * huff0: Use static decompression buffer up to 30% faster by @klauspost in [#499](https://github.com/klauspost/compress/pull/499) [#500](https://github.com/klauspost/compress/pull/500) + +* Feb 17, 2022 (v1.14.3) + * flate: Improve fastest levels compression speed ~10% more throughput. [#482](https://github.com/klauspost/compress/pull/482) [#489](https://github.com/klauspost/compress/pull/489) [#490](https://github.com/klauspost/compress/pull/490) [#491](https://github.com/klauspost/compress/pull/491) [#494](https://github.com/klauspost/compress/pull/494) [#478](https://github.com/klauspost/compress/pull/478) + * flate: Faster decompression speed, ~5-10%. [#483](https://github.com/klauspost/compress/pull/483) + * s2: Faster compression with Go v1.18 and amd64 microarch level 3+. [#484](https://github.com/klauspost/compress/pull/484) [#486](https://github.com/klauspost/compress/pull/486) + +* Jan 25, 2022 (v1.14.2) + * zstd: improve header decoder by @dsnet [#476](https://github.com/klauspost/compress/pull/476) + * zstd: Add bigger default blocks [#469](https://github.com/klauspost/compress/pull/469) + * zstd: Remove unused decompression buffer [#470](https://github.com/klauspost/compress/pull/470) + * zstd: Fix logically dead code by @ningmingxiao [#472](https://github.com/klauspost/compress/pull/472) + * flate: Improve level 7-9 [#471](https://github.com/klauspost/compress/pull/471) [#473](https://github.com/klauspost/compress/pull/473) + * zstd: Add noasm tag for xxhash [#475](https://github.com/klauspost/compress/pull/475) + +* Jan 11, 2022 (v1.14.1) + * s2: Add stream index in [#462](https://github.com/klauspost/compress/pull/462) + * flate: Speed and efficiency improvements in [#439](https://github.com/klauspost/compress/pull/439) [#461](https://github.com/klauspost/compress/pull/461) [#455](https://github.com/klauspost/compress/pull/455) [#452](https://github.com/klauspost/compress/pull/452) [#458](https://github.com/klauspost/compress/pull/458) + * zstd: Performance improvement in [#420]( https://github.com/klauspost/compress/pull/420) [#456](https://github.com/klauspost/compress/pull/456) [#437](https://github.com/klauspost/compress/pull/437) [#467](https://github.com/klauspost/compress/pull/467) [#468](https://github.com/klauspost/compress/pull/468) + * zstd: add arm64 xxhash assembly in [#464](https://github.com/klauspost/compress/pull/464) + * Add garbled for binaries for s2 in [#445](https://github.com/klauspost/compress/pull/445) +
+ +
+ See changes to v1.13.x + +* Aug 30, 2021 (v1.13.5) + * gz/zlib/flate: Alias stdlib errors [#425](https://github.com/klauspost/compress/pull/425) + * s2: Add block support to commandline tools [#413](https://github.com/klauspost/compress/pull/413) + * zstd: pooledZipWriter should return Writers to the same pool [#426](https://github.com/klauspost/compress/pull/426) + * Removed golang/snappy as external dependency for tests [#421](https://github.com/klauspost/compress/pull/421) + +* Aug 12, 2021 (v1.13.4) + * Add [snappy replacement package](https://github.com/klauspost/compress/tree/master/snappy). + * zstd: Fix incorrect encoding in "best" mode [#415](https://github.com/klauspost/compress/pull/415) + +* Aug 3, 2021 (v1.13.3) + * zstd: Improve Best compression [#404](https://github.com/klauspost/compress/pull/404) + * zstd: Fix WriteTo error forwarding [#411](https://github.com/klauspost/compress/pull/411) + * gzhttp: Return http.HandlerFunc instead of http.Handler. Unlikely breaking change. [#406](https://github.com/klauspost/compress/pull/406) + * s2sx: Fix max size error [#399](https://github.com/klauspost/compress/pull/399) + * zstd: Add optional stream content size on reset [#401](https://github.com/klauspost/compress/pull/401) + * zstd: use SpeedBestCompression for level >= 10 [#410](https://github.com/klauspost/compress/pull/410) + +* Jun 14, 2021 (v1.13.1) + * s2: Add full Snappy output support [#396](https://github.com/klauspost/compress/pull/396) + * zstd: Add configurable [Decoder window](https://pkg.go.dev/github.com/klauspost/compress/zstd#WithDecoderMaxWindow) size [#394](https://github.com/klauspost/compress/pull/394) + * gzhttp: Add header to skip compression [#389](https://github.com/klauspost/compress/pull/389) + * s2: Improve speed with bigger output margin [#395](https://github.com/klauspost/compress/pull/395) + +* Jun 3, 2021 (v1.13.0) + * Added [gzhttp](https://github.com/klauspost/compress/tree/master/gzhttp#gzip-handler) which allows wrapping HTTP servers and clients with GZIP compressors. + * zstd: Detect short invalid signatures [#382](https://github.com/klauspost/compress/pull/382) + * zstd: Spawn decoder goroutine only if needed. [#380](https://github.com/klauspost/compress/pull/380) +
+ + +
+ See changes to v1.12.x + +* May 25, 2021 (v1.12.3) + * deflate: Better/faster Huffman encoding [#374](https://github.com/klauspost/compress/pull/374) + * deflate: Allocate less for history. [#375](https://github.com/klauspost/compress/pull/375) + * zstd: Forward read errors [#373](https://github.com/klauspost/compress/pull/373) + +* Apr 27, 2021 (v1.12.2) + * zstd: Improve better/best compression [#360](https://github.com/klauspost/compress/pull/360) [#364](https://github.com/klauspost/compress/pull/364) [#365](https://github.com/klauspost/compress/pull/365) + * zstd: Add helpers to compress/decompress zstd inside zip files [#363](https://github.com/klauspost/compress/pull/363) + * deflate: Improve level 5+6 compression [#367](https://github.com/klauspost/compress/pull/367) + * s2: Improve better/best compression [#358](https://github.com/klauspost/compress/pull/358) [#359](https://github.com/klauspost/compress/pull/358) + * s2: Load after checking src limit on amd64. [#362](https://github.com/klauspost/compress/pull/362) + * s2sx: Limit max executable size [#368](https://github.com/klauspost/compress/pull/368) + +* Apr 14, 2021 (v1.12.1) + * snappy package removed. Upstream added as dependency. + * s2: Better compression in "best" mode [#353](https://github.com/klauspost/compress/pull/353) + * s2sx: Add stdin input and detect pre-compressed from signature [#352](https://github.com/klauspost/compress/pull/352) + * s2c/s2d: Add http as possible input [#348](https://github.com/klauspost/compress/pull/348) + * s2c/s2d/s2sx: Always truncate when writing files [#352](https://github.com/klauspost/compress/pull/352) + * zstd: Reduce memory usage further when using [WithLowerEncoderMem](https://pkg.go.dev/github.com/klauspost/compress/zstd#WithLowerEncoderMem) [#346](https://github.com/klauspost/compress/pull/346) + * s2: Fix potential problem with amd64 assembly and profilers [#349](https://github.com/klauspost/compress/pull/349) +
+ +
+ See changes to v1.11.x + +* Mar 26, 2021 (v1.11.13) + * zstd: Big speedup on small dictionary encodes [#344](https://github.com/klauspost/compress/pull/344) [#345](https://github.com/klauspost/compress/pull/345) + * zstd: Add [WithLowerEncoderMem](https://pkg.go.dev/github.com/klauspost/compress/zstd#WithLowerEncoderMem) encoder option [#336](https://github.com/klauspost/compress/pull/336) + * deflate: Improve entropy compression [#338](https://github.com/klauspost/compress/pull/338) + * s2: Clean up and minor performance improvement in best [#341](https://github.com/klauspost/compress/pull/341) + +* Mar 5, 2021 (v1.11.12) + * s2: Add `s2sx` binary that creates [self extracting archives](https://github.com/klauspost/compress/tree/master/s2#s2sx-self-extracting-archives). + * s2: Speed up decompression on non-assembly platforms [#328](https://github.com/klauspost/compress/pull/328) + +* Mar 1, 2021 (v1.11.9) + * s2: Add ARM64 decompression assembly. Around 2x output speed. [#324](https://github.com/klauspost/compress/pull/324) + * s2: Improve "better" speed and efficiency. [#325](https://github.com/klauspost/compress/pull/325) + * s2: Fix binaries. + +* Feb 25, 2021 (v1.11.8) + * s2: Fixed occational out-of-bounds write on amd64. Upgrade recommended. + * s2: Add AMD64 assembly for better mode. 25-50% faster. [#315](https://github.com/klauspost/compress/pull/315) + * s2: Less upfront decoder allocation. [#322](https://github.com/klauspost/compress/pull/322) + * zstd: Faster "compression" of incompressible data. [#314](https://github.com/klauspost/compress/pull/314) + * zip: Fix zip64 headers. [#313](https://github.com/klauspost/compress/pull/313) + +* Jan 14, 2021 (v1.11.7) + * Use Bytes() interface to get bytes across packages. [#309](https://github.com/klauspost/compress/pull/309) + * s2: Add 'best' compression option. [#310](https://github.com/klauspost/compress/pull/310) + * s2: Add ReaderMaxBlockSize, changes `s2.NewReader` signature to include varargs. [#311](https://github.com/klauspost/compress/pull/311) + * s2: Fix crash on small better buffers. [#308](https://github.com/klauspost/compress/pull/308) + * s2: Clean up decoder. [#312](https://github.com/klauspost/compress/pull/312) + +* Jan 7, 2021 (v1.11.6) + * zstd: Make decoder allocations smaller [#306](https://github.com/klauspost/compress/pull/306) + * zstd: Free Decoder resources when Reset is called with a nil io.Reader [#305](https://github.com/klauspost/compress/pull/305) + +* Dec 20, 2020 (v1.11.4) + * zstd: Add Best compression mode [#304](https://github.com/klauspost/compress/pull/304) + * Add header decoder [#299](https://github.com/klauspost/compress/pull/299) + * s2: Add uncompressed stream option [#297](https://github.com/klauspost/compress/pull/297) + * Simplify/speed up small blocks with known max size. [#300](https://github.com/klauspost/compress/pull/300) + * zstd: Always reset literal dict encoder [#303](https://github.com/klauspost/compress/pull/303) + +* Nov 15, 2020 (v1.11.3) + * inflate: 10-15% faster decompression [#293](https://github.com/klauspost/compress/pull/293) + * zstd: Tweak DecodeAll default allocation [#295](https://github.com/klauspost/compress/pull/295) + +* Oct 11, 2020 (v1.11.2) + * s2: Fix out of bounds read in "better" block compression [#291](https://github.com/klauspost/compress/pull/291) + +* Oct 1, 2020 (v1.11.1) + * zstd: Set allLitEntropy true in default configuration [#286](https://github.com/klauspost/compress/pull/286) + +* Sept 8, 2020 (v1.11.0) + * zstd: Add experimental compression [dictionaries](https://github.com/klauspost/compress/tree/master/zstd#dictionaries) [#281](https://github.com/klauspost/compress/pull/281) + * zstd: Fix mixed Write and ReadFrom calls [#282](https://github.com/klauspost/compress/pull/282) + * inflate/gz: Limit variable shifts, ~5% faster decompression [#274](https://github.com/klauspost/compress/pull/274) +
+ +
+ See changes to v1.10.x + +* July 8, 2020 (v1.10.11) + * zstd: Fix extra block when compressing with ReadFrom. [#278](https://github.com/klauspost/compress/pull/278) + * huff0: Also populate compression table when reading decoding table. [#275](https://github.com/klauspost/compress/pull/275) + +* June 23, 2020 (v1.10.10) + * zstd: Skip entropy compression in fastest mode when no matches. [#270](https://github.com/klauspost/compress/pull/270) + +* June 16, 2020 (v1.10.9): + * zstd: API change for specifying dictionaries. See [#268](https://github.com/klauspost/compress/pull/268) + * zip: update CreateHeaderRaw to handle zip64 fields. [#266](https://github.com/klauspost/compress/pull/266) + * Fuzzit tests removed. The service has been purchased and is no longer available. + +* June 5, 2020 (v1.10.8): + * 1.15x faster zstd block decompression. [#265](https://github.com/klauspost/compress/pull/265) + +* June 1, 2020 (v1.10.7): + * Added zstd decompression [dictionary support](https://github.com/klauspost/compress/tree/master/zstd#dictionaries) + * Increase zstd decompression speed up to 1.19x. [#259](https://github.com/klauspost/compress/pull/259) + * Remove internal reset call in zstd compression and reduce allocations. [#263](https://github.com/klauspost/compress/pull/263) + +* May 21, 2020: (v1.10.6) + * zstd: Reduce allocations while decoding. [#258](https://github.com/klauspost/compress/pull/258), [#252](https://github.com/klauspost/compress/pull/252) + * zstd: Stricter decompression checks. + +* April 12, 2020: (v1.10.5) + * s2-commands: Flush output when receiving SIGINT. [#239](https://github.com/klauspost/compress/pull/239) + +* Apr 8, 2020: (v1.10.4) + * zstd: Minor/special case optimizations. [#251](https://github.com/klauspost/compress/pull/251), [#250](https://github.com/klauspost/compress/pull/250), [#249](https://github.com/klauspost/compress/pull/249), [#247](https://github.com/klauspost/compress/pull/247) +* Mar 11, 2020: (v1.10.3) + * s2: Use S2 encoder in pure Go mode for Snappy output as well. [#245](https://github.com/klauspost/compress/pull/245) + * s2: Fix pure Go block encoder. [#244](https://github.com/klauspost/compress/pull/244) + * zstd: Added "better compression" mode. [#240](https://github.com/klauspost/compress/pull/240) + * zstd: Improve speed of fastest compression mode by 5-10% [#241](https://github.com/klauspost/compress/pull/241) + * zstd: Skip creating encoders when not needed. [#238](https://github.com/klauspost/compress/pull/238) + +* Feb 27, 2020: (v1.10.2) + * Close to 50% speedup in inflate (gzip/zip decompression). [#236](https://github.com/klauspost/compress/pull/236) [#234](https://github.com/klauspost/compress/pull/234) [#232](https://github.com/klauspost/compress/pull/232) + * Reduce deflate level 1-6 memory usage up to 59%. [#227](https://github.com/klauspost/compress/pull/227) + +* Feb 18, 2020: (v1.10.1) + * Fix zstd crash when resetting multiple times without sending data. [#226](https://github.com/klauspost/compress/pull/226) + * deflate: Fix dictionary use on level 1-6. [#224](https://github.com/klauspost/compress/pull/224) + * Remove deflate writer reference when closing. [#224](https://github.com/klauspost/compress/pull/224) + +* Feb 4, 2020: (v1.10.0) + * Add optional dictionary to [stateless deflate](https://pkg.go.dev/github.com/klauspost/compress/flate?tab=doc#StatelessDeflate). Breaking change, send `nil` for previous behaviour. [#216](https://github.com/klauspost/compress/pull/216) + * Fix buffer overflow on repeated small block deflate. [#218](https://github.com/klauspost/compress/pull/218) + * Allow copying content from an existing ZIP file without decompressing+compressing. [#214](https://github.com/klauspost/compress/pull/214) + * Added [S2](https://github.com/klauspost/compress/tree/master/s2#s2-compression) AMD64 assembler and various optimizations. Stream speed >10GB/s. [#186](https://github.com/klauspost/compress/pull/186) + +
+ +
+ See changes prior to v1.10.0 + +* Jan 20,2020 (v1.9.8) Optimize gzip/deflate with better size estimates and faster table generation. [#207](https://github.com/klauspost/compress/pull/207) by [luyu6056](https://github.com/luyu6056), [#206](https://github.com/klauspost/compress/pull/206). +* Jan 11, 2020: S2 Encode/Decode will use provided buffer if capacity is big enough. [#204](https://github.com/klauspost/compress/pull/204) +* Jan 5, 2020: (v1.9.7) Fix another zstd regression in v1.9.5 - v1.9.6 removed. +* Jan 4, 2020: (v1.9.6) Regression in v1.9.5 fixed causing corrupt zstd encodes in rare cases. +* Jan 4, 2020: Faster IO in [s2c + s2d commandline tools](https://github.com/klauspost/compress/tree/master/s2#commandline-tools) compression/decompression. [#192](https://github.com/klauspost/compress/pull/192) +* Dec 29, 2019: Removed v1.9.5 since fuzz tests showed a compatibility problem with the reference zstandard decoder. +* Dec 29, 2019: (v1.9.5) zstd: 10-20% faster block compression. [#199](https://github.com/klauspost/compress/pull/199) +* Dec 29, 2019: [zip](https://godoc.org/github.com/klauspost/compress/zip) package updated with latest Go features +* Dec 29, 2019: zstd: Single segment flag condintions tweaked. [#197](https://github.com/klauspost/compress/pull/197) +* Dec 18, 2019: s2: Faster compression when ReadFrom is used. [#198](https://github.com/klauspost/compress/pull/198) +* Dec 10, 2019: s2: Fix repeat length output when just above at 16MB limit. +* Dec 10, 2019: zstd: Add function to get decoder as io.ReadCloser. [#191](https://github.com/klauspost/compress/pull/191) +* Dec 3, 2019: (v1.9.4) S2: limit max repeat length. [#188](https://github.com/klauspost/compress/pull/188) +* Dec 3, 2019: Add [WithNoEntropyCompression](https://godoc.org/github.com/klauspost/compress/zstd#WithNoEntropyCompression) to zstd [#187](https://github.com/klauspost/compress/pull/187) +* Dec 3, 2019: Reduce memory use for tests. Check for leaked goroutines. +* Nov 28, 2019 (v1.9.3) Less allocations in stateless deflate. +* Nov 28, 2019: 5-20% Faster huff0 decode. Impacts zstd as well. [#184](https://github.com/klauspost/compress/pull/184) +* Nov 12, 2019 (v1.9.2) Added [Stateless Compression](#stateless-compression) for gzip/deflate. +* Nov 12, 2019: Fixed zstd decompression of large single blocks. [#180](https://github.com/klauspost/compress/pull/180) +* Nov 11, 2019: Set default [s2c](https://github.com/klauspost/compress/tree/master/s2#commandline-tools) block size to 4MB. +* Nov 11, 2019: Reduce inflate memory use by 1KB. +* Nov 10, 2019: Less allocations in deflate bit writer. +* Nov 10, 2019: Fix inconsistent error returned by zstd decoder. +* Oct 28, 2019 (v1.9.1) ztsd: Fix crash when compressing blocks. [#174](https://github.com/klauspost/compress/pull/174) +* Oct 24, 2019 (v1.9.0) zstd: Fix rare data corruption [#173](https://github.com/klauspost/compress/pull/173) +* Oct 24, 2019 zstd: Fix huff0 out of buffer write [#171](https://github.com/klauspost/compress/pull/171) and always return errors [#172](https://github.com/klauspost/compress/pull/172) +* Oct 10, 2019: Big deflate rewrite, 30-40% faster with better compression [#105](https://github.com/klauspost/compress/pull/105) + +
+ +
+ See changes prior to v1.9.0 + +* Oct 10, 2019: (v1.8.6) zstd: Allow partial reads to get flushed data. [#169](https://github.com/klauspost/compress/pull/169) +* Oct 3, 2019: Fix inconsistent results on broken zstd streams. +* Sep 25, 2019: Added `-rm` (remove source files) and `-q` (no output except errors) to `s2c` and `s2d` [commands](https://github.com/klauspost/compress/tree/master/s2#commandline-tools) +* Sep 16, 2019: (v1.8.4) Add `s2c` and `s2d` [commandline tools](https://github.com/klauspost/compress/tree/master/s2#commandline-tools). +* Sep 10, 2019: (v1.8.3) Fix s2 decoder [Skip](https://godoc.org/github.com/klauspost/compress/s2#Reader.Skip). +* Sep 7, 2019: zstd: Added [WithWindowSize](https://godoc.org/github.com/klauspost/compress/zstd#WithWindowSize), contributed by [ianwilkes](https://github.com/ianwilkes). +* Sep 5, 2019: (v1.8.2) Add [WithZeroFrames](https://godoc.org/github.com/klauspost/compress/zstd#WithZeroFrames) which adds full zero payload block encoding option. +* Sep 5, 2019: Lazy initialization of zstandard predefined en/decoder tables. +* Aug 26, 2019: (v1.8.1) S2: 1-2% compression increase in "better" compression mode. +* Aug 26, 2019: zstd: Check maximum size of Huffman 1X compressed literals while decoding. +* Aug 24, 2019: (v1.8.0) Added [S2 compression](https://github.com/klauspost/compress/tree/master/s2#s2-compression), a high performance replacement for Snappy. +* Aug 21, 2019: (v1.7.6) Fixed minor issues found by fuzzer. One could lead to zstd not decompressing. +* Aug 18, 2019: Add [fuzzit](https://fuzzit.dev/) continuous fuzzing. +* Aug 14, 2019: zstd: Skip incompressible data 2x faster. [#147](https://github.com/klauspost/compress/pull/147) +* Aug 4, 2019 (v1.7.5): Better literal compression. [#146](https://github.com/klauspost/compress/pull/146) +* Aug 4, 2019: Faster zstd compression. [#143](https://github.com/klauspost/compress/pull/143) [#144](https://github.com/klauspost/compress/pull/144) +* Aug 4, 2019: Faster zstd decompression. [#145](https://github.com/klauspost/compress/pull/145) [#143](https://github.com/klauspost/compress/pull/143) [#142](https://github.com/klauspost/compress/pull/142) +* July 15, 2019 (v1.7.4): Fix double EOF block in rare cases on zstd encoder. +* July 15, 2019 (v1.7.3): Minor speedup/compression increase in default zstd encoder. +* July 14, 2019: zstd decoder: Fix decompression error on multiple uses with mixed content. +* July 7, 2019 (v1.7.2): Snappy update, zstd decoder potential race fix. +* June 17, 2019: zstd decompression bugfix. +* June 17, 2019: fix 32 bit builds. +* June 17, 2019: Easier use in modules (less dependencies). +* June 9, 2019: New stronger "default" [zstd](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression mode. Matches zstd default compression ratio. +* June 5, 2019: 20-40% throughput in [zstandard](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression and better compression. +* June 5, 2019: deflate/gzip compression: Reduce memory usage of lower compression levels. +* June 2, 2019: Added [zstandard](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression! +* May 25, 2019: deflate/gzip: 10% faster bit writer, mostly visible in lower levels. +* Apr 22, 2019: [zstd](https://github.com/klauspost/compress/tree/master/zstd#zstd) decompression added. +* Aug 1, 2018: Added [huff0 README](https://github.com/klauspost/compress/tree/master/huff0#huff0-entropy-compression). +* Jul 8, 2018: Added [Performance Update 2018](#performance-update-2018) below. +* Jun 23, 2018: Merged [Go 1.11 inflate optimizations](https://go-review.googlesource.com/c/go/+/102235). Go 1.9 is now required. Backwards compatible version tagged with [v1.3.0](https://github.com/klauspost/compress/releases/tag/v1.3.0). +* Apr 2, 2018: Added [huff0](https://godoc.org/github.com/klauspost/compress/huff0) en/decoder. Experimental for now, API may change. +* Mar 4, 2018: Added [FSE Entropy](https://godoc.org/github.com/klauspost/compress/fse) en/decoder. Experimental for now, API may change. +* Nov 3, 2017: Add compression [Estimate](https://godoc.org/github.com/klauspost/compress#Estimate) function. +* May 28, 2017: Reduce allocations when resetting decoder. +* Apr 02, 2017: Change back to official crc32, since changes were merged in Go 1.7. +* Jan 14, 2017: Reduce stack pressure due to array copies. See [Issue #18625](https://github.com/golang/go/issues/18625). +* Oct 25, 2016: Level 2-4 have been rewritten and now offers significantly better performance than before. +* Oct 20, 2016: Port zlib changes from Go 1.7 to fix zlib writer issue. Please update. +* Oct 16, 2016: Go 1.7 changes merged. Apples to apples this package is a few percent faster, but has a significantly better balance between speed and compression per level. +* Mar 24, 2016: Always attempt Huffman encoding on level 4-7. This improves base 64 encoded data compression. +* Mar 24, 2016: Small speedup for level 1-3. +* Feb 19, 2016: Faster bit writer, level -2 is 15% faster, level 1 is 4% faster. +* Feb 19, 2016: Handle small payloads faster in level 1-3. +* Feb 19, 2016: Added faster level 2 + 3 compression modes. +* Feb 19, 2016: [Rebalanced compression levels](https://blog.klauspost.com/rebalancing-deflate-compression-levels/), so there is a more even progresssion in terms of compression. New default level is 5. +* Feb 14, 2016: Snappy: Merge upstream changes. +* Feb 14, 2016: Snappy: Fix aggressive skipping. +* Feb 14, 2016: Snappy: Update benchmark. +* Feb 13, 2016: Deflate: Fixed assembler problem that could lead to sub-optimal compression. +* Feb 12, 2016: Snappy: Added AMD64 SSE 4.2 optimizations to matching, which makes easy to compress material run faster. Typical speedup is around 25%. +* Feb 9, 2016: Added Snappy package fork. This version is 5-7% faster, much more on hard to compress content. +* Jan 30, 2016: Optimize level 1 to 3 by not considering static dictionary or storing uncompressed. ~4-5% speedup. +* Jan 16, 2016: Optimization on deflate level 1,2,3 compression. +* Jan 8 2016: Merge [CL 18317](https://go-review.googlesource.com/#/c/18317): fix reading, writing of zip64 archives. +* Dec 8 2015: Make level 1 and -2 deterministic even if write size differs. +* Dec 8 2015: Split encoding functions, so hashing and matching can potentially be inlined. 1-3% faster on AMD64. 5% faster on other platforms. +* Dec 8 2015: Fixed rare [one byte out-of bounds read](https://github.com/klauspost/compress/issues/20). Please update! +* Nov 23 2015: Optimization on token writer. ~2-4% faster. Contributed by [@dsnet](https://github.com/dsnet). +* Nov 20 2015: Small optimization to bit writer on 64 bit systems. +* Nov 17 2015: Fixed out-of-bound errors if the underlying Writer returned an error. See [#15](https://github.com/klauspost/compress/issues/15). +* Nov 12 2015: Added [io.WriterTo](https://golang.org/pkg/io/#WriterTo) support to gzip/inflate. +* Nov 11 2015: Merged [CL 16669](https://go-review.googlesource.com/#/c/16669/4): archive/zip: enable overriding (de)compressors per file +* Oct 15 2015: Added skipping on uncompressible data. Random data speed up >5x. + +
+ +# deflate usage + +The packages are drop-in replacements for standard libraries. Simply replace the import path to use them: + +| old import | new import | Documentation +|--------------------|-----------------------------------------|--------------------| +| `compress/gzip` | `github.com/klauspost/compress/gzip` | [gzip](https://pkg.go.dev/github.com/klauspost/compress/gzip?tab=doc) +| `compress/zlib` | `github.com/klauspost/compress/zlib` | [zlib](https://pkg.go.dev/github.com/klauspost/compress/zlib?tab=doc) +| `archive/zip` | `github.com/klauspost/compress/zip` | [zip](https://pkg.go.dev/github.com/klauspost/compress/zip?tab=doc) +| `compress/flate` | `github.com/klauspost/compress/flate` | [flate](https://pkg.go.dev/github.com/klauspost/compress/flate?tab=doc) + +* Optimized [deflate](https://godoc.org/github.com/klauspost/compress/flate) packages which can be used as a dropin replacement for [gzip](https://godoc.org/github.com/klauspost/compress/gzip), [zip](https://godoc.org/github.com/klauspost/compress/zip) and [zlib](https://godoc.org/github.com/klauspost/compress/zlib). + +You may also be interested in [pgzip](https://github.com/klauspost/pgzip), which is a drop in replacement for gzip, which support multithreaded compression on big files and the optimized [crc32](https://github.com/klauspost/crc32) package used by these packages. + +The packages contains the same as the standard library, so you can use the godoc for that: [gzip](http://golang.org/pkg/compress/gzip/), [zip](http://golang.org/pkg/archive/zip/), [zlib](http://golang.org/pkg/compress/zlib/), [flate](http://golang.org/pkg/compress/flate/). + +Currently there is only minor speedup on decompression (mostly CRC32 calculation). + +Memory usage is typically 1MB for a Writer. stdlib is in the same range. +If you expect to have a lot of concurrently allocated Writers consider using +the stateless compress described below. + +For compression performance, see: [this spreadsheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing). + +To disable all assembly add `-tags=noasm`. This works across all packages. + +# Stateless compression + +This package offers stateless compression as a special option for gzip/deflate. +It will do compression but without maintaining any state between Write calls. + +This means there will be no memory kept between Write calls, but compression and speed will be suboptimal. + +This is only relevant in cases where you expect to run many thousands of compressors concurrently, +but with very little activity. This is *not* intended for regular web servers serving individual requests. + +Because of this, the size of actual Write calls will affect output size. + +In gzip, specify level `-3` / `gzip.StatelessCompression` to enable. + +For direct deflate use, NewStatelessWriter and StatelessDeflate are available. See [documentation](https://godoc.org/github.com/klauspost/compress/flate#NewStatelessWriter) + +A `bufio.Writer` can of course be used to control write sizes. For example, to use a 4KB buffer: + +```go + // replace 'ioutil.Discard' with your output. + gzw, err := gzip.NewWriterLevel(ioutil.Discard, gzip.StatelessCompression) + if err != nil { + return err + } + defer gzw.Close() + + w := bufio.NewWriterSize(gzw, 4096) + defer w.Flush() + + // Write to 'w' +``` + +This will only use up to 4KB in memory when the writer is idle. + +Compression is almost always worse than the fastest compression level +and each write will allocate (a little) memory. + +# Performance Update 2018 + +It has been a while since we have been looking at the speed of this package compared to the standard library, so I thought I would re-do my tests and give some overall recommendations based on the current state. All benchmarks have been performed with Go 1.10 on my Desktop Intel(R) Core(TM) i7-2600 CPU @3.40GHz. Since I last ran the tests, I have gotten more RAM, which means tests with big files are no longer limited by my SSD. + +The raw results are in my [updated spreadsheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing). Due to cgo changes and upstream updates i could not get the cgo version of gzip to compile. Instead I included the [zstd](https://github.com/datadog/zstd) cgo implementation. If I get cgo gzip to work again, I might replace the results in the sheet. + +The columns to take note of are: *MB/s* - the throughput. *Reduction* - the data size reduction in percent of the original. *Rel Speed* relative speed compared to the standard library at the same level. *Smaller* - how many percent smaller is the compressed output compared to stdlib. Negative means the output was bigger. *Loss* means the loss (or gain) in compression as a percentage difference of the input. + +The `gzstd` (standard library gzip) and `gzkp` (this package gzip) only uses one CPU core. [`pgzip`](https://github.com/klauspost/pgzip), [`bgzf`](https://github.com/biogo/hts/tree/master/bgzf) uses all 4 cores. [`zstd`](https://github.com/DataDog/zstd) uses one core, and is a beast (but not Go, yet). + + +## Overall differences. + +There appears to be a roughly 5-10% speed advantage over the standard library when comparing at similar compression levels. + +The biggest difference you will see is the result of [re-balancing](https://blog.klauspost.com/rebalancing-deflate-compression-levels/) the compression levels. I wanted by library to give a smoother transition between the compression levels than the standard library. + +This package attempts to provide a more smooth transition, where "1" is taking a lot of shortcuts, "5" is the reasonable trade-off and "9" is the "give me the best compression", and the values in between gives something reasonable in between. The standard library has big differences in levels 1-4, but levels 5-9 having no significant gains - often spending a lot more time than can be justified by the achieved compression. + +There are links to all the test data in the [spreadsheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing) in the top left field on each tab. + +## Web Content + +This test set aims to emulate typical use in a web server. The test-set is 4GB data in 53k files, and is a mixture of (mostly) HTML, JS, CSS. + +Since level 1 and 9 are close to being the same code, they are quite close. But looking at the levels in-between the differences are quite big. + +Looking at level 6, this package is 88% faster, but will output about 6% more data. For a web server, this means you can serve 88% more data, but have to pay for 6% more bandwidth. You can draw your own conclusions on what would be the most expensive for your case. + +## Object files + +This test is for typical data files stored on a server. In this case it is a collection of Go precompiled objects. They are very compressible. + +The picture is similar to the web content, but with small differences since this is very compressible. Levels 2-3 offer good speed, but is sacrificing quite a bit of compression. + +The standard library seems suboptimal on level 3 and 4 - offering both worse compression and speed than level 6 & 7 of this package respectively. + +## Highly Compressible File + +This is a JSON file with very high redundancy. The reduction starts at 95% on level 1, so in real life terms we are dealing with something like a highly redundant stream of data, etc. + +It is definitely visible that we are dealing with specialized content here, so the results are very scattered. This package does not do very well at levels 1-4, but picks up significantly at level 5 and levels 7 and 8 offering great speed for the achieved compression. + +So if you know you content is extremely compressible you might want to go slightly higher than the defaults. The standard library has a huge gap between levels 3 and 4 in terms of speed (2.75x slowdown), so it offers little "middle ground". + +## Medium-High Compressible + +This is a pretty common test corpus: [enwik9](http://mattmahoney.net/dc/textdata.html). It contains the first 10^9 bytes of the English Wikipedia dump on Mar. 3, 2006. This is a very good test of typical text based compression and more data heavy streams. + +We see a similar picture here as in "Web Content". On equal levels some compression is sacrificed for more speed. Level 5 seems to be the best trade-off between speed and size, beating stdlib level 3 in both. + +## Medium Compressible + +I will combine two test sets, one [10GB file set](http://mattmahoney.net/dc/10gb.html) and a VM disk image (~8GB). Both contain different data types and represent a typical backup scenario. + +The most notable thing is how quickly the standard library drops to very low compression speeds around level 5-6 without any big gains in compression. Since this type of data is fairly common, this does not seem like good behavior. + + +## Un-compressible Content + +This is mainly a test of how good the algorithms are at detecting un-compressible input. The standard library only offers this feature with very conservative settings at level 1. Obviously there is no reason for the algorithms to try to compress input that cannot be compressed. The only downside is that it might skip some compressible data on false detections. + + +## Huffman only compression + +This compression library adds a special compression level, named `HuffmanOnly`, which allows near linear time compression. This is done by completely disabling matching of previous data, and only reduce the number of bits to represent each character. + +This means that often used characters, like 'e' and ' ' (space) in text use the fewest bits to represent, and rare characters like '¤' takes more bits to represent. For more information see [wikipedia](https://en.wikipedia.org/wiki/Huffman_coding) or this nice [video](https://youtu.be/ZdooBTdW5bM). + +Since this type of compression has much less variance, the compression speed is mostly unaffected by the input data, and is usually more than *180MB/s* for a single core. + +The downside is that the compression ratio is usually considerably worse than even the fastest conventional compression. The compression ratio can never be better than 8:1 (12.5%). + +The linear time compression can be used as a "better than nothing" mode, where you cannot risk the encoder to slow down on some content. For comparison, the size of the "Twain" text is *233460 bytes* (+29% vs. level 1) and encode speed is 144MB/s (4.5x level 1). So in this case you trade a 30% size increase for a 4 times speedup. + +For more information see my blog post on [Fast Linear Time Compression](http://blog.klauspost.com/constant-time-gzipzip-compression/). + +This is implemented on Go 1.7 as "Huffman Only" mode, though not exposed for gzip. + +# Other packages + +Here are other packages of good quality and pure Go (no cgo wrappers or autoconverted code): + +* [github.com/pierrec/lz4](https://github.com/pierrec/lz4) - strong multithreaded LZ4 compression. +* [github.com/cosnicolaou/pbzip2](https://github.com/cosnicolaou/pbzip2) - multithreaded bzip2 decompression. +* [github.com/dsnet/compress](https://github.com/dsnet/compress) - brotli decompression, bzip2 writer. +* [github.com/ronanh/intcomp](https://github.com/ronanh/intcomp) - Integer compression. +* [github.com/spenczar/fpc](https://github.com/spenczar/fpc) - Float compression. +* [github.com/minio/zipindex](https://github.com/minio/zipindex) - External ZIP directory index. +* [github.com/ybirader/pzip](https://github.com/ybirader/pzip) - Fast concurrent zip archiver and extractor. + +# license + +This code is licensed under the same conditions as the original Go code. See LICENSE file. diff --git a/vendor/github.com/klauspost/compress/SECURITY.md b/vendor/github.com/klauspost/compress/SECURITY.md new file mode 100644 index 0000000000..ca6685e2b7 --- /dev/null +++ b/vendor/github.com/klauspost/compress/SECURITY.md @@ -0,0 +1,25 @@ +# Security Policy + +## Supported Versions + +Security updates are applied only to the latest release. + +## Vulnerability Definition + +A security vulnerability is a bug that with certain input triggers a crash or an infinite loop. Most calls will have varying execution time and only in rare cases will slow operation be considered a security vulnerability. + +Corrupted output generally is not considered a security vulnerability, unless independent operations are able to affect each other. Note that not all functionality is re-entrant and safe to use concurrently. + +Out-of-memory crashes only applies if the en/decoder uses an abnormal amount of memory, with appropriate options applied, to limit maximum window size, concurrency, etc. However, if you are in doubt you are welcome to file a security issue. + +It is assumed that all callers are trusted, meaning internal data exposed through reflection or inspection of returned data structures is not considered a vulnerability. + +Vulnerabilities resulting from compiler/assembler errors should be reported upstream. Depending on the severity this package may or may not implement a workaround. + +## Reporting a Vulnerability + +If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released. + +Please disclose it at [security advisory](https://github.com/klauspost/compress/security/advisories/new). If possible please provide a minimal reproducer. If the issue only applies to a single platform, it would be helpful to provide access to that. + +This project is maintained by a team of volunteers on a reasonable-effort basis. As such, vulnerabilities will be disclosed in a best effort base. diff --git a/vendor/github.com/klauspost/compress/compressible.go b/vendor/github.com/klauspost/compress/compressible.go new file mode 100644 index 0000000000..ea5a692d51 --- /dev/null +++ b/vendor/github.com/klauspost/compress/compressible.go @@ -0,0 +1,85 @@ +package compress + +import "math" + +// Estimate returns a normalized compressibility estimate of block b. +// Values close to zero are likely uncompressible. +// Values above 0.1 are likely to be compressible. +// Values above 0.5 are very compressible. +// Very small lengths will return 0. +func Estimate(b []byte) float64 { + if len(b) < 16 { + return 0 + } + + // Correctly predicted order 1 + hits := 0 + lastMatch := false + var o1 [256]byte + var hist [256]int + c1 := byte(0) + for _, c := range b { + if c == o1[c1] { + // We only count a hit if there was two correct predictions in a row. + if lastMatch { + hits++ + } + lastMatch = true + } else { + lastMatch = false + } + o1[c1] = c + c1 = c + hist[c]++ + } + + // Use x^0.6 to give better spread + prediction := math.Pow(float64(hits)/float64(len(b)), 0.6) + + // Calculate histogram distribution + variance := float64(0) + avg := float64(len(b)) / 256 + + for _, v := range hist { + Δ := float64(v) - avg + variance += Δ * Δ + } + + stddev := math.Sqrt(float64(variance)) / float64(len(b)) + exp := math.Sqrt(1 / float64(len(b))) + + // Subtract expected stddev + stddev -= exp + if stddev < 0 { + stddev = 0 + } + stddev *= 1 + exp + + // Use x^0.4 to give better spread + entropy := math.Pow(stddev, 0.4) + + // 50/50 weight between prediction and histogram distribution + return math.Pow((prediction+entropy)/2, 0.9) +} + +// ShannonEntropyBits returns the number of bits minimum required to represent +// an entropy encoding of the input bytes. +// https://en.wiktionary.org/wiki/Shannon_entropy +func ShannonEntropyBits(b []byte) int { + if len(b) == 0 { + return 0 + } + var hist [256]int + for _, c := range b { + hist[c]++ + } + shannon := float64(0) + invTotal := 1.0 / float64(len(b)) + for _, v := range hist[:] { + if v > 0 { + n := float64(v) + shannon += math.Ceil(-math.Log2(n*invTotal) * n) + } + } + return int(math.Ceil(shannon)) +} diff --git a/vendor/github.com/klauspost/compress/fse/README.md b/vendor/github.com/klauspost/compress/fse/README.md new file mode 100644 index 0000000000..ea7324da67 --- /dev/null +++ b/vendor/github.com/klauspost/compress/fse/README.md @@ -0,0 +1,79 @@ +# Finite State Entropy + +This package provides Finite State Entropy encoding and decoding. + +Finite State Entropy (also referenced as [tANS](https://en.wikipedia.org/wiki/Asymmetric_numeral_systems#tANS)) +encoding provides a fast near-optimal symbol encoding/decoding +for byte blocks as implemented in [zstandard](https://github.com/facebook/zstd). + +This can be used for compressing input with a lot of similar input values to the smallest number of bytes. +This does not perform any multi-byte [dictionary coding](https://en.wikipedia.org/wiki/Dictionary_coder) as LZ coders, +but it can be used as a secondary step to compressors (like Snappy) that does not do entropy encoding. + +* [Godoc documentation](https://godoc.org/github.com/klauspost/compress/fse) + +## News + + * Feb 2018: First implementation released. Consider this beta software for now. + +# Usage + +This package provides a low level interface that allows to compress single independent blocks. + +Each block is separate, and there is no built in integrity checks. +This means that the caller should keep track of block sizes and also do checksums if needed. + +Compressing a block is done via the [`Compress`](https://godoc.org/github.com/klauspost/compress/fse#Compress) function. +You must provide input and will receive the output and maybe an error. + +These error values can be returned: + +| Error | Description | +|---------------------|-----------------------------------------------------------------------------| +| `` | Everything ok, output is returned | +| `ErrIncompressible` | Returned when input is judged to be too hard to compress | +| `ErrUseRLE` | Returned from the compressor when the input is a single byte value repeated | +| `(error)` | An internal error occurred. | + +As can be seen above there are errors that will be returned even under normal operation so it is important to handle these. + +To reduce allocations you can provide a [`Scratch`](https://godoc.org/github.com/klauspost/compress/fse#Scratch) object +that can be re-used for successive calls. Both compression and decompression accepts a `Scratch` object, and the same +object can be used for both. + +Be aware, that when re-using a `Scratch` object that the *output* buffer is also re-used, so if you are still using this +you must set the `Out` field in the scratch to nil. The same buffer is used for compression and decompression output. + +Decompressing is done by calling the [`Decompress`](https://godoc.org/github.com/klauspost/compress/fse#Decompress) function. +You must provide the output from the compression stage, at exactly the size you got back. If you receive an error back +your input was likely corrupted. + +It is important to note that a successful decoding does *not* mean your output matches your original input. +There are no integrity checks, so relying on errors from the decompressor does not assure your data is valid. + +For more detailed usage, see examples in the [godoc documentation](https://godoc.org/github.com/klauspost/compress/fse#pkg-examples). + +# Performance + +A lot of factors are affecting speed. Block sizes and compressibility of the material are primary factors. +All compression functions are currently only running on the calling goroutine so only one core will be used per block. + +The compressor is significantly faster if symbols are kept as small as possible. The highest byte value of the input +is used to reduce some of the processing, so if all your input is above byte value 64 for instance, it may be +beneficial to transpose all your input values down by 64. + +With moderate block sizes around 64k speed are typically 200MB/s per core for compression and +around 300MB/s decompression speed. + +The same hardware typically does Huffman (deflate) encoding at 125MB/s and decompression at 100MB/s. + +# Plans + +At one point, more internals will be exposed to facilitate more "expert" usage of the components. + +A streaming interface is also likely to be implemented. Likely compatible with [FSE stream format](https://github.com/Cyan4973/FiniteStateEntropy/blob/dev/programs/fileio.c#L261). + +# Contributing + +Contributions are always welcome. Be aware that adding public functions will require good justification and breaking +changes will likely not be accepted. If in doubt open an issue before writing the PR. \ No newline at end of file diff --git a/vendor/github.com/klauspost/compress/fse/bitreader.go b/vendor/github.com/klauspost/compress/fse/bitreader.go new file mode 100644 index 0000000000..f65eb3909c --- /dev/null +++ b/vendor/github.com/klauspost/compress/fse/bitreader.go @@ -0,0 +1,122 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +package fse + +import ( + "encoding/binary" + "errors" + "io" +) + +// bitReader reads a bitstream in reverse. +// The last set bit indicates the start of the stream and is used +// for aligning the input. +type bitReader struct { + in []byte + off uint // next byte to read is at in[off - 1] + value uint64 + bitsRead uint8 +} + +// init initializes and resets the bit reader. +func (b *bitReader) init(in []byte) error { + if len(in) < 1 { + return errors.New("corrupt stream: too short") + } + b.in = in + b.off = uint(len(in)) + // The highest bit of the last byte indicates where to start + v := in[len(in)-1] + if v == 0 { + return errors.New("corrupt stream, did not find end of stream") + } + b.bitsRead = 64 + b.value = 0 + if len(in) >= 8 { + b.fillFastStart() + } else { + b.fill() + b.fill() + } + b.bitsRead += 8 - uint8(highBits(uint32(v))) + return nil +} + +// getBits will return n bits. n can be 0. +func (b *bitReader) getBits(n uint8) uint16 { + if n == 0 || b.bitsRead >= 64 { + return 0 + } + return b.getBitsFast(n) +} + +// getBitsFast requires that at least one bit is requested every time. +// There are no checks if the buffer is filled. +func (b *bitReader) getBitsFast(n uint8) uint16 { + const regMask = 64 - 1 + v := uint16((b.value << (b.bitsRead & regMask)) >> ((regMask + 1 - n) & regMask)) + b.bitsRead += n + return v +} + +// fillFast() will make sure at least 32 bits are available. +// There must be at least 4 bytes available. +func (b *bitReader) fillFast() { + if b.bitsRead < 32 { + return + } + // 2 bounds checks. + v := b.in[b.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value = (b.value << 32) | uint64(low) + b.bitsRead -= 32 + b.off -= 4 +} + +// fill() will make sure at least 32 bits are available. +func (b *bitReader) fill() { + if b.bitsRead < 32 { + return + } + if b.off > 4 { + v := b.in[b.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value = (b.value << 32) | uint64(low) + b.bitsRead -= 32 + b.off -= 4 + return + } + for b.off > 0 { + b.value = (b.value << 8) | uint64(b.in[b.off-1]) + b.bitsRead -= 8 + b.off-- + } +} + +// fillFastStart() assumes the bitreader is empty and there is at least 8 bytes to read. +func (b *bitReader) fillFastStart() { + // Do single re-slice to avoid bounds checks. + b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.bitsRead = 0 + b.off -= 8 +} + +// finished returns true if all bits have been read from the bit stream. +func (b *bitReader) finished() bool { + return b.bitsRead >= 64 && b.off == 0 +} + +// close the bitstream and returns an error if out-of-buffer reads occurred. +func (b *bitReader) close() error { + // Release reference. + b.in = nil + if b.bitsRead > 64 { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/vendor/github.com/klauspost/compress/fse/bitwriter.go b/vendor/github.com/klauspost/compress/fse/bitwriter.go new file mode 100644 index 0000000000..e82fa3bb7b --- /dev/null +++ b/vendor/github.com/klauspost/compress/fse/bitwriter.go @@ -0,0 +1,167 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +package fse + +import "fmt" + +// bitWriter will write bits. +// First bit will be LSB of the first byte of output. +type bitWriter struct { + bitContainer uint64 + nBits uint8 + out []byte +} + +// bitMask16 is bitmasks. Has extra to avoid bounds check. +var bitMask16 = [32]uint16{ + 0, 1, 3, 7, 0xF, 0x1F, + 0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, + 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF} /* up to 16 bits */ + +// addBits16NC will add up to 16 bits. +// It will not check if there is space for them, +// so the caller must ensure that it has flushed recently. +func (b *bitWriter) addBits16NC(value uint16, bits uint8) { + b.bitContainer |= uint64(value&bitMask16[bits&31]) << (b.nBits & 63) + b.nBits += bits +} + +// addBits16Clean will add up to 16 bits. value may not contain more set bits than indicated. +// It will not check if there is space for them, so the caller must ensure that it has flushed recently. +func (b *bitWriter) addBits16Clean(value uint16, bits uint8) { + b.bitContainer |= uint64(value) << (b.nBits & 63) + b.nBits += bits +} + +// addBits16ZeroNC will add up to 16 bits. +// It will not check if there is space for them, +// so the caller must ensure that it has flushed recently. +// This is fastest if bits can be zero. +func (b *bitWriter) addBits16ZeroNC(value uint16, bits uint8) { + if bits == 0 { + return + } + value <<= (16 - bits) & 15 + value >>= (16 - bits) & 15 + b.bitContainer |= uint64(value) << (b.nBits & 63) + b.nBits += bits +} + +// flush will flush all pending full bytes. +// There will be at least 56 bits available for writing when this has been called. +// Using flush32 is faster, but leaves less space for writing. +func (b *bitWriter) flush() { + v := b.nBits >> 3 + switch v { + case 0: + case 1: + b.out = append(b.out, + byte(b.bitContainer), + ) + case 2: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + ) + case 3: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + ) + case 4: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + ) + case 5: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + ) + case 6: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + byte(b.bitContainer>>40), + ) + case 7: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + byte(b.bitContainer>>40), + byte(b.bitContainer>>48), + ) + case 8: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + byte(b.bitContainer>>40), + byte(b.bitContainer>>48), + byte(b.bitContainer>>56), + ) + default: + panic(fmt.Errorf("bits (%d) > 64", b.nBits)) + } + b.bitContainer >>= v << 3 + b.nBits &= 7 +} + +// flush32 will flush out, so there are at least 32 bits available for writing. +func (b *bitWriter) flush32() { + if b.nBits < 32 { + return + } + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24)) + b.nBits -= 32 + b.bitContainer >>= 32 +} + +// flushAlign will flush remaining full bytes and align to next byte boundary. +func (b *bitWriter) flushAlign() { + nbBytes := (b.nBits + 7) >> 3 + for i := uint8(0); i < nbBytes; i++ { + b.out = append(b.out, byte(b.bitContainer>>(i*8))) + } + b.nBits = 0 + b.bitContainer = 0 +} + +// close will write the alignment bit and write the final byte(s) +// to the output. +func (b *bitWriter) close() { + // End mark + b.addBits16Clean(1, 1) + // flush until next byte. + b.flushAlign() +} + +// reset and continue writing by appending to out. +func (b *bitWriter) reset(out []byte) { + b.bitContainer = 0 + b.nBits = 0 + b.out = out +} diff --git a/vendor/github.com/klauspost/compress/fse/bytereader.go b/vendor/github.com/klauspost/compress/fse/bytereader.go new file mode 100644 index 0000000000..abade2d605 --- /dev/null +++ b/vendor/github.com/klauspost/compress/fse/bytereader.go @@ -0,0 +1,47 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +package fse + +// byteReader provides a byte reader that reads +// little endian values from a byte stream. +// The input stream is manually advanced. +// The reader performs no bounds checks. +type byteReader struct { + b []byte + off int +} + +// init will initialize the reader and set the input. +func (b *byteReader) init(in []byte) { + b.b = in + b.off = 0 +} + +// advance the stream b n bytes. +func (b *byteReader) advance(n uint) { + b.off += int(n) +} + +// Uint32 returns a little endian uint32 starting at current offset. +func (b byteReader) Uint32() uint32 { + b2 := b.b[b.off:] + b2 = b2[:4] + v3 := uint32(b2[3]) + v2 := uint32(b2[2]) + v1 := uint32(b2[1]) + v0 := uint32(b2[0]) + return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24) +} + +// unread returns the unread portion of the input. +func (b byteReader) unread() []byte { + return b.b[b.off:] +} + +// remain will return the number of bytes remaining. +func (b byteReader) remain() int { + return len(b.b) - b.off +} diff --git a/vendor/github.com/klauspost/compress/fse/compress.go b/vendor/github.com/klauspost/compress/fse/compress.go new file mode 100644 index 0000000000..074018d8f9 --- /dev/null +++ b/vendor/github.com/klauspost/compress/fse/compress.go @@ -0,0 +1,683 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +package fse + +import ( + "errors" + "fmt" +) + +// Compress the input bytes. Input must be < 2GB. +// Provide a Scratch buffer to avoid memory allocations. +// Note that the output is also kept in the scratch buffer. +// If input is too hard to compress, ErrIncompressible is returned. +// If input is a single byte value repeated ErrUseRLE is returned. +func Compress(in []byte, s *Scratch) ([]byte, error) { + if len(in) <= 1 { + return nil, ErrIncompressible + } + if len(in) > (2<<30)-1 { + return nil, errors.New("input too big, must be < 2GB") + } + s, err := s.prepare(in) + if err != nil { + return nil, err + } + + // Create histogram, if none was provided. + maxCount := s.maxCount + if maxCount == 0 { + maxCount = s.countSimple(in) + } + // Reset for next run. + s.clearCount = true + s.maxCount = 0 + if maxCount == len(in) { + // One symbol, use RLE + return nil, ErrUseRLE + } + if maxCount == 1 || maxCount < (len(in)>>7) { + // Each symbol present maximum once or too well distributed. + return nil, ErrIncompressible + } + s.optimalTableLog() + err = s.normalizeCount() + if err != nil { + return nil, err + } + err = s.writeCount() + if err != nil { + return nil, err + } + + if false { + err = s.validateNorm() + if err != nil { + return nil, err + } + } + + err = s.buildCTable() + if err != nil { + return nil, err + } + err = s.compress(in) + if err != nil { + return nil, err + } + s.Out = s.bw.out + // Check if we compressed. + if len(s.Out) >= len(in) { + return nil, ErrIncompressible + } + return s.Out, nil +} + +// cState contains the compression state of a stream. +type cState struct { + bw *bitWriter + stateTable []uint16 + state uint16 +} + +// init will initialize the compression state to the first symbol of the stream. +func (c *cState) init(bw *bitWriter, ct *cTable, tableLog uint8, first symbolTransform) { + c.bw = bw + c.stateTable = ct.stateTable + + nbBitsOut := (first.deltaNbBits + (1 << 15)) >> 16 + im := int32((nbBitsOut << 16) - first.deltaNbBits) + lu := (im >> nbBitsOut) + first.deltaFindState + c.state = c.stateTable[lu] +} + +// encode the output symbol provided and write it to the bitstream. +func (c *cState) encode(symbolTT symbolTransform) { + nbBitsOut := (uint32(c.state) + symbolTT.deltaNbBits) >> 16 + dstState := int32(c.state>>(nbBitsOut&15)) + symbolTT.deltaFindState + c.bw.addBits16NC(c.state, uint8(nbBitsOut)) + c.state = c.stateTable[dstState] +} + +// encode the output symbol provided and write it to the bitstream. +func (c *cState) encodeZero(symbolTT symbolTransform) { + nbBitsOut := (uint32(c.state) + symbolTT.deltaNbBits) >> 16 + dstState := int32(c.state>>(nbBitsOut&15)) + symbolTT.deltaFindState + c.bw.addBits16ZeroNC(c.state, uint8(nbBitsOut)) + c.state = c.stateTable[dstState] +} + +// flush will write the tablelog to the output and flush the remaining full bytes. +func (c *cState) flush(tableLog uint8) { + c.bw.flush32() + c.bw.addBits16NC(c.state, tableLog) + c.bw.flush() +} + +// compress is the main compression loop that will encode the input from the last byte to the first. +func (s *Scratch) compress(src []byte) error { + if len(src) <= 2 { + return errors.New("compress: src too small") + } + tt := s.ct.symbolTT[:256] + s.bw.reset(s.Out) + + // Our two states each encodes every second byte. + // Last byte encoded (first byte decoded) will always be encoded by c1. + var c1, c2 cState + + // Encode so remaining size is divisible by 4. + ip := len(src) + if ip&1 == 1 { + c1.init(&s.bw, &s.ct, s.actualTableLog, tt[src[ip-1]]) + c2.init(&s.bw, &s.ct, s.actualTableLog, tt[src[ip-2]]) + c1.encodeZero(tt[src[ip-3]]) + ip -= 3 + } else { + c2.init(&s.bw, &s.ct, s.actualTableLog, tt[src[ip-1]]) + c1.init(&s.bw, &s.ct, s.actualTableLog, tt[src[ip-2]]) + ip -= 2 + } + if ip&2 != 0 { + c2.encodeZero(tt[src[ip-1]]) + c1.encodeZero(tt[src[ip-2]]) + ip -= 2 + } + src = src[:ip] + + // Main compression loop. + switch { + case !s.zeroBits && s.actualTableLog <= 8: + // We can encode 4 symbols without requiring a flush. + // We do not need to check if any output is 0 bits. + for ; len(src) >= 4; src = src[:len(src)-4] { + s.bw.flush32() + v3, v2, v1, v0 := src[len(src)-4], src[len(src)-3], src[len(src)-2], src[len(src)-1] + c2.encode(tt[v0]) + c1.encode(tt[v1]) + c2.encode(tt[v2]) + c1.encode(tt[v3]) + } + case !s.zeroBits: + // We do not need to check if any output is 0 bits. + for ; len(src) >= 4; src = src[:len(src)-4] { + s.bw.flush32() + v3, v2, v1, v0 := src[len(src)-4], src[len(src)-3], src[len(src)-2], src[len(src)-1] + c2.encode(tt[v0]) + c1.encode(tt[v1]) + s.bw.flush32() + c2.encode(tt[v2]) + c1.encode(tt[v3]) + } + case s.actualTableLog <= 8: + // We can encode 4 symbols without requiring a flush + for ; len(src) >= 4; src = src[:len(src)-4] { + s.bw.flush32() + v3, v2, v1, v0 := src[len(src)-4], src[len(src)-3], src[len(src)-2], src[len(src)-1] + c2.encodeZero(tt[v0]) + c1.encodeZero(tt[v1]) + c2.encodeZero(tt[v2]) + c1.encodeZero(tt[v3]) + } + default: + for ; len(src) >= 4; src = src[:len(src)-4] { + s.bw.flush32() + v3, v2, v1, v0 := src[len(src)-4], src[len(src)-3], src[len(src)-2], src[len(src)-1] + c2.encodeZero(tt[v0]) + c1.encodeZero(tt[v1]) + s.bw.flush32() + c2.encodeZero(tt[v2]) + c1.encodeZero(tt[v3]) + } + } + + // Flush final state. + // Used to initialize state when decoding. + c2.flush(s.actualTableLog) + c1.flush(s.actualTableLog) + + s.bw.close() + return nil +} + +// writeCount will write the normalized histogram count to header. +// This is read back by readNCount. +func (s *Scratch) writeCount() error { + var ( + tableLog = s.actualTableLog + tableSize = 1 << tableLog + previous0 bool + charnum uint16 + + maxHeaderSize = ((int(s.symbolLen)*int(tableLog) + 4 + 2) >> 3) + 3 + + // Write Table Size + bitStream = uint32(tableLog - minTablelog) + bitCount = uint(4) + remaining = int16(tableSize + 1) /* +1 for extra accuracy */ + threshold = int16(tableSize) + nbBits = uint(tableLog + 1) + ) + if cap(s.Out) < maxHeaderSize { + s.Out = make([]byte, 0, s.br.remain()+maxHeaderSize) + } + outP := uint(0) + out := s.Out[:maxHeaderSize] + + // stops at 1 + for remaining > 1 { + if previous0 { + start := charnum + for s.norm[charnum] == 0 { + charnum++ + } + for charnum >= start+24 { + start += 24 + bitStream += uint32(0xFFFF) << bitCount + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += 2 + bitStream >>= 16 + } + for charnum >= start+3 { + start += 3 + bitStream += 3 << bitCount + bitCount += 2 + } + bitStream += uint32(charnum-start) << bitCount + bitCount += 2 + if bitCount > 16 { + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += 2 + bitStream >>= 16 + bitCount -= 16 + } + } + + count := s.norm[charnum] + charnum++ + max := (2*threshold - 1) - remaining + if count < 0 { + remaining += count + } else { + remaining -= count + } + count++ // +1 for extra accuracy + if count >= threshold { + count += max // [0..max[ [max..threshold[ (...) [threshold+max 2*threshold[ + } + bitStream += uint32(count) << bitCount + bitCount += nbBits + if count < max { + bitCount-- + } + + previous0 = count == 1 + if remaining < 1 { + return errors.New("internal error: remaining<1") + } + for remaining < threshold { + nbBits-- + threshold >>= 1 + } + + if bitCount > 16 { + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += 2 + bitStream >>= 16 + bitCount -= 16 + } + } + + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += (bitCount + 7) / 8 + + if charnum > s.symbolLen { + return errors.New("internal error: charnum > s.symbolLen") + } + s.Out = out[:outP] + return nil +} + +// symbolTransform contains the state transform for a symbol. +type symbolTransform struct { + deltaFindState int32 + deltaNbBits uint32 +} + +// String prints values as a human readable string. +func (s symbolTransform) String() string { + return fmt.Sprintf("dnbits: %08x, fs:%d", s.deltaNbBits, s.deltaFindState) +} + +// cTable contains tables used for compression. +type cTable struct { + tableSymbol []byte + stateTable []uint16 + symbolTT []symbolTransform +} + +// allocCtable will allocate tables needed for compression. +// If existing tables a re big enough, they are simply re-used. +func (s *Scratch) allocCtable() { + tableSize := 1 << s.actualTableLog + // get tableSymbol that is big enough. + if cap(s.ct.tableSymbol) < tableSize { + s.ct.tableSymbol = make([]byte, tableSize) + } + s.ct.tableSymbol = s.ct.tableSymbol[:tableSize] + + ctSize := tableSize + if cap(s.ct.stateTable) < ctSize { + s.ct.stateTable = make([]uint16, ctSize) + } + s.ct.stateTable = s.ct.stateTable[:ctSize] + + if cap(s.ct.symbolTT) < 256 { + s.ct.symbolTT = make([]symbolTransform, 256) + } + s.ct.symbolTT = s.ct.symbolTT[:256] +} + +// buildCTable will populate the compression table so it is ready to be used. +func (s *Scratch) buildCTable() error { + tableSize := uint32(1 << s.actualTableLog) + highThreshold := tableSize - 1 + var cumul [maxSymbolValue + 2]int16 + + s.allocCtable() + tableSymbol := s.ct.tableSymbol[:tableSize] + // symbol start positions + { + cumul[0] = 0 + for ui, v := range s.norm[:s.symbolLen-1] { + u := byte(ui) // one less than reference + if v == -1 { + // Low proba symbol + cumul[u+1] = cumul[u] + 1 + tableSymbol[highThreshold] = u + highThreshold-- + } else { + cumul[u+1] = cumul[u] + v + } + } + // Encode last symbol separately to avoid overflowing u + u := int(s.symbolLen - 1) + v := s.norm[s.symbolLen-1] + if v == -1 { + // Low proba symbol + cumul[u+1] = cumul[u] + 1 + tableSymbol[highThreshold] = byte(u) + highThreshold-- + } else { + cumul[u+1] = cumul[u] + v + } + if uint32(cumul[s.symbolLen]) != tableSize { + return fmt.Errorf("internal error: expected cumul[s.symbolLen] (%d) == tableSize (%d)", cumul[s.symbolLen], tableSize) + } + cumul[s.symbolLen] = int16(tableSize) + 1 + } + // Spread symbols + s.zeroBits = false + { + step := tableStep(tableSize) + tableMask := tableSize - 1 + var position uint32 + // if any symbol > largeLimit, we may have 0 bits output. + largeLimit := int16(1 << (s.actualTableLog - 1)) + for ui, v := range s.norm[:s.symbolLen] { + symbol := byte(ui) + if v > largeLimit { + s.zeroBits = true + } + for nbOccurrences := int16(0); nbOccurrences < v; nbOccurrences++ { + tableSymbol[position] = symbol + position = (position + step) & tableMask + for position > highThreshold { + position = (position + step) & tableMask + } /* Low proba area */ + } + } + + // Check if we have gone through all positions + if position != 0 { + return errors.New("position!=0") + } + } + + // Build table + table := s.ct.stateTable + { + tsi := int(tableSize) + for u, v := range tableSymbol { + // TableU16 : sorted by symbol order; gives next state value + table[cumul[v]] = uint16(tsi + u) + cumul[v]++ + } + } + + // Build Symbol Transformation Table + { + total := int16(0) + symbolTT := s.ct.symbolTT[:s.symbolLen] + tableLog := s.actualTableLog + tl := (uint32(tableLog) << 16) - (1 << tableLog) + for i, v := range s.norm[:s.symbolLen] { + switch v { + case 0: + case -1, 1: + symbolTT[i].deltaNbBits = tl + symbolTT[i].deltaFindState = int32(total - 1) + total++ + default: + maxBitsOut := uint32(tableLog) - highBits(uint32(v-1)) + minStatePlus := uint32(v) << maxBitsOut + symbolTT[i].deltaNbBits = (maxBitsOut << 16) - minStatePlus + symbolTT[i].deltaFindState = int32(total - v) + total += v + } + } + if total != int16(tableSize) { + return fmt.Errorf("total mismatch %d (got) != %d (want)", total, tableSize) + } + } + return nil +} + +// countSimple will create a simple histogram in s.count. +// Returns the biggest count. +// Does not update s.clearCount. +func (s *Scratch) countSimple(in []byte) (max int) { + for _, v := range in { + s.count[v]++ + } + m, symlen := uint32(0), s.symbolLen + for i, v := range s.count[:] { + if v == 0 { + continue + } + if v > m { + m = v + } + symlen = uint16(i) + 1 + } + s.symbolLen = symlen + return int(m) +} + +// minTableLog provides the minimum logSize to safely represent a distribution. +func (s *Scratch) minTableLog() uint8 { + minBitsSrc := highBits(uint32(s.br.remain()-1)) + 1 + minBitsSymbols := highBits(uint32(s.symbolLen-1)) + 2 + if minBitsSrc < minBitsSymbols { + return uint8(minBitsSrc) + } + return uint8(minBitsSymbols) +} + +// optimalTableLog calculates and sets the optimal tableLog in s.actualTableLog +func (s *Scratch) optimalTableLog() { + tableLog := s.TableLog + minBits := s.minTableLog() + maxBitsSrc := uint8(highBits(uint32(s.br.remain()-1))) - 2 + if maxBitsSrc < tableLog { + // Accuracy can be reduced + tableLog = maxBitsSrc + } + if minBits > tableLog { + tableLog = minBits + } + // Need a minimum to safely represent all symbol values + if tableLog < minTablelog { + tableLog = minTablelog + } + if tableLog > maxTableLog { + tableLog = maxTableLog + } + s.actualTableLog = tableLog +} + +var rtbTable = [...]uint32{0, 473195, 504333, 520860, 550000, 700000, 750000, 830000} + +// normalizeCount will normalize the count of the symbols so +// the total is equal to the table size. +func (s *Scratch) normalizeCount() error { + var ( + tableLog = s.actualTableLog + scale = 62 - uint64(tableLog) + step = (1 << 62) / uint64(s.br.remain()) + vStep = uint64(1) << (scale - 20) + stillToDistribute = int16(1 << tableLog) + largest int + largestP int16 + lowThreshold = (uint32)(s.br.remain() >> tableLog) + ) + + for i, cnt := range s.count[:s.symbolLen] { + // already handled + // if (count[s] == s.length) return 0; /* rle special case */ + + if cnt == 0 { + s.norm[i] = 0 + continue + } + if cnt <= lowThreshold { + s.norm[i] = -1 + stillToDistribute-- + } else { + proba := (int16)((uint64(cnt) * step) >> scale) + if proba < 8 { + restToBeat := vStep * uint64(rtbTable[proba]) + v := uint64(cnt)*step - (uint64(proba) << scale) + if v > restToBeat { + proba++ + } + } + if proba > largestP { + largestP = proba + largest = i + } + s.norm[i] = proba + stillToDistribute -= proba + } + } + + if -stillToDistribute >= (s.norm[largest] >> 1) { + // corner case, need another normalization method + return s.normalizeCount2() + } + s.norm[largest] += stillToDistribute + return nil +} + +// Secondary normalization method. +// To be used when primary method fails. +func (s *Scratch) normalizeCount2() error { + const notYetAssigned = -2 + var ( + distributed uint32 + total = uint32(s.br.remain()) + tableLog = s.actualTableLog + lowThreshold = total >> tableLog + lowOne = (total * 3) >> (tableLog + 1) + ) + for i, cnt := range s.count[:s.symbolLen] { + if cnt == 0 { + s.norm[i] = 0 + continue + } + if cnt <= lowThreshold { + s.norm[i] = -1 + distributed++ + total -= cnt + continue + } + if cnt <= lowOne { + s.norm[i] = 1 + distributed++ + total -= cnt + continue + } + s.norm[i] = notYetAssigned + } + toDistribute := (1 << tableLog) - distributed + + if (total / toDistribute) > lowOne { + // risk of rounding to zero + lowOne = (total * 3) / (toDistribute * 2) + for i, cnt := range s.count[:s.symbolLen] { + if (s.norm[i] == notYetAssigned) && (cnt <= lowOne) { + s.norm[i] = 1 + distributed++ + total -= cnt + continue + } + } + toDistribute = (1 << tableLog) - distributed + } + if distributed == uint32(s.symbolLen)+1 { + // all values are pretty poor; + // probably incompressible data (should have already been detected); + // find max, then give all remaining points to max + var maxV int + var maxC uint32 + for i, cnt := range s.count[:s.symbolLen] { + if cnt > maxC { + maxV = i + maxC = cnt + } + } + s.norm[maxV] += int16(toDistribute) + return nil + } + + if total == 0 { + // all of the symbols were low enough for the lowOne or lowThreshold + for i := uint32(0); toDistribute > 0; i = (i + 1) % (uint32(s.symbolLen)) { + if s.norm[i] > 0 { + toDistribute-- + s.norm[i]++ + } + } + return nil + } + + var ( + vStepLog = 62 - uint64(tableLog) + mid = uint64((1 << (vStepLog - 1)) - 1) + rStep = (((1 << vStepLog) * uint64(toDistribute)) + mid) / uint64(total) // scale on remaining + tmpTotal = mid + ) + for i, cnt := range s.count[:s.symbolLen] { + if s.norm[i] == notYetAssigned { + var ( + end = tmpTotal + uint64(cnt)*rStep + sStart = uint32(tmpTotal >> vStepLog) + sEnd = uint32(end >> vStepLog) + weight = sEnd - sStart + ) + if weight < 1 { + return errors.New("weight < 1") + } + s.norm[i] = int16(weight) + tmpTotal = end + } + } + return nil +} + +// validateNorm validates the normalized histogram table. +func (s *Scratch) validateNorm() (err error) { + var total int + for _, v := range s.norm[:s.symbolLen] { + if v >= 0 { + total += int(v) + } else { + total -= int(v) + } + } + defer func() { + if err == nil { + return + } + fmt.Printf("selected TableLog: %d, Symbol length: %d\n", s.actualTableLog, s.symbolLen) + for i, v := range s.norm[:s.symbolLen] { + fmt.Printf("%3d: %5d -> %4d \n", i, s.count[i], v) + } + }() + if total != (1 << s.actualTableLog) { + return fmt.Errorf("warning: Total == %d != %d", total, 1< tablelogAbsoluteMax { + return errors.New("tableLog too large") + } + bitStream >>= 4 + bitCount := uint(4) + + s.actualTableLog = uint8(nbBits) + remaining := int32((1 << nbBits) + 1) + threshold := int32(1 << nbBits) + gotTotal := int32(0) + nbBits++ + + for remaining > 1 { + if previous0 { + n0 := charnum + for (bitStream & 0xFFFF) == 0xFFFF { + n0 += 24 + if b.off < iend-5 { + b.advance(2) + bitStream = b.Uint32() >> bitCount + } else { + bitStream >>= 16 + bitCount += 16 + } + } + for (bitStream & 3) == 3 { + n0 += 3 + bitStream >>= 2 + bitCount += 2 + } + n0 += uint16(bitStream & 3) + bitCount += 2 + if n0 > maxSymbolValue { + return errors.New("maxSymbolValue too small") + } + for charnum < n0 { + s.norm[charnum&0xff] = 0 + charnum++ + } + + if b.off <= iend-7 || b.off+int(bitCount>>3) <= iend-4 { + b.advance(bitCount >> 3) + bitCount &= 7 + bitStream = b.Uint32() >> bitCount + } else { + bitStream >>= 2 + } + } + + max := (2*(threshold) - 1) - (remaining) + var count int32 + + if (int32(bitStream) & (threshold - 1)) < max { + count = int32(bitStream) & (threshold - 1) + bitCount += nbBits - 1 + } else { + count = int32(bitStream) & (2*threshold - 1) + if count >= threshold { + count -= max + } + bitCount += nbBits + } + + count-- // extra accuracy + if count < 0 { + // -1 means +1 + remaining += count + gotTotal -= count + } else { + remaining -= count + gotTotal += count + } + s.norm[charnum&0xff] = int16(count) + charnum++ + previous0 = count == 0 + for remaining < threshold { + nbBits-- + threshold >>= 1 + } + if b.off <= iend-7 || b.off+int(bitCount>>3) <= iend-4 { + b.advance(bitCount >> 3) + bitCount &= 7 + } else { + bitCount -= (uint)(8 * (len(b.b) - 4 - b.off)) + b.off = len(b.b) - 4 + } + bitStream = b.Uint32() >> (bitCount & 31) + } + s.symbolLen = charnum + + if s.symbolLen <= 1 { + return fmt.Errorf("symbolLen (%d) too small", s.symbolLen) + } + if s.symbolLen > maxSymbolValue+1 { + return fmt.Errorf("symbolLen (%d) too big", s.symbolLen) + } + if remaining != 1 { + return fmt.Errorf("corruption detected (remaining %d != 1)", remaining) + } + if bitCount > 32 { + return fmt.Errorf("corruption detected (bitCount %d > 32)", bitCount) + } + if gotTotal != 1<> 3) + return nil +} + +// decSymbol contains information about a state entry, +// Including the state offset base, the output symbol and +// the number of bits to read for the low part of the destination state. +type decSymbol struct { + newState uint16 + symbol uint8 + nbBits uint8 +} + +// allocDtable will allocate decoding tables if they are not big enough. +func (s *Scratch) allocDtable() { + tableSize := 1 << s.actualTableLog + if cap(s.decTable) < tableSize { + s.decTable = make([]decSymbol, tableSize) + } + s.decTable = s.decTable[:tableSize] + + if cap(s.ct.tableSymbol) < 256 { + s.ct.tableSymbol = make([]byte, 256) + } + s.ct.tableSymbol = s.ct.tableSymbol[:256] + + if cap(s.ct.stateTable) < 256 { + s.ct.stateTable = make([]uint16, 256) + } + s.ct.stateTable = s.ct.stateTable[:256] +} + +// buildDtable will build the decoding table. +func (s *Scratch) buildDtable() error { + tableSize := uint32(1 << s.actualTableLog) + highThreshold := tableSize - 1 + s.allocDtable() + symbolNext := s.ct.stateTable[:256] + + // Init, lay down lowprob symbols + s.zeroBits = false + { + largeLimit := int16(1 << (s.actualTableLog - 1)) + for i, v := range s.norm[:s.symbolLen] { + if v == -1 { + s.decTable[highThreshold].symbol = uint8(i) + highThreshold-- + symbolNext[i] = 1 + } else { + if v >= largeLimit { + s.zeroBits = true + } + symbolNext[i] = uint16(v) + } + } + } + // Spread symbols + { + tableMask := tableSize - 1 + step := tableStep(tableSize) + position := uint32(0) + for ss, v := range s.norm[:s.symbolLen] { + for i := 0; i < int(v); i++ { + s.decTable[position].symbol = uint8(ss) + position = (position + step) & tableMask + for position > highThreshold { + // lowprob area + position = (position + step) & tableMask + } + } + } + if position != 0 { + // position must reach all cells once, otherwise normalizedCounter is incorrect + return errors.New("corrupted input (position != 0)") + } + } + + // Build Decoding table + { + tableSize := uint16(1 << s.actualTableLog) + for u, v := range s.decTable { + symbol := v.symbol + nextState := symbolNext[symbol] + symbolNext[symbol] = nextState + 1 + nBits := s.actualTableLog - byte(highBits(uint32(nextState))) + s.decTable[u].nbBits = nBits + newState := (nextState << nBits) - tableSize + if newState >= tableSize { + return fmt.Errorf("newState (%d) outside table size (%d)", newState, tableSize) + } + if newState == uint16(u) && nBits == 0 { + // Seems weird that this is possible with nbits > 0. + return fmt.Errorf("newState (%d) == oldState (%d) and no bits", newState, u) + } + s.decTable[u].newState = newState + } + } + return nil +} + +// decompress will decompress the bitstream. +// If the buffer is over-read an error is returned. +func (s *Scratch) decompress() error { + br := &s.bits + if err := br.init(s.br.unread()); err != nil { + return err + } + + var s1, s2 decoder + // Initialize and decode first state and symbol. + s1.init(br, s.decTable, s.actualTableLog) + s2.init(br, s.decTable, s.actualTableLog) + + // Use temp table to avoid bound checks/append penalty. + var tmp = s.ct.tableSymbol[:256] + var off uint8 + + // Main part + if !s.zeroBits { + for br.off >= 8 { + br.fillFast() + tmp[off+0] = s1.nextFast() + tmp[off+1] = s2.nextFast() + br.fillFast() + tmp[off+2] = s1.nextFast() + tmp[off+3] = s2.nextFast() + off += 4 + // When off is 0, we have overflowed and should write. + if off == 0 { + s.Out = append(s.Out, tmp...) + if len(s.Out) >= s.DecompressLimit { + return fmt.Errorf("output size (%d) > DecompressLimit (%d)", len(s.Out), s.DecompressLimit) + } + } + } + } else { + for br.off >= 8 { + br.fillFast() + tmp[off+0] = s1.next() + tmp[off+1] = s2.next() + br.fillFast() + tmp[off+2] = s1.next() + tmp[off+3] = s2.next() + off += 4 + if off == 0 { + s.Out = append(s.Out, tmp...) + // When off is 0, we have overflowed and should write. + if len(s.Out) >= s.DecompressLimit { + return fmt.Errorf("output size (%d) > DecompressLimit (%d)", len(s.Out), s.DecompressLimit) + } + } + } + } + s.Out = append(s.Out, tmp[:off]...) + + // Final bits, a bit more expensive check + for { + if s1.finished() { + s.Out = append(s.Out, s1.final(), s2.final()) + break + } + br.fill() + s.Out = append(s.Out, s1.next()) + if s2.finished() { + s.Out = append(s.Out, s2.final(), s1.final()) + break + } + s.Out = append(s.Out, s2.next()) + if len(s.Out) >= s.DecompressLimit { + return fmt.Errorf("output size (%d) > DecompressLimit (%d)", len(s.Out), s.DecompressLimit) + } + } + return br.close() +} + +// decoder keeps track of the current state and updates it from the bitstream. +type decoder struct { + state uint16 + br *bitReader + dt []decSymbol +} + +// init will initialize the decoder and read the first state from the stream. +func (d *decoder) init(in *bitReader, dt []decSymbol, tableLog uint8) { + d.dt = dt + d.br = in + d.state = in.getBits(tableLog) +} + +// next returns the next symbol and sets the next state. +// At least tablelog bits must be available in the bit reader. +func (d *decoder) next() uint8 { + n := &d.dt[d.state] + lowBits := d.br.getBits(n.nbBits) + d.state = n.newState + lowBits + return n.symbol +} + +// finished returns true if all bits have been read from the bitstream +// and the next state would require reading bits from the input. +func (d *decoder) finished() bool { + return d.br.finished() && d.dt[d.state].nbBits > 0 +} + +// final returns the current state symbol without decoding the next. +func (d *decoder) final() uint8 { + return d.dt[d.state].symbol +} + +// nextFast returns the next symbol and sets the next state. +// This can only be used if no symbols are 0 bits. +// At least tablelog bits must be available in the bit reader. +func (d *decoder) nextFast() uint8 { + n := d.dt[d.state] + lowBits := d.br.getBitsFast(n.nbBits) + d.state = n.newState + lowBits + return n.symbol +} diff --git a/vendor/github.com/klauspost/compress/fse/fse.go b/vendor/github.com/klauspost/compress/fse/fse.go new file mode 100644 index 0000000000..535cbadfde --- /dev/null +++ b/vendor/github.com/klauspost/compress/fse/fse.go @@ -0,0 +1,144 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +// Package fse provides Finite State Entropy encoding and decoding. +// +// Finite State Entropy encoding provides a fast near-optimal symbol encoding/decoding +// for byte blocks as implemented in zstd. +// +// See https://github.com/klauspost/compress/tree/master/fse for more information. +package fse + +import ( + "errors" + "fmt" + "math/bits" +) + +const ( + /*!MEMORY_USAGE : + * Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.) + * Increasing memory usage improves compression ratio + * Reduced memory usage can improve speed, due to cache effect + * Recommended max value is 14, for 16KB, which nicely fits into Intel x86 L1 cache */ + maxMemoryUsage = 14 + defaultMemoryUsage = 13 + + maxTableLog = maxMemoryUsage - 2 + maxTablesize = 1 << maxTableLog + defaultTablelog = defaultMemoryUsage - 2 + minTablelog = 5 + maxSymbolValue = 255 +) + +var ( + // ErrIncompressible is returned when input is judged to be too hard to compress. + ErrIncompressible = errors.New("input is not compressible") + + // ErrUseRLE is returned from the compressor when the input is a single byte value repeated. + ErrUseRLE = errors.New("input is single value repeated") +) + +// Scratch provides temporary storage for compression and decompression. +type Scratch struct { + // Private + count [maxSymbolValue + 1]uint32 + norm [maxSymbolValue + 1]int16 + br byteReader + bits bitReader + bw bitWriter + ct cTable // Compression tables. + decTable []decSymbol // Decompression table. + maxCount int // count of the most probable symbol + + // Per block parameters. + // These can be used to override compression parameters of the block. + // Do not touch, unless you know what you are doing. + + // Out is output buffer. + // If the scratch is re-used before the caller is done processing the output, + // set this field to nil. + // Otherwise the output buffer will be re-used for next Compression/Decompression step + // and allocation will be avoided. + Out []byte + + // DecompressLimit limits the maximum decoded size acceptable. + // If > 0 decompression will stop when approximately this many bytes + // has been decoded. + // If 0, maximum size will be 2GB. + DecompressLimit int + + symbolLen uint16 // Length of active part of the symbol table. + actualTableLog uint8 // Selected tablelog. + zeroBits bool // no bits has prob > 50%. + clearCount bool // clear count + + // MaxSymbolValue will override the maximum symbol value of the next block. + MaxSymbolValue uint8 + + // TableLog will attempt to override the tablelog for the next block. + TableLog uint8 +} + +// Histogram allows to populate the histogram and skip that step in the compression, +// It otherwise allows to inspect the histogram when compression is done. +// To indicate that you have populated the histogram call HistogramFinished +// with the value of the highest populated symbol, as well as the number of entries +// in the most populated entry. These are accepted at face value. +// The returned slice will always be length 256. +func (s *Scratch) Histogram() []uint32 { + return s.count[:] +} + +// HistogramFinished can be called to indicate that the histogram has been populated. +// maxSymbol is the index of the highest set symbol of the next data segment. +// maxCount is the number of entries in the most populated entry. +// These are accepted at face value. +func (s *Scratch) HistogramFinished(maxSymbol uint8, maxCount int) { + s.maxCount = maxCount + s.symbolLen = uint16(maxSymbol) + 1 + s.clearCount = maxCount != 0 +} + +// prepare will prepare and allocate scratch tables used for both compression and decompression. +func (s *Scratch) prepare(in []byte) (*Scratch, error) { + if s == nil { + s = &Scratch{} + } + if s.MaxSymbolValue == 0 { + s.MaxSymbolValue = 255 + } + if s.TableLog == 0 { + s.TableLog = defaultTablelog + } + if s.TableLog > maxTableLog { + return nil, fmt.Errorf("tableLog (%d) > maxTableLog (%d)", s.TableLog, maxTableLog) + } + if cap(s.Out) == 0 { + s.Out = make([]byte, 0, len(in)) + } + if s.clearCount && s.maxCount == 0 { + for i := range s.count { + s.count[i] = 0 + } + s.clearCount = false + } + s.br.init(in) + if s.DecompressLimit == 0 { + // Max size 2GB. + s.DecompressLimit = (2 << 30) - 1 + } + + return s, nil +} + +// tableStep returns the next table index. +func tableStep(tableSize uint32) uint32 { + return (tableSize >> 1) + (tableSize >> 3) + 3 +} + +func highBits(val uint32) (n uint32) { + return uint32(bits.Len32(val) - 1) +} diff --git a/vendor/github.com/klauspost/compress/gen.sh b/vendor/github.com/klauspost/compress/gen.sh new file mode 100644 index 0000000000..aff942205f --- /dev/null +++ b/vendor/github.com/klauspost/compress/gen.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +cd s2/cmd/_s2sx/ || exit 1 +go generate . diff --git a/vendor/github.com/klauspost/compress/huff0/.gitignore b/vendor/github.com/klauspost/compress/huff0/.gitignore new file mode 100644 index 0000000000..b3d262958f --- /dev/null +++ b/vendor/github.com/klauspost/compress/huff0/.gitignore @@ -0,0 +1 @@ +/huff0-fuzz.zip diff --git a/vendor/github.com/klauspost/compress/huff0/README.md b/vendor/github.com/klauspost/compress/huff0/README.md new file mode 100644 index 0000000000..8b6e5c6638 --- /dev/null +++ b/vendor/github.com/klauspost/compress/huff0/README.md @@ -0,0 +1,89 @@ +# Huff0 entropy compression + +This package provides Huff0 encoding and decoding as used in zstd. + +[Huff0](https://github.com/Cyan4973/FiniteStateEntropy#new-generation-entropy-coders), +a Huffman codec designed for modern CPU, featuring OoO (Out of Order) operations on multiple ALU +(Arithmetic Logic Unit), achieving extremely fast compression and decompression speeds. + +This can be used for compressing input with a lot of similar input values to the smallest number of bytes. +This does not perform any multi-byte [dictionary coding](https://en.wikipedia.org/wiki/Dictionary_coder) as LZ coders, +but it can be used as a secondary step to compressors (like Snappy) that does not do entropy encoding. + +* [Godoc documentation](https://godoc.org/github.com/klauspost/compress/huff0) + +## News + +This is used as part of the [zstandard](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression and decompression package. + +This ensures that most functionality is well tested. + +# Usage + +This package provides a low level interface that allows to compress single independent blocks. + +Each block is separate, and there is no built in integrity checks. +This means that the caller should keep track of block sizes and also do checksums if needed. + +Compressing a block is done via the [`Compress1X`](https://godoc.org/github.com/klauspost/compress/huff0#Compress1X) and +[`Compress4X`](https://godoc.org/github.com/klauspost/compress/huff0#Compress4X) functions. +You must provide input and will receive the output and maybe an error. + +These error values can be returned: + +| Error | Description | +|---------------------|-----------------------------------------------------------------------------| +| `` | Everything ok, output is returned | +| `ErrIncompressible` | Returned when input is judged to be too hard to compress | +| `ErrUseRLE` | Returned from the compressor when the input is a single byte value repeated | +| `ErrTooBig` | Returned if the input block exceeds the maximum allowed size (128 Kib) | +| `(error)` | An internal error occurred. | + + +As can be seen above some of there are errors that will be returned even under normal operation so it is important to handle these. + +To reduce allocations you can provide a [`Scratch`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch) object +that can be re-used for successive calls. Both compression and decompression accepts a `Scratch` object, and the same +object can be used for both. + +Be aware, that when re-using a `Scratch` object that the *output* buffer is also re-used, so if you are still using this +you must set the `Out` field in the scratch to nil. The same buffer is used for compression and decompression output. + +The `Scratch` object will retain state that allows to re-use previous tables for encoding and decoding. + +## Tables and re-use + +Huff0 allows for reusing tables from the previous block to save space if that is expected to give better/faster results. + +The Scratch object allows you to set a [`ReusePolicy`](https://godoc.org/github.com/klauspost/compress/huff0#ReusePolicy) +that controls this behaviour. See the documentation for details. This can be altered between each block. + +Do however note that this information is *not* stored in the output block and it is up to the users of the package to +record whether [`ReadTable`](https://godoc.org/github.com/klauspost/compress/huff0#ReadTable) should be called, +based on the boolean reported back from the CompressXX call. + +If you want to store the table separate from the data, you can access them as `OutData` and `OutTable` on the +[`Scratch`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch) object. + +## Decompressing + +The first part of decoding is to initialize the decoding table through [`ReadTable`](https://godoc.org/github.com/klauspost/compress/huff0#ReadTable). +This will initialize the decoding tables. +You can supply the complete block to `ReadTable` and it will return the data part of the block +which can be given to the decompressor. + +Decompressing is done by calling the [`Decompress1X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress1X) +or [`Decompress4X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress4X) function. + +For concurrently decompressing content with a fixed table a stateless [`Decoder`](https://godoc.org/github.com/klauspost/compress/huff0#Decoder) can be requested which will remain correct as long as the scratch is unchanged. The capacity of the provided slice indicates the expected output size. + +You must provide the output from the compression stage, at exactly the size you got back. If you receive an error back +your input was likely corrupted. + +It is important to note that a successful decoding does *not* mean your output matches your original input. +There are no integrity checks, so relying on errors from the decompressor does not assure your data is valid. + +# Contributing + +Contributions are always welcome. Be aware that adding public functions will require good justification and breaking +changes will likely not be accepted. If in doubt open an issue before writing the PR. diff --git a/vendor/github.com/klauspost/compress/huff0/bitreader.go b/vendor/github.com/klauspost/compress/huff0/bitreader.go new file mode 100644 index 0000000000..e36d9742f9 --- /dev/null +++ b/vendor/github.com/klauspost/compress/huff0/bitreader.go @@ -0,0 +1,229 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +package huff0 + +import ( + "encoding/binary" + "errors" + "fmt" + "io" +) + +// bitReader reads a bitstream in reverse. +// The last set bit indicates the start of the stream and is used +// for aligning the input. +type bitReaderBytes struct { + in []byte + off uint // next byte to read is at in[off - 1] + value uint64 + bitsRead uint8 +} + +// init initializes and resets the bit reader. +func (b *bitReaderBytes) init(in []byte) error { + if len(in) < 1 { + return errors.New("corrupt stream: too short") + } + b.in = in + b.off = uint(len(in)) + // The highest bit of the last byte indicates where to start + v := in[len(in)-1] + if v == 0 { + return errors.New("corrupt stream, did not find end of stream") + } + b.bitsRead = 64 + b.value = 0 + if len(in) >= 8 { + b.fillFastStart() + } else { + b.fill() + b.fill() + } + b.advance(8 - uint8(highBit32(uint32(v)))) + return nil +} + +// peekBitsFast requires that at least one bit is requested every time. +// There are no checks if the buffer is filled. +func (b *bitReaderBytes) peekByteFast() uint8 { + got := uint8(b.value >> 56) + return got +} + +func (b *bitReaderBytes) advance(n uint8) { + b.bitsRead += n + b.value <<= n & 63 +} + +// fillFast() will make sure at least 32 bits are available. +// There must be at least 4 bytes available. +func (b *bitReaderBytes) fillFast() { + if b.bitsRead < 32 { + return + } + + // 2 bounds checks. + v := b.in[b.off-4 : b.off] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value |= uint64(low) << (b.bitsRead - 32) + b.bitsRead -= 32 + b.off -= 4 +} + +// fillFastStart() assumes the bitReaderBytes is empty and there is at least 8 bytes to read. +func (b *bitReaderBytes) fillFastStart() { + // Do single re-slice to avoid bounds checks. + b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.bitsRead = 0 + b.off -= 8 +} + +// fill() will make sure at least 32 bits are available. +func (b *bitReaderBytes) fill() { + if b.bitsRead < 32 { + return + } + if b.off > 4 { + v := b.in[b.off-4 : b.off] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value |= uint64(low) << (b.bitsRead - 32) + b.bitsRead -= 32 + b.off -= 4 + return + } + for b.off > 0 { + b.value |= uint64(b.in[b.off-1]) << (b.bitsRead - 8) + b.bitsRead -= 8 + b.off-- + } +} + +// finished returns true if all bits have been read from the bit stream. +func (b *bitReaderBytes) finished() bool { + return b.off == 0 && b.bitsRead >= 64 +} + +func (b *bitReaderBytes) remaining() uint { + return b.off*8 + uint(64-b.bitsRead) +} + +// close the bitstream and returns an error if out-of-buffer reads occurred. +func (b *bitReaderBytes) close() error { + // Release reference. + b.in = nil + if b.remaining() > 0 { + return fmt.Errorf("corrupt input: %d bits remain on stream", b.remaining()) + } + if b.bitsRead > 64 { + return io.ErrUnexpectedEOF + } + return nil +} + +// bitReaderShifted reads a bitstream in reverse. +// The last set bit indicates the start of the stream and is used +// for aligning the input. +type bitReaderShifted struct { + in []byte + off uint // next byte to read is at in[off - 1] + value uint64 + bitsRead uint8 +} + +// init initializes and resets the bit reader. +func (b *bitReaderShifted) init(in []byte) error { + if len(in) < 1 { + return errors.New("corrupt stream: too short") + } + b.in = in + b.off = uint(len(in)) + // The highest bit of the last byte indicates where to start + v := in[len(in)-1] + if v == 0 { + return errors.New("corrupt stream, did not find end of stream") + } + b.bitsRead = 64 + b.value = 0 + if len(in) >= 8 { + b.fillFastStart() + } else { + b.fill() + b.fill() + } + b.advance(8 - uint8(highBit32(uint32(v)))) + return nil +} + +// peekBitsFast requires that at least one bit is requested every time. +// There are no checks if the buffer is filled. +func (b *bitReaderShifted) peekBitsFast(n uint8) uint16 { + return uint16(b.value >> ((64 - n) & 63)) +} + +func (b *bitReaderShifted) advance(n uint8) { + b.bitsRead += n + b.value <<= n & 63 +} + +// fillFast() will make sure at least 32 bits are available. +// There must be at least 4 bytes available. +func (b *bitReaderShifted) fillFast() { + if b.bitsRead < 32 { + return + } + + // 2 bounds checks. + v := b.in[b.off-4 : b.off] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value |= uint64(low) << ((b.bitsRead - 32) & 63) + b.bitsRead -= 32 + b.off -= 4 +} + +// fillFastStart() assumes the bitReaderShifted is empty and there is at least 8 bytes to read. +func (b *bitReaderShifted) fillFastStart() { + // Do single re-slice to avoid bounds checks. + b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.bitsRead = 0 + b.off -= 8 +} + +// fill() will make sure at least 32 bits are available. +func (b *bitReaderShifted) fill() { + if b.bitsRead < 32 { + return + } + if b.off > 4 { + v := b.in[b.off-4 : b.off] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value |= uint64(low) << ((b.bitsRead - 32) & 63) + b.bitsRead -= 32 + b.off -= 4 + return + } + for b.off > 0 { + b.value |= uint64(b.in[b.off-1]) << ((b.bitsRead - 8) & 63) + b.bitsRead -= 8 + b.off-- + } +} + +func (b *bitReaderShifted) remaining() uint { + return b.off*8 + uint(64-b.bitsRead) +} + +// close the bitstream and returns an error if out-of-buffer reads occurred. +func (b *bitReaderShifted) close() error { + // Release reference. + b.in = nil + if b.remaining() > 0 { + return fmt.Errorf("corrupt input: %d bits remain on stream", b.remaining()) + } + if b.bitsRead > 64 { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/vendor/github.com/klauspost/compress/huff0/bitwriter.go b/vendor/github.com/klauspost/compress/huff0/bitwriter.go new file mode 100644 index 0000000000..0ebc9aaac7 --- /dev/null +++ b/vendor/github.com/klauspost/compress/huff0/bitwriter.go @@ -0,0 +1,102 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +package huff0 + +// bitWriter will write bits. +// First bit will be LSB of the first byte of output. +type bitWriter struct { + bitContainer uint64 + nBits uint8 + out []byte +} + +// addBits16Clean will add up to 16 bits. value may not contain more set bits than indicated. +// It will not check if there is space for them, so the caller must ensure that it has flushed recently. +func (b *bitWriter) addBits16Clean(value uint16, bits uint8) { + b.bitContainer |= uint64(value) << (b.nBits & 63) + b.nBits += bits +} + +// encSymbol will add up to 16 bits. value may not contain more set bits than indicated. +// It will not check if there is space for them, so the caller must ensure that it has flushed recently. +func (b *bitWriter) encSymbol(ct cTable, symbol byte) { + enc := ct[symbol] + b.bitContainer |= uint64(enc.val) << (b.nBits & 63) + if false { + if enc.nBits == 0 { + panic("nbits 0") + } + } + b.nBits += enc.nBits +} + +// encTwoSymbols will add up to 32 bits. value may not contain more set bits than indicated. +// It will not check if there is space for them, so the caller must ensure that it has flushed recently. +func (b *bitWriter) encTwoSymbols(ct cTable, av, bv byte) { + encA := ct[av] + encB := ct[bv] + sh := b.nBits & 63 + combined := uint64(encA.val) | (uint64(encB.val) << (encA.nBits & 63)) + b.bitContainer |= combined << sh + if false { + if encA.nBits == 0 { + panic("nbitsA 0") + } + if encB.nBits == 0 { + panic("nbitsB 0") + } + } + b.nBits += encA.nBits + encB.nBits +} + +// encFourSymbols adds up to 32 bits from four symbols. +// It will not check if there is space for them, +// so the caller must ensure that b has been flushed recently. +func (b *bitWriter) encFourSymbols(encA, encB, encC, encD cTableEntry) { + bitsA := encA.nBits + bitsB := bitsA + encB.nBits + bitsC := bitsB + encC.nBits + bitsD := bitsC + encD.nBits + combined := uint64(encA.val) | + (uint64(encB.val) << (bitsA & 63)) | + (uint64(encC.val) << (bitsB & 63)) | + (uint64(encD.val) << (bitsC & 63)) + b.bitContainer |= combined << (b.nBits & 63) + b.nBits += bitsD +} + +// flush32 will flush out, so there are at least 32 bits available for writing. +func (b *bitWriter) flush32() { + if b.nBits < 32 { + return + } + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24)) + b.nBits -= 32 + b.bitContainer >>= 32 +} + +// flushAlign will flush remaining full bytes and align to next byte boundary. +func (b *bitWriter) flushAlign() { + nbBytes := (b.nBits + 7) >> 3 + for i := uint8(0); i < nbBytes; i++ { + b.out = append(b.out, byte(b.bitContainer>>(i*8))) + } + b.nBits = 0 + b.bitContainer = 0 +} + +// close will write the alignment bit and write the final byte(s) +// to the output. +func (b *bitWriter) close() { + // End mark + b.addBits16Clean(1, 1) + // flush until next byte. + b.flushAlign() +} diff --git a/vendor/github.com/klauspost/compress/huff0/compress.go b/vendor/github.com/klauspost/compress/huff0/compress.go new file mode 100644 index 0000000000..84aa3d12f0 --- /dev/null +++ b/vendor/github.com/klauspost/compress/huff0/compress.go @@ -0,0 +1,742 @@ +package huff0 + +import ( + "fmt" + "math" + "runtime" + "sync" +) + +// Compress1X will compress the input. +// The output can be decoded using Decompress1X. +// Supply a Scratch object. The scratch object contains state about re-use, +// So when sharing across independent encodes, be sure to set the re-use policy. +func Compress1X(in []byte, s *Scratch) (out []byte, reUsed bool, err error) { + s, err = s.prepare(in) + if err != nil { + return nil, false, err + } + return compress(in, s, s.compress1X) +} + +// Compress4X will compress the input. The input is split into 4 independent blocks +// and compressed similar to Compress1X. +// The output can be decoded using Decompress4X. +// Supply a Scratch object. The scratch object contains state about re-use, +// So when sharing across independent encodes, be sure to set the re-use policy. +func Compress4X(in []byte, s *Scratch) (out []byte, reUsed bool, err error) { + s, err = s.prepare(in) + if err != nil { + return nil, false, err + } + if false { + // TODO: compress4Xp only slightly faster. + const parallelThreshold = 8 << 10 + if len(in) < parallelThreshold || runtime.GOMAXPROCS(0) == 1 { + return compress(in, s, s.compress4X) + } + return compress(in, s, s.compress4Xp) + } + return compress(in, s, s.compress4X) +} + +func compress(in []byte, s *Scratch, compressor func(src []byte) ([]byte, error)) (out []byte, reUsed bool, err error) { + // Nuke previous table if we cannot reuse anyway. + if s.Reuse == ReusePolicyNone { + s.prevTable = s.prevTable[:0] + } + + // Create histogram, if none was provided. + maxCount := s.maxCount + var canReuse = false + if maxCount == 0 { + maxCount, canReuse = s.countSimple(in) + } else { + canReuse = s.canUseTable(s.prevTable) + } + + // We want the output size to be less than this: + wantSize := len(in) + if s.WantLogLess > 0 { + wantSize -= wantSize >> s.WantLogLess + } + + // Reset for next run. + s.clearCount = true + s.maxCount = 0 + if maxCount >= len(in) { + if maxCount > len(in) { + return nil, false, fmt.Errorf("maxCount (%d) > length (%d)", maxCount, len(in)) + } + if len(in) == 1 { + return nil, false, ErrIncompressible + } + // One symbol, use RLE + return nil, false, ErrUseRLE + } + if maxCount == 1 || maxCount < (len(in)>>7) { + // Each symbol present maximum once or too well distributed. + return nil, false, ErrIncompressible + } + if s.Reuse == ReusePolicyMust && !canReuse { + // We must reuse, but we can't. + return nil, false, ErrIncompressible + } + if (s.Reuse == ReusePolicyPrefer || s.Reuse == ReusePolicyMust) && canReuse { + keepTable := s.cTable + keepTL := s.actualTableLog + s.cTable = s.prevTable + s.actualTableLog = s.prevTableLog + s.Out, err = compressor(in) + s.cTable = keepTable + s.actualTableLog = keepTL + if err == nil && len(s.Out) < wantSize { + s.OutData = s.Out + return s.Out, true, nil + } + if s.Reuse == ReusePolicyMust { + return nil, false, ErrIncompressible + } + // Do not attempt to re-use later. + s.prevTable = s.prevTable[:0] + } + + // Calculate new table. + err = s.buildCTable() + if err != nil { + return nil, false, err + } + + if false && !s.canUseTable(s.cTable) { + panic("invalid table generated") + } + + if s.Reuse == ReusePolicyAllow && canReuse { + hSize := len(s.Out) + oldSize := s.prevTable.estimateSize(s.count[:s.symbolLen]) + newSize := s.cTable.estimateSize(s.count[:s.symbolLen]) + if oldSize <= hSize+newSize || hSize+12 >= wantSize { + // Retain cTable even if we re-use. + keepTable := s.cTable + keepTL := s.actualTableLog + + s.cTable = s.prevTable + s.actualTableLog = s.prevTableLog + s.Out, err = compressor(in) + + // Restore ctable. + s.cTable = keepTable + s.actualTableLog = keepTL + if err != nil { + return nil, false, err + } + if len(s.Out) >= wantSize { + return nil, false, ErrIncompressible + } + s.OutData = s.Out + return s.Out, true, nil + } + } + + // Use new table + err = s.cTable.write(s) + if err != nil { + s.OutTable = nil + return nil, false, err + } + s.OutTable = s.Out + + // Compress using new table + s.Out, err = compressor(in) + if err != nil { + s.OutTable = nil + return nil, false, err + } + if len(s.Out) >= wantSize { + s.OutTable = nil + return nil, false, ErrIncompressible + } + // Move current table into previous. + s.prevTable, s.prevTableLog, s.cTable = s.cTable, s.actualTableLog, s.prevTable[:0] + s.OutData = s.Out[len(s.OutTable):] + return s.Out, false, nil +} + +// EstimateSizes will estimate the data sizes +func EstimateSizes(in []byte, s *Scratch) (tableSz, dataSz, reuseSz int, err error) { + s, err = s.prepare(in) + if err != nil { + return 0, 0, 0, err + } + + // Create histogram, if none was provided. + tableSz, dataSz, reuseSz = -1, -1, -1 + maxCount := s.maxCount + var canReuse = false + if maxCount == 0 { + maxCount, canReuse = s.countSimple(in) + } else { + canReuse = s.canUseTable(s.prevTable) + } + + // We want the output size to be less than this: + wantSize := len(in) + if s.WantLogLess > 0 { + wantSize -= wantSize >> s.WantLogLess + } + + // Reset for next run. + s.clearCount = true + s.maxCount = 0 + if maxCount >= len(in) { + if maxCount > len(in) { + return 0, 0, 0, fmt.Errorf("maxCount (%d) > length (%d)", maxCount, len(in)) + } + if len(in) == 1 { + return 0, 0, 0, ErrIncompressible + } + // One symbol, use RLE + return 0, 0, 0, ErrUseRLE + } + if maxCount == 1 || maxCount < (len(in)>>7) { + // Each symbol present maximum once or too well distributed. + return 0, 0, 0, ErrIncompressible + } + + // Calculate new table. + err = s.buildCTable() + if err != nil { + return 0, 0, 0, err + } + + if false && !s.canUseTable(s.cTable) { + panic("invalid table generated") + } + + tableSz, err = s.cTable.estTableSize(s) + if err != nil { + return 0, 0, 0, err + } + if canReuse { + reuseSz = s.prevTable.estimateSize(s.count[:s.symbolLen]) + } + dataSz = s.cTable.estimateSize(s.count[:s.symbolLen]) + + // Restore + return tableSz, dataSz, reuseSz, nil +} + +func (s *Scratch) compress1X(src []byte) ([]byte, error) { + return s.compress1xDo(s.Out, src), nil +} + +func (s *Scratch) compress1xDo(dst, src []byte) []byte { + var bw = bitWriter{out: dst} + + // N is length divisible by 4. + n := len(src) + n -= n & 3 + cTable := s.cTable[:256] + + // Encode last bytes. + for i := len(src) & 3; i > 0; i-- { + bw.encSymbol(cTable, src[n+i-1]) + } + n -= 4 + if s.actualTableLog <= 8 { + for ; n >= 0; n -= 4 { + tmp := src[n : n+4] + // tmp should be len 4 + bw.flush32() + bw.encFourSymbols(cTable[tmp[3]], cTable[tmp[2]], cTable[tmp[1]], cTable[tmp[0]]) + } + } else { + for ; n >= 0; n -= 4 { + tmp := src[n : n+4] + // tmp should be len 4 + bw.flush32() + bw.encTwoSymbols(cTable, tmp[3], tmp[2]) + bw.flush32() + bw.encTwoSymbols(cTable, tmp[1], tmp[0]) + } + } + bw.close() + return bw.out +} + +var sixZeros [6]byte + +func (s *Scratch) compress4X(src []byte) ([]byte, error) { + if len(src) < 12 { + return nil, ErrIncompressible + } + segmentSize := (len(src) + 3) / 4 + + // Add placeholder for output length + offsetIdx := len(s.Out) + s.Out = append(s.Out, sixZeros[:]...) + + for i := 0; i < 4; i++ { + toDo := src + if len(toDo) > segmentSize { + toDo = toDo[:segmentSize] + } + src = src[len(toDo):] + + idx := len(s.Out) + s.Out = s.compress1xDo(s.Out, toDo) + if len(s.Out)-idx > math.MaxUint16 { + // We cannot store the size in the jump table + return nil, ErrIncompressible + } + // Write compressed length as little endian before block. + if i < 3 { + // Last length is not written. + length := len(s.Out) - idx + s.Out[i*2+offsetIdx] = byte(length) + s.Out[i*2+offsetIdx+1] = byte(length >> 8) + } + } + + return s.Out, nil +} + +// compress4Xp will compress 4 streams using separate goroutines. +func (s *Scratch) compress4Xp(src []byte) ([]byte, error) { + if len(src) < 12 { + return nil, ErrIncompressible + } + // Add placeholder for output length + s.Out = s.Out[:6] + + segmentSize := (len(src) + 3) / 4 + var wg sync.WaitGroup + wg.Add(4) + for i := 0; i < 4; i++ { + toDo := src + if len(toDo) > segmentSize { + toDo = toDo[:segmentSize] + } + src = src[len(toDo):] + + // Separate goroutine for each block. + go func(i int) { + s.tmpOut[i] = s.compress1xDo(s.tmpOut[i][:0], toDo) + wg.Done() + }(i) + } + wg.Wait() + for i := 0; i < 4; i++ { + o := s.tmpOut[i] + if len(o) > math.MaxUint16 { + // We cannot store the size in the jump table + return nil, ErrIncompressible + } + // Write compressed length as little endian before block. + if i < 3 { + // Last length is not written. + s.Out[i*2] = byte(len(o)) + s.Out[i*2+1] = byte(len(o) >> 8) + } + + // Write output. + s.Out = append(s.Out, o...) + } + return s.Out, nil +} + +// countSimple will create a simple histogram in s.count. +// Returns the biggest count. +// Does not update s.clearCount. +func (s *Scratch) countSimple(in []byte) (max int, reuse bool) { + reuse = true + _ = s.count // Assert that s != nil to speed up the following loop. + for _, v := range in { + s.count[v]++ + } + m := uint32(0) + if len(s.prevTable) > 0 { + for i, v := range s.count[:] { + if v == 0 { + continue + } + if v > m { + m = v + } + s.symbolLen = uint16(i) + 1 + if i >= len(s.prevTable) { + reuse = false + } else if s.prevTable[i].nBits == 0 { + reuse = false + } + } + return int(m), reuse + } + for i, v := range s.count[:] { + if v == 0 { + continue + } + if v > m { + m = v + } + s.symbolLen = uint16(i) + 1 + } + return int(m), false +} + +func (s *Scratch) canUseTable(c cTable) bool { + if len(c) < int(s.symbolLen) { + return false + } + for i, v := range s.count[:s.symbolLen] { + if v != 0 && c[i].nBits == 0 { + return false + } + } + return true +} + +//lint:ignore U1000 used for debugging +func (s *Scratch) validateTable(c cTable) bool { + if len(c) < int(s.symbolLen) { + return false + } + for i, v := range s.count[:s.symbolLen] { + if v != 0 { + if c[i].nBits == 0 { + return false + } + if c[i].nBits > s.actualTableLog { + return false + } + } + } + return true +} + +// minTableLog provides the minimum logSize to safely represent a distribution. +func (s *Scratch) minTableLog() uint8 { + minBitsSrc := highBit32(uint32(s.srcLen)) + 1 + minBitsSymbols := highBit32(uint32(s.symbolLen-1)) + 2 + if minBitsSrc < minBitsSymbols { + return uint8(minBitsSrc) + } + return uint8(minBitsSymbols) +} + +// optimalTableLog calculates and sets the optimal tableLog in s.actualTableLog +func (s *Scratch) optimalTableLog() { + tableLog := s.TableLog + minBits := s.minTableLog() + maxBitsSrc := uint8(highBit32(uint32(s.srcLen-1))) - 1 + if maxBitsSrc < tableLog { + // Accuracy can be reduced + tableLog = maxBitsSrc + } + if minBits > tableLog { + tableLog = minBits + } + // Need a minimum to safely represent all symbol values + if tableLog < minTablelog { + tableLog = minTablelog + } + if tableLog > tableLogMax { + tableLog = tableLogMax + } + s.actualTableLog = tableLog +} + +type cTableEntry struct { + val uint16 + nBits uint8 + // We have 8 bits extra +} + +const huffNodesMask = huffNodesLen - 1 + +func (s *Scratch) buildCTable() error { + s.optimalTableLog() + s.huffSort() + if cap(s.cTable) < maxSymbolValue+1 { + s.cTable = make([]cTableEntry, s.symbolLen, maxSymbolValue+1) + } else { + s.cTable = s.cTable[:s.symbolLen] + for i := range s.cTable { + s.cTable[i] = cTableEntry{} + } + } + + var startNode = int16(s.symbolLen) + nonNullRank := s.symbolLen - 1 + + nodeNb := startNode + huffNode := s.nodes[1 : huffNodesLen+1] + + // This overlays the slice above, but allows "-1" index lookups. + // Different from reference implementation. + huffNode0 := s.nodes[0 : huffNodesLen+1] + + for huffNode[nonNullRank].count() == 0 { + nonNullRank-- + } + + lowS := int16(nonNullRank) + nodeRoot := nodeNb + lowS - 1 + lowN := nodeNb + huffNode[nodeNb].setCount(huffNode[lowS].count() + huffNode[lowS-1].count()) + huffNode[lowS].setParent(nodeNb) + huffNode[lowS-1].setParent(nodeNb) + nodeNb++ + lowS -= 2 + for n := nodeNb; n <= nodeRoot; n++ { + huffNode[n].setCount(1 << 30) + } + // fake entry, strong barrier + huffNode0[0].setCount(1 << 31) + + // create parents + for nodeNb <= nodeRoot { + var n1, n2 int16 + if huffNode0[lowS+1].count() < huffNode0[lowN+1].count() { + n1 = lowS + lowS-- + } else { + n1 = lowN + lowN++ + } + if huffNode0[lowS+1].count() < huffNode0[lowN+1].count() { + n2 = lowS + lowS-- + } else { + n2 = lowN + lowN++ + } + + huffNode[nodeNb].setCount(huffNode0[n1+1].count() + huffNode0[n2+1].count()) + huffNode0[n1+1].setParent(nodeNb) + huffNode0[n2+1].setParent(nodeNb) + nodeNb++ + } + + // distribute weights (unlimited tree height) + huffNode[nodeRoot].setNbBits(0) + for n := nodeRoot - 1; n >= startNode; n-- { + huffNode[n].setNbBits(huffNode[huffNode[n].parent()].nbBits() + 1) + } + for n := uint16(0); n <= nonNullRank; n++ { + huffNode[n].setNbBits(huffNode[huffNode[n].parent()].nbBits() + 1) + } + s.actualTableLog = s.setMaxHeight(int(nonNullRank)) + maxNbBits := s.actualTableLog + + // fill result into tree (val, nbBits) + if maxNbBits > tableLogMax { + return fmt.Errorf("internal error: maxNbBits (%d) > tableLogMax (%d)", maxNbBits, tableLogMax) + } + var nbPerRank [tableLogMax + 1]uint16 + var valPerRank [16]uint16 + for _, v := range huffNode[:nonNullRank+1] { + nbPerRank[v.nbBits()]++ + } + // determine stating value per rank + { + min := uint16(0) + for n := maxNbBits; n > 0; n-- { + // get starting value within each rank + valPerRank[n] = min + min += nbPerRank[n] + min >>= 1 + } + } + + // push nbBits per symbol, symbol order + for _, v := range huffNode[:nonNullRank+1] { + s.cTable[v.symbol()].nBits = v.nbBits() + } + + // assign value within rank, symbol order + t := s.cTable[:s.symbolLen] + for n, val := range t { + nbits := val.nBits & 15 + v := valPerRank[nbits] + t[n].val = v + valPerRank[nbits] = v + 1 + } + + return nil +} + +// huffSort will sort symbols, decreasing order. +func (s *Scratch) huffSort() { + type rankPos struct { + base uint32 + current uint32 + } + + // Clear nodes + nodes := s.nodes[:huffNodesLen+1] + s.nodes = nodes + nodes = nodes[1 : huffNodesLen+1] + + // Sort into buckets based on length of symbol count. + var rank [32]rankPos + for _, v := range s.count[:s.symbolLen] { + r := highBit32(v+1) & 31 + rank[r].base++ + } + // maxBitLength is log2(BlockSizeMax) + 1 + const maxBitLength = 18 + 1 + for n := maxBitLength; n > 0; n-- { + rank[n-1].base += rank[n].base + } + for n := range rank[:maxBitLength] { + rank[n].current = rank[n].base + } + for n, c := range s.count[:s.symbolLen] { + r := (highBit32(c+1) + 1) & 31 + pos := rank[r].current + rank[r].current++ + prev := nodes[(pos-1)&huffNodesMask] + for pos > rank[r].base && c > prev.count() { + nodes[pos&huffNodesMask] = prev + pos-- + prev = nodes[(pos-1)&huffNodesMask] + } + nodes[pos&huffNodesMask] = makeNodeElt(c, byte(n)) + } +} + +func (s *Scratch) setMaxHeight(lastNonNull int) uint8 { + maxNbBits := s.actualTableLog + huffNode := s.nodes[1 : huffNodesLen+1] + //huffNode = huffNode[: huffNodesLen] + + largestBits := huffNode[lastNonNull].nbBits() + + // early exit : no elt > maxNbBits + if largestBits <= maxNbBits { + return largestBits + } + totalCost := int(0) + baseCost := int(1) << (largestBits - maxNbBits) + n := uint32(lastNonNull) + + for huffNode[n].nbBits() > maxNbBits { + totalCost += baseCost - (1 << (largestBits - huffNode[n].nbBits())) + huffNode[n].setNbBits(maxNbBits) + n-- + } + // n stops at huffNode[n].nbBits <= maxNbBits + + for huffNode[n].nbBits() == maxNbBits { + n-- + } + // n end at index of smallest symbol using < maxNbBits + + // renorm totalCost + totalCost >>= largestBits - maxNbBits /* note : totalCost is necessarily a multiple of baseCost */ + + // repay normalized cost + { + const noSymbol = 0xF0F0F0F0 + var rankLast [tableLogMax + 2]uint32 + + for i := range rankLast[:] { + rankLast[i] = noSymbol + } + + // Get pos of last (smallest) symbol per rank + { + currentNbBits := maxNbBits + for pos := int(n); pos >= 0; pos-- { + if huffNode[pos].nbBits() >= currentNbBits { + continue + } + currentNbBits = huffNode[pos].nbBits() // < maxNbBits + rankLast[maxNbBits-currentNbBits] = uint32(pos) + } + } + + for totalCost > 0 { + nBitsToDecrease := uint8(highBit32(uint32(totalCost))) + 1 + + for ; nBitsToDecrease > 1; nBitsToDecrease-- { + highPos := rankLast[nBitsToDecrease] + lowPos := rankLast[nBitsToDecrease-1] + if highPos == noSymbol { + continue + } + if lowPos == noSymbol { + break + } + highTotal := huffNode[highPos].count() + lowTotal := 2 * huffNode[lowPos].count() + if highTotal <= lowTotal { + break + } + } + // only triggered when no more rank 1 symbol left => find closest one (note : there is necessarily at least one !) + // HUF_MAX_TABLELOG test just to please gcc 5+; but it should not be necessary + // FIXME: try to remove + for (nBitsToDecrease <= tableLogMax) && (rankLast[nBitsToDecrease] == noSymbol) { + nBitsToDecrease++ + } + totalCost -= 1 << (nBitsToDecrease - 1) + if rankLast[nBitsToDecrease-1] == noSymbol { + // this rank is no longer empty + rankLast[nBitsToDecrease-1] = rankLast[nBitsToDecrease] + } + huffNode[rankLast[nBitsToDecrease]].setNbBits(1 + + huffNode[rankLast[nBitsToDecrease]].nbBits()) + if rankLast[nBitsToDecrease] == 0 { + /* special case, reached largest symbol */ + rankLast[nBitsToDecrease] = noSymbol + } else { + rankLast[nBitsToDecrease]-- + if huffNode[rankLast[nBitsToDecrease]].nbBits() != maxNbBits-nBitsToDecrease { + rankLast[nBitsToDecrease] = noSymbol /* this rank is now empty */ + } + } + } + + for totalCost < 0 { /* Sometimes, cost correction overshoot */ + if rankLast[1] == noSymbol { /* special case : no rank 1 symbol (using maxNbBits-1); let's create one from largest rank 0 (using maxNbBits) */ + for huffNode[n].nbBits() == maxNbBits { + n-- + } + huffNode[n+1].setNbBits(huffNode[n+1].nbBits() - 1) + rankLast[1] = n + 1 + totalCost++ + continue + } + huffNode[rankLast[1]+1].setNbBits(huffNode[rankLast[1]+1].nbBits() - 1) + rankLast[1]++ + totalCost++ + } + } + return maxNbBits +} + +// A nodeElt is the fields +// +// count uint32 +// parent uint16 +// symbol byte +// nbBits uint8 +// +// in some order, all squashed into an integer so that the compiler +// always loads and stores entire nodeElts instead of separate fields. +type nodeElt uint64 + +func makeNodeElt(count uint32, symbol byte) nodeElt { + return nodeElt(count) | nodeElt(symbol)<<48 +} + +func (e *nodeElt) count() uint32 { return uint32(*e) } +func (e *nodeElt) parent() uint16 { return uint16(*e >> 32) } +func (e *nodeElt) symbol() byte { return byte(*e >> 48) } +func (e *nodeElt) nbBits() uint8 { return uint8(*e >> 56) } + +func (e *nodeElt) setCount(c uint32) { *e = (*e)&0xffffffff00000000 | nodeElt(c) } +func (e *nodeElt) setParent(p int16) { *e = (*e)&0xffff0000ffffffff | nodeElt(uint16(p))<<32 } +func (e *nodeElt) setNbBits(n uint8) { *e = (*e)&0x00ffffffffffffff | nodeElt(n)<<56 } diff --git a/vendor/github.com/klauspost/compress/huff0/decompress.go b/vendor/github.com/klauspost/compress/huff0/decompress.go new file mode 100644 index 0000000000..54bd08b25c --- /dev/null +++ b/vendor/github.com/klauspost/compress/huff0/decompress.go @@ -0,0 +1,1167 @@ +package huff0 + +import ( + "errors" + "fmt" + "io" + "sync" + + "github.com/klauspost/compress/fse" +) + +type dTable struct { + single []dEntrySingle +} + +// single-symbols decoding +type dEntrySingle struct { + entry uint16 +} + +// Uses special code for all tables that are < 8 bits. +const use8BitTables = true + +// ReadTable will read a table from the input. +// The size of the input may be larger than the table definition. +// Any content remaining after the table definition will be returned. +// If no Scratch is provided a new one is allocated. +// The returned Scratch can be used for encoding or decoding input using this table. +func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) { + s, err = s.prepare(nil) + if err != nil { + return s, nil, err + } + if len(in) <= 1 { + return s, nil, errors.New("input too small for table") + } + iSize := in[0] + in = in[1:] + if iSize >= 128 { + // Uncompressed + oSize := iSize - 127 + iSize = (oSize + 1) / 2 + if int(iSize) > len(in) { + return s, nil, errors.New("input too small for table") + } + for n := uint8(0); n < oSize; n += 2 { + v := in[n/2] + s.huffWeight[n] = v >> 4 + s.huffWeight[n+1] = v & 15 + } + s.symbolLen = uint16(oSize) + in = in[iSize:] + } else { + if len(in) < int(iSize) { + return s, nil, fmt.Errorf("input too small for table, want %d bytes, have %d", iSize, len(in)) + } + // FSE compressed weights + s.fse.DecompressLimit = 255 + hw := s.huffWeight[:] + s.fse.Out = hw + b, err := fse.Decompress(in[:iSize], s.fse) + s.fse.Out = nil + if err != nil { + return s, nil, fmt.Errorf("fse decompress returned: %w", err) + } + if len(b) > 255 { + return s, nil, errors.New("corrupt input: output table too large") + } + s.symbolLen = uint16(len(b)) + in = in[iSize:] + } + + // collect weight stats + var rankStats [16]uint32 + weightTotal := uint32(0) + for _, v := range s.huffWeight[:s.symbolLen] { + if v > tableLogMax { + return s, nil, errors.New("corrupt input: weight too large") + } + v2 := v & 15 + rankStats[v2]++ + // (1 << (v2-1)) is slower since the compiler cannot prove that v2 isn't 0. + weightTotal += (1 << v2) >> 1 + } + if weightTotal == 0 { + return s, nil, errors.New("corrupt input: weights zero") + } + + // get last non-null symbol weight (implied, total must be 2^n) + { + tableLog := highBit32(weightTotal) + 1 + if tableLog > tableLogMax { + return s, nil, errors.New("corrupt input: tableLog too big") + } + s.actualTableLog = uint8(tableLog) + // determine last weight + { + total := uint32(1) << tableLog + rest := total - weightTotal + verif := uint32(1) << highBit32(rest) + lastWeight := highBit32(rest) + 1 + if verif != rest { + // last value must be a clean power of 2 + return s, nil, errors.New("corrupt input: last value not power of two") + } + s.huffWeight[s.symbolLen] = uint8(lastWeight) + s.symbolLen++ + rankStats[lastWeight]++ + } + } + + if (rankStats[1] < 2) || (rankStats[1]&1 != 0) { + // by construction : at least 2 elts of rank 1, must be even + return s, nil, errors.New("corrupt input: min elt size, even check failed ") + } + + // TODO: Choose between single/double symbol decoding + + // Calculate starting value for each rank + { + var nextRankStart uint32 + for n := uint8(1); n < s.actualTableLog+1; n++ { + current := nextRankStart + nextRankStart += rankStats[n] << (n - 1) + rankStats[n] = current + } + } + + // fill DTable (always full size) + tSize := 1 << tableLogMax + if len(s.dt.single) != tSize { + s.dt.single = make([]dEntrySingle, tSize) + } + cTable := s.prevTable + if cap(cTable) < maxSymbolValue+1 { + cTable = make([]cTableEntry, 0, maxSymbolValue+1) + } + cTable = cTable[:maxSymbolValue+1] + s.prevTable = cTable[:s.symbolLen] + s.prevTableLog = s.actualTableLog + + for n, w := range s.huffWeight[:s.symbolLen] { + if w == 0 { + cTable[n] = cTableEntry{ + val: 0, + nBits: 0, + } + continue + } + length := (uint32(1) << w) >> 1 + d := dEntrySingle{ + entry: uint16(s.actualTableLog+1-w) | (uint16(n) << 8), + } + + rank := &rankStats[w] + cTable[n] = cTableEntry{ + val: uint16(*rank >> (w - 1)), + nBits: uint8(d.entry), + } + + single := s.dt.single[*rank : *rank+length] + for i := range single { + single[i] = d + } + *rank += length + } + + return s, in, nil +} + +// Decompress1X will decompress a 1X encoded stream. +// The length of the supplied input must match the end of a block exactly. +// Before this is called, the table must be initialized with ReadTable unless +// the encoder re-used the table. +// deprecated: Use the stateless Decoder() to get a concurrent version. +func (s *Scratch) Decompress1X(in []byte) (out []byte, err error) { + if cap(s.Out) < s.MaxDecodedSize { + s.Out = make([]byte, s.MaxDecodedSize) + } + s.Out = s.Out[:0:s.MaxDecodedSize] + s.Out, err = s.Decoder().Decompress1X(s.Out, in) + return s.Out, err +} + +// Decompress4X will decompress a 4X encoded stream. +// Before this is called, the table must be initialized with ReadTable unless +// the encoder re-used the table. +// The length of the supplied input must match the end of a block exactly. +// The destination size of the uncompressed data must be known and provided. +// deprecated: Use the stateless Decoder() to get a concurrent version. +func (s *Scratch) Decompress4X(in []byte, dstSize int) (out []byte, err error) { + if dstSize > s.MaxDecodedSize { + return nil, ErrMaxDecodedSizeExceeded + } + if cap(s.Out) < dstSize { + s.Out = make([]byte, s.MaxDecodedSize) + } + s.Out = s.Out[:0:dstSize] + s.Out, err = s.Decoder().Decompress4X(s.Out, in) + return s.Out, err +} + +// Decoder will return a stateless decoder that can be used by multiple +// decompressors concurrently. +// Before this is called, the table must be initialized with ReadTable. +// The Decoder is still linked to the scratch buffer so that cannot be reused. +// However, it is safe to discard the scratch. +func (s *Scratch) Decoder() *Decoder { + return &Decoder{ + dt: s.dt, + actualTableLog: s.actualTableLog, + bufs: &s.decPool, + } +} + +// Decoder provides stateless decoding. +type Decoder struct { + dt dTable + actualTableLog uint8 + bufs *sync.Pool +} + +func (d *Decoder) buffer() *[4][256]byte { + buf, ok := d.bufs.Get().(*[4][256]byte) + if ok { + return buf + } + return &[4][256]byte{} +} + +// decompress1X8Bit will decompress a 1X encoded stream with tablelog <= 8. +// The cap of the output buffer will be the maximum decompressed size. +// The length of the supplied input must match the end of a block exactly. +func (d *Decoder) decompress1X8Bit(dst, src []byte) ([]byte, error) { + if d.actualTableLog == 8 { + return d.decompress1X8BitExactly(dst, src) + } + var br bitReaderBytes + err := br.init(src) + if err != nil { + return dst, err + } + maxDecodedSize := cap(dst) + dst = dst[:0] + + // Avoid bounds check by always having full sized table. + dt := d.dt.single[:256] + + // Use temp table to avoid bound checks/append penalty. + bufs := d.buffer() + buf := &bufs[0] + var off uint8 + + switch d.actualTableLog { + case 8: + const shift = 0 + for br.off >= 4 { + br.fillFast() + v := dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + br.close() + d.bufs.Put(bufs) + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + case 7: + const shift = 8 - 7 + for br.off >= 4 { + br.fillFast() + v := dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + br.close() + d.bufs.Put(bufs) + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + case 6: + const shift = 8 - 6 + for br.off >= 4 { + br.fillFast() + v := dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + d.bufs.Put(bufs) + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + case 5: + const shift = 8 - 5 + for br.off >= 4 { + br.fillFast() + v := dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + d.bufs.Put(bufs) + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + case 4: + const shift = 8 - 4 + for br.off >= 4 { + br.fillFast() + v := dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + d.bufs.Put(bufs) + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + case 3: + const shift = 8 - 3 + for br.off >= 4 { + br.fillFast() + v := dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + d.bufs.Put(bufs) + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + case 2: + const shift = 8 - 2 + for br.off >= 4 { + br.fillFast() + v := dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + d.bufs.Put(bufs) + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + case 1: + const shift = 8 - 1 + for br.off >= 4 { + br.fillFast() + v := dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>(56+shift))] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + d.bufs.Put(bufs) + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + default: + d.bufs.Put(bufs) + return nil, fmt.Errorf("invalid tablelog: %d", d.actualTableLog) + } + + if len(dst)+int(off) > maxDecodedSize { + d.bufs.Put(bufs) + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:off]...) + + // br < 4, so uint8 is fine + bitsLeft := int8(uint8(br.off)*8 + (64 - br.bitsRead)) + shift := (8 - d.actualTableLog) & 7 + + for bitsLeft > 0 { + if br.bitsRead >= 64-8 { + for br.off > 0 { + br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) + br.bitsRead -= 8 + br.off-- + } + } + if len(dst) >= maxDecodedSize { + br.close() + d.bufs.Put(bufs) + return nil, ErrMaxDecodedSizeExceeded + } + v := dt[br.peekByteFast()>>shift] + nBits := uint8(v.entry) + br.advance(nBits) + bitsLeft -= int8(nBits) + dst = append(dst, uint8(v.entry>>8)) + } + d.bufs.Put(bufs) + return dst, br.close() +} + +// decompress1X8Bit will decompress a 1X encoded stream with tablelog <= 8. +// The cap of the output buffer will be the maximum decompressed size. +// The length of the supplied input must match the end of a block exactly. +func (d *Decoder) decompress1X8BitExactly(dst, src []byte) ([]byte, error) { + var br bitReaderBytes + err := br.init(src) + if err != nil { + return dst, err + } + maxDecodedSize := cap(dst) + dst = dst[:0] + + // Avoid bounds check by always having full sized table. + dt := d.dt.single[:256] + + // Use temp table to avoid bound checks/append penalty. + bufs := d.buffer() + buf := &bufs[0] + var off uint8 + + const shift = 56 + + //fmt.Printf("mask: %b, tl:%d\n", mask, d.actualTableLog) + for br.off >= 4 { + br.fillFast() + v := dt[uint8(br.value>>shift)] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>shift)] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>shift)] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[uint8(br.value>>shift)] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + d.bufs.Put(bufs) + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + + if len(dst)+int(off) > maxDecodedSize { + d.bufs.Put(bufs) + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:off]...) + + // br < 4, so uint8 is fine + bitsLeft := int8(uint8(br.off)*8 + (64 - br.bitsRead)) + for bitsLeft > 0 { + if br.bitsRead >= 64-8 { + for br.off > 0 { + br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) + br.bitsRead -= 8 + br.off-- + } + } + if len(dst) >= maxDecodedSize { + d.bufs.Put(bufs) + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + v := dt[br.peekByteFast()] + nBits := uint8(v.entry) + br.advance(nBits) + bitsLeft -= int8(nBits) + dst = append(dst, uint8(v.entry>>8)) + } + d.bufs.Put(bufs) + return dst, br.close() +} + +// Decompress4X will decompress a 4X encoded stream. +// The length of the supplied input must match the end of a block exactly. +// The *capacity* of the dst slice must match the destination size of +// the uncompressed data exactly. +func (d *Decoder) decompress4X8bit(dst, src []byte) ([]byte, error) { + if d.actualTableLog == 8 { + return d.decompress4X8bitExactly(dst, src) + } + + var br [4]bitReaderBytes + start := 6 + for i := 0; i < 3; i++ { + length := int(src[i*2]) | (int(src[i*2+1]) << 8) + if start+length >= len(src) { + return nil, errors.New("truncated input (or invalid offset)") + } + err := br[i].init(src[start : start+length]) + if err != nil { + return nil, err + } + start += length + } + err := br[3].init(src[start:]) + if err != nil { + return nil, err + } + + // destination, offset to match first output + dstSize := cap(dst) + dst = dst[:dstSize] + out := dst + dstEvery := (dstSize + 3) / 4 + + shift := (56 + (8 - d.actualTableLog)) & 63 + + const tlSize = 1 << 8 + single := d.dt.single[:tlSize] + + // Use temp table to avoid bound checks/append penalty. + buf := d.buffer() + var off uint8 + var decoded int + + // Decode 4 values from each decoder/loop. + const bufoff = 256 + for { + if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 { + break + } + + { + // Interleave 2 decodes. + const stream = 0 + const stream2 = 1 + br1 := &br[stream] + br2 := &br[stream2] + br1.fillFast() + br2.fillFast() + + v := single[uint8(br1.value>>shift)].entry + v2 := single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off] = uint8(v >> 8) + buf[stream2][off] = uint8(v2 >> 8) + + v = single[uint8(br1.value>>shift)].entry + v2 = single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off+1] = uint8(v >> 8) + buf[stream2][off+1] = uint8(v2 >> 8) + + v = single[uint8(br1.value>>shift)].entry + v2 = single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off+2] = uint8(v >> 8) + buf[stream2][off+2] = uint8(v2 >> 8) + + v = single[uint8(br1.value>>shift)].entry + v2 = single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off+3] = uint8(v >> 8) + buf[stream2][off+3] = uint8(v2 >> 8) + } + + { + const stream = 2 + const stream2 = 3 + br1 := &br[stream] + br2 := &br[stream2] + br1.fillFast() + br2.fillFast() + + v := single[uint8(br1.value>>shift)].entry + v2 := single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off] = uint8(v >> 8) + buf[stream2][off] = uint8(v2 >> 8) + + v = single[uint8(br1.value>>shift)].entry + v2 = single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off+1] = uint8(v >> 8) + buf[stream2][off+1] = uint8(v2 >> 8) + + v = single[uint8(br1.value>>shift)].entry + v2 = single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off+2] = uint8(v >> 8) + buf[stream2][off+2] = uint8(v2 >> 8) + + v = single[uint8(br1.value>>shift)].entry + v2 = single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off+3] = uint8(v >> 8) + buf[stream2][off+3] = uint8(v2 >> 8) + } + + off += 4 + + if off == 0 { + if bufoff > dstEvery { + d.bufs.Put(buf) + return nil, errors.New("corruption detected: stream overrun 1") + } + // There must at least be 3 buffers left. + if len(out)-bufoff < dstEvery*3 { + d.bufs.Put(buf) + return nil, errors.New("corruption detected: stream overrun 2") + } + //copy(out, buf[0][:]) + //copy(out[dstEvery:], buf[1][:]) + //copy(out[dstEvery*2:], buf[2][:]) + *(*[bufoff]byte)(out) = buf[0] + *(*[bufoff]byte)(out[dstEvery:]) = buf[1] + *(*[bufoff]byte)(out[dstEvery*2:]) = buf[2] + *(*[bufoff]byte)(out[dstEvery*3:]) = buf[3] + out = out[bufoff:] + decoded += bufoff * 4 + } + } + if off > 0 { + ioff := int(off) + if len(out) < dstEvery*3+ioff { + d.bufs.Put(buf) + return nil, errors.New("corruption detected: stream overrun 3") + } + copy(out, buf[0][:off]) + copy(out[dstEvery:], buf[1][:off]) + copy(out[dstEvery*2:], buf[2][:off]) + copy(out[dstEvery*3:], buf[3][:off]) + decoded += int(off) * 4 + out = out[off:] + } + + // Decode remaining. + // Decode remaining. + remainBytes := dstEvery - (decoded / 4) + for i := range br { + offset := dstEvery * i + endsAt := offset + remainBytes + if endsAt > len(out) { + endsAt = len(out) + } + br := &br[i] + bitsLeft := br.remaining() + for bitsLeft > 0 { + if br.finished() { + d.bufs.Put(buf) + return nil, io.ErrUnexpectedEOF + } + if br.bitsRead >= 56 { + if br.off >= 4 { + v := br.in[br.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + br.value |= uint64(low) << (br.bitsRead - 32) + br.bitsRead -= 32 + br.off -= 4 + } else { + for br.off > 0 { + br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) + br.bitsRead -= 8 + br.off-- + } + } + } + // end inline... + if offset >= endsAt { + d.bufs.Put(buf) + return nil, errors.New("corruption detected: stream overrun 4") + } + + // Read value and increment offset. + v := single[uint8(br.value>>shift)].entry + nBits := uint8(v) + br.advance(nBits) + bitsLeft -= uint(nBits) + out[offset] = uint8(v >> 8) + offset++ + } + if offset != endsAt { + d.bufs.Put(buf) + return nil, fmt.Errorf("corruption detected: short output block %d, end %d != %d", i, offset, endsAt) + } + decoded += offset - dstEvery*i + err = br.close() + if err != nil { + d.bufs.Put(buf) + return nil, err + } + } + d.bufs.Put(buf) + if dstSize != decoded { + return nil, errors.New("corruption detected: short output block") + } + return dst, nil +} + +// Decompress4X will decompress a 4X encoded stream. +// The length of the supplied input must match the end of a block exactly. +// The *capacity* of the dst slice must match the destination size of +// the uncompressed data exactly. +func (d *Decoder) decompress4X8bitExactly(dst, src []byte) ([]byte, error) { + var br [4]bitReaderBytes + start := 6 + for i := 0; i < 3; i++ { + length := int(src[i*2]) | (int(src[i*2+1]) << 8) + if start+length >= len(src) { + return nil, errors.New("truncated input (or invalid offset)") + } + err := br[i].init(src[start : start+length]) + if err != nil { + return nil, err + } + start += length + } + err := br[3].init(src[start:]) + if err != nil { + return nil, err + } + + // destination, offset to match first output + dstSize := cap(dst) + dst = dst[:dstSize] + out := dst + dstEvery := (dstSize + 3) / 4 + + const shift = 56 + const tlSize = 1 << 8 + single := d.dt.single[:tlSize] + + // Use temp table to avoid bound checks/append penalty. + buf := d.buffer() + var off uint8 + var decoded int + + // Decode 4 values from each decoder/loop. + const bufoff = 256 + for { + if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 { + break + } + + { + // Interleave 2 decodes. + const stream = 0 + const stream2 = 1 + br1 := &br[stream] + br2 := &br[stream2] + br1.fillFast() + br2.fillFast() + + v := single[uint8(br1.value>>shift)].entry + v2 := single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off] = uint8(v >> 8) + buf[stream2][off] = uint8(v2 >> 8) + + v = single[uint8(br1.value>>shift)].entry + v2 = single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off+1] = uint8(v >> 8) + buf[stream2][off+1] = uint8(v2 >> 8) + + v = single[uint8(br1.value>>shift)].entry + v2 = single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off+2] = uint8(v >> 8) + buf[stream2][off+2] = uint8(v2 >> 8) + + v = single[uint8(br1.value>>shift)].entry + v2 = single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off+3] = uint8(v >> 8) + buf[stream2][off+3] = uint8(v2 >> 8) + } + + { + const stream = 2 + const stream2 = 3 + br1 := &br[stream] + br2 := &br[stream2] + br1.fillFast() + br2.fillFast() + + v := single[uint8(br1.value>>shift)].entry + v2 := single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off] = uint8(v >> 8) + buf[stream2][off] = uint8(v2 >> 8) + + v = single[uint8(br1.value>>shift)].entry + v2 = single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off+1] = uint8(v >> 8) + buf[stream2][off+1] = uint8(v2 >> 8) + + v = single[uint8(br1.value>>shift)].entry + v2 = single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off+2] = uint8(v >> 8) + buf[stream2][off+2] = uint8(v2 >> 8) + + v = single[uint8(br1.value>>shift)].entry + v2 = single[uint8(br2.value>>shift)].entry + br1.bitsRead += uint8(v) + br1.value <<= v & 63 + br2.bitsRead += uint8(v2) + br2.value <<= v2 & 63 + buf[stream][off+3] = uint8(v >> 8) + buf[stream2][off+3] = uint8(v2 >> 8) + } + + off += 4 + + if off == 0 { + if bufoff > dstEvery { + d.bufs.Put(buf) + return nil, errors.New("corruption detected: stream overrun 1") + } + // There must at least be 3 buffers left. + if len(out)-bufoff < dstEvery*3 { + d.bufs.Put(buf) + return nil, errors.New("corruption detected: stream overrun 2") + } + + //copy(out, buf[0][:]) + //copy(out[dstEvery:], buf[1][:]) + //copy(out[dstEvery*2:], buf[2][:]) + // copy(out[dstEvery*3:], buf[3][:]) + *(*[bufoff]byte)(out) = buf[0] + *(*[bufoff]byte)(out[dstEvery:]) = buf[1] + *(*[bufoff]byte)(out[dstEvery*2:]) = buf[2] + *(*[bufoff]byte)(out[dstEvery*3:]) = buf[3] + out = out[bufoff:] + decoded += bufoff * 4 + } + } + if off > 0 { + ioff := int(off) + if len(out) < dstEvery*3+ioff { + return nil, errors.New("corruption detected: stream overrun 3") + } + copy(out, buf[0][:off]) + copy(out[dstEvery:], buf[1][:off]) + copy(out[dstEvery*2:], buf[2][:off]) + copy(out[dstEvery*3:], buf[3][:off]) + decoded += int(off) * 4 + out = out[off:] + } + + // Decode remaining. + remainBytes := dstEvery - (decoded / 4) + for i := range br { + offset := dstEvery * i + endsAt := offset + remainBytes + if endsAt > len(out) { + endsAt = len(out) + } + br := &br[i] + bitsLeft := br.remaining() + for bitsLeft > 0 { + if br.finished() { + d.bufs.Put(buf) + return nil, io.ErrUnexpectedEOF + } + if br.bitsRead >= 56 { + if br.off >= 4 { + v := br.in[br.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + br.value |= uint64(low) << (br.bitsRead - 32) + br.bitsRead -= 32 + br.off -= 4 + } else { + for br.off > 0 { + br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) + br.bitsRead -= 8 + br.off-- + } + } + } + // end inline... + if offset >= endsAt { + d.bufs.Put(buf) + return nil, errors.New("corruption detected: stream overrun 4") + } + + // Read value and increment offset. + v := single[br.peekByteFast()].entry + nBits := uint8(v) + br.advance(nBits) + bitsLeft -= uint(nBits) + out[offset] = uint8(v >> 8) + offset++ + } + if offset != endsAt { + d.bufs.Put(buf) + return nil, fmt.Errorf("corruption detected: short output block %d, end %d != %d", i, offset, endsAt) + } + + decoded += offset - dstEvery*i + err = br.close() + if err != nil { + d.bufs.Put(buf) + return nil, err + } + } + d.bufs.Put(buf) + if dstSize != decoded { + return nil, errors.New("corruption detected: short output block") + } + return dst, nil +} + +// matches will compare a decoding table to a coding table. +// Errors are written to the writer. +// Nothing will be written if table is ok. +func (s *Scratch) matches(ct cTable, w io.Writer) { + if s == nil || len(s.dt.single) == 0 { + return + } + dt := s.dt.single[:1<>8) == byte(sym) { + fmt.Fprintf(w, "symbol %x has decoder, but no encoder\n", sym) + errs++ + break + } + } + if errs == 0 { + broken-- + } + continue + } + // Unused bits in input + ub := tablelog - enc.nBits + top := enc.val << ub + // decoder looks at top bits. + dec := dt[top] + if uint8(dec.entry) != enc.nBits { + fmt.Fprintf(w, "symbol 0x%x bit size mismatch (enc: %d, dec:%d).\n", sym, enc.nBits, uint8(dec.entry)) + errs++ + } + if uint8(dec.entry>>8) != uint8(sym) { + fmt.Fprintf(w, "symbol 0x%x decoder output mismatch (enc: %d, dec:%d).\n", sym, sym, uint8(dec.entry>>8)) + errs++ + } + if errs > 0 { + fmt.Fprintf(w, "%d errros in base, stopping\n", errs) + continue + } + // Ensure that all combinations are covered. + for i := uint16(0); i < (1 << ub); i++ { + vval := top | i + dec := dt[vval] + if uint8(dec.entry) != enc.nBits { + fmt.Fprintf(w, "symbol 0x%x bit size mismatch (enc: %d, dec:%d).\n", vval, enc.nBits, uint8(dec.entry)) + errs++ + } + if uint8(dec.entry>>8) != uint8(sym) { + fmt.Fprintf(w, "symbol 0x%x decoder output mismatch (enc: %d, dec:%d).\n", vval, sym, uint8(dec.entry>>8)) + errs++ + } + if errs > 20 { + fmt.Fprintf(w, "%d errros, stopping\n", errs) + break + } + } + if errs == 0 { + ok++ + broken-- + } + } + if broken > 0 { + fmt.Fprintf(w, "%d broken, %d ok\n", broken, ok) + } +} diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go new file mode 100644 index 0000000000..ba7e8e6b02 --- /dev/null +++ b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go @@ -0,0 +1,226 @@ +//go:build amd64 && !appengine && !noasm && gc +// +build amd64,!appengine,!noasm,gc + +// This file contains the specialisation of Decoder.Decompress4X +// and Decoder.Decompress1X that use an asm implementation of thir main loops. +package huff0 + +import ( + "errors" + "fmt" + + "github.com/klauspost/compress/internal/cpuinfo" +) + +// decompress4x_main_loop_x86 is an x86 assembler implementation +// of Decompress4X when tablelog > 8. +// +//go:noescape +func decompress4x_main_loop_amd64(ctx *decompress4xContext) + +// decompress4x_8b_loop_x86 is an x86 assembler implementation +// of Decompress4X when tablelog <= 8 which decodes 4 entries +// per loop. +// +//go:noescape +func decompress4x_8b_main_loop_amd64(ctx *decompress4xContext) + +// fallback8BitSize is the size where using Go version is faster. +const fallback8BitSize = 800 + +type decompress4xContext struct { + pbr *[4]bitReaderShifted + peekBits uint8 + out *byte + dstEvery int + tbl *dEntrySingle + decoded int + limit *byte +} + +// Decompress4X will decompress a 4X encoded stream. +// The length of the supplied input must match the end of a block exactly. +// The *capacity* of the dst slice must match the destination size of +// the uncompressed data exactly. +func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) { + if len(d.dt.single) == 0 { + return nil, errors.New("no table loaded") + } + if len(src) < 6+(4*1) { + return nil, errors.New("input too small") + } + + use8BitTables := d.actualTableLog <= 8 + if cap(dst) < fallback8BitSize && use8BitTables { + return d.decompress4X8bit(dst, src) + } + + var br [4]bitReaderShifted + // Decode "jump table" + start := 6 + for i := 0; i < 3; i++ { + length := int(src[i*2]) | (int(src[i*2+1]) << 8) + if start+length >= len(src) { + return nil, errors.New("truncated input (or invalid offset)") + } + err := br[i].init(src[start : start+length]) + if err != nil { + return nil, err + } + start += length + } + err := br[3].init(src[start:]) + if err != nil { + return nil, err + } + + // destination, offset to match first output + dstSize := cap(dst) + dst = dst[:dstSize] + out := dst + dstEvery := (dstSize + 3) / 4 + + const tlSize = 1 << tableLogMax + const tlMask = tlSize - 1 + single := d.dt.single[:tlSize] + + var decoded int + + if len(out) > 4*4 && !(br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4) { + ctx := decompress4xContext{ + pbr: &br, + peekBits: uint8((64 - d.actualTableLog) & 63), // see: bitReaderShifted.peekBitsFast() + out: &out[0], + dstEvery: dstEvery, + tbl: &single[0], + limit: &out[dstEvery-4], // Always stop decoding when first buffer gets here to avoid writing OOB on last. + } + if use8BitTables { + decompress4x_8b_main_loop_amd64(&ctx) + } else { + decompress4x_main_loop_amd64(&ctx) + } + + decoded = ctx.decoded + out = out[decoded/4:] + } + + // Decode remaining. + remainBytes := dstEvery - (decoded / 4) + for i := range br { + offset := dstEvery * i + endsAt := offset + remainBytes + if endsAt > len(out) { + endsAt = len(out) + } + br := &br[i] + bitsLeft := br.remaining() + for bitsLeft > 0 { + br.fill() + if offset >= endsAt { + return nil, errors.New("corruption detected: stream overrun 4") + } + + // Read value and increment offset. + val := br.peekBitsFast(d.actualTableLog) + v := single[val&tlMask].entry + nBits := uint8(v) + br.advance(nBits) + bitsLeft -= uint(nBits) + out[offset] = uint8(v >> 8) + offset++ + } + if offset != endsAt { + return nil, fmt.Errorf("corruption detected: short output block %d, end %d != %d", i, offset, endsAt) + } + decoded += offset - dstEvery*i + err = br.close() + if err != nil { + return nil, err + } + } + if dstSize != decoded { + return nil, errors.New("corruption detected: short output block") + } + return dst, nil +} + +// decompress4x_main_loop_x86 is an x86 assembler implementation +// of Decompress1X when tablelog > 8. +// +//go:noescape +func decompress1x_main_loop_amd64(ctx *decompress1xContext) + +// decompress4x_main_loop_x86 is an x86 with BMI2 assembler implementation +// of Decompress1X when tablelog > 8. +// +//go:noescape +func decompress1x_main_loop_bmi2(ctx *decompress1xContext) + +type decompress1xContext struct { + pbr *bitReaderShifted + peekBits uint8 + out *byte + outCap int + tbl *dEntrySingle + decoded int +} + +// Error reported by asm implementations +const error_max_decoded_size_exeeded = -1 + +// Decompress1X will decompress a 1X encoded stream. +// The cap of the output buffer will be the maximum decompressed size. +// The length of the supplied input must match the end of a block exactly. +func (d *Decoder) Decompress1X(dst, src []byte) ([]byte, error) { + if len(d.dt.single) == 0 { + return nil, errors.New("no table loaded") + } + var br bitReaderShifted + err := br.init(src) + if err != nil { + return dst, err + } + maxDecodedSize := cap(dst) + dst = dst[:maxDecodedSize] + + const tlSize = 1 << tableLogMax + const tlMask = tlSize - 1 + + if maxDecodedSize >= 4 { + ctx := decompress1xContext{ + pbr: &br, + out: &dst[0], + outCap: maxDecodedSize, + peekBits: uint8((64 - d.actualTableLog) & 63), // see: bitReaderShifted.peekBitsFast() + tbl: &d.dt.single[0], + } + + if cpuinfo.HasBMI2() { + decompress1x_main_loop_bmi2(&ctx) + } else { + decompress1x_main_loop_amd64(&ctx) + } + if ctx.decoded == error_max_decoded_size_exeeded { + return nil, ErrMaxDecodedSizeExceeded + } + + dst = dst[:ctx.decoded] + } + + // br < 8, so uint8 is fine + bitsLeft := uint8(br.off)*8 + 64 - br.bitsRead + for bitsLeft > 0 { + br.fill() + if len(dst) >= maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + v := d.dt.single[br.peekBitsFast(d.actualTableLog)&tlMask] + nBits := uint8(v.entry) + br.advance(nBits) + bitsLeft -= nBits + dst = append(dst, uint8(v.entry>>8)) + } + return dst, br.close() +} diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s new file mode 100644 index 0000000000..c4c7ab2d1f --- /dev/null +++ b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s @@ -0,0 +1,830 @@ +// Code generated by command: go run gen.go -out ../decompress_amd64.s -pkg=huff0. DO NOT EDIT. + +//go:build amd64 && !appengine && !noasm && gc + +// func decompress4x_main_loop_amd64(ctx *decompress4xContext) +TEXT ·decompress4x_main_loop_amd64(SB), $0-8 + // Preload values + MOVQ ctx+0(FP), AX + MOVBQZX 8(AX), DI + MOVQ 16(AX), BX + MOVQ 48(AX), SI + MOVQ 24(AX), R8 + MOVQ 32(AX), R9 + MOVQ (AX), R10 + + // Main loop +main_loop: + XORL DX, DX + CMPQ BX, SI + SETGE DL + + // br0.fillFast32() + MOVQ 32(R10), R11 + MOVBQZX 40(R10), R12 + CMPQ R12, $0x20 + JBE skip_fill0 + MOVQ 24(R10), AX + SUBQ $0x20, R12 + SUBQ $0x04, AX + MOVQ (R10), R13 + + // b.value |= uint64(low) << (b.bitsRead & 63) + MOVL (AX)(R13*1), R13 + MOVQ R12, CX + SHLQ CL, R13 + MOVQ AX, 24(R10) + ORQ R13, R11 + + // exhausted += (br0.off < 4) + CMPQ AX, $0x04 + ADCB $+0, DL + +skip_fill0: + // val0 := br0.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v0 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br0.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R11 + ADDB CL, R12 + + // val1 := br0.peekTopBits(peekBits) + MOVQ DI, CX + MOVQ R11, R13 + SHRQ CL, R13 + + // v1 := table[val1&mask] + MOVW (R9)(R13*2), CX + + // br0.advance(uint8(v1.entry)) + MOVB CH, AH + SHLQ CL, R11 + ADDB CL, R12 + + // these two writes get coalesced + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + MOVW AX, (BX) + + // update the bitreader structure + MOVQ R11, 32(R10) + MOVB R12, 40(R10) + + // br1.fillFast32() + MOVQ 80(R10), R11 + MOVBQZX 88(R10), R12 + CMPQ R12, $0x20 + JBE skip_fill1 + MOVQ 72(R10), AX + SUBQ $0x20, R12 + SUBQ $0x04, AX + MOVQ 48(R10), R13 + + // b.value |= uint64(low) << (b.bitsRead & 63) + MOVL (AX)(R13*1), R13 + MOVQ R12, CX + SHLQ CL, R13 + MOVQ AX, 72(R10) + ORQ R13, R11 + + // exhausted += (br1.off < 4) + CMPQ AX, $0x04 + ADCB $+0, DL + +skip_fill1: + // val0 := br1.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v0 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br1.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R11 + ADDB CL, R12 + + // val1 := br1.peekTopBits(peekBits) + MOVQ DI, CX + MOVQ R11, R13 + SHRQ CL, R13 + + // v1 := table[val1&mask] + MOVW (R9)(R13*2), CX + + // br1.advance(uint8(v1.entry)) + MOVB CH, AH + SHLQ CL, R11 + ADDB CL, R12 + + // these two writes get coalesced + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + MOVW AX, (BX)(R8*1) + + // update the bitreader structure + MOVQ R11, 80(R10) + MOVB R12, 88(R10) + + // br2.fillFast32() + MOVQ 128(R10), R11 + MOVBQZX 136(R10), R12 + CMPQ R12, $0x20 + JBE skip_fill2 + MOVQ 120(R10), AX + SUBQ $0x20, R12 + SUBQ $0x04, AX + MOVQ 96(R10), R13 + + // b.value |= uint64(low) << (b.bitsRead & 63) + MOVL (AX)(R13*1), R13 + MOVQ R12, CX + SHLQ CL, R13 + MOVQ AX, 120(R10) + ORQ R13, R11 + + // exhausted += (br2.off < 4) + CMPQ AX, $0x04 + ADCB $+0, DL + +skip_fill2: + // val0 := br2.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v0 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br2.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R11 + ADDB CL, R12 + + // val1 := br2.peekTopBits(peekBits) + MOVQ DI, CX + MOVQ R11, R13 + SHRQ CL, R13 + + // v1 := table[val1&mask] + MOVW (R9)(R13*2), CX + + // br2.advance(uint8(v1.entry)) + MOVB CH, AH + SHLQ CL, R11 + ADDB CL, R12 + + // these two writes get coalesced + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + MOVW AX, (BX)(R8*2) + + // update the bitreader structure + MOVQ R11, 128(R10) + MOVB R12, 136(R10) + + // br3.fillFast32() + MOVQ 176(R10), R11 + MOVBQZX 184(R10), R12 + CMPQ R12, $0x20 + JBE skip_fill3 + MOVQ 168(R10), AX + SUBQ $0x20, R12 + SUBQ $0x04, AX + MOVQ 144(R10), R13 + + // b.value |= uint64(low) << (b.bitsRead & 63) + MOVL (AX)(R13*1), R13 + MOVQ R12, CX + SHLQ CL, R13 + MOVQ AX, 168(R10) + ORQ R13, R11 + + // exhausted += (br3.off < 4) + CMPQ AX, $0x04 + ADCB $+0, DL + +skip_fill3: + // val0 := br3.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v0 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br3.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R11 + ADDB CL, R12 + + // val1 := br3.peekTopBits(peekBits) + MOVQ DI, CX + MOVQ R11, R13 + SHRQ CL, R13 + + // v1 := table[val1&mask] + MOVW (R9)(R13*2), CX + + // br3.advance(uint8(v1.entry)) + MOVB CH, AH + SHLQ CL, R11 + ADDB CL, R12 + + // these two writes get coalesced + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + LEAQ (R8)(R8*2), CX + MOVW AX, (BX)(CX*1) + + // update the bitreader structure + MOVQ R11, 176(R10) + MOVB R12, 184(R10) + ADDQ $0x02, BX + TESTB DL, DL + JZ main_loop + MOVQ ctx+0(FP), AX + SUBQ 16(AX), BX + SHLQ $0x02, BX + MOVQ BX, 40(AX) + RET + +// func decompress4x_8b_main_loop_amd64(ctx *decompress4xContext) +TEXT ·decompress4x_8b_main_loop_amd64(SB), $0-8 + // Preload values + MOVQ ctx+0(FP), CX + MOVBQZX 8(CX), DI + MOVQ 16(CX), BX + MOVQ 48(CX), SI + MOVQ 24(CX), R8 + MOVQ 32(CX), R9 + MOVQ (CX), R10 + + // Main loop +main_loop: + XORL DX, DX + CMPQ BX, SI + SETGE DL + + // br0.fillFast32() + MOVQ 32(R10), R11 + MOVBQZX 40(R10), R12 + CMPQ R12, $0x20 + JBE skip_fill0 + MOVQ 24(R10), R13 + SUBQ $0x20, R12 + SUBQ $0x04, R13 + MOVQ (R10), R14 + + // b.value |= uint64(low) << (b.bitsRead & 63) + MOVL (R13)(R14*1), R14 + MOVQ R12, CX + SHLQ CL, R14 + MOVQ R13, 24(R10) + ORQ R14, R11 + + // exhausted += (br0.off < 4) + CMPQ R13, $0x04 + ADCB $+0, DL + +skip_fill0: + // val0 := br0.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v0 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br0.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R11 + ADDB CL, R12 + + // val1 := br0.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v1 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br0.advance(uint8(v1.entry) + MOVB CH, AH + SHLQ CL, R11 + ADDB CL, R12 + BSWAPL AX + + // val2 := br0.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v2 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br0.advance(uint8(v2.entry) + MOVB CH, AH + SHLQ CL, R11 + ADDB CL, R12 + + // val3 := br0.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v3 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br0.advance(uint8(v3.entry) + MOVB CH, AL + SHLQ CL, R11 + ADDB CL, R12 + BSWAPL AX + + // these four writes get coalesced + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + // out[id * dstEvery + 3] = uint8(v2.entry >> 8) + // out[id * dstEvery + 4] = uint8(v3.entry >> 8) + MOVL AX, (BX) + + // update the bitreader structure + MOVQ R11, 32(R10) + MOVB R12, 40(R10) + + // br1.fillFast32() + MOVQ 80(R10), R11 + MOVBQZX 88(R10), R12 + CMPQ R12, $0x20 + JBE skip_fill1 + MOVQ 72(R10), R13 + SUBQ $0x20, R12 + SUBQ $0x04, R13 + MOVQ 48(R10), R14 + + // b.value |= uint64(low) << (b.bitsRead & 63) + MOVL (R13)(R14*1), R14 + MOVQ R12, CX + SHLQ CL, R14 + MOVQ R13, 72(R10) + ORQ R14, R11 + + // exhausted += (br1.off < 4) + CMPQ R13, $0x04 + ADCB $+0, DL + +skip_fill1: + // val0 := br1.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v0 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br1.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R11 + ADDB CL, R12 + + // val1 := br1.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v1 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br1.advance(uint8(v1.entry) + MOVB CH, AH + SHLQ CL, R11 + ADDB CL, R12 + BSWAPL AX + + // val2 := br1.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v2 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br1.advance(uint8(v2.entry) + MOVB CH, AH + SHLQ CL, R11 + ADDB CL, R12 + + // val3 := br1.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v3 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br1.advance(uint8(v3.entry) + MOVB CH, AL + SHLQ CL, R11 + ADDB CL, R12 + BSWAPL AX + + // these four writes get coalesced + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + // out[id * dstEvery + 3] = uint8(v2.entry >> 8) + // out[id * dstEvery + 4] = uint8(v3.entry >> 8) + MOVL AX, (BX)(R8*1) + + // update the bitreader structure + MOVQ R11, 80(R10) + MOVB R12, 88(R10) + + // br2.fillFast32() + MOVQ 128(R10), R11 + MOVBQZX 136(R10), R12 + CMPQ R12, $0x20 + JBE skip_fill2 + MOVQ 120(R10), R13 + SUBQ $0x20, R12 + SUBQ $0x04, R13 + MOVQ 96(R10), R14 + + // b.value |= uint64(low) << (b.bitsRead & 63) + MOVL (R13)(R14*1), R14 + MOVQ R12, CX + SHLQ CL, R14 + MOVQ R13, 120(R10) + ORQ R14, R11 + + // exhausted += (br2.off < 4) + CMPQ R13, $0x04 + ADCB $+0, DL + +skip_fill2: + // val0 := br2.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v0 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br2.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R11 + ADDB CL, R12 + + // val1 := br2.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v1 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br2.advance(uint8(v1.entry) + MOVB CH, AH + SHLQ CL, R11 + ADDB CL, R12 + BSWAPL AX + + // val2 := br2.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v2 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br2.advance(uint8(v2.entry) + MOVB CH, AH + SHLQ CL, R11 + ADDB CL, R12 + + // val3 := br2.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v3 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br2.advance(uint8(v3.entry) + MOVB CH, AL + SHLQ CL, R11 + ADDB CL, R12 + BSWAPL AX + + // these four writes get coalesced + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + // out[id * dstEvery + 3] = uint8(v2.entry >> 8) + // out[id * dstEvery + 4] = uint8(v3.entry >> 8) + MOVL AX, (BX)(R8*2) + + // update the bitreader structure + MOVQ R11, 128(R10) + MOVB R12, 136(R10) + + // br3.fillFast32() + MOVQ 176(R10), R11 + MOVBQZX 184(R10), R12 + CMPQ R12, $0x20 + JBE skip_fill3 + MOVQ 168(R10), R13 + SUBQ $0x20, R12 + SUBQ $0x04, R13 + MOVQ 144(R10), R14 + + // b.value |= uint64(low) << (b.bitsRead & 63) + MOVL (R13)(R14*1), R14 + MOVQ R12, CX + SHLQ CL, R14 + MOVQ R13, 168(R10) + ORQ R14, R11 + + // exhausted += (br3.off < 4) + CMPQ R13, $0x04 + ADCB $+0, DL + +skip_fill3: + // val0 := br3.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v0 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br3.advance(uint8(v0.entry) + MOVB CH, AL + SHLQ CL, R11 + ADDB CL, R12 + + // val1 := br3.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v1 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br3.advance(uint8(v1.entry) + MOVB CH, AH + SHLQ CL, R11 + ADDB CL, R12 + BSWAPL AX + + // val2 := br3.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v2 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br3.advance(uint8(v2.entry) + MOVB CH, AH + SHLQ CL, R11 + ADDB CL, R12 + + // val3 := br3.peekTopBits(peekBits) + MOVQ R11, R13 + MOVQ DI, CX + SHRQ CL, R13 + + // v3 := table[val0&mask] + MOVW (R9)(R13*2), CX + + // br3.advance(uint8(v3.entry) + MOVB CH, AL + SHLQ CL, R11 + ADDB CL, R12 + BSWAPL AX + + // these four writes get coalesced + // out[id * dstEvery + 0] = uint8(v0.entry >> 8) + // out[id * dstEvery + 1] = uint8(v1.entry >> 8) + // out[id * dstEvery + 3] = uint8(v2.entry >> 8) + // out[id * dstEvery + 4] = uint8(v3.entry >> 8) + LEAQ (R8)(R8*2), CX + MOVL AX, (BX)(CX*1) + + // update the bitreader structure + MOVQ R11, 176(R10) + MOVB R12, 184(R10) + ADDQ $0x04, BX + TESTB DL, DL + JZ main_loop + MOVQ ctx+0(FP), AX + SUBQ 16(AX), BX + SHLQ $0x02, BX + MOVQ BX, 40(AX) + RET + +// func decompress1x_main_loop_amd64(ctx *decompress1xContext) +TEXT ·decompress1x_main_loop_amd64(SB), $0-8 + MOVQ ctx+0(FP), CX + MOVQ 16(CX), DX + MOVQ 24(CX), BX + CMPQ BX, $0x04 + JB error_max_decoded_size_exceeded + LEAQ (DX)(BX*1), BX + MOVQ (CX), SI + MOVQ (SI), R8 + MOVQ 24(SI), R9 + MOVQ 32(SI), R10 + MOVBQZX 40(SI), R11 + MOVQ 32(CX), SI + MOVBQZX 8(CX), DI + JMP loop_condition + +main_loop: + // Check if we have room for 4 bytes in the output buffer + LEAQ 4(DX), CX + CMPQ CX, BX + JGE error_max_decoded_size_exceeded + + // Decode 4 values + CMPQ R11, $0x20 + JL bitReader_fillFast_1_end + SUBQ $0x20, R11 + SUBQ $0x04, R9 + MOVL (R8)(R9*1), R12 + MOVQ R11, CX + SHLQ CL, R12 + ORQ R12, R10 + +bitReader_fillFast_1_end: + MOVQ DI, CX + MOVQ R10, R12 + SHRQ CL, R12 + MOVW (SI)(R12*2), CX + MOVB CH, AL + MOVBQZX CL, CX + ADDQ CX, R11 + SHLQ CL, R10 + MOVQ DI, CX + MOVQ R10, R12 + SHRQ CL, R12 + MOVW (SI)(R12*2), CX + MOVB CH, AH + MOVBQZX CL, CX + ADDQ CX, R11 + SHLQ CL, R10 + BSWAPL AX + CMPQ R11, $0x20 + JL bitReader_fillFast_2_end + SUBQ $0x20, R11 + SUBQ $0x04, R9 + MOVL (R8)(R9*1), R12 + MOVQ R11, CX + SHLQ CL, R12 + ORQ R12, R10 + +bitReader_fillFast_2_end: + MOVQ DI, CX + MOVQ R10, R12 + SHRQ CL, R12 + MOVW (SI)(R12*2), CX + MOVB CH, AH + MOVBQZX CL, CX + ADDQ CX, R11 + SHLQ CL, R10 + MOVQ DI, CX + MOVQ R10, R12 + SHRQ CL, R12 + MOVW (SI)(R12*2), CX + MOVB CH, AL + MOVBQZX CL, CX + ADDQ CX, R11 + SHLQ CL, R10 + BSWAPL AX + + // Store the decoded values + MOVL AX, (DX) + ADDQ $0x04, DX + +loop_condition: + CMPQ R9, $0x08 + JGE main_loop + + // Update ctx structure + MOVQ ctx+0(FP), AX + SUBQ 16(AX), DX + MOVQ DX, 40(AX) + MOVQ (AX), AX + MOVQ R9, 24(AX) + MOVQ R10, 32(AX) + MOVB R11, 40(AX) + RET + + // Report error +error_max_decoded_size_exceeded: + MOVQ ctx+0(FP), AX + MOVQ $-1, CX + MOVQ CX, 40(AX) + RET + +// func decompress1x_main_loop_bmi2(ctx *decompress1xContext) +// Requires: BMI2 +TEXT ·decompress1x_main_loop_bmi2(SB), $0-8 + MOVQ ctx+0(FP), CX + MOVQ 16(CX), DX + MOVQ 24(CX), BX + CMPQ BX, $0x04 + JB error_max_decoded_size_exceeded + LEAQ (DX)(BX*1), BX + MOVQ (CX), SI + MOVQ (SI), R8 + MOVQ 24(SI), R9 + MOVQ 32(SI), R10 + MOVBQZX 40(SI), R11 + MOVQ 32(CX), SI + MOVBQZX 8(CX), DI + JMP loop_condition + +main_loop: + // Check if we have room for 4 bytes in the output buffer + LEAQ 4(DX), CX + CMPQ CX, BX + JGE error_max_decoded_size_exceeded + + // Decode 4 values + CMPQ R11, $0x20 + JL bitReader_fillFast_1_end + SUBQ $0x20, R11 + SUBQ $0x04, R9 + MOVL (R8)(R9*1), CX + SHLXQ R11, CX, CX + ORQ CX, R10 + +bitReader_fillFast_1_end: + SHRXQ DI, R10, CX + MOVW (SI)(CX*2), CX + MOVB CH, AL + MOVBQZX CL, CX + ADDQ CX, R11 + SHLXQ CX, R10, R10 + SHRXQ DI, R10, CX + MOVW (SI)(CX*2), CX + MOVB CH, AH + MOVBQZX CL, CX + ADDQ CX, R11 + SHLXQ CX, R10, R10 + BSWAPL AX + CMPQ R11, $0x20 + JL bitReader_fillFast_2_end + SUBQ $0x20, R11 + SUBQ $0x04, R9 + MOVL (R8)(R9*1), CX + SHLXQ R11, CX, CX + ORQ CX, R10 + +bitReader_fillFast_2_end: + SHRXQ DI, R10, CX + MOVW (SI)(CX*2), CX + MOVB CH, AH + MOVBQZX CL, CX + ADDQ CX, R11 + SHLXQ CX, R10, R10 + SHRXQ DI, R10, CX + MOVW (SI)(CX*2), CX + MOVB CH, AL + MOVBQZX CL, CX + ADDQ CX, R11 + SHLXQ CX, R10, R10 + BSWAPL AX + + // Store the decoded values + MOVL AX, (DX) + ADDQ $0x04, DX + +loop_condition: + CMPQ R9, $0x08 + JGE main_loop + + // Update ctx structure + MOVQ ctx+0(FP), AX + SUBQ 16(AX), DX + MOVQ DX, 40(AX) + MOVQ (AX), AX + MOVQ R9, 24(AX) + MOVQ R10, 32(AX) + MOVB R11, 40(AX) + RET + + // Report error +error_max_decoded_size_exceeded: + MOVQ ctx+0(FP), AX + MOVQ $-1, CX + MOVQ CX, 40(AX) + RET diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_generic.go b/vendor/github.com/klauspost/compress/huff0/decompress_generic.go new file mode 100644 index 0000000000..908c17de63 --- /dev/null +++ b/vendor/github.com/klauspost/compress/huff0/decompress_generic.go @@ -0,0 +1,299 @@ +//go:build !amd64 || appengine || !gc || noasm +// +build !amd64 appengine !gc noasm + +// This file contains a generic implementation of Decoder.Decompress4X. +package huff0 + +import ( + "errors" + "fmt" +) + +// Decompress4X will decompress a 4X encoded stream. +// The length of the supplied input must match the end of a block exactly. +// The *capacity* of the dst slice must match the destination size of +// the uncompressed data exactly. +func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) { + if len(d.dt.single) == 0 { + return nil, errors.New("no table loaded") + } + if len(src) < 6+(4*1) { + return nil, errors.New("input too small") + } + if use8BitTables && d.actualTableLog <= 8 { + return d.decompress4X8bit(dst, src) + } + + var br [4]bitReaderShifted + // Decode "jump table" + start := 6 + for i := 0; i < 3; i++ { + length := int(src[i*2]) | (int(src[i*2+1]) << 8) + if start+length >= len(src) { + return nil, errors.New("truncated input (or invalid offset)") + } + err := br[i].init(src[start : start+length]) + if err != nil { + return nil, err + } + start += length + } + err := br[3].init(src[start:]) + if err != nil { + return nil, err + } + + // destination, offset to match first output + dstSize := cap(dst) + dst = dst[:dstSize] + out := dst + dstEvery := (dstSize + 3) / 4 + + const tlSize = 1 << tableLogMax + const tlMask = tlSize - 1 + single := d.dt.single[:tlSize] + + // Use temp table to avoid bound checks/append penalty. + buf := d.buffer() + var off uint8 + var decoded int + + // Decode 2 values from each decoder/loop. + const bufoff = 256 + for { + if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 { + break + } + + { + const stream = 0 + const stream2 = 1 + br[stream].fillFast() + br[stream2].fillFast() + + val := br[stream].peekBitsFast(d.actualTableLog) + val2 := br[stream2].peekBitsFast(d.actualTableLog) + v := single[val&tlMask] + v2 := single[val2&tlMask] + br[stream].advance(uint8(v.entry)) + br[stream2].advance(uint8(v2.entry)) + buf[stream][off] = uint8(v.entry >> 8) + buf[stream2][off] = uint8(v2.entry >> 8) + + val = br[stream].peekBitsFast(d.actualTableLog) + val2 = br[stream2].peekBitsFast(d.actualTableLog) + v = single[val&tlMask] + v2 = single[val2&tlMask] + br[stream].advance(uint8(v.entry)) + br[stream2].advance(uint8(v2.entry)) + buf[stream][off+1] = uint8(v.entry >> 8) + buf[stream2][off+1] = uint8(v2.entry >> 8) + } + + { + const stream = 2 + const stream2 = 3 + br[stream].fillFast() + br[stream2].fillFast() + + val := br[stream].peekBitsFast(d.actualTableLog) + val2 := br[stream2].peekBitsFast(d.actualTableLog) + v := single[val&tlMask] + v2 := single[val2&tlMask] + br[stream].advance(uint8(v.entry)) + br[stream2].advance(uint8(v2.entry)) + buf[stream][off] = uint8(v.entry >> 8) + buf[stream2][off] = uint8(v2.entry >> 8) + + val = br[stream].peekBitsFast(d.actualTableLog) + val2 = br[stream2].peekBitsFast(d.actualTableLog) + v = single[val&tlMask] + v2 = single[val2&tlMask] + br[stream].advance(uint8(v.entry)) + br[stream2].advance(uint8(v2.entry)) + buf[stream][off+1] = uint8(v.entry >> 8) + buf[stream2][off+1] = uint8(v2.entry >> 8) + } + + off += 2 + + if off == 0 { + if bufoff > dstEvery { + d.bufs.Put(buf) + return nil, errors.New("corruption detected: stream overrun 1") + } + // There must at least be 3 buffers left. + if len(out)-bufoff < dstEvery*3 { + d.bufs.Put(buf) + return nil, errors.New("corruption detected: stream overrun 2") + } + //copy(out, buf[0][:]) + //copy(out[dstEvery:], buf[1][:]) + //copy(out[dstEvery*2:], buf[2][:]) + //copy(out[dstEvery*3:], buf[3][:]) + *(*[bufoff]byte)(out) = buf[0] + *(*[bufoff]byte)(out[dstEvery:]) = buf[1] + *(*[bufoff]byte)(out[dstEvery*2:]) = buf[2] + *(*[bufoff]byte)(out[dstEvery*3:]) = buf[3] + out = out[bufoff:] + decoded += bufoff * 4 + } + } + if off > 0 { + ioff := int(off) + if len(out) < dstEvery*3+ioff { + d.bufs.Put(buf) + return nil, errors.New("corruption detected: stream overrun 3") + } + copy(out, buf[0][:off]) + copy(out[dstEvery:], buf[1][:off]) + copy(out[dstEvery*2:], buf[2][:off]) + copy(out[dstEvery*3:], buf[3][:off]) + decoded += int(off) * 4 + out = out[off:] + } + + // Decode remaining. + remainBytes := dstEvery - (decoded / 4) + for i := range br { + offset := dstEvery * i + endsAt := offset + remainBytes + if endsAt > len(out) { + endsAt = len(out) + } + br := &br[i] + bitsLeft := br.remaining() + for bitsLeft > 0 { + br.fill() + if offset >= endsAt { + d.bufs.Put(buf) + return nil, errors.New("corruption detected: stream overrun 4") + } + + // Read value and increment offset. + val := br.peekBitsFast(d.actualTableLog) + v := single[val&tlMask].entry + nBits := uint8(v) + br.advance(nBits) + bitsLeft -= uint(nBits) + out[offset] = uint8(v >> 8) + offset++ + } + if offset != endsAt { + d.bufs.Put(buf) + return nil, fmt.Errorf("corruption detected: short output block %d, end %d != %d", i, offset, endsAt) + } + decoded += offset - dstEvery*i + err = br.close() + if err != nil { + return nil, err + } + } + d.bufs.Put(buf) + if dstSize != decoded { + return nil, errors.New("corruption detected: short output block") + } + return dst, nil +} + +// Decompress1X will decompress a 1X encoded stream. +// The cap of the output buffer will be the maximum decompressed size. +// The length of the supplied input must match the end of a block exactly. +func (d *Decoder) Decompress1X(dst, src []byte) ([]byte, error) { + if len(d.dt.single) == 0 { + return nil, errors.New("no table loaded") + } + if use8BitTables && d.actualTableLog <= 8 { + return d.decompress1X8Bit(dst, src) + } + var br bitReaderShifted + err := br.init(src) + if err != nil { + return dst, err + } + maxDecodedSize := cap(dst) + dst = dst[:0] + + // Avoid bounds check by always having full sized table. + const tlSize = 1 << tableLogMax + const tlMask = tlSize - 1 + dt := d.dt.single[:tlSize] + + // Use temp table to avoid bound checks/append penalty. + bufs := d.buffer() + buf := &bufs[0] + var off uint8 + + for br.off >= 8 { + br.fillFast() + v := dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + // Refill + br.fillFast() + + v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + br.close() + d.bufs.Put(bufs) + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + + if len(dst)+int(off) > maxDecodedSize { + d.bufs.Put(bufs) + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:off]...) + + // br < 8, so uint8 is fine + bitsLeft := uint8(br.off)*8 + 64 - br.bitsRead + for bitsLeft > 0 { + br.fill() + if false && br.bitsRead >= 32 { + if br.off >= 4 { + v := br.in[br.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + br.value = (br.value << 32) | uint64(low) + br.bitsRead -= 32 + br.off -= 4 + } else { + for br.off > 0 { + br.value = (br.value << 8) | uint64(br.in[br.off-1]) + br.bitsRead -= 8 + br.off-- + } + } + } + if len(dst) >= maxDecodedSize { + d.bufs.Put(bufs) + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + v := d.dt.single[br.peekBitsFast(d.actualTableLog)&tlMask] + nBits := uint8(v.entry) + br.advance(nBits) + bitsLeft -= nBits + dst = append(dst, uint8(v.entry>>8)) + } + d.bufs.Put(bufs) + return dst, br.close() +} diff --git a/vendor/github.com/klauspost/compress/huff0/huff0.go b/vendor/github.com/klauspost/compress/huff0/huff0.go new file mode 100644 index 0000000000..77ecd68e0a --- /dev/null +++ b/vendor/github.com/klauspost/compress/huff0/huff0.go @@ -0,0 +1,337 @@ +// Package huff0 provides fast huffman encoding as used in zstd. +// +// See README.md at https://github.com/klauspost/compress/tree/master/huff0 for details. +package huff0 + +import ( + "errors" + "fmt" + "math" + "math/bits" + "sync" + + "github.com/klauspost/compress/fse" +) + +const ( + maxSymbolValue = 255 + + // zstandard limits tablelog to 11, see: + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#huffman-tree-description + tableLogMax = 11 + tableLogDefault = 11 + minTablelog = 5 + huffNodesLen = 512 + + // BlockSizeMax is maximum input size for a single block uncompressed. + BlockSizeMax = 1<<18 - 1 +) + +var ( + // ErrIncompressible is returned when input is judged to be too hard to compress. + ErrIncompressible = errors.New("input is not compressible") + + // ErrUseRLE is returned from the compressor when the input is a single byte value repeated. + ErrUseRLE = errors.New("input is single value repeated") + + // ErrTooBig is return if input is too large for a single block. + ErrTooBig = errors.New("input too big") + + // ErrMaxDecodedSizeExceeded is return if input is too large for a single block. + ErrMaxDecodedSizeExceeded = errors.New("maximum output size exceeded") +) + +type ReusePolicy uint8 + +const ( + // ReusePolicyAllow will allow reuse if it produces smaller output. + ReusePolicyAllow ReusePolicy = iota + + // ReusePolicyPrefer will re-use aggressively if possible. + // This will not check if a new table will produce smaller output, + // except if the current table is impossible to use or + // compressed output is bigger than input. + ReusePolicyPrefer + + // ReusePolicyNone will disable re-use of tables. + // This is slightly faster than ReusePolicyAllow but may produce larger output. + ReusePolicyNone + + // ReusePolicyMust must allow reuse and produce smaller output. + ReusePolicyMust +) + +type Scratch struct { + count [maxSymbolValue + 1]uint32 + + // Per block parameters. + // These can be used to override compression parameters of the block. + // Do not touch, unless you know what you are doing. + + // Out is output buffer. + // If the scratch is re-used before the caller is done processing the output, + // set this field to nil. + // Otherwise the output buffer will be re-used for next Compression/Decompression step + // and allocation will be avoided. + Out []byte + + // OutTable will contain the table data only, if a new table has been generated. + // Slice of the returned data. + OutTable []byte + + // OutData will contain the compressed data. + // Slice of the returned data. + OutData []byte + + // MaxDecodedSize will set the maximum allowed output size. + // This value will automatically be set to BlockSizeMax if not set. + // Decoders will return ErrMaxDecodedSizeExceeded is this limit is exceeded. + MaxDecodedSize int + + srcLen int + + // MaxSymbolValue will override the maximum symbol value of the next block. + MaxSymbolValue uint8 + + // TableLog will attempt to override the tablelog for the next block. + // Must be <= 11 and >= 5. + TableLog uint8 + + // Reuse will specify the reuse policy + Reuse ReusePolicy + + // WantLogLess allows to specify a log 2 reduction that should at least be achieved, + // otherwise the block will be returned as incompressible. + // The reduction should then at least be (input size >> WantLogLess) + // If WantLogLess == 0 any improvement will do. + WantLogLess uint8 + + symbolLen uint16 // Length of active part of the symbol table. + maxCount int // count of the most probable symbol + clearCount bool // clear count + actualTableLog uint8 // Selected tablelog. + prevTableLog uint8 // Tablelog for previous table + prevTable cTable // Table used for previous compression. + cTable cTable // compression table + dt dTable // decompression table + nodes []nodeElt + tmpOut [4][]byte + fse *fse.Scratch + decPool sync.Pool // *[4][256]byte buffers. + huffWeight [maxSymbolValue + 1]byte +} + +// TransferCTable will transfer the previously used compression table. +func (s *Scratch) TransferCTable(src *Scratch) { + if cap(s.prevTable) < len(src.prevTable) { + s.prevTable = make(cTable, 0, maxSymbolValue+1) + } + s.prevTable = s.prevTable[:len(src.prevTable)] + copy(s.prevTable, src.prevTable) + s.prevTableLog = src.prevTableLog +} + +func (s *Scratch) prepare(in []byte) (*Scratch, error) { + if len(in) > BlockSizeMax { + return nil, ErrTooBig + } + if s == nil { + s = &Scratch{} + } + if s.MaxSymbolValue == 0 { + s.MaxSymbolValue = maxSymbolValue + } + if s.TableLog == 0 { + s.TableLog = tableLogDefault + } + if s.TableLog > tableLogMax || s.TableLog < minTablelog { + return nil, fmt.Errorf(" invalid tableLog %d (%d -> %d)", s.TableLog, minTablelog, tableLogMax) + } + if s.MaxDecodedSize <= 0 || s.MaxDecodedSize > BlockSizeMax { + s.MaxDecodedSize = BlockSizeMax + } + if s.clearCount && s.maxCount == 0 { + for i := range s.count { + s.count[i] = 0 + } + s.clearCount = false + } + if cap(s.Out) == 0 { + s.Out = make([]byte, 0, len(in)) + } + s.Out = s.Out[:0] + + s.OutTable = nil + s.OutData = nil + if cap(s.nodes) < huffNodesLen+1 { + s.nodes = make([]nodeElt, 0, huffNodesLen+1) + } + s.nodes = s.nodes[:0] + if s.fse == nil { + s.fse = &fse.Scratch{} + } + s.srcLen = len(in) + + return s, nil +} + +type cTable []cTableEntry + +func (c cTable) write(s *Scratch) error { + var ( + // precomputed conversion table + bitsToWeight [tableLogMax + 1]byte + huffLog = s.actualTableLog + // last weight is not saved. + maxSymbolValue = uint8(s.symbolLen - 1) + huffWeight = s.huffWeight[:256] + ) + const ( + maxFSETableLog = 6 + ) + // convert to weight + bitsToWeight[0] = 0 + for n := uint8(1); n < huffLog+1; n++ { + bitsToWeight[n] = huffLog + 1 - n + } + + // Acquire histogram for FSE. + hist := s.fse.Histogram() + hist = hist[:256] + for i := range hist[:16] { + hist[i] = 0 + } + for n := uint8(0); n < maxSymbolValue; n++ { + v := bitsToWeight[c[n].nBits] & 15 + huffWeight[n] = v + hist[v]++ + } + + // FSE compress if feasible. + if maxSymbolValue >= 2 { + huffMaxCnt := uint32(0) + huffMax := uint8(0) + for i, v := range hist[:16] { + if v == 0 { + continue + } + huffMax = byte(i) + if v > huffMaxCnt { + huffMaxCnt = v + } + } + s.fse.HistogramFinished(huffMax, int(huffMaxCnt)) + s.fse.TableLog = maxFSETableLog + b, err := fse.Compress(huffWeight[:maxSymbolValue], s.fse) + if err == nil && len(b) < int(s.symbolLen>>1) { + s.Out = append(s.Out, uint8(len(b))) + s.Out = append(s.Out, b...) + return nil + } + // Unable to compress (RLE/uncompressible) + } + // write raw values as 4-bits (max : 15) + if maxSymbolValue > (256 - 128) { + // should not happen : likely means source cannot be compressed + return ErrIncompressible + } + op := s.Out + // special case, pack weights 4 bits/weight. + op = append(op, 128|(maxSymbolValue-1)) + // be sure it doesn't cause msan issue in final combination + huffWeight[maxSymbolValue] = 0 + for n := uint16(0); n < uint16(maxSymbolValue); n += 2 { + op = append(op, (huffWeight[n]<<4)|huffWeight[n+1]) + } + s.Out = op + return nil +} + +func (c cTable) estTableSize(s *Scratch) (sz int, err error) { + var ( + // precomputed conversion table + bitsToWeight [tableLogMax + 1]byte + huffLog = s.actualTableLog + // last weight is not saved. + maxSymbolValue = uint8(s.symbolLen - 1) + huffWeight = s.huffWeight[:256] + ) + const ( + maxFSETableLog = 6 + ) + // convert to weight + bitsToWeight[0] = 0 + for n := uint8(1); n < huffLog+1; n++ { + bitsToWeight[n] = huffLog + 1 - n + } + + // Acquire histogram for FSE. + hist := s.fse.Histogram() + hist = hist[:256] + for i := range hist[:16] { + hist[i] = 0 + } + for n := uint8(0); n < maxSymbolValue; n++ { + v := bitsToWeight[c[n].nBits] & 15 + huffWeight[n] = v + hist[v]++ + } + + // FSE compress if feasible. + if maxSymbolValue >= 2 { + huffMaxCnt := uint32(0) + huffMax := uint8(0) + for i, v := range hist[:16] { + if v == 0 { + continue + } + huffMax = byte(i) + if v > huffMaxCnt { + huffMaxCnt = v + } + } + s.fse.HistogramFinished(huffMax, int(huffMaxCnt)) + s.fse.TableLog = maxFSETableLog + b, err := fse.Compress(huffWeight[:maxSymbolValue], s.fse) + if err == nil && len(b) < int(s.symbolLen>>1) { + sz += 1 + len(b) + return sz, nil + } + // Unable to compress (RLE/uncompressible) + } + // write raw values as 4-bits (max : 15) + if maxSymbolValue > (256 - 128) { + // should not happen : likely means source cannot be compressed + return 0, ErrIncompressible + } + // special case, pack weights 4 bits/weight. + sz += 1 + int(maxSymbolValue/2) + return sz, nil +} + +// estimateSize returns the estimated size in bytes of the input represented in the +// histogram supplied. +func (c cTable) estimateSize(hist []uint32) int { + nbBits := uint32(7) + for i, v := range c[:len(hist)] { + nbBits += uint32(v.nBits) * hist[i] + } + return int(nbBits >> 3) +} + +// minSize returns the minimum possible size considering the shannon limit. +func (s *Scratch) minSize(total int) int { + nbBits := float64(7) + fTotal := float64(total) + for _, v := range s.count[:s.symbolLen] { + n := float64(v) + if n > 0 { + nbBits += math.Log2(fTotal/n) * n + } + } + return int(nbBits) >> 3 +} + +func highBit32(val uint32) (n uint32) { + return uint32(bits.Len32(val) - 1) +} diff --git a/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go new file mode 100644 index 0000000000..3954c51219 --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go @@ -0,0 +1,34 @@ +// Package cpuinfo gives runtime info about the current CPU. +// +// This is a very limited module meant for use internally +// in this project. For more versatile solution check +// https://github.com/klauspost/cpuid. +package cpuinfo + +// HasBMI1 checks whether an x86 CPU supports the BMI1 extension. +func HasBMI1() bool { + return hasBMI1 +} + +// HasBMI2 checks whether an x86 CPU supports the BMI2 extension. +func HasBMI2() bool { + return hasBMI2 +} + +// DisableBMI2 will disable BMI2, for testing purposes. +// Call returned function to restore previous state. +func DisableBMI2() func() { + old := hasBMI2 + hasBMI2 = false + return func() { + hasBMI2 = old + } +} + +// HasBMI checks whether an x86 CPU supports both BMI1 and BMI2 extensions. +func HasBMI() bool { + return HasBMI1() && HasBMI2() +} + +var hasBMI1 bool +var hasBMI2 bool diff --git a/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go new file mode 100644 index 0000000000..e802579c4f --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go @@ -0,0 +1,11 @@ +//go:build amd64 && !appengine && !noasm && gc +// +build amd64,!appengine,!noasm,gc + +package cpuinfo + +// go:noescape +func x86extensions() (bmi1, bmi2 bool) + +func init() { + hasBMI1, hasBMI2 = x86extensions() +} diff --git a/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s new file mode 100644 index 0000000000..4465fbe9e9 --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s @@ -0,0 +1,36 @@ +// +build !appengine +// +build gc +// +build !noasm + +#include "textflag.h" +#include "funcdata.h" +#include "go_asm.h" + +TEXT ·x86extensions(SB), NOSPLIT, $0 + // 1. determine max EAX value + XORQ AX, AX + CPUID + + CMPQ AX, $7 + JB unsupported + + // 2. EAX = 7, ECX = 0 --- see Table 3-8 "Information Returned by CPUID Instruction" + MOVQ $7, AX + MOVQ $0, CX + CPUID + + BTQ $3, BX // bit 3 = BMI1 + SETCS AL + + BTQ $8, BX // bit 8 = BMI2 + SETCS AH + + MOVB AL, bmi1+0(FP) + MOVB AH, bmi2+1(FP) + RET + +unsupported: + XORQ AX, AX + MOVB AL, bmi1+0(FP) + MOVB AL, bmi2+1(FP) + RET diff --git a/vendor/github.com/klauspost/compress/internal/snapref/LICENSE b/vendor/github.com/klauspost/compress/internal/snapref/LICENSE new file mode 100644 index 0000000000..6050c10f4c --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/snapref/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2011 The Snappy-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/klauspost/compress/internal/snapref/decode.go b/vendor/github.com/klauspost/compress/internal/snapref/decode.go new file mode 100644 index 0000000000..40796a49d6 --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/snapref/decode.go @@ -0,0 +1,264 @@ +// Copyright 2011 The Snappy-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 snapref + +import ( + "encoding/binary" + "errors" + "io" +) + +var ( + // ErrCorrupt reports that the input is invalid. + ErrCorrupt = errors.New("snappy: corrupt input") + // ErrTooLarge reports that the uncompressed length is too large. + ErrTooLarge = errors.New("snappy: decoded block is too large") + // ErrUnsupported reports that the input isn't supported. + ErrUnsupported = errors.New("snappy: unsupported input") + + errUnsupportedLiteralLength = errors.New("snappy: unsupported literal length") +) + +// DecodedLen returns the length of the decoded block. +func DecodedLen(src []byte) (int, error) { + v, _, err := decodedLen(src) + return v, err +} + +// decodedLen returns the length of the decoded block and the number of bytes +// that the length header occupied. +func decodedLen(src []byte) (blockLen, headerLen int, err error) { + v, n := binary.Uvarint(src) + if n <= 0 || v > 0xffffffff { + return 0, 0, ErrCorrupt + } + + const wordSize = 32 << (^uint(0) >> 32 & 1) + if wordSize == 32 && v > 0x7fffffff { + return 0, 0, ErrTooLarge + } + return int(v), n, nil +} + +const ( + decodeErrCodeCorrupt = 1 + decodeErrCodeUnsupportedLiteralLength = 2 +) + +// Decode returns the decoded form of src. The returned slice may be a sub- +// slice of dst if dst was large enough to hold the entire decoded block. +// Otherwise, a newly allocated slice will be returned. +// +// The dst and src must not overlap. It is valid to pass a nil dst. +// +// Decode handles the Snappy block format, not the Snappy stream format. +func Decode(dst, src []byte) ([]byte, error) { + dLen, s, err := decodedLen(src) + if err != nil { + return nil, err + } + if dLen <= len(dst) { + dst = dst[:dLen] + } else { + dst = make([]byte, dLen) + } + switch decode(dst, src[s:]) { + case 0: + return dst, nil + case decodeErrCodeUnsupportedLiteralLength: + return nil, errUnsupportedLiteralLength + } + return nil, ErrCorrupt +} + +// NewReader returns a new Reader that decompresses from r, using the framing +// format described at +// https://github.com/google/snappy/blob/master/framing_format.txt +func NewReader(r io.Reader) *Reader { + return &Reader{ + r: r, + decoded: make([]byte, maxBlockSize), + buf: make([]byte, maxEncodedLenOfMaxBlockSize+checksumSize), + } +} + +// Reader is an io.Reader that can read Snappy-compressed bytes. +// +// Reader handles the Snappy stream format, not the Snappy block format. +type Reader struct { + r io.Reader + err error + decoded []byte + buf []byte + // decoded[i:j] contains decoded bytes that have not yet been passed on. + i, j int + readHeader bool +} + +// Reset discards any buffered data, resets all state, and switches the Snappy +// reader to read from r. This permits reusing a Reader rather than allocating +// a new one. +func (r *Reader) Reset(reader io.Reader) { + r.r = reader + r.err = nil + r.i = 0 + r.j = 0 + r.readHeader = false +} + +func (r *Reader) readFull(p []byte, allowEOF bool) (ok bool) { + if _, r.err = io.ReadFull(r.r, p); r.err != nil { + if r.err == io.ErrUnexpectedEOF || (r.err == io.EOF && !allowEOF) { + r.err = ErrCorrupt + } + return false + } + return true +} + +func (r *Reader) fill() error { + for r.i >= r.j { + if !r.readFull(r.buf[:4], true) { + return r.err + } + chunkType := r.buf[0] + if !r.readHeader { + if chunkType != chunkTypeStreamIdentifier { + r.err = ErrCorrupt + return r.err + } + r.readHeader = true + } + chunkLen := int(r.buf[1]) | int(r.buf[2])<<8 | int(r.buf[3])<<16 + if chunkLen > len(r.buf) { + r.err = ErrUnsupported + return r.err + } + + // The chunk types are specified at + // https://github.com/google/snappy/blob/master/framing_format.txt + switch chunkType { + case chunkTypeCompressedData: + // Section 4.2. Compressed data (chunk type 0x00). + if chunkLen < checksumSize { + r.err = ErrCorrupt + return r.err + } + buf := r.buf[:chunkLen] + if !r.readFull(buf, false) { + return r.err + } + checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + buf = buf[checksumSize:] + + n, err := DecodedLen(buf) + if err != nil { + r.err = err + return r.err + } + if n > len(r.decoded) { + r.err = ErrCorrupt + return r.err + } + if _, err := Decode(r.decoded, buf); err != nil { + r.err = err + return r.err + } + if crc(r.decoded[:n]) != checksum { + r.err = ErrCorrupt + return r.err + } + r.i, r.j = 0, n + continue + + case chunkTypeUncompressedData: + // Section 4.3. Uncompressed data (chunk type 0x01). + if chunkLen < checksumSize { + r.err = ErrCorrupt + return r.err + } + buf := r.buf[:checksumSize] + if !r.readFull(buf, false) { + return r.err + } + checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + // Read directly into r.decoded instead of via r.buf. + n := chunkLen - checksumSize + if n > len(r.decoded) { + r.err = ErrCorrupt + return r.err + } + if !r.readFull(r.decoded[:n], false) { + return r.err + } + if crc(r.decoded[:n]) != checksum { + r.err = ErrCorrupt + return r.err + } + r.i, r.j = 0, n + continue + + case chunkTypeStreamIdentifier: + // Section 4.1. Stream identifier (chunk type 0xff). + if chunkLen != len(magicBody) { + r.err = ErrCorrupt + return r.err + } + if !r.readFull(r.buf[:len(magicBody)], false) { + return r.err + } + for i := 0; i < len(magicBody); i++ { + if r.buf[i] != magicBody[i] { + r.err = ErrCorrupt + return r.err + } + } + continue + } + + if chunkType <= 0x7f { + // Section 4.5. Reserved unskippable chunks (chunk types 0x02-0x7f). + r.err = ErrUnsupported + return r.err + } + // Section 4.4 Padding (chunk type 0xfe). + // Section 4.6. Reserved skippable chunks (chunk types 0x80-0xfd). + if !r.readFull(r.buf[:chunkLen], false) { + return r.err + } + } + + return nil +} + +// Read satisfies the io.Reader interface. +func (r *Reader) Read(p []byte) (int, error) { + if r.err != nil { + return 0, r.err + } + + if err := r.fill(); err != nil { + return 0, err + } + + n := copy(p, r.decoded[r.i:r.j]) + r.i += n + return n, nil +} + +// ReadByte satisfies the io.ByteReader interface. +func (r *Reader) ReadByte() (byte, error) { + if r.err != nil { + return 0, r.err + } + + if err := r.fill(); err != nil { + return 0, err + } + + c := r.decoded[r.i] + r.i++ + return c, nil +} diff --git a/vendor/github.com/klauspost/compress/internal/snapref/decode_other.go b/vendor/github.com/klauspost/compress/internal/snapref/decode_other.go new file mode 100644 index 0000000000..77395a6b8b --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/snapref/decode_other.go @@ -0,0 +1,113 @@ +// Copyright 2016 The Snappy-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 snapref + +// decode writes the decoding of src to dst. It assumes that the varint-encoded +// length of the decompressed bytes has already been read, and that len(dst) +// equals that length. +// +// It returns 0 on success or a decodeErrCodeXxx error code on failure. +func decode(dst, src []byte) int { + var d, s, offset, length int + for s < len(src) { + switch src[s] & 0x03 { + case tagLiteral: + x := uint32(src[s] >> 2) + switch { + case x < 60: + s++ + case x == 60: + s += 2 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + return decodeErrCodeCorrupt + } + x = uint32(src[s-1]) + case x == 61: + s += 3 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + return decodeErrCodeCorrupt + } + x = uint32(src[s-2]) | uint32(src[s-1])<<8 + case x == 62: + s += 4 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + return decodeErrCodeCorrupt + } + x = uint32(src[s-3]) | uint32(src[s-2])<<8 | uint32(src[s-1])<<16 + case x == 63: + s += 5 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + return decodeErrCodeCorrupt + } + x = uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24 + } + length = int(x) + 1 + if length <= 0 { + return decodeErrCodeUnsupportedLiteralLength + } + if length > len(dst)-d || length > len(src)-s { + return decodeErrCodeCorrupt + } + copy(dst[d:], src[s:s+length]) + d += length + s += length + continue + + case tagCopy1: + s += 2 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + return decodeErrCodeCorrupt + } + length = 4 + int(src[s-2])>>2&0x7 + offset = int(uint32(src[s-2])&0xe0<<3 | uint32(src[s-1])) + + case tagCopy2: + s += 3 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + return decodeErrCodeCorrupt + } + length = 1 + int(src[s-3])>>2 + offset = int(uint32(src[s-2]) | uint32(src[s-1])<<8) + + case tagCopy4: + s += 5 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + return decodeErrCodeCorrupt + } + length = 1 + int(src[s-5])>>2 + offset = int(uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24) + } + + if offset <= 0 || d < offset || length > len(dst)-d { + return decodeErrCodeCorrupt + } + // Copy from an earlier sub-slice of dst to a later sub-slice. + // If no overlap, use the built-in copy: + if offset >= length { + copy(dst[d:d+length], dst[d-offset:]) + d += length + continue + } + + // Unlike the built-in copy function, this byte-by-byte copy always runs + // forwards, even if the slices overlap. Conceptually, this is: + // + // d += forwardCopy(dst[d:d+length], dst[d-offset:]) + // + // We align the slices into a and b and show the compiler they are the same size. + // This allows the loop to run without bounds checks. + a := dst[d : d+length] + b := dst[d-offset:] + b = b[:len(a)] + for i := range a { + a[i] = b[i] + } + d += length + } + if d != len(dst) { + return decodeErrCodeCorrupt + } + return 0 +} diff --git a/vendor/github.com/klauspost/compress/internal/snapref/encode.go b/vendor/github.com/klauspost/compress/internal/snapref/encode.go new file mode 100644 index 0000000000..13c6040a5d --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/snapref/encode.go @@ -0,0 +1,289 @@ +// Copyright 2011 The Snappy-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 snapref + +import ( + "encoding/binary" + "errors" + "io" +) + +// Encode returns the encoded form of src. The returned slice may be a sub- +// slice of dst if dst was large enough to hold the entire encoded block. +// Otherwise, a newly allocated slice will be returned. +// +// The dst and src must not overlap. It is valid to pass a nil dst. +// +// Encode handles the Snappy block format, not the Snappy stream format. +func Encode(dst, src []byte) []byte { + if n := MaxEncodedLen(len(src)); n < 0 { + panic(ErrTooLarge) + } else if len(dst) < n { + dst = make([]byte, n) + } + + // The block starts with the varint-encoded length of the decompressed bytes. + d := binary.PutUvarint(dst, uint64(len(src))) + + for len(src) > 0 { + p := src + src = nil + if len(p) > maxBlockSize { + p, src = p[:maxBlockSize], p[maxBlockSize:] + } + if len(p) < minNonLiteralBlockSize { + d += emitLiteral(dst[d:], p) + } else { + d += encodeBlock(dst[d:], p) + } + } + return dst[:d] +} + +// inputMargin is the minimum number of extra input bytes to keep, inside +// encodeBlock's inner loop. On some architectures, this margin lets us +// implement a fast path for emitLiteral, where the copy of short (<= 16 byte) +// literals can be implemented as a single load to and store from a 16-byte +// register. That literal's actual length can be as short as 1 byte, so this +// can copy up to 15 bytes too much, but that's OK as subsequent iterations of +// the encoding loop will fix up the copy overrun, and this inputMargin ensures +// that we don't overrun the dst and src buffers. +const inputMargin = 16 - 1 + +// minNonLiteralBlockSize is the minimum size of the input to encodeBlock that +// could be encoded with a copy tag. This is the minimum with respect to the +// algorithm used by encodeBlock, not a minimum enforced by the file format. +// +// The encoded output must start with at least a 1 byte literal, as there are +// no previous bytes to copy. A minimal (1 byte) copy after that, generated +// from an emitCopy call in encodeBlock's main loop, would require at least +// another inputMargin bytes, for the reason above: we want any emitLiteral +// calls inside encodeBlock's main loop to use the fast path if possible, which +// requires being able to overrun by inputMargin bytes. Thus, +// minNonLiteralBlockSize equals 1 + 1 + inputMargin. +// +// The C++ code doesn't use this exact threshold, but it could, as discussed at +// https://groups.google.com/d/topic/snappy-compression/oGbhsdIJSJ8/discussion +// The difference between Go (2+inputMargin) and C++ (inputMargin) is purely an +// optimization. It should not affect the encoded form. This is tested by +// TestSameEncodingAsCppShortCopies. +const minNonLiteralBlockSize = 1 + 1 + inputMargin + +// MaxEncodedLen returns the maximum length of a snappy block, given its +// uncompressed length. +// +// It will return a negative value if srcLen is too large to encode. +func MaxEncodedLen(srcLen int) int { + n := uint64(srcLen) + if n > 0xffffffff { + return -1 + } + // Compressed data can be defined as: + // compressed := item* literal* + // item := literal* copy + // + // The trailing literal sequence has a space blowup of at most 62/60 + // since a literal of length 60 needs one tag byte + one extra byte + // for length information. + // + // Item blowup is trickier to measure. Suppose the "copy" op copies + // 4 bytes of data. Because of a special check in the encoding code, + // we produce a 4-byte copy only if the offset is < 65536. Therefore + // the copy op takes 3 bytes to encode, and this type of item leads + // to at most the 62/60 blowup for representing literals. + // + // Suppose the "copy" op copies 5 bytes of data. If the offset is big + // enough, it will take 5 bytes to encode the copy op. Therefore the + // worst case here is a one-byte literal followed by a five-byte copy. + // That is, 6 bytes of input turn into 7 bytes of "compressed" data. + // + // This last factor dominates the blowup, so the final estimate is: + n = 32 + n + n/6 + if n > 0xffffffff { + return -1 + } + return int(n) +} + +var errClosed = errors.New("snappy: Writer is closed") + +// NewWriter returns a new Writer that compresses to w. +// +// The Writer returned does not buffer writes. There is no need to Flush or +// Close such a Writer. +// +// Deprecated: the Writer returned is not suitable for many small writes, only +// for few large writes. Use NewBufferedWriter instead, which is efficient +// regardless of the frequency and shape of the writes, and remember to Close +// that Writer when done. +func NewWriter(w io.Writer) *Writer { + return &Writer{ + w: w, + obuf: make([]byte, obufLen), + } +} + +// NewBufferedWriter returns a new Writer that compresses to w, using the +// framing format described at +// https://github.com/google/snappy/blob/master/framing_format.txt +// +// The Writer returned buffers writes. Users must call Close to guarantee all +// data has been forwarded to the underlying io.Writer. They may also call +// Flush zero or more times before calling Close. +func NewBufferedWriter(w io.Writer) *Writer { + return &Writer{ + w: w, + ibuf: make([]byte, 0, maxBlockSize), + obuf: make([]byte, obufLen), + } +} + +// Writer is an io.Writer that can write Snappy-compressed bytes. +// +// Writer handles the Snappy stream format, not the Snappy block format. +type Writer struct { + w io.Writer + err error + + // ibuf is a buffer for the incoming (uncompressed) bytes. + // + // Its use is optional. For backwards compatibility, Writers created by the + // NewWriter function have ibuf == nil, do not buffer incoming bytes, and + // therefore do not need to be Flush'ed or Close'd. + ibuf []byte + + // obuf is a buffer for the outgoing (compressed) bytes. + obuf []byte + + // wroteStreamHeader is whether we have written the stream header. + wroteStreamHeader bool +} + +// Reset discards the writer's state and switches the Snappy writer to write to +// w. This permits reusing a Writer rather than allocating a new one. +func (w *Writer) Reset(writer io.Writer) { + w.w = writer + w.err = nil + if w.ibuf != nil { + w.ibuf = w.ibuf[:0] + } + w.wroteStreamHeader = false +} + +// Write satisfies the io.Writer interface. +func (w *Writer) Write(p []byte) (nRet int, errRet error) { + if w.ibuf == nil { + // Do not buffer incoming bytes. This does not perform or compress well + // if the caller of Writer.Write writes many small slices. This + // behavior is therefore deprecated, but still supported for backwards + // compatibility with code that doesn't explicitly Flush or Close. + return w.write(p) + } + + // The remainder of this method is based on bufio.Writer.Write from the + // standard library. + + for len(p) > (cap(w.ibuf)-len(w.ibuf)) && w.err == nil { + var n int + if len(w.ibuf) == 0 { + // Large write, empty buffer. + // Write directly from p to avoid copy. + n, _ = w.write(p) + } else { + n = copy(w.ibuf[len(w.ibuf):cap(w.ibuf)], p) + w.ibuf = w.ibuf[:len(w.ibuf)+n] + w.Flush() + } + nRet += n + p = p[n:] + } + if w.err != nil { + return nRet, w.err + } + n := copy(w.ibuf[len(w.ibuf):cap(w.ibuf)], p) + w.ibuf = w.ibuf[:len(w.ibuf)+n] + nRet += n + return nRet, nil +} + +func (w *Writer) write(p []byte) (nRet int, errRet error) { + if w.err != nil { + return 0, w.err + } + for len(p) > 0 { + obufStart := len(magicChunk) + if !w.wroteStreamHeader { + w.wroteStreamHeader = true + copy(w.obuf, magicChunk) + obufStart = 0 + } + + var uncompressed []byte + if len(p) > maxBlockSize { + uncompressed, p = p[:maxBlockSize], p[maxBlockSize:] + } else { + uncompressed, p = p, nil + } + checksum := crc(uncompressed) + + // Compress the buffer, discarding the result if the improvement + // isn't at least 12.5%. + compressed := Encode(w.obuf[obufHeaderLen:], uncompressed) + chunkType := uint8(chunkTypeCompressedData) + chunkLen := 4 + len(compressed) + obufEnd := obufHeaderLen + len(compressed) + if len(compressed) >= len(uncompressed)-len(uncompressed)/8 { + chunkType = chunkTypeUncompressedData + chunkLen = 4 + len(uncompressed) + obufEnd = obufHeaderLen + } + + // Fill in the per-chunk header that comes before the body. + w.obuf[len(magicChunk)+0] = chunkType + w.obuf[len(magicChunk)+1] = uint8(chunkLen >> 0) + w.obuf[len(magicChunk)+2] = uint8(chunkLen >> 8) + w.obuf[len(magicChunk)+3] = uint8(chunkLen >> 16) + w.obuf[len(magicChunk)+4] = uint8(checksum >> 0) + w.obuf[len(magicChunk)+5] = uint8(checksum >> 8) + w.obuf[len(magicChunk)+6] = uint8(checksum >> 16) + w.obuf[len(magicChunk)+7] = uint8(checksum >> 24) + + if _, err := w.w.Write(w.obuf[obufStart:obufEnd]); err != nil { + w.err = err + return nRet, err + } + if chunkType == chunkTypeUncompressedData { + if _, err := w.w.Write(uncompressed); err != nil { + w.err = err + return nRet, err + } + } + nRet += len(uncompressed) + } + return nRet, nil +} + +// Flush flushes the Writer to its underlying io.Writer. +func (w *Writer) Flush() error { + if w.err != nil { + return w.err + } + if len(w.ibuf) == 0 { + return nil + } + w.write(w.ibuf) + w.ibuf = w.ibuf[:0] + return w.err +} + +// Close calls Flush and then closes the Writer. +func (w *Writer) Close() error { + w.Flush() + ret := w.err + if w.err == nil { + w.err = errClosed + } + return ret +} diff --git a/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go b/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go new file mode 100644 index 0000000000..2754bac6f1 --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go @@ -0,0 +1,250 @@ +// Copyright 2016 The Snappy-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 snapref + +func load32(b []byte, i int) uint32 { + b = b[i : i+4 : len(b)] // Help the compiler eliminate bounds checks on the next line. + return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 +} + +func load64(b []byte, i int) uint64 { + b = b[i : i+8 : len(b)] // Help the compiler eliminate bounds checks on the next line. + return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | + uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 +} + +// emitLiteral writes a literal chunk and returns the number of bytes written. +// +// It assumes that: +// +// dst is long enough to hold the encoded bytes +// 1 <= len(lit) && len(lit) <= 65536 +func emitLiteral(dst, lit []byte) int { + i, n := 0, uint(len(lit)-1) + switch { + case n < 60: + dst[0] = uint8(n)<<2 | tagLiteral + i = 1 + case n < 1<<8: + dst[0] = 60<<2 | tagLiteral + dst[1] = uint8(n) + i = 2 + default: + dst[0] = 61<<2 | tagLiteral + dst[1] = uint8(n) + dst[2] = uint8(n >> 8) + i = 3 + } + return i + copy(dst[i:], lit) +} + +// emitCopy writes a copy chunk and returns the number of bytes written. +// +// It assumes that: +// +// dst is long enough to hold the encoded bytes +// 1 <= offset && offset <= 65535 +// 4 <= length && length <= 65535 +func emitCopy(dst []byte, offset, length int) int { + i := 0 + // The maximum length for a single tagCopy1 or tagCopy2 op is 64 bytes. The + // threshold for this loop is a little higher (at 68 = 64 + 4), and the + // length emitted down below is a little lower (at 60 = 64 - 4), because + // it's shorter to encode a length 67 copy as a length 60 tagCopy2 followed + // by a length 7 tagCopy1 (which encodes as 3+2 bytes) than to encode it as + // a length 64 tagCopy2 followed by a length 3 tagCopy2 (which encodes as + // 3+3 bytes). The magic 4 in the 64±4 is because the minimum length for a + // tagCopy1 op is 4 bytes, which is why a length 3 copy has to be an + // encodes-as-3-bytes tagCopy2 instead of an encodes-as-2-bytes tagCopy1. + for length >= 68 { + // Emit a length 64 copy, encoded as 3 bytes. + dst[i+0] = 63<<2 | tagCopy2 + dst[i+1] = uint8(offset) + dst[i+2] = uint8(offset >> 8) + i += 3 + length -= 64 + } + if length > 64 { + // Emit a length 60 copy, encoded as 3 bytes. + dst[i+0] = 59<<2 | tagCopy2 + dst[i+1] = uint8(offset) + dst[i+2] = uint8(offset >> 8) + i += 3 + length -= 60 + } + if length >= 12 || offset >= 2048 { + // Emit the remaining copy, encoded as 3 bytes. + dst[i+0] = uint8(length-1)<<2 | tagCopy2 + dst[i+1] = uint8(offset) + dst[i+2] = uint8(offset >> 8) + return i + 3 + } + // Emit the remaining copy, encoded as 2 bytes. + dst[i+0] = uint8(offset>>8)<<5 | uint8(length-4)<<2 | tagCopy1 + dst[i+1] = uint8(offset) + return i + 2 +} + +func hash(u, shift uint32) uint32 { + return (u * 0x1e35a7bd) >> shift +} + +// EncodeBlockInto exposes encodeBlock but checks dst size. +func EncodeBlockInto(dst, src []byte) (d int) { + if MaxEncodedLen(len(src)) > len(dst) { + return 0 + } + + // encodeBlock breaks on too big blocks, so split. + for len(src) > 0 { + p := src + src = nil + if len(p) > maxBlockSize { + p, src = p[:maxBlockSize], p[maxBlockSize:] + } + if len(p) < minNonLiteralBlockSize { + d += emitLiteral(dst[d:], p) + } else { + d += encodeBlock(dst[d:], p) + } + } + return d +} + +// encodeBlock encodes a non-empty src to a guaranteed-large-enough dst. It +// assumes that the varint-encoded length of the decompressed bytes has already +// been written. +// +// It also assumes that: +// +// len(dst) >= MaxEncodedLen(len(src)) && +// minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize +func encodeBlock(dst, src []byte) (d int) { + // Initialize the hash table. Its size ranges from 1<<8 to 1<<14 inclusive. + // The table element type is uint16, as s < sLimit and sLimit < len(src) + // and len(src) <= maxBlockSize and maxBlockSize == 65536. + const ( + maxTableSize = 1 << 14 + // tableMask is redundant, but helps the compiler eliminate bounds + // checks. + tableMask = maxTableSize - 1 + ) + shift := uint32(32 - 8) + for tableSize := 1 << 8; tableSize < maxTableSize && tableSize < len(src); tableSize *= 2 { + shift-- + } + // In Go, all array elements are zero-initialized, so there is no advantage + // to a smaller tableSize per se. However, it matches the C++ algorithm, + // and in the asm versions of this code, we can get away with zeroing only + // the first tableSize elements. + var table [maxTableSize]uint16 + + // sLimit is when to stop looking for offset/length copies. The inputMargin + // lets us use a fast path for emitLiteral in the main loop, while we are + // looking for copies. + sLimit := len(src) - inputMargin + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := 0 + + // The encoded form must start with a literal, as there are no previous + // bytes to copy, so we start looking for hash matches at s == 1. + s := 1 + nextHash := hash(load32(src, s), shift) + + for { + // Copied from the C++ snappy implementation: + // + // Heuristic match skipping: If 32 bytes are scanned with no matches + // found, start looking only at every other byte. If 32 more bytes are + // scanned (or skipped), look at every third byte, etc.. When a match + // is found, immediately go back to looking at every byte. This is a + // small loss (~5% performance, ~0.1% density) for compressible data + // due to more bookkeeping, but for non-compressible data (such as + // JPEG) it's a huge win since the compressor quickly "realizes" the + // data is incompressible and doesn't bother looking for matches + // everywhere. + // + // The "skip" variable keeps track of how many bytes there are since + // the last match; dividing it by 32 (ie. right-shifting by five) gives + // the number of bytes to move ahead for each iteration. + skip := 32 + + nextS := s + candidate := 0 + for { + s = nextS + bytesBetweenHashLookups := skip >> 5 + nextS = s + bytesBetweenHashLookups + skip += bytesBetweenHashLookups + if nextS > sLimit { + goto emitRemainder + } + candidate = int(table[nextHash&tableMask]) + table[nextHash&tableMask] = uint16(s) + nextHash = hash(load32(src, nextS), shift) + if load32(src, s) == load32(src, candidate) { + break + } + } + + // A 4-byte match has been found. We'll later see if more than 4 bytes + // match. But, prior to the match, src[nextEmit:s] are unmatched. Emit + // them as literal bytes. + d += emitLiteral(dst[d:], src[nextEmit:s]) + + // Call emitCopy, and then see if another emitCopy could be our next + // move. Repeat until we find no match for the input immediately after + // what was consumed by the last emitCopy call. + // + // If we exit this loop normally then we need to call emitLiteral next, + // though we don't yet know how big the literal will be. We handle that + // by proceeding to the next iteration of the main loop. We also can + // exit this loop via goto if we get close to exhausting the input. + for { + // Invariant: we have a 4-byte match at s, and no need to emit any + // literal bytes prior to s. + base := s + + // Extend the 4-byte match as long as possible. + // + // This is an inlined version of: + // s = extendMatch(src, candidate+4, s+4) + s += 4 + for i := candidate + 4; s < len(src) && src[i] == src[s]; i, s = i+1, s+1 { + } + + d += emitCopy(dst[d:], base-candidate, s-base) + nextEmit = s + if s >= sLimit { + goto emitRemainder + } + + // We could immediately start working at s now, but to improve + // compression we first update the hash table at s-1 and at s. If + // another emitCopy is not our next move, also calculate nextHash + // at s+1. At least on GOARCH=amd64, these three hash calculations + // are faster as one load64 call (with some shifts) instead of + // three load32 calls. + x := load64(src, s-1) + prevHash := hash(uint32(x>>0), shift) + table[prevHash&tableMask] = uint16(s - 1) + currHash := hash(uint32(x>>8), shift) + candidate = int(table[currHash&tableMask]) + table[currHash&tableMask] = uint16(s) + if uint32(x>>8) != load32(src, candidate) { + nextHash = hash(uint32(x>>16), shift) + s++ + break + } + } + } + +emitRemainder: + if nextEmit < len(src) { + d += emitLiteral(dst[d:], src[nextEmit:]) + } + return d +} diff --git a/vendor/github.com/klauspost/compress/internal/snapref/snappy.go b/vendor/github.com/klauspost/compress/internal/snapref/snappy.go new file mode 100644 index 0000000000..34d01f4aa6 --- /dev/null +++ b/vendor/github.com/klauspost/compress/internal/snapref/snappy.go @@ -0,0 +1,98 @@ +// Copyright 2011 The Snappy-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 snapref implements the Snappy compression format. It aims for very +// high speeds and reasonable compression. +// +// There are actually two Snappy formats: block and stream. They are related, +// but different: trying to decompress block-compressed data as a Snappy stream +// will fail, and vice versa. The block format is the Decode and Encode +// functions and the stream format is the Reader and Writer types. +// +// The block format, the more common case, is used when the complete size (the +// number of bytes) of the original data is known upfront, at the time +// compression starts. The stream format, also known as the framing format, is +// for when that isn't always true. +// +// The canonical, C++ implementation is at https://github.com/google/snappy and +// it only implements the block format. +package snapref + +import ( + "hash/crc32" +) + +/* +Each encoded block begins with the varint-encoded length of the decoded data, +followed by a sequence of chunks. Chunks begin and end on byte boundaries. The +first byte of each chunk is broken into its 2 least and 6 most significant bits +called l and m: l ranges in [0, 4) and m ranges in [0, 64). l is the chunk tag. +Zero means a literal tag. All other values mean a copy tag. + +For literal tags: + - If m < 60, the next 1 + m bytes are literal bytes. + - Otherwise, let n be the little-endian unsigned integer denoted by the next + m - 59 bytes. The next 1 + n bytes after that are literal bytes. + +For copy tags, length bytes are copied from offset bytes ago, in the style of +Lempel-Ziv compression algorithms. In particular: + - For l == 1, the offset ranges in [0, 1<<11) and the length in [4, 12). + The length is 4 + the low 3 bits of m. The high 3 bits of m form bits 8-10 + of the offset. The next byte is bits 0-7 of the offset. + - For l == 2, the offset ranges in [0, 1<<16) and the length in [1, 65). + The length is 1 + m. The offset is the little-endian unsigned integer + denoted by the next 2 bytes. + - For l == 3, this tag is a legacy format that is no longer issued by most + encoders. Nonetheless, the offset ranges in [0, 1<<32) and the length in + [1, 65). The length is 1 + m. The offset is the little-endian unsigned + integer denoted by the next 4 bytes. +*/ +const ( + tagLiteral = 0x00 + tagCopy1 = 0x01 + tagCopy2 = 0x02 + tagCopy4 = 0x03 +) + +const ( + checksumSize = 4 + chunkHeaderSize = 4 + magicChunk = "\xff\x06\x00\x00" + magicBody + magicBody = "sNaPpY" + + // maxBlockSize is the maximum size of the input to encodeBlock. It is not + // part of the wire format per se, but some parts of the encoder assume + // that an offset fits into a uint16. + // + // Also, for the framing format (Writer type instead of Encode function), + // https://github.com/google/snappy/blob/master/framing_format.txt says + // that "the uncompressed data in a chunk must be no longer than 65536 + // bytes". + maxBlockSize = 65536 + + // maxEncodedLenOfMaxBlockSize equals MaxEncodedLen(maxBlockSize), but is + // hard coded to be a const instead of a variable, so that obufLen can also + // be a const. Their equivalence is confirmed by + // TestMaxEncodedLenOfMaxBlockSize. + maxEncodedLenOfMaxBlockSize = 76490 + + obufHeaderLen = len(magicChunk) + checksumSize + chunkHeaderSize + obufLen = obufHeaderLen + maxEncodedLenOfMaxBlockSize +) + +const ( + chunkTypeCompressedData = 0x00 + chunkTypeUncompressedData = 0x01 + chunkTypePadding = 0xfe + chunkTypeStreamIdentifier = 0xff +) + +var crcTable = crc32.MakeTable(crc32.Castagnoli) + +// crc implements the checksum specified in section 3 of +// https://github.com/google/snappy/blob/master/framing_format.txt +func crc(b []byte) uint32 { + c := crc32.Update(0, crcTable, b) + return uint32(c>>15|c<<17) + 0xa282ead8 +} diff --git a/vendor/github.com/klauspost/compress/s2sx.mod b/vendor/github.com/klauspost/compress/s2sx.mod new file mode 100644 index 0000000000..5a4412f907 --- /dev/null +++ b/vendor/github.com/klauspost/compress/s2sx.mod @@ -0,0 +1,4 @@ +module github.com/klauspost/compress + +go 1.19 + diff --git a/vendor/github.com/klauspost/compress/s2sx.sum b/vendor/github.com/klauspost/compress/s2sx.sum new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/github.com/klauspost/compress/zstd/README.md b/vendor/github.com/klauspost/compress/zstd/README.md new file mode 100644 index 0000000000..92e2347bbc --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/README.md @@ -0,0 +1,441 @@ +# zstd + +[Zstandard](https://facebook.github.io/zstd/) is a real-time compression algorithm, providing high compression ratios. +It offers a very wide range of compression / speed trade-off, while being backed by a very fast decoder. +A high performance compression algorithm is implemented. For now focused on speed. + +This package provides [compression](#Compressor) to and [decompression](#Decompressor) of Zstandard content. + +This package is pure Go and without use of "unsafe". + +The `zstd` package is provided as open source software using a Go standard license. + +Currently the package is heavily optimized for 64 bit processors and will be significantly slower on 32 bit processors. + +For seekable zstd streams, see [this excellent package](https://github.com/SaveTheRbtz/zstd-seekable-format-go). + +## Installation + +Install using `go get -u github.com/klauspost/compress`. The package is located in `github.com/klauspost/compress/zstd`. + +[![Go Reference](https://pkg.go.dev/badge/github.com/klauspost/compress/zstd.svg)](https://pkg.go.dev/github.com/klauspost/compress/zstd) + +## Compressor + +### Status: + +STABLE - there may always be subtle bugs, a wide variety of content has been tested and the library is actively +used by several projects. This library is being [fuzz-tested](https://github.com/klauspost/compress-fuzz) for all updates. + +There may still be specific combinations of data types/size/settings that could lead to edge cases, +so as always, testing is recommended. + +For now, a high speed (fastest) and medium-fast (default) compressor has been implemented. + +* The "Fastest" compression ratio is roughly equivalent to zstd level 1. +* The "Default" compression ratio is roughly equivalent to zstd level 3 (default). +* The "Better" compression ratio is roughly equivalent to zstd level 7. +* The "Best" compression ratio is roughly equivalent to zstd level 11. + +In terms of speed, it is typically 2x as fast as the stdlib deflate/gzip in its fastest mode. +The compression ratio compared to stdlib is around level 3, but usually 3x as fast. + + +### Usage + +An Encoder can be used for either compressing a stream via the +`io.WriteCloser` interface supported by the Encoder or as multiple independent +tasks via the `EncodeAll` function. +Smaller encodes are encouraged to use the EncodeAll function. +Use `NewWriter` to create a new instance that can be used for both. + +To create a writer with default options, do like this: + +```Go +// Compress input to output. +func Compress(in io.Reader, out io.Writer) error { + enc, err := zstd.NewWriter(out) + if err != nil { + return err + } + _, err = io.Copy(enc, in) + if err != nil { + enc.Close() + return err + } + return enc.Close() +} +``` + +Now you can encode by writing data to `enc`. The output will be finished writing when `Close()` is called. +Even if your encode fails, you should still call `Close()` to release any resources that may be held up. + +The above is fine for big encodes. However, whenever possible try to *reuse* the writer. + +To reuse the encoder, you can use the `Reset(io.Writer)` function to change to another output. +This will allow the encoder to reuse all resources and avoid wasteful allocations. + +Currently stream encoding has 'light' concurrency, meaning up to 2 goroutines can be working on part +of a stream. This is independent of the `WithEncoderConcurrency(n)`, but that is likely to change +in the future. So if you want to limit concurrency for future updates, specify the concurrency +you would like. + +If you would like stream encoding to be done without spawning async goroutines, use `WithEncoderConcurrency(1)` +which will compress input as each block is completed, blocking on writes until each has completed. + +You can specify your desired compression level using `WithEncoderLevel()` option. Currently only pre-defined +compression settings can be specified. + +#### Future Compatibility Guarantees + +This will be an evolving project. When using this package it is important to note that both the compression efficiency and speed may change. + +The goal will be to keep the default efficiency at the default zstd (level 3). +However the encoding should never be assumed to remain the same, +and you should not use hashes of compressed output for similarity checks. + +The Encoder can be assumed to produce the same output from the exact same code version. +However, the may be modes in the future that break this, +although they will not be enabled without an explicit option. + +This encoder is not designed to (and will probably never) output the exact same bitstream as the reference encoder. + +Also note, that the cgo decompressor currently does not [report all errors on invalid input](https://github.com/DataDog/zstd/issues/59), +[omits error checks](https://github.com/DataDog/zstd/issues/61), [ignores checksums](https://github.com/DataDog/zstd/issues/43) +and seems to ignore concatenated streams, even though [it is part of the spec](https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#frames). + +#### Blocks + +For compressing small blocks, the returned encoder has a function called `EncodeAll(src, dst []byte) []byte`. + +`EncodeAll` will encode all input in src and append it to dst. +This function can be called concurrently. +Each call will only run on a same goroutine as the caller. + +Encoded blocks can be concatenated and the result will be the combined input stream. +Data compressed with EncodeAll can be decoded with the Decoder, using either a stream or `DecodeAll`. + +Especially when encoding blocks you should take special care to reuse the encoder. +This will effectively make it run without allocations after a warmup period. +To make it run completely without allocations, supply a destination buffer with space for all content. + +```Go +import "github.com/klauspost/compress/zstd" + +// Create a writer that caches compressors. +// For this operation type we supply a nil Reader. +var encoder, _ = zstd.NewWriter(nil) + +// Compress a buffer. +// If you have a destination buffer, the allocation in the call can also be eliminated. +func Compress(src []byte) []byte { + return encoder.EncodeAll(src, make([]byte, 0, len(src))) +} +``` + +You can control the maximum number of concurrent encodes using the `WithEncoderConcurrency(n)` +option when creating the writer. + +Using the Encoder for both a stream and individual blocks concurrently is safe. + +### Performance + +I have collected some speed examples to compare speed and compression against other compressors. + +* `file` is the input file. +* `out` is the compressor used. `zskp` is this package. `zstd` is the Datadog cgo library. `gzstd/gzkp` is gzip standard and this library. +* `level` is the compression level used. For `zskp` level 1 is "fastest", level 2 is "default"; 3 is "better", 4 is "best". +* `insize`/`outsize` is the input/output size. +* `millis` is the number of milliseconds used for compression. +* `mb/s` is megabytes (2^20 bytes) per second. + +``` +Silesia Corpus: +http://sun.aei.polsl.pl/~sdeor/corpus/silesia.zip + +This package: +file out level insize outsize millis mb/s +silesia.tar zskp 1 211947520 73821326 634 318.47 +silesia.tar zskp 2 211947520 67655404 1508 133.96 +silesia.tar zskp 3 211947520 64746933 3000 67.37 +silesia.tar zskp 4 211947520 60073508 16926 11.94 + +cgo zstd: +silesia.tar zstd 1 211947520 73605392 543 371.56 +silesia.tar zstd 3 211947520 66793289 864 233.68 +silesia.tar zstd 6 211947520 62916450 1913 105.66 +silesia.tar zstd 9 211947520 60212393 5063 39.92 + +gzip, stdlib/this package: +silesia.tar gzstd 1 211947520 80007735 1498 134.87 +silesia.tar gzkp 1 211947520 80088272 1009 200.31 + +GOB stream of binary data. Highly compressible. +https://files.klauspost.com/compress/gob-stream.7z + +file out level insize outsize millis mb/s +gob-stream zskp 1 1911399616 233948096 3230 564.34 +gob-stream zskp 2 1911399616 203997694 4997 364.73 +gob-stream zskp 3 1911399616 173526523 13435 135.68 +gob-stream zskp 4 1911399616 162195235 47559 38.33 + +gob-stream zstd 1 1911399616 249810424 2637 691.26 +gob-stream zstd 3 1911399616 208192146 3490 522.31 +gob-stream zstd 6 1911399616 193632038 6687 272.56 +gob-stream zstd 9 1911399616 177620386 16175 112.70 + +gob-stream gzstd 1 1911399616 357382013 9046 201.49 +gob-stream gzkp 1 1911399616 359136669 4885 373.08 + +The test data for the Large Text Compression Benchmark is the first +10^9 bytes of the English Wikipedia dump on Mar. 3, 2006. +http://mattmahoney.net/dc/textdata.html + +file out level insize outsize millis mb/s +enwik9 zskp 1 1000000000 343833605 3687 258.64 +enwik9 zskp 2 1000000000 317001237 7672 124.29 +enwik9 zskp 3 1000000000 291915823 15923 59.89 +enwik9 zskp 4 1000000000 261710291 77697 12.27 + +enwik9 zstd 1 1000000000 358072021 3110 306.65 +enwik9 zstd 3 1000000000 313734672 4784 199.35 +enwik9 zstd 6 1000000000 295138875 10290 92.68 +enwik9 zstd 9 1000000000 278348700 28549 33.40 + +enwik9 gzstd 1 1000000000 382578136 8608 110.78 +enwik9 gzkp 1 1000000000 382781160 5628 169.45 + +Highly compressible JSON file. +https://files.klauspost.com/compress/github-june-2days-2019.json.zst + +file out level insize outsize millis mb/s +github-june-2days-2019.json zskp 1 6273951764 697439532 9789 611.17 +github-june-2days-2019.json zskp 2 6273951764 610876538 18553 322.49 +github-june-2days-2019.json zskp 3 6273951764 517662858 44186 135.41 +github-june-2days-2019.json zskp 4 6273951764 464617114 165373 36.18 + +github-june-2days-2019.json zstd 1 6273951764 766284037 8450 708.00 +github-june-2days-2019.json zstd 3 6273951764 661889476 10927 547.57 +github-june-2days-2019.json zstd 6 6273951764 642756859 22996 260.18 +github-june-2days-2019.json zstd 9 6273951764 601974523 52413 114.16 + +github-june-2days-2019.json gzstd 1 6273951764 1164397768 26793 223.32 +github-june-2days-2019.json gzkp 1 6273951764 1120631856 17693 338.16 + +VM Image, Linux mint with a few installed applications: +https://files.klauspost.com/compress/rawstudio-mint14.7z + +file out level insize outsize millis mb/s +rawstudio-mint14.tar zskp 1 8558382592 3718400221 18206 448.29 +rawstudio-mint14.tar zskp 2 8558382592 3326118337 37074 220.15 +rawstudio-mint14.tar zskp 3 8558382592 3163842361 87306 93.49 +rawstudio-mint14.tar zskp 4 8558382592 2970480650 783862 10.41 + +rawstudio-mint14.tar zstd 1 8558382592 3609250104 17136 476.27 +rawstudio-mint14.tar zstd 3 8558382592 3341679997 29262 278.92 +rawstudio-mint14.tar zstd 6 8558382592 3235846406 77904 104.77 +rawstudio-mint14.tar zstd 9 8558382592 3160778861 140946 57.91 + +rawstudio-mint14.tar gzstd 1 8558382592 3926234992 51345 158.96 +rawstudio-mint14.tar gzkp 1 8558382592 3960117298 36722 222.26 + +CSV data: +https://files.klauspost.com/compress/nyc-taxi-data-10M.csv.zst + +file out level insize outsize millis mb/s +nyc-taxi-data-10M.csv zskp 1 3325605752 641319332 9462 335.17 +nyc-taxi-data-10M.csv zskp 2 3325605752 588976126 17570 180.50 +nyc-taxi-data-10M.csv zskp 3 3325605752 529329260 32432 97.79 +nyc-taxi-data-10M.csv zskp 4 3325605752 474949772 138025 22.98 + +nyc-taxi-data-10M.csv zstd 1 3325605752 687399637 8233 385.18 +nyc-taxi-data-10M.csv zstd 3 3325605752 598514411 10065 315.07 +nyc-taxi-data-10M.csv zstd 6 3325605752 570522953 20038 158.27 +nyc-taxi-data-10M.csv zstd 9 3325605752 517554797 64565 49.12 + +nyc-taxi-data-10M.csv gzstd 1 3325605752 928654908 21270 149.11 +nyc-taxi-data-10M.csv gzkp 1 3325605752 922273214 13929 227.68 +``` + +## Decompressor + +Status: STABLE - there may still be subtle bugs, but a wide variety of content has been tested. + +This library is being continuously [fuzz-tested](https://github.com/klauspost/compress-fuzz), +kindly supplied by [fuzzit.dev](https://fuzzit.dev/). +The main purpose of the fuzz testing is to ensure that it is not possible to crash the decoder, +or run it past its limits with ANY input provided. + +### Usage + +The package has been designed for two main usages, big streams of data and smaller in-memory buffers. +There are two main usages of the package for these. Both of them are accessed by creating a `Decoder`. + +For streaming use a simple setup could look like this: + +```Go +import "github.com/klauspost/compress/zstd" + +func Decompress(in io.Reader, out io.Writer) error { + d, err := zstd.NewReader(in) + if err != nil { + return err + } + defer d.Close() + + // Copy content... + _, err = io.Copy(out, d) + return err +} +``` + +It is important to use the "Close" function when you no longer need the Reader to stop running goroutines, +when running with default settings. +Goroutines will exit once an error has been returned, including `io.EOF` at the end of a stream. + +Streams are decoded concurrently in 4 asynchronous stages to give the best possible throughput. +However, if you prefer synchronous decompression, use `WithDecoderConcurrency(1)` which will decompress data +as it is being requested only. + +For decoding buffers, it could look something like this: + +```Go +import "github.com/klauspost/compress/zstd" + +// Create a reader that caches decompressors. +// For this operation type we supply a nil Reader. +var decoder, _ = zstd.NewReader(nil, zstd.WithDecoderConcurrency(0)) + +// Decompress a buffer. We don't supply a destination buffer, +// so it will be allocated by the decoder. +func Decompress(src []byte) ([]byte, error) { + return decoder.DecodeAll(src, nil) +} +``` + +Both of these cases should provide the functionality needed. +The decoder can be used for *concurrent* decompression of multiple buffers. +By default 4 decompressors will be created. + +It will only allow a certain number of concurrent operations to run. +To tweak that yourself use the `WithDecoderConcurrency(n)` option when creating the decoder. +It is possible to use `WithDecoderConcurrency(0)` to create GOMAXPROCS decoders. + +### Dictionaries + +Data compressed with [dictionaries](https://github.com/facebook/zstd#the-case-for-small-data-compression) can be decompressed. + +Dictionaries are added individually to Decoders. +Dictionaries are generated by the `zstd --train` command and contains an initial state for the decoder. +To add a dictionary use the `WithDecoderDicts(dicts ...[]byte)` option with the dictionary data. +Several dictionaries can be added at once. + +The dictionary will be used automatically for the data that specifies them. +A re-used Decoder will still contain the dictionaries registered. + +When registering multiple dictionaries with the same ID, the last one will be used. + +It is possible to use dictionaries when compressing data. + +To enable a dictionary use `WithEncoderDict(dict []byte)`. Here only one dictionary will be used +and it will likely be used even if it doesn't improve compression. + +The used dictionary must be used to decompress the content. + +For any real gains, the dictionary should be built with similar data. +If an unsuitable dictionary is used the output may be slightly larger than using no dictionary. +Use the [zstd commandline tool](https://github.com/facebook/zstd/releases) to build a dictionary from sample data. +For information see [zstd dictionary information](https://github.com/facebook/zstd#the-case-for-small-data-compression). + +For now there is a fixed startup performance penalty for compressing content with dictionaries. +This will likely be improved over time. Just be aware to test performance when implementing. + +### Allocation-less operation + +The decoder has been designed to operate without allocations after a warmup. + +This means that you should *store* the decoder for best performance. +To re-use a stream decoder, use the `Reset(r io.Reader) error` to switch to another stream. +A decoder can safely be re-used even if the previous stream failed. + +To release the resources, you must call the `Close()` function on a decoder. +After this it can *no longer be reused*, but all running goroutines will be stopped. +So you *must* use this if you will no longer need the Reader. + +For decompressing smaller buffers a single decoder can be used. +When decoding buffers, you can supply a destination slice with length 0 and your expected capacity. +In this case no unneeded allocations should be made. + +### Concurrency + +The buffer decoder does everything on the same goroutine and does nothing concurrently. +It can however decode several buffers concurrently. Use `WithDecoderConcurrency(n)` to limit that. + +The stream decoder will create goroutines that: + +1) Reads input and splits the input into blocks. +2) Decompression of literals. +3) Decompression of sequences. +4) Reconstruction of output stream. + +So effectively this also means the decoder will "read ahead" and prepare data to always be available for output. + +The concurrency level will, for streams, determine how many blocks ahead the compression will start. + +Since "blocks" are quite dependent on the output of the previous block stream decoding will only have limited concurrency. + +In practice this means that concurrency is often limited to utilizing about 3 cores effectively. + +### Benchmarks + +The first two are streaming decodes and the last are smaller inputs. + +Running on AMD Ryzen 9 3950X 16-Core Processor. AMD64 assembly used. + +``` +BenchmarkDecoderSilesia-32 5 206878840 ns/op 1024.50 MB/s 49808 B/op 43 allocs/op +BenchmarkDecoderEnwik9-32 1 1271809000 ns/op 786.28 MB/s 72048 B/op 52 allocs/op + +Concurrent blocks, performance: + +BenchmarkDecoder_DecodeAllParallel/kppkn.gtb.zst-32 67356 17857 ns/op 10321.96 MB/s 22.48 pct 102 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/geo.protodata.zst-32 266656 4421 ns/op 26823.21 MB/s 11.89 pct 19 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/plrabn12.txt.zst-32 20992 56842 ns/op 8477.17 MB/s 39.90 pct 754 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/lcet10.txt.zst-32 27456 43932 ns/op 9714.01 MB/s 33.27 pct 524 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/asyoulik.txt.zst-32 78432 15047 ns/op 8319.15 MB/s 40.34 pct 66 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/alice29.txt.zst-32 65800 18436 ns/op 8249.63 MB/s 37.75 pct 88 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/html_x_4.zst-32 102993 11523 ns/op 35546.09 MB/s 3.637 pct 143 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/paper-100k.pdf.zst-32 1000000 1070 ns/op 95720.98 MB/s 80.53 pct 3 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/fireworks.jpeg.zst-32 749802 1752 ns/op 70272.35 MB/s 100.0 pct 5 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/urls.10K.zst-32 22640 52934 ns/op 13263.37 MB/s 26.25 pct 1014 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/html.zst-32 226412 5232 ns/op 19572.27 MB/s 14.49 pct 20 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/comp-data.bin.zst-32 923041 1276 ns/op 3194.71 MB/s 31.26 pct 0 B/op 0 allocs/op +``` + +This reflects the performance around May 2022, but this may be out of date. + +## Zstd inside ZIP files + +It is possible to use zstandard to compress individual files inside zip archives. +While this isn't widely supported it can be useful for internal files. + +To support the compression and decompression of these files you must register a compressor and decompressor. + +It is highly recommended registering the (de)compressors on individual zip Reader/Writer and NOT +use the global registration functions. The main reason for this is that 2 registrations from +different packages will result in a panic. + +It is a good idea to only have a single compressor and decompressor, since they can be used for multiple zip +files concurrently, and using a single instance will allow reusing some resources. + +See [this example](https://pkg.go.dev/github.com/klauspost/compress/zstd#example-ZipCompressor) for +how to compress and decompress files inside zip archives. + +# Contributions + +Contributions are always welcome. +For new features/fixes, remember to add tests and for performance enhancements include benchmarks. + +For general feedback and experience reports, feel free to open an issue or write me on [Twitter](https://twitter.com/sh0dan). + +This package includes the excellent [`github.com/cespare/xxhash`](https://github.com/cespare/xxhash) package Copyright (c) 2016 Caleb Spare. diff --git a/vendor/github.com/klauspost/compress/zstd/bitreader.go b/vendor/github.com/klauspost/compress/zstd/bitreader.go new file mode 100644 index 0000000000..25ca983941 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/bitreader.go @@ -0,0 +1,136 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "encoding/binary" + "errors" + "fmt" + "io" + "math/bits" +) + +// bitReader reads a bitstream in reverse. +// The last set bit indicates the start of the stream and is used +// for aligning the input. +type bitReader struct { + in []byte + value uint64 // Maybe use [16]byte, but shifting is awkward. + bitsRead uint8 +} + +// init initializes and resets the bit reader. +func (b *bitReader) init(in []byte) error { + if len(in) < 1 { + return errors.New("corrupt stream: too short") + } + b.in = in + // The highest bit of the last byte indicates where to start + v := in[len(in)-1] + if v == 0 { + return errors.New("corrupt stream, did not find end of stream") + } + b.bitsRead = 64 + b.value = 0 + if len(in) >= 8 { + b.fillFastStart() + } else { + b.fill() + b.fill() + } + b.bitsRead += 8 - uint8(highBits(uint32(v))) + return nil +} + +// getBits will return n bits. n can be 0. +func (b *bitReader) getBits(n uint8) int { + if n == 0 /*|| b.bitsRead >= 64 */ { + return 0 + } + return int(b.get32BitsFast(n)) +} + +// get32BitsFast requires that at least one bit is requested every time. +// There are no checks if the buffer is filled. +func (b *bitReader) get32BitsFast(n uint8) uint32 { + const regMask = 64 - 1 + v := uint32((b.value << (b.bitsRead & regMask)) >> ((regMask + 1 - n) & regMask)) + b.bitsRead += n + return v +} + +// fillFast() will make sure at least 32 bits are available. +// There must be at least 4 bytes available. +func (b *bitReader) fillFast() { + if b.bitsRead < 32 { + return + } + v := b.in[len(b.in)-4:] + b.in = b.in[:len(b.in)-4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value = (b.value << 32) | uint64(low) + b.bitsRead -= 32 +} + +// fillFastStart() assumes the bitreader is empty and there is at least 8 bytes to read. +func (b *bitReader) fillFastStart() { + v := b.in[len(b.in)-8:] + b.in = b.in[:len(b.in)-8] + b.value = binary.LittleEndian.Uint64(v) + b.bitsRead = 0 +} + +// fill() will make sure at least 32 bits are available. +func (b *bitReader) fill() { + if b.bitsRead < 32 { + return + } + if len(b.in) >= 4 { + v := b.in[len(b.in)-4:] + b.in = b.in[:len(b.in)-4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value = (b.value << 32) | uint64(low) + b.bitsRead -= 32 + return + } + + b.bitsRead -= uint8(8 * len(b.in)) + for len(b.in) > 0 { + b.value = (b.value << 8) | uint64(b.in[len(b.in)-1]) + b.in = b.in[:len(b.in)-1] + } +} + +// finished returns true if all bits have been read from the bit stream. +func (b *bitReader) finished() bool { + return len(b.in) == 0 && b.bitsRead >= 64 +} + +// overread returns true if more bits have been requested than is on the stream. +func (b *bitReader) overread() bool { + return b.bitsRead > 64 +} + +// remain returns the number of bits remaining. +func (b *bitReader) remain() uint { + return 8*uint(len(b.in)) + 64 - uint(b.bitsRead) +} + +// close the bitstream and returns an error if out-of-buffer reads occurred. +func (b *bitReader) close() error { + // Release reference. + b.in = nil + if !b.finished() { + return fmt.Errorf("%d extra bits on block, should be 0", b.remain()) + } + if b.bitsRead > 64 { + return io.ErrUnexpectedEOF + } + return nil +} + +func highBits(val uint32) (n uint32) { + return uint32(bits.Len32(val) - 1) +} diff --git a/vendor/github.com/klauspost/compress/zstd/bitwriter.go b/vendor/github.com/klauspost/compress/zstd/bitwriter.go new file mode 100644 index 0000000000..1952f175b0 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/bitwriter.go @@ -0,0 +1,112 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +package zstd + +// bitWriter will write bits. +// First bit will be LSB of the first byte of output. +type bitWriter struct { + bitContainer uint64 + nBits uint8 + out []byte +} + +// bitMask16 is bitmasks. Has extra to avoid bounds check. +var bitMask16 = [32]uint16{ + 0, 1, 3, 7, 0xF, 0x1F, + 0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, + 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF} /* up to 16 bits */ + +var bitMask32 = [32]uint32{ + 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, + 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, + 0x1ffff, 0x3ffff, 0x7FFFF, 0xfFFFF, 0x1fFFFF, 0x3fFFFF, 0x7fFFFF, 0xffFFFF, + 0x1ffFFFF, 0x3ffFFFF, 0x7ffFFFF, 0xfffFFFF, 0x1fffFFFF, 0x3fffFFFF, 0x7fffFFFF, +} // up to 32 bits + +// addBits16NC will add up to 16 bits. +// It will not check if there is space for them, +// so the caller must ensure that it has flushed recently. +func (b *bitWriter) addBits16NC(value uint16, bits uint8) { + b.bitContainer |= uint64(value&bitMask16[bits&31]) << (b.nBits & 63) + b.nBits += bits +} + +// addBits32NC will add up to 31 bits. +// It will not check if there is space for them, +// so the caller must ensure that it has flushed recently. +func (b *bitWriter) addBits32NC(value uint32, bits uint8) { + b.bitContainer |= uint64(value&bitMask32[bits&31]) << (b.nBits & 63) + b.nBits += bits +} + +// addBits64NC will add up to 64 bits. +// There must be space for 32 bits. +func (b *bitWriter) addBits64NC(value uint64, bits uint8) { + if bits <= 31 { + b.addBits32Clean(uint32(value), bits) + return + } + b.addBits32Clean(uint32(value), 32) + b.flush32() + b.addBits32Clean(uint32(value>>32), bits-32) +} + +// addBits32Clean will add up to 32 bits. +// It will not check if there is space for them. +// The input must not contain more bits than specified. +func (b *bitWriter) addBits32Clean(value uint32, bits uint8) { + b.bitContainer |= uint64(value) << (b.nBits & 63) + b.nBits += bits +} + +// addBits16Clean will add up to 16 bits. value may not contain more set bits than indicated. +// It will not check if there is space for them, so the caller must ensure that it has flushed recently. +func (b *bitWriter) addBits16Clean(value uint16, bits uint8) { + b.bitContainer |= uint64(value) << (b.nBits & 63) + b.nBits += bits +} + +// flush32 will flush out, so there are at least 32 bits available for writing. +func (b *bitWriter) flush32() { + if b.nBits < 32 { + return + } + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24)) + b.nBits -= 32 + b.bitContainer >>= 32 +} + +// flushAlign will flush remaining full bytes and align to next byte boundary. +func (b *bitWriter) flushAlign() { + nbBytes := (b.nBits + 7) >> 3 + for i := uint8(0); i < nbBytes; i++ { + b.out = append(b.out, byte(b.bitContainer>>(i*8))) + } + b.nBits = 0 + b.bitContainer = 0 +} + +// close will write the alignment bit and write the final byte(s) +// to the output. +func (b *bitWriter) close() { + // End mark + b.addBits16Clean(1, 1) + // flush until next byte. + b.flushAlign() +} + +// reset and continue writing by appending to out. +func (b *bitWriter) reset(out []byte) { + b.bitContainer = 0 + b.nBits = 0 + b.out = out +} diff --git a/vendor/github.com/klauspost/compress/zstd/blockdec.go b/vendor/github.com/klauspost/compress/zstd/blockdec.go new file mode 100644 index 0000000000..03744fbc76 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/blockdec.go @@ -0,0 +1,729 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "bytes" + "encoding/binary" + "errors" + "fmt" + "hash/crc32" + "io" + "os" + "path/filepath" + "sync" + + "github.com/klauspost/compress/huff0" + "github.com/klauspost/compress/zstd/internal/xxhash" +) + +type blockType uint8 + +//go:generate stringer -type=blockType,literalsBlockType,seqCompMode,tableIndex + +const ( + blockTypeRaw blockType = iota + blockTypeRLE + blockTypeCompressed + blockTypeReserved +) + +type literalsBlockType uint8 + +const ( + literalsBlockRaw literalsBlockType = iota + literalsBlockRLE + literalsBlockCompressed + literalsBlockTreeless +) + +const ( + // maxCompressedBlockSize is the biggest allowed compressed block size (128KB) + maxCompressedBlockSize = 128 << 10 + + compressedBlockOverAlloc = 16 + maxCompressedBlockSizeAlloc = 128<<10 + compressedBlockOverAlloc + + // Maximum possible block size (all Raw+Uncompressed). + maxBlockSize = (1 << 21) - 1 + + maxMatchLen = 131074 + maxSequences = 0x7f00 + 0xffff + + // We support slightly less than the reference decoder to be able to + // use ints on 32 bit archs. + maxOffsetBits = 30 +) + +var ( + huffDecoderPool = sync.Pool{New: func() interface{} { + return &huff0.Scratch{} + }} + + fseDecoderPool = sync.Pool{New: func() interface{} { + return &fseDecoder{} + }} +) + +type blockDec struct { + // Raw source data of the block. + data []byte + dataStorage []byte + + // Destination of the decoded data. + dst []byte + + // Buffer for literals data. + literalBuf []byte + + // Window size of the block. + WindowSize uint64 + + err error + + // Check against this crc, if hasCRC is true. + checkCRC uint32 + hasCRC bool + + // Frame to use for singlethreaded decoding. + // Should not be used by the decoder itself since parent may be another frame. + localFrame *frameDec + + sequence []seqVals + + async struct { + newHist *history + literals []byte + seqData []byte + seqSize int // Size of uncompressed sequences + fcs uint64 + } + + // Block is RLE, this is the size. + RLESize uint32 + + Type blockType + + // Is this the last block of a frame? + Last bool + + // Use less memory + lowMem bool +} + +func (b *blockDec) String() string { + if b == nil { + return "" + } + return fmt.Sprintf("Steam Size: %d, Type: %v, Last: %t, Window: %d", len(b.data), b.Type, b.Last, b.WindowSize) +} + +func newBlockDec(lowMem bool) *blockDec { + b := blockDec{ + lowMem: lowMem, + } + return &b +} + +// reset will reset the block. +// Input must be a start of a block and will be at the end of the block when returned. +func (b *blockDec) reset(br byteBuffer, windowSize uint64) error { + b.WindowSize = windowSize + tmp, err := br.readSmall(3) + if err != nil { + println("Reading block header:", err) + return err + } + bh := uint32(tmp[0]) | (uint32(tmp[1]) << 8) | (uint32(tmp[2]) << 16) + b.Last = bh&1 != 0 + b.Type = blockType((bh >> 1) & 3) + // find size. + cSize := int(bh >> 3) + maxSize := maxCompressedBlockSizeAlloc + switch b.Type { + case blockTypeReserved: + return ErrReservedBlockType + case blockTypeRLE: + if cSize > maxCompressedBlockSize || cSize > int(b.WindowSize) { + if debugDecoder { + printf("rle block too big: csize:%d block: %+v\n", uint64(cSize), b) + } + return ErrWindowSizeExceeded + } + b.RLESize = uint32(cSize) + if b.lowMem { + maxSize = cSize + } + cSize = 1 + case blockTypeCompressed: + if debugDecoder { + println("Data size on stream:", cSize) + } + b.RLESize = 0 + maxSize = maxCompressedBlockSizeAlloc + if windowSize < maxCompressedBlockSize && b.lowMem { + maxSize = int(windowSize) + compressedBlockOverAlloc + } + if cSize > maxCompressedBlockSize || uint64(cSize) > b.WindowSize { + if debugDecoder { + printf("compressed block too big: csize:%d block: %+v\n", uint64(cSize), b) + } + return ErrCompressedSizeTooBig + } + // Empty compressed blocks must at least be 2 bytes + // for Literals_Block_Type and one for Sequences_Section_Header. + if cSize < 2 { + return ErrBlockTooSmall + } + case blockTypeRaw: + if cSize > maxCompressedBlockSize || cSize > int(b.WindowSize) { + if debugDecoder { + printf("rle block too big: csize:%d block: %+v\n", uint64(cSize), b) + } + return ErrWindowSizeExceeded + } + + b.RLESize = 0 + // We do not need a destination for raw blocks. + maxSize = -1 + default: + panic("Invalid block type") + } + + // Read block data. + if _, ok := br.(*byteBuf); !ok && cap(b.dataStorage) < cSize { + // byteBuf doesn't need a destination buffer. + if b.lowMem || cSize > maxCompressedBlockSize { + b.dataStorage = make([]byte, 0, cSize+compressedBlockOverAlloc) + } else { + b.dataStorage = make([]byte, 0, maxCompressedBlockSizeAlloc) + } + } + b.data, err = br.readBig(cSize, b.dataStorage) + if err != nil { + if debugDecoder { + println("Reading block:", err, "(", cSize, ")", len(b.data)) + printf("%T", br) + } + return err + } + if cap(b.dst) <= maxSize { + b.dst = make([]byte, 0, maxSize+1) + } + return nil +} + +// sendEOF will make the decoder send EOF on this frame. +func (b *blockDec) sendErr(err error) { + b.Last = true + b.Type = blockTypeReserved + b.err = err +} + +// Close will release resources. +// Closed blockDec cannot be reset. +func (b *blockDec) Close() { +} + +// decodeBuf +func (b *blockDec) decodeBuf(hist *history) error { + switch b.Type { + case blockTypeRLE: + if cap(b.dst) < int(b.RLESize) { + if b.lowMem { + b.dst = make([]byte, b.RLESize) + } else { + b.dst = make([]byte, maxCompressedBlockSize) + } + } + b.dst = b.dst[:b.RLESize] + v := b.data[0] + for i := range b.dst { + b.dst[i] = v + } + hist.appendKeep(b.dst) + return nil + case blockTypeRaw: + hist.appendKeep(b.data) + return nil + case blockTypeCompressed: + saved := b.dst + // Append directly to history + if hist.ignoreBuffer == 0 { + b.dst = hist.b + hist.b = nil + } else { + b.dst = b.dst[:0] + } + err := b.decodeCompressed(hist) + if debugDecoder { + println("Decompressed to total", len(b.dst), "bytes, hash:", xxhash.Sum64(b.dst), "error:", err) + } + if hist.ignoreBuffer == 0 { + hist.b = b.dst + b.dst = saved + } else { + hist.appendKeep(b.dst) + } + return err + case blockTypeReserved: + // Used for returning errors. + return b.err + default: + panic("Invalid block type") + } +} + +func (b *blockDec) decodeLiterals(in []byte, hist *history) (remain []byte, err error) { + // There must be at least one byte for Literals_Block_Type and one for Sequences_Section_Header + if len(in) < 2 { + return in, ErrBlockTooSmall + } + + litType := literalsBlockType(in[0] & 3) + var litRegenSize int + var litCompSize int + sizeFormat := (in[0] >> 2) & 3 + var fourStreams bool + var literals []byte + switch litType { + case literalsBlockRaw, literalsBlockRLE: + switch sizeFormat { + case 0, 2: + // Regenerated_Size uses 5 bits (0-31). Literals_Section_Header uses 1 byte. + litRegenSize = int(in[0] >> 3) + in = in[1:] + case 1: + // Regenerated_Size uses 12 bits (0-4095). Literals_Section_Header uses 2 bytes. + litRegenSize = int(in[0]>>4) + (int(in[1]) << 4) + in = in[2:] + case 3: + // Regenerated_Size uses 20 bits (0-1048575). Literals_Section_Header uses 3 bytes. + if len(in) < 3 { + println("too small: litType:", litType, " sizeFormat", sizeFormat, len(in)) + return in, ErrBlockTooSmall + } + litRegenSize = int(in[0]>>4) + (int(in[1]) << 4) + (int(in[2]) << 12) + in = in[3:] + } + case literalsBlockCompressed, literalsBlockTreeless: + switch sizeFormat { + case 0, 1: + // Both Regenerated_Size and Compressed_Size use 10 bits (0-1023). + if len(in) < 3 { + println("too small: litType:", litType, " sizeFormat", sizeFormat, len(in)) + return in, ErrBlockTooSmall + } + n := uint64(in[0]>>4) + (uint64(in[1]) << 4) + (uint64(in[2]) << 12) + litRegenSize = int(n & 1023) + litCompSize = int(n >> 10) + fourStreams = sizeFormat == 1 + in = in[3:] + case 2: + fourStreams = true + if len(in) < 4 { + println("too small: litType:", litType, " sizeFormat", sizeFormat, len(in)) + return in, ErrBlockTooSmall + } + n := uint64(in[0]>>4) + (uint64(in[1]) << 4) + (uint64(in[2]) << 12) + (uint64(in[3]) << 20) + litRegenSize = int(n & 16383) + litCompSize = int(n >> 14) + in = in[4:] + case 3: + fourStreams = true + if len(in) < 5 { + println("too small: litType:", litType, " sizeFormat", sizeFormat, len(in)) + return in, ErrBlockTooSmall + } + n := uint64(in[0]>>4) + (uint64(in[1]) << 4) + (uint64(in[2]) << 12) + (uint64(in[3]) << 20) + (uint64(in[4]) << 28) + litRegenSize = int(n & 262143) + litCompSize = int(n >> 18) + in = in[5:] + } + } + if debugDecoder { + println("literals type:", litType, "litRegenSize:", litRegenSize, "litCompSize:", litCompSize, "sizeFormat:", sizeFormat, "4X:", fourStreams) + } + if litRegenSize > int(b.WindowSize) || litRegenSize > maxCompressedBlockSize { + return in, ErrWindowSizeExceeded + } + + switch litType { + case literalsBlockRaw: + if len(in) < litRegenSize { + println("too small: litType:", litType, " sizeFormat", sizeFormat, "remain:", len(in), "want:", litRegenSize) + return in, ErrBlockTooSmall + } + literals = in[:litRegenSize] + in = in[litRegenSize:] + //printf("Found %d uncompressed literals\n", litRegenSize) + case literalsBlockRLE: + if len(in) < 1 { + println("too small: litType:", litType, " sizeFormat", sizeFormat, "remain:", len(in), "want:", 1) + return in, ErrBlockTooSmall + } + if cap(b.literalBuf) < litRegenSize { + if b.lowMem { + b.literalBuf = make([]byte, litRegenSize, litRegenSize+compressedBlockOverAlloc) + } else { + b.literalBuf = make([]byte, litRegenSize, maxCompressedBlockSize+compressedBlockOverAlloc) + } + } + literals = b.literalBuf[:litRegenSize] + v := in[0] + for i := range literals { + literals[i] = v + } + in = in[1:] + if debugDecoder { + printf("Found %d RLE compressed literals\n", litRegenSize) + } + case literalsBlockTreeless: + if len(in) < litCompSize { + println("too small: litType:", litType, " sizeFormat", sizeFormat, "remain:", len(in), "want:", litCompSize) + return in, ErrBlockTooSmall + } + // Store compressed literals, so we defer decoding until we get history. + literals = in[:litCompSize] + in = in[litCompSize:] + if debugDecoder { + printf("Found %d compressed literals\n", litCompSize) + } + huff := hist.huffTree + if huff == nil { + return in, errors.New("literal block was treeless, but no history was defined") + } + // Ensure we have space to store it. + if cap(b.literalBuf) < litRegenSize { + if b.lowMem { + b.literalBuf = make([]byte, 0, litRegenSize+compressedBlockOverAlloc) + } else { + b.literalBuf = make([]byte, 0, maxCompressedBlockSize+compressedBlockOverAlloc) + } + } + var err error + // Use our out buffer. + huff.MaxDecodedSize = litRegenSize + if fourStreams { + literals, err = huff.Decoder().Decompress4X(b.literalBuf[:0:litRegenSize], literals) + } else { + literals, err = huff.Decoder().Decompress1X(b.literalBuf[:0:litRegenSize], literals) + } + // Make sure we don't leak our literals buffer + if err != nil { + println("decompressing literals:", err) + return in, err + } + if len(literals) != litRegenSize { + return in, fmt.Errorf("literal output size mismatch want %d, got %d", litRegenSize, len(literals)) + } + + case literalsBlockCompressed: + if len(in) < litCompSize { + println("too small: litType:", litType, " sizeFormat", sizeFormat, "remain:", len(in), "want:", litCompSize) + return in, ErrBlockTooSmall + } + literals = in[:litCompSize] + in = in[litCompSize:] + // Ensure we have space to store it. + if cap(b.literalBuf) < litRegenSize { + if b.lowMem { + b.literalBuf = make([]byte, 0, litRegenSize+compressedBlockOverAlloc) + } else { + b.literalBuf = make([]byte, 0, maxCompressedBlockSize+compressedBlockOverAlloc) + } + } + huff := hist.huffTree + if huff == nil || (hist.dict != nil && huff == hist.dict.litEnc) { + huff = huffDecoderPool.Get().(*huff0.Scratch) + if huff == nil { + huff = &huff0.Scratch{} + } + } + var err error + if debugDecoder { + println("huff table input:", len(literals), "CRC:", crc32.ChecksumIEEE(literals)) + } + huff, literals, err = huff0.ReadTable(literals, huff) + if err != nil { + println("reading huffman table:", err) + return in, err + } + hist.huffTree = huff + huff.MaxDecodedSize = litRegenSize + // Use our out buffer. + if fourStreams { + literals, err = huff.Decoder().Decompress4X(b.literalBuf[:0:litRegenSize], literals) + } else { + literals, err = huff.Decoder().Decompress1X(b.literalBuf[:0:litRegenSize], literals) + } + if err != nil { + println("decoding compressed literals:", err) + return in, err + } + // Make sure we don't leak our literals buffer + if len(literals) != litRegenSize { + return in, fmt.Errorf("literal output size mismatch want %d, got %d", litRegenSize, len(literals)) + } + // Re-cap to get extra size. + literals = b.literalBuf[:len(literals)] + if debugDecoder { + printf("Decompressed %d literals into %d bytes\n", litCompSize, litRegenSize) + } + } + hist.decoders.literals = literals + return in, nil +} + +// decodeCompressed will start decompressing a block. +func (b *blockDec) decodeCompressed(hist *history) error { + in := b.data + in, err := b.decodeLiterals(in, hist) + if err != nil { + return err + } + err = b.prepareSequences(in, hist) + if err != nil { + return err + } + if hist.decoders.nSeqs == 0 { + b.dst = append(b.dst, hist.decoders.literals...) + return nil + } + before := len(hist.decoders.out) + err = hist.decoders.decodeSync(hist.b[hist.ignoreBuffer:]) + if err != nil { + return err + } + if hist.decoders.maxSyncLen > 0 { + hist.decoders.maxSyncLen += uint64(before) + hist.decoders.maxSyncLen -= uint64(len(hist.decoders.out)) + } + b.dst = hist.decoders.out + hist.recentOffsets = hist.decoders.prevOffset + return nil +} + +func (b *blockDec) prepareSequences(in []byte, hist *history) (err error) { + if debugDecoder { + printf("prepareSequences: %d byte(s) input\n", len(in)) + } + // Decode Sequences + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#sequences-section + if len(in) < 1 { + return ErrBlockTooSmall + } + var nSeqs int + seqHeader := in[0] + switch { + case seqHeader < 128: + nSeqs = int(seqHeader) + in = in[1:] + case seqHeader < 255: + if len(in) < 2 { + return ErrBlockTooSmall + } + nSeqs = int(seqHeader-128)<<8 | int(in[1]) + in = in[2:] + case seqHeader == 255: + if len(in) < 3 { + return ErrBlockTooSmall + } + nSeqs = 0x7f00 + int(in[1]) + (int(in[2]) << 8) + in = in[3:] + } + if nSeqs == 0 && len(in) != 0 { + // When no sequences, there should not be any more data... + if debugDecoder { + printf("prepareSequences: 0 sequences, but %d byte(s) left on stream\n", len(in)) + } + return ErrUnexpectedBlockSize + } + + var seqs = &hist.decoders + seqs.nSeqs = nSeqs + if nSeqs > 0 { + if len(in) < 1 { + return ErrBlockTooSmall + } + br := byteReader{b: in, off: 0} + compMode := br.Uint8() + br.advance(1) + if debugDecoder { + printf("Compression modes: 0b%b", compMode) + } + if compMode&3 != 0 { + return errors.New("corrupt block: reserved bits not zero") + } + for i := uint(0); i < 3; i++ { + mode := seqCompMode((compMode >> (6 - i*2)) & 3) + if debugDecoder { + println("Table", tableIndex(i), "is", mode) + } + var seq *sequenceDec + switch tableIndex(i) { + case tableLiteralLengths: + seq = &seqs.litLengths + case tableOffsets: + seq = &seqs.offsets + case tableMatchLengths: + seq = &seqs.matchLengths + default: + panic("unknown table") + } + switch mode { + case compModePredefined: + if seq.fse != nil && !seq.fse.preDefined { + fseDecoderPool.Put(seq.fse) + } + seq.fse = &fsePredef[i] + case compModeRLE: + if br.remain() < 1 { + return ErrBlockTooSmall + } + v := br.Uint8() + br.advance(1) + if seq.fse == nil || seq.fse.preDefined { + seq.fse = fseDecoderPool.Get().(*fseDecoder) + } + symb, err := decSymbolValue(v, symbolTableX[i]) + if err != nil { + printf("RLE Transform table (%v) error: %v", tableIndex(i), err) + return err + } + seq.fse.setRLE(symb) + if debugDecoder { + printf("RLE set to 0x%x, code: %v", symb, v) + } + case compModeFSE: + println("Reading table for", tableIndex(i)) + if seq.fse == nil || seq.fse.preDefined { + seq.fse = fseDecoderPool.Get().(*fseDecoder) + } + err := seq.fse.readNCount(&br, uint16(maxTableSymbol[i])) + if err != nil { + println("Read table error:", err) + return err + } + err = seq.fse.transform(symbolTableX[i]) + if err != nil { + println("Transform table error:", err) + return err + } + if debugDecoder { + println("Read table ok", "symbolLen:", seq.fse.symbolLen) + } + case compModeRepeat: + seq.repeat = true + } + if br.overread() { + return io.ErrUnexpectedEOF + } + } + in = br.unread() + } + if debugDecoder { + println("Literals:", len(seqs.literals), "hash:", xxhash.Sum64(seqs.literals), "and", seqs.nSeqs, "sequences.") + } + + if nSeqs == 0 { + if len(b.sequence) > 0 { + b.sequence = b.sequence[:0] + } + return nil + } + br := seqs.br + if br == nil { + br = &bitReader{} + } + if err := br.init(in); err != nil { + return err + } + + if err := seqs.initialize(br, hist, b.dst); err != nil { + println("initializing sequences:", err) + return err + } + // Extract blocks... + if false && hist.dict == nil { + fatalErr := func(err error) { + if err != nil { + panic(err) + } + } + fn := fmt.Sprintf("n-%d-lits-%d-prev-%d-%d-%d-win-%d.blk", hist.decoders.nSeqs, len(hist.decoders.literals), hist.recentOffsets[0], hist.recentOffsets[1], hist.recentOffsets[2], hist.windowSize) + var buf bytes.Buffer + fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.litLengths.fse)) + fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.matchLengths.fse)) + fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.offsets.fse)) + buf.Write(in) + os.WriteFile(filepath.Join("testdata", "seqs", fn), buf.Bytes(), os.ModePerm) + } + + return nil +} + +func (b *blockDec) decodeSequences(hist *history) error { + if cap(b.sequence) < hist.decoders.nSeqs { + if b.lowMem { + b.sequence = make([]seqVals, 0, hist.decoders.nSeqs) + } else { + b.sequence = make([]seqVals, 0, 0x7F00+0xffff) + } + } + b.sequence = b.sequence[:hist.decoders.nSeqs] + if hist.decoders.nSeqs == 0 { + hist.decoders.seqSize = len(hist.decoders.literals) + return nil + } + hist.decoders.windowSize = hist.windowSize + hist.decoders.prevOffset = hist.recentOffsets + + err := hist.decoders.decode(b.sequence) + hist.recentOffsets = hist.decoders.prevOffset + return err +} + +func (b *blockDec) executeSequences(hist *history) error { + hbytes := hist.b + if len(hbytes) > hist.windowSize { + hbytes = hbytes[len(hbytes)-hist.windowSize:] + // We do not need history anymore. + if hist.dict != nil { + hist.dict.content = nil + } + } + hist.decoders.windowSize = hist.windowSize + hist.decoders.out = b.dst[:0] + err := hist.decoders.execute(b.sequence, hbytes) + if err != nil { + return err + } + return b.updateHistory(hist) +} + +func (b *blockDec) updateHistory(hist *history) error { + if len(b.data) > maxCompressedBlockSize { + return fmt.Errorf("compressed block size too large (%d)", len(b.data)) + } + // Set output and release references. + b.dst = hist.decoders.out + hist.recentOffsets = hist.decoders.prevOffset + + if b.Last { + // if last block we don't care about history. + println("Last block, no history returned") + hist.b = hist.b[:0] + return nil + } else { + hist.append(b.dst) + if debugDecoder { + println("Finished block with ", len(b.sequence), "sequences. Added", len(b.dst), "to history, now length", len(hist.b)) + } + } + hist.decoders.out, hist.decoders.literals = nil, nil + + return nil +} diff --git a/vendor/github.com/klauspost/compress/zstd/blockenc.go b/vendor/github.com/klauspost/compress/zstd/blockenc.go new file mode 100644 index 0000000000..32a7f401d5 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/blockenc.go @@ -0,0 +1,909 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "errors" + "fmt" + "math" + "math/bits" + + "github.com/klauspost/compress/huff0" +) + +type blockEnc struct { + size int + literals []byte + sequences []seq + coders seqCoders + litEnc *huff0.Scratch + dictLitEnc *huff0.Scratch + wr bitWriter + + extraLits int + output []byte + recentOffsets [3]uint32 + prevRecentOffsets [3]uint32 + + last bool + lowMem bool +} + +// init should be used once the block has been created. +// If called more than once, the effect is the same as calling reset. +func (b *blockEnc) init() { + if b.lowMem { + // 1K literals + if cap(b.literals) < 1<<10 { + b.literals = make([]byte, 0, 1<<10) + } + const defSeqs = 20 + if cap(b.sequences) < defSeqs { + b.sequences = make([]seq, 0, defSeqs) + } + // 1K + if cap(b.output) < 1<<10 { + b.output = make([]byte, 0, 1<<10) + } + } else { + if cap(b.literals) < maxCompressedBlockSize { + b.literals = make([]byte, 0, maxCompressedBlockSize) + } + const defSeqs = 2000 + if cap(b.sequences) < defSeqs { + b.sequences = make([]seq, 0, defSeqs) + } + if cap(b.output) < maxCompressedBlockSize { + b.output = make([]byte, 0, maxCompressedBlockSize) + } + } + + if b.coders.mlEnc == nil { + b.coders.mlEnc = &fseEncoder{} + b.coders.mlPrev = &fseEncoder{} + b.coders.ofEnc = &fseEncoder{} + b.coders.ofPrev = &fseEncoder{} + b.coders.llEnc = &fseEncoder{} + b.coders.llPrev = &fseEncoder{} + } + b.litEnc = &huff0.Scratch{WantLogLess: 4} + b.reset(nil) +} + +// initNewEncode can be used to reset offsets and encoders to the initial state. +func (b *blockEnc) initNewEncode() { + b.recentOffsets = [3]uint32{1, 4, 8} + b.litEnc.Reuse = huff0.ReusePolicyNone + b.coders.setPrev(nil, nil, nil) +} + +// reset will reset the block for a new encode, but in the same stream, +// meaning that state will be carried over, but the block content is reset. +// If a previous block is provided, the recent offsets are carried over. +func (b *blockEnc) reset(prev *blockEnc) { + b.extraLits = 0 + b.literals = b.literals[:0] + b.size = 0 + b.sequences = b.sequences[:0] + b.output = b.output[:0] + b.last = false + if prev != nil { + b.recentOffsets = prev.prevRecentOffsets + } + b.dictLitEnc = nil +} + +// reset will reset the block for a new encode, but in the same stream, +// meaning that state will be carried over, but the block content is reset. +// If a previous block is provided, the recent offsets are carried over. +func (b *blockEnc) swapEncoders(prev *blockEnc) { + b.coders.swap(&prev.coders) + b.litEnc, prev.litEnc = prev.litEnc, b.litEnc +} + +// blockHeader contains the information for a block header. +type blockHeader uint32 + +// setLast sets the 'last' indicator on a block. +func (h *blockHeader) setLast(b bool) { + if b { + *h = *h | 1 + } else { + const mask = (1 << 24) - 2 + *h = *h & mask + } +} + +// setSize will store the compressed size of a block. +func (h *blockHeader) setSize(v uint32) { + const mask = 7 + *h = (*h)&mask | blockHeader(v<<3) +} + +// setType sets the block type. +func (h *blockHeader) setType(t blockType) { + const mask = 1 | (((1 << 24) - 1) ^ 7) + *h = (*h & mask) | blockHeader(t<<1) +} + +// appendTo will append the block header to a slice. +func (h blockHeader) appendTo(b []byte) []byte { + return append(b, uint8(h), uint8(h>>8), uint8(h>>16)) +} + +// String returns a string representation of the block. +func (h blockHeader) String() string { + return fmt.Sprintf("Type: %d, Size: %d, Last:%t", (h>>1)&3, h>>3, h&1 == 1) +} + +// literalsHeader contains literals header information. +type literalsHeader uint64 + +// setType can be used to set the type of literal block. +func (h *literalsHeader) setType(t literalsBlockType) { + const mask = math.MaxUint64 - 3 + *h = (*h & mask) | literalsHeader(t) +} + +// setSize can be used to set a single size, for uncompressed and RLE content. +func (h *literalsHeader) setSize(regenLen int) { + inBits := bits.Len32(uint32(regenLen)) + // Only retain 2 bits + const mask = 3 + lh := uint64(*h & mask) + switch { + case inBits < 5: + lh |= (uint64(regenLen) << 3) | (1 << 60) + if debugEncoder { + got := int(lh>>3) & 0xff + if got != regenLen { + panic(fmt.Sprint("litRegenSize = ", regenLen, "(want) != ", got, "(got)")) + } + } + case inBits < 12: + lh |= (1 << 2) | (uint64(regenLen) << 4) | (2 << 60) + case inBits < 20: + lh |= (3 << 2) | (uint64(regenLen) << 4) | (3 << 60) + default: + panic(fmt.Errorf("internal error: block too big (%d)", regenLen)) + } + *h = literalsHeader(lh) +} + +// setSizes will set the size of a compressed literals section and the input length. +func (h *literalsHeader) setSizes(compLen, inLen int, single bool) { + compBits, inBits := bits.Len32(uint32(compLen)), bits.Len32(uint32(inLen)) + // Only retain 2 bits + const mask = 3 + lh := uint64(*h & mask) + switch { + case compBits <= 10 && inBits <= 10: + if !single { + lh |= 1 << 2 + } + lh |= (uint64(inLen) << 4) | (uint64(compLen) << (10 + 4)) | (3 << 60) + if debugEncoder { + const mmask = (1 << 24) - 1 + n := (lh >> 4) & mmask + if int(n&1023) != inLen { + panic(fmt.Sprint("regensize:", int(n&1023), "!=", inLen, inBits)) + } + if int(n>>10) != compLen { + panic(fmt.Sprint("compsize:", int(n>>10), "!=", compLen, compBits)) + } + } + case compBits <= 14 && inBits <= 14: + lh |= (2 << 2) | (uint64(inLen) << 4) | (uint64(compLen) << (14 + 4)) | (4 << 60) + if single { + panic("single stream used with more than 10 bits length.") + } + case compBits <= 18 && inBits <= 18: + lh |= (3 << 2) | (uint64(inLen) << 4) | (uint64(compLen) << (18 + 4)) | (5 << 60) + if single { + panic("single stream used with more than 10 bits length.") + } + default: + panic("internal error: block too big") + } + *h = literalsHeader(lh) +} + +// appendTo will append the literals header to a byte slice. +func (h literalsHeader) appendTo(b []byte) []byte { + size := uint8(h >> 60) + switch size { + case 1: + b = append(b, uint8(h)) + case 2: + b = append(b, uint8(h), uint8(h>>8)) + case 3: + b = append(b, uint8(h), uint8(h>>8), uint8(h>>16)) + case 4: + b = append(b, uint8(h), uint8(h>>8), uint8(h>>16), uint8(h>>24)) + case 5: + b = append(b, uint8(h), uint8(h>>8), uint8(h>>16), uint8(h>>24), uint8(h>>32)) + default: + panic(fmt.Errorf("internal error: literalsHeader has invalid size (%d)", size)) + } + return b +} + +// size returns the output size with currently set values. +func (h literalsHeader) size() int { + return int(h >> 60) +} + +func (h literalsHeader) String() string { + return fmt.Sprintf("Type: %d, SizeFormat: %d, Size: 0x%d, Bytes:%d", literalsBlockType(h&3), (h>>2)&3, h&((1<<60)-1)>>4, h>>60) +} + +// pushOffsets will push the recent offsets to the backup store. +func (b *blockEnc) pushOffsets() { + b.prevRecentOffsets = b.recentOffsets +} + +// pushOffsets will push the recent offsets to the backup store. +func (b *blockEnc) popOffsets() { + b.recentOffsets = b.prevRecentOffsets +} + +// matchOffset will adjust recent offsets and return the adjusted one, +// if it matches a previous offset. +func (b *blockEnc) matchOffset(offset, lits uint32) uint32 { + // Check if offset is one of the recent offsets. + // Adjusts the output offset accordingly. + // Gives a tiny bit of compression, typically around 1%. + if true { + if lits > 0 { + switch offset { + case b.recentOffsets[0]: + offset = 1 + case b.recentOffsets[1]: + b.recentOffsets[1] = b.recentOffsets[0] + b.recentOffsets[0] = offset + offset = 2 + case b.recentOffsets[2]: + b.recentOffsets[2] = b.recentOffsets[1] + b.recentOffsets[1] = b.recentOffsets[0] + b.recentOffsets[0] = offset + offset = 3 + default: + b.recentOffsets[2] = b.recentOffsets[1] + b.recentOffsets[1] = b.recentOffsets[0] + b.recentOffsets[0] = offset + offset += 3 + } + } else { + switch offset { + case b.recentOffsets[1]: + b.recentOffsets[1] = b.recentOffsets[0] + b.recentOffsets[0] = offset + offset = 1 + case b.recentOffsets[2]: + b.recentOffsets[2] = b.recentOffsets[1] + b.recentOffsets[1] = b.recentOffsets[0] + b.recentOffsets[0] = offset + offset = 2 + case b.recentOffsets[0] - 1: + b.recentOffsets[2] = b.recentOffsets[1] + b.recentOffsets[1] = b.recentOffsets[0] + b.recentOffsets[0] = offset + offset = 3 + default: + b.recentOffsets[2] = b.recentOffsets[1] + b.recentOffsets[1] = b.recentOffsets[0] + b.recentOffsets[0] = offset + offset += 3 + } + } + } else { + offset += 3 + } + return offset +} + +// encodeRaw can be used to set the output to a raw representation of supplied bytes. +func (b *blockEnc) encodeRaw(a []byte) { + var bh blockHeader + bh.setLast(b.last) + bh.setSize(uint32(len(a))) + bh.setType(blockTypeRaw) + b.output = bh.appendTo(b.output[:0]) + b.output = append(b.output, a...) + if debugEncoder { + println("Adding RAW block, length", len(a), "last:", b.last) + } +} + +// encodeRaw can be used to set the output to a raw representation of supplied bytes. +func (b *blockEnc) encodeRawTo(dst, src []byte) []byte { + var bh blockHeader + bh.setLast(b.last) + bh.setSize(uint32(len(src))) + bh.setType(blockTypeRaw) + dst = bh.appendTo(dst) + dst = append(dst, src...) + if debugEncoder { + println("Adding RAW block, length", len(src), "last:", b.last) + } + return dst +} + +// encodeLits can be used if the block is only litLen. +func (b *blockEnc) encodeLits(lits []byte, raw bool) error { + var bh blockHeader + bh.setLast(b.last) + bh.setSize(uint32(len(lits))) + + // Don't compress extremely small blocks + if len(lits) < 8 || (len(lits) < 32 && b.dictLitEnc == nil) || raw { + if debugEncoder { + println("Adding RAW block, length", len(lits), "last:", b.last) + } + bh.setType(blockTypeRaw) + b.output = bh.appendTo(b.output) + b.output = append(b.output, lits...) + return nil + } + + var ( + out []byte + reUsed, single bool + err error + ) + if b.dictLitEnc != nil { + b.litEnc.TransferCTable(b.dictLitEnc) + b.litEnc.Reuse = huff0.ReusePolicyAllow + b.dictLitEnc = nil + } + if len(lits) >= 1024 { + // Use 4 Streams. + out, reUsed, err = huff0.Compress4X(lits, b.litEnc) + } else if len(lits) > 16 { + // Use 1 stream + single = true + out, reUsed, err = huff0.Compress1X(lits, b.litEnc) + } else { + err = huff0.ErrIncompressible + } + if err == nil && len(out)+5 > len(lits) { + // If we are close, we may still be worse or equal to raw. + var lh literalsHeader + lh.setSizes(len(out), len(lits), single) + if len(out)+lh.size() >= len(lits) { + err = huff0.ErrIncompressible + } + } + switch err { + case huff0.ErrIncompressible: + if debugEncoder { + println("Adding RAW block, length", len(lits), "last:", b.last) + } + bh.setType(blockTypeRaw) + b.output = bh.appendTo(b.output) + b.output = append(b.output, lits...) + return nil + case huff0.ErrUseRLE: + if debugEncoder { + println("Adding RLE block, length", len(lits)) + } + bh.setType(blockTypeRLE) + b.output = bh.appendTo(b.output) + b.output = append(b.output, lits[0]) + return nil + case nil: + default: + return err + } + // Compressed... + // Now, allow reuse + b.litEnc.Reuse = huff0.ReusePolicyAllow + bh.setType(blockTypeCompressed) + var lh literalsHeader + if reUsed { + if debugEncoder { + println("Reused tree, compressed to", len(out)) + } + lh.setType(literalsBlockTreeless) + } else { + if debugEncoder { + println("New tree, compressed to", len(out), "tree size:", len(b.litEnc.OutTable)) + } + lh.setType(literalsBlockCompressed) + } + // Set sizes + lh.setSizes(len(out), len(lits), single) + bh.setSize(uint32(len(out) + lh.size() + 1)) + + // Write block headers. + b.output = bh.appendTo(b.output) + b.output = lh.appendTo(b.output) + // Add compressed data. + b.output = append(b.output, out...) + // No sequences. + b.output = append(b.output, 0) + return nil +} + +// encodeRLE will encode an RLE block. +func (b *blockEnc) encodeRLE(val byte, length uint32) { + var bh blockHeader + bh.setLast(b.last) + bh.setSize(length) + bh.setType(blockTypeRLE) + b.output = bh.appendTo(b.output) + b.output = append(b.output, val) +} + +// fuzzFseEncoder can be used to fuzz the FSE encoder. +func fuzzFseEncoder(data []byte) int { + if len(data) > maxSequences || len(data) < 2 { + return 0 + } + enc := fseEncoder{} + hist := enc.Histogram() + maxSym := uint8(0) + for i, v := range data { + v = v & 63 + data[i] = v + hist[v]++ + if v > maxSym { + maxSym = v + } + } + if maxSym == 0 { + // All 0 + return 0 + } + maxCount := func(a []uint32) int { + var max uint32 + for _, v := range a { + if v > max { + max = v + } + } + return int(max) + } + cnt := maxCount(hist[:maxSym]) + if cnt == len(data) { + // RLE + return 0 + } + enc.HistogramFinished(maxSym, cnt) + err := enc.normalizeCount(len(data)) + if err != nil { + return 0 + } + _, err = enc.writeCount(nil) + if err != nil { + panic(err) + } + return 1 +} + +// encode will encode the block and append the output in b.output. +// Previous offset codes must be pushed if more blocks are expected. +func (b *blockEnc) encode(org []byte, raw, rawAllLits bool) error { + if len(b.sequences) == 0 { + return b.encodeLits(b.literals, rawAllLits) + } + if len(b.sequences) == 1 && len(org) > 0 && len(b.literals) <= 1 { + // Check common RLE cases. + seq := b.sequences[0] + if seq.litLen == uint32(len(b.literals)) && seq.offset-3 == 1 { + // Offset == 1 and 0 or 1 literals. + b.encodeRLE(org[0], b.sequences[0].matchLen+zstdMinMatch+seq.litLen) + return nil + } + } + + // We want some difference to at least account for the headers. + saved := b.size - len(b.literals) - (b.size >> 6) + if saved < 16 { + if org == nil { + return errIncompressible + } + b.popOffsets() + return b.encodeLits(org, rawAllLits) + } + + var bh blockHeader + var lh literalsHeader + bh.setLast(b.last) + bh.setType(blockTypeCompressed) + // Store offset of the block header. Needed when we know the size. + bhOffset := len(b.output) + b.output = bh.appendTo(b.output) + + var ( + out []byte + reUsed, single bool + err error + ) + if b.dictLitEnc != nil { + b.litEnc.TransferCTable(b.dictLitEnc) + b.litEnc.Reuse = huff0.ReusePolicyAllow + b.dictLitEnc = nil + } + if len(b.literals) >= 1024 && !raw { + // Use 4 Streams. + out, reUsed, err = huff0.Compress4X(b.literals, b.litEnc) + } else if len(b.literals) > 16 && !raw { + // Use 1 stream + single = true + out, reUsed, err = huff0.Compress1X(b.literals, b.litEnc) + } else { + err = huff0.ErrIncompressible + } + + if err == nil && len(out)+5 > len(b.literals) { + // If we are close, we may still be worse or equal to raw. + var lh literalsHeader + lh.setSize(len(b.literals)) + szRaw := lh.size() + lh.setSizes(len(out), len(b.literals), single) + szComp := lh.size() + if len(out)+szComp >= len(b.literals)+szRaw { + err = huff0.ErrIncompressible + } + } + switch err { + case huff0.ErrIncompressible: + lh.setType(literalsBlockRaw) + lh.setSize(len(b.literals)) + b.output = lh.appendTo(b.output) + b.output = append(b.output, b.literals...) + if debugEncoder { + println("Adding literals RAW, length", len(b.literals)) + } + case huff0.ErrUseRLE: + lh.setType(literalsBlockRLE) + lh.setSize(len(b.literals)) + b.output = lh.appendTo(b.output) + b.output = append(b.output, b.literals[0]) + if debugEncoder { + println("Adding literals RLE") + } + case nil: + // Compressed litLen... + if reUsed { + if debugEncoder { + println("reused tree") + } + lh.setType(literalsBlockTreeless) + } else { + if debugEncoder { + println("new tree, size:", len(b.litEnc.OutTable)) + } + lh.setType(literalsBlockCompressed) + if debugEncoder { + _, _, err := huff0.ReadTable(out, nil) + if err != nil { + panic(err) + } + } + } + lh.setSizes(len(out), len(b.literals), single) + if debugEncoder { + printf("Compressed %d literals to %d bytes", len(b.literals), len(out)) + println("Adding literal header:", lh) + } + b.output = lh.appendTo(b.output) + b.output = append(b.output, out...) + b.litEnc.Reuse = huff0.ReusePolicyAllow + if debugEncoder { + println("Adding literals compressed") + } + default: + if debugEncoder { + println("Adding literals ERROR:", err) + } + return err + } + // Sequence compression + + // Write the number of sequences + switch { + case len(b.sequences) < 128: + b.output = append(b.output, uint8(len(b.sequences))) + case len(b.sequences) < 0x7f00: // TODO: this could be wrong + n := len(b.sequences) + b.output = append(b.output, 128+uint8(n>>8), uint8(n)) + default: + n := len(b.sequences) - 0x7f00 + b.output = append(b.output, 255, uint8(n), uint8(n>>8)) + } + if debugEncoder { + println("Encoding", len(b.sequences), "sequences") + } + b.genCodes() + llEnc := b.coders.llEnc + ofEnc := b.coders.ofEnc + mlEnc := b.coders.mlEnc + err = llEnc.normalizeCount(len(b.sequences)) + if err != nil { + return err + } + err = ofEnc.normalizeCount(len(b.sequences)) + if err != nil { + return err + } + err = mlEnc.normalizeCount(len(b.sequences)) + if err != nil { + return err + } + + // Choose the best compression mode for each type. + // Will evaluate the new vs predefined and previous. + chooseComp := func(cur, prev, preDef *fseEncoder) (*fseEncoder, seqCompMode) { + // See if predefined/previous is better + hist := cur.count[:cur.symbolLen] + nSize := cur.approxSize(hist) + cur.maxHeaderSize() + predefSize := preDef.approxSize(hist) + prevSize := prev.approxSize(hist) + + // Add a small penalty for new encoders. + // Don't bother with extremely small (<2 byte gains). + nSize = nSize + (nSize+2*8*16)>>4 + switch { + case predefSize <= prevSize && predefSize <= nSize || forcePreDef: + if debugEncoder { + println("Using predefined", predefSize>>3, "<=", nSize>>3) + } + return preDef, compModePredefined + case prevSize <= nSize: + if debugEncoder { + println("Using previous", prevSize>>3, "<=", nSize>>3) + } + return prev, compModeRepeat + default: + if debugEncoder { + println("Using new, predef", predefSize>>3, ". previous:", prevSize>>3, ">", nSize>>3, "header max:", cur.maxHeaderSize()>>3, "bytes") + println("tl:", cur.actualTableLog, "symbolLen:", cur.symbolLen, "norm:", cur.norm[:cur.symbolLen], "hist", cur.count[:cur.symbolLen]) + } + return cur, compModeFSE + } + } + + // Write compression mode + var mode uint8 + if llEnc.useRLE { + mode |= uint8(compModeRLE) << 6 + llEnc.setRLE(b.sequences[0].llCode) + if debugEncoder { + println("llEnc.useRLE") + } + } else { + var m seqCompMode + llEnc, m = chooseComp(llEnc, b.coders.llPrev, &fsePredefEnc[tableLiteralLengths]) + mode |= uint8(m) << 6 + } + if ofEnc.useRLE { + mode |= uint8(compModeRLE) << 4 + ofEnc.setRLE(b.sequences[0].ofCode) + if debugEncoder { + println("ofEnc.useRLE") + } + } else { + var m seqCompMode + ofEnc, m = chooseComp(ofEnc, b.coders.ofPrev, &fsePredefEnc[tableOffsets]) + mode |= uint8(m) << 4 + } + + if mlEnc.useRLE { + mode |= uint8(compModeRLE) << 2 + mlEnc.setRLE(b.sequences[0].mlCode) + if debugEncoder { + println("mlEnc.useRLE, code: ", b.sequences[0].mlCode, "value", b.sequences[0].matchLen) + } + } else { + var m seqCompMode + mlEnc, m = chooseComp(mlEnc, b.coders.mlPrev, &fsePredefEnc[tableMatchLengths]) + mode |= uint8(m) << 2 + } + b.output = append(b.output, mode) + if debugEncoder { + printf("Compression modes: 0b%b", mode) + } + b.output, err = llEnc.writeCount(b.output) + if err != nil { + return err + } + start := len(b.output) + b.output, err = ofEnc.writeCount(b.output) + if err != nil { + return err + } + if false { + println("block:", b.output[start:], "tablelog", ofEnc.actualTableLog, "maxcount:", ofEnc.maxCount) + fmt.Printf("selected TableLog: %d, Symbol length: %d\n", ofEnc.actualTableLog, ofEnc.symbolLen) + for i, v := range ofEnc.norm[:ofEnc.symbolLen] { + fmt.Printf("%3d: %5d -> %4d \n", i, ofEnc.count[i], v) + } + } + b.output, err = mlEnc.writeCount(b.output) + if err != nil { + return err + } + + // Maybe in block? + wr := &b.wr + wr.reset(b.output) + + var ll, of, ml cState + + // Current sequence + seq := len(b.sequences) - 1 + s := b.sequences[seq] + llEnc.setBits(llBitsTable[:]) + mlEnc.setBits(mlBitsTable[:]) + ofEnc.setBits(nil) + + llTT, ofTT, mlTT := llEnc.ct.symbolTT[:256], ofEnc.ct.symbolTT[:256], mlEnc.ct.symbolTT[:256] + + // We have 3 bounds checks here (and in the loop). + // Since we are iterating backwards it is kinda hard to avoid. + llB, ofB, mlB := llTT[s.llCode], ofTT[s.ofCode], mlTT[s.mlCode] + ll.init(wr, &llEnc.ct, llB) + of.init(wr, &ofEnc.ct, ofB) + wr.flush32() + ml.init(wr, &mlEnc.ct, mlB) + + // Each of these lookups also generates a bounds check. + wr.addBits32NC(s.litLen, llB.outBits) + wr.addBits32NC(s.matchLen, mlB.outBits) + wr.flush32() + wr.addBits32NC(s.offset, ofB.outBits) + if debugSequences { + println("Encoded seq", seq, s, "codes:", s.llCode, s.mlCode, s.ofCode, "states:", ll.state, ml.state, of.state, "bits:", llB, mlB, ofB) + } + seq-- + // Store sequences in reverse... + for seq >= 0 { + s = b.sequences[seq] + + ofB := ofTT[s.ofCode] + wr.flush32() // tablelog max is below 8 for each, so it will fill max 24 bits. + //of.encode(ofB) + nbBitsOut := (uint32(of.state) + ofB.deltaNbBits) >> 16 + dstState := int32(of.state>>(nbBitsOut&15)) + int32(ofB.deltaFindState) + wr.addBits16NC(of.state, uint8(nbBitsOut)) + of.state = of.stateTable[dstState] + + // Accumulate extra bits. + outBits := ofB.outBits & 31 + extraBits := uint64(s.offset & bitMask32[outBits]) + extraBitsN := outBits + + mlB := mlTT[s.mlCode] + //ml.encode(mlB) + nbBitsOut = (uint32(ml.state) + mlB.deltaNbBits) >> 16 + dstState = int32(ml.state>>(nbBitsOut&15)) + int32(mlB.deltaFindState) + wr.addBits16NC(ml.state, uint8(nbBitsOut)) + ml.state = ml.stateTable[dstState] + + outBits = mlB.outBits & 31 + extraBits = extraBits<> 16 + dstState = int32(ll.state>>(nbBitsOut&15)) + int32(llB.deltaFindState) + wr.addBits16NC(ll.state, uint8(nbBitsOut)) + ll.state = ll.stateTable[dstState] + + outBits = llB.outBits & 31 + extraBits = extraBits<= b.size { + // Discard and encode as raw block. + b.output = b.encodeRawTo(b.output[:bhOffset], org) + b.popOffsets() + b.litEnc.Reuse = huff0.ReusePolicyNone + return nil + } + + // Size is output minus block header. + bh.setSize(uint32(len(b.output)-bhOffset) - 3) + if debugEncoder { + println("Rewriting block header", bh) + } + _ = bh.appendTo(b.output[bhOffset:bhOffset]) + b.coders.setPrev(llEnc, mlEnc, ofEnc) + return nil +} + +var errIncompressible = errors.New("incompressible") + +func (b *blockEnc) genCodes() { + if len(b.sequences) == 0 { + // nothing to do + return + } + if len(b.sequences) > math.MaxUint16 { + panic("can only encode up to 64K sequences") + } + // No bounds checks after here: + llH := b.coders.llEnc.Histogram() + ofH := b.coders.ofEnc.Histogram() + mlH := b.coders.mlEnc.Histogram() + for i := range llH { + llH[i] = 0 + } + for i := range ofH { + ofH[i] = 0 + } + for i := range mlH { + mlH[i] = 0 + } + + var llMax, ofMax, mlMax uint8 + for i := range b.sequences { + seq := &b.sequences[i] + v := llCode(seq.litLen) + seq.llCode = v + llH[v]++ + if v > llMax { + llMax = v + } + + v = ofCode(seq.offset) + seq.ofCode = v + ofH[v]++ + if v > ofMax { + ofMax = v + } + + v = mlCode(seq.matchLen) + seq.mlCode = v + mlH[v]++ + if v > mlMax { + mlMax = v + if debugAsserts && mlMax > maxMatchLengthSymbol { + panic(fmt.Errorf("mlMax > maxMatchLengthSymbol (%d), matchlen: %d", mlMax, seq.matchLen)) + } + } + } + maxCount := func(a []uint32) int { + var max uint32 + for _, v := range a { + if v > max { + max = v + } + } + return int(max) + } + if debugAsserts && mlMax > maxMatchLengthSymbol { + panic(fmt.Errorf("mlMax > maxMatchLengthSymbol (%d)", mlMax)) + } + if debugAsserts && ofMax > maxOffsetBits { + panic(fmt.Errorf("ofMax > maxOffsetBits (%d)", ofMax)) + } + if debugAsserts && llMax > maxLiteralLengthSymbol { + panic(fmt.Errorf("llMax > maxLiteralLengthSymbol (%d)", llMax)) + } + + b.coders.mlEnc.HistogramFinished(mlMax, maxCount(mlH[:mlMax+1])) + b.coders.ofEnc.HistogramFinished(ofMax, maxCount(ofH[:ofMax+1])) + b.coders.llEnc.HistogramFinished(llMax, maxCount(llH[:llMax+1])) +} diff --git a/vendor/github.com/klauspost/compress/zstd/blocktype_string.go b/vendor/github.com/klauspost/compress/zstd/blocktype_string.go new file mode 100644 index 0000000000..01a01e486e --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/blocktype_string.go @@ -0,0 +1,85 @@ +// Code generated by "stringer -type=blockType,literalsBlockType,seqCompMode,tableIndex"; DO NOT EDIT. + +package zstd + +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[blockTypeRaw-0] + _ = x[blockTypeRLE-1] + _ = x[blockTypeCompressed-2] + _ = x[blockTypeReserved-3] +} + +const _blockType_name = "blockTypeRawblockTypeRLEblockTypeCompressedblockTypeReserved" + +var _blockType_index = [...]uint8{0, 12, 24, 43, 60} + +func (i blockType) String() string { + if i >= blockType(len(_blockType_index)-1) { + return "blockType(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _blockType_name[_blockType_index[i]:_blockType_index[i+1]] +} +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[literalsBlockRaw-0] + _ = x[literalsBlockRLE-1] + _ = x[literalsBlockCompressed-2] + _ = x[literalsBlockTreeless-3] +} + +const _literalsBlockType_name = "literalsBlockRawliteralsBlockRLEliteralsBlockCompressedliteralsBlockTreeless" + +var _literalsBlockType_index = [...]uint8{0, 16, 32, 55, 76} + +func (i literalsBlockType) String() string { + if i >= literalsBlockType(len(_literalsBlockType_index)-1) { + return "literalsBlockType(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _literalsBlockType_name[_literalsBlockType_index[i]:_literalsBlockType_index[i+1]] +} +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[compModePredefined-0] + _ = x[compModeRLE-1] + _ = x[compModeFSE-2] + _ = x[compModeRepeat-3] +} + +const _seqCompMode_name = "compModePredefinedcompModeRLEcompModeFSEcompModeRepeat" + +var _seqCompMode_index = [...]uint8{0, 18, 29, 40, 54} + +func (i seqCompMode) String() string { + if i >= seqCompMode(len(_seqCompMode_index)-1) { + return "seqCompMode(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _seqCompMode_name[_seqCompMode_index[i]:_seqCompMode_index[i+1]] +} +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[tableLiteralLengths-0] + _ = x[tableOffsets-1] + _ = x[tableMatchLengths-2] +} + +const _tableIndex_name = "tableLiteralLengthstableOffsetstableMatchLengths" + +var _tableIndex_index = [...]uint8{0, 19, 31, 48} + +func (i tableIndex) String() string { + if i >= tableIndex(len(_tableIndex_index)-1) { + return "tableIndex(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _tableIndex_name[_tableIndex_index[i]:_tableIndex_index[i+1]] +} diff --git a/vendor/github.com/klauspost/compress/zstd/bytebuf.go b/vendor/github.com/klauspost/compress/zstd/bytebuf.go new file mode 100644 index 0000000000..55a388553d --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/bytebuf.go @@ -0,0 +1,131 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "fmt" + "io" +) + +type byteBuffer interface { + // Read up to 8 bytes. + // Returns io.ErrUnexpectedEOF if this cannot be satisfied. + readSmall(n int) ([]byte, error) + + // Read >8 bytes. + // MAY use the destination slice. + readBig(n int, dst []byte) ([]byte, error) + + // Read a single byte. + readByte() (byte, error) + + // Skip n bytes. + skipN(n int64) error +} + +// in-memory buffer +type byteBuf []byte + +func (b *byteBuf) readSmall(n int) ([]byte, error) { + if debugAsserts && n > 8 { + panic(fmt.Errorf("small read > 8 (%d). use readBig", n)) + } + bb := *b + if len(bb) < n { + return nil, io.ErrUnexpectedEOF + } + r := bb[:n] + *b = bb[n:] + return r, nil +} + +func (b *byteBuf) readBig(n int, dst []byte) ([]byte, error) { + bb := *b + if len(bb) < n { + return nil, io.ErrUnexpectedEOF + } + r := bb[:n] + *b = bb[n:] + return r, nil +} + +func (b *byteBuf) readByte() (byte, error) { + bb := *b + if len(bb) < 1 { + return 0, io.ErrUnexpectedEOF + } + r := bb[0] + *b = bb[1:] + return r, nil +} + +func (b *byteBuf) skipN(n int64) error { + bb := *b + if n < 0 { + return fmt.Errorf("negative skip (%d) requested", n) + } + if int64(len(bb)) < n { + return io.ErrUnexpectedEOF + } + *b = bb[n:] + return nil +} + +// wrapper around a reader. +type readerWrapper struct { + r io.Reader + tmp [8]byte +} + +func (r *readerWrapper) readSmall(n int) ([]byte, error) { + if debugAsserts && n > 8 { + panic(fmt.Errorf("small read > 8 (%d). use readBig", n)) + } + n2, err := io.ReadFull(r.r, r.tmp[:n]) + // We only really care about the actual bytes read. + if err != nil { + if err == io.EOF { + return nil, io.ErrUnexpectedEOF + } + if debugDecoder { + println("readSmall: got", n2, "want", n, "err", err) + } + return nil, err + } + return r.tmp[:n], nil +} + +func (r *readerWrapper) readBig(n int, dst []byte) ([]byte, error) { + if cap(dst) < n { + dst = make([]byte, n) + } + n2, err := io.ReadFull(r.r, dst[:n]) + if err == io.EOF && n > 0 { + err = io.ErrUnexpectedEOF + } + return dst[:n2], err +} + +func (r *readerWrapper) readByte() (byte, error) { + n2, err := io.ReadFull(r.r, r.tmp[:1]) + if err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + return 0, err + } + if n2 != 1 { + return 0, io.ErrUnexpectedEOF + } + return r.tmp[0], nil +} + +func (r *readerWrapper) skipN(n int64) error { + n2, err := io.CopyN(io.Discard, r.r, n) + if n2 != n { + err = io.ErrUnexpectedEOF + } + return err +} diff --git a/vendor/github.com/klauspost/compress/zstd/bytereader.go b/vendor/github.com/klauspost/compress/zstd/bytereader.go new file mode 100644 index 0000000000..0e59a242d8 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/bytereader.go @@ -0,0 +1,82 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +// byteReader provides a byte reader that reads +// little endian values from a byte stream. +// The input stream is manually advanced. +// The reader performs no bounds checks. +type byteReader struct { + b []byte + off int +} + +// advance the stream b n bytes. +func (b *byteReader) advance(n uint) { + b.off += int(n) +} + +// overread returns whether we have advanced too far. +func (b *byteReader) overread() bool { + return b.off > len(b.b) +} + +// Int32 returns a little endian int32 starting at current offset. +func (b byteReader) Int32() int32 { + b2 := b.b[b.off:] + b2 = b2[:4] + v3 := int32(b2[3]) + v2 := int32(b2[2]) + v1 := int32(b2[1]) + v0 := int32(b2[0]) + return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24) +} + +// Uint8 returns the next byte +func (b *byteReader) Uint8() uint8 { + v := b.b[b.off] + return v +} + +// Uint32 returns a little endian uint32 starting at current offset. +func (b byteReader) Uint32() uint32 { + if r := b.remain(); r < 4 { + // Very rare + v := uint32(0) + for i := 1; i <= r; i++ { + v = (v << 8) | uint32(b.b[len(b.b)-i]) + } + return v + } + b2 := b.b[b.off:] + b2 = b2[:4] + v3 := uint32(b2[3]) + v2 := uint32(b2[2]) + v1 := uint32(b2[1]) + v0 := uint32(b2[0]) + return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24) +} + +// Uint32NC returns a little endian uint32 starting at current offset. +// The caller must be sure if there are at least 4 bytes left. +func (b byteReader) Uint32NC() uint32 { + b2 := b.b[b.off:] + b2 = b2[:4] + v3 := uint32(b2[3]) + v2 := uint32(b2[2]) + v1 := uint32(b2[1]) + v0 := uint32(b2[0]) + return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24) +} + +// unread returns the unread portion of the input. +func (b byteReader) unread() []byte { + return b.b[b.off:] +} + +// remain will return the number of bytes remaining. +func (b byteReader) remain() int { + return len(b.b) - b.off +} diff --git a/vendor/github.com/klauspost/compress/zstd/decodeheader.go b/vendor/github.com/klauspost/compress/zstd/decodeheader.go new file mode 100644 index 0000000000..6a5a2988b6 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/decodeheader.go @@ -0,0 +1,261 @@ +// Copyright 2020+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. + +package zstd + +import ( + "encoding/binary" + "errors" + "io" +) + +// HeaderMaxSize is the maximum size of a Frame and Block Header. +// If less is sent to Header.Decode it *may* still contain enough information. +const HeaderMaxSize = 14 + 3 + +// Header contains information about the first frame and block within that. +type Header struct { + // SingleSegment specifies whether the data is to be decompressed into a + // single contiguous memory segment. + // It implies that WindowSize is invalid and that FrameContentSize is valid. + SingleSegment bool + + // WindowSize is the window of data to keep while decoding. + // Will only be set if SingleSegment is false. + WindowSize uint64 + + // Dictionary ID. + // If 0, no dictionary. + DictionaryID uint32 + + // HasFCS specifies whether FrameContentSize has a valid value. + HasFCS bool + + // FrameContentSize is the expected uncompressed size of the entire frame. + FrameContentSize uint64 + + // Skippable will be true if the frame is meant to be skipped. + // This implies that FirstBlock.OK is false. + Skippable bool + + // SkippableID is the user-specific ID for the skippable frame. + // Valid values are between 0 to 15, inclusive. + SkippableID int + + // SkippableSize is the length of the user data to skip following + // the header. + SkippableSize uint32 + + // HeaderSize is the raw size of the frame header. + // + // For normal frames, it includes the size of the magic number and + // the size of the header (per section 3.1.1.1). + // It does not include the size for any data blocks (section 3.1.1.2) nor + // the size for the trailing content checksum. + // + // For skippable frames, this counts the size of the magic number + // along with the size of the size field of the payload. + // It does not include the size of the skippable payload itself. + // The total frame size is the HeaderSize plus the SkippableSize. + HeaderSize int + + // First block information. + FirstBlock struct { + // OK will be set if first block could be decoded. + OK bool + + // Is this the last block of a frame? + Last bool + + // Is the data compressed? + // If true CompressedSize will be populated. + // Unfortunately DecompressedSize cannot be determined + // without decoding the blocks. + Compressed bool + + // DecompressedSize is the expected decompressed size of the block. + // Will be 0 if it cannot be determined. + DecompressedSize int + + // CompressedSize of the data in the block. + // Does not include the block header. + // Will be equal to DecompressedSize if not Compressed. + CompressedSize int + } + + // If set there is a checksum present for the block content. + // The checksum field at the end is always 4 bytes long. + HasCheckSum bool +} + +// Decode the header from the beginning of the stream. +// This will decode the frame header and the first block header if enough bytes are provided. +// It is recommended to provide at least HeaderMaxSize bytes. +// If the frame header cannot be read an error will be returned. +// If there isn't enough input, io.ErrUnexpectedEOF is returned. +// The FirstBlock.OK will indicate if enough information was available to decode the first block header. +func (h *Header) Decode(in []byte) error { + _, err := h.DecodeAndStrip(in) + return err +} + +// DecodeAndStrip will decode the header from the beginning of the stream +// and on success return the remaining bytes. +// This will decode the frame header and the first block header if enough bytes are provided. +// It is recommended to provide at least HeaderMaxSize bytes. +// If the frame header cannot be read an error will be returned. +// If there isn't enough input, io.ErrUnexpectedEOF is returned. +// The FirstBlock.OK will indicate if enough information was available to decode the first block header. +func (h *Header) DecodeAndStrip(in []byte) (remain []byte, err error) { + *h = Header{} + if len(in) < 4 { + return nil, io.ErrUnexpectedEOF + } + h.HeaderSize += 4 + b, in := in[:4], in[4:] + if string(b) != frameMagic { + if string(b[1:4]) != skippableFrameMagic || b[0]&0xf0 != 0x50 { + return nil, ErrMagicMismatch + } + if len(in) < 4 { + return nil, io.ErrUnexpectedEOF + } + h.HeaderSize += 4 + h.Skippable = true + h.SkippableID = int(b[0] & 0xf) + h.SkippableSize = binary.LittleEndian.Uint32(in) + return in[4:], nil + } + + // Read Window_Descriptor + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#window_descriptor + if len(in) < 1 { + return nil, io.ErrUnexpectedEOF + } + fhd, in := in[0], in[1:] + h.HeaderSize++ + h.SingleSegment = fhd&(1<<5) != 0 + h.HasCheckSum = fhd&(1<<2) != 0 + if fhd&(1<<3) != 0 { + return nil, errors.New("reserved bit set on frame header") + } + + if !h.SingleSegment { + if len(in) < 1 { + return nil, io.ErrUnexpectedEOF + } + var wd byte + wd, in = in[0], in[1:] + h.HeaderSize++ + windowLog := 10 + (wd >> 3) + windowBase := uint64(1) << windowLog + windowAdd := (windowBase / 8) * uint64(wd&0x7) + h.WindowSize = windowBase + windowAdd + } + + // Read Dictionary_ID + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary_id + if size := fhd & 3; size != 0 { + if size == 3 { + size = 4 + } + if len(in) < int(size) { + return nil, io.ErrUnexpectedEOF + } + b, in = in[:size], in[size:] + h.HeaderSize += int(size) + switch len(b) { + case 1: + h.DictionaryID = uint32(b[0]) + case 2: + h.DictionaryID = uint32(b[0]) | (uint32(b[1]) << 8) + case 4: + h.DictionaryID = uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24) + } + } + + // Read Frame_Content_Size + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#frame_content_size + var fcsSize int + v := fhd >> 6 + switch v { + case 0: + if h.SingleSegment { + fcsSize = 1 + } + default: + fcsSize = 1 << v + } + + if fcsSize > 0 { + h.HasFCS = true + if len(in) < fcsSize { + return nil, io.ErrUnexpectedEOF + } + b, in = in[:fcsSize], in[fcsSize:] + h.HeaderSize += int(fcsSize) + switch len(b) { + case 1: + h.FrameContentSize = uint64(b[0]) + case 2: + // When FCS_Field_Size is 2, the offset of 256 is added. + h.FrameContentSize = uint64(b[0]) | (uint64(b[1]) << 8) + 256 + case 4: + h.FrameContentSize = uint64(b[0]) | (uint64(b[1]) << 8) | (uint64(b[2]) << 16) | (uint64(b[3]) << 24) + case 8: + d1 := uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24) + d2 := uint32(b[4]) | (uint32(b[5]) << 8) | (uint32(b[6]) << 16) | (uint32(b[7]) << 24) + h.FrameContentSize = uint64(d1) | (uint64(d2) << 32) + } + } + + // Frame Header done, we will not fail from now on. + if len(in) < 3 { + return in, nil + } + tmp := in[:3] + bh := uint32(tmp[0]) | (uint32(tmp[1]) << 8) | (uint32(tmp[2]) << 16) + h.FirstBlock.Last = bh&1 != 0 + blockType := blockType((bh >> 1) & 3) + // find size. + cSize := int(bh >> 3) + switch blockType { + case blockTypeReserved: + return in, nil + case blockTypeRLE: + h.FirstBlock.Compressed = true + h.FirstBlock.DecompressedSize = cSize + h.FirstBlock.CompressedSize = 1 + case blockTypeCompressed: + h.FirstBlock.Compressed = true + h.FirstBlock.CompressedSize = cSize + case blockTypeRaw: + h.FirstBlock.DecompressedSize = cSize + h.FirstBlock.CompressedSize = cSize + default: + panic("Invalid block type") + } + + h.FirstBlock.OK = true + return in, nil +} + +// AppendTo will append the encoded header to the dst slice. +// There is no error checking performed on the header values. +func (h *Header) AppendTo(dst []byte) ([]byte, error) { + if h.Skippable { + magic := [4]byte{0x50, 0x2a, 0x4d, 0x18} + magic[0] |= byte(h.SkippableID & 0xf) + dst = append(dst, magic[:]...) + f := h.SkippableSize + return append(dst, uint8(f), uint8(f>>8), uint8(f>>16), uint8(f>>24)), nil + } + f := frameHeader{ + ContentSize: h.FrameContentSize, + WindowSize: uint32(h.WindowSize), + SingleSegment: h.SingleSegment, + Checksum: h.HasCheckSum, + DictID: h.DictionaryID, + } + return f.appendTo(dst), nil +} diff --git a/vendor/github.com/klauspost/compress/zstd/decoder.go b/vendor/github.com/klauspost/compress/zstd/decoder.go new file mode 100644 index 0000000000..bbca17234a --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/decoder.go @@ -0,0 +1,948 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "context" + "encoding/binary" + "io" + "sync" + + "github.com/klauspost/compress/zstd/internal/xxhash" +) + +// Decoder provides decoding of zstandard streams. +// The decoder has been designed to operate without allocations after a warmup. +// This means that you should store the decoder for best performance. +// To re-use a stream decoder, use the Reset(r io.Reader) error to switch to another stream. +// A decoder can safely be re-used even if the previous stream failed. +// To release the resources, you must call the Close() function on a decoder. +type Decoder struct { + o decoderOptions + + // Unreferenced decoders, ready for use. + decoders chan *blockDec + + // Current read position used for Reader functionality. + current decoderState + + // sync stream decoding + syncStream struct { + decodedFrame uint64 + br readerWrapper + enabled bool + inFrame bool + dstBuf []byte + } + + frame *frameDec + + // Custom dictionaries. + dicts map[uint32]*dict + + // streamWg is the waitgroup for all streams + streamWg sync.WaitGroup +} + +// decoderState is used for maintaining state when the decoder +// is used for streaming. +type decoderState struct { + // current block being written to stream. + decodeOutput + + // output in order to be written to stream. + output chan decodeOutput + + // cancel remaining output. + cancel context.CancelFunc + + // crc of current frame + crc *xxhash.Digest + + flushed bool +} + +var ( + // Check the interfaces we want to support. + _ = io.WriterTo(&Decoder{}) + _ = io.Reader(&Decoder{}) +) + +// NewReader creates a new decoder. +// A nil Reader can be provided in which case Reset can be used to start a decode. +// +// A Decoder can be used in two modes: +// +// 1) As a stream, or +// 2) For stateless decoding using DecodeAll. +// +// Only a single stream can be decoded concurrently, but the same decoder +// can run multiple concurrent stateless decodes. It is even possible to +// use stateless decodes while a stream is being decoded. +// +// The Reset function can be used to initiate a new stream, which will considerably +// reduce the allocations normally caused by NewReader. +func NewReader(r io.Reader, opts ...DOption) (*Decoder, error) { + initPredefined() + var d Decoder + d.o.setDefault() + for _, o := range opts { + err := o(&d.o) + if err != nil { + return nil, err + } + } + d.current.crc = xxhash.New() + d.current.flushed = true + + if r == nil { + d.current.err = ErrDecoderNilInput + } + + // Transfer option dicts. + d.dicts = make(map[uint32]*dict, len(d.o.dicts)) + for _, dc := range d.o.dicts { + d.dicts[dc.id] = dc + } + d.o.dicts = nil + + // Create decoders + d.decoders = make(chan *blockDec, d.o.concurrent) + for i := 0; i < d.o.concurrent; i++ { + dec := newBlockDec(d.o.lowMem) + dec.localFrame = newFrameDec(d.o) + d.decoders <- dec + } + + if r == nil { + return &d, nil + } + return &d, d.Reset(r) +} + +// Read bytes from the decompressed stream into p. +// Returns the number of bytes written and any error that occurred. +// When the stream is done, io.EOF will be returned. +func (d *Decoder) Read(p []byte) (int, error) { + var n int + for { + if len(d.current.b) > 0 { + filled := copy(p, d.current.b) + p = p[filled:] + d.current.b = d.current.b[filled:] + n += filled + } + if len(p) == 0 { + break + } + if len(d.current.b) == 0 { + // We have an error and no more data + if d.current.err != nil { + break + } + if !d.nextBlock(n == 0) { + return n, d.current.err + } + } + } + if len(d.current.b) > 0 { + if debugDecoder { + println("returning", n, "still bytes left:", len(d.current.b)) + } + // Only return error at end of block + return n, nil + } + if d.current.err != nil { + d.drainOutput() + } + if debugDecoder { + println("returning", n, d.current.err, len(d.decoders)) + } + return n, d.current.err +} + +// Reset will reset the decoder the supplied stream after the current has finished processing. +// Note that this functionality cannot be used after Close has been called. +// Reset can be called with a nil reader to release references to the previous reader. +// After being called with a nil reader, no other operations than Reset or DecodeAll or Close +// should be used. +func (d *Decoder) Reset(r io.Reader) error { + if d.current.err == ErrDecoderClosed { + return d.current.err + } + + d.drainOutput() + + d.syncStream.br.r = nil + if r == nil { + d.current.err = ErrDecoderNilInput + if len(d.current.b) > 0 { + d.current.b = d.current.b[:0] + } + d.current.flushed = true + return nil + } + + // If bytes buffer and < 5MB, do sync decoding anyway. + if bb, ok := r.(byter); ok && bb.Len() < d.o.decodeBufsBelow && !d.o.limitToCap { + bb2 := bb + if debugDecoder { + println("*bytes.Buffer detected, doing sync decode, len:", bb.Len()) + } + b := bb2.Bytes() + var dst []byte + if cap(d.syncStream.dstBuf) > 0 { + dst = d.syncStream.dstBuf[:0] + } + + dst, err := d.DecodeAll(b, dst) + if err == nil { + err = io.EOF + } + // Save output buffer + d.syncStream.dstBuf = dst + d.current.b = dst + d.current.err = err + d.current.flushed = true + if debugDecoder { + println("sync decode to", len(dst), "bytes, err:", err) + } + return nil + } + // Remove current block. + d.stashDecoder() + d.current.decodeOutput = decodeOutput{} + d.current.err = nil + d.current.flushed = false + d.current.d = nil + d.syncStream.dstBuf = nil + + // Ensure no-one else is still running... + d.streamWg.Wait() + if d.frame == nil { + d.frame = newFrameDec(d.o) + } + + if d.o.concurrent == 1 { + return d.startSyncDecoder(r) + } + + d.current.output = make(chan decodeOutput, d.o.concurrent) + ctx, cancel := context.WithCancel(context.Background()) + d.current.cancel = cancel + d.streamWg.Add(1) + go d.startStreamDecoder(ctx, r, d.current.output) + + return nil +} + +// drainOutput will drain the output until errEndOfStream is sent. +func (d *Decoder) drainOutput() { + if d.current.cancel != nil { + if debugDecoder { + println("cancelling current") + } + d.current.cancel() + d.current.cancel = nil + } + if d.current.d != nil { + if debugDecoder { + printf("re-adding current decoder %p, decoders: %d", d.current.d, len(d.decoders)) + } + d.decoders <- d.current.d + d.current.d = nil + d.current.b = nil + } + if d.current.output == nil || d.current.flushed { + println("current already flushed") + return + } + for v := range d.current.output { + if v.d != nil { + if debugDecoder { + printf("re-adding decoder %p", v.d) + } + d.decoders <- v.d + } + } + d.current.output = nil + d.current.flushed = true +} + +// WriteTo writes data to w until there's no more data to write or when an error occurs. +// The return value n is the number of bytes written. +// Any error encountered during the write is also returned. +func (d *Decoder) WriteTo(w io.Writer) (int64, error) { + var n int64 + for { + if len(d.current.b) > 0 { + n2, err2 := w.Write(d.current.b) + n += int64(n2) + if err2 != nil && (d.current.err == nil || d.current.err == io.EOF) { + d.current.err = err2 + } else if n2 != len(d.current.b) { + d.current.err = io.ErrShortWrite + } + } + if d.current.err != nil { + break + } + d.nextBlock(true) + } + err := d.current.err + if err != nil { + d.drainOutput() + } + if err == io.EOF { + err = nil + } + return n, err +} + +// DecodeAll allows stateless decoding of a blob of bytes. +// Output will be appended to dst, so if the destination size is known +// you can pre-allocate the destination slice to avoid allocations. +// DecodeAll can be used concurrently. +// The Decoder concurrency limits will be respected. +func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) { + if d.decoders == nil { + return dst, ErrDecoderClosed + } + + // Grab a block decoder and frame decoder. + block := <-d.decoders + frame := block.localFrame + initialSize := len(dst) + defer func() { + if debugDecoder { + printf("re-adding decoder: %p", block) + } + frame.rawInput = nil + frame.bBuf = nil + if frame.history.decoders.br != nil { + frame.history.decoders.br.in = nil + } + d.decoders <- block + }() + frame.bBuf = input + + for { + frame.history.reset() + err := frame.reset(&frame.bBuf) + if err != nil { + if err == io.EOF { + if debugDecoder { + println("frame reset return EOF") + } + return dst, nil + } + return dst, err + } + if err = d.setDict(frame); err != nil { + return nil, err + } + if frame.WindowSize > d.o.maxWindowSize { + if debugDecoder { + println("window size exceeded:", frame.WindowSize, ">", d.o.maxWindowSize) + } + return dst, ErrWindowSizeExceeded + } + if frame.FrameContentSize != fcsUnknown { + if frame.FrameContentSize > d.o.maxDecodedSize-uint64(len(dst)-initialSize) { + if debugDecoder { + println("decoder size exceeded; fcs:", frame.FrameContentSize, "> mcs:", d.o.maxDecodedSize-uint64(len(dst)-initialSize), "len:", len(dst)) + } + return dst, ErrDecoderSizeExceeded + } + if d.o.limitToCap && frame.FrameContentSize > uint64(cap(dst)-len(dst)) { + if debugDecoder { + println("decoder size exceeded; fcs:", frame.FrameContentSize, "> (cap-len)", cap(dst)-len(dst)) + } + return dst, ErrDecoderSizeExceeded + } + if cap(dst)-len(dst) < int(frame.FrameContentSize) { + dst2 := make([]byte, len(dst), len(dst)+int(frame.FrameContentSize)+compressedBlockOverAlloc) + copy(dst2, dst) + dst = dst2 + } + } + + if cap(dst) == 0 && !d.o.limitToCap { + // Allocate len(input) * 2 by default if nothing is provided + // and we didn't get frame content size. + size := len(input) * 2 + // Cap to 1 MB. + if size > 1<<20 { + size = 1 << 20 + } + if uint64(size) > d.o.maxDecodedSize { + size = int(d.o.maxDecodedSize) + } + dst = make([]byte, 0, size) + } + + dst, err = frame.runDecoder(dst, block) + if err != nil { + return dst, err + } + if uint64(len(dst)-initialSize) > d.o.maxDecodedSize { + return dst, ErrDecoderSizeExceeded + } + if len(frame.bBuf) == 0 { + if debugDecoder { + println("frame dbuf empty") + } + break + } + } + return dst, nil +} + +// nextBlock returns the next block. +// If an error occurs d.err will be set. +// Optionally the function can block for new output. +// If non-blocking mode is used the returned boolean will be false +// if no data was available without blocking. +func (d *Decoder) nextBlock(blocking bool) (ok bool) { + if d.current.err != nil { + // Keep error state. + return false + } + d.current.b = d.current.b[:0] + + // SYNC: + if d.syncStream.enabled { + if !blocking { + return false + } + ok = d.nextBlockSync() + if !ok { + d.stashDecoder() + } + return ok + } + + //ASYNC: + d.stashDecoder() + if blocking { + d.current.decodeOutput, ok = <-d.current.output + } else { + select { + case d.current.decodeOutput, ok = <-d.current.output: + default: + return false + } + } + if !ok { + // This should not happen, so signal error state... + d.current.err = io.ErrUnexpectedEOF + return false + } + next := d.current.decodeOutput + if next.d != nil && next.d.async.newHist != nil { + d.current.crc.Reset() + } + if debugDecoder { + var tmp [4]byte + binary.LittleEndian.PutUint32(tmp[:], uint32(xxhash.Sum64(next.b))) + println("got", len(d.current.b), "bytes, error:", d.current.err, "data crc:", tmp) + } + + if d.o.ignoreChecksum { + return true + } + + if len(next.b) > 0 { + d.current.crc.Write(next.b) + } + if next.err == nil && next.d != nil && next.d.hasCRC { + got := uint32(d.current.crc.Sum64()) + if got != next.d.checkCRC { + if debugDecoder { + printf("CRC Check Failed: %08x (got) != %08x (on stream)\n", got, next.d.checkCRC) + } + d.current.err = ErrCRCMismatch + } else { + if debugDecoder { + printf("CRC ok %08x\n", got) + } + } + } + + return true +} + +func (d *Decoder) nextBlockSync() (ok bool) { + if d.current.d == nil { + d.current.d = <-d.decoders + } + for len(d.current.b) == 0 { + if !d.syncStream.inFrame { + d.frame.history.reset() + d.current.err = d.frame.reset(&d.syncStream.br) + if d.current.err == nil { + d.current.err = d.setDict(d.frame) + } + if d.current.err != nil { + return false + } + if d.frame.WindowSize > d.o.maxDecodedSize || d.frame.WindowSize > d.o.maxWindowSize { + d.current.err = ErrDecoderSizeExceeded + return false + } + + d.syncStream.decodedFrame = 0 + d.syncStream.inFrame = true + } + d.current.err = d.frame.next(d.current.d) + if d.current.err != nil { + return false + } + d.frame.history.ensureBlock() + if debugDecoder { + println("History trimmed:", len(d.frame.history.b), "decoded already:", d.syncStream.decodedFrame) + } + histBefore := len(d.frame.history.b) + d.current.err = d.current.d.decodeBuf(&d.frame.history) + + if d.current.err != nil { + println("error after:", d.current.err) + return false + } + d.current.b = d.frame.history.b[histBefore:] + if debugDecoder { + println("history after:", len(d.frame.history.b)) + } + + // Check frame size (before CRC) + d.syncStream.decodedFrame += uint64(len(d.current.b)) + if d.syncStream.decodedFrame > d.frame.FrameContentSize { + if debugDecoder { + printf("DecodedFrame (%d) > FrameContentSize (%d)\n", d.syncStream.decodedFrame, d.frame.FrameContentSize) + } + d.current.err = ErrFrameSizeExceeded + return false + } + + // Check FCS + if d.current.d.Last && d.frame.FrameContentSize != fcsUnknown && d.syncStream.decodedFrame != d.frame.FrameContentSize { + if debugDecoder { + printf("DecodedFrame (%d) != FrameContentSize (%d)\n", d.syncStream.decodedFrame, d.frame.FrameContentSize) + } + d.current.err = ErrFrameSizeMismatch + return false + } + + // Update/Check CRC + if d.frame.HasCheckSum { + if !d.o.ignoreChecksum { + d.frame.crc.Write(d.current.b) + } + if d.current.d.Last { + if !d.o.ignoreChecksum { + d.current.err = d.frame.checkCRC() + } else { + d.current.err = d.frame.consumeCRC() + } + if d.current.err != nil { + println("CRC error:", d.current.err) + return false + } + } + } + d.syncStream.inFrame = !d.current.d.Last + } + return true +} + +func (d *Decoder) stashDecoder() { + if d.current.d != nil { + if debugDecoder { + printf("re-adding current decoder %p", d.current.d) + } + d.decoders <- d.current.d + d.current.d = nil + } +} + +// Close will release all resources. +// It is NOT possible to reuse the decoder after this. +func (d *Decoder) Close() { + if d.current.err == ErrDecoderClosed { + return + } + d.drainOutput() + if d.current.cancel != nil { + d.current.cancel() + d.streamWg.Wait() + d.current.cancel = nil + } + if d.decoders != nil { + close(d.decoders) + for dec := range d.decoders { + dec.Close() + } + d.decoders = nil + } + if d.current.d != nil { + d.current.d.Close() + d.current.d = nil + } + d.current.err = ErrDecoderClosed +} + +// IOReadCloser returns the decoder as an io.ReadCloser for convenience. +// Any changes to the decoder will be reflected, so the returned ReadCloser +// can be reused along with the decoder. +// io.WriterTo is also supported by the returned ReadCloser. +func (d *Decoder) IOReadCloser() io.ReadCloser { + return closeWrapper{d: d} +} + +// closeWrapper wraps a function call as a closer. +type closeWrapper struct { + d *Decoder +} + +// WriteTo forwards WriteTo calls to the decoder. +func (c closeWrapper) WriteTo(w io.Writer) (n int64, err error) { + return c.d.WriteTo(w) +} + +// Read forwards read calls to the decoder. +func (c closeWrapper) Read(p []byte) (n int, err error) { + return c.d.Read(p) +} + +// Close closes the decoder. +func (c closeWrapper) Close() error { + c.d.Close() + return nil +} + +type decodeOutput struct { + d *blockDec + b []byte + err error +} + +func (d *Decoder) startSyncDecoder(r io.Reader) error { + d.frame.history.reset() + d.syncStream.br = readerWrapper{r: r} + d.syncStream.inFrame = false + d.syncStream.enabled = true + d.syncStream.decodedFrame = 0 + return nil +} + +// Create Decoder: +// ASYNC: +// Spawn 3 go routines. +// 0: Read frames and decode block literals. +// 1: Decode sequences. +// 2: Execute sequences, send to output. +func (d *Decoder) startStreamDecoder(ctx context.Context, r io.Reader, output chan decodeOutput) { + defer d.streamWg.Done() + br := readerWrapper{r: r} + + var seqDecode = make(chan *blockDec, d.o.concurrent) + var seqExecute = make(chan *blockDec, d.o.concurrent) + + // Async 1: Decode sequences... + go func() { + var hist history + var hasErr bool + + for block := range seqDecode { + if hasErr { + if block != nil { + seqExecute <- block + } + continue + } + if block.async.newHist != nil { + if debugDecoder { + println("Async 1: new history, recent:", block.async.newHist.recentOffsets) + } + hist.reset() + hist.decoders = block.async.newHist.decoders + hist.recentOffsets = block.async.newHist.recentOffsets + hist.windowSize = block.async.newHist.windowSize + if block.async.newHist.dict != nil { + hist.setDict(block.async.newHist.dict) + } + } + if block.err != nil || block.Type != blockTypeCompressed { + hasErr = block.err != nil + seqExecute <- block + continue + } + + hist.decoders.literals = block.async.literals + block.err = block.prepareSequences(block.async.seqData, &hist) + if debugDecoder && block.err != nil { + println("prepareSequences returned:", block.err) + } + hasErr = block.err != nil + if block.err == nil { + block.err = block.decodeSequences(&hist) + if debugDecoder && block.err != nil { + println("decodeSequences returned:", block.err) + } + hasErr = block.err != nil + // block.async.sequence = hist.decoders.seq[:hist.decoders.nSeqs] + block.async.seqSize = hist.decoders.seqSize + } + seqExecute <- block + } + close(seqExecute) + hist.reset() + }() + + var wg sync.WaitGroup + wg.Add(1) + + // Async 3: Execute sequences... + frameHistCache := d.frame.history.b + go func() { + var hist history + var decodedFrame uint64 + var fcs uint64 + var hasErr bool + for block := range seqExecute { + out := decodeOutput{err: block.err, d: block} + if block.err != nil || hasErr { + hasErr = true + output <- out + continue + } + if block.async.newHist != nil { + if debugDecoder { + println("Async 2: new history") + } + hist.reset() + hist.windowSize = block.async.newHist.windowSize + hist.allocFrameBuffer = block.async.newHist.allocFrameBuffer + if block.async.newHist.dict != nil { + hist.setDict(block.async.newHist.dict) + } + + if cap(hist.b) < hist.allocFrameBuffer { + if cap(frameHistCache) >= hist.allocFrameBuffer { + hist.b = frameHistCache + } else { + hist.b = make([]byte, 0, hist.allocFrameBuffer) + println("Alloc history sized", hist.allocFrameBuffer) + } + } + hist.b = hist.b[:0] + fcs = block.async.fcs + decodedFrame = 0 + } + do := decodeOutput{err: block.err, d: block} + switch block.Type { + case blockTypeRLE: + if debugDecoder { + println("add rle block length:", block.RLESize) + } + + if cap(block.dst) < int(block.RLESize) { + if block.lowMem { + block.dst = make([]byte, block.RLESize) + } else { + block.dst = make([]byte, maxCompressedBlockSize) + } + } + block.dst = block.dst[:block.RLESize] + v := block.data[0] + for i := range block.dst { + block.dst[i] = v + } + hist.append(block.dst) + do.b = block.dst + case blockTypeRaw: + if debugDecoder { + println("add raw block length:", len(block.data)) + } + hist.append(block.data) + do.b = block.data + case blockTypeCompressed: + if debugDecoder { + println("execute with history length:", len(hist.b), "window:", hist.windowSize) + } + hist.decoders.seqSize = block.async.seqSize + hist.decoders.literals = block.async.literals + do.err = block.executeSequences(&hist) + hasErr = do.err != nil + if debugDecoder && hasErr { + println("executeSequences returned:", do.err) + } + do.b = block.dst + } + if !hasErr { + decodedFrame += uint64(len(do.b)) + if decodedFrame > fcs { + println("fcs exceeded", block.Last, fcs, decodedFrame) + do.err = ErrFrameSizeExceeded + hasErr = true + } else if block.Last && fcs != fcsUnknown && decodedFrame != fcs { + do.err = ErrFrameSizeMismatch + hasErr = true + } else { + if debugDecoder { + println("fcs ok", block.Last, fcs, decodedFrame) + } + } + } + output <- do + } + close(output) + frameHistCache = hist.b + wg.Done() + if debugDecoder { + println("decoder goroutines finished") + } + hist.reset() + }() + + var hist history +decodeStream: + for { + var hasErr bool + hist.reset() + decodeBlock := func(block *blockDec) { + if hasErr { + if block != nil { + seqDecode <- block + } + return + } + if block.err != nil || block.Type != blockTypeCompressed { + hasErr = block.err != nil + seqDecode <- block + return + } + + remain, err := block.decodeLiterals(block.data, &hist) + block.err = err + hasErr = block.err != nil + if err == nil { + block.async.literals = hist.decoders.literals + block.async.seqData = remain + } else if debugDecoder { + println("decodeLiterals error:", err) + } + seqDecode <- block + } + frame := d.frame + if debugDecoder { + println("New frame...") + } + var historySent bool + frame.history.reset() + err := frame.reset(&br) + if debugDecoder && err != nil { + println("Frame decoder returned", err) + } + if err == nil { + err = d.setDict(frame) + } + if err == nil && d.frame.WindowSize > d.o.maxWindowSize { + if debugDecoder { + println("decoder size exceeded, fws:", d.frame.WindowSize, "> mws:", d.o.maxWindowSize) + } + + err = ErrDecoderSizeExceeded + } + if err != nil { + select { + case <-ctx.Done(): + case dec := <-d.decoders: + dec.sendErr(err) + decodeBlock(dec) + } + break decodeStream + } + + // Go through all blocks of the frame. + for { + var dec *blockDec + select { + case <-ctx.Done(): + break decodeStream + case dec = <-d.decoders: + // Once we have a decoder, we MUST return it. + } + err := frame.next(dec) + if !historySent { + h := frame.history + if debugDecoder { + println("Alloc History:", h.allocFrameBuffer) + } + hist.reset() + if h.dict != nil { + hist.setDict(h.dict) + } + dec.async.newHist = &h + dec.async.fcs = frame.FrameContentSize + historySent = true + } else { + dec.async.newHist = nil + } + if debugDecoder && err != nil { + println("next block returned error:", err) + } + dec.err = err + dec.hasCRC = false + if dec.Last && frame.HasCheckSum && err == nil { + crc, err := frame.rawInput.readSmall(4) + if len(crc) < 4 { + if err == nil { + err = io.ErrUnexpectedEOF + + } + println("CRC missing?", err) + dec.err = err + } else { + dec.checkCRC = binary.LittleEndian.Uint32(crc) + dec.hasCRC = true + if debugDecoder { + printf("found crc to check: %08x\n", dec.checkCRC) + } + } + } + err = dec.err + last := dec.Last + decodeBlock(dec) + if err != nil { + break decodeStream + } + if last { + break + } + } + } + close(seqDecode) + wg.Wait() + hist.reset() + d.frame.history.b = frameHistCache +} + +func (d *Decoder) setDict(frame *frameDec) (err error) { + dict, ok := d.dicts[frame.DictionaryID] + if ok { + if debugDecoder { + println("setting dict", frame.DictionaryID) + } + frame.history.setDict(dict) + } else if frame.DictionaryID != 0 { + // A zero or missing dictionary id is ambiguous: + // either dictionary zero, or no dictionary. In particular, + // zstd --patch-from uses this id for the source file, + // so only return an error if the dictionary id is not zero. + err = ErrUnknownDictionary + } + return err +} diff --git a/vendor/github.com/klauspost/compress/zstd/decoder_options.go b/vendor/github.com/klauspost/compress/zstd/decoder_options.go new file mode 100644 index 0000000000..774c5f00fe --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/decoder_options.go @@ -0,0 +1,169 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "errors" + "fmt" + "math/bits" + "runtime" +) + +// DOption is an option for creating a decoder. +type DOption func(*decoderOptions) error + +// options retains accumulated state of multiple options. +type decoderOptions struct { + lowMem bool + concurrent int + maxDecodedSize uint64 + maxWindowSize uint64 + dicts []*dict + ignoreChecksum bool + limitToCap bool + decodeBufsBelow int +} + +func (o *decoderOptions) setDefault() { + *o = decoderOptions{ + // use less ram: true for now, but may change. + lowMem: true, + concurrent: runtime.GOMAXPROCS(0), + maxWindowSize: MaxWindowSize, + decodeBufsBelow: 128 << 10, + } + if o.concurrent > 4 { + o.concurrent = 4 + } + o.maxDecodedSize = 64 << 30 +} + +// WithDecoderLowmem will set whether to use a lower amount of memory, +// but possibly have to allocate more while running. +func WithDecoderLowmem(b bool) DOption { + return func(o *decoderOptions) error { o.lowMem = b; return nil } +} + +// WithDecoderConcurrency sets the number of created decoders. +// When decoding block with DecodeAll, this will limit the number +// of possible concurrently running decodes. +// When decoding streams, this will limit the number of +// inflight blocks. +// When decoding streams and setting maximum to 1, +// no async decoding will be done. +// When a value of 0 is provided GOMAXPROCS will be used. +// By default this will be set to 4 or GOMAXPROCS, whatever is lower. +func WithDecoderConcurrency(n int) DOption { + return func(o *decoderOptions) error { + if n < 0 { + return errors.New("concurrency must be at least 1") + } + if n == 0 { + o.concurrent = runtime.GOMAXPROCS(0) + } else { + o.concurrent = n + } + return nil + } +} + +// WithDecoderMaxMemory allows to set a maximum decoded size for in-memory +// non-streaming operations or maximum window size for streaming operations. +// This can be used to control memory usage of potentially hostile content. +// Maximum is 1 << 63 bytes. Default is 64GiB. +func WithDecoderMaxMemory(n uint64) DOption { + return func(o *decoderOptions) error { + if n == 0 { + return errors.New("WithDecoderMaxMemory must be at least 1") + } + if n > 1<<63 { + return errors.New("WithDecoderMaxmemory must be less than 1 << 63") + } + o.maxDecodedSize = n + return nil + } +} + +// WithDecoderDicts allows to register one or more dictionaries for the decoder. +// +// Each slice in dict must be in the [dictionary format] produced by +// "zstd --train" from the Zstandard reference implementation. +// +// If several dictionaries with the same ID are provided, the last one will be used. +// +// [dictionary format]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary-format +func WithDecoderDicts(dicts ...[]byte) DOption { + return func(o *decoderOptions) error { + for _, b := range dicts { + d, err := loadDict(b) + if err != nil { + return err + } + o.dicts = append(o.dicts, d) + } + return nil + } +} + +// WithDecoderDictRaw registers a dictionary that may be used by the decoder. +// The slice content can be arbitrary data. +func WithDecoderDictRaw(id uint32, content []byte) DOption { + return func(o *decoderOptions) error { + if bits.UintSize > 32 && uint(len(content)) > dictMaxLength { + return fmt.Errorf("dictionary of size %d > 2GiB too large", len(content)) + } + o.dicts = append(o.dicts, &dict{id: id, content: content, offsets: [3]int{1, 4, 8}}) + return nil + } +} + +// WithDecoderMaxWindow allows to set a maximum window size for decodes. +// This allows rejecting packets that will cause big memory usage. +// The Decoder will likely allocate more memory based on the WithDecoderLowmem setting. +// If WithDecoderMaxMemory is set to a lower value, that will be used. +// Default is 512MB, Maximum is ~3.75 TB as per zstandard spec. +func WithDecoderMaxWindow(size uint64) DOption { + return func(o *decoderOptions) error { + if size < MinWindowSize { + return errors.New("WithMaxWindowSize must be at least 1KB, 1024 bytes") + } + if size > (1<<41)+7*(1<<38) { + return errors.New("WithMaxWindowSize must be less than (1<<41) + 7*(1<<38) ~ 3.75TB") + } + o.maxWindowSize = size + return nil + } +} + +// WithDecodeAllCapLimit will limit DecodeAll to decoding cap(dst)-len(dst) bytes, +// or any size set in WithDecoderMaxMemory. +// This can be used to limit decoding to a specific maximum output size. +// Disabled by default. +func WithDecodeAllCapLimit(b bool) DOption { + return func(o *decoderOptions) error { + o.limitToCap = b + return nil + } +} + +// WithDecodeBuffersBelow will fully decode readers that have a +// `Bytes() []byte` and `Len() int` interface similar to bytes.Buffer. +// This typically uses less allocations but will have the full decompressed object in memory. +// Note that DecodeAllCapLimit will disable this, as well as giving a size of 0 or less. +// Default is 128KiB. +func WithDecodeBuffersBelow(size int) DOption { + return func(o *decoderOptions) error { + o.decodeBufsBelow = size + return nil + } +} + +// IgnoreChecksum allows to forcibly ignore checksum checking. +func IgnoreChecksum(b bool) DOption { + return func(o *decoderOptions) error { + o.ignoreChecksum = b + return nil + } +} diff --git a/vendor/github.com/klauspost/compress/zstd/dict.go b/vendor/github.com/klauspost/compress/zstd/dict.go new file mode 100644 index 0000000000..b7b83164bc --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/dict.go @@ -0,0 +1,565 @@ +package zstd + +import ( + "bytes" + "encoding/binary" + "errors" + "fmt" + "io" + "math" + "sort" + + "github.com/klauspost/compress/huff0" +) + +type dict struct { + id uint32 + + litEnc *huff0.Scratch + llDec, ofDec, mlDec sequenceDec + offsets [3]int + content []byte +} + +const dictMagic = "\x37\xa4\x30\xec" + +// Maximum dictionary size for the reference implementation (1.5.3) is 2 GiB. +const dictMaxLength = 1 << 31 + +// ID returns the dictionary id or 0 if d is nil. +func (d *dict) ID() uint32 { + if d == nil { + return 0 + } + return d.id +} + +// ContentSize returns the dictionary content size or 0 if d is nil. +func (d *dict) ContentSize() int { + if d == nil { + return 0 + } + return len(d.content) +} + +// Content returns the dictionary content. +func (d *dict) Content() []byte { + if d == nil { + return nil + } + return d.content +} + +// Offsets returns the initial offsets. +func (d *dict) Offsets() [3]int { + if d == nil { + return [3]int{} + } + return d.offsets +} + +// LitEncoder returns the literal encoder. +func (d *dict) LitEncoder() *huff0.Scratch { + if d == nil { + return nil + } + return d.litEnc +} + +// Load a dictionary as described in +// https://github.com/facebook/zstd/blob/master/doc/zstd_compression_format.md#dictionary-format +func loadDict(b []byte) (*dict, error) { + // Check static field size. + if len(b) <= 8+(3*4) { + return nil, io.ErrUnexpectedEOF + } + d := dict{ + llDec: sequenceDec{fse: &fseDecoder{}}, + ofDec: sequenceDec{fse: &fseDecoder{}}, + mlDec: sequenceDec{fse: &fseDecoder{}}, + } + if string(b[:4]) != dictMagic { + return nil, ErrMagicMismatch + } + d.id = binary.LittleEndian.Uint32(b[4:8]) + if d.id == 0 { + return nil, errors.New("dictionaries cannot have ID 0") + } + + // Read literal table + var err error + d.litEnc, b, err = huff0.ReadTable(b[8:], nil) + if err != nil { + return nil, fmt.Errorf("loading literal table: %w", err) + } + d.litEnc.Reuse = huff0.ReusePolicyMust + + br := byteReader{ + b: b, + off: 0, + } + readDec := func(i tableIndex, dec *fseDecoder) error { + if err := dec.readNCount(&br, uint16(maxTableSymbol[i])); err != nil { + return err + } + if br.overread() { + return io.ErrUnexpectedEOF + } + err = dec.transform(symbolTableX[i]) + if err != nil { + println("Transform table error:", err) + return err + } + if debugDecoder || debugEncoder { + println("Read table ok", "symbolLen:", dec.symbolLen) + } + // Set decoders as predefined so they aren't reused. + dec.preDefined = true + return nil + } + + if err := readDec(tableOffsets, d.ofDec.fse); err != nil { + return nil, err + } + if err := readDec(tableMatchLengths, d.mlDec.fse); err != nil { + return nil, err + } + if err := readDec(tableLiteralLengths, d.llDec.fse); err != nil { + return nil, err + } + if br.remain() < 12 { + return nil, io.ErrUnexpectedEOF + } + + d.offsets[0] = int(br.Uint32()) + br.advance(4) + d.offsets[1] = int(br.Uint32()) + br.advance(4) + d.offsets[2] = int(br.Uint32()) + br.advance(4) + if d.offsets[0] <= 0 || d.offsets[1] <= 0 || d.offsets[2] <= 0 { + return nil, errors.New("invalid offset in dictionary") + } + d.content = make([]byte, br.remain()) + copy(d.content, br.unread()) + if d.offsets[0] > len(d.content) || d.offsets[1] > len(d.content) || d.offsets[2] > len(d.content) { + return nil, fmt.Errorf("initial offset bigger than dictionary content size %d, offsets: %v", len(d.content), d.offsets) + } + + return &d, nil +} + +// InspectDictionary loads a zstd dictionary and provides functions to inspect the content. +func InspectDictionary(b []byte) (interface { + ID() uint32 + ContentSize() int + Content() []byte + Offsets() [3]int + LitEncoder() *huff0.Scratch +}, error) { + initPredefined() + d, err := loadDict(b) + return d, err +} + +type BuildDictOptions struct { + // Dictionary ID. + ID uint32 + + // Content to use to create dictionary tables. + Contents [][]byte + + // History to use for all blocks. + History []byte + + // Offsets to use. + Offsets [3]int + + // CompatV155 will make the dictionary compatible with Zstd v1.5.5 and earlier. + // See https://github.com/facebook/zstd/issues/3724 + CompatV155 bool + + // Use the specified encoder level. + // The dictionary will be built using the specified encoder level, + // which will reflect speed and make the dictionary tailored for that level. + // If not set SpeedBestCompression will be used. + Level EncoderLevel + + // DebugOut will write stats and other details here if set. + DebugOut io.Writer +} + +func BuildDict(o BuildDictOptions) ([]byte, error) { + initPredefined() + hist := o.History + contents := o.Contents + debug := o.DebugOut != nil + println := func(args ...interface{}) { + if o.DebugOut != nil { + fmt.Fprintln(o.DebugOut, args...) + } + } + printf := func(s string, args ...interface{}) { + if o.DebugOut != nil { + fmt.Fprintf(o.DebugOut, s, args...) + } + } + print := func(args ...interface{}) { + if o.DebugOut != nil { + fmt.Fprint(o.DebugOut, args...) + } + } + + if int64(len(hist)) > dictMaxLength { + return nil, fmt.Errorf("dictionary of size %d > %d", len(hist), int64(dictMaxLength)) + } + if len(hist) < 8 { + return nil, fmt.Errorf("dictionary of size %d < %d", len(hist), 8) + } + if len(contents) == 0 { + return nil, errors.New("no content provided") + } + d := dict{ + id: o.ID, + litEnc: nil, + llDec: sequenceDec{}, + ofDec: sequenceDec{}, + mlDec: sequenceDec{}, + offsets: o.Offsets, + content: hist, + } + block := blockEnc{lowMem: false} + block.init() + enc := encoder(&bestFastEncoder{fastBase: fastBase{maxMatchOff: int32(maxMatchLen), bufferReset: math.MaxInt32 - int32(maxMatchLen*2), lowMem: false}}) + if o.Level != 0 { + eOpts := encoderOptions{ + level: o.Level, + blockSize: maxMatchLen, + windowSize: maxMatchLen, + dict: &d, + lowMem: false, + } + enc = eOpts.encoder() + } else { + o.Level = SpeedBestCompression + } + var ( + remain [256]int + ll [256]int + ml [256]int + of [256]int + ) + addValues := func(dst *[256]int, src []byte) { + for _, v := range src { + dst[v]++ + } + } + addHist := func(dst *[256]int, src *[256]uint32) { + for i, v := range src { + dst[i] += int(v) + } + } + seqs := 0 + nUsed := 0 + litTotal := 0 + newOffsets := make(map[uint32]int, 1000) + for _, b := range contents { + block.reset(nil) + if len(b) < 8 { + continue + } + nUsed++ + enc.Reset(&d, true) + enc.Encode(&block, b) + addValues(&remain, block.literals) + litTotal += len(block.literals) + if len(block.sequences) == 0 { + continue + } + seqs += len(block.sequences) + block.genCodes() + addHist(&ll, block.coders.llEnc.Histogram()) + addHist(&ml, block.coders.mlEnc.Histogram()) + addHist(&of, block.coders.ofEnc.Histogram()) + for i, seq := range block.sequences { + if i > 3 { + break + } + offset := seq.offset + if offset == 0 { + continue + } + if int(offset) >= len(o.History) { + continue + } + if offset > 3 { + newOffsets[offset-3]++ + } else { + newOffsets[uint32(o.Offsets[offset-1])]++ + } + } + } + // Find most used offsets. + var sortedOffsets []uint32 + for k := range newOffsets { + sortedOffsets = append(sortedOffsets, k) + } + sort.Slice(sortedOffsets, func(i, j int) bool { + a, b := sortedOffsets[i], sortedOffsets[j] + if a == b { + // Prefer the longer offset + return sortedOffsets[i] > sortedOffsets[j] + } + return newOffsets[sortedOffsets[i]] > newOffsets[sortedOffsets[j]] + }) + if len(sortedOffsets) > 3 { + if debug { + print("Offsets:") + for i, v := range sortedOffsets { + if i > 20 { + break + } + printf("[%d: %d],", v, newOffsets[v]) + } + println("") + } + + sortedOffsets = sortedOffsets[:3] + } + for i, v := range sortedOffsets { + o.Offsets[i] = int(v) + } + if debug { + println("New repeat offsets", o.Offsets) + } + + if nUsed == 0 || seqs == 0 { + return nil, fmt.Errorf("%d blocks, %d sequences found", nUsed, seqs) + } + if debug { + println("Sequences:", seqs, "Blocks:", nUsed, "Literals:", litTotal) + } + if seqs/nUsed < 512 { + // Use 512 as minimum. + nUsed = seqs / 512 + if nUsed == 0 { + nUsed = 1 + } + } + copyHist := func(dst *fseEncoder, src *[256]int) ([]byte, error) { + hist := dst.Histogram() + var maxSym uint8 + var maxCount int + var fakeLength int + for i, v := range src { + if v > 0 { + v = v / nUsed + if v == 0 { + v = 1 + } + } + if v > maxCount { + maxCount = v + } + if v != 0 { + maxSym = uint8(i) + } + fakeLength += v + hist[i] = uint32(v) + } + + // Ensure we aren't trying to represent RLE. + if maxCount == fakeLength { + for i := range hist { + if uint8(i) == maxSym { + fakeLength++ + maxSym++ + hist[i+1] = 1 + if maxSym > 1 { + break + } + } + if hist[0] == 0 { + fakeLength++ + hist[i] = 1 + if maxSym > 1 { + break + } + } + } + } + + dst.HistogramFinished(maxSym, maxCount) + dst.reUsed = false + dst.useRLE = false + err := dst.normalizeCount(fakeLength) + if err != nil { + return nil, err + } + if debug { + println("RAW:", dst.count[:maxSym+1], "NORM:", dst.norm[:maxSym+1], "LEN:", fakeLength) + } + return dst.writeCount(nil) + } + if debug { + print("Literal lengths: ") + } + llTable, err := copyHist(block.coders.llEnc, &ll) + if err != nil { + return nil, err + } + if debug { + print("Match lengths: ") + } + mlTable, err := copyHist(block.coders.mlEnc, &ml) + if err != nil { + return nil, err + } + if debug { + print("Offsets: ") + } + ofTable, err := copyHist(block.coders.ofEnc, &of) + if err != nil { + return nil, err + } + + // Literal table + avgSize := litTotal + if avgSize > huff0.BlockSizeMax/2 { + avgSize = huff0.BlockSizeMax / 2 + } + huffBuff := make([]byte, 0, avgSize) + // Target size + div := litTotal / avgSize + if div < 1 { + div = 1 + } + if debug { + println("Huffman weights:") + } + for i, n := range remain[:] { + if n > 0 { + n = n / div + // Allow all entries to be represented. + if n == 0 { + n = 1 + } + huffBuff = append(huffBuff, bytes.Repeat([]byte{byte(i)}, n)...) + if debug { + printf("[%d: %d], ", i, n) + } + } + } + if o.CompatV155 && remain[255]/div == 0 { + huffBuff = append(huffBuff, 255) + } + scratch := &huff0.Scratch{TableLog: 11} + for tries := 0; tries < 255; tries++ { + scratch = &huff0.Scratch{TableLog: 11} + _, _, err = huff0.Compress1X(huffBuff, scratch) + if err == nil { + break + } + if debug { + printf("Try %d: Huffman error: %v\n", tries+1, err) + } + huffBuff = huffBuff[:0] + if tries == 250 { + if debug { + println("Huffman: Bailing out with predefined table") + } + + // Bail out.... Just generate something + huffBuff = append(huffBuff, bytes.Repeat([]byte{255}, 10000)...) + for i := 0; i < 128; i++ { + huffBuff = append(huffBuff, byte(i)) + } + continue + } + if errors.Is(err, huff0.ErrIncompressible) { + // Try truncating least common. + for i, n := range remain[:] { + if n > 0 { + n = n / (div * (i + 1)) + if n > 0 { + huffBuff = append(huffBuff, bytes.Repeat([]byte{byte(i)}, n)...) + } + } + } + if o.CompatV155 && len(huffBuff) > 0 && huffBuff[len(huffBuff)-1] != 255 { + huffBuff = append(huffBuff, 255) + } + if len(huffBuff) == 0 { + huffBuff = append(huffBuff, 0, 255) + } + } + if errors.Is(err, huff0.ErrUseRLE) { + for i, n := range remain[:] { + n = n / (div * (i + 1)) + // Allow all entries to be represented. + if n == 0 { + n = 1 + } + huffBuff = append(huffBuff, bytes.Repeat([]byte{byte(i)}, n)...) + } + } + } + + var out bytes.Buffer + out.Write([]byte(dictMagic)) + out.Write(binary.LittleEndian.AppendUint32(nil, o.ID)) + out.Write(scratch.OutTable) + if debug { + println("huff table:", len(scratch.OutTable), "bytes") + println("of table:", len(ofTable), "bytes") + println("ml table:", len(mlTable), "bytes") + println("ll table:", len(llTable), "bytes") + } + out.Write(ofTable) + out.Write(mlTable) + out.Write(llTable) + out.Write(binary.LittleEndian.AppendUint32(nil, uint32(o.Offsets[0]))) + out.Write(binary.LittleEndian.AppendUint32(nil, uint32(o.Offsets[1]))) + out.Write(binary.LittleEndian.AppendUint32(nil, uint32(o.Offsets[2]))) + out.Write(hist) + if debug { + _, err := loadDict(out.Bytes()) + if err != nil { + panic(err) + } + i, err := InspectDictionary(out.Bytes()) + if err != nil { + panic(err) + } + println("ID:", i.ID()) + println("Content size:", i.ContentSize()) + println("Encoder:", i.LitEncoder() != nil) + println("Offsets:", i.Offsets()) + var totalSize int + for _, b := range contents { + totalSize += len(b) + } + + encWith := func(opts ...EOption) int { + enc, err := NewWriter(nil, opts...) + if err != nil { + panic(err) + } + defer enc.Close() + var dst []byte + var totalSize int + for _, b := range contents { + dst = enc.EncodeAll(b, dst[:0]) + totalSize += len(dst) + } + return totalSize + } + plain := encWith(WithEncoderLevel(o.Level)) + withDict := encWith(WithEncoderLevel(o.Level), WithEncoderDict(out.Bytes())) + println("Input size:", totalSize) + println("Plain Compressed:", plain) + println("Dict Compressed:", withDict) + println("Saved:", plain-withDict, (plain-withDict)/len(contents), "bytes per input (rounded down)") + } + return out.Bytes(), nil +} diff --git a/vendor/github.com/klauspost/compress/zstd/enc_base.go b/vendor/github.com/klauspost/compress/zstd/enc_base.go new file mode 100644 index 0000000000..5ca46038ad --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/enc_base.go @@ -0,0 +1,173 @@ +package zstd + +import ( + "fmt" + "math/bits" + + "github.com/klauspost/compress/zstd/internal/xxhash" +) + +const ( + dictShardBits = 6 +) + +type fastBase struct { + // cur is the offset at the start of hist + cur int32 + // maximum offset. Should be at least 2x block size. + maxMatchOff int32 + bufferReset int32 + hist []byte + crc *xxhash.Digest + tmp [8]byte + blk *blockEnc + lastDictID uint32 + lowMem bool +} + +// CRC returns the underlying CRC writer. +func (e *fastBase) CRC() *xxhash.Digest { + return e.crc +} + +// AppendCRC will append the CRC to the destination slice and return it. +func (e *fastBase) AppendCRC(dst []byte) []byte { + crc := e.crc.Sum(e.tmp[:0]) + dst = append(dst, crc[7], crc[6], crc[5], crc[4]) + return dst +} + +// WindowSize returns the window size of the encoder, +// or a window size small enough to contain the input size, if > 0. +func (e *fastBase) WindowSize(size int64) int32 { + if size > 0 && size < int64(e.maxMatchOff) { + b := int32(1) << uint(bits.Len(uint(size))) + // Keep minimum window. + if b < 1024 { + b = 1024 + } + return b + } + return e.maxMatchOff +} + +// Block returns the current block. +func (e *fastBase) Block() *blockEnc { + return e.blk +} + +func (e *fastBase) addBlock(src []byte) int32 { + if debugAsserts && e.cur > e.bufferReset { + panic(fmt.Sprintf("ecur (%d) > buffer reset (%d)", e.cur, e.bufferReset)) + } + // check if we have space already + if len(e.hist)+len(src) > cap(e.hist) { + if cap(e.hist) == 0 { + e.ensureHist(len(src)) + } else { + if cap(e.hist) < int(e.maxMatchOff+maxCompressedBlockSize) { + panic(fmt.Errorf("unexpected buffer cap %d, want at least %d with window %d", cap(e.hist), e.maxMatchOff+maxCompressedBlockSize, e.maxMatchOff)) + } + // Move down + offset := int32(len(e.hist)) - e.maxMatchOff + copy(e.hist[0:e.maxMatchOff], e.hist[offset:]) + e.cur += offset + e.hist = e.hist[:e.maxMatchOff] + } + } + s := int32(len(e.hist)) + e.hist = append(e.hist, src...) + return s +} + +// ensureHist will ensure that history can keep at least this many bytes. +func (e *fastBase) ensureHist(n int) { + if cap(e.hist) >= n { + return + } + l := e.maxMatchOff + if (e.lowMem && e.maxMatchOff > maxCompressedBlockSize) || e.maxMatchOff <= maxCompressedBlockSize { + l += maxCompressedBlockSize + } else { + l += e.maxMatchOff + } + // Make it at least 1MB. + if l < 1<<20 && !e.lowMem { + l = 1 << 20 + } + // Make it at least the requested size. + if l < int32(n) { + l = int32(n) + } + e.hist = make([]byte, 0, l) +} + +// useBlock will replace the block with the provided one, +// but transfer recent offsets from the previous. +func (e *fastBase) UseBlock(enc *blockEnc) { + enc.reset(e.blk) + e.blk = enc +} + +func (e *fastBase) matchlen(s, t int32, src []byte) int32 { + if debugAsserts { + if s < 0 { + err := fmt.Sprintf("s (%d) < 0", s) + panic(err) + } + if t < 0 { + err := fmt.Sprintf("s (%d) < 0", s) + panic(err) + } + if s-t > e.maxMatchOff { + err := fmt.Sprintf("s (%d) - t (%d) > maxMatchOff (%d)", s, t, e.maxMatchOff) + panic(err) + } + if len(src)-int(s) > maxCompressedBlockSize { + panic(fmt.Sprintf("len(src)-s (%d) > maxCompressedBlockSize (%d)", len(src)-int(s), maxCompressedBlockSize)) + } + } + return int32(matchLen(src[s:], src[t:])) +} + +// Reset the encoding table. +func (e *fastBase) resetBase(d *dict, singleBlock bool) { + if e.blk == nil { + e.blk = &blockEnc{lowMem: e.lowMem} + e.blk.init() + } else { + e.blk.reset(nil) + } + e.blk.initNewEncode() + if e.crc == nil { + e.crc = xxhash.New() + } else { + e.crc.Reset() + } + e.blk.dictLitEnc = nil + if d != nil { + low := e.lowMem + if singleBlock { + e.lowMem = true + } + e.ensureHist(d.ContentSize() + maxCompressedBlockSize) + e.lowMem = low + } + + // We offset current position so everything will be out of reach. + // If above reset line, history will be purged. + if e.cur < e.bufferReset { + e.cur += e.maxMatchOff + int32(len(e.hist)) + } + e.hist = e.hist[:0] + if d != nil { + // Set offsets (currently not used) + for i, off := range d.offsets { + e.blk.recentOffsets[i] = uint32(off) + e.blk.prevRecentOffsets[i] = e.blk.recentOffsets[i] + } + // Transfer litenc. + e.blk.dictLitEnc = d.litEnc + e.hist = append(e.hist, d.content...) + } +} diff --git a/vendor/github.com/klauspost/compress/zstd/enc_best.go b/vendor/github.com/klauspost/compress/zstd/enc_best.go new file mode 100644 index 0000000000..4613724e9d --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/enc_best.go @@ -0,0 +1,560 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "bytes" + "fmt" + + "github.com/klauspost/compress" +) + +const ( + bestLongTableBits = 22 // Bits used in the long match table + bestLongTableSize = 1 << bestLongTableBits // Size of the table + bestLongLen = 8 // Bytes used for table hash + + // Note: Increasing the short table bits or making the hash shorter + // can actually lead to compression degradation since it will 'steal' more from the + // long match table and match offsets are quite big. + // This greatly depends on the type of input. + bestShortTableBits = 18 // Bits used in the short match table + bestShortTableSize = 1 << bestShortTableBits // Size of the table + bestShortLen = 4 // Bytes used for table hash + +) + +type match struct { + offset int32 + s int32 + length int32 + rep int32 + est int32 +} + +const highScore = maxMatchLen * 8 + +// estBits will estimate output bits from predefined tables. +func (m *match) estBits(bitsPerByte int32) { + mlc := mlCode(uint32(m.length - zstdMinMatch)) + var ofc uint8 + if m.rep < 0 { + ofc = ofCode(uint32(m.s-m.offset) + 3) + } else { + ofc = ofCode(uint32(m.rep) & 3) + } + // Cost, excluding + ofTT, mlTT := fsePredefEnc[tableOffsets].ct.symbolTT[ofc], fsePredefEnc[tableMatchLengths].ct.symbolTT[mlc] + + // Add cost of match encoding... + m.est = int32(ofTT.outBits + mlTT.outBits) + m.est += int32(ofTT.deltaNbBits>>16 + mlTT.deltaNbBits>>16) + // Subtract savings compared to literal encoding... + m.est -= (m.length * bitsPerByte) >> 10 + if m.est > 0 { + // Unlikely gain.. + m.length = 0 + m.est = highScore + } +} + +// bestFastEncoder uses 2 tables, one for short matches (5 bytes) and one for long matches. +// The long match table contains the previous entry with the same hash, +// effectively making it a "chain" of length 2. +// When we find a long match we choose between the two values and select the longest. +// When we find a short match, after checking the long, we check if we can find a long at n+1 +// and that it is longer (lazy matching). +type bestFastEncoder struct { + fastBase + table [bestShortTableSize]prevEntry + longTable [bestLongTableSize]prevEntry + dictTable []prevEntry + dictLongTable []prevEntry +} + +// Encode improves compression... +func (e *bestFastEncoder) Encode(blk *blockEnc, src []byte) { + const ( + // Input margin is the number of bytes we read (8) + // and the maximum we will read ahead (2) + inputMargin = 8 + 4 + minNonLiteralBlockSize = 16 + ) + + // Protect against e.cur wraparound. + for e.cur >= e.bufferReset-int32(len(e.hist)) { + if len(e.hist) == 0 { + e.table = [bestShortTableSize]prevEntry{} + e.longTable = [bestLongTableSize]prevEntry{} + e.cur = e.maxMatchOff + break + } + // Shift down everything in the table that isn't already too far away. + minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff + for i := range e.table[:] { + v := e.table[i].offset + v2 := e.table[i].prev + if v < minOff { + v = 0 + v2 = 0 + } else { + v = v - e.cur + e.maxMatchOff + if v2 < minOff { + v2 = 0 + } else { + v2 = v2 - e.cur + e.maxMatchOff + } + } + e.table[i] = prevEntry{ + offset: v, + prev: v2, + } + } + for i := range e.longTable[:] { + v := e.longTable[i].offset + v2 := e.longTable[i].prev + if v < minOff { + v = 0 + v2 = 0 + } else { + v = v - e.cur + e.maxMatchOff + if v2 < minOff { + v2 = 0 + } else { + v2 = v2 - e.cur + e.maxMatchOff + } + } + e.longTable[i] = prevEntry{ + offset: v, + prev: v2, + } + } + e.cur = e.maxMatchOff + break + } + + // Add block to history + s := e.addBlock(src) + blk.size = len(src) + + // Check RLE first + if len(src) > zstdMinMatch { + ml := matchLen(src[1:], src) + if ml == len(src)-1 { + blk.literals = append(blk.literals, src[0]) + blk.sequences = append(blk.sequences, seq{litLen: 1, matchLen: uint32(len(src)-1) - zstdMinMatch, offset: 1 + 3}) + return + } + } + + if len(src) < minNonLiteralBlockSize { + blk.extraLits = len(src) + blk.literals = blk.literals[:len(src)] + copy(blk.literals, src) + return + } + + // Use this to estimate literal cost. + // Scaled by 10 bits. + bitsPerByte := int32((compress.ShannonEntropyBits(src) * 1024) / len(src)) + // Huffman can never go < 1 bit/byte + if bitsPerByte < 1024 { + bitsPerByte = 1024 + } + + // Override src + src = e.hist + sLimit := int32(len(src)) - inputMargin + const kSearchStrength = 10 + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := s + + // Relative offsets + offset1 := int32(blk.recentOffsets[0]) + offset2 := int32(blk.recentOffsets[1]) + offset3 := int32(blk.recentOffsets[2]) + + addLiterals := func(s *seq, until int32) { + if until == nextEmit { + return + } + blk.literals = append(blk.literals, src[nextEmit:until]...) + s.litLen = uint32(until - nextEmit) + } + + if debugEncoder { + println("recent offsets:", blk.recentOffsets) + } + +encodeLoop: + for { + // We allow the encoder to optionally turn off repeat offsets across blocks + canRepeat := len(blk.sequences) > 2 + + if debugAsserts && canRepeat && offset1 == 0 { + panic("offset0 was 0") + } + + const goodEnough = 250 + + cv := load6432(src, s) + + nextHashL := hashLen(cv, bestLongTableBits, bestLongLen) + nextHashS := hashLen(cv, bestShortTableBits, bestShortLen) + candidateL := e.longTable[nextHashL] + candidateS := e.table[nextHashS] + + // Set m to a match at offset if it looks like that will improve compression. + improve := func(m *match, offset int32, s int32, first uint32, rep int32) { + delta := s - offset + if delta >= e.maxMatchOff || delta <= 0 || load3232(src, offset) != first { + return + } + // Try to quick reject if we already have a long match. + if m.length > 16 { + left := len(src) - int(m.s+m.length) + // If we are too close to the end, keep as is. + if left <= 0 { + return + } + checkLen := m.length - (s - m.s) - 8 + if left > 2 && checkLen > 4 { + // Check 4 bytes, 4 bytes from the end of the current match. + a := load3232(src, offset+checkLen) + b := load3232(src, s+checkLen) + if a != b { + return + } + } + } + l := 4 + e.matchlen(s+4, offset+4, src) + if m.rep <= 0 { + // Extend candidate match backwards as far as possible. + // Do not extend repeats as we can assume they are optimal + // and offsets change if s == nextEmit. + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for offset > tMin && s > nextEmit && src[offset-1] == src[s-1] && l < maxMatchLength { + s-- + offset-- + l++ + } + } + if debugAsserts { + if offset >= s { + panic(fmt.Sprintf("offset: %d - s:%d - rep: %d - cur :%d - max: %d", offset, s, rep, e.cur, e.maxMatchOff)) + } + if !bytes.Equal(src[s:s+l], src[offset:offset+l]) { + panic(fmt.Sprintf("second match mismatch: %v != %v, first: %08x", src[s:s+4], src[offset:offset+4], first)) + } + } + cand := match{offset: offset, s: s, length: l, rep: rep} + cand.estBits(bitsPerByte) + if m.est >= highScore || cand.est-m.est+(cand.s-m.s)*bitsPerByte>>10 < 0 { + *m = cand + } + } + + best := match{s: s, est: highScore} + improve(&best, candidateL.offset-e.cur, s, uint32(cv), -1) + improve(&best, candidateL.prev-e.cur, s, uint32(cv), -1) + improve(&best, candidateS.offset-e.cur, s, uint32(cv), -1) + improve(&best, candidateS.prev-e.cur, s, uint32(cv), -1) + + if canRepeat && best.length < goodEnough { + if s == nextEmit { + // Check repeats straight after a match. + improve(&best, s-offset2, s, uint32(cv), 1|4) + improve(&best, s-offset3, s, uint32(cv), 2|4) + if offset1 > 1 { + improve(&best, s-(offset1-1), s, uint32(cv), 3|4) + } + } + + // If either no match or a non-repeat match, check at + 1 + if best.rep <= 0 { + cv32 := uint32(cv >> 8) + spp := s + 1 + improve(&best, spp-offset1, spp, cv32, 1) + improve(&best, spp-offset2, spp, cv32, 2) + improve(&best, spp-offset3, spp, cv32, 3) + if best.rep < 0 { + cv32 = uint32(cv >> 24) + spp += 2 + improve(&best, spp-offset1, spp, cv32, 1) + improve(&best, spp-offset2, spp, cv32, 2) + improve(&best, spp-offset3, spp, cv32, 3) + } + } + } + // Load next and check... + e.longTable[nextHashL] = prevEntry{offset: s + e.cur, prev: candidateL.offset} + e.table[nextHashS] = prevEntry{offset: s + e.cur, prev: candidateS.offset} + index0 := s + 1 + + // Look far ahead, unless we have a really long match already... + if best.length < goodEnough { + // No match found, move forward on input, no need to check forward... + if best.length < 4 { + s += 1 + (s-nextEmit)>>(kSearchStrength-1) + if s >= sLimit { + break encodeLoop + } + continue + } + + candidateS = e.table[hashLen(cv>>8, bestShortTableBits, bestShortLen)] + cv = load6432(src, s+1) + cv2 := load6432(src, s+2) + candidateL = e.longTable[hashLen(cv, bestLongTableBits, bestLongLen)] + candidateL2 := e.longTable[hashLen(cv2, bestLongTableBits, bestLongLen)] + + // Short at s+1 + improve(&best, candidateS.offset-e.cur, s+1, uint32(cv), -1) + // Long at s+1, s+2 + improve(&best, candidateL.offset-e.cur, s+1, uint32(cv), -1) + improve(&best, candidateL.prev-e.cur, s+1, uint32(cv), -1) + improve(&best, candidateL2.offset-e.cur, s+2, uint32(cv2), -1) + improve(&best, candidateL2.prev-e.cur, s+2, uint32(cv2), -1) + if false { + // Short at s+3. + // Too often worse... + improve(&best, e.table[hashLen(cv2>>8, bestShortTableBits, bestShortLen)].offset-e.cur, s+3, uint32(cv2>>8), -1) + } + + // Start check at a fixed offset to allow for a few mismatches. + // For this compression level 2 yields the best results. + // We cannot do this if we have already indexed this position. + const skipBeginning = 2 + if best.s > s-skipBeginning { + // See if we can find a better match by checking where the current best ends. + // Use that offset to see if we can find a better full match. + if sAt := best.s + best.length; sAt < sLimit { + nextHashL := hashLen(load6432(src, sAt), bestLongTableBits, bestLongLen) + candidateEnd := e.longTable[nextHashL] + + if off := candidateEnd.offset - e.cur - best.length + skipBeginning; off >= 0 { + improve(&best, off, best.s+skipBeginning, load3232(src, best.s+skipBeginning), -1) + if off := candidateEnd.prev - e.cur - best.length + skipBeginning; off >= 0 { + improve(&best, off, best.s+skipBeginning, load3232(src, best.s+skipBeginning), -1) + } + } + } + } + } + + if debugAsserts { + if best.offset >= best.s { + panic(fmt.Sprintf("best.offset > s: %d >= %d", best.offset, best.s)) + } + if best.s < nextEmit { + panic(fmt.Sprintf("s %d < nextEmit %d", best.s, nextEmit)) + } + if best.offset < s-e.maxMatchOff { + panic(fmt.Sprintf("best.offset < s-e.maxMatchOff: %d < %d", best.offset, s-e.maxMatchOff)) + } + if !bytes.Equal(src[best.s:best.s+best.length], src[best.offset:best.offset+best.length]) { + panic(fmt.Sprintf("match mismatch: %v != %v", src[best.s:best.s+best.length], src[best.offset:best.offset+best.length])) + } + } + + // We have a match, we can store the forward value + s = best.s + if best.rep > 0 { + var seq seq + seq.matchLen = uint32(best.length - zstdMinMatch) + addLiterals(&seq, best.s) + + // Repeat. If bit 4 is set, this is a non-lit repeat. + seq.offset = uint32(best.rep & 3) + if debugSequences { + println("repeat sequence", seq, "next s:", best.s, "off:", best.s-best.offset) + } + blk.sequences = append(blk.sequences, seq) + + // Index old s + 1 -> s - 1 + s = best.s + best.length + nextEmit = s + + // Index skipped... + end := s + if s > sLimit+4 { + end = sLimit + 4 + } + off := index0 + e.cur + for index0 < end { + cv0 := load6432(src, index0) + h0 := hashLen(cv0, bestLongTableBits, bestLongLen) + h1 := hashLen(cv0, bestShortTableBits, bestShortLen) + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.table[h1] = prevEntry{offset: off, prev: e.table[h1].offset} + off++ + index0++ + } + + switch best.rep { + case 2, 4 | 1: + offset1, offset2 = offset2, offset1 + case 3, 4 | 2: + offset1, offset2, offset3 = offset3, offset1, offset2 + case 4 | 3: + offset1, offset2, offset3 = offset1-1, offset1, offset2 + } + if s >= sLimit { + if debugEncoder { + println("repeat ended", s, best.length) + } + break encodeLoop + } + continue + } + + // A 4-byte match has been found. Update recent offsets. + // We'll later see if more than 4 bytes. + t := best.offset + offset1, offset2, offset3 = s-t, offset1, offset2 + + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + + if debugAsserts && int(offset1) > len(src) { + panic("invalid offset") + } + + // Write our sequence + var seq seq + l := best.length + seq.litLen = uint32(s - nextEmit) + seq.matchLen = uint32(l - zstdMinMatch) + if seq.litLen > 0 { + blk.literals = append(blk.literals, src[nextEmit:s]...) + } + seq.offset = uint32(s-t) + 3 + s += l + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + nextEmit = s + + // Index old s + 1 -> s - 1 or sLimit + end := s + if s > sLimit-4 { + end = sLimit - 4 + } + + off := index0 + e.cur + for index0 < end { + cv0 := load6432(src, index0) + h0 := hashLen(cv0, bestLongTableBits, bestLongLen) + h1 := hashLen(cv0, bestShortTableBits, bestShortLen) + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.table[h1] = prevEntry{offset: off, prev: e.table[h1].offset} + index0++ + off++ + } + if s >= sLimit { + break encodeLoop + } + } + + if int(nextEmit) < len(src) { + blk.literals = append(blk.literals, src[nextEmit:]...) + blk.extraLits = len(src) - int(nextEmit) + } + blk.recentOffsets[0] = uint32(offset1) + blk.recentOffsets[1] = uint32(offset2) + blk.recentOffsets[2] = uint32(offset3) + if debugEncoder { + println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) + } +} + +// EncodeNoHist will encode a block with no history and no following blocks. +// Most notable difference is that src will not be copied for history and +// we do not need to check for max match length. +func (e *bestFastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { + e.ensureHist(len(src)) + e.Encode(blk, src) +} + +// Reset will reset and set a dictionary if not nil +func (e *bestFastEncoder) Reset(d *dict, singleBlock bool) { + e.resetBase(d, singleBlock) + if d == nil { + return + } + // Init or copy dict table + if len(e.dictTable) != len(e.table) || d.id != e.lastDictID { + if len(e.dictTable) != len(e.table) { + e.dictTable = make([]prevEntry, len(e.table)) + } + end := int32(len(d.content)) - 8 + e.maxMatchOff + for i := e.maxMatchOff; i < end; i += 4 { + const hashLog = bestShortTableBits + + cv := load6432(d.content, i-e.maxMatchOff) + nextHash := hashLen(cv, hashLog, bestShortLen) // 0 -> 4 + nextHash1 := hashLen(cv>>8, hashLog, bestShortLen) // 1 -> 5 + nextHash2 := hashLen(cv>>16, hashLog, bestShortLen) // 2 -> 6 + nextHash3 := hashLen(cv>>24, hashLog, bestShortLen) // 3 -> 7 + e.dictTable[nextHash] = prevEntry{ + prev: e.dictTable[nextHash].offset, + offset: i, + } + e.dictTable[nextHash1] = prevEntry{ + prev: e.dictTable[nextHash1].offset, + offset: i + 1, + } + e.dictTable[nextHash2] = prevEntry{ + prev: e.dictTable[nextHash2].offset, + offset: i + 2, + } + e.dictTable[nextHash3] = prevEntry{ + prev: e.dictTable[nextHash3].offset, + offset: i + 3, + } + } + e.lastDictID = d.id + } + + // Init or copy dict table + if len(e.dictLongTable) != len(e.longTable) || d.id != e.lastDictID { + if len(e.dictLongTable) != len(e.longTable) { + e.dictLongTable = make([]prevEntry, len(e.longTable)) + } + if len(d.content) >= 8 { + cv := load6432(d.content, 0) + h := hashLen(cv, bestLongTableBits, bestLongLen) + e.dictLongTable[h] = prevEntry{ + offset: e.maxMatchOff, + prev: e.dictLongTable[h].offset, + } + + end := int32(len(d.content)) - 8 + e.maxMatchOff + off := 8 // First to read + for i := e.maxMatchOff + 1; i < end; i++ { + cv = cv>>8 | (uint64(d.content[off]) << 56) + h := hashLen(cv, bestLongTableBits, bestLongLen) + e.dictLongTable[h] = prevEntry{ + offset: i, + prev: e.dictLongTable[h].offset, + } + off++ + } + } + e.lastDictID = d.id + } + // Reset table to initial state + copy(e.longTable[:], e.dictLongTable) + + e.cur = e.maxMatchOff + // Reset table to initial state + copy(e.table[:], e.dictTable) +} diff --git a/vendor/github.com/klauspost/compress/zstd/enc_better.go b/vendor/github.com/klauspost/compress/zstd/enc_better.go new file mode 100644 index 0000000000..a4f5bf91fc --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/enc_better.go @@ -0,0 +1,1252 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import "fmt" + +const ( + betterLongTableBits = 19 // Bits used in the long match table + betterLongTableSize = 1 << betterLongTableBits // Size of the table + betterLongLen = 8 // Bytes used for table hash + + // Note: Increasing the short table bits or making the hash shorter + // can actually lead to compression degradation since it will 'steal' more from the + // long match table and match offsets are quite big. + // This greatly depends on the type of input. + betterShortTableBits = 13 // Bits used in the short match table + betterShortTableSize = 1 << betterShortTableBits // Size of the table + betterShortLen = 5 // Bytes used for table hash + + betterLongTableShardCnt = 1 << (betterLongTableBits - dictShardBits) // Number of shards in the table + betterLongTableShardSize = betterLongTableSize / betterLongTableShardCnt // Size of an individual shard + + betterShortTableShardCnt = 1 << (betterShortTableBits - dictShardBits) // Number of shards in the table + betterShortTableShardSize = betterShortTableSize / betterShortTableShardCnt // Size of an individual shard +) + +type prevEntry struct { + offset int32 + prev int32 +} + +// betterFastEncoder uses 2 tables, one for short matches (5 bytes) and one for long matches. +// The long match table contains the previous entry with the same hash, +// effectively making it a "chain" of length 2. +// When we find a long match we choose between the two values and select the longest. +// When we find a short match, after checking the long, we check if we can find a long at n+1 +// and that it is longer (lazy matching). +type betterFastEncoder struct { + fastBase + table [betterShortTableSize]tableEntry + longTable [betterLongTableSize]prevEntry +} + +type betterFastEncoderDict struct { + betterFastEncoder + dictTable []tableEntry + dictLongTable []prevEntry + shortTableShardDirty [betterShortTableShardCnt]bool + longTableShardDirty [betterLongTableShardCnt]bool + allDirty bool +} + +// Encode improves compression... +func (e *betterFastEncoder) Encode(blk *blockEnc, src []byte) { + const ( + // Input margin is the number of bytes we read (8) + // and the maximum we will read ahead (2) + inputMargin = 8 + 2 + minNonLiteralBlockSize = 16 + ) + + // Protect against e.cur wraparound. + for e.cur >= e.bufferReset-int32(len(e.hist)) { + if len(e.hist) == 0 { + e.table = [betterShortTableSize]tableEntry{} + e.longTable = [betterLongTableSize]prevEntry{} + e.cur = e.maxMatchOff + break + } + // Shift down everything in the table that isn't already too far away. + minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff + for i := range e.table[:] { + v := e.table[i].offset + if v < minOff { + v = 0 + } else { + v = v - e.cur + e.maxMatchOff + } + e.table[i].offset = v + } + for i := range e.longTable[:] { + v := e.longTable[i].offset + v2 := e.longTable[i].prev + if v < minOff { + v = 0 + v2 = 0 + } else { + v = v - e.cur + e.maxMatchOff + if v2 < minOff { + v2 = 0 + } else { + v2 = v2 - e.cur + e.maxMatchOff + } + } + e.longTable[i] = prevEntry{ + offset: v, + prev: v2, + } + } + e.cur = e.maxMatchOff + break + } + // Add block to history + s := e.addBlock(src) + blk.size = len(src) + + // Check RLE first + if len(src) > zstdMinMatch { + ml := matchLen(src[1:], src) + if ml == len(src)-1 { + blk.literals = append(blk.literals, src[0]) + blk.sequences = append(blk.sequences, seq{litLen: 1, matchLen: uint32(len(src)-1) - zstdMinMatch, offset: 1 + 3}) + return + } + } + + if len(src) < minNonLiteralBlockSize { + blk.extraLits = len(src) + blk.literals = blk.literals[:len(src)] + copy(blk.literals, src) + return + } + + // Override src + src = e.hist + sLimit := int32(len(src)) - inputMargin + // stepSize is the number of bytes to skip on every main loop iteration. + // It should be >= 1. + const stepSize = 1 + + const kSearchStrength = 9 + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := s + cv := load6432(src, s) + + // Relative offsets + offset1 := int32(blk.recentOffsets[0]) + offset2 := int32(blk.recentOffsets[1]) + + addLiterals := func(s *seq, until int32) { + if until == nextEmit { + return + } + blk.literals = append(blk.literals, src[nextEmit:until]...) + s.litLen = uint32(until - nextEmit) + } + if debugEncoder { + println("recent offsets:", blk.recentOffsets) + } + +encodeLoop: + for { + var t int32 + // We allow the encoder to optionally turn off repeat offsets across blocks + canRepeat := len(blk.sequences) > 2 + var matched, index0 int32 + + for { + if debugAsserts && canRepeat && offset1 == 0 { + panic("offset0 was 0") + } + + nextHashL := hashLen(cv, betterLongTableBits, betterLongLen) + nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) + candidateL := e.longTable[nextHashL] + candidateS := e.table[nextHashS] + + const repOff = 1 + repIndex := s - offset1 + repOff + off := s + e.cur + e.longTable[nextHashL] = prevEntry{offset: off, prev: candidateL.offset} + e.table[nextHashS] = tableEntry{offset: off, val: uint32(cv)} + index0 = s + 1 + + if canRepeat { + if repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff*8)) { + // Consider history as well. + var seq seq + lenght := 4 + e.matchlen(s+4+repOff, repIndex+4, src) + + seq.matchLen = uint32(lenght - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + repOff + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 0 + seq.offset = 1 + if debugSequences { + println("repeat sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Index match start+1 (long) -> s - 1 + index0 := s + repOff + s += lenght + repOff + + nextEmit = s + if s >= sLimit { + if debugEncoder { + println("repeat ended", s, lenght) + + } + break encodeLoop + } + // Index skipped... + for index0 < s-1 { + cv0 := load6432(src, index0) + cv1 := cv0 >> 8 + h0 := hashLen(cv0, betterLongTableBits, betterLongLen) + off := index0 + e.cur + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.table[hashLen(cv1, betterShortTableBits, betterShortLen)] = tableEntry{offset: off + 1, val: uint32(cv1)} + index0 += 2 + } + cv = load6432(src, s) + continue + } + const repOff2 = 1 + + // We deviate from the reference encoder and also check offset 2. + // Still slower and not much better, so disabled. + // repIndex = s - offset2 + repOff2 + if false && repIndex >= 0 && load6432(src, repIndex) == load6432(src, s+repOff) { + // Consider history as well. + var seq seq + lenght := 8 + e.matchlen(s+8+repOff2, repIndex+8, src) + + seq.matchLen = uint32(lenght - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + repOff2 + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 2 + seq.offset = 2 + if debugSequences { + println("repeat sequence 2", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + s += lenght + repOff2 + nextEmit = s + if s >= sLimit { + if debugEncoder { + println("repeat ended", s, lenght) + + } + break encodeLoop + } + + // Index skipped... + for index0 < s-1 { + cv0 := load6432(src, index0) + cv1 := cv0 >> 8 + h0 := hashLen(cv0, betterLongTableBits, betterLongLen) + off := index0 + e.cur + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.table[hashLen(cv1, betterShortTableBits, betterShortLen)] = tableEntry{offset: off + 1, val: uint32(cv1)} + index0 += 2 + } + cv = load6432(src, s) + // Swap offsets + offset1, offset2 = offset2, offset1 + continue + } + } + // Find the offsets of our two matches. + coffsetL := candidateL.offset - e.cur + coffsetLP := candidateL.prev - e.cur + + // Check if we have a long match. + if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) { + // Found a long match, at least 8 bytes. + matched = e.matchlen(s+8, coffsetL+8, src) + 8 + t = coffsetL + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + + if s-coffsetLP < e.maxMatchOff && cv == load6432(src, coffsetLP) { + // Found a long match, at least 8 bytes. + prevMatch := e.matchlen(s+8, coffsetLP+8, src) + 8 + if prevMatch > matched { + matched = prevMatch + t = coffsetLP + } + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + } + break + } + + // Check if we have a long match on prev. + if s-coffsetLP < e.maxMatchOff && cv == load6432(src, coffsetLP) { + // Found a long match, at least 8 bytes. + matched = e.matchlen(s+8, coffsetLP+8, src) + 8 + t = coffsetLP + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + break + } + + coffsetS := candidateS.offset - e.cur + + // Check if we have a short match. + if s-coffsetS < e.maxMatchOff && uint32(cv) == candidateS.val { + // found a regular match + matched = e.matchlen(s+4, coffsetS+4, src) + 4 + + // See if we can find a long match at s+1 + const checkAt = 1 + cv := load6432(src, s+checkAt) + nextHashL = hashLen(cv, betterLongTableBits, betterLongLen) + candidateL = e.longTable[nextHashL] + coffsetL = candidateL.offset - e.cur + + // We can store it, since we have at least a 4 byte match. + e.longTable[nextHashL] = prevEntry{offset: s + checkAt + e.cur, prev: candidateL.offset} + if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) { + // Found a long match, at least 8 bytes. + matchedNext := e.matchlen(s+8+checkAt, coffsetL+8, src) + 8 + if matchedNext > matched { + t = coffsetL + s += checkAt + matched = matchedNext + if debugMatches { + println("long match (after short)") + } + break + } + } + + // Check prev long... + coffsetL = candidateL.prev - e.cur + if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) { + // Found a long match, at least 8 bytes. + matchedNext := e.matchlen(s+8+checkAt, coffsetL+8, src) + 8 + if matchedNext > matched { + t = coffsetL + s += checkAt + matched = matchedNext + if debugMatches { + println("prev long match (after short)") + } + break + } + } + t = coffsetS + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic("t<0") + } + if debugMatches { + println("short match") + } + break + } + + // No match found, move forward in input. + s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1)) + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + } + + // Try to find a better match by searching for a long match at the end of the current best match + if s+matched < sLimit { + // Allow some bytes at the beginning to mismatch. + // Sweet spot is around 3 bytes, but depends on input. + // The skipped bytes are tested in Extend backwards, + // and still picked up as part of the match if they do. + const skipBeginning = 3 + + nextHashL := hashLen(load6432(src, s+matched), betterLongTableBits, betterLongLen) + s2 := s + skipBeginning + cv := load3232(src, s2) + candidateL := e.longTable[nextHashL] + coffsetL := candidateL.offset - e.cur - matched + skipBeginning + if coffsetL >= 0 && coffsetL < s2 && s2-coffsetL < e.maxMatchOff && cv == load3232(src, coffsetL) { + // Found a long match, at least 4 bytes. + matchedNext := e.matchlen(s2+4, coffsetL+4, src) + 4 + if matchedNext > matched { + t = coffsetL + s = s2 + matched = matchedNext + if debugMatches { + println("long match at end-of-match") + } + } + } + + // Check prev long... + if true { + coffsetL = candidateL.prev - e.cur - matched + skipBeginning + if coffsetL >= 0 && coffsetL < s2 && s2-coffsetL < e.maxMatchOff && cv == load3232(src, coffsetL) { + // Found a long match, at least 4 bytes. + matchedNext := e.matchlen(s2+4, coffsetL+4, src) + 4 + if matchedNext > matched { + t = coffsetL + s = s2 + matched = matchedNext + if debugMatches { + println("prev long match at end-of-match") + } + } + } + } + } + // A match has been found. Update recent offsets. + offset2 = offset1 + offset1 = s - t + + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + + if debugAsserts && canRepeat && int(offset1) > len(src) { + panic("invalid offset") + } + + // Extend the n-byte match as long as possible. + l := matched + + // Extend backwards + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { + s-- + t-- + l++ + } + + // Write our sequence + var seq seq + seq.litLen = uint32(s - nextEmit) + seq.matchLen = uint32(l - zstdMinMatch) + if seq.litLen > 0 { + blk.literals = append(blk.literals, src[nextEmit:s]...) + } + seq.offset = uint32(s-t) + 3 + s += l + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + nextEmit = s + if s >= sLimit { + break encodeLoop + } + + // Index match start+1 (long) -> s - 1 + off := index0 + e.cur + for index0 < s-1 { + cv0 := load6432(src, index0) + cv1 := cv0 >> 8 + h0 := hashLen(cv0, betterLongTableBits, betterLongLen) + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.table[hashLen(cv1, betterShortTableBits, betterShortLen)] = tableEntry{offset: off + 1, val: uint32(cv1)} + index0 += 2 + off += 2 + } + + cv = load6432(src, s) + if !canRepeat { + continue + } + + // Check offset 2 + for { + o2 := s - offset2 + if load3232(src, o2) != uint32(cv) { + // Do regular search + break + } + + // Store this, since we have it. + nextHashL := hashLen(cv, betterLongTableBits, betterLongLen) + nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) + + // We have at least 4 byte match. + // No need to check backwards. We come straight from a match + l := 4 + e.matchlen(s+4, o2+4, src) + + e.longTable[nextHashL] = prevEntry{offset: s + e.cur, prev: e.longTable[nextHashL].offset} + e.table[nextHashS] = tableEntry{offset: s + e.cur, val: uint32(cv)} + seq.matchLen = uint32(l) - zstdMinMatch + seq.litLen = 0 + + // Since litlen is always 0, this is offset 1. + seq.offset = 1 + s += l + nextEmit = s + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Swap offset 1 and 2. + offset1, offset2 = offset2, offset1 + if s >= sLimit { + // Finished + break encodeLoop + } + cv = load6432(src, s) + } + } + + if int(nextEmit) < len(src) { + blk.literals = append(blk.literals, src[nextEmit:]...) + blk.extraLits = len(src) - int(nextEmit) + } + blk.recentOffsets[0] = uint32(offset1) + blk.recentOffsets[1] = uint32(offset2) + if debugEncoder { + println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) + } +} + +// EncodeNoHist will encode a block with no history and no following blocks. +// Most notable difference is that src will not be copied for history and +// we do not need to check for max match length. +func (e *betterFastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { + e.ensureHist(len(src)) + e.Encode(blk, src) +} + +// Encode improves compression... +func (e *betterFastEncoderDict) Encode(blk *blockEnc, src []byte) { + const ( + // Input margin is the number of bytes we read (8) + // and the maximum we will read ahead (2) + inputMargin = 8 + 2 + minNonLiteralBlockSize = 16 + ) + + // Protect against e.cur wraparound. + for e.cur >= e.bufferReset-int32(len(e.hist)) { + if len(e.hist) == 0 { + for i := range e.table[:] { + e.table[i] = tableEntry{} + } + for i := range e.longTable[:] { + e.longTable[i] = prevEntry{} + } + e.cur = e.maxMatchOff + e.allDirty = true + break + } + // Shift down everything in the table that isn't already too far away. + minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff + for i := range e.table[:] { + v := e.table[i].offset + if v < minOff { + v = 0 + } else { + v = v - e.cur + e.maxMatchOff + } + e.table[i].offset = v + } + for i := range e.longTable[:] { + v := e.longTable[i].offset + v2 := e.longTable[i].prev + if v < minOff { + v = 0 + v2 = 0 + } else { + v = v - e.cur + e.maxMatchOff + if v2 < minOff { + v2 = 0 + } else { + v2 = v2 - e.cur + e.maxMatchOff + } + } + e.longTable[i] = prevEntry{ + offset: v, + prev: v2, + } + } + e.allDirty = true + e.cur = e.maxMatchOff + break + } + + s := e.addBlock(src) + blk.size = len(src) + if len(src) < minNonLiteralBlockSize { + blk.extraLits = len(src) + blk.literals = blk.literals[:len(src)] + copy(blk.literals, src) + return + } + + // Override src + src = e.hist + sLimit := int32(len(src)) - inputMargin + // stepSize is the number of bytes to skip on every main loop iteration. + // It should be >= 1. + const stepSize = 1 + + const kSearchStrength = 9 + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := s + cv := load6432(src, s) + + // Relative offsets + offset1 := int32(blk.recentOffsets[0]) + offset2 := int32(blk.recentOffsets[1]) + + addLiterals := func(s *seq, until int32) { + if until == nextEmit { + return + } + blk.literals = append(blk.literals, src[nextEmit:until]...) + s.litLen = uint32(until - nextEmit) + } + if debugEncoder { + println("recent offsets:", blk.recentOffsets) + } + +encodeLoop: + for { + var t int32 + // We allow the encoder to optionally turn off repeat offsets across blocks + canRepeat := len(blk.sequences) > 2 + var matched, index0 int32 + + for { + if debugAsserts && canRepeat && offset1 == 0 { + panic("offset0 was 0") + } + + nextHashL := hashLen(cv, betterLongTableBits, betterLongLen) + nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) + candidateL := e.longTable[nextHashL] + candidateS := e.table[nextHashS] + + const repOff = 1 + repIndex := s - offset1 + repOff + off := s + e.cur + e.longTable[nextHashL] = prevEntry{offset: off, prev: candidateL.offset} + e.markLongShardDirty(nextHashL) + e.table[nextHashS] = tableEntry{offset: off, val: uint32(cv)} + e.markShortShardDirty(nextHashS) + index0 = s + 1 + + if canRepeat { + if repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff*8)) { + // Consider history as well. + var seq seq + lenght := 4 + e.matchlen(s+4+repOff, repIndex+4, src) + + seq.matchLen = uint32(lenght - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + repOff + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 0 + seq.offset = 1 + if debugSequences { + println("repeat sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Index match start+1 (long) -> s - 1 + s += lenght + repOff + + nextEmit = s + if s >= sLimit { + if debugEncoder { + println("repeat ended", s, lenght) + + } + break encodeLoop + } + // Index skipped... + for index0 < s-1 { + cv0 := load6432(src, index0) + cv1 := cv0 >> 8 + h0 := hashLen(cv0, betterLongTableBits, betterLongLen) + off := index0 + e.cur + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.markLongShardDirty(h0) + h1 := hashLen(cv1, betterShortTableBits, betterShortLen) + e.table[h1] = tableEntry{offset: off + 1, val: uint32(cv1)} + e.markShortShardDirty(h1) + index0 += 2 + } + cv = load6432(src, s) + continue + } + const repOff2 = 1 + + // We deviate from the reference encoder and also check offset 2. + // Still slower and not much better, so disabled. + // repIndex = s - offset2 + repOff2 + if false && repIndex >= 0 && load6432(src, repIndex) == load6432(src, s+repOff) { + // Consider history as well. + var seq seq + lenght := 8 + e.matchlen(s+8+repOff2, repIndex+8, src) + + seq.matchLen = uint32(lenght - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + repOff2 + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 2 + seq.offset = 2 + if debugSequences { + println("repeat sequence 2", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + s += lenght + repOff2 + nextEmit = s + if s >= sLimit { + if debugEncoder { + println("repeat ended", s, lenght) + + } + break encodeLoop + } + + // Index skipped... + for index0 < s-1 { + cv0 := load6432(src, index0) + cv1 := cv0 >> 8 + h0 := hashLen(cv0, betterLongTableBits, betterLongLen) + off := index0 + e.cur + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.markLongShardDirty(h0) + h1 := hashLen(cv1, betterShortTableBits, betterShortLen) + e.table[h1] = tableEntry{offset: off + 1, val: uint32(cv1)} + e.markShortShardDirty(h1) + index0 += 2 + } + cv = load6432(src, s) + // Swap offsets + offset1, offset2 = offset2, offset1 + continue + } + } + // Find the offsets of our two matches. + coffsetL := candidateL.offset - e.cur + coffsetLP := candidateL.prev - e.cur + + // Check if we have a long match. + if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) { + // Found a long match, at least 8 bytes. + matched = e.matchlen(s+8, coffsetL+8, src) + 8 + t = coffsetL + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + + if s-coffsetLP < e.maxMatchOff && cv == load6432(src, coffsetLP) { + // Found a long match, at least 8 bytes. + prevMatch := e.matchlen(s+8, coffsetLP+8, src) + 8 + if prevMatch > matched { + matched = prevMatch + t = coffsetLP + } + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + } + break + } + + // Check if we have a long match on prev. + if s-coffsetLP < e.maxMatchOff && cv == load6432(src, coffsetLP) { + // Found a long match, at least 8 bytes. + matched = e.matchlen(s+8, coffsetLP+8, src) + 8 + t = coffsetLP + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + break + } + + coffsetS := candidateS.offset - e.cur + + // Check if we have a short match. + if s-coffsetS < e.maxMatchOff && uint32(cv) == candidateS.val { + // found a regular match + matched = e.matchlen(s+4, coffsetS+4, src) + 4 + + // See if we can find a long match at s+1 + const checkAt = 1 + cv := load6432(src, s+checkAt) + nextHashL = hashLen(cv, betterLongTableBits, betterLongLen) + candidateL = e.longTable[nextHashL] + coffsetL = candidateL.offset - e.cur + + // We can store it, since we have at least a 4 byte match. + e.longTable[nextHashL] = prevEntry{offset: s + checkAt + e.cur, prev: candidateL.offset} + e.markLongShardDirty(nextHashL) + if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) { + // Found a long match, at least 8 bytes. + matchedNext := e.matchlen(s+8+checkAt, coffsetL+8, src) + 8 + if matchedNext > matched { + t = coffsetL + s += checkAt + matched = matchedNext + if debugMatches { + println("long match (after short)") + } + break + } + } + + // Check prev long... + coffsetL = candidateL.prev - e.cur + if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) { + // Found a long match, at least 8 bytes. + matchedNext := e.matchlen(s+8+checkAt, coffsetL+8, src) + 8 + if matchedNext > matched { + t = coffsetL + s += checkAt + matched = matchedNext + if debugMatches { + println("prev long match (after short)") + } + break + } + } + t = coffsetS + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic("t<0") + } + if debugMatches { + println("short match") + } + break + } + + // No match found, move forward in input. + s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1)) + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + } + // Try to find a better match by searching for a long match at the end of the current best match + if s+matched < sLimit { + nextHashL := hashLen(load6432(src, s+matched), betterLongTableBits, betterLongLen) + cv := load3232(src, s) + candidateL := e.longTable[nextHashL] + coffsetL := candidateL.offset - e.cur - matched + if coffsetL >= 0 && coffsetL < s && s-coffsetL < e.maxMatchOff && cv == load3232(src, coffsetL) { + // Found a long match, at least 4 bytes. + matchedNext := e.matchlen(s+4, coffsetL+4, src) + 4 + if matchedNext > matched { + t = coffsetL + matched = matchedNext + if debugMatches { + println("long match at end-of-match") + } + } + } + + // Check prev long... + if true { + coffsetL = candidateL.prev - e.cur - matched + if coffsetL >= 0 && coffsetL < s && s-coffsetL < e.maxMatchOff && cv == load3232(src, coffsetL) { + // Found a long match, at least 4 bytes. + matchedNext := e.matchlen(s+4, coffsetL+4, src) + 4 + if matchedNext > matched { + t = coffsetL + matched = matchedNext + if debugMatches { + println("prev long match at end-of-match") + } + } + } + } + } + // A match has been found. Update recent offsets. + offset2 = offset1 + offset1 = s - t + + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + + if debugAsserts && canRepeat && int(offset1) > len(src) { + panic("invalid offset") + } + + // Extend the n-byte match as long as possible. + l := matched + + // Extend backwards + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { + s-- + t-- + l++ + } + + // Write our sequence + var seq seq + seq.litLen = uint32(s - nextEmit) + seq.matchLen = uint32(l - zstdMinMatch) + if seq.litLen > 0 { + blk.literals = append(blk.literals, src[nextEmit:s]...) + } + seq.offset = uint32(s-t) + 3 + s += l + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + nextEmit = s + if s >= sLimit { + break encodeLoop + } + + // Index match start+1 (long) -> s - 1 + off := index0 + e.cur + for index0 < s-1 { + cv0 := load6432(src, index0) + cv1 := cv0 >> 8 + h0 := hashLen(cv0, betterLongTableBits, betterLongLen) + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.markLongShardDirty(h0) + h1 := hashLen(cv1, betterShortTableBits, betterShortLen) + e.table[h1] = tableEntry{offset: off + 1, val: uint32(cv1)} + e.markShortShardDirty(h1) + index0 += 2 + off += 2 + } + + cv = load6432(src, s) + if !canRepeat { + continue + } + + // Check offset 2 + for { + o2 := s - offset2 + if load3232(src, o2) != uint32(cv) { + // Do regular search + break + } + + // Store this, since we have it. + nextHashL := hashLen(cv, betterLongTableBits, betterLongLen) + nextHashS := hashLen(cv, betterShortTableBits, betterShortLen) + + // We have at least 4 byte match. + // No need to check backwards. We come straight from a match + l := 4 + e.matchlen(s+4, o2+4, src) + + e.longTable[nextHashL] = prevEntry{offset: s + e.cur, prev: e.longTable[nextHashL].offset} + e.markLongShardDirty(nextHashL) + e.table[nextHashS] = tableEntry{offset: s + e.cur, val: uint32(cv)} + e.markShortShardDirty(nextHashS) + seq.matchLen = uint32(l) - zstdMinMatch + seq.litLen = 0 + + // Since litlen is always 0, this is offset 1. + seq.offset = 1 + s += l + nextEmit = s + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Swap offset 1 and 2. + offset1, offset2 = offset2, offset1 + if s >= sLimit { + // Finished + break encodeLoop + } + cv = load6432(src, s) + } + } + + if int(nextEmit) < len(src) { + blk.literals = append(blk.literals, src[nextEmit:]...) + blk.extraLits = len(src) - int(nextEmit) + } + blk.recentOffsets[0] = uint32(offset1) + blk.recentOffsets[1] = uint32(offset2) + if debugEncoder { + println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) + } +} + +// ResetDict will reset and set a dictionary if not nil +func (e *betterFastEncoder) Reset(d *dict, singleBlock bool) { + e.resetBase(d, singleBlock) + if d != nil { + panic("betterFastEncoder: Reset with dict") + } +} + +// ResetDict will reset and set a dictionary if not nil +func (e *betterFastEncoderDict) Reset(d *dict, singleBlock bool) { + e.resetBase(d, singleBlock) + if d == nil { + return + } + // Init or copy dict table + if len(e.dictTable) != len(e.table) || d.id != e.lastDictID { + if len(e.dictTable) != len(e.table) { + e.dictTable = make([]tableEntry, len(e.table)) + } + end := int32(len(d.content)) - 8 + e.maxMatchOff + for i := e.maxMatchOff; i < end; i += 4 { + const hashLog = betterShortTableBits + + cv := load6432(d.content, i-e.maxMatchOff) + nextHash := hashLen(cv, hashLog, betterShortLen) // 0 -> 4 + nextHash1 := hashLen(cv>>8, hashLog, betterShortLen) // 1 -> 5 + nextHash2 := hashLen(cv>>16, hashLog, betterShortLen) // 2 -> 6 + nextHash3 := hashLen(cv>>24, hashLog, betterShortLen) // 3 -> 7 + e.dictTable[nextHash] = tableEntry{ + val: uint32(cv), + offset: i, + } + e.dictTable[nextHash1] = tableEntry{ + val: uint32(cv >> 8), + offset: i + 1, + } + e.dictTable[nextHash2] = tableEntry{ + val: uint32(cv >> 16), + offset: i + 2, + } + e.dictTable[nextHash3] = tableEntry{ + val: uint32(cv >> 24), + offset: i + 3, + } + } + e.lastDictID = d.id + e.allDirty = true + } + + // Init or copy dict table + if len(e.dictLongTable) != len(e.longTable) || d.id != e.lastDictID { + if len(e.dictLongTable) != len(e.longTable) { + e.dictLongTable = make([]prevEntry, len(e.longTable)) + } + if len(d.content) >= 8 { + cv := load6432(d.content, 0) + h := hashLen(cv, betterLongTableBits, betterLongLen) + e.dictLongTable[h] = prevEntry{ + offset: e.maxMatchOff, + prev: e.dictLongTable[h].offset, + } + + end := int32(len(d.content)) - 8 + e.maxMatchOff + off := 8 // First to read + for i := e.maxMatchOff + 1; i < end; i++ { + cv = cv>>8 | (uint64(d.content[off]) << 56) + h := hashLen(cv, betterLongTableBits, betterLongLen) + e.dictLongTable[h] = prevEntry{ + offset: i, + prev: e.dictLongTable[h].offset, + } + off++ + } + } + e.lastDictID = d.id + e.allDirty = true + } + + // Reset table to initial state + { + dirtyShardCnt := 0 + if !e.allDirty { + for i := range e.shortTableShardDirty { + if e.shortTableShardDirty[i] { + dirtyShardCnt++ + } + } + } + const shardCnt = betterShortTableShardCnt + const shardSize = betterShortTableShardSize + if e.allDirty || dirtyShardCnt > shardCnt*4/6 { + copy(e.table[:], e.dictTable) + for i := range e.shortTableShardDirty { + e.shortTableShardDirty[i] = false + } + } else { + for i := range e.shortTableShardDirty { + if !e.shortTableShardDirty[i] { + continue + } + + copy(e.table[i*shardSize:(i+1)*shardSize], e.dictTable[i*shardSize:(i+1)*shardSize]) + e.shortTableShardDirty[i] = false + } + } + } + { + dirtyShardCnt := 0 + if !e.allDirty { + for i := range e.shortTableShardDirty { + if e.shortTableShardDirty[i] { + dirtyShardCnt++ + } + } + } + const shardCnt = betterLongTableShardCnt + const shardSize = betterLongTableShardSize + if e.allDirty || dirtyShardCnt > shardCnt*4/6 { + copy(e.longTable[:], e.dictLongTable) + for i := range e.longTableShardDirty { + e.longTableShardDirty[i] = false + } + } else { + for i := range e.longTableShardDirty { + if !e.longTableShardDirty[i] { + continue + } + + copy(e.longTable[i*shardSize:(i+1)*shardSize], e.dictLongTable[i*shardSize:(i+1)*shardSize]) + e.longTableShardDirty[i] = false + } + } + } + e.cur = e.maxMatchOff + e.allDirty = false +} + +func (e *betterFastEncoderDict) markLongShardDirty(entryNum uint32) { + e.longTableShardDirty[entryNum/betterLongTableShardSize] = true +} + +func (e *betterFastEncoderDict) markShortShardDirty(entryNum uint32) { + e.shortTableShardDirty[entryNum/betterShortTableShardSize] = true +} diff --git a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go new file mode 100644 index 0000000000..a154c18f74 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go @@ -0,0 +1,1123 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import "fmt" + +const ( + dFastLongTableBits = 17 // Bits used in the long match table + dFastLongTableSize = 1 << dFastLongTableBits // Size of the table + dFastLongTableMask = dFastLongTableSize - 1 // Mask for table indices. Redundant, but can eliminate bounds checks. + dFastLongLen = 8 // Bytes used for table hash + + dLongTableShardCnt = 1 << (dFastLongTableBits - dictShardBits) // Number of shards in the table + dLongTableShardSize = dFastLongTableSize / tableShardCnt // Size of an individual shard + + dFastShortTableBits = tableBits // Bits used in the short match table + dFastShortTableSize = 1 << dFastShortTableBits // Size of the table + dFastShortTableMask = dFastShortTableSize - 1 // Mask for table indices. Redundant, but can eliminate bounds checks. + dFastShortLen = 5 // Bytes used for table hash + +) + +type doubleFastEncoder struct { + fastEncoder + longTable [dFastLongTableSize]tableEntry +} + +type doubleFastEncoderDict struct { + fastEncoderDict + longTable [dFastLongTableSize]tableEntry + dictLongTable []tableEntry + longTableShardDirty [dLongTableShardCnt]bool +} + +// Encode mimmics functionality in zstd_dfast.c +func (e *doubleFastEncoder) Encode(blk *blockEnc, src []byte) { + const ( + // Input margin is the number of bytes we read (8) + // and the maximum we will read ahead (2) + inputMargin = 8 + 2 + minNonLiteralBlockSize = 16 + ) + + // Protect against e.cur wraparound. + for e.cur >= e.bufferReset-int32(len(e.hist)) { + if len(e.hist) == 0 { + e.table = [dFastShortTableSize]tableEntry{} + e.longTable = [dFastLongTableSize]tableEntry{} + e.cur = e.maxMatchOff + break + } + // Shift down everything in the table that isn't already too far away. + minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff + for i := range e.table[:] { + v := e.table[i].offset + if v < minOff { + v = 0 + } else { + v = v - e.cur + e.maxMatchOff + } + e.table[i].offset = v + } + for i := range e.longTable[:] { + v := e.longTable[i].offset + if v < minOff { + v = 0 + } else { + v = v - e.cur + e.maxMatchOff + } + e.longTable[i].offset = v + } + e.cur = e.maxMatchOff + break + } + + s := e.addBlock(src) + blk.size = len(src) + if len(src) < minNonLiteralBlockSize { + blk.extraLits = len(src) + blk.literals = blk.literals[:len(src)] + copy(blk.literals, src) + return + } + + // Override src + src = e.hist + sLimit := int32(len(src)) - inputMargin + // stepSize is the number of bytes to skip on every main loop iteration. + // It should be >= 1. + const stepSize = 1 + + const kSearchStrength = 8 + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := s + cv := load6432(src, s) + + // Relative offsets + offset1 := int32(blk.recentOffsets[0]) + offset2 := int32(blk.recentOffsets[1]) + + addLiterals := func(s *seq, until int32) { + if until == nextEmit { + return + } + blk.literals = append(blk.literals, src[nextEmit:until]...) + s.litLen = uint32(until - nextEmit) + } + if debugEncoder { + println("recent offsets:", blk.recentOffsets) + } + +encodeLoop: + for { + var t int32 + // We allow the encoder to optionally turn off repeat offsets across blocks + canRepeat := len(blk.sequences) > 2 + + for { + if debugAsserts && canRepeat && offset1 == 0 { + panic("offset0 was 0") + } + + nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) + nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) + candidateL := e.longTable[nextHashL] + candidateS := e.table[nextHashS] + + const repOff = 1 + repIndex := s - offset1 + repOff + entry := tableEntry{offset: s + e.cur, val: uint32(cv)} + e.longTable[nextHashL] = entry + e.table[nextHashS] = entry + + if canRepeat { + if repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff*8)) { + // Consider history as well. + var seq seq + lenght := 4 + e.matchlen(s+4+repOff, repIndex+4, src) + + seq.matchLen = uint32(lenght - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + repOff + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 0 + seq.offset = 1 + if debugSequences { + println("repeat sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + s += lenght + repOff + nextEmit = s + if s >= sLimit { + if debugEncoder { + println("repeat ended", s, lenght) + + } + break encodeLoop + } + cv = load6432(src, s) + continue + } + } + // Find the offsets of our two matches. + coffsetL := s - (candidateL.offset - e.cur) + coffsetS := s - (candidateS.offset - e.cur) + + // Check if we have a long match. + if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val { + // Found a long match, likely at least 8 bytes. + // Reference encoder checks all 8 bytes, we only check 4, + // but the likelihood of both the first 4 bytes and the hash matching should be enough. + t = candidateL.offset - e.cur + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + break + } + + // Check if we have a short match. + if coffsetS < e.maxMatchOff && uint32(cv) == candidateS.val { + // found a regular match + // See if we can find a long match at s+1 + const checkAt = 1 + cv := load6432(src, s+checkAt) + nextHashL = hashLen(cv, dFastLongTableBits, dFastLongLen) + candidateL = e.longTable[nextHashL] + coffsetL = s - (candidateL.offset - e.cur) + checkAt + + // We can store it, since we have at least a 4 byte match. + e.longTable[nextHashL] = tableEntry{offset: s + checkAt + e.cur, val: uint32(cv)} + if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val { + // Found a long match, likely at least 8 bytes. + // Reference encoder checks all 8 bytes, we only check 4, + // but the likelihood of both the first 4 bytes and the hash matching should be enough. + t = candidateL.offset - e.cur + s += checkAt + if debugMatches { + println("long match (after short)") + } + break + } + + t = candidateS.offset - e.cur + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic("t<0") + } + if debugMatches { + println("short match") + } + break + } + + // No match found, move forward in input. + s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1)) + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + } + + // A 4-byte match has been found. Update recent offsets. + // We'll later see if more than 4 bytes. + offset2 = offset1 + offset1 = s - t + + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + + if debugAsserts && canRepeat && int(offset1) > len(src) { + panic("invalid offset") + } + + // Extend the 4-byte match as long as possible. + l := e.matchlen(s+4, t+4, src) + 4 + + // Extend backwards + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { + s-- + t-- + l++ + } + + // Write our sequence + var seq seq + seq.litLen = uint32(s - nextEmit) + seq.matchLen = uint32(l - zstdMinMatch) + if seq.litLen > 0 { + blk.literals = append(blk.literals, src[nextEmit:s]...) + } + seq.offset = uint32(s-t) + 3 + s += l + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + nextEmit = s + if s >= sLimit { + break encodeLoop + } + + // Index match start+1 (long) and start+2 (short) + index0 := s - l + 1 + // Index match end-2 (long) and end-1 (short) + index1 := s - 2 + + cv0 := load6432(src, index0) + cv1 := load6432(src, index1) + te0 := tableEntry{offset: index0 + e.cur, val: uint32(cv0)} + te1 := tableEntry{offset: index1 + e.cur, val: uint32(cv1)} + e.longTable[hashLen(cv0, dFastLongTableBits, dFastLongLen)] = te0 + e.longTable[hashLen(cv1, dFastLongTableBits, dFastLongLen)] = te1 + cv0 >>= 8 + cv1 >>= 8 + te0.offset++ + te1.offset++ + te0.val = uint32(cv0) + te1.val = uint32(cv1) + e.table[hashLen(cv0, dFastShortTableBits, dFastShortLen)] = te0 + e.table[hashLen(cv1, dFastShortTableBits, dFastShortLen)] = te1 + + cv = load6432(src, s) + + if !canRepeat { + continue + } + + // Check offset 2 + for { + o2 := s - offset2 + if load3232(src, o2) != uint32(cv) { + // Do regular search + break + } + + // Store this, since we have it. + nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) + nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) + + // We have at least 4 byte match. + // No need to check backwards. We come straight from a match + l := 4 + e.matchlen(s+4, o2+4, src) + + entry := tableEntry{offset: s + e.cur, val: uint32(cv)} + e.longTable[nextHashL] = entry + e.table[nextHashS] = entry + seq.matchLen = uint32(l) - zstdMinMatch + seq.litLen = 0 + + // Since litlen is always 0, this is offset 1. + seq.offset = 1 + s += l + nextEmit = s + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Swap offset 1 and 2. + offset1, offset2 = offset2, offset1 + if s >= sLimit { + // Finished + break encodeLoop + } + cv = load6432(src, s) + } + } + + if int(nextEmit) < len(src) { + blk.literals = append(blk.literals, src[nextEmit:]...) + blk.extraLits = len(src) - int(nextEmit) + } + blk.recentOffsets[0] = uint32(offset1) + blk.recentOffsets[1] = uint32(offset2) + if debugEncoder { + println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) + } +} + +// EncodeNoHist will encode a block with no history and no following blocks. +// Most notable difference is that src will not be copied for history and +// we do not need to check for max match length. +func (e *doubleFastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { + const ( + // Input margin is the number of bytes we read (8) + // and the maximum we will read ahead (2) + inputMargin = 8 + 2 + minNonLiteralBlockSize = 16 + ) + + // Protect against e.cur wraparound. + if e.cur >= e.bufferReset { + for i := range e.table[:] { + e.table[i] = tableEntry{} + } + for i := range e.longTable[:] { + e.longTable[i] = tableEntry{} + } + e.cur = e.maxMatchOff + } + + s := int32(0) + blk.size = len(src) + if len(src) < minNonLiteralBlockSize { + blk.extraLits = len(src) + blk.literals = blk.literals[:len(src)] + copy(blk.literals, src) + return + } + + // Override src + sLimit := int32(len(src)) - inputMargin + // stepSize is the number of bytes to skip on every main loop iteration. + // It should be >= 1. + const stepSize = 1 + + const kSearchStrength = 8 + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := s + cv := load6432(src, s) + + // Relative offsets + offset1 := int32(blk.recentOffsets[0]) + offset2 := int32(blk.recentOffsets[1]) + + addLiterals := func(s *seq, until int32) { + if until == nextEmit { + return + } + blk.literals = append(blk.literals, src[nextEmit:until]...) + s.litLen = uint32(until - nextEmit) + } + if debugEncoder { + println("recent offsets:", blk.recentOffsets) + } + +encodeLoop: + for { + var t int32 + for { + + nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) + nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) + candidateL := e.longTable[nextHashL] + candidateS := e.table[nextHashS] + + const repOff = 1 + repIndex := s - offset1 + repOff + entry := tableEntry{offset: s + e.cur, val: uint32(cv)} + e.longTable[nextHashL] = entry + e.table[nextHashS] = entry + + if len(blk.sequences) > 2 { + if load3232(src, repIndex) == uint32(cv>>(repOff*8)) { + // Consider history as well. + var seq seq + //length := 4 + e.matchlen(s+4+repOff, repIndex+4, src) + length := 4 + int32(matchLen(src[s+4+repOff:], src[repIndex+4:])) + + seq.matchLen = uint32(length - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + repOff + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 0 + seq.offset = 1 + if debugSequences { + println("repeat sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + s += length + repOff + nextEmit = s + if s >= sLimit { + if debugEncoder { + println("repeat ended", s, length) + + } + break encodeLoop + } + cv = load6432(src, s) + continue + } + } + // Find the offsets of our two matches. + coffsetL := s - (candidateL.offset - e.cur) + coffsetS := s - (candidateS.offset - e.cur) + + // Check if we have a long match. + if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val { + // Found a long match, likely at least 8 bytes. + // Reference encoder checks all 8 bytes, we only check 4, + // but the likelihood of both the first 4 bytes and the hash matching should be enough. + t = candidateL.offset - e.cur + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d). cur: %d", s, t, e.cur)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + break + } + + // Check if we have a short match. + if coffsetS < e.maxMatchOff && uint32(cv) == candidateS.val { + // found a regular match + // See if we can find a long match at s+1 + const checkAt = 1 + cv := load6432(src, s+checkAt) + nextHashL = hashLen(cv, dFastLongTableBits, dFastLongLen) + candidateL = e.longTable[nextHashL] + coffsetL = s - (candidateL.offset - e.cur) + checkAt + + // We can store it, since we have at least a 4 byte match. + e.longTable[nextHashL] = tableEntry{offset: s + checkAt + e.cur, val: uint32(cv)} + if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val { + // Found a long match, likely at least 8 bytes. + // Reference encoder checks all 8 bytes, we only check 4, + // but the likelihood of both the first 4 bytes and the hash matching should be enough. + t = candidateL.offset - e.cur + s += checkAt + if debugMatches { + println("long match (after short)") + } + break + } + + t = candidateS.offset - e.cur + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic("t<0") + } + if debugMatches { + println("short match") + } + break + } + + // No match found, move forward in input. + s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1)) + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + } + + // A 4-byte match has been found. Update recent offsets. + // We'll later see if more than 4 bytes. + offset2 = offset1 + offset1 = s - t + + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + + // Extend the 4-byte match as long as possible. + //l := e.matchlen(s+4, t+4, src) + 4 + l := int32(matchLen(src[s+4:], src[t+4:])) + 4 + + // Extend backwards + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for t > tMin && s > nextEmit && src[t-1] == src[s-1] { + s-- + t-- + l++ + } + + // Write our sequence + var seq seq + seq.litLen = uint32(s - nextEmit) + seq.matchLen = uint32(l - zstdMinMatch) + if seq.litLen > 0 { + blk.literals = append(blk.literals, src[nextEmit:s]...) + } + seq.offset = uint32(s-t) + 3 + s += l + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + nextEmit = s + if s >= sLimit { + break encodeLoop + } + + // Index match start+1 (long) and start+2 (short) + index0 := s - l + 1 + // Index match end-2 (long) and end-1 (short) + index1 := s - 2 + + cv0 := load6432(src, index0) + cv1 := load6432(src, index1) + te0 := tableEntry{offset: index0 + e.cur, val: uint32(cv0)} + te1 := tableEntry{offset: index1 + e.cur, val: uint32(cv1)} + e.longTable[hashLen(cv0, dFastLongTableBits, dFastLongLen)] = te0 + e.longTable[hashLen(cv1, dFastLongTableBits, dFastLongLen)] = te1 + cv0 >>= 8 + cv1 >>= 8 + te0.offset++ + te1.offset++ + te0.val = uint32(cv0) + te1.val = uint32(cv1) + e.table[hashLen(cv0, dFastShortTableBits, dFastShortLen)] = te0 + e.table[hashLen(cv1, dFastShortTableBits, dFastShortLen)] = te1 + + cv = load6432(src, s) + + if len(blk.sequences) <= 2 { + continue + } + + // Check offset 2 + for { + o2 := s - offset2 + if load3232(src, o2) != uint32(cv) { + // Do regular search + break + } + + // Store this, since we have it. + nextHashS := hashLen(cv1>>8, dFastShortTableBits, dFastShortLen) + nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) + + // We have at least 4 byte match. + // No need to check backwards. We come straight from a match + //l := 4 + e.matchlen(s+4, o2+4, src) + l := 4 + int32(matchLen(src[s+4:], src[o2+4:])) + + entry := tableEntry{offset: s + e.cur, val: uint32(cv)} + e.longTable[nextHashL] = entry + e.table[nextHashS] = entry + seq.matchLen = uint32(l) - zstdMinMatch + seq.litLen = 0 + + // Since litlen is always 0, this is offset 1. + seq.offset = 1 + s += l + nextEmit = s + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Swap offset 1 and 2. + offset1, offset2 = offset2, offset1 + if s >= sLimit { + // Finished + break encodeLoop + } + cv = load6432(src, s) + } + } + + if int(nextEmit) < len(src) { + blk.literals = append(blk.literals, src[nextEmit:]...) + blk.extraLits = len(src) - int(nextEmit) + } + if debugEncoder { + println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) + } + + // We do not store history, so we must offset e.cur to avoid false matches for next user. + if e.cur < e.bufferReset { + e.cur += int32(len(src)) + } +} + +// Encode will encode the content, with a dictionary if initialized for it. +func (e *doubleFastEncoderDict) Encode(blk *blockEnc, src []byte) { + const ( + // Input margin is the number of bytes we read (8) + // and the maximum we will read ahead (2) + inputMargin = 8 + 2 + minNonLiteralBlockSize = 16 + ) + + // Protect against e.cur wraparound. + for e.cur >= e.bufferReset-int32(len(e.hist)) { + if len(e.hist) == 0 { + for i := range e.table[:] { + e.table[i] = tableEntry{} + } + for i := range e.longTable[:] { + e.longTable[i] = tableEntry{} + } + e.markAllShardsDirty() + e.cur = e.maxMatchOff + break + } + // Shift down everything in the table that isn't already too far away. + minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff + for i := range e.table[:] { + v := e.table[i].offset + if v < minOff { + v = 0 + } else { + v = v - e.cur + e.maxMatchOff + } + e.table[i].offset = v + } + for i := range e.longTable[:] { + v := e.longTable[i].offset + if v < minOff { + v = 0 + } else { + v = v - e.cur + e.maxMatchOff + } + e.longTable[i].offset = v + } + e.markAllShardsDirty() + e.cur = e.maxMatchOff + break + } + + s := e.addBlock(src) + blk.size = len(src) + if len(src) < minNonLiteralBlockSize { + blk.extraLits = len(src) + blk.literals = blk.literals[:len(src)] + copy(blk.literals, src) + return + } + + // Override src + src = e.hist + sLimit := int32(len(src)) - inputMargin + // stepSize is the number of bytes to skip on every main loop iteration. + // It should be >= 1. + const stepSize = 1 + + const kSearchStrength = 8 + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := s + cv := load6432(src, s) + + // Relative offsets + offset1 := int32(blk.recentOffsets[0]) + offset2 := int32(blk.recentOffsets[1]) + + addLiterals := func(s *seq, until int32) { + if until == nextEmit { + return + } + blk.literals = append(blk.literals, src[nextEmit:until]...) + s.litLen = uint32(until - nextEmit) + } + if debugEncoder { + println("recent offsets:", blk.recentOffsets) + } + +encodeLoop: + for { + var t int32 + // We allow the encoder to optionally turn off repeat offsets across blocks + canRepeat := len(blk.sequences) > 2 + + for { + if debugAsserts && canRepeat && offset1 == 0 { + panic("offset0 was 0") + } + + nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) + nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) + candidateL := e.longTable[nextHashL] + candidateS := e.table[nextHashS] + + const repOff = 1 + repIndex := s - offset1 + repOff + entry := tableEntry{offset: s + e.cur, val: uint32(cv)} + e.longTable[nextHashL] = entry + e.markLongShardDirty(nextHashL) + e.table[nextHashS] = entry + e.markShardDirty(nextHashS) + + if canRepeat { + if repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff*8)) { + // Consider history as well. + var seq seq + lenght := 4 + e.matchlen(s+4+repOff, repIndex+4, src) + + seq.matchLen = uint32(lenght - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + repOff + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 0 + seq.offset = 1 + if debugSequences { + println("repeat sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + s += lenght + repOff + nextEmit = s + if s >= sLimit { + if debugEncoder { + println("repeat ended", s, lenght) + + } + break encodeLoop + } + cv = load6432(src, s) + continue + } + } + // Find the offsets of our two matches. + coffsetL := s - (candidateL.offset - e.cur) + coffsetS := s - (candidateS.offset - e.cur) + + // Check if we have a long match. + if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val { + // Found a long match, likely at least 8 bytes. + // Reference encoder checks all 8 bytes, we only check 4, + // but the likelihood of both the first 4 bytes and the hash matching should be enough. + t = candidateL.offset - e.cur + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + break + } + + // Check if we have a short match. + if coffsetS < e.maxMatchOff && uint32(cv) == candidateS.val { + // found a regular match + // See if we can find a long match at s+1 + const checkAt = 1 + cv := load6432(src, s+checkAt) + nextHashL = hashLen(cv, dFastLongTableBits, dFastLongLen) + candidateL = e.longTable[nextHashL] + coffsetL = s - (candidateL.offset - e.cur) + checkAt + + // We can store it, since we have at least a 4 byte match. + e.longTable[nextHashL] = tableEntry{offset: s + checkAt + e.cur, val: uint32(cv)} + e.markLongShardDirty(nextHashL) + if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val { + // Found a long match, likely at least 8 bytes. + // Reference encoder checks all 8 bytes, we only check 4, + // but the likelihood of both the first 4 bytes and the hash matching should be enough. + t = candidateL.offset - e.cur + s += checkAt + if debugMatches { + println("long match (after short)") + } + break + } + + t = candidateS.offset - e.cur + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic("t<0") + } + if debugMatches { + println("short match") + } + break + } + + // No match found, move forward in input. + s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1)) + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + } + + // A 4-byte match has been found. Update recent offsets. + // We'll later see if more than 4 bytes. + offset2 = offset1 + offset1 = s - t + + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + + if debugAsserts && canRepeat && int(offset1) > len(src) { + panic("invalid offset") + } + + // Extend the 4-byte match as long as possible. + l := e.matchlen(s+4, t+4, src) + 4 + + // Extend backwards + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { + s-- + t-- + l++ + } + + // Write our sequence + var seq seq + seq.litLen = uint32(s - nextEmit) + seq.matchLen = uint32(l - zstdMinMatch) + if seq.litLen > 0 { + blk.literals = append(blk.literals, src[nextEmit:s]...) + } + seq.offset = uint32(s-t) + 3 + s += l + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + nextEmit = s + if s >= sLimit { + break encodeLoop + } + + // Index match start+1 (long) and start+2 (short) + index0 := s - l + 1 + // Index match end-2 (long) and end-1 (short) + index1 := s - 2 + + cv0 := load6432(src, index0) + cv1 := load6432(src, index1) + te0 := tableEntry{offset: index0 + e.cur, val: uint32(cv0)} + te1 := tableEntry{offset: index1 + e.cur, val: uint32(cv1)} + longHash1 := hashLen(cv0, dFastLongTableBits, dFastLongLen) + longHash2 := hashLen(cv1, dFastLongTableBits, dFastLongLen) + e.longTable[longHash1] = te0 + e.longTable[longHash2] = te1 + e.markLongShardDirty(longHash1) + e.markLongShardDirty(longHash2) + cv0 >>= 8 + cv1 >>= 8 + te0.offset++ + te1.offset++ + te0.val = uint32(cv0) + te1.val = uint32(cv1) + hashVal1 := hashLen(cv0, dFastShortTableBits, dFastShortLen) + hashVal2 := hashLen(cv1, dFastShortTableBits, dFastShortLen) + e.table[hashVal1] = te0 + e.markShardDirty(hashVal1) + e.table[hashVal2] = te1 + e.markShardDirty(hashVal2) + + cv = load6432(src, s) + + if !canRepeat { + continue + } + + // Check offset 2 + for { + o2 := s - offset2 + if load3232(src, o2) != uint32(cv) { + // Do regular search + break + } + + // Store this, since we have it. + nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen) + nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen) + + // We have at least 4 byte match. + // No need to check backwards. We come straight from a match + l := 4 + e.matchlen(s+4, o2+4, src) + + entry := tableEntry{offset: s + e.cur, val: uint32(cv)} + e.longTable[nextHashL] = entry + e.markLongShardDirty(nextHashL) + e.table[nextHashS] = entry + e.markShardDirty(nextHashS) + seq.matchLen = uint32(l) - zstdMinMatch + seq.litLen = 0 + + // Since litlen is always 0, this is offset 1. + seq.offset = 1 + s += l + nextEmit = s + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Swap offset 1 and 2. + offset1, offset2 = offset2, offset1 + if s >= sLimit { + // Finished + break encodeLoop + } + cv = load6432(src, s) + } + } + + if int(nextEmit) < len(src) { + blk.literals = append(blk.literals, src[nextEmit:]...) + blk.extraLits = len(src) - int(nextEmit) + } + blk.recentOffsets[0] = uint32(offset1) + blk.recentOffsets[1] = uint32(offset2) + if debugEncoder { + println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) + } + // If we encoded more than 64K mark all dirty. + if len(src) > 64<<10 { + e.markAllShardsDirty() + } +} + +// ResetDict will reset and set a dictionary if not nil +func (e *doubleFastEncoder) Reset(d *dict, singleBlock bool) { + e.fastEncoder.Reset(d, singleBlock) + if d != nil { + panic("doubleFastEncoder: Reset with dict not supported") + } +} + +// ResetDict will reset and set a dictionary if not nil +func (e *doubleFastEncoderDict) Reset(d *dict, singleBlock bool) { + allDirty := e.allDirty + e.fastEncoderDict.Reset(d, singleBlock) + if d == nil { + return + } + + // Init or copy dict table + if len(e.dictLongTable) != len(e.longTable) || d.id != e.lastDictID { + if len(e.dictLongTable) != len(e.longTable) { + e.dictLongTable = make([]tableEntry, len(e.longTable)) + } + if len(d.content) >= 8 { + cv := load6432(d.content, 0) + e.dictLongTable[hashLen(cv, dFastLongTableBits, dFastLongLen)] = tableEntry{ + val: uint32(cv), + offset: e.maxMatchOff, + } + end := int32(len(d.content)) - 8 + e.maxMatchOff + for i := e.maxMatchOff + 1; i < end; i++ { + cv = cv>>8 | (uint64(d.content[i-e.maxMatchOff+7]) << 56) + e.dictLongTable[hashLen(cv, dFastLongTableBits, dFastLongLen)] = tableEntry{ + val: uint32(cv), + offset: i, + } + } + } + e.lastDictID = d.id + allDirty = true + } + // Reset table to initial state + e.cur = e.maxMatchOff + + dirtyShardCnt := 0 + if !allDirty { + for i := range e.longTableShardDirty { + if e.longTableShardDirty[i] { + dirtyShardCnt++ + } + } + } + + if allDirty || dirtyShardCnt > dLongTableShardCnt/2 { + //copy(e.longTable[:], e.dictLongTable) + e.longTable = *(*[dFastLongTableSize]tableEntry)(e.dictLongTable) + for i := range e.longTableShardDirty { + e.longTableShardDirty[i] = false + } + return + } + for i := range e.longTableShardDirty { + if !e.longTableShardDirty[i] { + continue + } + + // copy(e.longTable[i*dLongTableShardSize:(i+1)*dLongTableShardSize], e.dictLongTable[i*dLongTableShardSize:(i+1)*dLongTableShardSize]) + *(*[dLongTableShardSize]tableEntry)(e.longTable[i*dLongTableShardSize:]) = *(*[dLongTableShardSize]tableEntry)(e.dictLongTable[i*dLongTableShardSize:]) + + e.longTableShardDirty[i] = false + } +} + +func (e *doubleFastEncoderDict) markLongShardDirty(entryNum uint32) { + e.longTableShardDirty[entryNum/dLongTableShardSize] = true +} diff --git a/vendor/github.com/klauspost/compress/zstd/enc_fast.go b/vendor/github.com/klauspost/compress/zstd/enc_fast.go new file mode 100644 index 0000000000..f45a3da7da --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/enc_fast.go @@ -0,0 +1,891 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "fmt" +) + +const ( + tableBits = 15 // Bits used in the table + tableSize = 1 << tableBits // Size of the table + tableShardCnt = 1 << (tableBits - dictShardBits) // Number of shards in the table + tableShardSize = tableSize / tableShardCnt // Size of an individual shard + tableFastHashLen = 6 + tableMask = tableSize - 1 // Mask for table indices. Redundant, but can eliminate bounds checks. + maxMatchLength = 131074 +) + +type tableEntry struct { + val uint32 + offset int32 +} + +type fastEncoder struct { + fastBase + table [tableSize]tableEntry +} + +type fastEncoderDict struct { + fastEncoder + dictTable []tableEntry + tableShardDirty [tableShardCnt]bool + allDirty bool +} + +// Encode mimmics functionality in zstd_fast.c +func (e *fastEncoder) Encode(blk *blockEnc, src []byte) { + const ( + inputMargin = 8 + minNonLiteralBlockSize = 1 + 1 + inputMargin + ) + + // Protect against e.cur wraparound. + for e.cur >= e.bufferReset-int32(len(e.hist)) { + if len(e.hist) == 0 { + for i := range e.table[:] { + e.table[i] = tableEntry{} + } + e.cur = e.maxMatchOff + break + } + // Shift down everything in the table that isn't already too far away. + minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff + for i := range e.table[:] { + v := e.table[i].offset + if v < minOff { + v = 0 + } else { + v = v - e.cur + e.maxMatchOff + } + e.table[i].offset = v + } + e.cur = e.maxMatchOff + break + } + + s := e.addBlock(src) + blk.size = len(src) + if len(src) < minNonLiteralBlockSize { + blk.extraLits = len(src) + blk.literals = blk.literals[:len(src)] + copy(blk.literals, src) + return + } + + // Override src + src = e.hist + sLimit := int32(len(src)) - inputMargin + // stepSize is the number of bytes to skip on every main loop iteration. + // It should be >= 2. + const stepSize = 2 + + // TEMPLATE + const hashLog = tableBits + // seems global, but would be nice to tweak. + const kSearchStrength = 6 + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := s + cv := load6432(src, s) + + // Relative offsets + offset1 := int32(blk.recentOffsets[0]) + offset2 := int32(blk.recentOffsets[1]) + + addLiterals := func(s *seq, until int32) { + if until == nextEmit { + return + } + blk.literals = append(blk.literals, src[nextEmit:until]...) + s.litLen = uint32(until - nextEmit) + } + if debugEncoder { + println("recent offsets:", blk.recentOffsets) + } + +encodeLoop: + for { + // t will contain the match offset when we find one. + // When existing the search loop, we have already checked 4 bytes. + var t int32 + + // We will not use repeat offsets across blocks. + // By not using them for the first 3 matches + canRepeat := len(blk.sequences) > 2 + + for { + if debugAsserts && canRepeat && offset1 == 0 { + panic("offset0 was 0") + } + + nextHash := hashLen(cv, hashLog, tableFastHashLen) + nextHash2 := hashLen(cv>>8, hashLog, tableFastHashLen) + candidate := e.table[nextHash] + candidate2 := e.table[nextHash2] + repIndex := s - offset1 + 2 + + e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)} + e.table[nextHash2] = tableEntry{offset: s + e.cur + 1, val: uint32(cv >> 8)} + + if canRepeat && repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>16) { + // Consider history as well. + var seq seq + length := 4 + e.matchlen(s+6, repIndex+4, src) + seq.matchLen = uint32(length - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + 2 + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + sMin := s - e.maxMatchOff + if sMin < 0 { + sMin = 0 + } + for repIndex > sMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 0 + seq.offset = 1 + if debugSequences { + println("repeat sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + s += length + 2 + nextEmit = s + if s >= sLimit { + if debugEncoder { + println("repeat ended", s, length) + + } + break encodeLoop + } + cv = load6432(src, s) + continue + } + coffset0 := s - (candidate.offset - e.cur) + coffset1 := s - (candidate2.offset - e.cur) + 1 + if coffset0 < e.maxMatchOff && uint32(cv) == candidate.val { + // found a regular match + t = candidate.offset - e.cur + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + break + } + + if coffset1 < e.maxMatchOff && uint32(cv>>8) == candidate2.val { + // found a regular match + t = candidate2.offset - e.cur + s++ + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic("t<0") + } + break + } + s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1)) + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + } + // A 4-byte match has been found. We'll later see if more than 4 bytes. + offset2 = offset1 + offset1 = s - t + + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + + if debugAsserts && canRepeat && int(offset1) > len(src) { + panic("invalid offset") + } + + // Extend the 4-byte match as long as possible. + l := e.matchlen(s+4, t+4, src) + 4 + + // Extend backwards + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { + s-- + t-- + l++ + } + + // Write our sequence. + var seq seq + seq.litLen = uint32(s - nextEmit) + seq.matchLen = uint32(l - zstdMinMatch) + if seq.litLen > 0 { + blk.literals = append(blk.literals, src[nextEmit:s]...) + } + // Don't use repeat offsets + seq.offset = uint32(s-t) + 3 + s += l + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + nextEmit = s + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + + // Check offset 2 + if o2 := s - offset2; canRepeat && load3232(src, o2) == uint32(cv) { + // We have at least 4 byte match. + // No need to check backwards. We come straight from a match + l := 4 + e.matchlen(s+4, o2+4, src) + + // Store this, since we have it. + nextHash := hashLen(cv, hashLog, tableFastHashLen) + e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)} + seq.matchLen = uint32(l) - zstdMinMatch + seq.litLen = 0 + // Since litlen is always 0, this is offset 1. + seq.offset = 1 + s += l + nextEmit = s + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Swap offset 1 and 2. + offset1, offset2 = offset2, offset1 + if s >= sLimit { + break encodeLoop + } + // Prepare next loop. + cv = load6432(src, s) + } + } + + if int(nextEmit) < len(src) { + blk.literals = append(blk.literals, src[nextEmit:]...) + blk.extraLits = len(src) - int(nextEmit) + } + blk.recentOffsets[0] = uint32(offset1) + blk.recentOffsets[1] = uint32(offset2) + if debugEncoder { + println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) + } +} + +// EncodeNoHist will encode a block with no history and no following blocks. +// Most notable difference is that src will not be copied for history and +// we do not need to check for max match length. +func (e *fastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { + const ( + inputMargin = 8 + minNonLiteralBlockSize = 1 + 1 + inputMargin + ) + if debugEncoder { + if len(src) > maxCompressedBlockSize { + panic("src too big") + } + } + + // Protect against e.cur wraparound. + if e.cur >= e.bufferReset { + for i := range e.table[:] { + e.table[i] = tableEntry{} + } + e.cur = e.maxMatchOff + } + + s := int32(0) + blk.size = len(src) + if len(src) < minNonLiteralBlockSize { + blk.extraLits = len(src) + blk.literals = blk.literals[:len(src)] + copy(blk.literals, src) + return + } + + sLimit := int32(len(src)) - inputMargin + // stepSize is the number of bytes to skip on every main loop iteration. + // It should be >= 2. + const stepSize = 2 + + // TEMPLATE + const hashLog = tableBits + // seems global, but would be nice to tweak. + const kSearchStrength = 6 + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := s + cv := load6432(src, s) + + // Relative offsets + offset1 := int32(blk.recentOffsets[0]) + offset2 := int32(blk.recentOffsets[1]) + + addLiterals := func(s *seq, until int32) { + if until == nextEmit { + return + } + blk.literals = append(blk.literals, src[nextEmit:until]...) + s.litLen = uint32(until - nextEmit) + } + if debugEncoder { + println("recent offsets:", blk.recentOffsets) + } + +encodeLoop: + for { + // t will contain the match offset when we find one. + // When existing the search loop, we have already checked 4 bytes. + var t int32 + + // We will not use repeat offsets across blocks. + // By not using them for the first 3 matches + + for { + nextHash := hashLen(cv, hashLog, tableFastHashLen) + nextHash2 := hashLen(cv>>8, hashLog, tableFastHashLen) + candidate := e.table[nextHash] + candidate2 := e.table[nextHash2] + repIndex := s - offset1 + 2 + + e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)} + e.table[nextHash2] = tableEntry{offset: s + e.cur + 1, val: uint32(cv >> 8)} + + if len(blk.sequences) > 2 && load3232(src, repIndex) == uint32(cv>>16) { + // Consider history as well. + var seq seq + length := 4 + e.matchlen(s+6, repIndex+4, src) + + seq.matchLen = uint32(length - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + 2 + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + sMin := s - e.maxMatchOff + if sMin < 0 { + sMin = 0 + } + for repIndex > sMin && start > startLimit && src[repIndex-1] == src[start-1] { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 0 + seq.offset = 1 + if debugSequences { + println("repeat sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + s += length + 2 + nextEmit = s + if s >= sLimit { + if debugEncoder { + println("repeat ended", s, length) + + } + break encodeLoop + } + cv = load6432(src, s) + continue + } + coffset0 := s - (candidate.offset - e.cur) + coffset1 := s - (candidate2.offset - e.cur) + 1 + if coffset0 < e.maxMatchOff && uint32(cv) == candidate.val { + // found a regular match + t = candidate.offset - e.cur + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic(fmt.Sprintf("t (%d) < 0, candidate.offset: %d, e.cur: %d, coffset0: %d, e.maxMatchOff: %d", t, candidate.offset, e.cur, coffset0, e.maxMatchOff)) + } + break + } + + if coffset1 < e.maxMatchOff && uint32(cv>>8) == candidate2.val { + // found a regular match + t = candidate2.offset - e.cur + s++ + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic("t<0") + } + break + } + s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1)) + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + } + // A 4-byte match has been found. We'll later see if more than 4 bytes. + offset2 = offset1 + offset1 = s - t + + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + + if debugAsserts && t < 0 { + panic(fmt.Sprintf("t (%d) < 0 ", t)) + } + // Extend the 4-byte match as long as possible. + l := e.matchlen(s+4, t+4, src) + 4 + + // Extend backwards + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for t > tMin && s > nextEmit && src[t-1] == src[s-1] { + s-- + t-- + l++ + } + + // Write our sequence. + var seq seq + seq.litLen = uint32(s - nextEmit) + seq.matchLen = uint32(l - zstdMinMatch) + if seq.litLen > 0 { + blk.literals = append(blk.literals, src[nextEmit:s]...) + } + // Don't use repeat offsets + seq.offset = uint32(s-t) + 3 + s += l + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + nextEmit = s + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + + // Check offset 2 + if o2 := s - offset2; len(blk.sequences) > 2 && load3232(src, o2) == uint32(cv) { + // We have at least 4 byte match. + // No need to check backwards. We come straight from a match + l := 4 + e.matchlen(s+4, o2+4, src) + + // Store this, since we have it. + nextHash := hashLen(cv, hashLog, tableFastHashLen) + e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)} + seq.matchLen = uint32(l) - zstdMinMatch + seq.litLen = 0 + // Since litlen is always 0, this is offset 1. + seq.offset = 1 + s += l + nextEmit = s + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Swap offset 1 and 2. + offset1, offset2 = offset2, offset1 + if s >= sLimit { + break encodeLoop + } + // Prepare next loop. + cv = load6432(src, s) + } + } + + if int(nextEmit) < len(src) { + blk.literals = append(blk.literals, src[nextEmit:]...) + blk.extraLits = len(src) - int(nextEmit) + } + if debugEncoder { + println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) + } + // We do not store history, so we must offset e.cur to avoid false matches for next user. + if e.cur < e.bufferReset { + e.cur += int32(len(src)) + } +} + +// Encode will encode the content, with a dictionary if initialized for it. +func (e *fastEncoderDict) Encode(blk *blockEnc, src []byte) { + const ( + inputMargin = 8 + minNonLiteralBlockSize = 1 + 1 + inputMargin + ) + if e.allDirty || len(src) > 32<<10 { + e.fastEncoder.Encode(blk, src) + e.allDirty = true + return + } + // Protect against e.cur wraparound. + for e.cur >= e.bufferReset-int32(len(e.hist)) { + if len(e.hist) == 0 { + e.table = [tableSize]tableEntry{} + e.cur = e.maxMatchOff + break + } + // Shift down everything in the table that isn't already too far away. + minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff + for i := range e.table[:] { + v := e.table[i].offset + if v < minOff { + v = 0 + } else { + v = v - e.cur + e.maxMatchOff + } + e.table[i].offset = v + } + e.cur = e.maxMatchOff + break + } + + s := e.addBlock(src) + blk.size = len(src) + if len(src) < minNonLiteralBlockSize { + blk.extraLits = len(src) + blk.literals = blk.literals[:len(src)] + copy(blk.literals, src) + return + } + + // Override src + src = e.hist + sLimit := int32(len(src)) - inputMargin + // stepSize is the number of bytes to skip on every main loop iteration. + // It should be >= 2. + const stepSize = 2 + + // TEMPLATE + const hashLog = tableBits + // seems global, but would be nice to tweak. + const kSearchStrength = 7 + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := s + cv := load6432(src, s) + + // Relative offsets + offset1 := int32(blk.recentOffsets[0]) + offset2 := int32(blk.recentOffsets[1]) + + addLiterals := func(s *seq, until int32) { + if until == nextEmit { + return + } + blk.literals = append(blk.literals, src[nextEmit:until]...) + s.litLen = uint32(until - nextEmit) + } + if debugEncoder { + println("recent offsets:", blk.recentOffsets) + } + +encodeLoop: + for { + // t will contain the match offset when we find one. + // When existing the search loop, we have already checked 4 bytes. + var t int32 + + // We will not use repeat offsets across blocks. + // By not using them for the first 3 matches + canRepeat := len(blk.sequences) > 2 + + for { + if debugAsserts && canRepeat && offset1 == 0 { + panic("offset0 was 0") + } + + nextHash := hashLen(cv, hashLog, tableFastHashLen) + nextHash2 := hashLen(cv>>8, hashLog, tableFastHashLen) + candidate := e.table[nextHash] + candidate2 := e.table[nextHash2] + repIndex := s - offset1 + 2 + + e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)} + e.markShardDirty(nextHash) + e.table[nextHash2] = tableEntry{offset: s + e.cur + 1, val: uint32(cv >> 8)} + e.markShardDirty(nextHash2) + + if canRepeat && repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>16) { + // Consider history as well. + var seq seq + length := 4 + e.matchlen(s+6, repIndex+4, src) + + seq.matchLen = uint32(length - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + 2 + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + sMin := s - e.maxMatchOff + if sMin < 0 { + sMin = 0 + } + for repIndex > sMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 0 + seq.offset = 1 + if debugSequences { + println("repeat sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + s += length + 2 + nextEmit = s + if s >= sLimit { + if debugEncoder { + println("repeat ended", s, length) + + } + break encodeLoop + } + cv = load6432(src, s) + continue + } + coffset0 := s - (candidate.offset - e.cur) + coffset1 := s - (candidate2.offset - e.cur) + 1 + if coffset0 < e.maxMatchOff && uint32(cv) == candidate.val { + // found a regular match + t = candidate.offset - e.cur + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + break + } + + if coffset1 < e.maxMatchOff && uint32(cv>>8) == candidate2.val { + // found a regular match + t = candidate2.offset - e.cur + s++ + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic("t<0") + } + break + } + s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1)) + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + } + // A 4-byte match has been found. We'll later see if more than 4 bytes. + offset2 = offset1 + offset1 = s - t + + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + + if debugAsserts && canRepeat && int(offset1) > len(src) { + panic("invalid offset") + } + + // Extend the 4-byte match as long as possible. + l := e.matchlen(s+4, t+4, src) + 4 + + // Extend backwards + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { + s-- + t-- + l++ + } + + // Write our sequence. + var seq seq + seq.litLen = uint32(s - nextEmit) + seq.matchLen = uint32(l - zstdMinMatch) + if seq.litLen > 0 { + blk.literals = append(blk.literals, src[nextEmit:s]...) + } + // Don't use repeat offsets + seq.offset = uint32(s-t) + 3 + s += l + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + nextEmit = s + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + + // Check offset 2 + if o2 := s - offset2; canRepeat && load3232(src, o2) == uint32(cv) { + // We have at least 4 byte match. + // No need to check backwards. We come straight from a match + l := 4 + e.matchlen(s+4, o2+4, src) + + // Store this, since we have it. + nextHash := hashLen(cv, hashLog, tableFastHashLen) + e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)} + e.markShardDirty(nextHash) + seq.matchLen = uint32(l) - zstdMinMatch + seq.litLen = 0 + // Since litlen is always 0, this is offset 1. + seq.offset = 1 + s += l + nextEmit = s + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Swap offset 1 and 2. + offset1, offset2 = offset2, offset1 + if s >= sLimit { + break encodeLoop + } + // Prepare next loop. + cv = load6432(src, s) + } + } + + if int(nextEmit) < len(src) { + blk.literals = append(blk.literals, src[nextEmit:]...) + blk.extraLits = len(src) - int(nextEmit) + } + blk.recentOffsets[0] = uint32(offset1) + blk.recentOffsets[1] = uint32(offset2) + if debugEncoder { + println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) + } +} + +// ResetDict will reset and set a dictionary if not nil +func (e *fastEncoder) Reset(d *dict, singleBlock bool) { + e.resetBase(d, singleBlock) + if d != nil { + panic("fastEncoder: Reset with dict") + } +} + +// ResetDict will reset and set a dictionary if not nil +func (e *fastEncoderDict) Reset(d *dict, singleBlock bool) { + e.resetBase(d, singleBlock) + if d == nil { + return + } + + // Init or copy dict table + if len(e.dictTable) != len(e.table) || d.id != e.lastDictID { + if len(e.dictTable) != len(e.table) { + e.dictTable = make([]tableEntry, len(e.table)) + } + if true { + end := e.maxMatchOff + int32(len(d.content)) - 8 + for i := e.maxMatchOff; i < end; i += 2 { + const hashLog = tableBits + + cv := load6432(d.content, i-e.maxMatchOff) + nextHash := hashLen(cv, hashLog, tableFastHashLen) // 0 -> 6 + nextHash1 := hashLen(cv>>8, hashLog, tableFastHashLen) // 1 -> 7 + e.dictTable[nextHash] = tableEntry{ + val: uint32(cv), + offset: i, + } + e.dictTable[nextHash1] = tableEntry{ + val: uint32(cv >> 8), + offset: i + 1, + } + } + } + e.lastDictID = d.id + e.allDirty = true + } + + e.cur = e.maxMatchOff + dirtyShardCnt := 0 + if !e.allDirty { + for i := range e.tableShardDirty { + if e.tableShardDirty[i] { + dirtyShardCnt++ + } + } + } + + const shardCnt = tableShardCnt + const shardSize = tableShardSize + if e.allDirty || dirtyShardCnt > shardCnt*4/6 { + //copy(e.table[:], e.dictTable) + e.table = *(*[tableSize]tableEntry)(e.dictTable) + for i := range e.tableShardDirty { + e.tableShardDirty[i] = false + } + e.allDirty = false + return + } + for i := range e.tableShardDirty { + if !e.tableShardDirty[i] { + continue + } + + //copy(e.table[i*shardSize:(i+1)*shardSize], e.dictTable[i*shardSize:(i+1)*shardSize]) + *(*[shardSize]tableEntry)(e.table[i*shardSize:]) = *(*[shardSize]tableEntry)(e.dictTable[i*shardSize:]) + e.tableShardDirty[i] = false + } + e.allDirty = false +} + +func (e *fastEncoderDict) markAllShardsDirty() { + e.allDirty = true +} + +func (e *fastEncoderDict) markShardDirty(entryNum uint32) { + e.tableShardDirty[entryNum/tableShardSize] = true +} diff --git a/vendor/github.com/klauspost/compress/zstd/encoder.go b/vendor/github.com/klauspost/compress/zstd/encoder.go new file mode 100644 index 0000000000..72af7ef0fe --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/encoder.go @@ -0,0 +1,619 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "crypto/rand" + "fmt" + "io" + "math" + rdebug "runtime/debug" + "sync" + + "github.com/klauspost/compress/zstd/internal/xxhash" +) + +// Encoder provides encoding to Zstandard. +// An Encoder can be used for either compressing a stream via the +// io.WriteCloser interface supported by the Encoder or as multiple independent +// tasks via the EncodeAll function. +// Smaller encodes are encouraged to use the EncodeAll function. +// Use NewWriter to create a new instance. +type Encoder struct { + o encoderOptions + encoders chan encoder + state encoderState + init sync.Once +} + +type encoder interface { + Encode(blk *blockEnc, src []byte) + EncodeNoHist(blk *blockEnc, src []byte) + Block() *blockEnc + CRC() *xxhash.Digest + AppendCRC([]byte) []byte + WindowSize(size int64) int32 + UseBlock(*blockEnc) + Reset(d *dict, singleBlock bool) +} + +type encoderState struct { + w io.Writer + filling []byte + current []byte + previous []byte + encoder encoder + writing *blockEnc + err error + writeErr error + nWritten int64 + nInput int64 + frameContentSize int64 + headerWritten bool + eofWritten bool + fullFrameWritten bool + + // This waitgroup indicates an encode is running. + wg sync.WaitGroup + // This waitgroup indicates we have a block encoding/writing. + wWg sync.WaitGroup +} + +// NewWriter will create a new Zstandard encoder. +// If the encoder will be used for encoding blocks a nil writer can be used. +func NewWriter(w io.Writer, opts ...EOption) (*Encoder, error) { + initPredefined() + var e Encoder + e.o.setDefault() + for _, o := range opts { + err := o(&e.o) + if err != nil { + return nil, err + } + } + if w != nil { + e.Reset(w) + } + return &e, nil +} + +func (e *Encoder) initialize() { + if e.o.concurrent == 0 { + e.o.setDefault() + } + e.encoders = make(chan encoder, e.o.concurrent) + for i := 0; i < e.o.concurrent; i++ { + enc := e.o.encoder() + e.encoders <- enc + } +} + +// Reset will re-initialize the writer and new writes will encode to the supplied writer +// as a new, independent stream. +func (e *Encoder) Reset(w io.Writer) { + s := &e.state + s.wg.Wait() + s.wWg.Wait() + if cap(s.filling) == 0 { + s.filling = make([]byte, 0, e.o.blockSize) + } + if e.o.concurrent > 1 { + if cap(s.current) == 0 { + s.current = make([]byte, 0, e.o.blockSize) + } + if cap(s.previous) == 0 { + s.previous = make([]byte, 0, e.o.blockSize) + } + s.current = s.current[:0] + s.previous = s.previous[:0] + if s.writing == nil { + s.writing = &blockEnc{lowMem: e.o.lowMem} + s.writing.init() + } + s.writing.initNewEncode() + } + if s.encoder == nil { + s.encoder = e.o.encoder() + } + s.filling = s.filling[:0] + s.encoder.Reset(e.o.dict, false) + s.headerWritten = false + s.eofWritten = false + s.fullFrameWritten = false + s.w = w + s.err = nil + s.nWritten = 0 + s.nInput = 0 + s.writeErr = nil + s.frameContentSize = 0 +} + +// ResetContentSize will reset and set a content size for the next stream. +// If the bytes written does not match the size given an error will be returned +// when calling Close(). +// This is removed when Reset is called. +// Sizes <= 0 results in no content size set. +func (e *Encoder) ResetContentSize(w io.Writer, size int64) { + e.Reset(w) + if size >= 0 { + e.state.frameContentSize = size + } +} + +// Write data to the encoder. +// Input data will be buffered and as the buffer fills up +// content will be compressed and written to the output. +// When done writing, use Close to flush the remaining output +// and write CRC if requested. +func (e *Encoder) Write(p []byte) (n int, err error) { + s := &e.state + for len(p) > 0 { + if len(p)+len(s.filling) < e.o.blockSize { + if e.o.crc { + _, _ = s.encoder.CRC().Write(p) + } + s.filling = append(s.filling, p...) + return n + len(p), nil + } + add := p + if len(p)+len(s.filling) > e.o.blockSize { + add = add[:e.o.blockSize-len(s.filling)] + } + if e.o.crc { + _, _ = s.encoder.CRC().Write(add) + } + s.filling = append(s.filling, add...) + p = p[len(add):] + n += len(add) + if len(s.filling) < e.o.blockSize { + return n, nil + } + err := e.nextBlock(false) + if err != nil { + return n, err + } + if debugAsserts && len(s.filling) > 0 { + panic(len(s.filling)) + } + } + return n, nil +} + +// nextBlock will synchronize and start compressing input in e.state.filling. +// If an error has occurred during encoding it will be returned. +func (e *Encoder) nextBlock(final bool) error { + s := &e.state + // Wait for current block. + s.wg.Wait() + if s.err != nil { + return s.err + } + if len(s.filling) > e.o.blockSize { + return fmt.Errorf("block > maxStoreBlockSize") + } + if !s.headerWritten { + // If we have a single block encode, do a sync compression. + if final && len(s.filling) == 0 && !e.o.fullZero { + s.headerWritten = true + s.fullFrameWritten = true + s.eofWritten = true + return nil + } + if final && len(s.filling) > 0 { + s.current = e.EncodeAll(s.filling, s.current[:0]) + var n2 int + n2, s.err = s.w.Write(s.current) + if s.err != nil { + return s.err + } + s.nWritten += int64(n2) + s.nInput += int64(len(s.filling)) + s.current = s.current[:0] + s.filling = s.filling[:0] + s.headerWritten = true + s.fullFrameWritten = true + s.eofWritten = true + return nil + } + + var tmp [maxHeaderSize]byte + fh := frameHeader{ + ContentSize: uint64(s.frameContentSize), + WindowSize: uint32(s.encoder.WindowSize(s.frameContentSize)), + SingleSegment: false, + Checksum: e.o.crc, + DictID: e.o.dict.ID(), + } + + dst := fh.appendTo(tmp[:0]) + s.headerWritten = true + s.wWg.Wait() + var n2 int + n2, s.err = s.w.Write(dst) + if s.err != nil { + return s.err + } + s.nWritten += int64(n2) + } + if s.eofWritten { + // Ensure we only write it once. + final = false + } + + if len(s.filling) == 0 { + // Final block, but no data. + if final { + enc := s.encoder + blk := enc.Block() + blk.reset(nil) + blk.last = true + blk.encodeRaw(nil) + s.wWg.Wait() + _, s.err = s.w.Write(blk.output) + s.nWritten += int64(len(blk.output)) + s.eofWritten = true + } + return s.err + } + + // SYNC: + if e.o.concurrent == 1 { + src := s.filling + s.nInput += int64(len(s.filling)) + if debugEncoder { + println("Adding sync block,", len(src), "bytes, final:", final) + } + enc := s.encoder + blk := enc.Block() + blk.reset(nil) + enc.Encode(blk, src) + blk.last = final + if final { + s.eofWritten = true + } + + s.err = blk.encode(src, e.o.noEntropy, !e.o.allLitEntropy) + if s.err != nil { + return s.err + } + _, s.err = s.w.Write(blk.output) + s.nWritten += int64(len(blk.output)) + s.filling = s.filling[:0] + return s.err + } + + // Move blocks forward. + s.filling, s.current, s.previous = s.previous[:0], s.filling, s.current + s.nInput += int64(len(s.current)) + s.wg.Add(1) + go func(src []byte) { + if debugEncoder { + println("Adding block,", len(src), "bytes, final:", final) + } + defer func() { + if r := recover(); r != nil { + s.err = fmt.Errorf("panic while encoding: %v", r) + rdebug.PrintStack() + } + s.wg.Done() + }() + enc := s.encoder + blk := enc.Block() + enc.Encode(blk, src) + blk.last = final + if final { + s.eofWritten = true + } + // Wait for pending writes. + s.wWg.Wait() + if s.writeErr != nil { + s.err = s.writeErr + return + } + // Transfer encoders from previous write block. + blk.swapEncoders(s.writing) + // Transfer recent offsets to next. + enc.UseBlock(s.writing) + s.writing = blk + s.wWg.Add(1) + go func() { + defer func() { + if r := recover(); r != nil { + s.writeErr = fmt.Errorf("panic while encoding/writing: %v", r) + rdebug.PrintStack() + } + s.wWg.Done() + }() + s.writeErr = blk.encode(src, e.o.noEntropy, !e.o.allLitEntropy) + if s.writeErr != nil { + return + } + _, s.writeErr = s.w.Write(blk.output) + s.nWritten += int64(len(blk.output)) + }() + }(s.current) + return nil +} + +// ReadFrom reads data from r until EOF or error. +// The return value n is the number of bytes read. +// Any error except io.EOF encountered during the read is also returned. +// +// The Copy function uses ReaderFrom if available. +func (e *Encoder) ReadFrom(r io.Reader) (n int64, err error) { + if debugEncoder { + println("Using ReadFrom") + } + + // Flush any current writes. + if len(e.state.filling) > 0 { + if err := e.nextBlock(false); err != nil { + return 0, err + } + } + e.state.filling = e.state.filling[:e.o.blockSize] + src := e.state.filling + for { + n2, err := r.Read(src) + if e.o.crc { + _, _ = e.state.encoder.CRC().Write(src[:n2]) + } + // src is now the unfilled part... + src = src[n2:] + n += int64(n2) + switch err { + case io.EOF: + e.state.filling = e.state.filling[:len(e.state.filling)-len(src)] + if debugEncoder { + println("ReadFrom: got EOF final block:", len(e.state.filling)) + } + return n, nil + case nil: + default: + if debugEncoder { + println("ReadFrom: got error:", err) + } + e.state.err = err + return n, err + } + if len(src) > 0 { + if debugEncoder { + println("ReadFrom: got space left in source:", len(src)) + } + continue + } + err = e.nextBlock(false) + if err != nil { + return n, err + } + e.state.filling = e.state.filling[:e.o.blockSize] + src = e.state.filling + } +} + +// Flush will send the currently written data to output +// and block until everything has been written. +// This should only be used on rare occasions where pushing the currently queued data is critical. +func (e *Encoder) Flush() error { + s := &e.state + if len(s.filling) > 0 { + err := e.nextBlock(false) + if err != nil { + return err + } + } + s.wg.Wait() + s.wWg.Wait() + if s.err != nil { + return s.err + } + return s.writeErr +} + +// Close will flush the final output and close the stream. +// The function will block until everything has been written. +// The Encoder can still be re-used after calling this. +func (e *Encoder) Close() error { + s := &e.state + if s.encoder == nil { + return nil + } + err := e.nextBlock(true) + if err != nil { + return err + } + if s.frameContentSize > 0 { + if s.nInput != s.frameContentSize { + return fmt.Errorf("frame content size %d given, but %d bytes was written", s.frameContentSize, s.nInput) + } + } + if e.state.fullFrameWritten { + return s.err + } + s.wg.Wait() + s.wWg.Wait() + + if s.err != nil { + return s.err + } + if s.writeErr != nil { + return s.writeErr + } + + // Write CRC + if e.o.crc && s.err == nil { + // heap alloc. + var tmp [4]byte + _, s.err = s.w.Write(s.encoder.AppendCRC(tmp[:0])) + s.nWritten += 4 + } + + // Add padding with content from crypto/rand.Reader + if s.err == nil && e.o.pad > 0 { + add := calcSkippableFrame(s.nWritten, int64(e.o.pad)) + frame, err := skippableFrame(s.filling[:0], add, rand.Reader) + if err != nil { + return err + } + _, s.err = s.w.Write(frame) + } + return s.err +} + +// EncodeAll will encode all input in src and append it to dst. +// This function can be called concurrently, but each call will only run on a single goroutine. +// If empty input is given, nothing is returned, unless WithZeroFrames is specified. +// Encoded blocks can be concatenated and the result will be the combined input stream. +// Data compressed with EncodeAll can be decoded with the Decoder, +// using either a stream or DecodeAll. +func (e *Encoder) EncodeAll(src, dst []byte) []byte { + if len(src) == 0 { + if e.o.fullZero { + // Add frame header. + fh := frameHeader{ + ContentSize: 0, + WindowSize: MinWindowSize, + SingleSegment: true, + // Adding a checksum would be a waste of space. + Checksum: false, + DictID: 0, + } + dst = fh.appendTo(dst) + + // Write raw block as last one only. + var blk blockHeader + blk.setSize(0) + blk.setType(blockTypeRaw) + blk.setLast(true) + dst = blk.appendTo(dst) + } + return dst + } + e.init.Do(e.initialize) + enc := <-e.encoders + defer func() { + // Release encoder reference to last block. + // If a non-single block is needed the encoder will reset again. + e.encoders <- enc + }() + // Use single segments when above minimum window and below window size. + single := len(src) <= e.o.windowSize && len(src) > MinWindowSize + if e.o.single != nil { + single = *e.o.single + } + fh := frameHeader{ + ContentSize: uint64(len(src)), + WindowSize: uint32(enc.WindowSize(int64(len(src)))), + SingleSegment: single, + Checksum: e.o.crc, + DictID: e.o.dict.ID(), + } + + // If less than 1MB, allocate a buffer up front. + if len(dst) == 0 && cap(dst) == 0 && len(src) < 1<<20 && !e.o.lowMem { + dst = make([]byte, 0, len(src)) + } + dst = fh.appendTo(dst) + + // If we can do everything in one block, prefer that. + if len(src) <= e.o.blockSize { + enc.Reset(e.o.dict, true) + // Slightly faster with no history and everything in one block. + if e.o.crc { + _, _ = enc.CRC().Write(src) + } + blk := enc.Block() + blk.last = true + if e.o.dict == nil { + enc.EncodeNoHist(blk, src) + } else { + enc.Encode(blk, src) + } + + // If we got the exact same number of literals as input, + // assume the literals cannot be compressed. + oldout := blk.output + // Output directly to dst + blk.output = dst + + err := blk.encode(src, e.o.noEntropy, !e.o.allLitEntropy) + if err != nil { + panic(err) + } + dst = blk.output + blk.output = oldout + } else { + enc.Reset(e.o.dict, false) + blk := enc.Block() + for len(src) > 0 { + todo := src + if len(todo) > e.o.blockSize { + todo = todo[:e.o.blockSize] + } + src = src[len(todo):] + if e.o.crc { + _, _ = enc.CRC().Write(todo) + } + blk.pushOffsets() + enc.Encode(blk, todo) + if len(src) == 0 { + blk.last = true + } + err := blk.encode(todo, e.o.noEntropy, !e.o.allLitEntropy) + if err != nil { + panic(err) + } + dst = append(dst, blk.output...) + blk.reset(nil) + } + } + if e.o.crc { + dst = enc.AppendCRC(dst) + } + // Add padding with content from crypto/rand.Reader + if e.o.pad > 0 { + add := calcSkippableFrame(int64(len(dst)), int64(e.o.pad)) + var err error + dst, err = skippableFrame(dst, add, rand.Reader) + if err != nil { + panic(err) + } + } + return dst +} + +// MaxEncodedSize returns the expected maximum +// size of an encoded block or stream. +func (e *Encoder) MaxEncodedSize(size int) int { + frameHeader := 4 + 2 // magic + frame header & window descriptor + if e.o.dict != nil { + frameHeader += 4 + } + // Frame content size: + if size < 256 { + frameHeader++ + } else if size < 65536+256 { + frameHeader += 2 + } else if size < math.MaxInt32 { + frameHeader += 4 + } else { + frameHeader += 8 + } + // Final crc + if e.o.crc { + frameHeader += 4 + } + + // Max overhead is 3 bytes/block. + // There cannot be 0 blocks. + blocks := (size + e.o.blockSize) / e.o.blockSize + + // Combine, add padding. + maxSz := frameHeader + 3*blocks + size + if e.o.pad > 1 { + maxSz += calcSkippableFrame(int64(maxSz), int64(e.o.pad)) + } + return maxSz +} diff --git a/vendor/github.com/klauspost/compress/zstd/encoder_options.go b/vendor/github.com/klauspost/compress/zstd/encoder_options.go new file mode 100644 index 0000000000..20671dcb91 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/encoder_options.go @@ -0,0 +1,339 @@ +package zstd + +import ( + "errors" + "fmt" + "math" + "math/bits" + "runtime" + "strings" +) + +// EOption is an option for creating a encoder. +type EOption func(*encoderOptions) error + +// options retains accumulated state of multiple options. +type encoderOptions struct { + concurrent int + level EncoderLevel + single *bool + pad int + blockSize int + windowSize int + crc bool + fullZero bool + noEntropy bool + allLitEntropy bool + customWindow bool + customALEntropy bool + customBlockSize bool + lowMem bool + dict *dict +} + +func (o *encoderOptions) setDefault() { + *o = encoderOptions{ + concurrent: runtime.GOMAXPROCS(0), + crc: true, + single: nil, + blockSize: maxCompressedBlockSize, + windowSize: 8 << 20, + level: SpeedDefault, + allLitEntropy: false, + lowMem: false, + } +} + +// encoder returns an encoder with the selected options. +func (o encoderOptions) encoder() encoder { + switch o.level { + case SpeedFastest: + if o.dict != nil { + return &fastEncoderDict{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), bufferReset: math.MaxInt32 - int32(o.windowSize*2), lowMem: o.lowMem}}} + } + return &fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), bufferReset: math.MaxInt32 - int32(o.windowSize*2), lowMem: o.lowMem}} + + case SpeedDefault: + if o.dict != nil { + return &doubleFastEncoderDict{fastEncoderDict: fastEncoderDict{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), bufferReset: math.MaxInt32 - int32(o.windowSize*2), lowMem: o.lowMem}}}} + } + return &doubleFastEncoder{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), bufferReset: math.MaxInt32 - int32(o.windowSize*2), lowMem: o.lowMem}}} + case SpeedBetterCompression: + if o.dict != nil { + return &betterFastEncoderDict{betterFastEncoder: betterFastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), bufferReset: math.MaxInt32 - int32(o.windowSize*2), lowMem: o.lowMem}}} + } + return &betterFastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), bufferReset: math.MaxInt32 - int32(o.windowSize*2), lowMem: o.lowMem}} + case SpeedBestCompression: + return &bestFastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), bufferReset: math.MaxInt32 - int32(o.windowSize*2), lowMem: o.lowMem}} + } + panic("unknown compression level") +} + +// WithEncoderCRC will add CRC value to output. +// Output will be 4 bytes larger. +func WithEncoderCRC(b bool) EOption { + return func(o *encoderOptions) error { o.crc = b; return nil } +} + +// WithEncoderConcurrency will set the concurrency, +// meaning the maximum number of encoders to run concurrently. +// The value supplied must be at least 1. +// For streams, setting a value of 1 will disable async compression. +// By default this will be set to GOMAXPROCS. +func WithEncoderConcurrency(n int) EOption { + return func(o *encoderOptions) error { + if n <= 0 { + return fmt.Errorf("concurrency must be at least 1") + } + o.concurrent = n + return nil + } +} + +// WithWindowSize will set the maximum allowed back-reference distance. +// The value must be a power of two between MinWindowSize and MaxWindowSize. +// A larger value will enable better compression but allocate more memory and, +// for above-default values, take considerably longer. +// The default value is determined by the compression level and max 8MB. +func WithWindowSize(n int) EOption { + return func(o *encoderOptions) error { + switch { + case n < MinWindowSize: + return fmt.Errorf("window size must be at least %d", MinWindowSize) + case n > MaxWindowSize: + return fmt.Errorf("window size must be at most %d", MaxWindowSize) + case (n & (n - 1)) != 0: + return errors.New("window size must be a power of 2") + } + + o.windowSize = n + o.customWindow = true + if o.blockSize > o.windowSize { + o.blockSize = o.windowSize + o.customBlockSize = true + } + return nil + } +} + +// WithEncoderPadding will add padding to all output so the size will be a multiple of n. +// This can be used to obfuscate the exact output size or make blocks of a certain size. +// The contents will be a skippable frame, so it will be invisible by the decoder. +// n must be > 0 and <= 1GB, 1<<30 bytes. +// The padded area will be filled with data from crypto/rand.Reader. +// If `EncodeAll` is used with data already in the destination, the total size will be multiple of this. +func WithEncoderPadding(n int) EOption { + return func(o *encoderOptions) error { + if n <= 0 { + return fmt.Errorf("padding must be at least 1") + } + // No need to waste our time. + if n == 1 { + n = 0 + } + if n > 1<<30 { + return fmt.Errorf("padding must less than 1GB (1<<30 bytes) ") + } + o.pad = n + return nil + } +} + +// EncoderLevel predefines encoder compression levels. +// Only use the constants made available, since the actual mapping +// of these values are very likely to change and your compression could change +// unpredictably when upgrading the library. +type EncoderLevel int + +const ( + speedNotSet EncoderLevel = iota + + // SpeedFastest will choose the fastest reasonable compression. + // This is roughly equivalent to the fastest Zstandard mode. + SpeedFastest + + // SpeedDefault is the default "pretty fast" compression option. + // This is roughly equivalent to the default Zstandard mode (level 3). + SpeedDefault + + // SpeedBetterCompression will yield better compression than the default. + // Currently it is about zstd level 7-8 with ~ 2x-3x the default CPU usage. + // By using this, notice that CPU usage may go up in the future. + SpeedBetterCompression + + // SpeedBestCompression will choose the best available compression option. + // This will offer the best compression no matter the CPU cost. + SpeedBestCompression + + // speedLast should be kept as the last actual compression option. + // The is not for external usage, but is used to keep track of the valid options. + speedLast +) + +// EncoderLevelFromString will convert a string representation of an encoding level back +// to a compression level. The compare is not case sensitive. +// If the string wasn't recognized, (false, SpeedDefault) will be returned. +func EncoderLevelFromString(s string) (bool, EncoderLevel) { + for l := speedNotSet + 1; l < speedLast; l++ { + if strings.EqualFold(s, l.String()) { + return true, l + } + } + return false, SpeedDefault +} + +// EncoderLevelFromZstd will return an encoder level that closest matches the compression +// ratio of a specific zstd compression level. +// Many input values will provide the same compression level. +func EncoderLevelFromZstd(level int) EncoderLevel { + switch { + case level < 3: + return SpeedFastest + case level >= 3 && level < 6: + return SpeedDefault + case level >= 6 && level < 10: + return SpeedBetterCompression + default: + return SpeedBestCompression + } +} + +// String provides a string representation of the compression level. +func (e EncoderLevel) String() string { + switch e { + case SpeedFastest: + return "fastest" + case SpeedDefault: + return "default" + case SpeedBetterCompression: + return "better" + case SpeedBestCompression: + return "best" + default: + return "invalid" + } +} + +// WithEncoderLevel specifies a predefined compression level. +func WithEncoderLevel(l EncoderLevel) EOption { + return func(o *encoderOptions) error { + switch { + case l <= speedNotSet || l >= speedLast: + return fmt.Errorf("unknown encoder level") + } + o.level = l + if !o.customWindow { + switch o.level { + case SpeedFastest: + o.windowSize = 4 << 20 + if !o.customBlockSize { + o.blockSize = 1 << 16 + } + case SpeedDefault: + o.windowSize = 8 << 20 + case SpeedBetterCompression: + o.windowSize = 8 << 20 + case SpeedBestCompression: + o.windowSize = 8 << 20 + } + } + if !o.customALEntropy { + o.allLitEntropy = l > SpeedDefault + } + + return nil + } +} + +// WithZeroFrames will encode 0 length input as full frames. +// This can be needed for compatibility with zstandard usage, +// but is not needed for this package. +func WithZeroFrames(b bool) EOption { + return func(o *encoderOptions) error { + o.fullZero = b + return nil + } +} + +// WithAllLitEntropyCompression will apply entropy compression if no matches are found. +// Disabling this will skip incompressible data faster, but in cases with no matches but +// skewed character distribution compression is lost. +// Default value depends on the compression level selected. +func WithAllLitEntropyCompression(b bool) EOption { + return func(o *encoderOptions) error { + o.customALEntropy = true + o.allLitEntropy = b + return nil + } +} + +// WithNoEntropyCompression will always skip entropy compression of literals. +// This can be useful if content has matches, but unlikely to benefit from entropy +// compression. Usually the slight speed improvement is not worth enabling this. +func WithNoEntropyCompression(b bool) EOption { + return func(o *encoderOptions) error { + o.noEntropy = b + return nil + } +} + +// WithSingleSegment will set the "single segment" flag when EncodeAll is used. +// If this flag is set, data must be regenerated within a single continuous memory segment. +// In this case, Window_Descriptor byte is skipped, but Frame_Content_Size is necessarily present. +// As a consequence, the decoder must allocate a memory segment of size equal or larger than size of your content. +// In order to preserve the decoder from unreasonable memory requirements, +// a decoder is allowed to reject a compressed frame which requests a memory size beyond decoder's authorized range. +// For broader compatibility, decoders are recommended to support memory sizes of at least 8 MB. +// This is only a recommendation, each decoder is free to support higher or lower limits, depending on local limitations. +// If this is not specified, block encodes will automatically choose this based on the input size and the window size. +// This setting has no effect on streamed encodes. +func WithSingleSegment(b bool) EOption { + return func(o *encoderOptions) error { + o.single = &b + return nil + } +} + +// WithLowerEncoderMem will trade in some memory cases trade less memory usage for +// slower encoding speed. +// This will not change the window size which is the primary function for reducing +// memory usage. See WithWindowSize. +func WithLowerEncoderMem(b bool) EOption { + return func(o *encoderOptions) error { + o.lowMem = b + return nil + } +} + +// WithEncoderDict allows to register a dictionary that will be used for the encode. +// +// The slice dict must be in the [dictionary format] produced by +// "zstd --train" from the Zstandard reference implementation. +// +// The encoder *may* choose to use no dictionary instead for certain payloads. +// +// [dictionary format]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary-format +func WithEncoderDict(dict []byte) EOption { + return func(o *encoderOptions) error { + d, err := loadDict(dict) + if err != nil { + return err + } + o.dict = d + return nil + } +} + +// WithEncoderDictRaw registers a dictionary that may be used by the encoder. +// +// The slice content may contain arbitrary data. It will be used as an initial +// history. +func WithEncoderDictRaw(id uint32, content []byte) EOption { + return func(o *encoderOptions) error { + if bits.UintSize > 32 && uint(len(content)) > dictMaxLength { + return fmt.Errorf("dictionary of size %d > 2GiB too large", len(content)) + } + o.dict = &dict{id: id, content: content, offsets: [3]int{1, 4, 8}} + return nil + } +} diff --git a/vendor/github.com/klauspost/compress/zstd/framedec.go b/vendor/github.com/klauspost/compress/zstd/framedec.go new file mode 100644 index 0000000000..53e160f7e5 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/framedec.go @@ -0,0 +1,413 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "encoding/binary" + "encoding/hex" + "errors" + "io" + + "github.com/klauspost/compress/zstd/internal/xxhash" +) + +type frameDec struct { + o decoderOptions + crc *xxhash.Digest + + WindowSize uint64 + + // Frame history passed between blocks + history history + + rawInput byteBuffer + + // Byte buffer that can be reused for small input blocks. + bBuf byteBuf + + FrameContentSize uint64 + + DictionaryID uint32 + HasCheckSum bool + SingleSegment bool +} + +const ( + // MinWindowSize is the minimum Window Size, which is 1 KB. + MinWindowSize = 1 << 10 + + // MaxWindowSize is the maximum encoder window size + // and the default decoder maximum window size. + MaxWindowSize = 1 << 29 +) + +const ( + frameMagic = "\x28\xb5\x2f\xfd" + skippableFrameMagic = "\x2a\x4d\x18" +) + +func newFrameDec(o decoderOptions) *frameDec { + if o.maxWindowSize > o.maxDecodedSize { + o.maxWindowSize = o.maxDecodedSize + } + d := frameDec{ + o: o, + } + return &d +} + +// reset will read the frame header and prepare for block decoding. +// If nothing can be read from the input, io.EOF will be returned. +// Any other error indicated that the stream contained data, but +// there was a problem. +func (d *frameDec) reset(br byteBuffer) error { + d.HasCheckSum = false + d.WindowSize = 0 + var signature [4]byte + for { + var err error + // Check if we can read more... + b, err := br.readSmall(1) + switch err { + case io.EOF, io.ErrUnexpectedEOF: + return io.EOF + case nil: + signature[0] = b[0] + default: + return err + } + // Read the rest, don't allow io.ErrUnexpectedEOF + b, err = br.readSmall(3) + switch err { + case io.EOF: + return io.EOF + case nil: + copy(signature[1:], b) + default: + return err + } + + if string(signature[1:4]) != skippableFrameMagic || signature[0]&0xf0 != 0x50 { + if debugDecoder { + println("Not skippable", hex.EncodeToString(signature[:]), hex.EncodeToString([]byte(skippableFrameMagic))) + } + // Break if not skippable frame. + break + } + // Read size to skip + b, err = br.readSmall(4) + if err != nil { + if debugDecoder { + println("Reading Frame Size", err) + } + return err + } + n := uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24) + println("Skipping frame with", n, "bytes.") + err = br.skipN(int64(n)) + if err != nil { + if debugDecoder { + println("Reading discarded frame", err) + } + return err + } + } + if string(signature[:]) != frameMagic { + if debugDecoder { + println("Got magic numbers: ", signature, "want:", []byte(frameMagic)) + } + return ErrMagicMismatch + } + + // Read Frame_Header_Descriptor + fhd, err := br.readByte() + if err != nil { + if debugDecoder { + println("Reading Frame_Header_Descriptor", err) + } + return err + } + d.SingleSegment = fhd&(1<<5) != 0 + + if fhd&(1<<3) != 0 { + return errors.New("reserved bit set on frame header") + } + + // Read Window_Descriptor + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#window_descriptor + d.WindowSize = 0 + if !d.SingleSegment { + wd, err := br.readByte() + if err != nil { + if debugDecoder { + println("Reading Window_Descriptor", err) + } + return err + } + printf("raw: %x, mantissa: %d, exponent: %d\n", wd, wd&7, wd>>3) + windowLog := 10 + (wd >> 3) + windowBase := uint64(1) << windowLog + windowAdd := (windowBase / 8) * uint64(wd&0x7) + d.WindowSize = windowBase + windowAdd + } + + // Read Dictionary_ID + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary_id + d.DictionaryID = 0 + if size := fhd & 3; size != 0 { + if size == 3 { + size = 4 + } + + b, err := br.readSmall(int(size)) + if err != nil { + println("Reading Dictionary_ID", err) + return err + } + var id uint32 + switch len(b) { + case 1: + id = uint32(b[0]) + case 2: + id = uint32(b[0]) | (uint32(b[1]) << 8) + case 4: + id = uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24) + } + if debugDecoder { + println("Dict size", size, "ID:", id) + } + d.DictionaryID = id + } + + // Read Frame_Content_Size + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#frame_content_size + var fcsSize int + v := fhd >> 6 + switch v { + case 0: + if d.SingleSegment { + fcsSize = 1 + } + default: + fcsSize = 1 << v + } + d.FrameContentSize = fcsUnknown + if fcsSize > 0 { + b, err := br.readSmall(fcsSize) + if err != nil { + println("Reading Frame content", err) + return err + } + switch len(b) { + case 1: + d.FrameContentSize = uint64(b[0]) + case 2: + // When FCS_Field_Size is 2, the offset of 256 is added. + d.FrameContentSize = uint64(b[0]) | (uint64(b[1]) << 8) + 256 + case 4: + d.FrameContentSize = uint64(b[0]) | (uint64(b[1]) << 8) | (uint64(b[2]) << 16) | (uint64(b[3]) << 24) + case 8: + d1 := uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24) + d2 := uint32(b[4]) | (uint32(b[5]) << 8) | (uint32(b[6]) << 16) | (uint32(b[7]) << 24) + d.FrameContentSize = uint64(d1) | (uint64(d2) << 32) + } + if debugDecoder { + println("Read FCS:", d.FrameContentSize) + } + } + + // Move this to shared. + d.HasCheckSum = fhd&(1<<2) != 0 + if d.HasCheckSum { + if d.crc == nil { + d.crc = xxhash.New() + } + d.crc.Reset() + } + + if d.WindowSize > d.o.maxWindowSize { + if debugDecoder { + printf("window size %d > max %d\n", d.WindowSize, d.o.maxWindowSize) + } + return ErrWindowSizeExceeded + } + + if d.WindowSize == 0 && d.SingleSegment { + // We may not need window in this case. + d.WindowSize = d.FrameContentSize + if d.WindowSize < MinWindowSize { + d.WindowSize = MinWindowSize + } + if d.WindowSize > d.o.maxDecodedSize { + if debugDecoder { + printf("window size %d > max %d\n", d.WindowSize, d.o.maxWindowSize) + } + return ErrDecoderSizeExceeded + } + } + + // The minimum Window_Size is 1 KB. + if d.WindowSize < MinWindowSize { + if debugDecoder { + println("got window size: ", d.WindowSize) + } + return ErrWindowSizeTooSmall + } + d.history.windowSize = int(d.WindowSize) + if !d.o.lowMem || d.history.windowSize < maxBlockSize { + // Alloc 2x window size if not low-mem, or window size below 2MB. + d.history.allocFrameBuffer = d.history.windowSize * 2 + } else { + if d.o.lowMem { + // Alloc with 1MB extra. + d.history.allocFrameBuffer = d.history.windowSize + maxBlockSize/2 + } else { + // Alloc with 2MB extra. + d.history.allocFrameBuffer = d.history.windowSize + maxBlockSize + } + } + + if debugDecoder { + println("Frame: Dict:", d.DictionaryID, "FrameContentSize:", d.FrameContentSize, "singleseg:", d.SingleSegment, "window:", d.WindowSize, "crc:", d.HasCheckSum) + } + + // history contains input - maybe we do something + d.rawInput = br + return nil +} + +// next will start decoding the next block from stream. +func (d *frameDec) next(block *blockDec) error { + if debugDecoder { + println("decoding new block") + } + err := block.reset(d.rawInput, d.WindowSize) + if err != nil { + println("block error:", err) + // Signal the frame decoder we have a problem. + block.sendErr(err) + return err + } + return nil +} + +// checkCRC will check the checksum, assuming the frame has one. +// Will return ErrCRCMismatch if crc check failed, otherwise nil. +func (d *frameDec) checkCRC() error { + // We can overwrite upper tmp now + buf, err := d.rawInput.readSmall(4) + if err != nil { + println("CRC missing?", err) + return err + } + + want := binary.LittleEndian.Uint32(buf[:4]) + got := uint32(d.crc.Sum64()) + + if got != want { + if debugDecoder { + printf("CRC check failed: got %08x, want %08x\n", got, want) + } + return ErrCRCMismatch + } + if debugDecoder { + printf("CRC ok %08x\n", got) + } + return nil +} + +// consumeCRC skips over the checksum, assuming the frame has one. +func (d *frameDec) consumeCRC() error { + _, err := d.rawInput.readSmall(4) + if err != nil { + println("CRC missing?", err) + } + return err +} + +// runDecoder will run the decoder for the remainder of the frame. +func (d *frameDec) runDecoder(dst []byte, dec *blockDec) ([]byte, error) { + saved := d.history.b + + // We use the history for output to avoid copying it. + d.history.b = dst + d.history.ignoreBuffer = len(dst) + // Store input length, so we only check new data. + crcStart := len(dst) + d.history.decoders.maxSyncLen = 0 + if d.o.limitToCap { + d.history.decoders.maxSyncLen = uint64(cap(dst) - len(dst)) + } + if d.FrameContentSize != fcsUnknown { + if !d.o.limitToCap || d.FrameContentSize+uint64(len(dst)) < d.history.decoders.maxSyncLen { + d.history.decoders.maxSyncLen = d.FrameContentSize + uint64(len(dst)) + } + if d.history.decoders.maxSyncLen > d.o.maxDecodedSize { + if debugDecoder { + println("maxSyncLen:", d.history.decoders.maxSyncLen, "> maxDecodedSize:", d.o.maxDecodedSize) + } + return dst, ErrDecoderSizeExceeded + } + if debugDecoder { + println("maxSyncLen:", d.history.decoders.maxSyncLen) + } + if !d.o.limitToCap && uint64(cap(dst)) < d.history.decoders.maxSyncLen { + // Alloc for output + dst2 := make([]byte, len(dst), d.history.decoders.maxSyncLen+compressedBlockOverAlloc) + copy(dst2, dst) + dst = dst2 + } + } + var err error + for { + err = dec.reset(d.rawInput, d.WindowSize) + if err != nil { + break + } + if debugDecoder { + println("next block:", dec) + } + err = dec.decodeBuf(&d.history) + if err != nil { + break + } + if uint64(len(d.history.b)-crcStart) > d.o.maxDecodedSize { + println("runDecoder: maxDecodedSize exceeded", uint64(len(d.history.b)-crcStart), ">", d.o.maxDecodedSize) + err = ErrDecoderSizeExceeded + break + } + if d.o.limitToCap && len(d.history.b) > cap(dst) { + println("runDecoder: cap exceeded", uint64(len(d.history.b)), ">", cap(dst)) + err = ErrDecoderSizeExceeded + break + } + if uint64(len(d.history.b)-crcStart) > d.FrameContentSize { + println("runDecoder: FrameContentSize exceeded", uint64(len(d.history.b)-crcStart), ">", d.FrameContentSize) + err = ErrFrameSizeExceeded + break + } + if dec.Last { + break + } + if debugDecoder { + println("runDecoder: FrameContentSize", uint64(len(d.history.b)-crcStart), "<=", d.FrameContentSize) + } + } + dst = d.history.b + if err == nil { + if d.FrameContentSize != fcsUnknown && uint64(len(d.history.b)-crcStart) != d.FrameContentSize { + err = ErrFrameSizeMismatch + } else if d.HasCheckSum { + if d.o.ignoreChecksum { + err = d.consumeCRC() + } else { + d.crc.Write(dst[crcStart:]) + err = d.checkCRC() + } + } + } + d.history.b = saved + return dst, err +} diff --git a/vendor/github.com/klauspost/compress/zstd/frameenc.go b/vendor/github.com/klauspost/compress/zstd/frameenc.go new file mode 100644 index 0000000000..667ca06794 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/frameenc.go @@ -0,0 +1,137 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "encoding/binary" + "fmt" + "io" + "math" + "math/bits" +) + +type frameHeader struct { + ContentSize uint64 + WindowSize uint32 + SingleSegment bool + Checksum bool + DictID uint32 +} + +const maxHeaderSize = 14 + +func (f frameHeader) appendTo(dst []byte) []byte { + dst = append(dst, frameMagic...) + var fhd uint8 + if f.Checksum { + fhd |= 1 << 2 + } + if f.SingleSegment { + fhd |= 1 << 5 + } + + var dictIDContent []byte + if f.DictID > 0 { + var tmp [4]byte + if f.DictID < 256 { + fhd |= 1 + tmp[0] = uint8(f.DictID) + dictIDContent = tmp[:1] + } else if f.DictID < 1<<16 { + fhd |= 2 + binary.LittleEndian.PutUint16(tmp[:2], uint16(f.DictID)) + dictIDContent = tmp[:2] + } else { + fhd |= 3 + binary.LittleEndian.PutUint32(tmp[:4], f.DictID) + dictIDContent = tmp[:4] + } + } + var fcs uint8 + if f.ContentSize >= 256 { + fcs++ + } + if f.ContentSize >= 65536+256 { + fcs++ + } + if f.ContentSize >= 0xffffffff { + fcs++ + } + + fhd |= fcs << 6 + + dst = append(dst, fhd) + if !f.SingleSegment { + const winLogMin = 10 + windowLog := (bits.Len32(f.WindowSize-1) - winLogMin) << 3 + dst = append(dst, uint8(windowLog)) + } + if f.DictID > 0 { + dst = append(dst, dictIDContent...) + } + switch fcs { + case 0: + if f.SingleSegment { + dst = append(dst, uint8(f.ContentSize)) + } + // Unless SingleSegment is set, framessizes < 256 are not stored. + case 1: + f.ContentSize -= 256 + dst = append(dst, uint8(f.ContentSize), uint8(f.ContentSize>>8)) + case 2: + dst = append(dst, uint8(f.ContentSize), uint8(f.ContentSize>>8), uint8(f.ContentSize>>16), uint8(f.ContentSize>>24)) + case 3: + dst = append(dst, uint8(f.ContentSize), uint8(f.ContentSize>>8), uint8(f.ContentSize>>16), uint8(f.ContentSize>>24), + uint8(f.ContentSize>>32), uint8(f.ContentSize>>40), uint8(f.ContentSize>>48), uint8(f.ContentSize>>56)) + default: + panic("invalid fcs") + } + return dst +} + +const skippableFrameHeader = 4 + 4 + +// calcSkippableFrame will return a total size to be added for written +// to be divisible by multiple. +// The value will always be > skippableFrameHeader. +// The function will panic if written < 0 or wantMultiple <= 0. +func calcSkippableFrame(written, wantMultiple int64) int { + if wantMultiple <= 0 { + panic("wantMultiple <= 0") + } + if written < 0 { + panic("written < 0") + } + leftOver := written % wantMultiple + if leftOver == 0 { + return 0 + } + toAdd := wantMultiple - leftOver + for toAdd < skippableFrameHeader { + toAdd += wantMultiple + } + return int(toAdd) +} + +// skippableFrame will add a skippable frame with a total size of bytes. +// total should be >= skippableFrameHeader and < math.MaxUint32. +func skippableFrame(dst []byte, total int, r io.Reader) ([]byte, error) { + if total == 0 { + return dst, nil + } + if total < skippableFrameHeader { + return dst, fmt.Errorf("requested skippable frame (%d) < 8", total) + } + if int64(total) > math.MaxUint32 { + return dst, fmt.Errorf("requested skippable frame (%d) > max uint32", total) + } + dst = append(dst, 0x50, 0x2a, 0x4d, 0x18) + f := uint32(total - skippableFrameHeader) + dst = append(dst, uint8(f), uint8(f>>8), uint8(f>>16), uint8(f>>24)) + start := len(dst) + dst = append(dst, make([]byte, f)...) + _, err := io.ReadFull(r, dst[start:]) + return dst, err +} diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder.go b/vendor/github.com/klauspost/compress/zstd/fse_decoder.go new file mode 100644 index 0000000000..2f8860a722 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder.go @@ -0,0 +1,307 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "encoding/binary" + "errors" + "fmt" + "io" +) + +const ( + tablelogAbsoluteMax = 9 +) + +const ( + /*!MEMORY_USAGE : + * Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.) + * Increasing memory usage improves compression ratio + * Reduced memory usage can improve speed, due to cache effect + * Recommended max value is 14, for 16KB, which nicely fits into Intel x86 L1 cache */ + maxMemoryUsage = tablelogAbsoluteMax + 2 + + maxTableLog = maxMemoryUsage - 2 + maxTablesize = 1 << maxTableLog + maxTableMask = (1 << maxTableLog) - 1 + minTablelog = 5 + maxSymbolValue = 255 +) + +// fseDecoder provides temporary storage for compression and decompression. +type fseDecoder struct { + dt [maxTablesize]decSymbol // Decompression table. + symbolLen uint16 // Length of active part of the symbol table. + actualTableLog uint8 // Selected tablelog. + maxBits uint8 // Maximum number of additional bits + + // used for table creation to avoid allocations. + stateTable [256]uint16 + norm [maxSymbolValue + 1]int16 + preDefined bool +} + +// tableStep returns the next table index. +func tableStep(tableSize uint32) uint32 { + return (tableSize >> 1) + (tableSize >> 3) + 3 +} + +// readNCount will read the symbol distribution so decoding tables can be constructed. +func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { + var ( + charnum uint16 + previous0 bool + ) + if b.remain() < 4 { + return errors.New("input too small") + } + bitStream := b.Uint32NC() + nbBits := uint((bitStream & 0xF) + minTablelog) // extract tableLog + if nbBits > tablelogAbsoluteMax { + println("Invalid tablelog:", nbBits) + return errors.New("tableLog too large") + } + bitStream >>= 4 + bitCount := uint(4) + + s.actualTableLog = uint8(nbBits) + remaining := int32((1 << nbBits) + 1) + threshold := int32(1 << nbBits) + gotTotal := int32(0) + nbBits++ + + for remaining > 1 && charnum <= maxSymbol { + if previous0 { + //println("prev0") + n0 := charnum + for (bitStream & 0xFFFF) == 0xFFFF { + //println("24 x 0") + n0 += 24 + if r := b.remain(); r > 5 { + b.advance(2) + // The check above should make sure we can read 32 bits + bitStream = b.Uint32NC() >> bitCount + } else { + // end of bit stream + bitStream >>= 16 + bitCount += 16 + } + } + //printf("bitstream: %d, 0b%b", bitStream&3, bitStream) + for (bitStream & 3) == 3 { + n0 += 3 + bitStream >>= 2 + bitCount += 2 + } + n0 += uint16(bitStream & 3) + bitCount += 2 + + if n0 > maxSymbolValue { + return errors.New("maxSymbolValue too small") + } + //println("inserting ", n0-charnum, "zeroes from idx", charnum, "ending before", n0) + for charnum < n0 { + s.norm[uint8(charnum)] = 0 + charnum++ + } + + if r := b.remain(); r >= 7 || r-int(bitCount>>3) >= 4 { + b.advance(bitCount >> 3) + bitCount &= 7 + // The check above should make sure we can read 32 bits + bitStream = b.Uint32NC() >> bitCount + } else { + bitStream >>= 2 + } + } + + max := (2*threshold - 1) - remaining + var count int32 + + if int32(bitStream)&(threshold-1) < max { + count = int32(bitStream) & (threshold - 1) + if debugAsserts && nbBits < 1 { + panic("nbBits underflow") + } + bitCount += nbBits - 1 + } else { + count = int32(bitStream) & (2*threshold - 1) + if count >= threshold { + count -= max + } + bitCount += nbBits + } + + // extra accuracy + count-- + if count < 0 { + // -1 means +1 + remaining += count + gotTotal -= count + } else { + remaining -= count + gotTotal += count + } + s.norm[charnum&0xff] = int16(count) + charnum++ + previous0 = count == 0 + for remaining < threshold { + nbBits-- + threshold >>= 1 + } + + if r := b.remain(); r >= 7 || r-int(bitCount>>3) >= 4 { + b.advance(bitCount >> 3) + bitCount &= 7 + // The check above should make sure we can read 32 bits + bitStream = b.Uint32NC() >> (bitCount & 31) + } else { + bitCount -= (uint)(8 * (len(b.b) - 4 - b.off)) + b.off = len(b.b) - 4 + bitStream = b.Uint32() >> (bitCount & 31) + } + } + s.symbolLen = charnum + if s.symbolLen <= 1 { + return fmt.Errorf("symbolLen (%d) too small", s.symbolLen) + } + if s.symbolLen > maxSymbolValue+1 { + return fmt.Errorf("symbolLen (%d) too big", s.symbolLen) + } + if remaining != 1 { + return fmt.Errorf("corruption detected (remaining %d != 1)", remaining) + } + if bitCount > 32 { + return fmt.Errorf("corruption detected (bitCount %d > 32)", bitCount) + } + if gotTotal != 1<> 3) + return s.buildDtable() +} + +func (s *fseDecoder) mustReadFrom(r io.Reader) { + fatalErr := func(err error) { + if err != nil { + panic(err) + } + } + // dt [maxTablesize]decSymbol // Decompression table. + // symbolLen uint16 // Length of active part of the symbol table. + // actualTableLog uint8 // Selected tablelog. + // maxBits uint8 // Maximum number of additional bits + // // used for table creation to avoid allocations. + // stateTable [256]uint16 + // norm [maxSymbolValue + 1]int16 + // preDefined bool + fatalErr(binary.Read(r, binary.LittleEndian, &s.dt)) + fatalErr(binary.Read(r, binary.LittleEndian, &s.symbolLen)) + fatalErr(binary.Read(r, binary.LittleEndian, &s.actualTableLog)) + fatalErr(binary.Read(r, binary.LittleEndian, &s.maxBits)) + fatalErr(binary.Read(r, binary.LittleEndian, &s.stateTable)) + fatalErr(binary.Read(r, binary.LittleEndian, &s.norm)) + fatalErr(binary.Read(r, binary.LittleEndian, &s.preDefined)) +} + +// decSymbol contains information about a state entry, +// Including the state offset base, the output symbol and +// the number of bits to read for the low part of the destination state. +// Using a composite uint64 is faster than a struct with separate members. +type decSymbol uint64 + +func newDecSymbol(nbits, addBits uint8, newState uint16, baseline uint32) decSymbol { + return decSymbol(nbits) | (decSymbol(addBits) << 8) | (decSymbol(newState) << 16) | (decSymbol(baseline) << 32) +} + +func (d decSymbol) nbBits() uint8 { + return uint8(d) +} + +func (d decSymbol) addBits() uint8 { + return uint8(d >> 8) +} + +func (d decSymbol) newState() uint16 { + return uint16(d >> 16) +} + +func (d decSymbol) baselineInt() int { + return int(d >> 32) +} + +func (d *decSymbol) setNBits(nBits uint8) { + const mask = 0xffffffffffffff00 + *d = (*d & mask) | decSymbol(nBits) +} + +func (d *decSymbol) setAddBits(addBits uint8) { + const mask = 0xffffffffffff00ff + *d = (*d & mask) | (decSymbol(addBits) << 8) +} + +func (d *decSymbol) setNewState(state uint16) { + const mask = 0xffffffff0000ffff + *d = (*d & mask) | decSymbol(state)<<16 +} + +func (d *decSymbol) setExt(addBits uint8, baseline uint32) { + const mask = 0xffff00ff + *d = (*d & mask) | (decSymbol(addBits) << 8) | (decSymbol(baseline) << 32) +} + +// decSymbolValue returns the transformed decSymbol for the given symbol. +func decSymbolValue(symb uint8, t []baseOffset) (decSymbol, error) { + if int(symb) >= len(t) { + return 0, fmt.Errorf("rle symbol %d >= max %d", symb, len(t)) + } + lu := t[symb] + return newDecSymbol(0, lu.addBits, 0, lu.baseLine), nil +} + +// setRLE will set the decoder til RLE mode. +func (s *fseDecoder) setRLE(symbol decSymbol) { + s.actualTableLog = 0 + s.maxBits = symbol.addBits() + s.dt[0] = symbol +} + +// transform will transform the decoder table into a table usable for +// decoding without having to apply the transformation while decoding. +// The state will contain the base value and the number of bits to read. +func (s *fseDecoder) transform(t []baseOffset) error { + tableSize := uint16(1 << s.actualTableLog) + s.maxBits = 0 + for i, v := range s.dt[:tableSize] { + add := v.addBits() + if int(add) >= len(t) { + return fmt.Errorf("invalid decoding table entry %d, symbol %d >= max (%d)", i, v.addBits(), len(t)) + } + lu := t[add] + if lu.addBits > s.maxBits { + s.maxBits = lu.addBits + } + v.setExt(lu.addBits, lu.baseLine) + s.dt[i] = v + } + return nil +} + +type fseState struct { + dt []decSymbol + state decSymbol +} + +// Initialize and decodeAsync first state and symbol. +func (s *fseState) init(br *bitReader, tableLog uint8, dt []decSymbol) { + s.dt = dt + br.fill() + s.state = dt[br.getBits(tableLog)] +} + +// final returns the current state symbol without decoding the next. +func (s decSymbol) final() (int, uint8) { + return s.baselineInt(), s.addBits() +} diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.go b/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.go new file mode 100644 index 0000000000..d04a829b0a --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.go @@ -0,0 +1,65 @@ +//go:build amd64 && !appengine && !noasm && gc +// +build amd64,!appengine,!noasm,gc + +package zstd + +import ( + "fmt" +) + +type buildDtableAsmContext struct { + // inputs + stateTable *uint16 + norm *int16 + dt *uint64 + + // outputs --- set by the procedure in the case of error; + // for interpretation please see the error handling part below + errParam1 uint64 + errParam2 uint64 +} + +// buildDtable_asm is an x86 assembly implementation of fseDecoder.buildDtable. +// Function returns non-zero exit code on error. +// +//go:noescape +func buildDtable_asm(s *fseDecoder, ctx *buildDtableAsmContext) int + +// please keep in sync with _generate/gen_fse.go +const ( + errorCorruptedNormalizedCounter = 1 + errorNewStateTooBig = 2 + errorNewStateNoBits = 3 +) + +// buildDtable will build the decoding table. +func (s *fseDecoder) buildDtable() error { + ctx := buildDtableAsmContext{ + stateTable: &s.stateTable[0], + norm: &s.norm[0], + dt: (*uint64)(&s.dt[0]), + } + code := buildDtable_asm(s, &ctx) + + if code != 0 { + switch code { + case errorCorruptedNormalizedCounter: + position := ctx.errParam1 + return fmt.Errorf("corrupted input (position=%d, expected 0)", position) + + case errorNewStateTooBig: + newState := decSymbol(ctx.errParam1) + size := ctx.errParam2 + return fmt.Errorf("newState (%d) outside table size (%d)", newState, size) + + case errorNewStateNoBits: + newState := decSymbol(ctx.errParam1) + oldState := decSymbol(ctx.errParam2) + return fmt.Errorf("newState (%d) == oldState (%d) and no bits", newState, oldState) + + default: + return fmt.Errorf("buildDtable_asm returned unhandled nonzero code = %d", code) + } + } + return nil +} diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.s b/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.s new file mode 100644 index 0000000000..bcde398695 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.s @@ -0,0 +1,126 @@ +// Code generated by command: go run gen_fse.go -out ../fse_decoder_amd64.s -pkg=zstd. DO NOT EDIT. + +//go:build !appengine && !noasm && gc && !noasm + +// func buildDtable_asm(s *fseDecoder, ctx *buildDtableAsmContext) int +TEXT ·buildDtable_asm(SB), $0-24 + MOVQ ctx+8(FP), CX + MOVQ s+0(FP), DI + + // Load values + MOVBQZX 4098(DI), DX + XORQ AX, AX + BTSQ DX, AX + MOVQ (CX), BX + MOVQ 16(CX), SI + LEAQ -1(AX), R8 + MOVQ 8(CX), CX + MOVWQZX 4096(DI), DI + + // End load values + // Init, lay down lowprob symbols + XORQ R9, R9 + JMP init_main_loop_condition + +init_main_loop: + MOVWQSX (CX)(R9*2), R10 + CMPW R10, $-1 + JNE do_not_update_high_threshold + MOVB R9, 1(SI)(R8*8) + DECQ R8 + MOVQ $0x0000000000000001, R10 + +do_not_update_high_threshold: + MOVW R10, (BX)(R9*2) + INCQ R9 + +init_main_loop_condition: + CMPQ R9, DI + JL init_main_loop + + // Spread symbols + // Calculate table step + MOVQ AX, R9 + SHRQ $0x01, R9 + MOVQ AX, R10 + SHRQ $0x03, R10 + LEAQ 3(R9)(R10*1), R9 + + // Fill add bits values + LEAQ -1(AX), R10 + XORQ R11, R11 + XORQ R12, R12 + JMP spread_main_loop_condition + +spread_main_loop: + XORQ R13, R13 + MOVWQSX (CX)(R12*2), R14 + JMP spread_inner_loop_condition + +spread_inner_loop: + MOVB R12, 1(SI)(R11*8) + +adjust_position: + ADDQ R9, R11 + ANDQ R10, R11 + CMPQ R11, R8 + JG adjust_position + INCQ R13 + +spread_inner_loop_condition: + CMPQ R13, R14 + JL spread_inner_loop + INCQ R12 + +spread_main_loop_condition: + CMPQ R12, DI + JL spread_main_loop + TESTQ R11, R11 + JZ spread_check_ok + MOVQ ctx+8(FP), AX + MOVQ R11, 24(AX) + MOVQ $+1, ret+16(FP) + RET + +spread_check_ok: + // Build Decoding table + XORQ DI, DI + +build_table_main_table: + MOVBQZX 1(SI)(DI*8), CX + MOVWQZX (BX)(CX*2), R8 + LEAQ 1(R8), R9 + MOVW R9, (BX)(CX*2) + MOVQ R8, R9 + BSRQ R9, R9 + MOVQ DX, CX + SUBQ R9, CX + SHLQ CL, R8 + SUBQ AX, R8 + MOVB CL, (SI)(DI*8) + MOVW R8, 2(SI)(DI*8) + CMPQ R8, AX + JLE build_table_check1_ok + MOVQ ctx+8(FP), CX + MOVQ R8, 24(CX) + MOVQ AX, 32(CX) + MOVQ $+2, ret+16(FP) + RET + +build_table_check1_ok: + TESTB CL, CL + JNZ build_table_check2_ok + CMPW R8, DI + JNE build_table_check2_ok + MOVQ ctx+8(FP), AX + MOVQ R8, 24(AX) + MOVQ DI, 32(AX) + MOVQ $+3, ret+16(FP) + RET + +build_table_check2_ok: + INCQ DI + CMPQ DI, AX + JL build_table_main_table + MOVQ $+0, ret+16(FP) + RET diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go b/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go new file mode 100644 index 0000000000..8adfebb029 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go @@ -0,0 +1,73 @@ +//go:build !amd64 || appengine || !gc || noasm +// +build !amd64 appengine !gc noasm + +package zstd + +import ( + "errors" + "fmt" +) + +// buildDtable will build the decoding table. +func (s *fseDecoder) buildDtable() error { + tableSize := uint32(1 << s.actualTableLog) + highThreshold := tableSize - 1 + symbolNext := s.stateTable[:256] + + // Init, lay down lowprob symbols + { + for i, v := range s.norm[:s.symbolLen] { + if v == -1 { + s.dt[highThreshold].setAddBits(uint8(i)) + highThreshold-- + v = 1 + } + symbolNext[i] = uint16(v) + } + } + + // Spread symbols + { + tableMask := tableSize - 1 + step := tableStep(tableSize) + position := uint32(0) + for ss, v := range s.norm[:s.symbolLen] { + for i := 0; i < int(v); i++ { + s.dt[position].setAddBits(uint8(ss)) + for { + // lowprob area + position = (position + step) & tableMask + if position <= highThreshold { + break + } + } + } + } + if position != 0 { + // position must reach all cells once, otherwise normalizedCounter is incorrect + return errors.New("corrupted input (position != 0)") + } + } + + // Build Decoding table + { + tableSize := uint16(1 << s.actualTableLog) + for u, v := range s.dt[:tableSize] { + symbol := v.addBits() + nextState := symbolNext[symbol] + symbolNext[symbol] = nextState + 1 + nBits := s.actualTableLog - byte(highBits(uint32(nextState))) + s.dt[u&maxTableMask].setNBits(nBits) + newState := (nextState << nBits) - tableSize + if newState > tableSize { + return fmt.Errorf("newState (%d) outside table size (%d)", newState, tableSize) + } + if newState == uint16(u) && nBits == 0 { + // Seems weird that this is possible with nbits > 0. + return fmt.Errorf("newState (%d) == oldState (%d) and no bits", newState, u) + } + s.dt[u&maxTableMask].setNewState(newState) + } + } + return nil +} diff --git a/vendor/github.com/klauspost/compress/zstd/fse_encoder.go b/vendor/github.com/klauspost/compress/zstd/fse_encoder.go new file mode 100644 index 0000000000..ab26326a8f --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/fse_encoder.go @@ -0,0 +1,701 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "errors" + "fmt" + "math" +) + +const ( + // For encoding we only support up to + maxEncTableLog = 8 + maxEncTablesize = 1 << maxTableLog + maxEncTableMask = (1 << maxTableLog) - 1 + minEncTablelog = 5 + maxEncSymbolValue = maxMatchLengthSymbol +) + +// Scratch provides temporary storage for compression and decompression. +type fseEncoder struct { + symbolLen uint16 // Length of active part of the symbol table. + actualTableLog uint8 // Selected tablelog. + ct cTable // Compression tables. + maxCount int // count of the most probable symbol + zeroBits bool // no bits has prob > 50%. + clearCount bool // clear count + useRLE bool // This encoder is for RLE + preDefined bool // This encoder is predefined. + reUsed bool // Set to know when the encoder has been reused. + rleVal uint8 // RLE Symbol + maxBits uint8 // Maximum output bits after transform. + + // TODO: Technically zstd should be fine with 64 bytes. + count [256]uint32 + norm [256]int16 +} + +// cTable contains tables used for compression. +type cTable struct { + tableSymbol []byte + stateTable []uint16 + symbolTT []symbolTransform +} + +// symbolTransform contains the state transform for a symbol. +type symbolTransform struct { + deltaNbBits uint32 + deltaFindState int16 + outBits uint8 +} + +// String prints values as a human readable string. +func (s symbolTransform) String() string { + return fmt.Sprintf("{deltabits: %08x, findstate:%d outbits:%d}", s.deltaNbBits, s.deltaFindState, s.outBits) +} + +// Histogram allows to populate the histogram and skip that step in the compression, +// It otherwise allows to inspect the histogram when compression is done. +// To indicate that you have populated the histogram call HistogramFinished +// with the value of the highest populated symbol, as well as the number of entries +// in the most populated entry. These are accepted at face value. +func (s *fseEncoder) Histogram() *[256]uint32 { + return &s.count +} + +// HistogramFinished can be called to indicate that the histogram has been populated. +// maxSymbol is the index of the highest set symbol of the next data segment. +// maxCount is the number of entries in the most populated entry. +// These are accepted at face value. +func (s *fseEncoder) HistogramFinished(maxSymbol uint8, maxCount int) { + s.maxCount = maxCount + s.symbolLen = uint16(maxSymbol) + 1 + s.clearCount = maxCount != 0 +} + +// allocCtable will allocate tables needed for compression. +// If existing tables a re big enough, they are simply re-used. +func (s *fseEncoder) allocCtable() { + tableSize := 1 << s.actualTableLog + // get tableSymbol that is big enough. + if cap(s.ct.tableSymbol) < tableSize { + s.ct.tableSymbol = make([]byte, tableSize) + } + s.ct.tableSymbol = s.ct.tableSymbol[:tableSize] + + ctSize := tableSize + if cap(s.ct.stateTable) < ctSize { + s.ct.stateTable = make([]uint16, ctSize) + } + s.ct.stateTable = s.ct.stateTable[:ctSize] + + if cap(s.ct.symbolTT) < 256 { + s.ct.symbolTT = make([]symbolTransform, 256) + } + s.ct.symbolTT = s.ct.symbolTT[:256] +} + +// buildCTable will populate the compression table so it is ready to be used. +func (s *fseEncoder) buildCTable() error { + tableSize := uint32(1 << s.actualTableLog) + highThreshold := tableSize - 1 + var cumul [256]int16 + + s.allocCtable() + tableSymbol := s.ct.tableSymbol[:tableSize] + // symbol start positions + { + cumul[0] = 0 + for ui, v := range s.norm[:s.symbolLen-1] { + u := byte(ui) // one less than reference + if v == -1 { + // Low proba symbol + cumul[u+1] = cumul[u] + 1 + tableSymbol[highThreshold] = u + highThreshold-- + } else { + cumul[u+1] = cumul[u] + v + } + } + // Encode last symbol separately to avoid overflowing u + u := int(s.symbolLen - 1) + v := s.norm[s.symbolLen-1] + if v == -1 { + // Low proba symbol + cumul[u+1] = cumul[u] + 1 + tableSymbol[highThreshold] = byte(u) + highThreshold-- + } else { + cumul[u+1] = cumul[u] + v + } + if uint32(cumul[s.symbolLen]) != tableSize { + return fmt.Errorf("internal error: expected cumul[s.symbolLen] (%d) == tableSize (%d)", cumul[s.symbolLen], tableSize) + } + cumul[s.symbolLen] = int16(tableSize) + 1 + } + // Spread symbols + s.zeroBits = false + { + step := tableStep(tableSize) + tableMask := tableSize - 1 + var position uint32 + // if any symbol > largeLimit, we may have 0 bits output. + largeLimit := int16(1 << (s.actualTableLog - 1)) + for ui, v := range s.norm[:s.symbolLen] { + symbol := byte(ui) + if v > largeLimit { + s.zeroBits = true + } + for nbOccurrences := int16(0); nbOccurrences < v; nbOccurrences++ { + tableSymbol[position] = symbol + position = (position + step) & tableMask + for position > highThreshold { + position = (position + step) & tableMask + } /* Low proba area */ + } + } + + // Check if we have gone through all positions + if position != 0 { + return errors.New("position!=0") + } + } + + // Build table + table := s.ct.stateTable + { + tsi := int(tableSize) + for u, v := range tableSymbol { + // TableU16 : sorted by symbol order; gives next state value + table[cumul[v]] = uint16(tsi + u) + cumul[v]++ + } + } + + // Build Symbol Transformation Table + { + total := int16(0) + symbolTT := s.ct.symbolTT[:s.symbolLen] + tableLog := s.actualTableLog + tl := (uint32(tableLog) << 16) - (1 << tableLog) + for i, v := range s.norm[:s.symbolLen] { + switch v { + case 0: + case -1, 1: + symbolTT[i].deltaNbBits = tl + symbolTT[i].deltaFindState = total - 1 + total++ + default: + maxBitsOut := uint32(tableLog) - highBit(uint32(v-1)) + minStatePlus := uint32(v) << maxBitsOut + symbolTT[i].deltaNbBits = (maxBitsOut << 16) - minStatePlus + symbolTT[i].deltaFindState = total - v + total += v + } + } + if total != int16(tableSize) { + return fmt.Errorf("total mismatch %d (got) != %d (want)", total, tableSize) + } + } + return nil +} + +var rtbTable = [...]uint32{0, 473195, 504333, 520860, 550000, 700000, 750000, 830000} + +func (s *fseEncoder) setRLE(val byte) { + s.allocCtable() + s.actualTableLog = 0 + s.ct.stateTable = s.ct.stateTable[:1] + s.ct.symbolTT[val] = symbolTransform{ + deltaFindState: 0, + deltaNbBits: 0, + } + if debugEncoder { + println("setRLE: val", val, "symbolTT", s.ct.symbolTT[val]) + } + s.rleVal = val + s.useRLE = true +} + +// setBits will set output bits for the transform. +// if nil is provided, the number of bits is equal to the index. +func (s *fseEncoder) setBits(transform []byte) { + if s.reUsed || s.preDefined { + return + } + if s.useRLE { + if transform == nil { + s.ct.symbolTT[s.rleVal].outBits = s.rleVal + s.maxBits = s.rleVal + return + } + s.maxBits = transform[s.rleVal] + s.ct.symbolTT[s.rleVal].outBits = s.maxBits + return + } + if transform == nil { + for i := range s.ct.symbolTT[:s.symbolLen] { + s.ct.symbolTT[i].outBits = uint8(i) + } + s.maxBits = uint8(s.symbolLen - 1) + return + } + s.maxBits = 0 + for i, v := range transform[:s.symbolLen] { + s.ct.symbolTT[i].outBits = v + if v > s.maxBits { + // We could assume bits always going up, but we play safe. + s.maxBits = v + } + } +} + +// normalizeCount will normalize the count of the symbols so +// the total is equal to the table size. +// If successful, compression tables will also be made ready. +func (s *fseEncoder) normalizeCount(length int) error { + if s.reUsed { + return nil + } + s.optimalTableLog(length) + var ( + tableLog = s.actualTableLog + scale = 62 - uint64(tableLog) + step = (1 << 62) / uint64(length) + vStep = uint64(1) << (scale - 20) + stillToDistribute = int16(1 << tableLog) + largest int + largestP int16 + lowThreshold = (uint32)(length >> tableLog) + ) + if s.maxCount == length { + s.useRLE = true + return nil + } + s.useRLE = false + for i, cnt := range s.count[:s.symbolLen] { + // already handled + // if (count[s] == s.length) return 0; /* rle special case */ + + if cnt == 0 { + s.norm[i] = 0 + continue + } + if cnt <= lowThreshold { + s.norm[i] = -1 + stillToDistribute-- + } else { + proba := (int16)((uint64(cnt) * step) >> scale) + if proba < 8 { + restToBeat := vStep * uint64(rtbTable[proba]) + v := uint64(cnt)*step - (uint64(proba) << scale) + if v > restToBeat { + proba++ + } + } + if proba > largestP { + largestP = proba + largest = i + } + s.norm[i] = proba + stillToDistribute -= proba + } + } + + if -stillToDistribute >= (s.norm[largest] >> 1) { + // corner case, need another normalization method + err := s.normalizeCount2(length) + if err != nil { + return err + } + if debugAsserts { + err = s.validateNorm() + if err != nil { + return err + } + } + return s.buildCTable() + } + s.norm[largest] += stillToDistribute + if debugAsserts { + err := s.validateNorm() + if err != nil { + return err + } + } + return s.buildCTable() +} + +// Secondary normalization method. +// To be used when primary method fails. +func (s *fseEncoder) normalizeCount2(length int) error { + const notYetAssigned = -2 + var ( + distributed uint32 + total = uint32(length) + tableLog = s.actualTableLog + lowThreshold = total >> tableLog + lowOne = (total * 3) >> (tableLog + 1) + ) + for i, cnt := range s.count[:s.symbolLen] { + if cnt == 0 { + s.norm[i] = 0 + continue + } + if cnt <= lowThreshold { + s.norm[i] = -1 + distributed++ + total -= cnt + continue + } + if cnt <= lowOne { + s.norm[i] = 1 + distributed++ + total -= cnt + continue + } + s.norm[i] = notYetAssigned + } + toDistribute := (1 << tableLog) - distributed + + if (total / toDistribute) > lowOne { + // risk of rounding to zero + lowOne = (total * 3) / (toDistribute * 2) + for i, cnt := range s.count[:s.symbolLen] { + if (s.norm[i] == notYetAssigned) && (cnt <= lowOne) { + s.norm[i] = 1 + distributed++ + total -= cnt + continue + } + } + toDistribute = (1 << tableLog) - distributed + } + if distributed == uint32(s.symbolLen)+1 { + // all values are pretty poor; + // probably incompressible data (should have already been detected); + // find max, then give all remaining points to max + var maxV int + var maxC uint32 + for i, cnt := range s.count[:s.symbolLen] { + if cnt > maxC { + maxV = i + maxC = cnt + } + } + s.norm[maxV] += int16(toDistribute) + return nil + } + + if total == 0 { + // all of the symbols were low enough for the lowOne or lowThreshold + for i := uint32(0); toDistribute > 0; i = (i + 1) % (uint32(s.symbolLen)) { + if s.norm[i] > 0 { + toDistribute-- + s.norm[i]++ + } + } + return nil + } + + var ( + vStepLog = 62 - uint64(tableLog) + mid = uint64((1 << (vStepLog - 1)) - 1) + rStep = (((1 << vStepLog) * uint64(toDistribute)) + mid) / uint64(total) // scale on remaining + tmpTotal = mid + ) + for i, cnt := range s.count[:s.symbolLen] { + if s.norm[i] == notYetAssigned { + var ( + end = tmpTotal + uint64(cnt)*rStep + sStart = uint32(tmpTotal >> vStepLog) + sEnd = uint32(end >> vStepLog) + weight = sEnd - sStart + ) + if weight < 1 { + return errors.New("weight < 1") + } + s.norm[i] = int16(weight) + tmpTotal = end + } + } + return nil +} + +// optimalTableLog calculates and sets the optimal tableLog in s.actualTableLog +func (s *fseEncoder) optimalTableLog(length int) { + tableLog := uint8(maxEncTableLog) + minBitsSrc := highBit(uint32(length)) + 1 + minBitsSymbols := highBit(uint32(s.symbolLen-1)) + 2 + minBits := uint8(minBitsSymbols) + if minBitsSrc < minBitsSymbols { + minBits = uint8(minBitsSrc) + } + + maxBitsSrc := uint8(highBit(uint32(length-1))) - 2 + if maxBitsSrc < tableLog { + // Accuracy can be reduced + tableLog = maxBitsSrc + } + if minBits > tableLog { + tableLog = minBits + } + // Need a minimum to safely represent all symbol values + if tableLog < minEncTablelog { + tableLog = minEncTablelog + } + if tableLog > maxEncTableLog { + tableLog = maxEncTableLog + } + s.actualTableLog = tableLog +} + +// validateNorm validates the normalized histogram table. +func (s *fseEncoder) validateNorm() (err error) { + var total int + for _, v := range s.norm[:s.symbolLen] { + if v >= 0 { + total += int(v) + } else { + total -= int(v) + } + } + defer func() { + if err == nil { + return + } + fmt.Printf("selected TableLog: %d, Symbol length: %d\n", s.actualTableLog, s.symbolLen) + for i, v := range s.norm[:s.symbolLen] { + fmt.Printf("%3d: %5d -> %4d \n", i, s.count[i], v) + } + }() + if total != (1 << s.actualTableLog) { + return fmt.Errorf("warning: Total == %d != %d", total, 1<> 3) + 3 + 2 + + // Write Table Size + bitStream = uint32(tableLog - minEncTablelog) + bitCount = uint(4) + remaining = int16(tableSize + 1) /* +1 for extra accuracy */ + threshold = int16(tableSize) + nbBits = uint(tableLog + 1) + outP = len(out) + ) + if cap(out) < outP+maxHeaderSize { + out = append(out, make([]byte, maxHeaderSize*3)...) + out = out[:len(out)-maxHeaderSize*3] + } + out = out[:outP+maxHeaderSize] + + // stops at 1 + for remaining > 1 { + if previous0 { + start := charnum + for s.norm[charnum] == 0 { + charnum++ + } + for charnum >= start+24 { + start += 24 + bitStream += uint32(0xFFFF) << bitCount + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += 2 + bitStream >>= 16 + } + for charnum >= start+3 { + start += 3 + bitStream += 3 << bitCount + bitCount += 2 + } + bitStream += uint32(charnum-start) << bitCount + bitCount += 2 + if bitCount > 16 { + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += 2 + bitStream >>= 16 + bitCount -= 16 + } + } + + count := s.norm[charnum] + charnum++ + max := (2*threshold - 1) - remaining + if count < 0 { + remaining += count + } else { + remaining -= count + } + count++ // +1 for extra accuracy + if count >= threshold { + count += max // [0..max[ [max..threshold[ (...) [threshold+max 2*threshold[ + } + bitStream += uint32(count) << bitCount + bitCount += nbBits + if count < max { + bitCount-- + } + + previous0 = count == 1 + if remaining < 1 { + return nil, errors.New("internal error: remaining < 1") + } + for remaining < threshold { + nbBits-- + threshold >>= 1 + } + + if bitCount > 16 { + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += 2 + bitStream >>= 16 + bitCount -= 16 + } + } + + if outP+2 > len(out) { + return nil, fmt.Errorf("internal error: %d > %d, maxheader: %d, sl: %d, tl: %d, normcount: %v", outP+2, len(out), maxHeaderSize, s.symbolLen, int(tableLog), s.norm[:s.symbolLen]) + } + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += int((bitCount + 7) / 8) + + if charnum > s.symbolLen { + return nil, errors.New("internal error: charnum > s.symbolLen") + } + return out[:outP], nil +} + +// Approximate symbol cost, as fractional value, using fixed-point format (accuracyLog fractional bits) +// note 1 : assume symbolValue is valid (<= maxSymbolValue) +// note 2 : if freq[symbolValue]==0, @return a fake cost of tableLog+1 bits * +func (s *fseEncoder) bitCost(symbolValue uint8, accuracyLog uint32) uint32 { + minNbBits := s.ct.symbolTT[symbolValue].deltaNbBits >> 16 + threshold := (minNbBits + 1) << 16 + if debugAsserts { + if !(s.actualTableLog < 16) { + panic("!s.actualTableLog < 16") + } + // ensure enough room for renormalization double shift + if !(uint8(accuracyLog) < 31-s.actualTableLog) { + panic("!uint8(accuracyLog) < 31-s.actualTableLog") + } + } + tableSize := uint32(1) << s.actualTableLog + deltaFromThreshold := threshold - (s.ct.symbolTT[symbolValue].deltaNbBits + tableSize) + // linear interpolation (very approximate) + normalizedDeltaFromThreshold := (deltaFromThreshold << accuracyLog) >> s.actualTableLog + bitMultiplier := uint32(1) << accuracyLog + if debugAsserts { + if s.ct.symbolTT[symbolValue].deltaNbBits+tableSize > threshold { + panic("s.ct.symbolTT[symbolValue].deltaNbBits+tableSize > threshold") + } + if normalizedDeltaFromThreshold > bitMultiplier { + panic("normalizedDeltaFromThreshold > bitMultiplier") + } + } + return (minNbBits+1)*bitMultiplier - normalizedDeltaFromThreshold +} + +// Returns the cost in bits of encoding the distribution in count using ctable. +// Histogram should only be up to the last non-zero symbol. +// Returns an -1 if ctable cannot represent all the symbols in count. +func (s *fseEncoder) approxSize(hist []uint32) uint32 { + if int(s.symbolLen) < len(hist) { + // More symbols than we have. + return math.MaxUint32 + } + if s.useRLE { + // We will never reuse RLE encoders. + return math.MaxUint32 + } + const kAccuracyLog = 8 + badCost := (uint32(s.actualTableLog) + 1) << kAccuracyLog + var cost uint32 + for i, v := range hist { + if v == 0 { + continue + } + if s.norm[i] == 0 { + return math.MaxUint32 + } + bitCost := s.bitCost(uint8(i), kAccuracyLog) + if bitCost > badCost { + return math.MaxUint32 + } + cost += v * bitCost + } + return cost >> kAccuracyLog +} + +// maxHeaderSize returns the maximum header size in bits. +// This is not exact size, but we want a penalty for new tables anyway. +func (s *fseEncoder) maxHeaderSize() uint32 { + if s.preDefined { + return 0 + } + if s.useRLE { + return 8 + } + return (((uint32(s.symbolLen) * uint32(s.actualTableLog)) >> 3) + 3) * 8 +} + +// cState contains the compression state of a stream. +type cState struct { + bw *bitWriter + stateTable []uint16 + state uint16 +} + +// init will initialize the compression state to the first symbol of the stream. +func (c *cState) init(bw *bitWriter, ct *cTable, first symbolTransform) { + c.bw = bw + c.stateTable = ct.stateTable + if len(c.stateTable) == 1 { + // RLE + c.stateTable[0] = uint16(0) + c.state = 0 + return + } + nbBitsOut := (first.deltaNbBits + (1 << 15)) >> 16 + im := int32((nbBitsOut << 16) - first.deltaNbBits) + lu := (im >> nbBitsOut) + int32(first.deltaFindState) + c.state = c.stateTable[lu] +} + +// flush will write the tablelog to the output and flush the remaining full bytes. +func (c *cState) flush(tableLog uint8) { + c.bw.flush32() + c.bw.addBits16NC(c.state, tableLog) +} diff --git a/vendor/github.com/klauspost/compress/zstd/fse_predefined.go b/vendor/github.com/klauspost/compress/zstd/fse_predefined.go new file mode 100644 index 0000000000..474cb77d2b --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/fse_predefined.go @@ -0,0 +1,158 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "fmt" + "math" + "sync" +) + +var ( + // fsePredef are the predefined fse tables as defined here: + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#default-distributions + // These values are already transformed. + fsePredef [3]fseDecoder + + // fsePredefEnc are the predefined encoder based on fse tables as defined here: + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#default-distributions + // These values are already transformed. + fsePredefEnc [3]fseEncoder + + // symbolTableX contain the transformations needed for each type as defined in + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#the-codes-for-literals-lengths-match-lengths-and-offsets + symbolTableX [3][]baseOffset + + // maxTableSymbol is the biggest supported symbol for each table type + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#the-codes-for-literals-lengths-match-lengths-and-offsets + maxTableSymbol = [3]uint8{tableLiteralLengths: maxLiteralLengthSymbol, tableOffsets: maxOffsetLengthSymbol, tableMatchLengths: maxMatchLengthSymbol} + + // bitTables is the bits table for each table. + bitTables = [3][]byte{tableLiteralLengths: llBitsTable[:], tableOffsets: nil, tableMatchLengths: mlBitsTable[:]} +) + +type tableIndex uint8 + +const ( + // indexes for fsePredef and symbolTableX + tableLiteralLengths tableIndex = 0 + tableOffsets tableIndex = 1 + tableMatchLengths tableIndex = 2 + + maxLiteralLengthSymbol = 35 + maxOffsetLengthSymbol = 30 + maxMatchLengthSymbol = 52 +) + +// baseOffset is used for calculating transformations. +type baseOffset struct { + baseLine uint32 + addBits uint8 +} + +// fillBase will precalculate base offsets with the given bit distributions. +func fillBase(dst []baseOffset, base uint32, bits ...uint8) { + if len(bits) != len(dst) { + panic(fmt.Sprintf("len(dst) (%d) != len(bits) (%d)", len(dst), len(bits))) + } + for i, bit := range bits { + if base > math.MaxInt32 { + panic("invalid decoding table, base overflows int32") + } + + dst[i] = baseOffset{ + baseLine: base, + addBits: bit, + } + base += 1 << bit + } +} + +var predef sync.Once + +func initPredefined() { + predef.Do(func() { + // Literals length codes + tmp := make([]baseOffset, 36) + for i := range tmp[:16] { + tmp[i] = baseOffset{ + baseLine: uint32(i), + addBits: 0, + } + } + fillBase(tmp[16:], 16, 1, 1, 1, 1, 2, 2, 3, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + symbolTableX[tableLiteralLengths] = tmp + + // Match length codes + tmp = make([]baseOffset, 53) + for i := range tmp[:32] { + tmp[i] = baseOffset{ + // The transformation adds the 3 length. + baseLine: uint32(i) + 3, + addBits: 0, + } + } + fillBase(tmp[32:], 35, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + symbolTableX[tableMatchLengths] = tmp + + // Offset codes + tmp = make([]baseOffset, maxOffsetBits+1) + tmp[1] = baseOffset{ + baseLine: 1, + addBits: 1, + } + fillBase(tmp[2:], 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) + symbolTableX[tableOffsets] = tmp + + // Fill predefined tables and transform them. + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#default-distributions + for i := range fsePredef[:] { + f := &fsePredef[i] + switch tableIndex(i) { + case tableLiteralLengths: + // https://github.com/facebook/zstd/blob/ededcfca57366461021c922720878c81a5854a0a/lib/decompress/zstd_decompress_block.c#L243 + f.actualTableLog = 6 + copy(f.norm[:], []int16{4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 1, 1, 1, 1, 1, + -1, -1, -1, -1}) + f.symbolLen = 36 + case tableOffsets: + // https://github.com/facebook/zstd/blob/ededcfca57366461021c922720878c81a5854a0a/lib/decompress/zstd_decompress_block.c#L281 + f.actualTableLog = 5 + copy(f.norm[:], []int16{ + 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1}) + f.symbolLen = 29 + case tableMatchLengths: + //https://github.com/facebook/zstd/blob/ededcfca57366461021c922720878c81a5854a0a/lib/decompress/zstd_decompress_block.c#L304 + f.actualTableLog = 6 + copy(f.norm[:], []int16{ + 1, 4, 3, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, + -1, -1, -1, -1, -1}) + f.symbolLen = 53 + } + if err := f.buildDtable(); err != nil { + panic(fmt.Errorf("building table %v: %v", tableIndex(i), err)) + } + if err := f.transform(symbolTableX[i]); err != nil { + panic(fmt.Errorf("building table %v: %v", tableIndex(i), err)) + } + f.preDefined = true + + // Create encoder as well + enc := &fsePredefEnc[i] + copy(enc.norm[:], f.norm[:]) + enc.symbolLen = f.symbolLen + enc.actualTableLog = f.actualTableLog + if err := enc.buildCTable(); err != nil { + panic(fmt.Errorf("building encoding table %v: %v", tableIndex(i), err)) + } + enc.setBits(bitTables[i]) + enc.preDefined = true + } + }) +} diff --git a/vendor/github.com/klauspost/compress/zstd/hash.go b/vendor/github.com/klauspost/compress/zstd/hash.go new file mode 100644 index 0000000000..5d73c21ebd --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/hash.go @@ -0,0 +1,35 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +const ( + prime3bytes = 506832829 + prime4bytes = 2654435761 + prime5bytes = 889523592379 + prime6bytes = 227718039650203 + prime7bytes = 58295818150454627 + prime8bytes = 0xcf1bbcdcb7a56463 +) + +// hashLen returns a hash of the lowest mls bytes of with length output bits. +// mls must be >=3 and <=8. Any other value will return hash for 4 bytes. +// length should always be < 32. +// Preferably length and mls should be a constant for inlining. +func hashLen(u uint64, length, mls uint8) uint32 { + switch mls { + case 3: + return (uint32(u<<8) * prime3bytes) >> (32 - length) + case 5: + return uint32(((u << (64 - 40)) * prime5bytes) >> (64 - length)) + case 6: + return uint32(((u << (64 - 48)) * prime6bytes) >> (64 - length)) + case 7: + return uint32(((u << (64 - 56)) * prime7bytes) >> (64 - length)) + case 8: + return uint32((u * prime8bytes) >> (64 - length)) + default: + return (uint32(u) * prime4bytes) >> (32 - length) + } +} diff --git a/vendor/github.com/klauspost/compress/zstd/history.go b/vendor/github.com/klauspost/compress/zstd/history.go new file mode 100644 index 0000000000..09164856d2 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/history.go @@ -0,0 +1,116 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "github.com/klauspost/compress/huff0" +) + +// history contains the information transferred between blocks. +type history struct { + // Literal decompression + huffTree *huff0.Scratch + + // Sequence decompression + decoders sequenceDecs + recentOffsets [3]int + + // History buffer... + b []byte + + // ignoreBuffer is meant to ignore a number of bytes + // when checking for matches in history + ignoreBuffer int + + windowSize int + allocFrameBuffer int // needed? + error bool + dict *dict +} + +// reset will reset the history to initial state of a frame. +// The history must already have been initialized to the desired size. +func (h *history) reset() { + h.b = h.b[:0] + h.ignoreBuffer = 0 + h.error = false + h.recentOffsets = [3]int{1, 4, 8} + h.decoders.freeDecoders() + h.decoders = sequenceDecs{br: h.decoders.br} + h.freeHuffDecoder() + h.huffTree = nil + h.dict = nil + //printf("history created: %+v (l: %d, c: %d)", *h, len(h.b), cap(h.b)) +} + +func (h *history) freeHuffDecoder() { + if h.huffTree != nil { + if h.dict == nil || h.dict.litEnc != h.huffTree { + huffDecoderPool.Put(h.huffTree) + h.huffTree = nil + } + } +} + +func (h *history) setDict(dict *dict) { + if dict == nil { + return + } + h.dict = dict + h.decoders.litLengths = dict.llDec + h.decoders.offsets = dict.ofDec + h.decoders.matchLengths = dict.mlDec + h.decoders.dict = dict.content + h.recentOffsets = dict.offsets + h.huffTree = dict.litEnc +} + +// append bytes to history. +// This function will make sure there is space for it, +// if the buffer has been allocated with enough extra space. +func (h *history) append(b []byte) { + if len(b) >= h.windowSize { + // Discard all history by simply overwriting + h.b = h.b[:h.windowSize] + copy(h.b, b[len(b)-h.windowSize:]) + return + } + + // If there is space, append it. + if len(b) < cap(h.b)-len(h.b) { + h.b = append(h.b, b...) + return + } + + // Move data down so we only have window size left. + // We know we have less than window size in b at this point. + discard := len(b) + len(h.b) - h.windowSize + copy(h.b, h.b[discard:]) + h.b = h.b[:h.windowSize] + copy(h.b[h.windowSize-len(b):], b) +} + +// ensureBlock will ensure there is space for at least one block... +func (h *history) ensureBlock() { + if cap(h.b) < h.allocFrameBuffer { + h.b = make([]byte, 0, h.allocFrameBuffer) + return + } + + avail := cap(h.b) - len(h.b) + if avail >= h.windowSize || avail > maxCompressedBlockSize { + return + } + // Move data down so we only have window size left. + // We know we have less than window size in b at this point. + discard := len(h.b) - h.windowSize + copy(h.b, h.b[discard:]) + h.b = h.b[:h.windowSize] +} + +// append bytes to history without ever discarding anything. +func (h *history) appendKeep(b []byte) { + h.b = append(h.b, b...) +} diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt new file mode 100644 index 0000000000..24b53065f4 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright (c) 2016 Caleb Spare + +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. diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md new file mode 100644 index 0000000000..777290d44c --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md @@ -0,0 +1,71 @@ +# xxhash + +VENDORED: Go to [github.com/cespare/xxhash](https://github.com/cespare/xxhash) for original package. + +xxhash is a Go implementation of the 64-bit [xxHash] algorithm, XXH64. This is a +high-quality hashing algorithm that is much faster than anything in the Go +standard library. + +This package provides a straightforward API: + +``` +func Sum64(b []byte) uint64 +func Sum64String(s string) uint64 +type Digest struct{ ... } + func New() *Digest +``` + +The `Digest` type implements hash.Hash64. Its key methods are: + +``` +func (*Digest) Write([]byte) (int, error) +func (*Digest) WriteString(string) (int, error) +func (*Digest) Sum64() uint64 +``` + +The package is written with optimized pure Go and also contains even faster +assembly implementations for amd64 and arm64. If desired, the `purego` build tag +opts into using the Go code even on those architectures. + +[xxHash]: http://cyan4973.github.io/xxHash/ + +## Compatibility + +This package is in a module and the latest code is in version 2 of the module. +You need a version of Go with at least "minimal module compatibility" to use +github.com/cespare/xxhash/v2: + +* 1.9.7+ for Go 1.9 +* 1.10.3+ for Go 1.10 +* Go 1.11 or later + +I recommend using the latest release of Go. + +## Benchmarks + +Here are some quick benchmarks comparing the pure-Go and assembly +implementations of Sum64. + +| input size | purego | asm | +| ---------- | --------- | --------- | +| 4 B | 1.3 GB/s | 1.2 GB/s | +| 16 B | 2.9 GB/s | 3.5 GB/s | +| 100 B | 6.9 GB/s | 8.1 GB/s | +| 4 KB | 11.7 GB/s | 16.7 GB/s | +| 10 MB | 12.0 GB/s | 17.3 GB/s | + +These numbers were generated on Ubuntu 20.04 with an Intel Xeon Platinum 8252C +CPU using the following commands under Go 1.19.2: + +``` +benchstat <(go test -tags purego -benchtime 500ms -count 15 -bench 'Sum64$') +benchstat <(go test -benchtime 500ms -count 15 -bench 'Sum64$') +``` + +## Projects using this package + +- [InfluxDB](https://github.com/influxdata/influxdb) +- [Prometheus](https://github.com/prometheus/prometheus) +- [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics) +- [FreeCache](https://github.com/coocood/freecache) +- [FastCache](https://github.com/VictoriaMetrics/fastcache) diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go new file mode 100644 index 0000000000..fc40c82001 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go @@ -0,0 +1,230 @@ +// Package xxhash implements the 64-bit variant of xxHash (XXH64) as described +// at http://cyan4973.github.io/xxHash/. +// THIS IS VENDORED: Go to github.com/cespare/xxhash for original package. + +package xxhash + +import ( + "encoding/binary" + "errors" + "math/bits" +) + +const ( + prime1 uint64 = 11400714785074694791 + prime2 uint64 = 14029467366897019727 + prime3 uint64 = 1609587929392839161 + prime4 uint64 = 9650029242287828579 + prime5 uint64 = 2870177450012600261 +) + +// Store the primes in an array as well. +// +// The consts are used when possible in Go code to avoid MOVs but we need a +// contiguous array of the assembly code. +var primes = [...]uint64{prime1, prime2, prime3, prime4, prime5} + +// Digest implements hash.Hash64. +type Digest struct { + v1 uint64 + v2 uint64 + v3 uint64 + v4 uint64 + total uint64 + mem [32]byte + n int // how much of mem is used +} + +// New creates a new Digest that computes the 64-bit xxHash algorithm. +func New() *Digest { + var d Digest + d.Reset() + return &d +} + +// Reset clears the Digest's state so that it can be reused. +func (d *Digest) Reset() { + d.v1 = primes[0] + prime2 + d.v2 = prime2 + d.v3 = 0 + d.v4 = -primes[0] + d.total = 0 + d.n = 0 +} + +// Size always returns 8 bytes. +func (d *Digest) Size() int { return 8 } + +// BlockSize always returns 32 bytes. +func (d *Digest) BlockSize() int { return 32 } + +// Write adds more data to d. It always returns len(b), nil. +func (d *Digest) Write(b []byte) (n int, err error) { + n = len(b) + d.total += uint64(n) + + memleft := d.mem[d.n&(len(d.mem)-1):] + + if d.n+n < 32 { + // This new data doesn't even fill the current block. + copy(memleft, b) + d.n += n + return + } + + if d.n > 0 { + // Finish off the partial block. + c := copy(memleft, b) + d.v1 = round(d.v1, u64(d.mem[0:8])) + d.v2 = round(d.v2, u64(d.mem[8:16])) + d.v3 = round(d.v3, u64(d.mem[16:24])) + d.v4 = round(d.v4, u64(d.mem[24:32])) + b = b[c:] + d.n = 0 + } + + if len(b) >= 32 { + // One or more full blocks left. + nw := writeBlocks(d, b) + b = b[nw:] + } + + // Store any remaining partial block. + copy(d.mem[:], b) + d.n = len(b) + + return +} + +// Sum appends the current hash to b and returns the resulting slice. +func (d *Digest) Sum(b []byte) []byte { + s := d.Sum64() + return append( + b, + byte(s>>56), + byte(s>>48), + byte(s>>40), + byte(s>>32), + byte(s>>24), + byte(s>>16), + byte(s>>8), + byte(s), + ) +} + +// Sum64 returns the current hash. +func (d *Digest) Sum64() uint64 { + var h uint64 + + if d.total >= 32 { + v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4 + h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4) + h = mergeRound(h, v1) + h = mergeRound(h, v2) + h = mergeRound(h, v3) + h = mergeRound(h, v4) + } else { + h = d.v3 + prime5 + } + + h += d.total + + b := d.mem[:d.n&(len(d.mem)-1)] + for ; len(b) >= 8; b = b[8:] { + k1 := round(0, u64(b[:8])) + h ^= k1 + h = rol27(h)*prime1 + prime4 + } + if len(b) >= 4 { + h ^= uint64(u32(b[:4])) * prime1 + h = rol23(h)*prime2 + prime3 + b = b[4:] + } + for ; len(b) > 0; b = b[1:] { + h ^= uint64(b[0]) * prime5 + h = rol11(h) * prime1 + } + + h ^= h >> 33 + h *= prime2 + h ^= h >> 29 + h *= prime3 + h ^= h >> 32 + + return h +} + +const ( + magic = "xxh\x06" + marshaledSize = len(magic) + 8*5 + 32 +) + +// MarshalBinary implements the encoding.BinaryMarshaler interface. +func (d *Digest) MarshalBinary() ([]byte, error) { + b := make([]byte, 0, marshaledSize) + b = append(b, magic...) + b = appendUint64(b, d.v1) + b = appendUint64(b, d.v2) + b = appendUint64(b, d.v3) + b = appendUint64(b, d.v4) + b = appendUint64(b, d.total) + b = append(b, d.mem[:d.n]...) + b = b[:len(b)+len(d.mem)-d.n] + return b, nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. +func (d *Digest) UnmarshalBinary(b []byte) error { + if len(b) < len(magic) || string(b[:len(magic)]) != magic { + return errors.New("xxhash: invalid hash state identifier") + } + if len(b) != marshaledSize { + return errors.New("xxhash: invalid hash state size") + } + b = b[len(magic):] + b, d.v1 = consumeUint64(b) + b, d.v2 = consumeUint64(b) + b, d.v3 = consumeUint64(b) + b, d.v4 = consumeUint64(b) + b, d.total = consumeUint64(b) + copy(d.mem[:], b) + d.n = int(d.total % uint64(len(d.mem))) + return nil +} + +func appendUint64(b []byte, x uint64) []byte { + var a [8]byte + binary.LittleEndian.PutUint64(a[:], x) + return append(b, a[:]...) +} + +func consumeUint64(b []byte) ([]byte, uint64) { + x := u64(b) + return b[8:], x +} + +func u64(b []byte) uint64 { return binary.LittleEndian.Uint64(b) } +func u32(b []byte) uint32 { return binary.LittleEndian.Uint32(b) } + +func round(acc, input uint64) uint64 { + acc += input * prime2 + acc = rol31(acc) + acc *= prime1 + return acc +} + +func mergeRound(acc, val uint64) uint64 { + val = round(0, val) + acc ^= val + acc = acc*prime1 + prime4 + return acc +} + +func rol1(x uint64) uint64 { return bits.RotateLeft64(x, 1) } +func rol7(x uint64) uint64 { return bits.RotateLeft64(x, 7) } +func rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) } +func rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) } +func rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) } +func rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) } +func rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) } +func rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) } diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s new file mode 100644 index 0000000000..ddb63aa91b --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s @@ -0,0 +1,210 @@ +//go:build !appengine && gc && !purego && !noasm +// +build !appengine +// +build gc +// +build !purego +// +build !noasm + +#include "textflag.h" + +// Registers: +#define h AX +#define d AX +#define p SI // pointer to advance through b +#define n DX +#define end BX // loop end +#define v1 R8 +#define v2 R9 +#define v3 R10 +#define v4 R11 +#define x R12 +#define prime1 R13 +#define prime2 R14 +#define prime4 DI + +#define round(acc, x) \ + IMULQ prime2, x \ + ADDQ x, acc \ + ROLQ $31, acc \ + IMULQ prime1, acc + +// round0 performs the operation x = round(0, x). +#define round0(x) \ + IMULQ prime2, x \ + ROLQ $31, x \ + IMULQ prime1, x + +// mergeRound applies a merge round on the two registers acc and x. +// It assumes that prime1, prime2, and prime4 have been loaded. +#define mergeRound(acc, x) \ + round0(x) \ + XORQ x, acc \ + IMULQ prime1, acc \ + ADDQ prime4, acc + +// blockLoop processes as many 32-byte blocks as possible, +// updating v1, v2, v3, and v4. It assumes that there is at least one block +// to process. +#define blockLoop() \ +loop: \ + MOVQ +0(p), x \ + round(v1, x) \ + MOVQ +8(p), x \ + round(v2, x) \ + MOVQ +16(p), x \ + round(v3, x) \ + MOVQ +24(p), x \ + round(v4, x) \ + ADDQ $32, p \ + CMPQ p, end \ + JLE loop + +// func Sum64(b []byte) uint64 +TEXT ·Sum64(SB), NOSPLIT|NOFRAME, $0-32 + // Load fixed primes. + MOVQ ·primes+0(SB), prime1 + MOVQ ·primes+8(SB), prime2 + MOVQ ·primes+24(SB), prime4 + + // Load slice. + MOVQ b_base+0(FP), p + MOVQ b_len+8(FP), n + LEAQ (p)(n*1), end + + // The first loop limit will be len(b)-32. + SUBQ $32, end + + // Check whether we have at least one block. + CMPQ n, $32 + JLT noBlocks + + // Set up initial state (v1, v2, v3, v4). + MOVQ prime1, v1 + ADDQ prime2, v1 + MOVQ prime2, v2 + XORQ v3, v3 + XORQ v4, v4 + SUBQ prime1, v4 + + blockLoop() + + MOVQ v1, h + ROLQ $1, h + MOVQ v2, x + ROLQ $7, x + ADDQ x, h + MOVQ v3, x + ROLQ $12, x + ADDQ x, h + MOVQ v4, x + ROLQ $18, x + ADDQ x, h + + mergeRound(h, v1) + mergeRound(h, v2) + mergeRound(h, v3) + mergeRound(h, v4) + + JMP afterBlocks + +noBlocks: + MOVQ ·primes+32(SB), h + +afterBlocks: + ADDQ n, h + + ADDQ $24, end + CMPQ p, end + JG try4 + +loop8: + MOVQ (p), x + ADDQ $8, p + round0(x) + XORQ x, h + ROLQ $27, h + IMULQ prime1, h + ADDQ prime4, h + + CMPQ p, end + JLE loop8 + +try4: + ADDQ $4, end + CMPQ p, end + JG try1 + + MOVL (p), x + ADDQ $4, p + IMULQ prime1, x + XORQ x, h + + ROLQ $23, h + IMULQ prime2, h + ADDQ ·primes+16(SB), h + +try1: + ADDQ $4, end + CMPQ p, end + JGE finalize + +loop1: + MOVBQZX (p), x + ADDQ $1, p + IMULQ ·primes+32(SB), x + XORQ x, h + ROLQ $11, h + IMULQ prime1, h + + CMPQ p, end + JL loop1 + +finalize: + MOVQ h, x + SHRQ $33, x + XORQ x, h + IMULQ prime2, h + MOVQ h, x + SHRQ $29, x + XORQ x, h + IMULQ ·primes+16(SB), h + MOVQ h, x + SHRQ $32, x + XORQ x, h + + MOVQ h, ret+24(FP) + RET + +// func writeBlocks(d *Digest, b []byte) int +TEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40 + // Load fixed primes needed for round. + MOVQ ·primes+0(SB), prime1 + MOVQ ·primes+8(SB), prime2 + + // Load slice. + MOVQ b_base+8(FP), p + MOVQ b_len+16(FP), n + LEAQ (p)(n*1), end + SUBQ $32, end + + // Load vN from d. + MOVQ s+0(FP), d + MOVQ 0(d), v1 + MOVQ 8(d), v2 + MOVQ 16(d), v3 + MOVQ 24(d), v4 + + // We don't need to check the loop condition here; this function is + // always called with at least one block of data to process. + blockLoop() + + // Copy vN back to d. + MOVQ v1, 0(d) + MOVQ v2, 8(d) + MOVQ v3, 16(d) + MOVQ v4, 24(d) + + // The number of bytes written is p minus the old base pointer. + SUBQ b_base+8(FP), p + MOVQ p, ret+32(FP) + + RET diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_arm64.s b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_arm64.s new file mode 100644 index 0000000000..ae7d4d3295 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_arm64.s @@ -0,0 +1,184 @@ +//go:build !appengine && gc && !purego && !noasm +// +build !appengine +// +build gc +// +build !purego +// +build !noasm + +#include "textflag.h" + +// Registers: +#define digest R1 +#define h R2 // return value +#define p R3 // input pointer +#define n R4 // input length +#define nblocks R5 // n / 32 +#define prime1 R7 +#define prime2 R8 +#define prime3 R9 +#define prime4 R10 +#define prime5 R11 +#define v1 R12 +#define v2 R13 +#define v3 R14 +#define v4 R15 +#define x1 R20 +#define x2 R21 +#define x3 R22 +#define x4 R23 + +#define round(acc, x) \ + MADD prime2, acc, x, acc \ + ROR $64-31, acc \ + MUL prime1, acc + +// round0 performs the operation x = round(0, x). +#define round0(x) \ + MUL prime2, x \ + ROR $64-31, x \ + MUL prime1, x + +#define mergeRound(acc, x) \ + round0(x) \ + EOR x, acc \ + MADD acc, prime4, prime1, acc + +// blockLoop processes as many 32-byte blocks as possible, +// updating v1, v2, v3, and v4. It assumes that n >= 32. +#define blockLoop() \ + LSR $5, n, nblocks \ + PCALIGN $16 \ + loop: \ + LDP.P 16(p), (x1, x2) \ + LDP.P 16(p), (x3, x4) \ + round(v1, x1) \ + round(v2, x2) \ + round(v3, x3) \ + round(v4, x4) \ + SUB $1, nblocks \ + CBNZ nblocks, loop + +// func Sum64(b []byte) uint64 +TEXT ·Sum64(SB), NOSPLIT|NOFRAME, $0-32 + LDP b_base+0(FP), (p, n) + + LDP ·primes+0(SB), (prime1, prime2) + LDP ·primes+16(SB), (prime3, prime4) + MOVD ·primes+32(SB), prime5 + + CMP $32, n + CSEL LT, prime5, ZR, h // if n < 32 { h = prime5 } else { h = 0 } + BLT afterLoop + + ADD prime1, prime2, v1 + MOVD prime2, v2 + MOVD $0, v3 + NEG prime1, v4 + + blockLoop() + + ROR $64-1, v1, x1 + ROR $64-7, v2, x2 + ADD x1, x2 + ROR $64-12, v3, x3 + ROR $64-18, v4, x4 + ADD x3, x4 + ADD x2, x4, h + + mergeRound(h, v1) + mergeRound(h, v2) + mergeRound(h, v3) + mergeRound(h, v4) + +afterLoop: + ADD n, h + + TBZ $4, n, try8 + LDP.P 16(p), (x1, x2) + + round0(x1) + + // NOTE: here and below, sequencing the EOR after the ROR (using a + // rotated register) is worth a small but measurable speedup for small + // inputs. + ROR $64-27, h + EOR x1 @> 64-27, h, h + MADD h, prime4, prime1, h + + round0(x2) + ROR $64-27, h + EOR x2 @> 64-27, h, h + MADD h, prime4, prime1, h + +try8: + TBZ $3, n, try4 + MOVD.P 8(p), x1 + + round0(x1) + ROR $64-27, h + EOR x1 @> 64-27, h, h + MADD h, prime4, prime1, h + +try4: + TBZ $2, n, try2 + MOVWU.P 4(p), x2 + + MUL prime1, x2 + ROR $64-23, h + EOR x2 @> 64-23, h, h + MADD h, prime3, prime2, h + +try2: + TBZ $1, n, try1 + MOVHU.P 2(p), x3 + AND $255, x3, x1 + LSR $8, x3, x2 + + MUL prime5, x1 + ROR $64-11, h + EOR x1 @> 64-11, h, h + MUL prime1, h + + MUL prime5, x2 + ROR $64-11, h + EOR x2 @> 64-11, h, h + MUL prime1, h + +try1: + TBZ $0, n, finalize + MOVBU (p), x4 + + MUL prime5, x4 + ROR $64-11, h + EOR x4 @> 64-11, h, h + MUL prime1, h + +finalize: + EOR h >> 33, h + MUL prime2, h + EOR h >> 29, h + MUL prime3, h + EOR h >> 32, h + + MOVD h, ret+24(FP) + RET + +// func writeBlocks(s *Digest, b []byte) int +TEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40 + LDP ·primes+0(SB), (prime1, prime2) + + // Load state. Assume v[1-4] are stored contiguously. + MOVD s+0(FP), digest + LDP 0(digest), (v1, v2) + LDP 16(digest), (v3, v4) + + LDP b_base+8(FP), (p, n) + + blockLoop() + + // Store updated state. + STP (v1, v2), 0(digest) + STP (v3, v4), 16(digest) + + BIC $31, n + MOVD n, ret+32(FP) + RET diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go new file mode 100644 index 0000000000..d4221edf4f --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go @@ -0,0 +1,16 @@ +//go:build (amd64 || arm64) && !appengine && gc && !purego && !noasm +// +build amd64 arm64 +// +build !appengine +// +build gc +// +build !purego +// +build !noasm + +package xxhash + +// Sum64 computes the 64-bit xxHash digest of b. +// +//go:noescape +func Sum64(b []byte) uint64 + +//go:noescape +func writeBlocks(s *Digest, b []byte) int diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go new file mode 100644 index 0000000000..0be16cefc7 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go @@ -0,0 +1,76 @@ +//go:build (!amd64 && !arm64) || appengine || !gc || purego || noasm +// +build !amd64,!arm64 appengine !gc purego noasm + +package xxhash + +// Sum64 computes the 64-bit xxHash digest of b. +func Sum64(b []byte) uint64 { + // A simpler version would be + // d := New() + // d.Write(b) + // return d.Sum64() + // but this is faster, particularly for small inputs. + + n := len(b) + var h uint64 + + if n >= 32 { + v1 := primes[0] + prime2 + v2 := prime2 + v3 := uint64(0) + v4 := -primes[0] + for len(b) >= 32 { + v1 = round(v1, u64(b[0:8:len(b)])) + v2 = round(v2, u64(b[8:16:len(b)])) + v3 = round(v3, u64(b[16:24:len(b)])) + v4 = round(v4, u64(b[24:32:len(b)])) + b = b[32:len(b):len(b)] + } + h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4) + h = mergeRound(h, v1) + h = mergeRound(h, v2) + h = mergeRound(h, v3) + h = mergeRound(h, v4) + } else { + h = prime5 + } + + h += uint64(n) + + for ; len(b) >= 8; b = b[8:] { + k1 := round(0, u64(b[:8])) + h ^= k1 + h = rol27(h)*prime1 + prime4 + } + if len(b) >= 4 { + h ^= uint64(u32(b[:4])) * prime1 + h = rol23(h)*prime2 + prime3 + b = b[4:] + } + for ; len(b) > 0; b = b[1:] { + h ^= uint64(b[0]) * prime5 + h = rol11(h) * prime1 + } + + h ^= h >> 33 + h *= prime2 + h ^= h >> 29 + h *= prime3 + h ^= h >> 32 + + return h +} + +func writeBlocks(d *Digest, b []byte) int { + v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4 + n := len(b) + for len(b) >= 32 { + v1 = round(v1, u64(b[0:8:len(b)])) + v2 = round(v2, u64(b[8:16:len(b)])) + v3 = round(v3, u64(b[16:24:len(b)])) + v4 = round(v4, u64(b[24:32:len(b)])) + b = b[32:len(b):len(b)] + } + d.v1, d.v2, d.v3, d.v4 = v1, v2, v3, v4 + return n - len(b) +} diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go new file mode 100644 index 0000000000..6f3b0cb102 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go @@ -0,0 +1,11 @@ +package xxhash + +// Sum64String computes the 64-bit xxHash digest of s. +func Sum64String(s string) uint64 { + return Sum64([]byte(s)) +} + +// WriteString adds more data to d. It always returns len(s), nil. +func (d *Digest) WriteString(s string) (n int, err error) { + return d.Write([]byte(s)) +} diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go new file mode 100644 index 0000000000..f41932b7a4 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go @@ -0,0 +1,16 @@ +//go:build amd64 && !appengine && !noasm && gc +// +build amd64,!appengine,!noasm,gc + +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. + +package zstd + +// matchLen returns how many bytes match in a and b +// +// It assumes that: +// +// len(a) <= len(b) and len(a) > 0 +// +//go:noescape +func matchLen(a []byte, b []byte) int diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s new file mode 100644 index 0000000000..0782b86e3d --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s @@ -0,0 +1,66 @@ +// Copied from S2 implementation. + +//go:build !appengine && !noasm && gc && !noasm + +#include "textflag.h" + +// func matchLen(a []byte, b []byte) int +TEXT ·matchLen(SB), NOSPLIT, $0-56 + MOVQ a_base+0(FP), AX + MOVQ b_base+24(FP), CX + MOVQ a_len+8(FP), DX + + // matchLen + XORL SI, SI + CMPL DX, $0x08 + JB matchlen_match4_standalone + +matchlen_loopback_standalone: + MOVQ (AX)(SI*1), BX + XORQ (CX)(SI*1), BX + JZ matchlen_loop_standalone + +#ifdef GOAMD64_v3 + TZCNTQ BX, BX +#else + BSFQ BX, BX +#endif + SHRL $0x03, BX + LEAL (SI)(BX*1), SI + JMP gen_match_len_end + +matchlen_loop_standalone: + LEAL -8(DX), DX + LEAL 8(SI), SI + CMPL DX, $0x08 + JAE matchlen_loopback_standalone + +matchlen_match4_standalone: + CMPL DX, $0x04 + JB matchlen_match2_standalone + MOVL (AX)(SI*1), BX + CMPL (CX)(SI*1), BX + JNE matchlen_match2_standalone + LEAL -4(DX), DX + LEAL 4(SI), SI + +matchlen_match2_standalone: + CMPL DX, $0x02 + JB matchlen_match1_standalone + MOVW (AX)(SI*1), BX + CMPW (CX)(SI*1), BX + JNE matchlen_match1_standalone + LEAL -2(DX), DX + LEAL 2(SI), SI + +matchlen_match1_standalone: + CMPL DX, $0x01 + JB gen_match_len_end + MOVB (AX)(SI*1), BL + CMPB (CX)(SI*1), BL + JNE gen_match_len_end + INCL SI + +gen_match_len_end: + MOVQ SI, ret+48(FP) + RET diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go new file mode 100644 index 0000000000..57b9c31c02 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go @@ -0,0 +1,33 @@ +//go:build !amd64 || appengine || !gc || noasm +// +build !amd64 appengine !gc noasm + +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. + +package zstd + +import ( + "encoding/binary" + "math/bits" +) + +// matchLen returns the maximum common prefix length of a and b. +// a must be the shortest of the two. +func matchLen(a, b []byte) (n int) { + for ; len(a) >= 8 && len(b) >= 8; a, b = a[8:], b[8:] { + diff := binary.LittleEndian.Uint64(a) ^ binary.LittleEndian.Uint64(b) + if diff != 0 { + return n + bits.TrailingZeros64(diff)>>3 + } + n += 8 + } + + for i := range a { + if a[i] != b[i] { + break + } + n++ + } + return n + +} diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec.go b/vendor/github.com/klauspost/compress/zstd/seqdec.go new file mode 100644 index 0000000000..d7fe6d82d9 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/seqdec.go @@ -0,0 +1,503 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "errors" + "fmt" + "io" +) + +type seq struct { + litLen uint32 + matchLen uint32 + offset uint32 + + // Codes are stored here for the encoder + // so they only have to be looked up once. + llCode, mlCode, ofCode uint8 +} + +type seqVals struct { + ll, ml, mo int +} + +func (s seq) String() string { + if s.offset <= 3 { + if s.offset == 0 { + return fmt.Sprint("litLen:", s.litLen, ", matchLen:", s.matchLen+zstdMinMatch, ", offset: INVALID (0)") + } + return fmt.Sprint("litLen:", s.litLen, ", matchLen:", s.matchLen+zstdMinMatch, ", offset:", s.offset, " (repeat)") + } + return fmt.Sprint("litLen:", s.litLen, ", matchLen:", s.matchLen+zstdMinMatch, ", offset:", s.offset-3, " (new)") +} + +type seqCompMode uint8 + +const ( + compModePredefined seqCompMode = iota + compModeRLE + compModeFSE + compModeRepeat +) + +type sequenceDec struct { + // decoder keeps track of the current state and updates it from the bitstream. + fse *fseDecoder + state fseState + repeat bool +} + +// init the state of the decoder with input from stream. +func (s *sequenceDec) init(br *bitReader) error { + if s.fse == nil { + return errors.New("sequence decoder not defined") + } + s.state.init(br, s.fse.actualTableLog, s.fse.dt[:1< cap(s.out) { + addBytes := s.seqSize + len(s.out) + s.out = append(s.out, make([]byte, addBytes)...) + s.out = s.out[:len(s.out)-addBytes] + } + + if debugDecoder { + printf("Execute %d seqs with hist %d, dict %d, literals: %d into %d bytes\n", len(seqs), len(hist), len(s.dict), len(s.literals), s.seqSize) + } + + var t = len(s.out) + out := s.out[:t+s.seqSize] + + for _, seq := range seqs { + // Add literals + copy(out[t:], s.literals[:seq.ll]) + t += seq.ll + s.literals = s.literals[seq.ll:] + + // Copy from dictionary... + if seq.mo > t+len(hist) || seq.mo > s.windowSize { + if len(s.dict) == 0 { + return fmt.Errorf("match offset (%d) bigger than current history (%d)", seq.mo, t+len(hist)) + } + + // we may be in dictionary. + dictO := len(s.dict) - (seq.mo - (t + len(hist))) + if dictO < 0 || dictO >= len(s.dict) { + return fmt.Errorf("match offset (%d) bigger than current history+dict (%d)", seq.mo, t+len(hist)+len(s.dict)) + } + end := dictO + seq.ml + if end > len(s.dict) { + n := len(s.dict) - dictO + copy(out[t:], s.dict[dictO:]) + t += n + seq.ml -= n + } else { + copy(out[t:], s.dict[dictO:end]) + t += end - dictO + continue + } + } + + // Copy from history. + if v := seq.mo - t; v > 0 { + // v is the start position in history from end. + start := len(hist) - v + if seq.ml > v { + // Some goes into current block. + // Copy remainder of history + copy(out[t:], hist[start:]) + t += v + seq.ml -= v + } else { + copy(out[t:], hist[start:start+seq.ml]) + t += seq.ml + continue + } + } + // We must be in current buffer now + if seq.ml > 0 { + start := t - seq.mo + if seq.ml <= t-start { + // No overlap + copy(out[t:], out[start:start+seq.ml]) + t += seq.ml + continue + } else { + // Overlapping copy + // Extend destination slice and copy one byte at the time. + src := out[start : start+seq.ml] + dst := out[t:] + dst = dst[:len(src)] + t += len(src) + // Destination is the space we just added. + for i := range src { + dst[i] = src[i] + } + } + } + } + + // Add final literals + copy(out[t:], s.literals) + if debugDecoder { + t += len(s.literals) + if t != len(out) { + panic(fmt.Errorf("length mismatch, want %d, got %d, ss: %d", len(out), t, s.seqSize)) + } + } + s.out = out + + return nil +} + +// decode sequences from the stream with the provided history. +func (s *sequenceDecs) decodeSync(hist []byte) error { + supported, err := s.decodeSyncSimple(hist) + if supported { + return err + } + + br := s.br + seqs := s.nSeqs + startSize := len(s.out) + // Grab full sizes tables, to avoid bounds checks. + llTable, mlTable, ofTable := s.litLengths.fse.dt[:maxTablesize], s.matchLengths.fse.dt[:maxTablesize], s.offsets.fse.dt[:maxTablesize] + llState, mlState, ofState := s.litLengths.state.state, s.matchLengths.state.state, s.offsets.state.state + out := s.out + maxBlockSize := maxCompressedBlockSize + if s.windowSize < maxBlockSize { + maxBlockSize = s.windowSize + } + + if debugDecoder { + println("decodeSync: decoding", seqs, "sequences", br.remain(), "bits remain on stream") + } + for i := seqs - 1; i >= 0; i-- { + if br.overread() { + printf("reading sequence %d, exceeded available data. Overread by %d\n", seqs-i, -br.remain()) + return io.ErrUnexpectedEOF + } + var ll, mo, ml int + if len(br.in) > 4+((maxOffsetBits+16+16)>>3) { + // inlined function: + // ll, mo, ml = s.nextFast(br, llState, mlState, ofState) + + // Final will not read from stream. + var llB, mlB, moB uint8 + ll, llB = llState.final() + ml, mlB = mlState.final() + mo, moB = ofState.final() + + // extra bits are stored in reverse order. + br.fillFast() + mo += br.getBits(moB) + if s.maxBits > 32 { + br.fillFast() + } + ml += br.getBits(mlB) + ll += br.getBits(llB) + + if moB > 1 { + s.prevOffset[2] = s.prevOffset[1] + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = mo + } else { + // mo = s.adjustOffset(mo, ll, moB) + // Inlined for rather big speedup + if ll == 0 { + // There is an exception though, when current sequence's literals_length = 0. + // In this case, repeated offsets are shifted by one, so an offset_value of 1 means Repeated_Offset2, + // an offset_value of 2 means Repeated_Offset3, and an offset_value of 3 means Repeated_Offset1 - 1_byte. + mo++ + } + + if mo == 0 { + mo = s.prevOffset[0] + } else { + var temp int + if mo == 3 { + temp = s.prevOffset[0] - 1 + } else { + temp = s.prevOffset[mo] + } + + if temp == 0 { + // 0 is not valid; input is corrupted; force offset to 1 + println("WARNING: temp was 0") + temp = 1 + } + + if mo != 1 { + s.prevOffset[2] = s.prevOffset[1] + } + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = temp + mo = temp + } + } + br.fillFast() + } else { + ll, mo, ml = s.next(br, llState, mlState, ofState) + br.fill() + } + + if debugSequences { + println("Seq", seqs-i-1, "Litlen:", ll, "mo:", mo, "(abs) ml:", ml) + } + + if ll > len(s.literals) { + return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ll, len(s.literals)) + } + size := ll + ml + len(out) + if size-startSize > maxBlockSize { + return fmt.Errorf("output bigger than max block size (%d)", maxBlockSize) + } + if size > cap(out) { + // Not enough size, which can happen under high volume block streaming conditions + // but could be if destination slice is too small for sync operations. + // over-allocating here can create a large amount of GC pressure so we try to keep + // it as contained as possible + used := len(out) - startSize + addBytes := 256 + ll + ml + used>>2 + // Clamp to max block size. + if used+addBytes > maxBlockSize { + addBytes = maxBlockSize - used + } + out = append(out, make([]byte, addBytes)...) + out = out[:len(out)-addBytes] + } + if ml > maxMatchLen { + return fmt.Errorf("match len (%d) bigger than max allowed length", ml) + } + + // Add literals + out = append(out, s.literals[:ll]...) + s.literals = s.literals[ll:] + + if mo == 0 && ml > 0 { + return fmt.Errorf("zero matchoff and matchlen (%d) > 0", ml) + } + + if mo > len(out)+len(hist) || mo > s.windowSize { + if len(s.dict) == 0 { + return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(out)+len(hist)-startSize) + } + + // we may be in dictionary. + dictO := len(s.dict) - (mo - (len(out) + len(hist))) + if dictO < 0 || dictO >= len(s.dict) { + return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(out)+len(hist)-startSize) + } + end := dictO + ml + if end > len(s.dict) { + out = append(out, s.dict[dictO:]...) + ml -= len(s.dict) - dictO + } else { + out = append(out, s.dict[dictO:end]...) + mo = 0 + ml = 0 + } + } + + // Copy from history. + // TODO: Blocks without history could be made to ignore this completely. + if v := mo - len(out); v > 0 { + // v is the start position in history from end. + start := len(hist) - v + if ml > v { + // Some goes into current block. + // Copy remainder of history + out = append(out, hist[start:]...) + ml -= v + } else { + out = append(out, hist[start:start+ml]...) + ml = 0 + } + } + // We must be in current buffer now + if ml > 0 { + start := len(out) - mo + if ml <= len(out)-start { + // No overlap + out = append(out, out[start:start+ml]...) + } else { + // Overlapping copy + // Extend destination slice and copy one byte at the time. + out = out[:len(out)+ml] + src := out[start : start+ml] + // Destination is the space we just added. + dst := out[len(out)-ml:] + dst = dst[:len(src)] + for i := range src { + dst[i] = src[i] + } + } + } + if i == 0 { + // This is the last sequence, so we shouldn't update state. + break + } + + // Manually inlined, ~ 5-20% faster + // Update all 3 states at once. Approx 20% faster. + nBits := llState.nbBits() + mlState.nbBits() + ofState.nbBits() + if nBits == 0 { + llState = llTable[llState.newState()&maxTableMask] + mlState = mlTable[mlState.newState()&maxTableMask] + ofState = ofTable[ofState.newState()&maxTableMask] + } else { + bits := br.get32BitsFast(nBits) + + lowBits := uint16(bits >> ((ofState.nbBits() + mlState.nbBits()) & 31)) + llState = llTable[(llState.newState()+lowBits)&maxTableMask] + + lowBits = uint16(bits >> (ofState.nbBits() & 31)) + lowBits &= bitMask[mlState.nbBits()&15] + mlState = mlTable[(mlState.newState()+lowBits)&maxTableMask] + + lowBits = uint16(bits) & bitMask[ofState.nbBits()&15] + ofState = ofTable[(ofState.newState()+lowBits)&maxTableMask] + } + } + + if size := len(s.literals) + len(out) - startSize; size > maxBlockSize { + return fmt.Errorf("output bigger than max block size (%d)", maxBlockSize) + } + + // Add final literals + s.out = append(out, s.literals...) + return br.close() +} + +var bitMask [16]uint16 + +func init() { + for i := range bitMask[:] { + bitMask[i] = uint16((1 << uint(i)) - 1) + } +} + +func (s *sequenceDecs) next(br *bitReader, llState, mlState, ofState decSymbol) (ll, mo, ml int) { + // Final will not read from stream. + ll, llB := llState.final() + ml, mlB := mlState.final() + mo, moB := ofState.final() + + // extra bits are stored in reverse order. + br.fill() + mo += br.getBits(moB) + if s.maxBits > 32 { + br.fill() + } + // matchlength+literal length, max 32 bits + ml += br.getBits(mlB) + ll += br.getBits(llB) + mo = s.adjustOffset(mo, ll, moB) + return +} + +func (s *sequenceDecs) adjustOffset(offset, litLen int, offsetB uint8) int { + if offsetB > 1 { + s.prevOffset[2] = s.prevOffset[1] + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = offset + return offset + } + + if litLen == 0 { + // There is an exception though, when current sequence's literals_length = 0. + // In this case, repeated offsets are shifted by one, so an offset_value of 1 means Repeated_Offset2, + // an offset_value of 2 means Repeated_Offset3, and an offset_value of 3 means Repeated_Offset1 - 1_byte. + offset++ + } + + if offset == 0 { + return s.prevOffset[0] + } + var temp int + if offset == 3 { + temp = s.prevOffset[0] - 1 + } else { + temp = s.prevOffset[offset] + } + + if temp == 0 { + // 0 is not valid; input is corrupted; force offset to 1 + println("temp was 0") + temp = 1 + } + + if offset != 1 { + s.prevOffset[2] = s.prevOffset[1] + } + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = temp + return temp +} diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go new file mode 100644 index 0000000000..8adabd8287 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go @@ -0,0 +1,394 @@ +//go:build amd64 && !appengine && !noasm && gc +// +build amd64,!appengine,!noasm,gc + +package zstd + +import ( + "fmt" + "io" + + "github.com/klauspost/compress/internal/cpuinfo" +) + +type decodeSyncAsmContext struct { + llTable []decSymbol + mlTable []decSymbol + ofTable []decSymbol + llState uint64 + mlState uint64 + ofState uint64 + iteration int + litRemain int + out []byte + outPosition int + literals []byte + litPosition int + history []byte + windowSize int + ll int // set on error (not for all errors, please refer to _generate/gen.go) + ml int // set on error (not for all errors, please refer to _generate/gen.go) + mo int // set on error (not for all errors, please refer to _generate/gen.go) +} + +// sequenceDecs_decodeSync_amd64 implements the main loop of sequenceDecs.decodeSync in x86 asm. +// +// Please refer to seqdec_generic.go for the reference implementation. +// +//go:noescape +func sequenceDecs_decodeSync_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int + +// sequenceDecs_decodeSync_bmi2 implements the main loop of sequenceDecs.decodeSync in x86 asm with BMI2 extensions. +// +//go:noescape +func sequenceDecs_decodeSync_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int + +// sequenceDecs_decodeSync_safe_amd64 does the same as above, but does not write more than output buffer. +// +//go:noescape +func sequenceDecs_decodeSync_safe_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int + +// sequenceDecs_decodeSync_safe_bmi2 does the same as above, but does not write more than output buffer. +// +//go:noescape +func sequenceDecs_decodeSync_safe_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int + +// decode sequences from the stream with the provided history but without a dictionary. +func (s *sequenceDecs) decodeSyncSimple(hist []byte) (bool, error) { + if len(s.dict) > 0 { + return false, nil + } + if s.maxSyncLen == 0 && cap(s.out)-len(s.out) < maxCompressedBlockSize { + return false, nil + } + + // FIXME: Using unsafe memory copies leads to rare, random crashes + // with fuzz testing. It is therefore disabled for now. + const useSafe = true + /* + useSafe := false + if s.maxSyncLen == 0 && cap(s.out)-len(s.out) < maxCompressedBlockSizeAlloc { + useSafe = true + } + if s.maxSyncLen > 0 && cap(s.out)-len(s.out)-compressedBlockOverAlloc < int(s.maxSyncLen) { + useSafe = true + } + if cap(s.literals) < len(s.literals)+compressedBlockOverAlloc { + useSafe = true + } + */ + + br := s.br + + maxBlockSize := maxCompressedBlockSize + if s.windowSize < maxBlockSize { + maxBlockSize = s.windowSize + } + + ctx := decodeSyncAsmContext{ + llTable: s.litLengths.fse.dt[:maxTablesize], + mlTable: s.matchLengths.fse.dt[:maxTablesize], + ofTable: s.offsets.fse.dt[:maxTablesize], + llState: uint64(s.litLengths.state.state), + mlState: uint64(s.matchLengths.state.state), + ofState: uint64(s.offsets.state.state), + iteration: s.nSeqs - 1, + litRemain: len(s.literals), + out: s.out, + outPosition: len(s.out), + literals: s.literals, + windowSize: s.windowSize, + history: hist, + } + + s.seqSize = 0 + startSize := len(s.out) + + var errCode int + if cpuinfo.HasBMI2() { + if useSafe { + errCode = sequenceDecs_decodeSync_safe_bmi2(s, br, &ctx) + } else { + errCode = sequenceDecs_decodeSync_bmi2(s, br, &ctx) + } + } else { + if useSafe { + errCode = sequenceDecs_decodeSync_safe_amd64(s, br, &ctx) + } else { + errCode = sequenceDecs_decodeSync_amd64(s, br, &ctx) + } + } + switch errCode { + case noError: + break + + case errorMatchLenOfsMismatch: + return true, fmt.Errorf("zero matchoff and matchlen (%d) > 0", ctx.ml) + + case errorMatchLenTooBig: + return true, fmt.Errorf("match len (%d) bigger than max allowed length", ctx.ml) + + case errorMatchOffTooBig: + return true, fmt.Errorf("match offset (%d) bigger than current history (%d)", + ctx.mo, ctx.outPosition+len(hist)-startSize) + + case errorNotEnoughLiterals: + return true, fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", + ctx.ll, ctx.litRemain+ctx.ll) + + case errorOverread: + return true, io.ErrUnexpectedEOF + + case errorNotEnoughSpace: + size := ctx.outPosition + ctx.ll + ctx.ml + if debugDecoder { + println("msl:", s.maxSyncLen, "cap", cap(s.out), "bef:", startSize, "sz:", size-startSize, "mbs:", maxBlockSize, "outsz:", cap(s.out)-startSize) + } + return true, fmt.Errorf("output bigger than max block size (%d)", maxBlockSize) + + default: + return true, fmt.Errorf("sequenceDecs_decode returned erronous code %d", errCode) + } + + s.seqSize += ctx.litRemain + if s.seqSize > maxBlockSize { + return true, fmt.Errorf("output bigger than max block size (%d)", maxBlockSize) + } + err := br.close() + if err != nil { + printf("Closing sequences: %v, %+v\n", err, *br) + return true, err + } + + s.literals = s.literals[ctx.litPosition:] + t := ctx.outPosition + s.out = s.out[:t] + + // Add final literals + s.out = append(s.out, s.literals...) + if debugDecoder { + t += len(s.literals) + if t != len(s.out) { + panic(fmt.Errorf("length mismatch, want %d, got %d", len(s.out), t)) + } + } + + return true, nil +} + +// -------------------------------------------------------------------------------- + +type decodeAsmContext struct { + llTable []decSymbol + mlTable []decSymbol + ofTable []decSymbol + llState uint64 + mlState uint64 + ofState uint64 + iteration int + seqs []seqVals + litRemain int +} + +const noError = 0 + +// error reported when mo == 0 && ml > 0 +const errorMatchLenOfsMismatch = 1 + +// error reported when ml > maxMatchLen +const errorMatchLenTooBig = 2 + +// error reported when mo > available history or mo > s.windowSize +const errorMatchOffTooBig = 3 + +// error reported when the sum of literal lengths exeeceds the literal buffer size +const errorNotEnoughLiterals = 4 + +// error reported when capacity of `out` is too small +const errorNotEnoughSpace = 5 + +// error reported when bits are overread. +const errorOverread = 6 + +// sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm. +// +// Please refer to seqdec_generic.go for the reference implementation. +// +//go:noescape +func sequenceDecs_decode_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int + +// sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm. +// +// Please refer to seqdec_generic.go for the reference implementation. +// +//go:noescape +func sequenceDecs_decode_56_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int + +// sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm with BMI2 extensions. +// +//go:noescape +func sequenceDecs_decode_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int + +// sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm with BMI2 extensions. +// +//go:noescape +func sequenceDecs_decode_56_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int + +// decode sequences from the stream without the provided history. +func (s *sequenceDecs) decode(seqs []seqVals) error { + br := s.br + + maxBlockSize := maxCompressedBlockSize + if s.windowSize < maxBlockSize { + maxBlockSize = s.windowSize + } + + ctx := decodeAsmContext{ + llTable: s.litLengths.fse.dt[:maxTablesize], + mlTable: s.matchLengths.fse.dt[:maxTablesize], + ofTable: s.offsets.fse.dt[:maxTablesize], + llState: uint64(s.litLengths.state.state), + mlState: uint64(s.matchLengths.state.state), + ofState: uint64(s.offsets.state.state), + seqs: seqs, + iteration: len(seqs) - 1, + litRemain: len(s.literals), + } + + if debugDecoder { + println("decode: decoding", len(seqs), "sequences", br.remain(), "bits remain on stream") + } + + s.seqSize = 0 + lte56bits := s.maxBits+s.offsets.fse.actualTableLog+s.matchLengths.fse.actualTableLog+s.litLengths.fse.actualTableLog <= 56 + var errCode int + if cpuinfo.HasBMI2() { + if lte56bits { + errCode = sequenceDecs_decode_56_bmi2(s, br, &ctx) + } else { + errCode = sequenceDecs_decode_bmi2(s, br, &ctx) + } + } else { + if lte56bits { + errCode = sequenceDecs_decode_56_amd64(s, br, &ctx) + } else { + errCode = sequenceDecs_decode_amd64(s, br, &ctx) + } + } + if errCode != 0 { + i := len(seqs) - ctx.iteration - 1 + switch errCode { + case errorMatchLenOfsMismatch: + ml := ctx.seqs[i].ml + return fmt.Errorf("zero matchoff and matchlen (%d) > 0", ml) + + case errorMatchLenTooBig: + ml := ctx.seqs[i].ml + return fmt.Errorf("match len (%d) bigger than max allowed length", ml) + + case errorNotEnoughLiterals: + ll := ctx.seqs[i].ll + return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ll, ctx.litRemain+ll) + case errorOverread: + return io.ErrUnexpectedEOF + } + + return fmt.Errorf("sequenceDecs_decode_amd64 returned erronous code %d", errCode) + } + + if ctx.litRemain < 0 { + return fmt.Errorf("literal count is too big: total available %d, total requested %d", + len(s.literals), len(s.literals)-ctx.litRemain) + } + + s.seqSize += ctx.litRemain + if s.seqSize > maxBlockSize { + return fmt.Errorf("output bigger than max block size (%d)", maxBlockSize) + } + if debugDecoder { + println("decode: ", br.remain(), "bits remain on stream. code:", errCode) + } + err := br.close() + if err != nil { + printf("Closing sequences: %v, %+v\n", err, *br) + } + return err +} + +// -------------------------------------------------------------------------------- + +type executeAsmContext struct { + seqs []seqVals + seqIndex int + out []byte + history []byte + literals []byte + outPosition int + litPosition int + windowSize int +} + +// sequenceDecs_executeSimple_amd64 implements the main loop of sequenceDecs.executeSimple in x86 asm. +// +// Returns false if a match offset is too big. +// +// Please refer to seqdec_generic.go for the reference implementation. +// +//go:noescape +func sequenceDecs_executeSimple_amd64(ctx *executeAsmContext) bool + +// Same as above, but with safe memcopies +// +//go:noescape +func sequenceDecs_executeSimple_safe_amd64(ctx *executeAsmContext) bool + +// executeSimple handles cases when dictionary is not used. +func (s *sequenceDecs) executeSimple(seqs []seqVals, hist []byte) error { + // Ensure we have enough output size... + if len(s.out)+s.seqSize+compressedBlockOverAlloc > cap(s.out) { + addBytes := s.seqSize + len(s.out) + compressedBlockOverAlloc + s.out = append(s.out, make([]byte, addBytes)...) + s.out = s.out[:len(s.out)-addBytes] + } + + if debugDecoder { + printf("Execute %d seqs with literals: %d into %d bytes\n", len(seqs), len(s.literals), s.seqSize) + } + + var t = len(s.out) + out := s.out[:t+s.seqSize] + + ctx := executeAsmContext{ + seqs: seqs, + seqIndex: 0, + out: out, + history: hist, + outPosition: t, + litPosition: 0, + literals: s.literals, + windowSize: s.windowSize, + } + var ok bool + if cap(s.literals) < len(s.literals)+compressedBlockOverAlloc { + ok = sequenceDecs_executeSimple_safe_amd64(&ctx) + } else { + ok = sequenceDecs_executeSimple_amd64(&ctx) + } + if !ok { + return fmt.Errorf("match offset (%d) bigger than current history (%d)", + seqs[ctx.seqIndex].mo, ctx.outPosition+len(hist)) + } + s.literals = s.literals[ctx.litPosition:] + t = ctx.outPosition + + // Add final literals + copy(out[t:], s.literals) + if debugDecoder { + t += len(s.literals) + if t != len(out) { + panic(fmt.Errorf("length mismatch, want %d, got %d, ss: %d", len(out), t, s.seqSize)) + } + } + s.out = out + + return nil +} diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s new file mode 100644 index 0000000000..5b06174b89 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s @@ -0,0 +1,4151 @@ +// Code generated by command: go run gen.go -out ../seqdec_amd64.s -pkg=zstd. DO NOT EDIT. + +//go:build !appengine && !noasm && gc && !noasm + +// func sequenceDecs_decode_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int +// Requires: CMOV +TEXT ·sequenceDecs_decode_amd64(SB), $8-32 + MOVQ br+8(FP), CX + MOVQ 24(CX), DX + MOVBQZX 32(CX), BX + MOVQ (CX), AX + MOVQ 8(CX), SI + ADDQ SI, AX + MOVQ AX, (SP) + MOVQ ctx+16(FP), AX + MOVQ 72(AX), DI + MOVQ 80(AX), R8 + MOVQ 88(AX), R9 + MOVQ 104(AX), R10 + MOVQ s+0(FP), AX + MOVQ 144(AX), R11 + MOVQ 152(AX), R12 + MOVQ 160(AX), R13 + +sequenceDecs_decode_amd64_main_loop: + MOVQ (SP), R14 + + // Fill bitreader to have enough for the offset and match length. + CMPQ SI, $0x08 + JL sequenceDecs_decode_amd64_fill_byte_by_byte + MOVQ BX, AX + SHRQ $0x03, AX + SUBQ AX, R14 + MOVQ (R14), DX + SUBQ AX, SI + ANDQ $0x07, BX + JMP sequenceDecs_decode_amd64_fill_end + +sequenceDecs_decode_amd64_fill_byte_by_byte: + CMPQ SI, $0x00 + JLE sequenceDecs_decode_amd64_fill_check_overread + CMPQ BX, $0x07 + JLE sequenceDecs_decode_amd64_fill_end + SHLQ $0x08, DX + SUBQ $0x01, R14 + SUBQ $0x01, SI + SUBQ $0x08, BX + MOVBQZX (R14), AX + ORQ AX, DX + JMP sequenceDecs_decode_amd64_fill_byte_by_byte + +sequenceDecs_decode_amd64_fill_check_overread: + CMPQ BX, $0x40 + JA error_overread + +sequenceDecs_decode_amd64_fill_end: + // Update offset + MOVQ R9, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + MOVB AH, CL + SHRQ $0x20, AX + TESTQ CX, CX + JZ sequenceDecs_decode_amd64_of_update_zero + ADDQ CX, BX + CMPQ BX, $0x40 + JA sequenceDecs_decode_amd64_of_update_zero + CMPQ CX, $0x40 + JAE sequenceDecs_decode_amd64_of_update_zero + NEGQ CX + SHRQ CL, R15 + ADDQ R15, AX + +sequenceDecs_decode_amd64_of_update_zero: + MOVQ AX, 16(R10) + + // Update match length + MOVQ R8, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + MOVB AH, CL + SHRQ $0x20, AX + TESTQ CX, CX + JZ sequenceDecs_decode_amd64_ml_update_zero + ADDQ CX, BX + CMPQ BX, $0x40 + JA sequenceDecs_decode_amd64_ml_update_zero + CMPQ CX, $0x40 + JAE sequenceDecs_decode_amd64_ml_update_zero + NEGQ CX + SHRQ CL, R15 + ADDQ R15, AX + +sequenceDecs_decode_amd64_ml_update_zero: + MOVQ AX, 8(R10) + + // Fill bitreader to have enough for the remaining + CMPQ SI, $0x08 + JL sequenceDecs_decode_amd64_fill_2_byte_by_byte + MOVQ BX, AX + SHRQ $0x03, AX + SUBQ AX, R14 + MOVQ (R14), DX + SUBQ AX, SI + ANDQ $0x07, BX + JMP sequenceDecs_decode_amd64_fill_2_end + +sequenceDecs_decode_amd64_fill_2_byte_by_byte: + CMPQ SI, $0x00 + JLE sequenceDecs_decode_amd64_fill_2_check_overread + CMPQ BX, $0x07 + JLE sequenceDecs_decode_amd64_fill_2_end + SHLQ $0x08, DX + SUBQ $0x01, R14 + SUBQ $0x01, SI + SUBQ $0x08, BX + MOVBQZX (R14), AX + ORQ AX, DX + JMP sequenceDecs_decode_amd64_fill_2_byte_by_byte + +sequenceDecs_decode_amd64_fill_2_check_overread: + CMPQ BX, $0x40 + JA error_overread + +sequenceDecs_decode_amd64_fill_2_end: + // Update literal length + MOVQ DI, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + MOVB AH, CL + SHRQ $0x20, AX + TESTQ CX, CX + JZ sequenceDecs_decode_amd64_ll_update_zero + ADDQ CX, BX + CMPQ BX, $0x40 + JA sequenceDecs_decode_amd64_ll_update_zero + CMPQ CX, $0x40 + JAE sequenceDecs_decode_amd64_ll_update_zero + NEGQ CX + SHRQ CL, R15 + ADDQ R15, AX + +sequenceDecs_decode_amd64_ll_update_zero: + MOVQ AX, (R10) + + // Fill bitreader for state updates + MOVQ R14, (SP) + MOVQ R9, AX + SHRQ $0x08, AX + MOVBQZX AL, AX + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decode_amd64_skip_update + + // Update Literal Length State + MOVBQZX DI, R14 + SHRL $0x10, DI + LEAQ (BX)(R14*1), CX + MOVQ DX, R15 + MOVQ CX, BX + ROLQ CL, R15 + MOVL $0x00000001, BP + MOVB R14, CL + SHLL CL, BP + DECL BP + ANDQ BP, R15 + ADDQ R15, DI + + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(DI*8), DI + + // Update Match Length State + MOVBQZX R8, R14 + SHRL $0x10, R8 + LEAQ (BX)(R14*1), CX + MOVQ DX, R15 + MOVQ CX, BX + ROLQ CL, R15 + MOVL $0x00000001, BP + MOVB R14, CL + SHLL CL, BP + DECL BP + ANDQ BP, R15 + ADDQ R15, R8 + + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Offset State + MOVBQZX R9, R14 + SHRL $0x10, R9 + LEAQ (BX)(R14*1), CX + MOVQ DX, R15 + MOVQ CX, BX + ROLQ CL, R15 + MOVL $0x00000001, BP + MOVB R14, CL + SHLL CL, BP + DECL BP + ANDQ BP, R15 + ADDQ R15, R9 + + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R9*8), R9 + +sequenceDecs_decode_amd64_skip_update: + // Adjust offset + MOVQ 16(R10), CX + CMPQ AX, $0x01 + JBE sequenceDecs_decode_amd64_adjust_offsetB_1_or_0 + MOVQ R12, R13 + MOVQ R11, R12 + MOVQ CX, R11 + JMP sequenceDecs_decode_amd64_after_adjust + +sequenceDecs_decode_amd64_adjust_offsetB_1_or_0: + CMPQ (R10), $0x00000000 + JNE sequenceDecs_decode_amd64_adjust_offset_maybezero + INCQ CX + JMP sequenceDecs_decode_amd64_adjust_offset_nonzero + +sequenceDecs_decode_amd64_adjust_offset_maybezero: + TESTQ CX, CX + JNZ sequenceDecs_decode_amd64_adjust_offset_nonzero + MOVQ R11, CX + JMP sequenceDecs_decode_amd64_after_adjust + +sequenceDecs_decode_amd64_adjust_offset_nonzero: + CMPQ CX, $0x01 + JB sequenceDecs_decode_amd64_adjust_zero + JEQ sequenceDecs_decode_amd64_adjust_one + CMPQ CX, $0x02 + JA sequenceDecs_decode_amd64_adjust_three + JMP sequenceDecs_decode_amd64_adjust_two + +sequenceDecs_decode_amd64_adjust_zero: + MOVQ R11, AX + JMP sequenceDecs_decode_amd64_adjust_test_temp_valid + +sequenceDecs_decode_amd64_adjust_one: + MOVQ R12, AX + JMP sequenceDecs_decode_amd64_adjust_test_temp_valid + +sequenceDecs_decode_amd64_adjust_two: + MOVQ R13, AX + JMP sequenceDecs_decode_amd64_adjust_test_temp_valid + +sequenceDecs_decode_amd64_adjust_three: + LEAQ -1(R11), AX + +sequenceDecs_decode_amd64_adjust_test_temp_valid: + TESTQ AX, AX + JNZ sequenceDecs_decode_amd64_adjust_temp_valid + MOVQ $0x00000001, AX + +sequenceDecs_decode_amd64_adjust_temp_valid: + CMPQ CX, $0x01 + CMOVQNE R12, R13 + MOVQ R11, R12 + MOVQ AX, R11 + MOVQ AX, CX + +sequenceDecs_decode_amd64_after_adjust: + MOVQ CX, 16(R10) + + // Check values + MOVQ 8(R10), AX + MOVQ (R10), R14 + LEAQ (AX)(R14*1), R15 + MOVQ s+0(FP), BP + ADDQ R15, 256(BP) + MOVQ ctx+16(FP), R15 + SUBQ R14, 128(R15) + JS error_not_enough_literals + CMPQ AX, $0x00020002 + JA sequenceDecs_decode_amd64_error_match_len_too_big + TESTQ CX, CX + JNZ sequenceDecs_decode_amd64_match_len_ofs_ok + TESTQ AX, AX + JNZ sequenceDecs_decode_amd64_error_match_len_ofs_mismatch + +sequenceDecs_decode_amd64_match_len_ofs_ok: + ADDQ $0x18, R10 + MOVQ ctx+16(FP), AX + DECQ 96(AX) + JNS sequenceDecs_decode_amd64_main_loop + MOVQ s+0(FP), AX + MOVQ R11, 144(AX) + MOVQ R12, 152(AX) + MOVQ R13, 160(AX) + MOVQ br+8(FP), AX + MOVQ DX, 24(AX) + MOVB BL, 32(AX) + MOVQ SI, 8(AX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decode_amd64_error_match_len_ofs_mismatch: + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decode_amd64_error_match_len_too_big: + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + +// func sequenceDecs_decode_56_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int +// Requires: CMOV +TEXT ·sequenceDecs_decode_56_amd64(SB), $8-32 + MOVQ br+8(FP), CX + MOVQ 24(CX), DX + MOVBQZX 32(CX), BX + MOVQ (CX), AX + MOVQ 8(CX), SI + ADDQ SI, AX + MOVQ AX, (SP) + MOVQ ctx+16(FP), AX + MOVQ 72(AX), DI + MOVQ 80(AX), R8 + MOVQ 88(AX), R9 + MOVQ 104(AX), R10 + MOVQ s+0(FP), AX + MOVQ 144(AX), R11 + MOVQ 152(AX), R12 + MOVQ 160(AX), R13 + +sequenceDecs_decode_56_amd64_main_loop: + MOVQ (SP), R14 + + // Fill bitreader to have enough for the offset and match length. + CMPQ SI, $0x08 + JL sequenceDecs_decode_56_amd64_fill_byte_by_byte + MOVQ BX, AX + SHRQ $0x03, AX + SUBQ AX, R14 + MOVQ (R14), DX + SUBQ AX, SI + ANDQ $0x07, BX + JMP sequenceDecs_decode_56_amd64_fill_end + +sequenceDecs_decode_56_amd64_fill_byte_by_byte: + CMPQ SI, $0x00 + JLE sequenceDecs_decode_56_amd64_fill_check_overread + CMPQ BX, $0x07 + JLE sequenceDecs_decode_56_amd64_fill_end + SHLQ $0x08, DX + SUBQ $0x01, R14 + SUBQ $0x01, SI + SUBQ $0x08, BX + MOVBQZX (R14), AX + ORQ AX, DX + JMP sequenceDecs_decode_56_amd64_fill_byte_by_byte + +sequenceDecs_decode_56_amd64_fill_check_overread: + CMPQ BX, $0x40 + JA error_overread + +sequenceDecs_decode_56_amd64_fill_end: + // Update offset + MOVQ R9, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + MOVB AH, CL + SHRQ $0x20, AX + TESTQ CX, CX + JZ sequenceDecs_decode_56_amd64_of_update_zero + ADDQ CX, BX + CMPQ BX, $0x40 + JA sequenceDecs_decode_56_amd64_of_update_zero + CMPQ CX, $0x40 + JAE sequenceDecs_decode_56_amd64_of_update_zero + NEGQ CX + SHRQ CL, R15 + ADDQ R15, AX + +sequenceDecs_decode_56_amd64_of_update_zero: + MOVQ AX, 16(R10) + + // Update match length + MOVQ R8, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + MOVB AH, CL + SHRQ $0x20, AX + TESTQ CX, CX + JZ sequenceDecs_decode_56_amd64_ml_update_zero + ADDQ CX, BX + CMPQ BX, $0x40 + JA sequenceDecs_decode_56_amd64_ml_update_zero + CMPQ CX, $0x40 + JAE sequenceDecs_decode_56_amd64_ml_update_zero + NEGQ CX + SHRQ CL, R15 + ADDQ R15, AX + +sequenceDecs_decode_56_amd64_ml_update_zero: + MOVQ AX, 8(R10) + + // Update literal length + MOVQ DI, AX + MOVQ BX, CX + MOVQ DX, R15 + SHLQ CL, R15 + MOVB AH, CL + SHRQ $0x20, AX + TESTQ CX, CX + JZ sequenceDecs_decode_56_amd64_ll_update_zero + ADDQ CX, BX + CMPQ BX, $0x40 + JA sequenceDecs_decode_56_amd64_ll_update_zero + CMPQ CX, $0x40 + JAE sequenceDecs_decode_56_amd64_ll_update_zero + NEGQ CX + SHRQ CL, R15 + ADDQ R15, AX + +sequenceDecs_decode_56_amd64_ll_update_zero: + MOVQ AX, (R10) + + // Fill bitreader for state updates + MOVQ R14, (SP) + MOVQ R9, AX + SHRQ $0x08, AX + MOVBQZX AL, AX + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decode_56_amd64_skip_update + + // Update Literal Length State + MOVBQZX DI, R14 + SHRL $0x10, DI + LEAQ (BX)(R14*1), CX + MOVQ DX, R15 + MOVQ CX, BX + ROLQ CL, R15 + MOVL $0x00000001, BP + MOVB R14, CL + SHLL CL, BP + DECL BP + ANDQ BP, R15 + ADDQ R15, DI + + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(DI*8), DI + + // Update Match Length State + MOVBQZX R8, R14 + SHRL $0x10, R8 + LEAQ (BX)(R14*1), CX + MOVQ DX, R15 + MOVQ CX, BX + ROLQ CL, R15 + MOVL $0x00000001, BP + MOVB R14, CL + SHLL CL, BP + DECL BP + ANDQ BP, R15 + ADDQ R15, R8 + + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Offset State + MOVBQZX R9, R14 + SHRL $0x10, R9 + LEAQ (BX)(R14*1), CX + MOVQ DX, R15 + MOVQ CX, BX + ROLQ CL, R15 + MOVL $0x00000001, BP + MOVB R14, CL + SHLL CL, BP + DECL BP + ANDQ BP, R15 + ADDQ R15, R9 + + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R9*8), R9 + +sequenceDecs_decode_56_amd64_skip_update: + // Adjust offset + MOVQ 16(R10), CX + CMPQ AX, $0x01 + JBE sequenceDecs_decode_56_amd64_adjust_offsetB_1_or_0 + MOVQ R12, R13 + MOVQ R11, R12 + MOVQ CX, R11 + JMP sequenceDecs_decode_56_amd64_after_adjust + +sequenceDecs_decode_56_amd64_adjust_offsetB_1_or_0: + CMPQ (R10), $0x00000000 + JNE sequenceDecs_decode_56_amd64_adjust_offset_maybezero + INCQ CX + JMP sequenceDecs_decode_56_amd64_adjust_offset_nonzero + +sequenceDecs_decode_56_amd64_adjust_offset_maybezero: + TESTQ CX, CX + JNZ sequenceDecs_decode_56_amd64_adjust_offset_nonzero + MOVQ R11, CX + JMP sequenceDecs_decode_56_amd64_after_adjust + +sequenceDecs_decode_56_amd64_adjust_offset_nonzero: + CMPQ CX, $0x01 + JB sequenceDecs_decode_56_amd64_adjust_zero + JEQ sequenceDecs_decode_56_amd64_adjust_one + CMPQ CX, $0x02 + JA sequenceDecs_decode_56_amd64_adjust_three + JMP sequenceDecs_decode_56_amd64_adjust_two + +sequenceDecs_decode_56_amd64_adjust_zero: + MOVQ R11, AX + JMP sequenceDecs_decode_56_amd64_adjust_test_temp_valid + +sequenceDecs_decode_56_amd64_adjust_one: + MOVQ R12, AX + JMP sequenceDecs_decode_56_amd64_adjust_test_temp_valid + +sequenceDecs_decode_56_amd64_adjust_two: + MOVQ R13, AX + JMP sequenceDecs_decode_56_amd64_adjust_test_temp_valid + +sequenceDecs_decode_56_amd64_adjust_three: + LEAQ -1(R11), AX + +sequenceDecs_decode_56_amd64_adjust_test_temp_valid: + TESTQ AX, AX + JNZ sequenceDecs_decode_56_amd64_adjust_temp_valid + MOVQ $0x00000001, AX + +sequenceDecs_decode_56_amd64_adjust_temp_valid: + CMPQ CX, $0x01 + CMOVQNE R12, R13 + MOVQ R11, R12 + MOVQ AX, R11 + MOVQ AX, CX + +sequenceDecs_decode_56_amd64_after_adjust: + MOVQ CX, 16(R10) + + // Check values + MOVQ 8(R10), AX + MOVQ (R10), R14 + LEAQ (AX)(R14*1), R15 + MOVQ s+0(FP), BP + ADDQ R15, 256(BP) + MOVQ ctx+16(FP), R15 + SUBQ R14, 128(R15) + JS error_not_enough_literals + CMPQ AX, $0x00020002 + JA sequenceDecs_decode_56_amd64_error_match_len_too_big + TESTQ CX, CX + JNZ sequenceDecs_decode_56_amd64_match_len_ofs_ok + TESTQ AX, AX + JNZ sequenceDecs_decode_56_amd64_error_match_len_ofs_mismatch + +sequenceDecs_decode_56_amd64_match_len_ofs_ok: + ADDQ $0x18, R10 + MOVQ ctx+16(FP), AX + DECQ 96(AX) + JNS sequenceDecs_decode_56_amd64_main_loop + MOVQ s+0(FP), AX + MOVQ R11, 144(AX) + MOVQ R12, 152(AX) + MOVQ R13, 160(AX) + MOVQ br+8(FP), AX + MOVQ DX, 24(AX) + MOVB BL, 32(AX) + MOVQ SI, 8(AX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decode_56_amd64_error_match_len_ofs_mismatch: + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decode_56_amd64_error_match_len_too_big: + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + +// func sequenceDecs_decode_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int +// Requires: BMI, BMI2, CMOV +TEXT ·sequenceDecs_decode_bmi2(SB), $8-32 + MOVQ br+8(FP), BX + MOVQ 24(BX), AX + MOVBQZX 32(BX), DX + MOVQ (BX), CX + MOVQ 8(BX), BX + ADDQ BX, CX + MOVQ CX, (SP) + MOVQ ctx+16(FP), CX + MOVQ 72(CX), SI + MOVQ 80(CX), DI + MOVQ 88(CX), R8 + MOVQ 104(CX), R9 + MOVQ s+0(FP), CX + MOVQ 144(CX), R10 + MOVQ 152(CX), R11 + MOVQ 160(CX), R12 + +sequenceDecs_decode_bmi2_main_loop: + MOVQ (SP), R13 + + // Fill bitreader to have enough for the offset and match length. + CMPQ BX, $0x08 + JL sequenceDecs_decode_bmi2_fill_byte_by_byte + MOVQ DX, CX + SHRQ $0x03, CX + SUBQ CX, R13 + MOVQ (R13), AX + SUBQ CX, BX + ANDQ $0x07, DX + JMP sequenceDecs_decode_bmi2_fill_end + +sequenceDecs_decode_bmi2_fill_byte_by_byte: + CMPQ BX, $0x00 + JLE sequenceDecs_decode_bmi2_fill_check_overread + CMPQ DX, $0x07 + JLE sequenceDecs_decode_bmi2_fill_end + SHLQ $0x08, AX + SUBQ $0x01, R13 + SUBQ $0x01, BX + SUBQ $0x08, DX + MOVBQZX (R13), CX + ORQ CX, AX + JMP sequenceDecs_decode_bmi2_fill_byte_by_byte + +sequenceDecs_decode_bmi2_fill_check_overread: + CMPQ DX, $0x40 + JA error_overread + +sequenceDecs_decode_bmi2_fill_end: + // Update offset + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R14 + MOVQ AX, R15 + LEAQ (DX)(R14*1), CX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + MOVQ CX, DX + MOVQ R8, CX + SHRQ $0x20, CX + ADDQ R15, CX + MOVQ CX, 16(R9) + + // Update match length + MOVQ $0x00000808, CX + BEXTRQ CX, DI, R14 + MOVQ AX, R15 + LEAQ (DX)(R14*1), CX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + MOVQ CX, DX + MOVQ DI, CX + SHRQ $0x20, CX + ADDQ R15, CX + MOVQ CX, 8(R9) + + // Fill bitreader to have enough for the remaining + CMPQ BX, $0x08 + JL sequenceDecs_decode_bmi2_fill_2_byte_by_byte + MOVQ DX, CX + SHRQ $0x03, CX + SUBQ CX, R13 + MOVQ (R13), AX + SUBQ CX, BX + ANDQ $0x07, DX + JMP sequenceDecs_decode_bmi2_fill_2_end + +sequenceDecs_decode_bmi2_fill_2_byte_by_byte: + CMPQ BX, $0x00 + JLE sequenceDecs_decode_bmi2_fill_2_check_overread + CMPQ DX, $0x07 + JLE sequenceDecs_decode_bmi2_fill_2_end + SHLQ $0x08, AX + SUBQ $0x01, R13 + SUBQ $0x01, BX + SUBQ $0x08, DX + MOVBQZX (R13), CX + ORQ CX, AX + JMP sequenceDecs_decode_bmi2_fill_2_byte_by_byte + +sequenceDecs_decode_bmi2_fill_2_check_overread: + CMPQ DX, $0x40 + JA error_overread + +sequenceDecs_decode_bmi2_fill_2_end: + // Update literal length + MOVQ $0x00000808, CX + BEXTRQ CX, SI, R14 + MOVQ AX, R15 + LEAQ (DX)(R14*1), CX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + MOVQ CX, DX + MOVQ SI, CX + SHRQ $0x20, CX + ADDQ R15, CX + MOVQ CX, (R9) + + // Fill bitreader for state updates + MOVQ R13, (SP) + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R13 + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decode_bmi2_skip_update + LEAQ (SI)(DI*1), R14 + ADDQ R8, R14 + MOVBQZX R14, R14 + LEAQ (DX)(R14*1), CX + MOVQ AX, R15 + MOVQ CX, DX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + + // Update Offset State + BZHIQ R8, R15, CX + SHRXQ R8, R15, R15 + SHRL $0x10, R8 + ADDQ CX, R8 + + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Match Length State + BZHIQ DI, R15, CX + SHRXQ DI, R15, R15 + SHRL $0x10, DI + ADDQ CX, DI + + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(DI*8), DI + + // Update Literal Length State + BZHIQ SI, R15, CX + SHRL $0x10, SI + ADDQ CX, SI + + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(SI*8), SI + +sequenceDecs_decode_bmi2_skip_update: + // Adjust offset + MOVQ 16(R9), CX + CMPQ R13, $0x01 + JBE sequenceDecs_decode_bmi2_adjust_offsetB_1_or_0 + MOVQ R11, R12 + MOVQ R10, R11 + MOVQ CX, R10 + JMP sequenceDecs_decode_bmi2_after_adjust + +sequenceDecs_decode_bmi2_adjust_offsetB_1_or_0: + CMPQ (R9), $0x00000000 + JNE sequenceDecs_decode_bmi2_adjust_offset_maybezero + INCQ CX + JMP sequenceDecs_decode_bmi2_adjust_offset_nonzero + +sequenceDecs_decode_bmi2_adjust_offset_maybezero: + TESTQ CX, CX + JNZ sequenceDecs_decode_bmi2_adjust_offset_nonzero + MOVQ R10, CX + JMP sequenceDecs_decode_bmi2_after_adjust + +sequenceDecs_decode_bmi2_adjust_offset_nonzero: + CMPQ CX, $0x01 + JB sequenceDecs_decode_bmi2_adjust_zero + JEQ sequenceDecs_decode_bmi2_adjust_one + CMPQ CX, $0x02 + JA sequenceDecs_decode_bmi2_adjust_three + JMP sequenceDecs_decode_bmi2_adjust_two + +sequenceDecs_decode_bmi2_adjust_zero: + MOVQ R10, R13 + JMP sequenceDecs_decode_bmi2_adjust_test_temp_valid + +sequenceDecs_decode_bmi2_adjust_one: + MOVQ R11, R13 + JMP sequenceDecs_decode_bmi2_adjust_test_temp_valid + +sequenceDecs_decode_bmi2_adjust_two: + MOVQ R12, R13 + JMP sequenceDecs_decode_bmi2_adjust_test_temp_valid + +sequenceDecs_decode_bmi2_adjust_three: + LEAQ -1(R10), R13 + +sequenceDecs_decode_bmi2_adjust_test_temp_valid: + TESTQ R13, R13 + JNZ sequenceDecs_decode_bmi2_adjust_temp_valid + MOVQ $0x00000001, R13 + +sequenceDecs_decode_bmi2_adjust_temp_valid: + CMPQ CX, $0x01 + CMOVQNE R11, R12 + MOVQ R10, R11 + MOVQ R13, R10 + MOVQ R13, CX + +sequenceDecs_decode_bmi2_after_adjust: + MOVQ CX, 16(R9) + + // Check values + MOVQ 8(R9), R13 + MOVQ (R9), R14 + LEAQ (R13)(R14*1), R15 + MOVQ s+0(FP), BP + ADDQ R15, 256(BP) + MOVQ ctx+16(FP), R15 + SUBQ R14, 128(R15) + JS error_not_enough_literals + CMPQ R13, $0x00020002 + JA sequenceDecs_decode_bmi2_error_match_len_too_big + TESTQ CX, CX + JNZ sequenceDecs_decode_bmi2_match_len_ofs_ok + TESTQ R13, R13 + JNZ sequenceDecs_decode_bmi2_error_match_len_ofs_mismatch + +sequenceDecs_decode_bmi2_match_len_ofs_ok: + ADDQ $0x18, R9 + MOVQ ctx+16(FP), CX + DECQ 96(CX) + JNS sequenceDecs_decode_bmi2_main_loop + MOVQ s+0(FP), CX + MOVQ R10, 144(CX) + MOVQ R11, 152(CX) + MOVQ R12, 160(CX) + MOVQ br+8(FP), CX + MOVQ AX, 24(CX) + MOVB DL, 32(CX) + MOVQ BX, 8(CX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decode_bmi2_error_match_len_ofs_mismatch: + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decode_bmi2_error_match_len_too_big: + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + +// func sequenceDecs_decode_56_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int +// Requires: BMI, BMI2, CMOV +TEXT ·sequenceDecs_decode_56_bmi2(SB), $8-32 + MOVQ br+8(FP), BX + MOVQ 24(BX), AX + MOVBQZX 32(BX), DX + MOVQ (BX), CX + MOVQ 8(BX), BX + ADDQ BX, CX + MOVQ CX, (SP) + MOVQ ctx+16(FP), CX + MOVQ 72(CX), SI + MOVQ 80(CX), DI + MOVQ 88(CX), R8 + MOVQ 104(CX), R9 + MOVQ s+0(FP), CX + MOVQ 144(CX), R10 + MOVQ 152(CX), R11 + MOVQ 160(CX), R12 + +sequenceDecs_decode_56_bmi2_main_loop: + MOVQ (SP), R13 + + // Fill bitreader to have enough for the offset and match length. + CMPQ BX, $0x08 + JL sequenceDecs_decode_56_bmi2_fill_byte_by_byte + MOVQ DX, CX + SHRQ $0x03, CX + SUBQ CX, R13 + MOVQ (R13), AX + SUBQ CX, BX + ANDQ $0x07, DX + JMP sequenceDecs_decode_56_bmi2_fill_end + +sequenceDecs_decode_56_bmi2_fill_byte_by_byte: + CMPQ BX, $0x00 + JLE sequenceDecs_decode_56_bmi2_fill_check_overread + CMPQ DX, $0x07 + JLE sequenceDecs_decode_56_bmi2_fill_end + SHLQ $0x08, AX + SUBQ $0x01, R13 + SUBQ $0x01, BX + SUBQ $0x08, DX + MOVBQZX (R13), CX + ORQ CX, AX + JMP sequenceDecs_decode_56_bmi2_fill_byte_by_byte + +sequenceDecs_decode_56_bmi2_fill_check_overread: + CMPQ DX, $0x40 + JA error_overread + +sequenceDecs_decode_56_bmi2_fill_end: + // Update offset + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R14 + MOVQ AX, R15 + LEAQ (DX)(R14*1), CX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + MOVQ CX, DX + MOVQ R8, CX + SHRQ $0x20, CX + ADDQ R15, CX + MOVQ CX, 16(R9) + + // Update match length + MOVQ $0x00000808, CX + BEXTRQ CX, DI, R14 + MOVQ AX, R15 + LEAQ (DX)(R14*1), CX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + MOVQ CX, DX + MOVQ DI, CX + SHRQ $0x20, CX + ADDQ R15, CX + MOVQ CX, 8(R9) + + // Update literal length + MOVQ $0x00000808, CX + BEXTRQ CX, SI, R14 + MOVQ AX, R15 + LEAQ (DX)(R14*1), CX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + MOVQ CX, DX + MOVQ SI, CX + SHRQ $0x20, CX + ADDQ R15, CX + MOVQ CX, (R9) + + // Fill bitreader for state updates + MOVQ R13, (SP) + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R13 + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decode_56_bmi2_skip_update + LEAQ (SI)(DI*1), R14 + ADDQ R8, R14 + MOVBQZX R14, R14 + LEAQ (DX)(R14*1), CX + MOVQ AX, R15 + MOVQ CX, DX + ROLQ CL, R15 + BZHIQ R14, R15, R15 + + // Update Offset State + BZHIQ R8, R15, CX + SHRXQ R8, R15, R15 + SHRL $0x10, R8 + ADDQ CX, R8 + + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Match Length State + BZHIQ DI, R15, CX + SHRXQ DI, R15, R15 + SHRL $0x10, DI + ADDQ CX, DI + + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(DI*8), DI + + // Update Literal Length State + BZHIQ SI, R15, CX + SHRL $0x10, SI + ADDQ CX, SI + + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(SI*8), SI + +sequenceDecs_decode_56_bmi2_skip_update: + // Adjust offset + MOVQ 16(R9), CX + CMPQ R13, $0x01 + JBE sequenceDecs_decode_56_bmi2_adjust_offsetB_1_or_0 + MOVQ R11, R12 + MOVQ R10, R11 + MOVQ CX, R10 + JMP sequenceDecs_decode_56_bmi2_after_adjust + +sequenceDecs_decode_56_bmi2_adjust_offsetB_1_or_0: + CMPQ (R9), $0x00000000 + JNE sequenceDecs_decode_56_bmi2_adjust_offset_maybezero + INCQ CX + JMP sequenceDecs_decode_56_bmi2_adjust_offset_nonzero + +sequenceDecs_decode_56_bmi2_adjust_offset_maybezero: + TESTQ CX, CX + JNZ sequenceDecs_decode_56_bmi2_adjust_offset_nonzero + MOVQ R10, CX + JMP sequenceDecs_decode_56_bmi2_after_adjust + +sequenceDecs_decode_56_bmi2_adjust_offset_nonzero: + CMPQ CX, $0x01 + JB sequenceDecs_decode_56_bmi2_adjust_zero + JEQ sequenceDecs_decode_56_bmi2_adjust_one + CMPQ CX, $0x02 + JA sequenceDecs_decode_56_bmi2_adjust_three + JMP sequenceDecs_decode_56_bmi2_adjust_two + +sequenceDecs_decode_56_bmi2_adjust_zero: + MOVQ R10, R13 + JMP sequenceDecs_decode_56_bmi2_adjust_test_temp_valid + +sequenceDecs_decode_56_bmi2_adjust_one: + MOVQ R11, R13 + JMP sequenceDecs_decode_56_bmi2_adjust_test_temp_valid + +sequenceDecs_decode_56_bmi2_adjust_two: + MOVQ R12, R13 + JMP sequenceDecs_decode_56_bmi2_adjust_test_temp_valid + +sequenceDecs_decode_56_bmi2_adjust_three: + LEAQ -1(R10), R13 + +sequenceDecs_decode_56_bmi2_adjust_test_temp_valid: + TESTQ R13, R13 + JNZ sequenceDecs_decode_56_bmi2_adjust_temp_valid + MOVQ $0x00000001, R13 + +sequenceDecs_decode_56_bmi2_adjust_temp_valid: + CMPQ CX, $0x01 + CMOVQNE R11, R12 + MOVQ R10, R11 + MOVQ R13, R10 + MOVQ R13, CX + +sequenceDecs_decode_56_bmi2_after_adjust: + MOVQ CX, 16(R9) + + // Check values + MOVQ 8(R9), R13 + MOVQ (R9), R14 + LEAQ (R13)(R14*1), R15 + MOVQ s+0(FP), BP + ADDQ R15, 256(BP) + MOVQ ctx+16(FP), R15 + SUBQ R14, 128(R15) + JS error_not_enough_literals + CMPQ R13, $0x00020002 + JA sequenceDecs_decode_56_bmi2_error_match_len_too_big + TESTQ CX, CX + JNZ sequenceDecs_decode_56_bmi2_match_len_ofs_ok + TESTQ R13, R13 + JNZ sequenceDecs_decode_56_bmi2_error_match_len_ofs_mismatch + +sequenceDecs_decode_56_bmi2_match_len_ofs_ok: + ADDQ $0x18, R9 + MOVQ ctx+16(FP), CX + DECQ 96(CX) + JNS sequenceDecs_decode_56_bmi2_main_loop + MOVQ s+0(FP), CX + MOVQ R10, 144(CX) + MOVQ R11, 152(CX) + MOVQ R12, 160(CX) + MOVQ br+8(FP), CX + MOVQ AX, 24(CX) + MOVB DL, 32(CX) + MOVQ BX, 8(CX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decode_56_bmi2_error_match_len_ofs_mismatch: + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decode_56_bmi2_error_match_len_too_big: + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + +// func sequenceDecs_executeSimple_amd64(ctx *executeAsmContext) bool +// Requires: SSE +TEXT ·sequenceDecs_executeSimple_amd64(SB), $8-9 + MOVQ ctx+0(FP), R10 + MOVQ 8(R10), CX + TESTQ CX, CX + JZ empty_seqs + MOVQ (R10), AX + MOVQ 24(R10), DX + MOVQ 32(R10), BX + MOVQ 80(R10), SI + MOVQ 104(R10), DI + MOVQ 120(R10), R8 + MOVQ 56(R10), R9 + MOVQ 64(R10), R10 + ADDQ R10, R9 + + // seqsBase += 24 * seqIndex + LEAQ (DX)(DX*2), R11 + SHLQ $0x03, R11 + ADDQ R11, AX + + // outBase += outPosition + ADDQ DI, BX + +main_loop: + MOVQ (AX), R11 + MOVQ 16(AX), R12 + MOVQ 8(AX), R13 + + // Copy literals + TESTQ R11, R11 + JZ check_offset + XORQ R14, R14 + +copy_1: + MOVUPS (SI)(R14*1), X0 + MOVUPS X0, (BX)(R14*1) + ADDQ $0x10, R14 + CMPQ R14, R11 + JB copy_1 + ADDQ R11, SI + ADDQ R11, BX + ADDQ R11, DI + + // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) +check_offset: + LEAQ (DI)(R10*1), R11 + CMPQ R12, R11 + JG error_match_off_too_big + CMPQ R12, R8 + JG error_match_off_too_big + + // Copy match from history + MOVQ R12, R11 + SUBQ DI, R11 + JLS copy_match + MOVQ R9, R14 + SUBQ R11, R14 + CMPQ R13, R11 + JG copy_all_from_history + MOVQ R13, R11 + SUBQ $0x10, R11 + JB copy_4_small + +copy_4_loop: + MOVUPS (R14), X0 + MOVUPS X0, (BX) + ADDQ $0x10, R14 + ADDQ $0x10, BX + SUBQ $0x10, R11 + JAE copy_4_loop + LEAQ 16(R14)(R11*1), R14 + LEAQ 16(BX)(R11*1), BX + MOVUPS -16(R14), X0 + MOVUPS X0, -16(BX) + JMP copy_4_end + +copy_4_small: + CMPQ R13, $0x03 + JE copy_4_move_3 + CMPQ R13, $0x08 + JB copy_4_move_4through7 + JMP copy_4_move_8through16 + +copy_4_move_3: + MOVW (R14), R11 + MOVB 2(R14), R12 + MOVW R11, (BX) + MOVB R12, 2(BX) + ADDQ R13, R14 + ADDQ R13, BX + JMP copy_4_end + +copy_4_move_4through7: + MOVL (R14), R11 + MOVL -4(R14)(R13*1), R12 + MOVL R11, (BX) + MOVL R12, -4(BX)(R13*1) + ADDQ R13, R14 + ADDQ R13, BX + JMP copy_4_end + +copy_4_move_8through16: + MOVQ (R14), R11 + MOVQ -8(R14)(R13*1), R12 + MOVQ R11, (BX) + MOVQ R12, -8(BX)(R13*1) + ADDQ R13, R14 + ADDQ R13, BX + +copy_4_end: + ADDQ R13, DI + ADDQ $0x18, AX + INCQ DX + CMPQ DX, CX + JB main_loop + JMP loop_finished + +copy_all_from_history: + MOVQ R11, R15 + SUBQ $0x10, R15 + JB copy_5_small + +copy_5_loop: + MOVUPS (R14), X0 + MOVUPS X0, (BX) + ADDQ $0x10, R14 + ADDQ $0x10, BX + SUBQ $0x10, R15 + JAE copy_5_loop + LEAQ 16(R14)(R15*1), R14 + LEAQ 16(BX)(R15*1), BX + MOVUPS -16(R14), X0 + MOVUPS X0, -16(BX) + JMP copy_5_end + +copy_5_small: + CMPQ R11, $0x03 + JE copy_5_move_3 + JB copy_5_move_1or2 + CMPQ R11, $0x08 + JB copy_5_move_4through7 + JMP copy_5_move_8through16 + +copy_5_move_1or2: + MOVB (R14), R15 + MOVB -1(R14)(R11*1), BP + MOVB R15, (BX) + MOVB BP, -1(BX)(R11*1) + ADDQ R11, R14 + ADDQ R11, BX + JMP copy_5_end + +copy_5_move_3: + MOVW (R14), R15 + MOVB 2(R14), BP + MOVW R15, (BX) + MOVB BP, 2(BX) + ADDQ R11, R14 + ADDQ R11, BX + JMP copy_5_end + +copy_5_move_4through7: + MOVL (R14), R15 + MOVL -4(R14)(R11*1), BP + MOVL R15, (BX) + MOVL BP, -4(BX)(R11*1) + ADDQ R11, R14 + ADDQ R11, BX + JMP copy_5_end + +copy_5_move_8through16: + MOVQ (R14), R15 + MOVQ -8(R14)(R11*1), BP + MOVQ R15, (BX) + MOVQ BP, -8(BX)(R11*1) + ADDQ R11, R14 + ADDQ R11, BX + +copy_5_end: + ADDQ R11, DI + SUBQ R11, R13 + + // Copy match from the current buffer +copy_match: + MOVQ BX, R11 + SUBQ R12, R11 + + // ml <= mo + CMPQ R13, R12 + JA copy_overlapping_match + + // Copy non-overlapping match + ADDQ R13, DI + MOVQ BX, R12 + ADDQ R13, BX + +copy_2: + MOVUPS (R11), X0 + MOVUPS X0, (R12) + ADDQ $0x10, R11 + ADDQ $0x10, R12 + SUBQ $0x10, R13 + JHI copy_2 + JMP handle_loop + + // Copy overlapping match +copy_overlapping_match: + ADDQ R13, DI + +copy_slow_3: + MOVB (R11), R12 + MOVB R12, (BX) + INCQ R11 + INCQ BX + DECQ R13 + JNZ copy_slow_3 + +handle_loop: + ADDQ $0x18, AX + INCQ DX + CMPQ DX, CX + JB main_loop + +loop_finished: + // Return value + MOVB $0x01, ret+8(FP) + + // Update the context + MOVQ ctx+0(FP), AX + MOVQ DX, 24(AX) + MOVQ DI, 104(AX) + SUBQ 80(AX), SI + MOVQ SI, 112(AX) + RET + +error_match_off_too_big: + // Return value + MOVB $0x00, ret+8(FP) + + // Update the context + MOVQ ctx+0(FP), AX + MOVQ DX, 24(AX) + MOVQ DI, 104(AX) + SUBQ 80(AX), SI + MOVQ SI, 112(AX) + RET + +empty_seqs: + // Return value + MOVB $0x01, ret+8(FP) + RET + +// func sequenceDecs_executeSimple_safe_amd64(ctx *executeAsmContext) bool +// Requires: SSE +TEXT ·sequenceDecs_executeSimple_safe_amd64(SB), $8-9 + MOVQ ctx+0(FP), R10 + MOVQ 8(R10), CX + TESTQ CX, CX + JZ empty_seqs + MOVQ (R10), AX + MOVQ 24(R10), DX + MOVQ 32(R10), BX + MOVQ 80(R10), SI + MOVQ 104(R10), DI + MOVQ 120(R10), R8 + MOVQ 56(R10), R9 + MOVQ 64(R10), R10 + ADDQ R10, R9 + + // seqsBase += 24 * seqIndex + LEAQ (DX)(DX*2), R11 + SHLQ $0x03, R11 + ADDQ R11, AX + + // outBase += outPosition + ADDQ DI, BX + +main_loop: + MOVQ (AX), R11 + MOVQ 16(AX), R12 + MOVQ 8(AX), R13 + + // Copy literals + TESTQ R11, R11 + JZ check_offset + MOVQ R11, R14 + SUBQ $0x10, R14 + JB copy_1_small + +copy_1_loop: + MOVUPS (SI), X0 + MOVUPS X0, (BX) + ADDQ $0x10, SI + ADDQ $0x10, BX + SUBQ $0x10, R14 + JAE copy_1_loop + LEAQ 16(SI)(R14*1), SI + LEAQ 16(BX)(R14*1), BX + MOVUPS -16(SI), X0 + MOVUPS X0, -16(BX) + JMP copy_1_end + +copy_1_small: + CMPQ R11, $0x03 + JE copy_1_move_3 + JB copy_1_move_1or2 + CMPQ R11, $0x08 + JB copy_1_move_4through7 + JMP copy_1_move_8through16 + +copy_1_move_1or2: + MOVB (SI), R14 + MOVB -1(SI)(R11*1), R15 + MOVB R14, (BX) + MOVB R15, -1(BX)(R11*1) + ADDQ R11, SI + ADDQ R11, BX + JMP copy_1_end + +copy_1_move_3: + MOVW (SI), R14 + MOVB 2(SI), R15 + MOVW R14, (BX) + MOVB R15, 2(BX) + ADDQ R11, SI + ADDQ R11, BX + JMP copy_1_end + +copy_1_move_4through7: + MOVL (SI), R14 + MOVL -4(SI)(R11*1), R15 + MOVL R14, (BX) + MOVL R15, -4(BX)(R11*1) + ADDQ R11, SI + ADDQ R11, BX + JMP copy_1_end + +copy_1_move_8through16: + MOVQ (SI), R14 + MOVQ -8(SI)(R11*1), R15 + MOVQ R14, (BX) + MOVQ R15, -8(BX)(R11*1) + ADDQ R11, SI + ADDQ R11, BX + +copy_1_end: + ADDQ R11, DI + + // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) +check_offset: + LEAQ (DI)(R10*1), R11 + CMPQ R12, R11 + JG error_match_off_too_big + CMPQ R12, R8 + JG error_match_off_too_big + + // Copy match from history + MOVQ R12, R11 + SUBQ DI, R11 + JLS copy_match + MOVQ R9, R14 + SUBQ R11, R14 + CMPQ R13, R11 + JG copy_all_from_history + MOVQ R13, R11 + SUBQ $0x10, R11 + JB copy_4_small + +copy_4_loop: + MOVUPS (R14), X0 + MOVUPS X0, (BX) + ADDQ $0x10, R14 + ADDQ $0x10, BX + SUBQ $0x10, R11 + JAE copy_4_loop + LEAQ 16(R14)(R11*1), R14 + LEAQ 16(BX)(R11*1), BX + MOVUPS -16(R14), X0 + MOVUPS X0, -16(BX) + JMP copy_4_end + +copy_4_small: + CMPQ R13, $0x03 + JE copy_4_move_3 + CMPQ R13, $0x08 + JB copy_4_move_4through7 + JMP copy_4_move_8through16 + +copy_4_move_3: + MOVW (R14), R11 + MOVB 2(R14), R12 + MOVW R11, (BX) + MOVB R12, 2(BX) + ADDQ R13, R14 + ADDQ R13, BX + JMP copy_4_end + +copy_4_move_4through7: + MOVL (R14), R11 + MOVL -4(R14)(R13*1), R12 + MOVL R11, (BX) + MOVL R12, -4(BX)(R13*1) + ADDQ R13, R14 + ADDQ R13, BX + JMP copy_4_end + +copy_4_move_8through16: + MOVQ (R14), R11 + MOVQ -8(R14)(R13*1), R12 + MOVQ R11, (BX) + MOVQ R12, -8(BX)(R13*1) + ADDQ R13, R14 + ADDQ R13, BX + +copy_4_end: + ADDQ R13, DI + ADDQ $0x18, AX + INCQ DX + CMPQ DX, CX + JB main_loop + JMP loop_finished + +copy_all_from_history: + MOVQ R11, R15 + SUBQ $0x10, R15 + JB copy_5_small + +copy_5_loop: + MOVUPS (R14), X0 + MOVUPS X0, (BX) + ADDQ $0x10, R14 + ADDQ $0x10, BX + SUBQ $0x10, R15 + JAE copy_5_loop + LEAQ 16(R14)(R15*1), R14 + LEAQ 16(BX)(R15*1), BX + MOVUPS -16(R14), X0 + MOVUPS X0, -16(BX) + JMP copy_5_end + +copy_5_small: + CMPQ R11, $0x03 + JE copy_5_move_3 + JB copy_5_move_1or2 + CMPQ R11, $0x08 + JB copy_5_move_4through7 + JMP copy_5_move_8through16 + +copy_5_move_1or2: + MOVB (R14), R15 + MOVB -1(R14)(R11*1), BP + MOVB R15, (BX) + MOVB BP, -1(BX)(R11*1) + ADDQ R11, R14 + ADDQ R11, BX + JMP copy_5_end + +copy_5_move_3: + MOVW (R14), R15 + MOVB 2(R14), BP + MOVW R15, (BX) + MOVB BP, 2(BX) + ADDQ R11, R14 + ADDQ R11, BX + JMP copy_5_end + +copy_5_move_4through7: + MOVL (R14), R15 + MOVL -4(R14)(R11*1), BP + MOVL R15, (BX) + MOVL BP, -4(BX)(R11*1) + ADDQ R11, R14 + ADDQ R11, BX + JMP copy_5_end + +copy_5_move_8through16: + MOVQ (R14), R15 + MOVQ -8(R14)(R11*1), BP + MOVQ R15, (BX) + MOVQ BP, -8(BX)(R11*1) + ADDQ R11, R14 + ADDQ R11, BX + +copy_5_end: + ADDQ R11, DI + SUBQ R11, R13 + + // Copy match from the current buffer +copy_match: + MOVQ BX, R11 + SUBQ R12, R11 + + // ml <= mo + CMPQ R13, R12 + JA copy_overlapping_match + + // Copy non-overlapping match + ADDQ R13, DI + MOVQ R13, R12 + SUBQ $0x10, R12 + JB copy_2_small + +copy_2_loop: + MOVUPS (R11), X0 + MOVUPS X0, (BX) + ADDQ $0x10, R11 + ADDQ $0x10, BX + SUBQ $0x10, R12 + JAE copy_2_loop + LEAQ 16(R11)(R12*1), R11 + LEAQ 16(BX)(R12*1), BX + MOVUPS -16(R11), X0 + MOVUPS X0, -16(BX) + JMP copy_2_end + +copy_2_small: + CMPQ R13, $0x03 + JE copy_2_move_3 + JB copy_2_move_1or2 + CMPQ R13, $0x08 + JB copy_2_move_4through7 + JMP copy_2_move_8through16 + +copy_2_move_1or2: + MOVB (R11), R12 + MOVB -1(R11)(R13*1), R14 + MOVB R12, (BX) + MOVB R14, -1(BX)(R13*1) + ADDQ R13, R11 + ADDQ R13, BX + JMP copy_2_end + +copy_2_move_3: + MOVW (R11), R12 + MOVB 2(R11), R14 + MOVW R12, (BX) + MOVB R14, 2(BX) + ADDQ R13, R11 + ADDQ R13, BX + JMP copy_2_end + +copy_2_move_4through7: + MOVL (R11), R12 + MOVL -4(R11)(R13*1), R14 + MOVL R12, (BX) + MOVL R14, -4(BX)(R13*1) + ADDQ R13, R11 + ADDQ R13, BX + JMP copy_2_end + +copy_2_move_8through16: + MOVQ (R11), R12 + MOVQ -8(R11)(R13*1), R14 + MOVQ R12, (BX) + MOVQ R14, -8(BX)(R13*1) + ADDQ R13, R11 + ADDQ R13, BX + +copy_2_end: + JMP handle_loop + + // Copy overlapping match +copy_overlapping_match: + ADDQ R13, DI + +copy_slow_3: + MOVB (R11), R12 + MOVB R12, (BX) + INCQ R11 + INCQ BX + DECQ R13 + JNZ copy_slow_3 + +handle_loop: + ADDQ $0x18, AX + INCQ DX + CMPQ DX, CX + JB main_loop + +loop_finished: + // Return value + MOVB $0x01, ret+8(FP) + + // Update the context + MOVQ ctx+0(FP), AX + MOVQ DX, 24(AX) + MOVQ DI, 104(AX) + SUBQ 80(AX), SI + MOVQ SI, 112(AX) + RET + +error_match_off_too_big: + // Return value + MOVB $0x00, ret+8(FP) + + // Update the context + MOVQ ctx+0(FP), AX + MOVQ DX, 24(AX) + MOVQ DI, 104(AX) + SUBQ 80(AX), SI + MOVQ SI, 112(AX) + RET + +empty_seqs: + // Return value + MOVB $0x01, ret+8(FP) + RET + +// func sequenceDecs_decodeSync_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int +// Requires: CMOV, SSE +TEXT ·sequenceDecs_decodeSync_amd64(SB), $64-32 + MOVQ br+8(FP), CX + MOVQ 24(CX), DX + MOVBQZX 32(CX), BX + MOVQ (CX), AX + MOVQ 8(CX), SI + ADDQ SI, AX + MOVQ AX, (SP) + MOVQ ctx+16(FP), AX + MOVQ 72(AX), DI + MOVQ 80(AX), R8 + MOVQ 88(AX), R9 + XORQ CX, CX + MOVQ CX, 8(SP) + MOVQ CX, 16(SP) + MOVQ CX, 24(SP) + MOVQ 112(AX), R10 + MOVQ 128(AX), CX + MOVQ CX, 32(SP) + MOVQ 144(AX), R11 + MOVQ 136(AX), R12 + MOVQ 200(AX), CX + MOVQ CX, 56(SP) + MOVQ 176(AX), CX + MOVQ CX, 48(SP) + MOVQ 184(AX), AX + MOVQ AX, 40(SP) + MOVQ 40(SP), AX + ADDQ AX, 48(SP) + + // Calculate poiter to s.out[cap(s.out)] (a past-end pointer) + ADDQ R10, 32(SP) + + // outBase += outPosition + ADDQ R12, R10 + +sequenceDecs_decodeSync_amd64_main_loop: + MOVQ (SP), R13 + + // Fill bitreader to have enough for the offset and match length. + CMPQ SI, $0x08 + JL sequenceDecs_decodeSync_amd64_fill_byte_by_byte + MOVQ BX, AX + SHRQ $0x03, AX + SUBQ AX, R13 + MOVQ (R13), DX + SUBQ AX, SI + ANDQ $0x07, BX + JMP sequenceDecs_decodeSync_amd64_fill_end + +sequenceDecs_decodeSync_amd64_fill_byte_by_byte: + CMPQ SI, $0x00 + JLE sequenceDecs_decodeSync_amd64_fill_check_overread + CMPQ BX, $0x07 + JLE sequenceDecs_decodeSync_amd64_fill_end + SHLQ $0x08, DX + SUBQ $0x01, R13 + SUBQ $0x01, SI + SUBQ $0x08, BX + MOVBQZX (R13), AX + ORQ AX, DX + JMP sequenceDecs_decodeSync_amd64_fill_byte_by_byte + +sequenceDecs_decodeSync_amd64_fill_check_overread: + CMPQ BX, $0x40 + JA error_overread + +sequenceDecs_decodeSync_amd64_fill_end: + // Update offset + MOVQ R9, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + MOVB AH, CL + SHRQ $0x20, AX + TESTQ CX, CX + JZ sequenceDecs_decodeSync_amd64_of_update_zero + ADDQ CX, BX + CMPQ BX, $0x40 + JA sequenceDecs_decodeSync_amd64_of_update_zero + CMPQ CX, $0x40 + JAE sequenceDecs_decodeSync_amd64_of_update_zero + NEGQ CX + SHRQ CL, R14 + ADDQ R14, AX + +sequenceDecs_decodeSync_amd64_of_update_zero: + MOVQ AX, 8(SP) + + // Update match length + MOVQ R8, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + MOVB AH, CL + SHRQ $0x20, AX + TESTQ CX, CX + JZ sequenceDecs_decodeSync_amd64_ml_update_zero + ADDQ CX, BX + CMPQ BX, $0x40 + JA sequenceDecs_decodeSync_amd64_ml_update_zero + CMPQ CX, $0x40 + JAE sequenceDecs_decodeSync_amd64_ml_update_zero + NEGQ CX + SHRQ CL, R14 + ADDQ R14, AX + +sequenceDecs_decodeSync_amd64_ml_update_zero: + MOVQ AX, 16(SP) + + // Fill bitreader to have enough for the remaining + CMPQ SI, $0x08 + JL sequenceDecs_decodeSync_amd64_fill_2_byte_by_byte + MOVQ BX, AX + SHRQ $0x03, AX + SUBQ AX, R13 + MOVQ (R13), DX + SUBQ AX, SI + ANDQ $0x07, BX + JMP sequenceDecs_decodeSync_amd64_fill_2_end + +sequenceDecs_decodeSync_amd64_fill_2_byte_by_byte: + CMPQ SI, $0x00 + JLE sequenceDecs_decodeSync_amd64_fill_2_check_overread + CMPQ BX, $0x07 + JLE sequenceDecs_decodeSync_amd64_fill_2_end + SHLQ $0x08, DX + SUBQ $0x01, R13 + SUBQ $0x01, SI + SUBQ $0x08, BX + MOVBQZX (R13), AX + ORQ AX, DX + JMP sequenceDecs_decodeSync_amd64_fill_2_byte_by_byte + +sequenceDecs_decodeSync_amd64_fill_2_check_overread: + CMPQ BX, $0x40 + JA error_overread + +sequenceDecs_decodeSync_amd64_fill_2_end: + // Update literal length + MOVQ DI, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + MOVB AH, CL + SHRQ $0x20, AX + TESTQ CX, CX + JZ sequenceDecs_decodeSync_amd64_ll_update_zero + ADDQ CX, BX + CMPQ BX, $0x40 + JA sequenceDecs_decodeSync_amd64_ll_update_zero + CMPQ CX, $0x40 + JAE sequenceDecs_decodeSync_amd64_ll_update_zero + NEGQ CX + SHRQ CL, R14 + ADDQ R14, AX + +sequenceDecs_decodeSync_amd64_ll_update_zero: + MOVQ AX, 24(SP) + + // Fill bitreader for state updates + MOVQ R13, (SP) + MOVQ R9, AX + SHRQ $0x08, AX + MOVBQZX AL, AX + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decodeSync_amd64_skip_update + + // Update Literal Length State + MOVBQZX DI, R13 + SHRL $0x10, DI + LEAQ (BX)(R13*1), CX + MOVQ DX, R14 + MOVQ CX, BX + ROLQ CL, R14 + MOVL $0x00000001, R15 + MOVB R13, CL + SHLL CL, R15 + DECL R15 + ANDQ R15, R14 + ADDQ R14, DI + + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(DI*8), DI + + // Update Match Length State + MOVBQZX R8, R13 + SHRL $0x10, R8 + LEAQ (BX)(R13*1), CX + MOVQ DX, R14 + MOVQ CX, BX + ROLQ CL, R14 + MOVL $0x00000001, R15 + MOVB R13, CL + SHLL CL, R15 + DECL R15 + ANDQ R15, R14 + ADDQ R14, R8 + + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Offset State + MOVBQZX R9, R13 + SHRL $0x10, R9 + LEAQ (BX)(R13*1), CX + MOVQ DX, R14 + MOVQ CX, BX + ROLQ CL, R14 + MOVL $0x00000001, R15 + MOVB R13, CL + SHLL CL, R15 + DECL R15 + ANDQ R15, R14 + ADDQ R14, R9 + + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R9*8), R9 + +sequenceDecs_decodeSync_amd64_skip_update: + // Adjust offset + MOVQ s+0(FP), CX + MOVQ 8(SP), R13 + CMPQ AX, $0x01 + JBE sequenceDecs_decodeSync_amd64_adjust_offsetB_1_or_0 + MOVUPS 144(CX), X0 + MOVQ R13, 144(CX) + MOVUPS X0, 152(CX) + JMP sequenceDecs_decodeSync_amd64_after_adjust + +sequenceDecs_decodeSync_amd64_adjust_offsetB_1_or_0: + CMPQ 24(SP), $0x00000000 + JNE sequenceDecs_decodeSync_amd64_adjust_offset_maybezero + INCQ R13 + JMP sequenceDecs_decodeSync_amd64_adjust_offset_nonzero + +sequenceDecs_decodeSync_amd64_adjust_offset_maybezero: + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_amd64_adjust_offset_nonzero + MOVQ 144(CX), R13 + JMP sequenceDecs_decodeSync_amd64_after_adjust + +sequenceDecs_decodeSync_amd64_adjust_offset_nonzero: + MOVQ R13, AX + XORQ R14, R14 + MOVQ $-1, R15 + CMPQ R13, $0x03 + CMOVQEQ R14, AX + CMOVQEQ R15, R14 + ADDQ 144(CX)(AX*8), R14 + JNZ sequenceDecs_decodeSync_amd64_adjust_temp_valid + MOVQ $0x00000001, R14 + +sequenceDecs_decodeSync_amd64_adjust_temp_valid: + CMPQ R13, $0x01 + JZ sequenceDecs_decodeSync_amd64_adjust_skip + MOVQ 152(CX), AX + MOVQ AX, 160(CX) + +sequenceDecs_decodeSync_amd64_adjust_skip: + MOVQ 144(CX), AX + MOVQ AX, 152(CX) + MOVQ R14, 144(CX) + MOVQ R14, R13 + +sequenceDecs_decodeSync_amd64_after_adjust: + MOVQ R13, 8(SP) + + // Check values + MOVQ 16(SP), AX + MOVQ 24(SP), CX + LEAQ (AX)(CX*1), R14 + MOVQ s+0(FP), R15 + ADDQ R14, 256(R15) + MOVQ ctx+16(FP), R14 + SUBQ CX, 104(R14) + JS error_not_enough_literals + CMPQ AX, $0x00020002 + JA sequenceDecs_decodeSync_amd64_error_match_len_too_big + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_amd64_match_len_ofs_ok + TESTQ AX, AX + JNZ sequenceDecs_decodeSync_amd64_error_match_len_ofs_mismatch + +sequenceDecs_decodeSync_amd64_match_len_ofs_ok: + MOVQ 24(SP), AX + MOVQ 8(SP), CX + MOVQ 16(SP), R13 + + // Check if we have enough space in s.out + LEAQ (AX)(R13*1), R14 + ADDQ R10, R14 + CMPQ R14, 32(SP) + JA error_not_enough_space + + // Copy literals + TESTQ AX, AX + JZ check_offset + XORQ R14, R14 + +copy_1: + MOVUPS (R11)(R14*1), X0 + MOVUPS X0, (R10)(R14*1) + ADDQ $0x10, R14 + CMPQ R14, AX + JB copy_1 + ADDQ AX, R11 + ADDQ AX, R10 + ADDQ AX, R12 + + // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) +check_offset: + MOVQ R12, AX + ADDQ 40(SP), AX + CMPQ CX, AX + JG error_match_off_too_big + CMPQ CX, 56(SP) + JG error_match_off_too_big + + // Copy match from history + MOVQ CX, AX + SUBQ R12, AX + JLS copy_match + MOVQ 48(SP), R14 + SUBQ AX, R14 + CMPQ R13, AX + JG copy_all_from_history + MOVQ R13, AX + SUBQ $0x10, AX + JB copy_4_small + +copy_4_loop: + MOVUPS (R14), X0 + MOVUPS X0, (R10) + ADDQ $0x10, R14 + ADDQ $0x10, R10 + SUBQ $0x10, AX + JAE copy_4_loop + LEAQ 16(R14)(AX*1), R14 + LEAQ 16(R10)(AX*1), R10 + MOVUPS -16(R14), X0 + MOVUPS X0, -16(R10) + JMP copy_4_end + +copy_4_small: + CMPQ R13, $0x03 + JE copy_4_move_3 + CMPQ R13, $0x08 + JB copy_4_move_4through7 + JMP copy_4_move_8through16 + +copy_4_move_3: + MOVW (R14), AX + MOVB 2(R14), CL + MOVW AX, (R10) + MOVB CL, 2(R10) + ADDQ R13, R14 + ADDQ R13, R10 + JMP copy_4_end + +copy_4_move_4through7: + MOVL (R14), AX + MOVL -4(R14)(R13*1), CX + MOVL AX, (R10) + MOVL CX, -4(R10)(R13*1) + ADDQ R13, R14 + ADDQ R13, R10 + JMP copy_4_end + +copy_4_move_8through16: + MOVQ (R14), AX + MOVQ -8(R14)(R13*1), CX + MOVQ AX, (R10) + MOVQ CX, -8(R10)(R13*1) + ADDQ R13, R14 + ADDQ R13, R10 + +copy_4_end: + ADDQ R13, R12 + JMP handle_loop + JMP loop_finished + +copy_all_from_history: + MOVQ AX, R15 + SUBQ $0x10, R15 + JB copy_5_small + +copy_5_loop: + MOVUPS (R14), X0 + MOVUPS X0, (R10) + ADDQ $0x10, R14 + ADDQ $0x10, R10 + SUBQ $0x10, R15 + JAE copy_5_loop + LEAQ 16(R14)(R15*1), R14 + LEAQ 16(R10)(R15*1), R10 + MOVUPS -16(R14), X0 + MOVUPS X0, -16(R10) + JMP copy_5_end + +copy_5_small: + CMPQ AX, $0x03 + JE copy_5_move_3 + JB copy_5_move_1or2 + CMPQ AX, $0x08 + JB copy_5_move_4through7 + JMP copy_5_move_8through16 + +copy_5_move_1or2: + MOVB (R14), R15 + MOVB -1(R14)(AX*1), BP + MOVB R15, (R10) + MOVB BP, -1(R10)(AX*1) + ADDQ AX, R14 + ADDQ AX, R10 + JMP copy_5_end + +copy_5_move_3: + MOVW (R14), R15 + MOVB 2(R14), BP + MOVW R15, (R10) + MOVB BP, 2(R10) + ADDQ AX, R14 + ADDQ AX, R10 + JMP copy_5_end + +copy_5_move_4through7: + MOVL (R14), R15 + MOVL -4(R14)(AX*1), BP + MOVL R15, (R10) + MOVL BP, -4(R10)(AX*1) + ADDQ AX, R14 + ADDQ AX, R10 + JMP copy_5_end + +copy_5_move_8through16: + MOVQ (R14), R15 + MOVQ -8(R14)(AX*1), BP + MOVQ R15, (R10) + MOVQ BP, -8(R10)(AX*1) + ADDQ AX, R14 + ADDQ AX, R10 + +copy_5_end: + ADDQ AX, R12 + SUBQ AX, R13 + + // Copy match from the current buffer +copy_match: + MOVQ R10, AX + SUBQ CX, AX + + // ml <= mo + CMPQ R13, CX + JA copy_overlapping_match + + // Copy non-overlapping match + ADDQ R13, R12 + MOVQ R10, CX + ADDQ R13, R10 + +copy_2: + MOVUPS (AX), X0 + MOVUPS X0, (CX) + ADDQ $0x10, AX + ADDQ $0x10, CX + SUBQ $0x10, R13 + JHI copy_2 + JMP handle_loop + + // Copy overlapping match +copy_overlapping_match: + ADDQ R13, R12 + +copy_slow_3: + MOVB (AX), CL + MOVB CL, (R10) + INCQ AX + INCQ R10 + DECQ R13 + JNZ copy_slow_3 + +handle_loop: + MOVQ ctx+16(FP), AX + DECQ 96(AX) + JNS sequenceDecs_decodeSync_amd64_main_loop + +loop_finished: + MOVQ br+8(FP), AX + MOVQ DX, 24(AX) + MOVB BL, 32(AX) + MOVQ SI, 8(AX) + + // Update the context + MOVQ ctx+16(FP), AX + MOVQ R12, 136(AX) + MOVQ 144(AX), CX + SUBQ CX, R11 + MOVQ R11, 168(AX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decodeSync_amd64_error_match_len_ofs_mismatch: + MOVQ 16(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 216(CX) + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decodeSync_amd64_error_match_len_too_big: + MOVQ ctx+16(FP), AX + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error +error_match_off_too_big: + MOVQ ctx+16(FP), AX + MOVQ 8(SP), CX + MOVQ CX, 224(AX) + MOVQ R12, 136(AX) + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + + // Return with not enough output space error +error_not_enough_space: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ R12, 136(AX) + MOVQ $0x00000005, ret+24(FP) + RET + +// func sequenceDecs_decodeSync_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int +// Requires: BMI, BMI2, CMOV, SSE +TEXT ·sequenceDecs_decodeSync_bmi2(SB), $64-32 + MOVQ br+8(FP), BX + MOVQ 24(BX), AX + MOVBQZX 32(BX), DX + MOVQ (BX), CX + MOVQ 8(BX), BX + ADDQ BX, CX + MOVQ CX, (SP) + MOVQ ctx+16(FP), CX + MOVQ 72(CX), SI + MOVQ 80(CX), DI + MOVQ 88(CX), R8 + XORQ R9, R9 + MOVQ R9, 8(SP) + MOVQ R9, 16(SP) + MOVQ R9, 24(SP) + MOVQ 112(CX), R9 + MOVQ 128(CX), R10 + MOVQ R10, 32(SP) + MOVQ 144(CX), R10 + MOVQ 136(CX), R11 + MOVQ 200(CX), R12 + MOVQ R12, 56(SP) + MOVQ 176(CX), R12 + MOVQ R12, 48(SP) + MOVQ 184(CX), CX + MOVQ CX, 40(SP) + MOVQ 40(SP), CX + ADDQ CX, 48(SP) + + // Calculate poiter to s.out[cap(s.out)] (a past-end pointer) + ADDQ R9, 32(SP) + + // outBase += outPosition + ADDQ R11, R9 + +sequenceDecs_decodeSync_bmi2_main_loop: + MOVQ (SP), R12 + + // Fill bitreader to have enough for the offset and match length. + CMPQ BX, $0x08 + JL sequenceDecs_decodeSync_bmi2_fill_byte_by_byte + MOVQ DX, CX + SHRQ $0x03, CX + SUBQ CX, R12 + MOVQ (R12), AX + SUBQ CX, BX + ANDQ $0x07, DX + JMP sequenceDecs_decodeSync_bmi2_fill_end + +sequenceDecs_decodeSync_bmi2_fill_byte_by_byte: + CMPQ BX, $0x00 + JLE sequenceDecs_decodeSync_bmi2_fill_check_overread + CMPQ DX, $0x07 + JLE sequenceDecs_decodeSync_bmi2_fill_end + SHLQ $0x08, AX + SUBQ $0x01, R12 + SUBQ $0x01, BX + SUBQ $0x08, DX + MOVBQZX (R12), CX + ORQ CX, AX + JMP sequenceDecs_decodeSync_bmi2_fill_byte_by_byte + +sequenceDecs_decodeSync_bmi2_fill_check_overread: + CMPQ DX, $0x40 + JA error_overread + +sequenceDecs_decodeSync_bmi2_fill_end: + // Update offset + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R13 + MOVQ AX, R14 + LEAQ (DX)(R13*1), CX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + MOVQ CX, DX + MOVQ R8, CX + SHRQ $0x20, CX + ADDQ R14, CX + MOVQ CX, 8(SP) + + // Update match length + MOVQ $0x00000808, CX + BEXTRQ CX, DI, R13 + MOVQ AX, R14 + LEAQ (DX)(R13*1), CX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + MOVQ CX, DX + MOVQ DI, CX + SHRQ $0x20, CX + ADDQ R14, CX + MOVQ CX, 16(SP) + + // Fill bitreader to have enough for the remaining + CMPQ BX, $0x08 + JL sequenceDecs_decodeSync_bmi2_fill_2_byte_by_byte + MOVQ DX, CX + SHRQ $0x03, CX + SUBQ CX, R12 + MOVQ (R12), AX + SUBQ CX, BX + ANDQ $0x07, DX + JMP sequenceDecs_decodeSync_bmi2_fill_2_end + +sequenceDecs_decodeSync_bmi2_fill_2_byte_by_byte: + CMPQ BX, $0x00 + JLE sequenceDecs_decodeSync_bmi2_fill_2_check_overread + CMPQ DX, $0x07 + JLE sequenceDecs_decodeSync_bmi2_fill_2_end + SHLQ $0x08, AX + SUBQ $0x01, R12 + SUBQ $0x01, BX + SUBQ $0x08, DX + MOVBQZX (R12), CX + ORQ CX, AX + JMP sequenceDecs_decodeSync_bmi2_fill_2_byte_by_byte + +sequenceDecs_decodeSync_bmi2_fill_2_check_overread: + CMPQ DX, $0x40 + JA error_overread + +sequenceDecs_decodeSync_bmi2_fill_2_end: + // Update literal length + MOVQ $0x00000808, CX + BEXTRQ CX, SI, R13 + MOVQ AX, R14 + LEAQ (DX)(R13*1), CX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + MOVQ CX, DX + MOVQ SI, CX + SHRQ $0x20, CX + ADDQ R14, CX + MOVQ CX, 24(SP) + + // Fill bitreader for state updates + MOVQ R12, (SP) + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R12 + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decodeSync_bmi2_skip_update + LEAQ (SI)(DI*1), R13 + ADDQ R8, R13 + MOVBQZX R13, R13 + LEAQ (DX)(R13*1), CX + MOVQ AX, R14 + MOVQ CX, DX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + + // Update Offset State + BZHIQ R8, R14, CX + SHRXQ R8, R14, R14 + SHRL $0x10, R8 + ADDQ CX, R8 + + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Match Length State + BZHIQ DI, R14, CX + SHRXQ DI, R14, R14 + SHRL $0x10, DI + ADDQ CX, DI + + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(DI*8), DI + + // Update Literal Length State + BZHIQ SI, R14, CX + SHRL $0x10, SI + ADDQ CX, SI + + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(SI*8), SI + +sequenceDecs_decodeSync_bmi2_skip_update: + // Adjust offset + MOVQ s+0(FP), CX + MOVQ 8(SP), R13 + CMPQ R12, $0x01 + JBE sequenceDecs_decodeSync_bmi2_adjust_offsetB_1_or_0 + MOVUPS 144(CX), X0 + MOVQ R13, 144(CX) + MOVUPS X0, 152(CX) + JMP sequenceDecs_decodeSync_bmi2_after_adjust + +sequenceDecs_decodeSync_bmi2_adjust_offsetB_1_or_0: + CMPQ 24(SP), $0x00000000 + JNE sequenceDecs_decodeSync_bmi2_adjust_offset_maybezero + INCQ R13 + JMP sequenceDecs_decodeSync_bmi2_adjust_offset_nonzero + +sequenceDecs_decodeSync_bmi2_adjust_offset_maybezero: + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_bmi2_adjust_offset_nonzero + MOVQ 144(CX), R13 + JMP sequenceDecs_decodeSync_bmi2_after_adjust + +sequenceDecs_decodeSync_bmi2_adjust_offset_nonzero: + MOVQ R13, R12 + XORQ R14, R14 + MOVQ $-1, R15 + CMPQ R13, $0x03 + CMOVQEQ R14, R12 + CMOVQEQ R15, R14 + ADDQ 144(CX)(R12*8), R14 + JNZ sequenceDecs_decodeSync_bmi2_adjust_temp_valid + MOVQ $0x00000001, R14 + +sequenceDecs_decodeSync_bmi2_adjust_temp_valid: + CMPQ R13, $0x01 + JZ sequenceDecs_decodeSync_bmi2_adjust_skip + MOVQ 152(CX), R12 + MOVQ R12, 160(CX) + +sequenceDecs_decodeSync_bmi2_adjust_skip: + MOVQ 144(CX), R12 + MOVQ R12, 152(CX) + MOVQ R14, 144(CX) + MOVQ R14, R13 + +sequenceDecs_decodeSync_bmi2_after_adjust: + MOVQ R13, 8(SP) + + // Check values + MOVQ 16(SP), CX + MOVQ 24(SP), R12 + LEAQ (CX)(R12*1), R14 + MOVQ s+0(FP), R15 + ADDQ R14, 256(R15) + MOVQ ctx+16(FP), R14 + SUBQ R12, 104(R14) + JS error_not_enough_literals + CMPQ CX, $0x00020002 + JA sequenceDecs_decodeSync_bmi2_error_match_len_too_big + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_bmi2_match_len_ofs_ok + TESTQ CX, CX + JNZ sequenceDecs_decodeSync_bmi2_error_match_len_ofs_mismatch + +sequenceDecs_decodeSync_bmi2_match_len_ofs_ok: + MOVQ 24(SP), CX + MOVQ 8(SP), R12 + MOVQ 16(SP), R13 + + // Check if we have enough space in s.out + LEAQ (CX)(R13*1), R14 + ADDQ R9, R14 + CMPQ R14, 32(SP) + JA error_not_enough_space + + // Copy literals + TESTQ CX, CX + JZ check_offset + XORQ R14, R14 + +copy_1: + MOVUPS (R10)(R14*1), X0 + MOVUPS X0, (R9)(R14*1) + ADDQ $0x10, R14 + CMPQ R14, CX + JB copy_1 + ADDQ CX, R10 + ADDQ CX, R9 + ADDQ CX, R11 + + // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) +check_offset: + MOVQ R11, CX + ADDQ 40(SP), CX + CMPQ R12, CX + JG error_match_off_too_big + CMPQ R12, 56(SP) + JG error_match_off_too_big + + // Copy match from history + MOVQ R12, CX + SUBQ R11, CX + JLS copy_match + MOVQ 48(SP), R14 + SUBQ CX, R14 + CMPQ R13, CX + JG copy_all_from_history + MOVQ R13, CX + SUBQ $0x10, CX + JB copy_4_small + +copy_4_loop: + MOVUPS (R14), X0 + MOVUPS X0, (R9) + ADDQ $0x10, R14 + ADDQ $0x10, R9 + SUBQ $0x10, CX + JAE copy_4_loop + LEAQ 16(R14)(CX*1), R14 + LEAQ 16(R9)(CX*1), R9 + MOVUPS -16(R14), X0 + MOVUPS X0, -16(R9) + JMP copy_4_end + +copy_4_small: + CMPQ R13, $0x03 + JE copy_4_move_3 + CMPQ R13, $0x08 + JB copy_4_move_4through7 + JMP copy_4_move_8through16 + +copy_4_move_3: + MOVW (R14), CX + MOVB 2(R14), R12 + MOVW CX, (R9) + MOVB R12, 2(R9) + ADDQ R13, R14 + ADDQ R13, R9 + JMP copy_4_end + +copy_4_move_4through7: + MOVL (R14), CX + MOVL -4(R14)(R13*1), R12 + MOVL CX, (R9) + MOVL R12, -4(R9)(R13*1) + ADDQ R13, R14 + ADDQ R13, R9 + JMP copy_4_end + +copy_4_move_8through16: + MOVQ (R14), CX + MOVQ -8(R14)(R13*1), R12 + MOVQ CX, (R9) + MOVQ R12, -8(R9)(R13*1) + ADDQ R13, R14 + ADDQ R13, R9 + +copy_4_end: + ADDQ R13, R11 + JMP handle_loop + JMP loop_finished + +copy_all_from_history: + MOVQ CX, R15 + SUBQ $0x10, R15 + JB copy_5_small + +copy_5_loop: + MOVUPS (R14), X0 + MOVUPS X0, (R9) + ADDQ $0x10, R14 + ADDQ $0x10, R9 + SUBQ $0x10, R15 + JAE copy_5_loop + LEAQ 16(R14)(R15*1), R14 + LEAQ 16(R9)(R15*1), R9 + MOVUPS -16(R14), X0 + MOVUPS X0, -16(R9) + JMP copy_5_end + +copy_5_small: + CMPQ CX, $0x03 + JE copy_5_move_3 + JB copy_5_move_1or2 + CMPQ CX, $0x08 + JB copy_5_move_4through7 + JMP copy_5_move_8through16 + +copy_5_move_1or2: + MOVB (R14), R15 + MOVB -1(R14)(CX*1), BP + MOVB R15, (R9) + MOVB BP, -1(R9)(CX*1) + ADDQ CX, R14 + ADDQ CX, R9 + JMP copy_5_end + +copy_5_move_3: + MOVW (R14), R15 + MOVB 2(R14), BP + MOVW R15, (R9) + MOVB BP, 2(R9) + ADDQ CX, R14 + ADDQ CX, R9 + JMP copy_5_end + +copy_5_move_4through7: + MOVL (R14), R15 + MOVL -4(R14)(CX*1), BP + MOVL R15, (R9) + MOVL BP, -4(R9)(CX*1) + ADDQ CX, R14 + ADDQ CX, R9 + JMP copy_5_end + +copy_5_move_8through16: + MOVQ (R14), R15 + MOVQ -8(R14)(CX*1), BP + MOVQ R15, (R9) + MOVQ BP, -8(R9)(CX*1) + ADDQ CX, R14 + ADDQ CX, R9 + +copy_5_end: + ADDQ CX, R11 + SUBQ CX, R13 + + // Copy match from the current buffer +copy_match: + MOVQ R9, CX + SUBQ R12, CX + + // ml <= mo + CMPQ R13, R12 + JA copy_overlapping_match + + // Copy non-overlapping match + ADDQ R13, R11 + MOVQ R9, R12 + ADDQ R13, R9 + +copy_2: + MOVUPS (CX), X0 + MOVUPS X0, (R12) + ADDQ $0x10, CX + ADDQ $0x10, R12 + SUBQ $0x10, R13 + JHI copy_2 + JMP handle_loop + + // Copy overlapping match +copy_overlapping_match: + ADDQ R13, R11 + +copy_slow_3: + MOVB (CX), R12 + MOVB R12, (R9) + INCQ CX + INCQ R9 + DECQ R13 + JNZ copy_slow_3 + +handle_loop: + MOVQ ctx+16(FP), CX + DECQ 96(CX) + JNS sequenceDecs_decodeSync_bmi2_main_loop + +loop_finished: + MOVQ br+8(FP), CX + MOVQ AX, 24(CX) + MOVB DL, 32(CX) + MOVQ BX, 8(CX) + + // Update the context + MOVQ ctx+16(FP), AX + MOVQ R11, 136(AX) + MOVQ 144(AX), CX + SUBQ CX, R10 + MOVQ R10, 168(AX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decodeSync_bmi2_error_match_len_ofs_mismatch: + MOVQ 16(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 216(CX) + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decodeSync_bmi2_error_match_len_too_big: + MOVQ ctx+16(FP), AX + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error +error_match_off_too_big: + MOVQ ctx+16(FP), AX + MOVQ 8(SP), CX + MOVQ CX, 224(AX) + MOVQ R11, 136(AX) + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + + // Return with not enough output space error +error_not_enough_space: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ R11, 136(AX) + MOVQ $0x00000005, ret+24(FP) + RET + +// func sequenceDecs_decodeSync_safe_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int +// Requires: CMOV, SSE +TEXT ·sequenceDecs_decodeSync_safe_amd64(SB), $64-32 + MOVQ br+8(FP), CX + MOVQ 24(CX), DX + MOVBQZX 32(CX), BX + MOVQ (CX), AX + MOVQ 8(CX), SI + ADDQ SI, AX + MOVQ AX, (SP) + MOVQ ctx+16(FP), AX + MOVQ 72(AX), DI + MOVQ 80(AX), R8 + MOVQ 88(AX), R9 + XORQ CX, CX + MOVQ CX, 8(SP) + MOVQ CX, 16(SP) + MOVQ CX, 24(SP) + MOVQ 112(AX), R10 + MOVQ 128(AX), CX + MOVQ CX, 32(SP) + MOVQ 144(AX), R11 + MOVQ 136(AX), R12 + MOVQ 200(AX), CX + MOVQ CX, 56(SP) + MOVQ 176(AX), CX + MOVQ CX, 48(SP) + MOVQ 184(AX), AX + MOVQ AX, 40(SP) + MOVQ 40(SP), AX + ADDQ AX, 48(SP) + + // Calculate poiter to s.out[cap(s.out)] (a past-end pointer) + ADDQ R10, 32(SP) + + // outBase += outPosition + ADDQ R12, R10 + +sequenceDecs_decodeSync_safe_amd64_main_loop: + MOVQ (SP), R13 + + // Fill bitreader to have enough for the offset and match length. + CMPQ SI, $0x08 + JL sequenceDecs_decodeSync_safe_amd64_fill_byte_by_byte + MOVQ BX, AX + SHRQ $0x03, AX + SUBQ AX, R13 + MOVQ (R13), DX + SUBQ AX, SI + ANDQ $0x07, BX + JMP sequenceDecs_decodeSync_safe_amd64_fill_end + +sequenceDecs_decodeSync_safe_amd64_fill_byte_by_byte: + CMPQ SI, $0x00 + JLE sequenceDecs_decodeSync_safe_amd64_fill_check_overread + CMPQ BX, $0x07 + JLE sequenceDecs_decodeSync_safe_amd64_fill_end + SHLQ $0x08, DX + SUBQ $0x01, R13 + SUBQ $0x01, SI + SUBQ $0x08, BX + MOVBQZX (R13), AX + ORQ AX, DX + JMP sequenceDecs_decodeSync_safe_amd64_fill_byte_by_byte + +sequenceDecs_decodeSync_safe_amd64_fill_check_overread: + CMPQ BX, $0x40 + JA error_overread + +sequenceDecs_decodeSync_safe_amd64_fill_end: + // Update offset + MOVQ R9, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + MOVB AH, CL + SHRQ $0x20, AX + TESTQ CX, CX + JZ sequenceDecs_decodeSync_safe_amd64_of_update_zero + ADDQ CX, BX + CMPQ BX, $0x40 + JA sequenceDecs_decodeSync_safe_amd64_of_update_zero + CMPQ CX, $0x40 + JAE sequenceDecs_decodeSync_safe_amd64_of_update_zero + NEGQ CX + SHRQ CL, R14 + ADDQ R14, AX + +sequenceDecs_decodeSync_safe_amd64_of_update_zero: + MOVQ AX, 8(SP) + + // Update match length + MOVQ R8, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + MOVB AH, CL + SHRQ $0x20, AX + TESTQ CX, CX + JZ sequenceDecs_decodeSync_safe_amd64_ml_update_zero + ADDQ CX, BX + CMPQ BX, $0x40 + JA sequenceDecs_decodeSync_safe_amd64_ml_update_zero + CMPQ CX, $0x40 + JAE sequenceDecs_decodeSync_safe_amd64_ml_update_zero + NEGQ CX + SHRQ CL, R14 + ADDQ R14, AX + +sequenceDecs_decodeSync_safe_amd64_ml_update_zero: + MOVQ AX, 16(SP) + + // Fill bitreader to have enough for the remaining + CMPQ SI, $0x08 + JL sequenceDecs_decodeSync_safe_amd64_fill_2_byte_by_byte + MOVQ BX, AX + SHRQ $0x03, AX + SUBQ AX, R13 + MOVQ (R13), DX + SUBQ AX, SI + ANDQ $0x07, BX + JMP sequenceDecs_decodeSync_safe_amd64_fill_2_end + +sequenceDecs_decodeSync_safe_amd64_fill_2_byte_by_byte: + CMPQ SI, $0x00 + JLE sequenceDecs_decodeSync_safe_amd64_fill_2_check_overread + CMPQ BX, $0x07 + JLE sequenceDecs_decodeSync_safe_amd64_fill_2_end + SHLQ $0x08, DX + SUBQ $0x01, R13 + SUBQ $0x01, SI + SUBQ $0x08, BX + MOVBQZX (R13), AX + ORQ AX, DX + JMP sequenceDecs_decodeSync_safe_amd64_fill_2_byte_by_byte + +sequenceDecs_decodeSync_safe_amd64_fill_2_check_overread: + CMPQ BX, $0x40 + JA error_overread + +sequenceDecs_decodeSync_safe_amd64_fill_2_end: + // Update literal length + MOVQ DI, AX + MOVQ BX, CX + MOVQ DX, R14 + SHLQ CL, R14 + MOVB AH, CL + SHRQ $0x20, AX + TESTQ CX, CX + JZ sequenceDecs_decodeSync_safe_amd64_ll_update_zero + ADDQ CX, BX + CMPQ BX, $0x40 + JA sequenceDecs_decodeSync_safe_amd64_ll_update_zero + CMPQ CX, $0x40 + JAE sequenceDecs_decodeSync_safe_amd64_ll_update_zero + NEGQ CX + SHRQ CL, R14 + ADDQ R14, AX + +sequenceDecs_decodeSync_safe_amd64_ll_update_zero: + MOVQ AX, 24(SP) + + // Fill bitreader for state updates + MOVQ R13, (SP) + MOVQ R9, AX + SHRQ $0x08, AX + MOVBQZX AL, AX + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decodeSync_safe_amd64_skip_update + + // Update Literal Length State + MOVBQZX DI, R13 + SHRL $0x10, DI + LEAQ (BX)(R13*1), CX + MOVQ DX, R14 + MOVQ CX, BX + ROLQ CL, R14 + MOVL $0x00000001, R15 + MOVB R13, CL + SHLL CL, R15 + DECL R15 + ANDQ R15, R14 + ADDQ R14, DI + + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(DI*8), DI + + // Update Match Length State + MOVBQZX R8, R13 + SHRL $0x10, R8 + LEAQ (BX)(R13*1), CX + MOVQ DX, R14 + MOVQ CX, BX + ROLQ CL, R14 + MOVL $0x00000001, R15 + MOVB R13, CL + SHLL CL, R15 + DECL R15 + ANDQ R15, R14 + ADDQ R14, R8 + + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Offset State + MOVBQZX R9, R13 + SHRL $0x10, R9 + LEAQ (BX)(R13*1), CX + MOVQ DX, R14 + MOVQ CX, BX + ROLQ CL, R14 + MOVL $0x00000001, R15 + MOVB R13, CL + SHLL CL, R15 + DECL R15 + ANDQ R15, R14 + ADDQ R14, R9 + + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R9*8), R9 + +sequenceDecs_decodeSync_safe_amd64_skip_update: + // Adjust offset + MOVQ s+0(FP), CX + MOVQ 8(SP), R13 + CMPQ AX, $0x01 + JBE sequenceDecs_decodeSync_safe_amd64_adjust_offsetB_1_or_0 + MOVUPS 144(CX), X0 + MOVQ R13, 144(CX) + MOVUPS X0, 152(CX) + JMP sequenceDecs_decodeSync_safe_amd64_after_adjust + +sequenceDecs_decodeSync_safe_amd64_adjust_offsetB_1_or_0: + CMPQ 24(SP), $0x00000000 + JNE sequenceDecs_decodeSync_safe_amd64_adjust_offset_maybezero + INCQ R13 + JMP sequenceDecs_decodeSync_safe_amd64_adjust_offset_nonzero + +sequenceDecs_decodeSync_safe_amd64_adjust_offset_maybezero: + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_safe_amd64_adjust_offset_nonzero + MOVQ 144(CX), R13 + JMP sequenceDecs_decodeSync_safe_amd64_after_adjust + +sequenceDecs_decodeSync_safe_amd64_adjust_offset_nonzero: + MOVQ R13, AX + XORQ R14, R14 + MOVQ $-1, R15 + CMPQ R13, $0x03 + CMOVQEQ R14, AX + CMOVQEQ R15, R14 + ADDQ 144(CX)(AX*8), R14 + JNZ sequenceDecs_decodeSync_safe_amd64_adjust_temp_valid + MOVQ $0x00000001, R14 + +sequenceDecs_decodeSync_safe_amd64_adjust_temp_valid: + CMPQ R13, $0x01 + JZ sequenceDecs_decodeSync_safe_amd64_adjust_skip + MOVQ 152(CX), AX + MOVQ AX, 160(CX) + +sequenceDecs_decodeSync_safe_amd64_adjust_skip: + MOVQ 144(CX), AX + MOVQ AX, 152(CX) + MOVQ R14, 144(CX) + MOVQ R14, R13 + +sequenceDecs_decodeSync_safe_amd64_after_adjust: + MOVQ R13, 8(SP) + + // Check values + MOVQ 16(SP), AX + MOVQ 24(SP), CX + LEAQ (AX)(CX*1), R14 + MOVQ s+0(FP), R15 + ADDQ R14, 256(R15) + MOVQ ctx+16(FP), R14 + SUBQ CX, 104(R14) + JS error_not_enough_literals + CMPQ AX, $0x00020002 + JA sequenceDecs_decodeSync_safe_amd64_error_match_len_too_big + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_safe_amd64_match_len_ofs_ok + TESTQ AX, AX + JNZ sequenceDecs_decodeSync_safe_amd64_error_match_len_ofs_mismatch + +sequenceDecs_decodeSync_safe_amd64_match_len_ofs_ok: + MOVQ 24(SP), AX + MOVQ 8(SP), CX + MOVQ 16(SP), R13 + + // Check if we have enough space in s.out + LEAQ (AX)(R13*1), R14 + ADDQ R10, R14 + CMPQ R14, 32(SP) + JA error_not_enough_space + + // Copy literals + TESTQ AX, AX + JZ check_offset + MOVQ AX, R14 + SUBQ $0x10, R14 + JB copy_1_small + +copy_1_loop: + MOVUPS (R11), X0 + MOVUPS X0, (R10) + ADDQ $0x10, R11 + ADDQ $0x10, R10 + SUBQ $0x10, R14 + JAE copy_1_loop + LEAQ 16(R11)(R14*1), R11 + LEAQ 16(R10)(R14*1), R10 + MOVUPS -16(R11), X0 + MOVUPS X0, -16(R10) + JMP copy_1_end + +copy_1_small: + CMPQ AX, $0x03 + JE copy_1_move_3 + JB copy_1_move_1or2 + CMPQ AX, $0x08 + JB copy_1_move_4through7 + JMP copy_1_move_8through16 + +copy_1_move_1or2: + MOVB (R11), R14 + MOVB -1(R11)(AX*1), R15 + MOVB R14, (R10) + MOVB R15, -1(R10)(AX*1) + ADDQ AX, R11 + ADDQ AX, R10 + JMP copy_1_end + +copy_1_move_3: + MOVW (R11), R14 + MOVB 2(R11), R15 + MOVW R14, (R10) + MOVB R15, 2(R10) + ADDQ AX, R11 + ADDQ AX, R10 + JMP copy_1_end + +copy_1_move_4through7: + MOVL (R11), R14 + MOVL -4(R11)(AX*1), R15 + MOVL R14, (R10) + MOVL R15, -4(R10)(AX*1) + ADDQ AX, R11 + ADDQ AX, R10 + JMP copy_1_end + +copy_1_move_8through16: + MOVQ (R11), R14 + MOVQ -8(R11)(AX*1), R15 + MOVQ R14, (R10) + MOVQ R15, -8(R10)(AX*1) + ADDQ AX, R11 + ADDQ AX, R10 + +copy_1_end: + ADDQ AX, R12 + + // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) +check_offset: + MOVQ R12, AX + ADDQ 40(SP), AX + CMPQ CX, AX + JG error_match_off_too_big + CMPQ CX, 56(SP) + JG error_match_off_too_big + + // Copy match from history + MOVQ CX, AX + SUBQ R12, AX + JLS copy_match + MOVQ 48(SP), R14 + SUBQ AX, R14 + CMPQ R13, AX + JG copy_all_from_history + MOVQ R13, AX + SUBQ $0x10, AX + JB copy_4_small + +copy_4_loop: + MOVUPS (R14), X0 + MOVUPS X0, (R10) + ADDQ $0x10, R14 + ADDQ $0x10, R10 + SUBQ $0x10, AX + JAE copy_4_loop + LEAQ 16(R14)(AX*1), R14 + LEAQ 16(R10)(AX*1), R10 + MOVUPS -16(R14), X0 + MOVUPS X0, -16(R10) + JMP copy_4_end + +copy_4_small: + CMPQ R13, $0x03 + JE copy_4_move_3 + CMPQ R13, $0x08 + JB copy_4_move_4through7 + JMP copy_4_move_8through16 + +copy_4_move_3: + MOVW (R14), AX + MOVB 2(R14), CL + MOVW AX, (R10) + MOVB CL, 2(R10) + ADDQ R13, R14 + ADDQ R13, R10 + JMP copy_4_end + +copy_4_move_4through7: + MOVL (R14), AX + MOVL -4(R14)(R13*1), CX + MOVL AX, (R10) + MOVL CX, -4(R10)(R13*1) + ADDQ R13, R14 + ADDQ R13, R10 + JMP copy_4_end + +copy_4_move_8through16: + MOVQ (R14), AX + MOVQ -8(R14)(R13*1), CX + MOVQ AX, (R10) + MOVQ CX, -8(R10)(R13*1) + ADDQ R13, R14 + ADDQ R13, R10 + +copy_4_end: + ADDQ R13, R12 + JMP handle_loop + JMP loop_finished + +copy_all_from_history: + MOVQ AX, R15 + SUBQ $0x10, R15 + JB copy_5_small + +copy_5_loop: + MOVUPS (R14), X0 + MOVUPS X0, (R10) + ADDQ $0x10, R14 + ADDQ $0x10, R10 + SUBQ $0x10, R15 + JAE copy_5_loop + LEAQ 16(R14)(R15*1), R14 + LEAQ 16(R10)(R15*1), R10 + MOVUPS -16(R14), X0 + MOVUPS X0, -16(R10) + JMP copy_5_end + +copy_5_small: + CMPQ AX, $0x03 + JE copy_5_move_3 + JB copy_5_move_1or2 + CMPQ AX, $0x08 + JB copy_5_move_4through7 + JMP copy_5_move_8through16 + +copy_5_move_1or2: + MOVB (R14), R15 + MOVB -1(R14)(AX*1), BP + MOVB R15, (R10) + MOVB BP, -1(R10)(AX*1) + ADDQ AX, R14 + ADDQ AX, R10 + JMP copy_5_end + +copy_5_move_3: + MOVW (R14), R15 + MOVB 2(R14), BP + MOVW R15, (R10) + MOVB BP, 2(R10) + ADDQ AX, R14 + ADDQ AX, R10 + JMP copy_5_end + +copy_5_move_4through7: + MOVL (R14), R15 + MOVL -4(R14)(AX*1), BP + MOVL R15, (R10) + MOVL BP, -4(R10)(AX*1) + ADDQ AX, R14 + ADDQ AX, R10 + JMP copy_5_end + +copy_5_move_8through16: + MOVQ (R14), R15 + MOVQ -8(R14)(AX*1), BP + MOVQ R15, (R10) + MOVQ BP, -8(R10)(AX*1) + ADDQ AX, R14 + ADDQ AX, R10 + +copy_5_end: + ADDQ AX, R12 + SUBQ AX, R13 + + // Copy match from the current buffer +copy_match: + MOVQ R10, AX + SUBQ CX, AX + + // ml <= mo + CMPQ R13, CX + JA copy_overlapping_match + + // Copy non-overlapping match + ADDQ R13, R12 + MOVQ R13, CX + SUBQ $0x10, CX + JB copy_2_small + +copy_2_loop: + MOVUPS (AX), X0 + MOVUPS X0, (R10) + ADDQ $0x10, AX + ADDQ $0x10, R10 + SUBQ $0x10, CX + JAE copy_2_loop + LEAQ 16(AX)(CX*1), AX + LEAQ 16(R10)(CX*1), R10 + MOVUPS -16(AX), X0 + MOVUPS X0, -16(R10) + JMP copy_2_end + +copy_2_small: + CMPQ R13, $0x03 + JE copy_2_move_3 + JB copy_2_move_1or2 + CMPQ R13, $0x08 + JB copy_2_move_4through7 + JMP copy_2_move_8through16 + +copy_2_move_1or2: + MOVB (AX), CL + MOVB -1(AX)(R13*1), R14 + MOVB CL, (R10) + MOVB R14, -1(R10)(R13*1) + ADDQ R13, AX + ADDQ R13, R10 + JMP copy_2_end + +copy_2_move_3: + MOVW (AX), CX + MOVB 2(AX), R14 + MOVW CX, (R10) + MOVB R14, 2(R10) + ADDQ R13, AX + ADDQ R13, R10 + JMP copy_2_end + +copy_2_move_4through7: + MOVL (AX), CX + MOVL -4(AX)(R13*1), R14 + MOVL CX, (R10) + MOVL R14, -4(R10)(R13*1) + ADDQ R13, AX + ADDQ R13, R10 + JMP copy_2_end + +copy_2_move_8through16: + MOVQ (AX), CX + MOVQ -8(AX)(R13*1), R14 + MOVQ CX, (R10) + MOVQ R14, -8(R10)(R13*1) + ADDQ R13, AX + ADDQ R13, R10 + +copy_2_end: + JMP handle_loop + + // Copy overlapping match +copy_overlapping_match: + ADDQ R13, R12 + +copy_slow_3: + MOVB (AX), CL + MOVB CL, (R10) + INCQ AX + INCQ R10 + DECQ R13 + JNZ copy_slow_3 + +handle_loop: + MOVQ ctx+16(FP), AX + DECQ 96(AX) + JNS sequenceDecs_decodeSync_safe_amd64_main_loop + +loop_finished: + MOVQ br+8(FP), AX + MOVQ DX, 24(AX) + MOVB BL, 32(AX) + MOVQ SI, 8(AX) + + // Update the context + MOVQ ctx+16(FP), AX + MOVQ R12, 136(AX) + MOVQ 144(AX), CX + SUBQ CX, R11 + MOVQ R11, 168(AX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decodeSync_safe_amd64_error_match_len_ofs_mismatch: + MOVQ 16(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 216(CX) + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decodeSync_safe_amd64_error_match_len_too_big: + MOVQ ctx+16(FP), AX + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error +error_match_off_too_big: + MOVQ ctx+16(FP), AX + MOVQ 8(SP), CX + MOVQ CX, 224(AX) + MOVQ R12, 136(AX) + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + + // Return with not enough output space error +error_not_enough_space: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ R12, 136(AX) + MOVQ $0x00000005, ret+24(FP) + RET + +// func sequenceDecs_decodeSync_safe_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int +// Requires: BMI, BMI2, CMOV, SSE +TEXT ·sequenceDecs_decodeSync_safe_bmi2(SB), $64-32 + MOVQ br+8(FP), BX + MOVQ 24(BX), AX + MOVBQZX 32(BX), DX + MOVQ (BX), CX + MOVQ 8(BX), BX + ADDQ BX, CX + MOVQ CX, (SP) + MOVQ ctx+16(FP), CX + MOVQ 72(CX), SI + MOVQ 80(CX), DI + MOVQ 88(CX), R8 + XORQ R9, R9 + MOVQ R9, 8(SP) + MOVQ R9, 16(SP) + MOVQ R9, 24(SP) + MOVQ 112(CX), R9 + MOVQ 128(CX), R10 + MOVQ R10, 32(SP) + MOVQ 144(CX), R10 + MOVQ 136(CX), R11 + MOVQ 200(CX), R12 + MOVQ R12, 56(SP) + MOVQ 176(CX), R12 + MOVQ R12, 48(SP) + MOVQ 184(CX), CX + MOVQ CX, 40(SP) + MOVQ 40(SP), CX + ADDQ CX, 48(SP) + + // Calculate poiter to s.out[cap(s.out)] (a past-end pointer) + ADDQ R9, 32(SP) + + // outBase += outPosition + ADDQ R11, R9 + +sequenceDecs_decodeSync_safe_bmi2_main_loop: + MOVQ (SP), R12 + + // Fill bitreader to have enough for the offset and match length. + CMPQ BX, $0x08 + JL sequenceDecs_decodeSync_safe_bmi2_fill_byte_by_byte + MOVQ DX, CX + SHRQ $0x03, CX + SUBQ CX, R12 + MOVQ (R12), AX + SUBQ CX, BX + ANDQ $0x07, DX + JMP sequenceDecs_decodeSync_safe_bmi2_fill_end + +sequenceDecs_decodeSync_safe_bmi2_fill_byte_by_byte: + CMPQ BX, $0x00 + JLE sequenceDecs_decodeSync_safe_bmi2_fill_check_overread + CMPQ DX, $0x07 + JLE sequenceDecs_decodeSync_safe_bmi2_fill_end + SHLQ $0x08, AX + SUBQ $0x01, R12 + SUBQ $0x01, BX + SUBQ $0x08, DX + MOVBQZX (R12), CX + ORQ CX, AX + JMP sequenceDecs_decodeSync_safe_bmi2_fill_byte_by_byte + +sequenceDecs_decodeSync_safe_bmi2_fill_check_overread: + CMPQ DX, $0x40 + JA error_overread + +sequenceDecs_decodeSync_safe_bmi2_fill_end: + // Update offset + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R13 + MOVQ AX, R14 + LEAQ (DX)(R13*1), CX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + MOVQ CX, DX + MOVQ R8, CX + SHRQ $0x20, CX + ADDQ R14, CX + MOVQ CX, 8(SP) + + // Update match length + MOVQ $0x00000808, CX + BEXTRQ CX, DI, R13 + MOVQ AX, R14 + LEAQ (DX)(R13*1), CX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + MOVQ CX, DX + MOVQ DI, CX + SHRQ $0x20, CX + ADDQ R14, CX + MOVQ CX, 16(SP) + + // Fill bitreader to have enough for the remaining + CMPQ BX, $0x08 + JL sequenceDecs_decodeSync_safe_bmi2_fill_2_byte_by_byte + MOVQ DX, CX + SHRQ $0x03, CX + SUBQ CX, R12 + MOVQ (R12), AX + SUBQ CX, BX + ANDQ $0x07, DX + JMP sequenceDecs_decodeSync_safe_bmi2_fill_2_end + +sequenceDecs_decodeSync_safe_bmi2_fill_2_byte_by_byte: + CMPQ BX, $0x00 + JLE sequenceDecs_decodeSync_safe_bmi2_fill_2_check_overread + CMPQ DX, $0x07 + JLE sequenceDecs_decodeSync_safe_bmi2_fill_2_end + SHLQ $0x08, AX + SUBQ $0x01, R12 + SUBQ $0x01, BX + SUBQ $0x08, DX + MOVBQZX (R12), CX + ORQ CX, AX + JMP sequenceDecs_decodeSync_safe_bmi2_fill_2_byte_by_byte + +sequenceDecs_decodeSync_safe_bmi2_fill_2_check_overread: + CMPQ DX, $0x40 + JA error_overread + +sequenceDecs_decodeSync_safe_bmi2_fill_2_end: + // Update literal length + MOVQ $0x00000808, CX + BEXTRQ CX, SI, R13 + MOVQ AX, R14 + LEAQ (DX)(R13*1), CX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + MOVQ CX, DX + MOVQ SI, CX + SHRQ $0x20, CX + ADDQ R14, CX + MOVQ CX, 24(SP) + + // Fill bitreader for state updates + MOVQ R12, (SP) + MOVQ $0x00000808, CX + BEXTRQ CX, R8, R12 + MOVQ ctx+16(FP), CX + CMPQ 96(CX), $0x00 + JZ sequenceDecs_decodeSync_safe_bmi2_skip_update + LEAQ (SI)(DI*1), R13 + ADDQ R8, R13 + MOVBQZX R13, R13 + LEAQ (DX)(R13*1), CX + MOVQ AX, R14 + MOVQ CX, DX + ROLQ CL, R14 + BZHIQ R13, R14, R14 + + // Update Offset State + BZHIQ R8, R14, CX + SHRXQ R8, R14, R14 + SHRL $0x10, R8 + ADDQ CX, R8 + + // Load ctx.ofTable + MOVQ ctx+16(FP), CX + MOVQ 48(CX), CX + MOVQ (CX)(R8*8), R8 + + // Update Match Length State + BZHIQ DI, R14, CX + SHRXQ DI, R14, R14 + SHRL $0x10, DI + ADDQ CX, DI + + // Load ctx.mlTable + MOVQ ctx+16(FP), CX + MOVQ 24(CX), CX + MOVQ (CX)(DI*8), DI + + // Update Literal Length State + BZHIQ SI, R14, CX + SHRL $0x10, SI + ADDQ CX, SI + + // Load ctx.llTable + MOVQ ctx+16(FP), CX + MOVQ (CX), CX + MOVQ (CX)(SI*8), SI + +sequenceDecs_decodeSync_safe_bmi2_skip_update: + // Adjust offset + MOVQ s+0(FP), CX + MOVQ 8(SP), R13 + CMPQ R12, $0x01 + JBE sequenceDecs_decodeSync_safe_bmi2_adjust_offsetB_1_or_0 + MOVUPS 144(CX), X0 + MOVQ R13, 144(CX) + MOVUPS X0, 152(CX) + JMP sequenceDecs_decodeSync_safe_bmi2_after_adjust + +sequenceDecs_decodeSync_safe_bmi2_adjust_offsetB_1_or_0: + CMPQ 24(SP), $0x00000000 + JNE sequenceDecs_decodeSync_safe_bmi2_adjust_offset_maybezero + INCQ R13 + JMP sequenceDecs_decodeSync_safe_bmi2_adjust_offset_nonzero + +sequenceDecs_decodeSync_safe_bmi2_adjust_offset_maybezero: + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_safe_bmi2_adjust_offset_nonzero + MOVQ 144(CX), R13 + JMP sequenceDecs_decodeSync_safe_bmi2_after_adjust + +sequenceDecs_decodeSync_safe_bmi2_adjust_offset_nonzero: + MOVQ R13, R12 + XORQ R14, R14 + MOVQ $-1, R15 + CMPQ R13, $0x03 + CMOVQEQ R14, R12 + CMOVQEQ R15, R14 + ADDQ 144(CX)(R12*8), R14 + JNZ sequenceDecs_decodeSync_safe_bmi2_adjust_temp_valid + MOVQ $0x00000001, R14 + +sequenceDecs_decodeSync_safe_bmi2_adjust_temp_valid: + CMPQ R13, $0x01 + JZ sequenceDecs_decodeSync_safe_bmi2_adjust_skip + MOVQ 152(CX), R12 + MOVQ R12, 160(CX) + +sequenceDecs_decodeSync_safe_bmi2_adjust_skip: + MOVQ 144(CX), R12 + MOVQ R12, 152(CX) + MOVQ R14, 144(CX) + MOVQ R14, R13 + +sequenceDecs_decodeSync_safe_bmi2_after_adjust: + MOVQ R13, 8(SP) + + // Check values + MOVQ 16(SP), CX + MOVQ 24(SP), R12 + LEAQ (CX)(R12*1), R14 + MOVQ s+0(FP), R15 + ADDQ R14, 256(R15) + MOVQ ctx+16(FP), R14 + SUBQ R12, 104(R14) + JS error_not_enough_literals + CMPQ CX, $0x00020002 + JA sequenceDecs_decodeSync_safe_bmi2_error_match_len_too_big + TESTQ R13, R13 + JNZ sequenceDecs_decodeSync_safe_bmi2_match_len_ofs_ok + TESTQ CX, CX + JNZ sequenceDecs_decodeSync_safe_bmi2_error_match_len_ofs_mismatch + +sequenceDecs_decodeSync_safe_bmi2_match_len_ofs_ok: + MOVQ 24(SP), CX + MOVQ 8(SP), R12 + MOVQ 16(SP), R13 + + // Check if we have enough space in s.out + LEAQ (CX)(R13*1), R14 + ADDQ R9, R14 + CMPQ R14, 32(SP) + JA error_not_enough_space + + // Copy literals + TESTQ CX, CX + JZ check_offset + MOVQ CX, R14 + SUBQ $0x10, R14 + JB copy_1_small + +copy_1_loop: + MOVUPS (R10), X0 + MOVUPS X0, (R9) + ADDQ $0x10, R10 + ADDQ $0x10, R9 + SUBQ $0x10, R14 + JAE copy_1_loop + LEAQ 16(R10)(R14*1), R10 + LEAQ 16(R9)(R14*1), R9 + MOVUPS -16(R10), X0 + MOVUPS X0, -16(R9) + JMP copy_1_end + +copy_1_small: + CMPQ CX, $0x03 + JE copy_1_move_3 + JB copy_1_move_1or2 + CMPQ CX, $0x08 + JB copy_1_move_4through7 + JMP copy_1_move_8through16 + +copy_1_move_1or2: + MOVB (R10), R14 + MOVB -1(R10)(CX*1), R15 + MOVB R14, (R9) + MOVB R15, -1(R9)(CX*1) + ADDQ CX, R10 + ADDQ CX, R9 + JMP copy_1_end + +copy_1_move_3: + MOVW (R10), R14 + MOVB 2(R10), R15 + MOVW R14, (R9) + MOVB R15, 2(R9) + ADDQ CX, R10 + ADDQ CX, R9 + JMP copy_1_end + +copy_1_move_4through7: + MOVL (R10), R14 + MOVL -4(R10)(CX*1), R15 + MOVL R14, (R9) + MOVL R15, -4(R9)(CX*1) + ADDQ CX, R10 + ADDQ CX, R9 + JMP copy_1_end + +copy_1_move_8through16: + MOVQ (R10), R14 + MOVQ -8(R10)(CX*1), R15 + MOVQ R14, (R9) + MOVQ R15, -8(R9)(CX*1) + ADDQ CX, R10 + ADDQ CX, R9 + +copy_1_end: + ADDQ CX, R11 + + // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize) +check_offset: + MOVQ R11, CX + ADDQ 40(SP), CX + CMPQ R12, CX + JG error_match_off_too_big + CMPQ R12, 56(SP) + JG error_match_off_too_big + + // Copy match from history + MOVQ R12, CX + SUBQ R11, CX + JLS copy_match + MOVQ 48(SP), R14 + SUBQ CX, R14 + CMPQ R13, CX + JG copy_all_from_history + MOVQ R13, CX + SUBQ $0x10, CX + JB copy_4_small + +copy_4_loop: + MOVUPS (R14), X0 + MOVUPS X0, (R9) + ADDQ $0x10, R14 + ADDQ $0x10, R9 + SUBQ $0x10, CX + JAE copy_4_loop + LEAQ 16(R14)(CX*1), R14 + LEAQ 16(R9)(CX*1), R9 + MOVUPS -16(R14), X0 + MOVUPS X0, -16(R9) + JMP copy_4_end + +copy_4_small: + CMPQ R13, $0x03 + JE copy_4_move_3 + CMPQ R13, $0x08 + JB copy_4_move_4through7 + JMP copy_4_move_8through16 + +copy_4_move_3: + MOVW (R14), CX + MOVB 2(R14), R12 + MOVW CX, (R9) + MOVB R12, 2(R9) + ADDQ R13, R14 + ADDQ R13, R9 + JMP copy_4_end + +copy_4_move_4through7: + MOVL (R14), CX + MOVL -4(R14)(R13*1), R12 + MOVL CX, (R9) + MOVL R12, -4(R9)(R13*1) + ADDQ R13, R14 + ADDQ R13, R9 + JMP copy_4_end + +copy_4_move_8through16: + MOVQ (R14), CX + MOVQ -8(R14)(R13*1), R12 + MOVQ CX, (R9) + MOVQ R12, -8(R9)(R13*1) + ADDQ R13, R14 + ADDQ R13, R9 + +copy_4_end: + ADDQ R13, R11 + JMP handle_loop + JMP loop_finished + +copy_all_from_history: + MOVQ CX, R15 + SUBQ $0x10, R15 + JB copy_5_small + +copy_5_loop: + MOVUPS (R14), X0 + MOVUPS X0, (R9) + ADDQ $0x10, R14 + ADDQ $0x10, R9 + SUBQ $0x10, R15 + JAE copy_5_loop + LEAQ 16(R14)(R15*1), R14 + LEAQ 16(R9)(R15*1), R9 + MOVUPS -16(R14), X0 + MOVUPS X0, -16(R9) + JMP copy_5_end + +copy_5_small: + CMPQ CX, $0x03 + JE copy_5_move_3 + JB copy_5_move_1or2 + CMPQ CX, $0x08 + JB copy_5_move_4through7 + JMP copy_5_move_8through16 + +copy_5_move_1or2: + MOVB (R14), R15 + MOVB -1(R14)(CX*1), BP + MOVB R15, (R9) + MOVB BP, -1(R9)(CX*1) + ADDQ CX, R14 + ADDQ CX, R9 + JMP copy_5_end + +copy_5_move_3: + MOVW (R14), R15 + MOVB 2(R14), BP + MOVW R15, (R9) + MOVB BP, 2(R9) + ADDQ CX, R14 + ADDQ CX, R9 + JMP copy_5_end + +copy_5_move_4through7: + MOVL (R14), R15 + MOVL -4(R14)(CX*1), BP + MOVL R15, (R9) + MOVL BP, -4(R9)(CX*1) + ADDQ CX, R14 + ADDQ CX, R9 + JMP copy_5_end + +copy_5_move_8through16: + MOVQ (R14), R15 + MOVQ -8(R14)(CX*1), BP + MOVQ R15, (R9) + MOVQ BP, -8(R9)(CX*1) + ADDQ CX, R14 + ADDQ CX, R9 + +copy_5_end: + ADDQ CX, R11 + SUBQ CX, R13 + + // Copy match from the current buffer +copy_match: + MOVQ R9, CX + SUBQ R12, CX + + // ml <= mo + CMPQ R13, R12 + JA copy_overlapping_match + + // Copy non-overlapping match + ADDQ R13, R11 + MOVQ R13, R12 + SUBQ $0x10, R12 + JB copy_2_small + +copy_2_loop: + MOVUPS (CX), X0 + MOVUPS X0, (R9) + ADDQ $0x10, CX + ADDQ $0x10, R9 + SUBQ $0x10, R12 + JAE copy_2_loop + LEAQ 16(CX)(R12*1), CX + LEAQ 16(R9)(R12*1), R9 + MOVUPS -16(CX), X0 + MOVUPS X0, -16(R9) + JMP copy_2_end + +copy_2_small: + CMPQ R13, $0x03 + JE copy_2_move_3 + JB copy_2_move_1or2 + CMPQ R13, $0x08 + JB copy_2_move_4through7 + JMP copy_2_move_8through16 + +copy_2_move_1or2: + MOVB (CX), R12 + MOVB -1(CX)(R13*1), R14 + MOVB R12, (R9) + MOVB R14, -1(R9)(R13*1) + ADDQ R13, CX + ADDQ R13, R9 + JMP copy_2_end + +copy_2_move_3: + MOVW (CX), R12 + MOVB 2(CX), R14 + MOVW R12, (R9) + MOVB R14, 2(R9) + ADDQ R13, CX + ADDQ R13, R9 + JMP copy_2_end + +copy_2_move_4through7: + MOVL (CX), R12 + MOVL -4(CX)(R13*1), R14 + MOVL R12, (R9) + MOVL R14, -4(R9)(R13*1) + ADDQ R13, CX + ADDQ R13, R9 + JMP copy_2_end + +copy_2_move_8through16: + MOVQ (CX), R12 + MOVQ -8(CX)(R13*1), R14 + MOVQ R12, (R9) + MOVQ R14, -8(R9)(R13*1) + ADDQ R13, CX + ADDQ R13, R9 + +copy_2_end: + JMP handle_loop + + // Copy overlapping match +copy_overlapping_match: + ADDQ R13, R11 + +copy_slow_3: + MOVB (CX), R12 + MOVB R12, (R9) + INCQ CX + INCQ R9 + DECQ R13 + JNZ copy_slow_3 + +handle_loop: + MOVQ ctx+16(FP), CX + DECQ 96(CX) + JNS sequenceDecs_decodeSync_safe_bmi2_main_loop + +loop_finished: + MOVQ br+8(FP), CX + MOVQ AX, 24(CX) + MOVB DL, 32(CX) + MOVQ BX, 8(CX) + + // Update the context + MOVQ ctx+16(FP), AX + MOVQ R11, 136(AX) + MOVQ 144(AX), CX + SUBQ CX, R10 + MOVQ R10, 168(AX) + + // Return success + MOVQ $0x00000000, ret+24(FP) + RET + + // Return with match length error +sequenceDecs_decodeSync_safe_bmi2_error_match_len_ofs_mismatch: + MOVQ 16(SP), AX + MOVQ ctx+16(FP), CX + MOVQ AX, 216(CX) + MOVQ $0x00000001, ret+24(FP) + RET + + // Return with match too long error +sequenceDecs_decodeSync_safe_bmi2_error_match_len_too_big: + MOVQ ctx+16(FP), AX + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ $0x00000002, ret+24(FP) + RET + + // Return with match offset too long error +error_match_off_too_big: + MOVQ ctx+16(FP), AX + MOVQ 8(SP), CX + MOVQ CX, 224(AX) + MOVQ R11, 136(AX) + MOVQ $0x00000003, ret+24(FP) + RET + + // Return with not enough literals error +error_not_enough_literals: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ $0x00000004, ret+24(FP) + RET + + // Return with overread error +error_overread: + MOVQ $0x00000006, ret+24(FP) + RET + + // Return with not enough output space error +error_not_enough_space: + MOVQ ctx+16(FP), AX + MOVQ 24(SP), CX + MOVQ CX, 208(AX) + MOVQ 16(SP), CX + MOVQ CX, 216(AX) + MOVQ R11, 136(AX) + MOVQ $0x00000005, ret+24(FP) + RET diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go b/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go new file mode 100644 index 0000000000..2fb35b788c --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go @@ -0,0 +1,237 @@ +//go:build !amd64 || appengine || !gc || noasm +// +build !amd64 appengine !gc noasm + +package zstd + +import ( + "fmt" + "io" +) + +// decode sequences from the stream with the provided history but without dictionary. +func (s *sequenceDecs) decodeSyncSimple(hist []byte) (bool, error) { + return false, nil +} + +// decode sequences from the stream without the provided history. +func (s *sequenceDecs) decode(seqs []seqVals) error { + br := s.br + + // Grab full sizes tables, to avoid bounds checks. + llTable, mlTable, ofTable := s.litLengths.fse.dt[:maxTablesize], s.matchLengths.fse.dt[:maxTablesize], s.offsets.fse.dt[:maxTablesize] + llState, mlState, ofState := s.litLengths.state.state, s.matchLengths.state.state, s.offsets.state.state + s.seqSize = 0 + litRemain := len(s.literals) + + maxBlockSize := maxCompressedBlockSize + if s.windowSize < maxBlockSize { + maxBlockSize = s.windowSize + } + for i := range seqs { + var ll, mo, ml int + if len(br.in) > 4+((maxOffsetBits+16+16)>>3) { + // inlined function: + // ll, mo, ml = s.nextFast(br, llState, mlState, ofState) + + // Final will not read from stream. + var llB, mlB, moB uint8 + ll, llB = llState.final() + ml, mlB = mlState.final() + mo, moB = ofState.final() + + // extra bits are stored in reverse order. + br.fillFast() + mo += br.getBits(moB) + if s.maxBits > 32 { + br.fillFast() + } + ml += br.getBits(mlB) + ll += br.getBits(llB) + + if moB > 1 { + s.prevOffset[2] = s.prevOffset[1] + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = mo + } else { + // mo = s.adjustOffset(mo, ll, moB) + // Inlined for rather big speedup + if ll == 0 { + // There is an exception though, when current sequence's literals_length = 0. + // In this case, repeated offsets are shifted by one, so an offset_value of 1 means Repeated_Offset2, + // an offset_value of 2 means Repeated_Offset3, and an offset_value of 3 means Repeated_Offset1 - 1_byte. + mo++ + } + + if mo == 0 { + mo = s.prevOffset[0] + } else { + var temp int + if mo == 3 { + temp = s.prevOffset[0] - 1 + } else { + temp = s.prevOffset[mo] + } + + if temp == 0 { + // 0 is not valid; input is corrupted; force offset to 1 + println("WARNING: temp was 0") + temp = 1 + } + + if mo != 1 { + s.prevOffset[2] = s.prevOffset[1] + } + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = temp + mo = temp + } + } + br.fillFast() + } else { + if br.overread() { + if debugDecoder { + printf("reading sequence %d, exceeded available data\n", i) + } + return io.ErrUnexpectedEOF + } + ll, mo, ml = s.next(br, llState, mlState, ofState) + br.fill() + } + + if debugSequences { + println("Seq", i, "Litlen:", ll, "mo:", mo, "(abs) ml:", ml) + } + // Evaluate. + // We might be doing this async, so do it early. + if mo == 0 && ml > 0 { + return fmt.Errorf("zero matchoff and matchlen (%d) > 0", ml) + } + if ml > maxMatchLen { + return fmt.Errorf("match len (%d) bigger than max allowed length", ml) + } + s.seqSize += ll + ml + if s.seqSize > maxBlockSize { + return fmt.Errorf("output bigger than max block size (%d)", maxBlockSize) + } + litRemain -= ll + if litRemain < 0 { + return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ll, litRemain+ll) + } + seqs[i] = seqVals{ + ll: ll, + ml: ml, + mo: mo, + } + if i == len(seqs)-1 { + // This is the last sequence, so we shouldn't update state. + break + } + + // Manually inlined, ~ 5-20% faster + // Update all 3 states at once. Approx 20% faster. + nBits := llState.nbBits() + mlState.nbBits() + ofState.nbBits() + if nBits == 0 { + llState = llTable[llState.newState()&maxTableMask] + mlState = mlTable[mlState.newState()&maxTableMask] + ofState = ofTable[ofState.newState()&maxTableMask] + } else { + bits := br.get32BitsFast(nBits) + lowBits := uint16(bits >> ((ofState.nbBits() + mlState.nbBits()) & 31)) + llState = llTable[(llState.newState()+lowBits)&maxTableMask] + + lowBits = uint16(bits >> (ofState.nbBits() & 31)) + lowBits &= bitMask[mlState.nbBits()&15] + mlState = mlTable[(mlState.newState()+lowBits)&maxTableMask] + + lowBits = uint16(bits) & bitMask[ofState.nbBits()&15] + ofState = ofTable[(ofState.newState()+lowBits)&maxTableMask] + } + } + s.seqSize += litRemain + if s.seqSize > maxBlockSize { + return fmt.Errorf("output bigger than max block size (%d)", maxBlockSize) + } + err := br.close() + if err != nil { + printf("Closing sequences: %v, %+v\n", err, *br) + } + return err +} + +// executeSimple handles cases when a dictionary is not used. +func (s *sequenceDecs) executeSimple(seqs []seqVals, hist []byte) error { + // Ensure we have enough output size... + if len(s.out)+s.seqSize > cap(s.out) { + addBytes := s.seqSize + len(s.out) + s.out = append(s.out, make([]byte, addBytes)...) + s.out = s.out[:len(s.out)-addBytes] + } + + if debugDecoder { + printf("Execute %d seqs with literals: %d into %d bytes\n", len(seqs), len(s.literals), s.seqSize) + } + + var t = len(s.out) + out := s.out[:t+s.seqSize] + + for _, seq := range seqs { + // Add literals + copy(out[t:], s.literals[:seq.ll]) + t += seq.ll + s.literals = s.literals[seq.ll:] + + // Malformed input + if seq.mo > t+len(hist) || seq.mo > s.windowSize { + return fmt.Errorf("match offset (%d) bigger than current history (%d)", seq.mo, t+len(hist)) + } + + // Copy from history. + if v := seq.mo - t; v > 0 { + // v is the start position in history from end. + start := len(hist) - v + if seq.ml > v { + // Some goes into the current block. + // Copy remainder of history + copy(out[t:], hist[start:]) + t += v + seq.ml -= v + } else { + copy(out[t:], hist[start:start+seq.ml]) + t += seq.ml + continue + } + } + + // We must be in the current buffer now + if seq.ml > 0 { + start := t - seq.mo + if seq.ml <= t-start { + // No overlap + copy(out[t:], out[start:start+seq.ml]) + t += seq.ml + } else { + // Overlapping copy + // Extend destination slice and copy one byte at the time. + src := out[start : start+seq.ml] + dst := out[t:] + dst = dst[:len(src)] + t += len(src) + // Destination is the space we just added. + for i := range src { + dst[i] = src[i] + } + } + } + } + // Add final literals + copy(out[t:], s.literals) + if debugDecoder { + t += len(s.literals) + if t != len(out) { + panic(fmt.Errorf("length mismatch, want %d, got %d, ss: %d", len(out), t, s.seqSize)) + } + } + s.out = out + + return nil +} diff --git a/vendor/github.com/klauspost/compress/zstd/seqenc.go b/vendor/github.com/klauspost/compress/zstd/seqenc.go new file mode 100644 index 0000000000..8014174a77 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/seqenc.go @@ -0,0 +1,114 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import "math/bits" + +type seqCoders struct { + llEnc, ofEnc, mlEnc *fseEncoder + llPrev, ofPrev, mlPrev *fseEncoder +} + +// swap coders with another (block). +func (s *seqCoders) swap(other *seqCoders) { + *s, *other = *other, *s +} + +// setPrev will update the previous encoders to the actually used ones +// and make sure a fresh one is in the main slot. +func (s *seqCoders) setPrev(ll, ml, of *fseEncoder) { + compareSwap := func(used *fseEncoder, current, prev **fseEncoder) { + // We used the new one, more current to history and reuse the previous history + if *current == used { + *prev, *current = *current, *prev + c := *current + p := *prev + c.reUsed = false + p.reUsed = true + return + } + if used == *prev { + return + } + // Ensure we cannot reuse by accident + prevEnc := *prev + prevEnc.symbolLen = 0 + } + compareSwap(ll, &s.llEnc, &s.llPrev) + compareSwap(ml, &s.mlEnc, &s.mlPrev) + compareSwap(of, &s.ofEnc, &s.ofPrev) +} + +func highBit(val uint32) (n uint32) { + return uint32(bits.Len32(val) - 1) +} + +var llCodeTable = [64]byte{0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, + 16, 16, 17, 17, 18, 18, 19, 19, + 20, 20, 20, 20, 21, 21, 21, 21, + 22, 22, 22, 22, 22, 22, 22, 22, + 23, 23, 23, 23, 23, 23, 23, 23, + 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24} + +// Up to 6 bits +const maxLLCode = 35 + +// llBitsTable translates from ll code to number of bits. +var llBitsTable = [maxLLCode + 1]byte{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 2, 2, 3, 3, + 4, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16} + +// llCode returns the code that represents the literal length requested. +func llCode(litLength uint32) uint8 { + const llDeltaCode = 19 + if litLength <= 63 { + // Compiler insists on bounds check (Go 1.12) + return llCodeTable[litLength&63] + } + return uint8(highBit(litLength)) + llDeltaCode +} + +var mlCodeTable = [128]byte{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, + 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37, + 38, 38, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 39, 39, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42} + +// Up to 6 bits +const maxMLCode = 52 + +// mlBitsTable translates from ml code to number of bits. +var mlBitsTable = [maxMLCode + 1]byte{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 2, 2, 3, 3, + 4, 4, 5, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16} + +// note : mlBase = matchLength - MINMATCH; +// because it's the format it's stored in seqStore->sequences +func mlCode(mlBase uint32) uint8 { + const mlDeltaCode = 36 + if mlBase <= 127 { + // Compiler insists on bounds check (Go 1.12) + return mlCodeTable[mlBase&127] + } + return uint8(highBit(mlBase)) + mlDeltaCode +} + +func ofCode(offset uint32) uint8 { + // A valid offset will always be > 0. + return uint8(bits.Len32(offset) - 1) +} diff --git a/vendor/github.com/klauspost/compress/zstd/snappy.go b/vendor/github.com/klauspost/compress/zstd/snappy.go new file mode 100644 index 0000000000..ec13594e89 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/snappy.go @@ -0,0 +1,434 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "encoding/binary" + "errors" + "hash/crc32" + "io" + + "github.com/klauspost/compress/huff0" + snappy "github.com/klauspost/compress/internal/snapref" +) + +const ( + snappyTagLiteral = 0x00 + snappyTagCopy1 = 0x01 + snappyTagCopy2 = 0x02 + snappyTagCopy4 = 0x03 +) + +const ( + snappyChecksumSize = 4 + snappyMagicBody = "sNaPpY" + + // snappyMaxBlockSize is the maximum size of the input to encodeBlock. It is not + // part of the wire format per se, but some parts of the encoder assume + // that an offset fits into a uint16. + // + // Also, for the framing format (Writer type instead of Encode function), + // https://github.com/google/snappy/blob/master/framing_format.txt says + // that "the uncompressed data in a chunk must be no longer than 65536 + // bytes". + snappyMaxBlockSize = 65536 + + // snappyMaxEncodedLenOfMaxBlockSize equals MaxEncodedLen(snappyMaxBlockSize), but is + // hard coded to be a const instead of a variable, so that obufLen can also + // be a const. Their equivalence is confirmed by + // TestMaxEncodedLenOfMaxBlockSize. + snappyMaxEncodedLenOfMaxBlockSize = 76490 +) + +const ( + chunkTypeCompressedData = 0x00 + chunkTypeUncompressedData = 0x01 + chunkTypePadding = 0xfe + chunkTypeStreamIdentifier = 0xff +) + +var ( + // ErrSnappyCorrupt reports that the input is invalid. + ErrSnappyCorrupt = errors.New("snappy: corrupt input") + // ErrSnappyTooLarge reports that the uncompressed length is too large. + ErrSnappyTooLarge = errors.New("snappy: decoded block is too large") + // ErrSnappyUnsupported reports that the input isn't supported. + ErrSnappyUnsupported = errors.New("snappy: unsupported input") + + errUnsupportedLiteralLength = errors.New("snappy: unsupported literal length") +) + +// SnappyConverter can read SnappyConverter-compressed streams and convert them to zstd. +// Conversion is done by converting the stream directly from Snappy without intermediate +// full decoding. +// Therefore the compression ratio is much less than what can be done by a full decompression +// and compression, and a faulty Snappy stream may lead to a faulty Zstandard stream without +// any errors being generated. +// No CRC value is being generated and not all CRC values of the Snappy stream are checked. +// However, it provides really fast recompression of Snappy streams. +// The converter can be reused to avoid allocations, even after errors. +type SnappyConverter struct { + r io.Reader + err error + buf []byte + block *blockEnc +} + +// Convert the Snappy stream supplied in 'in' and write the zStandard stream to 'w'. +// If any error is detected on the Snappy stream it is returned. +// The number of bytes written is returned. +func (r *SnappyConverter) Convert(in io.Reader, w io.Writer) (int64, error) { + initPredefined() + r.err = nil + r.r = in + if r.block == nil { + r.block = &blockEnc{} + r.block.init() + } + r.block.initNewEncode() + if len(r.buf) != snappyMaxEncodedLenOfMaxBlockSize+snappyChecksumSize { + r.buf = make([]byte, snappyMaxEncodedLenOfMaxBlockSize+snappyChecksumSize) + } + r.block.litEnc.Reuse = huff0.ReusePolicyNone + var written int64 + var readHeader bool + { + header := frameHeader{WindowSize: snappyMaxBlockSize}.appendTo(r.buf[:0]) + + var n int + n, r.err = w.Write(header) + if r.err != nil { + return written, r.err + } + written += int64(n) + } + + for { + if !r.readFull(r.buf[:4], true) { + // Add empty last block + r.block.reset(nil) + r.block.last = true + err := r.block.encodeLits(r.block.literals, false) + if err != nil { + return written, err + } + n, err := w.Write(r.block.output) + if err != nil { + return written, err + } + written += int64(n) + + return written, r.err + } + chunkType := r.buf[0] + if !readHeader { + if chunkType != chunkTypeStreamIdentifier { + println("chunkType != chunkTypeStreamIdentifier", chunkType) + r.err = ErrSnappyCorrupt + return written, r.err + } + readHeader = true + } + chunkLen := int(r.buf[1]) | int(r.buf[2])<<8 | int(r.buf[3])<<16 + if chunkLen > len(r.buf) { + println("chunkLen > len(r.buf)", chunkType) + r.err = ErrSnappyUnsupported + return written, r.err + } + + // The chunk types are specified at + // https://github.com/google/snappy/blob/master/framing_format.txt + switch chunkType { + case chunkTypeCompressedData: + // Section 4.2. Compressed data (chunk type 0x00). + if chunkLen < snappyChecksumSize { + println("chunkLen < snappyChecksumSize", chunkLen, snappyChecksumSize) + r.err = ErrSnappyCorrupt + return written, r.err + } + buf := r.buf[:chunkLen] + if !r.readFull(buf, false) { + return written, r.err + } + //checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + buf = buf[snappyChecksumSize:] + + n, hdr, err := snappyDecodedLen(buf) + if err != nil { + r.err = err + return written, r.err + } + buf = buf[hdr:] + if n > snappyMaxBlockSize { + println("n > snappyMaxBlockSize", n, snappyMaxBlockSize) + r.err = ErrSnappyCorrupt + return written, r.err + } + r.block.reset(nil) + r.block.pushOffsets() + if err := decodeSnappy(r.block, buf); err != nil { + r.err = err + return written, r.err + } + if r.block.size+r.block.extraLits != n { + printf("invalid size, want %d, got %d\n", n, r.block.size+r.block.extraLits) + r.err = ErrSnappyCorrupt + return written, r.err + } + err = r.block.encode(nil, false, false) + switch err { + case errIncompressible: + r.block.popOffsets() + r.block.reset(nil) + r.block.literals, err = snappy.Decode(r.block.literals[:n], r.buf[snappyChecksumSize:chunkLen]) + if err != nil { + return written, err + } + err = r.block.encodeLits(r.block.literals, false) + if err != nil { + return written, err + } + case nil: + default: + return written, err + } + + n, r.err = w.Write(r.block.output) + if r.err != nil { + return written, err + } + written += int64(n) + continue + case chunkTypeUncompressedData: + if debugEncoder { + println("Uncompressed, chunklen", chunkLen) + } + // Section 4.3. Uncompressed data (chunk type 0x01). + if chunkLen < snappyChecksumSize { + println("chunkLen < snappyChecksumSize", chunkLen, snappyChecksumSize) + r.err = ErrSnappyCorrupt + return written, r.err + } + r.block.reset(nil) + buf := r.buf[:snappyChecksumSize] + if !r.readFull(buf, false) { + return written, r.err + } + checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + // Read directly into r.decoded instead of via r.buf. + n := chunkLen - snappyChecksumSize + if n > snappyMaxBlockSize { + println("n > snappyMaxBlockSize", n, snappyMaxBlockSize) + r.err = ErrSnappyCorrupt + return written, r.err + } + r.block.literals = r.block.literals[:n] + if !r.readFull(r.block.literals, false) { + return written, r.err + } + if snappyCRC(r.block.literals) != checksum { + println("literals crc mismatch") + r.err = ErrSnappyCorrupt + return written, r.err + } + err := r.block.encodeLits(r.block.literals, false) + if err != nil { + return written, err + } + n, r.err = w.Write(r.block.output) + if r.err != nil { + return written, err + } + written += int64(n) + continue + + case chunkTypeStreamIdentifier: + if debugEncoder { + println("stream id", chunkLen, len(snappyMagicBody)) + } + // Section 4.1. Stream identifier (chunk type 0xff). + if chunkLen != len(snappyMagicBody) { + println("chunkLen != len(snappyMagicBody)", chunkLen, len(snappyMagicBody)) + r.err = ErrSnappyCorrupt + return written, r.err + } + if !r.readFull(r.buf[:len(snappyMagicBody)], false) { + return written, r.err + } + for i := 0; i < len(snappyMagicBody); i++ { + if r.buf[i] != snappyMagicBody[i] { + println("r.buf[i] != snappyMagicBody[i]", r.buf[i], snappyMagicBody[i], i) + r.err = ErrSnappyCorrupt + return written, r.err + } + } + continue + } + + if chunkType <= 0x7f { + // Section 4.5. Reserved unskippable chunks (chunk types 0x02-0x7f). + println("chunkType <= 0x7f") + r.err = ErrSnappyUnsupported + return written, r.err + } + // Section 4.4 Padding (chunk type 0xfe). + // Section 4.6. Reserved skippable chunks (chunk types 0x80-0xfd). + if !r.readFull(r.buf[:chunkLen], false) { + return written, r.err + } + } +} + +// decodeSnappy writes the decoding of src to dst. It assumes that the varint-encoded +// length of the decompressed bytes has already been read. +func decodeSnappy(blk *blockEnc, src []byte) error { + //decodeRef(make([]byte, snappyMaxBlockSize), src) + var s, length int + lits := blk.extraLits + var offset uint32 + for s < len(src) { + switch src[s] & 0x03 { + case snappyTagLiteral: + x := uint32(src[s] >> 2) + switch { + case x < 60: + s++ + case x == 60: + s += 2 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + println("uint(s) > uint(len(src)", s, src) + return ErrSnappyCorrupt + } + x = uint32(src[s-1]) + case x == 61: + s += 3 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + println("uint(s) > uint(len(src)", s, src) + return ErrSnappyCorrupt + } + x = uint32(src[s-2]) | uint32(src[s-1])<<8 + case x == 62: + s += 4 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + println("uint(s) > uint(len(src)", s, src) + return ErrSnappyCorrupt + } + x = uint32(src[s-3]) | uint32(src[s-2])<<8 | uint32(src[s-1])<<16 + case x == 63: + s += 5 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + println("uint(s) > uint(len(src)", s, src) + return ErrSnappyCorrupt + } + x = uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24 + } + if x > snappyMaxBlockSize { + println("x > snappyMaxBlockSize", x, snappyMaxBlockSize) + return ErrSnappyCorrupt + } + length = int(x) + 1 + if length <= 0 { + println("length <= 0 ", length) + + return errUnsupportedLiteralLength + } + //if length > snappyMaxBlockSize-d || uint32(length) > len(src)-s { + // return ErrSnappyCorrupt + //} + + blk.literals = append(blk.literals, src[s:s+length]...) + //println(length, "litLen") + lits += length + s += length + continue + + case snappyTagCopy1: + s += 2 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + println("uint(s) > uint(len(src)", s, len(src)) + return ErrSnappyCorrupt + } + length = 4 + int(src[s-2])>>2&0x7 + offset = uint32(src[s-2])&0xe0<<3 | uint32(src[s-1]) + + case snappyTagCopy2: + s += 3 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + println("uint(s) > uint(len(src)", s, len(src)) + return ErrSnappyCorrupt + } + length = 1 + int(src[s-3])>>2 + offset = uint32(src[s-2]) | uint32(src[s-1])<<8 + + case snappyTagCopy4: + s += 5 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + println("uint(s) > uint(len(src)", s, len(src)) + return ErrSnappyCorrupt + } + length = 1 + int(src[s-5])>>2 + offset = uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24 + } + + if offset <= 0 || blk.size+lits < int(offset) /*|| length > len(blk)-d */ { + println("offset <= 0 || blk.size+lits < int(offset)", offset, blk.size+lits, int(offset), blk.size, lits) + + return ErrSnappyCorrupt + } + + // Check if offset is one of the recent offsets. + // Adjusts the output offset accordingly. + // Gives a tiny bit of compression, typically around 1%. + if false { + offset = blk.matchOffset(offset, uint32(lits)) + } else { + offset += 3 + } + + blk.sequences = append(blk.sequences, seq{ + litLen: uint32(lits), + offset: offset, + matchLen: uint32(length) - zstdMinMatch, + }) + blk.size += length + lits + lits = 0 + } + blk.extraLits = lits + return nil +} + +func (r *SnappyConverter) readFull(p []byte, allowEOF bool) (ok bool) { + if _, r.err = io.ReadFull(r.r, p); r.err != nil { + if r.err == io.ErrUnexpectedEOF || (r.err == io.EOF && !allowEOF) { + r.err = ErrSnappyCorrupt + } + return false + } + return true +} + +var crcTable = crc32.MakeTable(crc32.Castagnoli) + +// crc implements the checksum specified in section 3 of +// https://github.com/google/snappy/blob/master/framing_format.txt +func snappyCRC(b []byte) uint32 { + c := crc32.Update(0, crcTable, b) + return c>>15 | c<<17 + 0xa282ead8 +} + +// snappyDecodedLen returns the length of the decoded block and the number of bytes +// that the length header occupied. +func snappyDecodedLen(src []byte) (blockLen, headerLen int, err error) { + v, n := binary.Uvarint(src) + if n <= 0 || v > 0xffffffff { + return 0, 0, ErrSnappyCorrupt + } + + const wordSize = 32 << (^uint(0) >> 32 & 1) + if wordSize == 32 && v > 0x7fffffff { + return 0, 0, ErrSnappyTooLarge + } + return int(v), n, nil +} diff --git a/vendor/github.com/klauspost/compress/zstd/zip.go b/vendor/github.com/klauspost/compress/zstd/zip.go new file mode 100644 index 0000000000..29c15c8c4e --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/zip.go @@ -0,0 +1,141 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. + +package zstd + +import ( + "errors" + "io" + "sync" +) + +// ZipMethodWinZip is the method for Zstandard compressed data inside Zip files for WinZip. +// See https://www.winzip.com/win/en/comp_info.html +const ZipMethodWinZip = 93 + +// ZipMethodPKWare is the original method number used by PKWARE to indicate Zstandard compression. +// Deprecated: This has been deprecated by PKWARE, use ZipMethodWinZip instead for compression. +// See https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.9.TXT +const ZipMethodPKWare = 20 + +// zipReaderPool is the default reader pool. +var zipReaderPool = sync.Pool{New: func() interface{} { + z, err := NewReader(nil, WithDecoderLowmem(true), WithDecoderMaxWindow(128<<20), WithDecoderConcurrency(1)) + if err != nil { + panic(err) + } + return z +}} + +// newZipReader creates a pooled zip decompressor. +func newZipReader(opts ...DOption) func(r io.Reader) io.ReadCloser { + pool := &zipReaderPool + if len(opts) > 0 { + opts = append([]DOption{WithDecoderLowmem(true), WithDecoderMaxWindow(128 << 20)}, opts...) + // Force concurrency 1 + opts = append(opts, WithDecoderConcurrency(1)) + // Create our own pool + pool = &sync.Pool{} + } + return func(r io.Reader) io.ReadCloser { + dec, ok := pool.Get().(*Decoder) + if ok { + dec.Reset(r) + } else { + d, err := NewReader(r, opts...) + if err != nil { + panic(err) + } + dec = d + } + return &pooledZipReader{dec: dec, pool: pool} + } +} + +type pooledZipReader struct { + mu sync.Mutex // guards Close and Read + pool *sync.Pool + dec *Decoder +} + +func (r *pooledZipReader) Read(p []byte) (n int, err error) { + r.mu.Lock() + defer r.mu.Unlock() + if r.dec == nil { + return 0, errors.New("read after close or EOF") + } + dec, err := r.dec.Read(p) + if err == io.EOF { + r.dec.Reset(nil) + r.pool.Put(r.dec) + r.dec = nil + } + return dec, err +} + +func (r *pooledZipReader) Close() error { + r.mu.Lock() + defer r.mu.Unlock() + var err error + if r.dec != nil { + err = r.dec.Reset(nil) + r.pool.Put(r.dec) + r.dec = nil + } + return err +} + +type pooledZipWriter struct { + mu sync.Mutex // guards Close and Read + enc *Encoder + pool *sync.Pool +} + +func (w *pooledZipWriter) Write(p []byte) (n int, err error) { + w.mu.Lock() + defer w.mu.Unlock() + if w.enc == nil { + return 0, errors.New("Write after Close") + } + return w.enc.Write(p) +} + +func (w *pooledZipWriter) Close() error { + w.mu.Lock() + defer w.mu.Unlock() + var err error + if w.enc != nil { + err = w.enc.Close() + w.pool.Put(w.enc) + w.enc = nil + } + return err +} + +// ZipCompressor returns a compressor that can be registered with zip libraries. +// The provided encoder options will be used on all encodes. +func ZipCompressor(opts ...EOption) func(w io.Writer) (io.WriteCloser, error) { + var pool sync.Pool + return func(w io.Writer) (io.WriteCloser, error) { + enc, ok := pool.Get().(*Encoder) + if ok { + enc.Reset(w) + } else { + var err error + enc, err = NewWriter(w, opts...) + if err != nil { + return nil, err + } + } + return &pooledZipWriter{enc: enc, pool: &pool}, nil + } +} + +// ZipDecompressor returns a decompressor that can be registered with zip libraries. +// See ZipCompressor for example. +// Options can be specified. WithDecoderConcurrency(1) is forced, +// and by default a 128MB maximum decompression window is specified. +// The window size can be overridden if required. +func ZipDecompressor(opts ...DOption) func(r io.Reader) io.ReadCloser { + return newZipReader(opts...) +} diff --git a/vendor/github.com/klauspost/compress/zstd/zstd.go b/vendor/github.com/klauspost/compress/zstd/zstd.go new file mode 100644 index 0000000000..4be7cc7367 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/zstd.go @@ -0,0 +1,121 @@ +// Package zstd provides decompression of zstandard files. +// +// For advanced usage and examples, go to the README: https://github.com/klauspost/compress/tree/master/zstd#zstd +package zstd + +import ( + "bytes" + "encoding/binary" + "errors" + "log" + "math" +) + +// enable debug printing +const debug = false + +// enable encoding debug printing +const debugEncoder = debug + +// enable decoding debug printing +const debugDecoder = debug + +// Enable extra assertions. +const debugAsserts = debug || false + +// print sequence details +const debugSequences = false + +// print detailed matching information +const debugMatches = false + +// force encoder to use predefined tables. +const forcePreDef = false + +// zstdMinMatch is the minimum zstd match length. +const zstdMinMatch = 3 + +// fcsUnknown is used for unknown frame content size. +const fcsUnknown = math.MaxUint64 + +var ( + // ErrReservedBlockType is returned when a reserved block type is found. + // Typically this indicates wrong or corrupted input. + ErrReservedBlockType = errors.New("invalid input: reserved block type encountered") + + // ErrCompressedSizeTooBig is returned when a block is bigger than allowed. + // Typically this indicates wrong or corrupted input. + ErrCompressedSizeTooBig = errors.New("invalid input: compressed size too big") + + // ErrBlockTooSmall is returned when a block is too small to be decoded. + // Typically returned on invalid input. + ErrBlockTooSmall = errors.New("block too small") + + // ErrUnexpectedBlockSize is returned when a block has unexpected size. + // Typically returned on invalid input. + ErrUnexpectedBlockSize = errors.New("unexpected block size") + + // ErrMagicMismatch is returned when a "magic" number isn't what is expected. + // Typically this indicates wrong or corrupted input. + ErrMagicMismatch = errors.New("invalid input: magic number mismatch") + + // ErrWindowSizeExceeded is returned when a reference exceeds the valid window size. + // Typically this indicates wrong or corrupted input. + ErrWindowSizeExceeded = errors.New("window size exceeded") + + // ErrWindowSizeTooSmall is returned when no window size is specified. + // Typically this indicates wrong or corrupted input. + ErrWindowSizeTooSmall = errors.New("invalid input: window size was too small") + + // ErrDecoderSizeExceeded is returned if decompressed size exceeds the configured limit. + ErrDecoderSizeExceeded = errors.New("decompressed size exceeds configured limit") + + // ErrUnknownDictionary is returned if the dictionary ID is unknown. + ErrUnknownDictionary = errors.New("unknown dictionary") + + // ErrFrameSizeExceeded is returned if the stated frame size is exceeded. + // This is only returned if SingleSegment is specified on the frame. + ErrFrameSizeExceeded = errors.New("frame size exceeded") + + // ErrFrameSizeMismatch is returned if the stated frame size does not match the expected size. + // This is only returned if SingleSegment is specified on the frame. + ErrFrameSizeMismatch = errors.New("frame size does not match size on stream") + + // ErrCRCMismatch is returned if CRC mismatches. + ErrCRCMismatch = errors.New("CRC check failed") + + // ErrDecoderClosed will be returned if the Decoder was used after + // Close has been called. + ErrDecoderClosed = errors.New("decoder used after Close") + + // ErrDecoderNilInput is returned when a nil Reader was provided + // and an operation other than Reset/DecodeAll/Close was attempted. + ErrDecoderNilInput = errors.New("nil input provided as reader") +) + +func println(a ...interface{}) { + if debug || debugDecoder || debugEncoder { + log.Println(a...) + } +} + +func printf(format string, a ...interface{}) { + if debug || debugDecoder || debugEncoder { + log.Printf(format, a...) + } +} + +func load3232(b []byte, i int32) uint32 { + return binary.LittleEndian.Uint32(b[:len(b):len(b)][i:]) +} + +func load6432(b []byte, i int32) uint64 { + return binary.LittleEndian.Uint64(b[:len(b):len(b)][i:]) +} + +type byter interface { + Bytes() []byte + Len() int +} + +var _ byter = &bytes.Buffer{} diff --git a/vendor/github.com/mailru/easyjson/buffer/pool.go b/vendor/github.com/mailru/easyjson/buffer/pool.go index 07fb4bc1f7..598a54af9d 100644 --- a/vendor/github.com/mailru/easyjson/buffer/pool.go +++ b/vendor/github.com/mailru/easyjson/buffer/pool.go @@ -4,6 +4,7 @@ package buffer import ( "io" + "net" "sync" ) @@ -52,14 +53,12 @@ func putBuf(buf []byte) { // 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) + if size >= config.PooledSize { + if c := buffers[size]; c != nil { + v := c.Get() + if v != nil { + return v.([]byte) + } } } return make([]byte, 0, size) @@ -78,9 +77,12 @@ type Buffer struct { // 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 + if cap(b.Buf)-len(b.Buf) < s { + b.ensureSpaceSlow(s) } +} + +func (b *Buffer) ensureSpaceSlow(s int) { l := len(b.Buf) if l > 0 { if cap(b.toPool) != cap(b.Buf) { @@ -105,18 +107,22 @@ func (b *Buffer) EnsureSpace(s int) { // 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.EnsureSpace(1) b.Buf = append(b.Buf, data) } // AppendBytes appends a byte slice to buffer. func (b *Buffer) AppendBytes(data []byte) { + if len(data) <= cap(b.Buf)-len(b.Buf) { + b.Buf = append(b.Buf, data...) // fast path + } else { + b.appendBytesSlow(data) + } +} + +func (b *Buffer) appendBytesSlow(data []byte) { for len(data) > 0 { - if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined. - b.EnsureSpace(1) - } + b.EnsureSpace(1) sz := cap(b.Buf) - len(b.Buf) if sz > len(data) { @@ -128,12 +134,18 @@ func (b *Buffer) AppendBytes(data []byte) { } } -// AppendBytes appends a string to buffer. +// AppendString appends a string to buffer. func (b *Buffer) AppendString(data string) { + if len(data) <= cap(b.Buf)-len(b.Buf) { + b.Buf = append(b.Buf, data...) // fast path + } else { + b.appendStringSlow(data) + } +} + +func (b *Buffer) appendStringSlow(data string) { for len(data) > 0 { - if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined. - b.EnsureSpace(1) - } + b.EnsureSpace(1) sz := cap(b.Buf) - len(b.Buf) if sz > len(data) { @@ -156,18 +168,14 @@ func (b *Buffer) Size() int { // 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) + bufs := net.Buffers(b.bufs) + if len(b.Buf) > 0 { + bufs = append(bufs, b.Buf) } + n, err := bufs.WriteTo(w) - if err == nil { - n, err = w.Write(b.Buf) - written += n + for _, buf := range b.bufs { + putBuf(buf) } putBuf(b.toPool) @@ -175,7 +183,7 @@ func (b *Buffer) DumpTo(w io.Writer) (written int, err error) { b.Buf = nil b.toPool = nil - return + return int(n), err } // BuildBytes creates a single byte slice with all the contents of the buffer. Data is @@ -192,7 +200,7 @@ func (b *Buffer) BuildBytes(reuse ...[]byte) []byte { var ret []byte size := b.Size() - // If we got a buffer as argument and it is big enought, reuse it. + // If we got a buffer as argument and it is big enough, reuse it. if len(reuse) == 1 && cap(reuse[0]) >= size { ret = reuse[0][:0] } else { diff --git a/vendor/github.com/mailru/easyjson/jlexer/lexer.go b/vendor/github.com/mailru/easyjson/jlexer/lexer.go index ddd376b844..b5f5e26132 100644 --- a/vendor/github.com/mailru/easyjson/jlexer/lexer.go +++ b/vendor/github.com/mailru/easyjson/jlexer/lexer.go @@ -5,6 +5,7 @@ package jlexer import ( + "bytes" "encoding/base64" "encoding/json" "errors" @@ -14,6 +15,8 @@ import ( "unicode" "unicode/utf16" "unicode/utf8" + + "github.com/josharian/intern" ) // tokenKind determines type of a token. @@ -32,9 +35,10 @@ const ( 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 + boolValue bool // Value if a boolean literal token. + byteValueCloned bool // true if byteValue was allocated and does not refer to original json body + byteValue []byte // Raw value of a token. + delimValue byte } // Lexer is a JSON lexer: it iterates over JSON tokens in a byte slice. @@ -240,23 +244,65 @@ func (r *Lexer) fetchNumber() { // 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) +func findStringLen(data []byte) (isValid bool, length int) { + for { + idx := bytes.IndexByte(data, '"') + if idx == -1 { + return false, len(data) + } + if idx == 0 || (idx > 0 && data[idx-1] != '\\') { + return true, length + idx + } + + // count \\\\\\\ sequences. even number of slashes means quote is not really escaped + cnt := 1 + for idx-cnt-1 >= 0 && data[idx-cnt-1] == '\\' { + cnt++ + } + if cnt%2 == 0 { + return true, length + idx + } + + length += idx + 1 + data = data[idx+1:] + } +} + +// unescapeStringToken performs unescaping of string token. +// if no escaping is needed, original string is returned, otherwise - a new one allocated +func (r *Lexer) unescapeStringToken() (err error) { + data := r.token.byteValue + var unescapedData []byte + + for { + i := bytes.IndexByte(data, '\\') + if i == -1 { + break + } + + escapedRune, escapedBytes, err := decodeEscape(data[i:]) + if err != nil { + r.errParse(err.Error()) + return err + } + + if unescapedData == nil { + unescapedData = make([]byte, 0, len(r.token.byteValue)) } + + var d [4]byte + s := utf8.EncodeRune(d[:], escapedRune) + unescapedData = append(unescapedData, data[:i]...) + unescapedData = append(unescapedData, d[:s]...) + + data = data[i+escapedBytes:] } - return false, false, len(data) + if unescapedData != nil { + r.token.byteValue = append(unescapedData, data...) + r.token.byteValueCloned = true + } + return } // getu4 decodes \uXXXX from the beginning of s, returning the hex value, @@ -286,36 +332,30 @@ func getu4(s []byte) rune { return val } -// processEscape processes a single escape sequence and returns number of bytes processed. -func (r *Lexer) processEscape(data []byte) (int, error) { +// decodeEscape processes a single escape sequence and returns number of bytes processed. +func decodeEscape(data []byte) (decoded rune, bytesProcessed int, err error) { if len(data) < 2 { - return 0, fmt.Errorf("syntax error at %v", string(data)) + return 0, 0, errors.New("incorrect escape symbol \\ at the end of token") } c := data[1] switch c { case '"', '/', '\\': - r.token.byteValue = append(r.token.byteValue, c) - return 2, nil + return rune(c), 2, nil case 'b': - r.token.byteValue = append(r.token.byteValue, '\b') - return 2, nil + return '\b', 2, nil case 'f': - r.token.byteValue = append(r.token.byteValue, '\f') - return 2, nil + return '\f', 2, nil case 'n': - r.token.byteValue = append(r.token.byteValue, '\n') - return 2, nil + return '\n', 2, nil case 'r': - r.token.byteValue = append(r.token.byteValue, '\r') - return 2, nil + return '\r', 2, nil case 't': - r.token.byteValue = append(r.token.byteValue, '\t') - return 2, nil + return '\t', 2, nil case 'u': rr := getu4(data) if rr < 0 { - return 0, errors.New("syntax error") + return 0, 0, errors.New("incorrectly escaped \\uXXXX sequence") } read := 6 @@ -328,13 +368,10 @@ func (r *Lexer) processEscape(data []byte) (int, error) { 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 rr, read, nil } - return 0, errors.New("syntax error") + return 0, 0, errors.New("incorrectly escaped bytes") } // fetchString scans a string literal token. @@ -342,43 +379,14 @@ func (r *Lexer) fetchString() { r.pos++ data := r.Data[r.pos:] - isValid, hasEscapes, length := findStringLen(data) + isValid, 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") + r.token.byteValue = data[:length] + r.pos += length + 1 // skip closing '"' as well } // scanToken scans the next token if no token is currently available in the lexer. @@ -393,6 +401,7 @@ func (r *Lexer) scanToken() { // consume resets the current token to allow scanning the next one. func (r *Lexer) consume() { r.token.kind = tokenUndef + r.token.byteValueCloned = false r.token.delimValue = 0 } @@ -520,6 +529,7 @@ func (r *Lexer) Skip() { func (r *Lexer) SkipRecursive() { r.scanToken() var start, end byte + startPos := r.start switch r.token.delimValue { case '{': @@ -545,6 +555,14 @@ func (r *Lexer) SkipRecursive() { level-- if level == 0 { r.pos += i + 1 + if !json.Valid(r.Data[startPos:r.pos]) { + r.pos = len(r.Data) + r.fatalError = &LexerError{ + Reason: "skipped array/object json value is invalid", + Offset: r.pos, + Data: string(r.Data[r.pos:]), + } + } return } case c == '\\' && inQuotes: @@ -602,7 +620,7 @@ func (r *Lexer) Consumed() { } } -func (r *Lexer) unsafeString() (string, []byte) { +func (r *Lexer) unsafeString(skipUnescape bool) (string, []byte) { if r.token.kind == tokenUndef && r.Ok() { r.FetchToken() } @@ -610,6 +628,13 @@ func (r *Lexer) unsafeString() (string, []byte) { r.errInvalidToken("string") return "", nil } + if !skipUnescape { + if err := r.unescapeStringToken(); err != nil { + r.errInvalidToken("string") + return "", nil + } + } + bytes := r.token.byteValue ret := bytesToStr(r.token.byteValue) r.consume() @@ -621,13 +646,19 @@ func (r *Lexer) unsafeString() (string, []byte) { // 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() + ret, _ := r.unsafeString(false) return ret } // UnsafeBytes returns the byte slice if the token is a string literal. func (r *Lexer) UnsafeBytes() []byte { - _, ret := r.unsafeString() + _, ret := r.unsafeString(false) + return ret +} + +// UnsafeFieldName returns current member name string token +func (r *Lexer) UnsafeFieldName(skipUnescape bool) string { + ret, _ := r.unsafeString(skipUnescape) return ret } @@ -640,7 +671,34 @@ func (r *Lexer) String() string { r.errInvalidToken("string") return "" } - ret := string(r.token.byteValue) + if err := r.unescapeStringToken(); err != nil { + r.errInvalidToken("string") + return "" + } + var ret string + if r.token.byteValueCloned { + ret = bytesToStr(r.token.byteValue) + } else { + ret = string(r.token.byteValue) + } + r.consume() + return ret +} + +// StringIntern reads a string literal, and performs string interning on it. +func (r *Lexer) StringIntern() string { + if r.token.kind == tokenUndef && r.Ok() { + r.FetchToken() + } + if !r.Ok() || r.token.kind != tokenString { + r.errInvalidToken("string") + return "" + } + if err := r.unescapeStringToken(); err != nil { + r.errInvalidToken("string") + return "" + } + ret := intern.Bytes(r.token.byteValue) r.consume() return ret } @@ -654,6 +712,10 @@ func (r *Lexer) Bytes() []byte { r.errInvalidToken("string") return nil } + if err := r.unescapeStringToken(); err != nil { + 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 { @@ -839,7 +901,7 @@ func (r *Lexer) Int() int { } func (r *Lexer) Uint8Str() uint8 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -856,7 +918,7 @@ func (r *Lexer) Uint8Str() uint8 { } func (r *Lexer) Uint16Str() uint16 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -873,7 +935,7 @@ func (r *Lexer) Uint16Str() uint16 { } func (r *Lexer) Uint32Str() uint32 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -890,7 +952,7 @@ func (r *Lexer) Uint32Str() uint32 { } func (r *Lexer) Uint64Str() uint64 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -915,7 +977,7 @@ func (r *Lexer) UintptrStr() uintptr { } func (r *Lexer) Int8Str() int8 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -932,7 +994,7 @@ func (r *Lexer) Int8Str() int8 { } func (r *Lexer) Int16Str() int16 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -949,7 +1011,7 @@ func (r *Lexer) Int16Str() int16 { } func (r *Lexer) Int32Str() int32 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -966,7 +1028,7 @@ func (r *Lexer) Int32Str() int32 { } func (r *Lexer) Int64Str() int64 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -1004,7 +1066,7 @@ func (r *Lexer) Float32() float32 { } func (r *Lexer) Float32Str() float32 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -1037,7 +1099,7 @@ func (r *Lexer) Float64() float64 { } func (r *Lexer) Float64Str() float64 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } diff --git a/vendor/github.com/mailru/easyjson/jwriter/writer.go b/vendor/github.com/mailru/easyjson/jwriter/writer.go index eb8547ccc2..2c5b20105b 100644 --- a/vendor/github.com/mailru/easyjson/jwriter/writer.go +++ b/vendor/github.com/mailru/easyjson/jwriter/writer.go @@ -297,11 +297,9 @@ func (w *Writer) String(s string) { p := 0 // last non-escape symbol - var escapeTable [128]bool + escapeTable := &htmlEscapeTable if w.NoEscapeHTML { - escapeTable = htmlNoEscapeTable - } else { - escapeTable = htmlEscapeTable + escapeTable = &htmlNoEscapeTable } for i := 0; i < len(s); { diff --git a/vendor/github.com/mattn/go-runewidth/.travis.yml b/vendor/github.com/mattn/go-runewidth/.travis.yml deleted file mode 100644 index 6a21813a3e..0000000000 --- a/vendor/github.com/mattn/go-runewidth/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: go -sudo: false -go: - - 1.13.x - - tip - -before_install: - - go get -t -v ./... - -script: - - go generate - - git diff --cached --exit-code - - ./go.test.sh - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/mattn/go-runewidth/README.md b/vendor/github.com/mattn/go-runewidth/README.md index aa56ab96c2..5e2cfd98cb 100644 --- a/vendor/github.com/mattn/go-runewidth/README.md +++ b/vendor/github.com/mattn/go-runewidth/README.md @@ -1,7 +1,7 @@ go-runewidth ============ -[![Build Status](https://travis-ci.org/mattn/go-runewidth.png?branch=master)](https://travis-ci.org/mattn/go-runewidth) +[![Build Status](https://github.com/mattn/go-runewidth/workflows/test/badge.svg?branch=master)](https://github.com/mattn/go-runewidth/actions?query=workflow%3Atest) [![Codecov](https://codecov.io/gh/mattn/go-runewidth/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-runewidth) [![GoDoc](https://godoc.org/github.com/mattn/go-runewidth?status.svg)](http://godoc.org/github.com/mattn/go-runewidth) [![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-runewidth)](https://goreportcard.com/report/github.com/mattn/go-runewidth) diff --git a/vendor/github.com/mattn/go-runewidth/go.test.sh b/vendor/github.com/mattn/go-runewidth/go.test.sh deleted file mode 100644 index 012162b077..0000000000 --- a/vendor/github.com/mattn/go-runewidth/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 -race -coverprofile=profile.out -covermode=atomic "$d" - if [ -f profile.out ]; then - cat profile.out >> coverage.txt - rm profile.out - fi -done diff --git a/vendor/github.com/mattn/go-runewidth/runewidth.go b/vendor/github.com/mattn/go-runewidth/runewidth.go index 19f8e0449b..7dfbb3be91 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth.go @@ -2,6 +2,9 @@ package runewidth import ( "os" + "strings" + + "github.com/rivo/uniseg" ) //go:generate go run script/generate.go @@ -10,11 +13,14 @@ var ( // EastAsianWidth will be set true if the current locale is CJK EastAsianWidth bool - // ZeroWidthJoiner is flag to set to use UTR#51 ZWJ - ZeroWidthJoiner bool + // StrictEmojiNeutral should be set false if handle broken fonts + StrictEmojiNeutral bool = true // DefaultCondition is a condition in current locale - DefaultCondition = &Condition{} + DefaultCondition = &Condition{ + EastAsianWidth: false, + StrictEmojiNeutral: true, + } ) func init() { @@ -29,8 +35,13 @@ func handleEnv() { EastAsianWidth = env == "1" } // update DefaultCondition - DefaultCondition.EastAsianWidth = EastAsianWidth - DefaultCondition.ZeroWidthJoiner = ZeroWidthJoiner + if DefaultCondition.EastAsianWidth != EastAsianWidth { + DefaultCondition.EastAsianWidth = EastAsianWidth + if len(DefaultCondition.combinedLut) > 0 { + DefaultCondition.combinedLut = DefaultCondition.combinedLut[:0] + CreateLUT() + } + } } type interval struct { @@ -85,63 +96,97 @@ var nonprint = table{ // Condition have flag EastAsianWidth whether the current locale is CJK or not. type Condition struct { - EastAsianWidth bool - ZeroWidthJoiner bool + combinedLut []byte + EastAsianWidth bool + StrictEmojiNeutral bool } // NewCondition return new instance of Condition which is current locale. func NewCondition() *Condition { return &Condition{ - EastAsianWidth: EastAsianWidth, - ZeroWidthJoiner: ZeroWidthJoiner, + EastAsianWidth: EastAsianWidth, + StrictEmojiNeutral: StrictEmojiNeutral, } } // RuneWidth returns the number of cells in r. // See http://www.unicode.org/reports/tr11/ func (c *Condition) RuneWidth(r rune) int { - switch { - case r < 0 || r > 0x10FFFF || inTables(r, nonprint, combining, notassigned): + if r < 0 || r > 0x10FFFF { return 0 - case (c.EastAsianWidth && IsAmbiguousWidth(r)) || inTables(r, doublewidth): - return 2 - default: - return 1 } -} - -func (c *Condition) stringWidth(s string) (width int) { - for _, r := range []rune(s) { - width += c.RuneWidth(r) + if len(c.combinedLut) > 0 { + return int(c.combinedLut[r>>1]>>(uint(r&1)*4)) & 3 } - return width -} - -func (c *Condition) stringWidthZeroJoiner(s string) (width int) { - r1, r2 := rune(0), rune(0) - for _, r := range []rune(s) { - if r == 0xFE0E || r == 0xFE0F { - continue + // optimized version, verified by TestRuneWidthChecksums() + if !c.EastAsianWidth { + switch { + case r < 0x20: + return 0 + case (r >= 0x7F && r <= 0x9F) || r == 0xAD: // nonprint + return 0 + case r < 0x300: + return 1 + case inTable(r, narrow): + return 1 + case inTables(r, nonprint, combining): + return 0 + case inTable(r, doublewidth): + return 2 + default: + return 1 } - w := c.RuneWidth(r) - if r2 == 0x200D && inTables(r, emoji) && inTables(r1, emoji) { - if width < w { - width = w - } - } else { - width += w + } else { + switch { + case inTables(r, nonprint, combining): + return 0 + case inTable(r, narrow): + return 1 + case inTables(r, ambiguous, doublewidth): + return 2 + case !c.StrictEmojiNeutral && inTables(r, ambiguous, emoji, narrow): + return 2 + default: + return 1 } - r1, r2 = r2, r } - return width +} + +// CreateLUT will create an in-memory lookup table of 557056 bytes for faster operation. +// This should not be called concurrently with other operations on c. +// If options in c is changed, CreateLUT should be called again. +func (c *Condition) CreateLUT() { + const max = 0x110000 + lut := c.combinedLut + if len(c.combinedLut) != 0 { + // Remove so we don't use it. + c.combinedLut = nil + } else { + lut = make([]byte, max/2) + } + for i := range lut { + i32 := int32(i * 2) + x0 := c.RuneWidth(i32) + x1 := c.RuneWidth(i32 + 1) + lut[i] = uint8(x0) | uint8(x1)<<4 + } + c.combinedLut = lut } // StringWidth return width as you can see func (c *Condition) StringWidth(s string) (width int) { - if c.ZeroWidthJoiner { - return c.stringWidthZeroJoiner(s) + g := uniseg.NewGraphemes(s) + for g.Next() { + var chWidth int + for _, r := range g.Runes() { + chWidth = c.RuneWidth(r) + if chWidth > 0 { + break // Our best guess at this point is to use the width of the first non-zero-width rune. + } + } + width += chWidth } - return c.stringWidth(s) + return } // Truncate return string truncated with w cells @@ -149,27 +194,69 @@ func (c *Condition) Truncate(s string, w int, tail string) string { if c.StringWidth(s) <= w { return s } - r := []rune(s) - tw := c.StringWidth(tail) - w -= tw - width := 0 - i := 0 - for ; i < len(r); i++ { - cw := c.RuneWidth(r[i]) - if width+cw > w { + w -= c.StringWidth(tail) + var width int + pos := len(s) + g := uniseg.NewGraphemes(s) + for g.Next() { + var chWidth int + for _, r := range g.Runes() { + chWidth = c.RuneWidth(r) + if chWidth > 0 { + break // See StringWidth() for details. + } + } + if width+chWidth > w { + pos, _ = g.Positions() break } - width += cw + width += chWidth + } + return s[:pos] + tail +} + +// TruncateLeft cuts w cells from the beginning of the `s`. +func (c *Condition) TruncateLeft(s string, w int, prefix string) string { + if c.StringWidth(s) <= w { + return prefix + } + + var width int + pos := len(s) + + g := uniseg.NewGraphemes(s) + for g.Next() { + var chWidth int + for _, r := range g.Runes() { + chWidth = c.RuneWidth(r) + if chWidth > 0 { + break // See StringWidth() for details. + } + } + + if width+chWidth > w { + if width < w { + _, pos = g.Positions() + prefix += strings.Repeat(" ", width+chWidth-w) + } else { + pos, _ = g.Positions() + } + + break + } + + width += chWidth } - return string(r[0:i]) + tail + + return prefix + s[pos:] } // Wrap return string wrapped with w cells func (c *Condition) Wrap(s string, w int) string { width := 0 out := "" - for _, r := range []rune(s) { - cw := RuneWidth(r) + for _, r := range s { + cw := c.RuneWidth(r) if r == '\n' { out += string(r) width = 0 @@ -241,6 +328,11 @@ func Truncate(s string, w int, tail string) string { return DefaultCondition.Truncate(s, w, tail) } +// TruncateLeft cuts w cells from the beginning of the `s`. +func TruncateLeft(s string, w int, prefix string) string { + return DefaultCondition.TruncateLeft(s, w, prefix) +} + // Wrap return string wrapped with w cells func Wrap(s string, w int) string { return DefaultCondition.Wrap(s, w) @@ -255,3 +347,12 @@ func FillLeft(s string, w int) string { func FillRight(s string, w int) string { return DefaultCondition.FillRight(s, w) } + +// CreateLUT will create an in-memory lookup table of 557055 bytes for faster operation. +// This should not be called concurrently with other operations. +func CreateLUT() { + if len(DefaultCondition.combinedLut) > 0 { + return + } + DefaultCondition.CreateLUT() +} diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_appengine.go b/vendor/github.com/mattn/go-runewidth/runewidth_appengine.go index 7d99f6e521..84b6528dfe 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth_appengine.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth_appengine.go @@ -1,3 +1,4 @@ +//go:build appengine // +build appengine package runewidth diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_js.go b/vendor/github.com/mattn/go-runewidth/runewidth_js.go index c5fdf40baa..c2abbc2db3 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth_js.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth_js.go @@ -1,5 +1,5 @@ -// +build js -// +build !appengine +//go:build js && !appengine +// +build js,!appengine package runewidth diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_posix.go b/vendor/github.com/mattn/go-runewidth/runewidth_posix.go index 480ad74853..5a31d738ec 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth_posix.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth_posix.go @@ -1,6 +1,5 @@ -// +build !windows -// +build !js -// +build !appengine +//go:build !windows && !js && !appengine +// +build !windows,!js,!appengine package runewidth diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_table.go b/vendor/github.com/mattn/go-runewidth/runewidth_table.go index b27d77d891..ad025ad529 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth_table.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth_table.go @@ -4,20 +4,21 @@ package runewidth var combining = table{ {0x0300, 0x036F}, {0x0483, 0x0489}, {0x07EB, 0x07F3}, - {0x0C00, 0x0C00}, {0x0C04, 0x0C04}, {0x0D00, 0x0D01}, - {0x135D, 0x135F}, {0x1A7F, 0x1A7F}, {0x1AB0, 0x1AC0}, - {0x1B6B, 0x1B73}, {0x1DC0, 0x1DF9}, {0x1DFB, 0x1DFF}, + {0x0C00, 0x0C00}, {0x0C04, 0x0C04}, {0x0CF3, 0x0CF3}, + {0x0D00, 0x0D01}, {0x135D, 0x135F}, {0x1A7F, 0x1A7F}, + {0x1AB0, 0x1ACE}, {0x1B6B, 0x1B73}, {0x1DC0, 0x1DFF}, {0x20D0, 0x20F0}, {0x2CEF, 0x2CF1}, {0x2DE0, 0x2DFF}, {0x3099, 0x309A}, {0xA66F, 0xA672}, {0xA674, 0xA67D}, {0xA69E, 0xA69F}, {0xA6F0, 0xA6F1}, {0xA8E0, 0xA8F1}, {0xFE20, 0xFE2F}, {0x101FD, 0x101FD}, {0x10376, 0x1037A}, - {0x10EAB, 0x10EAC}, {0x10F46, 0x10F50}, {0x11300, 0x11301}, - {0x1133B, 0x1133C}, {0x11366, 0x1136C}, {0x11370, 0x11374}, - {0x16AF0, 0x16AF4}, {0x1D165, 0x1D169}, {0x1D16D, 0x1D172}, + {0x10EAB, 0x10EAC}, {0x10F46, 0x10F50}, {0x10F82, 0x10F85}, + {0x11300, 0x11301}, {0x1133B, 0x1133C}, {0x11366, 0x1136C}, + {0x11370, 0x11374}, {0x16AF0, 0x16AF4}, {0x1CF00, 0x1CF2D}, + {0x1CF30, 0x1CF46}, {0x1D165, 0x1D169}, {0x1D16D, 0x1D172}, {0x1D17B, 0x1D182}, {0x1D185, 0x1D18B}, {0x1D1AA, 0x1D1AD}, {0x1D242, 0x1D244}, {0x1E000, 0x1E006}, {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, {0x1E023, 0x1E024}, {0x1E026, 0x1E02A}, - {0x1E8D0, 0x1E8D6}, + {0x1E08F, 0x1E08F}, {0x1E8D0, 0x1E8D6}, } var doublewidth = table{ @@ -33,33 +34,34 @@ var doublewidth = table{ {0x2753, 0x2755}, {0x2757, 0x2757}, {0x2795, 0x2797}, {0x27B0, 0x27B0}, {0x27BF, 0x27BF}, {0x2B1B, 0x2B1C}, {0x2B50, 0x2B50}, {0x2B55, 0x2B55}, {0x2E80, 0x2E99}, - {0x2E9B, 0x2EF3}, {0x2F00, 0x2FD5}, {0x2FF0, 0x2FFB}, - {0x3000, 0x303E}, {0x3041, 0x3096}, {0x3099, 0x30FF}, - {0x3105, 0x312F}, {0x3131, 0x318E}, {0x3190, 0x31E3}, - {0x31F0, 0x321E}, {0x3220, 0x3247}, {0x3250, 0x4DBF}, - {0x4E00, 0xA48C}, {0xA490, 0xA4C6}, {0xA960, 0xA97C}, - {0xAC00, 0xD7A3}, {0xF900, 0xFAFF}, {0xFE10, 0xFE19}, - {0xFE30, 0xFE52}, {0xFE54, 0xFE66}, {0xFE68, 0xFE6B}, - {0xFF01, 0xFF60}, {0xFFE0, 0xFFE6}, {0x16FE0, 0x16FE4}, - {0x16FF0, 0x16FF1}, {0x17000, 0x187F7}, {0x18800, 0x18CD5}, - {0x18D00, 0x18D08}, {0x1B000, 0x1B11E}, {0x1B150, 0x1B152}, - {0x1B164, 0x1B167}, {0x1B170, 0x1B2FB}, {0x1F004, 0x1F004}, - {0x1F0CF, 0x1F0CF}, {0x1F18E, 0x1F18E}, {0x1F191, 0x1F19A}, - {0x1F200, 0x1F202}, {0x1F210, 0x1F23B}, {0x1F240, 0x1F248}, - {0x1F250, 0x1F251}, {0x1F260, 0x1F265}, {0x1F300, 0x1F320}, - {0x1F32D, 0x1F335}, {0x1F337, 0x1F37C}, {0x1F37E, 0x1F393}, - {0x1F3A0, 0x1F3CA}, {0x1F3CF, 0x1F3D3}, {0x1F3E0, 0x1F3F0}, - {0x1F3F4, 0x1F3F4}, {0x1F3F8, 0x1F43E}, {0x1F440, 0x1F440}, - {0x1F442, 0x1F4FC}, {0x1F4FF, 0x1F53D}, {0x1F54B, 0x1F54E}, - {0x1F550, 0x1F567}, {0x1F57A, 0x1F57A}, {0x1F595, 0x1F596}, - {0x1F5A4, 0x1F5A4}, {0x1F5FB, 0x1F64F}, {0x1F680, 0x1F6C5}, - {0x1F6CC, 0x1F6CC}, {0x1F6D0, 0x1F6D2}, {0x1F6D5, 0x1F6D7}, - {0x1F6EB, 0x1F6EC}, {0x1F6F4, 0x1F6FC}, {0x1F7E0, 0x1F7EB}, - {0x1F90C, 0x1F93A}, {0x1F93C, 0x1F945}, {0x1F947, 0x1F978}, - {0x1F97A, 0x1F9CB}, {0x1F9CD, 0x1F9FF}, {0x1FA70, 0x1FA74}, - {0x1FA78, 0x1FA7A}, {0x1FA80, 0x1FA86}, {0x1FA90, 0x1FAA8}, - {0x1FAB0, 0x1FAB6}, {0x1FAC0, 0x1FAC2}, {0x1FAD0, 0x1FAD6}, - {0x20000, 0x2FFFD}, {0x30000, 0x3FFFD}, + {0x2E9B, 0x2EF3}, {0x2F00, 0x2FD5}, {0x2FF0, 0x303E}, + {0x3041, 0x3096}, {0x3099, 0x30FF}, {0x3105, 0x312F}, + {0x3131, 0x318E}, {0x3190, 0x31E3}, {0x31EF, 0x321E}, + {0x3220, 0x3247}, {0x3250, 0x4DBF}, {0x4E00, 0xA48C}, + {0xA490, 0xA4C6}, {0xA960, 0xA97C}, {0xAC00, 0xD7A3}, + {0xF900, 0xFAFF}, {0xFE10, 0xFE19}, {0xFE30, 0xFE52}, + {0xFE54, 0xFE66}, {0xFE68, 0xFE6B}, {0xFF01, 0xFF60}, + {0xFFE0, 0xFFE6}, {0x16FE0, 0x16FE4}, {0x16FF0, 0x16FF1}, + {0x17000, 0x187F7}, {0x18800, 0x18CD5}, {0x18D00, 0x18D08}, + {0x1AFF0, 0x1AFF3}, {0x1AFF5, 0x1AFFB}, {0x1AFFD, 0x1AFFE}, + {0x1B000, 0x1B122}, {0x1B132, 0x1B132}, {0x1B150, 0x1B152}, + {0x1B155, 0x1B155}, {0x1B164, 0x1B167}, {0x1B170, 0x1B2FB}, + {0x1F004, 0x1F004}, {0x1F0CF, 0x1F0CF}, {0x1F18E, 0x1F18E}, + {0x1F191, 0x1F19A}, {0x1F200, 0x1F202}, {0x1F210, 0x1F23B}, + {0x1F240, 0x1F248}, {0x1F250, 0x1F251}, {0x1F260, 0x1F265}, + {0x1F300, 0x1F320}, {0x1F32D, 0x1F335}, {0x1F337, 0x1F37C}, + {0x1F37E, 0x1F393}, {0x1F3A0, 0x1F3CA}, {0x1F3CF, 0x1F3D3}, + {0x1F3E0, 0x1F3F0}, {0x1F3F4, 0x1F3F4}, {0x1F3F8, 0x1F43E}, + {0x1F440, 0x1F440}, {0x1F442, 0x1F4FC}, {0x1F4FF, 0x1F53D}, + {0x1F54B, 0x1F54E}, {0x1F550, 0x1F567}, {0x1F57A, 0x1F57A}, + {0x1F595, 0x1F596}, {0x1F5A4, 0x1F5A4}, {0x1F5FB, 0x1F64F}, + {0x1F680, 0x1F6C5}, {0x1F6CC, 0x1F6CC}, {0x1F6D0, 0x1F6D2}, + {0x1F6D5, 0x1F6D7}, {0x1F6DC, 0x1F6DF}, {0x1F6EB, 0x1F6EC}, + {0x1F6F4, 0x1F6FC}, {0x1F7E0, 0x1F7EB}, {0x1F7F0, 0x1F7F0}, + {0x1F90C, 0x1F93A}, {0x1F93C, 0x1F945}, {0x1F947, 0x1F9FF}, + {0x1FA70, 0x1FA7C}, {0x1FA80, 0x1FA88}, {0x1FA90, 0x1FABD}, + {0x1FABF, 0x1FAC5}, {0x1FACE, 0x1FADB}, {0x1FAE0, 0x1FAE8}, + {0x1FAF0, 0x1FAF8}, {0x20000, 0x2FFFD}, {0x30000, 0x3FFFD}, } var ambiguous = table{ @@ -124,8 +126,10 @@ var ambiguous = table{ {0x1F18F, 0x1F190}, {0x1F19B, 0x1F1AC}, {0xE0100, 0xE01EF}, {0xF0000, 0xFFFFD}, {0x100000, 0x10FFFD}, } -var notassigned = table{ - {0x27E6, 0x27ED}, {0x2985, 0x2986}, +var narrow = table{ + {0x0020, 0x007E}, {0x00A2, 0x00A3}, {0x00A5, 0x00A6}, + {0x00AC, 0x00AC}, {0x00AF, 0x00AF}, {0x27E6, 0x27ED}, + {0x2985, 0x2986}, } var neutral = table{ @@ -152,43 +156,43 @@ var neutral = table{ {0x0402, 0x040F}, {0x0450, 0x0450}, {0x0452, 0x052F}, {0x0531, 0x0556}, {0x0559, 0x058A}, {0x058D, 0x058F}, {0x0591, 0x05C7}, {0x05D0, 0x05EA}, {0x05EF, 0x05F4}, - {0x0600, 0x061C}, {0x061E, 0x070D}, {0x070F, 0x074A}, - {0x074D, 0x07B1}, {0x07C0, 0x07FA}, {0x07FD, 0x082D}, - {0x0830, 0x083E}, {0x0840, 0x085B}, {0x085E, 0x085E}, - {0x0860, 0x086A}, {0x08A0, 0x08B4}, {0x08B6, 0x08C7}, - {0x08D3, 0x0983}, {0x0985, 0x098C}, {0x098F, 0x0990}, - {0x0993, 0x09A8}, {0x09AA, 0x09B0}, {0x09B2, 0x09B2}, - {0x09B6, 0x09B9}, {0x09BC, 0x09C4}, {0x09C7, 0x09C8}, - {0x09CB, 0x09CE}, {0x09D7, 0x09D7}, {0x09DC, 0x09DD}, - {0x09DF, 0x09E3}, {0x09E6, 0x09FE}, {0x0A01, 0x0A03}, - {0x0A05, 0x0A0A}, {0x0A0F, 0x0A10}, {0x0A13, 0x0A28}, - {0x0A2A, 0x0A30}, {0x0A32, 0x0A33}, {0x0A35, 0x0A36}, - {0x0A38, 0x0A39}, {0x0A3C, 0x0A3C}, {0x0A3E, 0x0A42}, - {0x0A47, 0x0A48}, {0x0A4B, 0x0A4D}, {0x0A51, 0x0A51}, - {0x0A59, 0x0A5C}, {0x0A5E, 0x0A5E}, {0x0A66, 0x0A76}, - {0x0A81, 0x0A83}, {0x0A85, 0x0A8D}, {0x0A8F, 0x0A91}, - {0x0A93, 0x0AA8}, {0x0AAA, 0x0AB0}, {0x0AB2, 0x0AB3}, - {0x0AB5, 0x0AB9}, {0x0ABC, 0x0AC5}, {0x0AC7, 0x0AC9}, - {0x0ACB, 0x0ACD}, {0x0AD0, 0x0AD0}, {0x0AE0, 0x0AE3}, - {0x0AE6, 0x0AF1}, {0x0AF9, 0x0AFF}, {0x0B01, 0x0B03}, - {0x0B05, 0x0B0C}, {0x0B0F, 0x0B10}, {0x0B13, 0x0B28}, - {0x0B2A, 0x0B30}, {0x0B32, 0x0B33}, {0x0B35, 0x0B39}, - {0x0B3C, 0x0B44}, {0x0B47, 0x0B48}, {0x0B4B, 0x0B4D}, - {0x0B55, 0x0B57}, {0x0B5C, 0x0B5D}, {0x0B5F, 0x0B63}, - {0x0B66, 0x0B77}, {0x0B82, 0x0B83}, {0x0B85, 0x0B8A}, - {0x0B8E, 0x0B90}, {0x0B92, 0x0B95}, {0x0B99, 0x0B9A}, - {0x0B9C, 0x0B9C}, {0x0B9E, 0x0B9F}, {0x0BA3, 0x0BA4}, - {0x0BA8, 0x0BAA}, {0x0BAE, 0x0BB9}, {0x0BBE, 0x0BC2}, - {0x0BC6, 0x0BC8}, {0x0BCA, 0x0BCD}, {0x0BD0, 0x0BD0}, - {0x0BD7, 0x0BD7}, {0x0BE6, 0x0BFA}, {0x0C00, 0x0C0C}, - {0x0C0E, 0x0C10}, {0x0C12, 0x0C28}, {0x0C2A, 0x0C39}, - {0x0C3D, 0x0C44}, {0x0C46, 0x0C48}, {0x0C4A, 0x0C4D}, - {0x0C55, 0x0C56}, {0x0C58, 0x0C5A}, {0x0C60, 0x0C63}, + {0x0600, 0x070D}, {0x070F, 0x074A}, {0x074D, 0x07B1}, + {0x07C0, 0x07FA}, {0x07FD, 0x082D}, {0x0830, 0x083E}, + {0x0840, 0x085B}, {0x085E, 0x085E}, {0x0860, 0x086A}, + {0x0870, 0x088E}, {0x0890, 0x0891}, {0x0898, 0x0983}, + {0x0985, 0x098C}, {0x098F, 0x0990}, {0x0993, 0x09A8}, + {0x09AA, 0x09B0}, {0x09B2, 0x09B2}, {0x09B6, 0x09B9}, + {0x09BC, 0x09C4}, {0x09C7, 0x09C8}, {0x09CB, 0x09CE}, + {0x09D7, 0x09D7}, {0x09DC, 0x09DD}, {0x09DF, 0x09E3}, + {0x09E6, 0x09FE}, {0x0A01, 0x0A03}, {0x0A05, 0x0A0A}, + {0x0A0F, 0x0A10}, {0x0A13, 0x0A28}, {0x0A2A, 0x0A30}, + {0x0A32, 0x0A33}, {0x0A35, 0x0A36}, {0x0A38, 0x0A39}, + {0x0A3C, 0x0A3C}, {0x0A3E, 0x0A42}, {0x0A47, 0x0A48}, + {0x0A4B, 0x0A4D}, {0x0A51, 0x0A51}, {0x0A59, 0x0A5C}, + {0x0A5E, 0x0A5E}, {0x0A66, 0x0A76}, {0x0A81, 0x0A83}, + {0x0A85, 0x0A8D}, {0x0A8F, 0x0A91}, {0x0A93, 0x0AA8}, + {0x0AAA, 0x0AB0}, {0x0AB2, 0x0AB3}, {0x0AB5, 0x0AB9}, + {0x0ABC, 0x0AC5}, {0x0AC7, 0x0AC9}, {0x0ACB, 0x0ACD}, + {0x0AD0, 0x0AD0}, {0x0AE0, 0x0AE3}, {0x0AE6, 0x0AF1}, + {0x0AF9, 0x0AFF}, {0x0B01, 0x0B03}, {0x0B05, 0x0B0C}, + {0x0B0F, 0x0B10}, {0x0B13, 0x0B28}, {0x0B2A, 0x0B30}, + {0x0B32, 0x0B33}, {0x0B35, 0x0B39}, {0x0B3C, 0x0B44}, + {0x0B47, 0x0B48}, {0x0B4B, 0x0B4D}, {0x0B55, 0x0B57}, + {0x0B5C, 0x0B5D}, {0x0B5F, 0x0B63}, {0x0B66, 0x0B77}, + {0x0B82, 0x0B83}, {0x0B85, 0x0B8A}, {0x0B8E, 0x0B90}, + {0x0B92, 0x0B95}, {0x0B99, 0x0B9A}, {0x0B9C, 0x0B9C}, + {0x0B9E, 0x0B9F}, {0x0BA3, 0x0BA4}, {0x0BA8, 0x0BAA}, + {0x0BAE, 0x0BB9}, {0x0BBE, 0x0BC2}, {0x0BC6, 0x0BC8}, + {0x0BCA, 0x0BCD}, {0x0BD0, 0x0BD0}, {0x0BD7, 0x0BD7}, + {0x0BE6, 0x0BFA}, {0x0C00, 0x0C0C}, {0x0C0E, 0x0C10}, + {0x0C12, 0x0C28}, {0x0C2A, 0x0C39}, {0x0C3C, 0x0C44}, + {0x0C46, 0x0C48}, {0x0C4A, 0x0C4D}, {0x0C55, 0x0C56}, + {0x0C58, 0x0C5A}, {0x0C5D, 0x0C5D}, {0x0C60, 0x0C63}, {0x0C66, 0x0C6F}, {0x0C77, 0x0C8C}, {0x0C8E, 0x0C90}, {0x0C92, 0x0CA8}, {0x0CAA, 0x0CB3}, {0x0CB5, 0x0CB9}, {0x0CBC, 0x0CC4}, {0x0CC6, 0x0CC8}, {0x0CCA, 0x0CCD}, - {0x0CD5, 0x0CD6}, {0x0CDE, 0x0CDE}, {0x0CE0, 0x0CE3}, - {0x0CE6, 0x0CEF}, {0x0CF1, 0x0CF2}, {0x0D00, 0x0D0C}, + {0x0CD5, 0x0CD6}, {0x0CDD, 0x0CDE}, {0x0CE0, 0x0CE3}, + {0x0CE6, 0x0CEF}, {0x0CF1, 0x0CF3}, {0x0D00, 0x0D0C}, {0x0D0E, 0x0D10}, {0x0D12, 0x0D44}, {0x0D46, 0x0D48}, {0x0D4A, 0x0D4F}, {0x0D54, 0x0D63}, {0x0D66, 0x0D7F}, {0x0D81, 0x0D83}, {0x0D85, 0x0D96}, {0x0D9A, 0x0DB1}, @@ -198,7 +202,7 @@ var neutral = table{ {0x0E01, 0x0E3A}, {0x0E3F, 0x0E5B}, {0x0E81, 0x0E82}, {0x0E84, 0x0E84}, {0x0E86, 0x0E8A}, {0x0E8C, 0x0EA3}, {0x0EA5, 0x0EA5}, {0x0EA7, 0x0EBD}, {0x0EC0, 0x0EC4}, - {0x0EC6, 0x0EC6}, {0x0EC8, 0x0ECD}, {0x0ED0, 0x0ED9}, + {0x0EC6, 0x0EC6}, {0x0EC8, 0x0ECE}, {0x0ED0, 0x0ED9}, {0x0EDC, 0x0EDF}, {0x0F00, 0x0F47}, {0x0F49, 0x0F6C}, {0x0F71, 0x0F97}, {0x0F99, 0x0FBC}, {0x0FBE, 0x0FCC}, {0x0FCE, 0x0FDA}, {0x1000, 0x10C5}, {0x10C7, 0x10C7}, @@ -210,20 +214,19 @@ var neutral = table{ {0x12D8, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x135A}, {0x135D, 0x137C}, {0x1380, 0x1399}, {0x13A0, 0x13F5}, {0x13F8, 0x13FD}, {0x1400, 0x169C}, {0x16A0, 0x16F8}, - {0x1700, 0x170C}, {0x170E, 0x1714}, {0x1720, 0x1736}, - {0x1740, 0x1753}, {0x1760, 0x176C}, {0x176E, 0x1770}, - {0x1772, 0x1773}, {0x1780, 0x17DD}, {0x17E0, 0x17E9}, - {0x17F0, 0x17F9}, {0x1800, 0x180E}, {0x1810, 0x1819}, - {0x1820, 0x1878}, {0x1880, 0x18AA}, {0x18B0, 0x18F5}, - {0x1900, 0x191E}, {0x1920, 0x192B}, {0x1930, 0x193B}, - {0x1940, 0x1940}, {0x1944, 0x196D}, {0x1970, 0x1974}, - {0x1980, 0x19AB}, {0x19B0, 0x19C9}, {0x19D0, 0x19DA}, - {0x19DE, 0x1A1B}, {0x1A1E, 0x1A5E}, {0x1A60, 0x1A7C}, - {0x1A7F, 0x1A89}, {0x1A90, 0x1A99}, {0x1AA0, 0x1AAD}, - {0x1AB0, 0x1AC0}, {0x1B00, 0x1B4B}, {0x1B50, 0x1B7C}, - {0x1B80, 0x1BF3}, {0x1BFC, 0x1C37}, {0x1C3B, 0x1C49}, - {0x1C4D, 0x1C88}, {0x1C90, 0x1CBA}, {0x1CBD, 0x1CC7}, - {0x1CD0, 0x1CFA}, {0x1D00, 0x1DF9}, {0x1DFB, 0x1F15}, + {0x1700, 0x1715}, {0x171F, 0x1736}, {0x1740, 0x1753}, + {0x1760, 0x176C}, {0x176E, 0x1770}, {0x1772, 0x1773}, + {0x1780, 0x17DD}, {0x17E0, 0x17E9}, {0x17F0, 0x17F9}, + {0x1800, 0x1819}, {0x1820, 0x1878}, {0x1880, 0x18AA}, + {0x18B0, 0x18F5}, {0x1900, 0x191E}, {0x1920, 0x192B}, + {0x1930, 0x193B}, {0x1940, 0x1940}, {0x1944, 0x196D}, + {0x1970, 0x1974}, {0x1980, 0x19AB}, {0x19B0, 0x19C9}, + {0x19D0, 0x19DA}, {0x19DE, 0x1A1B}, {0x1A1E, 0x1A5E}, + {0x1A60, 0x1A7C}, {0x1A7F, 0x1A89}, {0x1A90, 0x1A99}, + {0x1AA0, 0x1AAD}, {0x1AB0, 0x1ACE}, {0x1B00, 0x1B4C}, + {0x1B50, 0x1B7E}, {0x1B80, 0x1BF3}, {0x1BFC, 0x1C37}, + {0x1C3B, 0x1C49}, {0x1C4D, 0x1C88}, {0x1C90, 0x1CBA}, + {0x1CBD, 0x1CC7}, {0x1CD0, 0x1CFA}, {0x1D00, 0x1F15}, {0x1F18, 0x1F1D}, {0x1F20, 0x1F45}, {0x1F48, 0x1F4D}, {0x1F50, 0x1F57}, {0x1F59, 0x1F59}, {0x1F5B, 0x1F5B}, {0x1F5D, 0x1F5D}, {0x1F5F, 0x1F7D}, {0x1F80, 0x1FB4}, @@ -235,7 +238,7 @@ var neutral = table{ {0x2036, 0x203A}, {0x203C, 0x203D}, {0x203F, 0x2064}, {0x2066, 0x2071}, {0x2075, 0x207E}, {0x2080, 0x2080}, {0x2085, 0x208E}, {0x2090, 0x209C}, {0x20A0, 0x20A8}, - {0x20AA, 0x20AB}, {0x20AD, 0x20BF}, {0x20D0, 0x20F0}, + {0x20AA, 0x20AB}, {0x20AD, 0x20C0}, {0x20D0, 0x20F0}, {0x2100, 0x2102}, {0x2104, 0x2104}, {0x2106, 0x2108}, {0x210A, 0x2112}, {0x2114, 0x2115}, {0x2117, 0x2120}, {0x2123, 0x2125}, {0x2127, 0x212A}, {0x212C, 0x2152}, @@ -273,15 +276,15 @@ var neutral = table{ {0x2780, 0x2794}, {0x2798, 0x27AF}, {0x27B1, 0x27BE}, {0x27C0, 0x27E5}, {0x27EE, 0x2984}, {0x2987, 0x2B1A}, {0x2B1D, 0x2B4F}, {0x2B51, 0x2B54}, {0x2B5A, 0x2B73}, - {0x2B76, 0x2B95}, {0x2B97, 0x2C2E}, {0x2C30, 0x2C5E}, - {0x2C60, 0x2CF3}, {0x2CF9, 0x2D25}, {0x2D27, 0x2D27}, - {0x2D2D, 0x2D2D}, {0x2D30, 0x2D67}, {0x2D6F, 0x2D70}, - {0x2D7F, 0x2D96}, {0x2DA0, 0x2DA6}, {0x2DA8, 0x2DAE}, - {0x2DB0, 0x2DB6}, {0x2DB8, 0x2DBE}, {0x2DC0, 0x2DC6}, - {0x2DC8, 0x2DCE}, {0x2DD0, 0x2DD6}, {0x2DD8, 0x2DDE}, - {0x2DE0, 0x2E52}, {0x303F, 0x303F}, {0x4DC0, 0x4DFF}, - {0xA4D0, 0xA62B}, {0xA640, 0xA6F7}, {0xA700, 0xA7BF}, - {0xA7C2, 0xA7CA}, {0xA7F5, 0xA82C}, {0xA830, 0xA839}, + {0x2B76, 0x2B95}, {0x2B97, 0x2CF3}, {0x2CF9, 0x2D25}, + {0x2D27, 0x2D27}, {0x2D2D, 0x2D2D}, {0x2D30, 0x2D67}, + {0x2D6F, 0x2D70}, {0x2D7F, 0x2D96}, {0x2DA0, 0x2DA6}, + {0x2DA8, 0x2DAE}, {0x2DB0, 0x2DB6}, {0x2DB8, 0x2DBE}, + {0x2DC0, 0x2DC6}, {0x2DC8, 0x2DCE}, {0x2DD0, 0x2DD6}, + {0x2DD8, 0x2DDE}, {0x2DE0, 0x2E5D}, {0x303F, 0x303F}, + {0x4DC0, 0x4DFF}, {0xA4D0, 0xA62B}, {0xA640, 0xA6F7}, + {0xA700, 0xA7CA}, {0xA7D0, 0xA7D1}, {0xA7D3, 0xA7D3}, + {0xA7D5, 0xA7D9}, {0xA7F2, 0xA82C}, {0xA830, 0xA839}, {0xA840, 0xA877}, {0xA880, 0xA8C5}, {0xA8CE, 0xA8D9}, {0xA8E0, 0xA953}, {0xA95F, 0xA95F}, {0xA980, 0xA9CD}, {0xA9CF, 0xA9D9}, {0xA9DE, 0xA9FE}, {0xAA00, 0xAA36}, @@ -292,8 +295,8 @@ var neutral = table{ {0xD7B0, 0xD7C6}, {0xD7CB, 0xD7FB}, {0xD800, 0xDFFF}, {0xFB00, 0xFB06}, {0xFB13, 0xFB17}, {0xFB1D, 0xFB36}, {0xFB38, 0xFB3C}, {0xFB3E, 0xFB3E}, {0xFB40, 0xFB41}, - {0xFB43, 0xFB44}, {0xFB46, 0xFBC1}, {0xFBD3, 0xFD3F}, - {0xFD50, 0xFD8F}, {0xFD92, 0xFDC7}, {0xFDF0, 0xFDFD}, + {0xFB43, 0xFB44}, {0xFB46, 0xFBC2}, {0xFBD3, 0xFD8F}, + {0xFD92, 0xFDC7}, {0xFDCF, 0xFDCF}, {0xFDF0, 0xFDFF}, {0xFE20, 0xFE2F}, {0xFE70, 0xFE74}, {0xFE76, 0xFEFC}, {0xFEFF, 0xFEFF}, {0xFFF9, 0xFFFC}, {0x10000, 0x1000B}, {0x1000D, 0x10026}, {0x10028, 0x1003A}, {0x1003C, 0x1003D}, @@ -305,44 +308,48 @@ var neutral = table{ {0x10380, 0x1039D}, {0x1039F, 0x103C3}, {0x103C8, 0x103D5}, {0x10400, 0x1049D}, {0x104A0, 0x104A9}, {0x104B0, 0x104D3}, {0x104D8, 0x104FB}, {0x10500, 0x10527}, {0x10530, 0x10563}, - {0x1056F, 0x1056F}, {0x10600, 0x10736}, {0x10740, 0x10755}, - {0x10760, 0x10767}, {0x10800, 0x10805}, {0x10808, 0x10808}, - {0x1080A, 0x10835}, {0x10837, 0x10838}, {0x1083C, 0x1083C}, - {0x1083F, 0x10855}, {0x10857, 0x1089E}, {0x108A7, 0x108AF}, - {0x108E0, 0x108F2}, {0x108F4, 0x108F5}, {0x108FB, 0x1091B}, - {0x1091F, 0x10939}, {0x1093F, 0x1093F}, {0x10980, 0x109B7}, - {0x109BC, 0x109CF}, {0x109D2, 0x10A03}, {0x10A05, 0x10A06}, - {0x10A0C, 0x10A13}, {0x10A15, 0x10A17}, {0x10A19, 0x10A35}, - {0x10A38, 0x10A3A}, {0x10A3F, 0x10A48}, {0x10A50, 0x10A58}, - {0x10A60, 0x10A9F}, {0x10AC0, 0x10AE6}, {0x10AEB, 0x10AF6}, - {0x10B00, 0x10B35}, {0x10B39, 0x10B55}, {0x10B58, 0x10B72}, - {0x10B78, 0x10B91}, {0x10B99, 0x10B9C}, {0x10BA9, 0x10BAF}, - {0x10C00, 0x10C48}, {0x10C80, 0x10CB2}, {0x10CC0, 0x10CF2}, - {0x10CFA, 0x10D27}, {0x10D30, 0x10D39}, {0x10E60, 0x10E7E}, - {0x10E80, 0x10EA9}, {0x10EAB, 0x10EAD}, {0x10EB0, 0x10EB1}, - {0x10F00, 0x10F27}, {0x10F30, 0x10F59}, {0x10FB0, 0x10FCB}, - {0x10FE0, 0x10FF6}, {0x11000, 0x1104D}, {0x11052, 0x1106F}, - {0x1107F, 0x110C1}, {0x110CD, 0x110CD}, {0x110D0, 0x110E8}, - {0x110F0, 0x110F9}, {0x11100, 0x11134}, {0x11136, 0x11147}, - {0x11150, 0x11176}, {0x11180, 0x111DF}, {0x111E1, 0x111F4}, - {0x11200, 0x11211}, {0x11213, 0x1123E}, {0x11280, 0x11286}, - {0x11288, 0x11288}, {0x1128A, 0x1128D}, {0x1128F, 0x1129D}, - {0x1129F, 0x112A9}, {0x112B0, 0x112EA}, {0x112F0, 0x112F9}, - {0x11300, 0x11303}, {0x11305, 0x1130C}, {0x1130F, 0x11310}, - {0x11313, 0x11328}, {0x1132A, 0x11330}, {0x11332, 0x11333}, - {0x11335, 0x11339}, {0x1133B, 0x11344}, {0x11347, 0x11348}, - {0x1134B, 0x1134D}, {0x11350, 0x11350}, {0x11357, 0x11357}, - {0x1135D, 0x11363}, {0x11366, 0x1136C}, {0x11370, 0x11374}, - {0x11400, 0x1145B}, {0x1145D, 0x11461}, {0x11480, 0x114C7}, - {0x114D0, 0x114D9}, {0x11580, 0x115B5}, {0x115B8, 0x115DD}, - {0x11600, 0x11644}, {0x11650, 0x11659}, {0x11660, 0x1166C}, - {0x11680, 0x116B8}, {0x116C0, 0x116C9}, {0x11700, 0x1171A}, - {0x1171D, 0x1172B}, {0x11730, 0x1173F}, {0x11800, 0x1183B}, - {0x118A0, 0x118F2}, {0x118FF, 0x11906}, {0x11909, 0x11909}, - {0x1190C, 0x11913}, {0x11915, 0x11916}, {0x11918, 0x11935}, - {0x11937, 0x11938}, {0x1193B, 0x11946}, {0x11950, 0x11959}, - {0x119A0, 0x119A7}, {0x119AA, 0x119D7}, {0x119DA, 0x119E4}, - {0x11A00, 0x11A47}, {0x11A50, 0x11AA2}, {0x11AC0, 0x11AF8}, + {0x1056F, 0x1057A}, {0x1057C, 0x1058A}, {0x1058C, 0x10592}, + {0x10594, 0x10595}, {0x10597, 0x105A1}, {0x105A3, 0x105B1}, + {0x105B3, 0x105B9}, {0x105BB, 0x105BC}, {0x10600, 0x10736}, + {0x10740, 0x10755}, {0x10760, 0x10767}, {0x10780, 0x10785}, + {0x10787, 0x107B0}, {0x107B2, 0x107BA}, {0x10800, 0x10805}, + {0x10808, 0x10808}, {0x1080A, 0x10835}, {0x10837, 0x10838}, + {0x1083C, 0x1083C}, {0x1083F, 0x10855}, {0x10857, 0x1089E}, + {0x108A7, 0x108AF}, {0x108E0, 0x108F2}, {0x108F4, 0x108F5}, + {0x108FB, 0x1091B}, {0x1091F, 0x10939}, {0x1093F, 0x1093F}, + {0x10980, 0x109B7}, {0x109BC, 0x109CF}, {0x109D2, 0x10A03}, + {0x10A05, 0x10A06}, {0x10A0C, 0x10A13}, {0x10A15, 0x10A17}, + {0x10A19, 0x10A35}, {0x10A38, 0x10A3A}, {0x10A3F, 0x10A48}, + {0x10A50, 0x10A58}, {0x10A60, 0x10A9F}, {0x10AC0, 0x10AE6}, + {0x10AEB, 0x10AF6}, {0x10B00, 0x10B35}, {0x10B39, 0x10B55}, + {0x10B58, 0x10B72}, {0x10B78, 0x10B91}, {0x10B99, 0x10B9C}, + {0x10BA9, 0x10BAF}, {0x10C00, 0x10C48}, {0x10C80, 0x10CB2}, + {0x10CC0, 0x10CF2}, {0x10CFA, 0x10D27}, {0x10D30, 0x10D39}, + {0x10E60, 0x10E7E}, {0x10E80, 0x10EA9}, {0x10EAB, 0x10EAD}, + {0x10EB0, 0x10EB1}, {0x10EFD, 0x10F27}, {0x10F30, 0x10F59}, + {0x10F70, 0x10F89}, {0x10FB0, 0x10FCB}, {0x10FE0, 0x10FF6}, + {0x11000, 0x1104D}, {0x11052, 0x11075}, {0x1107F, 0x110C2}, + {0x110CD, 0x110CD}, {0x110D0, 0x110E8}, {0x110F0, 0x110F9}, + {0x11100, 0x11134}, {0x11136, 0x11147}, {0x11150, 0x11176}, + {0x11180, 0x111DF}, {0x111E1, 0x111F4}, {0x11200, 0x11211}, + {0x11213, 0x11241}, {0x11280, 0x11286}, {0x11288, 0x11288}, + {0x1128A, 0x1128D}, {0x1128F, 0x1129D}, {0x1129F, 0x112A9}, + {0x112B0, 0x112EA}, {0x112F0, 0x112F9}, {0x11300, 0x11303}, + {0x11305, 0x1130C}, {0x1130F, 0x11310}, {0x11313, 0x11328}, + {0x1132A, 0x11330}, {0x11332, 0x11333}, {0x11335, 0x11339}, + {0x1133B, 0x11344}, {0x11347, 0x11348}, {0x1134B, 0x1134D}, + {0x11350, 0x11350}, {0x11357, 0x11357}, {0x1135D, 0x11363}, + {0x11366, 0x1136C}, {0x11370, 0x11374}, {0x11400, 0x1145B}, + {0x1145D, 0x11461}, {0x11480, 0x114C7}, {0x114D0, 0x114D9}, + {0x11580, 0x115B5}, {0x115B8, 0x115DD}, {0x11600, 0x11644}, + {0x11650, 0x11659}, {0x11660, 0x1166C}, {0x11680, 0x116B9}, + {0x116C0, 0x116C9}, {0x11700, 0x1171A}, {0x1171D, 0x1172B}, + {0x11730, 0x11746}, {0x11800, 0x1183B}, {0x118A0, 0x118F2}, + {0x118FF, 0x11906}, {0x11909, 0x11909}, {0x1190C, 0x11913}, + {0x11915, 0x11916}, {0x11918, 0x11935}, {0x11937, 0x11938}, + {0x1193B, 0x11946}, {0x11950, 0x11959}, {0x119A0, 0x119A7}, + {0x119AA, 0x119D7}, {0x119DA, 0x119E4}, {0x11A00, 0x11A47}, + {0x11A50, 0x11AA2}, {0x11AB0, 0x11AF8}, {0x11B00, 0x11B09}, {0x11C00, 0x11C08}, {0x11C0A, 0x11C36}, {0x11C38, 0x11C45}, {0x11C50, 0x11C6C}, {0x11C70, 0x11C8F}, {0x11C92, 0x11CA7}, {0x11CA9, 0x11CB6}, {0x11D00, 0x11D06}, {0x11D08, 0x11D09}, @@ -350,30 +357,36 @@ var neutral = table{ {0x11D3F, 0x11D47}, {0x11D50, 0x11D59}, {0x11D60, 0x11D65}, {0x11D67, 0x11D68}, {0x11D6A, 0x11D8E}, {0x11D90, 0x11D91}, {0x11D93, 0x11D98}, {0x11DA0, 0x11DA9}, {0x11EE0, 0x11EF8}, + {0x11F00, 0x11F10}, {0x11F12, 0x11F3A}, {0x11F3E, 0x11F59}, {0x11FB0, 0x11FB0}, {0x11FC0, 0x11FF1}, {0x11FFF, 0x12399}, {0x12400, 0x1246E}, {0x12470, 0x12474}, {0x12480, 0x12543}, - {0x13000, 0x1342E}, {0x13430, 0x13438}, {0x14400, 0x14646}, + {0x12F90, 0x12FF2}, {0x13000, 0x13455}, {0x14400, 0x14646}, {0x16800, 0x16A38}, {0x16A40, 0x16A5E}, {0x16A60, 0x16A69}, - {0x16A6E, 0x16A6F}, {0x16AD0, 0x16AED}, {0x16AF0, 0x16AF5}, - {0x16B00, 0x16B45}, {0x16B50, 0x16B59}, {0x16B5B, 0x16B61}, - {0x16B63, 0x16B77}, {0x16B7D, 0x16B8F}, {0x16E40, 0x16E9A}, - {0x16F00, 0x16F4A}, {0x16F4F, 0x16F87}, {0x16F8F, 0x16F9F}, - {0x1BC00, 0x1BC6A}, {0x1BC70, 0x1BC7C}, {0x1BC80, 0x1BC88}, - {0x1BC90, 0x1BC99}, {0x1BC9C, 0x1BCA3}, {0x1D000, 0x1D0F5}, - {0x1D100, 0x1D126}, {0x1D129, 0x1D1E8}, {0x1D200, 0x1D245}, - {0x1D2E0, 0x1D2F3}, {0x1D300, 0x1D356}, {0x1D360, 0x1D378}, - {0x1D400, 0x1D454}, {0x1D456, 0x1D49C}, {0x1D49E, 0x1D49F}, - {0x1D4A2, 0x1D4A2}, {0x1D4A5, 0x1D4A6}, {0x1D4A9, 0x1D4AC}, - {0x1D4AE, 0x1D4B9}, {0x1D4BB, 0x1D4BB}, {0x1D4BD, 0x1D4C3}, - {0x1D4C5, 0x1D505}, {0x1D507, 0x1D50A}, {0x1D50D, 0x1D514}, - {0x1D516, 0x1D51C}, {0x1D51E, 0x1D539}, {0x1D53B, 0x1D53E}, - {0x1D540, 0x1D544}, {0x1D546, 0x1D546}, {0x1D54A, 0x1D550}, - {0x1D552, 0x1D6A5}, {0x1D6A8, 0x1D7CB}, {0x1D7CE, 0x1DA8B}, - {0x1DA9B, 0x1DA9F}, {0x1DAA1, 0x1DAAF}, {0x1E000, 0x1E006}, - {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, {0x1E023, 0x1E024}, - {0x1E026, 0x1E02A}, {0x1E100, 0x1E12C}, {0x1E130, 0x1E13D}, - {0x1E140, 0x1E149}, {0x1E14E, 0x1E14F}, {0x1E2C0, 0x1E2F9}, - {0x1E2FF, 0x1E2FF}, {0x1E800, 0x1E8C4}, {0x1E8C7, 0x1E8D6}, + {0x16A6E, 0x16ABE}, {0x16AC0, 0x16AC9}, {0x16AD0, 0x16AED}, + {0x16AF0, 0x16AF5}, {0x16B00, 0x16B45}, {0x16B50, 0x16B59}, + {0x16B5B, 0x16B61}, {0x16B63, 0x16B77}, {0x16B7D, 0x16B8F}, + {0x16E40, 0x16E9A}, {0x16F00, 0x16F4A}, {0x16F4F, 0x16F87}, + {0x16F8F, 0x16F9F}, {0x1BC00, 0x1BC6A}, {0x1BC70, 0x1BC7C}, + {0x1BC80, 0x1BC88}, {0x1BC90, 0x1BC99}, {0x1BC9C, 0x1BCA3}, + {0x1CF00, 0x1CF2D}, {0x1CF30, 0x1CF46}, {0x1CF50, 0x1CFC3}, + {0x1D000, 0x1D0F5}, {0x1D100, 0x1D126}, {0x1D129, 0x1D1EA}, + {0x1D200, 0x1D245}, {0x1D2C0, 0x1D2D3}, {0x1D2E0, 0x1D2F3}, + {0x1D300, 0x1D356}, {0x1D360, 0x1D378}, {0x1D400, 0x1D454}, + {0x1D456, 0x1D49C}, {0x1D49E, 0x1D49F}, {0x1D4A2, 0x1D4A2}, + {0x1D4A5, 0x1D4A6}, {0x1D4A9, 0x1D4AC}, {0x1D4AE, 0x1D4B9}, + {0x1D4BB, 0x1D4BB}, {0x1D4BD, 0x1D4C3}, {0x1D4C5, 0x1D505}, + {0x1D507, 0x1D50A}, {0x1D50D, 0x1D514}, {0x1D516, 0x1D51C}, + {0x1D51E, 0x1D539}, {0x1D53B, 0x1D53E}, {0x1D540, 0x1D544}, + {0x1D546, 0x1D546}, {0x1D54A, 0x1D550}, {0x1D552, 0x1D6A5}, + {0x1D6A8, 0x1D7CB}, {0x1D7CE, 0x1DA8B}, {0x1DA9B, 0x1DA9F}, + {0x1DAA1, 0x1DAAF}, {0x1DF00, 0x1DF1E}, {0x1DF25, 0x1DF2A}, + {0x1E000, 0x1E006}, {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, + {0x1E023, 0x1E024}, {0x1E026, 0x1E02A}, {0x1E030, 0x1E06D}, + {0x1E08F, 0x1E08F}, {0x1E100, 0x1E12C}, {0x1E130, 0x1E13D}, + {0x1E140, 0x1E149}, {0x1E14E, 0x1E14F}, {0x1E290, 0x1E2AE}, + {0x1E2C0, 0x1E2F9}, {0x1E2FF, 0x1E2FF}, {0x1E4D0, 0x1E4F9}, + {0x1E7E0, 0x1E7E6}, {0x1E7E8, 0x1E7EB}, {0x1E7ED, 0x1E7EE}, + {0x1E7F0, 0x1E7FE}, {0x1E800, 0x1E8C4}, {0x1E8C7, 0x1E8D6}, {0x1E900, 0x1E94B}, {0x1E950, 0x1E959}, {0x1E95E, 0x1E95F}, {0x1EC71, 0x1ECB4}, {0x1ED01, 0x1ED3D}, {0x1EE00, 0x1EE03}, {0x1EE05, 0x1EE1F}, {0x1EE21, 0x1EE22}, {0x1EE24, 0x1EE24}, @@ -398,8 +411,8 @@ var neutral = table{ {0x1F54F, 0x1F54F}, {0x1F568, 0x1F579}, {0x1F57B, 0x1F594}, {0x1F597, 0x1F5A3}, {0x1F5A5, 0x1F5FA}, {0x1F650, 0x1F67F}, {0x1F6C6, 0x1F6CB}, {0x1F6CD, 0x1F6CF}, {0x1F6D3, 0x1F6D4}, - {0x1F6E0, 0x1F6EA}, {0x1F6F0, 0x1F6F3}, {0x1F700, 0x1F773}, - {0x1F780, 0x1F7D8}, {0x1F800, 0x1F80B}, {0x1F810, 0x1F847}, + {0x1F6E0, 0x1F6EA}, {0x1F6F0, 0x1F6F3}, {0x1F700, 0x1F776}, + {0x1F77B, 0x1F7D9}, {0x1F800, 0x1F80B}, {0x1F810, 0x1F847}, {0x1F850, 0x1F859}, {0x1F860, 0x1F887}, {0x1F890, 0x1F8AD}, {0x1F8B0, 0x1F8B1}, {0x1F900, 0x1F90B}, {0x1F93B, 0x1F93B}, {0x1F946, 0x1F946}, {0x1FA00, 0x1FA53}, {0x1FA60, 0x1FA6D}, diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_windows.go b/vendor/github.com/mattn/go-runewidth/runewidth_windows.go index d6a61777d7..5f987a310f 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth_windows.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth_windows.go @@ -1,5 +1,5 @@ -// +build windows -// +build !appengine +//go:build windows && !appengine +// +build windows,!appengine package runewidth diff --git a/vendor/github.com/matttproud/golang_protobuf_extensions/NOTICE b/vendor/github.com/matttproud/golang_protobuf_extensions/NOTICE deleted file mode 100644 index 5d8cb5b72e..0000000000 --- a/vendor/github.com/matttproud/golang_protobuf_extensions/NOTICE +++ /dev/null @@ -1 +0,0 @@ -Copyright 2012 Matt T. Proud (matt.proud@gmail.com) diff --git a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/.gitignore b/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/.gitignore deleted file mode 100644 index e16fb946bb..0000000000 --- a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/.gitignore +++ /dev/null @@ -1 +0,0 @@ -cover.dat diff --git a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile b/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile deleted file mode 100644 index 81be214370..0000000000 --- a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: - -cover: - go test -cover -v -coverprofile=cover.dat ./... - go tool cover -func cover.dat - -.PHONY: cover diff --git a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/decode.go b/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/decode.go deleted file mode 100644 index 258c0636aa..0000000000 --- a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/decode.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2013 Matt T. Proud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 pbutil - -import ( - "encoding/binary" - "errors" - "io" - - "github.com/golang/protobuf/proto" -) - -var errInvalidVarint = errors.New("invalid varint32 encountered") - -// ReadDelimited decodes a message from the provided length-delimited stream, -// where the length is encoded as 32-bit varint prefix to the message body. -// It returns the total number of bytes read and any applicable error. This is -// roughly equivalent to the companion Java API's -// MessageLite#parseDelimitedFrom. As per the reader contract, this function -// calls r.Read repeatedly as required until exactly one message including its -// prefix is read and decoded (or an error has occurred). The function never -// reads more bytes from the stream than required. The function never returns -// an error if a message has been read and decoded correctly, even if the end -// of the stream has been reached in doing so. In that case, any subsequent -// calls return (0, io.EOF). -func ReadDelimited(r io.Reader, m proto.Message) (n int, err error) { - // Per AbstractParser#parsePartialDelimitedFrom with - // CodedInputStream#readRawVarint32. - var headerBuf [binary.MaxVarintLen32]byte - var bytesRead, varIntBytes int - var messageLength uint64 - for varIntBytes == 0 { // i.e. no varint has been decoded yet. - if bytesRead >= len(headerBuf) { - return bytesRead, errInvalidVarint - } - // We have to read byte by byte here to avoid reading more bytes - // than required. Each read byte is appended to what we have - // read before. - newBytesRead, err := r.Read(headerBuf[bytesRead : bytesRead+1]) - if newBytesRead == 0 { - if err != nil { - return bytesRead, err - } - // A Reader should not return (0, nil), but if it does, - // it should be treated as no-op (according to the - // Reader contract). So let's go on... - continue - } - bytesRead += newBytesRead - // Now present everything read so far to the varint decoder and - // see if a varint can be decoded already. - messageLength, varIntBytes = proto.DecodeVarint(headerBuf[:bytesRead]) - } - - messageBuf := make([]byte, messageLength) - newBytesRead, err := io.ReadFull(r, messageBuf) - bytesRead += newBytesRead - if err != nil { - return bytesRead, err - } - - return bytesRead, proto.Unmarshal(messageBuf, m) -} diff --git a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/doc.go b/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/doc.go deleted file mode 100644 index c318385cbe..0000000000 --- a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/doc.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2013 Matt T. Proud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 pbutil provides record length-delimited Protocol Buffer streaming. -package pbutil diff --git a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/encode.go b/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/encode.go deleted file mode 100644 index 8fb59ad226..0000000000 --- a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/encode.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2013 Matt T. Proud -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 pbutil - -import ( - "encoding/binary" - "io" - - "github.com/golang/protobuf/proto" -) - -// WriteDelimited encodes and dumps a message to the provided writer prefixed -// with a 32-bit varint indicating the length of the encoded message, producing -// a length-delimited record stream, which can be used to chain together -// encoded messages of the same type together in a file. It returns the total -// number of bytes written and any applicable error. This is roughly -// equivalent to the companion Java API's MessageLite#writeDelimitedTo. -func WriteDelimited(w io.Writer, m proto.Message) (n int, err error) { - buffer, err := proto.Marshal(m) - if err != nil { - return 0, err - } - - var buf [binary.MaxVarintLen32]byte - encodedLength := binary.PutUvarint(buf[:], uint64(len(buffer))) - - sync, err := w.Write(buf[:encodedLength]) - if err != nil { - return sync, err - } - - n, err = w.Write(buffer) - return n + sync, err -} diff --git a/vendor/github.com/mitchellh/mapstructure/.travis.yml b/vendor/github.com/mitchellh/mapstructure/.travis.yml deleted file mode 100644 index 5e31a95a8b..0000000000 --- a/vendor/github.com/mitchellh/mapstructure/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: go - -go: - - "1.14.x" - - tip - -script: - - go test - - go test -bench . -benchmem diff --git a/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md b/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md index 3378f7e66e..c758234904 100644 --- a/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md +++ b/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md @@ -1,3 +1,42 @@ +## 1.5.0 + +* New option `IgnoreUntaggedFields` to ignore decoding to any fields + without `mapstructure` (or the configured tag name) set [GH-277] +* New option `ErrorUnset` which makes it an error if any fields + in a target struct are not set by the decoding process. [GH-225] +* New function `OrComposeDecodeHookFunc` to help compose decode hooks. [GH-240] +* Decoding to slice from array no longer crashes [GH-265] +* Decode nested struct pointers to map [GH-271] +* Fix issue where `,squash` was ignored if `Squash` option was set. [GH-280] +* Fix issue where fields with `,omitempty` would sometimes decode + into a map with an empty string key [GH-281] + +## 1.4.3 + +* Fix cases where `json.Number` didn't decode properly [GH-261] + +## 1.4.2 + +* Custom name matchers to support any sort of casing, formatting, etc. for + field names. [GH-250] +* Fix possible panic in ComposeDecodeHookFunc [GH-251] + +## 1.4.1 + +* Fix regression where `*time.Time` value would be set to empty and not be sent + to decode hooks properly [GH-232] + +## 1.4.0 + +* A new decode hook type `DecodeHookFuncValue` has been added that has + access to the full values. [GH-183] +* Squash is now supported with embedded fields that are struct pointers [GH-205] +* Empty strings will convert to 0 for all numeric types when weakly decoding [GH-206] + +## 1.3.3 + +* Decoding maps from maps creates a settable value for decode hooks [GH-203] + ## 1.3.2 * Decode into interface type with a struct value is supported [GH-187] diff --git a/vendor/github.com/mitchellh/mapstructure/decode_hooks.go b/vendor/github.com/mitchellh/mapstructure/decode_hooks.go index 1f0abc65ab..3a754ca724 100644 --- a/vendor/github.com/mitchellh/mapstructure/decode_hooks.go +++ b/vendor/github.com/mitchellh/mapstructure/decode_hooks.go @@ -1,6 +1,7 @@ package mapstructure import ( + "encoding" "errors" "fmt" "net" @@ -16,10 +17,11 @@ func typedDecodeHook(h DecodeHookFunc) DecodeHookFunc { // Create variables here so we can reference them with the reflect pkg var f1 DecodeHookFuncType var f2 DecodeHookFuncKind + var f3 DecodeHookFuncValue // Fill in the variables into this interface and the rest is done // automatically using the reflect package. - potential := []interface{}{f1, f2} + potential := []interface{}{f1, f2, f3} v := reflect.ValueOf(h) vt := v.Type() @@ -38,13 +40,15 @@ func typedDecodeHook(h DecodeHookFunc) DecodeHookFunc { // that took reflect.Kind instead of reflect.Type. func DecodeHookExec( raw DecodeHookFunc, - from reflect.Type, to reflect.Type, - data interface{}) (interface{}, error) { + from reflect.Value, to reflect.Value) (interface{}, error) { + switch f := typedDecodeHook(raw).(type) { case DecodeHookFuncType: - return f(from, to, data) + return f(from.Type(), to.Type(), from.Interface()) case DecodeHookFuncKind: - return f(from.Kind(), to.Kind(), data) + return f(from.Kind(), to.Kind(), from.Interface()) + case DecodeHookFuncValue: + return f(from, to) default: return nil, errors.New("invalid decode hook signature") } @@ -56,25 +60,42 @@ func DecodeHookExec( // The composed funcs are called in order, with the result of the // previous transformation. func ComposeDecodeHookFunc(fs ...DecodeHookFunc) DecodeHookFunc { - return func( - f reflect.Type, - t reflect.Type, - data interface{}) (interface{}, error) { + return func(f reflect.Value, t reflect.Value) (interface{}, error) { var err error + data := f.Interface() + + newFrom := f for _, f1 := range fs { - data, err = DecodeHookExec(f1, f, t, data) + data, err = DecodeHookExec(f1, newFrom, t) if err != nil { return nil, err } + newFrom = reflect.ValueOf(data) + } - // Modify the from kind to be correct with the new data - f = nil - if val := reflect.ValueOf(data); val.IsValid() { - f = val.Type() + return data, nil + } +} + +// OrComposeDecodeHookFunc executes all input hook functions until one of them returns no error. In that case its value is returned. +// If all hooks return an error, OrComposeDecodeHookFunc returns an error concatenating all error messages. +func OrComposeDecodeHookFunc(ff ...DecodeHookFunc) DecodeHookFunc { + return func(a, b reflect.Value) (interface{}, error) { + var allErrs string + var out interface{} + var err error + + for _, f := range ff { + out, err = DecodeHookExec(f, a, b) + if err != nil { + allErrs += err.Error() + "\n" + continue } + + return out, nil } - return data, nil + return nil, errors.New(allErrs) } } @@ -215,3 +236,44 @@ func WeaklyTypedHook( return data, nil } + +func RecursiveStructToMapHookFunc() DecodeHookFunc { + return func(f reflect.Value, t reflect.Value) (interface{}, error) { + if f.Kind() != reflect.Struct { + return f.Interface(), nil + } + + var i interface{} = struct{}{} + if t.Type() != reflect.TypeOf(&i).Elem() { + return f.Interface(), nil + } + + m := make(map[string]interface{}) + t.Set(reflect.ValueOf(m)) + + return f.Interface(), nil + } +} + +// TextUnmarshallerHookFunc returns a DecodeHookFunc that applies +// strings to the UnmarshalText function, when the target type +// implements the encoding.TextUnmarshaler interface +func TextUnmarshallerHookFunc() DecodeHookFuncType { + return func( + f reflect.Type, + t reflect.Type, + data interface{}) (interface{}, error) { + if f.Kind() != reflect.String { + return data, nil + } + result := reflect.New(t).Interface() + unmarshaller, ok := result.(encoding.TextUnmarshaler) + if !ok { + return data, nil + } + if err := unmarshaller.UnmarshalText([]byte(data.(string))); err != nil { + return nil, err + } + return result, nil + } +} diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure.go b/vendor/github.com/mitchellh/mapstructure/mapstructure.go index b384d9d928..1efb22ac36 100644 --- a/vendor/github.com/mitchellh/mapstructure/mapstructure.go +++ b/vendor/github.com/mitchellh/mapstructure/mapstructure.go @@ -72,6 +72,17 @@ // "name": "alice", // } // +// When decoding from a struct to a map, the squash tag squashes the struct +// fields into a single map. Using the example structs from above: +// +// Friend{Person: Person{Name: "alice"}} +// +// Will be decoded into a map: +// +// map[string]interface{}{ +// "name": "alice", +// } +// // DecoderConfig has a field that changes the behavior of mapstructure // to always squash embedded structs. // @@ -111,7 +122,7 @@ // field value is zero and a numeric type, the field is empty, and it won't // be encoded into the destination type. // -// type Source { +// type Source struct { // Age int `mapstructure:",omitempty"` // } // @@ -161,10 +172,11 @@ import ( // data transformations. See "DecodeHook" in the DecoderConfig // struct. // -// The type should be DecodeHookFuncType or DecodeHookFuncKind. -// Either is accepted. Types are a superset of Kinds (Types can return -// Kinds) and are generally a richer thing to use, but Kinds are simpler -// if you only need those. +// The type must be one of DecodeHookFuncType, DecodeHookFuncKind, or +// DecodeHookFuncValue. +// Values are a superset of Types (Values can return types), and Types are a +// superset of Kinds (Types can return Kinds) and are generally a richer thing +// to use, but Kinds are simpler if you only need those. // // The reason DecodeHookFunc is multi-typed is for backwards compatibility: // we started with Kinds and then realized Types were the better solution, @@ -180,15 +192,22 @@ type DecodeHookFuncType func(reflect.Type, reflect.Type, interface{}) (interface // source and target types. type DecodeHookFuncKind func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error) +// DecodeHookFuncValue is a DecodeHookFunc which has complete access to both the source and target +// values. +type DecodeHookFuncValue func(from reflect.Value, to reflect.Value) (interface{}, error) + // DecoderConfig is the configuration that is used to create a new decoder // and allows customization of various aspects of decoding. type DecoderConfig struct { // DecodeHook, if set, will be called before any decoding and any // type conversion (if WeaklyTypedInput is on). This lets you modify - // the values before they're set down onto the resulting struct. + // the values before they're set down onto the resulting struct. The + // DecodeHook is called for every map and value in the input. This means + // that if a struct has embedded fields with squash tags the decode hook + // is called only once with all of the input data, not once for each + // embedded struct. // - // If an error is returned, the entire decode will fail with that - // error. + // If an error is returned, the entire decode will fail with that error. DecodeHook DecodeHookFunc // If ErrorUnused is true, then it is an error for there to exist @@ -196,6 +215,12 @@ type DecoderConfig struct { // (extra keys). ErrorUnused bool + // If ErrorUnset is true, then it is an error for there to exist + // fields in the result that were not set in the decoding process + // (extra fields). This only applies to decoding to a struct. This + // will affect all nested structs as well. + ErrorUnset bool + // ZeroFields, if set to true, will zero fields before writing them. // For example, a map will be emptied before decoded values are put in // it. If this is false, a map will be merged. @@ -239,6 +264,15 @@ type DecoderConfig struct { // The tag name that mapstructure reads for field names. This // defaults to "mapstructure" TagName string + + // IgnoreUntaggedFields ignores all struct fields without explicit + // TagName, comparable to `mapstructure:"-"` as default behaviour. + IgnoreUntaggedFields bool + + // MatchName is the function used to match the map key to the struct + // field name or tag. Defaults to `strings.EqualFold`. This can be used + // to implement case-sensitive tag values, support snake casing, etc. + MatchName func(mapKey, fieldName string) bool } // A Decoder takes a raw interface value and turns it into structured @@ -260,6 +294,11 @@ type Metadata struct { // Unused is a slice of keys that were found in the raw value but // weren't decoded since there was no matching field in the result interface Unused []string + + // Unset is a slice of field names that were found in the result interface + // but weren't set in the decoding process since there was no matching value + // in the input + Unset []string } // Decode takes an input structure and uses reflection to translate it to @@ -351,12 +390,20 @@ func NewDecoder(config *DecoderConfig) (*Decoder, error) { if config.Metadata.Unused == nil { config.Metadata.Unused = make([]string, 0) } + + if config.Metadata.Unset == nil { + config.Metadata.Unset = make([]string, 0) + } } if config.TagName == "" { config.TagName = "mapstructure" } + if config.MatchName == nil { + config.MatchName = strings.EqualFold + } + result := &Decoder{ config: config, } @@ -409,9 +456,7 @@ func (d *Decoder) decode(name string, input interface{}, outVal reflect.Value) e if d.config.DecodeHook != nil { // We have a DecodeHook, so let's pre-process the input. var err error - input, err = DecodeHookExec( - d.config.DecodeHook, - inputVal.Type(), outVal.Type(), input) + input, err = DecodeHookExec(d.config.DecodeHook, inputVal, outVal) if err != nil { return fmt.Errorf("error decoding '%s': %s", name, err) } @@ -562,8 +607,8 @@ func (d *Decoder) decodeString(name string, data interface{}, val reflect.Value) if !converted { return fmt.Errorf( - "'%s' expected type '%s', got unconvertible type '%s'", - name, val.Type(), dataVal.Type()) + "'%s' expected type '%s', got unconvertible type '%s', value: '%v'", + name, val.Type(), dataVal.Type(), data) } return nil @@ -588,7 +633,12 @@ func (d *Decoder) decodeInt(name string, data interface{}, val reflect.Value) er val.SetInt(0) } case dataKind == reflect.String && d.config.WeaklyTypedInput: - i, err := strconv.ParseInt(dataVal.String(), 0, val.Type().Bits()) + str := dataVal.String() + if str == "" { + str = "0" + } + + i, err := strconv.ParseInt(str, 0, val.Type().Bits()) if err == nil { val.SetInt(i) } else { @@ -604,8 +654,8 @@ func (d *Decoder) decodeInt(name string, data interface{}, val reflect.Value) er val.SetInt(i) default: return fmt.Errorf( - "'%s' expected type '%s', got unconvertible type '%s'", - name, val.Type(), dataVal.Type()) + "'%s' expected type '%s', got unconvertible type '%s', value: '%v'", + name, val.Type(), dataVal.Type(), data) } return nil @@ -640,7 +690,12 @@ func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) e val.SetUint(0) } case dataKind == reflect.String && d.config.WeaklyTypedInput: - i, err := strconv.ParseUint(dataVal.String(), 0, val.Type().Bits()) + str := dataVal.String() + if str == "" { + str = "0" + } + + i, err := strconv.ParseUint(str, 0, val.Type().Bits()) if err == nil { val.SetUint(i) } else { @@ -648,20 +703,16 @@ func (d *Decoder) decodeUint(name string, data interface{}, val reflect.Value) e } case dataType.PkgPath() == "encoding/json" && dataType.Name() == "Number": jn := data.(json.Number) - i, err := jn.Int64() + i, err := strconv.ParseUint(string(jn), 0, 64) if err != nil { return fmt.Errorf( "error decoding json.Number into %s: %s", name, err) } - if i < 0 && !d.config.WeaklyTypedInput { - return fmt.Errorf("cannot parse '%s', %d overflows uint", - name, i) - } - val.SetUint(uint64(i)) + val.SetUint(i) default: return fmt.Errorf( - "'%s' expected type '%s', got unconvertible type '%s'", - name, val.Type(), dataVal.Type()) + "'%s' expected type '%s', got unconvertible type '%s', value: '%v'", + name, val.Type(), dataVal.Type(), data) } return nil @@ -691,8 +742,8 @@ func (d *Decoder) decodeBool(name string, data interface{}, val reflect.Value) e } default: return fmt.Errorf( - "'%s' expected type '%s', got unconvertible type '%s'", - name, val.Type(), dataVal.Type()) + "'%s' expected type '%s', got unconvertible type '%s', value: '%v'", + name, val.Type(), dataVal.Type(), data) } return nil @@ -717,7 +768,12 @@ func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value) val.SetFloat(0) } case dataKind == reflect.String && d.config.WeaklyTypedInput: - f, err := strconv.ParseFloat(dataVal.String(), val.Type().Bits()) + str := dataVal.String() + if str == "" { + str = "0" + } + + f, err := strconv.ParseFloat(str, val.Type().Bits()) if err == nil { val.SetFloat(f) } else { @@ -733,8 +789,8 @@ func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value) val.SetFloat(i) default: return fmt.Errorf( - "'%s' expected type '%s', got unconvertible type '%s'", - name, val.Type(), dataVal.Type()) + "'%s' expected type '%s', got unconvertible type '%s', value: '%v'", + name, val.Type(), dataVal.Type(), data) } return nil @@ -785,7 +841,7 @@ func (d *Decoder) decodeMapFromSlice(name string, dataVal reflect.Value, val ref for i := 0; i < dataVal.Len(); i++ { err := d.decode( - fmt.Sprintf("%s[%d]", name, i), + name+"["+strconv.Itoa(i)+"]", dataVal.Index(i).Interface(), val) if err != nil { return err @@ -818,7 +874,7 @@ func (d *Decoder) decodeMapFromMap(name string, dataVal reflect.Value, val refle } for _, k := range dataVal.MapKeys() { - fieldName := fmt.Sprintf("%s[%s]", name, k) + fieldName := name + "[" + k.String() + "]" // First decode the key into the proper type currentKey := reflect.Indirect(reflect.New(valKeyType)) @@ -869,8 +925,15 @@ func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val re tagValue := f.Tag.Get(d.config.TagName) keyName := f.Name + if tagValue == "" && d.config.IgnoreUntaggedFields { + continue + } + // If Squash is set in the config, we squash the field down. squash := d.config.Squash && v.Kind() == reflect.Struct && f.Anonymous + + v = dereferencePtrToStructIfNeeded(v, d.config.TagName) + // Determine the name of the key in the map if index := strings.Index(tagValue, ","); index != -1 { if tagValue[:index] == "-" { @@ -882,11 +945,21 @@ func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val re } // If "squash" is specified in the tag, we squash the field down. - squash = !squash && strings.Index(tagValue[index+1:], "squash") != -1 - if squash && v.Kind() != reflect.Struct { - return fmt.Errorf("cannot squash non-struct type '%s'", v.Type()) + squash = squash || strings.Index(tagValue[index+1:], "squash") != -1 + if squash { + // When squashing, the embedded type can be a pointer to a struct. + if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Struct { + v = v.Elem() + } + + // The final type must be a struct + if v.Kind() != reflect.Struct { + return fmt.Errorf("cannot squash non-struct type '%s'", v.Type()) + } + } + if keyNameTagValue := tagValue[:index]; keyNameTagValue != "" { + keyName = keyNameTagValue } - keyName = tagValue[:index] } else if len(tagValue) > 0 { if tagValue == "-" { continue @@ -906,11 +979,22 @@ func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val re mType := reflect.MapOf(vKeyType, vElemType) vMap := reflect.MakeMap(mType) - err := d.decode(keyName, x.Interface(), vMap) + // Creating a pointer to a map so that other methods can completely + // overwrite the map if need be (looking at you decodeMapFromMap). The + // indirection allows the underlying map to be settable (CanSet() == true) + // where as reflect.MakeMap returns an unsettable map. + addrVal := reflect.New(vMap.Type()) + reflect.Indirect(addrVal).Set(vMap) + + err := d.decode(keyName, x.Interface(), reflect.Indirect(addrVal)) if err != nil { return err } + // the underlying map may have been completely overwritten so pull + // it indirectly out of the enclosing value. + vMap = reflect.Indirect(addrVal) + if squash { for _, k := range vMap.MapKeys() { valMap.SetMapIndex(k, vMap.MapIndex(k)) @@ -984,8 +1068,8 @@ func (d *Decoder) decodeFunc(name string, data interface{}, val reflect.Value) e dataVal := reflect.Indirect(reflect.ValueOf(data)) if val.Type() != dataVal.Type() { return fmt.Errorf( - "'%s' expected type '%s', got unconvertible type '%s'", - name, val.Type(), dataVal.Type()) + "'%s' expected type '%s', got unconvertible type '%s', value: '%v'", + name, val.Type(), dataVal.Type(), data) } val.Set(dataVal) return nil @@ -1031,7 +1115,7 @@ func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) } // If the input value is nil, then don't allocate since empty != nil - if dataVal.IsNil() { + if dataValKind != reflect.Array && dataVal.IsNil() { return nil } @@ -1051,7 +1135,7 @@ func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) } currentField := valSlice.Index(i) - fieldName := fmt.Sprintf("%s[%d]", name, i) + fieldName := name + "[" + strconv.Itoa(i) + "]" if err := d.decode(fieldName, currentData, currentField); err != nil { errors = appendErrors(errors, err) } @@ -1118,7 +1202,7 @@ func (d *Decoder) decodeArray(name string, data interface{}, val reflect.Value) currentData := dataVal.Index(i).Interface() currentField := valArray.Index(i) - fieldName := fmt.Sprintf("%s[%d]", name, i) + fieldName := name + "[" + strconv.Itoa(i) + "]" if err := d.decode(fieldName, currentData, currentField); err != nil { errors = appendErrors(errors, err) } @@ -1154,13 +1238,23 @@ func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) // Not the most efficient way to do this but we can optimize later if // we want to. To convert from struct to struct we go to map first // as an intermediary. - m := make(map[string]interface{}) - mval := reflect.Indirect(reflect.ValueOf(&m)) - if err := d.decodeMapFromStruct(name, dataVal, mval, mval); err != nil { + + // Make a new map to hold our result + mapType := reflect.TypeOf((map[string]interface{})(nil)) + mval := reflect.MakeMap(mapType) + + // Creating a pointer to a map so that other methods can completely + // overwrite the map if need be (looking at you decodeMapFromMap). The + // indirection allows the underlying map to be settable (CanSet() == true) + // where as reflect.MakeMap returns an unsettable map. + addrVal := reflect.New(mval.Type()) + + reflect.Indirect(addrVal).Set(mval) + if err := d.decodeMapFromStruct(name, dataVal, reflect.Indirect(addrVal), mval); err != nil { return err } - result := d.decodeStructFromMap(name, mval, val) + result := d.decodeStructFromMap(name, reflect.Indirect(addrVal), val) return result default: @@ -1183,6 +1277,7 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e dataValKeysUnused[dataValKey.Interface()] = struct{}{} } + targetValKeysUnused := make(map[interface{}]struct{}) errors := make([]string, 0) // This slice will keep track of all the structs we'll be decoding. @@ -1211,10 +1306,14 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e for i := 0; i < structType.NumField(); i++ { fieldType := structType.Field(i) - fieldKind := fieldType.Type.Kind() + fieldVal := structVal.Field(i) + if fieldVal.Kind() == reflect.Ptr && fieldVal.Elem().Kind() == reflect.Struct { + // Handle embedded struct pointers as embedded structs. + fieldVal = fieldVal.Elem() + } // If "squash" is specified in the tag, we squash the field down. - squash := d.config.Squash && fieldKind == reflect.Struct && fieldType.Anonymous + squash := d.config.Squash && fieldVal.Kind() == reflect.Struct && fieldType.Anonymous remain := false // We always parse the tags cause we're looking for other tags too @@ -1232,21 +1331,21 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e } if squash { - if fieldKind != reflect.Struct { + if fieldVal.Kind() != reflect.Struct { errors = appendErrors(errors, - fmt.Errorf("%s: unsupported type for squash: %s", fieldType.Name, fieldKind)) + fmt.Errorf("%s: unsupported type for squash: %s", fieldType.Name, fieldVal.Kind())) } else { - structs = append(structs, structVal.FieldByName(fieldType.Name)) + structs = append(structs, fieldVal) } continue } // Build our field if remain { - remainField = &field{fieldType, structVal.Field(i)} + remainField = &field{fieldType, fieldVal} } else { // Normal struct field, store it away - fields = append(fields, field{fieldType, structVal.Field(i)}) + fields = append(fields, field{fieldType, fieldVal}) } } } @@ -1274,7 +1373,7 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e continue } - if strings.EqualFold(mK, fieldName) { + if d.config.MatchName(mK, fieldName) { rawMapKey = dataValKey rawMapVal = dataVal.MapIndex(dataValKey) break @@ -1283,7 +1382,8 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e if !rawMapVal.IsValid() { // There was no matching key in the map for the value in - // the struct. Just ignore. + // the struct. Remember it for potential errors and metadata. + targetValKeysUnused[fieldName] = struct{}{} continue } } @@ -1305,7 +1405,7 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e // If the name is empty string, then we're at the root, and we // don't dot-join the fields. if name != "" { - fieldName = fmt.Sprintf("%s.%s", name, fieldName) + fieldName = name + "." + fieldName } if err := d.decode(fieldName, rawMapVal.Interface(), fieldValue); err != nil { @@ -1343,6 +1443,17 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e errors = appendErrors(errors, err) } + if d.config.ErrorUnset && len(targetValKeysUnused) > 0 { + keys := make([]string, 0, len(targetValKeysUnused)) + for rawKey := range targetValKeysUnused { + keys = append(keys, rawKey.(string)) + } + sort.Strings(keys) + + err := fmt.Errorf("'%s' has unset fields: %s", name, strings.Join(keys, ", ")) + errors = appendErrors(errors, err) + } + if len(errors) > 0 { return &Error{errors} } @@ -1352,11 +1463,19 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e for rawKey := range dataValKeysUnused { key := rawKey.(string) if name != "" { - key = fmt.Sprintf("%s.%s", name, key) + key = name + "." + key } d.config.Metadata.Unused = append(d.config.Metadata.Unused, key) } + for rawKey := range targetValKeysUnused { + key := rawKey.(string) + if name != "" { + key = name + "." + key + } + + d.config.Metadata.Unset = append(d.config.Metadata.Unset, key) + } } return nil @@ -1394,3 +1513,28 @@ func getKind(val reflect.Value) reflect.Kind { return kind } } + +func isStructTypeConvertibleToMap(typ reflect.Type, checkMapstructureTags bool, tagName string) bool { + for i := 0; i < typ.NumField(); i++ { + f := typ.Field(i) + if f.PkgPath == "" && !checkMapstructureTags { // check for unexported fields + return true + } + if checkMapstructureTags && f.Tag.Get(tagName) != "" { // check for mapstructure tags inside + return true + } + } + return false +} + +func dereferencePtrToStructIfNeeded(v reflect.Value, tagName string) reflect.Value { + if v.Kind() != reflect.Ptr || v.Elem().Kind() != reflect.Struct { + return v + } + deref := v.Elem() + derefT := deref.Type() + if isStructTypeConvertibleToMap(derefT, true, tagName) { + return deref + } + return v +} diff --git a/vendor/github.com/modern-go/reflect2/.travis.yml b/vendor/github.com/modern-go/reflect2/.travis.yml index fbb43744d9..b097728dbf 100644 --- a/vendor/github.com/modern-go/reflect2/.travis.yml +++ b/vendor/github.com/modern-go/reflect2/.travis.yml @@ -1,7 +1,7 @@ language: go go: - - 1.8.x + - 1.9.x - 1.x before_install: diff --git a/vendor/github.com/modern-go/reflect2/Gopkg.lock b/vendor/github.com/modern-go/reflect2/Gopkg.lock index 2a3a69893b..10ef811182 100644 --- a/vendor/github.com/modern-go/reflect2/Gopkg.lock +++ b/vendor/github.com/modern-go/reflect2/Gopkg.lock @@ -1,15 +1,9 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -[[projects]] - name = "github.com/modern-go/concurrent" - packages = ["."] - revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a" - version = "1.0.0" - [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "daee8a88b3498b61c5640056665b8b9eea062006f5e596bbb6a3ed9119a11ec7" + input-imports = [] solver-name = "gps-cdcl" solver-version = 1 diff --git a/vendor/github.com/modern-go/reflect2/Gopkg.toml b/vendor/github.com/modern-go/reflect2/Gopkg.toml index 2f4f4dbdcc..a9bc5061b0 100644 --- a/vendor/github.com/modern-go/reflect2/Gopkg.toml +++ b/vendor/github.com/modern-go/reflect2/Gopkg.toml @@ -26,10 +26,6 @@ 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/go_above_118.go b/vendor/github.com/modern-go/reflect2/go_above_118.go new file mode 100644 index 0000000000..2b4116f6c9 --- /dev/null +++ b/vendor/github.com/modern-go/reflect2/go_above_118.go @@ -0,0 +1,23 @@ +//+build go1.18 + +package reflect2 + +import ( + "unsafe" +) + +// m escapes into the return value, but the caller of mapiterinit +// doesn't let the return value escape. +//go:noescape +//go:linkname mapiterinit reflect.mapiterinit +func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer, it *hiter) + +func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator { + var it hiter + mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj), &it) + return &UnsafeMapIterator{ + hiter: &it, + pKeyRType: type2.pKeyRType, + pElemRType: type2.pElemRType, + } +} \ No newline at end of file diff --git a/vendor/github.com/modern-go/reflect2/go_above_17.go b/vendor/github.com/modern-go/reflect2/go_above_17.go deleted file mode 100644 index 5c1cea8683..0000000000 --- a/vendor/github.com/modern-go/reflect2/go_above_17.go +++ /dev/null @@ -1,8 +0,0 @@ -//+build go1.7 - -package reflect2 - -import "unsafe" - -//go:linkname resolveTypeOff reflect.resolveTypeOff -func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer diff --git a/vendor/github.com/modern-go/reflect2/go_above_19.go b/vendor/github.com/modern-go/reflect2/go_above_19.go index c7e3b78011..974f7685e4 100644 --- a/vendor/github.com/modern-go/reflect2/go_above_19.go +++ b/vendor/github.com/modern-go/reflect2/go_above_19.go @@ -6,6 +6,9 @@ import ( "unsafe" ) +//go:linkname resolveTypeOff reflect.resolveTypeOff +func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer + //go:linkname makemap reflect.makemap func makemap(rtype unsafe.Pointer, cap int) (m unsafe.Pointer) diff --git a/vendor/github.com/modern-go/reflect2/go_below_118.go b/vendor/github.com/modern-go/reflect2/go_below_118.go new file mode 100644 index 0000000000..00003dbd7c --- /dev/null +++ b/vendor/github.com/modern-go/reflect2/go_below_118.go @@ -0,0 +1,21 @@ +//+build !go1.18 + +package reflect2 + +import ( + "unsafe" +) + +// m escapes into the return value, but the caller of mapiterinit +// doesn't let the return value escape. +//go:noescape +//go:linkname mapiterinit reflect.mapiterinit +func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer) (val *hiter) + +func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator { + return &UnsafeMapIterator{ + hiter: mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj)), + pKeyRType: type2.pKeyRType, + pElemRType: type2.pElemRType, + } +} \ No newline at end of file diff --git a/vendor/github.com/modern-go/reflect2/go_below_17.go b/vendor/github.com/modern-go/reflect2/go_below_17.go deleted file mode 100644 index 65a93c889b..0000000000 --- a/vendor/github.com/modern-go/reflect2/go_below_17.go +++ /dev/null @@ -1,9 +0,0 @@ -//+build !go1.7 - -package reflect2 - -import "unsafe" - -func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer { - return nil -} diff --git a/vendor/github.com/modern-go/reflect2/go_below_19.go b/vendor/github.com/modern-go/reflect2/go_below_19.go deleted file mode 100644 index b050ef70cd..0000000000 --- a/vendor/github.com/modern-go/reflect2/go_below_19.go +++ /dev/null @@ -1,14 +0,0 @@ -//+build !go1.9 - -package reflect2 - -import ( - "unsafe" -) - -//go:linkname makemap reflect.makemap -func makemap(rtype unsafe.Pointer) (m unsafe.Pointer) - -func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer { - return makemap(rtype) -} diff --git a/vendor/github.com/modern-go/reflect2/reflect2.go b/vendor/github.com/modern-go/reflect2/reflect2.go index 63b49c7991..c43c8b9d62 100644 --- a/vendor/github.com/modern-go/reflect2/reflect2.go +++ b/vendor/github.com/modern-go/reflect2/reflect2.go @@ -1,8 +1,9 @@ package reflect2 import ( - "github.com/modern-go/concurrent" "reflect" + "runtime" + "sync" "unsafe" ) @@ -130,13 +131,13 @@ var ConfigSafe = Config{UseSafeImplementation: true}.Froze() type frozenConfig struct { useSafeImplementation bool - cache *concurrent.Map + cache *sync.Map } func (cfg Config) Froze() *frozenConfig { return &frozenConfig{ useSafeImplementation: cfg.UseSafeImplementation, - cache: concurrent.NewMap(), + cache: new(sync.Map), } } @@ -288,11 +289,12 @@ func NoEscape(p unsafe.Pointer) unsafe.Pointer { } func UnsafeCastString(str string) []byte { + bytes := make([]byte, 0) stringHeader := (*reflect.StringHeader)(unsafe.Pointer(&str)) - sliceHeader := &reflect.SliceHeader{ - Data: stringHeader.Data, - Cap: stringHeader.Len, - Len: stringHeader.Len, - } - return *(*[]byte)(unsafe.Pointer(sliceHeader)) + sliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&bytes)) + sliceHeader.Data = stringHeader.Data + sliceHeader.Cap = stringHeader.Len + sliceHeader.Len = stringHeader.Len + runtime.KeepAlive(str) + return bytes } diff --git a/vendor/github.com/modern-go/reflect2/test.sh b/vendor/github.com/modern-go/reflect2/test.sh deleted file mode 100644 index 3d2b9768ce..0000000000 --- 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 3acfb55803..4b13c3155c 100644 --- a/vendor/github.com/modern-go/reflect2/type_map.go +++ b/vendor/github.com/modern-go/reflect2/type_map.go @@ -1,17 +1,13 @@ +// +build !gccgo + package reflect2 import ( "reflect" - "runtime" - "strings" "sync" "unsafe" ) -// typelinks1 for 1.5 ~ 1.6 -//go:linkname typelinks1 reflect.typelinks -func typelinks1() [][]unsafe.Pointer - // typelinks2 for 1.7 ~ //go:linkname typelinks2 reflect.typelinks func typelinks2() (sections []unsafe.Pointer, offset [][]int32) @@ -27,49 +23,10 @@ func discoverTypes() { types = make(map[string]reflect.Type) packages = make(map[string]map[string]reflect.Type) - ver := runtime.Version() - if ver == "go1.5" || strings.HasPrefix(ver, "go1.5.") { - loadGo15Types() - } else if ver == "go1.6" || strings.HasPrefix(ver, "go1.6.") { - loadGo15Types() - } else { - loadGo17Types() - } -} - -func loadGo15Types() { - var obj interface{} = reflect.TypeOf(0) - typePtrss := typelinks1() - for _, typePtrs := range typePtrss { - for _, typePtr := range typePtrs { - (*emptyInterface)(unsafe.Pointer(&obj)).word = typePtr - typ := obj.(reflect.Type) - if typ.Kind() == reflect.Ptr && typ.Elem().Kind() == reflect.Struct { - loadedType := typ.Elem() - pkgTypes := packages[loadedType.PkgPath()] - if pkgTypes == nil { - pkgTypes = map[string]reflect.Type{} - packages[loadedType.PkgPath()] = pkgTypes - } - types[loadedType.String()] = loadedType - pkgTypes[loadedType.Name()] = loadedType - } - if typ.Kind() == reflect.Slice && typ.Elem().Kind() == reflect.Ptr && - typ.Elem().Elem().Kind() == reflect.Struct { - loadedType := typ.Elem().Elem() - pkgTypes := packages[loadedType.PkgPath()] - if pkgTypes == nil { - pkgTypes = map[string]reflect.Type{} - packages[loadedType.PkgPath()] = pkgTypes - } - types[loadedType.String()] = loadedType - pkgTypes[loadedType.Name()] = loadedType - } - } - } + loadGoTypes() } -func loadGo17Types() { +func loadGoTypes() { var obj interface{} = reflect.TypeOf(0) sections, offset := typelinks2() for i, offs := range offset { diff --git a/vendor/github.com/modern-go/reflect2/unsafe_link.go b/vendor/github.com/modern-go/reflect2/unsafe_link.go index 57229c8db4..b49f614efc 100644 --- a/vendor/github.com/modern-go/reflect2/unsafe_link.go +++ b/vendor/github.com/modern-go/reflect2/unsafe_link.go @@ -19,18 +19,12 @@ func typedslicecopy(elemType unsafe.Pointer, dst, src sliceHeader) int //go:linkname mapassign reflect.mapassign //go:noescape -func mapassign(rtype unsafe.Pointer, m unsafe.Pointer, key, val unsafe.Pointer) +func mapassign(rtype unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer, val unsafe.Pointer) //go:linkname mapaccess reflect.mapaccess //go:noescape func mapaccess(rtype unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer) (val unsafe.Pointer) -// m escapes into the return value, but the caller of mapiterinit -// doesn't let the return value escape. -//go:noescape -//go:linkname mapiterinit reflect.mapiterinit -func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer) *hiter - //go:noescape //go:linkname mapiternext reflect.mapiternext func mapiternext(it *hiter) @@ -42,9 +36,21 @@ func ifaceE2I(rtype unsafe.Pointer, src interface{}, dst unsafe.Pointer) // If you modify hiter, also change cmd/internal/gc/reflect.go to indicate // the layout of this structure. type hiter struct { - key unsafe.Pointer // Must be in first position. Write nil to indicate iteration end (see cmd/internal/gc/range.go). - value unsafe.Pointer // Must be in second position (see cmd/internal/gc/range.go). - // rest fields are ignored + key unsafe.Pointer + value unsafe.Pointer + t unsafe.Pointer + h unsafe.Pointer + buckets unsafe.Pointer + bptr unsafe.Pointer + overflow *[]unsafe.Pointer + oldoverflow *[]unsafe.Pointer + startBucket uintptr + offset uint8 + wrapped bool + B uint8 + i uint8 + bucket uintptr + checkBucket uintptr } // add returns p+x. diff --git a/vendor/github.com/modern-go/reflect2/unsafe_map.go b/vendor/github.com/modern-go/reflect2/unsafe_map.go index f2e76e6bb1..37872da819 100644 --- a/vendor/github.com/modern-go/reflect2/unsafe_map.go +++ b/vendor/github.com/modern-go/reflect2/unsafe_map.go @@ -107,14 +107,6 @@ func (type2 *UnsafeMapType) Iterate(obj interface{}) MapIterator { return type2.UnsafeIterate(objEFace.data) } -func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator { - return &UnsafeMapIterator{ - hiter: mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj)), - pKeyRType: type2.pKeyRType, - pElemRType: type2.pElemRType, - } -} - type UnsafeMapIterator struct { *hiter pKeyRType unsafe.Pointer diff --git a/vendor/github.com/munnerz/goautoneg/LICENSE b/vendor/github.com/munnerz/goautoneg/LICENSE new file mode 100644 index 0000000000..bbc7b897cb --- /dev/null +++ b/vendor/github.com/munnerz/goautoneg/LICENSE @@ -0,0 +1,31 @@ +Copyright (c) 2011, Open Knowledge Foundation Ltd. +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 Open Knowledge Foundation Ltd. 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/munnerz/goautoneg/Makefile b/vendor/github.com/munnerz/goautoneg/Makefile new file mode 100644 index 0000000000..e33ee17303 --- /dev/null +++ b/vendor/github.com/munnerz/goautoneg/Makefile @@ -0,0 +1,13 @@ +include $(GOROOT)/src/Make.inc + +TARG=bitbucket.org/ww/goautoneg +GOFILES=autoneg.go + +include $(GOROOT)/src/Make.pkg + +format: + gofmt -w *.go + +docs: + gomake clean + godoc ${TARG} > README.txt diff --git a/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/README.txt b/vendor/github.com/munnerz/goautoneg/README.txt similarity index 100% rename from vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/README.txt rename to vendor/github.com/munnerz/goautoneg/README.txt diff --git a/vendor/github.com/munnerz/goautoneg/autoneg.go b/vendor/github.com/munnerz/goautoneg/autoneg.go new file mode 100644 index 0000000000..1dd1cad646 --- /dev/null +++ b/vendor/github.com/munnerz/goautoneg/autoneg.go @@ -0,0 +1,189 @@ +/* +HTTP Content-Type Autonegotiation. + +The functions in this package implement the behaviour specified in +http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html + +Copyright (c) 2011, Open Knowledge Foundation Ltd. +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 Open Knowledge Foundation Ltd. 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. +*/ + +package goautoneg + +import ( + "sort" + "strconv" + "strings" +) + +// Structure to represent a clause in an HTTP Accept Header +type Accept struct { + Type, SubType string + Q float64 + Params map[string]string +} + +// acceptSlice is defined to implement sort interface. +type acceptSlice []Accept + +func (slice acceptSlice) Len() int { + return len(slice) +} + +func (slice acceptSlice) Less(i, j int) bool { + ai, aj := slice[i], slice[j] + if ai.Q > aj.Q { + return true + } + if ai.Type != "*" && aj.Type == "*" { + return true + } + if ai.SubType != "*" && aj.SubType == "*" { + return true + } + return false +} + +func (slice acceptSlice) Swap(i, j int) { + slice[i], slice[j] = slice[j], slice[i] +} + +func stringTrimSpaceCutset(r rune) bool { + return r == ' ' +} + +func nextSplitElement(s, sep string) (item string, remaining string) { + if index := strings.Index(s, sep); index != -1 { + return s[:index], s[index+1:] + } + return s, "" +} + +// Parse an Accept Header string returning a sorted list +// of clauses +func ParseAccept(header string) acceptSlice { + partsCount := 0 + remaining := header + for len(remaining) > 0 { + partsCount++ + _, remaining = nextSplitElement(remaining, ",") + } + accept := make(acceptSlice, 0, partsCount) + + remaining = header + var part string + for len(remaining) > 0 { + part, remaining = nextSplitElement(remaining, ",") + part = strings.TrimFunc(part, stringTrimSpaceCutset) + + a := Accept{ + Q: 1.0, + } + + sp, remainingPart := nextSplitElement(part, ";") + + sp0, spRemaining := nextSplitElement(sp, "/") + a.Type = strings.TrimFunc(sp0, stringTrimSpaceCutset) + + switch { + case len(spRemaining) == 0: + if a.Type == "*" { + a.SubType = "*" + } else { + continue + } + default: + var sp1 string + sp1, spRemaining = nextSplitElement(spRemaining, "/") + if len(spRemaining) > 0 { + continue + } + a.SubType = strings.TrimFunc(sp1, stringTrimSpaceCutset) + } + + if len(remainingPart) == 0 { + accept = append(accept, a) + continue + } + + a.Params = make(map[string]string) + for len(remainingPart) > 0 { + sp, remainingPart = nextSplitElement(remainingPart, ";") + sp0, spRemaining = nextSplitElement(sp, "=") + if len(spRemaining) == 0 { + continue + } + var sp1 string + sp1, spRemaining = nextSplitElement(spRemaining, "=") + if len(spRemaining) != 0 { + continue + } + token := strings.TrimFunc(sp0, stringTrimSpaceCutset) + if token == "q" { + a.Q, _ = strconv.ParseFloat(sp1, 32) + } else { + a.Params[token] = strings.TrimFunc(sp1, stringTrimSpaceCutset) + } + } + + accept = append(accept, a) + } + + sort.Sort(accept) + return accept +} + +// Negotiate the most appropriate content_type given the accept header +// and a list of alternatives. +func Negotiate(header string, alternatives []string) (content_type string) { + asp := make([][]string, 0, len(alternatives)) + for _, ctype := range alternatives { + asp = append(asp, strings.SplitN(ctype, "/", 2)) + } + for _, clause := range ParseAccept(header) { + for i, ctsp := range asp { + if clause.Type == ctsp[0] && clause.SubType == ctsp[1] { + content_type = alternatives[i] + return + } + if clause.Type == ctsp[0] && clause.SubType == "*" { + content_type = alternatives[i] + return + } + if clause.Type == "*" && clause.SubType == "*" { + content_type = alternatives[i] + return + } + } + } + return +} diff --git a/vendor/github.com/oklog/ulid/.gitignore b/vendor/github.com/oklog/ulid/.gitignore new file mode 100644 index 0000000000..c92c4d5608 --- /dev/null +++ b/vendor/github.com/oklog/ulid/.gitignore @@ -0,0 +1,29 @@ +#### joe made this: http://goel.io/joe + +#####=== Go ===##### + +# 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/oklog/ulid/.travis.yml b/vendor/github.com/oklog/ulid/.travis.yml new file mode 100644 index 0000000000..43eb762fa3 --- /dev/null +++ b/vendor/github.com/oklog/ulid/.travis.yml @@ -0,0 +1,16 @@ +language: go +sudo: false +go: + - 1.10.x +install: + - go get -v github.com/golang/lint/golint + - go get golang.org/x/tools/cmd/cover + - go get github.com/mattn/goveralls + - go get -d -t -v ./... + - go build -v ./... +script: + - go vet ./... + - $HOME/gopath/bin/golint . + - go test -v -race ./... + - go test -v -covermode=count -coverprofile=cov.out + - $HOME/gopath/bin/goveralls -coverprofile=cov.out -service=travis-ci -repotoken "$COVERALLS_TOKEN" || true diff --git a/vendor/github.com/oklog/ulid/AUTHORS.md b/vendor/github.com/oklog/ulid/AUTHORS.md new file mode 100644 index 0000000000..95581c78b0 --- /dev/null +++ b/vendor/github.com/oklog/ulid/AUTHORS.md @@ -0,0 +1,2 @@ +- Peter Bourgon (@peterbourgon) +- Tomás Senart (@tsenart) diff --git a/vendor/github.com/oklog/ulid/CHANGELOG.md b/vendor/github.com/oklog/ulid/CHANGELOG.md new file mode 100644 index 0000000000..8da38c6b00 --- /dev/null +++ b/vendor/github.com/oklog/ulid/CHANGELOG.md @@ -0,0 +1,33 @@ +## 1.3.1 / 2018-10-02 + +* Use underlying entropy source for random increments in Monotonic (#32) + +## 1.3.0 / 2018-09-29 + +* Monotonic entropy support (#31) + +## 1.2.0 / 2018-09-09 + +* Add a function to convert Unix time in milliseconds back to time.Time (#30) + +## 1.1.0 / 2018-08-15 + +* Ensure random part is always read from the entropy reader in full (#28) + +## 1.0.0 / 2018-07-29 + +* Add ParseStrict and MustParseStrict functions (#26) +* Enforce overflow checking when parsing (#20) + +## 0.3.0 / 2017-01-03 + +* Implement ULID.Compare method + +## 0.2.0 / 2016-12-13 + +* Remove year 2262 Timestamp bug. (#1) +* Gracefully handle invalid encodings when parsing. + +## 0.1.0 / 2016-12-06 + +* First ULID release diff --git a/vendor/github.com/oklog/ulid/CONTRIBUTING.md b/vendor/github.com/oklog/ulid/CONTRIBUTING.md new file mode 100644 index 0000000000..68f03f26eb --- /dev/null +++ b/vendor/github.com/oklog/ulid/CONTRIBUTING.md @@ -0,0 +1,17 @@ +# Contributing + +We use GitHub to manage reviews of pull requests. + +* If you have a trivial fix or improvement, go ahead and create a pull + request, addressing (with `@...`) one or more of the maintainers + (see [AUTHORS.md](AUTHORS.md)) in the description of the pull request. + +* If you plan to do something more involved, first propose your ideas + in a Github issue. This will avoid unnecessary work and surely give + you and us a good deal of inspiration. + +* Relevant coding style guidelines are the [Go Code Review + Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) + and the _Formatting and style_ section of Peter Bourgon's [Go: Best + Practices for Production + Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style). diff --git a/vendor/github.com/oklog/ulid/Gopkg.lock b/vendor/github.com/oklog/ulid/Gopkg.lock new file mode 100644 index 0000000000..349b449a6e --- /dev/null +++ b/vendor/github.com/oklog/ulid/Gopkg.lock @@ -0,0 +1,15 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + branch = "master" + name = "github.com/pborman/getopt" + packages = ["v2"] + revision = "7148bc3a4c3008adfcab60cbebfd0576018f330b" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "6779b05abd5cd429c5393641d2453005a3cb74a400d161b2b5c5d0ca2e10e116" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/vendor/github.com/oklog/ulid/Gopkg.toml b/vendor/github.com/oklog/ulid/Gopkg.toml new file mode 100644 index 0000000000..624a7a019c --- /dev/null +++ b/vendor/github.com/oklog/ulid/Gopkg.toml @@ -0,0 +1,26 @@ + +# 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" + + +[[constraint]] + branch = "master" + name = "github.com/pborman/getopt" diff --git a/vendor/github.com/oklog/ulid/LICENSE b/vendor/github.com/oklog/ulid/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/vendor/github.com/oklog/ulid/LICENSE @@ -0,0 +1,201 @@ + 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/oklog/ulid/README.md b/vendor/github.com/oklog/ulid/README.md new file mode 100644 index 0000000000..0a3d2f82b2 --- /dev/null +++ b/vendor/github.com/oklog/ulid/README.md @@ -0,0 +1,150 @@ +# Universally Unique Lexicographically Sortable Identifier + +![Project status](https://img.shields.io/badge/version-1.3.0-yellow.svg) +[![Build Status](https://secure.travis-ci.org/oklog/ulid.png)](http://travis-ci.org/oklog/ulid) +[![Go Report Card](https://goreportcard.com/badge/oklog/ulid?cache=0)](https://goreportcard.com/report/oklog/ulid) +[![Coverage Status](https://coveralls.io/repos/github/oklog/ulid/badge.svg?branch=master&cache=0)](https://coveralls.io/github/oklog/ulid?branch=master) +[![GoDoc](https://godoc.org/github.com/oklog/ulid?status.svg)](https://godoc.org/github.com/oklog/ulid) +[![Apache 2 licensed](https://img.shields.io/badge/license-Apache2-blue.svg)](https://raw.githubusercontent.com/oklog/ulid/master/LICENSE) + +A Go port of [alizain/ulid](https://github.com/alizain/ulid) with binary format implemented. + +## Background + +A GUID/UUID can be suboptimal for many use-cases because: + +- It isn't the most character efficient way of encoding 128 bits +- UUID v1/v2 is impractical in many environments, as it requires access to a unique, stable MAC address +- UUID v3/v5 requires a unique seed and produces randomly distributed IDs, which can cause fragmentation in many data structures +- UUID v4 provides no other information than randomness which can cause fragmentation in many data structures + +A ULID however: + +- Is compatible with UUID/GUID's +- 1.21e+24 unique ULIDs per millisecond (1,208,925,819,614,629,174,706,176 to be exact) +- Lexicographically sortable +- Canonically encoded as a 26 character string, as opposed to the 36 character UUID +- Uses Crockford's base32 for better efficiency and readability (5 bits per character) +- Case insensitive +- No special characters (URL safe) +- Monotonic sort order (correctly detects and handles the same millisecond) + +## Install + +```shell +go get github.com/oklog/ulid +``` + +## Usage + +An ULID is constructed with a `time.Time` and an `io.Reader` entropy source. +This design allows for greater flexibility in choosing your trade-offs. + +Please note that `rand.Rand` from the `math` package is *not* safe for concurrent use. +Instantiate one per long living go-routine or use a `sync.Pool` if you want to avoid the potential contention of a locked `rand.Source` as its been frequently observed in the package level functions. + + +```go +func ExampleULID() { + t := time.Unix(1000000, 0) + entropy := ulid.Monotonic(rand.New(rand.NewSource(t.UnixNano())), 0) + fmt.Println(ulid.MustNew(ulid.Timestamp(t), entropy)) + // Output: 0000XSNJG0MQJHBF4QX1EFD6Y3 +} + +``` + +## Specification + +Below is the current specification of ULID as implemented in this repository. + +### Components + +**Timestamp** +- 48 bits +- UNIX-time in milliseconds +- Won't run out of space till the year 10895 AD + +**Entropy** +- 80 bits +- User defined entropy source. +- Monotonicity within the same millisecond with [`ulid.Monotonic`](https://godoc.org/github.com/oklog/ulid#Monotonic) + +### Encoding + +[Crockford's Base32](http://www.crockford.com/wrmg/base32.html) is used as shown. +This alphabet excludes the letters I, L, O, and U to avoid confusion and abuse. + +``` +0123456789ABCDEFGHJKMNPQRSTVWXYZ +``` + +### Binary Layout and Byte Order + +The components are encoded as 16 octets. Each component is encoded with the Most Significant Byte first (network byte order). + +``` +0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +| 32_bit_uint_time_high | ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +| 16_bit_uint_time_low | 16_bit_uint_random | ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +| 32_bit_uint_random | ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +| 32_bit_uint_random | ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +``` + +### String Representation + +``` + 01AN4Z07BY 79KA1307SR9X4MV3 +|----------| |----------------| + Timestamp Entropy + 10 chars 16 chars + 48bits 80bits + base32 base32 +``` + +## Test + +```shell +go test ./... +``` + +## Benchmarks + +On a Intel Core i7 Ivy Bridge 2.7 GHz, MacOS 10.12.1 and Go 1.8.0beta1 + +``` +BenchmarkNew/WithCryptoEntropy-8 2000000 771 ns/op 20.73 MB/s 16 B/op 1 allocs/op +BenchmarkNew/WithEntropy-8 20000000 65.8 ns/op 243.01 MB/s 16 B/op 1 allocs/op +BenchmarkNew/WithoutEntropy-8 50000000 30.0 ns/op 534.06 MB/s 16 B/op 1 allocs/op +BenchmarkMustNew/WithCryptoEntropy-8 2000000 781 ns/op 20.48 MB/s 16 B/op 1 allocs/op +BenchmarkMustNew/WithEntropy-8 20000000 70.0 ns/op 228.51 MB/s 16 B/op 1 allocs/op +BenchmarkMustNew/WithoutEntropy-8 50000000 34.6 ns/op 462.98 MB/s 16 B/op 1 allocs/op +BenchmarkParse-8 50000000 30.0 ns/op 866.16 MB/s 0 B/op 0 allocs/op +BenchmarkMustParse-8 50000000 35.2 ns/op 738.94 MB/s 0 B/op 0 allocs/op +BenchmarkString-8 20000000 64.9 ns/op 246.40 MB/s 32 B/op 1 allocs/op +BenchmarkMarshal/Text-8 20000000 55.8 ns/op 286.84 MB/s 32 B/op 1 allocs/op +BenchmarkMarshal/TextTo-8 100000000 22.4 ns/op 714.91 MB/s 0 B/op 0 allocs/op +BenchmarkMarshal/Binary-8 300000000 4.02 ns/op 3981.77 MB/s 0 B/op 0 allocs/op +BenchmarkMarshal/BinaryTo-8 2000000000 1.18 ns/op 13551.75 MB/s 0 B/op 0 allocs/op +BenchmarkUnmarshal/Text-8 100000000 20.5 ns/op 1265.27 MB/s 0 B/op 0 allocs/op +BenchmarkUnmarshal/Binary-8 300000000 4.94 ns/op 3240.01 MB/s 0 B/op 0 allocs/op +BenchmarkNow-8 100000000 15.1 ns/op 528.09 MB/s 0 B/op 0 allocs/op +BenchmarkTimestamp-8 2000000000 0.29 ns/op 27271.59 MB/s 0 B/op 0 allocs/op +BenchmarkTime-8 2000000000 0.58 ns/op 13717.80 MB/s 0 B/op 0 allocs/op +BenchmarkSetTime-8 2000000000 0.89 ns/op 9023.95 MB/s 0 B/op 0 allocs/op +BenchmarkEntropy-8 200000000 7.62 ns/op 1311.66 MB/s 0 B/op 0 allocs/op +BenchmarkSetEntropy-8 2000000000 0.88 ns/op 11376.54 MB/s 0 B/op 0 allocs/op +BenchmarkCompare-8 200000000 7.34 ns/op 4359.23 MB/s 0 B/op 0 allocs/op +``` + +## Prior Art + +- [alizain/ulid](https://github.com/alizain/ulid) +- [RobThree/NUlid](https://github.com/RobThree/NUlid) +- [imdario/go-ulid](https://github.com/imdario/go-ulid) diff --git a/vendor/github.com/oklog/ulid/ulid.go b/vendor/github.com/oklog/ulid/ulid.go new file mode 100644 index 0000000000..c5d0d66fd2 --- /dev/null +++ b/vendor/github.com/oklog/ulid/ulid.go @@ -0,0 +1,614 @@ +// Copyright 2016 The Oklog 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 ulid + +import ( + "bufio" + "bytes" + "database/sql/driver" + "encoding/binary" + "errors" + "io" + "math" + "math/bits" + "math/rand" + "time" +) + +/* +An ULID is a 16 byte Universally Unique Lexicographically Sortable Identifier + + The components are encoded as 16 octets. + Each component is encoded with the MSB first (network byte order). + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | 32_bit_uint_time_high | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | 16_bit_uint_time_low | 16_bit_uint_random | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | 32_bit_uint_random | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | 32_bit_uint_random | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +*/ +type ULID [16]byte + +var ( + // ErrDataSize is returned when parsing or unmarshaling ULIDs with the wrong + // data size. + ErrDataSize = errors.New("ulid: bad data size when unmarshaling") + + // ErrInvalidCharacters is returned when parsing or unmarshaling ULIDs with + // invalid Base32 encodings. + ErrInvalidCharacters = errors.New("ulid: bad data characters when unmarshaling") + + // ErrBufferSize is returned when marshalling ULIDs to a buffer of insufficient + // size. + ErrBufferSize = errors.New("ulid: bad buffer size when marshaling") + + // ErrBigTime is returned when constructing an ULID with a time that is larger + // than MaxTime. + ErrBigTime = errors.New("ulid: time too big") + + // ErrOverflow is returned when unmarshaling a ULID whose first character is + // larger than 7, thereby exceeding the valid bit depth of 128. + ErrOverflow = errors.New("ulid: overflow when unmarshaling") + + // ErrMonotonicOverflow is returned by a Monotonic entropy source when + // incrementing the previous ULID's entropy bytes would result in overflow. + ErrMonotonicOverflow = errors.New("ulid: monotonic entropy overflow") + + // ErrScanValue is returned when the value passed to scan cannot be unmarshaled + // into the ULID. + ErrScanValue = errors.New("ulid: source value must be a string or byte slice") +) + +// New returns an ULID with the given Unix milliseconds timestamp and an +// optional entropy source. Use the Timestamp function to convert +// a time.Time to Unix milliseconds. +// +// ErrBigTime is returned when passing a timestamp bigger than MaxTime. +// Reading from the entropy source may also return an error. +func New(ms uint64, entropy io.Reader) (id ULID, err error) { + if err = id.SetTime(ms); err != nil { + return id, err + } + + switch e := entropy.(type) { + case nil: + return id, err + case *monotonic: + err = e.MonotonicRead(ms, id[6:]) + default: + _, err = io.ReadFull(e, id[6:]) + } + + return id, err +} + +// MustNew is a convenience function equivalent to New that panics on failure +// instead of returning an error. +func MustNew(ms uint64, entropy io.Reader) ULID { + id, err := New(ms, entropy) + if err != nil { + panic(err) + } + return id +} + +// Parse parses an encoded ULID, returning an error in case of failure. +// +// ErrDataSize is returned if the len(ulid) is different from an encoded +// ULID's length. Invalid encodings produce undefined ULIDs. For a version that +// returns an error instead, see ParseStrict. +func Parse(ulid string) (id ULID, err error) { + return id, parse([]byte(ulid), false, &id) +} + +// ParseStrict parses an encoded ULID, returning an error in case of failure. +// +// It is like Parse, but additionally validates that the parsed ULID consists +// only of valid base32 characters. It is slightly slower than Parse. +// +// ErrDataSize is returned if the len(ulid) is different from an encoded +// ULID's length. Invalid encodings return ErrInvalidCharacters. +func ParseStrict(ulid string) (id ULID, err error) { + return id, parse([]byte(ulid), true, &id) +} + +func parse(v []byte, strict bool, id *ULID) error { + // Check if a base32 encoded ULID is the right length. + if len(v) != EncodedSize { + return ErrDataSize + } + + // Check if all the characters in a base32 encoded ULID are part of the + // expected base32 character set. + if strict && + (dec[v[0]] == 0xFF || + dec[v[1]] == 0xFF || + dec[v[2]] == 0xFF || + dec[v[3]] == 0xFF || + dec[v[4]] == 0xFF || + dec[v[5]] == 0xFF || + dec[v[6]] == 0xFF || + dec[v[7]] == 0xFF || + dec[v[8]] == 0xFF || + dec[v[9]] == 0xFF || + dec[v[10]] == 0xFF || + dec[v[11]] == 0xFF || + dec[v[12]] == 0xFF || + dec[v[13]] == 0xFF || + dec[v[14]] == 0xFF || + dec[v[15]] == 0xFF || + dec[v[16]] == 0xFF || + dec[v[17]] == 0xFF || + dec[v[18]] == 0xFF || + dec[v[19]] == 0xFF || + dec[v[20]] == 0xFF || + dec[v[21]] == 0xFF || + dec[v[22]] == 0xFF || + dec[v[23]] == 0xFF || + dec[v[24]] == 0xFF || + dec[v[25]] == 0xFF) { + return ErrInvalidCharacters + } + + // Check if the first character in a base32 encoded ULID will overflow. This + // happens because the base32 representation encodes 130 bits, while the + // ULID is only 128 bits. + // + // See https://github.com/oklog/ulid/issues/9 for details. + if v[0] > '7' { + return ErrOverflow + } + + // Use an optimized unrolled loop (from https://github.com/RobThree/NUlid) + // to decode a base32 ULID. + + // 6 bytes timestamp (48 bits) + (*id)[0] = ((dec[v[0]] << 5) | dec[v[1]]) + (*id)[1] = ((dec[v[2]] << 3) | (dec[v[3]] >> 2)) + (*id)[2] = ((dec[v[3]] << 6) | (dec[v[4]] << 1) | (dec[v[5]] >> 4)) + (*id)[3] = ((dec[v[5]] << 4) | (dec[v[6]] >> 1)) + (*id)[4] = ((dec[v[6]] << 7) | (dec[v[7]] << 2) | (dec[v[8]] >> 3)) + (*id)[5] = ((dec[v[8]] << 5) | dec[v[9]]) + + // 10 bytes of entropy (80 bits) + (*id)[6] = ((dec[v[10]] << 3) | (dec[v[11]] >> 2)) + (*id)[7] = ((dec[v[11]] << 6) | (dec[v[12]] << 1) | (dec[v[13]] >> 4)) + (*id)[8] = ((dec[v[13]] << 4) | (dec[v[14]] >> 1)) + (*id)[9] = ((dec[v[14]] << 7) | (dec[v[15]] << 2) | (dec[v[16]] >> 3)) + (*id)[10] = ((dec[v[16]] << 5) | dec[v[17]]) + (*id)[11] = ((dec[v[18]] << 3) | dec[v[19]]>>2) + (*id)[12] = ((dec[v[19]] << 6) | (dec[v[20]] << 1) | (dec[v[21]] >> 4)) + (*id)[13] = ((dec[v[21]] << 4) | (dec[v[22]] >> 1)) + (*id)[14] = ((dec[v[22]] << 7) | (dec[v[23]] << 2) | (dec[v[24]] >> 3)) + (*id)[15] = ((dec[v[24]] << 5) | dec[v[25]]) + + return nil +} + +// MustParse is a convenience function equivalent to Parse that panics on failure +// instead of returning an error. +func MustParse(ulid string) ULID { + id, err := Parse(ulid) + if err != nil { + panic(err) + } + return id +} + +// MustParseStrict is a convenience function equivalent to ParseStrict that +// panics on failure instead of returning an error. +func MustParseStrict(ulid string) ULID { + id, err := ParseStrict(ulid) + if err != nil { + panic(err) + } + return id +} + +// String returns a lexicographically sortable string encoded ULID +// (26 characters, non-standard base 32) e.g. 01AN4Z07BY79KA1307SR9X4MV3 +// Format: tttttttttteeeeeeeeeeeeeeee where t is time and e is entropy +func (id ULID) String() string { + ulid := make([]byte, EncodedSize) + _ = id.MarshalTextTo(ulid) + return string(ulid) +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface by +// returning the ULID as a byte slice. +func (id ULID) MarshalBinary() ([]byte, error) { + ulid := make([]byte, len(id)) + return ulid, id.MarshalBinaryTo(ulid) +} + +// MarshalBinaryTo writes the binary encoding of the ULID to the given buffer. +// ErrBufferSize is returned when the len(dst) != 16. +func (id ULID) MarshalBinaryTo(dst []byte) error { + if len(dst) != len(id) { + return ErrBufferSize + } + + copy(dst, id[:]) + return nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface by +// copying the passed data and converting it to an ULID. ErrDataSize is +// returned if the data length is different from ULID length. +func (id *ULID) UnmarshalBinary(data []byte) error { + if len(data) != len(*id) { + return ErrDataSize + } + + copy((*id)[:], data) + return nil +} + +// Encoding is the base 32 encoding alphabet used in ULID strings. +const Encoding = "0123456789ABCDEFGHJKMNPQRSTVWXYZ" + +// MarshalText implements the encoding.TextMarshaler interface by +// returning the string encoded ULID. +func (id ULID) MarshalText() ([]byte, error) { + ulid := make([]byte, EncodedSize) + return ulid, id.MarshalTextTo(ulid) +} + +// MarshalTextTo writes the ULID as a string to the given buffer. +// ErrBufferSize is returned when the len(dst) != 26. +func (id ULID) MarshalTextTo(dst []byte) error { + // Optimized unrolled loop ahead. + // From https://github.com/RobThree/NUlid + + if len(dst) != EncodedSize { + return ErrBufferSize + } + + // 10 byte timestamp + dst[0] = Encoding[(id[0]&224)>>5] + dst[1] = Encoding[id[0]&31] + dst[2] = Encoding[(id[1]&248)>>3] + dst[3] = Encoding[((id[1]&7)<<2)|((id[2]&192)>>6)] + dst[4] = Encoding[(id[2]&62)>>1] + dst[5] = Encoding[((id[2]&1)<<4)|((id[3]&240)>>4)] + dst[6] = Encoding[((id[3]&15)<<1)|((id[4]&128)>>7)] + dst[7] = Encoding[(id[4]&124)>>2] + dst[8] = Encoding[((id[4]&3)<<3)|((id[5]&224)>>5)] + dst[9] = Encoding[id[5]&31] + + // 16 bytes of entropy + dst[10] = Encoding[(id[6]&248)>>3] + dst[11] = Encoding[((id[6]&7)<<2)|((id[7]&192)>>6)] + dst[12] = Encoding[(id[7]&62)>>1] + dst[13] = Encoding[((id[7]&1)<<4)|((id[8]&240)>>4)] + dst[14] = Encoding[((id[8]&15)<<1)|((id[9]&128)>>7)] + dst[15] = Encoding[(id[9]&124)>>2] + dst[16] = Encoding[((id[9]&3)<<3)|((id[10]&224)>>5)] + dst[17] = Encoding[id[10]&31] + dst[18] = Encoding[(id[11]&248)>>3] + dst[19] = Encoding[((id[11]&7)<<2)|((id[12]&192)>>6)] + dst[20] = Encoding[(id[12]&62)>>1] + dst[21] = Encoding[((id[12]&1)<<4)|((id[13]&240)>>4)] + dst[22] = Encoding[((id[13]&15)<<1)|((id[14]&128)>>7)] + dst[23] = Encoding[(id[14]&124)>>2] + dst[24] = Encoding[((id[14]&3)<<3)|((id[15]&224)>>5)] + dst[25] = Encoding[id[15]&31] + + return nil +} + +// Byte to index table for O(1) lookups when unmarshaling. +// We use 0xFF as sentinel value for invalid indexes. +var dec = [...]byte{ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, + 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, + 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, 0x15, 0xFF, + 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, 0x1D, 0x1E, + 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, + 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, + 0x15, 0xFF, 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, + 0x1D, 0x1E, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +} + +// EncodedSize is the length of a text encoded ULID. +const EncodedSize = 26 + +// UnmarshalText implements the encoding.TextUnmarshaler interface by +// parsing the data as string encoded ULID. +// +// ErrDataSize is returned if the len(v) is different from an encoded +// ULID's length. Invalid encodings produce undefined ULIDs. +func (id *ULID) UnmarshalText(v []byte) error { + return parse(v, false, id) +} + +// Time returns the Unix time in milliseconds encoded in the ULID. +// Use the top level Time function to convert the returned value to +// a time.Time. +func (id ULID) Time() uint64 { + return uint64(id[5]) | uint64(id[4])<<8 | + uint64(id[3])<<16 | uint64(id[2])<<24 | + uint64(id[1])<<32 | uint64(id[0])<<40 +} + +// maxTime is the maximum Unix time in milliseconds that can be +// represented in an ULID. +var maxTime = ULID{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}.Time() + +// MaxTime returns the maximum Unix time in milliseconds that +// can be encoded in an ULID. +func MaxTime() uint64 { return maxTime } + +// Now is a convenience function that returns the current +// UTC time in Unix milliseconds. Equivalent to: +// Timestamp(time.Now().UTC()) +func Now() uint64 { return Timestamp(time.Now().UTC()) } + +// Timestamp converts a time.Time to Unix milliseconds. +// +// Because of the way ULID stores time, times from the year +// 10889 produces undefined results. +func Timestamp(t time.Time) uint64 { + return uint64(t.Unix())*1000 + + uint64(t.Nanosecond()/int(time.Millisecond)) +} + +// Time converts Unix milliseconds in the format +// returned by the Timestamp function to a time.Time. +func Time(ms uint64) time.Time { + s := int64(ms / 1e3) + ns := int64((ms % 1e3) * 1e6) + return time.Unix(s, ns) +} + +// SetTime sets the time component of the ULID to the given Unix time +// in milliseconds. +func (id *ULID) SetTime(ms uint64) error { + if ms > maxTime { + return ErrBigTime + } + + (*id)[0] = byte(ms >> 40) + (*id)[1] = byte(ms >> 32) + (*id)[2] = byte(ms >> 24) + (*id)[3] = byte(ms >> 16) + (*id)[4] = byte(ms >> 8) + (*id)[5] = byte(ms) + + return nil +} + +// Entropy returns the entropy from the ULID. +func (id ULID) Entropy() []byte { + e := make([]byte, 10) + copy(e, id[6:]) + return e +} + +// SetEntropy sets the ULID entropy to the passed byte slice. +// ErrDataSize is returned if len(e) != 10. +func (id *ULID) SetEntropy(e []byte) error { + if len(e) != 10 { + return ErrDataSize + } + + copy((*id)[6:], e) + return nil +} + +// Compare returns an integer comparing id and other lexicographically. +// The result will be 0 if id==other, -1 if id < other, and +1 if id > other. +func (id ULID) Compare(other ULID) int { + return bytes.Compare(id[:], other[:]) +} + +// Scan implements the sql.Scanner interface. It supports scanning +// a string or byte slice. +func (id *ULID) Scan(src interface{}) error { + switch x := src.(type) { + case nil: + return nil + case string: + return id.UnmarshalText([]byte(x)) + case []byte: + return id.UnmarshalBinary(x) + } + + return ErrScanValue +} + +// Value implements the sql/driver.Valuer interface. This returns the value +// represented as a byte slice. If instead a string is desirable, a wrapper +// type can be created that calls String(). +// +// // stringValuer wraps a ULID as a string-based driver.Valuer. +// type stringValuer ULID +// +// func (id stringValuer) Value() (driver.Value, error) { +// return ULID(id).String(), nil +// } +// +// // Example usage. +// db.Exec("...", stringValuer(id)) +func (id ULID) Value() (driver.Value, error) { + return id.MarshalBinary() +} + +// Monotonic returns an entropy source that is guaranteed to yield +// strictly increasing entropy bytes for the same ULID timestamp. +// On conflicts, the previous ULID entropy is incremented with a +// random number between 1 and `inc` (inclusive). +// +// The provided entropy source must actually yield random bytes or else +// monotonic reads are not guaranteed to terminate, since there isn't +// enough randomness to compute an increment number. +// +// When `inc == 0`, it'll be set to a secure default of `math.MaxUint32`. +// The lower the value of `inc`, the easier the next ULID within the +// same millisecond is to guess. If your code depends on ULIDs having +// secure entropy bytes, then don't go under this default unless you know +// what you're doing. +// +// The returned io.Reader isn't safe for concurrent use. +func Monotonic(entropy io.Reader, inc uint64) io.Reader { + m := monotonic{ + Reader: bufio.NewReader(entropy), + inc: inc, + } + + if m.inc == 0 { + m.inc = math.MaxUint32 + } + + if rng, ok := entropy.(*rand.Rand); ok { + m.rng = rng + } + + return &m +} + +type monotonic struct { + io.Reader + ms uint64 + inc uint64 + entropy uint80 + rand [8]byte + rng *rand.Rand +} + +func (m *monotonic) MonotonicRead(ms uint64, entropy []byte) (err error) { + if !m.entropy.IsZero() && m.ms == ms { + err = m.increment() + m.entropy.AppendTo(entropy) + } else if _, err = io.ReadFull(m.Reader, entropy); err == nil { + m.ms = ms + m.entropy.SetBytes(entropy) + } + return err +} + +// increment the previous entropy number with a random number +// of up to m.inc (inclusive). +func (m *monotonic) increment() error { + if inc, err := m.random(); err != nil { + return err + } else if m.entropy.Add(inc) { + return ErrMonotonicOverflow + } + return nil +} + +// random returns a uniform random value in [1, m.inc), reading entropy +// from m.Reader. When m.inc == 0 || m.inc == 1, it returns 1. +// Adapted from: https://golang.org/pkg/crypto/rand/#Int +func (m *monotonic) random() (inc uint64, err error) { + if m.inc <= 1 { + return 1, nil + } + + // Fast path for using a underlying rand.Rand directly. + if m.rng != nil { + // Range: [1, m.inc) + return 1 + uint64(m.rng.Int63n(int64(m.inc))), nil + } + + // bitLen is the maximum bit length needed to encode a value < m.inc. + bitLen := bits.Len64(m.inc) + + // byteLen is the maximum byte length needed to encode a value < m.inc. + byteLen := uint(bitLen+7) / 8 + + // msbitLen is the number of bits in the most significant byte of m.inc-1. + msbitLen := uint(bitLen % 8) + if msbitLen == 0 { + msbitLen = 8 + } + + for inc == 0 || inc >= m.inc { + if _, err = io.ReadFull(m.Reader, m.rand[:byteLen]); err != nil { + return 0, err + } + + // Clear bits in the first byte to increase the probability + // that the candidate is < m.inc. + m.rand[0] &= uint8(int(1< +- Add IsGlobalTracerRegistered() to indicate if a tracer has been registered (#201) +- Use Set() instead of Add() in HTTPHeadersCarrier (#191) +- Update license to Apache 2.0 (#181) +- Replace 'golang.org/x/net/context' with 'context' (#176) +- Port of Python opentracing/harness/api_check.py to Go (#146) +- Fix race condition in MockSpan.Context() (#170) +- Add PeerHostIPv4.SetString() (#155) +- Add a Noop log field type to log to allow for optional fields (#150) + + +1.0.2 (2017-04-26) +------------------- + +- Add more semantic tags (#139) + + +1.0.1 (2017-02-06) +------------------- + +- Correct spelling in comments +- Address race in nextMockID() (#123) +- log: avoid panic marshaling nil error (#131) +- Deprecate InitGlobalTracer in favor of SetGlobalTracer (#128) +- Drop Go 1.5 that fails in Travis (#129) +- Add convenience methods Key() and Value() to log.Field +- Add convenience methods to log.Field (2 years, 6 months ago) + +1.0.0 (2016-09-26) +------------------- + +- This release implements OpenTracing Specification 1.0 (https://opentracing.io/spec) + diff --git a/vendor/github.com/opentracing/opentracing-go/LICENSE b/vendor/github.com/opentracing/opentracing-go/LICENSE new file mode 100644 index 0000000000..f0027349e8 --- /dev/null +++ b/vendor/github.com/opentracing/opentracing-go/LICENSE @@ -0,0 +1,201 @@ + 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 2016 The OpenTracing 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/github.com/opentracing/opentracing-go/Makefile b/vendor/github.com/opentracing/opentracing-go/Makefile new file mode 100644 index 0000000000..62abb63f58 --- /dev/null +++ b/vendor/github.com/opentracing/opentracing-go/Makefile @@ -0,0 +1,20 @@ +.DEFAULT_GOAL := test-and-lint + +.PHONY: test-and-lint +test-and-lint: test lint + +.PHONY: test +test: + go test -v -cover -race ./... + +.PHONY: cover +cover: + go test -v -coverprofile=coverage.txt -covermode=atomic -race ./... + +.PHONY: lint +lint: + go fmt ./... + golint ./... + @# Run again with magic to exit non-zero if golint outputs anything. + @! (golint ./... | read dummy) + go vet ./... diff --git a/vendor/github.com/opentracing/opentracing-go/README.md b/vendor/github.com/opentracing/opentracing-go/README.md new file mode 100644 index 0000000000..6ef1d7c9d2 --- /dev/null +++ b/vendor/github.com/opentracing/opentracing-go/README.md @@ -0,0 +1,171 @@ +[![Gitter chat](http://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg)](https://gitter.im/opentracing/public) [![Build Status](https://travis-ci.org/opentracing/opentracing-go.svg?branch=master)](https://travis-ci.org/opentracing/opentracing-go) [![GoDoc](https://godoc.org/github.com/opentracing/opentracing-go?status.svg)](http://godoc.org/github.com/opentracing/opentracing-go) +[![Sourcegraph Badge](https://sourcegraph.com/github.com/opentracing/opentracing-go/-/badge.svg)](https://sourcegraph.com/github.com/opentracing/opentracing-go?badge) + +# OpenTracing API for Go + +This package is a Go platform API for OpenTracing. + +## Required Reading + +In order to understand the Go platform API, one must first be familiar with the +[OpenTracing project](https://opentracing.io) and +[terminology](https://opentracing.io/specification/) more specifically. + +## API overview for those adding instrumentation + +Everyday consumers of this `opentracing` package really only need to worry +about a couple of key abstractions: the `StartSpan` function, the `Span` +interface, and binding a `Tracer` at `main()`-time. Here are code snippets +demonstrating some important use cases. + +#### Singleton initialization + +The simplest starting point is `./default_tracer.go`. As early as possible, call + +```go + import "github.com/opentracing/opentracing-go" + import ".../some_tracing_impl" + + func main() { + opentracing.SetGlobalTracer( + // tracing impl specific: + some_tracing_impl.New(...), + ) + ... + } +``` + +#### Non-Singleton initialization + +If you prefer direct control to singletons, manage ownership of the +`opentracing.Tracer` implementation explicitly. + +#### Creating a Span given an existing Go `context.Context` + +If you use `context.Context` in your application, OpenTracing's Go library will +happily rely on it for `Span` propagation. To start a new (blocking child) +`Span`, you can use `StartSpanFromContext`. + +```go + func xyz(ctx context.Context, ...) { + ... + span, ctx := opentracing.StartSpanFromContext(ctx, "operation_name") + defer span.Finish() + span.LogFields( + log.String("event", "soft error"), + log.String("type", "cache timeout"), + log.Int("waited.millis", 1500)) + ... + } +``` + +#### Starting an empty trace by creating a "root span" + +It's always possible to create a "root" `Span` with no parent or other causal +reference. + +```go + func xyz() { + ... + sp := opentracing.StartSpan("operation_name") + defer sp.Finish() + ... + } +``` + +#### Creating a (child) Span given an existing (parent) Span + +```go + func xyz(parentSpan opentracing.Span, ...) { + ... + sp := opentracing.StartSpan( + "operation_name", + opentracing.ChildOf(parentSpan.Context())) + defer sp.Finish() + ... + } +``` + +#### Serializing to the wire + +```go + func makeSomeRequest(ctx context.Context) ... { + if span := opentracing.SpanFromContext(ctx); span != nil { + httpClient := &http.Client{} + httpReq, _ := http.NewRequest("GET", "http://myservice/", nil) + + // Transmit the span's TraceContext as HTTP headers on our + // outbound request. + opentracing.GlobalTracer().Inject( + span.Context(), + opentracing.HTTPHeaders, + opentracing.HTTPHeadersCarrier(httpReq.Header)) + + resp, err := httpClient.Do(httpReq) + ... + } + ... + } +``` + +#### Deserializing from the wire + +```go + http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { + var serverSpan opentracing.Span + appSpecificOperationName := ... + wireContext, err := opentracing.GlobalTracer().Extract( + opentracing.HTTPHeaders, + opentracing.HTTPHeadersCarrier(req.Header)) + if err != nil { + // Optionally record something about err here + } + + // Create the span referring to the RPC client if available. + // If wireContext == nil, a root span will be created. + serverSpan = opentracing.StartSpan( + appSpecificOperationName, + ext.RPCServerOption(wireContext)) + + defer serverSpan.Finish() + + ctx := opentracing.ContextWithSpan(context.Background(), serverSpan) + ... + } +``` + +#### Conditionally capture a field using `log.Noop` + +In some situations, you may want to dynamically decide whether or not +to log a field. For example, you may want to capture additional data, +such as a customer ID, in non-production environments: + +```go + func Customer(order *Order) log.Field { + if os.Getenv("ENVIRONMENT") == "dev" { + return log.String("customer", order.Customer.ID) + } + return log.Noop() + } +``` + +#### Goroutine-safety + +The entire public API is goroutine-safe and does not require external +synchronization. + +## API pointers for those implementing a tracing system + +Tracing system implementors may be able to reuse or copy-paste-modify the `basictracer` package, found [here](https://github.com/opentracing/basictracer-go). In particular, see `basictracer.New(...)`. + +## API compatibility + +For the time being, "mild" backwards-incompatible changes may be made without changing the major version number. As OpenTracing and `opentracing-go` mature, backwards compatibility will become more of a priority. + +## Tracer test suite + +A test suite is available in the [harness](https://godoc.org/github.com/opentracing/opentracing-go/harness) package that can assist Tracer implementors to assert that their Tracer is working correctly. + +## Licensing + +[Apache 2.0 License](./LICENSE). diff --git a/vendor/github.com/opentracing/opentracing-go/ext.go b/vendor/github.com/opentracing/opentracing-go/ext.go new file mode 100644 index 0000000000..e11977ebe8 --- /dev/null +++ b/vendor/github.com/opentracing/opentracing-go/ext.go @@ -0,0 +1,24 @@ +package opentracing + +import ( + "context" +) + +// TracerContextWithSpanExtension is an extension interface that the +// implementation of the Tracer interface may want to implement. It +// allows to have some control over the go context when the +// ContextWithSpan is invoked. +// +// The primary purpose of this extension are adapters from opentracing +// API to some other tracing API. +type TracerContextWithSpanExtension interface { + // ContextWithSpanHook gets called by the ContextWithSpan + // function, when the Tracer implementation also implements + // this interface. It allows to put extra information into the + // context and make it available to the callers of the + // ContextWithSpan. + // + // This hook is invoked before the ContextWithSpan function + // actually puts the span into the context. + ContextWithSpanHook(ctx context.Context, span Span) context.Context +} diff --git a/vendor/github.com/opentracing/opentracing-go/ext/field.go b/vendor/github.com/opentracing/opentracing-go/ext/field.go new file mode 100644 index 0000000000..8282bd7584 --- /dev/null +++ b/vendor/github.com/opentracing/opentracing-go/ext/field.go @@ -0,0 +1,17 @@ +package ext + +import ( + "github.com/opentracing/opentracing-go" + "github.com/opentracing/opentracing-go/log" +) + +// LogError sets the error=true tag on the Span and logs err as an "error" event. +func LogError(span opentracing.Span, err error, fields ...log.Field) { + Error.Set(span, true) + ef := []log.Field{ + log.Event("error"), + log.Error(err), + } + ef = append(ef, fields...) + span.LogFields(ef...) +} diff --git a/vendor/github.com/opentracing/opentracing-go/ext/tags.go b/vendor/github.com/opentracing/opentracing-go/ext/tags.go new file mode 100644 index 0000000000..a414b5951f --- /dev/null +++ b/vendor/github.com/opentracing/opentracing-go/ext/tags.go @@ -0,0 +1,215 @@ +package ext + +import "github.com/opentracing/opentracing-go" + +// These constants define common tag names recommended for better portability across +// tracing systems and languages/platforms. +// +// The tag names are defined as typed strings, so that in addition to the usual use +// +// span.setTag(TagName, value) +// +// they also support value type validation via this additional syntax: +// +// TagName.Set(span, value) +// +var ( + ////////////////////////////////////////////////////////////////////// + // SpanKind (client/server or producer/consumer) + ////////////////////////////////////////////////////////////////////// + + // SpanKind hints at relationship between spans, e.g. client/server + SpanKind = spanKindTagName("span.kind") + + // SpanKindRPCClient marks a span representing the client-side of an RPC + // or other remote call + SpanKindRPCClientEnum = SpanKindEnum("client") + SpanKindRPCClient = opentracing.Tag{Key: string(SpanKind), Value: SpanKindRPCClientEnum} + + // SpanKindRPCServer marks a span representing the server-side of an RPC + // or other remote call + SpanKindRPCServerEnum = SpanKindEnum("server") + SpanKindRPCServer = opentracing.Tag{Key: string(SpanKind), Value: SpanKindRPCServerEnum} + + // SpanKindProducer marks a span representing the producer-side of a + // message bus + SpanKindProducerEnum = SpanKindEnum("producer") + SpanKindProducer = opentracing.Tag{Key: string(SpanKind), Value: SpanKindProducerEnum} + + // SpanKindConsumer marks a span representing the consumer-side of a + // message bus + SpanKindConsumerEnum = SpanKindEnum("consumer") + SpanKindConsumer = opentracing.Tag{Key: string(SpanKind), Value: SpanKindConsumerEnum} + + ////////////////////////////////////////////////////////////////////// + // Component name + ////////////////////////////////////////////////////////////////////// + + // Component is a low-cardinality identifier of the module, library, + // or package that is generating a span. + Component = StringTagName("component") + + ////////////////////////////////////////////////////////////////////// + // Sampling hint + ////////////////////////////////////////////////////////////////////// + + // SamplingPriority determines the priority of sampling this Span. + SamplingPriority = Uint16TagName("sampling.priority") + + ////////////////////////////////////////////////////////////////////// + // Peer tags. These tags can be emitted by either client-side or + // server-side to describe the other side/service in a peer-to-peer + // communications, like an RPC call. + ////////////////////////////////////////////////////////////////////// + + // PeerService records the service name of the peer. + PeerService = StringTagName("peer.service") + + // PeerAddress records the address name of the peer. This may be a "ip:port", + // a bare "hostname", a FQDN or even a database DSN substring + // like "mysql://username@127.0.0.1:3306/dbname" + PeerAddress = StringTagName("peer.address") + + // PeerHostname records the host name of the peer + PeerHostname = StringTagName("peer.hostname") + + // PeerHostIPv4 records IP v4 host address of the peer + PeerHostIPv4 = IPv4TagName("peer.ipv4") + + // PeerHostIPv6 records IP v6 host address of the peer + PeerHostIPv6 = StringTagName("peer.ipv6") + + // PeerPort records port number of the peer + PeerPort = Uint16TagName("peer.port") + + ////////////////////////////////////////////////////////////////////// + // HTTP Tags + ////////////////////////////////////////////////////////////////////// + + // HTTPUrl should be the URL of the request being handled in this segment + // of the trace, in standard URI format. The protocol is optional. + HTTPUrl = StringTagName("http.url") + + // HTTPMethod is the HTTP method of the request, and is case-insensitive. + HTTPMethod = StringTagName("http.method") + + // HTTPStatusCode is the numeric HTTP status code (200, 404, etc) of the + // HTTP response. + HTTPStatusCode = Uint16TagName("http.status_code") + + ////////////////////////////////////////////////////////////////////// + // DB Tags + ////////////////////////////////////////////////////////////////////// + + // DBInstance is database instance name. + DBInstance = StringTagName("db.instance") + + // DBStatement is a database statement for the given database type. + // It can be a query or a prepared statement (i.e., before substitution). + DBStatement = StringTagName("db.statement") + + // DBType is a database type. For any SQL database, "sql". + // For others, the lower-case database category, e.g. "redis" + DBType = StringTagName("db.type") + + // DBUser is a username for accessing database. + DBUser = StringTagName("db.user") + + ////////////////////////////////////////////////////////////////////// + // Message Bus Tag + ////////////////////////////////////////////////////////////////////// + + // MessageBusDestination is an address at which messages can be exchanged + MessageBusDestination = StringTagName("message_bus.destination") + + ////////////////////////////////////////////////////////////////////// + // Error Tag + ////////////////////////////////////////////////////////////////////// + + // Error indicates that operation represented by the span resulted in an error. + Error = BoolTagName("error") +) + +// --- + +// SpanKindEnum represents common span types +type SpanKindEnum string + +type spanKindTagName string + +// Set adds a string tag to the `span` +func (tag spanKindTagName) Set(span opentracing.Span, value SpanKindEnum) { + span.SetTag(string(tag), value) +} + +type rpcServerOption struct { + clientContext opentracing.SpanContext +} + +func (r rpcServerOption) Apply(o *opentracing.StartSpanOptions) { + if r.clientContext != nil { + opentracing.ChildOf(r.clientContext).Apply(o) + } + SpanKindRPCServer.Apply(o) +} + +// RPCServerOption returns a StartSpanOption appropriate for an RPC server span +// with `client` representing the metadata for the remote peer Span if available. +// In case client == nil, due to the client not being instrumented, this RPC +// server span will be a root span. +func RPCServerOption(client opentracing.SpanContext) opentracing.StartSpanOption { + return rpcServerOption{client} +} + +// --- + +// StringTagName is a common tag name to be set to a string value +type StringTagName string + +// Set adds a string tag to the `span` +func (tag StringTagName) Set(span opentracing.Span, value string) { + span.SetTag(string(tag), value) +} + +// --- + +// Uint32TagName is a common tag name to be set to a uint32 value +type Uint32TagName string + +// Set adds a uint32 tag to the `span` +func (tag Uint32TagName) Set(span opentracing.Span, value uint32) { + span.SetTag(string(tag), value) +} + +// --- + +// Uint16TagName is a common tag name to be set to a uint16 value +type Uint16TagName string + +// Set adds a uint16 tag to the `span` +func (tag Uint16TagName) Set(span opentracing.Span, value uint16) { + span.SetTag(string(tag), value) +} + +// --- + +// BoolTagName is a common tag name to be set to a bool value +type BoolTagName string + +// Set adds a bool tag to the `span` +func (tag BoolTagName) Set(span opentracing.Span, value bool) { + span.SetTag(string(tag), value) +} + +// IPv4TagName is a common tag name to be set to an ipv4 value +type IPv4TagName string + +// Set adds IP v4 host address of the peer as an uint32 value to the `span`, keep this for backward and zipkin compatibility +func (tag IPv4TagName) Set(span opentracing.Span, value uint32) { + span.SetTag(string(tag), value) +} + +// SetString records IP v4 host address of the peer as a .-separated tuple to the `span`. E.g., "127.0.0.1" +func (tag IPv4TagName) SetString(span opentracing.Span, value string) { + span.SetTag(string(tag), value) +} diff --git a/vendor/github.com/opentracing/opentracing-go/globaltracer.go b/vendor/github.com/opentracing/opentracing-go/globaltracer.go new file mode 100644 index 0000000000..4f7066a925 --- /dev/null +++ b/vendor/github.com/opentracing/opentracing-go/globaltracer.go @@ -0,0 +1,42 @@ +package opentracing + +type registeredTracer struct { + tracer Tracer + isRegistered bool +} + +var ( + globalTracer = registeredTracer{NoopTracer{}, false} +) + +// SetGlobalTracer sets the [singleton] opentracing.Tracer returned by +// GlobalTracer(). Those who use GlobalTracer (rather than directly manage an +// opentracing.Tracer instance) should call SetGlobalTracer as early as +// possible in main(), prior to calling the `StartSpan` global func below. +// Prior to calling `SetGlobalTracer`, any Spans started via the `StartSpan` +// (etc) globals are noops. +func SetGlobalTracer(tracer Tracer) { + globalTracer = registeredTracer{tracer, true} +} + +// GlobalTracer returns the global singleton `Tracer` implementation. +// Before `SetGlobalTracer()` is called, the `GlobalTracer()` is a noop +// implementation that drops all data handed to it. +func GlobalTracer() Tracer { + return globalTracer.tracer +} + +// StartSpan defers to `Tracer.StartSpan`. See `GlobalTracer()`. +func StartSpan(operationName string, opts ...StartSpanOption) Span { + return globalTracer.tracer.StartSpan(operationName, opts...) +} + +// InitGlobalTracer is deprecated. Please use SetGlobalTracer. +func InitGlobalTracer(tracer Tracer) { + SetGlobalTracer(tracer) +} + +// IsGlobalTracerRegistered returns a `bool` to indicate if a tracer has been globally registered +func IsGlobalTracerRegistered() bool { + return globalTracer.isRegistered +} diff --git a/vendor/github.com/opentracing/opentracing-go/gocontext.go b/vendor/github.com/opentracing/opentracing-go/gocontext.go new file mode 100644 index 0000000000..1831bc9b26 --- /dev/null +++ b/vendor/github.com/opentracing/opentracing-go/gocontext.go @@ -0,0 +1,65 @@ +package opentracing + +import "context" + +type contextKey struct{} + +var activeSpanKey = contextKey{} + +// ContextWithSpan returns a new `context.Context` that holds a reference to +// the span. If span is nil, a new context without an active span is returned. +func ContextWithSpan(ctx context.Context, span Span) context.Context { + if span != nil { + if tracerWithHook, ok := span.Tracer().(TracerContextWithSpanExtension); ok { + ctx = tracerWithHook.ContextWithSpanHook(ctx, span) + } + } + return context.WithValue(ctx, activeSpanKey, span) +} + +// SpanFromContext returns the `Span` previously associated with `ctx`, or +// `nil` if no such `Span` could be found. +// +// NOTE: context.Context != SpanContext: the former is Go's intra-process +// context propagation mechanism, and the latter houses OpenTracing's per-Span +// identity and baggage information. +func SpanFromContext(ctx context.Context) Span { + val := ctx.Value(activeSpanKey) + if sp, ok := val.(Span); ok { + return sp + } + return nil +} + +// StartSpanFromContext starts and returns a Span with `operationName`, using +// any Span found within `ctx` as a ChildOfRef. If no such parent could be +// found, StartSpanFromContext creates a root (parentless) Span. +// +// The second return value is a context.Context object built around the +// returned Span. +// +// Example usage: +// +// SomeFunction(ctx context.Context, ...) { +// sp, ctx := opentracing.StartSpanFromContext(ctx, "SomeFunction") +// defer sp.Finish() +// ... +// } +func StartSpanFromContext(ctx context.Context, operationName string, opts ...StartSpanOption) (Span, context.Context) { + return StartSpanFromContextWithTracer(ctx, GlobalTracer(), operationName, opts...) +} + +// StartSpanFromContextWithTracer starts and returns a span with `operationName` +// using a span found within the context as a ChildOfRef. If that doesn't exist +// it creates a root span. It also returns a context.Context object built +// around the returned span. +// +// It's behavior is identical to StartSpanFromContext except that it takes an explicit +// tracer as opposed to using the global tracer. +func StartSpanFromContextWithTracer(ctx context.Context, tracer Tracer, operationName string, opts ...StartSpanOption) (Span, context.Context) { + if parentSpan := SpanFromContext(ctx); parentSpan != nil { + opts = append(opts, ChildOf(parentSpan.Context())) + } + span := tracer.StartSpan(operationName, opts...) + return span, ContextWithSpan(ctx, span) +} diff --git a/vendor/github.com/opentracing/opentracing-go/log/field.go b/vendor/github.com/opentracing/opentracing-go/log/field.go new file mode 100644 index 0000000000..f222ded797 --- /dev/null +++ b/vendor/github.com/opentracing/opentracing-go/log/field.go @@ -0,0 +1,282 @@ +package log + +import ( + "fmt" + "math" +) + +type fieldType int + +const ( + stringType fieldType = iota + boolType + intType + int32Type + uint32Type + int64Type + uint64Type + float32Type + float64Type + errorType + objectType + lazyLoggerType + noopType +) + +// Field instances are constructed via LogBool, LogString, and so on. +// Tracing implementations may then handle them via the Field.Marshal +// method. +// +// "heavily influenced by" (i.e., partially stolen from) +// https://github.com/uber-go/zap +type Field struct { + key string + fieldType fieldType + numericVal int64 + stringVal string + interfaceVal interface{} +} + +// String adds a string-valued key:value pair to a Span.LogFields() record +func String(key, val string) Field { + return Field{ + key: key, + fieldType: stringType, + stringVal: val, + } +} + +// Bool adds a bool-valued key:value pair to a Span.LogFields() record +func Bool(key string, val bool) Field { + var numericVal int64 + if val { + numericVal = 1 + } + return Field{ + key: key, + fieldType: boolType, + numericVal: numericVal, + } +} + +// Int adds an int-valued key:value pair to a Span.LogFields() record +func Int(key string, val int) Field { + return Field{ + key: key, + fieldType: intType, + numericVal: int64(val), + } +} + +// Int32 adds an int32-valued key:value pair to a Span.LogFields() record +func Int32(key string, val int32) Field { + return Field{ + key: key, + fieldType: int32Type, + numericVal: int64(val), + } +} + +// Int64 adds an int64-valued key:value pair to a Span.LogFields() record +func Int64(key string, val int64) Field { + return Field{ + key: key, + fieldType: int64Type, + numericVal: val, + } +} + +// Uint32 adds a uint32-valued key:value pair to a Span.LogFields() record +func Uint32(key string, val uint32) Field { + return Field{ + key: key, + fieldType: uint32Type, + numericVal: int64(val), + } +} + +// Uint64 adds a uint64-valued key:value pair to a Span.LogFields() record +func Uint64(key string, val uint64) Field { + return Field{ + key: key, + fieldType: uint64Type, + numericVal: int64(val), + } +} + +// Float32 adds a float32-valued key:value pair to a Span.LogFields() record +func Float32(key string, val float32) Field { + return Field{ + key: key, + fieldType: float32Type, + numericVal: int64(math.Float32bits(val)), + } +} + +// Float64 adds a float64-valued key:value pair to a Span.LogFields() record +func Float64(key string, val float64) Field { + return Field{ + key: key, + fieldType: float64Type, + numericVal: int64(math.Float64bits(val)), + } +} + +// Error adds an error with the key "error.object" to a Span.LogFields() record +func Error(err error) Field { + return Field{ + key: "error.object", + fieldType: errorType, + interfaceVal: err, + } +} + +// Object adds an object-valued key:value pair to a Span.LogFields() record +// Please pass in an immutable object, otherwise there may be concurrency issues. +// Such as passing in the map, log.Object may result in "fatal error: concurrent map iteration and map write". +// Because span is sent asynchronously, it is possible that this map will also be modified. +func Object(key string, obj interface{}) Field { + return Field{ + key: key, + fieldType: objectType, + interfaceVal: obj, + } +} + +// Event creates a string-valued Field for span logs with key="event" and value=val. +func Event(val string) Field { + return String("event", val) +} + +// Message creates a string-valued Field for span logs with key="message" and value=val. +func Message(val string) Field { + return String("message", val) +} + +// LazyLogger allows for user-defined, late-bound logging of arbitrary data +type LazyLogger func(fv Encoder) + +// Lazy adds a LazyLogger to a Span.LogFields() record; the tracing +// implementation will call the LazyLogger function at an indefinite time in +// the future (after Lazy() returns). +func Lazy(ll LazyLogger) Field { + return Field{ + fieldType: lazyLoggerType, + interfaceVal: ll, + } +} + +// Noop creates a no-op log field that should be ignored by the tracer. +// It can be used to capture optional fields, for example those that should +// only be logged in non-production environment: +// +// func customerField(order *Order) log.Field { +// if os.Getenv("ENVIRONMENT") == "dev" { +// return log.String("customer", order.Customer.ID) +// } +// return log.Noop() +// } +// +// span.LogFields(log.String("event", "purchase"), customerField(order)) +// +func Noop() Field { + return Field{ + fieldType: noopType, + } +} + +// Encoder allows access to the contents of a Field (via a call to +// Field.Marshal). +// +// Tracer implementations typically provide an implementation of Encoder; +// OpenTracing callers typically do not need to concern themselves with it. +type Encoder interface { + EmitString(key, value string) + EmitBool(key string, value bool) + EmitInt(key string, value int) + EmitInt32(key string, value int32) + EmitInt64(key string, value int64) + EmitUint32(key string, value uint32) + EmitUint64(key string, value uint64) + EmitFloat32(key string, value float32) + EmitFloat64(key string, value float64) + EmitObject(key string, value interface{}) + EmitLazyLogger(value LazyLogger) +} + +// Marshal passes a Field instance through to the appropriate +// field-type-specific method of an Encoder. +func (lf Field) Marshal(visitor Encoder) { + switch lf.fieldType { + case stringType: + visitor.EmitString(lf.key, lf.stringVal) + case boolType: + visitor.EmitBool(lf.key, lf.numericVal != 0) + case intType: + visitor.EmitInt(lf.key, int(lf.numericVal)) + case int32Type: + visitor.EmitInt32(lf.key, int32(lf.numericVal)) + case int64Type: + visitor.EmitInt64(lf.key, int64(lf.numericVal)) + case uint32Type: + visitor.EmitUint32(lf.key, uint32(lf.numericVal)) + case uint64Type: + visitor.EmitUint64(lf.key, uint64(lf.numericVal)) + case float32Type: + visitor.EmitFloat32(lf.key, math.Float32frombits(uint32(lf.numericVal))) + case float64Type: + visitor.EmitFloat64(lf.key, math.Float64frombits(uint64(lf.numericVal))) + case errorType: + if err, ok := lf.interfaceVal.(error); ok { + visitor.EmitString(lf.key, err.Error()) + } else { + visitor.EmitString(lf.key, "") + } + case objectType: + visitor.EmitObject(lf.key, lf.interfaceVal) + case lazyLoggerType: + visitor.EmitLazyLogger(lf.interfaceVal.(LazyLogger)) + case noopType: + // intentionally left blank + } +} + +// Key returns the field's key. +func (lf Field) Key() string { + return lf.key +} + +// Value returns the field's value as interface{}. +func (lf Field) Value() interface{} { + switch lf.fieldType { + case stringType: + return lf.stringVal + case boolType: + return lf.numericVal != 0 + case intType: + return int(lf.numericVal) + case int32Type: + return int32(lf.numericVal) + case int64Type: + return int64(lf.numericVal) + case uint32Type: + return uint32(lf.numericVal) + case uint64Type: + return uint64(lf.numericVal) + case float32Type: + return math.Float32frombits(uint32(lf.numericVal)) + case float64Type: + return math.Float64frombits(uint64(lf.numericVal)) + case errorType, objectType, lazyLoggerType: + return lf.interfaceVal + case noopType: + return nil + default: + return nil + } +} + +// String returns a string representation of the key and value. +func (lf Field) String() string { + return fmt.Sprint(lf.key, ":", lf.Value()) +} diff --git a/vendor/github.com/opentracing/opentracing-go/log/util.go b/vendor/github.com/opentracing/opentracing-go/log/util.go new file mode 100644 index 0000000000..d57e28aa57 --- /dev/null +++ b/vendor/github.com/opentracing/opentracing-go/log/util.go @@ -0,0 +1,61 @@ +package log + +import ( + "fmt" + "reflect" +) + +// InterleavedKVToFields converts keyValues a la Span.LogKV() to a Field slice +// a la Span.LogFields(). +func InterleavedKVToFields(keyValues ...interface{}) ([]Field, error) { + if len(keyValues)%2 != 0 { + return nil, fmt.Errorf("non-even keyValues len: %d", len(keyValues)) + } + fields := make([]Field, len(keyValues)/2) + for i := 0; i*2 < len(keyValues); i++ { + key, ok := keyValues[i*2].(string) + if !ok { + return nil, fmt.Errorf( + "non-string key (pair #%d): %T", + i, keyValues[i*2]) + } + switch typedVal := keyValues[i*2+1].(type) { + case bool: + fields[i] = Bool(key, typedVal) + case string: + fields[i] = String(key, typedVal) + case int: + fields[i] = Int(key, typedVal) + case int8: + fields[i] = Int32(key, int32(typedVal)) + case int16: + fields[i] = Int32(key, int32(typedVal)) + case int32: + fields[i] = Int32(key, typedVal) + case int64: + fields[i] = Int64(key, typedVal) + case uint: + fields[i] = Uint64(key, uint64(typedVal)) + case uint64: + fields[i] = Uint64(key, typedVal) + case uint8: + fields[i] = Uint32(key, uint32(typedVal)) + case uint16: + fields[i] = Uint32(key, uint32(typedVal)) + case uint32: + fields[i] = Uint32(key, typedVal) + case float32: + fields[i] = Float32(key, typedVal) + case float64: + fields[i] = Float64(key, typedVal) + default: + if typedVal == nil || (reflect.ValueOf(typedVal).Kind() == reflect.Ptr && reflect.ValueOf(typedVal).IsNil()) { + fields[i] = String(key, "nil") + continue + } + // When in doubt, coerce to a string + fields[i] = String(key, fmt.Sprint(typedVal)) + } + } + return fields, nil +} diff --git a/vendor/github.com/opentracing/opentracing-go/noop.go b/vendor/github.com/opentracing/opentracing-go/noop.go new file mode 100644 index 0000000000..f9b680a213 --- /dev/null +++ b/vendor/github.com/opentracing/opentracing-go/noop.go @@ -0,0 +1,64 @@ +package opentracing + +import "github.com/opentracing/opentracing-go/log" + +// A NoopTracer is a trivial, minimum overhead implementation of Tracer +// for which all operations are no-ops. +// +// The primary use of this implementation is in libraries, such as RPC +// frameworks, that make tracing an optional feature controlled by the +// end user. A no-op implementation allows said libraries to use it +// as the default Tracer and to write instrumentation that does +// not need to keep checking if the tracer instance is nil. +// +// For the same reason, the NoopTracer is the default "global" tracer +// (see GlobalTracer and SetGlobalTracer functions). +// +// WARNING: NoopTracer does not support baggage propagation. +type NoopTracer struct{} + +type noopSpan struct{} +type noopSpanContext struct{} + +var ( + defaultNoopSpanContext SpanContext = noopSpanContext{} + defaultNoopSpan Span = noopSpan{} + defaultNoopTracer Tracer = NoopTracer{} +) + +const ( + emptyString = "" +) + +// noopSpanContext: +func (n noopSpanContext) ForeachBaggageItem(handler func(k, v string) bool) {} + +// noopSpan: +func (n noopSpan) Context() SpanContext { return defaultNoopSpanContext } +func (n noopSpan) SetBaggageItem(key, val string) Span { return n } +func (n noopSpan) BaggageItem(key string) string { return emptyString } +func (n noopSpan) SetTag(key string, value interface{}) Span { return n } +func (n noopSpan) LogFields(fields ...log.Field) {} +func (n noopSpan) LogKV(keyVals ...interface{}) {} +func (n noopSpan) Finish() {} +func (n noopSpan) FinishWithOptions(opts FinishOptions) {} +func (n noopSpan) SetOperationName(operationName string) Span { return n } +func (n noopSpan) Tracer() Tracer { return defaultNoopTracer } +func (n noopSpan) LogEvent(event string) {} +func (n noopSpan) LogEventWithPayload(event string, payload interface{}) {} +func (n noopSpan) Log(data LogData) {} + +// StartSpan belongs to the Tracer interface. +func (n NoopTracer) StartSpan(operationName string, opts ...StartSpanOption) Span { + return defaultNoopSpan +} + +// Inject belongs to the Tracer interface. +func (n NoopTracer) Inject(sp SpanContext, format interface{}, carrier interface{}) error { + return nil +} + +// Extract belongs to the Tracer interface. +func (n NoopTracer) Extract(format interface{}, carrier interface{}) (SpanContext, error) { + return nil, ErrSpanContextNotFound +} diff --git a/vendor/github.com/opentracing/opentracing-go/propagation.go b/vendor/github.com/opentracing/opentracing-go/propagation.go new file mode 100644 index 0000000000..b0c275eb05 --- /dev/null +++ b/vendor/github.com/opentracing/opentracing-go/propagation.go @@ -0,0 +1,176 @@ +package opentracing + +import ( + "errors" + "net/http" +) + +/////////////////////////////////////////////////////////////////////////////// +// CORE PROPAGATION INTERFACES: +/////////////////////////////////////////////////////////////////////////////// + +var ( + // ErrUnsupportedFormat occurs when the `format` passed to Tracer.Inject() or + // Tracer.Extract() is not recognized by the Tracer implementation. + ErrUnsupportedFormat = errors.New("opentracing: Unknown or unsupported Inject/Extract format") + + // ErrSpanContextNotFound occurs when the `carrier` passed to + // Tracer.Extract() is valid and uncorrupted but has insufficient + // information to extract a SpanContext. + ErrSpanContextNotFound = errors.New("opentracing: SpanContext not found in Extract carrier") + + // ErrInvalidSpanContext errors occur when Tracer.Inject() is asked to + // operate on a SpanContext which it is not prepared to handle (for + // example, since it was created by a different tracer implementation). + ErrInvalidSpanContext = errors.New("opentracing: SpanContext type incompatible with tracer") + + // ErrInvalidCarrier errors occur when Tracer.Inject() or Tracer.Extract() + // implementations expect a different type of `carrier` than they are + // given. + ErrInvalidCarrier = errors.New("opentracing: Invalid Inject/Extract carrier") + + // ErrSpanContextCorrupted occurs when the `carrier` passed to + // Tracer.Extract() is of the expected type but is corrupted. + ErrSpanContextCorrupted = errors.New("opentracing: SpanContext data corrupted in Extract carrier") +) + +/////////////////////////////////////////////////////////////////////////////// +// BUILTIN PROPAGATION FORMATS: +/////////////////////////////////////////////////////////////////////////////// + +// BuiltinFormat is used to demarcate the values within package `opentracing` +// that are intended for use with the Tracer.Inject() and Tracer.Extract() +// methods. +type BuiltinFormat byte + +const ( + // Binary represents SpanContexts as opaque binary data. + // + // For Tracer.Inject(): the carrier must be an `io.Writer`. + // + // For Tracer.Extract(): the carrier must be an `io.Reader`. + Binary BuiltinFormat = iota + + // TextMap represents SpanContexts as key:value string pairs. + // + // Unlike HTTPHeaders, the TextMap format does not restrict the key or + // value character sets in any way. + // + // For Tracer.Inject(): the carrier must be a `TextMapWriter`. + // + // For Tracer.Extract(): the carrier must be a `TextMapReader`. + TextMap + + // HTTPHeaders represents SpanContexts as HTTP header string pairs. + // + // Unlike TextMap, the HTTPHeaders format requires that the keys and values + // be valid as HTTP headers as-is (i.e., character casing may be unstable + // and special characters are disallowed in keys, values should be + // URL-escaped, etc). + // + // For Tracer.Inject(): the carrier must be a `TextMapWriter`. + // + // For Tracer.Extract(): the carrier must be a `TextMapReader`. + // + // See HTTPHeadersCarrier for an implementation of both TextMapWriter + // and TextMapReader that defers to an http.Header instance for storage. + // For example, Inject(): + // + // carrier := opentracing.HTTPHeadersCarrier(httpReq.Header) + // err := span.Tracer().Inject( + // span.Context(), opentracing.HTTPHeaders, carrier) + // + // Or Extract(): + // + // carrier := opentracing.HTTPHeadersCarrier(httpReq.Header) + // clientContext, err := tracer.Extract( + // opentracing.HTTPHeaders, carrier) + // + HTTPHeaders +) + +// TextMapWriter is the Inject() carrier for the TextMap builtin format. With +// it, the caller can encode a SpanContext for propagation as entries in a map +// of unicode strings. +type TextMapWriter interface { + // Set a key:value pair to the carrier. Multiple calls to Set() for the + // same key leads to undefined behavior. + // + // NOTE: The backing store for the TextMapWriter may contain data unrelated + // to SpanContext. As such, Inject() and Extract() implementations that + // call the TextMapWriter and TextMapReader interfaces must agree on a + // prefix or other convention to distinguish their own key:value pairs. + Set(key, val string) +} + +// TextMapReader is the Extract() carrier for the TextMap builtin format. With it, +// the caller can decode a propagated SpanContext as entries in a map of +// unicode strings. +type TextMapReader interface { + // ForeachKey returns TextMap contents via repeated calls to the `handler` + // function. If any call to `handler` returns a non-nil error, ForeachKey + // terminates and returns that error. + // + // NOTE: The backing store for the TextMapReader may contain data unrelated + // to SpanContext. As such, Inject() and Extract() implementations that + // call the TextMapWriter and TextMapReader interfaces must agree on a + // prefix or other convention to distinguish their own key:value pairs. + // + // The "foreach" callback pattern reduces unnecessary copying in some cases + // and also allows implementations to hold locks while the map is read. + ForeachKey(handler func(key, val string) error) error +} + +// TextMapCarrier allows the use of regular map[string]string +// as both TextMapWriter and TextMapReader. +type TextMapCarrier map[string]string + +// ForeachKey conforms to the TextMapReader interface. +func (c TextMapCarrier) ForeachKey(handler func(key, val string) error) error { + for k, v := range c { + if err := handler(k, v); err != nil { + return err + } + } + return nil +} + +// Set implements Set() of opentracing.TextMapWriter +func (c TextMapCarrier) Set(key, val string) { + c[key] = val +} + +// HTTPHeadersCarrier satisfies both TextMapWriter and TextMapReader. +// +// Example usage for server side: +// +// carrier := opentracing.HTTPHeadersCarrier(httpReq.Header) +// clientContext, err := tracer.Extract(opentracing.HTTPHeaders, carrier) +// +// Example usage for client side: +// +// carrier := opentracing.HTTPHeadersCarrier(httpReq.Header) +// err := tracer.Inject( +// span.Context(), +// opentracing.HTTPHeaders, +// carrier) +// +type HTTPHeadersCarrier http.Header + +// Set conforms to the TextMapWriter interface. +func (c HTTPHeadersCarrier) Set(key, val string) { + h := http.Header(c) + h.Set(key, val) +} + +// ForeachKey conforms to the TextMapReader interface. +func (c HTTPHeadersCarrier) ForeachKey(handler func(key, val string) error) error { + for k, vals := range c { + for _, v := range vals { + if err := handler(k, v); err != nil { + return err + } + } + } + return nil +} diff --git a/vendor/github.com/opentracing/opentracing-go/span.go b/vendor/github.com/opentracing/opentracing-go/span.go new file mode 100644 index 0000000000..0d3fb53418 --- /dev/null +++ b/vendor/github.com/opentracing/opentracing-go/span.go @@ -0,0 +1,189 @@ +package opentracing + +import ( + "time" + + "github.com/opentracing/opentracing-go/log" +) + +// SpanContext represents Span state that must propagate to descendant Spans and across process +// boundaries (e.g., a tuple). +type SpanContext interface { + // ForeachBaggageItem grants access to all baggage items stored in the + // SpanContext. + // The handler function will be called for each baggage key/value pair. + // The ordering of items is not guaranteed. + // + // The bool return value indicates if the handler wants to continue iterating + // through the rest of the baggage items; for example if the handler is trying to + // find some baggage item by pattern matching the name, it can return false + // as soon as the item is found to stop further iterations. + ForeachBaggageItem(handler func(k, v string) bool) +} + +// Span represents an active, un-finished span in the OpenTracing system. +// +// Spans are created by the Tracer interface. +type Span interface { + // Sets the end timestamp and finalizes Span state. + // + // With the exception of calls to Context() (which are always allowed), + // Finish() must be the last call made to any span instance, and to do + // otherwise leads to undefined behavior. + Finish() + // FinishWithOptions is like Finish() but with explicit control over + // timestamps and log data. + FinishWithOptions(opts FinishOptions) + + // Context() yields the SpanContext for this Span. Note that the return + // value of Context() is still valid after a call to Span.Finish(), as is + // a call to Span.Context() after a call to Span.Finish(). + Context() SpanContext + + // Sets or changes the operation name. + // + // Returns a reference to this Span for chaining. + SetOperationName(operationName string) Span + + // Adds a tag to the span. + // + // If there is a pre-existing tag set for `key`, it is overwritten. + // + // Tag values can be numeric types, strings, or bools. The behavior of + // other tag value types is undefined at the OpenTracing level. If a + // tracing system does not know how to handle a particular value type, it + // may ignore the tag, but shall not panic. + // + // Returns a reference to this Span for chaining. + SetTag(key string, value interface{}) Span + + // LogFields is an efficient and type-checked way to record key:value + // logging data about a Span, though the programming interface is a little + // more verbose than LogKV(). Here's an example: + // + // span.LogFields( + // log.String("event", "soft error"), + // log.String("type", "cache timeout"), + // log.Int("waited.millis", 1500)) + // + // Also see Span.FinishWithOptions() and FinishOptions.BulkLogData. + LogFields(fields ...log.Field) + + // LogKV is a concise, readable way to record key:value logging data about + // a Span, though unfortunately this also makes it less efficient and less + // type-safe than LogFields(). Here's an example: + // + // span.LogKV( + // "event", "soft error", + // "type", "cache timeout", + // "waited.millis", 1500) + // + // For LogKV (as opposed to LogFields()), the parameters must appear as + // key-value pairs, like + // + // span.LogKV(key1, val1, key2, val2, key3, val3, ...) + // + // The keys must all be strings. The values may be strings, numeric types, + // bools, Go error instances, or arbitrary structs. + // + // (Note to implementors: consider the log.InterleavedKVToFields() helper) + LogKV(alternatingKeyValues ...interface{}) + + // SetBaggageItem sets a key:value pair on this Span and its SpanContext + // that also propagates to descendants of this Span. + // + // SetBaggageItem() enables powerful functionality given a full-stack + // opentracing integration (e.g., arbitrary application data from a mobile + // app can make it, transparently, all the way into the depths of a storage + // system), and with it some powerful costs: use this feature with care. + // + // IMPORTANT NOTE #1: SetBaggageItem() will only propagate baggage items to + // *future* causal descendants of the associated Span. + // + // IMPORTANT NOTE #2: Use this thoughtfully and with care. Every key and + // value is copied into every local *and remote* child of the associated + // Span, and that can add up to a lot of network and cpu overhead. + // + // Returns a reference to this Span for chaining. + SetBaggageItem(restrictedKey, value string) Span + + // Gets the value for a baggage item given its key. Returns the empty string + // if the value isn't found in this Span. + BaggageItem(restrictedKey string) string + + // Provides access to the Tracer that created this Span. + Tracer() Tracer + + // Deprecated: use LogFields or LogKV + LogEvent(event string) + // Deprecated: use LogFields or LogKV + LogEventWithPayload(event string, payload interface{}) + // Deprecated: use LogFields or LogKV + Log(data LogData) +} + +// LogRecord is data associated with a single Span log. Every LogRecord +// instance must specify at least one Field. +type LogRecord struct { + Timestamp time.Time + Fields []log.Field +} + +// FinishOptions allows Span.FinishWithOptions callers to override the finish +// timestamp and provide log data via a bulk interface. +type FinishOptions struct { + // FinishTime overrides the Span's finish time, or implicitly becomes + // time.Now() if FinishTime.IsZero(). + // + // FinishTime must resolve to a timestamp that's >= the Span's StartTime + // (per StartSpanOptions). + FinishTime time.Time + + // LogRecords allows the caller to specify the contents of many LogFields() + // calls with a single slice. May be nil. + // + // None of the LogRecord.Timestamp values may be .IsZero() (i.e., they must + // be set explicitly). Also, they must be >= the Span's start timestamp and + // <= the FinishTime (or time.Now() if FinishTime.IsZero()). Otherwise the + // behavior of FinishWithOptions() is undefined. + // + // If specified, the caller hands off ownership of LogRecords at + // FinishWithOptions() invocation time. + // + // If specified, the (deprecated) BulkLogData must be nil or empty. + LogRecords []LogRecord + + // BulkLogData is DEPRECATED. + BulkLogData []LogData +} + +// LogData is DEPRECATED +type LogData struct { + Timestamp time.Time + Event string + Payload interface{} +} + +// ToLogRecord converts a deprecated LogData to a non-deprecated LogRecord +func (ld *LogData) ToLogRecord() LogRecord { + var literalTimestamp time.Time + if ld.Timestamp.IsZero() { + literalTimestamp = time.Now() + } else { + literalTimestamp = ld.Timestamp + } + rval := LogRecord{ + Timestamp: literalTimestamp, + } + if ld.Payload == nil { + rval.Fields = []log.Field{ + log.String("event", ld.Event), + } + } else { + rval.Fields = []log.Field{ + log.String("event", ld.Event), + log.Object("payload", ld.Payload), + } + } + return rval +} diff --git a/vendor/github.com/opentracing/opentracing-go/tracer.go b/vendor/github.com/opentracing/opentracing-go/tracer.go new file mode 100644 index 0000000000..715f0cedfb --- /dev/null +++ b/vendor/github.com/opentracing/opentracing-go/tracer.go @@ -0,0 +1,304 @@ +package opentracing + +import "time" + +// Tracer is a simple, thin interface for Span creation and SpanContext +// propagation. +type Tracer interface { + + // Create, start, and return a new Span with the given `operationName` and + // incorporate the given StartSpanOption `opts`. (Note that `opts` borrows + // from the "functional options" pattern, per + // http://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis) + // + // A Span with no SpanReference options (e.g., opentracing.ChildOf() or + // opentracing.FollowsFrom()) becomes the root of its own trace. + // + // Examples: + // + // var tracer opentracing.Tracer = ... + // + // // The root-span case: + // sp := tracer.StartSpan("GetFeed") + // + // // The vanilla child span case: + // sp := tracer.StartSpan( + // "GetFeed", + // opentracing.ChildOf(parentSpan.Context())) + // + // // All the bells and whistles: + // sp := tracer.StartSpan( + // "GetFeed", + // opentracing.ChildOf(parentSpan.Context()), + // opentracing.Tag{"user_agent", loggedReq.UserAgent}, + // opentracing.StartTime(loggedReq.Timestamp), + // ) + // + StartSpan(operationName string, opts ...StartSpanOption) Span + + // Inject() takes the `sm` SpanContext instance and injects it for + // propagation within `carrier`. The actual type of `carrier` depends on + // the value of `format`. + // + // OpenTracing defines a common set of `format` values (see BuiltinFormat), + // and each has an expected carrier type. + // + // Other packages may declare their own `format` values, much like the keys + // used by `context.Context` (see https://godoc.org/context#WithValue). + // + // Example usage (sans error handling): + // + // carrier := opentracing.HTTPHeadersCarrier(httpReq.Header) + // err := tracer.Inject( + // span.Context(), + // opentracing.HTTPHeaders, + // carrier) + // + // NOTE: All opentracing.Tracer implementations MUST support all + // BuiltinFormats. + // + // Implementations may return opentracing.ErrUnsupportedFormat if `format` + // is not supported by (or not known by) the implementation. + // + // Implementations may return opentracing.ErrInvalidCarrier or any other + // implementation-specific error if the format is supported but injection + // fails anyway. + // + // See Tracer.Extract(). + Inject(sm SpanContext, format interface{}, carrier interface{}) error + + // Extract() returns a SpanContext instance given `format` and `carrier`. + // + // OpenTracing defines a common set of `format` values (see BuiltinFormat), + // and each has an expected carrier type. + // + // Other packages may declare their own `format` values, much like the keys + // used by `context.Context` (see + // https://godoc.org/golang.org/x/net/context#WithValue). + // + // Example usage (with StartSpan): + // + // + // carrier := opentracing.HTTPHeadersCarrier(httpReq.Header) + // clientContext, err := tracer.Extract(opentracing.HTTPHeaders, carrier) + // + // // ... assuming the ultimate goal here is to resume the trace with a + // // server-side Span: + // var serverSpan opentracing.Span + // if err == nil { + // span = tracer.StartSpan( + // rpcMethodName, ext.RPCServerOption(clientContext)) + // } else { + // span = tracer.StartSpan(rpcMethodName) + // } + // + // + // NOTE: All opentracing.Tracer implementations MUST support all + // BuiltinFormats. + // + // Return values: + // - A successful Extract returns a SpanContext instance and a nil error + // - If there was simply no SpanContext to extract in `carrier`, Extract() + // returns (nil, opentracing.ErrSpanContextNotFound) + // - If `format` is unsupported or unrecognized, Extract() returns (nil, + // opentracing.ErrUnsupportedFormat) + // - If there are more fundamental problems with the `carrier` object, + // Extract() may return opentracing.ErrInvalidCarrier, + // opentracing.ErrSpanContextCorrupted, or implementation-specific + // errors. + // + // See Tracer.Inject(). + Extract(format interface{}, carrier interface{}) (SpanContext, error) +} + +// StartSpanOptions allows Tracer.StartSpan() callers and implementors a +// mechanism to override the start timestamp, specify Span References, and make +// a single Tag or multiple Tags available at Span start time. +// +// StartSpan() callers should look at the StartSpanOption interface and +// implementations available in this package. +// +// Tracer implementations can convert a slice of `StartSpanOption` instances +// into a `StartSpanOptions` struct like so: +// +// func StartSpan(opName string, opts ...opentracing.StartSpanOption) { +// sso := opentracing.StartSpanOptions{} +// for _, o := range opts { +// o.Apply(&sso) +// } +// ... +// } +// +type StartSpanOptions struct { + // Zero or more causal references to other Spans (via their SpanContext). + // If empty, start a "root" Span (i.e., start a new trace). + References []SpanReference + + // StartTime overrides the Span's start time, or implicitly becomes + // time.Now() if StartTime.IsZero(). + StartTime time.Time + + // Tags may have zero or more entries; the restrictions on map values are + // identical to those for Span.SetTag(). May be nil. + // + // If specified, the caller hands off ownership of Tags at + // StartSpan() invocation time. + Tags map[string]interface{} +} + +// StartSpanOption instances (zero or more) may be passed to Tracer.StartSpan. +// +// StartSpanOption borrows from the "functional options" pattern, per +// http://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis +type StartSpanOption interface { + Apply(*StartSpanOptions) +} + +// SpanReferenceType is an enum type describing different categories of +// relationships between two Spans. If Span-2 refers to Span-1, the +// SpanReferenceType describes Span-1 from Span-2's perspective. For example, +// ChildOfRef means that Span-1 created Span-2. +// +// NOTE: Span-1 and Span-2 do *not* necessarily depend on each other for +// completion; e.g., Span-2 may be part of a background job enqueued by Span-1, +// or Span-2 may be sitting in a distributed queue behind Span-1. +type SpanReferenceType int + +const ( + // ChildOfRef refers to a parent Span that caused *and* somehow depends + // upon the new child Span. Often (but not always), the parent Span cannot + // finish until the child Span does. + // + // An timing diagram for a ChildOfRef that's blocked on the new Span: + // + // [-Parent Span---------] + // [-Child Span----] + // + // See http://opentracing.io/spec/ + // + // See opentracing.ChildOf() + ChildOfRef SpanReferenceType = iota + + // FollowsFromRef refers to a parent Span that does not depend in any way + // on the result of the new child Span. For instance, one might use + // FollowsFromRefs to describe pipeline stages separated by queues, + // or a fire-and-forget cache insert at the tail end of a web request. + // + // A FollowsFromRef Span is part of the same logical trace as the new Span: + // i.e., the new Span is somehow caused by the work of its FollowsFromRef. + // + // All of the following could be valid timing diagrams for children that + // "FollowFrom" a parent. + // + // [-Parent Span-] [-Child Span-] + // + // + // [-Parent Span--] + // [-Child Span-] + // + // + // [-Parent Span-] + // [-Child Span-] + // + // See http://opentracing.io/spec/ + // + // See opentracing.FollowsFrom() + FollowsFromRef +) + +// SpanReference is a StartSpanOption that pairs a SpanReferenceType and a +// referenced SpanContext. See the SpanReferenceType documentation for +// supported relationships. If SpanReference is created with +// ReferencedContext==nil, it has no effect. Thus it allows for a more concise +// syntax for starting spans: +// +// sc, _ := tracer.Extract(someFormat, someCarrier) +// span := tracer.StartSpan("operation", opentracing.ChildOf(sc)) +// +// The `ChildOf(sc)` option above will not panic if sc == nil, it will just +// not add the parent span reference to the options. +type SpanReference struct { + Type SpanReferenceType + ReferencedContext SpanContext +} + +// Apply satisfies the StartSpanOption interface. +func (r SpanReference) Apply(o *StartSpanOptions) { + if r.ReferencedContext != nil { + o.References = append(o.References, r) + } +} + +// ChildOf returns a StartSpanOption pointing to a dependent parent span. +// If sc == nil, the option has no effect. +// +// See ChildOfRef, SpanReference +func ChildOf(sc SpanContext) SpanReference { + return SpanReference{ + Type: ChildOfRef, + ReferencedContext: sc, + } +} + +// FollowsFrom returns a StartSpanOption pointing to a parent Span that caused +// the child Span but does not directly depend on its result in any way. +// If sc == nil, the option has no effect. +// +// See FollowsFromRef, SpanReference +func FollowsFrom(sc SpanContext) SpanReference { + return SpanReference{ + Type: FollowsFromRef, + ReferencedContext: sc, + } +} + +// StartTime is a StartSpanOption that sets an explicit start timestamp for the +// new Span. +type StartTime time.Time + +// Apply satisfies the StartSpanOption interface. +func (t StartTime) Apply(o *StartSpanOptions) { + o.StartTime = time.Time(t) +} + +// Tags are a generic map from an arbitrary string key to an opaque value type. +// The underlying tracing system is responsible for interpreting and +// serializing the values. +type Tags map[string]interface{} + +// Apply satisfies the StartSpanOption interface. +func (t Tags) Apply(o *StartSpanOptions) { + if o.Tags == nil { + o.Tags = make(map[string]interface{}) + } + for k, v := range t { + o.Tags[k] = v + } +} + +// Tag may be passed as a StartSpanOption to add a tag to new spans, +// or its Set method may be used to apply the tag to an existing Span, +// for example: +// +// tracer.StartSpan("opName", Tag{"Key", value}) +// +// or +// +// Tag{"key", value}.Set(span) +type Tag struct { + Key string + Value interface{} +} + +// Apply satisfies the StartSpanOption interface. +func (t Tag) Apply(o *StartSpanOptions) { + if o.Tags == nil { + o.Tags = make(map[string]interface{}) + } + o.Tags[t.Key] = t.Value +} + +// Set applies the tag to an existing Span. +func (t Tag) Set(s Span) { + s.SetTag(t.Key, t.Value) +} diff --git a/vendor/github.com/prometheus/client_golang/NOTICE b/vendor/github.com/prometheus/client_golang/NOTICE index dd878a30ee..b9cc55abbb 100644 --- a/vendor/github.com/prometheus/client_golang/NOTICE +++ b/vendor/github.com/prometheus/client_golang/NOTICE @@ -16,8 +16,3 @@ Go support for Protocol Buffers - Google's data interchange format http://github.com/golang/protobuf/ Copyright 2010 The Go Authors See source code for license details. - -Support for streaming Protocol Buffer messages for the Go language (golang). -https://github.com/matttproud/golang_protobuf_extensions -Copyright 2013 Matt T. Proud -Licensed under the Apache License, Version 2.0 diff --git a/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/LICENSE b/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/LICENSE new file mode 100644 index 0000000000..65d761bc9f --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2013 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/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header/header.go b/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header/header.go new file mode 100644 index 0000000000..8547c8dfd1 --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header/header.go @@ -0,0 +1,145 @@ +// 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 or at +// https://developers.google.com/open-source/licenses/bsd. + +// Package header provides functions for parsing HTTP headers. +package header + +import ( + "net/http" + "strings" +) + +// Octet types from RFC 2616. +var octetTypes [256]octetType + +type octetType byte + +const ( + isToken octetType = 1 << iota + isSpace +) + +func init() { + // OCTET = + // CHAR = + // CTL = + // CR = + // LF = + // SP = + // HT = + // <"> = + // CRLF = CR LF + // LWS = [CRLF] 1*( SP | HT ) + // TEXT = + // separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> + // | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT + // token = 1* + // qdtext = > + + for c := 0; c < 256; c++ { + var t octetType + isCtl := c <= 31 || c == 127 + isChar := 0 <= c && c <= 127 + isSeparator := strings.ContainsRune(" \t\"(),/:;<=>?@[]\\{}", rune(c)) + if strings.ContainsRune(" \t\r\n", rune(c)) { + t |= isSpace + } + if isChar && !isCtl && !isSeparator { + t |= isToken + } + octetTypes[c] = t + } +} + +// AcceptSpec describes an Accept* header. +type AcceptSpec struct { + Value string + Q float64 +} + +// ParseAccept parses Accept* headers. +func ParseAccept(header http.Header, key string) (specs []AcceptSpec) { +loop: + for _, s := range header[key] { + for { + var spec AcceptSpec + spec.Value, s = expectTokenSlash(s) + if spec.Value == "" { + continue loop + } + spec.Q = 1.0 + s = skipSpace(s) + if strings.HasPrefix(s, ";") { + s = skipSpace(s[1:]) + if !strings.HasPrefix(s, "q=") { + continue loop + } + spec.Q, s = expectQuality(s[2:]) + if spec.Q < 0.0 { + continue loop + } + } + specs = append(specs, spec) + s = skipSpace(s) + if !strings.HasPrefix(s, ",") { + continue loop + } + s = skipSpace(s[1:]) + } + } + return +} + +func skipSpace(s string) (rest string) { + i := 0 + for ; i < len(s); i++ { + if octetTypes[s[i]]&isSpace == 0 { + break + } + } + return s[i:] +} + +func expectTokenSlash(s string) (token, rest string) { + i := 0 + for ; i < len(s); i++ { + b := s[i] + if (octetTypes[b]&isToken == 0) && b != '/' { + break + } + } + return s[:i], s[i:] +} + +func expectQuality(s string) (q float64, rest string) { + switch { + case len(s) == 0: + return -1, "" + case s[0] == '0': + q = 0 + case s[0] == '1': + q = 1 + default: + return -1, "" + } + s = s[1:] + if !strings.HasPrefix(s, ".") { + return q, s + } + s = s[1:] + i := 0 + n := 0 + d := 1 + for ; i < len(s); i++ { + b := s[i] + if b < '0' || b > '9' { + break + } + n = n*10 + int(b) - '0' + d *= 10 + } + return q + float64(n)/float64(d), s[i:] +} diff --git a/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/negotiate.go b/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/negotiate.go new file mode 100644 index 0000000000..2e45780b74 --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/negotiate.go @@ -0,0 +1,36 @@ +// 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 or at +// https://developers.google.com/open-source/licenses/bsd. + +package httputil + +import ( + "net/http" + + "github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header" +) + +// NegotiateContentEncoding returns the best offered content encoding for the +// request's Accept-Encoding header. If two offers match with equal weight and +// then the offer earlier in the list is preferred. If no offers are +// acceptable, then "" is returned. +func NegotiateContentEncoding(r *http.Request, offers []string) string { + bestOffer := "identity" + bestQ := -1.0 + specs := header.ParseAccept(r.Header, "Accept-Encoding") + for _, offer := range offers { + for _, spec := range specs { + if spec.Q > bestQ && + (spec.Value == "*" || spec.Value == offer) { + bestQ = spec.Q + bestOffer = offer + } + } + } + if bestQ == 0 { + bestOffer = "" + } + return bestOffer +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/README.md b/vendor/github.com/prometheus/client_golang/prometheus/README.md index 44986bff06..c67ff1b7fa 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/README.md +++ b/vendor/github.com/prometheus/client_golang/prometheus/README.md @@ -1 +1 @@ -See [![go-doc](https://godoc.org/github.com/prometheus/client_golang/prometheus?status.svg)](https://godoc.org/github.com/prometheus/client_golang/prometheus). +See [![Go Reference](https://pkg.go.dev/badge/github.com/prometheus/client_golang/prometheus.svg)](https://pkg.go.dev/github.com/prometheus/client_golang/prometheus). diff --git a/vendor/github.com/prometheus/client_golang/prometheus/build_info_collector.go b/vendor/github.com/prometheus/client_golang/prometheus/build_info_collector.go new file mode 100644 index 0000000000..450189f35e --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/build_info_collector.go @@ -0,0 +1,38 @@ +// Copyright 2021 The Prometheus 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 prometheus + +import "runtime/debug" + +// NewBuildInfoCollector is the obsolete version of collectors.NewBuildInfoCollector. +// See there for documentation. +// +// Deprecated: Use collectors.NewBuildInfoCollector instead. +func NewBuildInfoCollector() Collector { + path, version, sum := "unknown", "unknown", "unknown" + if bi, ok := debug.ReadBuildInfo(); ok { + path = bi.Main.Path + version = bi.Main.Version + sum = bi.Main.Sum + } + c := &selfCollector{MustNewConstMetric( + NewDesc( + "go_build_info", + "Build information about the main Go module.", + nil, Labels{"path": path, "version": version, "checksum": sum}, + ), + GaugeValue, 1)} + c.init(c.self) + return c +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/collector.go b/vendor/github.com/prometheus/client_golang/prometheus/collector.go index 1e839650d4..cf05079fb8 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/collector.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/collector.go @@ -69,9 +69,9 @@ type Collector interface { // If a Collector collects the same metrics throughout its lifetime, its // Describe method can simply be implemented as: // -// func (c customCollector) Describe(ch chan<- *Desc) { -// DescribeByCollect(c, ch) -// } +// func (c customCollector) Describe(ch chan<- *Desc) { +// DescribeByCollect(c, ch) +// } // // However, this will not work if the metrics collected change dynamically over // the lifetime of the Collector in a way that their combined set of descriptors @@ -118,3 +118,11 @@ func (c *selfCollector) Describe(ch chan<- *Desc) { func (c *selfCollector) Collect(ch chan<- Metric) { ch <- c.self } + +// collectorMetric is a metric that is also a collector. +// Because of selfCollector, most (if not all) Metrics in +// this package are also collectors. +type collectorMetric interface { + Metric + Collector +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/counter.go b/vendor/github.com/prometheus/client_golang/prometheus/counter.go index 3f8fd790d6..4ce84e7a80 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/counter.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/counter.go @@ -20,6 +20,7 @@ import ( "time" dto "github.com/prometheus/client_model/go" + "google.golang.org/protobuf/types/known/timestamppb" ) // Counter is a Metric that represents a single numerical value that only ever @@ -51,7 +52,7 @@ type Counter interface { // will lead to a valid (label-less) exemplar. But if Labels is nil, the current // exemplar is left in place. AddWithExemplar panics if the value is < 0, if any // of the provided labels are invalid, or if the provided labels contain more -// than 64 runes in total. +// than 128 runes in total. type ExemplarAdder interface { AddWithExemplar(value float64, exemplar Labels) } @@ -59,6 +60,18 @@ type ExemplarAdder interface { // CounterOpts is an alias for Opts. See there for doc comments. type CounterOpts Opts +// CounterVecOpts bundles the options to create a CounterVec metric. +// It is mandatory to set CounterOpts, see there for mandatory fields. VariableLabels +// is optional and can safely be left to its default value. +type CounterVecOpts struct { + CounterOpts + + // VariableLabels are used to partition the metric vector by the given set + // of labels. Each label value will be constrained with the optional Constraint + // function, if provided. + VariableLabels ConstrainableLabels +} + // NewCounter creates a new Counter based on the provided CounterOpts. // // The returned implementation also implements ExemplarAdder. It is safe to @@ -78,8 +91,12 @@ func NewCounter(opts CounterOpts) Counter { nil, opts.ConstLabels, ) - result := &counter{desc: desc, labelPairs: desc.constLabelPairs, now: time.Now} + if opts.now == nil { + opts.now = time.Now + } + result := &counter{desc: desc, labelPairs: desc.constLabelPairs, now: opts.now} result.init(result) // Init self-collection. + result.createdTs = timestamppb.New(opts.now()) return result } @@ -94,10 +111,12 @@ type counter struct { selfCollector desc *Desc + createdTs *timestamppb.Timestamp labelPairs []*dto.LabelPair exemplar atomic.Value // Containing nil or a *dto.Exemplar. - now func() time.Time // To mock out time.Now() for testing. + // now is for testing purposes, by default it's time.Now. + now func() time.Time } func (c *counter) Desc() *Desc { @@ -133,17 +152,21 @@ func (c *counter) Inc() { atomic.AddUint64(&c.valInt, 1) } -func (c *counter) Write(out *dto.Metric) error { +func (c *counter) get() float64 { fval := math.Float64frombits(atomic.LoadUint64(&c.valBits)) ival := atomic.LoadUint64(&c.valInt) - val := fval + float64(ival) + return fval + float64(ival) +} +func (c *counter) Write(out *dto.Metric) error { + // Read the Exemplar first and the value second. This is to avoid a race condition + // where users see an exemplar for a not-yet-existing observation. var exemplar *dto.Exemplar if e := c.exemplar.Load(); e != nil { exemplar = e.(*dto.Exemplar) } - - return populateMetric(CounterValue, val, c.labelPairs, exemplar, out) + val := c.get() + return populateMetric(CounterValue, val, c.labelPairs, exemplar, out, c.createdTs) } func (c *counter) updateExemplar(v float64, l Labels) { @@ -169,19 +192,31 @@ type CounterVec struct { // NewCounterVec creates a new CounterVec based on the provided CounterOpts and // partitioned by the given label names. func NewCounterVec(opts CounterOpts, labelNames []string) *CounterVec { - desc := NewDesc( + return V2.NewCounterVec(CounterVecOpts{ + CounterOpts: opts, + VariableLabels: UnconstrainedLabels(labelNames), + }) +} + +// NewCounterVec creates a new CounterVec based on the provided CounterVecOpts. +func (v2) NewCounterVec(opts CounterVecOpts) *CounterVec { + desc := V2.NewDesc( BuildFQName(opts.Namespace, opts.Subsystem, opts.Name), opts.Help, - labelNames, + opts.VariableLabels, opts.ConstLabels, ) + if opts.now == nil { + opts.now = time.Now + } return &CounterVec{ MetricVec: NewMetricVec(desc, func(lvs ...string) Metric { - if len(lvs) != len(desc.variableLabels) { - panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels, lvs)) + if len(lvs) != len(desc.variableLabels.names) { + panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.names, lvs)) } - result := &counter{desc: desc, labelPairs: MakeLabelPairs(desc, lvs), now: time.Now} + result := &counter{desc: desc, labelPairs: MakeLabelPairs(desc, lvs), now: opts.now} result.init(result) // Init self-collection. + result.createdTs = timestamppb.New(opts.now()) return result }), } @@ -241,7 +276,8 @@ func (v *CounterVec) GetMetricWith(labels Labels) (Counter, error) { // WithLabelValues works as GetMetricWithLabelValues, but panics where // GetMetricWithLabelValues would have returned an error. Not returning an // error allows shortcuts like -// myVec.WithLabelValues("404", "GET").Add(42) +// +// myVec.WithLabelValues("404", "GET").Add(42) func (v *CounterVec) WithLabelValues(lvs ...string) Counter { c, err := v.GetMetricWithLabelValues(lvs...) if err != nil { @@ -252,7 +288,8 @@ func (v *CounterVec) WithLabelValues(lvs ...string) Counter { // With works as GetMetricWith, but panics where GetMetricWithLabels would have // returned an error. Not returning an error allows shortcuts like -// myVec.With(prometheus.Labels{"code": "404", "method": "GET"}).Add(42) +// +// myVec.With(prometheus.Labels{"code": "404", "method": "GET"}).Add(42) func (v *CounterVec) With(labels Labels) Counter { c, err := v.GetMetricWith(labels) if err != nil { diff --git a/vendor/github.com/prometheus/client_golang/prometheus/desc.go b/vendor/github.com/prometheus/client_golang/prometheus/desc.go index 4bb816ab75..68ffe3c248 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/desc.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/desc.go @@ -14,17 +14,16 @@ package prometheus import ( - "errors" "fmt" "sort" "strings" "github.com/cespare/xxhash/v2" - //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/golang/protobuf/proto" + dto "github.com/prometheus/client_model/go" "github.com/prometheus/common/model" + "google.golang.org/protobuf/proto" - dto "github.com/prometheus/client_model/go" + "github.com/prometheus/client_golang/prometheus/internal" ) // Desc is the descriptor used by every Prometheus Metric. It is essentially @@ -51,9 +50,9 @@ type Desc struct { // constLabelPairs contains precalculated DTO label pairs based on // the constant labels. constLabelPairs []*dto.LabelPair - // variableLabels contains names of labels for which the metric - // maintains variable values. - variableLabels []string + // variableLabels contains names of labels and normalization function for + // which the metric maintains variable values. + variableLabels *compiledLabels // id is a hash of the values of the ConstLabels and fqName. This // must be unique among all registered descriptors and can therefore be // used as an identifier of the descriptor. @@ -77,10 +76,24 @@ type Desc struct { // For constLabels, the label values are constant. Therefore, they are fully // specified in the Desc. See the Collector example for a usage pattern. func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) *Desc { + return V2.NewDesc(fqName, help, UnconstrainedLabels(variableLabels), constLabels) +} + +// NewDesc allocates and initializes a new Desc. Errors are recorded in the Desc +// and will be reported on registration time. variableLabels and constLabels can +// be nil if no such labels should be set. fqName must not be empty. +// +// variableLabels only contain the label names and normalization functions. Their +// label values are variable and therefore not part of the Desc. (They are managed +// within the Metric.) +// +// For constLabels, the label values are constant. Therefore, they are fully +// specified in the Desc. See the Collector example for a usage pattern. +func (v2) NewDesc(fqName, help string, variableLabels ConstrainableLabels, constLabels Labels) *Desc { d := &Desc{ fqName: fqName, help: help, - variableLabels: variableLabels, + variableLabels: variableLabels.compile(), } if !model.IsValidMetricName(model.LabelValue(fqName)) { d.err = fmt.Errorf("%q is not a valid metric name", fqName) @@ -90,7 +103,7 @@ func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) * // their sorted label names) plus the fqName (at position 0). labelValues := make([]string, 1, len(constLabels)+1) labelValues[0] = fqName - labelNames := make([]string, 0, len(constLabels)+len(variableLabels)) + labelNames := make([]string, 0, len(constLabels)+len(d.variableLabels.names)) labelNameSet := map[string]struct{}{} // First add only the const label names and sort them... for labelName := range constLabels { @@ -115,16 +128,16 @@ func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) * // Now add the variable label names, but prefix them with something that // cannot be in a regular label name. That prevents matching the label // dimension with a different mix between preset and variable labels. - for _, labelName := range variableLabels { - if !checkLabelName(labelName) { - d.err = fmt.Errorf("%q is not a valid label name for metric %q", labelName, fqName) + for _, label := range d.variableLabels.names { + if !checkLabelName(label) { + d.err = fmt.Errorf("%q is not a valid label name for metric %q", label, fqName) return d } - labelNames = append(labelNames, "$"+labelName) - labelNameSet[labelName] = struct{}{} + labelNames = append(labelNames, "$"+label) + labelNameSet[label] = struct{}{} } if len(labelNames) != len(labelNameSet) { - d.err = errors.New("duplicate label names") + d.err = fmt.Errorf("duplicate label names in constant and variable labels for metric %q", fqName) return d } @@ -154,7 +167,7 @@ func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) * Value: proto.String(v), }) } - sort.Sort(labelPairSorter(d.constLabelPairs)) + sort.Sort(internal.LabelPairSorter(d.constLabelPairs)) return d } @@ -176,11 +189,19 @@ func (d *Desc) String() string { fmt.Sprintf("%s=%q", lp.GetName(), lp.GetValue()), ) } + vlStrings := make([]string, 0, len(d.variableLabels.names)) + for _, vl := range d.variableLabels.names { + if fn, ok := d.variableLabels.labelConstraints[vl]; ok && fn != nil { + vlStrings = append(vlStrings, fmt.Sprintf("c(%s)", vl)) + } else { + vlStrings = append(vlStrings, vl) + } + } return fmt.Sprintf( - "Desc{fqName: %q, help: %q, constLabels: {%s}, variableLabels: %v}", + "Desc{fqName: %q, help: %q, constLabels: {%s}, variableLabels: {%s}}", d.fqName, d.help, strings.Join(lpStrings, ","), - d.variableLabels, + strings.Join(vlStrings, ","), ) } diff --git a/vendor/github.com/prometheus/client_golang/prometheus/doc.go b/vendor/github.com/prometheus/client_golang/prometheus/doc.go index 98450125d6..962608f02c 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/doc.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/doc.go @@ -21,55 +21,66 @@ // All exported functions and methods are safe to be used concurrently unless // specified otherwise. // -// A Basic Example +// # A Basic Example // // As a starting point, a very basic usage example: // -// package main -// -// import ( -// "log" -// "net/http" -// -// "github.com/prometheus/client_golang/prometheus" -// "github.com/prometheus/client_golang/prometheus/promhttp" -// ) -// -// var ( -// cpuTemp = prometheus.NewGauge(prometheus.GaugeOpts{ -// Name: "cpu_temperature_celsius", -// Help: "Current temperature of the CPU.", -// }) -// hdFailures = prometheus.NewCounterVec( -// prometheus.CounterOpts{ -// Name: "hd_errors_total", -// Help: "Number of hard-disk errors.", -// }, -// []string{"device"}, -// ) -// ) -// -// func init() { -// // Metrics have to be registered to be exposed: -// prometheus.MustRegister(cpuTemp) -// prometheus.MustRegister(hdFailures) -// } -// -// func main() { -// cpuTemp.Set(65.3) -// hdFailures.With(prometheus.Labels{"device":"/dev/sda"}).Inc() -// -// // The Handler function provides a default handler to expose metrics -// // via an HTTP server. "/metrics" is the usual endpoint for that. -// http.Handle("/metrics", promhttp.Handler()) -// log.Fatal(http.ListenAndServe(":8080", nil)) -// } -// +// package main +// +// import ( +// "log" +// "net/http" +// +// "github.com/prometheus/client_golang/prometheus" +// "github.com/prometheus/client_golang/prometheus/promhttp" +// ) +// +// type metrics struct { +// cpuTemp prometheus.Gauge +// hdFailures *prometheus.CounterVec +// } +// +// func NewMetrics(reg prometheus.Registerer) *metrics { +// m := &metrics{ +// cpuTemp: prometheus.NewGauge(prometheus.GaugeOpts{ +// Name: "cpu_temperature_celsius", +// Help: "Current temperature of the CPU.", +// }), +// hdFailures: prometheus.NewCounterVec( +// prometheus.CounterOpts{ +// Name: "hd_errors_total", +// Help: "Number of hard-disk errors.", +// }, +// []string{"device"}, +// ), +// } +// reg.MustRegister(m.cpuTemp) +// reg.MustRegister(m.hdFailures) +// return m +// } +// +// func main() { +// // Create a non-global registry. +// reg := prometheus.NewRegistry() +// +// // Create new metrics and register them using the custom registry. +// m := NewMetrics(reg) +// // Set values for the new created metrics. +// m.cpuTemp.Set(65.3) +// m.hdFailures.With(prometheus.Labels{"device":"/dev/sda"}).Inc() +// +// // Expose metrics and custom registry via an HTTP server +// // using the HandleFor function. "/metrics" is the usual endpoint for that. +// http.Handle("/metrics", promhttp.HandlerFor(reg, promhttp.HandlerOpts{Registry: reg})) +// log.Fatal(http.ListenAndServe(":8080", nil)) +// } // // This is a complete program that exports two metrics, a Gauge and a Counter, // the latter with a label attached to turn it into a (one-dimensional) vector. +// It register the metrics using a custom registry and exposes them via an HTTP server +// on the /metrics endpoint. // -// Metrics +// # Metrics // // The number of exported identifiers in this package might appear a bit // overwhelming. However, in addition to the basic plumbing shown in the example @@ -100,7 +111,7 @@ // To create instances of Metrics and their vector versions, you need a suitable // …Opts struct, i.e. GaugeOpts, CounterOpts, SummaryOpts, or HistogramOpts. // -// Custom Collectors and constant Metrics +// # Custom Collectors and constant Metrics // // While you could create your own implementations of Metric, most likely you // will only ever implement the Collector interface on your own. At a first @@ -141,7 +152,7 @@ // a metric, GaugeFunc, CounterFunc, or UntypedFunc might be interesting // shortcuts. // -// Advanced Uses of the Registry +// # Advanced Uses of the Registry // // While MustRegister is the by far most common way of registering a Collector, // sometimes you might want to handle the errors the registration might cause. @@ -176,23 +187,23 @@ // NewProcessCollector). With a custom registry, you are in control and decide // yourself about the Collectors to register. // -// HTTP Exposition +// # HTTP Exposition // // The Registry implements the Gatherer interface. The caller of the Gather // method can then expose the gathered metrics in some way. Usually, the metrics // are served via HTTP on the /metrics endpoint. That's happening in the example // above. The tools to expose metrics via HTTP are in the promhttp sub-package. // -// Pushing to the Pushgateway +// # Pushing to the Pushgateway // // Function for pushing to the Pushgateway can be found in the push sub-package. // -// Graphite Bridge +// # Graphite Bridge // // Functions and examples to push metrics from a Gatherer to Graphite can be // found in the graphite sub-package. // -// Other Means of Exposition +// # Other Means of Exposition // // More ways of exposing metrics can easily be added by following the approaches // of the existing implementations. diff --git a/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go b/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go index c41ab37f3b..de5a856293 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go @@ -48,7 +48,7 @@ func (e *expvarCollector) Collect(ch chan<- Metric) { continue } var v interface{} - labels := make([]string, len(desc.variableLabels)) + labels := make([]string, len(desc.variableLabels.names)) if err := json.Unmarshal([]byte(expVar.String()), &v); err != nil { ch <- NewInvalidMetric(desc, err) continue diff --git a/vendor/github.com/prometheus/client_golang/prometheus/gauge.go b/vendor/github.com/prometheus/client_golang/prometheus/gauge.go index bd0733d6a7..dd2eac9406 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/gauge.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/gauge.go @@ -55,6 +55,18 @@ type Gauge interface { // GaugeOpts is an alias for Opts. See there for doc comments. type GaugeOpts Opts +// GaugeVecOpts bundles the options to create a GaugeVec metric. +// It is mandatory to set GaugeOpts, see there for mandatory fields. VariableLabels +// is optional and can safely be left to its default value. +type GaugeVecOpts struct { + GaugeOpts + + // VariableLabels are used to partition the metric vector by the given set + // of labels. Each label value will be constrained with the optional Constraint + // function, if provided. + VariableLabels ConstrainableLabels +} + // NewGauge creates a new Gauge based on the provided GaugeOpts. // // The returned implementation is optimized for a fast Set method. If you have a @@ -123,7 +135,7 @@ func (g *gauge) Sub(val float64) { func (g *gauge) Write(out *dto.Metric) error { val := math.Float64frombits(atomic.LoadUint64(&g.valBits)) - return populateMetric(GaugeValue, val, g.labelPairs, nil, out) + return populateMetric(GaugeValue, val, g.labelPairs, nil, out, nil) } // GaugeVec is a Collector that bundles a set of Gauges that all share the same @@ -138,16 +150,24 @@ type GaugeVec struct { // NewGaugeVec creates a new GaugeVec based on the provided GaugeOpts and // partitioned by the given label names. func NewGaugeVec(opts GaugeOpts, labelNames []string) *GaugeVec { - desc := NewDesc( + return V2.NewGaugeVec(GaugeVecOpts{ + GaugeOpts: opts, + VariableLabels: UnconstrainedLabels(labelNames), + }) +} + +// NewGaugeVec creates a new GaugeVec based on the provided GaugeVecOpts. +func (v2) NewGaugeVec(opts GaugeVecOpts) *GaugeVec { + desc := V2.NewDesc( BuildFQName(opts.Namespace, opts.Subsystem, opts.Name), opts.Help, - labelNames, + opts.VariableLabels, opts.ConstLabels, ) return &GaugeVec{ MetricVec: NewMetricVec(desc, func(lvs ...string) Metric { - if len(lvs) != len(desc.variableLabels) { - panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels, lvs)) + if len(lvs) != len(desc.variableLabels.names) { + panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.names, lvs)) } result := &gauge{desc: desc, labelPairs: MakeLabelPairs(desc, lvs)} result.init(result) // Init self-collection. @@ -210,7 +230,8 @@ func (v *GaugeVec) GetMetricWith(labels Labels) (Gauge, error) { // WithLabelValues works as GetMetricWithLabelValues, but panics where // GetMetricWithLabelValues would have returned an error. Not returning an // error allows shortcuts like -// myVec.WithLabelValues("404", "GET").Add(42) +// +// myVec.WithLabelValues("404", "GET").Add(42) func (v *GaugeVec) WithLabelValues(lvs ...string) Gauge { g, err := v.GetMetricWithLabelValues(lvs...) if err != nil { @@ -221,7 +242,8 @@ func (v *GaugeVec) WithLabelValues(lvs ...string) Gauge { // With works as GetMetricWith, but panics where GetMetricWithLabels would have // returned an error. Not returning an error allows shortcuts like -// myVec.With(prometheus.Labels{"code": "404", "method": "GET"}).Add(42) +// +// myVec.With(prometheus.Labels{"code": "404", "method": "GET"}).Add(42) func (v *GaugeVec) With(labels Labels) Gauge { g, err := v.GetMetricWith(labels) if err != nil { diff --git a/vendor/github.com/prometheus/client_golang/prometheus/get_pid.go b/vendor/github.com/prometheus/client_golang/prometheus/get_pid.go new file mode 100644 index 0000000000..614fd61be9 --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/get_pid.go @@ -0,0 +1,26 @@ +// Copyright 2015 The Prometheus 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:build !js || wasm +// +build !js wasm + +package prometheus + +import "os" + +func getPIDFn() func() (int, error) { + pid := os.Getpid() + return func() (int, error) { + return pid, nil + } +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/get_pid_gopherjs.go b/vendor/github.com/prometheus/client_golang/prometheus/get_pid_gopherjs.go new file mode 100644 index 0000000000..eaf8059ee1 --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/get_pid_gopherjs.go @@ -0,0 +1,23 @@ +// Copyright 2015 The Prometheus 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:build js && !wasm +// +build js,!wasm + +package prometheus + +func getPIDFn() func() (int, error) { + return func() (int, error) { + return 1, nil + } +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go b/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go index a96ed1cee8..520cbd7d41 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go @@ -16,32 +16,198 @@ package prometheus import ( "runtime" "runtime/debug" - "sync" "time" ) -type goCollector struct { +// goRuntimeMemStats provides the metrics initially provided by runtime.ReadMemStats. +// From Go 1.17 those similar (and better) statistics are provided by runtime/metrics, so +// while eval closure works on runtime.MemStats, the struct from Go 1.17+ is +// populated using runtime/metrics. Those are the defaults we can't alter. +func goRuntimeMemStats() memStatsMetrics { + return memStatsMetrics{ + { + desc: NewDesc( + memstatNamespace("alloc_bytes"), + "Number of bytes allocated in heap and currently in use. Equals to /memory/classes/heap/objects:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.Alloc) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("alloc_bytes_total"), + "Total number of bytes allocated in heap until now, even if released already. Equals to /gc/heap/allocs:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.TotalAlloc) }, + valType: CounterValue, + }, { + desc: NewDesc( + memstatNamespace("sys_bytes"), + "Number of bytes obtained from system. Equals to /memory/classes/total:byte.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.Sys) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("mallocs_total"), + // TODO(bwplotka): We could add go_memstats_heap_objects, probably useful for discovery. Let's gather more feedback, kind of a waste of bytes for everybody for compatibility reasons to keep both, and we can't really rename/remove useful metric. + "Total number of heap objects allocated, both live and gc-ed. Semantically a counter version for go_memstats_heap_objects gauge. Equals to /gc/heap/allocs:objects + /gc/heap/tiny/allocs:objects.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.Mallocs) }, + valType: CounterValue, + }, { + desc: NewDesc( + memstatNamespace("frees_total"), + "Total number of heap objects frees. Equals to /gc/heap/frees:objects + /gc/heap/tiny/allocs:objects.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.Frees) }, + valType: CounterValue, + }, { + desc: NewDesc( + memstatNamespace("heap_alloc_bytes"), + "Number of heap bytes allocated and currently in use, same as go_memstats_alloc_bytes. Equals to /memory/classes/heap/objects:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapAlloc) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("heap_sys_bytes"), + "Number of heap bytes obtained from system. Equals to /memory/classes/heap/objects:bytes + /memory/classes/heap/unused:bytes + /memory/classes/heap/released:bytes + /memory/classes/heap/free:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapSys) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("heap_idle_bytes"), + "Number of heap bytes waiting to be used. Equals to /memory/classes/heap/released:bytes + /memory/classes/heap/free:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapIdle) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("heap_inuse_bytes"), + "Number of heap bytes that are in use. Equals to /memory/classes/heap/objects:bytes + /memory/classes/heap/unused:bytes", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapInuse) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("heap_released_bytes"), + "Number of heap bytes released to OS. Equals to /memory/classes/heap/released:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapReleased) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("heap_objects"), + "Number of currently allocated objects. Equals to /gc/heap/objects:objects.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapObjects) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("stack_inuse_bytes"), + "Number of bytes obtained from system for stack allocator in non-CGO environments. Equals to /memory/classes/heap/stacks:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.StackInuse) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("stack_sys_bytes"), + "Number of bytes obtained from system for stack allocator. Equals to /memory/classes/heap/stacks:bytes + /memory/classes/os-stacks:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.StackSys) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("mspan_inuse_bytes"), + "Number of bytes in use by mspan structures. Equals to /memory/classes/metadata/mspan/inuse:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.MSpanInuse) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("mspan_sys_bytes"), + "Number of bytes used for mspan structures obtained from system. Equals to /memory/classes/metadata/mspan/inuse:bytes + /memory/classes/metadata/mspan/free:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.MSpanSys) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("mcache_inuse_bytes"), + "Number of bytes in use by mcache structures. Equals to /memory/classes/metadata/mcache/inuse:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.MCacheInuse) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("mcache_sys_bytes"), + "Number of bytes used for mcache structures obtained from system. Equals to /memory/classes/metadata/mcache/inuse:bytes + /memory/classes/metadata/mcache/free:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.MCacheSys) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("buck_hash_sys_bytes"), + "Number of bytes used by the profiling bucket hash table. Equals to /memory/classes/profiling/buckets:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.BuckHashSys) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("gc_sys_bytes"), + "Number of bytes used for garbage collection system metadata. Equals to /memory/classes/metadata/other:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.GCSys) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("other_sys_bytes"), + "Number of bytes used for other system allocations. Equals to /memory/classes/other:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.OtherSys) }, + valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("next_gc_bytes"), + "Number of heap bytes when next garbage collection will take place. Equals to /gc/heap/goal:bytes.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return float64(ms.NextGC) }, + valType: GaugeValue, + }, + } +} + +type baseGoCollector struct { goroutinesDesc *Desc threadsDesc *Desc gcDesc *Desc + gcLastTimeDesc *Desc goInfoDesc *Desc - - // ms... are memstats related. - msLast *runtime.MemStats // Previously collected memstats. - msLastTimestamp time.Time - msMtx sync.Mutex // Protects msLast and msLastTimestamp. - msMetrics memStatsMetrics - msRead func(*runtime.MemStats) // For mocking in tests. - msMaxWait time.Duration // Wait time for fresh memstats. - msMaxAge time.Duration // Maximum allowed age of old memstats. } -// NewGoCollector is the obsolete version of collectors.NewGoCollector. -// See there for documentation. -// -// Deprecated: Use collectors.NewGoCollector instead. -func NewGoCollector() Collector { - return &goCollector{ +func newBaseGoCollector() baseGoCollector { + return baseGoCollector{ goroutinesDesc: NewDesc( "go_goroutines", "Number of goroutines that currently exist.", @@ -52,248 +218,34 @@ func NewGoCollector() Collector { nil, nil), gcDesc: NewDesc( "go_gc_duration_seconds", - "A summary of the pause duration of garbage collection cycles.", + "A summary of the wall-time pause (stop-the-world) duration in garbage collection cycles.", + nil, nil), + gcLastTimeDesc: NewDesc( + "go_memstats_last_gc_time_seconds", + "Number of seconds since 1970 of last garbage collection.", nil, nil), goInfoDesc: NewDesc( "go_info", "Information about the Go environment.", nil, Labels{"version": runtime.Version()}), - msLast: &runtime.MemStats{}, - msRead: runtime.ReadMemStats, - msMaxWait: time.Second, - msMaxAge: 5 * time.Minute, - msMetrics: memStatsMetrics{ - { - desc: NewDesc( - memstatNamespace("alloc_bytes"), - "Number of bytes allocated and still in use.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.Alloc) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("alloc_bytes_total"), - "Total number of bytes allocated, even if freed.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.TotalAlloc) }, - valType: CounterValue, - }, { - desc: NewDesc( - memstatNamespace("sys_bytes"), - "Number of bytes obtained from system.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.Sys) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("lookups_total"), - "Total number of pointer lookups.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.Lookups) }, - valType: CounterValue, - }, { - desc: NewDesc( - memstatNamespace("mallocs_total"), - "Total number of mallocs.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.Mallocs) }, - valType: CounterValue, - }, { - desc: NewDesc( - memstatNamespace("frees_total"), - "Total number of frees.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.Frees) }, - valType: CounterValue, - }, { - desc: NewDesc( - memstatNamespace("heap_alloc_bytes"), - "Number of heap bytes allocated and still in use.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapAlloc) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("heap_sys_bytes"), - "Number of heap bytes obtained from system.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapSys) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("heap_idle_bytes"), - "Number of heap bytes waiting to be used.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapIdle) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("heap_inuse_bytes"), - "Number of heap bytes that are in use.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapInuse) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("heap_released_bytes"), - "Number of heap bytes released to OS.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapReleased) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("heap_objects"), - "Number of allocated objects.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapObjects) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("stack_inuse_bytes"), - "Number of bytes in use by the stack allocator.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.StackInuse) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("stack_sys_bytes"), - "Number of bytes obtained from system for stack allocator.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.StackSys) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("mspan_inuse_bytes"), - "Number of bytes in use by mspan structures.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.MSpanInuse) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("mspan_sys_bytes"), - "Number of bytes used for mspan structures obtained from system.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.MSpanSys) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("mcache_inuse_bytes"), - "Number of bytes in use by mcache structures.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.MCacheInuse) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("mcache_sys_bytes"), - "Number of bytes used for mcache structures obtained from system.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.MCacheSys) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("buck_hash_sys_bytes"), - "Number of bytes used by the profiling bucket hash table.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.BuckHashSys) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("gc_sys_bytes"), - "Number of bytes used for garbage collection system metadata.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.GCSys) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("other_sys_bytes"), - "Number of bytes used for other system allocations.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.OtherSys) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("next_gc_bytes"), - "Number of heap bytes when next garbage collection will take place.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.NextGC) }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("last_gc_time_seconds"), - "Number of seconds since 1970 of last garbage collection.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return float64(ms.LastGC) / 1e9 }, - valType: GaugeValue, - }, { - desc: NewDesc( - memstatNamespace("gc_cpu_fraction"), - "The fraction of this program's available CPU time used by the GC since the program started.", - nil, nil, - ), - eval: func(ms *runtime.MemStats) float64 { return ms.GCCPUFraction }, - valType: GaugeValue, - }, - }, } } -func memstatNamespace(s string) string { - return "go_memstats_" + s -} - // Describe returns all descriptions of the collector. -func (c *goCollector) Describe(ch chan<- *Desc) { +func (c *baseGoCollector) Describe(ch chan<- *Desc) { ch <- c.goroutinesDesc ch <- c.threadsDesc ch <- c.gcDesc + ch <- c.gcLastTimeDesc ch <- c.goInfoDesc - for _, i := range c.msMetrics { - ch <- i.desc - } } // Collect returns the current state of all metrics of the collector. -func (c *goCollector) Collect(ch chan<- Metric) { - var ( - ms = &runtime.MemStats{} - done = make(chan struct{}) - ) - // Start reading memstats first as it might take a while. - go func() { - c.msRead(ms) - c.msMtx.Lock() - c.msLast = ms - c.msLastTimestamp = time.Now() - c.msMtx.Unlock() - close(done) - }() - +func (c *baseGoCollector) Collect(ch chan<- Metric) { ch <- MustNewConstMetric(c.goroutinesDesc, GaugeValue, float64(runtime.NumGoroutine())) - n, _ := runtime.ThreadCreateProfile(nil) - ch <- MustNewConstMetric(c.threadsDesc, GaugeValue, float64(n)) + + n := getRuntimeNumThreads() + ch <- MustNewConstMetric(c.threadsDesc, GaugeValue, n) var stats debug.GCStats stats.PauseQuantiles = make([]time.Duration, 5) @@ -305,63 +257,18 @@ func (c *goCollector) Collect(ch chan<- Metric) { } quantiles[0.0] = stats.PauseQuantiles[0].Seconds() ch <- MustNewConstSummary(c.gcDesc, uint64(stats.NumGC), stats.PauseTotal.Seconds(), quantiles) - + ch <- MustNewConstMetric(c.gcLastTimeDesc, GaugeValue, float64(stats.LastGC.UnixNano())/1e9) ch <- MustNewConstMetric(c.goInfoDesc, GaugeValue, 1) - - timer := time.NewTimer(c.msMaxWait) - select { - case <-done: // Our own ReadMemStats succeeded in time. Use it. - timer.Stop() // Important for high collection frequencies to not pile up timers. - c.msCollect(ch, ms) - return - case <-timer.C: // Time out, use last memstats if possible. Continue below. - } - c.msMtx.Lock() - if time.Since(c.msLastTimestamp) < c.msMaxAge { - // Last memstats are recent enough. Collect from them under the lock. - c.msCollect(ch, c.msLast) - c.msMtx.Unlock() - return - } - // If we are here, the last memstats are too old or don't exist. We have - // to wait until our own ReadMemStats finally completes. For that to - // happen, we have to release the lock. - c.msMtx.Unlock() - <-done - c.msCollect(ch, ms) } -func (c *goCollector) msCollect(ch chan<- Metric, ms *runtime.MemStats) { - for _, i := range c.msMetrics { - ch <- MustNewConstMetric(i.desc, i.valType, i.eval(ms)) - } +func memstatNamespace(s string) string { + return "go_memstats_" + s } -// memStatsMetrics provide description, value, and value type for memstat metrics. +// memStatsMetrics provide description, evaluator, runtime/metrics name, and +// value type for memstat metrics. type memStatsMetrics []struct { desc *Desc eval func(*runtime.MemStats) float64 valType ValueType } - -// NewBuildInfoCollector is the obsolete version of collectors.NewBuildInfoCollector. -// See there for documentation. -// -// Deprecated: Use collectors.NewBuildInfoCollector instead. -func NewBuildInfoCollector() Collector { - path, version, sum := "unknown", "unknown", "unknown" - if bi, ok := debug.ReadBuildInfo(); ok { - path = bi.Main.Path - version = bi.Main.Version - sum = bi.Main.Sum - } - c := &selfCollector{MustNewConstMetric( - NewDesc( - "go_build_info", - "Build information about the main Go module.", - nil, Labels{"path": path, "version": version, "checksum": sum}, - ), - GaugeValue, 1)} - c.init(c.self) - return c -} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/go_collector_go116.go b/vendor/github.com/prometheus/client_golang/prometheus/go_collector_go116.go new file mode 100644 index 0000000000..897a6e906b --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/go_collector_go116.go @@ -0,0 +1,122 @@ +// Copyright 2021 The Prometheus 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:build !go1.17 +// +build !go1.17 + +package prometheus + +import ( + "runtime" + "sync" + "time" +) + +type goCollector struct { + base baseGoCollector + + // ms... are memstats related. + msLast *runtime.MemStats // Previously collected memstats. + msLastTimestamp time.Time + msMtx sync.Mutex // Protects msLast and msLastTimestamp. + msMetrics memStatsMetrics + msRead func(*runtime.MemStats) // For mocking in tests. + msMaxWait time.Duration // Wait time for fresh memstats. + msMaxAge time.Duration // Maximum allowed age of old memstats. +} + +// NewGoCollector is the obsolete version of collectors.NewGoCollector. +// See there for documentation. +// +// Deprecated: Use collectors.NewGoCollector instead. +func NewGoCollector() Collector { + msMetrics := goRuntimeMemStats() + msMetrics = append(msMetrics, struct { + desc *Desc + eval func(*runtime.MemStats) float64 + valType ValueType + }{ + // This metric is omitted in Go1.17+, see https://github.com/prometheus/client_golang/issues/842#issuecomment-861812034 + desc: NewDesc( + memstatNamespace("gc_cpu_fraction"), + "The fraction of this program's available CPU time used by the GC since the program started.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return ms.GCCPUFraction }, + valType: GaugeValue, + }) + return &goCollector{ + base: newBaseGoCollector(), + msLast: &runtime.MemStats{}, + msRead: runtime.ReadMemStats, + msMaxWait: time.Second, + msMaxAge: 5 * time.Minute, + msMetrics: msMetrics, + } +} + +// Describe returns all descriptions of the collector. +func (c *goCollector) Describe(ch chan<- *Desc) { + c.base.Describe(ch) + for _, i := range c.msMetrics { + ch <- i.desc + } +} + +// Collect returns the current state of all metrics of the collector. +func (c *goCollector) Collect(ch chan<- Metric) { + var ( + ms = &runtime.MemStats{} + done = make(chan struct{}) + ) + // Start reading memstats first as it might take a while. + go func() { + c.msRead(ms) + c.msMtx.Lock() + c.msLast = ms + c.msLastTimestamp = time.Now() + c.msMtx.Unlock() + close(done) + }() + + // Collect base non-memory metrics. + c.base.Collect(ch) + + timer := time.NewTimer(c.msMaxWait) + select { + case <-done: // Our own ReadMemStats succeeded in time. Use it. + timer.Stop() // Important for high collection frequencies to not pile up timers. + c.msCollect(ch, ms) + return + case <-timer.C: // Time out, use last memstats if possible. Continue below. + } + c.msMtx.Lock() + if time.Since(c.msLastTimestamp) < c.msMaxAge { + // Last memstats are recent enough. Collect from them under the lock. + c.msCollect(ch, c.msLast) + c.msMtx.Unlock() + return + } + // If we are here, the last memstats are too old or don't exist. We have + // to wait until our own ReadMemStats finally completes. For that to + // happen, we have to release the lock. + c.msMtx.Unlock() + <-done + c.msCollect(ch, ms) +} + +func (c *goCollector) msCollect(ch chan<- Metric, ms *runtime.MemStats) { + for _, i := range c.msMetrics { + ch <- MustNewConstMetric(i.desc, i.valType, i.eval(ms)) + } +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/go_collector_latest.go b/vendor/github.com/prometheus/client_golang/prometheus/go_collector_latest.go new file mode 100644 index 0000000000..5117464172 --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/go_collector_latest.go @@ -0,0 +1,574 @@ +// Copyright 2021 The Prometheus 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:build go1.17 +// +build go1.17 + +package prometheus + +import ( + "fmt" + "math" + "runtime" + "runtime/metrics" + "strings" + "sync" + + "github.com/prometheus/client_golang/prometheus/internal" + + dto "github.com/prometheus/client_model/go" + "google.golang.org/protobuf/proto" +) + +const ( + // constants for strings referenced more than once. + goGCHeapTinyAllocsObjects = "/gc/heap/tiny/allocs:objects" + goGCHeapAllocsObjects = "/gc/heap/allocs:objects" + goGCHeapFreesObjects = "/gc/heap/frees:objects" + goGCHeapFreesBytes = "/gc/heap/frees:bytes" + goGCHeapAllocsBytes = "/gc/heap/allocs:bytes" + goGCHeapObjects = "/gc/heap/objects:objects" + goGCHeapGoalBytes = "/gc/heap/goal:bytes" + goMemoryClassesTotalBytes = "/memory/classes/total:bytes" + goMemoryClassesHeapObjectsBytes = "/memory/classes/heap/objects:bytes" + goMemoryClassesHeapUnusedBytes = "/memory/classes/heap/unused:bytes" + goMemoryClassesHeapReleasedBytes = "/memory/classes/heap/released:bytes" + goMemoryClassesHeapFreeBytes = "/memory/classes/heap/free:bytes" + goMemoryClassesHeapStacksBytes = "/memory/classes/heap/stacks:bytes" + goMemoryClassesOSStacksBytes = "/memory/classes/os-stacks:bytes" + goMemoryClassesMetadataMSpanInuseBytes = "/memory/classes/metadata/mspan/inuse:bytes" + goMemoryClassesMetadataMSPanFreeBytes = "/memory/classes/metadata/mspan/free:bytes" + goMemoryClassesMetadataMCacheInuseBytes = "/memory/classes/metadata/mcache/inuse:bytes" + goMemoryClassesMetadataMCacheFreeBytes = "/memory/classes/metadata/mcache/free:bytes" + goMemoryClassesProfilingBucketsBytes = "/memory/classes/profiling/buckets:bytes" + goMemoryClassesMetadataOtherBytes = "/memory/classes/metadata/other:bytes" + goMemoryClassesOtherBytes = "/memory/classes/other:bytes" +) + +// rmNamesForMemStatsMetrics represents runtime/metrics names required to populate goRuntimeMemStats from like logic. +var rmNamesForMemStatsMetrics = []string{ + goGCHeapTinyAllocsObjects, + goGCHeapAllocsObjects, + goGCHeapFreesObjects, + goGCHeapAllocsBytes, + goGCHeapObjects, + goGCHeapGoalBytes, + goMemoryClassesTotalBytes, + goMemoryClassesHeapObjectsBytes, + goMemoryClassesHeapUnusedBytes, + goMemoryClassesHeapReleasedBytes, + goMemoryClassesHeapFreeBytes, + goMemoryClassesHeapStacksBytes, + goMemoryClassesOSStacksBytes, + goMemoryClassesMetadataMSpanInuseBytes, + goMemoryClassesMetadataMSPanFreeBytes, + goMemoryClassesMetadataMCacheInuseBytes, + goMemoryClassesMetadataMCacheFreeBytes, + goMemoryClassesProfilingBucketsBytes, + goMemoryClassesMetadataOtherBytes, + goMemoryClassesOtherBytes, +} + +func bestEffortLookupRM(lookup []string) []metrics.Description { + ret := make([]metrics.Description, 0, len(lookup)) + for _, rm := range metrics.All() { + for _, m := range lookup { + if m == rm.Name { + ret = append(ret, rm) + } + } + } + return ret +} + +type goCollector struct { + base baseGoCollector + + // mu protects updates to all fields ensuring a consistent + // snapshot is always produced by Collect. + mu sync.Mutex + + // Contains all samples that has to retrieved from runtime/metrics (not all of them will be exposed). + sampleBuf []metrics.Sample + // sampleMap allows lookup for MemStats metrics and runtime/metrics histograms for exact sums. + sampleMap map[string]*metrics.Sample + + // rmExposedMetrics represents all runtime/metrics package metrics + // that were configured to be exposed. + rmExposedMetrics []collectorMetric + rmExactSumMapForHist map[string]string + + // With Go 1.17, the runtime/metrics package was introduced. + // From that point on, metric names produced by the runtime/metrics + // package could be generated from runtime/metrics names. However, + // these differ from the old names for the same values. + // + // This field exists to export the same values under the old names + // as well. + msMetrics memStatsMetrics + msMetricsEnabled bool +} + +type rmMetricDesc struct { + metrics.Description +} + +func matchRuntimeMetricsRules(rules []internal.GoCollectorRule) []rmMetricDesc { + var descs []rmMetricDesc + for _, d := range metrics.All() { + var ( + deny = true + desc rmMetricDesc + ) + + for _, r := range rules { + if !r.Matcher.MatchString(d.Name) { + continue + } + deny = r.Deny + } + if deny { + continue + } + + desc.Description = d + descs = append(descs, desc) + } + return descs +} + +func defaultGoCollectorOptions() internal.GoCollectorOptions { + return internal.GoCollectorOptions{ + RuntimeMetricSumForHist: map[string]string{ + "/gc/heap/allocs-by-size:bytes": goGCHeapAllocsBytes, + "/gc/heap/frees-by-size:bytes": goGCHeapFreesBytes, + }, + RuntimeMetricRules: []internal.GoCollectorRule{ + // Recommended metrics we want by default from runtime/metrics. + {Matcher: internal.GoCollectorDefaultRuntimeMetrics}, + }, + } +} + +// NewGoCollector is the obsolete version of collectors.NewGoCollector. +// See there for documentation. +// +// Deprecated: Use collectors.NewGoCollector instead. +func NewGoCollector(opts ...func(o *internal.GoCollectorOptions)) Collector { + opt := defaultGoCollectorOptions() + for _, o := range opts { + o(&opt) + } + + exposedDescriptions := matchRuntimeMetricsRules(opt.RuntimeMetricRules) + + // Collect all histogram samples so that we can get their buckets. + // The API guarantees that the buckets are always fixed for the lifetime + // of the process. + var histograms []metrics.Sample + for _, d := range exposedDescriptions { + if d.Kind == metrics.KindFloat64Histogram { + histograms = append(histograms, metrics.Sample{Name: d.Name}) + } + } + + if len(histograms) > 0 { + metrics.Read(histograms) + } + + bucketsMap := make(map[string][]float64) + for i := range histograms { + bucketsMap[histograms[i].Name] = histograms[i].Value.Float64Histogram().Buckets + } + + // Generate a collector for each exposed runtime/metrics metric. + metricSet := make([]collectorMetric, 0, len(exposedDescriptions)) + // SampleBuf is used for reading from runtime/metrics. + // We are assuming the largest case to have stable pointers for sampleMap purposes. + sampleBuf := make([]metrics.Sample, 0, len(exposedDescriptions)+len(opt.RuntimeMetricSumForHist)+len(rmNamesForMemStatsMetrics)) + sampleMap := make(map[string]*metrics.Sample, len(exposedDescriptions)) + for _, d := range exposedDescriptions { + namespace, subsystem, name, ok := internal.RuntimeMetricsToProm(&d.Description) + if !ok { + // Just ignore this metric; we can't do anything with it here. + // If a user decides to use the latest version of Go, we don't want + // to fail here. This condition is tested in TestExpectedRuntimeMetrics. + continue + } + help := attachOriginalName(d.Description.Description, d.Name) + + sampleBuf = append(sampleBuf, metrics.Sample{Name: d.Name}) + sampleMap[d.Name] = &sampleBuf[len(sampleBuf)-1] + + var m collectorMetric + if d.Kind == metrics.KindFloat64Histogram { + _, hasSum := opt.RuntimeMetricSumForHist[d.Name] + unit := d.Name[strings.IndexRune(d.Name, ':')+1:] + m = newBatchHistogram( + NewDesc( + BuildFQName(namespace, subsystem, name), + help, + nil, + nil, + ), + internal.RuntimeMetricsBucketsForUnit(bucketsMap[d.Name], unit), + hasSum, + ) + } else if d.Cumulative { + m = NewCounter(CounterOpts{ + Namespace: namespace, + Subsystem: subsystem, + Name: name, + Help: help, + }, + ) + } else { + m = NewGauge(GaugeOpts{ + Namespace: namespace, + Subsystem: subsystem, + Name: name, + Help: help, + }) + } + metricSet = append(metricSet, m) + } + + // Add exact sum metrics to sampleBuf if not added before. + for _, h := range histograms { + sumMetric, ok := opt.RuntimeMetricSumForHist[h.Name] + if !ok { + continue + } + + if _, ok := sampleMap[sumMetric]; ok { + continue + } + sampleBuf = append(sampleBuf, metrics.Sample{Name: sumMetric}) + sampleMap[sumMetric] = &sampleBuf[len(sampleBuf)-1] + } + + var ( + msMetrics memStatsMetrics + msDescriptions []metrics.Description + ) + + if !opt.DisableMemStatsLikeMetrics { + msMetrics = goRuntimeMemStats() + msDescriptions = bestEffortLookupRM(rmNamesForMemStatsMetrics) + + // Check if metric was not exposed before and if not, add to sampleBuf. + for _, mdDesc := range msDescriptions { + if _, ok := sampleMap[mdDesc.Name]; ok { + continue + } + sampleBuf = append(sampleBuf, metrics.Sample{Name: mdDesc.Name}) + sampleMap[mdDesc.Name] = &sampleBuf[len(sampleBuf)-1] + } + } + + return &goCollector{ + base: newBaseGoCollector(), + sampleBuf: sampleBuf, + sampleMap: sampleMap, + rmExposedMetrics: metricSet, + rmExactSumMapForHist: opt.RuntimeMetricSumForHist, + msMetrics: msMetrics, + msMetricsEnabled: !opt.DisableMemStatsLikeMetrics, + } +} + +func attachOriginalName(desc, origName string) string { + return fmt.Sprintf("%s Sourced from %s", desc, origName) +} + +// Describe returns all descriptions of the collector. +func (c *goCollector) Describe(ch chan<- *Desc) { + c.base.Describe(ch) + for _, i := range c.msMetrics { + ch <- i.desc + } + for _, m := range c.rmExposedMetrics { + ch <- m.Desc() + } +} + +// Collect returns the current state of all metrics of the collector. +func (c *goCollector) Collect(ch chan<- Metric) { + // Collect base non-memory metrics. + c.base.Collect(ch) + + if len(c.sampleBuf) == 0 { + return + } + + // Collect must be thread-safe, so prevent concurrent use of + // sampleBuf elements. Just read into sampleBuf but write all the data + // we get into our Metrics or MemStats. + // + // This lock also ensures that the Metrics we send out are all from + // the same updates, ensuring their mutual consistency insofar as + // is guaranteed by the runtime/metrics package. + // + // N.B. This locking is heavy-handed, but Collect is expected to be called + // relatively infrequently. Also the core operation here, metrics.Read, + // is fast (O(tens of microseconds)) so contention should certainly be + // low, though channel operations and any allocations may add to that. + c.mu.Lock() + defer c.mu.Unlock() + + // Populate runtime/metrics sample buffer. + metrics.Read(c.sampleBuf) + + // Collect all our runtime/metrics user chose to expose from sampleBuf (if any). + for i, metric := range c.rmExposedMetrics { + // We created samples for exposed metrics first in order, so indexes match. + sample := c.sampleBuf[i] + + // N.B. switch on concrete type because it's significantly more efficient + // than checking for the Counter and Gauge interface implementations. In + // this case, we control all the types here. + switch m := metric.(type) { + case *counter: + // Guard against decreases. This should never happen, but a failure + // to do so will result in a panic, which is a harsh consequence for + // a metrics collection bug. + v0, v1 := m.get(), unwrapScalarRMValue(sample.Value) + if v1 > v0 { + m.Add(unwrapScalarRMValue(sample.Value) - m.get()) + } + m.Collect(ch) + case *gauge: + m.Set(unwrapScalarRMValue(sample.Value)) + m.Collect(ch) + case *batchHistogram: + m.update(sample.Value.Float64Histogram(), c.exactSumFor(sample.Name)) + m.Collect(ch) + default: + panic("unexpected metric type") + } + } + + if c.msMetricsEnabled { + // ms is a dummy MemStats that we populate ourselves so that we can + // populate the old metrics from it if goMemStatsCollection is enabled. + var ms runtime.MemStats + memStatsFromRM(&ms, c.sampleMap) + for _, i := range c.msMetrics { + ch <- MustNewConstMetric(i.desc, i.valType, i.eval(&ms)) + } + } +} + +// unwrapScalarRMValue unwraps a runtime/metrics value that is assumed +// to be scalar and returns the equivalent float64 value. Panics if the +// value is not scalar. +func unwrapScalarRMValue(v metrics.Value) float64 { + switch v.Kind() { + case metrics.KindUint64: + return float64(v.Uint64()) + case metrics.KindFloat64: + return v.Float64() + case metrics.KindBad: + // Unsupported metric. + // + // This should never happen because we always populate our metric + // set from the runtime/metrics package. + panic("unexpected bad kind metric") + default: + // Unsupported metric kind. + // + // This should never happen because we check for this during initialization + // and flag and filter metrics whose kinds we don't understand. + panic(fmt.Sprintf("unexpected unsupported metric: %v", v.Kind())) + } +} + +// exactSumFor takes a runtime/metrics metric name (that is assumed to +// be of kind KindFloat64Histogram) and returns its exact sum and whether +// its exact sum exists. +// +// The runtime/metrics API for histograms doesn't currently expose exact +// sums, but some of the other metrics are in fact exact sums of histograms. +func (c *goCollector) exactSumFor(rmName string) float64 { + sumName, ok := c.rmExactSumMapForHist[rmName] + if !ok { + return 0 + } + s, ok := c.sampleMap[sumName] + if !ok { + return 0 + } + return unwrapScalarRMValue(s.Value) +} + +func memStatsFromRM(ms *runtime.MemStats, rm map[string]*metrics.Sample) { + lookupOrZero := func(name string) uint64 { + if s, ok := rm[name]; ok { + return s.Value.Uint64() + } + return 0 + } + + // Currently, MemStats adds tiny alloc count to both Mallocs AND Frees. + // The reason for this is because MemStats couldn't be extended at the time + // but there was a desire to have Mallocs at least be a little more representative, + // while having Mallocs - Frees still represent a live object count. + // Unfortunately, MemStats doesn't actually export a large allocation count, + // so it's impossible to pull this number out directly. + tinyAllocs := lookupOrZero(goGCHeapTinyAllocsObjects) + ms.Mallocs = lookupOrZero(goGCHeapAllocsObjects) + tinyAllocs + ms.Frees = lookupOrZero(goGCHeapFreesObjects) + tinyAllocs + + ms.TotalAlloc = lookupOrZero(goGCHeapAllocsBytes) + ms.Sys = lookupOrZero(goMemoryClassesTotalBytes) + ms.Lookups = 0 // Already always zero. + ms.HeapAlloc = lookupOrZero(goMemoryClassesHeapObjectsBytes) + ms.Alloc = ms.HeapAlloc + ms.HeapInuse = ms.HeapAlloc + lookupOrZero(goMemoryClassesHeapUnusedBytes) + ms.HeapReleased = lookupOrZero(goMemoryClassesHeapReleasedBytes) + ms.HeapIdle = ms.HeapReleased + lookupOrZero(goMemoryClassesHeapFreeBytes) + ms.HeapSys = ms.HeapInuse + ms.HeapIdle + ms.HeapObjects = lookupOrZero(goGCHeapObjects) + ms.StackInuse = lookupOrZero(goMemoryClassesHeapStacksBytes) + ms.StackSys = ms.StackInuse + lookupOrZero(goMemoryClassesOSStacksBytes) + ms.MSpanInuse = lookupOrZero(goMemoryClassesMetadataMSpanInuseBytes) + ms.MSpanSys = ms.MSpanInuse + lookupOrZero(goMemoryClassesMetadataMSPanFreeBytes) + ms.MCacheInuse = lookupOrZero(goMemoryClassesMetadataMCacheInuseBytes) + ms.MCacheSys = ms.MCacheInuse + lookupOrZero(goMemoryClassesMetadataMCacheFreeBytes) + ms.BuckHashSys = lookupOrZero(goMemoryClassesProfilingBucketsBytes) + ms.GCSys = lookupOrZero(goMemoryClassesMetadataOtherBytes) + ms.OtherSys = lookupOrZero(goMemoryClassesOtherBytes) + ms.NextGC = lookupOrZero(goGCHeapGoalBytes) + + // N.B. GCCPUFraction is intentionally omitted. This metric is not useful, + // and often misleading due to the fact that it's an average over the lifetime + // of the process. + // See https://github.com/prometheus/client_golang/issues/842#issuecomment-861812034 + // for more details. + ms.GCCPUFraction = 0 +} + +// batchHistogram is a mutable histogram that is updated +// in batches. +type batchHistogram struct { + selfCollector + + // Static fields updated only once. + desc *Desc + hasSum bool + + // Because this histogram operates in batches, it just uses a + // single mutex for everything. updates are always serialized + // but Write calls may operate concurrently with updates. + // Contention between these two sources should be rare. + mu sync.Mutex + buckets []float64 // Inclusive lower bounds, like runtime/metrics. + counts []uint64 + sum float64 // Used if hasSum is true. +} + +// newBatchHistogram creates a new batch histogram value with the given +// Desc, buckets, and whether or not it has an exact sum available. +// +// buckets must always be from the runtime/metrics package, following +// the same conventions. +func newBatchHistogram(desc *Desc, buckets []float64, hasSum bool) *batchHistogram { + // We need to remove -Inf values. runtime/metrics keeps them around. + // But -Inf bucket should not be allowed for prometheus histograms. + if buckets[0] == math.Inf(-1) { + buckets = buckets[1:] + } + h := &batchHistogram{ + desc: desc, + buckets: buckets, + // Because buckets follows runtime/metrics conventions, there's + // 1 more value in the buckets list than there are buckets represented, + // because in runtime/metrics, the bucket values represent *boundaries*, + // and non-Inf boundaries are inclusive lower bounds for that bucket. + counts: make([]uint64, len(buckets)-1), + hasSum: hasSum, + } + h.init(h) + return h +} + +// update updates the batchHistogram from a runtime/metrics histogram. +// +// sum must be provided if the batchHistogram was created to have an exact sum. +// h.buckets must be a strict subset of his.Buckets. +func (h *batchHistogram) update(his *metrics.Float64Histogram, sum float64) { + counts, buckets := his.Counts, his.Buckets + + h.mu.Lock() + defer h.mu.Unlock() + + // Clear buckets. + for i := range h.counts { + h.counts[i] = 0 + } + // Copy and reduce buckets. + var j int + for i, count := range counts { + h.counts[j] += count + if buckets[i+1] == h.buckets[j+1] { + j++ + } + } + if h.hasSum { + h.sum = sum + } +} + +func (h *batchHistogram) Desc() *Desc { + return h.desc +} + +func (h *batchHistogram) Write(out *dto.Metric) error { + h.mu.Lock() + defer h.mu.Unlock() + + sum := float64(0) + if h.hasSum { + sum = h.sum + } + dtoBuckets := make([]*dto.Bucket, 0, len(h.counts)) + totalCount := uint64(0) + for i, count := range h.counts { + totalCount += count + if !h.hasSum { + if count != 0 { + // N.B. This computed sum is an underestimate. + sum += h.buckets[i] * float64(count) + } + } + + // Skip the +Inf bucket, but only for the bucket list. + // It must still count for sum and totalCount. + if math.IsInf(h.buckets[i+1], 1) { + break + } + // Float64Histogram's upper bound is exclusive, so make it inclusive + // by obtaining the next float64 value down, in order. + upperBound := math.Nextafter(h.buckets[i+1], h.buckets[i]) + dtoBuckets = append(dtoBuckets, &dto.Bucket{ + CumulativeCount: proto.Uint64(totalCount), + UpperBound: proto.Float64(upperBound), + }) + } + out.Histogram = &dto.Histogram{ + Bucket: dtoBuckets, + SampleCount: proto.Uint64(totalCount), + SampleSum: proto.Float64(sum), + } + return nil +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go index 8425640b39..8d35f2d8ae 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go @@ -22,25 +22,222 @@ import ( "sync/atomic" "time" - //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/golang/protobuf/proto" - dto "github.com/prometheus/client_model/go" + + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) +// nativeHistogramBounds for the frac of observed values. Only relevant for +// schema > 0. The position in the slice is the schema. (0 is never used, just +// here for convenience of using the schema directly as the index.) +// +// TODO(beorn7): Currently, we do a binary search into these slices. There are +// ways to turn it into a small number of simple array lookups. It probably only +// matters for schema 5 and beyond, but should be investigated. See this comment +// as a starting point: +// https://github.com/open-telemetry/opentelemetry-specification/issues/1776#issuecomment-870164310 +var nativeHistogramBounds = [][]float64{ + // Schema "0": + {0.5}, + // Schema 1: + {0.5, 0.7071067811865475}, + // Schema 2: + {0.5, 0.5946035575013605, 0.7071067811865475, 0.8408964152537144}, + // Schema 3: + { + 0.5, 0.5452538663326288, 0.5946035575013605, 0.6484197773255048, + 0.7071067811865475, 0.7711054127039704, 0.8408964152537144, 0.9170040432046711, + }, + // Schema 4: + { + 0.5, 0.5221368912137069, 0.5452538663326288, 0.5693943173783458, + 0.5946035575013605, 0.620928906036742, 0.6484197773255048, 0.6771277734684463, + 0.7071067811865475, 0.7384130729697496, 0.7711054127039704, 0.805245165974627, + 0.8408964152537144, 0.8781260801866495, 0.9170040432046711, 0.9576032806985735, + }, + // Schema 5: + { + 0.5, 0.5109485743270583, 0.5221368912137069, 0.5335702003384117, + 0.5452538663326288, 0.5571933712979462, 0.5693943173783458, 0.5818624293887887, + 0.5946035575013605, 0.6076236799902344, 0.620928906036742, 0.6345254785958666, + 0.6484197773255048, 0.6626183215798706, 0.6771277734684463, 0.6919549409819159, + 0.7071067811865475, 0.7225904034885232, 0.7384130729697496, 0.7545822137967112, + 0.7711054127039704, 0.7879904225539431, 0.805245165974627, 0.8228777390769823, + 0.8408964152537144, 0.8593096490612387, 0.8781260801866495, 0.8973545375015533, + 0.9170040432046711, 0.9370838170551498, 0.9576032806985735, 0.9785720620876999, + }, + // Schema 6: + { + 0.5, 0.5054446430258502, 0.5109485743270583, 0.5165124395106142, + 0.5221368912137069, 0.5278225891802786, 0.5335702003384117, 0.5393803988785598, + 0.5452538663326288, 0.5511912916539204, 0.5571933712979462, 0.5632608093041209, + 0.5693943173783458, 0.5755946149764913, 0.5818624293887887, 0.5881984958251406, + 0.5946035575013605, 0.6010783657263515, 0.6076236799902344, 0.6142402680534349, + 0.620928906036742, 0.6276903785123455, 0.6345254785958666, 0.6414350080393891, + 0.6484197773255048, 0.6554806057623822, 0.6626183215798706, 0.6698337620266515, + 0.6771277734684463, 0.6845012114872953, 0.6919549409819159, 0.6994898362691555, + 0.7071067811865475, 0.7148066691959849, 0.7225904034885232, 0.7304588970903234, + 0.7384130729697496, 0.7464538641456323, 0.7545822137967112, 0.762799075372269, + 0.7711054127039704, 0.7795022001189185, 0.7879904225539431, 0.7965710756711334, + 0.805245165974627, 0.8140137109286738, 0.8228777390769823, 0.8318382901633681, + 0.8408964152537144, 0.8500531768592616, 0.8593096490612387, 0.8686669176368529, + 0.8781260801866495, 0.8876882462632604, 0.8973545375015533, 0.9071260877501991, + 0.9170040432046711, 0.9269895625416926, 0.9370838170551498, 0.9472879907934827, + 0.9576032806985735, 0.9680308967461471, 0.9785720620876999, 0.9892280131939752, + }, + // Schema 7: + { + 0.5, 0.5027149505564014, 0.5054446430258502, 0.5081891574554764, + 0.5109485743270583, 0.5137229745593818, 0.5165124395106142, 0.5193170509806894, + 0.5221368912137069, 0.5249720429003435, 0.5278225891802786, 0.5306886136446309, + 0.5335702003384117, 0.5364674337629877, 0.5393803988785598, 0.5423091811066545, + 0.5452538663326288, 0.5482145409081883, 0.5511912916539204, 0.5541842058618393, + 0.5571933712979462, 0.5602188762048033, 0.5632608093041209, 0.5663192597993595, + 0.5693943173783458, 0.572486072215902, 0.5755946149764913, 0.5787200368168754, + 0.5818624293887887, 0.585021884841625, 0.5881984958251406, 0.5913923554921704, + 0.5946035575013605, 0.5978321960199137, 0.6010783657263515, 0.6043421618132907, + 0.6076236799902344, 0.6109230164863786, 0.6142402680534349, 0.6175755319684665, + 0.620928906036742, 0.6243004885946023, 0.6276903785123455, 0.6310986751971253, + 0.6345254785958666, 0.637970889198196, 0.6414350080393891, 0.6449179367033329, + 0.6484197773255048, 0.6519406325959679, 0.6554806057623822, 0.659039800633032, + 0.6626183215798706, 0.6662162735415805, 0.6698337620266515, 0.6734708931164728, + 0.6771277734684463, 0.6808045103191123, 0.6845012114872953, 0.688217985377265, + 0.6919549409819159, 0.6957121878859629, 0.6994898362691555, 0.7032879969095076, + 0.7071067811865475, 0.7109463010845827, 0.7148066691959849, 0.718687998724491, + 0.7225904034885232, 0.7265139979245261, 0.7304588970903234, 0.7344252166684908, + 0.7384130729697496, 0.7424225829363761, 0.7464538641456323, 0.7505070348132126, + 0.7545822137967112, 0.7586795205991071, 0.762799075372269, 0.7669409989204777, + 0.7711054127039704, 0.7752924388424999, 0.7795022001189185, 0.7837348199827764, + 0.7879904225539431, 0.7922691326262467, 0.7965710756711334, 0.8008963778413465, + 0.805245165974627, 0.8096175675974316, 0.8140137109286738, 0.8184337248834821, + 0.8228777390769823, 0.8273458838280969, 0.8318382901633681, 0.8363550898207981, + 0.8408964152537144, 0.8454623996346523, 0.8500531768592616, 0.8546688815502312, + 0.8593096490612387, 0.8639756154809185, 0.8686669176368529, 0.8733836930995842, + 0.8781260801866495, 0.8828942179666361, 0.8876882462632604, 0.8925083056594671, + 0.8973545375015533, 0.9022270839033115, 0.9071260877501991, 0.9120516927035263, + 0.9170040432046711, 0.9219832844793128, 0.9269895625416926, 0.9320230241988943, + 0.9370838170551498, 0.9421720895161669, 0.9472879907934827, 0.9524316709088368, + 0.9576032806985735, 0.9628029718180622, 0.9680308967461471, 0.9732872087896164, + 0.9785720620876999, 0.9838856116165875, 0.9892280131939752, 0.9945994234836328, + }, + // Schema 8: + { + 0.5, 0.5013556375251013, 0.5027149505564014, 0.5040779490592088, + 0.5054446430258502, 0.5068150424757447, 0.5081891574554764, 0.509566998038869, + 0.5109485743270583, 0.5123338964485679, 0.5137229745593818, 0.5151158188430205, + 0.5165124395106142, 0.5179128468009786, 0.5193170509806894, 0.520725062344158, + 0.5221368912137069, 0.5235525479396449, 0.5249720429003435, 0.526395386502313, + 0.5278225891802786, 0.5292536613972564, 0.5306886136446309, 0.5321274564422321, + 0.5335702003384117, 0.5350168559101208, 0.5364674337629877, 0.5379219445313954, + 0.5393803988785598, 0.5408428074966075, 0.5423091811066545, 0.5437795304588847, + 0.5452538663326288, 0.5467321995364429, 0.5482145409081883, 0.549700901315111, + 0.5511912916539204, 0.5526857228508706, 0.5541842058618393, 0.5556867516724088, + 0.5571933712979462, 0.5587040757836845, 0.5602188762048033, 0.5617377836665098, + 0.5632608093041209, 0.564787964283144, 0.5663192597993595, 0.5678547070789026, + 0.5693943173783458, 0.5709381019847808, 0.572486072215902, 0.5740382394200894, + 0.5755946149764913, 0.5771552102951081, 0.5787200368168754, 0.5802891060137493, + 0.5818624293887887, 0.5834400184762408, 0.585021884841625, 0.5866080400818185, + 0.5881984958251406, 0.5897932637314379, 0.5913923554921704, 0.5929957828304968, + 0.5946035575013605, 0.5962156912915756, 0.5978321960199137, 0.5994530835371903, + 0.6010783657263515, 0.6027080545025619, 0.6043421618132907, 0.6059806996384005, + 0.6076236799902344, 0.6092711149137041, 0.6109230164863786, 0.6125793968185725, + 0.6142402680534349, 0.6159056423670379, 0.6175755319684665, 0.6192499490999082, + 0.620928906036742, 0.622612415087629, 0.6243004885946023, 0.6259931389331581, + 0.6276903785123455, 0.6293922197748583, 0.6310986751971253, 0.6328097572894031, + 0.6345254785958666, 0.6362458516947014, 0.637970889198196, 0.6397006037528346, + 0.6414350080393891, 0.6431741147730128, 0.6449179367033329, 0.6466664866145447, + 0.6484197773255048, 0.6501778216898253, 0.6519406325959679, 0.6537082229673385, + 0.6554806057623822, 0.6572577939746774, 0.659039800633032, 0.6608266388015788, + 0.6626183215798706, 0.6644148621029772, 0.6662162735415805, 0.6680225691020727, + 0.6698337620266515, 0.6716498655934177, 0.6734708931164728, 0.6752968579460171, + 0.6771277734684463, 0.6789636531064505, 0.6808045103191123, 0.6826503586020058, + 0.6845012114872953, 0.6863570825438342, 0.688217985377265, 0.690083933630119, + 0.6919549409819159, 0.6938310211492645, 0.6957121878859629, 0.6975984549830999, + 0.6994898362691555, 0.7013863456101023, 0.7032879969095076, 0.7051948041086352, + 0.7071067811865475, 0.7090239421602076, 0.7109463010845827, 0.7128738720527471, + 0.7148066691959849, 0.7167447066838943, 0.718687998724491, 0.7206365595643126, + 0.7225904034885232, 0.7245495448210174, 0.7265139979245261, 0.7284837772007218, + 0.7304588970903234, 0.7324393720732029, 0.7344252166684908, 0.7364164454346837, + 0.7384130729697496, 0.7404151139112358, 0.7424225829363761, 0.7444354947621984, + 0.7464538641456323, 0.7484777058836176, 0.7505070348132126, 0.7525418658117031, + 0.7545822137967112, 0.7566280937263048, 0.7586795205991071, 0.7607365094544071, + 0.762799075372269, 0.7648672334736434, 0.7669409989204777, 0.7690203869158282, + 0.7711054127039704, 0.7731960915705107, 0.7752924388424999, 0.7773944698885442, + 0.7795022001189185, 0.7816156449856788, 0.7837348199827764, 0.7858597406461707, + 0.7879904225539431, 0.7901268813264122, 0.7922691326262467, 0.7944171921585818, + 0.7965710756711334, 0.7987307989543135, 0.8008963778413465, 0.8030678282083853, + 0.805245165974627, 0.8074284071024302, 0.8096175675974316, 0.8118126635086642, + 0.8140137109286738, 0.8162207259936375, 0.8184337248834821, 0.820652723822003, + 0.8228777390769823, 0.8251087869603088, 0.8273458838280969, 0.8295890460808079, + 0.8318382901633681, 0.8340936325652911, 0.8363550898207981, 0.8386226785089391, + 0.8408964152537144, 0.8431763167241966, 0.8454623996346523, 0.8477546807446661, + 0.8500531768592616, 0.8523579048290255, 0.8546688815502312, 0.8569861239649629, + 0.8593096490612387, 0.8616394738731368, 0.8639756154809185, 0.8663180910111553, + 0.8686669176368529, 0.871022112577578, 0.8733836930995842, 0.8757516765159389, + 0.8781260801866495, 0.8805069215187917, 0.8828942179666361, 0.8852879870317771, + 0.8876882462632604, 0.890095013257712, 0.8925083056594671, 0.8949281411607002, + 0.8973545375015533, 0.8997875124702672, 0.9022270839033115, 0.9046732696855155, + 0.9071260877501991, 0.909585556079304, 0.9120516927035263, 0.9145245157024483, + 0.9170040432046711, 0.9194902933879467, 0.9219832844793128, 0.9244830347552253, + 0.9269895625416926, 0.92950288621441, 0.9320230241988943, 0.9345499949706191, + 0.9370838170551498, 0.93962450902828, 0.9421720895161669, 0.9447265771954693, + 0.9472879907934827, 0.9498563490882775, 0.9524316709088368, 0.9550139751351947, + 0.9576032806985735, 0.9601996065815236, 0.9628029718180622, 0.9654133954938133, + 0.9680308967461471, 0.9706554947643201, 0.9732872087896164, 0.9759260581154889, + 0.9785720620876999, 0.9812252401044634, 0.9838856116165875, 0.9865531961276168, + 0.9892280131939752, 0.9919100824251095, 0.9945994234836328, 0.9972960560854698, + }, +} + +// The nativeHistogramBounds above can be generated with the code below. +// +// TODO(beorn7): It's tempting to actually use `go generate` to generate the +// code above. However, this could lead to slightly different numbers on +// different architectures. We still need to come to terms if we are fine with +// that, or if we might prefer to specify precise numbers in the standard. +// +// var nativeHistogramBounds [][]float64 = make([][]float64, 9) +// +// func init() { +// // Populate nativeHistogramBounds. +// numBuckets := 1 +// for i := range nativeHistogramBounds { +// bounds := []float64{0.5} +// factor := math.Exp2(math.Exp2(float64(-i))) +// for j := 0; j < numBuckets-1; j++ { +// var bound float64 +// if (j+1)%2 == 0 { +// // Use previously calculated value for increased precision. +// bound = nativeHistogramBounds[i-1][j/2+1] +// } else { +// bound = bounds[j] * factor +// } +// bounds = append(bounds, bound) +// } +// numBuckets *= 2 +// nativeHistogramBounds[i] = bounds +// } +// } + // A Histogram counts individual observations from an event or sample stream in -// configurable buckets. Similar to a summary, it also provides a sum of -// observations and an observation count. +// configurable static buckets (or in dynamic sparse buckets as part of the +// experimental Native Histograms, see below for more details). Similar to a +// Summary, it also provides a sum of observations and an observation count. // // On the Prometheus server, quantiles can be calculated from a Histogram using -// the histogram_quantile function in the query language. +// the histogram_quantile PromQL function. // -// Note that Histograms, in contrast to Summaries, can be aggregated with the -// Prometheus query language (see the documentation for detailed -// procedures). However, Histograms require the user to pre-define suitable -// buckets, and they are in general less accurate. The Observe method of a -// Histogram has a very low performance overhead in comparison with the Observe -// method of a Summary. +// Note that Histograms, in contrast to Summaries, can be aggregated in PromQL +// (see the documentation for detailed procedures). However, Histograms require +// the user to pre-define suitable buckets, and they are in general less +// accurate. (Both problems are addressed by the experimental Native +// Histograms. To use them, configure a NativeHistogramBucketFactor in the +// HistogramOpts. They also require a Prometheus server v2.40+ with the +// corresponding feature flag enabled.) +// +// The Observe method of a Histogram has a very low performance overhead in +// comparison with the Observe method of a Summary. // // To create Histogram instances, use NewHistogram. type Histogram interface { @@ -50,7 +247,8 @@ type Histogram interface { // Observe adds a single observation to the histogram. Observations are // usually positive or zero. Negative observations are accepted but // prevent current versions of Prometheus from properly detecting - // counter resets in the sum of observations. See + // counter resets in the sum of observations. (The experimental Native + // Histograms handle negative observations properly.) See // https://prometheus.io/docs/practices/histograms/#count-and-sum-of-observations // for details. Observe(float64) @@ -64,18 +262,28 @@ const bucketLabel = "le" // tailored to broadly measure the response time (in seconds) of a network // service. Most likely, however, you will be required to define buckets // customized to your use case. -var ( - DefBuckets = []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10} +var DefBuckets = []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10} - errBucketLabelNotAllowed = fmt.Errorf( - "%q is not allowed as label name in histograms", bucketLabel, - ) +// DefNativeHistogramZeroThreshold is the default value for +// NativeHistogramZeroThreshold in the HistogramOpts. +// +// The value is 2^-128 (or 0.5*2^-127 in the actual IEEE 754 representation), +// which is a bucket boundary at all possible resolutions. +const DefNativeHistogramZeroThreshold = 2.938735877055719e-39 + +// NativeHistogramZeroThresholdZero can be used as NativeHistogramZeroThreshold +// in the HistogramOpts to create a zero bucket of width zero, i.e. a zero +// bucket that only receives observations of precisely zero. +const NativeHistogramZeroThresholdZero = -1 + +var errBucketLabelNotAllowed = fmt.Errorf( + "%q is not allowed as label name in histograms", bucketLabel, ) -// LinearBuckets creates 'count' buckets, each 'width' wide, where the lowest -// bucket has an upper bound of 'start'. The final +Inf bucket is not counted -// and not included in the returned slice. The returned slice is meant to be -// used for the Buckets field of HistogramOpts. +// LinearBuckets creates 'count' regular buckets, each 'width' wide, where the +// lowest bucket has an upper bound of 'start'. The final +Inf bucket is not +// counted and not included in the returned slice. The returned slice is meant +// to be used for the Buckets field of HistogramOpts. // // The function panics if 'count' is zero or negative. func LinearBuckets(start, width float64, count int) []float64 { @@ -90,11 +298,11 @@ func LinearBuckets(start, width float64, count int) []float64 { return buckets } -// ExponentialBuckets creates 'count' buckets, where the lowest bucket has an -// upper bound of 'start' and each following bucket's upper bound is 'factor' -// times the previous bucket's upper bound. The final +Inf bucket is not counted -// and not included in the returned slice. The returned slice is meant to be -// used for the Buckets field of HistogramOpts. +// ExponentialBuckets creates 'count' regular buckets, where the lowest bucket +// has an upper bound of 'start' and each following bucket's upper bound is +// 'factor' times the previous bucket's upper bound. The final +Inf bucket is +// not counted and not included in the returned slice. The returned slice is +// meant to be used for the Buckets field of HistogramOpts. // // The function panics if 'count' is 0 or negative, if 'start' is 0 or negative, // or if 'factor' is less than or equal 1. @@ -116,6 +324,34 @@ func ExponentialBuckets(start, factor float64, count int) []float64 { return buckets } +// ExponentialBucketsRange creates 'count' buckets, where the lowest bucket is +// 'min' and the highest bucket is 'max'. The final +Inf bucket is not counted +// and not included in the returned slice. The returned slice is meant to be +// used for the Buckets field of HistogramOpts. +// +// The function panics if 'count' is 0 or negative, if 'min' is 0 or negative. +func ExponentialBucketsRange(min, max float64, count int) []float64 { + if count < 1 { + panic("ExponentialBucketsRange count needs a positive count") + } + if min <= 0 { + panic("ExponentialBucketsRange min needs to be greater than 0") + } + + // Formula for exponential buckets. + // max = min*growthFactor^(bucketCount-1) + + // We know max/min and highest bucket. Solve for growthFactor. + growthFactor := math.Pow(max/min, 1.0/float64(count-1)) + + // Now that we know growthFactor, solve for each bucket. + buckets := make([]float64, count) + for i := 1; i <= count; i++ { + buckets[i-1] = min * math.Pow(growthFactor, float64(i-1)) + } + return buckets +} + // HistogramOpts bundles the options for creating a Histogram metric. It is // mandatory to set Name to a non-empty string. All other fields are optional // and can safely be left at their zero value, although it is strongly @@ -152,8 +388,124 @@ type HistogramOpts struct { // element in the slice is the upper inclusive bound of a bucket. The // values must be sorted in strictly increasing order. There is no need // to add a highest bucket with +Inf bound, it will be added - // implicitly. The default value is DefBuckets. + // implicitly. If Buckets is left as nil or set to a slice of length + // zero, it is replaced by default buckets. The default buckets are + // DefBuckets if no buckets for a native histogram (see below) are used, + // otherwise the default is no buckets. (In other words, if you want to + // use both regular buckets and buckets for a native histogram, you have + // to define the regular buckets here explicitly.) Buckets []float64 + + // If NativeHistogramBucketFactor is greater than one, so-called sparse + // buckets are used (in addition to the regular buckets, if defined + // above). A Histogram with sparse buckets will be ingested as a Native + // Histogram by a Prometheus server with that feature enabled (requires + // Prometheus v2.40+). Sparse buckets are exponential buckets covering + // the whole float64 range (with the exception of the “zero” bucket, see + // NativeHistogramZeroThreshold below). From any one bucket to the next, + // the width of the bucket grows by a constant + // factor. NativeHistogramBucketFactor provides an upper bound for this + // factor (exception see below). The smaller + // NativeHistogramBucketFactor, the more buckets will be used and thus + // the more costly the histogram will become. A generally good trade-off + // between cost and accuracy is a value of 1.1 (each bucket is at most + // 10% wider than the previous one), which will result in each power of + // two divided into 8 buckets (e.g. there will be 8 buckets between 1 + // and 2, same as between 2 and 4, and 4 and 8, etc.). + // + // Details about the actually used factor: The factor is calculated as + // 2^(2^-n), where n is an integer number between (and including) -4 and + // 8. n is chosen so that the resulting factor is the largest that is + // still smaller or equal to NativeHistogramBucketFactor. Note that the + // smallest possible factor is therefore approx. 1.00271 (i.e. 2^(2^-8) + // ). If NativeHistogramBucketFactor is greater than 1 but smaller than + // 2^(2^-8), then the actually used factor is still 2^(2^-8) even though + // it is larger than the provided NativeHistogramBucketFactor. + // + // NOTE: Native Histograms are still an experimental feature. Their + // behavior might still change without a major version + // bump. Subsequently, all NativeHistogram... options here might still + // change their behavior or name (or might completely disappear) without + // a major version bump. + NativeHistogramBucketFactor float64 + // All observations with an absolute value of less or equal + // NativeHistogramZeroThreshold are accumulated into a “zero” bucket. + // For best results, this should be close to a bucket boundary. This is + // usually the case if picking a power of two. If + // NativeHistogramZeroThreshold is left at zero, + // DefNativeHistogramZeroThreshold is used as the threshold. To + // configure a zero bucket with an actual threshold of zero (i.e. only + // observations of precisely zero will go into the zero bucket), set + // NativeHistogramZeroThreshold to the NativeHistogramZeroThresholdZero + // constant (or any negative float value). + NativeHistogramZeroThreshold float64 + + // The next three fields define a strategy to limit the number of + // populated sparse buckets. If NativeHistogramMaxBucketNumber is left + // at zero, the number of buckets is not limited. (Note that this might + // lead to unbounded memory consumption if the values observed by the + // Histogram are sufficiently wide-spread. In particular, this could be + // used as a DoS attack vector. Where the observed values depend on + // external inputs, it is highly recommended to set a + // NativeHistogramMaxBucketNumber.) Once the set + // NativeHistogramMaxBucketNumber is exceeded, the following strategy is + // enacted: + // - First, if the last reset (or the creation) of the histogram is at + // least NativeHistogramMinResetDuration ago, then the whole + // histogram is reset to its initial state (including regular + // buckets). + // - If less time has passed, or if NativeHistogramMinResetDuration is + // zero, no reset is performed. Instead, the zero threshold is + // increased sufficiently to reduce the number of buckets to or below + // NativeHistogramMaxBucketNumber, but not to more than + // NativeHistogramMaxZeroThreshold. Thus, if + // NativeHistogramMaxZeroThreshold is already at or below the current + // zero threshold, nothing happens at this step. + // - After that, if the number of buckets still exceeds + // NativeHistogramMaxBucketNumber, the resolution of the histogram is + // reduced by doubling the width of the sparse buckets (up to a + // growth factor between one bucket to the next of 2^(2^4) = 65536, + // see above). + // - Any increased zero threshold or reduced resolution is reset back + // to their original values once NativeHistogramMinResetDuration has + // passed (since the last reset or the creation of the histogram). + NativeHistogramMaxBucketNumber uint32 + NativeHistogramMinResetDuration time.Duration + NativeHistogramMaxZeroThreshold float64 + + // NativeHistogramMaxExemplars limits the number of exemplars + // that are kept in memory for each native histogram. If you leave it at + // zero, a default value of 10 is used. If no exemplars should be kept specifically + // for native histograms, set it to a negative value. (Scrapers can + // still use the exemplars exposed for classic buckets, which are managed + // independently.) + NativeHistogramMaxExemplars int + // NativeHistogramExemplarTTL is only checked once + // NativeHistogramMaxExemplars is exceeded. In that case, the + // oldest exemplar is removed if it is older than NativeHistogramExemplarTTL. + // Otherwise, the older exemplar in the pair of exemplars that are closest + // together (on an exponential scale) is removed. + // If NativeHistogramExemplarTTL is left at its zero value, a default value of + // 5m is used. To always delete the oldest exemplar, set it to a negative value. + NativeHistogramExemplarTTL time.Duration + + // now is for testing purposes, by default it's time.Now. + now func() time.Time + + // afterFunc is for testing purposes, by default it's time.AfterFunc. + afterFunc func(time.Duration, func()) *time.Timer +} + +// HistogramVecOpts bundles the options to create a HistogramVec metric. +// It is mandatory to set HistogramOpts, see there for mandatory fields. VariableLabels +// is optional and can safely be left to its default value. +type HistogramVecOpts struct { + HistogramOpts + + // VariableLabels are used to partition the metric vector by the given set + // of labels. Each label value will be constrained with the optional Constraint + // function, if provided. + VariableLabels ConstrainableLabels } // NewHistogram creates a new Histogram based on the provided HistogramOpts. It @@ -175,11 +527,11 @@ func NewHistogram(opts HistogramOpts) Histogram { } func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogram { - if len(desc.variableLabels) != len(labelValues) { - panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels, labelValues)) + if len(desc.variableLabels.names) != len(labelValues) { + panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.names, labelValues)) } - for _, n := range desc.variableLabels { + for _, n := range desc.variableLabels.names { if n == bucketLabel { panic(errBucketLabelNotAllowed) } @@ -190,16 +542,38 @@ func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogr } } - if len(opts.Buckets) == 0 { - opts.Buckets = DefBuckets + if opts.now == nil { + opts.now = time.Now + } + if opts.afterFunc == nil { + opts.afterFunc = time.AfterFunc } h := &histogram{ - desc: desc, - upperBounds: opts.Buckets, - labelPairs: MakeLabelPairs(desc, labelValues), - counts: [2]*histogramCounts{{}, {}}, - now: time.Now, + desc: desc, + upperBounds: opts.Buckets, + labelPairs: MakeLabelPairs(desc, labelValues), + nativeHistogramMaxBuckets: opts.NativeHistogramMaxBucketNumber, + nativeHistogramMaxZeroThreshold: opts.NativeHistogramMaxZeroThreshold, + nativeHistogramMinResetDuration: opts.NativeHistogramMinResetDuration, + lastResetTime: opts.now(), + now: opts.now, + afterFunc: opts.afterFunc, + } + if len(h.upperBounds) == 0 && opts.NativeHistogramBucketFactor <= 1 { + h.upperBounds = DefBuckets + } + if opts.NativeHistogramBucketFactor <= 1 { + h.nativeHistogramSchema = math.MinInt32 // To mark that there are no sparse buckets. + } else { + switch { + case opts.NativeHistogramZeroThreshold > 0: + h.nativeHistogramZeroThreshold = opts.NativeHistogramZeroThreshold + case opts.NativeHistogramZeroThreshold == 0: + h.nativeHistogramZeroThreshold = DefNativeHistogramZeroThreshold + } // Leave h.nativeHistogramZeroThreshold at 0 otherwise. + h.nativeHistogramSchema = pickSchema(opts.NativeHistogramBucketFactor) + h.nativeExemplars = makeNativeExemplars(opts.NativeHistogramExemplarTTL, opts.NativeHistogramMaxExemplars) } for i, upperBound := range h.upperBounds { if i < len(h.upperBounds)-1 { @@ -218,8 +592,12 @@ func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogr } // Finally we know the final length of h.upperBounds and can make buckets // for both counts as well as exemplars: - h.counts[0].buckets = make([]uint64, len(h.upperBounds)) - h.counts[1].buckets = make([]uint64, len(h.upperBounds)) + h.counts[0] = &histogramCounts{buckets: make([]uint64, len(h.upperBounds))} + atomic.StoreUint64(&h.counts[0].nativeHistogramZeroThresholdBits, math.Float64bits(h.nativeHistogramZeroThreshold)) + atomic.StoreInt32(&h.counts[0].nativeHistogramSchema, h.nativeHistogramSchema) + h.counts[1] = &histogramCounts{buckets: make([]uint64, len(h.upperBounds))} + atomic.StoreUint64(&h.counts[1].nativeHistogramZeroThresholdBits, math.Float64bits(h.nativeHistogramZeroThreshold)) + atomic.StoreInt32(&h.counts[1].nativeHistogramSchema, h.nativeHistogramSchema) h.exemplars = make([]atomic.Value, len(h.upperBounds)+1) h.init(h) // Init self-collection. @@ -227,13 +605,98 @@ func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogr } type histogramCounts struct { + // Order in this struct matters for the alignment required by atomic + // operations, see http://golang.org/pkg/sync/atomic/#pkg-note-BUG + // sumBits contains the bits of the float64 representing the sum of all - // observations. sumBits and count have to go first in the struct to - // guarantee alignment for atomic operations. - // http://golang.org/pkg/sync/atomic/#pkg-note-BUG + // observations. sumBits uint64 count uint64 + + // nativeHistogramZeroBucket counts all (positive and negative) + // observations in the zero bucket (with an absolute value less or equal + // the current threshold, see next field. + nativeHistogramZeroBucket uint64 + // nativeHistogramZeroThresholdBits is the bit pattern of the current + // threshold for the zero bucket. It's initially equal to + // nativeHistogramZeroThreshold but may change according to the bucket + // count limitation strategy. + nativeHistogramZeroThresholdBits uint64 + // nativeHistogramSchema may change over time according to the bucket + // count limitation strategy and therefore has to be saved here. + nativeHistogramSchema int32 + // Number of (positive and negative) sparse buckets. + nativeHistogramBucketsNumber uint32 + + // Regular buckets. buckets []uint64 + + // The sparse buckets for native histograms are implemented with a + // sync.Map for now. A dedicated data structure will likely be more + // efficient. There are separate maps for negative and positive + // observations. The map's value is an *int64, counting observations in + // that bucket. (Note that we don't use uint64 as an int64 won't + // overflow in practice, and working with signed numbers from the + // beginning simplifies the handling of deltas.) The map's key is the + // index of the bucket according to the used + // nativeHistogramSchema. Index 0 is for an upper bound of 1. + nativeHistogramBucketsPositive, nativeHistogramBucketsNegative sync.Map +} + +// observe manages the parts of observe that only affects +// histogramCounts. doSparse is true if sparse buckets should be done, +// too. +func (hc *histogramCounts) observe(v float64, bucket int, doSparse bool) { + if bucket < len(hc.buckets) { + atomic.AddUint64(&hc.buckets[bucket], 1) + } + atomicAddFloat(&hc.sumBits, v) + if doSparse && !math.IsNaN(v) { + var ( + key int + schema = atomic.LoadInt32(&hc.nativeHistogramSchema) + zeroThreshold = math.Float64frombits(atomic.LoadUint64(&hc.nativeHistogramZeroThresholdBits)) + bucketCreated, isInf bool + ) + if math.IsInf(v, 0) { + // Pretend v is MaxFloat64 but later increment key by one. + if math.IsInf(v, +1) { + v = math.MaxFloat64 + } else { + v = -math.MaxFloat64 + } + isInf = true + } + frac, exp := math.Frexp(math.Abs(v)) + if schema > 0 { + bounds := nativeHistogramBounds[schema] + key = sort.SearchFloat64s(bounds, frac) + (exp-1)*len(bounds) + } else { + key = exp + if frac == 0.5 { + key-- + } + offset := (1 << -schema) - 1 + key = (key + offset) >> -schema + } + if isInf { + key++ + } + switch { + case v > zeroThreshold: + bucketCreated = addToBucket(&hc.nativeHistogramBucketsPositive, key, 1) + case v < -zeroThreshold: + bucketCreated = addToBucket(&hc.nativeHistogramBucketsNegative, key, 1) + default: + atomic.AddUint64(&hc.nativeHistogramZeroBucket, 1) + } + if bucketCreated { + atomic.AddUint32(&hc.nativeHistogramBucketsNumber, 1) + } + } + // Increment count last as we take it as a signal that the observation + // is complete. + atomic.AddUint64(&hc.count, 1) } type histogram struct { @@ -248,7 +711,7 @@ type histogram struct { // perspective of the histogram) swap the hot–cold under the writeMtx // lock. A cooldown is awaited (while locked) by comparing the number of // observations with the initiation count. Once they match, then the - // last observation on the now cool one has completed. All cool fields must + // last observation on the now cool one has completed. All cold fields must // be merged into the new hot before releasing writeMtx. // // Fields with atomic access first! See alignment constraint: @@ -256,8 +719,10 @@ type histogram struct { countAndHotIdx uint64 selfCollector - desc *Desc - writeMtx sync.Mutex // Only used in the Write method. + desc *Desc + + // Only used in the Write method and for sparse bucket management. + mtx sync.Mutex // Two counts, one is "hot" for lock-free observations, the other is // "cold" for writing out a dto.Metric. It has to be an array of @@ -265,11 +730,27 @@ type histogram struct { // http://golang.org/pkg/sync/atomic/#pkg-note-BUG. counts [2]*histogramCounts - upperBounds []float64 - labelPairs []*dto.LabelPair - exemplars []atomic.Value // One more than buckets (to include +Inf), each a *dto.Exemplar. + upperBounds []float64 + labelPairs []*dto.LabelPair + exemplars []atomic.Value // One more than buckets (to include +Inf), each a *dto.Exemplar. + nativeHistogramSchema int32 // The initial schema. Set to math.MinInt32 if no sparse buckets are used. + nativeHistogramZeroThreshold float64 // The initial zero threshold. + nativeHistogramMaxZeroThreshold float64 + nativeHistogramMaxBuckets uint32 + nativeHistogramMinResetDuration time.Duration + // lastResetTime is protected by mtx. It is also used as created timestamp. + lastResetTime time.Time + // resetScheduled is protected by mtx. It is true if a reset is + // scheduled for a later time (when nativeHistogramMinResetDuration has + // passed). + resetScheduled bool + nativeExemplars nativeExemplars - now func() time.Time // To mock out time.Now() for testing. + // now is for testing purposes, by default it's time.Now. + now func() time.Time + + // afterFunc is for testing purposes, by default it's time.AfterFunc. + afterFunc func(time.Duration, func()) *time.Timer } func (h *histogram) Desc() *Desc { @@ -280,6 +761,9 @@ func (h *histogram) Observe(v float64) { h.observe(v, h.findBucket(v)) } +// ObserveWithExemplar should not be called in a high-frequency setting +// for a native histogram with configured exemplars. For this case, +// the implementation isn't lock-free and might suffer from lock contention. func (h *histogram) ObserveWithExemplar(v float64, e Labels) { i := h.findBucket(v) h.observe(v, i) @@ -291,8 +775,8 @@ func (h *histogram) Write(out *dto.Metric) error { // the hot path, i.e. Observe is called much more often than Write. The // complication of making Write lock-free isn't worth it, if possible at // all. - h.writeMtx.Lock() - defer h.writeMtx.Unlock() + h.mtx.Lock() + defer h.mtx.Unlock() // Adding 1<<63 switches the hot index (from 0 to 1 or from 1 to 0) // without touching the count bits. See the struct comments for a full @@ -305,16 +789,17 @@ func (h *histogram) Write(out *dto.Metric) error { hotCounts := h.counts[n>>63] coldCounts := h.counts[(^n)>>63] - // Await cooldown. - for count != atomic.LoadUint64(&coldCounts.count) { - runtime.Gosched() // Let observations get work done. - } + waitForCooldown(count, coldCounts) his := &dto.Histogram{ - Bucket: make([]*dto.Bucket, len(h.upperBounds)), - SampleCount: proto.Uint64(count), - SampleSum: proto.Float64(math.Float64frombits(atomic.LoadUint64(&coldCounts.sumBits))), + Bucket: make([]*dto.Bucket, len(h.upperBounds)), + SampleCount: proto.Uint64(count), + SampleSum: proto.Float64(math.Float64frombits(atomic.LoadUint64(&coldCounts.sumBits))), + CreatedTimestamp: timestamppb.New(h.lastResetTime), } + out.Histogram = his + out.Label = h.labelPairs + var cumCount uint64 for i, upperBound := range h.upperBounds { cumCount += atomic.LoadUint64(&coldCounts.buckets[i]) @@ -335,25 +820,40 @@ func (h *histogram) Write(out *dto.Metric) error { } his.Bucket = append(his.Bucket, b) } + if h.nativeHistogramSchema > math.MinInt32 { + his.ZeroThreshold = proto.Float64(math.Float64frombits(atomic.LoadUint64(&coldCounts.nativeHistogramZeroThresholdBits))) + his.Schema = proto.Int32(atomic.LoadInt32(&coldCounts.nativeHistogramSchema)) + zeroBucket := atomic.LoadUint64(&coldCounts.nativeHistogramZeroBucket) - out.Histogram = his - out.Label = h.labelPairs + defer func() { + coldCounts.nativeHistogramBucketsPositive.Range(addAndReset(&hotCounts.nativeHistogramBucketsPositive, &hotCounts.nativeHistogramBucketsNumber)) + coldCounts.nativeHistogramBucketsNegative.Range(addAndReset(&hotCounts.nativeHistogramBucketsNegative, &hotCounts.nativeHistogramBucketsNumber)) + }() - // Finally add all the cold counts to the new hot counts and reset the cold counts. - atomic.AddUint64(&hotCounts.count, count) - atomic.StoreUint64(&coldCounts.count, 0) - for { - oldBits := atomic.LoadUint64(&hotCounts.sumBits) - newBits := math.Float64bits(math.Float64frombits(oldBits) + his.GetSampleSum()) - if atomic.CompareAndSwapUint64(&hotCounts.sumBits, oldBits, newBits) { - atomic.StoreUint64(&coldCounts.sumBits, 0) - break + his.ZeroCount = proto.Uint64(zeroBucket) + his.NegativeSpan, his.NegativeDelta = makeBuckets(&coldCounts.nativeHistogramBucketsNegative) + his.PositiveSpan, his.PositiveDelta = makeBuckets(&coldCounts.nativeHistogramBucketsPositive) + + // Add a no-op span to a histogram without observations and with + // a zero threshold of zero. Otherwise, a native histogram would + // look like a classic histogram to scrapers. + if *his.ZeroThreshold == 0 && *his.ZeroCount == 0 && len(his.PositiveSpan) == 0 && len(his.NegativeSpan) == 0 { + his.PositiveSpan = []*dto.BucketSpan{{ + Offset: proto.Int32(0), + Length: proto.Uint32(0), + }} } + + // If exemplars are not configured, the cap will be 0. + // So append is not needed in this case. + if cap(h.nativeExemplars.exemplars) > 0 { + h.nativeExemplars.Lock() + his.Exemplars = append(his.Exemplars, h.nativeExemplars.exemplars...) + h.nativeExemplars.Unlock() + } + } - for i := range h.upperBounds { - atomic.AddUint64(&hotCounts.buckets[i], atomic.LoadUint64(&coldCounts.buckets[i])) - atomic.StoreUint64(&coldCounts.buckets[i], 0) - } + addAndResetCounts(hotCounts, coldCounts) return nil } @@ -374,29 +874,258 @@ func (h *histogram) findBucket(v float64) int { // observe is the implementation for Observe without the findBucket part. func (h *histogram) observe(v float64, bucket int) { + // Do not add to sparse buckets for NaN observations. + doSparse := h.nativeHistogramSchema > math.MinInt32 && !math.IsNaN(v) // We increment h.countAndHotIdx so that the counter in the lower // 63 bits gets incremented. At the same time, we get the new value // back, which we can use to find the currently-hot counts. n := atomic.AddUint64(&h.countAndHotIdx, 1) hotCounts := h.counts[n>>63] + hotCounts.observe(v, bucket, doSparse) + if doSparse { + h.limitBuckets(hotCounts, v, bucket) + } +} - if bucket < len(h.upperBounds) { - atomic.AddUint64(&hotCounts.buckets[bucket], 1) +// limitBuckets applies a strategy to limit the number of populated sparse +// buckets. It's generally best effort, and there are situations where the +// number can go higher (if even the lowest resolution isn't enough to reduce +// the number sufficiently, or if the provided counts aren't fully updated yet +// by a concurrently happening Write call). +func (h *histogram) limitBuckets(counts *histogramCounts, value float64, bucket int) { + if h.nativeHistogramMaxBuckets == 0 { + return // No limit configured. } - for { - oldBits := atomic.LoadUint64(&hotCounts.sumBits) - newBits := math.Float64bits(math.Float64frombits(oldBits) + v) - if atomic.CompareAndSwapUint64(&hotCounts.sumBits, oldBits, newBits) { - break + if h.nativeHistogramMaxBuckets >= atomic.LoadUint32(&counts.nativeHistogramBucketsNumber) { + return // Bucket limit not exceeded yet. + } + + h.mtx.Lock() + defer h.mtx.Unlock() + + // The hot counts might have been swapped just before we acquired the + // lock. Re-fetch the hot counts first... + n := atomic.LoadUint64(&h.countAndHotIdx) + hotIdx := n >> 63 + coldIdx := (^n) >> 63 + hotCounts := h.counts[hotIdx] + coldCounts := h.counts[coldIdx] + // ...and then check again if we really have to reduce the bucket count. + if h.nativeHistogramMaxBuckets >= atomic.LoadUint32(&hotCounts.nativeHistogramBucketsNumber) { + return // Bucket limit not exceeded after all. + } + // Try the various strategies in order. + if h.maybeReset(hotCounts, coldCounts, coldIdx, value, bucket) { + return + } + // One of the other strategies will happen. To undo what they will do as + // soon as enough time has passed to satisfy + // h.nativeHistogramMinResetDuration, schedule a reset at the right time + // if we haven't done so already. + if h.nativeHistogramMinResetDuration > 0 && !h.resetScheduled { + h.resetScheduled = true + h.afterFunc(h.nativeHistogramMinResetDuration-h.now().Sub(h.lastResetTime), h.reset) + } + + if h.maybeWidenZeroBucket(hotCounts, coldCounts) { + return + } + h.doubleBucketWidth(hotCounts, coldCounts) +} + +// maybeReset resets the whole histogram if at least +// h.nativeHistogramMinResetDuration has been passed. It returns true if the +// histogram has been reset. The caller must have locked h.mtx. +func (h *histogram) maybeReset( + hot, cold *histogramCounts, coldIdx uint64, value float64, bucket int, +) bool { + // We are using the possibly mocked h.now() rather than + // time.Since(h.lastResetTime) to enable testing. + if h.nativeHistogramMinResetDuration == 0 || // No reset configured. + h.resetScheduled || // Do not interefere if a reset is already scheduled. + h.now().Sub(h.lastResetTime) < h.nativeHistogramMinResetDuration { + return false + } + // Completely reset coldCounts. + h.resetCounts(cold) + // Repeat the latest observation to not lose it completely. + cold.observe(value, bucket, true) + // Make coldCounts the new hot counts while resetting countAndHotIdx. + n := atomic.SwapUint64(&h.countAndHotIdx, (coldIdx<<63)+1) + count := n & ((1 << 63) - 1) + waitForCooldown(count, hot) + // Finally, reset the formerly hot counts, too. + h.resetCounts(hot) + h.lastResetTime = h.now() + return true +} + +// reset resets the whole histogram. It locks h.mtx itself, i.e. it has to be +// called without having locked h.mtx. +func (h *histogram) reset() { + h.mtx.Lock() + defer h.mtx.Unlock() + + n := atomic.LoadUint64(&h.countAndHotIdx) + hotIdx := n >> 63 + coldIdx := (^n) >> 63 + hot := h.counts[hotIdx] + cold := h.counts[coldIdx] + // Completely reset coldCounts. + h.resetCounts(cold) + // Make coldCounts the new hot counts while resetting countAndHotIdx. + n = atomic.SwapUint64(&h.countAndHotIdx, coldIdx<<63) + count := n & ((1 << 63) - 1) + waitForCooldown(count, hot) + // Finally, reset the formerly hot counts, too. + h.resetCounts(hot) + h.lastResetTime = h.now() + h.resetScheduled = false +} + +// maybeWidenZeroBucket widens the zero bucket until it includes the existing +// buckets closest to the zero bucket (which could be two, if an equidistant +// negative and a positive bucket exists, but usually it's only one bucket to be +// merged into the new wider zero bucket). h.nativeHistogramMaxZeroThreshold +// limits how far the zero bucket can be extended, and if that's not enough to +// include an existing bucket, the method returns false. The caller must have +// locked h.mtx. +func (h *histogram) maybeWidenZeroBucket(hot, cold *histogramCounts) bool { + currentZeroThreshold := math.Float64frombits(atomic.LoadUint64(&hot.nativeHistogramZeroThresholdBits)) + if currentZeroThreshold >= h.nativeHistogramMaxZeroThreshold { + return false + } + // Find the key of the bucket closest to zero. + smallestKey := findSmallestKey(&hot.nativeHistogramBucketsPositive) + smallestNegativeKey := findSmallestKey(&hot.nativeHistogramBucketsNegative) + if smallestNegativeKey < smallestKey { + smallestKey = smallestNegativeKey + } + if smallestKey == math.MaxInt32 { + return false + } + newZeroThreshold := getLe(smallestKey, atomic.LoadInt32(&hot.nativeHistogramSchema)) + if newZeroThreshold > h.nativeHistogramMaxZeroThreshold { + return false // New threshold would exceed the max threshold. + } + atomic.StoreUint64(&cold.nativeHistogramZeroThresholdBits, math.Float64bits(newZeroThreshold)) + // Remove applicable buckets. + if _, loaded := cold.nativeHistogramBucketsNegative.LoadAndDelete(smallestKey); loaded { + atomicDecUint32(&cold.nativeHistogramBucketsNumber) + } + if _, loaded := cold.nativeHistogramBucketsPositive.LoadAndDelete(smallestKey); loaded { + atomicDecUint32(&cold.nativeHistogramBucketsNumber) + } + // Make cold counts the new hot counts. + n := atomic.AddUint64(&h.countAndHotIdx, 1<<63) + count := n & ((1 << 63) - 1) + // Swap the pointer names to represent the new roles and make + // the rest less confusing. + hot, cold = cold, hot + waitForCooldown(count, cold) + // Add all the now cold counts to the new hot counts... + addAndResetCounts(hot, cold) + // ...adjust the new zero threshold in the cold counts, too... + atomic.StoreUint64(&cold.nativeHistogramZeroThresholdBits, math.Float64bits(newZeroThreshold)) + // ...and then merge the newly deleted buckets into the wider zero + // bucket. + mergeAndDeleteOrAddAndReset := func(hotBuckets, coldBuckets *sync.Map) func(k, v interface{}) bool { + return func(k, v interface{}) bool { + key := k.(int) + bucket := v.(*int64) + if key == smallestKey { + // Merge into hot zero bucket... + atomic.AddUint64(&hot.nativeHistogramZeroBucket, uint64(atomic.LoadInt64(bucket))) + // ...and delete from cold counts. + coldBuckets.Delete(key) + atomicDecUint32(&cold.nativeHistogramBucketsNumber) + } else { + // Add to corresponding hot bucket... + if addToBucket(hotBuckets, key, atomic.LoadInt64(bucket)) { + atomic.AddUint32(&hot.nativeHistogramBucketsNumber, 1) + } + // ...and reset cold bucket. + atomic.StoreInt64(bucket, 0) + } + return true } } - // Increment count last as we take it as a signal that the observation - // is complete. - atomic.AddUint64(&hotCounts.count, 1) + + cold.nativeHistogramBucketsPositive.Range(mergeAndDeleteOrAddAndReset(&hot.nativeHistogramBucketsPositive, &cold.nativeHistogramBucketsPositive)) + cold.nativeHistogramBucketsNegative.Range(mergeAndDeleteOrAddAndReset(&hot.nativeHistogramBucketsNegative, &cold.nativeHistogramBucketsNegative)) + return true +} + +// doubleBucketWidth doubles the bucket width (by decrementing the schema +// number). Note that very sparse buckets could lead to a low reduction of the +// bucket count (or even no reduction at all). The method does nothing if the +// schema is already -4. +func (h *histogram) doubleBucketWidth(hot, cold *histogramCounts) { + coldSchema := atomic.LoadInt32(&cold.nativeHistogramSchema) + if coldSchema == -4 { + return // Already at lowest resolution. + } + coldSchema-- + atomic.StoreInt32(&cold.nativeHistogramSchema, coldSchema) + // Play it simple and just delete all cold buckets. + atomic.StoreUint32(&cold.nativeHistogramBucketsNumber, 0) + deleteSyncMap(&cold.nativeHistogramBucketsNegative) + deleteSyncMap(&cold.nativeHistogramBucketsPositive) + // Make coldCounts the new hot counts. + n := atomic.AddUint64(&h.countAndHotIdx, 1<<63) + count := n & ((1 << 63) - 1) + // Swap the pointer names to represent the new roles and make + // the rest less confusing. + hot, cold = cold, hot + waitForCooldown(count, cold) + // Add all the now cold counts to the new hot counts... + addAndResetCounts(hot, cold) + // ...adjust the schema in the cold counts, too... + atomic.StoreInt32(&cold.nativeHistogramSchema, coldSchema) + // ...and then merge the cold buckets into the wider hot buckets. + merge := func(hotBuckets *sync.Map) func(k, v interface{}) bool { + return func(k, v interface{}) bool { + key := k.(int) + bucket := v.(*int64) + // Adjust key to match the bucket to merge into. + if key > 0 { + key++ + } + key /= 2 + // Add to corresponding hot bucket. + if addToBucket(hotBuckets, key, atomic.LoadInt64(bucket)) { + atomic.AddUint32(&hot.nativeHistogramBucketsNumber, 1) + } + return true + } + } + + cold.nativeHistogramBucketsPositive.Range(merge(&hot.nativeHistogramBucketsPositive)) + cold.nativeHistogramBucketsNegative.Range(merge(&hot.nativeHistogramBucketsNegative)) + // Play it simple again and just delete all cold buckets. + atomic.StoreUint32(&cold.nativeHistogramBucketsNumber, 0) + deleteSyncMap(&cold.nativeHistogramBucketsNegative) + deleteSyncMap(&cold.nativeHistogramBucketsPositive) } -// updateExemplar replaces the exemplar for the provided bucket. With empty -// labels, it's a no-op. It panics if any of the labels is invalid. +func (h *histogram) resetCounts(counts *histogramCounts) { + atomic.StoreUint64(&counts.sumBits, 0) + atomic.StoreUint64(&counts.count, 0) + atomic.StoreUint64(&counts.nativeHistogramZeroBucket, 0) + atomic.StoreUint64(&counts.nativeHistogramZeroThresholdBits, math.Float64bits(h.nativeHistogramZeroThreshold)) + atomic.StoreInt32(&counts.nativeHistogramSchema, h.nativeHistogramSchema) + atomic.StoreUint32(&counts.nativeHistogramBucketsNumber, 0) + for i := range h.upperBounds { + atomic.StoreUint64(&counts.buckets[i], 0) + } + deleteSyncMap(&counts.nativeHistogramBucketsNegative) + deleteSyncMap(&counts.nativeHistogramBucketsPositive) +} + +// updateExemplar replaces the exemplar for the provided classic bucket. +// With empty labels, it's a no-op. It panics if any of the labels is invalid. +// If histogram is native, the exemplar will be cached into nativeExemplars, +// which has a limit, and will remove one exemplar when limit is reached. func (h *histogram) updateExemplar(v float64, bucket int, l Labels) { if l == nil { return @@ -406,6 +1135,10 @@ func (h *histogram) updateExemplar(v float64, bucket int, l Labels) { panic(err) } h.exemplars[bucket].Store(e) + doSparse := h.nativeHistogramSchema > math.MinInt32 && !math.IsNaN(v) + if doSparse { + h.nativeExemplars.addExemplar(e) + } } // HistogramVec is a Collector that bundles a set of Histograms that all share the @@ -420,15 +1153,23 @@ type HistogramVec struct { // NewHistogramVec creates a new HistogramVec based on the provided HistogramOpts and // partitioned by the given label names. func NewHistogramVec(opts HistogramOpts, labelNames []string) *HistogramVec { - desc := NewDesc( + return V2.NewHistogramVec(HistogramVecOpts{ + HistogramOpts: opts, + VariableLabels: UnconstrainedLabels(labelNames), + }) +} + +// NewHistogramVec creates a new HistogramVec based on the provided HistogramVecOpts. +func (v2) NewHistogramVec(opts HistogramVecOpts) *HistogramVec { + desc := V2.NewDesc( BuildFQName(opts.Namespace, opts.Subsystem, opts.Name), opts.Help, - labelNames, + opts.VariableLabels, opts.ConstLabels, ) return &HistogramVec{ MetricVec: NewMetricVec(desc, func(lvs ...string) Metric { - return newHistogram(desc, opts, lvs...) + return newHistogram(desc, opts.HistogramOpts, lvs...) }), } } @@ -488,7 +1229,8 @@ func (v *HistogramVec) GetMetricWith(labels Labels) (Observer, error) { // WithLabelValues works as GetMetricWithLabelValues, but panics where // GetMetricWithLabelValues would have returned an error. Not returning an // error allows shortcuts like -// myVec.WithLabelValues("404", "GET").Observe(42.21) +// +// myVec.WithLabelValues("404", "GET").Observe(42.21) func (v *HistogramVec) WithLabelValues(lvs ...string) Observer { h, err := v.GetMetricWithLabelValues(lvs...) if err != nil { @@ -499,7 +1241,8 @@ func (v *HistogramVec) WithLabelValues(lvs ...string) Observer { // With works as GetMetricWith but panics where GetMetricWithLabels would have // returned an error. Not returning an error allows shortcuts like -// myVec.With(prometheus.Labels{"code": "404", "method": "GET"}).Observe(42.21) +// +// myVec.With(prometheus.Labels{"code": "404", "method": "GET"}).Observe(42.21) func (v *HistogramVec) With(labels Labels) Observer { h, err := v.GetMetricWith(labels) if err != nil { @@ -545,6 +1288,7 @@ type constHistogram struct { sum float64 buckets map[float64]uint64 labelPairs []*dto.LabelPair + createdTs *timestamppb.Timestamp } func (h *constHistogram) Desc() *Desc { @@ -552,12 +1296,14 @@ func (h *constHistogram) Desc() *Desc { } func (h *constHistogram) Write(out *dto.Metric) error { - his := &dto.Histogram{} + his := &dto.Histogram{ + CreatedTimestamp: h.createdTs, + } + buckets := make([]*dto.Bucket, 0, len(h.buckets)) his.SampleCount = proto.Uint64(h.count) his.SampleSum = proto.Float64(h.sum) - for upperBound, count := range h.buckets { buckets = append(buckets, &dto.Bucket{ CumulativeCount: proto.Uint64(count), @@ -585,7 +1331,7 @@ func (h *constHistogram) Write(out *dto.Metric) error { // to send it to Prometheus in the Collect method. // // buckets is a map of upper bounds to cumulative counts, excluding the +Inf -// bucket. +// bucket. The +Inf bucket is implicit, and its value is equal to the provided count. // // NewConstHistogram returns an error if the length of labelValues is not // consistent with the variable labels in Desc or if Desc is invalid. @@ -599,7 +1345,7 @@ func NewConstHistogram( if desc.err != nil { return nil, desc.err } - if err := validateLabelValues(labelValues, len(desc.variableLabels)); err != nil { + if err := validateLabelValues(labelValues, len(desc.variableLabels.names)); err != nil { return nil, err } return &constHistogram{ @@ -627,6 +1373,48 @@ func MustNewConstHistogram( return m } +// NewConstHistogramWithCreatedTimestamp does the same thing as NewConstHistogram but sets the created timestamp. +func NewConstHistogramWithCreatedTimestamp( + desc *Desc, + count uint64, + sum float64, + buckets map[float64]uint64, + ct time.Time, + labelValues ...string, +) (Metric, error) { + if desc.err != nil { + return nil, desc.err + } + if err := validateLabelValues(labelValues, len(desc.variableLabels.names)); err != nil { + return nil, err + } + return &constHistogram{ + desc: desc, + count: count, + sum: sum, + buckets: buckets, + labelPairs: MakeLabelPairs(desc, labelValues), + createdTs: timestamppb.New(ct), + }, nil +} + +// MustNewConstHistogramWithCreatedTimestamp is a version of NewConstHistogramWithCreatedTimestamp that panics where +// NewConstHistogramWithCreatedTimestamp would have returned an error. +func MustNewConstHistogramWithCreatedTimestamp( + desc *Desc, + count uint64, + sum float64, + buckets map[float64]uint64, + ct time.Time, + labelValues ...string, +) Metric { + m, err := NewConstHistogramWithCreatedTimestamp(desc, count, sum, buckets, ct, labelValues...) + if err != nil { + panic(err) + } + return m +} + type buckSort []*dto.Bucket func (s buckSort) Len() int { @@ -640,3 +1428,368 @@ func (s buckSort) Swap(i, j int) { func (s buckSort) Less(i, j int) bool { return s[i].GetUpperBound() < s[j].GetUpperBound() } + +// pickSchema returns the largest number n between -4 and 8 such that +// 2^(2^-n) is less or equal the provided bucketFactor. +// +// Special cases: +// - bucketFactor <= 1: panics. +// - bucketFactor < 2^(2^-8) (but > 1): still returns 8. +func pickSchema(bucketFactor float64) int32 { + if bucketFactor <= 1 { + panic(fmt.Errorf("bucketFactor %f is <=1", bucketFactor)) + } + floor := math.Floor(math.Log2(math.Log2(bucketFactor))) + switch { + case floor <= -8: + return 8 + case floor >= 4: + return -4 + default: + return -int32(floor) + } +} + +func makeBuckets(buckets *sync.Map) ([]*dto.BucketSpan, []int64) { + var ii []int + buckets.Range(func(k, v interface{}) bool { + ii = append(ii, k.(int)) + return true + }) + sort.Ints(ii) + + if len(ii) == 0 { + return nil, nil + } + + var ( + spans []*dto.BucketSpan + deltas []int64 + prevCount int64 + nextI int + ) + + appendDelta := func(count int64) { + *spans[len(spans)-1].Length++ + deltas = append(deltas, count-prevCount) + prevCount = count + } + + for n, i := range ii { + v, _ := buckets.Load(i) + count := atomic.LoadInt64(v.(*int64)) + // Multiple spans with only small gaps in between are probably + // encoded more efficiently as one larger span with a few empty + // buckets. Needs some research to find the sweet spot. For now, + // we assume that gaps of one or two buckets should not create + // a new span. + iDelta := int32(i - nextI) + if n == 0 || iDelta > 2 { + // We have to create a new span, either because we are + // at the very beginning, or because we have found a gap + // of more than two buckets. + spans = append(spans, &dto.BucketSpan{ + Offset: proto.Int32(iDelta), + Length: proto.Uint32(0), + }) + } else { + // We have found a small gap (or no gap at all). + // Insert empty buckets as needed. + for j := int32(0); j < iDelta; j++ { + appendDelta(0) + } + } + appendDelta(count) + nextI = i + 1 + } + return spans, deltas +} + +// addToBucket increments the sparse bucket at key by the provided amount. It +// returns true if a new sparse bucket had to be created for that. +func addToBucket(buckets *sync.Map, key int, increment int64) bool { + if existingBucket, ok := buckets.Load(key); ok { + // Fast path without allocation. + atomic.AddInt64(existingBucket.(*int64), increment) + return false + } + // Bucket doesn't exist yet. Slow path allocating new counter. + newBucket := increment // TODO(beorn7): Check if this is sufficient to not let increment escape. + if actualBucket, loaded := buckets.LoadOrStore(key, &newBucket); loaded { + // The bucket was created concurrently in another goroutine. + // Have to increment after all. + atomic.AddInt64(actualBucket.(*int64), increment) + return false + } + return true +} + +// addAndReset returns a function to be used with sync.Map.Range of spare +// buckets in coldCounts. It increments the buckets in the provided hotBuckets +// according to the buckets ranged through. It then resets all buckets ranged +// through to 0 (but leaves them in place so that they don't need to get +// recreated on the next scrape). +func addAndReset(hotBuckets *sync.Map, bucketNumber *uint32) func(k, v interface{}) bool { + return func(k, v interface{}) bool { + bucket := v.(*int64) + if addToBucket(hotBuckets, k.(int), atomic.LoadInt64(bucket)) { + atomic.AddUint32(bucketNumber, 1) + } + atomic.StoreInt64(bucket, 0) + return true + } +} + +func deleteSyncMap(m *sync.Map) { + m.Range(func(k, v interface{}) bool { + m.Delete(k) + return true + }) +} + +func findSmallestKey(m *sync.Map) int { + result := math.MaxInt32 + m.Range(func(k, v interface{}) bool { + key := k.(int) + if key < result { + result = key + } + return true + }) + return result +} + +func getLe(key int, schema int32) float64 { + // Here a bit of context about the behavior for the last bucket counting + // regular numbers (called simply "last bucket" below) and the bucket + // counting observations of ±Inf (called "inf bucket" below, with a key + // one higher than that of the "last bucket"): + // + // If we apply the usual formula to the last bucket, its upper bound + // would be calculated as +Inf. The reason is that the max possible + // regular float64 number (math.MaxFloat64) doesn't coincide with one of + // the calculated bucket boundaries. So the calculated boundary has to + // be larger than math.MaxFloat64, and the only float64 larger than + // math.MaxFloat64 is +Inf. However, we want to count actual + // observations of ±Inf in the inf bucket. Therefore, we have to treat + // the upper bound of the last bucket specially and set it to + // math.MaxFloat64. (The upper bound of the inf bucket, with its key + // being one higher than that of the last bucket, naturally comes out as + // +Inf by the usual formula. So that's fine.) + // + // math.MaxFloat64 has a frac of 0.9999999999999999 and an exp of + // 1024. If there were a float64 number following math.MaxFloat64, it + // would have a frac of 1.0 and an exp of 1024, or equivalently a frac + // of 0.5 and an exp of 1025. However, since frac must be smaller than + // 1, and exp must be smaller than 1025, either representation overflows + // a float64. (Which, in turn, is the reason that math.MaxFloat64 is the + // largest possible float64. Q.E.D.) However, the formula for + // calculating the upper bound from the idx and schema of the last + // bucket results in precisely that. It is either frac=1.0 & exp=1024 + // (for schema < 0) or frac=0.5 & exp=1025 (for schema >=0). (This is, + // by the way, a power of two where the exponent itself is a power of + // two, 2¹⁰ in fact, which coinicides with a bucket boundary in all + // schemas.) So these are the special cases we have to catch below. + if schema < 0 { + exp := key << -schema + if exp == 1024 { + // This is the last bucket before the overflow bucket + // (for ±Inf observations). Return math.MaxFloat64 as + // explained above. + return math.MaxFloat64 + } + return math.Ldexp(1, exp) + } + + fracIdx := key & ((1 << schema) - 1) + frac := nativeHistogramBounds[schema][fracIdx] + exp := (key >> schema) + 1 + if frac == 0.5 && exp == 1025 { + // This is the last bucket before the overflow bucket (for ±Inf + // observations). Return math.MaxFloat64 as explained above. + return math.MaxFloat64 + } + return math.Ldexp(frac, exp) +} + +// waitForCooldown returns after the count field in the provided histogramCounts +// has reached the provided count value. +func waitForCooldown(count uint64, counts *histogramCounts) { + for count != atomic.LoadUint64(&counts.count) { + runtime.Gosched() // Let observations get work done. + } +} + +// atomicAddFloat adds the provided float atomically to another float +// represented by the bit pattern the bits pointer is pointing to. +func atomicAddFloat(bits *uint64, v float64) { + for { + loadedBits := atomic.LoadUint64(bits) + newBits := math.Float64bits(math.Float64frombits(loadedBits) + v) + if atomic.CompareAndSwapUint64(bits, loadedBits, newBits) { + break + } + } +} + +// atomicDecUint32 atomically decrements the uint32 p points to. See +// https://pkg.go.dev/sync/atomic#AddUint32 to understand how this is done. +func atomicDecUint32(p *uint32) { + atomic.AddUint32(p, ^uint32(0)) +} + +// addAndResetCounts adds certain fields (count, sum, conventional buckets, zero +// bucket) from the cold counts to the corresponding fields in the hot +// counts. Those fields are then reset to 0 in the cold counts. +func addAndResetCounts(hot, cold *histogramCounts) { + atomic.AddUint64(&hot.count, atomic.LoadUint64(&cold.count)) + atomic.StoreUint64(&cold.count, 0) + coldSum := math.Float64frombits(atomic.LoadUint64(&cold.sumBits)) + atomicAddFloat(&hot.sumBits, coldSum) + atomic.StoreUint64(&cold.sumBits, 0) + for i := range hot.buckets { + atomic.AddUint64(&hot.buckets[i], atomic.LoadUint64(&cold.buckets[i])) + atomic.StoreUint64(&cold.buckets[i], 0) + } + atomic.AddUint64(&hot.nativeHistogramZeroBucket, atomic.LoadUint64(&cold.nativeHistogramZeroBucket)) + atomic.StoreUint64(&cold.nativeHistogramZeroBucket, 0) +} + +type nativeExemplars struct { + sync.Mutex + + ttl time.Duration + exemplars []*dto.Exemplar +} + +func makeNativeExemplars(ttl time.Duration, maxCount int) nativeExemplars { + if ttl == 0 { + ttl = 5 * time.Minute + } + + if maxCount == 0 { + maxCount = 10 + } + + if maxCount < 0 { + maxCount = 0 + } + + return nativeExemplars{ + ttl: ttl, + exemplars: make([]*dto.Exemplar, 0, maxCount), + } +} + +func (n *nativeExemplars) addExemplar(e *dto.Exemplar) { + if cap(n.exemplars) == 0 { + return + } + + n.Lock() + defer n.Unlock() + + // The index where to insert the new exemplar. + var nIdx int = -1 + + // When the number of exemplars has not yet exceeded or + // is equal to cap(n.exemplars), then + // insert the new exemplar directly. + if len(n.exemplars) < cap(n.exemplars) { + for nIdx = 0; nIdx < len(n.exemplars); nIdx++ { + if *e.Value < *n.exemplars[nIdx].Value { + break + } + } + n.exemplars = append(n.exemplars[:nIdx], append([]*dto.Exemplar{e}, n.exemplars[nIdx:]...)...) + return + } + + // When the number of exemplars exceeds the limit, remove one exemplar. + var ( + rIdx int // The index where to remove the old exemplar. + + ot = time.Now() // Oldest timestamp seen. + otIdx = -1 // Index of the exemplar with the oldest timestamp. + + md = -1.0 // Logarithm of the delta of the closest pair of exemplars. + mdIdx = -1 // Index of the older exemplar within the closest pair. + cLog float64 // Logarithm of the current exemplar. + pLog float64 // Logarithm of the previous exemplar. + ) + + for i, exemplar := range n.exemplars { + // Find the exemplar with the oldest timestamp. + if otIdx == -1 || exemplar.Timestamp.AsTime().Before(ot) { + ot = exemplar.Timestamp.AsTime() + otIdx = i + } + + // Find the index at which to insert new the exemplar. + if *e.Value <= *exemplar.Value && nIdx == -1 { + nIdx = i + } + + // Find the two closest exemplars and pick the one the with older timestamp. + pLog = cLog + cLog = math.Log(exemplar.GetValue()) + if i == 0 { + continue + } + diff := math.Abs(cLog - pLog) + if md == -1 || diff < md { + md = diff + if n.exemplars[i].Timestamp.AsTime().Before(n.exemplars[i-1].Timestamp.AsTime()) { + mdIdx = i + } else { + mdIdx = i - 1 + } + } + + } + + // If all existing exemplar are smaller than new exemplar, + // then the exemplar should be inserted at the end. + if nIdx == -1 { + nIdx = len(n.exemplars) + } + + if otIdx != -1 && e.Timestamp.AsTime().Sub(ot) > n.ttl { + rIdx = otIdx + } else { + // In the previous for loop, when calculating the closest pair of exemplars, + // we did not take into account the newly inserted exemplar. + // So we need to calculate with the newly inserted exemplar again. + elog := math.Log(e.GetValue()) + if nIdx > 0 { + diff := math.Abs(elog - math.Log(n.exemplars[nIdx-1].GetValue())) + if diff < md { + md = diff + mdIdx = nIdx + if n.exemplars[nIdx-1].Timestamp.AsTime().Before(e.Timestamp.AsTime()) { + mdIdx = nIdx - 1 + } + } + } + if nIdx < len(n.exemplars) { + diff := math.Abs(math.Log(n.exemplars[nIdx].GetValue()) - elog) + if diff < md { + mdIdx = nIdx + if n.exemplars[nIdx].Timestamp.AsTime().Before(e.Timestamp.AsTime()) { + mdIdx = nIdx + } + } + } + rIdx = mdIdx + } + + // Adjust the slice according to rIdx and nIdx. + switch { + case rIdx == nIdx: + n.exemplars[nIdx] = e + case rIdx < nIdx: + n.exemplars = append(n.exemplars[:rIdx], append(n.exemplars[rIdx+1:nIdx], append([]*dto.Exemplar{e}, n.exemplars[nIdx:]...)...)...) + case rIdx > nIdx: + n.exemplars = append(n.exemplars[:nIdx], append([]*dto.Exemplar{e}, append(n.exemplars[nIdx:rIdx], n.exemplars[rIdx+1:]...)...)...) + } +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/internal/almost_equal.go b/vendor/github.com/prometheus/client_golang/prometheus/internal/almost_equal.go new file mode 100644 index 0000000000..1ed5abe74c --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/internal/almost_equal.go @@ -0,0 +1,60 @@ +// Copyright (c) 2015 Björn Rabenstein +// +// 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. +// +// The code in this package is copy/paste to avoid a dependency. Hence this file +// carries the copyright of the original repo. +// https://github.com/beorn7/floats +package internal + +import ( + "math" +) + +// minNormalFloat64 is the smallest positive normal value of type float64. +var minNormalFloat64 = math.Float64frombits(0x0010000000000000) + +// AlmostEqualFloat64 returns true if a and b are equal within a relative error +// of epsilon. See http://floating-point-gui.de/errors/comparison/ for the +// details of the applied method. +func AlmostEqualFloat64(a, b, epsilon float64) bool { + if a == b { + return true + } + absA := math.Abs(a) + absB := math.Abs(b) + diff := math.Abs(a - b) + if a == 0 || b == 0 || absA+absB < minNormalFloat64 { + return diff < epsilon*minNormalFloat64 + } + return diff/math.Min(absA+absB, math.MaxFloat64) < epsilon +} + +// AlmostEqualFloat64s is the slice form of AlmostEqualFloat64. +func AlmostEqualFloat64s(a, b []float64, epsilon float64) bool { + if len(a) != len(b) { + return false + } + for i := range a { + if !AlmostEqualFloat64(a[i], b[i], epsilon) { + return false + } + } + return true +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go b/vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go new file mode 100644 index 0000000000..a595a20362 --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go @@ -0,0 +1,654 @@ +// Copyright 2022 The Prometheus 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. +// +// It provides tools to compare sequences of strings and generate textual diffs. +// +// Maintaining `GetUnifiedDiffString` here because original repository +// (https://github.com/pmezard/go-difflib) is no longer maintained. +package internal + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strings" +) + +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 calculateRatio(matches, length int) float64 { + if length > 0 { + return 2.0 * float64(matches) / float64(length) + } + return 1.0 +} + +type Match struct { + A int + B int + Size int +} + +type OpCode struct { + Tag byte + I1 int + I2 int + J1 int + J2 int +} + +// SequenceMatcher compares sequence of strings. The basic +// algorithm predates, and is a little fancier than, an algorithm +// published in the late 1980's by Ratcliff and Obershelp under the +// hyperbolic name "gestalt pattern matching". The basic idea is to find +// the longest contiguous matching subsequence that contains no "junk" +// elements (R-O doesn't address junk). The same idea is then applied +// recursively to the pieces of the sequences to the left and to the right +// of the matching subsequence. This does not yield minimal edit +// sequences, but does tend to yield matches that "look right" to people. +// +// SequenceMatcher tries to compute a "human-friendly diff" between two +// sequences. Unlike e.g. UNIX(tm) diff, the fundamental notion is the +// longest *contiguous* & junk-free matching subsequence. That's what +// catches peoples' eyes. The Windows(tm) windiff has another interesting +// notion, pairing up elements that appear uniquely in each sequence. +// That, and the method here, appear to yield more intuitive difference +// reports than does diff. This method appears to be the least vulnerable +// to synching up on blocks of "junk lines", though (like blank lines in +// ordinary text files, or maybe "

" lines in HTML files). That may be +// because this is the only method of the 3 that has a *concept* of +// "junk" . +// +// Timing: Basic R-O is cubic time worst case and quadratic time expected +// case. SequenceMatcher is quadratic time for the worst case and has +// expected-case behavior dependent in a complicated way on how many +// elements the sequences have in common; best case time is linear. +type SequenceMatcher struct { + a []string + b []string + b2j map[string][]int + IsJunk func(string) bool + autoJunk bool + bJunk map[string]struct{} + matchingBlocks []Match + fullBCount map[string]int + bPopular map[string]struct{} + opCodes []OpCode +} + +func NewMatcher(a, b []string) *SequenceMatcher { + m := SequenceMatcher{autoJunk: true} + m.SetSeqs(a, b) + return &m +} + +func NewMatcherWithJunk(a, b []string, autoJunk bool, + isJunk func(string) bool, +) *SequenceMatcher { + m := SequenceMatcher{IsJunk: isJunk, autoJunk: autoJunk} + m.SetSeqs(a, b) + return &m +} + +// Set two sequences to be compared. +func (m *SequenceMatcher) SetSeqs(a, b []string) { + m.SetSeq1(a) + m.SetSeq2(b) +} + +// Set the first sequence to be compared. The second sequence to be compared is +// not changed. +// +// SequenceMatcher computes and caches detailed information about the second +// sequence, so if you want to compare one sequence S against many sequences, +// use .SetSeq2(s) once and call .SetSeq1(x) repeatedly for each of the other +// sequences. +// +// See also SetSeqs() and SetSeq2(). +func (m *SequenceMatcher) SetSeq1(a []string) { + if &a == &m.a { + return + } + m.a = a + m.matchingBlocks = nil + m.opCodes = nil +} + +// Set the second sequence to be compared. The first sequence to be compared is +// not changed. +func (m *SequenceMatcher) SetSeq2(b []string) { + if &b == &m.b { + return + } + m.b = b + m.matchingBlocks = nil + m.opCodes = nil + m.fullBCount = nil + m.chainB() +} + +func (m *SequenceMatcher) chainB() { + // Populate line -> index mapping + b2j := map[string][]int{} + for i, s := range m.b { + indices := b2j[s] + indices = append(indices, i) + b2j[s] = indices + } + + // Purge junk elements + m.bJunk = map[string]struct{}{} + if m.IsJunk != nil { + junk := m.bJunk + for s := range b2j { + if m.IsJunk(s) { + junk[s] = struct{}{} + } + } + for s := range junk { + delete(b2j, s) + } + } + + // Purge remaining popular elements + popular := map[string]struct{}{} + n := len(m.b) + if m.autoJunk && n >= 200 { + ntest := n/100 + 1 + for s, indices := range b2j { + if len(indices) > ntest { + popular[s] = struct{}{} + } + } + for s := range popular { + delete(b2j, s) + } + } + m.bPopular = popular + m.b2j = b2j +} + +func (m *SequenceMatcher) isBJunk(s string) bool { + _, ok := m.bJunk[s] + return ok +} + +// Find longest matching block in a[alo:ahi] and b[blo:bhi]. +// +// If IsJunk is not defined: +// +// Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where +// +// alo <= i <= i+k <= ahi +// blo <= j <= j+k <= bhi +// +// and for all (i',j',k') meeting those conditions, +// +// k >= k' +// i <= i' +// and if i == i', j <= j' +// +// In other words, of all maximal matching blocks, return one that +// starts earliest in a, and of all those maximal matching blocks that +// start earliest in a, return the one that starts earliest in b. +// +// If IsJunk is defined, first the longest matching block is +// determined as above, but with the additional restriction that no +// junk element appears in the block. Then that block is extended as +// far as possible by matching (only) junk elements on both sides. So +// the resulting block never matches on junk except as identical junk +// happens to be adjacent to an "interesting" match. +// +// If no blocks match, return (alo, blo, 0). +func (m *SequenceMatcher) findLongestMatch(alo, ahi, blo, bhi int) Match { + // CAUTION: stripping common prefix or suffix would be incorrect. + // E.g., + // ab + // acab + // Longest matching block is "ab", but if common prefix is + // stripped, it's "a" (tied with "b"). UNIX(tm) diff does so + // strip, so ends up claiming that ab is changed to acab by + // inserting "ca" in the middle. That's minimal but unintuitive: + // "it's obvious" that someone inserted "ac" at the front. + // Windiff ends up at the same place as diff, but by pairing up + // the unique 'b's and then matching the first two 'a's. + besti, bestj, bestsize := alo, blo, 0 + + // find longest junk-free match + // during an iteration of the loop, j2len[j] = length of longest + // junk-free match ending with a[i-1] and b[j] + j2len := map[int]int{} + for i := alo; i != ahi; i++ { + // look at all instances of a[i] in b; note that because + // b2j has no junk keys, the loop is skipped if a[i] is junk + newj2len := map[int]int{} + for _, j := range m.b2j[m.a[i]] { + // a[i] matches b[j] + if j < blo { + continue + } + if j >= bhi { + break + } + k := j2len[j-1] + 1 + newj2len[j] = k + if k > bestsize { + besti, bestj, bestsize = i-k+1, j-k+1, k + } + } + j2len = newj2len + } + + // Extend the best by non-junk elements on each end. In particular, + // "popular" non-junk elements aren't in b2j, which greatly speeds + // the inner loop above, but also means "the best" match so far + // doesn't contain any junk *or* popular non-junk elements. + for besti > alo && bestj > blo && !m.isBJunk(m.b[bestj-1]) && + m.a[besti-1] == m.b[bestj-1] { + besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 + } + for besti+bestsize < ahi && bestj+bestsize < bhi && + !m.isBJunk(m.b[bestj+bestsize]) && + m.a[besti+bestsize] == m.b[bestj+bestsize] { + bestsize++ + } + + // Now that we have a wholly interesting match (albeit possibly + // empty!), we may as well suck up the matching junk on each + // side of it too. Can't think of a good reason not to, and it + // saves post-processing the (possibly considerable) expense of + // figuring out what to do with it. In the case of an empty + // interesting match, this is clearly the right thing to do, + // because no other kind of match is possible in the regions. + for besti > alo && bestj > blo && m.isBJunk(m.b[bestj-1]) && + m.a[besti-1] == m.b[bestj-1] { + besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 + } + for besti+bestsize < ahi && bestj+bestsize < bhi && + m.isBJunk(m.b[bestj+bestsize]) && + m.a[besti+bestsize] == m.b[bestj+bestsize] { + bestsize++ + } + + return Match{A: besti, B: bestj, Size: bestsize} +} + +// Return list of triples describing matching subsequences. +// +// Each triple is of the form (i, j, n), and means that +// a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in +// i and in j. It's also guaranteed that if (i, j, n) and (i', j', n') are +// adjacent triples in the list, and the second is not the last triple in the +// list, then i+n != i' or j+n != j'. IOW, adjacent triples never describe +// adjacent equal blocks. +// +// The last triple is a dummy, (len(a), len(b), 0), and is the only +// triple with n==0. +func (m *SequenceMatcher) GetMatchingBlocks() []Match { + if m.matchingBlocks != nil { + return m.matchingBlocks + } + + var matchBlocks func(alo, ahi, blo, bhi int, matched []Match) []Match + matchBlocks = func(alo, ahi, blo, bhi int, matched []Match) []Match { + match := m.findLongestMatch(alo, ahi, blo, bhi) + i, j, k := match.A, match.B, match.Size + if match.Size > 0 { + if alo < i && blo < j { + matched = matchBlocks(alo, i, blo, j, matched) + } + matched = append(matched, match) + if i+k < ahi && j+k < bhi { + matched = matchBlocks(i+k, ahi, j+k, bhi, matched) + } + } + return matched + } + matched := matchBlocks(0, len(m.a), 0, len(m.b), nil) + + // It's possible that we have adjacent equal blocks in the + // matching_blocks list now. + nonAdjacent := []Match{} + i1, j1, k1 := 0, 0, 0 + for _, b := range matched { + // Is this block adjacent to i1, j1, k1? + i2, j2, k2 := b.A, b.B, b.Size + if i1+k1 == i2 && j1+k1 == j2 { + // Yes, so collapse them -- this just increases the length of + // the first block by the length of the second, and the first + // block so lengthened remains the block to compare against. + k1 += k2 + } else { + // Not adjacent. Remember the first block (k1==0 means it's + // the dummy we started with), and make the second block the + // new block to compare against. + if k1 > 0 { + nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) + } + i1, j1, k1 = i2, j2, k2 + } + } + if k1 > 0 { + nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) + } + + nonAdjacent = append(nonAdjacent, Match{len(m.a), len(m.b), 0}) + m.matchingBlocks = nonAdjacent + return m.matchingBlocks +} + +// Return list of 5-tuples describing how to turn a into b. +// +// Each tuple is of the form (tag, i1, i2, j1, j2). The first tuple +// has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the +// tuple preceding it, and likewise for j1 == the previous j2. +// +// The tags are characters, with these meanings: +// +// 'r' (replace): a[i1:i2] should be replaced by b[j1:j2] +// +// 'd' (delete): a[i1:i2] should be deleted, j1==j2 in this case. +// +// 'i' (insert): b[j1:j2] should be inserted at a[i1:i1], i1==i2 in this case. +// +// 'e' (equal): a[i1:i2] == b[j1:j2] +func (m *SequenceMatcher) GetOpCodes() []OpCode { + if m.opCodes != nil { + return m.opCodes + } + i, j := 0, 0 + matching := m.GetMatchingBlocks() + opCodes := make([]OpCode, 0, len(matching)) + for _, m := range matching { + // invariant: we've pumped out correct diffs to change + // a[:i] into b[:j], and the next matching block is + // a[ai:ai+size] == b[bj:bj+size]. So we need to pump + // out a diff to change a[i:ai] into b[j:bj], pump out + // the matching block, and move (i,j) beyond the match + ai, bj, size := m.A, m.B, m.Size + tag := byte(0) + if i < ai && j < bj { + tag = 'r' + } else if i < ai { + tag = 'd' + } else if j < bj { + tag = 'i' + } + if tag > 0 { + opCodes = append(opCodes, OpCode{tag, i, ai, j, bj}) + } + i, j = ai+size, bj+size + // the list of matching blocks is terminated by a + // sentinel with size 0 + if size > 0 { + opCodes = append(opCodes, OpCode{'e', ai, i, bj, j}) + } + } + m.opCodes = opCodes + return m.opCodes +} + +// Isolate change clusters by eliminating ranges with no changes. +// +// Return a generator of groups with up to n lines of context. +// Each group is in the same format as returned by GetOpCodes(). +func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode { + if n < 0 { + n = 3 + } + codes := m.GetOpCodes() + if len(codes) == 0 { + codes = []OpCode{{'e', 0, 1, 0, 1}} + } + // Fixup leading and trailing groups if they show no changes. + if codes[0].Tag == 'e' { + c := codes[0] + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + codes[0] = OpCode{c.Tag, max(i1, i2-n), i2, max(j1, j2-n), j2} + } + if codes[len(codes)-1].Tag == 'e' { + c := codes[len(codes)-1] + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + codes[len(codes)-1] = OpCode{c.Tag, i1, min(i2, i1+n), j1, min(j2, j1+n)} + } + nn := n + n + groups := [][]OpCode{} + group := []OpCode{} + for _, c := range codes { + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + // End the current group and start a new one whenever + // there is a large range with no changes. + if c.Tag == 'e' && i2-i1 > nn { + group = append(group, OpCode{ + c.Tag, i1, min(i2, i1+n), + j1, min(j2, j1+n), + }) + groups = append(groups, group) + group = []OpCode{} + i1, j1 = max(i1, i2-n), max(j1, j2-n) + } + group = append(group, OpCode{c.Tag, i1, i2, j1, j2}) + } + if len(group) > 0 && !(len(group) == 1 && group[0].Tag == 'e') { + groups = append(groups, group) + } + return groups +} + +// Return a measure of the sequences' similarity (float in [0,1]). +// +// Where T is the total number of elements in both sequences, and +// M is the number of matches, this is 2.0*M / T. +// Note that this is 1 if the sequences are identical, and 0 if +// they have nothing in common. +// +// .Ratio() is expensive to compute if you haven't already computed +// .GetMatchingBlocks() or .GetOpCodes(), in which case you may +// want to try .QuickRatio() or .RealQuickRation() first to get an +// upper bound. +func (m *SequenceMatcher) Ratio() float64 { + matches := 0 + for _, m := range m.GetMatchingBlocks() { + matches += m.Size + } + return calculateRatio(matches, len(m.a)+len(m.b)) +} + +// Return an upper bound on ratio() relatively quickly. +// +// This isn't defined beyond that it is an upper bound on .Ratio(), and +// is faster to compute. +func (m *SequenceMatcher) QuickRatio() float64 { + // viewing a and b as multisets, set matches to the cardinality + // of their intersection; this counts the number of matches + // without regard to order, so is clearly an upper bound + if m.fullBCount == nil { + m.fullBCount = map[string]int{} + for _, s := range m.b { + m.fullBCount[s]++ + } + } + + // avail[x] is the number of times x appears in 'b' less the + // number of times we've seen it in 'a' so far ... kinda + avail := map[string]int{} + matches := 0 + for _, s := range m.a { + n, ok := avail[s] + if !ok { + n = m.fullBCount[s] + } + avail[s] = n - 1 + if n > 0 { + matches++ + } + } + return calculateRatio(matches, len(m.a)+len(m.b)) +} + +// Return an upper bound on ratio() very quickly. +// +// This isn't defined beyond that it is an upper bound on .Ratio(), and +// is faster to compute than either .Ratio() or .QuickRatio(). +func (m *SequenceMatcher) RealQuickRatio() float64 { + la, lb := len(m.a), len(m.b) + return calculateRatio(min(la, lb), la+lb) +} + +// Convert range to the "ed" format +func formatRangeUnified(start, stop int) string { + // Per the diff spec at http://www.unix.org/single_unix_specification/ + beginning := start + 1 // lines start numbering with one + length := stop - start + if length == 1 { + return fmt.Sprintf("%d", beginning) + } + if length == 0 { + beginning-- // empty ranges begin at line just before the range + } + return fmt.Sprintf("%d,%d", beginning, length) +} + +// Unified diff parameters +type UnifiedDiff struct { + A []string // First sequence lines + FromFile string // First file name + FromDate string // First file time + B []string // Second sequence lines + ToFile string // Second file name + ToDate string // Second file time + Eol string // Headers end of line, defaults to LF + Context int // Number of context lines +} + +// Compare two sequences of lines; generate the delta as a unified diff. +// +// Unified diffs are a compact way of showing line changes and a few +// lines of context. The number of context lines is set by 'n' which +// defaults to three. +// +// By default, the diff control lines (those with ---, +++, or @@) are +// created with a trailing newline. This is helpful so that inputs +// created from file.readlines() result in diffs that are suitable for +// file.writelines() since both the inputs and outputs have trailing +// newlines. +// +// For inputs that do not have trailing newlines, set the lineterm +// argument to "" so that the output will be uniformly newline free. +// +// The unidiff format normally has a header for filenames and modification +// times. Any or all of these may be specified using strings for +// 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'. +// The modification times are normally expressed in the ISO 8601 format. +func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error { + buf := bufio.NewWriter(writer) + defer buf.Flush() + wf := func(format string, args ...interface{}) error { + _, err := buf.WriteString(fmt.Sprintf(format, args...)) + return err + } + ws := func(s string) error { + _, err := buf.WriteString(s) + return err + } + + if len(diff.Eol) == 0 { + diff.Eol = "\n" + } + + started := false + m := NewMatcher(diff.A, diff.B) + for _, g := range m.GetGroupedOpCodes(diff.Context) { + if !started { + started = true + fromDate := "" + if len(diff.FromDate) > 0 { + fromDate = "\t" + diff.FromDate + } + toDate := "" + if len(diff.ToDate) > 0 { + toDate = "\t" + diff.ToDate + } + if diff.FromFile != "" || diff.ToFile != "" { + err := wf("--- %s%s%s", diff.FromFile, fromDate, diff.Eol) + if err != nil { + return err + } + err = wf("+++ %s%s%s", diff.ToFile, toDate, diff.Eol) + if err != nil { + return err + } + } + } + first, last := g[0], g[len(g)-1] + range1 := formatRangeUnified(first.I1, last.I2) + range2 := formatRangeUnified(first.J1, last.J2) + if err := wf("@@ -%s +%s @@%s", range1, range2, diff.Eol); err != nil { + return err + } + for _, c := range g { + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + if c.Tag == 'e' { + for _, line := range diff.A[i1:i2] { + if err := ws(" " + line); err != nil { + return err + } + } + continue + } + if c.Tag == 'r' || c.Tag == 'd' { + for _, line := range diff.A[i1:i2] { + if err := ws("-" + line); err != nil { + return err + } + } + } + if c.Tag == 'r' || c.Tag == 'i' { + for _, line := range diff.B[j1:j2] { + if err := ws("+" + line); err != nil { + return err + } + } + } + } + } + return nil +} + +// Like WriteUnifiedDiff but returns the diff a string. +func GetUnifiedDiffString(diff UnifiedDiff) (string, error) { + w := &bytes.Buffer{} + err := WriteUnifiedDiff(w, diff) + return w.String(), err +} + +// Split a string on "\n" while preserving them. The output can be used +// as input for UnifiedDiff and ContextDiff structures. +func SplitLines(s string) []string { + lines := strings.SplitAfter(s, "\n") + lines[len(lines)-1] += "\n" + return lines +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/internal/go_collector_options.go b/vendor/github.com/prometheus/client_golang/prometheus/internal/go_collector_options.go new file mode 100644 index 0000000000..a4fa6eabd7 --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/internal/go_collector_options.go @@ -0,0 +1,34 @@ +// Copyright 2021 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal + +import "regexp" + +type GoCollectorRule struct { + Matcher *regexp.Regexp + Deny bool +} + +// GoCollectorOptions should not be used be directly by anything, except `collectors` package. +// Use it via collectors package instead. See issue +// https://github.com/prometheus/client_golang/issues/1030. +// +// This is internal, so external users only can use it via `collector.WithGoCollector*` methods +type GoCollectorOptions struct { + DisableMemStatsLikeMetrics bool + RuntimeMetricSumForHist map[string]string + RuntimeMetricRules []GoCollectorRule +} + +var GoCollectorDefaultRuntimeMetrics = regexp.MustCompile(`/gc/gogc:percent|/gc/gomemlimit:bytes|/sched/gomaxprocs:threads`) diff --git a/vendor/github.com/prometheus/client_golang/prometheus/internal/go_runtime_metrics.go b/vendor/github.com/prometheus/client_golang/prometheus/internal/go_runtime_metrics.go new file mode 100644 index 0000000000..97d17d6cb6 --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/internal/go_runtime_metrics.go @@ -0,0 +1,142 @@ +// Copyright 2021 The Prometheus 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:build go1.17 +// +build go1.17 + +package internal + +import ( + "math" + "path" + "runtime/metrics" + "strings" + + "github.com/prometheus/common/model" +) + +// RuntimeMetricsToProm produces a Prometheus metric name from a runtime/metrics +// metric description and validates whether the metric is suitable for integration +// with Prometheus. +// +// Returns false if a name could not be produced, or if Prometheus does not understand +// the runtime/metrics Kind. +// +// Note that the main reason a name couldn't be produced is if the runtime/metrics +// package exports a name with characters outside the valid Prometheus metric name +// character set. This is theoretically possible, but should never happen in practice. +// Still, don't rely on it. +func RuntimeMetricsToProm(d *metrics.Description) (string, string, string, bool) { + namespace := "go" + + comp := strings.SplitN(d.Name, ":", 2) + key := comp[0] + unit := comp[1] + + // The last path element in the key is the name, + // the rest is the subsystem. + subsystem := path.Dir(key[1:] /* remove leading / */) + name := path.Base(key) + + // subsystem is translated by replacing all / and - with _. + subsystem = strings.ReplaceAll(subsystem, "/", "_") + subsystem = strings.ReplaceAll(subsystem, "-", "_") + + // unit is translated assuming that the unit contains no + // non-ASCII characters. + unit = strings.ReplaceAll(unit, "-", "_") + unit = strings.ReplaceAll(unit, "*", "_") + unit = strings.ReplaceAll(unit, "/", "_per_") + + // name has - replaced with _ and is concatenated with the unit and + // other data. + name = strings.ReplaceAll(name, "-", "_") + name += "_" + unit + if d.Cumulative && d.Kind != metrics.KindFloat64Histogram { + name += "_total" + } + + valid := model.IsValidMetricName(model.LabelValue(namespace + "_" + subsystem + "_" + name)) + switch d.Kind { + case metrics.KindUint64: + case metrics.KindFloat64: + case metrics.KindFloat64Histogram: + default: + valid = false + } + return namespace, subsystem, name, valid +} + +// RuntimeMetricsBucketsForUnit takes a set of buckets obtained for a runtime/metrics histogram +// type (so, lower-bound inclusive) and a unit from a runtime/metrics name, and produces +// a reduced set of buckets. This function always removes any -Inf bucket as it's represented +// as the bottom-most upper-bound inclusive bucket in Prometheus. +func RuntimeMetricsBucketsForUnit(buckets []float64, unit string) []float64 { + switch unit { + case "bytes": + // Re-bucket as powers of 2. + return reBucketExp(buckets, 2) + case "seconds": + // Re-bucket as powers of 10 and then merge all buckets greater + // than 1 second into the +Inf bucket. + b := reBucketExp(buckets, 10) + for i := range b { + if b[i] <= 1 { + continue + } + b[i] = math.Inf(1) + b = b[:i+1] + break + } + return b + } + return buckets +} + +// reBucketExp takes a list of bucket boundaries (lower bound inclusive) and +// downsamples the buckets to those a multiple of base apart. The end result +// is a roughly exponential (in many cases, perfectly exponential) bucketing +// scheme. +func reBucketExp(buckets []float64, base float64) []float64 { + bucket := buckets[0] + var newBuckets []float64 + // We may see a -Inf here, in which case, add it and skip it + // since we risk producing NaNs otherwise. + // + // We need to preserve -Inf values to maintain runtime/metrics + // conventions. We'll strip it out later. + if bucket == math.Inf(-1) { + newBuckets = append(newBuckets, bucket) + buckets = buckets[1:] + bucket = buckets[0] + } + // From now on, bucket should always have a non-Inf value because + // Infs are only ever at the ends of the bucket lists, so + // arithmetic operations on it are non-NaN. + for i := 1; i < len(buckets); i++ { + if bucket >= 0 && buckets[i] < bucket*base { + // The next bucket we want to include is at least bucket*base. + continue + } else if bucket < 0 && buckets[i] < bucket/base { + // In this case the bucket we're targeting is negative, and since + // we're ascending through buckets here, we need to divide to get + // closer to zero exponentially. + continue + } + // The +Inf bucket will always be the last one, and we'll always + // end up including it here because bucket + newBuckets = append(newBuckets, bucket) + bucket = buckets[i] + } + return append(newBuckets, bucket) +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/internal/metric.go b/vendor/github.com/prometheus/client_golang/prometheus/internal/metric.go index 351c26e1ae..6515c11480 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/internal/metric.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/internal/metric.go @@ -19,18 +19,34 @@ import ( dto "github.com/prometheus/client_model/go" ) -// metricSorter is a sortable slice of *dto.Metric. -type metricSorter []*dto.Metric +// LabelPairSorter implements sort.Interface. It is used to sort a slice of +// dto.LabelPair pointers. +type LabelPairSorter []*dto.LabelPair -func (s metricSorter) Len() int { +func (s LabelPairSorter) Len() int { return len(s) } -func (s metricSorter) Swap(i, j int) { +func (s LabelPairSorter) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s metricSorter) Less(i, j int) bool { +func (s LabelPairSorter) Less(i, j int) bool { + return s[i].GetName() < s[j].GetName() +} + +// MetricSorter is a sortable slice of *dto.Metric. +type MetricSorter []*dto.Metric + +func (s MetricSorter) Len() int { + return len(s) +} + +func (s MetricSorter) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} + +func (s MetricSorter) Less(i, j int) bool { if len(s[i].Label) != len(s[j].Label) { // This should not happen. The metrics are // inconsistent. However, we have to deal with the fact, as @@ -68,7 +84,7 @@ func (s metricSorter) Less(i, j int) bool { // the slice, with the contained Metrics sorted within each MetricFamily. func NormalizeMetricFamilies(metricFamiliesByName map[string]*dto.MetricFamily) []*dto.MetricFamily { for _, mf := range metricFamiliesByName { - sort.Sort(metricSorter(mf.Metric)) + sort.Sort(MetricSorter(mf.Metric)) } names := make([]string, 0, len(metricFamiliesByName)) for name, mf := range metricFamiliesByName { diff --git a/vendor/github.com/prometheus/client_golang/prometheus/labels.go b/vendor/github.com/prometheus/client_golang/prometheus/labels.go index 2744443ac2..c21911f292 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/labels.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/labels.go @@ -25,12 +25,111 @@ import ( // Labels represents a collection of label name -> value mappings. This type is // commonly used with the With(Labels) and GetMetricWith(Labels) methods of // metric vector Collectors, e.g.: -// myVec.With(Labels{"code": "404", "method": "GET"}).Add(42) +// +// myVec.With(Labels{"code": "404", "method": "GET"}).Add(42) // // The other use-case is the specification of constant label pairs in Opts or to // create a Desc. type Labels map[string]string +// LabelConstraint normalizes label values. +type LabelConstraint func(string) string + +// ConstrainedLabels represents a label name and its constrain function +// to normalize label values. This type is commonly used when constructing +// metric vector Collectors. +type ConstrainedLabel struct { + Name string + Constraint LabelConstraint +} + +// ConstrainableLabels is an interface that allows creating of labels that can +// be optionally constrained. +// +// prometheus.V2().NewCounterVec(CounterVecOpts{ +// CounterOpts: {...}, // Usual CounterOpts fields +// VariableLabels: []ConstrainedLabels{ +// {Name: "A"}, +// {Name: "B", Constraint: func(v string) string { ... }}, +// }, +// }) +type ConstrainableLabels interface { + compile() *compiledLabels + labelNames() []string +} + +// ConstrainedLabels represents a collection of label name -> constrain function +// to normalize label values. This type is commonly used when constructing +// metric vector Collectors. +type ConstrainedLabels []ConstrainedLabel + +func (cls ConstrainedLabels) compile() *compiledLabels { + compiled := &compiledLabels{ + names: make([]string, len(cls)), + labelConstraints: map[string]LabelConstraint{}, + } + + for i, label := range cls { + compiled.names[i] = label.Name + if label.Constraint != nil { + compiled.labelConstraints[label.Name] = label.Constraint + } + } + + return compiled +} + +func (cls ConstrainedLabels) labelNames() []string { + names := make([]string, len(cls)) + for i, label := range cls { + names[i] = label.Name + } + return names +} + +// UnconstrainedLabels represents collection of label without any constraint on +// their value. Thus, it is simply a collection of label names. +// +// UnconstrainedLabels([]string{ "A", "B" }) +// +// is equivalent to +// +// ConstrainedLabels { +// { Name: "A" }, +// { Name: "B" }, +// } +type UnconstrainedLabels []string + +func (uls UnconstrainedLabels) compile() *compiledLabels { + return &compiledLabels{ + names: uls, + } +} + +func (uls UnconstrainedLabels) labelNames() []string { + return uls +} + +type compiledLabels struct { + names []string + labelConstraints map[string]LabelConstraint +} + +func (cls *compiledLabels) compile() *compiledLabels { + return cls +} + +func (cls *compiledLabels) labelNames() []string { + return cls.names +} + +func (cls *compiledLabels) constrain(labelName, value string) string { + if fn, ok := cls.labelConstraints[labelName]; ok && fn != nil { + return fn(value) + } + return value +} + // reservedLabelPrefix is a prefix which is not legal in user-supplied // label names. const reservedLabelPrefix = "__" @@ -39,7 +138,7 @@ var errInconsistentCardinality = errors.New("inconsistent label cardinality") func makeInconsistentCardinalityError(fqName string, labels, labelValues []string) error { return fmt.Errorf( - "%s: %q has %d variable labels named %q but %d values %q were provided", + "%w: %q has %d variable labels named %q but %d values %q were provided", errInconsistentCardinality, fqName, len(labels), labels, len(labelValues), labelValues, @@ -49,7 +148,7 @@ func makeInconsistentCardinalityError(fqName string, labels, labelValues []strin func validateValuesInLabels(labels Labels, expectedNumberOfValues int) error { if len(labels) != expectedNumberOfValues { return fmt.Errorf( - "%s: expected %d label values but got %d in %#v", + "%w: expected %d label values but got %d in %#v", errInconsistentCardinality, expectedNumberOfValues, len(labels), labels, ) @@ -66,8 +165,10 @@ func validateValuesInLabels(labels Labels, expectedNumberOfValues int) error { func validateLabelValues(vals []string, expectedNumberOfValues int) error { if len(vals) != expectedNumberOfValues { + // The call below makes vals escape, copy them to avoid that. + vals := append([]string(nil), vals...) return fmt.Errorf( - "%s: expected %d label values but got %d in %#v", + "%w: expected %d label values but got %d in %#v", errInconsistentCardinality, expectedNumberOfValues, len(vals), vals, ) diff --git a/vendor/github.com/prometheus/client_golang/prometheus/metric.go b/vendor/github.com/prometheus/client_golang/prometheus/metric.go index dc121910a5..9d9b81ab44 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/metric.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/metric.go @@ -14,14 +14,15 @@ package prometheus import ( + "errors" + "math" + "sort" "strings" "time" - //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/golang/protobuf/proto" - "github.com/prometheus/common/model" - dto "github.com/prometheus/client_model/go" + "github.com/prometheus/common/model" + "google.golang.org/protobuf/proto" ) var separatorByteSlice = []byte{model.SeparatorByte} // For convenient use with xxhash. @@ -91,6 +92,9 @@ type Opts struct { // machine_role metric). See also // https://prometheus.io/docs/instrumenting/writing_exporters/#target-labels-not-static-scraped-labels ConstLabels Labels + + // now is for testing purposes, by default it's time.Now. + now func() time.Time } // BuildFQName joins the given three name components by "_". Empty name @@ -115,22 +119,6 @@ func BuildFQName(namespace, subsystem, name string) string { return name } -// labelPairSorter implements sort.Interface. It is used to sort a slice of -// dto.LabelPair pointers. -type labelPairSorter []*dto.LabelPair - -func (s labelPairSorter) Len() int { - return len(s) -} - -func (s labelPairSorter) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} - -func (s labelPairSorter) Less(i, j int) bool { - return s[i].GetName() < s[j].GetName() -} - type invalidMetric struct { desc *Desc err error @@ -174,3 +162,96 @@ func (m timestampedMetric) Write(pb *dto.Metric) error { func NewMetricWithTimestamp(t time.Time, m Metric) Metric { return timestampedMetric{Metric: m, t: t} } + +type withExemplarsMetric struct { + Metric + + exemplars []*dto.Exemplar +} + +func (m *withExemplarsMetric) Write(pb *dto.Metric) error { + if err := m.Metric.Write(pb); err != nil { + return err + } + + switch { + case pb.Counter != nil: + pb.Counter.Exemplar = m.exemplars[len(m.exemplars)-1] + case pb.Histogram != nil: + for _, e := range m.exemplars { + // pb.Histogram.Bucket are sorted by UpperBound. + i := sort.Search(len(pb.Histogram.Bucket), func(i int) bool { + return pb.Histogram.Bucket[i].GetUpperBound() >= e.GetValue() + }) + if i < len(pb.Histogram.Bucket) { + pb.Histogram.Bucket[i].Exemplar = e + } else { + // The +Inf bucket should be explicitly added if there is an exemplar for it, similar to non-const histogram logic in https://github.com/prometheus/client_golang/blob/main/prometheus/histogram.go#L357-L365. + b := &dto.Bucket{ + CumulativeCount: proto.Uint64(pb.Histogram.GetSampleCount()), + UpperBound: proto.Float64(math.Inf(1)), + Exemplar: e, + } + pb.Histogram.Bucket = append(pb.Histogram.Bucket, b) + } + } + default: + // TODO(bwplotka): Implement Gauge? + return errors.New("cannot inject exemplar into Gauge, Summary or Untyped") + } + + return nil +} + +// Exemplar is easier to use, user-facing representation of *dto.Exemplar. +type Exemplar struct { + Value float64 + Labels Labels + // Optional. + // Default value (time.Time{}) indicates its empty, which should be + // understood as time.Now() time at the moment of creation of metric. + Timestamp time.Time +} + +// NewMetricWithExemplars returns a new Metric wrapping the provided Metric with given +// exemplars. Exemplars are validated. +// +// Only last applicable exemplar is injected from the list. +// For example for Counter it means last exemplar is injected. +// For Histogram, it means last applicable exemplar for each bucket is injected. +// +// NewMetricWithExemplars works best with MustNewConstMetric and +// MustNewConstHistogram, see example. +func NewMetricWithExemplars(m Metric, exemplars ...Exemplar) (Metric, error) { + if len(exemplars) == 0 { + return nil, errors.New("no exemplar was passed for NewMetricWithExemplars") + } + + var ( + now = time.Now() + exs = make([]*dto.Exemplar, len(exemplars)) + err error + ) + for i, e := range exemplars { + ts := e.Timestamp + if ts.IsZero() { + ts = now + } + exs[i], err = newExemplar(e.Value, ts, e.Labels) + if err != nil { + return nil, err + } + } + + return &withExemplarsMetric{Metric: m, exemplars: exs}, nil +} + +// MustNewMetricWithExemplars is a version of NewMetricWithExemplars that panics where +// NewMetricWithExemplars would have returned an error. +func MustNewMetricWithExemplars(m Metric, exemplars ...Exemplar) Metric { + ret, err := NewMetricWithExemplars(m, exemplars...) + if err != nil { + panic(err) + } + return ret +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/num_threads.go b/vendor/github.com/prometheus/client_golang/prometheus/num_threads.go new file mode 100644 index 0000000000..7c12b21087 --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/num_threads.go @@ -0,0 +1,25 @@ +// Copyright 2018 The Prometheus 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:build !js || wasm +// +build !js wasm + +package prometheus + +import "runtime" + +// getRuntimeNumThreads returns the number of open OS threads. +func getRuntimeNumThreads() float64 { + n, _ := runtime.ThreadCreateProfile(nil) + return float64(n) +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/num_threads_gopherjs.go b/vendor/github.com/prometheus/client_golang/prometheus/num_threads_gopherjs.go new file mode 100644 index 0000000000..7348df01df --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/num_threads_gopherjs.go @@ -0,0 +1,22 @@ +// Copyright 2018 The Prometheus 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:build js && !wasm +// +build js,!wasm + +package prometheus + +// getRuntimeNumThreads returns the number of open OS threads. +func getRuntimeNumThreads() float64 { + return 1 +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/observer.go b/vendor/github.com/prometheus/client_golang/prometheus/observer.go index 44128016fd..03773b21f7 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/observer.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/observer.go @@ -58,7 +58,7 @@ type ObserverVec interface { // current time as timestamp, and the provided Labels. Empty Labels will lead to // a valid (label-less) exemplar. But if Labels is nil, the current exemplar is // left in place. ObserveWithExemplar panics if any of the provided labels are -// invalid or if the provided labels contain more than 64 runes in total. +// invalid or if the provided labels contain more than 128 runes in total. type ExemplarObserver interface { ObserveWithExemplar(value float64, exemplar Labels) } diff --git a/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go b/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go index 5bfe0ff5bb..efbc3ea8fb 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go @@ -16,21 +16,21 @@ package prometheus import ( "errors" "fmt" - "io/ioutil" "os" "strconv" "strings" ) type processCollector struct { - collectFn func(chan<- Metric) - pidFn func() (int, error) - reportErrors bool - cpuTotal *Desc - openFDs, maxFDs *Desc - vsize, maxVsize *Desc - rss *Desc - startTime *Desc + collectFn func(chan<- Metric) + pidFn func() (int, error) + reportErrors bool + cpuTotal *Desc + openFDs, maxFDs *Desc + vsize, maxVsize *Desc + rss *Desc + startTime *Desc + inBytes, outBytes *Desc } // ProcessCollectorOpts defines the behavior of a process metrics collector @@ -101,11 +101,20 @@ func NewProcessCollector(opts ProcessCollectorOpts) Collector { "Start time of the process since unix epoch in seconds.", nil, nil, ), + inBytes: NewDesc( + ns+"process_network_receive_bytes_total", + "Number of bytes received by the process over the network.", + nil, nil, + ), + outBytes: NewDesc( + ns+"process_network_transmit_bytes_total", + "Number of bytes sent by the process over the network.", + nil, nil, + ), } if opts.PidFn == nil { - pid := os.Getpid() - c.pidFn = func() (int, error) { return pid, nil } + c.pidFn = getPIDFn() } else { c.pidFn = opts.PidFn } @@ -152,13 +161,13 @@ func (c *processCollector) reportError(ch chan<- Metric, desc *Desc, err error) // It is meant to be used for the PidFn field in ProcessCollectorOpts. func NewPidFileFn(pidFilePath string) func() (int, error) { return func() (int, error) { - content, err := ioutil.ReadFile(pidFilePath) + content, err := os.ReadFile(pidFilePath) if err != nil { - return 0, fmt.Errorf("can't read pid file %q: %+v", pidFilePath, err) + return 0, fmt.Errorf("can't read pid file %q: %w", pidFilePath, err) } pid, err := strconv.Atoi(strings.TrimSpace(string(content))) if err != nil { - return 0, fmt.Errorf("can't parse pid file %q: %+v", pidFilePath, err) + return 0, fmt.Errorf("can't parse pid file %q: %w", pidFilePath, err) } return pid, nil diff --git a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_js.go b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_js.go new file mode 100644 index 0000000000..b1e363d6cf --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_js.go @@ -0,0 +1,26 @@ +// Copyright 2019 The Prometheus 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:build js +// +build js + +package prometheus + +func canCollectProcess() bool { + return false +} + +func (c *processCollector) processCollect(ch chan<- Metric) { + // noop on this platform + return +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_other.go b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_other.go index 3117461cde..14d56d2d06 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_other.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_other.go @@ -11,7 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build !windows +//go:build !windows && !js && !wasip1 +// +build !windows,!js,!wasip1 package prometheus @@ -62,4 +63,18 @@ func (c *processCollector) processCollect(ch chan<- Metric) { } else { c.reportError(ch, nil, err) } + + if netstat, err := p.Netstat(); err == nil { + var inOctets, outOctets float64 + if netstat.IpExt.InOctets != nil { + inOctets = *netstat.IpExt.InOctets + } + if netstat.IpExt.OutOctets != nil { + outOctets = *netstat.IpExt.OutOctets + } + ch <- MustNewConstMetric(c.inBytes, CounterValue, inOctets) + ch <- MustNewConstMetric(c.outBytes, CounterValue, outOctets) + } else { + c.reportError(ch, nil, err) + } } diff --git a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_wasip1.go b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_wasip1.go new file mode 100644 index 0000000000..d8d9a6d7a2 --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_wasip1.go @@ -0,0 +1,26 @@ +// Copyright 2023 The Prometheus 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:build wasip1 +// +build wasip1 + +package prometheus + +func canCollectProcess() bool { + return false +} + +func (*processCollector) processCollect(chan<- Metric) { + // noop on this platform + return +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/delegator.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/delegator.go index e7c0d05464..315eab5f17 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/delegator.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/delegator.go @@ -76,16 +76,25 @@ func (r *responseWriterDelegator) Write(b []byte) (int, error) { return n, err } -type closeNotifierDelegator struct{ *responseWriterDelegator } -type flusherDelegator struct{ *responseWriterDelegator } -type hijackerDelegator struct{ *responseWriterDelegator } -type readerFromDelegator struct{ *responseWriterDelegator } -type pusherDelegator struct{ *responseWriterDelegator } +// Unwrap lets http.ResponseController get the underlying http.ResponseWriter, +// by implementing the [rwUnwrapper](https://cs.opensource.google/go/go/+/refs/tags/go1.21.4:src/net/http/responsecontroller.go;l=42-44) interface. +func (r *responseWriterDelegator) Unwrap() http.ResponseWriter { + return r.ResponseWriter +} + +type ( + closeNotifierDelegator struct{ *responseWriterDelegator } + flusherDelegator struct{ *responseWriterDelegator } + hijackerDelegator struct{ *responseWriterDelegator } + readerFromDelegator struct{ *responseWriterDelegator } + pusherDelegator struct{ *responseWriterDelegator } +) func (d closeNotifierDelegator) CloseNotify() <-chan bool { //nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users. return d.ResponseWriter.(http.CloseNotifier).CloseNotify() } + func (d flusherDelegator) Flush() { // If applicable, call WriteHeader here so that observeWriteHeader is // handled appropriately. @@ -94,9 +103,11 @@ func (d flusherDelegator) Flush() { } d.ResponseWriter.(http.Flusher).Flush() } + func (d hijackerDelegator) Hijack() (net.Conn, *bufio.ReadWriter, error) { return d.ResponseWriter.(http.Hijacker).Hijack() } + func (d readerFromDelegator) ReadFrom(re io.Reader) (int64, error) { // If applicable, call WriteHeader here so that observeWriteHeader is // handled appropriately. @@ -107,6 +118,7 @@ func (d readerFromDelegator) ReadFrom(re io.Reader) (int64, error) { d.written += n return n, err } + func (d pusherDelegator) Push(target string, opts *http.PushOptions) error { return d.ResponseWriter.(http.Pusher).Push(target, opts) } @@ -261,7 +273,7 @@ func init() { http.Flusher }{d, pusherDelegator{d}, hijackerDelegator{d}, flusherDelegator{d}} } - pickDelegator[pusher+hijacker+flusher+closeNotifier] = func(d *responseWriterDelegator) delegator { //23 + pickDelegator[pusher+hijacker+flusher+closeNotifier] = func(d *responseWriterDelegator) delegator { // 23 return struct { *responseWriterDelegator http.Pusher diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go index d86d0cf4b0..2e0b9a8648 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go @@ -33,24 +33,40 @@ package promhttp import ( "compress/gzip" + "errors" "fmt" "io" "net/http" - "strings" + "strconv" "sync" "time" + "github.com/klauspost/compress/zstd" "github.com/prometheus/common/expfmt" + "github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil" "github.com/prometheus/client_golang/prometheus" ) const ( - contentTypeHeader = "Content-Type" - contentEncodingHeader = "Content-Encoding" - acceptEncodingHeader = "Accept-Encoding" + contentTypeHeader = "Content-Type" + contentEncodingHeader = "Content-Encoding" + acceptEncodingHeader = "Accept-Encoding" + processStartTimeHeader = "Process-Start-Time-Unix" ) +// Compression represents the content encodings handlers support for the HTTP +// responses. +type Compression string + +const ( + Identity Compression = "identity" + Gzip Compression = "gzip" + Zstd Compression = "zstd" +) + +var defaultCompressionFormats = []Compression{Identity, Gzip, Zstd} + var gzipPool = sync.Pool{ New: func() interface{} { return gzip.NewWriter(nil) @@ -84,6 +100,13 @@ func Handler() http.Handler { // instrumentation. Use the InstrumentMetricHandler function to apply the same // kind of instrumentation as it is used by the Handler function. func HandlerFor(reg prometheus.Gatherer, opts HandlerOpts) http.Handler { + return HandlerForTransactional(prometheus.ToTransactionalGatherer(reg), opts) +} + +// HandlerForTransactional is like HandlerFor, but it uses transactional gather, which +// can safely change in-place returned *dto.MetricFamily before call to `Gather` and after +// call to `done` of that `Gather`. +func HandlerForTransactional(reg prometheus.TransactionalGatherer, opts HandlerOpts) http.Handler { var ( inFlightSem chan struct{} errCnt = prometheus.NewCounterVec( @@ -103,7 +126,8 @@ func HandlerFor(reg prometheus.Gatherer, opts HandlerOpts) http.Handler { errCnt.WithLabelValues("gathering") errCnt.WithLabelValues("encoding") if err := opts.Registry.Register(errCnt); err != nil { - if are, ok := err.(prometheus.AlreadyRegisteredError); ok { + are := &prometheus.AlreadyRegisteredError{} + if errors.As(err, are) { errCnt = are.ExistingCollector.(*prometheus.CounterVec) } else { panic(err) @@ -111,7 +135,22 @@ func HandlerFor(reg prometheus.Gatherer, opts HandlerOpts) http.Handler { } } + // Select compression formats to offer based on default or user choice. + var compressions []string + if !opts.DisableCompression { + offers := defaultCompressionFormats + if len(opts.OfferedCompressions) > 0 { + offers = opts.OfferedCompressions + } + for _, comp := range offers { + compressions = append(compressions, string(comp)) + } + } + h := http.HandlerFunc(func(rsp http.ResponseWriter, req *http.Request) { + if !opts.ProcessStartTime.IsZero() { + rsp.Header().Set(processStartTimeHeader, strconv.FormatInt(opts.ProcessStartTime.Unix(), 10)) + } if inFlightSem != nil { select { case inFlightSem <- struct{}{}: // All good, carry on. @@ -123,7 +162,8 @@ func HandlerFor(reg prometheus.Gatherer, opts HandlerOpts) http.Handler { return } } - mfs, err := reg.Gather() + mfs, done, err := reg.Gather() + defer done() if err != nil { if opts.ErrorLog != nil { opts.ErrorLog.Println("error gathering metrics:", err) @@ -150,20 +190,20 @@ func HandlerFor(reg prometheus.Gatherer, opts HandlerOpts) http.Handler { } else { contentType = expfmt.Negotiate(req.Header) } - header := rsp.Header() - header.Set(contentTypeHeader, string(contentType)) + rsp.Header().Set(contentTypeHeader, string(contentType)) - w := io.Writer(rsp) - if !opts.DisableCompression && gzipAccepted(req.Header) { - header.Set(contentEncodingHeader, "gzip") - gz := gzipPool.Get().(*gzip.Writer) - defer gzipPool.Put(gz) + w, encodingHeader, closeWriter, err := negotiateEncodingWriter(req, rsp, compressions) + if err != nil { + if opts.ErrorLog != nil { + opts.ErrorLog.Println("error getting writer", err) + } + w = io.Writer(rsp) + encodingHeader = string(Identity) + } - gz.Reset(w) - defer gz.Close() + defer closeWriter() - w = gz - } + rsp.Header().Set(contentEncodingHeader, encodingHeader) enc := expfmt.NewEncoder(w, contentType) @@ -242,7 +282,8 @@ func InstrumentMetricHandler(reg prometheus.Registerer, handler http.Handler) ht cnt.WithLabelValues("500") cnt.WithLabelValues("503") if err := reg.Register(cnt); err != nil { - if are, ok := err.(prometheus.AlreadyRegisteredError); ok { + are := &prometheus.AlreadyRegisteredError{} + if errors.As(err, are) { cnt = are.ExistingCollector.(*prometheus.CounterVec) } else { panic(err) @@ -254,7 +295,8 @@ func InstrumentMetricHandler(reg prometheus.Registerer, handler http.Handler) ht Help: "Current number of scrapes being served.", }) if err := reg.Register(gge); err != nil { - if are, ok := err.(prometheus.AlreadyRegisteredError); ok { + are := &prometheus.AlreadyRegisteredError{} + if errors.As(err, are) { gge = are.ExistingCollector.(prometheus.Gauge) } else { panic(err) @@ -326,9 +368,19 @@ type HandlerOpts struct { // no effect on the HTTP status code because ErrorHandling is set to // ContinueOnError. Registry prometheus.Registerer - // If DisableCompression is true, the handler will never compress the - // response, even if requested by the client. + // DisableCompression disables the response encoding (compression) and + // encoding negotiation. If true, the handler will + // never compress the response, even if requested + // by the client and the OfferedCompressions field is set. DisableCompression bool + // OfferedCompressions is a set of encodings (compressions) handler will + // try to offer when negotiating with the client. This defaults to identity, gzip + // and zstd. + // NOTE: If handler can't agree with the client on the encodings or + // unsupported or empty encodings are set in OfferedCompressions, + // handler always fallbacks to no compression (identity), for + // compatibility reasons. In such cases ErrorLog will be used if set. + OfferedCompressions []Compression // The number of concurrent HTTP requests is limited to // MaxRequestsInFlight. Additional requests are responded to with 503 // Service Unavailable and a suitable message in the body. If @@ -354,19 +406,14 @@ type HandlerOpts struct { // (which changes the identity of the resulting series on the Prometheus // server). EnableOpenMetrics bool -} - -// gzipAccepted returns whether the client will accept gzip-encoded content. -func gzipAccepted(header http.Header) bool { - a := header.Get(acceptEncodingHeader) - parts := strings.Split(a, ",") - for _, part := range parts { - part = strings.TrimSpace(part) - if part == "gzip" || strings.HasPrefix(part, "gzip;") { - return true - } - } - return false + // ProcessStartTime allows setting process start timevalue that will be exposed + // with "Process-Start-Time-Unix" response header along with the metrics + // payload. This allow callers to have efficient transformations to cumulative + // counters (e.g. OpenTelemetry) or generally _created timestamp estimation per + // scrape target. + // NOTE: This feature is experimental and not covered by OpenMetrics or Prometheus + // exposition format. + ProcessStartTime time.Time } // httpError removes any content-encoding header and then calls http.Error with @@ -381,3 +428,38 @@ func httpError(rsp http.ResponseWriter, err error) { http.StatusInternalServerError, ) } + +// negotiateEncodingWriter reads the Accept-Encoding header from a request and +// selects the right compression based on an allow-list of supported +// compressions. It returns a writer implementing the compression and an the +// correct value that the caller can set in the response header. +func negotiateEncodingWriter(r *http.Request, rw io.Writer, compressions []string) (_ io.Writer, encodingHeaderValue string, closeWriter func(), _ error) { + if len(compressions) == 0 { + return rw, string(Identity), func() {}, nil + } + + // TODO(mrueg): Replace internal/github.com/gddo once https://github.com/golang/go/issues/19307 is implemented. + selected := httputil.NegotiateContentEncoding(r, compressions) + + switch selected { + case "zstd": + // TODO(mrueg): Replace klauspost/compress with stdlib implementation once https://github.com/golang/go/issues/62513 is implemented. + z, err := zstd.NewWriter(rw, zstd.WithEncoderLevel(zstd.SpeedFastest)) + if err != nil { + return nil, "", func() {}, err + } + + z.Reset(rw) + return z, selected, func() { _ = z.Close() }, nil + case "gzip": + gz := gzipPool.Get().(*gzip.Writer) + gz.Reset(rw) + return gz, selected, func() { _ = gz.Close(); gzipPool.Put(gz) }, nil + case "identity": + // This means the content is not compressed. + return rw, selected, func() {}, nil + default: + // The content encoding was not implemented yet. + return nil, "", func() {}, fmt.Errorf("content compression format not recognized: %s. Valid formats are: %s", selected, defaultCompressionFormats) + } +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go index 861b4d21ca..d3482c40ca 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go @@ -38,11 +38,11 @@ func (rt RoundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) { // // See the example for ExampleInstrumentRoundTripperDuration for example usage. func InstrumentRoundTripperInFlight(gauge prometheus.Gauge, next http.RoundTripper) RoundTripperFunc { - return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { + return func(r *http.Request) (*http.Response, error) { gauge.Inc() defer gauge.Dec() return next.RoundTrip(r) - }) + } } // InstrumentRoundTripperCounter is a middleware that wraps the provided @@ -59,22 +59,29 @@ func InstrumentRoundTripperInFlight(gauge prometheus.Gauge, next http.RoundTripp // If the wrapped RoundTripper panics or returns a non-nil error, the Counter // is not incremented. // +// Use with WithExemplarFromContext to instrument the exemplars on the counter of requests. +// // See the example for ExampleInstrumentRoundTripperDuration for example usage. func InstrumentRoundTripperCounter(counter *prometheus.CounterVec, next http.RoundTripper, opts ...Option) RoundTripperFunc { - rtOpts := &option{} + rtOpts := defaultOptions() for _, o := range opts { - o(rtOpts) + o.apply(rtOpts) } - code, method := checkLabels(counter) + // Curry the counter with dynamic labels before checking the remaining labels. + code, method := checkLabels(counter.MustCurryWith(rtOpts.emptyDynamicLabels())) - return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { + return func(r *http.Request) (*http.Response, error) { resp, err := next.RoundTrip(r) if err == nil { - counter.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)).Inc() + l := labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...) + for label, resolve := range rtOpts.extraLabelsFromCtx { + l[label] = resolve(resp.Request.Context()) + } + addWithExemplar(counter.With(l), 1, rtOpts.getExemplarFn(r.Context())) } return resp, err - }) + } } // InstrumentRoundTripperDuration is a middleware that wraps the provided @@ -94,24 +101,31 @@ func InstrumentRoundTripperCounter(counter *prometheus.CounterVec, next http.Rou // If the wrapped RoundTripper panics or returns a non-nil error, no values are // reported. // +// Use with WithExemplarFromContext to instrument the exemplars on the duration histograms. +// // Note that this method is only guaranteed to never observe negative durations // if used with Go1.9+. func InstrumentRoundTripperDuration(obs prometheus.ObserverVec, next http.RoundTripper, opts ...Option) RoundTripperFunc { - rtOpts := &option{} + rtOpts := defaultOptions() for _, o := range opts { - o(rtOpts) + o.apply(rtOpts) } - code, method := checkLabels(obs) + // Curry the observer with dynamic labels before checking the remaining labels. + code, method := checkLabels(obs.MustCurryWith(rtOpts.emptyDynamicLabels())) - return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { + return func(r *http.Request) (*http.Response, error) { start := time.Now() resp, err := next.RoundTrip(r) if err == nil { - obs.With(labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)).Observe(time.Since(start).Seconds()) + l := labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...) + for label, resolve := range rtOpts.extraLabelsFromCtx { + l[label] = resolve(resp.Request.Context()) + } + observeWithExemplar(obs.With(l), time.Since(start).Seconds(), rtOpts.getExemplarFn(r.Context())) } return resp, err - }) + } } // InstrumentTrace is used to offer flexibility in instrumenting the available @@ -149,7 +163,7 @@ type InstrumentTrace struct { // // See the example for ExampleInstrumentRoundTripperDuration for example usage. func InstrumentRoundTripperTrace(it *InstrumentTrace, next http.RoundTripper) RoundTripperFunc { - return RoundTripperFunc(func(r *http.Request) (*http.Response, error) { + return func(r *http.Request) (*http.Response, error) { start := time.Now() trace := &httptrace.ClientTrace{ @@ -231,5 +245,5 @@ func InstrumentRoundTripperTrace(it *InstrumentTrace, next http.RoundTripper) Ro r = r.WithContext(httptrace.WithClientTrace(r.Context(), trace)) return next.RoundTrip(r) - }) + } } diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go index a23f0edc6f..356edb7868 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go @@ -28,6 +28,26 @@ import ( // magicString is used for the hacky label test in checkLabels. Remove once fixed. const magicString = "zZgWfBxLqvG8kc8IMv3POi2Bb0tZI3vAnBx+gBaFi9FyPzB/CzKUer1yufDa" +// observeWithExemplar is a wrapper for [prometheus.ExemplarAdder.ExemplarObserver], +// which falls back to [prometheus.Observer.Observe] if no labels are provided. +func observeWithExemplar(obs prometheus.Observer, val float64, labels map[string]string) { + if labels == nil { + obs.Observe(val) + return + } + obs.(prometheus.ExemplarObserver).ObserveWithExemplar(val, labels) +} + +// addWithExemplar is a wrapper for [prometheus.ExemplarAdder.AddWithExemplar], +// which falls back to [prometheus.Counter.Add] if no labels are provided. +func addWithExemplar(obs prometheus.Counter, val float64, labels map[string]string) { + if labels == nil { + obs.Add(val) + return + } + obs.(prometheus.ExemplarAdder).AddWithExemplar(val, labels) +} + // InstrumentHandlerInFlight is a middleware that wraps the provided // http.Handler. It sets the provided prometheus.Gauge to the number of // requests currently handled by the wrapped http.Handler. @@ -48,7 +68,7 @@ func InstrumentHandlerInFlight(g prometheus.Gauge, next http.Handler) http.Handl // names are "code" and "method". The function panics otherwise. For the "method" // label a predefined default label value set is used to filter given values. // Values besides predefined values will count as `unknown` method. -//`WithExtraMethods` can be used to add more methods to the set. The Observe +// `WithExtraMethods` can be used to add more methods to the set. The Observe // method of the Observer in the ObserverVec is called with the request duration // in seconds. Partitioning happens by HTTP status code and/or HTTP method if // the respective instance label names are present in the ObserverVec. For @@ -62,28 +82,37 @@ func InstrumentHandlerInFlight(g prometheus.Gauge, next http.Handler) http.Handl // Note that this method is only guaranteed to never observe negative durations // if used with Go1.9+. func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.HandlerFunc { - mwOpts := &option{} + hOpts := defaultOptions() for _, o := range opts { - o(mwOpts) + o.apply(hOpts) } - code, method := checkLabels(obs) + // Curry the observer with dynamic labels before checking the remaining labels. + code, method := checkLabels(obs.MustCurryWith(hOpts.emptyDynamicLabels())) if code { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { now := time.Now() d := newDelegator(w, nil) next.ServeHTTP(d, r) - obs.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Observe(time.Since(now).Seconds()) - }) + l := labels(code, method, r.Method, d.Status(), hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + observeWithExemplar(obs.With(l), time.Since(now).Seconds(), hOpts.getExemplarFn(r.Context())) + } } - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { now := time.Now() next.ServeHTTP(w, r) - obs.With(labels(code, method, r.Method, 0, mwOpts.extraMethods...)).Observe(time.Since(now).Seconds()) - }) + l := labels(code, method, r.Method, 0, hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + observeWithExemplar(obs.With(l), time.Since(now).Seconds(), hOpts.getExemplarFn(r.Context())) + } } // InstrumentHandlerCounter is a middleware that wraps the provided http.Handler @@ -104,25 +133,36 @@ func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler, op // // See the example for InstrumentHandlerDuration for example usage. func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler, opts ...Option) http.HandlerFunc { - mwOpts := &option{} + hOpts := defaultOptions() for _, o := range opts { - o(mwOpts) + o.apply(hOpts) } - code, method := checkLabels(counter) + // Curry the counter with dynamic labels before checking the remaining labels. + code, method := checkLabels(counter.MustCurryWith(hOpts.emptyDynamicLabels())) if code { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { d := newDelegator(w, nil) next.ServeHTTP(d, r) - counter.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Inc() - }) + + l := labels(code, method, r.Method, d.Status(), hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + addWithExemplar(counter.With(l), 1, hOpts.getExemplarFn(r.Context())) + } } - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { next.ServeHTTP(w, r) - counter.With(labels(code, method, r.Method, 0, mwOpts.extraMethods...)).Inc() - }) + + l := labels(code, method, r.Method, 0, hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + addWithExemplar(counter.With(l), 1, hOpts.getExemplarFn(r.Context())) + } } // InstrumentHandlerTimeToWriteHeader is a middleware that wraps the provided @@ -148,20 +188,25 @@ func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler, // // See the example for InstrumentHandlerDuration for example usage. func InstrumentHandlerTimeToWriteHeader(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.HandlerFunc { - mwOpts := &option{} + hOpts := defaultOptions() for _, o := range opts { - o(mwOpts) + o.apply(hOpts) } - code, method := checkLabels(obs) + // Curry the observer with dynamic labels before checking the remaining labels. + code, method := checkLabels(obs.MustCurryWith(hOpts.emptyDynamicLabels())) - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { now := time.Now() d := newDelegator(w, func(status int) { - obs.With(labels(code, method, r.Method, status, mwOpts.extraMethods...)).Observe(time.Since(now).Seconds()) + l := labels(code, method, r.Method, status, hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + observeWithExemplar(obs.With(l), time.Since(now).Seconds(), hOpts.getExemplarFn(r.Context())) }) next.ServeHTTP(d, r) - }) + } } // InstrumentHandlerRequestSize is a middleware that wraps the provided @@ -184,27 +229,38 @@ func InstrumentHandlerTimeToWriteHeader(obs prometheus.ObserverVec, next http.Ha // // See the example for InstrumentHandlerDuration for example usage. func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.HandlerFunc { - mwOpts := &option{} + hOpts := defaultOptions() for _, o := range opts { - o(mwOpts) + o.apply(hOpts) } - code, method := checkLabels(obs) + // Curry the observer with dynamic labels before checking the remaining labels. + code, method := checkLabels(obs.MustCurryWith(hOpts.emptyDynamicLabels())) if code { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { d := newDelegator(w, nil) next.ServeHTTP(d, r) size := computeApproximateRequestSize(r) - obs.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Observe(float64(size)) - }) + + l := labels(code, method, r.Method, d.Status(), hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + observeWithExemplar(obs.With(l), float64(size), hOpts.getExemplarFn(r.Context())) + } } - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { next.ServeHTTP(w, r) size := computeApproximateRequestSize(r) - obs.With(labels(code, method, r.Method, 0, mwOpts.extraMethods...)).Observe(float64(size)) - }) + + l := labels(code, method, r.Method, 0, hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + observeWithExemplar(obs.With(l), float64(size), hOpts.getExemplarFn(r.Context())) + } } // InstrumentHandlerResponseSize is a middleware that wraps the provided @@ -227,17 +283,23 @@ func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler, // // See the example for InstrumentHandlerDuration for example usage. func InstrumentHandlerResponseSize(obs prometheus.ObserverVec, next http.Handler, opts ...Option) http.Handler { - mwOpts := &option{} + hOpts := defaultOptions() for _, o := range opts { - o(mwOpts) + o.apply(hOpts) } - code, method := checkLabels(obs) + // Curry the observer with dynamic labels before checking the remaining labels. + code, method := checkLabels(obs.MustCurryWith(hOpts.emptyDynamicLabels())) return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { d := newDelegator(w, nil) next.ServeHTTP(d, r) - obs.With(labels(code, method, r.Method, d.Status(), mwOpts.extraMethods...)).Observe(float64(d.Written())) + + l := labels(code, method, r.Method, d.Status(), hOpts.extraMethods...) + for label, resolve := range hOpts.extraLabelsFromCtx { + l[label] = resolve(r.Context()) + } + observeWithExemplar(obs.With(l), float64(d.Written()), hOpts.getExemplarFn(r.Context())) }) } @@ -246,7 +308,7 @@ func InstrumentHandlerResponseSize(obs prometheus.ObserverVec, next http.Handler // Collector does not have a Desc or has more than one Desc or its Desc is // invalid. It also panics if the Collector has any non-const, non-curried // labels that are not named "code" or "method". -func checkLabels(c prometheus.Collector) (code bool, method bool) { +func checkLabels(c prometheus.Collector) (code, method bool) { // TODO(beorn7): Remove this hacky way to check for instance labels // once Descriptors can have their dimensionality queried. var ( @@ -327,15 +389,12 @@ func isLabelCurried(c prometheus.Collector, label string) bool { return true } -// emptyLabels is a one-time allocation for non-partitioned metrics to avoid -// unnecessary allocations on each request. -var emptyLabels = prometheus.Labels{} - func labels(code, method bool, reqMethod string, status int, extraMethods ...string) prometheus.Labels { + labels := prometheus.Labels{} + if !(code || method) { - return emptyLabels + return labels } - labels := prometheus.Labels{} if code { labels["code"] = sanitizeCode(status) diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/option.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/option.go index 35e41bd1e6..5d4383aa14 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/option.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/option.go @@ -13,19 +13,72 @@ package promhttp -// Option are used to configure a middleware or round tripper.. -type Option func(*option) +import ( + "context" -type option struct { - extraMethods []string + "github.com/prometheus/client_golang/prometheus" +) + +// Option are used to configure both handler (middleware) or round tripper. +type Option interface { + apply(*options) +} + +// LabelValueFromCtx are used to compute the label value from request context. +// Context can be filled with values from request through middleware. +type LabelValueFromCtx func(ctx context.Context) string + +// options store options for both a handler or round tripper. +type options struct { + extraMethods []string + getExemplarFn func(requestCtx context.Context) prometheus.Labels + extraLabelsFromCtx map[string]LabelValueFromCtx +} + +func defaultOptions() *options { + return &options{ + getExemplarFn: func(ctx context.Context) prometheus.Labels { return nil }, + extraLabelsFromCtx: map[string]LabelValueFromCtx{}, + } } +func (o *options) emptyDynamicLabels() prometheus.Labels { + labels := prometheus.Labels{} + + for label := range o.extraLabelsFromCtx { + labels[label] = "" + } + + return labels +} + +type optionApplyFunc func(*options) + +func (o optionApplyFunc) apply(opt *options) { o(opt) } + // WithExtraMethods adds additional HTTP methods to the list of allowed methods. // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods for the default list. // // See the example for ExampleInstrumentHandlerWithExtraMethods for example usage. func WithExtraMethods(methods ...string) Option { - return func(o *option) { + return optionApplyFunc(func(o *options) { o.extraMethods = methods - } + }) +} + +// WithExemplarFromContext allows to inject function that will get exemplar from context that will be put to counter and histogram metrics. +// If the function returns nil labels or the metric does not support exemplars, no exemplar will be added (noop), but +// metric will continue to observe/increment. +func WithExemplarFromContext(getExemplarFn func(requestCtx context.Context) prometheus.Labels) Option { + return optionApplyFunc(func(o *options) { + o.getExemplarFn = getExemplarFn + }) +} + +// WithLabelFromCtx registers a label for dynamic resolution with access to context. +// See the example for ExampleInstrumentHandlerWithLabelResolver for example usage +func WithLabelFromCtx(name string, valueFn LabelValueFromCtx) Option { + return optionApplyFunc(func(o *options) { + o.extraLabelsFromCtx[name] = valueFn + }) } diff --git a/vendor/github.com/prometheus/client_golang/prometheus/registry.go b/vendor/github.com/prometheus/client_golang/prometheus/registry.go index 383a7f5941..c6fd2f58b7 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/registry.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/registry.go @@ -15,24 +15,23 @@ package prometheus import ( "bytes" + "errors" "fmt" - "io/ioutil" "os" "path/filepath" "runtime" "sort" + "strconv" "strings" "sync" "unicode/utf8" - "github.com/cespare/xxhash/v2" - //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/golang/protobuf/proto" - "github.com/prometheus/common/expfmt" + "github.com/prometheus/client_golang/prometheus/internal" + "github.com/cespare/xxhash/v2" dto "github.com/prometheus/client_model/go" - - "github.com/prometheus/client_golang/prometheus/internal" + "github.com/prometheus/common/expfmt" + "google.golang.org/protobuf/proto" ) const ( @@ -252,9 +251,12 @@ func (errs MultiError) MaybeUnwrap() error { } // Registry registers Prometheus collectors, collects their metrics, and gathers -// them into MetricFamilies for exposition. It implements both Registerer and -// Gatherer. The zero value is not usable. Create instances with NewRegistry or -// NewPedanticRegistry. +// them into MetricFamilies for exposition. It implements Registerer, Gatherer, +// and Collector. The zero value is not usable. Create instances with +// NewRegistry or NewPedanticRegistry. +// +// Registry implements Collector to allow it to be used for creating groups of +// metrics. See the Grouping example for how this can be done. type Registry struct { mtx sync.RWMutex collectorsByID map[uint64]Collector // ID is a hash of the descIDs. @@ -289,7 +291,7 @@ func (r *Registry) Register(c Collector) error { // Is the descriptor valid at all? if desc.err != nil { - return fmt.Errorf("descriptor %s is invalid: %s", desc, desc.err) + return fmt.Errorf("descriptor %s is invalid: %w", desc, desc.err) } // Is the descID unique? @@ -312,16 +314,17 @@ func (r *Registry) Register(c Collector) error { if dimHash != desc.dimHash { return fmt.Errorf("a previously registered descriptor with the same fully-qualified name as %s has different label names or a different help string", desc) } - } else { - // ...then check the new descriptors already seen. - if dimHash, exists := newDimHashesByName[desc.fqName]; exists { - if dimHash != desc.dimHash { - return fmt.Errorf("descriptors reported by collector have inconsistent label names or help strings for the same fully-qualified name, offender is %s", desc) - } - } else { - newDimHashesByName[desc.fqName] = desc.dimHash + continue + } + + // ...then check the new descriptors already seen. + if dimHash, exists := newDimHashesByName[desc.fqName]; exists { + if dimHash != desc.dimHash { + return fmt.Errorf("descriptors reported by collector have inconsistent label names or help strings for the same fully-qualified name, offender is %s", desc) } + continue } + newDimHashesByName[desc.fqName] = desc.dimHash } // A Collector yielding no Desc at all is considered unchecked. if len(newDescIDs) == 0 { @@ -407,6 +410,14 @@ func (r *Registry) MustRegister(cs ...Collector) { // Gather implements Gatherer. func (r *Registry) Gather() ([]*dto.MetricFamily, error) { + r.mtx.RLock() + + if len(r.collectorsByID) == 0 && len(r.uncheckedCollectors) == 0 { + // Fast path. + r.mtx.RUnlock() + return nil, nil + } + var ( checkedMetricChan = make(chan Metric, capMetricChan) uncheckedMetricChan = make(chan Metric, capMetricChan) @@ -416,7 +427,6 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) { registeredDescIDs map[uint64]struct{} // Only used for pedantic checks ) - r.mtx.RLock() goroutineBudget := len(r.collectorsByID) + len(r.uncheckedCollectors) metricFamiliesByName := make(map[string]*dto.MetricFamily, len(r.dimHashesByName)) checkedCollectors := make(chan Collector, len(r.collectorsByID)) @@ -539,7 +549,7 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) { goroutineBudget-- runtime.Gosched() } - // Once both checkedMetricChan and uncheckdMetricChan are closed + // Once both checkedMetricChan and uncheckedMetricChan are closed // and drained, the contraption above will nil out cmc and umc, // and then we can leave the collect loop here. if cmc == nil && umc == nil { @@ -549,6 +559,31 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) { return internal.NormalizeMetricFamilies(metricFamiliesByName), errs.MaybeUnwrap() } +// Describe implements Collector. +func (r *Registry) Describe(ch chan<- *Desc) { + r.mtx.RLock() + defer r.mtx.RUnlock() + + // Only report the checked Collectors; unchecked collectors don't report any + // Desc. + for _, c := range r.collectorsByID { + c.Describe(ch) + } +} + +// Collect implements Collector. +func (r *Registry) Collect(ch chan<- Metric) { + r.mtx.RLock() + defer r.mtx.RUnlock() + + for _, c := range r.collectorsByID { + c.Collect(ch) + } + for _, c := range r.uncheckedCollectors { + c.Collect(ch) + } +} + // WriteToTextfile calls Gather on the provided Gatherer, encodes the result in the // Prometheus text format, and writes it to a temporary file. Upon success, the // temporary file is renamed to the provided filename. @@ -556,7 +591,7 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) { // This is intended for use with the textfile collector of the node exporter. // Note that the node exporter expects the filename to be suffixed with ".prom". func WriteToTextfile(filename string, g Gatherer) error { - tmp, err := ioutil.TempFile(filepath.Dir(filename), filepath.Base(filename)) + tmp, err := os.CreateTemp(filepath.Dir(filename), filepath.Base(filename)) if err != nil { return err } @@ -575,7 +610,7 @@ func WriteToTextfile(filename string, g Gatherer) error { return err } - if err := os.Chmod(tmp.Name(), 0644); err != nil { + if err := os.Chmod(tmp.Name(), 0o644); err != nil { return err } return os.Rename(tmp.Name(), filename) @@ -596,7 +631,7 @@ func processMetric( } dtoMetric := &dto.Metric{} if err := metric.Write(dtoMetric); err != nil { - return fmt.Errorf("error collecting metric %v: %s", desc, err) + return fmt.Errorf("error collecting metric %v: %w", desc, err) } metricFamily, ok := metricFamiliesByName[desc.fqName] if ok { // Existing name. @@ -718,12 +753,13 @@ func (gs Gatherers) Gather() ([]*dto.MetricFamily, error) { for i, g := range gs { mfs, err := g.Gather() if err != nil { - if multiErr, ok := err.(MultiError); ok { + multiErr := MultiError{} + if errors.As(err, &multiErr) { for _, err := range multiErr { - errs = append(errs, fmt.Errorf("[from Gatherer #%d] %s", i+1, err)) + errs = append(errs, fmt.Errorf("[from Gatherer #%d] %w", i+1, err)) } } else { - errs = append(errs, fmt.Errorf("[from Gatherer #%d] %s", i+1, err)) + errs = append(errs, fmt.Errorf("[from Gatherer #%d] %w", i+1, err)) } } for _, mf := range mfs { @@ -884,11 +920,11 @@ func checkMetricConsistency( h.Write(separatorByteSlice) // Make sure label pairs are sorted. We depend on it for the consistency // check. - if !sort.IsSorted(labelPairSorter(dtoMetric.Label)) { + if !sort.IsSorted(internal.LabelPairSorter(dtoMetric.Label)) { // We cannot sort dtoMetric.Label in place as it is immutable by contract. copiedLabels := make([]*dto.LabelPair, len(dtoMetric.Label)) copy(copiedLabels, dtoMetric.Label) - sort.Sort(labelPairSorter(copiedLabels)) + sort.Sort(internal.LabelPairSorter(copiedLabels)) dtoMetric.Label = copiedLabels } for _, lp := range dtoMetric.Label { @@ -897,6 +933,10 @@ func checkMetricConsistency( h.WriteString(lp.GetValue()) h.Write(separatorByteSlice) } + if dtoMetric.TimestampMs != nil { + h.WriteString(strconv.FormatInt(*(dtoMetric.TimestampMs), 10)) + h.Write(separatorByteSlice) + } hSum := h.Sum64() if _, exists := metricHashes[hSum]; exists { return fmt.Errorf( @@ -924,7 +964,7 @@ func checkDescConsistency( // Is the desc consistent with the content of the metric? lpsFromDesc := make([]*dto.LabelPair, len(desc.constLabelPairs), len(dtoMetric.Label)) copy(lpsFromDesc, desc.constLabelPairs) - for _, l := range desc.variableLabels { + for _, l := range desc.variableLabels.names { lpsFromDesc = append(lpsFromDesc, &dto.LabelPair{ Name: proto.String(l), }) @@ -935,7 +975,7 @@ func checkDescConsistency( metricFamily.GetName(), dtoMetric, desc, ) } - sort.Sort(labelPairSorter(lpsFromDesc)) + sort.Sort(internal.LabelPairSorter(lpsFromDesc)) for i, lpFromDesc := range lpsFromDesc { lpFromMetric := dtoMetric.Label[i] if lpFromDesc.GetName() != lpFromMetric.GetName() || @@ -948,3 +988,89 @@ func checkDescConsistency( } return nil } + +var _ TransactionalGatherer = &MultiTRegistry{} + +// MultiTRegistry is a TransactionalGatherer that joins gathered metrics from multiple +// transactional gatherers. +// +// It is caller responsibility to ensure two registries have mutually exclusive metric families, +// no deduplication will happen. +type MultiTRegistry struct { + tGatherers []TransactionalGatherer +} + +// NewMultiTRegistry creates MultiTRegistry. +func NewMultiTRegistry(tGatherers ...TransactionalGatherer) *MultiTRegistry { + return &MultiTRegistry{ + tGatherers: tGatherers, + } +} + +// Gather implements TransactionalGatherer interface. +func (r *MultiTRegistry) Gather() (mfs []*dto.MetricFamily, done func(), err error) { + errs := MultiError{} + + dFns := make([]func(), 0, len(r.tGatherers)) + // TODO(bwplotka): Implement concurrency for those? + for _, g := range r.tGatherers { + // TODO(bwplotka): Check for duplicates? + m, d, err := g.Gather() + errs.Append(err) + + mfs = append(mfs, m...) + dFns = append(dFns, d) + } + + // TODO(bwplotka): Consider sort in place, given metric family in gather is sorted already. + sort.Slice(mfs, func(i, j int) bool { + return *mfs[i].Name < *mfs[j].Name + }) + return mfs, func() { + for _, d := range dFns { + d() + } + }, errs.MaybeUnwrap() +} + +// TransactionalGatherer represents transactional gatherer that can be triggered to notify gatherer that memory +// used by metric family is no longer used by a caller. This allows implementations with cache. +type TransactionalGatherer interface { + // Gather returns metrics in a lexicographically sorted slice + // of uniquely named MetricFamily protobufs. Gather ensures that the + // returned slice is valid and self-consistent so that it can be used + // for valid exposition. As an exception to the strict consistency + // requirements described for metric.Desc, Gather will tolerate + // different sets of label names for metrics of the same metric family. + // + // Even if an error occurs, Gather attempts to gather as many metrics as + // possible. Hence, if a non-nil error is returned, the returned + // MetricFamily slice could be nil (in case of a fatal error that + // prevented any meaningful metric collection) or contain a number of + // MetricFamily protobufs, some of which might be incomplete, and some + // might be missing altogether. The returned error (which might be a + // MultiError) explains the details. Note that this is mostly useful for + // debugging purposes. If the gathered protobufs are to be used for + // exposition in actual monitoring, it is almost always better to not + // expose an incomplete result and instead disregard the returned + // MetricFamily protobufs in case the returned error is non-nil. + // + // Important: done is expected to be triggered (even if the error occurs!) + // once caller does not need returned slice of dto.MetricFamily. + Gather() (_ []*dto.MetricFamily, done func(), err error) +} + +// ToTransactionalGatherer transforms Gatherer to transactional one with noop as done function. +func ToTransactionalGatherer(g Gatherer) TransactionalGatherer { + return &noTransactionGatherer{g: g} +} + +type noTransactionGatherer struct { + g Gatherer +} + +// Gather implements TransactionalGatherer interface. +func (g *noTransactionGatherer) Gather() (_ []*dto.MetricFamily, done func(), err error) { + mfs, err := g.g.Gather() + return mfs, func() {}, err +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/summary.go b/vendor/github.com/prometheus/client_golang/prometheus/summary.go index c5fa8ed7c7..1ab0e47965 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/summary.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/summary.go @@ -22,11 +22,11 @@ import ( "sync/atomic" "time" - "github.com/beorn7/perks/quantile" - //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/golang/protobuf/proto" - dto "github.com/prometheus/client_model/go" + + "github.com/beorn7/perks/quantile" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) // quantileLabel is used for the label that defines the quantile in a @@ -146,6 +146,21 @@ type SummaryOpts struct { // is the internal buffer size of the underlying package // "github.com/bmizerany/perks/quantile"). BufCap uint32 + + // now is for testing purposes, by default it's time.Now. + now func() time.Time +} + +// SummaryVecOpts bundles the options to create a SummaryVec metric. +// It is mandatory to set SummaryOpts, see there for mandatory fields. VariableLabels +// is optional and can safely be left to its default value. +type SummaryVecOpts struct { + SummaryOpts + + // VariableLabels are used to partition the metric vector by the given set + // of labels. Each label value will be constrained with the optional Constraint + // function, if provided. + VariableLabels ConstrainableLabels } // Problem with the sliding-window decay algorithm... The Merge method of @@ -177,11 +192,11 @@ func NewSummary(opts SummaryOpts) Summary { } func newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary { - if len(desc.variableLabels) != len(labelValues) { - panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels, labelValues)) + if len(desc.variableLabels.names) != len(labelValues) { + panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.names, labelValues)) } - for _, n := range desc.variableLabels { + for _, n := range desc.variableLabels.names { if n == quantileLabel { panic(errQuantileLabelNotAllowed) } @@ -211,6 +226,9 @@ func newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary { opts.BufCap = DefBufCap } + if opts.now == nil { + opts.now = time.Now + } if len(opts.Objectives) == 0 { // Use the lock-free implementation of a Summary without objectives. s := &noObjectivesSummary{ @@ -219,6 +237,7 @@ func newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary { counts: [2]*summaryCounts{{}, {}}, } s.init(s) // Init self-collection. + s.createdTs = timestamppb.New(opts.now()) return s } @@ -234,7 +253,7 @@ func newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary { coldBuf: make([]float64, 0, opts.BufCap), streamDuration: opts.MaxAge / time.Duration(opts.AgeBuckets), } - s.headStreamExpTime = time.Now().Add(s.streamDuration) + s.headStreamExpTime = opts.now().Add(s.streamDuration) s.hotBufExpTime = s.headStreamExpTime for i := uint32(0); i < opts.AgeBuckets; i++ { @@ -248,6 +267,7 @@ func newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary { sort.Float64s(s.sortedObjectives) s.init(s) // Init self-collection. + s.createdTs = timestamppb.New(opts.now()) return s } @@ -275,6 +295,8 @@ type summary struct { headStream *quantile.Stream headStreamIdx int headStreamExpTime, hotBufExpTime time.Time + + createdTs *timestamppb.Timestamp } func (s *summary) Desc() *Desc { @@ -296,7 +318,9 @@ func (s *summary) Observe(v float64) { } func (s *summary) Write(out *dto.Metric) error { - sum := &dto.Summary{} + sum := &dto.Summary{ + CreatedTimestamp: s.createdTs, + } qs := make([]*dto.Quantile, 0, len(s.objectives)) s.bufMtx.Lock() @@ -429,6 +453,8 @@ type noObjectivesSummary struct { counts [2]*summaryCounts labelPairs []*dto.LabelPair + + createdTs *timestamppb.Timestamp } func (s *noObjectivesSummary) Desc() *Desc { @@ -479,8 +505,9 @@ func (s *noObjectivesSummary) Write(out *dto.Metric) error { } sum := &dto.Summary{ - SampleCount: proto.Uint64(count), - SampleSum: proto.Float64(math.Float64frombits(atomic.LoadUint64(&coldCounts.sumBits))), + SampleCount: proto.Uint64(count), + SampleSum: proto.Float64(math.Float64frombits(atomic.LoadUint64(&coldCounts.sumBits))), + CreatedTimestamp: s.createdTs, } out.Summary = sum @@ -530,20 +557,28 @@ type SummaryVec struct { // it is handled by the Prometheus server internally, “quantile” is an illegal // label name. NewSummaryVec will panic if this label name is used. func NewSummaryVec(opts SummaryOpts, labelNames []string) *SummaryVec { - for _, ln := range labelNames { + return V2.NewSummaryVec(SummaryVecOpts{ + SummaryOpts: opts, + VariableLabels: UnconstrainedLabels(labelNames), + }) +} + +// NewSummaryVec creates a new SummaryVec based on the provided SummaryVecOpts. +func (v2) NewSummaryVec(opts SummaryVecOpts) *SummaryVec { + for _, ln := range opts.VariableLabels.labelNames() { if ln == quantileLabel { panic(errQuantileLabelNotAllowed) } } - desc := NewDesc( + desc := V2.NewDesc( BuildFQName(opts.Namespace, opts.Subsystem, opts.Name), opts.Help, - labelNames, + opts.VariableLabels, opts.ConstLabels, ) return &SummaryVec{ MetricVec: NewMetricVec(desc, func(lvs ...string) Metric { - return newSummary(desc, opts, lvs...) + return newSummary(desc, opts.SummaryOpts, lvs...) }), } } @@ -603,7 +638,8 @@ func (v *SummaryVec) GetMetricWith(labels Labels) (Observer, error) { // WithLabelValues works as GetMetricWithLabelValues, but panics where // GetMetricWithLabelValues would have returned an error. Not returning an // error allows shortcuts like -// myVec.WithLabelValues("404", "GET").Observe(42.21) +// +// myVec.WithLabelValues("404", "GET").Observe(42.21) func (v *SummaryVec) WithLabelValues(lvs ...string) Observer { s, err := v.GetMetricWithLabelValues(lvs...) if err != nil { @@ -614,7 +650,8 @@ func (v *SummaryVec) WithLabelValues(lvs ...string) Observer { // With works as GetMetricWith, but panics where GetMetricWithLabels would have // returned an error. Not returning an error allows shortcuts like -// myVec.With(prometheus.Labels{"code": "404", "method": "GET"}).Observe(42.21) +// +// myVec.With(prometheus.Labels{"code": "404", "method": "GET"}).Observe(42.21) func (v *SummaryVec) With(labels Labels) Observer { s, err := v.GetMetricWith(labels) if err != nil { @@ -660,6 +697,7 @@ type constSummary struct { sum float64 quantiles map[float64]float64 labelPairs []*dto.LabelPair + createdTs *timestamppb.Timestamp } func (s *constSummary) Desc() *Desc { @@ -667,7 +705,9 @@ func (s *constSummary) Desc() *Desc { } func (s *constSummary) Write(out *dto.Metric) error { - sum := &dto.Summary{} + sum := &dto.Summary{ + CreatedTimestamp: s.createdTs, + } qs := make([]*dto.Quantile, 0, len(s.quantiles)) sum.SampleCount = proto.Uint64(s.count) @@ -701,7 +741,8 @@ func (s *constSummary) Write(out *dto.Metric) error { // // quantiles maps ranks to quantile values. For example, a median latency of // 0.23s and a 99th percentile latency of 0.56s would be expressed as: -// map[float64]float64{0.5: 0.23, 0.99: 0.56} +// +// map[float64]float64{0.5: 0.23, 0.99: 0.56} // // NewConstSummary returns an error if the length of labelValues is not // consistent with the variable labels in Desc or if Desc is invalid. @@ -715,7 +756,7 @@ func NewConstSummary( if desc.err != nil { return nil, desc.err } - if err := validateLabelValues(labelValues, len(desc.variableLabels)); err != nil { + if err := validateLabelValues(labelValues, len(desc.variableLabels.names)); err != nil { return nil, err } return &constSummary{ @@ -742,3 +783,45 @@ func MustNewConstSummary( } return m } + +// NewConstSummaryWithCreatedTimestamp does the same thing as NewConstSummary but sets the created timestamp. +func NewConstSummaryWithCreatedTimestamp( + desc *Desc, + count uint64, + sum float64, + quantiles map[float64]float64, + ct time.Time, + labelValues ...string, +) (Metric, error) { + if desc.err != nil { + return nil, desc.err + } + if err := validateLabelValues(labelValues, len(desc.variableLabels.names)); err != nil { + return nil, err + } + return &constSummary{ + desc: desc, + count: count, + sum: sum, + quantiles: quantiles, + labelPairs: MakeLabelPairs(desc, labelValues), + createdTs: timestamppb.New(ct), + }, nil +} + +// MustNewConstSummaryWithCreatedTimestamp is a version of NewConstSummaryWithCreatedTimestamp that panics where +// NewConstSummaryWithCreatedTimestamp would have returned an error. +func MustNewConstSummaryWithCreatedTimestamp( + desc *Desc, + count uint64, + sum float64, + quantiles map[float64]float64, + ct time.Time, + labelValues ...string, +) Metric { + m, err := NewConstSummaryWithCreatedTimestamp(desc, count, sum, quantiles, ct, labelValues...) + if err != nil { + panic(err) + } + return m +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/timer.go b/vendor/github.com/prometheus/client_golang/prometheus/timer.go index 8d5f105233..52344fef53 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/timer.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/timer.go @@ -23,13 +23,24 @@ type Timer struct { } // NewTimer creates a new Timer. The provided Observer is used to observe a -// duration in seconds. Timer is usually used to time a function call in the +// duration in seconds. If the Observer implements ExemplarObserver, passing exemplar +// later on will be also supported. +// Timer is usually used to time a function call in the // following way: -// func TimeMe() { -// timer := NewTimer(myHistogram) -// defer timer.ObserveDuration() -// // Do actual work. -// } +// +// func TimeMe() { +// timer := NewTimer(myHistogram) +// defer timer.ObserveDuration() +// // Do actual work. +// } +// +// or +// +// func TimeMeWithExemplar() { +// timer := NewTimer(myHistogram) +// defer timer.ObserveDurationWithExemplar(exemplar) +// // Do actual work. +// } func NewTimer(o Observer) *Timer { return &Timer{ begin: time.Now(), @@ -52,3 +63,19 @@ func (t *Timer) ObserveDuration() time.Duration { } return d } + +// ObserveDurationWithExemplar is like ObserveDuration, but it will also +// observe exemplar with the duration unless exemplar is nil or provided Observer can't +// be casted to ExemplarObserver. +func (t *Timer) ObserveDurationWithExemplar(exemplar Labels) time.Duration { + d := time.Since(t.begin) + eo, ok := t.observer.(ExemplarObserver) + if ok && exemplar != nil { + eo.ObserveWithExemplar(d.Seconds(), exemplar) + return d + } + if t.observer != nil { + t.observer.Observe(d.Seconds()) + } + return d +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/value.go b/vendor/github.com/prometheus/client_golang/prometheus/value.go index c778711b8a..cc23011fad 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/value.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/value.go @@ -14,16 +14,17 @@ package prometheus import ( + "errors" "fmt" "sort" "time" "unicode/utf8" - //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes" + "github.com/prometheus/client_golang/prometheus/internal" dto "github.com/prometheus/client_model/go" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) // ValueType is an enumeration of metric types that represent a simple value. @@ -38,6 +39,23 @@ const ( UntypedValue ) +var ( + CounterMetricTypePtr = func() *dto.MetricType { d := dto.MetricType_COUNTER; return &d }() + GaugeMetricTypePtr = func() *dto.MetricType { d := dto.MetricType_GAUGE; return &d }() + UntypedMetricTypePtr = func() *dto.MetricType { d := dto.MetricType_UNTYPED; return &d }() +) + +func (v ValueType) ToDTO() *dto.MetricType { + switch v { + case CounterValue: + return CounterMetricTypePtr + case GaugeValue: + return GaugeMetricTypePtr + default: + return UntypedMetricTypePtr + } +} + // valueFunc is a generic metric for simple values retrieved on collect time // from a function. It implements Metric and Collector. Its effective type is // determined by ValueType. This is a low-level building block used by the @@ -74,7 +92,7 @@ func (v *valueFunc) Desc() *Desc { } func (v *valueFunc) Write(out *dto.Metric) error { - return populateMetric(v.valType, v.function(), v.labelPairs, nil, out) + return populateMetric(v.valType, v.function(), v.labelPairs, nil, out, nil) } // NewConstMetric returns a metric with one fixed value that cannot be @@ -88,14 +106,18 @@ func NewConstMetric(desc *Desc, valueType ValueType, value float64, labelValues if desc.err != nil { return nil, desc.err } - if err := validateLabelValues(labelValues, len(desc.variableLabels)); err != nil { + if err := validateLabelValues(labelValues, len(desc.variableLabels.names)); err != nil { + return nil, err + } + + metric := &dto.Metric{} + if err := populateMetric(valueType, value, MakeLabelPairs(desc, labelValues), nil, metric, nil); err != nil { return nil, err } + return &constMetric{ - desc: desc, - valType: valueType, - val: value, - labelPairs: MakeLabelPairs(desc, labelValues), + desc: desc, + metric: metric, }, nil } @@ -109,11 +131,46 @@ func MustNewConstMetric(desc *Desc, valueType ValueType, value float64, labelVal return m } +// NewConstMetricWithCreatedTimestamp does the same thing as NewConstMetric, but generates Counters +// with created timestamp set and returns an error for other metric types. +func NewConstMetricWithCreatedTimestamp(desc *Desc, valueType ValueType, value float64, ct time.Time, labelValues ...string) (Metric, error) { + if desc.err != nil { + return nil, desc.err + } + if err := validateLabelValues(labelValues, len(desc.variableLabels.names)); err != nil { + return nil, err + } + switch valueType { + case CounterValue: + break + default: + return nil, errors.New("created timestamps are only supported for counters") + } + + metric := &dto.Metric{} + if err := populateMetric(valueType, value, MakeLabelPairs(desc, labelValues), nil, metric, timestamppb.New(ct)); err != nil { + return nil, err + } + + return &constMetric{ + desc: desc, + metric: metric, + }, nil +} + +// MustNewConstMetricWithCreatedTimestamp is a version of NewConstMetricWithCreatedTimestamp that panics where +// NewConstMetricWithCreatedTimestamp would have returned an error. +func MustNewConstMetricWithCreatedTimestamp(desc *Desc, valueType ValueType, value float64, ct time.Time, labelValues ...string) Metric { + m, err := NewConstMetricWithCreatedTimestamp(desc, valueType, value, ct, labelValues...) + if err != nil { + panic(err) + } + return m +} + type constMetric struct { - desc *Desc - valType ValueType - val float64 - labelPairs []*dto.LabelPair + desc *Desc + metric *dto.Metric } func (m *constMetric) Desc() *Desc { @@ -121,7 +178,11 @@ func (m *constMetric) Desc() *Desc { } func (m *constMetric) Write(out *dto.Metric) error { - return populateMetric(m.valType, m.val, m.labelPairs, nil, out) + out.Label = m.metric.Label + out.Counter = m.metric.Counter + out.Gauge = m.metric.Gauge + out.Untyped = m.metric.Untyped + return nil } func populateMetric( @@ -130,11 +191,12 @@ func populateMetric( labelPairs []*dto.LabelPair, e *dto.Exemplar, m *dto.Metric, + ct *timestamppb.Timestamp, ) error { m.Label = labelPairs switch t { case CounterValue: - m.Counter = &dto.Counter{Value: proto.Float64(v), Exemplar: e} + m.Counter = &dto.Counter{Value: proto.Float64(v), Exemplar: e, CreatedTimestamp: ct} case GaugeValue: m.Gauge = &dto.Gauge{Value: proto.Float64(v)} case UntypedValue: @@ -153,29 +215,29 @@ func populateMetric( // This function is only needed for custom Metric implementations. See MetricVec // example. func MakeLabelPairs(desc *Desc, labelValues []string) []*dto.LabelPair { - totalLen := len(desc.variableLabels) + len(desc.constLabelPairs) + totalLen := len(desc.variableLabels.names) + len(desc.constLabelPairs) if totalLen == 0 { // Super fast path. return nil } - if len(desc.variableLabels) == 0 { + if len(desc.variableLabels.names) == 0 { // Moderately fast path. return desc.constLabelPairs } labelPairs := make([]*dto.LabelPair, 0, totalLen) - for i, n := range desc.variableLabels { + for i, l := range desc.variableLabels.names { labelPairs = append(labelPairs, &dto.LabelPair{ - Name: proto.String(n), + Name: proto.String(l), Value: proto.String(labelValues[i]), }) } labelPairs = append(labelPairs, desc.constLabelPairs...) - sort.Sort(labelPairSorter(labelPairs)) + sort.Sort(internal.LabelPairSorter(labelPairs)) return labelPairs } // ExemplarMaxRunes is the max total number of runes allowed in exemplar labels. -const ExemplarMaxRunes = 64 +const ExemplarMaxRunes = 128 // newExemplar creates a new dto.Exemplar from the provided values. An error is // returned if any of the label names or values are invalid or if the total @@ -183,8 +245,8 @@ const ExemplarMaxRunes = 64 func newExemplar(value float64, ts time.Time, l Labels) (*dto.Exemplar, error) { e := &dto.Exemplar{} e.Value = proto.Float64(value) - tsProto, err := ptypes.TimestampProto(ts) - if err != nil { + tsProto := timestamppb.New(ts) + if err := tsProto.CheckValid(); err != nil { return nil, err } e.Timestamp = tsProto diff --git a/vendor/github.com/prometheus/client_golang/prometheus/vec.go b/vendor/github.com/prometheus/client_golang/prometheus/vec.go index 4ababe6c98..2c808eece0 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/vec.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/vec.go @@ -72,6 +72,8 @@ func NewMetricVec(desc *Desc, newMetric func(lvs ...string) Metric) *MetricVec { // with a performance overhead (for creating and processing the Labels map). // See also the CounterVec example. func (m *MetricVec) DeleteLabelValues(lvs ...string) bool { + lvs = constrainLabelValues(m.desc, lvs, m.curry) + h, err := m.hashLabelValues(lvs) if err != nil { return false @@ -91,6 +93,9 @@ func (m *MetricVec) DeleteLabelValues(lvs ...string) bool { // This method is used for the same purpose as DeleteLabelValues(...string). See // there for pros and cons of the two methods. func (m *MetricVec) Delete(labels Labels) bool { + labels, closer := constrainLabels(m.desc, labels) + defer closer() + h, err := m.hashLabels(labels) if err != nil { return false @@ -99,6 +104,19 @@ func (m *MetricVec) Delete(labels Labels) bool { return m.metricMap.deleteByHashWithLabels(h, labels, m.curry) } +// DeletePartialMatch deletes all metrics where the variable labels contain all of those +// passed in as labels. The order of the labels does not matter. +// It returns the number of metrics deleted. +// +// Note that curried labels will never be matched if deleting from the curried vector. +// To match curried labels with DeletePartialMatch, it must be called on the base vector. +func (m *MetricVec) DeletePartialMatch(labels Labels) int { + labels, closer := constrainLabels(m.desc, labels) + defer closer() + + return m.metricMap.deleteByLabels(labels, m.curry) +} + // Without explicit forwarding of Describe, Collect, Reset, those methods won't // show up in GoDoc. @@ -134,11 +152,11 @@ func (m *MetricVec) CurryWith(labels Labels) (*MetricVec, error) { oldCurry = m.curry iCurry int ) - for i, label := range m.desc.variableLabels { - val, ok := labels[label] + for i, labelName := range m.desc.variableLabels.names { + val, ok := labels[labelName] if iCurry < len(oldCurry) && oldCurry[iCurry].index == i { if ok { - return nil, fmt.Errorf("label name %q is already curried", label) + return nil, fmt.Errorf("label name %q is already curried", labelName) } newCurry = append(newCurry, oldCurry[iCurry]) iCurry++ @@ -146,7 +164,10 @@ func (m *MetricVec) CurryWith(labels Labels) (*MetricVec, error) { if !ok { continue // Label stays uncurried. } - newCurry = append(newCurry, curriedLabelValue{i, val}) + newCurry = append(newCurry, curriedLabelValue{ + i, + m.desc.variableLabels.constrain(labelName, val), + }) } } if l := len(oldCurry) + len(labels) - len(newCurry); l > 0 { @@ -189,6 +210,7 @@ func (m *MetricVec) CurryWith(labels Labels) (*MetricVec, error) { // a wrapper around MetricVec, implementing a vector for a specific Metric // implementation, for example GaugeVec. func (m *MetricVec) GetMetricWithLabelValues(lvs ...string) (Metric, error) { + lvs = constrainLabelValues(m.desc, lvs, m.curry) h, err := m.hashLabelValues(lvs) if err != nil { return nil, err @@ -214,6 +236,9 @@ func (m *MetricVec) GetMetricWithLabelValues(lvs ...string) (Metric, error) { // around MetricVec, implementing a vector for a specific Metric implementation, // for example GaugeVec. func (m *MetricVec) GetMetricWith(labels Labels) (Metric, error) { + labels, closer := constrainLabels(m.desc, labels) + defer closer() + h, err := m.hashLabels(labels) if err != nil { return nil, err @@ -223,7 +248,7 @@ func (m *MetricVec) GetMetricWith(labels Labels) (Metric, error) { } func (m *MetricVec) hashLabelValues(vals []string) (uint64, error) { - if err := validateLabelValues(vals, len(m.desc.variableLabels)-len(m.curry)); err != nil { + if err := validateLabelValues(vals, len(m.desc.variableLabels.names)-len(m.curry)); err != nil { return 0, err } @@ -232,7 +257,7 @@ func (m *MetricVec) hashLabelValues(vals []string) (uint64, error) { curry = m.curry iVals, iCurry int ) - for i := 0; i < len(m.desc.variableLabels); i++ { + for i := 0; i < len(m.desc.variableLabels.names); i++ { if iCurry < len(curry) && curry[iCurry].index == i { h = m.hashAdd(h, curry[iCurry].value) iCurry++ @@ -246,7 +271,7 @@ func (m *MetricVec) hashLabelValues(vals []string) (uint64, error) { } func (m *MetricVec) hashLabels(labels Labels) (uint64, error) { - if err := validateValuesInLabels(labels, len(m.desc.variableLabels)-len(m.curry)); err != nil { + if err := validateValuesInLabels(labels, len(m.desc.variableLabels.names)-len(m.curry)); err != nil { return 0, err } @@ -255,17 +280,17 @@ func (m *MetricVec) hashLabels(labels Labels) (uint64, error) { curry = m.curry iCurry int ) - for i, label := range m.desc.variableLabels { - val, ok := labels[label] + for i, labelName := range m.desc.variableLabels.names { + val, ok := labels[labelName] if iCurry < len(curry) && curry[iCurry].index == i { if ok { - return 0, fmt.Errorf("label name %q is already curried", label) + return 0, fmt.Errorf("label name %q is already curried", labelName) } h = m.hashAdd(h, curry[iCurry].value) iCurry++ } else { if !ok { - return 0, fmt.Errorf("label name %q missing in label map", label) + return 0, fmt.Errorf("label name %q missing in label map", labelName) } h = m.hashAdd(h, val) } @@ -381,6 +406,82 @@ func (m *metricMap) deleteByHashWithLabels( return true } +// deleteByLabels deletes a metric if the given labels are present in the metric. +func (m *metricMap) deleteByLabels(labels Labels, curry []curriedLabelValue) int { + m.mtx.Lock() + defer m.mtx.Unlock() + + var numDeleted int + + for h, metrics := range m.metrics { + i := findMetricWithPartialLabels(m.desc, metrics, labels, curry) + if i >= len(metrics) { + // Didn't find matching labels in this metric slice. + continue + } + delete(m.metrics, h) + numDeleted++ + } + + return numDeleted +} + +// findMetricWithPartialLabel returns the index of the matching metric or +// len(metrics) if not found. +func findMetricWithPartialLabels( + desc *Desc, metrics []metricWithLabelValues, labels Labels, curry []curriedLabelValue, +) int { + for i, metric := range metrics { + if matchPartialLabels(desc, metric.values, labels, curry) { + return i + } + } + return len(metrics) +} + +// indexOf searches the given slice of strings for the target string and returns +// the index or len(items) as well as a boolean whether the search succeeded. +func indexOf(target string, items []string) (int, bool) { + for i, l := range items { + if l == target { + return i, true + } + } + return len(items), false +} + +// valueMatchesVariableOrCurriedValue determines if a value was previously curried, +// and returns whether it matches either the "base" value or the curried value accordingly. +// It also indicates whether the match is against a curried or uncurried value. +func valueMatchesVariableOrCurriedValue(targetValue string, index int, values []string, curry []curriedLabelValue) (bool, bool) { + for _, curriedValue := range curry { + if curriedValue.index == index { + // This label was curried. See if the curried value matches our target. + return curriedValue.value == targetValue, true + } + } + // This label was not curried. See if the current value matches our target label. + return values[index] == targetValue, false +} + +// matchPartialLabels searches the current metric and returns whether all of the target label:value pairs are present. +func matchPartialLabels(desc *Desc, values []string, labels Labels, curry []curriedLabelValue) bool { + for l, v := range labels { + // Check if the target label exists in our metrics and get the index. + varLabelIndex, validLabel := indexOf(l, desc.variableLabels.names) + if validLabel { + // Check the value of that label against the target value. + // We don't consider curried values in partial matches. + matches, curried := valueMatchesVariableOrCurriedValue(v, varLabelIndex, values, curry) + if matches && !curried { + continue + } + } + return false + } + return true +} + // getOrCreateMetricWithLabelValues retrieves the metric by hash and label value // or creates it and returns the new one. // @@ -406,7 +507,7 @@ func (m *metricMap) getOrCreateMetricWithLabelValues( return metric } -// getOrCreateMetricWithLabelValues retrieves the metric by hash and label value +// getOrCreateMetricWithLabels retrieves the metric by hash and label value // or creates it and returns the new one. // // This function holds the mutex. @@ -485,7 +586,7 @@ func findMetricWithLabels( return len(metrics) } -func matchLabelValues(values []string, lvs []string, curry []curriedLabelValue) bool { +func matchLabelValues(values, lvs []string, curry []curriedLabelValue) bool { if len(values) != len(lvs)+len(curry) { return false } @@ -511,7 +612,7 @@ func matchLabels(desc *Desc, values []string, labels Labels, curry []curriedLabe return false } iCurry := 0 - for i, k := range desc.variableLabels { + for i, k := range desc.variableLabels.names { if iCurry < len(curry) && curry[iCurry].index == i { if values[i] != curry[iCurry].value { return false @@ -529,7 +630,7 @@ func matchLabels(desc *Desc, values []string, labels Labels, curry []curriedLabe func extractLabelValues(desc *Desc, labels Labels, curry []curriedLabelValue) []string { labelValues := make([]string, len(labels)+len(curry)) iCurry := 0 - for i, k := range desc.variableLabels { + for i, k := range desc.variableLabels.names { if iCurry < len(curry) && curry[iCurry].index == i { labelValues[i] = curry[iCurry].value iCurry++ @@ -554,3 +655,55 @@ func inlineLabelValues(lvs []string, curry []curriedLabelValue) []string { } return labelValues } + +var labelsPool = &sync.Pool{ + New: func() interface{} { + return make(Labels) + }, +} + +func constrainLabels(desc *Desc, labels Labels) (Labels, func()) { + if len(desc.variableLabels.labelConstraints) == 0 { + // Fast path when there's no constraints + return labels, func() {} + } + + constrainedLabels := labelsPool.Get().(Labels) + for l, v := range labels { + constrainedLabels[l] = desc.variableLabels.constrain(l, v) + } + + return constrainedLabels, func() { + for k := range constrainedLabels { + delete(constrainedLabels, k) + } + labelsPool.Put(constrainedLabels) + } +} + +func constrainLabelValues(desc *Desc, lvs []string, curry []curriedLabelValue) []string { + if len(desc.variableLabels.labelConstraints) == 0 { + // Fast path when there's no constraints + return lvs + } + + constrainedValues := make([]string, len(lvs)) + var iCurry, iLVs int + for i := 0; i < len(lvs)+len(curry); i++ { + if iCurry < len(curry) && curry[iCurry].index == i { + iCurry++ + continue + } + + if i < len(desc.variableLabels.names) { + constrainedValues[iLVs] = desc.variableLabels.constrain( + desc.variableLabels.names[i], + lvs[iLVs], + ) + } else { + constrainedValues[iLVs] = lvs[iLVs] + } + iLVs++ + } + return constrainedValues +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/vnext.go b/vendor/github.com/prometheus/client_golang/prometheus/vnext.go new file mode 100644 index 0000000000..42bc3a8f06 --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/vnext.go @@ -0,0 +1,23 @@ +// Copyright 2022 The Prometheus 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 prometheus + +type v2 struct{} + +// V2 is a struct that can be referenced to access experimental API that might +// be present in v2 of client golang someday. It offers extended functionality +// of v1 with slightly changed API. It is acceptable to use some pieces from v1 +// and e.g `prometheus.NewGauge` and some from v2 e.g. `prometheus.V2.NewDesc` +// in the same codebase. +var V2 = v2{} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/wrap.go b/vendor/github.com/prometheus/client_golang/prometheus/wrap.go index 74ee93280f..25da157f15 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/wrap.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/wrap.go @@ -17,10 +17,10 @@ import ( "fmt" "sort" - //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/golang/protobuf/proto" + "github.com/prometheus/client_golang/prometheus/internal" dto "github.com/prometheus/client_model/go" + "google.golang.org/protobuf/proto" ) // WrapRegistererWith returns a Registerer wrapping the provided @@ -182,7 +182,7 @@ func (m *wrappingMetric) Write(out *dto.Metric) error { Value: proto.String(lv), }) } - sort.Sort(labelPairSorter(out.Label)) + sort.Sort(internal.LabelPairSorter(out.Label)) return nil } @@ -204,7 +204,7 @@ func wrapDesc(desc *Desc, prefix string, labels Labels) *Desc { constLabels[ln] = lv } // NewDesc will do remaining validations. - newDesc := NewDesc(prefix+desc.fqName, desc.help, desc.variableLabels, constLabels) + newDesc := V2.NewDesc(prefix+desc.fqName, desc.help, desc.variableLabels, constLabels) // Propagate errors if there was any. This will override any errer // created by NewDesc above, i.e. earlier errors get precedence. if desc.err != nil { diff --git a/vendor/github.com/prometheus/client_model/go/metrics.pb.go b/vendor/github.com/prometheus/client_model/go/metrics.pb.go index 35904ea198..2f15490758 100644 --- a/vendor/github.com/prometheus/client_model/go/metrics.pb.go +++ b/vendor/github.com/prometheus/client_model/go/metrics.pb.go @@ -1,25 +1,38 @@ +// Copyright 2013 Prometheus Team +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.20.3 // source: io/prometheus/client/metrics.proto package io_prometheus_client import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type MetricType int32 @@ -38,23 +51,25 @@ const ( MetricType_GAUGE_HISTOGRAM MetricType = 5 ) -var MetricType_name = map[int32]string{ - 0: "COUNTER", - 1: "GAUGE", - 2: "SUMMARY", - 3: "UNTYPED", - 4: "HISTOGRAM", - 5: "GAUGE_HISTOGRAM", -} - -var MetricType_value = map[string]int32{ - "COUNTER": 0, - "GAUGE": 1, - "SUMMARY": 2, - "UNTYPED": 3, - "HISTOGRAM": 4, - "GAUGE_HISTOGRAM": 5, -} +// Enum value maps for MetricType. +var ( + MetricType_name = map[int32]string{ + 0: "COUNTER", + 1: "GAUGE", + 2: "SUMMARY", + 3: "UNTYPED", + 4: "HISTOGRAM", + 5: "GAUGE_HISTOGRAM", + } + MetricType_value = map[string]int32{ + "COUNTER": 0, + "GAUGE": 1, + "SUMMARY": 2, + "UNTYPED": 3, + "HISTOGRAM": 4, + "GAUGE_HISTOGRAM": 5, + } +) func (x MetricType) Enum() *MetricType { p := new(MetricType) @@ -63,449 +78,555 @@ func (x MetricType) Enum() *MetricType { } func (x MetricType) String() string { - return proto.EnumName(MetricType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MetricType) Descriptor() protoreflect.EnumDescriptor { + return file_io_prometheus_client_metrics_proto_enumTypes[0].Descriptor() +} + +func (MetricType) Type() protoreflect.EnumType { + return &file_io_prometheus_client_metrics_proto_enumTypes[0] } -func (x *MetricType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MetricType_value, data, "MetricType") +func (x MetricType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *MetricType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) if err != nil { return err } - *x = MetricType(value) + *x = MetricType(num) return nil } +// Deprecated: Use MetricType.Descriptor instead. func (MetricType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d1e5ddb18987a258, []int{0} + return file_io_prometheus_client_metrics_proto_rawDescGZIP(), []int{0} } type LabelPair struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *LabelPair) Reset() { *m = LabelPair{} } -func (m *LabelPair) String() string { return proto.CompactTextString(m) } -func (*LabelPair) ProtoMessage() {} -func (*LabelPair) Descriptor() ([]byte, []int) { - return fileDescriptor_d1e5ddb18987a258, []int{0} + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } -func (m *LabelPair) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LabelPair.Unmarshal(m, b) -} -func (m *LabelPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LabelPair.Marshal(b, m, deterministic) -} -func (m *LabelPair) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelPair.Merge(m, src) +func (x *LabelPair) Reset() { + *x = LabelPair{} + if protoimpl.UnsafeEnabled { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *LabelPair) XXX_Size() int { - return xxx_messageInfo_LabelPair.Size(m) + +func (x *LabelPair) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *LabelPair) XXX_DiscardUnknown() { - xxx_messageInfo_LabelPair.DiscardUnknown(m) + +func (*LabelPair) ProtoMessage() {} + +func (x *LabelPair) ProtoReflect() protoreflect.Message { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_LabelPair proto.InternalMessageInfo +// Deprecated: Use LabelPair.ProtoReflect.Descriptor instead. +func (*LabelPair) Descriptor() ([]byte, []int) { + return file_io_prometheus_client_metrics_proto_rawDescGZIP(), []int{0} +} -func (m *LabelPair) GetName() string { - if m != nil && m.Name != nil { - return *m.Name +func (x *LabelPair) GetName() string { + if x != nil && x.Name != nil { + return *x.Name } return "" } -func (m *LabelPair) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value +func (x *LabelPair) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value } return "" } type Gauge struct { - Value *float64 `protobuf:"fixed64,1,opt,name=value" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Gauge) Reset() { *m = Gauge{} } -func (m *Gauge) String() string { return proto.CompactTextString(m) } -func (*Gauge) ProtoMessage() {} -func (*Gauge) Descriptor() ([]byte, []int) { - return fileDescriptor_d1e5ddb18987a258, []int{1} + Value *float64 `protobuf:"fixed64,1,opt,name=value" json:"value,omitempty"` } -func (m *Gauge) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Gauge.Unmarshal(m, b) -} -func (m *Gauge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Gauge.Marshal(b, m, deterministic) -} -func (m *Gauge) XXX_Merge(src proto.Message) { - xxx_messageInfo_Gauge.Merge(m, src) +func (x *Gauge) Reset() { + *x = Gauge{} + if protoimpl.UnsafeEnabled { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Gauge) XXX_Size() int { - return xxx_messageInfo_Gauge.Size(m) + +func (x *Gauge) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Gauge) XXX_DiscardUnknown() { - xxx_messageInfo_Gauge.DiscardUnknown(m) + +func (*Gauge) ProtoMessage() {} + +func (x *Gauge) ProtoReflect() protoreflect.Message { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Gauge proto.InternalMessageInfo +// Deprecated: Use Gauge.ProtoReflect.Descriptor instead. +func (*Gauge) Descriptor() ([]byte, []int) { + return file_io_prometheus_client_metrics_proto_rawDescGZIP(), []int{1} +} -func (m *Gauge) GetValue() float64 { - if m != nil && m.Value != nil { - return *m.Value +func (x *Gauge) GetValue() float64 { + if x != nil && x.Value != nil { + return *x.Value } return 0 } type Counter struct { - Value *float64 `protobuf:"fixed64,1,opt,name=value" json:"value,omitempty"` - Exemplar *Exemplar `protobuf:"bytes,2,opt,name=exemplar" json:"exemplar,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Counter) Reset() { *m = Counter{} } -func (m *Counter) String() string { return proto.CompactTextString(m) } -func (*Counter) ProtoMessage() {} -func (*Counter) Descriptor() ([]byte, []int) { - return fileDescriptor_d1e5ddb18987a258, []int{2} + Value *float64 `protobuf:"fixed64,1,opt,name=value" json:"value,omitempty"` + Exemplar *Exemplar `protobuf:"bytes,2,opt,name=exemplar" json:"exemplar,omitempty"` + CreatedTimestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_timestamp,json=createdTimestamp" json:"created_timestamp,omitempty"` } -func (m *Counter) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Counter.Unmarshal(m, b) -} -func (m *Counter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Counter.Marshal(b, m, deterministic) -} -func (m *Counter) XXX_Merge(src proto.Message) { - xxx_messageInfo_Counter.Merge(m, src) +func (x *Counter) Reset() { + *x = Counter{} + if protoimpl.UnsafeEnabled { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Counter) XXX_Size() int { - return xxx_messageInfo_Counter.Size(m) + +func (x *Counter) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Counter) XXX_DiscardUnknown() { - xxx_messageInfo_Counter.DiscardUnknown(m) + +func (*Counter) ProtoMessage() {} + +func (x *Counter) ProtoReflect() protoreflect.Message { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Counter proto.InternalMessageInfo +// Deprecated: Use Counter.ProtoReflect.Descriptor instead. +func (*Counter) Descriptor() ([]byte, []int) { + return file_io_prometheus_client_metrics_proto_rawDescGZIP(), []int{2} +} -func (m *Counter) GetValue() float64 { - if m != nil && m.Value != nil { - return *m.Value +func (x *Counter) GetValue() float64 { + if x != nil && x.Value != nil { + return *x.Value } return 0 } -func (m *Counter) GetExemplar() *Exemplar { - if m != nil { - return m.Exemplar +func (x *Counter) GetExemplar() *Exemplar { + if x != nil { + return x.Exemplar } return nil } -type Quantile struct { - Quantile *float64 `protobuf:"fixed64,1,opt,name=quantile" json:"quantile,omitempty"` - Value *float64 `protobuf:"fixed64,2,opt,name=value" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *Counter) GetCreatedTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.CreatedTimestamp + } + return nil } -func (m *Quantile) Reset() { *m = Quantile{} } -func (m *Quantile) String() string { return proto.CompactTextString(m) } -func (*Quantile) ProtoMessage() {} -func (*Quantile) Descriptor() ([]byte, []int) { - return fileDescriptor_d1e5ddb18987a258, []int{3} -} +type Quantile struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Quantile) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Quantile.Unmarshal(m, b) -} -func (m *Quantile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Quantile.Marshal(b, m, deterministic) + Quantile *float64 `protobuf:"fixed64,1,opt,name=quantile" json:"quantile,omitempty"` + Value *float64 `protobuf:"fixed64,2,opt,name=value" json:"value,omitempty"` } -func (m *Quantile) XXX_Merge(src proto.Message) { - xxx_messageInfo_Quantile.Merge(m, src) + +func (x *Quantile) Reset() { + *x = Quantile{} + if protoimpl.UnsafeEnabled { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Quantile) XXX_Size() int { - return xxx_messageInfo_Quantile.Size(m) + +func (x *Quantile) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Quantile) XXX_DiscardUnknown() { - xxx_messageInfo_Quantile.DiscardUnknown(m) + +func (*Quantile) ProtoMessage() {} + +func (x *Quantile) ProtoReflect() protoreflect.Message { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Quantile proto.InternalMessageInfo +// Deprecated: Use Quantile.ProtoReflect.Descriptor instead. +func (*Quantile) Descriptor() ([]byte, []int) { + return file_io_prometheus_client_metrics_proto_rawDescGZIP(), []int{3} +} -func (m *Quantile) GetQuantile() float64 { - if m != nil && m.Quantile != nil { - return *m.Quantile +func (x *Quantile) GetQuantile() float64 { + if x != nil && x.Quantile != nil { + return *x.Quantile } return 0 } -func (m *Quantile) GetValue() float64 { - if m != nil && m.Value != nil { - return *m.Value +func (x *Quantile) GetValue() float64 { + if x != nil && x.Value != nil { + return *x.Value } return 0 } type Summary struct { - SampleCount *uint64 `protobuf:"varint,1,opt,name=sample_count,json=sampleCount" json:"sample_count,omitempty"` - SampleSum *float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum" json:"sample_sum,omitempty"` - Quantile []*Quantile `protobuf:"bytes,3,rep,name=quantile" json:"quantile,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SampleCount *uint64 `protobuf:"varint,1,opt,name=sample_count,json=sampleCount" json:"sample_count,omitempty"` + SampleSum *float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum" json:"sample_sum,omitempty"` + Quantile []*Quantile `protobuf:"bytes,3,rep,name=quantile" json:"quantile,omitempty"` + CreatedTimestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_timestamp,json=createdTimestamp" json:"created_timestamp,omitempty"` +} + +func (x *Summary) Reset() { + *x = Summary{} + if protoimpl.UnsafeEnabled { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Summary) Reset() { *m = Summary{} } -func (m *Summary) String() string { return proto.CompactTextString(m) } -func (*Summary) ProtoMessage() {} -func (*Summary) Descriptor() ([]byte, []int) { - return fileDescriptor_d1e5ddb18987a258, []int{4} +func (x *Summary) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Summary) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Summary.Unmarshal(m, b) -} -func (m *Summary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Summary.Marshal(b, m, deterministic) -} -func (m *Summary) XXX_Merge(src proto.Message) { - xxx_messageInfo_Summary.Merge(m, src) -} -func (m *Summary) XXX_Size() int { - return xxx_messageInfo_Summary.Size(m) -} -func (m *Summary) XXX_DiscardUnknown() { - xxx_messageInfo_Summary.DiscardUnknown(m) +func (*Summary) ProtoMessage() {} + +func (x *Summary) ProtoReflect() protoreflect.Message { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Summary proto.InternalMessageInfo +// Deprecated: Use Summary.ProtoReflect.Descriptor instead. +func (*Summary) Descriptor() ([]byte, []int) { + return file_io_prometheus_client_metrics_proto_rawDescGZIP(), []int{4} +} -func (m *Summary) GetSampleCount() uint64 { - if m != nil && m.SampleCount != nil { - return *m.SampleCount +func (x *Summary) GetSampleCount() uint64 { + if x != nil && x.SampleCount != nil { + return *x.SampleCount } return 0 } -func (m *Summary) GetSampleSum() float64 { - if m != nil && m.SampleSum != nil { - return *m.SampleSum +func (x *Summary) GetSampleSum() float64 { + if x != nil && x.SampleSum != nil { + return *x.SampleSum } return 0 } -func (m *Summary) GetQuantile() []*Quantile { - if m != nil { - return m.Quantile +func (x *Summary) GetQuantile() []*Quantile { + if x != nil { + return x.Quantile } return nil } -type Untyped struct { - Value *float64 `protobuf:"fixed64,1,opt,name=value" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *Summary) GetCreatedTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.CreatedTimestamp + } + return nil } -func (m *Untyped) Reset() { *m = Untyped{} } -func (m *Untyped) String() string { return proto.CompactTextString(m) } -func (*Untyped) ProtoMessage() {} -func (*Untyped) Descriptor() ([]byte, []int) { - return fileDescriptor_d1e5ddb18987a258, []int{5} -} +type Untyped struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Untyped) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Untyped.Unmarshal(m, b) + Value *float64 `protobuf:"fixed64,1,opt,name=value" json:"value,omitempty"` } -func (m *Untyped) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Untyped.Marshal(b, m, deterministic) -} -func (m *Untyped) XXX_Merge(src proto.Message) { - xxx_messageInfo_Untyped.Merge(m, src) + +func (x *Untyped) Reset() { + *x = Untyped{} + if protoimpl.UnsafeEnabled { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Untyped) XXX_Size() int { - return xxx_messageInfo_Untyped.Size(m) + +func (x *Untyped) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Untyped) XXX_DiscardUnknown() { - xxx_messageInfo_Untyped.DiscardUnknown(m) + +func (*Untyped) ProtoMessage() {} + +func (x *Untyped) ProtoReflect() protoreflect.Message { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Untyped proto.InternalMessageInfo +// Deprecated: Use Untyped.ProtoReflect.Descriptor instead. +func (*Untyped) Descriptor() ([]byte, []int) { + return file_io_prometheus_client_metrics_proto_rawDescGZIP(), []int{5} +} -func (m *Untyped) GetValue() float64 { - if m != nil && m.Value != nil { - return *m.Value +func (x *Untyped) GetValue() float64 { + if x != nil && x.Value != nil { + return *x.Value } return 0 } type Histogram struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + SampleCount *uint64 `protobuf:"varint,1,opt,name=sample_count,json=sampleCount" json:"sample_count,omitempty"` - SampleCountFloat *float64 `protobuf:"fixed64,4,opt,name=sample_count_float,json=sampleCountFloat" json:"sample_count_float,omitempty"` + SampleCountFloat *float64 `protobuf:"fixed64,4,opt,name=sample_count_float,json=sampleCountFloat" json:"sample_count_float,omitempty"` // Overrides sample_count if > 0. SampleSum *float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum" json:"sample_sum,omitempty"` // Buckets for the conventional histogram. - Bucket []*Bucket `protobuf:"bytes,3,rep,name=bucket" json:"bucket,omitempty"` + Bucket []*Bucket `protobuf:"bytes,3,rep,name=bucket" json:"bucket,omitempty"` // Ordered in increasing order of upper_bound, +Inf bucket is optional. + CreatedTimestamp *timestamppb.Timestamp `protobuf:"bytes,15,opt,name=created_timestamp,json=createdTimestamp" json:"created_timestamp,omitempty"` // schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8. // They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and // then each power of two is divided into 2^n logarithmic buckets. // Or in other words, each bucket boundary is the previous boundary times 2^(2^-n). // In the future, more bucket schemas may be added using numbers < -4 or > 8. Schema *int32 `protobuf:"zigzag32,5,opt,name=schema" json:"schema,omitempty"` - ZeroThreshold *float64 `protobuf:"fixed64,6,opt,name=zero_threshold,json=zeroThreshold" json:"zero_threshold,omitempty"` - ZeroCount *uint64 `protobuf:"varint,7,opt,name=zero_count,json=zeroCount" json:"zero_count,omitempty"` - ZeroCountFloat *float64 `protobuf:"fixed64,8,opt,name=zero_count_float,json=zeroCountFloat" json:"zero_count_float,omitempty"` + ZeroThreshold *float64 `protobuf:"fixed64,6,opt,name=zero_threshold,json=zeroThreshold" json:"zero_threshold,omitempty"` // Breadth of the zero bucket. + ZeroCount *uint64 `protobuf:"varint,7,opt,name=zero_count,json=zeroCount" json:"zero_count,omitempty"` // Count in zero bucket. + ZeroCountFloat *float64 `protobuf:"fixed64,8,opt,name=zero_count_float,json=zeroCountFloat" json:"zero_count_float,omitempty"` // Overrides sb_zero_count if > 0. // Negative buckets for the native histogram. NegativeSpan []*BucketSpan `protobuf:"bytes,9,rep,name=negative_span,json=negativeSpan" json:"negative_span,omitempty"` // Use either "negative_delta" or "negative_count", the former for // regular histograms with integer counts, the latter for float // histograms. - NegativeDelta []int64 `protobuf:"zigzag64,10,rep,name=negative_delta,json=negativeDelta" json:"negative_delta,omitempty"` - NegativeCount []float64 `protobuf:"fixed64,11,rep,name=negative_count,json=negativeCount" json:"negative_count,omitempty"` + NegativeDelta []int64 `protobuf:"zigzag64,10,rep,name=negative_delta,json=negativeDelta" json:"negative_delta,omitempty"` // Count delta of each bucket compared to previous one (or to zero for 1st bucket). + NegativeCount []float64 `protobuf:"fixed64,11,rep,name=negative_count,json=negativeCount" json:"negative_count,omitempty"` // Absolute count of each bucket. // Positive buckets for the native histogram. + // Use a no-op span (offset 0, length 0) for a native histogram without any + // observations yet and with a zero_threshold of 0. Otherwise, it would be + // indistinguishable from a classic histogram. PositiveSpan []*BucketSpan `protobuf:"bytes,12,rep,name=positive_span,json=positiveSpan" json:"positive_span,omitempty"` // Use either "positive_delta" or "positive_count", the former for // regular histograms with integer counts, the latter for float // histograms. - PositiveDelta []int64 `protobuf:"zigzag64,13,rep,name=positive_delta,json=positiveDelta" json:"positive_delta,omitempty"` - PositiveCount []float64 `protobuf:"fixed64,14,rep,name=positive_count,json=positiveCount" json:"positive_count,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + PositiveDelta []int64 `protobuf:"zigzag64,13,rep,name=positive_delta,json=positiveDelta" json:"positive_delta,omitempty"` // Count delta of each bucket compared to previous one (or to zero for 1st bucket). + PositiveCount []float64 `protobuf:"fixed64,14,rep,name=positive_count,json=positiveCount" json:"positive_count,omitempty"` // Absolute count of each bucket. + // Only used for native histograms. These exemplars MUST have a timestamp. + Exemplars []*Exemplar `protobuf:"bytes,16,rep,name=exemplars" json:"exemplars,omitempty"` +} + +func (x *Histogram) Reset() { + *x = Histogram{} + if protoimpl.UnsafeEnabled { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Histogram) Reset() { *m = Histogram{} } -func (m *Histogram) String() string { return proto.CompactTextString(m) } -func (*Histogram) ProtoMessage() {} -func (*Histogram) Descriptor() ([]byte, []int) { - return fileDescriptor_d1e5ddb18987a258, []int{6} +func (x *Histogram) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Histogram) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Histogram.Unmarshal(m, b) -} -func (m *Histogram) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Histogram.Marshal(b, m, deterministic) -} -func (m *Histogram) XXX_Merge(src proto.Message) { - xxx_messageInfo_Histogram.Merge(m, src) -} -func (m *Histogram) XXX_Size() int { - return xxx_messageInfo_Histogram.Size(m) -} -func (m *Histogram) XXX_DiscardUnknown() { - xxx_messageInfo_Histogram.DiscardUnknown(m) +func (*Histogram) ProtoMessage() {} + +func (x *Histogram) ProtoReflect() protoreflect.Message { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Histogram proto.InternalMessageInfo +// Deprecated: Use Histogram.ProtoReflect.Descriptor instead. +func (*Histogram) Descriptor() ([]byte, []int) { + return file_io_prometheus_client_metrics_proto_rawDescGZIP(), []int{6} +} -func (m *Histogram) GetSampleCount() uint64 { - if m != nil && m.SampleCount != nil { - return *m.SampleCount +func (x *Histogram) GetSampleCount() uint64 { + if x != nil && x.SampleCount != nil { + return *x.SampleCount } return 0 } -func (m *Histogram) GetSampleCountFloat() float64 { - if m != nil && m.SampleCountFloat != nil { - return *m.SampleCountFloat +func (x *Histogram) GetSampleCountFloat() float64 { + if x != nil && x.SampleCountFloat != nil { + return *x.SampleCountFloat } return 0 } -func (m *Histogram) GetSampleSum() float64 { - if m != nil && m.SampleSum != nil { - return *m.SampleSum +func (x *Histogram) GetSampleSum() float64 { + if x != nil && x.SampleSum != nil { + return *x.SampleSum } return 0 } -func (m *Histogram) GetBucket() []*Bucket { - if m != nil { - return m.Bucket +func (x *Histogram) GetBucket() []*Bucket { + if x != nil { + return x.Bucket + } + return nil +} + +func (x *Histogram) GetCreatedTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.CreatedTimestamp } return nil } -func (m *Histogram) GetSchema() int32 { - if m != nil && m.Schema != nil { - return *m.Schema +func (x *Histogram) GetSchema() int32 { + if x != nil && x.Schema != nil { + return *x.Schema } return 0 } -func (m *Histogram) GetZeroThreshold() float64 { - if m != nil && m.ZeroThreshold != nil { - return *m.ZeroThreshold +func (x *Histogram) GetZeroThreshold() float64 { + if x != nil && x.ZeroThreshold != nil { + return *x.ZeroThreshold } return 0 } -func (m *Histogram) GetZeroCount() uint64 { - if m != nil && m.ZeroCount != nil { - return *m.ZeroCount +func (x *Histogram) GetZeroCount() uint64 { + if x != nil && x.ZeroCount != nil { + return *x.ZeroCount } return 0 } -func (m *Histogram) GetZeroCountFloat() float64 { - if m != nil && m.ZeroCountFloat != nil { - return *m.ZeroCountFloat +func (x *Histogram) GetZeroCountFloat() float64 { + if x != nil && x.ZeroCountFloat != nil { + return *x.ZeroCountFloat } return 0 } -func (m *Histogram) GetNegativeSpan() []*BucketSpan { - if m != nil { - return m.NegativeSpan +func (x *Histogram) GetNegativeSpan() []*BucketSpan { + if x != nil { + return x.NegativeSpan + } + return nil +} + +func (x *Histogram) GetNegativeDelta() []int64 { + if x != nil { + return x.NegativeDelta } return nil } -func (m *Histogram) GetNegativeDelta() []int64 { - if m != nil { - return m.NegativeDelta +func (x *Histogram) GetNegativeCount() []float64 { + if x != nil { + return x.NegativeCount } return nil } -func (m *Histogram) GetNegativeCount() []float64 { - if m != nil { - return m.NegativeCount +func (x *Histogram) GetPositiveSpan() []*BucketSpan { + if x != nil { + return x.PositiveSpan } return nil } -func (m *Histogram) GetPositiveSpan() []*BucketSpan { - if m != nil { - return m.PositiveSpan +func (x *Histogram) GetPositiveDelta() []int64 { + if x != nil { + return x.PositiveDelta } return nil } -func (m *Histogram) GetPositiveDelta() []int64 { - if m != nil { - return m.PositiveDelta +func (x *Histogram) GetPositiveCount() []float64 { + if x != nil { + return x.PositiveCount } return nil } -func (m *Histogram) GetPositiveCount() []float64 { - if m != nil { - return m.PositiveCount +func (x *Histogram) GetExemplars() []*Exemplar { + if x != nil { + return x.Exemplars } return nil } @@ -513,64 +634,72 @@ func (m *Histogram) GetPositiveCount() []float64 { // A Bucket of a conventional histogram, each of which is treated as // an individual counter-like time series by Prometheus. type Bucket struct { - CumulativeCount *uint64 `protobuf:"varint,1,opt,name=cumulative_count,json=cumulativeCount" json:"cumulative_count,omitempty"` - CumulativeCountFloat *float64 `protobuf:"fixed64,4,opt,name=cumulative_count_float,json=cumulativeCountFloat" json:"cumulative_count_float,omitempty"` - UpperBound *float64 `protobuf:"fixed64,2,opt,name=upper_bound,json=upperBound" json:"upper_bound,omitempty"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CumulativeCount *uint64 `protobuf:"varint,1,opt,name=cumulative_count,json=cumulativeCount" json:"cumulative_count,omitempty"` // Cumulative in increasing order. + CumulativeCountFloat *float64 `protobuf:"fixed64,4,opt,name=cumulative_count_float,json=cumulativeCountFloat" json:"cumulative_count_float,omitempty"` // Overrides cumulative_count if > 0. + UpperBound *float64 `protobuf:"fixed64,2,opt,name=upper_bound,json=upperBound" json:"upper_bound,omitempty"` // Inclusive. Exemplar *Exemplar `protobuf:"bytes,3,opt,name=exemplar" json:"exemplar,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *Bucket) Reset() { *m = Bucket{} } -func (m *Bucket) String() string { return proto.CompactTextString(m) } -func (*Bucket) ProtoMessage() {} -func (*Bucket) Descriptor() ([]byte, []int) { - return fileDescriptor_d1e5ddb18987a258, []int{7} +func (x *Bucket) Reset() { + *x = Bucket{} + if protoimpl.UnsafeEnabled { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Bucket) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Bucket.Unmarshal(m, b) -} -func (m *Bucket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Bucket.Marshal(b, m, deterministic) +func (x *Bucket) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Bucket) XXX_Merge(src proto.Message) { - xxx_messageInfo_Bucket.Merge(m, src) -} -func (m *Bucket) XXX_Size() int { - return xxx_messageInfo_Bucket.Size(m) -} -func (m *Bucket) XXX_DiscardUnknown() { - xxx_messageInfo_Bucket.DiscardUnknown(m) + +func (*Bucket) ProtoMessage() {} + +func (x *Bucket) ProtoReflect() protoreflect.Message { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Bucket proto.InternalMessageInfo +// Deprecated: Use Bucket.ProtoReflect.Descriptor instead. +func (*Bucket) Descriptor() ([]byte, []int) { + return file_io_prometheus_client_metrics_proto_rawDescGZIP(), []int{7} +} -func (m *Bucket) GetCumulativeCount() uint64 { - if m != nil && m.CumulativeCount != nil { - return *m.CumulativeCount +func (x *Bucket) GetCumulativeCount() uint64 { + if x != nil && x.CumulativeCount != nil { + return *x.CumulativeCount } return 0 } -func (m *Bucket) GetCumulativeCountFloat() float64 { - if m != nil && m.CumulativeCountFloat != nil { - return *m.CumulativeCountFloat +func (x *Bucket) GetCumulativeCountFloat() float64 { + if x != nil && x.CumulativeCountFloat != nil { + return *x.CumulativeCountFloat } return 0 } -func (m *Bucket) GetUpperBound() float64 { - if m != nil && m.UpperBound != nil { - return *m.UpperBound +func (x *Bucket) GetUpperBound() float64 { + if x != nil && x.UpperBound != nil { + return *x.UpperBound } return 0 } -func (m *Bucket) GetExemplar() *Exemplar { - if m != nil { - return m.Exemplar +func (x *Bucket) GetExemplar() *Exemplar { + if x != nil { + return x.Exemplar } return nil } @@ -582,333 +711,689 @@ func (m *Bucket) GetExemplar() *Exemplar { // structured here (with all the buckets in a single array separate // from the Spans). type BucketSpan struct { - Offset *int32 `protobuf:"zigzag32,1,opt,name=offset" json:"offset,omitempty"` - Length *uint32 `protobuf:"varint,2,opt,name=length" json:"length,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *BucketSpan) Reset() { *m = BucketSpan{} } -func (m *BucketSpan) String() string { return proto.CompactTextString(m) } -func (*BucketSpan) ProtoMessage() {} -func (*BucketSpan) Descriptor() ([]byte, []int) { - return fileDescriptor_d1e5ddb18987a258, []int{8} + Offset *int32 `protobuf:"zigzag32,1,opt,name=offset" json:"offset,omitempty"` // Gap to previous span, or starting point for 1st span (which can be negative). + Length *uint32 `protobuf:"varint,2,opt,name=length" json:"length,omitempty"` // Length of consecutive buckets. } -func (m *BucketSpan) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BucketSpan.Unmarshal(m, b) -} -func (m *BucketSpan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BucketSpan.Marshal(b, m, deterministic) -} -func (m *BucketSpan) XXX_Merge(src proto.Message) { - xxx_messageInfo_BucketSpan.Merge(m, src) +func (x *BucketSpan) Reset() { + *x = BucketSpan{} + if protoimpl.UnsafeEnabled { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BucketSpan) XXX_Size() int { - return xxx_messageInfo_BucketSpan.Size(m) + +func (x *BucketSpan) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BucketSpan) XXX_DiscardUnknown() { - xxx_messageInfo_BucketSpan.DiscardUnknown(m) + +func (*BucketSpan) ProtoMessage() {} + +func (x *BucketSpan) ProtoReflect() protoreflect.Message { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BucketSpan proto.InternalMessageInfo +// Deprecated: Use BucketSpan.ProtoReflect.Descriptor instead. +func (*BucketSpan) Descriptor() ([]byte, []int) { + return file_io_prometheus_client_metrics_proto_rawDescGZIP(), []int{8} +} -func (m *BucketSpan) GetOffset() int32 { - if m != nil && m.Offset != nil { - return *m.Offset +func (x *BucketSpan) GetOffset() int32 { + if x != nil && x.Offset != nil { + return *x.Offset } return 0 } -func (m *BucketSpan) GetLength() uint32 { - if m != nil && m.Length != nil { - return *m.Length +func (x *BucketSpan) GetLength() uint32 { + if x != nil && x.Length != nil { + return *x.Length } return 0 } type Exemplar struct { - Label []*LabelPair `protobuf:"bytes,1,rep,name=label" json:"label,omitempty"` - Value *float64 `protobuf:"fixed64,2,opt,name=value" json:"value,omitempty"` - Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp" json:"timestamp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Exemplar) Reset() { *m = Exemplar{} } -func (m *Exemplar) String() string { return proto.CompactTextString(m) } -func (*Exemplar) ProtoMessage() {} -func (*Exemplar) Descriptor() ([]byte, []int) { - return fileDescriptor_d1e5ddb18987a258, []int{9} + Label []*LabelPair `protobuf:"bytes,1,rep,name=label" json:"label,omitempty"` + Value *float64 `protobuf:"fixed64,2,opt,name=value" json:"value,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp" json:"timestamp,omitempty"` // OpenMetrics-style. } -func (m *Exemplar) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Exemplar.Unmarshal(m, b) -} -func (m *Exemplar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Exemplar.Marshal(b, m, deterministic) -} -func (m *Exemplar) XXX_Merge(src proto.Message) { - xxx_messageInfo_Exemplar.Merge(m, src) +func (x *Exemplar) Reset() { + *x = Exemplar{} + if protoimpl.UnsafeEnabled { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Exemplar) XXX_Size() int { - return xxx_messageInfo_Exemplar.Size(m) + +func (x *Exemplar) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Exemplar) XXX_DiscardUnknown() { - xxx_messageInfo_Exemplar.DiscardUnknown(m) + +func (*Exemplar) ProtoMessage() {} + +func (x *Exemplar) ProtoReflect() protoreflect.Message { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Exemplar proto.InternalMessageInfo +// Deprecated: Use Exemplar.ProtoReflect.Descriptor instead. +func (*Exemplar) Descriptor() ([]byte, []int) { + return file_io_prometheus_client_metrics_proto_rawDescGZIP(), []int{9} +} -func (m *Exemplar) GetLabel() []*LabelPair { - if m != nil { - return m.Label +func (x *Exemplar) GetLabel() []*LabelPair { + if x != nil { + return x.Label } return nil } -func (m *Exemplar) GetValue() float64 { - if m != nil && m.Value != nil { - return *m.Value +func (x *Exemplar) GetValue() float64 { + if x != nil && x.Value != nil { + return *x.Value } return 0 } -func (m *Exemplar) GetTimestamp() *timestamp.Timestamp { - if m != nil { - return m.Timestamp +func (x *Exemplar) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp } return nil } type Metric struct { - Label []*LabelPair `protobuf:"bytes,1,rep,name=label" json:"label,omitempty"` - Gauge *Gauge `protobuf:"bytes,2,opt,name=gauge" json:"gauge,omitempty"` - Counter *Counter `protobuf:"bytes,3,opt,name=counter" json:"counter,omitempty"` - Summary *Summary `protobuf:"bytes,4,opt,name=summary" json:"summary,omitempty"` - Untyped *Untyped `protobuf:"bytes,5,opt,name=untyped" json:"untyped,omitempty"` - Histogram *Histogram `protobuf:"bytes,7,opt,name=histogram" json:"histogram,omitempty"` - TimestampMs *int64 `protobuf:"varint,6,opt,name=timestamp_ms,json=timestampMs" json:"timestamp_ms,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Metric) Reset() { *m = Metric{} } -func (m *Metric) String() string { return proto.CompactTextString(m) } -func (*Metric) ProtoMessage() {} -func (*Metric) Descriptor() ([]byte, []int) { - return fileDescriptor_d1e5ddb18987a258, []int{10} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Label []*LabelPair `protobuf:"bytes,1,rep,name=label" json:"label,omitempty"` + Gauge *Gauge `protobuf:"bytes,2,opt,name=gauge" json:"gauge,omitempty"` + Counter *Counter `protobuf:"bytes,3,opt,name=counter" json:"counter,omitempty"` + Summary *Summary `protobuf:"bytes,4,opt,name=summary" json:"summary,omitempty"` + Untyped *Untyped `protobuf:"bytes,5,opt,name=untyped" json:"untyped,omitempty"` + Histogram *Histogram `protobuf:"bytes,7,opt,name=histogram" json:"histogram,omitempty"` + TimestampMs *int64 `protobuf:"varint,6,opt,name=timestamp_ms,json=timestampMs" json:"timestamp_ms,omitempty"` +} + +func (x *Metric) Reset() { + *x = Metric{} + if protoimpl.UnsafeEnabled { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Metric) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Metric.Unmarshal(m, b) +func (x *Metric) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Metric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Metric.Marshal(b, m, deterministic) -} -func (m *Metric) XXX_Merge(src proto.Message) { - xxx_messageInfo_Metric.Merge(m, src) -} -func (m *Metric) XXX_Size() int { - return xxx_messageInfo_Metric.Size(m) -} -func (m *Metric) XXX_DiscardUnknown() { - xxx_messageInfo_Metric.DiscardUnknown(m) + +func (*Metric) ProtoMessage() {} + +func (x *Metric) ProtoReflect() protoreflect.Message { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Metric proto.InternalMessageInfo +// Deprecated: Use Metric.ProtoReflect.Descriptor instead. +func (*Metric) Descriptor() ([]byte, []int) { + return file_io_prometheus_client_metrics_proto_rawDescGZIP(), []int{10} +} -func (m *Metric) GetLabel() []*LabelPair { - if m != nil { - return m.Label +func (x *Metric) GetLabel() []*LabelPair { + if x != nil { + return x.Label } return nil } -func (m *Metric) GetGauge() *Gauge { - if m != nil { - return m.Gauge +func (x *Metric) GetGauge() *Gauge { + if x != nil { + return x.Gauge } return nil } -func (m *Metric) GetCounter() *Counter { - if m != nil { - return m.Counter +func (x *Metric) GetCounter() *Counter { + if x != nil { + return x.Counter } return nil } -func (m *Metric) GetSummary() *Summary { - if m != nil { - return m.Summary +func (x *Metric) GetSummary() *Summary { + if x != nil { + return x.Summary } return nil } -func (m *Metric) GetUntyped() *Untyped { - if m != nil { - return m.Untyped +func (x *Metric) GetUntyped() *Untyped { + if x != nil { + return x.Untyped } return nil } -func (m *Metric) GetHistogram() *Histogram { - if m != nil { - return m.Histogram +func (x *Metric) GetHistogram() *Histogram { + if x != nil { + return x.Histogram } return nil } -func (m *Metric) GetTimestampMs() int64 { - if m != nil && m.TimestampMs != nil { - return *m.TimestampMs +func (x *Metric) GetTimestampMs() int64 { + if x != nil && x.TimestampMs != nil { + return *x.TimestampMs } return 0 } type MetricFamily struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Help *string `protobuf:"bytes,2,opt,name=help" json:"help,omitempty"` - Type *MetricType `protobuf:"varint,3,opt,name=type,enum=io.prometheus.client.MetricType" json:"type,omitempty"` - Metric []*Metric `protobuf:"bytes,4,rep,name=metric" json:"metric,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MetricFamily) Reset() { *m = MetricFamily{} } -func (m *MetricFamily) String() string { return proto.CompactTextString(m) } -func (*MetricFamily) ProtoMessage() {} -func (*MetricFamily) Descriptor() ([]byte, []int) { - return fileDescriptor_d1e5ddb18987a258, []int{11} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Help *string `protobuf:"bytes,2,opt,name=help" json:"help,omitempty"` + Type *MetricType `protobuf:"varint,3,opt,name=type,enum=io.prometheus.client.MetricType" json:"type,omitempty"` + Metric []*Metric `protobuf:"bytes,4,rep,name=metric" json:"metric,omitempty"` + Unit *string `protobuf:"bytes,5,opt,name=unit" json:"unit,omitempty"` +} + +func (x *MetricFamily) Reset() { + *x = MetricFamily{} + if protoimpl.UnsafeEnabled { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *MetricFamily) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MetricFamily.Unmarshal(m, b) -} -func (m *MetricFamily) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MetricFamily.Marshal(b, m, deterministic) +func (x *MetricFamily) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MetricFamily) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricFamily.Merge(m, src) -} -func (m *MetricFamily) XXX_Size() int { - return xxx_messageInfo_MetricFamily.Size(m) -} -func (m *MetricFamily) XXX_DiscardUnknown() { - xxx_messageInfo_MetricFamily.DiscardUnknown(m) + +func (*MetricFamily) ProtoMessage() {} + +func (x *MetricFamily) ProtoReflect() protoreflect.Message { + mi := &file_io_prometheus_client_metrics_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_MetricFamily proto.InternalMessageInfo +// Deprecated: Use MetricFamily.ProtoReflect.Descriptor instead. +func (*MetricFamily) Descriptor() ([]byte, []int) { + return file_io_prometheus_client_metrics_proto_rawDescGZIP(), []int{11} +} -func (m *MetricFamily) GetName() string { - if m != nil && m.Name != nil { - return *m.Name +func (x *MetricFamily) GetName() string { + if x != nil && x.Name != nil { + return *x.Name } return "" } -func (m *MetricFamily) GetHelp() string { - if m != nil && m.Help != nil { - return *m.Help +func (x *MetricFamily) GetHelp() string { + if x != nil && x.Help != nil { + return *x.Help } return "" } -func (m *MetricFamily) GetType() MetricType { - if m != nil && m.Type != nil { - return *m.Type +func (x *MetricFamily) GetType() MetricType { + if x != nil && x.Type != nil { + return *x.Type } return MetricType_COUNTER } -func (m *MetricFamily) GetMetric() []*Metric { - if m != nil { - return m.Metric +func (x *MetricFamily) GetMetric() []*Metric { + if x != nil { + return x.Metric } return nil } -func init() { - proto.RegisterEnum("io.prometheus.client.MetricType", MetricType_name, MetricType_value) - proto.RegisterType((*LabelPair)(nil), "io.prometheus.client.LabelPair") - proto.RegisterType((*Gauge)(nil), "io.prometheus.client.Gauge") - proto.RegisterType((*Counter)(nil), "io.prometheus.client.Counter") - proto.RegisterType((*Quantile)(nil), "io.prometheus.client.Quantile") - proto.RegisterType((*Summary)(nil), "io.prometheus.client.Summary") - proto.RegisterType((*Untyped)(nil), "io.prometheus.client.Untyped") - proto.RegisterType((*Histogram)(nil), "io.prometheus.client.Histogram") - proto.RegisterType((*Bucket)(nil), "io.prometheus.client.Bucket") - proto.RegisterType((*BucketSpan)(nil), "io.prometheus.client.BucketSpan") - proto.RegisterType((*Exemplar)(nil), "io.prometheus.client.Exemplar") - proto.RegisterType((*Metric)(nil), "io.prometheus.client.Metric") - proto.RegisterType((*MetricFamily)(nil), "io.prometheus.client.MetricFamily") -} - -func init() { - proto.RegisterFile("io/prometheus/client/metrics.proto", fileDescriptor_d1e5ddb18987a258) -} - -var fileDescriptor_d1e5ddb18987a258 = []byte{ - // 896 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xdd, 0x8e, 0xdb, 0x44, - 0x18, 0xc5, 0x9b, 0x5f, 0x7f, 0xd9, 0x6c, 0xd3, 0x61, 0x55, 0x59, 0x0b, 0xcb, 0x06, 0x4b, 0x48, - 0x0b, 0x42, 0x8e, 0x40, 0x5b, 0x81, 0x0a, 0x5c, 0xec, 0xb6, 0xe9, 0x16, 0x89, 0xb4, 0x65, 0x92, - 0x5c, 0x14, 0x2e, 0xac, 0x49, 0x32, 0xeb, 0x58, 0x78, 0x3c, 0xc6, 0x1e, 0x57, 0x2c, 0x2f, 0xc0, - 0x35, 0xaf, 0xc0, 0xc3, 0xf0, 0x22, 0x3c, 0x08, 0x68, 0xfe, 0xec, 0xdd, 0xe2, 0x94, 0xd2, 0x3b, - 0x7f, 0x67, 0xce, 0xf7, 0xcd, 0x39, 0xe3, 0xc9, 0x71, 0xc0, 0x8f, 0xf9, 0x24, 0xcb, 0x39, 0xa3, - 0x62, 0x4b, 0xcb, 0x62, 0xb2, 0x4e, 0x62, 0x9a, 0x8a, 0x09, 0xa3, 0x22, 0x8f, 0xd7, 0x45, 0x90, - 0xe5, 0x5c, 0x70, 0x74, 0x18, 0xf3, 0xa0, 0xe6, 0x04, 0x9a, 0x73, 0x74, 0x12, 0x71, 0x1e, 0x25, - 0x74, 0xa2, 0x38, 0xab, 0xf2, 0x6a, 0x22, 0x62, 0x46, 0x0b, 0x41, 0x58, 0xa6, 0xdb, 0xfc, 0xfb, - 0xe0, 0x7e, 0x47, 0x56, 0x34, 0x79, 0x4e, 0xe2, 0x1c, 0x21, 0x68, 0xa7, 0x84, 0x51, 0xcf, 0x19, - 0x3b, 0xa7, 0x2e, 0x56, 0xcf, 0xe8, 0x10, 0x3a, 0x2f, 0x49, 0x52, 0x52, 0x6f, 0x4f, 0x81, 0xba, - 0xf0, 0x8f, 0xa1, 0x73, 0x49, 0xca, 0xe8, 0xc6, 0xb2, 0xec, 0x71, 0xec, 0xf2, 0x8f, 0xd0, 0x7b, - 0xc8, 0xcb, 0x54, 0xd0, 0xbc, 0x99, 0x80, 0x1e, 0x40, 0x9f, 0xfe, 0x42, 0x59, 0x96, 0x90, 0x5c, - 0x0d, 0x1e, 0x7c, 0xfe, 0x41, 0xd0, 0x64, 0x20, 0x98, 0x1a, 0x16, 0xae, 0xf8, 0xfe, 0xd7, 0xd0, - 0xff, 0xbe, 0x24, 0xa9, 0x88, 0x13, 0x8a, 0x8e, 0xa0, 0xff, 0xb3, 0x79, 0x36, 0x1b, 0x54, 0xf5, - 0x6d, 0xe5, 0x95, 0xb4, 0xdf, 0x1c, 0xe8, 0xcd, 0x4b, 0xc6, 0x48, 0x7e, 0x8d, 0x3e, 0x84, 0xfd, - 0x82, 0xb0, 0x2c, 0xa1, 0xe1, 0x5a, 0xaa, 0x55, 0x13, 0xda, 0x78, 0xa0, 0x31, 0x65, 0x00, 0x1d, - 0x03, 0x18, 0x4a, 0x51, 0x32, 0x33, 0xc9, 0xd5, 0xc8, 0xbc, 0x64, 0xd2, 0x47, 0xb5, 0x7f, 0x6b, - 0xdc, 0xda, 0xed, 0xc3, 0x2a, 0xae, 0xf5, 0xf9, 0x27, 0xd0, 0x5b, 0xa6, 0xe2, 0x3a, 0xa3, 0x9b, - 0x1d, 0xa7, 0xf8, 0x57, 0x1b, 0xdc, 0x27, 0x71, 0x21, 0x78, 0x94, 0x13, 0xf6, 0x26, 0x62, 0x3f, - 0x05, 0x74, 0x93, 0x12, 0x5e, 0x25, 0x9c, 0x08, 0xaf, 0xad, 0x66, 0x8e, 0x6e, 0x10, 0x1f, 0x4b, - 0xfc, 0xbf, 0xac, 0x9d, 0x41, 0x77, 0x55, 0xae, 0x7f, 0xa2, 0xc2, 0x18, 0x7b, 0xbf, 0xd9, 0xd8, - 0x85, 0xe2, 0x60, 0xc3, 0x45, 0xf7, 0xa0, 0x5b, 0xac, 0xb7, 0x94, 0x11, 0xaf, 0x33, 0x76, 0x4e, - 0xef, 0x62, 0x53, 0xa1, 0x8f, 0xe0, 0xe0, 0x57, 0x9a, 0xf3, 0x50, 0x6c, 0x73, 0x5a, 0x6c, 0x79, - 0xb2, 0xf1, 0xba, 0x6a, 0xc3, 0xa1, 0x44, 0x17, 0x16, 0x94, 0x9a, 0x14, 0x4d, 0x5b, 0xec, 0x29, - 0x8b, 0xae, 0x44, 0xb4, 0xc1, 0x53, 0x18, 0xd5, 0xcb, 0xc6, 0x5e, 0x5f, 0xcd, 0x39, 0xa8, 0x48, - 0xda, 0xdc, 0x14, 0x86, 0x29, 0x8d, 0x88, 0x88, 0x5f, 0xd2, 0xb0, 0xc8, 0x48, 0xea, 0xb9, 0xca, - 0xc4, 0xf8, 0x75, 0x26, 0xe6, 0x19, 0x49, 0xf1, 0xbe, 0x6d, 0x93, 0x95, 0x94, 0x5d, 0x8d, 0xd9, - 0xd0, 0x44, 0x10, 0x0f, 0xc6, 0xad, 0x53, 0x84, 0xab, 0xe1, 0x8f, 0x24, 0x78, 0x8b, 0xa6, 0xa5, - 0x0f, 0xc6, 0x2d, 0xe9, 0xce, 0xa2, 0x5a, 0xfe, 0x14, 0x86, 0x19, 0x2f, 0xe2, 0x5a, 0xd4, 0xfe, - 0x9b, 0x8a, 0xb2, 0x6d, 0x56, 0x54, 0x35, 0x46, 0x8b, 0x1a, 0x6a, 0x51, 0x16, 0xad, 0x44, 0x55, - 0x34, 0x2d, 0xea, 0x40, 0x8b, 0xb2, 0xa8, 0x12, 0xe5, 0xff, 0xe9, 0x40, 0x57, 0x6f, 0x85, 0x3e, - 0x86, 0xd1, 0xba, 0x64, 0x65, 0x72, 0xd3, 0x88, 0xbe, 0x66, 0x77, 0x6a, 0x5c, 0x5b, 0x39, 0x83, - 0x7b, 0xaf, 0x52, 0x6f, 0x5d, 0xb7, 0xc3, 0x57, 0x1a, 0xf4, 0x5b, 0x39, 0x81, 0x41, 0x99, 0x65, - 0x34, 0x0f, 0x57, 0xbc, 0x4c, 0x37, 0xe6, 0xce, 0x81, 0x82, 0x2e, 0x24, 0x72, 0x2b, 0x17, 0x5a, - 0xff, 0x3b, 0x17, 0xa0, 0x3e, 0x32, 0x79, 0x11, 0xf9, 0xd5, 0x55, 0x41, 0xb5, 0x83, 0xbb, 0xd8, - 0x54, 0x12, 0x4f, 0x68, 0x1a, 0x89, 0xad, 0xda, 0x7d, 0x88, 0x4d, 0xe5, 0xff, 0xee, 0x40, 0xdf, - 0x0e, 0x45, 0xf7, 0xa1, 0x93, 0xc8, 0x54, 0xf4, 0x1c, 0xf5, 0x82, 0x4e, 0x9a, 0x35, 0x54, 0xc1, - 0x89, 0x35, 0xbb, 0x39, 0x71, 0xd0, 0x97, 0xe0, 0x56, 0xa9, 0x6b, 0x4c, 0x1d, 0x05, 0x3a, 0x97, - 0x03, 0x9b, 0xcb, 0xc1, 0xc2, 0x32, 0x70, 0x4d, 0xf6, 0xff, 0xde, 0x83, 0xee, 0x4c, 0xa5, 0xfc, - 0xdb, 0x2a, 0xfa, 0x0c, 0x3a, 0x91, 0xcc, 0x69, 0x13, 0xb2, 0xef, 0x35, 0xb7, 0xa9, 0x28, 0xc7, - 0x9a, 0x89, 0xbe, 0x80, 0xde, 0x5a, 0x67, 0xb7, 0x11, 0x7b, 0xdc, 0xdc, 0x64, 0x02, 0x1e, 0x5b, - 0xb6, 0x6c, 0x2c, 0x74, 0xb0, 0xaa, 0x3b, 0xb0, 0xb3, 0xd1, 0xa4, 0x2f, 0xb6, 0x6c, 0xd9, 0x58, - 0xea, 0x20, 0x54, 0xa1, 0xb1, 0xb3, 0xd1, 0xa4, 0x25, 0xb6, 0x6c, 0xf4, 0x0d, 0xb8, 0x5b, 0x9b, - 0x8f, 0x2a, 0x2c, 0x76, 0x1e, 0x4c, 0x15, 0xa3, 0xb8, 0xee, 0x90, 0x89, 0x5a, 0x9d, 0x75, 0xc8, - 0x0a, 0x95, 0x48, 0x2d, 0x3c, 0xa8, 0xb0, 0x59, 0xe1, 0xff, 0xe1, 0xc0, 0xbe, 0x7e, 0x03, 0x8f, - 0x09, 0x8b, 0x93, 0xeb, 0xc6, 0x4f, 0x24, 0x82, 0xf6, 0x96, 0x26, 0x99, 0xf9, 0x42, 0xaa, 0x67, - 0x74, 0x06, 0x6d, 0xa9, 0x51, 0x1d, 0xe1, 0xc1, 0xae, 0x5f, 0xb8, 0x9e, 0xbc, 0xb8, 0xce, 0x28, - 0x56, 0x6c, 0x99, 0xb9, 0xfa, 0xab, 0xee, 0xb5, 0x5f, 0x97, 0xb9, 0xba, 0x0f, 0x1b, 0xee, 0x27, - 0x2b, 0x80, 0x7a, 0x12, 0x1a, 0x40, 0xef, 0xe1, 0xb3, 0xe5, 0xd3, 0xc5, 0x14, 0x8f, 0xde, 0x41, - 0x2e, 0x74, 0x2e, 0xcf, 0x97, 0x97, 0xd3, 0x91, 0x23, 0xf1, 0xf9, 0x72, 0x36, 0x3b, 0xc7, 0x2f, - 0x46, 0x7b, 0xb2, 0x58, 0x3e, 0x5d, 0xbc, 0x78, 0x3e, 0x7d, 0x34, 0x6a, 0xa1, 0x21, 0xb8, 0x4f, - 0xbe, 0x9d, 0x2f, 0x9e, 0x5d, 0xe2, 0xf3, 0xd9, 0xa8, 0x8d, 0xde, 0x85, 0x3b, 0xaa, 0x27, 0xac, - 0xc1, 0xce, 0x05, 0x86, 0xc6, 0x3f, 0x18, 0x3f, 0x3c, 0x88, 0x62, 0xb1, 0x2d, 0x57, 0xc1, 0x9a, - 0xb3, 0x7f, 0xff, 0x45, 0x09, 0x19, 0xdf, 0xd0, 0x64, 0x12, 0xf1, 0xaf, 0x62, 0x1e, 0xd6, 0xab, - 0xa1, 0x5e, 0xfd, 0x27, 0x00, 0x00, 0xff, 0xff, 0x16, 0x77, 0x81, 0x98, 0xd7, 0x08, 0x00, 0x00, +func (x *MetricFamily) GetUnit() string { + if x != nil && x.Unit != nil { + return *x.Unit + } + return "" +} + +var File_io_prometheus_client_metrics_proto protoreflect.FileDescriptor + +var file_io_prometheus_client_metrics_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2f, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, + 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x35, 0x0a, 0x09, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x50, 0x61, 0x69, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x1d, 0x0a, 0x05, 0x47, 0x61, 0x75, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0xa4, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, + 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x78, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x52, 0x08, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x12, + 0x47, 0x0a, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x3c, 0x0a, 0x08, 0x51, 0x75, 0x61, 0x6e, + 0x74, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xd0, 0x01, 0x0a, 0x07, 0x53, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, + 0x73, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x73, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x53, 0x75, 0x6d, 0x12, 0x3a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, + 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x51, 0x75, + 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, + 0x12, 0x47, 0x0a, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x1f, 0x0a, 0x07, 0x55, 0x6e, 0x74, + 0x79, 0x70, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xea, 0x05, 0x0a, 0x09, 0x48, + 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x73, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x66, 0x6c, 0x6f, 0x61, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x73, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x75, 0x6d, 0x12, 0x34, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, + 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x47, + 0x0a, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x11, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, + 0x25, 0x0a, 0x0e, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, + 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0d, 0x7a, 0x65, 0x72, 0x6f, 0x54, 0x68, 0x72, + 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x7a, 0x65, 0x72, 0x6f, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x0e, 0x7a, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x12, + 0x45, 0x0a, 0x0d, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x6e, + 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, + 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x42, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x0c, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, + 0x76, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, + 0x76, 0x65, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x12, 0x52, 0x0d, + 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x25, 0x0a, + 0x0e, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x0b, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0d, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x45, 0x0a, 0x0d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x5f, 0x73, 0x70, 0x61, 0x6e, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x69, 0x6f, + 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x0c, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x0d, 0x20, + 0x03, 0x28, 0x12, 0x52, 0x0d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x44, 0x65, 0x6c, + 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0d, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x78, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x52, 0x09, 0x65, 0x78, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x22, 0xc6, 0x01, 0x0a, 0x06, 0x42, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x63, 0x75, + 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a, + 0x16, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x14, 0x63, + 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6c, + 0x6f, 0x61, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x70, 0x65, 0x72, 0x5f, 0x62, 0x6f, 0x75, + 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x75, 0x70, 0x70, 0x65, 0x72, 0x42, + 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x3a, 0x0a, 0x08, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, + 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x78, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x52, 0x08, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, + 0x22, 0x3c, 0x0a, 0x0a, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x12, 0x16, + 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x11, 0x52, 0x06, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x91, + 0x01, 0x0a, 0x08, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x12, 0x35, 0x0a, 0x05, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x50, 0x61, 0x69, 0x72, 0x52, 0x05, 0x6c, 0x61, 0x62, + 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x22, 0xff, 0x02, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x35, 0x0a, + 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x50, 0x61, 0x69, 0x72, 0x52, 0x05, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x12, 0x31, 0x0a, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, + 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x61, 0x75, 0x67, 0x65, + 0x52, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, + 0x12, 0x37, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, + 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, + 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x75, 0x6e, 0x74, + 0x79, 0x70, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x69, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x2e, 0x55, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x64, 0x52, 0x07, 0x75, 0x6e, 0x74, 0x79, 0x70, + 0x65, 0x64, 0x12, 0x3d, 0x0a, 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, + 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x48, 0x69, 0x73, + 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, + 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d, + 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x4d, 0x73, 0x22, 0xb6, 0x01, 0x0a, 0x0c, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x46, + 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x6c, + 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12, 0x34, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x69, 0x6f, + 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, + 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x6e, 0x69, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x2a, 0x62, 0x0a, + 0x0a, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x43, + 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x41, 0x55, 0x47, + 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x4d, 0x4d, 0x41, 0x52, 0x59, 0x10, 0x02, + 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x54, 0x59, 0x50, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0d, 0x0a, + 0x09, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, + 0x47, 0x41, 0x55, 0x47, 0x45, 0x5f, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, + 0x05, 0x42, 0x52, 0x0a, 0x14, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, + 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, + 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x67, 0x6f, + 0x3b, 0x69, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, +} + +var ( + file_io_prometheus_client_metrics_proto_rawDescOnce sync.Once + file_io_prometheus_client_metrics_proto_rawDescData = file_io_prometheus_client_metrics_proto_rawDesc +) + +func file_io_prometheus_client_metrics_proto_rawDescGZIP() []byte { + file_io_prometheus_client_metrics_proto_rawDescOnce.Do(func() { + file_io_prometheus_client_metrics_proto_rawDescData = protoimpl.X.CompressGZIP(file_io_prometheus_client_metrics_proto_rawDescData) + }) + return file_io_prometheus_client_metrics_proto_rawDescData +} + +var file_io_prometheus_client_metrics_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_io_prometheus_client_metrics_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_io_prometheus_client_metrics_proto_goTypes = []interface{}{ + (MetricType)(0), // 0: io.prometheus.client.MetricType + (*LabelPair)(nil), // 1: io.prometheus.client.LabelPair + (*Gauge)(nil), // 2: io.prometheus.client.Gauge + (*Counter)(nil), // 3: io.prometheus.client.Counter + (*Quantile)(nil), // 4: io.prometheus.client.Quantile + (*Summary)(nil), // 5: io.prometheus.client.Summary + (*Untyped)(nil), // 6: io.prometheus.client.Untyped + (*Histogram)(nil), // 7: io.prometheus.client.Histogram + (*Bucket)(nil), // 8: io.prometheus.client.Bucket + (*BucketSpan)(nil), // 9: io.prometheus.client.BucketSpan + (*Exemplar)(nil), // 10: io.prometheus.client.Exemplar + (*Metric)(nil), // 11: io.prometheus.client.Metric + (*MetricFamily)(nil), // 12: io.prometheus.client.MetricFamily + (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp +} +var file_io_prometheus_client_metrics_proto_depIdxs = []int32{ + 10, // 0: io.prometheus.client.Counter.exemplar:type_name -> io.prometheus.client.Exemplar + 13, // 1: io.prometheus.client.Counter.created_timestamp:type_name -> google.protobuf.Timestamp + 4, // 2: io.prometheus.client.Summary.quantile:type_name -> io.prometheus.client.Quantile + 13, // 3: io.prometheus.client.Summary.created_timestamp:type_name -> google.protobuf.Timestamp + 8, // 4: io.prometheus.client.Histogram.bucket:type_name -> io.prometheus.client.Bucket + 13, // 5: io.prometheus.client.Histogram.created_timestamp:type_name -> google.protobuf.Timestamp + 9, // 6: io.prometheus.client.Histogram.negative_span:type_name -> io.prometheus.client.BucketSpan + 9, // 7: io.prometheus.client.Histogram.positive_span:type_name -> io.prometheus.client.BucketSpan + 10, // 8: io.prometheus.client.Histogram.exemplars:type_name -> io.prometheus.client.Exemplar + 10, // 9: io.prometheus.client.Bucket.exemplar:type_name -> io.prometheus.client.Exemplar + 1, // 10: io.prometheus.client.Exemplar.label:type_name -> io.prometheus.client.LabelPair + 13, // 11: io.prometheus.client.Exemplar.timestamp:type_name -> google.protobuf.Timestamp + 1, // 12: io.prometheus.client.Metric.label:type_name -> io.prometheus.client.LabelPair + 2, // 13: io.prometheus.client.Metric.gauge:type_name -> io.prometheus.client.Gauge + 3, // 14: io.prometheus.client.Metric.counter:type_name -> io.prometheus.client.Counter + 5, // 15: io.prometheus.client.Metric.summary:type_name -> io.prometheus.client.Summary + 6, // 16: io.prometheus.client.Metric.untyped:type_name -> io.prometheus.client.Untyped + 7, // 17: io.prometheus.client.Metric.histogram:type_name -> io.prometheus.client.Histogram + 0, // 18: io.prometheus.client.MetricFamily.type:type_name -> io.prometheus.client.MetricType + 11, // 19: io.prometheus.client.MetricFamily.metric:type_name -> io.prometheus.client.Metric + 20, // [20:20] is the sub-list for method output_type + 20, // [20:20] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name +} + +func init() { file_io_prometheus_client_metrics_proto_init() } +func file_io_prometheus_client_metrics_proto_init() { + if File_io_prometheus_client_metrics_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_io_prometheus_client_metrics_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LabelPair); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_prometheus_client_metrics_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Gauge); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_prometheus_client_metrics_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Counter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_prometheus_client_metrics_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Quantile); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_prometheus_client_metrics_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Summary); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_prometheus_client_metrics_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Untyped); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_prometheus_client_metrics_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Histogram); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_prometheus_client_metrics_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Bucket); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_prometheus_client_metrics_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BucketSpan); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_prometheus_client_metrics_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Exemplar); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_prometheus_client_metrics_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Metric); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_prometheus_client_metrics_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MetricFamily); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_io_prometheus_client_metrics_proto_rawDesc, + NumEnums: 1, + NumMessages: 12, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_io_prometheus_client_metrics_proto_goTypes, + DependencyIndexes: file_io_prometheus_client_metrics_proto_depIdxs, + EnumInfos: file_io_prometheus_client_metrics_proto_enumTypes, + MessageInfos: file_io_prometheus_client_metrics_proto_msgTypes, + }.Build() + File_io_prometheus_client_metrics_proto = out.File + file_io_prometheus_client_metrics_proto_rawDesc = nil + file_io_prometheus_client_metrics_proto_goTypes = nil + file_io_prometheus_client_metrics_proto_depIdxs = nil } diff --git a/vendor/github.com/prometheus/common/expfmt/decode.go b/vendor/github.com/prometheus/common/expfmt/decode.go index 7657f841d6..1448439b7f 100644 --- a/vendor/github.com/prometheus/common/expfmt/decode.go +++ b/vendor/github.com/prometheus/common/expfmt/decode.go @@ -14,6 +14,7 @@ package expfmt import ( + "bufio" "fmt" "io" "math" @@ -21,8 +22,8 @@ import ( "net/http" dto "github.com/prometheus/client_model/go" + "google.golang.org/protobuf/encoding/protodelim" - "github.com/matttproud/golang_protobuf_extensions/pbutil" "github.com/prometheus/common/model" ) @@ -72,22 +73,24 @@ func ResponseFormat(h http.Header) Format { // NewDecoder returns a new decoder based on the given input format. // If the input format does not imply otherwise, a text format decoder is returned. func NewDecoder(r io.Reader, format Format) Decoder { - switch format { - case FmtProtoDelim: - return &protoDecoder{r: r} + switch format.FormatType() { + case TypeProtoDelim: + return &protoDecoder{r: bufio.NewReader(r)} } return &textDecoder{r: r} } // protoDecoder implements the Decoder interface for protocol buffers. type protoDecoder struct { - r io.Reader + r protodelim.Reader } // Decode implements the Decoder interface. func (d *protoDecoder) Decode(v *dto.MetricFamily) error { - _, err := pbutil.ReadDelimited(d.r, v) - if err != nil { + opts := protodelim.UnmarshalOptions{ + MaxSize: -1, + } + if err := opts.UnmarshalFrom(d.r, v); err != nil { return err } if !model.IsValidMetricName(model.LabelValue(v.GetName())) { @@ -115,32 +118,31 @@ func (d *protoDecoder) Decode(v *dto.MetricFamily) error { // textDecoder implements the Decoder interface for the text protocol. type textDecoder struct { r io.Reader - p TextParser - fams []*dto.MetricFamily + fams map[string]*dto.MetricFamily + err error } // Decode implements the Decoder interface. func (d *textDecoder) Decode(v *dto.MetricFamily) error { - // TODO(fabxc): Wrap this as a line reader to make streaming safer. - if len(d.fams) == 0 { - // No cached metric families, read everything and parse metrics. - fams, err := d.p.TextToMetricFamilies(d.r) - if err != nil { - return err - } - if len(fams) == 0 { - return io.EOF - } - d.fams = make([]*dto.MetricFamily, 0, len(fams)) - for _, f := range fams { - d.fams = append(d.fams, f) + if d.err == nil { + // Read all metrics in one shot. + var p TextParser + d.fams, d.err = p.TextToMetricFamilies(d.r) + // If we don't get an error, store io.EOF for the end. + if d.err == nil { + d.err = io.EOF } } - - *v = *d.fams[0] - d.fams = d.fams[1:] - - return nil + // Pick off one MetricFamily per Decode until there's nothing left. + for key, fam := range d.fams { + v.Name = fam.Name + v.Help = fam.Help + v.Type = fam.Type + v.Metric = fam.Metric + delete(d.fams, key) + return nil + } + return d.err } // SampleDecoder wraps a Decoder to extract samples from the metric families diff --git a/vendor/github.com/prometheus/common/expfmt/encode.go b/vendor/github.com/prometheus/common/expfmt/encode.go index bd4e347454..cf0c150c2e 100644 --- a/vendor/github.com/prometheus/common/expfmt/encode.go +++ b/vendor/github.com/prometheus/common/expfmt/encode.go @@ -18,9 +18,12 @@ import ( "io" "net/http" - "github.com/golang/protobuf/proto" - "github.com/matttproud/golang_protobuf_extensions/pbutil" - "github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg" + "google.golang.org/protobuf/encoding/protodelim" + "google.golang.org/protobuf/encoding/prototext" + + "github.com/prometheus/common/model" + + "github.com/munnerz/goautoneg" dto "github.com/prometheus/client_model/go" ) @@ -60,23 +63,32 @@ func (ec encoderCloser) Close() error { // as the support is still experimental. To include the option to negotiate // FmtOpenMetrics, use NegotiateOpenMetrics. func Negotiate(h http.Header) Format { + escapingScheme := Format(fmt.Sprintf("; escaping=%s", Format(model.NameEscapingScheme.String()))) for _, ac := range goautoneg.ParseAccept(h.Get(hdrAccept)) { + if escapeParam := ac.Params[model.EscapingKey]; escapeParam != "" { + switch Format(escapeParam) { + case model.AllowUTF8, model.EscapeUnderscores, model.EscapeDots, model.EscapeValues: + escapingScheme = Format(fmt.Sprintf("; escaping=%s", escapeParam)) + default: + // If the escaping parameter is unknown, ignore it. + } + } ver := ac.Params["version"] if ac.Type+"/"+ac.SubType == ProtoType && ac.Params["proto"] == ProtoProtocol { switch ac.Params["encoding"] { case "delimited": - return FmtProtoDelim + return FmtProtoDelim + escapingScheme case "text": - return FmtProtoText + return FmtProtoText + escapingScheme case "compact-text": - return FmtProtoCompact + return FmtProtoCompact + escapingScheme } } if ac.Type == "text" && ac.SubType == "plain" && (ver == TextVersion || ver == "") { - return FmtText + return FmtText + escapingScheme } } - return FmtText + return FmtText + escapingScheme } // NegotiateIncludingOpenMetrics works like Negotiate but includes @@ -84,26 +96,40 @@ func Negotiate(h http.Header) Format { // temporary and will disappear once FmtOpenMetrics is fully supported and as // such may be negotiated by the normal Negotiate function. func NegotiateIncludingOpenMetrics(h http.Header) Format { + escapingScheme := Format(fmt.Sprintf("; escaping=%s", Format(model.NameEscapingScheme.String()))) for _, ac := range goautoneg.ParseAccept(h.Get(hdrAccept)) { + if escapeParam := ac.Params[model.EscapingKey]; escapeParam != "" { + switch Format(escapeParam) { + case model.AllowUTF8, model.EscapeUnderscores, model.EscapeDots, model.EscapeValues: + escapingScheme = Format(fmt.Sprintf("; escaping=%s", escapeParam)) + default: + // If the escaping parameter is unknown, ignore it. + } + } ver := ac.Params["version"] if ac.Type+"/"+ac.SubType == ProtoType && ac.Params["proto"] == ProtoProtocol { switch ac.Params["encoding"] { case "delimited": - return FmtProtoDelim + return FmtProtoDelim + escapingScheme case "text": - return FmtProtoText + return FmtProtoText + escapingScheme case "compact-text": - return FmtProtoCompact + return FmtProtoCompact + escapingScheme } } if ac.Type == "text" && ac.SubType == "plain" && (ver == TextVersion || ver == "") { - return FmtText + return FmtText + escapingScheme } - if ac.Type+"/"+ac.SubType == OpenMetricsType && (ver == OpenMetricsVersion || ver == "") { - return FmtOpenMetrics + if ac.Type+"/"+ac.SubType == OpenMetricsType && (ver == OpenMetricsVersion_0_0_1 || ver == OpenMetricsVersion_1_0_0 || ver == "") { + switch ver { + case OpenMetricsVersion_1_0_0: + return FmtOpenMetrics_1_0_0 + escapingScheme + default: + return FmtOpenMetrics_0_0_1 + escapingScheme + } } } - return FmtText + return FmtText + escapingScheme } // NewEncoder returns a new encoder based on content type negotiation. All @@ -112,44 +138,54 @@ func NegotiateIncludingOpenMetrics(h http.Header) Format { // for FmtOpenMetrics, but a future (breaking) release will add the Close method // to the Encoder interface directly. The current version of the Encoder // interface is kept for backwards compatibility. -func NewEncoder(w io.Writer, format Format) Encoder { - switch format { - case FmtProtoDelim: +// In cases where the Format does not allow for UTF-8 names, the global +// NameEscapingScheme will be applied. +// +// NewEncoder can be called with additional options to customize the OpenMetrics text output. +// For example: +// NewEncoder(w, FmtOpenMetrics_1_0_0, WithCreatedLines()) +// +// Extra options are ignored for all other formats. +func NewEncoder(w io.Writer, format Format, options ...EncoderOption) Encoder { + escapingScheme := format.ToEscapingScheme() + + switch format.FormatType() { + case TypeProtoDelim: return encoderCloser{ encode: func(v *dto.MetricFamily) error { - _, err := pbutil.WriteDelimited(w, v) + _, err := protodelim.MarshalTo(w, v) return err }, close: func() error { return nil }, } - case FmtProtoCompact: + case TypeProtoCompact: return encoderCloser{ encode: func(v *dto.MetricFamily) error { - _, err := fmt.Fprintln(w, v.String()) + _, err := fmt.Fprintln(w, model.EscapeMetricFamily(v, escapingScheme).String()) return err }, close: func() error { return nil }, } - case FmtProtoText: + case TypeProtoText: return encoderCloser{ encode: func(v *dto.MetricFamily) error { - _, err := fmt.Fprintln(w, proto.MarshalTextString(v)) + _, err := fmt.Fprintln(w, prototext.Format(model.EscapeMetricFamily(v, escapingScheme))) return err }, close: func() error { return nil }, } - case FmtText: + case TypeTextPlain: return encoderCloser{ encode: func(v *dto.MetricFamily) error { - _, err := MetricFamilyToText(w, v) + _, err := MetricFamilyToText(w, model.EscapeMetricFamily(v, escapingScheme)) return err }, close: func() error { return nil }, } - case FmtOpenMetrics: + case TypeOpenMetrics: return encoderCloser{ encode: func(v *dto.MetricFamily) error { - _, err := MetricFamilyToOpenMetrics(w, v) + _, err := MetricFamilyToOpenMetrics(w, model.EscapeMetricFamily(v, escapingScheme), options...) return err }, close: func() error { diff --git a/vendor/github.com/prometheus/common/expfmt/expfmt.go b/vendor/github.com/prometheus/common/expfmt/expfmt.go index 0f176fa64f..14034a673a 100644 --- a/vendor/github.com/prometheus/common/expfmt/expfmt.go +++ b/vendor/github.com/prometheus/common/expfmt/expfmt.go @@ -14,28 +14,171 @@ // Package expfmt contains tools for reading and writing Prometheus metrics. package expfmt +import ( + "fmt" + "strings" + + "github.com/prometheus/common/model" +) + // Format specifies the HTTP content type of the different wire protocols. type Format string -// Constants to assemble the Content-Type values for the different wire protocols. +// Constants to assemble the Content-Type values for the different wire +// protocols. The Content-Type strings here are all for the legacy exposition +// formats, where valid characters for metric names and label names are limited. +// Support for arbitrary UTF-8 characters in those names is already partially +// implemented in this module (see model.ValidationScheme), but to actually use +// it on the wire, new content-type strings will have to be agreed upon and +// added here. const ( - TextVersion = "0.0.4" - ProtoType = `application/vnd.google.protobuf` - ProtoProtocol = `io.prometheus.client.MetricFamily` - ProtoFmt = ProtoType + "; proto=" + ProtoProtocol + ";" - OpenMetricsType = `application/openmetrics-text` - OpenMetricsVersion = "0.0.1" - - // The Content-Type values for the different wire protocols. - FmtUnknown Format = `` - FmtText Format = `text/plain; version=` + TextVersion + `; charset=utf-8` - FmtProtoDelim Format = ProtoFmt + ` encoding=delimited` - FmtProtoText Format = ProtoFmt + ` encoding=text` + TextVersion = "0.0.4" + ProtoType = `application/vnd.google.protobuf` + ProtoProtocol = `io.prometheus.client.MetricFamily` + // Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoCompact) instead. + ProtoFmt = ProtoType + "; proto=" + ProtoProtocol + ";" + OpenMetricsType = `application/openmetrics-text` + OpenMetricsVersion_0_0_1 = "0.0.1" + OpenMetricsVersion_1_0_0 = "1.0.0" + + // The Content-Type values for the different wire protocols. Do not do direct + // comparisons to these constants, instead use the comparison functions. + // Deprecated: Use expfmt.NewFormat(expfmt.TypeUnknown) instead. + FmtUnknown Format = `` + // Deprecated: Use expfmt.NewFormat(expfmt.TypeTextPlain) instead. + FmtText Format = `text/plain; version=` + TextVersion + `; charset=utf-8` + // Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoDelim) instead. + FmtProtoDelim Format = ProtoFmt + ` encoding=delimited` + // Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoText) instead. + FmtProtoText Format = ProtoFmt + ` encoding=text` + // Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoCompact) instead. FmtProtoCompact Format = ProtoFmt + ` encoding=compact-text` - FmtOpenMetrics Format = OpenMetricsType + `; version=` + OpenMetricsVersion + `; charset=utf-8` + // Deprecated: Use expfmt.NewFormat(expfmt.TypeOpenMetrics) instead. + FmtOpenMetrics_1_0_0 Format = OpenMetricsType + `; version=` + OpenMetricsVersion_1_0_0 + `; charset=utf-8` + // Deprecated: Use expfmt.NewFormat(expfmt.TypeOpenMetrics) instead. + FmtOpenMetrics_0_0_1 Format = OpenMetricsType + `; version=` + OpenMetricsVersion_0_0_1 + `; charset=utf-8` ) const ( hdrContentType = "Content-Type" hdrAccept = "Accept" ) + +// FormatType is a Go enum representing the overall category for the given +// Format. As the number of Format permutations increases, doing basic string +// comparisons are not feasible, so this enum captures the most useful +// high-level attribute of the Format string. +type FormatType int + +const ( + TypeUnknown FormatType = iota + TypeProtoCompact + TypeProtoDelim + TypeProtoText + TypeTextPlain + TypeOpenMetrics +) + +// NewFormat generates a new Format from the type provided. Mostly used for +// tests, most Formats should be generated as part of content negotiation in +// encode.go. If a type has more than one version, the latest version will be +// returned. +func NewFormat(t FormatType) Format { + switch t { + case TypeProtoCompact: + return FmtProtoCompact + case TypeProtoDelim: + return FmtProtoDelim + case TypeProtoText: + return FmtProtoText + case TypeTextPlain: + return FmtText + case TypeOpenMetrics: + return FmtOpenMetrics_1_0_0 + default: + return FmtUnknown + } +} + +// NewOpenMetricsFormat generates a new OpenMetrics format matching the +// specified version number. +func NewOpenMetricsFormat(version string) (Format, error) { + if version == OpenMetricsVersion_0_0_1 { + return FmtOpenMetrics_0_0_1, nil + } + if version == OpenMetricsVersion_1_0_0 { + return FmtOpenMetrics_1_0_0, nil + } + return FmtUnknown, fmt.Errorf("unknown open metrics version string") +} + +// FormatType deduces an overall FormatType for the given format. +func (f Format) FormatType() FormatType { + toks := strings.Split(string(f), ";") + params := make(map[string]string) + for i, t := range toks { + if i == 0 { + continue + } + args := strings.Split(t, "=") + if len(args) != 2 { + continue + } + params[strings.TrimSpace(args[0])] = strings.TrimSpace(args[1]) + } + + switch strings.TrimSpace(toks[0]) { + case ProtoType: + if params["proto"] != ProtoProtocol { + return TypeUnknown + } + switch params["encoding"] { + case "delimited": + return TypeProtoDelim + case "text": + return TypeProtoText + case "compact-text": + return TypeProtoCompact + default: + return TypeUnknown + } + case OpenMetricsType: + if params["charset"] != "utf-8" { + return TypeUnknown + } + return TypeOpenMetrics + case "text/plain": + v, ok := params["version"] + if !ok { + return TypeTextPlain + } + if v == TextVersion { + return TypeTextPlain + } + return TypeUnknown + default: + return TypeUnknown + } +} + +// ToEscapingScheme returns an EscapingScheme depending on the Format. Iff the +// Format contains a escaping=allow-utf-8 term, it will select NoEscaping. If a valid +// "escaping" term exists, that will be used. Otherwise, the global default will +// be returned. +func (format Format) ToEscapingScheme() model.EscapingScheme { + for _, p := range strings.Split(string(format), ";") { + toks := strings.Split(p, "=") + if len(toks) != 2 { + continue + } + key, value := strings.TrimSpace(toks[0]), strings.TrimSpace(toks[1]) + if key == model.EscapingKey { + scheme, err := model.ToEscapingScheme(value) + if err != nil { + return model.NameEscapingScheme + } + return scheme + } + } + return model.NameEscapingScheme +} diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz.go b/vendor/github.com/prometheus/common/expfmt/fuzz.go index dc2eedeefc..dfac962a4e 100644 --- a/vendor/github.com/prometheus/common/expfmt/fuzz.go +++ b/vendor/github.com/prometheus/common/expfmt/fuzz.go @@ -12,6 +12,7 @@ // limitations under the License. // Build only when actually fuzzing +//go:build gofuzz // +build gofuzz package expfmt @@ -20,8 +21,8 @@ import "bytes" // Fuzz text metric parser with with github.com/dvyukov/go-fuzz: // -// go-fuzz-build github.com/prometheus/common/expfmt -// go-fuzz -bin expfmt-fuzz.zip -workdir fuzz +// go-fuzz-build github.com/prometheus/common/expfmt +// go-fuzz -bin expfmt-fuzz.zip -workdir fuzz // // Further input samples should go in the folder fuzz/corpus. func Fuzz(in []byte) int { diff --git a/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go b/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go index 8a9313a3be..11c8ff4b9d 100644 --- a/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go +++ b/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go @@ -22,12 +22,47 @@ import ( "strconv" "strings" - "github.com/golang/protobuf/ptypes" + "google.golang.org/protobuf/types/known/timestamppb" + "github.com/prometheus/common/model" dto "github.com/prometheus/client_model/go" ) +type encoderOption struct { + withCreatedLines bool + withUnit bool +} + +type EncoderOption func(*encoderOption) + +// WithCreatedLines is an EncoderOption that configures the OpenMetrics encoder +// to include _created lines (See +// https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#counter-1). +// Created timestamps can improve the accuracy of series reset detection, but +// come with a bandwidth cost. +// +// At the time of writing, created timestamp ingestion is still experimental in +// Prometheus and need to be enabled with the feature-flag +// `--feature-flag=created-timestamp-zero-ingestion`, and breaking changes are +// still possible. Therefore, it is recommended to use this feature with caution. +func WithCreatedLines() EncoderOption { + return func(t *encoderOption) { + t.withCreatedLines = true + } +} + +// WithUnit is an EncoderOption enabling a set unit to be written to the output +// and to be added to the metric name, if it's not there already, as a suffix. +// Without opting in this way, the unit will not be added to the metric name and, +// on top of that, the unit will not be passed onto the output, even if it +// were declared in the *dto.MetricFamily struct, i.e. even if in.Unit !=nil. +func WithUnit() EncoderOption { + return func(t *encoderOption) { + t.withUnit = true + } +} + // MetricFamilyToOpenMetrics converts a MetricFamily proto message into the // OpenMetrics text format and writes the resulting lines to 'out'. It returns // the number of bytes written and any error encountered. The output will have @@ -36,6 +71,18 @@ import ( // sanity checks. If the input contains duplicate metrics or invalid metric or // label names, the conversion will result in invalid text format output. // +// If metric names conform to the legacy validation pattern, they will be placed +// outside the brackets in the traditional way, like `foo{}`. If the metric name +// fails the legacy validation check, it will be placed quoted inside the +// brackets: `{"foo"}`. As stated above, the input is assumed to be santized and +// no error will be thrown in this case. +// +// Similar to metric names, if label names conform to the legacy validation +// pattern, they will be unquoted as normal, like `foo{bar="baz"}`. If the label +// name fails the legacy validation check, it will be quoted: +// `foo{"bar"="baz"}`. As stated above, the input is assumed to be santized and +// no error will be thrown in this case. +// // This function fulfills the type 'expfmt.encoder'. // // Note that OpenMetrics requires a final `# EOF` line. Since this function acts @@ -47,21 +94,35 @@ import ( // missing features and peculiarities to avoid complications when switching from // Prometheus to OpenMetrics or vice versa: // -// - Counters are expected to have the `_total` suffix in their metric name. In -// the output, the suffix will be truncated from the `# TYPE` and `# HELP` -// line. A counter with a missing `_total` suffix is not an error. However, -// its type will be set to `unknown` in that case to avoid invalid OpenMetrics -// output. +// - Counters are expected to have the `_total` suffix in their metric name. In +// the output, the suffix will be truncated from the `# TYPE`, `# HELP` and `# UNIT` +// lines. A counter with a missing `_total` suffix is not an error. However, +// its type will be set to `unknown` in that case to avoid invalid OpenMetrics +// output. // -// - No support for the following (optional) features: `# UNIT` line, `_created` -// line, info type, stateset type, gaugehistogram type. +// - According to the OM specs, the `# UNIT` line is optional, but if populated, +// the unit has to be present in the metric name as its suffix: +// (see https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#unit). +// However, in order to accommodate any potential scenario where such a change in the +// metric name is not desirable, the users are here given the choice of either explicitly +// opt in, in case they wish for the unit to be included in the output AND in the metric name +// as a suffix (see the description of the WithUnit function above), +// or not to opt in, in case they don't want for any of that to happen. // -// - The size of exemplar labels is not checked (i.e. it's possible to create -// exemplars that are larger than allowed by the OpenMetrics specification). +// - No support for the following (optional) features: info type, +// stateset type, gaugehistogram type. // -// - The value of Counters is not checked. (OpenMetrics doesn't allow counters -// with a `NaN` value.) -func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int, err error) { +// - The size of exemplar labels is not checked (i.e. it's possible to create +// exemplars that are larger than allowed by the OpenMetrics specification). +// +// - The value of Counters is not checked. (OpenMetrics doesn't allow counters +// with a `NaN` value.) +func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily, options ...EncoderOption) (written int, err error) { + toOM := encoderOption{} + for _, option := range options { + option(&toOM) + } + name := in.GetName() if name == "" { return 0, fmt.Errorf("MetricFamily has no name: %s", in) @@ -84,12 +145,15 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int } var ( - n int - metricType = in.GetType() - shortName = name + n int + metricType = in.GetType() + compliantName = name ) - if metricType == dto.MetricType_COUNTER && strings.HasSuffix(shortName, "_total") { - shortName = name[:len(name)-6] + if metricType == dto.MetricType_COUNTER && strings.HasSuffix(compliantName, "_total") { + compliantName = name[:len(name)-6] + } + if toOM.withUnit && in.Unit != nil && !strings.HasSuffix(compliantName, fmt.Sprintf("_%s", *in.Unit)) { + compliantName = compliantName + fmt.Sprintf("_%s", *in.Unit) } // Comments, first HELP, then TYPE. @@ -99,7 +163,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int if err != nil { return } - n, err = w.WriteString(shortName) + n, err = writeName(w, compliantName) written += n if err != nil { return @@ -125,7 +189,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int if err != nil { return } - n, err = w.WriteString(shortName) + n, err = writeName(w, compliantName) written += n if err != nil { return @@ -152,55 +216,89 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int if err != nil { return } + if toOM.withUnit && in.Unit != nil { + n, err = w.WriteString("# UNIT ") + written += n + if err != nil { + return + } + n, err = writeName(w, compliantName) + written += n + if err != nil { + return + } + + err = w.WriteByte(' ') + written++ + if err != nil { + return + } + n, err = writeEscapedString(w, *in.Unit, true) + written += n + if err != nil { + return + } + err = w.WriteByte('\n') + written++ + if err != nil { + return + } + } + + var createdTsBytesWritten int // Finally the samples, one line for each. + if metricType == dto.MetricType_COUNTER && strings.HasSuffix(name, "_total") { + compliantName = compliantName + "_total" + } for _, metric := range in.Metric { switch metricType { case dto.MetricType_COUNTER: if metric.Counter == nil { return written, fmt.Errorf( - "expected counter in metric %s %s", name, metric, + "expected counter in metric %s %s", compliantName, metric, ) } - // Note that we have ensured above that either the name - // ends on `_total` or that the rendered type is - // `unknown`. Therefore, no `_total` must be added here. n, err = writeOpenMetricsSample( - w, name, "", metric, "", 0, + w, compliantName, "", metric, "", 0, metric.Counter.GetValue(), 0, false, metric.Counter.Exemplar, ) + if toOM.withCreatedLines && metric.Counter.CreatedTimestamp != nil { + createdTsBytesWritten, err = writeOpenMetricsCreated(w, compliantName, "_total", metric, "", 0, metric.Counter.GetCreatedTimestamp()) + n += createdTsBytesWritten + } case dto.MetricType_GAUGE: if metric.Gauge == nil { return written, fmt.Errorf( - "expected gauge in metric %s %s", name, metric, + "expected gauge in metric %s %s", compliantName, metric, ) } n, err = writeOpenMetricsSample( - w, name, "", metric, "", 0, + w, compliantName, "", metric, "", 0, metric.Gauge.GetValue(), 0, false, nil, ) case dto.MetricType_UNTYPED: if metric.Untyped == nil { return written, fmt.Errorf( - "expected untyped in metric %s %s", name, metric, + "expected untyped in metric %s %s", compliantName, metric, ) } n, err = writeOpenMetricsSample( - w, name, "", metric, "", 0, + w, compliantName, "", metric, "", 0, metric.Untyped.GetValue(), 0, false, nil, ) case dto.MetricType_SUMMARY: if metric.Summary == nil { return written, fmt.Errorf( - "expected summary in metric %s %s", name, metric, + "expected summary in metric %s %s", compliantName, metric, ) } for _, q := range metric.Summary.Quantile { n, err = writeOpenMetricsSample( - w, name, "", metric, + w, compliantName, "", metric, model.QuantileLabel, q.GetQuantile(), q.GetValue(), 0, false, nil, @@ -211,7 +309,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int } } n, err = writeOpenMetricsSample( - w, name, "_sum", metric, "", 0, + w, compliantName, "_sum", metric, "", 0, metric.Summary.GetSampleSum(), 0, false, nil, ) @@ -220,20 +318,24 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int return } n, err = writeOpenMetricsSample( - w, name, "_count", metric, "", 0, + w, compliantName, "_count", metric, "", 0, 0, metric.Summary.GetSampleCount(), true, nil, ) + if toOM.withCreatedLines && metric.Summary.CreatedTimestamp != nil { + createdTsBytesWritten, err = writeOpenMetricsCreated(w, compliantName, "", metric, "", 0, metric.Summary.GetCreatedTimestamp()) + n += createdTsBytesWritten + } case dto.MetricType_HISTOGRAM: if metric.Histogram == nil { return written, fmt.Errorf( - "expected histogram in metric %s %s", name, metric, + "expected histogram in metric %s %s", compliantName, metric, ) } infSeen := false for _, b := range metric.Histogram.Bucket { n, err = writeOpenMetricsSample( - w, name, "_bucket", metric, + w, compliantName, "_bucket", metric, model.BucketLabel, b.GetUpperBound(), 0, b.GetCumulativeCount(), true, b.Exemplar, @@ -248,7 +350,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int } if !infSeen { n, err = writeOpenMetricsSample( - w, name, "_bucket", metric, + w, compliantName, "_bucket", metric, model.BucketLabel, math.Inf(+1), 0, metric.Histogram.GetSampleCount(), true, nil, @@ -259,7 +361,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int } } n, err = writeOpenMetricsSample( - w, name, "_sum", metric, "", 0, + w, compliantName, "_sum", metric, "", 0, metric.Histogram.GetSampleSum(), 0, false, nil, ) @@ -268,13 +370,17 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int return } n, err = writeOpenMetricsSample( - w, name, "_count", metric, "", 0, + w, compliantName, "_count", metric, "", 0, 0, metric.Histogram.GetSampleCount(), true, nil, ) + if toOM.withCreatedLines && metric.Histogram.CreatedTimestamp != nil { + createdTsBytesWritten, err = writeOpenMetricsCreated(w, compliantName, "", metric, "", 0, metric.Histogram.GetCreatedTimestamp()) + n += createdTsBytesWritten + } default: return written, fmt.Errorf( - "unexpected type in metric %s %s", name, metric, + "unexpected type in metric %s %s", compliantName, metric, ) } written += n @@ -304,21 +410,9 @@ func writeOpenMetricsSample( floatValue float64, intValue uint64, useIntValue bool, exemplar *dto.Exemplar, ) (int, error) { - var written int - n, err := w.WriteString(name) - written += n - if err != nil { - return written, err - } - if suffix != "" { - n, err = w.WriteString(suffix) - written += n - if err != nil { - return written, err - } - } - n, err = writeOpenMetricsLabelPairs( - w, metric.Label, additionalLabelName, additionalLabelValue, + written := 0 + n, err := writeOpenMetricsNameAndLabelPairs( + w, name+suffix, metric.Label, additionalLabelName, additionalLabelValue, ) written += n if err != nil { @@ -351,7 +445,7 @@ func writeOpenMetricsSample( return written, err } } - if exemplar != nil { + if exemplar != nil && len(exemplar.Label) > 0 { n, err = writeExemplar(w, exemplar) written += n if err != nil { @@ -366,27 +460,58 @@ func writeOpenMetricsSample( return written, nil } -// writeOpenMetricsLabelPairs works like writeOpenMetrics but formats the float -// in OpenMetrics style. -func writeOpenMetricsLabelPairs( +// writeOpenMetricsNameAndLabelPairs works like writeOpenMetricsSample but +// formats the float in OpenMetrics style. +func writeOpenMetricsNameAndLabelPairs( w enhancedWriter, + name string, in []*dto.LabelPair, additionalLabelName string, additionalLabelValue float64, ) (int, error) { - if len(in) == 0 && additionalLabelName == "" { - return 0, nil - } var ( - written int - separator byte = '{' + written int + separator byte = '{' + metricInsideBraces = false ) + + if name != "" { + // If the name does not pass the legacy validity check, we must put the + // metric name inside the braces, quoted. + if !model.IsValidLegacyMetricName(name) { + metricInsideBraces = true + err := w.WriteByte(separator) + written++ + if err != nil { + return written, err + } + separator = ',' + } + + n, err := writeName(w, name) + written += n + if err != nil { + return written, err + } + } + + if len(in) == 0 && additionalLabelName == "" { + if metricInsideBraces { + err := w.WriteByte('}') + written++ + if err != nil { + return written, err + } + } + return written, nil + } + for _, lp := range in { err := w.WriteByte(separator) written++ if err != nil { return written, err } - n, err := w.WriteString(lp.GetName()) + n, err := writeName(w, lp.GetName()) written += n if err != nil { return written, err @@ -443,6 +568,49 @@ func writeOpenMetricsLabelPairs( return written, nil } +// writeOpenMetricsCreated writes the created timestamp for a single time series +// following OpenMetrics text format to w, given the metric name, the metric proto +// message itself, optionally a suffix to be removed, e.g. '_total' for counters, +// an additional label name with a float64 value (use empty string as label name if +// not required) and the timestamp that represents the created timestamp. +// The function returns the number of bytes written and any error encountered. +func writeOpenMetricsCreated(w enhancedWriter, + name, suffixToTrim string, metric *dto.Metric, + additionalLabelName string, additionalLabelValue float64, + createdTimestamp *timestamppb.Timestamp, +) (int, error) { + written := 0 + n, err := writeOpenMetricsNameAndLabelPairs( + w, strings.TrimSuffix(name, suffixToTrim)+"_created", metric.Label, additionalLabelName, additionalLabelValue, + ) + written += n + if err != nil { + return written, err + } + + err = w.WriteByte(' ') + written++ + if err != nil { + return written, err + } + + // TODO(beorn7): Format this directly from components of ts to + // avoid overflow/underflow and precision issues of the float + // conversion. + n, err = writeOpenMetricsFloat(w, float64(createdTimestamp.AsTime().UnixNano())/1e9) + written += n + if err != nil { + return written, err + } + + err = w.WriteByte('\n') + written++ + if err != nil { + return written, err + } + return written, nil +} + // writeExemplar writes the provided exemplar in OpenMetrics format to w. The // function returns the number of bytes written and any error encountered. func writeExemplar(w enhancedWriter, e *dto.Exemplar) (int, error) { @@ -452,7 +620,7 @@ func writeExemplar(w enhancedWriter, e *dto.Exemplar) (int, error) { if err != nil { return written, err } - n, err = writeOpenMetricsLabelPairs(w, e.Label, "", 0) + n, err = writeOpenMetricsNameAndLabelPairs(w, "", e.Label, "", 0) written += n if err != nil { return written, err @@ -473,10 +641,11 @@ func writeExemplar(w enhancedWriter, e *dto.Exemplar) (int, error) { if err != nil { return written, err } - ts, err := ptypes.Timestamp((*e).Timestamp) + err = (*e).Timestamp.CheckValid() if err != nil { return written, err } + ts := (*e).Timestamp.AsTime() // TODO(beorn7): Format this directly from components of ts to // avoid overflow/underflow and precision issues of the float // conversion. diff --git a/vendor/github.com/prometheus/common/expfmt/text_create.go b/vendor/github.com/prometheus/common/expfmt/text_create.go index 5ba503b065..4b86434b33 100644 --- a/vendor/github.com/prometheus/common/expfmt/text_create.go +++ b/vendor/github.com/prometheus/common/expfmt/text_create.go @@ -17,7 +17,6 @@ import ( "bufio" "fmt" "io" - "io/ioutil" "math" "strconv" "strings" @@ -44,7 +43,7 @@ const ( var ( bufPool = sync.Pool{ New: func() interface{} { - return bufio.NewWriter(ioutil.Discard) + return bufio.NewWriter(io.Discard) }, } numBufPool = sync.Pool{ @@ -63,6 +62,18 @@ var ( // contains duplicate metrics or invalid metric or label names, the conversion // will result in invalid text format output. // +// If metric names conform to the legacy validation pattern, they will be placed +// outside the brackets in the traditional way, like `foo{}`. If the metric name +// fails the legacy validation check, it will be placed quoted inside the +// brackets: `{"foo"}`. As stated above, the input is assumed to be santized and +// no error will be thrown in this case. +// +// Similar to metric names, if label names conform to the legacy validation +// pattern, they will be unquoted as normal, like `foo{bar="baz"}`. If the label +// name fails the legacy validation check, it will be quoted: +// `foo{"bar"="baz"}`. As stated above, the input is assumed to be santized and +// no error will be thrown in this case. +// // This method fulfills the type 'prometheus.encoder'. func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (written int, err error) { // Fail-fast checks. @@ -99,7 +110,7 @@ func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (written int, err e if err != nil { return } - n, err = w.WriteString(name) + n, err = writeName(w, name) written += n if err != nil { return @@ -125,7 +136,7 @@ func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (written int, err e if err != nil { return } - n, err = w.WriteString(name) + n, err = writeName(w, name) written += n if err != nil { return @@ -281,21 +292,9 @@ func writeSample( additionalLabelName string, additionalLabelValue float64, value float64, ) (int, error) { - var written int - n, err := w.WriteString(name) - written += n - if err != nil { - return written, err - } - if suffix != "" { - n, err = w.WriteString(suffix) - written += n - if err != nil { - return written, err - } - } - n, err = writeLabelPairs( - w, metric.Label, additionalLabelName, additionalLabelValue, + written := 0 + n, err := writeNameAndLabelPairs( + w, name+suffix, metric.Label, additionalLabelName, additionalLabelValue, ) written += n if err != nil { @@ -331,32 +330,64 @@ func writeSample( return written, nil } -// writeLabelPairs converts a slice of LabelPair proto messages plus the -// explicitly given additional label pair into text formatted as required by the -// text format and writes it to 'w'. An empty slice in combination with an empty -// string 'additionalLabelName' results in nothing being written. Otherwise, the -// label pairs are written, escaped as required by the text format, and enclosed -// in '{...}'. The function returns the number of bytes written and any error -// encountered. -func writeLabelPairs( +// writeNameAndLabelPairs converts a slice of LabelPair proto messages plus the +// explicitly given metric name and additional label pair into text formatted as +// required by the text format and writes it to 'w'. An empty slice in +// combination with an empty string 'additionalLabelName' results in nothing +// being written. Otherwise, the label pairs are written, escaped as required by +// the text format, and enclosed in '{...}'. The function returns the number of +// bytes written and any error encountered. If the metric name is not +// legacy-valid, it will be put inside the brackets as well. Legacy-invalid +// label names will also be quoted. +func writeNameAndLabelPairs( w enhancedWriter, + name string, in []*dto.LabelPair, additionalLabelName string, additionalLabelValue float64, ) (int, error) { - if len(in) == 0 && additionalLabelName == "" { - return 0, nil - } var ( - written int - separator byte = '{' + written int + separator byte = '{' + metricInsideBraces = false ) + + if name != "" { + // If the name does not pass the legacy validity check, we must put the + // metric name inside the braces. + if !model.IsValidLegacyMetricName(name) { + metricInsideBraces = true + err := w.WriteByte(separator) + written++ + if err != nil { + return written, err + } + separator = ',' + } + n, err := writeName(w, name) + written += n + if err != nil { + return written, err + } + } + + if len(in) == 0 && additionalLabelName == "" { + if metricInsideBraces { + err := w.WriteByte('}') + written++ + if err != nil { + return written, err + } + } + return written, nil + } + for _, lp := range in { err := w.WriteByte(separator) written++ if err != nil { return written, err } - n, err := w.WriteString(lp.GetName()) + n, err := writeName(w, lp.GetName()) written += n if err != nil { return written, err @@ -463,3 +494,27 @@ func writeInt(w enhancedWriter, i int64) (int, error) { numBufPool.Put(bp) return written, err } + +// writeName writes a string as-is if it complies with the legacy naming +// scheme, or escapes it in double quotes if not. +func writeName(w enhancedWriter, name string) (int, error) { + if model.IsValidLegacyMetricName(name) { + return w.WriteString(name) + } + var written int + var err error + err = w.WriteByte('"') + written++ + if err != nil { + return written, err + } + var n int + n, err = writeEscapedString(w, name, true) + written += n + if err != nil { + return written, err + } + err = w.WriteByte('"') + written++ + return written, err +} diff --git a/vendor/github.com/prometheus/common/expfmt/text_parse.go b/vendor/github.com/prometheus/common/expfmt/text_parse.go index b6079b31ee..25db4f2151 100644 --- a/vendor/github.com/prometheus/common/expfmt/text_parse.go +++ b/vendor/github.com/prometheus/common/expfmt/text_parse.go @@ -16,15 +16,17 @@ package expfmt import ( "bufio" "bytes" + "errors" "fmt" "io" "math" "strconv" "strings" + "unicode/utf8" dto "github.com/prometheus/client_model/go" + "google.golang.org/protobuf/proto" - "github.com/golang/protobuf/proto" "github.com/prometheus/common/model" ) @@ -58,6 +60,7 @@ type TextParser struct { currentMF *dto.MetricFamily currentMetric *dto.Metric currentLabelPair *dto.LabelPair + currentLabelPairs []*dto.LabelPair // Temporarily stores label pairs while parsing a metric line. // The remaining member variables are only used for summaries/histograms. currentLabels map[string]string // All labels including '__name__' but excluding 'quantile'/'le' @@ -72,6 +75,7 @@ type TextParser struct { // count and sum of that summary/histogram. currentIsSummaryCount, currentIsSummarySum bool currentIsHistogramCount, currentIsHistogramSum bool + currentMetricIsInsideBraces bool } // TextToMetricFamilies reads 'in' as the simple and flat text-based exchange @@ -112,7 +116,7 @@ func (p *TextParser) TextToMetricFamilies(in io.Reader) (map[string]*dto.MetricF // stream. Turn this error into something nicer and more // meaningful. (io.EOF is often used as a signal for the legitimate end // of an input stream.) - if p.err == io.EOF { + if p.err != nil && errors.Is(p.err, io.EOF) { p.parseError("unexpected end of input stream") } return p.metricFamiliesByName, p.err @@ -135,16 +139,22 @@ func (p *TextParser) reset(in io.Reader) { } p.currentQuantile = math.NaN() p.currentBucket = math.NaN() + p.currentMF = nil } // startOfLine represents the state where the next byte read from p.buf is the // start of a line (or whitespace leading up to it). func (p *TextParser) startOfLine() stateFn { p.lineCount++ + p.currentMetricIsInsideBraces = false if p.skipBlankTab(); p.err != nil { - // End of input reached. This is the only case where - // that is not an error but a signal that we are done. - p.err = nil + // This is the only place that we expect to see io.EOF, + // which is not an error but the signal that we are done. + // Any other error that happens to align with the start of + // a line is still an error. + if errors.Is(p.err, io.EOF) { + p.err = nil + } return nil } switch p.currentByte { @@ -152,6 +162,9 @@ func (p *TextParser) startOfLine() stateFn { return p.startComment case '\n': return p.startOfLine // Empty line, start the next one. + case '{': + p.currentMetricIsInsideBraces = true + return p.readingLabels } return p.readingMetricName } @@ -269,6 +282,8 @@ func (p *TextParser) startLabelName() stateFn { return nil // Unexpected end of input. } if p.currentByte == '}' { + p.currentMetric.Label = append(p.currentMetric.Label, p.currentLabelPairs...) + p.currentLabelPairs = nil if p.skipBlankTab(); p.err != nil { return nil // Unexpected end of input. } @@ -281,6 +296,38 @@ func (p *TextParser) startLabelName() stateFn { p.parseError(fmt.Sprintf("invalid label name for metric %q", p.currentMF.GetName())) return nil } + if p.skipBlankTabIfCurrentBlankTab(); p.err != nil { + return nil // Unexpected end of input. + } + if p.currentByte != '=' { + if p.currentMetricIsInsideBraces { + if p.currentMF != nil && p.currentMF.GetName() != p.currentToken.String() { + p.parseError(fmt.Sprintf("multiple metric names %s %s", p.currentMF.GetName(), p.currentToken.String())) + return nil + } + switch p.currentByte { + case ',': + p.setOrCreateCurrentMF() + p.currentMetric = &dto.Metric{} + return p.startLabelName + case '}': + p.setOrCreateCurrentMF() + p.currentMetric = &dto.Metric{} + p.currentMetric.Label = append(p.currentMetric.Label, p.currentLabelPairs...) + p.currentLabelPairs = nil + if p.skipBlankTab(); p.err != nil { + return nil // Unexpected end of input. + } + return p.readingValue + default: + p.parseError(fmt.Sprintf("unexpected end of metric name %q", p.currentByte)) + return nil + } + } + p.parseError(fmt.Sprintf("expected '=' after label name, found %q", p.currentByte)) + p.currentLabelPairs = nil + return nil + } p.currentLabelPair = &dto.LabelPair{Name: proto.String(p.currentToken.String())} if p.currentLabelPair.GetName() == string(model.MetricNameLabel) { p.parseError(fmt.Sprintf("label name %q is reserved", model.MetricNameLabel)) @@ -290,23 +337,17 @@ func (p *TextParser) startLabelName() stateFn { // labels to 'real' labels. if !(p.currentMF.GetType() == dto.MetricType_SUMMARY && p.currentLabelPair.GetName() == model.QuantileLabel) && !(p.currentMF.GetType() == dto.MetricType_HISTOGRAM && p.currentLabelPair.GetName() == model.BucketLabel) { - p.currentMetric.Label = append(p.currentMetric.Label, p.currentLabelPair) - } - if p.skipBlankTabIfCurrentBlankTab(); p.err != nil { - return nil // Unexpected end of input. - } - if p.currentByte != '=' { - p.parseError(fmt.Sprintf("expected '=' after label name, found %q", p.currentByte)) - return nil + p.currentLabelPairs = append(p.currentLabelPairs, p.currentLabelPair) } // Check for duplicate label names. labels := make(map[string]struct{}) - for _, l := range p.currentMetric.Label { + for _, l := range p.currentLabelPairs { lName := l.GetName() if _, exists := labels[lName]; !exists { labels[lName] = struct{}{} } else { p.parseError(fmt.Sprintf("duplicate label names for metric %q", p.currentMF.GetName())) + p.currentLabelPairs = nil return nil } } @@ -339,6 +380,7 @@ func (p *TextParser) startLabelValue() stateFn { if p.currentQuantile, p.err = parseFloat(p.currentLabelPair.GetValue()); p.err != nil { // Create a more helpful error message. p.parseError(fmt.Sprintf("expected float as value for 'quantile' label, got %q", p.currentLabelPair.GetValue())) + p.currentLabelPairs = nil return nil } } else { @@ -365,12 +407,19 @@ func (p *TextParser) startLabelValue() stateFn { return p.startLabelName case '}': + if p.currentMF == nil { + p.parseError("invalid metric name") + return nil + } + p.currentMetric.Label = append(p.currentMetric.Label, p.currentLabelPairs...) + p.currentLabelPairs = nil if p.skipBlankTab(); p.err != nil { return nil // Unexpected end of input. } return p.readingValue default: p.parseError(fmt.Sprintf("unexpected end of label value %q", p.currentLabelPair.GetValue())) + p.currentLabelPairs = nil return nil } } @@ -579,6 +628,8 @@ func (p *TextParser) readTokenUntilNewline(recognizeEscapeSequence bool) { p.currentToken.WriteByte(p.currentByte) case 'n': p.currentToken.WriteByte('\n') + case '"': + p.currentToken.WriteByte('"') default: p.parseError(fmt.Sprintf("invalid escape sequence '\\%c'", p.currentByte)) return @@ -604,13 +655,45 @@ func (p *TextParser) readTokenUntilNewline(recognizeEscapeSequence bool) { // but not into p.currentToken. func (p *TextParser) readTokenAsMetricName() { p.currentToken.Reset() + // A UTF-8 metric name must be quoted and may have escaped characters. + quoted := false + escaped := false if !isValidMetricNameStart(p.currentByte) { return } - for { - p.currentToken.WriteByte(p.currentByte) + for p.err == nil { + if escaped { + switch p.currentByte { + case '\\': + p.currentToken.WriteByte(p.currentByte) + case 'n': + p.currentToken.WriteByte('\n') + case '"': + p.currentToken.WriteByte('"') + default: + p.parseError(fmt.Sprintf("invalid escape sequence '\\%c'", p.currentByte)) + return + } + escaped = false + } else { + switch p.currentByte { + case '"': + quoted = !quoted + if !quoted { + p.currentByte, p.err = p.buf.ReadByte() + return + } + case '\n': + p.parseError(fmt.Sprintf("metric name %q contains unescaped new-line", p.currentToken.String())) + return + case '\\': + escaped = true + default: + p.currentToken.WriteByte(p.currentByte) + } + } p.currentByte, p.err = p.buf.ReadByte() - if p.err != nil || !isValidMetricNameContinuation(p.currentByte) { + if !isValidMetricNameContinuation(p.currentByte, quoted) || (!quoted && p.currentByte == ' ') { return } } @@ -622,13 +705,45 @@ func (p *TextParser) readTokenAsMetricName() { // but not into p.currentToken. func (p *TextParser) readTokenAsLabelName() { p.currentToken.Reset() + // A UTF-8 label name must be quoted and may have escaped characters. + quoted := false + escaped := false if !isValidLabelNameStart(p.currentByte) { return } - for { - p.currentToken.WriteByte(p.currentByte) + for p.err == nil { + if escaped { + switch p.currentByte { + case '\\': + p.currentToken.WriteByte(p.currentByte) + case 'n': + p.currentToken.WriteByte('\n') + case '"': + p.currentToken.WriteByte('"') + default: + p.parseError(fmt.Sprintf("invalid escape sequence '\\%c'", p.currentByte)) + return + } + escaped = false + } else { + switch p.currentByte { + case '"': + quoted = !quoted + if !quoted { + p.currentByte, p.err = p.buf.ReadByte() + return + } + case '\n': + p.parseError(fmt.Sprintf("label name %q contains unescaped new-line", p.currentToken.String())) + return + case '\\': + escaped = true + default: + p.currentToken.WriteByte(p.currentByte) + } + } p.currentByte, p.err = p.buf.ReadByte() - if p.err != nil || !isValidLabelNameContinuation(p.currentByte) { + if !isValidLabelNameContinuation(p.currentByte, quoted) || (!quoted && p.currentByte == '=') { return } } @@ -654,6 +769,7 @@ func (p *TextParser) readTokenAsLabelValue() { p.currentToken.WriteByte('\n') default: p.parseError(fmt.Sprintf("invalid escape sequence '\\%c'", p.currentByte)) + p.currentLabelPairs = nil return } escaped = false @@ -712,19 +828,19 @@ func (p *TextParser) setOrCreateCurrentMF() { } func isValidLabelNameStart(b byte) bool { - return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' + return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' || b == '"' } -func isValidLabelNameContinuation(b byte) bool { - return isValidLabelNameStart(b) || (b >= '0' && b <= '9') +func isValidLabelNameContinuation(b byte, quoted bool) bool { + return isValidLabelNameStart(b) || (b >= '0' && b <= '9') || (quoted && utf8.ValidString(string(b))) } func isValidMetricNameStart(b byte) bool { return isValidLabelNameStart(b) || b == ':' } -func isValidMetricNameContinuation(b byte) bool { - return isValidLabelNameContinuation(b) || b == ':' +func isValidMetricNameContinuation(b byte, quoted bool) bool { + return isValidLabelNameContinuation(b, quoted) || b == ':' } func isBlankOrTab(b byte) bool { diff --git a/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go b/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go deleted file mode 100644 index 26e92288c7..0000000000 --- a/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright (c) 2011, Open Knowledge Foundation Ltd. -All rights reserved. - -HTTP Content-Type Autonegotiation. - -The functions in this package implement the behaviour specified in -http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html - -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 Open Knowledge Foundation Ltd. 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. - - -*/ -package goautoneg - -import ( - "sort" - "strconv" - "strings" -) - -// Structure to represent a clause in an HTTP Accept Header -type Accept struct { - Type, SubType string - Q float64 - Params map[string]string -} - -// For internal use, so that we can use the sort interface -type accept_slice []Accept - -func (accept accept_slice) Len() int { - slice := []Accept(accept) - return len(slice) -} - -func (accept accept_slice) Less(i, j int) bool { - slice := []Accept(accept) - ai, aj := slice[i], slice[j] - if ai.Q > aj.Q { - return true - } - if ai.Type != "*" && aj.Type == "*" { - return true - } - if ai.SubType != "*" && aj.SubType == "*" { - return true - } - return false -} - -func (accept accept_slice) Swap(i, j int) { - slice := []Accept(accept) - slice[i], slice[j] = slice[j], slice[i] -} - -// Parse an Accept Header string returning a sorted list -// of clauses -func ParseAccept(header string) (accept []Accept) { - parts := strings.Split(header, ",") - accept = make([]Accept, 0, len(parts)) - for _, part := range parts { - part := strings.Trim(part, " ") - - a := Accept{} - a.Params = make(map[string]string) - a.Q = 1.0 - - mrp := strings.Split(part, ";") - - media_range := mrp[0] - sp := strings.Split(media_range, "/") - a.Type = strings.Trim(sp[0], " ") - - switch { - case len(sp) == 1 && a.Type == "*": - a.SubType = "*" - case len(sp) == 2: - a.SubType = strings.Trim(sp[1], " ") - default: - continue - } - - if len(mrp) == 1 { - accept = append(accept, a) - continue - } - - for _, param := range mrp[1:] { - sp := strings.SplitN(param, "=", 2) - if len(sp) != 2 { - continue - } - token := strings.Trim(sp[0], " ") - if token == "q" { - a.Q, _ = strconv.ParseFloat(sp[1], 32) - } else { - a.Params[token] = strings.Trim(sp[1], " ") - } - } - - accept = append(accept, a) - } - - slice := accept_slice(accept) - sort.Sort(slice) - - return -} - -// Negotiate the most appropriate content_type given the accept header -// and a list of alternatives. -func Negotiate(header string, alternatives []string) (content_type string) { - asp := make([][]string, 0, len(alternatives)) - for _, ctype := range alternatives { - asp = append(asp, strings.SplitN(ctype, "/", 2)) - } - for _, clause := range ParseAccept(header) { - for i, ctsp := range asp { - if clause.Type == ctsp[0] && clause.SubType == ctsp[1] { - content_type = alternatives[i] - return - } - if clause.Type == ctsp[0] && clause.SubType == "*" { - content_type = alternatives[i] - return - } - if clause.Type == "*" && clause.SubType == "*" { - content_type = alternatives[i] - return - } - } - } - return -} diff --git a/vendor/github.com/prometheus/common/model/alert.go b/vendor/github.com/prometheus/common/model/alert.go index 35e739c7ad..80d1fe944e 100644 --- a/vendor/github.com/prometheus/common/model/alert.go +++ b/vendor/github.com/prometheus/common/model/alert.go @@ -75,7 +75,12 @@ func (a *Alert) ResolvedAt(ts time.Time) bool { // Status returns the status of the alert. func (a *Alert) Status() AlertStatus { - if a.Resolved() { + return a.StatusAt(time.Now()) +} + +// StatusAt returns the status of the alert at the given timestamp. +func (a *Alert) StatusAt(ts time.Time) AlertStatus { + if a.ResolvedAt(ts) { return AlertResolved } return AlertFiring @@ -90,13 +95,13 @@ func (a *Alert) Validate() error { return fmt.Errorf("start time must be before end time") } if err := a.Labels.Validate(); err != nil { - return fmt.Errorf("invalid label set: %s", err) + return fmt.Errorf("invalid label set: %w", err) } if len(a.Labels) == 0 { return fmt.Errorf("at least one label pair required") } if err := a.Annotations.Validate(); err != nil { - return fmt.Errorf("invalid annotations: %s", err) + return fmt.Errorf("invalid annotations: %w", err) } return nil } @@ -127,6 +132,17 @@ func (as Alerts) HasFiring() bool { return false } +// HasFiringAt returns true iff one of the alerts is not resolved +// at the time ts. +func (as Alerts) HasFiringAt(ts time.Time) bool { + for _, a := range as { + if !a.ResolvedAt(ts) { + return true + } + } + return false +} + // Status returns StatusFiring iff at least one of the alerts is firing. func (as Alerts) Status() AlertStatus { if as.HasFiring() { @@ -134,3 +150,12 @@ func (as Alerts) Status() AlertStatus { } return AlertResolved } + +// StatusAt returns StatusFiring iff at least one of the alerts is firing +// at the time ts. +func (as Alerts) StatusAt(ts time.Time) AlertStatus { + if as.HasFiringAt(ts) { + return AlertFiring + } + return AlertResolved +} diff --git a/vendor/github.com/prometheus/common/model/labels.go b/vendor/github.com/prometheus/common/model/labels.go index ef89563354..73b7aa3e60 100644 --- a/vendor/github.com/prometheus/common/model/labels.go +++ b/vendor/github.com/prometheus/common/model/labels.go @@ -97,10 +97,27 @@ var LabelNameRE = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9_]*$") // therewith. type LabelName string -// IsValid is true iff the label name matches the pattern of LabelNameRE. This -// method, however, does not use LabelNameRE for the check but a much faster -// hardcoded implementation. +// IsValid returns true iff the name matches the pattern of LabelNameRE when +// NameValidationScheme is set to LegacyValidation, or valid UTF-8 if +// NameValidationScheme is set to UTF8Validation. func (ln LabelName) IsValid() bool { + if len(ln) == 0 { + return false + } + switch NameValidationScheme { + case LegacyValidation: + return ln.IsValidLegacy() + case UTF8Validation: + return utf8.ValidString(string(ln)) + default: + panic(fmt.Sprintf("Invalid name validation scheme requested: %d", NameValidationScheme)) + } +} + +// IsValidLegacy returns true iff name matches the pattern of LabelNameRE for +// legacy names. It does not use LabelNameRE for the check but a much faster +// hardcoded implementation. +func (ln LabelName) IsValidLegacy() bool { if len(ln) == 0 { return false } @@ -164,7 +181,7 @@ func (l LabelNames) String() string { // A LabelValue is an associated value for a LabelName. type LabelValue string -// IsValid returns true iff the string is a valid UTF8. +// IsValid returns true iff the string is a valid UTF-8. func (lv LabelValue) IsValid() bool { return utf8.ValidString(string(lv)) } diff --git a/vendor/github.com/prometheus/common/model/labelset.go b/vendor/github.com/prometheus/common/model/labelset.go index 6eda08a739..d0ad88da33 100644 --- a/vendor/github.com/prometheus/common/model/labelset.go +++ b/vendor/github.com/prometheus/common/model/labelset.go @@ -17,7 +17,6 @@ import ( "encoding/json" "fmt" "sort" - "strings" ) // A LabelSet is a collection of LabelName and LabelValue pairs. The LabelSet @@ -129,16 +128,6 @@ func (l LabelSet) Merge(other LabelSet) LabelSet { return result } -func (l LabelSet) String() string { - lstrs := make([]string, 0, len(l)) - for l, v := range l { - lstrs = append(lstrs, fmt.Sprintf("%s=%q", l, v)) - } - - sort.Strings(lstrs) - return fmt.Sprintf("{%s}", strings.Join(lstrs, ", ")) -} - // Fingerprint returns the LabelSet's fingerprint. func (ls LabelSet) Fingerprint() Fingerprint { return labelSetToFingerprint(ls) diff --git a/vendor/github.com/prometheus/common/model/labelset_string.go b/vendor/github.com/prometheus/common/model/labelset_string.go new file mode 100644 index 0000000000..481c47b46e --- /dev/null +++ b/vendor/github.com/prometheus/common/model/labelset_string.go @@ -0,0 +1,45 @@ +// Copyright 2024 The Prometheus 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:build go1.21 + +package model + +import ( + "bytes" + "slices" + "strconv" +) + +// String will look like `{foo="bar", more="less"}`. Names are sorted alphabetically. +func (l LabelSet) String() string { + var lna [32]string // On stack to avoid memory allocation for sorting names. + labelNames := lna[:0] + for name := range l { + labelNames = append(labelNames, string(name)) + } + slices.Sort(labelNames) + var bytea [1024]byte // On stack to avoid memory allocation while building the output. + b := bytes.NewBuffer(bytea[:0]) + b.WriteByte('{') + for i, name := range labelNames { + if i > 0 { + b.WriteString(", ") + } + b.WriteString(name) + b.WriteByte('=') + b.Write(strconv.AppendQuote(b.AvailableBuffer(), string(l[LabelName(name)]))) + } + b.WriteByte('}') + return b.String() +} diff --git a/vendor/github.com/prometheus/common/model/labelset_string_go120.go b/vendor/github.com/prometheus/common/model/labelset_string_go120.go new file mode 100644 index 0000000000..c4212685e7 --- /dev/null +++ b/vendor/github.com/prometheus/common/model/labelset_string_go120.go @@ -0,0 +1,39 @@ +// Copyright 2024 The Prometheus 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:build !go1.21 + +package model + +import ( + "fmt" + "sort" + "strings" +) + +// String was optimized using functions not available for go 1.20 +// or lower. We keep the old implementation for compatibility with client_golang. +// Once client golang drops support for go 1.20 (scheduled for August 2024), this +// file can be removed. +func (l LabelSet) String() string { + labelNames := make([]string, 0, len(l)) + for name := range l { + labelNames = append(labelNames, string(name)) + } + sort.Strings(labelNames) + lstrs := make([]string, 0, len(l)) + for _, name := range labelNames { + lstrs = append(lstrs, fmt.Sprintf("%s=%q", name, l[LabelName(name)])) + } + return fmt.Sprintf("{%s}", strings.Join(lstrs, ", ")) +} diff --git a/vendor/github.com/prometheus/common/model/metadata.go b/vendor/github.com/prometheus/common/model/metadata.go new file mode 100644 index 0000000000..447ab8ad63 --- /dev/null +++ b/vendor/github.com/prometheus/common/model/metadata.go @@ -0,0 +1,28 @@ +// Copyright 2023 The Prometheus 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 model + +// MetricType represents metric type values. +type MetricType string + +const ( + MetricTypeCounter = MetricType("counter") + MetricTypeGauge = MetricType("gauge") + MetricTypeHistogram = MetricType("histogram") + MetricTypeGaugeHistogram = MetricType("gaugehistogram") + MetricTypeSummary = MetricType("summary") + MetricTypeInfo = MetricType("info") + MetricTypeStateset = MetricType("stateset") + MetricTypeUnknown = MetricType("unknown") +) diff --git a/vendor/github.com/prometheus/common/model/metric.go b/vendor/github.com/prometheus/common/model/metric.go index 00804b7fed..c44f93f314 100644 --- a/vendor/github.com/prometheus/common/model/metric.go +++ b/vendor/github.com/prometheus/common/model/metric.go @@ -18,15 +18,84 @@ import ( "regexp" "sort" "strings" + "unicode/utf8" + + dto "github.com/prometheus/client_model/go" + "google.golang.org/protobuf/proto" ) var ( - // MetricNameRE is a regular expression matching valid metric - // names. Note that the IsValidMetricName function performs the same - // check but faster than a match with this regular expression. - MetricNameRE = regexp.MustCompile(`^[a-zA-Z_:][a-zA-Z0-9_:]*$`) + // NameValidationScheme determines the method of name validation to be used by + // all calls to IsValidMetricName() and LabelName IsValid(). Setting UTF-8 mode + // in isolation from other components that don't support UTF-8 may result in + // bugs or other undefined behavior. This value is intended to be set by + // UTF-8-aware binaries as part of their startup. To avoid need for locking, + // this value should be set once, ideally in an init(), before multiple + // goroutines are started. + NameValidationScheme = LegacyValidation + + // NameEscapingScheme defines the default way that names will be + // escaped when presented to systems that do not support UTF-8 names. If the + // Content-Type "escaping" term is specified, that will override this value. + NameEscapingScheme = ValueEncodingEscaping +) + +// ValidationScheme is a Go enum for determining how metric and label names will +// be validated by this library. +type ValidationScheme int + +const ( + // LegacyValidation is a setting that requirets that metric and label names + // conform to the original Prometheus character requirements described by + // MetricNameRE and LabelNameRE. + LegacyValidation ValidationScheme = iota + + // UTF8Validation only requires that metric and label names be valid UTF-8 + // strings. + UTF8Validation +) + +type EscapingScheme int + +const ( + // NoEscaping indicates that a name will not be escaped. Unescaped names that + // do not conform to the legacy validity check will use a new exposition + // format syntax that will be officially standardized in future versions. + NoEscaping EscapingScheme = iota + + // UnderscoreEscaping replaces all legacy-invalid characters with underscores. + UnderscoreEscaping + + // DotsEscaping is similar to UnderscoreEscaping, except that dots are + // converted to `_dot_` and pre-existing underscores are converted to `__`. + DotsEscaping + + // ValueEncodingEscaping prepends the name with `U__` and replaces all invalid + // characters with the unicode value, surrounded by underscores. Single + // underscores are replaced with double underscores. + ValueEncodingEscaping +) + +const ( + // EscapingKey is the key in an Accept or Content-Type header that defines how + // metric and label names that do not conform to the legacy character + // requirements should be escaped when being scraped by a legacy prometheus + // system. If a system does not explicitly pass an escaping parameter in the + // Accept header, the default NameEscapingScheme will be used. + EscapingKey = "escaping" + + // Possible values for Escaping Key: + AllowUTF8 = "allow-utf-8" // No escaping required. + EscapeUnderscores = "underscores" + EscapeDots = "dots" + EscapeValues = "values" ) +// MetricNameRE is a regular expression matching valid metric +// names. Note that the IsValidMetricName function performs the same +// check but faster than a match with this regular expression. +var MetricNameRE = regexp.MustCompile(`^[a-zA-Z_:][a-zA-Z0-9_:]*$`) + // A Metric is similar to a LabelSet, but the key difference is that a Metric is // a singleton and refers to one and only one stream of samples. type Metric LabelSet @@ -86,17 +155,303 @@ func (m Metric) FastFingerprint() Fingerprint { return LabelSet(m).FastFingerprint() } -// IsValidMetricName returns true iff name matches the pattern of MetricNameRE. +// IsValidMetricName returns true iff name matches the pattern of MetricNameRE +// for legacy names, and iff it's valid UTF-8 if the UTF8Validation scheme is +// selected. +func IsValidMetricName(n LabelValue) bool { + switch NameValidationScheme { + case LegacyValidation: + return IsValidLegacyMetricName(string(n)) + case UTF8Validation: + if len(n) == 0 { + return false + } + return utf8.ValidString(string(n)) + default: + panic(fmt.Sprintf("Invalid name validation scheme requested: %d", NameValidationScheme)) + } +} + +// IsValidLegacyMetricName is similar to IsValidMetricName but always uses the +// legacy validation scheme regardless of the value of NameValidationScheme. // This function, however, does not use MetricNameRE for the check but a much // faster hardcoded implementation. -func IsValidMetricName(n LabelValue) bool { +func IsValidLegacyMetricName(n string) bool { if len(n) == 0 { return false } for i, b := range n { - if !((b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' || b == ':' || (b >= '0' && b <= '9' && i > 0)) { + if !isValidLegacyRune(b, i) { return false } } return true } + +// EscapeMetricFamily escapes the given metric names and labels with the given +// escaping scheme. Returns a new object that uses the same pointers to fields +// when possible and creates new escaped versions so as not to mutate the +// input. +func EscapeMetricFamily(v *dto.MetricFamily, scheme EscapingScheme) *dto.MetricFamily { + if v == nil { + return nil + } + + if scheme == NoEscaping { + return v + } + + out := &dto.MetricFamily{ + Help: v.Help, + Type: v.Type, + Unit: v.Unit, + } + + // If the name is nil, copy as-is, don't try to escape. + if v.Name == nil || IsValidLegacyMetricName(v.GetName()) { + out.Name = v.Name + } else { + out.Name = proto.String(EscapeName(v.GetName(), scheme)) + } + for _, m := range v.Metric { + if !metricNeedsEscaping(m) { + out.Metric = append(out.Metric, m) + continue + } + + escaped := &dto.Metric{ + Gauge: m.Gauge, + Counter: m.Counter, + Summary: m.Summary, + Untyped: m.Untyped, + Histogram: m.Histogram, + TimestampMs: m.TimestampMs, + } + + for _, l := range m.Label { + if l.GetName() == MetricNameLabel { + if l.Value == nil || IsValidLegacyMetricName(l.GetValue()) { + escaped.Label = append(escaped.Label, l) + continue + } + escaped.Label = append(escaped.Label, &dto.LabelPair{ + Name: proto.String(MetricNameLabel), + Value: proto.String(EscapeName(l.GetValue(), scheme)), + }) + continue + } + if l.Name == nil || IsValidLegacyMetricName(l.GetName()) { + escaped.Label = append(escaped.Label, l) + continue + } + escaped.Label = append(escaped.Label, &dto.LabelPair{ + Name: proto.String(EscapeName(l.GetName(), scheme)), + Value: l.Value, + }) + } + out.Metric = append(out.Metric, escaped) + } + return out +} + +func metricNeedsEscaping(m *dto.Metric) bool { + for _, l := range m.Label { + if l.GetName() == MetricNameLabel && !IsValidLegacyMetricName(l.GetValue()) { + return true + } + if !IsValidLegacyMetricName(l.GetName()) { + return true + } + } + return false +} + +const ( + lowerhex = "0123456789abcdef" +) + +// EscapeName escapes the incoming name according to the provided escaping +// scheme. Depending on the rules of escaping, this may cause no change in the +// string that is returned. (Especially NoEscaping, which by definition is a +// noop). This function does not do any validation of the name. +func EscapeName(name string, scheme EscapingScheme) string { + if len(name) == 0 { + return name + } + var escaped strings.Builder + switch scheme { + case NoEscaping: + return name + case UnderscoreEscaping: + if IsValidLegacyMetricName(name) { + return name + } + for i, b := range name { + if isValidLegacyRune(b, i) { + escaped.WriteRune(b) + } else { + escaped.WriteRune('_') + } + } + return escaped.String() + case DotsEscaping: + // Do not early return for legacy valid names, we still escape underscores. + for i, b := range name { + if b == '_' { + escaped.WriteString("__") + } else if b == '.' { + escaped.WriteString("_dot_") + } else if isValidLegacyRune(b, i) { + escaped.WriteRune(b) + } else { + escaped.WriteRune('_') + } + } + return escaped.String() + case ValueEncodingEscaping: + if IsValidLegacyMetricName(name) { + return name + } + escaped.WriteString("U__") + for i, b := range name { + if isValidLegacyRune(b, i) { + escaped.WriteRune(b) + } else if !utf8.ValidRune(b) { + escaped.WriteString("_FFFD_") + } else if b < 0x100 { + escaped.WriteRune('_') + for s := 4; s >= 0; s -= 4 { + escaped.WriteByte(lowerhex[b>>uint(s)&0xF]) + } + escaped.WriteRune('_') + } else if b < 0x10000 { + escaped.WriteRune('_') + for s := 12; s >= 0; s -= 4 { + escaped.WriteByte(lowerhex[b>>uint(s)&0xF]) + } + escaped.WriteRune('_') + } + } + return escaped.String() + default: + panic(fmt.Sprintf("invalid escaping scheme %d", scheme)) + } +} + +// lower function taken from strconv.atoi +func lower(c byte) byte { + return c | ('x' - 'X') +} + +// UnescapeName unescapes the incoming name according to the provided escaping +// scheme if possible. Some schemes are partially or totally non-roundtripable. +// If any error is enountered, returns the original input. +func UnescapeName(name string, scheme EscapingScheme) string { + if len(name) == 0 { + return name + } + switch scheme { + case NoEscaping: + return name + case UnderscoreEscaping: + // It is not possible to unescape from underscore replacement. + return name + case DotsEscaping: + name = strings.ReplaceAll(name, "_dot_", ".") + name = strings.ReplaceAll(name, "__", "_") + return name + case ValueEncodingEscaping: + escapedName, found := strings.CutPrefix(name, "U__") + if !found { + return name + } + + var unescaped strings.Builder + TOP: + for i := 0; i < len(escapedName); i++ { + // All non-underscores are treated normally. + if escapedName[i] != '_' { + unescaped.WriteByte(escapedName[i]) + continue + } + i++ + if i >= len(escapedName) { + return name + } + // A double underscore is a single underscore. + if escapedName[i] == '_' { + unescaped.WriteByte('_') + continue + } + // We think we are in a UTF-8 code, process it. + var utf8Val uint + for j := 0; i < len(escapedName); j++ { + // This is too many characters for a utf8 value. + if j > 4 { + return name + } + // Found a closing underscore, convert to a rune, check validity, and append. + if escapedName[i] == '_' { + utf8Rune := rune(utf8Val) + if !utf8.ValidRune(utf8Rune) { + return name + } + unescaped.WriteRune(utf8Rune) + continue TOP + } + r := lower(escapedName[i]) + utf8Val *= 16 + if r >= '0' && r <= '9' { + utf8Val += uint(r) - '0' + } else if r >= 'a' && r <= 'f' { + utf8Val += uint(r) - 'a' + 10 + } else { + return name + } + i++ + } + // Didn't find closing underscore, invalid. + return name + } + return unescaped.String() + default: + panic(fmt.Sprintf("invalid escaping scheme %d", scheme)) + } +} + +func isValidLegacyRune(b rune, i int) bool { + return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' || b == ':' || (b >= '0' && b <= '9' && i > 0) +} + +func (e EscapingScheme) String() string { + switch e { + case NoEscaping: + return AllowUTF8 + case UnderscoreEscaping: + return EscapeUnderscores + case DotsEscaping: + return EscapeDots + case ValueEncodingEscaping: + return EscapeValues + default: + panic(fmt.Sprintf("unknown format scheme %d", e)) + } +} + +func ToEscapingScheme(s string) (EscapingScheme, error) { + if s == "" { + return NoEscaping, fmt.Errorf("got empty string instead of escaping scheme") + } + switch s { + case AllowUTF8: + return NoEscaping, nil + case EscapeUnderscores: + return UnderscoreEscaping, nil + case EscapeDots: + return DotsEscaping, nil + case EscapeValues: + return ValueEncodingEscaping, nil + default: + return NoEscaping, fmt.Errorf("unknown format scheme %s", s) + } +} diff --git a/vendor/github.com/prometheus/common/model/signature.go b/vendor/github.com/prometheus/common/model/signature.go index 8762b13c63..dc8a0026c4 100644 --- a/vendor/github.com/prometheus/common/model/signature.go +++ b/vendor/github.com/prometheus/common/model/signature.go @@ -22,10 +22,8 @@ import ( // when calculating their combined hash value (aka signature aka fingerprint). const SeparatorByte byte = 255 -var ( - // cache the signature of an empty label set. - emptyLabelSignature = hashNew() -) +// cache the signature of an empty label set. +var emptyLabelSignature = hashNew() // LabelsToSignature returns a quasi-unique signature (i.e., fingerprint) for a // given label set. (Collisions are possible but unlikely if the number of label diff --git a/vendor/github.com/prometheus/common/model/silence.go b/vendor/github.com/prometheus/common/model/silence.go index bb99889d2c..910b0b71fc 100644 --- a/vendor/github.com/prometheus/common/model/silence.go +++ b/vendor/github.com/prometheus/common/model/silence.go @@ -81,7 +81,7 @@ func (s *Silence) Validate() error { } for _, m := range s.Matchers { if err := m.Validate(); err != nil { - return fmt.Errorf("invalid matcher: %s", err) + return fmt.Errorf("invalid matcher: %w", err) } } if s.StartsAt.IsZero() { diff --git a/vendor/github.com/prometheus/common/model/time.go b/vendor/github.com/prometheus/common/model/time.go index 7f67b16e42..5727452c1e 100644 --- a/vendor/github.com/prometheus/common/model/time.go +++ b/vendor/github.com/prometheus/common/model/time.go @@ -18,7 +18,6 @@ import ( "errors" "fmt" "math" - "regexp" "strconv" "strings" "time" @@ -183,54 +182,78 @@ func (d *Duration) Type() string { return "duration" } -var durationRE = regexp.MustCompile("^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$") +func isdigit(c byte) bool { return c >= '0' && c <= '9' } + +// Units are required to go in order from biggest to smallest. +// This guards against confusion from "1m1d" being 1 minute + 1 day, not 1 month + 1 day. +var unitMap = map[string]struct { + pos int + mult uint64 +}{ + "ms": {7, uint64(time.Millisecond)}, + "s": {6, uint64(time.Second)}, + "m": {5, uint64(time.Minute)}, + "h": {4, uint64(time.Hour)}, + "d": {3, uint64(24 * time.Hour)}, + "w": {2, uint64(7 * 24 * time.Hour)}, + "y": {1, uint64(365 * 24 * time.Hour)}, +} // ParseDuration parses a string into a time.Duration, assuming that a year // always has 365d, a week always has 7d, and a day always has 24h. -func ParseDuration(durationStr string) (Duration, error) { - switch durationStr { +func ParseDuration(s string) (Duration, error) { + switch s { case "0": // Allow 0 without a unit. return 0, nil case "": - return 0, fmt.Errorf("empty duration string") - } - matches := durationRE.FindStringSubmatch(durationStr) - if matches == nil { - return 0, fmt.Errorf("not a valid duration string: %q", durationStr) + return 0, errors.New("empty duration string") } - var dur time.Duration - // Parse the match at pos `pos` in the regex and use `mult` to turn that - // into ms, then add that value to the total parsed duration. - var overflowErr error - m := func(pos int, mult time.Duration) { - if matches[pos] == "" { - return + orig := s + var dur uint64 + lastUnitPos := 0 + + for s != "" { + if !isdigit(s[0]) { + return 0, fmt.Errorf("not a valid duration string: %q", orig) + } + // Consume [0-9]* + i := 0 + for ; i < len(s) && isdigit(s[i]); i++ { + } + v, err := strconv.ParseUint(s[:i], 10, 0) + if err != nil { + return 0, fmt.Errorf("not a valid duration string: %q", orig) } - n, _ := strconv.Atoi(matches[pos]) + s = s[i:] + // Consume unit. + for i = 0; i < len(s) && !isdigit(s[i]); i++ { + } + if i == 0 { + return 0, fmt.Errorf("not a valid duration string: %q", orig) + } + u := s[:i] + s = s[i:] + unit, ok := unitMap[u] + if !ok { + return 0, fmt.Errorf("unknown unit %q in duration %q", u, orig) + } + if unit.pos <= lastUnitPos { // Units must go in order from biggest to smallest. + return 0, fmt.Errorf("not a valid duration string: %q", orig) + } + lastUnitPos = unit.pos // Check if the provided duration overflows time.Duration (> ~ 290years). - if n > int((1<<63-1)/mult/time.Millisecond) { - overflowErr = errors.New("duration out of range") + if v > 1<<63/unit.mult { + return 0, errors.New("duration out of range") } - d := time.Duration(n) * time.Millisecond - dur += d * mult - - if dur < 0 { - overflowErr = errors.New("duration out of range") + dur += v * unit.mult + if dur > 1<<63-1 { + return 0, errors.New("duration out of range") } } - - m(2, 1000*60*60*24*365) // y - m(4, 1000*60*60*24*7) // w - m(6, 1000*60*60*24) // d - m(8, 1000*60*60) // h - m(10, 1000*60) // m - m(12, 1000) // s - m(14, 1) // ms - - return Duration(dur), overflowErr + return Duration(dur), nil } func (d Duration) String() string { diff --git a/vendor/github.com/prometheus/common/model/value.go b/vendor/github.com/prometheus/common/model/value.go index c9d8fb1a28..8050637d82 100644 --- a/vendor/github.com/prometheus/common/model/value.go +++ b/vendor/github.com/prometheus/common/model/value.go @@ -16,104 +16,26 @@ package model import ( "encoding/json" "fmt" - "math" "sort" "strconv" "strings" ) -var ( - // ZeroSamplePair is the pseudo zero-value of SamplePair used to signal a - // non-existing sample pair. It is a SamplePair with timestamp Earliest and - // value 0.0. Note that the natural zero value of SamplePair has a timestamp - // of 0, which is possible to appear in a real SamplePair and thus not - // suitable to signal a non-existing SamplePair. - ZeroSamplePair = SamplePair{Timestamp: Earliest} - - // ZeroSample is the pseudo zero-value of Sample used to signal a - // non-existing sample. It is a Sample with timestamp Earliest, value 0.0, - // and metric nil. Note that the natural zero value of Sample has a timestamp - // of 0, which is possible to appear in a real Sample and thus not suitable - // to signal a non-existing Sample. - ZeroSample = Sample{Timestamp: Earliest} -) - -// A SampleValue is a representation of a value for a given sample at a given -// time. -type SampleValue float64 - -// MarshalJSON implements json.Marshaler. -func (v SampleValue) MarshalJSON() ([]byte, error) { - return json.Marshal(v.String()) -} - -// UnmarshalJSON implements json.Unmarshaler. -func (v *SampleValue) UnmarshalJSON(b []byte) error { - if len(b) < 2 || b[0] != '"' || b[len(b)-1] != '"' { - return fmt.Errorf("sample value must be a quoted string") - } - f, err := strconv.ParseFloat(string(b[1:len(b)-1]), 64) - if err != nil { - return err - } - *v = SampleValue(f) - return nil -} - -// Equal returns true if the value of v and o is equal or if both are NaN. Note -// that v==o is false if both are NaN. If you want the conventional float -// behavior, use == to compare two SampleValues. -func (v SampleValue) Equal(o SampleValue) bool { - if v == o { - return true - } - return math.IsNaN(float64(v)) && math.IsNaN(float64(o)) -} - -func (v SampleValue) String() string { - return strconv.FormatFloat(float64(v), 'f', -1, 64) -} - -// SamplePair pairs a SampleValue with a Timestamp. -type SamplePair struct { - Timestamp Time - Value SampleValue -} - -// MarshalJSON implements json.Marshaler. -func (s SamplePair) MarshalJSON() ([]byte, error) { - t, err := json.Marshal(s.Timestamp) - if err != nil { - return nil, err - } - v, err := json.Marshal(s.Value) - if err != nil { - return nil, err - } - return []byte(fmt.Sprintf("[%s,%s]", t, v)), nil -} - -// UnmarshalJSON implements json.Unmarshaler. -func (s *SamplePair) UnmarshalJSON(b []byte) error { - v := [...]json.Unmarshaler{&s.Timestamp, &s.Value} - return json.Unmarshal(b, &v) -} - -// Equal returns true if this SamplePair and o have equal Values and equal -// Timestamps. The semantics of Value equality is defined by SampleValue.Equal. -func (s *SamplePair) Equal(o *SamplePair) bool { - return s == o || (s.Value.Equal(o.Value) && s.Timestamp.Equal(o.Timestamp)) -} - -func (s SamplePair) String() string { - return fmt.Sprintf("%s @[%s]", s.Value, s.Timestamp) -} +// ZeroSample is the pseudo zero-value of Sample used to signal a +// non-existing sample. It is a Sample with timestamp Earliest, value 0.0, +// and metric nil. Note that the natural zero value of Sample has a timestamp +// of 0, which is possible to appear in a real Sample and thus not suitable +// to signal a non-existing Sample. +var ZeroSample = Sample{Timestamp: Earliest} -// Sample is a sample pair associated with a metric. +// Sample is a sample pair associated with a metric. A single sample must either +// define Value or Histogram but not both. Histogram == nil implies the Value +// field is used, otherwise it should be ignored. type Sample struct { - Metric Metric `json:"metric"` - Value SampleValue `json:"value"` - Timestamp Time `json:"timestamp"` + Metric Metric `json:"metric"` + Value SampleValue `json:"value"` + Timestamp Time `json:"timestamp"` + Histogram *SampleHistogram `json:"histogram"` } // Equal compares first the metrics, then the timestamp, then the value. The @@ -129,11 +51,19 @@ func (s *Sample) Equal(o *Sample) bool { if !s.Timestamp.Equal(o.Timestamp) { return false } - + if s.Histogram != nil { + return s.Histogram.Equal(o.Histogram) + } return s.Value.Equal(o.Value) } func (s Sample) String() string { + if s.Histogram != nil { + return fmt.Sprintf("%s => %s", s.Metric, SampleHistogramPair{ + Timestamp: s.Timestamp, + Histogram: s.Histogram, + }) + } return fmt.Sprintf("%s => %s", s.Metric, SamplePair{ Timestamp: s.Timestamp, Value: s.Value, @@ -142,6 +72,19 @@ func (s Sample) String() string { // MarshalJSON implements json.Marshaler. func (s Sample) MarshalJSON() ([]byte, error) { + if s.Histogram != nil { + v := struct { + Metric Metric `json:"metric"` + Histogram SampleHistogramPair `json:"histogram"` + }{ + Metric: s.Metric, + Histogram: SampleHistogramPair{ + Timestamp: s.Timestamp, + Histogram: s.Histogram, + }, + } + return json.Marshal(&v) + } v := struct { Metric Metric `json:"metric"` Value SamplePair `json:"value"` @@ -152,21 +95,25 @@ func (s Sample) MarshalJSON() ([]byte, error) { Value: s.Value, }, } - return json.Marshal(&v) } // UnmarshalJSON implements json.Unmarshaler. func (s *Sample) UnmarshalJSON(b []byte) error { v := struct { - Metric Metric `json:"metric"` - Value SamplePair `json:"value"` + Metric Metric `json:"metric"` + Value SamplePair `json:"value"` + Histogram SampleHistogramPair `json:"histogram"` }{ Metric: s.Metric, Value: SamplePair{ Timestamp: s.Timestamp, Value: s.Value, }, + Histogram: SampleHistogramPair{ + Timestamp: s.Timestamp, + Histogram: s.Histogram, + }, } if err := json.Unmarshal(b, &v); err != nil { @@ -174,8 +121,13 @@ func (s *Sample) UnmarshalJSON(b []byte) error { } s.Metric = v.Metric - s.Timestamp = v.Value.Timestamp - s.Value = v.Value.Value + if v.Histogram.Histogram != nil { + s.Timestamp = v.Histogram.Timestamp + s.Histogram = v.Histogram.Histogram + } else { + s.Timestamp = v.Value.Timestamp + s.Value = v.Value.Value + } return nil } @@ -221,80 +173,76 @@ func (s Samples) Equal(o Samples) bool { // SampleStream is a stream of Values belonging to an attached COWMetric. type SampleStream struct { - Metric Metric `json:"metric"` - Values []SamplePair `json:"values"` + Metric Metric `json:"metric"` + Values []SamplePair `json:"values"` + Histograms []SampleHistogramPair `json:"histograms"` } func (ss SampleStream) String() string { - vals := make([]string, len(ss.Values)) + valuesLength := len(ss.Values) + vals := make([]string, valuesLength+len(ss.Histograms)) for i, v := range ss.Values { vals[i] = v.String() } + for i, v := range ss.Histograms { + vals[i+valuesLength] = v.String() + } return fmt.Sprintf("%s =>\n%s", ss.Metric, strings.Join(vals, "\n")) } -// Value is a generic interface for values resulting from a query evaluation. -type Value interface { - Type() ValueType - String() string +func (ss SampleStream) MarshalJSON() ([]byte, error) { + if len(ss.Histograms) > 0 && len(ss.Values) > 0 { + v := struct { + Metric Metric `json:"metric"` + Values []SamplePair `json:"values"` + Histograms []SampleHistogramPair `json:"histograms"` + }{ + Metric: ss.Metric, + Values: ss.Values, + Histograms: ss.Histograms, + } + return json.Marshal(&v) + } else if len(ss.Histograms) > 0 { + v := struct { + Metric Metric `json:"metric"` + Histograms []SampleHistogramPair `json:"histograms"` + }{ + Metric: ss.Metric, + Histograms: ss.Histograms, + } + return json.Marshal(&v) + } else { + v := struct { + Metric Metric `json:"metric"` + Values []SamplePair `json:"values"` + }{ + Metric: ss.Metric, + Values: ss.Values, + } + return json.Marshal(&v) + } } -func (Matrix) Type() ValueType { return ValMatrix } -func (Vector) Type() ValueType { return ValVector } -func (*Scalar) Type() ValueType { return ValScalar } -func (*String) Type() ValueType { return ValString } - -type ValueType int - -const ( - ValNone ValueType = iota - ValScalar - ValVector - ValMatrix - ValString -) - -// MarshalJSON implements json.Marshaler. -func (et ValueType) MarshalJSON() ([]byte, error) { - return json.Marshal(et.String()) -} +func (ss *SampleStream) UnmarshalJSON(b []byte) error { + v := struct { + Metric Metric `json:"metric"` + Values []SamplePair `json:"values"` + Histograms []SampleHistogramPair `json:"histograms"` + }{ + Metric: ss.Metric, + Values: ss.Values, + Histograms: ss.Histograms, + } -func (et *ValueType) UnmarshalJSON(b []byte) error { - var s string - if err := json.Unmarshal(b, &s); err != nil { + if err := json.Unmarshal(b, &v); err != nil { return err } - switch s { - case "": - *et = ValNone - case "scalar": - *et = ValScalar - case "vector": - *et = ValVector - case "matrix": - *et = ValMatrix - case "string": - *et = ValString - default: - return fmt.Errorf("unknown value type %q", s) - } - return nil -} -func (e ValueType) String() string { - switch e { - case ValNone: - return "" - case ValScalar: - return "scalar" - case ValVector: - return "vector" - case ValMatrix: - return "matrix" - case ValString: - return "string" - } - panic("ValueType.String: unhandled value type") + ss.Metric = v.Metric + ss.Values = v.Values + ss.Histograms = v.Histograms + + return nil } // Scalar is a scalar value evaluated at the set timestamp. @@ -324,7 +272,7 @@ func (s *Scalar) UnmarshalJSON(b []byte) error { value, err := strconv.ParseFloat(f, 64) if err != nil { - return fmt.Errorf("error parsing sample value: %s", err) + return fmt.Errorf("error parsing sample value: %w", err) } s.Value = SampleValue(value) return nil diff --git a/vendor/github.com/prometheus/common/model/value_float.go b/vendor/github.com/prometheus/common/model/value_float.go new file mode 100644 index 0000000000..ae35cc2ab4 --- /dev/null +++ b/vendor/github.com/prometheus/common/model/value_float.go @@ -0,0 +1,98 @@ +// Copyright 2013 The Prometheus 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 model + +import ( + "encoding/json" + "fmt" + "math" + "strconv" +) + +// ZeroSamplePair is the pseudo zero-value of SamplePair used to signal a +// non-existing sample pair. It is a SamplePair with timestamp Earliest and +// value 0.0. Note that the natural zero value of SamplePair has a timestamp +// of 0, which is possible to appear in a real SamplePair and thus not +// suitable to signal a non-existing SamplePair. +var ZeroSamplePair = SamplePair{Timestamp: Earliest} + +// A SampleValue is a representation of a value for a given sample at a given +// time. +type SampleValue float64 + +// MarshalJSON implements json.Marshaler. +func (v SampleValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.String()) +} + +// UnmarshalJSON implements json.Unmarshaler. +func (v *SampleValue) UnmarshalJSON(b []byte) error { + if len(b) < 2 || b[0] != '"' || b[len(b)-1] != '"' { + return fmt.Errorf("sample value must be a quoted string") + } + f, err := strconv.ParseFloat(string(b[1:len(b)-1]), 64) + if err != nil { + return err + } + *v = SampleValue(f) + return nil +} + +// Equal returns true if the value of v and o is equal or if both are NaN. Note +// that v==o is false if both are NaN. If you want the conventional float +// behavior, use == to compare two SampleValues. +func (v SampleValue) Equal(o SampleValue) bool { + if v == o { + return true + } + return math.IsNaN(float64(v)) && math.IsNaN(float64(o)) +} + +func (v SampleValue) String() string { + return strconv.FormatFloat(float64(v), 'f', -1, 64) +} + +// SamplePair pairs a SampleValue with a Timestamp. +type SamplePair struct { + Timestamp Time + Value SampleValue +} + +func (s SamplePair) MarshalJSON() ([]byte, error) { + t, err := json.Marshal(s.Timestamp) + if err != nil { + return nil, err + } + v, err := json.Marshal(s.Value) + if err != nil { + return nil, err + } + return []byte(fmt.Sprintf("[%s,%s]", t, v)), nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (s *SamplePair) UnmarshalJSON(b []byte) error { + v := [...]json.Unmarshaler{&s.Timestamp, &s.Value} + return json.Unmarshal(b, &v) +} + +// Equal returns true if this SamplePair and o have equal Values and equal +// Timestamps. The semantics of Value equality is defined by SampleValue.Equal. +func (s *SamplePair) Equal(o *SamplePair) bool { + return s == o || (s.Value.Equal(o.Value) && s.Timestamp.Equal(o.Timestamp)) +} + +func (s SamplePair) String() string { + return fmt.Sprintf("%s @[%s]", s.Value, s.Timestamp) +} diff --git a/vendor/github.com/prometheus/common/model/value_histogram.go b/vendor/github.com/prometheus/common/model/value_histogram.go new file mode 100644 index 0000000000..54bb038cff --- /dev/null +++ b/vendor/github.com/prometheus/common/model/value_histogram.go @@ -0,0 +1,178 @@ +// Copyright 2013 The Prometheus 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 model + +import ( + "encoding/json" + "fmt" + "strconv" + "strings" +) + +type FloatString float64 + +func (v FloatString) String() string { + return strconv.FormatFloat(float64(v), 'f', -1, 64) +} + +func (v FloatString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.String()) +} + +func (v *FloatString) UnmarshalJSON(b []byte) error { + if len(b) < 2 || b[0] != '"' || b[len(b)-1] != '"' { + return fmt.Errorf("float value must be a quoted string") + } + f, err := strconv.ParseFloat(string(b[1:len(b)-1]), 64) + if err != nil { + return err + } + *v = FloatString(f) + return nil +} + +type HistogramBucket struct { + Boundaries int32 + Lower FloatString + Upper FloatString + Count FloatString +} + +func (s HistogramBucket) MarshalJSON() ([]byte, error) { + b, err := json.Marshal(s.Boundaries) + if err != nil { + return nil, err + } + l, err := json.Marshal(s.Lower) + if err != nil { + return nil, err + } + u, err := json.Marshal(s.Upper) + if err != nil { + return nil, err + } + c, err := json.Marshal(s.Count) + if err != nil { + return nil, err + } + return []byte(fmt.Sprintf("[%s,%s,%s,%s]", b, l, u, c)), nil +} + +func (s *HistogramBucket) UnmarshalJSON(buf []byte) error { + tmp := []interface{}{&s.Boundaries, &s.Lower, &s.Upper, &s.Count} + wantLen := len(tmp) + if err := json.Unmarshal(buf, &tmp); err != nil { + return err + } + if gotLen := len(tmp); gotLen != wantLen { + return fmt.Errorf("wrong number of fields: %d != %d", gotLen, wantLen) + } + return nil +} + +func (s *HistogramBucket) Equal(o *HistogramBucket) bool { + return s == o || (s.Boundaries == o.Boundaries && s.Lower == o.Lower && s.Upper == o.Upper && s.Count == o.Count) +} + +func (b HistogramBucket) String() string { + var sb strings.Builder + lowerInclusive := b.Boundaries == 1 || b.Boundaries == 3 + upperInclusive := b.Boundaries == 0 || b.Boundaries == 3 + if lowerInclusive { + sb.WriteRune('[') + } else { + sb.WriteRune('(') + } + fmt.Fprintf(&sb, "%g,%g", b.Lower, b.Upper) + if upperInclusive { + sb.WriteRune(']') + } else { + sb.WriteRune(')') + } + fmt.Fprintf(&sb, ":%v", b.Count) + return sb.String() +} + +type HistogramBuckets []*HistogramBucket + +func (s HistogramBuckets) Equal(o HistogramBuckets) bool { + if len(s) != len(o) { + return false + } + + for i, bucket := range s { + if !bucket.Equal(o[i]) { + return false + } + } + return true +} + +type SampleHistogram struct { + Count FloatString `json:"count"` + Sum FloatString `json:"sum"` + Buckets HistogramBuckets `json:"buckets"` +} + +func (s SampleHistogram) String() string { + return fmt.Sprintf("Count: %f, Sum: %f, Buckets: %v", s.Count, s.Sum, s.Buckets) +} + +func (s *SampleHistogram) Equal(o *SampleHistogram) bool { + return s == o || (s.Count == o.Count && s.Sum == o.Sum && s.Buckets.Equal(o.Buckets)) +} + +type SampleHistogramPair struct { + Timestamp Time + // Histogram should never be nil, it's only stored as pointer for efficiency. + Histogram *SampleHistogram +} + +func (s SampleHistogramPair) MarshalJSON() ([]byte, error) { + if s.Histogram == nil { + return nil, fmt.Errorf("histogram is nil") + } + t, err := json.Marshal(s.Timestamp) + if err != nil { + return nil, err + } + v, err := json.Marshal(s.Histogram) + if err != nil { + return nil, err + } + return []byte(fmt.Sprintf("[%s,%s]", t, v)), nil +} + +func (s *SampleHistogramPair) UnmarshalJSON(buf []byte) error { + tmp := []interface{}{&s.Timestamp, &s.Histogram} + wantLen := len(tmp) + if err := json.Unmarshal(buf, &tmp); err != nil { + return err + } + if gotLen := len(tmp); gotLen != wantLen { + return fmt.Errorf("wrong number of fields: %d != %d", gotLen, wantLen) + } + if s.Histogram == nil { + return fmt.Errorf("histogram is null") + } + return nil +} + +func (s SampleHistogramPair) String() string { + return fmt.Sprintf("%s @[%s]", s.Histogram, s.Timestamp) +} + +func (s *SampleHistogramPair) Equal(o *SampleHistogramPair) bool { + return s == o || (s.Histogram.Equal(o.Histogram) && s.Timestamp.Equal(o.Timestamp)) +} diff --git a/vendor/github.com/prometheus/common/model/value_type.go b/vendor/github.com/prometheus/common/model/value_type.go new file mode 100644 index 0000000000..726c50ee63 --- /dev/null +++ b/vendor/github.com/prometheus/common/model/value_type.go @@ -0,0 +1,83 @@ +// Copyright 2013 The Prometheus 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 model + +import ( + "encoding/json" + "fmt" +) + +// Value is a generic interface for values resulting from a query evaluation. +type Value interface { + Type() ValueType + String() string +} + +func (Matrix) Type() ValueType { return ValMatrix } +func (Vector) Type() ValueType { return ValVector } +func (*Scalar) Type() ValueType { return ValScalar } +func (*String) Type() ValueType { return ValString } + +type ValueType int + +const ( + ValNone ValueType = iota + ValScalar + ValVector + ValMatrix + ValString +) + +// MarshalJSON implements json.Marshaler. +func (et ValueType) MarshalJSON() ([]byte, error) { + return json.Marshal(et.String()) +} + +func (et *ValueType) UnmarshalJSON(b []byte) error { + var s string + if err := json.Unmarshal(b, &s); err != nil { + return err + } + switch s { + case "": + *et = ValNone + case "scalar": + *et = ValScalar + case "vector": + *et = ValVector + case "matrix": + *et = ValMatrix + case "string": + *et = ValString + default: + return fmt.Errorf("unknown value type %q", s) + } + return nil +} + +func (e ValueType) String() string { + switch e { + case ValNone: + return "" + case ValScalar: + return "scalar" + case ValVector: + return "vector" + case ValMatrix: + return "matrix" + case ValString: + return "string" + } + panic("ValueType.String: unhandled value type") +} diff --git a/vendor/github.com/prometheus/procfs/.gitignore b/vendor/github.com/prometheus/procfs/.gitignore index 25e3659ab2..7cc33ae4a7 100644 --- a/vendor/github.com/prometheus/procfs/.gitignore +++ b/vendor/github.com/prometheus/procfs/.gitignore @@ -1 +1,2 @@ -/fixtures/ +/testdata/fixtures/ +/fixtures diff --git a/vendor/github.com/prometheus/procfs/.golangci.yml b/vendor/github.com/prometheus/procfs/.golangci.yml index 0aa09edacb..126df9e67a 100644 --- a/vendor/github.com/prometheus/procfs/.golangci.yml +++ b/vendor/github.com/prometheus/procfs/.golangci.yml @@ -1,4 +1,22 @@ --- linters: enable: - - golint + - errcheck + - godot + - gosimple + - govet + - ineffassign + - misspell + - revive + - staticcheck + - testifylint + - unused + +linter-settings: + godot: + capital: true + exclude: + # Ignore "See: URL" + - 'See:' + misspell: + locale: US diff --git a/vendor/github.com/prometheus/procfs/CODE_OF_CONDUCT.md b/vendor/github.com/prometheus/procfs/CODE_OF_CONDUCT.md index 9a1aff4127..d325872bdf 100644 --- a/vendor/github.com/prometheus/procfs/CODE_OF_CONDUCT.md +++ b/vendor/github.com/prometheus/procfs/CODE_OF_CONDUCT.md @@ -1,3 +1,3 @@ -## Prometheus Community Code of Conduct +# Prometheus Community Code of Conduct -Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). +Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md). diff --git a/vendor/github.com/prometheus/procfs/CONTRIBUTING.md b/vendor/github.com/prometheus/procfs/CONTRIBUTING.md index 943de7615e..853eb9d49b 100644 --- a/vendor/github.com/prometheus/procfs/CONTRIBUTING.md +++ b/vendor/github.com/prometheus/procfs/CONTRIBUTING.md @@ -97,7 +97,7 @@ Many of the files are changing continuously and the data being read can in some reads in the same file. Also, most of the files are relatively small (less than a few KBs), and system calls to the `stat` function will often return the wrong size. Therefore, for most files it's recommended to read the full file in a single operation using an internal utility function called `util.ReadFileNoStat`. -This function is similar to `ioutil.ReadFile`, but it avoids the system call to `stat` to get the current size of +This function is similar to `os.ReadFile`, but it avoids the system call to `stat` to get the current size of the file. Note that parsing the file's contents can still be performed one line at a time. This is done by first reading @@ -113,7 +113,7 @@ the full file, and then using a scanner on the `[]byte` or `string` containing t ``` The `/sys` filesystem contains many very small files which contain only a single numeric or text value. These files -can be read using an internal function called `util.SysReadFile` which is similar to `ioutil.ReadFile` but does +can be read using an internal function called `util.SysReadFile` which is similar to `os.ReadFile` but does not bother to check the size of the file before reading. ``` data, err := util.SysReadFile("/sys/class/power_supply/BAT0/capacity") diff --git a/vendor/github.com/prometheus/procfs/MAINTAINERS.md b/vendor/github.com/prometheus/procfs/MAINTAINERS.md index 56ba67d3e3..e00f3b365b 100644 --- a/vendor/github.com/prometheus/procfs/MAINTAINERS.md +++ b/vendor/github.com/prometheus/procfs/MAINTAINERS.md @@ -1,2 +1,3 @@ * Johannes 'fish' Ziemke @discordianfish -* Paul Gier @pgier +* Paul Gier @pgier +* Ben Kochie @SuperQ diff --git a/vendor/github.com/prometheus/procfs/Makefile b/vendor/github.com/prometheus/procfs/Makefile index 616a0d25eb..7edfe4d093 100644 --- a/vendor/github.com/prometheus/procfs/Makefile +++ b/vendor/github.com/prometheus/procfs/Makefile @@ -14,16 +14,18 @@ include Makefile.common %/.unpacked: %.ttar - @echo ">> extracting fixtures" + @echo ">> extracting fixtures $*" ./ttar -C $(dir $*) -x -f $*.ttar touch $@ +fixtures: testdata/fixtures/.unpacked + update_fixtures: - rm -vf fixtures/.unpacked - ./ttar -c -f fixtures.ttar fixtures/ + rm -vf testdata/fixtures/.unpacked + ./ttar -c -f testdata/fixtures.ttar -C testdata/ fixtures/ .PHONY: build build: .PHONY: test -test: fixtures/.unpacked common-test +test: testdata/fixtures/.unpacked common-test diff --git a/vendor/github.com/prometheus/procfs/Makefile.common b/vendor/github.com/prometheus/procfs/Makefile.common index 3ac29c636c..1617292350 100644 --- a/vendor/github.com/prometheus/procfs/Makefile.common +++ b/vendor/github.com/prometheus/procfs/Makefile.common @@ -36,29 +36,6 @@ GO_VERSION ?= $(shell $(GO) version) GO_VERSION_NUMBER ?= $(word 3, $(GO_VERSION)) PRE_GO_111 ?= $(shell echo $(GO_VERSION_NUMBER) | grep -E 'go1\.(10|[0-9])\.') -GOVENDOR := -GO111MODULE := -ifeq (, $(PRE_GO_111)) - ifneq (,$(wildcard go.mod)) - # Enforce Go modules support just in case the directory is inside GOPATH (and for Travis CI). - GO111MODULE := on - - ifneq (,$(wildcard vendor)) - # Always use the local vendor/ directory to satisfy the dependencies. - GOOPTS := $(GOOPTS) -mod=vendor - endif - endif -else - ifneq (,$(wildcard go.mod)) - ifneq (,$(wildcard vendor)) -$(warning This repository requires Go >= 1.11 because of Go modules) -$(warning Some recipes may not work as expected as the current Go runtime is '$(GO_VERSION_NUMBER)') - endif - else - # This repository isn't using Go modules (yet). - GOVENDOR := $(FIRST_GOPATH)/bin/govendor - endif -endif PROMU := $(FIRST_GOPATH)/bin/promu pkgs = ./... @@ -72,23 +49,32 @@ endif GOTEST := $(GO) test GOTEST_DIR := ifneq ($(CIRCLE_JOB),) -ifneq ($(shell which gotestsum),) +ifneq ($(shell command -v gotestsum 2> /dev/null),) GOTEST_DIR := test-results GOTEST := gotestsum --junitfile $(GOTEST_DIR)/unit-tests.xml -- endif endif -PROMU_VERSION ?= 0.7.0 +PROMU_VERSION ?= 0.17.0 PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz +SKIP_GOLANGCI_LINT := GOLANGCI_LINT := GOLANGCI_LINT_OPTS ?= -GOLANGCI_LINT_VERSION ?= v1.18.0 -# golangci-lint only supports linux, darwin and windows platforms on i386/amd64. +GOLANGCI_LINT_VERSION ?= v1.59.0 +# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64. # windows isn't included here because of the path separator being different. ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin)) - ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386)) - GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint + ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386 arm64)) + # If we're in CI and there is an Actions file, that means the linter + # is being run in Actions, so we don't need to run it here. + ifneq (,$(SKIP_GOLANGCI_LINT)) + GOLANGCI_LINT := + else ifeq (,$(CIRCLE_JOB)) + GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint + else ifeq (,$(wildcard .github/workflows/golangci-lint.yml)) + GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint + endif endif endif @@ -105,6 +91,8 @@ BUILD_DOCKER_ARCHS = $(addprefix common-docker-,$(DOCKER_ARCHS)) PUBLISH_DOCKER_ARCHS = $(addprefix common-docker-publish-,$(DOCKER_ARCHS)) TAG_DOCKER_ARCHS = $(addprefix common-docker-tag-latest-,$(DOCKER_ARCHS)) +SANITIZED_DOCKER_IMAGE_TAG := $(subst +,-,$(DOCKER_IMAGE_TAG)) + ifeq ($(GOHOSTARCH),amd64) ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux freebsd darwin windows)) # Only supported on amd64 @@ -118,7 +106,7 @@ endif %: common-% ; .PHONY: common-all -common-all: precheck style check_license lint unused build test +common-all: precheck style check_license lint yamllint unused build test .PHONY: common-style common-style: @@ -144,32 +132,25 @@ common-check_license: .PHONY: common-deps common-deps: @echo ">> getting dependencies" -ifdef GO111MODULE - GO111MODULE=$(GO111MODULE) $(GO) mod download -else - $(GO) get $(GOOPTS) -t ./... -endif + $(GO) mod download .PHONY: update-go-deps update-go-deps: @echo ">> updating Go dependencies" @for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \ - $(GO) get $$m; \ + $(GO) get -d $$m; \ done - GO111MODULE=$(GO111MODULE) $(GO) mod tidy -ifneq (,$(wildcard vendor)) - GO111MODULE=$(GO111MODULE) $(GO) mod vendor -endif + $(GO) mod tidy .PHONY: common-test-short common-test-short: $(GOTEST_DIR) @echo ">> running short tests" - GO111MODULE=$(GO111MODULE) $(GOTEST) -short $(GOOPTS) $(pkgs) + $(GOTEST) -short $(GOOPTS) $(pkgs) .PHONY: common-test common-test: $(GOTEST_DIR) @echo ">> running all tests" - GO111MODULE=$(GO111MODULE) $(GOTEST) $(test-flags) $(GOOPTS) $(pkgs) + $(GOTEST) $(test-flags) $(GOOPTS) $(pkgs) $(GOTEST_DIR): @mkdir -p $@ @@ -177,25 +158,34 @@ $(GOTEST_DIR): .PHONY: common-format common-format: @echo ">> formatting code" - GO111MODULE=$(GO111MODULE) $(GO) fmt $(pkgs) + $(GO) fmt $(pkgs) .PHONY: common-vet common-vet: @echo ">> vetting code" - GO111MODULE=$(GO111MODULE) $(GO) vet $(GOOPTS) $(pkgs) + $(GO) vet $(GOOPTS) $(pkgs) .PHONY: common-lint common-lint: $(GOLANGCI_LINT) ifdef GOLANGCI_LINT @echo ">> running golangci-lint" -ifdef GO111MODULE -# 'go list' needs to be executed before staticcheck to prepopulate the modules cache. -# Otherwise staticcheck might fail randomly for some reason not yet explained. - GO111MODULE=$(GO111MODULE) $(GO) list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null - GO111MODULE=$(GO111MODULE) $(GOLANGCI_LINT) run $(GOLANGCI_LINT_OPTS) $(pkgs) -else - $(GOLANGCI_LINT) run $(pkgs) + $(GOLANGCI_LINT) run $(GOLANGCI_LINT_OPTS) $(pkgs) endif + +.PHONY: common-lint-fix +common-lint-fix: $(GOLANGCI_LINT) +ifdef GOLANGCI_LINT + @echo ">> running golangci-lint fix" + $(GOLANGCI_LINT) run --fix $(GOLANGCI_LINT_OPTS) $(pkgs) +endif + +.PHONY: common-yamllint +common-yamllint: + @echo ">> running yamllint on all YAML files in the repository" +ifeq (, $(shell command -v yamllint 2> /dev/null)) + @echo "yamllint not installed so skipping" +else + yamllint . endif # For backward-compatibility. @@ -203,38 +193,29 @@ endif common-staticcheck: lint .PHONY: common-unused -common-unused: $(GOVENDOR) -ifdef GOVENDOR - @echo ">> running check for unused packages" - @$(GOVENDOR) list +unused | grep . && exit 1 || echo 'No unused packages' -else -ifdef GO111MODULE +common-unused: @echo ">> running check for unused/missing packages in go.mod" - GO111MODULE=$(GO111MODULE) $(GO) mod tidy -ifeq (,$(wildcard vendor)) + $(GO) mod tidy @git diff --exit-code -- go.sum go.mod -else - @echo ">> running check for unused packages in vendor/" - GO111MODULE=$(GO111MODULE) $(GO) mod vendor - @git diff --exit-code -- go.sum go.mod vendor/ -endif -endif -endif .PHONY: common-build common-build: promu @echo ">> building binaries" - GO111MODULE=$(GO111MODULE) $(PROMU) build --prefix $(PREFIX) $(PROMU_BINARIES) + $(PROMU) build --prefix $(PREFIX) $(PROMU_BINARIES) .PHONY: common-tarball common-tarball: promu @echo ">> building release tarball" $(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR) +.PHONY: common-docker-repo-name +common-docker-repo-name: + @echo "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)" + .PHONY: common-docker $(BUILD_DOCKER_ARCHS) common-docker: $(BUILD_DOCKER_ARCHS) $(BUILD_DOCKER_ARCHS): common-docker-%: - docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" \ + docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" \ -f $(DOCKERFILE_PATH) \ --build-arg ARCH="$*" \ --build-arg OS="linux" \ @@ -243,19 +224,19 @@ $(BUILD_DOCKER_ARCHS): common-docker-%: .PHONY: common-docker-publish $(PUBLISH_DOCKER_ARCHS) common-docker-publish: $(PUBLISH_DOCKER_ARCHS) $(PUBLISH_DOCKER_ARCHS): common-docker-publish-%: - docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" + docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" DOCKER_MAJOR_VERSION_TAG = $(firstword $(subst ., ,$(shell cat VERSION))) .PHONY: common-docker-tag-latest $(TAG_DOCKER_ARCHS) common-docker-tag-latest: $(TAG_DOCKER_ARCHS) $(TAG_DOCKER_ARCHS): common-docker-tag-latest-%: - docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest" - docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)" + docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest" + docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)" .PHONY: common-docker-manifest common-docker-manifest: - DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" $(foreach ARCH,$(DOCKER_ARCHS),$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$(ARCH):$(DOCKER_IMAGE_TAG)) - DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)" $(foreach ARCH,$(DOCKER_ARCHS),$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$(ARCH):$(SANITIZED_DOCKER_IMAGE_TAG)) + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)" .PHONY: promu promu: $(PROMU) @@ -280,12 +261,6 @@ $(GOLANGCI_LINT): | sh -s -- -b $(FIRST_GOPATH)/bin $(GOLANGCI_LINT_VERSION) endif -ifdef GOVENDOR -.PHONY: $(GOVENDOR) -$(GOVENDOR): - GOOS= GOARCH= $(GO) get -u github.com/kardianos/govendor -endif - .PHONY: precheck precheck:: diff --git a/vendor/github.com/prometheus/procfs/README.md b/vendor/github.com/prometheus/procfs/README.md index 55d1e3261c..1224816c2a 100644 --- a/vendor/github.com/prometheus/procfs/README.md +++ b/vendor/github.com/prometheus/procfs/README.md @@ -6,8 +6,8 @@ metrics from the pseudo-filesystems /proc and /sys. *WARNING*: This package is a work in progress. Its API may still break in backwards-incompatible ways without warnings. Use it at your own risk. -[![GoDoc](https://godoc.org/github.com/prometheus/procfs?status.png)](https://godoc.org/github.com/prometheus/procfs) -[![Build Status](https://travis-ci.org/prometheus/procfs.svg?branch=master)](https://travis-ci.org/prometheus/procfs) +[![Go Reference](https://pkg.go.dev/badge/github.com/prometheus/procfs.svg)](https://pkg.go.dev/github.com/prometheus/procfs) +[![CircleCI](https://circleci.com/gh/prometheus/procfs/tree/master.svg?style=svg)](https://circleci.com/gh/prometheus/procfs/tree/master) [![Go Report Card](https://goreportcard.com/badge/github.com/prometheus/procfs)](https://goreportcard.com/report/github.com/prometheus/procfs) ## Usage @@ -51,11 +51,11 @@ ensure the `fixtures` directory is up to date by removing the existing directory extracting the ttar file using `make fixtures/.unpacked` or just `make test`. ```bash -rm -rf fixtures +rm -rf testdata/fixtures make test ``` Next, make the required changes to the extracted files in the `fixtures` directory. When the changes are complete, run `make update_fixtures` to create a new `fixtures.ttar` file based on the updated `fixtures` directory. And finally, verify the changes using -`git diff fixtures.ttar`. +`git diff testdata/fixtures.ttar`. diff --git a/vendor/github.com/prometheus/procfs/SECURITY.md b/vendor/github.com/prometheus/procfs/SECURITY.md index 67741f015a..fed02d85c7 100644 --- a/vendor/github.com/prometheus/procfs/SECURITY.md +++ b/vendor/github.com/prometheus/procfs/SECURITY.md @@ -3,4 +3,4 @@ The Prometheus security policy, including how to report vulnerabilities, can be found here: -https://prometheus.io/docs/operating/security/ + diff --git a/vendor/github.com/prometheus/procfs/arp.go b/vendor/github.com/prometheus/procfs/arp.go index 4e47e61720..cdcc8a7ccc 100644 --- a/vendor/github.com/prometheus/procfs/arp.go +++ b/vendor/github.com/prometheus/procfs/arp.go @@ -15,11 +15,28 @@ package procfs import ( "fmt" - "io/ioutil" "net" + "os" + "strconv" "strings" ) +// Learned from include/uapi/linux/if_arp.h. +const ( + // completed entry (ha valid). + ATFComplete = 0x02 + // permanent entry. + ATFPermanent = 0x04 + // Publish entry. + ATFPublish = 0x08 + // Has requested trailers. + ATFUseTrailers = 0x10 + // Obsoleted: Want to use a netmask (only for proxy entries). + ATFNetmask = 0x20 + // Don't answer this addresses. + ATFDontPublish = 0x40 +) + // ARPEntry contains a single row of the columnar data represented in // /proc/net/arp. type ARPEntry struct { @@ -29,14 +46,16 @@ type ARPEntry struct { HWAddr net.HardwareAddr // Name of the device Device string + // Flags + Flags byte } // GatherARPEntries retrieves all the ARP entries, parse the relevant columns, // and then return a slice of ARPEntry's. func (fs FS) GatherARPEntries() ([]ARPEntry, error) { - data, err := ioutil.ReadFile(fs.proc.Path("net/arp")) + data, err := os.ReadFile(fs.proc.Path("net/arp")) if err != nil { - return nil, fmt.Errorf("error reading arp %q: %w", fs.proc.Path("net/arp"), err) + return nil, fmt.Errorf("%w: error reading arp %s: %w", ErrFileRead, fs.proc.Path("net/arp"), err) } return parseARPEntries(data) @@ -59,11 +78,11 @@ func parseARPEntries(data []byte) ([]ARPEntry, error) { } else if width == expectedDataWidth { entry, err := parseARPEntry(columns) if err != nil { - return []ARPEntry{}, fmt.Errorf("failed to parse ARP entry: %w", err) + return []ARPEntry{}, fmt.Errorf("%w: Failed to parse ARP entry: %v: %w", ErrFileParse, entry, err) } entries = append(entries, entry) } else { - return []ARPEntry{}, fmt.Errorf("%d columns were detected, but %d were expected", width, expectedDataWidth) + return []ARPEntry{}, fmt.Errorf("%w: %d columns found, but expected %d: %w", ErrFileParse, width, expectedDataWidth, err) } } @@ -72,14 +91,26 @@ func parseARPEntries(data []byte) ([]ARPEntry, error) { } func parseARPEntry(columns []string) (ARPEntry, error) { + entry := ARPEntry{Device: columns[5]} ip := net.ParseIP(columns[0]) - mac := net.HardwareAddr(columns[3]) + entry.IPAddr = ip + + if mac, err := net.ParseMAC(columns[3]); err == nil { + entry.HWAddr = mac + } else { + return ARPEntry{}, err + } - entry := ARPEntry{ - IPAddr: ip, - HWAddr: mac, - Device: columns[5], + if flags, err := strconv.ParseUint(columns[2], 0, 8); err == nil { + entry.Flags = byte(flags) + } else { + return ARPEntry{}, err } return entry, nil } + +// IsComplete returns true if ARP entry is marked with complete flag. +func (entry *ARPEntry) IsComplete() bool { + return entry.Flags&ATFComplete != 0 +} diff --git a/vendor/github.com/prometheus/procfs/buddyinfo.go b/vendor/github.com/prometheus/procfs/buddyinfo.go index f5b7939b26..8380750090 100644 --- a/vendor/github.com/prometheus/procfs/buddyinfo.go +++ b/vendor/github.com/prometheus/procfs/buddyinfo.go @@ -55,18 +55,18 @@ func parseBuddyInfo(r io.Reader) ([]BuddyInfo, error) { parts := strings.Fields(line) if len(parts) < 4 { - return nil, fmt.Errorf("invalid number of fields when parsing buddyinfo") + return nil, fmt.Errorf("%w: Invalid number of fields, found: %v", ErrFileParse, parts) } - node := strings.TrimRight(parts[1], ",") - zone := strings.TrimRight(parts[3], ",") + node := strings.TrimSuffix(parts[1], ",") + zone := strings.TrimSuffix(parts[3], ",") arraySize := len(parts[4:]) if bucketCount == -1 { bucketCount = arraySize } else { if bucketCount != arraySize { - return nil, fmt.Errorf("mismatch in number of buddyinfo buckets, previous count %d, new count %d", bucketCount, arraySize) + return nil, fmt.Errorf("%w: mismatch in number of buddyinfo buckets, previous count %d, new count %d", ErrFileParse, bucketCount, arraySize) } } @@ -74,7 +74,7 @@ func parseBuddyInfo(r io.Reader) ([]BuddyInfo, error) { for i := 0; i < arraySize; i++ { sizes[i], err = strconv.ParseFloat(parts[i+4], 64) if err != nil { - return nil, fmt.Errorf("invalid value in buddyinfo: %w", err) + return nil, fmt.Errorf("%w: Invalid valid in buddyinfo: %f: %w", ErrFileParse, sizes[i], err) } } diff --git a/vendor/github.com/prometheus/procfs/cmdline.go b/vendor/github.com/prometheus/procfs/cmdline.go new file mode 100644 index 0000000000..bf4f3b48c0 --- /dev/null +++ b/vendor/github.com/prometheus/procfs/cmdline.go @@ -0,0 +1,30 @@ +// Copyright 2021 The Prometheus 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 procfs + +import ( + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +// CmdLine returns the command line of the kernel. +func (fs FS) CmdLine() ([]string, error) { + data, err := util.ReadFileNoStat(fs.proc.Path("cmdline")) + if err != nil { + return nil, err + } + + return strings.Fields(string(data)), nil +} diff --git a/vendor/github.com/prometheus/procfs/cpuinfo.go b/vendor/github.com/prometheus/procfs/cpuinfo.go index 5623b24a16..f0950bb495 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package procfs @@ -27,7 +28,7 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// CPUInfo contains general information about a system CPU found in /proc/cpuinfo +// CPUInfo contains general information about a system CPU found in /proc/cpuinfo. type CPUInfo struct { Processor uint VendorID string @@ -78,7 +79,7 @@ func parseCPUInfoX86(info []byte) ([]CPUInfo, error) { // find the first "processor" line firstLine := firstNonEmptyLine(scanner) if !strings.HasPrefix(firstLine, "processor") || !strings.Contains(firstLine, ":") { - return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine) + return nil, fmt.Errorf("%w: Cannot parse line: %q", ErrFileParse, firstLine) } field := strings.SplitN(firstLine, ": ", 2) v, err := strconv.ParseUint(field[1], 0, 32) @@ -191,9 +192,10 @@ func parseCPUInfoARM(info []byte) ([]CPUInfo, error) { scanner := bufio.NewScanner(bytes.NewReader(info)) firstLine := firstNonEmptyLine(scanner) - match, _ := regexp.MatchString("^[Pp]rocessor", firstLine) + match, err := regexp.MatchString("^[Pp]rocessor", firstLine) if !match || !strings.Contains(firstLine, ":") { - return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine) + return nil, fmt.Errorf("%w: Cannot parse line: %q: %w", ErrFileParse, firstLine, err) + } field := strings.SplitN(firstLine, ": ", 2) cpuinfo := []CPUInfo{} @@ -257,7 +259,7 @@ func parseCPUInfoS390X(info []byte) ([]CPUInfo, error) { firstLine := firstNonEmptyLine(scanner) if !strings.HasPrefix(firstLine, "vendor_id") || !strings.Contains(firstLine, ":") { - return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine) + return nil, fmt.Errorf("%w: Cannot parse line: %q", ErrFileParse, firstLine) } field := strings.SplitN(firstLine, ": ", 2) cpuinfo := []CPUInfo{} @@ -282,7 +284,7 @@ func parseCPUInfoS390X(info []byte) ([]CPUInfo, error) { if strings.HasPrefix(line, "processor") { match := cpuinfoS390XProcessorRegexp.FindStringSubmatch(line) if len(match) < 2 { - return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine) + return nil, fmt.Errorf("%w: %q", ErrFileParse, firstLine) } cpu := commonCPUInfo v, err := strconv.ParseUint(match[1], 0, 32) @@ -342,7 +344,7 @@ func parseCPUInfoMips(info []byte) ([]CPUInfo, error) { // find the first "processor" line firstLine := firstNonEmptyLine(scanner) if !strings.HasPrefix(firstLine, "system type") || !strings.Contains(firstLine, ":") { - return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine) + return nil, fmt.Errorf("%w: %q", ErrFileParse, firstLine) } field := strings.SplitN(firstLine, ": ", 2) cpuinfo := []CPUInfo{} @@ -379,12 +381,48 @@ func parseCPUInfoMips(info []byte) ([]CPUInfo, error) { return cpuinfo, nil } +func parseCPUInfoLoong(info []byte) ([]CPUInfo, error) { + scanner := bufio.NewScanner(bytes.NewReader(info)) + // find the first "processor" line + firstLine := firstNonEmptyLine(scanner) + if !strings.HasPrefix(firstLine, "system type") || !strings.Contains(firstLine, ":") { + return nil, fmt.Errorf("%w: %q", ErrFileParse, firstLine) + } + field := strings.SplitN(firstLine, ": ", 2) + cpuinfo := []CPUInfo{} + systemType := field[1] + i := 0 + for scanner.Scan() { + line := scanner.Text() + if !strings.Contains(line, ":") { + continue + } + field := strings.SplitN(line, ": ", 2) + switch strings.TrimSpace(field[0]) { + case "processor": + v, err := strconv.ParseUint(field[1], 0, 32) + if err != nil { + return nil, err + } + i = int(v) + cpuinfo = append(cpuinfo, CPUInfo{}) // start of the next processor + cpuinfo[i].Processor = uint(v) + cpuinfo[i].VendorID = systemType + case "CPU Family": + cpuinfo[i].CPUFamily = field[1] + case "Model Name": + cpuinfo[i].ModelName = field[1] + } + } + return cpuinfo, nil +} + func parseCPUInfoPPC(info []byte) ([]CPUInfo, error) { scanner := bufio.NewScanner(bytes.NewReader(info)) firstLine := firstNonEmptyLine(scanner) if !strings.HasPrefix(firstLine, "processor") || !strings.Contains(firstLine, ":") { - return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine) + return nil, fmt.Errorf("%w: %q", ErrFileParse, firstLine) } field := strings.SplitN(firstLine, ": ", 2) v, err := strconv.ParseUint(field[1], 0, 32) @@ -429,7 +467,7 @@ func parseCPUInfoRISCV(info []byte) ([]CPUInfo, error) { firstLine := firstNonEmptyLine(scanner) if !strings.HasPrefix(firstLine, "processor") || !strings.Contains(firstLine, ":") { - return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine) + return nil, fmt.Errorf("%w: %q", ErrFileParse, firstLine) } field := strings.SplitN(firstLine, ": ", 2) v, err := strconv.ParseUint(field[1], 0, 32) @@ -469,7 +507,7 @@ func parseCPUInfoDummy(_ []byte) ([]CPUInfo, error) { // nolint:unused,deadcode } // firstNonEmptyLine advances the scanner to the first non-empty line -// and returns the contents of that line +// and returns the contents of that line. func firstNonEmptyLine(scanner *bufio.Scanner) string { for scanner.Scan() { line := scanner.Text() diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_armx.go b/vendor/github.com/prometheus/procfs/cpuinfo_armx.go index 44b590ed38..64cfd534c1 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo_armx.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo_armx.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux && (arm || arm64) // +build linux // +build arm arm64 diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_loong64.go b/vendor/github.com/prometheus/procfs/cpuinfo_loong64.go new file mode 100644 index 0000000000..d88442f0ed --- /dev/null +++ b/vendor/github.com/prometheus/procfs/cpuinfo_loong64.go @@ -0,0 +1,19 @@ +// Copyright 2022 The Prometheus 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:build linux +// +build linux + +package procfs + +var parseCPUInfo = parseCPUInfoLoong diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_mipsx.go b/vendor/github.com/prometheus/procfs/cpuinfo_mipsx.go index 91e272573a..c11207f3ab 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo_mipsx.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo_mipsx.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux && (mips || mipsle || mips64 || mips64le) // +build linux // +build mips mipsle mips64 mips64le diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_others.go b/vendor/github.com/prometheus/procfs/cpuinfo_others.go index 95b5b4ec44..a6b2b3127c 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo_others.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo_others.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build linux -// +build !386,!amd64,!arm,!arm64,!mips,!mips64,!mips64le,!mipsle,!ppc64,!ppc64le,!riscv64,!s390x +//go:build linux && !386 && !amd64 && !arm && !arm64 && !loong64 && !mips && !mips64 && !mips64le && !mipsle && !ppc64 && !ppc64le && !riscv64 && !s390x +// +build linux,!386,!amd64,!arm,!arm64,!loong64,!mips,!mips64,!mips64le,!mipsle,!ppc64,!ppc64le,!riscv64,!s390x package procfs diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_ppcx.go b/vendor/github.com/prometheus/procfs/cpuinfo_ppcx.go index 6068bd571c..003bc2ad4a 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo_ppcx.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo_ppcx.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux && (ppc64 || ppc64le) // +build linux // +build ppc64 ppc64le diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_riscvx.go b/vendor/github.com/prometheus/procfs/cpuinfo_riscvx.go index e83c2e207c..1c9b7313b6 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo_riscvx.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo_riscvx.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux && (riscv || riscv64) // +build linux // +build riscv riscv64 diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_s390x.go b/vendor/github.com/prometheus/procfs/cpuinfo_s390x.go index 26814eebaa..fa3686bc00 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo_s390x.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo_s390x.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package procfs diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_x86.go b/vendor/github.com/prometheus/procfs/cpuinfo_x86.go index d5bedf97f3..a0ef55562e 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo_x86.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo_x86.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux && (386 || amd64) // +build linux // +build 386 amd64 diff --git a/vendor/github.com/prometheus/procfs/crypto.go b/vendor/github.com/prometheus/procfs/crypto.go index 5048ad1f21..5f2a37a78b 100644 --- a/vendor/github.com/prometheus/procfs/crypto.go +++ b/vendor/github.com/prometheus/procfs/crypto.go @@ -55,12 +55,13 @@ func (fs FS) Crypto() ([]Crypto, error) { path := fs.proc.Path("crypto") b, err := util.ReadFileNoStat(path) if err != nil { - return nil, fmt.Errorf("error reading crypto %q: %w", path, err) + return nil, fmt.Errorf("%w: Cannot read file %v: %w", ErrFileRead, b, err) + } crypto, err := parseCrypto(bytes.NewReader(b)) if err != nil { - return nil, fmt.Errorf("error parsing crypto %q: %w", path, err) + return nil, fmt.Errorf("%w: Cannot parse %v: %w", ErrFileParse, crypto, err) } return crypto, nil @@ -83,7 +84,7 @@ func parseCrypto(r io.Reader) ([]Crypto, error) { kv := strings.Split(text, ":") if len(kv) != 2 { - return nil, fmt.Errorf("malformed crypto line: %q", text) + return nil, fmt.Errorf("%w: Cannot parse line: %q", ErrFileParse, text) } k := strings.TrimSpace(kv[0]) diff --git a/vendor/github.com/prometheus/procfs/doc.go b/vendor/github.com/prometheus/procfs/doc.go index e2acd6d40a..f9d961e441 100644 --- a/vendor/github.com/prometheus/procfs/doc.go +++ b/vendor/github.com/prometheus/procfs/doc.go @@ -16,30 +16,29 @@ // // Example: // -// package main -// -// import ( -// "fmt" -// "log" -// -// "github.com/prometheus/procfs" -// ) -// -// func main() { -// p, err := procfs.Self() -// if err != nil { -// log.Fatalf("could not get process: %s", err) -// } -// -// stat, err := p.NewStat() -// if err != nil { -// log.Fatalf("could not get process stat: %s", err) -// } -// -// fmt.Printf("command: %s\n", stat.Comm) -// fmt.Printf("cpu time: %fs\n", stat.CPUTime()) -// fmt.Printf("vsize: %dB\n", stat.VirtualMemory()) -// fmt.Printf("rss: %dB\n", stat.ResidentMemory()) -// } -// +// package main +// +// import ( +// "fmt" +// "log" +// +// "github.com/prometheus/procfs" +// ) +// +// func main() { +// p, err := procfs.Self() +// if err != nil { +// log.Fatalf("could not get process: %s", err) +// } +// +// stat, err := p.Stat() +// if err != nil { +// log.Fatalf("could not get process stat: %s", err) +// } +// +// fmt.Printf("command: %s\n", stat.Comm) +// fmt.Printf("cpu time: %fs\n", stat.CPUTime()) +// fmt.Printf("vsize: %dB\n", stat.VirtualMemory()) +// fmt.Printf("rss: %dB\n", stat.ResidentMemory()) +// } package procfs diff --git a/vendor/github.com/prometheus/procfs/fixtures.ttar b/vendor/github.com/prometheus/procfs/fixtures.ttar deleted file mode 100644 index 1e76173da0..0000000000 --- a/vendor/github.com/prometheus/procfs/fixtures.ttar +++ /dev/null @@ -1,6553 +0,0 @@ -# Archive created by ttar -c -f fixtures.ttar fixtures/ -Directory: fixtures -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/26231 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/cmdline -Lines: 1 -vimNULLBYTEtest.goNULLBYTE+10NULLBYTEEOF -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/comm -Lines: 1 -vim -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/cwd -SymlinkTo: /usr/bin -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/environ -Lines: 1 -PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binNULLBYTEHOSTNAME=cd24e11f73a5NULLBYTETERM=xtermNULLBYTEGOLANG_VERSION=1.12.5NULLBYTEGOPATH=/goNULLBYTEHOME=/rootNULLBYTEEOF -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/exe -SymlinkTo: /usr/bin/vim -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/26231/fd -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/fd/0 -SymlinkTo: ../../symlinktargets/abc -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/fd/1 -SymlinkTo: ../../symlinktargets/def -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/fd/10 -SymlinkTo: ../../symlinktargets/xyz -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/fd/2 -SymlinkTo: ../../symlinktargets/ghi -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/fd/3 -SymlinkTo: ../../symlinktargets/uvw -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/26231/fdinfo -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/fdinfo/0 -Lines: 6 -pos: 0 -flags: 02004000 -mnt_id: 13 -inotify wd:3 ino:1 sdev:34 mask:fce ignored_mask:0 fhandle-bytes:c fhandle-type:81 f_handle:000000000100000000000000 -inotify wd:2 ino:1300016 sdev:fd00002 mask:fce ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:16003001ed3f022a -inotify wd:1 ino:2e0001 sdev:fd00000 mask:fce ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:01002e00138e7c65 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/fdinfo/1 -Lines: 4 -pos: 0 -flags: 02004002 -mnt_id: 13 -eventfd-count: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/fdinfo/10 -Lines: 3 -pos: 0 -flags: 02004002 -mnt_id: 9 -Mode: 400 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/fdinfo/2 -Lines: 3 -pos: 0 -flags: 02004002 -mnt_id: 9 -Mode: 400 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/fdinfo/3 -Lines: 3 -pos: 0 -flags: 02004002 -mnt_id: 9 -Mode: 400 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/io -Lines: 7 -rchar: 750339 -wchar: 818609 -syscr: 7405 -syscw: 5245 -read_bytes: 1024 -write_bytes: 2048 -cancelled_write_bytes: -1024 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/limits -Lines: 17 -Limit Soft Limit Hard Limit Units -Max cpu time unlimited unlimited seconds -Max file size unlimited unlimited bytes -Max data size unlimited unlimited bytes -Max stack size 8388608 unlimited bytes -Max core file size 0 unlimited bytes -Max resident set unlimited unlimited bytes -Max processes 62898 62898 processes -Max open files 2048 4096 files -Max locked memory 18446744073708503040 18446744073708503040 bytes -Max address space 8589934592 unlimited bytes -Max file locks unlimited unlimited locks -Max pending signals 62898 62898 signals -Max msgqueue size 819200 819200 bytes -Max nice priority 0 0 -Max realtime priority 0 0 -Max realtime timeout unlimited unlimited us -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/mountstats -Lines: 20 -device rootfs mounted on / with fstype rootfs -device sysfs mounted on /sys with fstype sysfs -device proc mounted on /proc with fstype proc -device /dev/sda1 mounted on / with fstype ext4 -device 192.168.1.1:/srv/test mounted on /mnt/nfs/test with fstype nfs4 statvers=1.1 - opts: rw,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,acregmin=3,acregmax=60,acdirmin=30,acdirmax=60,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,mountaddr=192.168.1.1,clientaddr=192.168.1.5,local_lock=none - age: 13968 - caps: caps=0xfff7,wtmult=512,dtsize=32768,bsize=0,namlen=255 - nfsv4: bm0=0xfdffafff,bm1=0xf9be3e,bm2=0x0,acl=0x0,pnfs=not configured - sec: flavor=1,pseudoflavor=1 - events: 52 226 0 0 1 13 398 0 0 331 0 47 0 0 77 0 0 77 0 0 0 0 0 0 0 0 0 - bytes: 1207640230 0 0 0 1210214218 0 295483 0 - RPC iostats version: 1.0 p/v: 100003/4 (nfs) - xprt: tcp 832 0 1 0 11 6428 6428 0 12154 0 24 26 5726 - per-op statistics - NULL: 0 0 0 0 0 0 0 0 - READ: 1298 1298 0 207680 1210292152 6 79386 79407 - WRITE: 0 0 0 0 0 0 0 0 - ACCESS: 2927395007 2927394995 0 526931094212 362996810236 18446743919241604546 1667369447 1953587717 - -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/26231/net -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/net/dev -Lines: 4 -Inter-| Receive | Transmit - face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed - lo: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - eth0: 438 5 0 0 0 0 0 0 648 8 0 0 0 0 0 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/26231/ns -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/ns/mnt -SymlinkTo: mnt:[4026531840] -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/ns/net -SymlinkTo: net:[4026531993] -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/root -SymlinkTo: / -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/schedstat -Lines: 1 -411605849 93680043 79 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/smaps -Lines: 252 -00400000-00cb1000 r-xp 00000000 fd:01 952273 /bin/alertmanager -Size: 8900 kB -KernelPageSize: 4 kB -MMUPageSize: 4 kB -Rss: 2952 kB -Pss: 2952 kB -Shared_Clean: 0 kB -Shared_Dirty: 0 kB -Private_Clean: 2952 kB -Private_Dirty: 0 kB -Referenced: 2864 kB -Anonymous: 0 kB -LazyFree: 0 kB -AnonHugePages: 0 kB -ShmemPmdMapped: 0 kB -Shared_Hugetlb: 0 kB -Private_Hugetlb: 0 kB -Swap: 0 kB -SwapPss: 0 kB -Locked: 0 kB -VmFlags: rd ex mr mw me dw sd -00cb1000-016b0000 r--p 008b1000 fd:01 952273 /bin/alertmanager -Size: 10236 kB -KernelPageSize: 4 kB -MMUPageSize: 4 kB -Rss: 6152 kB -Pss: 6152 kB -Shared_Clean: 0 kB -Shared_Dirty: 0 kB -Private_Clean: 6152 kB -Private_Dirty: 0 kB -Referenced: 5308 kB -Anonymous: 0 kB -LazyFree: 0 kB -AnonHugePages: 0 kB -ShmemPmdMapped: 0 kB -Shared_Hugetlb: 0 kB -Private_Hugetlb: 0 kB -Swap: 0 kB -SwapPss: 0 kB -Locked: 0 kB -VmFlags: rd mr mw me dw sd -016b0000-0171a000 rw-p 012b0000 fd:01 952273 /bin/alertmanager -Size: 424 kB -KernelPageSize: 4 kB -MMUPageSize: 4 kB -Rss: 176 kB -Pss: 176 kB -Shared_Clean: 0 kB -Shared_Dirty: 0 kB -Private_Clean: 84 kB -Private_Dirty: 92 kB -Referenced: 176 kB -Anonymous: 92 kB -LazyFree: 0 kB -AnonHugePages: 0 kB -ShmemPmdMapped: 0 kB -Shared_Hugetlb: 0 kB -Private_Hugetlb: 0 kB -Swap: 12 kB -SwapPss: 12 kB -Locked: 0 kB -VmFlags: rd wr mr mw me dw ac sd -0171a000-0173f000 rw-p 00000000 00:00 0 -Size: 148 kB -KernelPageSize: 4 kB -MMUPageSize: 4 kB -Rss: 76 kB -Pss: 76 kB -Shared_Clean: 0 kB -Shared_Dirty: 0 kB -Private_Clean: 0 kB -Private_Dirty: 76 kB -Referenced: 76 kB -Anonymous: 76 kB -LazyFree: 0 kB -AnonHugePages: 0 kB -ShmemPmdMapped: 0 kB -Shared_Hugetlb: 0 kB -Private_Hugetlb: 0 kB -Swap: 0 kB -SwapPss: 0 kB -Locked: 0 kB -VmFlags: rd wr mr mw me ac sd -c000000000-c000400000 rw-p 00000000 00:00 0 -Size: 4096 kB -KernelPageSize: 4 kB -MMUPageSize: 4 kB -Rss: 2564 kB -Pss: 2564 kB -Shared_Clean: 0 kB -Shared_Dirty: 0 kB -Private_Clean: 20 kB -Private_Dirty: 2544 kB -Referenced: 2544 kB -Anonymous: 2564 kB -LazyFree: 0 kB -AnonHugePages: 0 kB -ShmemPmdMapped: 0 kB -Shared_Hugetlb: 0 kB -Private_Hugetlb: 0 kB -Swap: 1100 kB -SwapPss: 1100 kB -Locked: 0 kB -VmFlags: rd wr mr mw me ac sd -c000400000-c001600000 rw-p 00000000 00:00 0 -Size: 18432 kB -KernelPageSize: 4 kB -MMUPageSize: 4 kB -Rss: 16024 kB -Pss: 16024 kB -Shared_Clean: 0 kB -Shared_Dirty: 0 kB -Private_Clean: 5864 kB -Private_Dirty: 10160 kB -Referenced: 11944 kB -Anonymous: 16024 kB -LazyFree: 5848 kB -AnonHugePages: 0 kB -ShmemPmdMapped: 0 kB -Shared_Hugetlb: 0 kB -Private_Hugetlb: 0 kB -Swap: 440 kB -SwapPss: 440 kB -Locked: 0 kB -VmFlags: rd wr mr mw me ac sd nh -c001600000-c004000000 rw-p 00000000 00:00 0 -Size: 43008 kB -KernelPageSize: 4 kB -MMUPageSize: 4 kB -Rss: 0 kB -Pss: 0 kB -Shared_Clean: 0 kB -Shared_Dirty: 0 kB -Private_Clean: 0 kB -Private_Dirty: 0 kB -Referenced: 0 kB -Anonymous: 0 kB -LazyFree: 0 kB -AnonHugePages: 0 kB -ShmemPmdMapped: 0 kB -Shared_Hugetlb: 0 kB -Private_Hugetlb: 0 kB -Swap: 0 kB -SwapPss: 0 kB -Locked: 0 kB -VmFlags: rd wr mr mw me ac sd -7f0ab95ca000-7f0abbb7b000 rw-p 00000000 00:00 0 -Size: 38596 kB -KernelPageSize: 4 kB -MMUPageSize: 4 kB -Rss: 1992 kB -Pss: 1992 kB -Shared_Clean: 0 kB -Shared_Dirty: 0 kB -Private_Clean: 476 kB -Private_Dirty: 1516 kB -Referenced: 1828 kB -Anonymous: 1992 kB -LazyFree: 0 kB -AnonHugePages: 0 kB -ShmemPmdMapped: 0 kB -Shared_Hugetlb: 0 kB -Private_Hugetlb: 0 kB -Swap: 384 kB -SwapPss: 384 kB -Locked: 0 kB -VmFlags: rd wr mr mw me ac sd -7ffc07ecf000-7ffc07ef0000 rw-p 00000000 00:00 0 [stack] -Size: 132 kB -KernelPageSize: 4 kB -MMUPageSize: 4 kB -Rss: 8 kB -Pss: 8 kB -Shared_Clean: 0 kB -Shared_Dirty: 0 kB -Private_Clean: 0 kB -Private_Dirty: 8 kB -Referenced: 8 kB -Anonymous: 8 kB -LazyFree: 0 kB -AnonHugePages: 0 kB -ShmemPmdMapped: 0 kB -Shared_Hugetlb: 0 kB -Private_Hugetlb: 0 kB -Swap: 4 kB -SwapPss: 4 kB -Locked: 0 kB -VmFlags: rd wr mr mw me gd ac -7ffc07f9e000-7ffc07fa1000 r--p 00000000 00:00 0 [vvar] -Size: 12 kB -KernelPageSize: 4 kB -MMUPageSize: 4 kB -Rss: 0 kB -Pss: 0 kB -Shared_Clean: 0 kB -Shared_Dirty: 0 kB -Private_Clean: 0 kB -Private_Dirty: 0 kB -Referenced: 0 kB -Anonymous: 0 kB -LazyFree: 0 kB -AnonHugePages: 0 kB -ShmemPmdMapped: 0 kB -Shared_Hugetlb: 0 kB -Private_Hugetlb: 0 kB -Swap: 0 kB -SwapPss: 0 kB -Locked: 0 kB -VmFlags: rd mr pf io de dd sd -7ffc07fa1000-7ffc07fa3000 r-xp 00000000 00:00 0 [vdso] -Size: 8 kB -KernelPageSize: 4 kB -MMUPageSize: 4 kB -Rss: 4 kB -Pss: 0 kB -Shared_Clean: 4 kB -Shared_Dirty: 0 kB -Private_Clean: 0 kB -Private_Dirty: 0 kB -Referenced: 4 kB -Anonymous: 0 kB -LazyFree: 0 kB -AnonHugePages: 0 kB -ShmemPmdMapped: 0 kB -Shared_Hugetlb: 0 kB -Private_Hugetlb: 0 kB -Swap: 0 kB -SwapPss: 0 kB -Locked: 0 kB -VmFlags: rd ex mr mw me de sd -ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] -Size: 4 kB -KernelPageSize: 4 kB -MMUPageSize: 4 kB -Rss: 0 kB -Pss: 0 kB -Shared_Clean: 0 kB -Shared_Dirty: 0 kB -Private_Clean: 0 kB -Private_Dirty: 0 kB -Referenced: 0 kB -Anonymous: 0 kB -LazyFree: 0 kB -AnonHugePages: 0 kB -ShmemPmdMapped: 0 kB -Shared_Hugetlb: 0 kB -Private_Hugetlb: 0 kB -Swap: 0 kB -SwapPss: 0 kB -Locked: 0 kB -VmFlags: rd ex -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/smaps_rollup -Lines: 17 -00400000-ffffffffff601000 ---p 00000000 00:00 0 [rollup] -Rss: 29948 kB -Pss: 29944 kB -Shared_Clean: 4 kB -Shared_Dirty: 0 kB -Private_Clean: 15548 kB -Private_Dirty: 14396 kB -Referenced: 24752 kB -Anonymous: 20756 kB -LazyFree: 5848 kB -AnonHugePages: 0 kB -ShmemPmdMapped: 0 kB -Shared_Hugetlb: 0 kB -Private_Hugetlb: 0 kB -Swap: 1940 kB -SwapPss: 1940 kB -Locked: 0 kB -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/stat -Lines: 1 -26231 (vim) R 5392 7446 5392 34835 7446 4218880 32533 309516 26 82 1677 44 158 99 20 0 1 0 82375 56274944 1981 18446744073709551615 4194304 6294284 140736914091744 140736914087944 139965136429984 0 0 12288 1870679807 0 0 0 17 0 0 0 31 0 0 8391624 8481048 16420864 140736914093252 140736914093279 140736914093279 140736914096107 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/status -Lines: 53 - -Name: prometheus -Umask: 0022 -State: S (sleeping) -Tgid: 26231 -Ngid: 0 -Pid: 26231 -PPid: 1 -TracerPid: 0 -Uid: 1000 1000 1000 0 -Gid: 1001 1001 1001 0 -FDSize: 128 -Groups: -NStgid: 1 -NSpid: 1 -NSpgid: 1 -NSsid: 1 -VmPeak: 58472 kB -VmSize: 58440 kB -VmLck: 0 kB -VmPin: 0 kB -VmHWM: 8028 kB -VmRSS: 6716 kB -RssAnon: 2092 kB -RssFile: 4624 kB -RssShmem: 0 kB -VmData: 2580 kB -VmStk: 136 kB -VmExe: 948 kB -VmLib: 6816 kB -VmPTE: 128 kB -VmPMD: 12 kB -VmSwap: 660 kB -HugetlbPages: 0 kB -Threads: 1 -SigQ: 8/63965 -SigPnd: 0000000000000000 -ShdPnd: 0000000000000000 -SigBlk: 7be3c0fe28014a03 -SigIgn: 0000000000001000 -SigCgt: 00000001800004ec -CapInh: 0000000000000000 -CapPrm: 0000003fffffffff -CapEff: 0000003fffffffff -CapBnd: 0000003fffffffff -CapAmb: 0000000000000000 -Seccomp: 0 -Cpus_allowed: ff -Cpus_allowed_list: 0-7 -Mems_allowed: 00000000,00000001 -Mems_allowed_list: 0 -voluntary_ctxt_switches: 4742839 -nonvoluntary_ctxt_switches: 1727500 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/wchan -Lines: 1 -poll_schedule_timeoutEOF -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/26232 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26232/cmdline -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26232/comm -Lines: 1 -ata_sff -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26232/cwd -SymlinkTo: /does/not/exist -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/26232/fd -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26232/fd/0 -SymlinkTo: ../../symlinktargets/abc -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26232/fd/1 -SymlinkTo: ../../symlinktargets/def -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26232/fd/2 -SymlinkTo: ../../symlinktargets/ghi -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26232/fd/3 -SymlinkTo: ../../symlinktargets/uvw -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26232/fd/4 -SymlinkTo: ../../symlinktargets/xyz -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26232/limits -Lines: 17 -Limit Soft Limit Hard Limit Units -Max cpu time unlimited unlimited seconds -Max file size unlimited unlimited bytes -Max data size unlimited unlimited bytes -Max stack size 8388608 unlimited bytes -Max core file size 0 unlimited bytes -Max resident set unlimited unlimited bytes -Max processes 29436 29436 processes -Max open files 1024 4096 files -Max locked memory 65536 65536 bytes -Max address space unlimited unlimited bytes -Max file locks unlimited unlimited locks -Max pending signals 29436 29436 signals -Max msgqueue size 819200 819200 bytes -Max nice priority 0 0 -Max realtime priority 0 0 -Max realtime timeout unlimited unlimited us -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26232/maps -Lines: 9 -55680ae1e000-55680ae20000 r--p 00000000 fd:01 47316994 /bin/cat -55680ae29000-55680ae2a000 rwxs 0000a000 fd:01 47316994 /bin/cat -55680bed6000-55680bef7000 rw-p 00000000 00:00 0 [heap] -7fdf964fc000-7fdf973f2000 r--p 00000000 fd:01 17432624 /usr/lib/locale/locale-archive -7fdf973f2000-7fdf97417000 r--p 00000000 fd:01 60571062 /lib/x86_64-linux-gnu/libc-2.29.so -7ffe9215c000-7ffe9217f000 rw-p 00000000 00:00 0 [stack] -7ffe921da000-7ffe921dd000 r--p 00000000 00:00 0 [vvar] -7ffe921dd000-7ffe921de000 r-xp 00000000 00:00 0 [vdso] -ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall] -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26232/root -SymlinkTo: /does/not/exist -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26232/stat -Lines: 1 -33 (ata_sff) S 2 0 0 0 -1 69238880 0 0 0 0 0 0 0 0 0 -20 1 0 5 0 0 18446744073709551615 0 0 0 0 0 0 0 2147483647 0 18446744073709551615 0 0 17 1 0 0 0 0 0 0 0 0 0 0 0 0 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26232/wchan -Lines: 1 -0EOF -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/26233 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26233/cmdline -Lines: 1 -com.github.uiautomatorNULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTEEOF -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26233/schedstat -Lines: 8 - ____________________________________ -< this is a malformed schedstat file > - ------------------------------------ - \ ^__^ - \ (oo)\_______ - (__)\ )\/\ - ||----w | - || || -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/26234 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26234/maps -Lines: 4 -08048000-08089000 r-xp 00000000 03:01 104219 /bin/tcsh -08089000-0808c000 rw-p 00041000 03:01 104219 /bin/tcsh -0808c000-08146000 rwxp 00000000 00:00 0 -40000000-40015000 r-xp 00000000 03:01 61874 /lib/ld-2.3.2.so -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/584 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/584/stat -Lines: 2 -1020 ((a b ) ( c d) ) R 28378 1020 28378 34842 1020 4218880 286 0 0 0 0 0 0 0 20 0 1 0 10839175 10395648 155 18446744073709551615 4194304 4238788 140736466511168 140736466511168 140609271124624 0 0 0 0 0 0 0 17 5 0 0 0 0 0 6336016 6337300 25579520 140736466515030 140736466515061 140736466515061 140736466518002 0 -#!/bin/cat /proc/self/stat -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/buddyinfo -Lines: 3 -Node 0, zone DMA 1 0 1 0 2 1 1 0 1 1 3 -Node 0, zone DMA32 759 572 791 475 194 45 12 0 0 0 0 -Node 0, zone Normal 4381 1093 185 1530 567 102 4 0 0 0 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/cpuinfo -Lines: 216 -processor : 0 -vendor_id : GenuineIntel -cpu family : 6 -model : 142 -model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz -stepping : 10 -microcode : 0xb4 -cpu MHz : 799.998 -cache size : 8192 KB -physical id : 0 -siblings : 8 -core id : 0 -cpu cores : 4 -apicid : 0 -initial apicid : 0 -fpu : yes -fpu_exception : yes -cpuid level : 22 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d -bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs -bogomips : 4224.00 -clflush size : 64 -cache_alignment : 64 -address sizes : 39 bits physical, 48 bits virtual -power management: - -processor : 1 -vendor_id : GenuineIntel -cpu family : 6 -model : 142 -model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz -stepping : 10 -microcode : 0xb4 -cpu MHz : 800.037 -cache size : 8192 KB -physical id : 0 -siblings : 8 -core id : 1 -cpu cores : 4 -apicid : 2 -initial apicid : 2 -fpu : yes -fpu_exception : yes -cpuid level : 22 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d -bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs -bogomips : 4224.00 -clflush size : 64 -cache_alignment : 64 -address sizes : 39 bits physical, 48 bits virtual -power management: - -processor : 2 -vendor_id : GenuineIntel -cpu family : 6 -model : 142 -model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz -stepping : 10 -microcode : 0xb4 -cpu MHz : 800.010 -cache size : 8192 KB -physical id : 0 -siblings : 8 -core id : 2 -cpu cores : 4 -apicid : 4 -initial apicid : 4 -fpu : yes -fpu_exception : yes -cpuid level : 22 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d -bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs -bogomips : 4224.00 -clflush size : 64 -cache_alignment : 64 -address sizes : 39 bits physical, 48 bits virtual -power management: - -processor : 3 -vendor_id : GenuineIntel -cpu family : 6 -model : 142 -model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz -stepping : 10 -microcode : 0xb4 -cpu MHz : 800.028 -cache size : 8192 KB -physical id : 0 -siblings : 8 -core id : 3 -cpu cores : 4 -apicid : 6 -initial apicid : 6 -fpu : yes -fpu_exception : yes -cpuid level : 22 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d -bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs -bogomips : 4224.00 -clflush size : 64 -cache_alignment : 64 -address sizes : 39 bits physical, 48 bits virtual -power management: - -processor : 4 -vendor_id : GenuineIntel -cpu family : 6 -model : 142 -model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz -stepping : 10 -microcode : 0xb4 -cpu MHz : 799.989 -cache size : 8192 KB -physical id : 0 -siblings : 8 -core id : 0 -cpu cores : 4 -apicid : 1 -initial apicid : 1 -fpu : yes -fpu_exception : yes -cpuid level : 22 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d -bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs -bogomips : 4224.00 -clflush size : 64 -cache_alignment : 64 -address sizes : 39 bits physical, 48 bits virtual -power management: - -processor : 5 -vendor_id : GenuineIntel -cpu family : 6 -model : 142 -model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz -stepping : 10 -microcode : 0xb4 -cpu MHz : 800.083 -cache size : 8192 KB -physical id : 0 -siblings : 8 -core id : 1 -cpu cores : 4 -apicid : 3 -initial apicid : 3 -fpu : yes -fpu_exception : yes -cpuid level : 22 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d -bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs -bogomips : 4224.00 -clflush size : 64 -cache_alignment : 64 -address sizes : 39 bits physical, 48 bits virtual -power management: - -processor : 6 -vendor_id : GenuineIntel -cpu family : 6 -model : 142 -model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz -stepping : 10 -microcode : 0xb4 -cpu MHz : 800.017 -cache size : 8192 KB -physical id : 0 -siblings : 8 -core id : 2 -cpu cores : 4 -apicid : 5 -initial apicid : 5 -fpu : yes -fpu_exception : yes -cpuid level : 22 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d -bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs -bogomips : 4224.00 -clflush size : 64 -cache_alignment : 64 -address sizes : 39 bits physical, 48 bits virtual -power management: - -processor : 7 -vendor_id : GenuineIntel -cpu family : 6 -model : 142 -model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz -stepping : 10 -microcode : 0xb4 -cpu MHz : 800.030 -cache size : 8192 KB -physical id : 0 -siblings : 8 -core id : 3 -cpu cores : 4 -apicid : 7 -initial apicid : 7 -fpu : yes -fpu_exception : yes -cpuid level : 22 -wp : yes -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d -bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs -bogomips : 4224.00 -clflush size : 64 -cache_alignment : 64 -address sizes : 39 bits physical, 48 bits virtual -power management: - -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/crypto -Lines: 972 -name : ccm(aes) -driver : ccm_base(ctr(aes-aesni),cbcmac(aes-aesni)) -module : ccm -priority : 300 -refcnt : 4 -selftest : passed -internal : no -type : aead -async : no -blocksize : 1 -ivsize : 16 -maxauthsize : 16 -geniv : - -name : cbcmac(aes) -driver : cbcmac(aes-aesni) -module : ccm -priority : 300 -refcnt : 7 -selftest : passed -internal : no -type : shash -blocksize : 1 -digestsize : 16 - -name : ecdh -driver : ecdh-generic -module : ecdh_generic -priority : 100 -refcnt : 1 -selftest : passed -internal : no -type : kpp -async : yes - -name : ecb(arc4) -driver : ecb(arc4)-generic -module : arc4 -priority : 100 -refcnt : 1 -selftest : passed -internal : no -type : skcipher -async : no -blocksize : 1 -min keysize : 1 -max keysize : 256 -ivsize : 0 -chunksize : 1 -walksize : 1 - -name : arc4 -driver : arc4-generic -module : arc4 -priority : 0 -refcnt : 3 -selftest : passed -internal : no -type : cipher -blocksize : 1 -min keysize : 1 -max keysize : 256 - -name : crct10dif -driver : crct10dif-pclmul -module : crct10dif_pclmul -priority : 200 -refcnt : 2 -selftest : passed -internal : no -type : shash -blocksize : 1 -digestsize : 2 - -name : crc32 -driver : crc32-pclmul -module : crc32_pclmul -priority : 200 -refcnt : 1 -selftest : passed -internal : no -type : shash -blocksize : 1 -digestsize : 4 - -name : __ghash -driver : cryptd(__ghash-pclmulqdqni) -module : kernel -priority : 50 -refcnt : 1 -selftest : passed -internal : yes -type : ahash -async : yes -blocksize : 16 -digestsize : 16 - -name : ghash -driver : ghash-clmulni -module : ghash_clmulni_intel -priority : 400 -refcnt : 1 -selftest : passed -internal : no -type : ahash -async : yes -blocksize : 16 -digestsize : 16 - -name : __ghash -driver : __ghash-pclmulqdqni -module : ghash_clmulni_intel -priority : 0 -refcnt : 1 -selftest : passed -internal : yes -type : shash -blocksize : 16 -digestsize : 16 - -name : crc32c -driver : crc32c-intel -module : crc32c_intel -priority : 200 -refcnt : 5 -selftest : passed -internal : no -type : shash -blocksize : 1 -digestsize : 4 - -name : cbc(aes) -driver : cbc(aes-aesni) -module : kernel -priority : 300 -refcnt : 1 -selftest : passed -internal : no -type : skcipher -async : no -blocksize : 16 -min keysize : 16 -max keysize : 32 -ivsize : 16 -chunksize : 16 -walksize : 16 - -name : ctr(aes) -driver : ctr(aes-aesni) -module : kernel -priority : 300 -refcnt : 5 -selftest : passed -internal : no -type : skcipher -async : no -blocksize : 1 -min keysize : 16 -max keysize : 32 -ivsize : 16 -chunksize : 16 -walksize : 16 - -name : pkcs1pad(rsa,sha256) -driver : pkcs1pad(rsa-generic,sha256) -module : kernel -priority : 100 -refcnt : 1 -selftest : passed -internal : no -type : akcipher - -name : __xts(aes) -driver : cryptd(__xts-aes-aesni) -module : kernel -priority : 451 -refcnt : 1 -selftest : passed -internal : yes -type : skcipher -async : yes -blocksize : 16 -min keysize : 32 -max keysize : 64 -ivsize : 16 -chunksize : 16 -walksize : 16 - -name : xts(aes) -driver : xts-aes-aesni -module : kernel -priority : 401 -refcnt : 1 -selftest : passed -internal : no -type : skcipher -async : yes -blocksize : 16 -min keysize : 32 -max keysize : 64 -ivsize : 16 -chunksize : 16 -walksize : 16 - -name : __ctr(aes) -driver : cryptd(__ctr-aes-aesni) -module : kernel -priority : 450 -refcnt : 1 -selftest : passed -internal : yes -type : skcipher -async : yes -blocksize : 1 -max keysize : 32 -ivsize : 16 -chunksize : 16 -walksize : 16 - -name : ctr(aes) -driver : ctr-aes-aesni -module : kernel -priority : 400 -refcnt : 1 -selftest : passed -internal : no -type : skcipher -async : yes -blocksize : 1 -min keysize : 16 -max keysize : 32 -ivsize : 16 -chunksize : 16 -walksize : 16 - -name : __cbc(aes) -driver : cryptd(__cbc-aes-aesni) -module : kernel -priority : 450 -refcnt : 1 -selftest : passed -internal : yes -type : skcipher -async : yes -blocksize : 16 -min keysize : 16 -max keysize : 32 -ivsize : 16 -chunksize : 16 -walksize : 16 - -name : cbc(aes) -driver : cbc-aes-aesni -module : kernel -priority : 400 -refcnt : 1 -selftest : passed -internal : no -type : skcipher -async : yes -blocksize : 16 -min keysize : 16 -max keysize : 32 -ivsize : 16 -chunksize : 16 -walksize : 16 - -name : __ecb(aes) -driver : cryptd(__ecb-aes-aesni) -module : kernel -priority : 450 -refcnt : 1 -selftest : passed -internal : yes -type : skcipher -async : yes -blocksize : 16 -min keysize : 16 -max keysize : 32 -ivsize : 0 -chunksize : 16 -walksize : 16 - -name : ecb(aes) -driver : ecb-aes-aesni -module : kernel -priority : 400 -refcnt : 1 -selftest : passed -internal : no -type : skcipher -async : yes -blocksize : 16 -min keysize : 16 -max keysize : 32 -ivsize : 0 -chunksize : 16 -walksize : 16 - -name : __generic-gcm-aes-aesni -driver : cryptd(__driver-generic-gcm-aes-aesni) -module : kernel -priority : 50 -refcnt : 1 -selftest : passed -internal : yes -type : aead -async : yes -blocksize : 1 -ivsize : 12 -maxauthsize : 16 -geniv : - -name : gcm(aes) -driver : generic-gcm-aesni -module : kernel -priority : 400 -refcnt : 1 -selftest : passed -internal : no -type : aead -async : yes -blocksize : 1 -ivsize : 12 -maxauthsize : 16 -geniv : - -name : __generic-gcm-aes-aesni -driver : __driver-generic-gcm-aes-aesni -module : kernel -priority : 0 -refcnt : 1 -selftest : passed -internal : yes -type : aead -async : no -blocksize : 1 -ivsize : 12 -maxauthsize : 16 -geniv : - -name : __gcm-aes-aesni -driver : cryptd(__driver-gcm-aes-aesni) -module : kernel -priority : 50 -refcnt : 1 -selftest : passed -internal : yes -type : aead -async : yes -blocksize : 1 -ivsize : 8 -maxauthsize : 16 -geniv : - -name : rfc4106(gcm(aes)) -driver : rfc4106-gcm-aesni -module : kernel -priority : 400 -refcnt : 1 -selftest : passed -internal : no -type : aead -async : yes -blocksize : 1 -ivsize : 8 -maxauthsize : 16 -geniv : - -name : __gcm-aes-aesni -driver : __driver-gcm-aes-aesni -module : kernel -priority : 0 -refcnt : 1 -selftest : passed -internal : yes -type : aead -async : no -blocksize : 1 -ivsize : 8 -maxauthsize : 16 -geniv : - -name : __xts(aes) -driver : __xts-aes-aesni -module : kernel -priority : 401 -refcnt : 1 -selftest : passed -internal : yes -type : skcipher -async : no -blocksize : 16 -min keysize : 32 -max keysize : 64 -ivsize : 16 -chunksize : 16 -walksize : 16 - -name : __ctr(aes) -driver : __ctr-aes-aesni -module : kernel -priority : 400 -refcnt : 1 -selftest : passed -internal : yes -type : skcipher -async : no -blocksize : 1 -min keysize : 16 -max keysize : 32 -ivsize : 16 -chunksize : 16 -walksize : 16 - -name : __cbc(aes) -driver : __cbc-aes-aesni -module : kernel -priority : 400 -refcnt : 1 -selftest : passed -internal : yes -type : skcipher -async : no -blocksize : 16 -min keysize : 16 -max keysize : 32 -ivsize : 16 -chunksize : 16 -walksize : 16 - -name : __ecb(aes) -driver : __ecb-aes-aesni -module : kernel -priority : 400 -refcnt : 1 -selftest : passed -internal : yes -type : skcipher -async : no -blocksize : 16 -min keysize : 16 -max keysize : 32 -ivsize : 0 -chunksize : 16 -walksize : 16 - -name : __aes -driver : __aes-aesni -module : kernel -priority : 300 -refcnt : 1 -selftest : passed -internal : yes -type : cipher -blocksize : 16 -min keysize : 16 -max keysize : 32 - -name : aes -driver : aes-aesni -module : kernel -priority : 300 -refcnt : 8 -selftest : passed -internal : no -type : cipher -blocksize : 16 -min keysize : 16 -max keysize : 32 - -name : hmac(sha1) -driver : hmac(sha1-generic) -module : kernel -priority : 100 -refcnt : 9 -selftest : passed -internal : no -type : shash -blocksize : 64 -digestsize : 20 - -name : ghash -driver : ghash-generic -module : kernel -priority : 100 -refcnt : 3 -selftest : passed -internal : no -type : shash -blocksize : 16 -digestsize : 16 - -name : jitterentropy_rng -driver : jitterentropy_rng -module : kernel -priority : 100 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_nopr_hmac_sha256 -module : kernel -priority : 221 -refcnt : 2 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_nopr_hmac_sha512 -module : kernel -priority : 220 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_nopr_hmac_sha384 -module : kernel -priority : 219 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_nopr_hmac_sha1 -module : kernel -priority : 218 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_nopr_sha256 -module : kernel -priority : 217 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_nopr_sha512 -module : kernel -priority : 216 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_nopr_sha384 -module : kernel -priority : 215 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_nopr_sha1 -module : kernel -priority : 214 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_nopr_ctr_aes256 -module : kernel -priority : 213 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_nopr_ctr_aes192 -module : kernel -priority : 212 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_nopr_ctr_aes128 -module : kernel -priority : 211 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : hmac(sha256) -driver : hmac(sha256-generic) -module : kernel -priority : 100 -refcnt : 10 -selftest : passed -internal : no -type : shash -blocksize : 64 -digestsize : 32 - -name : stdrng -driver : drbg_pr_hmac_sha256 -module : kernel -priority : 210 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_pr_hmac_sha512 -module : kernel -priority : 209 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_pr_hmac_sha384 -module : kernel -priority : 208 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_pr_hmac_sha1 -module : kernel -priority : 207 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_pr_sha256 -module : kernel -priority : 206 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_pr_sha512 -module : kernel -priority : 205 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_pr_sha384 -module : kernel -priority : 204 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_pr_sha1 -module : kernel -priority : 203 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_pr_ctr_aes256 -module : kernel -priority : 202 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_pr_ctr_aes192 -module : kernel -priority : 201 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : stdrng -driver : drbg_pr_ctr_aes128 -module : kernel -priority : 200 -refcnt : 1 -selftest : passed -internal : no -type : rng -seedsize : 0 - -name : 842 -driver : 842-scomp -module : kernel -priority : 100 -refcnt : 1 -selftest : passed -internal : no -type : scomp - -name : 842 -driver : 842-generic -module : kernel -priority : 100 -refcnt : 1 -selftest : passed -internal : no -type : compression - -name : lzo-rle -driver : lzo-rle-scomp -module : kernel -priority : 0 -refcnt : 1 -selftest : passed -internal : no -type : scomp - -name : lzo-rle -driver : lzo-rle-generic -module : kernel -priority : 0 -refcnt : 1 -selftest : passed -internal : no -type : compression - -name : lzo -driver : lzo-scomp -module : kernel -priority : 0 -refcnt : 1 -selftest : passed -internal : no -type : scomp - -name : lzo -driver : lzo-generic -module : kernel -priority : 0 -refcnt : 9 -selftest : passed -internal : no -type : compression - -name : crct10dif -driver : crct10dif-generic -module : kernel -priority : 100 -refcnt : 1 -selftest : passed -internal : no -type : shash -blocksize : 1 -digestsize : 2 - -name : crc32c -driver : crc32c-generic -module : kernel -priority : 100 -refcnt : 1 -selftest : passed -internal : no -type : shash -blocksize : 1 -digestsize : 4 - -name : zlib-deflate -driver : zlib-deflate-scomp -module : kernel -priority : 0 -refcnt : 1 -selftest : passed -internal : no -type : scomp - -name : deflate -driver : deflate-scomp -module : kernel -priority : 0 -refcnt : 1 -selftest : passed -internal : no -type : scomp - -name : deflate -driver : deflate-generic -module : kernel -priority : 0 -refcnt : 1 -selftest : passed -internal : no -type : compression - -name : aes -driver : aes-generic -module : kernel -priority : 100 -refcnt : 1 -selftest : passed -internal : no -type : cipher -blocksize : 16 -min keysize : 16 -max keysize : 32 - -name : sha224 -driver : sha224-generic -module : kernel -priority : 100 -refcnt : 1 -selftest : passed -internal : no -type : shash -blocksize : 64 -digestsize : 28 - -name : sha256 -driver : sha256-generic -module : kernel -priority : 100 -refcnt : 11 -selftest : passed -internal : no -type : shash -blocksize : 64 -digestsize : 32 - -name : sha1 -driver : sha1-generic -module : kernel -priority : 100 -refcnt : 11 -selftest : passed -internal : no -type : shash -blocksize : 64 -digestsize : 20 - -name : md5 -driver : md5-generic -module : kernel -priority : 0 -refcnt : 1 -selftest : passed -internal : no -type : shash -blocksize : 64 -digestsize : 16 - -name : ecb(cipher_null) -driver : ecb-cipher_null -module : kernel -priority : 100 -refcnt : 1 -selftest : passed -internal : no -type : skcipher -async : no -blocksize : 1 -min keysize : 0 -max keysize : 0 -ivsize : 0 -chunksize : 1 -walksize : 1 - -name : digest_null -driver : digest_null-generic -module : kernel -priority : 0 -refcnt : 1 -selftest : passed -internal : no -type : shash -blocksize : 1 -digestsize : 0 - -name : compress_null -driver : compress_null-generic -module : kernel -priority : 0 -refcnt : 1 -selftest : passed -internal : no -type : compression - -name : cipher_null -driver : cipher_null-generic -module : kernel -priority : 0 -refcnt : 1 -selftest : passed -internal : no -type : cipher -blocksize : 1 -min keysize : 0 -max keysize : 0 - -name : rsa -driver : rsa-generic -module : kernel -priority : 100 -refcnt : 1 -selftest : passed -internal : no -type : akcipher - -name : dh -driver : dh-generic -module : kernel -priority : 100 -refcnt : 1 -selftest : passed -internal : no -type : kpp - -name : aes -driver : aes-asm -module : kernel -priority : 200 -refcnt : 1 -selftest : passed -internal : no -type : cipher -blocksize : 16 -min keysize : 16 -max keysize : 32 - -Mode: 444 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/diskstats -Lines: 52 - 1 0 ram0 0 0 0 0 0 0 0 0 0 0 0 - 1 1 ram1 0 0 0 0 0 0 0 0 0 0 0 - 1 2 ram2 0 0 0 0 0 0 0 0 0 0 0 - 1 3 ram3 0 0 0 0 0 0 0 0 0 0 0 - 1 4 ram4 0 0 0 0 0 0 0 0 0 0 0 - 1 5 ram5 0 0 0 0 0 0 0 0 0 0 0 - 1 6 ram6 0 0 0 0 0 0 0 0 0 0 0 - 1 7 ram7 0 0 0 0 0 0 0 0 0 0 0 - 1 8 ram8 0 0 0 0 0 0 0 0 0 0 0 - 1 9 ram9 0 0 0 0 0 0 0 0 0 0 0 - 1 10 ram10 0 0 0 0 0 0 0 0 0 0 0 - 1 11 ram11 0 0 0 0 0 0 0 0 0 0 0 - 1 12 ram12 0 0 0 0 0 0 0 0 0 0 0 - 1 13 ram13 0 0 0 0 0 0 0 0 0 0 0 - 1 14 ram14 0 0 0 0 0 0 0 0 0 0 0 - 1 15 ram15 0 0 0 0 0 0 0 0 0 0 0 - 7 0 loop0 0 0 0 0 0 0 0 0 0 0 0 - 7 1 loop1 0 0 0 0 0 0 0 0 0 0 0 - 7 2 loop2 0 0 0 0 0 0 0 0 0 0 0 - 7 3 loop3 0 0 0 0 0 0 0 0 0 0 0 - 7 4 loop4 0 0 0 0 0 0 0 0 0 0 0 - 7 5 loop5 0 0 0 0 0 0 0 0 0 0 0 - 7 6 loop6 0 0 0 0 0 0 0 0 0 0 0 - 7 7 loop7 0 0 0 0 0 0 0 0 0 0 0 - 8 0 sda 25354637 34367663 1003346126 18492372 28444756 11134226 505697032 63877960 0 9653880 82621804 - 8 1 sda1 250 0 2000 36 0 0 0 0 0 36 36 - 8 2 sda2 246 0 1968 32 0 0 0 0 0 32 32 - 8 3 sda3 340 13 2818 52 11 8 152 8 0 56 60 - 8 4 sda4 25353629 34367650 1003337964 18492232 27448755 11134218 505696880 61593380 0 7576432 80332428 - 252 0 dm-0 59910002 0 1003337218 46229572 39231014 0 505696880 1158557800 0 11325968 1206301256 - 252 1 dm-1 388 0 3104 84 74 0 592 0 0 76 84 - 252 2 dm-2 11571 0 308350 6536 153522 0 5093416 122884 0 65400 129416 - 252 3 dm-3 3870 0 3870 104 0 0 0 0 0 16 104 - 252 4 dm-4 392 0 1034 28 38 0 137 16 0 24 44 - 252 5 dm-5 3729 0 84279 924 98918 0 1151688 104684 0 58848 105632 - 179 0 mmcblk0 192 3 1560 156 0 0 0 0 0 136 156 - 179 1 mmcblk0p1 17 3 160 24 0 0 0 0 0 24 24 - 179 2 mmcblk0p2 95 0 760 68 0 0 0 0 0 68 68 - 2 0 fd0 2 0 16 80 0 0 0 0 0 80 80 - 254 0 vda 1775784 15386 32670882 8655768 6038856 20711856 213637440 2069221364 0 41614592 2077872228 - 254 1 vda1 668 85 5984 956 207 4266 35784 32772 0 8808 33720 - 254 2 vda2 1774936 15266 32663262 8654692 5991028 20707590 213601656 2069152216 0 41607628 2077801992 - 11 0 sr0 0 0 0 0 0 0 0 0 0 0 0 - 259 0 nvme0n1 47114 4 4643973 21650 1078320 43950 39451633 1011053 0 222766 1032546 - 259 1 nvme0n1p1 1140 0 9370 16 1 0 1 0 0 16 16 - 259 2 nvme0n1p2 45914 4 4631243 21626 1036885 43950 39451632 919480 0 131580 940970 - 8 0 sdb 326552 841 9657779 84 41822 2895 1972905 5007 0 60730 67070 68851 0 1925173784 11130 - 8 1 sdb1 231 3 34466 4 24 23 106 0 0 64 64 0 0 0 0 - 8 2 sdb2 326310 838 9622281 67 40726 2872 1972799 4924 0 58250 64567 68851 0 1925173784 11130 - 8 0 sdc 14202 71 579164 21861 2995 1589 180500 40875 0 11628 55200 0 0 0 0 127 182 - 8 1 sdc1 1027 0 13795 5021 2 0 4096 3 0 690 4579 0 0 0 0 0 0 - 8 2 sdc2 13126 71 561749 16802 2830 1589 176404 40620 0 10931 50449 0 0 0 0 0 0 -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/fs -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/fs/fscache -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/fs/fscache/stats -Lines: 24 -FS-Cache statistics -Cookies: idx=3 dat=67877 spc=0 -Objects: alc=67473 nal=0 avl=67473 ded=388 -ChkAux : non=12 ok=33 upd=44 obs=55 -Pages : mrk=547164 unc=364577 -Acquire: n=67880 nul=98 noc=25 ok=67780 nbf=39 oom=26 -Lookups: n=67473 neg=67470 pos=58 crt=67473 tmo=85 -Invals : n=14 run=13 -Updates: n=7 nul=3 run=8 -Relinqs: n=394 nul=1 wcr=2 rtr=3 -AttrChg: n=6 ok=5 nbf=4 oom=3 run=2 -Allocs : n=20 ok=19 wt=18 nbf=17 int=16 -Allocs : ops=15 owt=14 abt=13 -Retrvls: n=151959 ok=82823 wt=23467 nod=69136 nbf=15 int=69 oom=43 -Retrvls: ops=151959 owt=42747 abt=44 -Stores : n=225565 ok=225565 agn=12 nbf=13 oom=14 -Stores : ops=69156 run=294721 pgs=225565 rxd=225565 olm=43 -VmScan : nos=364512 gon=2 bsy=43 can=12 wt=66 -Ops : pend=42753 run=221129 enq=628798 can=11 rej=88 -Ops : ini=377538 dfr=27 rel=377538 gc=37 -CacheOp: alo=1 luo=2 luc=3 gro=4 -CacheOp: inv=5 upo=6 dro=7 pto=8 atc=9 syn=10 -CacheOp: rap=11 ras=12 alp=13 als=14 wrp=15 ucp=16 dsp=17 -CacheEv: nsp=18 stl=19 rtr=20 cul=21EOF -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/fs/xfs -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/fs/xfs/stat -Lines: 23 -extent_alloc 92447 97589 92448 93751 -abt 0 0 0 0 -blk_map 1767055 188820 184891 92447 92448 2140766 0 -bmbt 0 0 0 0 -dir 185039 92447 92444 136422 -trans 706 944304 0 -ig 185045 58807 0 126238 0 33637 22 -log 2883 113448 9 17360 739 -push_ail 945014 0 134260 15483 0 3940 464 159985 0 40 -xstrat 92447 0 -rw 107739 94045 -attr 4 0 0 0 -icluster 8677 7849 135802 -vnodes 92601 0 0 0 92444 92444 92444 0 -buf 2666287 7122 2659202 3599 2 7085 0 10297 7085 -abtb2 184941 1277345 13257 13278 0 0 0 0 0 0 0 0 0 0 2746147 -abtc2 345295 2416764 172637 172658 0 0 0 0 0 0 0 0 0 0 21406023 -bmbt2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -ibt2 343004 1358467 0 0 0 0 0 0 0 0 0 0 0 0 0 -fibt2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -qm 0 0 0 0 0 0 0 0 -xpc 399724544 92823103 86219234 -debug 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/loadavg -Lines: 1 -0.02 0.04 0.05 1/497 11947 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/mdstat -Lines: 60 -Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] - -md3 : active raid6 sda1[8] sdh1[7] sdg1[6] sdf1[5] sde1[11] sdd1[3] sdc1[10] sdb1[9] sdd1[10](S) sdd2[11](S) - 5853468288 blocks super 1.2 level 6, 64k chunk, algorithm 2 [8/8] [UUUUUUUU] - -md127 : active raid1 sdi2[0] sdj2[1] - 312319552 blocks [2/2] [UU] - -md0 : active raid1 sdi1[0] sdj1[1] - 248896 blocks [2/2] [UU] - -md4 : inactive raid1 sda3[0](F) sdb3[1](S) - 4883648 blocks [2/2] [UU] - -md6 : active raid1 sdb2[2](F) sdc[1](S) sda2[0] - 195310144 blocks [2/1] [U_] - [=>...................] recovery = 8.5% (16775552/195310144) finish=17.0min speed=259783K/sec - -md8 : active raid1 sdb1[1] sda1[0] sdc[2](S) sde[3](S) - 195310144 blocks [2/2] [UU] - [=>...................] resync = 8.5% (16775552/195310144) finish=17.0min speed=259783K/sec - -md201 : active raid1 sda3[0] sdb3[1] - 1993728 blocks super 1.2 [2/2] [UU] - [=>...................] check = 5.7% (114176/1993728) finish=0.2min speed=114176K/sec - -md7 : active raid6 sdb1[0] sde1[3] sdd1[2] sdc1[1](F) - 7813735424 blocks super 1.2 level 6, 512k chunk, algorithm 2 [4/3] [U_UU] - bitmap: 0/30 pages [0KB], 65536KB chunk - -md9 : active raid1 sdc2[2] sdd2[3] sdb2[1] sda2[0] sde[4](F) sdf[5](F) sdg[6](S) - 523968 blocks super 1.2 [4/4] [UUUU] - resync=DELAYED - -md10 : active raid0 sda1[0] sdb1[1] - 314159265 blocks 64k chunks - -md11 : active (auto-read-only) raid1 sdb2[0] sdc2[1] sdc3[2](F) hda[4](S) ssdc2[3](S) - 4190208 blocks super 1.2 [2/2] [UU] - resync=PENDING - -md12 : active raid0 sdc2[0] sdd2[1] - 3886394368 blocks super 1.2 512k chunks - -md126 : active raid0 sdb[1] sdc[0] - 1855870976 blocks super external:/md127/0 128k chunks - -md219 : inactive sdb[2](S) sdc[1](S) sda[0](S) - 7932 blocks super external:imsm - -md00 : active raid0 xvdb[0] - 4186624 blocks super 1.2 256k chunks - -md120 : active linear sda1[1] sdb1[0] - 2095104 blocks super 1.2 0k rounding - -md101 : active (read-only) raid0 sdb[2] sdd[1] sdc[0] - 322560 blocks super 1.2 512k chunks - -unused devices: -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/meminfo -Lines: 42 -MemTotal: 15666184 kB -MemFree: 440324 kB -Buffers: 1020128 kB -Cached: 12007640 kB -SwapCached: 0 kB -Active: 6761276 kB -Inactive: 6532708 kB -Active(anon): 267256 kB -Inactive(anon): 268 kB -Active(file): 6494020 kB -Inactive(file): 6532440 kB -Unevictable: 0 kB -Mlocked: 0 kB -SwapTotal: 0 kB -SwapFree: 0 kB -Dirty: 768 kB -Writeback: 0 kB -AnonPages: 266216 kB -Mapped: 44204 kB -Shmem: 1308 kB -Slab: 1807264 kB -SReclaimable: 1738124 kB -SUnreclaim: 69140 kB -KernelStack: 1616 kB -PageTables: 5288 kB -NFS_Unstable: 0 kB -Bounce: 0 kB -WritebackTmp: 0 kB -CommitLimit: 7833092 kB -Committed_AS: 530844 kB -VmallocTotal: 34359738367 kB -VmallocUsed: 36596 kB -VmallocChunk: 34359637840 kB -HardwareCorrupted: 0 kB -AnonHugePages: 12288 kB -HugePages_Total: 0 -HugePages_Free: 0 -HugePages_Rsvd: 0 -HugePages_Surp: 0 -Hugepagesize: 2048 kB -DirectMap4k: 91136 kB -DirectMap2M: 16039936 kB -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/net -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/arp -Lines: 2 -IP address HW type Flags HW address Mask Device -192.168.224.1 0x1 0x2 00:50:56:c0:00:08 * ens33 -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/dev -Lines: 6 -Inter-| Receive | Transmit - face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed -vethf345468: 648 8 0 0 0 0 0 0 438 5 0 0 0 0 0 0 - lo: 1664039048 1566805 0 0 0 0 0 0 1664039048 1566805 0 0 0 0 0 0 -docker0: 2568 38 0 0 0 0 0 0 438 5 0 0 0 0 0 0 - eth0: 874354587 1036395 0 0 0 0 0 0 563352563 732147 0 0 0 0 0 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/ip_vs -Lines: 21 -IP Virtual Server version 1.2.1 (size=4096) -Prot LocalAddress:Port Scheduler Flags - -> RemoteAddress:Port Forward Weight ActiveConn InActConn -TCP C0A80016:0CEA wlc - -> C0A85216:0CEA Tunnel 100 248 2 - -> C0A85318:0CEA Tunnel 100 248 2 - -> C0A85315:0CEA Tunnel 100 248 1 -TCP C0A80039:0CEA wlc - -> C0A85416:0CEA Tunnel 0 0 0 - -> C0A85215:0CEA Tunnel 100 1499 0 - -> C0A83215:0CEA Tunnel 100 1498 0 -TCP C0A80037:0CEA wlc - -> C0A8321A:0CEA Tunnel 0 0 0 - -> C0A83120:0CEA Tunnel 100 0 0 -TCP [2620:0000:0000:0000:0000:0000:0000:0001]:0050 sh - -> [2620:0000:0000:0000:0000:0000:0000:0002]:0050 Route 1 0 0 - -> [2620:0000:0000:0000:0000:0000:0000:0003]:0050 Route 1 0 0 - -> [2620:0000:0000:0000:0000:0000:0000:0004]:0050 Route 1 1 1 -FWM 10001000 wlc - -> C0A8321A:0CEA Route 0 0 1 - -> C0A83215:0CEA Route 0 0 2 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/ip_vs_stats -Lines: 6 - Total Incoming Outgoing Incoming Outgoing - Conns Packets Packets Bytes Bytes - 16AA370 E33656E5 0 51D8C8883AB3 0 - - Conns/s Pkts/s Pkts/s Bytes/s Bytes/s - 4 1FB3C 0 1282A8F 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/protocols -Lines: 14 -protocol size sockets memory press maxhdr slab module cl co di ac io in de sh ss gs se re sp bi br ha uh gp em -PACKET 1344 2 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n -PINGv6 1112 0 -1 NI 0 yes kernel y y y n n y n n y y y y n y y y y y n -RAWv6 1112 1 -1 NI 0 yes kernel y y y n y y y n y y y y n y y y y n n -UDPLITEv6 1216 0 57 NI 0 yes kernel y y y n y y y n y y y y n n n y y y n -UDPv6 1216 10 57 NI 0 yes kernel y y y n y y y n y y y y n n n y y y n -TCPv6 2144 1937 1225378 no 320 yes kernel y y y y y y y y y y y y y n y y y y y -UNIX 1024 120 -1 NI 0 yes kernel n n n n n n n n n n n n n n n n n n n -UDP-Lite 1024 0 57 NI 0 yes kernel y y y n y y y n y y y y y n n y y y n -PING 904 0 -1 NI 0 yes kernel y y y n n y n n y y y y n y y y y y n -RAW 912 0 -1 NI 0 yes kernel y y y n y y y n y y y y n y y y y n n -UDP 1024 73 57 NI 0 yes kernel y y y n y y y n y y y y y n n y y y n -TCP 1984 93064 1225378 yes 320 yes kernel y y y y y y y y y y y y y n y y y y y -NETLINK 1040 16 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/net/rpc -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/rpc/nfs -Lines: 5 -net 18628 0 18628 6 -rpc 4329785 0 4338291 -proc2 18 2 69 0 0 4410 0 0 0 0 0 0 0 0 0 0 0 99 2 -proc3 22 1 4084749 29200 94754 32580 186 47747 7981 8639 0 6356 0 6962 0 7958 0 0 241 4 4 2 39 -proc4 61 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/rpc/nfsd -Lines: 11 -rc 0 6 18622 -fh 0 0 0 0 0 -io 157286400 0 -th 8 0 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 -ra 32 0 0 0 0 0 0 0 0 0 0 0 -net 18628 0 18628 6 -rpc 18628 0 0 0 0 -proc2 18 2 69 0 0 4410 0 0 0 0 0 0 0 0 0 0 0 99 2 -proc3 22 2 112 0 2719 111 0 0 0 0 0 0 0 0 0 0 0 27 216 0 2 1 0 -proc4 2 2 10853 -proc4ops 72 0 0 0 1098 2 0 0 0 0 8179 5896 0 0 0 0 5900 0 0 2 0 2 0 9609 0 2 150 1272 0 0 0 1236 0 0 0 0 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/sockstat -Lines: 6 -sockets: used 1602 -TCP: inuse 35 orphan 0 tw 4 alloc 59 mem 22 -UDP: inuse 12 mem 62 -UDPLITE: inuse 0 -RAW: inuse 0 -FRAG: inuse 0 memory 0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/sockstat6 -Lines: 5 -TCP6: inuse 17 -UDP6: inuse 9 -UDPLITE6: inuse 0 -RAW6: inuse 1 -FRAG6: inuse 0 memory 0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/softnet_stat -Lines: 2 -00015c73 00020e76 F0000769 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 -01663fb2 00000000 000109a4 00000000 00000000 00000000 00000000 00000000 00000000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/softnet_stat.broken -Lines: 1 -00015c73 00020e76 F0000769 00000000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/tcp -Lines: 4 - sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode - 0: 0500000A:0016 00000000:0000 0A 00000000:00000001 00:00000000 00000000 0 0 2740 1 ffff88003d3af3c0 100 0 0 10 0 - 1: 00000000:0016 00000000:0000 0A 00000001:00000000 00:00000000 00000000 0 0 2740 1 ffff88003d3af3c0 100 0 0 10 0 - 2: 00000000:0016 00000000:0000 0A 00000001:00000001 00:00000000 00000000 0 0 2740 1 ffff88003d3af3c0 100 0 0 10 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/tcp6 -Lines: 3 - sl local_address remote_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode ref pointer drops - 1315: 00000000000000000000000000000000:14EB 00000000000000000000000000000000:0000 07 00000000:00000000 00:00000000 00000000 981 0 21040 2 0000000013726323 0 - 6073: 000080FE00000000FFADE15609667CFE:C781 00000000000000000000000000000000:0000 07 00000000:00000000 00:00000000 00000000 1000 0 11337031 2 00000000b9256fdd 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/udp -Lines: 4 - sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode - 0: 0500000A:0016 00000000:0000 0A 00000000:00000001 00:00000000 00000000 0 0 2740 1 ffff88003d3af3c0 100 0 0 10 0 - 1: 00000000:0016 00000000:0000 0A 00000001:00000000 00:00000000 00000000 0 0 2740 1 ffff88003d3af3c0 100 0 0 10 0 - 2: 00000000:0016 00000000:0000 0A 00000001:00000001 00:00000000 00000000 0 0 2740 1 ffff88003d3af3c0 100 0 0 10 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/udp6 -Lines: 3 - sl local_address remote_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode ref pointer drops - 1315: 00000000000000000000000000000000:14EB 00000000000000000000000000000000:0000 07 00000000:00000000 00:00000000 00000000 981 0 21040 2 0000000013726323 0 - 6073: 000080FE00000000FFADE15609667CFE:C781 00000000000000000000000000000000:0000 07 00000000:00000000 00:00000000 00000000 1000 0 11337031 2 00000000b9256fdd 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/udp_broken -Lines: 2 - sl local_address rem_address st - 1: 00000000:0016 00000000:0000 0A -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/unix -Lines: 6 -Num RefCount Protocol Flags Type St Inode Path -0000000000000000: 00000002 00000000 00010000 0001 01 3442596 /var/run/postgresql/.s.PGSQL.5432 -0000000000000000: 0000000a 00000000 00010000 0005 01 10061 /run/udev/control -0000000000000000: 00000007 00000000 00000000 0002 01 12392 /dev/log -0000000000000000: 00000003 00000000 00000000 0001 03 4787297 /var/run/postgresql/.s.PGSQL.5432 -0000000000000000: 00000003 00000000 00000000 0001 03 5091797 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/unix_without_inode -Lines: 6 -Num RefCount Protocol Flags Type St Path -0000000000000000: 00000002 00000000 00010000 0001 01 /var/run/postgresql/.s.PGSQL.5432 -0000000000000000: 0000000a 00000000 00010000 0005 01 /run/udev/control -0000000000000000: 00000007 00000000 00000000 0002 01 /dev/log -0000000000000000: 00000003 00000000 00000000 0001 03 /var/run/postgresql/.s.PGSQL.5432 -0000000000000000: 00000003 00000000 00000000 0001 03 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/net/xfrm_stat -Lines: 28 -XfrmInError 1 -XfrmInBufferError 2 -XfrmInHdrError 4 -XfrmInNoStates 3 -XfrmInStateProtoError 40 -XfrmInStateModeError 100 -XfrmInStateSeqError 6000 -XfrmInStateExpired 4 -XfrmInStateMismatch 23451 -XfrmInStateInvalid 55555 -XfrmInTmplMismatch 51 -XfrmInNoPols 65432 -XfrmInPolBlock 100 -XfrmInPolError 10000 -XfrmOutError 1000000 -XfrmOutBundleGenError 43321 -XfrmOutBundleCheckError 555 -XfrmOutNoStates 869 -XfrmOutStateProtoError 4542 -XfrmOutStateModeError 4 -XfrmOutStateSeqError 543 -XfrmOutStateExpired 565 -XfrmOutPolBlock 43456 -XfrmOutPolDead 7656 -XfrmOutPolError 1454 -XfrmFwdHdrError 6654 -XfrmOutStateInvalid 28765 -XfrmAcquireError 24532 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/pressure -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/pressure/cpu -Lines: 1 -some avg10=0.10 avg60=2.00 avg300=3.85 total=15 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/pressure/io -Lines: 2 -some avg10=0.10 avg60=2.00 avg300=3.85 total=15 -full avg10=0.20 avg60=3.00 avg300=4.95 total=25 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/pressure/memory -Lines: 2 -some avg10=0.10 avg60=2.00 avg300=3.85 total=15 -full avg10=0.20 avg60=3.00 avg300=4.95 total=25 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/schedstat -Lines: 6 -version 15 -timestamp 15819019232 -cpu0 498494191 0 3533438552 2553969831 3853684107 2465731542 2045936778163039 343796328169361 4767485306 -domain0 00000000,00000003 212499247 210112015 1861015 1860405436 536440 369895 32599 210079416 25368550 24241256 384652 927363878 807233 6366 1647 24239609 2122447165 1886868564 121112060 2848625533 125678146 241025 1032026 1885836538 2545 12 2533 0 0 0 0 0 0 1387952561 21076581 0 -cpu1 518377256 0 4155211005 2778589869 10466382 2867629021 1904686152592476 364107263788241 5145567945 -domain0 00000000,00000003 217653037 215526982 1577949 1580427380 557469 393576 28538 215498444 28721913 27662819 371153 870843407 745912 5523 1639 27661180 2331056874 2107732788 111442342 652402556 123615235 196159 1045245 2106687543 2400 3 2397 0 0 0 0 0 0 1437804657 26220076 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/self -SymlinkTo: 26231 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/slabinfo -Lines: 302 -slabinfo - version: 2.1 -# name : tunables : slabdata -pid_3 375 532 576 28 4 : tunables 0 0 0 : slabdata 19 19 0 -pid_2 3 28 576 28 4 : tunables 0 0 0 : slabdata 1 1 0 -nvidia_p2p_page_cache 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 -nvidia_pte_cache 9022 9152 368 22 2 : tunables 0 0 0 : slabdata 416 416 0 -nvidia_stack_cache 321 326 12624 2 8 : tunables 0 0 0 : slabdata 163 163 0 -kvm_async_pf 0 0 472 34 4 : tunables 0 0 0 : slabdata 0 0 0 -kvm_vcpu 0 0 15552 2 8 : tunables 0 0 0 : slabdata 0 0 0 -kvm_mmu_page_header 0 0 504 32 4 : tunables 0 0 0 : slabdata 0 0 0 -pte_list_desc 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 -x86_emulator 0 0 3024 10 8 : tunables 0 0 0 : slabdata 0 0 0 -x86_fpu 0 0 4608 7 8 : tunables 0 0 0 : slabdata 0 0 0 -iwl_cmd_pool:0000:04:00.0 0 128 512 32 4 : tunables 0 0 0 : slabdata 4 4 0 -ext4_groupinfo_4k 3719 3740 480 34 4 : tunables 0 0 0 : slabdata 110 110 0 -bio-6 32 75 640 25 4 : tunables 0 0 0 : slabdata 3 3 0 -bio-5 16 48 1344 24 8 : tunables 0 0 0 : slabdata 2 2 0 -bio-4 17 92 1408 23 8 : tunables 0 0 0 : slabdata 4 4 0 -fat_inode_cache 0 0 1056 31 8 : tunables 0 0 0 : slabdata 0 0 0 -fat_cache 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 -ovl_aio_req 0 0 512 32 4 : tunables 0 0 0 : slabdata 0 0 0 -ovl_inode 0 0 1000 32 8 : tunables 0 0 0 : slabdata 0 0 0 -squashfs_inode_cache 0 0 1088 30 8 : tunables 0 0 0 : slabdata 0 0 0 -fuse_request 0 0 472 34 4 : tunables 0 0 0 : slabdata 0 0 0 -fuse_inode 0 0 1152 28 8 : tunables 0 0 0 : slabdata 0 0 0 -xfs_dqtrx 0 0 864 37 8 : tunables 0 0 0 : slabdata 0 0 0 -xfs_dquot 0 0 832 39 8 : tunables 0 0 0 : slabdata 0 0 0 -xfs_buf 0 0 768 21 4 : tunables 0 0 0 : slabdata 0 0 0 -xfs_bui_item 0 0 544 30 4 : tunables 0 0 0 : slabdata 0 0 0 -xfs_bud_item 0 0 512 32 4 : tunables 0 0 0 : slabdata 0 0 0 -xfs_cui_item 0 0 768 21 4 : tunables 0 0 0 : slabdata 0 0 0 -xfs_cud_item 0 0 512 32 4 : tunables 0 0 0 : slabdata 0 0 0 -xfs_rui_item 0 0 1024 32 8 : tunables 0 0 0 : slabdata 0 0 0 -xfs_rud_item 0 0 512 32 4 : tunables 0 0 0 : slabdata 0 0 0 -xfs_icr 0 0 520 31 4 : tunables 0 0 0 : slabdata 0 0 0 -xfs_ili 0 0 528 31 4 : tunables 0 0 0 : slabdata 0 0 0 -xfs_inode 0 0 1344 24 8 : tunables 0 0 0 : slabdata 0 0 0 -xfs_efi_item 0 0 768 21 4 : tunables 0 0 0 : slabdata 0 0 0 -xfs_efd_item 0 0 776 21 4 : tunables 0 0 0 : slabdata 0 0 0 -xfs_buf_item 0 0 608 26 4 : tunables 0 0 0 : slabdata 0 0 0 -xf_trans 0 0 568 28 4 : tunables 0 0 0 : slabdata 0 0 0 -xfs_ifork 0 0 376 21 2 : tunables 0 0 0 : slabdata 0 0 0 -xfs_da_state 0 0 816 20 4 : tunables 0 0 0 : slabdata 0 0 0 -xfs_btree_cur 0 0 560 29 4 : tunables 0 0 0 : slabdata 0 0 0 -xfs_bmap_free_item 0 0 400 20 2 : tunables 0 0 0 : slabdata 0 0 0 -xfs_log_ticket 0 0 520 31 4 : tunables 0 0 0 : slabdata 0 0 0 -nfs_direct_cache 0 0 560 29 4 : tunables 0 0 0 : slabdata 0 0 0 -nfs_commit_data 4 28 1152 28 8 : tunables 0 0 0 : slabdata 1 1 0 -nfs_write_data 32 50 1280 25 8 : tunables 0 0 0 : slabdata 2 2 0 -nfs_read_data 0 0 1280 25 8 : tunables 0 0 0 : slabdata 0 0 0 -nfs_inode_cache 0 0 1408 23 8 : tunables 0 0 0 : slabdata 0 0 0 -nfs_page 0 0 512 32 4 : tunables 0 0 0 : slabdata 0 0 0 -rpc_inode_cache 0 0 1024 32 8 : tunables 0 0 0 : slabdata 0 0 0 -rpc_buffers 8 13 2496 13 8 : tunables 0 0 0 : slabdata 1 1 0 -rpc_tasks 8 25 640 25 4 : tunables 0 0 0 : slabdata 1 1 0 -fscache_cookie_jar 1 35 464 35 4 : tunables 0 0 0 : slabdata 1 1 0 -jfs_mp 32 35 464 35 4 : tunables 0 0 0 : slabdata 1 1 0 -jfs_ip 0 0 1592 20 8 : tunables 0 0 0 : slabdata 0 0 0 -reiser_inode_cache 0 0 1096 29 8 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_end_io_wq 0 0 464 35 4 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_prelim_ref 0 0 424 38 4 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_delayed_extent_op 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_delayed_data_ref 0 0 448 36 4 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_delayed_tree_ref 0 0 440 37 4 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_delayed_ref_head 0 0 480 34 4 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_inode_defrag 0 0 400 20 2 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_delayed_node 0 0 648 25 4 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_ordered_extent 0 0 752 21 4 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_extent_map 0 0 480 34 4 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_extent_state 0 0 416 39 4 : tunables 0 0 0 : slabdata 0 0 0 -bio-3 35 92 704 23 4 : tunables 0 0 0 : slabdata 4 4 0 -btrfs_extent_buffer 0 0 600 27 4 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_free_space_bitmap 0 0 12288 2 8 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_free_space 0 0 416 39 4 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_path 0 0 448 36 4 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_trans_handle 0 0 440 37 4 : tunables 0 0 0 : slabdata 0 0 0 -btrfs_inode 0 0 1496 21 8 : tunables 0 0 0 : slabdata 0 0 0 -ext4_inode_cache 84136 84755 1400 23 8 : tunables 0 0 0 : slabdata 3685 3685 0 -ext4_free_data 22 80 392 20 2 : tunables 0 0 0 : slabdata 4 4 0 -ext4_allocation_context 0 70 464 35 4 : tunables 0 0 0 : slabdata 2 2 0 -ext4_prealloc_space 24 74 440 37 4 : tunables 0 0 0 : slabdata 2 2 0 -ext4_system_zone 267 273 376 21 2 : tunables 0 0 0 : slabdata 13 13 0 -ext4_io_end_vec 0 88 368 22 2 : tunables 0 0 0 : slabdata 4 4 0 -ext4_io_end 0 80 400 20 2 : tunables 0 0 0 : slabdata 4 4 0 -ext4_bio_post_read_ctx 128 147 384 21 2 : tunables 0 0 0 : slabdata 7 7 0 -ext4_pending_reservation 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 -ext4_extent_status 79351 79422 376 21 2 : tunables 0 0 0 : slabdata 3782 3782 0 -jbd2_transaction_s 44 100 640 25 4 : tunables 0 0 0 : slabdata 4 4 0 -jbd2_inode 6785 6840 400 20 2 : tunables 0 0 0 : slabdata 342 342 0 -jbd2_journal_handle 0 80 392 20 2 : tunables 0 0 0 : slabdata 4 4 0 -jbd2_journal_head 824 1944 448 36 4 : tunables 0 0 0 : slabdata 54 54 0 -jbd2_revoke_table_s 4 23 352 23 2 : tunables 0 0 0 : slabdata 1 1 0 -jbd2_revoke_record_s 0 156 416 39 4 : tunables 0 0 0 : slabdata 4 4 0 -ext2_inode_cache 0 0 1144 28 8 : tunables 0 0 0 : slabdata 0 0 0 -mbcache 0 0 392 20 2 : tunables 0 0 0 : slabdata 0 0 0 -dm_thin_new_mapping 0 152 424 38 4 : tunables 0 0 0 : slabdata 4 4 0 -dm_snap_pending_exception 0 0 464 35 4 : tunables 0 0 0 : slabdata 0 0 0 -dm_exception 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 -dm_dirty_log_flush_entry 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 -dm_bio_prison_cell_v2 0 0 432 37 4 : tunables 0 0 0 : slabdata 0 0 0 -dm_bio_prison_cell 0 148 432 37 4 : tunables 0 0 0 : slabdata 4 4 0 -kcopyd_job 0 8 3648 8 8 : tunables 0 0 0 : slabdata 1 1 0 -io 0 32 512 32 4 : tunables 0 0 0 : slabdata 1 1 0 -dm_uevent 0 0 3224 10 8 : tunables 0 0 0 : slabdata 0 0 0 -dax_cache 1 28 1152 28 8 : tunables 0 0 0 : slabdata 1 1 0 -aic94xx_ascb 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 -aic94xx_dma_token 0 0 384 21 2 : tunables 0 0 0 : slabdata 0 0 0 -asd_sas_event 0 0 512 32 4 : tunables 0 0 0 : slabdata 0 0 0 -sas_task 0 0 704 23 4 : tunables 0 0 0 : slabdata 0 0 0 -qla2xxx_srbs 0 0 832 39 8 : tunables 0 0 0 : slabdata 0 0 0 -sd_ext_cdb 2 22 368 22 2 : tunables 0 0 0 : slabdata 1 1 0 -scsi_sense_cache 258 288 512 32 4 : tunables 0 0 0 : slabdata 9 9 0 -virtio_scsi_cmd 64 75 640 25 4 : tunables 0 0 0 : slabdata 3 3 0 -L2TP/IPv6 0 0 1536 21 8 : tunables 0 0 0 : slabdata 0 0 0 -L2TP/IP 0 0 1408 23 8 : tunables 0 0 0 : slabdata 0 0 0 -ip6-frags 0 0 520 31 4 : tunables 0 0 0 : slabdata 0 0 0 -fib6_nodes 5 32 512 32 4 : tunables 0 0 0 : slabdata 1 1 0 -ip6_dst_cache 4 25 640 25 4 : tunables 0 0 0 : slabdata 1 1 0 -ip6_mrt_cache 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 -PINGv6 0 0 1600 20 8 : tunables 0 0 0 : slabdata 0 0 0 -RAWv6 25 40 1600 20 8 : tunables 0 0 0 : slabdata 2 2 0 -UDPLITEv6 0 0 1728 18 8 : tunables 0 0 0 : slabdata 0 0 0 -UDPv6 3 54 1728 18 8 : tunables 0 0 0 : slabdata 3 3 0 -tw_sock_TCPv6 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 -request_sock_TCPv6 0 0 632 25 4 : tunables 0 0 0 : slabdata 0 0 0 -TCPv6 0 33 2752 11 8 : tunables 0 0 0 : slabdata 3 3 0 -uhci_urb_priv 0 0 392 20 2 : tunables 0 0 0 : slabdata 0 0 0 -sgpool-128 2 14 4544 7 8 : tunables 0 0 0 : slabdata 2 2 0 -sgpool-64 2 13 2496 13 8 : tunables 0 0 0 : slabdata 1 1 0 -sgpool-32 2 44 1472 22 8 : tunables 0 0 0 : slabdata 2 2 0 -sgpool-16 2 68 960 34 8 : tunables 0 0 0 : slabdata 2 2 0 -sgpool-8 2 46 704 23 4 : tunables 0 0 0 : slabdata 2 2 0 -btree_node 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 -bfq_io_cq 0 0 488 33 4 : tunables 0 0 0 : slabdata 0 0 0 -bfq_queue 0 0 848 38 8 : tunables 0 0 0 : slabdata 0 0 0 -mqueue_inode_cache 1 24 1344 24 8 : tunables 0 0 0 : slabdata 1 1 0 -isofs_inode_cache 0 0 968 33 8 : tunables 0 0 0 : slabdata 0 0 0 -io_kiocb 0 0 640 25 4 : tunables 0 0 0 : slabdata 0 0 0 -kioctx 0 30 1088 30 8 : tunables 0 0 0 : slabdata 1 1 0 -aio_kiocb 0 28 576 28 4 : tunables 0 0 0 : slabdata 1 1 0 -userfaultfd_ctx_cache 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 -fanotify_path_event 0 0 392 20 2 : tunables 0 0 0 : slabdata 0 0 0 -fanotify_fid_event 0 0 400 20 2 : tunables 0 0 0 : slabdata 0 0 0 -fsnotify_mark 0 0 408 20 2 : tunables 0 0 0 : slabdata 0 0 0 -dnotify_mark 0 0 416 39 4 : tunables 0 0 0 : slabdata 0 0 0 -dnotify_struct 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 -dio 0 0 1088 30 8 : tunables 0 0 0 : slabdata 0 0 0 -bio-2 4 25 640 25 4 : tunables 0 0 0 : slabdata 1 1 0 -fasync_cache 0 0 384 21 2 : tunables 0 0 0 : slabdata 0 0 0 -audit_tree_mark 0 0 416 39 4 : tunables 0 0 0 : slabdata 0 0 0 -pid_namespace 30 34 480 34 4 : tunables 0 0 0 : slabdata 1 1 0 -posix_timers_cache 0 27 592 27 4 : tunables 0 0 0 : slabdata 1 1 0 -iommu_devinfo 24 32 512 32 4 : tunables 0 0 0 : slabdata 1 1 0 -iommu_domain 10 10 3264 10 8 : tunables 0 0 0 : slabdata 1 1 0 -iommu_iova 8682 8748 448 36 4 : tunables 0 0 0 : slabdata 243 243 0 -UNIX 529 814 1472 22 8 : tunables 0 0 0 : slabdata 37 37 0 -ip4-frags 0 0 536 30 4 : tunables 0 0 0 : slabdata 0 0 0 -ip_mrt_cache 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 -UDP-Lite 0 0 1536 21 8 : tunables 0 0 0 : slabdata 0 0 0 -tcp_bind_bucket 7 128 512 32 4 : tunables 0 0 0 : slabdata 4 4 0 -inet_peer_cache 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 -xfrm_dst_cache 0 0 704 23 4 : tunables 0 0 0 : slabdata 0 0 0 -xfrm_state 0 0 1152 28 8 : tunables 0 0 0 : slabdata 0 0 0 -ip_fib_trie 7 21 384 21 2 : tunables 0 0 0 : slabdata 1 1 0 -ip_fib_alias 9 20 392 20 2 : tunables 0 0 0 : slabdata 1 1 0 -ip_dst_cache 27 84 576 28 4 : tunables 0 0 0 : slabdata 3 3 0 -PING 0 0 1408 23 8 : tunables 0 0 0 : slabdata 0 0 0 -RAW 32 46 1408 23 8 : tunables 0 0 0 : slabdata 2 2 0 -UDP 11 168 1536 21 8 : tunables 0 0 0 : slabdata 8 8 0 -tw_sock_TCP 1 56 576 28 4 : tunables 0 0 0 : slabdata 2 2 0 -request_sock_TCP 0 25 632 25 4 : tunables 0 0 0 : slabdata 1 1 0 -TCP 10 60 2624 12 8 : tunables 0 0 0 : slabdata 5 5 0 -hugetlbfs_inode_cache 2 35 928 35 8 : tunables 0 0 0 : slabdata 1 1 0 -dquot 0 0 640 25 4 : tunables 0 0 0 : slabdata 0 0 0 -bio-1 32 46 704 23 4 : tunables 0 0 0 : slabdata 2 2 0 -eventpoll_pwq 409 600 408 20 2 : tunables 0 0 0 : slabdata 30 30 0 -eventpoll_epi 408 672 576 28 4 : tunables 0 0 0 : slabdata 24 24 0 -inotify_inode_mark 58 195 416 39 4 : tunables 0 0 0 : slabdata 5 5 0 -scsi_data_buffer 0 0 360 22 2 : tunables 0 0 0 : slabdata 0 0 0 -bio_crypt_ctx 128 147 376 21 2 : tunables 0 0 0 : slabdata 7 7 0 -request_queue 29 39 2408 13 8 : tunables 0 0 0 : slabdata 3 3 0 -blkdev_ioc 81 148 440 37 4 : tunables 0 0 0 : slabdata 4 4 0 -bio-0 125 200 640 25 4 : tunables 0 0 0 : slabdata 8 8 0 -biovec-max 166 196 4544 7 8 : tunables 0 0 0 : slabdata 28 28 0 -biovec-128 0 52 2496 13 8 : tunables 0 0 0 : slabdata 4 4 0 -biovec-64 0 88 1472 22 8 : tunables 0 0 0 : slabdata 4 4 0 -biovec-16 0 92 704 23 4 : tunables 0 0 0 : slabdata 4 4 0 -bio_integrity_payload 4 28 576 28 4 : tunables 0 0 0 : slabdata 1 1 0 -khugepaged_mm_slot 59 180 448 36 4 : tunables 0 0 0 : slabdata 5 5 0 -ksm_mm_slot 0 0 384 21 2 : tunables 0 0 0 : slabdata 0 0 0 -ksm_stable_node 0 0 400 20 2 : tunables 0 0 0 : slabdata 0 0 0 -ksm_rmap_item 0 0 400 20 2 : tunables 0 0 0 : slabdata 0 0 0 -user_namespace 2 37 864 37 8 : tunables 0 0 0 : slabdata 1 1 0 -uid_cache 5 28 576 28 4 : tunables 0 0 0 : slabdata 1 1 0 -dmaengine-unmap-256 1 13 2496 13 8 : tunables 0 0 0 : slabdata 1 1 0 -dmaengine-unmap-128 1 22 1472 22 8 : tunables 0 0 0 : slabdata 1 1 0 -dmaengine-unmap-16 1 28 576 28 4 : tunables 0 0 0 : slabdata 1 1 0 -dmaengine-unmap-2 1 36 448 36 4 : tunables 0 0 0 : slabdata 1 1 0 -audit_buffer 0 22 360 22 2 : tunables 0 0 0 : slabdata 1 1 0 -sock_inode_cache 663 1170 1216 26 8 : tunables 0 0 0 : slabdata 45 45 0 -skbuff_ext_cache 0 0 576 28 4 : tunables 0 0 0 : slabdata 0 0 0 -skbuff_fclone_cache 1 72 896 36 8 : tunables 0 0 0 : slabdata 2 2 0 -skbuff_head_cache 3 650 640 25 4 : tunables 0 0 0 : slabdata 26 26 0 -configfs_dir_cache 7 38 424 38 4 : tunables 0 0 0 : slabdata 1 1 0 -file_lock_cache 27 116 552 29 4 : tunables 0 0 0 : slabdata 4 4 0 -file_lock_ctx 106 120 392 20 2 : tunables 0 0 0 : slabdata 6 6 0 -fsnotify_mark_connector 52 66 368 22 2 : tunables 0 0 0 : slabdata 3 3 0 -net_namespace 1 6 5312 6 8 : tunables 0 0 0 : slabdata 1 1 0 -task_delay_info 784 1560 416 39 4 : tunables 0 0 0 : slabdata 40 40 0 -taskstats 45 92 688 23 4 : tunables 0 0 0 : slabdata 4 4 0 -proc_dir_entry 678 682 528 31 4 : tunables 0 0 0 : slabdata 22 22 0 -pde_opener 0 189 376 21 2 : tunables 0 0 0 : slabdata 9 9 0 -proc_inode_cache 7150 8250 992 33 8 : tunables 0 0 0 : slabdata 250 250 0 -seq_file 60 735 456 35 4 : tunables 0 0 0 : slabdata 21 21 0 -sigqueue 0 156 416 39 4 : tunables 0 0 0 : slabdata 4 4 0 -bdev_cache 36 78 1216 26 8 : tunables 0 0 0 : slabdata 3 3 0 -shmem_inode_cache 1599 2208 1016 32 8 : tunables 0 0 0 : slabdata 69 69 0 -kernfs_iattrs_cache 1251 1254 424 38 4 : tunables 0 0 0 : slabdata 33 33 0 -kernfs_node_cache 52898 52920 464 35 4 : tunables 0 0 0 : slabdata 1512 1512 0 -mnt_cache 42 46 704 23 4 : tunables 0 0 0 : slabdata 2 2 0 -filp 4314 6371 704 23 4 : tunables 0 0 0 : slabdata 277 277 0 -inode_cache 28695 29505 920 35 8 : tunables 0 0 0 : slabdata 843 843 0 -dentry 166069 169074 528 31 4 : tunables 0 0 0 : slabdata 5454 5454 0 -names_cache 0 35 4544 7 8 : tunables 0 0 0 : slabdata 5 5 0 -hashtab_node 0 0 360 22 2 : tunables 0 0 0 : slabdata 0 0 0 -ebitmap_node 0 0 400 20 2 : tunables 0 0 0 : slabdata 0 0 0 -avtab_extended_perms 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 -avtab_node 0 0 360 22 2 : tunables 0 0 0 : slabdata 0 0 0 -avc_xperms_data 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 -avc_xperms_decision_node 0 0 384 21 2 : tunables 0 0 0 : slabdata 0 0 0 -avc_xperms_node 0 0 392 20 2 : tunables 0 0 0 : slabdata 0 0 0 -avc_node 37 40 408 20 2 : tunables 0 0 0 : slabdata 2 2 0 -iint_cache 0 0 448 36 4 : tunables 0 0 0 : slabdata 0 0 0 -lsm_inode_cache 122284 122340 392 20 2 : tunables 0 0 0 : slabdata 6117 6117 0 -lsm_file_cache 4266 4485 352 23 2 : tunables 0 0 0 : slabdata 195 195 0 -key_jar 8 25 640 25 4 : tunables 0 0 0 : slabdata 1 1 0 -buffer_head 255622 257076 440 37 4 : tunables 0 0 0 : slabdata 6948 6948 0 -uts_namespace 0 0 776 21 4 : tunables 0 0 0 : slabdata 0 0 0 -nsproxy 31 40 408 20 2 : tunables 0 0 0 : slabdata 2 2 0 -vm_area_struct 39115 43214 528 31 4 : tunables 0 0 0 : slabdata 1394 1394 0 -mm_struct 96 529 1408 23 8 : tunables 0 0 0 : slabdata 23 23 0 -fs_cache 102 756 448 36 4 : tunables 0 0 0 : slabdata 21 21 0 -files_cache 102 588 1152 28 8 : tunables 0 0 0 : slabdata 21 21 0 -signal_cache 266 672 1536 21 8 : tunables 0 0 0 : slabdata 32 32 0 -sighand_cache 266 507 2496 13 8 : tunables 0 0 0 : slabdata 39 39 0 -task_struct 783 963 10240 3 8 : tunables 0 0 0 : slabdata 321 321 0 -cred_jar 364 952 576 28 4 : tunables 0 0 0 : slabdata 34 34 0 -anon_vma_chain 63907 67821 416 39 4 : tunables 0 0 0 : slabdata 1739 1739 0 -anon_vma 25891 28899 416 39 4 : tunables 0 0 0 : slabdata 741 741 0 -pid 408 992 512 32 4 : tunables 0 0 0 : slabdata 31 31 0 -Acpi-Operand 6682 6740 408 20 2 : tunables 0 0 0 : slabdata 337 337 0 -Acpi-ParseExt 0 39 416 39 4 : tunables 0 0 0 : slabdata 1 1 0 -Acpi-Parse 0 80 392 20 2 : tunables 0 0 0 : slabdata 4 4 0 -Acpi-State 0 78 416 39 4 : tunables 0 0 0 : slabdata 2 2 0 -Acpi-Namespace 3911 3948 384 21 2 : tunables 0 0 0 : slabdata 188 188 0 -trace_event_file 2638 2660 424 38 4 : tunables 0 0 0 : slabdata 70 70 0 -ftrace_event_field 6592 6594 384 21 2 : tunables 0 0 0 : slabdata 314 314 0 -pool_workqueue 41 64 1024 32 8 : tunables 0 0 0 : slabdata 2 2 0 -radix_tree_node 21638 24045 912 35 8 : tunables 0 0 0 : slabdata 687 687 0 -task_group 48 78 1216 26 8 : tunables 0 0 0 : slabdata 3 3 0 -vmap_area 4411 4680 400 20 2 : tunables 0 0 0 : slabdata 234 234 0 -dma-kmalloc-8k 0 0 24576 1 8 : tunables 0 0 0 : slabdata 0 0 0 -dma-kmalloc-4k 0 0 12288 2 8 : tunables 0 0 0 : slabdata 0 0 0 -dma-kmalloc-2k 0 0 6144 5 8 : tunables 0 0 0 : slabdata 0 0 0 -dma-kmalloc-1k 0 0 3072 10 8 : tunables 0 0 0 : slabdata 0 0 0 -dma-kmalloc-512 0 0 1536 21 8 : tunables 0 0 0 : slabdata 0 0 0 -dma-kmalloc-256 0 0 1024 32 8 : tunables 0 0 0 : slabdata 0 0 0 -dma-kmalloc-128 0 0 640 25 4 : tunables 0 0 0 : slabdata 0 0 0 -dma-kmalloc-64 0 0 512 32 4 : tunables 0 0 0 : slabdata 0 0 0 -dma-kmalloc-32 0 0 416 39 4 : tunables 0 0 0 : slabdata 0 0 0 -dma-kmalloc-16 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 -dma-kmalloc-8 0 0 344 23 2 : tunables 0 0 0 : slabdata 0 0 0 -dma-kmalloc-192 0 0 528 31 4 : tunables 0 0 0 : slabdata 0 0 0 -dma-kmalloc-96 0 0 432 37 4 : tunables 0 0 0 : slabdata 0 0 0 -kmalloc-rcl-8k 0 0 24576 1 8 : tunables 0 0 0 : slabdata 0 0 0 -kmalloc-rcl-4k 0 0 12288 2 8 : tunables 0 0 0 : slabdata 0 0 0 -kmalloc-rcl-2k 0 0 6144 5 8 : tunables 0 0 0 : slabdata 0 0 0 -kmalloc-rcl-1k 0 0 3072 10 8 : tunables 0 0 0 : slabdata 0 0 0 -kmalloc-rcl-512 0 0 1536 21 8 : tunables 0 0 0 : slabdata 0 0 0 -kmalloc-rcl-256 0 0 1024 32 8 : tunables 0 0 0 : slabdata 0 0 0 -kmalloc-rcl-192 0 0 528 31 4 : tunables 0 0 0 : slabdata 0 0 0 -kmalloc-rcl-128 31 75 640 25 4 : tunables 0 0 0 : slabdata 3 3 0 -kmalloc-rcl-96 3371 3626 432 37 4 : tunables 0 0 0 : slabdata 98 98 0 -kmalloc-rcl-64 2080 2272 512 32 4 : tunables 0 0 0 : slabdata 71 71 0 -kmalloc-rcl-32 0 0 416 39 4 : tunables 0 0 0 : slabdata 0 0 0 -kmalloc-rcl-16 0 0 368 22 2 : tunables 0 0 0 : slabdata 0 0 0 -kmalloc-rcl-8 0 0 344 23 2 : tunables 0 0 0 : slabdata 0 0 0 -kmalloc-8k 133 140 24576 1 8 : tunables 0 0 0 : slabdata 140 140 0 -kmalloc-4k 403 444 12288 2 8 : tunables 0 0 0 : slabdata 222 222 0 -kmalloc-2k 2391 2585 6144 5 8 : tunables 0 0 0 : slabdata 517 517 0 -kmalloc-1k 2163 2420 3072 10 8 : tunables 0 0 0 : slabdata 242 242 0 -kmalloc-512 2972 3633 1536 21 8 : tunables 0 0 0 : slabdata 173 173 0 -kmalloc-256 1841 1856 1024 32 8 : tunables 0 0 0 : slabdata 58 58 0 -kmalloc-192 2165 2914 528 31 4 : tunables 0 0 0 : slabdata 94 94 0 -kmalloc-128 1137 1175 640 25 4 : tunables 0 0 0 : slabdata 47 47 0 -kmalloc-96 1925 2590 432 37 4 : tunables 0 0 0 : slabdata 70 70 0 -kmalloc-64 9433 10688 512 32 4 : tunables 0 0 0 : slabdata 334 334 0 -kmalloc-32 9098 10062 416 39 4 : tunables 0 0 0 : slabdata 258 258 0 -kmalloc-16 10914 10956 368 22 2 : tunables 0 0 0 : slabdata 498 498 0 -kmalloc-8 7576 7705 344 23 2 : tunables 0 0 0 : slabdata 335 335 0 -kmem_cache_node 904 928 512 32 4 : tunables 0 0 0 : slabdata 29 29 0 -kmem_cache 904 936 832 39 8 : tunables 0 0 0 : slabdata 24 24 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/stat -Lines: 16 -cpu 301854 612 111922 8979004 3552 2 3944 0 0 0 -cpu0 44490 19 21045 1087069 220 1 3410 0 0 0 -cpu1 47869 23 16474 1110787 591 0 46 0 0 0 -cpu2 46504 36 15916 1112321 441 0 326 0 0 0 -cpu3 47054 102 15683 1113230 533 0 60 0 0 0 -cpu4 28413 25 10776 1140321 217 0 8 0 0 0 -cpu5 29271 101 11586 1136270 672 0 30 0 0 0 -cpu6 29152 36 10276 1139721 319 0 29 0 0 0 -cpu7 29098 268 10164 1139282 555 0 31 0 0 0 -intr 8885917 17 0 0 0 0 0 0 0 1 79281 0 0 0 0 0 0 0 231237 0 0 0 0 250586 103 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 223424 190745 13 906 1283803 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -ctxt 38014093 -btime 1418183276 -processes 26442 -procs_running 2 -procs_blocked 1 -softirq 5057579 250191 1481983 1647 211099 186066 0 1783454 622196 12499 508444 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/swaps -Lines: 2 -Filename Type Size Used Priority -/dev/dm-2 partition 131068 176 -2 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/symlinktargets -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/symlinktargets/README -Lines: 2 -This directory contains some empty files that are the symlinks the files in the "fd" directory point to. -They are otherwise ignored by the tests -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/symlinktargets/abc -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/symlinktargets/def -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/symlinktargets/ghi -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/symlinktargets/uvw -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/symlinktargets/xyz -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/sys -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/sys/kernel -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/sys/kernel/random -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/kernel/random/entropy_avail -Lines: 1 -3943 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/kernel/random/poolsize -Lines: 1 -4096 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/kernel/random/urandom_min_reseed_secs -Lines: 1 -60 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/kernel/random/write_wakeup_threshold -Lines: 1 -3072 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/proc/sys/vm -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/admin_reserve_kbytes -Lines: 1 -8192 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/block_dump -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/compact_unevictable_allowed -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/dirty_background_bytes -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/dirty_background_ratio -Lines: 1 -10 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/dirty_bytes -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/dirty_expire_centisecs -Lines: 1 -3000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/dirty_ratio -Lines: 1 -20 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/dirty_writeback_centisecs -Lines: 1 -500 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/dirtytime_expire_seconds -Lines: 1 -43200 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/drop_caches -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/extfrag_threshold -Lines: 1 -500 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/hugetlb_shm_group -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/laptop_mode -Lines: 1 -5 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/legacy_va_layout -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/lowmem_reserve_ratio -Lines: 1 -256 256 32 0 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/max_map_count -Lines: 1 -65530 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/memory_failure_early_kill -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/memory_failure_recovery -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/min_free_kbytes -Lines: 1 -67584 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/min_slab_ratio -Lines: 1 -5 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/min_unmapped_ratio -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/mmap_min_addr -Lines: 1 -65536 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/nr_hugepages -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/nr_hugepages_mempolicy -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/nr_overcommit_hugepages -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/numa_stat -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/numa_zonelist_order -Lines: 1 -Node -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/oom_dump_tasks -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/oom_kill_allocating_task -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/overcommit_kbytes -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/overcommit_memory -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/overcommit_ratio -Lines: 1 -50 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/page-cluster -Lines: 1 -3 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/panic_on_oom -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/percpu_pagelist_fraction -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/stat_interval -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/swappiness -Lines: 1 -60 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/user_reserve_kbytes -Lines: 1 -131072 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/vfs_cache_pressure -Lines: 1 -100 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/watermark_boost_factor -Lines: 1 -15000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/watermark_scale_factor -Lines: 1 -10 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/sys/vm/zone_reclaim_mode -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/zoneinfo -Lines: 262 -Node 0, zone DMA - per-node stats - nr_inactive_anon 230981 - nr_active_anon 547580 - nr_inactive_file 316904 - nr_active_file 346282 - nr_unevictable 115467 - nr_slab_reclaimable 131220 - nr_slab_unreclaimable 47320 - nr_isolated_anon 0 - nr_isolated_file 0 - workingset_nodes 11627 - workingset_refault 466886 - workingset_activate 276925 - workingset_restore 84055 - workingset_nodereclaim 487 - nr_anon_pages 795576 - nr_mapped 215483 - nr_file_pages 761874 - nr_dirty 908 - nr_writeback 0 - nr_writeback_temp 0 - nr_shmem 224925 - nr_shmem_hugepages 0 - nr_shmem_pmdmapped 0 - nr_anon_transparent_hugepages 0 - nr_unstable 0 - nr_vmscan_write 12950 - nr_vmscan_immediate_reclaim 3033 - nr_dirtied 8007423 - nr_written 7752121 - nr_kernel_misc_reclaimable 0 - pages free 3952 - min 33 - low 41 - high 49 - spanned 4095 - present 3975 - managed 3956 - protection: (0, 2877, 7826, 7826, 7826) - nr_free_pages 3952 - nr_zone_inactive_anon 0 - nr_zone_active_anon 0 - nr_zone_inactive_file 0 - nr_zone_active_file 0 - nr_zone_unevictable 0 - nr_zone_write_pending 0 - nr_mlock 0 - nr_page_table_pages 0 - nr_kernel_stack 0 - nr_bounce 0 - nr_zspages 0 - nr_free_cma 0 - numa_hit 1 - numa_miss 0 - numa_foreign 0 - numa_interleave 0 - numa_local 1 - numa_other 0 - pagesets - cpu: 0 - count: 0 - high: 0 - batch: 1 - vm stats threshold: 8 - cpu: 1 - count: 0 - high: 0 - batch: 1 - vm stats threshold: 8 - cpu: 2 - count: 0 - high: 0 - batch: 1 - vm stats threshold: 8 - cpu: 3 - count: 0 - high: 0 - batch: 1 - vm stats threshold: 8 - cpu: 4 - count: 0 - high: 0 - batch: 1 - vm stats threshold: 8 - cpu: 5 - count: 0 - high: 0 - batch: 1 - vm stats threshold: 8 - cpu: 6 - count: 0 - high: 0 - batch: 1 - vm stats threshold: 8 - cpu: 7 - count: 0 - high: 0 - batch: 1 - vm stats threshold: 8 - node_unreclaimable: 0 - start_pfn: 1 -Node 0, zone DMA32 - pages free 204252 - min 19510 - low 21059 - high 22608 - spanned 1044480 - present 759231 - managed 742806 - protection: (0, 0, 4949, 4949, 4949) - nr_free_pages 204252 - nr_zone_inactive_anon 118558 - nr_zone_active_anon 106598 - nr_zone_inactive_file 75475 - nr_zone_active_file 70293 - nr_zone_unevictable 66195 - nr_zone_write_pending 64 - nr_mlock 4 - nr_page_table_pages 1756 - nr_kernel_stack 2208 - nr_bounce 0 - nr_zspages 0 - nr_free_cma 0 - numa_hit 113952967 - numa_miss 0 - numa_foreign 0 - numa_interleave 0 - numa_local 113952967 - numa_other 0 - pagesets - cpu: 0 - count: 345 - high: 378 - batch: 63 - vm stats threshold: 48 - cpu: 1 - count: 356 - high: 378 - batch: 63 - vm stats threshold: 48 - cpu: 2 - count: 325 - high: 378 - batch: 63 - vm stats threshold: 48 - cpu: 3 - count: 346 - high: 378 - batch: 63 - vm stats threshold: 48 - cpu: 4 - count: 321 - high: 378 - batch: 63 - vm stats threshold: 48 - cpu: 5 - count: 316 - high: 378 - batch: 63 - vm stats threshold: 48 - cpu: 6 - count: 373 - high: 378 - batch: 63 - vm stats threshold: 48 - cpu: 7 - count: 339 - high: 378 - batch: 63 - vm stats threshold: 48 - node_unreclaimable: 0 - start_pfn: 4096 -Node 0, zone Normal - pages free 18553 - min 11176 - low 13842 - high 16508 - spanned 1308160 - present 1308160 - managed 1268711 - protection: (0, 0, 0, 0, 0) - nr_free_pages 18553 - nr_zone_inactive_anon 112423 - nr_zone_active_anon 440982 - nr_zone_inactive_file 241429 - nr_zone_active_file 275989 - nr_zone_unevictable 49272 - nr_zone_write_pending 844 - nr_mlock 154 - nr_page_table_pages 9750 - nr_kernel_stack 15136 - nr_bounce 0 - nr_zspages 0 - nr_free_cma 0 - numa_hit 162718019 - numa_miss 0 - numa_foreign 0 - numa_interleave 26812 - numa_local 162718019 - numa_other 0 - pagesets - cpu: 0 - count: 316 - high: 378 - batch: 63 - vm stats threshold: 56 - cpu: 1 - count: 366 - high: 378 - batch: 63 - vm stats threshold: 56 - cpu: 2 - count: 60 - high: 378 - batch: 63 - vm stats threshold: 56 - cpu: 3 - count: 256 - high: 378 - batch: 63 - vm stats threshold: 56 - cpu: 4 - count: 253 - high: 378 - batch: 63 - vm stats threshold: 56 - cpu: 5 - count: 159 - high: 378 - batch: 63 - vm stats threshold: 56 - cpu: 6 - count: 311 - high: 378 - batch: 63 - vm stats threshold: 56 - cpu: 7 - count: 264 - high: 378 - batch: 63 - vm stats threshold: 56 - node_unreclaimable: 0 - start_pfn: 1048576 -Node 0, zone Movable - pages free 0 - min 0 - low 0 - high 0 - spanned 0 - present 0 - managed 0 - protection: (0, 0, 0, 0, 0) -Node 0, zone Device - pages free 0 - min 0 - low 0 - high 0 - spanned 0 - present 0 - managed 0 - protection: (0, 0, 0, 0, 0) -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/block -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/block/dm-0 -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/dm-0/stat -Lines: 1 -6447303 0 710266738 1529043 953216 0 31201176 4557464 0 796160 6088971 -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/block/sda -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/block/sda/queue -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/add_random -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/chunk_sectors -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/dax -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/discard_granularity -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/discard_max_bytes -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/discard_max_hw_bytes -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/discard_zeroes_data -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/fua -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/hw_sector_size -Lines: 1 -512 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/io_poll -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/io_poll_delay -Lines: 1 --1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/io_timeout -Lines: 1 -30000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/block/sda/queue/iosched -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/iosched/back_seek_max -Lines: 1 -16384 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/iosched/back_seek_penalty -Lines: 1 -2 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/iosched/fifo_expire_async -Lines: 1 -250 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/iosched/fifo_expire_sync -Lines: 1 -125 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/iosched/low_latency -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/iosched/max_budget -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/iosched/slice_idle -Lines: 1 -8 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/iosched/slice_idle_us -Lines: 1 -8000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/iosched/strict_guarantees -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/iosched/timeout_sync -Lines: 1 -125 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/iostats -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/logical_block_size -Lines: 1 -512 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/max_discard_segments -Lines: 1 -1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/max_hw_sectors_kb -Lines: 1 -32767 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/max_integrity_segments -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/max_sectors_kb -Lines: 1 -1280 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/max_segment_size -Lines: 1 -65536 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/max_segments -Lines: 1 -168 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/minimum_io_size -Lines: 1 -512 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/nomerges -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/nr_requests -Lines: 1 -64 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/nr_zones -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/optimal_io_size -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/physical_block_size -Lines: 1 -512 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/read_ahead_kb -Lines: 1 -128 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/rotational -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/rq_affinity -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/scheduler -Lines: 1 -mq-deadline kyber [bfq] none -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/wbt_lat_usec -Lines: 1 -75000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/write_cache -Lines: 1 -write back -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/write_same_max_bytes -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/write_zeroes_max_bytes -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/queue/zoned -Lines: 1 -none -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/block/sda/stat -Lines: 1 -9652963 396792 759304206 412943 8422549 6731723 286915323 13947418 0 5658367 19174573 1 2 3 12 -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/fc_host -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/fc_host/host0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/dev_loss_tmo -Lines: 1 -30 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/fabric_name -Lines: 1 -0x0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/node_name -Lines: 1 -0x2000e0071bce95f2 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/port_id -Lines: 1 -0x000002 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/port_name -Lines: 1 -0x1000e0071bce95f2 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/port_state -Lines: 1 -Online -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/port_type -Lines: 1 -Point-To-Point (direct nport connection) -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/speed -Lines: 1 -16 Gbit -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/fc_host/host0/statistics -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/statistics/dumped_frames -Lines: 1 -0xffffffffffffffff -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/statistics/error_frames -Lines: 1 -0x0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/statistics/fcp_packet_aborts -Lines: 1 -0x13 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/statistics/invalid_crc_count -Lines: 1 -0x2 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/statistics/invalid_tx_word_count -Lines: 1 -0x8 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/statistics/link_failure_count -Lines: 1 -0x9 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/statistics/loss_of_signal_count -Lines: 1 -0x11 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/statistics/loss_of_sync_count -Lines: 1 -0x10 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/statistics/nos_count -Lines: 1 -0x12 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/statistics/rx_frames -Lines: 1 -0x3 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/statistics/rx_words -Lines: 1 -0x4 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/statistics/seconds_since_last_reset -Lines: 1 -0x7 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/statistics/tx_frames -Lines: 1 -0x5 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/statistics/tx_words -Lines: 1 -0x6 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/supported_classes -Lines: 1 -Class 3 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/supported_speeds -Lines: 1 -4 Gbit, 8 Gbit, 16 Gbit -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/fc_host/host0/symbolic_name -Lines: 1 -Emulex SN1100E2P FV12.4.270.3 DV12.4.0.0. HN:gotest. OS:Linux -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/infiniband -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/infiniband/mlx4_0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/board_id -Lines: 1 -SM_1141000001000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/fw_ver -Lines: 1 -2.31.5050 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/hca_type -Lines: 1 -MT4099 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/infiniband/mlx4_0/ports -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/infiniband/mlx4_0/ports/1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/VL15_dropped -Lines: 1 -0 -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/excessive_buffer_overrun_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/link_downed -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/link_error_recovery -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/local_link_integrity_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/port_rcv_constraint_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/port_rcv_data -Lines: 1 -2221223609 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/port_rcv_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/port_rcv_packets -Lines: 1 -87169372 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/port_rcv_remote_physical_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/port_rcv_switch_relay_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/port_xmit_constraint_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/port_xmit_data -Lines: 1 -26509113295 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/port_xmit_discards -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/port_xmit_packets -Lines: 1 -85734114 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/port_xmit_wait -Lines: 1 -3599 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/counters/symbol_error -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/phys_state -Lines: 1 -5: LinkUp -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/rate -Lines: 1 -40 Gb/sec (4X QDR) -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/1/state -Lines: 1 -4: ACTIVE -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/infiniband/mlx4_0/ports/2 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/VL15_dropped -Lines: 1 -0 -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/excessive_buffer_overrun_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/link_downed -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/link_error_recovery -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/local_link_integrity_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/port_rcv_constraint_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/port_rcv_data -Lines: 1 -2460436784 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/port_rcv_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/port_rcv_packets -Lines: 1 -89332064 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/port_rcv_remote_physical_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/port_rcv_switch_relay_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/port_xmit_constraint_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/port_xmit_data -Lines: 1 -26540356890 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/port_xmit_discards -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/port_xmit_packets -Lines: 1 -88622850 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/port_xmit_wait -Lines: 1 -3846 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/counters/symbol_error -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/phys_state -Lines: 1 -5: LinkUp -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/rate -Lines: 1 -40 Gb/sec (4X QDR) -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/infiniband/mlx4_0/ports/2/state -Lines: 1 -4: ACTIVE -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/net -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/net/eth0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/addr_assign_type -Lines: 1 -3 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/addr_len -Lines: 1 -6 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/address -Lines: 1 -01:01:01:01:01:01 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/broadcast -Lines: 1 -ff:ff:ff:ff:ff:ff -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/carrier -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/carrier_changes -Lines: 1 -2 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/carrier_down_count -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/carrier_up_count -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/dev_id -Lines: 1 -0x20 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/device -SymlinkTo: ../../../devices/pci0000:00/0000:00:1f.6/ -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/dormant -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/duplex -Lines: 1 -full -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/flags -Lines: 1 -0x1303 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/ifalias -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/ifindex -Lines: 1 -2 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/iflink -Lines: 1 -2 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/link_mode -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/mtu -Lines: 1 -1500 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/name_assign_type -Lines: 1 -2 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/netdev_group -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/operstate -Lines: 1 -up -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/phys_port_id -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/phys_port_name -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/phys_switch_id -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/speed -Lines: 1 -1000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/tx_queue_len -Lines: 1 -1000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/net/eth0/type -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/power_supply -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/power_supply/AC -SymlinkTo: ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/power_supply/BAT0 -SymlinkTo: ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/powercap -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/powercap/intel-rapl -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl/enabled -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl/uevent -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/powercap/intel-rapl:0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_0_max_power_uw -Lines: 1 -95000000 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_0_name -Lines: 1 -long_term -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_0_power_limit_uw -Lines: 1 -4090000000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_0_time_window_us -Lines: 1 -999424 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_1_max_power_uw -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_1_name -Lines: 1 -short_term -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_1_power_limit_uw -Lines: 1 -4090000000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_1_time_window_us -Lines: 1 -2440 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0/enabled -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0/energy_uj -Lines: 1 -240422366267 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0/max_energy_range_uj -Lines: 1 -262143328850 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0/name -Lines: 1 -package-0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0/uevent -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/powercap/intel-rapl:0:0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0:0/constraint_0_max_power_uw -Lines: 0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0:0/constraint_0_name -Lines: 1 -long_term -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0:0/constraint_0_power_limit_uw -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0:0/constraint_0_time_window_us -Lines: 1 -976 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0:0/enabled -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0:0/energy_uj -Lines: 1 -118821284256 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0:0/max_energy_range_uj -Lines: 1 -262143328850 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0:0/name -Lines: 1 -core -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:0:0/uevent -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/powercap/intel-rapl:a -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:a/constraint_0_max_power_uw -Lines: 1 -95000000 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:a/constraint_0_name -Lines: 1 -long_term -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:a/constraint_0_power_limit_uw -Lines: 1 -4090000000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:a/constraint_0_time_window_us -Lines: 1 -999424 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:a/constraint_1_max_power_uw -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:a/constraint_1_name -Lines: 1 -short_term -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:a/constraint_1_power_limit_uw -Lines: 1 -4090000000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:a/constraint_1_time_window_us -Lines: 1 -2440 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:a/enabled -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:a/energy_uj -Lines: 1 -240422366267 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:a/max_energy_range_uj -Lines: 1 -262143328850 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:a/name -Lines: 1 -package-10 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/powercap/intel-rapl:a/uevent -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/thermal -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/thermal/cooling_device0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/thermal/cooling_device0/cur_state -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/thermal/cooling_device0/max_state -Lines: 1 -50 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/thermal/cooling_device0/type -Lines: 1 -Processor -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/thermal/cooling_device1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/thermal/cooling_device1/cur_state -Lines: 1 --1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/thermal/cooling_device1/max_state -Lines: 1 -27 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/thermal/cooling_device1/type -Lines: 1 -intel_powerclamp -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/thermal/thermal_zone0 -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/thermal/thermal_zone0/policy -Lines: 1 -step_wise -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/thermal/thermal_zone0/temp -Lines: 1 -49925 -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/thermal/thermal_zone0/type -Lines: 1 -bcm2835_thermal -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/class/thermal/thermal_zone1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/thermal/thermal_zone1/mode -Lines: 1 -enabled -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/thermal/thermal_zone1/passive -Lines: 1 -0 -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/thermal/thermal_zone1/policy -Lines: 1 -step_wise -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/thermal/thermal_zone1/temp -Lines: 1 --44000 -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/class/thermal/thermal_zone1/type -Lines: 1 -acpitz -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/LNXSYSTM:00 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/device -SymlinkTo: ../../../ACPI0003:00 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/online -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/async -Lines: 1 -disabled -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/autosuspend_delay_ms -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/control -Lines: 1 -auto -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_active_kids -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_active_time -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_enabled -Lines: 1 -disabled -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_status -Lines: 1 -unsupported -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_suspended_time -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_usage -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup -Lines: 1 -enabled -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_abort_count -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_active -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_active_count -Lines: 1 -1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_count -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_expire_count -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_last_time_ms -Lines: 1 -10598 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_max_time_ms -Lines: 1 -1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_prevent_sleep_time_ms -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_total_time_ms -Lines: 1 -1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/subsystem -SymlinkTo: ../../../../../../../../../class/power_supply -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/type -Lines: 1 -Mains -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/uevent -Lines: 2 -POWER_SUPPLY_NAME=AC -POWER_SUPPLY_ONLINE=0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/alarm -Lines: 1 -2369000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/capacity -Lines: 1 -98 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/capacity_level -Lines: 1 -Normal -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/charge_start_threshold -Lines: 1 -95 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/charge_stop_threshold -Lines: 1 -100 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/cycle_count -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/device -SymlinkTo: ../../../PNP0C0A:00 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/energy_full -Lines: 1 -50060000 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/energy_full_design -Lines: 1 -47520000 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/energy_now -Lines: 1 -49450000 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/manufacturer -Lines: 1 -LGC -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/model_name -Lines: 1 -LNV-45N1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/async -Lines: 1 -disabled -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/autosuspend_delay_ms -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/control -Lines: 1 -auto -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_active_kids -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_active_time -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_enabled -Lines: 1 -disabled -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_status -Lines: 1 -unsupported -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_suspended_time -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_usage -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power_now -Lines: 1 -4830000 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/present -Lines: 1 -1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/serial_number -Lines: 1 -38109 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/status -Lines: 1 -Discharging -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/subsystem -SymlinkTo: ../../../../../../../../../class/power_supply -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/technology -Lines: 1 -Li-ion -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/type -Lines: 1 -Battery -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/uevent -Lines: 16 -POWER_SUPPLY_NAME=BAT0 -POWER_SUPPLY_STATUS=Discharging -POWER_SUPPLY_PRESENT=1 -POWER_SUPPLY_TECHNOLOGY=Li-ion -POWER_SUPPLY_CYCLE_COUNT=0 -POWER_SUPPLY_VOLTAGE_MIN_DESIGN=10800000 -POWER_SUPPLY_VOLTAGE_NOW=11750000 -POWER_SUPPLY_POWER_NOW=5064000 -POWER_SUPPLY_ENERGY_FULL_DESIGN=47520000 -POWER_SUPPLY_ENERGY_FULL=47390000 -POWER_SUPPLY_ENERGY_NOW=40730000 -POWER_SUPPLY_CAPACITY=85 -POWER_SUPPLY_CAPACITY_LEVEL=Normal -POWER_SUPPLY_MODEL_NAME=LNV-45N1 -POWER_SUPPLY_MANUFACTURER=LGC -POWER_SUPPLY_SERIAL_NUMBER=38109 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/voltage_min_design -Lines: 1 -10800000 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/voltage_now -Lines: 1 -12229000 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/dirty_data -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/bypassed -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_bypass_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_bypass_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_hit_ratio -Lines: 1 -100 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_hits -Lines: 1 -289 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_miss_collisions -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/bypassed -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_bypass_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_bypass_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_hit_ratio -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_miss_collisions -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/bypassed -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_bypass_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_bypass_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_hit_ratio -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_miss_collisions -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/bypassed -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_bypass_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_bypass_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_hit_ratio -Lines: 1 -100 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_hits -Lines: 1 -546 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_miss_collisions -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata5 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata5/host4 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0/block -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0/block/sdc -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0/block/sdc/bcache -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0/block/sdc/bcache/io_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0/block/sdc/bcache/metadata_written -Lines: 1 -512 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0/block/sdc/bcache/priority_stats -Lines: 5 -Unused: 99% -Metadata: 0% -Average: 10473 -Sectors per Q: 64 -Quantiles: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946] -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata5/host4/target4:0:0/4:0:0:0/block/sdc/bcache/written -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/pci0000:00/0000:00:1f.6 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/ari_enabled -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/broken_parity_status -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/class -Lines: 1 -0x020000 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/consistent_dma_mask_bits -Lines: 1 -64 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/d3cold_allowed -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/device -Lines: 1 -0x15d7 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/dma_mask_bits -Lines: 1 -64 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/driver_override -Lines: 1 -(null) -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/enable -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/irq -Lines: 1 -140 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/local_cpulist -Lines: 1 -0-7 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/local_cpus -Lines: 1 -ff -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/modalias -Lines: 1 -pci:v00008086d000015D7sv000017AAsd0000225Abc02sc00i00 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/msi_bus -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/numa_node -Lines: 1 --1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/resource -Lines: 13 -0x00000000ec200000 0x00000000ec21ffff 0x0000000000040200 -0x0000000000000000 0x0000000000000000 0x0000000000000000 -0x0000000000000000 0x0000000000000000 0x0000000000000000 -0x0000000000000000 0x0000000000000000 0x0000000000000000 -0x0000000000000000 0x0000000000000000 0x0000000000000000 -0x0000000000000000 0x0000000000000000 0x0000000000000000 -0x0000000000000000 0x0000000000000000 0x0000000000000000 -0x0000000000000000 0x0000000000000000 0x0000000000000000 -0x0000000000000000 0x0000000000000000 0x0000000000000000 -0x0000000000000000 0x0000000000000000 0x0000000000000000 -0x0000000000000000 0x0000000000000000 0x0000000000000000 -0x0000000000000000 0x0000000000000000 0x0000000000000000 -0x0000000000000000 0x0000000000000000 0x0000000000000000 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/revision -Lines: 1 -0x21 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/subsystem_device -Lines: 1 -0x225a -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/subsystem_vendor -Lines: 1 -0x17aa -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/uevent -Lines: 6 -DRIVER=e1000e -PCI_CLASS=20000 -PCI_ID=8086:15D7 -PCI_SUBSYS_ID=17AA:225A -PCI_SLOT_NAME=0000:00:1f.6 -MODALIAS=pci:v00008086d000015D7sv000017AAsd0000225Abc02sc00i00 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/vendor -Lines: 1 -0x8086 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/rbd -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/rbd/0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/rbd/0/name -Lines: 1 -demo -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/rbd/0/pool -Lines: 1 -iscsi-images -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/rbd/1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/rbd/1/name -Lines: 1 -wrong -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/rbd/1/pool -Lines: 1 -wrong-images -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/node -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/node/node1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/node/node1/vmstat -Lines: 6 -nr_free_pages 1 -nr_zone_inactive_anon 2 -nr_zone_active_anon 3 -nr_zone_inactive_file 4 -nr_zone_active_file 5 -nr_zone_unevictable 6 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/node/node2 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/node/node2/vmstat -Lines: 6 -nr_free_pages 7 -nr_zone_inactive_anon 8 -nr_zone_active_anon 9 -nr_zone_inactive_file 10 -nr_zone_active_file 11 -nr_zone_unevictable 12 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/clocksource -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/clocksource/clocksource0 -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/clocksource/clocksource0/available_clocksource -Lines: 1 -tsc hpet acpi_pm -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/clocksource/clocksource0/current_clocksource -Lines: 1 -tsc -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/cpu -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/cpu/cpu0 -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu0/cpufreq -SymlinkTo: ../cpufreq/policy0 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/cpu/cpu0/thermal_throttle -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu0/thermal_throttle/core_throttle_count -Lines: 1 -10084 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu0/thermal_throttle/package_throttle_count -Lines: 1 -34818 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/cpu/cpu0/topology -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu0/topology/core_id -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu0/topology/core_siblings -Lines: 1 -ff -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu0/topology/core_siblings_list -Lines: 1 -0-7 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu0/topology/physical_package_id -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu0/topology/thread_siblings -Lines: 1 -11 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu0/topology/thread_siblings_list -Lines: 1 -0,4 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/cpu/cpu1 -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/cpu/cpu1/cpufreq -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_cur_freq -Lines: 1 -1200195 -Mode: 400 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq -Lines: 1 -3300000 -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_min_freq -Lines: 1 -1200000 -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_transition_latency -Lines: 1 -4294967295 -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/cpufreq/related_cpus -Lines: 1 -1 -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_governors -Lines: 1 -performance powersave -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver -Lines: 1 -intel_pstate -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor -Lines: 1 -powersave -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq -Lines: 1 -3300000 -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq -Lines: 1 -1200000 -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/cpufreq/scaling_setspeed -Lines: 1 - -Mode: 664 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/cpu/cpu1/thermal_throttle -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/thermal_throttle/core_throttle_count -Lines: 1 -523 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/thermal_throttle/package_throttle_count -Lines: 1 -34818 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/cpu/cpu1/topology -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/topology/core_id -Lines: 1 -1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/topology/core_siblings -Lines: 1 -ff -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/topology/core_siblings_list -Lines: 1 -0-7 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/topology/physical_package_id -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/topology/thread_siblings -Lines: 1 -22 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpu1/topology/thread_siblings_list -Lines: 1 -1,5 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/cpu/cpufreq -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/cpu/cpufreq/policy0 -Mode: 775 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpufreq/policy0/affected_cpus -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_max_freq -Lines: 1 -2400000 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_min_freq -Lines: 1 -800000 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_transition_latency -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpufreq/policy0/related_cpus -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors -Lines: 1 -performance powersave -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq -Lines: 1 -1219917 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpufreq/policy0/scaling_driver -Lines: 1 -intel_pstate -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpufreq/policy0/scaling_governor -Lines: 1 -powersave -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq -Lines: 1 -2400000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq -Lines: 1 -800000 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/system/cpu/cpufreq/policy0/scaling_setspeed -Lines: 1 - -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/devices/system/cpu/cpufreq/policy1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/bcache -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/average_key_size -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0 -Mode: 777 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/dirty_data -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_day -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_day/bypassed -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_day/cache_bypass_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_day/cache_bypass_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_day/cache_hit_ratio -Lines: 1 -100 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_day/cache_hits -Lines: 1 -289 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_day/cache_miss_collisions -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_day/cache_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_day/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_five_minute -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_five_minute/bypassed -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_five_minute/cache_bypass_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_five_minute/cache_bypass_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_five_minute/cache_hit_ratio -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_five_minute/cache_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_five_minute/cache_miss_collisions -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_five_minute/cache_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_five_minute/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_hour -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_hour/bypassed -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_hour/cache_bypass_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_hour/cache_bypass_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_hour/cache_hit_ratio -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_hour/cache_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_hour/cache_miss_collisions -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_hour/cache_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_hour/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_total -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_total/bypassed -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_total/cache_bypass_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_total/cache_bypass_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_total/cache_hit_ratio -Lines: 1 -100 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_total/cache_hits -Lines: 1 -546 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_total/cache_miss_collisions -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_total/cache_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_total/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/writeback_rate_debug -Lines: 7 -rate: 1.1M/sec -dirty: 20.4G -target: 20.4G -proportional: 427.5k -integral: 790.0k -change: 321.5k/sec -next io: 17ms -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/btree_cache_size -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/cache0 -Mode: 777 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/cache0/io_errors -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/cache0/metadata_written -Lines: 1 -512 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/cache0/priority_stats -Lines: 5 -Unused: 99% -Metadata: 0% -Average: 10473 -Sectors per Q: 64 -Quantiles: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946 20946] -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/cache0/written -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/cache_available_percent -Lines: 1 -100 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/congested -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/internal -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/internal/active_journal_entries -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/internal/btree_nodes -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/internal/btree_read_average_duration_us -Lines: 1 -1305 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/internal/cache_read_races -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/root_usage_percent -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/bypassed -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_bypass_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_bypass_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_hit_ratio -Lines: 1 -100 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_hits -Lines: 1 -289 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_miss_collisions -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/bypassed -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_bypass_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_bypass_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_hit_ratio -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_miss_collisions -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/bypassed -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_bypass_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_bypass_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_hit_ratio -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_miss_collisions -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/bypassed -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_bypass_hits -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_bypass_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_hit_ratio -Lines: 1 -100 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_hits -Lines: 1 -546 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_miss_collisions -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_misses -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/tree_depth -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/bytes_may_use -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/bytes_pinned -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/bytes_readonly -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/bytes_reserved -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/bytes_used -Lines: 1 -808189952 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/disk_total -Lines: 1 -2147483648 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/disk_used -Lines: 1 -808189952 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/flags -Lines: 1 -1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/raid0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/raid0/total_bytes -Lines: 1 -2147483648 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/raid0/used_bytes -Lines: 1 -808189952 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/total_bytes -Lines: 1 -2147483648 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/total_bytes_pinned -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/global_rsv_reserved -Lines: 1 -16777216 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/global_rsv_size -Lines: 1 -16777216 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/bytes_may_use -Lines: 1 -16777216 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/bytes_pinned -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/bytes_readonly -Lines: 1 -131072 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/bytes_reserved -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/bytes_used -Lines: 1 -933888 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/disk_total -Lines: 1 -2147483648 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/disk_used -Lines: 1 -1867776 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/flags -Lines: 1 -4 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/raid1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/raid1/total_bytes -Lines: 1 -1073741824 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/raid1/used_bytes -Lines: 1 -933888 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/total_bytes -Lines: 1 -1073741824 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/total_bytes_pinned -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/bytes_may_use -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/bytes_pinned -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/bytes_readonly -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/bytes_reserved -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/bytes_used -Lines: 1 -16384 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/disk_total -Lines: 1 -16777216 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/disk_used -Lines: 1 -32768 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/flags -Lines: 1 -2 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/raid1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/raid1/total_bytes -Lines: 1 -8388608 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/raid1/used_bytes -Lines: 1 -16384 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/total_bytes -Lines: 1 -8388608 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/total_bytes_pinned -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/clone_alignment -Lines: 1 -4096 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/devices -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/devices/loop25 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/devices/loop25/size -Lines: 1 -20971520 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/devices/loop26 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/devices/loop26/size -Lines: 1 -20971520 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/features -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/features/big_metadata -Lines: 1 -1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/features/extended_iref -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/features/mixed_backref -Lines: 1 -1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/features/skinny_metadata -Lines: 1 -1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/label -Lines: 1 -fixture -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/metadata_uuid -Lines: 1 -0abb23a9-579b-43e6-ad30-227ef47fcb9d -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/nodesize -Lines: 1 -16384 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/quota_override -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/sectorsize -Lines: 1 -4096 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/bytes_may_use -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/bytes_pinned -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/bytes_readonly -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/bytes_reserved -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/bytes_used -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/disk_total -Lines: 1 -644087808 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/disk_used -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/flags -Lines: 1 -1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/raid5 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/raid5/total_bytes -Lines: 1 -644087808 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/raid5/used_bytes -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/total_bytes -Lines: 1 -644087808 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/total_bytes_pinned -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/global_rsv_reserved -Lines: 1 -16777216 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/global_rsv_size -Lines: 1 -16777216 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/bytes_may_use -Lines: 1 -16777216 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/bytes_pinned -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/bytes_readonly -Lines: 1 -262144 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/bytes_reserved -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/bytes_used -Lines: 1 -114688 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/disk_total -Lines: 1 -429391872 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/disk_used -Lines: 1 -114688 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/flags -Lines: 1 -4 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/raid6 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/raid6/total_bytes -Lines: 1 -429391872 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/raid6/used_bytes -Lines: 1 -114688 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/total_bytes -Lines: 1 -429391872 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/total_bytes_pinned -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/bytes_may_use -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/bytes_pinned -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/bytes_readonly -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/bytes_reserved -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/bytes_used -Lines: 1 -16384 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/disk_total -Lines: 1 -16777216 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/disk_used -Lines: 1 -16384 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/flags -Lines: 1 -2 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/raid6 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/raid6/total_bytes -Lines: 1 -16777216 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/raid6/used_bytes -Lines: 1 -16384 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/total_bytes -Lines: 1 -16777216 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/total_bytes_pinned -Lines: 1 -0 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/clone_alignment -Lines: 1 -4096 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/devices -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/devices/loop22 -SymlinkTo: ../../../../devices/virtual/block/loop22 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/devices/loop23 -SymlinkTo: ../../../../devices/virtual/block/loop23 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/devices/loop24 -SymlinkTo: ../../../../devices/virtual/block/loop24 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/devices/loop25 -SymlinkTo: ../../../../devices/virtual/block/loop25 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/features -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/features/big_metadata -Lines: 1 -1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/features/extended_iref -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/features/mixed_backref -Lines: 1 -1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/features/raid56 -Lines: 1 -1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/features/skinny_metadata -Lines: 1 -1 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/label -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/metadata_uuid -Lines: 1 -7f07c59f-6136-449c-ab87-e1cf2328731b -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/nodesize -Lines: 1 -16384 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/quota_override -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/sectorsize -Lines: 1 -4096 -Mode: 444 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/xfs -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/xfs/sda1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/xfs/sda1/stats -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/xfs/sda1/stats/stats -Lines: 1 -extent_alloc 1 0 0 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/xfs/sdb1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/fs/xfs/sdb1/stats -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/xfs/sdb1/stats/stats -Lines: 1 -extent_alloc 2 0 0 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/core -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/core/fileio_0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/core/fileio_1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/core/fileio_1/file_lio_1G -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/core/fileio_1/file_lio_1G/enable -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/core/fileio_1/file_lio_1G/udev_path -Lines: 1 -/home/iscsi/file_back_1G -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/core/iblock_0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/core/iblock_0/block_lio_rbd1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/core/iblock_0/block_lio_rbd1/enable -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/core/iblock_0/block_lio_rbd1/udev_path -Lines: 1 -/dev/rbd1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/core/rbd_0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/core/rbd_0/iscsi-images-demo -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/core/rbd_0/iscsi-images-demo/enable -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/core/rbd_0/iscsi-images-demo/udev_path -Lines: 1 -/dev/rbd/iscsi-images/demo -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/core/rd_mcp_119 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/core/rd_mcp_119/ramdisk_lio_1G -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/core/rd_mcp_119/ramdisk_lio_1G/enable -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/core/rd_mcp_119/ramdisk_lio_1G/udev_path -Lines: 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.8888bbbbddd0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.8888bbbbddd0/tpgt_1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.8888bbbbddd0/tpgt_1/enable -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.8888bbbbddd0/tpgt_1/lun -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.8888bbbbddd0/tpgt_1/lun/lun_0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.8888bbbbddd0/tpgt_1/lun/lun_0/7f4a4eb56d -SymlinkTo: ../../../../../../target/core/rd_mcp_119/ramdisk_lio_1G -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.8888bbbbddd0/tpgt_1/lun/lun_0/statistics -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.8888bbbbddd0/tpgt_1/lun/lun_0/statistics/scsi_tgt_port -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.8888bbbbddd0/tpgt_1/lun/lun_0/statistics/scsi_tgt_port/in_cmds -Lines: 1 -204950 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.8888bbbbddd0/tpgt_1/lun/lun_0/statistics/scsi_tgt_port/read_mbytes -Lines: 1 -10325 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.8888bbbbddd0/tpgt_1/lun/lun_0/statistics/scsi_tgt_port/write_mbytes -Lines: 1 -40325 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.abcd1abcd2ab -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.abcd1abcd2ab/tpgt_1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.abcd1abcd2ab/tpgt_1/enable -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.abcd1abcd2ab/tpgt_1/lun -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.abcd1abcd2ab/tpgt_1/lun/lun_0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.abcd1abcd2ab/tpgt_1/lun/lun_0/795b7c7026 -SymlinkTo: ../../../../../../target/core/iblock_0/block_lio_rbd1 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.abcd1abcd2ab/tpgt_1/lun/lun_0/statistics -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.abcd1abcd2ab/tpgt_1/lun/lun_0/statistics/scsi_tgt_port -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.abcd1abcd2ab/tpgt_1/lun/lun_0/statistics/scsi_tgt_port/in_cmds -Lines: 1 -104950 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.abcd1abcd2ab/tpgt_1/lun/lun_0/statistics/scsi_tgt_port/read_mbytes -Lines: 1 -20095 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.abcd1abcd2ab/tpgt_1/lun/lun_0/statistics/scsi_tgt_port/write_mbytes -Lines: 1 -71235 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:dev.rbd0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:dev.rbd0/tpgt_1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:dev.rbd0/tpgt_1/enable -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:dev.rbd0/tpgt_1/lun -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:dev.rbd0/tpgt_1/lun/lun_0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:dev.rbd0/tpgt_1/lun/lun_0/fff5e16686 -SymlinkTo: ../../../../../../target/core/fileio_1/file_lio_1G -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:dev.rbd0/tpgt_1/lun/lun_0/statistics -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:dev.rbd0/tpgt_1/lun/lun_0/statistics/scsi_tgt_port -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:dev.rbd0/tpgt_1/lun/lun_0/statistics/scsi_tgt_port/in_cmds -Lines: 1 -301950 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:dev.rbd0/tpgt_1/lun/lun_0/statistics/scsi_tgt_port/read_mbytes -Lines: 1 -10195 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:dev.rbd0/tpgt_1/lun/lun_0/statistics/scsi_tgt_port/write_mbytes -Lines: 1 -30195 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:sn.ramdemo -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:sn.ramdemo/tpgt_1 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:sn.ramdemo/tpgt_1/enable -Lines: 1 -1 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:sn.ramdemo/tpgt_1/lun -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:sn.ramdemo/tpgt_1/lun/lun_0 -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:sn.ramdemo/tpgt_1/lun/lun_0/eba1edf893 -SymlinkTo: ../../../../../../target/core/rbd_0/iscsi-images-demo -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:sn.ramdemo/tpgt_1/lun/lun_0/statistics -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Directory: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:sn.ramdemo/tpgt_1/lun/lun_0/statistics/scsi_tgt_port -Mode: 755 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:sn.ramdemo/tpgt_1/lun/lun_0/statistics/scsi_tgt_port/in_cmds -Lines: 1 -1234 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:sn.ramdemo/tpgt_1/lun/lun_0/statistics/scsi_tgt_port/read_mbytes -Lines: 1 -1504 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:sn.ramdemo/tpgt_1/lun/lun_0/statistics/scsi_tgt_port/write_mbytes -Lines: 1 -4733 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/github.com/prometheus/procfs/fs.go b/vendor/github.com/prometheus/procfs/fs.go index 0102ab0fd8..4980c875bf 100644 --- a/vendor/github.com/prometheus/procfs/fs.go +++ b/vendor/github.com/prometheus/procfs/fs.go @@ -20,7 +20,8 @@ import ( // FS represents the pseudo-filesystem sys, which provides an interface to // kernel data structures. type FS struct { - proc fs.FS + proc fs.FS + isReal bool } // DefaultMountPoint is the common mount point of the proc filesystem. @@ -39,5 +40,11 @@ func NewFS(mountPoint string) (FS, error) { if err != nil { return FS{}, err } - return FS{fs}, nil + + isReal, err := isRealProc(mountPoint) + if err != nil { + return FS{}, err + } + + return FS{fs, isReal}, nil } diff --git a/vendor/github.com/prometheus/procfs/fs_statfs_notype.go b/vendor/github.com/prometheus/procfs/fs_statfs_notype.go new file mode 100644 index 0000000000..134767d69a --- /dev/null +++ b/vendor/github.com/prometheus/procfs/fs_statfs_notype.go @@ -0,0 +1,23 @@ +// Copyright 2018 The Prometheus 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:build !freebsd && !linux +// +build !freebsd,!linux + +package procfs + +// isRealProc returns true on architectures that don't have a Type argument +// in their Statfs_t struct +func isRealProc(mountPoint string) (bool, error) { + return true, nil +} diff --git a/vendor/github.com/prometheus/procfs/fs_statfs_type.go b/vendor/github.com/prometheus/procfs/fs_statfs_type.go new file mode 100644 index 0000000000..80df79c319 --- /dev/null +++ b/vendor/github.com/prometheus/procfs/fs_statfs_type.go @@ -0,0 +1,33 @@ +// Copyright 2018 The Prometheus 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:build freebsd || linux +// +build freebsd linux + +package procfs + +import ( + "syscall" +) + +// isRealProc determines whether supplied mountpoint is really a proc filesystem. +func isRealProc(mountPoint string) (bool, error) { + stat := syscall.Statfs_t{} + err := syscall.Statfs(mountPoint, &stat) + if err != nil { + return false, err + } + + // 0x9fa0 is PROC_SUPER_MAGIC: https://elixir.bootlin.com/linux/v6.1/source/include/uapi/linux/magic.h#L87 + return stat.Type == 0x9fa0, nil +} diff --git a/vendor/github.com/prometheus/procfs/fscache.go b/vendor/github.com/prometheus/procfs/fscache.go index f8070e6e2b..cf2e3eaa03 100644 --- a/vendor/github.com/prometheus/procfs/fscache.go +++ b/vendor/github.com/prometheus/procfs/fscache.go @@ -236,7 +236,7 @@ func (fs FS) Fscacheinfo() (Fscacheinfo, error) { m, err := parseFscacheinfo(bytes.NewReader(b)) if err != nil { - return Fscacheinfo{}, fmt.Errorf("failed to parse Fscacheinfo: %w", err) + return Fscacheinfo{}, fmt.Errorf("%w: Cannot parse %v: %w", ErrFileParse, m, err) } return *m, nil @@ -245,7 +245,7 @@ func (fs FS) Fscacheinfo() (Fscacheinfo, error) { func setFSCacheFields(fields []string, setFields ...*uint64) error { var err error if len(fields) < len(setFields) { - return fmt.Errorf("Insufficient number of fields, expected %v, got %v", len(setFields), len(fields)) + return fmt.Errorf("%w: Expected %d, but got %d: %w", ErrFileParse, len(setFields), len(fields), err) } for i := range setFields { @@ -263,7 +263,7 @@ func parseFscacheinfo(r io.Reader) (*Fscacheinfo, error) { for s.Scan() { fields := strings.Fields(s.Text()) if len(fields) < 2 { - return nil, fmt.Errorf("malformed Fscacheinfo line: %q", s.Text()) + return nil, fmt.Errorf("%w: malformed Fscacheinfo line: %q", ErrFileParse, s.Text()) } switch fields[0] { diff --git a/vendor/github.com/prometheus/procfs/internal/fs/fs.go b/vendor/github.com/prometheus/procfs/internal/fs/fs.go index 0040753b1c..3c18c7610e 100644 --- a/vendor/github.com/prometheus/procfs/internal/fs/fs.go +++ b/vendor/github.com/prometheus/procfs/internal/fs/fs.go @@ -26,7 +26,7 @@ const ( // DefaultSysMountPoint is the common mount point of the sys filesystem. DefaultSysMountPoint = "/sys" - // DefaultConfigfsMountPoint is the common mount point of the configfs + // DefaultConfigfsMountPoint is the common mount point of the configfs. DefaultConfigfsMountPoint = "/sys/kernel/config" ) diff --git a/vendor/github.com/prometheus/procfs/internal/util/parse.go b/vendor/github.com/prometheus/procfs/internal/util/parse.go index 22cb07a6bb..14272dc788 100644 --- a/vendor/github.com/prometheus/procfs/internal/util/parse.go +++ b/vendor/github.com/prometheus/procfs/internal/util/parse.go @@ -14,7 +14,7 @@ package util import ( - "io/ioutil" + "os" "strconv" "strings" ) @@ -64,9 +64,24 @@ func ParsePInt64s(ss []string) ([]*int64, error) { return us, nil } +// Parses a uint64 from given hex in string. +func ParseHexUint64s(ss []string) ([]*uint64, error) { + us := make([]*uint64, 0, len(ss)) + for _, s := range ss { + u, err := strconv.ParseUint(s, 16, 64) + if err != nil { + return nil, err + } + + us = append(us, &u) + } + + return us, nil +} + // ReadUintFromFile reads a file and attempts to parse a uint64 from it. func ReadUintFromFile(path string) (uint64, error) { - data, err := ioutil.ReadFile(path) + data, err := os.ReadFile(path) if err != nil { return 0, err } @@ -75,7 +90,7 @@ func ReadUintFromFile(path string) (uint64, error) { // ReadIntFromFile reads a file and attempts to parse a int64 from it. func ReadIntFromFile(path string) (int64, error) { - data, err := ioutil.ReadFile(path) + data, err := os.ReadFile(path) if err != nil { return 0, err } diff --git a/vendor/github.com/prometheus/procfs/internal/util/readfile.go b/vendor/github.com/prometheus/procfs/internal/util/readfile.go index 8051161b2a..71b7a70ebd 100644 --- a/vendor/github.com/prometheus/procfs/internal/util/readfile.go +++ b/vendor/github.com/prometheus/procfs/internal/util/readfile.go @@ -15,17 +15,16 @@ package util import ( "io" - "io/ioutil" "os" ) -// ReadFileNoStat uses ioutil.ReadAll to read contents of entire file. -// This is similar to ioutil.ReadFile but without the call to os.Stat, because +// ReadFileNoStat uses io.ReadAll to read contents of entire file. +// This is similar to os.ReadFile but without the call to os.Stat, because // many files in /proc and /sys report incorrect file sizes (either 0 or 4096). -// Reads a max file size of 512kB. For files larger than this, a scanner +// Reads a max file size of 1024kB. For files larger than this, a scanner // should be used. func ReadFileNoStat(filename string) ([]byte, error) { - const maxBufferSize = 1024 * 512 + const maxBufferSize = 1024 * 1024 f, err := os.Open(filename) if err != nil { @@ -34,5 +33,5 @@ func ReadFileNoStat(filename string) ([]byte, error) { defer f.Close() reader := io.LimitReader(f, maxBufferSize) - return ioutil.ReadAll(reader) + return io.ReadAll(reader) } diff --git a/vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go b/vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go index c07de0b6c9..1ab875ceec 100644 --- a/vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go +++ b/vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go @@ -11,7 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build linux,!appengine +//go:build (linux || darwin) && !appengine +// +build linux darwin +// +build !appengine package util @@ -21,7 +23,7 @@ import ( "syscall" ) -// SysReadFile is a simplified ioutil.ReadFile that invokes syscall.Read directly. +// SysReadFile is a simplified os.ReadFile that invokes syscall.Read directly. // https://github.com/prometheus/node_exporter/pull/728/files // // Note that this function will not read files larger than 128 bytes. @@ -33,7 +35,7 @@ func SysReadFile(file string) (string, error) { defer f.Close() // On some machines, hwmon drivers are broken and return EAGAIN. This causes - // Go's ioutil.ReadFile implementation to poll forever. + // Go's os.ReadFile implementation to poll forever. // // Since we either want to read data or bail immediately, do the simplest // possible read using syscall directly. diff --git a/vendor/github.com/prometheus/procfs/internal/util/sysreadfile_compat.go b/vendor/github.com/prometheus/procfs/internal/util/sysreadfile_compat.go index bd55b45377..1d86f5e63f 100644 --- a/vendor/github.com/prometheus/procfs/internal/util/sysreadfile_compat.go +++ b/vendor/github.com/prometheus/procfs/internal/util/sysreadfile_compat.go @@ -11,7 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build linux,appengine !linux +//go:build (linux && appengine) || (!linux && !darwin) +// +build linux,appengine !linux,!darwin package util diff --git a/vendor/github.com/prometheus/procfs/ipvs.go b/vendor/github.com/prometheus/procfs/ipvs.go index 89e447746c..bc3a20c932 100644 --- a/vendor/github.com/prometheus/procfs/ipvs.go +++ b/vendor/github.com/prometheus/procfs/ipvs.go @@ -20,7 +20,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "net" "os" "strconv" @@ -84,7 +83,7 @@ func parseIPVSStats(r io.Reader) (IPVSStats, error) { stats IPVSStats ) - statContent, err := ioutil.ReadAll(r) + statContent, err := io.ReadAll(r) if err != nil { return IPVSStats{}, err } @@ -222,15 +221,16 @@ func parseIPPort(s string) (net.IP, uint16, error) { case 46: ip = net.ParseIP(s[1:40]) if ip == nil { - return nil, 0, fmt.Errorf("invalid IPv6 address: %s", s[1:40]) + return nil, 0, fmt.Errorf("%w: Invalid IPv6 addr %s: %w", ErrFileParse, s[1:40], err) } default: - return nil, 0, fmt.Errorf("unexpected IP:Port: %s", s) + return nil, 0, fmt.Errorf("%w: Unexpected IP:Port %s: %w", ErrFileParse, s, err) } portString := s[len(s)-4:] if len(portString) != 4 { - return nil, 0, fmt.Errorf("unexpected port string format: %s", portString) + return nil, 0, + fmt.Errorf("%w: Unexpected port string format %s: %w", ErrFileParse, portString, err) } port, err := strconv.ParseUint(portString, 16, 16) if err != nil { diff --git a/vendor/github.com/prometheus/procfs/kernel_random.go b/vendor/github.com/prometheus/procfs/kernel_random.go index da3a941d60..db88566bdf 100644 --- a/vendor/github.com/prometheus/procfs/kernel_random.go +++ b/vendor/github.com/prometheus/procfs/kernel_random.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package procfs diff --git a/vendor/github.com/prometheus/procfs/loadavg.go b/vendor/github.com/prometheus/procfs/loadavg.go index 0cce190ec2..332e76c17f 100644 --- a/vendor/github.com/prometheus/procfs/loadavg.go +++ b/vendor/github.com/prometheus/procfs/loadavg.go @@ -21,7 +21,7 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// LoadAvg represents an entry in /proc/loadavg +// LoadAvg represents an entry in /proc/loadavg. type LoadAvg struct { Load1 float64 Load5 float64 @@ -44,14 +44,14 @@ func parseLoad(loadavgBytes []byte) (*LoadAvg, error) { loads := make([]float64, 3) parts := strings.Fields(string(loadavgBytes)) if len(parts) < 3 { - return nil, fmt.Errorf("malformed loadavg line: too few fields in loadavg string: %q", string(loadavgBytes)) + return nil, fmt.Errorf("%w: Malformed line %q", ErrFileParse, string(loadavgBytes)) } var err error for i, load := range parts[0:3] { loads[i], err = strconv.ParseFloat(load, 64) if err != nil { - return nil, fmt.Errorf("could not parse load %q: %w", load, err) + return nil, fmt.Errorf("%w: Cannot parse load: %f: %w", ErrFileParse, loads[i], err) } } return &LoadAvg{ diff --git a/vendor/github.com/prometheus/procfs/mdstat.go b/vendor/github.com/prometheus/procfs/mdstat.go index 4c4493bfa5..67a9d2b448 100644 --- a/vendor/github.com/prometheus/procfs/mdstat.go +++ b/vendor/github.com/prometheus/procfs/mdstat.go @@ -15,16 +15,19 @@ package procfs import ( "fmt" - "io/ioutil" + "os" "regexp" "strconv" "strings" ) var ( - statusLineRE = regexp.MustCompile(`(\d+) blocks .*\[(\d+)/(\d+)\] \[[U_]+\]`) - recoveryLineRE = regexp.MustCompile(`\((\d+)/\d+\)`) - componentDeviceRE = regexp.MustCompile(`(.*)\[\d+\]`) + statusLineRE = regexp.MustCompile(`(\d+) blocks .*\[(\d+)/(\d+)\] \[([U_]+)\]`) + recoveryLineBlocksRE = regexp.MustCompile(`\((\d+/\d+)\)`) + recoveryLinePctRE = regexp.MustCompile(`= (.+)%`) + recoveryLineFinishRE = regexp.MustCompile(`finish=(.+)min`) + recoveryLineSpeedRE = regexp.MustCompile(`speed=(.+)[A-Z]`) + componentDeviceRE = regexp.MustCompile(`(.*)\[\d+\]`) ) // MDStat holds info parsed from /proc/mdstat. @@ -39,12 +42,22 @@ type MDStat struct { DisksTotal int64 // Number of failed disks. DisksFailed int64 + // Number of "down" disks. (the _ indicator in the status line) + DisksDown int64 // Spare disks in the device. DisksSpare int64 // Number of blocks the device holds. BlocksTotal int64 // Number of blocks on the device that are in sync. BlocksSynced int64 + // Number of blocks on the device that need to be synced. + BlocksToBeSynced int64 + // progress percentage of current sync + BlocksSyncedPct float64 + // estimated finishing time for current sync (in minutes) + BlocksSyncedFinishTime float64 + // current sync speed (in Kilobytes/sec) + BlocksSyncedSpeed float64 // Name of md component devices Devices []string } @@ -53,13 +66,13 @@ type MDStat struct { // structs containing the relevant info. More information available here: // https://raid.wiki.kernel.org/index.php/Mdstat func (fs FS) MDStat() ([]MDStat, error) { - data, err := ioutil.ReadFile(fs.proc.Path("mdstat")) + data, err := os.ReadFile(fs.proc.Path("mdstat")) if err != nil { return nil, err } mdstat, err := parseMDStat(data) if err != nil { - return nil, fmt.Errorf("error parsing mdstat %q: %w", fs.proc.Path("mdstat"), err) + return nil, fmt.Errorf("%w: Cannot parse %v: %w", ErrFileParse, fs.proc.Path("mdstat"), err) } return mdstat, nil } @@ -79,22 +92,22 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) { deviceFields := strings.Fields(line) if len(deviceFields) < 3 { - return nil, fmt.Errorf("not enough fields in mdline (expected at least 3): %s", line) + return nil, fmt.Errorf("%w: Expected 3+ lines, got %q", ErrFileParse, line) } mdName := deviceFields[0] // mdx state := deviceFields[2] // active or inactive if len(lines) <= i+3 { - return nil, fmt.Errorf("error parsing %q: too few lines for md device", mdName) + return nil, fmt.Errorf("%w: Too few lines for md device: %q", ErrFileParse, mdName) } // Failed disks have the suffix (F) & Spare disks have the suffix (S). fail := int64(strings.Count(line, "(F)")) spare := int64(strings.Count(line, "(S)")) - active, total, size, err := evalStatusLine(lines[i], lines[i+1]) + active, total, down, size, err := evalStatusLine(lines[i], lines[i+1]) if err != nil { - return nil, fmt.Errorf("error parsing md device lines: %w", err) + return nil, fmt.Errorf("%w: Cannot parse md device lines: %v: %w", ErrFileParse, active, err) } syncLineIdx := i + 2 @@ -104,7 +117,11 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) { // If device is syncing at the moment, get the number of currently // synced bytes, otherwise that number equals the size of the device. - syncedBlocks := size + blocksSynced := size + blocksToBeSynced := size + speed := float64(0) + finish := float64(0) + pct := float64(0) recovering := strings.Contains(lines[syncLineIdx], "recovery") resyncing := strings.Contains(lines[syncLineIdx], "resync") checking := strings.Contains(lines[syncLineIdx], "check") @@ -122,79 +139,125 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) { // Handle case when resync=PENDING or resync=DELAYED. if strings.Contains(lines[syncLineIdx], "PENDING") || strings.Contains(lines[syncLineIdx], "DELAYED") { - syncedBlocks = 0 + blocksSynced = 0 } else { - syncedBlocks, err = evalRecoveryLine(lines[syncLineIdx]) + blocksSynced, blocksToBeSynced, pct, finish, speed, err = evalRecoveryLine(lines[syncLineIdx]) if err != nil { - return nil, fmt.Errorf("error parsing sync line in md device %q: %w", mdName, err) + return nil, fmt.Errorf("%w: Cannot parse sync line in md device: %q: %w", ErrFileParse, mdName, err) } } } mdStats = append(mdStats, MDStat{ - Name: mdName, - ActivityState: state, - DisksActive: active, - DisksFailed: fail, - DisksSpare: spare, - DisksTotal: total, - BlocksTotal: size, - BlocksSynced: syncedBlocks, - Devices: evalComponentDevices(deviceFields), + Name: mdName, + ActivityState: state, + DisksActive: active, + DisksFailed: fail, + DisksDown: down, + DisksSpare: spare, + DisksTotal: total, + BlocksTotal: size, + BlocksSynced: blocksSynced, + BlocksToBeSynced: blocksToBeSynced, + BlocksSyncedPct: pct, + BlocksSyncedFinishTime: finish, + BlocksSyncedSpeed: speed, + Devices: evalComponentDevices(deviceFields), }) } return mdStats, nil } -func evalStatusLine(deviceLine, statusLine string) (active, total, size int64, err error) { +func evalStatusLine(deviceLine, statusLine string) (active, total, down, size int64, err error) { + statusFields := strings.Fields(statusLine) + if len(statusFields) < 1 { + return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected statusline %q: %w", ErrFileParse, statusLine, err) + } - sizeStr := strings.Fields(statusLine)[0] + sizeStr := statusFields[0] size, err = strconv.ParseInt(sizeStr, 10, 64) if err != nil { - return 0, 0, 0, fmt.Errorf("unexpected statusLine %q: %w", statusLine, err) + return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected statusline %q: %w", ErrFileParse, statusLine, err) } if strings.Contains(deviceLine, "raid0") || strings.Contains(deviceLine, "linear") { // In the device deviceLine, only disks have a number associated with them in []. total = int64(strings.Count(deviceLine, "[")) - return total, total, size, nil + return total, total, 0, size, nil } if strings.Contains(deviceLine, "inactive") { - return 0, 0, size, nil + return 0, 0, 0, size, nil } matches := statusLineRE.FindStringSubmatch(statusLine) - if len(matches) != 4 { - return 0, 0, 0, fmt.Errorf("couldn't find all the substring matches: %s", statusLine) + if len(matches) != 5 { + return 0, 0, 0, 0, fmt.Errorf("%w: Could not fild all substring matches %s: %w", ErrFileParse, statusLine, err) } total, err = strconv.ParseInt(matches[2], 10, 64) if err != nil { - return 0, 0, 0, fmt.Errorf("unexpected statusLine %q: %w", statusLine, err) + return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected statusline %q: %w", ErrFileParse, statusLine, err) } active, err = strconv.ParseInt(matches[3], 10, 64) if err != nil { - return 0, 0, 0, fmt.Errorf("unexpected statusLine %q: %w", statusLine, err) + return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected active %d: %w", ErrFileParse, active, err) } + down = int64(strings.Count(matches[4], "_")) - return active, total, size, nil + return active, total, down, size, nil } -func evalRecoveryLine(recoveryLine string) (syncedBlocks int64, err error) { - matches := recoveryLineRE.FindStringSubmatch(recoveryLine) +func evalRecoveryLine(recoveryLine string) (blocksSynced int64, blocksToBeSynced int64, pct float64, finish float64, speed float64, err error) { + matches := recoveryLineBlocksRE.FindStringSubmatch(recoveryLine) if len(matches) != 2 { - return 0, fmt.Errorf("unexpected recoveryLine: %s", recoveryLine) + return 0, 0, 0, 0, 0, fmt.Errorf("%w: Unexpected recoveryLine blocks %s: %w", ErrFileParse, recoveryLine, err) + } + + blocks := strings.Split(matches[1], "/") + blocksSynced, err = strconv.ParseInt(blocks[0], 10, 64) + if err != nil { + return 0, 0, 0, 0, 0, fmt.Errorf("%w: Unable to parse recovery blocks synced %q: %w", ErrFileParse, matches[1], err) + } + + blocksToBeSynced, err = strconv.ParseInt(blocks[1], 10, 64) + if err != nil { + return blocksSynced, 0, 0, 0, 0, fmt.Errorf("%w: Unable to parse recovery to be synced blocks %q: %w", ErrFileParse, matches[2], err) } - syncedBlocks, err = strconv.ParseInt(matches[1], 10, 64) + // Get percentage complete + matches = recoveryLinePctRE.FindStringSubmatch(recoveryLine) + if len(matches) != 2 { + return blocksSynced, blocksToBeSynced, 0, 0, 0, fmt.Errorf("%w: Unexpected recoveryLine matching percentage %s", ErrFileParse, recoveryLine) + } + pct, err = strconv.ParseFloat(strings.TrimSpace(matches[1]), 64) + if err != nil { + return blocksSynced, blocksToBeSynced, 0, 0, 0, fmt.Errorf("%w: Error parsing float from recoveryLine %q", ErrFileParse, recoveryLine) + } + + // Get time expected left to complete + matches = recoveryLineFinishRE.FindStringSubmatch(recoveryLine) + if len(matches) != 2 { + return blocksSynced, blocksToBeSynced, pct, 0, 0, fmt.Errorf("%w: Unexpected recoveryLine matching est. finish time: %s", ErrFileParse, recoveryLine) + } + finish, err = strconv.ParseFloat(matches[1], 64) + if err != nil { + return blocksSynced, blocksToBeSynced, pct, 0, 0, fmt.Errorf("%w: Unable to parse float from recoveryLine: %q", ErrFileParse, recoveryLine) + } + + // Get recovery speed + matches = recoveryLineSpeedRE.FindStringSubmatch(recoveryLine) + if len(matches) != 2 { + return blocksSynced, blocksToBeSynced, pct, finish, 0, fmt.Errorf("%w: Unexpected recoveryLine value: %s", ErrFileParse, recoveryLine) + } + speed, err = strconv.ParseFloat(matches[1], 64) if err != nil { - return 0, fmt.Errorf("error parsing int from recoveryLine %q: %w", recoveryLine, err) + return blocksSynced, blocksToBeSynced, pct, finish, 0, fmt.Errorf("%w: Error parsing float from recoveryLine: %q: %w", ErrFileParse, recoveryLine, err) } - return syncedBlocks, nil + return blocksSynced, blocksToBeSynced, pct, finish, speed, nil } func evalComponentDevices(deviceFields []string) []string { diff --git a/vendor/github.com/prometheus/procfs/meminfo.go b/vendor/github.com/prometheus/procfs/meminfo.go index f65e174e57..4b2c4050a3 100644 --- a/vendor/github.com/prometheus/procfs/meminfo.go +++ b/vendor/github.com/prometheus/procfs/meminfo.go @@ -126,6 +126,7 @@ type Meminfo struct { VmallocUsed *uint64 // largest contiguous block of vmalloc area which is free VmallocChunk *uint64 + Percpu *uint64 HardwareCorrupted *uint64 AnonHugePages *uint64 ShmemHugePages *uint64 @@ -140,6 +141,55 @@ type Meminfo struct { DirectMap4k *uint64 DirectMap2M *uint64 DirectMap1G *uint64 + + // The struct fields below are the byte-normalized counterparts to the + // existing struct fields. Values are normalized using the optional + // unit field in the meminfo line. + MemTotalBytes *uint64 + MemFreeBytes *uint64 + MemAvailableBytes *uint64 + BuffersBytes *uint64 + CachedBytes *uint64 + SwapCachedBytes *uint64 + ActiveBytes *uint64 + InactiveBytes *uint64 + ActiveAnonBytes *uint64 + InactiveAnonBytes *uint64 + ActiveFileBytes *uint64 + InactiveFileBytes *uint64 + UnevictableBytes *uint64 + MlockedBytes *uint64 + SwapTotalBytes *uint64 + SwapFreeBytes *uint64 + DirtyBytes *uint64 + WritebackBytes *uint64 + AnonPagesBytes *uint64 + MappedBytes *uint64 + ShmemBytes *uint64 + SlabBytes *uint64 + SReclaimableBytes *uint64 + SUnreclaimBytes *uint64 + KernelStackBytes *uint64 + PageTablesBytes *uint64 + NFSUnstableBytes *uint64 + BounceBytes *uint64 + WritebackTmpBytes *uint64 + CommitLimitBytes *uint64 + CommittedASBytes *uint64 + VmallocTotalBytes *uint64 + VmallocUsedBytes *uint64 + VmallocChunkBytes *uint64 + PercpuBytes *uint64 + HardwareCorruptedBytes *uint64 + AnonHugePagesBytes *uint64 + ShmemHugePagesBytes *uint64 + ShmemPmdMappedBytes *uint64 + CmaTotalBytes *uint64 + CmaFreeBytes *uint64 + HugepagesizeBytes *uint64 + DirectMap4kBytes *uint64 + DirectMap2MBytes *uint64 + DirectMap1GBytes *uint64 } // Meminfo returns an information about current kernel/system memory statistics. @@ -152,7 +202,7 @@ func (fs FS) Meminfo() (Meminfo, error) { m, err := parseMemInfo(bytes.NewReader(b)) if err != nil { - return Meminfo{}, fmt.Errorf("failed to parse meminfo: %w", err) + return Meminfo{}, fmt.Errorf("%w: %w", ErrFileParse, err) } return *m, nil @@ -162,114 +212,176 @@ func parseMemInfo(r io.Reader) (*Meminfo, error) { var m Meminfo s := bufio.NewScanner(r) for s.Scan() { - // Each line has at least a name and value; we ignore the unit. fields := strings.Fields(s.Text()) - if len(fields) < 2 { - return nil, fmt.Errorf("malformed meminfo line: %q", s.Text()) - } + var val, valBytes uint64 - v, err := strconv.ParseUint(fields[1], 0, 64) + val, err := strconv.ParseUint(fields[1], 0, 64) if err != nil { return nil, err } + switch len(fields) { + case 2: + // No unit present, use the parsed the value as bytes directly. + valBytes = val + case 3: + // Unit present in optional 3rd field, convert it to + // bytes. The only unit supported within the Linux + // kernel is `kB`. + if fields[2] != "kB" { + return nil, fmt.Errorf("%w: Unsupported unit in optional 3rd field %q", ErrFileParse, fields[2]) + } + + valBytes = 1024 * val + + default: + return nil, fmt.Errorf("%w: Malformed line %q", ErrFileParse, s.Text()) + } + switch fields[0] { case "MemTotal:": - m.MemTotal = &v + m.MemTotal = &val + m.MemTotalBytes = &valBytes case "MemFree:": - m.MemFree = &v + m.MemFree = &val + m.MemFreeBytes = &valBytes case "MemAvailable:": - m.MemAvailable = &v + m.MemAvailable = &val + m.MemAvailableBytes = &valBytes case "Buffers:": - m.Buffers = &v + m.Buffers = &val + m.BuffersBytes = &valBytes case "Cached:": - m.Cached = &v + m.Cached = &val + m.CachedBytes = &valBytes case "SwapCached:": - m.SwapCached = &v + m.SwapCached = &val + m.SwapCachedBytes = &valBytes case "Active:": - m.Active = &v + m.Active = &val + m.ActiveBytes = &valBytes case "Inactive:": - m.Inactive = &v + m.Inactive = &val + m.InactiveBytes = &valBytes case "Active(anon):": - m.ActiveAnon = &v + m.ActiveAnon = &val + m.ActiveAnonBytes = &valBytes case "Inactive(anon):": - m.InactiveAnon = &v + m.InactiveAnon = &val + m.InactiveAnonBytes = &valBytes case "Active(file):": - m.ActiveFile = &v + m.ActiveFile = &val + m.ActiveFileBytes = &valBytes case "Inactive(file):": - m.InactiveFile = &v + m.InactiveFile = &val + m.InactiveFileBytes = &valBytes case "Unevictable:": - m.Unevictable = &v + m.Unevictable = &val + m.UnevictableBytes = &valBytes case "Mlocked:": - m.Mlocked = &v + m.Mlocked = &val + m.MlockedBytes = &valBytes case "SwapTotal:": - m.SwapTotal = &v + m.SwapTotal = &val + m.SwapTotalBytes = &valBytes case "SwapFree:": - m.SwapFree = &v + m.SwapFree = &val + m.SwapFreeBytes = &valBytes case "Dirty:": - m.Dirty = &v + m.Dirty = &val + m.DirtyBytes = &valBytes case "Writeback:": - m.Writeback = &v + m.Writeback = &val + m.WritebackBytes = &valBytes case "AnonPages:": - m.AnonPages = &v + m.AnonPages = &val + m.AnonPagesBytes = &valBytes case "Mapped:": - m.Mapped = &v + m.Mapped = &val + m.MappedBytes = &valBytes case "Shmem:": - m.Shmem = &v + m.Shmem = &val + m.ShmemBytes = &valBytes case "Slab:": - m.Slab = &v + m.Slab = &val + m.SlabBytes = &valBytes case "SReclaimable:": - m.SReclaimable = &v + m.SReclaimable = &val + m.SReclaimableBytes = &valBytes case "SUnreclaim:": - m.SUnreclaim = &v + m.SUnreclaim = &val + m.SUnreclaimBytes = &valBytes case "KernelStack:": - m.KernelStack = &v + m.KernelStack = &val + m.KernelStackBytes = &valBytes case "PageTables:": - m.PageTables = &v + m.PageTables = &val + m.PageTablesBytes = &valBytes case "NFS_Unstable:": - m.NFSUnstable = &v + m.NFSUnstable = &val + m.NFSUnstableBytes = &valBytes case "Bounce:": - m.Bounce = &v + m.Bounce = &val + m.BounceBytes = &valBytes case "WritebackTmp:": - m.WritebackTmp = &v + m.WritebackTmp = &val + m.WritebackTmpBytes = &valBytes case "CommitLimit:": - m.CommitLimit = &v + m.CommitLimit = &val + m.CommitLimitBytes = &valBytes case "Committed_AS:": - m.CommittedAS = &v + m.CommittedAS = &val + m.CommittedASBytes = &valBytes case "VmallocTotal:": - m.VmallocTotal = &v + m.VmallocTotal = &val + m.VmallocTotalBytes = &valBytes case "VmallocUsed:": - m.VmallocUsed = &v + m.VmallocUsed = &val + m.VmallocUsedBytes = &valBytes case "VmallocChunk:": - m.VmallocChunk = &v + m.VmallocChunk = &val + m.VmallocChunkBytes = &valBytes + case "Percpu:": + m.Percpu = &val + m.PercpuBytes = &valBytes case "HardwareCorrupted:": - m.HardwareCorrupted = &v + m.HardwareCorrupted = &val + m.HardwareCorruptedBytes = &valBytes case "AnonHugePages:": - m.AnonHugePages = &v + m.AnonHugePages = &val + m.AnonHugePagesBytes = &valBytes case "ShmemHugePages:": - m.ShmemHugePages = &v + m.ShmemHugePages = &val + m.ShmemHugePagesBytes = &valBytes case "ShmemPmdMapped:": - m.ShmemPmdMapped = &v + m.ShmemPmdMapped = &val + m.ShmemPmdMappedBytes = &valBytes case "CmaTotal:": - m.CmaTotal = &v + m.CmaTotal = &val + m.CmaTotalBytes = &valBytes case "CmaFree:": - m.CmaFree = &v + m.CmaFree = &val + m.CmaFreeBytes = &valBytes case "HugePages_Total:": - m.HugePagesTotal = &v + m.HugePagesTotal = &val case "HugePages_Free:": - m.HugePagesFree = &v + m.HugePagesFree = &val case "HugePages_Rsvd:": - m.HugePagesRsvd = &v + m.HugePagesRsvd = &val case "HugePages_Surp:": - m.HugePagesSurp = &v + m.HugePagesSurp = &val case "Hugepagesize:": - m.Hugepagesize = &v + m.Hugepagesize = &val + m.HugepagesizeBytes = &valBytes case "DirectMap4k:": - m.DirectMap4k = &v + m.DirectMap4k = &val + m.DirectMap4kBytes = &valBytes case "DirectMap2M:": - m.DirectMap2M = &v + m.DirectMap2M = &val + m.DirectMap2MBytes = &valBytes case "DirectMap1G:": - m.DirectMap1G = &v + m.DirectMap1G = &val + m.DirectMap1GBytes = &valBytes } } diff --git a/vendor/github.com/prometheus/procfs/mountinfo.go b/vendor/github.com/prometheus/procfs/mountinfo.go index 59f4d50558..a704c5e735 100644 --- a/vendor/github.com/prometheus/procfs/mountinfo.go +++ b/vendor/github.com/prometheus/procfs/mountinfo.go @@ -78,11 +78,11 @@ func parseMountInfoString(mountString string) (*MountInfo, error) { mountInfo := strings.Split(mountString, " ") mountInfoLength := len(mountInfo) if mountInfoLength < 10 { - return nil, fmt.Errorf("couldn't find enough fields in mount string: %s", mountString) + return nil, fmt.Errorf("%w: Too few fields in mount string: %s", ErrFileParse, mountString) } if mountInfo[mountInfoLength-4] != "-" { - return nil, fmt.Errorf("couldn't find separator in expected field: %s", mountInfo[mountInfoLength-4]) + return nil, fmt.Errorf("%w: couldn't find separator in expected field: %s", ErrFileParse, mountInfo[mountInfoLength-4]) } mount := &MountInfo{ @@ -98,18 +98,18 @@ func parseMountInfoString(mountString string) (*MountInfo, error) { mount.MountID, err = strconv.Atoi(mountInfo[0]) if err != nil { - return nil, fmt.Errorf("failed to parse mount ID") + return nil, fmt.Errorf("%w: mount ID: %q", ErrFileParse, mount.MountID) } mount.ParentID, err = strconv.Atoi(mountInfo[1]) if err != nil { - return nil, fmt.Errorf("failed to parse parent ID") + return nil, fmt.Errorf("%w: parent ID: %q", ErrFileParse, mount.ParentID) } // Has optional fields, which is a space separated list of values. // Example: shared:2 master:7 if mountInfo[6] != "" { mount.OptionalFields, err = mountOptionsParseOptionalFields(mountInfo[6 : mountInfoLength-4]) if err != nil { - return nil, err + return nil, fmt.Errorf("%w: %w", ErrFileParse, err) } } return mount, nil diff --git a/vendor/github.com/prometheus/procfs/mountstats.go b/vendor/github.com/prometheus/procfs/mountstats.go index f7a828bb1d..75a3b6c810 100644 --- a/vendor/github.com/prometheus/procfs/mountstats.go +++ b/vendor/github.com/prometheus/procfs/mountstats.go @@ -44,6 +44,14 @@ const ( fieldTransport11TCPLen = 13 fieldTransport11UDPLen = 10 + + // kernel version >= 4.14 MaxLen + // See: https://elixir.bootlin.com/linux/v6.4.8/source/net/sunrpc/xprtrdma/xprt_rdma.h#L393 + fieldTransport11RDMAMaxLen = 28 + + // kernel version <= 4.2 MinLen + // See: https://elixir.bootlin.com/linux/v4.2.8/source/net/sunrpc/xprtrdma/xprt_rdma.h#L331 + fieldTransport11RDMAMinLen = 20 ) // A Mount is a device mount parsed from /proc/[pid]/mountstats. @@ -80,7 +88,7 @@ type MountStatsNFS struct { // Statistics broken down by filesystem operation. Operations []NFSOperationStats // Statistics about the NFS RPC transport. - Transport NFSTransportStats + Transport []NFSTransportStats } // mountStats implements MountStats. @@ -231,6 +239,33 @@ type NFSTransportStats struct { // A running counter, incremented on each request as the current size of the // pending queue. CumulativePendingQueue uint64 + + // Stats below only available with stat version 1.1. + // Transport over RDMA + + // accessed when sending a call + ReadChunkCount uint64 + WriteChunkCount uint64 + ReplyChunkCount uint64 + TotalRdmaRequest uint64 + + // rarely accessed error counters + PullupCopyCount uint64 + HardwayRegisterCount uint64 + FailedMarshalCount uint64 + BadReplyCount uint64 + MrsRecovered uint64 + MrsOrphaned uint64 + MrsAllocated uint64 + EmptySendctxQ uint64 + + // accessed when receiving a reply + TotalRdmaReply uint64 + FixupCopyCount uint64 + ReplyWaitsForSend uint64 + LocalInvNeeded uint64 + NomsgCallCount uint64 + BcallCount uint64 } // parseMountStats parses a /proc/[pid]/mountstats file and returns a slice @@ -264,7 +299,7 @@ func parseMountStats(r io.Reader) ([]*Mount, error) { if len(ss) > deviceEntryLen { // Only NFSv3 and v4 are supported for parsing statistics if m.Type != nfs3Type && m.Type != nfs4Type { - return nil, fmt.Errorf("cannot parse MountStats for fstype %q", m.Type) + return nil, fmt.Errorf("%w: Cannot parse MountStats for %q", ErrFileParse, m.Type) } statVersion := strings.TrimPrefix(ss[8], statVersionPrefix) @@ -284,10 +319,11 @@ func parseMountStats(r io.Reader) ([]*Mount, error) { } // parseMount parses an entry in /proc/[pid]/mountstats in the format: -// device [device] mounted on [mount] with fstype [type] +// +// device [device] mounted on [mount] with fstype [type] func parseMount(ss []string) (*Mount, error) { if len(ss) < deviceEntryLen { - return nil, fmt.Errorf("invalid device entry: %v", ss) + return nil, fmt.Errorf("%w: Invalid device %q", ErrFileParse, ss) } // Check for specific words appearing at specific indices to ensure @@ -305,7 +341,7 @@ func parseMount(ss []string) (*Mount, error) { for _, f := range format { if ss[f.i] != f.s { - return nil, fmt.Errorf("invalid device entry: %v", ss) + return nil, fmt.Errorf("%w: Invalid device %q", ErrFileParse, ss) } } @@ -342,7 +378,7 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e switch ss[0] { case fieldOpts: if len(ss) < 2 { - return nil, fmt.Errorf("not enough information for NFS stats: %v", ss) + return nil, fmt.Errorf("%w: Incomplete information for NFS stats: %v", ErrFileParse, ss) } if stats.Opts == nil { stats.Opts = map[string]string{} @@ -357,7 +393,7 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e } case fieldAge: if len(ss) < 2 { - return nil, fmt.Errorf("not enough information for NFS stats: %v", ss) + return nil, fmt.Errorf("%w: Incomplete information for NFS stats: %v", ErrFileParse, ss) } // Age integer is in seconds d, err := time.ParseDuration(ss[1] + "s") @@ -368,7 +404,7 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e stats.Age = d case fieldBytes: if len(ss) < 2 { - return nil, fmt.Errorf("not enough information for NFS stats: %v", ss) + return nil, fmt.Errorf("%w: Incomplete information for NFS stats: %v", ErrFileParse, ss) } bstats, err := parseNFSBytesStats(ss[1:]) if err != nil { @@ -378,7 +414,7 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e stats.Bytes = *bstats case fieldEvents: if len(ss) < 2 { - return nil, fmt.Errorf("not enough information for NFS stats: %v", ss) + return nil, fmt.Errorf("%w: Incomplete information for NFS events: %v", ErrFileParse, ss) } estats, err := parseNFSEventsStats(ss[1:]) if err != nil { @@ -388,7 +424,7 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e stats.Events = *estats case fieldTransport: if len(ss) < 3 { - return nil, fmt.Errorf("not enough information for NFS transport stats: %v", ss) + return nil, fmt.Errorf("%w: Incomplete information for NFS transport stats: %v", ErrFileParse, ss) } tstats, err := parseNFSTransportStats(ss[1:], statVersion) @@ -396,7 +432,7 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e return nil, err } - stats.Transport = *tstats + stats.Transport = append(stats.Transport, *tstats) } // When encountering "per-operation statistics", we must break this @@ -427,7 +463,7 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e // integer fields. func parseNFSBytesStats(ss []string) (*NFSBytesStats, error) { if len(ss) != fieldBytesLen { - return nil, fmt.Errorf("invalid NFS bytes stats: %v", ss) + return nil, fmt.Errorf("%w: Invalid NFS bytes stats: %v", ErrFileParse, ss) } ns := make([]uint64, 0, fieldBytesLen) @@ -456,7 +492,7 @@ func parseNFSBytesStats(ss []string) (*NFSBytesStats, error) { // integer fields. func parseNFSEventsStats(ss []string) (*NFSEventsStats, error) { if len(ss) != fieldEventsLen { - return nil, fmt.Errorf("invalid NFS events stats: %v", ss) + return nil, fmt.Errorf("%w: invalid NFS events stats: %v", ErrFileParse, ss) } ns := make([]uint64, 0, fieldEventsLen) @@ -520,7 +556,7 @@ func parseNFSOperationStats(s *bufio.Scanner) ([]NFSOperationStats, error) { } if len(ss) < minFields { - return nil, fmt.Errorf("invalid NFS per-operations stats: %v", ss) + return nil, fmt.Errorf("%w: invalid NFS per-operations stats: %v", ErrFileParse, ss) } // Skip string operation name for integers @@ -533,7 +569,6 @@ func parseNFSOperationStats(s *bufio.Scanner) ([]NFSOperationStats, error) { ns = append(ns, n) } - opStats := NFSOperationStats{ Operation: strings.TrimSuffix(ss[0], ":"), Requests: ns[0], @@ -571,10 +606,10 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats } else if protocol == "udp" { expectedLength = fieldTransport10UDPLen } else { - return nil, fmt.Errorf("invalid NFS protocol \"%s\" in stats 1.0 statement: %v", protocol, ss) + return nil, fmt.Errorf("%w: Invalid NFS protocol \"%s\" in stats 1.0 statement: %v", ErrFileParse, protocol, ss) } if len(ss) != expectedLength { - return nil, fmt.Errorf("invalid NFS transport stats 1.0 statement: %v", ss) + return nil, fmt.Errorf("%w: Invalid NFS transport stats 1.0 statement: %v", ErrFileParse, ss) } case statVersion11: var expectedLength int @@ -582,14 +617,17 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats expectedLength = fieldTransport11TCPLen } else if protocol == "udp" { expectedLength = fieldTransport11UDPLen + } else if protocol == "rdma" { + expectedLength = fieldTransport11RDMAMinLen } else { - return nil, fmt.Errorf("invalid NFS protocol \"%s\" in stats 1.1 statement: %v", protocol, ss) + return nil, fmt.Errorf("%w: invalid NFS protocol \"%s\" in stats 1.1 statement: %v", ErrFileParse, protocol, ss) } - if len(ss) != expectedLength { - return nil, fmt.Errorf("invalid NFS transport stats 1.1 statement: %v", ss) + if (len(ss) != expectedLength && (protocol == "tcp" || protocol == "udp")) || + (protocol == "rdma" && len(ss) < expectedLength) { + return nil, fmt.Errorf("%w: invalid NFS transport stats 1.1 statement: %v, protocol: %v", ErrFileParse, ss, protocol) } default: - return nil, fmt.Errorf("unrecognized NFS transport stats version: %q", statVersion) + return nil, fmt.Errorf("%w: Unrecognized NFS transport stats version: %q, protocol: %v", ErrFileParse, statVersion, protocol) } // Allocate enough for v1.1 stats since zero value for v1.1 stats will be okay @@ -599,7 +637,9 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats // Note: slice length must be set to length of v1.1 stats to avoid a panic when // only v1.0 stats are present. // See: https://github.com/prometheus/node_exporter/issues/571. - ns := make([]uint64, fieldTransport11TCPLen) + // + // Note: NFS Over RDMA slice length is fieldTransport11RDMAMaxLen + ns := make([]uint64, fieldTransport11RDMAMaxLen+3) for i, s := range ss { n, err := strconv.ParseUint(s, 10, 64) if err != nil { @@ -617,9 +657,14 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats // we set them to 0 here. if protocol == "udp" { ns = append(ns[:2], append(make([]uint64, 3), ns[2:]...)...) + } else if protocol == "tcp" { + ns = append(ns[:fieldTransport11TCPLen], make([]uint64, fieldTransport11RDMAMaxLen-fieldTransport11TCPLen+3)...) + } else if protocol == "rdma" { + ns = append(ns[:fieldTransport10TCPLen], append(make([]uint64, 3), ns[fieldTransport10TCPLen:]...)...) } return &NFSTransportStats{ + // NFS xprt over tcp or udp Protocol: protocol, Port: ns[0], Bind: ns[1], @@ -631,8 +676,32 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats BadTransactionIDs: ns[7], CumulativeActiveRequests: ns[8], CumulativeBacklog: ns[9], - MaximumRPCSlotsUsed: ns[10], - CumulativeSendingQueue: ns[11], - CumulativePendingQueue: ns[12], + + // NFS xprt over tcp or udp + // And statVersion 1.1 + MaximumRPCSlotsUsed: ns[10], + CumulativeSendingQueue: ns[11], + CumulativePendingQueue: ns[12], + + // NFS xprt over rdma + // And stat Version 1.1 + ReadChunkCount: ns[13], + WriteChunkCount: ns[14], + ReplyChunkCount: ns[15], + TotalRdmaRequest: ns[16], + PullupCopyCount: ns[17], + HardwayRegisterCount: ns[18], + FailedMarshalCount: ns[19], + BadReplyCount: ns[20], + MrsRecovered: ns[21], + MrsOrphaned: ns[22], + MrsAllocated: ns[23], + EmptySendctxQ: ns[24], + TotalRdmaReply: ns[25], + FixupCopyCount: ns[26], + ReplyWaitsForSend: ns[27], + LocalInvNeeded: ns[28], + NomsgCallCount: ns[29], + BcallCount: ns[30], }, nil } diff --git a/vendor/github.com/prometheus/procfs/net_conntrackstat.go b/vendor/github.com/prometheus/procfs/net_conntrackstat.go index 9964a3600b..316df5fbb7 100644 --- a/vendor/github.com/prometheus/procfs/net_conntrackstat.go +++ b/vendor/github.com/prometheus/procfs/net_conntrackstat.go @@ -18,19 +18,22 @@ import ( "bytes" "fmt" "io" - "strconv" "strings" "github.com/prometheus/procfs/internal/util" ) // A ConntrackStatEntry represents one line from net/stat/nf_conntrack -// and contains netfilter conntrack statistics at one CPU core +// and contains netfilter conntrack statistics at one CPU core. type ConntrackStatEntry struct { Entries uint64 + Searched uint64 Found uint64 + New uint64 Invalid uint64 Ignore uint64 + Delete uint64 + DeleteList uint64 Insert uint64 InsertFailed uint64 Drop uint64 @@ -38,12 +41,12 @@ type ConntrackStatEntry struct { SearchRestart uint64 } -// ConntrackStat retrieves netfilter's conntrack statistics, split by CPU cores +// ConntrackStat retrieves netfilter's conntrack statistics, split by CPU cores. func (fs FS) ConntrackStat() ([]ConntrackStatEntry, error) { return readConntrackStat(fs.proc.Path("net", "stat", "nf_conntrack")) } -// Parses a slice of ConntrackStatEntries from the given filepath +// Parses a slice of ConntrackStatEntries from the given filepath. func readConntrackStat(path string) ([]ConntrackStatEntry, error) { // This file is small and can be read with one syscall. b, err := util.ReadFileNoStat(path) @@ -55,13 +58,13 @@ func readConntrackStat(path string) ([]ConntrackStatEntry, error) { stat, err := parseConntrackStat(bytes.NewReader(b)) if err != nil { - return nil, fmt.Errorf("failed to read conntrack stats from %q: %w", path, err) + return nil, fmt.Errorf("%w: Cannot read file: %v: %w", ErrFileRead, path, err) } return stat, nil } -// Reads the contents of a conntrack statistics file and parses a slice of ConntrackStatEntries +// Reads the contents of a conntrack statistics file and parses a slice of ConntrackStatEntries. func parseConntrackStat(r io.Reader) ([]ConntrackStatEntry, error) { var entries []ConntrackStatEntry @@ -79,75 +82,37 @@ func parseConntrackStat(r io.Reader) ([]ConntrackStatEntry, error) { return entries, nil } -// Parses a ConntrackStatEntry from given array of fields +// Parses a ConntrackStatEntry from given array of fields. func parseConntrackStatEntry(fields []string) (*ConntrackStatEntry, error) { - if len(fields) != 17 { - return nil, fmt.Errorf("invalid conntrackstat entry, missing fields") - } - entry := &ConntrackStatEntry{} - - entries, err := parseConntrackStatField(fields[0]) - if err != nil { - return nil, err - } - entry.Entries = entries - - found, err := parseConntrackStatField(fields[2]) - if err != nil { - return nil, err - } - entry.Found = found - - invalid, err := parseConntrackStatField(fields[4]) - if err != nil { - return nil, err - } - entry.Invalid = invalid - - ignore, err := parseConntrackStatField(fields[5]) - if err != nil { - return nil, err - } - entry.Ignore = ignore - - insert, err := parseConntrackStatField(fields[8]) + entries, err := util.ParseHexUint64s(fields) if err != nil { - return nil, err + return nil, fmt.Errorf("%w: Cannot parse entry: %d: %w", ErrFileParse, entries, err) } - entry.Insert = insert - - insertFailed, err := parseConntrackStatField(fields[9]) - if err != nil { - return nil, err + numEntries := len(entries) + if numEntries < 16 || numEntries > 17 { + return nil, + fmt.Errorf("%w: invalid conntrackstat entry, invalid number of fields: %d", ErrFileParse, numEntries) } - entry.InsertFailed = insertFailed - drop, err := parseConntrackStatField(fields[10]) - if err != nil { - return nil, err + stats := &ConntrackStatEntry{ + Entries: *entries[0], + Searched: *entries[1], + Found: *entries[2], + New: *entries[3], + Invalid: *entries[4], + Ignore: *entries[5], + Delete: *entries[6], + DeleteList: *entries[7], + Insert: *entries[8], + InsertFailed: *entries[9], + Drop: *entries[10], + EarlyDrop: *entries[11], } - entry.Drop = drop - earlyDrop, err := parseConntrackStatField(fields[11]) - if err != nil { - return nil, err + // Ignore missing search_restart on Linux < 2.6.35. + if numEntries == 17 { + stats.SearchRestart = *entries[16] } - entry.EarlyDrop = earlyDrop - searchRestart, err := parseConntrackStatField(fields[16]) - if err != nil { - return nil, err - } - entry.SearchRestart = searchRestart - - return entry, nil -} - -// Parses a uint64 from given hex in string -func parseConntrackStatField(field string) (uint64, error) { - val, err := strconv.ParseUint(field, 16, 64) - if err != nil { - return 0, fmt.Errorf("couldn't parse %q field: %w", field, err) - } - return val, err + return stats, nil } diff --git a/vendor/github.com/prometheus/procfs/net_dev.go b/vendor/github.com/prometheus/procfs/net_dev.go index 47a710befb..e66208aa05 100644 --- a/vendor/github.com/prometheus/procfs/net_dev.go +++ b/vendor/github.com/prometheus/procfs/net_dev.go @@ -87,17 +87,17 @@ func newNetDev(file string) (NetDev, error) { // parseLine parses a single line from the /proc/net/dev file. Header lines // must be filtered prior to calling this method. func (netDev NetDev) parseLine(rawLine string) (*NetDevLine, error) { - parts := strings.SplitN(rawLine, ":", 2) - if len(parts) != 2 { + idx := strings.LastIndex(rawLine, ":") + if idx == -1 { return nil, errors.New("invalid net/dev line, missing colon") } - fields := strings.Fields(strings.TrimSpace(parts[1])) + fields := strings.Fields(strings.TrimSpace(rawLine[idx+1:])) var err error line := &NetDevLine{} // Interface Name - line.Name = strings.TrimSpace(parts[0]) + line.Name = strings.TrimSpace(rawLine[:idx]) if line.Name == "" { return nil, errors.New("invalid net/dev line, empty interface name") } diff --git a/vendor/github.com/prometheus/procfs/net_ip_socket.go b/vendor/github.com/prometheus/procfs/net_ip_socket.go index ac01dd8475..b70f1fc7a4 100644 --- a/vendor/github.com/prometheus/procfs/net_ip_socket.go +++ b/vendor/github.com/prometheus/procfs/net_ip_socket.go @@ -34,7 +34,7 @@ const ( readLimit = 4294967296 // Byte -> 4 GiB ) -// this contains generic data structures for both udp and tcp sockets +// This contains generic data structures for both udp and tcp sockets. type ( // NetIPSocket represents the contents of /proc/net/{t,u}dp{,6} file without the header. NetIPSocket []*netIPSocketLine @@ -50,10 +50,13 @@ type ( // UsedSockets shows the total number of parsed lines representing the // number of used sockets. UsedSockets uint64 + // Drops shows the total number of dropped packets of all UPD sockets. + Drops *uint64 } // netIPSocketLine represents the fields parsed from a single line // in /proc/net/{t,u}dp{,6}. Fields which are not used by IPSocket are skipped. + // Drops is non-nil for udp{,6}, but nil for tcp{,6}. // For the proc file format details, see https://linux.die.net/man/5/proc. netIPSocketLine struct { Sl uint64 @@ -65,6 +68,8 @@ type ( TxQueue uint64 RxQueue uint64 UID uint64 + Inode uint64 + Drops *uint64 } ) @@ -76,13 +81,14 @@ func newNetIPSocket(file string) (NetIPSocket, error) { defer f.Close() var netIPSocket NetIPSocket + isUDP := strings.Contains(file, "udp") lr := io.LimitReader(f, readLimit) s := bufio.NewScanner(lr) s.Scan() // skip first line with headers for s.Scan() { fields := strings.Fields(s.Text()) - line, err := parseNetIPSocketLine(fields) + line, err := parseNetIPSocketLine(fields, isUDP) if err != nil { return nil, err } @@ -103,19 +109,25 @@ func newNetIPSocketSummary(file string) (*NetIPSocketSummary, error) { defer f.Close() var netIPSocketSummary NetIPSocketSummary + var udpPacketDrops uint64 + isUDP := strings.Contains(file, "udp") lr := io.LimitReader(f, readLimit) s := bufio.NewScanner(lr) s.Scan() // skip first line with headers for s.Scan() { fields := strings.Fields(s.Text()) - line, err := parseNetIPSocketLine(fields) + line, err := parseNetIPSocketLine(fields, isUDP) if err != nil { return nil, err } netIPSocketSummary.TxQueueLength += line.TxQueue netIPSocketSummary.RxQueueLength += line.RxQueue netIPSocketSummary.UsedSockets++ + if isUDP { + udpPacketDrops += *line.Drops + netIPSocketSummary.Drops = &udpPacketDrops + } } if err := s.Err(); err != nil { return nil, err @@ -129,7 +141,7 @@ func parseIP(hexIP string) (net.IP, error) { var byteIP []byte byteIP, err := hex.DecodeString(hexIP) if err != nil { - return nil, fmt.Errorf("cannot parse address field in socket line %q", hexIP) + return nil, fmt.Errorf("%w: Cannot parse socket field in %q: %w", ErrFileParse, hexIP, err) } switch len(byteIP) { case 4: @@ -143,16 +155,17 @@ func parseIP(hexIP string) (net.IP, error) { } return i, nil default: - return nil, fmt.Errorf("Unable to parse IP %s", hexIP) + return nil, fmt.Errorf("%w: Unable to parse IP %s: %v", ErrFileParse, hexIP, nil) } } // parseNetIPSocketLine parses a single line, represented by a list of fields. -func parseNetIPSocketLine(fields []string) (*netIPSocketLine, error) { +func parseNetIPSocketLine(fields []string, isUDP bool) (*netIPSocketLine, error) { line := &netIPSocketLine{} - if len(fields) < 8 { + if len(fields) < 10 { return nil, fmt.Errorf( - "cannot parse net socket line as it has less then 8 columns %q", + "%w: Less than 10 columns found %q", + ErrFileParse, strings.Join(fields, " "), ) } @@ -161,59 +174,74 @@ func parseNetIPSocketLine(fields []string) (*netIPSocketLine, error) { // sl s := strings.Split(fields[0], ":") if len(s) != 2 { - return nil, fmt.Errorf("cannot parse sl field in socket line %q", fields[0]) + return nil, fmt.Errorf("%w: Unable to parse sl field in line %q", ErrFileParse, fields[0]) } if line.Sl, err = strconv.ParseUint(s[0], 0, 64); err != nil { - return nil, fmt.Errorf("cannot parse sl value in socket line: %w", err) + return nil, fmt.Errorf("%w: Unable to parse sl field in %q: %w", ErrFileParse, line.Sl, err) } // local_address l := strings.Split(fields[1], ":") if len(l) != 2 { - return nil, fmt.Errorf("cannot parse local_address field in socket line %q", fields[1]) + return nil, fmt.Errorf("%w: Unable to parse local_address field in %q", ErrFileParse, fields[1]) } if line.LocalAddr, err = parseIP(l[0]); err != nil { return nil, err } if line.LocalPort, err = strconv.ParseUint(l[1], 16, 64); err != nil { - return nil, fmt.Errorf("cannot parse local_address port value in socket line: %w", err) + return nil, fmt.Errorf("%w: Unable to parse local_address port value line %q: %w", ErrFileParse, line.LocalPort, err) } // remote_address r := strings.Split(fields[2], ":") if len(r) != 2 { - return nil, fmt.Errorf("cannot parse rem_address field in socket line %q", fields[1]) + return nil, fmt.Errorf("%w: Unable to parse rem_address field in %q", ErrFileParse, fields[1]) } if line.RemAddr, err = parseIP(r[0]); err != nil { return nil, err } if line.RemPort, err = strconv.ParseUint(r[1], 16, 64); err != nil { - return nil, fmt.Errorf("cannot parse rem_address port value in socket line: %w", err) + return nil, fmt.Errorf("%w: Cannot parse rem_address port value in %q: %w", ErrFileParse, line.RemPort, err) } // st if line.St, err = strconv.ParseUint(fields[3], 16, 64); err != nil { - return nil, fmt.Errorf("cannot parse st value in socket line: %w", err) + return nil, fmt.Errorf("%w: Cannot parse st value in %q: %w", ErrFileParse, line.St, err) } // tx_queue and rx_queue q := strings.Split(fields[4], ":") if len(q) != 2 { return nil, fmt.Errorf( - "cannot parse tx/rx queues in socket line as it has a missing colon %q", + "%w: Missing colon for tx/rx queues in socket line %q", + ErrFileParse, fields[4], ) } if line.TxQueue, err = strconv.ParseUint(q[0], 16, 64); err != nil { - return nil, fmt.Errorf("cannot parse tx_queue value in socket line: %w", err) + return nil, fmt.Errorf("%w: Cannot parse tx_queue value in %q: %w", ErrFileParse, line.TxQueue, err) } if line.RxQueue, err = strconv.ParseUint(q[1], 16, 64); err != nil { - return nil, fmt.Errorf("cannot parse rx_queue value in socket line: %w", err) + return nil, fmt.Errorf("%w: Cannot parse trx_queue value in %q: %w", ErrFileParse, line.RxQueue, err) } // uid if line.UID, err = strconv.ParseUint(fields[7], 0, 64); err != nil { - return nil, fmt.Errorf("cannot parse uid value in socket line: %w", err) + return nil, fmt.Errorf("%w: Cannot parse UID value in %q: %w", ErrFileParse, line.UID, err) + } + + // inode + if line.Inode, err = strconv.ParseUint(fields[9], 0, 64); err != nil { + return nil, fmt.Errorf("%w: Cannot parse inode value in %q: %w", ErrFileParse, line.Inode, err) + } + + // drops + if isUDP { + drops, err := strconv.ParseUint(fields[12], 0, 64) + if err != nil { + return nil, fmt.Errorf("%w: Cannot parse drops value in %q: %w", ErrFileParse, drops, err) + } + line.Drops = &drops } return line, nil diff --git a/vendor/github.com/prometheus/procfs/net_protocols.go b/vendor/github.com/prometheus/procfs/net_protocols.go index 8c6de3791b..b6c77b709f 100644 --- a/vendor/github.com/prometheus/procfs/net_protocols.go +++ b/vendor/github.com/prometheus/procfs/net_protocols.go @@ -23,7 +23,7 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// NetProtocolStats stores the contents from /proc/net/protocols +// NetProtocolStats stores the contents from /proc/net/protocols. type NetProtocolStats map[string]NetProtocolStatLine // NetProtocolStatLine contains a single line parsed from /proc/net/protocols. We @@ -41,7 +41,7 @@ type NetProtocolStatLine struct { Capabilities NetProtocolCapabilities } -// NetProtocolCapabilities contains a list of capabilities for each protocol +// NetProtocolCapabilities contains a list of capabilities for each protocol. type NetProtocolCapabilities struct { Close bool // 8 Connect bool // 9 @@ -131,7 +131,7 @@ func (ps NetProtocolStats) parseLine(rawLine string) (*NetProtocolStatLine, erro } else if fields[6] == disabled { line.Slab = false } else { - return nil, fmt.Errorf("unable to parse capability for protocol: %s", line.Name) + return nil, fmt.Errorf("%w: capability for protocol: %s", ErrFileParse, line.Name) } line.ModuleName = fields[7] @@ -173,7 +173,7 @@ func (pc *NetProtocolCapabilities) parseCapabilities(capabilities []string) erro } else if capabilities[i] == "n" { *capabilityFields[i] = false } else { - return fmt.Errorf("unable to parse capability block for protocol: position %d", i) + return fmt.Errorf("%w: capability block for protocol: position %d", ErrFileParse, i) } } return nil diff --git a/vendor/github.com/prometheus/procfs/net_route.go b/vendor/github.com/prometheus/procfs/net_route.go new file mode 100644 index 0000000000..deb7029fe1 --- /dev/null +++ b/vendor/github.com/prometheus/procfs/net_route.go @@ -0,0 +1,143 @@ +// Copyright 2023 The Prometheus 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 procfs + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strconv" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +const ( + blackholeRepresentation string = "*" + blackholeIfaceName string = "blackhole" + routeLineColumns int = 11 +) + +// A NetRouteLine represents one line from net/route. +type NetRouteLine struct { + Iface string + Destination uint32 + Gateway uint32 + Flags uint32 + RefCnt uint32 + Use uint32 + Metric uint32 + Mask uint32 + MTU uint32 + Window uint32 + IRTT uint32 +} + +func (fs FS) NetRoute() ([]NetRouteLine, error) { + return readNetRoute(fs.proc.Path("net", "route")) +} + +func readNetRoute(path string) ([]NetRouteLine, error) { + b, err := util.ReadFileNoStat(path) + if err != nil { + return nil, err + } + + routelines, err := parseNetRoute(bytes.NewReader(b)) + if err != nil { + return nil, fmt.Errorf("failed to read net route from %s: %w", path, err) + } + return routelines, nil +} + +func parseNetRoute(r io.Reader) ([]NetRouteLine, error) { + var routelines []NetRouteLine + + scanner := bufio.NewScanner(r) + scanner.Scan() + for scanner.Scan() { + fields := strings.Fields(scanner.Text()) + routeline, err := parseNetRouteLine(fields) + if err != nil { + return nil, err + } + routelines = append(routelines, *routeline) + } + return routelines, nil +} + +func parseNetRouteLine(fields []string) (*NetRouteLine, error) { + if len(fields) != routeLineColumns { + return nil, fmt.Errorf("invalid routeline, num of digits: %d", len(fields)) + } + iface := fields[0] + if iface == blackholeRepresentation { + iface = blackholeIfaceName + } + destination, err := strconv.ParseUint(fields[1], 16, 32) + if err != nil { + return nil, err + } + gateway, err := strconv.ParseUint(fields[2], 16, 32) + if err != nil { + return nil, err + } + flags, err := strconv.ParseUint(fields[3], 10, 32) + if err != nil { + return nil, err + } + refcnt, err := strconv.ParseUint(fields[4], 10, 32) + if err != nil { + return nil, err + } + use, err := strconv.ParseUint(fields[5], 10, 32) + if err != nil { + return nil, err + } + metric, err := strconv.ParseUint(fields[6], 10, 32) + if err != nil { + return nil, err + } + mask, err := strconv.ParseUint(fields[7], 16, 32) + if err != nil { + return nil, err + } + mtu, err := strconv.ParseUint(fields[8], 10, 32) + if err != nil { + return nil, err + } + window, err := strconv.ParseUint(fields[9], 10, 32) + if err != nil { + return nil, err + } + irtt, err := strconv.ParseUint(fields[10], 10, 32) + if err != nil { + return nil, err + } + routeline := &NetRouteLine{ + Iface: iface, + Destination: uint32(destination), + Gateway: uint32(gateway), + Flags: uint32(flags), + RefCnt: uint32(refcnt), + Use: uint32(use), + Metric: uint32(metric), + Mask: uint32(mask), + MTU: uint32(mtu), + Window: uint32(window), + IRTT: uint32(irtt), + } + return routeline, nil +} diff --git a/vendor/github.com/prometheus/procfs/net_sockstat.go b/vendor/github.com/prometheus/procfs/net_sockstat.go index e36f4872dd..fae62b13d9 100644 --- a/vendor/github.com/prometheus/procfs/net_sockstat.go +++ b/vendor/github.com/prometheus/procfs/net_sockstat.go @@ -16,7 +16,6 @@ package procfs import ( "bufio" "bytes" - "errors" "fmt" "io" "strings" @@ -70,7 +69,7 @@ func readSockstat(name string) (*NetSockstat, error) { stat, err := parseSockstat(bytes.NewReader(b)) if err != nil { - return nil, fmt.Errorf("failed to read sockstats from %q: %w", name, err) + return nil, fmt.Errorf("%w: sockstats from %q: %w", ErrFileRead, name, err) } return stat, nil @@ -84,13 +83,13 @@ func parseSockstat(r io.Reader) (*NetSockstat, error) { // Expect a minimum of a protocol and one key/value pair. fields := strings.Split(s.Text(), " ") if len(fields) < 3 { - return nil, fmt.Errorf("malformed sockstat line: %q", s.Text()) + return nil, fmt.Errorf("%w: Malformed sockstat line: %q", ErrFileParse, s.Text()) } // The remaining fields are key/value pairs. kvs, err := parseSockstatKVs(fields[1:]) if err != nil { - return nil, fmt.Errorf("error parsing sockstat key/value pairs from %q: %w", s.Text(), err) + return nil, fmt.Errorf("%w: sockstat key/value pairs from %q: %w", ErrFileParse, s.Text(), err) } // The first field is the protocol. We must trim its colon suffix. @@ -119,7 +118,7 @@ func parseSockstat(r io.Reader) (*NetSockstat, error) { // parseSockstatKVs parses a string slice into a map of key/value pairs. func parseSockstatKVs(kvs []string) (map[string]int, error) { if len(kvs)%2 != 0 { - return nil, errors.New("odd number of fields in key/value pairs") + return nil, fmt.Errorf("%w:: Odd number of fields in key/value pairs %q", ErrFileParse, kvs) } // Iterate two values at a time to gather key/value pairs. diff --git a/vendor/github.com/prometheus/procfs/net_softnet.go b/vendor/github.com/prometheus/procfs/net_softnet.go index 46f12c61d3..71c8059f4d 100644 --- a/vendor/github.com/prometheus/procfs/net_softnet.go +++ b/vendor/github.com/prometheus/procfs/net_softnet.go @@ -27,17 +27,30 @@ import ( // For the proc file format details, // See: // * Linux 2.6.23 https://elixir.bootlin.com/linux/v2.6.23/source/net/core/dev.c#L2343 -// * Linux 4.17 https://elixir.bootlin.com/linux/v4.17/source/net/core/net-procfs.c#L162 -// and https://elixir.bootlin.com/linux/v4.17/source/include/linux/netdevice.h#L2810. +// * Linux 2.6.39 https://elixir.bootlin.com/linux/v2.6.39/source/net/core/dev.c#L4086 +// * Linux 4.18 https://elixir.bootlin.com/linux/v4.18/source/net/core/net-procfs.c#L162 +// * Linux 5.14 https://elixir.bootlin.com/linux/v5.14/source/net/core/net-procfs.c#L169 -// SoftnetStat contains a single row of data from /proc/net/softnet_stat +// SoftnetStat contains a single row of data from /proc/net/softnet_stat. type SoftnetStat struct { - // Number of processed packets + // Number of processed packets. Processed uint32 - // Number of dropped packets + // Number of dropped packets. Dropped uint32 - // Number of times processing packets ran out of quota + // Number of times processing packets ran out of quota. TimeSqueezed uint32 + // Number of collision occur while obtaining device lock while transmitting. + CPUCollision uint32 + // Number of times cpu woken up received_rps. + ReceivedRps uint32 + // number of times flow limit has been reached. + FlowLimitCount uint32 + // Softnet backlog status. + SoftnetBacklogLen uint32 + // CPU id owning this softnet_data. + Index uint32 + // softnet_data's Width. + Width int } var softNetProcFile = "net/softnet_stat" @@ -51,7 +64,7 @@ func (fs FS) NetSoftnetStat() ([]SoftnetStat, error) { entries, err := parseSoftnet(bytes.NewReader(b)) if err != nil { - return nil, fmt.Errorf("failed to parse /proc/net/softnet_stat: %w", err) + return nil, fmt.Errorf("%w: /proc/net/softnet_stat: %w", ErrFileParse, err) } return entries, nil @@ -63,25 +76,65 @@ func parseSoftnet(r io.Reader) ([]SoftnetStat, error) { s := bufio.NewScanner(r) var stats []SoftnetStat + cpuIndex := 0 for s.Scan() { columns := strings.Fields(s.Text()) width := len(columns) + softnetStat := SoftnetStat{} if width < minColumns { - return nil, fmt.Errorf("%d columns were detected, but at least %d were expected", width, minColumns) + return nil, fmt.Errorf("%w: detected %d columns, but expected at least %d", ErrFileParse, width, minColumns) } - // We only parse the first three columns at the moment. - us, err := parseHexUint32s(columns[0:3]) - if err != nil { - return nil, err + // Linux 2.6.23 https://elixir.bootlin.com/linux/v2.6.23/source/net/core/dev.c#L2347 + if width >= minColumns { + us, err := parseHexUint32s(columns[0:9]) + if err != nil { + return nil, err + } + + softnetStat.Processed = us[0] + softnetStat.Dropped = us[1] + softnetStat.TimeSqueezed = us[2] + softnetStat.CPUCollision = us[8] + } + + // Linux 2.6.39 https://elixir.bootlin.com/linux/v2.6.39/source/net/core/dev.c#L4086 + if width >= 10 { + us, err := parseHexUint32s(columns[9:10]) + if err != nil { + return nil, err + } + + softnetStat.ReceivedRps = us[0] } - stats = append(stats, SoftnetStat{ - Processed: us[0], - Dropped: us[1], - TimeSqueezed: us[2], - }) + // Linux 4.18 https://elixir.bootlin.com/linux/v4.18/source/net/core/net-procfs.c#L162 + if width >= 11 { + us, err := parseHexUint32s(columns[10:11]) + if err != nil { + return nil, err + } + + softnetStat.FlowLimitCount = us[0] + } + + // Linux 5.14 https://elixir.bootlin.com/linux/v5.14/source/net/core/net-procfs.c#L169 + if width >= 13 { + us, err := parseHexUint32s(columns[11:13]) + if err != nil { + return nil, err + } + + softnetStat.SoftnetBacklogLen = us[0] + softnetStat.Index = us[1] + } else { + // For older kernels, create the Index based on the scan line number. + softnetStat.Index = uint32(cpuIndex) + } + softnetStat.Width = width + stats = append(stats, softnetStat) + cpuIndex++ } return stats, nil diff --git a/vendor/github.com/prometheus/procfs/net_tls_stat.go b/vendor/github.com/prometheus/procfs/net_tls_stat.go new file mode 100644 index 0000000000..13994c1782 --- /dev/null +++ b/vendor/github.com/prometheus/procfs/net_tls_stat.go @@ -0,0 +1,119 @@ +// Copyright 2023 Prometheus Team +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 procfs + +import ( + "bufio" + "fmt" + "os" + "strconv" + "strings" +) + +// TLSStat struct represents data in /proc/net/tls_stat. +// See https://docs.kernel.org/networking/tls.html#statistics +type TLSStat struct { + // number of TX sessions currently installed where host handles cryptography + TLSCurrTxSw int + // number of RX sessions currently installed where host handles cryptography + TLSCurrRxSw int + // number of TX sessions currently installed where NIC handles cryptography + TLSCurrTxDevice int + // number of RX sessions currently installed where NIC handles cryptography + TLSCurrRxDevice int + //number of TX sessions opened with host cryptography + TLSTxSw int + //number of RX sessions opened with host cryptography + TLSRxSw int + // number of TX sessions opened with NIC cryptography + TLSTxDevice int + // number of RX sessions opened with NIC cryptography + TLSRxDevice int + // record decryption failed (e.g. due to incorrect authentication tag) + TLSDecryptError int + // number of RX resyncs sent to NICs handling cryptography + TLSRxDeviceResync int + // number of RX records which had to be re-decrypted due to TLS_RX_EXPECT_NO_PAD mis-prediction. Note that this counter will also increment for non-data records. + TLSDecryptRetry int + // number of data RX records which had to be re-decrypted due to TLS_RX_EXPECT_NO_PAD mis-prediction. + TLSRxNoPadViolation int +} + +// NewTLSStat reads the tls_stat statistics. +func NewTLSStat() (TLSStat, error) { + fs, err := NewFS(DefaultMountPoint) + if err != nil { + return TLSStat{}, err + } + + return fs.NewTLSStat() +} + +// NewTLSStat reads the tls_stat statistics. +func (fs FS) NewTLSStat() (TLSStat, error) { + file, err := os.Open(fs.proc.Path("net/tls_stat")) + if err != nil { + return TLSStat{}, err + } + defer file.Close() + + var ( + tlsstat = TLSStat{} + s = bufio.NewScanner(file) + ) + + for s.Scan() { + fields := strings.Fields(s.Text()) + + if len(fields) != 2 { + return TLSStat{}, fmt.Errorf("%w: %q line %q", ErrFileParse, file.Name(), s.Text()) + } + + name := fields[0] + value, err := strconv.Atoi(fields[1]) + if err != nil { + return TLSStat{}, err + } + + switch name { + case "TlsCurrTxSw": + tlsstat.TLSCurrTxSw = value + case "TlsCurrRxSw": + tlsstat.TLSCurrRxSw = value + case "TlsCurrTxDevice": + tlsstat.TLSCurrTxDevice = value + case "TlsCurrRxDevice": + tlsstat.TLSCurrRxDevice = value + case "TlsTxSw": + tlsstat.TLSTxSw = value + case "TlsRxSw": + tlsstat.TLSRxSw = value + case "TlsTxDevice": + tlsstat.TLSTxDevice = value + case "TlsRxDevice": + tlsstat.TLSRxDevice = value + case "TlsDecryptError": + tlsstat.TLSDecryptError = value + case "TlsRxDeviceResync": + tlsstat.TLSRxDeviceResync = value + case "TlsDecryptRetry": + tlsstat.TLSDecryptRetry = value + case "TlsRxNoPadViolation": + tlsstat.TLSRxNoPadViolation = value + } + + } + + return tlsstat, s.Err() +} diff --git a/vendor/github.com/prometheus/procfs/net_unix.go b/vendor/github.com/prometheus/procfs/net_unix.go index 98aa8e1c31..d868cebdaa 100644 --- a/vendor/github.com/prometheus/procfs/net_unix.go +++ b/vendor/github.com/prometheus/procfs/net_unix.go @@ -108,14 +108,14 @@ func parseNetUNIX(r io.Reader) (*NetUNIX, error) { line := s.Text() item, err := nu.parseLine(line, hasInode, minFields) if err != nil { - return nil, fmt.Errorf("failed to parse /proc/net/unix data %q: %w", line, err) + return nil, fmt.Errorf("%w: /proc/net/unix encountered data %q: %w", ErrFileParse, line, err) } nu.Rows = append(nu.Rows, item) } if err := s.Err(); err != nil { - return nil, fmt.Errorf("failed to scan /proc/net/unix data: %w", err) + return nil, fmt.Errorf("%w: /proc/net/unix encountered data: %w", ErrFileParse, err) } return &nu, nil @@ -126,7 +126,7 @@ func (u *NetUNIX) parseLine(line string, hasInode bool, min int) (*NetUNIXLine, l := len(fields) if l < min { - return nil, fmt.Errorf("expected at least %d fields but got %d", min, l) + return nil, fmt.Errorf("%w: expected at least %d fields but got %d", ErrFileParse, min, l) } // Field offsets are as follows: @@ -136,29 +136,29 @@ func (u *NetUNIX) parseLine(line string, hasInode bool, min int) (*NetUNIXLine, users, err := u.parseUsers(fields[1]) if err != nil { - return nil, fmt.Errorf("failed to parse ref count %q: %w", fields[1], err) + return nil, fmt.Errorf("%w: ref count %q: %w", ErrFileParse, fields[1], err) } flags, err := u.parseFlags(fields[3]) if err != nil { - return nil, fmt.Errorf("failed to parse flags %q: %w", fields[3], err) + return nil, fmt.Errorf("%w: Unable to parse flags %q: %w", ErrFileParse, fields[3], err) } typ, err := u.parseType(fields[4]) if err != nil { - return nil, fmt.Errorf("failed to parse type %q: %w", fields[4], err) + return nil, fmt.Errorf("%w: Failed to parse type %q: %w", ErrFileParse, fields[4], err) } state, err := u.parseState(fields[5]) if err != nil { - return nil, fmt.Errorf("failed to parse state %q: %w", fields[5], err) + return nil, fmt.Errorf("%w: Failed to parse state %q: %w", ErrFileParse, fields[5], err) } var inode uint64 if hasInode { inode, err = u.parseInode(fields[6]) if err != nil { - return nil, fmt.Errorf("failed to parse inode %q: %w", fields[6], err) + return nil, fmt.Errorf("%w failed to parse inode %q: %w", ErrFileParse, fields[6], err) } } diff --git a/vendor/github.com/prometheus/procfs/net_wireless.go b/vendor/github.com/prometheus/procfs/net_wireless.go new file mode 100644 index 0000000000..7c597bc870 --- /dev/null +++ b/vendor/github.com/prometheus/procfs/net_wireless.go @@ -0,0 +1,182 @@ +// Copyright 2023 The Prometheus 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 procfs + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strconv" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +// Wireless models the content of /proc/net/wireless. +type Wireless struct { + Name string + + // Status is the current 4-digit hex value status of the interface. + Status uint64 + + // QualityLink is the link quality. + QualityLink int + + // QualityLevel is the signal gain (dBm). + QualityLevel int + + // QualityNoise is the signal noise baseline (dBm). + QualityNoise int + + // DiscardedNwid is the number of discarded packets with wrong nwid/essid. + DiscardedNwid int + + // DiscardedCrypt is the number of discarded packets with wrong code/decode (WEP). + DiscardedCrypt int + + // DiscardedFrag is the number of discarded packets that can't perform MAC reassembly. + DiscardedFrag int + + // DiscardedRetry is the number of discarded packets that reached max MAC retries. + DiscardedRetry int + + // DiscardedMisc is the number of discarded packets for other reasons. + DiscardedMisc int + + // MissedBeacon is the number of missed beacons/superframe. + MissedBeacon int +} + +// Wireless returns kernel wireless statistics. +func (fs FS) Wireless() ([]*Wireless, error) { + b, err := util.ReadFileNoStat(fs.proc.Path("net/wireless")) + if err != nil { + return nil, err + } + + m, err := parseWireless(bytes.NewReader(b)) + if err != nil { + return nil, fmt.Errorf("%w: wireless: %w", ErrFileParse, err) + } + + return m, nil +} + +// parseWireless parses the contents of /proc/net/wireless. +/* +Inter-| sta-| Quality | Discarded packets | Missed | WE +face | tus | link level noise | nwid crypt frag retry misc | beacon | 22 + eth1: 0000 5. -256. -10. 0 1 0 3 0 0 + eth2: 0000 5. -256. -20. 0 2 0 4 0 0 +*/ +func parseWireless(r io.Reader) ([]*Wireless, error) { + var ( + interfaces []*Wireless + scanner = bufio.NewScanner(r) + ) + + for n := 0; scanner.Scan(); n++ { + // Skip the 2 header lines. + if n < 2 { + continue + } + + line := scanner.Text() + + parts := strings.Split(line, ":") + if len(parts) != 2 { + return nil, fmt.Errorf("%w: expected 2 parts after splitting line by ':', got %d for line %q", ErrFileParse, len(parts), line) + } + + name := strings.TrimSpace(parts[0]) + stats := strings.Fields(parts[1]) + + if len(stats) < 10 { + return nil, fmt.Errorf("%w: invalid number of fields in line %d, expected 10+, got %d: %q", ErrFileParse, n, len(stats), line) + } + + status, err := strconv.ParseUint(stats[0], 16, 16) + if err != nil { + return nil, fmt.Errorf("%w: invalid status in line %d: %q", ErrFileParse, n, line) + } + + qlink, err := strconv.Atoi(strings.TrimSuffix(stats[1], ".")) + if err != nil { + return nil, fmt.Errorf("%w: parse Quality:link as integer %q: %w", ErrFileParse, qlink, err) + } + + qlevel, err := strconv.Atoi(strings.TrimSuffix(stats[2], ".")) + if err != nil { + return nil, fmt.Errorf("%w: Quality:level as integer %q: %w", ErrFileParse, qlevel, err) + } + + qnoise, err := strconv.Atoi(strings.TrimSuffix(stats[3], ".")) + if err != nil { + return nil, fmt.Errorf("%w: Quality:noise as integer %q: %w", ErrFileParse, qnoise, err) + } + + dnwid, err := strconv.Atoi(stats[4]) + if err != nil { + return nil, fmt.Errorf("%w: Discarded:nwid as integer %q: %w", ErrFileParse, dnwid, err) + } + + dcrypt, err := strconv.Atoi(stats[5]) + if err != nil { + return nil, fmt.Errorf("%w: Discarded:crypt as integer %q: %w", ErrFileParse, dcrypt, err) + } + + dfrag, err := strconv.Atoi(stats[6]) + if err != nil { + return nil, fmt.Errorf("%w: Discarded:frag as integer %q: %w", ErrFileParse, dfrag, err) + } + + dretry, err := strconv.Atoi(stats[7]) + if err != nil { + return nil, fmt.Errorf("%w: Discarded:retry as integer %q: %w", ErrFileParse, dretry, err) + } + + dmisc, err := strconv.Atoi(stats[8]) + if err != nil { + return nil, fmt.Errorf("%w: Discarded:misc as integer %q: %w", ErrFileParse, dmisc, err) + } + + mbeacon, err := strconv.Atoi(stats[9]) + if err != nil { + return nil, fmt.Errorf("%w: Missed:beacon as integer %q: %w", ErrFileParse, mbeacon, err) + } + + w := &Wireless{ + Name: name, + Status: status, + QualityLink: qlink, + QualityLevel: qlevel, + QualityNoise: qnoise, + DiscardedNwid: dnwid, + DiscardedCrypt: dcrypt, + DiscardedFrag: dfrag, + DiscardedRetry: dretry, + DiscardedMisc: dmisc, + MissedBeacon: mbeacon, + } + + interfaces = append(interfaces, w) + } + + if err := scanner.Err(); err != nil { + return nil, fmt.Errorf("%w: Failed to scan /proc/net/wireless: %w", ErrFileRead, err) + } + + return interfaces, nil +} diff --git a/vendor/github.com/prometheus/procfs/net_xfrm.go b/vendor/github.com/prometheus/procfs/net_xfrm.go new file mode 100644 index 0000000000..932ef20468 --- /dev/null +++ b/vendor/github.com/prometheus/procfs/net_xfrm.go @@ -0,0 +1,189 @@ +// Copyright 2017 Prometheus Team +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 procfs + +import ( + "bufio" + "fmt" + "os" + "strconv" + "strings" +) + +// XfrmStat models the contents of /proc/net/xfrm_stat. +type XfrmStat struct { + // All errors which are not matched by other + XfrmInError int + // No buffer is left + XfrmInBufferError int + // Header Error + XfrmInHdrError int + // No state found + // i.e. either inbound SPI, address, or IPSEC protocol at SA is wrong + XfrmInNoStates int + // Transformation protocol specific error + // e.g. SA Key is wrong + XfrmInStateProtoError int + // Transformation mode specific error + XfrmInStateModeError int + // Sequence error + // e.g. sequence number is out of window + XfrmInStateSeqError int + // State is expired + XfrmInStateExpired int + // State has mismatch option + // e.g. UDP encapsulation type is mismatched + XfrmInStateMismatch int + // State is invalid + XfrmInStateInvalid int + // No matching template for states + // e.g. Inbound SAs are correct but SP rule is wrong + XfrmInTmplMismatch int + // No policy is found for states + // e.g. Inbound SAs are correct but no SP is found + XfrmInNoPols int + // Policy discards + XfrmInPolBlock int + // Policy error + XfrmInPolError int + // All errors which are not matched by others + XfrmOutError int + // Bundle generation error + XfrmOutBundleGenError int + // Bundle check error + XfrmOutBundleCheckError int + // No state was found + XfrmOutNoStates int + // Transformation protocol specific error + XfrmOutStateProtoError int + // Transportation mode specific error + XfrmOutStateModeError int + // Sequence error + // i.e sequence number overflow + XfrmOutStateSeqError int + // State is expired + XfrmOutStateExpired int + // Policy discads + XfrmOutPolBlock int + // Policy is dead + XfrmOutPolDead int + // Policy Error + XfrmOutPolError int + // Forward routing of a packet is not allowed + XfrmFwdHdrError int + // State is invalid, perhaps expired + XfrmOutStateInvalid int + // State hasn’t been fully acquired before use + XfrmAcquireError int +} + +// NewXfrmStat reads the xfrm_stat statistics. +func NewXfrmStat() (XfrmStat, error) { + fs, err := NewFS(DefaultMountPoint) + if err != nil { + return XfrmStat{}, err + } + + return fs.NewXfrmStat() +} + +// NewXfrmStat reads the xfrm_stat statistics from the 'proc' filesystem. +func (fs FS) NewXfrmStat() (XfrmStat, error) { + file, err := os.Open(fs.proc.Path("net/xfrm_stat")) + if err != nil { + return XfrmStat{}, err + } + defer file.Close() + + var ( + x = XfrmStat{} + s = bufio.NewScanner(file) + ) + + for s.Scan() { + fields := strings.Fields(s.Text()) + + if len(fields) != 2 { + return XfrmStat{}, fmt.Errorf("%w: %q line %q", ErrFileParse, file.Name(), s.Text()) + } + + name := fields[0] + value, err := strconv.Atoi(fields[1]) + if err != nil { + return XfrmStat{}, err + } + + switch name { + case "XfrmInError": + x.XfrmInError = value + case "XfrmInBufferError": + x.XfrmInBufferError = value + case "XfrmInHdrError": + x.XfrmInHdrError = value + case "XfrmInNoStates": + x.XfrmInNoStates = value + case "XfrmInStateProtoError": + x.XfrmInStateProtoError = value + case "XfrmInStateModeError": + x.XfrmInStateModeError = value + case "XfrmInStateSeqError": + x.XfrmInStateSeqError = value + case "XfrmInStateExpired": + x.XfrmInStateExpired = value + case "XfrmInStateInvalid": + x.XfrmInStateInvalid = value + case "XfrmInTmplMismatch": + x.XfrmInTmplMismatch = value + case "XfrmInNoPols": + x.XfrmInNoPols = value + case "XfrmInPolBlock": + x.XfrmInPolBlock = value + case "XfrmInPolError": + x.XfrmInPolError = value + case "XfrmOutError": + x.XfrmOutError = value + case "XfrmInStateMismatch": + x.XfrmInStateMismatch = value + case "XfrmOutBundleGenError": + x.XfrmOutBundleGenError = value + case "XfrmOutBundleCheckError": + x.XfrmOutBundleCheckError = value + case "XfrmOutNoStates": + x.XfrmOutNoStates = value + case "XfrmOutStateProtoError": + x.XfrmOutStateProtoError = value + case "XfrmOutStateModeError": + x.XfrmOutStateModeError = value + case "XfrmOutStateSeqError": + x.XfrmOutStateSeqError = value + case "XfrmOutStateExpired": + x.XfrmOutStateExpired = value + case "XfrmOutPolBlock": + x.XfrmOutPolBlock = value + case "XfrmOutPolDead": + x.XfrmOutPolDead = value + case "XfrmOutPolError": + x.XfrmOutPolError = value + case "XfrmFwdHdrError": + x.XfrmFwdHdrError = value + case "XfrmOutStateInvalid": + x.XfrmOutStateInvalid = value + case "XfrmAcquireError": + x.XfrmAcquireError = value + } + + } + + return x, s.Err() +} diff --git a/vendor/github.com/prometheus/procfs/netstat.go b/vendor/github.com/prometheus/procfs/netstat.go new file mode 100644 index 0000000000..742dff453b --- /dev/null +++ b/vendor/github.com/prometheus/procfs/netstat.go @@ -0,0 +1,82 @@ +// Copyright 2020 The Prometheus 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 procfs + +import ( + "bufio" + "os" + "path/filepath" + "strconv" + "strings" +) + +// NetStat contains statistics for all the counters from one file. +type NetStat struct { + Stats map[string][]uint64 + Filename string +} + +// NetStat retrieves stats from `/proc/net/stat/`. +func (fs FS) NetStat() ([]NetStat, error) { + statFiles, err := filepath.Glob(fs.proc.Path("net/stat/*")) + if err != nil { + return nil, err + } + + var netStatsTotal []NetStat + + for _, filePath := range statFiles { + procNetstat, err := parseNetstat(filePath) + if err != nil { + return nil, err + } + procNetstat.Filename = filepath.Base(filePath) + + netStatsTotal = append(netStatsTotal, procNetstat) + } + return netStatsTotal, nil +} + +// parseNetstat parses the metrics from `/proc/net/stat/` file +// and returns a NetStat structure. +func parseNetstat(filePath string) (NetStat, error) { + netStat := NetStat{ + Stats: make(map[string][]uint64), + } + file, err := os.Open(filePath) + if err != nil { + return netStat, err + } + defer file.Close() + + scanner := bufio.NewScanner(file) + scanner.Scan() + + // First string is always a header for stats + var headers []string + headers = append(headers, strings.Fields(scanner.Text())...) + + // Other strings represent per-CPU counters + for scanner.Scan() { + for num, counter := range strings.Fields(scanner.Text()) { + value, err := strconv.ParseUint(counter, 16, 64) + if err != nil { + return NetStat{}, err + } + netStat.Stats[headers[num]] = append(netStat.Stats[headers[num]], value) + } + } + + return netStat, nil +} diff --git a/vendor/github.com/prometheus/procfs/proc.go b/vendor/github.com/prometheus/procfs/proc.go index 28f696803f..142796368f 100644 --- a/vendor/github.com/prometheus/procfs/proc.go +++ b/vendor/github.com/prometheus/procfs/proc.go @@ -15,13 +15,13 @@ package procfs import ( "bytes" + "errors" "fmt" - "io/ioutil" + "io" "os" "strconv" "strings" - "github.com/prometheus/procfs/internal/fs" "github.com/prometheus/procfs/internal/util" ) @@ -30,12 +30,18 @@ type Proc struct { // The process ID. PID int - fs fs.FS + fs FS } // Procs represents a list of Proc structs. type Procs []Proc +var ( + ErrFileParse = errors.New("Error Parsing File") + ErrFileRead = errors.New("Error Reading File") + ErrMountPoint = errors.New("Error Accessing Mount point") +) + func (p Procs) Len() int { return len(p) } func (p Procs) Swap(i, j int) { p[i], p[j] = p[j], p[i] } func (p Procs) Less(i, j int) bool { return p[i].PID < p[j].PID } @@ -43,7 +49,7 @@ func (p Procs) Less(i, j int) bool { return p[i].PID < p[j].PID } // Self returns a process for the current process read via /proc/self. func Self() (Proc, error) { fs, err := NewFS(DefaultMountPoint) - if err != nil { + if err != nil || errors.Unwrap(err) == ErrMountPoint { return Proc{}, err } return fs.Self() @@ -82,7 +88,7 @@ func (fs FS) Self() (Proc, error) { // NewProc returns a process for the given pid. // -// Deprecated: use fs.Proc() instead +// Deprecated: Use fs.Proc() instead. func (fs FS) NewProc(pid int) (Proc, error) { return fs.Proc(pid) } @@ -92,7 +98,7 @@ func (fs FS) Proc(pid int) (Proc, error) { if _, err := os.Stat(fs.proc.Path(strconv.Itoa(pid))); err != nil { return Proc{}, err } - return Proc{PID: pid, fs: fs.proc}, nil + return Proc{PID: pid, fs: fs}, nil } // AllProcs returns a list of all currently available processes. @@ -105,7 +111,7 @@ func (fs FS) AllProcs() (Procs, error) { names, err := d.Readdirnames(-1) if err != nil { - return Procs{}, fmt.Errorf("could not read %q: %w", d.Name(), err) + return Procs{}, fmt.Errorf("%w: Cannot read file: %v: %w", ErrFileRead, names, err) } p := Procs{} @@ -114,7 +120,7 @@ func (fs FS) AllProcs() (Procs, error) { if err != nil { continue } - p = append(p, Proc{PID: int(pid), fs: fs.proc}) + p = append(p, Proc{PID: int(pid), fs: fs}) } return p, nil @@ -131,7 +137,7 @@ func (p Proc) CmdLine() ([]string, error) { return []string{}, nil } - return strings.Split(string(bytes.TrimRight(data, string("\x00"))), string(byte(0))), nil + return strings.Split(string(bytes.TrimRight(data, "\x00")), "\x00"), nil } // Wchan returns the wchan (wait channel) of a process. @@ -142,7 +148,7 @@ func (p Proc) Wchan() (string, error) { } defer f.Close() - data, err := ioutil.ReadAll(f) + data, err := io.ReadAll(f) if err != nil { return "", err } @@ -185,7 +191,7 @@ func (p Proc) Cwd() (string, error) { return wd, err } -// RootDir returns the absolute path to the process's root directory (as set by chroot) +// RootDir returns the absolute path to the process's root directory (as set by chroot). func (p Proc) RootDir() (string, error) { rdir, err := os.Readlink(p.path("root")) if os.IsNotExist(err) { @@ -206,7 +212,7 @@ func (p Proc) FileDescriptors() ([]uintptr, error) { for i, n := range names { fd, err := strconv.ParseInt(n, 10, 32) if err != nil { - return nil, fmt.Errorf("could not parse fd %q: %w", n, err) + return nil, fmt.Errorf("%w: Cannot parse line: %v: %w", ErrFileParse, i, err) } fds[i] = uintptr(fd) } @@ -237,6 +243,19 @@ func (p Proc) FileDescriptorTargets() ([]string, error) { // FileDescriptorsLen returns the number of currently open file descriptors of // a process. func (p Proc) FileDescriptorsLen() (int, error) { + // Use fast path if available (Linux v6.2): https://github.com/torvalds/linux/commit/f1f1f2569901 + if p.fs.isReal { + stat, err := os.Stat(p.path("fd")) + if err != nil { + return 0, err + } + + size := stat.Size() + if size > 0 { + return int(size), nil + } + } + fds, err := p.fileDescriptors() if err != nil { return 0, err @@ -278,14 +297,14 @@ func (p Proc) fileDescriptors() ([]string, error) { names, err := d.Readdirnames(-1) if err != nil { - return nil, fmt.Errorf("could not read %q: %w", d.Name(), err) + return nil, fmt.Errorf("%w: Cannot read file: %v: %w", ErrFileRead, names, err) } return names, nil } func (p Proc) path(pa ...string) string { - return p.fs.Path(append([]string{strconv.Itoa(p.PID)}, pa...)...) + return p.fs.proc.Path(append([]string{strconv.Itoa(p.PID)}, pa...)...) } // FileDescriptorsInfo retrieves information about all file descriptors of @@ -311,7 +330,7 @@ func (p Proc) FileDescriptorsInfo() (ProcFDInfos, error) { // Schedstat returns task scheduling information for the process. func (p Proc) Schedstat() (ProcSchedstat, error) { - contents, err := ioutil.ReadFile(p.path("schedstat")) + contents, err := os.ReadFile(p.path("schedstat")) if err != nil { return ProcSchedstat{}, err } diff --git a/vendor/github.com/prometheus/procfs/proc_cgroup.go b/vendor/github.com/prometheus/procfs/proc_cgroup.go index 0094a13c05..daeed7f571 100644 --- a/vendor/github.com/prometheus/procfs/proc_cgroup.go +++ b/vendor/github.com/prometheus/procfs/proc_cgroup.go @@ -23,7 +23,7 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// Cgroup models one line from /proc/[pid]/cgroup. Each Cgroup struct describes the the placement of a PID inside a +// Cgroup models one line from /proc/[pid]/cgroup. Each Cgroup struct describes the placement of a PID inside a // specific control hierarchy. The kernel has two cgroup APIs, v1 and v2. v1 has one hierarchy per available resource // controller, while v2 has one unified hierarchy shared by all controllers. Regardless of v1 or v2, all hierarchies // contain all running processes, so the question answerable with a Cgroup struct is 'where is this process in @@ -45,13 +45,13 @@ type Cgroup struct { } // parseCgroupString parses each line of the /proc/[pid]/cgroup file -// Line format is hierarchyID:[controller1,controller2]:path +// Line format is hierarchyID:[controller1,controller2]:path. func parseCgroupString(cgroupStr string) (*Cgroup, error) { var err error fields := strings.SplitN(cgroupStr, ":", 3) if len(fields) < 3 { - return nil, fmt.Errorf("at least 3 fields required, found %d fields in cgroup string: %s", len(fields), cgroupStr) + return nil, fmt.Errorf("%w: 3+ fields required, found %d fields in cgroup string: %s", ErrFileParse, len(fields), cgroupStr) } cgroup := &Cgroup{ @@ -60,7 +60,7 @@ func parseCgroupString(cgroupStr string) (*Cgroup, error) { } cgroup.HierarchyID, err = strconv.Atoi(fields[0]) if err != nil { - return nil, fmt.Errorf("failed to parse hierarchy ID") + return nil, fmt.Errorf("%w: hierarchy ID: %q", ErrFileParse, cgroup.HierarchyID) } if fields[1] != "" { ssNames := strings.Split(fields[1], ",") @@ -69,7 +69,7 @@ func parseCgroupString(cgroupStr string) (*Cgroup, error) { return cgroup, nil } -// parseCgroups reads each line of the /proc/[pid]/cgroup file +// parseCgroups reads each line of the /proc/[pid]/cgroup file. func parseCgroups(data []byte) ([]Cgroup, error) { var cgroups []Cgroup scanner := bufio.NewScanner(bytes.NewReader(data)) @@ -88,9 +88,9 @@ func parseCgroups(data []byte) ([]Cgroup, error) { // Cgroups reads from /proc//cgroups and returns a []*Cgroup struct locating this PID in each process // control hierarchy running on this system. On every system (v1 and v2), all hierarchies contain all processes, -// so the len of the returned struct is equal to the number of active hierarchies on this system +// so the len of the returned struct is equal to the number of active hierarchies on this system. func (p Proc) Cgroups() ([]Cgroup, error) { - data, err := util.ReadFileNoStat(fmt.Sprintf("/proc/%d/cgroup", p.PID)) + data, err := util.ReadFileNoStat(p.path("cgroup")) if err != nil { return nil, err } diff --git a/vendor/github.com/prometheus/procfs/proc_cgroups.go b/vendor/github.com/prometheus/procfs/proc_cgroups.go new file mode 100644 index 0000000000..5dd4938999 --- /dev/null +++ b/vendor/github.com/prometheus/procfs/proc_cgroups.go @@ -0,0 +1,98 @@ +// Copyright 2021 The Prometheus 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 procfs + +import ( + "bufio" + "bytes" + "fmt" + "strconv" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +// CgroupSummary models one line from /proc/cgroups. +// This file contains information about the controllers that are compiled into the kernel. +// +// Also see http://man7.org/linux/man-pages/man7/cgroups.7.html +type CgroupSummary struct { + // The name of the controller. controller is also known as subsystem. + SubsysName string + // The unique ID of the cgroup hierarchy on which this controller is mounted. + Hierarchy int + // The number of control groups in this hierarchy using this controller. + Cgroups int + // This field contains the value 1 if this controller is enabled, or 0 if it has been disabled + Enabled int +} + +// parseCgroupSummary parses each line of the /proc/cgroup file +// Line format is `subsys_name hierarchy num_cgroups enabled`. +func parseCgroupSummaryString(CgroupSummaryStr string) (*CgroupSummary, error) { + var err error + + fields := strings.Fields(CgroupSummaryStr) + // require at least 4 fields + if len(fields) < 4 { + return nil, fmt.Errorf("%w: 4+ fields required, found %d fields in cgroup info string: %s", ErrFileParse, len(fields), CgroupSummaryStr) + } + + CgroupSummary := &CgroupSummary{ + SubsysName: fields[0], + } + CgroupSummary.Hierarchy, err = strconv.Atoi(fields[1]) + if err != nil { + return nil, fmt.Errorf("%w: Unable to parse hierarchy ID from %q", ErrFileParse, fields[1]) + } + CgroupSummary.Cgroups, err = strconv.Atoi(fields[2]) + if err != nil { + return nil, fmt.Errorf("%w: Unable to parse Cgroup Num from %q", ErrFileParse, fields[2]) + } + CgroupSummary.Enabled, err = strconv.Atoi(fields[3]) + if err != nil { + return nil, fmt.Errorf("%w: Unable to parse Enabled from %q", ErrFileParse, fields[3]) + } + return CgroupSummary, nil +} + +// parseCgroupSummary reads each line of the /proc/cgroup file. +func parseCgroupSummary(data []byte) ([]CgroupSummary, error) { + var CgroupSummarys []CgroupSummary + scanner := bufio.NewScanner(bytes.NewReader(data)) + for scanner.Scan() { + CgroupSummaryString := scanner.Text() + // ignore comment lines + if strings.HasPrefix(CgroupSummaryString, "#") { + continue + } + CgroupSummary, err := parseCgroupSummaryString(CgroupSummaryString) + if err != nil { + return nil, err + } + CgroupSummarys = append(CgroupSummarys, *CgroupSummary) + } + + err := scanner.Err() + return CgroupSummarys, err +} + +// CgroupSummarys returns information about current /proc/cgroups. +func (fs FS) CgroupSummarys() ([]CgroupSummary, error) { + data, err := util.ReadFileNoStat(fs.proc.Path("cgroups")) + if err != nil { + return nil, err + } + return parseCgroupSummary(data) +} diff --git a/vendor/github.com/prometheus/procfs/proc_environ.go b/vendor/github.com/prometheus/procfs/proc_environ.go index 6134b3580c..57a89895d6 100644 --- a/vendor/github.com/prometheus/procfs/proc_environ.go +++ b/vendor/github.com/prometheus/procfs/proc_environ.go @@ -19,7 +19,7 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// Environ reads process environments from /proc//environ +// Environ reads process environments from `/proc//environ`. func (p Proc) Environ() ([]string, error) { environments := make([]string, 0) diff --git a/vendor/github.com/prometheus/procfs/proc_fdinfo.go b/vendor/github.com/prometheus/procfs/proc_fdinfo.go index cf63227f06..fa761b3529 100644 --- a/vendor/github.com/prometheus/procfs/proc_fdinfo.go +++ b/vendor/github.com/prometheus/procfs/proc_fdinfo.go @@ -22,11 +22,11 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// Regexp variables var ( rPos = regexp.MustCompile(`^pos:\s+(\d+)$`) rFlags = regexp.MustCompile(`^flags:\s+(\d+)$`) rMntID = regexp.MustCompile(`^mnt_id:\s+(\d+)$`) + rIno = regexp.MustCompile(`^ino:\s+(\d+)$`) rInotify = regexp.MustCompile(`^inotify`) rInotifyParts = regexp.MustCompile(`^inotify\s+wd:([0-9a-f]+)\s+ino:([0-9a-f]+)\s+sdev:([0-9a-f]+)(?:\s+mask:([0-9a-f]+))?`) ) @@ -41,6 +41,8 @@ type ProcFDInfo struct { Flags string // Mount point ID MntID string + // Inode number + Ino string // List of inotify lines (structured) in the fdinfo file (kernel 3.8+ only) InotifyInfos []InotifyInfo } @@ -52,7 +54,7 @@ func (p Proc) FDInfo(fd string) (*ProcFDInfo, error) { return nil, err } - var text, pos, flags, mntid string + var text, pos, flags, mntid, ino string var inotify []InotifyInfo scanner := bufio.NewScanner(bytes.NewReader(data)) @@ -64,6 +66,8 @@ func (p Proc) FDInfo(fd string) (*ProcFDInfo, error) { flags = rFlags.FindStringSubmatch(text)[1] } else if rMntID.MatchString(text) { mntid = rMntID.FindStringSubmatch(text)[1] + } else if rIno.MatchString(text) { + ino = rIno.FindStringSubmatch(text)[1] } else if rInotify.MatchString(text) { newInotify, err := parseInotifyInfo(text) if err != nil { @@ -78,6 +82,7 @@ func (p Proc) FDInfo(fd string) (*ProcFDInfo, error) { Pos: pos, Flags: flags, MntID: mntid, + Ino: ino, InotifyInfos: inotify, } @@ -112,7 +117,7 @@ func parseInotifyInfo(line string) (*InotifyInfo, error) { } return i, nil } - return nil, fmt.Errorf("invalid inode entry: %q", line) + return nil, fmt.Errorf("%w: invalid inode entry: %q", ErrFileParse, line) } // ProcFDInfos represents a list of ProcFDInfo structs. @@ -122,7 +127,7 @@ func (p ProcFDInfos) Len() int { return len(p) } func (p ProcFDInfos) Swap(i, j int) { p[i], p[j] = p[j], p[i] } func (p ProcFDInfos) Less(i, j int) bool { return p[i].FD < p[j].FD } -// InotifyWatchLen returns the total number of inotify watches +// InotifyWatchLen returns the total number of inotify watches. func (p ProcFDInfos) InotifyWatchLen() (int, error) { length := 0 for _, f := range p { diff --git a/vendor/github.com/prometheus/procfs/proc_interrupts.go b/vendor/github.com/prometheus/procfs/proc_interrupts.go new file mode 100644 index 0000000000..86b4b45246 --- /dev/null +++ b/vendor/github.com/prometheus/procfs/proc_interrupts.go @@ -0,0 +1,98 @@ +// Copyright 2022 The Prometheus 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 procfs + +import ( + "bufio" + "bytes" + "errors" + "fmt" + "io" + "strconv" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +// Interrupt represents a single interrupt line. +type Interrupt struct { + // Info is the type of interrupt. + Info string + // Devices is the name of the device that is located at that IRQ + Devices string + // Values is the number of interrupts per CPU. + Values []string +} + +// Interrupts models the content of /proc/interrupts. Key is the IRQ number. +// - https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s2-proc-interrupts +// - https://raspberrypi.stackexchange.com/questions/105802/explanation-of-proc-interrupts-output +type Interrupts map[string]Interrupt + +// Interrupts creates a new instance from a given Proc instance. +func (p Proc) Interrupts() (Interrupts, error) { + data, err := util.ReadFileNoStat(p.path("interrupts")) + if err != nil { + return nil, err + } + return parseInterrupts(bytes.NewReader(data)) +} + +func parseInterrupts(r io.Reader) (Interrupts, error) { + var ( + interrupts = Interrupts{} + scanner = bufio.NewScanner(r) + ) + + if !scanner.Scan() { + return nil, errors.New("interrupts empty") + } + cpuNum := len(strings.Fields(scanner.Text())) // one header per cpu + + for scanner.Scan() { + parts := strings.Fields(scanner.Text()) + if len(parts) == 0 { // skip empty lines + continue + } + if len(parts) < 2 { + return nil, fmt.Errorf("%w: Not enough fields in interrupts (expected 2+ fields but got %d): %s", ErrFileParse, len(parts), parts) + } + intName := parts[0][:len(parts[0])-1] // remove trailing : + + if len(parts) == 2 { + interrupts[intName] = Interrupt{ + Info: "", + Devices: "", + Values: []string{ + parts[1], + }, + } + continue + } + + intr := Interrupt{ + Values: parts[1 : cpuNum+1], + } + + if _, err := strconv.Atoi(intName); err == nil { // numeral interrupt + intr.Info = parts[cpuNum+1] + intr.Devices = strings.Join(parts[cpuNum+2:], " ") + } else { + intr.Info = strings.Join(parts[cpuNum+1:], " ") + } + interrupts[intName] = intr + } + + return interrupts, scanner.Err() +} diff --git a/vendor/github.com/prometheus/procfs/proc_limits.go b/vendor/github.com/prometheus/procfs/proc_limits.go index dd20f198a3..9530b14bc6 100644 --- a/vendor/github.com/prometheus/procfs/proc_limits.go +++ b/vendor/github.com/prometheus/procfs/proc_limits.go @@ -79,7 +79,7 @@ var ( // NewLimits returns the current soft limits of the process. // -// Deprecated: use p.Limits() instead +// Deprecated: Use p.Limits() instead. func (p Proc) NewLimits() (ProcLimits, error) { return p.Limits() } @@ -103,7 +103,7 @@ func (p Proc) Limits() (ProcLimits, error) { //fields := limitsMatch.Split(s.Text(), limitsFields) fields := limitsMatch.FindStringSubmatch(s.Text()) if len(fields) != limitsFields { - return ProcLimits{}, fmt.Errorf("couldn't parse %q line %q", f.Name(), s.Text()) + return ProcLimits{}, fmt.Errorf("%w: couldn't parse %q line %q", ErrFileParse, f.Name(), s.Text()) } switch fields[1] { @@ -154,7 +154,7 @@ func parseUint(s string) (uint64, error) { } i, err := strconv.ParseUint(s, 10, 64) if err != nil { - return 0, fmt.Errorf("couldn't parse value %q: %w", s, err) + return 0, fmt.Errorf("%w: couldn't parse value %q: %w", ErrFileParse, s, err) } return i, nil } diff --git a/vendor/github.com/prometheus/procfs/proc_maps.go b/vendor/github.com/prometheus/procfs/proc_maps.go index 1d7772d516..7e75c286b5 100644 --- a/vendor/github.com/prometheus/procfs/proc_maps.go +++ b/vendor/github.com/prometheus/procfs/proc_maps.go @@ -11,7 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && !js // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +// +build !js package procfs @@ -25,7 +27,7 @@ import ( "golang.org/x/sys/unix" ) -// ProcMapPermissions contains permission settings read from /proc/[pid]/maps +// ProcMapPermissions contains permission settings read from `/proc/[pid]/maps`. type ProcMapPermissions struct { // mapping has the [R]ead flag set Read bool @@ -39,8 +41,8 @@ type ProcMapPermissions struct { Private bool } -// ProcMap contains the process memory-mappings of the process, -// read from /proc/[pid]/maps +// ProcMap contains the process memory-mappings of the process +// read from `/proc/[pid]/maps`. type ProcMap struct { // The start address of current mapping. StartAddr uintptr @@ -61,17 +63,17 @@ type ProcMap struct { // parseDevice parses the device token of a line and converts it to a dev_t // (mkdev) like structure. func parseDevice(s string) (uint64, error) { - toks := strings.Split(s, ":") - if len(toks) < 2 { - return 0, fmt.Errorf("unexpected number of fields") + i := strings.Index(s, ":") + if i == -1 { + return 0, fmt.Errorf("%w: expected separator `:` in %s", ErrFileParse, s) } - major, err := strconv.ParseUint(toks[0], 16, 0) + major, err := strconv.ParseUint(s[0:i], 16, 0) if err != nil { return 0, err } - minor, err := strconv.ParseUint(toks[1], 16, 0) + minor, err := strconv.ParseUint(s[i+1:], 16, 0) if err != nil { return 0, err } @@ -79,7 +81,7 @@ func parseDevice(s string) (uint64, error) { return unix.Mkdev(uint32(major), uint32(minor)), nil } -// parseAddress just converts a hex-string to a uintptr +// parseAddress converts a hex-string to a uintptr. func parseAddress(s string) (uintptr, error) { a, err := strconv.ParseUint(s, 16, 0) if err != nil { @@ -89,19 +91,19 @@ func parseAddress(s string) (uintptr, error) { return uintptr(a), nil } -// parseAddresses parses the start-end address +// parseAddresses parses the start-end address. func parseAddresses(s string) (uintptr, uintptr, error) { - toks := strings.Split(s, "-") - if len(toks) < 2 { - return 0, 0, fmt.Errorf("invalid address") + idx := strings.Index(s, "-") + if idx == -1 { + return 0, 0, fmt.Errorf("%w: expected separator `-` in %s", ErrFileParse, s) } - saddr, err := parseAddress(toks[0]) + saddr, err := parseAddress(s[0:idx]) if err != nil { return 0, 0, err } - eaddr, err := parseAddress(toks[1]) + eaddr, err := parseAddress(s[idx+1:]) if err != nil { return 0, 0, err } @@ -112,7 +114,7 @@ func parseAddresses(s string) (uintptr, uintptr, error) { // parsePermissions parses a token and returns any that are set. func parsePermissions(s string) (*ProcMapPermissions, error) { if len(s) < 4 { - return nil, fmt.Errorf("invalid permissions token") + return nil, fmt.Errorf("%w: invalid permissions token", ErrFileParse) } perms := ProcMapPermissions{} @@ -139,7 +141,7 @@ func parsePermissions(s string) (*ProcMapPermissions, error) { func parseProcMap(text string) (*ProcMap, error) { fields := strings.Fields(text) if len(fields) < 5 { - return nil, fmt.Errorf("truncated procmap entry") + return nil, fmt.Errorf("%w: truncated procmap entry", ErrFileParse) } saddr, eaddr, err := parseAddresses(fields[0]) diff --git a/vendor/github.com/prometheus/procfs/proc_netstat.go b/vendor/github.com/prometheus/procfs/proc_netstat.go new file mode 100644 index 0000000000..8e3ff4d794 --- /dev/null +++ b/vendor/github.com/prometheus/procfs/proc_netstat.go @@ -0,0 +1,443 @@ +// Copyright 2022 The Prometheus 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 procfs + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strconv" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +// ProcNetstat models the content of /proc//net/netstat. +type ProcNetstat struct { + // The process ID. + PID int + TcpExt + IpExt +} + +type TcpExt struct { // nolint:revive + SyncookiesSent *float64 + SyncookiesRecv *float64 + SyncookiesFailed *float64 + EmbryonicRsts *float64 + PruneCalled *float64 + RcvPruned *float64 + OfoPruned *float64 + OutOfWindowIcmps *float64 + LockDroppedIcmps *float64 + ArpFilter *float64 + TW *float64 + TWRecycled *float64 + TWKilled *float64 + PAWSActive *float64 + PAWSEstab *float64 + DelayedACKs *float64 + DelayedACKLocked *float64 + DelayedACKLost *float64 + ListenOverflows *float64 + ListenDrops *float64 + TCPHPHits *float64 + TCPPureAcks *float64 + TCPHPAcks *float64 + TCPRenoRecovery *float64 + TCPSackRecovery *float64 + TCPSACKReneging *float64 + TCPSACKReorder *float64 + TCPRenoReorder *float64 + TCPTSReorder *float64 + TCPFullUndo *float64 + TCPPartialUndo *float64 + TCPDSACKUndo *float64 + TCPLossUndo *float64 + TCPLostRetransmit *float64 + TCPRenoFailures *float64 + TCPSackFailures *float64 + TCPLossFailures *float64 + TCPFastRetrans *float64 + TCPSlowStartRetrans *float64 + TCPTimeouts *float64 + TCPLossProbes *float64 + TCPLossProbeRecovery *float64 + TCPRenoRecoveryFail *float64 + TCPSackRecoveryFail *float64 + TCPRcvCollapsed *float64 + TCPDSACKOldSent *float64 + TCPDSACKOfoSent *float64 + TCPDSACKRecv *float64 + TCPDSACKOfoRecv *float64 + TCPAbortOnData *float64 + TCPAbortOnClose *float64 + TCPAbortOnMemory *float64 + TCPAbortOnTimeout *float64 + TCPAbortOnLinger *float64 + TCPAbortFailed *float64 + TCPMemoryPressures *float64 + TCPMemoryPressuresChrono *float64 + TCPSACKDiscard *float64 + TCPDSACKIgnoredOld *float64 + TCPDSACKIgnoredNoUndo *float64 + TCPSpuriousRTOs *float64 + TCPMD5NotFound *float64 + TCPMD5Unexpected *float64 + TCPMD5Failure *float64 + TCPSackShifted *float64 + TCPSackMerged *float64 + TCPSackShiftFallback *float64 + TCPBacklogDrop *float64 + PFMemallocDrop *float64 + TCPMinTTLDrop *float64 + TCPDeferAcceptDrop *float64 + IPReversePathFilter *float64 + TCPTimeWaitOverflow *float64 + TCPReqQFullDoCookies *float64 + TCPReqQFullDrop *float64 + TCPRetransFail *float64 + TCPRcvCoalesce *float64 + TCPRcvQDrop *float64 + TCPOFOQueue *float64 + TCPOFODrop *float64 + TCPOFOMerge *float64 + TCPChallengeACK *float64 + TCPSYNChallenge *float64 + TCPFastOpenActive *float64 + TCPFastOpenActiveFail *float64 + TCPFastOpenPassive *float64 + TCPFastOpenPassiveFail *float64 + TCPFastOpenListenOverflow *float64 + TCPFastOpenCookieReqd *float64 + TCPFastOpenBlackhole *float64 + TCPSpuriousRtxHostQueues *float64 + BusyPollRxPackets *float64 + TCPAutoCorking *float64 + TCPFromZeroWindowAdv *float64 + TCPToZeroWindowAdv *float64 + TCPWantZeroWindowAdv *float64 + TCPSynRetrans *float64 + TCPOrigDataSent *float64 + TCPHystartTrainDetect *float64 + TCPHystartTrainCwnd *float64 + TCPHystartDelayDetect *float64 + TCPHystartDelayCwnd *float64 + TCPACKSkippedSynRecv *float64 + TCPACKSkippedPAWS *float64 + TCPACKSkippedSeq *float64 + TCPACKSkippedFinWait2 *float64 + TCPACKSkippedTimeWait *float64 + TCPACKSkippedChallenge *float64 + TCPWinProbe *float64 + TCPKeepAlive *float64 + TCPMTUPFail *float64 + TCPMTUPSuccess *float64 + TCPWqueueTooBig *float64 +} + +type IpExt struct { // nolint:revive + InNoRoutes *float64 + InTruncatedPkts *float64 + InMcastPkts *float64 + OutMcastPkts *float64 + InBcastPkts *float64 + OutBcastPkts *float64 + InOctets *float64 + OutOctets *float64 + InMcastOctets *float64 + OutMcastOctets *float64 + InBcastOctets *float64 + OutBcastOctets *float64 + InCsumErrors *float64 + InNoECTPkts *float64 + InECT1Pkts *float64 + InECT0Pkts *float64 + InCEPkts *float64 + ReasmOverlaps *float64 +} + +func (p Proc) Netstat() (ProcNetstat, error) { + filename := p.path("net/netstat") + data, err := util.ReadFileNoStat(filename) + if err != nil { + return ProcNetstat{PID: p.PID}, err + } + procNetstat, err := parseProcNetstat(bytes.NewReader(data), filename) + procNetstat.PID = p.PID + return procNetstat, err +} + +// parseProcNetstat parses the metrics from proc//net/netstat file +// and returns a ProcNetstat structure. +func parseProcNetstat(r io.Reader, fileName string) (ProcNetstat, error) { + var ( + scanner = bufio.NewScanner(r) + procNetstat = ProcNetstat{} + ) + + for scanner.Scan() { + nameParts := strings.Split(scanner.Text(), " ") + scanner.Scan() + valueParts := strings.Split(scanner.Text(), " ") + // Remove trailing :. + protocol := strings.TrimSuffix(nameParts[0], ":") + if len(nameParts) != len(valueParts) { + return procNetstat, fmt.Errorf("%w: mismatch field count mismatch in %s: %s", + ErrFileParse, fileName, protocol) + } + for i := 1; i < len(nameParts); i++ { + value, err := strconv.ParseFloat(valueParts[i], 64) + if err != nil { + return procNetstat, err + } + key := nameParts[i] + + switch protocol { + case "TcpExt": + switch key { + case "SyncookiesSent": + procNetstat.TcpExt.SyncookiesSent = &value + case "SyncookiesRecv": + procNetstat.TcpExt.SyncookiesRecv = &value + case "SyncookiesFailed": + procNetstat.TcpExt.SyncookiesFailed = &value + case "EmbryonicRsts": + procNetstat.TcpExt.EmbryonicRsts = &value + case "PruneCalled": + procNetstat.TcpExt.PruneCalled = &value + case "RcvPruned": + procNetstat.TcpExt.RcvPruned = &value + case "OfoPruned": + procNetstat.TcpExt.OfoPruned = &value + case "OutOfWindowIcmps": + procNetstat.TcpExt.OutOfWindowIcmps = &value + case "LockDroppedIcmps": + procNetstat.TcpExt.LockDroppedIcmps = &value + case "ArpFilter": + procNetstat.TcpExt.ArpFilter = &value + case "TW": + procNetstat.TcpExt.TW = &value + case "TWRecycled": + procNetstat.TcpExt.TWRecycled = &value + case "TWKilled": + procNetstat.TcpExt.TWKilled = &value + case "PAWSActive": + procNetstat.TcpExt.PAWSActive = &value + case "PAWSEstab": + procNetstat.TcpExt.PAWSEstab = &value + case "DelayedACKs": + procNetstat.TcpExt.DelayedACKs = &value + case "DelayedACKLocked": + procNetstat.TcpExt.DelayedACKLocked = &value + case "DelayedACKLost": + procNetstat.TcpExt.DelayedACKLost = &value + case "ListenOverflows": + procNetstat.TcpExt.ListenOverflows = &value + case "ListenDrops": + procNetstat.TcpExt.ListenDrops = &value + case "TCPHPHits": + procNetstat.TcpExt.TCPHPHits = &value + case "TCPPureAcks": + procNetstat.TcpExt.TCPPureAcks = &value + case "TCPHPAcks": + procNetstat.TcpExt.TCPHPAcks = &value + case "TCPRenoRecovery": + procNetstat.TcpExt.TCPRenoRecovery = &value + case "TCPSackRecovery": + procNetstat.TcpExt.TCPSackRecovery = &value + case "TCPSACKReneging": + procNetstat.TcpExt.TCPSACKReneging = &value + case "TCPSACKReorder": + procNetstat.TcpExt.TCPSACKReorder = &value + case "TCPRenoReorder": + procNetstat.TcpExt.TCPRenoReorder = &value + case "TCPTSReorder": + procNetstat.TcpExt.TCPTSReorder = &value + case "TCPFullUndo": + procNetstat.TcpExt.TCPFullUndo = &value + case "TCPPartialUndo": + procNetstat.TcpExt.TCPPartialUndo = &value + case "TCPDSACKUndo": + procNetstat.TcpExt.TCPDSACKUndo = &value + case "TCPLossUndo": + procNetstat.TcpExt.TCPLossUndo = &value + case "TCPLostRetransmit": + procNetstat.TcpExt.TCPLostRetransmit = &value + case "TCPRenoFailures": + procNetstat.TcpExt.TCPRenoFailures = &value + case "TCPSackFailures": + procNetstat.TcpExt.TCPSackFailures = &value + case "TCPLossFailures": + procNetstat.TcpExt.TCPLossFailures = &value + case "TCPFastRetrans": + procNetstat.TcpExt.TCPFastRetrans = &value + case "TCPSlowStartRetrans": + procNetstat.TcpExt.TCPSlowStartRetrans = &value + case "TCPTimeouts": + procNetstat.TcpExt.TCPTimeouts = &value + case "TCPLossProbes": + procNetstat.TcpExt.TCPLossProbes = &value + case "TCPLossProbeRecovery": + procNetstat.TcpExt.TCPLossProbeRecovery = &value + case "TCPRenoRecoveryFail": + procNetstat.TcpExt.TCPRenoRecoveryFail = &value + case "TCPSackRecoveryFail": + procNetstat.TcpExt.TCPSackRecoveryFail = &value + case "TCPRcvCollapsed": + procNetstat.TcpExt.TCPRcvCollapsed = &value + case "TCPDSACKOldSent": + procNetstat.TcpExt.TCPDSACKOldSent = &value + case "TCPDSACKOfoSent": + procNetstat.TcpExt.TCPDSACKOfoSent = &value + case "TCPDSACKRecv": + procNetstat.TcpExt.TCPDSACKRecv = &value + case "TCPDSACKOfoRecv": + procNetstat.TcpExt.TCPDSACKOfoRecv = &value + case "TCPAbortOnData": + procNetstat.TcpExt.TCPAbortOnData = &value + case "TCPAbortOnClose": + procNetstat.TcpExt.TCPAbortOnClose = &value + case "TCPDeferAcceptDrop": + procNetstat.TcpExt.TCPDeferAcceptDrop = &value + case "IPReversePathFilter": + procNetstat.TcpExt.IPReversePathFilter = &value + case "TCPTimeWaitOverflow": + procNetstat.TcpExt.TCPTimeWaitOverflow = &value + case "TCPReqQFullDoCookies": + procNetstat.TcpExt.TCPReqQFullDoCookies = &value + case "TCPReqQFullDrop": + procNetstat.TcpExt.TCPReqQFullDrop = &value + case "TCPRetransFail": + procNetstat.TcpExt.TCPRetransFail = &value + case "TCPRcvCoalesce": + procNetstat.TcpExt.TCPRcvCoalesce = &value + case "TCPRcvQDrop": + procNetstat.TcpExt.TCPRcvQDrop = &value + case "TCPOFOQueue": + procNetstat.TcpExt.TCPOFOQueue = &value + case "TCPOFODrop": + procNetstat.TcpExt.TCPOFODrop = &value + case "TCPOFOMerge": + procNetstat.TcpExt.TCPOFOMerge = &value + case "TCPChallengeACK": + procNetstat.TcpExt.TCPChallengeACK = &value + case "TCPSYNChallenge": + procNetstat.TcpExt.TCPSYNChallenge = &value + case "TCPFastOpenActive": + procNetstat.TcpExt.TCPFastOpenActive = &value + case "TCPFastOpenActiveFail": + procNetstat.TcpExt.TCPFastOpenActiveFail = &value + case "TCPFastOpenPassive": + procNetstat.TcpExt.TCPFastOpenPassive = &value + case "TCPFastOpenPassiveFail": + procNetstat.TcpExt.TCPFastOpenPassiveFail = &value + case "TCPFastOpenListenOverflow": + procNetstat.TcpExt.TCPFastOpenListenOverflow = &value + case "TCPFastOpenCookieReqd": + procNetstat.TcpExt.TCPFastOpenCookieReqd = &value + case "TCPFastOpenBlackhole": + procNetstat.TcpExt.TCPFastOpenBlackhole = &value + case "TCPSpuriousRtxHostQueues": + procNetstat.TcpExt.TCPSpuriousRtxHostQueues = &value + case "BusyPollRxPackets": + procNetstat.TcpExt.BusyPollRxPackets = &value + case "TCPAutoCorking": + procNetstat.TcpExt.TCPAutoCorking = &value + case "TCPFromZeroWindowAdv": + procNetstat.TcpExt.TCPFromZeroWindowAdv = &value + case "TCPToZeroWindowAdv": + procNetstat.TcpExt.TCPToZeroWindowAdv = &value + case "TCPWantZeroWindowAdv": + procNetstat.TcpExt.TCPWantZeroWindowAdv = &value + case "TCPSynRetrans": + procNetstat.TcpExt.TCPSynRetrans = &value + case "TCPOrigDataSent": + procNetstat.TcpExt.TCPOrigDataSent = &value + case "TCPHystartTrainDetect": + procNetstat.TcpExt.TCPHystartTrainDetect = &value + case "TCPHystartTrainCwnd": + procNetstat.TcpExt.TCPHystartTrainCwnd = &value + case "TCPHystartDelayDetect": + procNetstat.TcpExt.TCPHystartDelayDetect = &value + case "TCPHystartDelayCwnd": + procNetstat.TcpExt.TCPHystartDelayCwnd = &value + case "TCPACKSkippedSynRecv": + procNetstat.TcpExt.TCPACKSkippedSynRecv = &value + case "TCPACKSkippedPAWS": + procNetstat.TcpExt.TCPACKSkippedPAWS = &value + case "TCPACKSkippedSeq": + procNetstat.TcpExt.TCPACKSkippedSeq = &value + case "TCPACKSkippedFinWait2": + procNetstat.TcpExt.TCPACKSkippedFinWait2 = &value + case "TCPACKSkippedTimeWait": + procNetstat.TcpExt.TCPACKSkippedTimeWait = &value + case "TCPACKSkippedChallenge": + procNetstat.TcpExt.TCPACKSkippedChallenge = &value + case "TCPWinProbe": + procNetstat.TcpExt.TCPWinProbe = &value + case "TCPKeepAlive": + procNetstat.TcpExt.TCPKeepAlive = &value + case "TCPMTUPFail": + procNetstat.TcpExt.TCPMTUPFail = &value + case "TCPMTUPSuccess": + procNetstat.TcpExt.TCPMTUPSuccess = &value + case "TCPWqueueTooBig": + procNetstat.TcpExt.TCPWqueueTooBig = &value + } + case "IpExt": + switch key { + case "InNoRoutes": + procNetstat.IpExt.InNoRoutes = &value + case "InTruncatedPkts": + procNetstat.IpExt.InTruncatedPkts = &value + case "InMcastPkts": + procNetstat.IpExt.InMcastPkts = &value + case "OutMcastPkts": + procNetstat.IpExt.OutMcastPkts = &value + case "InBcastPkts": + procNetstat.IpExt.InBcastPkts = &value + case "OutBcastPkts": + procNetstat.IpExt.OutBcastPkts = &value + case "InOctets": + procNetstat.IpExt.InOctets = &value + case "OutOctets": + procNetstat.IpExt.OutOctets = &value + case "InMcastOctets": + procNetstat.IpExt.InMcastOctets = &value + case "OutMcastOctets": + procNetstat.IpExt.OutMcastOctets = &value + case "InBcastOctets": + procNetstat.IpExt.InBcastOctets = &value + case "OutBcastOctets": + procNetstat.IpExt.OutBcastOctets = &value + case "InCsumErrors": + procNetstat.IpExt.InCsumErrors = &value + case "InNoECTPkts": + procNetstat.IpExt.InNoECTPkts = &value + case "InECT1Pkts": + procNetstat.IpExt.InECT1Pkts = &value + case "InECT0Pkts": + procNetstat.IpExt.InECT0Pkts = &value + case "InCEPkts": + procNetstat.IpExt.InCEPkts = &value + case "ReasmOverlaps": + procNetstat.IpExt.ReasmOverlaps = &value + } + } + } + } + return procNetstat, scanner.Err() +} diff --git a/vendor/github.com/prometheus/procfs/proc_ns.go b/vendor/github.com/prometheus/procfs/proc_ns.go index 391b4cbd11..0f8f847f95 100644 --- a/vendor/github.com/prometheus/procfs/proc_ns.go +++ b/vendor/github.com/prometheus/procfs/proc_ns.go @@ -40,7 +40,7 @@ func (p Proc) Namespaces() (Namespaces, error) { names, err := d.Readdirnames(-1) if err != nil { - return nil, fmt.Errorf("failed to read contents of ns dir: %w", err) + return nil, fmt.Errorf("%w: failed to read contents of ns dir: %w", ErrFileRead, err) } ns := make(Namespaces, len(names)) @@ -52,13 +52,13 @@ func (p Proc) Namespaces() (Namespaces, error) { fields := strings.SplitN(target, ":", 2) if len(fields) != 2 { - return nil, fmt.Errorf("failed to parse namespace type and inode from %q", target) + return nil, fmt.Errorf("%w: namespace type and inode from %q", ErrFileParse, target) } typ := fields[0] inode, err := strconv.ParseUint(strings.Trim(fields[1], "[]"), 10, 32) if err != nil { - return nil, fmt.Errorf("failed to parse inode from %q: %w", fields[1], err) + return nil, fmt.Errorf("%w: inode from %q: %w", ErrFileParse, fields[1], err) } ns[name] = Namespace{typ, uint32(inode)} diff --git a/vendor/github.com/prometheus/procfs/proc_psi.go b/vendor/github.com/prometheus/procfs/proc_psi.go index dc6c14f0a4..ccd35f153a 100644 --- a/vendor/github.com/prometheus/procfs/proc_psi.go +++ b/vendor/github.com/prometheus/procfs/proc_psi.go @@ -35,9 +35,10 @@ import ( const lineFormat = "avg10=%f avg60=%f avg300=%f total=%d" -// PSILine is a single line of values as returned by /proc/pressure/* -// The Avg entries are averages over n seconds, as a percentage -// The Total line is in microseconds +// PSILine is a single line of values as returned by `/proc/pressure/*`. +// +// The Avg entries are averages over n seconds, as a percentage. +// The Total line is in microseconds. type PSILine struct { Avg10 float64 Avg60 float64 @@ -46,8 +47,9 @@ type PSILine struct { } // PSIStats represent pressure stall information from /proc/pressure/* -// Some indicates the share of time in which at least some tasks are stalled -// Full indicates the share of time in which all non-idle tasks are stalled simultaneously +// +// "Some" indicates the share of time in which at least some tasks are stalled. +// "Full" indicates the share of time in which all non-idle tasks are stalled simultaneously. type PSIStats struct { Some *PSILine Full *PSILine @@ -59,14 +61,14 @@ type PSIStats struct { func (fs FS) PSIStatsForResource(resource string) (PSIStats, error) { data, err := util.ReadFileNoStat(fs.proc.Path(fmt.Sprintf("%s/%s", "pressure", resource))) if err != nil { - return PSIStats{}, fmt.Errorf("psi_stats: unavailable for %q: %w", resource, err) + return PSIStats{}, fmt.Errorf("%w: psi_stats: unavailable for %q: %w", ErrFileRead, resource, err) } - return parsePSIStats(resource, bytes.NewReader(data)) + return parsePSIStats(bytes.NewReader(data)) } -// parsePSIStats parses the specified file for pressure stall information -func parsePSIStats(resource string, r io.Reader) (PSIStats, error) { +// parsePSIStats parses the specified file for pressure stall information. +func parsePSIStats(r io.Reader) (PSIStats, error) { psiStats := PSIStats{} scanner := bufio.NewScanner(r) diff --git a/vendor/github.com/prometheus/procfs/proc_smaps.go b/vendor/github.com/prometheus/procfs/proc_smaps.go index a576a720a4..09060e8208 100644 --- a/vendor/github.com/prometheus/procfs/proc_smaps.go +++ b/vendor/github.com/prometheus/procfs/proc_smaps.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package procfs @@ -28,30 +29,30 @@ import ( ) var ( - // match the header line before each mapped zone in /proc/pid/smaps + // match the header line before each mapped zone in `/proc/pid/smaps`. procSMapsHeaderLine = regexp.MustCompile(`^[a-f0-9].*$`) ) type ProcSMapsRollup struct { - // Amount of the mapping that is currently resident in RAM + // Amount of the mapping that is currently resident in RAM. Rss uint64 - // Process's proportional share of this mapping + // Process's proportional share of this mapping. Pss uint64 - // Size in bytes of clean shared pages + // Size in bytes of clean shared pages. SharedClean uint64 - // Size in bytes of dirty shared pages + // Size in bytes of dirty shared pages. SharedDirty uint64 - // Size in bytes of clean private pages + // Size in bytes of clean private pages. PrivateClean uint64 - // Size in bytes of dirty private pages + // Size in bytes of dirty private pages. PrivateDirty uint64 - // Amount of memory currently marked as referenced or accessed + // Amount of memory currently marked as referenced or accessed. Referenced uint64 - // Amount of memory that does not belong to any file + // Amount of memory that does not belong to any file. Anonymous uint64 - // Amount would-be-anonymous memory currently on swap + // Amount would-be-anonymous memory currently on swap. Swap uint64 - // Process's proportional memory on swap + // Process's proportional memory on swap. SwapPss uint64 } @@ -126,7 +127,7 @@ func (s *ProcSMapsRollup) parseLine(line string) error { } v := strings.TrimSpace(kv[1]) - v = strings.TrimRight(v, " kB") + v = strings.TrimSuffix(v, " kB") vKBytes, err := strconv.ParseUint(v, 10, 64) if err != nil { @@ -134,12 +135,12 @@ func (s *ProcSMapsRollup) parseLine(line string) error { } vBytes := vKBytes * 1024 - s.addValue(k, v, vKBytes, vBytes) + s.addValue(k, vBytes) return nil } -func (s *ProcSMapsRollup) addValue(k string, vString string, vUint uint64, vUintBytes uint64) { +func (s *ProcSMapsRollup) addValue(k string, vUintBytes uint64) { switch k { case "Rss": s.Rss += vUintBytes diff --git a/vendor/github.com/prometheus/procfs/proc_snmp.go b/vendor/github.com/prometheus/procfs/proc_snmp.go new file mode 100644 index 0000000000..b9d2cf642a --- /dev/null +++ b/vendor/github.com/prometheus/procfs/proc_snmp.go @@ -0,0 +1,353 @@ +// Copyright 2022 The Prometheus 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 procfs + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strconv" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +// ProcSnmp models the content of /proc//net/snmp. +type ProcSnmp struct { + // The process ID. + PID int + Ip + Icmp + IcmpMsg + Tcp + Udp + UdpLite +} + +type Ip struct { // nolint:revive + Forwarding *float64 + DefaultTTL *float64 + InReceives *float64 + InHdrErrors *float64 + InAddrErrors *float64 + ForwDatagrams *float64 + InUnknownProtos *float64 + InDiscards *float64 + InDelivers *float64 + OutRequests *float64 + OutDiscards *float64 + OutNoRoutes *float64 + ReasmTimeout *float64 + ReasmReqds *float64 + ReasmOKs *float64 + ReasmFails *float64 + FragOKs *float64 + FragFails *float64 + FragCreates *float64 +} + +type Icmp struct { // nolint:revive + InMsgs *float64 + InErrors *float64 + InCsumErrors *float64 + InDestUnreachs *float64 + InTimeExcds *float64 + InParmProbs *float64 + InSrcQuenchs *float64 + InRedirects *float64 + InEchos *float64 + InEchoReps *float64 + InTimestamps *float64 + InTimestampReps *float64 + InAddrMasks *float64 + InAddrMaskReps *float64 + OutMsgs *float64 + OutErrors *float64 + OutDestUnreachs *float64 + OutTimeExcds *float64 + OutParmProbs *float64 + OutSrcQuenchs *float64 + OutRedirects *float64 + OutEchos *float64 + OutEchoReps *float64 + OutTimestamps *float64 + OutTimestampReps *float64 + OutAddrMasks *float64 + OutAddrMaskReps *float64 +} + +type IcmpMsg struct { + InType3 *float64 + OutType3 *float64 +} + +type Tcp struct { // nolint:revive + RtoAlgorithm *float64 + RtoMin *float64 + RtoMax *float64 + MaxConn *float64 + ActiveOpens *float64 + PassiveOpens *float64 + AttemptFails *float64 + EstabResets *float64 + CurrEstab *float64 + InSegs *float64 + OutSegs *float64 + RetransSegs *float64 + InErrs *float64 + OutRsts *float64 + InCsumErrors *float64 +} + +type Udp struct { // nolint:revive + InDatagrams *float64 + NoPorts *float64 + InErrors *float64 + OutDatagrams *float64 + RcvbufErrors *float64 + SndbufErrors *float64 + InCsumErrors *float64 + IgnoredMulti *float64 +} + +type UdpLite struct { // nolint:revive + InDatagrams *float64 + NoPorts *float64 + InErrors *float64 + OutDatagrams *float64 + RcvbufErrors *float64 + SndbufErrors *float64 + InCsumErrors *float64 + IgnoredMulti *float64 +} + +func (p Proc) Snmp() (ProcSnmp, error) { + filename := p.path("net/snmp") + data, err := util.ReadFileNoStat(filename) + if err != nil { + return ProcSnmp{PID: p.PID}, err + } + procSnmp, err := parseSnmp(bytes.NewReader(data), filename) + procSnmp.PID = p.PID + return procSnmp, err +} + +// parseSnmp parses the metrics from proc//net/snmp file +// and returns a map contains those metrics (e.g. {"Ip": {"Forwarding": 2}}). +func parseSnmp(r io.Reader, fileName string) (ProcSnmp, error) { + var ( + scanner = bufio.NewScanner(r) + procSnmp = ProcSnmp{} + ) + + for scanner.Scan() { + nameParts := strings.Split(scanner.Text(), " ") + scanner.Scan() + valueParts := strings.Split(scanner.Text(), " ") + // Remove trailing :. + protocol := strings.TrimSuffix(nameParts[0], ":") + if len(nameParts) != len(valueParts) { + return procSnmp, fmt.Errorf("%w: mismatch field count mismatch in %s: %s", + ErrFileParse, fileName, protocol) + } + for i := 1; i < len(nameParts); i++ { + value, err := strconv.ParseFloat(valueParts[i], 64) + if err != nil { + return procSnmp, err + } + key := nameParts[i] + + switch protocol { + case "Ip": + switch key { + case "Forwarding": + procSnmp.Ip.Forwarding = &value + case "DefaultTTL": + procSnmp.Ip.DefaultTTL = &value + case "InReceives": + procSnmp.Ip.InReceives = &value + case "InHdrErrors": + procSnmp.Ip.InHdrErrors = &value + case "InAddrErrors": + procSnmp.Ip.InAddrErrors = &value + case "ForwDatagrams": + procSnmp.Ip.ForwDatagrams = &value + case "InUnknownProtos": + procSnmp.Ip.InUnknownProtos = &value + case "InDiscards": + procSnmp.Ip.InDiscards = &value + case "InDelivers": + procSnmp.Ip.InDelivers = &value + case "OutRequests": + procSnmp.Ip.OutRequests = &value + case "OutDiscards": + procSnmp.Ip.OutDiscards = &value + case "OutNoRoutes": + procSnmp.Ip.OutNoRoutes = &value + case "ReasmTimeout": + procSnmp.Ip.ReasmTimeout = &value + case "ReasmReqds": + procSnmp.Ip.ReasmReqds = &value + case "ReasmOKs": + procSnmp.Ip.ReasmOKs = &value + case "ReasmFails": + procSnmp.Ip.ReasmFails = &value + case "FragOKs": + procSnmp.Ip.FragOKs = &value + case "FragFails": + procSnmp.Ip.FragFails = &value + case "FragCreates": + procSnmp.Ip.FragCreates = &value + } + case "Icmp": + switch key { + case "InMsgs": + procSnmp.Icmp.InMsgs = &value + case "InErrors": + procSnmp.Icmp.InErrors = &value + case "InCsumErrors": + procSnmp.Icmp.InCsumErrors = &value + case "InDestUnreachs": + procSnmp.Icmp.InDestUnreachs = &value + case "InTimeExcds": + procSnmp.Icmp.InTimeExcds = &value + case "InParmProbs": + procSnmp.Icmp.InParmProbs = &value + case "InSrcQuenchs": + procSnmp.Icmp.InSrcQuenchs = &value + case "InRedirects": + procSnmp.Icmp.InRedirects = &value + case "InEchos": + procSnmp.Icmp.InEchos = &value + case "InEchoReps": + procSnmp.Icmp.InEchoReps = &value + case "InTimestamps": + procSnmp.Icmp.InTimestamps = &value + case "InTimestampReps": + procSnmp.Icmp.InTimestampReps = &value + case "InAddrMasks": + procSnmp.Icmp.InAddrMasks = &value + case "InAddrMaskReps": + procSnmp.Icmp.InAddrMaskReps = &value + case "OutMsgs": + procSnmp.Icmp.OutMsgs = &value + case "OutErrors": + procSnmp.Icmp.OutErrors = &value + case "OutDestUnreachs": + procSnmp.Icmp.OutDestUnreachs = &value + case "OutTimeExcds": + procSnmp.Icmp.OutTimeExcds = &value + case "OutParmProbs": + procSnmp.Icmp.OutParmProbs = &value + case "OutSrcQuenchs": + procSnmp.Icmp.OutSrcQuenchs = &value + case "OutRedirects": + procSnmp.Icmp.OutRedirects = &value + case "OutEchos": + procSnmp.Icmp.OutEchos = &value + case "OutEchoReps": + procSnmp.Icmp.OutEchoReps = &value + case "OutTimestamps": + procSnmp.Icmp.OutTimestamps = &value + case "OutTimestampReps": + procSnmp.Icmp.OutTimestampReps = &value + case "OutAddrMasks": + procSnmp.Icmp.OutAddrMasks = &value + case "OutAddrMaskReps": + procSnmp.Icmp.OutAddrMaskReps = &value + } + case "IcmpMsg": + switch key { + case "InType3": + procSnmp.IcmpMsg.InType3 = &value + case "OutType3": + procSnmp.IcmpMsg.OutType3 = &value + } + case "Tcp": + switch key { + case "RtoAlgorithm": + procSnmp.Tcp.RtoAlgorithm = &value + case "RtoMin": + procSnmp.Tcp.RtoMin = &value + case "RtoMax": + procSnmp.Tcp.RtoMax = &value + case "MaxConn": + procSnmp.Tcp.MaxConn = &value + case "ActiveOpens": + procSnmp.Tcp.ActiveOpens = &value + case "PassiveOpens": + procSnmp.Tcp.PassiveOpens = &value + case "AttemptFails": + procSnmp.Tcp.AttemptFails = &value + case "EstabResets": + procSnmp.Tcp.EstabResets = &value + case "CurrEstab": + procSnmp.Tcp.CurrEstab = &value + case "InSegs": + procSnmp.Tcp.InSegs = &value + case "OutSegs": + procSnmp.Tcp.OutSegs = &value + case "RetransSegs": + procSnmp.Tcp.RetransSegs = &value + case "InErrs": + procSnmp.Tcp.InErrs = &value + case "OutRsts": + procSnmp.Tcp.OutRsts = &value + case "InCsumErrors": + procSnmp.Tcp.InCsumErrors = &value + } + case "Udp": + switch key { + case "InDatagrams": + procSnmp.Udp.InDatagrams = &value + case "NoPorts": + procSnmp.Udp.NoPorts = &value + case "InErrors": + procSnmp.Udp.InErrors = &value + case "OutDatagrams": + procSnmp.Udp.OutDatagrams = &value + case "RcvbufErrors": + procSnmp.Udp.RcvbufErrors = &value + case "SndbufErrors": + procSnmp.Udp.SndbufErrors = &value + case "InCsumErrors": + procSnmp.Udp.InCsumErrors = &value + case "IgnoredMulti": + procSnmp.Udp.IgnoredMulti = &value + } + case "UdpLite": + switch key { + case "InDatagrams": + procSnmp.UdpLite.InDatagrams = &value + case "NoPorts": + procSnmp.UdpLite.NoPorts = &value + case "InErrors": + procSnmp.UdpLite.InErrors = &value + case "OutDatagrams": + procSnmp.UdpLite.OutDatagrams = &value + case "RcvbufErrors": + procSnmp.UdpLite.RcvbufErrors = &value + case "SndbufErrors": + procSnmp.UdpLite.SndbufErrors = &value + case "InCsumErrors": + procSnmp.UdpLite.InCsumErrors = &value + case "IgnoredMulti": + procSnmp.UdpLite.IgnoredMulti = &value + } + } + } + } + return procSnmp, scanner.Err() +} diff --git a/vendor/github.com/prometheus/procfs/proc_snmp6.go b/vendor/github.com/prometheus/procfs/proc_snmp6.go new file mode 100644 index 0000000000..3059cc6a13 --- /dev/null +++ b/vendor/github.com/prometheus/procfs/proc_snmp6.go @@ -0,0 +1,381 @@ +// Copyright 2022 The Prometheus 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 procfs + +import ( + "bufio" + "bytes" + "errors" + "io" + "os" + "strconv" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +// ProcSnmp6 models the content of /proc//net/snmp6. +type ProcSnmp6 struct { + // The process ID. + PID int + Ip6 + Icmp6 + Udp6 + UdpLite6 +} + +type Ip6 struct { // nolint:revive + InReceives *float64 + InHdrErrors *float64 + InTooBigErrors *float64 + InNoRoutes *float64 + InAddrErrors *float64 + InUnknownProtos *float64 + InTruncatedPkts *float64 + InDiscards *float64 + InDelivers *float64 + OutForwDatagrams *float64 + OutRequests *float64 + OutDiscards *float64 + OutNoRoutes *float64 + ReasmTimeout *float64 + ReasmReqds *float64 + ReasmOKs *float64 + ReasmFails *float64 + FragOKs *float64 + FragFails *float64 + FragCreates *float64 + InMcastPkts *float64 + OutMcastPkts *float64 + InOctets *float64 + OutOctets *float64 + InMcastOctets *float64 + OutMcastOctets *float64 + InBcastOctets *float64 + OutBcastOctets *float64 + InNoECTPkts *float64 + InECT1Pkts *float64 + InECT0Pkts *float64 + InCEPkts *float64 +} + +type Icmp6 struct { + InMsgs *float64 + InErrors *float64 + OutMsgs *float64 + OutErrors *float64 + InCsumErrors *float64 + InDestUnreachs *float64 + InPktTooBigs *float64 + InTimeExcds *float64 + InParmProblems *float64 + InEchos *float64 + InEchoReplies *float64 + InGroupMembQueries *float64 + InGroupMembResponses *float64 + InGroupMembReductions *float64 + InRouterSolicits *float64 + InRouterAdvertisements *float64 + InNeighborSolicits *float64 + InNeighborAdvertisements *float64 + InRedirects *float64 + InMLDv2Reports *float64 + OutDestUnreachs *float64 + OutPktTooBigs *float64 + OutTimeExcds *float64 + OutParmProblems *float64 + OutEchos *float64 + OutEchoReplies *float64 + OutGroupMembQueries *float64 + OutGroupMembResponses *float64 + OutGroupMembReductions *float64 + OutRouterSolicits *float64 + OutRouterAdvertisements *float64 + OutNeighborSolicits *float64 + OutNeighborAdvertisements *float64 + OutRedirects *float64 + OutMLDv2Reports *float64 + InType1 *float64 + InType134 *float64 + InType135 *float64 + InType136 *float64 + InType143 *float64 + OutType133 *float64 + OutType135 *float64 + OutType136 *float64 + OutType143 *float64 +} + +type Udp6 struct { // nolint:revive + InDatagrams *float64 + NoPorts *float64 + InErrors *float64 + OutDatagrams *float64 + RcvbufErrors *float64 + SndbufErrors *float64 + InCsumErrors *float64 + IgnoredMulti *float64 +} + +type UdpLite6 struct { // nolint:revive + InDatagrams *float64 + NoPorts *float64 + InErrors *float64 + OutDatagrams *float64 + RcvbufErrors *float64 + SndbufErrors *float64 + InCsumErrors *float64 +} + +func (p Proc) Snmp6() (ProcSnmp6, error) { + filename := p.path("net/snmp6") + data, err := util.ReadFileNoStat(filename) + if err != nil { + // On systems with IPv6 disabled, this file won't exist. + // Do nothing. + if errors.Is(err, os.ErrNotExist) { + return ProcSnmp6{PID: p.PID}, nil + } + + return ProcSnmp6{PID: p.PID}, err + } + + procSnmp6, err := parseSNMP6Stats(bytes.NewReader(data)) + procSnmp6.PID = p.PID + return procSnmp6, err +} + +// parseSnmp6 parses the metrics from proc//net/snmp6 file +// and returns a map contains those metrics. +func parseSNMP6Stats(r io.Reader) (ProcSnmp6, error) { + var ( + scanner = bufio.NewScanner(r) + procSnmp6 = ProcSnmp6{} + ) + + for scanner.Scan() { + stat := strings.Fields(scanner.Text()) + if len(stat) < 2 { + continue + } + // Expect to have "6" in metric name, skip line otherwise + if sixIndex := strings.Index(stat[0], "6"); sixIndex != -1 { + protocol := stat[0][:sixIndex+1] + key := stat[0][sixIndex+1:] + value, err := strconv.ParseFloat(stat[1], 64) + if err != nil { + return procSnmp6, err + } + + switch protocol { + case "Ip6": + switch key { + case "InReceives": + procSnmp6.Ip6.InReceives = &value + case "InHdrErrors": + procSnmp6.Ip6.InHdrErrors = &value + case "InTooBigErrors": + procSnmp6.Ip6.InTooBigErrors = &value + case "InNoRoutes": + procSnmp6.Ip6.InNoRoutes = &value + case "InAddrErrors": + procSnmp6.Ip6.InAddrErrors = &value + case "InUnknownProtos": + procSnmp6.Ip6.InUnknownProtos = &value + case "InTruncatedPkts": + procSnmp6.Ip6.InTruncatedPkts = &value + case "InDiscards": + procSnmp6.Ip6.InDiscards = &value + case "InDelivers": + procSnmp6.Ip6.InDelivers = &value + case "OutForwDatagrams": + procSnmp6.Ip6.OutForwDatagrams = &value + case "OutRequests": + procSnmp6.Ip6.OutRequests = &value + case "OutDiscards": + procSnmp6.Ip6.OutDiscards = &value + case "OutNoRoutes": + procSnmp6.Ip6.OutNoRoutes = &value + case "ReasmTimeout": + procSnmp6.Ip6.ReasmTimeout = &value + case "ReasmReqds": + procSnmp6.Ip6.ReasmReqds = &value + case "ReasmOKs": + procSnmp6.Ip6.ReasmOKs = &value + case "ReasmFails": + procSnmp6.Ip6.ReasmFails = &value + case "FragOKs": + procSnmp6.Ip6.FragOKs = &value + case "FragFails": + procSnmp6.Ip6.FragFails = &value + case "FragCreates": + procSnmp6.Ip6.FragCreates = &value + case "InMcastPkts": + procSnmp6.Ip6.InMcastPkts = &value + case "OutMcastPkts": + procSnmp6.Ip6.OutMcastPkts = &value + case "InOctets": + procSnmp6.Ip6.InOctets = &value + case "OutOctets": + procSnmp6.Ip6.OutOctets = &value + case "InMcastOctets": + procSnmp6.Ip6.InMcastOctets = &value + case "OutMcastOctets": + procSnmp6.Ip6.OutMcastOctets = &value + case "InBcastOctets": + procSnmp6.Ip6.InBcastOctets = &value + case "OutBcastOctets": + procSnmp6.Ip6.OutBcastOctets = &value + case "InNoECTPkts": + procSnmp6.Ip6.InNoECTPkts = &value + case "InECT1Pkts": + procSnmp6.Ip6.InECT1Pkts = &value + case "InECT0Pkts": + procSnmp6.Ip6.InECT0Pkts = &value + case "InCEPkts": + procSnmp6.Ip6.InCEPkts = &value + + } + case "Icmp6": + switch key { + case "InMsgs": + procSnmp6.Icmp6.InMsgs = &value + case "InErrors": + procSnmp6.Icmp6.InErrors = &value + case "OutMsgs": + procSnmp6.Icmp6.OutMsgs = &value + case "OutErrors": + procSnmp6.Icmp6.OutErrors = &value + case "InCsumErrors": + procSnmp6.Icmp6.InCsumErrors = &value + case "InDestUnreachs": + procSnmp6.Icmp6.InDestUnreachs = &value + case "InPktTooBigs": + procSnmp6.Icmp6.InPktTooBigs = &value + case "InTimeExcds": + procSnmp6.Icmp6.InTimeExcds = &value + case "InParmProblems": + procSnmp6.Icmp6.InParmProblems = &value + case "InEchos": + procSnmp6.Icmp6.InEchos = &value + case "InEchoReplies": + procSnmp6.Icmp6.InEchoReplies = &value + case "InGroupMembQueries": + procSnmp6.Icmp6.InGroupMembQueries = &value + case "InGroupMembResponses": + procSnmp6.Icmp6.InGroupMembResponses = &value + case "InGroupMembReductions": + procSnmp6.Icmp6.InGroupMembReductions = &value + case "InRouterSolicits": + procSnmp6.Icmp6.InRouterSolicits = &value + case "InRouterAdvertisements": + procSnmp6.Icmp6.InRouterAdvertisements = &value + case "InNeighborSolicits": + procSnmp6.Icmp6.InNeighborSolicits = &value + case "InNeighborAdvertisements": + procSnmp6.Icmp6.InNeighborAdvertisements = &value + case "InRedirects": + procSnmp6.Icmp6.InRedirects = &value + case "InMLDv2Reports": + procSnmp6.Icmp6.InMLDv2Reports = &value + case "OutDestUnreachs": + procSnmp6.Icmp6.OutDestUnreachs = &value + case "OutPktTooBigs": + procSnmp6.Icmp6.OutPktTooBigs = &value + case "OutTimeExcds": + procSnmp6.Icmp6.OutTimeExcds = &value + case "OutParmProblems": + procSnmp6.Icmp6.OutParmProblems = &value + case "OutEchos": + procSnmp6.Icmp6.OutEchos = &value + case "OutEchoReplies": + procSnmp6.Icmp6.OutEchoReplies = &value + case "OutGroupMembQueries": + procSnmp6.Icmp6.OutGroupMembQueries = &value + case "OutGroupMembResponses": + procSnmp6.Icmp6.OutGroupMembResponses = &value + case "OutGroupMembReductions": + procSnmp6.Icmp6.OutGroupMembReductions = &value + case "OutRouterSolicits": + procSnmp6.Icmp6.OutRouterSolicits = &value + case "OutRouterAdvertisements": + procSnmp6.Icmp6.OutRouterAdvertisements = &value + case "OutNeighborSolicits": + procSnmp6.Icmp6.OutNeighborSolicits = &value + case "OutNeighborAdvertisements": + procSnmp6.Icmp6.OutNeighborAdvertisements = &value + case "OutRedirects": + procSnmp6.Icmp6.OutRedirects = &value + case "OutMLDv2Reports": + procSnmp6.Icmp6.OutMLDv2Reports = &value + case "InType1": + procSnmp6.Icmp6.InType1 = &value + case "InType134": + procSnmp6.Icmp6.InType134 = &value + case "InType135": + procSnmp6.Icmp6.InType135 = &value + case "InType136": + procSnmp6.Icmp6.InType136 = &value + case "InType143": + procSnmp6.Icmp6.InType143 = &value + case "OutType133": + procSnmp6.Icmp6.OutType133 = &value + case "OutType135": + procSnmp6.Icmp6.OutType135 = &value + case "OutType136": + procSnmp6.Icmp6.OutType136 = &value + case "OutType143": + procSnmp6.Icmp6.OutType143 = &value + } + case "Udp6": + switch key { + case "InDatagrams": + procSnmp6.Udp6.InDatagrams = &value + case "NoPorts": + procSnmp6.Udp6.NoPorts = &value + case "InErrors": + procSnmp6.Udp6.InErrors = &value + case "OutDatagrams": + procSnmp6.Udp6.OutDatagrams = &value + case "RcvbufErrors": + procSnmp6.Udp6.RcvbufErrors = &value + case "SndbufErrors": + procSnmp6.Udp6.SndbufErrors = &value + case "InCsumErrors": + procSnmp6.Udp6.InCsumErrors = &value + case "IgnoredMulti": + procSnmp6.Udp6.IgnoredMulti = &value + } + case "UdpLite6": + switch key { + case "InDatagrams": + procSnmp6.UdpLite6.InDatagrams = &value + case "NoPorts": + procSnmp6.UdpLite6.NoPorts = &value + case "InErrors": + procSnmp6.UdpLite6.InErrors = &value + case "OutDatagrams": + procSnmp6.UdpLite6.OutDatagrams = &value + case "RcvbufErrors": + procSnmp6.UdpLite6.RcvbufErrors = &value + case "SndbufErrors": + procSnmp6.UdpLite6.SndbufErrors = &value + case "InCsumErrors": + procSnmp6.UdpLite6.InCsumErrors = &value + } + } + } + } + return procSnmp6, scanner.Err() +} diff --git a/vendor/github.com/prometheus/procfs/proc_stat.go b/vendor/github.com/prometheus/procfs/proc_stat.go index 67ca0e9fbc..06a8d931c9 100644 --- a/vendor/github.com/prometheus/procfs/proc_stat.go +++ b/vendor/github.com/prometheus/procfs/proc_stat.go @@ -18,7 +18,6 @@ import ( "fmt" "os" - "github.com/prometheus/procfs/internal/fs" "github.com/prometheus/procfs/internal/util" ) @@ -81,10 +80,10 @@ type ProcStat struct { STime uint // Amount of time that this process's waited-for children have been // scheduled in user mode, measured in clock ticks. - CUTime uint + CUTime int // Amount of time that this process's waited-for children have been // scheduled in kernel mode, measured in clock ticks. - CSTime uint + CSTime int // For processes running a real-time scheduling policy, this is the negated // scheduling priority, minus one. Priority int @@ -100,13 +99,29 @@ type ProcStat struct { VSize uint // Resident set size in pages. RSS int - - proc fs.FS + // Soft limit in bytes on the rss of the process. + RSSLimit uint64 + // CPU number last executed on. + Processor uint + // Real-time scheduling priority, a number in the range 1 to 99 for processes + // scheduled under a real-time policy, or 0, for non-real-time processes. + RTPriority uint + // Scheduling policy. + Policy uint + // Aggregated block I/O delays, measured in clock ticks (centiseconds). + DelayAcctBlkIOTicks uint64 + // Guest time of the process (time spent running a virtual CPU for a guest + // operating system), measured in clock ticks. + GuestTime int + // Guest time of the process's children, measured in clock ticks. + CGuestTime int + + proc FS } // NewStat returns the current status information of the process. // -// Deprecated: use p.Stat() instead +// Deprecated: Use p.Stat() instead. func (p Proc) NewStat() (ProcStat, error) { return p.Stat() } @@ -119,7 +134,8 @@ func (p Proc) Stat() (ProcStat, error) { } var ( - ignore int + ignoreInt64 int64 + ignoreUint64 uint64 s = ProcStat{PID: p.PID, proc: p.fs} l = bytes.Index(data, []byte("(")) @@ -127,10 +143,15 @@ func (p Proc) Stat() (ProcStat, error) { ) if l < 0 || r < 0 { - return ProcStat{}, fmt.Errorf("unexpected format, couldn't extract comm %q", data) + return ProcStat{}, fmt.Errorf("%w: unexpected format, couldn't extract comm %q", ErrFileParse, data) } s.Comm = string(data[l+1 : r]) + + // Check the following resources for the details about the particular stat + // fields and their data types: + // * https://man7.org/linux/man-pages/man5/proc.5.html + // * https://man7.org/linux/man-pages/man3/scanf.3.html _, err = fmt.Fscan( bytes.NewBuffer(data[r+2:]), &s.State, @@ -151,10 +172,30 @@ func (p Proc) Stat() (ProcStat, error) { &s.Priority, &s.Nice, &s.NumThreads, - &ignore, + &ignoreInt64, &s.Starttime, &s.VSize, &s.RSS, + &s.RSSLimit, + &ignoreUint64, + &ignoreUint64, + &ignoreUint64, + &ignoreUint64, + &ignoreUint64, + &ignoreUint64, + &ignoreUint64, + &ignoreUint64, + &ignoreUint64, + &ignoreUint64, + &ignoreUint64, + &ignoreUint64, + &ignoreInt64, + &s.Processor, + &s.RTPriority, + &s.Policy, + &s.DelayAcctBlkIOTicks, + &s.GuestTime, + &s.CGuestTime, ) if err != nil { return ProcStat{}, err @@ -175,8 +216,7 @@ func (s ProcStat) ResidentMemory() int { // StartTime returns the unix timestamp of the process in seconds. func (s ProcStat) StartTime() (float64, error) { - fs := FS{proc: s.proc} - stat, err := fs.Stat() + stat, err := s.proc.Stat() if err != nil { return 0, err } diff --git a/vendor/github.com/prometheus/procfs/proc_status.go b/vendor/github.com/prometheus/procfs/proc_status.go index 6edd8333b3..a055197c63 100644 --- a/vendor/github.com/prometheus/procfs/proc_status.go +++ b/vendor/github.com/prometheus/procfs/proc_status.go @@ -15,6 +15,8 @@ package procfs import ( "bytes" + "math/bits" + "sort" "strconv" "strings" @@ -22,7 +24,7 @@ import ( ) // ProcStatus provides status information about the process, -// read from /proc/[pid]/stat. +// read from /proc/[pid]/status. type ProcStatus struct { // The process ID. PID int @@ -31,39 +33,41 @@ type ProcStatus struct { // Thread group ID. TGID int + // List of Pid namespace. + NSpids []uint64 // Peak virtual memory size. - VmPeak uint64 // nolint:golint + VmPeak uint64 // nolint:revive // Virtual memory size. - VmSize uint64 // nolint:golint + VmSize uint64 // nolint:revive // Locked memory size. - VmLck uint64 // nolint:golint + VmLck uint64 // nolint:revive // Pinned memory size. - VmPin uint64 // nolint:golint + VmPin uint64 // nolint:revive // Peak resident set size. - VmHWM uint64 // nolint:golint + VmHWM uint64 // nolint:revive // Resident set size (sum of RssAnnon RssFile and RssShmem). - VmRSS uint64 // nolint:golint + VmRSS uint64 // nolint:revive // Size of resident anonymous memory. - RssAnon uint64 // nolint:golint + RssAnon uint64 // nolint:revive // Size of resident file mappings. - RssFile uint64 // nolint:golint + RssFile uint64 // nolint:revive // Size of resident shared memory. - RssShmem uint64 // nolint:golint + RssShmem uint64 // nolint:revive // Size of data segments. - VmData uint64 // nolint:golint + VmData uint64 // nolint:revive // Size of stack segments. - VmStk uint64 // nolint:golint + VmStk uint64 // nolint:revive // Size of text segments. - VmExe uint64 // nolint:golint + VmExe uint64 // nolint:revive // Shared library code size. - VmLib uint64 // nolint:golint + VmLib uint64 // nolint:revive // Page table entries size. - VmPTE uint64 // nolint:golint + VmPTE uint64 // nolint:revive // Size of second-level page tables. - VmPMD uint64 // nolint:golint + VmPMD uint64 // nolint:revive // Swapped-out virtual memory size by anonymous private. - VmSwap uint64 // nolint:golint + VmSwap uint64 // nolint:revive // Size of hugetlb memory portions HugetlbPages uint64 @@ -73,9 +77,12 @@ type ProcStatus struct { NonVoluntaryCtxtSwitches uint64 // UIDs of the process (Real, effective, saved set, and filesystem UIDs) - UIDs [4]string + UIDs [4]uint64 // GIDs of the process (Real, effective, saved set, and filesystem GIDs) - GIDs [4]string + GIDs [4]uint64 + + // CpusAllowedList: List of cpu cores processes are allowed to run on. + CpusAllowedList []uint64 } // NewStatus returns the current status information of the process. @@ -96,10 +103,10 @@ func (p Proc) NewStatus() (ProcStatus, error) { kv := strings.SplitN(line, ":", 2) // removes spaces - k := string(strings.TrimSpace(kv[0])) - v := string(strings.TrimSpace(kv[1])) + k := strings.TrimSpace(kv[0]) + v := strings.TrimSpace(kv[1]) // removes "kB" - v = string(bytes.Trim([]byte(v), " kB")) + v = strings.TrimSuffix(v, " kB") // value to int when possible // we can skip error check here, 'cause vKBytes is not used when value is a string @@ -107,22 +114,39 @@ func (p Proc) NewStatus() (ProcStatus, error) { // convert kB to B vBytes := vKBytes * 1024 - s.fillStatus(k, v, vKBytes, vBytes) + err = s.fillStatus(k, v, vKBytes, vBytes) + if err != nil { + return ProcStatus{}, err + } } return s, nil } -func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintBytes uint64) { +func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintBytes uint64) error { switch k { case "Tgid": s.TGID = int(vUint) case "Name": s.Name = vString case "Uid": - copy(s.UIDs[:], strings.Split(vString, "\t")) + var err error + for i, v := range strings.Split(vString, "\t") { + s.UIDs[i], err = strconv.ParseUint(v, 10, bits.UintSize) + if err != nil { + return err + } + } case "Gid": - copy(s.GIDs[:], strings.Split(vString, "\t")) + var err error + for i, v := range strings.Split(vString, "\t") { + s.GIDs[i], err = strconv.ParseUint(v, 10, bits.UintSize) + if err != nil { + return err + } + } + case "NSpid": + s.NSpids = calcNSPidsList(vString) case "VmPeak": s.VmPeak = vUintBytes case "VmSize": @@ -161,10 +185,54 @@ func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintByt s.VoluntaryCtxtSwitches = vUint case "nonvoluntary_ctxt_switches": s.NonVoluntaryCtxtSwitches = vUint + case "Cpus_allowed_list": + s.CpusAllowedList = calcCpusAllowedList(vString) } + + return nil } // TotalCtxtSwitches returns the total context switch. func (s ProcStatus) TotalCtxtSwitches() uint64 { return s.VoluntaryCtxtSwitches + s.NonVoluntaryCtxtSwitches } + +func calcCpusAllowedList(cpuString string) []uint64 { + s := strings.Split(cpuString, ",") + + var g []uint64 + + for _, cpu := range s { + // parse cpu ranges, example: 1-3=[1,2,3] + if l := strings.Split(strings.TrimSpace(cpu), "-"); len(l) > 1 { + startCPU, _ := strconv.ParseUint(l[0], 10, 64) + endCPU, _ := strconv.ParseUint(l[1], 10, 64) + + for i := startCPU; i <= endCPU; i++ { + g = append(g, i) + } + } else if len(l) == 1 { + cpu, _ := strconv.ParseUint(l[0], 10, 64) + g = append(g, cpu) + } + + } + + sort.Slice(g, func(i, j int) bool { return g[i] < g[j] }) + return g +} + +func calcNSPidsList(nspidsString string) []uint64 { + s := strings.Split(nspidsString, " ") + var nspids []uint64 + + for _, nspid := range s { + nspid, _ := strconv.ParseUint(nspid, 10, 64) + if nspid == 0 { + continue + } + nspids = append(nspids, nspid) + } + + return nspids +} diff --git a/vendor/github.com/prometheus/procfs/proc_sys.go b/vendor/github.com/prometheus/procfs/proc_sys.go new file mode 100644 index 0000000000..5eefbe2ef8 --- /dev/null +++ b/vendor/github.com/prometheus/procfs/proc_sys.go @@ -0,0 +1,51 @@ +// Copyright 2022 The Prometheus 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 procfs + +import ( + "fmt" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +func sysctlToPath(sysctl string) string { + return strings.Replace(sysctl, ".", "/", -1) +} + +func (fs FS) SysctlStrings(sysctl string) ([]string, error) { + value, err := util.SysReadFile(fs.proc.Path("sys", sysctlToPath(sysctl))) + if err != nil { + return nil, err + } + return strings.Fields(value), nil + +} + +func (fs FS) SysctlInts(sysctl string) ([]int, error) { + fields, err := fs.SysctlStrings(sysctl) + if err != nil { + return nil, err + } + + values := make([]int, len(fields)) + for i, f := range fields { + vp := util.NewValueParser(f) + values[i] = vp.Int() + if err := vp.Err(); err != nil { + return nil, fmt.Errorf("%w: field %d in sysctl %s is not a valid int: %w", ErrFileParse, i, sysctl, err) + } + } + return values, nil +} diff --git a/vendor/github.com/prometheus/procfs/schedstat.go b/vendor/github.com/prometheus/procfs/schedstat.go index 28228164ef..5f7f32dc83 100644 --- a/vendor/github.com/prometheus/procfs/schedstat.go +++ b/vendor/github.com/prometheus/procfs/schedstat.go @@ -40,7 +40,7 @@ type Schedstat struct { CPUs []*SchedstatCPU } -// SchedstatCPU contains the values from one "cpu" line +// SchedstatCPU contains the values from one "cpu" line. type SchedstatCPU struct { CPUNum string @@ -49,14 +49,14 @@ type SchedstatCPU struct { RunTimeslices uint64 } -// ProcSchedstat contains the values from /proc//schedstat +// ProcSchedstat contains the values from `/proc//schedstat`. type ProcSchedstat struct { RunningNanoseconds uint64 WaitingNanoseconds uint64 RunTimeslices uint64 } -// Schedstat reads data from /proc/schedstat +// Schedstat reads data from `/proc/schedstat`. func (fs FS) Schedstat() (*Schedstat, error) { file, err := os.Open(fs.proc.Path("schedstat")) if err != nil { diff --git a/vendor/github.com/prometheus/procfs/slab.go b/vendor/github.com/prometheus/procfs/slab.go index 7896fd7242..8611c90177 100644 --- a/vendor/github.com/prometheus/procfs/slab.go +++ b/vendor/github.com/prometheus/procfs/slab.go @@ -68,7 +68,7 @@ func parseV21SlabEntry(line string) (*Slab, error) { l := slabSpace.ReplaceAllString(line, " ") s := strings.Split(l, " ") if len(s) != 16 { - return nil, fmt.Errorf("unable to parse: %q", line) + return nil, fmt.Errorf("%w: unable to parse: %q", ErrFileParse, line) } var err error i := &Slab{Name: s[0]} @@ -137,7 +137,7 @@ func parseSlabInfo21(r *bytes.Reader) (SlabInfo, error) { return s, nil } -// SlabInfo reads data from /proc/slabinfo +// SlabInfo reads data from `/proc/slabinfo`. func (fs FS) SlabInfo() (SlabInfo, error) { // TODO: Consider passing options to allow for parsing different // slabinfo versions. However, slabinfo 2.1 has been stable since diff --git a/vendor/github.com/prometheus/procfs/softirqs.go b/vendor/github.com/prometheus/procfs/softirqs.go new file mode 100644 index 0000000000..28708e0745 --- /dev/null +++ b/vendor/github.com/prometheus/procfs/softirqs.go @@ -0,0 +1,160 @@ +// Copyright 2022 The Prometheus 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 procfs + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strconv" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +// Softirqs represents the softirq statistics. +type Softirqs struct { + Hi []uint64 + Timer []uint64 + NetTx []uint64 + NetRx []uint64 + Block []uint64 + IRQPoll []uint64 + Tasklet []uint64 + Sched []uint64 + HRTimer []uint64 + RCU []uint64 +} + +func (fs FS) Softirqs() (Softirqs, error) { + fileName := fs.proc.Path("softirqs") + data, err := util.ReadFileNoStat(fileName) + if err != nil { + return Softirqs{}, err + } + + reader := bytes.NewReader(data) + + return parseSoftirqs(reader) +} + +func parseSoftirqs(r io.Reader) (Softirqs, error) { + var ( + softirqs = Softirqs{} + scanner = bufio.NewScanner(r) + ) + + if !scanner.Scan() { + return Softirqs{}, fmt.Errorf("%w: softirqs empty", ErrFileRead) + } + + for scanner.Scan() { + parts := strings.Fields(scanner.Text()) + var err error + + // require at least one cpu + if len(parts) < 2 { + continue + } + switch { + case parts[0] == "HI:": + perCPU := parts[1:] + softirqs.Hi = make([]uint64, len(perCPU)) + for i, count := range perCPU { + if softirqs.Hi[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (HI%d): %w", ErrFileParse, count, i, err) + } + } + case parts[0] == "TIMER:": + perCPU := parts[1:] + softirqs.Timer = make([]uint64, len(perCPU)) + for i, count := range perCPU { + if softirqs.Timer[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (TIMER%d): %w", ErrFileParse, count, i, err) + } + } + case parts[0] == "NET_TX:": + perCPU := parts[1:] + softirqs.NetTx = make([]uint64, len(perCPU)) + for i, count := range perCPU { + if softirqs.NetTx[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (NET_TX%d): %w", ErrFileParse, count, i, err) + } + } + case parts[0] == "NET_RX:": + perCPU := parts[1:] + softirqs.NetRx = make([]uint64, len(perCPU)) + for i, count := range perCPU { + if softirqs.NetRx[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (NET_RX%d): %w", ErrFileParse, count, i, err) + } + } + case parts[0] == "BLOCK:": + perCPU := parts[1:] + softirqs.Block = make([]uint64, len(perCPU)) + for i, count := range perCPU { + if softirqs.Block[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (BLOCK%d): %w", ErrFileParse, count, i, err) + } + } + case parts[0] == "IRQ_POLL:": + perCPU := parts[1:] + softirqs.IRQPoll = make([]uint64, len(perCPU)) + for i, count := range perCPU { + if softirqs.IRQPoll[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (IRQ_POLL%d): %w", ErrFileParse, count, i, err) + } + } + case parts[0] == "TASKLET:": + perCPU := parts[1:] + softirqs.Tasklet = make([]uint64, len(perCPU)) + for i, count := range perCPU { + if softirqs.Tasklet[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (TASKLET%d): %w", ErrFileParse, count, i, err) + } + } + case parts[0] == "SCHED:": + perCPU := parts[1:] + softirqs.Sched = make([]uint64, len(perCPU)) + for i, count := range perCPU { + if softirqs.Sched[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (SCHED%d): %w", ErrFileParse, count, i, err) + } + } + case parts[0] == "HRTIMER:": + perCPU := parts[1:] + softirqs.HRTimer = make([]uint64, len(perCPU)) + for i, count := range perCPU { + if softirqs.HRTimer[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (HRTIMER%d): %w", ErrFileParse, count, i, err) + } + } + case parts[0] == "RCU:": + perCPU := parts[1:] + softirqs.RCU = make([]uint64, len(perCPU)) + for i, count := range perCPU { + if softirqs.RCU[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (RCU%d): %w", ErrFileParse, count, i, err) + } + } + } + } + + if err := scanner.Err(); err != nil { + return Softirqs{}, fmt.Errorf("%w: couldn't parse softirqs: %w", ErrFileParse, err) + } + + return softirqs, scanner.Err() +} diff --git a/vendor/github.com/prometheus/procfs/stat.go b/vendor/github.com/prometheus/procfs/stat.go index 6d8727541e..e36b41c18a 100644 --- a/vendor/github.com/prometheus/procfs/stat.go +++ b/vendor/github.com/prometheus/procfs/stat.go @@ -41,7 +41,7 @@ type CPUStat struct { // SoftIRQStat represent the softirq statistics as exported in the procfs stat file. // A nice introduction can be found at https://0xax.gitbooks.io/linux-insides/content/interrupts/interrupts-9.html -// It is possible to get per-cpu stats by reading /proc/softirqs +// It is possible to get per-cpu stats by reading `/proc/softirqs`. type SoftIRQStat struct { Hi uint64 Timer uint64 @@ -62,7 +62,7 @@ type Stat struct { // Summed up cpu statistics. CPUTotal CPUStat // Per-CPU statistics. - CPU []CPUStat + CPU map[int64]CPUStat // Number of times interrupts were handled, which contains numbered and unnumbered IRQs. IRQTotal uint64 // Number of times a numbered IRQ was triggered. @@ -93,10 +93,10 @@ func parseCPUStat(line string) (CPUStat, int64, error) { &cpuStat.Guest, &cpuStat.GuestNice) if err != nil && err != io.EOF { - return CPUStat{}, -1, fmt.Errorf("couldn't parse %q (cpu): %w", line, err) + return CPUStat{}, -1, fmt.Errorf("%w: couldn't parse %q (cpu): %w", ErrFileParse, line, err) } if count == 0 { - return CPUStat{}, -1, fmt.Errorf("couldn't parse %q (cpu): 0 elements parsed", line) + return CPUStat{}, -1, fmt.Errorf("%w: couldn't parse %q (cpu): 0 elements parsed", ErrFileParse, line) } cpuStat.User /= userHZ @@ -116,7 +116,7 @@ func parseCPUStat(line string) (CPUStat, int64, error) { cpuID, err := strconv.ParseInt(cpu[3:], 10, 64) if err != nil { - return CPUStat{}, -1, fmt.Errorf("couldn't parse %q (cpu/cpuid): %w", line, err) + return CPUStat{}, -1, fmt.Errorf("%w: couldn't parse %q (cpu/cpuid): %w", ErrFileParse, line, err) } return cpuStat, cpuID, nil @@ -136,7 +136,7 @@ func parseSoftIRQStat(line string) (SoftIRQStat, uint64, error) { &softIRQStat.Hrtimer, &softIRQStat.Rcu) if err != nil { - return SoftIRQStat{}, 0, fmt.Errorf("couldn't parse %q (softirq): %w", line, err) + return SoftIRQStat{}, 0, fmt.Errorf("%w: couldn't parse %q (softirq): %w", ErrFileParse, line, err) } return softIRQStat, total, nil @@ -145,7 +145,7 @@ func parseSoftIRQStat(line string) (SoftIRQStat, uint64, error) { // NewStat returns information about current cpu/process statistics. // See https://www.kernel.org/doc/Documentation/filesystems/proc.txt // -// Deprecated: use fs.Stat() instead +// Deprecated: Use fs.Stat() instead. func NewStat() (Stat, error) { fs, err := NewFS(fs.DefaultProcMountPoint) if err != nil { @@ -155,25 +155,42 @@ func NewStat() (Stat, error) { } // NewStat returns information about current cpu/process statistics. -// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt +// See: https://www.kernel.org/doc/Documentation/filesystems/proc.txt // -// Deprecated: use fs.Stat() instead +// Deprecated: Use fs.Stat() instead. func (fs FS) NewStat() (Stat, error) { return fs.Stat() } // Stat returns information about current cpu/process statistics. -// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt +// See: https://www.kernel.org/doc/Documentation/filesystems/proc.txt func (fs FS) Stat() (Stat, error) { fileName := fs.proc.Path("stat") data, err := util.ReadFileNoStat(fileName) if err != nil { return Stat{}, err } + procStat, err := parseStat(bytes.NewReader(data), fileName) + if err != nil { + return Stat{}, err + } + return procStat, nil +} + +// parseStat parses the metrics from /proc/[pid]/stat. +func parseStat(r io.Reader, fileName string) (Stat, error) { + var ( + scanner = bufio.NewScanner(r) + stat = Stat{ + CPU: make(map[int64]CPUStat), + } + err error + ) - stat := Stat{} + // Increase default scanner buffer to handle very long `intr` lines. + buf := make([]byte, 0, 8*1024) + scanner.Buffer(buf, 1024*1024) - scanner := bufio.NewScanner(bytes.NewReader(data)) for scanner.Scan() { line := scanner.Text() parts := strings.Fields(scanner.Text()) @@ -184,34 +201,34 @@ func (fs FS) Stat() (Stat, error) { switch { case parts[0] == "btime": if stat.BootTime, err = strconv.ParseUint(parts[1], 10, 64); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %q (btime): %w", parts[1], err) + return Stat{}, fmt.Errorf("%w: couldn't parse %q (btime): %w", ErrFileParse, parts[1], err) } case parts[0] == "intr": if stat.IRQTotal, err = strconv.ParseUint(parts[1], 10, 64); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %q (intr): %w", parts[1], err) + return Stat{}, fmt.Errorf("%w: couldn't parse %q (intr): %w", ErrFileParse, parts[1], err) } numberedIRQs := parts[2:] stat.IRQ = make([]uint64, len(numberedIRQs)) for i, count := range numberedIRQs { if stat.IRQ[i], err = strconv.ParseUint(count, 10, 64); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %q (intr%d): %w", count, i, err) + return Stat{}, fmt.Errorf("%w: couldn't parse %q (intr%d): %w", ErrFileParse, count, i, err) } } case parts[0] == "ctxt": if stat.ContextSwitches, err = strconv.ParseUint(parts[1], 10, 64); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %q (ctxt): %w", parts[1], err) + return Stat{}, fmt.Errorf("%w: couldn't parse %q (ctxt): %w", ErrFileParse, parts[1], err) } case parts[0] == "processes": if stat.ProcessCreated, err = strconv.ParseUint(parts[1], 10, 64); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %q (processes): %w", parts[1], err) + return Stat{}, fmt.Errorf("%w: couldn't parse %q (processes): %w", ErrFileParse, parts[1], err) } case parts[0] == "procs_running": if stat.ProcessesRunning, err = strconv.ParseUint(parts[1], 10, 64); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %q (procs_running): %w", parts[1], err) + return Stat{}, fmt.Errorf("%w: couldn't parse %q (procs_running): %w", ErrFileParse, parts[1], err) } case parts[0] == "procs_blocked": if stat.ProcessesBlocked, err = strconv.ParseUint(parts[1], 10, 64); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %q (procs_blocked): %w", parts[1], err) + return Stat{}, fmt.Errorf("%w: couldn't parse %q (procs_blocked): %w", ErrFileParse, parts[1], err) } case parts[0] == "softirq": softIRQStats, total, err := parseSoftIRQStat(line) @@ -228,16 +245,13 @@ func (fs FS) Stat() (Stat, error) { if cpuID == -1 { stat.CPUTotal = cpuStat } else { - for int64(len(stat.CPU)) <= cpuID { - stat.CPU = append(stat.CPU, CPUStat{}) - } stat.CPU[cpuID] = cpuStat } } } if err := scanner.Err(); err != nil { - return Stat{}, fmt.Errorf("couldn't parse %q: %w", fileName, err) + return Stat{}, fmt.Errorf("%w: couldn't parse %q: %w", ErrFileParse, fileName, err) } return stat, nil diff --git a/vendor/github.com/prometheus/procfs/swaps.go b/vendor/github.com/prometheus/procfs/swaps.go index 15edc2212b..65fec834bf 100644 --- a/vendor/github.com/prometheus/procfs/swaps.go +++ b/vendor/github.com/prometheus/procfs/swaps.go @@ -64,7 +64,7 @@ func parseSwapString(swapString string) (*Swap, error) { swapFields := strings.Fields(swapString) swapLength := len(swapFields) if swapLength < 5 { - return nil, fmt.Errorf("too few fields in swap string: %s", swapString) + return nil, fmt.Errorf("%w: too few fields in swap string: %s", ErrFileParse, swapString) } swap := &Swap{ @@ -74,15 +74,15 @@ func parseSwapString(swapString string) (*Swap, error) { swap.Size, err = strconv.Atoi(swapFields[2]) if err != nil { - return nil, fmt.Errorf("invalid swap size: %s", swapFields[2]) + return nil, fmt.Errorf("%w: invalid swap size: %s: %w", ErrFileParse, swapFields[2], err) } swap.Used, err = strconv.Atoi(swapFields[3]) if err != nil { - return nil, fmt.Errorf("invalid swap used: %s", swapFields[3]) + return nil, fmt.Errorf("%w: invalid swap used: %s: %w", ErrFileParse, swapFields[3], err) } swap.Priority, err = strconv.Atoi(swapFields[4]) if err != nil { - return nil, fmt.Errorf("invalid swap priority: %s", swapFields[4]) + return nil, fmt.Errorf("%w: invalid swap priority: %s: %w", ErrFileParse, swapFields[4], err) } return swap, nil diff --git a/vendor/github.com/prometheus/procfs/thread.go b/vendor/github.com/prometheus/procfs/thread.go new file mode 100644 index 0000000000..80e0e947be --- /dev/null +++ b/vendor/github.com/prometheus/procfs/thread.go @@ -0,0 +1,80 @@ +// Copyright 2022 The Prometheus 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 procfs + +import ( + "fmt" + "os" + "strconv" + + fsi "github.com/prometheus/procfs/internal/fs" +) + +// Provide access to /proc/PID/task/TID files, for thread specific values. Since +// such files have the same structure as /proc/PID/ ones, the data structures +// and the parsers for the latter may be reused. + +// AllThreads returns a list of all currently available threads under /proc/PID. +func AllThreads(pid int) (Procs, error) { + fs, err := NewFS(DefaultMountPoint) + if err != nil { + return Procs{}, err + } + return fs.AllThreads(pid) +} + +// AllThreads returns a list of all currently available threads for PID. +func (fs FS) AllThreads(pid int) (Procs, error) { + taskPath := fs.proc.Path(strconv.Itoa(pid), "task") + d, err := os.Open(taskPath) + if err != nil { + return Procs{}, err + } + defer d.Close() + + names, err := d.Readdirnames(-1) + if err != nil { + return Procs{}, fmt.Errorf("%w: could not read %q: %w", ErrFileRead, d.Name(), err) + } + + t := Procs{} + for _, n := range names { + tid, err := strconv.ParseInt(n, 10, 64) + if err != nil { + continue + } + + t = append(t, Proc{PID: int(tid), fs: FS{fsi.FS(taskPath), fs.isReal}}) + } + + return t, nil +} + +// Thread returns a process for a given PID, TID. +func (fs FS) Thread(pid, tid int) (Proc, error) { + taskPath := fs.proc.Path(strconv.Itoa(pid), "task") + if _, err := os.Stat(taskPath); err != nil { + return Proc{}, err + } + return Proc{PID: tid, fs: FS{fsi.FS(taskPath), fs.isReal}}, nil +} + +// Thread returns a process for a given TID of Proc. +func (proc Proc) Thread(tid int) (Proc, error) { + tfs := FS{fsi.FS(proc.path("task")), proc.fs.isReal} + if _, err := os.Stat(tfs.proc.Path(strconv.Itoa(tid))); err != nil { + return Proc{}, err + } + return Proc{PID: tid, fs: tfs}, nil +} diff --git a/vendor/github.com/prometheus/procfs/vm.go b/vendor/github.com/prometheus/procfs/vm.go index cb13891414..51c49d89e8 100644 --- a/vendor/github.com/prometheus/procfs/vm.go +++ b/vendor/github.com/prometheus/procfs/vm.go @@ -11,13 +11,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package procfs import ( "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -26,10 +26,12 @@ import ( ) // The VM interface is described at -// https://www.kernel.org/doc/Documentation/sysctl/vm.txt +// +// https://www.kernel.org/doc/Documentation/sysctl/vm.txt +// // Each setting is exposed as a single file. // Each file contains one line with a single numerical value, except lowmem_reserve_ratio which holds an array -// and numa_zonelist_order (deprecated) which is a string +// and numa_zonelist_order (deprecated) which is a string. type VM struct { AdminReserveKbytes *int64 // /proc/sys/vm/admin_reserve_kbytes BlockDump *int64 // /proc/sys/vm/block_dump @@ -84,10 +86,10 @@ func (fs FS) VM() (*VM, error) { return nil, err } if !file.Mode().IsDir() { - return nil, fmt.Errorf("%s is not a directory", path) + return nil, fmt.Errorf("%w: %s is not a directory", ErrFileRead, path) } - files, err := ioutil.ReadDir(path) + files, err := os.ReadDir(path) if err != nil { return nil, err } diff --git a/vendor/github.com/prometheus/procfs/xfrm.go b/vendor/github.com/prometheus/procfs/xfrm.go deleted file mode 100644 index eed07c7d77..0000000000 --- a/vendor/github.com/prometheus/procfs/xfrm.go +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright 2017 Prometheus Team -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 procfs - -import ( - "bufio" - "fmt" - "os" - "strconv" - "strings" -) - -// XfrmStat models the contents of /proc/net/xfrm_stat. -type XfrmStat struct { - // All errors which are not matched by other - XfrmInError int - // No buffer is left - XfrmInBufferError int - // Header Error - XfrmInHdrError int - // No state found - // i.e. either inbound SPI, address, or IPSEC protocol at SA is wrong - XfrmInNoStates int - // Transformation protocol specific error - // e.g. SA Key is wrong - XfrmInStateProtoError int - // Transformation mode specific error - XfrmInStateModeError int - // Sequence error - // e.g. sequence number is out of window - XfrmInStateSeqError int - // State is expired - XfrmInStateExpired int - // State has mismatch option - // e.g. UDP encapsulation type is mismatched - XfrmInStateMismatch int - // State is invalid - XfrmInStateInvalid int - // No matching template for states - // e.g. Inbound SAs are correct but SP rule is wrong - XfrmInTmplMismatch int - // No policy is found for states - // e.g. Inbound SAs are correct but no SP is found - XfrmInNoPols int - // Policy discards - XfrmInPolBlock int - // Policy error - XfrmInPolError int - // All errors which are not matched by others - XfrmOutError int - // Bundle generation error - XfrmOutBundleGenError int - // Bundle check error - XfrmOutBundleCheckError int - // No state was found - XfrmOutNoStates int - // Transformation protocol specific error - XfrmOutStateProtoError int - // Transportation mode specific error - XfrmOutStateModeError int - // Sequence error - // i.e sequence number overflow - XfrmOutStateSeqError int - // State is expired - XfrmOutStateExpired int - // Policy discads - XfrmOutPolBlock int - // Policy is dead - XfrmOutPolDead int - // Policy Error - XfrmOutPolError int - XfrmFwdHdrError int - XfrmOutStateInvalid int - XfrmAcquireError int -} - -// NewXfrmStat reads the xfrm_stat statistics. -func NewXfrmStat() (XfrmStat, error) { - fs, err := NewFS(DefaultMountPoint) - if err != nil { - return XfrmStat{}, err - } - - return fs.NewXfrmStat() -} - -// NewXfrmStat reads the xfrm_stat statistics from the 'proc' filesystem. -func (fs FS) NewXfrmStat() (XfrmStat, error) { - file, err := os.Open(fs.proc.Path("net/xfrm_stat")) - if err != nil { - return XfrmStat{}, err - } - defer file.Close() - - var ( - x = XfrmStat{} - s = bufio.NewScanner(file) - ) - - for s.Scan() { - fields := strings.Fields(s.Text()) - - if len(fields) != 2 { - return XfrmStat{}, fmt.Errorf("couldn't parse %q line %q", file.Name(), s.Text()) - } - - name := fields[0] - value, err := strconv.Atoi(fields[1]) - if err != nil { - return XfrmStat{}, err - } - - switch name { - case "XfrmInError": - x.XfrmInError = value - case "XfrmInBufferError": - x.XfrmInBufferError = value - case "XfrmInHdrError": - x.XfrmInHdrError = value - case "XfrmInNoStates": - x.XfrmInNoStates = value - case "XfrmInStateProtoError": - x.XfrmInStateProtoError = value - case "XfrmInStateModeError": - x.XfrmInStateModeError = value - case "XfrmInStateSeqError": - x.XfrmInStateSeqError = value - case "XfrmInStateExpired": - x.XfrmInStateExpired = value - case "XfrmInStateInvalid": - x.XfrmInStateInvalid = value - case "XfrmInTmplMismatch": - x.XfrmInTmplMismatch = value - case "XfrmInNoPols": - x.XfrmInNoPols = value - case "XfrmInPolBlock": - x.XfrmInPolBlock = value - case "XfrmInPolError": - x.XfrmInPolError = value - case "XfrmOutError": - x.XfrmOutError = value - case "XfrmInStateMismatch": - x.XfrmInStateMismatch = value - case "XfrmOutBundleGenError": - x.XfrmOutBundleGenError = value - case "XfrmOutBundleCheckError": - x.XfrmOutBundleCheckError = value - case "XfrmOutNoStates": - x.XfrmOutNoStates = value - case "XfrmOutStateProtoError": - x.XfrmOutStateProtoError = value - case "XfrmOutStateModeError": - x.XfrmOutStateModeError = value - case "XfrmOutStateSeqError": - x.XfrmOutStateSeqError = value - case "XfrmOutStateExpired": - x.XfrmOutStateExpired = value - case "XfrmOutPolBlock": - x.XfrmOutPolBlock = value - case "XfrmOutPolDead": - x.XfrmOutPolDead = value - case "XfrmOutPolError": - x.XfrmOutPolError = value - case "XfrmFwdHdrError": - x.XfrmFwdHdrError = value - case "XfrmOutStateInvalid": - x.XfrmOutStateInvalid = value - case "XfrmAcquireError": - x.XfrmAcquireError = value - } - - } - - return x, s.Err() -} diff --git a/vendor/github.com/prometheus/procfs/zoneinfo.go b/vendor/github.com/prometheus/procfs/zoneinfo.go index 0b9bb6796b..e54d94b090 100644 --- a/vendor/github.com/prometheus/procfs/zoneinfo.go +++ b/vendor/github.com/prometheus/procfs/zoneinfo.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package procfs @@ -18,7 +19,7 @@ package procfs import ( "bytes" "fmt" - "io/ioutil" + "os" "regexp" "strings" @@ -72,13 +73,13 @@ var nodeZoneRE = regexp.MustCompile(`(\d+), zone\s+(\w+)`) // structs containing the relevant info. More information available here: // https://www.kernel.org/doc/Documentation/sysctl/vm.txt func (fs FS) Zoneinfo() ([]Zoneinfo, error) { - data, err := ioutil.ReadFile(fs.proc.Path("zoneinfo")) + data, err := os.ReadFile(fs.proc.Path("zoneinfo")) if err != nil { - return nil, fmt.Errorf("error reading zoneinfo %q: %w", fs.proc.Path("zoneinfo"), err) + return nil, fmt.Errorf("%w: error reading zoneinfo %q: %w", ErrFileRead, fs.proc.Path("zoneinfo"), err) } zoneinfo, err := parseZoneinfo(data) if err != nil { - return nil, fmt.Errorf("error parsing zoneinfo %q: %w", fs.proc.Path("zoneinfo"), err) + return nil, fmt.Errorf("%w: error parsing zoneinfo %q: %w", ErrFileParse, fs.proc.Path("zoneinfo"), err) } return zoneinfo, nil } @@ -99,7 +100,6 @@ func parseZoneinfo(zoneinfoData []byte) ([]Zoneinfo, error) { continue } if strings.HasPrefix(strings.TrimSpace(line), "per-node stats") { - zoneinfoElement.Zone = "" continue } parts := strings.Fields(strings.TrimSpace(line)) diff --git a/vendor/github.com/rivo/uniseg/LICENSE.txt b/vendor/github.com/rivo/uniseg/LICENSE.txt new file mode 100644 index 0000000000..5040f1ef80 --- /dev/null +++ b/vendor/github.com/rivo/uniseg/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Oliver Kuederle + +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/rivo/uniseg/README.md b/vendor/github.com/rivo/uniseg/README.md new file mode 100644 index 0000000000..f8da293e15 --- /dev/null +++ b/vendor/github.com/rivo/uniseg/README.md @@ -0,0 +1,62 @@ +# Unicode Text Segmentation for Go + +[![Godoc Reference](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/rivo/uniseg) +[![Go Report](https://img.shields.io/badge/go%20report-A%2B-brightgreen.svg)](https://goreportcard.com/report/github.com/rivo/uniseg) + +This Go package implements Unicode Text Segmentation according to [Unicode Standard Annex #29](http://unicode.org/reports/tr29/) (Unicode version 12.0.0). + +At this point, only the determination of grapheme cluster boundaries is implemented. + +## Background + +In Go, [strings are read-only slices of bytes](https://blog.golang.org/strings). They can be turned into Unicode code points using the `for` loop or by casting: `[]rune(str)`. However, multiple code points may be combined into one user-perceived character or what the Unicode specification calls "grapheme cluster". Here are some examples: + +|String|Bytes (UTF-8)|Code points (runes)|Grapheme clusters| +|-|-|-|-| +|Käse|6 bytes: `4b 61 cc 88 73 65`|5 code points: `4b 61 308 73 65`|4 clusters: `[4b],[61 308],[73],[65]`| +|🏳️‍🌈|14 bytes: `f0 9f 8f b3 ef b8 8f e2 80 8d f0 9f 8c 88`|4 code points: `1f3f3 fe0f 200d 1f308`|1 cluster: `[1f3f3 fe0f 200d 1f308]`| +|🇩🇪|8 bytes: `f0 9f 87 a9 f0 9f 87 aa`|2 code points: `1f1e9 1f1ea`|1 cluster: `[1f1e9 1f1ea]`| + +This package provides a tool to iterate over these grapheme clusters. This may be used to determine the number of user-perceived characters, to split strings in their intended places, or to extract individual characters which form a unit. + +## Installation + +```bash +go get github.com/rivo/uniseg +``` + +## Basic Example + +```go +package uniseg + +import ( + "fmt" + + "github.com/rivo/uniseg" +) + +func main() { + gr := uniseg.NewGraphemes("👍🏼!") + for gr.Next() { + fmt.Printf("%x ", gr.Runes()) + } + // Output: [1f44d 1f3fc] [21] +} +``` + +## Documentation + +Refer to https://godoc.org/github.com/rivo/uniseg for the package's documentation. + +## Dependencies + +This package does not depend on any packages outside the standard library. + +## Your Feedback + +Add your issue here on GitHub. Feel free to get in touch if you have any questions. + +## Version + +Version tags will be introduced once Golang modules are official. Consider this version 0.1. diff --git a/vendor/github.com/rivo/uniseg/doc.go b/vendor/github.com/rivo/uniseg/doc.go new file mode 100644 index 0000000000..60c737d7b3 --- /dev/null +++ b/vendor/github.com/rivo/uniseg/doc.go @@ -0,0 +1,8 @@ +/* +Package uniseg implements Unicode Text Segmentation according to Unicode +Standard Annex #29 (http://unicode.org/reports/tr29/). + +At this point, only the determination of grapheme cluster boundaries is +implemented. +*/ +package uniseg diff --git a/vendor/github.com/rivo/uniseg/grapheme.go b/vendor/github.com/rivo/uniseg/grapheme.go new file mode 100644 index 0000000000..207157f5e4 --- /dev/null +++ b/vendor/github.com/rivo/uniseg/grapheme.go @@ -0,0 +1,268 @@ +package uniseg + +import "unicode/utf8" + +// The states of the grapheme cluster parser. +const ( + grAny = iota + grCR + grControlLF + grL + grLVV + grLVTT + grPrepend + grExtendedPictographic + grExtendedPictographicZWJ + grRIOdd + grRIEven +) + +// The grapheme cluster parser's breaking instructions. +const ( + grNoBoundary = iota + grBoundary +) + +// The grapheme cluster parser's state transitions. Maps (state, property) to +// (new state, breaking instruction, rule number). The breaking instruction +// always refers to the boundary between the last and next code point. +// +// This map is queried as follows: +// +// 1. Find specific state + specific property. Stop if found. +// 2. Find specific state + any property. +// 3. Find any state + specific property. +// 4. If only (2) or (3) (but not both) was found, stop. +// 5. If both (2) and (3) were found, use state and breaking instruction from +// the transition with the lower rule number, prefer (3) if rule numbers +// are equal. Stop. +// 6. Assume grAny and grBoundary. +var grTransitions = map[[2]int][3]int{ + // GB5 + {grAny, prCR}: {grCR, grBoundary, 50}, + {grAny, prLF}: {grControlLF, grBoundary, 50}, + {grAny, prControl}: {grControlLF, grBoundary, 50}, + + // GB4 + {grCR, prAny}: {grAny, grBoundary, 40}, + {grControlLF, prAny}: {grAny, grBoundary, 40}, + + // GB3. + {grCR, prLF}: {grAny, grNoBoundary, 30}, + + // GB6. + {grAny, prL}: {grL, grBoundary, 9990}, + {grL, prL}: {grL, grNoBoundary, 60}, + {grL, prV}: {grLVV, grNoBoundary, 60}, + {grL, prLV}: {grLVV, grNoBoundary, 60}, + {grL, prLVT}: {grLVTT, grNoBoundary, 60}, + + // GB7. + {grAny, prLV}: {grLVV, grBoundary, 9990}, + {grAny, prV}: {grLVV, grBoundary, 9990}, + {grLVV, prV}: {grLVV, grNoBoundary, 70}, + {grLVV, prT}: {grLVTT, grNoBoundary, 70}, + + // GB8. + {grAny, prLVT}: {grLVTT, grBoundary, 9990}, + {grAny, prT}: {grLVTT, grBoundary, 9990}, + {grLVTT, prT}: {grLVTT, grNoBoundary, 80}, + + // GB9. + {grAny, prExtend}: {grAny, grNoBoundary, 90}, + {grAny, prZWJ}: {grAny, grNoBoundary, 90}, + + // GB9a. + {grAny, prSpacingMark}: {grAny, grNoBoundary, 91}, + + // GB9b. + {grAny, prPreprend}: {grPrepend, grBoundary, 9990}, + {grPrepend, prAny}: {grAny, grNoBoundary, 92}, + + // GB11. + {grAny, prExtendedPictographic}: {grExtendedPictographic, grBoundary, 9990}, + {grExtendedPictographic, prExtend}: {grExtendedPictographic, grNoBoundary, 110}, + {grExtendedPictographic, prZWJ}: {grExtendedPictographicZWJ, grNoBoundary, 110}, + {grExtendedPictographicZWJ, prExtendedPictographic}: {grExtendedPictographic, grNoBoundary, 110}, + + // GB12 / GB13. + {grAny, prRegionalIndicator}: {grRIOdd, grBoundary, 9990}, + {grRIOdd, prRegionalIndicator}: {grRIEven, grNoBoundary, 120}, + {grRIEven, prRegionalIndicator}: {grRIOdd, grBoundary, 120}, +} + +// Graphemes implements an iterator over Unicode extended grapheme clusters, +// specified in the Unicode Standard Annex #29. Grapheme clusters correspond to +// "user-perceived characters". These characters often consist of multiple +// code points (e.g. the "woman kissing woman" emoji consists of 8 code points: +// woman + ZWJ + heavy black heart (2 code points) + ZWJ + kiss mark + ZWJ + +// woman) and the rules described in Annex #29 must be applied to group those +// code points into clusters perceived by the user as one character. +type Graphemes struct { + // The code points over which this class iterates. + codePoints []rune + + // The (byte-based) indices of the code points into the original string plus + // len(original string). Thus, len(indices) = len(codePoints) + 1. + indices []int + + // The current grapheme cluster to be returned. These are indices into + // codePoints/indices. If start == end, we either haven't started iterating + // yet (0) or the iteration has already completed (1). + start, end int + + // The index of the next code point to be parsed. + pos int + + // The current state of the code point parser. + state int +} + +// NewGraphemes returns a new grapheme cluster iterator. +func NewGraphemes(s string) *Graphemes { + l := utf8.RuneCountInString(s) + codePoints := make([]rune, l) + indices := make([]int, l+1) + i := 0 + for pos, r := range s { + codePoints[i] = r + indices[i] = pos + i++ + } + indices[l] = len(s) + g := &Graphemes{ + codePoints: codePoints, + indices: indices, + } + g.Next() // Parse ahead. + return g +} + +// Next advances the iterator by one grapheme cluster and returns false if no +// clusters are left. This function must be called before the first cluster is +// accessed. +func (g *Graphemes) Next() bool { + g.start = g.end + + // The state transition gives us a boundary instruction BEFORE the next code + // point so we always need to stay ahead by one code point. + + // Parse the next code point. + for g.pos <= len(g.codePoints) { + // GB2. + if g.pos == len(g.codePoints) { + g.end = g.pos + g.pos++ + break + } + + // Determine the property of the next character. + nextProperty := property(g.codePoints[g.pos]) + g.pos++ + + // Find the applicable transition. + var boundary bool + transition, ok := grTransitions[[2]int{g.state, nextProperty}] + if ok { + // We have a specific transition. We'll use it. + g.state = transition[0] + boundary = transition[1] == grBoundary + } else { + // No specific transition found. Try the less specific ones. + transAnyProp, okAnyProp := grTransitions[[2]int{g.state, prAny}] + transAnyState, okAnyState := grTransitions[[2]int{grAny, nextProperty}] + if okAnyProp && okAnyState { + // Both apply. We'll use a mix (see comments for grTransitions). + g.state = transAnyState[0] + boundary = transAnyState[1] == grBoundary + if transAnyProp[2] < transAnyState[2] { + g.state = transAnyProp[0] + boundary = transAnyProp[1] == grBoundary + } + } else if okAnyProp { + // We only have a specific state. + g.state = transAnyProp[0] + boundary = transAnyProp[1] == grBoundary + // This branch will probably never be reached because okAnyState will + // always be true given the current transition map. But we keep it here + // for future modifications to the transition map where this may not be + // true anymore. + } else if okAnyState { + // We only have a specific property. + g.state = transAnyState[0] + boundary = transAnyState[1] == grBoundary + } else { + // No known transition. GB999: Any x Any. + g.state = grAny + boundary = true + } + } + + // If we found a cluster boundary, let's stop here. The current cluster will + // be the one that just ended. + if g.pos-1 == 0 /* GB1 */ || boundary { + g.end = g.pos - 1 + break + } + } + + return g.start != g.end +} + +// Runes returns a slice of runes (code points) which corresponds to the current +// grapheme cluster. If the iterator is already past the end or Next() has not +// yet been called, nil is returned. +func (g *Graphemes) Runes() []rune { + if g.start == g.end { + return nil + } + return g.codePoints[g.start:g.end] +} + +// Str returns a substring of the original string which corresponds to the +// current grapheme cluster. If the iterator is already past the end or Next() +// has not yet been called, an empty string is returned. +func (g *Graphemes) Str() string { + if g.start == g.end { + return "" + } + return string(g.codePoints[g.start:g.end]) +} + +// Bytes returns a byte slice which corresponds to the current grapheme cluster. +// If the iterator is already past the end or Next() has not yet been called, +// nil is returned. +func (g *Graphemes) Bytes() []byte { + if g.start == g.end { + return nil + } + return []byte(string(g.codePoints[g.start:g.end])) +} + +// Positions returns the interval of the current grapheme cluster as byte +// positions into the original string. The first returned value "from" indexes +// the first byte and the second returned value "to" indexes the first byte that +// is not included anymore, i.e. str[from:to] is the current grapheme cluster of +// the original string "str". If Next() has not yet been called, both values are +// 0. If the iterator is already past the end, both values are 1. +func (g *Graphemes) Positions() (int, int) { + return g.indices[g.start], g.indices[g.end] +} + +// Reset puts the iterator into its initial state such that the next call to +// Next() sets it to the first grapheme cluster again. +func (g *Graphemes) Reset() { + g.start, g.end, g.pos, g.state = 0, 0, 0, grAny + g.Next() // Parse ahead again. +} + +// GraphemeClusterCount returns the number of user-perceived characters +// (grapheme clusters) for the given string. To calculate this number, it +// iterates through the string using the Graphemes iterator. +func GraphemeClusterCount(s string) (n int) { + g := NewGraphemes(s) + for g.Next() { + n++ + } + return +} diff --git a/vendor/github.com/rivo/uniseg/properties.go b/vendor/github.com/rivo/uniseg/properties.go new file mode 100644 index 0000000000..a75ab58839 --- /dev/null +++ b/vendor/github.com/rivo/uniseg/properties.go @@ -0,0 +1,1658 @@ +package uniseg + +// The unicode properties. Only the ones needed in the context of this package +// are included. +const ( + prAny = iota + prPreprend + prCR + prLF + prControl + prExtend + prRegionalIndicator + prSpacingMark + prL + prV + prT + prLV + prLVT + prZWJ + prExtendedPictographic +) + +// Maps code point ranges to their properties. In the context of this package, +// any code point that is not contained may map to "prAny". The code point +// ranges in this slice are numerically sorted. +// +// These ranges were taken from +// http://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakProperty.txt +// as well as +// https://unicode.org/Public/emoji/latest/emoji-data.txt +// ("Extended_Pictographic" only) on March 11, 2019. See +// https://www.unicode.org/license.html for the Unicode license agreement. +var codePoints = [][3]int{ + {0x0000, 0x0009, prControl}, // Cc [10] .. + {0x000A, 0x000A, prLF}, // Cc + {0x000B, 0x000C, prControl}, // Cc [2] .. + {0x000D, 0x000D, prCR}, // Cc + {0x000E, 0x001F, prControl}, // Cc [18] .. + {0x007F, 0x009F, prControl}, // Cc [33] .. + {0x00A9, 0x00A9, prExtendedPictographic}, // 1.1 [1] (©️) copyright + {0x00AD, 0x00AD, prControl}, // Cf SOFT HYPHEN + {0x00AE, 0x00AE, prExtendedPictographic}, // 1.1 [1] (®️) registered + {0x0300, 0x036F, prExtend}, // Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X + {0x0483, 0x0487, prExtend}, // Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE + {0x0488, 0x0489, prExtend}, // Me [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN + {0x0591, 0x05BD, prExtend}, // Mn [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG + {0x05BF, 0x05BF, prExtend}, // Mn HEBREW POINT RAFE + {0x05C1, 0x05C2, prExtend}, // Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT + {0x05C4, 0x05C5, prExtend}, // Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT + {0x05C7, 0x05C7, prExtend}, // Mn HEBREW POINT QAMATS QATAN + {0x0600, 0x0605, prPreprend}, // Cf [6] ARABIC NUMBER SIGN..ARABIC NUMBER MARK ABOVE + {0x0610, 0x061A, prExtend}, // Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA + {0x061C, 0x061C, prControl}, // Cf ARABIC LETTER MARK + {0x064B, 0x065F, prExtend}, // Mn [21] ARABIC FATHATAN..ARABIC WAVY HAMZA BELOW + {0x0670, 0x0670, prExtend}, // Mn ARABIC LETTER SUPERSCRIPT ALEF + {0x06D6, 0x06DC, prExtend}, // Mn [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN + {0x06DD, 0x06DD, prPreprend}, // Cf ARABIC END OF AYAH + {0x06DF, 0x06E4, prExtend}, // Mn [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA + {0x06E7, 0x06E8, prExtend}, // Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON + {0x06EA, 0x06ED, prExtend}, // Mn [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM + {0x070F, 0x070F, prPreprend}, // Cf SYRIAC ABBREVIATION MARK + {0x0711, 0x0711, prExtend}, // Mn SYRIAC LETTER SUPERSCRIPT ALAPH + {0x0730, 0x074A, prExtend}, // Mn [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH + {0x07A6, 0x07B0, prExtend}, // Mn [11] THAANA ABAFILI..THAANA SUKUN + {0x07EB, 0x07F3, prExtend}, // Mn [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE + {0x07FD, 0x07FD, prExtend}, // Mn NKO DANTAYALAN + {0x0816, 0x0819, prExtend}, // Mn [4] SAMARITAN MARK IN..SAMARITAN MARK DAGESH + {0x081B, 0x0823, prExtend}, // Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A + {0x0825, 0x0827, prExtend}, // Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U + {0x0829, 0x082D, prExtend}, // Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA + {0x0859, 0x085B, prExtend}, // Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK + {0x08D3, 0x08E1, prExtend}, // Mn [15] ARABIC SMALL LOW WAW..ARABIC SMALL HIGH SIGN SAFHA + {0x08E2, 0x08E2, prPreprend}, // Cf ARABIC DISPUTED END OF AYAH + {0x08E3, 0x0902, prExtend}, // Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA + {0x0903, 0x0903, prSpacingMark}, // Mc DEVANAGARI SIGN VISARGA + {0x093A, 0x093A, prExtend}, // Mn DEVANAGARI VOWEL SIGN OE + {0x093B, 0x093B, prSpacingMark}, // Mc DEVANAGARI VOWEL SIGN OOE + {0x093C, 0x093C, prExtend}, // Mn DEVANAGARI SIGN NUKTA + {0x093E, 0x0940, prSpacingMark}, // Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II + {0x0941, 0x0948, prExtend}, // Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI + {0x0949, 0x094C, prSpacingMark}, // Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU + {0x094D, 0x094D, prExtend}, // Mn DEVANAGARI SIGN VIRAMA + {0x094E, 0x094F, prSpacingMark}, // Mc [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW + {0x0951, 0x0957, prExtend}, // Mn [7] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI VOWEL SIGN UUE + {0x0962, 0x0963, prExtend}, // Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL + {0x0981, 0x0981, prExtend}, // Mn BENGALI SIGN CANDRABINDU + {0x0982, 0x0983, prSpacingMark}, // Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA + {0x09BC, 0x09BC, prExtend}, // Mn BENGALI SIGN NUKTA + {0x09BE, 0x09BE, prExtend}, // Mc BENGALI VOWEL SIGN AA + {0x09BF, 0x09C0, prSpacingMark}, // Mc [2] BENGALI VOWEL SIGN I..BENGALI VOWEL SIGN II + {0x09C1, 0x09C4, prExtend}, // Mn [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR + {0x09C7, 0x09C8, prSpacingMark}, // Mc [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI + {0x09CB, 0x09CC, prSpacingMark}, // Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU + {0x09CD, 0x09CD, prExtend}, // Mn BENGALI SIGN VIRAMA + {0x09D7, 0x09D7, prExtend}, // Mc BENGALI AU LENGTH MARK + {0x09E2, 0x09E3, prExtend}, // Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL + {0x09FE, 0x09FE, prExtend}, // Mn BENGALI SANDHI MARK + {0x0A01, 0x0A02, prExtend}, // Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI + {0x0A03, 0x0A03, prSpacingMark}, // Mc GURMUKHI SIGN VISARGA + {0x0A3C, 0x0A3C, prExtend}, // Mn GURMUKHI SIGN NUKTA + {0x0A3E, 0x0A40, prSpacingMark}, // Mc [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II + {0x0A41, 0x0A42, prExtend}, // Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU + {0x0A47, 0x0A48, prExtend}, // Mn [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI + {0x0A4B, 0x0A4D, prExtend}, // Mn [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA + {0x0A51, 0x0A51, prExtend}, // Mn GURMUKHI SIGN UDAAT + {0x0A70, 0x0A71, prExtend}, // Mn [2] GURMUKHI TIPPI..GURMUKHI ADDAK + {0x0A75, 0x0A75, prExtend}, // Mn GURMUKHI SIGN YAKASH + {0x0A81, 0x0A82, prExtend}, // Mn [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA + {0x0A83, 0x0A83, prSpacingMark}, // Mc GUJARATI SIGN VISARGA + {0x0ABC, 0x0ABC, prExtend}, // Mn GUJARATI SIGN NUKTA + {0x0ABE, 0x0AC0, prSpacingMark}, // Mc [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II + {0x0AC1, 0x0AC5, prExtend}, // Mn [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E + {0x0AC7, 0x0AC8, prExtend}, // Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI + {0x0AC9, 0x0AC9, prSpacingMark}, // Mc GUJARATI VOWEL SIGN CANDRA O + {0x0ACB, 0x0ACC, prSpacingMark}, // Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU + {0x0ACD, 0x0ACD, prExtend}, // Mn GUJARATI SIGN VIRAMA + {0x0AE2, 0x0AE3, prExtend}, // Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL + {0x0AFA, 0x0AFF, prExtend}, // Mn [6] GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE + {0x0B01, 0x0B01, prExtend}, // Mn ORIYA SIGN CANDRABINDU + {0x0B02, 0x0B03, prSpacingMark}, // Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA + {0x0B3C, 0x0B3C, prExtend}, // Mn ORIYA SIGN NUKTA + {0x0B3E, 0x0B3E, prExtend}, // Mc ORIYA VOWEL SIGN AA + {0x0B3F, 0x0B3F, prExtend}, // Mn ORIYA VOWEL SIGN I + {0x0B40, 0x0B40, prSpacingMark}, // Mc ORIYA VOWEL SIGN II + {0x0B41, 0x0B44, prExtend}, // Mn [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR + {0x0B47, 0x0B48, prSpacingMark}, // Mc [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI + {0x0B4B, 0x0B4C, prSpacingMark}, // Mc [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU + {0x0B4D, 0x0B4D, prExtend}, // Mn ORIYA SIGN VIRAMA + {0x0B56, 0x0B56, prExtend}, // Mn ORIYA AI LENGTH MARK + {0x0B57, 0x0B57, prExtend}, // Mc ORIYA AU LENGTH MARK + {0x0B62, 0x0B63, prExtend}, // Mn [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL + {0x0B82, 0x0B82, prExtend}, // Mn TAMIL SIGN ANUSVARA + {0x0BBE, 0x0BBE, prExtend}, // Mc TAMIL VOWEL SIGN AA + {0x0BBF, 0x0BBF, prSpacingMark}, // Mc TAMIL VOWEL SIGN I + {0x0BC0, 0x0BC0, prExtend}, // Mn TAMIL VOWEL SIGN II + {0x0BC1, 0x0BC2, prSpacingMark}, // Mc [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU + {0x0BC6, 0x0BC8, prSpacingMark}, // Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI + {0x0BCA, 0x0BCC, prSpacingMark}, // Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU + {0x0BCD, 0x0BCD, prExtend}, // Mn TAMIL SIGN VIRAMA + {0x0BD7, 0x0BD7, prExtend}, // Mc TAMIL AU LENGTH MARK + {0x0C00, 0x0C00, prExtend}, // Mn TELUGU SIGN COMBINING CANDRABINDU ABOVE + {0x0C01, 0x0C03, prSpacingMark}, // Mc [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA + {0x0C04, 0x0C04, prExtend}, // Mn TELUGU SIGN COMBINING ANUSVARA ABOVE + {0x0C3E, 0x0C40, prExtend}, // Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II + {0x0C41, 0x0C44, prSpacingMark}, // Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR + {0x0C46, 0x0C48, prExtend}, // Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI + {0x0C4A, 0x0C4D, prExtend}, // Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA + {0x0C55, 0x0C56, prExtend}, // Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK + {0x0C62, 0x0C63, prExtend}, // Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL + {0x0C81, 0x0C81, prExtend}, // Mn KANNADA SIGN CANDRABINDU + {0x0C82, 0x0C83, prSpacingMark}, // Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA + {0x0CBC, 0x0CBC, prExtend}, // Mn KANNADA SIGN NUKTA + {0x0CBE, 0x0CBE, prSpacingMark}, // Mc KANNADA VOWEL SIGN AA + {0x0CBF, 0x0CBF, prExtend}, // Mn KANNADA VOWEL SIGN I + {0x0CC0, 0x0CC1, prSpacingMark}, // Mc [2] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN U + {0x0CC2, 0x0CC2, prExtend}, // Mc KANNADA VOWEL SIGN UU + {0x0CC3, 0x0CC4, prSpacingMark}, // Mc [2] KANNADA VOWEL SIGN VOCALIC R..KANNADA VOWEL SIGN VOCALIC RR + {0x0CC6, 0x0CC6, prExtend}, // Mn KANNADA VOWEL SIGN E + {0x0CC7, 0x0CC8, prSpacingMark}, // Mc [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI + {0x0CCA, 0x0CCB, prSpacingMark}, // Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO + {0x0CCC, 0x0CCD, prExtend}, // Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA + {0x0CD5, 0x0CD6, prExtend}, // Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK + {0x0CE2, 0x0CE3, prExtend}, // Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL + {0x0D00, 0x0D01, prExtend}, // Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU + {0x0D02, 0x0D03, prSpacingMark}, // Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA + {0x0D3B, 0x0D3C, prExtend}, // Mn [2] MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA + {0x0D3E, 0x0D3E, prExtend}, // Mc MALAYALAM VOWEL SIGN AA + {0x0D3F, 0x0D40, prSpacingMark}, // Mc [2] MALAYALAM VOWEL SIGN I..MALAYALAM VOWEL SIGN II + {0x0D41, 0x0D44, prExtend}, // Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR + {0x0D46, 0x0D48, prSpacingMark}, // Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI + {0x0D4A, 0x0D4C, prSpacingMark}, // Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU + {0x0D4D, 0x0D4D, prExtend}, // Mn MALAYALAM SIGN VIRAMA + {0x0D4E, 0x0D4E, prPreprend}, // Lo MALAYALAM LETTER DOT REPH + {0x0D57, 0x0D57, prExtend}, // Mc MALAYALAM AU LENGTH MARK + {0x0D62, 0x0D63, prExtend}, // Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL + {0x0D82, 0x0D83, prSpacingMark}, // Mc [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA + {0x0DCA, 0x0DCA, prExtend}, // Mn SINHALA SIGN AL-LAKUNA + {0x0DCF, 0x0DCF, prExtend}, // Mc SINHALA VOWEL SIGN AELA-PILLA + {0x0DD0, 0x0DD1, prSpacingMark}, // Mc [2] SINHALA VOWEL SIGN KETTI AEDA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA + {0x0DD2, 0x0DD4, prExtend}, // Mn [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA + {0x0DD6, 0x0DD6, prExtend}, // Mn SINHALA VOWEL SIGN DIGA PAA-PILLA + {0x0DD8, 0x0DDE, prSpacingMark}, // Mc [7] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA + {0x0DDF, 0x0DDF, prExtend}, // Mc SINHALA VOWEL SIGN GAYANUKITTA + {0x0DF2, 0x0DF3, prSpacingMark}, // Mc [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA + {0x0E31, 0x0E31, prExtend}, // Mn THAI CHARACTER MAI HAN-AKAT + {0x0E33, 0x0E33, prSpacingMark}, // Lo THAI CHARACTER SARA AM + {0x0E34, 0x0E3A, prExtend}, // Mn [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU + {0x0E47, 0x0E4E, prExtend}, // Mn [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN + {0x0EB1, 0x0EB1, prExtend}, // Mn LAO VOWEL SIGN MAI KAN + {0x0EB3, 0x0EB3, prSpacingMark}, // Lo LAO VOWEL SIGN AM + {0x0EB4, 0x0EBC, prExtend}, // Mn [9] LAO VOWEL SIGN I..LAO SEMIVOWEL SIGN LO + {0x0EC8, 0x0ECD, prExtend}, // Mn [6] LAO TONE MAI EK..LAO NIGGAHITA + {0x0F18, 0x0F19, prExtend}, // Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS + {0x0F35, 0x0F35, prExtend}, // Mn TIBETAN MARK NGAS BZUNG NYI ZLA + {0x0F37, 0x0F37, prExtend}, // Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS + {0x0F39, 0x0F39, prExtend}, // Mn TIBETAN MARK TSA -PHRU + {0x0F3E, 0x0F3F, prSpacingMark}, // Mc [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES + {0x0F71, 0x0F7E, prExtend}, // Mn [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO + {0x0F7F, 0x0F7F, prSpacingMark}, // Mc TIBETAN SIGN RNAM BCAD + {0x0F80, 0x0F84, prExtend}, // Mn [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA + {0x0F86, 0x0F87, prExtend}, // Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS + {0x0F8D, 0x0F97, prExtend}, // Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA + {0x0F99, 0x0FBC, prExtend}, // Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA + {0x0FC6, 0x0FC6, prExtend}, // Mn TIBETAN SYMBOL PADMA GDAN + {0x102D, 0x1030, prExtend}, // Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU + {0x1031, 0x1031, prSpacingMark}, // Mc MYANMAR VOWEL SIGN E + {0x1032, 0x1037, prExtend}, // Mn [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW + {0x1039, 0x103A, prExtend}, // Mn [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT + {0x103B, 0x103C, prSpacingMark}, // Mc [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA + {0x103D, 0x103E, prExtend}, // Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA + {0x1056, 0x1057, prSpacingMark}, // Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR + {0x1058, 0x1059, prExtend}, // Mn [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL + {0x105E, 0x1060, prExtend}, // Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA + {0x1071, 0x1074, prExtend}, // Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE + {0x1082, 0x1082, prExtend}, // Mn MYANMAR CONSONANT SIGN SHAN MEDIAL WA + {0x1084, 0x1084, prSpacingMark}, // Mc MYANMAR VOWEL SIGN SHAN E + {0x1085, 0x1086, prExtend}, // Mn [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y + {0x108D, 0x108D, prExtend}, // Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE + {0x109D, 0x109D, prExtend}, // Mn MYANMAR VOWEL SIGN AITON AI + {0x1100, 0x115F, prL}, // Lo [96] HANGUL CHOSEONG KIYEOK..HANGUL CHOSEONG FILLER + {0x1160, 0x11A7, prV}, // Lo [72] HANGUL JUNGSEONG FILLER..HANGUL JUNGSEONG O-YAE + {0x11A8, 0x11FF, prT}, // Lo [88] HANGUL JONGSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN + {0x135D, 0x135F, prExtend}, // Mn [3] ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK..ETHIOPIC COMBINING GEMINATION MARK + {0x1712, 0x1714, prExtend}, // Mn [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA + {0x1732, 0x1734, prExtend}, // Mn [3] HANUNOO VOWEL SIGN I..HANUNOO SIGN PAMUDPOD + {0x1752, 0x1753, prExtend}, // Mn [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U + {0x1772, 0x1773, prExtend}, // Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U + {0x17B4, 0x17B5, prExtend}, // Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA + {0x17B6, 0x17B6, prSpacingMark}, // Mc KHMER VOWEL SIGN AA + {0x17B7, 0x17BD, prExtend}, // Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA + {0x17BE, 0x17C5, prSpacingMark}, // Mc [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU + {0x17C6, 0x17C6, prExtend}, // Mn KHMER SIGN NIKAHIT + {0x17C7, 0x17C8, prSpacingMark}, // Mc [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU + {0x17C9, 0x17D3, prExtend}, // Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT + {0x17DD, 0x17DD, prExtend}, // Mn KHMER SIGN ATTHACAN + {0x180B, 0x180D, prExtend}, // Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE + {0x180E, 0x180E, prControl}, // Cf MONGOLIAN VOWEL SEPARATOR + {0x1885, 0x1886, prExtend}, // Mn [2] MONGOLIAN LETTER ALI GALI BALUDA..MONGOLIAN LETTER ALI GALI THREE BALUDA + {0x18A9, 0x18A9, prExtend}, // Mn MONGOLIAN LETTER ALI GALI DAGALGA + {0x1920, 0x1922, prExtend}, // Mn [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U + {0x1923, 0x1926, prSpacingMark}, // Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU + {0x1927, 0x1928, prExtend}, // Mn [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O + {0x1929, 0x192B, prSpacingMark}, // Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA + {0x1930, 0x1931, prSpacingMark}, // Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA + {0x1932, 0x1932, prExtend}, // Mn LIMBU SMALL LETTER ANUSVARA + {0x1933, 0x1938, prSpacingMark}, // Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA + {0x1939, 0x193B, prExtend}, // Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I + {0x1A17, 0x1A18, prExtend}, // Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U + {0x1A19, 0x1A1A, prSpacingMark}, // Mc [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O + {0x1A1B, 0x1A1B, prExtend}, // Mn BUGINESE VOWEL SIGN AE + {0x1A55, 0x1A55, prSpacingMark}, // Mc TAI THAM CONSONANT SIGN MEDIAL RA + {0x1A56, 0x1A56, prExtend}, // Mn TAI THAM CONSONANT SIGN MEDIAL LA + {0x1A57, 0x1A57, prSpacingMark}, // Mc TAI THAM CONSONANT SIGN LA TANG LAI + {0x1A58, 0x1A5E, prExtend}, // Mn [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA + {0x1A60, 0x1A60, prExtend}, // Mn TAI THAM SIGN SAKOT + {0x1A62, 0x1A62, prExtend}, // Mn TAI THAM VOWEL SIGN MAI SAT + {0x1A65, 0x1A6C, prExtend}, // Mn [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW + {0x1A6D, 0x1A72, prSpacingMark}, // Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI + {0x1A73, 0x1A7C, prExtend}, // Mn [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN + {0x1A7F, 0x1A7F, prExtend}, // Mn TAI THAM COMBINING CRYPTOGRAMMIC DOT + {0x1AB0, 0x1ABD, prExtend}, // Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW + {0x1ABE, 0x1ABE, prExtend}, // Me COMBINING PARENTHESES OVERLAY + {0x1B00, 0x1B03, prExtend}, // Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG + {0x1B04, 0x1B04, prSpacingMark}, // Mc BALINESE SIGN BISAH + {0x1B34, 0x1B34, prExtend}, // Mn BALINESE SIGN REREKAN + {0x1B35, 0x1B35, prExtend}, // Mc BALINESE VOWEL SIGN TEDUNG + {0x1B36, 0x1B3A, prExtend}, // Mn [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA + {0x1B3B, 0x1B3B, prSpacingMark}, // Mc BALINESE VOWEL SIGN RA REPA TEDUNG + {0x1B3C, 0x1B3C, prExtend}, // Mn BALINESE VOWEL SIGN LA LENGA + {0x1B3D, 0x1B41, prSpacingMark}, // Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG + {0x1B42, 0x1B42, prExtend}, // Mn BALINESE VOWEL SIGN PEPET + {0x1B43, 0x1B44, prSpacingMark}, // Mc [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG + {0x1B6B, 0x1B73, prExtend}, // Mn [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG + {0x1B80, 0x1B81, prExtend}, // Mn [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR + {0x1B82, 0x1B82, prSpacingMark}, // Mc SUNDANESE SIGN PANGWISAD + {0x1BA1, 0x1BA1, prSpacingMark}, // Mc SUNDANESE CONSONANT SIGN PAMINGKAL + {0x1BA2, 0x1BA5, prExtend}, // Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU + {0x1BA6, 0x1BA7, prSpacingMark}, // Mc [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG + {0x1BA8, 0x1BA9, prExtend}, // Mn [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG + {0x1BAA, 0x1BAA, prSpacingMark}, // Mc SUNDANESE SIGN PAMAAEH + {0x1BAB, 0x1BAD, prExtend}, // Mn [3] SUNDANESE SIGN VIRAMA..SUNDANESE CONSONANT SIGN PASANGAN WA + {0x1BE6, 0x1BE6, prExtend}, // Mn BATAK SIGN TOMPI + {0x1BE7, 0x1BE7, prSpacingMark}, // Mc BATAK VOWEL SIGN E + {0x1BE8, 0x1BE9, prExtend}, // Mn [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE + {0x1BEA, 0x1BEC, prSpacingMark}, // Mc [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O + {0x1BED, 0x1BED, prExtend}, // Mn BATAK VOWEL SIGN KARO O + {0x1BEE, 0x1BEE, prSpacingMark}, // Mc BATAK VOWEL SIGN U + {0x1BEF, 0x1BF1, prExtend}, // Mn [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H + {0x1BF2, 0x1BF3, prSpacingMark}, // Mc [2] BATAK PANGOLAT..BATAK PANONGONAN + {0x1C24, 0x1C2B, prSpacingMark}, // Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU + {0x1C2C, 0x1C33, prExtend}, // Mn [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T + {0x1C34, 0x1C35, prSpacingMark}, // Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG + {0x1C36, 0x1C37, prExtend}, // Mn [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA + {0x1CD0, 0x1CD2, prExtend}, // Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA + {0x1CD4, 0x1CE0, prExtend}, // Mn [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA + {0x1CE1, 0x1CE1, prSpacingMark}, // Mc VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA + {0x1CE2, 0x1CE8, prExtend}, // Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL + {0x1CED, 0x1CED, prExtend}, // Mn VEDIC SIGN TIRYAK + {0x1CF4, 0x1CF4, prExtend}, // Mn VEDIC TONE CANDRA ABOVE + {0x1CF7, 0x1CF7, prSpacingMark}, // Mc VEDIC SIGN ATIKRAMA + {0x1CF8, 0x1CF9, prExtend}, // Mn [2] VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE + {0x1DC0, 0x1DF9, prExtend}, // Mn [58] COMBINING DOTTED GRAVE ACCENT..COMBINING WIDE INVERTED BRIDGE BELOW + {0x1DFB, 0x1DFF, prExtend}, // Mn [5] COMBINING DELETION MARK..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW + {0x200B, 0x200B, prControl}, // Cf ZERO WIDTH SPACE + {0x200C, 0x200C, prExtend}, // Cf ZERO WIDTH NON-JOINER + {0x200D, 0x200D, prZWJ}, // Cf ZERO WIDTH JOINER + {0x200E, 0x200F, prControl}, // Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK + {0x2028, 0x2028, prControl}, // Zl LINE SEPARATOR + {0x2029, 0x2029, prControl}, // Zp PARAGRAPH SEPARATOR + {0x202A, 0x202E, prControl}, // Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE + {0x203C, 0x203C, prExtendedPictographic}, // 1.1 [1] (‼️) double exclamation mark + {0x2049, 0x2049, prExtendedPictographic}, // 3.0 [1] (⁉️) exclamation question mark + {0x2060, 0x2064, prControl}, // Cf [5] WORD JOINER..INVISIBLE PLUS + {0x2065, 0x2065, prControl}, // Cn + {0x2066, 0x206F, prControl}, // Cf [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES + {0x20D0, 0x20DC, prExtend}, // Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE + {0x20DD, 0x20E0, prExtend}, // Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH + {0x20E1, 0x20E1, prExtend}, // Mn COMBINING LEFT RIGHT ARROW ABOVE + {0x20E2, 0x20E4, prExtend}, // Me [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE + {0x20E5, 0x20F0, prExtend}, // Mn [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE + {0x2122, 0x2122, prExtendedPictographic}, // 1.1 [1] (™️) trade mark + {0x2139, 0x2139, prExtendedPictographic}, // 3.0 [1] (ℹ️) information + {0x2194, 0x2199, prExtendedPictographic}, // 1.1 [6] (↔️..↙️) left-right arrow..down-left arrow + {0x21A9, 0x21AA, prExtendedPictographic}, // 1.1 [2] (↩️..↪️) right arrow curving left..left arrow curving right + {0x231A, 0x231B, prExtendedPictographic}, // 1.1 [2] (⌚..⌛) watch..hourglass done + {0x2328, 0x2328, prExtendedPictographic}, // 1.1 [1] (⌨️) keyboard + {0x2388, 0x2388, prExtendedPictographic}, // 3.0 [1] (⎈) HELM SYMBOL + {0x23CF, 0x23CF, prExtendedPictographic}, // 4.0 [1] (⏏️) eject button + {0x23E9, 0x23F3, prExtendedPictographic}, // 6.0 [11] (⏩..⏳) fast-forward button..hourglass not done + {0x23F8, 0x23FA, prExtendedPictographic}, // 7.0 [3] (⏸️..⏺️) pause button..record button + {0x24C2, 0x24C2, prExtendedPictographic}, // 1.1 [1] (Ⓜ️) circled M + {0x25AA, 0x25AB, prExtendedPictographic}, // 1.1 [2] (▪️..▫️) black small square..white small square + {0x25B6, 0x25B6, prExtendedPictographic}, // 1.1 [1] (▶️) play button + {0x25C0, 0x25C0, prExtendedPictographic}, // 1.1 [1] (◀️) reverse button + {0x25FB, 0x25FE, prExtendedPictographic}, // 3.2 [4] (◻️..◾) white medium square..black medium-small square + {0x2600, 0x2605, prExtendedPictographic}, // 1.1 [6] (☀️..★) sun..BLACK STAR + {0x2607, 0x2612, prExtendedPictographic}, // 1.1 [12] (☇..☒) LIGHTNING..BALLOT BOX WITH X + {0x2614, 0x2615, prExtendedPictographic}, // 4.0 [2] (☔..☕) umbrella with rain drops..hot beverage + {0x2616, 0x2617, prExtendedPictographic}, // 3.2 [2] (☖..☗) WHITE SHOGI PIECE..BLACK SHOGI PIECE + {0x2618, 0x2618, prExtendedPictographic}, // 4.1 [1] (☘️) shamrock + {0x2619, 0x2619, prExtendedPictographic}, // 3.0 [1] (☙) REVERSED ROTATED FLORAL HEART BULLET + {0x261A, 0x266F, prExtendedPictographic}, // 1.1 [86] (☚..♯) BLACK LEFT POINTING INDEX..MUSIC SHARP SIGN + {0x2670, 0x2671, prExtendedPictographic}, // 3.0 [2] (♰..♱) WEST SYRIAC CROSS..EAST SYRIAC CROSS + {0x2672, 0x267D, prExtendedPictographic}, // 3.2 [12] (♲..♽) UNIVERSAL RECYCLING SYMBOL..PARTIALLY-RECYCLED PAPER SYMBOL + {0x267E, 0x267F, prExtendedPictographic}, // 4.1 [2] (♾️..♿) infinity..wheelchair symbol + {0x2680, 0x2685, prExtendedPictographic}, // 3.2 [6] (⚀..⚅) DIE FACE-1..DIE FACE-6 + {0x2690, 0x2691, prExtendedPictographic}, // 4.0 [2] (⚐..⚑) WHITE FLAG..BLACK FLAG + {0x2692, 0x269C, prExtendedPictographic}, // 4.1 [11] (⚒️..⚜️) hammer and pick..fleur-de-lis + {0x269D, 0x269D, prExtendedPictographic}, // 5.1 [1] (⚝) OUTLINED WHITE STAR + {0x269E, 0x269F, prExtendedPictographic}, // 5.2 [2] (⚞..⚟) THREE LINES CONVERGING RIGHT..THREE LINES CONVERGING LEFT + {0x26A0, 0x26A1, prExtendedPictographic}, // 4.0 [2] (⚠️..⚡) warning..high voltage + {0x26A2, 0x26B1, prExtendedPictographic}, // 4.1 [16] (⚢..⚱️) DOUBLED FEMALE SIGN..funeral urn + {0x26B2, 0x26B2, prExtendedPictographic}, // 5.0 [1] (⚲) NEUTER + {0x26B3, 0x26BC, prExtendedPictographic}, // 5.1 [10] (⚳..⚼) CERES..SESQUIQUADRATE + {0x26BD, 0x26BF, prExtendedPictographic}, // 5.2 [3] (⚽..⚿) soccer ball..SQUARED KEY + {0x26C0, 0x26C3, prExtendedPictographic}, // 5.1 [4] (⛀..⛃) WHITE DRAUGHTS MAN..BLACK DRAUGHTS KING + {0x26C4, 0x26CD, prExtendedPictographic}, // 5.2 [10] (⛄..⛍) snowman without snow..DISABLED CAR + {0x26CE, 0x26CE, prExtendedPictographic}, // 6.0 [1] (⛎) Ophiuchus + {0x26CF, 0x26E1, prExtendedPictographic}, // 5.2 [19] (⛏️..⛡) pick..RESTRICTED LEFT ENTRY-2 + {0x26E2, 0x26E2, prExtendedPictographic}, // 6.0 [1] (⛢) ASTRONOMICAL SYMBOL FOR URANUS + {0x26E3, 0x26E3, prExtendedPictographic}, // 5.2 [1] (⛣) HEAVY CIRCLE WITH STROKE AND TWO DOTS ABOVE + {0x26E4, 0x26E7, prExtendedPictographic}, // 6.0 [4] (⛤..⛧) PENTAGRAM..INVERTED PENTAGRAM + {0x26E8, 0x26FF, prExtendedPictographic}, // 5.2 [24] (⛨..⛿) BLACK CROSS ON SHIELD..WHITE FLAG WITH HORIZONTAL MIDDLE BLACK STRIPE + {0x2700, 0x2700, prExtendedPictographic}, // 7.0 [1] (✀) BLACK SAFETY SCISSORS + {0x2701, 0x2704, prExtendedPictographic}, // 1.1 [4] (✁..✄) UPPER BLADE SCISSORS..WHITE SCISSORS + {0x2705, 0x2705, prExtendedPictographic}, // 6.0 [1] (✅) check mark button + {0x2708, 0x2709, prExtendedPictographic}, // 1.1 [2] (✈️..✉️) airplane..envelope + {0x270A, 0x270B, prExtendedPictographic}, // 6.0 [2] (✊..✋) raised fist..raised hand + {0x270C, 0x2712, prExtendedPictographic}, // 1.1 [7] (✌️..✒️) victory hand..black nib + {0x2714, 0x2714, prExtendedPictographic}, // 1.1 [1] (✔️) check mark + {0x2716, 0x2716, prExtendedPictographic}, // 1.1 [1] (✖️) multiplication sign + {0x271D, 0x271D, prExtendedPictographic}, // 1.1 [1] (✝️) latin cross + {0x2721, 0x2721, prExtendedPictographic}, // 1.1 [1] (✡️) star of David + {0x2728, 0x2728, prExtendedPictographic}, // 6.0 [1] (✨) sparkles + {0x2733, 0x2734, prExtendedPictographic}, // 1.1 [2] (✳️..✴️) eight-spoked asterisk..eight-pointed star + {0x2744, 0x2744, prExtendedPictographic}, // 1.1 [1] (❄️) snowflake + {0x2747, 0x2747, prExtendedPictographic}, // 1.1 [1] (❇️) sparkle + {0x274C, 0x274C, prExtendedPictographic}, // 6.0 [1] (❌) cross mark + {0x274E, 0x274E, prExtendedPictographic}, // 6.0 [1] (❎) cross mark button + {0x2753, 0x2755, prExtendedPictographic}, // 6.0 [3] (❓..❕) question mark..white exclamation mark + {0x2757, 0x2757, prExtendedPictographic}, // 5.2 [1] (❗) exclamation mark + {0x2763, 0x2767, prExtendedPictographic}, // 1.1 [5] (❣️..❧) heart exclamation..ROTATED FLORAL HEART BULLET + {0x2795, 0x2797, prExtendedPictographic}, // 6.0 [3] (➕..➗) plus sign..division sign + {0x27A1, 0x27A1, prExtendedPictographic}, // 1.1 [1] (➡️) right arrow + {0x27B0, 0x27B0, prExtendedPictographic}, // 6.0 [1] (➰) curly loop + {0x27BF, 0x27BF, prExtendedPictographic}, // 6.0 [1] (➿) double curly loop + {0x2934, 0x2935, prExtendedPictographic}, // 3.2 [2] (⤴️..⤵️) right arrow curving up..right arrow curving down + {0x2B05, 0x2B07, prExtendedPictographic}, // 4.0 [3] (⬅️..⬇️) left arrow..down arrow + {0x2B1B, 0x2B1C, prExtendedPictographic}, // 5.1 [2] (⬛..⬜) black large square..white large square + {0x2B50, 0x2B50, prExtendedPictographic}, // 5.1 [1] (⭐) star + {0x2B55, 0x2B55, prExtendedPictographic}, // 5.2 [1] (⭕) hollow red circle + {0x2CEF, 0x2CF1, prExtend}, // Mn [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS + {0x2D7F, 0x2D7F, prExtend}, // Mn TIFINAGH CONSONANT JOINER + {0x2DE0, 0x2DFF, prExtend}, // Mn [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS + {0x302A, 0x302D, prExtend}, // Mn [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENTERING TONE MARK + {0x302E, 0x302F, prExtend}, // Mc [2] HANGUL SINGLE DOT TONE MARK..HANGUL DOUBLE DOT TONE MARK + {0x3030, 0x3030, prExtendedPictographic}, // 1.1 [1] (〰️) wavy dash + {0x303D, 0x303D, prExtendedPictographic}, // 3.2 [1] (〽️) part alternation mark + {0x3099, 0x309A, prExtend}, // Mn [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK + {0x3297, 0x3297, prExtendedPictographic}, // 1.1 [1] (㊗️) Japanese “congratulations” button + {0x3299, 0x3299, prExtendedPictographic}, // 1.1 [1] (㊙️) Japanese “secret” button + {0xA66F, 0xA66F, prExtend}, // Mn COMBINING CYRILLIC VZMET + {0xA670, 0xA672, prExtend}, // Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN + {0xA674, 0xA67D, prExtend}, // Mn [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK + {0xA69E, 0xA69F, prExtend}, // Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E + {0xA6F0, 0xA6F1, prExtend}, // Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS + {0xA802, 0xA802, prExtend}, // Mn SYLOTI NAGRI SIGN DVISVARA + {0xA806, 0xA806, prExtend}, // Mn SYLOTI NAGRI SIGN HASANTA + {0xA80B, 0xA80B, prExtend}, // Mn SYLOTI NAGRI SIGN ANUSVARA + {0xA823, 0xA824, prSpacingMark}, // Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I + {0xA825, 0xA826, prExtend}, // Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E + {0xA827, 0xA827, prSpacingMark}, // Mc SYLOTI NAGRI VOWEL SIGN OO + {0xA880, 0xA881, prSpacingMark}, // Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA + {0xA8B4, 0xA8C3, prSpacingMark}, // Mc [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU + {0xA8C4, 0xA8C5, prExtend}, // Mn [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA SIGN CANDRABINDU + {0xA8E0, 0xA8F1, prExtend}, // Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA + {0xA8FF, 0xA8FF, prExtend}, // Mn DEVANAGARI VOWEL SIGN AY + {0xA926, 0xA92D, prExtend}, // Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU + {0xA947, 0xA951, prExtend}, // Mn [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R + {0xA952, 0xA953, prSpacingMark}, // Mc [2] REJANG CONSONANT SIGN H..REJANG VIRAMA + {0xA960, 0xA97C, prL}, // Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH + {0xA980, 0xA982, prExtend}, // Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR + {0xA983, 0xA983, prSpacingMark}, // Mc JAVANESE SIGN WIGNYAN + {0xA9B3, 0xA9B3, prExtend}, // Mn JAVANESE SIGN CECAK TELU + {0xA9B4, 0xA9B5, prSpacingMark}, // Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG + {0xA9B6, 0xA9B9, prExtend}, // Mn [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT + {0xA9BA, 0xA9BB, prSpacingMark}, // Mc [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE + {0xA9BC, 0xA9BD, prExtend}, // Mn [2] JAVANESE VOWEL SIGN PEPET..JAVANESE CONSONANT SIGN KERET + {0xA9BE, 0xA9C0, prSpacingMark}, // Mc [3] JAVANESE CONSONANT SIGN PENGKAL..JAVANESE PANGKON + {0xA9E5, 0xA9E5, prExtend}, // Mn MYANMAR SIGN SHAN SAW + {0xAA29, 0xAA2E, prExtend}, // Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE + {0xAA2F, 0xAA30, prSpacingMark}, // Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI + {0xAA31, 0xAA32, prExtend}, // Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE + {0xAA33, 0xAA34, prSpacingMark}, // Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA + {0xAA35, 0xAA36, prExtend}, // Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA + {0xAA43, 0xAA43, prExtend}, // Mn CHAM CONSONANT SIGN FINAL NG + {0xAA4C, 0xAA4C, prExtend}, // Mn CHAM CONSONANT SIGN FINAL M + {0xAA4D, 0xAA4D, prSpacingMark}, // Mc CHAM CONSONANT SIGN FINAL H + {0xAA7C, 0xAA7C, prExtend}, // Mn MYANMAR SIGN TAI LAING TONE-2 + {0xAAB0, 0xAAB0, prExtend}, // Mn TAI VIET MAI KANG + {0xAAB2, 0xAAB4, prExtend}, // Mn [3] TAI VIET VOWEL I..TAI VIET VOWEL U + {0xAAB7, 0xAAB8, prExtend}, // Mn [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA + {0xAABE, 0xAABF, prExtend}, // Mn [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK + {0xAAC1, 0xAAC1, prExtend}, // Mn TAI VIET TONE MAI THO + {0xAAEB, 0xAAEB, prSpacingMark}, // Mc MEETEI MAYEK VOWEL SIGN II + {0xAAEC, 0xAAED, prExtend}, // Mn [2] MEETEI MAYEK VOWEL SIGN UU..MEETEI MAYEK VOWEL SIGN AAI + {0xAAEE, 0xAAEF, prSpacingMark}, // Mc [2] MEETEI MAYEK VOWEL SIGN AU..MEETEI MAYEK VOWEL SIGN AAU + {0xAAF5, 0xAAF5, prSpacingMark}, // Mc MEETEI MAYEK VOWEL SIGN VISARGA + {0xAAF6, 0xAAF6, prExtend}, // Mn MEETEI MAYEK VIRAMA + {0xABE3, 0xABE4, prSpacingMark}, // Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP + {0xABE5, 0xABE5, prExtend}, // Mn MEETEI MAYEK VOWEL SIGN ANAP + {0xABE6, 0xABE7, prSpacingMark}, // Mc [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP + {0xABE8, 0xABE8, prExtend}, // Mn MEETEI MAYEK VOWEL SIGN UNAP + {0xABE9, 0xABEA, prSpacingMark}, // Mc [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG + {0xABEC, 0xABEC, prSpacingMark}, // Mc MEETEI MAYEK LUM IYEK + {0xABED, 0xABED, prExtend}, // Mn MEETEI MAYEK APUN IYEK + {0xAC00, 0xAC00, prLV}, // Lo HANGUL SYLLABLE GA + {0xAC01, 0xAC1B, prLVT}, // Lo [27] HANGUL SYLLABLE GAG..HANGUL SYLLABLE GAH + {0xAC1C, 0xAC1C, prLV}, // Lo HANGUL SYLLABLE GAE + {0xAC1D, 0xAC37, prLVT}, // Lo [27] HANGUL SYLLABLE GAEG..HANGUL SYLLABLE GAEH + {0xAC38, 0xAC38, prLV}, // Lo HANGUL SYLLABLE GYA + {0xAC39, 0xAC53, prLVT}, // Lo [27] HANGUL SYLLABLE GYAG..HANGUL SYLLABLE GYAH + {0xAC54, 0xAC54, prLV}, // Lo HANGUL SYLLABLE GYAE + {0xAC55, 0xAC6F, prLVT}, // Lo [27] HANGUL SYLLABLE GYAEG..HANGUL SYLLABLE GYAEH + {0xAC70, 0xAC70, prLV}, // Lo HANGUL SYLLABLE GEO + {0xAC71, 0xAC8B, prLVT}, // Lo [27] HANGUL SYLLABLE GEOG..HANGUL SYLLABLE GEOH + {0xAC8C, 0xAC8C, prLV}, // Lo HANGUL SYLLABLE GE + {0xAC8D, 0xACA7, prLVT}, // Lo [27] HANGUL SYLLABLE GEG..HANGUL SYLLABLE GEH + {0xACA8, 0xACA8, prLV}, // Lo HANGUL SYLLABLE GYEO + {0xACA9, 0xACC3, prLVT}, // Lo [27] HANGUL SYLLABLE GYEOG..HANGUL SYLLABLE GYEOH + {0xACC4, 0xACC4, prLV}, // Lo HANGUL SYLLABLE GYE + {0xACC5, 0xACDF, prLVT}, // Lo [27] HANGUL SYLLABLE GYEG..HANGUL SYLLABLE GYEH + {0xACE0, 0xACE0, prLV}, // Lo HANGUL SYLLABLE GO + {0xACE1, 0xACFB, prLVT}, // Lo [27] HANGUL SYLLABLE GOG..HANGUL SYLLABLE GOH + {0xACFC, 0xACFC, prLV}, // Lo HANGUL SYLLABLE GWA + {0xACFD, 0xAD17, prLVT}, // Lo [27] HANGUL SYLLABLE GWAG..HANGUL SYLLABLE GWAH + {0xAD18, 0xAD18, prLV}, // Lo HANGUL SYLLABLE GWAE + {0xAD19, 0xAD33, prLVT}, // Lo [27] HANGUL SYLLABLE GWAEG..HANGUL SYLLABLE GWAEH + {0xAD34, 0xAD34, prLV}, // Lo HANGUL SYLLABLE GOE + {0xAD35, 0xAD4F, prLVT}, // Lo [27] HANGUL SYLLABLE GOEG..HANGUL SYLLABLE GOEH + {0xAD50, 0xAD50, prLV}, // Lo HANGUL SYLLABLE GYO + {0xAD51, 0xAD6B, prLVT}, // Lo [27] HANGUL SYLLABLE GYOG..HANGUL SYLLABLE GYOH + {0xAD6C, 0xAD6C, prLV}, // Lo HANGUL SYLLABLE GU + {0xAD6D, 0xAD87, prLVT}, // Lo [27] HANGUL SYLLABLE GUG..HANGUL SYLLABLE GUH + {0xAD88, 0xAD88, prLV}, // Lo HANGUL SYLLABLE GWEO + {0xAD89, 0xADA3, prLVT}, // Lo [27] HANGUL SYLLABLE GWEOG..HANGUL SYLLABLE GWEOH + {0xADA4, 0xADA4, prLV}, // Lo HANGUL SYLLABLE GWE + {0xADA5, 0xADBF, prLVT}, // Lo [27] HANGUL SYLLABLE GWEG..HANGUL SYLLABLE GWEH + {0xADC0, 0xADC0, prLV}, // Lo HANGUL SYLLABLE GWI + {0xADC1, 0xADDB, prLVT}, // Lo [27] HANGUL SYLLABLE GWIG..HANGUL SYLLABLE GWIH + {0xADDC, 0xADDC, prLV}, // Lo HANGUL SYLLABLE GYU + {0xADDD, 0xADF7, prLVT}, // Lo [27] HANGUL SYLLABLE GYUG..HANGUL SYLLABLE GYUH + {0xADF8, 0xADF8, prLV}, // Lo HANGUL SYLLABLE GEU + {0xADF9, 0xAE13, prLVT}, // Lo [27] HANGUL SYLLABLE GEUG..HANGUL SYLLABLE GEUH + {0xAE14, 0xAE14, prLV}, // Lo HANGUL SYLLABLE GYI + {0xAE15, 0xAE2F, prLVT}, // Lo [27] HANGUL SYLLABLE GYIG..HANGUL SYLLABLE GYIH + {0xAE30, 0xAE30, prLV}, // Lo HANGUL SYLLABLE GI + {0xAE31, 0xAE4B, prLVT}, // Lo [27] HANGUL SYLLABLE GIG..HANGUL SYLLABLE GIH + {0xAE4C, 0xAE4C, prLV}, // Lo HANGUL SYLLABLE GGA + {0xAE4D, 0xAE67, prLVT}, // Lo [27] HANGUL SYLLABLE GGAG..HANGUL SYLLABLE GGAH + {0xAE68, 0xAE68, prLV}, // Lo HANGUL SYLLABLE GGAE + {0xAE69, 0xAE83, prLVT}, // Lo [27] HANGUL SYLLABLE GGAEG..HANGUL SYLLABLE GGAEH + {0xAE84, 0xAE84, prLV}, // Lo HANGUL SYLLABLE GGYA + {0xAE85, 0xAE9F, prLVT}, // Lo [27] HANGUL SYLLABLE GGYAG..HANGUL SYLLABLE GGYAH + {0xAEA0, 0xAEA0, prLV}, // Lo HANGUL SYLLABLE GGYAE + {0xAEA1, 0xAEBB, prLVT}, // Lo [27] HANGUL SYLLABLE GGYAEG..HANGUL SYLLABLE GGYAEH + {0xAEBC, 0xAEBC, prLV}, // Lo HANGUL SYLLABLE GGEO + {0xAEBD, 0xAED7, prLVT}, // Lo [27] HANGUL SYLLABLE GGEOG..HANGUL SYLLABLE GGEOH + {0xAED8, 0xAED8, prLV}, // Lo HANGUL SYLLABLE GGE + {0xAED9, 0xAEF3, prLVT}, // Lo [27] HANGUL SYLLABLE GGEG..HANGUL SYLLABLE GGEH + {0xAEF4, 0xAEF4, prLV}, // Lo HANGUL SYLLABLE GGYEO + {0xAEF5, 0xAF0F, prLVT}, // Lo [27] HANGUL SYLLABLE GGYEOG..HANGUL SYLLABLE GGYEOH + {0xAF10, 0xAF10, prLV}, // Lo HANGUL SYLLABLE GGYE + {0xAF11, 0xAF2B, prLVT}, // Lo [27] HANGUL SYLLABLE GGYEG..HANGUL SYLLABLE GGYEH + {0xAF2C, 0xAF2C, prLV}, // Lo HANGUL SYLLABLE GGO + {0xAF2D, 0xAF47, prLVT}, // Lo [27] HANGUL SYLLABLE GGOG..HANGUL SYLLABLE GGOH + {0xAF48, 0xAF48, prLV}, // Lo HANGUL SYLLABLE GGWA + {0xAF49, 0xAF63, prLVT}, // Lo [27] HANGUL SYLLABLE GGWAG..HANGUL SYLLABLE GGWAH + {0xAF64, 0xAF64, prLV}, // Lo HANGUL SYLLABLE GGWAE + {0xAF65, 0xAF7F, prLVT}, // Lo [27] HANGUL SYLLABLE GGWAEG..HANGUL SYLLABLE GGWAEH + {0xAF80, 0xAF80, prLV}, // Lo HANGUL SYLLABLE GGOE + {0xAF81, 0xAF9B, prLVT}, // Lo [27] HANGUL SYLLABLE GGOEG..HANGUL SYLLABLE GGOEH + {0xAF9C, 0xAF9C, prLV}, // Lo HANGUL SYLLABLE GGYO + {0xAF9D, 0xAFB7, prLVT}, // Lo [27] HANGUL SYLLABLE GGYOG..HANGUL SYLLABLE GGYOH + {0xAFB8, 0xAFB8, prLV}, // Lo HANGUL SYLLABLE GGU + {0xAFB9, 0xAFD3, prLVT}, // Lo [27] HANGUL SYLLABLE GGUG..HANGUL SYLLABLE GGUH + {0xAFD4, 0xAFD4, prLV}, // Lo HANGUL SYLLABLE GGWEO + {0xAFD5, 0xAFEF, prLVT}, // Lo [27] HANGUL SYLLABLE GGWEOG..HANGUL SYLLABLE GGWEOH + {0xAFF0, 0xAFF0, prLV}, // Lo HANGUL SYLLABLE GGWE + {0xAFF1, 0xB00B, prLVT}, // Lo [27] HANGUL SYLLABLE GGWEG..HANGUL SYLLABLE GGWEH + {0xB00C, 0xB00C, prLV}, // Lo HANGUL SYLLABLE GGWI + {0xB00D, 0xB027, prLVT}, // Lo [27] HANGUL SYLLABLE GGWIG..HANGUL SYLLABLE GGWIH + {0xB028, 0xB028, prLV}, // Lo HANGUL SYLLABLE GGYU + {0xB029, 0xB043, prLVT}, // Lo [27] HANGUL SYLLABLE GGYUG..HANGUL SYLLABLE GGYUH + {0xB044, 0xB044, prLV}, // Lo HANGUL SYLLABLE GGEU + {0xB045, 0xB05F, prLVT}, // Lo [27] HANGUL SYLLABLE GGEUG..HANGUL SYLLABLE GGEUH + {0xB060, 0xB060, prLV}, // Lo HANGUL SYLLABLE GGYI + {0xB061, 0xB07B, prLVT}, // Lo [27] HANGUL SYLLABLE GGYIG..HANGUL SYLLABLE GGYIH + {0xB07C, 0xB07C, prLV}, // Lo HANGUL SYLLABLE GGI + {0xB07D, 0xB097, prLVT}, // Lo [27] HANGUL SYLLABLE GGIG..HANGUL SYLLABLE GGIH + {0xB098, 0xB098, prLV}, // Lo HANGUL SYLLABLE NA + {0xB099, 0xB0B3, prLVT}, // Lo [27] HANGUL SYLLABLE NAG..HANGUL SYLLABLE NAH + {0xB0B4, 0xB0B4, prLV}, // Lo HANGUL SYLLABLE NAE + {0xB0B5, 0xB0CF, prLVT}, // Lo [27] HANGUL SYLLABLE NAEG..HANGUL SYLLABLE NAEH + {0xB0D0, 0xB0D0, prLV}, // Lo HANGUL SYLLABLE NYA + {0xB0D1, 0xB0EB, prLVT}, // Lo [27] HANGUL SYLLABLE NYAG..HANGUL SYLLABLE NYAH + {0xB0EC, 0xB0EC, prLV}, // Lo HANGUL SYLLABLE NYAE + {0xB0ED, 0xB107, prLVT}, // Lo [27] HANGUL SYLLABLE NYAEG..HANGUL SYLLABLE NYAEH + {0xB108, 0xB108, prLV}, // Lo HANGUL SYLLABLE NEO + {0xB109, 0xB123, prLVT}, // Lo [27] HANGUL SYLLABLE NEOG..HANGUL SYLLABLE NEOH + {0xB124, 0xB124, prLV}, // Lo HANGUL SYLLABLE NE + {0xB125, 0xB13F, prLVT}, // Lo [27] HANGUL SYLLABLE NEG..HANGUL SYLLABLE NEH + {0xB140, 0xB140, prLV}, // Lo HANGUL SYLLABLE NYEO + {0xB141, 0xB15B, prLVT}, // Lo [27] HANGUL SYLLABLE NYEOG..HANGUL SYLLABLE NYEOH + {0xB15C, 0xB15C, prLV}, // Lo HANGUL SYLLABLE NYE + {0xB15D, 0xB177, prLVT}, // Lo [27] HANGUL SYLLABLE NYEG..HANGUL SYLLABLE NYEH + {0xB178, 0xB178, prLV}, // Lo HANGUL SYLLABLE NO + {0xB179, 0xB193, prLVT}, // Lo [27] HANGUL SYLLABLE NOG..HANGUL SYLLABLE NOH + {0xB194, 0xB194, prLV}, // Lo HANGUL SYLLABLE NWA + {0xB195, 0xB1AF, prLVT}, // Lo [27] HANGUL SYLLABLE NWAG..HANGUL SYLLABLE NWAH + {0xB1B0, 0xB1B0, prLV}, // Lo HANGUL SYLLABLE NWAE + {0xB1B1, 0xB1CB, prLVT}, // Lo [27] HANGUL SYLLABLE NWAEG..HANGUL SYLLABLE NWAEH + {0xB1CC, 0xB1CC, prLV}, // Lo HANGUL SYLLABLE NOE + {0xB1CD, 0xB1E7, prLVT}, // Lo [27] HANGUL SYLLABLE NOEG..HANGUL SYLLABLE NOEH + {0xB1E8, 0xB1E8, prLV}, // Lo HANGUL SYLLABLE NYO + {0xB1E9, 0xB203, prLVT}, // Lo [27] HANGUL SYLLABLE NYOG..HANGUL SYLLABLE NYOH + {0xB204, 0xB204, prLV}, // Lo HANGUL SYLLABLE NU + {0xB205, 0xB21F, prLVT}, // Lo [27] HANGUL SYLLABLE NUG..HANGUL SYLLABLE NUH + {0xB220, 0xB220, prLV}, // Lo HANGUL SYLLABLE NWEO + {0xB221, 0xB23B, prLVT}, // Lo [27] HANGUL SYLLABLE NWEOG..HANGUL SYLLABLE NWEOH + {0xB23C, 0xB23C, prLV}, // Lo HANGUL SYLLABLE NWE + {0xB23D, 0xB257, prLVT}, // Lo [27] HANGUL SYLLABLE NWEG..HANGUL SYLLABLE NWEH + {0xB258, 0xB258, prLV}, // Lo HANGUL SYLLABLE NWI + {0xB259, 0xB273, prLVT}, // Lo [27] HANGUL SYLLABLE NWIG..HANGUL SYLLABLE NWIH + {0xB274, 0xB274, prLV}, // Lo HANGUL SYLLABLE NYU + {0xB275, 0xB28F, prLVT}, // Lo [27] HANGUL SYLLABLE NYUG..HANGUL SYLLABLE NYUH + {0xB290, 0xB290, prLV}, // Lo HANGUL SYLLABLE NEU + {0xB291, 0xB2AB, prLVT}, // Lo [27] HANGUL SYLLABLE NEUG..HANGUL SYLLABLE NEUH + {0xB2AC, 0xB2AC, prLV}, // Lo HANGUL SYLLABLE NYI + {0xB2AD, 0xB2C7, prLVT}, // Lo [27] HANGUL SYLLABLE NYIG..HANGUL SYLLABLE NYIH + {0xB2C8, 0xB2C8, prLV}, // Lo HANGUL SYLLABLE NI + {0xB2C9, 0xB2E3, prLVT}, // Lo [27] HANGUL SYLLABLE NIG..HANGUL SYLLABLE NIH + {0xB2E4, 0xB2E4, prLV}, // Lo HANGUL SYLLABLE DA + {0xB2E5, 0xB2FF, prLVT}, // Lo [27] HANGUL SYLLABLE DAG..HANGUL SYLLABLE DAH + {0xB300, 0xB300, prLV}, // Lo HANGUL SYLLABLE DAE + {0xB301, 0xB31B, prLVT}, // Lo [27] HANGUL SYLLABLE DAEG..HANGUL SYLLABLE DAEH + {0xB31C, 0xB31C, prLV}, // Lo HANGUL SYLLABLE DYA + {0xB31D, 0xB337, prLVT}, // Lo [27] HANGUL SYLLABLE DYAG..HANGUL SYLLABLE DYAH + {0xB338, 0xB338, prLV}, // Lo HANGUL SYLLABLE DYAE + {0xB339, 0xB353, prLVT}, // Lo [27] HANGUL SYLLABLE DYAEG..HANGUL SYLLABLE DYAEH + {0xB354, 0xB354, prLV}, // Lo HANGUL SYLLABLE DEO + {0xB355, 0xB36F, prLVT}, // Lo [27] HANGUL SYLLABLE DEOG..HANGUL SYLLABLE DEOH + {0xB370, 0xB370, prLV}, // Lo HANGUL SYLLABLE DE + {0xB371, 0xB38B, prLVT}, // Lo [27] HANGUL SYLLABLE DEG..HANGUL SYLLABLE DEH + {0xB38C, 0xB38C, prLV}, // Lo HANGUL SYLLABLE DYEO + {0xB38D, 0xB3A7, prLVT}, // Lo [27] HANGUL SYLLABLE DYEOG..HANGUL SYLLABLE DYEOH + {0xB3A8, 0xB3A8, prLV}, // Lo HANGUL SYLLABLE DYE + {0xB3A9, 0xB3C3, prLVT}, // Lo [27] HANGUL SYLLABLE DYEG..HANGUL SYLLABLE DYEH + {0xB3C4, 0xB3C4, prLV}, // Lo HANGUL SYLLABLE DO + {0xB3C5, 0xB3DF, prLVT}, // Lo [27] HANGUL SYLLABLE DOG..HANGUL SYLLABLE DOH + {0xB3E0, 0xB3E0, prLV}, // Lo HANGUL SYLLABLE DWA + {0xB3E1, 0xB3FB, prLVT}, // Lo [27] HANGUL SYLLABLE DWAG..HANGUL SYLLABLE DWAH + {0xB3FC, 0xB3FC, prLV}, // Lo HANGUL SYLLABLE DWAE + {0xB3FD, 0xB417, prLVT}, // Lo [27] HANGUL SYLLABLE DWAEG..HANGUL SYLLABLE DWAEH + {0xB418, 0xB418, prLV}, // Lo HANGUL SYLLABLE DOE + {0xB419, 0xB433, prLVT}, // Lo [27] HANGUL SYLLABLE DOEG..HANGUL SYLLABLE DOEH + {0xB434, 0xB434, prLV}, // Lo HANGUL SYLLABLE DYO + {0xB435, 0xB44F, prLVT}, // Lo [27] HANGUL SYLLABLE DYOG..HANGUL SYLLABLE DYOH + {0xB450, 0xB450, prLV}, // Lo HANGUL SYLLABLE DU + {0xB451, 0xB46B, prLVT}, // Lo [27] HANGUL SYLLABLE DUG..HANGUL SYLLABLE DUH + {0xB46C, 0xB46C, prLV}, // Lo HANGUL SYLLABLE DWEO + {0xB46D, 0xB487, prLVT}, // Lo [27] HANGUL SYLLABLE DWEOG..HANGUL SYLLABLE DWEOH + {0xB488, 0xB488, prLV}, // Lo HANGUL SYLLABLE DWE + {0xB489, 0xB4A3, prLVT}, // Lo [27] HANGUL SYLLABLE DWEG..HANGUL SYLLABLE DWEH + {0xB4A4, 0xB4A4, prLV}, // Lo HANGUL SYLLABLE DWI + {0xB4A5, 0xB4BF, prLVT}, // Lo [27] HANGUL SYLLABLE DWIG..HANGUL SYLLABLE DWIH + {0xB4C0, 0xB4C0, prLV}, // Lo HANGUL SYLLABLE DYU + {0xB4C1, 0xB4DB, prLVT}, // Lo [27] HANGUL SYLLABLE DYUG..HANGUL SYLLABLE DYUH + {0xB4DC, 0xB4DC, prLV}, // Lo HANGUL SYLLABLE DEU + {0xB4DD, 0xB4F7, prLVT}, // Lo [27] HANGUL SYLLABLE DEUG..HANGUL SYLLABLE DEUH + {0xB4F8, 0xB4F8, prLV}, // Lo HANGUL SYLLABLE DYI + {0xB4F9, 0xB513, prLVT}, // Lo [27] HANGUL SYLLABLE DYIG..HANGUL SYLLABLE DYIH + {0xB514, 0xB514, prLV}, // Lo HANGUL SYLLABLE DI + {0xB515, 0xB52F, prLVT}, // Lo [27] HANGUL SYLLABLE DIG..HANGUL SYLLABLE DIH + {0xB530, 0xB530, prLV}, // Lo HANGUL SYLLABLE DDA + {0xB531, 0xB54B, prLVT}, // Lo [27] HANGUL SYLLABLE DDAG..HANGUL SYLLABLE DDAH + {0xB54C, 0xB54C, prLV}, // Lo HANGUL SYLLABLE DDAE + {0xB54D, 0xB567, prLVT}, // Lo [27] HANGUL SYLLABLE DDAEG..HANGUL SYLLABLE DDAEH + {0xB568, 0xB568, prLV}, // Lo HANGUL SYLLABLE DDYA + {0xB569, 0xB583, prLVT}, // Lo [27] HANGUL SYLLABLE DDYAG..HANGUL SYLLABLE DDYAH + {0xB584, 0xB584, prLV}, // Lo HANGUL SYLLABLE DDYAE + {0xB585, 0xB59F, prLVT}, // Lo [27] HANGUL SYLLABLE DDYAEG..HANGUL SYLLABLE DDYAEH + {0xB5A0, 0xB5A0, prLV}, // Lo HANGUL SYLLABLE DDEO + {0xB5A1, 0xB5BB, prLVT}, // Lo [27] HANGUL SYLLABLE DDEOG..HANGUL SYLLABLE DDEOH + {0xB5BC, 0xB5BC, prLV}, // Lo HANGUL SYLLABLE DDE + {0xB5BD, 0xB5D7, prLVT}, // Lo [27] HANGUL SYLLABLE DDEG..HANGUL SYLLABLE DDEH + {0xB5D8, 0xB5D8, prLV}, // Lo HANGUL SYLLABLE DDYEO + {0xB5D9, 0xB5F3, prLVT}, // Lo [27] HANGUL SYLLABLE DDYEOG..HANGUL SYLLABLE DDYEOH + {0xB5F4, 0xB5F4, prLV}, // Lo HANGUL SYLLABLE DDYE + {0xB5F5, 0xB60F, prLVT}, // Lo [27] HANGUL SYLLABLE DDYEG..HANGUL SYLLABLE DDYEH + {0xB610, 0xB610, prLV}, // Lo HANGUL SYLLABLE DDO + {0xB611, 0xB62B, prLVT}, // Lo [27] HANGUL SYLLABLE DDOG..HANGUL SYLLABLE DDOH + {0xB62C, 0xB62C, prLV}, // Lo HANGUL SYLLABLE DDWA + {0xB62D, 0xB647, prLVT}, // Lo [27] HANGUL SYLLABLE DDWAG..HANGUL SYLLABLE DDWAH + {0xB648, 0xB648, prLV}, // Lo HANGUL SYLLABLE DDWAE + {0xB649, 0xB663, prLVT}, // Lo [27] HANGUL SYLLABLE DDWAEG..HANGUL SYLLABLE DDWAEH + {0xB664, 0xB664, prLV}, // Lo HANGUL SYLLABLE DDOE + {0xB665, 0xB67F, prLVT}, // Lo [27] HANGUL SYLLABLE DDOEG..HANGUL SYLLABLE DDOEH + {0xB680, 0xB680, prLV}, // Lo HANGUL SYLLABLE DDYO + {0xB681, 0xB69B, prLVT}, // Lo [27] HANGUL SYLLABLE DDYOG..HANGUL SYLLABLE DDYOH + {0xB69C, 0xB69C, prLV}, // Lo HANGUL SYLLABLE DDU + {0xB69D, 0xB6B7, prLVT}, // Lo [27] HANGUL SYLLABLE DDUG..HANGUL SYLLABLE DDUH + {0xB6B8, 0xB6B8, prLV}, // Lo HANGUL SYLLABLE DDWEO + {0xB6B9, 0xB6D3, prLVT}, // Lo [27] HANGUL SYLLABLE DDWEOG..HANGUL SYLLABLE DDWEOH + {0xB6D4, 0xB6D4, prLV}, // Lo HANGUL SYLLABLE DDWE + {0xB6D5, 0xB6EF, prLVT}, // Lo [27] HANGUL SYLLABLE DDWEG..HANGUL SYLLABLE DDWEH + {0xB6F0, 0xB6F0, prLV}, // Lo HANGUL SYLLABLE DDWI + {0xB6F1, 0xB70B, prLVT}, // Lo [27] HANGUL SYLLABLE DDWIG..HANGUL SYLLABLE DDWIH + {0xB70C, 0xB70C, prLV}, // Lo HANGUL SYLLABLE DDYU + {0xB70D, 0xB727, prLVT}, // Lo [27] HANGUL SYLLABLE DDYUG..HANGUL SYLLABLE DDYUH + {0xB728, 0xB728, prLV}, // Lo HANGUL SYLLABLE DDEU + {0xB729, 0xB743, prLVT}, // Lo [27] HANGUL SYLLABLE DDEUG..HANGUL SYLLABLE DDEUH + {0xB744, 0xB744, prLV}, // Lo HANGUL SYLLABLE DDYI + {0xB745, 0xB75F, prLVT}, // Lo [27] HANGUL SYLLABLE DDYIG..HANGUL SYLLABLE DDYIH + {0xB760, 0xB760, prLV}, // Lo HANGUL SYLLABLE DDI + {0xB761, 0xB77B, prLVT}, // Lo [27] HANGUL SYLLABLE DDIG..HANGUL SYLLABLE DDIH + {0xB77C, 0xB77C, prLV}, // Lo HANGUL SYLLABLE RA + {0xB77D, 0xB797, prLVT}, // Lo [27] HANGUL SYLLABLE RAG..HANGUL SYLLABLE RAH + {0xB798, 0xB798, prLV}, // Lo HANGUL SYLLABLE RAE + {0xB799, 0xB7B3, prLVT}, // Lo [27] HANGUL SYLLABLE RAEG..HANGUL SYLLABLE RAEH + {0xB7B4, 0xB7B4, prLV}, // Lo HANGUL SYLLABLE RYA + {0xB7B5, 0xB7CF, prLVT}, // Lo [27] HANGUL SYLLABLE RYAG..HANGUL SYLLABLE RYAH + {0xB7D0, 0xB7D0, prLV}, // Lo HANGUL SYLLABLE RYAE + {0xB7D1, 0xB7EB, prLVT}, // Lo [27] HANGUL SYLLABLE RYAEG..HANGUL SYLLABLE RYAEH + {0xB7EC, 0xB7EC, prLV}, // Lo HANGUL SYLLABLE REO + {0xB7ED, 0xB807, prLVT}, // Lo [27] HANGUL SYLLABLE REOG..HANGUL SYLLABLE REOH + {0xB808, 0xB808, prLV}, // Lo HANGUL SYLLABLE RE + {0xB809, 0xB823, prLVT}, // Lo [27] HANGUL SYLLABLE REG..HANGUL SYLLABLE REH + {0xB824, 0xB824, prLV}, // Lo HANGUL SYLLABLE RYEO + {0xB825, 0xB83F, prLVT}, // Lo [27] HANGUL SYLLABLE RYEOG..HANGUL SYLLABLE RYEOH + {0xB840, 0xB840, prLV}, // Lo HANGUL SYLLABLE RYE + {0xB841, 0xB85B, prLVT}, // Lo [27] HANGUL SYLLABLE RYEG..HANGUL SYLLABLE RYEH + {0xB85C, 0xB85C, prLV}, // Lo HANGUL SYLLABLE RO + {0xB85D, 0xB877, prLVT}, // Lo [27] HANGUL SYLLABLE ROG..HANGUL SYLLABLE ROH + {0xB878, 0xB878, prLV}, // Lo HANGUL SYLLABLE RWA + {0xB879, 0xB893, prLVT}, // Lo [27] HANGUL SYLLABLE RWAG..HANGUL SYLLABLE RWAH + {0xB894, 0xB894, prLV}, // Lo HANGUL SYLLABLE RWAE + {0xB895, 0xB8AF, prLVT}, // Lo [27] HANGUL SYLLABLE RWAEG..HANGUL SYLLABLE RWAEH + {0xB8B0, 0xB8B0, prLV}, // Lo HANGUL SYLLABLE ROE + {0xB8B1, 0xB8CB, prLVT}, // Lo [27] HANGUL SYLLABLE ROEG..HANGUL SYLLABLE ROEH + {0xB8CC, 0xB8CC, prLV}, // Lo HANGUL SYLLABLE RYO + {0xB8CD, 0xB8E7, prLVT}, // Lo [27] HANGUL SYLLABLE RYOG..HANGUL SYLLABLE RYOH + {0xB8E8, 0xB8E8, prLV}, // Lo HANGUL SYLLABLE RU + {0xB8E9, 0xB903, prLVT}, // Lo [27] HANGUL SYLLABLE RUG..HANGUL SYLLABLE RUH + {0xB904, 0xB904, prLV}, // Lo HANGUL SYLLABLE RWEO + {0xB905, 0xB91F, prLVT}, // Lo [27] HANGUL SYLLABLE RWEOG..HANGUL SYLLABLE RWEOH + {0xB920, 0xB920, prLV}, // Lo HANGUL SYLLABLE RWE + {0xB921, 0xB93B, prLVT}, // Lo [27] HANGUL SYLLABLE RWEG..HANGUL SYLLABLE RWEH + {0xB93C, 0xB93C, prLV}, // Lo HANGUL SYLLABLE RWI + {0xB93D, 0xB957, prLVT}, // Lo [27] HANGUL SYLLABLE RWIG..HANGUL SYLLABLE RWIH + {0xB958, 0xB958, prLV}, // Lo HANGUL SYLLABLE RYU + {0xB959, 0xB973, prLVT}, // Lo [27] HANGUL SYLLABLE RYUG..HANGUL SYLLABLE RYUH + {0xB974, 0xB974, prLV}, // Lo HANGUL SYLLABLE REU + {0xB975, 0xB98F, prLVT}, // Lo [27] HANGUL SYLLABLE REUG..HANGUL SYLLABLE REUH + {0xB990, 0xB990, prLV}, // Lo HANGUL SYLLABLE RYI + {0xB991, 0xB9AB, prLVT}, // Lo [27] HANGUL SYLLABLE RYIG..HANGUL SYLLABLE RYIH + {0xB9AC, 0xB9AC, prLV}, // Lo HANGUL SYLLABLE RI + {0xB9AD, 0xB9C7, prLVT}, // Lo [27] HANGUL SYLLABLE RIG..HANGUL SYLLABLE RIH + {0xB9C8, 0xB9C8, prLV}, // Lo HANGUL SYLLABLE MA + {0xB9C9, 0xB9E3, prLVT}, // Lo [27] HANGUL SYLLABLE MAG..HANGUL SYLLABLE MAH + {0xB9E4, 0xB9E4, prLV}, // Lo HANGUL SYLLABLE MAE + {0xB9E5, 0xB9FF, prLVT}, // Lo [27] HANGUL SYLLABLE MAEG..HANGUL SYLLABLE MAEH + {0xBA00, 0xBA00, prLV}, // Lo HANGUL SYLLABLE MYA + {0xBA01, 0xBA1B, prLVT}, // Lo [27] HANGUL SYLLABLE MYAG..HANGUL SYLLABLE MYAH + {0xBA1C, 0xBA1C, prLV}, // Lo HANGUL SYLLABLE MYAE + {0xBA1D, 0xBA37, prLVT}, // Lo [27] HANGUL SYLLABLE MYAEG..HANGUL SYLLABLE MYAEH + {0xBA38, 0xBA38, prLV}, // Lo HANGUL SYLLABLE MEO + {0xBA39, 0xBA53, prLVT}, // Lo [27] HANGUL SYLLABLE MEOG..HANGUL SYLLABLE MEOH + {0xBA54, 0xBA54, prLV}, // Lo HANGUL SYLLABLE ME + {0xBA55, 0xBA6F, prLVT}, // Lo [27] HANGUL SYLLABLE MEG..HANGUL SYLLABLE MEH + {0xBA70, 0xBA70, prLV}, // Lo HANGUL SYLLABLE MYEO + {0xBA71, 0xBA8B, prLVT}, // Lo [27] HANGUL SYLLABLE MYEOG..HANGUL SYLLABLE MYEOH + {0xBA8C, 0xBA8C, prLV}, // Lo HANGUL SYLLABLE MYE + {0xBA8D, 0xBAA7, prLVT}, // Lo [27] HANGUL SYLLABLE MYEG..HANGUL SYLLABLE MYEH + {0xBAA8, 0xBAA8, prLV}, // Lo HANGUL SYLLABLE MO + {0xBAA9, 0xBAC3, prLVT}, // Lo [27] HANGUL SYLLABLE MOG..HANGUL SYLLABLE MOH + {0xBAC4, 0xBAC4, prLV}, // Lo HANGUL SYLLABLE MWA + {0xBAC5, 0xBADF, prLVT}, // Lo [27] HANGUL SYLLABLE MWAG..HANGUL SYLLABLE MWAH + {0xBAE0, 0xBAE0, prLV}, // Lo HANGUL SYLLABLE MWAE + {0xBAE1, 0xBAFB, prLVT}, // Lo [27] HANGUL SYLLABLE MWAEG..HANGUL SYLLABLE MWAEH + {0xBAFC, 0xBAFC, prLV}, // Lo HANGUL SYLLABLE MOE + {0xBAFD, 0xBB17, prLVT}, // Lo [27] HANGUL SYLLABLE MOEG..HANGUL SYLLABLE MOEH + {0xBB18, 0xBB18, prLV}, // Lo HANGUL SYLLABLE MYO + {0xBB19, 0xBB33, prLVT}, // Lo [27] HANGUL SYLLABLE MYOG..HANGUL SYLLABLE MYOH + {0xBB34, 0xBB34, prLV}, // Lo HANGUL SYLLABLE MU + {0xBB35, 0xBB4F, prLVT}, // Lo [27] HANGUL SYLLABLE MUG..HANGUL SYLLABLE MUH + {0xBB50, 0xBB50, prLV}, // Lo HANGUL SYLLABLE MWEO + {0xBB51, 0xBB6B, prLVT}, // Lo [27] HANGUL SYLLABLE MWEOG..HANGUL SYLLABLE MWEOH + {0xBB6C, 0xBB6C, prLV}, // Lo HANGUL SYLLABLE MWE + {0xBB6D, 0xBB87, prLVT}, // Lo [27] HANGUL SYLLABLE MWEG..HANGUL SYLLABLE MWEH + {0xBB88, 0xBB88, prLV}, // Lo HANGUL SYLLABLE MWI + {0xBB89, 0xBBA3, prLVT}, // Lo [27] HANGUL SYLLABLE MWIG..HANGUL SYLLABLE MWIH + {0xBBA4, 0xBBA4, prLV}, // Lo HANGUL SYLLABLE MYU + {0xBBA5, 0xBBBF, prLVT}, // Lo [27] HANGUL SYLLABLE MYUG..HANGUL SYLLABLE MYUH + {0xBBC0, 0xBBC0, prLV}, // Lo HANGUL SYLLABLE MEU + {0xBBC1, 0xBBDB, prLVT}, // Lo [27] HANGUL SYLLABLE MEUG..HANGUL SYLLABLE MEUH + {0xBBDC, 0xBBDC, prLV}, // Lo HANGUL SYLLABLE MYI + {0xBBDD, 0xBBF7, prLVT}, // Lo [27] HANGUL SYLLABLE MYIG..HANGUL SYLLABLE MYIH + {0xBBF8, 0xBBF8, prLV}, // Lo HANGUL SYLLABLE MI + {0xBBF9, 0xBC13, prLVT}, // Lo [27] HANGUL SYLLABLE MIG..HANGUL SYLLABLE MIH + {0xBC14, 0xBC14, prLV}, // Lo HANGUL SYLLABLE BA + {0xBC15, 0xBC2F, prLVT}, // Lo [27] HANGUL SYLLABLE BAG..HANGUL SYLLABLE BAH + {0xBC30, 0xBC30, prLV}, // Lo HANGUL SYLLABLE BAE + {0xBC31, 0xBC4B, prLVT}, // Lo [27] HANGUL SYLLABLE BAEG..HANGUL SYLLABLE BAEH + {0xBC4C, 0xBC4C, prLV}, // Lo HANGUL SYLLABLE BYA + {0xBC4D, 0xBC67, prLVT}, // Lo [27] HANGUL SYLLABLE BYAG..HANGUL SYLLABLE BYAH + {0xBC68, 0xBC68, prLV}, // Lo HANGUL SYLLABLE BYAE + {0xBC69, 0xBC83, prLVT}, // Lo [27] HANGUL SYLLABLE BYAEG..HANGUL SYLLABLE BYAEH + {0xBC84, 0xBC84, prLV}, // Lo HANGUL SYLLABLE BEO + {0xBC85, 0xBC9F, prLVT}, // Lo [27] HANGUL SYLLABLE BEOG..HANGUL SYLLABLE BEOH + {0xBCA0, 0xBCA0, prLV}, // Lo HANGUL SYLLABLE BE + {0xBCA1, 0xBCBB, prLVT}, // Lo [27] HANGUL SYLLABLE BEG..HANGUL SYLLABLE BEH + {0xBCBC, 0xBCBC, prLV}, // Lo HANGUL SYLLABLE BYEO + {0xBCBD, 0xBCD7, prLVT}, // Lo [27] HANGUL SYLLABLE BYEOG..HANGUL SYLLABLE BYEOH + {0xBCD8, 0xBCD8, prLV}, // Lo HANGUL SYLLABLE BYE + {0xBCD9, 0xBCF3, prLVT}, // Lo [27] HANGUL SYLLABLE BYEG..HANGUL SYLLABLE BYEH + {0xBCF4, 0xBCF4, prLV}, // Lo HANGUL SYLLABLE BO + {0xBCF5, 0xBD0F, prLVT}, // Lo [27] HANGUL SYLLABLE BOG..HANGUL SYLLABLE BOH + {0xBD10, 0xBD10, prLV}, // Lo HANGUL SYLLABLE BWA + {0xBD11, 0xBD2B, prLVT}, // Lo [27] HANGUL SYLLABLE BWAG..HANGUL SYLLABLE BWAH + {0xBD2C, 0xBD2C, prLV}, // Lo HANGUL SYLLABLE BWAE + {0xBD2D, 0xBD47, prLVT}, // Lo [27] HANGUL SYLLABLE BWAEG..HANGUL SYLLABLE BWAEH + {0xBD48, 0xBD48, prLV}, // Lo HANGUL SYLLABLE BOE + {0xBD49, 0xBD63, prLVT}, // Lo [27] HANGUL SYLLABLE BOEG..HANGUL SYLLABLE BOEH + {0xBD64, 0xBD64, prLV}, // Lo HANGUL SYLLABLE BYO + {0xBD65, 0xBD7F, prLVT}, // Lo [27] HANGUL SYLLABLE BYOG..HANGUL SYLLABLE BYOH + {0xBD80, 0xBD80, prLV}, // Lo HANGUL SYLLABLE BU + {0xBD81, 0xBD9B, prLVT}, // Lo [27] HANGUL SYLLABLE BUG..HANGUL SYLLABLE BUH + {0xBD9C, 0xBD9C, prLV}, // Lo HANGUL SYLLABLE BWEO + {0xBD9D, 0xBDB7, prLVT}, // Lo [27] HANGUL SYLLABLE BWEOG..HANGUL SYLLABLE BWEOH + {0xBDB8, 0xBDB8, prLV}, // Lo HANGUL SYLLABLE BWE + {0xBDB9, 0xBDD3, prLVT}, // Lo [27] HANGUL SYLLABLE BWEG..HANGUL SYLLABLE BWEH + {0xBDD4, 0xBDD4, prLV}, // Lo HANGUL SYLLABLE BWI + {0xBDD5, 0xBDEF, prLVT}, // Lo [27] HANGUL SYLLABLE BWIG..HANGUL SYLLABLE BWIH + {0xBDF0, 0xBDF0, prLV}, // Lo HANGUL SYLLABLE BYU + {0xBDF1, 0xBE0B, prLVT}, // Lo [27] HANGUL SYLLABLE BYUG..HANGUL SYLLABLE BYUH + {0xBE0C, 0xBE0C, prLV}, // Lo HANGUL SYLLABLE BEU + {0xBE0D, 0xBE27, prLVT}, // Lo [27] HANGUL SYLLABLE BEUG..HANGUL SYLLABLE BEUH + {0xBE28, 0xBE28, prLV}, // Lo HANGUL SYLLABLE BYI + {0xBE29, 0xBE43, prLVT}, // Lo [27] HANGUL SYLLABLE BYIG..HANGUL SYLLABLE BYIH + {0xBE44, 0xBE44, prLV}, // Lo HANGUL SYLLABLE BI + {0xBE45, 0xBE5F, prLVT}, // Lo [27] HANGUL SYLLABLE BIG..HANGUL SYLLABLE BIH + {0xBE60, 0xBE60, prLV}, // Lo HANGUL SYLLABLE BBA + {0xBE61, 0xBE7B, prLVT}, // Lo [27] HANGUL SYLLABLE BBAG..HANGUL SYLLABLE BBAH + {0xBE7C, 0xBE7C, prLV}, // Lo HANGUL SYLLABLE BBAE + {0xBE7D, 0xBE97, prLVT}, // Lo [27] HANGUL SYLLABLE BBAEG..HANGUL SYLLABLE BBAEH + {0xBE98, 0xBE98, prLV}, // Lo HANGUL SYLLABLE BBYA + {0xBE99, 0xBEB3, prLVT}, // Lo [27] HANGUL SYLLABLE BBYAG..HANGUL SYLLABLE BBYAH + {0xBEB4, 0xBEB4, prLV}, // Lo HANGUL SYLLABLE BBYAE + {0xBEB5, 0xBECF, prLVT}, // Lo [27] HANGUL SYLLABLE BBYAEG..HANGUL SYLLABLE BBYAEH + {0xBED0, 0xBED0, prLV}, // Lo HANGUL SYLLABLE BBEO + {0xBED1, 0xBEEB, prLVT}, // Lo [27] HANGUL SYLLABLE BBEOG..HANGUL SYLLABLE BBEOH + {0xBEEC, 0xBEEC, prLV}, // Lo HANGUL SYLLABLE BBE + {0xBEED, 0xBF07, prLVT}, // Lo [27] HANGUL SYLLABLE BBEG..HANGUL SYLLABLE BBEH + {0xBF08, 0xBF08, prLV}, // Lo HANGUL SYLLABLE BBYEO + {0xBF09, 0xBF23, prLVT}, // Lo [27] HANGUL SYLLABLE BBYEOG..HANGUL SYLLABLE BBYEOH + {0xBF24, 0xBF24, prLV}, // Lo HANGUL SYLLABLE BBYE + {0xBF25, 0xBF3F, prLVT}, // Lo [27] HANGUL SYLLABLE BBYEG..HANGUL SYLLABLE BBYEH + {0xBF40, 0xBF40, prLV}, // Lo HANGUL SYLLABLE BBO + {0xBF41, 0xBF5B, prLVT}, // Lo [27] HANGUL SYLLABLE BBOG..HANGUL SYLLABLE BBOH + {0xBF5C, 0xBF5C, prLV}, // Lo HANGUL SYLLABLE BBWA + {0xBF5D, 0xBF77, prLVT}, // Lo [27] HANGUL SYLLABLE BBWAG..HANGUL SYLLABLE BBWAH + {0xBF78, 0xBF78, prLV}, // Lo HANGUL SYLLABLE BBWAE + {0xBF79, 0xBF93, prLVT}, // Lo [27] HANGUL SYLLABLE BBWAEG..HANGUL SYLLABLE BBWAEH + {0xBF94, 0xBF94, prLV}, // Lo HANGUL SYLLABLE BBOE + {0xBF95, 0xBFAF, prLVT}, // Lo [27] HANGUL SYLLABLE BBOEG..HANGUL SYLLABLE BBOEH + {0xBFB0, 0xBFB0, prLV}, // Lo HANGUL SYLLABLE BBYO + {0xBFB1, 0xBFCB, prLVT}, // Lo [27] HANGUL SYLLABLE BBYOG..HANGUL SYLLABLE BBYOH + {0xBFCC, 0xBFCC, prLV}, // Lo HANGUL SYLLABLE BBU + {0xBFCD, 0xBFE7, prLVT}, // Lo [27] HANGUL SYLLABLE BBUG..HANGUL SYLLABLE BBUH + {0xBFE8, 0xBFE8, prLV}, // Lo HANGUL SYLLABLE BBWEO + {0xBFE9, 0xC003, prLVT}, // Lo [27] HANGUL SYLLABLE BBWEOG..HANGUL SYLLABLE BBWEOH + {0xC004, 0xC004, prLV}, // Lo HANGUL SYLLABLE BBWE + {0xC005, 0xC01F, prLVT}, // Lo [27] HANGUL SYLLABLE BBWEG..HANGUL SYLLABLE BBWEH + {0xC020, 0xC020, prLV}, // Lo HANGUL SYLLABLE BBWI + {0xC021, 0xC03B, prLVT}, // Lo [27] HANGUL SYLLABLE BBWIG..HANGUL SYLLABLE BBWIH + {0xC03C, 0xC03C, prLV}, // Lo HANGUL SYLLABLE BBYU + {0xC03D, 0xC057, prLVT}, // Lo [27] HANGUL SYLLABLE BBYUG..HANGUL SYLLABLE BBYUH + {0xC058, 0xC058, prLV}, // Lo HANGUL SYLLABLE BBEU + {0xC059, 0xC073, prLVT}, // Lo [27] HANGUL SYLLABLE BBEUG..HANGUL SYLLABLE BBEUH + {0xC074, 0xC074, prLV}, // Lo HANGUL SYLLABLE BBYI + {0xC075, 0xC08F, prLVT}, // Lo [27] HANGUL SYLLABLE BBYIG..HANGUL SYLLABLE BBYIH + {0xC090, 0xC090, prLV}, // Lo HANGUL SYLLABLE BBI + {0xC091, 0xC0AB, prLVT}, // Lo [27] HANGUL SYLLABLE BBIG..HANGUL SYLLABLE BBIH + {0xC0AC, 0xC0AC, prLV}, // Lo HANGUL SYLLABLE SA + {0xC0AD, 0xC0C7, prLVT}, // Lo [27] HANGUL SYLLABLE SAG..HANGUL SYLLABLE SAH + {0xC0C8, 0xC0C8, prLV}, // Lo HANGUL SYLLABLE SAE + {0xC0C9, 0xC0E3, prLVT}, // Lo [27] HANGUL SYLLABLE SAEG..HANGUL SYLLABLE SAEH + {0xC0E4, 0xC0E4, prLV}, // Lo HANGUL SYLLABLE SYA + {0xC0E5, 0xC0FF, prLVT}, // Lo [27] HANGUL SYLLABLE SYAG..HANGUL SYLLABLE SYAH + {0xC100, 0xC100, prLV}, // Lo HANGUL SYLLABLE SYAE + {0xC101, 0xC11B, prLVT}, // Lo [27] HANGUL SYLLABLE SYAEG..HANGUL SYLLABLE SYAEH + {0xC11C, 0xC11C, prLV}, // Lo HANGUL SYLLABLE SEO + {0xC11D, 0xC137, prLVT}, // Lo [27] HANGUL SYLLABLE SEOG..HANGUL SYLLABLE SEOH + {0xC138, 0xC138, prLV}, // Lo HANGUL SYLLABLE SE + {0xC139, 0xC153, prLVT}, // Lo [27] HANGUL SYLLABLE SEG..HANGUL SYLLABLE SEH + {0xC154, 0xC154, prLV}, // Lo HANGUL SYLLABLE SYEO + {0xC155, 0xC16F, prLVT}, // Lo [27] HANGUL SYLLABLE SYEOG..HANGUL SYLLABLE SYEOH + {0xC170, 0xC170, prLV}, // Lo HANGUL SYLLABLE SYE + {0xC171, 0xC18B, prLVT}, // Lo [27] HANGUL SYLLABLE SYEG..HANGUL SYLLABLE SYEH + {0xC18C, 0xC18C, prLV}, // Lo HANGUL SYLLABLE SO + {0xC18D, 0xC1A7, prLVT}, // Lo [27] HANGUL SYLLABLE SOG..HANGUL SYLLABLE SOH + {0xC1A8, 0xC1A8, prLV}, // Lo HANGUL SYLLABLE SWA + {0xC1A9, 0xC1C3, prLVT}, // Lo [27] HANGUL SYLLABLE SWAG..HANGUL SYLLABLE SWAH + {0xC1C4, 0xC1C4, prLV}, // Lo HANGUL SYLLABLE SWAE + {0xC1C5, 0xC1DF, prLVT}, // Lo [27] HANGUL SYLLABLE SWAEG..HANGUL SYLLABLE SWAEH + {0xC1E0, 0xC1E0, prLV}, // Lo HANGUL SYLLABLE SOE + {0xC1E1, 0xC1FB, prLVT}, // Lo [27] HANGUL SYLLABLE SOEG..HANGUL SYLLABLE SOEH + {0xC1FC, 0xC1FC, prLV}, // Lo HANGUL SYLLABLE SYO + {0xC1FD, 0xC217, prLVT}, // Lo [27] HANGUL SYLLABLE SYOG..HANGUL SYLLABLE SYOH + {0xC218, 0xC218, prLV}, // Lo HANGUL SYLLABLE SU + {0xC219, 0xC233, prLVT}, // Lo [27] HANGUL SYLLABLE SUG..HANGUL SYLLABLE SUH + {0xC234, 0xC234, prLV}, // Lo HANGUL SYLLABLE SWEO + {0xC235, 0xC24F, prLVT}, // Lo [27] HANGUL SYLLABLE SWEOG..HANGUL SYLLABLE SWEOH + {0xC250, 0xC250, prLV}, // Lo HANGUL SYLLABLE SWE + {0xC251, 0xC26B, prLVT}, // Lo [27] HANGUL SYLLABLE SWEG..HANGUL SYLLABLE SWEH + {0xC26C, 0xC26C, prLV}, // Lo HANGUL SYLLABLE SWI + {0xC26D, 0xC287, prLVT}, // Lo [27] HANGUL SYLLABLE SWIG..HANGUL SYLLABLE SWIH + {0xC288, 0xC288, prLV}, // Lo HANGUL SYLLABLE SYU + {0xC289, 0xC2A3, prLVT}, // Lo [27] HANGUL SYLLABLE SYUG..HANGUL SYLLABLE SYUH + {0xC2A4, 0xC2A4, prLV}, // Lo HANGUL SYLLABLE SEU + {0xC2A5, 0xC2BF, prLVT}, // Lo [27] HANGUL SYLLABLE SEUG..HANGUL SYLLABLE SEUH + {0xC2C0, 0xC2C0, prLV}, // Lo HANGUL SYLLABLE SYI + {0xC2C1, 0xC2DB, prLVT}, // Lo [27] HANGUL SYLLABLE SYIG..HANGUL SYLLABLE SYIH + {0xC2DC, 0xC2DC, prLV}, // Lo HANGUL SYLLABLE SI + {0xC2DD, 0xC2F7, prLVT}, // Lo [27] HANGUL SYLLABLE SIG..HANGUL SYLLABLE SIH + {0xC2F8, 0xC2F8, prLV}, // Lo HANGUL SYLLABLE SSA + {0xC2F9, 0xC313, prLVT}, // Lo [27] HANGUL SYLLABLE SSAG..HANGUL SYLLABLE SSAH + {0xC314, 0xC314, prLV}, // Lo HANGUL SYLLABLE SSAE + {0xC315, 0xC32F, prLVT}, // Lo [27] HANGUL SYLLABLE SSAEG..HANGUL SYLLABLE SSAEH + {0xC330, 0xC330, prLV}, // Lo HANGUL SYLLABLE SSYA + {0xC331, 0xC34B, prLVT}, // Lo [27] HANGUL SYLLABLE SSYAG..HANGUL SYLLABLE SSYAH + {0xC34C, 0xC34C, prLV}, // Lo HANGUL SYLLABLE SSYAE + {0xC34D, 0xC367, prLVT}, // Lo [27] HANGUL SYLLABLE SSYAEG..HANGUL SYLLABLE SSYAEH + {0xC368, 0xC368, prLV}, // Lo HANGUL SYLLABLE SSEO + {0xC369, 0xC383, prLVT}, // Lo [27] HANGUL SYLLABLE SSEOG..HANGUL SYLLABLE SSEOH + {0xC384, 0xC384, prLV}, // Lo HANGUL SYLLABLE SSE + {0xC385, 0xC39F, prLVT}, // Lo [27] HANGUL SYLLABLE SSEG..HANGUL SYLLABLE SSEH + {0xC3A0, 0xC3A0, prLV}, // Lo HANGUL SYLLABLE SSYEO + {0xC3A1, 0xC3BB, prLVT}, // Lo [27] HANGUL SYLLABLE SSYEOG..HANGUL SYLLABLE SSYEOH + {0xC3BC, 0xC3BC, prLV}, // Lo HANGUL SYLLABLE SSYE + {0xC3BD, 0xC3D7, prLVT}, // Lo [27] HANGUL SYLLABLE SSYEG..HANGUL SYLLABLE SSYEH + {0xC3D8, 0xC3D8, prLV}, // Lo HANGUL SYLLABLE SSO + {0xC3D9, 0xC3F3, prLVT}, // Lo [27] HANGUL SYLLABLE SSOG..HANGUL SYLLABLE SSOH + {0xC3F4, 0xC3F4, prLV}, // Lo HANGUL SYLLABLE SSWA + {0xC3F5, 0xC40F, prLVT}, // Lo [27] HANGUL SYLLABLE SSWAG..HANGUL SYLLABLE SSWAH + {0xC410, 0xC410, prLV}, // Lo HANGUL SYLLABLE SSWAE + {0xC411, 0xC42B, prLVT}, // Lo [27] HANGUL SYLLABLE SSWAEG..HANGUL SYLLABLE SSWAEH + {0xC42C, 0xC42C, prLV}, // Lo HANGUL SYLLABLE SSOE + {0xC42D, 0xC447, prLVT}, // Lo [27] HANGUL SYLLABLE SSOEG..HANGUL SYLLABLE SSOEH + {0xC448, 0xC448, prLV}, // Lo HANGUL SYLLABLE SSYO + {0xC449, 0xC463, prLVT}, // Lo [27] HANGUL SYLLABLE SSYOG..HANGUL SYLLABLE SSYOH + {0xC464, 0xC464, prLV}, // Lo HANGUL SYLLABLE SSU + {0xC465, 0xC47F, prLVT}, // Lo [27] HANGUL SYLLABLE SSUG..HANGUL SYLLABLE SSUH + {0xC480, 0xC480, prLV}, // Lo HANGUL SYLLABLE SSWEO + {0xC481, 0xC49B, prLVT}, // Lo [27] HANGUL SYLLABLE SSWEOG..HANGUL SYLLABLE SSWEOH + {0xC49C, 0xC49C, prLV}, // Lo HANGUL SYLLABLE SSWE + {0xC49D, 0xC4B7, prLVT}, // Lo [27] HANGUL SYLLABLE SSWEG..HANGUL SYLLABLE SSWEH + {0xC4B8, 0xC4B8, prLV}, // Lo HANGUL SYLLABLE SSWI + {0xC4B9, 0xC4D3, prLVT}, // Lo [27] HANGUL SYLLABLE SSWIG..HANGUL SYLLABLE SSWIH + {0xC4D4, 0xC4D4, prLV}, // Lo HANGUL SYLLABLE SSYU + {0xC4D5, 0xC4EF, prLVT}, // Lo [27] HANGUL SYLLABLE SSYUG..HANGUL SYLLABLE SSYUH + {0xC4F0, 0xC4F0, prLV}, // Lo HANGUL SYLLABLE SSEU + {0xC4F1, 0xC50B, prLVT}, // Lo [27] HANGUL SYLLABLE SSEUG..HANGUL SYLLABLE SSEUH + {0xC50C, 0xC50C, prLV}, // Lo HANGUL SYLLABLE SSYI + {0xC50D, 0xC527, prLVT}, // Lo [27] HANGUL SYLLABLE SSYIG..HANGUL SYLLABLE SSYIH + {0xC528, 0xC528, prLV}, // Lo HANGUL SYLLABLE SSI + {0xC529, 0xC543, prLVT}, // Lo [27] HANGUL SYLLABLE SSIG..HANGUL SYLLABLE SSIH + {0xC544, 0xC544, prLV}, // Lo HANGUL SYLLABLE A + {0xC545, 0xC55F, prLVT}, // Lo [27] HANGUL SYLLABLE AG..HANGUL SYLLABLE AH + {0xC560, 0xC560, prLV}, // Lo HANGUL SYLLABLE AE + {0xC561, 0xC57B, prLVT}, // Lo [27] HANGUL SYLLABLE AEG..HANGUL SYLLABLE AEH + {0xC57C, 0xC57C, prLV}, // Lo HANGUL SYLLABLE YA + {0xC57D, 0xC597, prLVT}, // Lo [27] HANGUL SYLLABLE YAG..HANGUL SYLLABLE YAH + {0xC598, 0xC598, prLV}, // Lo HANGUL SYLLABLE YAE + {0xC599, 0xC5B3, prLVT}, // Lo [27] HANGUL SYLLABLE YAEG..HANGUL SYLLABLE YAEH + {0xC5B4, 0xC5B4, prLV}, // Lo HANGUL SYLLABLE EO + {0xC5B5, 0xC5CF, prLVT}, // Lo [27] HANGUL SYLLABLE EOG..HANGUL SYLLABLE EOH + {0xC5D0, 0xC5D0, prLV}, // Lo HANGUL SYLLABLE E + {0xC5D1, 0xC5EB, prLVT}, // Lo [27] HANGUL SYLLABLE EG..HANGUL SYLLABLE EH + {0xC5EC, 0xC5EC, prLV}, // Lo HANGUL SYLLABLE YEO + {0xC5ED, 0xC607, prLVT}, // Lo [27] HANGUL SYLLABLE YEOG..HANGUL SYLLABLE YEOH + {0xC608, 0xC608, prLV}, // Lo HANGUL SYLLABLE YE + {0xC609, 0xC623, prLVT}, // Lo [27] HANGUL SYLLABLE YEG..HANGUL SYLLABLE YEH + {0xC624, 0xC624, prLV}, // Lo HANGUL SYLLABLE O + {0xC625, 0xC63F, prLVT}, // Lo [27] HANGUL SYLLABLE OG..HANGUL SYLLABLE OH + {0xC640, 0xC640, prLV}, // Lo HANGUL SYLLABLE WA + {0xC641, 0xC65B, prLVT}, // Lo [27] HANGUL SYLLABLE WAG..HANGUL SYLLABLE WAH + {0xC65C, 0xC65C, prLV}, // Lo HANGUL SYLLABLE WAE + {0xC65D, 0xC677, prLVT}, // Lo [27] HANGUL SYLLABLE WAEG..HANGUL SYLLABLE WAEH + {0xC678, 0xC678, prLV}, // Lo HANGUL SYLLABLE OE + {0xC679, 0xC693, prLVT}, // Lo [27] HANGUL SYLLABLE OEG..HANGUL SYLLABLE OEH + {0xC694, 0xC694, prLV}, // Lo HANGUL SYLLABLE YO + {0xC695, 0xC6AF, prLVT}, // Lo [27] HANGUL SYLLABLE YOG..HANGUL SYLLABLE YOH + {0xC6B0, 0xC6B0, prLV}, // Lo HANGUL SYLLABLE U + {0xC6B1, 0xC6CB, prLVT}, // Lo [27] HANGUL SYLLABLE UG..HANGUL SYLLABLE UH + {0xC6CC, 0xC6CC, prLV}, // Lo HANGUL SYLLABLE WEO + {0xC6CD, 0xC6E7, prLVT}, // Lo [27] HANGUL SYLLABLE WEOG..HANGUL SYLLABLE WEOH + {0xC6E8, 0xC6E8, prLV}, // Lo HANGUL SYLLABLE WE + {0xC6E9, 0xC703, prLVT}, // Lo [27] HANGUL SYLLABLE WEG..HANGUL SYLLABLE WEH + {0xC704, 0xC704, prLV}, // Lo HANGUL SYLLABLE WI + {0xC705, 0xC71F, prLVT}, // Lo [27] HANGUL SYLLABLE WIG..HANGUL SYLLABLE WIH + {0xC720, 0xC720, prLV}, // Lo HANGUL SYLLABLE YU + {0xC721, 0xC73B, prLVT}, // Lo [27] HANGUL SYLLABLE YUG..HANGUL SYLLABLE YUH + {0xC73C, 0xC73C, prLV}, // Lo HANGUL SYLLABLE EU + {0xC73D, 0xC757, prLVT}, // Lo [27] HANGUL SYLLABLE EUG..HANGUL SYLLABLE EUH + {0xC758, 0xC758, prLV}, // Lo HANGUL SYLLABLE YI + {0xC759, 0xC773, prLVT}, // Lo [27] HANGUL SYLLABLE YIG..HANGUL SYLLABLE YIH + {0xC774, 0xC774, prLV}, // Lo HANGUL SYLLABLE I + {0xC775, 0xC78F, prLVT}, // Lo [27] HANGUL SYLLABLE IG..HANGUL SYLLABLE IH + {0xC790, 0xC790, prLV}, // Lo HANGUL SYLLABLE JA + {0xC791, 0xC7AB, prLVT}, // Lo [27] HANGUL SYLLABLE JAG..HANGUL SYLLABLE JAH + {0xC7AC, 0xC7AC, prLV}, // Lo HANGUL SYLLABLE JAE + {0xC7AD, 0xC7C7, prLVT}, // Lo [27] HANGUL SYLLABLE JAEG..HANGUL SYLLABLE JAEH + {0xC7C8, 0xC7C8, prLV}, // Lo HANGUL SYLLABLE JYA + {0xC7C9, 0xC7E3, prLVT}, // Lo [27] HANGUL SYLLABLE JYAG..HANGUL SYLLABLE JYAH + {0xC7E4, 0xC7E4, prLV}, // Lo HANGUL SYLLABLE JYAE + {0xC7E5, 0xC7FF, prLVT}, // Lo [27] HANGUL SYLLABLE JYAEG..HANGUL SYLLABLE JYAEH + {0xC800, 0xC800, prLV}, // Lo HANGUL SYLLABLE JEO + {0xC801, 0xC81B, prLVT}, // Lo [27] HANGUL SYLLABLE JEOG..HANGUL SYLLABLE JEOH + {0xC81C, 0xC81C, prLV}, // Lo HANGUL SYLLABLE JE + {0xC81D, 0xC837, prLVT}, // Lo [27] HANGUL SYLLABLE JEG..HANGUL SYLLABLE JEH + {0xC838, 0xC838, prLV}, // Lo HANGUL SYLLABLE JYEO + {0xC839, 0xC853, prLVT}, // Lo [27] HANGUL SYLLABLE JYEOG..HANGUL SYLLABLE JYEOH + {0xC854, 0xC854, prLV}, // Lo HANGUL SYLLABLE JYE + {0xC855, 0xC86F, prLVT}, // Lo [27] HANGUL SYLLABLE JYEG..HANGUL SYLLABLE JYEH + {0xC870, 0xC870, prLV}, // Lo HANGUL SYLLABLE JO + {0xC871, 0xC88B, prLVT}, // Lo [27] HANGUL SYLLABLE JOG..HANGUL SYLLABLE JOH + {0xC88C, 0xC88C, prLV}, // Lo HANGUL SYLLABLE JWA + {0xC88D, 0xC8A7, prLVT}, // Lo [27] HANGUL SYLLABLE JWAG..HANGUL SYLLABLE JWAH + {0xC8A8, 0xC8A8, prLV}, // Lo HANGUL SYLLABLE JWAE + {0xC8A9, 0xC8C3, prLVT}, // Lo [27] HANGUL SYLLABLE JWAEG..HANGUL SYLLABLE JWAEH + {0xC8C4, 0xC8C4, prLV}, // Lo HANGUL SYLLABLE JOE + {0xC8C5, 0xC8DF, prLVT}, // Lo [27] HANGUL SYLLABLE JOEG..HANGUL SYLLABLE JOEH + {0xC8E0, 0xC8E0, prLV}, // Lo HANGUL SYLLABLE JYO + {0xC8E1, 0xC8FB, prLVT}, // Lo [27] HANGUL SYLLABLE JYOG..HANGUL SYLLABLE JYOH + {0xC8FC, 0xC8FC, prLV}, // Lo HANGUL SYLLABLE JU + {0xC8FD, 0xC917, prLVT}, // Lo [27] HANGUL SYLLABLE JUG..HANGUL SYLLABLE JUH + {0xC918, 0xC918, prLV}, // Lo HANGUL SYLLABLE JWEO + {0xC919, 0xC933, prLVT}, // Lo [27] HANGUL SYLLABLE JWEOG..HANGUL SYLLABLE JWEOH + {0xC934, 0xC934, prLV}, // Lo HANGUL SYLLABLE JWE + {0xC935, 0xC94F, prLVT}, // Lo [27] HANGUL SYLLABLE JWEG..HANGUL SYLLABLE JWEH + {0xC950, 0xC950, prLV}, // Lo HANGUL SYLLABLE JWI + {0xC951, 0xC96B, prLVT}, // Lo [27] HANGUL SYLLABLE JWIG..HANGUL SYLLABLE JWIH + {0xC96C, 0xC96C, prLV}, // Lo HANGUL SYLLABLE JYU + {0xC96D, 0xC987, prLVT}, // Lo [27] HANGUL SYLLABLE JYUG..HANGUL SYLLABLE JYUH + {0xC988, 0xC988, prLV}, // Lo HANGUL SYLLABLE JEU + {0xC989, 0xC9A3, prLVT}, // Lo [27] HANGUL SYLLABLE JEUG..HANGUL SYLLABLE JEUH + {0xC9A4, 0xC9A4, prLV}, // Lo HANGUL SYLLABLE JYI + {0xC9A5, 0xC9BF, prLVT}, // Lo [27] HANGUL SYLLABLE JYIG..HANGUL SYLLABLE JYIH + {0xC9C0, 0xC9C0, prLV}, // Lo HANGUL SYLLABLE JI + {0xC9C1, 0xC9DB, prLVT}, // Lo [27] HANGUL SYLLABLE JIG..HANGUL SYLLABLE JIH + {0xC9DC, 0xC9DC, prLV}, // Lo HANGUL SYLLABLE JJA + {0xC9DD, 0xC9F7, prLVT}, // Lo [27] HANGUL SYLLABLE JJAG..HANGUL SYLLABLE JJAH + {0xC9F8, 0xC9F8, prLV}, // Lo HANGUL SYLLABLE JJAE + {0xC9F9, 0xCA13, prLVT}, // Lo [27] HANGUL SYLLABLE JJAEG..HANGUL SYLLABLE JJAEH + {0xCA14, 0xCA14, prLV}, // Lo HANGUL SYLLABLE JJYA + {0xCA15, 0xCA2F, prLVT}, // Lo [27] HANGUL SYLLABLE JJYAG..HANGUL SYLLABLE JJYAH + {0xCA30, 0xCA30, prLV}, // Lo HANGUL SYLLABLE JJYAE + {0xCA31, 0xCA4B, prLVT}, // Lo [27] HANGUL SYLLABLE JJYAEG..HANGUL SYLLABLE JJYAEH + {0xCA4C, 0xCA4C, prLV}, // Lo HANGUL SYLLABLE JJEO + {0xCA4D, 0xCA67, prLVT}, // Lo [27] HANGUL SYLLABLE JJEOG..HANGUL SYLLABLE JJEOH + {0xCA68, 0xCA68, prLV}, // Lo HANGUL SYLLABLE JJE + {0xCA69, 0xCA83, prLVT}, // Lo [27] HANGUL SYLLABLE JJEG..HANGUL SYLLABLE JJEH + {0xCA84, 0xCA84, prLV}, // Lo HANGUL SYLLABLE JJYEO + {0xCA85, 0xCA9F, prLVT}, // Lo [27] HANGUL SYLLABLE JJYEOG..HANGUL SYLLABLE JJYEOH + {0xCAA0, 0xCAA0, prLV}, // Lo HANGUL SYLLABLE JJYE + {0xCAA1, 0xCABB, prLVT}, // Lo [27] HANGUL SYLLABLE JJYEG..HANGUL SYLLABLE JJYEH + {0xCABC, 0xCABC, prLV}, // Lo HANGUL SYLLABLE JJO + {0xCABD, 0xCAD7, prLVT}, // Lo [27] HANGUL SYLLABLE JJOG..HANGUL SYLLABLE JJOH + {0xCAD8, 0xCAD8, prLV}, // Lo HANGUL SYLLABLE JJWA + {0xCAD9, 0xCAF3, prLVT}, // Lo [27] HANGUL SYLLABLE JJWAG..HANGUL SYLLABLE JJWAH + {0xCAF4, 0xCAF4, prLV}, // Lo HANGUL SYLLABLE JJWAE + {0xCAF5, 0xCB0F, prLVT}, // Lo [27] HANGUL SYLLABLE JJWAEG..HANGUL SYLLABLE JJWAEH + {0xCB10, 0xCB10, prLV}, // Lo HANGUL SYLLABLE JJOE + {0xCB11, 0xCB2B, prLVT}, // Lo [27] HANGUL SYLLABLE JJOEG..HANGUL SYLLABLE JJOEH + {0xCB2C, 0xCB2C, prLV}, // Lo HANGUL SYLLABLE JJYO + {0xCB2D, 0xCB47, prLVT}, // Lo [27] HANGUL SYLLABLE JJYOG..HANGUL SYLLABLE JJYOH + {0xCB48, 0xCB48, prLV}, // Lo HANGUL SYLLABLE JJU + {0xCB49, 0xCB63, prLVT}, // Lo [27] HANGUL SYLLABLE JJUG..HANGUL SYLLABLE JJUH + {0xCB64, 0xCB64, prLV}, // Lo HANGUL SYLLABLE JJWEO + {0xCB65, 0xCB7F, prLVT}, // Lo [27] HANGUL SYLLABLE JJWEOG..HANGUL SYLLABLE JJWEOH + {0xCB80, 0xCB80, prLV}, // Lo HANGUL SYLLABLE JJWE + {0xCB81, 0xCB9B, prLVT}, // Lo [27] HANGUL SYLLABLE JJWEG..HANGUL SYLLABLE JJWEH + {0xCB9C, 0xCB9C, prLV}, // Lo HANGUL SYLLABLE JJWI + {0xCB9D, 0xCBB7, prLVT}, // Lo [27] HANGUL SYLLABLE JJWIG..HANGUL SYLLABLE JJWIH + {0xCBB8, 0xCBB8, prLV}, // Lo HANGUL SYLLABLE JJYU + {0xCBB9, 0xCBD3, prLVT}, // Lo [27] HANGUL SYLLABLE JJYUG..HANGUL SYLLABLE JJYUH + {0xCBD4, 0xCBD4, prLV}, // Lo HANGUL SYLLABLE JJEU + {0xCBD5, 0xCBEF, prLVT}, // Lo [27] HANGUL SYLLABLE JJEUG..HANGUL SYLLABLE JJEUH + {0xCBF0, 0xCBF0, prLV}, // Lo HANGUL SYLLABLE JJYI + {0xCBF1, 0xCC0B, prLVT}, // Lo [27] HANGUL SYLLABLE JJYIG..HANGUL SYLLABLE JJYIH + {0xCC0C, 0xCC0C, prLV}, // Lo HANGUL SYLLABLE JJI + {0xCC0D, 0xCC27, prLVT}, // Lo [27] HANGUL SYLLABLE JJIG..HANGUL SYLLABLE JJIH + {0xCC28, 0xCC28, prLV}, // Lo HANGUL SYLLABLE CA + {0xCC29, 0xCC43, prLVT}, // Lo [27] HANGUL SYLLABLE CAG..HANGUL SYLLABLE CAH + {0xCC44, 0xCC44, prLV}, // Lo HANGUL SYLLABLE CAE + {0xCC45, 0xCC5F, prLVT}, // Lo [27] HANGUL SYLLABLE CAEG..HANGUL SYLLABLE CAEH + {0xCC60, 0xCC60, prLV}, // Lo HANGUL SYLLABLE CYA + {0xCC61, 0xCC7B, prLVT}, // Lo [27] HANGUL SYLLABLE CYAG..HANGUL SYLLABLE CYAH + {0xCC7C, 0xCC7C, prLV}, // Lo HANGUL SYLLABLE CYAE + {0xCC7D, 0xCC97, prLVT}, // Lo [27] HANGUL SYLLABLE CYAEG..HANGUL SYLLABLE CYAEH + {0xCC98, 0xCC98, prLV}, // Lo HANGUL SYLLABLE CEO + {0xCC99, 0xCCB3, prLVT}, // Lo [27] HANGUL SYLLABLE CEOG..HANGUL SYLLABLE CEOH + {0xCCB4, 0xCCB4, prLV}, // Lo HANGUL SYLLABLE CE + {0xCCB5, 0xCCCF, prLVT}, // Lo [27] HANGUL SYLLABLE CEG..HANGUL SYLLABLE CEH + {0xCCD0, 0xCCD0, prLV}, // Lo HANGUL SYLLABLE CYEO + {0xCCD1, 0xCCEB, prLVT}, // Lo [27] HANGUL SYLLABLE CYEOG..HANGUL SYLLABLE CYEOH + {0xCCEC, 0xCCEC, prLV}, // Lo HANGUL SYLLABLE CYE + {0xCCED, 0xCD07, prLVT}, // Lo [27] HANGUL SYLLABLE CYEG..HANGUL SYLLABLE CYEH + {0xCD08, 0xCD08, prLV}, // Lo HANGUL SYLLABLE CO + {0xCD09, 0xCD23, prLVT}, // Lo [27] HANGUL SYLLABLE COG..HANGUL SYLLABLE COH + {0xCD24, 0xCD24, prLV}, // Lo HANGUL SYLLABLE CWA + {0xCD25, 0xCD3F, prLVT}, // Lo [27] HANGUL SYLLABLE CWAG..HANGUL SYLLABLE CWAH + {0xCD40, 0xCD40, prLV}, // Lo HANGUL SYLLABLE CWAE + {0xCD41, 0xCD5B, prLVT}, // Lo [27] HANGUL SYLLABLE CWAEG..HANGUL SYLLABLE CWAEH + {0xCD5C, 0xCD5C, prLV}, // Lo HANGUL SYLLABLE COE + {0xCD5D, 0xCD77, prLVT}, // Lo [27] HANGUL SYLLABLE COEG..HANGUL SYLLABLE COEH + {0xCD78, 0xCD78, prLV}, // Lo HANGUL SYLLABLE CYO + {0xCD79, 0xCD93, prLVT}, // Lo [27] HANGUL SYLLABLE CYOG..HANGUL SYLLABLE CYOH + {0xCD94, 0xCD94, prLV}, // Lo HANGUL SYLLABLE CU + {0xCD95, 0xCDAF, prLVT}, // Lo [27] HANGUL SYLLABLE CUG..HANGUL SYLLABLE CUH + {0xCDB0, 0xCDB0, prLV}, // Lo HANGUL SYLLABLE CWEO + {0xCDB1, 0xCDCB, prLVT}, // Lo [27] HANGUL SYLLABLE CWEOG..HANGUL SYLLABLE CWEOH + {0xCDCC, 0xCDCC, prLV}, // Lo HANGUL SYLLABLE CWE + {0xCDCD, 0xCDE7, prLVT}, // Lo [27] HANGUL SYLLABLE CWEG..HANGUL SYLLABLE CWEH + {0xCDE8, 0xCDE8, prLV}, // Lo HANGUL SYLLABLE CWI + {0xCDE9, 0xCE03, prLVT}, // Lo [27] HANGUL SYLLABLE CWIG..HANGUL SYLLABLE CWIH + {0xCE04, 0xCE04, prLV}, // Lo HANGUL SYLLABLE CYU + {0xCE05, 0xCE1F, prLVT}, // Lo [27] HANGUL SYLLABLE CYUG..HANGUL SYLLABLE CYUH + {0xCE20, 0xCE20, prLV}, // Lo HANGUL SYLLABLE CEU + {0xCE21, 0xCE3B, prLVT}, // Lo [27] HANGUL SYLLABLE CEUG..HANGUL SYLLABLE CEUH + {0xCE3C, 0xCE3C, prLV}, // Lo HANGUL SYLLABLE CYI + {0xCE3D, 0xCE57, prLVT}, // Lo [27] HANGUL SYLLABLE CYIG..HANGUL SYLLABLE CYIH + {0xCE58, 0xCE58, prLV}, // Lo HANGUL SYLLABLE CI + {0xCE59, 0xCE73, prLVT}, // Lo [27] HANGUL SYLLABLE CIG..HANGUL SYLLABLE CIH + {0xCE74, 0xCE74, prLV}, // Lo HANGUL SYLLABLE KA + {0xCE75, 0xCE8F, prLVT}, // Lo [27] HANGUL SYLLABLE KAG..HANGUL SYLLABLE KAH + {0xCE90, 0xCE90, prLV}, // Lo HANGUL SYLLABLE KAE + {0xCE91, 0xCEAB, prLVT}, // Lo [27] HANGUL SYLLABLE KAEG..HANGUL SYLLABLE KAEH + {0xCEAC, 0xCEAC, prLV}, // Lo HANGUL SYLLABLE KYA + {0xCEAD, 0xCEC7, prLVT}, // Lo [27] HANGUL SYLLABLE KYAG..HANGUL SYLLABLE KYAH + {0xCEC8, 0xCEC8, prLV}, // Lo HANGUL SYLLABLE KYAE + {0xCEC9, 0xCEE3, prLVT}, // Lo [27] HANGUL SYLLABLE KYAEG..HANGUL SYLLABLE KYAEH + {0xCEE4, 0xCEE4, prLV}, // Lo HANGUL SYLLABLE KEO + {0xCEE5, 0xCEFF, prLVT}, // Lo [27] HANGUL SYLLABLE KEOG..HANGUL SYLLABLE KEOH + {0xCF00, 0xCF00, prLV}, // Lo HANGUL SYLLABLE KE + {0xCF01, 0xCF1B, prLVT}, // Lo [27] HANGUL SYLLABLE KEG..HANGUL SYLLABLE KEH + {0xCF1C, 0xCF1C, prLV}, // Lo HANGUL SYLLABLE KYEO + {0xCF1D, 0xCF37, prLVT}, // Lo [27] HANGUL SYLLABLE KYEOG..HANGUL SYLLABLE KYEOH + {0xCF38, 0xCF38, prLV}, // Lo HANGUL SYLLABLE KYE + {0xCF39, 0xCF53, prLVT}, // Lo [27] HANGUL SYLLABLE KYEG..HANGUL SYLLABLE KYEH + {0xCF54, 0xCF54, prLV}, // Lo HANGUL SYLLABLE KO + {0xCF55, 0xCF6F, prLVT}, // Lo [27] HANGUL SYLLABLE KOG..HANGUL SYLLABLE KOH + {0xCF70, 0xCF70, prLV}, // Lo HANGUL SYLLABLE KWA + {0xCF71, 0xCF8B, prLVT}, // Lo [27] HANGUL SYLLABLE KWAG..HANGUL SYLLABLE KWAH + {0xCF8C, 0xCF8C, prLV}, // Lo HANGUL SYLLABLE KWAE + {0xCF8D, 0xCFA7, prLVT}, // Lo [27] HANGUL SYLLABLE KWAEG..HANGUL SYLLABLE KWAEH + {0xCFA8, 0xCFA8, prLV}, // Lo HANGUL SYLLABLE KOE + {0xCFA9, 0xCFC3, prLVT}, // Lo [27] HANGUL SYLLABLE KOEG..HANGUL SYLLABLE KOEH + {0xCFC4, 0xCFC4, prLV}, // Lo HANGUL SYLLABLE KYO + {0xCFC5, 0xCFDF, prLVT}, // Lo [27] HANGUL SYLLABLE KYOG..HANGUL SYLLABLE KYOH + {0xCFE0, 0xCFE0, prLV}, // Lo HANGUL SYLLABLE KU + {0xCFE1, 0xCFFB, prLVT}, // Lo [27] HANGUL SYLLABLE KUG..HANGUL SYLLABLE KUH + {0xCFFC, 0xCFFC, prLV}, // Lo HANGUL SYLLABLE KWEO + {0xCFFD, 0xD017, prLVT}, // Lo [27] HANGUL SYLLABLE KWEOG..HANGUL SYLLABLE KWEOH + {0xD018, 0xD018, prLV}, // Lo HANGUL SYLLABLE KWE + {0xD019, 0xD033, prLVT}, // Lo [27] HANGUL SYLLABLE KWEG..HANGUL SYLLABLE KWEH + {0xD034, 0xD034, prLV}, // Lo HANGUL SYLLABLE KWI + {0xD035, 0xD04F, prLVT}, // Lo [27] HANGUL SYLLABLE KWIG..HANGUL SYLLABLE KWIH + {0xD050, 0xD050, prLV}, // Lo HANGUL SYLLABLE KYU + {0xD051, 0xD06B, prLVT}, // Lo [27] HANGUL SYLLABLE KYUG..HANGUL SYLLABLE KYUH + {0xD06C, 0xD06C, prLV}, // Lo HANGUL SYLLABLE KEU + {0xD06D, 0xD087, prLVT}, // Lo [27] HANGUL SYLLABLE KEUG..HANGUL SYLLABLE KEUH + {0xD088, 0xD088, prLV}, // Lo HANGUL SYLLABLE KYI + {0xD089, 0xD0A3, prLVT}, // Lo [27] HANGUL SYLLABLE KYIG..HANGUL SYLLABLE KYIH + {0xD0A4, 0xD0A4, prLV}, // Lo HANGUL SYLLABLE KI + {0xD0A5, 0xD0BF, prLVT}, // Lo [27] HANGUL SYLLABLE KIG..HANGUL SYLLABLE KIH + {0xD0C0, 0xD0C0, prLV}, // Lo HANGUL SYLLABLE TA + {0xD0C1, 0xD0DB, prLVT}, // Lo [27] HANGUL SYLLABLE TAG..HANGUL SYLLABLE TAH + {0xD0DC, 0xD0DC, prLV}, // Lo HANGUL SYLLABLE TAE + {0xD0DD, 0xD0F7, prLVT}, // Lo [27] HANGUL SYLLABLE TAEG..HANGUL SYLLABLE TAEH + {0xD0F8, 0xD0F8, prLV}, // Lo HANGUL SYLLABLE TYA + {0xD0F9, 0xD113, prLVT}, // Lo [27] HANGUL SYLLABLE TYAG..HANGUL SYLLABLE TYAH + {0xD114, 0xD114, prLV}, // Lo HANGUL SYLLABLE TYAE + {0xD115, 0xD12F, prLVT}, // Lo [27] HANGUL SYLLABLE TYAEG..HANGUL SYLLABLE TYAEH + {0xD130, 0xD130, prLV}, // Lo HANGUL SYLLABLE TEO + {0xD131, 0xD14B, prLVT}, // Lo [27] HANGUL SYLLABLE TEOG..HANGUL SYLLABLE TEOH + {0xD14C, 0xD14C, prLV}, // Lo HANGUL SYLLABLE TE + {0xD14D, 0xD167, prLVT}, // Lo [27] HANGUL SYLLABLE TEG..HANGUL SYLLABLE TEH + {0xD168, 0xD168, prLV}, // Lo HANGUL SYLLABLE TYEO + {0xD169, 0xD183, prLVT}, // Lo [27] HANGUL SYLLABLE TYEOG..HANGUL SYLLABLE TYEOH + {0xD184, 0xD184, prLV}, // Lo HANGUL SYLLABLE TYE + {0xD185, 0xD19F, prLVT}, // Lo [27] HANGUL SYLLABLE TYEG..HANGUL SYLLABLE TYEH + {0xD1A0, 0xD1A0, prLV}, // Lo HANGUL SYLLABLE TO + {0xD1A1, 0xD1BB, prLVT}, // Lo [27] HANGUL SYLLABLE TOG..HANGUL SYLLABLE TOH + {0xD1BC, 0xD1BC, prLV}, // Lo HANGUL SYLLABLE TWA + {0xD1BD, 0xD1D7, prLVT}, // Lo [27] HANGUL SYLLABLE TWAG..HANGUL SYLLABLE TWAH + {0xD1D8, 0xD1D8, prLV}, // Lo HANGUL SYLLABLE TWAE + {0xD1D9, 0xD1F3, prLVT}, // Lo [27] HANGUL SYLLABLE TWAEG..HANGUL SYLLABLE TWAEH + {0xD1F4, 0xD1F4, prLV}, // Lo HANGUL SYLLABLE TOE + {0xD1F5, 0xD20F, prLVT}, // Lo [27] HANGUL SYLLABLE TOEG..HANGUL SYLLABLE TOEH + {0xD210, 0xD210, prLV}, // Lo HANGUL SYLLABLE TYO + {0xD211, 0xD22B, prLVT}, // Lo [27] HANGUL SYLLABLE TYOG..HANGUL SYLLABLE TYOH + {0xD22C, 0xD22C, prLV}, // Lo HANGUL SYLLABLE TU + {0xD22D, 0xD247, prLVT}, // Lo [27] HANGUL SYLLABLE TUG..HANGUL SYLLABLE TUH + {0xD248, 0xD248, prLV}, // Lo HANGUL SYLLABLE TWEO + {0xD249, 0xD263, prLVT}, // Lo [27] HANGUL SYLLABLE TWEOG..HANGUL SYLLABLE TWEOH + {0xD264, 0xD264, prLV}, // Lo HANGUL SYLLABLE TWE + {0xD265, 0xD27F, prLVT}, // Lo [27] HANGUL SYLLABLE TWEG..HANGUL SYLLABLE TWEH + {0xD280, 0xD280, prLV}, // Lo HANGUL SYLLABLE TWI + {0xD281, 0xD29B, prLVT}, // Lo [27] HANGUL SYLLABLE TWIG..HANGUL SYLLABLE TWIH + {0xD29C, 0xD29C, prLV}, // Lo HANGUL SYLLABLE TYU + {0xD29D, 0xD2B7, prLVT}, // Lo [27] HANGUL SYLLABLE TYUG..HANGUL SYLLABLE TYUH + {0xD2B8, 0xD2B8, prLV}, // Lo HANGUL SYLLABLE TEU + {0xD2B9, 0xD2D3, prLVT}, // Lo [27] HANGUL SYLLABLE TEUG..HANGUL SYLLABLE TEUH + {0xD2D4, 0xD2D4, prLV}, // Lo HANGUL SYLLABLE TYI + {0xD2D5, 0xD2EF, prLVT}, // Lo [27] HANGUL SYLLABLE TYIG..HANGUL SYLLABLE TYIH + {0xD2F0, 0xD2F0, prLV}, // Lo HANGUL SYLLABLE TI + {0xD2F1, 0xD30B, prLVT}, // Lo [27] HANGUL SYLLABLE TIG..HANGUL SYLLABLE TIH + {0xD30C, 0xD30C, prLV}, // Lo HANGUL SYLLABLE PA + {0xD30D, 0xD327, prLVT}, // Lo [27] HANGUL SYLLABLE PAG..HANGUL SYLLABLE PAH + {0xD328, 0xD328, prLV}, // Lo HANGUL SYLLABLE PAE + {0xD329, 0xD343, prLVT}, // Lo [27] HANGUL SYLLABLE PAEG..HANGUL SYLLABLE PAEH + {0xD344, 0xD344, prLV}, // Lo HANGUL SYLLABLE PYA + {0xD345, 0xD35F, prLVT}, // Lo [27] HANGUL SYLLABLE PYAG..HANGUL SYLLABLE PYAH + {0xD360, 0xD360, prLV}, // Lo HANGUL SYLLABLE PYAE + {0xD361, 0xD37B, prLVT}, // Lo [27] HANGUL SYLLABLE PYAEG..HANGUL SYLLABLE PYAEH + {0xD37C, 0xD37C, prLV}, // Lo HANGUL SYLLABLE PEO + {0xD37D, 0xD397, prLVT}, // Lo [27] HANGUL SYLLABLE PEOG..HANGUL SYLLABLE PEOH + {0xD398, 0xD398, prLV}, // Lo HANGUL SYLLABLE PE + {0xD399, 0xD3B3, prLVT}, // Lo [27] HANGUL SYLLABLE PEG..HANGUL SYLLABLE PEH + {0xD3B4, 0xD3B4, prLV}, // Lo HANGUL SYLLABLE PYEO + {0xD3B5, 0xD3CF, prLVT}, // Lo [27] HANGUL SYLLABLE PYEOG..HANGUL SYLLABLE PYEOH + {0xD3D0, 0xD3D0, prLV}, // Lo HANGUL SYLLABLE PYE + {0xD3D1, 0xD3EB, prLVT}, // Lo [27] HANGUL SYLLABLE PYEG..HANGUL SYLLABLE PYEH + {0xD3EC, 0xD3EC, prLV}, // Lo HANGUL SYLLABLE PO + {0xD3ED, 0xD407, prLVT}, // Lo [27] HANGUL SYLLABLE POG..HANGUL SYLLABLE POH + {0xD408, 0xD408, prLV}, // Lo HANGUL SYLLABLE PWA + {0xD409, 0xD423, prLVT}, // Lo [27] HANGUL SYLLABLE PWAG..HANGUL SYLLABLE PWAH + {0xD424, 0xD424, prLV}, // Lo HANGUL SYLLABLE PWAE + {0xD425, 0xD43F, prLVT}, // Lo [27] HANGUL SYLLABLE PWAEG..HANGUL SYLLABLE PWAEH + {0xD440, 0xD440, prLV}, // Lo HANGUL SYLLABLE POE + {0xD441, 0xD45B, prLVT}, // Lo [27] HANGUL SYLLABLE POEG..HANGUL SYLLABLE POEH + {0xD45C, 0xD45C, prLV}, // Lo HANGUL SYLLABLE PYO + {0xD45D, 0xD477, prLVT}, // Lo [27] HANGUL SYLLABLE PYOG..HANGUL SYLLABLE PYOH + {0xD478, 0xD478, prLV}, // Lo HANGUL SYLLABLE PU + {0xD479, 0xD493, prLVT}, // Lo [27] HANGUL SYLLABLE PUG..HANGUL SYLLABLE PUH + {0xD494, 0xD494, prLV}, // Lo HANGUL SYLLABLE PWEO + {0xD495, 0xD4AF, prLVT}, // Lo [27] HANGUL SYLLABLE PWEOG..HANGUL SYLLABLE PWEOH + {0xD4B0, 0xD4B0, prLV}, // Lo HANGUL SYLLABLE PWE + {0xD4B1, 0xD4CB, prLVT}, // Lo [27] HANGUL SYLLABLE PWEG..HANGUL SYLLABLE PWEH + {0xD4CC, 0xD4CC, prLV}, // Lo HANGUL SYLLABLE PWI + {0xD4CD, 0xD4E7, prLVT}, // Lo [27] HANGUL SYLLABLE PWIG..HANGUL SYLLABLE PWIH + {0xD4E8, 0xD4E8, prLV}, // Lo HANGUL SYLLABLE PYU + {0xD4E9, 0xD503, prLVT}, // Lo [27] HANGUL SYLLABLE PYUG..HANGUL SYLLABLE PYUH + {0xD504, 0xD504, prLV}, // Lo HANGUL SYLLABLE PEU + {0xD505, 0xD51F, prLVT}, // Lo [27] HANGUL SYLLABLE PEUG..HANGUL SYLLABLE PEUH + {0xD520, 0xD520, prLV}, // Lo HANGUL SYLLABLE PYI + {0xD521, 0xD53B, prLVT}, // Lo [27] HANGUL SYLLABLE PYIG..HANGUL SYLLABLE PYIH + {0xD53C, 0xD53C, prLV}, // Lo HANGUL SYLLABLE PI + {0xD53D, 0xD557, prLVT}, // Lo [27] HANGUL SYLLABLE PIG..HANGUL SYLLABLE PIH + {0xD558, 0xD558, prLV}, // Lo HANGUL SYLLABLE HA + {0xD559, 0xD573, prLVT}, // Lo [27] HANGUL SYLLABLE HAG..HANGUL SYLLABLE HAH + {0xD574, 0xD574, prLV}, // Lo HANGUL SYLLABLE HAE + {0xD575, 0xD58F, prLVT}, // Lo [27] HANGUL SYLLABLE HAEG..HANGUL SYLLABLE HAEH + {0xD590, 0xD590, prLV}, // Lo HANGUL SYLLABLE HYA + {0xD591, 0xD5AB, prLVT}, // Lo [27] HANGUL SYLLABLE HYAG..HANGUL SYLLABLE HYAH + {0xD5AC, 0xD5AC, prLV}, // Lo HANGUL SYLLABLE HYAE + {0xD5AD, 0xD5C7, prLVT}, // Lo [27] HANGUL SYLLABLE HYAEG..HANGUL SYLLABLE HYAEH + {0xD5C8, 0xD5C8, prLV}, // Lo HANGUL SYLLABLE HEO + {0xD5C9, 0xD5E3, prLVT}, // Lo [27] HANGUL SYLLABLE HEOG..HANGUL SYLLABLE HEOH + {0xD5E4, 0xD5E4, prLV}, // Lo HANGUL SYLLABLE HE + {0xD5E5, 0xD5FF, prLVT}, // Lo [27] HANGUL SYLLABLE HEG..HANGUL SYLLABLE HEH + {0xD600, 0xD600, prLV}, // Lo HANGUL SYLLABLE HYEO + {0xD601, 0xD61B, prLVT}, // Lo [27] HANGUL SYLLABLE HYEOG..HANGUL SYLLABLE HYEOH + {0xD61C, 0xD61C, prLV}, // Lo HANGUL SYLLABLE HYE + {0xD61D, 0xD637, prLVT}, // Lo [27] HANGUL SYLLABLE HYEG..HANGUL SYLLABLE HYEH + {0xD638, 0xD638, prLV}, // Lo HANGUL SYLLABLE HO + {0xD639, 0xD653, prLVT}, // Lo [27] HANGUL SYLLABLE HOG..HANGUL SYLLABLE HOH + {0xD654, 0xD654, prLV}, // Lo HANGUL SYLLABLE HWA + {0xD655, 0xD66F, prLVT}, // Lo [27] HANGUL SYLLABLE HWAG..HANGUL SYLLABLE HWAH + {0xD670, 0xD670, prLV}, // Lo HANGUL SYLLABLE HWAE + {0xD671, 0xD68B, prLVT}, // Lo [27] HANGUL SYLLABLE HWAEG..HANGUL SYLLABLE HWAEH + {0xD68C, 0xD68C, prLV}, // Lo HANGUL SYLLABLE HOE + {0xD68D, 0xD6A7, prLVT}, // Lo [27] HANGUL SYLLABLE HOEG..HANGUL SYLLABLE HOEH + {0xD6A8, 0xD6A8, prLV}, // Lo HANGUL SYLLABLE HYO + {0xD6A9, 0xD6C3, prLVT}, // Lo [27] HANGUL SYLLABLE HYOG..HANGUL SYLLABLE HYOH + {0xD6C4, 0xD6C4, prLV}, // Lo HANGUL SYLLABLE HU + {0xD6C5, 0xD6DF, prLVT}, // Lo [27] HANGUL SYLLABLE HUG..HANGUL SYLLABLE HUH + {0xD6E0, 0xD6E0, prLV}, // Lo HANGUL SYLLABLE HWEO + {0xD6E1, 0xD6FB, prLVT}, // Lo [27] HANGUL SYLLABLE HWEOG..HANGUL SYLLABLE HWEOH + {0xD6FC, 0xD6FC, prLV}, // Lo HANGUL SYLLABLE HWE + {0xD6FD, 0xD717, prLVT}, // Lo [27] HANGUL SYLLABLE HWEG..HANGUL SYLLABLE HWEH + {0xD718, 0xD718, prLV}, // Lo HANGUL SYLLABLE HWI + {0xD719, 0xD733, prLVT}, // Lo [27] HANGUL SYLLABLE HWIG..HANGUL SYLLABLE HWIH + {0xD734, 0xD734, prLV}, // Lo HANGUL SYLLABLE HYU + {0xD735, 0xD74F, prLVT}, // Lo [27] HANGUL SYLLABLE HYUG..HANGUL SYLLABLE HYUH + {0xD750, 0xD750, prLV}, // Lo HANGUL SYLLABLE HEU + {0xD751, 0xD76B, prLVT}, // Lo [27] HANGUL SYLLABLE HEUG..HANGUL SYLLABLE HEUH + {0xD76C, 0xD76C, prLV}, // Lo HANGUL SYLLABLE HYI + {0xD76D, 0xD787, prLVT}, // Lo [27] HANGUL SYLLABLE HYIG..HANGUL SYLLABLE HYIH + {0xD788, 0xD788, prLV}, // Lo HANGUL SYLLABLE HI + {0xD789, 0xD7A3, prLVT}, // Lo [27] HANGUL SYLLABLE HIG..HANGUL SYLLABLE HIH + {0xD7B0, 0xD7C6, prV}, // Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E + {0xD7CB, 0xD7FB, prT}, // Lo [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH + {0xFB1E, 0xFB1E, prExtend}, // Mn HEBREW POINT JUDEO-SPANISH VARIKA + {0xFE00, 0xFE0F, prExtend}, // Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16 + {0xFE20, 0xFE2F, prExtend}, // Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF + {0xFEFF, 0xFEFF, prControl}, // Cf ZERO WIDTH NO-BREAK SPACE + {0xFF9E, 0xFF9F, prExtend}, // Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK + {0xFFF0, 0xFFF8, prControl}, // Cn [9] .. + {0xFFF9, 0xFFFB, prControl}, // Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR + {0x101FD, 0x101FD, prExtend}, // Mn PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE + {0x102E0, 0x102E0, prExtend}, // Mn COPTIC EPACT THOUSANDS MARK + {0x10376, 0x1037A, prExtend}, // Mn [5] COMBINING OLD PERMIC LETTER AN..COMBINING OLD PERMIC LETTER SII + {0x10A01, 0x10A03, prExtend}, // Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R + {0x10A05, 0x10A06, prExtend}, // Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O + {0x10A0C, 0x10A0F, prExtend}, // Mn [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA + {0x10A38, 0x10A3A, prExtend}, // Mn [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW + {0x10A3F, 0x10A3F, prExtend}, // Mn KHAROSHTHI VIRAMA + {0x10AE5, 0x10AE6, prExtend}, // Mn [2] MANICHAEAN ABBREVIATION MARK ABOVE..MANICHAEAN ABBREVIATION MARK BELOW + {0x10D24, 0x10D27, prExtend}, // Mn [4] HANIFI ROHINGYA SIGN HARBAHAY..HANIFI ROHINGYA SIGN TASSI + {0x10F46, 0x10F50, prExtend}, // Mn [11] SOGDIAN COMBINING DOT BELOW..SOGDIAN COMBINING STROKE BELOW + {0x11000, 0x11000, prSpacingMark}, // Mc BRAHMI SIGN CANDRABINDU + {0x11001, 0x11001, prExtend}, // Mn BRAHMI SIGN ANUSVARA + {0x11002, 0x11002, prSpacingMark}, // Mc BRAHMI SIGN VISARGA + {0x11038, 0x11046, prExtend}, // Mn [15] BRAHMI VOWEL SIGN AA..BRAHMI VIRAMA + {0x1107F, 0x11081, prExtend}, // Mn [3] BRAHMI NUMBER JOINER..KAITHI SIGN ANUSVARA + {0x11082, 0x11082, prSpacingMark}, // Mc KAITHI SIGN VISARGA + {0x110B0, 0x110B2, prSpacingMark}, // Mc [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II + {0x110B3, 0x110B6, prExtend}, // Mn [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI + {0x110B7, 0x110B8, prSpacingMark}, // Mc [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU + {0x110B9, 0x110BA, prExtend}, // Mn [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA + {0x110BD, 0x110BD, prPreprend}, // Cf KAITHI NUMBER SIGN + {0x110CD, 0x110CD, prPreprend}, // Cf KAITHI NUMBER SIGN ABOVE + {0x11100, 0x11102, prExtend}, // Mn [3] CHAKMA SIGN CANDRABINDU..CHAKMA SIGN VISARGA + {0x11127, 0x1112B, prExtend}, // Mn [5] CHAKMA VOWEL SIGN A..CHAKMA VOWEL SIGN UU + {0x1112C, 0x1112C, prSpacingMark}, // Mc CHAKMA VOWEL SIGN E + {0x1112D, 0x11134, prExtend}, // Mn [8] CHAKMA VOWEL SIGN AI..CHAKMA MAAYYAA + {0x11145, 0x11146, prSpacingMark}, // Mc [2] CHAKMA VOWEL SIGN AA..CHAKMA VOWEL SIGN EI + {0x11173, 0x11173, prExtend}, // Mn MAHAJANI SIGN NUKTA + {0x11180, 0x11181, prExtend}, // Mn [2] SHARADA SIGN CANDRABINDU..SHARADA SIGN ANUSVARA + {0x11182, 0x11182, prSpacingMark}, // Mc SHARADA SIGN VISARGA + {0x111B3, 0x111B5, prSpacingMark}, // Mc [3] SHARADA VOWEL SIGN AA..SHARADA VOWEL SIGN II + {0x111B6, 0x111BE, prExtend}, // Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O + {0x111BF, 0x111C0, prSpacingMark}, // Mc [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA + {0x111C2, 0x111C3, prPreprend}, // Lo [2] SHARADA SIGN JIHVAMULIYA..SHARADA SIGN UPADHMANIYA + {0x111C9, 0x111CC, prExtend}, // Mn [4] SHARADA SANDHI MARK..SHARADA EXTRA SHORT VOWEL MARK + {0x1122C, 0x1122E, prSpacingMark}, // Mc [3] KHOJKI VOWEL SIGN AA..KHOJKI VOWEL SIGN II + {0x1122F, 0x11231, prExtend}, // Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI + {0x11232, 0x11233, prSpacingMark}, // Mc [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU + {0x11234, 0x11234, prExtend}, // Mn KHOJKI SIGN ANUSVARA + {0x11235, 0x11235, prSpacingMark}, // Mc KHOJKI SIGN VIRAMA + {0x11236, 0x11237, prExtend}, // Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA + {0x1123E, 0x1123E, prExtend}, // Mn KHOJKI SIGN SUKUN + {0x112DF, 0x112DF, prExtend}, // Mn KHUDAWADI SIGN ANUSVARA + {0x112E0, 0x112E2, prSpacingMark}, // Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II + {0x112E3, 0x112EA, prExtend}, // Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA + {0x11300, 0x11301, prExtend}, // Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU + {0x11302, 0x11303, prSpacingMark}, // Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA + {0x1133B, 0x1133C, prExtend}, // Mn [2] COMBINING BINDU BELOW..GRANTHA SIGN NUKTA + {0x1133E, 0x1133E, prExtend}, // Mc GRANTHA VOWEL SIGN AA + {0x1133F, 0x1133F, prSpacingMark}, // Mc GRANTHA VOWEL SIGN I + {0x11340, 0x11340, prExtend}, // Mn GRANTHA VOWEL SIGN II + {0x11341, 0x11344, prSpacingMark}, // Mc [4] GRANTHA VOWEL SIGN U..GRANTHA VOWEL SIGN VOCALIC RR + {0x11347, 0x11348, prSpacingMark}, // Mc [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI + {0x1134B, 0x1134D, prSpacingMark}, // Mc [3] GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA + {0x11357, 0x11357, prExtend}, // Mc GRANTHA AU LENGTH MARK + {0x11362, 0x11363, prSpacingMark}, // Mc [2] GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL + {0x11366, 0x1136C, prExtend}, // Mn [7] COMBINING GRANTHA DIGIT ZERO..COMBINING GRANTHA DIGIT SIX + {0x11370, 0x11374, prExtend}, // Mn [5] COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER PA + {0x11435, 0x11437, prSpacingMark}, // Mc [3] NEWA VOWEL SIGN AA..NEWA VOWEL SIGN II + {0x11438, 0x1143F, prExtend}, // Mn [8] NEWA VOWEL SIGN U..NEWA VOWEL SIGN AI + {0x11440, 0x11441, prSpacingMark}, // Mc [2] NEWA VOWEL SIGN O..NEWA VOWEL SIGN AU + {0x11442, 0x11444, prExtend}, // Mn [3] NEWA SIGN VIRAMA..NEWA SIGN ANUSVARA + {0x11445, 0x11445, prSpacingMark}, // Mc NEWA SIGN VISARGA + {0x11446, 0x11446, prExtend}, // Mn NEWA SIGN NUKTA + {0x1145E, 0x1145E, prExtend}, // Mn NEWA SANDHI MARK + {0x114B0, 0x114B0, prExtend}, // Mc TIRHUTA VOWEL SIGN AA + {0x114B1, 0x114B2, prSpacingMark}, // Mc [2] TIRHUTA VOWEL SIGN I..TIRHUTA VOWEL SIGN II + {0x114B3, 0x114B8, prExtend}, // Mn [6] TIRHUTA VOWEL SIGN U..TIRHUTA VOWEL SIGN VOCALIC LL + {0x114B9, 0x114B9, prSpacingMark}, // Mc TIRHUTA VOWEL SIGN E + {0x114BA, 0x114BA, prExtend}, // Mn TIRHUTA VOWEL SIGN SHORT E + {0x114BB, 0x114BC, prSpacingMark}, // Mc [2] TIRHUTA VOWEL SIGN AI..TIRHUTA VOWEL SIGN O + {0x114BD, 0x114BD, prExtend}, // Mc TIRHUTA VOWEL SIGN SHORT O + {0x114BE, 0x114BE, prSpacingMark}, // Mc TIRHUTA VOWEL SIGN AU + {0x114BF, 0x114C0, prExtend}, // Mn [2] TIRHUTA SIGN CANDRABINDU..TIRHUTA SIGN ANUSVARA + {0x114C1, 0x114C1, prSpacingMark}, // Mc TIRHUTA SIGN VISARGA + {0x114C2, 0x114C3, prExtend}, // Mn [2] TIRHUTA SIGN VIRAMA..TIRHUTA SIGN NUKTA + {0x115AF, 0x115AF, prExtend}, // Mc SIDDHAM VOWEL SIGN AA + {0x115B0, 0x115B1, prSpacingMark}, // Mc [2] SIDDHAM VOWEL SIGN I..SIDDHAM VOWEL SIGN II + {0x115B2, 0x115B5, prExtend}, // Mn [4] SIDDHAM VOWEL SIGN U..SIDDHAM VOWEL SIGN VOCALIC RR + {0x115B8, 0x115BB, prSpacingMark}, // Mc [4] SIDDHAM VOWEL SIGN E..SIDDHAM VOWEL SIGN AU + {0x115BC, 0x115BD, prExtend}, // Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA + {0x115BE, 0x115BE, prSpacingMark}, // Mc SIDDHAM SIGN VISARGA + {0x115BF, 0x115C0, prExtend}, // Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA + {0x115DC, 0x115DD, prExtend}, // Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU + {0x11630, 0x11632, prSpacingMark}, // Mc [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II + {0x11633, 0x1163A, prExtend}, // Mn [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI + {0x1163B, 0x1163C, prSpacingMark}, // Mc [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU + {0x1163D, 0x1163D, prExtend}, // Mn MODI SIGN ANUSVARA + {0x1163E, 0x1163E, prSpacingMark}, // Mc MODI SIGN VISARGA + {0x1163F, 0x11640, prExtend}, // Mn [2] MODI SIGN VIRAMA..MODI SIGN ARDHACANDRA + {0x116AB, 0x116AB, prExtend}, // Mn TAKRI SIGN ANUSVARA + {0x116AC, 0x116AC, prSpacingMark}, // Mc TAKRI SIGN VISARGA + {0x116AD, 0x116AD, prExtend}, // Mn TAKRI VOWEL SIGN AA + {0x116AE, 0x116AF, prSpacingMark}, // Mc [2] TAKRI VOWEL SIGN I..TAKRI VOWEL SIGN II + {0x116B0, 0x116B5, prExtend}, // Mn [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU + {0x116B6, 0x116B6, prSpacingMark}, // Mc TAKRI SIGN VIRAMA + {0x116B7, 0x116B7, prExtend}, // Mn TAKRI SIGN NUKTA + {0x1171D, 0x1171F, prExtend}, // Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA + {0x11720, 0x11721, prSpacingMark}, // Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA + {0x11722, 0x11725, prExtend}, // Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU + {0x11726, 0x11726, prSpacingMark}, // Mc AHOM VOWEL SIGN E + {0x11727, 0x1172B, prExtend}, // Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER + {0x1182C, 0x1182E, prSpacingMark}, // Mc [3] DOGRA VOWEL SIGN AA..DOGRA VOWEL SIGN II + {0x1182F, 0x11837, prExtend}, // Mn [9] DOGRA VOWEL SIGN U..DOGRA SIGN ANUSVARA + {0x11838, 0x11838, prSpacingMark}, // Mc DOGRA SIGN VISARGA + {0x11839, 0x1183A, prExtend}, // Mn [2] DOGRA SIGN VIRAMA..DOGRA SIGN NUKTA + {0x119D1, 0x119D3, prSpacingMark}, // Mc [3] NANDINAGARI VOWEL SIGN AA..NANDINAGARI VOWEL SIGN II + {0x119D4, 0x119D7, prExtend}, // Mn [4] NANDINAGARI VOWEL SIGN U..NANDINAGARI VOWEL SIGN VOCALIC RR + {0x119DA, 0x119DB, prExtend}, // Mn [2] NANDINAGARI VOWEL SIGN E..NANDINAGARI VOWEL SIGN AI + {0x119DC, 0x119DF, prSpacingMark}, // Mc [4] NANDINAGARI VOWEL SIGN O..NANDINAGARI SIGN VISARGA + {0x119E0, 0x119E0, prExtend}, // Mn NANDINAGARI SIGN VIRAMA + {0x119E4, 0x119E4, prSpacingMark}, // Mc NANDINAGARI VOWEL SIGN PRISHTHAMATRA E + {0x11A01, 0x11A0A, prExtend}, // Mn [10] ZANABAZAR SQUARE VOWEL SIGN I..ZANABAZAR SQUARE VOWEL LENGTH MARK + {0x11A33, 0x11A38, prExtend}, // Mn [6] ZANABAZAR SQUARE FINAL CONSONANT MARK..ZANABAZAR SQUARE SIGN ANUSVARA + {0x11A39, 0x11A39, prSpacingMark}, // Mc ZANABAZAR SQUARE SIGN VISARGA + {0x11A3A, 0x11A3A, prPreprend}, // Lo ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA + {0x11A3B, 0x11A3E, prExtend}, // Mn [4] ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA..ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA + {0x11A47, 0x11A47, prExtend}, // Mn ZANABAZAR SQUARE SUBJOINER + {0x11A51, 0x11A56, prExtend}, // Mn [6] SOYOMBO VOWEL SIGN I..SOYOMBO VOWEL SIGN OE + {0x11A57, 0x11A58, prSpacingMark}, // Mc [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU + {0x11A59, 0x11A5B, prExtend}, // Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK + {0x11A84, 0x11A89, prPreprend}, // Lo [6] SOYOMBO SIGN JIHVAMULIYA..SOYOMBO CLUSTER-INITIAL LETTER SA + {0x11A8A, 0x11A96, prExtend}, // Mn [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA + {0x11A97, 0x11A97, prSpacingMark}, // Mc SOYOMBO SIGN VISARGA + {0x11A98, 0x11A99, prExtend}, // Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER + {0x11C2F, 0x11C2F, prSpacingMark}, // Mc BHAIKSUKI VOWEL SIGN AA + {0x11C30, 0x11C36, prExtend}, // Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L + {0x11C38, 0x11C3D, prExtend}, // Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA + {0x11C3E, 0x11C3E, prSpacingMark}, // Mc BHAIKSUKI SIGN VISARGA + {0x11C3F, 0x11C3F, prExtend}, // Mn BHAIKSUKI SIGN VIRAMA + {0x11C92, 0x11CA7, prExtend}, // Mn [22] MARCHEN SUBJOINED LETTER KA..MARCHEN SUBJOINED LETTER ZA + {0x11CA9, 0x11CA9, prSpacingMark}, // Mc MARCHEN SUBJOINED LETTER YA + {0x11CAA, 0x11CB0, prExtend}, // Mn [7] MARCHEN SUBJOINED LETTER RA..MARCHEN VOWEL SIGN AA + {0x11CB1, 0x11CB1, prSpacingMark}, // Mc MARCHEN VOWEL SIGN I + {0x11CB2, 0x11CB3, prExtend}, // Mn [2] MARCHEN VOWEL SIGN U..MARCHEN VOWEL SIGN E + {0x11CB4, 0x11CB4, prSpacingMark}, // Mc MARCHEN VOWEL SIGN O + {0x11CB5, 0x11CB6, prExtend}, // Mn [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU + {0x11D31, 0x11D36, prExtend}, // Mn [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI VOWEL SIGN VOCALIC R + {0x11D3A, 0x11D3A, prExtend}, // Mn MASARAM GONDI VOWEL SIGN E + {0x11D3C, 0x11D3D, prExtend}, // Mn [2] MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O + {0x11D3F, 0x11D45, prExtend}, // Mn [7] MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI VIRAMA + {0x11D46, 0x11D46, prPreprend}, // Lo MASARAM GONDI REPHA + {0x11D47, 0x11D47, prExtend}, // Mn MASARAM GONDI RA-KARA + {0x11D8A, 0x11D8E, prSpacingMark}, // Mc [5] GUNJALA GONDI VOWEL SIGN AA..GUNJALA GONDI VOWEL SIGN UU + {0x11D90, 0x11D91, prExtend}, // Mn [2] GUNJALA GONDI VOWEL SIGN EE..GUNJALA GONDI VOWEL SIGN AI + {0x11D93, 0x11D94, prSpacingMark}, // Mc [2] GUNJALA GONDI VOWEL SIGN OO..GUNJALA GONDI VOWEL SIGN AU + {0x11D95, 0x11D95, prExtend}, // Mn GUNJALA GONDI SIGN ANUSVARA + {0x11D96, 0x11D96, prSpacingMark}, // Mc GUNJALA GONDI SIGN VISARGA + {0x11D97, 0x11D97, prExtend}, // Mn GUNJALA GONDI VIRAMA + {0x11EF3, 0x11EF4, prExtend}, // Mn [2] MAKASAR VOWEL SIGN I..MAKASAR VOWEL SIGN U + {0x11EF5, 0x11EF6, prSpacingMark}, // Mc [2] MAKASAR VOWEL SIGN E..MAKASAR VOWEL SIGN O + {0x13430, 0x13438, prControl}, // Cf [9] EGYPTIAN HIEROGLYPH VERTICAL JOINER..EGYPTIAN HIEROGLYPH END SEGMENT + {0x16AF0, 0x16AF4, prExtend}, // Mn [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE + {0x16B30, 0x16B36, prExtend}, // Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM + {0x16F4F, 0x16F4F, prExtend}, // Mn MIAO SIGN CONSONANT MODIFIER BAR + {0x16F51, 0x16F87, prSpacingMark}, // Mc [55] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN UI + {0x16F8F, 0x16F92, prExtend}, // Mn [4] MIAO TONE RIGHT..MIAO TONE BELOW + {0x1BC9D, 0x1BC9E, prExtend}, // Mn [2] DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK + {0x1BCA0, 0x1BCA3, prControl}, // Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP + {0x1D165, 0x1D165, prExtend}, // Mc MUSICAL SYMBOL COMBINING STEM + {0x1D166, 0x1D166, prSpacingMark}, // Mc MUSICAL SYMBOL COMBINING SPRECHGESANG STEM + {0x1D167, 0x1D169, prExtend}, // Mn [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3 + {0x1D16D, 0x1D16D, prSpacingMark}, // Mc MUSICAL SYMBOL COMBINING AUGMENTATION DOT + {0x1D16E, 0x1D172, prExtend}, // Mc [5] MUSICAL SYMBOL COMBINING FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5 + {0x1D173, 0x1D17A, prControl}, // Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE + {0x1D17B, 0x1D182, prExtend}, // Mn [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE + {0x1D185, 0x1D18B, prExtend}, // Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE + {0x1D1AA, 0x1D1AD, prExtend}, // Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO + {0x1D242, 0x1D244, prExtend}, // Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME + {0x1DA00, 0x1DA36, prExtend}, // Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN + {0x1DA3B, 0x1DA6C, prExtend}, // Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT + {0x1DA75, 0x1DA75, prExtend}, // Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS + {0x1DA84, 0x1DA84, prExtend}, // Mn SIGNWRITING LOCATION HEAD NECK + {0x1DA9B, 0x1DA9F, prExtend}, // Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6 + {0x1DAA1, 0x1DAAF, prExtend}, // Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16 + {0x1E000, 0x1E006, prExtend}, // Mn [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE + {0x1E008, 0x1E018, prExtend}, // Mn [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU + {0x1E01B, 0x1E021, prExtend}, // Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI + {0x1E023, 0x1E024, prExtend}, // Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS + {0x1E026, 0x1E02A, prExtend}, // Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA + {0x1E130, 0x1E136, prExtend}, // Mn [7] NYIAKENG PUACHUE HMONG TONE-B..NYIAKENG PUACHUE HMONG TONE-D + {0x1E2EC, 0x1E2EF, prExtend}, // Mn [4] WANCHO TONE TUP..WANCHO TONE KOINI + {0x1E8D0, 0x1E8D6, prExtend}, // Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS + {0x1E944, 0x1E94A, prExtend}, // Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA + {0x1F000, 0x1F02B, prExtendedPictographic}, // 5.1 [44] (🀀..🀫) MAHJONG TILE EAST WIND..MAHJONG TILE BACK + {0x1F02C, 0x1F02F, prExtendedPictographic}, // NA [4] (🀬..🀯) .. + {0x1F030, 0x1F093, prExtendedPictographic}, // 5.1[100] (🀰..🂓) DOMINO TILE HORIZONTAL BACK..DOMINO TILE VERTICAL-06-06 + {0x1F094, 0x1F09F, prExtendedPictographic}, // NA [12] (🂔..🂟) .. + {0x1F0A0, 0x1F0AE, prExtendedPictographic}, // 6.0 [15] (🂠..🂮) PLAYING CARD BACK..PLAYING CARD KING OF SPADES + {0x1F0AF, 0x1F0B0, prExtendedPictographic}, // NA [2] (🂯..🂰) .. + {0x1F0B1, 0x1F0BE, prExtendedPictographic}, // 6.0 [14] (🂱..🂾) PLAYING CARD ACE OF HEARTS..PLAYING CARD KING OF HEARTS + {0x1F0BF, 0x1F0BF, prExtendedPictographic}, // 7.0 [1] (🂿) PLAYING CARD RED JOKER + {0x1F0C0, 0x1F0C0, prExtendedPictographic}, // NA [1] (🃀) + {0x1F0C1, 0x1F0CF, prExtendedPictographic}, // 6.0 [15] (🃁..🃏) PLAYING CARD ACE OF DIAMONDS..joker + {0x1F0D0, 0x1F0D0, prExtendedPictographic}, // NA [1] (🃐) + {0x1F0D1, 0x1F0DF, prExtendedPictographic}, // 6.0 [15] (🃑..🃟) PLAYING CARD ACE OF CLUBS..PLAYING CARD WHITE JOKER + {0x1F0E0, 0x1F0F5, prExtendedPictographic}, // 7.0 [22] (🃠..🃵) PLAYING CARD FOOL..PLAYING CARD TRUMP-21 + {0x1F0F6, 0x1F0FF, prExtendedPictographic}, // NA [10] (🃶..🃿) .. + {0x1F10D, 0x1F10F, prExtendedPictographic}, // NA [3] (🄍..🄏) .. + {0x1F12F, 0x1F12F, prExtendedPictographic}, // 11.0 [1] (🄯) COPYLEFT SYMBOL + {0x1F16C, 0x1F16C, prExtendedPictographic}, // 12.0 [1] (🅬) RAISED MR SIGN + {0x1F16D, 0x1F16F, prExtendedPictographic}, // NA [3] (🅭..🅯) .. + {0x1F170, 0x1F171, prExtendedPictographic}, // 6.0 [2] (🅰️..🅱️) A button (blood type)..B button (blood type) + {0x1F17E, 0x1F17E, prExtendedPictographic}, // 6.0 [1] (🅾️) O button (blood type) + {0x1F17F, 0x1F17F, prExtendedPictographic}, // 5.2 [1] (🅿️) P button + {0x1F18E, 0x1F18E, prExtendedPictographic}, // 6.0 [1] (🆎) AB button (blood type) + {0x1F191, 0x1F19A, prExtendedPictographic}, // 6.0 [10] (🆑..🆚) CL button..VS button + {0x1F1AD, 0x1F1E5, prExtendedPictographic}, // NA [57] (🆭..🇥) .. + {0x1F1E6, 0x1F1FF, prRegionalIndicator}, // So [26] REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z + {0x1F201, 0x1F202, prExtendedPictographic}, // 6.0 [2] (🈁..🈂️) Japanese “here” button..Japanese “service charge” button + {0x1F203, 0x1F20F, prExtendedPictographic}, // NA [13] (🈃..🈏) .. + {0x1F21A, 0x1F21A, prExtendedPictographic}, // 5.2 [1] (🈚) Japanese “free of charge” button + {0x1F22F, 0x1F22F, prExtendedPictographic}, // 5.2 [1] (🈯) Japanese “reserved” button + {0x1F232, 0x1F23A, prExtendedPictographic}, // 6.0 [9] (🈲..🈺) Japanese “prohibited” button..Japanese “open for business” button + {0x1F23C, 0x1F23F, prExtendedPictographic}, // NA [4] (🈼..🈿) .. + {0x1F249, 0x1F24F, prExtendedPictographic}, // NA [7] (🉉..🉏) .. + {0x1F250, 0x1F251, prExtendedPictographic}, // 6.0 [2] (🉐..🉑) Japanese “bargain” button..Japanese “acceptable” button + {0x1F252, 0x1F25F, prExtendedPictographic}, // NA [14] (🉒..🉟) .. + {0x1F260, 0x1F265, prExtendedPictographic}, // 10.0 [6] (🉠..🉥) ROUNDED SYMBOL FOR FU..ROUNDED SYMBOL FOR CAI + {0x1F266, 0x1F2FF, prExtendedPictographic}, // NA[154] (🉦..🋿) .. + {0x1F300, 0x1F320, prExtendedPictographic}, // 6.0 [33] (🌀..🌠) cyclone..shooting star + {0x1F321, 0x1F32C, prExtendedPictographic}, // 7.0 [12] (🌡️..🌬️) thermometer..wind face + {0x1F32D, 0x1F32F, prExtendedPictographic}, // 8.0 [3] (🌭..🌯) hot dog..burrito + {0x1F330, 0x1F335, prExtendedPictographic}, // 6.0 [6] (🌰..🌵) chestnut..cactus + {0x1F336, 0x1F336, prExtendedPictographic}, // 7.0 [1] (🌶️) hot pepper + {0x1F337, 0x1F37C, prExtendedPictographic}, // 6.0 [70] (🌷..🍼) tulip..baby bottle + {0x1F37D, 0x1F37D, prExtendedPictographic}, // 7.0 [1] (🍽️) fork and knife with plate + {0x1F37E, 0x1F37F, prExtendedPictographic}, // 8.0 [2] (🍾..🍿) bottle with popping cork..popcorn + {0x1F380, 0x1F393, prExtendedPictographic}, // 6.0 [20] (🎀..🎓) ribbon..graduation cap + {0x1F394, 0x1F39F, prExtendedPictographic}, // 7.0 [12] (🎔..🎟️) HEART WITH TIP ON THE LEFT..admission tickets + {0x1F3A0, 0x1F3C4, prExtendedPictographic}, // 6.0 [37] (🎠..🏄) carousel horse..person surfing + {0x1F3C5, 0x1F3C5, prExtendedPictographic}, // 7.0 [1] (🏅) sports medal + {0x1F3C6, 0x1F3CA, prExtendedPictographic}, // 6.0 [5] (🏆..🏊) trophy..person swimming + {0x1F3CB, 0x1F3CE, prExtendedPictographic}, // 7.0 [4] (🏋️..🏎️) person lifting weights..racing car + {0x1F3CF, 0x1F3D3, prExtendedPictographic}, // 8.0 [5] (🏏..🏓) cricket game..ping pong + {0x1F3D4, 0x1F3DF, prExtendedPictographic}, // 7.0 [12] (🏔️..🏟️) snow-capped mountain..stadium + {0x1F3E0, 0x1F3F0, prExtendedPictographic}, // 6.0 [17] (🏠..🏰) house..castle + {0x1F3F1, 0x1F3F7, prExtendedPictographic}, // 7.0 [7] (🏱..🏷️) WHITE PENNANT..label + {0x1F3F8, 0x1F3FA, prExtendedPictographic}, // 8.0 [3] (🏸..🏺) badminton..amphora + {0x1F3FB, 0x1F3FF, prExtend}, // Sk [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6 + {0x1F400, 0x1F43E, prExtendedPictographic}, // 6.0 [63] (🐀..🐾) rat..paw prints + {0x1F43F, 0x1F43F, prExtendedPictographic}, // 7.0 [1] (🐿️) chipmunk + {0x1F440, 0x1F440, prExtendedPictographic}, // 6.0 [1] (👀) eyes + {0x1F441, 0x1F441, prExtendedPictographic}, // 7.0 [1] (👁️) eye + {0x1F442, 0x1F4F7, prExtendedPictographic}, // 6.0[182] (👂..📷) ear..camera + {0x1F4F8, 0x1F4F8, prExtendedPictographic}, // 7.0 [1] (📸) camera with flash + {0x1F4F9, 0x1F4FC, prExtendedPictographic}, // 6.0 [4] (📹..📼) video camera..videocassette + {0x1F4FD, 0x1F4FE, prExtendedPictographic}, // 7.0 [2] (📽️..📾) film projector..PORTABLE STEREO + {0x1F4FF, 0x1F4FF, prExtendedPictographic}, // 8.0 [1] (📿) prayer beads + {0x1F500, 0x1F53D, prExtendedPictographic}, // 6.0 [62] (🔀..🔽) shuffle tracks button..downwards button + {0x1F546, 0x1F54A, prExtendedPictographic}, // 7.0 [5] (🕆..🕊️) WHITE LATIN CROSS..dove + {0x1F54B, 0x1F54F, prExtendedPictographic}, // 8.0 [5] (🕋..🕏) kaaba..BOWL OF HYGIEIA + {0x1F550, 0x1F567, prExtendedPictographic}, // 6.0 [24] (🕐..🕧) one o’clock..twelve-thirty + {0x1F568, 0x1F579, prExtendedPictographic}, // 7.0 [18] (🕨..🕹️) RIGHT SPEAKER..joystick + {0x1F57A, 0x1F57A, prExtendedPictographic}, // 9.0 [1] (🕺) man dancing + {0x1F57B, 0x1F5A3, prExtendedPictographic}, // 7.0 [41] (🕻..🖣) LEFT HAND TELEPHONE RECEIVER..BLACK DOWN POINTING BACKHAND INDEX + {0x1F5A4, 0x1F5A4, prExtendedPictographic}, // 9.0 [1] (🖤) black heart + {0x1F5A5, 0x1F5FA, prExtendedPictographic}, // 7.0 [86] (🖥️..🗺️) desktop computer..world map + {0x1F5FB, 0x1F5FF, prExtendedPictographic}, // 6.0 [5] (🗻..🗿) mount fuji..moai + {0x1F600, 0x1F600, prExtendedPictographic}, // 6.1 [1] (😀) grinning face + {0x1F601, 0x1F610, prExtendedPictographic}, // 6.0 [16] (😁..😐) beaming face with smiling eyes..neutral face + {0x1F611, 0x1F611, prExtendedPictographic}, // 6.1 [1] (😑) expressionless face + {0x1F612, 0x1F614, prExtendedPictographic}, // 6.0 [3] (😒..😔) unamused face..pensive face + {0x1F615, 0x1F615, prExtendedPictographic}, // 6.1 [1] (😕) confused face + {0x1F616, 0x1F616, prExtendedPictographic}, // 6.0 [1] (😖) confounded face + {0x1F617, 0x1F617, prExtendedPictographic}, // 6.1 [1] (😗) kissing face + {0x1F618, 0x1F618, prExtendedPictographic}, // 6.0 [1] (😘) face blowing a kiss + {0x1F619, 0x1F619, prExtendedPictographic}, // 6.1 [1] (😙) kissing face with smiling eyes + {0x1F61A, 0x1F61A, prExtendedPictographic}, // 6.0 [1] (😚) kissing face with closed eyes + {0x1F61B, 0x1F61B, prExtendedPictographic}, // 6.1 [1] (😛) face with tongue + {0x1F61C, 0x1F61E, prExtendedPictographic}, // 6.0 [3] (😜..😞) winking face with tongue..disappointed face + {0x1F61F, 0x1F61F, prExtendedPictographic}, // 6.1 [1] (😟) worried face + {0x1F620, 0x1F625, prExtendedPictographic}, // 6.0 [6] (😠..😥) angry face..sad but relieved face + {0x1F626, 0x1F627, prExtendedPictographic}, // 6.1 [2] (😦..😧) frowning face with open mouth..anguished face + {0x1F628, 0x1F62B, prExtendedPictographic}, // 6.0 [4] (😨..😫) fearful face..tired face + {0x1F62C, 0x1F62C, prExtendedPictographic}, // 6.1 [1] (😬) grimacing face + {0x1F62D, 0x1F62D, prExtendedPictographic}, // 6.0 [1] (😭) loudly crying face + {0x1F62E, 0x1F62F, prExtendedPictographic}, // 6.1 [2] (😮..😯) face with open mouth..hushed face + {0x1F630, 0x1F633, prExtendedPictographic}, // 6.0 [4] (😰..😳) anxious face with sweat..flushed face + {0x1F634, 0x1F634, prExtendedPictographic}, // 6.1 [1] (😴) sleeping face + {0x1F635, 0x1F640, prExtendedPictographic}, // 6.0 [12] (😵..🙀) dizzy face..weary cat + {0x1F641, 0x1F642, prExtendedPictographic}, // 7.0 [2] (🙁..🙂) slightly frowning face..slightly smiling face + {0x1F643, 0x1F644, prExtendedPictographic}, // 8.0 [2] (🙃..🙄) upside-down face..face with rolling eyes + {0x1F645, 0x1F64F, prExtendedPictographic}, // 6.0 [11] (🙅..🙏) person gesturing NO..folded hands + {0x1F680, 0x1F6C5, prExtendedPictographic}, // 6.0 [70] (🚀..🛅) rocket..left luggage + {0x1F6C6, 0x1F6CF, prExtendedPictographic}, // 7.0 [10] (🛆..🛏️) TRIANGLE WITH ROUNDED CORNERS..bed + {0x1F6D0, 0x1F6D0, prExtendedPictographic}, // 8.0 [1] (🛐) place of worship + {0x1F6D1, 0x1F6D2, prExtendedPictographic}, // 9.0 [2] (🛑..🛒) stop sign..shopping cart + {0x1F6D3, 0x1F6D4, prExtendedPictographic}, // 10.0 [2] (🛓..🛔) STUPA..PAGODA + {0x1F6D5, 0x1F6D5, prExtendedPictographic}, // 12.0 [1] (🛕) hindu temple + {0x1F6D6, 0x1F6DF, prExtendedPictographic}, // NA [10] (🛖..🛟) .. + {0x1F6E0, 0x1F6EC, prExtendedPictographic}, // 7.0 [13] (🛠️..🛬) hammer and wrench..airplane arrival + {0x1F6ED, 0x1F6EF, prExtendedPictographic}, // NA [3] (🛭..🛯) .. + {0x1F6F0, 0x1F6F3, prExtendedPictographic}, // 7.0 [4] (🛰️..🛳️) satellite..passenger ship + {0x1F6F4, 0x1F6F6, prExtendedPictographic}, // 9.0 [3] (🛴..🛶) kick scooter..canoe + {0x1F6F7, 0x1F6F8, prExtendedPictographic}, // 10.0 [2] (🛷..🛸) sled..flying saucer + {0x1F6F9, 0x1F6F9, prExtendedPictographic}, // 11.0 [1] (🛹) skateboard + {0x1F6FA, 0x1F6FA, prExtendedPictographic}, // 12.0 [1] (🛺) auto rickshaw + {0x1F6FB, 0x1F6FF, prExtendedPictographic}, // NA [5] (🛻..🛿) .. + {0x1F774, 0x1F77F, prExtendedPictographic}, // NA [12] (🝴..🝿) .. + {0x1F7D5, 0x1F7D8, prExtendedPictographic}, // 11.0 [4] (🟕..🟘) CIRCLED TRIANGLE..NEGATIVE CIRCLED SQUARE + {0x1F7D9, 0x1F7DF, prExtendedPictographic}, // NA [7] (🟙..🟟) .. + {0x1F7E0, 0x1F7EB, prExtendedPictographic}, // 12.0 [12] (🟠..🟫) orange circle..brown square + {0x1F7EC, 0x1F7FF, prExtendedPictographic}, // NA [20] (🟬..🟿) .. + {0x1F80C, 0x1F80F, prExtendedPictographic}, // NA [4] (🠌..🠏) .. + {0x1F848, 0x1F84F, prExtendedPictographic}, // NA [8] (🡈..🡏) .. + {0x1F85A, 0x1F85F, prExtendedPictographic}, // NA [6] (🡚..🡟) .. + {0x1F888, 0x1F88F, prExtendedPictographic}, // NA [8] (🢈..🢏) .. + {0x1F8AE, 0x1F8FF, prExtendedPictographic}, // NA [82] (🢮..🣿) .. + {0x1F90C, 0x1F90C, prExtendedPictographic}, // NA [1] (🤌) + {0x1F90D, 0x1F90F, prExtendedPictographic}, // 12.0 [3] (🤍..🤏) white heart..pinching hand + {0x1F910, 0x1F918, prExtendedPictographic}, // 8.0 [9] (🤐..🤘) zipper-mouth face..sign of the horns + {0x1F919, 0x1F91E, prExtendedPictographic}, // 9.0 [6] (🤙..🤞) call me hand..crossed fingers + {0x1F91F, 0x1F91F, prExtendedPictographic}, // 10.0 [1] (🤟) love-you gesture + {0x1F920, 0x1F927, prExtendedPictographic}, // 9.0 [8] (🤠..🤧) cowboy hat face..sneezing face + {0x1F928, 0x1F92F, prExtendedPictographic}, // 10.0 [8] (🤨..🤯) face with raised eyebrow..exploding head + {0x1F930, 0x1F930, prExtendedPictographic}, // 9.0 [1] (🤰) pregnant woman + {0x1F931, 0x1F932, prExtendedPictographic}, // 10.0 [2] (🤱..🤲) breast-feeding..palms up together + {0x1F933, 0x1F93A, prExtendedPictographic}, // 9.0 [8] (🤳..🤺) selfie..person fencing + {0x1F93C, 0x1F93E, prExtendedPictographic}, // 9.0 [3] (🤼..🤾) people wrestling..person playing handball + {0x1F93F, 0x1F93F, prExtendedPictographic}, // 12.0 [1] (🤿) diving mask + {0x1F940, 0x1F945, prExtendedPictographic}, // 9.0 [6] (🥀..🥅) wilted flower..goal net + {0x1F947, 0x1F94B, prExtendedPictographic}, // 9.0 [5] (🥇..🥋) 1st place medal..martial arts uniform + {0x1F94C, 0x1F94C, prExtendedPictographic}, // 10.0 [1] (🥌) curling stone + {0x1F94D, 0x1F94F, prExtendedPictographic}, // 11.0 [3] (🥍..🥏) lacrosse..flying disc + {0x1F950, 0x1F95E, prExtendedPictographic}, // 9.0 [15] (🥐..🥞) croissant..pancakes + {0x1F95F, 0x1F96B, prExtendedPictographic}, // 10.0 [13] (🥟..🥫) dumpling..canned food + {0x1F96C, 0x1F970, prExtendedPictographic}, // 11.0 [5] (🥬..🥰) leafy green..smiling face with hearts + {0x1F971, 0x1F971, prExtendedPictographic}, // 12.0 [1] (🥱) yawning face + {0x1F972, 0x1F972, prExtendedPictographic}, // NA [1] (🥲) + {0x1F973, 0x1F976, prExtendedPictographic}, // 11.0 [4] (🥳..🥶) partying face..cold face + {0x1F977, 0x1F979, prExtendedPictographic}, // NA [3] (🥷..🥹) .. + {0x1F97A, 0x1F97A, prExtendedPictographic}, // 11.0 [1] (🥺) pleading face + {0x1F97B, 0x1F97B, prExtendedPictographic}, // 12.0 [1] (🥻) sari + {0x1F97C, 0x1F97F, prExtendedPictographic}, // 11.0 [4] (🥼..🥿) lab coat..flat shoe + {0x1F980, 0x1F984, prExtendedPictographic}, // 8.0 [5] (🦀..🦄) crab..unicorn + {0x1F985, 0x1F991, prExtendedPictographic}, // 9.0 [13] (🦅..🦑) eagle..squid + {0x1F992, 0x1F997, prExtendedPictographic}, // 10.0 [6] (🦒..🦗) giraffe..cricket + {0x1F998, 0x1F9A2, prExtendedPictographic}, // 11.0 [11] (🦘..🦢) kangaroo..swan + {0x1F9A3, 0x1F9A4, prExtendedPictographic}, // NA [2] (🦣..🦤) .. + {0x1F9A5, 0x1F9AA, prExtendedPictographic}, // 12.0 [6] (🦥..🦪) sloth..oyster + {0x1F9AB, 0x1F9AD, prExtendedPictographic}, // NA [3] (🦫..🦭) .. + {0x1F9AE, 0x1F9AF, prExtendedPictographic}, // 12.0 [2] (🦮..🦯) guide dog..probing cane + {0x1F9B0, 0x1F9B9, prExtendedPictographic}, // 11.0 [10] (🦰..🦹) red hair..supervillain + {0x1F9BA, 0x1F9BF, prExtendedPictographic}, // 12.0 [6] (🦺..🦿) safety vest..mechanical leg + {0x1F9C0, 0x1F9C0, prExtendedPictographic}, // 8.0 [1] (🧀) cheese wedge + {0x1F9C1, 0x1F9C2, prExtendedPictographic}, // 11.0 [2] (🧁..🧂) cupcake..salt + {0x1F9C3, 0x1F9CA, prExtendedPictographic}, // 12.0 [8] (🧃..🧊) beverage box..ice cube + {0x1F9CB, 0x1F9CC, prExtendedPictographic}, // NA [2] (🧋..🧌) .. + {0x1F9CD, 0x1F9CF, prExtendedPictographic}, // 12.0 [3] (🧍..🧏) person standing..deaf person + {0x1F9D0, 0x1F9E6, prExtendedPictographic}, // 10.0 [23] (🧐..🧦) face with monocle..socks + {0x1F9E7, 0x1F9FF, prExtendedPictographic}, // 11.0 [25] (🧧..🧿) red envelope..nazar amulet + {0x1FA00, 0x1FA53, prExtendedPictographic}, // 12.0 [84] (🨀..🩓) NEUTRAL CHESS KING..BLACK CHESS KNIGHT-BISHOP + {0x1FA54, 0x1FA5F, prExtendedPictographic}, // NA [12] (🩔..🩟) .. + {0x1FA60, 0x1FA6D, prExtendedPictographic}, // 11.0 [14] (🩠..🩭) XIANGQI RED GENERAL..XIANGQI BLACK SOLDIER + {0x1FA6E, 0x1FA6F, prExtendedPictographic}, // NA [2] (🩮..🩯) .. + {0x1FA70, 0x1FA73, prExtendedPictographic}, // 12.0 [4] (🩰..🩳) ballet shoes..shorts + {0x1FA74, 0x1FA77, prExtendedPictographic}, // NA [4] (🩴..🩷) .. + {0x1FA78, 0x1FA7A, prExtendedPictographic}, // 12.0 [3] (🩸..🩺) drop of blood..stethoscope + {0x1FA7B, 0x1FA7F, prExtendedPictographic}, // NA [5] (🩻..🩿) .. + {0x1FA80, 0x1FA82, prExtendedPictographic}, // 12.0 [3] (🪀..🪂) yo-yo..parachute + {0x1FA83, 0x1FA8F, prExtendedPictographic}, // NA [13] (🪃..🪏) .. + {0x1FA90, 0x1FA95, prExtendedPictographic}, // 12.0 [6] (🪐..🪕) ringed planet..banjo + {0x1FA96, 0x1FFFD, prExtendedPictographic}, // NA[1384] (🪖..🿽) .. + {0xE0000, 0xE0000, prControl}, // Cn + {0xE0001, 0xE0001, prControl}, // Cf LANGUAGE TAG + {0xE0002, 0xE001F, prControl}, // Cn [30] .. + {0xE0020, 0xE007F, prExtend}, // Cf [96] TAG SPACE..CANCEL TAG + {0xE0080, 0xE00FF, prControl}, // Cn [128] .. + {0xE0100, 0xE01EF, prExtend}, // Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 + {0xE01F0, 0xE0FFF, prControl}, // Cn [3600] .. +} + +// property returns the Unicode property value (see constants above) of the +// given code point. +func property(r rune) int { + // Run a binary search. + from := 0 + to := len(codePoints) + for to > from { + middle := (from + to) / 2 + cpRange := codePoints[middle] + if int(r) < cpRange[0] { + to = middle + continue + } + if int(r) > cpRange[1] { + from = middle + 1 + continue + } + return cpRange[2] + } + return prAny +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/LICENSE b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/LICENSE new file mode 100644 index 0000000000..a155a625fc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/LICENSE @@ -0,0 +1,62 @@ +Scylla SOURCE AVAILABLE LICENSE (SSAL) AGREEMENT Last Update: June 30, 2021 + +This Agreement sets forth the terms on which the Licensor makes available the Software. BY INSTALLING, DOWNLOADING, ACCESSING, USING OR DISTRIBUTING ANY OF THE SOFTWARE, YOU AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO SUCH TERMS AND CONDITIONS, YOU MUST NOT USE THE SOFTWARE. + +If you are receiving the Software on behalf of a legal entity, you represent and warrant that you have the actual authority to agree to the terms and conditions of this agreement on behalf of such entity. + +The terms below have the meanings set forth below for purposes of this Agreement: + +Agreement: this Scylla Source Available License Agreement. + +Database Product: any of the following products or services: + +(a) Scylla Manager; + +(b) a product or service exposing the Scylla Manager API + +License: the Scylla Source Available License described in Section 1. + +Licensor: as indicated in the source code license. + +Modification: a modification of the Software made by You under the License, Section 1.1(c). + +Scylla: the open source Scylla software as described in scylladb.com + +Software: certain software components designed to work with Scylla NoSQL Database and provided to you under this Agreement. + +You: the recipient of this Software, an individual, or the entity on whose behalf you are receiving the Software. + +Your Application: an application developed by or for You, where such application is not a Database Product. + +LICENSE GRANT AND CONDITIONS +1.1 Subject to the terms and conditions of this Section 1, Licensor hereby grants to You a non-exclusive, royalty-free, worldwide, non-transferable license during the term of this Agreement to: + +a) distribute or make available the Software or your Modifications under the terms of this +Agreement, only as part of Your Application, so long as you include the following notice on any copy you distribute: “This software is subject to the terms of the Scylla Source Available License Agreement”. + +(b) use the Software, or your Modifications, only as part of Your Application, but not in connection + +with any Database Product that is distributed or otherwise made available by any third party. + +(c) modify the Software, provided that Modifications remain subject to the terms of this License. + +(d) reproduce the Software as necessary for the above. + +1.3. Notices. + +On all copies of the Software that you make, you must retain all copyright or other proprietary notices. + +TERM AND TERMINATION. +This Agreement will continue unless and until earlier terminated as set forth herein. If You breach any of its conditions or obligations under this Agreement, this Agreement will terminate automatically and the licenses granted herein will terminate automatically. + +INTELLECTUAL PROPERTY. +As between the parties, Licensor retains all right, title, and interest in the Software, and to Scylla or other Licensor trademarks or service marks, and all intellectual property rights therein. Licensor hereby reserves all rights not expressly granted to You in this Agreement. + +DISCLAIMER. +TO THE EXTENT ALLOWABLE UNDER LAW, LICENSOR HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE SOFTWARE. Licensor has no obligation to support the Software. + +LIMITATION OF LIABILITY. TO THE EXTENT ALLOWABLE UNDER LAW, LICENSOR WILL NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND, INCLUDING BUT NOT LIMITED TO, LOST PROFITS OR ANY CONSEQUENTIAL, SPECIAL, INCIDENTAL, INDIRECT, OR DIRECT DAMAGES, ARISING OUT OF OR RELATING TO THIS AGREEMENT. +GENERAL. You are not authorized to assign Your rights under this Agreement to any third party. Licensor may freely assign its rights under this Agreement to any third party. This Agreement is the entire agreement between the parties on the subject matter hereof. No amendment or modification hereof will be valid or binding upon the parties unless made in writing and signed by the duly authorized representatives of both parties. In the event that any provision, including without limitation any condition, of this Agreement is held to be unenforceable, this Agreement and all licenses and rights granted hereunder will immediately terminate. Failure by Licensor to exercise any right hereunder will not be construed as a waiver of any subsequent breach of that right or as a waiver of any other right. This Agreement will be governed by and interpreted in accordance with the laws of the state of California, without reference to its conflict of laws principles. If You are located within the United States, all disputes arising out of this Agreement are subject to the exclusive jurisdiction of courts located in Santa Clara County, California. USA. If You are located outside of the United States, any dispute, controversy or claim arising out of or relating to this Agreement will be referred to and finally determined by arbitration in accordance with the JAMS before a single arbitrator in Santa Clara County, California. Judgment upon the award rendered by the arbitrator may be entered in any court having jurisdiction thereof. + +This license is base on REDIS SOURCE AVAILABLE LICENSE (RSAL) AGREEMENT with some updates +https://redislabs.com/wp-content/uploads/2019/09/redis-source-available-license.pdf diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/backup.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/backup.go new file mode 100644 index 0000000000..7bd459e5f4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/backup.go @@ -0,0 +1,39 @@ +// Copyright (C) 2017 ScyllaDB + +package managerclient + +// Stage enumeration. +const ( + BackupStageInit string = "INIT" + BackupStageSnapshot string = "SNAPSHOT" + BackupStageAwaitSchema string = "AWAIT_SCHEMA" + BackupStageIndex string = "INDEX" + BackupStageManifest string = "MANIFEST" + BackupStageSchema string = "SCHEMA" + BackupStageDeduplicate string = "DEDUPLICATE" + BackupStageUpload string = "UPLOAD" + BackupStageMoveManifest string = "MOVE_MANIFEST" + BackupStageMigrate string = "MIGRATE" + BackupStagePurge string = "PURGE" + BackupStageDone string = "DONE" +) + +var backupStageName = map[string]string{ + BackupStageInit: "initialising", + BackupStageSnapshot: "taking snapshot", + BackupStageAwaitSchema: "awaiting schema agreement", + BackupStageIndex: "indexing files", + BackupStageManifest: "uploading manifests", + BackupStageSchema: "uploading schema", + BackupStageDeduplicate: "deduplicating the snapshot", + BackupStageUpload: "uploading data", + BackupStageMoveManifest: "moving manifests", + BackupStageMigrate: "migrating legacy metadata", + BackupStagePurge: "retention", + BackupStageDone: "", +} + +// BackupStageName returns verbose name for backup stage. +func BackupStageName(s string) string { + return backupStageName[s] +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/client.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/client.go new file mode 100644 index 0000000000..e162a7f81d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/client.go @@ -0,0 +1,686 @@ +// Copyright (C) 2017 ScyllaDB + +package managerclient + +import ( + "context" + "crypto/tls" + "net" + "net/http" + "net/url" + "os" + "runtime" + "strconv" + "strings" + "sync" + "time" + + api "github.com/go-openapi/runtime/client" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/hbollon/go-edlib" + "github.com/pkg/errors" + "github.com/scylladb/scylla-manager/v3/pkg/util/pointer" + "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations" + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +var disableOpenAPIDebugOnce sync.Once + +// Client provides means to interact with Scylla Manager. +type Client struct { + operations operations.ClientService +} + +// DefaultTransport specifies default HTTP transport to be used in NewClient if +// nil transport is provided. +var DefaultTransport = &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + }).DialContext, + MaxIdleConns: 100, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + MaxIdleConnsPerHost: runtime.GOMAXPROCS(0) + 1, + + TLSClientConfig: DefaultTLSConfig(), +} + +// DefaultTLSConfig specifies default TLS configuration used when creating a new +// client. +var DefaultTLSConfig = func() *tls.Config { + return &tls.Config{ + InsecureSkipVerify: true, + } +} + +// Option allows decorating underlying HTTP client in NewClient. +type Option func(*http.Client) + +func NewClient(rawURL string, opts ...Option) (Client, error) { + u, err := url.Parse(rawURL) + if err != nil { + return Client{}, err + } + + disableOpenAPIDebugOnce.Do(func() { + middleware.Debug = false + }) + + httpClient := &http.Client{ + Transport: DefaultTransport, + } + for _, o := range opts { + o(httpClient) + } + + r := api.NewWithClient(u.Host, u.Path, []string{u.Scheme}, httpClient) + // debug can be turned on by SWAGGER_DEBUG or DEBUG env variable + // we change that to SCTOOL_DUMP_HTTP + r.Debug, _ = strconv.ParseBool(os.Getenv("SCTOOL_DUMP_HTTP")) + + return Client{operations: operations.New(r, strfmt.Default)}, nil +} + +// CreateCluster creates a new cluster. +func (c *Client) CreateCluster(ctx context.Context, cluster *Cluster) (string, error) { + resp, err := c.operations.PostClusters(&operations.PostClustersParams{ + Context: ctx, + Cluster: cluster, + }) + if err != nil { + return "", err + } + + clusterID, err := uuidFromLocation(resp.Location) + if err != nil { + return "", errors.Wrap(err, "cannot parse response") + } + + return clusterID.String(), nil +} + +// GetCluster returns a cluster for a given ID. +func (c *Client) GetCluster(ctx context.Context, clusterID string) (*Cluster, error) { + resp, err := c.operations.GetClusterClusterID(&operations.GetClusterClusterIDParams{ + Context: ctx, + ClusterID: clusterID, + }) + if err != nil { + return nil, err + } + + return resp.Payload, nil +} + +// UpdateCluster updates cluster. +func (c *Client) UpdateCluster(ctx context.Context, cluster *Cluster) error { + _, err := c.operations.PutClusterClusterID(&operations.PutClusterClusterIDParams{ // nolint: errcheck + Context: ctx, + ClusterID: cluster.ID, + Cluster: cluster, + }) + return err +} + +// DeleteCluster removes cluster. +func (c *Client) DeleteCluster(ctx context.Context, clusterID string) error { + _, err := c.operations.DeleteClusterClusterID(&operations.DeleteClusterClusterIDParams{ // nolint: errcheck + Context: ctx, + ClusterID: clusterID, + }) + return err +} + +// DeleteClusterSecrets removes cluster secrets. +func (c *Client) DeleteClusterSecrets(ctx context.Context, clusterID string, cqlCreds, sslUserCert bool) error { + ok := false + p := &operations.DeleteClusterClusterIDParams{ + Context: ctx, + ClusterID: clusterID, + } + if cqlCreds { + p.CqlCreds = &cqlCreds + ok = true + } + if sslUserCert { + p.SslUserCert = &sslUserCert + ok = true + } + + if !ok { + return nil + } + + _, err := c.operations.DeleteClusterClusterID(p) // nolint: errcheck + return err +} + +// ListClusters returns clusters. +func (c *Client) ListClusters(ctx context.Context) (ClusterSlice, error) { + resp, err := c.operations.GetClusters(&operations.GetClustersParams{ + Context: ctx, + }) + if err != nil { + return nil, err + } + + return resp.Payload, nil +} + +// ClusterStatus returns health check progress. +func (c *Client) ClusterStatus(ctx context.Context, clusterID string) (ClusterStatus, error) { + resp, err := c.operations.GetClusterClusterIDStatus(&operations.GetClusterClusterIDStatusParams{ + Context: ctx, + ClusterID: clusterID, + }) + if err != nil { + return nil, err + } + + return ClusterStatus(resp.Payload), nil +} + +// GetRepairTarget fetches information about repair target. +func (c *Client) GetRepairTarget(ctx context.Context, clusterID string, t *Task) (*RepairTarget, error) { + resp, err := c.operations.GetClusterClusterIDTasksRepairTarget(&operations.GetClusterClusterIDTasksRepairTargetParams{ + Context: ctx, + ClusterID: clusterID, + TaskFields: makeTaskUpdate(t), + }) + if err != nil { + return nil, err + } + + return &RepairTarget{RepairTarget: *resp.Payload}, nil +} + +// GetBackupTarget fetches information about repair target. +func (c *Client) GetBackupTarget(ctx context.Context, clusterID string, t *Task) (*BackupTarget, error) { + resp, err := c.operations.GetClusterClusterIDTasksBackupTarget(&operations.GetClusterClusterIDTasksBackupTargetParams{ + Context: ctx, + ClusterID: clusterID, + TaskFields: makeTaskUpdate(t), + }) + if err != nil { + return nil, err + } + + return &BackupTarget{BackupTarget: *resp.Payload}, nil +} + +// GetRestoreTarget fetches information about restore target. +func (c *Client) GetRestoreTarget(ctx context.Context, clusterID string, t *Task) (*RestoreTarget, error) { + resp, err := c.operations.GetClusterClusterIDTasksRestoreTarget(&operations.GetClusterClusterIDTasksRestoreTargetParams{ + Context: ctx, + ClusterID: clusterID, + TaskFields: makeTaskUpdate(t), + }) + if err != nil { + return nil, err + } + + return &RestoreTarget{RestoreTarget: *resp.Payload}, nil +} + +// CreateTask creates a new task. +func (c *Client) CreateTask(ctx context.Context, clusterID string, t *Task) (uuid.UUID, error) { + params := &operations.PostClusterClusterIDTasksParams{ + Context: ctx, + ClusterID: clusterID, + TaskFields: makeTaskUpdate(t), + } + resp, err := c.operations.PostClusterClusterIDTasks(params) + if err != nil { + return uuid.Nil, err + } + + taskID, err := uuidFromLocation(resp.Location) + if err != nil { + return uuid.Nil, errors.Wrap(err, "cannot parse response") + } + + return taskID, nil +} + +// GetTask returns a task of a given type and ID. +func (c *Client) GetTask(ctx context.Context, clusterID, taskType string, taskID uuid.UUID) (*Task, error) { + resp, err := c.operations.GetClusterClusterIDTaskTaskTypeTaskID(&operations.GetClusterClusterIDTaskTaskTypeTaskIDParams{ + Context: ctx, + ClusterID: clusterID, + TaskType: taskType, + TaskID: taskID.String(), + }) + if err != nil { + return nil, err + } + + return resp.Payload, nil +} + +// GetTaskHistory returns a run history of task of a given type and task ID. +func (c *Client) GetTaskHistory(ctx context.Context, clusterID, taskType string, taskID uuid.UUID, limit int64) (TaskRunSlice, error) { + params := &operations.GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams{ + Context: ctx, + ClusterID: clusterID, + TaskType: taskType, + TaskID: taskID.String(), + } + + params.Limit = &limit + + resp, err := c.operations.GetClusterClusterIDTaskTaskTypeTaskIDHistory(params) + if err != nil { + return nil, err + } + + return resp.Payload, nil +} + +// StartTask starts executing a task. +func (c *Client) StartTask(ctx context.Context, clusterID, taskType string, taskID uuid.UUID, cont bool) error { + _, err := c.operations.PutClusterClusterIDTaskTaskTypeTaskIDStart(&operations.PutClusterClusterIDTaskTaskTypeTaskIDStartParams{ // nolint: errcheck + Context: ctx, + ClusterID: clusterID, + TaskType: taskType, + TaskID: taskID.String(), + Continue: cont, + }) + + return err +} + +// StopTask stops executing a task. +func (c *Client) StopTask(ctx context.Context, clusterID, taskType string, taskID uuid.UUID, disable bool) error { + _, err := c.operations.PutClusterClusterIDTaskTaskTypeTaskIDStop(&operations.PutClusterClusterIDTaskTaskTypeTaskIDStopParams{ // nolint: errcheck + Context: ctx, + ClusterID: clusterID, + TaskType: taskType, + TaskID: taskID.String(), + Disable: &disable, + }) + + return err +} + +// DeleteTask stops executing a task. +func (c *Client) DeleteTask(ctx context.Context, clusterID, taskType string, taskID uuid.UUID) error { + _, err := c.operations.DeleteClusterClusterIDTaskTaskTypeTaskID(&operations.DeleteClusterClusterIDTaskTaskTypeTaskIDParams{ // nolint: errcheck + Context: ctx, + ClusterID: clusterID, + TaskType: taskType, + TaskID: taskID.String(), + }) + + return err +} + +// UpdateTask updates an existing task unit. +func (c *Client) UpdateTask(ctx context.Context, clusterID string, t *Task) error { + _, err := c.operations.PutClusterClusterIDTaskTaskTypeTaskID(&operations.PutClusterClusterIDTaskTaskTypeTaskIDParams{ // nolint: errcheck + Context: ctx, + ClusterID: clusterID, + TaskType: t.Type, + TaskID: t.ID, + TaskFields: &models.TaskUpdate{ + Enabled: t.Enabled, + Name: t.Name, + Labels: t.Labels, + Schedule: t.Schedule, + Tags: t.Tags, + Properties: t.Properties, + }, + }) + return err +} + +// ListTasks returns tasks within a clusterID, optionally filtered by task type tp. +func (c *Client) ListTasks(ctx context.Context, clusterID, taskType string, all bool, status, taskID string) (TaskListItems, error) { + resp, err := c.operations.GetClusterClusterIDTasks(&operations.GetClusterClusterIDTasksParams{ + Context: ctx, + ClusterID: clusterID, + Type: &taskType, + All: &all, + Status: &status, + TaskID: &taskID, + }) + if err != nil { + return TaskListItems{}, err + } + + et := TaskListItems{ + All: all, + } + et.TaskListItemSlice = resp.Payload + return et, nil +} + +// TaskSplit is an extended version of the package level TaskSplit function. +// It adds support for providing task type only. +// If there is a single task of a given type the ID is returned. +// Otherwise an error is returned. +// If there is more tasks the error lists the available options. +func (c *Client) TaskSplit(ctx context.Context, cluster, s string) (taskType string, taskID uuid.UUID, err error) { + var taskName string + taskType, taskID, taskName, err = TaskSplit(s) + if err != nil { + return + } + + if taskID != uuid.Nil { + return taskType, taskID, nil + } + + if taskName == "" { + taskID, err = c.uniqueTaskID(ctx, cluster, taskType) + } else { + taskID, err = c.taskByName(ctx, cluster, taskType, taskName) + } + + return +} + +func (c *Client) uniqueTaskID(ctx context.Context, clusterID, taskType string) (uuid.UUID, error) { + resp, err := c.operations.GetClusterClusterIDTasks(&operations.GetClusterClusterIDTasksParams{ + Context: ctx, + ClusterID: clusterID, + Type: &taskType, + Short: pointer.BoolPtr(true), + }) + if err != nil { + return uuid.Nil, err + } + + tasks := resp.Payload + switch len(tasks) { + case 0: + return uuid.Nil, errors.Errorf("no tasks of type %s", taskType) + case 1: + return uuid.Parse(tasks[0].ID) + default: + return uuid.Nil, errors.Errorf("task ambiguity, use one of:\n%s", formatTaskList(tasks)) + } +} + +func (c *Client) taskByName(ctx context.Context, clusterID, taskType, taskName string) (uuid.UUID, error) { + resp, err := c.operations.GetClusterClusterIDTasks(&operations.GetClusterClusterIDTasksParams{ + Context: ctx, + ClusterID: clusterID, + Type: &taskType, + Short: pointer.BoolPtr(true), + All: pointer.BoolPtr(true), + }) + if err != nil { + return uuid.Nil, err + } + + tasks := resp.Payload + if len(tasks) == 0 { + return uuid.Nil, errors.Errorf("no tasks of type %s", taskType) + } + + for _, t := range tasks { + if t.Name == taskName { + return uuid.Parse(t.ID) + } + } + + var names []string + for _, t := range tasks { + if t.Name != "" { + names = append(names, t.Name) + } + } + if len(names) > 0 { + res, _ := edlib.FuzzySearch(taskName, names, edlib.Levenshtein) // nolint: errcheck + if res != "" { + return uuid.Nil, errors.Errorf("not found, did you mean %s", taskJoin(taskType, res)) + } + } + + return uuid.Nil, errors.Errorf("not found, use one of:\n%s", formatTaskList(tasks)) +} + +func formatTaskList(tasks []*models.TaskListItem) string { + ids := make([]string, len(tasks)) + for i, t := range tasks { + if t.Name != "" { + ids[i] = "- " + taskJoin(t.Type, t.Name) + } else { + ids[i] = "- " + taskJoin(t.Type, t.ID) + } + } + return strings.Join(ids, "\n") +} + +// RepairProgress returns repair progress. +func (c *Client) RepairProgress(ctx context.Context, clusterID, taskID, runID string) (RepairProgress, error) { + resp, err := c.operations.GetClusterClusterIDTaskRepairTaskIDRunID(&operations.GetClusterClusterIDTaskRepairTaskIDRunIDParams{ + Context: ctx, + ClusterID: clusterID, + TaskID: taskID, + RunID: runID, + }) + if err != nil { + return RepairProgress{}, err + } + + return RepairProgress{ + TaskRunRepairProgress: resp.Payload, + }, nil +} + +// BackupProgress returns backup progress. +func (c *Client) BackupProgress(ctx context.Context, clusterID, taskID, runID string) (BackupProgress, error) { + tr := &models.TaskRunBackupProgress{ + Progress: &models.BackupProgress{ + Stage: "INIT", + }, + Run: &models.TaskRun{ + Status: "NEW", + }, + } + + resp, err := c.operations.GetClusterClusterIDTaskBackupTaskIDRunID(&operations.GetClusterClusterIDTaskBackupTaskIDRunIDParams{ + Context: ctx, + ClusterID: clusterID, + TaskID: taskID, + RunID: runID, + }) + if err != nil { + return BackupProgress{ + TaskRunBackupProgress: tr, + }, err + } + + if resp.Payload.Progress == nil { + resp.Payload.Progress = tr.Progress + } + if resp.Payload.Run == nil { + resp.Payload.Run = tr.Run + } + + return BackupProgress{ + TaskRunBackupProgress: resp.Payload, + }, nil +} + +// RestoreProgress returns restore progress. +func (c *Client) RestoreProgress(ctx context.Context, clusterID, taskID, runID string) (RestoreProgress, error) { + resp, err := c.operations.GetClusterClusterIDTaskRestoreTaskIDRunID(&operations.GetClusterClusterIDTaskRestoreTaskIDRunIDParams{ + Context: ctx, + ClusterID: clusterID, + TaskID: taskID, + RunID: runID, + }) + if err != nil { + return RestoreProgress{}, err + } + + return RestoreProgress{ + TaskRunRestoreProgress: resp.Payload, + }, nil +} + +// ValidateBackupProgress returns validate backup progress. +func (c *Client) ValidateBackupProgress(ctx context.Context, clusterID, taskID, runID string) (ValidateBackupProgress, error) { + resp, err := c.operations.GetClusterClusterIDTaskValidateBackupTaskIDRunID(&operations.GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams{ + Context: ctx, + ClusterID: clusterID, + TaskID: taskID, + RunID: runID, + }) + if err != nil { + return ValidateBackupProgress{}, err + } + + return ValidateBackupProgress{ + TaskRunValidateBackupProgress: resp.Payload, + }, nil +} + +// ListBackups returns listing of available backups. +func (c *Client) ListBackups(ctx context.Context, clusterID string, + locations []string, allClusters bool, keyspace []string, minDate, maxDate time.Time, +) (BackupListItems, error) { + p := &operations.GetClusterClusterIDBackupsParams{ + Context: ctx, + ClusterID: clusterID, + Locations: locations, + Keyspace: keyspace, + } + if !allClusters { + p.QueryClusterID = &clusterID + } + if !minDate.IsZero() { + p.MinDate = (*strfmt.DateTime)(pointer.TimePtr(minDate)) + } + if !maxDate.IsZero() { + p.MaxDate = (*strfmt.DateTime)(pointer.TimePtr(maxDate)) + } + + resp, err := c.operations.GetClusterClusterIDBackups(p) + if err != nil { + return BackupListItems{}, err + } + + return BackupListItems{items: resp.Payload}, nil +} + +// ListBackupFiles returns a listing of available backup files. +func (c *Client) ListBackupFiles(ctx context.Context, clusterID string, + locations []string, allClusters bool, keyspace []string, snapshotTag string, +) ([]*models.BackupFilesInfo, error) { + p := &operations.GetClusterClusterIDBackupsFilesParams{ + Context: ctx, + ClusterID: clusterID, + Locations: locations, + Keyspace: keyspace, + SnapshotTag: snapshotTag, + } + if !allClusters { + p.QueryClusterID = &clusterID + } + + resp, err := c.operations.GetClusterClusterIDBackupsFiles(p) + if err != nil { + return nil, err + } + + return resp.Payload, nil +} + +// DeleteSnapshot deletes backup snapshot with all data associated with it. +func (c *Client) DeleteSnapshot(ctx context.Context, clusterID string, + locations []string, snapshotTags []string, +) error { + p := &operations.DeleteClusterClusterIDBackupsParams{ + Context: ctx, + ClusterID: clusterID, + Locations: locations, + SnapshotTags: snapshotTags, + } + + _, err := c.operations.DeleteClusterClusterIDBackups(p) // nolint: errcheck + return err +} + +// Version returns server version. +func (c *Client) Version(ctx context.Context) (*models.Version, error) { + resp, err := c.operations.GetVersion(&operations.GetVersionParams{ + Context: ctx, + }) + if err != nil { + return &models.Version{}, err + } + + return resp.Payload, nil +} + +// SetRepairIntensity updates ongoing repair intensity. +func (c *Client) SetRepairIntensity(ctx context.Context, clusterID string, intensity float64) error { + p := &operations.PutClusterClusterIDRepairsIntensityParams{ + Context: ctx, + ClusterID: clusterID, + Intensity: intensity, + } + + _, err := c.operations.PutClusterClusterIDRepairsIntensity(p) // nolint: errcheck + return err +} + +// SetRepairParallel updates ongoing repair parallel disjoint host groups. +func (c *Client) SetRepairParallel(ctx context.Context, clusterID string, parallel int64) error { + p := &operations.PutClusterClusterIDRepairsParallelParams{ + Context: ctx, + ClusterID: clusterID, + Parallel: parallel, + } + + _, err := c.operations.PutClusterClusterIDRepairsParallel(p) // nolint: errcheck + return err +} + +// IsSuspended returns true iff the current cluster is suspended. +func (c *Client) IsSuspended(ctx context.Context, clusterID string) (bool, error) { + p := &operations.GetClusterClusterIDSuspendedParams{ + Context: ctx, + ClusterID: clusterID, + } + + s, err := c.operations.GetClusterClusterIDSuspended(p) + if err != nil { + return false, err + } + + return bool(s.Payload), nil +} + +// Suspend updates cluster suspended property. +func (c *Client) Suspend(ctx context.Context, clusterID string) error { + p := &operations.PutClusterClusterIDSuspendedParams{ + Context: ctx, + ClusterID: clusterID, + Suspended: true, + } + + _, err := c.operations.PutClusterClusterIDSuspended(p) // nolint: errcheck + return err +} + +// Resume updates cluster suspended property. +func (c *Client) Resume(ctx context.Context, clusterID string, startTasks bool) error { + p := &operations.PutClusterClusterIDSuspendedParams{ + Context: ctx, + ClusterID: clusterID, + StartTasks: startTasks, + Suspended: false, + } + + _, err := c.operations.PutClusterClusterIDSuspended(p) // nolint: errcheck + return err +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/cron.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/cron.go new file mode 100644 index 0000000000..1e20f20311 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/cron.go @@ -0,0 +1,22 @@ +// Copyright (C) 2022 ScyllaDB + +package managerclient + +import ( + "github.com/lnquy/cron" +) + +var cronDesc *cron.ExpressionDescriptor + +func init() { + cronDesc, _ = cron.NewDescriptor() // nolint: errcheck +} + +// DescribeCron returns description of cron expression in plain English. +func DescribeCron(s string) string { + if cronDesc == nil { + return "" + } + d, _ := cronDesc.ToDescription(s, cron.Locale_en) // nolint: errcheck + return d +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/error.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/error.go new file mode 100644 index 0000000000..3647fb8548 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/error.go @@ -0,0 +1,43 @@ +// Copyright (C) 2017 ScyllaDB + +package managerclient + +import ( + "fmt" + "io" + "regexp" +) + +// PrintError handles ErrorResponse and can format multierror strings. +func PrintError(w io.Writer, err error) { + v, ok := err.(interface { // nolint: errorlint + GetPayload() *ErrorResponse + }) + if ok { + p := v.GetPayload() + + if len(p.Details) > 0 { + fmt.Fprintf(w, "%s\n\n", p.Details) + } + fmt.Fprintf(w, "Error: %s\n", FormatError(p.Message)) + fmt.Fprintf(w, "Trace ID: %s (grep in scylla-manager logs)\n", p.TraceID) + } else { + fmt.Fprintf(w, "Error: %s\n", err) + } + fmt.Fprintln(w) +} + +// FormatError formats messages created by using multierror with +// errors wrapped with host IP so that each host error is in it's own line. +func FormatError(msg string) string { + const prefix = " " + + // Fairly relaxed IPv4 and IPv6 heuristic pattern, a proper pattern can + // be very complex + const ipRegex = `([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(\d{1,3}\.){3}\d{1,3}` + + // Move host errors to newline + r := regexp.MustCompile(`(^|: |; )(` + ipRegex + `): `) + + return r.ReplaceAllString(msg, "\n"+prefix+"${2}: ") +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/model.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/model.go new file mode 100644 index 0000000000..fad3142ba2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/model.go @@ -0,0 +1,1375 @@ +// Copyright (C) 2017 ScyllaDB + +package managerclient + +import ( + "encoding/json" + "fmt" + "io" + "sort" + "strings" + "text/template" + "time" + + "github.com/go-openapi/strfmt" + "github.com/pkg/errors" + "github.com/scylladb/go-set/strset" + "github.com/scylladb/scylla-manager/v3/pkg/managerclient/table" + "github.com/scylladb/scylla-manager/v3/pkg/util/inexlist" + "github.com/scylladb/scylla-manager/v3/pkg/util/schedules" + "github.com/scylladb/scylla-manager/v3/pkg/util/timeutc" + "github.com/scylladb/scylla-manager/v3/pkg/util/version" + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" + "github.com/scylladb/termtables" +) + +// ErrorResponse is returned in case of an error. +type ErrorResponse = models.ErrorResponse + +// TableRenderer is the interface that components need to implement +// if they can render themselves as tables. +type TableRenderer interface { + Render(io.Writer) error +} + +// Cluster is cluster.Cluster representation. +type Cluster = models.Cluster + +// ClusterSlice is []*cluster.Cluster representation. +type ClusterSlice []*models.Cluster + +// Render renders ClusterSlice in a tabular format. +func (cs ClusterSlice) Render(w io.Writer) error { + t := table.New("ID", "Name", "Labels", "Port", "CQL credentials") + for _, c := range cs { + p := "default" + if c.Port != 0 { + p = fmt.Sprint(c.Port) + } + creds := "not set" + if c.Username != "" && c.Password != "" { + creds = "set" + } + t.AddRow(c.ID, c.Name, formatLabels(c.Labels), p, creds) + } + if _, err := w.Write([]byte(t.String())); err != nil { + return err + } + + return nil +} + +// ClusterStatus contains cluster status info. +type ClusterStatus models.ClusterStatus + +func (cs ClusterStatus) tableHeaders() []interface{} { + headers := []interface{}{"Address", "Uptime", "CPUs", "Memory", "Scylla", "Agent", "Host ID"} + apis := []interface{}{"CQL", "REST"} + + if cs.hasAnyAlternator() { + apis = append([]interface{}{"Alternator"}, apis...) + } + + return append([]interface{}{""}, append(apis, headers...)...) +} + +func (cs ClusterStatus) hasAnyAlternator() bool { + for _, s := range cs { + if s.AlternatorStatus != "" { + return true + } + } + return false +} + +func (cs ClusterStatus) addRow(t *table.Table, rows ...interface{}) { + unpacked := make([]interface{}, 0, len(rows)) + for _, r := range rows { + switch v := r.(type) { + case []interface{}: + unpacked = append(unpacked, v...) + default: + unpacked = append(unpacked, v) + } + } + headers := cs.tableHeaders() + t.AddRow(unpacked[:len(headers)]...) +} + +// Render renders ClusterStatus in a tabular format. +func (cs ClusterStatus) Render(w io.Writer) error { + if len(cs) == 0 { + return nil + } + + var ( + dc = cs[0].Dc + t = table.New(cs.tableHeaders()...) + errors []string + ) + + for _, s := range cs { + if s.Dc != dc { + fmt.Fprintf(w, "Datacenter: %s\n%s", dc, t) + dc = s.Dc + t = table.New(cs.tableHeaders()...) + + if len(errors) > 0 { + fmt.Fprintf(w, "Errors:\n- %s\n\n", strings.Join(errors, "\n- ")) + errors = nil + } + } + + var apiStatuses []interface{} + + if s.AlternatorStatus != "" { + status := s.AlternatorStatus + if s.Ssl { + status += " SSL" + } + apiStatuses = append(apiStatuses, fmt.Sprintf("%s (%.0fms)", status, s.AlternatorRttMs)) + } else if cs.hasAnyAlternator() { + apiStatuses = append(apiStatuses, "-") + } + if s.AlternatorCause != "" { + errors = append(errors, fmt.Sprintf("%s alternator: %s", s.Host, s.AlternatorCause)) + } + + if s.CqlStatus != "" { + status := s.CqlStatus + if s.Ssl { + status += " SSL" + } + apiStatuses = append(apiStatuses, fmt.Sprintf("%s (%.0fms)", status, s.CqlRttMs)) + } else { + apiStatuses = append(apiStatuses, "-") + } + if s.CqlCause != "" { + errors = append(errors, fmt.Sprintf("%s CQL: %s", s.Host, s.CqlCause)) + } + + if s.RestStatus != "" { + apiStatuses = append(apiStatuses, fmt.Sprintf("%s (%.0fms)", s.RestStatus, s.RestRttMs)) + } else { + apiStatuses = append(apiStatuses, "-") + } + if s.RestCause != "" { + errors = append(errors, fmt.Sprintf("%s REST: %s", s.Host, s.RestCause)) + } + + var ( + cpus = "-" + mem = "-" + scyllaVersion = "-" + agentVersion = "-" + uptime = "-" + ) + if s.CPUCount > 0 { + cpus = fmt.Sprintf("%d", s.CPUCount) + } + if s.TotalRAM > 0 { + mem = FormatSizeSuffix(s.TotalRAM) + } + if s.ScyllaVersion != "" { + scyllaVersion = version.Short(s.ScyllaVersion) + } + if s.AgentVersion != "" { + agentVersion = version.Short(s.AgentVersion) + } + if s.Uptime > 0 { + uptime = (time.Duration(s.Uptime) * time.Second).String() + } + + cs.addRow(t, s.Status, apiStatuses, s.Host, uptime, cpus, mem, scyllaVersion, agentVersion, s.HostID) + } + + fmt.Fprintf(w, "Datacenter: %s\n%s", dc, t) + if len(errors) > 0 { + fmt.Fprintf(w, "Errors:\n- %s\n\n", strings.Join(errors, "\n- ")) + } + return nil +} + +// Task is a scheduler.Task representation. +type Task = models.Task + +func makeTaskUpdate(t *Task) *models.TaskUpdate { + return &models.TaskUpdate{ + Type: t.Type, + Enabled: t.Enabled, + Name: t.Name, + Labels: t.Labels, + Schedule: t.Schedule, + Properties: t.Properties, + } +} + +// TaskInfo allows for rendering of Task information i.e. schedule and properties. +type TaskInfo struct { + *TaskListItem +} + +const taskInfoTemplate = `Name: {{ TaskID .TaskListItem }} +Cron: {{ CronDesc .TaskListItem }} +{{ if .Schedule.Window -}} +Window: {{ WindowDesc .Schedule.Window }} +{{ end -}} +{{ if .Schedule.Timezone -}} +Tz: {{ .Schedule.Timezone }} +{{ end -}} +{{ if .Schedule.NumRetries -}} +Retry: {{ .Schedule.NumRetries }} {{ if .Schedule.RetryWait }}(initial backoff {{ .Schedule.RetryWait }}){{ end }}{{ end -}} +{{ if .Labels }} +Labels: +{{- range $key, $val := .Labels }} +- {{ $key }}: {{ $val -}} +{{ end }} +{{ end -}} + +{{ if .Properties }} +Properties: +{{- range $key, $val := .Properties }} +- {{ FormatKey $key }}: {{ FormatValue $val -}} +{{ end }} +{{ end -}} + +` + +// Render implements Renderer interface. +func (t TaskInfo) Render(w io.Writer) error { + temp := template.Must(template.New("target").Funcs(template.FuncMap{ + "TaskID": func(i *TaskListItem) string { + if i.Name != "" { + return taskJoin(i.Type, i.Name) + } + return taskJoin(i.Type, i.ID) + }, + "CronDesc": func(i *TaskListItem) string { + s := i.Schedule.Cron + if s == "" { + s = i.Schedule.Interval + } + + d := DescribeCron(s) + if d == "" { + nextStr := FormatTimePointer(i.NextActivation) + if nextStr != "" { + d = "next activation date: " + nextStr + } else { + d = "no activations scheduled" + } + } + + if s != "" { + return s + " (" + d + ")" + } + return d + }, + "WindowDesc": func(s []string) string { + v := "" + for i := 0; i < len(s)/2; i++ { + v += fmt.Sprint(s[i*2:(i+1)*2]) + " " + } + return v + }, + "FormatKey": formatKey, + "FormatValue": formatValue, + }).Parse(taskInfoTemplate)) + return temp.Execute(w, t) +} + +func formatKey(k string) string { + return strings.ReplaceAll(k, "_", "-") +} + +func formatValue(v any) string { + switch t := v.(type) { + case []string: + return "'" + strings.Join(t, ",") + "'" + case []interface{}: + s := make([]string, len(t)) + for i := range t { + s[i] = fmt.Sprint(t[i]) + } + return "'" + strings.Join(s, ",") + "'" + default: + return fmt.Sprint(t) + } +} + +// RepairTarget is a representing results of dry running repair task. +type RepairTarget struct { + models.RepairTarget + Schedule *Schedule + ShowTables int +} + +const repairTargetTemplate = `{{ if .Schedule.Cron -}} +Cron: {{ .Schedule.Cron }} {{ CronDesc .Schedule.Cron }} +{{ if .Schedule.Timezone -}} +Tz: {{ .Schedule.Timezone }} +{{ end }} +{{ end -}} +{{ if .Host -}} + +Host: {{ .Host }} + +{{ end -}} +{{ if .IgnoreHosts -}} + +Ignore Hosts: +{{ range .IgnoreHosts -}} + - {{ . }} +{{ end }} +{{ end -}} + +Data Centers: +{{ range .Dc }} - {{ . }} +{{ end }} +Keyspaces: +{{- range .Units }} + - {{ .Keyspace }} {{ FormatTables .Tables .AllTables -}} +{{ end }} + +` + +// Render implements Renderer interface. +func (t RepairTarget) Render(w io.Writer) error { + temp := template.Must(template.New("target").Funcs(template.FuncMap{ + "FormatTables": func(tables []string, all bool) string { + return FormatTables(t.ShowTables, tables, all) + }, + "CronDesc": func(s string) string { + d := DescribeCron(s) + if d != "" { + d = "(" + d + ")" + } + return d + }, + }).Parse(repairTargetTemplate)) + return temp.Execute(w, t) +} + +// BackupTarget is a representing results of dry running backup task. +type BackupTarget struct { + models.BackupTarget + Schedule *Schedule + ShowTables int +} + +const backupTargetTemplate = `{{ if .Schedule.Cron -}} +Cron: {{ .Schedule.Cron }} {{ CronDesc .Schedule.Cron }} +{{ if .Schedule.Timezone -}} +Tz: {{ .Schedule.Timezone }} +{{ end }} +{{ end -}} +Data Centers: +{{ range .Dc }} - {{ . }} +{{ end }} +Keyspaces: +{{- range .Units }} + - {{ .Keyspace }} {{ FormatTables .Tables .AllTables }} +{{- end }} + +Disk size: ~{{ FormatSizeSuffix .Size }} + +Locations: +{{- range .Location }} + - {{ . }} +{{- end }} + +Bandwidth Limits: +{{- if .RateLimit -}} +{{ range .RateLimit }} + - {{ . }} MiB/s +{{- end }} +{{- else }} + - Unlimited +{{- end }} + +Snapshot Parallel Limits: +{{- if .SnapshotParallel -}} +{{- range .SnapshotParallel }} + - {{ . }} +{{- end }} +{{- else }} + - All hosts in parallel +{{- end }} + +Upload Parallel Limits: +{{- if .UploadParallel -}} +{{- range .UploadParallel }} + - {{ . }} +{{- end }} +{{- else }} + - All hosts in parallel +{{- end }} + +Retention Policy: +{{ FormatRetentionPolicy .Retention .RetentionDays }} +` + +// Render implements Renderer interface. +func (t BackupTarget) Render(w io.Writer) error { + temp := template.Must(template.New("target").Funcs(template.FuncMap{ + "FormatSizeSuffix": FormatSizeSuffix, + "FormatTables": func(tables []string, all bool) string { + return FormatTables(t.ShowTables, tables, all) + }, + "CronDesc": func(s string) string { + d := DescribeCron(s) + if d != "" { + d = "(" + d + ")" + } + return d + }, + "FormatRetentionPolicy": FormatRetentionPolicy, + }).Parse(backupTargetTemplate)) + return temp.Execute(w, t) +} + +// RestoreTarget is a representing results of dry running restore task. +type RestoreTarget struct { + models.RestoreTarget + Schedule *Schedule + ShowTables int +} + +const restoreTargetTemplate = `{{ if .Schedule.Cron -}} +Cron: {{ .Schedule.Cron }} {{ CronDesc .Schedule.Cron }} +{{ if .Schedule.Timezone -}} +Tz: {{ .Schedule.Timezone }} +{{ end }} +{{ end -}} +Restored tables: +{{- range .Units }} + - {{ .Keyspace }}: {{ FormatSizeSuffix .Size }} {{ FormatRestoreTables .Tables }} +{{- end }} +{{ if .Views }} +Restored views: +{{- range .Views }} + - {{ .Keyspace }}.{{ .View }} +{{- end }} +{{ end }} +Disk size: ~{{ FormatSizeSuffix .Size }} + +Locations: +{{- range .Location }} + - {{ . }} +{{- end }} + +Snapshot Tag: {{ .SnapshotTag }} +Batch Size: {{ .BatchSize }} +Parallel: {{ .Parallel }} +` + +// Render implements Renderer interface. +func (t RestoreTarget) Render(w io.Writer) error { + temp := template.Must(template.New("target").Funcs(template.FuncMap{ + "FormatSizeSuffix": FormatSizeSuffix, + "FormatRestoreTables": func(tables []*models.RestoreTable) string { + return FormatRestoreTables(t.ShowTables, tables) + }, + "CronDesc": func(s string) string { + d := DescribeCron(s) + if d != "" { + d = "(" + d + ")" + } + return d + }, + }).Parse(restoreTargetTemplate)) + return temp.Execute(w, t) +} + +// TaskListItem is a representation of scheduler.Task with additional fields from scheduler. +type TaskListItem = models.TaskListItem + +// TaskListItemSlice is a representation of a slice of scheduler.Task with additional fields from scheduler. +type TaskListItemSlice = []*models.TaskListItem + +// TaskListItems is a representation of []*scheduler.Task with additional fields from scheduler. +type TaskListItems struct { + TaskListItemSlice + All bool + ShowIDs bool + ShowProps bool +} + +// Render renders TaskListItems in a tabular format. +func (li TaskListItems) Render(w io.Writer) error { + columns := []any{"Task", "Labels", "Schedule", "Window", "Timezone", "Success", "Error", "Last Success", "Last Error", "Status", "Next"} + if li.ShowProps { + columns = append(columns, "Properties") + } + p := table.New(columns...) + for _, t := range li.TaskListItemSlice { + var id string + if t.Name != "" && !li.ShowIDs { + id = taskJoin(t.Type, t.Name) + } else { + id = taskJoin(t.Type, t.ID) + } + if li.All && !t.Enabled { + id = "*" + id + } + + emptySpec := schedules.CronSpecification{} + bytesEmptySpec, err := json.Marshal(emptySpec) + if err != nil { + return errors.New("cannot marshall empty cron specification object") + } + + var schedule string + if t.Schedule.Cron != "" && t.Schedule.Cron != string(bytesEmptySpec) { + var cronSpec schedules.CronSpecification + err := json.Unmarshal([]byte(t.Schedule.Cron), &cronSpec) + if err != nil { + schedule = t.Schedule.Cron + } else { + schedule = cronSpec.Spec + if cronSpec.StartDate.After(timeutc.Now()) { + c := schedules.MustCron(cronSpec.Spec, cronSpec.StartDate) + schedule += fmt.Sprintf(" with first activation after %s", + c.Next(cronSpec.StartDate).Format("2006-01-02 15:04:05")) + } + } + } else if t.Schedule.Interval != "" { + schedule = t.Schedule.Interval + } + + status := t.Status + if status == TaskStatusError && t.Retry > 0 { + status += fmt.Sprintf(" (%d/%d)", t.Retry-1, t.Schedule.NumRetries) + } + + var next string + if t.Suspended { + next = "[SUSPENDED]" + } else { + next = FormatTimePointer(t.NextActivation) + } + + row := []any{ + id, formatLabels(t.Labels), schedule, strings.Join(t.Schedule.Window, ","), t.Schedule.Timezone, + t.SuccessCount, t.ErrorCount, FormatTimePointer(t.LastSuccess), FormatTimePointer(t.LastError), + status, next, + } + if li.ShowProps { + props, ok := t.Properties.(map[string]any) + if !ok { + return errors.New("can't cast task properties into map[string]any") + } + + var fmtProps []string + for k, v := range props { + fmtProps = append(fmtProps, formatKey(k)+": "+formatValue(v)) + } + + row = append(row, strings.Join(fmtProps, ", ")) + } + + p.AddRow(row...) + } + fmt.Fprint(w, p) + + return nil +} + +// Schedule is a scheduler.Schedule representation. +type Schedule = models.Schedule + +// TaskRun is a scheduler.TaskRun representation. +type TaskRun = models.TaskRun + +// TaskRunSlice is a []*scheduler.TaskRun representation. +type TaskRunSlice []*TaskRun + +// Render renders TaskRunSlice in a tabular format. +func (tr TaskRunSlice) Render(w io.Writer, printCause bool) error { + t := table.New("ID", "Start time", "Duration", "Status") + for _, r := range tr { + s := r.Status + if printCause && r.Cause != "" { + t.LimitColumnLength(3) + s += " " + r.Cause + } + t.AddRow(r.ID, FormatTime(r.StartTime), FormatDuration(r.StartTime, r.EndTime), s) + } + if _, err := w.Write([]byte(t.String())); err != nil { + return err + } + return nil +} + +// RepairProgress contains shard progress info. +type RepairProgress struct { + *models.TaskRunRepairProgress + Task *Task + Detailed bool + ShowTables int + + hostFilter inexlist.InExList + keyspaceFilter inexlist.InExList +} + +// SetHostFilter adds filtering rules used for rendering for host details. +func (rp *RepairProgress) SetHostFilter(filters []string) (err error) { + rp.hostFilter, err = inexlist.ParseInExList(filters) + return +} + +// SetKeyspaceFilter adds filtering rules used for rendering for keyspace details. +func (rp *RepairProgress) SetKeyspaceFilter(filters []string) (err error) { + rp.keyspaceFilter, err = inexlist.ParseInExList(filters) + return +} + +// hideKeyspace returns true if provided keyspace should be hidden. +func (rp RepairProgress) hideKeyspace(keyspace string) bool { + if rp.keyspaceFilter.Size() > 0 { + if rp.keyspaceFilter.FirstMatch(keyspace) == -1 { + return true + } + } + return false +} + +func (rp RepairProgress) hideHost(host string) bool { + if rp.hostFilter.Size() > 0 { + return rp.hostFilter.FirstMatch(host) == -1 + } + return false +} + +// Render renders *RepairProgress in a tabular format. +func (rp RepairProgress) Render(w io.Writer) error { + if err := rp.addHeader(w); err != nil { + return err + } + + if rp.Progress == nil { + return nil + } + + t := table.New() + rp.addRepairTableProgress(t) + t.SetColumnAlignment(termtables.AlignRight, 1) + if _, err := io.WriteString(w, t.String()); err != nil { + return err + } + + if rp.Detailed { + for _, h := range rp.Progress.Hosts { + if rp.hideHost(h.Host) { + continue + } + + fmt.Fprintf(w, "\nHost: %s\n", h.Host) + d := table.New() + d.AddRow("Keyspace", "Table", "Progress", "Token Ranges", "Success", "Error", "Started at", "Completed at", "Duration") + d.AddSeparator() + ks := "" + for _, t := range h.Tables { + if rp.hideKeyspace(t.Keyspace) { + continue + } + + if ks == "" { + ks = t.Keyspace + } else if ks != t.Keyspace { + ks = t.Keyspace + d.AddSeparator() + } + + rp.addRepairTableDetailedProgress(d, t) + } + d.SetColumnAlignment(termtables.AlignRight, 2, 3, 4, 5, 6, 7, 8) + if _, err := w.Write([]byte(d.String())); err != nil { + return err + } + } + } + return nil +} + +var repairProgressTemplate = `{{ with .Run -}} +Run: {{ .ID }} +Status: {{ .Status }} +{{- if .Cause }} +Cause: {{ FormatError .Cause }} + +{{- end }} +{{- if not (isZero .StartTime) }} +Start time: {{ FormatTime .StartTime }} +{{- end -}} +{{- if not (isZero .EndTime) }} +End time: {{ FormatTime .EndTime }} +{{- end }} +Duration: {{ FormatDuration .StartTime .EndTime }} +{{- end }} +{{- with .Progress }} +Progress: {{ FormatTotalRepairProgress .SuccessPercentage .ErrorPercentage }} +Intensity: {{ FormatRepairIntensity .Intensity .MaxIntensity }} +Parallel: {{ FormatRepairParallel .Parallel .MaxParallel }} +{{ if .Host }}Host: {{ .Host }} +{{ end -}} +{{ if .Dcs }}Datacenters: {{ range .Dcs }} + - {{ . }} +{{- end }} +{{ end -}} +{{ else }} +Progress: - +{{ end }} +` + +func (rp RepairProgress) addHeader(w io.Writer) error { + temp := template.Must(template.New("repair_progress").Funcs(template.FuncMap{ + "isZero": isZero, + "FormatTime": FormatTime, + "FormatDuration": FormatDuration, + "FormatError": FormatError, + "FormatRepairProgress": FormatRepairProgress, + "FormatTotalRepairProgress": FormatTotalRepairProgress, + "FormatRepairIntensity": FormatRepairIntensity, + "FormatRepairParallel": FormatRepairParallel, + }).Parse(repairProgressTemplate)) + return temp.Execute(w, rp) +} + +func (rp RepairProgress) addRepairTableProgress(d *table.Table) { + if len(rp.Progress.Tables) > 0 { + d.AddRow("Keyspace", "Table", "Progress", "Duration") + d.AddSeparator() + } + + ks := "" + for _, t := range rp.Progress.Tables { + if rp.hideKeyspace(t.Keyspace) { + continue + } + if ks == "" { + ks = t.Keyspace + } else if ks != t.Keyspace { + ks = t.Keyspace + d.AddSeparator() + } + p := "-" + if t.TokenRanges > 0 { + p = FormatRepairProgress(t.TokenRanges, t.Success, t.Error) + } + + d.AddRow(t.Keyspace, t.Table, p, FormatMsDuration(t.DurationMs)) + } +} + +func (rp RepairProgress) addRepairTableDetailedProgress(d *table.Table, t *models.TableRepairProgress) { + d.AddRow(t.Keyspace, + t.Table, + FormatRepairProgress(t.TokenRanges, t.Success, t.Error), + t.TokenRanges, + t.Success, + t.Error, + FormatTimePointer(t.StartedAt), + FormatTimePointer(t.CompletedAt), + FormatMsDuration(t.DurationMs), + ) +} + +// BackupProgress contains shard progress info. +type BackupProgress struct { + *models.TaskRunBackupProgress + Task *Task + Detailed bool + Errors []string + + hostFilter inexlist.InExList + keyspaceFilter inexlist.InExList +} + +// SetHostFilter adds filtering rules used for rendering for host details. +func (bp *BackupProgress) SetHostFilter(filters []string) (err error) { + bp.hostFilter, err = inexlist.ParseInExList(filters) + return +} + +// SetKeyspaceFilter adds filtering rules used for rendering for keyspace details. +func (bp *BackupProgress) SetKeyspaceFilter(filters []string) (err error) { + bp.keyspaceFilter, err = inexlist.ParseInExList(filters) + return +} + +// AggregateErrors collects all errors from the table progress. +func (bp *BackupProgress) AggregateErrors() { + if bp.Progress == nil || bp.Run.Status != TaskStatusError { + return + } + for i := range bp.Progress.Hosts { + for j := range bp.Progress.Hosts[i].Keyspaces { + for _, t := range bp.Progress.Hosts[i].Keyspaces[j].Tables { + if t.Error != "" { + bp.Errors = append(bp.Errors, t.Error) + } + } + } + } +} + +// Render renders *BackupProgress in a tabular format. +func (bp BackupProgress) Render(w io.Writer) error { + if err := bp.addHeader(w); err != nil { + return err + } + + if bp.Progress != nil && bp.Progress.Size > 0 { + t := table.New() + bp.addHostProgress(t) + if _, err := io.WriteString(w, t.String()); err != nil { + return err + } + } + + if bp.Detailed && bp.Progress != nil && bp.Progress.Size > 0 { + if err := bp.addKeyspaceProgress(w); err != nil { + return err + } + } + return nil +} + +func (bp BackupProgress) addHostProgress(t *table.Table) { + t.AddRow("Host", "Progress", "Size", "Success", "Deduplicated", "Failed") + t.AddSeparator() + for _, h := range bp.Progress.Hosts { + if bp.hideHost(h.Host) { + continue + } + p := "-" + if len(h.Keyspaces) > 0 { + p = FormatUploadProgress(h.Size, h.Uploaded, h.Skipped, h.Failed) + } + success := h.Uploaded + h.Skipped + t.AddRow(h.Host, p, + FormatSizeSuffix(h.Size), + FormatSizeSuffix(success), + FormatSizeSuffix(h.Skipped), + FormatSizeSuffix(h.Failed), + ) + } + t.SetColumnAlignment(termtables.AlignRight, 1, 2, 3, 4, 5) +} + +func (bp BackupProgress) addKeyspaceProgress(w io.Writer) error { + for _, h := range bp.Progress.Hosts { + if bp.hideHost(h.Host) { + continue + } + fmt.Fprintf(w, "\nHost: %s\n", h.Host) + + t := table.New("Keyspace", "Table", "Progress", "Size", "Success", "Deduplicated", "Failed", "Started at", "Completed at") + for i, ks := range h.Keyspaces { + if bp.hideKeyspace(ks.Keyspace) { + break + } + if i > 0 { + t.AddSeparator() + } + + rowAdded := false + for _, tbl := range ks.Tables { + startedAt := strfmt.DateTime{} + completedAt := strfmt.DateTime{} + if tbl.StartedAt != nil { + startedAt = *tbl.StartedAt + } + if tbl.CompletedAt != nil { + completedAt = *tbl.CompletedAt + } + success := tbl.Uploaded + tbl.Skipped + t.AddRow( + ks.Keyspace, + tbl.Table, + FormatUploadProgress(tbl.Size, + tbl.Uploaded, + tbl.Skipped, + tbl.Failed), + FormatSizeSuffix(tbl.Size), + FormatSizeSuffix(success), + FormatSizeSuffix(tbl.Skipped), + FormatSizeSuffix(tbl.Failed), + FormatTime(startedAt), + FormatTime(completedAt), + ) + rowAdded = true + } + if !rowAdded { + // Separate keyspaces with no table rows + t.AddRow("-", "-", "-", "-", "-", "-", "-", "-", "-") + } + } + t.SetColumnAlignment(termtables.AlignRight, 2, 3, 4, 5, 6) + if _, err := w.Write([]byte(t.String())); err != nil { + return err + } + } + return nil +} + +func (bp BackupProgress) hideHost(host string) bool { + if bp.hostFilter.Size() > 0 { + return bp.hostFilter.FirstMatch(host) == -1 + } + return false +} + +func (bp BackupProgress) hideKeyspace(keyspace string) bool { + if bp.keyspaceFilter.Size() > 0 { + return bp.keyspaceFilter.FirstMatch(keyspace) == -1 + } + return false +} + +var backupProgressTemplate = `{{ with .Run -}} +Run: {{ .ID }} +Status: {{ status }} +{{- if .Cause }} +Cause: {{ FormatError .Cause }} + +{{- end }} +{{- if not (isZero .StartTime) }} +Start time: {{ FormatTime .StartTime }} +{{- end -}} +{{- if not (isZero .EndTime) }} +End time: {{ FormatTime .EndTime }} +{{- end }} +Duration: {{ FormatDuration .StartTime .EndTime }} +{{ end -}} +{{ with .Progress }}Progress: {{ if ne .Size 0 }}{{ FormatUploadProgress .Size .Uploaded .Skipped .Failed }}{{else}}-{{ end }} +{{- if ne .SnapshotTag "" }} +Snapshot Tag: {{ .SnapshotTag }} +{{- end }} +{{ if .Dcs -}} +Datacenters: {{ range .Dcs }} + - {{ . }} +{{- end }} +{{ end -}} +{{ else }}Progress: 0% +{{ end }} +{{- if .Errors -}} +Errors: {{ range .Errors }} + - {{ . }} +{{- end }} +{{ end }} +` + +func (bp BackupProgress) addHeader(w io.Writer) error { + temp := template.Must(template.New("backup_progress").Funcs(template.FuncMap{ + "isZero": isZero, + "FormatTime": FormatTime, + "FormatDuration": FormatDuration, + "FormatError": FormatError, + "FormatUploadProgress": FormatUploadProgress, + "status": bp.status, + }).Parse(backupProgressTemplate)) + return temp.Execute(w, bp) +} + +// status returns task status with optional backup stage. +func (bp BackupProgress) status() string { + stage := BackupStageName(bp.Progress.Stage) + s := bp.Run.Status + if s != TaskStatusNew && s != TaskStatusDone && stage != "" { + s += " (" + stage + ")" + } + return s +} + +// RestoreProgress contains shard progress info. +type RestoreProgress struct { + *models.TaskRunRestoreProgress + Task *Task + Detailed bool + Errors []string + + KeyspaceFilter inexlist.InExList +} + +var restoreProgressTemplate = `{{ with .Run -}} +Run: {{ .ID }} +Status: {{ status }} +{{- if .Cause }} +Cause: {{ FormatError .Cause }} + +{{- end }} +{{- if not (isZero .StartTime) }} +Start time: {{ FormatTime .StartTime }} +{{- end -}} +{{- if not (isZero .EndTime) }} +End time: {{ FormatTime .EndTime }} +{{- end }} +Duration: {{ FormatDuration .StartTime .EndTime }} +{{ end -}} +{{ with .Progress }}Progress: {{ if ne .Size 0 }}{{ FormatRestoreProgress .Size .Restored .Downloaded .Failed }}{{else}}-{{ end }} +Snapshot Tag: {{ .SnapshotTag }} +{{ else }}Progress: 0% +{{ end }} +{{- if .Errors -}} +Errors: {{ range .Errors }} + - {{ . }} +{{- end }} +{{ end }} +` + +func (rp RestoreProgress) addHeader(w io.Writer) error { + temp := template.Must(template.New("restore_progress").Funcs(template.FuncMap{ + "isZero": isZero, + "FormatTime": FormatTime, + "FormatDuration": FormatDuration, + "FormatError": FormatError, + "FormatRestoreProgress": FormatRestoreProgress, + "status": rp.status, + }).Parse(restoreProgressTemplate)) + return temp.Execute(w, rp) +} + +// status returns task status with optional restore stage. +func (rp RestoreProgress) status() string { + s := rp.Run.Status + if rp.Progress == nil { + return s + } + stage := RestoreStageName(rp.Progress.Stage) + if s != TaskStatusNew && s != TaskStatusDone && stage != "" { + s += " (" + stage + ")" + } + return s +} + +func (rp RestoreProgress) hideKeyspace(keyspace string) bool { + if rp.KeyspaceFilter.Size() > 0 { + return rp.KeyspaceFilter.FirstMatch(keyspace) == -1 + } + return false +} + +// Render renders *RestoreProgress in a tabular format. +func (rp RestoreProgress) Render(w io.Writer) error { + if rp.Progress != nil { + fmt.Fprintf(w, "Restore progress\n") + } + if err := rp.addHeader(w); err != nil { + return err + } + if rp.Progress == nil { + return nil + } + + if rp.Progress.Size > 0 { + t := table.New() + rp.addKeyspaceProgress(t) + if _, err := io.WriteString(w, t.String()); err != nil { + return err + } + } + + if rp.Detailed && rp.Progress.Size > 0 { + if err := rp.addTableProgress(w); err != nil { + return err + } + } + + // Check if there is repair progress to display + if rp.Progress.RepairProgress != nil { + fmt.Fprintf(w, "\nPost-restore repair progress\n") + + repairRunPr := &models.TaskRunRepairProgress{ + Progress: rp.Progress.RepairProgress, + Run: rp.Run, + } + repairPr := RepairProgress{ + TaskRunRepairProgress: repairRunPr, + Task: rp.Task, + Detailed: rp.Detailed, + keyspaceFilter: rp.KeyspaceFilter, + } + + if err := repairPr.Render(w); err != nil { + return err + } + } + + rp.addViewProgress(w) + return nil +} + +func (rp RestoreProgress) addKeyspaceProgress(t *table.Table) { + t.AddRow("Keyspace", "Progress", "Size", "Success", "Downloaded", "Failed") + t.AddSeparator() + for _, ks := range rp.Progress.Keyspaces { + if rp.hideKeyspace(ks.Keyspace) { + continue + } + p := "-" + if len(ks.Tables) > 0 { + p = FormatRestoreProgress(ks.Size, ks.Restored, ks.Downloaded, ks.Failed) + } + t.AddRow(ks.Keyspace, p, + FormatSizeSuffix(ks.Size), + FormatSizeSuffix(ks.Restored), + FormatSizeSuffix(ks.Downloaded), + FormatSizeSuffix(ks.Failed), + ) + } + t.SetColumnAlignment(termtables.AlignRight, 1, 2, 3, 4, 5) +} + +func (rp RestoreProgress) addTableProgress(w io.Writer) error { + for _, ks := range rp.Progress.Keyspaces { + if rp.hideKeyspace(ks.Keyspace) { + continue + } + fmt.Fprintf(w, "\nKeyspace: %s\n", ks.Keyspace) + + t := table.New("Table", "Progress", "Size", "Success", "Downloaded", "Failed", "Started at", "Completed at", "tombstone_gc mode") + for i, tab := range ks.Tables { + if i > 0 { + t.AddSeparator() + } + + startedAt := strfmt.DateTime{} + completedAt := strfmt.DateTime{} + if tab.StartedAt != nil { + startedAt = *tab.StartedAt + } + if tab.CompletedAt != nil { + completedAt = *tab.CompletedAt + } + t.AddRow( + tab.Table, + FormatRestoreProgress(tab.Size, + tab.Restored, + tab.Downloaded, + tab.Failed), + FormatSizeSuffix(tab.Size), + FormatSizeSuffix(tab.Restored), + FormatSizeSuffix(tab.Downloaded), + FormatSizeSuffix(tab.Failed), + FormatTime(startedAt), + FormatTime(completedAt), + tab.TombstoneGc, + ) + } + t.SetColumnAlignment(termtables.AlignRight, 1, 2, 3, 4, 5) + if _, err := w.Write([]byte(t.String())); err != nil { + return err + } + } + return nil +} + +func (rp RestoreProgress) addViewProgress(w io.Writer) { + if len(rp.Progress.Views) == 0 { + return + } + + _, _ = fmt.Fprintf(w, "\nRestored views\n") + for _, v := range rp.Progress.Views { + if rp.Detailed { + _, _ = fmt.Fprintf(w, "View: %s.%s, Status: %s, Schema definition:\n %s\n", v.Keyspace, v.View, v.Status, v.CreateStmt) + } else { + _, _ = fmt.Fprintf(w, "View: %s.%s, Status: %s\n", v.Keyspace, v.View, v.Status) + } + } +} + +// ValidateBackupProgress prints validate_backup task progress. +type ValidateBackupProgress struct { + *models.TaskRunValidateBackupProgress + Task *Task + Detailed bool + + hostFilter inexlist.InExList +} + +// SetHostFilter adds filtering rules used for rendering for host details. +func (p *ValidateBackupProgress) SetHostFilter(filters []string) (err error) { + p.hostFilter, err = inexlist.ParseInExList(filters) + return +} + +func (p ValidateBackupProgress) hideHost(host string) bool { + if p.hostFilter.Size() > 0 { + return p.hostFilter.FirstMatch(host) == -1 + } + return false +} + +// Render implements Renderer interface. +func (p ValidateBackupProgress) Render(w io.Writer) error { + if err := p.addHeader(w); err != nil { + return err + } + if p.Detailed { + if err := p.addHostProgress(w); err != nil { + return err + } + } + + return nil +} + +var validateBackupProgressTemplate = `{{ with .Run -}} +Run: {{ .ID }} +Status: {{ .Status }} +{{- if .Cause }} +Cause: {{ FormatError .Cause }} + +{{- end }} +{{- if not (isZero .StartTime) }} +Start time: {{ FormatTime .StartTime }} +{{- end -}} +{{- if not (isZero .EndTime) }} +End time: {{ FormatTime .EndTime }} +{{- end }} +Duration: {{ FormatDuration .StartTime .EndTime }} +{{ end }} +{{ with progress -}} +Scanned files: {{ .ScannedFiles }} +Missing files: {{ .MissingFiles }} +Orphaned files: {{ .OrphanedFiles }} {{ if gt .OrphanedFiles 0 }}({{ FormatSizeSuffix .OrphanedBytes }}){{ end }} +{{- if gt .DeletedFiles 0 }} +Deleted files: {{ .DeletedFiles }} +{{- end }} +{{- if .BrokenSnapshots }} + +Broken snapshots: {{ range .BrokenSnapshots }} + - {{ . }} +{{- end }} +{{- end }} +{{- end }} +` + +func (p ValidateBackupProgress) addHeader(w io.Writer) error { + temp := template.Must(template.New("validate_backup_progress").Funcs(template.FuncMap{ + "isZero": isZero, + "FormatTime": FormatTime, + "FormatDuration": FormatDuration, + "FormatError": FormatError, + "FormatUploadProgress": FormatUploadProgress, + "FormatSizeSuffix": FormatSizeSuffix, + "progress": p.aggregatedProgress, + }).Parse(validateBackupProgressTemplate)) + return temp.Execute(w, p) +} + +func (p ValidateBackupProgress) aggregatedProgress() models.ValidateBackupProgress { + var a models.ValidateBackupProgress + + bs := strset.New() + for _, i := range p.Progress { + a.Manifests += i.Manifests + a.ScannedFiles += i.ScannedFiles + bs.Add(a.BrokenSnapshots...) + a.MissingFiles += i.MissingFiles + a.OrphanedFiles += i.OrphanedFiles + a.OrphanedBytes += i.OrphanedBytes + a.DeletedFiles += i.DeletedFiles + } + a.BrokenSnapshots = bs.List() + sort.Strings(a.BrokenSnapshots) + + return a +} + +func (p ValidateBackupProgress) addHostProgress(w io.Writer) error { + t := table.New( + "Host", + "Manifests", + "Scanned files", + "Missing files", + "Orphaned files", + "Orphaned bytes", + "Deleted files", + ) + t.SetColumnAlignment(termtables.AlignRight, 1, 2, 3, 4, 5, 6, 7) + lastLocation := "" + + fmt.Fprintln(w) + for _, hp := range p.Progress { + if hp.Location != lastLocation { + if t.Size() > 0 { + fmt.Fprintf(w, "Location: %s\n%s\n", lastLocation, t) + } + t.Reset() + lastLocation = hp.Location + } + if p.hideHost(hp.Host) { + continue + } + t.AddRow( + hp.Host, + hp.Manifests, + hp.ScannedFiles, + hp.MissingFiles, + hp.OrphanedFiles, + FormatSizeSuffix(hp.OrphanedBytes), + hp.DeletedFiles, + ) + } + if t.Size() > 0 { + fmt.Fprintf(w, "Location: %s\n%s\n", lastLocation, t) + } + + return nil +} + +// BackupListItems is a []backup.ListItem representation. +type BackupListItems struct { + items []*models.BackupListItem + AllClusters bool + ShowTables int +} + +const backupListItemTemplate = `backup/{{ .TaskID }} +Snapshots: +{{- range .SnapshotInfo }} + - {{ .SnapshotTag }} ({{ if eq .Size 0 }}n/a{{ else }}{{ FormatSizeSuffix .Size }}{{ end }}, {{ .Nodes }} nodes) +{{- end }} +Keyspaces: +{{- range .Units }} + - {{ .Keyspace }} {{ FormatTables .Tables .AllTables }} +{{- end }} + +` + +// Render implements Renderer interface. +func (bl BackupListItems) Render(w io.Writer) error { + temp := template.Must(template.New("backup_list_items").Funcs(template.FuncMap{ + "FormatTables": func(tables []string, all bool) string { + return FormatTables(bl.ShowTables, tables, all) + }, + "FormatSizeSuffix": FormatSizeSuffix, + }).Parse(backupListItemTemplate)) + + prev := "" + for _, i := range bl.items { + if bl.AllClusters { + if prev != i.ClusterID { + prev = i.ClusterID + fmt.Fprintln(w, "Cluster:", i.ClusterID) + fmt.Fprintln(w) + } + } + if err := temp.Execute(w, i); err != nil { + return err + } + } + return nil +} + +func formatLabels(labels map[string]string) string { + var out []string + for k, v := range labels { + out = append(out, k+"="+v) + } + return strings.Join(out, ", ") +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/restore.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/restore.go new file mode 100644 index 0000000000..8ee2fe2348 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/restore.go @@ -0,0 +1,31 @@ +// Copyright (C) 2017 ScyllaDB + +package managerclient + +// Stage enumeration. +const ( + RestoreStageInit = "INIT" + RestoreStageDropViews = "DROP_VIEWS" + RestoreStageDisableTGC = "DISABLE_TGC" + RestoreStageData = "DATA" + RestoreStageRepair = "REPAIR" + RestoreStageEnableTG = "ENABLE_TGC" + RestoreStageRecreateViews = "RECREATE_VIEWS" + RestoreStageDone = "DONE" +) + +var restoreStageName = map[string]string{ + RestoreStageInit: "initialising", + RestoreStageDropViews: "dropping restored views", + RestoreStageDisableTGC: "disabling restored tables tombstone_gc", + RestoreStageData: "restoring backed-up data", + RestoreStageRepair: "repairing restored tables", + RestoreStageEnableTG: "enabling restored tables tombstone_gc", + RestoreStageRecreateViews: "recreating restored views", + RestoreStageDone: "", +} + +// RestoreStageName returns verbose name for restore stage. +func RestoreStageName(s string) string { + return restoreStageName[s] +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/sizesuffix.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/sizesuffix.go new file mode 100644 index 0000000000..173e2b6513 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/sizesuffix.go @@ -0,0 +1,149 @@ +// Copyright (C) 2017 ScyllaDB +// +// Copyright Rclone https://github.com/rclone/rclone + +package managerclient + +// SizeSuffix is parsed by flag with k/M/G suffixes +import ( + "fmt" + "math" + "sort" + "strconv" + "strings" + + "github.com/pkg/errors" +) + +// SizeSuffix is an int64 with a friendly way of printing setting +type SizeSuffix int64 + +// Common multipliers for SizeSuffix +const ( + Byte SizeSuffix = 1 << (iota * 10) + KibiByte + MebiByte + GibiByte + TebiByte + PebiByte + ExbiByte +) + +// Turn SizeSuffix into a string and a suffix +func (x SizeSuffix) string() (string, string) { + scaled := float64(0) + suffix := "" + switch { + case x < 0: + return "off", "" + case x == 0: + return "0", "" + case x < 1<<10: + scaled = float64(x) + suffix = "" + case x < 1<<20: + scaled = float64(x) / (1 << 10) + suffix = "k" + case x < 1<<30: + scaled = float64(x) / (1 << 20) + suffix = "M" + case x < 1<<40: + scaled = float64(x) / (1 << 30) + suffix = "G" + case x < 1<<50: + scaled = float64(x) / (1 << 40) + suffix = "T" + default: + scaled = float64(x) / (1 << 50) + suffix = "P" + } + if math.Floor(scaled) == scaled { + return fmt.Sprintf("%.0f", scaled), suffix + } + return fmt.Sprintf("%.3f", scaled), suffix +} + +// String turns SizeSuffix into a string +func (x SizeSuffix) String() string { + val, suffix := x.string() + return val + suffix +} + +// Unit turns SizeSuffix into a string with a unit +func (x SizeSuffix) Unit(unit string) string { + val, suffix := x.string() + if val == "off" { + return val + } + return val + " " + suffix + unit +} + +// Set a SizeSuffix +func (x *SizeSuffix) Set(s string) error { + if len(s) == 0 { + return errors.New("empty string") + } + if strings.ToLower(s) == "off" { + *x = -1 + return nil + } + suffix := s[len(s)-1] + suffixLen := 1 + var multiplier float64 + switch suffix { + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.': + suffixLen = 0 + multiplier = 1 << 10 + case 'b', 'B': + multiplier = 1 + case 'k', 'K': + multiplier = 1 << 10 + case 'm', 'M': + multiplier = 1 << 20 + case 'g', 'G': + multiplier = 1 << 30 + case 't', 'T': + multiplier = 1 << 40 + case 'p', 'P': + multiplier = 1 << 50 + default: + return errors.Errorf("bad suffix %q", suffix) + } + s = s[:len(s)-suffixLen] + value, err := strconv.ParseFloat(s, 64) + if err != nil { + return err + } + if value < 0 { + return errors.Errorf("size can't be negative %q", s) + } + value *= multiplier + *x = SizeSuffix(value) + return nil +} + +// Type of the value +func (x *SizeSuffix) Type() string { + return "SizeSuffix" +} + +// Scan implements the fmt.Scanner interface +func (x *SizeSuffix) Scan(s fmt.ScanState, ch rune) error { + token, err := s.Token(true, nil) + if err != nil { + return err + } + return x.Set(string(token)) +} + +// SizeSuffixList is a slice SizeSuffix values +type SizeSuffixList []SizeSuffix + +func (l SizeSuffixList) Len() int { return len(l) } +func (l SizeSuffixList) Swap(i, j int) { l[i], l[j] = l[j], l[i] } +func (l SizeSuffixList) Less(i, j int) bool { return l[i] < l[j] } + +// Sort sorts the list +func (l SizeSuffixList) Sort() { + sort.Sort(l) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/table/table.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/table/table.go new file mode 100644 index 0000000000..314fcef3f7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/table/table.go @@ -0,0 +1,198 @@ +// Copyright (C) 2017 ScyllaDB + +package table + +import ( + "fmt" + "os" + + "github.com/scylladb/termtables" +) + +func init() { + // Select drawing character set for termtables to avoid output bugs. + // See scylladb/scylla-manager#1381. + ascii := os.Getenv("SCTOOL_ASCII_TABLES") + if ascii == "" { + termtables.EnableUTF8PerLocale() + } +} + +var defaultCellStyle = &termtables.CellStyle{ + Alignment: termtables.AlignLeft, + ColSpan: 1, +} + +type colProps struct { + limit bool + width int + alignment termtables.TableAlignment +} + +// Table is a helper type to make it easier to draw tables in the terminal. +type Table struct { + colProps map[int]*colProps + headers []interface{} + rows [][]interface{} + separator []bool +} + +// New creates a new Table. +func New(header ...interface{}) *Table { + cp := make(map[int]*colProps, len(header)) + for i := range header { + cw := cellWidth(header[i]) + cp[i] = &colProps{ + width: cw, + } + } + return &Table{ + colProps: cp, + headers: header, + } +} + +func cellWidth(val interface{}) int { + c := termtables.CreateCell(val, defaultCellStyle) + return c.Width() +} + +// SetColumnAlignment changes the alignment for elements in a column of the table; +// alignments are stored with each cell, so cells added after a call to +// SetColumnAlignment will not pick up the change. +// Columns are numbered from 0. +func (t *Table) SetColumnAlignment(alignment termtables.TableAlignment, cols ...int) { + for _, col := range cols { + if colProp, ok := t.colProps[col]; ok { + colProp.alignment = alignment + } + } +} + +// LimitColumnLength sets column to mask it's content that is overflowing +// length limit by replacing overflow with … character. +// Maximum width is determined by the available space considering total +// terminal width and number of other columns. +func (t *Table) LimitColumnLength(index ...int) { + if t.colProps == nil { + t.colProps = make(map[int]*colProps) + } + for _, i := range index { + _, ok := t.colProps[i] + if !ok { + t.colProps[i] = &colProps{ + limit: true, + } + } else { + t.colProps[i].limit = true + } + } +} + +// AddRow adds another row to the table. +func (t *Table) AddRow(items ...interface{}) *termtables.Row { + for i := range items { + if _, ok := t.colProps[i]; !ok { + t.colProps[i] = &colProps{} + } + w := cellWidth(items[i]) + if w > t.colProps[i].width { + t.colProps[i].width = w + } + } + t.rows = append(t.rows, items) + t.separator = append(t.separator, false) + return nil +} + +// AddSeparator adds a line to the table content, where the line +// consists of separator characters. +func (t *Table) AddSeparator() { + t.separator[len(t.separator)-1] = true +} + +// Size returns number of rows in a table. +func (t *Table) Size() int { + return len(t.rows) +} + +// Reset removes all rows from the table. +func (t *Table) Reset() { + t.rows = nil + t.separator = nil +} + +// Render returns a string representation of a fully rendered table. +func (t *Table) Render() string { + tbl := termtables.CreateTable() + if len(t.headers) > 0 { + tbl.AddHeaders(t.headers...) + } + wl := t.widthLimit() + for i := range t.rows { + row := make([]interface{}, 0, len(t.rows[i])) + for j, item := range t.rows[i] { + if v := t.colProps[j]; v.limit { + item = limitStr(item, wl) + } + row = append(row, item) + } + tbl.AddRow(row...) + if t.separator[i] { + tbl.AddSeparator() + } + } + + for i, colProp := range t.colProps { + // termtables counts columns from 1, we count from 0. + tbl.SetAlign(colProp.alignment, i+1) + } + + return tbl.Render() +} + +func (t *Table) widthLimit() int { + // Init with border and spacing + fixedTotal := len(t.colProps)*3 + 1 + limited := 0 + for _, prop := range t.colProps { + if prop.limit { + limited++ + } else { + fixedTotal += prop.width + } + } + widthLimit := 0 + if limited > 0 { + available := termtables.MaxColumns - fixedTotal + widthLimit = available / limited + } + return widthLimit +} + +// String representation of a fully drawn table. +func (t *Table) String() string { + if len(t.rows) == 0 { + return "" + } + return t.Render() +} + +func limitStr(v interface{}, limit int) string { + var val string + switch v := v.(type) { + case fmt.Stringer: + val = v.String() + case string: + val = v + default: + val = fmt.Sprintf("%v", v) + } + if limit >= len(val) { + return val + } + if limit > 0 { + val = val[:limit-1] + "…" + } + return val +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/tasks.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/tasks.go new file mode 100644 index 0000000000..5695b6b955 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/tasks.go @@ -0,0 +1,37 @@ +// Copyright (C) 2017 ScyllaDB + +package managerclient + +import "github.com/scylladb/go-set/strset" + +// TaskType enumeration. +const ( + BackupTask string = "backup" + RestoreTask string = "restore" + HealthCheckTask string = "healthcheck" + RepairTask string = "repair" + SuspendTask string = "suspend" + ValidateBackupTask string = "validate_backup" +) + +// TasksTypes is a set of all known task types. +var TasksTypes = strset.New( + BackupTask, + RestoreTask, + HealthCheckTask, + RepairTask, + SuspendTask, + ValidateBackupTask, +) + +// Status enumeration. +const ( + TaskStatusNew string = "NEW" + TaskStatusRunning string = "RUNNING" + TaskStatusStopping string = "STOPPING" + TaskStatusStopped string = "STOPPED" + TaskStatusWaiting string = "WAITING" + TaskStatusDone string = "DONE" + TaskStatusError string = "ERROR" + TaskStatusAborted string = "ABORTED" +) diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/utils.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/utils.go new file mode 100644 index 0000000000..4a5fe69f22 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/managerclient/utils.go @@ -0,0 +1,285 @@ +// Copyright (C) 2017 ScyllaDB + +package managerclient + +import ( + "fmt" + "io" + "math" + "net/url" + "path" + "strings" + "time" + + "github.com/go-openapi/strfmt" + "github.com/pkg/errors" + "github.com/scylladb/scylla-manager/v3/pkg/util/timeutc" + "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +const rfc822WithSec = "02 Jan 06 15:04:05 MST" + +// TaskSplit attempts to split a string into task type and ID. +// It accepts task type without ID, and validates task type against TasksTypes. +func TaskSplit(s string) (taskType string, taskID uuid.UUID, taskName string, err error) { + if TasksTypes.Has(s) { + taskType = s + return + } + + i := strings.LastIndex(s, "/") + if i != -1 { + taskType = s[:i] + } else { + taskType = s + } + if !TasksTypes.Has(taskType) { + err = errors.Errorf("unknown task type %s", taskType) + return + } + + txt := s[i+1:] + if id, err := uuid.Parse(txt); err != nil { + taskName = txt + } else { + taskID = id + } + + return +} + +// TaskID creates a string in the form `taskType/taskName` or `taskType/taskID`. +func TaskID(t *Task) string { + id := t.Name + if id == "" { + id = t.ID + } + return taskJoin(t.Type, id) +} + +// taskJoin creates a new type id string in the form `taskType/taskId`. +func taskJoin(taskType string, taskID interface{}) string { + return fmt.Sprint(taskType, "/", taskID) +} + +func uuidFromLocation(location string) (uuid.UUID, error) { + l, err := url.Parse(location) + if err != nil { + return uuid.Nil, err + } + _, id := path.Split(l.Path) + + return uuid.Parse(id) +} + +// FormatRepairProgress returns string representation of percentage of +// successful and error repair ranges. +func FormatRepairProgress(total, success, failed int64) string { + if total == 0 { + return "-" + } + out := fmt.Sprintf("%.f%%", math.Floor(float64(success)*100/float64(total))) + if failed > 0 { + out += fmt.Sprintf("/%.f%%", math.Ceil(float64(failed)*100/float64(total))) + } + return out +} + +// FormatTotalRepairProgress returns string representation of weighted repair progress. +func FormatTotalRepairProgress(successPr, errorPr int64) string { + if successPr < 0 || errorPr < 0 { + return "-" + } + out := fmt.Sprintf("%d%%", successPr) + if errorPr > 0 { + out += fmt.Sprintf("/%d%%", errorPr) + } + return out +} + +// FormatRepairParallel return string representation of currently used and maximal parallel value. +func FormatRepairParallel(parallel, maxParallel int64) string { + if maxParallel <= 0 { + return fmt.Sprint(parallel) + } + if parallel > maxParallel { + parallel = maxParallel + } + if parallel == 0 { + return fmt.Sprintf("%d/%d (max)", maxParallel, maxParallel) + } + return fmt.Sprintf("%d/%d", parallel, maxParallel) +} + +// FormatRepairIntensity return string representation of currently used and maximal intensity value. +func FormatRepairIntensity(intensity, maxIntensity float64) string { + if maxIntensity <= 0 { + return fmt.Sprint(intensity) + } + if intensity > maxIntensity { + intensity = maxIntensity + } + if intensity == 0 { + return fmt.Sprintf("%.0f/%.0f (max)", maxIntensity, maxIntensity) + } + return fmt.Sprintf("%.0f/%.0f", intensity, maxIntensity) +} + +// FormatUploadProgress calculates percentage of success and failed uploads. +func FormatUploadProgress(size, uploaded, skipped, failed int64) string { + if size == 0 { + return "100%" + } + transferred := uploaded + skipped + out := fmt.Sprintf("%.f%%", math.Floor(float64(transferred)*100/float64(size))) + if failed > 0 { + out += fmt.Sprintf("/%.f%%", math.Ceil(float64(failed)*100/float64(size))) + } + return out +} + +// FormatRestoreProgress calculates percentage of success and failed downloads and restores. +func FormatRestoreProgress(size, restored, downloaded, failed int64) string { + if size == 0 { + return "100%" + } + out := fmt.Sprintf("%.f%%", math.Floor(float64(restored)*100/float64(size))) + out += fmt.Sprintf(" | %.f%%", math.Floor(float64(downloaded)*100/float64(size))) + if failed > 0 { + out += fmt.Sprintf(" / failed: %.f%%", math.Ceil(float64(failed)*100/float64(size))) + } + return out +} + +// FormatSizeSuffix returns string printing size with a unit. +func FormatSizeSuffix(b int64) string { + return SizeSuffix(b).String() +} + +// FormatTime formats the supplied DateTime in `02 Jan 06 15:04:05 MST` format. +func FormatTime(t strfmt.DateTime) string { + if isZero(t) { + return "" + } + return time.Time(t).Local().Format(rfc822WithSec) //nolint: gosmopolitan +} + +// FormatTimePointer see FormatTime. +func FormatTimePointer(t *strfmt.DateTime) string { + var tf strfmt.DateTime + if t != nil { + tf = *t + } + return FormatTime(tf) +} + +// FormatDuration creates and formats the duration between +// the supplied DateTime values. +// If t1 is zero it will default to current time. +func FormatDuration(t0, t1 strfmt.DateTime) string { + if isZero(t0) && isZero(t1) { + return "0s" + } + var d time.Duration + if isZero(t1) { + d = timeutc.Now().Sub(time.Time(t0)) + } else { + d = time.Time(t1).Sub(time.Time(t0)) + } + + return d.Truncate(time.Second).String() +} + +// FormatMsDuration returns string representation of duration as number of +// milliseconds. +func FormatMsDuration(d int64) string { + return (time.Duration(d) * time.Millisecond).Truncate(time.Second).String() +} + +func isZero(t strfmt.DateTime) bool { + return time.Time(t).IsZero() +} + +// FormatTables returns tables listing if number of tables is lower than +// threshold. It prints (n tables) or (table_a, table_b, ...). +func FormatTables(threshold int, tables []string, all bool) string { + var out string + if len(tables) == 0 || threshold == 0 || (threshold > 0 && len(tables) > threshold) { + if len(tables) == 1 { + out = "(1 table)" + } else { + out = fmt.Sprintf("(%d tables)", len(tables)) + } + } + if out == "" { + out = "(" + strings.Join(tables, ", ") + ")" + } + if all { + out = "all " + out + } + return out +} + +// FormatRestoreTables returns tables listing if number of tables is lower than +// threshold. It prints (n tables) or (table_a: size_a, table_b: size_b, ...). +func FormatRestoreTables(threshold int, tables []*models.RestoreTable) string { + var out string + if len(tables) == 0 || threshold == 0 || (threshold > 0 && len(tables) > threshold) { + if len(tables) == 1 { + out = "(1 table)" + } else { + out = fmt.Sprintf("(%d tables)", len(tables)) + } + } + if out == "" { + var tableStr []string + for _, t := range tables { + tableStr = append(tableStr, fmt.Sprintf("%s: %s", t.Table, FormatSizeSuffix(t.Size))) + } + + out = "(" + strings.Join(tableStr, ", ") + ")" + } + return out +} + +// FormatClusterName writes cluster name and id to the writer. +func FormatClusterName(w io.Writer, c *Cluster) { + fmt.Fprintf(w, "Cluster: %s (%s)\n", c.Name, c.ID) +} + +// FormatIntensity returns text representation of repair intensity. +func FormatIntensity(v float64) string { + if v == -1 { + return "max" + } + if math.Floor(v) == v { + return fmt.Sprintf("%d", int(v)) + } + return fmt.Sprintf("%.2f", v) +} + +// FormatRetentionPolicy returns text representation of retention policy. +func FormatRetentionPolicy(retention, retentionDays int64) string { + var res string + if retention == 0 && retentionDays == 0 { + res += " - Scylla Manager will not purge any backups created by this task\n" + } + if retention > 0 { + res += " - Last " + if retention == 1 { + res += "backup\n" + } else { + res += fmt.Sprintf("%d backups\n", retention) + } + } + if retentionDays > 0 { + res += fmt.Sprintf(" - Backups not older than %d ", retentionDays) + if retentionDays == 1 { + res += "day\n" + } else { + res += "days\n" + } + } + return res +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/LICENSE b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/LICENSE new file mode 100644 index 0000000000..a155a625fc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/LICENSE @@ -0,0 +1,62 @@ +Scylla SOURCE AVAILABLE LICENSE (SSAL) AGREEMENT Last Update: June 30, 2021 + +This Agreement sets forth the terms on which the Licensor makes available the Software. BY INSTALLING, DOWNLOADING, ACCESSING, USING OR DISTRIBUTING ANY OF THE SOFTWARE, YOU AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO SUCH TERMS AND CONDITIONS, YOU MUST NOT USE THE SOFTWARE. + +If you are receiving the Software on behalf of a legal entity, you represent and warrant that you have the actual authority to agree to the terms and conditions of this agreement on behalf of such entity. + +The terms below have the meanings set forth below for purposes of this Agreement: + +Agreement: this Scylla Source Available License Agreement. + +Database Product: any of the following products or services: + +(a) Scylla Manager; + +(b) a product or service exposing the Scylla Manager API + +License: the Scylla Source Available License described in Section 1. + +Licensor: as indicated in the source code license. + +Modification: a modification of the Software made by You under the License, Section 1.1(c). + +Scylla: the open source Scylla software as described in scylladb.com + +Software: certain software components designed to work with Scylla NoSQL Database and provided to you under this Agreement. + +You: the recipient of this Software, an individual, or the entity on whose behalf you are receiving the Software. + +Your Application: an application developed by or for You, where such application is not a Database Product. + +LICENSE GRANT AND CONDITIONS +1.1 Subject to the terms and conditions of this Section 1, Licensor hereby grants to You a non-exclusive, royalty-free, worldwide, non-transferable license during the term of this Agreement to: + +a) distribute or make available the Software or your Modifications under the terms of this +Agreement, only as part of Your Application, so long as you include the following notice on any copy you distribute: “This software is subject to the terms of the Scylla Source Available License Agreement”. + +(b) use the Software, or your Modifications, only as part of Your Application, but not in connection + +with any Database Product that is distributed or otherwise made available by any third party. + +(c) modify the Software, provided that Modifications remain subject to the terms of this License. + +(d) reproduce the Software as necessary for the above. + +1.3. Notices. + +On all copies of the Software that you make, you must retain all copyright or other proprietary notices. + +TERM AND TERMINATION. +This Agreement will continue unless and until earlier terminated as set forth herein. If You breach any of its conditions or obligations under this Agreement, this Agreement will terminate automatically and the licenses granted herein will terminate automatically. + +INTELLECTUAL PROPERTY. +As between the parties, Licensor retains all right, title, and interest in the Software, and to Scylla or other Licensor trademarks or service marks, and all intellectual property rights therein. Licensor hereby reserves all rights not expressly granted to You in this Agreement. + +DISCLAIMER. +TO THE EXTENT ALLOWABLE UNDER LAW, LICENSOR HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE SOFTWARE. Licensor has no obligation to support the Software. + +LIMITATION OF LIABILITY. TO THE EXTENT ALLOWABLE UNDER LAW, LICENSOR WILL NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND, INCLUDING BUT NOT LIMITED TO, LOST PROFITS OR ANY CONSEQUENTIAL, SPECIAL, INCIDENTAL, INDIRECT, OR DIRECT DAMAGES, ARISING OUT OF OR RELATING TO THIS AGREEMENT. +GENERAL. You are not authorized to assign Your rights under this Agreement to any third party. Licensor may freely assign its rights under this Agreement to any third party. This Agreement is the entire agreement between the parties on the subject matter hereof. No amendment or modification hereof will be valid or binding upon the parties unless made in writing and signed by the duly authorized representatives of both parties. In the event that any provision, including without limitation any condition, of this Agreement is held to be unenforceable, this Agreement and all licenses and rights granted hereunder will immediately terminate. Failure by Licensor to exercise any right hereunder will not be construed as a waiver of any subsequent breach of that right or as a waiver of any other right. This Agreement will be governed by and interpreted in accordance with the laws of the state of California, without reference to its conflict of laws principles. If You are located within the United States, all disputes arising out of this Agreement are subject to the exclusive jurisdiction of courts located in Santa Clara County, California. USA. If You are located outside of the United States, any dispute, controversy or claim arising out of or relating to this Agreement will be referred to and finally determined by arbitration in accordance with the JAMS before a single arbitrator in Santa Clara County, California. Judgment upon the award rendered by the arbitrator may be entered in any court having jurisdiction thereof. + +This license is base on REDIS SOURCE AVAILABLE LICENSE (RSAL) AGREEMENT with some updates +https://redislabs.com/wp-content/uploads/2019/09/redis-source-available-license.pdf diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/certutil/certutil.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/certutil/certutil.go new file mode 100644 index 0000000000..6d545a78e2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/certutil/certutil.go @@ -0,0 +1,74 @@ +// Copyright (C) 2017 ScyllaDB + +package certutil + +import ( + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "crypto/tls" + "crypto/x509" + "crypto/x509/pkix" + "math/big" + "net" + + "github.com/pkg/errors" + "github.com/scylladb/scylla-manager/v3/pkg/util/timeutc" +) + +// GenerateSelfSignedCertificate generates a P256 certificate that can be used +// to start an HTTPS server. +// The certificate is valid for a year after it's generated. +func GenerateSelfSignedCertificate(hosts []string) (tls.Certificate, error) { + var cert tls.Certificate + + priv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err != nil { + return cert, err + } + + serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128) + serialNumber, err := rand.Int(rand.Reader, serialNumberLimit) + if err != nil { + return cert, errors.Wrap(err, "generate serial number") + } + + now := timeutc.Now() + + template := x509.Certificate{ + SerialNumber: serialNumber, + Subject: pkix.Name{ + Organization: []string{"Scylla"}, + }, + NotBefore: now, + NotAfter: now.AddDate(1, 0, 0), + KeyUsage: x509.KeyUsageDigitalSignature, + ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, + BasicConstraintsValid: true, + } + + for i := range hosts { + h, _, err := net.SplitHostPort(hosts[i]) + if err != nil { + h = hosts[i] + } + if ip := net.ParseIP(h); ip != nil { + template.IPAddresses = append(template.IPAddresses, ip) + } else { + template.DNSNames = append(template.DNSNames, h) + } + } + + template.IsCA = true + template.KeyUsage |= x509.KeyUsageCertSign + + derBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv) + if err != nil { + return cert, errors.Wrap(err, "generate certificate") + } + + cert.Certificate = [][]byte{derBytes} + cert.PrivateKey = priv + + return cert, nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/cfgutil/cfgutil.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/cfgutil/cfgutil.go new file mode 100644 index 0000000000..9d3c7f430c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/cfgutil/cfgutil.go @@ -0,0 +1,93 @@ +// Copyright (C) 2017 ScyllaDB + +package cfgutil + +import ( + "os" + "reflect" + + "github.com/pkg/errors" + "go.uber.org/config" +) + +// ParseYAML attempts to load and parse the files given by files and store +// the contents of the files in the struct given by target. +// It will overwrite any conflicting keys by the keys in the subsequent files. +// Missing files will not cause an error but will just be skipped. +// After parsing all files any top level structs which are empty will be +// replaced by their value from def. +func ParseYAML(target, def interface{}, files ...string) error { + opts, err := fileOpts(files) + if err != nil { + return err + } + + if err := parseYaml(target, opts); err != nil { + return err + } + + return mergeZeroStructs(target, def) +} + +func mergeZeroStructs(dst, src interface{}) error { + d := reflect.ValueOf(dst).Elem() + s := reflect.ValueOf(src) + + if d.Type() != s.Type() { + return errors.New("cannot merge structs of differing types") + } + + for i := 0; i < d.NumField(); i++ { + field := d.Field(i) + if field.Kind() == reflect.Struct && field.IsZero() { + field.Set(s.Field(i)) + } + } + + return nil +} + +// PermissiveParseYAML is a variant of ParseYAML that disables gopkg.in/yaml.v2's strict mode +// +// DO NOT USE. +func PermissiveParseYAML(target interface{}, files ...string) error { + opts, err := fileOpts(files) + if err != nil { + return err + } + opts = append(opts, config.Permissive()) + return parseYaml(target, opts) +} + +func parseYaml(target interface{}, opts []config.YAMLOption) error { + cfg, err := config.NewYAML(opts...) + if err != nil { + return err + } + return cfg.Get(config.Root).Populate(target) +} + +func fileOpts(files []string) ([]config.YAMLOption, error) { + var opts []config.YAMLOption + for _, f := range files { + exists, err := fileExists(f) + if err != nil { + return nil, err + } + if exists { + opts = append(opts, config.File(f)) + } + } + return opts, nil +} + +func fileExists(filename string) (bool, error) { + info, err := os.Stat(filename) + if err != nil { + if os.IsNotExist(err) { + return false, nil + } + return false, err + } + return !info.IsDir(), nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/clipper/clipper.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/clipper/clipper.go new file mode 100644 index 0000000000..f085806294 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/clipper/clipper.go @@ -0,0 +1,47 @@ +// Copyright (C) 2017 ScyllaDB + +package clipper + +import ( + "io" + "strings" +) + +var clipperPrefixes = []string{ + ` __ `, + `/ \ `, + `@ @ `, + `| | `, + `|| |/`, + `|| ||`, + `|\_/|`, + `\___/`, +} +var clipperLength = len(clipperPrefixes[0]) + +// Say prints message with clipper asci art. Similar to `cowsay` on linux. +func Say(w io.Writer, lines ...string) error { + const indent = " " + + sb := strings.Builder{} + for i, prefix := range clipperPrefixes { + sb.WriteString(prefix) + // message from second line of clipper + if i != 0 && len(lines) > i-1 { + sb.WriteString(indent) + sb.WriteString(lines[i-1]) + } + sb.WriteRune('\n') + } + for i := len(clipperPrefixes) - 1; i < len(lines); i++ { + for k := 0; k < clipperLength; k++ { + sb.WriteRune(' ') + } + sb.WriteString(indent) + sb.WriteString(lines[i]) + sb.WriteRune('\n') + } + + _, err := io.WriteString(w, sb.String()) + return err +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/cpuset/cpuset.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/cpuset/cpuset.go new file mode 100644 index 0000000000..f12e56a11b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/cpuset/cpuset.go @@ -0,0 +1,94 @@ +// Copyright (C) 2017 ScyllaDB + +package cpuset + +import ( + "bufio" + "os" + "regexp" + "sort" + "strconv" + "strings" + + "github.com/pkg/errors" + "github.com/scylladb/go-set/iset" +) + +const ( + // scyllaConfigFile is a file generated by a Scylla configuration tools, + // it contains additional flags --cpuset and --smp that are passed to + // scylla-server on start. + scyllaConfigFile = "/etc/scylla.d/cpuset.conf" + // cpuSetPattern matches the configuration line in the scyllaConfigFile ex. + // CPUSET="--cpuset 0 --smp 1". + cpuSetPattern = `^\s*CPUSET=\s*\"(?:\s*--cpuset(?:\s*|=)(?P\d+(?:[-,]\d+)*))?(?:\s*--smp(?:\s*|=)(?P\d+))?"` +) + +// ErrNoCPUSetConfig is returned in presence of an empty cpuset.conf file. +var ErrNoCPUSetConfig = errors.New("no CPUSET configuration") + +// ParseScyllaConfigFile returns a list of busy CPUs based on /etc/scylla.d/cpuset.conf +// contents. +func ParseScyllaConfigFile() ([]int, error) { + return parseConfigFile(scyllaConfigFile) +} + +func parseConfigFile(name string) ([]int, error) { + file, err := os.Open(name) + if err != nil { + return nil, err + } + defer file.Close() + + var groups []string + p := regexp.MustCompile(cpuSetPattern) + s := bufio.NewScanner(file) + for s.Scan() { + if m := p.FindStringSubmatch(s.Text()); m != nil { + groups = m + } + } + if err := s.Err(); err != nil { + return nil, err + } + if groups == nil { + return nil, ErrNoCPUSetConfig // nolint: errorlint + } + + idx := 0 + for i, n := range p.SubexpNames() { + if n == "cpuset" { + idx = i + break + } + } + + if groups[idx] == "" { + return nil, errors.New("CPUSET configuration is missing cpuset flag") + } + + return parseCPUSet(groups[idx]) +} + +func parseCPUSet(s string) ([]int, error) { + cpus := iset.New() + + for _, g := range strings.Split(s, ",") { + v := strings.Split(g, "-") + start, err := strconv.ParseInt(v[0], 10, 64) + if err != nil { + return nil, err + } + end, err := strconv.ParseInt(v[len(v)-1], 10, 64) + if err != nil { + return nil, err + } + for i := start; i <= end; i++ { + cpus.Add(int(i)) + } + } + + l := cpus.List() + sort.Ints(l) + return l, nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/cpuset/cpuset_linux.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/cpuset/cpuset_linux.go new file mode 100644 index 0000000000..865c1b32ca --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/cpuset/cpuset_linux.go @@ -0,0 +1,91 @@ +// Copyright (C) 2017 ScyllaDB +//go:build linux +// +build linux + +package cpuset + +import ( + "fmt" + "os" + "strconv" + + "github.com/pkg/errors" + "go.uber.org/multierr" + "golang.org/x/sys/unix" +) + +// AvailableCPUs returns a list of CPUs of length wantCPUs that does not contain +// any of the busyCPUs. If the conditions cannot be met error is returned. +// AvailableCPUs selects the CPUs with the highest available indexes to offload +// shard 0... +func AvailableCPUs(busyCPUs []int) ([]int, error) { + var cpus unix.CPUSet + if err := unix.SchedGetaffinity(os.Getpid(), &cpus); err != nil { + return nil, errors.Wrap(err, "get affinity") + } + for _, c := range busyCPUs { + cpus.Clear(c) + } + + n := cpus.Count() + if n == 0 { + return nil, errors.Errorf("no available CPUs") + } + + return cpulist(&cpus), nil +} + +// SchedSetAffinity makes all of this process threads run on the provided set +// of CPUs only. +func SchedSetAffinity(useCPUs []int) error { + pids, err := osTasks(os.Getpid()) + if err != nil { + return errors.Wrap(err, "get tasks") + } + + return schedSetAffinityToMany(pids, cpuset(useCPUs)) +} + +func schedSetAffinityToMany(pids []int, set *unix.CPUSet) (err error) { + for _, pid := range pids { + err = multierr.Append(unix.SchedSetaffinity(pid, set), errors.Wrapf(err, "pid %d", pid)) + } + return +} + +func cpuset(cpus []int) *unix.CPUSet { + set := &unix.CPUSet{} + set.Zero() + for _, c := range cpus { + set.Set(c) + } + return set +} + +func cpulist(set *unix.CPUSet) []int { + var cpus []int + + n := set.Count() + for i := 0; len(cpus) < n; i++ { + if set.IsSet(i) { + cpus = append(cpus, i) + } + } + + return cpus +} + +func osTasks(pid int) ([]int, error) { + files, err := os.ReadDir(fmt.Sprint("/proc/", pid, "/task")) + if err != nil { + return nil, err + } + + var pids []int + for _, f := range files { + p, _ := strconv.ParseInt(f.Name(), 10, 64) // nolint: errcheck + pids = append(pids, int(p)) + } + + return pids, nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/cpuset/cpuset_others.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/cpuset/cpuset_others.go new file mode 100644 index 0000000000..515685dad5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/cpuset/cpuset_others.go @@ -0,0 +1,19 @@ +// Copyright (C) 2017 ScyllaDB +//go:build !linux +// +build !linux + +package cpuset + +// AvailableCPUs is a no-op implementation for all systems but Linux. +// This is intended for development purposes only. +// Scylla Manager supports only Linux OS. +func AvailableCPUs(cpus []int) ([]int, error) { + return cpus, nil +} + +// SchedSetAffinity is a no-op implementation for all systems but Linux. +// This is intended for development purposes only. +// Scylla Manager supports only Linux OS. +func SchedSetAffinity(useCPUs []int) error { + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/duration.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/duration.go new file mode 100644 index 0000000000..15223ffaf7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/duration.go @@ -0,0 +1,11 @@ +// Copyright (C) 2017 ScyllaDB + +package util + +import "time" + +// EpsilonRange returns start and end of range 5% close to provided value. +func EpsilonRange(d time.Duration) (a, b time.Duration) { + e := time.Duration(float64(d) * 1.05) + return d - e, d + e +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/duration/duration.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/duration/duration.go new file mode 100644 index 0000000000..7a65e3117e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/duration/duration.go @@ -0,0 +1,55 @@ +// Copyright (C) 2017 ScyllaDB + +package duration + +import ( + "time" + + "github.com/gocql/gocql" +) + +// Duration adds marshalling to time.Duration. +type Duration time.Duration + +// MarshalCQL implements gocql.Marshaler. +func (d Duration) MarshalCQL(info gocql.TypeInfo) ([]byte, error) { + return gocql.Marshal(info, int(time.Duration(d).Seconds())) +} + +// UnmarshalCQL implements gocql.Unmarshaler. +func (d *Duration) UnmarshalCQL(info gocql.TypeInfo, data []byte) error { + var t time.Duration + if err := gocql.Unmarshal(info, data, &t); err != nil { + return err + } + *d = Duration(t * time.Second) + return nil +} + +// MarshalText implements text.Marshaller. +func (d Duration) MarshalText() ([]byte, error) { + if d == 0 { + return []byte{}, nil + } + return []byte(d.String()), nil +} + +// UnmarshalText implements text.Marshaller. +func (d *Duration) UnmarshalText(b []byte) error { + if len(b) == 0 { + *d = 0 + return nil + } + + t, err := ParseDuration(string(b)) + if err != nil { + return err + } + *d = t + return nil +} + +// Duration returns this duration as time.Duration. +func (d Duration) Duration() time.Duration { + return time.Duration(d) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/duration/duration_string.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/duration/duration_string.go new file mode 100644 index 0000000000..ded5007617 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/duration/duration_string.go @@ -0,0 +1,153 @@ +// Copyright (C) 2017 ScyllaDB + +// 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. + +// This file contains a modified version of time.Duration String function from +// go stdlib src/time/duration.go file together with all required helper functions. + +package duration + +import "time" + +// String is a modified time.Duration String function that supports printing +// days with d suffix, note that day is equal to 24h. This is not supported by +// time.Duration because of issues with leap year and different time zones. We +// decide to ignore that as we are working with UTC. +// +// The implementation is changed not to print units if value is 0 to keep the +// representation shorter i.e. instead of 7d0h0m0s we print just 7d. +// +// String returns a string representing the duration in the form "72h3m0.5s". +// Leading zero units are omitted. As a special case, durations less than one +// second format use a smaller unit (milli-, micro-, or nanoseconds) to ensure +// that the leading digit is non-zero. The zero duration formats as 0s. +func (d Duration) String() string { + // Largest time is 2540400h10m10.000000000s + var buf [32]byte + w := len(buf) + + u := uint64(d) + neg := d < 0 + if neg { + u = -u + } + + if u < uint64(time.Second) { + // Special case: if duration is smaller than a second, + // use smaller units, like 1.2ms + var prec int + w-- + buf[w] = 's' + w-- + switch { + case u == 0: + return "0s" + case u < uint64(time.Microsecond): + // print nanoseconds + prec = 0 + buf[w] = 'n' + case u < uint64(time.Millisecond): + // print microseconds + prec = 3 + // U+00B5 'µ' micro sign == 0xC2 0xB5 + w-- // Need room for two bytes. + copy(buf[w:], "µ") + default: + // print milliseconds + prec = 6 + buf[w] = 'm' + } + w, u = fmtFrac(buf[:w], u, prec) + w = fmtInt(buf[:w], u) + } else { + w-- + buf[w] = 's' + + w, u = fmtFrac(buf[:w], u, 9) + + // u is now integer seconds + if u%60 != 0 || w != len(buf)-1 { + w = fmtInt(buf[:w], u%60) + } else { + w = len(buf) + } + u /= 60 + + // u is now integer minutes + if u > 0 { + if u%60 != 0 { + w-- + buf[w] = 'm' + w = fmtInt(buf[:w], u%60) + } + u /= 60 + + // u is now integer hours + if u > 0 { + if u%24 != 0 { + w-- + buf[w] = 'h' + w = fmtInt(buf[:w], u%24) + } + u /= 24 + + // u is now integer days + if u > 0 { + w-- + buf[w] = 'd' + w = fmtInt(buf[:w], u) + } + } + } + } + + if neg { + w-- + buf[w] = '-' + } + + return string(buf[w:]) +} + +// fmtFrac formats the fraction of v/10**prec (e.g., ".12345") into the +// tail of buf, omitting trailing zeros. It omits the decimal +// point too when the fraction is 0. It returns the index where the +// output bytes begin and the value v/10**prec. +func fmtFrac(buf []byte, v uint64, prec int) (nw int, nv uint64) { + // Omit trailing zeros up to and including decimal point. + w := len(buf) + print := false + for i := 0; i < prec; i++ { + digit := v % 10 + print = print || digit != 0 + if print { + w-- + buf[w] = byte(digit) + '0' + } + v /= 10 + } + if print { + w-- + buf[w] = '.' + } + return w, v +} + +// fmtInt formats v into the tail of buf. +// It returns the index where the output begins. +func fmtInt(buf []byte, v uint64) int { + w := len(buf) + if v == 0 { + w-- + buf[w] = '0' + } else { + for v > 0 { + w-- + buf[w] = byte(v%10) + '0' + v /= 10 + } + } + return w +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/duration/format.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/duration/format.go new file mode 100644 index 0000000000..c84ebf07fd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/duration/format.go @@ -0,0 +1,181 @@ +// Copyright (C) 2017 ScyllaDB + +// 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. + +// This file contains a modified version of ParseDuration function from +// go stdlib src/time/format.go file together with all required helper functions. + +package duration + +import ( + "errors" + "time" +) + +// unitMap is modified by eliminating ms and below units and by adding d that +// denotes 24 hours. +var unitMap = map[string]int64{ + "s": int64(time.Second), + "m": int64(time.Minute), + "h": int64(time.Hour), + "d": int64(24 * time.Hour), +} + +// ParseDuration parses a duration string. +// A duration string is a possibly signed sequence of +// decimal numbers, each with optional fraction and a unit suffix, +// such as "300ms", "-1.5h" or "2h45m". +// Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". +func ParseDuration(s string) (Duration, error) { // nolint: gocognit + // [-+]?([0-9]*(\.[0-9]*)?[a-z]+)+ + orig := s + var d int64 + neg := false + + // Consume [-+]? + if s != "" { + c := s[0] + if c == '-' || c == '+' { + neg = c == '-' + s = s[1:] + } + } + // Special case: if all that is left is "0", this is zero. + if s == "0" { + return 0, nil + } + if s == "" { + return 0, errors.New("time: invalid duration " + orig) + } + for s != "" { + var ( + v, f int64 // integers before, after decimal point + scale float64 = 1 // value = v + f/scale + ) + + var err error + + // The next character must be [0-9.] + if !(s[0] == '.' || '0' <= s[0] && s[0] <= '9') { + return 0, errors.New("time: invalid duration " + orig) + } + // Consume [0-9]* + pl := len(s) + v, s, err = leadingInt(s) + if err != nil { + return 0, errors.New("time: invalid duration " + orig) + } + pre := pl != len(s) // whether we consumed anything before a period + + // Consume (\.[0-9]*)? + post := false + if s != "" && s[0] == '.' { + s = s[1:] + pl := len(s) + f, scale, s = leadingFraction(s) + post = pl != len(s) + } + if !pre && !post { + // no digits (e.g. ".s" or "-.s") + return 0, errors.New("time: invalid duration " + orig) + } + + // Consume unit. + i := 0 + for ; i < len(s); i++ { + c := s[i] + if c == '.' || '0' <= c && c <= '9' { + break + } + } + if i == 0 { + return 0, errors.New("time: missing unit in duration " + orig) + } + u := s[:i] + s = s[i:] + unit, ok := unitMap[u] + if !ok { + return 0, errors.New("time: unknown unit " + u + " in duration " + orig) + } + if v > (1<<63-1)/unit { + // overflow + return 0, errors.New("time: invalid duration " + orig) + } + v *= unit + if f > 0 { + // float64 is needed to be nanosecond accurate for fractions of hours. + // v >= 0 && (f*unit/scale) <= 3.6e+12 (ns/h, h is the largest unit) + v += int64(float64(f) * (float64(unit) / scale)) + if v < 0 { + // overflow + return 0, errors.New("time: invalid duration " + orig) + } + } + d += v + if d < 0 { + // overflow + return 0, errors.New("time: invalid duration " + orig) + } + } + + if neg { + d = -d + } + return Duration(d), nil +} + +// leadingFraction consumes the leading [0-9]* from s. +// It is used only for fractions, so does not return an error on overflow, +// it just stops accumulating precision. +func leadingFraction(s string) (x int64, scale float64, rem string) { + i := 0 + scale = 1 + overflow := false + for ; i < len(s); i++ { + c := s[i] + if c < '0' || c > '9' { + break + } + if overflow { + continue + } + if x > (1<<63-1)/10 { + // It's possible for overflow to give a positive number, so take care. + overflow = true + continue + } + y := x*10 + int64(c) - '0' + if y < 0 { + overflow = true + continue + } + x = y + scale *= 10 + } + return x, scale, s[i:] +} + +var errLeadingInt = errors.New("time: bad [0-9]*") // never printed + +// leadingInt consumes the leading [0-9]* from s. +func leadingInt(s string) (x int64, rem string, err error) { + i := 0 + for ; i < len(s); i++ { + c := s[i] + if c < '0' || c > '9' { + break + } + if x > (1<<63-1)/10 { + // overflow + return 0, "", errLeadingInt + } + x = x*10 + int64(c) - '0' + if x < 0 { + // overflow + return 0, "", errLeadingInt + } + } + return x, s[i:], nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/errors.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/errors.go new file mode 100644 index 0000000000..464f561c7a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/errors.go @@ -0,0 +1,38 @@ +// Copyright (C) 2017 ScyllaDB + +package util + +import ( + "github.com/gocql/gocql" + "github.com/pkg/errors" +) + +// Common errors. +var ( + ErrNotFound = gocql.ErrNotFound + ErrNilPtr = errors.New("nil") +) + +// errValidate is a validation error caused by inner error. +type errValidate struct { // nolint: errname + err error +} + +// ErrValidate marks error as a validation error, if err is not nil. +func ErrValidate(err error) error { + if err == nil { + return nil + } + return errValidate{err: err} +} + +// IsErrValidate checks if given error is a validation error. +func IsErrValidate(err error) bool { + _, ok := err.(errValidate) // nolint: errorlint + return ok +} + +// Error implements error. +func (e errValidate) Error() string { + return e.err.Error() +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/fsutil/expand.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/fsutil/expand.go new file mode 100644 index 0000000000..1a8e5f115e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/fsutil/expand.go @@ -0,0 +1,43 @@ +// Copyright (C) 2017 ScyllaDB + +package fsutil + +import ( + "os" + "path/filepath" + + "github.com/pkg/errors" +) + +// ExpandPath expands the path to include the home directory if the path +// is prefixed with `~`. If it isn't prefixed with `~`, the path is +// returned as-is. +func ExpandPath(path string) (string, error) { + if path == "" { + return path, nil + } + + if path[0] != '~' { + return path, nil + } + + if len(path) > 1 && path[1] != '/' && path[1] != '\\' { + return "", errors.New("cannot expand user-specific home dir") + } + + home, err := os.UserHomeDir() + if err != nil { + return "", errors.Wrap(err, "get home dir") + } + + return filepath.Join(home, path[1:]), nil +} + +// ReadFile expands path and calls os.ReadFile. +func ReadFile(filename string) ([]byte, error) { + p, err := ExpandPath(filename) + if err != nil { + return nil, err + } + return os.ReadFile(p) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/httplog/log.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/httplog/log.go new file mode 100644 index 0000000000..31cbd1a6e4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/httplog/log.go @@ -0,0 +1,66 @@ +// Copyright (C) 2017 ScyllaDB + +package httplog + +import ( + "fmt" + "net/http" + "time" + + "github.com/go-chi/chi/v5/middleware" + "github.com/scylladb/go-log" +) + +// TraceID adds trace ID to incoming request. +func TraceID(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + r = r.WithContext(log.WithTraceID(r.Context())) + next.ServeHTTP(w, r) + }) +} + +// RequestLogger logs requests and responses. +func RequestLogger(logger log.Logger) func(next http.Handler) http.Handler { + return middleware.RequestLogger(&logFormatter{logger: logger}) +} + +// RequestLoggerSetRequestError adds error to request for rendering. +func RequestLoggerSetRequestError(r *http.Request, err error) { + if le, _ := middleware.GetLogEntry(r).(*logEntry); le != nil { + le.err = err + } +} + +type logFormatter struct { + logger log.Logger +} + +func (lf logFormatter) NewLogEntry(r *http.Request) middleware.LogEntry { + return &logEntry{ + r: r, + l: lf.logger, + } +} + +type logEntry struct { + r *http.Request + l log.Logger + err error +} + +func (le *logEntry) Write(status, bytes int, _ http.Header, elapsed time.Duration, _ interface{}) { + f := []interface{}{ + "from", le.r.RemoteAddr, + "status", status, + "bytes", bytes, + "duration", fmt.Sprintf("%dms", elapsed.Milliseconds()), + } + if le.err != nil { + f = append(f, "error", le.err) + } + le.l.Info(le.r.Context(), le.r.Method+" "+le.r.URL.RequestURI(), f...) +} + +func (le *logEntry) Panic(v interface{}, stack []byte) { + le.l.Error(le.r.Context(), "Panic", "panic", v, "stack", stack) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/httppprof/pprof.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/httppprof/pprof.go new file mode 100644 index 0000000000..ad9aabf581 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/httppprof/pprof.go @@ -0,0 +1,19 @@ +// Copyright (C) 2017 ScyllaDB + +package httppprof + +import ( + "net/http" + "net/http/pprof" +) + +// Handler returns http.Handler serving pprof endpoints. +func Handler() http.Handler { + m := http.NewServeMux() + m.HandleFunc("/debug/pprof/", pprof.Index) + m.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline) + m.HandleFunc("/debug/pprof/profile", pprof.Profile) + m.HandleFunc("/debug/pprof/symbol", pprof.Symbol) + m.HandleFunc("/debug/pprof/trace", pprof.Trace) + return m +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/httpx/clone.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/httpx/clone.go new file mode 100644 index 0000000000..4f8a54588f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/httpx/clone.go @@ -0,0 +1,40 @@ +// Copyright (C) 2017 ScyllaDB + +package httpx + +import ( + "net/http" + "net/url" +) + +// CloneRequest creates a shallow copy of the request along with a deep copy +// of the Headers and URL. +func CloneRequest(req *http.Request) *http.Request { + r := new(http.Request) + + // Shallow clone + *r = *req + + // Copy ctx + r = r.WithContext(req.Context()) + + // Deep copy headers + r.Header = CloneHeader(req.Header) + + // Deep copy URL + r.URL = new(url.URL) + *r.URL = *req.URL + + return r +} + +// CloneHeader creates a deep copy of an http.Header. +func CloneHeader(in http.Header) http.Header { + out := make(http.Header, len(in)) + for key, values := range in { + newValues := make([]string, len(values)) + copy(newValues, values) + out[key] = newValues + } + return out +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/httpx/resp.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/httpx/resp.go new file mode 100644 index 0000000000..b6f56f384b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/httpx/resp.go @@ -0,0 +1,32 @@ +// Copyright (C) 2017 ScyllaDB + +package httpx + +import ( + "bytes" + "fmt" + "io" + "net/http" +) + +// MakeResponse creates a minimal response for a request and status code. +func MakeResponse(req *http.Request, statusCode int) *http.Response { + return &http.Response{ + Status: http.StatusText(statusCode), + StatusCode: statusCode, + Proto: "HTTP/1.1", + ProtoMajor: 1, + ProtoMinor: 1, + Request: req, + Header: make(http.Header), + Body: http.NoBody, + } +} + +// MakeAgentErrorResponse creates an agent error response that can be used in testing. +func MakeAgentErrorResponse(req *http.Request, statusCode int, msg string) *http.Response { + resp := MakeResponse(req, statusCode) + resp.Header.Set("Content-type", "application/json") + resp.Body = io.NopCloser(bytes.NewBufferString(fmt.Sprintf(`{"status": %d, "message": "%s"}`, statusCode, msg))) // nolint: gocritic + return resp +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/httpx/rt.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/httpx/rt.go new file mode 100644 index 0000000000..1cd0aaf06a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/httpx/rt.go @@ -0,0 +1,15 @@ +// Copyright (C) 2017 ScyllaDB + +package httpx + +import "net/http" + +// The RoundTripperFunc type is an adapter to allow the use of ordinary +// functions as RoundTrippers. If f is a function with the appropriate +// signature, RountTripperFunc(f) is a RoundTripper that calls f. +type RoundTripperFunc func(req *http.Request) (*http.Response, error) + +// RoundTrip implements the RoundTripper interface. +func (rt RoundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) { + return rt(r) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/inexlist/dcfilter/dcfilter.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/inexlist/dcfilter/dcfilter.go new file mode 100644 index 0000000000..24a931b18d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/inexlist/dcfilter/dcfilter.go @@ -0,0 +1,45 @@ +// Copyright (C) 2017 ScyllaDB + +package dcfilter + +import ( + "sort" + + "github.com/pkg/errors" + "github.com/scylladb/scylla-manager/v3/pkg/util" + "github.com/scylladb/scylla-manager/v3/pkg/util/inexlist" +) + +// Apply returns DCs matched by the filters. +// If no DCs are found or a filter is invalid a validation error is returned. +func Apply(dcMap map[string][]string, filters []string) ([]string, error) { + dcInclExcl, err := inexlist.ParseInExList(decorate(filters)) + if err != nil { + return nil, err + } + + dcs := make([]string, 0, len(dcMap)) + for dc := range dcMap { + dcs = append(dcs, dc) + } + + // Filter + filtered := dcInclExcl.Filter(dcs) + + // Report error if there is no match + if len(filtered) == 0 { + return nil, util.ErrValidate(errors.Errorf("no matching DCs found for filters %s", filters)) + } + + // Sort lexicographically + sort.Strings(filtered) + + return filtered, nil +} + +func decorate(filters []string) []string { + if len(filters) == 0 { + filters = append(filters, "*") + } + return filters +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/inexlist/inexlist.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/inexlist/inexlist.go new file mode 100644 index 0000000000..600427f49c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/inexlist/inexlist.go @@ -0,0 +1,109 @@ +// Copyright (C) 2017 ScyllaDB + +package inexlist + +import ( + "fmt" + "strings" + + "github.com/gobwas/glob" + "github.com/pkg/errors" + "github.com/scylladb/scylla-manager/v3/pkg/util" +) + +type sign bool + +func (s sign) String() string { + if s { + return "" + } + return "!" +} + +type signedPattern struct { + Sign sign + Pattern string + g glob.Glob +} + +// InExList is an include/exclude list that can filter string slices based on +// a given set of glob patterns. +type InExList struct { + patterns []string + list []signedPattern +} + +func (sp signedPattern) String() string { + return fmt.Sprintf("%s%s", sp.Sign, sp.Pattern) +} + +// ParseInExList takes a list of patterns such as +// [keyspace_1.table_1 !keyspace_1.table_2] and parses it into executable rules. +// If any of the glob pattern is invalid an error is returned. +func ParseInExList(patterns []string) (InExList, error) { + inExList := InExList{ + patterns: patterns, + } + + parsed := make([]signedPattern, 0, len(patterns)) + + for i, p := range patterns { + p = strings.TrimSpace(p) + if p == "" { + continue + } + s := !strings.HasPrefix(p, "!") + p = strings.TrimLeft(p, "!") + g, err := glob.Compile(p) + if err != nil { + return InExList{}, util.ErrValidate(errors.Errorf("invalid glob p on position %d: %s", i, p)) + } + parsed = append(parsed, signedPattern{Sign: sign(s), Pattern: p, g: g}) + } + + inExList.list = parsed + + return inExList, nil +} + +// Filter simply applies the rules to the supplied list of strings. +// If an earlier rule excludes a given entry a succeeding rule can later add it back. +func (ie InExList) Filter(in []string) []string { + if len(ie.patterns) == 0 { + return in + } + + var out []string + + for _, v := range in { + ok := false + for _, p := range ie.list { + if p.g.Match(v) { + ok = bool(p.Sign) + } + } + if ok { + out = append(out, v) + } + } + + return out +} + +// FirstMatch takes a string and tries to find a matching rule and +// if it finds one the position of that rule is returned. +// If no matching rule is found then -1 is returned. +func (ie InExList) FirstMatch(s string) int { + for i, sp := range ie.list { + if bool(sp.Sign) && sp.g.Match(s) { + return i + } + } + + return -1 +} + +// Size returns the number of patterns. +func (ie InExList) Size() int { + return len(ie.list) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/inexlist/ksfilter/ksfilter.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/inexlist/ksfilter/ksfilter.go new file mode 100644 index 0000000000..a6b46b6953 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/inexlist/ksfilter/ksfilter.go @@ -0,0 +1,182 @@ +// Copyright (C) 2017 ScyllaDB + +package ksfilter + +import ( + "sort" + "strings" + + "github.com/pkg/errors" + "github.com/scylladb/scylla-manager/v3/pkg/util" + "github.com/scylladb/scylla-manager/v3/pkg/util/inexlist" + "go.uber.org/multierr" +) + +// Unit specifies keyspace and it's tables. +type Unit struct { + Keyspace string + Tables []string + AllTables bool +} + +// Filter is a builder that let's you filter keyspaces and tables by adding them +// on keyspace by keyspace basis. +type Filter struct { + filters []string + inex inexlist.InExList + units []Unit + keyspaces []string +} + +func NewFilter(filters []string) (*Filter, error) { + // Validate filters + var errs error + for i, f := range filters { + err := validate(filters[i]) + if err != nil { + errs = multierr.Append(errs, errors.Wrapf(err, "%q on position %d", f, i)) + continue + } + } + if errs != nil { + return nil, util.ErrValidate(errors.Wrap(errs, "invalid filters")) + } + + // Decorate filters and create inexlist + inex, err := inexlist.ParseInExList(decorate(filters)) + if err != nil { + return nil, err + } + + return &Filter{ + filters: filters, + inex: inex, + }, nil +} + +func validate(filter string) error { + if filter == "*" || filter == "!*" { + return nil + } + if strings.HasPrefix(filter, ".") { + return errors.New("missing keyspace") + } + return nil +} + +func decorate(filters []string) []string { + if len(filters) == 0 { + filters = append(filters, "*.*") + } + + for i, f := range filters { + if strings.Contains(f, ".") { + continue + } + if strings.HasSuffix(f, "*") { + filters[i] = strings.TrimSuffix(f, "*") + "*.*" + } else { + filters[i] += ".*" + } + } + + return filters +} + +// Add filters the keyspace and tables, if they match it adds a new unit to the +// Filter. +func (f *Filter) Add(keyspace string, tables []string) { + // Add prefix + prefix := keyspace + "." + for i := 0; i < len(tables); i++ { + tables[i] = prefix + tables[i] + } + + // Filter + filtered := f.inex.Filter(tables) + + // No data, skip the keyspace + if len(filtered) == 0 { + return + } + + // Remove prefix + for i := 0; i < len(filtered); i++ { + filtered[i] = strings.TrimPrefix(filtered[i], prefix) + } + + // Add unit + u := Unit{ + Keyspace: keyspace, + Tables: filtered, + AllTables: len(filtered) == len(tables), + } + f.units = append(f.units, u) + + f.keyspaces = append(f.keyspaces, keyspace) +} + +// Check returns true iff table matches filter. +func (f *Filter) Check(keyspace, table string) bool { + key := keyspace + "." + table + return len(f.inex.Filter([]string{key})) > 0 +} + +// Apply returns the resulting units. The units are sorted by position of a +// first match in the filters. +// If no units are found or a filter is invalid a validation error is returned. +// The validation error may be disabled by providing the force=true. +func (f *Filter) Apply(force bool) ([]Unit, error) { + if len(f.units) == 0 && !force { + return nil, util.ErrValidate(errors.Errorf("no keyspace matched criteria %s - available keyspaces are: %s", f.filters, f.keyspaces)) + } + + // Sort units by the presence + sortUnits(f.units, f.inex) + + return f.units, nil +} + +func sortUnits(units []Unit, inclExcl inexlist.InExList) { + positions := make(map[string]int) + for _, u := range units { + min := inclExcl.Size() + for _, t := range u.Tables { + if p := inclExcl.FirstMatch(u.Keyspace + "." + t); p >= 0 && p < min { + min = p + } + } + positions[u.Keyspace] = min + } + + sort.Slice(units, func(i, j int) bool { + // order by position + switch { + case positions[units[i].Keyspace] < positions[units[j].Keyspace]: + return true + case positions[units[i].Keyspace] > positions[units[j].Keyspace]: + return false + default: + // promote system keyspaces + l := strings.HasPrefix(units[i].Keyspace, "system") + r := strings.HasPrefix(units[j].Keyspace, "system") + switch { + case l && !r: + return true + case !l && r: + return false + default: + // order by name + return units[i].Keyspace < units[j].Keyspace + } + } + }) +} + +// Filters returns the original filters used to create the instance. +func (f *Filter) Filters() []string { + if f == nil { + return nil + } + return f.filters +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/jsonutil/set.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/jsonutil/set.go new file mode 100644 index 0000000000..cf0eb299f2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/jsonutil/set.go @@ -0,0 +1,21 @@ +// Copyright (C) 2017 ScyllaDB + +package jsonutil + +import ( + "encoding/json" +) + +// Set returns a copy of the message where key=value. +func Set(msg json.RawMessage, key string, value interface{}) json.RawMessage { + m := map[string]interface{}{} + if err := json.Unmarshal(msg, &m); err != nil { + panic(err) + } + m[key] = value + v, err := json.Marshal(m) + if err != nil { + panic(err) + } + return v +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/logutil/logutil.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/logutil/logutil.go new file mode 100644 index 0000000000..605f81cc0a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/logutil/logutil.go @@ -0,0 +1,17 @@ +// Copyright (C) 2024 ScyllaDB + +package logutil + +import ( + "context" + + "github.com/scylladb/go-log" +) + +// LogOnError logs provided msg and keyvals only when f results encounters error. +// It's useful for logging resource cleanup errors that don't directly influence function execution. +func LogOnError(ctx context.Context, log log.Logger, f func() error, msg string, keyvals ...interface{}) { + if err := f(); err != nil { + log.Error(ctx, msg, append(append([]any{}, keyvals...), "error", err)...) + } +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/maputil/map.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/maputil/map.go new file mode 100644 index 0000000000..6ae9e5234e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/maputil/map.go @@ -0,0 +1,16 @@ +// Copyright (C) 2024 ScyllaDB + +package maputil + +// Equal checks if m1 and m2 are the same mapping. +func Equal[K, V comparable](m1, m2 map[K]V) bool { + if len(m1) != len(m2) { + return false + } + for k, v1 := range m1 { + if v2, ok := m2[k]; !ok || v1 != v2 { + return false + } + } + return true +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/netwait/netwait.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/netwait/netwait.go new file mode 100644 index 0000000000..b334825f21 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/netwait/netwait.go @@ -0,0 +1,122 @@ +// Copyright (C) 2017 ScyllaDB + +package netwait + +import ( + "context" + "net" + "time" + + "github.com/pkg/errors" + "github.com/scylladb/go-log" + "go.uber.org/multierr" +) + +// AnyAddr tries to open a TCP connection to any of the provided addresses, +// returns first address it could connect to. +func AnyAddr(ctx context.Context, addr ...string) (string, error) { + return DefaultWaiter.WaitAnyAddr(ctx, addr...) +} + +// AnyHostPort tries to connect to any of the hosts, returns first host if +// could connect to over the given port. +func AnyHostPort(ctx context.Context, hosts []string, port string) (string, error) { + return DefaultWaiter.WaitAnyHostPort(ctx, hosts, port) +} + +// Waiter specifies waiting parameters. +type Waiter struct { + DialTimeout time.Duration + RetryBackoff time.Duration + MaxAttempts int + Logger log.Logger +} + +var DefaultWaiter = Waiter{ + DialTimeout: 1 * time.Second, + RetryBackoff: 2 * time.Second, + MaxAttempts: 60, +} + +// WaitAnyAddr tries to open a TCP connection to any of the provided addresses, +// returns first address it could connect to. +func (w Waiter) WaitAnyAddr(ctx context.Context, addr ...string) (string, error) { + t := time.NewTimer(w.RetryBackoff) + defer t.Stop() + + var ( + a string + err error + ) + for i := 0; i < w.MaxAttempts; i++ { + t.Reset(w.RetryBackoff) + + a, err = tryConnectToAny(addr, w.DialTimeout) + + if err != nil { + w.Logger.Info(ctx, "Waiting for network connection", + "sleep", w.RetryBackoff, + "error", err, + ) + select { + case <-t.C: + continue + case <-ctx.Done(): + return "", err + } + } + + return a, nil + } + + return "", errors.Wrapf(err, "giving up after %d attempts", w.MaxAttempts) +} + +// tryConnectToAny tries to open a TCP connection to any of the provided +// addresses, attempts are sequential, it returns first successful address or +// error if failed to connect to any address. +func tryConnectToAny(addrs []string, timeout time.Duration) (string, error) { + var errs error + + for _, addr := range addrs { + var conn net.Conn + var err error + + if timeout != 0 { + conn, err = net.DialTimeout("tcp", addr, timeout) + } else { + conn, err = net.Dial("tcp", addr) + } + + if conn != nil { + conn.Close() + } + if err == nil { + return addr, nil + } + errs = multierr.Append(errs, err) + } + + return "", errs +} + +// WaitAnyHostPort tries to connect to any of the hosts, returns first host if +// could connect to over the given port. +func (w Waiter) WaitAnyHostPort(ctx context.Context, hosts []string, port string) (string, error) { + addr, err := w.WaitAnyAddr(ctx, joinHostsPort(hosts, port)...) + if err != nil { + return addr, err + } + + // Extract host from address before returning + host, _, _ := net.SplitHostPort(addr) + return host, nil +} + +func joinHostsPort(hosts []string, port string) []string { + out := make([]string, len(hosts)) + for i, h := range hosts { + out[i] = net.JoinHostPort(h, port) + } + return out +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/osutil/osutil.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/osutil/osutil.go new file mode 100644 index 0000000000..9985831d0a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/osutil/osutil.go @@ -0,0 +1,159 @@ +// Copyright (C) 2017 ScyllaDB + +package osutil + +import ( + "bufio" + "bytes" + "io" + "os" + "os/exec" + "regexp" + "strings" + + "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" +) + +// Distro is string representation of the linux distribution. +type Distro string + +const ( + // Amazon Linux distribution id. + Amazon Distro = "amzn" + // Centos Linux distribution id. + Centos Distro = "centos" + // Debian Linux distribution id. + Debian Distro = "debian" + // Fedora Linux distribution id. + Fedora Distro = "fedora" + // Rehl Red Hat Linux distribution id. + Rehl Distro = "rehl" + // Ubuntu Linux distribution id. + Ubuntu Distro = "ubuntu" + // Unknown distro. + Unknown Distro = "unknown" +) + +// osReleaseFile used for override in tests. +var osReleaseFile = "/etc/os-release" + +// LinuxDistro returns Linux distribution id. +// Common ids are defined as constants. +// Unknown is returned if distro can't be detected. +func LinuxDistro() Distro { + f, err := os.Open(osReleaseFile) + if err != nil { + return Unknown + } + defer f.Close() + s := bufio.NewScanner(f) + release := "unknown" + for s.Scan() { + l := s.Text() + if strings.HasPrefix(l, "ID=") { + release = strings.Trim(l[3:], `"`) + break + } + } + return Distro(release) +} + +// dockerEnvFile used for override in tests. +var dockerEnvFile = "/.dockerenv" + +// cGroupFile used for override in tests. +var cGroupFile = "/proc/1/cgroup" + +// Docker returns true if application is running inside docker environment. +// Tests presence of "/.dockerenv" file or "docker|lxc" in /proc/1/cgroup. +func Docker() bool { + if f, err := os.Open(dockerEnvFile); err == nil { + f.Close() + return true + } + if f, err := os.Open(cGroupFile); err == nil { + defer f.Close() + b, err := io.ReadAll(f) + if err != nil { + return false + } + if bytes.Contains(b, []byte("docker")) || bytes.Contains(b, []byte("lxc")) { + return true + } + } + + return false +} + +// macUUIDFile used for override in tests. +var macUUIDFile = "/var/tmp/scylla-manager-macuuid" + +// MacUUID returns unique id of the machine that application is running on. +// Implementation is using file to generate this value. +// If the file system is/ not persistent like in Docker it will be different +// every time this file is removed. +func MacUUID() uuid.UUID { + f, err := os.Open(macUUIDFile) + if err != nil { + macUUID := uuid.NewTime() + f, err := os.OpenFile(macUUIDFile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, os.ModePerm) + if err != nil { + return uuid.Nil + } + n, err := f.WriteString(macUUID.String()) + if err == nil && n < len(macUUID.String()) { + return uuid.Nil + } + if err := f.Close(); err != nil { + return uuid.Nil + } + return macUUID + } + defer f.Close() + out, err := io.ReadAll(f) + if err != nil { + return uuid.Nil + } + id, err := uuid.Parse(string(out)) + if err != nil { + return uuid.Nil + } + return id +} + +var ( + // regExecCommand used for override in tests. + regExecCommand = func(name string, args ...string) ([]byte, error) { + cmd := exec.Command(name, args...) + return cmd.CombinedOutput() + } + // Sample repository URL: + // https://repositories.scylladb.com/scylla/downloads/scylladb/f3d53efa-ee7e-4f4e-9d4b-7ee6b9ea48da/scylla-manager/rpm/centos/scylladb-manager-1.3 + idRegex = regexp.MustCompile("(?s)scylladb/([a-z0-9-]+)/scylla-manager") +) + +// RegUUID extracts registration id from scylla-manager package repositories. +func RegUUID() uuid.UUID { + var out []byte + var err error + switch LinuxDistro() { + case Ubuntu, Debian: + out, err = regExecCommand("apt-cache", "policy", "scylla-manager-server") + case Amazon, Rehl, Centos, Fedora: + out, err = regExecCommand("repoquery", "-a", "--nolock", "--location", "scylla-manager-server") + default: + return uuid.Nil + } + if err != nil { + return uuid.Nil + } + match := idRegex.FindStringSubmatch(string(out)) + if len(match) < 2 { + return uuid.Nil + } + id, err := uuid.Parse(match[1]) + if err != nil { + return uuid.Nil + } + return id +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/parallel/parallel.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/parallel/parallel.go new file mode 100644 index 0000000000..2754865178 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/parallel/parallel.go @@ -0,0 +1,95 @@ +// Copyright (C) 2017 ScyllaDB + +package parallel + +import ( + "go.uber.org/atomic" +) + +// NoLimit means full parallelism mode. +const NoLimit = 0 + +// ErrAbort is a special kind of error that aborts all further execution. +// Function calls that are in progress will continue to execute but no new +// functions will be called. +type ErrAbort struct { + error +} + +// Abort is special kind of error that aborts all further execution. +func Abort(err error) ErrAbort { + return ErrAbort{error: err} +} + +func isErrAbort(err error) (bool, error) { + a, ok := err.(ErrAbort) // nolint: errorlint + if !ok { + return false, nil + } + return true, a.error +} + +// NopNotify does not perform any operation when encountering an error during Run. +func NopNotify(int, error) {} + +// Run executes function f with arguments ranging from 0 to n-1 executing at +// most limit in parallel. +// If limit is 0 it runs f(0),f(1),...,f(n-1) in parallel. +// Notify is called when worker i encounters error err. +func Run(n, limit int, f func(i int) error, notify func(i int, err error)) error { + if n == 0 { + return nil + } + if n == 1 { + return f(0) + } + + if limit <= 0 || limit > n { + limit = n + } + + var ( + idx = atomic.NewInt32(0) + out = make(chan error) + abrt = atomic.NewBool(false) + ) + for j := 0; j < limit; j++ { + go func() { + for { + // Exit when there is nothing to do + i := int(idx.Inc()) - 1 + if i >= n { + return + } + + // Exit if aborted + if abrt.Load() { + out <- nil + continue + } + + // Execute + err := f(i) + if ok, inner := isErrAbort(err); ok { + abrt.Store(true) + err = inner + } + out <- err + if err != nil { + notify(i, err) + } + } + }() + } + + var retErr error + for i := 0; i < n; i++ { + err := <-out + // Appending all errors reduces readability, so it's enough to return only one of them + // (the other errors has already been logged via notify). + if retErr == nil { + retErr = err + } + } + return retErr +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/pathparser/parser.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/pathparser/parser.go new file mode 100644 index 0000000000..c3d25f26f7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/pathparser/parser.go @@ -0,0 +1,83 @@ +// Copyright (C) 2017 ScyllaDB + +package pathparser + +import ( + "strings" + + "github.com/pkg/errors" + "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" +) + +// PathParser can be used to parse parts of string separated by provided sep. +type PathParser struct { + value string + sep string +} + +// New returns instance of PathParser. +func New(v, sep string) *PathParser { + return &PathParser{ + value: v, + sep: sep, + } +} + +// Parser describes interface of part parser, user can implement his own parsers. +// PartGetter is used for part retrieval, single parser may consume multiple parts. +type Parser func(string) error + +// Parse iterates over provided parsers which consumes string parts. +func (p PathParser) Parse(parsers ...Parser) (int, error) { + parts := strings.Split(p.value, p.sep) + for i, p := range parsers { + if i >= len(parts) { + return i, nil + } + if err := p(parts[i]); err != nil { + return i, errors.Wrapf(err, "invalid path element at position %d", i) + } + } + return len(parsers), nil +} + +// ID parser saves UUID value under given ptr. +func ID(ptr *uuid.UUID) Parser { + return func(v string) error { + return ptr.UnmarshalText([]byte(v)) + } +} + +// String parser saves string under given ptr. +func String(ptr *string) Parser { + return func(v string) error { + *ptr = v + return nil + } +} + +// Static validates a path part is one of the provided values. +func Static(s ...string) Parser { + if len(s) == 0 { + panic("Expected list of values") + } + return func(v string) error { + if len(s) == 1 { + if v != s[0] { + return errors.Errorf("expected %s got %s", s[0], v) + } + } else { + var ok bool + for i := range s { + if v == s[i] { + ok = true + break + } + } + if !ok { + return errors.Errorf("expected one of %s got %s", s, v) + } + } + return nil + } +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/pointer/pointer.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/pointer/pointer.go new file mode 100644 index 0000000000..c0733d36e9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/pointer/pointer.go @@ -0,0 +1,103 @@ +// Copyright (C) 2017 ScyllaDB + +package pointer + +import "time" + +// Int32Ptr returns a pointer to an int32. +func Int32Ptr(i int32) *int32 { + return &i +} + +// Int32PtrDerefOr dereference the int32 ptr and returns it if not nil, +// else returns def. +func Int32PtrDerefOr(ptr *int32, def int32) int32 { + if ptr != nil { + return *ptr + } + return def +} + +// Int64Ptr returns a pointer to an int64. +func Int64Ptr(i int64) *int64 { + return &i +} + +// Int64PtrDerefOr dereference the int64 ptr and returns it if not nil, +// else returns def. +func Int64PtrDerefOr(ptr *int64, def int64) int64 { + if ptr != nil { + return *ptr + } + return def +} + +// BoolPtr returns a pointer to a bool. +func BoolPtr(b bool) *bool { + return &b +} + +// BoolPtrDerefOr dereference the bool ptr and returns it if not nil, +// else returns def. +func BoolPtrDerefOr(ptr *bool, def bool) bool { + if ptr != nil { + return *ptr + } + return def +} + +// StringPtr returns a pointer to the passed string. +func StringPtr(s string) *string { + return &s +} + +// StringPtrDerefOr dereference the string ptr and returns it if not nil, +// else returns def. +func StringPtrDerefOr(ptr *string, def string) string { + if ptr != nil { + return *ptr + } + return def +} + +// Float32Ptr returns a pointer to the passed float32. +func Float32Ptr(i float32) *float32 { + return &i +} + +// Float32PtrDerefOr dereference the float32 ptr and returns it if not nil, +// else returns def. +func Float32PtrDerefOr(ptr *float32, def float32) float32 { + if ptr != nil { + return *ptr + } + return def +} + +// Float64Ptr returns a pointer to the passed float64. +func Float64Ptr(i float64) *float64 { + return &i +} + +// Float64PtrDerefOr dereference the float64 ptr and returns it if not nil, +// else returns def. +func Float64PtrDerefOr(ptr *float64, def float64) float64 { + if ptr != nil { + return *ptr + } + return def +} + +// TimePtr returns a pointer to the passed Time. +func TimePtr(i time.Time) *time.Time { + return &i +} + +// TimePtrDerefOr dereference the time.Time ptr and returns it if not nil, +// else returns def. +func TimePtrDerefOr(ptr *time.Time, def time.Time) time.Time { + if ptr != nil { + return *ptr + } + return def +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/prom/parse.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/prom/parse.go new file mode 100644 index 0000000000..c919a7eb4c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/prom/parse.go @@ -0,0 +1,19 @@ +// Copyright (C) 2017 ScyllaDB + +package prom + +import ( + "io" + + dto "github.com/prometheus/client_model/go" + "github.com/prometheus/common/expfmt" +) + +// MetricFamily represent single prometheus metric. +type MetricFamily = dto.MetricFamily + +// ParseText parses text format of prometheus metrics from input reader. +func ParseText(r io.Reader) (map[string]*MetricFamily, error) { + var p expfmt.TextParser + return p.TextToMetricFamilies(r) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/query/query.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/query/query.go new file mode 100644 index 0000000000..006738b93c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/query/query.go @@ -0,0 +1,110 @@ +// Copyright (C) 2023 ScyllaDB + +package query + +import ( + "fmt" + "strings" + + "github.com/gocql/gocql" + "github.com/pkg/errors" + "github.com/scylladb/go-set/strset" + "github.com/scylladb/gocqlx/v2" + "github.com/scylladb/gocqlx/v2/qb" + "github.com/scylladb/scylla-manager/v3/pkg/util/uuid" +) + +// GetAllViews returns set of all views present in cluster. +func GetAllViews(s gocqlx.Session) (*strset.Set, error) { + q := qb.Select("system_schema.views"). + Columns("keyspace_name", "view_name"). + Query(s) + defer q.Release() + iter := q.Iter() + + views := strset.New() + var keyspace, view string + for iter.Scan(&keyspace, &view) { + views.Add(keyspace + "." + view) + } + + return views, iter.Close() +} + +// GetTableVersion returns given table version. +func GetTableVersion(s gocqlx.Session, keyspace, table string) (string, error) { + q := qb.Select("system_schema.tables"). + Columns("id"). + Where(qb.Eq("keyspace_name"), qb.Eq("table_name")). + Query(s). + Bind(keyspace, table) + + defer q.Release() + + var version string + if err := q.Scan(&version); err != nil { + return "", err + } + // Table's version is stripped of '-' characters + version = strings.ReplaceAll(version, "-", "") + + return version, nil +} + +// DescribedSchema describes output of DESCRIBE SCHEMA WITH INTERNALS. +type DescribedSchema []DescribedSchemaRow + +// DescribedSchemaRow describes a single row returned by DESCRIBE SCHEMA WITH INTERNALS. +type DescribedSchemaRow struct { + Keyspace string `json:"keyspace"` + Type string `json:"type"` + Name string `json:"name"` + CQLStmt string `json:"cql_stmt"` +} + +// DescribeSchemaWithInternals returns the output of DESCRIBE SCHEMA WITH INTERNALS query parsed into DescribedSchema. +func DescribeSchemaWithInternals(session gocqlx.Session) (DescribedSchema, error) { + it := session.Query("DESCRIBE SCHEMA WITH INTERNALS", nil).Iter() + var ks, t, name, cql string + var schema DescribedSchema + for it.Scan(&ks, &t, &name, &cql) { + schema = append(schema, DescribedSchemaRow{ + Keyspace: ks, + Type: t, + Name: name, + CQLStmt: cql, + }) + } + + if err := it.Close(); err != nil { + return DescribedSchema{}, errors.Wrap(err, "describe schema with internals") + } + return schema, nil +} + +// RaftReadBarrier performs read barrier on a random node to which session is connected to. +// When used with single host session, it can be used to ensure that given node +// has already applied all raft commands present in the raft log. +func RaftReadBarrier(session gocqlx.Session) error { + // As this functionality is not available from Scylla API, + // SM uses the workaround described in https://github.com/scylladb/scylladb/issues/19213. + // Read barrier is performed before any schema change, so it's enough to try to apply + // some dummy schema changing CQL statement. + // In order to avoid misleading errors, it's good to use the IF EXISTS clause. + // Still, it might happen that SM does not have the permissions to perform dummy schema change. + // As described in the issue, this type of error still results in performing read barrier, + // so SM should treat it as if everything went fine. + // TODO: swap workaround with proper API call when mentioned issue is fixed. + // nolint: godox + tmpName := strings.ReplaceAll(uuid.NewTime().String(), "-", "") + readBarrierStmt := fmt.Sprintf("DROP TABLE IF EXISTS %q.%q", tmpName, tmpName) + if err := session.ExecStmt(readBarrierStmt); err != nil && !isGocqlUnauthorizedError(err) { + return errors.Wrap(err, "exec dummy schema change") + } + return nil +} + +func isGocqlUnauthorizedError(err error) bool { + var reqErr gocql.RequestError + return errors.As(err, &reqErr) && reqErr.Code() == gocql.ErrCodeUnauthorized +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/retry/backoff.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/retry/backoff.go new file mode 100644 index 0000000000..30982ba4f9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/retry/backoff.go @@ -0,0 +1,55 @@ +// Copyright (C) 2017 ScyllaDB + +package retry + +import ( + "time" + + "github.com/cenkalti/backoff/v4" +) + +// Backoff specifies a policy for how long to wait between retries. +// It is called after a failing request, to determine the amount of time +// that should pass before trying again. +type Backoff = backoff.BackOff + +// Stop indicates that no more retries should be made. +const Stop time.Duration = -1 + +// NewExponentialBackoff returns Backoff implementation that increases each +// wait period exponentially. +// Multiplier controls how fast each wait period grows, and randomizationFactor +// allows to inject some jitter between periods. +func NewExponentialBackoff(initialInterval, maxElapsedTime, maxInterval time.Duration, multiplier, randomizationFactor float64) Backoff { + b := backoff.NewExponentialBackOff() + b.InitialInterval = initialInterval + b.MaxElapsedTime = maxElapsedTime + b.MaxInterval = maxInterval + + b.Multiplier = multiplier + b.RandomizationFactor = randomizationFactor + b.Reset() + return b +} + +// WithMaxRetries allows to set maximum number of retries for given backoff strategy. +func WithMaxRetries(b Backoff, maxRetries uint64) Backoff { + return backoff.WithMaxRetries(b, maxRetries) +} + +// BackoffFunc type is an adapter to allow the use of ordinary +// functions as Backoff. +type BackoffFunc func() time.Duration + +// NextBackOff returns the duration to wait before retrying the operation. +func (b BackoffFunc) NextBackOff() time.Duration { + return b() +} + +// Reset to initial state. +func (b BackoffFunc) Reset() {} + +// Clone returns a copy of BackoffFunc. +func (b BackoffFunc) Clone() Backoff { + return b +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/retry/retry.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/retry/retry.go new file mode 100644 index 0000000000..2ca25e14f4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/retry/retry.go @@ -0,0 +1,36 @@ +// Copyright (C) 2017 ScyllaDB + +package retry + +import ( + "context" + + "github.com/cenkalti/backoff/v4" + "github.com/pkg/errors" +) + +// An Operation is executing by WithNotify(). +// The operation will be retried using a backoff policy if it returns an error. +type Operation = backoff.Operation + +// Notify is a notify-on-error function. It receives an operation error and +// backoff delay if the operation failed (with an error). +type Notify = backoff.Notify + +// WithNotify calls notify function with the error and wait duration +// for each failed attempt before sleep. +func WithNotify(ctx context.Context, op Operation, b Backoff, n Notify) error { + return backoff.RetryNotify(op, backoff.WithContext(b, ctx), n) +} + +// Permanent wraps the given err in a *backoff.PermanentError. +// This error interrupts further retries and causes retrying mechanism. +func Permanent(err error) error { + return backoff.Permanent(err) +} + +// IsPermanent checks if an error is a permanent error created with Permanent. +func IsPermanent(err error) bool { + var perr *backoff.PermanentError + return errors.As(err, &perr) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/schedules/cron.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/schedules/cron.go new file mode 100644 index 0000000000..550d7ccf79 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/schedules/cron.go @@ -0,0 +1,14 @@ +// Copyright (C) 2017 ScyllaDB + +package schedules + +import ( + "github.com/robfig/cron/v3" +) + +var cronParser = cron.NewParser(cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor) + +// NewCronTrigger returns a cron Trigger for a given spec. +func NewCronTrigger(spec string) (Trigger, error) { + return cronParser.Parse(spec) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/schedules/legacy.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/schedules/legacy.go new file mode 100644 index 0000000000..ee2c4fdc82 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/schedules/legacy.go @@ -0,0 +1,32 @@ +// Copyright (C) 2017 ScyllaDB + +package schedules + +import ( + "time" +) + +type legacy struct { + startDate time.Time + interval time.Duration +} + +// NewLegacy returns Trigger based on interval duration that was used in +// Scylla Manager 2.x and before. +func NewLegacy(startDate time.Time, interval time.Duration) Trigger { + return legacy{startDate: startDate, interval: interval} +} + +func (l legacy) Next(now time.Time) time.Time { + if l.startDate.After(now) { + return l.startDate + } + if l.interval == 0 { + return time.Time{} + } + lastStart := l.startDate.Add(now.Sub(l.startDate).Round(l.interval)) + for lastStart.Before(now) { + lastStart = lastStart.Add(l.interval) + } + return lastStart +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/schedules/multi.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/schedules/multi.go new file mode 100644 index 0000000000..e2534de698 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/schedules/multi.go @@ -0,0 +1,27 @@ +// Copyright (C) 2017 ScyllaDB + +package schedules + +import ( + "time" +) + +type multi []Trigger + +// NewMulti returns a trigger that joins multiple triggers. +func NewMulti(t ...Trigger) Trigger { + return multi(t) +} + +func (m multi) Next(now time.Time) time.Time { + var min time.Time + for _, t := range m { + next := t.Next(now) + if min.IsZero() { + min = next + } else if !next.IsZero() && next.Before(min) { + min = next + } + } + return min +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/schedules/once.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/schedules/once.go new file mode 100644 index 0000000000..270792aa18 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/schedules/once.go @@ -0,0 +1,28 @@ +// Copyright (C) 2017 ScyllaDB + +package schedules + +import ( + "time" + + "go.uber.org/atomic" +) + +type once struct { + v *atomic.Bool +} + +// NewOnce creates a trigger that fires once at a specified time. +// There is a sub second threshold to enable starting once now. +func NewOnce() Trigger { + return once{ + v: atomic.NewBool(false), + } +} + +func (o once) Next(now time.Time) time.Time { + if o.v.CompareAndSwap(false, true) { + return now + } + return time.Time{} +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/schedules/schedule.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/schedules/schedule.go new file mode 100644 index 0000000000..cf23956abc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/schedules/schedule.go @@ -0,0 +1,123 @@ +package schedules + +import ( + "encoding/json" + "time" + + "github.com/gocql/gocql" + "github.com/pkg/errors" + "go.uber.org/multierr" +) + +// Trigger provides the next activation date. +// Implementations must return the same values for the same now parameter. +// A zero time can be returned to indicate no more executions. +type Trigger interface { + Next(now time.Time) time.Time +} + +// Cron implements a trigger based on cron expression. +// It supports the extended syntax including @monthly, @weekly, @daily, @midnight, @hourly, @every . +type Cron struct { + CronSpecification + inner Trigger +} + +// CronSpecification combines specification for cron together with the start dates +// that defines the moment when the cron is being started. +type CronSpecification struct { + Spec string `json:"spec"` + StartDate time.Time `json:"start_date"` +} + +func NewCron(spec string, startDate time.Time) (Cron, error) { + t, err := NewCronTrigger(spec) + if err != nil { + return Cron{}, err + } + + return Cron{ + CronSpecification: CronSpecification{ + Spec: spec, + StartDate: startDate, + }, + inner: t, + }, nil +} + +func NewCronEvery(d time.Duration, startDate time.Time) Cron { + c, _ := NewCron("@every "+d.String(), startDate) // nolint: errcheck + return c +} + +// MustCron calls NewCron and panics on error. +func MustCron(spec string, startDate time.Time) Cron { + c, err := NewCron(spec, startDate) + if err != nil { + panic(err) + } + return c +} + +// Next implements scheduler.Trigger. +func (c Cron) Next(now time.Time) time.Time { + if c.inner == nil { + return time.Time{} + } + if c.StartDate.After(now) { + return c.inner.Next(c.StartDate) + } + return c.inner.Next(now) +} + +func (c Cron) MarshalText() (text []byte, err error) { + bytes, err := json.Marshal(c.CronSpecification) + if err != nil { + return nil, errors.Wrapf(err, "cannot json marshal {%v}", c.CronSpecification) + } + return bytes, nil +} + +func (c *Cron) UnmarshalText(text []byte) error { + if len(text) == 0 { + return nil + } + + var cronSpec CronSpecification + err := json.Unmarshal(text, &cronSpec) + if err != nil { + // fallback to the < 3.2.6 approach where cron was not coupled with start date + cronSpec = CronSpecification{ + Spec: string(text), + } + } + + if cronSpec.Spec == "" { + return nil + } + v, err2 := NewCron(cronSpec.Spec, cronSpec.StartDate) + if err2 != nil { + return errors.Wrap(multierr.Combine(err, err2), "cron") + } + + *c = v + return nil +} + +func (c Cron) MarshalCQL(info gocql.TypeInfo) ([]byte, error) { + if i := info.Type(); i != gocql.TypeText && i != gocql.TypeVarchar { + return nil, errors.Errorf("invalid gocql type %s expected %s", info.Type(), gocql.TypeText) + } + return c.MarshalText() +} + +func (c *Cron) UnmarshalCQL(info gocql.TypeInfo, data []byte) error { + if i := info.Type(); i != gocql.TypeText && i != gocql.TypeVarchar { + return errors.Errorf("invalid gocql type %s expected %s", info.Type(), gocql.TypeText) + } + return c.UnmarshalText(data) +} + +func (c Cron) IsZero() bool { + return c.inner == nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/slice/contains.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/slice/contains.go new file mode 100644 index 0000000000..b93c6c8ce0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/slice/contains.go @@ -0,0 +1,35 @@ +// Copyright (C) 2017 ScyllaDB + +package slice + +import "fmt" + +// Contains is a general purpose function to check if a slice contains element. +// It has a linear complexity, and does not assume any structure of data. +// Most likely you want to use one of the typed functions `ContainsX` from this +// package instead of this function. +func Contains(n int, match func(i int) bool) bool { + for i := 0; i < n; i++ { + if match(i) { + return true + } + } + return false +} + +// ContainsString returns true iff one of elements of a is s. +func ContainsString(a []string, s string) bool { + return Contains(len(a), func(i int) bool { + return a[i] == s + }) +} + +// Index returns position of e in s or panics if e can't be found in s. +func Index[T comparable](s []T, e T) int { + for i := range s { + if e == s[i] { + return i + } + } + panic(fmt.Sprintf("unknown element: %v in slice: %v", e, s)) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/timeutc/timeutc.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/timeutc/timeutc.go new file mode 100644 index 0000000000..1e25f90dfa --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/timeutc/timeutc.go @@ -0,0 +1,37 @@ +// Copyright (C) 2017 ScyllaDB + +package timeutc + +import "time" + +// Now returns current time in UTC. +func Now() time.Time { + return time.Now().UTC() +} + +// Parse calls time.Parse and returns value in UTC. +func Parse(layout, value string) (time.Time, error) { + t, err := time.Parse(layout, value) + return t.UTC(), err +} + +// Since returns the time elapsed since t. +func Since(t time.Time) time.Duration { + return Now().Sub(t.UTC()) +} + +// TodayMidnight returns local midnight time in UTC. +func TodayMidnight() time.Time { + t := time.Now().AddDate(0, 0, 1) + return time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, time.Local).UTC() // nolint: gosmopolitan +} + +// MustParse call time.Parse and returns value in UTC. +// It panics on time.Parse error. +func MustParse(layout, value string) time.Time { + t, err := Parse(layout, value) + if err != nil { + panic(err) + } + return t +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/timeutc/zoneinfo.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/timeutc/zoneinfo.go new file mode 100644 index 0000000000..8ed107388d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/timeutc/zoneinfo.go @@ -0,0 +1,34 @@ +// Copyright (C) 2021 ScyllaDB + +package timeutc + +import ( + "os" + "strings" + "time" +) + +// LocalName is name of the local time zone conforming to the IANA Time Zone database, such as "America/New_York". +// Using time.Local if timezone is read from /etc/localtime its name is overwritten by "Local". +// LocalName provides the name as read from /etc/localtime static link. +var LocalName string + +func init() { + tz := time.Local.String() //nolint: gosmopolitan + if tz == "Local" { + p, err := os.Readlink("/etc/localtime") + if err != nil { + return + } + i := strings.LastIndex(p, "/zoneinfo/") + if i < 0 { + return + } + tz = p[i+len("/zoneinfo/"):] + if _, err := time.LoadLocation(tz); err != nil { + return + } + } + + LocalName = tz +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/uuid/flags.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/uuid/flags.go new file mode 100644 index 0000000000..925367a94b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/uuid/flags.go @@ -0,0 +1,24 @@ +// Copyright (C) 2017 ScyllaDB + +package uuid + +type Value UUID + +func (v *Value) String() string { + if v.Value() == Nil { + return "" + } + return UUID(*v).String() +} + +func (v *Value) Set(s string) error { + return (*UUID)(v).UnmarshalText([]byte(s)) +} + +func (v *Value) Type() string { + return "string" +} + +func (v *Value) Value() UUID { + return UUID(*v) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/uuid/sort.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/uuid/sort.go new file mode 100644 index 0000000000..e80e80a1a3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/uuid/sort.go @@ -0,0 +1,11 @@ +// Copyright (C) 2017 ScyllaDB + +package uuid + +import "bytes" + +// Compare returns an integer comparing two UUIDs. +// The result will be 0 if a==b, -1 if a < b, and +1 if a > b. +func Compare(a, b UUID) int { + return bytes.Compare(a.Bytes(), b.Bytes()) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/uuid/uuid.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/uuid/uuid.go new file mode 100644 index 0000000000..fad12129c9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/uuid/uuid.go @@ -0,0 +1,160 @@ +// Copyright (C) 2017 ScyllaDB + +package uuid + +import ( + "encoding/binary" + "time" + + "github.com/gocql/gocql" + "github.com/pkg/errors" +) + +// UUID reference: +// https://tools.ietf.org/html/rfc4122 + +// Nil UUID is special form of UUID that is specified to have all 128 bits set +// to zero (see https://tools.ietf.org/html/rfc4122#section-4.1.7). +var Nil UUID + +// UUID is a wrapper for a UUID type. +type UUID struct { + uuid gocql.UUID +} + +// NewRandom returns a random (Version 4) UUID and error if it fails to read +// from it's random source. +func NewRandom() (UUID, error) { + u, err := gocql.RandomUUID() + if err != nil { + return Nil, errors.Wrap(err, "random") + } + return UUID{u}, nil +} + +// MustRandom works like NewRandom but will panic on error. +func MustRandom() UUID { + u, err := gocql.RandomUUID() + if err != nil { + panic(err) + } + return UUID{u} +} + +// NewTime generates a new time based UUID (version 1) using the current +// time as the timestamp. +func NewTime() UUID { + return UUID{gocql.TimeUUID()} +} + +// NewFromTime generates a new time based UUID (version 1) using the provided time. +func NewFromTime(t time.Time) UUID { + return UUID{gocql.UUIDFromTime(t)} +} + +// NewFromUint64 creates a UUID from a uint64 pair. +func NewFromUint64(l, h uint64) UUID { + var b [16]byte + binary.LittleEndian.PutUint64(b[:8], l) + binary.LittleEndian.PutUint64(b[8:], h) + + b[6] &= 0x0F // clear version + b[6] |= 0x40 // set version to 4 (random uuid) + b[8] &= 0x3F // clear variant + b[8] |= 0x80 // set to IETF variant + + return UUID{b} +} + +// Parse creates a new UUID from string. +func Parse(s string) (UUID, error) { + var u UUID + err := u.UnmarshalText([]byte(s)) + return u, err +} + +// MustParse creates a new UUID from string and panics if s is not an UUID. +func MustParse(s string) UUID { + u, err := Parse(s) + if err != nil { + panic(err) + } + return u +} + +// Bytes returns the raw byte slice for this UUID. A UUID is always 128 bits +// (16 bytes) long. +func (u UUID) Bytes() []byte { + b := make([]byte, 16) + copy(b, u.uuid[:]) + return b +} + +// Bytes16 returns the raw byte array for this UUID. +func (u UUID) Bytes16() [16]byte { + return u.uuid +} + +// MarshalCQL implements gocql.Marshaler. +func (u UUID) MarshalCQL(info gocql.TypeInfo) ([]byte, error) { + if u == Nil { + return nil, nil + } + + switch info.Type() { + case gocql.TypeUUID: + return u.uuid[:], nil + case gocql.TypeTimeUUID: + if u.uuid[6]&0x10 != 0x10 { + return nil, errors.New("not a timeuuid") + } + return u.uuid[:], nil + default: + return nil, errors.Errorf("unsupported type %q", info.Type()) + } +} + +// UnmarshalCQL implements gocql.Unmarshaler. +func (u *UUID) UnmarshalCQL(info gocql.TypeInfo, data []byte) error { + if info.Type() != gocql.TypeUUID && info.Type() != gocql.TypeTimeUUID { + return errors.Errorf("unsupported type %q", info.Type()) + } + + if len(data) == 0 { + *u = Nil + return nil + } + + if len(data) != 16 { + return errors.New("UUIDs must be exactly 16 bytes long") + } + + copy(u.uuid[:], data) + return nil +} + +// MarshalJSON implements json.Marshaller. +func (u UUID) MarshalJSON() ([]byte, error) { + return u.uuid.MarshalJSON() +} + +// UnmarshalJSON implements json.Unmarshaler. +func (u *UUID) UnmarshalJSON(data []byte) error { + return u.uuid.UnmarshalJSON(data) +} + +// MarshalText implements text.Marshaller. +func (u UUID) MarshalText() ([]byte, error) { + return u.uuid.MarshalText() +} + +// UnmarshalText implements text.Marshaller. +func (u *UUID) UnmarshalText(text []byte) error { + return u.uuid.UnmarshalText(text) +} + +// String returns the UUID in it's canonical form, a 32 digit hexadecimal +// number in the form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. +func (u UUID) String() string { + return u.uuid.String() +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/version/version.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/version/version.go new file mode 100644 index 0000000000..ba668112c9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/version/version.go @@ -0,0 +1,96 @@ +// Copyright (C) 2017 ScyllaDB + +package version + +import ( + "fmt" + "regexp" + "strings" + + "github.com/hashicorp/go-version" + "github.com/pkg/errors" +) + +// Short excludes any metadata or pre-release information. For example, +// for a version "1.2.3-20200101.b41b3dbs1b", it will return "1.2.3". +// If provided string isn't version, it will return input string. +func Short(v string) string { + ver, err := version.NewVersion(v) + if err != nil { + return v + } + + parts := make([]string, len(ver.Segments())) + for i, s := range ver.Segments() { + parts[i] = fmt.Sprint(s) + } + + return strings.Join(parts, ".") +} + +const ( + masterMajorVersion = "666" + masterEnterpriseMajorVersion = "9999" + + masterVersionSuffix = ".dev" + masterVersionLongSuffix = ".development" + masterEnterpriseVersionSuffix = ".enterprise_dev" + + masterVersion = masterMajorVersion + masterVersionSuffix + masterLongVersion = masterMajorVersion + masterVersionLongSuffix + masterEnterpriseMasterVersion = masterEnterpriseMajorVersion + masterEnterpriseVersionSuffix +) + +// MasterVersion returns whether provided version string originates from master branch. +func MasterVersion(v string) bool { + v = strings.Split(v, "-")[0] + return v == masterLongVersion || v == masterEnterpriseMasterVersion || v == masterVersion +} + +// TrimMaster returns version string without master branch bloat breaking semantic +// format constraints. +func TrimMaster(v string) string { + if v == "Snapshot" { + return masterMajorVersion + } + + v = strings.Split(v, "-")[0] + v = strings.TrimSuffix(v, masterVersionSuffix) + v = strings.TrimSuffix(v, masterVersionLongSuffix) + v = strings.TrimSuffix(v, masterEnterpriseVersionSuffix) + + return v +} + +var releaseCandidateRe = regexp.MustCompile(`\.rc([0-9]+)`) + +// TransformReleaseCandidate replaces `.rcX` in version string with `~` instead +// of the dot. +func TransformReleaseCandidate(v string) string { + v = releaseCandidateRe.ReplaceAllString(v, `~rc$1`) + + return v +} + +var verRe = regexp.MustCompile(`^[0-9]+\.[0-9]+(\.[0-9]+)?`) + +// CheckConstraint returns whether version fulfills given constraint. +func CheckConstraint(ver, constraint string) (bool, error) { + if verRe.FindString(ver) == "" { + return false, errors.Errorf("Unsupported Scylla version: %s", ver) + } + + // Extract only version number + ver = verRe.FindString(ver) + + v, err := version.NewSemver(ver) + if err != nil { + return false, err + } + + c, err := version.NewConstraint(constraint) + if err != nil { + return false, fmt.Errorf("version constraint syntax error: %w", err) + } + return c.Check(v), nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/workerpool/pool.go b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/workerpool/pool.go new file mode 100644 index 0000000000..116abb5f74 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/pkg/util/workerpool/pool.go @@ -0,0 +1,173 @@ +// Copyright (C) 2023 ScyllaDB + +package workerpool + +import ( + "context" + "sync" +) + +// JobHandler describes handler for tasks of type T which returns results of type R. +type JobHandler[T, R any] interface { + // HandleJob is called when worker receives task from the pool. + HandleJob(ctx context.Context, task T) R + // Done is called when worker exits. + Done(ctx context.Context) +} + +// Pool allows for executing homogeneous JobHandlers with ongoing control over parallelism. +// Use Spawn, Kill and SetSize methods to change the current amount of workers. +// Use Submit to submit new task and Results to wait for the results. +// Pool can be closed with Close or drained with cancelling workers context. +type Pool[W JobHandler[T, R], T, R any] struct { + workerCtx context.Context // nolint: containedctx + spawnWorker func(ctx context.Context, id int) W + + tasks chan T + results chan R + killWorker chan struct{} + size int + totalSize int + wait sync.WaitGroup + closed bool + mu sync.Mutex +} + +// New returns newly created Pool. +// WorkerCtx is passed to ever HandleJob execution and can be cancelled +// to shut down the pool. +// Spawn function is used for creating new JobHandlers with unique ID. +// ChanSize describes the max number of unprocessed tasks and results +// before operations start blocking. +func New[W JobHandler[T, R], T, R any](workerCtx context.Context, spawn func(context.Context, int) W, chanSize int) *Pool[W, T, R] { + return &Pool[W, T, R]{ + workerCtx: workerCtx, + spawnWorker: spawn, + tasks: make(chan T, chanSize), + results: make(chan R, chanSize), + killWorker: make(chan struct{}, chanSize), + size: 0, + totalSize: 0, + wait: sync.WaitGroup{}, + closed: false, + mu: sync.Mutex{}, + } +} + +// Spawn adds a single worker to the pool. +func (p *Pool[_, _, _]) Spawn() { + p.mu.Lock() + defer p.mu.Unlock() + if p.closed { + return + } + p.spawn() +} + +func (p *Pool[_, _, _]) spawn() { + p.wait.Add(1) + p.size++ + p.totalSize++ + id := p.totalSize + w := p.spawnWorker(p.workerCtx, id) + + go func() { + defer func() { + p.wait.Done() + w.Done(p.workerCtx) + }() + + for { + select { + case <-p.killWorker: + return + default: + } + if p.workerCtx.Err() != nil { + return + } + + select { + case <-p.workerCtx.Done(): + return + case <-p.killWorker: + return + case t, ok := <-p.tasks: + if !ok { + return + } + p.results <- w.HandleJob(p.workerCtx, t) + } + } + }() +} + +func (p *Pool[_, _, _]) kill() { + p.killWorker <- struct{}{} + p.size-- +} + +// Kill removes single worker from the pool. +func (p *Pool[_, _, _]) Kill() { + p.mu.Lock() + defer p.mu.Unlock() + if p.closed { + return + } + p.kill() +} + +// SetSize spawns or kills worker to achieve desired pool size. +func (p *Pool[_, _, _]) SetSize(size int) { + p.mu.Lock() + defer p.mu.Unlock() + if p.closed { + return + } + + for p.size > size { + p.kill() + } + for p.size < size { + p.spawn() + } +} + +// Submit queues task to be picked up by a free worker. +// Might block when chanSize is too little. +func (p *Pool[_, T, _]) Submit(task T) { + p.tasks <- task +} + +// Results returns channel that can be used to wait for +// the results of submitted tasks. +func (p *Pool[_, _, R]) Results() chan R { + return p.results +} + +// Size returns the current number of workers. +func (p *Pool[_, _, _]) Size() int { + p.mu.Lock() + defer p.mu.Unlock() + + return p.size +} + +// Close kills all workers and makes submitting new tasks panic. +func (p *Pool[_, _, _]) Close() { + p.mu.Lock() + defer p.mu.Unlock() + + if p.closed { + return + } + close(p.killWorker) + close(p.tasks) + p.size = 0 + p.closed = true +} + +// Wait returns when all workers have exited. +func (p *Pool[_, _, _]) Wait() { + p.wait.Wait() +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/LICENSE b/vendor/github.com/scylladb/scylla-manager/v3/swagger/LICENSE new file mode 100644 index 0000000000..a155a625fc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/LICENSE @@ -0,0 +1,62 @@ +Scylla SOURCE AVAILABLE LICENSE (SSAL) AGREEMENT Last Update: June 30, 2021 + +This Agreement sets forth the terms on which the Licensor makes available the Software. BY INSTALLING, DOWNLOADING, ACCESSING, USING OR DISTRIBUTING ANY OF THE SOFTWARE, YOU AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO SUCH TERMS AND CONDITIONS, YOU MUST NOT USE THE SOFTWARE. + +If you are receiving the Software on behalf of a legal entity, you represent and warrant that you have the actual authority to agree to the terms and conditions of this agreement on behalf of such entity. + +The terms below have the meanings set forth below for purposes of this Agreement: + +Agreement: this Scylla Source Available License Agreement. + +Database Product: any of the following products or services: + +(a) Scylla Manager; + +(b) a product or service exposing the Scylla Manager API + +License: the Scylla Source Available License described in Section 1. + +Licensor: as indicated in the source code license. + +Modification: a modification of the Software made by You under the License, Section 1.1(c). + +Scylla: the open source Scylla software as described in scylladb.com + +Software: certain software components designed to work with Scylla NoSQL Database and provided to you under this Agreement. + +You: the recipient of this Software, an individual, or the entity on whose behalf you are receiving the Software. + +Your Application: an application developed by or for You, where such application is not a Database Product. + +LICENSE GRANT AND CONDITIONS +1.1 Subject to the terms and conditions of this Section 1, Licensor hereby grants to You a non-exclusive, royalty-free, worldwide, non-transferable license during the term of this Agreement to: + +a) distribute or make available the Software or your Modifications under the terms of this +Agreement, only as part of Your Application, so long as you include the following notice on any copy you distribute: “This software is subject to the terms of the Scylla Source Available License Agreement”. + +(b) use the Software, or your Modifications, only as part of Your Application, but not in connection + +with any Database Product that is distributed or otherwise made available by any third party. + +(c) modify the Software, provided that Modifications remain subject to the terms of this License. + +(d) reproduce the Software as necessary for the above. + +1.3. Notices. + +On all copies of the Software that you make, you must retain all copyright or other proprietary notices. + +TERM AND TERMINATION. +This Agreement will continue unless and until earlier terminated as set forth herein. If You breach any of its conditions or obligations under this Agreement, this Agreement will terminate automatically and the licenses granted herein will terminate automatically. + +INTELLECTUAL PROPERTY. +As between the parties, Licensor retains all right, title, and interest in the Software, and to Scylla or other Licensor trademarks or service marks, and all intellectual property rights therein. Licensor hereby reserves all rights not expressly granted to You in this Agreement. + +DISCLAIMER. +TO THE EXTENT ALLOWABLE UNDER LAW, LICENSOR HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE SOFTWARE. Licensor has no obligation to support the Software. + +LIMITATION OF LIABILITY. TO THE EXTENT ALLOWABLE UNDER LAW, LICENSOR WILL NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND, INCLUDING BUT NOT LIMITED TO, LOST PROFITS OR ANY CONSEQUENTIAL, SPECIAL, INCIDENTAL, INDIRECT, OR DIRECT DAMAGES, ARISING OUT OF OR RELATING TO THIS AGREEMENT. +GENERAL. You are not authorized to assign Your rights under this Agreement to any third party. Licensor may freely assign its rights under this Agreement to any third party. This Agreement is the entire agreement between the parties on the subject matter hereof. No amendment or modification hereof will be valid or binding upon the parties unless made in writing and signed by the duly authorized representatives of both parties. In the event that any provision, including without limitation any condition, of this Agreement is held to be unenforceable, this Agreement and all licenses and rights granted hereunder will immediately terminate. Failure by Licensor to exercise any right hereunder will not be construed as a waiver of any subsequent breach of that right or as a waiver of any other right. This Agreement will be governed by and interpreted in accordance with the laws of the state of California, without reference to its conflict of laws principles. If You are located within the United States, all disputes arising out of this Agreement are subject to the exclusive jurisdiction of courts located in Santa Clara County, California. USA. If You are located outside of the United States, any dispute, controversy or claim arising out of or relating to this Agreement will be referred to and finally determined by arbitration in accordance with the JAMS before a single arbitrator in Santa Clara County, California. Judgment upon the award rendered by the arbitrator may be entered in any court having jurisdiction thereof. + +This license is base on REDIS SOURCE AVAILABLE LICENSE (RSAL) AGREEMENT with some updates +https://redislabs.com/wp-content/uploads/2019/09/redis-source-available-license.pdf diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/agent_client.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/agent_client.go new file mode 100644 index 0000000000..c1fadfbb1e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/agent_client.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations" +) + +// Default agent HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "scylla-manager.magic.host" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/agent" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new agent HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Agent { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new agent HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Agent { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new agent client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Agent { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Agent) + cli.Transport = transport + cli.Operations = operations.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Agent is a client for agent +type Agent struct { + Operations operations.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Agent) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Operations.SetTransport(transport) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_bwlimit_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_bwlimit_parameters.go new file mode 100644 index 0000000000..62ac422409 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_bwlimit_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewCoreBwlimitParams creates a new CoreBwlimitParams object +// with the default values initialized. +func NewCoreBwlimitParams() *CoreBwlimitParams { + var () + return &CoreBwlimitParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCoreBwlimitParamsWithTimeout creates a new CoreBwlimitParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCoreBwlimitParamsWithTimeout(timeout time.Duration) *CoreBwlimitParams { + var () + return &CoreBwlimitParams{ + + timeout: timeout, + } +} + +// NewCoreBwlimitParamsWithContext creates a new CoreBwlimitParams object +// with the default values initialized, and the ability to set a context for a request +func NewCoreBwlimitParamsWithContext(ctx context.Context) *CoreBwlimitParams { + var () + return &CoreBwlimitParams{ + + Context: ctx, + } +} + +// NewCoreBwlimitParamsWithHTTPClient creates a new CoreBwlimitParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCoreBwlimitParamsWithHTTPClient(client *http.Client) *CoreBwlimitParams { + var () + return &CoreBwlimitParams{ + HTTPClient: client, + } +} + +/* +CoreBwlimitParams contains all the parameters to send to the API endpoint +for the core bwlimit operation typically these are written to a http.Request +*/ +type CoreBwlimitParams struct { + + /*BandwidthRate + bandwidth rate + + */ + BandwidthRate *models.Bandwidth + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the core bwlimit params +func (o *CoreBwlimitParams) WithTimeout(timeout time.Duration) *CoreBwlimitParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the core bwlimit params +func (o *CoreBwlimitParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the core bwlimit params +func (o *CoreBwlimitParams) WithContext(ctx context.Context) *CoreBwlimitParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the core bwlimit params +func (o *CoreBwlimitParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the core bwlimit params +func (o *CoreBwlimitParams) WithHTTPClient(client *http.Client) *CoreBwlimitParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the core bwlimit params +func (o *CoreBwlimitParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBandwidthRate adds the bandwidthRate to the core bwlimit params +func (o *CoreBwlimitParams) WithBandwidthRate(bandwidthRate *models.Bandwidth) *CoreBwlimitParams { + o.SetBandwidthRate(bandwidthRate) + return o +} + +// SetBandwidthRate adds the bandwidthRate to the core bwlimit params +func (o *CoreBwlimitParams) SetBandwidthRate(bandwidthRate *models.Bandwidth) { + o.BandwidthRate = bandwidthRate +} + +// WriteToRequest writes these params to a swagger request +func (o *CoreBwlimitParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.BandwidthRate != nil { + if err := r.SetBodyParam(o.BandwidthRate); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_bwlimit_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_bwlimit_responses.go new file mode 100644 index 0000000000..d2b5c33a64 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_bwlimit_responses.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// CoreBwlimitReader is a Reader for the CoreBwlimit structure. +type CoreBwlimitReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CoreBwlimitReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCoreBwlimitOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCoreBwlimitDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCoreBwlimitOK creates a CoreBwlimitOK with default headers values +func NewCoreBwlimitOK() *CoreBwlimitOK { + return &CoreBwlimitOK{} +} + +/* +CoreBwlimitOK handles this case with default header values. + +bandwidth rate +*/ +type CoreBwlimitOK struct { + Payload *models.Bandwidth + JobID int64 +} + +func (o *CoreBwlimitOK) GetPayload() *models.Bandwidth { + return o.Payload +} + +func (o *CoreBwlimitOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Bandwidth) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewCoreBwlimitDefault creates a CoreBwlimitDefault with default headers values +func NewCoreBwlimitDefault(code int) *CoreBwlimitDefault { + return &CoreBwlimitDefault{ + _statusCode: code, + } +} + +/* +CoreBwlimitDefault handles this case with default header values. + +Server error +*/ +type CoreBwlimitDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the core bwlimit default response +func (o *CoreBwlimitDefault) Code() int { + return o._statusCode +} + +func (o *CoreBwlimitDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *CoreBwlimitDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *CoreBwlimitDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_stats_delete_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_stats_delete_parameters.go new file mode 100644 index 0000000000..e729150475 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_stats_delete_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewCoreStatsDeleteParams creates a new CoreStatsDeleteParams object +// with the default values initialized. +func NewCoreStatsDeleteParams() *CoreStatsDeleteParams { + var () + return &CoreStatsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCoreStatsDeleteParamsWithTimeout creates a new CoreStatsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCoreStatsDeleteParamsWithTimeout(timeout time.Duration) *CoreStatsDeleteParams { + var () + return &CoreStatsDeleteParams{ + + timeout: timeout, + } +} + +// NewCoreStatsDeleteParamsWithContext creates a new CoreStatsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewCoreStatsDeleteParamsWithContext(ctx context.Context) *CoreStatsDeleteParams { + var () + return &CoreStatsDeleteParams{ + + Context: ctx, + } +} + +// NewCoreStatsDeleteParamsWithHTTPClient creates a new CoreStatsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCoreStatsDeleteParamsWithHTTPClient(client *http.Client) *CoreStatsDeleteParams { + var () + return &CoreStatsDeleteParams{ + HTTPClient: client, + } +} + +/* +CoreStatsDeleteParams contains all the parameters to send to the API endpoint +for the core stats delete operation typically these are written to a http.Request +*/ +type CoreStatsDeleteParams struct { + + /*StatsParams + Stats parameters + + */ + StatsParams *models.StatsParams + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the core stats delete params +func (o *CoreStatsDeleteParams) WithTimeout(timeout time.Duration) *CoreStatsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the core stats delete params +func (o *CoreStatsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the core stats delete params +func (o *CoreStatsDeleteParams) WithContext(ctx context.Context) *CoreStatsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the core stats delete params +func (o *CoreStatsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the core stats delete params +func (o *CoreStatsDeleteParams) WithHTTPClient(client *http.Client) *CoreStatsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the core stats delete params +func (o *CoreStatsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithStatsParams adds the statsParams to the core stats delete params +func (o *CoreStatsDeleteParams) WithStatsParams(statsParams *models.StatsParams) *CoreStatsDeleteParams { + o.SetStatsParams(statsParams) + return o +} + +// SetStatsParams adds the statsParams to the core stats delete params +func (o *CoreStatsDeleteParams) SetStatsParams(statsParams *models.StatsParams) { + o.StatsParams = statsParams +} + +// WriteToRequest writes these params to a swagger request +func (o *CoreStatsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.StatsParams != nil { + if err := r.SetBodyParam(o.StatsParams); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_stats_delete_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_stats_delete_responses.go new file mode 100644 index 0000000000..ada73d24a0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_stats_delete_responses.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// CoreStatsDeleteReader is a Reader for the CoreStatsDelete structure. +type CoreStatsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CoreStatsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCoreStatsDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCoreStatsDeleteDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCoreStatsDeleteOK creates a CoreStatsDeleteOK with default headers values +func NewCoreStatsDeleteOK() *CoreStatsDeleteOK { + return &CoreStatsDeleteOK{} +} + +/* +CoreStatsDeleteOK handles this case with default header values. + +Empty object +*/ +type CoreStatsDeleteOK struct { + Payload interface{} + JobID int64 +} + +func (o *CoreStatsDeleteOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CoreStatsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewCoreStatsDeleteDefault creates a CoreStatsDeleteDefault with default headers values +func NewCoreStatsDeleteDefault(code int) *CoreStatsDeleteDefault { + return &CoreStatsDeleteDefault{ + _statusCode: code, + } +} + +/* +CoreStatsDeleteDefault handles this case with default header values. + +Server error +*/ +type CoreStatsDeleteDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the core stats delete default response +func (o *CoreStatsDeleteDefault) Code() int { + return o._statusCode +} + +func (o *CoreStatsDeleteDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *CoreStatsDeleteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *CoreStatsDeleteDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_stats_reset_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_stats_reset_parameters.go new file mode 100644 index 0000000000..8a0fcc09eb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_stats_reset_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewCoreStatsResetParams creates a new CoreStatsResetParams object +// with the default values initialized. +func NewCoreStatsResetParams() *CoreStatsResetParams { + var () + return &CoreStatsResetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCoreStatsResetParamsWithTimeout creates a new CoreStatsResetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCoreStatsResetParamsWithTimeout(timeout time.Duration) *CoreStatsResetParams { + var () + return &CoreStatsResetParams{ + + timeout: timeout, + } +} + +// NewCoreStatsResetParamsWithContext creates a new CoreStatsResetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCoreStatsResetParamsWithContext(ctx context.Context) *CoreStatsResetParams { + var () + return &CoreStatsResetParams{ + + Context: ctx, + } +} + +// NewCoreStatsResetParamsWithHTTPClient creates a new CoreStatsResetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCoreStatsResetParamsWithHTTPClient(client *http.Client) *CoreStatsResetParams { + var () + return &CoreStatsResetParams{ + HTTPClient: client, + } +} + +/* +CoreStatsResetParams contains all the parameters to send to the API endpoint +for the core stats reset operation typically these are written to a http.Request +*/ +type CoreStatsResetParams struct { + + /*StatsParams + Stats parameters + + */ + StatsParams *models.StatsParams + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the core stats reset params +func (o *CoreStatsResetParams) WithTimeout(timeout time.Duration) *CoreStatsResetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the core stats reset params +func (o *CoreStatsResetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the core stats reset params +func (o *CoreStatsResetParams) WithContext(ctx context.Context) *CoreStatsResetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the core stats reset params +func (o *CoreStatsResetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the core stats reset params +func (o *CoreStatsResetParams) WithHTTPClient(client *http.Client) *CoreStatsResetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the core stats reset params +func (o *CoreStatsResetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithStatsParams adds the statsParams to the core stats reset params +func (o *CoreStatsResetParams) WithStatsParams(statsParams *models.StatsParams) *CoreStatsResetParams { + o.SetStatsParams(statsParams) + return o +} + +// SetStatsParams adds the statsParams to the core stats reset params +func (o *CoreStatsResetParams) SetStatsParams(statsParams *models.StatsParams) { + o.StatsParams = statsParams +} + +// WriteToRequest writes these params to a swagger request +func (o *CoreStatsResetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.StatsParams != nil { + if err := r.SetBodyParam(o.StatsParams); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_stats_reset_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_stats_reset_responses.go new file mode 100644 index 0000000000..a954eea654 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/core_stats_reset_responses.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// CoreStatsResetReader is a Reader for the CoreStatsReset structure. +type CoreStatsResetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CoreStatsResetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCoreStatsResetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCoreStatsResetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCoreStatsResetOK creates a CoreStatsResetOK with default headers values +func NewCoreStatsResetOK() *CoreStatsResetOK { + return &CoreStatsResetOK{} +} + +/* +CoreStatsResetOK handles this case with default header values. + +Empty object +*/ +type CoreStatsResetOK struct { + Payload interface{} + JobID int64 +} + +func (o *CoreStatsResetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CoreStatsResetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewCoreStatsResetDefault creates a CoreStatsResetDefault with default headers values +func NewCoreStatsResetDefault(code int) *CoreStatsResetDefault { + return &CoreStatsResetDefault{ + _statusCode: code, + } +} + +/* +CoreStatsResetDefault handles this case with default header values. + +Server error +*/ +type CoreStatsResetDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the core stats reset default response +func (o *CoreStatsResetDefault) Code() int { + return o._statusCode +} + +func (o *CoreStatsResetDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *CoreStatsResetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *CoreStatsResetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/free_o_s_memory_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/free_o_s_memory_parameters.go new file mode 100644 index 0000000000..587403775c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/free_o_s_memory_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFreeOSMemoryParams creates a new FreeOSMemoryParams object +// with the default values initialized. +func NewFreeOSMemoryParams() *FreeOSMemoryParams { + + return &FreeOSMemoryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFreeOSMemoryParamsWithTimeout creates a new FreeOSMemoryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFreeOSMemoryParamsWithTimeout(timeout time.Duration) *FreeOSMemoryParams { + + return &FreeOSMemoryParams{ + + timeout: timeout, + } +} + +// NewFreeOSMemoryParamsWithContext creates a new FreeOSMemoryParams object +// with the default values initialized, and the ability to set a context for a request +func NewFreeOSMemoryParamsWithContext(ctx context.Context) *FreeOSMemoryParams { + + return &FreeOSMemoryParams{ + + Context: ctx, + } +} + +// NewFreeOSMemoryParamsWithHTTPClient creates a new FreeOSMemoryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFreeOSMemoryParamsWithHTTPClient(client *http.Client) *FreeOSMemoryParams { + + return &FreeOSMemoryParams{ + HTTPClient: client, + } +} + +/* +FreeOSMemoryParams contains all the parameters to send to the API endpoint +for the free o s memory operation typically these are written to a http.Request +*/ +type FreeOSMemoryParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the free o s memory params +func (o *FreeOSMemoryParams) WithTimeout(timeout time.Duration) *FreeOSMemoryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the free o s memory params +func (o *FreeOSMemoryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the free o s memory params +func (o *FreeOSMemoryParams) WithContext(ctx context.Context) *FreeOSMemoryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the free o s memory params +func (o *FreeOSMemoryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the free o s memory params +func (o *FreeOSMemoryParams) WithHTTPClient(client *http.Client) *FreeOSMemoryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the free o s memory params +func (o *FreeOSMemoryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FreeOSMemoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/free_o_s_memory_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/free_o_s_memory_responses.go new file mode 100644 index 0000000000..51313ddac8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/free_o_s_memory_responses.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// FreeOSMemoryReader is a Reader for the FreeOSMemory structure. +type FreeOSMemoryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FreeOSMemoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFreeOSMemoryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFreeOSMemoryDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFreeOSMemoryOK creates a FreeOSMemoryOK with default headers values +func NewFreeOSMemoryOK() *FreeOSMemoryOK { + return &FreeOSMemoryOK{} +} + +/* +FreeOSMemoryOK handles this case with default header values. + +Empty object +*/ +type FreeOSMemoryOK struct { + Payload interface{} + JobID int64 +} + +func (o *FreeOSMemoryOK) GetPayload() interface{} { + return o.Payload +} + +func (o *FreeOSMemoryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewFreeOSMemoryDefault creates a FreeOSMemoryDefault with default headers values +func NewFreeOSMemoryDefault(code int) *FreeOSMemoryDefault { + return &FreeOSMemoryDefault{ + _statusCode: code, + } +} + +/* +FreeOSMemoryDefault handles this case with default header values. + +Server error +*/ +type FreeOSMemoryDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the free o s memory default response +func (o *FreeOSMemoryDefault) Code() int { + return o._statusCode +} + +func (o *FreeOSMemoryDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *FreeOSMemoryDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *FreeOSMemoryDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_info_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_info_parameters.go new file mode 100644 index 0000000000..294e47e8ee --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_info_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewJobInfoParams creates a new JobInfoParams object +// with the default values initialized. +func NewJobInfoParams() *JobInfoParams { + var () + return &JobInfoParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewJobInfoParamsWithTimeout creates a new JobInfoParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewJobInfoParamsWithTimeout(timeout time.Duration) *JobInfoParams { + var () + return &JobInfoParams{ + + timeout: timeout, + } +} + +// NewJobInfoParamsWithContext creates a new JobInfoParams object +// with the default values initialized, and the ability to set a context for a request +func NewJobInfoParamsWithContext(ctx context.Context) *JobInfoParams { + var () + return &JobInfoParams{ + + Context: ctx, + } +} + +// NewJobInfoParamsWithHTTPClient creates a new JobInfoParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewJobInfoParamsWithHTTPClient(client *http.Client) *JobInfoParams { + var () + return &JobInfoParams{ + HTTPClient: client, + } +} + +/* +JobInfoParams contains all the parameters to send to the API endpoint +for the job info operation typically these are written to a http.Request +*/ +type JobInfoParams struct { + + /*Jobinfo + Job info params with id and long polling + + */ + Jobinfo *models.JobInfoParams + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the job info params +func (o *JobInfoParams) WithTimeout(timeout time.Duration) *JobInfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the job info params +func (o *JobInfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the job info params +func (o *JobInfoParams) WithContext(ctx context.Context) *JobInfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the job info params +func (o *JobInfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the job info params +func (o *JobInfoParams) WithHTTPClient(client *http.Client) *JobInfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the job info params +func (o *JobInfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithJobinfo adds the jobinfo to the job info params +func (o *JobInfoParams) WithJobinfo(jobinfo *models.JobInfoParams) *JobInfoParams { + o.SetJobinfo(jobinfo) + return o +} + +// SetJobinfo adds the jobinfo to the job info params +func (o *JobInfoParams) SetJobinfo(jobinfo *models.JobInfoParams) { + o.Jobinfo = jobinfo +} + +// WriteToRequest writes these params to a swagger request +func (o *JobInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Jobinfo != nil { + if err := r.SetBodyParam(o.Jobinfo); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_info_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_info_responses.go new file mode 100644 index 0000000000..06df084dc8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_info_responses.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// JobInfoReader is a Reader for the JobInfo structure. +type JobInfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *JobInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewJobInfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewJobInfoDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewJobInfoOK creates a JobInfoOK with default headers values +func NewJobInfoOK() *JobInfoOK { + return &JobInfoOK{} +} + +/* +JobInfoOK handles this case with default header values. + +Aggregated info about job transfers +*/ +type JobInfoOK struct { + Payload *models.JobInfo + JobID int64 +} + +func (o *JobInfoOK) GetPayload() *models.JobInfo { + return o.Payload +} + +func (o *JobInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.JobInfo) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewJobInfoDefault creates a JobInfoDefault with default headers values +func NewJobInfoDefault(code int) *JobInfoDefault { + return &JobInfoDefault{ + _statusCode: code, + } +} + +/* +JobInfoDefault handles this case with default header values. + +Server error +*/ +type JobInfoDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the job info default response +func (o *JobInfoDefault) Code() int { + return o._statusCode +} + +func (o *JobInfoDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *JobInfoDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *JobInfoDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_progress_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_progress_parameters.go new file mode 100644 index 0000000000..e50bcfe381 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_progress_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewJobProgressParams creates a new JobProgressParams object +// with the default values initialized. +func NewJobProgressParams() *JobProgressParams { + var () + return &JobProgressParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewJobProgressParamsWithTimeout creates a new JobProgressParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewJobProgressParamsWithTimeout(timeout time.Duration) *JobProgressParams { + var () + return &JobProgressParams{ + + timeout: timeout, + } +} + +// NewJobProgressParamsWithContext creates a new JobProgressParams object +// with the default values initialized, and the ability to set a context for a request +func NewJobProgressParamsWithContext(ctx context.Context) *JobProgressParams { + var () + return &JobProgressParams{ + + Context: ctx, + } +} + +// NewJobProgressParamsWithHTTPClient creates a new JobProgressParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewJobProgressParamsWithHTTPClient(client *http.Client) *JobProgressParams { + var () + return &JobProgressParams{ + HTTPClient: client, + } +} + +/* +JobProgressParams contains all the parameters to send to the API endpoint +for the job progress operation typically these are written to a http.Request +*/ +type JobProgressParams struct { + + /*Jobinfo + Job info params with id and long polling + + */ + Jobinfo *models.JobInfoParams + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the job progress params +func (o *JobProgressParams) WithTimeout(timeout time.Duration) *JobProgressParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the job progress params +func (o *JobProgressParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the job progress params +func (o *JobProgressParams) WithContext(ctx context.Context) *JobProgressParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the job progress params +func (o *JobProgressParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the job progress params +func (o *JobProgressParams) WithHTTPClient(client *http.Client) *JobProgressParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the job progress params +func (o *JobProgressParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithJobinfo adds the jobinfo to the job progress params +func (o *JobProgressParams) WithJobinfo(jobinfo *models.JobInfoParams) *JobProgressParams { + o.SetJobinfo(jobinfo) + return o +} + +// SetJobinfo adds the jobinfo to the job progress params +func (o *JobProgressParams) SetJobinfo(jobinfo *models.JobInfoParams) { + o.Jobinfo = jobinfo +} + +// WriteToRequest writes these params to a swagger request +func (o *JobProgressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Jobinfo != nil { + if err := r.SetBodyParam(o.Jobinfo); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_progress_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_progress_responses.go new file mode 100644 index 0000000000..a3f2ee6c6c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_progress_responses.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// JobProgressReader is a Reader for the JobProgress structure. +type JobProgressReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *JobProgressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewJobProgressOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewJobProgressDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewJobProgressOK creates a JobProgressOK with default headers values +func NewJobProgressOK() *JobProgressOK { + return &JobProgressOK{} +} + +/* +JobProgressOK handles this case with default header values. + +Aggregated info about job transfers +*/ +type JobProgressOK struct { + Payload *models.JobProgress + JobID int64 +} + +func (o *JobProgressOK) GetPayload() *models.JobProgress { + return o.Payload +} + +func (o *JobProgressOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.JobProgress) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewJobProgressDefault creates a JobProgressDefault with default headers values +func NewJobProgressDefault(code int) *JobProgressDefault { + return &JobProgressDefault{ + _statusCode: code, + } +} + +/* +JobProgressDefault handles this case with default header values. + +Server error +*/ +type JobProgressDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the job progress default response +func (o *JobProgressDefault) Code() int { + return o._statusCode +} + +func (o *JobProgressDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *JobProgressDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *JobProgressDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_stop_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_stop_parameters.go new file mode 100644 index 0000000000..ade24bf1c2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_stop_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewJobStopParams creates a new JobStopParams object +// with the default values initialized. +func NewJobStopParams() *JobStopParams { + var () + return &JobStopParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewJobStopParamsWithTimeout creates a new JobStopParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewJobStopParamsWithTimeout(timeout time.Duration) *JobStopParams { + var () + return &JobStopParams{ + + timeout: timeout, + } +} + +// NewJobStopParamsWithContext creates a new JobStopParams object +// with the default values initialized, and the ability to set a context for a request +func NewJobStopParamsWithContext(ctx context.Context) *JobStopParams { + var () + return &JobStopParams{ + + Context: ctx, + } +} + +// NewJobStopParamsWithHTTPClient creates a new JobStopParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewJobStopParamsWithHTTPClient(client *http.Client) *JobStopParams { + var () + return &JobStopParams{ + HTTPClient: client, + } +} + +/* +JobStopParams contains all the parameters to send to the API endpoint +for the job stop operation typically these are written to a http.Request +*/ +type JobStopParams struct { + + /*Jobid + jobid + + */ + Jobid *models.Jobid + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the job stop params +func (o *JobStopParams) WithTimeout(timeout time.Duration) *JobStopParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the job stop params +func (o *JobStopParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the job stop params +func (o *JobStopParams) WithContext(ctx context.Context) *JobStopParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the job stop params +func (o *JobStopParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the job stop params +func (o *JobStopParams) WithHTTPClient(client *http.Client) *JobStopParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the job stop params +func (o *JobStopParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithJobid adds the jobid to the job stop params +func (o *JobStopParams) WithJobid(jobid *models.Jobid) *JobStopParams { + o.SetJobid(jobid) + return o +} + +// SetJobid adds the jobid to the job stop params +func (o *JobStopParams) SetJobid(jobid *models.Jobid) { + o.Jobid = jobid +} + +// WriteToRequest writes these params to a swagger request +func (o *JobStopParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Jobid != nil { + if err := r.SetBodyParam(o.Jobid); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_stop_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_stop_responses.go new file mode 100644 index 0000000000..7dd272a47f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/job_stop_responses.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// JobStopReader is a Reader for the JobStop structure. +type JobStopReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *JobStopReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewJobStopOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewJobStopDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewJobStopOK creates a JobStopOK with default headers values +func NewJobStopOK() *JobStopOK { + return &JobStopOK{} +} + +/* +JobStopOK handles this case with default header values. + +Empty object +*/ +type JobStopOK struct { + Payload interface{} + JobID int64 +} + +func (o *JobStopOK) GetPayload() interface{} { + return o.Payload +} + +func (o *JobStopOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewJobStopDefault creates a JobStopDefault with default headers values +func NewJobStopDefault(code int) *JobStopDefault { + return &JobStopDefault{ + _statusCode: code, + } +} + +/* +JobStopDefault handles this case with default header values. + +Server error +*/ +type JobStopDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the job stop default response +func (o *JobStopDefault) Code() int { + return o._statusCode +} + +func (o *JobStopDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *JobStopDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *JobStopDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/node_info_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/node_info_parameters.go new file mode 100644 index 0000000000..22b2ccb83c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/node_info_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewNodeInfoParams creates a new NodeInfoParams object +// with the default values initialized. +func NewNodeInfoParams() *NodeInfoParams { + + return &NodeInfoParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewNodeInfoParamsWithTimeout creates a new NodeInfoParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewNodeInfoParamsWithTimeout(timeout time.Duration) *NodeInfoParams { + + return &NodeInfoParams{ + + timeout: timeout, + } +} + +// NewNodeInfoParamsWithContext creates a new NodeInfoParams object +// with the default values initialized, and the ability to set a context for a request +func NewNodeInfoParamsWithContext(ctx context.Context) *NodeInfoParams { + + return &NodeInfoParams{ + + Context: ctx, + } +} + +// NewNodeInfoParamsWithHTTPClient creates a new NodeInfoParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewNodeInfoParamsWithHTTPClient(client *http.Client) *NodeInfoParams { + + return &NodeInfoParams{ + HTTPClient: client, + } +} + +/* +NodeInfoParams contains all the parameters to send to the API endpoint +for the node info operation typically these are written to a http.Request +*/ +type NodeInfoParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the node info params +func (o *NodeInfoParams) WithTimeout(timeout time.Duration) *NodeInfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the node info params +func (o *NodeInfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the node info params +func (o *NodeInfoParams) WithContext(ctx context.Context) *NodeInfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the node info params +func (o *NodeInfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the node info params +func (o *NodeInfoParams) WithHTTPClient(client *http.Client) *NodeInfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the node info params +func (o *NodeInfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *NodeInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/node_info_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/node_info_responses.go new file mode 100644 index 0000000000..48671cc35f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/node_info_responses.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NodeInfoReader is a Reader for the NodeInfo structure. +type NodeInfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *NodeInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewNodeInfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewNodeInfoDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewNodeInfoOK creates a NodeInfoOK with default headers values +func NewNodeInfoOK() *NodeInfoOK { + return &NodeInfoOK{} +} + +/* +NodeInfoOK handles this case with default header values. + +node information +*/ +type NodeInfoOK struct { + Payload *models.NodeInfo + JobID int64 +} + +func (o *NodeInfoOK) GetPayload() *models.NodeInfo { + return o.Payload +} + +func (o *NodeInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NodeInfo) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewNodeInfoDefault creates a NodeInfoDefault with default headers values +func NewNodeInfoDefault(code int) *NodeInfoDefault { + return &NodeInfoDefault{ + _statusCode: code, + } +} + +/* +NodeInfoDefault handles this case with default header values. + +Server error +*/ +type NodeInfoDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the node info default response +func (o *NodeInfoDefault) Code() int { + return o._statusCode +} + +func (o *NodeInfoDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *NodeInfoDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *NodeInfoDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_about_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_about_parameters.go new file mode 100644 index 0000000000..4b2d93957f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_about_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewOperationsAboutParams creates a new OperationsAboutParams object +// with the default values initialized. +func NewOperationsAboutParams() *OperationsAboutParams { + var () + return &OperationsAboutParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewOperationsAboutParamsWithTimeout creates a new OperationsAboutParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewOperationsAboutParamsWithTimeout(timeout time.Duration) *OperationsAboutParams { + var () + return &OperationsAboutParams{ + + timeout: timeout, + } +} + +// NewOperationsAboutParamsWithContext creates a new OperationsAboutParams object +// with the default values initialized, and the ability to set a context for a request +func NewOperationsAboutParamsWithContext(ctx context.Context) *OperationsAboutParams { + var () + return &OperationsAboutParams{ + + Context: ctx, + } +} + +// NewOperationsAboutParamsWithHTTPClient creates a new OperationsAboutParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewOperationsAboutParamsWithHTTPClient(client *http.Client) *OperationsAboutParams { + var () + return &OperationsAboutParams{ + HTTPClient: client, + } +} + +/* +OperationsAboutParams contains all the parameters to send to the API endpoint +for the operations about operation typically these are written to a http.Request +*/ +type OperationsAboutParams struct { + + /*RemotePath + Remote path + + */ + RemotePath *models.RemotePath + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the operations about params +func (o *OperationsAboutParams) WithTimeout(timeout time.Duration) *OperationsAboutParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the operations about params +func (o *OperationsAboutParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the operations about params +func (o *OperationsAboutParams) WithContext(ctx context.Context) *OperationsAboutParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the operations about params +func (o *OperationsAboutParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the operations about params +func (o *OperationsAboutParams) WithHTTPClient(client *http.Client) *OperationsAboutParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the operations about params +func (o *OperationsAboutParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRemotePath adds the remotePath to the operations about params +func (o *OperationsAboutParams) WithRemotePath(remotePath *models.RemotePath) *OperationsAboutParams { + o.SetRemotePath(remotePath) + return o +} + +// SetRemotePath adds the remotePath to the operations about params +func (o *OperationsAboutParams) SetRemotePath(remotePath *models.RemotePath) { + o.RemotePath = remotePath +} + +// WriteToRequest writes these params to a swagger request +func (o *OperationsAboutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.RemotePath != nil { + if err := r.SetBodyParam(o.RemotePath); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_about_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_about_responses.go new file mode 100644 index 0000000000..b9a4573292 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_about_responses.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// OperationsAboutReader is a Reader for the OperationsAbout structure. +type OperationsAboutReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *OperationsAboutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewOperationsAboutOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewOperationsAboutDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewOperationsAboutOK creates a OperationsAboutOK with default headers values +func NewOperationsAboutOK() *OperationsAboutOK { + return &OperationsAboutOK{} +} + +/* +OperationsAboutOK handles this case with default header values. + +File system details +*/ +type OperationsAboutOK struct { + Payload *models.FileSystemDetails + JobID int64 +} + +func (o *OperationsAboutOK) GetPayload() *models.FileSystemDetails { + return o.Payload +} + +func (o *OperationsAboutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FileSystemDetails) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewOperationsAboutDefault creates a OperationsAboutDefault with default headers values +func NewOperationsAboutDefault(code int) *OperationsAboutDefault { + return &OperationsAboutDefault{ + _statusCode: code, + } +} + +/* +OperationsAboutDefault handles this case with default header values. + +Server error +*/ +type OperationsAboutDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the operations about default response +func (o *OperationsAboutDefault) Code() int { + return o._statusCode +} + +func (o *OperationsAboutDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *OperationsAboutDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *OperationsAboutDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_check_permissions_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_check_permissions_parameters.go new file mode 100644 index 0000000000..ca746a0270 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_check_permissions_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewOperationsCheckPermissionsParams creates a new OperationsCheckPermissionsParams object +// with the default values initialized. +func NewOperationsCheckPermissionsParams() *OperationsCheckPermissionsParams { + var () + return &OperationsCheckPermissionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewOperationsCheckPermissionsParamsWithTimeout creates a new OperationsCheckPermissionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewOperationsCheckPermissionsParamsWithTimeout(timeout time.Duration) *OperationsCheckPermissionsParams { + var () + return &OperationsCheckPermissionsParams{ + + timeout: timeout, + } +} + +// NewOperationsCheckPermissionsParamsWithContext creates a new OperationsCheckPermissionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewOperationsCheckPermissionsParamsWithContext(ctx context.Context) *OperationsCheckPermissionsParams { + var () + return &OperationsCheckPermissionsParams{ + + Context: ctx, + } +} + +// NewOperationsCheckPermissionsParamsWithHTTPClient creates a new OperationsCheckPermissionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewOperationsCheckPermissionsParamsWithHTTPClient(client *http.Client) *OperationsCheckPermissionsParams { + var () + return &OperationsCheckPermissionsParams{ + HTTPClient: client, + } +} + +/* +OperationsCheckPermissionsParams contains all the parameters to send to the API endpoint +for the operations check permissions operation typically these are written to a http.Request +*/ +type OperationsCheckPermissionsParams struct { + + /*RemotePath + Remote path + + */ + RemotePath *models.RemotePath + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the operations check permissions params +func (o *OperationsCheckPermissionsParams) WithTimeout(timeout time.Duration) *OperationsCheckPermissionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the operations check permissions params +func (o *OperationsCheckPermissionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the operations check permissions params +func (o *OperationsCheckPermissionsParams) WithContext(ctx context.Context) *OperationsCheckPermissionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the operations check permissions params +func (o *OperationsCheckPermissionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the operations check permissions params +func (o *OperationsCheckPermissionsParams) WithHTTPClient(client *http.Client) *OperationsCheckPermissionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the operations check permissions params +func (o *OperationsCheckPermissionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRemotePath adds the remotePath to the operations check permissions params +func (o *OperationsCheckPermissionsParams) WithRemotePath(remotePath *models.RemotePath) *OperationsCheckPermissionsParams { + o.SetRemotePath(remotePath) + return o +} + +// SetRemotePath adds the remotePath to the operations check permissions params +func (o *OperationsCheckPermissionsParams) SetRemotePath(remotePath *models.RemotePath) { + o.RemotePath = remotePath +} + +// WriteToRequest writes these params to a swagger request +func (o *OperationsCheckPermissionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.RemotePath != nil { + if err := r.SetBodyParam(o.RemotePath); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_check_permissions_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_check_permissions_responses.go new file mode 100644 index 0000000000..abaf73fb8a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_check_permissions_responses.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// OperationsCheckPermissionsReader is a Reader for the OperationsCheckPermissions structure. +type OperationsCheckPermissionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *OperationsCheckPermissionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewOperationsCheckPermissionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewOperationsCheckPermissionsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewOperationsCheckPermissionsOK creates a OperationsCheckPermissionsOK with default headers values +func NewOperationsCheckPermissionsOK() *OperationsCheckPermissionsOK { + return &OperationsCheckPermissionsOK{} +} + +/* +OperationsCheckPermissionsOK handles this case with default header values. + +Empty object +*/ +type OperationsCheckPermissionsOK struct { + Payload interface{} + JobID int64 +} + +func (o *OperationsCheckPermissionsOK) GetPayload() interface{} { + return o.Payload +} + +func (o *OperationsCheckPermissionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewOperationsCheckPermissionsDefault creates a OperationsCheckPermissionsDefault with default headers values +func NewOperationsCheckPermissionsDefault(code int) *OperationsCheckPermissionsDefault { + return &OperationsCheckPermissionsDefault{ + _statusCode: code, + } +} + +/* +OperationsCheckPermissionsDefault handles this case with default header values. + +Server error +*/ +type OperationsCheckPermissionsDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the operations check permissions default response +func (o *OperationsCheckPermissionsDefault) Code() int { + return o._statusCode +} + +func (o *OperationsCheckPermissionsDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *OperationsCheckPermissionsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *OperationsCheckPermissionsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_client.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_client.go new file mode 100644 index 0000000000..18bd52efca --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_client.go @@ -0,0 +1,811 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new operations API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for operations API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + CoreBwlimit(params *CoreBwlimitParams) (*CoreBwlimitOK, error) + + CoreStatsDelete(params *CoreStatsDeleteParams) (*CoreStatsDeleteOK, error) + + CoreStatsReset(params *CoreStatsResetParams) (*CoreStatsResetOK, error) + + FreeOSMemory(params *FreeOSMemoryParams) (*FreeOSMemoryOK, error) + + JobInfo(params *JobInfoParams) (*JobInfoOK, error) + + JobProgress(params *JobProgressParams) (*JobProgressOK, error) + + JobStop(params *JobStopParams) (*JobStopOK, error) + + NodeInfo(params *NodeInfoParams) (*NodeInfoOK, error) + + OperationsAbout(params *OperationsAboutParams) (*OperationsAboutOK, error) + + OperationsCheckPermissions(params *OperationsCheckPermissionsParams) (*OperationsCheckPermissionsOK, error) + + OperationsCopyfile(params *OperationsCopyfileParams) (*OperationsCopyfileOK, error) + + OperationsDeletefile(params *OperationsDeletefileParams) (*OperationsDeletefileOK, error) + + OperationsDeletepaths(params *OperationsDeletepathsParams) (*OperationsDeletepathsOK, error) + + OperationsFileInfo(params *OperationsFileInfoParams) (*OperationsFileInfoOK, error) + + OperationsList(params *OperationsListParams) (*OperationsListOK, error) + + OperationsMovefile(params *OperationsMovefileParams) (*OperationsMovefileOK, error) + + OperationsPurge(params *OperationsPurgeParams) (*OperationsPurgeOK, error) + + Reload(params *ReloadParams) (*ReloadOK, error) + + SyncCopyDir(params *SyncCopyDirParams) (*SyncCopyDirOK, error) + + SyncCopyPaths(params *SyncCopyPathsParams) (*SyncCopyPathsOK, error) + + SyncMoveDir(params *SyncMoveDirParams) (*SyncMoveDirOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +CoreBwlimit sets the bandwidth limit + +This sets the bandwidth limit to that passed in +*/ +func (a *Client) CoreBwlimit(params *CoreBwlimitParams) (*CoreBwlimitOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCoreBwlimitParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CoreBwlimit", + Method: "POST", + PathPattern: "/rclone/core/bwlimit", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CoreBwlimitReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CoreBwlimitOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CoreBwlimitDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CoreStatsDelete deletes specific stats group + +Delete stats +*/ +func (a *Client) CoreStatsDelete(params *CoreStatsDeleteParams) (*CoreStatsDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCoreStatsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CoreStatsDelete", + Method: "POST", + PathPattern: "/rclone/core/stats-delete", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CoreStatsDeleteReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CoreStatsDeleteOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CoreStatsDeleteDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CoreStatsReset resets all or specific stats group + +Resets stats +*/ +func (a *Client) CoreStatsReset(params *CoreStatsResetParams) (*CoreStatsResetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCoreStatsResetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CoreStatsReset", + Method: "POST", + PathPattern: "/rclone/core/stats-reset", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CoreStatsResetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CoreStatsResetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CoreStatsResetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FreeOSMemory returns memory to o s + +Run debug.FreeOSMemory on the agent +*/ +func (a *Client) FreeOSMemory(params *FreeOSMemoryParams) (*FreeOSMemoryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFreeOSMemoryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "FreeOSMemory", + Method: "POST", + PathPattern: "/free_os_memory", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FreeOSMemoryReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FreeOSMemoryOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FreeOSMemoryDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +JobInfo transfers stats about the job + +Returns current, completed transfers and job stats +*/ +func (a *Client) JobInfo(params *JobInfoParams) (*JobInfoOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewJobInfoParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "JobInfo", + Method: "POST", + PathPattern: "/rclone/job/info", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &JobInfoReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*JobInfoOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*JobInfoDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +JobProgress returns aggregated job stats + +Returns aggregated job stats +*/ +func (a *Client) JobProgress(params *JobProgressParams) (*JobProgressOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewJobProgressParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "JobProgress", + Method: "POST", + PathPattern: "/rclone/job/progress", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &JobProgressReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*JobProgressOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*JobProgressDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +JobStop stops async job + +Stops job with provided ID +*/ +func (a *Client) JobStop(params *JobStopParams) (*JobStopOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewJobStopParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "JobStop", + Method: "POST", + PathPattern: "/rclone/job/stop", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &JobStopReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*JobStopOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*JobStopDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +NodeInfo gets information about scylla node + +Get information about Scylla node +*/ +func (a *Client) NodeInfo(params *NodeInfoParams) (*NodeInfoOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewNodeInfoParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "NodeInfo", + Method: "GET", + PathPattern: "/node_info", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &NodeInfoReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*NodeInfoOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*NodeInfoDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +OperationsAbout abouts remote + +Get usage information from the remote +*/ +func (a *Client) OperationsAbout(params *OperationsAboutParams) (*OperationsAboutOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewOperationsAboutParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "OperationsAbout", + Method: "POST", + PathPattern: "/rclone/operations/about", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &OperationsAboutReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*OperationsAboutOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*OperationsAboutDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +OperationsCheckPermissions checks fs + +Check if the fs is fully accessible +*/ +func (a *Client) OperationsCheckPermissions(params *OperationsCheckPermissionsParams) (*OperationsCheckPermissionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewOperationsCheckPermissionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "OperationsCheckPermissions", + Method: "POST", + PathPattern: "/rclone/operations/check-permissions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &OperationsCheckPermissionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*OperationsCheckPermissionsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*OperationsCheckPermissionsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +OperationsCopyfile copies a file + +Copy a file from source remote to destination remote +*/ +func (a *Client) OperationsCopyfile(params *OperationsCopyfileParams) (*OperationsCopyfileOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewOperationsCopyfileParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "OperationsCopyfile", + Method: "POST", + PathPattern: "/rclone/operations/copyfile", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &OperationsCopyfileReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*OperationsCopyfileOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*OperationsCopyfileDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +OperationsDeletefile deletes file + +Remove the single file pointed to +*/ +func (a *Client) OperationsDeletefile(params *OperationsDeletefileParams) (*OperationsDeletefileOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewOperationsDeletefileParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "OperationsDeletefile", + Method: "POST", + PathPattern: "/rclone/operations/deletefile", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &OperationsDeletefileReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*OperationsDeletefileOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*OperationsDeletefileDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +OperationsDeletepaths deletes paths + +Delete provided list of paths +*/ +func (a *Client) OperationsDeletepaths(params *OperationsDeletepathsParams) (*OperationsDeletepathsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewOperationsDeletepathsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "OperationsDeletepaths", + Method: "POST", + PathPattern: "/rclone/operations/deletepaths", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &OperationsDeletepathsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*OperationsDeletepathsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*OperationsDeletepathsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +OperationsFileInfo objects info + +Get basic file information +*/ +func (a *Client) OperationsFileInfo(params *OperationsFileInfoParams) (*OperationsFileInfoOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewOperationsFileInfoParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "OperationsFileInfo", + Method: "POST", + PathPattern: "/rclone/operations/fileinfo", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &OperationsFileInfoReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*OperationsFileInfoOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*OperationsFileInfoDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +OperationsList lists remote + +List the given remote and path +*/ +func (a *Client) OperationsList(params *OperationsListParams) (*OperationsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewOperationsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "OperationsList", + Method: "POST", + PathPattern: "/rclone/operations/list", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &OperationsListReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*OperationsListOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*OperationsListDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +OperationsMovefile moves a file + +Move a file from source remote to destination remote +*/ +func (a *Client) OperationsMovefile(params *OperationsMovefileParams) (*OperationsMovefileOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewOperationsMovefileParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "OperationsMovefile", + Method: "POST", + PathPattern: "/rclone/operations/movefile", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &OperationsMovefileReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*OperationsMovefileOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*OperationsMovefileDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +OperationsPurge purges container + +Remove a directory or container and all of its contents +*/ +func (a *Client) OperationsPurge(params *OperationsPurgeParams) (*OperationsPurgeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewOperationsPurgeParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "OperationsPurge", + Method: "POST", + PathPattern: "/rclone/operations/purge", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &OperationsPurgeReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*OperationsPurgeOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*OperationsPurgeDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +Reload reloads agent config + +Reload agent config +*/ +func (a *Client) Reload(params *ReloadParams) (*ReloadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReloadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "Reload", + Method: "POST", + PathPattern: "/terminate", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ReloadReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ReloadOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ReloadDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +SyncCopyDir copies dir contents to directory + +Copy contents from path on source fs to path on destination fs +*/ +func (a *Client) SyncCopyDir(params *SyncCopyDirParams) (*SyncCopyDirOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSyncCopyDirParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "SyncCopyDir", + Method: "POST", + PathPattern: "/rclone/sync/copydir", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SyncCopyDirReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SyncCopyDirOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SyncCopyDirDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +SyncCopyPaths copies paths from fsrc remote src paths to fdst remote dst paths + +Copy provided list of paths from directory on source fs to directory on destination fs +*/ +func (a *Client) SyncCopyPaths(params *SyncCopyPathsParams) (*SyncCopyPathsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSyncCopyPathsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "SyncCopyPaths", + Method: "POST", + PathPattern: "/rclone/sync/copypaths", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SyncCopyPathsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SyncCopyPathsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SyncCopyPathsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +SyncMoveDir moves dir contents to directory + +Move contents from path on source fs to path on destination fs +*/ +func (a *Client) SyncMoveDir(params *SyncMoveDirParams) (*SyncMoveDirOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSyncMoveDirParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "SyncMoveDir", + Method: "POST", + PathPattern: "/rclone/sync/movedir", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SyncMoveDirReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SyncMoveDirOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SyncMoveDirDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_copyfile_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_copyfile_parameters.go new file mode 100644 index 0000000000..0f931785d9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_copyfile_parameters.go @@ -0,0 +1,164 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewOperationsCopyfileParams creates a new OperationsCopyfileParams object +// with the default values initialized. +func NewOperationsCopyfileParams() *OperationsCopyfileParams { + var () + return &OperationsCopyfileParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewOperationsCopyfileParamsWithTimeout creates a new OperationsCopyfileParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewOperationsCopyfileParamsWithTimeout(timeout time.Duration) *OperationsCopyfileParams { + var () + return &OperationsCopyfileParams{ + + timeout: timeout, + } +} + +// NewOperationsCopyfileParamsWithContext creates a new OperationsCopyfileParams object +// with the default values initialized, and the ability to set a context for a request +func NewOperationsCopyfileParamsWithContext(ctx context.Context) *OperationsCopyfileParams { + var () + return &OperationsCopyfileParams{ + + Context: ctx, + } +} + +// NewOperationsCopyfileParamsWithHTTPClient creates a new OperationsCopyfileParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewOperationsCopyfileParamsWithHTTPClient(client *http.Client) *OperationsCopyfileParams { + var () + return &OperationsCopyfileParams{ + HTTPClient: client, + } +} + +/* +OperationsCopyfileParams contains all the parameters to send to the API endpoint +for the operations copyfile operation typically these are written to a http.Request +*/ +type OperationsCopyfileParams struct { + + /*Options + Options + + */ + Options *models.MoveOrCopyFileOptions + /*Group + Place this operation under this stat group + + */ + Group string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the operations copyfile params +func (o *OperationsCopyfileParams) WithTimeout(timeout time.Duration) *OperationsCopyfileParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the operations copyfile params +func (o *OperationsCopyfileParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the operations copyfile params +func (o *OperationsCopyfileParams) WithContext(ctx context.Context) *OperationsCopyfileParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the operations copyfile params +func (o *OperationsCopyfileParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the operations copyfile params +func (o *OperationsCopyfileParams) WithHTTPClient(client *http.Client) *OperationsCopyfileParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the operations copyfile params +func (o *OperationsCopyfileParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOptions adds the options to the operations copyfile params +func (o *OperationsCopyfileParams) WithOptions(options *models.MoveOrCopyFileOptions) *OperationsCopyfileParams { + o.SetOptions(options) + return o +} + +// SetOptions adds the options to the operations copyfile params +func (o *OperationsCopyfileParams) SetOptions(options *models.MoveOrCopyFileOptions) { + o.Options = options +} + +// WithGroup adds the group to the operations copyfile params +func (o *OperationsCopyfileParams) WithGroup(group string) *OperationsCopyfileParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the operations copyfile params +func (o *OperationsCopyfileParams) SetGroup(group string) { + o.Group = group +} + +// WriteToRequest writes these params to a swagger request +func (o *OperationsCopyfileParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Options != nil { + if err := r.SetBodyParam(o.Options); err != nil { + return err + } + } + + // query param _group + qrGroup := o.Group + qGroup := qrGroup + if qGroup != "" { + if err := r.SetQueryParam("_group", qGroup); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_copyfile_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_copyfile_responses.go new file mode 100644 index 0000000000..188278a84d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_copyfile_responses.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// OperationsCopyfileReader is a Reader for the OperationsCopyfile structure. +type OperationsCopyfileReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *OperationsCopyfileReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewOperationsCopyfileOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewOperationsCopyfileDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewOperationsCopyfileOK creates a OperationsCopyfileOK with default headers values +func NewOperationsCopyfileOK() *OperationsCopyfileOK { + return &OperationsCopyfileOK{} +} + +/* +OperationsCopyfileOK handles this case with default header values. + +Empty object +*/ +type OperationsCopyfileOK struct { + JobID int64 +} + +func (o *OperationsCopyfileOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewOperationsCopyfileDefault creates a OperationsCopyfileDefault with default headers values +func NewOperationsCopyfileDefault(code int) *OperationsCopyfileDefault { + return &OperationsCopyfileDefault{ + _statusCode: code, + } +} + +/* +OperationsCopyfileDefault handles this case with default header values. + +Server error +*/ +type OperationsCopyfileDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the operations copyfile default response +func (o *OperationsCopyfileDefault) Code() int { + return o._statusCode +} + +func (o *OperationsCopyfileDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *OperationsCopyfileDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *OperationsCopyfileDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_deletefile_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_deletefile_parameters.go new file mode 100644 index 0000000000..587e30092d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_deletefile_parameters.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewOperationsDeletefileParams creates a new OperationsDeletefileParams object +// with the default values initialized. +func NewOperationsDeletefileParams() *OperationsDeletefileParams { + var ( + asyncDefault = bool(true) + ) + return &OperationsDeletefileParams{ + Async: asyncDefault, + + timeout: cr.DefaultTimeout, + } +} + +// NewOperationsDeletefileParamsWithTimeout creates a new OperationsDeletefileParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewOperationsDeletefileParamsWithTimeout(timeout time.Duration) *OperationsDeletefileParams { + var ( + asyncDefault = bool(true) + ) + return &OperationsDeletefileParams{ + Async: asyncDefault, + + timeout: timeout, + } +} + +// NewOperationsDeletefileParamsWithContext creates a new OperationsDeletefileParams object +// with the default values initialized, and the ability to set a context for a request +func NewOperationsDeletefileParamsWithContext(ctx context.Context) *OperationsDeletefileParams { + var ( + asyncDefault = bool(true) + ) + return &OperationsDeletefileParams{ + Async: asyncDefault, + + Context: ctx, + } +} + +// NewOperationsDeletefileParamsWithHTTPClient creates a new OperationsDeletefileParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewOperationsDeletefileParamsWithHTTPClient(client *http.Client) *OperationsDeletefileParams { + var ( + asyncDefault = bool(true) + ) + return &OperationsDeletefileParams{ + Async: asyncDefault, + HTTPClient: client, + } +} + +/* +OperationsDeletefileParams contains all the parameters to send to the API endpoint +for the operations deletefile operation typically these are written to a http.Request +*/ +type OperationsDeletefileParams struct { + + /*RemotePath + Remote path + + */ + RemotePath *models.RemotePath + /*Async + Async request + + */ + Async bool + /*Group + Place this operation under this stat group + + */ + Group string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the operations deletefile params +func (o *OperationsDeletefileParams) WithTimeout(timeout time.Duration) *OperationsDeletefileParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the operations deletefile params +func (o *OperationsDeletefileParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the operations deletefile params +func (o *OperationsDeletefileParams) WithContext(ctx context.Context) *OperationsDeletefileParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the operations deletefile params +func (o *OperationsDeletefileParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the operations deletefile params +func (o *OperationsDeletefileParams) WithHTTPClient(client *http.Client) *OperationsDeletefileParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the operations deletefile params +func (o *OperationsDeletefileParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRemotePath adds the remotePath to the operations deletefile params +func (o *OperationsDeletefileParams) WithRemotePath(remotePath *models.RemotePath) *OperationsDeletefileParams { + o.SetRemotePath(remotePath) + return o +} + +// SetRemotePath adds the remotePath to the operations deletefile params +func (o *OperationsDeletefileParams) SetRemotePath(remotePath *models.RemotePath) { + o.RemotePath = remotePath +} + +// WithAsync adds the async to the operations deletefile params +func (o *OperationsDeletefileParams) WithAsync(async bool) *OperationsDeletefileParams { + o.SetAsync(async) + return o +} + +// SetAsync adds the async to the operations deletefile params +func (o *OperationsDeletefileParams) SetAsync(async bool) { + o.Async = async +} + +// WithGroup adds the group to the operations deletefile params +func (o *OperationsDeletefileParams) WithGroup(group string) *OperationsDeletefileParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the operations deletefile params +func (o *OperationsDeletefileParams) SetGroup(group string) { + o.Group = group +} + +// WriteToRequest writes these params to a swagger request +func (o *OperationsDeletefileParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.RemotePath != nil { + if err := r.SetBodyParam(o.RemotePath); err != nil { + return err + } + } + + // query param _async + qrAsync := o.Async + qAsync := swag.FormatBool(qrAsync) + if qAsync != "" { + if err := r.SetQueryParam("_async", qAsync); err != nil { + return err + } + } + + // query param _group + qrGroup := o.Group + qGroup := qrGroup + if qGroup != "" { + if err := r.SetQueryParam("_group", qGroup); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_deletefile_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_deletefile_responses.go new file mode 100644 index 0000000000..707fd78c65 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_deletefile_responses.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// OperationsDeletefileReader is a Reader for the OperationsDeletefile structure. +type OperationsDeletefileReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *OperationsDeletefileReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewOperationsDeletefileOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewOperationsDeletefileDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewOperationsDeletefileOK creates a OperationsDeletefileOK with default headers values +func NewOperationsDeletefileOK() *OperationsDeletefileOK { + return &OperationsDeletefileOK{} +} + +/* +OperationsDeletefileOK handles this case with default header values. + +Job ID +*/ +type OperationsDeletefileOK struct { + Payload *models.Jobid + JobID int64 +} + +func (o *OperationsDeletefileOK) GetPayload() *models.Jobid { + return o.Payload +} + +func (o *OperationsDeletefileOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Jobid) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewOperationsDeletefileDefault creates a OperationsDeletefileDefault with default headers values +func NewOperationsDeletefileDefault(code int) *OperationsDeletefileDefault { + return &OperationsDeletefileDefault{ + _statusCode: code, + } +} + +/* +OperationsDeletefileDefault handles this case with default header values. + +Server error +*/ +type OperationsDeletefileDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the operations deletefile default response +func (o *OperationsDeletefileDefault) Code() int { + return o._statusCode +} + +func (o *OperationsDeletefileDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *OperationsDeletefileDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *OperationsDeletefileDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_deletepaths_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_deletepaths_parameters.go new file mode 100644 index 0000000000..df4589fc8a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_deletepaths_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewOperationsDeletepathsParams creates a new OperationsDeletepathsParams object +// with the default values initialized. +func NewOperationsDeletepathsParams() *OperationsDeletepathsParams { + var () + return &OperationsDeletepathsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewOperationsDeletepathsParamsWithTimeout creates a new OperationsDeletepathsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewOperationsDeletepathsParamsWithTimeout(timeout time.Duration) *OperationsDeletepathsParams { + var () + return &OperationsDeletepathsParams{ + + timeout: timeout, + } +} + +// NewOperationsDeletepathsParamsWithContext creates a new OperationsDeletepathsParams object +// with the default values initialized, and the ability to set a context for a request +func NewOperationsDeletepathsParamsWithContext(ctx context.Context) *OperationsDeletepathsParams { + var () + return &OperationsDeletepathsParams{ + + Context: ctx, + } +} + +// NewOperationsDeletepathsParamsWithHTTPClient creates a new OperationsDeletepathsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewOperationsDeletepathsParamsWithHTTPClient(client *http.Client) *OperationsDeletepathsParams { + var () + return &OperationsDeletepathsParams{ + HTTPClient: client, + } +} + +/* +OperationsDeletepathsParams contains all the parameters to send to the API endpoint +for the operations deletepaths operation typically these are written to a http.Request +*/ +type OperationsDeletepathsParams struct { + + /*Options + Options + + */ + Options *models.DeletePathsOptions + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the operations deletepaths params +func (o *OperationsDeletepathsParams) WithTimeout(timeout time.Duration) *OperationsDeletepathsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the operations deletepaths params +func (o *OperationsDeletepathsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the operations deletepaths params +func (o *OperationsDeletepathsParams) WithContext(ctx context.Context) *OperationsDeletepathsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the operations deletepaths params +func (o *OperationsDeletepathsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the operations deletepaths params +func (o *OperationsDeletepathsParams) WithHTTPClient(client *http.Client) *OperationsDeletepathsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the operations deletepaths params +func (o *OperationsDeletepathsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOptions adds the options to the operations deletepaths params +func (o *OperationsDeletepathsParams) WithOptions(options *models.DeletePathsOptions) *OperationsDeletepathsParams { + o.SetOptions(options) + return o +} + +// SetOptions adds the options to the operations deletepaths params +func (o *OperationsDeletepathsParams) SetOptions(options *models.DeletePathsOptions) { + o.Options = options +} + +// WriteToRequest writes these params to a swagger request +func (o *OperationsDeletepathsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Options != nil { + if err := r.SetBodyParam(o.Options); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_deletepaths_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_deletepaths_responses.go new file mode 100644 index 0000000000..4838cf8cb6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_deletepaths_responses.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// OperationsDeletepathsReader is a Reader for the OperationsDeletepaths structure. +type OperationsDeletepathsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *OperationsDeletepathsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewOperationsDeletepathsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewOperationsDeletepathsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewOperationsDeletepathsOK creates a OperationsDeletepathsOK with default headers values +func NewOperationsDeletepathsOK() *OperationsDeletepathsOK { + return &OperationsDeletepathsOK{} +} + +/* +OperationsDeletepathsOK handles this case with default header values. + +Deleted files count +*/ +type OperationsDeletepathsOK struct { + Payload *OperationsDeletepathsOKBody + JobID int64 +} + +func (o *OperationsDeletepathsOK) GetPayload() *OperationsDeletepathsOKBody { + return o.Payload +} + +func (o *OperationsDeletepathsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(OperationsDeletepathsOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewOperationsDeletepathsDefault creates a OperationsDeletepathsDefault with default headers values +func NewOperationsDeletepathsDefault(code int) *OperationsDeletepathsDefault { + return &OperationsDeletepathsDefault{ + _statusCode: code, + } +} + +/* +OperationsDeletepathsDefault handles this case with default header values. + +Server error +*/ +type OperationsDeletepathsDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the operations deletepaths default response +func (o *OperationsDeletepathsDefault) Code() int { + return o._statusCode +} + +func (o *OperationsDeletepathsDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *OperationsDeletepathsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *OperationsDeletepathsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} + +/* +OperationsDeletepathsOKBody operations deletepaths o k body +swagger:model OperationsDeletepathsOKBody +*/ +type OperationsDeletepathsOKBody struct { + + // deletes + Deletes int64 `json:"deletes,omitempty"` +} + +// Validate validates this operations deletepaths o k body +func (o *OperationsDeletepathsOKBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *OperationsDeletepathsOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *OperationsDeletepathsOKBody) UnmarshalBinary(b []byte) error { + var res OperationsDeletepathsOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_file_info_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_file_info_parameters.go new file mode 100644 index 0000000000..d77627e800 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_file_info_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewOperationsFileInfoParams creates a new OperationsFileInfoParams object +// with the default values initialized. +func NewOperationsFileInfoParams() *OperationsFileInfoParams { + var () + return &OperationsFileInfoParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewOperationsFileInfoParamsWithTimeout creates a new OperationsFileInfoParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewOperationsFileInfoParamsWithTimeout(timeout time.Duration) *OperationsFileInfoParams { + var () + return &OperationsFileInfoParams{ + + timeout: timeout, + } +} + +// NewOperationsFileInfoParamsWithContext creates a new OperationsFileInfoParams object +// with the default values initialized, and the ability to set a context for a request +func NewOperationsFileInfoParamsWithContext(ctx context.Context) *OperationsFileInfoParams { + var () + return &OperationsFileInfoParams{ + + Context: ctx, + } +} + +// NewOperationsFileInfoParamsWithHTTPClient creates a new OperationsFileInfoParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewOperationsFileInfoParamsWithHTTPClient(client *http.Client) *OperationsFileInfoParams { + var () + return &OperationsFileInfoParams{ + HTTPClient: client, + } +} + +/* +OperationsFileInfoParams contains all the parameters to send to the API endpoint +for the operations file info operation typically these are written to a http.Request +*/ +type OperationsFileInfoParams struct { + + /*RemotePath + Remote path + + */ + RemotePath *models.RemotePath + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the operations file info params +func (o *OperationsFileInfoParams) WithTimeout(timeout time.Duration) *OperationsFileInfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the operations file info params +func (o *OperationsFileInfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the operations file info params +func (o *OperationsFileInfoParams) WithContext(ctx context.Context) *OperationsFileInfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the operations file info params +func (o *OperationsFileInfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the operations file info params +func (o *OperationsFileInfoParams) WithHTTPClient(client *http.Client) *OperationsFileInfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the operations file info params +func (o *OperationsFileInfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRemotePath adds the remotePath to the operations file info params +func (o *OperationsFileInfoParams) WithRemotePath(remotePath *models.RemotePath) *OperationsFileInfoParams { + o.SetRemotePath(remotePath) + return o +} + +// SetRemotePath adds the remotePath to the operations file info params +func (o *OperationsFileInfoParams) SetRemotePath(remotePath *models.RemotePath) { + o.RemotePath = remotePath +} + +// WriteToRequest writes these params to a swagger request +func (o *OperationsFileInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.RemotePath != nil { + if err := r.SetBodyParam(o.RemotePath); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_file_info_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_file_info_responses.go new file mode 100644 index 0000000000..ae52cf8a70 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_file_info_responses.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// OperationsFileInfoReader is a Reader for the OperationsFileInfo structure. +type OperationsFileInfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *OperationsFileInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewOperationsFileInfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewOperationsFileInfoDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewOperationsFileInfoOK creates a OperationsFileInfoOK with default headers values +func NewOperationsFileInfoOK() *OperationsFileInfoOK { + return &OperationsFileInfoOK{} +} + +/* +OperationsFileInfoOK handles this case with default header values. + +File information +*/ +type OperationsFileInfoOK struct { + Payload *models.FileInfo + JobID int64 +} + +func (o *OperationsFileInfoOK) GetPayload() *models.FileInfo { + return o.Payload +} + +func (o *OperationsFileInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FileInfo) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewOperationsFileInfoDefault creates a OperationsFileInfoDefault with default headers values +func NewOperationsFileInfoDefault(code int) *OperationsFileInfoDefault { + return &OperationsFileInfoDefault{ + _statusCode: code, + } +} + +/* +OperationsFileInfoDefault handles this case with default header values. + +Server error +*/ +type OperationsFileInfoDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the operations file info default response +func (o *OperationsFileInfoDefault) Code() int { + return o._statusCode +} + +func (o *OperationsFileInfoDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *OperationsFileInfoDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *OperationsFileInfoDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_list_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_list_parameters.go new file mode 100644 index 0000000000..cd77d39377 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_list_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewOperationsListParams creates a new OperationsListParams object +// with the default values initialized. +func NewOperationsListParams() *OperationsListParams { + var () + return &OperationsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewOperationsListParamsWithTimeout creates a new OperationsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewOperationsListParamsWithTimeout(timeout time.Duration) *OperationsListParams { + var () + return &OperationsListParams{ + + timeout: timeout, + } +} + +// NewOperationsListParamsWithContext creates a new OperationsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewOperationsListParamsWithContext(ctx context.Context) *OperationsListParams { + var () + return &OperationsListParams{ + + Context: ctx, + } +} + +// NewOperationsListParamsWithHTTPClient creates a new OperationsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewOperationsListParamsWithHTTPClient(client *http.Client) *OperationsListParams { + var () + return &OperationsListParams{ + HTTPClient: client, + } +} + +/* +OperationsListParams contains all the parameters to send to the API endpoint +for the operations list operation typically these are written to a http.Request +*/ +type OperationsListParams struct { + + /*ListOpts + listOpts + + */ + ListOpts *models.ListOptions + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the operations list params +func (o *OperationsListParams) WithTimeout(timeout time.Duration) *OperationsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the operations list params +func (o *OperationsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the operations list params +func (o *OperationsListParams) WithContext(ctx context.Context) *OperationsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the operations list params +func (o *OperationsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the operations list params +func (o *OperationsListParams) WithHTTPClient(client *http.Client) *OperationsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the operations list params +func (o *OperationsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithListOpts adds the listOpts to the operations list params +func (o *OperationsListParams) WithListOpts(listOpts *models.ListOptions) *OperationsListParams { + o.SetListOpts(listOpts) + return o +} + +// SetListOpts adds the listOpts to the operations list params +func (o *OperationsListParams) SetListOpts(listOpts *models.ListOptions) { + o.ListOpts = listOpts +} + +// WriteToRequest writes these params to a swagger request +func (o *OperationsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ListOpts != nil { + if err := r.SetBodyParam(o.ListOpts); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_list_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_list_responses.go new file mode 100644 index 0000000000..5ed3ca3a55 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_list_responses.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// OperationsListReader is a Reader for the OperationsList structure. +type OperationsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *OperationsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewOperationsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewOperationsListDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewOperationsListOK creates a OperationsListOK with default headers values +func NewOperationsListOK() *OperationsListOK { + return &OperationsListOK{} +} + +/* +OperationsListOK handles this case with default header values. + +List of items +*/ +type OperationsListOK struct { + Payload *OperationsListOKBody + JobID int64 +} + +func (o *OperationsListOK) GetPayload() *OperationsListOKBody { + return o.Payload +} + +func (o *OperationsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(OperationsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewOperationsListDefault creates a OperationsListDefault with default headers values +func NewOperationsListDefault(code int) *OperationsListDefault { + return &OperationsListDefault{ + _statusCode: code, + } +} + +/* +OperationsListDefault handles this case with default header values. + +Server error +*/ +type OperationsListDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the operations list default response +func (o *OperationsListDefault) Code() int { + return o._statusCode +} + +func (o *OperationsListDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *OperationsListDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *OperationsListDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} + +/* +OperationsListOKBody operations list o k body +swagger:model OperationsListOKBody +*/ +type OperationsListOKBody struct { + + // list + List []*models.ListItem `json:"list"` +} + +// Validate validates this operations list o k body +func (o *OperationsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateList(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *OperationsListOKBody) validateList(formats strfmt.Registry) error { + + if swag.IsZero(o.List) { // not required + return nil + } + + for i := 0; i < len(o.List); i++ { + if swag.IsZero(o.List[i]) { // not required + continue + } + + if o.List[i] != nil { + if err := o.List[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operationsListOK" + "." + "list" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *OperationsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *OperationsListOKBody) UnmarshalBinary(b []byte) error { + var res OperationsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_movefile_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_movefile_parameters.go new file mode 100644 index 0000000000..8c412feb28 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_movefile_parameters.go @@ -0,0 +1,164 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewOperationsMovefileParams creates a new OperationsMovefileParams object +// with the default values initialized. +func NewOperationsMovefileParams() *OperationsMovefileParams { + var () + return &OperationsMovefileParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewOperationsMovefileParamsWithTimeout creates a new OperationsMovefileParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewOperationsMovefileParamsWithTimeout(timeout time.Duration) *OperationsMovefileParams { + var () + return &OperationsMovefileParams{ + + timeout: timeout, + } +} + +// NewOperationsMovefileParamsWithContext creates a new OperationsMovefileParams object +// with the default values initialized, and the ability to set a context for a request +func NewOperationsMovefileParamsWithContext(ctx context.Context) *OperationsMovefileParams { + var () + return &OperationsMovefileParams{ + + Context: ctx, + } +} + +// NewOperationsMovefileParamsWithHTTPClient creates a new OperationsMovefileParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewOperationsMovefileParamsWithHTTPClient(client *http.Client) *OperationsMovefileParams { + var () + return &OperationsMovefileParams{ + HTTPClient: client, + } +} + +/* +OperationsMovefileParams contains all the parameters to send to the API endpoint +for the operations movefile operation typically these are written to a http.Request +*/ +type OperationsMovefileParams struct { + + /*Options + Options + + */ + Options *models.MoveOrCopyFileOptions + /*Group + Place this operation under this stat group + + */ + Group string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the operations movefile params +func (o *OperationsMovefileParams) WithTimeout(timeout time.Duration) *OperationsMovefileParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the operations movefile params +func (o *OperationsMovefileParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the operations movefile params +func (o *OperationsMovefileParams) WithContext(ctx context.Context) *OperationsMovefileParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the operations movefile params +func (o *OperationsMovefileParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the operations movefile params +func (o *OperationsMovefileParams) WithHTTPClient(client *http.Client) *OperationsMovefileParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the operations movefile params +func (o *OperationsMovefileParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOptions adds the options to the operations movefile params +func (o *OperationsMovefileParams) WithOptions(options *models.MoveOrCopyFileOptions) *OperationsMovefileParams { + o.SetOptions(options) + return o +} + +// SetOptions adds the options to the operations movefile params +func (o *OperationsMovefileParams) SetOptions(options *models.MoveOrCopyFileOptions) { + o.Options = options +} + +// WithGroup adds the group to the operations movefile params +func (o *OperationsMovefileParams) WithGroup(group string) *OperationsMovefileParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the operations movefile params +func (o *OperationsMovefileParams) SetGroup(group string) { + o.Group = group +} + +// WriteToRequest writes these params to a swagger request +func (o *OperationsMovefileParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Options != nil { + if err := r.SetBodyParam(o.Options); err != nil { + return err + } + } + + // query param _group + qrGroup := o.Group + qGroup := qrGroup + if qGroup != "" { + if err := r.SetQueryParam("_group", qGroup); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_movefile_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_movefile_responses.go new file mode 100644 index 0000000000..1ad635d7d3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_movefile_responses.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// OperationsMovefileReader is a Reader for the OperationsMovefile structure. +type OperationsMovefileReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *OperationsMovefileReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewOperationsMovefileOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewOperationsMovefileDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewOperationsMovefileOK creates a OperationsMovefileOK with default headers values +func NewOperationsMovefileOK() *OperationsMovefileOK { + return &OperationsMovefileOK{} +} + +/* +OperationsMovefileOK handles this case with default header values. + +Empty object +*/ +type OperationsMovefileOK struct { + JobID int64 +} + +func (o *OperationsMovefileOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewOperationsMovefileDefault creates a OperationsMovefileDefault with default headers values +func NewOperationsMovefileDefault(code int) *OperationsMovefileDefault { + return &OperationsMovefileDefault{ + _statusCode: code, + } +} + +/* +OperationsMovefileDefault handles this case with default header values. + +Server error +*/ +type OperationsMovefileDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the operations movefile default response +func (o *OperationsMovefileDefault) Code() int { + return o._statusCode +} + +func (o *OperationsMovefileDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *OperationsMovefileDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *OperationsMovefileDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_purge_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_purge_parameters.go new file mode 100644 index 0000000000..7de11ad494 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_purge_parameters.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewOperationsPurgeParams creates a new OperationsPurgeParams object +// with the default values initialized. +func NewOperationsPurgeParams() *OperationsPurgeParams { + var ( + asyncDefault = bool(true) + ) + return &OperationsPurgeParams{ + Async: asyncDefault, + + timeout: cr.DefaultTimeout, + } +} + +// NewOperationsPurgeParamsWithTimeout creates a new OperationsPurgeParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewOperationsPurgeParamsWithTimeout(timeout time.Duration) *OperationsPurgeParams { + var ( + asyncDefault = bool(true) + ) + return &OperationsPurgeParams{ + Async: asyncDefault, + + timeout: timeout, + } +} + +// NewOperationsPurgeParamsWithContext creates a new OperationsPurgeParams object +// with the default values initialized, and the ability to set a context for a request +func NewOperationsPurgeParamsWithContext(ctx context.Context) *OperationsPurgeParams { + var ( + asyncDefault = bool(true) + ) + return &OperationsPurgeParams{ + Async: asyncDefault, + + Context: ctx, + } +} + +// NewOperationsPurgeParamsWithHTTPClient creates a new OperationsPurgeParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewOperationsPurgeParamsWithHTTPClient(client *http.Client) *OperationsPurgeParams { + var ( + asyncDefault = bool(true) + ) + return &OperationsPurgeParams{ + Async: asyncDefault, + HTTPClient: client, + } +} + +/* +OperationsPurgeParams contains all the parameters to send to the API endpoint +for the operations purge operation typically these are written to a http.Request +*/ +type OperationsPurgeParams struct { + + /*RemotePath + Remote path + + */ + RemotePath *models.RemotePath + /*Async + Async request + + */ + Async bool + /*Group + Place this operation under this stat group + + */ + Group string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the operations purge params +func (o *OperationsPurgeParams) WithTimeout(timeout time.Duration) *OperationsPurgeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the operations purge params +func (o *OperationsPurgeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the operations purge params +func (o *OperationsPurgeParams) WithContext(ctx context.Context) *OperationsPurgeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the operations purge params +func (o *OperationsPurgeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the operations purge params +func (o *OperationsPurgeParams) WithHTTPClient(client *http.Client) *OperationsPurgeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the operations purge params +func (o *OperationsPurgeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRemotePath adds the remotePath to the operations purge params +func (o *OperationsPurgeParams) WithRemotePath(remotePath *models.RemotePath) *OperationsPurgeParams { + o.SetRemotePath(remotePath) + return o +} + +// SetRemotePath adds the remotePath to the operations purge params +func (o *OperationsPurgeParams) SetRemotePath(remotePath *models.RemotePath) { + o.RemotePath = remotePath +} + +// WithAsync adds the async to the operations purge params +func (o *OperationsPurgeParams) WithAsync(async bool) *OperationsPurgeParams { + o.SetAsync(async) + return o +} + +// SetAsync adds the async to the operations purge params +func (o *OperationsPurgeParams) SetAsync(async bool) { + o.Async = async +} + +// WithGroup adds the group to the operations purge params +func (o *OperationsPurgeParams) WithGroup(group string) *OperationsPurgeParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the operations purge params +func (o *OperationsPurgeParams) SetGroup(group string) { + o.Group = group +} + +// WriteToRequest writes these params to a swagger request +func (o *OperationsPurgeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.RemotePath != nil { + if err := r.SetBodyParam(o.RemotePath); err != nil { + return err + } + } + + // query param _async + qrAsync := o.Async + qAsync := swag.FormatBool(qrAsync) + if qAsync != "" { + if err := r.SetQueryParam("_async", qAsync); err != nil { + return err + } + } + + // query param _group + qrGroup := o.Group + qGroup := qrGroup + if qGroup != "" { + if err := r.SetQueryParam("_group", qGroup); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_purge_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_purge_responses.go new file mode 100644 index 0000000000..3ff317064d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/operations_purge_responses.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// OperationsPurgeReader is a Reader for the OperationsPurge structure. +type OperationsPurgeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *OperationsPurgeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewOperationsPurgeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewOperationsPurgeDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewOperationsPurgeOK creates a OperationsPurgeOK with default headers values +func NewOperationsPurgeOK() *OperationsPurgeOK { + return &OperationsPurgeOK{} +} + +/* +OperationsPurgeOK handles this case with default header values. + +Job ID +*/ +type OperationsPurgeOK struct { + Payload *models.Jobid + JobID int64 +} + +func (o *OperationsPurgeOK) GetPayload() *models.Jobid { + return o.Payload +} + +func (o *OperationsPurgeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Jobid) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewOperationsPurgeDefault creates a OperationsPurgeDefault with default headers values +func NewOperationsPurgeDefault(code int) *OperationsPurgeDefault { + return &OperationsPurgeDefault{ + _statusCode: code, + } +} + +/* +OperationsPurgeDefault handles this case with default header values. + +Server error +*/ +type OperationsPurgeDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the operations purge default response +func (o *OperationsPurgeDefault) Code() int { + return o._statusCode +} + +func (o *OperationsPurgeDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *OperationsPurgeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *OperationsPurgeDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/reload_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/reload_parameters.go new file mode 100644 index 0000000000..90f806b23d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/reload_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewReloadParams creates a new ReloadParams object +// with the default values initialized. +func NewReloadParams() *ReloadParams { + + return &ReloadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewReloadParamsWithTimeout creates a new ReloadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewReloadParamsWithTimeout(timeout time.Duration) *ReloadParams { + + return &ReloadParams{ + + timeout: timeout, + } +} + +// NewReloadParamsWithContext creates a new ReloadParams object +// with the default values initialized, and the ability to set a context for a request +func NewReloadParamsWithContext(ctx context.Context) *ReloadParams { + + return &ReloadParams{ + + Context: ctx, + } +} + +// NewReloadParamsWithHTTPClient creates a new ReloadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewReloadParamsWithHTTPClient(client *http.Client) *ReloadParams { + + return &ReloadParams{ + HTTPClient: client, + } +} + +/* +ReloadParams contains all the parameters to send to the API endpoint +for the reload operation typically these are written to a http.Request +*/ +type ReloadParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the reload params +func (o *ReloadParams) WithTimeout(timeout time.Duration) *ReloadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the reload params +func (o *ReloadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the reload params +func (o *ReloadParams) WithContext(ctx context.Context) *ReloadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the reload params +func (o *ReloadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the reload params +func (o *ReloadParams) WithHTTPClient(client *http.Client) *ReloadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the reload params +func (o *ReloadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ReloadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/reload_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/reload_responses.go new file mode 100644 index 0000000000..41e3e2646a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/reload_responses.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// ReloadReader is a Reader for the Reload structure. +type ReloadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReloadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReloadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewReloadDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewReloadOK creates a ReloadOK with default headers values +func NewReloadOK() *ReloadOK { + return &ReloadOK{} +} + +/* +ReloadOK handles this case with default header values. + +Empty object +*/ +type ReloadOK struct { + Payload interface{} + JobID int64 +} + +func (o *ReloadOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ReloadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewReloadDefault creates a ReloadDefault with default headers values +func NewReloadDefault(code int) *ReloadDefault { + return &ReloadDefault{ + _statusCode: code, + } +} + +/* +ReloadDefault handles this case with default header values. + +Server error +*/ +type ReloadDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the reload default response +func (o *ReloadDefault) Code() int { + return o._statusCode +} + +func (o *ReloadDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *ReloadDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *ReloadDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_copy_dir_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_copy_dir_parameters.go new file mode 100644 index 0000000000..638f12721a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_copy_dir_parameters.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewSyncCopyDirParams creates a new SyncCopyDirParams object +// with the default values initialized. +func NewSyncCopyDirParams() *SyncCopyDirParams { + var ( + asyncDefault = bool(true) + ) + return &SyncCopyDirParams{ + Async: asyncDefault, + + timeout: cr.DefaultTimeout, + } +} + +// NewSyncCopyDirParamsWithTimeout creates a new SyncCopyDirParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSyncCopyDirParamsWithTimeout(timeout time.Duration) *SyncCopyDirParams { + var ( + asyncDefault = bool(true) + ) + return &SyncCopyDirParams{ + Async: asyncDefault, + + timeout: timeout, + } +} + +// NewSyncCopyDirParamsWithContext creates a new SyncCopyDirParams object +// with the default values initialized, and the ability to set a context for a request +func NewSyncCopyDirParamsWithContext(ctx context.Context) *SyncCopyDirParams { + var ( + asyncDefault = bool(true) + ) + return &SyncCopyDirParams{ + Async: asyncDefault, + + Context: ctx, + } +} + +// NewSyncCopyDirParamsWithHTTPClient creates a new SyncCopyDirParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSyncCopyDirParamsWithHTTPClient(client *http.Client) *SyncCopyDirParams { + var ( + asyncDefault = bool(true) + ) + return &SyncCopyDirParams{ + Async: asyncDefault, + HTTPClient: client, + } +} + +/* +SyncCopyDirParams contains all the parameters to send to the API endpoint +for the sync copy dir operation typically these are written to a http.Request +*/ +type SyncCopyDirParams struct { + + /*Options + Options + + */ + Options *models.MoveOrCopyFileOptions + /*Async + Async request + + */ + Async bool + /*Group + Place this operation under this stat group + + */ + Group string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the sync copy dir params +func (o *SyncCopyDirParams) WithTimeout(timeout time.Duration) *SyncCopyDirParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the sync copy dir params +func (o *SyncCopyDirParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the sync copy dir params +func (o *SyncCopyDirParams) WithContext(ctx context.Context) *SyncCopyDirParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the sync copy dir params +func (o *SyncCopyDirParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the sync copy dir params +func (o *SyncCopyDirParams) WithHTTPClient(client *http.Client) *SyncCopyDirParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the sync copy dir params +func (o *SyncCopyDirParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOptions adds the options to the sync copy dir params +func (o *SyncCopyDirParams) WithOptions(options *models.MoveOrCopyFileOptions) *SyncCopyDirParams { + o.SetOptions(options) + return o +} + +// SetOptions adds the options to the sync copy dir params +func (o *SyncCopyDirParams) SetOptions(options *models.MoveOrCopyFileOptions) { + o.Options = options +} + +// WithAsync adds the async to the sync copy dir params +func (o *SyncCopyDirParams) WithAsync(async bool) *SyncCopyDirParams { + o.SetAsync(async) + return o +} + +// SetAsync adds the async to the sync copy dir params +func (o *SyncCopyDirParams) SetAsync(async bool) { + o.Async = async +} + +// WithGroup adds the group to the sync copy dir params +func (o *SyncCopyDirParams) WithGroup(group string) *SyncCopyDirParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the sync copy dir params +func (o *SyncCopyDirParams) SetGroup(group string) { + o.Group = group +} + +// WriteToRequest writes these params to a swagger request +func (o *SyncCopyDirParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Options != nil { + if err := r.SetBodyParam(o.Options); err != nil { + return err + } + } + + // query param _async + qrAsync := o.Async + qAsync := swag.FormatBool(qrAsync) + if qAsync != "" { + if err := r.SetQueryParam("_async", qAsync); err != nil { + return err + } + } + + // query param _group + qrGroup := o.Group + qGroup := qrGroup + if qGroup != "" { + if err := r.SetQueryParam("_group", qGroup); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_copy_dir_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_copy_dir_responses.go new file mode 100644 index 0000000000..c262b00049 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_copy_dir_responses.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// SyncCopyDirReader is a Reader for the SyncCopyDir structure. +type SyncCopyDirReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SyncCopyDirReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSyncCopyDirOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSyncCopyDirDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSyncCopyDirOK creates a SyncCopyDirOK with default headers values +func NewSyncCopyDirOK() *SyncCopyDirOK { + return &SyncCopyDirOK{} +} + +/* +SyncCopyDirOK handles this case with default header values. + +Job ID +*/ +type SyncCopyDirOK struct { + Payload *models.Jobid + JobID int64 +} + +func (o *SyncCopyDirOK) GetPayload() *models.Jobid { + return o.Payload +} + +func (o *SyncCopyDirOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Jobid) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewSyncCopyDirDefault creates a SyncCopyDirDefault with default headers values +func NewSyncCopyDirDefault(code int) *SyncCopyDirDefault { + return &SyncCopyDirDefault{ + _statusCode: code, + } +} + +/* +SyncCopyDirDefault handles this case with default header values. + +Server error +*/ +type SyncCopyDirDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the sync copy dir default response +func (o *SyncCopyDirDefault) Code() int { + return o._statusCode +} + +func (o *SyncCopyDirDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *SyncCopyDirDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *SyncCopyDirDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_copy_paths_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_copy_paths_parameters.go new file mode 100644 index 0000000000..20ec989c2c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_copy_paths_parameters.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewSyncCopyPathsParams creates a new SyncCopyPathsParams object +// with the default values initialized. +func NewSyncCopyPathsParams() *SyncCopyPathsParams { + var ( + asyncDefault = bool(true) + ) + return &SyncCopyPathsParams{ + Async: asyncDefault, + + timeout: cr.DefaultTimeout, + } +} + +// NewSyncCopyPathsParamsWithTimeout creates a new SyncCopyPathsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSyncCopyPathsParamsWithTimeout(timeout time.Duration) *SyncCopyPathsParams { + var ( + asyncDefault = bool(true) + ) + return &SyncCopyPathsParams{ + Async: asyncDefault, + + timeout: timeout, + } +} + +// NewSyncCopyPathsParamsWithContext creates a new SyncCopyPathsParams object +// with the default values initialized, and the ability to set a context for a request +func NewSyncCopyPathsParamsWithContext(ctx context.Context) *SyncCopyPathsParams { + var ( + asyncDefault = bool(true) + ) + return &SyncCopyPathsParams{ + Async: asyncDefault, + + Context: ctx, + } +} + +// NewSyncCopyPathsParamsWithHTTPClient creates a new SyncCopyPathsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSyncCopyPathsParamsWithHTTPClient(client *http.Client) *SyncCopyPathsParams { + var ( + asyncDefault = bool(true) + ) + return &SyncCopyPathsParams{ + Async: asyncDefault, + HTTPClient: client, + } +} + +/* +SyncCopyPathsParams contains all the parameters to send to the API endpoint +for the sync copy paths operation typically these are written to a http.Request +*/ +type SyncCopyPathsParams struct { + + /*Options + Options + + */ + Options *models.CopyPathsOptions + /*Async + Async request + + */ + Async bool + /*Group + Place this operation under this stat group + + */ + Group string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the sync copy paths params +func (o *SyncCopyPathsParams) WithTimeout(timeout time.Duration) *SyncCopyPathsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the sync copy paths params +func (o *SyncCopyPathsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the sync copy paths params +func (o *SyncCopyPathsParams) WithContext(ctx context.Context) *SyncCopyPathsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the sync copy paths params +func (o *SyncCopyPathsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the sync copy paths params +func (o *SyncCopyPathsParams) WithHTTPClient(client *http.Client) *SyncCopyPathsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the sync copy paths params +func (o *SyncCopyPathsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOptions adds the options to the sync copy paths params +func (o *SyncCopyPathsParams) WithOptions(options *models.CopyPathsOptions) *SyncCopyPathsParams { + o.SetOptions(options) + return o +} + +// SetOptions adds the options to the sync copy paths params +func (o *SyncCopyPathsParams) SetOptions(options *models.CopyPathsOptions) { + o.Options = options +} + +// WithAsync adds the async to the sync copy paths params +func (o *SyncCopyPathsParams) WithAsync(async bool) *SyncCopyPathsParams { + o.SetAsync(async) + return o +} + +// SetAsync adds the async to the sync copy paths params +func (o *SyncCopyPathsParams) SetAsync(async bool) { + o.Async = async +} + +// WithGroup adds the group to the sync copy paths params +func (o *SyncCopyPathsParams) WithGroup(group string) *SyncCopyPathsParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the sync copy paths params +func (o *SyncCopyPathsParams) SetGroup(group string) { + o.Group = group +} + +// WriteToRequest writes these params to a swagger request +func (o *SyncCopyPathsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Options != nil { + if err := r.SetBodyParam(o.Options); err != nil { + return err + } + } + + // query param _async + qrAsync := o.Async + qAsync := swag.FormatBool(qrAsync) + if qAsync != "" { + if err := r.SetQueryParam("_async", qAsync); err != nil { + return err + } + } + + // query param _group + qrGroup := o.Group + qGroup := qrGroup + if qGroup != "" { + if err := r.SetQueryParam("_group", qGroup); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_copy_paths_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_copy_paths_responses.go new file mode 100644 index 0000000000..529fd7b1ca --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_copy_paths_responses.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// SyncCopyPathsReader is a Reader for the SyncCopyPaths structure. +type SyncCopyPathsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SyncCopyPathsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSyncCopyPathsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSyncCopyPathsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSyncCopyPathsOK creates a SyncCopyPathsOK with default headers values +func NewSyncCopyPathsOK() *SyncCopyPathsOK { + return &SyncCopyPathsOK{} +} + +/* +SyncCopyPathsOK handles this case with default header values. + +Job ID +*/ +type SyncCopyPathsOK struct { + Payload *models.Jobid + JobID int64 +} + +func (o *SyncCopyPathsOK) GetPayload() *models.Jobid { + return o.Payload +} + +func (o *SyncCopyPathsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Jobid) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewSyncCopyPathsDefault creates a SyncCopyPathsDefault with default headers values +func NewSyncCopyPathsDefault(code int) *SyncCopyPathsDefault { + return &SyncCopyPathsDefault{ + _statusCode: code, + } +} + +/* +SyncCopyPathsDefault handles this case with default header values. + +Server error +*/ +type SyncCopyPathsDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the sync copy paths default response +func (o *SyncCopyPathsDefault) Code() int { + return o._statusCode +} + +func (o *SyncCopyPathsDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *SyncCopyPathsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *SyncCopyPathsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_move_dir_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_move_dir_parameters.go new file mode 100644 index 0000000000..7221984684 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_move_dir_parameters.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// NewSyncMoveDirParams creates a new SyncMoveDirParams object +// with the default values initialized. +func NewSyncMoveDirParams() *SyncMoveDirParams { + var ( + asyncDefault = bool(true) + ) + return &SyncMoveDirParams{ + Async: asyncDefault, + + timeout: cr.DefaultTimeout, + } +} + +// NewSyncMoveDirParamsWithTimeout creates a new SyncMoveDirParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSyncMoveDirParamsWithTimeout(timeout time.Duration) *SyncMoveDirParams { + var ( + asyncDefault = bool(true) + ) + return &SyncMoveDirParams{ + Async: asyncDefault, + + timeout: timeout, + } +} + +// NewSyncMoveDirParamsWithContext creates a new SyncMoveDirParams object +// with the default values initialized, and the ability to set a context for a request +func NewSyncMoveDirParamsWithContext(ctx context.Context) *SyncMoveDirParams { + var ( + asyncDefault = bool(true) + ) + return &SyncMoveDirParams{ + Async: asyncDefault, + + Context: ctx, + } +} + +// NewSyncMoveDirParamsWithHTTPClient creates a new SyncMoveDirParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSyncMoveDirParamsWithHTTPClient(client *http.Client) *SyncMoveDirParams { + var ( + asyncDefault = bool(true) + ) + return &SyncMoveDirParams{ + Async: asyncDefault, + HTTPClient: client, + } +} + +/* +SyncMoveDirParams contains all the parameters to send to the API endpoint +for the sync move dir operation typically these are written to a http.Request +*/ +type SyncMoveDirParams struct { + + /*Options + Options + + */ + Options *models.MoveOrCopyFileOptions + /*Async + Async request + + */ + Async bool + /*Group + Place this operation under this stat group + + */ + Group string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the sync move dir params +func (o *SyncMoveDirParams) WithTimeout(timeout time.Duration) *SyncMoveDirParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the sync move dir params +func (o *SyncMoveDirParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the sync move dir params +func (o *SyncMoveDirParams) WithContext(ctx context.Context) *SyncMoveDirParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the sync move dir params +func (o *SyncMoveDirParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the sync move dir params +func (o *SyncMoveDirParams) WithHTTPClient(client *http.Client) *SyncMoveDirParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the sync move dir params +func (o *SyncMoveDirParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOptions adds the options to the sync move dir params +func (o *SyncMoveDirParams) WithOptions(options *models.MoveOrCopyFileOptions) *SyncMoveDirParams { + o.SetOptions(options) + return o +} + +// SetOptions adds the options to the sync move dir params +func (o *SyncMoveDirParams) SetOptions(options *models.MoveOrCopyFileOptions) { + o.Options = options +} + +// WithAsync adds the async to the sync move dir params +func (o *SyncMoveDirParams) WithAsync(async bool) *SyncMoveDirParams { + o.SetAsync(async) + return o +} + +// SetAsync adds the async to the sync move dir params +func (o *SyncMoveDirParams) SetAsync(async bool) { + o.Async = async +} + +// WithGroup adds the group to the sync move dir params +func (o *SyncMoveDirParams) WithGroup(group string) *SyncMoveDirParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the sync move dir params +func (o *SyncMoveDirParams) SetGroup(group string) { + o.Group = group +} + +// WriteToRequest writes these params to a swagger request +func (o *SyncMoveDirParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Options != nil { + if err := r.SetBodyParam(o.Options); err != nil { + return err + } + } + + // query param _async + qrAsync := o.Async + qAsync := swag.FormatBool(qrAsync) + if qAsync != "" { + if err := r.SetQueryParam("_async", qAsync); err != nil { + return err + } + } + + // query param _group + qrGroup := o.Group + qGroup := qrGroup + if qGroup != "" { + if err := r.SetQueryParam("_group", qGroup); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_move_dir_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_move_dir_responses.go new file mode 100644 index 0000000000..78c89ceb61 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations/sync_move_dir_responses.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models" +) + +// SyncMoveDirReader is a Reader for the SyncMoveDir structure. +type SyncMoveDirReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SyncMoveDirReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSyncMoveDirOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSyncMoveDirDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSyncMoveDirOK creates a SyncMoveDirOK with default headers values +func NewSyncMoveDirOK() *SyncMoveDirOK { + return &SyncMoveDirOK{} +} + +/* +SyncMoveDirOK handles this case with default header values. + +Job ID +*/ +type SyncMoveDirOK struct { + Payload *models.Jobid + JobID int64 +} + +func (o *SyncMoveDirOK) GetPayload() *models.Jobid { + return o.Payload +} + +func (o *SyncMoveDirOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Jobid) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +// NewSyncMoveDirDefault creates a SyncMoveDirDefault with default headers values +func NewSyncMoveDirDefault(code int) *SyncMoveDirDefault { + return &SyncMoveDirDefault{ + _statusCode: code, + } +} + +/* +SyncMoveDirDefault handles this case with default header values. + +Server error +*/ +type SyncMoveDirDefault struct { + _statusCode int + + Payload *models.ErrorResponse + JobID int64 +} + +// Code gets the status code for the sync move dir default response +func (o *SyncMoveDirDefault) Code() int { + return o._statusCode +} + +func (o *SyncMoveDirDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *SyncMoveDirDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + if jobIDHeader := response.GetHeader("x-rclone-jobid"); jobIDHeader != "" { + jobID, err := strconv.ParseInt(jobIDHeader, 10, 64) + if err != nil { + return err + } + + o.JobID = jobID + } + return nil +} + +func (o *SyncMoveDirDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/bandwidth.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/bandwidth.go new file mode 100644 index 0000000000..f4c9f0f348 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/bandwidth.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Bandwidth bandwidth rate +// +// # Rate at witch to rate limit bandwidth +// +// swagger:model Bandwidth +type Bandwidth struct { + + // String representation of the bandwidth rate limit (eg. 100k, 1M, ...). + Rate string `json:"rate,omitempty"` +} + +// Validate validates this bandwidth +func (m *Bandwidth) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Bandwidth) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Bandwidth) UnmarshalBinary(b []byte) error { + var res Bandwidth + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/content.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/content.go new file mode 100644 index 0000000000..dbf886bb6f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/content.go @@ -0,0 +1,44 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Content content +// +// swagger:model Content +type Content struct { + + // File content + // Format: byte + Content strfmt.Base64 `json:"Content,omitempty"` +} + +// Validate validates this content +func (m *Content) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Content) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Content) UnmarshalBinary(b []byte) error { + var res Content + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/copy_paths_options.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/copy_paths_options.go new file mode 100644 index 0000000000..514f6cb269 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/copy_paths_options.go @@ -0,0 +1,55 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CopyPathsOptions copy paths options +// +// swagger:model CopyPathsOptions +type CopyPathsOptions struct { + + // Destination file system e.g. s3: or gcs: + DstFs string `json:"dstFs,omitempty"` + + // A directory within that remote eg. files/ for the destination + DstRemote string `json:"dstRemote,omitempty"` + + // Paths relative to srcRemote/dstRemote eg. file.txt for both source and destination + Paths []string `json:"paths"` + + // Source file system e.g. s3: or gcs: + SrcFs string `json:"srcFs,omitempty"` + + // A directory within that remote eg. files/ for the source + SrcRemote string `json:"srcRemote,omitempty"` +} + +// Validate validates this copy paths options +func (m *CopyPathsOptions) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CopyPathsOptions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CopyPathsOptions) UnmarshalBinary(b []byte) error { + var res CopyPathsOptions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/delete_paths_options.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/delete_paths_options.go new file mode 100644 index 0000000000..a1d72c5b7f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/delete_paths_options.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DeletePathsOptions delete paths options +// +// swagger:model DeletePathsOptions +type DeletePathsOptions struct { + + // File system e.g. s3: or gcs: + Fs string `json:"fs,omitempty"` + + // Paths relative to remote eg. file.txt + Paths []string `json:"paths"` + + // A directory within that remote eg. files/ + Remote string `json:"remote,omitempty"` +} + +// Validate validates this delete paths options +func (m *DeletePathsOptions) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DeletePathsOptions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeletePathsOptions) UnmarshalBinary(b []byte) error { + var res DeletePathsOptions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/error_response.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/error_response.go new file mode 100644 index 0000000000..4721a24e42 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/error_response.go @@ -0,0 +1,54 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ErrorResponse error +// +// # Details about error response +// +// swagger:model ErrorResponse +type ErrorResponse struct { + + // Map of request parameters + Input interface{} `json:"input,omitempty"` + + // Error description + Message string `json:"message,omitempty"` + + // Requested path + Path string `json:"path,omitempty"` + + // HTTP status code + Status int64 `json:"status,omitempty"` +} + +// Validate validates this error response +func (m *ErrorResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ErrorResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ErrorResponse) UnmarshalBinary(b []byte) error { + var res ErrorResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/file_info.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/file_info.go new file mode 100644 index 0000000000..c21015f6da --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/file_info.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// FileInfo file info +// +// swagger:model FileInfo +type FileInfo struct { + + // Modification time + // Format: date-time + ModTime strfmt.DateTime `json:"modTime,omitempty"` + + // Size in bytes + Size int64 `json:"size,omitempty"` +} + +// Validate validates this file info +func (m *FileInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateModTime(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FileInfo) validateModTime(formats strfmt.Registry) error { + + if swag.IsZero(m.ModTime) { // not required + return nil + } + + if err := validate.FormatOf("modTime", "body", "date-time", m.ModTime.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *FileInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FileInfo) UnmarshalBinary(b []byte) error { + var res FileInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/file_system_details.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/file_system_details.go new file mode 100644 index 0000000000..64efd5c564 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/file_system_details.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// FileSystemDetails file system details +// +// swagger:model FileSystemDetails +type FileSystemDetails struct { + + // Free space in bytes + Free int64 `json:"free,omitempty"` + + // Available space in bytes + Total int64 `json:"total,omitempty"` + + // Used space in bytes + Used int64 `json:"used,omitempty"` +} + +// Validate validates this file system details +func (m *FileSystemDetails) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *FileSystemDetails) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FileSystemDetails) UnmarshalBinary(b []byte) error { + var res FileSystemDetails + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/group_list.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/group_list.go new file mode 100644 index 0000000000..e7a63b9072 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/group_list.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GroupList group list +// +// swagger:model GroupList +type GroupList struct { + + // groups + Groups []string `json:"groups"` +} + +// Validate validates this group list +func (m *GroupList) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GroupList) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GroupList) UnmarshalBinary(b []byte) error { + var res GroupList + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/job.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/job.go new file mode 100644 index 0000000000..3a995559b0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/job.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Job job +// +// # Status information about the job +// +// swagger:model Job +type Job struct { + + // Time in seconds that the job ran for + Duration float64 `json:"duration,omitempty"` + + // Time the job finished (eg 2018-10-26T18:50:20.528746884+01:00) + // Format: date-time + EndTime strfmt.DateTime `json:"endTime,omitempty"` + + // Error from the job or empty string for no error + Error string `json:"error,omitempty"` + + // Job has finished execution + Finished bool `json:"finished,omitempty"` + + // ID of the job + ID int64 `json:"id,omitempty"` + + // Output of the job as would have been returned if called synchronously + Output interface{} `json:"output,omitempty"` + + // Time the job started (eg 2018-10-26T18:50:20.528746884+01:00) + // Format: date-time + StartTime strfmt.DateTime `json:"startTime,omitempty"` + + // True for success false otherwise + Success bool `json:"success,omitempty"` +} + +// Validate validates this job +func (m *Job) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEndTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartTime(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Job) validateEndTime(formats strfmt.Registry) error { + + if swag.IsZero(m.EndTime) { // not required + return nil + } + + if err := validate.FormatOf("endTime", "body", "date-time", m.EndTime.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Job) validateStartTime(formats strfmt.Registry) error { + + if swag.IsZero(m.StartTime) { // not required + return nil + } + + if err := validate.FormatOf("startTime", "body", "date-time", m.StartTime.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Job) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Job) UnmarshalBinary(b []byte) error { + var res Job + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/job_info.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/job_info.go new file mode 100644 index 0000000000..8f22d0f6ed --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/job_info.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// JobInfo job info +// +// swagger:model JobInfo +type JobInfo struct { + + // job + Job *Job `json:"job,omitempty"` + + // Core status + Stats *Stats `json:"stats,omitempty"` + + // Completed transfers + Transferred []*Transfer `json:"transferred"` +} + +// Validate validates this job info +func (m *JobInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateJob(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStats(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransferred(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *JobInfo) validateJob(formats strfmt.Registry) error { + + if swag.IsZero(m.Job) { // not required + return nil + } + + if m.Job != nil { + if err := m.Job.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("job") + } + return err + } + } + + return nil +} + +func (m *JobInfo) validateStats(formats strfmt.Registry) error { + + if swag.IsZero(m.Stats) { // not required + return nil + } + + if m.Stats != nil { + if err := m.Stats.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("stats") + } + return err + } + } + + return nil +} + +func (m *JobInfo) validateTransferred(formats strfmt.Registry) error { + + if swag.IsZero(m.Transferred) { // not required + return nil + } + + for i := 0; i < len(m.Transferred); i++ { + if swag.IsZero(m.Transferred[i]) { // not required + continue + } + + if m.Transferred[i] != nil { + if err := m.Transferred[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transferred" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *JobInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JobInfo) UnmarshalBinary(b []byte) error { + var res JobInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/job_info_params.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/job_info_params.go new file mode 100644 index 0000000000..435c85d185 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/job_info_params.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// JobInfoParams job info params +// +// swagger:model JobInfoParams +type JobInfoParams struct { + + // ID of the job + Jobid int64 `json:"jobid,omitempty"` + + // Duration in seconds + Wait int64 `json:"wait,omitempty"` +} + +// Validate validates this job info params +func (m *JobInfoParams) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *JobInfoParams) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JobInfoParams) UnmarshalBinary(b []byte) error { + var res JobInfoParams + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/job_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/job_progress.go new file mode 100644 index 0000000000..a66dcaa620 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/job_progress.go @@ -0,0 +1,160 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// JobProgress job progress +// +// swagger:model JobProgress +type JobProgress struct { + + // time at which job completed + // Format: date-time + CompletedAt strfmt.DateTime `json:"completed_at,omitempty"` + + // string description of the error (empty if successful) + Error string `json:"error,omitempty"` + + // number of bytes that failed transfer + Failed int64 `json:"failed,omitempty"` + + // number of bytes that were skipped + Skipped int64 `json:"skipped,omitempty"` + + // time at which job started + // Format: date-time + StartedAt strfmt.DateTime `json:"started_at,omitempty"` + + // status of the job + // Enum: [success error running not_found] + Status string `json:"status,omitempty"` + + // number of bytes that are successfully uploaded + Uploaded int64 `json:"uploaded,omitempty"` +} + +// Validate validates this job progress +func (m *JobProgress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *JobProgress) validateCompletedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("completed_at", "body", "date-time", m.CompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *JobProgress) validateStartedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StartedAt) { // not required + return nil + } + + if err := validate.FormatOf("started_at", "body", "date-time", m.StartedAt.String(), formats); err != nil { + return err + } + + return nil +} + +var jobProgressTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["success","error","running","not_found"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + jobProgressTypeStatusPropEnum = append(jobProgressTypeStatusPropEnum, v) + } +} + +const ( + + // JobProgressStatusSuccess captures enum value "success" + JobProgressStatusSuccess string = "success" + + // JobProgressStatusError captures enum value "error" + JobProgressStatusError string = "error" + + // JobProgressStatusRunning captures enum value "running" + JobProgressStatusRunning string = "running" + + // JobProgressStatusNotFound captures enum value "not_found" + JobProgressStatusNotFound string = "not_found" +) + +// prop value enum +func (m *JobProgress) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, jobProgressTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *JobProgress) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *JobProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JobProgress) UnmarshalBinary(b []byte) error { + var res JobProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/jobid.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/jobid.go new file mode 100644 index 0000000000..e878cdd096 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/jobid.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Jobid jobid +// +// swagger:model Jobid +type Jobid struct { + + // ID of the job + Jobid int64 `json:"jobid,omitempty"` +} + +// Validate validates this jobid +func (m *Jobid) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Jobid) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Jobid) UnmarshalBinary(b []byte) error { + var res Jobid + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/list_item.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/list_item.go new file mode 100644 index 0000000000..7f981eff4b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/list_item.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ListItem list item +// +// swagger:model ListItem +type ListItem struct { + + // Encrypted name + Encrypted string `json:"Encrypted,omitempty"` + + // Hash of the item + Hashes interface{} `json:"Hashes,omitempty"` + + // ID of the item + ID string `json:"ID,omitempty"` + + // true if item is directory + IsDir bool `json:"IsDir,omitempty"` + + // mime type of the item + MimeType string `json:"MimeType,omitempty"` + + // Modification time + // Format: date-time + ModTime strfmt.DateTime `json:"ModTime,omitempty"` + + // Name of the item + Name string `json:"Name,omitempty"` + + // Original ID of the item + OrigID string `json:"OrigID,omitempty"` + + // Path of the item + Path string `json:"Path,omitempty"` + + // Size in bytes + Size int64 `json:"Size,omitempty"` +} + +// Validate validates this list item +func (m *ListItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateModTime(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListItem) validateModTime(formats strfmt.Registry) error { + + if swag.IsZero(m.ModTime) { // not required + return nil + } + + if err := validate.FormatOf("ModTime", "body", "date-time", m.ModTime.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ListItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ListItem) UnmarshalBinary(b []byte) error { + var res ListItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/list_options.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/list_options.go new file mode 100644 index 0000000000..cc2be53ce2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/list_options.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ListOptions list options +// +// swagger:model ListOptions +type ListOptions struct { + + // A remote name string eg. drive: + // Required: true + Fs *string `json:"fs"` + + // Show only the newest versions of files (no snapshot tag suffix attached) + NewestOnly bool `json:"newestOnly,omitempty"` + + // opt + Opt *ListOptionsOpt `json:"opt,omitempty"` + + // A path within that remote eg. dir + // Required: true + Remote *string `json:"remote"` + + // Show older version of files (snapshot tag suffix attached) + VersionedOnly bool `json:"versionedOnly,omitempty"` +} + +// Validate validates this list options +func (m *ListOptions) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOpt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRemote(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListOptions) validateFs(formats strfmt.Registry) error { + + if err := validate.Required("fs", "body", m.Fs); err != nil { + return err + } + + return nil +} + +func (m *ListOptions) validateOpt(formats strfmt.Registry) error { + + if swag.IsZero(m.Opt) { // not required + return nil + } + + if m.Opt != nil { + if err := m.Opt.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("opt") + } + return err + } + } + + return nil +} + +func (m *ListOptions) validateRemote(formats strfmt.Registry) error { + + if err := validate.Required("remote", "body", m.Remote); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ListOptions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ListOptions) UnmarshalBinary(b []byte) error { + var res ListOptions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ListOptionsOpt A path within that remote eg. dir +// +// swagger:model ListOptionsOpt +type ListOptionsOpt struct { + + // Show only directories in the listing + DirsOnly bool `json:"dirsOnly,omitempty"` + + // Show only files in the listing + FilesOnly bool `json:"filesOnly,omitempty"` + + // Don't read the mime type time (can speed things up) + NoMimeType bool `json:"noMimeType,omitempty"` + + // Don't read the modification time (can speed things up) + NoModTime bool `json:"noModTime,omitempty"` + + // Recurse into the listing + Recurse bool `json:"recurse,omitempty"` + + // Show the encrypted names + ShowEncrypted bool `json:"showEncrypted,omitempty"` + + // Include hashes in the output (may take longer) + ShowHash bool `json:"showHash,omitempty"` + + // Show the ID of the underlying Object + ShowOrigIDs bool `json:"showOrigIDs,omitempty"` +} + +// Validate validates this list options opt +func (m *ListOptionsOpt) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ListOptionsOpt) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ListOptionsOpt) UnmarshalBinary(b []byte) error { + var res ListOptionsOpt + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/move_or_copy_file_options.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/move_or_copy_file_options.go new file mode 100644 index 0000000000..4a5870b7e9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/move_or_copy_file_options.go @@ -0,0 +1,55 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MoveOrCopyFileOptions move or copy file options +// +// swagger:model MoveOrCopyFileOptions +type MoveOrCopyFileOptions struct { + + // Destination file system e.g. s3: or gcs: + DstFs string `json:"dstFs,omitempty"` + + // A path within that remote eg. file.txt for the destination + DstRemote string `json:"dstRemote,omitempty"` + + // Source file system e.g. s3: or gcs: + SrcFs string `json:"srcFs,omitempty"` + + // A path within that remote eg. file.txt for the source + SrcRemote string `json:"srcRemote,omitempty"` + + // A suffix which will be added to otherwise overwritten or deleted files + Suffix string `json:"suffix,omitempty"` +} + +// Validate validates this move or copy file options +func (m *MoveOrCopyFileOptions) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MoveOrCopyFileOptions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MoveOrCopyFileOptions) UnmarshalBinary(b []byte) error { + var res MoveOrCopyFileOptions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/node_info.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/node_info.go new file mode 100644 index 0000000000..2a07069885 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/node_info.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NodeInfo node info +// +// Information about Scylla node. +// +// swagger:model NodeInfo +type NodeInfo struct { + + // Scylla Manager Agent version. + AgentVersion string `json:"agent_version,omitempty"` + + // Address for Alternator API requests. + AlternatorAddress string `json:"alternator_address,omitempty"` + + // Whether Alternator requires authentication. + AlternatorEnforceAuthorization bool `json:"alternator_enforce_authorization,omitempty"` + + // Port for Alternator HTTPS API server. + AlternatorHTTPSPort string `json:"alternator_https_port,omitempty"` + + // Port for Alternator API server. + AlternatorPort string `json:"alternator_port,omitempty"` + + // Address for REST API requests. + APIAddress string `json:"api_address,omitempty"` + + // Port for REST API server. + APIPort string `json:"api_port,omitempty"` + + // Address that is broadcasted to tell other Scylla nodes to connect to. Related to listen_address. + BroadcastAddress string `json:"broadcast_address,omitempty"` + + // Address that is broadcasted to tell the clients to connect to. + BroadcastRPCAddress string `json:"broadcast_rpc_address,omitempty"` + + // Whether client encryption is enabled. + ClientEncryptionEnabled bool `json:"client_encryption_enabled,omitempty"` + + // Whether client authorization is required. + ClientEncryptionRequireAuth bool `json:"client_encryption_require_auth,omitempty"` + + // Whether Scylla uses RAFT for cluster management and DDL. + ConsistentClusterManagement bool `json:"consistent_cluster_management,omitempty"` + + // Logical CPU count. + CPUCount int64 `json:"cpu_count,omitempty"` + + // Whether CQL requires password authentication. + CqlPasswordProtected bool `json:"cql_password_protected,omitempty"` + + // Whether tablets are enabled. + EnableTablets bool `json:"enable_tablets,omitempty"` + + // Address Scylla listens for connections from other nodes. + ListenAddress string `json:"listen_address,omitempty"` + + // Total available memory. + MemoryTotal int64 `json:"memory_total,omitempty"` + + // Port for the CQL native transport to listen for clients on. + NativeTransportPort string `json:"native_transport_port,omitempty"` + + // Port for the encrypted CQL native transport to listen for clients on. + NativeTransportPortSsl string `json:"native_transport_port_ssl,omitempty"` + + // Address for Prometheus queries. + PrometheusAddress string `json:"prometheus_address,omitempty"` + + // Port for Prometheus server. + PrometheusPort string `json:"prometheus_port,omitempty"` + + // Address on which Scylla is going to expect Thrift and CQL clients connections. + RPCAddress string `json:"rpc_address,omitempty"` + + // Port for Thrift to listen for clients on. + RPCPort string `json:"rpc_port,omitempty"` + + // Scylla version. + ScyllaVersion string `json:"scylla_version,omitempty"` + + // Whether Scylla supports uuid-like sstable naming. + SstableUUIDFormat bool `json:"sstable_uuid_format,omitempty"` + + // Uptime in seconds. + Uptime int64 `json:"uptime,omitempty"` +} + +// Validate validates this node info +func (m *NodeInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NodeInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NodeInfo) UnmarshalBinary(b []byte) error { + var res NodeInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/remote.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/remote.go new file mode 100644 index 0000000000..a168cb89c4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/remote.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Remote remote +// +// swagger:model Remote +type Remote struct { + + // Name of the remote + Name string `json:"name,omitempty"` + + // Additional parameters for the remote + Parameters interface{} `json:"parameters,omitempty"` + + // Type of the new remote + Type string `json:"type,omitempty"` +} + +// Validate validates this remote +func (m *Remote) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Remote) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Remote) UnmarshalBinary(b []byte) error { + var res Remote + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/remote_path.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/remote_path.go new file mode 100644 index 0000000000..5895374882 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/remote_path.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RemotePath remote path +// +// swagger:model RemotePath +type RemotePath struct { + + // A remote name string eg. drive: + Fs string `json:"fs,omitempty"` + + // A path within that remote eg. dir + Remote string `json:"remote,omitempty"` +} + +// Validate validates this remote path +func (m *RemotePath) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RemotePath) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RemotePath) UnmarshalBinary(b []byte) error { + var res RemotePath + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/stats.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/stats.go new file mode 100644 index 0000000000..5c90cd5e93 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/stats.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Stats stats +// +// swagger:model Stats +type Stats struct { + + // total transferred bytes since the start of the process + Bytes int64 `json:"bytes,omitempty"` + + // an array of names of currently active file checks + Checking []string `json:"checking"` + + // number of checked files + Checks int64 `json:"checks,omitempty"` + + // number of deleted files + Deletes int64 `json:"deletes,omitempty"` + + // time in seconds since the start of the process + ElapsedTime float64 `json:"elapsedTime,omitempty"` + + // number of errors + Errors int64 `json:"errors,omitempty"` + + // whether there has been at least one FatalError + FatalError bool `json:"fatalError,omitempty"` + + // last occurred error + LastError string `json:"lastError,omitempty"` + + // whether there has been at least one non-NoRetryError + RetryError bool `json:"retryError,omitempty"` + + // average speed in bytes/sec since start of the process + Speed float64 `json:"speed,omitempty"` + + // an array of currently active file transfers + Transferring []*StatsTransferringItems0 `json:"transferring"` + + // number of transferred files + Transfers int64 `json:"transfers,omitempty"` +} + +// Validate validates this stats +func (m *Stats) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTransferring(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Stats) validateTransferring(formats strfmt.Registry) error { + + if swag.IsZero(m.Transferring) { // not required + return nil + } + + for i := 0; i < len(m.Transferring); i++ { + if swag.IsZero(m.Transferring[i]) { // not required + continue + } + + if m.Transferring[i] != nil { + if err := m.Transferring[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transferring" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Stats) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Stats) UnmarshalBinary(b []byte) error { + var res Stats + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// StatsTransferringItems0 stats transferring items0 +// +// swagger:model StatsTransferringItems0 +type StatsTransferringItems0 struct { + + // total transferred bytes for this file + Bytes int64 `json:"bytes,omitempty"` + + // estimated time in seconds until file transfer completion + Eta float64 `json:"eta,omitempty"` + + // name of the file + Name string `json:"name,omitempty"` + + // progress of the file transfer in percent + Percentage float64 `json:"percentage,omitempty"` + + // size of the file in bytes + Size int64 `json:"size,omitempty"` + + // speed in bytes/sec + Speed float64 `json:"speed,omitempty"` + + // speed in bytes/sec as an exponentially weighted moving average + SpeedAvg float64 `json:"speedAvg,omitempty"` +} + +// Validate validates this stats transferring items0 +func (m *StatsTransferringItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *StatsTransferringItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StatsTransferringItems0) UnmarshalBinary(b []byte) error { + var res StatsTransferringItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/stats_params.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/stats_params.go new file mode 100644 index 0000000000..e47cdc7438 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/stats_params.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// StatsParams stats params +// +// swagger:model StatsParams +type StatsParams struct { + + // group name + Group string `json:"group,omitempty"` +} + +// Validate validates this stats params +func (m *StatsParams) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *StatsParams) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StatsParams) UnmarshalBinary(b []byte) error { + var res StatsParams + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/transfer.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/transfer.go new file mode 100644 index 0000000000..f537796905 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models/transfer.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Transfer transfer +// +// swagger:model Transfer +type Transfer struct { + + // total transferred bytes for this file + Bytes int64 `json:"bytes,omitempty"` + + // if the transfer is only checked (skipped, deleted) + Checked bool `json:"checked,omitempty"` + + // time at which transfer completed + // Format: date-time + CompletedAt strfmt.DateTime `json:"completed_at,omitempty"` + + // string description of the error (empty if successful) + Error string `json:"error,omitempty"` + + // name of the file + Name string `json:"name,omitempty"` + + // size of the file in bytes + Size int64 `json:"size,omitempty"` + + // time at which transfer started + // Format: date-time + StartedAt strfmt.DateTime `json:"started_at,omitempty"` +} + +// Validate validates this transfer +func (m *Transfer) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Transfer) validateCompletedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("completed_at", "body", "date-time", m.CompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Transfer) validateStartedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StartedAt) { // not required + return nil + } + + if err := validate.FormatOf("started_at", "body", "date-time", m.StartedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Transfer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Transfer) UnmarshalBinary(b []byte) error { + var res Transfer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_backups_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_backups_parameters.go new file mode 100644 index 0000000000..fb501e32f5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_backups_parameters.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteClusterClusterIDBackupsParams creates a new DeleteClusterClusterIDBackupsParams object +// with the default values initialized. +func NewDeleteClusterClusterIDBackupsParams() *DeleteClusterClusterIDBackupsParams { + var () + return &DeleteClusterClusterIDBackupsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteClusterClusterIDBackupsParamsWithTimeout creates a new DeleteClusterClusterIDBackupsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteClusterClusterIDBackupsParamsWithTimeout(timeout time.Duration) *DeleteClusterClusterIDBackupsParams { + var () + return &DeleteClusterClusterIDBackupsParams{ + + timeout: timeout, + } +} + +// NewDeleteClusterClusterIDBackupsParamsWithContext creates a new DeleteClusterClusterIDBackupsParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteClusterClusterIDBackupsParamsWithContext(ctx context.Context) *DeleteClusterClusterIDBackupsParams { + var () + return &DeleteClusterClusterIDBackupsParams{ + + Context: ctx, + } +} + +// NewDeleteClusterClusterIDBackupsParamsWithHTTPClient creates a new DeleteClusterClusterIDBackupsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteClusterClusterIDBackupsParamsWithHTTPClient(client *http.Client) *DeleteClusterClusterIDBackupsParams { + var () + return &DeleteClusterClusterIDBackupsParams{ + HTTPClient: client, + } +} + +/* +DeleteClusterClusterIDBackupsParams contains all the parameters to send to the API endpoint +for the delete cluster cluster ID backups operation typically these are written to a http.Request +*/ +type DeleteClusterClusterIDBackupsParams struct { + + /*ClusterID*/ + ClusterID string + /*Locations*/ + Locations []string + /*SnapshotTags*/ + SnapshotTags []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete cluster cluster ID backups params +func (o *DeleteClusterClusterIDBackupsParams) WithTimeout(timeout time.Duration) *DeleteClusterClusterIDBackupsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete cluster cluster ID backups params +func (o *DeleteClusterClusterIDBackupsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete cluster cluster ID backups params +func (o *DeleteClusterClusterIDBackupsParams) WithContext(ctx context.Context) *DeleteClusterClusterIDBackupsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete cluster cluster ID backups params +func (o *DeleteClusterClusterIDBackupsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete cluster cluster ID backups params +func (o *DeleteClusterClusterIDBackupsParams) WithHTTPClient(client *http.Client) *DeleteClusterClusterIDBackupsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete cluster cluster ID backups params +func (o *DeleteClusterClusterIDBackupsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the delete cluster cluster ID backups params +func (o *DeleteClusterClusterIDBackupsParams) WithClusterID(clusterID string) *DeleteClusterClusterIDBackupsParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the delete cluster cluster ID backups params +func (o *DeleteClusterClusterIDBackupsParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLocations adds the locations to the delete cluster cluster ID backups params +func (o *DeleteClusterClusterIDBackupsParams) WithLocations(locations []string) *DeleteClusterClusterIDBackupsParams { + o.SetLocations(locations) + return o +} + +// SetLocations adds the locations to the delete cluster cluster ID backups params +func (o *DeleteClusterClusterIDBackupsParams) SetLocations(locations []string) { + o.Locations = locations +} + +// WithSnapshotTags adds the snapshotTags to the delete cluster cluster ID backups params +func (o *DeleteClusterClusterIDBackupsParams) WithSnapshotTags(snapshotTags []string) *DeleteClusterClusterIDBackupsParams { + o.SetSnapshotTags(snapshotTags) + return o +} + +// SetSnapshotTags adds the snapshotTags to the delete cluster cluster ID backups params +func (o *DeleteClusterClusterIDBackupsParams) SetSnapshotTags(snapshotTags []string) { + o.SnapshotTags = snapshotTags +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteClusterClusterIDBackupsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + valuesLocations := o.Locations + + joinedLocations := swag.JoinByFormat(valuesLocations, "") + // query array param locations + if err := r.SetQueryParam("locations", joinedLocations...); err != nil { + return err + } + + valuesSnapshotTags := o.SnapshotTags + + joinedSnapshotTags := swag.JoinByFormat(valuesSnapshotTags, "") + // query array param snapshot_tags + if err := r.SetQueryParam("snapshot_tags", joinedSnapshotTags...); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_backups_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_backups_responses.go new file mode 100644 index 0000000000..fe6bdb3c58 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_backups_responses.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// DeleteClusterClusterIDBackupsReader is a Reader for the DeleteClusterClusterIDBackups structure. +type DeleteClusterClusterIDBackupsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteClusterClusterIDBackupsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteClusterClusterIDBackupsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDeleteClusterClusterIDBackupsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewDeleteClusterClusterIDBackupsOK creates a DeleteClusterClusterIDBackupsOK with default headers values +func NewDeleteClusterClusterIDBackupsOK() *DeleteClusterClusterIDBackupsOK { + return &DeleteClusterClusterIDBackupsOK{} +} + +/* +DeleteClusterClusterIDBackupsOK handles this case with default header values. + +OK +*/ +type DeleteClusterClusterIDBackupsOK struct { +} + +func (o *DeleteClusterClusterIDBackupsOK) Error() string { + return fmt.Sprintf("[DELETE /cluster/{cluster_id}/backups][%d] deleteClusterClusterIdBackupsOK ", 200) +} + +func (o *DeleteClusterClusterIDBackupsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteClusterClusterIDBackupsDefault creates a DeleteClusterClusterIDBackupsDefault with default headers values +func NewDeleteClusterClusterIDBackupsDefault(code int) *DeleteClusterClusterIDBackupsDefault { + return &DeleteClusterClusterIDBackupsDefault{ + _statusCode: code, + } +} + +/* +DeleteClusterClusterIDBackupsDefault handles this case with default header values. + +Error +*/ +type DeleteClusterClusterIDBackupsDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the delete cluster cluster ID backups default response +func (o *DeleteClusterClusterIDBackupsDefault) Code() int { + return o._statusCode +} + +func (o *DeleteClusterClusterIDBackupsDefault) Error() string { + return fmt.Sprintf("[DELETE /cluster/{cluster_id}/backups][%d] DeleteClusterClusterIDBackups default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteClusterClusterIDBackupsDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *DeleteClusterClusterIDBackupsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_parameters.go new file mode 100644 index 0000000000..11039bec77 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_parameters.go @@ -0,0 +1,192 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteClusterClusterIDParams creates a new DeleteClusterClusterIDParams object +// with the default values initialized. +func NewDeleteClusterClusterIDParams() *DeleteClusterClusterIDParams { + var () + return &DeleteClusterClusterIDParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteClusterClusterIDParamsWithTimeout creates a new DeleteClusterClusterIDParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteClusterClusterIDParamsWithTimeout(timeout time.Duration) *DeleteClusterClusterIDParams { + var () + return &DeleteClusterClusterIDParams{ + + timeout: timeout, + } +} + +// NewDeleteClusterClusterIDParamsWithContext creates a new DeleteClusterClusterIDParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteClusterClusterIDParamsWithContext(ctx context.Context) *DeleteClusterClusterIDParams { + var () + return &DeleteClusterClusterIDParams{ + + Context: ctx, + } +} + +// NewDeleteClusterClusterIDParamsWithHTTPClient creates a new DeleteClusterClusterIDParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteClusterClusterIDParamsWithHTTPClient(client *http.Client) *DeleteClusterClusterIDParams { + var () + return &DeleteClusterClusterIDParams{ + HTTPClient: client, + } +} + +/* +DeleteClusterClusterIDParams contains all the parameters to send to the API endpoint +for the delete cluster cluster ID operation typically these are written to a http.Request +*/ +type DeleteClusterClusterIDParams struct { + + /*ClusterID*/ + ClusterID string + /*CqlCreds*/ + CqlCreds *bool + /*SslUserCert*/ + SslUserCert *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete cluster cluster ID params +func (o *DeleteClusterClusterIDParams) WithTimeout(timeout time.Duration) *DeleteClusterClusterIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete cluster cluster ID params +func (o *DeleteClusterClusterIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete cluster cluster ID params +func (o *DeleteClusterClusterIDParams) WithContext(ctx context.Context) *DeleteClusterClusterIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete cluster cluster ID params +func (o *DeleteClusterClusterIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete cluster cluster ID params +func (o *DeleteClusterClusterIDParams) WithHTTPClient(client *http.Client) *DeleteClusterClusterIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete cluster cluster ID params +func (o *DeleteClusterClusterIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the delete cluster cluster ID params +func (o *DeleteClusterClusterIDParams) WithClusterID(clusterID string) *DeleteClusterClusterIDParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the delete cluster cluster ID params +func (o *DeleteClusterClusterIDParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithCqlCreds adds the cqlCreds to the delete cluster cluster ID params +func (o *DeleteClusterClusterIDParams) WithCqlCreds(cqlCreds *bool) *DeleteClusterClusterIDParams { + o.SetCqlCreds(cqlCreds) + return o +} + +// SetCqlCreds adds the cqlCreds to the delete cluster cluster ID params +func (o *DeleteClusterClusterIDParams) SetCqlCreds(cqlCreds *bool) { + o.CqlCreds = cqlCreds +} + +// WithSslUserCert adds the sslUserCert to the delete cluster cluster ID params +func (o *DeleteClusterClusterIDParams) WithSslUserCert(sslUserCert *bool) *DeleteClusterClusterIDParams { + o.SetSslUserCert(sslUserCert) + return o +} + +// SetSslUserCert adds the sslUserCert to the delete cluster cluster ID params +func (o *DeleteClusterClusterIDParams) SetSslUserCert(sslUserCert *bool) { + o.SslUserCert = sslUserCert +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteClusterClusterIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + if o.CqlCreds != nil { + + // query param cql_creds + var qrCqlCreds bool + if o.CqlCreds != nil { + qrCqlCreds = *o.CqlCreds + } + qCqlCreds := swag.FormatBool(qrCqlCreds) + if qCqlCreds != "" { + if err := r.SetQueryParam("cql_creds", qCqlCreds); err != nil { + return err + } + } + + } + + if o.SslUserCert != nil { + + // query param ssl_user_cert + var qrSslUserCert bool + if o.SslUserCert != nil { + qrSslUserCert = *o.SslUserCert + } + qSslUserCert := swag.FormatBool(qrSslUserCert) + if qSslUserCert != "" { + if err := r.SetQueryParam("ssl_user_cert", qSslUserCert); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_responses.go new file mode 100644 index 0000000000..cfb172cfa6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_responses.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// DeleteClusterClusterIDReader is a Reader for the DeleteClusterClusterID structure. +type DeleteClusterClusterIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteClusterClusterIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteClusterClusterIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDeleteClusterClusterIDDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewDeleteClusterClusterIDOK creates a DeleteClusterClusterIDOK with default headers values +func NewDeleteClusterClusterIDOK() *DeleteClusterClusterIDOK { + return &DeleteClusterClusterIDOK{} +} + +/* +DeleteClusterClusterIDOK handles this case with default header values. + +Cluster deleted +*/ +type DeleteClusterClusterIDOK struct { +} + +func (o *DeleteClusterClusterIDOK) Error() string { + return fmt.Sprintf("[DELETE /cluster/{cluster_id}][%d] deleteClusterClusterIdOK ", 200) +} + +func (o *DeleteClusterClusterIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteClusterClusterIDDefault creates a DeleteClusterClusterIDDefault with default headers values +func NewDeleteClusterClusterIDDefault(code int) *DeleteClusterClusterIDDefault { + return &DeleteClusterClusterIDDefault{ + _statusCode: code, + } +} + +/* +DeleteClusterClusterIDDefault handles this case with default header values. + +Error +*/ +type DeleteClusterClusterIDDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the delete cluster cluster ID default response +func (o *DeleteClusterClusterIDDefault) Code() int { + return o._statusCode +} + +func (o *DeleteClusterClusterIDDefault) Error() string { + return fmt.Sprintf("[DELETE /cluster/{cluster_id}][%d] DeleteClusterClusterID default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteClusterClusterIDDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *DeleteClusterClusterIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_task_task_type_task_id_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_task_task_type_task_id_parameters.go new file mode 100644 index 0000000000..53d17dad4b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_task_task_type_task_id_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteClusterClusterIDTaskTaskTypeTaskIDParams creates a new DeleteClusterClusterIDTaskTaskTypeTaskIDParams object +// with the default values initialized. +func NewDeleteClusterClusterIDTaskTaskTypeTaskIDParams() *DeleteClusterClusterIDTaskTaskTypeTaskIDParams { + var () + return &DeleteClusterClusterIDTaskTaskTypeTaskIDParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteClusterClusterIDTaskTaskTypeTaskIDParamsWithTimeout creates a new DeleteClusterClusterIDTaskTaskTypeTaskIDParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDeleteClusterClusterIDTaskTaskTypeTaskIDParamsWithTimeout(timeout time.Duration) *DeleteClusterClusterIDTaskTaskTypeTaskIDParams { + var () + return &DeleteClusterClusterIDTaskTaskTypeTaskIDParams{ + + timeout: timeout, + } +} + +// NewDeleteClusterClusterIDTaskTaskTypeTaskIDParamsWithContext creates a new DeleteClusterClusterIDTaskTaskTypeTaskIDParams object +// with the default values initialized, and the ability to set a context for a request +func NewDeleteClusterClusterIDTaskTaskTypeTaskIDParamsWithContext(ctx context.Context) *DeleteClusterClusterIDTaskTaskTypeTaskIDParams { + var () + return &DeleteClusterClusterIDTaskTaskTypeTaskIDParams{ + + Context: ctx, + } +} + +// NewDeleteClusterClusterIDTaskTaskTypeTaskIDParamsWithHTTPClient creates a new DeleteClusterClusterIDTaskTaskTypeTaskIDParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDeleteClusterClusterIDTaskTaskTypeTaskIDParamsWithHTTPClient(client *http.Client) *DeleteClusterClusterIDTaskTaskTypeTaskIDParams { + var () + return &DeleteClusterClusterIDTaskTaskTypeTaskIDParams{ + HTTPClient: client, + } +} + +/* +DeleteClusterClusterIDTaskTaskTypeTaskIDParams contains all the parameters to send to the API endpoint +for the delete cluster cluster ID task task type task ID operation typically these are written to a http.Request +*/ +type DeleteClusterClusterIDTaskTaskTypeTaskIDParams struct { + + /*ClusterID*/ + ClusterID string + /*TaskID*/ + TaskID string + /*TaskType*/ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the delete cluster cluster ID task task type task ID params +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDParams) WithTimeout(timeout time.Duration) *DeleteClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete cluster cluster ID task task type task ID params +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete cluster cluster ID task task type task ID params +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDParams) WithContext(ctx context.Context) *DeleteClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete cluster cluster ID task task type task ID params +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete cluster cluster ID task task type task ID params +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDParams) WithHTTPClient(client *http.Client) *DeleteClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete cluster cluster ID task task type task ID params +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the delete cluster cluster ID task task type task ID params +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDParams) WithClusterID(clusterID string) *DeleteClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the delete cluster cluster ID task task type task ID params +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithTaskID adds the taskID to the delete cluster cluster ID task task type task ID params +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDParams) WithTaskID(taskID string) *DeleteClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the delete cluster cluster ID task task type task ID params +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WithTaskType adds the taskType to the delete cluster cluster ID task task type task ID params +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDParams) WithTaskType(taskType string) *DeleteClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the delete cluster cluster ID task task type task ID params +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + // path param task_type + if err := r.SetPathParam("task_type", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_task_task_type_task_id_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_task_task_type_task_id_responses.go new file mode 100644 index 0000000000..096fe4fe1d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/delete_cluster_cluster_id_task_task_type_task_id_responses.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// DeleteClusterClusterIDTaskTaskTypeTaskIDReader is a Reader for the DeleteClusterClusterIDTaskTaskTypeTaskID structure. +type DeleteClusterClusterIDTaskTaskTypeTaskIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteClusterClusterIDTaskTaskTypeTaskIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDeleteClusterClusterIDTaskTaskTypeTaskIDDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewDeleteClusterClusterIDTaskTaskTypeTaskIDOK creates a DeleteClusterClusterIDTaskTaskTypeTaskIDOK with default headers values +func NewDeleteClusterClusterIDTaskTaskTypeTaskIDOK() *DeleteClusterClusterIDTaskTaskTypeTaskIDOK { + return &DeleteClusterClusterIDTaskTaskTypeTaskIDOK{} +} + +/* +DeleteClusterClusterIDTaskTaskTypeTaskIDOK handles this case with default header values. + +Task deleted +*/ +type DeleteClusterClusterIDTaskTaskTypeTaskIDOK struct { +} + +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDOK) Error() string { + return fmt.Sprintf("[DELETE /cluster/{cluster_id}/task/{task_type}/{task_id}][%d] deleteClusterClusterIdTaskTaskTypeTaskIdOK ", 200) +} + +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteClusterClusterIDTaskTaskTypeTaskIDDefault creates a DeleteClusterClusterIDTaskTaskTypeTaskIDDefault with default headers values +func NewDeleteClusterClusterIDTaskTaskTypeTaskIDDefault(code int) *DeleteClusterClusterIDTaskTaskTypeTaskIDDefault { + return &DeleteClusterClusterIDTaskTaskTypeTaskIDDefault{ + _statusCode: code, + } +} + +/* +DeleteClusterClusterIDTaskTaskTypeTaskIDDefault handles this case with default header values. + +Error +*/ +type DeleteClusterClusterIDTaskTaskTypeTaskIDDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the delete cluster cluster ID task task type task ID default response +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDDefault) Code() int { + return o._statusCode +} + +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDDefault) Error() string { + return fmt.Sprintf("[DELETE /cluster/{cluster_id}/task/{task_type}/{task_id}][%d] DeleteClusterClusterIDTaskTaskTypeTaskID default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *DeleteClusterClusterIDTaskTaskTypeTaskIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_backups_files_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_backups_files_parameters.go new file mode 100644 index 0000000000..6e193dac42 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_backups_files_parameters.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetClusterClusterIDBackupsFilesParams creates a new GetClusterClusterIDBackupsFilesParams object +// with the default values initialized. +func NewGetClusterClusterIDBackupsFilesParams() *GetClusterClusterIDBackupsFilesParams { + var () + return &GetClusterClusterIDBackupsFilesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterClusterIDBackupsFilesParamsWithTimeout creates a new GetClusterClusterIDBackupsFilesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterClusterIDBackupsFilesParamsWithTimeout(timeout time.Duration) *GetClusterClusterIDBackupsFilesParams { + var () + return &GetClusterClusterIDBackupsFilesParams{ + + timeout: timeout, + } +} + +// NewGetClusterClusterIDBackupsFilesParamsWithContext creates a new GetClusterClusterIDBackupsFilesParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterClusterIDBackupsFilesParamsWithContext(ctx context.Context) *GetClusterClusterIDBackupsFilesParams { + var () + return &GetClusterClusterIDBackupsFilesParams{ + + Context: ctx, + } +} + +// NewGetClusterClusterIDBackupsFilesParamsWithHTTPClient creates a new GetClusterClusterIDBackupsFilesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterClusterIDBackupsFilesParamsWithHTTPClient(client *http.Client) *GetClusterClusterIDBackupsFilesParams { + var () + return &GetClusterClusterIDBackupsFilesParams{ + HTTPClient: client, + } +} + +/* +GetClusterClusterIDBackupsFilesParams contains all the parameters to send to the API endpoint +for the get cluster cluster ID backups files operation typically these are written to a http.Request +*/ +type GetClusterClusterIDBackupsFilesParams struct { + + /*ClusterID*/ + ClusterID string + /*Keyspace*/ + Keyspace []string + /*Locations*/ + Locations []string + /*QueryClusterID*/ + QueryClusterID *string + /*SnapshotTag*/ + SnapshotTag string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDBackupsFilesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) WithContext(ctx context.Context) *GetClusterClusterIDBackupsFilesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) WithHTTPClient(client *http.Client) *GetClusterClusterIDBackupsFilesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) WithClusterID(clusterID string) *GetClusterClusterIDBackupsFilesParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithKeyspace adds the keyspace to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) WithKeyspace(keyspace []string) *GetClusterClusterIDBackupsFilesParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) SetKeyspace(keyspace []string) { + o.Keyspace = keyspace +} + +// WithLocations adds the locations to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) WithLocations(locations []string) *GetClusterClusterIDBackupsFilesParams { + o.SetLocations(locations) + return o +} + +// SetLocations adds the locations to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) SetLocations(locations []string) { + o.Locations = locations +} + +// WithQueryClusterID adds the queryClusterID to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) WithQueryClusterID(queryClusterID *string) *GetClusterClusterIDBackupsFilesParams { + o.SetQueryClusterID(queryClusterID) + return o +} + +// SetQueryClusterID adds the queryClusterId to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) SetQueryClusterID(queryClusterID *string) { + o.QueryClusterID = queryClusterID +} + +// WithSnapshotTag adds the snapshotTag to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) WithSnapshotTag(snapshotTag string) *GetClusterClusterIDBackupsFilesParams { + o.SetSnapshotTag(snapshotTag) + return o +} + +// SetSnapshotTag adds the snapshotTag to the get cluster cluster ID backups files params +func (o *GetClusterClusterIDBackupsFilesParams) SetSnapshotTag(snapshotTag string) { + o.SnapshotTag = snapshotTag +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterClusterIDBackupsFilesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + valuesKeyspace := o.Keyspace + + joinedKeyspace := swag.JoinByFormat(valuesKeyspace, "") + // query array param keyspace + if err := r.SetQueryParam("keyspace", joinedKeyspace...); err != nil { + return err + } + + valuesLocations := o.Locations + + joinedLocations := swag.JoinByFormat(valuesLocations, "") + // query array param locations + if err := r.SetQueryParam("locations", joinedLocations...); err != nil { + return err + } + + if o.QueryClusterID != nil { + + // query param query_cluster_id + var qrQueryClusterID string + if o.QueryClusterID != nil { + qrQueryClusterID = *o.QueryClusterID + } + qQueryClusterID := qrQueryClusterID + if qQueryClusterID != "" { + if err := r.SetQueryParam("query_cluster_id", qQueryClusterID); err != nil { + return err + } + } + + } + + // query param snapshot_tag + qrSnapshotTag := o.SnapshotTag + qSnapshotTag := qrSnapshotTag + if qSnapshotTag != "" { + if err := r.SetQueryParam("snapshot_tag", qSnapshotTag); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_backups_files_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_backups_files_responses.go new file mode 100644 index 0000000000..afa118eb8c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_backups_files_responses.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClusterClusterIDBackupsFilesReader is a Reader for the GetClusterClusterIDBackupsFiles structure. +type GetClusterClusterIDBackupsFilesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterClusterIDBackupsFilesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterClusterIDBackupsFilesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClusterClusterIDBackupsFilesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClusterClusterIDBackupsFilesOK creates a GetClusterClusterIDBackupsFilesOK with default headers values +func NewGetClusterClusterIDBackupsFilesOK() *GetClusterClusterIDBackupsFilesOK { + return &GetClusterClusterIDBackupsFilesOK{} +} + +/* +GetClusterClusterIDBackupsFilesOK handles this case with default header values. + +Backup list +*/ +type GetClusterClusterIDBackupsFilesOK struct { + Payload []*models.BackupFilesInfo +} + +func (o *GetClusterClusterIDBackupsFilesOK) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/backups/files][%d] getClusterClusterIdBackupsFilesOK %+v", 200, o.Payload) +} + +func (o *GetClusterClusterIDBackupsFilesOK) GetPayload() []*models.BackupFilesInfo { + return o.Payload +} + +func (o *GetClusterClusterIDBackupsFilesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterClusterIDBackupsFilesDefault creates a GetClusterClusterIDBackupsFilesDefault with default headers values +func NewGetClusterClusterIDBackupsFilesDefault(code int) *GetClusterClusterIDBackupsFilesDefault { + return &GetClusterClusterIDBackupsFilesDefault{ + _statusCode: code, + } +} + +/* +GetClusterClusterIDBackupsFilesDefault handles this case with default header values. + +Error +*/ +type GetClusterClusterIDBackupsFilesDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get cluster cluster ID backups files default response +func (o *GetClusterClusterIDBackupsFilesDefault) Code() int { + return o._statusCode +} + +func (o *GetClusterClusterIDBackupsFilesDefault) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/backups/files][%d] GetClusterClusterIDBackupsFiles default %+v", o._statusCode, o.Payload) +} + +func (o *GetClusterClusterIDBackupsFilesDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClusterClusterIDBackupsFilesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_backups_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_backups_parameters.go new file mode 100644 index 0000000000..c76f50740d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_backups_parameters.go @@ -0,0 +1,263 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetClusterClusterIDBackupsParams creates a new GetClusterClusterIDBackupsParams object +// with the default values initialized. +func NewGetClusterClusterIDBackupsParams() *GetClusterClusterIDBackupsParams { + var () + return &GetClusterClusterIDBackupsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterClusterIDBackupsParamsWithTimeout creates a new GetClusterClusterIDBackupsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterClusterIDBackupsParamsWithTimeout(timeout time.Duration) *GetClusterClusterIDBackupsParams { + var () + return &GetClusterClusterIDBackupsParams{ + + timeout: timeout, + } +} + +// NewGetClusterClusterIDBackupsParamsWithContext creates a new GetClusterClusterIDBackupsParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterClusterIDBackupsParamsWithContext(ctx context.Context) *GetClusterClusterIDBackupsParams { + var () + return &GetClusterClusterIDBackupsParams{ + + Context: ctx, + } +} + +// NewGetClusterClusterIDBackupsParamsWithHTTPClient creates a new GetClusterClusterIDBackupsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterClusterIDBackupsParamsWithHTTPClient(client *http.Client) *GetClusterClusterIDBackupsParams { + var () + return &GetClusterClusterIDBackupsParams{ + HTTPClient: client, + } +} + +/* +GetClusterClusterIDBackupsParams contains all the parameters to send to the API endpoint +for the get cluster cluster ID backups operation typically these are written to a http.Request +*/ +type GetClusterClusterIDBackupsParams struct { + + /*ClusterID*/ + ClusterID string + /*Keyspace*/ + Keyspace []string + /*Locations*/ + Locations []string + /*MaxDate*/ + MaxDate *strfmt.DateTime + /*MinDate*/ + MinDate *strfmt.DateTime + /*QueryClusterID*/ + QueryClusterID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDBackupsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) WithContext(ctx context.Context) *GetClusterClusterIDBackupsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) WithHTTPClient(client *http.Client) *GetClusterClusterIDBackupsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) WithClusterID(clusterID string) *GetClusterClusterIDBackupsParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithKeyspace adds the keyspace to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) WithKeyspace(keyspace []string) *GetClusterClusterIDBackupsParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) SetKeyspace(keyspace []string) { + o.Keyspace = keyspace +} + +// WithLocations adds the locations to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) WithLocations(locations []string) *GetClusterClusterIDBackupsParams { + o.SetLocations(locations) + return o +} + +// SetLocations adds the locations to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) SetLocations(locations []string) { + o.Locations = locations +} + +// WithMaxDate adds the maxDate to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) WithMaxDate(maxDate *strfmt.DateTime) *GetClusterClusterIDBackupsParams { + o.SetMaxDate(maxDate) + return o +} + +// SetMaxDate adds the maxDate to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) SetMaxDate(maxDate *strfmt.DateTime) { + o.MaxDate = maxDate +} + +// WithMinDate adds the minDate to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) WithMinDate(minDate *strfmt.DateTime) *GetClusterClusterIDBackupsParams { + o.SetMinDate(minDate) + return o +} + +// SetMinDate adds the minDate to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) SetMinDate(minDate *strfmt.DateTime) { + o.MinDate = minDate +} + +// WithQueryClusterID adds the queryClusterID to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) WithQueryClusterID(queryClusterID *string) *GetClusterClusterIDBackupsParams { + o.SetQueryClusterID(queryClusterID) + return o +} + +// SetQueryClusterID adds the queryClusterId to the get cluster cluster ID backups params +func (o *GetClusterClusterIDBackupsParams) SetQueryClusterID(queryClusterID *string) { + o.QueryClusterID = queryClusterID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterClusterIDBackupsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + valuesKeyspace := o.Keyspace + + joinedKeyspace := swag.JoinByFormat(valuesKeyspace, "") + // query array param keyspace + if err := r.SetQueryParam("keyspace", joinedKeyspace...); err != nil { + return err + } + + valuesLocations := o.Locations + + joinedLocations := swag.JoinByFormat(valuesLocations, "") + // query array param locations + if err := r.SetQueryParam("locations", joinedLocations...); err != nil { + return err + } + + if o.MaxDate != nil { + + // query param max_date + var qrMaxDate strfmt.DateTime + if o.MaxDate != nil { + qrMaxDate = *o.MaxDate + } + qMaxDate := qrMaxDate.String() + if qMaxDate != "" { + if err := r.SetQueryParam("max_date", qMaxDate); err != nil { + return err + } + } + + } + + if o.MinDate != nil { + + // query param min_date + var qrMinDate strfmt.DateTime + if o.MinDate != nil { + qrMinDate = *o.MinDate + } + qMinDate := qrMinDate.String() + if qMinDate != "" { + if err := r.SetQueryParam("min_date", qMinDate); err != nil { + return err + } + } + + } + + if o.QueryClusterID != nil { + + // query param query_cluster_id + var qrQueryClusterID string + if o.QueryClusterID != nil { + qrQueryClusterID = *o.QueryClusterID + } + qQueryClusterID := qrQueryClusterID + if qQueryClusterID != "" { + if err := r.SetQueryParam("query_cluster_id", qQueryClusterID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_backups_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_backups_responses.go new file mode 100644 index 0000000000..db0ace2b33 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_backups_responses.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClusterClusterIDBackupsReader is a Reader for the GetClusterClusterIDBackups structure. +type GetClusterClusterIDBackupsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterClusterIDBackupsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterClusterIDBackupsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClusterClusterIDBackupsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClusterClusterIDBackupsOK creates a GetClusterClusterIDBackupsOK with default headers values +func NewGetClusterClusterIDBackupsOK() *GetClusterClusterIDBackupsOK { + return &GetClusterClusterIDBackupsOK{} +} + +/* +GetClusterClusterIDBackupsOK handles this case with default header values. + +Backup list +*/ +type GetClusterClusterIDBackupsOK struct { + Payload []*models.BackupListItem +} + +func (o *GetClusterClusterIDBackupsOK) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/backups][%d] getClusterClusterIdBackupsOK %+v", 200, o.Payload) +} + +func (o *GetClusterClusterIDBackupsOK) GetPayload() []*models.BackupListItem { + return o.Payload +} + +func (o *GetClusterClusterIDBackupsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterClusterIDBackupsDefault creates a GetClusterClusterIDBackupsDefault with default headers values +func NewGetClusterClusterIDBackupsDefault(code int) *GetClusterClusterIDBackupsDefault { + return &GetClusterClusterIDBackupsDefault{ + _statusCode: code, + } +} + +/* +GetClusterClusterIDBackupsDefault handles this case with default header values. + +Error +*/ +type GetClusterClusterIDBackupsDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get cluster cluster ID backups default response +func (o *GetClusterClusterIDBackupsDefault) Code() int { + return o._statusCode +} + +func (o *GetClusterClusterIDBackupsDefault) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/backups][%d] GetClusterClusterIDBackups default %+v", o._statusCode, o.Payload) +} + +func (o *GetClusterClusterIDBackupsDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClusterClusterIDBackupsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_parameters.go new file mode 100644 index 0000000000..c262e7f35e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_parameters.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetClusterClusterIDParams creates a new GetClusterClusterIDParams object +// with the default values initialized. +func NewGetClusterClusterIDParams() *GetClusterClusterIDParams { + var () + return &GetClusterClusterIDParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterClusterIDParamsWithTimeout creates a new GetClusterClusterIDParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterClusterIDParamsWithTimeout(timeout time.Duration) *GetClusterClusterIDParams { + var () + return &GetClusterClusterIDParams{ + + timeout: timeout, + } +} + +// NewGetClusterClusterIDParamsWithContext creates a new GetClusterClusterIDParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterClusterIDParamsWithContext(ctx context.Context) *GetClusterClusterIDParams { + var () + return &GetClusterClusterIDParams{ + + Context: ctx, + } +} + +// NewGetClusterClusterIDParamsWithHTTPClient creates a new GetClusterClusterIDParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterClusterIDParamsWithHTTPClient(client *http.Client) *GetClusterClusterIDParams { + var () + return &GetClusterClusterIDParams{ + HTTPClient: client, + } +} + +/* +GetClusterClusterIDParams contains all the parameters to send to the API endpoint +for the get cluster cluster ID operation typically these are written to a http.Request +*/ +type GetClusterClusterIDParams struct { + + /*ClusterID*/ + ClusterID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cluster cluster ID params +func (o *GetClusterClusterIDParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster cluster ID params +func (o *GetClusterClusterIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster cluster ID params +func (o *GetClusterClusterIDParams) WithContext(ctx context.Context) *GetClusterClusterIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster cluster ID params +func (o *GetClusterClusterIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster cluster ID params +func (o *GetClusterClusterIDParams) WithHTTPClient(client *http.Client) *GetClusterClusterIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster cluster ID params +func (o *GetClusterClusterIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get cluster cluster ID params +func (o *GetClusterClusterIDParams) WithClusterID(clusterID string) *GetClusterClusterIDParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get cluster cluster ID params +func (o *GetClusterClusterIDParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterClusterIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_responses.go new file mode 100644 index 0000000000..8b8affeee6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_responses.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClusterClusterIDReader is a Reader for the GetClusterClusterID structure. +type GetClusterClusterIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterClusterIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterClusterIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClusterClusterIDDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClusterClusterIDOK creates a GetClusterClusterIDOK with default headers values +func NewGetClusterClusterIDOK() *GetClusterClusterIDOK { + return &GetClusterClusterIDOK{} +} + +/* +GetClusterClusterIDOK handles this case with default header values. + +Cluster info +*/ +type GetClusterClusterIDOK struct { + Payload *models.Cluster +} + +func (o *GetClusterClusterIDOK) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}][%d] getClusterClusterIdOK %+v", 200, o.Payload) +} + +func (o *GetClusterClusterIDOK) GetPayload() *models.Cluster { + return o.Payload +} + +func (o *GetClusterClusterIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Cluster) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterClusterIDDefault creates a GetClusterClusterIDDefault with default headers values +func NewGetClusterClusterIDDefault(code int) *GetClusterClusterIDDefault { + return &GetClusterClusterIDDefault{ + _statusCode: code, + } +} + +/* +GetClusterClusterIDDefault handles this case with default header values. + +Error +*/ +type GetClusterClusterIDDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get cluster cluster ID default response +func (o *GetClusterClusterIDDefault) Code() int { + return o._statusCode +} + +func (o *GetClusterClusterIDDefault) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}][%d] GetClusterClusterID default %+v", o._statusCode, o.Payload) +} + +func (o *GetClusterClusterIDDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClusterClusterIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_status_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_status_parameters.go new file mode 100644 index 0000000000..0cc9c22c60 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_status_parameters.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetClusterClusterIDStatusParams creates a new GetClusterClusterIDStatusParams object +// with the default values initialized. +func NewGetClusterClusterIDStatusParams() *GetClusterClusterIDStatusParams { + var () + return &GetClusterClusterIDStatusParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterClusterIDStatusParamsWithTimeout creates a new GetClusterClusterIDStatusParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterClusterIDStatusParamsWithTimeout(timeout time.Duration) *GetClusterClusterIDStatusParams { + var () + return &GetClusterClusterIDStatusParams{ + + timeout: timeout, + } +} + +// NewGetClusterClusterIDStatusParamsWithContext creates a new GetClusterClusterIDStatusParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterClusterIDStatusParamsWithContext(ctx context.Context) *GetClusterClusterIDStatusParams { + var () + return &GetClusterClusterIDStatusParams{ + + Context: ctx, + } +} + +// NewGetClusterClusterIDStatusParamsWithHTTPClient creates a new GetClusterClusterIDStatusParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterClusterIDStatusParamsWithHTTPClient(client *http.Client) *GetClusterClusterIDStatusParams { + var () + return &GetClusterClusterIDStatusParams{ + HTTPClient: client, + } +} + +/* +GetClusterClusterIDStatusParams contains all the parameters to send to the API endpoint +for the get cluster cluster ID status operation typically these are written to a http.Request +*/ +type GetClusterClusterIDStatusParams struct { + + /*ClusterID*/ + ClusterID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cluster cluster ID status params +func (o *GetClusterClusterIDStatusParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster cluster ID status params +func (o *GetClusterClusterIDStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster cluster ID status params +func (o *GetClusterClusterIDStatusParams) WithContext(ctx context.Context) *GetClusterClusterIDStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster cluster ID status params +func (o *GetClusterClusterIDStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster cluster ID status params +func (o *GetClusterClusterIDStatusParams) WithHTTPClient(client *http.Client) *GetClusterClusterIDStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster cluster ID status params +func (o *GetClusterClusterIDStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get cluster cluster ID status params +func (o *GetClusterClusterIDStatusParams) WithClusterID(clusterID string) *GetClusterClusterIDStatusParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get cluster cluster ID status params +func (o *GetClusterClusterIDStatusParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterClusterIDStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_status_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_status_responses.go new file mode 100644 index 0000000000..49c7b11dfb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_status_responses.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClusterClusterIDStatusReader is a Reader for the GetClusterClusterIDStatus structure. +type GetClusterClusterIDStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterClusterIDStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterClusterIDStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClusterClusterIDStatusDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClusterClusterIDStatusOK creates a GetClusterClusterIDStatusOK with default headers values +func NewGetClusterClusterIDStatusOK() *GetClusterClusterIDStatusOK { + return &GetClusterClusterIDStatusOK{} +} + +/* +GetClusterClusterIDStatusOK handles this case with default header values. + +Cluster hosts and their statuses +*/ +type GetClusterClusterIDStatusOK struct { + Payload models.ClusterStatus +} + +func (o *GetClusterClusterIDStatusOK) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/status][%d] getClusterClusterIdStatusOK %+v", 200, o.Payload) +} + +func (o *GetClusterClusterIDStatusOK) GetPayload() models.ClusterStatus { + return o.Payload +} + +func (o *GetClusterClusterIDStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterClusterIDStatusDefault creates a GetClusterClusterIDStatusDefault with default headers values +func NewGetClusterClusterIDStatusDefault(code int) *GetClusterClusterIDStatusDefault { + return &GetClusterClusterIDStatusDefault{ + _statusCode: code, + } +} + +/* +GetClusterClusterIDStatusDefault handles this case with default header values. + +Error +*/ +type GetClusterClusterIDStatusDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get cluster cluster ID status default response +func (o *GetClusterClusterIDStatusDefault) Code() int { + return o._statusCode +} + +func (o *GetClusterClusterIDStatusDefault) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/status][%d] GetClusterClusterIDStatus default %+v", o._statusCode, o.Payload) +} + +func (o *GetClusterClusterIDStatusDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClusterClusterIDStatusDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_suspended_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_suspended_parameters.go new file mode 100644 index 0000000000..3ce5842041 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_suspended_parameters.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetClusterClusterIDSuspendedParams creates a new GetClusterClusterIDSuspendedParams object +// with the default values initialized. +func NewGetClusterClusterIDSuspendedParams() *GetClusterClusterIDSuspendedParams { + var () + return &GetClusterClusterIDSuspendedParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterClusterIDSuspendedParamsWithTimeout creates a new GetClusterClusterIDSuspendedParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterClusterIDSuspendedParamsWithTimeout(timeout time.Duration) *GetClusterClusterIDSuspendedParams { + var () + return &GetClusterClusterIDSuspendedParams{ + + timeout: timeout, + } +} + +// NewGetClusterClusterIDSuspendedParamsWithContext creates a new GetClusterClusterIDSuspendedParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterClusterIDSuspendedParamsWithContext(ctx context.Context) *GetClusterClusterIDSuspendedParams { + var () + return &GetClusterClusterIDSuspendedParams{ + + Context: ctx, + } +} + +// NewGetClusterClusterIDSuspendedParamsWithHTTPClient creates a new GetClusterClusterIDSuspendedParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterClusterIDSuspendedParamsWithHTTPClient(client *http.Client) *GetClusterClusterIDSuspendedParams { + var () + return &GetClusterClusterIDSuspendedParams{ + HTTPClient: client, + } +} + +/* +GetClusterClusterIDSuspendedParams contains all the parameters to send to the API endpoint +for the get cluster cluster ID suspended operation typically these are written to a http.Request +*/ +type GetClusterClusterIDSuspendedParams struct { + + /*ClusterID*/ + ClusterID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cluster cluster ID suspended params +func (o *GetClusterClusterIDSuspendedParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDSuspendedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster cluster ID suspended params +func (o *GetClusterClusterIDSuspendedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster cluster ID suspended params +func (o *GetClusterClusterIDSuspendedParams) WithContext(ctx context.Context) *GetClusterClusterIDSuspendedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster cluster ID suspended params +func (o *GetClusterClusterIDSuspendedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster cluster ID suspended params +func (o *GetClusterClusterIDSuspendedParams) WithHTTPClient(client *http.Client) *GetClusterClusterIDSuspendedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster cluster ID suspended params +func (o *GetClusterClusterIDSuspendedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get cluster cluster ID suspended params +func (o *GetClusterClusterIDSuspendedParams) WithClusterID(clusterID string) *GetClusterClusterIDSuspendedParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get cluster cluster ID suspended params +func (o *GetClusterClusterIDSuspendedParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterClusterIDSuspendedParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_suspended_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_suspended_responses.go new file mode 100644 index 0000000000..8580ff318d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_suspended_responses.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClusterClusterIDSuspendedReader is a Reader for the GetClusterClusterIDSuspended structure. +type GetClusterClusterIDSuspendedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterClusterIDSuspendedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterClusterIDSuspendedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClusterClusterIDSuspendedDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClusterClusterIDSuspendedOK creates a GetClusterClusterIDSuspendedOK with default headers values +func NewGetClusterClusterIDSuspendedOK() *GetClusterClusterIDSuspendedOK { + return &GetClusterClusterIDSuspendedOK{} +} + +/* +GetClusterClusterIDSuspendedOK handles this case with default header values. + +OK +*/ +type GetClusterClusterIDSuspendedOK struct { + Payload models.Suspended +} + +func (o *GetClusterClusterIDSuspendedOK) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/suspended][%d] getClusterClusterIdSuspendedOK %+v", 200, o.Payload) +} + +func (o *GetClusterClusterIDSuspendedOK) GetPayload() models.Suspended { + return o.Payload +} + +func (o *GetClusterClusterIDSuspendedOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterClusterIDSuspendedDefault creates a GetClusterClusterIDSuspendedDefault with default headers values +func NewGetClusterClusterIDSuspendedDefault(code int) *GetClusterClusterIDSuspendedDefault { + return &GetClusterClusterIDSuspendedDefault{ + _statusCode: code, + } +} + +/* +GetClusterClusterIDSuspendedDefault handles this case with default header values. + +Error +*/ +type GetClusterClusterIDSuspendedDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get cluster cluster ID suspended default response +func (o *GetClusterClusterIDSuspendedDefault) Code() int { + return o._statusCode +} + +func (o *GetClusterClusterIDSuspendedDefault) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/suspended][%d] GetClusterClusterIDSuspended default %+v", o._statusCode, o.Payload) +} + +func (o *GetClusterClusterIDSuspendedDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClusterClusterIDSuspendedDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_backup_task_id_run_id_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_backup_task_id_run_id_parameters.go new file mode 100644 index 0000000000..8ecd52a6dd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_backup_task_id_run_id_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetClusterClusterIDTaskBackupTaskIDRunIDParams creates a new GetClusterClusterIDTaskBackupTaskIDRunIDParams object +// with the default values initialized. +func NewGetClusterClusterIDTaskBackupTaskIDRunIDParams() *GetClusterClusterIDTaskBackupTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskBackupTaskIDRunIDParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterClusterIDTaskBackupTaskIDRunIDParamsWithTimeout creates a new GetClusterClusterIDTaskBackupTaskIDRunIDParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterClusterIDTaskBackupTaskIDRunIDParamsWithTimeout(timeout time.Duration) *GetClusterClusterIDTaskBackupTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskBackupTaskIDRunIDParams{ + + timeout: timeout, + } +} + +// NewGetClusterClusterIDTaskBackupTaskIDRunIDParamsWithContext creates a new GetClusterClusterIDTaskBackupTaskIDRunIDParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterClusterIDTaskBackupTaskIDRunIDParamsWithContext(ctx context.Context) *GetClusterClusterIDTaskBackupTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskBackupTaskIDRunIDParams{ + + Context: ctx, + } +} + +// NewGetClusterClusterIDTaskBackupTaskIDRunIDParamsWithHTTPClient creates a new GetClusterClusterIDTaskBackupTaskIDRunIDParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterClusterIDTaskBackupTaskIDRunIDParamsWithHTTPClient(client *http.Client) *GetClusterClusterIDTaskBackupTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskBackupTaskIDRunIDParams{ + HTTPClient: client, + } +} + +/* +GetClusterClusterIDTaskBackupTaskIDRunIDParams contains all the parameters to send to the API endpoint +for the get cluster cluster ID task backup task ID run ID operation typically these are written to a http.Request +*/ +type GetClusterClusterIDTaskBackupTaskIDRunIDParams struct { + + /*ClusterID*/ + ClusterID string + /*RunID*/ + RunID string + /*TaskID*/ + TaskID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cluster cluster ID task backup task ID run ID params +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDTaskBackupTaskIDRunIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster cluster ID task backup task ID run ID params +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster cluster ID task backup task ID run ID params +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDParams) WithContext(ctx context.Context) *GetClusterClusterIDTaskBackupTaskIDRunIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster cluster ID task backup task ID run ID params +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster cluster ID task backup task ID run ID params +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDParams) WithHTTPClient(client *http.Client) *GetClusterClusterIDTaskBackupTaskIDRunIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster cluster ID task backup task ID run ID params +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get cluster cluster ID task backup task ID run ID params +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDParams) WithClusterID(clusterID string) *GetClusterClusterIDTaskBackupTaskIDRunIDParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get cluster cluster ID task backup task ID run ID params +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithRunID adds the runID to the get cluster cluster ID task backup task ID run ID params +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDParams) WithRunID(runID string) *GetClusterClusterIDTaskBackupTaskIDRunIDParams { + o.SetRunID(runID) + return o +} + +// SetRunID adds the runId to the get cluster cluster ID task backup task ID run ID params +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDParams) SetRunID(runID string) { + o.RunID = runID +} + +// WithTaskID adds the taskID to the get cluster cluster ID task backup task ID run ID params +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDParams) WithTaskID(taskID string) *GetClusterClusterIDTaskBackupTaskIDRunIDParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the get cluster cluster ID task backup task ID run ID params +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + // path param run_id + if err := r.SetPathParam("run_id", o.RunID); err != nil { + return err + } + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_backup_task_id_run_id_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_backup_task_id_run_id_responses.go new file mode 100644 index 0000000000..2957e829dc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_backup_task_id_run_id_responses.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClusterClusterIDTaskBackupTaskIDRunIDReader is a Reader for the GetClusterClusterIDTaskBackupTaskIDRunID structure. +type GetClusterClusterIDTaskBackupTaskIDRunIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterClusterIDTaskBackupTaskIDRunIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClusterClusterIDTaskBackupTaskIDRunIDDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClusterClusterIDTaskBackupTaskIDRunIDOK creates a GetClusterClusterIDTaskBackupTaskIDRunIDOK with default headers values +func NewGetClusterClusterIDTaskBackupTaskIDRunIDOK() *GetClusterClusterIDTaskBackupTaskIDRunIDOK { + return &GetClusterClusterIDTaskBackupTaskIDRunIDOK{} +} + +/* +GetClusterClusterIDTaskBackupTaskIDRunIDOK handles this case with default header values. + +Backup progress +*/ +type GetClusterClusterIDTaskBackupTaskIDRunIDOK struct { + Payload *models.TaskRunBackupProgress +} + +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDOK) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/task/backup/{task_id}/{run_id}][%d] getClusterClusterIdTaskBackupTaskIdRunIdOK %+v", 200, o.Payload) +} + +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDOK) GetPayload() *models.TaskRunBackupProgress { + return o.Payload +} + +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskRunBackupProgress) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterClusterIDTaskBackupTaskIDRunIDDefault creates a GetClusterClusterIDTaskBackupTaskIDRunIDDefault with default headers values +func NewGetClusterClusterIDTaskBackupTaskIDRunIDDefault(code int) *GetClusterClusterIDTaskBackupTaskIDRunIDDefault { + return &GetClusterClusterIDTaskBackupTaskIDRunIDDefault{ + _statusCode: code, + } +} + +/* +GetClusterClusterIDTaskBackupTaskIDRunIDDefault handles this case with default header values. + +Error +*/ +type GetClusterClusterIDTaskBackupTaskIDRunIDDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get cluster cluster ID task backup task ID run ID default response +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDDefault) Code() int { + return o._statusCode +} + +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDDefault) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/task/backup/{task_id}/{run_id}][%d] GetClusterClusterIDTaskBackupTaskIDRunID default %+v", o._statusCode, o.Payload) +} + +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClusterClusterIDTaskBackupTaskIDRunIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_repair_task_id_run_id_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_repair_task_id_run_id_parameters.go new file mode 100644 index 0000000000..37a89afc31 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_repair_task_id_run_id_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetClusterClusterIDTaskRepairTaskIDRunIDParams creates a new GetClusterClusterIDTaskRepairTaskIDRunIDParams object +// with the default values initialized. +func NewGetClusterClusterIDTaskRepairTaskIDRunIDParams() *GetClusterClusterIDTaskRepairTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskRepairTaskIDRunIDParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterClusterIDTaskRepairTaskIDRunIDParamsWithTimeout creates a new GetClusterClusterIDTaskRepairTaskIDRunIDParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterClusterIDTaskRepairTaskIDRunIDParamsWithTimeout(timeout time.Duration) *GetClusterClusterIDTaskRepairTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskRepairTaskIDRunIDParams{ + + timeout: timeout, + } +} + +// NewGetClusterClusterIDTaskRepairTaskIDRunIDParamsWithContext creates a new GetClusterClusterIDTaskRepairTaskIDRunIDParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterClusterIDTaskRepairTaskIDRunIDParamsWithContext(ctx context.Context) *GetClusterClusterIDTaskRepairTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskRepairTaskIDRunIDParams{ + + Context: ctx, + } +} + +// NewGetClusterClusterIDTaskRepairTaskIDRunIDParamsWithHTTPClient creates a new GetClusterClusterIDTaskRepairTaskIDRunIDParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterClusterIDTaskRepairTaskIDRunIDParamsWithHTTPClient(client *http.Client) *GetClusterClusterIDTaskRepairTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskRepairTaskIDRunIDParams{ + HTTPClient: client, + } +} + +/* +GetClusterClusterIDTaskRepairTaskIDRunIDParams contains all the parameters to send to the API endpoint +for the get cluster cluster ID task repair task ID run ID operation typically these are written to a http.Request +*/ +type GetClusterClusterIDTaskRepairTaskIDRunIDParams struct { + + /*ClusterID*/ + ClusterID string + /*RunID*/ + RunID string + /*TaskID*/ + TaskID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cluster cluster ID task repair task ID run ID params +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDTaskRepairTaskIDRunIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster cluster ID task repair task ID run ID params +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster cluster ID task repair task ID run ID params +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDParams) WithContext(ctx context.Context) *GetClusterClusterIDTaskRepairTaskIDRunIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster cluster ID task repair task ID run ID params +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster cluster ID task repair task ID run ID params +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDParams) WithHTTPClient(client *http.Client) *GetClusterClusterIDTaskRepairTaskIDRunIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster cluster ID task repair task ID run ID params +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get cluster cluster ID task repair task ID run ID params +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDParams) WithClusterID(clusterID string) *GetClusterClusterIDTaskRepairTaskIDRunIDParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get cluster cluster ID task repair task ID run ID params +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithRunID adds the runID to the get cluster cluster ID task repair task ID run ID params +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDParams) WithRunID(runID string) *GetClusterClusterIDTaskRepairTaskIDRunIDParams { + o.SetRunID(runID) + return o +} + +// SetRunID adds the runId to the get cluster cluster ID task repair task ID run ID params +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDParams) SetRunID(runID string) { + o.RunID = runID +} + +// WithTaskID adds the taskID to the get cluster cluster ID task repair task ID run ID params +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDParams) WithTaskID(taskID string) *GetClusterClusterIDTaskRepairTaskIDRunIDParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the get cluster cluster ID task repair task ID run ID params +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + // path param run_id + if err := r.SetPathParam("run_id", o.RunID); err != nil { + return err + } + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_repair_task_id_run_id_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_repair_task_id_run_id_responses.go new file mode 100644 index 0000000000..82ffa8515b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_repair_task_id_run_id_responses.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClusterClusterIDTaskRepairTaskIDRunIDReader is a Reader for the GetClusterClusterIDTaskRepairTaskIDRunID structure. +type GetClusterClusterIDTaskRepairTaskIDRunIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterClusterIDTaskRepairTaskIDRunIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClusterClusterIDTaskRepairTaskIDRunIDDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClusterClusterIDTaskRepairTaskIDRunIDOK creates a GetClusterClusterIDTaskRepairTaskIDRunIDOK with default headers values +func NewGetClusterClusterIDTaskRepairTaskIDRunIDOK() *GetClusterClusterIDTaskRepairTaskIDRunIDOK { + return &GetClusterClusterIDTaskRepairTaskIDRunIDOK{} +} + +/* +GetClusterClusterIDTaskRepairTaskIDRunIDOK handles this case with default header values. + +Repair progress +*/ +type GetClusterClusterIDTaskRepairTaskIDRunIDOK struct { + Payload *models.TaskRunRepairProgress +} + +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDOK) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/task/repair/{task_id}/{run_id}][%d] getClusterClusterIdTaskRepairTaskIdRunIdOK %+v", 200, o.Payload) +} + +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDOK) GetPayload() *models.TaskRunRepairProgress { + return o.Payload +} + +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskRunRepairProgress) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterClusterIDTaskRepairTaskIDRunIDDefault creates a GetClusterClusterIDTaskRepairTaskIDRunIDDefault with default headers values +func NewGetClusterClusterIDTaskRepairTaskIDRunIDDefault(code int) *GetClusterClusterIDTaskRepairTaskIDRunIDDefault { + return &GetClusterClusterIDTaskRepairTaskIDRunIDDefault{ + _statusCode: code, + } +} + +/* +GetClusterClusterIDTaskRepairTaskIDRunIDDefault handles this case with default header values. + +Error +*/ +type GetClusterClusterIDTaskRepairTaskIDRunIDDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get cluster cluster ID task repair task ID run ID default response +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDDefault) Code() int { + return o._statusCode +} + +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDDefault) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/task/repair/{task_id}/{run_id}][%d] GetClusterClusterIDTaskRepairTaskIDRunID default %+v", o._statusCode, o.Payload) +} + +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClusterClusterIDTaskRepairTaskIDRunIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_restore_task_id_run_id_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_restore_task_id_run_id_parameters.go new file mode 100644 index 0000000000..c0df972086 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_restore_task_id_run_id_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetClusterClusterIDTaskRestoreTaskIDRunIDParams creates a new GetClusterClusterIDTaskRestoreTaskIDRunIDParams object +// with the default values initialized. +func NewGetClusterClusterIDTaskRestoreTaskIDRunIDParams() *GetClusterClusterIDTaskRestoreTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskRestoreTaskIDRunIDParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterClusterIDTaskRestoreTaskIDRunIDParamsWithTimeout creates a new GetClusterClusterIDTaskRestoreTaskIDRunIDParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterClusterIDTaskRestoreTaskIDRunIDParamsWithTimeout(timeout time.Duration) *GetClusterClusterIDTaskRestoreTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskRestoreTaskIDRunIDParams{ + + timeout: timeout, + } +} + +// NewGetClusterClusterIDTaskRestoreTaskIDRunIDParamsWithContext creates a new GetClusterClusterIDTaskRestoreTaskIDRunIDParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterClusterIDTaskRestoreTaskIDRunIDParamsWithContext(ctx context.Context) *GetClusterClusterIDTaskRestoreTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskRestoreTaskIDRunIDParams{ + + Context: ctx, + } +} + +// NewGetClusterClusterIDTaskRestoreTaskIDRunIDParamsWithHTTPClient creates a new GetClusterClusterIDTaskRestoreTaskIDRunIDParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterClusterIDTaskRestoreTaskIDRunIDParamsWithHTTPClient(client *http.Client) *GetClusterClusterIDTaskRestoreTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskRestoreTaskIDRunIDParams{ + HTTPClient: client, + } +} + +/* +GetClusterClusterIDTaskRestoreTaskIDRunIDParams contains all the parameters to send to the API endpoint +for the get cluster cluster ID task restore task ID run ID operation typically these are written to a http.Request +*/ +type GetClusterClusterIDTaskRestoreTaskIDRunIDParams struct { + + /*ClusterID*/ + ClusterID string + /*RunID*/ + RunID string + /*TaskID*/ + TaskID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cluster cluster ID task restore task ID run ID params +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDTaskRestoreTaskIDRunIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster cluster ID task restore task ID run ID params +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster cluster ID task restore task ID run ID params +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDParams) WithContext(ctx context.Context) *GetClusterClusterIDTaskRestoreTaskIDRunIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster cluster ID task restore task ID run ID params +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster cluster ID task restore task ID run ID params +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDParams) WithHTTPClient(client *http.Client) *GetClusterClusterIDTaskRestoreTaskIDRunIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster cluster ID task restore task ID run ID params +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get cluster cluster ID task restore task ID run ID params +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDParams) WithClusterID(clusterID string) *GetClusterClusterIDTaskRestoreTaskIDRunIDParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get cluster cluster ID task restore task ID run ID params +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithRunID adds the runID to the get cluster cluster ID task restore task ID run ID params +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDParams) WithRunID(runID string) *GetClusterClusterIDTaskRestoreTaskIDRunIDParams { + o.SetRunID(runID) + return o +} + +// SetRunID adds the runId to the get cluster cluster ID task restore task ID run ID params +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDParams) SetRunID(runID string) { + o.RunID = runID +} + +// WithTaskID adds the taskID to the get cluster cluster ID task restore task ID run ID params +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDParams) WithTaskID(taskID string) *GetClusterClusterIDTaskRestoreTaskIDRunIDParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the get cluster cluster ID task restore task ID run ID params +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + // path param run_id + if err := r.SetPathParam("run_id", o.RunID); err != nil { + return err + } + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_restore_task_id_run_id_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_restore_task_id_run_id_responses.go new file mode 100644 index 0000000000..54effbf18a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_restore_task_id_run_id_responses.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClusterClusterIDTaskRestoreTaskIDRunIDReader is a Reader for the GetClusterClusterIDTaskRestoreTaskIDRunID structure. +type GetClusterClusterIDTaskRestoreTaskIDRunIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterClusterIDTaskRestoreTaskIDRunIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClusterClusterIDTaskRestoreTaskIDRunIDDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClusterClusterIDTaskRestoreTaskIDRunIDOK creates a GetClusterClusterIDTaskRestoreTaskIDRunIDOK with default headers values +func NewGetClusterClusterIDTaskRestoreTaskIDRunIDOK() *GetClusterClusterIDTaskRestoreTaskIDRunIDOK { + return &GetClusterClusterIDTaskRestoreTaskIDRunIDOK{} +} + +/* +GetClusterClusterIDTaskRestoreTaskIDRunIDOK handles this case with default header values. + +Restore progress +*/ +type GetClusterClusterIDTaskRestoreTaskIDRunIDOK struct { + Payload *models.TaskRunRestoreProgress +} + +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDOK) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/task/restore/{task_id}/{run_id}][%d] getClusterClusterIdTaskRestoreTaskIdRunIdOK %+v", 200, o.Payload) +} + +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDOK) GetPayload() *models.TaskRunRestoreProgress { + return o.Payload +} + +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskRunRestoreProgress) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterClusterIDTaskRestoreTaskIDRunIDDefault creates a GetClusterClusterIDTaskRestoreTaskIDRunIDDefault with default headers values +func NewGetClusterClusterIDTaskRestoreTaskIDRunIDDefault(code int) *GetClusterClusterIDTaskRestoreTaskIDRunIDDefault { + return &GetClusterClusterIDTaskRestoreTaskIDRunIDDefault{ + _statusCode: code, + } +} + +/* +GetClusterClusterIDTaskRestoreTaskIDRunIDDefault handles this case with default header values. + +Error +*/ +type GetClusterClusterIDTaskRestoreTaskIDRunIDDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get cluster cluster ID task restore task ID run ID default response +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDDefault) Code() int { + return o._statusCode +} + +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDDefault) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/task/restore/{task_id}/{run_id}][%d] GetClusterClusterIDTaskRestoreTaskIDRunID default %+v", o._statusCode, o.Payload) +} + +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClusterClusterIDTaskRestoreTaskIDRunIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_task_type_task_id_history_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_task_type_task_id_history_parameters.go new file mode 100644 index 0000000000..2c5ebeb6d6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_task_type_task_id_history_parameters.go @@ -0,0 +1,199 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetClusterClusterIDTaskTaskTypeTaskIDHistoryParams creates a new GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams object +// with the default values initialized. +func NewGetClusterClusterIDTaskTaskTypeTaskIDHistoryParams() *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams { + var () + return &GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterClusterIDTaskTaskTypeTaskIDHistoryParamsWithTimeout creates a new GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterClusterIDTaskTaskTypeTaskIDHistoryParamsWithTimeout(timeout time.Duration) *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams { + var () + return &GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams{ + + timeout: timeout, + } +} + +// NewGetClusterClusterIDTaskTaskTypeTaskIDHistoryParamsWithContext creates a new GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterClusterIDTaskTaskTypeTaskIDHistoryParamsWithContext(ctx context.Context) *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams { + var () + return &GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams{ + + Context: ctx, + } +} + +// NewGetClusterClusterIDTaskTaskTypeTaskIDHistoryParamsWithHTTPClient creates a new GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterClusterIDTaskTaskTypeTaskIDHistoryParamsWithHTTPClient(client *http.Client) *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams { + var () + return &GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams{ + HTTPClient: client, + } +} + +/* +GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams contains all the parameters to send to the API endpoint +for the get cluster cluster ID task task type task ID history operation typically these are written to a http.Request +*/ +type GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams struct { + + /*ClusterID*/ + ClusterID string + /*Limit*/ + Limit *int64 + /*TaskID*/ + TaskID string + /*TaskType*/ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cluster cluster ID task task type task ID history params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster cluster ID task task type task ID history params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster cluster ID task task type task ID history params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) WithContext(ctx context.Context) *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster cluster ID task task type task ID history params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster cluster ID task task type task ID history params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) WithHTTPClient(client *http.Client) *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster cluster ID task task type task ID history params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get cluster cluster ID task task type task ID history params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) WithClusterID(clusterID string) *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get cluster cluster ID task task type task ID history params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithLimit adds the limit to the get cluster cluster ID task task type task ID history params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) WithLimit(limit *int64) *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get cluster cluster ID task task type task ID history params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithTaskID adds the taskID to the get cluster cluster ID task task type task ID history params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) WithTaskID(taskID string) *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the get cluster cluster ID task task type task ID history params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WithTaskType adds the taskType to the get cluster cluster ID task task type task ID history params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) WithTaskType(taskType string) *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the get cluster cluster ID task task type task ID history params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + // path param task_type + if err := r.SetPathParam("task_type", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_task_type_task_id_history_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_task_type_task_id_history_responses.go new file mode 100644 index 0000000000..dabf37e123 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_task_type_task_id_history_responses.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClusterClusterIDTaskTaskTypeTaskIDHistoryReader is a Reader for the GetClusterClusterIDTaskTaskTypeTaskIDHistory structure. +type GetClusterClusterIDTaskTaskTypeTaskIDHistoryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterClusterIDTaskTaskTypeTaskIDHistoryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClusterClusterIDTaskTaskTypeTaskIDHistoryDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClusterClusterIDTaskTaskTypeTaskIDHistoryOK creates a GetClusterClusterIDTaskTaskTypeTaskIDHistoryOK with default headers values +func NewGetClusterClusterIDTaskTaskTypeTaskIDHistoryOK() *GetClusterClusterIDTaskTaskTypeTaskIDHistoryOK { + return &GetClusterClusterIDTaskTaskTypeTaskIDHistoryOK{} +} + +/* +GetClusterClusterIDTaskTaskTypeTaskIDHistoryOK handles this case with default header values. + +List of task runs +*/ +type GetClusterClusterIDTaskTaskTypeTaskIDHistoryOK struct { + Payload []*models.TaskRun +} + +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryOK) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/task/{task_type}/{task_id}/history][%d] getClusterClusterIdTaskTaskTypeTaskIdHistoryOK %+v", 200, o.Payload) +} + +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryOK) GetPayload() []*models.TaskRun { + return o.Payload +} + +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterClusterIDTaskTaskTypeTaskIDHistoryDefault creates a GetClusterClusterIDTaskTaskTypeTaskIDHistoryDefault with default headers values +func NewGetClusterClusterIDTaskTaskTypeTaskIDHistoryDefault(code int) *GetClusterClusterIDTaskTaskTypeTaskIDHistoryDefault { + return &GetClusterClusterIDTaskTaskTypeTaskIDHistoryDefault{ + _statusCode: code, + } +} + +/* +GetClusterClusterIDTaskTaskTypeTaskIDHistoryDefault handles this case with default header values. + +Error +*/ +type GetClusterClusterIDTaskTaskTypeTaskIDHistoryDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get cluster cluster ID task task type task ID history default response +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryDefault) Code() int { + return o._statusCode +} + +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryDefault) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/task/{task_type}/{task_id}/history][%d] GetClusterClusterIDTaskTaskTypeTaskIDHistory default %+v", o._statusCode, o.Payload) +} + +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClusterClusterIDTaskTaskTypeTaskIDHistoryDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_task_type_task_id_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_task_type_task_id_parameters.go new file mode 100644 index 0000000000..cac9653b63 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_task_type_task_id_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetClusterClusterIDTaskTaskTypeTaskIDParams creates a new GetClusterClusterIDTaskTaskTypeTaskIDParams object +// with the default values initialized. +func NewGetClusterClusterIDTaskTaskTypeTaskIDParams() *GetClusterClusterIDTaskTaskTypeTaskIDParams { + var () + return &GetClusterClusterIDTaskTaskTypeTaskIDParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterClusterIDTaskTaskTypeTaskIDParamsWithTimeout creates a new GetClusterClusterIDTaskTaskTypeTaskIDParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterClusterIDTaskTaskTypeTaskIDParamsWithTimeout(timeout time.Duration) *GetClusterClusterIDTaskTaskTypeTaskIDParams { + var () + return &GetClusterClusterIDTaskTaskTypeTaskIDParams{ + + timeout: timeout, + } +} + +// NewGetClusterClusterIDTaskTaskTypeTaskIDParamsWithContext creates a new GetClusterClusterIDTaskTaskTypeTaskIDParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterClusterIDTaskTaskTypeTaskIDParamsWithContext(ctx context.Context) *GetClusterClusterIDTaskTaskTypeTaskIDParams { + var () + return &GetClusterClusterIDTaskTaskTypeTaskIDParams{ + + Context: ctx, + } +} + +// NewGetClusterClusterIDTaskTaskTypeTaskIDParamsWithHTTPClient creates a new GetClusterClusterIDTaskTaskTypeTaskIDParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterClusterIDTaskTaskTypeTaskIDParamsWithHTTPClient(client *http.Client) *GetClusterClusterIDTaskTaskTypeTaskIDParams { + var () + return &GetClusterClusterIDTaskTaskTypeTaskIDParams{ + HTTPClient: client, + } +} + +/* +GetClusterClusterIDTaskTaskTypeTaskIDParams contains all the parameters to send to the API endpoint +for the get cluster cluster ID task task type task ID operation typically these are written to a http.Request +*/ +type GetClusterClusterIDTaskTaskTypeTaskIDParams struct { + + /*ClusterID*/ + ClusterID string + /*TaskID*/ + TaskID string + /*TaskType*/ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cluster cluster ID task task type task ID params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster cluster ID task task type task ID params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster cluster ID task task type task ID params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDParams) WithContext(ctx context.Context) *GetClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster cluster ID task task type task ID params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster cluster ID task task type task ID params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDParams) WithHTTPClient(client *http.Client) *GetClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster cluster ID task task type task ID params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get cluster cluster ID task task type task ID params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDParams) WithClusterID(clusterID string) *GetClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get cluster cluster ID task task type task ID params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithTaskID adds the taskID to the get cluster cluster ID task task type task ID params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDParams) WithTaskID(taskID string) *GetClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the get cluster cluster ID task task type task ID params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WithTaskType adds the taskType to the get cluster cluster ID task task type task ID params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDParams) WithTaskType(taskType string) *GetClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the get cluster cluster ID task task type task ID params +func (o *GetClusterClusterIDTaskTaskTypeTaskIDParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterClusterIDTaskTaskTypeTaskIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + // path param task_type + if err := r.SetPathParam("task_type", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_task_type_task_id_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_task_type_task_id_responses.go new file mode 100644 index 0000000000..157676ffe7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_task_type_task_id_responses.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClusterClusterIDTaskTaskTypeTaskIDReader is a Reader for the GetClusterClusterIDTaskTaskTypeTaskID structure. +type GetClusterClusterIDTaskTaskTypeTaskIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterClusterIDTaskTaskTypeTaskIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterClusterIDTaskTaskTypeTaskIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClusterClusterIDTaskTaskTypeTaskIDDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClusterClusterIDTaskTaskTypeTaskIDOK creates a GetClusterClusterIDTaskTaskTypeTaskIDOK with default headers values +func NewGetClusterClusterIDTaskTaskTypeTaskIDOK() *GetClusterClusterIDTaskTaskTypeTaskIDOK { + return &GetClusterClusterIDTaskTaskTypeTaskIDOK{} +} + +/* +GetClusterClusterIDTaskTaskTypeTaskIDOK handles this case with default header values. + +Task info +*/ +type GetClusterClusterIDTaskTaskTypeTaskIDOK struct { + Payload *models.Task +} + +func (o *GetClusterClusterIDTaskTaskTypeTaskIDOK) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/task/{task_type}/{task_id}][%d] getClusterClusterIdTaskTaskTypeTaskIdOK %+v", 200, o.Payload) +} + +func (o *GetClusterClusterIDTaskTaskTypeTaskIDOK) GetPayload() *models.Task { + return o.Payload +} + +func (o *GetClusterClusterIDTaskTaskTypeTaskIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Task) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterClusterIDTaskTaskTypeTaskIDDefault creates a GetClusterClusterIDTaskTaskTypeTaskIDDefault with default headers values +func NewGetClusterClusterIDTaskTaskTypeTaskIDDefault(code int) *GetClusterClusterIDTaskTaskTypeTaskIDDefault { + return &GetClusterClusterIDTaskTaskTypeTaskIDDefault{ + _statusCode: code, + } +} + +/* +GetClusterClusterIDTaskTaskTypeTaskIDDefault handles this case with default header values. + +Error +*/ +type GetClusterClusterIDTaskTaskTypeTaskIDDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get cluster cluster ID task task type task ID default response +func (o *GetClusterClusterIDTaskTaskTypeTaskIDDefault) Code() int { + return o._statusCode +} + +func (o *GetClusterClusterIDTaskTaskTypeTaskIDDefault) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/task/{task_type}/{task_id}][%d] GetClusterClusterIDTaskTaskTypeTaskID default %+v", o._statusCode, o.Payload) +} + +func (o *GetClusterClusterIDTaskTaskTypeTaskIDDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClusterClusterIDTaskTaskTypeTaskIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_validate_backup_task_id_run_id_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_validate_backup_task_id_run_id_parameters.go new file mode 100644 index 0000000000..f423f1384e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_validate_backup_task_id_run_id_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetClusterClusterIDTaskValidateBackupTaskIDRunIDParams creates a new GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams object +// with the default values initialized. +func NewGetClusterClusterIDTaskValidateBackupTaskIDRunIDParams() *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterClusterIDTaskValidateBackupTaskIDRunIDParamsWithTimeout creates a new GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterClusterIDTaskValidateBackupTaskIDRunIDParamsWithTimeout(timeout time.Duration) *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams{ + + timeout: timeout, + } +} + +// NewGetClusterClusterIDTaskValidateBackupTaskIDRunIDParamsWithContext creates a new GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterClusterIDTaskValidateBackupTaskIDRunIDParamsWithContext(ctx context.Context) *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams{ + + Context: ctx, + } +} + +// NewGetClusterClusterIDTaskValidateBackupTaskIDRunIDParamsWithHTTPClient creates a new GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterClusterIDTaskValidateBackupTaskIDRunIDParamsWithHTTPClient(client *http.Client) *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams { + var () + return &GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams{ + HTTPClient: client, + } +} + +/* +GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams contains all the parameters to send to the API endpoint +for the get cluster cluster ID task validate backup task ID run ID operation typically these are written to a http.Request +*/ +type GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams struct { + + /*ClusterID*/ + ClusterID string + /*RunID*/ + RunID string + /*TaskID*/ + TaskID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cluster cluster ID task validate backup task ID run ID params +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster cluster ID task validate backup task ID run ID params +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster cluster ID task validate backup task ID run ID params +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams) WithContext(ctx context.Context) *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster cluster ID task validate backup task ID run ID params +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster cluster ID task validate backup task ID run ID params +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams) WithHTTPClient(client *http.Client) *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster cluster ID task validate backup task ID run ID params +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get cluster cluster ID task validate backup task ID run ID params +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams) WithClusterID(clusterID string) *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get cluster cluster ID task validate backup task ID run ID params +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithRunID adds the runID to the get cluster cluster ID task validate backup task ID run ID params +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams) WithRunID(runID string) *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams { + o.SetRunID(runID) + return o +} + +// SetRunID adds the runId to the get cluster cluster ID task validate backup task ID run ID params +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams) SetRunID(runID string) { + o.RunID = runID +} + +// WithTaskID adds the taskID to the get cluster cluster ID task validate backup task ID run ID params +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams) WithTaskID(taskID string) *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the get cluster cluster ID task validate backup task ID run ID params +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + // path param run_id + if err := r.SetPathParam("run_id", o.RunID); err != nil { + return err + } + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_validate_backup_task_id_run_id_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_validate_backup_task_id_run_id_responses.go new file mode 100644 index 0000000000..45da535623 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_task_validate_backup_task_id_run_id_responses.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClusterClusterIDTaskValidateBackupTaskIDRunIDReader is a Reader for the GetClusterClusterIDTaskValidateBackupTaskIDRunID structure. +type GetClusterClusterIDTaskValidateBackupTaskIDRunIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterClusterIDTaskValidateBackupTaskIDRunIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClusterClusterIDTaskValidateBackupTaskIDRunIDDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClusterClusterIDTaskValidateBackupTaskIDRunIDOK creates a GetClusterClusterIDTaskValidateBackupTaskIDRunIDOK with default headers values +func NewGetClusterClusterIDTaskValidateBackupTaskIDRunIDOK() *GetClusterClusterIDTaskValidateBackupTaskIDRunIDOK { + return &GetClusterClusterIDTaskValidateBackupTaskIDRunIDOK{} +} + +/* +GetClusterClusterIDTaskValidateBackupTaskIDRunIDOK handles this case with default header values. + +Backup validation progress +*/ +type GetClusterClusterIDTaskValidateBackupTaskIDRunIDOK struct { + Payload *models.TaskRunValidateBackupProgress +} + +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDOK) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/task/validate_backup/{task_id}/{run_id}][%d] getClusterClusterIdTaskValidateBackupTaskIdRunIdOK %+v", 200, o.Payload) +} + +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDOK) GetPayload() *models.TaskRunValidateBackupProgress { + return o.Payload +} + +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskRunValidateBackupProgress) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterClusterIDTaskValidateBackupTaskIDRunIDDefault creates a GetClusterClusterIDTaskValidateBackupTaskIDRunIDDefault with default headers values +func NewGetClusterClusterIDTaskValidateBackupTaskIDRunIDDefault(code int) *GetClusterClusterIDTaskValidateBackupTaskIDRunIDDefault { + return &GetClusterClusterIDTaskValidateBackupTaskIDRunIDDefault{ + _statusCode: code, + } +} + +/* +GetClusterClusterIDTaskValidateBackupTaskIDRunIDDefault handles this case with default header values. + +Error +*/ +type GetClusterClusterIDTaskValidateBackupTaskIDRunIDDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get cluster cluster ID task validate backup task ID run ID default response +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDDefault) Code() int { + return o._statusCode +} + +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDDefault) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/task/validate_backup/{task_id}/{run_id}][%d] GetClusterClusterIDTaskValidateBackupTaskIDRunID default %+v", o._statusCode, o.Payload) +} + +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClusterClusterIDTaskValidateBackupTaskIDRunIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_backup_target_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_backup_target_parameters.go new file mode 100644 index 0000000000..8aba4d6603 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_backup_target_parameters.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// NewGetClusterClusterIDTasksBackupTargetParams creates a new GetClusterClusterIDTasksBackupTargetParams object +// with the default values initialized. +func NewGetClusterClusterIDTasksBackupTargetParams() *GetClusterClusterIDTasksBackupTargetParams { + var () + return &GetClusterClusterIDTasksBackupTargetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterClusterIDTasksBackupTargetParamsWithTimeout creates a new GetClusterClusterIDTasksBackupTargetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterClusterIDTasksBackupTargetParamsWithTimeout(timeout time.Duration) *GetClusterClusterIDTasksBackupTargetParams { + var () + return &GetClusterClusterIDTasksBackupTargetParams{ + + timeout: timeout, + } +} + +// NewGetClusterClusterIDTasksBackupTargetParamsWithContext creates a new GetClusterClusterIDTasksBackupTargetParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterClusterIDTasksBackupTargetParamsWithContext(ctx context.Context) *GetClusterClusterIDTasksBackupTargetParams { + var () + return &GetClusterClusterIDTasksBackupTargetParams{ + + Context: ctx, + } +} + +// NewGetClusterClusterIDTasksBackupTargetParamsWithHTTPClient creates a new GetClusterClusterIDTasksBackupTargetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterClusterIDTasksBackupTargetParamsWithHTTPClient(client *http.Client) *GetClusterClusterIDTasksBackupTargetParams { + var () + return &GetClusterClusterIDTasksBackupTargetParams{ + HTTPClient: client, + } +} + +/* +GetClusterClusterIDTasksBackupTargetParams contains all the parameters to send to the API endpoint +for the get cluster cluster ID tasks backup target operation typically these are written to a http.Request +*/ +type GetClusterClusterIDTasksBackupTargetParams struct { + + /*ClusterID*/ + ClusterID string + /*TaskFields*/ + TaskFields *models.TaskUpdate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cluster cluster ID tasks backup target params +func (o *GetClusterClusterIDTasksBackupTargetParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDTasksBackupTargetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster cluster ID tasks backup target params +func (o *GetClusterClusterIDTasksBackupTargetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster cluster ID tasks backup target params +func (o *GetClusterClusterIDTasksBackupTargetParams) WithContext(ctx context.Context) *GetClusterClusterIDTasksBackupTargetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster cluster ID tasks backup target params +func (o *GetClusterClusterIDTasksBackupTargetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster cluster ID tasks backup target params +func (o *GetClusterClusterIDTasksBackupTargetParams) WithHTTPClient(client *http.Client) *GetClusterClusterIDTasksBackupTargetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster cluster ID tasks backup target params +func (o *GetClusterClusterIDTasksBackupTargetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get cluster cluster ID tasks backup target params +func (o *GetClusterClusterIDTasksBackupTargetParams) WithClusterID(clusterID string) *GetClusterClusterIDTasksBackupTargetParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get cluster cluster ID tasks backup target params +func (o *GetClusterClusterIDTasksBackupTargetParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithTaskFields adds the taskFields to the get cluster cluster ID tasks backup target params +func (o *GetClusterClusterIDTasksBackupTargetParams) WithTaskFields(taskFields *models.TaskUpdate) *GetClusterClusterIDTasksBackupTargetParams { + o.SetTaskFields(taskFields) + return o +} + +// SetTaskFields adds the taskFields to the get cluster cluster ID tasks backup target params +func (o *GetClusterClusterIDTasksBackupTargetParams) SetTaskFields(taskFields *models.TaskUpdate) { + o.TaskFields = taskFields +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterClusterIDTasksBackupTargetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + if o.TaskFields != nil { + if err := r.SetBodyParam(o.TaskFields); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_backup_target_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_backup_target_responses.go new file mode 100644 index 0000000000..367780b1c8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_backup_target_responses.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClusterClusterIDTasksBackupTargetReader is a Reader for the GetClusterClusterIDTasksBackupTarget structure. +type GetClusterClusterIDTasksBackupTargetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterClusterIDTasksBackupTargetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterClusterIDTasksBackupTargetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClusterClusterIDTasksBackupTargetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClusterClusterIDTasksBackupTargetOK creates a GetClusterClusterIDTasksBackupTargetOK with default headers values +func NewGetClusterClusterIDTasksBackupTargetOK() *GetClusterClusterIDTasksBackupTargetOK { + return &GetClusterClusterIDTasksBackupTargetOK{} +} + +/* +GetClusterClusterIDTasksBackupTargetOK handles this case with default header values. + +Backup target +*/ +type GetClusterClusterIDTasksBackupTargetOK struct { + Payload *models.BackupTarget +} + +func (o *GetClusterClusterIDTasksBackupTargetOK) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/tasks/backup/target][%d] getClusterClusterIdTasksBackupTargetOK %+v", 200, o.Payload) +} + +func (o *GetClusterClusterIDTasksBackupTargetOK) GetPayload() *models.BackupTarget { + return o.Payload +} + +func (o *GetClusterClusterIDTasksBackupTargetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.BackupTarget) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterClusterIDTasksBackupTargetDefault creates a GetClusterClusterIDTasksBackupTargetDefault with default headers values +func NewGetClusterClusterIDTasksBackupTargetDefault(code int) *GetClusterClusterIDTasksBackupTargetDefault { + return &GetClusterClusterIDTasksBackupTargetDefault{ + _statusCode: code, + } +} + +/* +GetClusterClusterIDTasksBackupTargetDefault handles this case with default header values. + +Error +*/ +type GetClusterClusterIDTasksBackupTargetDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get cluster cluster ID tasks backup target default response +func (o *GetClusterClusterIDTasksBackupTargetDefault) Code() int { + return o._statusCode +} + +func (o *GetClusterClusterIDTasksBackupTargetDefault) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/tasks/backup/target][%d] GetClusterClusterIDTasksBackupTarget default %+v", o._statusCode, o.Payload) +} + +func (o *GetClusterClusterIDTasksBackupTargetDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClusterClusterIDTasksBackupTargetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_parameters.go new file mode 100644 index 0000000000..b10e8a2959 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_parameters.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetClusterClusterIDTasksParams creates a new GetClusterClusterIDTasksParams object +// with the default values initialized. +func NewGetClusterClusterIDTasksParams() *GetClusterClusterIDTasksParams { + var () + return &GetClusterClusterIDTasksParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterClusterIDTasksParamsWithTimeout creates a new GetClusterClusterIDTasksParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterClusterIDTasksParamsWithTimeout(timeout time.Duration) *GetClusterClusterIDTasksParams { + var () + return &GetClusterClusterIDTasksParams{ + + timeout: timeout, + } +} + +// NewGetClusterClusterIDTasksParamsWithContext creates a new GetClusterClusterIDTasksParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterClusterIDTasksParamsWithContext(ctx context.Context) *GetClusterClusterIDTasksParams { + var () + return &GetClusterClusterIDTasksParams{ + + Context: ctx, + } +} + +// NewGetClusterClusterIDTasksParamsWithHTTPClient creates a new GetClusterClusterIDTasksParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterClusterIDTasksParamsWithHTTPClient(client *http.Client) *GetClusterClusterIDTasksParams { + var () + return &GetClusterClusterIDTasksParams{ + HTTPClient: client, + } +} + +/* +GetClusterClusterIDTasksParams contains all the parameters to send to the API endpoint +for the get cluster cluster ID tasks operation typically these are written to a http.Request +*/ +type GetClusterClusterIDTasksParams struct { + + /*All*/ + All *bool + /*ClusterID*/ + ClusterID string + /*Short*/ + Short *bool + /*Status*/ + Status *string + /*TaskID*/ + TaskID *string + /*Type*/ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDTasksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) WithContext(ctx context.Context) *GetClusterClusterIDTasksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) WithHTTPClient(client *http.Client) *GetClusterClusterIDTasksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAll adds the all to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) WithAll(all *bool) *GetClusterClusterIDTasksParams { + o.SetAll(all) + return o +} + +// SetAll adds the all to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) SetAll(all *bool) { + o.All = all +} + +// WithClusterID adds the clusterID to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) WithClusterID(clusterID string) *GetClusterClusterIDTasksParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithShort adds the short to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) WithShort(short *bool) *GetClusterClusterIDTasksParams { + o.SetShort(short) + return o +} + +// SetShort adds the short to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) SetShort(short *bool) { + o.Short = short +} + +// WithStatus adds the status to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) WithStatus(status *string) *GetClusterClusterIDTasksParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) SetStatus(status *string) { + o.Status = status +} + +// WithTaskID adds the taskID to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) WithTaskID(taskID *string) *GetClusterClusterIDTasksParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) SetTaskID(taskID *string) { + o.TaskID = taskID +} + +// WithType adds the typeVar to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) WithType(typeVar *string) *GetClusterClusterIDTasksParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the get cluster cluster ID tasks params +func (o *GetClusterClusterIDTasksParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterClusterIDTasksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.All != nil { + + // query param all + var qrAll bool + if o.All != nil { + qrAll = *o.All + } + qAll := swag.FormatBool(qrAll) + if qAll != "" { + if err := r.SetQueryParam("all", qAll); err != nil { + return err + } + } + + } + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + if o.Short != nil { + + // query param short + var qrShort bool + if o.Short != nil { + qrShort = *o.Short + } + qShort := swag.FormatBool(qrShort) + if qShort != "" { + if err := r.SetQueryParam("short", qShort); err != nil { + return err + } + } + + } + + if o.Status != nil { + + // query param status + var qrStatus string + if o.Status != nil { + qrStatus = *o.Status + } + qStatus := qrStatus + if qStatus != "" { + if err := r.SetQueryParam("status", qStatus); err != nil { + return err + } + } + + } + + if o.TaskID != nil { + + // query param task_id + var qrTaskID string + if o.TaskID != nil { + qrTaskID = *o.TaskID + } + qTaskID := qrTaskID + if qTaskID != "" { + if err := r.SetQueryParam("task_id", qTaskID); err != nil { + return err + } + } + + } + + if o.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_repair_target_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_repair_target_parameters.go new file mode 100644 index 0000000000..aeb8df26e3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_repair_target_parameters.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// NewGetClusterClusterIDTasksRepairTargetParams creates a new GetClusterClusterIDTasksRepairTargetParams object +// with the default values initialized. +func NewGetClusterClusterIDTasksRepairTargetParams() *GetClusterClusterIDTasksRepairTargetParams { + var () + return &GetClusterClusterIDTasksRepairTargetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterClusterIDTasksRepairTargetParamsWithTimeout creates a new GetClusterClusterIDTasksRepairTargetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterClusterIDTasksRepairTargetParamsWithTimeout(timeout time.Duration) *GetClusterClusterIDTasksRepairTargetParams { + var () + return &GetClusterClusterIDTasksRepairTargetParams{ + + timeout: timeout, + } +} + +// NewGetClusterClusterIDTasksRepairTargetParamsWithContext creates a new GetClusterClusterIDTasksRepairTargetParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterClusterIDTasksRepairTargetParamsWithContext(ctx context.Context) *GetClusterClusterIDTasksRepairTargetParams { + var () + return &GetClusterClusterIDTasksRepairTargetParams{ + + Context: ctx, + } +} + +// NewGetClusterClusterIDTasksRepairTargetParamsWithHTTPClient creates a new GetClusterClusterIDTasksRepairTargetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterClusterIDTasksRepairTargetParamsWithHTTPClient(client *http.Client) *GetClusterClusterIDTasksRepairTargetParams { + var () + return &GetClusterClusterIDTasksRepairTargetParams{ + HTTPClient: client, + } +} + +/* +GetClusterClusterIDTasksRepairTargetParams contains all the parameters to send to the API endpoint +for the get cluster cluster ID tasks repair target operation typically these are written to a http.Request +*/ +type GetClusterClusterIDTasksRepairTargetParams struct { + + /*ClusterID*/ + ClusterID string + /*TaskFields*/ + TaskFields *models.TaskUpdate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cluster cluster ID tasks repair target params +func (o *GetClusterClusterIDTasksRepairTargetParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDTasksRepairTargetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster cluster ID tasks repair target params +func (o *GetClusterClusterIDTasksRepairTargetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster cluster ID tasks repair target params +func (o *GetClusterClusterIDTasksRepairTargetParams) WithContext(ctx context.Context) *GetClusterClusterIDTasksRepairTargetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster cluster ID tasks repair target params +func (o *GetClusterClusterIDTasksRepairTargetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster cluster ID tasks repair target params +func (o *GetClusterClusterIDTasksRepairTargetParams) WithHTTPClient(client *http.Client) *GetClusterClusterIDTasksRepairTargetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster cluster ID tasks repair target params +func (o *GetClusterClusterIDTasksRepairTargetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get cluster cluster ID tasks repair target params +func (o *GetClusterClusterIDTasksRepairTargetParams) WithClusterID(clusterID string) *GetClusterClusterIDTasksRepairTargetParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get cluster cluster ID tasks repair target params +func (o *GetClusterClusterIDTasksRepairTargetParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithTaskFields adds the taskFields to the get cluster cluster ID tasks repair target params +func (o *GetClusterClusterIDTasksRepairTargetParams) WithTaskFields(taskFields *models.TaskUpdate) *GetClusterClusterIDTasksRepairTargetParams { + o.SetTaskFields(taskFields) + return o +} + +// SetTaskFields adds the taskFields to the get cluster cluster ID tasks repair target params +func (o *GetClusterClusterIDTasksRepairTargetParams) SetTaskFields(taskFields *models.TaskUpdate) { + o.TaskFields = taskFields +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterClusterIDTasksRepairTargetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + if o.TaskFields != nil { + if err := r.SetBodyParam(o.TaskFields); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_repair_target_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_repair_target_responses.go new file mode 100644 index 0000000000..a5ba329792 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_repair_target_responses.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClusterClusterIDTasksRepairTargetReader is a Reader for the GetClusterClusterIDTasksRepairTarget structure. +type GetClusterClusterIDTasksRepairTargetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterClusterIDTasksRepairTargetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterClusterIDTasksRepairTargetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClusterClusterIDTasksRepairTargetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClusterClusterIDTasksRepairTargetOK creates a GetClusterClusterIDTasksRepairTargetOK with default headers values +func NewGetClusterClusterIDTasksRepairTargetOK() *GetClusterClusterIDTasksRepairTargetOK { + return &GetClusterClusterIDTasksRepairTargetOK{} +} + +/* +GetClusterClusterIDTasksRepairTargetOK handles this case with default header values. + +Repair target +*/ +type GetClusterClusterIDTasksRepairTargetOK struct { + Payload *models.RepairTarget +} + +func (o *GetClusterClusterIDTasksRepairTargetOK) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/tasks/repair/target][%d] getClusterClusterIdTasksRepairTargetOK %+v", 200, o.Payload) +} + +func (o *GetClusterClusterIDTasksRepairTargetOK) GetPayload() *models.RepairTarget { + return o.Payload +} + +func (o *GetClusterClusterIDTasksRepairTargetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RepairTarget) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterClusterIDTasksRepairTargetDefault creates a GetClusterClusterIDTasksRepairTargetDefault with default headers values +func NewGetClusterClusterIDTasksRepairTargetDefault(code int) *GetClusterClusterIDTasksRepairTargetDefault { + return &GetClusterClusterIDTasksRepairTargetDefault{ + _statusCode: code, + } +} + +/* +GetClusterClusterIDTasksRepairTargetDefault handles this case with default header values. + +Error +*/ +type GetClusterClusterIDTasksRepairTargetDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get cluster cluster ID tasks repair target default response +func (o *GetClusterClusterIDTasksRepairTargetDefault) Code() int { + return o._statusCode +} + +func (o *GetClusterClusterIDTasksRepairTargetDefault) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/tasks/repair/target][%d] GetClusterClusterIDTasksRepairTarget default %+v", o._statusCode, o.Payload) +} + +func (o *GetClusterClusterIDTasksRepairTargetDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClusterClusterIDTasksRepairTargetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_responses.go new file mode 100644 index 0000000000..f13d676841 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_responses.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClusterClusterIDTasksReader is a Reader for the GetClusterClusterIDTasks structure. +type GetClusterClusterIDTasksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterClusterIDTasksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterClusterIDTasksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClusterClusterIDTasksDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClusterClusterIDTasksOK creates a GetClusterClusterIDTasksOK with default headers values +func NewGetClusterClusterIDTasksOK() *GetClusterClusterIDTasksOK { + return &GetClusterClusterIDTasksOK{} +} + +/* +GetClusterClusterIDTasksOK handles this case with default header values. + +List of tasks +*/ +type GetClusterClusterIDTasksOK struct { + Payload []*models.TaskListItem +} + +func (o *GetClusterClusterIDTasksOK) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/tasks][%d] getClusterClusterIdTasksOK %+v", 200, o.Payload) +} + +func (o *GetClusterClusterIDTasksOK) GetPayload() []*models.TaskListItem { + return o.Payload +} + +func (o *GetClusterClusterIDTasksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterClusterIDTasksDefault creates a GetClusterClusterIDTasksDefault with default headers values +func NewGetClusterClusterIDTasksDefault(code int) *GetClusterClusterIDTasksDefault { + return &GetClusterClusterIDTasksDefault{ + _statusCode: code, + } +} + +/* +GetClusterClusterIDTasksDefault handles this case with default header values. + +Error +*/ +type GetClusterClusterIDTasksDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get cluster cluster ID tasks default response +func (o *GetClusterClusterIDTasksDefault) Code() int { + return o._statusCode +} + +func (o *GetClusterClusterIDTasksDefault) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/tasks][%d] GetClusterClusterIDTasks default %+v", o._statusCode, o.Payload) +} + +func (o *GetClusterClusterIDTasksDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClusterClusterIDTasksDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_restore_target_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_restore_target_parameters.go new file mode 100644 index 0000000000..228204b7a0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_restore_target_parameters.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// NewGetClusterClusterIDTasksRestoreTargetParams creates a new GetClusterClusterIDTasksRestoreTargetParams object +// with the default values initialized. +func NewGetClusterClusterIDTasksRestoreTargetParams() *GetClusterClusterIDTasksRestoreTargetParams { + var () + return &GetClusterClusterIDTasksRestoreTargetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClusterClusterIDTasksRestoreTargetParamsWithTimeout creates a new GetClusterClusterIDTasksRestoreTargetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClusterClusterIDTasksRestoreTargetParamsWithTimeout(timeout time.Duration) *GetClusterClusterIDTasksRestoreTargetParams { + var () + return &GetClusterClusterIDTasksRestoreTargetParams{ + + timeout: timeout, + } +} + +// NewGetClusterClusterIDTasksRestoreTargetParamsWithContext creates a new GetClusterClusterIDTasksRestoreTargetParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClusterClusterIDTasksRestoreTargetParamsWithContext(ctx context.Context) *GetClusterClusterIDTasksRestoreTargetParams { + var () + return &GetClusterClusterIDTasksRestoreTargetParams{ + + Context: ctx, + } +} + +// NewGetClusterClusterIDTasksRestoreTargetParamsWithHTTPClient creates a new GetClusterClusterIDTasksRestoreTargetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClusterClusterIDTasksRestoreTargetParamsWithHTTPClient(client *http.Client) *GetClusterClusterIDTasksRestoreTargetParams { + var () + return &GetClusterClusterIDTasksRestoreTargetParams{ + HTTPClient: client, + } +} + +/* +GetClusterClusterIDTasksRestoreTargetParams contains all the parameters to send to the API endpoint +for the get cluster cluster ID tasks restore target operation typically these are written to a http.Request +*/ +type GetClusterClusterIDTasksRestoreTargetParams struct { + + /*ClusterID*/ + ClusterID string + /*TaskFields*/ + TaskFields *models.TaskUpdate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get cluster cluster ID tasks restore target params +func (o *GetClusterClusterIDTasksRestoreTargetParams) WithTimeout(timeout time.Duration) *GetClusterClusterIDTasksRestoreTargetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get cluster cluster ID tasks restore target params +func (o *GetClusterClusterIDTasksRestoreTargetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get cluster cluster ID tasks restore target params +func (o *GetClusterClusterIDTasksRestoreTargetParams) WithContext(ctx context.Context) *GetClusterClusterIDTasksRestoreTargetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get cluster cluster ID tasks restore target params +func (o *GetClusterClusterIDTasksRestoreTargetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get cluster cluster ID tasks restore target params +func (o *GetClusterClusterIDTasksRestoreTargetParams) WithHTTPClient(client *http.Client) *GetClusterClusterIDTasksRestoreTargetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get cluster cluster ID tasks restore target params +func (o *GetClusterClusterIDTasksRestoreTargetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the get cluster cluster ID tasks restore target params +func (o *GetClusterClusterIDTasksRestoreTargetParams) WithClusterID(clusterID string) *GetClusterClusterIDTasksRestoreTargetParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the get cluster cluster ID tasks restore target params +func (o *GetClusterClusterIDTasksRestoreTargetParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithTaskFields adds the taskFields to the get cluster cluster ID tasks restore target params +func (o *GetClusterClusterIDTasksRestoreTargetParams) WithTaskFields(taskFields *models.TaskUpdate) *GetClusterClusterIDTasksRestoreTargetParams { + o.SetTaskFields(taskFields) + return o +} + +// SetTaskFields adds the taskFields to the get cluster cluster ID tasks restore target params +func (o *GetClusterClusterIDTasksRestoreTargetParams) SetTaskFields(taskFields *models.TaskUpdate) { + o.TaskFields = taskFields +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClusterClusterIDTasksRestoreTargetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + if o.TaskFields != nil { + if err := r.SetBodyParam(o.TaskFields); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_restore_target_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_restore_target_responses.go new file mode 100644 index 0000000000..0f664b9c7c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_cluster_cluster_id_tasks_restore_target_responses.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClusterClusterIDTasksRestoreTargetReader is a Reader for the GetClusterClusterIDTasksRestoreTarget structure. +type GetClusterClusterIDTasksRestoreTargetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClusterClusterIDTasksRestoreTargetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClusterClusterIDTasksRestoreTargetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClusterClusterIDTasksRestoreTargetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClusterClusterIDTasksRestoreTargetOK creates a GetClusterClusterIDTasksRestoreTargetOK with default headers values +func NewGetClusterClusterIDTasksRestoreTargetOK() *GetClusterClusterIDTasksRestoreTargetOK { + return &GetClusterClusterIDTasksRestoreTargetOK{} +} + +/* +GetClusterClusterIDTasksRestoreTargetOK handles this case with default header values. + +Restore target +*/ +type GetClusterClusterIDTasksRestoreTargetOK struct { + Payload *models.RestoreTarget +} + +func (o *GetClusterClusterIDTasksRestoreTargetOK) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/tasks/restore/target][%d] getClusterClusterIdTasksRestoreTargetOK %+v", 200, o.Payload) +} + +func (o *GetClusterClusterIDTasksRestoreTargetOK) GetPayload() *models.RestoreTarget { + return o.Payload +} + +func (o *GetClusterClusterIDTasksRestoreTargetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RestoreTarget) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClusterClusterIDTasksRestoreTargetDefault creates a GetClusterClusterIDTasksRestoreTargetDefault with default headers values +func NewGetClusterClusterIDTasksRestoreTargetDefault(code int) *GetClusterClusterIDTasksRestoreTargetDefault { + return &GetClusterClusterIDTasksRestoreTargetDefault{ + _statusCode: code, + } +} + +/* +GetClusterClusterIDTasksRestoreTargetDefault handles this case with default header values. + +Error +*/ +type GetClusterClusterIDTasksRestoreTargetDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get cluster cluster ID tasks restore target default response +func (o *GetClusterClusterIDTasksRestoreTargetDefault) Code() int { + return o._statusCode +} + +func (o *GetClusterClusterIDTasksRestoreTargetDefault) Error() string { + return fmt.Sprintf("[GET /cluster/{cluster_id}/tasks/restore/target][%d] GetClusterClusterIDTasksRestoreTarget default %+v", o._statusCode, o.Payload) +} + +func (o *GetClusterClusterIDTasksRestoreTargetDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClusterClusterIDTasksRestoreTargetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_clusters_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_clusters_parameters.go new file mode 100644 index 0000000000..552d93805d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_clusters_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetClustersParams creates a new GetClustersParams object +// with the default values initialized. +func NewGetClustersParams() *GetClustersParams { + + return &GetClustersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetClustersParamsWithTimeout creates a new GetClustersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetClustersParamsWithTimeout(timeout time.Duration) *GetClustersParams { + + return &GetClustersParams{ + + timeout: timeout, + } +} + +// NewGetClustersParamsWithContext creates a new GetClustersParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetClustersParamsWithContext(ctx context.Context) *GetClustersParams { + + return &GetClustersParams{ + + Context: ctx, + } +} + +// NewGetClustersParamsWithHTTPClient creates a new GetClustersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetClustersParamsWithHTTPClient(client *http.Client) *GetClustersParams { + + return &GetClustersParams{ + HTTPClient: client, + } +} + +/* +GetClustersParams contains all the parameters to send to the API endpoint +for the get clusters operation typically these are written to a http.Request +*/ +type GetClustersParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get clusters params +func (o *GetClustersParams) WithTimeout(timeout time.Duration) *GetClustersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get clusters params +func (o *GetClustersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get clusters params +func (o *GetClustersParams) WithContext(ctx context.Context) *GetClustersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get clusters params +func (o *GetClustersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get clusters params +func (o *GetClustersParams) WithHTTPClient(client *http.Client) *GetClustersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get clusters params +func (o *GetClustersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetClustersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_clusters_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_clusters_responses.go new file mode 100644 index 0000000000..733aa12ebe --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_clusters_responses.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetClustersReader is a Reader for the GetClusters structure. +type GetClustersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetClustersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetClustersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetClustersDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetClustersOK creates a GetClustersOK with default headers values +func NewGetClustersOK() *GetClustersOK { + return &GetClustersOK{} +} + +/* +GetClustersOK handles this case with default header values. + +List of all clusters +*/ +type GetClustersOK struct { + Payload []*models.Cluster +} + +func (o *GetClustersOK) Error() string { + return fmt.Sprintf("[GET /clusters][%d] getClustersOK %+v", 200, o.Payload) +} + +func (o *GetClustersOK) GetPayload() []*models.Cluster { + return o.Payload +} + +func (o *GetClustersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetClustersDefault creates a GetClustersDefault with default headers values +func NewGetClustersDefault(code int) *GetClustersDefault { + return &GetClustersDefault{ + _statusCode: code, + } +} + +/* +GetClustersDefault handles this case with default header values. + +Error +*/ +type GetClustersDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get clusters default response +func (o *GetClustersDefault) Code() int { + return o._statusCode +} + +func (o *GetClustersDefault) Error() string { + return fmt.Sprintf("[GET /clusters][%d] GetClusters default %+v", o._statusCode, o.Payload) +} + +func (o *GetClustersDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetClustersDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_version_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_version_parameters.go new file mode 100644 index 0000000000..4d95d2d52e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_version_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetVersionParams creates a new GetVersionParams object +// with the default values initialized. +func NewGetVersionParams() *GetVersionParams { + + return &GetVersionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetVersionParamsWithTimeout creates a new GetVersionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetVersionParamsWithTimeout(timeout time.Duration) *GetVersionParams { + + return &GetVersionParams{ + + timeout: timeout, + } +} + +// NewGetVersionParamsWithContext creates a new GetVersionParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetVersionParamsWithContext(ctx context.Context) *GetVersionParams { + + return &GetVersionParams{ + + Context: ctx, + } +} + +// NewGetVersionParamsWithHTTPClient creates a new GetVersionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetVersionParamsWithHTTPClient(client *http.Client) *GetVersionParams { + + return &GetVersionParams{ + HTTPClient: client, + } +} + +/* +GetVersionParams contains all the parameters to send to the API endpoint +for the get version operation typically these are written to a http.Request +*/ +type GetVersionParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get version params +func (o *GetVersionParams) WithTimeout(timeout time.Duration) *GetVersionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get version params +func (o *GetVersionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get version params +func (o *GetVersionParams) WithContext(ctx context.Context) *GetVersionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get version params +func (o *GetVersionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get version params +func (o *GetVersionParams) WithHTTPClient(client *http.Client) *GetVersionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get version params +func (o *GetVersionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_version_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_version_responses.go new file mode 100644 index 0000000000..a62b7267f1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/get_version_responses.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// GetVersionReader is a Reader for the GetVersion structure. +type GetVersionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetVersionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetVersionDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetVersionOK creates a GetVersionOK with default headers values +func NewGetVersionOK() *GetVersionOK { + return &GetVersionOK{} +} + +/* +GetVersionOK handles this case with default header values. + +Server version +*/ +type GetVersionOK struct { + Payload *models.Version +} + +func (o *GetVersionOK) Error() string { + return fmt.Sprintf("[GET /version][%d] getVersionOK %+v", 200, o.Payload) +} + +func (o *GetVersionOK) GetPayload() *models.Version { + return o.Payload +} + +func (o *GetVersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Version) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetVersionDefault creates a GetVersionDefault with default headers values +func NewGetVersionDefault(code int) *GetVersionDefault { + return &GetVersionDefault{ + _statusCode: code, + } +} + +/* +GetVersionDefault handles this case with default header values. + +Error +*/ +type GetVersionDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the get version default response +func (o *GetVersionDefault) Code() int { + return o._statusCode +} + +func (o *GetVersionDefault) Error() string { + return fmt.Sprintf("[GET /version][%d] GetVersion default %+v", o._statusCode, o.Payload) +} + +func (o *GetVersionDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *GetVersionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/operations_client.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/operations_client.go new file mode 100644 index 0000000000..3b1f7da660 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/operations_client.go @@ -0,0 +1,1049 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new operations API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for operations API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + DeleteClusterClusterID(params *DeleteClusterClusterIDParams) (*DeleteClusterClusterIDOK, error) + + DeleteClusterClusterIDBackups(params *DeleteClusterClusterIDBackupsParams) (*DeleteClusterClusterIDBackupsOK, error) + + DeleteClusterClusterIDTaskTaskTypeTaskID(params *DeleteClusterClusterIDTaskTaskTypeTaskIDParams) (*DeleteClusterClusterIDTaskTaskTypeTaskIDOK, error) + + GetClusterClusterID(params *GetClusterClusterIDParams) (*GetClusterClusterIDOK, error) + + GetClusterClusterIDBackups(params *GetClusterClusterIDBackupsParams) (*GetClusterClusterIDBackupsOK, error) + + GetClusterClusterIDBackupsFiles(params *GetClusterClusterIDBackupsFilesParams) (*GetClusterClusterIDBackupsFilesOK, error) + + GetClusterClusterIDStatus(params *GetClusterClusterIDStatusParams) (*GetClusterClusterIDStatusOK, error) + + GetClusterClusterIDSuspended(params *GetClusterClusterIDSuspendedParams) (*GetClusterClusterIDSuspendedOK, error) + + GetClusterClusterIDTaskBackupTaskIDRunID(params *GetClusterClusterIDTaskBackupTaskIDRunIDParams) (*GetClusterClusterIDTaskBackupTaskIDRunIDOK, error) + + GetClusterClusterIDTaskRepairTaskIDRunID(params *GetClusterClusterIDTaskRepairTaskIDRunIDParams) (*GetClusterClusterIDTaskRepairTaskIDRunIDOK, error) + + GetClusterClusterIDTaskRestoreTaskIDRunID(params *GetClusterClusterIDTaskRestoreTaskIDRunIDParams) (*GetClusterClusterIDTaskRestoreTaskIDRunIDOK, error) + + GetClusterClusterIDTaskTaskTypeTaskID(params *GetClusterClusterIDTaskTaskTypeTaskIDParams) (*GetClusterClusterIDTaskTaskTypeTaskIDOK, error) + + GetClusterClusterIDTaskTaskTypeTaskIDHistory(params *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) (*GetClusterClusterIDTaskTaskTypeTaskIDHistoryOK, error) + + GetClusterClusterIDTaskValidateBackupTaskIDRunID(params *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams) (*GetClusterClusterIDTaskValidateBackupTaskIDRunIDOK, error) + + GetClusterClusterIDTasks(params *GetClusterClusterIDTasksParams) (*GetClusterClusterIDTasksOK, error) + + GetClusterClusterIDTasksBackupTarget(params *GetClusterClusterIDTasksBackupTargetParams) (*GetClusterClusterIDTasksBackupTargetOK, error) + + GetClusterClusterIDTasksRepairTarget(params *GetClusterClusterIDTasksRepairTargetParams) (*GetClusterClusterIDTasksRepairTargetOK, error) + + GetClusterClusterIDTasksRestoreTarget(params *GetClusterClusterIDTasksRestoreTargetParams) (*GetClusterClusterIDTasksRestoreTargetOK, error) + + GetClusters(params *GetClustersParams) (*GetClustersOK, error) + + GetVersion(params *GetVersionParams) (*GetVersionOK, error) + + PostClusterClusterIDTasks(params *PostClusterClusterIDTasksParams) (*PostClusterClusterIDTasksCreated, error) + + PostClusters(params *PostClustersParams) (*PostClustersCreated, error) + + PutClusterClusterID(params *PutClusterClusterIDParams) (*PutClusterClusterIDOK, error) + + PutClusterClusterIDRepairsIntensity(params *PutClusterClusterIDRepairsIntensityParams) (*PutClusterClusterIDRepairsIntensityOK, error) + + PutClusterClusterIDRepairsParallel(params *PutClusterClusterIDRepairsParallelParams) (*PutClusterClusterIDRepairsParallelOK, error) + + PutClusterClusterIDSuspended(params *PutClusterClusterIDSuspendedParams) (*PutClusterClusterIDSuspendedOK, error) + + PutClusterClusterIDTaskTaskTypeTaskID(params *PutClusterClusterIDTaskTaskTypeTaskIDParams) (*PutClusterClusterIDTaskTaskTypeTaskIDOK, error) + + PutClusterClusterIDTaskTaskTypeTaskIDStart(params *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) (*PutClusterClusterIDTaskTaskTypeTaskIDStartOK, error) + + PutClusterClusterIDTaskTaskTypeTaskIDStop(params *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) (*PutClusterClusterIDTaskTaskTypeTaskIDStopOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +DeleteClusterClusterID delete cluster cluster ID API +*/ +func (a *Client) DeleteClusterClusterID(params *DeleteClusterClusterIDParams) (*DeleteClusterClusterIDOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteClusterClusterIDParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteClusterClusterID", + Method: "DELETE", + PathPattern: "/cluster/{cluster_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteClusterClusterIDReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteClusterClusterIDOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DeleteClusterClusterIDDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +DeleteClusterClusterIDBackups delete cluster cluster ID backups API +*/ +func (a *Client) DeleteClusterClusterIDBackups(params *DeleteClusterClusterIDBackupsParams) (*DeleteClusterClusterIDBackupsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteClusterClusterIDBackupsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteClusterClusterIDBackups", + Method: "DELETE", + PathPattern: "/cluster/{cluster_id}/backups", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteClusterClusterIDBackupsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteClusterClusterIDBackupsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DeleteClusterClusterIDBackupsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +DeleteClusterClusterIDTaskTaskTypeTaskID delete cluster cluster ID task task type task ID API +*/ +func (a *Client) DeleteClusterClusterIDTaskTaskTypeTaskID(params *DeleteClusterClusterIDTaskTaskTypeTaskIDParams) (*DeleteClusterClusterIDTaskTaskTypeTaskIDOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteClusterClusterIDTaskTaskTypeTaskIDParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "DeleteClusterClusterIDTaskTaskTypeTaskID", + Method: "DELETE", + PathPattern: "/cluster/{cluster_id}/task/{task_type}/{task_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteClusterClusterIDTaskTaskTypeTaskIDReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteClusterClusterIDTaskTaskTypeTaskIDOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DeleteClusterClusterIDTaskTaskTypeTaskIDDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusterClusterID get cluster cluster ID API +*/ +func (a *Client) GetClusterClusterID(params *GetClusterClusterIDParams) (*GetClusterClusterIDOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterClusterIDParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusterClusterID", + Method: "GET", + PathPattern: "/cluster/{cluster_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterClusterIDReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterClusterIDOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClusterClusterIDDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusterClusterIDBackups get cluster cluster ID backups API +*/ +func (a *Client) GetClusterClusterIDBackups(params *GetClusterClusterIDBackupsParams) (*GetClusterClusterIDBackupsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterClusterIDBackupsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusterClusterIDBackups", + Method: "GET", + PathPattern: "/cluster/{cluster_id}/backups", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterClusterIDBackupsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterClusterIDBackupsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClusterClusterIDBackupsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusterClusterIDBackupsFiles get cluster cluster ID backups files API +*/ +func (a *Client) GetClusterClusterIDBackupsFiles(params *GetClusterClusterIDBackupsFilesParams) (*GetClusterClusterIDBackupsFilesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterClusterIDBackupsFilesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusterClusterIDBackupsFiles", + Method: "GET", + PathPattern: "/cluster/{cluster_id}/backups/files", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterClusterIDBackupsFilesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterClusterIDBackupsFilesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClusterClusterIDBackupsFilesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusterClusterIDStatus get cluster cluster ID status API +*/ +func (a *Client) GetClusterClusterIDStatus(params *GetClusterClusterIDStatusParams) (*GetClusterClusterIDStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterClusterIDStatusParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusterClusterIDStatus", + Method: "GET", + PathPattern: "/cluster/{cluster_id}/status", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterClusterIDStatusReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterClusterIDStatusOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClusterClusterIDStatusDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusterClusterIDSuspended get cluster cluster ID suspended API +*/ +func (a *Client) GetClusterClusterIDSuspended(params *GetClusterClusterIDSuspendedParams) (*GetClusterClusterIDSuspendedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterClusterIDSuspendedParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusterClusterIDSuspended", + Method: "GET", + PathPattern: "/cluster/{cluster_id}/suspended", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterClusterIDSuspendedReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterClusterIDSuspendedOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClusterClusterIDSuspendedDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusterClusterIDTaskBackupTaskIDRunID get cluster cluster ID task backup task ID run ID API +*/ +func (a *Client) GetClusterClusterIDTaskBackupTaskIDRunID(params *GetClusterClusterIDTaskBackupTaskIDRunIDParams) (*GetClusterClusterIDTaskBackupTaskIDRunIDOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterClusterIDTaskBackupTaskIDRunIDParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusterClusterIDTaskBackupTaskIDRunID", + Method: "GET", + PathPattern: "/cluster/{cluster_id}/task/backup/{task_id}/{run_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterClusterIDTaskBackupTaskIDRunIDReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterClusterIDTaskBackupTaskIDRunIDOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClusterClusterIDTaskBackupTaskIDRunIDDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusterClusterIDTaskRepairTaskIDRunID get cluster cluster ID task repair task ID run ID API +*/ +func (a *Client) GetClusterClusterIDTaskRepairTaskIDRunID(params *GetClusterClusterIDTaskRepairTaskIDRunIDParams) (*GetClusterClusterIDTaskRepairTaskIDRunIDOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterClusterIDTaskRepairTaskIDRunIDParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusterClusterIDTaskRepairTaskIDRunID", + Method: "GET", + PathPattern: "/cluster/{cluster_id}/task/repair/{task_id}/{run_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterClusterIDTaskRepairTaskIDRunIDReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterClusterIDTaskRepairTaskIDRunIDOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClusterClusterIDTaskRepairTaskIDRunIDDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusterClusterIDTaskRestoreTaskIDRunID get cluster cluster ID task restore task ID run ID API +*/ +func (a *Client) GetClusterClusterIDTaskRestoreTaskIDRunID(params *GetClusterClusterIDTaskRestoreTaskIDRunIDParams) (*GetClusterClusterIDTaskRestoreTaskIDRunIDOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterClusterIDTaskRestoreTaskIDRunIDParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusterClusterIDTaskRestoreTaskIDRunID", + Method: "GET", + PathPattern: "/cluster/{cluster_id}/task/restore/{task_id}/{run_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterClusterIDTaskRestoreTaskIDRunIDReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterClusterIDTaskRestoreTaskIDRunIDOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClusterClusterIDTaskRestoreTaskIDRunIDDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusterClusterIDTaskTaskTypeTaskID get cluster cluster ID task task type task ID API +*/ +func (a *Client) GetClusterClusterIDTaskTaskTypeTaskID(params *GetClusterClusterIDTaskTaskTypeTaskIDParams) (*GetClusterClusterIDTaskTaskTypeTaskIDOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterClusterIDTaskTaskTypeTaskIDParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusterClusterIDTaskTaskTypeTaskID", + Method: "GET", + PathPattern: "/cluster/{cluster_id}/task/{task_type}/{task_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterClusterIDTaskTaskTypeTaskIDReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterClusterIDTaskTaskTypeTaskIDOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClusterClusterIDTaskTaskTypeTaskIDDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusterClusterIDTaskTaskTypeTaskIDHistory get cluster cluster ID task task type task ID history API +*/ +func (a *Client) GetClusterClusterIDTaskTaskTypeTaskIDHistory(params *GetClusterClusterIDTaskTaskTypeTaskIDHistoryParams) (*GetClusterClusterIDTaskTaskTypeTaskIDHistoryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterClusterIDTaskTaskTypeTaskIDHistoryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusterClusterIDTaskTaskTypeTaskIDHistory", + Method: "GET", + PathPattern: "/cluster/{cluster_id}/task/{task_type}/{task_id}/history", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterClusterIDTaskTaskTypeTaskIDHistoryReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterClusterIDTaskTaskTypeTaskIDHistoryOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClusterClusterIDTaskTaskTypeTaskIDHistoryDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusterClusterIDTaskValidateBackupTaskIDRunID get cluster cluster ID task validate backup task ID run ID API +*/ +func (a *Client) GetClusterClusterIDTaskValidateBackupTaskIDRunID(params *GetClusterClusterIDTaskValidateBackupTaskIDRunIDParams) (*GetClusterClusterIDTaskValidateBackupTaskIDRunIDOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterClusterIDTaskValidateBackupTaskIDRunIDParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusterClusterIDTaskValidateBackupTaskIDRunID", + Method: "GET", + PathPattern: "/cluster/{cluster_id}/task/validate_backup/{task_id}/{run_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterClusterIDTaskValidateBackupTaskIDRunIDReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterClusterIDTaskValidateBackupTaskIDRunIDOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClusterClusterIDTaskValidateBackupTaskIDRunIDDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusterClusterIDTasks get cluster cluster ID tasks API +*/ +func (a *Client) GetClusterClusterIDTasks(params *GetClusterClusterIDTasksParams) (*GetClusterClusterIDTasksOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterClusterIDTasksParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusterClusterIDTasks", + Method: "GET", + PathPattern: "/cluster/{cluster_id}/tasks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterClusterIDTasksReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterClusterIDTasksOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClusterClusterIDTasksDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusterClusterIDTasksBackupTarget get cluster cluster ID tasks backup target API +*/ +func (a *Client) GetClusterClusterIDTasksBackupTarget(params *GetClusterClusterIDTasksBackupTargetParams) (*GetClusterClusterIDTasksBackupTargetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterClusterIDTasksBackupTargetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusterClusterIDTasksBackupTarget", + Method: "GET", + PathPattern: "/cluster/{cluster_id}/tasks/backup/target", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterClusterIDTasksBackupTargetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterClusterIDTasksBackupTargetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClusterClusterIDTasksBackupTargetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusterClusterIDTasksRepairTarget get cluster cluster ID tasks repair target API +*/ +func (a *Client) GetClusterClusterIDTasksRepairTarget(params *GetClusterClusterIDTasksRepairTargetParams) (*GetClusterClusterIDTasksRepairTargetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterClusterIDTasksRepairTargetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusterClusterIDTasksRepairTarget", + Method: "GET", + PathPattern: "/cluster/{cluster_id}/tasks/repair/target", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterClusterIDTasksRepairTargetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterClusterIDTasksRepairTargetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClusterClusterIDTasksRepairTargetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusterClusterIDTasksRestoreTarget get cluster cluster ID tasks restore target API +*/ +func (a *Client) GetClusterClusterIDTasksRestoreTarget(params *GetClusterClusterIDTasksRestoreTargetParams) (*GetClusterClusterIDTasksRestoreTargetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClusterClusterIDTasksRestoreTargetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusterClusterIDTasksRestoreTarget", + Method: "GET", + PathPattern: "/cluster/{cluster_id}/tasks/restore/target", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClusterClusterIDTasksRestoreTargetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClusterClusterIDTasksRestoreTargetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClusterClusterIDTasksRestoreTargetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetClusters get clusters API +*/ +func (a *Client) GetClusters(params *GetClustersParams) (*GetClustersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetClustersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetClusters", + Method: "GET", + PathPattern: "/clusters", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetClustersReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetClustersOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetClustersDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetVersion get version API +*/ +func (a *Client) GetVersion(params *GetVersionParams) (*GetVersionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetVersionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetVersion", + Method: "GET", + PathPattern: "/version", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetVersionReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetVersionOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetVersionDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +PostClusterClusterIDTasks post cluster cluster ID tasks API +*/ +func (a *Client) PostClusterClusterIDTasks(params *PostClusterClusterIDTasksParams) (*PostClusterClusterIDTasksCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostClusterClusterIDTasksParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PostClusterClusterIDTasks", + Method: "POST", + PathPattern: "/cluster/{cluster_id}/tasks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostClusterClusterIDTasksReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostClusterClusterIDTasksCreated) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PostClusterClusterIDTasksDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +PostClusters post clusters API +*/ +func (a *Client) PostClusters(params *PostClustersParams) (*PostClustersCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostClustersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PostClusters", + Method: "POST", + PathPattern: "/clusters", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostClustersReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PostClustersCreated) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PostClustersDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +PutClusterClusterID put cluster cluster ID API +*/ +func (a *Client) PutClusterClusterID(params *PutClusterClusterIDParams) (*PutClusterClusterIDOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutClusterClusterIDParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PutClusterClusterID", + Method: "PUT", + PathPattern: "/cluster/{cluster_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutClusterClusterIDReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutClusterClusterIDOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PutClusterClusterIDDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +PutClusterClusterIDRepairsIntensity put cluster cluster ID repairs intensity API +*/ +func (a *Client) PutClusterClusterIDRepairsIntensity(params *PutClusterClusterIDRepairsIntensityParams) (*PutClusterClusterIDRepairsIntensityOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutClusterClusterIDRepairsIntensityParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PutClusterClusterIDRepairsIntensity", + Method: "PUT", + PathPattern: "/cluster/{cluster_id}/repairs/intensity", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutClusterClusterIDRepairsIntensityReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutClusterClusterIDRepairsIntensityOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PutClusterClusterIDRepairsIntensityDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +PutClusterClusterIDRepairsParallel put cluster cluster ID repairs parallel API +*/ +func (a *Client) PutClusterClusterIDRepairsParallel(params *PutClusterClusterIDRepairsParallelParams) (*PutClusterClusterIDRepairsParallelOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutClusterClusterIDRepairsParallelParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PutClusterClusterIDRepairsParallel", + Method: "PUT", + PathPattern: "/cluster/{cluster_id}/repairs/parallel", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutClusterClusterIDRepairsParallelReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutClusterClusterIDRepairsParallelOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PutClusterClusterIDRepairsParallelDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +PutClusterClusterIDSuspended put cluster cluster ID suspended API +*/ +func (a *Client) PutClusterClusterIDSuspended(params *PutClusterClusterIDSuspendedParams) (*PutClusterClusterIDSuspendedOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutClusterClusterIDSuspendedParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PutClusterClusterIDSuspended", + Method: "PUT", + PathPattern: "/cluster/{cluster_id}/suspended", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutClusterClusterIDSuspendedReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutClusterClusterIDSuspendedOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PutClusterClusterIDSuspendedDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +PutClusterClusterIDTaskTaskTypeTaskID put cluster cluster ID task task type task ID API +*/ +func (a *Client) PutClusterClusterIDTaskTaskTypeTaskID(params *PutClusterClusterIDTaskTaskTypeTaskIDParams) (*PutClusterClusterIDTaskTaskTypeTaskIDOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutClusterClusterIDTaskTaskTypeTaskIDParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PutClusterClusterIDTaskTaskTypeTaskID", + Method: "PUT", + PathPattern: "/cluster/{cluster_id}/task/{task_type}/{task_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutClusterClusterIDTaskTaskTypeTaskIDReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutClusterClusterIDTaskTaskTypeTaskIDOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PutClusterClusterIDTaskTaskTypeTaskIDDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +PutClusterClusterIDTaskTaskTypeTaskIDStart put cluster cluster ID task task type task ID start API +*/ +func (a *Client) PutClusterClusterIDTaskTaskTypeTaskIDStart(params *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) (*PutClusterClusterIDTaskTaskTypeTaskIDStartOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutClusterClusterIDTaskTaskTypeTaskIDStartParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PutClusterClusterIDTaskTaskTypeTaskIDStart", + Method: "PUT", + PathPattern: "/cluster/{cluster_id}/task/{task_type}/{task_id}/start", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutClusterClusterIDTaskTaskTypeTaskIDStartReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutClusterClusterIDTaskTaskTypeTaskIDStartOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PutClusterClusterIDTaskTaskTypeTaskIDStartDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +PutClusterClusterIDTaskTaskTypeTaskIDStop put cluster cluster ID task task type task ID stop API +*/ +func (a *Client) PutClusterClusterIDTaskTaskTypeTaskIDStop(params *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) (*PutClusterClusterIDTaskTaskTypeTaskIDStopOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPutClusterClusterIDTaskTaskTypeTaskIDStopParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PutClusterClusterIDTaskTaskTypeTaskIDStop", + Method: "PUT", + PathPattern: "/cluster/{cluster_id}/task/{task_type}/{task_id}/stop", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PutClusterClusterIDTaskTaskTypeTaskIDStopReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*PutClusterClusterIDTaskTaskTypeTaskIDStopOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*PutClusterClusterIDTaskTaskTypeTaskIDStopDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/post_cluster_cluster_id_tasks_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/post_cluster_cluster_id_tasks_parameters.go new file mode 100644 index 0000000000..43b3d6ecda --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/post_cluster_cluster_id_tasks_parameters.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// NewPostClusterClusterIDTasksParams creates a new PostClusterClusterIDTasksParams object +// with the default values initialized. +func NewPostClusterClusterIDTasksParams() *PostClusterClusterIDTasksParams { + var () + return &PostClusterClusterIDTasksParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostClusterClusterIDTasksParamsWithTimeout creates a new PostClusterClusterIDTasksParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostClusterClusterIDTasksParamsWithTimeout(timeout time.Duration) *PostClusterClusterIDTasksParams { + var () + return &PostClusterClusterIDTasksParams{ + + timeout: timeout, + } +} + +// NewPostClusterClusterIDTasksParamsWithContext creates a new PostClusterClusterIDTasksParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostClusterClusterIDTasksParamsWithContext(ctx context.Context) *PostClusterClusterIDTasksParams { + var () + return &PostClusterClusterIDTasksParams{ + + Context: ctx, + } +} + +// NewPostClusterClusterIDTasksParamsWithHTTPClient creates a new PostClusterClusterIDTasksParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostClusterClusterIDTasksParamsWithHTTPClient(client *http.Client) *PostClusterClusterIDTasksParams { + var () + return &PostClusterClusterIDTasksParams{ + HTTPClient: client, + } +} + +/* +PostClusterClusterIDTasksParams contains all the parameters to send to the API endpoint +for the post cluster cluster ID tasks operation typically these are written to a http.Request +*/ +type PostClusterClusterIDTasksParams struct { + + /*ClusterID*/ + ClusterID string + /*TaskFields*/ + TaskFields *models.TaskUpdate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post cluster cluster ID tasks params +func (o *PostClusterClusterIDTasksParams) WithTimeout(timeout time.Duration) *PostClusterClusterIDTasksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post cluster cluster ID tasks params +func (o *PostClusterClusterIDTasksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post cluster cluster ID tasks params +func (o *PostClusterClusterIDTasksParams) WithContext(ctx context.Context) *PostClusterClusterIDTasksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post cluster cluster ID tasks params +func (o *PostClusterClusterIDTasksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post cluster cluster ID tasks params +func (o *PostClusterClusterIDTasksParams) WithHTTPClient(client *http.Client) *PostClusterClusterIDTasksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post cluster cluster ID tasks params +func (o *PostClusterClusterIDTasksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the post cluster cluster ID tasks params +func (o *PostClusterClusterIDTasksParams) WithClusterID(clusterID string) *PostClusterClusterIDTasksParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the post cluster cluster ID tasks params +func (o *PostClusterClusterIDTasksParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithTaskFields adds the taskFields to the post cluster cluster ID tasks params +func (o *PostClusterClusterIDTasksParams) WithTaskFields(taskFields *models.TaskUpdate) *PostClusterClusterIDTasksParams { + o.SetTaskFields(taskFields) + return o +} + +// SetTaskFields adds the taskFields to the post cluster cluster ID tasks params +func (o *PostClusterClusterIDTasksParams) SetTaskFields(taskFields *models.TaskUpdate) { + o.TaskFields = taskFields +} + +// WriteToRequest writes these params to a swagger request +func (o *PostClusterClusterIDTasksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + if o.TaskFields != nil { + if err := r.SetBodyParam(o.TaskFields); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/post_cluster_cluster_id_tasks_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/post_cluster_cluster_id_tasks_responses.go new file mode 100644 index 0000000000..cd916b3ad2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/post_cluster_cluster_id_tasks_responses.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// PostClusterClusterIDTasksReader is a Reader for the PostClusterClusterIDTasks structure. +type PostClusterClusterIDTasksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostClusterClusterIDTasksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewPostClusterClusterIDTasksCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPostClusterClusterIDTasksDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewPostClusterClusterIDTasksCreated creates a PostClusterClusterIDTasksCreated with default headers values +func NewPostClusterClusterIDTasksCreated() *PostClusterClusterIDTasksCreated { + return &PostClusterClusterIDTasksCreated{} +} + +/* +PostClusterClusterIDTasksCreated handles this case with default header values. + +Task added +*/ +type PostClusterClusterIDTasksCreated struct { + Location string +} + +func (o *PostClusterClusterIDTasksCreated) Error() string { + return fmt.Sprintf("[POST /cluster/{cluster_id}/tasks][%d] postClusterClusterIdTasksCreated ", 201) +} + +func (o *PostClusterClusterIDTasksCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Location + o.Location = response.GetHeader("Location") + + return nil +} + +// NewPostClusterClusterIDTasksDefault creates a PostClusterClusterIDTasksDefault with default headers values +func NewPostClusterClusterIDTasksDefault(code int) *PostClusterClusterIDTasksDefault { + return &PostClusterClusterIDTasksDefault{ + _statusCode: code, + } +} + +/* +PostClusterClusterIDTasksDefault handles this case with default header values. + +Error +*/ +type PostClusterClusterIDTasksDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the post cluster cluster ID tasks default response +func (o *PostClusterClusterIDTasksDefault) Code() int { + return o._statusCode +} + +func (o *PostClusterClusterIDTasksDefault) Error() string { + return fmt.Sprintf("[POST /cluster/{cluster_id}/tasks][%d] PostClusterClusterIDTasks default %+v", o._statusCode, o.Payload) +} + +func (o *PostClusterClusterIDTasksDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *PostClusterClusterIDTasksDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/post_clusters_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/post_clusters_parameters.go new file mode 100644 index 0000000000..cf640a99f5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/post_clusters_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// NewPostClustersParams creates a new PostClustersParams object +// with the default values initialized. +func NewPostClustersParams() *PostClustersParams { + var () + return &PostClustersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPostClustersParamsWithTimeout creates a new PostClustersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPostClustersParamsWithTimeout(timeout time.Duration) *PostClustersParams { + var () + return &PostClustersParams{ + + timeout: timeout, + } +} + +// NewPostClustersParamsWithContext creates a new PostClustersParams object +// with the default values initialized, and the ability to set a context for a request +func NewPostClustersParamsWithContext(ctx context.Context) *PostClustersParams { + var () + return &PostClustersParams{ + + Context: ctx, + } +} + +// NewPostClustersParamsWithHTTPClient creates a new PostClustersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPostClustersParamsWithHTTPClient(client *http.Client) *PostClustersParams { + var () + return &PostClustersParams{ + HTTPClient: client, + } +} + +/* +PostClustersParams contains all the parameters to send to the API endpoint +for the post clusters operation typically these are written to a http.Request +*/ +type PostClustersParams struct { + + /*Cluster*/ + Cluster *models.Cluster + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the post clusters params +func (o *PostClustersParams) WithTimeout(timeout time.Duration) *PostClustersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post clusters params +func (o *PostClustersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post clusters params +func (o *PostClustersParams) WithContext(ctx context.Context) *PostClustersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post clusters params +func (o *PostClustersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post clusters params +func (o *PostClustersParams) WithHTTPClient(client *http.Client) *PostClustersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post clusters params +func (o *PostClustersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCluster adds the cluster to the post clusters params +func (o *PostClustersParams) WithCluster(cluster *models.Cluster) *PostClustersParams { + o.SetCluster(cluster) + return o +} + +// SetCluster adds the cluster to the post clusters params +func (o *PostClustersParams) SetCluster(cluster *models.Cluster) { + o.Cluster = cluster +} + +// WriteToRequest writes these params to a swagger request +func (o *PostClustersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cluster != nil { + if err := r.SetBodyParam(o.Cluster); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/post_clusters_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/post_clusters_responses.go new file mode 100644 index 0000000000..403b0c7176 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/post_clusters_responses.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// PostClustersReader is a Reader for the PostClusters structure. +type PostClustersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostClustersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewPostClustersCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPostClustersDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewPostClustersCreated creates a PostClustersCreated with default headers values +func NewPostClustersCreated() *PostClustersCreated { + return &PostClustersCreated{} +} + +/* +PostClustersCreated handles this case with default header values. + +Cluster added +*/ +type PostClustersCreated struct { + Location string +} + +func (o *PostClustersCreated) Error() string { + return fmt.Sprintf("[POST /clusters][%d] postClustersCreated ", 201) +} + +func (o *PostClustersCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Location + o.Location = response.GetHeader("Location") + + return nil +} + +// NewPostClustersDefault creates a PostClustersDefault with default headers values +func NewPostClustersDefault(code int) *PostClustersDefault { + return &PostClustersDefault{ + _statusCode: code, + } +} + +/* +PostClustersDefault handles this case with default header values. + +Error +*/ +type PostClustersDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the post clusters default response +func (o *PostClustersDefault) Code() int { + return o._statusCode +} + +func (o *PostClustersDefault) Error() string { + return fmt.Sprintf("[POST /clusters][%d] PostClusters default %+v", o._statusCode, o.Payload) +} + +func (o *PostClustersDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *PostClustersDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_parameters.go new file mode 100644 index 0000000000..5ec169db87 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_parameters.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// NewPutClusterClusterIDParams creates a new PutClusterClusterIDParams object +// with the default values initialized. +func NewPutClusterClusterIDParams() *PutClusterClusterIDParams { + var () + return &PutClusterClusterIDParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutClusterClusterIDParamsWithTimeout creates a new PutClusterClusterIDParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutClusterClusterIDParamsWithTimeout(timeout time.Duration) *PutClusterClusterIDParams { + var () + return &PutClusterClusterIDParams{ + + timeout: timeout, + } +} + +// NewPutClusterClusterIDParamsWithContext creates a new PutClusterClusterIDParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutClusterClusterIDParamsWithContext(ctx context.Context) *PutClusterClusterIDParams { + var () + return &PutClusterClusterIDParams{ + + Context: ctx, + } +} + +// NewPutClusterClusterIDParamsWithHTTPClient creates a new PutClusterClusterIDParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutClusterClusterIDParamsWithHTTPClient(client *http.Client) *PutClusterClusterIDParams { + var () + return &PutClusterClusterIDParams{ + HTTPClient: client, + } +} + +/* +PutClusterClusterIDParams contains all the parameters to send to the API endpoint +for the put cluster cluster ID operation typically these are written to a http.Request +*/ +type PutClusterClusterIDParams struct { + + /*Cluster*/ + Cluster *models.Cluster + /*ClusterID*/ + ClusterID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put cluster cluster ID params +func (o *PutClusterClusterIDParams) WithTimeout(timeout time.Duration) *PutClusterClusterIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put cluster cluster ID params +func (o *PutClusterClusterIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put cluster cluster ID params +func (o *PutClusterClusterIDParams) WithContext(ctx context.Context) *PutClusterClusterIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put cluster cluster ID params +func (o *PutClusterClusterIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put cluster cluster ID params +func (o *PutClusterClusterIDParams) WithHTTPClient(client *http.Client) *PutClusterClusterIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put cluster cluster ID params +func (o *PutClusterClusterIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCluster adds the cluster to the put cluster cluster ID params +func (o *PutClusterClusterIDParams) WithCluster(cluster *models.Cluster) *PutClusterClusterIDParams { + o.SetCluster(cluster) + return o +} + +// SetCluster adds the cluster to the put cluster cluster ID params +func (o *PutClusterClusterIDParams) SetCluster(cluster *models.Cluster) { + o.Cluster = cluster +} + +// WithClusterID adds the clusterID to the put cluster cluster ID params +func (o *PutClusterClusterIDParams) WithClusterID(clusterID string) *PutClusterClusterIDParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the put cluster cluster ID params +func (o *PutClusterClusterIDParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WriteToRequest writes these params to a swagger request +func (o *PutClusterClusterIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cluster != nil { + if err := r.SetBodyParam(o.Cluster); err != nil { + return err + } + } + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_repairs_intensity_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_repairs_intensity_parameters.go new file mode 100644 index 0000000000..e236537d7c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_repairs_intensity_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewPutClusterClusterIDRepairsIntensityParams creates a new PutClusterClusterIDRepairsIntensityParams object +// with the default values initialized. +func NewPutClusterClusterIDRepairsIntensityParams() *PutClusterClusterIDRepairsIntensityParams { + var () + return &PutClusterClusterIDRepairsIntensityParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutClusterClusterIDRepairsIntensityParamsWithTimeout creates a new PutClusterClusterIDRepairsIntensityParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutClusterClusterIDRepairsIntensityParamsWithTimeout(timeout time.Duration) *PutClusterClusterIDRepairsIntensityParams { + var () + return &PutClusterClusterIDRepairsIntensityParams{ + + timeout: timeout, + } +} + +// NewPutClusterClusterIDRepairsIntensityParamsWithContext creates a new PutClusterClusterIDRepairsIntensityParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutClusterClusterIDRepairsIntensityParamsWithContext(ctx context.Context) *PutClusterClusterIDRepairsIntensityParams { + var () + return &PutClusterClusterIDRepairsIntensityParams{ + + Context: ctx, + } +} + +// NewPutClusterClusterIDRepairsIntensityParamsWithHTTPClient creates a new PutClusterClusterIDRepairsIntensityParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutClusterClusterIDRepairsIntensityParamsWithHTTPClient(client *http.Client) *PutClusterClusterIDRepairsIntensityParams { + var () + return &PutClusterClusterIDRepairsIntensityParams{ + HTTPClient: client, + } +} + +/* +PutClusterClusterIDRepairsIntensityParams contains all the parameters to send to the API endpoint +for the put cluster cluster ID repairs intensity operation typically these are written to a http.Request +*/ +type PutClusterClusterIDRepairsIntensityParams struct { + + /*ClusterID*/ + ClusterID string + /*Intensity*/ + Intensity float64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put cluster cluster ID repairs intensity params +func (o *PutClusterClusterIDRepairsIntensityParams) WithTimeout(timeout time.Duration) *PutClusterClusterIDRepairsIntensityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put cluster cluster ID repairs intensity params +func (o *PutClusterClusterIDRepairsIntensityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put cluster cluster ID repairs intensity params +func (o *PutClusterClusterIDRepairsIntensityParams) WithContext(ctx context.Context) *PutClusterClusterIDRepairsIntensityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put cluster cluster ID repairs intensity params +func (o *PutClusterClusterIDRepairsIntensityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put cluster cluster ID repairs intensity params +func (o *PutClusterClusterIDRepairsIntensityParams) WithHTTPClient(client *http.Client) *PutClusterClusterIDRepairsIntensityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put cluster cluster ID repairs intensity params +func (o *PutClusterClusterIDRepairsIntensityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the put cluster cluster ID repairs intensity params +func (o *PutClusterClusterIDRepairsIntensityParams) WithClusterID(clusterID string) *PutClusterClusterIDRepairsIntensityParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the put cluster cluster ID repairs intensity params +func (o *PutClusterClusterIDRepairsIntensityParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithIntensity adds the intensity to the put cluster cluster ID repairs intensity params +func (o *PutClusterClusterIDRepairsIntensityParams) WithIntensity(intensity float64) *PutClusterClusterIDRepairsIntensityParams { + o.SetIntensity(intensity) + return o +} + +// SetIntensity adds the intensity to the put cluster cluster ID repairs intensity params +func (o *PutClusterClusterIDRepairsIntensityParams) SetIntensity(intensity float64) { + o.Intensity = intensity +} + +// WriteToRequest writes these params to a swagger request +func (o *PutClusterClusterIDRepairsIntensityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + // query param intensity + qrIntensity := o.Intensity + qIntensity := swag.FormatFloat64(qrIntensity) + if qIntensity != "" { + if err := r.SetQueryParam("intensity", qIntensity); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_repairs_intensity_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_repairs_intensity_responses.go new file mode 100644 index 0000000000..92bbbbdeac --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_repairs_intensity_responses.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// PutClusterClusterIDRepairsIntensityReader is a Reader for the PutClusterClusterIDRepairsIntensity structure. +type PutClusterClusterIDRepairsIntensityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutClusterClusterIDRepairsIntensityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutClusterClusterIDRepairsIntensityOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPutClusterClusterIDRepairsIntensityDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewPutClusterClusterIDRepairsIntensityOK creates a PutClusterClusterIDRepairsIntensityOK with default headers values +func NewPutClusterClusterIDRepairsIntensityOK() *PutClusterClusterIDRepairsIntensityOK { + return &PutClusterClusterIDRepairsIntensityOK{} +} + +/* +PutClusterClusterIDRepairsIntensityOK handles this case with default header values. + +OK +*/ +type PutClusterClusterIDRepairsIntensityOK struct { +} + +func (o *PutClusterClusterIDRepairsIntensityOK) Error() string { + return fmt.Sprintf("[PUT /cluster/{cluster_id}/repairs/intensity][%d] putClusterClusterIdRepairsIntensityOK ", 200) +} + +func (o *PutClusterClusterIDRepairsIntensityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPutClusterClusterIDRepairsIntensityDefault creates a PutClusterClusterIDRepairsIntensityDefault with default headers values +func NewPutClusterClusterIDRepairsIntensityDefault(code int) *PutClusterClusterIDRepairsIntensityDefault { + return &PutClusterClusterIDRepairsIntensityDefault{ + _statusCode: code, + } +} + +/* +PutClusterClusterIDRepairsIntensityDefault handles this case with default header values. + +Error +*/ +type PutClusterClusterIDRepairsIntensityDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the put cluster cluster ID repairs intensity default response +func (o *PutClusterClusterIDRepairsIntensityDefault) Code() int { + return o._statusCode +} + +func (o *PutClusterClusterIDRepairsIntensityDefault) Error() string { + return fmt.Sprintf("[PUT /cluster/{cluster_id}/repairs/intensity][%d] PutClusterClusterIDRepairsIntensity default %+v", o._statusCode, o.Payload) +} + +func (o *PutClusterClusterIDRepairsIntensityDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *PutClusterClusterIDRepairsIntensityDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_repairs_parallel_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_repairs_parallel_parameters.go new file mode 100644 index 0000000000..ddede7456a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_repairs_parallel_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewPutClusterClusterIDRepairsParallelParams creates a new PutClusterClusterIDRepairsParallelParams object +// with the default values initialized. +func NewPutClusterClusterIDRepairsParallelParams() *PutClusterClusterIDRepairsParallelParams { + var () + return &PutClusterClusterIDRepairsParallelParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutClusterClusterIDRepairsParallelParamsWithTimeout creates a new PutClusterClusterIDRepairsParallelParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutClusterClusterIDRepairsParallelParamsWithTimeout(timeout time.Duration) *PutClusterClusterIDRepairsParallelParams { + var () + return &PutClusterClusterIDRepairsParallelParams{ + + timeout: timeout, + } +} + +// NewPutClusterClusterIDRepairsParallelParamsWithContext creates a new PutClusterClusterIDRepairsParallelParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutClusterClusterIDRepairsParallelParamsWithContext(ctx context.Context) *PutClusterClusterIDRepairsParallelParams { + var () + return &PutClusterClusterIDRepairsParallelParams{ + + Context: ctx, + } +} + +// NewPutClusterClusterIDRepairsParallelParamsWithHTTPClient creates a new PutClusterClusterIDRepairsParallelParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutClusterClusterIDRepairsParallelParamsWithHTTPClient(client *http.Client) *PutClusterClusterIDRepairsParallelParams { + var () + return &PutClusterClusterIDRepairsParallelParams{ + HTTPClient: client, + } +} + +/* +PutClusterClusterIDRepairsParallelParams contains all the parameters to send to the API endpoint +for the put cluster cluster ID repairs parallel operation typically these are written to a http.Request +*/ +type PutClusterClusterIDRepairsParallelParams struct { + + /*ClusterID*/ + ClusterID string + /*Parallel*/ + Parallel int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put cluster cluster ID repairs parallel params +func (o *PutClusterClusterIDRepairsParallelParams) WithTimeout(timeout time.Duration) *PutClusterClusterIDRepairsParallelParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put cluster cluster ID repairs parallel params +func (o *PutClusterClusterIDRepairsParallelParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put cluster cluster ID repairs parallel params +func (o *PutClusterClusterIDRepairsParallelParams) WithContext(ctx context.Context) *PutClusterClusterIDRepairsParallelParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put cluster cluster ID repairs parallel params +func (o *PutClusterClusterIDRepairsParallelParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put cluster cluster ID repairs parallel params +func (o *PutClusterClusterIDRepairsParallelParams) WithHTTPClient(client *http.Client) *PutClusterClusterIDRepairsParallelParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put cluster cluster ID repairs parallel params +func (o *PutClusterClusterIDRepairsParallelParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the put cluster cluster ID repairs parallel params +func (o *PutClusterClusterIDRepairsParallelParams) WithClusterID(clusterID string) *PutClusterClusterIDRepairsParallelParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the put cluster cluster ID repairs parallel params +func (o *PutClusterClusterIDRepairsParallelParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithParallel adds the parallel to the put cluster cluster ID repairs parallel params +func (o *PutClusterClusterIDRepairsParallelParams) WithParallel(parallel int64) *PutClusterClusterIDRepairsParallelParams { + o.SetParallel(parallel) + return o +} + +// SetParallel adds the parallel to the put cluster cluster ID repairs parallel params +func (o *PutClusterClusterIDRepairsParallelParams) SetParallel(parallel int64) { + o.Parallel = parallel +} + +// WriteToRequest writes these params to a swagger request +func (o *PutClusterClusterIDRepairsParallelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + // query param parallel + qrParallel := o.Parallel + qParallel := swag.FormatInt64(qrParallel) + if qParallel != "" { + if err := r.SetQueryParam("parallel", qParallel); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_repairs_parallel_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_repairs_parallel_responses.go new file mode 100644 index 0000000000..da493713b4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_repairs_parallel_responses.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// PutClusterClusterIDRepairsParallelReader is a Reader for the PutClusterClusterIDRepairsParallel structure. +type PutClusterClusterIDRepairsParallelReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutClusterClusterIDRepairsParallelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutClusterClusterIDRepairsParallelOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPutClusterClusterIDRepairsParallelDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewPutClusterClusterIDRepairsParallelOK creates a PutClusterClusterIDRepairsParallelOK with default headers values +func NewPutClusterClusterIDRepairsParallelOK() *PutClusterClusterIDRepairsParallelOK { + return &PutClusterClusterIDRepairsParallelOK{} +} + +/* +PutClusterClusterIDRepairsParallelOK handles this case with default header values. + +OK +*/ +type PutClusterClusterIDRepairsParallelOK struct { + Payload models.Suspended +} + +func (o *PutClusterClusterIDRepairsParallelOK) Error() string { + return fmt.Sprintf("[PUT /cluster/{cluster_id}/repairs/parallel][%d] putClusterClusterIdRepairsParallelOK %+v", 200, o.Payload) +} + +func (o *PutClusterClusterIDRepairsParallelOK) GetPayload() models.Suspended { + return o.Payload +} + +func (o *PutClusterClusterIDRepairsParallelOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutClusterClusterIDRepairsParallelDefault creates a PutClusterClusterIDRepairsParallelDefault with default headers values +func NewPutClusterClusterIDRepairsParallelDefault(code int) *PutClusterClusterIDRepairsParallelDefault { + return &PutClusterClusterIDRepairsParallelDefault{ + _statusCode: code, + } +} + +/* +PutClusterClusterIDRepairsParallelDefault handles this case with default header values. + +Error +*/ +type PutClusterClusterIDRepairsParallelDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the put cluster cluster ID repairs parallel default response +func (o *PutClusterClusterIDRepairsParallelDefault) Code() int { + return o._statusCode +} + +func (o *PutClusterClusterIDRepairsParallelDefault) Error() string { + return fmt.Sprintf("[PUT /cluster/{cluster_id}/repairs/parallel][%d] PutClusterClusterIDRepairsParallel default %+v", o._statusCode, o.Payload) +} + +func (o *PutClusterClusterIDRepairsParallelDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *PutClusterClusterIDRepairsParallelDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_responses.go new file mode 100644 index 0000000000..66cb83d0d8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_responses.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// PutClusterClusterIDReader is a Reader for the PutClusterClusterID structure. +type PutClusterClusterIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutClusterClusterIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutClusterClusterIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPutClusterClusterIDDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewPutClusterClusterIDOK creates a PutClusterClusterIDOK with default headers values +func NewPutClusterClusterIDOK() *PutClusterClusterIDOK { + return &PutClusterClusterIDOK{} +} + +/* +PutClusterClusterIDOK handles this case with default header values. + +Updated cluster info +*/ +type PutClusterClusterIDOK struct { + Payload *models.Cluster +} + +func (o *PutClusterClusterIDOK) Error() string { + return fmt.Sprintf("[PUT /cluster/{cluster_id}][%d] putClusterClusterIdOK %+v", 200, o.Payload) +} + +func (o *PutClusterClusterIDOK) GetPayload() *models.Cluster { + return o.Payload +} + +func (o *PutClusterClusterIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Cluster) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutClusterClusterIDDefault creates a PutClusterClusterIDDefault with default headers values +func NewPutClusterClusterIDDefault(code int) *PutClusterClusterIDDefault { + return &PutClusterClusterIDDefault{ + _statusCode: code, + } +} + +/* +PutClusterClusterIDDefault handles this case with default header values. + +Error +*/ +type PutClusterClusterIDDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the put cluster cluster ID default response +func (o *PutClusterClusterIDDefault) Code() int { + return o._statusCode +} + +func (o *PutClusterClusterIDDefault) Error() string { + return fmt.Sprintf("[PUT /cluster/{cluster_id}][%d] PutClusterClusterID default %+v", o._statusCode, o.Payload) +} + +func (o *PutClusterClusterIDDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *PutClusterClusterIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_suspended_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_suspended_parameters.go new file mode 100644 index 0000000000..1e7cd0ee9b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_suspended_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// NewPutClusterClusterIDSuspendedParams creates a new PutClusterClusterIDSuspendedParams object +// with the default values initialized. +func NewPutClusterClusterIDSuspendedParams() *PutClusterClusterIDSuspendedParams { + var () + return &PutClusterClusterIDSuspendedParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutClusterClusterIDSuspendedParamsWithTimeout creates a new PutClusterClusterIDSuspendedParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutClusterClusterIDSuspendedParamsWithTimeout(timeout time.Duration) *PutClusterClusterIDSuspendedParams { + var () + return &PutClusterClusterIDSuspendedParams{ + + timeout: timeout, + } +} + +// NewPutClusterClusterIDSuspendedParamsWithContext creates a new PutClusterClusterIDSuspendedParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutClusterClusterIDSuspendedParamsWithContext(ctx context.Context) *PutClusterClusterIDSuspendedParams { + var () + return &PutClusterClusterIDSuspendedParams{ + + Context: ctx, + } +} + +// NewPutClusterClusterIDSuspendedParamsWithHTTPClient creates a new PutClusterClusterIDSuspendedParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutClusterClusterIDSuspendedParamsWithHTTPClient(client *http.Client) *PutClusterClusterIDSuspendedParams { + var () + return &PutClusterClusterIDSuspendedParams{ + HTTPClient: client, + } +} + +/* +PutClusterClusterIDSuspendedParams contains all the parameters to send to the API endpoint +for the put cluster cluster ID suspended operation typically these are written to a http.Request +*/ +type PutClusterClusterIDSuspendedParams struct { + + /*ClusterID*/ + ClusterID string + /*StartTasks*/ + StartTasks bool + /*Suspended*/ + Suspended models.Suspended + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put cluster cluster ID suspended params +func (o *PutClusterClusterIDSuspendedParams) WithTimeout(timeout time.Duration) *PutClusterClusterIDSuspendedParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put cluster cluster ID suspended params +func (o *PutClusterClusterIDSuspendedParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put cluster cluster ID suspended params +func (o *PutClusterClusterIDSuspendedParams) WithContext(ctx context.Context) *PutClusterClusterIDSuspendedParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put cluster cluster ID suspended params +func (o *PutClusterClusterIDSuspendedParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put cluster cluster ID suspended params +func (o *PutClusterClusterIDSuspendedParams) WithHTTPClient(client *http.Client) *PutClusterClusterIDSuspendedParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put cluster cluster ID suspended params +func (o *PutClusterClusterIDSuspendedParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the put cluster cluster ID suspended params +func (o *PutClusterClusterIDSuspendedParams) WithClusterID(clusterID string) *PutClusterClusterIDSuspendedParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the put cluster cluster ID suspended params +func (o *PutClusterClusterIDSuspendedParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithStartTasks adds the startTasks to the put cluster cluster ID suspended params +func (o *PutClusterClusterIDSuspendedParams) WithStartTasks(startTasks bool) *PutClusterClusterIDSuspendedParams { + o.SetStartTasks(startTasks) + return o +} + +// SetStartTasks adds the startTasks to the put cluster cluster ID suspended params +func (o *PutClusterClusterIDSuspendedParams) SetStartTasks(startTasks bool) { + o.StartTasks = startTasks +} + +// WithSuspended adds the suspended to the put cluster cluster ID suspended params +func (o *PutClusterClusterIDSuspendedParams) WithSuspended(suspended models.Suspended) *PutClusterClusterIDSuspendedParams { + o.SetSuspended(suspended) + return o +} + +// SetSuspended adds the suspended to the put cluster cluster ID suspended params +func (o *PutClusterClusterIDSuspendedParams) SetSuspended(suspended models.Suspended) { + o.Suspended = suspended +} + +// WriteToRequest writes these params to a swagger request +func (o *PutClusterClusterIDSuspendedParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + // query param start_tasks + qrStartTasks := o.StartTasks + qStartTasks := swag.FormatBool(qrStartTasks) + if qStartTasks != "" { + if err := r.SetQueryParam("start_tasks", qStartTasks); err != nil { + return err + } + } + + if err := r.SetBodyParam(o.Suspended); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_suspended_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_suspended_responses.go new file mode 100644 index 0000000000..3ba1bbdb8b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_suspended_responses.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// PutClusterClusterIDSuspendedReader is a Reader for the PutClusterClusterIDSuspended structure. +type PutClusterClusterIDSuspendedReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutClusterClusterIDSuspendedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutClusterClusterIDSuspendedOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPutClusterClusterIDSuspendedDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewPutClusterClusterIDSuspendedOK creates a PutClusterClusterIDSuspendedOK with default headers values +func NewPutClusterClusterIDSuspendedOK() *PutClusterClusterIDSuspendedOK { + return &PutClusterClusterIDSuspendedOK{} +} + +/* +PutClusterClusterIDSuspendedOK handles this case with default header values. + +OK +*/ +type PutClusterClusterIDSuspendedOK struct { +} + +func (o *PutClusterClusterIDSuspendedOK) Error() string { + return fmt.Sprintf("[PUT /cluster/{cluster_id}/suspended][%d] putClusterClusterIdSuspendedOK ", 200) +} + +func (o *PutClusterClusterIDSuspendedOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPutClusterClusterIDSuspendedDefault creates a PutClusterClusterIDSuspendedDefault with default headers values +func NewPutClusterClusterIDSuspendedDefault(code int) *PutClusterClusterIDSuspendedDefault { + return &PutClusterClusterIDSuspendedDefault{ + _statusCode: code, + } +} + +/* +PutClusterClusterIDSuspendedDefault handles this case with default header values. + +Error +*/ +type PutClusterClusterIDSuspendedDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the put cluster cluster ID suspended default response +func (o *PutClusterClusterIDSuspendedDefault) Code() int { + return o._statusCode +} + +func (o *PutClusterClusterIDSuspendedDefault) Error() string { + return fmt.Sprintf("[PUT /cluster/{cluster_id}/suspended][%d] PutClusterClusterIDSuspended default %+v", o._statusCode, o.Payload) +} + +func (o *PutClusterClusterIDSuspendedDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *PutClusterClusterIDSuspendedDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_parameters.go new file mode 100644 index 0000000000..78fef0ebd3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_parameters.go @@ -0,0 +1,190 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// NewPutClusterClusterIDTaskTaskTypeTaskIDParams creates a new PutClusterClusterIDTaskTaskTypeTaskIDParams object +// with the default values initialized. +func NewPutClusterClusterIDTaskTaskTypeTaskIDParams() *PutClusterClusterIDTaskTaskTypeTaskIDParams { + var () + return &PutClusterClusterIDTaskTaskTypeTaskIDParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutClusterClusterIDTaskTaskTypeTaskIDParamsWithTimeout creates a new PutClusterClusterIDTaskTaskTypeTaskIDParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutClusterClusterIDTaskTaskTypeTaskIDParamsWithTimeout(timeout time.Duration) *PutClusterClusterIDTaskTaskTypeTaskIDParams { + var () + return &PutClusterClusterIDTaskTaskTypeTaskIDParams{ + + timeout: timeout, + } +} + +// NewPutClusterClusterIDTaskTaskTypeTaskIDParamsWithContext creates a new PutClusterClusterIDTaskTaskTypeTaskIDParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutClusterClusterIDTaskTaskTypeTaskIDParamsWithContext(ctx context.Context) *PutClusterClusterIDTaskTaskTypeTaskIDParams { + var () + return &PutClusterClusterIDTaskTaskTypeTaskIDParams{ + + Context: ctx, + } +} + +// NewPutClusterClusterIDTaskTaskTypeTaskIDParamsWithHTTPClient creates a new PutClusterClusterIDTaskTaskTypeTaskIDParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutClusterClusterIDTaskTaskTypeTaskIDParamsWithHTTPClient(client *http.Client) *PutClusterClusterIDTaskTaskTypeTaskIDParams { + var () + return &PutClusterClusterIDTaskTaskTypeTaskIDParams{ + HTTPClient: client, + } +} + +/* +PutClusterClusterIDTaskTaskTypeTaskIDParams contains all the parameters to send to the API endpoint +for the put cluster cluster ID task task type task ID operation typically these are written to a http.Request +*/ +type PutClusterClusterIDTaskTaskTypeTaskIDParams struct { + + /*ClusterID*/ + ClusterID string + /*TaskFields*/ + TaskFields *models.TaskUpdate + /*TaskID*/ + TaskID string + /*TaskType*/ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put cluster cluster ID task task type task ID params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDParams) WithTimeout(timeout time.Duration) *PutClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put cluster cluster ID task task type task ID params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put cluster cluster ID task task type task ID params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDParams) WithContext(ctx context.Context) *PutClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put cluster cluster ID task task type task ID params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put cluster cluster ID task task type task ID params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDParams) WithHTTPClient(client *http.Client) *PutClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put cluster cluster ID task task type task ID params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the put cluster cluster ID task task type task ID params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDParams) WithClusterID(clusterID string) *PutClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the put cluster cluster ID task task type task ID params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithTaskFields adds the taskFields to the put cluster cluster ID task task type task ID params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDParams) WithTaskFields(taskFields *models.TaskUpdate) *PutClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetTaskFields(taskFields) + return o +} + +// SetTaskFields adds the taskFields to the put cluster cluster ID task task type task ID params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDParams) SetTaskFields(taskFields *models.TaskUpdate) { + o.TaskFields = taskFields +} + +// WithTaskID adds the taskID to the put cluster cluster ID task task type task ID params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDParams) WithTaskID(taskID string) *PutClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the put cluster cluster ID task task type task ID params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WithTaskType adds the taskType to the put cluster cluster ID task task type task ID params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDParams) WithTaskType(taskType string) *PutClusterClusterIDTaskTaskTypeTaskIDParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the put cluster cluster ID task task type task ID params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *PutClusterClusterIDTaskTaskTypeTaskIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + if o.TaskFields != nil { + if err := r.SetBodyParam(o.TaskFields); err != nil { + return err + } + } + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + // path param task_type + if err := r.SetPathParam("task_type", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_responses.go new file mode 100644 index 0000000000..b746d7a21f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_responses.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// PutClusterClusterIDTaskTaskTypeTaskIDReader is a Reader for the PutClusterClusterIDTaskTaskTypeTaskID structure. +type PutClusterClusterIDTaskTaskTypeTaskIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutClusterClusterIDTaskTaskTypeTaskIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutClusterClusterIDTaskTaskTypeTaskIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPutClusterClusterIDTaskTaskTypeTaskIDDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewPutClusterClusterIDTaskTaskTypeTaskIDOK creates a PutClusterClusterIDTaskTaskTypeTaskIDOK with default headers values +func NewPutClusterClusterIDTaskTaskTypeTaskIDOK() *PutClusterClusterIDTaskTaskTypeTaskIDOK { + return &PutClusterClusterIDTaskTaskTypeTaskIDOK{} +} + +/* +PutClusterClusterIDTaskTaskTypeTaskIDOK handles this case with default header values. + +Updated task info +*/ +type PutClusterClusterIDTaskTaskTypeTaskIDOK struct { + Payload *models.Task +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDOK) Error() string { + return fmt.Sprintf("[PUT /cluster/{cluster_id}/task/{task_type}/{task_id}][%d] putClusterClusterIdTaskTaskTypeTaskIdOK %+v", 200, o.Payload) +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDOK) GetPayload() *models.Task { + return o.Payload +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Task) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutClusterClusterIDTaskTaskTypeTaskIDDefault creates a PutClusterClusterIDTaskTaskTypeTaskIDDefault with default headers values +func NewPutClusterClusterIDTaskTaskTypeTaskIDDefault(code int) *PutClusterClusterIDTaskTaskTypeTaskIDDefault { + return &PutClusterClusterIDTaskTaskTypeTaskIDDefault{ + _statusCode: code, + } +} + +/* +PutClusterClusterIDTaskTaskTypeTaskIDDefault handles this case with default header values. + +Error +*/ +type PutClusterClusterIDTaskTaskTypeTaskIDDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the put cluster cluster ID task task type task ID default response +func (o *PutClusterClusterIDTaskTaskTypeTaskIDDefault) Code() int { + return o._statusCode +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDDefault) Error() string { + return fmt.Sprintf("[PUT /cluster/{cluster_id}/task/{task_type}/{task_id}][%d] PutClusterClusterIDTaskTaskTypeTaskID default %+v", o._statusCode, o.Payload) +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_start_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_start_parameters.go new file mode 100644 index 0000000000..831d82b967 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_start_parameters.go @@ -0,0 +1,192 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewPutClusterClusterIDTaskTaskTypeTaskIDStartParams creates a new PutClusterClusterIDTaskTaskTypeTaskIDStartParams object +// with the default values initialized. +func NewPutClusterClusterIDTaskTaskTypeTaskIDStartParams() *PutClusterClusterIDTaskTaskTypeTaskIDStartParams { + var () + return &PutClusterClusterIDTaskTaskTypeTaskIDStartParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutClusterClusterIDTaskTaskTypeTaskIDStartParamsWithTimeout creates a new PutClusterClusterIDTaskTaskTypeTaskIDStartParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutClusterClusterIDTaskTaskTypeTaskIDStartParamsWithTimeout(timeout time.Duration) *PutClusterClusterIDTaskTaskTypeTaskIDStartParams { + var () + return &PutClusterClusterIDTaskTaskTypeTaskIDStartParams{ + + timeout: timeout, + } +} + +// NewPutClusterClusterIDTaskTaskTypeTaskIDStartParamsWithContext creates a new PutClusterClusterIDTaskTaskTypeTaskIDStartParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutClusterClusterIDTaskTaskTypeTaskIDStartParamsWithContext(ctx context.Context) *PutClusterClusterIDTaskTaskTypeTaskIDStartParams { + var () + return &PutClusterClusterIDTaskTaskTypeTaskIDStartParams{ + + Context: ctx, + } +} + +// NewPutClusterClusterIDTaskTaskTypeTaskIDStartParamsWithHTTPClient creates a new PutClusterClusterIDTaskTaskTypeTaskIDStartParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutClusterClusterIDTaskTaskTypeTaskIDStartParamsWithHTTPClient(client *http.Client) *PutClusterClusterIDTaskTaskTypeTaskIDStartParams { + var () + return &PutClusterClusterIDTaskTaskTypeTaskIDStartParams{ + HTTPClient: client, + } +} + +/* +PutClusterClusterIDTaskTaskTypeTaskIDStartParams contains all the parameters to send to the API endpoint +for the put cluster cluster ID task task type task ID start operation typically these are written to a http.Request +*/ +type PutClusterClusterIDTaskTaskTypeTaskIDStartParams struct { + + /*ClusterID*/ + ClusterID string + /*Continue*/ + Continue bool + /*TaskID*/ + TaskID string + /*TaskType*/ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put cluster cluster ID task task type task ID start params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) WithTimeout(timeout time.Duration) *PutClusterClusterIDTaskTaskTypeTaskIDStartParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put cluster cluster ID task task type task ID start params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put cluster cluster ID task task type task ID start params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) WithContext(ctx context.Context) *PutClusterClusterIDTaskTaskTypeTaskIDStartParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put cluster cluster ID task task type task ID start params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put cluster cluster ID task task type task ID start params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) WithHTTPClient(client *http.Client) *PutClusterClusterIDTaskTaskTypeTaskIDStartParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put cluster cluster ID task task type task ID start params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the put cluster cluster ID task task type task ID start params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) WithClusterID(clusterID string) *PutClusterClusterIDTaskTaskTypeTaskIDStartParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the put cluster cluster ID task task type task ID start params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithContinue adds the continueVar to the put cluster cluster ID task task type task ID start params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) WithContinue(continueVar bool) *PutClusterClusterIDTaskTaskTypeTaskIDStartParams { + o.SetContinue(continueVar) + return o +} + +// SetContinue adds the continue to the put cluster cluster ID task task type task ID start params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) SetContinue(continueVar bool) { + o.Continue = continueVar +} + +// WithTaskID adds the taskID to the put cluster cluster ID task task type task ID start params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) WithTaskID(taskID string) *PutClusterClusterIDTaskTaskTypeTaskIDStartParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the put cluster cluster ID task task type task ID start params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WithTaskType adds the taskType to the put cluster cluster ID task task type task ID start params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) WithTaskType(taskType string) *PutClusterClusterIDTaskTaskTypeTaskIDStartParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the put cluster cluster ID task task type task ID start params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + // query param continue + qrContinue := o.Continue + qContinue := swag.FormatBool(qrContinue) + if qContinue != "" { + if err := r.SetQueryParam("continue", qContinue); err != nil { + return err + } + } + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + // path param task_type + if err := r.SetPathParam("task_type", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_start_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_start_responses.go new file mode 100644 index 0000000000..355dea6813 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_start_responses.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// PutClusterClusterIDTaskTaskTypeTaskIDStartReader is a Reader for the PutClusterClusterIDTaskTaskTypeTaskIDStart structure. +type PutClusterClusterIDTaskTaskTypeTaskIDStartReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutClusterClusterIDTaskTaskTypeTaskIDStartOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPutClusterClusterIDTaskTaskTypeTaskIDStartDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewPutClusterClusterIDTaskTaskTypeTaskIDStartOK creates a PutClusterClusterIDTaskTaskTypeTaskIDStartOK with default headers values +func NewPutClusterClusterIDTaskTaskTypeTaskIDStartOK() *PutClusterClusterIDTaskTaskTypeTaskIDStartOK { + return &PutClusterClusterIDTaskTaskTypeTaskIDStartOK{} +} + +/* +PutClusterClusterIDTaskTaskTypeTaskIDStartOK handles this case with default header values. + +Task started +*/ +type PutClusterClusterIDTaskTaskTypeTaskIDStartOK struct { +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartOK) Error() string { + return fmt.Sprintf("[PUT /cluster/{cluster_id}/task/{task_type}/{task_id}/start][%d] putClusterClusterIdTaskTaskTypeTaskIdStartOK ", 200) +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPutClusterClusterIDTaskTaskTypeTaskIDStartDefault creates a PutClusterClusterIDTaskTaskTypeTaskIDStartDefault with default headers values +func NewPutClusterClusterIDTaskTaskTypeTaskIDStartDefault(code int) *PutClusterClusterIDTaskTaskTypeTaskIDStartDefault { + return &PutClusterClusterIDTaskTaskTypeTaskIDStartDefault{ + _statusCode: code, + } +} + +/* +PutClusterClusterIDTaskTaskTypeTaskIDStartDefault handles this case with default header values. + +Error +*/ +type PutClusterClusterIDTaskTaskTypeTaskIDStartDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the put cluster cluster ID task task type task ID start default response +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartDefault) Code() int { + return o._statusCode +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartDefault) Error() string { + return fmt.Sprintf("[PUT /cluster/{cluster_id}/task/{task_type}/{task_id}/start][%d] PutClusterClusterIDTaskTaskTypeTaskIDStart default %+v", o._statusCode, o.Payload) +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStartDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_stop_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_stop_parameters.go new file mode 100644 index 0000000000..5d641d7ce1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_stop_parameters.go @@ -0,0 +1,199 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewPutClusterClusterIDTaskTaskTypeTaskIDStopParams creates a new PutClusterClusterIDTaskTaskTypeTaskIDStopParams object +// with the default values initialized. +func NewPutClusterClusterIDTaskTaskTypeTaskIDStopParams() *PutClusterClusterIDTaskTaskTypeTaskIDStopParams { + var () + return &PutClusterClusterIDTaskTaskTypeTaskIDStopParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewPutClusterClusterIDTaskTaskTypeTaskIDStopParamsWithTimeout creates a new PutClusterClusterIDTaskTaskTypeTaskIDStopParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewPutClusterClusterIDTaskTaskTypeTaskIDStopParamsWithTimeout(timeout time.Duration) *PutClusterClusterIDTaskTaskTypeTaskIDStopParams { + var () + return &PutClusterClusterIDTaskTaskTypeTaskIDStopParams{ + + timeout: timeout, + } +} + +// NewPutClusterClusterIDTaskTaskTypeTaskIDStopParamsWithContext creates a new PutClusterClusterIDTaskTaskTypeTaskIDStopParams object +// with the default values initialized, and the ability to set a context for a request +func NewPutClusterClusterIDTaskTaskTypeTaskIDStopParamsWithContext(ctx context.Context) *PutClusterClusterIDTaskTaskTypeTaskIDStopParams { + var () + return &PutClusterClusterIDTaskTaskTypeTaskIDStopParams{ + + Context: ctx, + } +} + +// NewPutClusterClusterIDTaskTaskTypeTaskIDStopParamsWithHTTPClient creates a new PutClusterClusterIDTaskTaskTypeTaskIDStopParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewPutClusterClusterIDTaskTaskTypeTaskIDStopParamsWithHTTPClient(client *http.Client) *PutClusterClusterIDTaskTaskTypeTaskIDStopParams { + var () + return &PutClusterClusterIDTaskTaskTypeTaskIDStopParams{ + HTTPClient: client, + } +} + +/* +PutClusterClusterIDTaskTaskTypeTaskIDStopParams contains all the parameters to send to the API endpoint +for the put cluster cluster ID task task type task ID stop operation typically these are written to a http.Request +*/ +type PutClusterClusterIDTaskTaskTypeTaskIDStopParams struct { + + /*ClusterID*/ + ClusterID string + /*Disable*/ + Disable *bool + /*TaskID*/ + TaskID string + /*TaskType*/ + TaskType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the put cluster cluster ID task task type task ID stop params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) WithTimeout(timeout time.Duration) *PutClusterClusterIDTaskTaskTypeTaskIDStopParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put cluster cluster ID task task type task ID stop params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put cluster cluster ID task task type task ID stop params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) WithContext(ctx context.Context) *PutClusterClusterIDTaskTaskTypeTaskIDStopParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put cluster cluster ID task task type task ID stop params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put cluster cluster ID task task type task ID stop params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) WithHTTPClient(client *http.Client) *PutClusterClusterIDTaskTaskTypeTaskIDStopParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put cluster cluster ID task task type task ID stop params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClusterID adds the clusterID to the put cluster cluster ID task task type task ID stop params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) WithClusterID(clusterID string) *PutClusterClusterIDTaskTaskTypeTaskIDStopParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the put cluster cluster ID task task type task ID stop params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) SetClusterID(clusterID string) { + o.ClusterID = clusterID +} + +// WithDisable adds the disable to the put cluster cluster ID task task type task ID stop params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) WithDisable(disable *bool) *PutClusterClusterIDTaskTaskTypeTaskIDStopParams { + o.SetDisable(disable) + return o +} + +// SetDisable adds the disable to the put cluster cluster ID task task type task ID stop params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) SetDisable(disable *bool) { + o.Disable = disable +} + +// WithTaskID adds the taskID to the put cluster cluster ID task task type task ID stop params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) WithTaskID(taskID string) *PutClusterClusterIDTaskTaskTypeTaskIDStopParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the put cluster cluster ID task task type task ID stop params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WithTaskType adds the taskType to the put cluster cluster ID task task type task ID stop params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) WithTaskType(taskType string) *PutClusterClusterIDTaskTaskTypeTaskIDStopParams { + o.SetTaskType(taskType) + return o +} + +// SetTaskType adds the taskType to the put cluster cluster ID task task type task ID stop params +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) SetTaskType(taskType string) { + o.TaskType = taskType +} + +// WriteToRequest writes these params to a swagger request +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cluster_id + if err := r.SetPathParam("cluster_id", o.ClusterID); err != nil { + return err + } + + if o.Disable != nil { + + // query param disable + var qrDisable bool + if o.Disable != nil { + qrDisable = *o.Disable + } + qDisable := swag.FormatBool(qrDisable) + if qDisable != "" { + if err := r.SetQueryParam("disable", qDisable); err != nil { + return err + } + } + + } + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + // path param task_type + if err := r.SetPathParam("task_type", o.TaskType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_stop_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_stop_responses.go new file mode 100644 index 0000000000..3a73227dac --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations/put_cluster_cluster_id_task_task_type_task_id_stop_responses.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models" +) + +// PutClusterClusterIDTaskTaskTypeTaskIDStopReader is a Reader for the PutClusterClusterIDTaskTaskTypeTaskIDStop structure. +type PutClusterClusterIDTaskTaskTypeTaskIDStopReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPutClusterClusterIDTaskTaskTypeTaskIDStopOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewPutClusterClusterIDTaskTaskTypeTaskIDStopDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewPutClusterClusterIDTaskTaskTypeTaskIDStopOK creates a PutClusterClusterIDTaskTaskTypeTaskIDStopOK with default headers values +func NewPutClusterClusterIDTaskTaskTypeTaskIDStopOK() *PutClusterClusterIDTaskTaskTypeTaskIDStopOK { + return &PutClusterClusterIDTaskTaskTypeTaskIDStopOK{} +} + +/* +PutClusterClusterIDTaskTaskTypeTaskIDStopOK handles this case with default header values. + +Task stopped +*/ +type PutClusterClusterIDTaskTaskTypeTaskIDStopOK struct { +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopOK) Error() string { + return fmt.Sprintf("[PUT /cluster/{cluster_id}/task/{task_type}/{task_id}/stop][%d] putClusterClusterIdTaskTaskTypeTaskIdStopOK ", 200) +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPutClusterClusterIDTaskTaskTypeTaskIDStopDefault creates a PutClusterClusterIDTaskTaskTypeTaskIDStopDefault with default headers values +func NewPutClusterClusterIDTaskTaskTypeTaskIDStopDefault(code int) *PutClusterClusterIDTaskTaskTypeTaskIDStopDefault { + return &PutClusterClusterIDTaskTaskTypeTaskIDStopDefault{ + _statusCode: code, + } +} + +/* +PutClusterClusterIDTaskTaskTypeTaskIDStopDefault handles this case with default header values. + +Error +*/ +type PutClusterClusterIDTaskTaskTypeTaskIDStopDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the put cluster cluster ID task task type task ID stop default response +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopDefault) Code() int { + return o._statusCode +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopDefault) Error() string { + return fmt.Sprintf("[PUT /cluster/{cluster_id}/task/{task_type}/{task_id}/stop][%d] PutClusterClusterIDTaskTaskTypeTaskIDStop default %+v", o._statusCode, o.Payload) +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *PutClusterClusterIDTaskTaskTypeTaskIDStopDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/backup_files_info.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/backup_files_info.go new file mode 100644 index 0000000000..fba6872879 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/backup_files_info.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// BackupFilesInfo backup files info +// +// swagger:model BackupFilesInfo +type BackupFilesInfo struct { + + // files + Files []*BackupFilesInfoFilesItems0 `json:"files"` + + // location + Location string `json:"location,omitempty"` + + // schema + Schema string `json:"schema,omitempty"` +} + +// Validate validates this backup files info +func (m *BackupFilesInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFiles(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BackupFilesInfo) validateFiles(formats strfmt.Registry) error { + + if swag.IsZero(m.Files) { // not required + return nil + } + + for i := 0; i < len(m.Files); i++ { + if swag.IsZero(m.Files[i]) { // not required + continue + } + + if m.Files[i] != nil { + if err := m.Files[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("files" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *BackupFilesInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BackupFilesInfo) UnmarshalBinary(b []byte) error { + var res BackupFilesInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// BackupFilesInfoFilesItems0 backup files info files items0 +// +// swagger:model BackupFilesInfoFilesItems0 +type BackupFilesInfoFilesItems0 struct { + + // files + Files []string `json:"files"` + + // keyspace + Keyspace string `json:"keyspace,omitempty"` + + // path + Path string `json:"path,omitempty"` + + // size + Size int64 `json:"size,omitempty"` + + // table + Table string `json:"table,omitempty"` + + // version + Version string `json:"version,omitempty"` +} + +// Validate validates this backup files info files items0 +func (m *BackupFilesInfoFilesItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *BackupFilesInfoFilesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BackupFilesInfoFilesItems0) UnmarshalBinary(b []byte) error { + var res BackupFilesInfoFilesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/backup_list_item.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/backup_list_item.go new file mode 100644 index 0000000000..13d5ffda53 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/backup_list_item.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// BackupListItem backup list item +// +// swagger:model BackupListItem +type BackupListItem struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // snapshot info + SnapshotInfo []*SnapshotInfo `json:"snapshot_info"` + + // task id + TaskID string `json:"task_id,omitempty"` + + // units + Units []*BackupUnit `json:"units"` +} + +// Validate validates this backup list item +func (m *BackupListItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSnapshotInfo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUnits(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BackupListItem) validateSnapshotInfo(formats strfmt.Registry) error { + + if swag.IsZero(m.SnapshotInfo) { // not required + return nil + } + + for i := 0; i < len(m.SnapshotInfo); i++ { + if swag.IsZero(m.SnapshotInfo[i]) { // not required + continue + } + + if m.SnapshotInfo[i] != nil { + if err := m.SnapshotInfo[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("snapshot_info" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *BackupListItem) validateUnits(formats strfmt.Registry) error { + + if swag.IsZero(m.Units) { // not required + return nil + } + + for i := 0; i < len(m.Units); i++ { + if swag.IsZero(m.Units[i]) { // not required + continue + } + + if m.Units[i] != nil { + if err := m.Units[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("units" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *BackupListItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BackupListItem) UnmarshalBinary(b []byte) error { + var res BackupListItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/backup_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/backup_progress.go new file mode 100644 index 0000000000..cd8b9b2e18 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/backup_progress.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// BackupProgress backup progress +// +// swagger:model BackupProgress +type BackupProgress struct { + + // completed at + // Format: date-time + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` + + // dcs + Dcs []string `json:"dcs"` + + // failed + Failed int64 `json:"failed,omitempty"` + + // hosts + Hosts []*HostProgress `json:"hosts"` + + // size + Size int64 `json:"size,omitempty"` + + // skipped + Skipped int64 `json:"skipped,omitempty"` + + // snapshot tag + SnapshotTag string `json:"snapshot_tag,omitempty"` + + // stage + Stage string `json:"stage,omitempty"` + + // started at + // Format: date-time + StartedAt *strfmt.DateTime `json:"started_at,omitempty"` + + // uploaded + Uploaded int64 `json:"uploaded,omitempty"` +} + +// Validate validates this backup progress +func (m *BackupProgress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHosts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BackupProgress) validateCompletedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("completed_at", "body", "date-time", m.CompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *BackupProgress) validateHosts(formats strfmt.Registry) error { + + if swag.IsZero(m.Hosts) { // not required + return nil + } + + for i := 0; i < len(m.Hosts); i++ { + if swag.IsZero(m.Hosts[i]) { // not required + continue + } + + if m.Hosts[i] != nil { + if err := m.Hosts[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *BackupProgress) validateStartedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StartedAt) { // not required + return nil + } + + if err := validate.FormatOf("started_at", "body", "date-time", m.StartedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *BackupProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BackupProgress) UnmarshalBinary(b []byte) error { + var res BackupProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/backup_target.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/backup_target.go new file mode 100644 index 0000000000..c01d8ce1c0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/backup_target.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// BackupTarget backup target +// +// swagger:model BackupTarget +type BackupTarget struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // dc + Dc []string `json:"dc"` + + // host + Host string `json:"host,omitempty"` + + // location + Location []string `json:"location"` + + // rate limit + RateLimit []string `json:"rate_limit"` + + // retention + Retention int64 `json:"retention,omitempty"` + + // retention days + RetentionDays int64 `json:"retention_days,omitempty"` + + // size + Size int64 `json:"size,omitempty"` + + // snapshot parallel + SnapshotParallel []string `json:"snapshot_parallel"` + + // units + Units []*BackupUnit `json:"units"` + + // upload parallel + UploadParallel []string `json:"upload_parallel"` + + // with hosts + WithHosts []string `json:"with_hosts"` +} + +// Validate validates this backup target +func (m *BackupTarget) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUnits(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BackupTarget) validateUnits(formats strfmt.Registry) error { + + if swag.IsZero(m.Units) { // not required + return nil + } + + for i := 0; i < len(m.Units); i++ { + if swag.IsZero(m.Units[i]) { // not required + continue + } + + if m.Units[i] != nil { + if err := m.Units[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("units" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *BackupTarget) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BackupTarget) UnmarshalBinary(b []byte) error { + var res BackupTarget + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/backup_unit.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/backup_unit.go new file mode 100644 index 0000000000..04127c2b65 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/backup_unit.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// BackupUnit backup unit +// +// swagger:model BackupUnit +type BackupUnit struct { + + // all tables + AllTables bool `json:"all_tables,omitempty"` + + // keyspace + Keyspace string `json:"keyspace,omitempty"` + + // tables + Tables []string `json:"tables"` +} + +// Validate validates this backup unit +func (m *BackupUnit) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *BackupUnit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BackupUnit) UnmarshalBinary(b []byte) error { + var res BackupUnit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/cluster.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/cluster.go new file mode 100644 index 0000000000..67fe76352e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/cluster.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Cluster cluster +// +// swagger:model Cluster +type Cluster struct { + + // auth token + AuthToken string `json:"auth_token,omitempty"` + + // force non ssl session port + ForceNonSslSessionPort bool `json:"force_non_ssl_session_port,omitempty"` + + // force tls disabled + ForceTLSDisabled bool `json:"force_tls_disabled,omitempty"` + + // host + Host string `json:"host,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // labels + Labels map[string]string `json:"labels,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // password + Password string `json:"password,omitempty"` + + // port + Port int64 `json:"port,omitempty"` + + // ssl user cert file + // Format: byte + SslUserCertFile strfmt.Base64 `json:"ssl_user_cert_file,omitempty"` + + // ssl user key file + // Format: byte + SslUserKeyFile strfmt.Base64 `json:"ssl_user_key_file,omitempty"` + + // username + Username string `json:"username,omitempty"` + + // without repair + WithoutRepair bool `json:"without_repair,omitempty"` +} + +// Validate validates this cluster +func (m *Cluster) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Cluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Cluster) UnmarshalBinary(b []byte) error { + var res Cluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/cluster_status.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/cluster_status.go new file mode 100644 index 0000000000..71e571ada3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/cluster_status.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ClusterStatus cluster status +// +// swagger:model ClusterStatus +type ClusterStatus []*ClusterStatusItems0 + +// Validate validates this cluster status +func (m ClusterStatus) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ClusterStatusItems0 cluster status items0 +// +// swagger:model ClusterStatusItems0 +type ClusterStatusItems0 struct { + + // agent version + AgentVersion string `json:"agent_version,omitempty"` + + // alternator cause + AlternatorCause string `json:"alternator_cause,omitempty"` + + // alternator rtt ms + AlternatorRttMs float32 `json:"alternator_rtt_ms,omitempty"` + + // alternator status + AlternatorStatus string `json:"alternator_status,omitempty"` + + // cpu count + CPUCount int64 `json:"cpu_count,omitempty"` + + // cql cause + CqlCause string `json:"cql_cause,omitempty"` + + // cql rtt ms + CqlRttMs float32 `json:"cql_rtt_ms,omitempty"` + + // cql status + CqlStatus string `json:"cql_status,omitempty"` + + // dc + Dc string `json:"dc,omitempty"` + + // host + Host string `json:"host,omitempty"` + + // host id + HostID string `json:"host_id,omitempty"` + + // rest cause + RestCause string `json:"rest_cause,omitempty"` + + // rest rtt ms + RestRttMs float32 `json:"rest_rtt_ms,omitempty"` + + // rest status + RestStatus string `json:"rest_status,omitempty"` + + // scylla version + ScyllaVersion string `json:"scylla_version,omitempty"` + + // ssl + Ssl bool `json:"ssl,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // total ram + TotalRAM int64 `json:"total_ram,omitempty"` + + // uptime + Uptime int64 `json:"uptime,omitempty"` +} + +// Validate validates this cluster status items0 +func (m *ClusterStatusItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ClusterStatusItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ClusterStatusItems0) UnmarshalBinary(b []byte) error { + var res ClusterStatusItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/error_response.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/error_response.go new file mode 100644 index 0000000000..1a034831fc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/error_response.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ErrorResponse error response +// +// swagger:model ErrorResponse +type ErrorResponse struct { + + // Human readable description + Details string `json:"details,omitempty"` + + // Error description + Message string `json:"message,omitempty"` + + // Request ID for tracing in logs + TraceID string `json:"trace_id,omitempty"` +} + +// Validate validates this error response +func (m *ErrorResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ErrorResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ErrorResponse) UnmarshalBinary(b []byte) error { + var res ErrorResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/host_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/host_progress.go new file mode 100644 index 0000000000..35c41eef1b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/host_progress.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// HostProgress host progress +// +// swagger:model HostProgress +type HostProgress struct { + + // completed at + // Format: date-time + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` + + // failed + Failed int64 `json:"failed,omitempty"` + + // host + Host string `json:"host,omitempty"` + + // keyspaces + Keyspaces []*KeyspaceProgress `json:"keyspaces"` + + // size + Size int64 `json:"size,omitempty"` + + // skipped + Skipped int64 `json:"skipped,omitempty"` + + // started at + // Format: date-time + StartedAt *strfmt.DateTime `json:"started_at,omitempty"` + + // uploaded + Uploaded int64 `json:"uploaded,omitempty"` +} + +// Validate validates this host progress +func (m *HostProgress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKeyspaces(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HostProgress) validateCompletedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("completed_at", "body", "date-time", m.CompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *HostProgress) validateKeyspaces(formats strfmt.Registry) error { + + if swag.IsZero(m.Keyspaces) { // not required + return nil + } + + for i := 0; i < len(m.Keyspaces); i++ { + if swag.IsZero(m.Keyspaces[i]) { // not required + continue + } + + if m.Keyspaces[i] != nil { + if err := m.Keyspaces[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyspaces" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HostProgress) validateStartedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StartedAt) { // not required + return nil + } + + if err := validate.FormatOf("started_at", "body", "date-time", m.StartedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HostProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HostProgress) UnmarshalBinary(b []byte) error { + var res HostProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/keyspace_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/keyspace_progress.go new file mode 100644 index 0000000000..c550ede136 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/keyspace_progress.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// KeyspaceProgress keyspace progress +// +// swagger:model KeyspaceProgress +type KeyspaceProgress struct { + + // completed at + // Format: date-time + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` + + // failed + Failed int64 `json:"failed,omitempty"` + + // keyspace + Keyspace string `json:"keyspace,omitempty"` + + // size + Size int64 `json:"size,omitempty"` + + // skipped + Skipped int64 `json:"skipped,omitempty"` + + // started at + // Format: date-time + StartedAt *strfmt.DateTime `json:"started_at,omitempty"` + + // tables + Tables []*TableProgress `json:"tables"` + + // uploaded + Uploaded int64 `json:"uploaded,omitempty"` +} + +// Validate validates this keyspace progress +func (m *KeyspaceProgress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTables(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *KeyspaceProgress) validateCompletedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("completed_at", "body", "date-time", m.CompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *KeyspaceProgress) validateStartedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StartedAt) { // not required + return nil + } + + if err := validate.FormatOf("started_at", "body", "date-time", m.StartedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *KeyspaceProgress) validateTables(formats strfmt.Registry) error { + + if swag.IsZero(m.Tables) { // not required + return nil + } + + for i := 0; i < len(m.Tables); i++ { + if swag.IsZero(m.Tables[i]) { // not required + continue + } + + if m.Tables[i] != nil { + if err := m.Tables[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tables" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *KeyspaceProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *KeyspaceProgress) UnmarshalBinary(b []byte) error { + var res KeyspaceProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/repair_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/repair_progress.go new file mode 100644 index 0000000000..6d1dc455b0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/repair_progress.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RepairProgress repair progress +// +// swagger:model RepairProgress +type RepairProgress struct { + + // completed at + // Format: date-time + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` + + // dcs + Dcs []string `json:"dcs"` + + // duration ms + DurationMs int64 `json:"duration_ms,omitempty"` + + // error + Error int64 `json:"error,omitempty"` + + // error percentage + ErrorPercentage int64 `json:"error_percentage,omitempty"` + + // host + Host string `json:"host,omitempty"` + + // hosts + Hosts []*RepairProgressHostsItems0 `json:"hosts"` + + // intensity + Intensity float64 `json:"intensity,omitempty"` + + // max intensity + MaxIntensity float64 `json:"max_intensity,omitempty"` + + // max parallel + MaxParallel int64 `json:"max_parallel,omitempty"` + + // parallel + Parallel int64 `json:"parallel,omitempty"` + + // started at + // Format: date-time + StartedAt *strfmt.DateTime `json:"started_at,omitempty"` + + // success + Success int64 `json:"success,omitempty"` + + // success percentage + SuccessPercentage int64 `json:"success_percentage,omitempty"` + + // tables + Tables []*TableRepairProgress `json:"tables"` + + // token ranges + TokenRanges int64 `json:"token_ranges,omitempty"` +} + +// Validate validates this repair progress +func (m *RepairProgress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHosts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTables(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RepairProgress) validateCompletedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("completed_at", "body", "date-time", m.CompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *RepairProgress) validateHosts(formats strfmt.Registry) error { + + if swag.IsZero(m.Hosts) { // not required + return nil + } + + for i := 0; i < len(m.Hosts); i++ { + if swag.IsZero(m.Hosts[i]) { // not required + continue + } + + if m.Hosts[i] != nil { + if err := m.Hosts[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *RepairProgress) validateStartedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StartedAt) { // not required + return nil + } + + if err := validate.FormatOf("started_at", "body", "date-time", m.StartedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *RepairProgress) validateTables(formats strfmt.Registry) error { + + if swag.IsZero(m.Tables) { // not required + return nil + } + + for i := 0; i < len(m.Tables); i++ { + if swag.IsZero(m.Tables[i]) { // not required + continue + } + + if m.Tables[i] != nil { + if err := m.Tables[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tables" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RepairProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RepairProgress) UnmarshalBinary(b []byte) error { + var res RepairProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// RepairProgressHostsItems0 repair progress hosts items0 +// +// swagger:model RepairProgressHostsItems0 +type RepairProgressHostsItems0 struct { + + // host + Host string `json:"host,omitempty"` + + // tables + Tables []*TableRepairProgress `json:"tables"` +} + +// Validate validates this repair progress hosts items0 +func (m *RepairProgressHostsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTables(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RepairProgressHostsItems0) validateTables(formats strfmt.Registry) error { + + if swag.IsZero(m.Tables) { // not required + return nil + } + + for i := 0; i < len(m.Tables); i++ { + if swag.IsZero(m.Tables[i]) { // not required + continue + } + + if m.Tables[i] != nil { + if err := m.Tables[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tables" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RepairProgressHostsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RepairProgressHostsItems0) UnmarshalBinary(b []byte) error { + var res RepairProgressHostsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/repair_target.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/repair_target.go new file mode 100644 index 0000000000..c93190b212 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/repair_target.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RepairTarget repair target +// +// swagger:model RepairTarget +type RepairTarget struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // dc + Dc []string `json:"dc"` + + // host + Host string `json:"host,omitempty"` + + // ignore hosts + IgnoreHosts []string `json:"ignore_hosts"` + + // token ranges + TokenRanges string `json:"token_ranges,omitempty"` + + // units + Units []*RepairUnit `json:"units"` + + // with hosts + WithHosts []string `json:"with_hosts"` +} + +// Validate validates this repair target +func (m *RepairTarget) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUnits(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RepairTarget) validateUnits(formats strfmt.Registry) error { + + if swag.IsZero(m.Units) { // not required + return nil + } + + for i := 0; i < len(m.Units); i++ { + if swag.IsZero(m.Units[i]) { // not required + continue + } + + if m.Units[i] != nil { + if err := m.Units[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("units" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RepairTarget) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RepairTarget) UnmarshalBinary(b []byte) error { + var res RepairTarget + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/repair_unit.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/repair_unit.go new file mode 100644 index 0000000000..3910215af4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/repair_unit.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RepairUnit repair unit +// +// swagger:model RepairUnit +type RepairUnit struct { + + // all tables + AllTables bool `json:"all_tables,omitempty"` + + // keyspace + Keyspace string `json:"keyspace,omitempty"` + + // tables + Tables []string `json:"tables"` +} + +// Validate validates this repair unit +func (m *RepairUnit) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RepairUnit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RepairUnit) UnmarshalBinary(b []byte) error { + var res RepairUnit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_keyspace_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_keyspace_progress.go new file mode 100644 index 0000000000..e804217b1b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_keyspace_progress.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RestoreKeyspaceProgress restore keyspace progress +// +// swagger:model RestoreKeyspaceProgress +type RestoreKeyspaceProgress struct { + + // completed at + // Format: date-time + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` + + // downloaded + Downloaded int64 `json:"downloaded,omitempty"` + + // failed + Failed int64 `json:"failed,omitempty"` + + // keyspace + Keyspace string `json:"keyspace,omitempty"` + + // restored + Restored int64 `json:"restored,omitempty"` + + // size + Size int64 `json:"size,omitempty"` + + // started at + // Format: date-time + StartedAt *strfmt.DateTime `json:"started_at,omitempty"` + + // tables + Tables []*RestoreTableProgress `json:"tables"` +} + +// Validate validates this restore keyspace progress +func (m *RestoreKeyspaceProgress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTables(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RestoreKeyspaceProgress) validateCompletedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("completed_at", "body", "date-time", m.CompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *RestoreKeyspaceProgress) validateStartedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StartedAt) { // not required + return nil + } + + if err := validate.FormatOf("started_at", "body", "date-time", m.StartedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *RestoreKeyspaceProgress) validateTables(formats strfmt.Registry) error { + + if swag.IsZero(m.Tables) { // not required + return nil + } + + for i := 0; i < len(m.Tables); i++ { + if swag.IsZero(m.Tables[i]) { // not required + continue + } + + if m.Tables[i] != nil { + if err := m.Tables[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tables" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RestoreKeyspaceProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RestoreKeyspaceProgress) UnmarshalBinary(b []byte) error { + var res RestoreKeyspaceProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_progress.go new file mode 100644 index 0000000000..f250ac14ba --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_progress.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RestoreProgress restore progress +// +// swagger:model RestoreProgress +type RestoreProgress struct { + + // completed at + // Format: date-time + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` + + // downloaded + Downloaded int64 `json:"downloaded,omitempty"` + + // failed + Failed int64 `json:"failed,omitempty"` + + // keyspaces + Keyspaces []*RestoreKeyspaceProgress `json:"keyspaces"` + + // repair progress + RepairProgress *RepairProgress `json:"repair_progress,omitempty"` + + // restored + Restored int64 `json:"restored,omitempty"` + + // size + Size int64 `json:"size,omitempty"` + + // snapshot tag + SnapshotTag string `json:"snapshot_tag,omitempty"` + + // stage + Stage string `json:"stage,omitempty"` + + // started at + // Format: date-time + StartedAt *strfmt.DateTime `json:"started_at,omitempty"` + + // views + Views []*RestoreViewProgress `json:"views"` +} + +// Validate validates this restore progress +func (m *RestoreProgress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKeyspaces(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRepairProgress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateViews(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RestoreProgress) validateCompletedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("completed_at", "body", "date-time", m.CompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *RestoreProgress) validateKeyspaces(formats strfmt.Registry) error { + + if swag.IsZero(m.Keyspaces) { // not required + return nil + } + + for i := 0; i < len(m.Keyspaces); i++ { + if swag.IsZero(m.Keyspaces[i]) { // not required + continue + } + + if m.Keyspaces[i] != nil { + if err := m.Keyspaces[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keyspaces" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *RestoreProgress) validateRepairProgress(formats strfmt.Registry) error { + + if swag.IsZero(m.RepairProgress) { // not required + return nil + } + + if m.RepairProgress != nil { + if err := m.RepairProgress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("repair_progress") + } + return err + } + } + + return nil +} + +func (m *RestoreProgress) validateStartedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StartedAt) { // not required + return nil + } + + if err := validate.FormatOf("started_at", "body", "date-time", m.StartedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *RestoreProgress) validateViews(formats strfmt.Registry) error { + + if swag.IsZero(m.Views) { // not required + return nil + } + + for i := 0; i < len(m.Views); i++ { + if swag.IsZero(m.Views[i]) { // not required + continue + } + + if m.Views[i] != nil { + if err := m.Views[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("views" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RestoreProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RestoreProgress) UnmarshalBinary(b []byte) error { + var res RestoreProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_table.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_table.go new file mode 100644 index 0000000000..86aefa4441 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_table.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RestoreTable restore table +// +// swagger:model RestoreTable +type RestoreTable struct { + + // size + Size int64 `json:"size,omitempty"` + + // table + Table string `json:"table,omitempty"` + + // tombstone gc + TombstoneGc string `json:"tombstone_gc,omitempty"` +} + +// Validate validates this restore table +func (m *RestoreTable) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RestoreTable) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RestoreTable) UnmarshalBinary(b []byte) error { + var res RestoreTable + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_table_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_table_progress.go new file mode 100644 index 0000000000..f98edf0f3d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_table_progress.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RestoreTableProgress restore table progress +// +// swagger:model RestoreTableProgress +type RestoreTableProgress struct { + + // completed at + // Format: date-time + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` + + // downloaded + Downloaded int64 `json:"downloaded,omitempty"` + + // error + Error string `json:"error,omitempty"` + + // failed + Failed int64 `json:"failed,omitempty"` + + // restored + Restored int64 `json:"restored,omitempty"` + + // size + Size int64 `json:"size,omitempty"` + + // started at + // Format: date-time + StartedAt *strfmt.DateTime `json:"started_at,omitempty"` + + // table + Table string `json:"table,omitempty"` + + // tombstone gc + TombstoneGc string `json:"tombstone_gc,omitempty"` +} + +// Validate validates this restore table progress +func (m *RestoreTableProgress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RestoreTableProgress) validateCompletedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("completed_at", "body", "date-time", m.CompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *RestoreTableProgress) validateStartedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StartedAt) { // not required + return nil + } + + if err := validate.FormatOf("started_at", "body", "date-time", m.StartedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RestoreTableProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RestoreTableProgress) UnmarshalBinary(b []byte) error { + var res RestoreTableProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_target.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_target.go new file mode 100644 index 0000000000..6fcd07fb1b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_target.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RestoreTarget restore target +// +// swagger:model RestoreTarget +type RestoreTarget struct { + + // batch size + BatchSize int64 `json:"batch_size,omitempty"` + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // location + Location []string `json:"location"` + + // parallel + Parallel int64 `json:"parallel,omitempty"` + + // size + Size int64 `json:"size,omitempty"` + + // snapshot tag + SnapshotTag string `json:"snapshot_tag,omitempty"` + + // units + Units []*RestoreUnit `json:"units"` + + // views + Views []*RestoreView `json:"views"` +} + +// Validate validates this restore target +func (m *RestoreTarget) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUnits(formats); err != nil { + res = append(res, err) + } + + if err := m.validateViews(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RestoreTarget) validateUnits(formats strfmt.Registry) error { + + if swag.IsZero(m.Units) { // not required + return nil + } + + for i := 0; i < len(m.Units); i++ { + if swag.IsZero(m.Units[i]) { // not required + continue + } + + if m.Units[i] != nil { + if err := m.Units[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("units" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *RestoreTarget) validateViews(formats strfmt.Registry) error { + + if swag.IsZero(m.Views) { // not required + return nil + } + + for i := 0; i < len(m.Views); i++ { + if swag.IsZero(m.Views[i]) { // not required + continue + } + + if m.Views[i] != nil { + if err := m.Views[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("views" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RestoreTarget) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RestoreTarget) UnmarshalBinary(b []byte) error { + var res RestoreTarget + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_unit.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_unit.go new file mode 100644 index 0000000000..ccafae9cfb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_unit.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RestoreUnit restore unit +// +// swagger:model RestoreUnit +type RestoreUnit struct { + + // keyspace + Keyspace string `json:"keyspace,omitempty"` + + // size + Size int64 `json:"size,omitempty"` + + // tables + Tables []*RestoreTable `json:"tables"` +} + +// Validate validates this restore unit +func (m *RestoreUnit) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTables(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RestoreUnit) validateTables(formats strfmt.Registry) error { + + if swag.IsZero(m.Tables) { // not required + return nil + } + + for i := 0; i < len(m.Tables); i++ { + if swag.IsZero(m.Tables[i]) { // not required + continue + } + + if m.Tables[i] != nil { + if err := m.Tables[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tables" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RestoreUnit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RestoreUnit) UnmarshalBinary(b []byte) error { + var res RestoreUnit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_view.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_view.go new file mode 100644 index 0000000000..114852cb50 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_view.go @@ -0,0 +1,55 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RestoreView restore view +// +// swagger:model RestoreView +type RestoreView struct { + + // base table + BaseTable string `json:"base_table,omitempty"` + + // create stmt + CreateStmt string `json:"create_stmt,omitempty"` + + // keyspace + Keyspace string `json:"keyspace,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // view + View string `json:"view,omitempty"` +} + +// Validate validates this restore view +func (m *RestoreView) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RestoreView) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RestoreView) UnmarshalBinary(b []byte) error { + var res RestoreView + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_view_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_view_progress.go new file mode 100644 index 0000000000..cb1b688a9e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/restore_view_progress.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RestoreViewProgress restore view progress +// +// swagger:model RestoreViewProgress +type RestoreViewProgress struct { + + // base table + BaseTable string `json:"base_table,omitempty"` + + // create stmt + CreateStmt string `json:"create_stmt,omitempty"` + + // keyspace + Keyspace string `json:"keyspace,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // type + Type string `json:"type,omitempty"` + + // view + View string `json:"view,omitempty"` +} + +// Validate validates this restore view progress +func (m *RestoreViewProgress) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RestoreViewProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RestoreViewProgress) UnmarshalBinary(b []byte) error { + var res RestoreViewProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/schedule.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/schedule.go new file mode 100644 index 0000000000..f5a1eb953c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/schedule.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Schedule schedule +// +// swagger:model Schedule +type Schedule struct { + + // cron + Cron string `json:"cron,omitempty"` + + // This field is DEPRECATED. Use cron instead. + Interval string `json:"interval,omitempty"` + + // num retries + NumRetries int64 `json:"num_retries,omitempty"` + + // retry wait + RetryWait string `json:"retry_wait,omitempty"` + + // start date + // Format: date-time + StartDate *strfmt.DateTime `json:"start_date,omitempty"` + + // timezone + Timezone string `json:"timezone,omitempty"` + + // window + Window []string `json:"window"` +} + +// Validate validates this schedule +func (m *Schedule) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStartDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Schedule) validateStartDate(formats strfmt.Registry) error { + + if swag.IsZero(m.StartDate) { // not required + return nil + } + + if err := validate.FormatOf("start_date", "body", "date-time", m.StartDate.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Schedule) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Schedule) UnmarshalBinary(b []byte) error { + var res Schedule + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/snapshot_info.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/snapshot_info.go new file mode 100644 index 0000000000..303e2cdd2e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/snapshot_info.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SnapshotInfo snapshot info +// +// swagger:model SnapshotInfo +type SnapshotInfo struct { + + // nodes + Nodes int64 `json:"nodes,omitempty"` + + // size + Size int64 `json:"size,omitempty"` + + // snapshot tag + SnapshotTag string `json:"snapshot_tag,omitempty"` +} + +// Validate validates this snapshot info +func (m *SnapshotInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SnapshotInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SnapshotInfo) UnmarshalBinary(b []byte) error { + var res SnapshotInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/suspended.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/suspended.go new file mode 100644 index 0000000000..28b4f1e8ed --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/suspended.go @@ -0,0 +1,20 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" +) + +// Suspended suspended +// +// swagger:model Suspended +type Suspended bool + +// Validate validates this suspended +func (m Suspended) Validate(formats strfmt.Registry) error { + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/table_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/table_progress.go new file mode 100644 index 0000000000..fb96846132 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/table_progress.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TableProgress table progress +// +// swagger:model TableProgress +type TableProgress struct { + + // completed at + // Format: date-time + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` + + // error + Error string `json:"error,omitempty"` + + // failed + Failed int64 `json:"failed,omitempty"` + + // size + Size int64 `json:"size,omitempty"` + + // skipped + Skipped int64 `json:"skipped,omitempty"` + + // started at + // Format: date-time + StartedAt *strfmt.DateTime `json:"started_at,omitempty"` + + // table + Table string `json:"table,omitempty"` + + // uploaded + Uploaded int64 `json:"uploaded,omitempty"` +} + +// Validate validates this table progress +func (m *TableProgress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TableProgress) validateCompletedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("completed_at", "body", "date-time", m.CompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TableProgress) validateStartedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StartedAt) { // not required + return nil + } + + if err := validate.FormatOf("started_at", "body", "date-time", m.StartedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TableProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TableProgress) UnmarshalBinary(b []byte) error { + var res TableProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/table_repair_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/table_repair_progress.go new file mode 100644 index 0000000000..3bdaba3e61 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/table_repair_progress.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TableRepairProgress table repair progress +// +// swagger:model TableRepairProgress +type TableRepairProgress struct { + + // completed at + // Format: date-time + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` + + // duration ms + DurationMs int64 `json:"duration_ms,omitempty"` + + // error + Error int64 `json:"error,omitempty"` + + // keyspace + Keyspace string `json:"keyspace,omitempty"` + + // started at + // Format: date-time + StartedAt *strfmt.DateTime `json:"started_at,omitempty"` + + // success + Success int64 `json:"success,omitempty"` + + // table + Table string `json:"table,omitempty"` + + // token ranges + TokenRanges int64 `json:"token_ranges,omitempty"` +} + +// Validate validates this table repair progress +func (m *TableRepairProgress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TableRepairProgress) validateCompletedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("completed_at", "body", "date-time", m.CompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TableRepairProgress) validateStartedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StartedAt) { // not required + return nil + } + + if err := validate.FormatOf("started_at", "body", "date-time", m.StartedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TableRepairProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TableRepairProgress) UnmarshalBinary(b []byte) error { + var res TableRepairProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task.go new file mode 100644 index 0000000000..09bbb812dc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Task task +// +// swagger:model Task +type Task struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // labels + Labels map[string]string `json:"labels,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // properties + Properties interface{} `json:"properties,omitempty"` + + // schedule + Schedule *Schedule `json:"schedule,omitempty"` + + // This field is DEPRECATED. Use labels instead. + Tags []string `json:"tags"` + + // type + Type string `json:"type,omitempty"` +} + +// Validate validates this task +func (m *Task) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSchedule(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Task) validateSchedule(formats strfmt.Registry) error { + + if swag.IsZero(m.Schedule) { // not required + return nil + } + + if m.Schedule != nil { + if err := m.Schedule.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("schedule") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Task) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Task) UnmarshalBinary(b []byte) error { + var res Task + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_list_item.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_list_item.go new file mode 100644 index 0000000000..04a360b07e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_list_item.go @@ -0,0 +1,174 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TaskListItem task list item +// +// swagger:model TaskListItem +type TaskListItem struct { + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // error count + ErrorCount int64 `json:"error_count,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // labels + Labels map[string]string `json:"labels,omitempty"` + + // last error + // Format: date-time + LastError *strfmt.DateTime `json:"last_error,omitempty"` + + // last success + // Format: date-time + LastSuccess *strfmt.DateTime `json:"last_success,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // next activation + // Format: date-time + NextActivation *strfmt.DateTime `json:"next_activation,omitempty"` + + // properties + Properties interface{} `json:"properties,omitempty"` + + // retry + Retry int64 `json:"retry,omitempty"` + + // schedule + Schedule *Schedule `json:"schedule,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // success count + SuccessCount int64 `json:"success_count,omitempty"` + + // suspended + Suspended bool `json:"suspended,omitempty"` + + // This field is DEPRECATED. Use labels instead. + Tags []string `json:"tags"` + + // type + Type string `json:"type,omitempty"` +} + +// Validate validates this task list item +func (m *TaskListItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLastError(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastSuccess(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNextActivation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSchedule(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TaskListItem) validateLastError(formats strfmt.Registry) error { + + if swag.IsZero(m.LastError) { // not required + return nil + } + + if err := validate.FormatOf("last_error", "body", "date-time", m.LastError.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TaskListItem) validateLastSuccess(formats strfmt.Registry) error { + + if swag.IsZero(m.LastSuccess) { // not required + return nil + } + + if err := validate.FormatOf("last_success", "body", "date-time", m.LastSuccess.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TaskListItem) validateNextActivation(formats strfmt.Registry) error { + + if swag.IsZero(m.NextActivation) { // not required + return nil + } + + if err := validate.FormatOf("next_activation", "body", "date-time", m.NextActivation.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TaskListItem) validateSchedule(formats strfmt.Registry) error { + + if swag.IsZero(m.Schedule) { // not required + return nil + } + + if m.Schedule != nil { + if err := m.Schedule.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("schedule") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TaskListItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaskListItem) UnmarshalBinary(b []byte) error { + var res TaskListItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_run.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_run.go new file mode 100644 index 0000000000..1ec15d466e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_run.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TaskRun task run +// +// swagger:model TaskRun +type TaskRun struct { + + // cause + Cause string `json:"cause,omitempty"` + + // cluster id + ClusterID string `json:"cluster_id,omitempty"` + + // end time + // Format: date-time + EndTime strfmt.DateTime `json:"end_time,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // start time + // Format: date-time + StartTime strfmt.DateTime `json:"start_time,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // task id + TaskID string `json:"task_id,omitempty"` + + // type + Type string `json:"type,omitempty"` +} + +// Validate validates this task run +func (m *TaskRun) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEndTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartTime(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TaskRun) validateEndTime(formats strfmt.Registry) error { + + if swag.IsZero(m.EndTime) { // not required + return nil + } + + if err := validate.FormatOf("end_time", "body", "date-time", m.EndTime.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TaskRun) validateStartTime(formats strfmt.Registry) error { + + if swag.IsZero(m.StartTime) { // not required + return nil + } + + if err := validate.FormatOf("start_time", "body", "date-time", m.StartTime.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TaskRun) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaskRun) UnmarshalBinary(b []byte) error { + var res TaskRun + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_run_backup_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_run_backup_progress.go new file mode 100644 index 0000000000..8e6d0fcad5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_run_backup_progress.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaskRunBackupProgress task run backup progress +// +// swagger:model TaskRunBackupProgress +type TaskRunBackupProgress struct { + + // progress + Progress *BackupProgress `json:"progress,omitempty"` + + // run + Run *TaskRun `json:"run,omitempty"` +} + +// Validate validates this task run backup progress +func (m *TaskRunBackupProgress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateProgress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRun(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TaskRunBackupProgress) validateProgress(formats strfmt.Registry) error { + + if swag.IsZero(m.Progress) { // not required + return nil + } + + if m.Progress != nil { + if err := m.Progress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("progress") + } + return err + } + } + + return nil +} + +func (m *TaskRunBackupProgress) validateRun(formats strfmt.Registry) error { + + if swag.IsZero(m.Run) { // not required + return nil + } + + if m.Run != nil { + if err := m.Run.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("run") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TaskRunBackupProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaskRunBackupProgress) UnmarshalBinary(b []byte) error { + var res TaskRunBackupProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_run_repair_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_run_repair_progress.go new file mode 100644 index 0000000000..5ebc7c9805 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_run_repair_progress.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaskRunRepairProgress task run repair progress +// +// swagger:model TaskRunRepairProgress +type TaskRunRepairProgress struct { + + // progress + Progress *RepairProgress `json:"progress,omitempty"` + + // run + Run *TaskRun `json:"run,omitempty"` +} + +// Validate validates this task run repair progress +func (m *TaskRunRepairProgress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateProgress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRun(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TaskRunRepairProgress) validateProgress(formats strfmt.Registry) error { + + if swag.IsZero(m.Progress) { // not required + return nil + } + + if m.Progress != nil { + if err := m.Progress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("progress") + } + return err + } + } + + return nil +} + +func (m *TaskRunRepairProgress) validateRun(formats strfmt.Registry) error { + + if swag.IsZero(m.Run) { // not required + return nil + } + + if m.Run != nil { + if err := m.Run.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("run") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TaskRunRepairProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaskRunRepairProgress) UnmarshalBinary(b []byte) error { + var res TaskRunRepairProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_run_restore_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_run_restore_progress.go new file mode 100644 index 0000000000..88f4e1d8f7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_run_restore_progress.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaskRunRestoreProgress task run restore progress +// +// swagger:model TaskRunRestoreProgress +type TaskRunRestoreProgress struct { + + // progress + Progress *RestoreProgress `json:"progress,omitempty"` + + // run + Run *TaskRun `json:"run,omitempty"` +} + +// Validate validates this task run restore progress +func (m *TaskRunRestoreProgress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateProgress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRun(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TaskRunRestoreProgress) validateProgress(formats strfmt.Registry) error { + + if swag.IsZero(m.Progress) { // not required + return nil + } + + if m.Progress != nil { + if err := m.Progress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("progress") + } + return err + } + } + + return nil +} + +func (m *TaskRunRestoreProgress) validateRun(formats strfmt.Registry) error { + + if swag.IsZero(m.Run) { // not required + return nil + } + + if m.Run != nil { + if err := m.Run.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("run") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TaskRunRestoreProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaskRunRestoreProgress) UnmarshalBinary(b []byte) error { + var res TaskRunRestoreProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_run_validate_backup_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_run_validate_backup_progress.go new file mode 100644 index 0000000000..354046559d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_run_validate_backup_progress.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaskRunValidateBackupProgress task run validate backup progress +// +// swagger:model TaskRunValidateBackupProgress +type TaskRunValidateBackupProgress struct { + + // progress + Progress []*ValidateBackupProgress `json:"progress"` + + // run + Run *TaskRun `json:"run,omitempty"` +} + +// Validate validates this task run validate backup progress +func (m *TaskRunValidateBackupProgress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateProgress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRun(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TaskRunValidateBackupProgress) validateProgress(formats strfmt.Registry) error { + + if swag.IsZero(m.Progress) { // not required + return nil + } + + for i := 0; i < len(m.Progress); i++ { + if swag.IsZero(m.Progress[i]) { // not required + continue + } + + if m.Progress[i] != nil { + if err := m.Progress[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("progress" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TaskRunValidateBackupProgress) validateRun(formats strfmt.Registry) error { + + if swag.IsZero(m.Run) { // not required + return nil + } + + if m.Run != nil { + if err := m.Run.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("run") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TaskRunValidateBackupProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaskRunValidateBackupProgress) UnmarshalBinary(b []byte) error { + var res TaskRunValidateBackupProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_update.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_update.go new file mode 100644 index 0000000000..ce7cdd060e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/task_update.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaskUpdate task update +// +// swagger:model TaskUpdate +type TaskUpdate struct { + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // labels + Labels map[string]string `json:"labels,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // properties + Properties interface{} `json:"properties,omitempty"` + + // schedule + Schedule *Schedule `json:"schedule,omitempty"` + + // This field is DEPRECATED. Use labels instead. + Tags []string `json:"tags"` + + // type + Type string `json:"type,omitempty"` +} + +// Validate validates this task update +func (m *TaskUpdate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSchedule(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TaskUpdate) validateSchedule(formats strfmt.Registry) error { + + if swag.IsZero(m.Schedule) { // not required + return nil + } + + if m.Schedule != nil { + if err := m.Schedule.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("schedule") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TaskUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaskUpdate) UnmarshalBinary(b []byte) error { + var res TaskUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/validate_backup_progress.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/validate_backup_progress.go new file mode 100644 index 0000000000..2380d0db6c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/validate_backup_progress.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ValidateBackupProgress validate backup progress +// +// swagger:model ValidateBackupProgress +type ValidateBackupProgress struct { + + // broken snapshots + BrokenSnapshots []string `json:"broken_snapshots"` + + // completed at + // Format: date-time + CompletedAt *strfmt.DateTime `json:"completed_at,omitempty"` + + // dc + Dc string `json:"dc,omitempty"` + + // deleted files + DeletedFiles int64 `json:"deleted_files,omitempty"` + + // host + Host string `json:"host,omitempty"` + + // location + Location string `json:"location,omitempty"` + + // manifests + Manifests int64 `json:"manifests,omitempty"` + + // missing files + MissingFiles int64 `json:"missing_files,omitempty"` + + // orphaned bytes + OrphanedBytes int64 `json:"orphaned_bytes,omitempty"` + + // orphaned files + OrphanedFiles int64 `json:"orphaned_files,omitempty"` + + // scanned files + ScannedFiles int64 `json:"scanned_files,omitempty"` + + // started at + // Format: date-time + StartedAt *strfmt.DateTime `json:"started_at,omitempty"` +} + +// Validate validates this validate backup progress +func (m *ValidateBackupProgress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ValidateBackupProgress) validateCompletedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("completed_at", "body", "date-time", m.CompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ValidateBackupProgress) validateStartedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StartedAt) { // not required + return nil + } + + if err := validate.FormatOf("started_at", "body", "date-time", m.StartedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ValidateBackupProgress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidateBackupProgress) UnmarshalBinary(b []byte) error { + var res ValidateBackupProgress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/version.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/version.go new file mode 100644 index 0000000000..c9292afb4b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models/version.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Version version +// +// swagger:model Version +type Version struct { + + // version + Version string `json:"version,omitempty"` +} + +// Validate validates this version +func (m *Version) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Version) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Version) UnmarshalBinary(b []byte) error { + var res Version + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_capacity_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_capacity_post_parameters.go new file mode 100644 index 0000000000..ca58eaa612 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_capacity_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceCounterCacheCapacityPostParams creates a new CacheServiceCounterCacheCapacityPostParams object +// with the default values initialized. +func NewCacheServiceCounterCacheCapacityPostParams() *CacheServiceCounterCacheCapacityPostParams { + var () + return &CacheServiceCounterCacheCapacityPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceCounterCacheCapacityPostParamsWithTimeout creates a new CacheServiceCounterCacheCapacityPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceCounterCacheCapacityPostParamsWithTimeout(timeout time.Duration) *CacheServiceCounterCacheCapacityPostParams { + var () + return &CacheServiceCounterCacheCapacityPostParams{ + + timeout: timeout, + } +} + +// NewCacheServiceCounterCacheCapacityPostParamsWithContext creates a new CacheServiceCounterCacheCapacityPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceCounterCacheCapacityPostParamsWithContext(ctx context.Context) *CacheServiceCounterCacheCapacityPostParams { + var () + return &CacheServiceCounterCacheCapacityPostParams{ + + Context: ctx, + } +} + +// NewCacheServiceCounterCacheCapacityPostParamsWithHTTPClient creates a new CacheServiceCounterCacheCapacityPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceCounterCacheCapacityPostParamsWithHTTPClient(client *http.Client) *CacheServiceCounterCacheCapacityPostParams { + var () + return &CacheServiceCounterCacheCapacityPostParams{ + HTTPClient: client, + } +} + +/* +CacheServiceCounterCacheCapacityPostParams contains all the parameters to send to the API endpoint +for the cache service counter cache capacity post operation typically these are written to a http.Request +*/ +type CacheServiceCounterCacheCapacityPostParams struct { + + /*Capacity + counter cache capacity in mb + + */ + Capacity string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service counter cache capacity post params +func (o *CacheServiceCounterCacheCapacityPostParams) WithTimeout(timeout time.Duration) *CacheServiceCounterCacheCapacityPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service counter cache capacity post params +func (o *CacheServiceCounterCacheCapacityPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service counter cache capacity post params +func (o *CacheServiceCounterCacheCapacityPostParams) WithContext(ctx context.Context) *CacheServiceCounterCacheCapacityPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service counter cache capacity post params +func (o *CacheServiceCounterCacheCapacityPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service counter cache capacity post params +func (o *CacheServiceCounterCacheCapacityPostParams) WithHTTPClient(client *http.Client) *CacheServiceCounterCacheCapacityPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service counter cache capacity post params +func (o *CacheServiceCounterCacheCapacityPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCapacity adds the capacity to the cache service counter cache capacity post params +func (o *CacheServiceCounterCacheCapacityPostParams) WithCapacity(capacity string) *CacheServiceCounterCacheCapacityPostParams { + o.SetCapacity(capacity) + return o +} + +// SetCapacity adds the capacity to the cache service counter cache capacity post params +func (o *CacheServiceCounterCacheCapacityPostParams) SetCapacity(capacity string) { + o.Capacity = capacity +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceCounterCacheCapacityPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param capacity + qrCapacity := o.Capacity + qCapacity := qrCapacity + if qCapacity != "" { + if err := r.SetQueryParam("capacity", qCapacity); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_capacity_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_capacity_post_responses.go new file mode 100644 index 0000000000..e91ebc2de9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_capacity_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceCounterCacheCapacityPostReader is a Reader for the CacheServiceCounterCacheCapacityPost structure. +type CacheServiceCounterCacheCapacityPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceCounterCacheCapacityPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceCounterCacheCapacityPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceCounterCacheCapacityPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceCounterCacheCapacityPostOK creates a CacheServiceCounterCacheCapacityPostOK with default headers values +func NewCacheServiceCounterCacheCapacityPostOK() *CacheServiceCounterCacheCapacityPostOK { + return &CacheServiceCounterCacheCapacityPostOK{} +} + +/* +CacheServiceCounterCacheCapacityPostOK handles this case with default header values. + +Success +*/ +type CacheServiceCounterCacheCapacityPostOK struct { +} + +func (o *CacheServiceCounterCacheCapacityPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCacheServiceCounterCacheCapacityPostDefault creates a CacheServiceCounterCacheCapacityPostDefault with default headers values +func NewCacheServiceCounterCacheCapacityPostDefault(code int) *CacheServiceCounterCacheCapacityPostDefault { + return &CacheServiceCounterCacheCapacityPostDefault{ + _statusCode: code, + } +} + +/* +CacheServiceCounterCacheCapacityPostDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceCounterCacheCapacityPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service counter cache capacity post default response +func (o *CacheServiceCounterCacheCapacityPostDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceCounterCacheCapacityPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceCounterCacheCapacityPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceCounterCacheCapacityPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_keys_to_save_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_keys_to_save_get_parameters.go new file mode 100644 index 0000000000..fca4c32f19 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_keys_to_save_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceCounterCacheKeysToSaveGetParams creates a new CacheServiceCounterCacheKeysToSaveGetParams object +// with the default values initialized. +func NewCacheServiceCounterCacheKeysToSaveGetParams() *CacheServiceCounterCacheKeysToSaveGetParams { + + return &CacheServiceCounterCacheKeysToSaveGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceCounterCacheKeysToSaveGetParamsWithTimeout creates a new CacheServiceCounterCacheKeysToSaveGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceCounterCacheKeysToSaveGetParamsWithTimeout(timeout time.Duration) *CacheServiceCounterCacheKeysToSaveGetParams { + + return &CacheServiceCounterCacheKeysToSaveGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceCounterCacheKeysToSaveGetParamsWithContext creates a new CacheServiceCounterCacheKeysToSaveGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceCounterCacheKeysToSaveGetParamsWithContext(ctx context.Context) *CacheServiceCounterCacheKeysToSaveGetParams { + + return &CacheServiceCounterCacheKeysToSaveGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceCounterCacheKeysToSaveGetParamsWithHTTPClient creates a new CacheServiceCounterCacheKeysToSaveGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceCounterCacheKeysToSaveGetParamsWithHTTPClient(client *http.Client) *CacheServiceCounterCacheKeysToSaveGetParams { + + return &CacheServiceCounterCacheKeysToSaveGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceCounterCacheKeysToSaveGetParams contains all the parameters to send to the API endpoint +for the cache service counter cache keys to save get operation typically these are written to a http.Request +*/ +type CacheServiceCounterCacheKeysToSaveGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service counter cache keys to save get params +func (o *CacheServiceCounterCacheKeysToSaveGetParams) WithTimeout(timeout time.Duration) *CacheServiceCounterCacheKeysToSaveGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service counter cache keys to save get params +func (o *CacheServiceCounterCacheKeysToSaveGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service counter cache keys to save get params +func (o *CacheServiceCounterCacheKeysToSaveGetParams) WithContext(ctx context.Context) *CacheServiceCounterCacheKeysToSaveGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service counter cache keys to save get params +func (o *CacheServiceCounterCacheKeysToSaveGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service counter cache keys to save get params +func (o *CacheServiceCounterCacheKeysToSaveGetParams) WithHTTPClient(client *http.Client) *CacheServiceCounterCacheKeysToSaveGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service counter cache keys to save get params +func (o *CacheServiceCounterCacheKeysToSaveGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceCounterCacheKeysToSaveGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_keys_to_save_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_keys_to_save_get_responses.go new file mode 100644 index 0000000000..fa36173b91 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_keys_to_save_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceCounterCacheKeysToSaveGetReader is a Reader for the CacheServiceCounterCacheKeysToSaveGet structure. +type CacheServiceCounterCacheKeysToSaveGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceCounterCacheKeysToSaveGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceCounterCacheKeysToSaveGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceCounterCacheKeysToSaveGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceCounterCacheKeysToSaveGetOK creates a CacheServiceCounterCacheKeysToSaveGetOK with default headers values +func NewCacheServiceCounterCacheKeysToSaveGetOK() *CacheServiceCounterCacheKeysToSaveGetOK { + return &CacheServiceCounterCacheKeysToSaveGetOK{} +} + +/* +CacheServiceCounterCacheKeysToSaveGetOK handles this case with default header values. + +Success +*/ +type CacheServiceCounterCacheKeysToSaveGetOK struct { + Payload int32 +} + +func (o *CacheServiceCounterCacheKeysToSaveGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *CacheServiceCounterCacheKeysToSaveGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceCounterCacheKeysToSaveGetDefault creates a CacheServiceCounterCacheKeysToSaveGetDefault with default headers values +func NewCacheServiceCounterCacheKeysToSaveGetDefault(code int) *CacheServiceCounterCacheKeysToSaveGetDefault { + return &CacheServiceCounterCacheKeysToSaveGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceCounterCacheKeysToSaveGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceCounterCacheKeysToSaveGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service counter cache keys to save get default response +func (o *CacheServiceCounterCacheKeysToSaveGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceCounterCacheKeysToSaveGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceCounterCacheKeysToSaveGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceCounterCacheKeysToSaveGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_keys_to_save_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_keys_to_save_post_parameters.go new file mode 100644 index 0000000000..50c2cf28af --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_keys_to_save_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCacheServiceCounterCacheKeysToSavePostParams creates a new CacheServiceCounterCacheKeysToSavePostParams object +// with the default values initialized. +func NewCacheServiceCounterCacheKeysToSavePostParams() *CacheServiceCounterCacheKeysToSavePostParams { + var () + return &CacheServiceCounterCacheKeysToSavePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceCounterCacheKeysToSavePostParamsWithTimeout creates a new CacheServiceCounterCacheKeysToSavePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceCounterCacheKeysToSavePostParamsWithTimeout(timeout time.Duration) *CacheServiceCounterCacheKeysToSavePostParams { + var () + return &CacheServiceCounterCacheKeysToSavePostParams{ + + timeout: timeout, + } +} + +// NewCacheServiceCounterCacheKeysToSavePostParamsWithContext creates a new CacheServiceCounterCacheKeysToSavePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceCounterCacheKeysToSavePostParamsWithContext(ctx context.Context) *CacheServiceCounterCacheKeysToSavePostParams { + var () + return &CacheServiceCounterCacheKeysToSavePostParams{ + + Context: ctx, + } +} + +// NewCacheServiceCounterCacheKeysToSavePostParamsWithHTTPClient creates a new CacheServiceCounterCacheKeysToSavePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceCounterCacheKeysToSavePostParamsWithHTTPClient(client *http.Client) *CacheServiceCounterCacheKeysToSavePostParams { + var () + return &CacheServiceCounterCacheKeysToSavePostParams{ + HTTPClient: client, + } +} + +/* +CacheServiceCounterCacheKeysToSavePostParams contains all the parameters to send to the API endpoint +for the cache service counter cache keys to save post operation typically these are written to a http.Request +*/ +type CacheServiceCounterCacheKeysToSavePostParams struct { + + /*Cckts + counter cache keys to save + + */ + Cckts int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service counter cache keys to save post params +func (o *CacheServiceCounterCacheKeysToSavePostParams) WithTimeout(timeout time.Duration) *CacheServiceCounterCacheKeysToSavePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service counter cache keys to save post params +func (o *CacheServiceCounterCacheKeysToSavePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service counter cache keys to save post params +func (o *CacheServiceCounterCacheKeysToSavePostParams) WithContext(ctx context.Context) *CacheServiceCounterCacheKeysToSavePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service counter cache keys to save post params +func (o *CacheServiceCounterCacheKeysToSavePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service counter cache keys to save post params +func (o *CacheServiceCounterCacheKeysToSavePostParams) WithHTTPClient(client *http.Client) *CacheServiceCounterCacheKeysToSavePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service counter cache keys to save post params +func (o *CacheServiceCounterCacheKeysToSavePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCckts adds the cckts to the cache service counter cache keys to save post params +func (o *CacheServiceCounterCacheKeysToSavePostParams) WithCckts(cckts int32) *CacheServiceCounterCacheKeysToSavePostParams { + o.SetCckts(cckts) + return o +} + +// SetCckts adds the cckts to the cache service counter cache keys to save post params +func (o *CacheServiceCounterCacheKeysToSavePostParams) SetCckts(cckts int32) { + o.Cckts = cckts +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceCounterCacheKeysToSavePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param cckts + qrCckts := o.Cckts + qCckts := swag.FormatInt32(qrCckts) + if qCckts != "" { + if err := r.SetQueryParam("cckts", qCckts); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_keys_to_save_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_keys_to_save_post_responses.go new file mode 100644 index 0000000000..ac59b474c9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_keys_to_save_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceCounterCacheKeysToSavePostReader is a Reader for the CacheServiceCounterCacheKeysToSavePost structure. +type CacheServiceCounterCacheKeysToSavePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceCounterCacheKeysToSavePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceCounterCacheKeysToSavePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceCounterCacheKeysToSavePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceCounterCacheKeysToSavePostOK creates a CacheServiceCounterCacheKeysToSavePostOK with default headers values +func NewCacheServiceCounterCacheKeysToSavePostOK() *CacheServiceCounterCacheKeysToSavePostOK { + return &CacheServiceCounterCacheKeysToSavePostOK{} +} + +/* +CacheServiceCounterCacheKeysToSavePostOK handles this case with default header values. + +Success +*/ +type CacheServiceCounterCacheKeysToSavePostOK struct { +} + +func (o *CacheServiceCounterCacheKeysToSavePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCacheServiceCounterCacheKeysToSavePostDefault creates a CacheServiceCounterCacheKeysToSavePostDefault with default headers values +func NewCacheServiceCounterCacheKeysToSavePostDefault(code int) *CacheServiceCounterCacheKeysToSavePostDefault { + return &CacheServiceCounterCacheKeysToSavePostDefault{ + _statusCode: code, + } +} + +/* +CacheServiceCounterCacheKeysToSavePostDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceCounterCacheKeysToSavePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service counter cache keys to save post default response +func (o *CacheServiceCounterCacheKeysToSavePostDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceCounterCacheKeysToSavePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceCounterCacheKeysToSavePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceCounterCacheKeysToSavePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_save_period_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_save_period_get_parameters.go new file mode 100644 index 0000000000..0a1a26534d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_save_period_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceCounterCacheSavePeriodGetParams creates a new CacheServiceCounterCacheSavePeriodGetParams object +// with the default values initialized. +func NewCacheServiceCounterCacheSavePeriodGetParams() *CacheServiceCounterCacheSavePeriodGetParams { + + return &CacheServiceCounterCacheSavePeriodGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceCounterCacheSavePeriodGetParamsWithTimeout creates a new CacheServiceCounterCacheSavePeriodGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceCounterCacheSavePeriodGetParamsWithTimeout(timeout time.Duration) *CacheServiceCounterCacheSavePeriodGetParams { + + return &CacheServiceCounterCacheSavePeriodGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceCounterCacheSavePeriodGetParamsWithContext creates a new CacheServiceCounterCacheSavePeriodGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceCounterCacheSavePeriodGetParamsWithContext(ctx context.Context) *CacheServiceCounterCacheSavePeriodGetParams { + + return &CacheServiceCounterCacheSavePeriodGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceCounterCacheSavePeriodGetParamsWithHTTPClient creates a new CacheServiceCounterCacheSavePeriodGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceCounterCacheSavePeriodGetParamsWithHTTPClient(client *http.Client) *CacheServiceCounterCacheSavePeriodGetParams { + + return &CacheServiceCounterCacheSavePeriodGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceCounterCacheSavePeriodGetParams contains all the parameters to send to the API endpoint +for the cache service counter cache save period get operation typically these are written to a http.Request +*/ +type CacheServiceCounterCacheSavePeriodGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service counter cache save period get params +func (o *CacheServiceCounterCacheSavePeriodGetParams) WithTimeout(timeout time.Duration) *CacheServiceCounterCacheSavePeriodGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service counter cache save period get params +func (o *CacheServiceCounterCacheSavePeriodGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service counter cache save period get params +func (o *CacheServiceCounterCacheSavePeriodGetParams) WithContext(ctx context.Context) *CacheServiceCounterCacheSavePeriodGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service counter cache save period get params +func (o *CacheServiceCounterCacheSavePeriodGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service counter cache save period get params +func (o *CacheServiceCounterCacheSavePeriodGetParams) WithHTTPClient(client *http.Client) *CacheServiceCounterCacheSavePeriodGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service counter cache save period get params +func (o *CacheServiceCounterCacheSavePeriodGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceCounterCacheSavePeriodGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_save_period_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_save_period_get_responses.go new file mode 100644 index 0000000000..5eed411fb9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_save_period_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceCounterCacheSavePeriodGetReader is a Reader for the CacheServiceCounterCacheSavePeriodGet structure. +type CacheServiceCounterCacheSavePeriodGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceCounterCacheSavePeriodGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceCounterCacheSavePeriodGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceCounterCacheSavePeriodGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceCounterCacheSavePeriodGetOK creates a CacheServiceCounterCacheSavePeriodGetOK with default headers values +func NewCacheServiceCounterCacheSavePeriodGetOK() *CacheServiceCounterCacheSavePeriodGetOK { + return &CacheServiceCounterCacheSavePeriodGetOK{} +} + +/* +CacheServiceCounterCacheSavePeriodGetOK handles this case with default header values. + +Success +*/ +type CacheServiceCounterCacheSavePeriodGetOK struct { + Payload int32 +} + +func (o *CacheServiceCounterCacheSavePeriodGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *CacheServiceCounterCacheSavePeriodGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceCounterCacheSavePeriodGetDefault creates a CacheServiceCounterCacheSavePeriodGetDefault with default headers values +func NewCacheServiceCounterCacheSavePeriodGetDefault(code int) *CacheServiceCounterCacheSavePeriodGetDefault { + return &CacheServiceCounterCacheSavePeriodGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceCounterCacheSavePeriodGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceCounterCacheSavePeriodGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service counter cache save period get default response +func (o *CacheServiceCounterCacheSavePeriodGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceCounterCacheSavePeriodGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceCounterCacheSavePeriodGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceCounterCacheSavePeriodGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_save_period_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_save_period_post_parameters.go new file mode 100644 index 0000000000..2ddcb32219 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_save_period_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCacheServiceCounterCacheSavePeriodPostParams creates a new CacheServiceCounterCacheSavePeriodPostParams object +// with the default values initialized. +func NewCacheServiceCounterCacheSavePeriodPostParams() *CacheServiceCounterCacheSavePeriodPostParams { + var () + return &CacheServiceCounterCacheSavePeriodPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceCounterCacheSavePeriodPostParamsWithTimeout creates a new CacheServiceCounterCacheSavePeriodPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceCounterCacheSavePeriodPostParamsWithTimeout(timeout time.Duration) *CacheServiceCounterCacheSavePeriodPostParams { + var () + return &CacheServiceCounterCacheSavePeriodPostParams{ + + timeout: timeout, + } +} + +// NewCacheServiceCounterCacheSavePeriodPostParamsWithContext creates a new CacheServiceCounterCacheSavePeriodPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceCounterCacheSavePeriodPostParamsWithContext(ctx context.Context) *CacheServiceCounterCacheSavePeriodPostParams { + var () + return &CacheServiceCounterCacheSavePeriodPostParams{ + + Context: ctx, + } +} + +// NewCacheServiceCounterCacheSavePeriodPostParamsWithHTTPClient creates a new CacheServiceCounterCacheSavePeriodPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceCounterCacheSavePeriodPostParamsWithHTTPClient(client *http.Client) *CacheServiceCounterCacheSavePeriodPostParams { + var () + return &CacheServiceCounterCacheSavePeriodPostParams{ + HTTPClient: client, + } +} + +/* +CacheServiceCounterCacheSavePeriodPostParams contains all the parameters to send to the API endpoint +for the cache service counter cache save period post operation typically these are written to a http.Request +*/ +type CacheServiceCounterCacheSavePeriodPostParams struct { + + /*Ccspis + counter cache save period in seconds + + */ + Ccspis int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service counter cache save period post params +func (o *CacheServiceCounterCacheSavePeriodPostParams) WithTimeout(timeout time.Duration) *CacheServiceCounterCacheSavePeriodPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service counter cache save period post params +func (o *CacheServiceCounterCacheSavePeriodPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service counter cache save period post params +func (o *CacheServiceCounterCacheSavePeriodPostParams) WithContext(ctx context.Context) *CacheServiceCounterCacheSavePeriodPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service counter cache save period post params +func (o *CacheServiceCounterCacheSavePeriodPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service counter cache save period post params +func (o *CacheServiceCounterCacheSavePeriodPostParams) WithHTTPClient(client *http.Client) *CacheServiceCounterCacheSavePeriodPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service counter cache save period post params +func (o *CacheServiceCounterCacheSavePeriodPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCcspis adds the ccspis to the cache service counter cache save period post params +func (o *CacheServiceCounterCacheSavePeriodPostParams) WithCcspis(ccspis int32) *CacheServiceCounterCacheSavePeriodPostParams { + o.SetCcspis(ccspis) + return o +} + +// SetCcspis adds the ccspis to the cache service counter cache save period post params +func (o *CacheServiceCounterCacheSavePeriodPostParams) SetCcspis(ccspis int32) { + o.Ccspis = ccspis +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceCounterCacheSavePeriodPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param ccspis + qrCcspis := o.Ccspis + qCcspis := swag.FormatInt32(qrCcspis) + if qCcspis != "" { + if err := r.SetQueryParam("ccspis", qCcspis); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_save_period_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_save_period_post_responses.go new file mode 100644 index 0000000000..642d0169d5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_counter_cache_save_period_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceCounterCacheSavePeriodPostReader is a Reader for the CacheServiceCounterCacheSavePeriodPost structure. +type CacheServiceCounterCacheSavePeriodPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceCounterCacheSavePeriodPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceCounterCacheSavePeriodPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceCounterCacheSavePeriodPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceCounterCacheSavePeriodPostOK creates a CacheServiceCounterCacheSavePeriodPostOK with default headers values +func NewCacheServiceCounterCacheSavePeriodPostOK() *CacheServiceCounterCacheSavePeriodPostOK { + return &CacheServiceCounterCacheSavePeriodPostOK{} +} + +/* +CacheServiceCounterCacheSavePeriodPostOK handles this case with default header values. + +Success +*/ +type CacheServiceCounterCacheSavePeriodPostOK struct { +} + +func (o *CacheServiceCounterCacheSavePeriodPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCacheServiceCounterCacheSavePeriodPostDefault creates a CacheServiceCounterCacheSavePeriodPostDefault with default headers values +func NewCacheServiceCounterCacheSavePeriodPostDefault(code int) *CacheServiceCounterCacheSavePeriodPostDefault { + return &CacheServiceCounterCacheSavePeriodPostDefault{ + _statusCode: code, + } +} + +/* +CacheServiceCounterCacheSavePeriodPostDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceCounterCacheSavePeriodPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service counter cache save period post default response +func (o *CacheServiceCounterCacheSavePeriodPostDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceCounterCacheSavePeriodPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceCounterCacheSavePeriodPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceCounterCacheSavePeriodPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_invalidate_counter_cache_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_invalidate_counter_cache_post_parameters.go new file mode 100644 index 0000000000..82975a0bed --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_invalidate_counter_cache_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceInvalidateCounterCachePostParams creates a new CacheServiceInvalidateCounterCachePostParams object +// with the default values initialized. +func NewCacheServiceInvalidateCounterCachePostParams() *CacheServiceInvalidateCounterCachePostParams { + + return &CacheServiceInvalidateCounterCachePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceInvalidateCounterCachePostParamsWithTimeout creates a new CacheServiceInvalidateCounterCachePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceInvalidateCounterCachePostParamsWithTimeout(timeout time.Duration) *CacheServiceInvalidateCounterCachePostParams { + + return &CacheServiceInvalidateCounterCachePostParams{ + + timeout: timeout, + } +} + +// NewCacheServiceInvalidateCounterCachePostParamsWithContext creates a new CacheServiceInvalidateCounterCachePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceInvalidateCounterCachePostParamsWithContext(ctx context.Context) *CacheServiceInvalidateCounterCachePostParams { + + return &CacheServiceInvalidateCounterCachePostParams{ + + Context: ctx, + } +} + +// NewCacheServiceInvalidateCounterCachePostParamsWithHTTPClient creates a new CacheServiceInvalidateCounterCachePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceInvalidateCounterCachePostParamsWithHTTPClient(client *http.Client) *CacheServiceInvalidateCounterCachePostParams { + + return &CacheServiceInvalidateCounterCachePostParams{ + HTTPClient: client, + } +} + +/* +CacheServiceInvalidateCounterCachePostParams contains all the parameters to send to the API endpoint +for the cache service invalidate counter cache post operation typically these are written to a http.Request +*/ +type CacheServiceInvalidateCounterCachePostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service invalidate counter cache post params +func (o *CacheServiceInvalidateCounterCachePostParams) WithTimeout(timeout time.Duration) *CacheServiceInvalidateCounterCachePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service invalidate counter cache post params +func (o *CacheServiceInvalidateCounterCachePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service invalidate counter cache post params +func (o *CacheServiceInvalidateCounterCachePostParams) WithContext(ctx context.Context) *CacheServiceInvalidateCounterCachePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service invalidate counter cache post params +func (o *CacheServiceInvalidateCounterCachePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service invalidate counter cache post params +func (o *CacheServiceInvalidateCounterCachePostParams) WithHTTPClient(client *http.Client) *CacheServiceInvalidateCounterCachePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service invalidate counter cache post params +func (o *CacheServiceInvalidateCounterCachePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceInvalidateCounterCachePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_invalidate_counter_cache_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_invalidate_counter_cache_post_responses.go new file mode 100644 index 0000000000..60412d25f9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_invalidate_counter_cache_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceInvalidateCounterCachePostReader is a Reader for the CacheServiceInvalidateCounterCachePost structure. +type CacheServiceInvalidateCounterCachePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceInvalidateCounterCachePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceInvalidateCounterCachePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceInvalidateCounterCachePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceInvalidateCounterCachePostOK creates a CacheServiceInvalidateCounterCachePostOK with default headers values +func NewCacheServiceInvalidateCounterCachePostOK() *CacheServiceInvalidateCounterCachePostOK { + return &CacheServiceInvalidateCounterCachePostOK{} +} + +/* +CacheServiceInvalidateCounterCachePostOK handles this case with default header values. + +Success +*/ +type CacheServiceInvalidateCounterCachePostOK struct { +} + +func (o *CacheServiceInvalidateCounterCachePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCacheServiceInvalidateCounterCachePostDefault creates a CacheServiceInvalidateCounterCachePostDefault with default headers values +func NewCacheServiceInvalidateCounterCachePostDefault(code int) *CacheServiceInvalidateCounterCachePostDefault { + return &CacheServiceInvalidateCounterCachePostDefault{ + _statusCode: code, + } +} + +/* +CacheServiceInvalidateCounterCachePostDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceInvalidateCounterCachePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service invalidate counter cache post default response +func (o *CacheServiceInvalidateCounterCachePostDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceInvalidateCounterCachePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceInvalidateCounterCachePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceInvalidateCounterCachePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_invalidate_key_cache_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_invalidate_key_cache_post_parameters.go new file mode 100644 index 0000000000..24c300a52c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_invalidate_key_cache_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceInvalidateKeyCachePostParams creates a new CacheServiceInvalidateKeyCachePostParams object +// with the default values initialized. +func NewCacheServiceInvalidateKeyCachePostParams() *CacheServiceInvalidateKeyCachePostParams { + + return &CacheServiceInvalidateKeyCachePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceInvalidateKeyCachePostParamsWithTimeout creates a new CacheServiceInvalidateKeyCachePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceInvalidateKeyCachePostParamsWithTimeout(timeout time.Duration) *CacheServiceInvalidateKeyCachePostParams { + + return &CacheServiceInvalidateKeyCachePostParams{ + + timeout: timeout, + } +} + +// NewCacheServiceInvalidateKeyCachePostParamsWithContext creates a new CacheServiceInvalidateKeyCachePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceInvalidateKeyCachePostParamsWithContext(ctx context.Context) *CacheServiceInvalidateKeyCachePostParams { + + return &CacheServiceInvalidateKeyCachePostParams{ + + Context: ctx, + } +} + +// NewCacheServiceInvalidateKeyCachePostParamsWithHTTPClient creates a new CacheServiceInvalidateKeyCachePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceInvalidateKeyCachePostParamsWithHTTPClient(client *http.Client) *CacheServiceInvalidateKeyCachePostParams { + + return &CacheServiceInvalidateKeyCachePostParams{ + HTTPClient: client, + } +} + +/* +CacheServiceInvalidateKeyCachePostParams contains all the parameters to send to the API endpoint +for the cache service invalidate key cache post operation typically these are written to a http.Request +*/ +type CacheServiceInvalidateKeyCachePostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service invalidate key cache post params +func (o *CacheServiceInvalidateKeyCachePostParams) WithTimeout(timeout time.Duration) *CacheServiceInvalidateKeyCachePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service invalidate key cache post params +func (o *CacheServiceInvalidateKeyCachePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service invalidate key cache post params +func (o *CacheServiceInvalidateKeyCachePostParams) WithContext(ctx context.Context) *CacheServiceInvalidateKeyCachePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service invalidate key cache post params +func (o *CacheServiceInvalidateKeyCachePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service invalidate key cache post params +func (o *CacheServiceInvalidateKeyCachePostParams) WithHTTPClient(client *http.Client) *CacheServiceInvalidateKeyCachePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service invalidate key cache post params +func (o *CacheServiceInvalidateKeyCachePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceInvalidateKeyCachePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_invalidate_key_cache_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_invalidate_key_cache_post_responses.go new file mode 100644 index 0000000000..8da9cda092 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_invalidate_key_cache_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceInvalidateKeyCachePostReader is a Reader for the CacheServiceInvalidateKeyCachePost structure. +type CacheServiceInvalidateKeyCachePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceInvalidateKeyCachePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceInvalidateKeyCachePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceInvalidateKeyCachePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceInvalidateKeyCachePostOK creates a CacheServiceInvalidateKeyCachePostOK with default headers values +func NewCacheServiceInvalidateKeyCachePostOK() *CacheServiceInvalidateKeyCachePostOK { + return &CacheServiceInvalidateKeyCachePostOK{} +} + +/* +CacheServiceInvalidateKeyCachePostOK handles this case with default header values. + +Success +*/ +type CacheServiceInvalidateKeyCachePostOK struct { +} + +func (o *CacheServiceInvalidateKeyCachePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCacheServiceInvalidateKeyCachePostDefault creates a CacheServiceInvalidateKeyCachePostDefault with default headers values +func NewCacheServiceInvalidateKeyCachePostDefault(code int) *CacheServiceInvalidateKeyCachePostDefault { + return &CacheServiceInvalidateKeyCachePostDefault{ + _statusCode: code, + } +} + +/* +CacheServiceInvalidateKeyCachePostDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceInvalidateKeyCachePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service invalidate key cache post default response +func (o *CacheServiceInvalidateKeyCachePostDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceInvalidateKeyCachePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceInvalidateKeyCachePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceInvalidateKeyCachePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_capacity_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_capacity_post_parameters.go new file mode 100644 index 0000000000..3c6b602649 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_capacity_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceKeyCacheCapacityPostParams creates a new CacheServiceKeyCacheCapacityPostParams object +// with the default values initialized. +func NewCacheServiceKeyCacheCapacityPostParams() *CacheServiceKeyCacheCapacityPostParams { + var () + return &CacheServiceKeyCacheCapacityPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceKeyCacheCapacityPostParamsWithTimeout creates a new CacheServiceKeyCacheCapacityPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceKeyCacheCapacityPostParamsWithTimeout(timeout time.Duration) *CacheServiceKeyCacheCapacityPostParams { + var () + return &CacheServiceKeyCacheCapacityPostParams{ + + timeout: timeout, + } +} + +// NewCacheServiceKeyCacheCapacityPostParamsWithContext creates a new CacheServiceKeyCacheCapacityPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceKeyCacheCapacityPostParamsWithContext(ctx context.Context) *CacheServiceKeyCacheCapacityPostParams { + var () + return &CacheServiceKeyCacheCapacityPostParams{ + + Context: ctx, + } +} + +// NewCacheServiceKeyCacheCapacityPostParamsWithHTTPClient creates a new CacheServiceKeyCacheCapacityPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceKeyCacheCapacityPostParamsWithHTTPClient(client *http.Client) *CacheServiceKeyCacheCapacityPostParams { + var () + return &CacheServiceKeyCacheCapacityPostParams{ + HTTPClient: client, + } +} + +/* +CacheServiceKeyCacheCapacityPostParams contains all the parameters to send to the API endpoint +for the cache service key cache capacity post operation typically these are written to a http.Request +*/ +type CacheServiceKeyCacheCapacityPostParams struct { + + /*Capacity + key cache capacity in mb + + */ + Capacity string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service key cache capacity post params +func (o *CacheServiceKeyCacheCapacityPostParams) WithTimeout(timeout time.Duration) *CacheServiceKeyCacheCapacityPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service key cache capacity post params +func (o *CacheServiceKeyCacheCapacityPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service key cache capacity post params +func (o *CacheServiceKeyCacheCapacityPostParams) WithContext(ctx context.Context) *CacheServiceKeyCacheCapacityPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service key cache capacity post params +func (o *CacheServiceKeyCacheCapacityPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service key cache capacity post params +func (o *CacheServiceKeyCacheCapacityPostParams) WithHTTPClient(client *http.Client) *CacheServiceKeyCacheCapacityPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service key cache capacity post params +func (o *CacheServiceKeyCacheCapacityPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCapacity adds the capacity to the cache service key cache capacity post params +func (o *CacheServiceKeyCacheCapacityPostParams) WithCapacity(capacity string) *CacheServiceKeyCacheCapacityPostParams { + o.SetCapacity(capacity) + return o +} + +// SetCapacity adds the capacity to the cache service key cache capacity post params +func (o *CacheServiceKeyCacheCapacityPostParams) SetCapacity(capacity string) { + o.Capacity = capacity +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceKeyCacheCapacityPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param capacity + qrCapacity := o.Capacity + qCapacity := qrCapacity + if qCapacity != "" { + if err := r.SetQueryParam("capacity", qCapacity); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_capacity_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_capacity_post_responses.go new file mode 100644 index 0000000000..fddf204c98 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_capacity_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceKeyCacheCapacityPostReader is a Reader for the CacheServiceKeyCacheCapacityPost structure. +type CacheServiceKeyCacheCapacityPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceKeyCacheCapacityPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceKeyCacheCapacityPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceKeyCacheCapacityPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceKeyCacheCapacityPostOK creates a CacheServiceKeyCacheCapacityPostOK with default headers values +func NewCacheServiceKeyCacheCapacityPostOK() *CacheServiceKeyCacheCapacityPostOK { + return &CacheServiceKeyCacheCapacityPostOK{} +} + +/* +CacheServiceKeyCacheCapacityPostOK handles this case with default header values. + +Success +*/ +type CacheServiceKeyCacheCapacityPostOK struct { +} + +func (o *CacheServiceKeyCacheCapacityPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCacheServiceKeyCacheCapacityPostDefault creates a CacheServiceKeyCacheCapacityPostDefault with default headers values +func NewCacheServiceKeyCacheCapacityPostDefault(code int) *CacheServiceKeyCacheCapacityPostDefault { + return &CacheServiceKeyCacheCapacityPostDefault{ + _statusCode: code, + } +} + +/* +CacheServiceKeyCacheCapacityPostDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceKeyCacheCapacityPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service key cache capacity post default response +func (o *CacheServiceKeyCacheCapacityPostDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceKeyCacheCapacityPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceKeyCacheCapacityPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceKeyCacheCapacityPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_keys_to_save_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_keys_to_save_get_parameters.go new file mode 100644 index 0000000000..abb4316d23 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_keys_to_save_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceKeyCacheKeysToSaveGetParams creates a new CacheServiceKeyCacheKeysToSaveGetParams object +// with the default values initialized. +func NewCacheServiceKeyCacheKeysToSaveGetParams() *CacheServiceKeyCacheKeysToSaveGetParams { + + return &CacheServiceKeyCacheKeysToSaveGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceKeyCacheKeysToSaveGetParamsWithTimeout creates a new CacheServiceKeyCacheKeysToSaveGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceKeyCacheKeysToSaveGetParamsWithTimeout(timeout time.Duration) *CacheServiceKeyCacheKeysToSaveGetParams { + + return &CacheServiceKeyCacheKeysToSaveGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceKeyCacheKeysToSaveGetParamsWithContext creates a new CacheServiceKeyCacheKeysToSaveGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceKeyCacheKeysToSaveGetParamsWithContext(ctx context.Context) *CacheServiceKeyCacheKeysToSaveGetParams { + + return &CacheServiceKeyCacheKeysToSaveGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceKeyCacheKeysToSaveGetParamsWithHTTPClient creates a new CacheServiceKeyCacheKeysToSaveGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceKeyCacheKeysToSaveGetParamsWithHTTPClient(client *http.Client) *CacheServiceKeyCacheKeysToSaveGetParams { + + return &CacheServiceKeyCacheKeysToSaveGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceKeyCacheKeysToSaveGetParams contains all the parameters to send to the API endpoint +for the cache service key cache keys to save get operation typically these are written to a http.Request +*/ +type CacheServiceKeyCacheKeysToSaveGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service key cache keys to save get params +func (o *CacheServiceKeyCacheKeysToSaveGetParams) WithTimeout(timeout time.Duration) *CacheServiceKeyCacheKeysToSaveGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service key cache keys to save get params +func (o *CacheServiceKeyCacheKeysToSaveGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service key cache keys to save get params +func (o *CacheServiceKeyCacheKeysToSaveGetParams) WithContext(ctx context.Context) *CacheServiceKeyCacheKeysToSaveGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service key cache keys to save get params +func (o *CacheServiceKeyCacheKeysToSaveGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service key cache keys to save get params +func (o *CacheServiceKeyCacheKeysToSaveGetParams) WithHTTPClient(client *http.Client) *CacheServiceKeyCacheKeysToSaveGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service key cache keys to save get params +func (o *CacheServiceKeyCacheKeysToSaveGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceKeyCacheKeysToSaveGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_keys_to_save_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_keys_to_save_get_responses.go new file mode 100644 index 0000000000..f201bc813d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_keys_to_save_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceKeyCacheKeysToSaveGetReader is a Reader for the CacheServiceKeyCacheKeysToSaveGet structure. +type CacheServiceKeyCacheKeysToSaveGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceKeyCacheKeysToSaveGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceKeyCacheKeysToSaveGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceKeyCacheKeysToSaveGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceKeyCacheKeysToSaveGetOK creates a CacheServiceKeyCacheKeysToSaveGetOK with default headers values +func NewCacheServiceKeyCacheKeysToSaveGetOK() *CacheServiceKeyCacheKeysToSaveGetOK { + return &CacheServiceKeyCacheKeysToSaveGetOK{} +} + +/* +CacheServiceKeyCacheKeysToSaveGetOK handles this case with default header values. + +Success +*/ +type CacheServiceKeyCacheKeysToSaveGetOK struct { + Payload int32 +} + +func (o *CacheServiceKeyCacheKeysToSaveGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *CacheServiceKeyCacheKeysToSaveGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceKeyCacheKeysToSaveGetDefault creates a CacheServiceKeyCacheKeysToSaveGetDefault with default headers values +func NewCacheServiceKeyCacheKeysToSaveGetDefault(code int) *CacheServiceKeyCacheKeysToSaveGetDefault { + return &CacheServiceKeyCacheKeysToSaveGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceKeyCacheKeysToSaveGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceKeyCacheKeysToSaveGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service key cache keys to save get default response +func (o *CacheServiceKeyCacheKeysToSaveGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceKeyCacheKeysToSaveGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceKeyCacheKeysToSaveGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceKeyCacheKeysToSaveGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_keys_to_save_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_keys_to_save_post_parameters.go new file mode 100644 index 0000000000..9201d6d1bc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_keys_to_save_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCacheServiceKeyCacheKeysToSavePostParams creates a new CacheServiceKeyCacheKeysToSavePostParams object +// with the default values initialized. +func NewCacheServiceKeyCacheKeysToSavePostParams() *CacheServiceKeyCacheKeysToSavePostParams { + var () + return &CacheServiceKeyCacheKeysToSavePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceKeyCacheKeysToSavePostParamsWithTimeout creates a new CacheServiceKeyCacheKeysToSavePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceKeyCacheKeysToSavePostParamsWithTimeout(timeout time.Duration) *CacheServiceKeyCacheKeysToSavePostParams { + var () + return &CacheServiceKeyCacheKeysToSavePostParams{ + + timeout: timeout, + } +} + +// NewCacheServiceKeyCacheKeysToSavePostParamsWithContext creates a new CacheServiceKeyCacheKeysToSavePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceKeyCacheKeysToSavePostParamsWithContext(ctx context.Context) *CacheServiceKeyCacheKeysToSavePostParams { + var () + return &CacheServiceKeyCacheKeysToSavePostParams{ + + Context: ctx, + } +} + +// NewCacheServiceKeyCacheKeysToSavePostParamsWithHTTPClient creates a new CacheServiceKeyCacheKeysToSavePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceKeyCacheKeysToSavePostParamsWithHTTPClient(client *http.Client) *CacheServiceKeyCacheKeysToSavePostParams { + var () + return &CacheServiceKeyCacheKeysToSavePostParams{ + HTTPClient: client, + } +} + +/* +CacheServiceKeyCacheKeysToSavePostParams contains all the parameters to send to the API endpoint +for the cache service key cache keys to save post operation typically these are written to a http.Request +*/ +type CacheServiceKeyCacheKeysToSavePostParams struct { + + /*Kckts + key cache keys to save + + */ + Kckts int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service key cache keys to save post params +func (o *CacheServiceKeyCacheKeysToSavePostParams) WithTimeout(timeout time.Duration) *CacheServiceKeyCacheKeysToSavePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service key cache keys to save post params +func (o *CacheServiceKeyCacheKeysToSavePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service key cache keys to save post params +func (o *CacheServiceKeyCacheKeysToSavePostParams) WithContext(ctx context.Context) *CacheServiceKeyCacheKeysToSavePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service key cache keys to save post params +func (o *CacheServiceKeyCacheKeysToSavePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service key cache keys to save post params +func (o *CacheServiceKeyCacheKeysToSavePostParams) WithHTTPClient(client *http.Client) *CacheServiceKeyCacheKeysToSavePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service key cache keys to save post params +func (o *CacheServiceKeyCacheKeysToSavePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithKckts adds the kckts to the cache service key cache keys to save post params +func (o *CacheServiceKeyCacheKeysToSavePostParams) WithKckts(kckts int32) *CacheServiceKeyCacheKeysToSavePostParams { + o.SetKckts(kckts) + return o +} + +// SetKckts adds the kckts to the cache service key cache keys to save post params +func (o *CacheServiceKeyCacheKeysToSavePostParams) SetKckts(kckts int32) { + o.Kckts = kckts +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceKeyCacheKeysToSavePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param kckts + qrKckts := o.Kckts + qKckts := swag.FormatInt32(qrKckts) + if qKckts != "" { + if err := r.SetQueryParam("kckts", qKckts); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_keys_to_save_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_keys_to_save_post_responses.go new file mode 100644 index 0000000000..0ffd4a4984 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_keys_to_save_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceKeyCacheKeysToSavePostReader is a Reader for the CacheServiceKeyCacheKeysToSavePost structure. +type CacheServiceKeyCacheKeysToSavePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceKeyCacheKeysToSavePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceKeyCacheKeysToSavePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceKeyCacheKeysToSavePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceKeyCacheKeysToSavePostOK creates a CacheServiceKeyCacheKeysToSavePostOK with default headers values +func NewCacheServiceKeyCacheKeysToSavePostOK() *CacheServiceKeyCacheKeysToSavePostOK { + return &CacheServiceKeyCacheKeysToSavePostOK{} +} + +/* +CacheServiceKeyCacheKeysToSavePostOK handles this case with default header values. + +Success +*/ +type CacheServiceKeyCacheKeysToSavePostOK struct { +} + +func (o *CacheServiceKeyCacheKeysToSavePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCacheServiceKeyCacheKeysToSavePostDefault creates a CacheServiceKeyCacheKeysToSavePostDefault with default headers values +func NewCacheServiceKeyCacheKeysToSavePostDefault(code int) *CacheServiceKeyCacheKeysToSavePostDefault { + return &CacheServiceKeyCacheKeysToSavePostDefault{ + _statusCode: code, + } +} + +/* +CacheServiceKeyCacheKeysToSavePostDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceKeyCacheKeysToSavePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service key cache keys to save post default response +func (o *CacheServiceKeyCacheKeysToSavePostDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceKeyCacheKeysToSavePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceKeyCacheKeysToSavePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceKeyCacheKeysToSavePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_save_period_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_save_period_get_parameters.go new file mode 100644 index 0000000000..991955171e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_save_period_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceKeyCacheSavePeriodGetParams creates a new CacheServiceKeyCacheSavePeriodGetParams object +// with the default values initialized. +func NewCacheServiceKeyCacheSavePeriodGetParams() *CacheServiceKeyCacheSavePeriodGetParams { + + return &CacheServiceKeyCacheSavePeriodGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceKeyCacheSavePeriodGetParamsWithTimeout creates a new CacheServiceKeyCacheSavePeriodGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceKeyCacheSavePeriodGetParamsWithTimeout(timeout time.Duration) *CacheServiceKeyCacheSavePeriodGetParams { + + return &CacheServiceKeyCacheSavePeriodGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceKeyCacheSavePeriodGetParamsWithContext creates a new CacheServiceKeyCacheSavePeriodGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceKeyCacheSavePeriodGetParamsWithContext(ctx context.Context) *CacheServiceKeyCacheSavePeriodGetParams { + + return &CacheServiceKeyCacheSavePeriodGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceKeyCacheSavePeriodGetParamsWithHTTPClient creates a new CacheServiceKeyCacheSavePeriodGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceKeyCacheSavePeriodGetParamsWithHTTPClient(client *http.Client) *CacheServiceKeyCacheSavePeriodGetParams { + + return &CacheServiceKeyCacheSavePeriodGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceKeyCacheSavePeriodGetParams contains all the parameters to send to the API endpoint +for the cache service key cache save period get operation typically these are written to a http.Request +*/ +type CacheServiceKeyCacheSavePeriodGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service key cache save period get params +func (o *CacheServiceKeyCacheSavePeriodGetParams) WithTimeout(timeout time.Duration) *CacheServiceKeyCacheSavePeriodGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service key cache save period get params +func (o *CacheServiceKeyCacheSavePeriodGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service key cache save period get params +func (o *CacheServiceKeyCacheSavePeriodGetParams) WithContext(ctx context.Context) *CacheServiceKeyCacheSavePeriodGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service key cache save period get params +func (o *CacheServiceKeyCacheSavePeriodGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service key cache save period get params +func (o *CacheServiceKeyCacheSavePeriodGetParams) WithHTTPClient(client *http.Client) *CacheServiceKeyCacheSavePeriodGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service key cache save period get params +func (o *CacheServiceKeyCacheSavePeriodGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceKeyCacheSavePeriodGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_save_period_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_save_period_get_responses.go new file mode 100644 index 0000000000..01f53723fd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_save_period_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceKeyCacheSavePeriodGetReader is a Reader for the CacheServiceKeyCacheSavePeriodGet structure. +type CacheServiceKeyCacheSavePeriodGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceKeyCacheSavePeriodGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceKeyCacheSavePeriodGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceKeyCacheSavePeriodGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceKeyCacheSavePeriodGetOK creates a CacheServiceKeyCacheSavePeriodGetOK with default headers values +func NewCacheServiceKeyCacheSavePeriodGetOK() *CacheServiceKeyCacheSavePeriodGetOK { + return &CacheServiceKeyCacheSavePeriodGetOK{} +} + +/* +CacheServiceKeyCacheSavePeriodGetOK handles this case with default header values. + +Success +*/ +type CacheServiceKeyCacheSavePeriodGetOK struct { + Payload int32 +} + +func (o *CacheServiceKeyCacheSavePeriodGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *CacheServiceKeyCacheSavePeriodGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceKeyCacheSavePeriodGetDefault creates a CacheServiceKeyCacheSavePeriodGetDefault with default headers values +func NewCacheServiceKeyCacheSavePeriodGetDefault(code int) *CacheServiceKeyCacheSavePeriodGetDefault { + return &CacheServiceKeyCacheSavePeriodGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceKeyCacheSavePeriodGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceKeyCacheSavePeriodGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service key cache save period get default response +func (o *CacheServiceKeyCacheSavePeriodGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceKeyCacheSavePeriodGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceKeyCacheSavePeriodGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceKeyCacheSavePeriodGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_save_period_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_save_period_post_parameters.go new file mode 100644 index 0000000000..043f6489e9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_save_period_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCacheServiceKeyCacheSavePeriodPostParams creates a new CacheServiceKeyCacheSavePeriodPostParams object +// with the default values initialized. +func NewCacheServiceKeyCacheSavePeriodPostParams() *CacheServiceKeyCacheSavePeriodPostParams { + var () + return &CacheServiceKeyCacheSavePeriodPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceKeyCacheSavePeriodPostParamsWithTimeout creates a new CacheServiceKeyCacheSavePeriodPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceKeyCacheSavePeriodPostParamsWithTimeout(timeout time.Duration) *CacheServiceKeyCacheSavePeriodPostParams { + var () + return &CacheServiceKeyCacheSavePeriodPostParams{ + + timeout: timeout, + } +} + +// NewCacheServiceKeyCacheSavePeriodPostParamsWithContext creates a new CacheServiceKeyCacheSavePeriodPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceKeyCacheSavePeriodPostParamsWithContext(ctx context.Context) *CacheServiceKeyCacheSavePeriodPostParams { + var () + return &CacheServiceKeyCacheSavePeriodPostParams{ + + Context: ctx, + } +} + +// NewCacheServiceKeyCacheSavePeriodPostParamsWithHTTPClient creates a new CacheServiceKeyCacheSavePeriodPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceKeyCacheSavePeriodPostParamsWithHTTPClient(client *http.Client) *CacheServiceKeyCacheSavePeriodPostParams { + var () + return &CacheServiceKeyCacheSavePeriodPostParams{ + HTTPClient: client, + } +} + +/* +CacheServiceKeyCacheSavePeriodPostParams contains all the parameters to send to the API endpoint +for the cache service key cache save period post operation typically these are written to a http.Request +*/ +type CacheServiceKeyCacheSavePeriodPostParams struct { + + /*Period + key cache save period in seconds + + */ + Period int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service key cache save period post params +func (o *CacheServiceKeyCacheSavePeriodPostParams) WithTimeout(timeout time.Duration) *CacheServiceKeyCacheSavePeriodPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service key cache save period post params +func (o *CacheServiceKeyCacheSavePeriodPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service key cache save period post params +func (o *CacheServiceKeyCacheSavePeriodPostParams) WithContext(ctx context.Context) *CacheServiceKeyCacheSavePeriodPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service key cache save period post params +func (o *CacheServiceKeyCacheSavePeriodPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service key cache save period post params +func (o *CacheServiceKeyCacheSavePeriodPostParams) WithHTTPClient(client *http.Client) *CacheServiceKeyCacheSavePeriodPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service key cache save period post params +func (o *CacheServiceKeyCacheSavePeriodPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPeriod adds the period to the cache service key cache save period post params +func (o *CacheServiceKeyCacheSavePeriodPostParams) WithPeriod(period int32) *CacheServiceKeyCacheSavePeriodPostParams { + o.SetPeriod(period) + return o +} + +// SetPeriod adds the period to the cache service key cache save period post params +func (o *CacheServiceKeyCacheSavePeriodPostParams) SetPeriod(period int32) { + o.Period = period +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceKeyCacheSavePeriodPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param period + qrPeriod := o.Period + qPeriod := swag.FormatInt32(qrPeriod) + if qPeriod != "" { + if err := r.SetQueryParam("period", qPeriod); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_save_period_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_save_period_post_responses.go new file mode 100644 index 0000000000..d820901c00 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_key_cache_save_period_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceKeyCacheSavePeriodPostReader is a Reader for the CacheServiceKeyCacheSavePeriodPost structure. +type CacheServiceKeyCacheSavePeriodPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceKeyCacheSavePeriodPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceKeyCacheSavePeriodPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceKeyCacheSavePeriodPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceKeyCacheSavePeriodPostOK creates a CacheServiceKeyCacheSavePeriodPostOK with default headers values +func NewCacheServiceKeyCacheSavePeriodPostOK() *CacheServiceKeyCacheSavePeriodPostOK { + return &CacheServiceKeyCacheSavePeriodPostOK{} +} + +/* +CacheServiceKeyCacheSavePeriodPostOK handles this case with default header values. + +Success +*/ +type CacheServiceKeyCacheSavePeriodPostOK struct { +} + +func (o *CacheServiceKeyCacheSavePeriodPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCacheServiceKeyCacheSavePeriodPostDefault creates a CacheServiceKeyCacheSavePeriodPostDefault with default headers values +func NewCacheServiceKeyCacheSavePeriodPostDefault(code int) *CacheServiceKeyCacheSavePeriodPostDefault { + return &CacheServiceKeyCacheSavePeriodPostDefault{ + _statusCode: code, + } +} + +/* +CacheServiceKeyCacheSavePeriodPostDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceKeyCacheSavePeriodPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service key cache save period post default response +func (o *CacheServiceKeyCacheSavePeriodPostDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceKeyCacheSavePeriodPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceKeyCacheSavePeriodPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceKeyCacheSavePeriodPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_capacity_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_capacity_get_parameters.go new file mode 100644 index 0000000000..d12b97492d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_capacity_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsCounterCapacityGetParams creates a new CacheServiceMetricsCounterCapacityGetParams object +// with the default values initialized. +func NewCacheServiceMetricsCounterCapacityGetParams() *CacheServiceMetricsCounterCapacityGetParams { + + return &CacheServiceMetricsCounterCapacityGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsCounterCapacityGetParamsWithTimeout creates a new CacheServiceMetricsCounterCapacityGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsCounterCapacityGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsCounterCapacityGetParams { + + return &CacheServiceMetricsCounterCapacityGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsCounterCapacityGetParamsWithContext creates a new CacheServiceMetricsCounterCapacityGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsCounterCapacityGetParamsWithContext(ctx context.Context) *CacheServiceMetricsCounterCapacityGetParams { + + return &CacheServiceMetricsCounterCapacityGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsCounterCapacityGetParamsWithHTTPClient creates a new CacheServiceMetricsCounterCapacityGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsCounterCapacityGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsCounterCapacityGetParams { + + return &CacheServiceMetricsCounterCapacityGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsCounterCapacityGetParams contains all the parameters to send to the API endpoint +for the cache service metrics counter capacity get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsCounterCapacityGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics counter capacity get params +func (o *CacheServiceMetricsCounterCapacityGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsCounterCapacityGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics counter capacity get params +func (o *CacheServiceMetricsCounterCapacityGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics counter capacity get params +func (o *CacheServiceMetricsCounterCapacityGetParams) WithContext(ctx context.Context) *CacheServiceMetricsCounterCapacityGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics counter capacity get params +func (o *CacheServiceMetricsCounterCapacityGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics counter capacity get params +func (o *CacheServiceMetricsCounterCapacityGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsCounterCapacityGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics counter capacity get params +func (o *CacheServiceMetricsCounterCapacityGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsCounterCapacityGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_capacity_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_capacity_get_responses.go new file mode 100644 index 0000000000..917854594f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_capacity_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsCounterCapacityGetReader is a Reader for the CacheServiceMetricsCounterCapacityGet structure. +type CacheServiceMetricsCounterCapacityGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsCounterCapacityGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsCounterCapacityGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsCounterCapacityGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsCounterCapacityGetOK creates a CacheServiceMetricsCounterCapacityGetOK with default headers values +func NewCacheServiceMetricsCounterCapacityGetOK() *CacheServiceMetricsCounterCapacityGetOK { + return &CacheServiceMetricsCounterCapacityGetOK{} +} + +/* +CacheServiceMetricsCounterCapacityGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsCounterCapacityGetOK struct { + Payload interface{} +} + +func (o *CacheServiceMetricsCounterCapacityGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CacheServiceMetricsCounterCapacityGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsCounterCapacityGetDefault creates a CacheServiceMetricsCounterCapacityGetDefault with default headers values +func NewCacheServiceMetricsCounterCapacityGetDefault(code int) *CacheServiceMetricsCounterCapacityGetDefault { + return &CacheServiceMetricsCounterCapacityGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsCounterCapacityGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsCounterCapacityGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics counter capacity get default response +func (o *CacheServiceMetricsCounterCapacityGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsCounterCapacityGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsCounterCapacityGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsCounterCapacityGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_entries_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_entries_get_parameters.go new file mode 100644 index 0000000000..f2dd906ef9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_entries_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsCounterEntriesGetParams creates a new CacheServiceMetricsCounterEntriesGetParams object +// with the default values initialized. +func NewCacheServiceMetricsCounterEntriesGetParams() *CacheServiceMetricsCounterEntriesGetParams { + + return &CacheServiceMetricsCounterEntriesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsCounterEntriesGetParamsWithTimeout creates a new CacheServiceMetricsCounterEntriesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsCounterEntriesGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsCounterEntriesGetParams { + + return &CacheServiceMetricsCounterEntriesGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsCounterEntriesGetParamsWithContext creates a new CacheServiceMetricsCounterEntriesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsCounterEntriesGetParamsWithContext(ctx context.Context) *CacheServiceMetricsCounterEntriesGetParams { + + return &CacheServiceMetricsCounterEntriesGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsCounterEntriesGetParamsWithHTTPClient creates a new CacheServiceMetricsCounterEntriesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsCounterEntriesGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsCounterEntriesGetParams { + + return &CacheServiceMetricsCounterEntriesGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsCounterEntriesGetParams contains all the parameters to send to the API endpoint +for the cache service metrics counter entries get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsCounterEntriesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics counter entries get params +func (o *CacheServiceMetricsCounterEntriesGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsCounterEntriesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics counter entries get params +func (o *CacheServiceMetricsCounterEntriesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics counter entries get params +func (o *CacheServiceMetricsCounterEntriesGetParams) WithContext(ctx context.Context) *CacheServiceMetricsCounterEntriesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics counter entries get params +func (o *CacheServiceMetricsCounterEntriesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics counter entries get params +func (o *CacheServiceMetricsCounterEntriesGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsCounterEntriesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics counter entries get params +func (o *CacheServiceMetricsCounterEntriesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsCounterEntriesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_entries_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_entries_get_responses.go new file mode 100644 index 0000000000..07f1a23810 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_entries_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsCounterEntriesGetReader is a Reader for the CacheServiceMetricsCounterEntriesGet structure. +type CacheServiceMetricsCounterEntriesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsCounterEntriesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsCounterEntriesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsCounterEntriesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsCounterEntriesGetOK creates a CacheServiceMetricsCounterEntriesGetOK with default headers values +func NewCacheServiceMetricsCounterEntriesGetOK() *CacheServiceMetricsCounterEntriesGetOK { + return &CacheServiceMetricsCounterEntriesGetOK{} +} + +/* +CacheServiceMetricsCounterEntriesGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsCounterEntriesGetOK struct { + Payload int32 +} + +func (o *CacheServiceMetricsCounterEntriesGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *CacheServiceMetricsCounterEntriesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsCounterEntriesGetDefault creates a CacheServiceMetricsCounterEntriesGetDefault with default headers values +func NewCacheServiceMetricsCounterEntriesGetDefault(code int) *CacheServiceMetricsCounterEntriesGetDefault { + return &CacheServiceMetricsCounterEntriesGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsCounterEntriesGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsCounterEntriesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics counter entries get default response +func (o *CacheServiceMetricsCounterEntriesGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsCounterEntriesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsCounterEntriesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsCounterEntriesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hit_rate_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hit_rate_get_parameters.go new file mode 100644 index 0000000000..8281890438 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hit_rate_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsCounterHitRateGetParams creates a new CacheServiceMetricsCounterHitRateGetParams object +// with the default values initialized. +func NewCacheServiceMetricsCounterHitRateGetParams() *CacheServiceMetricsCounterHitRateGetParams { + + return &CacheServiceMetricsCounterHitRateGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsCounterHitRateGetParamsWithTimeout creates a new CacheServiceMetricsCounterHitRateGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsCounterHitRateGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsCounterHitRateGetParams { + + return &CacheServiceMetricsCounterHitRateGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsCounterHitRateGetParamsWithContext creates a new CacheServiceMetricsCounterHitRateGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsCounterHitRateGetParamsWithContext(ctx context.Context) *CacheServiceMetricsCounterHitRateGetParams { + + return &CacheServiceMetricsCounterHitRateGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsCounterHitRateGetParamsWithHTTPClient creates a new CacheServiceMetricsCounterHitRateGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsCounterHitRateGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsCounterHitRateGetParams { + + return &CacheServiceMetricsCounterHitRateGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsCounterHitRateGetParams contains all the parameters to send to the API endpoint +for the cache service metrics counter hit rate get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsCounterHitRateGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics counter hit rate get params +func (o *CacheServiceMetricsCounterHitRateGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsCounterHitRateGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics counter hit rate get params +func (o *CacheServiceMetricsCounterHitRateGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics counter hit rate get params +func (o *CacheServiceMetricsCounterHitRateGetParams) WithContext(ctx context.Context) *CacheServiceMetricsCounterHitRateGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics counter hit rate get params +func (o *CacheServiceMetricsCounterHitRateGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics counter hit rate get params +func (o *CacheServiceMetricsCounterHitRateGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsCounterHitRateGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics counter hit rate get params +func (o *CacheServiceMetricsCounterHitRateGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsCounterHitRateGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hit_rate_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hit_rate_get_responses.go new file mode 100644 index 0000000000..03c416e7a6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hit_rate_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsCounterHitRateGetReader is a Reader for the CacheServiceMetricsCounterHitRateGet structure. +type CacheServiceMetricsCounterHitRateGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsCounterHitRateGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsCounterHitRateGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsCounterHitRateGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsCounterHitRateGetOK creates a CacheServiceMetricsCounterHitRateGetOK with default headers values +func NewCacheServiceMetricsCounterHitRateGetOK() *CacheServiceMetricsCounterHitRateGetOK { + return &CacheServiceMetricsCounterHitRateGetOK{} +} + +/* +CacheServiceMetricsCounterHitRateGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsCounterHitRateGetOK struct { + Payload interface{} +} + +func (o *CacheServiceMetricsCounterHitRateGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CacheServiceMetricsCounterHitRateGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsCounterHitRateGetDefault creates a CacheServiceMetricsCounterHitRateGetDefault with default headers values +func NewCacheServiceMetricsCounterHitRateGetDefault(code int) *CacheServiceMetricsCounterHitRateGetDefault { + return &CacheServiceMetricsCounterHitRateGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsCounterHitRateGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsCounterHitRateGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics counter hit rate get default response +func (o *CacheServiceMetricsCounterHitRateGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsCounterHitRateGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsCounterHitRateGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsCounterHitRateGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hits_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hits_get_parameters.go new file mode 100644 index 0000000000..371ac603b4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hits_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsCounterHitsGetParams creates a new CacheServiceMetricsCounterHitsGetParams object +// with the default values initialized. +func NewCacheServiceMetricsCounterHitsGetParams() *CacheServiceMetricsCounterHitsGetParams { + + return &CacheServiceMetricsCounterHitsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsCounterHitsGetParamsWithTimeout creates a new CacheServiceMetricsCounterHitsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsCounterHitsGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsCounterHitsGetParams { + + return &CacheServiceMetricsCounterHitsGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsCounterHitsGetParamsWithContext creates a new CacheServiceMetricsCounterHitsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsCounterHitsGetParamsWithContext(ctx context.Context) *CacheServiceMetricsCounterHitsGetParams { + + return &CacheServiceMetricsCounterHitsGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsCounterHitsGetParamsWithHTTPClient creates a new CacheServiceMetricsCounterHitsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsCounterHitsGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsCounterHitsGetParams { + + return &CacheServiceMetricsCounterHitsGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsCounterHitsGetParams contains all the parameters to send to the API endpoint +for the cache service metrics counter hits get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsCounterHitsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics counter hits get params +func (o *CacheServiceMetricsCounterHitsGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsCounterHitsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics counter hits get params +func (o *CacheServiceMetricsCounterHitsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics counter hits get params +func (o *CacheServiceMetricsCounterHitsGetParams) WithContext(ctx context.Context) *CacheServiceMetricsCounterHitsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics counter hits get params +func (o *CacheServiceMetricsCounterHitsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics counter hits get params +func (o *CacheServiceMetricsCounterHitsGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsCounterHitsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics counter hits get params +func (o *CacheServiceMetricsCounterHitsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsCounterHitsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hits_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hits_get_responses.go new file mode 100644 index 0000000000..f973297110 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hits_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsCounterHitsGetReader is a Reader for the CacheServiceMetricsCounterHitsGet structure. +type CacheServiceMetricsCounterHitsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsCounterHitsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsCounterHitsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsCounterHitsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsCounterHitsGetOK creates a CacheServiceMetricsCounterHitsGetOK with default headers values +func NewCacheServiceMetricsCounterHitsGetOK() *CacheServiceMetricsCounterHitsGetOK { + return &CacheServiceMetricsCounterHitsGetOK{} +} + +/* +CacheServiceMetricsCounterHitsGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsCounterHitsGetOK struct { + Payload interface{} +} + +func (o *CacheServiceMetricsCounterHitsGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CacheServiceMetricsCounterHitsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsCounterHitsGetDefault creates a CacheServiceMetricsCounterHitsGetDefault with default headers values +func NewCacheServiceMetricsCounterHitsGetDefault(code int) *CacheServiceMetricsCounterHitsGetDefault { + return &CacheServiceMetricsCounterHitsGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsCounterHitsGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsCounterHitsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics counter hits get default response +func (o *CacheServiceMetricsCounterHitsGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsCounterHitsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsCounterHitsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsCounterHitsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hits_moving_avrage_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hits_moving_avrage_get_parameters.go new file mode 100644 index 0000000000..6b576f26c0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hits_moving_avrage_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsCounterHitsMovingAvrageGetParams creates a new CacheServiceMetricsCounterHitsMovingAvrageGetParams object +// with the default values initialized. +func NewCacheServiceMetricsCounterHitsMovingAvrageGetParams() *CacheServiceMetricsCounterHitsMovingAvrageGetParams { + + return &CacheServiceMetricsCounterHitsMovingAvrageGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsCounterHitsMovingAvrageGetParamsWithTimeout creates a new CacheServiceMetricsCounterHitsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsCounterHitsMovingAvrageGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsCounterHitsMovingAvrageGetParams { + + return &CacheServiceMetricsCounterHitsMovingAvrageGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsCounterHitsMovingAvrageGetParamsWithContext creates a new CacheServiceMetricsCounterHitsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsCounterHitsMovingAvrageGetParamsWithContext(ctx context.Context) *CacheServiceMetricsCounterHitsMovingAvrageGetParams { + + return &CacheServiceMetricsCounterHitsMovingAvrageGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsCounterHitsMovingAvrageGetParamsWithHTTPClient creates a new CacheServiceMetricsCounterHitsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsCounterHitsMovingAvrageGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsCounterHitsMovingAvrageGetParams { + + return &CacheServiceMetricsCounterHitsMovingAvrageGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsCounterHitsMovingAvrageGetParams contains all the parameters to send to the API endpoint +for the cache service metrics counter hits moving avrage get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsCounterHitsMovingAvrageGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics counter hits moving avrage get params +func (o *CacheServiceMetricsCounterHitsMovingAvrageGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsCounterHitsMovingAvrageGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics counter hits moving avrage get params +func (o *CacheServiceMetricsCounterHitsMovingAvrageGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics counter hits moving avrage get params +func (o *CacheServiceMetricsCounterHitsMovingAvrageGetParams) WithContext(ctx context.Context) *CacheServiceMetricsCounterHitsMovingAvrageGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics counter hits moving avrage get params +func (o *CacheServiceMetricsCounterHitsMovingAvrageGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics counter hits moving avrage get params +func (o *CacheServiceMetricsCounterHitsMovingAvrageGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsCounterHitsMovingAvrageGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics counter hits moving avrage get params +func (o *CacheServiceMetricsCounterHitsMovingAvrageGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsCounterHitsMovingAvrageGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hits_moving_avrage_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hits_moving_avrage_get_responses.go new file mode 100644 index 0000000000..685fd5c8b1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_hits_moving_avrage_get_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsCounterHitsMovingAvrageGetReader is a Reader for the CacheServiceMetricsCounterHitsMovingAvrageGet structure. +type CacheServiceMetricsCounterHitsMovingAvrageGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsCounterHitsMovingAvrageGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsCounterHitsMovingAvrageGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsCounterHitsMovingAvrageGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsCounterHitsMovingAvrageGetOK creates a CacheServiceMetricsCounterHitsMovingAvrageGetOK with default headers values +func NewCacheServiceMetricsCounterHitsMovingAvrageGetOK() *CacheServiceMetricsCounterHitsMovingAvrageGetOK { + return &CacheServiceMetricsCounterHitsMovingAvrageGetOK{} +} + +/* +CacheServiceMetricsCounterHitsMovingAvrageGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsCounterHitsMovingAvrageGetOK struct { + Payload *models.RateMovingAverage +} + +func (o *CacheServiceMetricsCounterHitsMovingAvrageGetOK) GetPayload() *models.RateMovingAverage { + return o.Payload +} + +func (o *CacheServiceMetricsCounterHitsMovingAvrageGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RateMovingAverage) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsCounterHitsMovingAvrageGetDefault creates a CacheServiceMetricsCounterHitsMovingAvrageGetDefault with default headers values +func NewCacheServiceMetricsCounterHitsMovingAvrageGetDefault(code int) *CacheServiceMetricsCounterHitsMovingAvrageGetDefault { + return &CacheServiceMetricsCounterHitsMovingAvrageGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsCounterHitsMovingAvrageGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsCounterHitsMovingAvrageGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics counter hits moving avrage get default response +func (o *CacheServiceMetricsCounterHitsMovingAvrageGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsCounterHitsMovingAvrageGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsCounterHitsMovingAvrageGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsCounterHitsMovingAvrageGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_requests_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_requests_get_parameters.go new file mode 100644 index 0000000000..e07fdb52ce --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_requests_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsCounterRequestsGetParams creates a new CacheServiceMetricsCounterRequestsGetParams object +// with the default values initialized. +func NewCacheServiceMetricsCounterRequestsGetParams() *CacheServiceMetricsCounterRequestsGetParams { + + return &CacheServiceMetricsCounterRequestsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsCounterRequestsGetParamsWithTimeout creates a new CacheServiceMetricsCounterRequestsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsCounterRequestsGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsCounterRequestsGetParams { + + return &CacheServiceMetricsCounterRequestsGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsCounterRequestsGetParamsWithContext creates a new CacheServiceMetricsCounterRequestsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsCounterRequestsGetParamsWithContext(ctx context.Context) *CacheServiceMetricsCounterRequestsGetParams { + + return &CacheServiceMetricsCounterRequestsGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsCounterRequestsGetParamsWithHTTPClient creates a new CacheServiceMetricsCounterRequestsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsCounterRequestsGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsCounterRequestsGetParams { + + return &CacheServiceMetricsCounterRequestsGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsCounterRequestsGetParams contains all the parameters to send to the API endpoint +for the cache service metrics counter requests get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsCounterRequestsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics counter requests get params +func (o *CacheServiceMetricsCounterRequestsGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsCounterRequestsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics counter requests get params +func (o *CacheServiceMetricsCounterRequestsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics counter requests get params +func (o *CacheServiceMetricsCounterRequestsGetParams) WithContext(ctx context.Context) *CacheServiceMetricsCounterRequestsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics counter requests get params +func (o *CacheServiceMetricsCounterRequestsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics counter requests get params +func (o *CacheServiceMetricsCounterRequestsGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsCounterRequestsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics counter requests get params +func (o *CacheServiceMetricsCounterRequestsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsCounterRequestsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_requests_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_requests_get_responses.go new file mode 100644 index 0000000000..d0c0bfd62d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_requests_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsCounterRequestsGetReader is a Reader for the CacheServiceMetricsCounterRequestsGet structure. +type CacheServiceMetricsCounterRequestsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsCounterRequestsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsCounterRequestsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsCounterRequestsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsCounterRequestsGetOK creates a CacheServiceMetricsCounterRequestsGetOK with default headers values +func NewCacheServiceMetricsCounterRequestsGetOK() *CacheServiceMetricsCounterRequestsGetOK { + return &CacheServiceMetricsCounterRequestsGetOK{} +} + +/* +CacheServiceMetricsCounterRequestsGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsCounterRequestsGetOK struct { + Payload interface{} +} + +func (o *CacheServiceMetricsCounterRequestsGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CacheServiceMetricsCounterRequestsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsCounterRequestsGetDefault creates a CacheServiceMetricsCounterRequestsGetDefault with default headers values +func NewCacheServiceMetricsCounterRequestsGetDefault(code int) *CacheServiceMetricsCounterRequestsGetDefault { + return &CacheServiceMetricsCounterRequestsGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsCounterRequestsGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsCounterRequestsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics counter requests get default response +func (o *CacheServiceMetricsCounterRequestsGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsCounterRequestsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsCounterRequestsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsCounterRequestsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_requests_moving_avrage_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_requests_moving_avrage_get_parameters.go new file mode 100644 index 0000000000..80344a6463 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_requests_moving_avrage_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsCounterRequestsMovingAvrageGetParams creates a new CacheServiceMetricsCounterRequestsMovingAvrageGetParams object +// with the default values initialized. +func NewCacheServiceMetricsCounterRequestsMovingAvrageGetParams() *CacheServiceMetricsCounterRequestsMovingAvrageGetParams { + + return &CacheServiceMetricsCounterRequestsMovingAvrageGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsCounterRequestsMovingAvrageGetParamsWithTimeout creates a new CacheServiceMetricsCounterRequestsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsCounterRequestsMovingAvrageGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsCounterRequestsMovingAvrageGetParams { + + return &CacheServiceMetricsCounterRequestsMovingAvrageGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsCounterRequestsMovingAvrageGetParamsWithContext creates a new CacheServiceMetricsCounterRequestsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsCounterRequestsMovingAvrageGetParamsWithContext(ctx context.Context) *CacheServiceMetricsCounterRequestsMovingAvrageGetParams { + + return &CacheServiceMetricsCounterRequestsMovingAvrageGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsCounterRequestsMovingAvrageGetParamsWithHTTPClient creates a new CacheServiceMetricsCounterRequestsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsCounterRequestsMovingAvrageGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsCounterRequestsMovingAvrageGetParams { + + return &CacheServiceMetricsCounterRequestsMovingAvrageGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsCounterRequestsMovingAvrageGetParams contains all the parameters to send to the API endpoint +for the cache service metrics counter requests moving avrage get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsCounterRequestsMovingAvrageGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics counter requests moving avrage get params +func (o *CacheServiceMetricsCounterRequestsMovingAvrageGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsCounterRequestsMovingAvrageGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics counter requests moving avrage get params +func (o *CacheServiceMetricsCounterRequestsMovingAvrageGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics counter requests moving avrage get params +func (o *CacheServiceMetricsCounterRequestsMovingAvrageGetParams) WithContext(ctx context.Context) *CacheServiceMetricsCounterRequestsMovingAvrageGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics counter requests moving avrage get params +func (o *CacheServiceMetricsCounterRequestsMovingAvrageGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics counter requests moving avrage get params +func (o *CacheServiceMetricsCounterRequestsMovingAvrageGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsCounterRequestsMovingAvrageGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics counter requests moving avrage get params +func (o *CacheServiceMetricsCounterRequestsMovingAvrageGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsCounterRequestsMovingAvrageGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_requests_moving_avrage_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_requests_moving_avrage_get_responses.go new file mode 100644 index 0000000000..533853f0b3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_requests_moving_avrage_get_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsCounterRequestsMovingAvrageGetReader is a Reader for the CacheServiceMetricsCounterRequestsMovingAvrageGet structure. +type CacheServiceMetricsCounterRequestsMovingAvrageGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsCounterRequestsMovingAvrageGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsCounterRequestsMovingAvrageGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsCounterRequestsMovingAvrageGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsCounterRequestsMovingAvrageGetOK creates a CacheServiceMetricsCounterRequestsMovingAvrageGetOK with default headers values +func NewCacheServiceMetricsCounterRequestsMovingAvrageGetOK() *CacheServiceMetricsCounterRequestsMovingAvrageGetOK { + return &CacheServiceMetricsCounterRequestsMovingAvrageGetOK{} +} + +/* +CacheServiceMetricsCounterRequestsMovingAvrageGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsCounterRequestsMovingAvrageGetOK struct { + Payload *models.RateMovingAverage +} + +func (o *CacheServiceMetricsCounterRequestsMovingAvrageGetOK) GetPayload() *models.RateMovingAverage { + return o.Payload +} + +func (o *CacheServiceMetricsCounterRequestsMovingAvrageGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RateMovingAverage) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsCounterRequestsMovingAvrageGetDefault creates a CacheServiceMetricsCounterRequestsMovingAvrageGetDefault with default headers values +func NewCacheServiceMetricsCounterRequestsMovingAvrageGetDefault(code int) *CacheServiceMetricsCounterRequestsMovingAvrageGetDefault { + return &CacheServiceMetricsCounterRequestsMovingAvrageGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsCounterRequestsMovingAvrageGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsCounterRequestsMovingAvrageGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics counter requests moving avrage get default response +func (o *CacheServiceMetricsCounterRequestsMovingAvrageGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsCounterRequestsMovingAvrageGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsCounterRequestsMovingAvrageGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsCounterRequestsMovingAvrageGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_size_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_size_get_parameters.go new file mode 100644 index 0000000000..5a7b82c9c9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_size_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsCounterSizeGetParams creates a new CacheServiceMetricsCounterSizeGetParams object +// with the default values initialized. +func NewCacheServiceMetricsCounterSizeGetParams() *CacheServiceMetricsCounterSizeGetParams { + + return &CacheServiceMetricsCounterSizeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsCounterSizeGetParamsWithTimeout creates a new CacheServiceMetricsCounterSizeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsCounterSizeGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsCounterSizeGetParams { + + return &CacheServiceMetricsCounterSizeGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsCounterSizeGetParamsWithContext creates a new CacheServiceMetricsCounterSizeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsCounterSizeGetParamsWithContext(ctx context.Context) *CacheServiceMetricsCounterSizeGetParams { + + return &CacheServiceMetricsCounterSizeGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsCounterSizeGetParamsWithHTTPClient creates a new CacheServiceMetricsCounterSizeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsCounterSizeGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsCounterSizeGetParams { + + return &CacheServiceMetricsCounterSizeGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsCounterSizeGetParams contains all the parameters to send to the API endpoint +for the cache service metrics counter size get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsCounterSizeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics counter size get params +func (o *CacheServiceMetricsCounterSizeGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsCounterSizeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics counter size get params +func (o *CacheServiceMetricsCounterSizeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics counter size get params +func (o *CacheServiceMetricsCounterSizeGetParams) WithContext(ctx context.Context) *CacheServiceMetricsCounterSizeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics counter size get params +func (o *CacheServiceMetricsCounterSizeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics counter size get params +func (o *CacheServiceMetricsCounterSizeGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsCounterSizeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics counter size get params +func (o *CacheServiceMetricsCounterSizeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsCounterSizeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_size_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_size_get_responses.go new file mode 100644 index 0000000000..c9502b722f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_counter_size_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsCounterSizeGetReader is a Reader for the CacheServiceMetricsCounterSizeGet structure. +type CacheServiceMetricsCounterSizeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsCounterSizeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsCounterSizeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsCounterSizeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsCounterSizeGetOK creates a CacheServiceMetricsCounterSizeGetOK with default headers values +func NewCacheServiceMetricsCounterSizeGetOK() *CacheServiceMetricsCounterSizeGetOK { + return &CacheServiceMetricsCounterSizeGetOK{} +} + +/* +CacheServiceMetricsCounterSizeGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsCounterSizeGetOK struct { + Payload interface{} +} + +func (o *CacheServiceMetricsCounterSizeGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CacheServiceMetricsCounterSizeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsCounterSizeGetDefault creates a CacheServiceMetricsCounterSizeGetDefault with default headers values +func NewCacheServiceMetricsCounterSizeGetDefault(code int) *CacheServiceMetricsCounterSizeGetDefault { + return &CacheServiceMetricsCounterSizeGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsCounterSizeGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsCounterSizeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics counter size get default response +func (o *CacheServiceMetricsCounterSizeGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsCounterSizeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsCounterSizeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsCounterSizeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_capacity_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_capacity_get_parameters.go new file mode 100644 index 0000000000..0e4cbc2bb9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_capacity_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsKeyCapacityGetParams creates a new CacheServiceMetricsKeyCapacityGetParams object +// with the default values initialized. +func NewCacheServiceMetricsKeyCapacityGetParams() *CacheServiceMetricsKeyCapacityGetParams { + + return &CacheServiceMetricsKeyCapacityGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsKeyCapacityGetParamsWithTimeout creates a new CacheServiceMetricsKeyCapacityGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsKeyCapacityGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsKeyCapacityGetParams { + + return &CacheServiceMetricsKeyCapacityGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsKeyCapacityGetParamsWithContext creates a new CacheServiceMetricsKeyCapacityGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsKeyCapacityGetParamsWithContext(ctx context.Context) *CacheServiceMetricsKeyCapacityGetParams { + + return &CacheServiceMetricsKeyCapacityGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsKeyCapacityGetParamsWithHTTPClient creates a new CacheServiceMetricsKeyCapacityGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsKeyCapacityGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsKeyCapacityGetParams { + + return &CacheServiceMetricsKeyCapacityGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsKeyCapacityGetParams contains all the parameters to send to the API endpoint +for the cache service metrics key capacity get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsKeyCapacityGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics key capacity get params +func (o *CacheServiceMetricsKeyCapacityGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsKeyCapacityGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics key capacity get params +func (o *CacheServiceMetricsKeyCapacityGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics key capacity get params +func (o *CacheServiceMetricsKeyCapacityGetParams) WithContext(ctx context.Context) *CacheServiceMetricsKeyCapacityGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics key capacity get params +func (o *CacheServiceMetricsKeyCapacityGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics key capacity get params +func (o *CacheServiceMetricsKeyCapacityGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsKeyCapacityGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics key capacity get params +func (o *CacheServiceMetricsKeyCapacityGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsKeyCapacityGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_capacity_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_capacity_get_responses.go new file mode 100644 index 0000000000..136472967d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_capacity_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsKeyCapacityGetReader is a Reader for the CacheServiceMetricsKeyCapacityGet structure. +type CacheServiceMetricsKeyCapacityGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsKeyCapacityGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsKeyCapacityGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsKeyCapacityGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsKeyCapacityGetOK creates a CacheServiceMetricsKeyCapacityGetOK with default headers values +func NewCacheServiceMetricsKeyCapacityGetOK() *CacheServiceMetricsKeyCapacityGetOK { + return &CacheServiceMetricsKeyCapacityGetOK{} +} + +/* +CacheServiceMetricsKeyCapacityGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsKeyCapacityGetOK struct { + Payload interface{} +} + +func (o *CacheServiceMetricsKeyCapacityGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CacheServiceMetricsKeyCapacityGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsKeyCapacityGetDefault creates a CacheServiceMetricsKeyCapacityGetDefault with default headers values +func NewCacheServiceMetricsKeyCapacityGetDefault(code int) *CacheServiceMetricsKeyCapacityGetDefault { + return &CacheServiceMetricsKeyCapacityGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsKeyCapacityGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsKeyCapacityGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics key capacity get default response +func (o *CacheServiceMetricsKeyCapacityGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsKeyCapacityGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsKeyCapacityGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsKeyCapacityGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_entries_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_entries_get_parameters.go new file mode 100644 index 0000000000..5176340f0d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_entries_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsKeyEntriesGetParams creates a new CacheServiceMetricsKeyEntriesGetParams object +// with the default values initialized. +func NewCacheServiceMetricsKeyEntriesGetParams() *CacheServiceMetricsKeyEntriesGetParams { + + return &CacheServiceMetricsKeyEntriesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsKeyEntriesGetParamsWithTimeout creates a new CacheServiceMetricsKeyEntriesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsKeyEntriesGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsKeyEntriesGetParams { + + return &CacheServiceMetricsKeyEntriesGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsKeyEntriesGetParamsWithContext creates a new CacheServiceMetricsKeyEntriesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsKeyEntriesGetParamsWithContext(ctx context.Context) *CacheServiceMetricsKeyEntriesGetParams { + + return &CacheServiceMetricsKeyEntriesGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsKeyEntriesGetParamsWithHTTPClient creates a new CacheServiceMetricsKeyEntriesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsKeyEntriesGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsKeyEntriesGetParams { + + return &CacheServiceMetricsKeyEntriesGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsKeyEntriesGetParams contains all the parameters to send to the API endpoint +for the cache service metrics key entries get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsKeyEntriesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics key entries get params +func (o *CacheServiceMetricsKeyEntriesGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsKeyEntriesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics key entries get params +func (o *CacheServiceMetricsKeyEntriesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics key entries get params +func (o *CacheServiceMetricsKeyEntriesGetParams) WithContext(ctx context.Context) *CacheServiceMetricsKeyEntriesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics key entries get params +func (o *CacheServiceMetricsKeyEntriesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics key entries get params +func (o *CacheServiceMetricsKeyEntriesGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsKeyEntriesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics key entries get params +func (o *CacheServiceMetricsKeyEntriesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsKeyEntriesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_entries_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_entries_get_responses.go new file mode 100644 index 0000000000..b230ef86dd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_entries_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsKeyEntriesGetReader is a Reader for the CacheServiceMetricsKeyEntriesGet structure. +type CacheServiceMetricsKeyEntriesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsKeyEntriesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsKeyEntriesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsKeyEntriesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsKeyEntriesGetOK creates a CacheServiceMetricsKeyEntriesGetOK with default headers values +func NewCacheServiceMetricsKeyEntriesGetOK() *CacheServiceMetricsKeyEntriesGetOK { + return &CacheServiceMetricsKeyEntriesGetOK{} +} + +/* +CacheServiceMetricsKeyEntriesGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsKeyEntriesGetOK struct { + Payload int32 +} + +func (o *CacheServiceMetricsKeyEntriesGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *CacheServiceMetricsKeyEntriesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsKeyEntriesGetDefault creates a CacheServiceMetricsKeyEntriesGetDefault with default headers values +func NewCacheServiceMetricsKeyEntriesGetDefault(code int) *CacheServiceMetricsKeyEntriesGetDefault { + return &CacheServiceMetricsKeyEntriesGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsKeyEntriesGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsKeyEntriesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics key entries get default response +func (o *CacheServiceMetricsKeyEntriesGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsKeyEntriesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsKeyEntriesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsKeyEntriesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hit_rate_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hit_rate_get_parameters.go new file mode 100644 index 0000000000..7237d7c2e2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hit_rate_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsKeyHitRateGetParams creates a new CacheServiceMetricsKeyHitRateGetParams object +// with the default values initialized. +func NewCacheServiceMetricsKeyHitRateGetParams() *CacheServiceMetricsKeyHitRateGetParams { + + return &CacheServiceMetricsKeyHitRateGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsKeyHitRateGetParamsWithTimeout creates a new CacheServiceMetricsKeyHitRateGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsKeyHitRateGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsKeyHitRateGetParams { + + return &CacheServiceMetricsKeyHitRateGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsKeyHitRateGetParamsWithContext creates a new CacheServiceMetricsKeyHitRateGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsKeyHitRateGetParamsWithContext(ctx context.Context) *CacheServiceMetricsKeyHitRateGetParams { + + return &CacheServiceMetricsKeyHitRateGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsKeyHitRateGetParamsWithHTTPClient creates a new CacheServiceMetricsKeyHitRateGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsKeyHitRateGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsKeyHitRateGetParams { + + return &CacheServiceMetricsKeyHitRateGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsKeyHitRateGetParams contains all the parameters to send to the API endpoint +for the cache service metrics key hit rate get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsKeyHitRateGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics key hit rate get params +func (o *CacheServiceMetricsKeyHitRateGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsKeyHitRateGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics key hit rate get params +func (o *CacheServiceMetricsKeyHitRateGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics key hit rate get params +func (o *CacheServiceMetricsKeyHitRateGetParams) WithContext(ctx context.Context) *CacheServiceMetricsKeyHitRateGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics key hit rate get params +func (o *CacheServiceMetricsKeyHitRateGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics key hit rate get params +func (o *CacheServiceMetricsKeyHitRateGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsKeyHitRateGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics key hit rate get params +func (o *CacheServiceMetricsKeyHitRateGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsKeyHitRateGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hit_rate_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hit_rate_get_responses.go new file mode 100644 index 0000000000..e18b0d8d56 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hit_rate_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsKeyHitRateGetReader is a Reader for the CacheServiceMetricsKeyHitRateGet structure. +type CacheServiceMetricsKeyHitRateGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsKeyHitRateGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsKeyHitRateGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsKeyHitRateGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsKeyHitRateGetOK creates a CacheServiceMetricsKeyHitRateGetOK with default headers values +func NewCacheServiceMetricsKeyHitRateGetOK() *CacheServiceMetricsKeyHitRateGetOK { + return &CacheServiceMetricsKeyHitRateGetOK{} +} + +/* +CacheServiceMetricsKeyHitRateGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsKeyHitRateGetOK struct { + Payload interface{} +} + +func (o *CacheServiceMetricsKeyHitRateGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CacheServiceMetricsKeyHitRateGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsKeyHitRateGetDefault creates a CacheServiceMetricsKeyHitRateGetDefault with default headers values +func NewCacheServiceMetricsKeyHitRateGetDefault(code int) *CacheServiceMetricsKeyHitRateGetDefault { + return &CacheServiceMetricsKeyHitRateGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsKeyHitRateGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsKeyHitRateGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics key hit rate get default response +func (o *CacheServiceMetricsKeyHitRateGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsKeyHitRateGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsKeyHitRateGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsKeyHitRateGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hits_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hits_get_parameters.go new file mode 100644 index 0000000000..e6ac7ba34f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hits_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsKeyHitsGetParams creates a new CacheServiceMetricsKeyHitsGetParams object +// with the default values initialized. +func NewCacheServiceMetricsKeyHitsGetParams() *CacheServiceMetricsKeyHitsGetParams { + + return &CacheServiceMetricsKeyHitsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsKeyHitsGetParamsWithTimeout creates a new CacheServiceMetricsKeyHitsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsKeyHitsGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsKeyHitsGetParams { + + return &CacheServiceMetricsKeyHitsGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsKeyHitsGetParamsWithContext creates a new CacheServiceMetricsKeyHitsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsKeyHitsGetParamsWithContext(ctx context.Context) *CacheServiceMetricsKeyHitsGetParams { + + return &CacheServiceMetricsKeyHitsGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsKeyHitsGetParamsWithHTTPClient creates a new CacheServiceMetricsKeyHitsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsKeyHitsGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsKeyHitsGetParams { + + return &CacheServiceMetricsKeyHitsGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsKeyHitsGetParams contains all the parameters to send to the API endpoint +for the cache service metrics key hits get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsKeyHitsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics key hits get params +func (o *CacheServiceMetricsKeyHitsGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsKeyHitsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics key hits get params +func (o *CacheServiceMetricsKeyHitsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics key hits get params +func (o *CacheServiceMetricsKeyHitsGetParams) WithContext(ctx context.Context) *CacheServiceMetricsKeyHitsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics key hits get params +func (o *CacheServiceMetricsKeyHitsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics key hits get params +func (o *CacheServiceMetricsKeyHitsGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsKeyHitsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics key hits get params +func (o *CacheServiceMetricsKeyHitsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsKeyHitsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hits_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hits_get_responses.go new file mode 100644 index 0000000000..1bdecfc50f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hits_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsKeyHitsGetReader is a Reader for the CacheServiceMetricsKeyHitsGet structure. +type CacheServiceMetricsKeyHitsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsKeyHitsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsKeyHitsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsKeyHitsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsKeyHitsGetOK creates a CacheServiceMetricsKeyHitsGetOK with default headers values +func NewCacheServiceMetricsKeyHitsGetOK() *CacheServiceMetricsKeyHitsGetOK { + return &CacheServiceMetricsKeyHitsGetOK{} +} + +/* +CacheServiceMetricsKeyHitsGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsKeyHitsGetOK struct { + Payload interface{} +} + +func (o *CacheServiceMetricsKeyHitsGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CacheServiceMetricsKeyHitsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsKeyHitsGetDefault creates a CacheServiceMetricsKeyHitsGetDefault with default headers values +func NewCacheServiceMetricsKeyHitsGetDefault(code int) *CacheServiceMetricsKeyHitsGetDefault { + return &CacheServiceMetricsKeyHitsGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsKeyHitsGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsKeyHitsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics key hits get default response +func (o *CacheServiceMetricsKeyHitsGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsKeyHitsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsKeyHitsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsKeyHitsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hits_moving_avrage_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hits_moving_avrage_get_parameters.go new file mode 100644 index 0000000000..f0964e6cde --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hits_moving_avrage_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsKeyHitsMovingAvrageGetParams creates a new CacheServiceMetricsKeyHitsMovingAvrageGetParams object +// with the default values initialized. +func NewCacheServiceMetricsKeyHitsMovingAvrageGetParams() *CacheServiceMetricsKeyHitsMovingAvrageGetParams { + + return &CacheServiceMetricsKeyHitsMovingAvrageGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsKeyHitsMovingAvrageGetParamsWithTimeout creates a new CacheServiceMetricsKeyHitsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsKeyHitsMovingAvrageGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsKeyHitsMovingAvrageGetParams { + + return &CacheServiceMetricsKeyHitsMovingAvrageGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsKeyHitsMovingAvrageGetParamsWithContext creates a new CacheServiceMetricsKeyHitsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsKeyHitsMovingAvrageGetParamsWithContext(ctx context.Context) *CacheServiceMetricsKeyHitsMovingAvrageGetParams { + + return &CacheServiceMetricsKeyHitsMovingAvrageGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsKeyHitsMovingAvrageGetParamsWithHTTPClient creates a new CacheServiceMetricsKeyHitsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsKeyHitsMovingAvrageGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsKeyHitsMovingAvrageGetParams { + + return &CacheServiceMetricsKeyHitsMovingAvrageGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsKeyHitsMovingAvrageGetParams contains all the parameters to send to the API endpoint +for the cache service metrics key hits moving avrage get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsKeyHitsMovingAvrageGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics key hits moving avrage get params +func (o *CacheServiceMetricsKeyHitsMovingAvrageGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsKeyHitsMovingAvrageGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics key hits moving avrage get params +func (o *CacheServiceMetricsKeyHitsMovingAvrageGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics key hits moving avrage get params +func (o *CacheServiceMetricsKeyHitsMovingAvrageGetParams) WithContext(ctx context.Context) *CacheServiceMetricsKeyHitsMovingAvrageGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics key hits moving avrage get params +func (o *CacheServiceMetricsKeyHitsMovingAvrageGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics key hits moving avrage get params +func (o *CacheServiceMetricsKeyHitsMovingAvrageGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsKeyHitsMovingAvrageGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics key hits moving avrage get params +func (o *CacheServiceMetricsKeyHitsMovingAvrageGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsKeyHitsMovingAvrageGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hits_moving_avrage_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hits_moving_avrage_get_responses.go new file mode 100644 index 0000000000..b4dfb391eb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_hits_moving_avrage_get_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsKeyHitsMovingAvrageGetReader is a Reader for the CacheServiceMetricsKeyHitsMovingAvrageGet structure. +type CacheServiceMetricsKeyHitsMovingAvrageGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsKeyHitsMovingAvrageGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsKeyHitsMovingAvrageGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsKeyHitsMovingAvrageGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsKeyHitsMovingAvrageGetOK creates a CacheServiceMetricsKeyHitsMovingAvrageGetOK with default headers values +func NewCacheServiceMetricsKeyHitsMovingAvrageGetOK() *CacheServiceMetricsKeyHitsMovingAvrageGetOK { + return &CacheServiceMetricsKeyHitsMovingAvrageGetOK{} +} + +/* +CacheServiceMetricsKeyHitsMovingAvrageGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsKeyHitsMovingAvrageGetOK struct { + Payload *models.RateMovingAverage +} + +func (o *CacheServiceMetricsKeyHitsMovingAvrageGetOK) GetPayload() *models.RateMovingAverage { + return o.Payload +} + +func (o *CacheServiceMetricsKeyHitsMovingAvrageGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RateMovingAverage) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsKeyHitsMovingAvrageGetDefault creates a CacheServiceMetricsKeyHitsMovingAvrageGetDefault with default headers values +func NewCacheServiceMetricsKeyHitsMovingAvrageGetDefault(code int) *CacheServiceMetricsKeyHitsMovingAvrageGetDefault { + return &CacheServiceMetricsKeyHitsMovingAvrageGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsKeyHitsMovingAvrageGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsKeyHitsMovingAvrageGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics key hits moving avrage get default response +func (o *CacheServiceMetricsKeyHitsMovingAvrageGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsKeyHitsMovingAvrageGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsKeyHitsMovingAvrageGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsKeyHitsMovingAvrageGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_requests_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_requests_get_parameters.go new file mode 100644 index 0000000000..d710e706fa --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_requests_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsKeyRequestsGetParams creates a new CacheServiceMetricsKeyRequestsGetParams object +// with the default values initialized. +func NewCacheServiceMetricsKeyRequestsGetParams() *CacheServiceMetricsKeyRequestsGetParams { + + return &CacheServiceMetricsKeyRequestsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsKeyRequestsGetParamsWithTimeout creates a new CacheServiceMetricsKeyRequestsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsKeyRequestsGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsKeyRequestsGetParams { + + return &CacheServiceMetricsKeyRequestsGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsKeyRequestsGetParamsWithContext creates a new CacheServiceMetricsKeyRequestsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsKeyRequestsGetParamsWithContext(ctx context.Context) *CacheServiceMetricsKeyRequestsGetParams { + + return &CacheServiceMetricsKeyRequestsGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsKeyRequestsGetParamsWithHTTPClient creates a new CacheServiceMetricsKeyRequestsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsKeyRequestsGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsKeyRequestsGetParams { + + return &CacheServiceMetricsKeyRequestsGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsKeyRequestsGetParams contains all the parameters to send to the API endpoint +for the cache service metrics key requests get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsKeyRequestsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics key requests get params +func (o *CacheServiceMetricsKeyRequestsGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsKeyRequestsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics key requests get params +func (o *CacheServiceMetricsKeyRequestsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics key requests get params +func (o *CacheServiceMetricsKeyRequestsGetParams) WithContext(ctx context.Context) *CacheServiceMetricsKeyRequestsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics key requests get params +func (o *CacheServiceMetricsKeyRequestsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics key requests get params +func (o *CacheServiceMetricsKeyRequestsGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsKeyRequestsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics key requests get params +func (o *CacheServiceMetricsKeyRequestsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsKeyRequestsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_requests_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_requests_get_responses.go new file mode 100644 index 0000000000..fdfa45f704 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_requests_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsKeyRequestsGetReader is a Reader for the CacheServiceMetricsKeyRequestsGet structure. +type CacheServiceMetricsKeyRequestsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsKeyRequestsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsKeyRequestsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsKeyRequestsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsKeyRequestsGetOK creates a CacheServiceMetricsKeyRequestsGetOK with default headers values +func NewCacheServiceMetricsKeyRequestsGetOK() *CacheServiceMetricsKeyRequestsGetOK { + return &CacheServiceMetricsKeyRequestsGetOK{} +} + +/* +CacheServiceMetricsKeyRequestsGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsKeyRequestsGetOK struct { + Payload interface{} +} + +func (o *CacheServiceMetricsKeyRequestsGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CacheServiceMetricsKeyRequestsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsKeyRequestsGetDefault creates a CacheServiceMetricsKeyRequestsGetDefault with default headers values +func NewCacheServiceMetricsKeyRequestsGetDefault(code int) *CacheServiceMetricsKeyRequestsGetDefault { + return &CacheServiceMetricsKeyRequestsGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsKeyRequestsGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsKeyRequestsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics key requests get default response +func (o *CacheServiceMetricsKeyRequestsGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsKeyRequestsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsKeyRequestsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsKeyRequestsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_requests_moving_avrage_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_requests_moving_avrage_get_parameters.go new file mode 100644 index 0000000000..848b4b16ea --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_requests_moving_avrage_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsKeyRequestsMovingAvrageGetParams creates a new CacheServiceMetricsKeyRequestsMovingAvrageGetParams object +// with the default values initialized. +func NewCacheServiceMetricsKeyRequestsMovingAvrageGetParams() *CacheServiceMetricsKeyRequestsMovingAvrageGetParams { + + return &CacheServiceMetricsKeyRequestsMovingAvrageGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsKeyRequestsMovingAvrageGetParamsWithTimeout creates a new CacheServiceMetricsKeyRequestsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsKeyRequestsMovingAvrageGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsKeyRequestsMovingAvrageGetParams { + + return &CacheServiceMetricsKeyRequestsMovingAvrageGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsKeyRequestsMovingAvrageGetParamsWithContext creates a new CacheServiceMetricsKeyRequestsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsKeyRequestsMovingAvrageGetParamsWithContext(ctx context.Context) *CacheServiceMetricsKeyRequestsMovingAvrageGetParams { + + return &CacheServiceMetricsKeyRequestsMovingAvrageGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsKeyRequestsMovingAvrageGetParamsWithHTTPClient creates a new CacheServiceMetricsKeyRequestsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsKeyRequestsMovingAvrageGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsKeyRequestsMovingAvrageGetParams { + + return &CacheServiceMetricsKeyRequestsMovingAvrageGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsKeyRequestsMovingAvrageGetParams contains all the parameters to send to the API endpoint +for the cache service metrics key requests moving avrage get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsKeyRequestsMovingAvrageGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics key requests moving avrage get params +func (o *CacheServiceMetricsKeyRequestsMovingAvrageGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsKeyRequestsMovingAvrageGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics key requests moving avrage get params +func (o *CacheServiceMetricsKeyRequestsMovingAvrageGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics key requests moving avrage get params +func (o *CacheServiceMetricsKeyRequestsMovingAvrageGetParams) WithContext(ctx context.Context) *CacheServiceMetricsKeyRequestsMovingAvrageGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics key requests moving avrage get params +func (o *CacheServiceMetricsKeyRequestsMovingAvrageGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics key requests moving avrage get params +func (o *CacheServiceMetricsKeyRequestsMovingAvrageGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsKeyRequestsMovingAvrageGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics key requests moving avrage get params +func (o *CacheServiceMetricsKeyRequestsMovingAvrageGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsKeyRequestsMovingAvrageGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_requests_moving_avrage_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_requests_moving_avrage_get_responses.go new file mode 100644 index 0000000000..ef11b91d27 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_requests_moving_avrage_get_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsKeyRequestsMovingAvrageGetReader is a Reader for the CacheServiceMetricsKeyRequestsMovingAvrageGet structure. +type CacheServiceMetricsKeyRequestsMovingAvrageGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsKeyRequestsMovingAvrageGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsKeyRequestsMovingAvrageGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsKeyRequestsMovingAvrageGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsKeyRequestsMovingAvrageGetOK creates a CacheServiceMetricsKeyRequestsMovingAvrageGetOK with default headers values +func NewCacheServiceMetricsKeyRequestsMovingAvrageGetOK() *CacheServiceMetricsKeyRequestsMovingAvrageGetOK { + return &CacheServiceMetricsKeyRequestsMovingAvrageGetOK{} +} + +/* +CacheServiceMetricsKeyRequestsMovingAvrageGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsKeyRequestsMovingAvrageGetOK struct { + Payload *models.RateMovingAverage +} + +func (o *CacheServiceMetricsKeyRequestsMovingAvrageGetOK) GetPayload() *models.RateMovingAverage { + return o.Payload +} + +func (o *CacheServiceMetricsKeyRequestsMovingAvrageGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RateMovingAverage) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsKeyRequestsMovingAvrageGetDefault creates a CacheServiceMetricsKeyRequestsMovingAvrageGetDefault with default headers values +func NewCacheServiceMetricsKeyRequestsMovingAvrageGetDefault(code int) *CacheServiceMetricsKeyRequestsMovingAvrageGetDefault { + return &CacheServiceMetricsKeyRequestsMovingAvrageGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsKeyRequestsMovingAvrageGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsKeyRequestsMovingAvrageGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics key requests moving avrage get default response +func (o *CacheServiceMetricsKeyRequestsMovingAvrageGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsKeyRequestsMovingAvrageGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsKeyRequestsMovingAvrageGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsKeyRequestsMovingAvrageGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_size_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_size_get_parameters.go new file mode 100644 index 0000000000..22f91a18c9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_size_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsKeySizeGetParams creates a new CacheServiceMetricsKeySizeGetParams object +// with the default values initialized. +func NewCacheServiceMetricsKeySizeGetParams() *CacheServiceMetricsKeySizeGetParams { + + return &CacheServiceMetricsKeySizeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsKeySizeGetParamsWithTimeout creates a new CacheServiceMetricsKeySizeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsKeySizeGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsKeySizeGetParams { + + return &CacheServiceMetricsKeySizeGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsKeySizeGetParamsWithContext creates a new CacheServiceMetricsKeySizeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsKeySizeGetParamsWithContext(ctx context.Context) *CacheServiceMetricsKeySizeGetParams { + + return &CacheServiceMetricsKeySizeGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsKeySizeGetParamsWithHTTPClient creates a new CacheServiceMetricsKeySizeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsKeySizeGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsKeySizeGetParams { + + return &CacheServiceMetricsKeySizeGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsKeySizeGetParams contains all the parameters to send to the API endpoint +for the cache service metrics key size get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsKeySizeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics key size get params +func (o *CacheServiceMetricsKeySizeGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsKeySizeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics key size get params +func (o *CacheServiceMetricsKeySizeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics key size get params +func (o *CacheServiceMetricsKeySizeGetParams) WithContext(ctx context.Context) *CacheServiceMetricsKeySizeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics key size get params +func (o *CacheServiceMetricsKeySizeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics key size get params +func (o *CacheServiceMetricsKeySizeGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsKeySizeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics key size get params +func (o *CacheServiceMetricsKeySizeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsKeySizeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_size_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_size_get_responses.go new file mode 100644 index 0000000000..40bf61717d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_key_size_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsKeySizeGetReader is a Reader for the CacheServiceMetricsKeySizeGet structure. +type CacheServiceMetricsKeySizeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsKeySizeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsKeySizeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsKeySizeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsKeySizeGetOK creates a CacheServiceMetricsKeySizeGetOK with default headers values +func NewCacheServiceMetricsKeySizeGetOK() *CacheServiceMetricsKeySizeGetOK { + return &CacheServiceMetricsKeySizeGetOK{} +} + +/* +CacheServiceMetricsKeySizeGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsKeySizeGetOK struct { + Payload interface{} +} + +func (o *CacheServiceMetricsKeySizeGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CacheServiceMetricsKeySizeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsKeySizeGetDefault creates a CacheServiceMetricsKeySizeGetDefault with default headers values +func NewCacheServiceMetricsKeySizeGetDefault(code int) *CacheServiceMetricsKeySizeGetDefault { + return &CacheServiceMetricsKeySizeGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsKeySizeGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsKeySizeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics key size get default response +func (o *CacheServiceMetricsKeySizeGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsKeySizeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsKeySizeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsKeySizeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_capacity_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_capacity_get_parameters.go new file mode 100644 index 0000000000..11f402c9e4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_capacity_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsRowCapacityGetParams creates a new CacheServiceMetricsRowCapacityGetParams object +// with the default values initialized. +func NewCacheServiceMetricsRowCapacityGetParams() *CacheServiceMetricsRowCapacityGetParams { + + return &CacheServiceMetricsRowCapacityGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsRowCapacityGetParamsWithTimeout creates a new CacheServiceMetricsRowCapacityGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsRowCapacityGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsRowCapacityGetParams { + + return &CacheServiceMetricsRowCapacityGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsRowCapacityGetParamsWithContext creates a new CacheServiceMetricsRowCapacityGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsRowCapacityGetParamsWithContext(ctx context.Context) *CacheServiceMetricsRowCapacityGetParams { + + return &CacheServiceMetricsRowCapacityGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsRowCapacityGetParamsWithHTTPClient creates a new CacheServiceMetricsRowCapacityGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsRowCapacityGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsRowCapacityGetParams { + + return &CacheServiceMetricsRowCapacityGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsRowCapacityGetParams contains all the parameters to send to the API endpoint +for the cache service metrics row capacity get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsRowCapacityGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics row capacity get params +func (o *CacheServiceMetricsRowCapacityGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsRowCapacityGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics row capacity get params +func (o *CacheServiceMetricsRowCapacityGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics row capacity get params +func (o *CacheServiceMetricsRowCapacityGetParams) WithContext(ctx context.Context) *CacheServiceMetricsRowCapacityGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics row capacity get params +func (o *CacheServiceMetricsRowCapacityGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics row capacity get params +func (o *CacheServiceMetricsRowCapacityGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsRowCapacityGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics row capacity get params +func (o *CacheServiceMetricsRowCapacityGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsRowCapacityGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_capacity_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_capacity_get_responses.go new file mode 100644 index 0000000000..a1a2d24af8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_capacity_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsRowCapacityGetReader is a Reader for the CacheServiceMetricsRowCapacityGet structure. +type CacheServiceMetricsRowCapacityGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsRowCapacityGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsRowCapacityGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsRowCapacityGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsRowCapacityGetOK creates a CacheServiceMetricsRowCapacityGetOK with default headers values +func NewCacheServiceMetricsRowCapacityGetOK() *CacheServiceMetricsRowCapacityGetOK { + return &CacheServiceMetricsRowCapacityGetOK{} +} + +/* +CacheServiceMetricsRowCapacityGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsRowCapacityGetOK struct { + Payload interface{} +} + +func (o *CacheServiceMetricsRowCapacityGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CacheServiceMetricsRowCapacityGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsRowCapacityGetDefault creates a CacheServiceMetricsRowCapacityGetDefault with default headers values +func NewCacheServiceMetricsRowCapacityGetDefault(code int) *CacheServiceMetricsRowCapacityGetDefault { + return &CacheServiceMetricsRowCapacityGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsRowCapacityGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsRowCapacityGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics row capacity get default response +func (o *CacheServiceMetricsRowCapacityGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsRowCapacityGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsRowCapacityGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsRowCapacityGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_entries_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_entries_get_parameters.go new file mode 100644 index 0000000000..f4b49b5b33 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_entries_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsRowEntriesGetParams creates a new CacheServiceMetricsRowEntriesGetParams object +// with the default values initialized. +func NewCacheServiceMetricsRowEntriesGetParams() *CacheServiceMetricsRowEntriesGetParams { + + return &CacheServiceMetricsRowEntriesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsRowEntriesGetParamsWithTimeout creates a new CacheServiceMetricsRowEntriesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsRowEntriesGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsRowEntriesGetParams { + + return &CacheServiceMetricsRowEntriesGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsRowEntriesGetParamsWithContext creates a new CacheServiceMetricsRowEntriesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsRowEntriesGetParamsWithContext(ctx context.Context) *CacheServiceMetricsRowEntriesGetParams { + + return &CacheServiceMetricsRowEntriesGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsRowEntriesGetParamsWithHTTPClient creates a new CacheServiceMetricsRowEntriesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsRowEntriesGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsRowEntriesGetParams { + + return &CacheServiceMetricsRowEntriesGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsRowEntriesGetParams contains all the parameters to send to the API endpoint +for the cache service metrics row entries get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsRowEntriesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics row entries get params +func (o *CacheServiceMetricsRowEntriesGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsRowEntriesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics row entries get params +func (o *CacheServiceMetricsRowEntriesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics row entries get params +func (o *CacheServiceMetricsRowEntriesGetParams) WithContext(ctx context.Context) *CacheServiceMetricsRowEntriesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics row entries get params +func (o *CacheServiceMetricsRowEntriesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics row entries get params +func (o *CacheServiceMetricsRowEntriesGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsRowEntriesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics row entries get params +func (o *CacheServiceMetricsRowEntriesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsRowEntriesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_entries_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_entries_get_responses.go new file mode 100644 index 0000000000..c21a89c5d8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_entries_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsRowEntriesGetReader is a Reader for the CacheServiceMetricsRowEntriesGet structure. +type CacheServiceMetricsRowEntriesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsRowEntriesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsRowEntriesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsRowEntriesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsRowEntriesGetOK creates a CacheServiceMetricsRowEntriesGetOK with default headers values +func NewCacheServiceMetricsRowEntriesGetOK() *CacheServiceMetricsRowEntriesGetOK { + return &CacheServiceMetricsRowEntriesGetOK{} +} + +/* +CacheServiceMetricsRowEntriesGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsRowEntriesGetOK struct { + Payload int32 +} + +func (o *CacheServiceMetricsRowEntriesGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *CacheServiceMetricsRowEntriesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsRowEntriesGetDefault creates a CacheServiceMetricsRowEntriesGetDefault with default headers values +func NewCacheServiceMetricsRowEntriesGetDefault(code int) *CacheServiceMetricsRowEntriesGetDefault { + return &CacheServiceMetricsRowEntriesGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsRowEntriesGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsRowEntriesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics row entries get default response +func (o *CacheServiceMetricsRowEntriesGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsRowEntriesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsRowEntriesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsRowEntriesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hit_rate_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hit_rate_get_parameters.go new file mode 100644 index 0000000000..f6ec3b5c18 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hit_rate_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsRowHitRateGetParams creates a new CacheServiceMetricsRowHitRateGetParams object +// with the default values initialized. +func NewCacheServiceMetricsRowHitRateGetParams() *CacheServiceMetricsRowHitRateGetParams { + + return &CacheServiceMetricsRowHitRateGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsRowHitRateGetParamsWithTimeout creates a new CacheServiceMetricsRowHitRateGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsRowHitRateGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsRowHitRateGetParams { + + return &CacheServiceMetricsRowHitRateGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsRowHitRateGetParamsWithContext creates a new CacheServiceMetricsRowHitRateGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsRowHitRateGetParamsWithContext(ctx context.Context) *CacheServiceMetricsRowHitRateGetParams { + + return &CacheServiceMetricsRowHitRateGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsRowHitRateGetParamsWithHTTPClient creates a new CacheServiceMetricsRowHitRateGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsRowHitRateGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsRowHitRateGetParams { + + return &CacheServiceMetricsRowHitRateGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsRowHitRateGetParams contains all the parameters to send to the API endpoint +for the cache service metrics row hit rate get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsRowHitRateGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics row hit rate get params +func (o *CacheServiceMetricsRowHitRateGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsRowHitRateGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics row hit rate get params +func (o *CacheServiceMetricsRowHitRateGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics row hit rate get params +func (o *CacheServiceMetricsRowHitRateGetParams) WithContext(ctx context.Context) *CacheServiceMetricsRowHitRateGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics row hit rate get params +func (o *CacheServiceMetricsRowHitRateGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics row hit rate get params +func (o *CacheServiceMetricsRowHitRateGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsRowHitRateGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics row hit rate get params +func (o *CacheServiceMetricsRowHitRateGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsRowHitRateGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hit_rate_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hit_rate_get_responses.go new file mode 100644 index 0000000000..ff364d4a08 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hit_rate_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsRowHitRateGetReader is a Reader for the CacheServiceMetricsRowHitRateGet structure. +type CacheServiceMetricsRowHitRateGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsRowHitRateGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsRowHitRateGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsRowHitRateGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsRowHitRateGetOK creates a CacheServiceMetricsRowHitRateGetOK with default headers values +func NewCacheServiceMetricsRowHitRateGetOK() *CacheServiceMetricsRowHitRateGetOK { + return &CacheServiceMetricsRowHitRateGetOK{} +} + +/* +CacheServiceMetricsRowHitRateGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsRowHitRateGetOK struct { + Payload interface{} +} + +func (o *CacheServiceMetricsRowHitRateGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CacheServiceMetricsRowHitRateGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsRowHitRateGetDefault creates a CacheServiceMetricsRowHitRateGetDefault with default headers values +func NewCacheServiceMetricsRowHitRateGetDefault(code int) *CacheServiceMetricsRowHitRateGetDefault { + return &CacheServiceMetricsRowHitRateGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsRowHitRateGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsRowHitRateGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics row hit rate get default response +func (o *CacheServiceMetricsRowHitRateGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsRowHitRateGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsRowHitRateGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsRowHitRateGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hits_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hits_get_parameters.go new file mode 100644 index 0000000000..7b2edbe9a4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hits_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsRowHitsGetParams creates a new CacheServiceMetricsRowHitsGetParams object +// with the default values initialized. +func NewCacheServiceMetricsRowHitsGetParams() *CacheServiceMetricsRowHitsGetParams { + + return &CacheServiceMetricsRowHitsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsRowHitsGetParamsWithTimeout creates a new CacheServiceMetricsRowHitsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsRowHitsGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsRowHitsGetParams { + + return &CacheServiceMetricsRowHitsGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsRowHitsGetParamsWithContext creates a new CacheServiceMetricsRowHitsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsRowHitsGetParamsWithContext(ctx context.Context) *CacheServiceMetricsRowHitsGetParams { + + return &CacheServiceMetricsRowHitsGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsRowHitsGetParamsWithHTTPClient creates a new CacheServiceMetricsRowHitsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsRowHitsGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsRowHitsGetParams { + + return &CacheServiceMetricsRowHitsGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsRowHitsGetParams contains all the parameters to send to the API endpoint +for the cache service metrics row hits get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsRowHitsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics row hits get params +func (o *CacheServiceMetricsRowHitsGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsRowHitsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics row hits get params +func (o *CacheServiceMetricsRowHitsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics row hits get params +func (o *CacheServiceMetricsRowHitsGetParams) WithContext(ctx context.Context) *CacheServiceMetricsRowHitsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics row hits get params +func (o *CacheServiceMetricsRowHitsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics row hits get params +func (o *CacheServiceMetricsRowHitsGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsRowHitsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics row hits get params +func (o *CacheServiceMetricsRowHitsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsRowHitsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hits_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hits_get_responses.go new file mode 100644 index 0000000000..bb624564ed --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hits_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsRowHitsGetReader is a Reader for the CacheServiceMetricsRowHitsGet structure. +type CacheServiceMetricsRowHitsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsRowHitsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsRowHitsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsRowHitsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsRowHitsGetOK creates a CacheServiceMetricsRowHitsGetOK with default headers values +func NewCacheServiceMetricsRowHitsGetOK() *CacheServiceMetricsRowHitsGetOK { + return &CacheServiceMetricsRowHitsGetOK{} +} + +/* +CacheServiceMetricsRowHitsGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsRowHitsGetOK struct { + Payload interface{} +} + +func (o *CacheServiceMetricsRowHitsGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CacheServiceMetricsRowHitsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsRowHitsGetDefault creates a CacheServiceMetricsRowHitsGetDefault with default headers values +func NewCacheServiceMetricsRowHitsGetDefault(code int) *CacheServiceMetricsRowHitsGetDefault { + return &CacheServiceMetricsRowHitsGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsRowHitsGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsRowHitsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics row hits get default response +func (o *CacheServiceMetricsRowHitsGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsRowHitsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsRowHitsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsRowHitsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hits_moving_avrage_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hits_moving_avrage_get_parameters.go new file mode 100644 index 0000000000..b32df73bd5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hits_moving_avrage_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsRowHitsMovingAvrageGetParams creates a new CacheServiceMetricsRowHitsMovingAvrageGetParams object +// with the default values initialized. +func NewCacheServiceMetricsRowHitsMovingAvrageGetParams() *CacheServiceMetricsRowHitsMovingAvrageGetParams { + + return &CacheServiceMetricsRowHitsMovingAvrageGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsRowHitsMovingAvrageGetParamsWithTimeout creates a new CacheServiceMetricsRowHitsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsRowHitsMovingAvrageGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsRowHitsMovingAvrageGetParams { + + return &CacheServiceMetricsRowHitsMovingAvrageGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsRowHitsMovingAvrageGetParamsWithContext creates a new CacheServiceMetricsRowHitsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsRowHitsMovingAvrageGetParamsWithContext(ctx context.Context) *CacheServiceMetricsRowHitsMovingAvrageGetParams { + + return &CacheServiceMetricsRowHitsMovingAvrageGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsRowHitsMovingAvrageGetParamsWithHTTPClient creates a new CacheServiceMetricsRowHitsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsRowHitsMovingAvrageGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsRowHitsMovingAvrageGetParams { + + return &CacheServiceMetricsRowHitsMovingAvrageGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsRowHitsMovingAvrageGetParams contains all the parameters to send to the API endpoint +for the cache service metrics row hits moving avrage get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsRowHitsMovingAvrageGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics row hits moving avrage get params +func (o *CacheServiceMetricsRowHitsMovingAvrageGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsRowHitsMovingAvrageGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics row hits moving avrage get params +func (o *CacheServiceMetricsRowHitsMovingAvrageGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics row hits moving avrage get params +func (o *CacheServiceMetricsRowHitsMovingAvrageGetParams) WithContext(ctx context.Context) *CacheServiceMetricsRowHitsMovingAvrageGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics row hits moving avrage get params +func (o *CacheServiceMetricsRowHitsMovingAvrageGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics row hits moving avrage get params +func (o *CacheServiceMetricsRowHitsMovingAvrageGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsRowHitsMovingAvrageGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics row hits moving avrage get params +func (o *CacheServiceMetricsRowHitsMovingAvrageGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsRowHitsMovingAvrageGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hits_moving_avrage_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hits_moving_avrage_get_responses.go new file mode 100644 index 0000000000..fca46a800c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_hits_moving_avrage_get_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsRowHitsMovingAvrageGetReader is a Reader for the CacheServiceMetricsRowHitsMovingAvrageGet structure. +type CacheServiceMetricsRowHitsMovingAvrageGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsRowHitsMovingAvrageGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsRowHitsMovingAvrageGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsRowHitsMovingAvrageGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsRowHitsMovingAvrageGetOK creates a CacheServiceMetricsRowHitsMovingAvrageGetOK with default headers values +func NewCacheServiceMetricsRowHitsMovingAvrageGetOK() *CacheServiceMetricsRowHitsMovingAvrageGetOK { + return &CacheServiceMetricsRowHitsMovingAvrageGetOK{} +} + +/* +CacheServiceMetricsRowHitsMovingAvrageGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsRowHitsMovingAvrageGetOK struct { + Payload *models.RateMovingAverage +} + +func (o *CacheServiceMetricsRowHitsMovingAvrageGetOK) GetPayload() *models.RateMovingAverage { + return o.Payload +} + +func (o *CacheServiceMetricsRowHitsMovingAvrageGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RateMovingAverage) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsRowHitsMovingAvrageGetDefault creates a CacheServiceMetricsRowHitsMovingAvrageGetDefault with default headers values +func NewCacheServiceMetricsRowHitsMovingAvrageGetDefault(code int) *CacheServiceMetricsRowHitsMovingAvrageGetDefault { + return &CacheServiceMetricsRowHitsMovingAvrageGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsRowHitsMovingAvrageGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsRowHitsMovingAvrageGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics row hits moving avrage get default response +func (o *CacheServiceMetricsRowHitsMovingAvrageGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsRowHitsMovingAvrageGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsRowHitsMovingAvrageGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsRowHitsMovingAvrageGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_requests_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_requests_get_parameters.go new file mode 100644 index 0000000000..57cf49e978 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_requests_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsRowRequestsGetParams creates a new CacheServiceMetricsRowRequestsGetParams object +// with the default values initialized. +func NewCacheServiceMetricsRowRequestsGetParams() *CacheServiceMetricsRowRequestsGetParams { + + return &CacheServiceMetricsRowRequestsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsRowRequestsGetParamsWithTimeout creates a new CacheServiceMetricsRowRequestsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsRowRequestsGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsRowRequestsGetParams { + + return &CacheServiceMetricsRowRequestsGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsRowRequestsGetParamsWithContext creates a new CacheServiceMetricsRowRequestsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsRowRequestsGetParamsWithContext(ctx context.Context) *CacheServiceMetricsRowRequestsGetParams { + + return &CacheServiceMetricsRowRequestsGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsRowRequestsGetParamsWithHTTPClient creates a new CacheServiceMetricsRowRequestsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsRowRequestsGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsRowRequestsGetParams { + + return &CacheServiceMetricsRowRequestsGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsRowRequestsGetParams contains all the parameters to send to the API endpoint +for the cache service metrics row requests get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsRowRequestsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics row requests get params +func (o *CacheServiceMetricsRowRequestsGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsRowRequestsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics row requests get params +func (o *CacheServiceMetricsRowRequestsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics row requests get params +func (o *CacheServiceMetricsRowRequestsGetParams) WithContext(ctx context.Context) *CacheServiceMetricsRowRequestsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics row requests get params +func (o *CacheServiceMetricsRowRequestsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics row requests get params +func (o *CacheServiceMetricsRowRequestsGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsRowRequestsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics row requests get params +func (o *CacheServiceMetricsRowRequestsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsRowRequestsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_requests_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_requests_get_responses.go new file mode 100644 index 0000000000..fe083b4c18 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_requests_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsRowRequestsGetReader is a Reader for the CacheServiceMetricsRowRequestsGet structure. +type CacheServiceMetricsRowRequestsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsRowRequestsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsRowRequestsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsRowRequestsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsRowRequestsGetOK creates a CacheServiceMetricsRowRequestsGetOK with default headers values +func NewCacheServiceMetricsRowRequestsGetOK() *CacheServiceMetricsRowRequestsGetOK { + return &CacheServiceMetricsRowRequestsGetOK{} +} + +/* +CacheServiceMetricsRowRequestsGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsRowRequestsGetOK struct { + Payload interface{} +} + +func (o *CacheServiceMetricsRowRequestsGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CacheServiceMetricsRowRequestsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsRowRequestsGetDefault creates a CacheServiceMetricsRowRequestsGetDefault with default headers values +func NewCacheServiceMetricsRowRequestsGetDefault(code int) *CacheServiceMetricsRowRequestsGetDefault { + return &CacheServiceMetricsRowRequestsGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsRowRequestsGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsRowRequestsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics row requests get default response +func (o *CacheServiceMetricsRowRequestsGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsRowRequestsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsRowRequestsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsRowRequestsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_requests_moving_avrage_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_requests_moving_avrage_get_parameters.go new file mode 100644 index 0000000000..22bec6db3d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_requests_moving_avrage_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsRowRequestsMovingAvrageGetParams creates a new CacheServiceMetricsRowRequestsMovingAvrageGetParams object +// with the default values initialized. +func NewCacheServiceMetricsRowRequestsMovingAvrageGetParams() *CacheServiceMetricsRowRequestsMovingAvrageGetParams { + + return &CacheServiceMetricsRowRequestsMovingAvrageGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsRowRequestsMovingAvrageGetParamsWithTimeout creates a new CacheServiceMetricsRowRequestsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsRowRequestsMovingAvrageGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsRowRequestsMovingAvrageGetParams { + + return &CacheServiceMetricsRowRequestsMovingAvrageGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsRowRequestsMovingAvrageGetParamsWithContext creates a new CacheServiceMetricsRowRequestsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsRowRequestsMovingAvrageGetParamsWithContext(ctx context.Context) *CacheServiceMetricsRowRequestsMovingAvrageGetParams { + + return &CacheServiceMetricsRowRequestsMovingAvrageGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsRowRequestsMovingAvrageGetParamsWithHTTPClient creates a new CacheServiceMetricsRowRequestsMovingAvrageGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsRowRequestsMovingAvrageGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsRowRequestsMovingAvrageGetParams { + + return &CacheServiceMetricsRowRequestsMovingAvrageGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsRowRequestsMovingAvrageGetParams contains all the parameters to send to the API endpoint +for the cache service metrics row requests moving avrage get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsRowRequestsMovingAvrageGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics row requests moving avrage get params +func (o *CacheServiceMetricsRowRequestsMovingAvrageGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsRowRequestsMovingAvrageGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics row requests moving avrage get params +func (o *CacheServiceMetricsRowRequestsMovingAvrageGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics row requests moving avrage get params +func (o *CacheServiceMetricsRowRequestsMovingAvrageGetParams) WithContext(ctx context.Context) *CacheServiceMetricsRowRequestsMovingAvrageGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics row requests moving avrage get params +func (o *CacheServiceMetricsRowRequestsMovingAvrageGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics row requests moving avrage get params +func (o *CacheServiceMetricsRowRequestsMovingAvrageGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsRowRequestsMovingAvrageGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics row requests moving avrage get params +func (o *CacheServiceMetricsRowRequestsMovingAvrageGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsRowRequestsMovingAvrageGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_requests_moving_avrage_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_requests_moving_avrage_get_responses.go new file mode 100644 index 0000000000..50972f19c6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_requests_moving_avrage_get_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsRowRequestsMovingAvrageGetReader is a Reader for the CacheServiceMetricsRowRequestsMovingAvrageGet structure. +type CacheServiceMetricsRowRequestsMovingAvrageGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsRowRequestsMovingAvrageGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsRowRequestsMovingAvrageGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsRowRequestsMovingAvrageGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsRowRequestsMovingAvrageGetOK creates a CacheServiceMetricsRowRequestsMovingAvrageGetOK with default headers values +func NewCacheServiceMetricsRowRequestsMovingAvrageGetOK() *CacheServiceMetricsRowRequestsMovingAvrageGetOK { + return &CacheServiceMetricsRowRequestsMovingAvrageGetOK{} +} + +/* +CacheServiceMetricsRowRequestsMovingAvrageGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsRowRequestsMovingAvrageGetOK struct { + Payload *models.RateMovingAverage +} + +func (o *CacheServiceMetricsRowRequestsMovingAvrageGetOK) GetPayload() *models.RateMovingAverage { + return o.Payload +} + +func (o *CacheServiceMetricsRowRequestsMovingAvrageGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RateMovingAverage) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsRowRequestsMovingAvrageGetDefault creates a CacheServiceMetricsRowRequestsMovingAvrageGetDefault with default headers values +func NewCacheServiceMetricsRowRequestsMovingAvrageGetDefault(code int) *CacheServiceMetricsRowRequestsMovingAvrageGetDefault { + return &CacheServiceMetricsRowRequestsMovingAvrageGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsRowRequestsMovingAvrageGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsRowRequestsMovingAvrageGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics row requests moving avrage get default response +func (o *CacheServiceMetricsRowRequestsMovingAvrageGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsRowRequestsMovingAvrageGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsRowRequestsMovingAvrageGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsRowRequestsMovingAvrageGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_size_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_size_get_parameters.go new file mode 100644 index 0000000000..44c486be0a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_size_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceMetricsRowSizeGetParams creates a new CacheServiceMetricsRowSizeGetParams object +// with the default values initialized. +func NewCacheServiceMetricsRowSizeGetParams() *CacheServiceMetricsRowSizeGetParams { + + return &CacheServiceMetricsRowSizeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceMetricsRowSizeGetParamsWithTimeout creates a new CacheServiceMetricsRowSizeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceMetricsRowSizeGetParamsWithTimeout(timeout time.Duration) *CacheServiceMetricsRowSizeGetParams { + + return &CacheServiceMetricsRowSizeGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceMetricsRowSizeGetParamsWithContext creates a new CacheServiceMetricsRowSizeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceMetricsRowSizeGetParamsWithContext(ctx context.Context) *CacheServiceMetricsRowSizeGetParams { + + return &CacheServiceMetricsRowSizeGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceMetricsRowSizeGetParamsWithHTTPClient creates a new CacheServiceMetricsRowSizeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceMetricsRowSizeGetParamsWithHTTPClient(client *http.Client) *CacheServiceMetricsRowSizeGetParams { + + return &CacheServiceMetricsRowSizeGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceMetricsRowSizeGetParams contains all the parameters to send to the API endpoint +for the cache service metrics row size get operation typically these are written to a http.Request +*/ +type CacheServiceMetricsRowSizeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service metrics row size get params +func (o *CacheServiceMetricsRowSizeGetParams) WithTimeout(timeout time.Duration) *CacheServiceMetricsRowSizeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service metrics row size get params +func (o *CacheServiceMetricsRowSizeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service metrics row size get params +func (o *CacheServiceMetricsRowSizeGetParams) WithContext(ctx context.Context) *CacheServiceMetricsRowSizeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service metrics row size get params +func (o *CacheServiceMetricsRowSizeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service metrics row size get params +func (o *CacheServiceMetricsRowSizeGetParams) WithHTTPClient(client *http.Client) *CacheServiceMetricsRowSizeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service metrics row size get params +func (o *CacheServiceMetricsRowSizeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceMetricsRowSizeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_size_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_size_get_responses.go new file mode 100644 index 0000000000..8996e07702 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_metrics_row_size_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceMetricsRowSizeGetReader is a Reader for the CacheServiceMetricsRowSizeGet structure. +type CacheServiceMetricsRowSizeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceMetricsRowSizeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceMetricsRowSizeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceMetricsRowSizeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceMetricsRowSizeGetOK creates a CacheServiceMetricsRowSizeGetOK with default headers values +func NewCacheServiceMetricsRowSizeGetOK() *CacheServiceMetricsRowSizeGetOK { + return &CacheServiceMetricsRowSizeGetOK{} +} + +/* +CacheServiceMetricsRowSizeGetOK handles this case with default header values. + +Success +*/ +type CacheServiceMetricsRowSizeGetOK struct { + Payload interface{} +} + +func (o *CacheServiceMetricsRowSizeGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CacheServiceMetricsRowSizeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceMetricsRowSizeGetDefault creates a CacheServiceMetricsRowSizeGetDefault with default headers values +func NewCacheServiceMetricsRowSizeGetDefault(code int) *CacheServiceMetricsRowSizeGetDefault { + return &CacheServiceMetricsRowSizeGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceMetricsRowSizeGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceMetricsRowSizeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service metrics row size get default response +func (o *CacheServiceMetricsRowSizeGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceMetricsRowSizeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceMetricsRowSizeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceMetricsRowSizeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_capacity_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_capacity_post_parameters.go new file mode 100644 index 0000000000..39646fcf24 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_capacity_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceRowCacheCapacityPostParams creates a new CacheServiceRowCacheCapacityPostParams object +// with the default values initialized. +func NewCacheServiceRowCacheCapacityPostParams() *CacheServiceRowCacheCapacityPostParams { + var () + return &CacheServiceRowCacheCapacityPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceRowCacheCapacityPostParamsWithTimeout creates a new CacheServiceRowCacheCapacityPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceRowCacheCapacityPostParamsWithTimeout(timeout time.Duration) *CacheServiceRowCacheCapacityPostParams { + var () + return &CacheServiceRowCacheCapacityPostParams{ + + timeout: timeout, + } +} + +// NewCacheServiceRowCacheCapacityPostParamsWithContext creates a new CacheServiceRowCacheCapacityPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceRowCacheCapacityPostParamsWithContext(ctx context.Context) *CacheServiceRowCacheCapacityPostParams { + var () + return &CacheServiceRowCacheCapacityPostParams{ + + Context: ctx, + } +} + +// NewCacheServiceRowCacheCapacityPostParamsWithHTTPClient creates a new CacheServiceRowCacheCapacityPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceRowCacheCapacityPostParamsWithHTTPClient(client *http.Client) *CacheServiceRowCacheCapacityPostParams { + var () + return &CacheServiceRowCacheCapacityPostParams{ + HTTPClient: client, + } +} + +/* +CacheServiceRowCacheCapacityPostParams contains all the parameters to send to the API endpoint +for the cache service row cache capacity post operation typically these are written to a http.Request +*/ +type CacheServiceRowCacheCapacityPostParams struct { + + /*Capacity + row cache capacity in mb + + */ + Capacity string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service row cache capacity post params +func (o *CacheServiceRowCacheCapacityPostParams) WithTimeout(timeout time.Duration) *CacheServiceRowCacheCapacityPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service row cache capacity post params +func (o *CacheServiceRowCacheCapacityPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service row cache capacity post params +func (o *CacheServiceRowCacheCapacityPostParams) WithContext(ctx context.Context) *CacheServiceRowCacheCapacityPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service row cache capacity post params +func (o *CacheServiceRowCacheCapacityPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service row cache capacity post params +func (o *CacheServiceRowCacheCapacityPostParams) WithHTTPClient(client *http.Client) *CacheServiceRowCacheCapacityPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service row cache capacity post params +func (o *CacheServiceRowCacheCapacityPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCapacity adds the capacity to the cache service row cache capacity post params +func (o *CacheServiceRowCacheCapacityPostParams) WithCapacity(capacity string) *CacheServiceRowCacheCapacityPostParams { + o.SetCapacity(capacity) + return o +} + +// SetCapacity adds the capacity to the cache service row cache capacity post params +func (o *CacheServiceRowCacheCapacityPostParams) SetCapacity(capacity string) { + o.Capacity = capacity +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceRowCacheCapacityPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param capacity + qrCapacity := o.Capacity + qCapacity := qrCapacity + if qCapacity != "" { + if err := r.SetQueryParam("capacity", qCapacity); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_capacity_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_capacity_post_responses.go new file mode 100644 index 0000000000..f83c1470b9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_capacity_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceRowCacheCapacityPostReader is a Reader for the CacheServiceRowCacheCapacityPost structure. +type CacheServiceRowCacheCapacityPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceRowCacheCapacityPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceRowCacheCapacityPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceRowCacheCapacityPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceRowCacheCapacityPostOK creates a CacheServiceRowCacheCapacityPostOK with default headers values +func NewCacheServiceRowCacheCapacityPostOK() *CacheServiceRowCacheCapacityPostOK { + return &CacheServiceRowCacheCapacityPostOK{} +} + +/* +CacheServiceRowCacheCapacityPostOK handles this case with default header values. + +Success +*/ +type CacheServiceRowCacheCapacityPostOK struct { +} + +func (o *CacheServiceRowCacheCapacityPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCacheServiceRowCacheCapacityPostDefault creates a CacheServiceRowCacheCapacityPostDefault with default headers values +func NewCacheServiceRowCacheCapacityPostDefault(code int) *CacheServiceRowCacheCapacityPostDefault { + return &CacheServiceRowCacheCapacityPostDefault{ + _statusCode: code, + } +} + +/* +CacheServiceRowCacheCapacityPostDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceRowCacheCapacityPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service row cache capacity post default response +func (o *CacheServiceRowCacheCapacityPostDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceRowCacheCapacityPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceRowCacheCapacityPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceRowCacheCapacityPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_keys_to_save_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_keys_to_save_get_parameters.go new file mode 100644 index 0000000000..ec8068ac07 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_keys_to_save_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceRowCacheKeysToSaveGetParams creates a new CacheServiceRowCacheKeysToSaveGetParams object +// with the default values initialized. +func NewCacheServiceRowCacheKeysToSaveGetParams() *CacheServiceRowCacheKeysToSaveGetParams { + + return &CacheServiceRowCacheKeysToSaveGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceRowCacheKeysToSaveGetParamsWithTimeout creates a new CacheServiceRowCacheKeysToSaveGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceRowCacheKeysToSaveGetParamsWithTimeout(timeout time.Duration) *CacheServiceRowCacheKeysToSaveGetParams { + + return &CacheServiceRowCacheKeysToSaveGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceRowCacheKeysToSaveGetParamsWithContext creates a new CacheServiceRowCacheKeysToSaveGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceRowCacheKeysToSaveGetParamsWithContext(ctx context.Context) *CacheServiceRowCacheKeysToSaveGetParams { + + return &CacheServiceRowCacheKeysToSaveGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceRowCacheKeysToSaveGetParamsWithHTTPClient creates a new CacheServiceRowCacheKeysToSaveGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceRowCacheKeysToSaveGetParamsWithHTTPClient(client *http.Client) *CacheServiceRowCacheKeysToSaveGetParams { + + return &CacheServiceRowCacheKeysToSaveGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceRowCacheKeysToSaveGetParams contains all the parameters to send to the API endpoint +for the cache service row cache keys to save get operation typically these are written to a http.Request +*/ +type CacheServiceRowCacheKeysToSaveGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service row cache keys to save get params +func (o *CacheServiceRowCacheKeysToSaveGetParams) WithTimeout(timeout time.Duration) *CacheServiceRowCacheKeysToSaveGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service row cache keys to save get params +func (o *CacheServiceRowCacheKeysToSaveGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service row cache keys to save get params +func (o *CacheServiceRowCacheKeysToSaveGetParams) WithContext(ctx context.Context) *CacheServiceRowCacheKeysToSaveGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service row cache keys to save get params +func (o *CacheServiceRowCacheKeysToSaveGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service row cache keys to save get params +func (o *CacheServiceRowCacheKeysToSaveGetParams) WithHTTPClient(client *http.Client) *CacheServiceRowCacheKeysToSaveGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service row cache keys to save get params +func (o *CacheServiceRowCacheKeysToSaveGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceRowCacheKeysToSaveGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_keys_to_save_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_keys_to_save_get_responses.go new file mode 100644 index 0000000000..ee55946eb3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_keys_to_save_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceRowCacheKeysToSaveGetReader is a Reader for the CacheServiceRowCacheKeysToSaveGet structure. +type CacheServiceRowCacheKeysToSaveGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceRowCacheKeysToSaveGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceRowCacheKeysToSaveGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceRowCacheKeysToSaveGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceRowCacheKeysToSaveGetOK creates a CacheServiceRowCacheKeysToSaveGetOK with default headers values +func NewCacheServiceRowCacheKeysToSaveGetOK() *CacheServiceRowCacheKeysToSaveGetOK { + return &CacheServiceRowCacheKeysToSaveGetOK{} +} + +/* +CacheServiceRowCacheKeysToSaveGetOK handles this case with default header values. + +Success +*/ +type CacheServiceRowCacheKeysToSaveGetOK struct { + Payload int32 +} + +func (o *CacheServiceRowCacheKeysToSaveGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *CacheServiceRowCacheKeysToSaveGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceRowCacheKeysToSaveGetDefault creates a CacheServiceRowCacheKeysToSaveGetDefault with default headers values +func NewCacheServiceRowCacheKeysToSaveGetDefault(code int) *CacheServiceRowCacheKeysToSaveGetDefault { + return &CacheServiceRowCacheKeysToSaveGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceRowCacheKeysToSaveGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceRowCacheKeysToSaveGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service row cache keys to save get default response +func (o *CacheServiceRowCacheKeysToSaveGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceRowCacheKeysToSaveGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceRowCacheKeysToSaveGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceRowCacheKeysToSaveGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_keys_to_save_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_keys_to_save_post_parameters.go new file mode 100644 index 0000000000..f552f23580 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_keys_to_save_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCacheServiceRowCacheKeysToSavePostParams creates a new CacheServiceRowCacheKeysToSavePostParams object +// with the default values initialized. +func NewCacheServiceRowCacheKeysToSavePostParams() *CacheServiceRowCacheKeysToSavePostParams { + var () + return &CacheServiceRowCacheKeysToSavePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceRowCacheKeysToSavePostParamsWithTimeout creates a new CacheServiceRowCacheKeysToSavePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceRowCacheKeysToSavePostParamsWithTimeout(timeout time.Duration) *CacheServiceRowCacheKeysToSavePostParams { + var () + return &CacheServiceRowCacheKeysToSavePostParams{ + + timeout: timeout, + } +} + +// NewCacheServiceRowCacheKeysToSavePostParamsWithContext creates a new CacheServiceRowCacheKeysToSavePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceRowCacheKeysToSavePostParamsWithContext(ctx context.Context) *CacheServiceRowCacheKeysToSavePostParams { + var () + return &CacheServiceRowCacheKeysToSavePostParams{ + + Context: ctx, + } +} + +// NewCacheServiceRowCacheKeysToSavePostParamsWithHTTPClient creates a new CacheServiceRowCacheKeysToSavePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceRowCacheKeysToSavePostParamsWithHTTPClient(client *http.Client) *CacheServiceRowCacheKeysToSavePostParams { + var () + return &CacheServiceRowCacheKeysToSavePostParams{ + HTTPClient: client, + } +} + +/* +CacheServiceRowCacheKeysToSavePostParams contains all the parameters to send to the API endpoint +for the cache service row cache keys to save post operation typically these are written to a http.Request +*/ +type CacheServiceRowCacheKeysToSavePostParams struct { + + /*Rckts + row cache keys to save + + */ + Rckts int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service row cache keys to save post params +func (o *CacheServiceRowCacheKeysToSavePostParams) WithTimeout(timeout time.Duration) *CacheServiceRowCacheKeysToSavePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service row cache keys to save post params +func (o *CacheServiceRowCacheKeysToSavePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service row cache keys to save post params +func (o *CacheServiceRowCacheKeysToSavePostParams) WithContext(ctx context.Context) *CacheServiceRowCacheKeysToSavePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service row cache keys to save post params +func (o *CacheServiceRowCacheKeysToSavePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service row cache keys to save post params +func (o *CacheServiceRowCacheKeysToSavePostParams) WithHTTPClient(client *http.Client) *CacheServiceRowCacheKeysToSavePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service row cache keys to save post params +func (o *CacheServiceRowCacheKeysToSavePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRckts adds the rckts to the cache service row cache keys to save post params +func (o *CacheServiceRowCacheKeysToSavePostParams) WithRckts(rckts int32) *CacheServiceRowCacheKeysToSavePostParams { + o.SetRckts(rckts) + return o +} + +// SetRckts adds the rckts to the cache service row cache keys to save post params +func (o *CacheServiceRowCacheKeysToSavePostParams) SetRckts(rckts int32) { + o.Rckts = rckts +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceRowCacheKeysToSavePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param rckts + qrRckts := o.Rckts + qRckts := swag.FormatInt32(qrRckts) + if qRckts != "" { + if err := r.SetQueryParam("rckts", qRckts); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_keys_to_save_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_keys_to_save_post_responses.go new file mode 100644 index 0000000000..2ca360176f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_keys_to_save_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceRowCacheKeysToSavePostReader is a Reader for the CacheServiceRowCacheKeysToSavePost structure. +type CacheServiceRowCacheKeysToSavePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceRowCacheKeysToSavePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceRowCacheKeysToSavePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceRowCacheKeysToSavePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceRowCacheKeysToSavePostOK creates a CacheServiceRowCacheKeysToSavePostOK with default headers values +func NewCacheServiceRowCacheKeysToSavePostOK() *CacheServiceRowCacheKeysToSavePostOK { + return &CacheServiceRowCacheKeysToSavePostOK{} +} + +/* +CacheServiceRowCacheKeysToSavePostOK handles this case with default header values. + +Success +*/ +type CacheServiceRowCacheKeysToSavePostOK struct { +} + +func (o *CacheServiceRowCacheKeysToSavePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCacheServiceRowCacheKeysToSavePostDefault creates a CacheServiceRowCacheKeysToSavePostDefault with default headers values +func NewCacheServiceRowCacheKeysToSavePostDefault(code int) *CacheServiceRowCacheKeysToSavePostDefault { + return &CacheServiceRowCacheKeysToSavePostDefault{ + _statusCode: code, + } +} + +/* +CacheServiceRowCacheKeysToSavePostDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceRowCacheKeysToSavePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service row cache keys to save post default response +func (o *CacheServiceRowCacheKeysToSavePostDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceRowCacheKeysToSavePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceRowCacheKeysToSavePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceRowCacheKeysToSavePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_save_period_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_save_period_get_parameters.go new file mode 100644 index 0000000000..326f6fbb41 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_save_period_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceRowCacheSavePeriodGetParams creates a new CacheServiceRowCacheSavePeriodGetParams object +// with the default values initialized. +func NewCacheServiceRowCacheSavePeriodGetParams() *CacheServiceRowCacheSavePeriodGetParams { + + return &CacheServiceRowCacheSavePeriodGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceRowCacheSavePeriodGetParamsWithTimeout creates a new CacheServiceRowCacheSavePeriodGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceRowCacheSavePeriodGetParamsWithTimeout(timeout time.Duration) *CacheServiceRowCacheSavePeriodGetParams { + + return &CacheServiceRowCacheSavePeriodGetParams{ + + timeout: timeout, + } +} + +// NewCacheServiceRowCacheSavePeriodGetParamsWithContext creates a new CacheServiceRowCacheSavePeriodGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceRowCacheSavePeriodGetParamsWithContext(ctx context.Context) *CacheServiceRowCacheSavePeriodGetParams { + + return &CacheServiceRowCacheSavePeriodGetParams{ + + Context: ctx, + } +} + +// NewCacheServiceRowCacheSavePeriodGetParamsWithHTTPClient creates a new CacheServiceRowCacheSavePeriodGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceRowCacheSavePeriodGetParamsWithHTTPClient(client *http.Client) *CacheServiceRowCacheSavePeriodGetParams { + + return &CacheServiceRowCacheSavePeriodGetParams{ + HTTPClient: client, + } +} + +/* +CacheServiceRowCacheSavePeriodGetParams contains all the parameters to send to the API endpoint +for the cache service row cache save period get operation typically these are written to a http.Request +*/ +type CacheServiceRowCacheSavePeriodGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service row cache save period get params +func (o *CacheServiceRowCacheSavePeriodGetParams) WithTimeout(timeout time.Duration) *CacheServiceRowCacheSavePeriodGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service row cache save period get params +func (o *CacheServiceRowCacheSavePeriodGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service row cache save period get params +func (o *CacheServiceRowCacheSavePeriodGetParams) WithContext(ctx context.Context) *CacheServiceRowCacheSavePeriodGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service row cache save period get params +func (o *CacheServiceRowCacheSavePeriodGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service row cache save period get params +func (o *CacheServiceRowCacheSavePeriodGetParams) WithHTTPClient(client *http.Client) *CacheServiceRowCacheSavePeriodGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service row cache save period get params +func (o *CacheServiceRowCacheSavePeriodGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceRowCacheSavePeriodGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_save_period_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_save_period_get_responses.go new file mode 100644 index 0000000000..6fbc7e49e5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_save_period_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceRowCacheSavePeriodGetReader is a Reader for the CacheServiceRowCacheSavePeriodGet structure. +type CacheServiceRowCacheSavePeriodGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceRowCacheSavePeriodGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceRowCacheSavePeriodGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceRowCacheSavePeriodGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceRowCacheSavePeriodGetOK creates a CacheServiceRowCacheSavePeriodGetOK with default headers values +func NewCacheServiceRowCacheSavePeriodGetOK() *CacheServiceRowCacheSavePeriodGetOK { + return &CacheServiceRowCacheSavePeriodGetOK{} +} + +/* +CacheServiceRowCacheSavePeriodGetOK handles this case with default header values. + +Success +*/ +type CacheServiceRowCacheSavePeriodGetOK struct { + Payload int32 +} + +func (o *CacheServiceRowCacheSavePeriodGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *CacheServiceRowCacheSavePeriodGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCacheServiceRowCacheSavePeriodGetDefault creates a CacheServiceRowCacheSavePeriodGetDefault with default headers values +func NewCacheServiceRowCacheSavePeriodGetDefault(code int) *CacheServiceRowCacheSavePeriodGetDefault { + return &CacheServiceRowCacheSavePeriodGetDefault{ + _statusCode: code, + } +} + +/* +CacheServiceRowCacheSavePeriodGetDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceRowCacheSavePeriodGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service row cache save period get default response +func (o *CacheServiceRowCacheSavePeriodGetDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceRowCacheSavePeriodGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceRowCacheSavePeriodGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceRowCacheSavePeriodGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_save_period_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_save_period_post_parameters.go new file mode 100644 index 0000000000..ccc2d3a332 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_save_period_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCacheServiceRowCacheSavePeriodPostParams creates a new CacheServiceRowCacheSavePeriodPostParams object +// with the default values initialized. +func NewCacheServiceRowCacheSavePeriodPostParams() *CacheServiceRowCacheSavePeriodPostParams { + var () + return &CacheServiceRowCacheSavePeriodPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceRowCacheSavePeriodPostParamsWithTimeout creates a new CacheServiceRowCacheSavePeriodPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceRowCacheSavePeriodPostParamsWithTimeout(timeout time.Duration) *CacheServiceRowCacheSavePeriodPostParams { + var () + return &CacheServiceRowCacheSavePeriodPostParams{ + + timeout: timeout, + } +} + +// NewCacheServiceRowCacheSavePeriodPostParamsWithContext creates a new CacheServiceRowCacheSavePeriodPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceRowCacheSavePeriodPostParamsWithContext(ctx context.Context) *CacheServiceRowCacheSavePeriodPostParams { + var () + return &CacheServiceRowCacheSavePeriodPostParams{ + + Context: ctx, + } +} + +// NewCacheServiceRowCacheSavePeriodPostParamsWithHTTPClient creates a new CacheServiceRowCacheSavePeriodPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceRowCacheSavePeriodPostParamsWithHTTPClient(client *http.Client) *CacheServiceRowCacheSavePeriodPostParams { + var () + return &CacheServiceRowCacheSavePeriodPostParams{ + HTTPClient: client, + } +} + +/* +CacheServiceRowCacheSavePeriodPostParams contains all the parameters to send to the API endpoint +for the cache service row cache save period post operation typically these are written to a http.Request +*/ +type CacheServiceRowCacheSavePeriodPostParams struct { + + /*Period + row cache save period in seconds + + */ + Period int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service row cache save period post params +func (o *CacheServiceRowCacheSavePeriodPostParams) WithTimeout(timeout time.Duration) *CacheServiceRowCacheSavePeriodPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service row cache save period post params +func (o *CacheServiceRowCacheSavePeriodPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service row cache save period post params +func (o *CacheServiceRowCacheSavePeriodPostParams) WithContext(ctx context.Context) *CacheServiceRowCacheSavePeriodPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service row cache save period post params +func (o *CacheServiceRowCacheSavePeriodPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service row cache save period post params +func (o *CacheServiceRowCacheSavePeriodPostParams) WithHTTPClient(client *http.Client) *CacheServiceRowCacheSavePeriodPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service row cache save period post params +func (o *CacheServiceRowCacheSavePeriodPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPeriod adds the period to the cache service row cache save period post params +func (o *CacheServiceRowCacheSavePeriodPostParams) WithPeriod(period int32) *CacheServiceRowCacheSavePeriodPostParams { + o.SetPeriod(period) + return o +} + +// SetPeriod adds the period to the cache service row cache save period post params +func (o *CacheServiceRowCacheSavePeriodPostParams) SetPeriod(period int32) { + o.Period = period +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceRowCacheSavePeriodPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param period + qrPeriod := o.Period + qPeriod := swag.FormatInt32(qrPeriod) + if qPeriod != "" { + if err := r.SetQueryParam("period", qPeriod); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_save_period_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_save_period_post_responses.go new file mode 100644 index 0000000000..3c99dace60 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_row_cache_save_period_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceRowCacheSavePeriodPostReader is a Reader for the CacheServiceRowCacheSavePeriodPost structure. +type CacheServiceRowCacheSavePeriodPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceRowCacheSavePeriodPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceRowCacheSavePeriodPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceRowCacheSavePeriodPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceRowCacheSavePeriodPostOK creates a CacheServiceRowCacheSavePeriodPostOK with default headers values +func NewCacheServiceRowCacheSavePeriodPostOK() *CacheServiceRowCacheSavePeriodPostOK { + return &CacheServiceRowCacheSavePeriodPostOK{} +} + +/* +CacheServiceRowCacheSavePeriodPostOK handles this case with default header values. + +Success +*/ +type CacheServiceRowCacheSavePeriodPostOK struct { +} + +func (o *CacheServiceRowCacheSavePeriodPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCacheServiceRowCacheSavePeriodPostDefault creates a CacheServiceRowCacheSavePeriodPostDefault with default headers values +func NewCacheServiceRowCacheSavePeriodPostDefault(code int) *CacheServiceRowCacheSavePeriodPostDefault { + return &CacheServiceRowCacheSavePeriodPostDefault{ + _statusCode: code, + } +} + +/* +CacheServiceRowCacheSavePeriodPostDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceRowCacheSavePeriodPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service row cache save period post default response +func (o *CacheServiceRowCacheSavePeriodPostDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceRowCacheSavePeriodPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceRowCacheSavePeriodPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceRowCacheSavePeriodPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_save_caches_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_save_caches_post_parameters.go new file mode 100644 index 0000000000..a10cfcac07 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_save_caches_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCacheServiceSaveCachesPostParams creates a new CacheServiceSaveCachesPostParams object +// with the default values initialized. +func NewCacheServiceSaveCachesPostParams() *CacheServiceSaveCachesPostParams { + + return &CacheServiceSaveCachesPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCacheServiceSaveCachesPostParamsWithTimeout creates a new CacheServiceSaveCachesPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCacheServiceSaveCachesPostParamsWithTimeout(timeout time.Duration) *CacheServiceSaveCachesPostParams { + + return &CacheServiceSaveCachesPostParams{ + + timeout: timeout, + } +} + +// NewCacheServiceSaveCachesPostParamsWithContext creates a new CacheServiceSaveCachesPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCacheServiceSaveCachesPostParamsWithContext(ctx context.Context) *CacheServiceSaveCachesPostParams { + + return &CacheServiceSaveCachesPostParams{ + + Context: ctx, + } +} + +// NewCacheServiceSaveCachesPostParamsWithHTTPClient creates a new CacheServiceSaveCachesPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCacheServiceSaveCachesPostParamsWithHTTPClient(client *http.Client) *CacheServiceSaveCachesPostParams { + + return &CacheServiceSaveCachesPostParams{ + HTTPClient: client, + } +} + +/* +CacheServiceSaveCachesPostParams contains all the parameters to send to the API endpoint +for the cache service save caches post operation typically these are written to a http.Request +*/ +type CacheServiceSaveCachesPostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the cache service save caches post params +func (o *CacheServiceSaveCachesPostParams) WithTimeout(timeout time.Duration) *CacheServiceSaveCachesPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the cache service save caches post params +func (o *CacheServiceSaveCachesPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the cache service save caches post params +func (o *CacheServiceSaveCachesPostParams) WithContext(ctx context.Context) *CacheServiceSaveCachesPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the cache service save caches post params +func (o *CacheServiceSaveCachesPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the cache service save caches post params +func (o *CacheServiceSaveCachesPostParams) WithHTTPClient(client *http.Client) *CacheServiceSaveCachesPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the cache service save caches post params +func (o *CacheServiceSaveCachesPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CacheServiceSaveCachesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_save_caches_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_save_caches_post_responses.go new file mode 100644 index 0000000000..9223429e25 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/cache_service_save_caches_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CacheServiceSaveCachesPostReader is a Reader for the CacheServiceSaveCachesPost structure. +type CacheServiceSaveCachesPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CacheServiceSaveCachesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCacheServiceSaveCachesPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCacheServiceSaveCachesPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCacheServiceSaveCachesPostOK creates a CacheServiceSaveCachesPostOK with default headers values +func NewCacheServiceSaveCachesPostOK() *CacheServiceSaveCachesPostOK { + return &CacheServiceSaveCachesPostOK{} +} + +/* +CacheServiceSaveCachesPostOK handles this case with default header values. + +Success +*/ +type CacheServiceSaveCachesPostOK struct { +} + +func (o *CacheServiceSaveCachesPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCacheServiceSaveCachesPostDefault creates a CacheServiceSaveCachesPostDefault with default headers values +func NewCacheServiceSaveCachesPostDefault(code int) *CacheServiceSaveCachesPostDefault { + return &CacheServiceSaveCachesPostDefault{ + _statusCode: code, + } +} + +/* +CacheServiceSaveCachesPostDefault handles this case with default header values. + +internal server error +*/ +type CacheServiceSaveCachesPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the cache service save caches post default response +func (o *CacheServiceSaveCachesPostDefault) Code() int { + return o._statusCode +} + +func (o *CacheServiceSaveCachesPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CacheServiceSaveCachesPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CacheServiceSaveCachesPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_by_pluginid_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_by_pluginid_get_parameters.go new file mode 100644 index 0000000000..65f03b65c4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_by_pluginid_get_parameters.go @@ -0,0 +1,225 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCollectdByPluginidGetParams creates a new CollectdByPluginidGetParams object +// with the default values initialized. +func NewCollectdByPluginidGetParams() *CollectdByPluginidGetParams { + var () + return &CollectdByPluginidGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCollectdByPluginidGetParamsWithTimeout creates a new CollectdByPluginidGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCollectdByPluginidGetParamsWithTimeout(timeout time.Duration) *CollectdByPluginidGetParams { + var () + return &CollectdByPluginidGetParams{ + + timeout: timeout, + } +} + +// NewCollectdByPluginidGetParamsWithContext creates a new CollectdByPluginidGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCollectdByPluginidGetParamsWithContext(ctx context.Context) *CollectdByPluginidGetParams { + var () + return &CollectdByPluginidGetParams{ + + Context: ctx, + } +} + +// NewCollectdByPluginidGetParamsWithHTTPClient creates a new CollectdByPluginidGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCollectdByPluginidGetParamsWithHTTPClient(client *http.Client) *CollectdByPluginidGetParams { + var () + return &CollectdByPluginidGetParams{ + HTTPClient: client, + } +} + +/* +CollectdByPluginidGetParams contains all the parameters to send to the API endpoint +for the collectd by pluginid get operation typically these are written to a http.Request +*/ +type CollectdByPluginidGetParams struct { + + /*Instance + The plugin instance + + */ + Instance *string + /*Pluginid + The plugin ID + + */ + Pluginid string + /*Type + The plugin type + + */ + Type string + /*TypeInstance + The plugin type instance + + */ + TypeInstance *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the collectd by pluginid get params +func (o *CollectdByPluginidGetParams) WithTimeout(timeout time.Duration) *CollectdByPluginidGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the collectd by pluginid get params +func (o *CollectdByPluginidGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the collectd by pluginid get params +func (o *CollectdByPluginidGetParams) WithContext(ctx context.Context) *CollectdByPluginidGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the collectd by pluginid get params +func (o *CollectdByPluginidGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the collectd by pluginid get params +func (o *CollectdByPluginidGetParams) WithHTTPClient(client *http.Client) *CollectdByPluginidGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the collectd by pluginid get params +func (o *CollectdByPluginidGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInstance adds the instance to the collectd by pluginid get params +func (o *CollectdByPluginidGetParams) WithInstance(instance *string) *CollectdByPluginidGetParams { + o.SetInstance(instance) + return o +} + +// SetInstance adds the instance to the collectd by pluginid get params +func (o *CollectdByPluginidGetParams) SetInstance(instance *string) { + o.Instance = instance +} + +// WithPluginid adds the pluginid to the collectd by pluginid get params +func (o *CollectdByPluginidGetParams) WithPluginid(pluginid string) *CollectdByPluginidGetParams { + o.SetPluginid(pluginid) + return o +} + +// SetPluginid adds the pluginid to the collectd by pluginid get params +func (o *CollectdByPluginidGetParams) SetPluginid(pluginid string) { + o.Pluginid = pluginid +} + +// WithType adds the typeVar to the collectd by pluginid get params +func (o *CollectdByPluginidGetParams) WithType(typeVar string) *CollectdByPluginidGetParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the collectd by pluginid get params +func (o *CollectdByPluginidGetParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WithTypeInstance adds the typeInstance to the collectd by pluginid get params +func (o *CollectdByPluginidGetParams) WithTypeInstance(typeInstance *string) *CollectdByPluginidGetParams { + o.SetTypeInstance(typeInstance) + return o +} + +// SetTypeInstance adds the typeInstance to the collectd by pluginid get params +func (o *CollectdByPluginidGetParams) SetTypeInstance(typeInstance *string) { + o.TypeInstance = typeInstance +} + +// WriteToRequest writes these params to a swagger request +func (o *CollectdByPluginidGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Instance != nil { + + // query param instance + var qrInstance string + if o.Instance != nil { + qrInstance = *o.Instance + } + qInstance := qrInstance + if qInstance != "" { + if err := r.SetQueryParam("instance", qInstance); err != nil { + return err + } + } + + } + + // path param pluginid + if err := r.SetPathParam("pluginid", o.Pluginid); err != nil { + return err + } + + // query param type + qrType := o.Type + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + if o.TypeInstance != nil { + + // query param type_instance + var qrTypeInstance string + if o.TypeInstance != nil { + qrTypeInstance = *o.TypeInstance + } + qTypeInstance := qrTypeInstance + if qTypeInstance != "" { + if err := r.SetQueryParam("type_instance", qTypeInstance); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_by_pluginid_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_by_pluginid_get_responses.go new file mode 100644 index 0000000000..76cff6d103 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_by_pluginid_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CollectdByPluginidGetReader is a Reader for the CollectdByPluginidGet structure. +type CollectdByPluginidGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CollectdByPluginidGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCollectdByPluginidGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCollectdByPluginidGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCollectdByPluginidGetOK creates a CollectdByPluginidGetOK with default headers values +func NewCollectdByPluginidGetOK() *CollectdByPluginidGetOK { + return &CollectdByPluginidGetOK{} +} + +/* +CollectdByPluginidGetOK handles this case with default header values. + +Success +*/ +type CollectdByPluginidGetOK struct { + Payload []*models.CollectdValue +} + +func (o *CollectdByPluginidGetOK) GetPayload() []*models.CollectdValue { + return o.Payload +} + +func (o *CollectdByPluginidGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCollectdByPluginidGetDefault creates a CollectdByPluginidGetDefault with default headers values +func NewCollectdByPluginidGetDefault(code int) *CollectdByPluginidGetDefault { + return &CollectdByPluginidGetDefault{ + _statusCode: code, + } +} + +/* +CollectdByPluginidGetDefault handles this case with default header values. + +internal server error +*/ +type CollectdByPluginidGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the collectd by pluginid get default response +func (o *CollectdByPluginidGetDefault) Code() int { + return o._statusCode +} + +func (o *CollectdByPluginidGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CollectdByPluginidGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CollectdByPluginidGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_by_pluginid_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_by_pluginid_post_parameters.go new file mode 100644 index 0000000000..b5f2f233c8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_by_pluginid_post_parameters.go @@ -0,0 +1,265 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCollectdByPluginidPostParams creates a new CollectdByPluginidPostParams object +// with the default values initialized. +func NewCollectdByPluginidPostParams() *CollectdByPluginidPostParams { + var () + return &CollectdByPluginidPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCollectdByPluginidPostParamsWithTimeout creates a new CollectdByPluginidPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCollectdByPluginidPostParamsWithTimeout(timeout time.Duration) *CollectdByPluginidPostParams { + var () + return &CollectdByPluginidPostParams{ + + timeout: timeout, + } +} + +// NewCollectdByPluginidPostParamsWithContext creates a new CollectdByPluginidPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCollectdByPluginidPostParamsWithContext(ctx context.Context) *CollectdByPluginidPostParams { + var () + return &CollectdByPluginidPostParams{ + + Context: ctx, + } +} + +// NewCollectdByPluginidPostParamsWithHTTPClient creates a new CollectdByPluginidPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCollectdByPluginidPostParamsWithHTTPClient(client *http.Client) *CollectdByPluginidPostParams { + var () + return &CollectdByPluginidPostParams{ + HTTPClient: client, + } +} + +/* +CollectdByPluginidPostParams contains all the parameters to send to the API endpoint +for the collectd by pluginid post operation typically these are written to a http.Request +*/ +type CollectdByPluginidPostParams struct { + + /*Enable + set to true to enable all, anything else or omit to disable + + */ + Enable *bool + /*Instance + The plugin instance typically #CPU indicating per CPU metric. Regex are supported. Omit for all + + */ + Instance *string + /*Pluginid + The plugin ID, describe the component the metric belongs to. Examples are cache, thrift, etc'. Regex are supported.The plugin ID, describe the component the metric belong to. Examples are: cache, thrift etc'. regex are supported + + */ + Pluginid string + /*Type + The plugin type, the type of the information. Examples are total_operations, bytes, total_operations, etc'. Regex are supported. Omit for all + + */ + Type *string + /*TypeInstance + The plugin type instance, the specific metric. Exampls are total_writes, total_size, zones, etc'. Regex are supported, Omit for all + + */ + TypeInstance *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) WithTimeout(timeout time.Duration) *CollectdByPluginidPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) WithContext(ctx context.Context) *CollectdByPluginidPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) WithHTTPClient(client *http.Client) *CollectdByPluginidPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEnable adds the enable to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) WithEnable(enable *bool) *CollectdByPluginidPostParams { + o.SetEnable(enable) + return o +} + +// SetEnable adds the enable to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) SetEnable(enable *bool) { + o.Enable = enable +} + +// WithInstance adds the instance to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) WithInstance(instance *string) *CollectdByPluginidPostParams { + o.SetInstance(instance) + return o +} + +// SetInstance adds the instance to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) SetInstance(instance *string) { + o.Instance = instance +} + +// WithPluginid adds the pluginid to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) WithPluginid(pluginid string) *CollectdByPluginidPostParams { + o.SetPluginid(pluginid) + return o +} + +// SetPluginid adds the pluginid to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) SetPluginid(pluginid string) { + o.Pluginid = pluginid +} + +// WithType adds the typeVar to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) WithType(typeVar *string) *CollectdByPluginidPostParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WithTypeInstance adds the typeInstance to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) WithTypeInstance(typeInstance *string) *CollectdByPluginidPostParams { + o.SetTypeInstance(typeInstance) + return o +} + +// SetTypeInstance adds the typeInstance to the collectd by pluginid post params +func (o *CollectdByPluginidPostParams) SetTypeInstance(typeInstance *string) { + o.TypeInstance = typeInstance +} + +// WriteToRequest writes these params to a swagger request +func (o *CollectdByPluginidPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Enable != nil { + + // query param enable + var qrEnable bool + if o.Enable != nil { + qrEnable = *o.Enable + } + qEnable := swag.FormatBool(qrEnable) + if qEnable != "" { + if err := r.SetQueryParam("enable", qEnable); err != nil { + return err + } + } + + } + + if o.Instance != nil { + + // query param instance + var qrInstance string + if o.Instance != nil { + qrInstance = *o.Instance + } + qInstance := qrInstance + if qInstance != "" { + if err := r.SetQueryParam("instance", qInstance); err != nil { + return err + } + } + + } + + // path param pluginid + if err := r.SetPathParam("pluginid", o.Pluginid); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if o.TypeInstance != nil { + + // query param type_instance + var qrTypeInstance string + if o.TypeInstance != nil { + qrTypeInstance = *o.TypeInstance + } + qTypeInstance := qrTypeInstance + if qTypeInstance != "" { + if err := r.SetQueryParam("type_instance", qTypeInstance); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_by_pluginid_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_by_pluginid_post_responses.go new file mode 100644 index 0000000000..7a55b5fbae --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_by_pluginid_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CollectdByPluginidPostReader is a Reader for the CollectdByPluginidPost structure. +type CollectdByPluginidPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CollectdByPluginidPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCollectdByPluginidPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCollectdByPluginidPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCollectdByPluginidPostOK creates a CollectdByPluginidPostOK with default headers values +func NewCollectdByPluginidPostOK() *CollectdByPluginidPostOK { + return &CollectdByPluginidPostOK{} +} + +/* +CollectdByPluginidPostOK handles this case with default header values. + +Success +*/ +type CollectdByPluginidPostOK struct { +} + +func (o *CollectdByPluginidPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCollectdByPluginidPostDefault creates a CollectdByPluginidPostDefault with default headers values +func NewCollectdByPluginidPostDefault(code int) *CollectdByPluginidPostDefault { + return &CollectdByPluginidPostDefault{ + _statusCode: code, + } +} + +/* +CollectdByPluginidPostDefault handles this case with default header values. + +internal server error +*/ +type CollectdByPluginidPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the collectd by pluginid post default response +func (o *CollectdByPluginidPostDefault) Code() int { + return o._statusCode +} + +func (o *CollectdByPluginidPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CollectdByPluginidPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CollectdByPluginidPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_get_parameters.go new file mode 100644 index 0000000000..cfc9a2e50b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCollectdGetParams creates a new CollectdGetParams object +// with the default values initialized. +func NewCollectdGetParams() *CollectdGetParams { + + return &CollectdGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCollectdGetParamsWithTimeout creates a new CollectdGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCollectdGetParamsWithTimeout(timeout time.Duration) *CollectdGetParams { + + return &CollectdGetParams{ + + timeout: timeout, + } +} + +// NewCollectdGetParamsWithContext creates a new CollectdGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCollectdGetParamsWithContext(ctx context.Context) *CollectdGetParams { + + return &CollectdGetParams{ + + Context: ctx, + } +} + +// NewCollectdGetParamsWithHTTPClient creates a new CollectdGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCollectdGetParamsWithHTTPClient(client *http.Client) *CollectdGetParams { + + return &CollectdGetParams{ + HTTPClient: client, + } +} + +/* +CollectdGetParams contains all the parameters to send to the API endpoint +for the collectd get operation typically these are written to a http.Request +*/ +type CollectdGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the collectd get params +func (o *CollectdGetParams) WithTimeout(timeout time.Duration) *CollectdGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the collectd get params +func (o *CollectdGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the collectd get params +func (o *CollectdGetParams) WithContext(ctx context.Context) *CollectdGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the collectd get params +func (o *CollectdGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the collectd get params +func (o *CollectdGetParams) WithHTTPClient(client *http.Client) *CollectdGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the collectd get params +func (o *CollectdGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CollectdGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_get_responses.go new file mode 100644 index 0000000000..59e748b0c7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CollectdGetReader is a Reader for the CollectdGet structure. +type CollectdGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CollectdGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCollectdGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCollectdGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCollectdGetOK creates a CollectdGetOK with default headers values +func NewCollectdGetOK() *CollectdGetOK { + return &CollectdGetOK{} +} + +/* +CollectdGetOK handles this case with default header values. + +Success +*/ +type CollectdGetOK struct { + Payload []*models.CollectdMetricStatus +} + +func (o *CollectdGetOK) GetPayload() []*models.CollectdMetricStatus { + return o.Payload +} + +func (o *CollectdGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCollectdGetDefault creates a CollectdGetDefault with default headers values +func NewCollectdGetDefault(code int) *CollectdGetDefault { + return &CollectdGetDefault{ + _statusCode: code, + } +} + +/* +CollectdGetDefault handles this case with default header values. + +internal server error +*/ +type CollectdGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the collectd get default response +func (o *CollectdGetDefault) Code() int { + return o._statusCode +} + +func (o *CollectdGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CollectdGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CollectdGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_post_parameters.go new file mode 100644 index 0000000000..e951d749ec --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_post_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCollectdPostParams creates a new CollectdPostParams object +// with the default values initialized. +func NewCollectdPostParams() *CollectdPostParams { + var () + return &CollectdPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCollectdPostParamsWithTimeout creates a new CollectdPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCollectdPostParamsWithTimeout(timeout time.Duration) *CollectdPostParams { + var () + return &CollectdPostParams{ + + timeout: timeout, + } +} + +// NewCollectdPostParamsWithContext creates a new CollectdPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCollectdPostParamsWithContext(ctx context.Context) *CollectdPostParams { + var () + return &CollectdPostParams{ + + Context: ctx, + } +} + +// NewCollectdPostParamsWithHTTPClient creates a new CollectdPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCollectdPostParamsWithHTTPClient(client *http.Client) *CollectdPostParams { + var () + return &CollectdPostParams{ + HTTPClient: client, + } +} + +/* +CollectdPostParams contains all the parameters to send to the API endpoint +for the collectd post operation typically these are written to a http.Request +*/ +type CollectdPostParams struct { + + /*Enable + set to true to enable all, anything else or omit to disable + + */ + Enable *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the collectd post params +func (o *CollectdPostParams) WithTimeout(timeout time.Duration) *CollectdPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the collectd post params +func (o *CollectdPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the collectd post params +func (o *CollectdPostParams) WithContext(ctx context.Context) *CollectdPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the collectd post params +func (o *CollectdPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the collectd post params +func (o *CollectdPostParams) WithHTTPClient(client *http.Client) *CollectdPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the collectd post params +func (o *CollectdPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEnable adds the enable to the collectd post params +func (o *CollectdPostParams) WithEnable(enable *bool) *CollectdPostParams { + o.SetEnable(enable) + return o +} + +// SetEnable adds the enable to the collectd post params +func (o *CollectdPostParams) SetEnable(enable *bool) { + o.Enable = enable +} + +// WriteToRequest writes these params to a swagger request +func (o *CollectdPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Enable != nil { + + // query param enable + var qrEnable bool + if o.Enable != nil { + qrEnable = *o.Enable + } + qEnable := swag.FormatBool(qrEnable) + if qEnable != "" { + if err := r.SetQueryParam("enable", qEnable); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_post_responses.go new file mode 100644 index 0000000000..e108b03d5e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/collectd_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CollectdPostReader is a Reader for the CollectdPost structure. +type CollectdPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CollectdPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCollectdPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCollectdPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCollectdPostOK creates a CollectdPostOK with default headers values +func NewCollectdPostOK() *CollectdPostOK { + return &CollectdPostOK{} +} + +/* +CollectdPostOK handles this case with default header values. + +Success +*/ +type CollectdPostOK struct { +} + +func (o *CollectdPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCollectdPostDefault creates a CollectdPostDefault with default headers values +func NewCollectdPostDefault(code int) *CollectdPostDefault { + return &CollectdPostDefault{ + _statusCode: code, + } +} + +/* +CollectdPostDefault handles this case with default header values. + +internal server error +*/ +type CollectdPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the collectd post default response +func (o *CollectdPostDefault) Code() int { + return o._statusCode +} + +func (o *CollectdPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CollectdPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CollectdPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_delete_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_delete_parameters.go new file mode 100644 index 0000000000..da72d85252 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_delete_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyAutocompactionByNameDeleteParams creates a new ColumnFamilyAutocompactionByNameDeleteParams object +// with the default values initialized. +func NewColumnFamilyAutocompactionByNameDeleteParams() *ColumnFamilyAutocompactionByNameDeleteParams { + var () + return &ColumnFamilyAutocompactionByNameDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyAutocompactionByNameDeleteParamsWithTimeout creates a new ColumnFamilyAutocompactionByNameDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyAutocompactionByNameDeleteParamsWithTimeout(timeout time.Duration) *ColumnFamilyAutocompactionByNameDeleteParams { + var () + return &ColumnFamilyAutocompactionByNameDeleteParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyAutocompactionByNameDeleteParamsWithContext creates a new ColumnFamilyAutocompactionByNameDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyAutocompactionByNameDeleteParamsWithContext(ctx context.Context) *ColumnFamilyAutocompactionByNameDeleteParams { + var () + return &ColumnFamilyAutocompactionByNameDeleteParams{ + + Context: ctx, + } +} + +// NewColumnFamilyAutocompactionByNameDeleteParamsWithHTTPClient creates a new ColumnFamilyAutocompactionByNameDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyAutocompactionByNameDeleteParamsWithHTTPClient(client *http.Client) *ColumnFamilyAutocompactionByNameDeleteParams { + var () + return &ColumnFamilyAutocompactionByNameDeleteParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyAutocompactionByNameDeleteParams contains all the parameters to send to the API endpoint +for the column family autocompaction by name delete operation typically these are written to a http.Request +*/ +type ColumnFamilyAutocompactionByNameDeleteParams struct { + + /*Name + The table name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family autocompaction by name delete params +func (o *ColumnFamilyAutocompactionByNameDeleteParams) WithTimeout(timeout time.Duration) *ColumnFamilyAutocompactionByNameDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family autocompaction by name delete params +func (o *ColumnFamilyAutocompactionByNameDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family autocompaction by name delete params +func (o *ColumnFamilyAutocompactionByNameDeleteParams) WithContext(ctx context.Context) *ColumnFamilyAutocompactionByNameDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family autocompaction by name delete params +func (o *ColumnFamilyAutocompactionByNameDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family autocompaction by name delete params +func (o *ColumnFamilyAutocompactionByNameDeleteParams) WithHTTPClient(client *http.Client) *ColumnFamilyAutocompactionByNameDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family autocompaction by name delete params +func (o *ColumnFamilyAutocompactionByNameDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family autocompaction by name delete params +func (o *ColumnFamilyAutocompactionByNameDeleteParams) WithName(name string) *ColumnFamilyAutocompactionByNameDeleteParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family autocompaction by name delete params +func (o *ColumnFamilyAutocompactionByNameDeleteParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyAutocompactionByNameDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_delete_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_delete_responses.go new file mode 100644 index 0000000000..80d0f07422 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_delete_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyAutocompactionByNameDeleteReader is a Reader for the ColumnFamilyAutocompactionByNameDelete structure. +type ColumnFamilyAutocompactionByNameDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyAutocompactionByNameDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyAutocompactionByNameDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyAutocompactionByNameDeleteDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyAutocompactionByNameDeleteOK creates a ColumnFamilyAutocompactionByNameDeleteOK with default headers values +func NewColumnFamilyAutocompactionByNameDeleteOK() *ColumnFamilyAutocompactionByNameDeleteOK { + return &ColumnFamilyAutocompactionByNameDeleteOK{} +} + +/* +ColumnFamilyAutocompactionByNameDeleteOK handles this case with default header values. + +Success +*/ +type ColumnFamilyAutocompactionByNameDeleteOK struct { +} + +func (o *ColumnFamilyAutocompactionByNameDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyAutocompactionByNameDeleteDefault creates a ColumnFamilyAutocompactionByNameDeleteDefault with default headers values +func NewColumnFamilyAutocompactionByNameDeleteDefault(code int) *ColumnFamilyAutocompactionByNameDeleteDefault { + return &ColumnFamilyAutocompactionByNameDeleteDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyAutocompactionByNameDeleteDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyAutocompactionByNameDeleteDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family autocompaction by name delete default response +func (o *ColumnFamilyAutocompactionByNameDeleteDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyAutocompactionByNameDeleteDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyAutocompactionByNameDeleteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyAutocompactionByNameDeleteDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_get_parameters.go new file mode 100644 index 0000000000..0dd06fb084 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyAutocompactionByNameGetParams creates a new ColumnFamilyAutocompactionByNameGetParams object +// with the default values initialized. +func NewColumnFamilyAutocompactionByNameGetParams() *ColumnFamilyAutocompactionByNameGetParams { + var () + return &ColumnFamilyAutocompactionByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyAutocompactionByNameGetParamsWithTimeout creates a new ColumnFamilyAutocompactionByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyAutocompactionByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyAutocompactionByNameGetParams { + var () + return &ColumnFamilyAutocompactionByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyAutocompactionByNameGetParamsWithContext creates a new ColumnFamilyAutocompactionByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyAutocompactionByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyAutocompactionByNameGetParams { + var () + return &ColumnFamilyAutocompactionByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyAutocompactionByNameGetParamsWithHTTPClient creates a new ColumnFamilyAutocompactionByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyAutocompactionByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyAutocompactionByNameGetParams { + var () + return &ColumnFamilyAutocompactionByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyAutocompactionByNameGetParams contains all the parameters to send to the API endpoint +for the column family autocompaction by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyAutocompactionByNameGetParams struct { + + /*Name + The table name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family autocompaction by name get params +func (o *ColumnFamilyAutocompactionByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyAutocompactionByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family autocompaction by name get params +func (o *ColumnFamilyAutocompactionByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family autocompaction by name get params +func (o *ColumnFamilyAutocompactionByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyAutocompactionByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family autocompaction by name get params +func (o *ColumnFamilyAutocompactionByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family autocompaction by name get params +func (o *ColumnFamilyAutocompactionByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyAutocompactionByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family autocompaction by name get params +func (o *ColumnFamilyAutocompactionByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family autocompaction by name get params +func (o *ColumnFamilyAutocompactionByNameGetParams) WithName(name string) *ColumnFamilyAutocompactionByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family autocompaction by name get params +func (o *ColumnFamilyAutocompactionByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyAutocompactionByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_get_responses.go new file mode 100644 index 0000000000..2c68daccba --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyAutocompactionByNameGetReader is a Reader for the ColumnFamilyAutocompactionByNameGet structure. +type ColumnFamilyAutocompactionByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyAutocompactionByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyAutocompactionByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyAutocompactionByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyAutocompactionByNameGetOK creates a ColumnFamilyAutocompactionByNameGetOK with default headers values +func NewColumnFamilyAutocompactionByNameGetOK() *ColumnFamilyAutocompactionByNameGetOK { + return &ColumnFamilyAutocompactionByNameGetOK{} +} + +/* +ColumnFamilyAutocompactionByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyAutocompactionByNameGetOK struct { + Payload bool +} + +func (o *ColumnFamilyAutocompactionByNameGetOK) GetPayload() bool { + return o.Payload +} + +func (o *ColumnFamilyAutocompactionByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyAutocompactionByNameGetDefault creates a ColumnFamilyAutocompactionByNameGetDefault with default headers values +func NewColumnFamilyAutocompactionByNameGetDefault(code int) *ColumnFamilyAutocompactionByNameGetDefault { + return &ColumnFamilyAutocompactionByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyAutocompactionByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyAutocompactionByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family autocompaction by name get default response +func (o *ColumnFamilyAutocompactionByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyAutocompactionByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyAutocompactionByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyAutocompactionByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_post_parameters.go new file mode 100644 index 0000000000..df9523b200 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_post_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyAutocompactionByNamePostParams creates a new ColumnFamilyAutocompactionByNamePostParams object +// with the default values initialized. +func NewColumnFamilyAutocompactionByNamePostParams() *ColumnFamilyAutocompactionByNamePostParams { + var () + return &ColumnFamilyAutocompactionByNamePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyAutocompactionByNamePostParamsWithTimeout creates a new ColumnFamilyAutocompactionByNamePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyAutocompactionByNamePostParamsWithTimeout(timeout time.Duration) *ColumnFamilyAutocompactionByNamePostParams { + var () + return &ColumnFamilyAutocompactionByNamePostParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyAutocompactionByNamePostParamsWithContext creates a new ColumnFamilyAutocompactionByNamePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyAutocompactionByNamePostParamsWithContext(ctx context.Context) *ColumnFamilyAutocompactionByNamePostParams { + var () + return &ColumnFamilyAutocompactionByNamePostParams{ + + Context: ctx, + } +} + +// NewColumnFamilyAutocompactionByNamePostParamsWithHTTPClient creates a new ColumnFamilyAutocompactionByNamePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyAutocompactionByNamePostParamsWithHTTPClient(client *http.Client) *ColumnFamilyAutocompactionByNamePostParams { + var () + return &ColumnFamilyAutocompactionByNamePostParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyAutocompactionByNamePostParams contains all the parameters to send to the API endpoint +for the column family autocompaction by name post operation typically these are written to a http.Request +*/ +type ColumnFamilyAutocompactionByNamePostParams struct { + + /*Name + The table name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family autocompaction by name post params +func (o *ColumnFamilyAutocompactionByNamePostParams) WithTimeout(timeout time.Duration) *ColumnFamilyAutocompactionByNamePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family autocompaction by name post params +func (o *ColumnFamilyAutocompactionByNamePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family autocompaction by name post params +func (o *ColumnFamilyAutocompactionByNamePostParams) WithContext(ctx context.Context) *ColumnFamilyAutocompactionByNamePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family autocompaction by name post params +func (o *ColumnFamilyAutocompactionByNamePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family autocompaction by name post params +func (o *ColumnFamilyAutocompactionByNamePostParams) WithHTTPClient(client *http.Client) *ColumnFamilyAutocompactionByNamePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family autocompaction by name post params +func (o *ColumnFamilyAutocompactionByNamePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family autocompaction by name post params +func (o *ColumnFamilyAutocompactionByNamePostParams) WithName(name string) *ColumnFamilyAutocompactionByNamePostParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family autocompaction by name post params +func (o *ColumnFamilyAutocompactionByNamePostParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyAutocompactionByNamePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_post_responses.go new file mode 100644 index 0000000000..5312e03442 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_autocompaction_by_name_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyAutocompactionByNamePostReader is a Reader for the ColumnFamilyAutocompactionByNamePost structure. +type ColumnFamilyAutocompactionByNamePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyAutocompactionByNamePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyAutocompactionByNamePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyAutocompactionByNamePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyAutocompactionByNamePostOK creates a ColumnFamilyAutocompactionByNamePostOK with default headers values +func NewColumnFamilyAutocompactionByNamePostOK() *ColumnFamilyAutocompactionByNamePostOK { + return &ColumnFamilyAutocompactionByNamePostOK{} +} + +/* +ColumnFamilyAutocompactionByNamePostOK handles this case with default header values. + +Success +*/ +type ColumnFamilyAutocompactionByNamePostOK struct { +} + +func (o *ColumnFamilyAutocompactionByNamePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyAutocompactionByNamePostDefault creates a ColumnFamilyAutocompactionByNamePostDefault with default headers values +func NewColumnFamilyAutocompactionByNamePostDefault(code int) *ColumnFamilyAutocompactionByNamePostDefault { + return &ColumnFamilyAutocompactionByNamePostDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyAutocompactionByNamePostDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyAutocompactionByNamePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family autocompaction by name post default response +func (o *ColumnFamilyAutocompactionByNamePostDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyAutocompactionByNamePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyAutocompactionByNamePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyAutocompactionByNamePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_built_indexes_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_built_indexes_by_name_get_parameters.go new file mode 100644 index 0000000000..1db3ffc46d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_built_indexes_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyBuiltIndexesByNameGetParams creates a new ColumnFamilyBuiltIndexesByNameGetParams object +// with the default values initialized. +func NewColumnFamilyBuiltIndexesByNameGetParams() *ColumnFamilyBuiltIndexesByNameGetParams { + var () + return &ColumnFamilyBuiltIndexesByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyBuiltIndexesByNameGetParamsWithTimeout creates a new ColumnFamilyBuiltIndexesByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyBuiltIndexesByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyBuiltIndexesByNameGetParams { + var () + return &ColumnFamilyBuiltIndexesByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyBuiltIndexesByNameGetParamsWithContext creates a new ColumnFamilyBuiltIndexesByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyBuiltIndexesByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyBuiltIndexesByNameGetParams { + var () + return &ColumnFamilyBuiltIndexesByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyBuiltIndexesByNameGetParamsWithHTTPClient creates a new ColumnFamilyBuiltIndexesByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyBuiltIndexesByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyBuiltIndexesByNameGetParams { + var () + return &ColumnFamilyBuiltIndexesByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyBuiltIndexesByNameGetParams contains all the parameters to send to the API endpoint +for the column family built indexes by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyBuiltIndexesByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family built indexes by name get params +func (o *ColumnFamilyBuiltIndexesByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyBuiltIndexesByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family built indexes by name get params +func (o *ColumnFamilyBuiltIndexesByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family built indexes by name get params +func (o *ColumnFamilyBuiltIndexesByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyBuiltIndexesByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family built indexes by name get params +func (o *ColumnFamilyBuiltIndexesByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family built indexes by name get params +func (o *ColumnFamilyBuiltIndexesByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyBuiltIndexesByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family built indexes by name get params +func (o *ColumnFamilyBuiltIndexesByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family built indexes by name get params +func (o *ColumnFamilyBuiltIndexesByNameGetParams) WithName(name string) *ColumnFamilyBuiltIndexesByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family built indexes by name get params +func (o *ColumnFamilyBuiltIndexesByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyBuiltIndexesByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_built_indexes_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_built_indexes_by_name_get_responses.go new file mode 100644 index 0000000000..73ef1f2a76 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_built_indexes_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyBuiltIndexesByNameGetReader is a Reader for the ColumnFamilyBuiltIndexesByNameGet structure. +type ColumnFamilyBuiltIndexesByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyBuiltIndexesByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyBuiltIndexesByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyBuiltIndexesByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyBuiltIndexesByNameGetOK creates a ColumnFamilyBuiltIndexesByNameGetOK with default headers values +func NewColumnFamilyBuiltIndexesByNameGetOK() *ColumnFamilyBuiltIndexesByNameGetOK { + return &ColumnFamilyBuiltIndexesByNameGetOK{} +} + +/* +ColumnFamilyBuiltIndexesByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyBuiltIndexesByNameGetOK struct { + Payload []string +} + +func (o *ColumnFamilyBuiltIndexesByNameGetOK) GetPayload() []string { + return o.Payload +} + +func (o *ColumnFamilyBuiltIndexesByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyBuiltIndexesByNameGetDefault creates a ColumnFamilyBuiltIndexesByNameGetDefault with default headers values +func NewColumnFamilyBuiltIndexesByNameGetDefault(code int) *ColumnFamilyBuiltIndexesByNameGetDefault { + return &ColumnFamilyBuiltIndexesByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyBuiltIndexesByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyBuiltIndexesByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family built indexes by name get default response +func (o *ColumnFamilyBuiltIndexesByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyBuiltIndexesByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyBuiltIndexesByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyBuiltIndexesByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_by_name_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_by_name_post_parameters.go new file mode 100644 index 0000000000..cac0499e6f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_by_name_post_parameters.go @@ -0,0 +1,187 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewColumnFamilyCompactionByNamePostParams creates a new ColumnFamilyCompactionByNamePostParams object +// with the default values initialized. +func NewColumnFamilyCompactionByNamePostParams() *ColumnFamilyCompactionByNamePostParams { + var () + return &ColumnFamilyCompactionByNamePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyCompactionByNamePostParamsWithTimeout creates a new ColumnFamilyCompactionByNamePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyCompactionByNamePostParamsWithTimeout(timeout time.Duration) *ColumnFamilyCompactionByNamePostParams { + var () + return &ColumnFamilyCompactionByNamePostParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyCompactionByNamePostParamsWithContext creates a new ColumnFamilyCompactionByNamePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyCompactionByNamePostParamsWithContext(ctx context.Context) *ColumnFamilyCompactionByNamePostParams { + var () + return &ColumnFamilyCompactionByNamePostParams{ + + Context: ctx, + } +} + +// NewColumnFamilyCompactionByNamePostParamsWithHTTPClient creates a new ColumnFamilyCompactionByNamePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyCompactionByNamePostParamsWithHTTPClient(client *http.Client) *ColumnFamilyCompactionByNamePostParams { + var () + return &ColumnFamilyCompactionByNamePostParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyCompactionByNamePostParams contains all the parameters to send to the API endpoint +for the column family compaction by name post operation typically these are written to a http.Request +*/ +type ColumnFamilyCompactionByNamePostParams struct { + + /*Maximum + The maximum number of sstables in queue before compaction kicks off + + */ + Maximum int32 + /*Minimum + The minimum number of sstables in queue before compaction kicks off + + */ + Minimum int32 + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family compaction by name post params +func (o *ColumnFamilyCompactionByNamePostParams) WithTimeout(timeout time.Duration) *ColumnFamilyCompactionByNamePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family compaction by name post params +func (o *ColumnFamilyCompactionByNamePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family compaction by name post params +func (o *ColumnFamilyCompactionByNamePostParams) WithContext(ctx context.Context) *ColumnFamilyCompactionByNamePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family compaction by name post params +func (o *ColumnFamilyCompactionByNamePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family compaction by name post params +func (o *ColumnFamilyCompactionByNamePostParams) WithHTTPClient(client *http.Client) *ColumnFamilyCompactionByNamePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family compaction by name post params +func (o *ColumnFamilyCompactionByNamePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMaximum adds the maximum to the column family compaction by name post params +func (o *ColumnFamilyCompactionByNamePostParams) WithMaximum(maximum int32) *ColumnFamilyCompactionByNamePostParams { + o.SetMaximum(maximum) + return o +} + +// SetMaximum adds the maximum to the column family compaction by name post params +func (o *ColumnFamilyCompactionByNamePostParams) SetMaximum(maximum int32) { + o.Maximum = maximum +} + +// WithMinimum adds the minimum to the column family compaction by name post params +func (o *ColumnFamilyCompactionByNamePostParams) WithMinimum(minimum int32) *ColumnFamilyCompactionByNamePostParams { + o.SetMinimum(minimum) + return o +} + +// SetMinimum adds the minimum to the column family compaction by name post params +func (o *ColumnFamilyCompactionByNamePostParams) SetMinimum(minimum int32) { + o.Minimum = minimum +} + +// WithName adds the name to the column family compaction by name post params +func (o *ColumnFamilyCompactionByNamePostParams) WithName(name string) *ColumnFamilyCompactionByNamePostParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family compaction by name post params +func (o *ColumnFamilyCompactionByNamePostParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyCompactionByNamePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param maximum + qrMaximum := o.Maximum + qMaximum := swag.FormatInt32(qrMaximum) + if qMaximum != "" { + if err := r.SetQueryParam("maximum", qMaximum); err != nil { + return err + } + } + + // query param minimum + qrMinimum := o.Minimum + qMinimum := swag.FormatInt32(qrMinimum) + if qMinimum != "" { + if err := r.SetQueryParam("minimum", qMinimum); err != nil { + return err + } + } + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_by_name_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_by_name_post_responses.go new file mode 100644 index 0000000000..204c08f663 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_by_name_post_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyCompactionByNamePostReader is a Reader for the ColumnFamilyCompactionByNamePost structure. +type ColumnFamilyCompactionByNamePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyCompactionByNamePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyCompactionByNamePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyCompactionByNamePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyCompactionByNamePostOK creates a ColumnFamilyCompactionByNamePostOK with default headers values +func NewColumnFamilyCompactionByNamePostOK() *ColumnFamilyCompactionByNamePostOK { + return &ColumnFamilyCompactionByNamePostOK{} +} + +/* +ColumnFamilyCompactionByNamePostOK handles this case with default header values. + +Success +*/ +type ColumnFamilyCompactionByNamePostOK struct { + Payload string +} + +func (o *ColumnFamilyCompactionByNamePostOK) GetPayload() string { + return o.Payload +} + +func (o *ColumnFamilyCompactionByNamePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyCompactionByNamePostDefault creates a ColumnFamilyCompactionByNamePostDefault with default headers values +func NewColumnFamilyCompactionByNamePostDefault(code int) *ColumnFamilyCompactionByNamePostDefault { + return &ColumnFamilyCompactionByNamePostDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyCompactionByNamePostDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyCompactionByNamePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family compaction by name post default response +func (o *ColumnFamilyCompactionByNamePostDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyCompactionByNamePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyCompactionByNamePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyCompactionByNamePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_strategy_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_strategy_by_name_get_parameters.go new file mode 100644 index 0000000000..4eee48277e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_strategy_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyCompactionStrategyByNameGetParams creates a new ColumnFamilyCompactionStrategyByNameGetParams object +// with the default values initialized. +func NewColumnFamilyCompactionStrategyByNameGetParams() *ColumnFamilyCompactionStrategyByNameGetParams { + var () + return &ColumnFamilyCompactionStrategyByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyCompactionStrategyByNameGetParamsWithTimeout creates a new ColumnFamilyCompactionStrategyByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyCompactionStrategyByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyCompactionStrategyByNameGetParams { + var () + return &ColumnFamilyCompactionStrategyByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyCompactionStrategyByNameGetParamsWithContext creates a new ColumnFamilyCompactionStrategyByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyCompactionStrategyByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyCompactionStrategyByNameGetParams { + var () + return &ColumnFamilyCompactionStrategyByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyCompactionStrategyByNameGetParamsWithHTTPClient creates a new ColumnFamilyCompactionStrategyByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyCompactionStrategyByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyCompactionStrategyByNameGetParams { + var () + return &ColumnFamilyCompactionStrategyByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyCompactionStrategyByNameGetParams contains all the parameters to send to the API endpoint +for the column family compaction strategy by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyCompactionStrategyByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family compaction strategy by name get params +func (o *ColumnFamilyCompactionStrategyByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyCompactionStrategyByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family compaction strategy by name get params +func (o *ColumnFamilyCompactionStrategyByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family compaction strategy by name get params +func (o *ColumnFamilyCompactionStrategyByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyCompactionStrategyByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family compaction strategy by name get params +func (o *ColumnFamilyCompactionStrategyByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family compaction strategy by name get params +func (o *ColumnFamilyCompactionStrategyByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyCompactionStrategyByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family compaction strategy by name get params +func (o *ColumnFamilyCompactionStrategyByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family compaction strategy by name get params +func (o *ColumnFamilyCompactionStrategyByNameGetParams) WithName(name string) *ColumnFamilyCompactionStrategyByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family compaction strategy by name get params +func (o *ColumnFamilyCompactionStrategyByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyCompactionStrategyByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_strategy_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_strategy_by_name_get_responses.go new file mode 100644 index 0000000000..9dfd6712e1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_strategy_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyCompactionStrategyByNameGetReader is a Reader for the ColumnFamilyCompactionStrategyByNameGet structure. +type ColumnFamilyCompactionStrategyByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyCompactionStrategyByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyCompactionStrategyByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyCompactionStrategyByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyCompactionStrategyByNameGetOK creates a ColumnFamilyCompactionStrategyByNameGetOK with default headers values +func NewColumnFamilyCompactionStrategyByNameGetOK() *ColumnFamilyCompactionStrategyByNameGetOK { + return &ColumnFamilyCompactionStrategyByNameGetOK{} +} + +/* +ColumnFamilyCompactionStrategyByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyCompactionStrategyByNameGetOK struct { + Payload string +} + +func (o *ColumnFamilyCompactionStrategyByNameGetOK) GetPayload() string { + return o.Payload +} + +func (o *ColumnFamilyCompactionStrategyByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyCompactionStrategyByNameGetDefault creates a ColumnFamilyCompactionStrategyByNameGetDefault with default headers values +func NewColumnFamilyCompactionStrategyByNameGetDefault(code int) *ColumnFamilyCompactionStrategyByNameGetDefault { + return &ColumnFamilyCompactionStrategyByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyCompactionStrategyByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyCompactionStrategyByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family compaction strategy by name get default response +func (o *ColumnFamilyCompactionStrategyByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyCompactionStrategyByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyCompactionStrategyByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyCompactionStrategyByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_strategy_by_name_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_strategy_by_name_post_parameters.go new file mode 100644 index 0000000000..eb2fff1537 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_strategy_by_name_post_parameters.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyCompactionStrategyByNamePostParams creates a new ColumnFamilyCompactionStrategyByNamePostParams object +// with the default values initialized. +func NewColumnFamilyCompactionStrategyByNamePostParams() *ColumnFamilyCompactionStrategyByNamePostParams { + var () + return &ColumnFamilyCompactionStrategyByNamePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyCompactionStrategyByNamePostParamsWithTimeout creates a new ColumnFamilyCompactionStrategyByNamePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyCompactionStrategyByNamePostParamsWithTimeout(timeout time.Duration) *ColumnFamilyCompactionStrategyByNamePostParams { + var () + return &ColumnFamilyCompactionStrategyByNamePostParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyCompactionStrategyByNamePostParamsWithContext creates a new ColumnFamilyCompactionStrategyByNamePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyCompactionStrategyByNamePostParamsWithContext(ctx context.Context) *ColumnFamilyCompactionStrategyByNamePostParams { + var () + return &ColumnFamilyCompactionStrategyByNamePostParams{ + + Context: ctx, + } +} + +// NewColumnFamilyCompactionStrategyByNamePostParamsWithHTTPClient creates a new ColumnFamilyCompactionStrategyByNamePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyCompactionStrategyByNamePostParamsWithHTTPClient(client *http.Client) *ColumnFamilyCompactionStrategyByNamePostParams { + var () + return &ColumnFamilyCompactionStrategyByNamePostParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyCompactionStrategyByNamePostParams contains all the parameters to send to the API endpoint +for the column family compaction strategy by name post operation typically these are written to a http.Request +*/ +type ColumnFamilyCompactionStrategyByNamePostParams struct { + + /*ClassName + The class name + + */ + ClassName string + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family compaction strategy by name post params +func (o *ColumnFamilyCompactionStrategyByNamePostParams) WithTimeout(timeout time.Duration) *ColumnFamilyCompactionStrategyByNamePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family compaction strategy by name post params +func (o *ColumnFamilyCompactionStrategyByNamePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family compaction strategy by name post params +func (o *ColumnFamilyCompactionStrategyByNamePostParams) WithContext(ctx context.Context) *ColumnFamilyCompactionStrategyByNamePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family compaction strategy by name post params +func (o *ColumnFamilyCompactionStrategyByNamePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family compaction strategy by name post params +func (o *ColumnFamilyCompactionStrategyByNamePostParams) WithHTTPClient(client *http.Client) *ColumnFamilyCompactionStrategyByNamePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family compaction strategy by name post params +func (o *ColumnFamilyCompactionStrategyByNamePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClassName adds the className to the column family compaction strategy by name post params +func (o *ColumnFamilyCompactionStrategyByNamePostParams) WithClassName(className string) *ColumnFamilyCompactionStrategyByNamePostParams { + o.SetClassName(className) + return o +} + +// SetClassName adds the className to the column family compaction strategy by name post params +func (o *ColumnFamilyCompactionStrategyByNamePostParams) SetClassName(className string) { + o.ClassName = className +} + +// WithName adds the name to the column family compaction strategy by name post params +func (o *ColumnFamilyCompactionStrategyByNamePostParams) WithName(name string) *ColumnFamilyCompactionStrategyByNamePostParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family compaction strategy by name post params +func (o *ColumnFamilyCompactionStrategyByNamePostParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyCompactionStrategyByNamePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param class_name + qrClassName := o.ClassName + qClassName := qrClassName + if qClassName != "" { + if err := r.SetQueryParam("class_name", qClassName); err != nil { + return err + } + } + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_strategy_by_name_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_strategy_by_name_post_responses.go new file mode 100644 index 0000000000..e4bb802d32 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compaction_strategy_by_name_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyCompactionStrategyByNamePostReader is a Reader for the ColumnFamilyCompactionStrategyByNamePost structure. +type ColumnFamilyCompactionStrategyByNamePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyCompactionStrategyByNamePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyCompactionStrategyByNamePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyCompactionStrategyByNamePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyCompactionStrategyByNamePostOK creates a ColumnFamilyCompactionStrategyByNamePostOK with default headers values +func NewColumnFamilyCompactionStrategyByNamePostOK() *ColumnFamilyCompactionStrategyByNamePostOK { + return &ColumnFamilyCompactionStrategyByNamePostOK{} +} + +/* +ColumnFamilyCompactionStrategyByNamePostOK handles this case with default header values. + +Success +*/ +type ColumnFamilyCompactionStrategyByNamePostOK struct { +} + +func (o *ColumnFamilyCompactionStrategyByNamePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyCompactionStrategyByNamePostDefault creates a ColumnFamilyCompactionStrategyByNamePostDefault with default headers values +func NewColumnFamilyCompactionStrategyByNamePostDefault(code int) *ColumnFamilyCompactionStrategyByNamePostDefault { + return &ColumnFamilyCompactionStrategyByNamePostDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyCompactionStrategyByNamePostDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyCompactionStrategyByNamePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family compaction strategy by name post default response +func (o *ColumnFamilyCompactionStrategyByNamePostDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyCompactionStrategyByNamePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyCompactionStrategyByNamePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyCompactionStrategyByNamePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compression_parameters_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compression_parameters_by_name_get_parameters.go new file mode 100644 index 0000000000..0d6a322d0e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compression_parameters_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyCompressionParametersByNameGetParams creates a new ColumnFamilyCompressionParametersByNameGetParams object +// with the default values initialized. +func NewColumnFamilyCompressionParametersByNameGetParams() *ColumnFamilyCompressionParametersByNameGetParams { + var () + return &ColumnFamilyCompressionParametersByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyCompressionParametersByNameGetParamsWithTimeout creates a new ColumnFamilyCompressionParametersByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyCompressionParametersByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyCompressionParametersByNameGetParams { + var () + return &ColumnFamilyCompressionParametersByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyCompressionParametersByNameGetParamsWithContext creates a new ColumnFamilyCompressionParametersByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyCompressionParametersByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyCompressionParametersByNameGetParams { + var () + return &ColumnFamilyCompressionParametersByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyCompressionParametersByNameGetParamsWithHTTPClient creates a new ColumnFamilyCompressionParametersByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyCompressionParametersByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyCompressionParametersByNameGetParams { + var () + return &ColumnFamilyCompressionParametersByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyCompressionParametersByNameGetParams contains all the parameters to send to the API endpoint +for the column family compression parameters by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyCompressionParametersByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family compression parameters by name get params +func (o *ColumnFamilyCompressionParametersByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyCompressionParametersByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family compression parameters by name get params +func (o *ColumnFamilyCompressionParametersByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family compression parameters by name get params +func (o *ColumnFamilyCompressionParametersByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyCompressionParametersByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family compression parameters by name get params +func (o *ColumnFamilyCompressionParametersByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family compression parameters by name get params +func (o *ColumnFamilyCompressionParametersByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyCompressionParametersByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family compression parameters by name get params +func (o *ColumnFamilyCompressionParametersByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family compression parameters by name get params +func (o *ColumnFamilyCompressionParametersByNameGetParams) WithName(name string) *ColumnFamilyCompressionParametersByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family compression parameters by name get params +func (o *ColumnFamilyCompressionParametersByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyCompressionParametersByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compression_parameters_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compression_parameters_by_name_get_responses.go new file mode 100644 index 0000000000..494bae06a4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compression_parameters_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyCompressionParametersByNameGetReader is a Reader for the ColumnFamilyCompressionParametersByNameGet structure. +type ColumnFamilyCompressionParametersByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyCompressionParametersByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyCompressionParametersByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyCompressionParametersByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyCompressionParametersByNameGetOK creates a ColumnFamilyCompressionParametersByNameGetOK with default headers values +func NewColumnFamilyCompressionParametersByNameGetOK() *ColumnFamilyCompressionParametersByNameGetOK { + return &ColumnFamilyCompressionParametersByNameGetOK{} +} + +/* +ColumnFamilyCompressionParametersByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyCompressionParametersByNameGetOK struct { + Payload []*models.Mapper +} + +func (o *ColumnFamilyCompressionParametersByNameGetOK) GetPayload() []*models.Mapper { + return o.Payload +} + +func (o *ColumnFamilyCompressionParametersByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyCompressionParametersByNameGetDefault creates a ColumnFamilyCompressionParametersByNameGetDefault with default headers values +func NewColumnFamilyCompressionParametersByNameGetDefault(code int) *ColumnFamilyCompressionParametersByNameGetDefault { + return &ColumnFamilyCompressionParametersByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyCompressionParametersByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyCompressionParametersByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family compression parameters by name get default response +func (o *ColumnFamilyCompressionParametersByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyCompressionParametersByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyCompressionParametersByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyCompressionParametersByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compression_parameters_by_name_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compression_parameters_by_name_post_parameters.go new file mode 100644 index 0000000000..d3a17a31b2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compression_parameters_by_name_post_parameters.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyCompressionParametersByNamePostParams creates a new ColumnFamilyCompressionParametersByNamePostParams object +// with the default values initialized. +func NewColumnFamilyCompressionParametersByNamePostParams() *ColumnFamilyCompressionParametersByNamePostParams { + var () + return &ColumnFamilyCompressionParametersByNamePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyCompressionParametersByNamePostParamsWithTimeout creates a new ColumnFamilyCompressionParametersByNamePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyCompressionParametersByNamePostParamsWithTimeout(timeout time.Duration) *ColumnFamilyCompressionParametersByNamePostParams { + var () + return &ColumnFamilyCompressionParametersByNamePostParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyCompressionParametersByNamePostParamsWithContext creates a new ColumnFamilyCompressionParametersByNamePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyCompressionParametersByNamePostParamsWithContext(ctx context.Context) *ColumnFamilyCompressionParametersByNamePostParams { + var () + return &ColumnFamilyCompressionParametersByNamePostParams{ + + Context: ctx, + } +} + +// NewColumnFamilyCompressionParametersByNamePostParamsWithHTTPClient creates a new ColumnFamilyCompressionParametersByNamePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyCompressionParametersByNamePostParamsWithHTTPClient(client *http.Client) *ColumnFamilyCompressionParametersByNamePostParams { + var () + return &ColumnFamilyCompressionParametersByNamePostParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyCompressionParametersByNamePostParams contains all the parameters to send to the API endpoint +for the column family compression parameters by name post operation typically these are written to a http.Request +*/ +type ColumnFamilyCompressionParametersByNamePostParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + /*Opts + The options to set + + */ + Opts string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family compression parameters by name post params +func (o *ColumnFamilyCompressionParametersByNamePostParams) WithTimeout(timeout time.Duration) *ColumnFamilyCompressionParametersByNamePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family compression parameters by name post params +func (o *ColumnFamilyCompressionParametersByNamePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family compression parameters by name post params +func (o *ColumnFamilyCompressionParametersByNamePostParams) WithContext(ctx context.Context) *ColumnFamilyCompressionParametersByNamePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family compression parameters by name post params +func (o *ColumnFamilyCompressionParametersByNamePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family compression parameters by name post params +func (o *ColumnFamilyCompressionParametersByNamePostParams) WithHTTPClient(client *http.Client) *ColumnFamilyCompressionParametersByNamePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family compression parameters by name post params +func (o *ColumnFamilyCompressionParametersByNamePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family compression parameters by name post params +func (o *ColumnFamilyCompressionParametersByNamePostParams) WithName(name string) *ColumnFamilyCompressionParametersByNamePostParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family compression parameters by name post params +func (o *ColumnFamilyCompressionParametersByNamePostParams) SetName(name string) { + o.Name = name +} + +// WithOpts adds the opts to the column family compression parameters by name post params +func (o *ColumnFamilyCompressionParametersByNamePostParams) WithOpts(opts string) *ColumnFamilyCompressionParametersByNamePostParams { + o.SetOpts(opts) + return o +} + +// SetOpts adds the opts to the column family compression parameters by name post params +func (o *ColumnFamilyCompressionParametersByNamePostParams) SetOpts(opts string) { + o.Opts = opts +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyCompressionParametersByNamePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + // query param opts + qrOpts := o.Opts + qOpts := qrOpts + if qOpts != "" { + if err := r.SetQueryParam("opts", qOpts); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compression_parameters_by_name_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compression_parameters_by_name_post_responses.go new file mode 100644 index 0000000000..8cd43e8bc2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_compression_parameters_by_name_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyCompressionParametersByNamePostReader is a Reader for the ColumnFamilyCompressionParametersByNamePost structure. +type ColumnFamilyCompressionParametersByNamePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyCompressionParametersByNamePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyCompressionParametersByNamePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyCompressionParametersByNamePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyCompressionParametersByNamePostOK creates a ColumnFamilyCompressionParametersByNamePostOK with default headers values +func NewColumnFamilyCompressionParametersByNamePostOK() *ColumnFamilyCompressionParametersByNamePostOK { + return &ColumnFamilyCompressionParametersByNamePostOK{} +} + +/* +ColumnFamilyCompressionParametersByNamePostOK handles this case with default header values. + +Success +*/ +type ColumnFamilyCompressionParametersByNamePostOK struct { +} + +func (o *ColumnFamilyCompressionParametersByNamePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyCompressionParametersByNamePostDefault creates a ColumnFamilyCompressionParametersByNamePostDefault with default headers values +func NewColumnFamilyCompressionParametersByNamePostDefault(code int) *ColumnFamilyCompressionParametersByNamePostDefault { + return &ColumnFamilyCompressionParametersByNamePostDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyCompressionParametersByNamePostDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyCompressionParametersByNamePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family compression parameters by name post default response +func (o *ColumnFamilyCompressionParametersByNamePostDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyCompressionParametersByNamePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyCompressionParametersByNamePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyCompressionParametersByNamePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_crc_check_chance_by_name_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_crc_check_chance_by_name_post_parameters.go new file mode 100644 index 0000000000..51a2dfc15f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_crc_check_chance_by_name_post_parameters.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyCrcCheckChanceByNamePostParams creates a new ColumnFamilyCrcCheckChanceByNamePostParams object +// with the default values initialized. +func NewColumnFamilyCrcCheckChanceByNamePostParams() *ColumnFamilyCrcCheckChanceByNamePostParams { + var () + return &ColumnFamilyCrcCheckChanceByNamePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyCrcCheckChanceByNamePostParamsWithTimeout creates a new ColumnFamilyCrcCheckChanceByNamePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyCrcCheckChanceByNamePostParamsWithTimeout(timeout time.Duration) *ColumnFamilyCrcCheckChanceByNamePostParams { + var () + return &ColumnFamilyCrcCheckChanceByNamePostParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyCrcCheckChanceByNamePostParamsWithContext creates a new ColumnFamilyCrcCheckChanceByNamePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyCrcCheckChanceByNamePostParamsWithContext(ctx context.Context) *ColumnFamilyCrcCheckChanceByNamePostParams { + var () + return &ColumnFamilyCrcCheckChanceByNamePostParams{ + + Context: ctx, + } +} + +// NewColumnFamilyCrcCheckChanceByNamePostParamsWithHTTPClient creates a new ColumnFamilyCrcCheckChanceByNamePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyCrcCheckChanceByNamePostParamsWithHTTPClient(client *http.Client) *ColumnFamilyCrcCheckChanceByNamePostParams { + var () + return &ColumnFamilyCrcCheckChanceByNamePostParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyCrcCheckChanceByNamePostParams contains all the parameters to send to the API endpoint +for the column family crc check chance by name post operation typically these are written to a http.Request +*/ +type ColumnFamilyCrcCheckChanceByNamePostParams struct { + + /*CheckChance + CRC check chance + + */ + CheckChance string + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family crc check chance by name post params +func (o *ColumnFamilyCrcCheckChanceByNamePostParams) WithTimeout(timeout time.Duration) *ColumnFamilyCrcCheckChanceByNamePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family crc check chance by name post params +func (o *ColumnFamilyCrcCheckChanceByNamePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family crc check chance by name post params +func (o *ColumnFamilyCrcCheckChanceByNamePostParams) WithContext(ctx context.Context) *ColumnFamilyCrcCheckChanceByNamePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family crc check chance by name post params +func (o *ColumnFamilyCrcCheckChanceByNamePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family crc check chance by name post params +func (o *ColumnFamilyCrcCheckChanceByNamePostParams) WithHTTPClient(client *http.Client) *ColumnFamilyCrcCheckChanceByNamePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family crc check chance by name post params +func (o *ColumnFamilyCrcCheckChanceByNamePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCheckChance adds the checkChance to the column family crc check chance by name post params +func (o *ColumnFamilyCrcCheckChanceByNamePostParams) WithCheckChance(checkChance string) *ColumnFamilyCrcCheckChanceByNamePostParams { + o.SetCheckChance(checkChance) + return o +} + +// SetCheckChance adds the checkChance to the column family crc check chance by name post params +func (o *ColumnFamilyCrcCheckChanceByNamePostParams) SetCheckChance(checkChance string) { + o.CheckChance = checkChance +} + +// WithName adds the name to the column family crc check chance by name post params +func (o *ColumnFamilyCrcCheckChanceByNamePostParams) WithName(name string) *ColumnFamilyCrcCheckChanceByNamePostParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family crc check chance by name post params +func (o *ColumnFamilyCrcCheckChanceByNamePostParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyCrcCheckChanceByNamePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param check_chance + qrCheckChance := o.CheckChance + qCheckChance := qrCheckChance + if qCheckChance != "" { + if err := r.SetQueryParam("check_chance", qCheckChance); err != nil { + return err + } + } + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_crc_check_chance_by_name_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_crc_check_chance_by_name_post_responses.go new file mode 100644 index 0000000000..0ecc6acd42 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_crc_check_chance_by_name_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyCrcCheckChanceByNamePostReader is a Reader for the ColumnFamilyCrcCheckChanceByNamePost structure. +type ColumnFamilyCrcCheckChanceByNamePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyCrcCheckChanceByNamePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyCrcCheckChanceByNamePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyCrcCheckChanceByNamePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyCrcCheckChanceByNamePostOK creates a ColumnFamilyCrcCheckChanceByNamePostOK with default headers values +func NewColumnFamilyCrcCheckChanceByNamePostOK() *ColumnFamilyCrcCheckChanceByNamePostOK { + return &ColumnFamilyCrcCheckChanceByNamePostOK{} +} + +/* +ColumnFamilyCrcCheckChanceByNamePostOK handles this case with default header values. + +Success +*/ +type ColumnFamilyCrcCheckChanceByNamePostOK struct { +} + +func (o *ColumnFamilyCrcCheckChanceByNamePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyCrcCheckChanceByNamePostDefault creates a ColumnFamilyCrcCheckChanceByNamePostDefault with default headers values +func NewColumnFamilyCrcCheckChanceByNamePostDefault(code int) *ColumnFamilyCrcCheckChanceByNamePostDefault { + return &ColumnFamilyCrcCheckChanceByNamePostDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyCrcCheckChanceByNamePostDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyCrcCheckChanceByNamePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family crc check chance by name post default response +func (o *ColumnFamilyCrcCheckChanceByNamePostDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyCrcCheckChanceByNamePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyCrcCheckChanceByNamePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyCrcCheckChanceByNamePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_droppable_ratio_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_droppable_ratio_by_name_get_parameters.go new file mode 100644 index 0000000000..be65465774 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_droppable_ratio_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyDroppableRatioByNameGetParams creates a new ColumnFamilyDroppableRatioByNameGetParams object +// with the default values initialized. +func NewColumnFamilyDroppableRatioByNameGetParams() *ColumnFamilyDroppableRatioByNameGetParams { + var () + return &ColumnFamilyDroppableRatioByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyDroppableRatioByNameGetParamsWithTimeout creates a new ColumnFamilyDroppableRatioByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyDroppableRatioByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyDroppableRatioByNameGetParams { + var () + return &ColumnFamilyDroppableRatioByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyDroppableRatioByNameGetParamsWithContext creates a new ColumnFamilyDroppableRatioByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyDroppableRatioByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyDroppableRatioByNameGetParams { + var () + return &ColumnFamilyDroppableRatioByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyDroppableRatioByNameGetParamsWithHTTPClient creates a new ColumnFamilyDroppableRatioByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyDroppableRatioByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyDroppableRatioByNameGetParams { + var () + return &ColumnFamilyDroppableRatioByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyDroppableRatioByNameGetParams contains all the parameters to send to the API endpoint +for the column family droppable ratio by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyDroppableRatioByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family droppable ratio by name get params +func (o *ColumnFamilyDroppableRatioByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyDroppableRatioByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family droppable ratio by name get params +func (o *ColumnFamilyDroppableRatioByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family droppable ratio by name get params +func (o *ColumnFamilyDroppableRatioByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyDroppableRatioByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family droppable ratio by name get params +func (o *ColumnFamilyDroppableRatioByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family droppable ratio by name get params +func (o *ColumnFamilyDroppableRatioByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyDroppableRatioByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family droppable ratio by name get params +func (o *ColumnFamilyDroppableRatioByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family droppable ratio by name get params +func (o *ColumnFamilyDroppableRatioByNameGetParams) WithName(name string) *ColumnFamilyDroppableRatioByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family droppable ratio by name get params +func (o *ColumnFamilyDroppableRatioByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyDroppableRatioByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_droppable_ratio_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_droppable_ratio_by_name_get_responses.go new file mode 100644 index 0000000000..dd62950589 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_droppable_ratio_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyDroppableRatioByNameGetReader is a Reader for the ColumnFamilyDroppableRatioByNameGet structure. +type ColumnFamilyDroppableRatioByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyDroppableRatioByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyDroppableRatioByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyDroppableRatioByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyDroppableRatioByNameGetOK creates a ColumnFamilyDroppableRatioByNameGetOK with default headers values +func NewColumnFamilyDroppableRatioByNameGetOK() *ColumnFamilyDroppableRatioByNameGetOK { + return &ColumnFamilyDroppableRatioByNameGetOK{} +} + +/* +ColumnFamilyDroppableRatioByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyDroppableRatioByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyDroppableRatioByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyDroppableRatioByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyDroppableRatioByNameGetDefault creates a ColumnFamilyDroppableRatioByNameGetDefault with default headers values +func NewColumnFamilyDroppableRatioByNameGetDefault(code int) *ColumnFamilyDroppableRatioByNameGetDefault { + return &ColumnFamilyDroppableRatioByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyDroppableRatioByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyDroppableRatioByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family droppable ratio by name get default response +func (o *ColumnFamilyDroppableRatioByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyDroppableRatioByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyDroppableRatioByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyDroppableRatioByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_estimate_keys_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_estimate_keys_by_name_get_parameters.go new file mode 100644 index 0000000000..6b5a446c4a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_estimate_keys_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyEstimateKeysByNameGetParams creates a new ColumnFamilyEstimateKeysByNameGetParams object +// with the default values initialized. +func NewColumnFamilyEstimateKeysByNameGetParams() *ColumnFamilyEstimateKeysByNameGetParams { + var () + return &ColumnFamilyEstimateKeysByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyEstimateKeysByNameGetParamsWithTimeout creates a new ColumnFamilyEstimateKeysByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyEstimateKeysByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyEstimateKeysByNameGetParams { + var () + return &ColumnFamilyEstimateKeysByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyEstimateKeysByNameGetParamsWithContext creates a new ColumnFamilyEstimateKeysByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyEstimateKeysByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyEstimateKeysByNameGetParams { + var () + return &ColumnFamilyEstimateKeysByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyEstimateKeysByNameGetParamsWithHTTPClient creates a new ColumnFamilyEstimateKeysByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyEstimateKeysByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyEstimateKeysByNameGetParams { + var () + return &ColumnFamilyEstimateKeysByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyEstimateKeysByNameGetParams contains all the parameters to send to the API endpoint +for the column family estimate keys by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyEstimateKeysByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family estimate keys by name get params +func (o *ColumnFamilyEstimateKeysByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyEstimateKeysByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family estimate keys by name get params +func (o *ColumnFamilyEstimateKeysByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family estimate keys by name get params +func (o *ColumnFamilyEstimateKeysByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyEstimateKeysByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family estimate keys by name get params +func (o *ColumnFamilyEstimateKeysByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family estimate keys by name get params +func (o *ColumnFamilyEstimateKeysByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyEstimateKeysByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family estimate keys by name get params +func (o *ColumnFamilyEstimateKeysByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family estimate keys by name get params +func (o *ColumnFamilyEstimateKeysByNameGetParams) WithName(name string) *ColumnFamilyEstimateKeysByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family estimate keys by name get params +func (o *ColumnFamilyEstimateKeysByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyEstimateKeysByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_estimate_keys_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_estimate_keys_by_name_get_responses.go new file mode 100644 index 0000000000..3afbb01516 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_estimate_keys_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyEstimateKeysByNameGetReader is a Reader for the ColumnFamilyEstimateKeysByNameGet structure. +type ColumnFamilyEstimateKeysByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyEstimateKeysByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyEstimateKeysByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyEstimateKeysByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyEstimateKeysByNameGetOK creates a ColumnFamilyEstimateKeysByNameGetOK with default headers values +func NewColumnFamilyEstimateKeysByNameGetOK() *ColumnFamilyEstimateKeysByNameGetOK { + return &ColumnFamilyEstimateKeysByNameGetOK{} +} + +/* +ColumnFamilyEstimateKeysByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyEstimateKeysByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyEstimateKeysByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyEstimateKeysByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyEstimateKeysByNameGetDefault creates a ColumnFamilyEstimateKeysByNameGetDefault with default headers values +func NewColumnFamilyEstimateKeysByNameGetDefault(code int) *ColumnFamilyEstimateKeysByNameGetDefault { + return &ColumnFamilyEstimateKeysByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyEstimateKeysByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyEstimateKeysByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family estimate keys by name get default response +func (o *ColumnFamilyEstimateKeysByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyEstimateKeysByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyEstimateKeysByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyEstimateKeysByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_get_parameters.go new file mode 100644 index 0000000000..253a229203 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyGetParams creates a new ColumnFamilyGetParams object +// with the default values initialized. +func NewColumnFamilyGetParams() *ColumnFamilyGetParams { + + return &ColumnFamilyGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyGetParamsWithTimeout creates a new ColumnFamilyGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyGetParams { + + return &ColumnFamilyGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyGetParamsWithContext creates a new ColumnFamilyGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyGetParamsWithContext(ctx context.Context) *ColumnFamilyGetParams { + + return &ColumnFamilyGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyGetParamsWithHTTPClient creates a new ColumnFamilyGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyGetParams { + + return &ColumnFamilyGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyGetParams contains all the parameters to send to the API endpoint +for the column family get operation typically these are written to a http.Request +*/ +type ColumnFamilyGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family get params +func (o *ColumnFamilyGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family get params +func (o *ColumnFamilyGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family get params +func (o *ColumnFamilyGetParams) WithContext(ctx context.Context) *ColumnFamilyGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family get params +func (o *ColumnFamilyGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family get params +func (o *ColumnFamilyGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family get params +func (o *ColumnFamilyGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_get_responses.go new file mode 100644 index 0000000000..9761eccba4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyGetReader is a Reader for the ColumnFamilyGet structure. +type ColumnFamilyGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyGetOK creates a ColumnFamilyGetOK with default headers values +func NewColumnFamilyGetOK() *ColumnFamilyGetOK { + return &ColumnFamilyGetOK{} +} + +/* +ColumnFamilyGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyGetOK struct { + Payload []*models.ColumnFamilyInfo +} + +func (o *ColumnFamilyGetOK) GetPayload() []*models.ColumnFamilyInfo { + return o.Payload +} + +func (o *ColumnFamilyGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyGetDefault creates a ColumnFamilyGetDefault with default headers values +func NewColumnFamilyGetDefault(code int) *ColumnFamilyGetDefault { + return &ColumnFamilyGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family get default response +func (o *ColumnFamilyGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_load_sstable_by_name_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_load_sstable_by_name_post_parameters.go new file mode 100644 index 0000000000..e6a107eb8d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_load_sstable_by_name_post_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyLoadSstableByNamePostParams creates a new ColumnFamilyLoadSstableByNamePostParams object +// with the default values initialized. +func NewColumnFamilyLoadSstableByNamePostParams() *ColumnFamilyLoadSstableByNamePostParams { + var () + return &ColumnFamilyLoadSstableByNamePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyLoadSstableByNamePostParamsWithTimeout creates a new ColumnFamilyLoadSstableByNamePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyLoadSstableByNamePostParamsWithTimeout(timeout time.Duration) *ColumnFamilyLoadSstableByNamePostParams { + var () + return &ColumnFamilyLoadSstableByNamePostParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyLoadSstableByNamePostParamsWithContext creates a new ColumnFamilyLoadSstableByNamePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyLoadSstableByNamePostParamsWithContext(ctx context.Context) *ColumnFamilyLoadSstableByNamePostParams { + var () + return &ColumnFamilyLoadSstableByNamePostParams{ + + Context: ctx, + } +} + +// NewColumnFamilyLoadSstableByNamePostParamsWithHTTPClient creates a new ColumnFamilyLoadSstableByNamePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyLoadSstableByNamePostParamsWithHTTPClient(client *http.Client) *ColumnFamilyLoadSstableByNamePostParams { + var () + return &ColumnFamilyLoadSstableByNamePostParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyLoadSstableByNamePostParams contains all the parameters to send to the API endpoint +for the column family load sstable by name post operation typically these are written to a http.Request +*/ +type ColumnFamilyLoadSstableByNamePostParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family load sstable by name post params +func (o *ColumnFamilyLoadSstableByNamePostParams) WithTimeout(timeout time.Duration) *ColumnFamilyLoadSstableByNamePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family load sstable by name post params +func (o *ColumnFamilyLoadSstableByNamePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family load sstable by name post params +func (o *ColumnFamilyLoadSstableByNamePostParams) WithContext(ctx context.Context) *ColumnFamilyLoadSstableByNamePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family load sstable by name post params +func (o *ColumnFamilyLoadSstableByNamePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family load sstable by name post params +func (o *ColumnFamilyLoadSstableByNamePostParams) WithHTTPClient(client *http.Client) *ColumnFamilyLoadSstableByNamePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family load sstable by name post params +func (o *ColumnFamilyLoadSstableByNamePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family load sstable by name post params +func (o *ColumnFamilyLoadSstableByNamePostParams) WithName(name string) *ColumnFamilyLoadSstableByNamePostParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family load sstable by name post params +func (o *ColumnFamilyLoadSstableByNamePostParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyLoadSstableByNamePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_load_sstable_by_name_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_load_sstable_by_name_post_responses.go new file mode 100644 index 0000000000..bab35a1ba9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_load_sstable_by_name_post_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyLoadSstableByNamePostReader is a Reader for the ColumnFamilyLoadSstableByNamePost structure. +type ColumnFamilyLoadSstableByNamePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyLoadSstableByNamePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyLoadSstableByNamePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyLoadSstableByNamePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyLoadSstableByNamePostOK creates a ColumnFamilyLoadSstableByNamePostOK with default headers values +func NewColumnFamilyLoadSstableByNamePostOK() *ColumnFamilyLoadSstableByNamePostOK { + return &ColumnFamilyLoadSstableByNamePostOK{} +} + +/* +ColumnFamilyLoadSstableByNamePostOK handles this case with default header values. + +Success +*/ +type ColumnFamilyLoadSstableByNamePostOK struct { + Payload string +} + +func (o *ColumnFamilyLoadSstableByNamePostOK) GetPayload() string { + return o.Payload +} + +func (o *ColumnFamilyLoadSstableByNamePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyLoadSstableByNamePostDefault creates a ColumnFamilyLoadSstableByNamePostDefault with default headers values +func NewColumnFamilyLoadSstableByNamePostDefault(code int) *ColumnFamilyLoadSstableByNamePostDefault { + return &ColumnFamilyLoadSstableByNamePostDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyLoadSstableByNamePostDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyLoadSstableByNamePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family load sstable by name post default response +func (o *ColumnFamilyLoadSstableByNamePostDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyLoadSstableByNamePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyLoadSstableByNamePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyLoadSstableByNamePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_major_compaction_by_name_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_major_compaction_by_name_post_parameters.go new file mode 100644 index 0000000000..8a641ab0f5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_major_compaction_by_name_post_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewColumnFamilyMajorCompactionByNamePostParams creates a new ColumnFamilyMajorCompactionByNamePostParams object +// with the default values initialized. +func NewColumnFamilyMajorCompactionByNamePostParams() *ColumnFamilyMajorCompactionByNamePostParams { + var () + return &ColumnFamilyMajorCompactionByNamePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMajorCompactionByNamePostParamsWithTimeout creates a new ColumnFamilyMajorCompactionByNamePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMajorCompactionByNamePostParamsWithTimeout(timeout time.Duration) *ColumnFamilyMajorCompactionByNamePostParams { + var () + return &ColumnFamilyMajorCompactionByNamePostParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMajorCompactionByNamePostParamsWithContext creates a new ColumnFamilyMajorCompactionByNamePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMajorCompactionByNamePostParamsWithContext(ctx context.Context) *ColumnFamilyMajorCompactionByNamePostParams { + var () + return &ColumnFamilyMajorCompactionByNamePostParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMajorCompactionByNamePostParamsWithHTTPClient creates a new ColumnFamilyMajorCompactionByNamePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMajorCompactionByNamePostParamsWithHTTPClient(client *http.Client) *ColumnFamilyMajorCompactionByNamePostParams { + var () + return &ColumnFamilyMajorCompactionByNamePostParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMajorCompactionByNamePostParams contains all the parameters to send to the API endpoint +for the column family major compaction by name post operation typically these are written to a http.Request +*/ +type ColumnFamilyMajorCompactionByNamePostParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + /*SplitOutput + true if the output of the major compaction should be split in several sstables + + */ + SplitOutput *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family major compaction by name post params +func (o *ColumnFamilyMajorCompactionByNamePostParams) WithTimeout(timeout time.Duration) *ColumnFamilyMajorCompactionByNamePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family major compaction by name post params +func (o *ColumnFamilyMajorCompactionByNamePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family major compaction by name post params +func (o *ColumnFamilyMajorCompactionByNamePostParams) WithContext(ctx context.Context) *ColumnFamilyMajorCompactionByNamePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family major compaction by name post params +func (o *ColumnFamilyMajorCompactionByNamePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family major compaction by name post params +func (o *ColumnFamilyMajorCompactionByNamePostParams) WithHTTPClient(client *http.Client) *ColumnFamilyMajorCompactionByNamePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family major compaction by name post params +func (o *ColumnFamilyMajorCompactionByNamePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family major compaction by name post params +func (o *ColumnFamilyMajorCompactionByNamePostParams) WithName(name string) *ColumnFamilyMajorCompactionByNamePostParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family major compaction by name post params +func (o *ColumnFamilyMajorCompactionByNamePostParams) SetName(name string) { + o.Name = name +} + +// WithSplitOutput adds the splitOutput to the column family major compaction by name post params +func (o *ColumnFamilyMajorCompactionByNamePostParams) WithSplitOutput(splitOutput *bool) *ColumnFamilyMajorCompactionByNamePostParams { + o.SetSplitOutput(splitOutput) + return o +} + +// SetSplitOutput adds the splitOutput to the column family major compaction by name post params +func (o *ColumnFamilyMajorCompactionByNamePostParams) SetSplitOutput(splitOutput *bool) { + o.SplitOutput = splitOutput +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMajorCompactionByNamePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if o.SplitOutput != nil { + + // query param split_output + var qrSplitOutput bool + if o.SplitOutput != nil { + qrSplitOutput = *o.SplitOutput + } + qSplitOutput := swag.FormatBool(qrSplitOutput) + if qSplitOutput != "" { + if err := r.SetQueryParam("split_output", qSplitOutput); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_major_compaction_by_name_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_major_compaction_by_name_post_responses.go new file mode 100644 index 0000000000..67718776d9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_major_compaction_by_name_post_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMajorCompactionByNamePostReader is a Reader for the ColumnFamilyMajorCompactionByNamePost structure. +type ColumnFamilyMajorCompactionByNamePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMajorCompactionByNamePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMajorCompactionByNamePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMajorCompactionByNamePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMajorCompactionByNamePostOK creates a ColumnFamilyMajorCompactionByNamePostOK with default headers values +func NewColumnFamilyMajorCompactionByNamePostOK() *ColumnFamilyMajorCompactionByNamePostOK { + return &ColumnFamilyMajorCompactionByNamePostOK{} +} + +/* +ColumnFamilyMajorCompactionByNamePostOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMajorCompactionByNamePostOK struct { + Payload string +} + +func (o *ColumnFamilyMajorCompactionByNamePostOK) GetPayload() string { + return o.Payload +} + +func (o *ColumnFamilyMajorCompactionByNamePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMajorCompactionByNamePostDefault creates a ColumnFamilyMajorCompactionByNamePostDefault with default headers values +func NewColumnFamilyMajorCompactionByNamePostDefault(code int) *ColumnFamilyMajorCompactionByNamePostDefault { + return &ColumnFamilyMajorCompactionByNamePostDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMajorCompactionByNamePostDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMajorCompactionByNamePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family major compaction by name post default response +func (o *ColumnFamilyMajorCompactionByNamePostDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMajorCompactionByNamePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMajorCompactionByNamePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMajorCompactionByNamePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_maximum_compaction_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_maximum_compaction_by_name_get_parameters.go new file mode 100644 index 0000000000..cd92478574 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_maximum_compaction_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMaximumCompactionByNameGetParams creates a new ColumnFamilyMaximumCompactionByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMaximumCompactionByNameGetParams() *ColumnFamilyMaximumCompactionByNameGetParams { + var () + return &ColumnFamilyMaximumCompactionByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMaximumCompactionByNameGetParamsWithTimeout creates a new ColumnFamilyMaximumCompactionByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMaximumCompactionByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMaximumCompactionByNameGetParams { + var () + return &ColumnFamilyMaximumCompactionByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMaximumCompactionByNameGetParamsWithContext creates a new ColumnFamilyMaximumCompactionByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMaximumCompactionByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMaximumCompactionByNameGetParams { + var () + return &ColumnFamilyMaximumCompactionByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMaximumCompactionByNameGetParamsWithHTTPClient creates a new ColumnFamilyMaximumCompactionByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMaximumCompactionByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMaximumCompactionByNameGetParams { + var () + return &ColumnFamilyMaximumCompactionByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMaximumCompactionByNameGetParams contains all the parameters to send to the API endpoint +for the column family maximum compaction by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMaximumCompactionByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family maximum compaction by name get params +func (o *ColumnFamilyMaximumCompactionByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMaximumCompactionByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family maximum compaction by name get params +func (o *ColumnFamilyMaximumCompactionByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family maximum compaction by name get params +func (o *ColumnFamilyMaximumCompactionByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMaximumCompactionByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family maximum compaction by name get params +func (o *ColumnFamilyMaximumCompactionByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family maximum compaction by name get params +func (o *ColumnFamilyMaximumCompactionByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMaximumCompactionByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family maximum compaction by name get params +func (o *ColumnFamilyMaximumCompactionByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family maximum compaction by name get params +func (o *ColumnFamilyMaximumCompactionByNameGetParams) WithName(name string) *ColumnFamilyMaximumCompactionByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family maximum compaction by name get params +func (o *ColumnFamilyMaximumCompactionByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMaximumCompactionByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_maximum_compaction_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_maximum_compaction_by_name_get_responses.go new file mode 100644 index 0000000000..5497614352 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_maximum_compaction_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMaximumCompactionByNameGetReader is a Reader for the ColumnFamilyMaximumCompactionByNameGet structure. +type ColumnFamilyMaximumCompactionByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMaximumCompactionByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMaximumCompactionByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMaximumCompactionByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMaximumCompactionByNameGetOK creates a ColumnFamilyMaximumCompactionByNameGetOK with default headers values +func NewColumnFamilyMaximumCompactionByNameGetOK() *ColumnFamilyMaximumCompactionByNameGetOK { + return &ColumnFamilyMaximumCompactionByNameGetOK{} +} + +/* +ColumnFamilyMaximumCompactionByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMaximumCompactionByNameGetOK struct { + Payload string +} + +func (o *ColumnFamilyMaximumCompactionByNameGetOK) GetPayload() string { + return o.Payload +} + +func (o *ColumnFamilyMaximumCompactionByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMaximumCompactionByNameGetDefault creates a ColumnFamilyMaximumCompactionByNameGetDefault with default headers values +func NewColumnFamilyMaximumCompactionByNameGetDefault(code int) *ColumnFamilyMaximumCompactionByNameGetDefault { + return &ColumnFamilyMaximumCompactionByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMaximumCompactionByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMaximumCompactionByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family maximum compaction by name get default response +func (o *ColumnFamilyMaximumCompactionByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMaximumCompactionByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMaximumCompactionByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMaximumCompactionByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_maximum_compaction_by_name_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_maximum_compaction_by_name_post_parameters.go new file mode 100644 index 0000000000..a28fdfab48 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_maximum_compaction_by_name_post_parameters.go @@ -0,0 +1,162 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewColumnFamilyMaximumCompactionByNamePostParams creates a new ColumnFamilyMaximumCompactionByNamePostParams object +// with the default values initialized. +func NewColumnFamilyMaximumCompactionByNamePostParams() *ColumnFamilyMaximumCompactionByNamePostParams { + var () + return &ColumnFamilyMaximumCompactionByNamePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMaximumCompactionByNamePostParamsWithTimeout creates a new ColumnFamilyMaximumCompactionByNamePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMaximumCompactionByNamePostParamsWithTimeout(timeout time.Duration) *ColumnFamilyMaximumCompactionByNamePostParams { + var () + return &ColumnFamilyMaximumCompactionByNamePostParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMaximumCompactionByNamePostParamsWithContext creates a new ColumnFamilyMaximumCompactionByNamePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMaximumCompactionByNamePostParamsWithContext(ctx context.Context) *ColumnFamilyMaximumCompactionByNamePostParams { + var () + return &ColumnFamilyMaximumCompactionByNamePostParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMaximumCompactionByNamePostParamsWithHTTPClient creates a new ColumnFamilyMaximumCompactionByNamePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMaximumCompactionByNamePostParamsWithHTTPClient(client *http.Client) *ColumnFamilyMaximumCompactionByNamePostParams { + var () + return &ColumnFamilyMaximumCompactionByNamePostParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMaximumCompactionByNamePostParams contains all the parameters to send to the API endpoint +for the column family maximum compaction by name post operation typically these are written to a http.Request +*/ +type ColumnFamilyMaximumCompactionByNamePostParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + /*Value + The maximum number of sstables in queue before compaction kicks off + + */ + Value int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family maximum compaction by name post params +func (o *ColumnFamilyMaximumCompactionByNamePostParams) WithTimeout(timeout time.Duration) *ColumnFamilyMaximumCompactionByNamePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family maximum compaction by name post params +func (o *ColumnFamilyMaximumCompactionByNamePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family maximum compaction by name post params +func (o *ColumnFamilyMaximumCompactionByNamePostParams) WithContext(ctx context.Context) *ColumnFamilyMaximumCompactionByNamePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family maximum compaction by name post params +func (o *ColumnFamilyMaximumCompactionByNamePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family maximum compaction by name post params +func (o *ColumnFamilyMaximumCompactionByNamePostParams) WithHTTPClient(client *http.Client) *ColumnFamilyMaximumCompactionByNamePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family maximum compaction by name post params +func (o *ColumnFamilyMaximumCompactionByNamePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family maximum compaction by name post params +func (o *ColumnFamilyMaximumCompactionByNamePostParams) WithName(name string) *ColumnFamilyMaximumCompactionByNamePostParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family maximum compaction by name post params +func (o *ColumnFamilyMaximumCompactionByNamePostParams) SetName(name string) { + o.Name = name +} + +// WithValue adds the value to the column family maximum compaction by name post params +func (o *ColumnFamilyMaximumCompactionByNamePostParams) WithValue(value int32) *ColumnFamilyMaximumCompactionByNamePostParams { + o.SetValue(value) + return o +} + +// SetValue adds the value to the column family maximum compaction by name post params +func (o *ColumnFamilyMaximumCompactionByNamePostParams) SetValue(value int32) { + o.Value = value +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMaximumCompactionByNamePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + // query param value + qrValue := o.Value + qValue := swag.FormatInt32(qrValue) + if qValue != "" { + if err := r.SetQueryParam("value", qValue); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_maximum_compaction_by_name_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_maximum_compaction_by_name_post_responses.go new file mode 100644 index 0000000000..26d1f69529 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_maximum_compaction_by_name_post_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMaximumCompactionByNamePostReader is a Reader for the ColumnFamilyMaximumCompactionByNamePost structure. +type ColumnFamilyMaximumCompactionByNamePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMaximumCompactionByNamePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMaximumCompactionByNamePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMaximumCompactionByNamePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMaximumCompactionByNamePostOK creates a ColumnFamilyMaximumCompactionByNamePostOK with default headers values +func NewColumnFamilyMaximumCompactionByNamePostOK() *ColumnFamilyMaximumCompactionByNamePostOK { + return &ColumnFamilyMaximumCompactionByNamePostOK{} +} + +/* +ColumnFamilyMaximumCompactionByNamePostOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMaximumCompactionByNamePostOK struct { + Payload string +} + +func (o *ColumnFamilyMaximumCompactionByNamePostOK) GetPayload() string { + return o.Payload +} + +func (o *ColumnFamilyMaximumCompactionByNamePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMaximumCompactionByNamePostDefault creates a ColumnFamilyMaximumCompactionByNamePostDefault with default headers values +func NewColumnFamilyMaximumCompactionByNamePostDefault(code int) *ColumnFamilyMaximumCompactionByNamePostDefault { + return &ColumnFamilyMaximumCompactionByNamePostDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMaximumCompactionByNamePostDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMaximumCompactionByNamePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family maximum compaction by name post default response +func (o *ColumnFamilyMaximumCompactionByNamePostDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMaximumCompactionByNamePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMaximumCompactionByNamePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMaximumCompactionByNamePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_live_data_size_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_live_data_size_by_name_get_parameters.go new file mode 100644 index 0000000000..196eff5f1a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_live_data_size_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams creates a new ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams() *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams { + var () + return &ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams { + var () + return &ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParamsWithContext creates a new ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams { + var () + return &ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams { + var () + return &ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics all memtables live data size by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics all memtables live data size by name get params +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics all memtables live data size by name get params +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics all memtables live data size by name get params +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics all memtables live data size by name get params +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics all memtables live data size by name get params +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics all memtables live data size by name get params +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics all memtables live data size by name get params +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams) WithName(name string) *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics all memtables live data size by name get params +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_live_data_size_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_live_data_size_by_name_get_responses.go new file mode 100644 index 0000000000..40a21e6c87 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_live_data_size_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetReader is a Reader for the ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGet structure. +type ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetOK creates a ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetOK with default headers values +func NewColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetOK() *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetOK { + return &ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetOK{} +} + +/* +ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetDefault creates a ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetDefault with default headers values +func NewColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetDefault(code int) *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetDefault { + return &ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics all memtables live data size by name get default response +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_live_data_size_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_live_data_size_get_parameters.go new file mode 100644 index 0000000000..6d2da4ad0e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_live_data_size_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams creates a new ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams() *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams { + + return &ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsAllMemtablesLiveDataSizeGetParamsWithTimeout creates a new ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsAllMemtablesLiveDataSizeGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams { + + return &ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsAllMemtablesLiveDataSizeGetParamsWithContext creates a new ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsAllMemtablesLiveDataSizeGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams { + + return &ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsAllMemtablesLiveDataSizeGetParamsWithHTTPClient creates a new ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsAllMemtablesLiveDataSizeGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams { + + return &ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams contains all the parameters to send to the API endpoint +for the column family metrics all memtables live data size get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics all memtables live data size get params +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics all memtables live data size get params +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics all memtables live data size get params +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics all memtables live data size get params +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics all memtables live data size get params +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics all memtables live data size get params +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_live_data_size_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_live_data_size_get_responses.go new file mode 100644 index 0000000000..7f3beb73eb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_live_data_size_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsAllMemtablesLiveDataSizeGetReader is a Reader for the ColumnFamilyMetricsAllMemtablesLiveDataSizeGet structure. +type ColumnFamilyMetricsAllMemtablesLiveDataSizeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsAllMemtablesLiveDataSizeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsAllMemtablesLiveDataSizeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsAllMemtablesLiveDataSizeGetOK creates a ColumnFamilyMetricsAllMemtablesLiveDataSizeGetOK with default headers values +func NewColumnFamilyMetricsAllMemtablesLiveDataSizeGetOK() *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetOK { + return &ColumnFamilyMetricsAllMemtablesLiveDataSizeGetOK{} +} + +/* +ColumnFamilyMetricsAllMemtablesLiveDataSizeGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsAllMemtablesLiveDataSizeGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsAllMemtablesLiveDataSizeGetDefault creates a ColumnFamilyMetricsAllMemtablesLiveDataSizeGetDefault with default headers values +func NewColumnFamilyMetricsAllMemtablesLiveDataSizeGetDefault(code int) *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetDefault { + return &ColumnFamilyMetricsAllMemtablesLiveDataSizeGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsAllMemtablesLiveDataSizeGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsAllMemtablesLiveDataSizeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics all memtables live data size get default response +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_off_heap_size_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_off_heap_size_by_name_get_parameters.go new file mode 100644 index 0000000000..b99284072a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_off_heap_size_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams creates a new ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams() *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParamsWithContext creates a new ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics all memtables off heap size by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics all memtables off heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics all memtables off heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics all memtables off heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics all memtables off heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics all memtables off heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics all memtables off heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics all memtables off heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams) WithName(name string) *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics all memtables off heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_off_heap_size_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_off_heap_size_by_name_get_responses.go new file mode 100644 index 0000000000..3148e953b5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_off_heap_size_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetReader is a Reader for the ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGet structure. +type ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetOK creates a ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetOK with default headers values +func NewColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetOK() *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetOK { + return &ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetOK{} +} + +/* +ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetDefault creates a ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetDefault with default headers values +func NewColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetDefault(code int) *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetDefault { + return &ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics all memtables off heap size by name get default response +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_off_heap_size_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_off_heap_size_get_parameters.go new file mode 100644 index 0000000000..aad49a13af --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_off_heap_size_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams creates a new ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams() *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams { + + return &ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsAllMemtablesOffHeapSizeGetParamsWithTimeout creates a new ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsAllMemtablesOffHeapSizeGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams { + + return &ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsAllMemtablesOffHeapSizeGetParamsWithContext creates a new ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsAllMemtablesOffHeapSizeGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams { + + return &ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsAllMemtablesOffHeapSizeGetParamsWithHTTPClient creates a new ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsAllMemtablesOffHeapSizeGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams { + + return &ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams contains all the parameters to send to the API endpoint +for the column family metrics all memtables off heap size get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics all memtables off heap size get params +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics all memtables off heap size get params +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics all memtables off heap size get params +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics all memtables off heap size get params +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics all memtables off heap size get params +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics all memtables off heap size get params +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_off_heap_size_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_off_heap_size_get_responses.go new file mode 100644 index 0000000000..34085de4b9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_off_heap_size_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsAllMemtablesOffHeapSizeGetReader is a Reader for the ColumnFamilyMetricsAllMemtablesOffHeapSizeGet structure. +type ColumnFamilyMetricsAllMemtablesOffHeapSizeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsAllMemtablesOffHeapSizeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsAllMemtablesOffHeapSizeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsAllMemtablesOffHeapSizeGetOK creates a ColumnFamilyMetricsAllMemtablesOffHeapSizeGetOK with default headers values +func NewColumnFamilyMetricsAllMemtablesOffHeapSizeGetOK() *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetOK { + return &ColumnFamilyMetricsAllMemtablesOffHeapSizeGetOK{} +} + +/* +ColumnFamilyMetricsAllMemtablesOffHeapSizeGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsAllMemtablesOffHeapSizeGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsAllMemtablesOffHeapSizeGetDefault creates a ColumnFamilyMetricsAllMemtablesOffHeapSizeGetDefault with default headers values +func NewColumnFamilyMetricsAllMemtablesOffHeapSizeGetDefault(code int) *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetDefault { + return &ColumnFamilyMetricsAllMemtablesOffHeapSizeGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsAllMemtablesOffHeapSizeGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsAllMemtablesOffHeapSizeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics all memtables off heap size get default response +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_on_heap_size_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_on_heap_size_by_name_get_parameters.go new file mode 100644 index 0000000000..595c266efb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_on_heap_size_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams creates a new ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams() *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParamsWithContext creates a new ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics all memtables on heap size by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics all memtables on heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics all memtables on heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics all memtables on heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics all memtables on heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics all memtables on heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics all memtables on heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics all memtables on heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams) WithName(name string) *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics all memtables on heap size by name get params +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_on_heap_size_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_on_heap_size_by_name_get_responses.go new file mode 100644 index 0000000000..2fae364fd1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_on_heap_size_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetReader is a Reader for the ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGet structure. +type ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetOK creates a ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetOK with default headers values +func NewColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetOK() *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetOK { + return &ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetOK{} +} + +/* +ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetDefault creates a ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetDefault with default headers values +func NewColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetDefault(code int) *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetDefault { + return &ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics all memtables on heap size by name get default response +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_on_heap_size_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_on_heap_size_get_parameters.go new file mode 100644 index 0000000000..91ede151c6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_on_heap_size_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams creates a new ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams() *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams { + + return &ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsAllMemtablesOnHeapSizeGetParamsWithTimeout creates a new ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsAllMemtablesOnHeapSizeGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams { + + return &ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsAllMemtablesOnHeapSizeGetParamsWithContext creates a new ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsAllMemtablesOnHeapSizeGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams { + + return &ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsAllMemtablesOnHeapSizeGetParamsWithHTTPClient creates a new ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsAllMemtablesOnHeapSizeGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams { + + return &ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams contains all the parameters to send to the API endpoint +for the column family metrics all memtables on heap size get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics all memtables on heap size get params +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics all memtables on heap size get params +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics all memtables on heap size get params +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics all memtables on heap size get params +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics all memtables on heap size get params +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics all memtables on heap size get params +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_on_heap_size_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_on_heap_size_get_responses.go new file mode 100644 index 0000000000..3f66f17852 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_all_memtables_on_heap_size_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsAllMemtablesOnHeapSizeGetReader is a Reader for the ColumnFamilyMetricsAllMemtablesOnHeapSizeGet structure. +type ColumnFamilyMetricsAllMemtablesOnHeapSizeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsAllMemtablesOnHeapSizeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsAllMemtablesOnHeapSizeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsAllMemtablesOnHeapSizeGetOK creates a ColumnFamilyMetricsAllMemtablesOnHeapSizeGetOK with default headers values +func NewColumnFamilyMetricsAllMemtablesOnHeapSizeGetOK() *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetOK { + return &ColumnFamilyMetricsAllMemtablesOnHeapSizeGetOK{} +} + +/* +ColumnFamilyMetricsAllMemtablesOnHeapSizeGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsAllMemtablesOnHeapSizeGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsAllMemtablesOnHeapSizeGetDefault creates a ColumnFamilyMetricsAllMemtablesOnHeapSizeGetDefault with default headers values +func NewColumnFamilyMetricsAllMemtablesOnHeapSizeGetDefault(code int) *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetDefault { + return &ColumnFamilyMetricsAllMemtablesOnHeapSizeGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsAllMemtablesOnHeapSizeGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsAllMemtablesOnHeapSizeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics all memtables on heap size get default response +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_disk_space_used_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_disk_space_used_by_name_get_parameters.go new file mode 100644 index 0000000000..7d177dea27 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_disk_space_used_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams creates a new ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams() *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParamsWithContext creates a new ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics bloom filter disk space used by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics bloom filter disk space used by name get params +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics bloom filter disk space used by name get params +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics bloom filter disk space used by name get params +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics bloom filter disk space used by name get params +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics bloom filter disk space used by name get params +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics bloom filter disk space used by name get params +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics bloom filter disk space used by name get params +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams) WithName(name string) *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics bloom filter disk space used by name get params +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_disk_space_used_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_disk_space_used_by_name_get_responses.go new file mode 100644 index 0000000000..4cdcff2dcf --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_disk_space_used_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetReader is a Reader for the ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGet structure. +type ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetOK creates a ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetOK with default headers values +func NewColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetOK() *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetOK { + return &ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetOK{} +} + +/* +ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetDefault creates a ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetDefault with default headers values +func NewColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetDefault(code int) *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetDefault { + return &ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics bloom filter disk space used by name get default response +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_disk_space_used_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_disk_space_used_get_parameters.go new file mode 100644 index 0000000000..144a0f0e22 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_disk_space_used_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams creates a new ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams() *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams { + + return &ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParamsWithTimeout creates a new ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams { + + return &ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParamsWithContext creates a new ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams { + + return &ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParamsWithHTTPClient creates a new ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams { + + return &ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams contains all the parameters to send to the API endpoint +for the column family metrics bloom filter disk space used get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics bloom filter disk space used get params +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics bloom filter disk space used get params +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics bloom filter disk space used get params +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics bloom filter disk space used get params +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics bloom filter disk space used get params +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics bloom filter disk space used get params +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_disk_space_used_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_disk_space_used_get_responses.go new file mode 100644 index 0000000000..92f9616d77 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_disk_space_used_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetReader is a Reader for the ColumnFamilyMetricsBloomFilterDiskSpaceUsedGet structure. +type ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsBloomFilterDiskSpaceUsedGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsBloomFilterDiskSpaceUsedGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsBloomFilterDiskSpaceUsedGetOK creates a ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetOK with default headers values +func NewColumnFamilyMetricsBloomFilterDiskSpaceUsedGetOK() *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetOK { + return &ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetOK{} +} + +/* +ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsBloomFilterDiskSpaceUsedGetDefault creates a ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetDefault with default headers values +func NewColumnFamilyMetricsBloomFilterDiskSpaceUsedGetDefault(code int) *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetDefault { + return &ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics bloom filter disk space used get default response +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_positives_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_positives_by_name_get_parameters.go new file mode 100644 index 0000000000..2c2ba78ee7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_positives_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams creates a new ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams() *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParamsWithContext creates a new ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics bloom filter false positives by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics bloom filter false positives by name get params +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics bloom filter false positives by name get params +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics bloom filter false positives by name get params +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics bloom filter false positives by name get params +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics bloom filter false positives by name get params +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics bloom filter false positives by name get params +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics bloom filter false positives by name get params +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams) WithName(name string) *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics bloom filter false positives by name get params +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_positives_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_positives_by_name_get_responses.go new file mode 100644 index 0000000000..8455a4400f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_positives_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetReader is a Reader for the ColumnFamilyMetricsBloomFilterFalsePositivesByNameGet structure. +type ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsBloomFilterFalsePositivesByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsBloomFilterFalsePositivesByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsBloomFilterFalsePositivesByNameGetOK creates a ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetOK with default headers values +func NewColumnFamilyMetricsBloomFilterFalsePositivesByNameGetOK() *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetOK { + return &ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetOK{} +} + +/* +ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsBloomFilterFalsePositivesByNameGetDefault creates a ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetDefault with default headers values +func NewColumnFamilyMetricsBloomFilterFalsePositivesByNameGetDefault(code int) *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetDefault { + return &ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics bloom filter false positives by name get default response +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_positives_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_positives_get_parameters.go new file mode 100644 index 0000000000..69b0f7e108 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_positives_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsBloomFilterFalsePositivesGetParams creates a new ColumnFamilyMetricsBloomFilterFalsePositivesGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsBloomFilterFalsePositivesGetParams() *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams { + + return &ColumnFamilyMetricsBloomFilterFalsePositivesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsBloomFilterFalsePositivesGetParamsWithTimeout creates a new ColumnFamilyMetricsBloomFilterFalsePositivesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsBloomFilterFalsePositivesGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams { + + return &ColumnFamilyMetricsBloomFilterFalsePositivesGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsBloomFilterFalsePositivesGetParamsWithContext creates a new ColumnFamilyMetricsBloomFilterFalsePositivesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsBloomFilterFalsePositivesGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams { + + return &ColumnFamilyMetricsBloomFilterFalsePositivesGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsBloomFilterFalsePositivesGetParamsWithHTTPClient creates a new ColumnFamilyMetricsBloomFilterFalsePositivesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsBloomFilterFalsePositivesGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams { + + return &ColumnFamilyMetricsBloomFilterFalsePositivesGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsBloomFilterFalsePositivesGetParams contains all the parameters to send to the API endpoint +for the column family metrics bloom filter false positives get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsBloomFilterFalsePositivesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics bloom filter false positives get params +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics bloom filter false positives get params +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics bloom filter false positives get params +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics bloom filter false positives get params +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics bloom filter false positives get params +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics bloom filter false positives get params +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_positives_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_positives_get_responses.go new file mode 100644 index 0000000000..5b7b3fa4d7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_positives_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsBloomFilterFalsePositivesGetReader is a Reader for the ColumnFamilyMetricsBloomFilterFalsePositivesGet structure. +type ColumnFamilyMetricsBloomFilterFalsePositivesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsBloomFilterFalsePositivesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsBloomFilterFalsePositivesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsBloomFilterFalsePositivesGetOK creates a ColumnFamilyMetricsBloomFilterFalsePositivesGetOK with default headers values +func NewColumnFamilyMetricsBloomFilterFalsePositivesGetOK() *ColumnFamilyMetricsBloomFilterFalsePositivesGetOK { + return &ColumnFamilyMetricsBloomFilterFalsePositivesGetOK{} +} + +/* +ColumnFamilyMetricsBloomFilterFalsePositivesGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsBloomFilterFalsePositivesGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsBloomFilterFalsePositivesGetDefault creates a ColumnFamilyMetricsBloomFilterFalsePositivesGetDefault with default headers values +func NewColumnFamilyMetricsBloomFilterFalsePositivesGetDefault(code int) *ColumnFamilyMetricsBloomFilterFalsePositivesGetDefault { + return &ColumnFamilyMetricsBloomFilterFalsePositivesGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsBloomFilterFalsePositivesGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsBloomFilterFalsePositivesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics bloom filter false positives get default response +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsBloomFilterFalsePositivesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_ratio_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_ratio_by_name_get_parameters.go new file mode 100644 index 0000000000..3a8e76dfb1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_ratio_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams creates a new ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams() *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsBloomFilterFalseRatioByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsBloomFilterFalseRatioByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsBloomFilterFalseRatioByNameGetParamsWithContext creates a new ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsBloomFilterFalseRatioByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsBloomFilterFalseRatioByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsBloomFilterFalseRatioByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics bloom filter false ratio by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams) WithName(name string) *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_ratio_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_ratio_by_name_get_responses.go new file mode 100644 index 0000000000..1adb05de9b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_ratio_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsBloomFilterFalseRatioByNameGetReader is a Reader for the ColumnFamilyMetricsBloomFilterFalseRatioByNameGet structure. +type ColumnFamilyMetricsBloomFilterFalseRatioByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsBloomFilterFalseRatioByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsBloomFilterFalseRatioByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsBloomFilterFalseRatioByNameGetOK creates a ColumnFamilyMetricsBloomFilterFalseRatioByNameGetOK with default headers values +func NewColumnFamilyMetricsBloomFilterFalseRatioByNameGetOK() *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetOK { + return &ColumnFamilyMetricsBloomFilterFalseRatioByNameGetOK{} +} + +/* +ColumnFamilyMetricsBloomFilterFalseRatioByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsBloomFilterFalseRatioByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsBloomFilterFalseRatioByNameGetDefault creates a ColumnFamilyMetricsBloomFilterFalseRatioByNameGetDefault with default headers values +func NewColumnFamilyMetricsBloomFilterFalseRatioByNameGetDefault(code int) *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetDefault { + return &ColumnFamilyMetricsBloomFilterFalseRatioByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsBloomFilterFalseRatioByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsBloomFilterFalseRatioByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics bloom filter false ratio by name get default response +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_ratio_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_ratio_get_parameters.go new file mode 100644 index 0000000000..a7b731cca4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_ratio_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsBloomFilterFalseRatioGetParams creates a new ColumnFamilyMetricsBloomFilterFalseRatioGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsBloomFilterFalseRatioGetParams() *ColumnFamilyMetricsBloomFilterFalseRatioGetParams { + + return &ColumnFamilyMetricsBloomFilterFalseRatioGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsBloomFilterFalseRatioGetParamsWithTimeout creates a new ColumnFamilyMetricsBloomFilterFalseRatioGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsBloomFilterFalseRatioGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterFalseRatioGetParams { + + return &ColumnFamilyMetricsBloomFilterFalseRatioGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsBloomFilterFalseRatioGetParamsWithContext creates a new ColumnFamilyMetricsBloomFilterFalseRatioGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsBloomFilterFalseRatioGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterFalseRatioGetParams { + + return &ColumnFamilyMetricsBloomFilterFalseRatioGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsBloomFilterFalseRatioGetParamsWithHTTPClient creates a new ColumnFamilyMetricsBloomFilterFalseRatioGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsBloomFilterFalseRatioGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterFalseRatioGetParams { + + return &ColumnFamilyMetricsBloomFilterFalseRatioGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsBloomFilterFalseRatioGetParams contains all the parameters to send to the API endpoint +for the column family metrics bloom filter false ratio get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsBloomFilterFalseRatioGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics bloom filter false ratio get params +func (o *ColumnFamilyMetricsBloomFilterFalseRatioGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterFalseRatioGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics bloom filter false ratio get params +func (o *ColumnFamilyMetricsBloomFilterFalseRatioGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics bloom filter false ratio get params +func (o *ColumnFamilyMetricsBloomFilterFalseRatioGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterFalseRatioGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics bloom filter false ratio get params +func (o *ColumnFamilyMetricsBloomFilterFalseRatioGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics bloom filter false ratio get params +func (o *ColumnFamilyMetricsBloomFilterFalseRatioGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterFalseRatioGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics bloom filter false ratio get params +func (o *ColumnFamilyMetricsBloomFilterFalseRatioGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsBloomFilterFalseRatioGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_ratio_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_ratio_get_responses.go new file mode 100644 index 0000000000..3e37e426e1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_false_ratio_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsBloomFilterFalseRatioGetReader is a Reader for the ColumnFamilyMetricsBloomFilterFalseRatioGet structure. +type ColumnFamilyMetricsBloomFilterFalseRatioGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsBloomFilterFalseRatioGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsBloomFilterFalseRatioGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsBloomFilterFalseRatioGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsBloomFilterFalseRatioGetOK creates a ColumnFamilyMetricsBloomFilterFalseRatioGetOK with default headers values +func NewColumnFamilyMetricsBloomFilterFalseRatioGetOK() *ColumnFamilyMetricsBloomFilterFalseRatioGetOK { + return &ColumnFamilyMetricsBloomFilterFalseRatioGetOK{} +} + +/* +ColumnFamilyMetricsBloomFilterFalseRatioGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsBloomFilterFalseRatioGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsBloomFilterFalseRatioGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterFalseRatioGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsBloomFilterFalseRatioGetDefault creates a ColumnFamilyMetricsBloomFilterFalseRatioGetDefault with default headers values +func NewColumnFamilyMetricsBloomFilterFalseRatioGetDefault(code int) *ColumnFamilyMetricsBloomFilterFalseRatioGetDefault { + return &ColumnFamilyMetricsBloomFilterFalseRatioGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsBloomFilterFalseRatioGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsBloomFilterFalseRatioGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics bloom filter false ratio get default response +func (o *ColumnFamilyMetricsBloomFilterFalseRatioGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsBloomFilterFalseRatioGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterFalseRatioGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsBloomFilterFalseRatioGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_off_heap_memory_used_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_off_heap_memory_used_by_name_get_parameters.go new file mode 100644 index 0000000000..fce05146f6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_off_heap_memory_used_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams creates a new ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams() *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParamsWithContext creates a new ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams { + var () + return &ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics bloom filter off heap memory used by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics bloom filter off heap memory used by name get params +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics bloom filter off heap memory used by name get params +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics bloom filter off heap memory used by name get params +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics bloom filter off heap memory used by name get params +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics bloom filter off heap memory used by name get params +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics bloom filter off heap memory used by name get params +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics bloom filter off heap memory used by name get params +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams) WithName(name string) *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics bloom filter off heap memory used by name get params +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_off_heap_memory_used_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_off_heap_memory_used_by_name_get_responses.go new file mode 100644 index 0000000000..42c63d73f0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_off_heap_memory_used_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetReader is a Reader for the ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGet structure. +type ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetOK creates a ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetOK with default headers values +func NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetOK() *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetOK { + return &ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetOK{} +} + +/* +ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetDefault creates a ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetDefault with default headers values +func NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetDefault(code int) *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetDefault { + return &ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics bloom filter off heap memory used by name get default response +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_off_heap_memory_used_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_off_heap_memory_used_get_parameters.go new file mode 100644 index 0000000000..3e8443ab8d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_off_heap_memory_used_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams creates a new ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams() *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams { + + return &ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParamsWithTimeout creates a new ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams { + + return &ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParamsWithContext creates a new ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams { + + return &ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParamsWithHTTPClient creates a new ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams { + + return &ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams contains all the parameters to send to the API endpoint +for the column family metrics bloom filter off heap memory used get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics bloom filter off heap memory used get params +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics bloom filter off heap memory used get params +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics bloom filter off heap memory used get params +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics bloom filter off heap memory used get params +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics bloom filter off heap memory used get params +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics bloom filter off heap memory used get params +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_off_heap_memory_used_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_off_heap_memory_used_get_responses.go new file mode 100644 index 0000000000..b3d499cdc8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_bloom_filter_off_heap_memory_used_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetReader is a Reader for the ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGet structure. +type ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetOK creates a ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetOK with default headers values +func NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetOK() *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetOK { + return &ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetOK{} +} + +/* +ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetDefault creates a ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetDefault with default headers values +func NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetDefault(code int) *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetDefault { + return &ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics bloom filter off heap memory used get default response +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_by_name_get_parameters.go new file mode 100644 index 0000000000..ff326b15e3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsCasCommitByNameGetParams creates a new ColumnFamilyMetricsCasCommitByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsCasCommitByNameGetParams() *ColumnFamilyMetricsCasCommitByNameGetParams { + var () + return &ColumnFamilyMetricsCasCommitByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsCasCommitByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsCasCommitByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsCasCommitByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasCommitByNameGetParams { + var () + return &ColumnFamilyMetricsCasCommitByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsCasCommitByNameGetParamsWithContext creates a new ColumnFamilyMetricsCasCommitByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsCasCommitByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsCasCommitByNameGetParams { + var () + return &ColumnFamilyMetricsCasCommitByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsCasCommitByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsCasCommitByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsCasCommitByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasCommitByNameGetParams { + var () + return &ColumnFamilyMetricsCasCommitByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsCasCommitByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics cas commit by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsCasCommitByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics cas commit by name get params +func (o *ColumnFamilyMetricsCasCommitByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasCommitByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics cas commit by name get params +func (o *ColumnFamilyMetricsCasCommitByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics cas commit by name get params +func (o *ColumnFamilyMetricsCasCommitByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsCasCommitByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics cas commit by name get params +func (o *ColumnFamilyMetricsCasCommitByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics cas commit by name get params +func (o *ColumnFamilyMetricsCasCommitByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasCommitByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics cas commit by name get params +func (o *ColumnFamilyMetricsCasCommitByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics cas commit by name get params +func (o *ColumnFamilyMetricsCasCommitByNameGetParams) WithName(name string) *ColumnFamilyMetricsCasCommitByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics cas commit by name get params +func (o *ColumnFamilyMetricsCasCommitByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsCasCommitByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_by_name_get_responses.go new file mode 100644 index 0000000000..06eb7c359e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsCasCommitByNameGetReader is a Reader for the ColumnFamilyMetricsCasCommitByNameGet structure. +type ColumnFamilyMetricsCasCommitByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsCasCommitByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsCasCommitByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsCasCommitByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsCasCommitByNameGetOK creates a ColumnFamilyMetricsCasCommitByNameGetOK with default headers values +func NewColumnFamilyMetricsCasCommitByNameGetOK() *ColumnFamilyMetricsCasCommitByNameGetOK { + return &ColumnFamilyMetricsCasCommitByNameGetOK{} +} + +/* +ColumnFamilyMetricsCasCommitByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsCasCommitByNameGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsCasCommitByNameGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsCasCommitByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsCasCommitByNameGetDefault creates a ColumnFamilyMetricsCasCommitByNameGetDefault with default headers values +func NewColumnFamilyMetricsCasCommitByNameGetDefault(code int) *ColumnFamilyMetricsCasCommitByNameGetDefault { + return &ColumnFamilyMetricsCasCommitByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsCasCommitByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsCasCommitByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics cas commit by name get default response +func (o *ColumnFamilyMetricsCasCommitByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsCasCommitByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsCasCommitByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsCasCommitByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_estimated_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_estimated_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..36477470d2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_estimated_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams creates a new ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams() *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics cas commit estimated histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics cas commit estimated histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics cas commit estimated histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics cas commit estimated histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics cas commit estimated histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics cas commit estimated histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics cas commit estimated histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics cas commit estimated histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics cas commit estimated histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_estimated_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_estimated_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..4642ec0077 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_estimated_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGet structure. +type ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetOK creates a ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetOK() *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetOK { + return &ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetDefault creates a ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetDefault(code int) *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetDefault { + return &ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics cas commit estimated histogram by name get default response +func (o *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_estimated_recent_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_estimated_recent_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..254da6bb05 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_estimated_recent_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams creates a new ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams() *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics cas commit estimated recent histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics cas commit estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics cas commit estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics cas commit estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics cas commit estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics cas commit estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics cas commit estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics cas commit estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics cas commit estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_estimated_recent_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_estimated_recent_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..cba510998c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_commit_estimated_recent_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGet structure. +type ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetOK creates a ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetOK() *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetOK { + return &ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetDefault creates a ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetDefault(code int) *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetDefault { + return &ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics cas commit estimated recent histogram by name get default response +func (o *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_by_name_get_parameters.go new file mode 100644 index 0000000000..5368d6bbcd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsCasPrepareByNameGetParams creates a new ColumnFamilyMetricsCasPrepareByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsCasPrepareByNameGetParams() *ColumnFamilyMetricsCasPrepareByNameGetParams { + var () + return &ColumnFamilyMetricsCasPrepareByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsCasPrepareByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsCasPrepareByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsCasPrepareByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasPrepareByNameGetParams { + var () + return &ColumnFamilyMetricsCasPrepareByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsCasPrepareByNameGetParamsWithContext creates a new ColumnFamilyMetricsCasPrepareByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsCasPrepareByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsCasPrepareByNameGetParams { + var () + return &ColumnFamilyMetricsCasPrepareByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsCasPrepareByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsCasPrepareByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsCasPrepareByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasPrepareByNameGetParams { + var () + return &ColumnFamilyMetricsCasPrepareByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsCasPrepareByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics cas prepare by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsCasPrepareByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics cas prepare by name get params +func (o *ColumnFamilyMetricsCasPrepareByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasPrepareByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics cas prepare by name get params +func (o *ColumnFamilyMetricsCasPrepareByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics cas prepare by name get params +func (o *ColumnFamilyMetricsCasPrepareByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsCasPrepareByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics cas prepare by name get params +func (o *ColumnFamilyMetricsCasPrepareByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics cas prepare by name get params +func (o *ColumnFamilyMetricsCasPrepareByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasPrepareByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics cas prepare by name get params +func (o *ColumnFamilyMetricsCasPrepareByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics cas prepare by name get params +func (o *ColumnFamilyMetricsCasPrepareByNameGetParams) WithName(name string) *ColumnFamilyMetricsCasPrepareByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics cas prepare by name get params +func (o *ColumnFamilyMetricsCasPrepareByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsCasPrepareByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_by_name_get_responses.go new file mode 100644 index 0000000000..e800ec2b2d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsCasPrepareByNameGetReader is a Reader for the ColumnFamilyMetricsCasPrepareByNameGet structure. +type ColumnFamilyMetricsCasPrepareByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsCasPrepareByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsCasPrepareByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsCasPrepareByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsCasPrepareByNameGetOK creates a ColumnFamilyMetricsCasPrepareByNameGetOK with default headers values +func NewColumnFamilyMetricsCasPrepareByNameGetOK() *ColumnFamilyMetricsCasPrepareByNameGetOK { + return &ColumnFamilyMetricsCasPrepareByNameGetOK{} +} + +/* +ColumnFamilyMetricsCasPrepareByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsCasPrepareByNameGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsCasPrepareByNameGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsCasPrepareByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsCasPrepareByNameGetDefault creates a ColumnFamilyMetricsCasPrepareByNameGetDefault with default headers values +func NewColumnFamilyMetricsCasPrepareByNameGetDefault(code int) *ColumnFamilyMetricsCasPrepareByNameGetDefault { + return &ColumnFamilyMetricsCasPrepareByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsCasPrepareByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsCasPrepareByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics cas prepare by name get default response +func (o *ColumnFamilyMetricsCasPrepareByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsCasPrepareByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsCasPrepareByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsCasPrepareByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_estimated_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_estimated_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..e380a38c9d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_estimated_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams creates a new ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams() *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics cas prepare estimated histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics cas prepare estimated histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics cas prepare estimated histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics cas prepare estimated histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics cas prepare estimated histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics cas prepare estimated histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics cas prepare estimated histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics cas prepare estimated histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics cas prepare estimated histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_estimated_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_estimated_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..d2b5723777 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_estimated_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGet structure. +type ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetOK creates a ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetOK() *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetOK { + return &ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetDefault creates a ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetDefault(code int) *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetDefault { + return &ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics cas prepare estimated histogram by name get default response +func (o *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_estimated_recent_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_estimated_recent_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..92c21842bd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_estimated_recent_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams creates a new ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams() *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics cas prepare estimated recent histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics cas prepare estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics cas prepare estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics cas prepare estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics cas prepare estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics cas prepare estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics cas prepare estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics cas prepare estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics cas prepare estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_estimated_recent_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_estimated_recent_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..4dadbc4a88 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_prepare_estimated_recent_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGet structure. +type ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetOK creates a ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetOK() *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetOK { + return &ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetDefault creates a ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetDefault(code int) *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetDefault { + return &ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics cas prepare estimated recent histogram by name get default response +func (o *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_by_name_get_parameters.go new file mode 100644 index 0000000000..43089a188e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsCasProposeByNameGetParams creates a new ColumnFamilyMetricsCasProposeByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsCasProposeByNameGetParams() *ColumnFamilyMetricsCasProposeByNameGetParams { + var () + return &ColumnFamilyMetricsCasProposeByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsCasProposeByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsCasProposeByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsCasProposeByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasProposeByNameGetParams { + var () + return &ColumnFamilyMetricsCasProposeByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsCasProposeByNameGetParamsWithContext creates a new ColumnFamilyMetricsCasProposeByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsCasProposeByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsCasProposeByNameGetParams { + var () + return &ColumnFamilyMetricsCasProposeByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsCasProposeByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsCasProposeByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsCasProposeByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasProposeByNameGetParams { + var () + return &ColumnFamilyMetricsCasProposeByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsCasProposeByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics cas propose by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsCasProposeByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics cas propose by name get params +func (o *ColumnFamilyMetricsCasProposeByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasProposeByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics cas propose by name get params +func (o *ColumnFamilyMetricsCasProposeByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics cas propose by name get params +func (o *ColumnFamilyMetricsCasProposeByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsCasProposeByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics cas propose by name get params +func (o *ColumnFamilyMetricsCasProposeByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics cas propose by name get params +func (o *ColumnFamilyMetricsCasProposeByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasProposeByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics cas propose by name get params +func (o *ColumnFamilyMetricsCasProposeByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics cas propose by name get params +func (o *ColumnFamilyMetricsCasProposeByNameGetParams) WithName(name string) *ColumnFamilyMetricsCasProposeByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics cas propose by name get params +func (o *ColumnFamilyMetricsCasProposeByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsCasProposeByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_by_name_get_responses.go new file mode 100644 index 0000000000..2bda59f953 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsCasProposeByNameGetReader is a Reader for the ColumnFamilyMetricsCasProposeByNameGet structure. +type ColumnFamilyMetricsCasProposeByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsCasProposeByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsCasProposeByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsCasProposeByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsCasProposeByNameGetOK creates a ColumnFamilyMetricsCasProposeByNameGetOK with default headers values +func NewColumnFamilyMetricsCasProposeByNameGetOK() *ColumnFamilyMetricsCasProposeByNameGetOK { + return &ColumnFamilyMetricsCasProposeByNameGetOK{} +} + +/* +ColumnFamilyMetricsCasProposeByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsCasProposeByNameGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsCasProposeByNameGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsCasProposeByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsCasProposeByNameGetDefault creates a ColumnFamilyMetricsCasProposeByNameGetDefault with default headers values +func NewColumnFamilyMetricsCasProposeByNameGetDefault(code int) *ColumnFamilyMetricsCasProposeByNameGetDefault { + return &ColumnFamilyMetricsCasProposeByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsCasProposeByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsCasProposeByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics cas propose by name get default response +func (o *ColumnFamilyMetricsCasProposeByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsCasProposeByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsCasProposeByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsCasProposeByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_estimated_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_estimated_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..209ff544d5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_estimated_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams creates a new ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams() *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics cas propose estimated histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics cas propose estimated histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics cas propose estimated histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics cas propose estimated histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics cas propose estimated histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics cas propose estimated histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics cas propose estimated histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics cas propose estimated histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics cas propose estimated histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_estimated_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_estimated_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..6bb389c027 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_estimated_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGet structure. +type ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetOK creates a ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetOK() *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetOK { + return &ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetDefault creates a ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetDefault(code int) *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetDefault { + return &ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics cas propose estimated histogram by name get default response +func (o *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_estimated_recent_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_estimated_recent_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..597c863305 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_estimated_recent_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams creates a new ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams() *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics cas propose estimated recent histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics cas propose estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics cas propose estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics cas propose estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics cas propose estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics cas propose estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics cas propose estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics cas propose estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics cas propose estimated recent histogram by name get params +func (o *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_estimated_recent_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_estimated_recent_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..bb34782a1b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_cas_propose_estimated_recent_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGet structure. +type ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetOK creates a ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetOK() *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetOK { + return &ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetDefault creates a ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetDefault(code int) *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetDefault { + return &ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics cas propose estimated recent histogram by name get default response +func (o *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_col_update_time_delta_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_col_update_time_delta_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..6fa3679f38 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_col_update_time_delta_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams creates a new ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams() *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics col update time delta histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics col update time delta histogram by name get params +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics col update time delta histogram by name get params +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics col update time delta histogram by name get params +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics col update time delta histogram by name get params +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics col update time delta histogram by name get params +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics col update time delta histogram by name get params +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics col update time delta histogram by name get params +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics col update time delta histogram by name get params +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_col_update_time_delta_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_col_update_time_delta_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..5a838461a9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_col_update_time_delta_histogram_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGet structure. +type ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetOK creates a ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetOK() *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetOK { + return &ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetDefault creates a ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetDefault(code int) *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetDefault { + return &ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics col update time delta histogram by name get default response +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_metadata_off_heap_memory_used_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_metadata_off_heap_memory_used_by_name_get_parameters.go new file mode 100644 index 0000000000..1ba6953c2c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_metadata_off_heap_memory_used_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams creates a new ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams() *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams { + var () + return &ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams { + var () + return &ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParamsWithContext creates a new ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams { + var () + return &ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams { + var () + return &ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics compression metadata off heap memory used by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics compression metadata off heap memory used by name get params +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics compression metadata off heap memory used by name get params +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics compression metadata off heap memory used by name get params +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics compression metadata off heap memory used by name get params +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics compression metadata off heap memory used by name get params +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics compression metadata off heap memory used by name get params +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics compression metadata off heap memory used by name get params +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams) WithName(name string) *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics compression metadata off heap memory used by name get params +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_metadata_off_heap_memory_used_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_metadata_off_heap_memory_used_by_name_get_responses.go new file mode 100644 index 0000000000..79bf1a5df4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_metadata_off_heap_memory_used_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetReader is a Reader for the ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGet structure. +type ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetOK creates a ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetOK with default headers values +func NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetOK() *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetOK { + return &ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetOK{} +} + +/* +ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetDefault creates a ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetDefault with default headers values +func NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetDefault(code int) *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetDefault { + return &ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics compression metadata off heap memory used by name get default response +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_metadata_off_heap_memory_used_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_metadata_off_heap_memory_used_get_parameters.go new file mode 100644 index 0000000000..9884751cc4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_metadata_off_heap_memory_used_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams creates a new ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams() *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams { + + return &ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParamsWithTimeout creates a new ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams { + + return &ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParamsWithContext creates a new ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams { + + return &ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParamsWithHTTPClient creates a new ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams { + + return &ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams contains all the parameters to send to the API endpoint +for the column family metrics compression metadata off heap memory used get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics compression metadata off heap memory used get params +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics compression metadata off heap memory used get params +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics compression metadata off heap memory used get params +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics compression metadata off heap memory used get params +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics compression metadata off heap memory used get params +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics compression metadata off heap memory used get params +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_metadata_off_heap_memory_used_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_metadata_off_heap_memory_used_get_responses.go new file mode 100644 index 0000000000..46919eb977 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_metadata_off_heap_memory_used_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetReader is a Reader for the ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGet structure. +type ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetOK creates a ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetOK with default headers values +func NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetOK() *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetOK { + return &ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetOK{} +} + +/* +ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetDefault creates a ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetDefault with default headers values +func NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetDefault(code int) *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetDefault { + return &ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics compression metadata off heap memory used get default response +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_ratio_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_ratio_by_name_get_parameters.go new file mode 100644 index 0000000000..3fb119bfac --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_ratio_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsCompressionRatioByNameGetParams creates a new ColumnFamilyMetricsCompressionRatioByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsCompressionRatioByNameGetParams() *ColumnFamilyMetricsCompressionRatioByNameGetParams { + var () + return &ColumnFamilyMetricsCompressionRatioByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsCompressionRatioByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsCompressionRatioByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsCompressionRatioByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsCompressionRatioByNameGetParams { + var () + return &ColumnFamilyMetricsCompressionRatioByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsCompressionRatioByNameGetParamsWithContext creates a new ColumnFamilyMetricsCompressionRatioByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsCompressionRatioByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsCompressionRatioByNameGetParams { + var () + return &ColumnFamilyMetricsCompressionRatioByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsCompressionRatioByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsCompressionRatioByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsCompressionRatioByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsCompressionRatioByNameGetParams { + var () + return &ColumnFamilyMetricsCompressionRatioByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsCompressionRatioByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics compression ratio by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsCompressionRatioByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics compression ratio by name get params +func (o *ColumnFamilyMetricsCompressionRatioByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsCompressionRatioByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics compression ratio by name get params +func (o *ColumnFamilyMetricsCompressionRatioByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics compression ratio by name get params +func (o *ColumnFamilyMetricsCompressionRatioByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsCompressionRatioByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics compression ratio by name get params +func (o *ColumnFamilyMetricsCompressionRatioByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics compression ratio by name get params +func (o *ColumnFamilyMetricsCompressionRatioByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsCompressionRatioByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics compression ratio by name get params +func (o *ColumnFamilyMetricsCompressionRatioByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics compression ratio by name get params +func (o *ColumnFamilyMetricsCompressionRatioByNameGetParams) WithName(name string) *ColumnFamilyMetricsCompressionRatioByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics compression ratio by name get params +func (o *ColumnFamilyMetricsCompressionRatioByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsCompressionRatioByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_ratio_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_ratio_by_name_get_responses.go new file mode 100644 index 0000000000..01fdb785af --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_ratio_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsCompressionRatioByNameGetReader is a Reader for the ColumnFamilyMetricsCompressionRatioByNameGet structure. +type ColumnFamilyMetricsCompressionRatioByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsCompressionRatioByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsCompressionRatioByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsCompressionRatioByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsCompressionRatioByNameGetOK creates a ColumnFamilyMetricsCompressionRatioByNameGetOK with default headers values +func NewColumnFamilyMetricsCompressionRatioByNameGetOK() *ColumnFamilyMetricsCompressionRatioByNameGetOK { + return &ColumnFamilyMetricsCompressionRatioByNameGetOK{} +} + +/* +ColumnFamilyMetricsCompressionRatioByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsCompressionRatioByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsCompressionRatioByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsCompressionRatioByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsCompressionRatioByNameGetDefault creates a ColumnFamilyMetricsCompressionRatioByNameGetDefault with default headers values +func NewColumnFamilyMetricsCompressionRatioByNameGetDefault(code int) *ColumnFamilyMetricsCompressionRatioByNameGetDefault { + return &ColumnFamilyMetricsCompressionRatioByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsCompressionRatioByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsCompressionRatioByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics compression ratio by name get default response +func (o *ColumnFamilyMetricsCompressionRatioByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsCompressionRatioByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsCompressionRatioByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsCompressionRatioByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_ratio_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_ratio_get_parameters.go new file mode 100644 index 0000000000..71d795d470 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_ratio_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsCompressionRatioGetParams creates a new ColumnFamilyMetricsCompressionRatioGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsCompressionRatioGetParams() *ColumnFamilyMetricsCompressionRatioGetParams { + + return &ColumnFamilyMetricsCompressionRatioGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsCompressionRatioGetParamsWithTimeout creates a new ColumnFamilyMetricsCompressionRatioGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsCompressionRatioGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsCompressionRatioGetParams { + + return &ColumnFamilyMetricsCompressionRatioGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsCompressionRatioGetParamsWithContext creates a new ColumnFamilyMetricsCompressionRatioGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsCompressionRatioGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsCompressionRatioGetParams { + + return &ColumnFamilyMetricsCompressionRatioGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsCompressionRatioGetParamsWithHTTPClient creates a new ColumnFamilyMetricsCompressionRatioGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsCompressionRatioGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsCompressionRatioGetParams { + + return &ColumnFamilyMetricsCompressionRatioGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsCompressionRatioGetParams contains all the parameters to send to the API endpoint +for the column family metrics compression ratio get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsCompressionRatioGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics compression ratio get params +func (o *ColumnFamilyMetricsCompressionRatioGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsCompressionRatioGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics compression ratio get params +func (o *ColumnFamilyMetricsCompressionRatioGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics compression ratio get params +func (o *ColumnFamilyMetricsCompressionRatioGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsCompressionRatioGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics compression ratio get params +func (o *ColumnFamilyMetricsCompressionRatioGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics compression ratio get params +func (o *ColumnFamilyMetricsCompressionRatioGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsCompressionRatioGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics compression ratio get params +func (o *ColumnFamilyMetricsCompressionRatioGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsCompressionRatioGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_ratio_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_ratio_get_responses.go new file mode 100644 index 0000000000..0e5ad187fa --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_compression_ratio_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsCompressionRatioGetReader is a Reader for the ColumnFamilyMetricsCompressionRatioGet structure. +type ColumnFamilyMetricsCompressionRatioGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsCompressionRatioGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsCompressionRatioGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsCompressionRatioGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsCompressionRatioGetOK creates a ColumnFamilyMetricsCompressionRatioGetOK with default headers values +func NewColumnFamilyMetricsCompressionRatioGetOK() *ColumnFamilyMetricsCompressionRatioGetOK { + return &ColumnFamilyMetricsCompressionRatioGetOK{} +} + +/* +ColumnFamilyMetricsCompressionRatioGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsCompressionRatioGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsCompressionRatioGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsCompressionRatioGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsCompressionRatioGetDefault creates a ColumnFamilyMetricsCompressionRatioGetDefault with default headers values +func NewColumnFamilyMetricsCompressionRatioGetDefault(code int) *ColumnFamilyMetricsCompressionRatioGetDefault { + return &ColumnFamilyMetricsCompressionRatioGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsCompressionRatioGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsCompressionRatioGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics compression ratio get default response +func (o *ColumnFamilyMetricsCompressionRatioGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsCompressionRatioGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsCompressionRatioGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsCompressionRatioGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_coordinator_read_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_coordinator_read_get_parameters.go new file mode 100644 index 0000000000..86cd0af335 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_coordinator_read_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsCoordinatorReadGetParams creates a new ColumnFamilyMetricsCoordinatorReadGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsCoordinatorReadGetParams() *ColumnFamilyMetricsCoordinatorReadGetParams { + + return &ColumnFamilyMetricsCoordinatorReadGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsCoordinatorReadGetParamsWithTimeout creates a new ColumnFamilyMetricsCoordinatorReadGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsCoordinatorReadGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsCoordinatorReadGetParams { + + return &ColumnFamilyMetricsCoordinatorReadGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsCoordinatorReadGetParamsWithContext creates a new ColumnFamilyMetricsCoordinatorReadGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsCoordinatorReadGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsCoordinatorReadGetParams { + + return &ColumnFamilyMetricsCoordinatorReadGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsCoordinatorReadGetParamsWithHTTPClient creates a new ColumnFamilyMetricsCoordinatorReadGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsCoordinatorReadGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsCoordinatorReadGetParams { + + return &ColumnFamilyMetricsCoordinatorReadGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsCoordinatorReadGetParams contains all the parameters to send to the API endpoint +for the column family metrics coordinator read get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsCoordinatorReadGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics coordinator read get params +func (o *ColumnFamilyMetricsCoordinatorReadGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsCoordinatorReadGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics coordinator read get params +func (o *ColumnFamilyMetricsCoordinatorReadGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics coordinator read get params +func (o *ColumnFamilyMetricsCoordinatorReadGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsCoordinatorReadGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics coordinator read get params +func (o *ColumnFamilyMetricsCoordinatorReadGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics coordinator read get params +func (o *ColumnFamilyMetricsCoordinatorReadGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsCoordinatorReadGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics coordinator read get params +func (o *ColumnFamilyMetricsCoordinatorReadGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsCoordinatorReadGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_coordinator_read_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_coordinator_read_get_responses.go new file mode 100644 index 0000000000..58e4938fae --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_coordinator_read_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsCoordinatorReadGetReader is a Reader for the ColumnFamilyMetricsCoordinatorReadGet structure. +type ColumnFamilyMetricsCoordinatorReadGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsCoordinatorReadGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsCoordinatorReadGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsCoordinatorReadGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsCoordinatorReadGetOK creates a ColumnFamilyMetricsCoordinatorReadGetOK with default headers values +func NewColumnFamilyMetricsCoordinatorReadGetOK() *ColumnFamilyMetricsCoordinatorReadGetOK { + return &ColumnFamilyMetricsCoordinatorReadGetOK{} +} + +/* +ColumnFamilyMetricsCoordinatorReadGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsCoordinatorReadGetOK struct { +} + +func (o *ColumnFamilyMetricsCoordinatorReadGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsCoordinatorReadGetDefault creates a ColumnFamilyMetricsCoordinatorReadGetDefault with default headers values +func NewColumnFamilyMetricsCoordinatorReadGetDefault(code int) *ColumnFamilyMetricsCoordinatorReadGetDefault { + return &ColumnFamilyMetricsCoordinatorReadGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsCoordinatorReadGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsCoordinatorReadGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics coordinator read get default response +func (o *ColumnFamilyMetricsCoordinatorReadGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsCoordinatorReadGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsCoordinatorReadGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsCoordinatorReadGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_coordinator_scan_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_coordinator_scan_get_parameters.go new file mode 100644 index 0000000000..0bc8e9ffa9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_coordinator_scan_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsCoordinatorScanGetParams creates a new ColumnFamilyMetricsCoordinatorScanGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsCoordinatorScanGetParams() *ColumnFamilyMetricsCoordinatorScanGetParams { + + return &ColumnFamilyMetricsCoordinatorScanGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsCoordinatorScanGetParamsWithTimeout creates a new ColumnFamilyMetricsCoordinatorScanGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsCoordinatorScanGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsCoordinatorScanGetParams { + + return &ColumnFamilyMetricsCoordinatorScanGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsCoordinatorScanGetParamsWithContext creates a new ColumnFamilyMetricsCoordinatorScanGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsCoordinatorScanGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsCoordinatorScanGetParams { + + return &ColumnFamilyMetricsCoordinatorScanGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsCoordinatorScanGetParamsWithHTTPClient creates a new ColumnFamilyMetricsCoordinatorScanGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsCoordinatorScanGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsCoordinatorScanGetParams { + + return &ColumnFamilyMetricsCoordinatorScanGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsCoordinatorScanGetParams contains all the parameters to send to the API endpoint +for the column family metrics coordinator scan get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsCoordinatorScanGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics coordinator scan get params +func (o *ColumnFamilyMetricsCoordinatorScanGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsCoordinatorScanGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics coordinator scan get params +func (o *ColumnFamilyMetricsCoordinatorScanGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics coordinator scan get params +func (o *ColumnFamilyMetricsCoordinatorScanGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsCoordinatorScanGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics coordinator scan get params +func (o *ColumnFamilyMetricsCoordinatorScanGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics coordinator scan get params +func (o *ColumnFamilyMetricsCoordinatorScanGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsCoordinatorScanGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics coordinator scan get params +func (o *ColumnFamilyMetricsCoordinatorScanGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsCoordinatorScanGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_coordinator_scan_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_coordinator_scan_get_responses.go new file mode 100644 index 0000000000..07364e8868 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_coordinator_scan_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsCoordinatorScanGetReader is a Reader for the ColumnFamilyMetricsCoordinatorScanGet structure. +type ColumnFamilyMetricsCoordinatorScanGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsCoordinatorScanGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsCoordinatorScanGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsCoordinatorScanGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsCoordinatorScanGetOK creates a ColumnFamilyMetricsCoordinatorScanGetOK with default headers values +func NewColumnFamilyMetricsCoordinatorScanGetOK() *ColumnFamilyMetricsCoordinatorScanGetOK { + return &ColumnFamilyMetricsCoordinatorScanGetOK{} +} + +/* +ColumnFamilyMetricsCoordinatorScanGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsCoordinatorScanGetOK struct { +} + +func (o *ColumnFamilyMetricsCoordinatorScanGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsCoordinatorScanGetDefault creates a ColumnFamilyMetricsCoordinatorScanGetDefault with default headers values +func NewColumnFamilyMetricsCoordinatorScanGetDefault(code int) *ColumnFamilyMetricsCoordinatorScanGetDefault { + return &ColumnFamilyMetricsCoordinatorScanGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsCoordinatorScanGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsCoordinatorScanGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics coordinator scan get default response +func (o *ColumnFamilyMetricsCoordinatorScanGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsCoordinatorScanGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsCoordinatorScanGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsCoordinatorScanGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_column_count_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_column_count_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..cfcd146ce0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_column_count_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams creates a new ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams() *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics estimated column count histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics estimated column count histogram by name get params +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics estimated column count histogram by name get params +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics estimated column count histogram by name get params +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics estimated column count histogram by name get params +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics estimated column count histogram by name get params +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics estimated column count histogram by name get params +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics estimated column count histogram by name get params +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics estimated column count histogram by name get params +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_column_count_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_column_count_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..05c2ece2fb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_column_count_histogram_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGet structure. +type ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetOK creates a ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetOK() *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetOK { + return &ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetDefault creates a ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetDefault(code int) *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetDefault { + return &ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics estimated column count histogram by name get default response +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_row_count_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_row_count_by_name_get_parameters.go new file mode 100644 index 0000000000..2c11f032ce --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_row_count_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsEstimatedRowCountByNameGetParams creates a new ColumnFamilyMetricsEstimatedRowCountByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsEstimatedRowCountByNameGetParams() *ColumnFamilyMetricsEstimatedRowCountByNameGetParams { + var () + return &ColumnFamilyMetricsEstimatedRowCountByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsEstimatedRowCountByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsEstimatedRowCountByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsEstimatedRowCountByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsEstimatedRowCountByNameGetParams { + var () + return &ColumnFamilyMetricsEstimatedRowCountByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsEstimatedRowCountByNameGetParamsWithContext creates a new ColumnFamilyMetricsEstimatedRowCountByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsEstimatedRowCountByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsEstimatedRowCountByNameGetParams { + var () + return &ColumnFamilyMetricsEstimatedRowCountByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsEstimatedRowCountByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsEstimatedRowCountByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsEstimatedRowCountByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsEstimatedRowCountByNameGetParams { + var () + return &ColumnFamilyMetricsEstimatedRowCountByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsEstimatedRowCountByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics estimated row count by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsEstimatedRowCountByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics estimated row count by name get params +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsEstimatedRowCountByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics estimated row count by name get params +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics estimated row count by name get params +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsEstimatedRowCountByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics estimated row count by name get params +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics estimated row count by name get params +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsEstimatedRowCountByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics estimated row count by name get params +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics estimated row count by name get params +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetParams) WithName(name string) *ColumnFamilyMetricsEstimatedRowCountByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics estimated row count by name get params +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_row_count_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_row_count_by_name_get_responses.go new file mode 100644 index 0000000000..3d05806272 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_row_count_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsEstimatedRowCountByNameGetReader is a Reader for the ColumnFamilyMetricsEstimatedRowCountByNameGet structure. +type ColumnFamilyMetricsEstimatedRowCountByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsEstimatedRowCountByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsEstimatedRowCountByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsEstimatedRowCountByNameGetOK creates a ColumnFamilyMetricsEstimatedRowCountByNameGetOK with default headers values +func NewColumnFamilyMetricsEstimatedRowCountByNameGetOK() *ColumnFamilyMetricsEstimatedRowCountByNameGetOK { + return &ColumnFamilyMetricsEstimatedRowCountByNameGetOK{} +} + +/* +ColumnFamilyMetricsEstimatedRowCountByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsEstimatedRowCountByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsEstimatedRowCountByNameGetDefault creates a ColumnFamilyMetricsEstimatedRowCountByNameGetDefault with default headers values +func NewColumnFamilyMetricsEstimatedRowCountByNameGetDefault(code int) *ColumnFamilyMetricsEstimatedRowCountByNameGetDefault { + return &ColumnFamilyMetricsEstimatedRowCountByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsEstimatedRowCountByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsEstimatedRowCountByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics estimated row count by name get default response +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsEstimatedRowCountByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_row_size_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_row_size_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..8205076305 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_row_size_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams creates a new ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams() *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics estimated row size histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics estimated row size histogram by name get params +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics estimated row size histogram by name get params +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics estimated row size histogram by name get params +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics estimated row size histogram by name get params +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics estimated row size histogram by name get params +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics estimated row size histogram by name get params +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics estimated row size histogram by name get params +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics estimated row size histogram by name get params +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_row_size_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_row_size_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..7694c1b9c5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_estimated_row_size_histogram_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGet structure. +type ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetOK creates a ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetOK() *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetOK { + return &ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetDefault creates a ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetDefault(code int) *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetDefault { + return &ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics estimated row size histogram by name get default response +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_index_summary_off_heap_memory_used_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_index_summary_off_heap_memory_used_by_name_get_parameters.go new file mode 100644 index 0000000000..fb62ee33cd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_index_summary_off_heap_memory_used_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams creates a new ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams() *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams { + var () + return &ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams { + var () + return &ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParamsWithContext creates a new ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams { + var () + return &ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams { + var () + return &ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics index summary off heap memory used by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics index summary off heap memory used by name get params +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics index summary off heap memory used by name get params +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics index summary off heap memory used by name get params +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics index summary off heap memory used by name get params +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics index summary off heap memory used by name get params +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics index summary off heap memory used by name get params +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics index summary off heap memory used by name get params +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams) WithName(name string) *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics index summary off heap memory used by name get params +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_index_summary_off_heap_memory_used_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_index_summary_off_heap_memory_used_by_name_get_responses.go new file mode 100644 index 0000000000..16ac36e594 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_index_summary_off_heap_memory_used_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetReader is a Reader for the ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGet structure. +type ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetOK creates a ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetOK with default headers values +func NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetOK() *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetOK { + return &ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetOK{} +} + +/* +ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetDefault creates a ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetDefault with default headers values +func NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetDefault(code int) *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetDefault { + return &ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics index summary off heap memory used by name get default response +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_index_summary_off_heap_memory_used_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_index_summary_off_heap_memory_used_get_parameters.go new file mode 100644 index 0000000000..d0ac967d42 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_index_summary_off_heap_memory_used_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams creates a new ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams() *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams { + + return &ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParamsWithTimeout creates a new ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams { + + return &ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParamsWithContext creates a new ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams { + + return &ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParamsWithHTTPClient creates a new ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams { + + return &ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams contains all the parameters to send to the API endpoint +for the column family metrics index summary off heap memory used get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics index summary off heap memory used get params +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics index summary off heap memory used get params +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics index summary off heap memory used get params +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics index summary off heap memory used get params +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics index summary off heap memory used get params +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics index summary off heap memory used get params +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_index_summary_off_heap_memory_used_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_index_summary_off_heap_memory_used_get_responses.go new file mode 100644 index 0000000000..536f246e9b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_index_summary_off_heap_memory_used_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetReader is a Reader for the ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGet structure. +type ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetOK creates a ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetOK with default headers values +func NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetOK() *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetOK { + return &ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetOK{} +} + +/* +ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetDefault creates a ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetDefault with default headers values +func NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetDefault(code int) *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetDefault { + return &ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics index summary off heap memory used get default response +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_key_cache_hit_rate_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_key_cache_hit_rate_by_name_get_parameters.go new file mode 100644 index 0000000000..3b77a90cf2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_key_cache_hit_rate_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsKeyCacheHitRateByNameGetParams creates a new ColumnFamilyMetricsKeyCacheHitRateByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsKeyCacheHitRateByNameGetParams() *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams { + var () + return &ColumnFamilyMetricsKeyCacheHitRateByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsKeyCacheHitRateByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsKeyCacheHitRateByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsKeyCacheHitRateByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams { + var () + return &ColumnFamilyMetricsKeyCacheHitRateByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsKeyCacheHitRateByNameGetParamsWithContext creates a new ColumnFamilyMetricsKeyCacheHitRateByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsKeyCacheHitRateByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams { + var () + return &ColumnFamilyMetricsKeyCacheHitRateByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsKeyCacheHitRateByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsKeyCacheHitRateByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsKeyCacheHitRateByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams { + var () + return &ColumnFamilyMetricsKeyCacheHitRateByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsKeyCacheHitRateByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics key cache hit rate by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsKeyCacheHitRateByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics key cache hit rate by name get params +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics key cache hit rate by name get params +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics key cache hit rate by name get params +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics key cache hit rate by name get params +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics key cache hit rate by name get params +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics key cache hit rate by name get params +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics key cache hit rate by name get params +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams) WithName(name string) *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics key cache hit rate by name get params +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_key_cache_hit_rate_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_key_cache_hit_rate_by_name_get_responses.go new file mode 100644 index 0000000000..28b38764c7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_key_cache_hit_rate_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsKeyCacheHitRateByNameGetReader is a Reader for the ColumnFamilyMetricsKeyCacheHitRateByNameGet structure. +type ColumnFamilyMetricsKeyCacheHitRateByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsKeyCacheHitRateByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsKeyCacheHitRateByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsKeyCacheHitRateByNameGetOK creates a ColumnFamilyMetricsKeyCacheHitRateByNameGetOK with default headers values +func NewColumnFamilyMetricsKeyCacheHitRateByNameGetOK() *ColumnFamilyMetricsKeyCacheHitRateByNameGetOK { + return &ColumnFamilyMetricsKeyCacheHitRateByNameGetOK{} +} + +/* +ColumnFamilyMetricsKeyCacheHitRateByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsKeyCacheHitRateByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsKeyCacheHitRateByNameGetDefault creates a ColumnFamilyMetricsKeyCacheHitRateByNameGetDefault with default headers values +func NewColumnFamilyMetricsKeyCacheHitRateByNameGetDefault(code int) *ColumnFamilyMetricsKeyCacheHitRateByNameGetDefault { + return &ColumnFamilyMetricsKeyCacheHitRateByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsKeyCacheHitRateByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsKeyCacheHitRateByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics key cache hit rate by name get default response +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsKeyCacheHitRateByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_disk_space_used_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_disk_space_used_by_name_get_parameters.go new file mode 100644 index 0000000000..db9f30cfec --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_disk_space_used_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams creates a new ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams() *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams { + var () + return &ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams { + var () + return &ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParamsWithContext creates a new ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams { + var () + return &ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams { + var () + return &ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics live disk space used by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics live disk space used by name get params +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics live disk space used by name get params +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics live disk space used by name get params +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics live disk space used by name get params +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics live disk space used by name get params +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics live disk space used by name get params +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics live disk space used by name get params +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams) WithName(name string) *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics live disk space used by name get params +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_disk_space_used_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_disk_space_used_by_name_get_responses.go new file mode 100644 index 0000000000..25c76bd803 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_disk_space_used_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetReader is a Reader for the ColumnFamilyMetricsLiveDiskSpaceUsedByNameGet structure. +type ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsLiveDiskSpaceUsedByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsLiveDiskSpaceUsedByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsLiveDiskSpaceUsedByNameGetOK creates a ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetOK with default headers values +func NewColumnFamilyMetricsLiveDiskSpaceUsedByNameGetOK() *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetOK { + return &ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetOK{} +} + +/* +ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsLiveDiskSpaceUsedByNameGetDefault creates a ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetDefault with default headers values +func NewColumnFamilyMetricsLiveDiskSpaceUsedByNameGetDefault(code int) *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetDefault { + return &ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics live disk space used by name get default response +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_disk_space_used_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_disk_space_used_get_parameters.go new file mode 100644 index 0000000000..199242bb11 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_disk_space_used_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsLiveDiskSpaceUsedGetParams creates a new ColumnFamilyMetricsLiveDiskSpaceUsedGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsLiveDiskSpaceUsedGetParams() *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams { + + return &ColumnFamilyMetricsLiveDiskSpaceUsedGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsLiveDiskSpaceUsedGetParamsWithTimeout creates a new ColumnFamilyMetricsLiveDiskSpaceUsedGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsLiveDiskSpaceUsedGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams { + + return &ColumnFamilyMetricsLiveDiskSpaceUsedGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsLiveDiskSpaceUsedGetParamsWithContext creates a new ColumnFamilyMetricsLiveDiskSpaceUsedGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsLiveDiskSpaceUsedGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams { + + return &ColumnFamilyMetricsLiveDiskSpaceUsedGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsLiveDiskSpaceUsedGetParamsWithHTTPClient creates a new ColumnFamilyMetricsLiveDiskSpaceUsedGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsLiveDiskSpaceUsedGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams { + + return &ColumnFamilyMetricsLiveDiskSpaceUsedGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsLiveDiskSpaceUsedGetParams contains all the parameters to send to the API endpoint +for the column family metrics live disk space used get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsLiveDiskSpaceUsedGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics live disk space used get params +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics live disk space used get params +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics live disk space used get params +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics live disk space used get params +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics live disk space used get params +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics live disk space used get params +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_disk_space_used_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_disk_space_used_get_responses.go new file mode 100644 index 0000000000..e85d8d4f3f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_disk_space_used_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsLiveDiskSpaceUsedGetReader is a Reader for the ColumnFamilyMetricsLiveDiskSpaceUsedGet structure. +type ColumnFamilyMetricsLiveDiskSpaceUsedGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsLiveDiskSpaceUsedGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsLiveDiskSpaceUsedGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsLiveDiskSpaceUsedGetOK creates a ColumnFamilyMetricsLiveDiskSpaceUsedGetOK with default headers values +func NewColumnFamilyMetricsLiveDiskSpaceUsedGetOK() *ColumnFamilyMetricsLiveDiskSpaceUsedGetOK { + return &ColumnFamilyMetricsLiveDiskSpaceUsedGetOK{} +} + +/* +ColumnFamilyMetricsLiveDiskSpaceUsedGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsLiveDiskSpaceUsedGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsLiveDiskSpaceUsedGetDefault creates a ColumnFamilyMetricsLiveDiskSpaceUsedGetDefault with default headers values +func NewColumnFamilyMetricsLiveDiskSpaceUsedGetDefault(code int) *ColumnFamilyMetricsLiveDiskSpaceUsedGetDefault { + return &ColumnFamilyMetricsLiveDiskSpaceUsedGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsLiveDiskSpaceUsedGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsLiveDiskSpaceUsedGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics live disk space used get default response +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsLiveDiskSpaceUsedGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_scanned_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_scanned_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..443b6716c5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_scanned_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsLiveScannedHistogramByNameGetParams creates a new ColumnFamilyMetricsLiveScannedHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsLiveScannedHistogramByNameGetParams() *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsLiveScannedHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsLiveScannedHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsLiveScannedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsLiveScannedHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsLiveScannedHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsLiveScannedHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsLiveScannedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsLiveScannedHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsLiveScannedHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsLiveScannedHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsLiveScannedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsLiveScannedHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsLiveScannedHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsLiveScannedHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics live scanned histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsLiveScannedHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics live scanned histogram by name get params +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics live scanned histogram by name get params +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics live scanned histogram by name get params +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics live scanned histogram by name get params +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics live scanned histogram by name get params +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics live scanned histogram by name get params +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics live scanned histogram by name get params +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics live scanned histogram by name get params +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_scanned_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_scanned_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..f7a513fdb4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_scanned_histogram_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsLiveScannedHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsLiveScannedHistogramByNameGet structure. +type ColumnFamilyMetricsLiveScannedHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsLiveScannedHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsLiveScannedHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsLiveScannedHistogramByNameGetOK creates a ColumnFamilyMetricsLiveScannedHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsLiveScannedHistogramByNameGetOK() *ColumnFamilyMetricsLiveScannedHistogramByNameGetOK { + return &ColumnFamilyMetricsLiveScannedHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsLiveScannedHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsLiveScannedHistogramByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsLiveScannedHistogramByNameGetDefault creates a ColumnFamilyMetricsLiveScannedHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsLiveScannedHistogramByNameGetDefault(code int) *ColumnFamilyMetricsLiveScannedHistogramByNameGetDefault { + return &ColumnFamilyMetricsLiveScannedHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsLiveScannedHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsLiveScannedHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics live scanned histogram by name get default response +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsLiveScannedHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_ss_table_count_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_ss_table_count_by_name_get_parameters.go new file mode 100644 index 0000000000..4774b8dbcb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_ss_table_count_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsLiveSsTableCountByNameGetParams creates a new ColumnFamilyMetricsLiveSsTableCountByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsLiveSsTableCountByNameGetParams() *ColumnFamilyMetricsLiveSsTableCountByNameGetParams { + var () + return &ColumnFamilyMetricsLiveSsTableCountByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsLiveSsTableCountByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsLiveSsTableCountByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsLiveSsTableCountByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsLiveSsTableCountByNameGetParams { + var () + return &ColumnFamilyMetricsLiveSsTableCountByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsLiveSsTableCountByNameGetParamsWithContext creates a new ColumnFamilyMetricsLiveSsTableCountByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsLiveSsTableCountByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsLiveSsTableCountByNameGetParams { + var () + return &ColumnFamilyMetricsLiveSsTableCountByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsLiveSsTableCountByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsLiveSsTableCountByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsLiveSsTableCountByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsLiveSsTableCountByNameGetParams { + var () + return &ColumnFamilyMetricsLiveSsTableCountByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsLiveSsTableCountByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics live ss table count by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsLiveSsTableCountByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics live ss table count by name get params +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsLiveSsTableCountByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics live ss table count by name get params +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics live ss table count by name get params +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsLiveSsTableCountByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics live ss table count by name get params +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics live ss table count by name get params +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsLiveSsTableCountByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics live ss table count by name get params +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics live ss table count by name get params +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetParams) WithName(name string) *ColumnFamilyMetricsLiveSsTableCountByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics live ss table count by name get params +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_ss_table_count_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_ss_table_count_by_name_get_responses.go new file mode 100644 index 0000000000..dc17456df2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_ss_table_count_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsLiveSsTableCountByNameGetReader is a Reader for the ColumnFamilyMetricsLiveSsTableCountByNameGet structure. +type ColumnFamilyMetricsLiveSsTableCountByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsLiveSsTableCountByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsLiveSsTableCountByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsLiveSsTableCountByNameGetOK creates a ColumnFamilyMetricsLiveSsTableCountByNameGetOK with default headers values +func NewColumnFamilyMetricsLiveSsTableCountByNameGetOK() *ColumnFamilyMetricsLiveSsTableCountByNameGetOK { + return &ColumnFamilyMetricsLiveSsTableCountByNameGetOK{} +} + +/* +ColumnFamilyMetricsLiveSsTableCountByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsLiveSsTableCountByNameGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsLiveSsTableCountByNameGetDefault creates a ColumnFamilyMetricsLiveSsTableCountByNameGetDefault with default headers values +func NewColumnFamilyMetricsLiveSsTableCountByNameGetDefault(code int) *ColumnFamilyMetricsLiveSsTableCountByNameGetDefault { + return &ColumnFamilyMetricsLiveSsTableCountByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsLiveSsTableCountByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsLiveSsTableCountByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics live ss table count by name get default response +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsLiveSsTableCountByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_ss_table_count_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_ss_table_count_get_parameters.go new file mode 100644 index 0000000000..7639bf3610 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_ss_table_count_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsLiveSsTableCountGetParams creates a new ColumnFamilyMetricsLiveSsTableCountGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsLiveSsTableCountGetParams() *ColumnFamilyMetricsLiveSsTableCountGetParams { + + return &ColumnFamilyMetricsLiveSsTableCountGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsLiveSsTableCountGetParamsWithTimeout creates a new ColumnFamilyMetricsLiveSsTableCountGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsLiveSsTableCountGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsLiveSsTableCountGetParams { + + return &ColumnFamilyMetricsLiveSsTableCountGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsLiveSsTableCountGetParamsWithContext creates a new ColumnFamilyMetricsLiveSsTableCountGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsLiveSsTableCountGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsLiveSsTableCountGetParams { + + return &ColumnFamilyMetricsLiveSsTableCountGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsLiveSsTableCountGetParamsWithHTTPClient creates a new ColumnFamilyMetricsLiveSsTableCountGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsLiveSsTableCountGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsLiveSsTableCountGetParams { + + return &ColumnFamilyMetricsLiveSsTableCountGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsLiveSsTableCountGetParams contains all the parameters to send to the API endpoint +for the column family metrics live ss table count get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsLiveSsTableCountGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics live ss table count get params +func (o *ColumnFamilyMetricsLiveSsTableCountGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsLiveSsTableCountGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics live ss table count get params +func (o *ColumnFamilyMetricsLiveSsTableCountGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics live ss table count get params +func (o *ColumnFamilyMetricsLiveSsTableCountGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsLiveSsTableCountGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics live ss table count get params +func (o *ColumnFamilyMetricsLiveSsTableCountGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics live ss table count get params +func (o *ColumnFamilyMetricsLiveSsTableCountGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsLiveSsTableCountGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics live ss table count get params +func (o *ColumnFamilyMetricsLiveSsTableCountGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsLiveSsTableCountGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_ss_table_count_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_ss_table_count_get_responses.go new file mode 100644 index 0000000000..213d0d305e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_live_ss_table_count_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsLiveSsTableCountGetReader is a Reader for the ColumnFamilyMetricsLiveSsTableCountGet structure. +type ColumnFamilyMetricsLiveSsTableCountGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsLiveSsTableCountGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsLiveSsTableCountGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsLiveSsTableCountGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsLiveSsTableCountGetOK creates a ColumnFamilyMetricsLiveSsTableCountGetOK with default headers values +func NewColumnFamilyMetricsLiveSsTableCountGetOK() *ColumnFamilyMetricsLiveSsTableCountGetOK { + return &ColumnFamilyMetricsLiveSsTableCountGetOK{} +} + +/* +ColumnFamilyMetricsLiveSsTableCountGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsLiveSsTableCountGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsLiveSsTableCountGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsLiveSsTableCountGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsLiveSsTableCountGetDefault creates a ColumnFamilyMetricsLiveSsTableCountGetDefault with default headers values +func NewColumnFamilyMetricsLiveSsTableCountGetDefault(code int) *ColumnFamilyMetricsLiveSsTableCountGetDefault { + return &ColumnFamilyMetricsLiveSsTableCountGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsLiveSsTableCountGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsLiveSsTableCountGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics live ss table count get default response +func (o *ColumnFamilyMetricsLiveSsTableCountGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsLiveSsTableCountGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsLiveSsTableCountGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsLiveSsTableCountGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_max_row_size_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_max_row_size_by_name_get_parameters.go new file mode 100644 index 0000000000..6f827aac6b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_max_row_size_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMaxRowSizeByNameGetParams creates a new ColumnFamilyMetricsMaxRowSizeByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMaxRowSizeByNameGetParams() *ColumnFamilyMetricsMaxRowSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMaxRowSizeByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMaxRowSizeByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsMaxRowSizeByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMaxRowSizeByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMaxRowSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMaxRowSizeByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMaxRowSizeByNameGetParamsWithContext creates a new ColumnFamilyMetricsMaxRowSizeByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMaxRowSizeByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMaxRowSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMaxRowSizeByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMaxRowSizeByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMaxRowSizeByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMaxRowSizeByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMaxRowSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMaxRowSizeByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMaxRowSizeByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics max row size by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMaxRowSizeByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics max row size by name get params +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMaxRowSizeByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics max row size by name get params +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics max row size by name get params +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMaxRowSizeByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics max row size by name get params +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics max row size by name get params +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMaxRowSizeByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics max row size by name get params +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics max row size by name get params +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetParams) WithName(name string) *ColumnFamilyMetricsMaxRowSizeByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics max row size by name get params +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_max_row_size_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_max_row_size_by_name_get_responses.go new file mode 100644 index 0000000000..123658dc2f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_max_row_size_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMaxRowSizeByNameGetReader is a Reader for the ColumnFamilyMetricsMaxRowSizeByNameGet structure. +type ColumnFamilyMetricsMaxRowSizeByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMaxRowSizeByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMaxRowSizeByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMaxRowSizeByNameGetOK creates a ColumnFamilyMetricsMaxRowSizeByNameGetOK with default headers values +func NewColumnFamilyMetricsMaxRowSizeByNameGetOK() *ColumnFamilyMetricsMaxRowSizeByNameGetOK { + return &ColumnFamilyMetricsMaxRowSizeByNameGetOK{} +} + +/* +ColumnFamilyMetricsMaxRowSizeByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMaxRowSizeByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMaxRowSizeByNameGetDefault creates a ColumnFamilyMetricsMaxRowSizeByNameGetDefault with default headers values +func NewColumnFamilyMetricsMaxRowSizeByNameGetDefault(code int) *ColumnFamilyMetricsMaxRowSizeByNameGetDefault { + return &ColumnFamilyMetricsMaxRowSizeByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMaxRowSizeByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMaxRowSizeByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics max row size by name get default response +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMaxRowSizeByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_max_row_size_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_max_row_size_get_parameters.go new file mode 100644 index 0000000000..b42a11ff2a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_max_row_size_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMaxRowSizeGetParams creates a new ColumnFamilyMetricsMaxRowSizeGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMaxRowSizeGetParams() *ColumnFamilyMetricsMaxRowSizeGetParams { + + return &ColumnFamilyMetricsMaxRowSizeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMaxRowSizeGetParamsWithTimeout creates a new ColumnFamilyMetricsMaxRowSizeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMaxRowSizeGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMaxRowSizeGetParams { + + return &ColumnFamilyMetricsMaxRowSizeGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMaxRowSizeGetParamsWithContext creates a new ColumnFamilyMetricsMaxRowSizeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMaxRowSizeGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMaxRowSizeGetParams { + + return &ColumnFamilyMetricsMaxRowSizeGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMaxRowSizeGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMaxRowSizeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMaxRowSizeGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMaxRowSizeGetParams { + + return &ColumnFamilyMetricsMaxRowSizeGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMaxRowSizeGetParams contains all the parameters to send to the API endpoint +for the column family metrics max row size get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMaxRowSizeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics max row size get params +func (o *ColumnFamilyMetricsMaxRowSizeGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMaxRowSizeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics max row size get params +func (o *ColumnFamilyMetricsMaxRowSizeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics max row size get params +func (o *ColumnFamilyMetricsMaxRowSizeGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMaxRowSizeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics max row size get params +func (o *ColumnFamilyMetricsMaxRowSizeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics max row size get params +func (o *ColumnFamilyMetricsMaxRowSizeGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMaxRowSizeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics max row size get params +func (o *ColumnFamilyMetricsMaxRowSizeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMaxRowSizeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_max_row_size_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_max_row_size_get_responses.go new file mode 100644 index 0000000000..cfcb196c8e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_max_row_size_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMaxRowSizeGetReader is a Reader for the ColumnFamilyMetricsMaxRowSizeGet structure. +type ColumnFamilyMetricsMaxRowSizeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMaxRowSizeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMaxRowSizeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMaxRowSizeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMaxRowSizeGetOK creates a ColumnFamilyMetricsMaxRowSizeGetOK with default headers values +func NewColumnFamilyMetricsMaxRowSizeGetOK() *ColumnFamilyMetricsMaxRowSizeGetOK { + return &ColumnFamilyMetricsMaxRowSizeGetOK{} +} + +/* +ColumnFamilyMetricsMaxRowSizeGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMaxRowSizeGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsMaxRowSizeGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsMaxRowSizeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMaxRowSizeGetDefault creates a ColumnFamilyMetricsMaxRowSizeGetDefault with default headers values +func NewColumnFamilyMetricsMaxRowSizeGetDefault(code int) *ColumnFamilyMetricsMaxRowSizeGetDefault { + return &ColumnFamilyMetricsMaxRowSizeGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMaxRowSizeGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMaxRowSizeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics max row size get default response +func (o *ColumnFamilyMetricsMaxRowSizeGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMaxRowSizeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMaxRowSizeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMaxRowSizeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_mean_row_size_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_mean_row_size_by_name_get_parameters.go new file mode 100644 index 0000000000..95d032a165 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_mean_row_size_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMeanRowSizeByNameGetParams creates a new ColumnFamilyMetricsMeanRowSizeByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMeanRowSizeByNameGetParams() *ColumnFamilyMetricsMeanRowSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMeanRowSizeByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMeanRowSizeByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsMeanRowSizeByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMeanRowSizeByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMeanRowSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMeanRowSizeByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMeanRowSizeByNameGetParamsWithContext creates a new ColumnFamilyMetricsMeanRowSizeByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMeanRowSizeByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMeanRowSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMeanRowSizeByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMeanRowSizeByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMeanRowSizeByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMeanRowSizeByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMeanRowSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMeanRowSizeByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMeanRowSizeByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics mean row size by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMeanRowSizeByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics mean row size by name get params +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMeanRowSizeByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics mean row size by name get params +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics mean row size by name get params +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMeanRowSizeByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics mean row size by name get params +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics mean row size by name get params +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMeanRowSizeByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics mean row size by name get params +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics mean row size by name get params +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetParams) WithName(name string) *ColumnFamilyMetricsMeanRowSizeByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics mean row size by name get params +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_mean_row_size_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_mean_row_size_by_name_get_responses.go new file mode 100644 index 0000000000..d814ff9322 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_mean_row_size_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMeanRowSizeByNameGetReader is a Reader for the ColumnFamilyMetricsMeanRowSizeByNameGet structure. +type ColumnFamilyMetricsMeanRowSizeByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMeanRowSizeByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMeanRowSizeByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMeanRowSizeByNameGetOK creates a ColumnFamilyMetricsMeanRowSizeByNameGetOK with default headers values +func NewColumnFamilyMetricsMeanRowSizeByNameGetOK() *ColumnFamilyMetricsMeanRowSizeByNameGetOK { + return &ColumnFamilyMetricsMeanRowSizeByNameGetOK{} +} + +/* +ColumnFamilyMetricsMeanRowSizeByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMeanRowSizeByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMeanRowSizeByNameGetDefault creates a ColumnFamilyMetricsMeanRowSizeByNameGetDefault with default headers values +func NewColumnFamilyMetricsMeanRowSizeByNameGetDefault(code int) *ColumnFamilyMetricsMeanRowSizeByNameGetDefault { + return &ColumnFamilyMetricsMeanRowSizeByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMeanRowSizeByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMeanRowSizeByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics mean row size by name get default response +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMeanRowSizeByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_mean_row_size_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_mean_row_size_get_parameters.go new file mode 100644 index 0000000000..ef9f14fcd3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_mean_row_size_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMeanRowSizeGetParams creates a new ColumnFamilyMetricsMeanRowSizeGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMeanRowSizeGetParams() *ColumnFamilyMetricsMeanRowSizeGetParams { + + return &ColumnFamilyMetricsMeanRowSizeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMeanRowSizeGetParamsWithTimeout creates a new ColumnFamilyMetricsMeanRowSizeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMeanRowSizeGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMeanRowSizeGetParams { + + return &ColumnFamilyMetricsMeanRowSizeGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMeanRowSizeGetParamsWithContext creates a new ColumnFamilyMetricsMeanRowSizeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMeanRowSizeGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMeanRowSizeGetParams { + + return &ColumnFamilyMetricsMeanRowSizeGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMeanRowSizeGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMeanRowSizeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMeanRowSizeGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMeanRowSizeGetParams { + + return &ColumnFamilyMetricsMeanRowSizeGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMeanRowSizeGetParams contains all the parameters to send to the API endpoint +for the column family metrics mean row size get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMeanRowSizeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics mean row size get params +func (o *ColumnFamilyMetricsMeanRowSizeGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMeanRowSizeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics mean row size get params +func (o *ColumnFamilyMetricsMeanRowSizeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics mean row size get params +func (o *ColumnFamilyMetricsMeanRowSizeGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMeanRowSizeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics mean row size get params +func (o *ColumnFamilyMetricsMeanRowSizeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics mean row size get params +func (o *ColumnFamilyMetricsMeanRowSizeGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMeanRowSizeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics mean row size get params +func (o *ColumnFamilyMetricsMeanRowSizeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMeanRowSizeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_mean_row_size_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_mean_row_size_get_responses.go new file mode 100644 index 0000000000..14e0167ca0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_mean_row_size_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMeanRowSizeGetReader is a Reader for the ColumnFamilyMetricsMeanRowSizeGet structure. +type ColumnFamilyMetricsMeanRowSizeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMeanRowSizeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMeanRowSizeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMeanRowSizeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMeanRowSizeGetOK creates a ColumnFamilyMetricsMeanRowSizeGetOK with default headers values +func NewColumnFamilyMetricsMeanRowSizeGetOK() *ColumnFamilyMetricsMeanRowSizeGetOK { + return &ColumnFamilyMetricsMeanRowSizeGetOK{} +} + +/* +ColumnFamilyMetricsMeanRowSizeGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMeanRowSizeGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsMeanRowSizeGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsMeanRowSizeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMeanRowSizeGetDefault creates a ColumnFamilyMetricsMeanRowSizeGetDefault with default headers values +func NewColumnFamilyMetricsMeanRowSizeGetDefault(code int) *ColumnFamilyMetricsMeanRowSizeGetDefault { + return &ColumnFamilyMetricsMeanRowSizeGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMeanRowSizeGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMeanRowSizeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics mean row size get default response +func (o *ColumnFamilyMetricsMeanRowSizeGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMeanRowSizeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMeanRowSizeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMeanRowSizeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_columns_count_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_columns_count_by_name_get_parameters.go new file mode 100644 index 0000000000..1c13095e4d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_columns_count_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMemtableColumnsCountByNameGetParams creates a new ColumnFamilyMetricsMemtableColumnsCountByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMemtableColumnsCountByNameGetParams() *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableColumnsCountByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMemtableColumnsCountByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsMemtableColumnsCountByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMemtableColumnsCountByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableColumnsCountByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMemtableColumnsCountByNameGetParamsWithContext creates a new ColumnFamilyMetricsMemtableColumnsCountByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMemtableColumnsCountByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableColumnsCountByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMemtableColumnsCountByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMemtableColumnsCountByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMemtableColumnsCountByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableColumnsCountByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMemtableColumnsCountByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics memtable columns count by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMemtableColumnsCountByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics memtable columns count by name get params +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics memtable columns count by name get params +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics memtable columns count by name get params +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics memtable columns count by name get params +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics memtable columns count by name get params +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics memtable columns count by name get params +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics memtable columns count by name get params +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams) WithName(name string) *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics memtable columns count by name get params +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_columns_count_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_columns_count_by_name_get_responses.go new file mode 100644 index 0000000000..f9a099dea7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_columns_count_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMemtableColumnsCountByNameGetReader is a Reader for the ColumnFamilyMetricsMemtableColumnsCountByNameGet structure. +type ColumnFamilyMetricsMemtableColumnsCountByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMemtableColumnsCountByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMemtableColumnsCountByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMemtableColumnsCountByNameGetOK creates a ColumnFamilyMetricsMemtableColumnsCountByNameGetOK with default headers values +func NewColumnFamilyMetricsMemtableColumnsCountByNameGetOK() *ColumnFamilyMetricsMemtableColumnsCountByNameGetOK { + return &ColumnFamilyMetricsMemtableColumnsCountByNameGetOK{} +} + +/* +ColumnFamilyMetricsMemtableColumnsCountByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMemtableColumnsCountByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMemtableColumnsCountByNameGetDefault creates a ColumnFamilyMetricsMemtableColumnsCountByNameGetDefault with default headers values +func NewColumnFamilyMetricsMemtableColumnsCountByNameGetDefault(code int) *ColumnFamilyMetricsMemtableColumnsCountByNameGetDefault { + return &ColumnFamilyMetricsMemtableColumnsCountByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMemtableColumnsCountByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMemtableColumnsCountByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics memtable columns count by name get default response +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMemtableColumnsCountByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_columns_count_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_columns_count_get_parameters.go new file mode 100644 index 0000000000..467df3de94 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_columns_count_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMemtableColumnsCountGetParams creates a new ColumnFamilyMetricsMemtableColumnsCountGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMemtableColumnsCountGetParams() *ColumnFamilyMetricsMemtableColumnsCountGetParams { + + return &ColumnFamilyMetricsMemtableColumnsCountGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMemtableColumnsCountGetParamsWithTimeout creates a new ColumnFamilyMetricsMemtableColumnsCountGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMemtableColumnsCountGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableColumnsCountGetParams { + + return &ColumnFamilyMetricsMemtableColumnsCountGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMemtableColumnsCountGetParamsWithContext creates a new ColumnFamilyMetricsMemtableColumnsCountGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMemtableColumnsCountGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMemtableColumnsCountGetParams { + + return &ColumnFamilyMetricsMemtableColumnsCountGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMemtableColumnsCountGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMemtableColumnsCountGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMemtableColumnsCountGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableColumnsCountGetParams { + + return &ColumnFamilyMetricsMemtableColumnsCountGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMemtableColumnsCountGetParams contains all the parameters to send to the API endpoint +for the column family metrics memtable columns count get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMemtableColumnsCountGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics memtable columns count get params +func (o *ColumnFamilyMetricsMemtableColumnsCountGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableColumnsCountGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics memtable columns count get params +func (o *ColumnFamilyMetricsMemtableColumnsCountGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics memtable columns count get params +func (o *ColumnFamilyMetricsMemtableColumnsCountGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMemtableColumnsCountGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics memtable columns count get params +func (o *ColumnFamilyMetricsMemtableColumnsCountGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics memtable columns count get params +func (o *ColumnFamilyMetricsMemtableColumnsCountGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableColumnsCountGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics memtable columns count get params +func (o *ColumnFamilyMetricsMemtableColumnsCountGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMemtableColumnsCountGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_columns_count_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_columns_count_get_responses.go new file mode 100644 index 0000000000..119e5fd6ad --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_columns_count_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMemtableColumnsCountGetReader is a Reader for the ColumnFamilyMetricsMemtableColumnsCountGet structure. +type ColumnFamilyMetricsMemtableColumnsCountGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMemtableColumnsCountGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMemtableColumnsCountGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMemtableColumnsCountGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMemtableColumnsCountGetOK creates a ColumnFamilyMetricsMemtableColumnsCountGetOK with default headers values +func NewColumnFamilyMetricsMemtableColumnsCountGetOK() *ColumnFamilyMetricsMemtableColumnsCountGetOK { + return &ColumnFamilyMetricsMemtableColumnsCountGetOK{} +} + +/* +ColumnFamilyMetricsMemtableColumnsCountGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMemtableColumnsCountGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsMemtableColumnsCountGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableColumnsCountGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMemtableColumnsCountGetDefault creates a ColumnFamilyMetricsMemtableColumnsCountGetDefault with default headers values +func NewColumnFamilyMetricsMemtableColumnsCountGetDefault(code int) *ColumnFamilyMetricsMemtableColumnsCountGetDefault { + return &ColumnFamilyMetricsMemtableColumnsCountGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMemtableColumnsCountGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMemtableColumnsCountGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics memtable columns count get default response +func (o *ColumnFamilyMetricsMemtableColumnsCountGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMemtableColumnsCountGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableColumnsCountGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMemtableColumnsCountGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_live_data_size_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_live_data_size_by_name_get_parameters.go new file mode 100644 index 0000000000..c45dee74fe --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_live_data_size_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams creates a new ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams() *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMemtableLiveDataSizeByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMemtableLiveDataSizeByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMemtableLiveDataSizeByNameGetParamsWithContext creates a new ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMemtableLiveDataSizeByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMemtableLiveDataSizeByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMemtableLiveDataSizeByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics memtable live data size by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics memtable live data size by name get params +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics memtable live data size by name get params +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics memtable live data size by name get params +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics memtable live data size by name get params +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics memtable live data size by name get params +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics memtable live data size by name get params +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics memtable live data size by name get params +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams) WithName(name string) *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics memtable live data size by name get params +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_live_data_size_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_live_data_size_by_name_get_responses.go new file mode 100644 index 0000000000..cbe801915e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_live_data_size_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMemtableLiveDataSizeByNameGetReader is a Reader for the ColumnFamilyMetricsMemtableLiveDataSizeByNameGet structure. +type ColumnFamilyMetricsMemtableLiveDataSizeByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMemtableLiveDataSizeByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMemtableLiveDataSizeByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMemtableLiveDataSizeByNameGetOK creates a ColumnFamilyMetricsMemtableLiveDataSizeByNameGetOK with default headers values +func NewColumnFamilyMetricsMemtableLiveDataSizeByNameGetOK() *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetOK { + return &ColumnFamilyMetricsMemtableLiveDataSizeByNameGetOK{} +} + +/* +ColumnFamilyMetricsMemtableLiveDataSizeByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMemtableLiveDataSizeByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMemtableLiveDataSizeByNameGetDefault creates a ColumnFamilyMetricsMemtableLiveDataSizeByNameGetDefault with default headers values +func NewColumnFamilyMetricsMemtableLiveDataSizeByNameGetDefault(code int) *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetDefault { + return &ColumnFamilyMetricsMemtableLiveDataSizeByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMemtableLiveDataSizeByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMemtableLiveDataSizeByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics memtable live data size by name get default response +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_live_data_size_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_live_data_size_get_parameters.go new file mode 100644 index 0000000000..993c6fdaac --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_live_data_size_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMemtableLiveDataSizeGetParams creates a new ColumnFamilyMetricsMemtableLiveDataSizeGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMemtableLiveDataSizeGetParams() *ColumnFamilyMetricsMemtableLiveDataSizeGetParams { + + return &ColumnFamilyMetricsMemtableLiveDataSizeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMemtableLiveDataSizeGetParamsWithTimeout creates a new ColumnFamilyMetricsMemtableLiveDataSizeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMemtableLiveDataSizeGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableLiveDataSizeGetParams { + + return &ColumnFamilyMetricsMemtableLiveDataSizeGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMemtableLiveDataSizeGetParamsWithContext creates a new ColumnFamilyMetricsMemtableLiveDataSizeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMemtableLiveDataSizeGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMemtableLiveDataSizeGetParams { + + return &ColumnFamilyMetricsMemtableLiveDataSizeGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMemtableLiveDataSizeGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMemtableLiveDataSizeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMemtableLiveDataSizeGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableLiveDataSizeGetParams { + + return &ColumnFamilyMetricsMemtableLiveDataSizeGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMemtableLiveDataSizeGetParams contains all the parameters to send to the API endpoint +for the column family metrics memtable live data size get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMemtableLiveDataSizeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics memtable live data size get params +func (o *ColumnFamilyMetricsMemtableLiveDataSizeGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableLiveDataSizeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics memtable live data size get params +func (o *ColumnFamilyMetricsMemtableLiveDataSizeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics memtable live data size get params +func (o *ColumnFamilyMetricsMemtableLiveDataSizeGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMemtableLiveDataSizeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics memtable live data size get params +func (o *ColumnFamilyMetricsMemtableLiveDataSizeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics memtable live data size get params +func (o *ColumnFamilyMetricsMemtableLiveDataSizeGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableLiveDataSizeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics memtable live data size get params +func (o *ColumnFamilyMetricsMemtableLiveDataSizeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMemtableLiveDataSizeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_live_data_size_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_live_data_size_get_responses.go new file mode 100644 index 0000000000..ad81638a5a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_live_data_size_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMemtableLiveDataSizeGetReader is a Reader for the ColumnFamilyMetricsMemtableLiveDataSizeGet structure. +type ColumnFamilyMetricsMemtableLiveDataSizeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMemtableLiveDataSizeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMemtableLiveDataSizeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMemtableLiveDataSizeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMemtableLiveDataSizeGetOK creates a ColumnFamilyMetricsMemtableLiveDataSizeGetOK with default headers values +func NewColumnFamilyMetricsMemtableLiveDataSizeGetOK() *ColumnFamilyMetricsMemtableLiveDataSizeGetOK { + return &ColumnFamilyMetricsMemtableLiveDataSizeGetOK{} +} + +/* +ColumnFamilyMetricsMemtableLiveDataSizeGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMemtableLiveDataSizeGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsMemtableLiveDataSizeGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableLiveDataSizeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMemtableLiveDataSizeGetDefault creates a ColumnFamilyMetricsMemtableLiveDataSizeGetDefault with default headers values +func NewColumnFamilyMetricsMemtableLiveDataSizeGetDefault(code int) *ColumnFamilyMetricsMemtableLiveDataSizeGetDefault { + return &ColumnFamilyMetricsMemtableLiveDataSizeGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMemtableLiveDataSizeGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMemtableLiveDataSizeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics memtable live data size get default response +func (o *ColumnFamilyMetricsMemtableLiveDataSizeGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMemtableLiveDataSizeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableLiveDataSizeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMemtableLiveDataSizeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_off_heap_size_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_off_heap_size_by_name_get_parameters.go new file mode 100644 index 0000000000..38ef3db03e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_off_heap_size_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams creates a new ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams() *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMemtableOffHeapSizeByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMemtableOffHeapSizeByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMemtableOffHeapSizeByNameGetParamsWithContext creates a new ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMemtableOffHeapSizeByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMemtableOffHeapSizeByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMemtableOffHeapSizeByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics memtable off heap size by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics memtable off heap size by name get params +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics memtable off heap size by name get params +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics memtable off heap size by name get params +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics memtable off heap size by name get params +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics memtable off heap size by name get params +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics memtable off heap size by name get params +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics memtable off heap size by name get params +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams) WithName(name string) *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics memtable off heap size by name get params +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_off_heap_size_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_off_heap_size_by_name_get_responses.go new file mode 100644 index 0000000000..cc41f5c09f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_off_heap_size_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMemtableOffHeapSizeByNameGetReader is a Reader for the ColumnFamilyMetricsMemtableOffHeapSizeByNameGet structure. +type ColumnFamilyMetricsMemtableOffHeapSizeByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMemtableOffHeapSizeByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMemtableOffHeapSizeByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMemtableOffHeapSizeByNameGetOK creates a ColumnFamilyMetricsMemtableOffHeapSizeByNameGetOK with default headers values +func NewColumnFamilyMetricsMemtableOffHeapSizeByNameGetOK() *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetOK { + return &ColumnFamilyMetricsMemtableOffHeapSizeByNameGetOK{} +} + +/* +ColumnFamilyMetricsMemtableOffHeapSizeByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMemtableOffHeapSizeByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMemtableOffHeapSizeByNameGetDefault creates a ColumnFamilyMetricsMemtableOffHeapSizeByNameGetDefault with default headers values +func NewColumnFamilyMetricsMemtableOffHeapSizeByNameGetDefault(code int) *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetDefault { + return &ColumnFamilyMetricsMemtableOffHeapSizeByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMemtableOffHeapSizeByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMemtableOffHeapSizeByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics memtable off heap size by name get default response +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_off_heap_size_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_off_heap_size_get_parameters.go new file mode 100644 index 0000000000..4f60d022ea --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_off_heap_size_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMemtableOffHeapSizeGetParams creates a new ColumnFamilyMetricsMemtableOffHeapSizeGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMemtableOffHeapSizeGetParams() *ColumnFamilyMetricsMemtableOffHeapSizeGetParams { + + return &ColumnFamilyMetricsMemtableOffHeapSizeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMemtableOffHeapSizeGetParamsWithTimeout creates a new ColumnFamilyMetricsMemtableOffHeapSizeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMemtableOffHeapSizeGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableOffHeapSizeGetParams { + + return &ColumnFamilyMetricsMemtableOffHeapSizeGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMemtableOffHeapSizeGetParamsWithContext creates a new ColumnFamilyMetricsMemtableOffHeapSizeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMemtableOffHeapSizeGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMemtableOffHeapSizeGetParams { + + return &ColumnFamilyMetricsMemtableOffHeapSizeGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMemtableOffHeapSizeGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMemtableOffHeapSizeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMemtableOffHeapSizeGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableOffHeapSizeGetParams { + + return &ColumnFamilyMetricsMemtableOffHeapSizeGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMemtableOffHeapSizeGetParams contains all the parameters to send to the API endpoint +for the column family metrics memtable off heap size get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMemtableOffHeapSizeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics memtable off heap size get params +func (o *ColumnFamilyMetricsMemtableOffHeapSizeGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableOffHeapSizeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics memtable off heap size get params +func (o *ColumnFamilyMetricsMemtableOffHeapSizeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics memtable off heap size get params +func (o *ColumnFamilyMetricsMemtableOffHeapSizeGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMemtableOffHeapSizeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics memtable off heap size get params +func (o *ColumnFamilyMetricsMemtableOffHeapSizeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics memtable off heap size get params +func (o *ColumnFamilyMetricsMemtableOffHeapSizeGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableOffHeapSizeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics memtable off heap size get params +func (o *ColumnFamilyMetricsMemtableOffHeapSizeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMemtableOffHeapSizeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_off_heap_size_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_off_heap_size_get_responses.go new file mode 100644 index 0000000000..9ee1532f09 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_off_heap_size_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMemtableOffHeapSizeGetReader is a Reader for the ColumnFamilyMetricsMemtableOffHeapSizeGet structure. +type ColumnFamilyMetricsMemtableOffHeapSizeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMemtableOffHeapSizeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMemtableOffHeapSizeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMemtableOffHeapSizeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMemtableOffHeapSizeGetOK creates a ColumnFamilyMetricsMemtableOffHeapSizeGetOK with default headers values +func NewColumnFamilyMetricsMemtableOffHeapSizeGetOK() *ColumnFamilyMetricsMemtableOffHeapSizeGetOK { + return &ColumnFamilyMetricsMemtableOffHeapSizeGetOK{} +} + +/* +ColumnFamilyMetricsMemtableOffHeapSizeGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMemtableOffHeapSizeGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsMemtableOffHeapSizeGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableOffHeapSizeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMemtableOffHeapSizeGetDefault creates a ColumnFamilyMetricsMemtableOffHeapSizeGetDefault with default headers values +func NewColumnFamilyMetricsMemtableOffHeapSizeGetDefault(code int) *ColumnFamilyMetricsMemtableOffHeapSizeGetDefault { + return &ColumnFamilyMetricsMemtableOffHeapSizeGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMemtableOffHeapSizeGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMemtableOffHeapSizeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics memtable off heap size get default response +func (o *ColumnFamilyMetricsMemtableOffHeapSizeGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMemtableOffHeapSizeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableOffHeapSizeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMemtableOffHeapSizeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_on_heap_size_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_on_heap_size_by_name_get_parameters.go new file mode 100644 index 0000000000..acd6cc9955 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_on_heap_size_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams creates a new ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams() *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMemtableOnHeapSizeByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMemtableOnHeapSizeByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMemtableOnHeapSizeByNameGetParamsWithContext creates a new ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMemtableOnHeapSizeByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMemtableOnHeapSizeByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMemtableOnHeapSizeByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics memtable on heap size by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics memtable on heap size by name get params +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics memtable on heap size by name get params +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics memtable on heap size by name get params +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics memtable on heap size by name get params +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics memtable on heap size by name get params +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics memtable on heap size by name get params +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics memtable on heap size by name get params +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams) WithName(name string) *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics memtable on heap size by name get params +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_on_heap_size_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_on_heap_size_by_name_get_responses.go new file mode 100644 index 0000000000..b1247cdc78 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_on_heap_size_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMemtableOnHeapSizeByNameGetReader is a Reader for the ColumnFamilyMetricsMemtableOnHeapSizeByNameGet structure. +type ColumnFamilyMetricsMemtableOnHeapSizeByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMemtableOnHeapSizeByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMemtableOnHeapSizeByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMemtableOnHeapSizeByNameGetOK creates a ColumnFamilyMetricsMemtableOnHeapSizeByNameGetOK with default headers values +func NewColumnFamilyMetricsMemtableOnHeapSizeByNameGetOK() *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetOK { + return &ColumnFamilyMetricsMemtableOnHeapSizeByNameGetOK{} +} + +/* +ColumnFamilyMetricsMemtableOnHeapSizeByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMemtableOnHeapSizeByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMemtableOnHeapSizeByNameGetDefault creates a ColumnFamilyMetricsMemtableOnHeapSizeByNameGetDefault with default headers values +func NewColumnFamilyMetricsMemtableOnHeapSizeByNameGetDefault(code int) *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetDefault { + return &ColumnFamilyMetricsMemtableOnHeapSizeByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMemtableOnHeapSizeByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMemtableOnHeapSizeByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics memtable on heap size by name get default response +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_on_heap_size_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_on_heap_size_get_parameters.go new file mode 100644 index 0000000000..d3473876f2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_on_heap_size_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMemtableOnHeapSizeGetParams creates a new ColumnFamilyMetricsMemtableOnHeapSizeGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMemtableOnHeapSizeGetParams() *ColumnFamilyMetricsMemtableOnHeapSizeGetParams { + + return &ColumnFamilyMetricsMemtableOnHeapSizeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMemtableOnHeapSizeGetParamsWithTimeout creates a new ColumnFamilyMetricsMemtableOnHeapSizeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMemtableOnHeapSizeGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableOnHeapSizeGetParams { + + return &ColumnFamilyMetricsMemtableOnHeapSizeGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMemtableOnHeapSizeGetParamsWithContext creates a new ColumnFamilyMetricsMemtableOnHeapSizeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMemtableOnHeapSizeGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMemtableOnHeapSizeGetParams { + + return &ColumnFamilyMetricsMemtableOnHeapSizeGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMemtableOnHeapSizeGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMemtableOnHeapSizeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMemtableOnHeapSizeGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableOnHeapSizeGetParams { + + return &ColumnFamilyMetricsMemtableOnHeapSizeGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMemtableOnHeapSizeGetParams contains all the parameters to send to the API endpoint +for the column family metrics memtable on heap size get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMemtableOnHeapSizeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics memtable on heap size get params +func (o *ColumnFamilyMetricsMemtableOnHeapSizeGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableOnHeapSizeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics memtable on heap size get params +func (o *ColumnFamilyMetricsMemtableOnHeapSizeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics memtable on heap size get params +func (o *ColumnFamilyMetricsMemtableOnHeapSizeGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMemtableOnHeapSizeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics memtable on heap size get params +func (o *ColumnFamilyMetricsMemtableOnHeapSizeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics memtable on heap size get params +func (o *ColumnFamilyMetricsMemtableOnHeapSizeGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableOnHeapSizeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics memtable on heap size get params +func (o *ColumnFamilyMetricsMemtableOnHeapSizeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMemtableOnHeapSizeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_on_heap_size_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_on_heap_size_get_responses.go new file mode 100644 index 0000000000..ab974948a2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_on_heap_size_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMemtableOnHeapSizeGetReader is a Reader for the ColumnFamilyMetricsMemtableOnHeapSizeGet structure. +type ColumnFamilyMetricsMemtableOnHeapSizeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMemtableOnHeapSizeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMemtableOnHeapSizeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMemtableOnHeapSizeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMemtableOnHeapSizeGetOK creates a ColumnFamilyMetricsMemtableOnHeapSizeGetOK with default headers values +func NewColumnFamilyMetricsMemtableOnHeapSizeGetOK() *ColumnFamilyMetricsMemtableOnHeapSizeGetOK { + return &ColumnFamilyMetricsMemtableOnHeapSizeGetOK{} +} + +/* +ColumnFamilyMetricsMemtableOnHeapSizeGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMemtableOnHeapSizeGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsMemtableOnHeapSizeGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableOnHeapSizeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMemtableOnHeapSizeGetDefault creates a ColumnFamilyMetricsMemtableOnHeapSizeGetDefault with default headers values +func NewColumnFamilyMetricsMemtableOnHeapSizeGetDefault(code int) *ColumnFamilyMetricsMemtableOnHeapSizeGetDefault { + return &ColumnFamilyMetricsMemtableOnHeapSizeGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMemtableOnHeapSizeGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMemtableOnHeapSizeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics memtable on heap size get default response +func (o *ColumnFamilyMetricsMemtableOnHeapSizeGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMemtableOnHeapSizeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableOnHeapSizeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMemtableOnHeapSizeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_switch_count_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_switch_count_by_name_get_parameters.go new file mode 100644 index 0000000000..8ac0e9bde0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_switch_count_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMemtableSwitchCountByNameGetParams creates a new ColumnFamilyMetricsMemtableSwitchCountByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMemtableSwitchCountByNameGetParams() *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableSwitchCountByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMemtableSwitchCountByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsMemtableSwitchCountByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMemtableSwitchCountByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableSwitchCountByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMemtableSwitchCountByNameGetParamsWithContext creates a new ColumnFamilyMetricsMemtableSwitchCountByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMemtableSwitchCountByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableSwitchCountByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMemtableSwitchCountByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMemtableSwitchCountByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMemtableSwitchCountByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams { + var () + return &ColumnFamilyMetricsMemtableSwitchCountByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMemtableSwitchCountByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics memtable switch count by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMemtableSwitchCountByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics memtable switch count by name get params +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics memtable switch count by name get params +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics memtable switch count by name get params +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics memtable switch count by name get params +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics memtable switch count by name get params +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics memtable switch count by name get params +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics memtable switch count by name get params +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams) WithName(name string) *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics memtable switch count by name get params +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_switch_count_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_switch_count_by_name_get_responses.go new file mode 100644 index 0000000000..8ce5b801ba --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_switch_count_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMemtableSwitchCountByNameGetReader is a Reader for the ColumnFamilyMetricsMemtableSwitchCountByNameGet structure. +type ColumnFamilyMetricsMemtableSwitchCountByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMemtableSwitchCountByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMemtableSwitchCountByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMemtableSwitchCountByNameGetOK creates a ColumnFamilyMetricsMemtableSwitchCountByNameGetOK with default headers values +func NewColumnFamilyMetricsMemtableSwitchCountByNameGetOK() *ColumnFamilyMetricsMemtableSwitchCountByNameGetOK { + return &ColumnFamilyMetricsMemtableSwitchCountByNameGetOK{} +} + +/* +ColumnFamilyMetricsMemtableSwitchCountByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMemtableSwitchCountByNameGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMemtableSwitchCountByNameGetDefault creates a ColumnFamilyMetricsMemtableSwitchCountByNameGetDefault with default headers values +func NewColumnFamilyMetricsMemtableSwitchCountByNameGetDefault(code int) *ColumnFamilyMetricsMemtableSwitchCountByNameGetDefault { + return &ColumnFamilyMetricsMemtableSwitchCountByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMemtableSwitchCountByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMemtableSwitchCountByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics memtable switch count by name get default response +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMemtableSwitchCountByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_switch_count_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_switch_count_get_parameters.go new file mode 100644 index 0000000000..b090be77b3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_switch_count_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMemtableSwitchCountGetParams creates a new ColumnFamilyMetricsMemtableSwitchCountGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMemtableSwitchCountGetParams() *ColumnFamilyMetricsMemtableSwitchCountGetParams { + + return &ColumnFamilyMetricsMemtableSwitchCountGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMemtableSwitchCountGetParamsWithTimeout creates a new ColumnFamilyMetricsMemtableSwitchCountGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMemtableSwitchCountGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableSwitchCountGetParams { + + return &ColumnFamilyMetricsMemtableSwitchCountGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMemtableSwitchCountGetParamsWithContext creates a new ColumnFamilyMetricsMemtableSwitchCountGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMemtableSwitchCountGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMemtableSwitchCountGetParams { + + return &ColumnFamilyMetricsMemtableSwitchCountGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMemtableSwitchCountGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMemtableSwitchCountGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMemtableSwitchCountGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableSwitchCountGetParams { + + return &ColumnFamilyMetricsMemtableSwitchCountGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMemtableSwitchCountGetParams contains all the parameters to send to the API endpoint +for the column family metrics memtable switch count get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMemtableSwitchCountGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics memtable switch count get params +func (o *ColumnFamilyMetricsMemtableSwitchCountGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMemtableSwitchCountGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics memtable switch count get params +func (o *ColumnFamilyMetricsMemtableSwitchCountGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics memtable switch count get params +func (o *ColumnFamilyMetricsMemtableSwitchCountGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMemtableSwitchCountGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics memtable switch count get params +func (o *ColumnFamilyMetricsMemtableSwitchCountGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics memtable switch count get params +func (o *ColumnFamilyMetricsMemtableSwitchCountGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMemtableSwitchCountGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics memtable switch count get params +func (o *ColumnFamilyMetricsMemtableSwitchCountGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMemtableSwitchCountGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_switch_count_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_switch_count_get_responses.go new file mode 100644 index 0000000000..49830e4137 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_memtable_switch_count_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMemtableSwitchCountGetReader is a Reader for the ColumnFamilyMetricsMemtableSwitchCountGet structure. +type ColumnFamilyMetricsMemtableSwitchCountGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMemtableSwitchCountGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMemtableSwitchCountGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMemtableSwitchCountGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMemtableSwitchCountGetOK creates a ColumnFamilyMetricsMemtableSwitchCountGetOK with default headers values +func NewColumnFamilyMetricsMemtableSwitchCountGetOK() *ColumnFamilyMetricsMemtableSwitchCountGetOK { + return &ColumnFamilyMetricsMemtableSwitchCountGetOK{} +} + +/* +ColumnFamilyMetricsMemtableSwitchCountGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMemtableSwitchCountGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsMemtableSwitchCountGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableSwitchCountGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMemtableSwitchCountGetDefault creates a ColumnFamilyMetricsMemtableSwitchCountGetDefault with default headers values +func NewColumnFamilyMetricsMemtableSwitchCountGetDefault(code int) *ColumnFamilyMetricsMemtableSwitchCountGetDefault { + return &ColumnFamilyMetricsMemtableSwitchCountGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMemtableSwitchCountGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMemtableSwitchCountGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics memtable switch count get default response +func (o *ColumnFamilyMetricsMemtableSwitchCountGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMemtableSwitchCountGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMemtableSwitchCountGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMemtableSwitchCountGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_min_row_size_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_min_row_size_by_name_get_parameters.go new file mode 100644 index 0000000000..556f1492e9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_min_row_size_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMinRowSizeByNameGetParams creates a new ColumnFamilyMetricsMinRowSizeByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMinRowSizeByNameGetParams() *ColumnFamilyMetricsMinRowSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMinRowSizeByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMinRowSizeByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsMinRowSizeByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMinRowSizeByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMinRowSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMinRowSizeByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMinRowSizeByNameGetParamsWithContext creates a new ColumnFamilyMetricsMinRowSizeByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMinRowSizeByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMinRowSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMinRowSizeByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMinRowSizeByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMinRowSizeByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMinRowSizeByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMinRowSizeByNameGetParams { + var () + return &ColumnFamilyMetricsMinRowSizeByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMinRowSizeByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics min row size by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMinRowSizeByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics min row size by name get params +func (o *ColumnFamilyMetricsMinRowSizeByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMinRowSizeByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics min row size by name get params +func (o *ColumnFamilyMetricsMinRowSizeByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics min row size by name get params +func (o *ColumnFamilyMetricsMinRowSizeByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMinRowSizeByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics min row size by name get params +func (o *ColumnFamilyMetricsMinRowSizeByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics min row size by name get params +func (o *ColumnFamilyMetricsMinRowSizeByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMinRowSizeByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics min row size by name get params +func (o *ColumnFamilyMetricsMinRowSizeByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics min row size by name get params +func (o *ColumnFamilyMetricsMinRowSizeByNameGetParams) WithName(name string) *ColumnFamilyMetricsMinRowSizeByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics min row size by name get params +func (o *ColumnFamilyMetricsMinRowSizeByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMinRowSizeByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_min_row_size_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_min_row_size_by_name_get_responses.go new file mode 100644 index 0000000000..d48ab89f67 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_min_row_size_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMinRowSizeByNameGetReader is a Reader for the ColumnFamilyMetricsMinRowSizeByNameGet structure. +type ColumnFamilyMetricsMinRowSizeByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMinRowSizeByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMinRowSizeByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMinRowSizeByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMinRowSizeByNameGetOK creates a ColumnFamilyMetricsMinRowSizeByNameGetOK with default headers values +func NewColumnFamilyMetricsMinRowSizeByNameGetOK() *ColumnFamilyMetricsMinRowSizeByNameGetOK { + return &ColumnFamilyMetricsMinRowSizeByNameGetOK{} +} + +/* +ColumnFamilyMetricsMinRowSizeByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMinRowSizeByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsMinRowSizeByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsMinRowSizeByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMinRowSizeByNameGetDefault creates a ColumnFamilyMetricsMinRowSizeByNameGetDefault with default headers values +func NewColumnFamilyMetricsMinRowSizeByNameGetDefault(code int) *ColumnFamilyMetricsMinRowSizeByNameGetDefault { + return &ColumnFamilyMetricsMinRowSizeByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMinRowSizeByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMinRowSizeByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics min row size by name get default response +func (o *ColumnFamilyMetricsMinRowSizeByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMinRowSizeByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMinRowSizeByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMinRowSizeByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_min_row_size_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_min_row_size_get_parameters.go new file mode 100644 index 0000000000..59f4010f05 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_min_row_size_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsMinRowSizeGetParams creates a new ColumnFamilyMetricsMinRowSizeGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsMinRowSizeGetParams() *ColumnFamilyMetricsMinRowSizeGetParams { + + return &ColumnFamilyMetricsMinRowSizeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsMinRowSizeGetParamsWithTimeout creates a new ColumnFamilyMetricsMinRowSizeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsMinRowSizeGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsMinRowSizeGetParams { + + return &ColumnFamilyMetricsMinRowSizeGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsMinRowSizeGetParamsWithContext creates a new ColumnFamilyMetricsMinRowSizeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsMinRowSizeGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsMinRowSizeGetParams { + + return &ColumnFamilyMetricsMinRowSizeGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsMinRowSizeGetParamsWithHTTPClient creates a new ColumnFamilyMetricsMinRowSizeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsMinRowSizeGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsMinRowSizeGetParams { + + return &ColumnFamilyMetricsMinRowSizeGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsMinRowSizeGetParams contains all the parameters to send to the API endpoint +for the column family metrics min row size get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsMinRowSizeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics min row size get params +func (o *ColumnFamilyMetricsMinRowSizeGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsMinRowSizeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics min row size get params +func (o *ColumnFamilyMetricsMinRowSizeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics min row size get params +func (o *ColumnFamilyMetricsMinRowSizeGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsMinRowSizeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics min row size get params +func (o *ColumnFamilyMetricsMinRowSizeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics min row size get params +func (o *ColumnFamilyMetricsMinRowSizeGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsMinRowSizeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics min row size get params +func (o *ColumnFamilyMetricsMinRowSizeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsMinRowSizeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_min_row_size_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_min_row_size_get_responses.go new file mode 100644 index 0000000000..79e4688642 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_min_row_size_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsMinRowSizeGetReader is a Reader for the ColumnFamilyMetricsMinRowSizeGet structure. +type ColumnFamilyMetricsMinRowSizeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsMinRowSizeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsMinRowSizeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsMinRowSizeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsMinRowSizeGetOK creates a ColumnFamilyMetricsMinRowSizeGetOK with default headers values +func NewColumnFamilyMetricsMinRowSizeGetOK() *ColumnFamilyMetricsMinRowSizeGetOK { + return &ColumnFamilyMetricsMinRowSizeGetOK{} +} + +/* +ColumnFamilyMetricsMinRowSizeGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsMinRowSizeGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsMinRowSizeGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsMinRowSizeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsMinRowSizeGetDefault creates a ColumnFamilyMetricsMinRowSizeGetDefault with default headers values +func NewColumnFamilyMetricsMinRowSizeGetDefault(code int) *ColumnFamilyMetricsMinRowSizeGetDefault { + return &ColumnFamilyMetricsMinRowSizeGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsMinRowSizeGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsMinRowSizeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics min row size get default response +func (o *ColumnFamilyMetricsMinRowSizeGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsMinRowSizeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsMinRowSizeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsMinRowSizeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_compactions_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_compactions_by_name_get_parameters.go new file mode 100644 index 0000000000..5ff9f845e3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_compactions_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsPendingCompactionsByNameGetParams creates a new ColumnFamilyMetricsPendingCompactionsByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsPendingCompactionsByNameGetParams() *ColumnFamilyMetricsPendingCompactionsByNameGetParams { + var () + return &ColumnFamilyMetricsPendingCompactionsByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsPendingCompactionsByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsPendingCompactionsByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsPendingCompactionsByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsPendingCompactionsByNameGetParams { + var () + return &ColumnFamilyMetricsPendingCompactionsByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsPendingCompactionsByNameGetParamsWithContext creates a new ColumnFamilyMetricsPendingCompactionsByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsPendingCompactionsByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsPendingCompactionsByNameGetParams { + var () + return &ColumnFamilyMetricsPendingCompactionsByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsPendingCompactionsByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsPendingCompactionsByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsPendingCompactionsByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsPendingCompactionsByNameGetParams { + var () + return &ColumnFamilyMetricsPendingCompactionsByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsPendingCompactionsByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics pending compactions by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsPendingCompactionsByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics pending compactions by name get params +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsPendingCompactionsByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics pending compactions by name get params +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics pending compactions by name get params +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsPendingCompactionsByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics pending compactions by name get params +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics pending compactions by name get params +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsPendingCompactionsByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics pending compactions by name get params +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics pending compactions by name get params +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetParams) WithName(name string) *ColumnFamilyMetricsPendingCompactionsByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics pending compactions by name get params +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_compactions_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_compactions_by_name_get_responses.go new file mode 100644 index 0000000000..5864656575 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_compactions_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsPendingCompactionsByNameGetReader is a Reader for the ColumnFamilyMetricsPendingCompactionsByNameGet structure. +type ColumnFamilyMetricsPendingCompactionsByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsPendingCompactionsByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsPendingCompactionsByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsPendingCompactionsByNameGetOK creates a ColumnFamilyMetricsPendingCompactionsByNameGetOK with default headers values +func NewColumnFamilyMetricsPendingCompactionsByNameGetOK() *ColumnFamilyMetricsPendingCompactionsByNameGetOK { + return &ColumnFamilyMetricsPendingCompactionsByNameGetOK{} +} + +/* +ColumnFamilyMetricsPendingCompactionsByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsPendingCompactionsByNameGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsPendingCompactionsByNameGetDefault creates a ColumnFamilyMetricsPendingCompactionsByNameGetDefault with default headers values +func NewColumnFamilyMetricsPendingCompactionsByNameGetDefault(code int) *ColumnFamilyMetricsPendingCompactionsByNameGetDefault { + return &ColumnFamilyMetricsPendingCompactionsByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsPendingCompactionsByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsPendingCompactionsByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics pending compactions by name get default response +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsPendingCompactionsByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_compactions_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_compactions_get_parameters.go new file mode 100644 index 0000000000..dd486883c5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_compactions_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsPendingCompactionsGetParams creates a new ColumnFamilyMetricsPendingCompactionsGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsPendingCompactionsGetParams() *ColumnFamilyMetricsPendingCompactionsGetParams { + + return &ColumnFamilyMetricsPendingCompactionsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsPendingCompactionsGetParamsWithTimeout creates a new ColumnFamilyMetricsPendingCompactionsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsPendingCompactionsGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsPendingCompactionsGetParams { + + return &ColumnFamilyMetricsPendingCompactionsGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsPendingCompactionsGetParamsWithContext creates a new ColumnFamilyMetricsPendingCompactionsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsPendingCompactionsGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsPendingCompactionsGetParams { + + return &ColumnFamilyMetricsPendingCompactionsGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsPendingCompactionsGetParamsWithHTTPClient creates a new ColumnFamilyMetricsPendingCompactionsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsPendingCompactionsGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsPendingCompactionsGetParams { + + return &ColumnFamilyMetricsPendingCompactionsGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsPendingCompactionsGetParams contains all the parameters to send to the API endpoint +for the column family metrics pending compactions get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsPendingCompactionsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics pending compactions get params +func (o *ColumnFamilyMetricsPendingCompactionsGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsPendingCompactionsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics pending compactions get params +func (o *ColumnFamilyMetricsPendingCompactionsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics pending compactions get params +func (o *ColumnFamilyMetricsPendingCompactionsGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsPendingCompactionsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics pending compactions get params +func (o *ColumnFamilyMetricsPendingCompactionsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics pending compactions get params +func (o *ColumnFamilyMetricsPendingCompactionsGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsPendingCompactionsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics pending compactions get params +func (o *ColumnFamilyMetricsPendingCompactionsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsPendingCompactionsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_compactions_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_compactions_get_responses.go new file mode 100644 index 0000000000..06ef0475b3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_compactions_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsPendingCompactionsGetReader is a Reader for the ColumnFamilyMetricsPendingCompactionsGet structure. +type ColumnFamilyMetricsPendingCompactionsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsPendingCompactionsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsPendingCompactionsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsPendingCompactionsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsPendingCompactionsGetOK creates a ColumnFamilyMetricsPendingCompactionsGetOK with default headers values +func NewColumnFamilyMetricsPendingCompactionsGetOK() *ColumnFamilyMetricsPendingCompactionsGetOK { + return &ColumnFamilyMetricsPendingCompactionsGetOK{} +} + +/* +ColumnFamilyMetricsPendingCompactionsGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsPendingCompactionsGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsPendingCompactionsGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsPendingCompactionsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsPendingCompactionsGetDefault creates a ColumnFamilyMetricsPendingCompactionsGetDefault with default headers values +func NewColumnFamilyMetricsPendingCompactionsGetDefault(code int) *ColumnFamilyMetricsPendingCompactionsGetDefault { + return &ColumnFamilyMetricsPendingCompactionsGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsPendingCompactionsGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsPendingCompactionsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics pending compactions get default response +func (o *ColumnFamilyMetricsPendingCompactionsGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsPendingCompactionsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsPendingCompactionsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsPendingCompactionsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_flushes_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_flushes_by_name_get_parameters.go new file mode 100644 index 0000000000..7f137a313d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_flushes_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsPendingFlushesByNameGetParams creates a new ColumnFamilyMetricsPendingFlushesByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsPendingFlushesByNameGetParams() *ColumnFamilyMetricsPendingFlushesByNameGetParams { + var () + return &ColumnFamilyMetricsPendingFlushesByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsPendingFlushesByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsPendingFlushesByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsPendingFlushesByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsPendingFlushesByNameGetParams { + var () + return &ColumnFamilyMetricsPendingFlushesByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsPendingFlushesByNameGetParamsWithContext creates a new ColumnFamilyMetricsPendingFlushesByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsPendingFlushesByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsPendingFlushesByNameGetParams { + var () + return &ColumnFamilyMetricsPendingFlushesByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsPendingFlushesByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsPendingFlushesByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsPendingFlushesByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsPendingFlushesByNameGetParams { + var () + return &ColumnFamilyMetricsPendingFlushesByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsPendingFlushesByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics pending flushes by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsPendingFlushesByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics pending flushes by name get params +func (o *ColumnFamilyMetricsPendingFlushesByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsPendingFlushesByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics pending flushes by name get params +func (o *ColumnFamilyMetricsPendingFlushesByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics pending flushes by name get params +func (o *ColumnFamilyMetricsPendingFlushesByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsPendingFlushesByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics pending flushes by name get params +func (o *ColumnFamilyMetricsPendingFlushesByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics pending flushes by name get params +func (o *ColumnFamilyMetricsPendingFlushesByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsPendingFlushesByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics pending flushes by name get params +func (o *ColumnFamilyMetricsPendingFlushesByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics pending flushes by name get params +func (o *ColumnFamilyMetricsPendingFlushesByNameGetParams) WithName(name string) *ColumnFamilyMetricsPendingFlushesByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics pending flushes by name get params +func (o *ColumnFamilyMetricsPendingFlushesByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsPendingFlushesByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_flushes_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_flushes_by_name_get_responses.go new file mode 100644 index 0000000000..8e43ed345c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_flushes_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsPendingFlushesByNameGetReader is a Reader for the ColumnFamilyMetricsPendingFlushesByNameGet structure. +type ColumnFamilyMetricsPendingFlushesByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsPendingFlushesByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsPendingFlushesByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsPendingFlushesByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsPendingFlushesByNameGetOK creates a ColumnFamilyMetricsPendingFlushesByNameGetOK with default headers values +func NewColumnFamilyMetricsPendingFlushesByNameGetOK() *ColumnFamilyMetricsPendingFlushesByNameGetOK { + return &ColumnFamilyMetricsPendingFlushesByNameGetOK{} +} + +/* +ColumnFamilyMetricsPendingFlushesByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsPendingFlushesByNameGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsPendingFlushesByNameGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsPendingFlushesByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsPendingFlushesByNameGetDefault creates a ColumnFamilyMetricsPendingFlushesByNameGetDefault with default headers values +func NewColumnFamilyMetricsPendingFlushesByNameGetDefault(code int) *ColumnFamilyMetricsPendingFlushesByNameGetDefault { + return &ColumnFamilyMetricsPendingFlushesByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsPendingFlushesByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsPendingFlushesByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics pending flushes by name get default response +func (o *ColumnFamilyMetricsPendingFlushesByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsPendingFlushesByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsPendingFlushesByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsPendingFlushesByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_flushes_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_flushes_get_parameters.go new file mode 100644 index 0000000000..9b97447634 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_flushes_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsPendingFlushesGetParams creates a new ColumnFamilyMetricsPendingFlushesGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsPendingFlushesGetParams() *ColumnFamilyMetricsPendingFlushesGetParams { + + return &ColumnFamilyMetricsPendingFlushesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsPendingFlushesGetParamsWithTimeout creates a new ColumnFamilyMetricsPendingFlushesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsPendingFlushesGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsPendingFlushesGetParams { + + return &ColumnFamilyMetricsPendingFlushesGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsPendingFlushesGetParamsWithContext creates a new ColumnFamilyMetricsPendingFlushesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsPendingFlushesGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsPendingFlushesGetParams { + + return &ColumnFamilyMetricsPendingFlushesGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsPendingFlushesGetParamsWithHTTPClient creates a new ColumnFamilyMetricsPendingFlushesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsPendingFlushesGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsPendingFlushesGetParams { + + return &ColumnFamilyMetricsPendingFlushesGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsPendingFlushesGetParams contains all the parameters to send to the API endpoint +for the column family metrics pending flushes get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsPendingFlushesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics pending flushes get params +func (o *ColumnFamilyMetricsPendingFlushesGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsPendingFlushesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics pending flushes get params +func (o *ColumnFamilyMetricsPendingFlushesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics pending flushes get params +func (o *ColumnFamilyMetricsPendingFlushesGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsPendingFlushesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics pending flushes get params +func (o *ColumnFamilyMetricsPendingFlushesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics pending flushes get params +func (o *ColumnFamilyMetricsPendingFlushesGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsPendingFlushesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics pending flushes get params +func (o *ColumnFamilyMetricsPendingFlushesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsPendingFlushesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_flushes_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_flushes_get_responses.go new file mode 100644 index 0000000000..fc64f4e04f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_pending_flushes_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsPendingFlushesGetReader is a Reader for the ColumnFamilyMetricsPendingFlushesGet structure. +type ColumnFamilyMetricsPendingFlushesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsPendingFlushesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsPendingFlushesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsPendingFlushesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsPendingFlushesGetOK creates a ColumnFamilyMetricsPendingFlushesGetOK with default headers values +func NewColumnFamilyMetricsPendingFlushesGetOK() *ColumnFamilyMetricsPendingFlushesGetOK { + return &ColumnFamilyMetricsPendingFlushesGetOK{} +} + +/* +ColumnFamilyMetricsPendingFlushesGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsPendingFlushesGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsPendingFlushesGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsPendingFlushesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsPendingFlushesGetDefault creates a ColumnFamilyMetricsPendingFlushesGetDefault with default headers values +func NewColumnFamilyMetricsPendingFlushesGetDefault(code int) *ColumnFamilyMetricsPendingFlushesGetDefault { + return &ColumnFamilyMetricsPendingFlushesGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsPendingFlushesGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsPendingFlushesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics pending flushes get default response +func (o *ColumnFamilyMetricsPendingFlushesGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsPendingFlushesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsPendingFlushesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsPendingFlushesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_by_name_get_parameters.go new file mode 100644 index 0000000000..8fac8b5eeb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsRangeLatencyByNameGetParams creates a new ColumnFamilyMetricsRangeLatencyByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsRangeLatencyByNameGetParams() *ColumnFamilyMetricsRangeLatencyByNameGetParams { + var () + return &ColumnFamilyMetricsRangeLatencyByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsRangeLatencyByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsRangeLatencyByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsRangeLatencyByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsRangeLatencyByNameGetParams { + var () + return &ColumnFamilyMetricsRangeLatencyByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsRangeLatencyByNameGetParamsWithContext creates a new ColumnFamilyMetricsRangeLatencyByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsRangeLatencyByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsRangeLatencyByNameGetParams { + var () + return &ColumnFamilyMetricsRangeLatencyByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsRangeLatencyByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsRangeLatencyByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsRangeLatencyByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsRangeLatencyByNameGetParams { + var () + return &ColumnFamilyMetricsRangeLatencyByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsRangeLatencyByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics range latency by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsRangeLatencyByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics range latency by name get params +func (o *ColumnFamilyMetricsRangeLatencyByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsRangeLatencyByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics range latency by name get params +func (o *ColumnFamilyMetricsRangeLatencyByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics range latency by name get params +func (o *ColumnFamilyMetricsRangeLatencyByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsRangeLatencyByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics range latency by name get params +func (o *ColumnFamilyMetricsRangeLatencyByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics range latency by name get params +func (o *ColumnFamilyMetricsRangeLatencyByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsRangeLatencyByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics range latency by name get params +func (o *ColumnFamilyMetricsRangeLatencyByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics range latency by name get params +func (o *ColumnFamilyMetricsRangeLatencyByNameGetParams) WithName(name string) *ColumnFamilyMetricsRangeLatencyByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics range latency by name get params +func (o *ColumnFamilyMetricsRangeLatencyByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsRangeLatencyByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_by_name_get_responses.go new file mode 100644 index 0000000000..cf6845b209 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsRangeLatencyByNameGetReader is a Reader for the ColumnFamilyMetricsRangeLatencyByNameGet structure. +type ColumnFamilyMetricsRangeLatencyByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsRangeLatencyByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsRangeLatencyByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsRangeLatencyByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsRangeLatencyByNameGetOK creates a ColumnFamilyMetricsRangeLatencyByNameGetOK with default headers values +func NewColumnFamilyMetricsRangeLatencyByNameGetOK() *ColumnFamilyMetricsRangeLatencyByNameGetOK { + return &ColumnFamilyMetricsRangeLatencyByNameGetOK{} +} + +/* +ColumnFamilyMetricsRangeLatencyByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsRangeLatencyByNameGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsRangeLatencyByNameGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsRangeLatencyByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsRangeLatencyByNameGetDefault creates a ColumnFamilyMetricsRangeLatencyByNameGetDefault with default headers values +func NewColumnFamilyMetricsRangeLatencyByNameGetDefault(code int) *ColumnFamilyMetricsRangeLatencyByNameGetDefault { + return &ColumnFamilyMetricsRangeLatencyByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsRangeLatencyByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsRangeLatencyByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics range latency by name get default response +func (o *ColumnFamilyMetricsRangeLatencyByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsRangeLatencyByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsRangeLatencyByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsRangeLatencyByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_estimated_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_estimated_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..d908a041af --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_estimated_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams creates a new ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams() *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics range latency estimated histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics range latency estimated histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics range latency estimated histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics range latency estimated histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics range latency estimated histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics range latency estimated histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics range latency estimated histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics range latency estimated histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics range latency estimated histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_estimated_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_estimated_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..4fa680e25d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_estimated_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGet structure. +type ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetOK creates a ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetOK() *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetOK { + return &ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetDefault creates a ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetDefault(code int) *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetDefault { + return &ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics range latency estimated histogram by name get default response +func (o *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_estimated_recent_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_estimated_recent_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..f2790feec9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_estimated_recent_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams creates a new ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams() *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics range latency estimated recent histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics range latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics range latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics range latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics range latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics range latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics range latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics range latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics range latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_estimated_recent_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_estimated_recent_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..5dcb37c078 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_estimated_recent_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGet structure. +type ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetOK creates a ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetOK() *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetOK { + return &ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetDefault creates a ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetDefault(code int) *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetDefault { + return &ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics range latency estimated recent histogram by name get default response +func (o *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_get_parameters.go new file mode 100644 index 0000000000..5bcb289314 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsRangeLatencyGetParams creates a new ColumnFamilyMetricsRangeLatencyGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsRangeLatencyGetParams() *ColumnFamilyMetricsRangeLatencyGetParams { + + return &ColumnFamilyMetricsRangeLatencyGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsRangeLatencyGetParamsWithTimeout creates a new ColumnFamilyMetricsRangeLatencyGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsRangeLatencyGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsRangeLatencyGetParams { + + return &ColumnFamilyMetricsRangeLatencyGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsRangeLatencyGetParamsWithContext creates a new ColumnFamilyMetricsRangeLatencyGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsRangeLatencyGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsRangeLatencyGetParams { + + return &ColumnFamilyMetricsRangeLatencyGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsRangeLatencyGetParamsWithHTTPClient creates a new ColumnFamilyMetricsRangeLatencyGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsRangeLatencyGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsRangeLatencyGetParams { + + return &ColumnFamilyMetricsRangeLatencyGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsRangeLatencyGetParams contains all the parameters to send to the API endpoint +for the column family metrics range latency get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsRangeLatencyGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics range latency get params +func (o *ColumnFamilyMetricsRangeLatencyGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsRangeLatencyGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics range latency get params +func (o *ColumnFamilyMetricsRangeLatencyGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics range latency get params +func (o *ColumnFamilyMetricsRangeLatencyGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsRangeLatencyGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics range latency get params +func (o *ColumnFamilyMetricsRangeLatencyGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics range latency get params +func (o *ColumnFamilyMetricsRangeLatencyGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsRangeLatencyGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics range latency get params +func (o *ColumnFamilyMetricsRangeLatencyGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsRangeLatencyGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_get_responses.go new file mode 100644 index 0000000000..e17b57dafc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_range_latency_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsRangeLatencyGetReader is a Reader for the ColumnFamilyMetricsRangeLatencyGet structure. +type ColumnFamilyMetricsRangeLatencyGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsRangeLatencyGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsRangeLatencyGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsRangeLatencyGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsRangeLatencyGetOK creates a ColumnFamilyMetricsRangeLatencyGetOK with default headers values +func NewColumnFamilyMetricsRangeLatencyGetOK() *ColumnFamilyMetricsRangeLatencyGetOK { + return &ColumnFamilyMetricsRangeLatencyGetOK{} +} + +/* +ColumnFamilyMetricsRangeLatencyGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsRangeLatencyGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsRangeLatencyGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsRangeLatencyGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsRangeLatencyGetDefault creates a ColumnFamilyMetricsRangeLatencyGetDefault with default headers values +func NewColumnFamilyMetricsRangeLatencyGetDefault(code int) *ColumnFamilyMetricsRangeLatencyGetDefault { + return &ColumnFamilyMetricsRangeLatencyGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsRangeLatencyGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsRangeLatencyGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics range latency get default response +func (o *ColumnFamilyMetricsRangeLatencyGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsRangeLatencyGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsRangeLatencyGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsRangeLatencyGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_by_name_get_parameters.go new file mode 100644 index 0000000000..4e25c6b623 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsReadByNameGetParams creates a new ColumnFamilyMetricsReadByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsReadByNameGetParams() *ColumnFamilyMetricsReadByNameGetParams { + var () + return &ColumnFamilyMetricsReadByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsReadByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsReadByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsReadByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadByNameGetParams { + var () + return &ColumnFamilyMetricsReadByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsReadByNameGetParamsWithContext creates a new ColumnFamilyMetricsReadByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsReadByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsReadByNameGetParams { + var () + return &ColumnFamilyMetricsReadByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsReadByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsReadByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsReadByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadByNameGetParams { + var () + return &ColumnFamilyMetricsReadByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsReadByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics read by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsReadByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics read by name get params +func (o *ColumnFamilyMetricsReadByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics read by name get params +func (o *ColumnFamilyMetricsReadByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics read by name get params +func (o *ColumnFamilyMetricsReadByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsReadByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics read by name get params +func (o *ColumnFamilyMetricsReadByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics read by name get params +func (o *ColumnFamilyMetricsReadByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics read by name get params +func (o *ColumnFamilyMetricsReadByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics read by name get params +func (o *ColumnFamilyMetricsReadByNameGetParams) WithName(name string) *ColumnFamilyMetricsReadByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics read by name get params +func (o *ColumnFamilyMetricsReadByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsReadByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_by_name_get_responses.go new file mode 100644 index 0000000000..c4bfe8a2c9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsReadByNameGetReader is a Reader for the ColumnFamilyMetricsReadByNameGet structure. +type ColumnFamilyMetricsReadByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsReadByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsReadByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsReadByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsReadByNameGetOK creates a ColumnFamilyMetricsReadByNameGetOK with default headers values +func NewColumnFamilyMetricsReadByNameGetOK() *ColumnFamilyMetricsReadByNameGetOK { + return &ColumnFamilyMetricsReadByNameGetOK{} +} + +/* +ColumnFamilyMetricsReadByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsReadByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsReadByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsReadByNameGetDefault creates a ColumnFamilyMetricsReadByNameGetDefault with default headers values +func NewColumnFamilyMetricsReadByNameGetDefault(code int) *ColumnFamilyMetricsReadByNameGetDefault { + return &ColumnFamilyMetricsReadByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsReadByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsReadByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics read by name get default response +func (o *ColumnFamilyMetricsReadByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsReadByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsReadByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_get_parameters.go new file mode 100644 index 0000000000..1a542f7290 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsReadGetParams creates a new ColumnFamilyMetricsReadGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsReadGetParams() *ColumnFamilyMetricsReadGetParams { + + return &ColumnFamilyMetricsReadGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsReadGetParamsWithTimeout creates a new ColumnFamilyMetricsReadGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsReadGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadGetParams { + + return &ColumnFamilyMetricsReadGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsReadGetParamsWithContext creates a new ColumnFamilyMetricsReadGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsReadGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsReadGetParams { + + return &ColumnFamilyMetricsReadGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsReadGetParamsWithHTTPClient creates a new ColumnFamilyMetricsReadGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsReadGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadGetParams { + + return &ColumnFamilyMetricsReadGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsReadGetParams contains all the parameters to send to the API endpoint +for the column family metrics read get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsReadGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics read get params +func (o *ColumnFamilyMetricsReadGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics read get params +func (o *ColumnFamilyMetricsReadGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics read get params +func (o *ColumnFamilyMetricsReadGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsReadGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics read get params +func (o *ColumnFamilyMetricsReadGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics read get params +func (o *ColumnFamilyMetricsReadGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics read get params +func (o *ColumnFamilyMetricsReadGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsReadGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_get_responses.go new file mode 100644 index 0000000000..269033bb5f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsReadGetReader is a Reader for the ColumnFamilyMetricsReadGet structure. +type ColumnFamilyMetricsReadGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsReadGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsReadGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsReadGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsReadGetOK creates a ColumnFamilyMetricsReadGetOK with default headers values +func NewColumnFamilyMetricsReadGetOK() *ColumnFamilyMetricsReadGetOK { + return &ColumnFamilyMetricsReadGetOK{} +} + +/* +ColumnFamilyMetricsReadGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsReadGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsReadGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsReadGetDefault creates a ColumnFamilyMetricsReadGetDefault with default headers values +func NewColumnFamilyMetricsReadGetDefault(code int) *ColumnFamilyMetricsReadGetDefault { + return &ColumnFamilyMetricsReadGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsReadGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsReadGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics read get default response +func (o *ColumnFamilyMetricsReadGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsReadGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsReadGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_by_name_get_parameters.go new file mode 100644 index 0000000000..a41cb8b68b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsReadLatencyByNameGetParams creates a new ColumnFamilyMetricsReadLatencyByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsReadLatencyByNameGetParams() *ColumnFamilyMetricsReadLatencyByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsReadLatencyByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsReadLatencyByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsReadLatencyByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsReadLatencyByNameGetParamsWithContext creates a new ColumnFamilyMetricsReadLatencyByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsReadLatencyByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsReadLatencyByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsReadLatencyByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsReadLatencyByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsReadLatencyByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics read latency by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsReadLatencyByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics read latency by name get params +func (o *ColumnFamilyMetricsReadLatencyByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics read latency by name get params +func (o *ColumnFamilyMetricsReadLatencyByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics read latency by name get params +func (o *ColumnFamilyMetricsReadLatencyByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics read latency by name get params +func (o *ColumnFamilyMetricsReadLatencyByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics read latency by name get params +func (o *ColumnFamilyMetricsReadLatencyByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics read latency by name get params +func (o *ColumnFamilyMetricsReadLatencyByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics read latency by name get params +func (o *ColumnFamilyMetricsReadLatencyByNameGetParams) WithName(name string) *ColumnFamilyMetricsReadLatencyByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics read latency by name get params +func (o *ColumnFamilyMetricsReadLatencyByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsReadLatencyByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_by_name_get_responses.go new file mode 100644 index 0000000000..ed5703e546 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsReadLatencyByNameGetReader is a Reader for the ColumnFamilyMetricsReadLatencyByNameGet structure. +type ColumnFamilyMetricsReadLatencyByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsReadLatencyByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsReadLatencyByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsReadLatencyByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsReadLatencyByNameGetOK creates a ColumnFamilyMetricsReadLatencyByNameGetOK with default headers values +func NewColumnFamilyMetricsReadLatencyByNameGetOK() *ColumnFamilyMetricsReadLatencyByNameGetOK { + return &ColumnFamilyMetricsReadLatencyByNameGetOK{} +} + +/* +ColumnFamilyMetricsReadLatencyByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsReadLatencyByNameGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsReadLatencyByNameGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadLatencyByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsReadLatencyByNameGetDefault creates a ColumnFamilyMetricsReadLatencyByNameGetDefault with default headers values +func NewColumnFamilyMetricsReadLatencyByNameGetDefault(code int) *ColumnFamilyMetricsReadLatencyByNameGetDefault { + return &ColumnFamilyMetricsReadLatencyByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsReadLatencyByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsReadLatencyByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics read latency by name get default response +func (o *ColumnFamilyMetricsReadLatencyByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsReadLatencyByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadLatencyByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsReadLatencyByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_estimated_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_estimated_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..57ad249ddd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_estimated_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams creates a new ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams() *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics read latency estimated histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics read latency estimated histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics read latency estimated histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics read latency estimated histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics read latency estimated histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics read latency estimated histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics read latency estimated histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics read latency estimated histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics read latency estimated histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_estimated_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_estimated_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..0b0e791fea --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_estimated_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGet structure. +type ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetOK creates a ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetOK() *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetOK { + return &ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetDefault creates a ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetDefault(code int) *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetDefault { + return &ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics read latency estimated histogram by name get default response +func (o *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_estimated_recent_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_estimated_recent_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..032a1938da --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_estimated_recent_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams creates a new ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams() *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics read latency estimated recent histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics read latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics read latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics read latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics read latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics read latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics read latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics read latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics read latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_estimated_recent_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_estimated_recent_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..4fbabd461a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_estimated_recent_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGet structure. +type ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetOK creates a ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetOK() *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetOK { + return &ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetDefault creates a ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetDefault(code int) *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetDefault { + return &ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics read latency estimated recent histogram by name get default response +func (o *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_get_parameters.go new file mode 100644 index 0000000000..b247af889b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsReadLatencyGetParams creates a new ColumnFamilyMetricsReadLatencyGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsReadLatencyGetParams() *ColumnFamilyMetricsReadLatencyGetParams { + + return &ColumnFamilyMetricsReadLatencyGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsReadLatencyGetParamsWithTimeout creates a new ColumnFamilyMetricsReadLatencyGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsReadLatencyGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyGetParams { + + return &ColumnFamilyMetricsReadLatencyGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsReadLatencyGetParamsWithContext creates a new ColumnFamilyMetricsReadLatencyGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsReadLatencyGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyGetParams { + + return &ColumnFamilyMetricsReadLatencyGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsReadLatencyGetParamsWithHTTPClient creates a new ColumnFamilyMetricsReadLatencyGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsReadLatencyGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyGetParams { + + return &ColumnFamilyMetricsReadLatencyGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsReadLatencyGetParams contains all the parameters to send to the API endpoint +for the column family metrics read latency get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsReadLatencyGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics read latency get params +func (o *ColumnFamilyMetricsReadLatencyGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics read latency get params +func (o *ColumnFamilyMetricsReadLatencyGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics read latency get params +func (o *ColumnFamilyMetricsReadLatencyGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics read latency get params +func (o *ColumnFamilyMetricsReadLatencyGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics read latency get params +func (o *ColumnFamilyMetricsReadLatencyGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics read latency get params +func (o *ColumnFamilyMetricsReadLatencyGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsReadLatencyGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_get_responses.go new file mode 100644 index 0000000000..82aa36cb47 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsReadLatencyGetReader is a Reader for the ColumnFamilyMetricsReadLatencyGet structure. +type ColumnFamilyMetricsReadLatencyGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsReadLatencyGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsReadLatencyGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsReadLatencyGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsReadLatencyGetOK creates a ColumnFamilyMetricsReadLatencyGetOK with default headers values +func NewColumnFamilyMetricsReadLatencyGetOK() *ColumnFamilyMetricsReadLatencyGetOK { + return &ColumnFamilyMetricsReadLatencyGetOK{} +} + +/* +ColumnFamilyMetricsReadLatencyGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsReadLatencyGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsReadLatencyGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadLatencyGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsReadLatencyGetDefault creates a ColumnFamilyMetricsReadLatencyGetDefault with default headers values +func NewColumnFamilyMetricsReadLatencyGetDefault(code int) *ColumnFamilyMetricsReadLatencyGetDefault { + return &ColumnFamilyMetricsReadLatencyGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsReadLatencyGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsReadLatencyGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics read latency get default response +func (o *ColumnFamilyMetricsReadLatencyGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsReadLatencyGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadLatencyGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsReadLatencyGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..de88f7cdc2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsReadLatencyHistogramByNameGetParams creates a new ColumnFamilyMetricsReadLatencyHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsReadLatencyHistogramByNameGetParams() *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsReadLatencyHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsReadLatencyHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsReadLatencyHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsReadLatencyHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsReadLatencyHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsReadLatencyHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsReadLatencyHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsReadLatencyHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsReadLatencyHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsReadLatencyHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics read latency histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsReadLatencyHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics read latency histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics read latency histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics read latency histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics read latency histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics read latency histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics read latency histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics read latency histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics read latency histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..815c3f90eb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsReadLatencyHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsReadLatencyHistogramByNameGet structure. +type ColumnFamilyMetricsReadLatencyHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsReadLatencyHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsReadLatencyHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsReadLatencyHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsReadLatencyHistogramByNameGetOK creates a ColumnFamilyMetricsReadLatencyHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsReadLatencyHistogramByNameGetOK() *ColumnFamilyMetricsReadLatencyHistogramByNameGetOK { + return &ColumnFamilyMetricsReadLatencyHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsReadLatencyHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsReadLatencyHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsReadLatencyHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsReadLatencyHistogramByNameGetDefault creates a ColumnFamilyMetricsReadLatencyHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsReadLatencyHistogramByNameGetDefault(code int) *ColumnFamilyMetricsReadLatencyHistogramByNameGetDefault { + return &ColumnFamilyMetricsReadLatencyHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsReadLatencyHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsReadLatencyHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics read latency histogram by name get default response +func (o *ColumnFamilyMetricsReadLatencyHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsReadLatencyHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadLatencyHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsReadLatencyHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_histogram_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_histogram_get_parameters.go new file mode 100644 index 0000000000..5f8cb38dfb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_histogram_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsReadLatencyHistogramGetParams creates a new ColumnFamilyMetricsReadLatencyHistogramGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsReadLatencyHistogramGetParams() *ColumnFamilyMetricsReadLatencyHistogramGetParams { + + return &ColumnFamilyMetricsReadLatencyHistogramGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsReadLatencyHistogramGetParamsWithTimeout creates a new ColumnFamilyMetricsReadLatencyHistogramGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsReadLatencyHistogramGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyHistogramGetParams { + + return &ColumnFamilyMetricsReadLatencyHistogramGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsReadLatencyHistogramGetParamsWithContext creates a new ColumnFamilyMetricsReadLatencyHistogramGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsReadLatencyHistogramGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyHistogramGetParams { + + return &ColumnFamilyMetricsReadLatencyHistogramGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsReadLatencyHistogramGetParamsWithHTTPClient creates a new ColumnFamilyMetricsReadLatencyHistogramGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsReadLatencyHistogramGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyHistogramGetParams { + + return &ColumnFamilyMetricsReadLatencyHistogramGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsReadLatencyHistogramGetParams contains all the parameters to send to the API endpoint +for the column family metrics read latency histogram get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsReadLatencyHistogramGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics read latency histogram get params +func (o *ColumnFamilyMetricsReadLatencyHistogramGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyHistogramGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics read latency histogram get params +func (o *ColumnFamilyMetricsReadLatencyHistogramGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics read latency histogram get params +func (o *ColumnFamilyMetricsReadLatencyHistogramGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyHistogramGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics read latency histogram get params +func (o *ColumnFamilyMetricsReadLatencyHistogramGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics read latency histogram get params +func (o *ColumnFamilyMetricsReadLatencyHistogramGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyHistogramGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics read latency histogram get params +func (o *ColumnFamilyMetricsReadLatencyHistogramGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsReadLatencyHistogramGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_histogram_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_histogram_get_responses.go new file mode 100644 index 0000000000..8c7aa1b94c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_histogram_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsReadLatencyHistogramGetReader is a Reader for the ColumnFamilyMetricsReadLatencyHistogramGet structure. +type ColumnFamilyMetricsReadLatencyHistogramGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsReadLatencyHistogramGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsReadLatencyHistogramGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsReadLatencyHistogramGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsReadLatencyHistogramGetOK creates a ColumnFamilyMetricsReadLatencyHistogramGetOK with default headers values +func NewColumnFamilyMetricsReadLatencyHistogramGetOK() *ColumnFamilyMetricsReadLatencyHistogramGetOK { + return &ColumnFamilyMetricsReadLatencyHistogramGetOK{} +} + +/* +ColumnFamilyMetricsReadLatencyHistogramGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsReadLatencyHistogramGetOK struct { + Payload []*models.Histogram +} + +func (o *ColumnFamilyMetricsReadLatencyHistogramGetOK) GetPayload() []*models.Histogram { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadLatencyHistogramGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsReadLatencyHistogramGetDefault creates a ColumnFamilyMetricsReadLatencyHistogramGetDefault with default headers values +func NewColumnFamilyMetricsReadLatencyHistogramGetDefault(code int) *ColumnFamilyMetricsReadLatencyHistogramGetDefault { + return &ColumnFamilyMetricsReadLatencyHistogramGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsReadLatencyHistogramGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsReadLatencyHistogramGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics read latency histogram get default response +func (o *ColumnFamilyMetricsReadLatencyHistogramGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsReadLatencyHistogramGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadLatencyHistogramGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsReadLatencyHistogramGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_moving_average_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_moving_average_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..a9090f1a98 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_moving_average_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams creates a new ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams() *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics read latency moving average histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics read latency moving average histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics read latency moving average histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics read latency moving average histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics read latency moving average histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics read latency moving average histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics read latency moving average histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics read latency moving average histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics read latency moving average histogram by name get params +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_moving_average_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_moving_average_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..645a9b896f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_moving_average_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGet structure. +type ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetOK creates a ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetOK() *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetOK { + return &ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetDefault creates a ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetDefault(code int) *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetDefault { + return &ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics read latency moving average histogram by name get default response +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_moving_average_histogram_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_moving_average_histogram_get_parameters.go new file mode 100644 index 0000000000..611e30134b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_moving_average_histogram_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams creates a new ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams() *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams { + + return &ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParamsWithTimeout creates a new ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams { + + return &ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParamsWithContext creates a new ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams { + + return &ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParamsWithHTTPClient creates a new ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams { + + return &ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams contains all the parameters to send to the API endpoint +for the column family metrics read latency moving average histogram get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics read latency moving average histogram get params +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics read latency moving average histogram get params +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics read latency moving average histogram get params +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics read latency moving average histogram get params +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics read latency moving average histogram get params +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics read latency moving average histogram get params +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_moving_average_histogram_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_moving_average_histogram_get_responses.go new file mode 100644 index 0000000000..7a1062fa43 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_read_latency_moving_average_histogram_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetReader is a Reader for the ColumnFamilyMetricsReadLatencyMovingAverageHistogramGet structure. +type ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsReadLatencyMovingAverageHistogramGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsReadLatencyMovingAverageHistogramGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsReadLatencyMovingAverageHistogramGetOK creates a ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetOK with default headers values +func NewColumnFamilyMetricsReadLatencyMovingAverageHistogramGetOK() *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetOK { + return &ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetOK{} +} + +/* +ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetOK struct { + Payload []*models.RateMovingAverageAndHistogram +} + +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetOK) GetPayload() []*models.RateMovingAverageAndHistogram { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsReadLatencyMovingAverageHistogramGetDefault creates a ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetDefault with default headers values +func NewColumnFamilyMetricsReadLatencyMovingAverageHistogramGetDefault(code int) *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetDefault { + return &ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics read latency moving average histogram get default response +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_positives_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_positives_by_name_get_parameters.go new file mode 100644 index 0000000000..0c3d32eba7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_positives_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams creates a new ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams() *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams { + var () + return &ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams { + var () + return &ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParamsWithContext creates a new ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams { + var () + return &ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams { + var () + return &ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics recent bloom filter false positives by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics recent bloom filter false positives by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics recent bloom filter false positives by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics recent bloom filter false positives by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics recent bloom filter false positives by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics recent bloom filter false positives by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics recent bloom filter false positives by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics recent bloom filter false positives by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams) WithName(name string) *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics recent bloom filter false positives by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_positives_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_positives_by_name_get_responses.go new file mode 100644 index 0000000000..1fdae9bad4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_positives_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetReader is a Reader for the ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGet structure. +type ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetOK creates a ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetOK with default headers values +func NewColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetOK() *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetOK { + return &ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetOK{} +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetDefault creates a ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetDefault with default headers values +func NewColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetDefault(code int) *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetDefault { + return &ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics recent bloom filter false positives by name get default response +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_positives_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_positives_get_parameters.go new file mode 100644 index 0000000000..f9b63b0ddc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_positives_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams creates a new ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams() *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams { + + return &ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParamsWithTimeout creates a new ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams { + + return &ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParamsWithContext creates a new ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams { + + return &ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParamsWithHTTPClient creates a new ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams { + + return &ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams contains all the parameters to send to the API endpoint +for the column family metrics recent bloom filter false positives get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics recent bloom filter false positives get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics recent bloom filter false positives get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics recent bloom filter false positives get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics recent bloom filter false positives get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics recent bloom filter false positives get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics recent bloom filter false positives get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_positives_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_positives_get_responses.go new file mode 100644 index 0000000000..6005248b1d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_positives_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetReader is a Reader for the ColumnFamilyMetricsRecentBloomFilterFalsePositivesGet structure. +type ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsRecentBloomFilterFalsePositivesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsRecentBloomFilterFalsePositivesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalsePositivesGetOK creates a ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetOK with default headers values +func NewColumnFamilyMetricsRecentBloomFilterFalsePositivesGetOK() *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetOK { + return &ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetOK{} +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsRecentBloomFilterFalsePositivesGetDefault creates a ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetDefault with default headers values +func NewColumnFamilyMetricsRecentBloomFilterFalsePositivesGetDefault(code int) *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetDefault { + return &ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics recent bloom filter false positives get default response +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_ratio_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_ratio_by_name_get_parameters.go new file mode 100644 index 0000000000..9762e1daaf --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_ratio_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams creates a new ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams() *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams { + var () + return &ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams { + var () + return &ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParamsWithContext creates a new ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams { + var () + return &ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams { + var () + return &ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics recent bloom filter false ratio by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics recent bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics recent bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics recent bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics recent bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics recent bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics recent bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics recent bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams) WithName(name string) *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics recent bloom filter false ratio by name get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_ratio_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_ratio_by_name_get_responses.go new file mode 100644 index 0000000000..b84165a560 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_ratio_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetReader is a Reader for the ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGet structure. +type ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetOK creates a ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetOK with default headers values +func NewColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetOK() *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetOK { + return &ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetOK{} +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetDefault creates a ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetDefault with default headers values +func NewColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetDefault(code int) *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetDefault { + return &ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics recent bloom filter false ratio by name get default response +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_ratio_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_ratio_get_parameters.go new file mode 100644 index 0000000000..3410082b5f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_ratio_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams creates a new ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams() *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams { + + return &ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalseRatioGetParamsWithTimeout creates a new ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsRecentBloomFilterFalseRatioGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams { + + return &ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalseRatioGetParamsWithContext creates a new ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsRecentBloomFilterFalseRatioGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams { + + return &ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalseRatioGetParamsWithHTTPClient creates a new ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsRecentBloomFilterFalseRatioGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams { + + return &ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams contains all the parameters to send to the API endpoint +for the column family metrics recent bloom filter false ratio get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics recent bloom filter false ratio get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics recent bloom filter false ratio get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics recent bloom filter false ratio get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics recent bloom filter false ratio get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics recent bloom filter false ratio get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics recent bloom filter false ratio get params +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_ratio_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_ratio_get_responses.go new file mode 100644 index 0000000000..7d0faf4bc5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_recent_bloom_filter_false_ratio_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsRecentBloomFilterFalseRatioGetReader is a Reader for the ColumnFamilyMetricsRecentBloomFilterFalseRatioGet structure. +type ColumnFamilyMetricsRecentBloomFilterFalseRatioGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsRecentBloomFilterFalseRatioGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsRecentBloomFilterFalseRatioGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsRecentBloomFilterFalseRatioGetOK creates a ColumnFamilyMetricsRecentBloomFilterFalseRatioGetOK with default headers values +func NewColumnFamilyMetricsRecentBloomFilterFalseRatioGetOK() *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetOK { + return &ColumnFamilyMetricsRecentBloomFilterFalseRatioGetOK{} +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalseRatioGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsRecentBloomFilterFalseRatioGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsRecentBloomFilterFalseRatioGetDefault creates a ColumnFamilyMetricsRecentBloomFilterFalseRatioGetDefault with default headers values +func NewColumnFamilyMetricsRecentBloomFilterFalseRatioGetDefault(code int) *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetDefault { + return &ColumnFamilyMetricsRecentBloomFilterFalseRatioGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalseRatioGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsRecentBloomFilterFalseRatioGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics recent bloom filter false ratio get default response +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_by_name_get_parameters.go new file mode 100644 index 0000000000..852178cc78 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsRowCacheHitByNameGetParams creates a new ColumnFamilyMetricsRowCacheHitByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsRowCacheHitByNameGetParams() *ColumnFamilyMetricsRowCacheHitByNameGetParams { + var () + return &ColumnFamilyMetricsRowCacheHitByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsRowCacheHitByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsRowCacheHitByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsRowCacheHitByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsRowCacheHitByNameGetParams { + var () + return &ColumnFamilyMetricsRowCacheHitByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsRowCacheHitByNameGetParamsWithContext creates a new ColumnFamilyMetricsRowCacheHitByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsRowCacheHitByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsRowCacheHitByNameGetParams { + var () + return &ColumnFamilyMetricsRowCacheHitByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsRowCacheHitByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsRowCacheHitByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsRowCacheHitByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsRowCacheHitByNameGetParams { + var () + return &ColumnFamilyMetricsRowCacheHitByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsRowCacheHitByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics row cache hit by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsRowCacheHitByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics row cache hit by name get params +func (o *ColumnFamilyMetricsRowCacheHitByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsRowCacheHitByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics row cache hit by name get params +func (o *ColumnFamilyMetricsRowCacheHitByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics row cache hit by name get params +func (o *ColumnFamilyMetricsRowCacheHitByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsRowCacheHitByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics row cache hit by name get params +func (o *ColumnFamilyMetricsRowCacheHitByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics row cache hit by name get params +func (o *ColumnFamilyMetricsRowCacheHitByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsRowCacheHitByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics row cache hit by name get params +func (o *ColumnFamilyMetricsRowCacheHitByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics row cache hit by name get params +func (o *ColumnFamilyMetricsRowCacheHitByNameGetParams) WithName(name string) *ColumnFamilyMetricsRowCacheHitByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics row cache hit by name get params +func (o *ColumnFamilyMetricsRowCacheHitByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsRowCacheHitByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_by_name_get_responses.go new file mode 100644 index 0000000000..aee068b9da --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsRowCacheHitByNameGetReader is a Reader for the ColumnFamilyMetricsRowCacheHitByNameGet structure. +type ColumnFamilyMetricsRowCacheHitByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsRowCacheHitByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsRowCacheHitByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsRowCacheHitByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsRowCacheHitByNameGetOK creates a ColumnFamilyMetricsRowCacheHitByNameGetOK with default headers values +func NewColumnFamilyMetricsRowCacheHitByNameGetOK() *ColumnFamilyMetricsRowCacheHitByNameGetOK { + return &ColumnFamilyMetricsRowCacheHitByNameGetOK{} +} + +/* +ColumnFamilyMetricsRowCacheHitByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsRowCacheHitByNameGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsRowCacheHitByNameGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsRowCacheHitByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsRowCacheHitByNameGetDefault creates a ColumnFamilyMetricsRowCacheHitByNameGetDefault with default headers values +func NewColumnFamilyMetricsRowCacheHitByNameGetDefault(code int) *ColumnFamilyMetricsRowCacheHitByNameGetDefault { + return &ColumnFamilyMetricsRowCacheHitByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsRowCacheHitByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsRowCacheHitByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics row cache hit by name get default response +func (o *ColumnFamilyMetricsRowCacheHitByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsRowCacheHitByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsRowCacheHitByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsRowCacheHitByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_get_parameters.go new file mode 100644 index 0000000000..d1287d9a31 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsRowCacheHitGetParams creates a new ColumnFamilyMetricsRowCacheHitGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsRowCacheHitGetParams() *ColumnFamilyMetricsRowCacheHitGetParams { + + return &ColumnFamilyMetricsRowCacheHitGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsRowCacheHitGetParamsWithTimeout creates a new ColumnFamilyMetricsRowCacheHitGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsRowCacheHitGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsRowCacheHitGetParams { + + return &ColumnFamilyMetricsRowCacheHitGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsRowCacheHitGetParamsWithContext creates a new ColumnFamilyMetricsRowCacheHitGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsRowCacheHitGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsRowCacheHitGetParams { + + return &ColumnFamilyMetricsRowCacheHitGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsRowCacheHitGetParamsWithHTTPClient creates a new ColumnFamilyMetricsRowCacheHitGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsRowCacheHitGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsRowCacheHitGetParams { + + return &ColumnFamilyMetricsRowCacheHitGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsRowCacheHitGetParams contains all the parameters to send to the API endpoint +for the column family metrics row cache hit get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsRowCacheHitGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics row cache hit get params +func (o *ColumnFamilyMetricsRowCacheHitGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsRowCacheHitGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics row cache hit get params +func (o *ColumnFamilyMetricsRowCacheHitGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics row cache hit get params +func (o *ColumnFamilyMetricsRowCacheHitGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsRowCacheHitGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics row cache hit get params +func (o *ColumnFamilyMetricsRowCacheHitGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics row cache hit get params +func (o *ColumnFamilyMetricsRowCacheHitGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsRowCacheHitGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics row cache hit get params +func (o *ColumnFamilyMetricsRowCacheHitGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsRowCacheHitGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_get_responses.go new file mode 100644 index 0000000000..edf71b2399 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsRowCacheHitGetReader is a Reader for the ColumnFamilyMetricsRowCacheHitGet structure. +type ColumnFamilyMetricsRowCacheHitGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsRowCacheHitGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsRowCacheHitGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsRowCacheHitGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsRowCacheHitGetOK creates a ColumnFamilyMetricsRowCacheHitGetOK with default headers values +func NewColumnFamilyMetricsRowCacheHitGetOK() *ColumnFamilyMetricsRowCacheHitGetOK { + return &ColumnFamilyMetricsRowCacheHitGetOK{} +} + +/* +ColumnFamilyMetricsRowCacheHitGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsRowCacheHitGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsRowCacheHitGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsRowCacheHitGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsRowCacheHitGetDefault creates a ColumnFamilyMetricsRowCacheHitGetDefault with default headers values +func NewColumnFamilyMetricsRowCacheHitGetDefault(code int) *ColumnFamilyMetricsRowCacheHitGetDefault { + return &ColumnFamilyMetricsRowCacheHitGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsRowCacheHitGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsRowCacheHitGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics row cache hit get default response +func (o *ColumnFamilyMetricsRowCacheHitGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsRowCacheHitGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsRowCacheHitGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsRowCacheHitGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_out_of_range_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_out_of_range_by_name_get_parameters.go new file mode 100644 index 0000000000..66bff9e5d1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_out_of_range_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams creates a new ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams() *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams { + var () + return &ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams { + var () + return &ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParamsWithContext creates a new ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams { + var () + return &ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams { + var () + return &ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics row cache hit out of range by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics row cache hit out of range by name get params +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics row cache hit out of range by name get params +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics row cache hit out of range by name get params +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics row cache hit out of range by name get params +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics row cache hit out of range by name get params +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics row cache hit out of range by name get params +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics row cache hit out of range by name get params +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams) WithName(name string) *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics row cache hit out of range by name get params +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_out_of_range_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_out_of_range_by_name_get_responses.go new file mode 100644 index 0000000000..3eb8d5b96b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_out_of_range_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetReader is a Reader for the ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGet structure. +type ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetOK creates a ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetOK with default headers values +func NewColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetOK() *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetOK { + return &ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetOK{} +} + +/* +ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetDefault creates a ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetDefault with default headers values +func NewColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetDefault(code int) *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetDefault { + return &ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics row cache hit out of range by name get default response +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_out_of_range_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_out_of_range_get_parameters.go new file mode 100644 index 0000000000..f0d4c6517d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_out_of_range_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsRowCacheHitOutOfRangeGetParams creates a new ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsRowCacheHitOutOfRangeGetParams() *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams { + + return &ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsRowCacheHitOutOfRangeGetParamsWithTimeout creates a new ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsRowCacheHitOutOfRangeGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams { + + return &ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsRowCacheHitOutOfRangeGetParamsWithContext creates a new ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsRowCacheHitOutOfRangeGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams { + + return &ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsRowCacheHitOutOfRangeGetParamsWithHTTPClient creates a new ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsRowCacheHitOutOfRangeGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams { + + return &ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams contains all the parameters to send to the API endpoint +for the column family metrics row cache hit out of range get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics row cache hit out of range get params +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics row cache hit out of range get params +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics row cache hit out of range get params +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics row cache hit out of range get params +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics row cache hit out of range get params +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics row cache hit out of range get params +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_out_of_range_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_out_of_range_get_responses.go new file mode 100644 index 0000000000..a5ae7ed79c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_hit_out_of_range_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsRowCacheHitOutOfRangeGetReader is a Reader for the ColumnFamilyMetricsRowCacheHitOutOfRangeGet structure. +type ColumnFamilyMetricsRowCacheHitOutOfRangeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsRowCacheHitOutOfRangeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsRowCacheHitOutOfRangeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsRowCacheHitOutOfRangeGetOK creates a ColumnFamilyMetricsRowCacheHitOutOfRangeGetOK with default headers values +func NewColumnFamilyMetricsRowCacheHitOutOfRangeGetOK() *ColumnFamilyMetricsRowCacheHitOutOfRangeGetOK { + return &ColumnFamilyMetricsRowCacheHitOutOfRangeGetOK{} +} + +/* +ColumnFamilyMetricsRowCacheHitOutOfRangeGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsRowCacheHitOutOfRangeGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsRowCacheHitOutOfRangeGetDefault creates a ColumnFamilyMetricsRowCacheHitOutOfRangeGetDefault with default headers values +func NewColumnFamilyMetricsRowCacheHitOutOfRangeGetDefault(code int) *ColumnFamilyMetricsRowCacheHitOutOfRangeGetDefault { + return &ColumnFamilyMetricsRowCacheHitOutOfRangeGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsRowCacheHitOutOfRangeGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsRowCacheHitOutOfRangeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics row cache hit out of range get default response +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsRowCacheHitOutOfRangeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_miss_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_miss_by_name_get_parameters.go new file mode 100644 index 0000000000..122c2dd848 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_miss_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsRowCacheMissByNameGetParams creates a new ColumnFamilyMetricsRowCacheMissByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsRowCacheMissByNameGetParams() *ColumnFamilyMetricsRowCacheMissByNameGetParams { + var () + return &ColumnFamilyMetricsRowCacheMissByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsRowCacheMissByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsRowCacheMissByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsRowCacheMissByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsRowCacheMissByNameGetParams { + var () + return &ColumnFamilyMetricsRowCacheMissByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsRowCacheMissByNameGetParamsWithContext creates a new ColumnFamilyMetricsRowCacheMissByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsRowCacheMissByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsRowCacheMissByNameGetParams { + var () + return &ColumnFamilyMetricsRowCacheMissByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsRowCacheMissByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsRowCacheMissByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsRowCacheMissByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsRowCacheMissByNameGetParams { + var () + return &ColumnFamilyMetricsRowCacheMissByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsRowCacheMissByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics row cache miss by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsRowCacheMissByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics row cache miss by name get params +func (o *ColumnFamilyMetricsRowCacheMissByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsRowCacheMissByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics row cache miss by name get params +func (o *ColumnFamilyMetricsRowCacheMissByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics row cache miss by name get params +func (o *ColumnFamilyMetricsRowCacheMissByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsRowCacheMissByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics row cache miss by name get params +func (o *ColumnFamilyMetricsRowCacheMissByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics row cache miss by name get params +func (o *ColumnFamilyMetricsRowCacheMissByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsRowCacheMissByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics row cache miss by name get params +func (o *ColumnFamilyMetricsRowCacheMissByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics row cache miss by name get params +func (o *ColumnFamilyMetricsRowCacheMissByNameGetParams) WithName(name string) *ColumnFamilyMetricsRowCacheMissByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics row cache miss by name get params +func (o *ColumnFamilyMetricsRowCacheMissByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsRowCacheMissByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_miss_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_miss_by_name_get_responses.go new file mode 100644 index 0000000000..cc192fd2d0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_miss_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsRowCacheMissByNameGetReader is a Reader for the ColumnFamilyMetricsRowCacheMissByNameGet structure. +type ColumnFamilyMetricsRowCacheMissByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsRowCacheMissByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsRowCacheMissByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsRowCacheMissByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsRowCacheMissByNameGetOK creates a ColumnFamilyMetricsRowCacheMissByNameGetOK with default headers values +func NewColumnFamilyMetricsRowCacheMissByNameGetOK() *ColumnFamilyMetricsRowCacheMissByNameGetOK { + return &ColumnFamilyMetricsRowCacheMissByNameGetOK{} +} + +/* +ColumnFamilyMetricsRowCacheMissByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsRowCacheMissByNameGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsRowCacheMissByNameGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsRowCacheMissByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsRowCacheMissByNameGetDefault creates a ColumnFamilyMetricsRowCacheMissByNameGetDefault with default headers values +func NewColumnFamilyMetricsRowCacheMissByNameGetDefault(code int) *ColumnFamilyMetricsRowCacheMissByNameGetDefault { + return &ColumnFamilyMetricsRowCacheMissByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsRowCacheMissByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsRowCacheMissByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics row cache miss by name get default response +func (o *ColumnFamilyMetricsRowCacheMissByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsRowCacheMissByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsRowCacheMissByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsRowCacheMissByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_miss_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_miss_get_parameters.go new file mode 100644 index 0000000000..44f3e79262 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_miss_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsRowCacheMissGetParams creates a new ColumnFamilyMetricsRowCacheMissGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsRowCacheMissGetParams() *ColumnFamilyMetricsRowCacheMissGetParams { + + return &ColumnFamilyMetricsRowCacheMissGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsRowCacheMissGetParamsWithTimeout creates a new ColumnFamilyMetricsRowCacheMissGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsRowCacheMissGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsRowCacheMissGetParams { + + return &ColumnFamilyMetricsRowCacheMissGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsRowCacheMissGetParamsWithContext creates a new ColumnFamilyMetricsRowCacheMissGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsRowCacheMissGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsRowCacheMissGetParams { + + return &ColumnFamilyMetricsRowCacheMissGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsRowCacheMissGetParamsWithHTTPClient creates a new ColumnFamilyMetricsRowCacheMissGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsRowCacheMissGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsRowCacheMissGetParams { + + return &ColumnFamilyMetricsRowCacheMissGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsRowCacheMissGetParams contains all the parameters to send to the API endpoint +for the column family metrics row cache miss get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsRowCacheMissGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics row cache miss get params +func (o *ColumnFamilyMetricsRowCacheMissGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsRowCacheMissGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics row cache miss get params +func (o *ColumnFamilyMetricsRowCacheMissGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics row cache miss get params +func (o *ColumnFamilyMetricsRowCacheMissGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsRowCacheMissGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics row cache miss get params +func (o *ColumnFamilyMetricsRowCacheMissGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics row cache miss get params +func (o *ColumnFamilyMetricsRowCacheMissGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsRowCacheMissGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics row cache miss get params +func (o *ColumnFamilyMetricsRowCacheMissGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsRowCacheMissGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_miss_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_miss_get_responses.go new file mode 100644 index 0000000000..caa9d6048d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_row_cache_miss_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsRowCacheMissGetReader is a Reader for the ColumnFamilyMetricsRowCacheMissGet structure. +type ColumnFamilyMetricsRowCacheMissGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsRowCacheMissGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsRowCacheMissGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsRowCacheMissGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsRowCacheMissGetOK creates a ColumnFamilyMetricsRowCacheMissGetOK with default headers values +func NewColumnFamilyMetricsRowCacheMissGetOK() *ColumnFamilyMetricsRowCacheMissGetOK { + return &ColumnFamilyMetricsRowCacheMissGetOK{} +} + +/* +ColumnFamilyMetricsRowCacheMissGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsRowCacheMissGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsRowCacheMissGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsRowCacheMissGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsRowCacheMissGetDefault creates a ColumnFamilyMetricsRowCacheMissGetDefault with default headers values +func NewColumnFamilyMetricsRowCacheMissGetDefault(code int) *ColumnFamilyMetricsRowCacheMissGetDefault { + return &ColumnFamilyMetricsRowCacheMissGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsRowCacheMissGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsRowCacheMissGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics row cache miss get default response +func (o *ColumnFamilyMetricsRowCacheMissGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsRowCacheMissGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsRowCacheMissGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsRowCacheMissGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_snapshots_size_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_snapshots_size_by_name_get_parameters.go new file mode 100644 index 0000000000..9c0f7d1f63 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_snapshots_size_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsSnapshotsSizeByNameGetParams creates a new ColumnFamilyMetricsSnapshotsSizeByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsSnapshotsSizeByNameGetParams() *ColumnFamilyMetricsSnapshotsSizeByNameGetParams { + var () + return &ColumnFamilyMetricsSnapshotsSizeByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsSnapshotsSizeByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsSnapshotsSizeByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsSnapshotsSizeByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsSnapshotsSizeByNameGetParams { + var () + return &ColumnFamilyMetricsSnapshotsSizeByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsSnapshotsSizeByNameGetParamsWithContext creates a new ColumnFamilyMetricsSnapshotsSizeByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsSnapshotsSizeByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsSnapshotsSizeByNameGetParams { + var () + return &ColumnFamilyMetricsSnapshotsSizeByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsSnapshotsSizeByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsSnapshotsSizeByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsSnapshotsSizeByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsSnapshotsSizeByNameGetParams { + var () + return &ColumnFamilyMetricsSnapshotsSizeByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsSnapshotsSizeByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics snapshots size by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsSnapshotsSizeByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics snapshots size by name get params +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsSnapshotsSizeByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics snapshots size by name get params +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics snapshots size by name get params +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsSnapshotsSizeByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics snapshots size by name get params +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics snapshots size by name get params +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsSnapshotsSizeByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics snapshots size by name get params +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics snapshots size by name get params +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetParams) WithName(name string) *ColumnFamilyMetricsSnapshotsSizeByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics snapshots size by name get params +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_snapshots_size_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_snapshots_size_by_name_get_responses.go new file mode 100644 index 0000000000..296cd92284 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_snapshots_size_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsSnapshotsSizeByNameGetReader is a Reader for the ColumnFamilyMetricsSnapshotsSizeByNameGet structure. +type ColumnFamilyMetricsSnapshotsSizeByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsSnapshotsSizeByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsSnapshotsSizeByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsSnapshotsSizeByNameGetOK creates a ColumnFamilyMetricsSnapshotsSizeByNameGetOK with default headers values +func NewColumnFamilyMetricsSnapshotsSizeByNameGetOK() *ColumnFamilyMetricsSnapshotsSizeByNameGetOK { + return &ColumnFamilyMetricsSnapshotsSizeByNameGetOK{} +} + +/* +ColumnFamilyMetricsSnapshotsSizeByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsSnapshotsSizeByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsSnapshotsSizeByNameGetDefault creates a ColumnFamilyMetricsSnapshotsSizeByNameGetDefault with default headers values +func NewColumnFamilyMetricsSnapshotsSizeByNameGetDefault(code int) *ColumnFamilyMetricsSnapshotsSizeByNameGetDefault { + return &ColumnFamilyMetricsSnapshotsSizeByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsSnapshotsSizeByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsSnapshotsSizeByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics snapshots size by name get default response +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsSnapshotsSizeByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_speculative_retries_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_speculative_retries_by_name_get_parameters.go new file mode 100644 index 0000000000..a001c08fa5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_speculative_retries_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsSpeculativeRetriesByNameGetParams creates a new ColumnFamilyMetricsSpeculativeRetriesByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsSpeculativeRetriesByNameGetParams() *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams { + var () + return &ColumnFamilyMetricsSpeculativeRetriesByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsSpeculativeRetriesByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsSpeculativeRetriesByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsSpeculativeRetriesByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams { + var () + return &ColumnFamilyMetricsSpeculativeRetriesByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsSpeculativeRetriesByNameGetParamsWithContext creates a new ColumnFamilyMetricsSpeculativeRetriesByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsSpeculativeRetriesByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams { + var () + return &ColumnFamilyMetricsSpeculativeRetriesByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsSpeculativeRetriesByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsSpeculativeRetriesByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsSpeculativeRetriesByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams { + var () + return &ColumnFamilyMetricsSpeculativeRetriesByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsSpeculativeRetriesByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics speculative retries by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsSpeculativeRetriesByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics speculative retries by name get params +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics speculative retries by name get params +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics speculative retries by name get params +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics speculative retries by name get params +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics speculative retries by name get params +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics speculative retries by name get params +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics speculative retries by name get params +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams) WithName(name string) *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics speculative retries by name get params +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_speculative_retries_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_speculative_retries_by_name_get_responses.go new file mode 100644 index 0000000000..9e6c8f56c2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_speculative_retries_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsSpeculativeRetriesByNameGetReader is a Reader for the ColumnFamilyMetricsSpeculativeRetriesByNameGet structure. +type ColumnFamilyMetricsSpeculativeRetriesByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsSpeculativeRetriesByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsSpeculativeRetriesByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsSpeculativeRetriesByNameGetOK creates a ColumnFamilyMetricsSpeculativeRetriesByNameGetOK with default headers values +func NewColumnFamilyMetricsSpeculativeRetriesByNameGetOK() *ColumnFamilyMetricsSpeculativeRetriesByNameGetOK { + return &ColumnFamilyMetricsSpeculativeRetriesByNameGetOK{} +} + +/* +ColumnFamilyMetricsSpeculativeRetriesByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsSpeculativeRetriesByNameGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsSpeculativeRetriesByNameGetDefault creates a ColumnFamilyMetricsSpeculativeRetriesByNameGetDefault with default headers values +func NewColumnFamilyMetricsSpeculativeRetriesByNameGetDefault(code int) *ColumnFamilyMetricsSpeculativeRetriesByNameGetDefault { + return &ColumnFamilyMetricsSpeculativeRetriesByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsSpeculativeRetriesByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsSpeculativeRetriesByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics speculative retries by name get default response +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsSpeculativeRetriesByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_speculative_retries_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_speculative_retries_get_parameters.go new file mode 100644 index 0000000000..73e7f276ea --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_speculative_retries_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsSpeculativeRetriesGetParams creates a new ColumnFamilyMetricsSpeculativeRetriesGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsSpeculativeRetriesGetParams() *ColumnFamilyMetricsSpeculativeRetriesGetParams { + + return &ColumnFamilyMetricsSpeculativeRetriesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsSpeculativeRetriesGetParamsWithTimeout creates a new ColumnFamilyMetricsSpeculativeRetriesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsSpeculativeRetriesGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsSpeculativeRetriesGetParams { + + return &ColumnFamilyMetricsSpeculativeRetriesGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsSpeculativeRetriesGetParamsWithContext creates a new ColumnFamilyMetricsSpeculativeRetriesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsSpeculativeRetriesGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsSpeculativeRetriesGetParams { + + return &ColumnFamilyMetricsSpeculativeRetriesGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsSpeculativeRetriesGetParamsWithHTTPClient creates a new ColumnFamilyMetricsSpeculativeRetriesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsSpeculativeRetriesGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsSpeculativeRetriesGetParams { + + return &ColumnFamilyMetricsSpeculativeRetriesGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsSpeculativeRetriesGetParams contains all the parameters to send to the API endpoint +for the column family metrics speculative retries get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsSpeculativeRetriesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics speculative retries get params +func (o *ColumnFamilyMetricsSpeculativeRetriesGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsSpeculativeRetriesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics speculative retries get params +func (o *ColumnFamilyMetricsSpeculativeRetriesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics speculative retries get params +func (o *ColumnFamilyMetricsSpeculativeRetriesGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsSpeculativeRetriesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics speculative retries get params +func (o *ColumnFamilyMetricsSpeculativeRetriesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics speculative retries get params +func (o *ColumnFamilyMetricsSpeculativeRetriesGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsSpeculativeRetriesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics speculative retries get params +func (o *ColumnFamilyMetricsSpeculativeRetriesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsSpeculativeRetriesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_speculative_retries_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_speculative_retries_get_responses.go new file mode 100644 index 0000000000..70ffa8690b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_speculative_retries_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsSpeculativeRetriesGetReader is a Reader for the ColumnFamilyMetricsSpeculativeRetriesGet structure. +type ColumnFamilyMetricsSpeculativeRetriesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsSpeculativeRetriesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsSpeculativeRetriesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsSpeculativeRetriesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsSpeculativeRetriesGetOK creates a ColumnFamilyMetricsSpeculativeRetriesGetOK with default headers values +func NewColumnFamilyMetricsSpeculativeRetriesGetOK() *ColumnFamilyMetricsSpeculativeRetriesGetOK { + return &ColumnFamilyMetricsSpeculativeRetriesGetOK{} +} + +/* +ColumnFamilyMetricsSpeculativeRetriesGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsSpeculativeRetriesGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsSpeculativeRetriesGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsSpeculativeRetriesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsSpeculativeRetriesGetDefault creates a ColumnFamilyMetricsSpeculativeRetriesGetDefault with default headers values +func NewColumnFamilyMetricsSpeculativeRetriesGetDefault(code int) *ColumnFamilyMetricsSpeculativeRetriesGetDefault { + return &ColumnFamilyMetricsSpeculativeRetriesGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsSpeculativeRetriesGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsSpeculativeRetriesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics speculative retries get default response +func (o *ColumnFamilyMetricsSpeculativeRetriesGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsSpeculativeRetriesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsSpeculativeRetriesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsSpeculativeRetriesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_sstables_per_read_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_sstables_per_read_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..6f2758b37e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_sstables_per_read_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams creates a new ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams() *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsSstablesPerReadHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsSstablesPerReadHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsSstablesPerReadHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsSstablesPerReadHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsSstablesPerReadHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsSstablesPerReadHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics sstables per read histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics sstables per read histogram by name get params +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics sstables per read histogram by name get params +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics sstables per read histogram by name get params +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics sstables per read histogram by name get params +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics sstables per read histogram by name get params +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics sstables per read histogram by name get params +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics sstables per read histogram by name get params +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics sstables per read histogram by name get params +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_sstables_per_read_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_sstables_per_read_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..8838d48169 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_sstables_per_read_histogram_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsSstablesPerReadHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsSstablesPerReadHistogramByNameGet structure. +type ColumnFamilyMetricsSstablesPerReadHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsSstablesPerReadHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsSstablesPerReadHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsSstablesPerReadHistogramByNameGetOK creates a ColumnFamilyMetricsSstablesPerReadHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsSstablesPerReadHistogramByNameGetOK() *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetOK { + return &ColumnFamilyMetricsSstablesPerReadHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsSstablesPerReadHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsSstablesPerReadHistogramByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsSstablesPerReadHistogramByNameGetDefault creates a ColumnFamilyMetricsSstablesPerReadHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsSstablesPerReadHistogramByNameGetDefault(code int) *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetDefault { + return &ColumnFamilyMetricsSstablesPerReadHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsSstablesPerReadHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsSstablesPerReadHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics sstables per read histogram by name get default response +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_tombstone_scanned_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_tombstone_scanned_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..3a257271d6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_tombstone_scanned_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams creates a new ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams() *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsTombstoneScannedHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsTombstoneScannedHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsTombstoneScannedHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsTombstoneScannedHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsTombstoneScannedHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsTombstoneScannedHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics tombstone scanned histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics tombstone scanned histogram by name get params +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics tombstone scanned histogram by name get params +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics tombstone scanned histogram by name get params +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics tombstone scanned histogram by name get params +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics tombstone scanned histogram by name get params +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics tombstone scanned histogram by name get params +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics tombstone scanned histogram by name get params +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics tombstone scanned histogram by name get params +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_tombstone_scanned_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_tombstone_scanned_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..9bd72f9fa5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_tombstone_scanned_histogram_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsTombstoneScannedHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsTombstoneScannedHistogramByNameGet structure. +type ColumnFamilyMetricsTombstoneScannedHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsTombstoneScannedHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsTombstoneScannedHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsTombstoneScannedHistogramByNameGetOK creates a ColumnFamilyMetricsTombstoneScannedHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsTombstoneScannedHistogramByNameGetOK() *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetOK { + return &ColumnFamilyMetricsTombstoneScannedHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsTombstoneScannedHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsTombstoneScannedHistogramByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsTombstoneScannedHistogramByNameGetDefault creates a ColumnFamilyMetricsTombstoneScannedHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsTombstoneScannedHistogramByNameGetDefault(code int) *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetDefault { + return &ColumnFamilyMetricsTombstoneScannedHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsTombstoneScannedHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsTombstoneScannedHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics tombstone scanned histogram by name get default response +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_total_disk_space_used_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_total_disk_space_used_by_name_get_parameters.go new file mode 100644 index 0000000000..7ac6906d6d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_total_disk_space_used_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams creates a new ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams() *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams { + var () + return &ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams { + var () + return &ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParamsWithContext creates a new ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams { + var () + return &ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams { + var () + return &ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics total disk space used by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics total disk space used by name get params +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics total disk space used by name get params +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics total disk space used by name get params +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics total disk space used by name get params +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics total disk space used by name get params +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics total disk space used by name get params +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics total disk space used by name get params +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams) WithName(name string) *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics total disk space used by name get params +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_total_disk_space_used_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_total_disk_space_used_by_name_get_responses.go new file mode 100644 index 0000000000..a01ea0dc85 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_total_disk_space_used_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetReader is a Reader for the ColumnFamilyMetricsTotalDiskSpaceUsedByNameGet structure. +type ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsTotalDiskSpaceUsedByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsTotalDiskSpaceUsedByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsTotalDiskSpaceUsedByNameGetOK creates a ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetOK with default headers values +func NewColumnFamilyMetricsTotalDiskSpaceUsedByNameGetOK() *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetOK { + return &ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetOK{} +} + +/* +ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetOK struct { + Payload int64 +} + +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetOK) GetPayload() int64 { + return o.Payload +} + +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsTotalDiskSpaceUsedByNameGetDefault creates a ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetDefault with default headers values +func NewColumnFamilyMetricsTotalDiskSpaceUsedByNameGetDefault(code int) *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetDefault { + return &ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics total disk space used by name get default response +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_total_disk_space_used_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_total_disk_space_used_get_parameters.go new file mode 100644 index 0000000000..2eb161d670 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_total_disk_space_used_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsTotalDiskSpaceUsedGetParams creates a new ColumnFamilyMetricsTotalDiskSpaceUsedGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsTotalDiskSpaceUsedGetParams() *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams { + + return &ColumnFamilyMetricsTotalDiskSpaceUsedGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsTotalDiskSpaceUsedGetParamsWithTimeout creates a new ColumnFamilyMetricsTotalDiskSpaceUsedGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsTotalDiskSpaceUsedGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams { + + return &ColumnFamilyMetricsTotalDiskSpaceUsedGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsTotalDiskSpaceUsedGetParamsWithContext creates a new ColumnFamilyMetricsTotalDiskSpaceUsedGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsTotalDiskSpaceUsedGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams { + + return &ColumnFamilyMetricsTotalDiskSpaceUsedGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsTotalDiskSpaceUsedGetParamsWithHTTPClient creates a new ColumnFamilyMetricsTotalDiskSpaceUsedGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsTotalDiskSpaceUsedGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams { + + return &ColumnFamilyMetricsTotalDiskSpaceUsedGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsTotalDiskSpaceUsedGetParams contains all the parameters to send to the API endpoint +for the column family metrics total disk space used get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsTotalDiskSpaceUsedGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics total disk space used get params +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics total disk space used get params +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics total disk space used get params +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics total disk space used get params +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics total disk space used get params +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics total disk space used get params +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_total_disk_space_used_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_total_disk_space_used_get_responses.go new file mode 100644 index 0000000000..8929f10e44 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_total_disk_space_used_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsTotalDiskSpaceUsedGetReader is a Reader for the ColumnFamilyMetricsTotalDiskSpaceUsedGet structure. +type ColumnFamilyMetricsTotalDiskSpaceUsedGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsTotalDiskSpaceUsedGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsTotalDiskSpaceUsedGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsTotalDiskSpaceUsedGetOK creates a ColumnFamilyMetricsTotalDiskSpaceUsedGetOK with default headers values +func NewColumnFamilyMetricsTotalDiskSpaceUsedGetOK() *ColumnFamilyMetricsTotalDiskSpaceUsedGetOK { + return &ColumnFamilyMetricsTotalDiskSpaceUsedGetOK{} +} + +/* +ColumnFamilyMetricsTotalDiskSpaceUsedGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsTotalDiskSpaceUsedGetOK struct { + Payload int64 +} + +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedGetOK) GetPayload() int64 { + return o.Payload +} + +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsTotalDiskSpaceUsedGetDefault creates a ColumnFamilyMetricsTotalDiskSpaceUsedGetDefault with default headers values +func NewColumnFamilyMetricsTotalDiskSpaceUsedGetDefault(code int) *ColumnFamilyMetricsTotalDiskSpaceUsedGetDefault { + return &ColumnFamilyMetricsTotalDiskSpaceUsedGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsTotalDiskSpaceUsedGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsTotalDiskSpaceUsedGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics total disk space used get default response +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsTotalDiskSpaceUsedGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_true_snapshots_size_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_true_snapshots_size_get_parameters.go new file mode 100644 index 0000000000..7e9bd8a854 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_true_snapshots_size_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsTrueSnapshotsSizeGetParams creates a new ColumnFamilyMetricsTrueSnapshotsSizeGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsTrueSnapshotsSizeGetParams() *ColumnFamilyMetricsTrueSnapshotsSizeGetParams { + + return &ColumnFamilyMetricsTrueSnapshotsSizeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsTrueSnapshotsSizeGetParamsWithTimeout creates a new ColumnFamilyMetricsTrueSnapshotsSizeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsTrueSnapshotsSizeGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsTrueSnapshotsSizeGetParams { + + return &ColumnFamilyMetricsTrueSnapshotsSizeGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsTrueSnapshotsSizeGetParamsWithContext creates a new ColumnFamilyMetricsTrueSnapshotsSizeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsTrueSnapshotsSizeGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsTrueSnapshotsSizeGetParams { + + return &ColumnFamilyMetricsTrueSnapshotsSizeGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsTrueSnapshotsSizeGetParamsWithHTTPClient creates a new ColumnFamilyMetricsTrueSnapshotsSizeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsTrueSnapshotsSizeGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsTrueSnapshotsSizeGetParams { + + return &ColumnFamilyMetricsTrueSnapshotsSizeGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsTrueSnapshotsSizeGetParams contains all the parameters to send to the API endpoint +for the column family metrics true snapshots size get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsTrueSnapshotsSizeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics true snapshots size get params +func (o *ColumnFamilyMetricsTrueSnapshotsSizeGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsTrueSnapshotsSizeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics true snapshots size get params +func (o *ColumnFamilyMetricsTrueSnapshotsSizeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics true snapshots size get params +func (o *ColumnFamilyMetricsTrueSnapshotsSizeGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsTrueSnapshotsSizeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics true snapshots size get params +func (o *ColumnFamilyMetricsTrueSnapshotsSizeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics true snapshots size get params +func (o *ColumnFamilyMetricsTrueSnapshotsSizeGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsTrueSnapshotsSizeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics true snapshots size get params +func (o *ColumnFamilyMetricsTrueSnapshotsSizeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsTrueSnapshotsSizeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_true_snapshots_size_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_true_snapshots_size_get_responses.go new file mode 100644 index 0000000000..76fbce7e62 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_true_snapshots_size_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsTrueSnapshotsSizeGetReader is a Reader for the ColumnFamilyMetricsTrueSnapshotsSizeGet structure. +type ColumnFamilyMetricsTrueSnapshotsSizeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsTrueSnapshotsSizeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsTrueSnapshotsSizeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsTrueSnapshotsSizeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsTrueSnapshotsSizeGetOK creates a ColumnFamilyMetricsTrueSnapshotsSizeGetOK with default headers values +func NewColumnFamilyMetricsTrueSnapshotsSizeGetOK() *ColumnFamilyMetricsTrueSnapshotsSizeGetOK { + return &ColumnFamilyMetricsTrueSnapshotsSizeGetOK{} +} + +/* +ColumnFamilyMetricsTrueSnapshotsSizeGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsTrueSnapshotsSizeGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsTrueSnapshotsSizeGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsTrueSnapshotsSizeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsTrueSnapshotsSizeGetDefault creates a ColumnFamilyMetricsTrueSnapshotsSizeGetDefault with default headers values +func NewColumnFamilyMetricsTrueSnapshotsSizeGetDefault(code int) *ColumnFamilyMetricsTrueSnapshotsSizeGetDefault { + return &ColumnFamilyMetricsTrueSnapshotsSizeGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsTrueSnapshotsSizeGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsTrueSnapshotsSizeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics true snapshots size get default response +func (o *ColumnFamilyMetricsTrueSnapshotsSizeGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsTrueSnapshotsSizeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsTrueSnapshotsSizeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsTrueSnapshotsSizeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_waiting_on_free_memtable_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_waiting_on_free_memtable_get_parameters.go new file mode 100644 index 0000000000..958d5da958 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_waiting_on_free_memtable_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsWaitingOnFreeMemtableGetParams creates a new ColumnFamilyMetricsWaitingOnFreeMemtableGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsWaitingOnFreeMemtableGetParams() *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams { + + return &ColumnFamilyMetricsWaitingOnFreeMemtableGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsWaitingOnFreeMemtableGetParamsWithTimeout creates a new ColumnFamilyMetricsWaitingOnFreeMemtableGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsWaitingOnFreeMemtableGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams { + + return &ColumnFamilyMetricsWaitingOnFreeMemtableGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsWaitingOnFreeMemtableGetParamsWithContext creates a new ColumnFamilyMetricsWaitingOnFreeMemtableGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsWaitingOnFreeMemtableGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams { + + return &ColumnFamilyMetricsWaitingOnFreeMemtableGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsWaitingOnFreeMemtableGetParamsWithHTTPClient creates a new ColumnFamilyMetricsWaitingOnFreeMemtableGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsWaitingOnFreeMemtableGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams { + + return &ColumnFamilyMetricsWaitingOnFreeMemtableGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsWaitingOnFreeMemtableGetParams contains all the parameters to send to the API endpoint +for the column family metrics waiting on free memtable get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsWaitingOnFreeMemtableGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics waiting on free memtable get params +func (o *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics waiting on free memtable get params +func (o *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics waiting on free memtable get params +func (o *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics waiting on free memtable get params +func (o *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics waiting on free memtable get params +func (o *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics waiting on free memtable get params +func (o *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_waiting_on_free_memtable_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_waiting_on_free_memtable_get_responses.go new file mode 100644 index 0000000000..3664e557fd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_waiting_on_free_memtable_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsWaitingOnFreeMemtableGetReader is a Reader for the ColumnFamilyMetricsWaitingOnFreeMemtableGet structure. +type ColumnFamilyMetricsWaitingOnFreeMemtableGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsWaitingOnFreeMemtableGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsWaitingOnFreeMemtableGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsWaitingOnFreeMemtableGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsWaitingOnFreeMemtableGetOK creates a ColumnFamilyMetricsWaitingOnFreeMemtableGetOK with default headers values +func NewColumnFamilyMetricsWaitingOnFreeMemtableGetOK() *ColumnFamilyMetricsWaitingOnFreeMemtableGetOK { + return &ColumnFamilyMetricsWaitingOnFreeMemtableGetOK{} +} + +/* +ColumnFamilyMetricsWaitingOnFreeMemtableGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsWaitingOnFreeMemtableGetOK struct { +} + +func (o *ColumnFamilyMetricsWaitingOnFreeMemtableGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsWaitingOnFreeMemtableGetDefault creates a ColumnFamilyMetricsWaitingOnFreeMemtableGetDefault with default headers values +func NewColumnFamilyMetricsWaitingOnFreeMemtableGetDefault(code int) *ColumnFamilyMetricsWaitingOnFreeMemtableGetDefault { + return &ColumnFamilyMetricsWaitingOnFreeMemtableGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsWaitingOnFreeMemtableGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsWaitingOnFreeMemtableGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics waiting on free memtable get default response +func (o *ColumnFamilyMetricsWaitingOnFreeMemtableGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsWaitingOnFreeMemtableGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsWaitingOnFreeMemtableGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsWaitingOnFreeMemtableGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_by_name_get_parameters.go new file mode 100644 index 0000000000..95a95afcc6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsWriteByNameGetParams creates a new ColumnFamilyMetricsWriteByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsWriteByNameGetParams() *ColumnFamilyMetricsWriteByNameGetParams { + var () + return &ColumnFamilyMetricsWriteByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsWriteByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsWriteByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsWriteByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteByNameGetParams { + var () + return &ColumnFamilyMetricsWriteByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsWriteByNameGetParamsWithContext creates a new ColumnFamilyMetricsWriteByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsWriteByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsWriteByNameGetParams { + var () + return &ColumnFamilyMetricsWriteByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsWriteByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsWriteByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsWriteByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteByNameGetParams { + var () + return &ColumnFamilyMetricsWriteByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsWriteByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics write by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsWriteByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics write by name get params +func (o *ColumnFamilyMetricsWriteByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics write by name get params +func (o *ColumnFamilyMetricsWriteByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics write by name get params +func (o *ColumnFamilyMetricsWriteByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsWriteByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics write by name get params +func (o *ColumnFamilyMetricsWriteByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics write by name get params +func (o *ColumnFamilyMetricsWriteByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics write by name get params +func (o *ColumnFamilyMetricsWriteByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics write by name get params +func (o *ColumnFamilyMetricsWriteByNameGetParams) WithName(name string) *ColumnFamilyMetricsWriteByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics write by name get params +func (o *ColumnFamilyMetricsWriteByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsWriteByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_by_name_get_responses.go new file mode 100644 index 0000000000..a57fba546d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsWriteByNameGetReader is a Reader for the ColumnFamilyMetricsWriteByNameGet structure. +type ColumnFamilyMetricsWriteByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsWriteByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsWriteByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsWriteByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsWriteByNameGetOK creates a ColumnFamilyMetricsWriteByNameGetOK with default headers values +func NewColumnFamilyMetricsWriteByNameGetOK() *ColumnFamilyMetricsWriteByNameGetOK { + return &ColumnFamilyMetricsWriteByNameGetOK{} +} + +/* +ColumnFamilyMetricsWriteByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsWriteByNameGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsWriteByNameGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsWriteByNameGetDefault creates a ColumnFamilyMetricsWriteByNameGetDefault with default headers values +func NewColumnFamilyMetricsWriteByNameGetDefault(code int) *ColumnFamilyMetricsWriteByNameGetDefault { + return &ColumnFamilyMetricsWriteByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsWriteByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsWriteByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics write by name get default response +func (o *ColumnFamilyMetricsWriteByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsWriteByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsWriteByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_get_parameters.go new file mode 100644 index 0000000000..558bc37fd6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsWriteGetParams creates a new ColumnFamilyMetricsWriteGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsWriteGetParams() *ColumnFamilyMetricsWriteGetParams { + + return &ColumnFamilyMetricsWriteGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsWriteGetParamsWithTimeout creates a new ColumnFamilyMetricsWriteGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsWriteGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteGetParams { + + return &ColumnFamilyMetricsWriteGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsWriteGetParamsWithContext creates a new ColumnFamilyMetricsWriteGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsWriteGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsWriteGetParams { + + return &ColumnFamilyMetricsWriteGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsWriteGetParamsWithHTTPClient creates a new ColumnFamilyMetricsWriteGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsWriteGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteGetParams { + + return &ColumnFamilyMetricsWriteGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsWriteGetParams contains all the parameters to send to the API endpoint +for the column family metrics write get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsWriteGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics write get params +func (o *ColumnFamilyMetricsWriteGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics write get params +func (o *ColumnFamilyMetricsWriteGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics write get params +func (o *ColumnFamilyMetricsWriteGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsWriteGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics write get params +func (o *ColumnFamilyMetricsWriteGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics write get params +func (o *ColumnFamilyMetricsWriteGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics write get params +func (o *ColumnFamilyMetricsWriteGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsWriteGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_get_responses.go new file mode 100644 index 0000000000..4e95cc1043 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsWriteGetReader is a Reader for the ColumnFamilyMetricsWriteGet structure. +type ColumnFamilyMetricsWriteGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsWriteGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsWriteGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsWriteGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsWriteGetOK creates a ColumnFamilyMetricsWriteGetOK with default headers values +func NewColumnFamilyMetricsWriteGetOK() *ColumnFamilyMetricsWriteGetOK { + return &ColumnFamilyMetricsWriteGetOK{} +} + +/* +ColumnFamilyMetricsWriteGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsWriteGetOK struct { + Payload interface{} +} + +func (o *ColumnFamilyMetricsWriteGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsWriteGetDefault creates a ColumnFamilyMetricsWriteGetDefault with default headers values +func NewColumnFamilyMetricsWriteGetDefault(code int) *ColumnFamilyMetricsWriteGetDefault { + return &ColumnFamilyMetricsWriteGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsWriteGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsWriteGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics write get default response +func (o *ColumnFamilyMetricsWriteGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsWriteGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsWriteGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_by_name_get_parameters.go new file mode 100644 index 0000000000..0bc18ec7f0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsWriteLatencyByNameGetParams creates a new ColumnFamilyMetricsWriteLatencyByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsWriteLatencyByNameGetParams() *ColumnFamilyMetricsWriteLatencyByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsWriteLatencyByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsWriteLatencyByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyByNameGetParamsWithContext creates a new ColumnFamilyMetricsWriteLatencyByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsWriteLatencyByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsWriteLatencyByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsWriteLatencyByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsWriteLatencyByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsWriteLatencyByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics write latency by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsWriteLatencyByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics write latency by name get params +func (o *ColumnFamilyMetricsWriteLatencyByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics write latency by name get params +func (o *ColumnFamilyMetricsWriteLatencyByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics write latency by name get params +func (o *ColumnFamilyMetricsWriteLatencyByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics write latency by name get params +func (o *ColumnFamilyMetricsWriteLatencyByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics write latency by name get params +func (o *ColumnFamilyMetricsWriteLatencyByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics write latency by name get params +func (o *ColumnFamilyMetricsWriteLatencyByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics write latency by name get params +func (o *ColumnFamilyMetricsWriteLatencyByNameGetParams) WithName(name string) *ColumnFamilyMetricsWriteLatencyByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics write latency by name get params +func (o *ColumnFamilyMetricsWriteLatencyByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsWriteLatencyByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_by_name_get_responses.go new file mode 100644 index 0000000000..7c19b239dc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsWriteLatencyByNameGetReader is a Reader for the ColumnFamilyMetricsWriteLatencyByNameGet structure. +type ColumnFamilyMetricsWriteLatencyByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsWriteLatencyByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsWriteLatencyByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsWriteLatencyByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsWriteLatencyByNameGetOK creates a ColumnFamilyMetricsWriteLatencyByNameGetOK with default headers values +func NewColumnFamilyMetricsWriteLatencyByNameGetOK() *ColumnFamilyMetricsWriteLatencyByNameGetOK { + return &ColumnFamilyMetricsWriteLatencyByNameGetOK{} +} + +/* +ColumnFamilyMetricsWriteLatencyByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsWriteLatencyByNameGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsWriteLatencyByNameGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteLatencyByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsWriteLatencyByNameGetDefault creates a ColumnFamilyMetricsWriteLatencyByNameGetDefault with default headers values +func NewColumnFamilyMetricsWriteLatencyByNameGetDefault(code int) *ColumnFamilyMetricsWriteLatencyByNameGetDefault { + return &ColumnFamilyMetricsWriteLatencyByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsWriteLatencyByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsWriteLatencyByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics write latency by name get default response +func (o *ColumnFamilyMetricsWriteLatencyByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsWriteLatencyByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteLatencyByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsWriteLatencyByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_estimated_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_estimated_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..89bd0d2ade --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_estimated_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams creates a new ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams() *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics write latency estimated histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics write latency estimated histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics write latency estimated histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics write latency estimated histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics write latency estimated histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics write latency estimated histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics write latency estimated histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics write latency estimated histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics write latency estimated histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_estimated_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_estimated_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..3333a24cd6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_estimated_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGet structure. +type ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetOK creates a ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetOK() *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetOK { + return &ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetDefault creates a ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetDefault(code int) *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetDefault { + return &ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics write latency estimated histogram by name get default response +func (o *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_estimated_recent_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_estimated_recent_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..1144aba796 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_estimated_recent_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams creates a new ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams() *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics write latency estimated recent histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics write latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics write latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics write latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics write latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics write latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics write latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics write latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics write latency estimated recent histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_estimated_recent_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_estimated_recent_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..a9d2aa83d4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_estimated_recent_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGet structure. +type ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetOK creates a ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetOK() *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetOK { + return &ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetDefault creates a ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetDefault(code int) *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetDefault { + return &ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics write latency estimated recent histogram by name get default response +func (o *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_get_parameters.go new file mode 100644 index 0000000000..90a9f745b6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsWriteLatencyGetParams creates a new ColumnFamilyMetricsWriteLatencyGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsWriteLatencyGetParams() *ColumnFamilyMetricsWriteLatencyGetParams { + + return &ColumnFamilyMetricsWriteLatencyGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyGetParamsWithTimeout creates a new ColumnFamilyMetricsWriteLatencyGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsWriteLatencyGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyGetParams { + + return &ColumnFamilyMetricsWriteLatencyGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyGetParamsWithContext creates a new ColumnFamilyMetricsWriteLatencyGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsWriteLatencyGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyGetParams { + + return &ColumnFamilyMetricsWriteLatencyGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsWriteLatencyGetParamsWithHTTPClient creates a new ColumnFamilyMetricsWriteLatencyGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsWriteLatencyGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyGetParams { + + return &ColumnFamilyMetricsWriteLatencyGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsWriteLatencyGetParams contains all the parameters to send to the API endpoint +for the column family metrics write latency get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsWriteLatencyGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics write latency get params +func (o *ColumnFamilyMetricsWriteLatencyGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics write latency get params +func (o *ColumnFamilyMetricsWriteLatencyGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics write latency get params +func (o *ColumnFamilyMetricsWriteLatencyGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics write latency get params +func (o *ColumnFamilyMetricsWriteLatencyGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics write latency get params +func (o *ColumnFamilyMetricsWriteLatencyGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics write latency get params +func (o *ColumnFamilyMetricsWriteLatencyGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsWriteLatencyGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_get_responses.go new file mode 100644 index 0000000000..283540d0db --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsWriteLatencyGetReader is a Reader for the ColumnFamilyMetricsWriteLatencyGet structure. +type ColumnFamilyMetricsWriteLatencyGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsWriteLatencyGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsWriteLatencyGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsWriteLatencyGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsWriteLatencyGetOK creates a ColumnFamilyMetricsWriteLatencyGetOK with default headers values +func NewColumnFamilyMetricsWriteLatencyGetOK() *ColumnFamilyMetricsWriteLatencyGetOK { + return &ColumnFamilyMetricsWriteLatencyGetOK{} +} + +/* +ColumnFamilyMetricsWriteLatencyGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsWriteLatencyGetOK struct { + Payload int32 +} + +func (o *ColumnFamilyMetricsWriteLatencyGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteLatencyGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsWriteLatencyGetDefault creates a ColumnFamilyMetricsWriteLatencyGetDefault with default headers values +func NewColumnFamilyMetricsWriteLatencyGetDefault(code int) *ColumnFamilyMetricsWriteLatencyGetDefault { + return &ColumnFamilyMetricsWriteLatencyGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsWriteLatencyGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsWriteLatencyGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics write latency get default response +func (o *ColumnFamilyMetricsWriteLatencyGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsWriteLatencyGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteLatencyGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsWriteLatencyGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..0ce860536a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsWriteLatencyHistogramByNameGetParams creates a new ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsWriteLatencyHistogramByNameGetParams() *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsWriteLatencyHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsWriteLatencyHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsWriteLatencyHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsWriteLatencyHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics write latency histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics write latency histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics write latency histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics write latency histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics write latency histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics write latency histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics write latency histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics write latency histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics write latency histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..be47259e61 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsWriteLatencyHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsWriteLatencyHistogramByNameGet structure. +type ColumnFamilyMetricsWriteLatencyHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsWriteLatencyHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsWriteLatencyHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsWriteLatencyHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsWriteLatencyHistogramByNameGetOK creates a ColumnFamilyMetricsWriteLatencyHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsWriteLatencyHistogramByNameGetOK() *ColumnFamilyMetricsWriteLatencyHistogramByNameGetOK { + return &ColumnFamilyMetricsWriteLatencyHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsWriteLatencyHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsWriteLatencyHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsWriteLatencyHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsWriteLatencyHistogramByNameGetDefault creates a ColumnFamilyMetricsWriteLatencyHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsWriteLatencyHistogramByNameGetDefault(code int) *ColumnFamilyMetricsWriteLatencyHistogramByNameGetDefault { + return &ColumnFamilyMetricsWriteLatencyHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsWriteLatencyHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsWriteLatencyHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics write latency histogram by name get default response +func (o *ColumnFamilyMetricsWriteLatencyHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsWriteLatencyHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteLatencyHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsWriteLatencyHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_histogram_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_histogram_get_parameters.go new file mode 100644 index 0000000000..7036f3ed6b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_histogram_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsWriteLatencyHistogramGetParams creates a new ColumnFamilyMetricsWriteLatencyHistogramGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsWriteLatencyHistogramGetParams() *ColumnFamilyMetricsWriteLatencyHistogramGetParams { + + return &ColumnFamilyMetricsWriteLatencyHistogramGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyHistogramGetParamsWithTimeout creates a new ColumnFamilyMetricsWriteLatencyHistogramGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsWriteLatencyHistogramGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyHistogramGetParams { + + return &ColumnFamilyMetricsWriteLatencyHistogramGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyHistogramGetParamsWithContext creates a new ColumnFamilyMetricsWriteLatencyHistogramGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsWriteLatencyHistogramGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyHistogramGetParams { + + return &ColumnFamilyMetricsWriteLatencyHistogramGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsWriteLatencyHistogramGetParamsWithHTTPClient creates a new ColumnFamilyMetricsWriteLatencyHistogramGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsWriteLatencyHistogramGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyHistogramGetParams { + + return &ColumnFamilyMetricsWriteLatencyHistogramGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsWriteLatencyHistogramGetParams contains all the parameters to send to the API endpoint +for the column family metrics write latency histogram get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsWriteLatencyHistogramGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics write latency histogram get params +func (o *ColumnFamilyMetricsWriteLatencyHistogramGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyHistogramGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics write latency histogram get params +func (o *ColumnFamilyMetricsWriteLatencyHistogramGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics write latency histogram get params +func (o *ColumnFamilyMetricsWriteLatencyHistogramGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyHistogramGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics write latency histogram get params +func (o *ColumnFamilyMetricsWriteLatencyHistogramGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics write latency histogram get params +func (o *ColumnFamilyMetricsWriteLatencyHistogramGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyHistogramGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics write latency histogram get params +func (o *ColumnFamilyMetricsWriteLatencyHistogramGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsWriteLatencyHistogramGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_histogram_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_histogram_get_responses.go new file mode 100644 index 0000000000..ac0abb0e6d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_histogram_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsWriteLatencyHistogramGetReader is a Reader for the ColumnFamilyMetricsWriteLatencyHistogramGet structure. +type ColumnFamilyMetricsWriteLatencyHistogramGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsWriteLatencyHistogramGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsWriteLatencyHistogramGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsWriteLatencyHistogramGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsWriteLatencyHistogramGetOK creates a ColumnFamilyMetricsWriteLatencyHistogramGetOK with default headers values +func NewColumnFamilyMetricsWriteLatencyHistogramGetOK() *ColumnFamilyMetricsWriteLatencyHistogramGetOK { + return &ColumnFamilyMetricsWriteLatencyHistogramGetOK{} +} + +/* +ColumnFamilyMetricsWriteLatencyHistogramGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsWriteLatencyHistogramGetOK struct { + Payload []*models.Histogram +} + +func (o *ColumnFamilyMetricsWriteLatencyHistogramGetOK) GetPayload() []*models.Histogram { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteLatencyHistogramGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsWriteLatencyHistogramGetDefault creates a ColumnFamilyMetricsWriteLatencyHistogramGetDefault with default headers values +func NewColumnFamilyMetricsWriteLatencyHistogramGetDefault(code int) *ColumnFamilyMetricsWriteLatencyHistogramGetDefault { + return &ColumnFamilyMetricsWriteLatencyHistogramGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsWriteLatencyHistogramGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsWriteLatencyHistogramGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics write latency histogram get default response +func (o *ColumnFamilyMetricsWriteLatencyHistogramGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsWriteLatencyHistogramGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteLatencyHistogramGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsWriteLatencyHistogramGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_moving_average_histogram_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_moving_average_histogram_by_name_get_parameters.go new file mode 100644 index 0000000000..2a0703f103 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_moving_average_histogram_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams creates a new ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams() *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParamsWithTimeout creates a new ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParamsWithContext creates a new ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParamsWithHTTPClient creates a new ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams { + var () + return &ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams contains all the parameters to send to the API endpoint +for the column family metrics write latency moving average histogram by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics write latency moving average histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics write latency moving average histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics write latency moving average histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics write latency moving average histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics write latency moving average histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics write latency moving average histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family metrics write latency moving average histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams) WithName(name string) *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family metrics write latency moving average histogram by name get params +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_moving_average_histogram_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_moving_average_histogram_by_name_get_responses.go new file mode 100644 index 0000000000..dd2b1556d0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_moving_average_histogram_by_name_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetReader is a Reader for the ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGet structure. +type ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetOK creates a ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetOK with default headers values +func NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetOK() *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetOK { + return &ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetOK{} +} + +/* +ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetOK struct { +} + +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetDefault creates a ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetDefault with default headers values +func NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetDefault(code int) *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetDefault { + return &ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics write latency moving average histogram by name get default response +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_moving_average_histogram_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_moving_average_histogram_get_parameters.go new file mode 100644 index 0000000000..16c80314b0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_moving_average_histogram_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams creates a new ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams object +// with the default values initialized. +func NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams() *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams { + + return &ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParamsWithTimeout creates a new ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams { + + return &ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParamsWithContext creates a new ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParamsWithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams { + + return &ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParamsWithHTTPClient creates a new ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams { + + return &ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams contains all the parameters to send to the API endpoint +for the column family metrics write latency moving average histogram get operation typically these are written to a http.Request +*/ +type ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family metrics write latency moving average histogram get params +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family metrics write latency moving average histogram get params +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family metrics write latency moving average histogram get params +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams) WithContext(ctx context.Context) *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family metrics write latency moving average histogram get params +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family metrics write latency moving average histogram get params +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family metrics write latency moving average histogram get params +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_moving_average_histogram_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_moving_average_histogram_get_responses.go new file mode 100644 index 0000000000..9a90f03d23 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_metrics_write_latency_moving_average_histogram_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetReader is a Reader for the ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGet structure. +type ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetOK creates a ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetOK with default headers values +func NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetOK() *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetOK { + return &ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetOK{} +} + +/* +ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetOK struct { + Payload []*models.RateMovingAverageAndHistogram +} + +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetOK) GetPayload() []*models.RateMovingAverageAndHistogram { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetDefault creates a ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetDefault with default headers values +func NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetDefault(code int) *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetDefault { + return &ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family metrics write latency moving average histogram get default response +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_minimum_compaction_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_minimum_compaction_by_name_get_parameters.go new file mode 100644 index 0000000000..43b8084f7f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_minimum_compaction_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyMinimumCompactionByNameGetParams creates a new ColumnFamilyMinimumCompactionByNameGetParams object +// with the default values initialized. +func NewColumnFamilyMinimumCompactionByNameGetParams() *ColumnFamilyMinimumCompactionByNameGetParams { + var () + return &ColumnFamilyMinimumCompactionByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMinimumCompactionByNameGetParamsWithTimeout creates a new ColumnFamilyMinimumCompactionByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMinimumCompactionByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyMinimumCompactionByNameGetParams { + var () + return &ColumnFamilyMinimumCompactionByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMinimumCompactionByNameGetParamsWithContext creates a new ColumnFamilyMinimumCompactionByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMinimumCompactionByNameGetParamsWithContext(ctx context.Context) *ColumnFamilyMinimumCompactionByNameGetParams { + var () + return &ColumnFamilyMinimumCompactionByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMinimumCompactionByNameGetParamsWithHTTPClient creates a new ColumnFamilyMinimumCompactionByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMinimumCompactionByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyMinimumCompactionByNameGetParams { + var () + return &ColumnFamilyMinimumCompactionByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMinimumCompactionByNameGetParams contains all the parameters to send to the API endpoint +for the column family minimum compaction by name get operation typically these are written to a http.Request +*/ +type ColumnFamilyMinimumCompactionByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family minimum compaction by name get params +func (o *ColumnFamilyMinimumCompactionByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyMinimumCompactionByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family minimum compaction by name get params +func (o *ColumnFamilyMinimumCompactionByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family minimum compaction by name get params +func (o *ColumnFamilyMinimumCompactionByNameGetParams) WithContext(ctx context.Context) *ColumnFamilyMinimumCompactionByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family minimum compaction by name get params +func (o *ColumnFamilyMinimumCompactionByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family minimum compaction by name get params +func (o *ColumnFamilyMinimumCompactionByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyMinimumCompactionByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family minimum compaction by name get params +func (o *ColumnFamilyMinimumCompactionByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family minimum compaction by name get params +func (o *ColumnFamilyMinimumCompactionByNameGetParams) WithName(name string) *ColumnFamilyMinimumCompactionByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family minimum compaction by name get params +func (o *ColumnFamilyMinimumCompactionByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMinimumCompactionByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_minimum_compaction_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_minimum_compaction_by_name_get_responses.go new file mode 100644 index 0000000000..afcd2adf6d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_minimum_compaction_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMinimumCompactionByNameGetReader is a Reader for the ColumnFamilyMinimumCompactionByNameGet structure. +type ColumnFamilyMinimumCompactionByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMinimumCompactionByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMinimumCompactionByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMinimumCompactionByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMinimumCompactionByNameGetOK creates a ColumnFamilyMinimumCompactionByNameGetOK with default headers values +func NewColumnFamilyMinimumCompactionByNameGetOK() *ColumnFamilyMinimumCompactionByNameGetOK { + return &ColumnFamilyMinimumCompactionByNameGetOK{} +} + +/* +ColumnFamilyMinimumCompactionByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMinimumCompactionByNameGetOK struct { + Payload string +} + +func (o *ColumnFamilyMinimumCompactionByNameGetOK) GetPayload() string { + return o.Payload +} + +func (o *ColumnFamilyMinimumCompactionByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMinimumCompactionByNameGetDefault creates a ColumnFamilyMinimumCompactionByNameGetDefault with default headers values +func NewColumnFamilyMinimumCompactionByNameGetDefault(code int) *ColumnFamilyMinimumCompactionByNameGetDefault { + return &ColumnFamilyMinimumCompactionByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMinimumCompactionByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMinimumCompactionByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family minimum compaction by name get default response +func (o *ColumnFamilyMinimumCompactionByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMinimumCompactionByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMinimumCompactionByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMinimumCompactionByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_minimum_compaction_by_name_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_minimum_compaction_by_name_post_parameters.go new file mode 100644 index 0000000000..dec2278426 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_minimum_compaction_by_name_post_parameters.go @@ -0,0 +1,162 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewColumnFamilyMinimumCompactionByNamePostParams creates a new ColumnFamilyMinimumCompactionByNamePostParams object +// with the default values initialized. +func NewColumnFamilyMinimumCompactionByNamePostParams() *ColumnFamilyMinimumCompactionByNamePostParams { + var () + return &ColumnFamilyMinimumCompactionByNamePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyMinimumCompactionByNamePostParamsWithTimeout creates a new ColumnFamilyMinimumCompactionByNamePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyMinimumCompactionByNamePostParamsWithTimeout(timeout time.Duration) *ColumnFamilyMinimumCompactionByNamePostParams { + var () + return &ColumnFamilyMinimumCompactionByNamePostParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyMinimumCompactionByNamePostParamsWithContext creates a new ColumnFamilyMinimumCompactionByNamePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyMinimumCompactionByNamePostParamsWithContext(ctx context.Context) *ColumnFamilyMinimumCompactionByNamePostParams { + var () + return &ColumnFamilyMinimumCompactionByNamePostParams{ + + Context: ctx, + } +} + +// NewColumnFamilyMinimumCompactionByNamePostParamsWithHTTPClient creates a new ColumnFamilyMinimumCompactionByNamePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyMinimumCompactionByNamePostParamsWithHTTPClient(client *http.Client) *ColumnFamilyMinimumCompactionByNamePostParams { + var () + return &ColumnFamilyMinimumCompactionByNamePostParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyMinimumCompactionByNamePostParams contains all the parameters to send to the API endpoint +for the column family minimum compaction by name post operation typically these are written to a http.Request +*/ +type ColumnFamilyMinimumCompactionByNamePostParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + /*Value + The minimum number of sstables in queue before compaction kicks off + + */ + Value int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family minimum compaction by name post params +func (o *ColumnFamilyMinimumCompactionByNamePostParams) WithTimeout(timeout time.Duration) *ColumnFamilyMinimumCompactionByNamePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family minimum compaction by name post params +func (o *ColumnFamilyMinimumCompactionByNamePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family minimum compaction by name post params +func (o *ColumnFamilyMinimumCompactionByNamePostParams) WithContext(ctx context.Context) *ColumnFamilyMinimumCompactionByNamePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family minimum compaction by name post params +func (o *ColumnFamilyMinimumCompactionByNamePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family minimum compaction by name post params +func (o *ColumnFamilyMinimumCompactionByNamePostParams) WithHTTPClient(client *http.Client) *ColumnFamilyMinimumCompactionByNamePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family minimum compaction by name post params +func (o *ColumnFamilyMinimumCompactionByNamePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family minimum compaction by name post params +func (o *ColumnFamilyMinimumCompactionByNamePostParams) WithName(name string) *ColumnFamilyMinimumCompactionByNamePostParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family minimum compaction by name post params +func (o *ColumnFamilyMinimumCompactionByNamePostParams) SetName(name string) { + o.Name = name +} + +// WithValue adds the value to the column family minimum compaction by name post params +func (o *ColumnFamilyMinimumCompactionByNamePostParams) WithValue(value int32) *ColumnFamilyMinimumCompactionByNamePostParams { + o.SetValue(value) + return o +} + +// SetValue adds the value to the column family minimum compaction by name post params +func (o *ColumnFamilyMinimumCompactionByNamePostParams) SetValue(value int32) { + o.Value = value +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyMinimumCompactionByNamePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + // query param value + qrValue := o.Value + qValue := swag.FormatInt32(qrValue) + if qValue != "" { + if err := r.SetQueryParam("value", qValue); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_minimum_compaction_by_name_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_minimum_compaction_by_name_post_responses.go new file mode 100644 index 0000000000..3cdd5e6aa1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_minimum_compaction_by_name_post_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyMinimumCompactionByNamePostReader is a Reader for the ColumnFamilyMinimumCompactionByNamePost structure. +type ColumnFamilyMinimumCompactionByNamePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyMinimumCompactionByNamePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyMinimumCompactionByNamePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyMinimumCompactionByNamePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyMinimumCompactionByNamePostOK creates a ColumnFamilyMinimumCompactionByNamePostOK with default headers values +func NewColumnFamilyMinimumCompactionByNamePostOK() *ColumnFamilyMinimumCompactionByNamePostOK { + return &ColumnFamilyMinimumCompactionByNamePostOK{} +} + +/* +ColumnFamilyMinimumCompactionByNamePostOK handles this case with default header values. + +Success +*/ +type ColumnFamilyMinimumCompactionByNamePostOK struct { + Payload string +} + +func (o *ColumnFamilyMinimumCompactionByNamePostOK) GetPayload() string { + return o.Payload +} + +func (o *ColumnFamilyMinimumCompactionByNamePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyMinimumCompactionByNamePostDefault creates a ColumnFamilyMinimumCompactionByNamePostDefault with default headers values +func NewColumnFamilyMinimumCompactionByNamePostDefault(code int) *ColumnFamilyMinimumCompactionByNamePostDefault { + return &ColumnFamilyMinimumCompactionByNamePostDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyMinimumCompactionByNamePostDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyMinimumCompactionByNamePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family minimum compaction by name post default response +func (o *ColumnFamilyMinimumCompactionByNamePostDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyMinimumCompactionByNamePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyMinimumCompactionByNamePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyMinimumCompactionByNamePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_name_get_parameters.go new file mode 100644 index 0000000000..56de4de4b2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_name_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyNameGetParams creates a new ColumnFamilyNameGetParams object +// with the default values initialized. +func NewColumnFamilyNameGetParams() *ColumnFamilyNameGetParams { + + return &ColumnFamilyNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyNameGetParamsWithTimeout creates a new ColumnFamilyNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyNameGetParams { + + return &ColumnFamilyNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyNameGetParamsWithContext creates a new ColumnFamilyNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyNameGetParamsWithContext(ctx context.Context) *ColumnFamilyNameGetParams { + + return &ColumnFamilyNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyNameGetParamsWithHTTPClient creates a new ColumnFamilyNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyNameGetParams { + + return &ColumnFamilyNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyNameGetParams contains all the parameters to send to the API endpoint +for the column family name get operation typically these are written to a http.Request +*/ +type ColumnFamilyNameGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family name get params +func (o *ColumnFamilyNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family name get params +func (o *ColumnFamilyNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family name get params +func (o *ColumnFamilyNameGetParams) WithContext(ctx context.Context) *ColumnFamilyNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family name get params +func (o *ColumnFamilyNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family name get params +func (o *ColumnFamilyNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family name get params +func (o *ColumnFamilyNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_name_get_responses.go new file mode 100644 index 0000000000..b924823299 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyNameGetReader is a Reader for the ColumnFamilyNameGet structure. +type ColumnFamilyNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyNameGetOK creates a ColumnFamilyNameGetOK with default headers values +func NewColumnFamilyNameGetOK() *ColumnFamilyNameGetOK { + return &ColumnFamilyNameGetOK{} +} + +/* +ColumnFamilyNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyNameGetOK struct { + Payload []string +} + +func (o *ColumnFamilyNameGetOK) GetPayload() []string { + return o.Payload +} + +func (o *ColumnFamilyNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyNameGetDefault creates a ColumnFamilyNameGetDefault with default headers values +func NewColumnFamilyNameGetDefault(code int) *ColumnFamilyNameGetDefault { + return &ColumnFamilyNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family name get default response +func (o *ColumnFamilyNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_name_keyspace_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_name_keyspace_get_parameters.go new file mode 100644 index 0000000000..b121be0287 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_name_keyspace_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilyNameKeyspaceGetParams creates a new ColumnFamilyNameKeyspaceGetParams object +// with the default values initialized. +func NewColumnFamilyNameKeyspaceGetParams() *ColumnFamilyNameKeyspaceGetParams { + + return &ColumnFamilyNameKeyspaceGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilyNameKeyspaceGetParamsWithTimeout creates a new ColumnFamilyNameKeyspaceGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilyNameKeyspaceGetParamsWithTimeout(timeout time.Duration) *ColumnFamilyNameKeyspaceGetParams { + + return &ColumnFamilyNameKeyspaceGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilyNameKeyspaceGetParamsWithContext creates a new ColumnFamilyNameKeyspaceGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilyNameKeyspaceGetParamsWithContext(ctx context.Context) *ColumnFamilyNameKeyspaceGetParams { + + return &ColumnFamilyNameKeyspaceGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilyNameKeyspaceGetParamsWithHTTPClient creates a new ColumnFamilyNameKeyspaceGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilyNameKeyspaceGetParamsWithHTTPClient(client *http.Client) *ColumnFamilyNameKeyspaceGetParams { + + return &ColumnFamilyNameKeyspaceGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilyNameKeyspaceGetParams contains all the parameters to send to the API endpoint +for the column family name keyspace get operation typically these are written to a http.Request +*/ +type ColumnFamilyNameKeyspaceGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family name keyspace get params +func (o *ColumnFamilyNameKeyspaceGetParams) WithTimeout(timeout time.Duration) *ColumnFamilyNameKeyspaceGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family name keyspace get params +func (o *ColumnFamilyNameKeyspaceGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family name keyspace get params +func (o *ColumnFamilyNameKeyspaceGetParams) WithContext(ctx context.Context) *ColumnFamilyNameKeyspaceGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family name keyspace get params +func (o *ColumnFamilyNameKeyspaceGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family name keyspace get params +func (o *ColumnFamilyNameKeyspaceGetParams) WithHTTPClient(client *http.Client) *ColumnFamilyNameKeyspaceGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family name keyspace get params +func (o *ColumnFamilyNameKeyspaceGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilyNameKeyspaceGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_name_keyspace_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_name_keyspace_get_responses.go new file mode 100644 index 0000000000..8738cb5ec9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_name_keyspace_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilyNameKeyspaceGetReader is a Reader for the ColumnFamilyNameKeyspaceGet structure. +type ColumnFamilyNameKeyspaceGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilyNameKeyspaceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilyNameKeyspaceGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilyNameKeyspaceGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilyNameKeyspaceGetOK creates a ColumnFamilyNameKeyspaceGetOK with default headers values +func NewColumnFamilyNameKeyspaceGetOK() *ColumnFamilyNameKeyspaceGetOK { + return &ColumnFamilyNameKeyspaceGetOK{} +} + +/* +ColumnFamilyNameKeyspaceGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilyNameKeyspaceGetOK struct { + Payload []string +} + +func (o *ColumnFamilyNameKeyspaceGetOK) GetPayload() []string { + return o.Payload +} + +func (o *ColumnFamilyNameKeyspaceGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilyNameKeyspaceGetDefault creates a ColumnFamilyNameKeyspaceGetDefault with default headers values +func NewColumnFamilyNameKeyspaceGetDefault(code int) *ColumnFamilyNameKeyspaceGetDefault { + return &ColumnFamilyNameKeyspaceGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilyNameKeyspaceGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilyNameKeyspaceGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family name keyspace get default response +func (o *ColumnFamilyNameKeyspaceGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilyNameKeyspaceGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilyNameKeyspaceGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilyNameKeyspaceGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_by_key_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_by_key_by_name_get_parameters.go new file mode 100644 index 0000000000..63c5c8eb73 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_by_key_by_name_get_parameters.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilySstablesByKeyByNameGetParams creates a new ColumnFamilySstablesByKeyByNameGetParams object +// with the default values initialized. +func NewColumnFamilySstablesByKeyByNameGetParams() *ColumnFamilySstablesByKeyByNameGetParams { + var () + return &ColumnFamilySstablesByKeyByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilySstablesByKeyByNameGetParamsWithTimeout creates a new ColumnFamilySstablesByKeyByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilySstablesByKeyByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilySstablesByKeyByNameGetParams { + var () + return &ColumnFamilySstablesByKeyByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilySstablesByKeyByNameGetParamsWithContext creates a new ColumnFamilySstablesByKeyByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilySstablesByKeyByNameGetParamsWithContext(ctx context.Context) *ColumnFamilySstablesByKeyByNameGetParams { + var () + return &ColumnFamilySstablesByKeyByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilySstablesByKeyByNameGetParamsWithHTTPClient creates a new ColumnFamilySstablesByKeyByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilySstablesByKeyByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilySstablesByKeyByNameGetParams { + var () + return &ColumnFamilySstablesByKeyByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilySstablesByKeyByNameGetParams contains all the parameters to send to the API endpoint +for the column family sstables by key by name get operation typically these are written to a http.Request +*/ +type ColumnFamilySstablesByKeyByNameGetParams struct { + + /*Key + The partition key. In a composite-key scenario, use ':' to separate the columns in the key. + + */ + Key string + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family sstables by key by name get params +func (o *ColumnFamilySstablesByKeyByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilySstablesByKeyByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family sstables by key by name get params +func (o *ColumnFamilySstablesByKeyByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family sstables by key by name get params +func (o *ColumnFamilySstablesByKeyByNameGetParams) WithContext(ctx context.Context) *ColumnFamilySstablesByKeyByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family sstables by key by name get params +func (o *ColumnFamilySstablesByKeyByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family sstables by key by name get params +func (o *ColumnFamilySstablesByKeyByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilySstablesByKeyByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family sstables by key by name get params +func (o *ColumnFamilySstablesByKeyByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithKey adds the key to the column family sstables by key by name get params +func (o *ColumnFamilySstablesByKeyByNameGetParams) WithKey(key string) *ColumnFamilySstablesByKeyByNameGetParams { + o.SetKey(key) + return o +} + +// SetKey adds the key to the column family sstables by key by name get params +func (o *ColumnFamilySstablesByKeyByNameGetParams) SetKey(key string) { + o.Key = key +} + +// WithName adds the name to the column family sstables by key by name get params +func (o *ColumnFamilySstablesByKeyByNameGetParams) WithName(name string) *ColumnFamilySstablesByKeyByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family sstables by key by name get params +func (o *ColumnFamilySstablesByKeyByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilySstablesByKeyByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param key + qrKey := o.Key + qKey := qrKey + if qKey != "" { + if err := r.SetQueryParam("key", qKey); err != nil { + return err + } + } + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_by_key_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_by_key_by_name_get_responses.go new file mode 100644 index 0000000000..471485187e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_by_key_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilySstablesByKeyByNameGetReader is a Reader for the ColumnFamilySstablesByKeyByNameGet structure. +type ColumnFamilySstablesByKeyByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilySstablesByKeyByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilySstablesByKeyByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilySstablesByKeyByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilySstablesByKeyByNameGetOK creates a ColumnFamilySstablesByKeyByNameGetOK with default headers values +func NewColumnFamilySstablesByKeyByNameGetOK() *ColumnFamilySstablesByKeyByNameGetOK { + return &ColumnFamilySstablesByKeyByNameGetOK{} +} + +/* +ColumnFamilySstablesByKeyByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilySstablesByKeyByNameGetOK struct { + Payload []string +} + +func (o *ColumnFamilySstablesByKeyByNameGetOK) GetPayload() []string { + return o.Payload +} + +func (o *ColumnFamilySstablesByKeyByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilySstablesByKeyByNameGetDefault creates a ColumnFamilySstablesByKeyByNameGetDefault with default headers values +func NewColumnFamilySstablesByKeyByNameGetDefault(code int) *ColumnFamilySstablesByKeyByNameGetDefault { + return &ColumnFamilySstablesByKeyByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilySstablesByKeyByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilySstablesByKeyByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family sstables by key by name get default response +func (o *ColumnFamilySstablesByKeyByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilySstablesByKeyByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilySstablesByKeyByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilySstablesByKeyByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_per_level_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_per_level_by_name_get_parameters.go new file mode 100644 index 0000000000..14530689c8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_per_level_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilySstablesPerLevelByNameGetParams creates a new ColumnFamilySstablesPerLevelByNameGetParams object +// with the default values initialized. +func NewColumnFamilySstablesPerLevelByNameGetParams() *ColumnFamilySstablesPerLevelByNameGetParams { + var () + return &ColumnFamilySstablesPerLevelByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilySstablesPerLevelByNameGetParamsWithTimeout creates a new ColumnFamilySstablesPerLevelByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilySstablesPerLevelByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilySstablesPerLevelByNameGetParams { + var () + return &ColumnFamilySstablesPerLevelByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilySstablesPerLevelByNameGetParamsWithContext creates a new ColumnFamilySstablesPerLevelByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilySstablesPerLevelByNameGetParamsWithContext(ctx context.Context) *ColumnFamilySstablesPerLevelByNameGetParams { + var () + return &ColumnFamilySstablesPerLevelByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilySstablesPerLevelByNameGetParamsWithHTTPClient creates a new ColumnFamilySstablesPerLevelByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilySstablesPerLevelByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilySstablesPerLevelByNameGetParams { + var () + return &ColumnFamilySstablesPerLevelByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilySstablesPerLevelByNameGetParams contains all the parameters to send to the API endpoint +for the column family sstables per level by name get operation typically these are written to a http.Request +*/ +type ColumnFamilySstablesPerLevelByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family sstables per level by name get params +func (o *ColumnFamilySstablesPerLevelByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilySstablesPerLevelByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family sstables per level by name get params +func (o *ColumnFamilySstablesPerLevelByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family sstables per level by name get params +func (o *ColumnFamilySstablesPerLevelByNameGetParams) WithContext(ctx context.Context) *ColumnFamilySstablesPerLevelByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family sstables per level by name get params +func (o *ColumnFamilySstablesPerLevelByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family sstables per level by name get params +func (o *ColumnFamilySstablesPerLevelByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilySstablesPerLevelByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family sstables per level by name get params +func (o *ColumnFamilySstablesPerLevelByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family sstables per level by name get params +func (o *ColumnFamilySstablesPerLevelByNameGetParams) WithName(name string) *ColumnFamilySstablesPerLevelByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family sstables per level by name get params +func (o *ColumnFamilySstablesPerLevelByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilySstablesPerLevelByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_per_level_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_per_level_by_name_get_responses.go new file mode 100644 index 0000000000..930f0a5393 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_per_level_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilySstablesPerLevelByNameGetReader is a Reader for the ColumnFamilySstablesPerLevelByNameGet structure. +type ColumnFamilySstablesPerLevelByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilySstablesPerLevelByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilySstablesPerLevelByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilySstablesPerLevelByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilySstablesPerLevelByNameGetOK creates a ColumnFamilySstablesPerLevelByNameGetOK with default headers values +func NewColumnFamilySstablesPerLevelByNameGetOK() *ColumnFamilySstablesPerLevelByNameGetOK { + return &ColumnFamilySstablesPerLevelByNameGetOK{} +} + +/* +ColumnFamilySstablesPerLevelByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilySstablesPerLevelByNameGetOK struct { + Payload []int32 +} + +func (o *ColumnFamilySstablesPerLevelByNameGetOK) GetPayload() []int32 { + return o.Payload +} + +func (o *ColumnFamilySstablesPerLevelByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilySstablesPerLevelByNameGetDefault creates a ColumnFamilySstablesPerLevelByNameGetDefault with default headers values +func NewColumnFamilySstablesPerLevelByNameGetDefault(code int) *ColumnFamilySstablesPerLevelByNameGetDefault { + return &ColumnFamilySstablesPerLevelByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilySstablesPerLevelByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilySstablesPerLevelByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family sstables per level by name get default response +func (o *ColumnFamilySstablesPerLevelByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilySstablesPerLevelByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilySstablesPerLevelByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilySstablesPerLevelByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_unleveled_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_unleveled_by_name_get_parameters.go new file mode 100644 index 0000000000..54db8c307b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_unleveled_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewColumnFamilySstablesUnleveledByNameGetParams creates a new ColumnFamilySstablesUnleveledByNameGetParams object +// with the default values initialized. +func NewColumnFamilySstablesUnleveledByNameGetParams() *ColumnFamilySstablesUnleveledByNameGetParams { + var () + return &ColumnFamilySstablesUnleveledByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewColumnFamilySstablesUnleveledByNameGetParamsWithTimeout creates a new ColumnFamilySstablesUnleveledByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewColumnFamilySstablesUnleveledByNameGetParamsWithTimeout(timeout time.Duration) *ColumnFamilySstablesUnleveledByNameGetParams { + var () + return &ColumnFamilySstablesUnleveledByNameGetParams{ + + timeout: timeout, + } +} + +// NewColumnFamilySstablesUnleveledByNameGetParamsWithContext creates a new ColumnFamilySstablesUnleveledByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewColumnFamilySstablesUnleveledByNameGetParamsWithContext(ctx context.Context) *ColumnFamilySstablesUnleveledByNameGetParams { + var () + return &ColumnFamilySstablesUnleveledByNameGetParams{ + + Context: ctx, + } +} + +// NewColumnFamilySstablesUnleveledByNameGetParamsWithHTTPClient creates a new ColumnFamilySstablesUnleveledByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewColumnFamilySstablesUnleveledByNameGetParamsWithHTTPClient(client *http.Client) *ColumnFamilySstablesUnleveledByNameGetParams { + var () + return &ColumnFamilySstablesUnleveledByNameGetParams{ + HTTPClient: client, + } +} + +/* +ColumnFamilySstablesUnleveledByNameGetParams contains all the parameters to send to the API endpoint +for the column family sstables unleveled by name get operation typically these are written to a http.Request +*/ +type ColumnFamilySstablesUnleveledByNameGetParams struct { + + /*Name + The column family name in keyspace:name format + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the column family sstables unleveled by name get params +func (o *ColumnFamilySstablesUnleveledByNameGetParams) WithTimeout(timeout time.Duration) *ColumnFamilySstablesUnleveledByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the column family sstables unleveled by name get params +func (o *ColumnFamilySstablesUnleveledByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the column family sstables unleveled by name get params +func (o *ColumnFamilySstablesUnleveledByNameGetParams) WithContext(ctx context.Context) *ColumnFamilySstablesUnleveledByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the column family sstables unleveled by name get params +func (o *ColumnFamilySstablesUnleveledByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the column family sstables unleveled by name get params +func (o *ColumnFamilySstablesUnleveledByNameGetParams) WithHTTPClient(client *http.Client) *ColumnFamilySstablesUnleveledByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the column family sstables unleveled by name get params +func (o *ColumnFamilySstablesUnleveledByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the column family sstables unleveled by name get params +func (o *ColumnFamilySstablesUnleveledByNameGetParams) WithName(name string) *ColumnFamilySstablesUnleveledByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the column family sstables unleveled by name get params +func (o *ColumnFamilySstablesUnleveledByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *ColumnFamilySstablesUnleveledByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_unleveled_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_unleveled_by_name_get_responses.go new file mode 100644 index 0000000000..53e94c4f36 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/column_family_sstables_unleveled_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// ColumnFamilySstablesUnleveledByNameGetReader is a Reader for the ColumnFamilySstablesUnleveledByNameGet structure. +type ColumnFamilySstablesUnleveledByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ColumnFamilySstablesUnleveledByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewColumnFamilySstablesUnleveledByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewColumnFamilySstablesUnleveledByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewColumnFamilySstablesUnleveledByNameGetOK creates a ColumnFamilySstablesUnleveledByNameGetOK with default headers values +func NewColumnFamilySstablesUnleveledByNameGetOK() *ColumnFamilySstablesUnleveledByNameGetOK { + return &ColumnFamilySstablesUnleveledByNameGetOK{} +} + +/* +ColumnFamilySstablesUnleveledByNameGetOK handles this case with default header values. + +Success +*/ +type ColumnFamilySstablesUnleveledByNameGetOK struct { + Payload []string +} + +func (o *ColumnFamilySstablesUnleveledByNameGetOK) GetPayload() []string { + return o.Payload +} + +func (o *ColumnFamilySstablesUnleveledByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewColumnFamilySstablesUnleveledByNameGetDefault creates a ColumnFamilySstablesUnleveledByNameGetDefault with default headers values +func NewColumnFamilySstablesUnleveledByNameGetDefault(code int) *ColumnFamilySstablesUnleveledByNameGetDefault { + return &ColumnFamilySstablesUnleveledByNameGetDefault{ + _statusCode: code, + } +} + +/* +ColumnFamilySstablesUnleveledByNameGetDefault handles this case with default header values. + +internal server error +*/ +type ColumnFamilySstablesUnleveledByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the column family sstables unleveled by name get default response +func (o *ColumnFamilySstablesUnleveledByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *ColumnFamilySstablesUnleveledByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *ColumnFamilySstablesUnleveledByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *ColumnFamilySstablesUnleveledByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commit_log_metrics_waiting_on_commit_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commit_log_metrics_waiting_on_commit_get_parameters.go new file mode 100644 index 0000000000..cb2a3e04b7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commit_log_metrics_waiting_on_commit_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCommitLogMetricsWaitingOnCommitGetParams creates a new CommitLogMetricsWaitingOnCommitGetParams object +// with the default values initialized. +func NewCommitLogMetricsWaitingOnCommitGetParams() *CommitLogMetricsWaitingOnCommitGetParams { + + return &CommitLogMetricsWaitingOnCommitGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCommitLogMetricsWaitingOnCommitGetParamsWithTimeout creates a new CommitLogMetricsWaitingOnCommitGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCommitLogMetricsWaitingOnCommitGetParamsWithTimeout(timeout time.Duration) *CommitLogMetricsWaitingOnCommitGetParams { + + return &CommitLogMetricsWaitingOnCommitGetParams{ + + timeout: timeout, + } +} + +// NewCommitLogMetricsWaitingOnCommitGetParamsWithContext creates a new CommitLogMetricsWaitingOnCommitGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCommitLogMetricsWaitingOnCommitGetParamsWithContext(ctx context.Context) *CommitLogMetricsWaitingOnCommitGetParams { + + return &CommitLogMetricsWaitingOnCommitGetParams{ + + Context: ctx, + } +} + +// NewCommitLogMetricsWaitingOnCommitGetParamsWithHTTPClient creates a new CommitLogMetricsWaitingOnCommitGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCommitLogMetricsWaitingOnCommitGetParamsWithHTTPClient(client *http.Client) *CommitLogMetricsWaitingOnCommitGetParams { + + return &CommitLogMetricsWaitingOnCommitGetParams{ + HTTPClient: client, + } +} + +/* +CommitLogMetricsWaitingOnCommitGetParams contains all the parameters to send to the API endpoint +for the commit log metrics waiting on commit get operation typically these are written to a http.Request +*/ +type CommitLogMetricsWaitingOnCommitGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the commit log metrics waiting on commit get params +func (o *CommitLogMetricsWaitingOnCommitGetParams) WithTimeout(timeout time.Duration) *CommitLogMetricsWaitingOnCommitGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the commit log metrics waiting on commit get params +func (o *CommitLogMetricsWaitingOnCommitGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the commit log metrics waiting on commit get params +func (o *CommitLogMetricsWaitingOnCommitGetParams) WithContext(ctx context.Context) *CommitLogMetricsWaitingOnCommitGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the commit log metrics waiting on commit get params +func (o *CommitLogMetricsWaitingOnCommitGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the commit log metrics waiting on commit get params +func (o *CommitLogMetricsWaitingOnCommitGetParams) WithHTTPClient(client *http.Client) *CommitLogMetricsWaitingOnCommitGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the commit log metrics waiting on commit get params +func (o *CommitLogMetricsWaitingOnCommitGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CommitLogMetricsWaitingOnCommitGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commit_log_metrics_waiting_on_commit_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commit_log_metrics_waiting_on_commit_get_responses.go new file mode 100644 index 0000000000..c44b5ba071 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commit_log_metrics_waiting_on_commit_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CommitLogMetricsWaitingOnCommitGetReader is a Reader for the CommitLogMetricsWaitingOnCommitGet structure. +type CommitLogMetricsWaitingOnCommitGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CommitLogMetricsWaitingOnCommitGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCommitLogMetricsWaitingOnCommitGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCommitLogMetricsWaitingOnCommitGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCommitLogMetricsWaitingOnCommitGetOK creates a CommitLogMetricsWaitingOnCommitGetOK with default headers values +func NewCommitLogMetricsWaitingOnCommitGetOK() *CommitLogMetricsWaitingOnCommitGetOK { + return &CommitLogMetricsWaitingOnCommitGetOK{} +} + +/* +CommitLogMetricsWaitingOnCommitGetOK handles this case with default header values. + +Success +*/ +type CommitLogMetricsWaitingOnCommitGetOK struct { +} + +func (o *CommitLogMetricsWaitingOnCommitGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCommitLogMetricsWaitingOnCommitGetDefault creates a CommitLogMetricsWaitingOnCommitGetDefault with default headers values +func NewCommitLogMetricsWaitingOnCommitGetDefault(code int) *CommitLogMetricsWaitingOnCommitGetDefault { + return &CommitLogMetricsWaitingOnCommitGetDefault{ + _statusCode: code, + } +} + +/* +CommitLogMetricsWaitingOnCommitGetDefault handles this case with default header values. + +internal server error +*/ +type CommitLogMetricsWaitingOnCommitGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the commit log metrics waiting on commit get default response +func (o *CommitLogMetricsWaitingOnCommitGetDefault) Code() int { + return o._statusCode +} + +func (o *CommitLogMetricsWaitingOnCommitGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CommitLogMetricsWaitingOnCommitGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CommitLogMetricsWaitingOnCommitGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commit_log_metrics_waiting_on_segment_allocation_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commit_log_metrics_waiting_on_segment_allocation_get_parameters.go new file mode 100644 index 0000000000..be54bc4b74 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commit_log_metrics_waiting_on_segment_allocation_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCommitLogMetricsWaitingOnSegmentAllocationGetParams creates a new CommitLogMetricsWaitingOnSegmentAllocationGetParams object +// with the default values initialized. +func NewCommitLogMetricsWaitingOnSegmentAllocationGetParams() *CommitLogMetricsWaitingOnSegmentAllocationGetParams { + + return &CommitLogMetricsWaitingOnSegmentAllocationGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCommitLogMetricsWaitingOnSegmentAllocationGetParamsWithTimeout creates a new CommitLogMetricsWaitingOnSegmentAllocationGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCommitLogMetricsWaitingOnSegmentAllocationGetParamsWithTimeout(timeout time.Duration) *CommitLogMetricsWaitingOnSegmentAllocationGetParams { + + return &CommitLogMetricsWaitingOnSegmentAllocationGetParams{ + + timeout: timeout, + } +} + +// NewCommitLogMetricsWaitingOnSegmentAllocationGetParamsWithContext creates a new CommitLogMetricsWaitingOnSegmentAllocationGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCommitLogMetricsWaitingOnSegmentAllocationGetParamsWithContext(ctx context.Context) *CommitLogMetricsWaitingOnSegmentAllocationGetParams { + + return &CommitLogMetricsWaitingOnSegmentAllocationGetParams{ + + Context: ctx, + } +} + +// NewCommitLogMetricsWaitingOnSegmentAllocationGetParamsWithHTTPClient creates a new CommitLogMetricsWaitingOnSegmentAllocationGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCommitLogMetricsWaitingOnSegmentAllocationGetParamsWithHTTPClient(client *http.Client) *CommitLogMetricsWaitingOnSegmentAllocationGetParams { + + return &CommitLogMetricsWaitingOnSegmentAllocationGetParams{ + HTTPClient: client, + } +} + +/* +CommitLogMetricsWaitingOnSegmentAllocationGetParams contains all the parameters to send to the API endpoint +for the commit log metrics waiting on segment allocation get operation typically these are written to a http.Request +*/ +type CommitLogMetricsWaitingOnSegmentAllocationGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the commit log metrics waiting on segment allocation get params +func (o *CommitLogMetricsWaitingOnSegmentAllocationGetParams) WithTimeout(timeout time.Duration) *CommitLogMetricsWaitingOnSegmentAllocationGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the commit log metrics waiting on segment allocation get params +func (o *CommitLogMetricsWaitingOnSegmentAllocationGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the commit log metrics waiting on segment allocation get params +func (o *CommitLogMetricsWaitingOnSegmentAllocationGetParams) WithContext(ctx context.Context) *CommitLogMetricsWaitingOnSegmentAllocationGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the commit log metrics waiting on segment allocation get params +func (o *CommitLogMetricsWaitingOnSegmentAllocationGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the commit log metrics waiting on segment allocation get params +func (o *CommitLogMetricsWaitingOnSegmentAllocationGetParams) WithHTTPClient(client *http.Client) *CommitLogMetricsWaitingOnSegmentAllocationGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the commit log metrics waiting on segment allocation get params +func (o *CommitLogMetricsWaitingOnSegmentAllocationGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CommitLogMetricsWaitingOnSegmentAllocationGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commit_log_metrics_waiting_on_segment_allocation_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commit_log_metrics_waiting_on_segment_allocation_get_responses.go new file mode 100644 index 0000000000..3c90867471 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commit_log_metrics_waiting_on_segment_allocation_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CommitLogMetricsWaitingOnSegmentAllocationGetReader is a Reader for the CommitLogMetricsWaitingOnSegmentAllocationGet structure. +type CommitLogMetricsWaitingOnSegmentAllocationGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CommitLogMetricsWaitingOnSegmentAllocationGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCommitLogMetricsWaitingOnSegmentAllocationGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCommitLogMetricsWaitingOnSegmentAllocationGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCommitLogMetricsWaitingOnSegmentAllocationGetOK creates a CommitLogMetricsWaitingOnSegmentAllocationGetOK with default headers values +func NewCommitLogMetricsWaitingOnSegmentAllocationGetOK() *CommitLogMetricsWaitingOnSegmentAllocationGetOK { + return &CommitLogMetricsWaitingOnSegmentAllocationGetOK{} +} + +/* +CommitLogMetricsWaitingOnSegmentAllocationGetOK handles this case with default header values. + +Success +*/ +type CommitLogMetricsWaitingOnSegmentAllocationGetOK struct { +} + +func (o *CommitLogMetricsWaitingOnSegmentAllocationGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCommitLogMetricsWaitingOnSegmentAllocationGetDefault creates a CommitLogMetricsWaitingOnSegmentAllocationGetDefault with default headers values +func NewCommitLogMetricsWaitingOnSegmentAllocationGetDefault(code int) *CommitLogMetricsWaitingOnSegmentAllocationGetDefault { + return &CommitLogMetricsWaitingOnSegmentAllocationGetDefault{ + _statusCode: code, + } +} + +/* +CommitLogMetricsWaitingOnSegmentAllocationGetDefault handles this case with default header values. + +internal server error +*/ +type CommitLogMetricsWaitingOnSegmentAllocationGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the commit log metrics waiting on segment allocation get default response +func (o *CommitLogMetricsWaitingOnSegmentAllocationGetDefault) Code() int { + return o._statusCode +} + +func (o *CommitLogMetricsWaitingOnSegmentAllocationGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CommitLogMetricsWaitingOnSegmentAllocationGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CommitLogMetricsWaitingOnSegmentAllocationGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_completed_tasks_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_completed_tasks_get_parameters.go new file mode 100644 index 0000000000..f76fad52da --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_completed_tasks_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCommitlogMetricsCompletedTasksGetParams creates a new CommitlogMetricsCompletedTasksGetParams object +// with the default values initialized. +func NewCommitlogMetricsCompletedTasksGetParams() *CommitlogMetricsCompletedTasksGetParams { + + return &CommitlogMetricsCompletedTasksGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCommitlogMetricsCompletedTasksGetParamsWithTimeout creates a new CommitlogMetricsCompletedTasksGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCommitlogMetricsCompletedTasksGetParamsWithTimeout(timeout time.Duration) *CommitlogMetricsCompletedTasksGetParams { + + return &CommitlogMetricsCompletedTasksGetParams{ + + timeout: timeout, + } +} + +// NewCommitlogMetricsCompletedTasksGetParamsWithContext creates a new CommitlogMetricsCompletedTasksGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCommitlogMetricsCompletedTasksGetParamsWithContext(ctx context.Context) *CommitlogMetricsCompletedTasksGetParams { + + return &CommitlogMetricsCompletedTasksGetParams{ + + Context: ctx, + } +} + +// NewCommitlogMetricsCompletedTasksGetParamsWithHTTPClient creates a new CommitlogMetricsCompletedTasksGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCommitlogMetricsCompletedTasksGetParamsWithHTTPClient(client *http.Client) *CommitlogMetricsCompletedTasksGetParams { + + return &CommitlogMetricsCompletedTasksGetParams{ + HTTPClient: client, + } +} + +/* +CommitlogMetricsCompletedTasksGetParams contains all the parameters to send to the API endpoint +for the commitlog metrics completed tasks get operation typically these are written to a http.Request +*/ +type CommitlogMetricsCompletedTasksGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the commitlog metrics completed tasks get params +func (o *CommitlogMetricsCompletedTasksGetParams) WithTimeout(timeout time.Duration) *CommitlogMetricsCompletedTasksGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the commitlog metrics completed tasks get params +func (o *CommitlogMetricsCompletedTasksGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the commitlog metrics completed tasks get params +func (o *CommitlogMetricsCompletedTasksGetParams) WithContext(ctx context.Context) *CommitlogMetricsCompletedTasksGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the commitlog metrics completed tasks get params +func (o *CommitlogMetricsCompletedTasksGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the commitlog metrics completed tasks get params +func (o *CommitlogMetricsCompletedTasksGetParams) WithHTTPClient(client *http.Client) *CommitlogMetricsCompletedTasksGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the commitlog metrics completed tasks get params +func (o *CommitlogMetricsCompletedTasksGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CommitlogMetricsCompletedTasksGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_completed_tasks_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_completed_tasks_get_responses.go new file mode 100644 index 0000000000..dc05c56bd5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_completed_tasks_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CommitlogMetricsCompletedTasksGetReader is a Reader for the CommitlogMetricsCompletedTasksGet structure. +type CommitlogMetricsCompletedTasksGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CommitlogMetricsCompletedTasksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCommitlogMetricsCompletedTasksGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCommitlogMetricsCompletedTasksGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCommitlogMetricsCompletedTasksGetOK creates a CommitlogMetricsCompletedTasksGetOK with default headers values +func NewCommitlogMetricsCompletedTasksGetOK() *CommitlogMetricsCompletedTasksGetOK { + return &CommitlogMetricsCompletedTasksGetOK{} +} + +/* +CommitlogMetricsCompletedTasksGetOK handles this case with default header values. + +Success +*/ +type CommitlogMetricsCompletedTasksGetOK struct { + Payload interface{} +} + +func (o *CommitlogMetricsCompletedTasksGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CommitlogMetricsCompletedTasksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCommitlogMetricsCompletedTasksGetDefault creates a CommitlogMetricsCompletedTasksGetDefault with default headers values +func NewCommitlogMetricsCompletedTasksGetDefault(code int) *CommitlogMetricsCompletedTasksGetDefault { + return &CommitlogMetricsCompletedTasksGetDefault{ + _statusCode: code, + } +} + +/* +CommitlogMetricsCompletedTasksGetDefault handles this case with default header values. + +internal server error +*/ +type CommitlogMetricsCompletedTasksGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the commitlog metrics completed tasks get default response +func (o *CommitlogMetricsCompletedTasksGetDefault) Code() int { + return o._statusCode +} + +func (o *CommitlogMetricsCompletedTasksGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CommitlogMetricsCompletedTasksGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CommitlogMetricsCompletedTasksGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_pending_tasks_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_pending_tasks_get_parameters.go new file mode 100644 index 0000000000..ef280c9289 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_pending_tasks_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCommitlogMetricsPendingTasksGetParams creates a new CommitlogMetricsPendingTasksGetParams object +// with the default values initialized. +func NewCommitlogMetricsPendingTasksGetParams() *CommitlogMetricsPendingTasksGetParams { + + return &CommitlogMetricsPendingTasksGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCommitlogMetricsPendingTasksGetParamsWithTimeout creates a new CommitlogMetricsPendingTasksGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCommitlogMetricsPendingTasksGetParamsWithTimeout(timeout time.Duration) *CommitlogMetricsPendingTasksGetParams { + + return &CommitlogMetricsPendingTasksGetParams{ + + timeout: timeout, + } +} + +// NewCommitlogMetricsPendingTasksGetParamsWithContext creates a new CommitlogMetricsPendingTasksGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCommitlogMetricsPendingTasksGetParamsWithContext(ctx context.Context) *CommitlogMetricsPendingTasksGetParams { + + return &CommitlogMetricsPendingTasksGetParams{ + + Context: ctx, + } +} + +// NewCommitlogMetricsPendingTasksGetParamsWithHTTPClient creates a new CommitlogMetricsPendingTasksGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCommitlogMetricsPendingTasksGetParamsWithHTTPClient(client *http.Client) *CommitlogMetricsPendingTasksGetParams { + + return &CommitlogMetricsPendingTasksGetParams{ + HTTPClient: client, + } +} + +/* +CommitlogMetricsPendingTasksGetParams contains all the parameters to send to the API endpoint +for the commitlog metrics pending tasks get operation typically these are written to a http.Request +*/ +type CommitlogMetricsPendingTasksGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the commitlog metrics pending tasks get params +func (o *CommitlogMetricsPendingTasksGetParams) WithTimeout(timeout time.Duration) *CommitlogMetricsPendingTasksGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the commitlog metrics pending tasks get params +func (o *CommitlogMetricsPendingTasksGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the commitlog metrics pending tasks get params +func (o *CommitlogMetricsPendingTasksGetParams) WithContext(ctx context.Context) *CommitlogMetricsPendingTasksGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the commitlog metrics pending tasks get params +func (o *CommitlogMetricsPendingTasksGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the commitlog metrics pending tasks get params +func (o *CommitlogMetricsPendingTasksGetParams) WithHTTPClient(client *http.Client) *CommitlogMetricsPendingTasksGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the commitlog metrics pending tasks get params +func (o *CommitlogMetricsPendingTasksGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CommitlogMetricsPendingTasksGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_pending_tasks_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_pending_tasks_get_responses.go new file mode 100644 index 0000000000..9323a0e1ff --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_pending_tasks_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CommitlogMetricsPendingTasksGetReader is a Reader for the CommitlogMetricsPendingTasksGet structure. +type CommitlogMetricsPendingTasksGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CommitlogMetricsPendingTasksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCommitlogMetricsPendingTasksGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCommitlogMetricsPendingTasksGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCommitlogMetricsPendingTasksGetOK creates a CommitlogMetricsPendingTasksGetOK with default headers values +func NewCommitlogMetricsPendingTasksGetOK() *CommitlogMetricsPendingTasksGetOK { + return &CommitlogMetricsPendingTasksGetOK{} +} + +/* +CommitlogMetricsPendingTasksGetOK handles this case with default header values. + +Success +*/ +type CommitlogMetricsPendingTasksGetOK struct { + Payload interface{} +} + +func (o *CommitlogMetricsPendingTasksGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CommitlogMetricsPendingTasksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCommitlogMetricsPendingTasksGetDefault creates a CommitlogMetricsPendingTasksGetDefault with default headers values +func NewCommitlogMetricsPendingTasksGetDefault(code int) *CommitlogMetricsPendingTasksGetDefault { + return &CommitlogMetricsPendingTasksGetDefault{ + _statusCode: code, + } +} + +/* +CommitlogMetricsPendingTasksGetDefault handles this case with default header values. + +internal server error +*/ +type CommitlogMetricsPendingTasksGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the commitlog metrics pending tasks get default response +func (o *CommitlogMetricsPendingTasksGetDefault) Code() int { + return o._statusCode +} + +func (o *CommitlogMetricsPendingTasksGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CommitlogMetricsPendingTasksGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CommitlogMetricsPendingTasksGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_total_commit_log_size_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_total_commit_log_size_get_parameters.go new file mode 100644 index 0000000000..c1ddab7221 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_total_commit_log_size_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCommitlogMetricsTotalCommitLogSizeGetParams creates a new CommitlogMetricsTotalCommitLogSizeGetParams object +// with the default values initialized. +func NewCommitlogMetricsTotalCommitLogSizeGetParams() *CommitlogMetricsTotalCommitLogSizeGetParams { + + return &CommitlogMetricsTotalCommitLogSizeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCommitlogMetricsTotalCommitLogSizeGetParamsWithTimeout creates a new CommitlogMetricsTotalCommitLogSizeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCommitlogMetricsTotalCommitLogSizeGetParamsWithTimeout(timeout time.Duration) *CommitlogMetricsTotalCommitLogSizeGetParams { + + return &CommitlogMetricsTotalCommitLogSizeGetParams{ + + timeout: timeout, + } +} + +// NewCommitlogMetricsTotalCommitLogSizeGetParamsWithContext creates a new CommitlogMetricsTotalCommitLogSizeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCommitlogMetricsTotalCommitLogSizeGetParamsWithContext(ctx context.Context) *CommitlogMetricsTotalCommitLogSizeGetParams { + + return &CommitlogMetricsTotalCommitLogSizeGetParams{ + + Context: ctx, + } +} + +// NewCommitlogMetricsTotalCommitLogSizeGetParamsWithHTTPClient creates a new CommitlogMetricsTotalCommitLogSizeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCommitlogMetricsTotalCommitLogSizeGetParamsWithHTTPClient(client *http.Client) *CommitlogMetricsTotalCommitLogSizeGetParams { + + return &CommitlogMetricsTotalCommitLogSizeGetParams{ + HTTPClient: client, + } +} + +/* +CommitlogMetricsTotalCommitLogSizeGetParams contains all the parameters to send to the API endpoint +for the commitlog metrics total commit log size get operation typically these are written to a http.Request +*/ +type CommitlogMetricsTotalCommitLogSizeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the commitlog metrics total commit log size get params +func (o *CommitlogMetricsTotalCommitLogSizeGetParams) WithTimeout(timeout time.Duration) *CommitlogMetricsTotalCommitLogSizeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the commitlog metrics total commit log size get params +func (o *CommitlogMetricsTotalCommitLogSizeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the commitlog metrics total commit log size get params +func (o *CommitlogMetricsTotalCommitLogSizeGetParams) WithContext(ctx context.Context) *CommitlogMetricsTotalCommitLogSizeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the commitlog metrics total commit log size get params +func (o *CommitlogMetricsTotalCommitLogSizeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the commitlog metrics total commit log size get params +func (o *CommitlogMetricsTotalCommitLogSizeGetParams) WithHTTPClient(client *http.Client) *CommitlogMetricsTotalCommitLogSizeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the commitlog metrics total commit log size get params +func (o *CommitlogMetricsTotalCommitLogSizeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CommitlogMetricsTotalCommitLogSizeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_total_commit_log_size_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_total_commit_log_size_get_responses.go new file mode 100644 index 0000000000..6f034a3ba5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_metrics_total_commit_log_size_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CommitlogMetricsTotalCommitLogSizeGetReader is a Reader for the CommitlogMetricsTotalCommitLogSizeGet structure. +type CommitlogMetricsTotalCommitLogSizeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CommitlogMetricsTotalCommitLogSizeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCommitlogMetricsTotalCommitLogSizeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCommitlogMetricsTotalCommitLogSizeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCommitlogMetricsTotalCommitLogSizeGetOK creates a CommitlogMetricsTotalCommitLogSizeGetOK with default headers values +func NewCommitlogMetricsTotalCommitLogSizeGetOK() *CommitlogMetricsTotalCommitLogSizeGetOK { + return &CommitlogMetricsTotalCommitLogSizeGetOK{} +} + +/* +CommitlogMetricsTotalCommitLogSizeGetOK handles this case with default header values. + +Success +*/ +type CommitlogMetricsTotalCommitLogSizeGetOK struct { + Payload interface{} +} + +func (o *CommitlogMetricsTotalCommitLogSizeGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CommitlogMetricsTotalCommitLogSizeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCommitlogMetricsTotalCommitLogSizeGetDefault creates a CommitlogMetricsTotalCommitLogSizeGetDefault with default headers values +func NewCommitlogMetricsTotalCommitLogSizeGetDefault(code int) *CommitlogMetricsTotalCommitLogSizeGetDefault { + return &CommitlogMetricsTotalCommitLogSizeGetDefault{ + _statusCode: code, + } +} + +/* +CommitlogMetricsTotalCommitLogSizeGetDefault handles this case with default header values. + +internal server error +*/ +type CommitlogMetricsTotalCommitLogSizeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the commitlog metrics total commit log size get default response +func (o *CommitlogMetricsTotalCommitLogSizeGetDefault) Code() int { + return o._statusCode +} + +func (o *CommitlogMetricsTotalCommitLogSizeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CommitlogMetricsTotalCommitLogSizeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CommitlogMetricsTotalCommitLogSizeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_recover_by_path_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_recover_by_path_post_parameters.go new file mode 100644 index 0000000000..997f83771f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_recover_by_path_post_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCommitlogRecoverByPathPostParams creates a new CommitlogRecoverByPathPostParams object +// with the default values initialized. +func NewCommitlogRecoverByPathPostParams() *CommitlogRecoverByPathPostParams { + var () + return &CommitlogRecoverByPathPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCommitlogRecoverByPathPostParamsWithTimeout creates a new CommitlogRecoverByPathPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCommitlogRecoverByPathPostParamsWithTimeout(timeout time.Duration) *CommitlogRecoverByPathPostParams { + var () + return &CommitlogRecoverByPathPostParams{ + + timeout: timeout, + } +} + +// NewCommitlogRecoverByPathPostParamsWithContext creates a new CommitlogRecoverByPathPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCommitlogRecoverByPathPostParamsWithContext(ctx context.Context) *CommitlogRecoverByPathPostParams { + var () + return &CommitlogRecoverByPathPostParams{ + + Context: ctx, + } +} + +// NewCommitlogRecoverByPathPostParamsWithHTTPClient creates a new CommitlogRecoverByPathPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCommitlogRecoverByPathPostParamsWithHTTPClient(client *http.Client) *CommitlogRecoverByPathPostParams { + var () + return &CommitlogRecoverByPathPostParams{ + HTTPClient: client, + } +} + +/* +CommitlogRecoverByPathPostParams contains all the parameters to send to the API endpoint +for the commitlog recover by path post operation typically these are written to a http.Request +*/ +type CommitlogRecoverByPathPostParams struct { + + /*Path + Full path of file or directory + + */ + Path string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the commitlog recover by path post params +func (o *CommitlogRecoverByPathPostParams) WithTimeout(timeout time.Duration) *CommitlogRecoverByPathPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the commitlog recover by path post params +func (o *CommitlogRecoverByPathPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the commitlog recover by path post params +func (o *CommitlogRecoverByPathPostParams) WithContext(ctx context.Context) *CommitlogRecoverByPathPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the commitlog recover by path post params +func (o *CommitlogRecoverByPathPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the commitlog recover by path post params +func (o *CommitlogRecoverByPathPostParams) WithHTTPClient(client *http.Client) *CommitlogRecoverByPathPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the commitlog recover by path post params +func (o *CommitlogRecoverByPathPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPath adds the path to the commitlog recover by path post params +func (o *CommitlogRecoverByPathPostParams) WithPath(path string) *CommitlogRecoverByPathPostParams { + o.SetPath(path) + return o +} + +// SetPath adds the path to the commitlog recover by path post params +func (o *CommitlogRecoverByPathPostParams) SetPath(path string) { + o.Path = path +} + +// WriteToRequest writes these params to a swagger request +func (o *CommitlogRecoverByPathPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param path + if err := r.SetPathParam("path", o.Path); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_recover_by_path_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_recover_by_path_post_responses.go new file mode 100644 index 0000000000..bdd28c39b2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_recover_by_path_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CommitlogRecoverByPathPostReader is a Reader for the CommitlogRecoverByPathPost structure. +type CommitlogRecoverByPathPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CommitlogRecoverByPathPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCommitlogRecoverByPathPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCommitlogRecoverByPathPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCommitlogRecoverByPathPostOK creates a CommitlogRecoverByPathPostOK with default headers values +func NewCommitlogRecoverByPathPostOK() *CommitlogRecoverByPathPostOK { + return &CommitlogRecoverByPathPostOK{} +} + +/* +CommitlogRecoverByPathPostOK handles this case with default header values. + +Success +*/ +type CommitlogRecoverByPathPostOK struct { +} + +func (o *CommitlogRecoverByPathPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCommitlogRecoverByPathPostDefault creates a CommitlogRecoverByPathPostDefault with default headers values +func NewCommitlogRecoverByPathPostDefault(code int) *CommitlogRecoverByPathPostDefault { + return &CommitlogRecoverByPathPostDefault{ + _statusCode: code, + } +} + +/* +CommitlogRecoverByPathPostDefault handles this case with default header values. + +internal server error +*/ +type CommitlogRecoverByPathPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the commitlog recover by path post default response +func (o *CommitlogRecoverByPathPostDefault) Code() int { + return o._statusCode +} + +func (o *CommitlogRecoverByPathPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CommitlogRecoverByPathPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CommitlogRecoverByPathPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_segments_active_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_segments_active_get_parameters.go new file mode 100644 index 0000000000..323b5adbb6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_segments_active_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCommitlogSegmentsActiveGetParams creates a new CommitlogSegmentsActiveGetParams object +// with the default values initialized. +func NewCommitlogSegmentsActiveGetParams() *CommitlogSegmentsActiveGetParams { + + return &CommitlogSegmentsActiveGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCommitlogSegmentsActiveGetParamsWithTimeout creates a new CommitlogSegmentsActiveGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCommitlogSegmentsActiveGetParamsWithTimeout(timeout time.Duration) *CommitlogSegmentsActiveGetParams { + + return &CommitlogSegmentsActiveGetParams{ + + timeout: timeout, + } +} + +// NewCommitlogSegmentsActiveGetParamsWithContext creates a new CommitlogSegmentsActiveGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCommitlogSegmentsActiveGetParamsWithContext(ctx context.Context) *CommitlogSegmentsActiveGetParams { + + return &CommitlogSegmentsActiveGetParams{ + + Context: ctx, + } +} + +// NewCommitlogSegmentsActiveGetParamsWithHTTPClient creates a new CommitlogSegmentsActiveGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCommitlogSegmentsActiveGetParamsWithHTTPClient(client *http.Client) *CommitlogSegmentsActiveGetParams { + + return &CommitlogSegmentsActiveGetParams{ + HTTPClient: client, + } +} + +/* +CommitlogSegmentsActiveGetParams contains all the parameters to send to the API endpoint +for the commitlog segments active get operation typically these are written to a http.Request +*/ +type CommitlogSegmentsActiveGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the commitlog segments active get params +func (o *CommitlogSegmentsActiveGetParams) WithTimeout(timeout time.Duration) *CommitlogSegmentsActiveGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the commitlog segments active get params +func (o *CommitlogSegmentsActiveGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the commitlog segments active get params +func (o *CommitlogSegmentsActiveGetParams) WithContext(ctx context.Context) *CommitlogSegmentsActiveGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the commitlog segments active get params +func (o *CommitlogSegmentsActiveGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the commitlog segments active get params +func (o *CommitlogSegmentsActiveGetParams) WithHTTPClient(client *http.Client) *CommitlogSegmentsActiveGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the commitlog segments active get params +func (o *CommitlogSegmentsActiveGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CommitlogSegmentsActiveGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_segments_active_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_segments_active_get_responses.go new file mode 100644 index 0000000000..71c4967ac2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_segments_active_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CommitlogSegmentsActiveGetReader is a Reader for the CommitlogSegmentsActiveGet structure. +type CommitlogSegmentsActiveGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CommitlogSegmentsActiveGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCommitlogSegmentsActiveGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCommitlogSegmentsActiveGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCommitlogSegmentsActiveGetOK creates a CommitlogSegmentsActiveGetOK with default headers values +func NewCommitlogSegmentsActiveGetOK() *CommitlogSegmentsActiveGetOK { + return &CommitlogSegmentsActiveGetOK{} +} + +/* +CommitlogSegmentsActiveGetOK handles this case with default header values. + +Success +*/ +type CommitlogSegmentsActiveGetOK struct { + Payload []string +} + +func (o *CommitlogSegmentsActiveGetOK) GetPayload() []string { + return o.Payload +} + +func (o *CommitlogSegmentsActiveGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCommitlogSegmentsActiveGetDefault creates a CommitlogSegmentsActiveGetDefault with default headers values +func NewCommitlogSegmentsActiveGetDefault(code int) *CommitlogSegmentsActiveGetDefault { + return &CommitlogSegmentsActiveGetDefault{ + _statusCode: code, + } +} + +/* +CommitlogSegmentsActiveGetDefault handles this case with default header values. + +internal server error +*/ +type CommitlogSegmentsActiveGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the commitlog segments active get default response +func (o *CommitlogSegmentsActiveGetDefault) Code() int { + return o._statusCode +} + +func (o *CommitlogSegmentsActiveGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CommitlogSegmentsActiveGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CommitlogSegmentsActiveGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_segments_archiving_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_segments_archiving_get_parameters.go new file mode 100644 index 0000000000..be65a05c36 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_segments_archiving_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCommitlogSegmentsArchivingGetParams creates a new CommitlogSegmentsArchivingGetParams object +// with the default values initialized. +func NewCommitlogSegmentsArchivingGetParams() *CommitlogSegmentsArchivingGetParams { + + return &CommitlogSegmentsArchivingGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCommitlogSegmentsArchivingGetParamsWithTimeout creates a new CommitlogSegmentsArchivingGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCommitlogSegmentsArchivingGetParamsWithTimeout(timeout time.Duration) *CommitlogSegmentsArchivingGetParams { + + return &CommitlogSegmentsArchivingGetParams{ + + timeout: timeout, + } +} + +// NewCommitlogSegmentsArchivingGetParamsWithContext creates a new CommitlogSegmentsArchivingGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCommitlogSegmentsArchivingGetParamsWithContext(ctx context.Context) *CommitlogSegmentsArchivingGetParams { + + return &CommitlogSegmentsArchivingGetParams{ + + Context: ctx, + } +} + +// NewCommitlogSegmentsArchivingGetParamsWithHTTPClient creates a new CommitlogSegmentsArchivingGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCommitlogSegmentsArchivingGetParamsWithHTTPClient(client *http.Client) *CommitlogSegmentsArchivingGetParams { + + return &CommitlogSegmentsArchivingGetParams{ + HTTPClient: client, + } +} + +/* +CommitlogSegmentsArchivingGetParams contains all the parameters to send to the API endpoint +for the commitlog segments archiving get operation typically these are written to a http.Request +*/ +type CommitlogSegmentsArchivingGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the commitlog segments archiving get params +func (o *CommitlogSegmentsArchivingGetParams) WithTimeout(timeout time.Duration) *CommitlogSegmentsArchivingGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the commitlog segments archiving get params +func (o *CommitlogSegmentsArchivingGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the commitlog segments archiving get params +func (o *CommitlogSegmentsArchivingGetParams) WithContext(ctx context.Context) *CommitlogSegmentsArchivingGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the commitlog segments archiving get params +func (o *CommitlogSegmentsArchivingGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the commitlog segments archiving get params +func (o *CommitlogSegmentsArchivingGetParams) WithHTTPClient(client *http.Client) *CommitlogSegmentsArchivingGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the commitlog segments archiving get params +func (o *CommitlogSegmentsArchivingGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CommitlogSegmentsArchivingGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_segments_archiving_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_segments_archiving_get_responses.go new file mode 100644 index 0000000000..4f2df544a0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/commitlog_segments_archiving_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CommitlogSegmentsArchivingGetReader is a Reader for the CommitlogSegmentsArchivingGet structure. +type CommitlogSegmentsArchivingGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CommitlogSegmentsArchivingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCommitlogSegmentsArchivingGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCommitlogSegmentsArchivingGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCommitlogSegmentsArchivingGetOK creates a CommitlogSegmentsArchivingGetOK with default headers values +func NewCommitlogSegmentsArchivingGetOK() *CommitlogSegmentsArchivingGetOK { + return &CommitlogSegmentsArchivingGetOK{} +} + +/* +CommitlogSegmentsArchivingGetOK handles this case with default header values. + +Success +*/ +type CommitlogSegmentsArchivingGetOK struct { + Payload []string +} + +func (o *CommitlogSegmentsArchivingGetOK) GetPayload() []string { + return o.Payload +} + +func (o *CommitlogSegmentsArchivingGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCommitlogSegmentsArchivingGetDefault creates a CommitlogSegmentsArchivingGetDefault with default headers values +func NewCommitlogSegmentsArchivingGetDefault(code int) *CommitlogSegmentsArchivingGetDefault { + return &CommitlogSegmentsArchivingGetDefault{ + _statusCode: code, + } +} + +/* +CommitlogSegmentsArchivingGetDefault handles this case with default header values. + +internal server error +*/ +type CommitlogSegmentsArchivingGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the commitlog segments archiving get default response +func (o *CommitlogSegmentsArchivingGetDefault) Code() int { + return o._statusCode +} + +func (o *CommitlogSegmentsArchivingGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CommitlogSegmentsArchivingGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CommitlogSegmentsArchivingGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compaction_history_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compaction_history_get_parameters.go new file mode 100644 index 0000000000..31580ab19a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compaction_history_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCompactionManagerCompactionHistoryGetParams creates a new CompactionManagerCompactionHistoryGetParams object +// with the default values initialized. +func NewCompactionManagerCompactionHistoryGetParams() *CompactionManagerCompactionHistoryGetParams { + + return &CompactionManagerCompactionHistoryGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCompactionManagerCompactionHistoryGetParamsWithTimeout creates a new CompactionManagerCompactionHistoryGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCompactionManagerCompactionHistoryGetParamsWithTimeout(timeout time.Duration) *CompactionManagerCompactionHistoryGetParams { + + return &CompactionManagerCompactionHistoryGetParams{ + + timeout: timeout, + } +} + +// NewCompactionManagerCompactionHistoryGetParamsWithContext creates a new CompactionManagerCompactionHistoryGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCompactionManagerCompactionHistoryGetParamsWithContext(ctx context.Context) *CompactionManagerCompactionHistoryGetParams { + + return &CompactionManagerCompactionHistoryGetParams{ + + Context: ctx, + } +} + +// NewCompactionManagerCompactionHistoryGetParamsWithHTTPClient creates a new CompactionManagerCompactionHistoryGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCompactionManagerCompactionHistoryGetParamsWithHTTPClient(client *http.Client) *CompactionManagerCompactionHistoryGetParams { + + return &CompactionManagerCompactionHistoryGetParams{ + HTTPClient: client, + } +} + +/* +CompactionManagerCompactionHistoryGetParams contains all the parameters to send to the API endpoint +for the compaction manager compaction history get operation typically these are written to a http.Request +*/ +type CompactionManagerCompactionHistoryGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the compaction manager compaction history get params +func (o *CompactionManagerCompactionHistoryGetParams) WithTimeout(timeout time.Duration) *CompactionManagerCompactionHistoryGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the compaction manager compaction history get params +func (o *CompactionManagerCompactionHistoryGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the compaction manager compaction history get params +func (o *CompactionManagerCompactionHistoryGetParams) WithContext(ctx context.Context) *CompactionManagerCompactionHistoryGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the compaction manager compaction history get params +func (o *CompactionManagerCompactionHistoryGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the compaction manager compaction history get params +func (o *CompactionManagerCompactionHistoryGetParams) WithHTTPClient(client *http.Client) *CompactionManagerCompactionHistoryGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the compaction manager compaction history get params +func (o *CompactionManagerCompactionHistoryGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CompactionManagerCompactionHistoryGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compaction_history_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compaction_history_get_responses.go new file mode 100644 index 0000000000..207a1793aa --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compaction_history_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CompactionManagerCompactionHistoryGetReader is a Reader for the CompactionManagerCompactionHistoryGet structure. +type CompactionManagerCompactionHistoryGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CompactionManagerCompactionHistoryGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCompactionManagerCompactionHistoryGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCompactionManagerCompactionHistoryGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCompactionManagerCompactionHistoryGetOK creates a CompactionManagerCompactionHistoryGetOK with default headers values +func NewCompactionManagerCompactionHistoryGetOK() *CompactionManagerCompactionHistoryGetOK { + return &CompactionManagerCompactionHistoryGetOK{} +} + +/* +CompactionManagerCompactionHistoryGetOK handles this case with default header values. + +Success +*/ +type CompactionManagerCompactionHistoryGetOK struct { + Payload []*models.History +} + +func (o *CompactionManagerCompactionHistoryGetOK) GetPayload() []*models.History { + return o.Payload +} + +func (o *CompactionManagerCompactionHistoryGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCompactionManagerCompactionHistoryGetDefault creates a CompactionManagerCompactionHistoryGetDefault with default headers values +func NewCompactionManagerCompactionHistoryGetDefault(code int) *CompactionManagerCompactionHistoryGetDefault { + return &CompactionManagerCompactionHistoryGetDefault{ + _statusCode: code, + } +} + +/* +CompactionManagerCompactionHistoryGetDefault handles this case with default header values. + +internal server error +*/ +type CompactionManagerCompactionHistoryGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the compaction manager compaction history get default response +func (o *CompactionManagerCompactionHistoryGetDefault) Code() int { + return o._statusCode +} + +func (o *CompactionManagerCompactionHistoryGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CompactionManagerCompactionHistoryGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CompactionManagerCompactionHistoryGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compaction_info_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compaction_info_get_parameters.go new file mode 100644 index 0000000000..67c8639f06 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compaction_info_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCompactionManagerCompactionInfoGetParams creates a new CompactionManagerCompactionInfoGetParams object +// with the default values initialized. +func NewCompactionManagerCompactionInfoGetParams() *CompactionManagerCompactionInfoGetParams { + + return &CompactionManagerCompactionInfoGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCompactionManagerCompactionInfoGetParamsWithTimeout creates a new CompactionManagerCompactionInfoGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCompactionManagerCompactionInfoGetParamsWithTimeout(timeout time.Duration) *CompactionManagerCompactionInfoGetParams { + + return &CompactionManagerCompactionInfoGetParams{ + + timeout: timeout, + } +} + +// NewCompactionManagerCompactionInfoGetParamsWithContext creates a new CompactionManagerCompactionInfoGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCompactionManagerCompactionInfoGetParamsWithContext(ctx context.Context) *CompactionManagerCompactionInfoGetParams { + + return &CompactionManagerCompactionInfoGetParams{ + + Context: ctx, + } +} + +// NewCompactionManagerCompactionInfoGetParamsWithHTTPClient creates a new CompactionManagerCompactionInfoGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCompactionManagerCompactionInfoGetParamsWithHTTPClient(client *http.Client) *CompactionManagerCompactionInfoGetParams { + + return &CompactionManagerCompactionInfoGetParams{ + HTTPClient: client, + } +} + +/* +CompactionManagerCompactionInfoGetParams contains all the parameters to send to the API endpoint +for the compaction manager compaction info get operation typically these are written to a http.Request +*/ +type CompactionManagerCompactionInfoGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the compaction manager compaction info get params +func (o *CompactionManagerCompactionInfoGetParams) WithTimeout(timeout time.Duration) *CompactionManagerCompactionInfoGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the compaction manager compaction info get params +func (o *CompactionManagerCompactionInfoGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the compaction manager compaction info get params +func (o *CompactionManagerCompactionInfoGetParams) WithContext(ctx context.Context) *CompactionManagerCompactionInfoGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the compaction manager compaction info get params +func (o *CompactionManagerCompactionInfoGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the compaction manager compaction info get params +func (o *CompactionManagerCompactionInfoGetParams) WithHTTPClient(client *http.Client) *CompactionManagerCompactionInfoGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the compaction manager compaction info get params +func (o *CompactionManagerCompactionInfoGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CompactionManagerCompactionInfoGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compaction_info_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compaction_info_get_responses.go new file mode 100644 index 0000000000..19db4d2374 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compaction_info_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CompactionManagerCompactionInfoGetReader is a Reader for the CompactionManagerCompactionInfoGet structure. +type CompactionManagerCompactionInfoGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CompactionManagerCompactionInfoGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCompactionManagerCompactionInfoGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCompactionManagerCompactionInfoGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCompactionManagerCompactionInfoGetOK creates a CompactionManagerCompactionInfoGetOK with default headers values +func NewCompactionManagerCompactionInfoGetOK() *CompactionManagerCompactionInfoGetOK { + return &CompactionManagerCompactionInfoGetOK{} +} + +/* +CompactionManagerCompactionInfoGetOK handles this case with default header values. + +Success +*/ +type CompactionManagerCompactionInfoGetOK struct { + Payload []*models.CompactionInfo +} + +func (o *CompactionManagerCompactionInfoGetOK) GetPayload() []*models.CompactionInfo { + return o.Payload +} + +func (o *CompactionManagerCompactionInfoGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCompactionManagerCompactionInfoGetDefault creates a CompactionManagerCompactionInfoGetDefault with default headers values +func NewCompactionManagerCompactionInfoGetDefault(code int) *CompactionManagerCompactionInfoGetDefault { + return &CompactionManagerCompactionInfoGetDefault{ + _statusCode: code, + } +} + +/* +CompactionManagerCompactionInfoGetDefault handles this case with default header values. + +internal server error +*/ +type CompactionManagerCompactionInfoGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the compaction manager compaction info get default response +func (o *CompactionManagerCompactionInfoGetDefault) Code() int { + return o._statusCode +} + +func (o *CompactionManagerCompactionInfoGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CompactionManagerCompactionInfoGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CompactionManagerCompactionInfoGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compactions_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compactions_get_parameters.go new file mode 100644 index 0000000000..5ee958a989 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compactions_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCompactionManagerCompactionsGetParams creates a new CompactionManagerCompactionsGetParams object +// with the default values initialized. +func NewCompactionManagerCompactionsGetParams() *CompactionManagerCompactionsGetParams { + + return &CompactionManagerCompactionsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCompactionManagerCompactionsGetParamsWithTimeout creates a new CompactionManagerCompactionsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCompactionManagerCompactionsGetParamsWithTimeout(timeout time.Duration) *CompactionManagerCompactionsGetParams { + + return &CompactionManagerCompactionsGetParams{ + + timeout: timeout, + } +} + +// NewCompactionManagerCompactionsGetParamsWithContext creates a new CompactionManagerCompactionsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCompactionManagerCompactionsGetParamsWithContext(ctx context.Context) *CompactionManagerCompactionsGetParams { + + return &CompactionManagerCompactionsGetParams{ + + Context: ctx, + } +} + +// NewCompactionManagerCompactionsGetParamsWithHTTPClient creates a new CompactionManagerCompactionsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCompactionManagerCompactionsGetParamsWithHTTPClient(client *http.Client) *CompactionManagerCompactionsGetParams { + + return &CompactionManagerCompactionsGetParams{ + HTTPClient: client, + } +} + +/* +CompactionManagerCompactionsGetParams contains all the parameters to send to the API endpoint +for the compaction manager compactions get operation typically these are written to a http.Request +*/ +type CompactionManagerCompactionsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the compaction manager compactions get params +func (o *CompactionManagerCompactionsGetParams) WithTimeout(timeout time.Duration) *CompactionManagerCompactionsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the compaction manager compactions get params +func (o *CompactionManagerCompactionsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the compaction manager compactions get params +func (o *CompactionManagerCompactionsGetParams) WithContext(ctx context.Context) *CompactionManagerCompactionsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the compaction manager compactions get params +func (o *CompactionManagerCompactionsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the compaction manager compactions get params +func (o *CompactionManagerCompactionsGetParams) WithHTTPClient(client *http.Client) *CompactionManagerCompactionsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the compaction manager compactions get params +func (o *CompactionManagerCompactionsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CompactionManagerCompactionsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compactions_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compactions_get_responses.go new file mode 100644 index 0000000000..97ee7e14b6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_compactions_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CompactionManagerCompactionsGetReader is a Reader for the CompactionManagerCompactionsGet structure. +type CompactionManagerCompactionsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CompactionManagerCompactionsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCompactionManagerCompactionsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCompactionManagerCompactionsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCompactionManagerCompactionsGetOK creates a CompactionManagerCompactionsGetOK with default headers values +func NewCompactionManagerCompactionsGetOK() *CompactionManagerCompactionsGetOK { + return &CompactionManagerCompactionsGetOK{} +} + +/* +CompactionManagerCompactionsGetOK handles this case with default header values. + +Success +*/ +type CompactionManagerCompactionsGetOK struct { + Payload []*models.Summary +} + +func (o *CompactionManagerCompactionsGetOK) GetPayload() []*models.Summary { + return o.Payload +} + +func (o *CompactionManagerCompactionsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCompactionManagerCompactionsGetDefault creates a CompactionManagerCompactionsGetDefault with default headers values +func NewCompactionManagerCompactionsGetDefault(code int) *CompactionManagerCompactionsGetDefault { + return &CompactionManagerCompactionsGetDefault{ + _statusCode: code, + } +} + +/* +CompactionManagerCompactionsGetDefault handles this case with default header values. + +internal server error +*/ +type CompactionManagerCompactionsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the compaction manager compactions get default response +func (o *CompactionManagerCompactionsGetDefault) Code() int { + return o._statusCode +} + +func (o *CompactionManagerCompactionsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CompactionManagerCompactionsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CompactionManagerCompactionsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_force_user_defined_compaction_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_force_user_defined_compaction_post_parameters.go new file mode 100644 index 0000000000..6348a41ad6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_force_user_defined_compaction_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCompactionManagerForceUserDefinedCompactionPostParams creates a new CompactionManagerForceUserDefinedCompactionPostParams object +// with the default values initialized. +func NewCompactionManagerForceUserDefinedCompactionPostParams() *CompactionManagerForceUserDefinedCompactionPostParams { + var () + return &CompactionManagerForceUserDefinedCompactionPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCompactionManagerForceUserDefinedCompactionPostParamsWithTimeout creates a new CompactionManagerForceUserDefinedCompactionPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCompactionManagerForceUserDefinedCompactionPostParamsWithTimeout(timeout time.Duration) *CompactionManagerForceUserDefinedCompactionPostParams { + var () + return &CompactionManagerForceUserDefinedCompactionPostParams{ + + timeout: timeout, + } +} + +// NewCompactionManagerForceUserDefinedCompactionPostParamsWithContext creates a new CompactionManagerForceUserDefinedCompactionPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCompactionManagerForceUserDefinedCompactionPostParamsWithContext(ctx context.Context) *CompactionManagerForceUserDefinedCompactionPostParams { + var () + return &CompactionManagerForceUserDefinedCompactionPostParams{ + + Context: ctx, + } +} + +// NewCompactionManagerForceUserDefinedCompactionPostParamsWithHTTPClient creates a new CompactionManagerForceUserDefinedCompactionPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCompactionManagerForceUserDefinedCompactionPostParamsWithHTTPClient(client *http.Client) *CompactionManagerForceUserDefinedCompactionPostParams { + var () + return &CompactionManagerForceUserDefinedCompactionPostParams{ + HTTPClient: client, + } +} + +/* +CompactionManagerForceUserDefinedCompactionPostParams contains all the parameters to send to the API endpoint +for the compaction manager force user defined compaction post operation typically these are written to a http.Request +*/ +type CompactionManagerForceUserDefinedCompactionPostParams struct { + + /*DataFiles + a comma separated list of sstable file to compact. must contain keyspace and columnfamily name in path(for 2.1+) or file name itself + + */ + DataFiles string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the compaction manager force user defined compaction post params +func (o *CompactionManagerForceUserDefinedCompactionPostParams) WithTimeout(timeout time.Duration) *CompactionManagerForceUserDefinedCompactionPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the compaction manager force user defined compaction post params +func (o *CompactionManagerForceUserDefinedCompactionPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the compaction manager force user defined compaction post params +func (o *CompactionManagerForceUserDefinedCompactionPostParams) WithContext(ctx context.Context) *CompactionManagerForceUserDefinedCompactionPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the compaction manager force user defined compaction post params +func (o *CompactionManagerForceUserDefinedCompactionPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the compaction manager force user defined compaction post params +func (o *CompactionManagerForceUserDefinedCompactionPostParams) WithHTTPClient(client *http.Client) *CompactionManagerForceUserDefinedCompactionPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the compaction manager force user defined compaction post params +func (o *CompactionManagerForceUserDefinedCompactionPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDataFiles adds the dataFiles to the compaction manager force user defined compaction post params +func (o *CompactionManagerForceUserDefinedCompactionPostParams) WithDataFiles(dataFiles string) *CompactionManagerForceUserDefinedCompactionPostParams { + o.SetDataFiles(dataFiles) + return o +} + +// SetDataFiles adds the dataFiles to the compaction manager force user defined compaction post params +func (o *CompactionManagerForceUserDefinedCompactionPostParams) SetDataFiles(dataFiles string) { + o.DataFiles = dataFiles +} + +// WriteToRequest writes these params to a swagger request +func (o *CompactionManagerForceUserDefinedCompactionPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param data_files + qrDataFiles := o.DataFiles + qDataFiles := qrDataFiles + if qDataFiles != "" { + if err := r.SetQueryParam("data_files", qDataFiles); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_force_user_defined_compaction_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_force_user_defined_compaction_post_responses.go new file mode 100644 index 0000000000..3bffaf621c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_force_user_defined_compaction_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CompactionManagerForceUserDefinedCompactionPostReader is a Reader for the CompactionManagerForceUserDefinedCompactionPost structure. +type CompactionManagerForceUserDefinedCompactionPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CompactionManagerForceUserDefinedCompactionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCompactionManagerForceUserDefinedCompactionPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCompactionManagerForceUserDefinedCompactionPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCompactionManagerForceUserDefinedCompactionPostOK creates a CompactionManagerForceUserDefinedCompactionPostOK with default headers values +func NewCompactionManagerForceUserDefinedCompactionPostOK() *CompactionManagerForceUserDefinedCompactionPostOK { + return &CompactionManagerForceUserDefinedCompactionPostOK{} +} + +/* +CompactionManagerForceUserDefinedCompactionPostOK handles this case with default header values. + +Success +*/ +type CompactionManagerForceUserDefinedCompactionPostOK struct { +} + +func (o *CompactionManagerForceUserDefinedCompactionPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCompactionManagerForceUserDefinedCompactionPostDefault creates a CompactionManagerForceUserDefinedCompactionPostDefault with default headers values +func NewCompactionManagerForceUserDefinedCompactionPostDefault(code int) *CompactionManagerForceUserDefinedCompactionPostDefault { + return &CompactionManagerForceUserDefinedCompactionPostDefault{ + _statusCode: code, + } +} + +/* +CompactionManagerForceUserDefinedCompactionPostDefault handles this case with default header values. + +internal server error +*/ +type CompactionManagerForceUserDefinedCompactionPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the compaction manager force user defined compaction post default response +func (o *CompactionManagerForceUserDefinedCompactionPostDefault) Code() int { + return o._statusCode +} + +func (o *CompactionManagerForceUserDefinedCompactionPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CompactionManagerForceUserDefinedCompactionPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CompactionManagerForceUserDefinedCompactionPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_bytes_compacted_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_bytes_compacted_get_parameters.go new file mode 100644 index 0000000000..1d92ae983d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_bytes_compacted_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCompactionManagerMetricsBytesCompactedGetParams creates a new CompactionManagerMetricsBytesCompactedGetParams object +// with the default values initialized. +func NewCompactionManagerMetricsBytesCompactedGetParams() *CompactionManagerMetricsBytesCompactedGetParams { + + return &CompactionManagerMetricsBytesCompactedGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCompactionManagerMetricsBytesCompactedGetParamsWithTimeout creates a new CompactionManagerMetricsBytesCompactedGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCompactionManagerMetricsBytesCompactedGetParamsWithTimeout(timeout time.Duration) *CompactionManagerMetricsBytesCompactedGetParams { + + return &CompactionManagerMetricsBytesCompactedGetParams{ + + timeout: timeout, + } +} + +// NewCompactionManagerMetricsBytesCompactedGetParamsWithContext creates a new CompactionManagerMetricsBytesCompactedGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCompactionManagerMetricsBytesCompactedGetParamsWithContext(ctx context.Context) *CompactionManagerMetricsBytesCompactedGetParams { + + return &CompactionManagerMetricsBytesCompactedGetParams{ + + Context: ctx, + } +} + +// NewCompactionManagerMetricsBytesCompactedGetParamsWithHTTPClient creates a new CompactionManagerMetricsBytesCompactedGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCompactionManagerMetricsBytesCompactedGetParamsWithHTTPClient(client *http.Client) *CompactionManagerMetricsBytesCompactedGetParams { + + return &CompactionManagerMetricsBytesCompactedGetParams{ + HTTPClient: client, + } +} + +/* +CompactionManagerMetricsBytesCompactedGetParams contains all the parameters to send to the API endpoint +for the compaction manager metrics bytes compacted get operation typically these are written to a http.Request +*/ +type CompactionManagerMetricsBytesCompactedGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the compaction manager metrics bytes compacted get params +func (o *CompactionManagerMetricsBytesCompactedGetParams) WithTimeout(timeout time.Duration) *CompactionManagerMetricsBytesCompactedGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the compaction manager metrics bytes compacted get params +func (o *CompactionManagerMetricsBytesCompactedGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the compaction manager metrics bytes compacted get params +func (o *CompactionManagerMetricsBytesCompactedGetParams) WithContext(ctx context.Context) *CompactionManagerMetricsBytesCompactedGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the compaction manager metrics bytes compacted get params +func (o *CompactionManagerMetricsBytesCompactedGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the compaction manager metrics bytes compacted get params +func (o *CompactionManagerMetricsBytesCompactedGetParams) WithHTTPClient(client *http.Client) *CompactionManagerMetricsBytesCompactedGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the compaction manager metrics bytes compacted get params +func (o *CompactionManagerMetricsBytesCompactedGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CompactionManagerMetricsBytesCompactedGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_bytes_compacted_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_bytes_compacted_get_responses.go new file mode 100644 index 0000000000..0413158101 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_bytes_compacted_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CompactionManagerMetricsBytesCompactedGetReader is a Reader for the CompactionManagerMetricsBytesCompactedGet structure. +type CompactionManagerMetricsBytesCompactedGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CompactionManagerMetricsBytesCompactedGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCompactionManagerMetricsBytesCompactedGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCompactionManagerMetricsBytesCompactedGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCompactionManagerMetricsBytesCompactedGetOK creates a CompactionManagerMetricsBytesCompactedGetOK with default headers values +func NewCompactionManagerMetricsBytesCompactedGetOK() *CompactionManagerMetricsBytesCompactedGetOK { + return &CompactionManagerMetricsBytesCompactedGetOK{} +} + +/* +CompactionManagerMetricsBytesCompactedGetOK handles this case with default header values. + +Success +*/ +type CompactionManagerMetricsBytesCompactedGetOK struct { + Payload int32 +} + +func (o *CompactionManagerMetricsBytesCompactedGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *CompactionManagerMetricsBytesCompactedGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCompactionManagerMetricsBytesCompactedGetDefault creates a CompactionManagerMetricsBytesCompactedGetDefault with default headers values +func NewCompactionManagerMetricsBytesCompactedGetDefault(code int) *CompactionManagerMetricsBytesCompactedGetDefault { + return &CompactionManagerMetricsBytesCompactedGetDefault{ + _statusCode: code, + } +} + +/* +CompactionManagerMetricsBytesCompactedGetDefault handles this case with default header values. + +internal server error +*/ +type CompactionManagerMetricsBytesCompactedGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the compaction manager metrics bytes compacted get default response +func (o *CompactionManagerMetricsBytesCompactedGetDefault) Code() int { + return o._statusCode +} + +func (o *CompactionManagerMetricsBytesCompactedGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CompactionManagerMetricsBytesCompactedGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CompactionManagerMetricsBytesCompactedGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_completed_tasks_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_completed_tasks_get_parameters.go new file mode 100644 index 0000000000..778934a81b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_completed_tasks_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCompactionManagerMetricsCompletedTasksGetParams creates a new CompactionManagerMetricsCompletedTasksGetParams object +// with the default values initialized. +func NewCompactionManagerMetricsCompletedTasksGetParams() *CompactionManagerMetricsCompletedTasksGetParams { + + return &CompactionManagerMetricsCompletedTasksGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCompactionManagerMetricsCompletedTasksGetParamsWithTimeout creates a new CompactionManagerMetricsCompletedTasksGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCompactionManagerMetricsCompletedTasksGetParamsWithTimeout(timeout time.Duration) *CompactionManagerMetricsCompletedTasksGetParams { + + return &CompactionManagerMetricsCompletedTasksGetParams{ + + timeout: timeout, + } +} + +// NewCompactionManagerMetricsCompletedTasksGetParamsWithContext creates a new CompactionManagerMetricsCompletedTasksGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCompactionManagerMetricsCompletedTasksGetParamsWithContext(ctx context.Context) *CompactionManagerMetricsCompletedTasksGetParams { + + return &CompactionManagerMetricsCompletedTasksGetParams{ + + Context: ctx, + } +} + +// NewCompactionManagerMetricsCompletedTasksGetParamsWithHTTPClient creates a new CompactionManagerMetricsCompletedTasksGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCompactionManagerMetricsCompletedTasksGetParamsWithHTTPClient(client *http.Client) *CompactionManagerMetricsCompletedTasksGetParams { + + return &CompactionManagerMetricsCompletedTasksGetParams{ + HTTPClient: client, + } +} + +/* +CompactionManagerMetricsCompletedTasksGetParams contains all the parameters to send to the API endpoint +for the compaction manager metrics completed tasks get operation typically these are written to a http.Request +*/ +type CompactionManagerMetricsCompletedTasksGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the compaction manager metrics completed tasks get params +func (o *CompactionManagerMetricsCompletedTasksGetParams) WithTimeout(timeout time.Duration) *CompactionManagerMetricsCompletedTasksGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the compaction manager metrics completed tasks get params +func (o *CompactionManagerMetricsCompletedTasksGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the compaction manager metrics completed tasks get params +func (o *CompactionManagerMetricsCompletedTasksGetParams) WithContext(ctx context.Context) *CompactionManagerMetricsCompletedTasksGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the compaction manager metrics completed tasks get params +func (o *CompactionManagerMetricsCompletedTasksGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the compaction manager metrics completed tasks get params +func (o *CompactionManagerMetricsCompletedTasksGetParams) WithHTTPClient(client *http.Client) *CompactionManagerMetricsCompletedTasksGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the compaction manager metrics completed tasks get params +func (o *CompactionManagerMetricsCompletedTasksGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CompactionManagerMetricsCompletedTasksGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_completed_tasks_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_completed_tasks_get_responses.go new file mode 100644 index 0000000000..45ec1c2b6e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_completed_tasks_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CompactionManagerMetricsCompletedTasksGetReader is a Reader for the CompactionManagerMetricsCompletedTasksGet structure. +type CompactionManagerMetricsCompletedTasksGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CompactionManagerMetricsCompletedTasksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCompactionManagerMetricsCompletedTasksGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCompactionManagerMetricsCompletedTasksGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCompactionManagerMetricsCompletedTasksGetOK creates a CompactionManagerMetricsCompletedTasksGetOK with default headers values +func NewCompactionManagerMetricsCompletedTasksGetOK() *CompactionManagerMetricsCompletedTasksGetOK { + return &CompactionManagerMetricsCompletedTasksGetOK{} +} + +/* +CompactionManagerMetricsCompletedTasksGetOK handles this case with default header values. + +Success +*/ +type CompactionManagerMetricsCompletedTasksGetOK struct { + Payload interface{} +} + +func (o *CompactionManagerMetricsCompletedTasksGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CompactionManagerMetricsCompletedTasksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCompactionManagerMetricsCompletedTasksGetDefault creates a CompactionManagerMetricsCompletedTasksGetDefault with default headers values +func NewCompactionManagerMetricsCompletedTasksGetDefault(code int) *CompactionManagerMetricsCompletedTasksGetDefault { + return &CompactionManagerMetricsCompletedTasksGetDefault{ + _statusCode: code, + } +} + +/* +CompactionManagerMetricsCompletedTasksGetDefault handles this case with default header values. + +internal server error +*/ +type CompactionManagerMetricsCompletedTasksGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the compaction manager metrics completed tasks get default response +func (o *CompactionManagerMetricsCompletedTasksGetDefault) Code() int { + return o._statusCode +} + +func (o *CompactionManagerMetricsCompletedTasksGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CompactionManagerMetricsCompletedTasksGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CompactionManagerMetricsCompletedTasksGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_pending_tasks_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_pending_tasks_get_parameters.go new file mode 100644 index 0000000000..17297c4ab7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_pending_tasks_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCompactionManagerMetricsPendingTasksGetParams creates a new CompactionManagerMetricsPendingTasksGetParams object +// with the default values initialized. +func NewCompactionManagerMetricsPendingTasksGetParams() *CompactionManagerMetricsPendingTasksGetParams { + + return &CompactionManagerMetricsPendingTasksGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCompactionManagerMetricsPendingTasksGetParamsWithTimeout creates a new CompactionManagerMetricsPendingTasksGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCompactionManagerMetricsPendingTasksGetParamsWithTimeout(timeout time.Duration) *CompactionManagerMetricsPendingTasksGetParams { + + return &CompactionManagerMetricsPendingTasksGetParams{ + + timeout: timeout, + } +} + +// NewCompactionManagerMetricsPendingTasksGetParamsWithContext creates a new CompactionManagerMetricsPendingTasksGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCompactionManagerMetricsPendingTasksGetParamsWithContext(ctx context.Context) *CompactionManagerMetricsPendingTasksGetParams { + + return &CompactionManagerMetricsPendingTasksGetParams{ + + Context: ctx, + } +} + +// NewCompactionManagerMetricsPendingTasksGetParamsWithHTTPClient creates a new CompactionManagerMetricsPendingTasksGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCompactionManagerMetricsPendingTasksGetParamsWithHTTPClient(client *http.Client) *CompactionManagerMetricsPendingTasksGetParams { + + return &CompactionManagerMetricsPendingTasksGetParams{ + HTTPClient: client, + } +} + +/* +CompactionManagerMetricsPendingTasksGetParams contains all the parameters to send to the API endpoint +for the compaction manager metrics pending tasks get operation typically these are written to a http.Request +*/ +type CompactionManagerMetricsPendingTasksGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the compaction manager metrics pending tasks get params +func (o *CompactionManagerMetricsPendingTasksGetParams) WithTimeout(timeout time.Duration) *CompactionManagerMetricsPendingTasksGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the compaction manager metrics pending tasks get params +func (o *CompactionManagerMetricsPendingTasksGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the compaction manager metrics pending tasks get params +func (o *CompactionManagerMetricsPendingTasksGetParams) WithContext(ctx context.Context) *CompactionManagerMetricsPendingTasksGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the compaction manager metrics pending tasks get params +func (o *CompactionManagerMetricsPendingTasksGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the compaction manager metrics pending tasks get params +func (o *CompactionManagerMetricsPendingTasksGetParams) WithHTTPClient(client *http.Client) *CompactionManagerMetricsPendingTasksGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the compaction manager metrics pending tasks get params +func (o *CompactionManagerMetricsPendingTasksGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CompactionManagerMetricsPendingTasksGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_pending_tasks_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_pending_tasks_get_responses.go new file mode 100644 index 0000000000..d734e3d652 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_pending_tasks_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CompactionManagerMetricsPendingTasksGetReader is a Reader for the CompactionManagerMetricsPendingTasksGet structure. +type CompactionManagerMetricsPendingTasksGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CompactionManagerMetricsPendingTasksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCompactionManagerMetricsPendingTasksGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCompactionManagerMetricsPendingTasksGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCompactionManagerMetricsPendingTasksGetOK creates a CompactionManagerMetricsPendingTasksGetOK with default headers values +func NewCompactionManagerMetricsPendingTasksGetOK() *CompactionManagerMetricsPendingTasksGetOK { + return &CompactionManagerMetricsPendingTasksGetOK{} +} + +/* +CompactionManagerMetricsPendingTasksGetOK handles this case with default header values. + +Success +*/ +type CompactionManagerMetricsPendingTasksGetOK struct { + Payload int32 +} + +func (o *CompactionManagerMetricsPendingTasksGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *CompactionManagerMetricsPendingTasksGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCompactionManagerMetricsPendingTasksGetDefault creates a CompactionManagerMetricsPendingTasksGetDefault with default headers values +func NewCompactionManagerMetricsPendingTasksGetDefault(code int) *CompactionManagerMetricsPendingTasksGetDefault { + return &CompactionManagerMetricsPendingTasksGetDefault{ + _statusCode: code, + } +} + +/* +CompactionManagerMetricsPendingTasksGetDefault handles this case with default header values. + +internal server error +*/ +type CompactionManagerMetricsPendingTasksGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the compaction manager metrics pending tasks get default response +func (o *CompactionManagerMetricsPendingTasksGetDefault) Code() int { + return o._statusCode +} + +func (o *CompactionManagerMetricsPendingTasksGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CompactionManagerMetricsPendingTasksGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CompactionManagerMetricsPendingTasksGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_total_compactions_completed_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_total_compactions_completed_get_parameters.go new file mode 100644 index 0000000000..141f74f760 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_total_compactions_completed_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCompactionManagerMetricsTotalCompactionsCompletedGetParams creates a new CompactionManagerMetricsTotalCompactionsCompletedGetParams object +// with the default values initialized. +func NewCompactionManagerMetricsTotalCompactionsCompletedGetParams() *CompactionManagerMetricsTotalCompactionsCompletedGetParams { + + return &CompactionManagerMetricsTotalCompactionsCompletedGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCompactionManagerMetricsTotalCompactionsCompletedGetParamsWithTimeout creates a new CompactionManagerMetricsTotalCompactionsCompletedGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCompactionManagerMetricsTotalCompactionsCompletedGetParamsWithTimeout(timeout time.Duration) *CompactionManagerMetricsTotalCompactionsCompletedGetParams { + + return &CompactionManagerMetricsTotalCompactionsCompletedGetParams{ + + timeout: timeout, + } +} + +// NewCompactionManagerMetricsTotalCompactionsCompletedGetParamsWithContext creates a new CompactionManagerMetricsTotalCompactionsCompletedGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewCompactionManagerMetricsTotalCompactionsCompletedGetParamsWithContext(ctx context.Context) *CompactionManagerMetricsTotalCompactionsCompletedGetParams { + + return &CompactionManagerMetricsTotalCompactionsCompletedGetParams{ + + Context: ctx, + } +} + +// NewCompactionManagerMetricsTotalCompactionsCompletedGetParamsWithHTTPClient creates a new CompactionManagerMetricsTotalCompactionsCompletedGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCompactionManagerMetricsTotalCompactionsCompletedGetParamsWithHTTPClient(client *http.Client) *CompactionManagerMetricsTotalCompactionsCompletedGetParams { + + return &CompactionManagerMetricsTotalCompactionsCompletedGetParams{ + HTTPClient: client, + } +} + +/* +CompactionManagerMetricsTotalCompactionsCompletedGetParams contains all the parameters to send to the API endpoint +for the compaction manager metrics total compactions completed get operation typically these are written to a http.Request +*/ +type CompactionManagerMetricsTotalCompactionsCompletedGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the compaction manager metrics total compactions completed get params +func (o *CompactionManagerMetricsTotalCompactionsCompletedGetParams) WithTimeout(timeout time.Duration) *CompactionManagerMetricsTotalCompactionsCompletedGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the compaction manager metrics total compactions completed get params +func (o *CompactionManagerMetricsTotalCompactionsCompletedGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the compaction manager metrics total compactions completed get params +func (o *CompactionManagerMetricsTotalCompactionsCompletedGetParams) WithContext(ctx context.Context) *CompactionManagerMetricsTotalCompactionsCompletedGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the compaction manager metrics total compactions completed get params +func (o *CompactionManagerMetricsTotalCompactionsCompletedGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the compaction manager metrics total compactions completed get params +func (o *CompactionManagerMetricsTotalCompactionsCompletedGetParams) WithHTTPClient(client *http.Client) *CompactionManagerMetricsTotalCompactionsCompletedGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the compaction manager metrics total compactions completed get params +func (o *CompactionManagerMetricsTotalCompactionsCompletedGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CompactionManagerMetricsTotalCompactionsCompletedGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_total_compactions_completed_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_total_compactions_completed_get_responses.go new file mode 100644 index 0000000000..abe52c13e7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_metrics_total_compactions_completed_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CompactionManagerMetricsTotalCompactionsCompletedGetReader is a Reader for the CompactionManagerMetricsTotalCompactionsCompletedGet structure. +type CompactionManagerMetricsTotalCompactionsCompletedGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CompactionManagerMetricsTotalCompactionsCompletedGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCompactionManagerMetricsTotalCompactionsCompletedGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCompactionManagerMetricsTotalCompactionsCompletedGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCompactionManagerMetricsTotalCompactionsCompletedGetOK creates a CompactionManagerMetricsTotalCompactionsCompletedGetOK with default headers values +func NewCompactionManagerMetricsTotalCompactionsCompletedGetOK() *CompactionManagerMetricsTotalCompactionsCompletedGetOK { + return &CompactionManagerMetricsTotalCompactionsCompletedGetOK{} +} + +/* +CompactionManagerMetricsTotalCompactionsCompletedGetOK handles this case with default header values. + +Success +*/ +type CompactionManagerMetricsTotalCompactionsCompletedGetOK struct { + Payload interface{} +} + +func (o *CompactionManagerMetricsTotalCompactionsCompletedGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *CompactionManagerMetricsTotalCompactionsCompletedGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCompactionManagerMetricsTotalCompactionsCompletedGetDefault creates a CompactionManagerMetricsTotalCompactionsCompletedGetDefault with default headers values +func NewCompactionManagerMetricsTotalCompactionsCompletedGetDefault(code int) *CompactionManagerMetricsTotalCompactionsCompletedGetDefault { + return &CompactionManagerMetricsTotalCompactionsCompletedGetDefault{ + _statusCode: code, + } +} + +/* +CompactionManagerMetricsTotalCompactionsCompletedGetDefault handles this case with default header values. + +internal server error +*/ +type CompactionManagerMetricsTotalCompactionsCompletedGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the compaction manager metrics total compactions completed get default response +func (o *CompactionManagerMetricsTotalCompactionsCompletedGetDefault) Code() int { + return o._statusCode +} + +func (o *CompactionManagerMetricsTotalCompactionsCompletedGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CompactionManagerMetricsTotalCompactionsCompletedGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CompactionManagerMetricsTotalCompactionsCompletedGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_stop_compaction_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_stop_compaction_post_parameters.go new file mode 100644 index 0000000000..6a27b1d329 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_stop_compaction_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCompactionManagerStopCompactionPostParams creates a new CompactionManagerStopCompactionPostParams object +// with the default values initialized. +func NewCompactionManagerStopCompactionPostParams() *CompactionManagerStopCompactionPostParams { + var () + return &CompactionManagerStopCompactionPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCompactionManagerStopCompactionPostParamsWithTimeout creates a new CompactionManagerStopCompactionPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCompactionManagerStopCompactionPostParamsWithTimeout(timeout time.Duration) *CompactionManagerStopCompactionPostParams { + var () + return &CompactionManagerStopCompactionPostParams{ + + timeout: timeout, + } +} + +// NewCompactionManagerStopCompactionPostParamsWithContext creates a new CompactionManagerStopCompactionPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewCompactionManagerStopCompactionPostParamsWithContext(ctx context.Context) *CompactionManagerStopCompactionPostParams { + var () + return &CompactionManagerStopCompactionPostParams{ + + Context: ctx, + } +} + +// NewCompactionManagerStopCompactionPostParamsWithHTTPClient creates a new CompactionManagerStopCompactionPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCompactionManagerStopCompactionPostParamsWithHTTPClient(client *http.Client) *CompactionManagerStopCompactionPostParams { + var () + return &CompactionManagerStopCompactionPostParams{ + HTTPClient: client, + } +} + +/* +CompactionManagerStopCompactionPostParams contains all the parameters to send to the API endpoint +for the compaction manager stop compaction post operation typically these are written to a http.Request +*/ +type CompactionManagerStopCompactionPostParams struct { + + /*Type + the type of compaction to stop. Can be one of: - COMPACTION - VALIDATION - CLEANUP - SCRUB - INDEX_BUILD + + */ + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the compaction manager stop compaction post params +func (o *CompactionManagerStopCompactionPostParams) WithTimeout(timeout time.Duration) *CompactionManagerStopCompactionPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the compaction manager stop compaction post params +func (o *CompactionManagerStopCompactionPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the compaction manager stop compaction post params +func (o *CompactionManagerStopCompactionPostParams) WithContext(ctx context.Context) *CompactionManagerStopCompactionPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the compaction manager stop compaction post params +func (o *CompactionManagerStopCompactionPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the compaction manager stop compaction post params +func (o *CompactionManagerStopCompactionPostParams) WithHTTPClient(client *http.Client) *CompactionManagerStopCompactionPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the compaction manager stop compaction post params +func (o *CompactionManagerStopCompactionPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithType adds the typeVar to the compaction manager stop compaction post params +func (o *CompactionManagerStopCompactionPostParams) WithType(typeVar string) *CompactionManagerStopCompactionPostParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the compaction manager stop compaction post params +func (o *CompactionManagerStopCompactionPostParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *CompactionManagerStopCompactionPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param type + qrType := o.Type + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_stop_compaction_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_stop_compaction_post_responses.go new file mode 100644 index 0000000000..bba0091480 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/compaction_manager_stop_compaction_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// CompactionManagerStopCompactionPostReader is a Reader for the CompactionManagerStopCompactionPost structure. +type CompactionManagerStopCompactionPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CompactionManagerStopCompactionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCompactionManagerStopCompactionPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCompactionManagerStopCompactionPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCompactionManagerStopCompactionPostOK creates a CompactionManagerStopCompactionPostOK with default headers values +func NewCompactionManagerStopCompactionPostOK() *CompactionManagerStopCompactionPostOK { + return &CompactionManagerStopCompactionPostOK{} +} + +/* +CompactionManagerStopCompactionPostOK handles this case with default header values. + +Success +*/ +type CompactionManagerStopCompactionPostOK struct { +} + +func (o *CompactionManagerStopCompactionPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCompactionManagerStopCompactionPostDefault creates a CompactionManagerStopCompactionPostDefault with default headers values +func NewCompactionManagerStopCompactionPostDefault(code int) *CompactionManagerStopCompactionPostDefault { + return &CompactionManagerStopCompactionPostDefault{ + _statusCode: code, + } +} + +/* +CompactionManagerStopCompactionPostDefault handles this case with default header values. + +internal server error +*/ +type CompactionManagerStopCompactionPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the compaction manager stop compaction post default response +func (o *CompactionManagerStopCompactionPostDefault) Code() int { + return o._statusCode +} + +func (o *CompactionManagerStopCompactionPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *CompactionManagerStopCompactionPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *CompactionManagerStopCompactionPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_count_endpoint_down_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_count_endpoint_down_get_parameters.go new file mode 100644 index 0000000000..1fff652269 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_count_endpoint_down_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFailureDetectorCountEndpointDownGetParams creates a new FailureDetectorCountEndpointDownGetParams object +// with the default values initialized. +func NewFailureDetectorCountEndpointDownGetParams() *FailureDetectorCountEndpointDownGetParams { + + return &FailureDetectorCountEndpointDownGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFailureDetectorCountEndpointDownGetParamsWithTimeout creates a new FailureDetectorCountEndpointDownGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFailureDetectorCountEndpointDownGetParamsWithTimeout(timeout time.Duration) *FailureDetectorCountEndpointDownGetParams { + + return &FailureDetectorCountEndpointDownGetParams{ + + timeout: timeout, + } +} + +// NewFailureDetectorCountEndpointDownGetParamsWithContext creates a new FailureDetectorCountEndpointDownGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewFailureDetectorCountEndpointDownGetParamsWithContext(ctx context.Context) *FailureDetectorCountEndpointDownGetParams { + + return &FailureDetectorCountEndpointDownGetParams{ + + Context: ctx, + } +} + +// NewFailureDetectorCountEndpointDownGetParamsWithHTTPClient creates a new FailureDetectorCountEndpointDownGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFailureDetectorCountEndpointDownGetParamsWithHTTPClient(client *http.Client) *FailureDetectorCountEndpointDownGetParams { + + return &FailureDetectorCountEndpointDownGetParams{ + HTTPClient: client, + } +} + +/* +FailureDetectorCountEndpointDownGetParams contains all the parameters to send to the API endpoint +for the failure detector count endpoint down get operation typically these are written to a http.Request +*/ +type FailureDetectorCountEndpointDownGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the failure detector count endpoint down get params +func (o *FailureDetectorCountEndpointDownGetParams) WithTimeout(timeout time.Duration) *FailureDetectorCountEndpointDownGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the failure detector count endpoint down get params +func (o *FailureDetectorCountEndpointDownGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the failure detector count endpoint down get params +func (o *FailureDetectorCountEndpointDownGetParams) WithContext(ctx context.Context) *FailureDetectorCountEndpointDownGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the failure detector count endpoint down get params +func (o *FailureDetectorCountEndpointDownGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the failure detector count endpoint down get params +func (o *FailureDetectorCountEndpointDownGetParams) WithHTTPClient(client *http.Client) *FailureDetectorCountEndpointDownGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the failure detector count endpoint down get params +func (o *FailureDetectorCountEndpointDownGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FailureDetectorCountEndpointDownGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_count_endpoint_down_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_count_endpoint_down_get_responses.go new file mode 100644 index 0000000000..88e2f92973 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_count_endpoint_down_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// FailureDetectorCountEndpointDownGetReader is a Reader for the FailureDetectorCountEndpointDownGet structure. +type FailureDetectorCountEndpointDownGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FailureDetectorCountEndpointDownGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFailureDetectorCountEndpointDownGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFailureDetectorCountEndpointDownGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFailureDetectorCountEndpointDownGetOK creates a FailureDetectorCountEndpointDownGetOK with default headers values +func NewFailureDetectorCountEndpointDownGetOK() *FailureDetectorCountEndpointDownGetOK { + return &FailureDetectorCountEndpointDownGetOK{} +} + +/* +FailureDetectorCountEndpointDownGetOK handles this case with default header values. + +Success +*/ +type FailureDetectorCountEndpointDownGetOK struct { + Payload int32 +} + +func (o *FailureDetectorCountEndpointDownGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *FailureDetectorCountEndpointDownGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFailureDetectorCountEndpointDownGetDefault creates a FailureDetectorCountEndpointDownGetDefault with default headers values +func NewFailureDetectorCountEndpointDownGetDefault(code int) *FailureDetectorCountEndpointDownGetDefault { + return &FailureDetectorCountEndpointDownGetDefault{ + _statusCode: code, + } +} + +/* +FailureDetectorCountEndpointDownGetDefault handles this case with default header values. + +internal server error +*/ +type FailureDetectorCountEndpointDownGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the failure detector count endpoint down get default response +func (o *FailureDetectorCountEndpointDownGetDefault) Code() int { + return o._statusCode +} + +func (o *FailureDetectorCountEndpointDownGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FailureDetectorCountEndpointDownGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FailureDetectorCountEndpointDownGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_count_endpoint_up_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_count_endpoint_up_get_parameters.go new file mode 100644 index 0000000000..aae7d189b4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_count_endpoint_up_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFailureDetectorCountEndpointUpGetParams creates a new FailureDetectorCountEndpointUpGetParams object +// with the default values initialized. +func NewFailureDetectorCountEndpointUpGetParams() *FailureDetectorCountEndpointUpGetParams { + + return &FailureDetectorCountEndpointUpGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFailureDetectorCountEndpointUpGetParamsWithTimeout creates a new FailureDetectorCountEndpointUpGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFailureDetectorCountEndpointUpGetParamsWithTimeout(timeout time.Duration) *FailureDetectorCountEndpointUpGetParams { + + return &FailureDetectorCountEndpointUpGetParams{ + + timeout: timeout, + } +} + +// NewFailureDetectorCountEndpointUpGetParamsWithContext creates a new FailureDetectorCountEndpointUpGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewFailureDetectorCountEndpointUpGetParamsWithContext(ctx context.Context) *FailureDetectorCountEndpointUpGetParams { + + return &FailureDetectorCountEndpointUpGetParams{ + + Context: ctx, + } +} + +// NewFailureDetectorCountEndpointUpGetParamsWithHTTPClient creates a new FailureDetectorCountEndpointUpGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFailureDetectorCountEndpointUpGetParamsWithHTTPClient(client *http.Client) *FailureDetectorCountEndpointUpGetParams { + + return &FailureDetectorCountEndpointUpGetParams{ + HTTPClient: client, + } +} + +/* +FailureDetectorCountEndpointUpGetParams contains all the parameters to send to the API endpoint +for the failure detector count endpoint up get operation typically these are written to a http.Request +*/ +type FailureDetectorCountEndpointUpGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the failure detector count endpoint up get params +func (o *FailureDetectorCountEndpointUpGetParams) WithTimeout(timeout time.Duration) *FailureDetectorCountEndpointUpGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the failure detector count endpoint up get params +func (o *FailureDetectorCountEndpointUpGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the failure detector count endpoint up get params +func (o *FailureDetectorCountEndpointUpGetParams) WithContext(ctx context.Context) *FailureDetectorCountEndpointUpGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the failure detector count endpoint up get params +func (o *FailureDetectorCountEndpointUpGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the failure detector count endpoint up get params +func (o *FailureDetectorCountEndpointUpGetParams) WithHTTPClient(client *http.Client) *FailureDetectorCountEndpointUpGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the failure detector count endpoint up get params +func (o *FailureDetectorCountEndpointUpGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FailureDetectorCountEndpointUpGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_count_endpoint_up_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_count_endpoint_up_get_responses.go new file mode 100644 index 0000000000..9d586c1050 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_count_endpoint_up_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// FailureDetectorCountEndpointUpGetReader is a Reader for the FailureDetectorCountEndpointUpGet structure. +type FailureDetectorCountEndpointUpGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FailureDetectorCountEndpointUpGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFailureDetectorCountEndpointUpGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFailureDetectorCountEndpointUpGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFailureDetectorCountEndpointUpGetOK creates a FailureDetectorCountEndpointUpGetOK with default headers values +func NewFailureDetectorCountEndpointUpGetOK() *FailureDetectorCountEndpointUpGetOK { + return &FailureDetectorCountEndpointUpGetOK{} +} + +/* +FailureDetectorCountEndpointUpGetOK handles this case with default header values. + +Success +*/ +type FailureDetectorCountEndpointUpGetOK struct { + Payload int32 +} + +func (o *FailureDetectorCountEndpointUpGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *FailureDetectorCountEndpointUpGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFailureDetectorCountEndpointUpGetDefault creates a FailureDetectorCountEndpointUpGetDefault with default headers values +func NewFailureDetectorCountEndpointUpGetDefault(code int) *FailureDetectorCountEndpointUpGetDefault { + return &FailureDetectorCountEndpointUpGetDefault{ + _statusCode: code, + } +} + +/* +FailureDetectorCountEndpointUpGetDefault handles this case with default header values. + +internal server error +*/ +type FailureDetectorCountEndpointUpGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the failure detector count endpoint up get default response +func (o *FailureDetectorCountEndpointUpGetDefault) Code() int { + return o._statusCode +} + +func (o *FailureDetectorCountEndpointUpGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FailureDetectorCountEndpointUpGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FailureDetectorCountEndpointUpGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoint_phi_values_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoint_phi_values_get_parameters.go new file mode 100644 index 0000000000..d0606c4649 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoint_phi_values_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFailureDetectorEndpointPhiValuesGetParams creates a new FailureDetectorEndpointPhiValuesGetParams object +// with the default values initialized. +func NewFailureDetectorEndpointPhiValuesGetParams() *FailureDetectorEndpointPhiValuesGetParams { + + return &FailureDetectorEndpointPhiValuesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFailureDetectorEndpointPhiValuesGetParamsWithTimeout creates a new FailureDetectorEndpointPhiValuesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFailureDetectorEndpointPhiValuesGetParamsWithTimeout(timeout time.Duration) *FailureDetectorEndpointPhiValuesGetParams { + + return &FailureDetectorEndpointPhiValuesGetParams{ + + timeout: timeout, + } +} + +// NewFailureDetectorEndpointPhiValuesGetParamsWithContext creates a new FailureDetectorEndpointPhiValuesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewFailureDetectorEndpointPhiValuesGetParamsWithContext(ctx context.Context) *FailureDetectorEndpointPhiValuesGetParams { + + return &FailureDetectorEndpointPhiValuesGetParams{ + + Context: ctx, + } +} + +// NewFailureDetectorEndpointPhiValuesGetParamsWithHTTPClient creates a new FailureDetectorEndpointPhiValuesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFailureDetectorEndpointPhiValuesGetParamsWithHTTPClient(client *http.Client) *FailureDetectorEndpointPhiValuesGetParams { + + return &FailureDetectorEndpointPhiValuesGetParams{ + HTTPClient: client, + } +} + +/* +FailureDetectorEndpointPhiValuesGetParams contains all the parameters to send to the API endpoint +for the failure detector endpoint phi values get operation typically these are written to a http.Request +*/ +type FailureDetectorEndpointPhiValuesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the failure detector endpoint phi values get params +func (o *FailureDetectorEndpointPhiValuesGetParams) WithTimeout(timeout time.Duration) *FailureDetectorEndpointPhiValuesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the failure detector endpoint phi values get params +func (o *FailureDetectorEndpointPhiValuesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the failure detector endpoint phi values get params +func (o *FailureDetectorEndpointPhiValuesGetParams) WithContext(ctx context.Context) *FailureDetectorEndpointPhiValuesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the failure detector endpoint phi values get params +func (o *FailureDetectorEndpointPhiValuesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the failure detector endpoint phi values get params +func (o *FailureDetectorEndpointPhiValuesGetParams) WithHTTPClient(client *http.Client) *FailureDetectorEndpointPhiValuesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the failure detector endpoint phi values get params +func (o *FailureDetectorEndpointPhiValuesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FailureDetectorEndpointPhiValuesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoint_phi_values_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoint_phi_values_get_responses.go new file mode 100644 index 0000000000..e96171593d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoint_phi_values_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// FailureDetectorEndpointPhiValuesGetReader is a Reader for the FailureDetectorEndpointPhiValuesGet structure. +type FailureDetectorEndpointPhiValuesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FailureDetectorEndpointPhiValuesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFailureDetectorEndpointPhiValuesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFailureDetectorEndpointPhiValuesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFailureDetectorEndpointPhiValuesGetOK creates a FailureDetectorEndpointPhiValuesGetOK with default headers values +func NewFailureDetectorEndpointPhiValuesGetOK() *FailureDetectorEndpointPhiValuesGetOK { + return &FailureDetectorEndpointPhiValuesGetOK{} +} + +/* +FailureDetectorEndpointPhiValuesGetOK handles this case with default header values. + +Success +*/ +type FailureDetectorEndpointPhiValuesGetOK struct { + Payload interface{} +} + +func (o *FailureDetectorEndpointPhiValuesGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *FailureDetectorEndpointPhiValuesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFailureDetectorEndpointPhiValuesGetDefault creates a FailureDetectorEndpointPhiValuesGetDefault with default headers values +func NewFailureDetectorEndpointPhiValuesGetDefault(code int) *FailureDetectorEndpointPhiValuesGetDefault { + return &FailureDetectorEndpointPhiValuesGetDefault{ + _statusCode: code, + } +} + +/* +FailureDetectorEndpointPhiValuesGetDefault handles this case with default header values. + +internal server error +*/ +type FailureDetectorEndpointPhiValuesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the failure detector endpoint phi values get default response +func (o *FailureDetectorEndpointPhiValuesGetDefault) Code() int { + return o._statusCode +} + +func (o *FailureDetectorEndpointPhiValuesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FailureDetectorEndpointPhiValuesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FailureDetectorEndpointPhiValuesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoints_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoints_get_parameters.go new file mode 100644 index 0000000000..4e2db827c8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoints_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFailureDetectorEndpointsGetParams creates a new FailureDetectorEndpointsGetParams object +// with the default values initialized. +func NewFailureDetectorEndpointsGetParams() *FailureDetectorEndpointsGetParams { + + return &FailureDetectorEndpointsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFailureDetectorEndpointsGetParamsWithTimeout creates a new FailureDetectorEndpointsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFailureDetectorEndpointsGetParamsWithTimeout(timeout time.Duration) *FailureDetectorEndpointsGetParams { + + return &FailureDetectorEndpointsGetParams{ + + timeout: timeout, + } +} + +// NewFailureDetectorEndpointsGetParamsWithContext creates a new FailureDetectorEndpointsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewFailureDetectorEndpointsGetParamsWithContext(ctx context.Context) *FailureDetectorEndpointsGetParams { + + return &FailureDetectorEndpointsGetParams{ + + Context: ctx, + } +} + +// NewFailureDetectorEndpointsGetParamsWithHTTPClient creates a new FailureDetectorEndpointsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFailureDetectorEndpointsGetParamsWithHTTPClient(client *http.Client) *FailureDetectorEndpointsGetParams { + + return &FailureDetectorEndpointsGetParams{ + HTTPClient: client, + } +} + +/* +FailureDetectorEndpointsGetParams contains all the parameters to send to the API endpoint +for the failure detector endpoints get operation typically these are written to a http.Request +*/ +type FailureDetectorEndpointsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the failure detector endpoints get params +func (o *FailureDetectorEndpointsGetParams) WithTimeout(timeout time.Duration) *FailureDetectorEndpointsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the failure detector endpoints get params +func (o *FailureDetectorEndpointsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the failure detector endpoints get params +func (o *FailureDetectorEndpointsGetParams) WithContext(ctx context.Context) *FailureDetectorEndpointsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the failure detector endpoints get params +func (o *FailureDetectorEndpointsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the failure detector endpoints get params +func (o *FailureDetectorEndpointsGetParams) WithHTTPClient(client *http.Client) *FailureDetectorEndpointsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the failure detector endpoints get params +func (o *FailureDetectorEndpointsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FailureDetectorEndpointsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoints_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoints_get_responses.go new file mode 100644 index 0000000000..687837f908 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoints_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// FailureDetectorEndpointsGetReader is a Reader for the FailureDetectorEndpointsGet structure. +type FailureDetectorEndpointsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FailureDetectorEndpointsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFailureDetectorEndpointsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFailureDetectorEndpointsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFailureDetectorEndpointsGetOK creates a FailureDetectorEndpointsGetOK with default headers values +func NewFailureDetectorEndpointsGetOK() *FailureDetectorEndpointsGetOK { + return &FailureDetectorEndpointsGetOK{} +} + +/* +FailureDetectorEndpointsGetOK handles this case with default header values. + +Success +*/ +type FailureDetectorEndpointsGetOK struct { + Payload []*models.EndpointState +} + +func (o *FailureDetectorEndpointsGetOK) GetPayload() []*models.EndpointState { + return o.Payload +} + +func (o *FailureDetectorEndpointsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFailureDetectorEndpointsGetDefault creates a FailureDetectorEndpointsGetDefault with default headers values +func NewFailureDetectorEndpointsGetDefault(code int) *FailureDetectorEndpointsGetDefault { + return &FailureDetectorEndpointsGetDefault{ + _statusCode: code, + } +} + +/* +FailureDetectorEndpointsGetDefault handles this case with default header values. + +internal server error +*/ +type FailureDetectorEndpointsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the failure detector endpoints get default response +func (o *FailureDetectorEndpointsGetDefault) Code() int { + return o._statusCode +} + +func (o *FailureDetectorEndpointsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FailureDetectorEndpointsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FailureDetectorEndpointsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoints_states_by_addr_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoints_states_by_addr_get_parameters.go new file mode 100644 index 0000000000..ee78533eaa --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoints_states_by_addr_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFailureDetectorEndpointsStatesByAddrGetParams creates a new FailureDetectorEndpointsStatesByAddrGetParams object +// with the default values initialized. +func NewFailureDetectorEndpointsStatesByAddrGetParams() *FailureDetectorEndpointsStatesByAddrGetParams { + var () + return &FailureDetectorEndpointsStatesByAddrGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFailureDetectorEndpointsStatesByAddrGetParamsWithTimeout creates a new FailureDetectorEndpointsStatesByAddrGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFailureDetectorEndpointsStatesByAddrGetParamsWithTimeout(timeout time.Duration) *FailureDetectorEndpointsStatesByAddrGetParams { + var () + return &FailureDetectorEndpointsStatesByAddrGetParams{ + + timeout: timeout, + } +} + +// NewFailureDetectorEndpointsStatesByAddrGetParamsWithContext creates a new FailureDetectorEndpointsStatesByAddrGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewFailureDetectorEndpointsStatesByAddrGetParamsWithContext(ctx context.Context) *FailureDetectorEndpointsStatesByAddrGetParams { + var () + return &FailureDetectorEndpointsStatesByAddrGetParams{ + + Context: ctx, + } +} + +// NewFailureDetectorEndpointsStatesByAddrGetParamsWithHTTPClient creates a new FailureDetectorEndpointsStatesByAddrGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFailureDetectorEndpointsStatesByAddrGetParamsWithHTTPClient(client *http.Client) *FailureDetectorEndpointsStatesByAddrGetParams { + var () + return &FailureDetectorEndpointsStatesByAddrGetParams{ + HTTPClient: client, + } +} + +/* +FailureDetectorEndpointsStatesByAddrGetParams contains all the parameters to send to the API endpoint +for the failure detector endpoints states by addr get operation typically these are written to a http.Request +*/ +type FailureDetectorEndpointsStatesByAddrGetParams struct { + + /*Addr + The endpoint address + + */ + Addr string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the failure detector endpoints states by addr get params +func (o *FailureDetectorEndpointsStatesByAddrGetParams) WithTimeout(timeout time.Duration) *FailureDetectorEndpointsStatesByAddrGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the failure detector endpoints states by addr get params +func (o *FailureDetectorEndpointsStatesByAddrGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the failure detector endpoints states by addr get params +func (o *FailureDetectorEndpointsStatesByAddrGetParams) WithContext(ctx context.Context) *FailureDetectorEndpointsStatesByAddrGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the failure detector endpoints states by addr get params +func (o *FailureDetectorEndpointsStatesByAddrGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the failure detector endpoints states by addr get params +func (o *FailureDetectorEndpointsStatesByAddrGetParams) WithHTTPClient(client *http.Client) *FailureDetectorEndpointsStatesByAddrGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the failure detector endpoints states by addr get params +func (o *FailureDetectorEndpointsStatesByAddrGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAddr adds the addr to the failure detector endpoints states by addr get params +func (o *FailureDetectorEndpointsStatesByAddrGetParams) WithAddr(addr string) *FailureDetectorEndpointsStatesByAddrGetParams { + o.SetAddr(addr) + return o +} + +// SetAddr adds the addr to the failure detector endpoints states by addr get params +func (o *FailureDetectorEndpointsStatesByAddrGetParams) SetAddr(addr string) { + o.Addr = addr +} + +// WriteToRequest writes these params to a swagger request +func (o *FailureDetectorEndpointsStatesByAddrGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param addr + if err := r.SetPathParam("addr", o.Addr); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoints_states_by_addr_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoints_states_by_addr_get_responses.go new file mode 100644 index 0000000000..b1a30a3159 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_endpoints_states_by_addr_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// FailureDetectorEndpointsStatesByAddrGetReader is a Reader for the FailureDetectorEndpointsStatesByAddrGet structure. +type FailureDetectorEndpointsStatesByAddrGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FailureDetectorEndpointsStatesByAddrGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFailureDetectorEndpointsStatesByAddrGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFailureDetectorEndpointsStatesByAddrGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFailureDetectorEndpointsStatesByAddrGetOK creates a FailureDetectorEndpointsStatesByAddrGetOK with default headers values +func NewFailureDetectorEndpointsStatesByAddrGetOK() *FailureDetectorEndpointsStatesByAddrGetOK { + return &FailureDetectorEndpointsStatesByAddrGetOK{} +} + +/* +FailureDetectorEndpointsStatesByAddrGetOK handles this case with default header values. + +Success +*/ +type FailureDetectorEndpointsStatesByAddrGetOK struct { + Payload string +} + +func (o *FailureDetectorEndpointsStatesByAddrGetOK) GetPayload() string { + return o.Payload +} + +func (o *FailureDetectorEndpointsStatesByAddrGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFailureDetectorEndpointsStatesByAddrGetDefault creates a FailureDetectorEndpointsStatesByAddrGetDefault with default headers values +func NewFailureDetectorEndpointsStatesByAddrGetDefault(code int) *FailureDetectorEndpointsStatesByAddrGetDefault { + return &FailureDetectorEndpointsStatesByAddrGetDefault{ + _statusCode: code, + } +} + +/* +FailureDetectorEndpointsStatesByAddrGetDefault handles this case with default header values. + +internal server error +*/ +type FailureDetectorEndpointsStatesByAddrGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the failure detector endpoints states by addr get default response +func (o *FailureDetectorEndpointsStatesByAddrGetDefault) Code() int { + return o._statusCode +} + +func (o *FailureDetectorEndpointsStatesByAddrGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FailureDetectorEndpointsStatesByAddrGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FailureDetectorEndpointsStatesByAddrGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_phi_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_phi_get_parameters.go new file mode 100644 index 0000000000..bf2175a114 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_phi_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFailureDetectorPhiGetParams creates a new FailureDetectorPhiGetParams object +// with the default values initialized. +func NewFailureDetectorPhiGetParams() *FailureDetectorPhiGetParams { + + return &FailureDetectorPhiGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFailureDetectorPhiGetParamsWithTimeout creates a new FailureDetectorPhiGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFailureDetectorPhiGetParamsWithTimeout(timeout time.Duration) *FailureDetectorPhiGetParams { + + return &FailureDetectorPhiGetParams{ + + timeout: timeout, + } +} + +// NewFailureDetectorPhiGetParamsWithContext creates a new FailureDetectorPhiGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewFailureDetectorPhiGetParamsWithContext(ctx context.Context) *FailureDetectorPhiGetParams { + + return &FailureDetectorPhiGetParams{ + + Context: ctx, + } +} + +// NewFailureDetectorPhiGetParamsWithHTTPClient creates a new FailureDetectorPhiGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFailureDetectorPhiGetParamsWithHTTPClient(client *http.Client) *FailureDetectorPhiGetParams { + + return &FailureDetectorPhiGetParams{ + HTTPClient: client, + } +} + +/* +FailureDetectorPhiGetParams contains all the parameters to send to the API endpoint +for the failure detector phi get operation typically these are written to a http.Request +*/ +type FailureDetectorPhiGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the failure detector phi get params +func (o *FailureDetectorPhiGetParams) WithTimeout(timeout time.Duration) *FailureDetectorPhiGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the failure detector phi get params +func (o *FailureDetectorPhiGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the failure detector phi get params +func (o *FailureDetectorPhiGetParams) WithContext(ctx context.Context) *FailureDetectorPhiGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the failure detector phi get params +func (o *FailureDetectorPhiGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the failure detector phi get params +func (o *FailureDetectorPhiGetParams) WithHTTPClient(client *http.Client) *FailureDetectorPhiGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the failure detector phi get params +func (o *FailureDetectorPhiGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FailureDetectorPhiGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_phi_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_phi_get_responses.go new file mode 100644 index 0000000000..8ac26073ad --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_phi_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// FailureDetectorPhiGetReader is a Reader for the FailureDetectorPhiGet structure. +type FailureDetectorPhiGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FailureDetectorPhiGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFailureDetectorPhiGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFailureDetectorPhiGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFailureDetectorPhiGetOK creates a FailureDetectorPhiGetOK with default headers values +func NewFailureDetectorPhiGetOK() *FailureDetectorPhiGetOK { + return &FailureDetectorPhiGetOK{} +} + +/* +FailureDetectorPhiGetOK handles this case with default header values. + +Success +*/ +type FailureDetectorPhiGetOK struct { + Payload string +} + +func (o *FailureDetectorPhiGetOK) GetPayload() string { + return o.Payload +} + +func (o *FailureDetectorPhiGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFailureDetectorPhiGetDefault creates a FailureDetectorPhiGetDefault with default headers values +func NewFailureDetectorPhiGetDefault(code int) *FailureDetectorPhiGetDefault { + return &FailureDetectorPhiGetDefault{ + _statusCode: code, + } +} + +/* +FailureDetectorPhiGetDefault handles this case with default header values. + +internal server error +*/ +type FailureDetectorPhiGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the failure detector phi get default response +func (o *FailureDetectorPhiGetDefault) Code() int { + return o._statusCode +} + +func (o *FailureDetectorPhiGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FailureDetectorPhiGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FailureDetectorPhiGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_phi_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_phi_post_parameters.go new file mode 100644 index 0000000000..76d817ace2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_phi_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFailureDetectorPhiPostParams creates a new FailureDetectorPhiPostParams object +// with the default values initialized. +func NewFailureDetectorPhiPostParams() *FailureDetectorPhiPostParams { + var () + return &FailureDetectorPhiPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFailureDetectorPhiPostParamsWithTimeout creates a new FailureDetectorPhiPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFailureDetectorPhiPostParamsWithTimeout(timeout time.Duration) *FailureDetectorPhiPostParams { + var () + return &FailureDetectorPhiPostParams{ + + timeout: timeout, + } +} + +// NewFailureDetectorPhiPostParamsWithContext creates a new FailureDetectorPhiPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewFailureDetectorPhiPostParamsWithContext(ctx context.Context) *FailureDetectorPhiPostParams { + var () + return &FailureDetectorPhiPostParams{ + + Context: ctx, + } +} + +// NewFailureDetectorPhiPostParamsWithHTTPClient creates a new FailureDetectorPhiPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFailureDetectorPhiPostParamsWithHTTPClient(client *http.Client) *FailureDetectorPhiPostParams { + var () + return &FailureDetectorPhiPostParams{ + HTTPClient: client, + } +} + +/* +FailureDetectorPhiPostParams contains all the parameters to send to the API endpoint +for the failure detector phi post operation typically these are written to a http.Request +*/ +type FailureDetectorPhiPostParams struct { + + /*Phi + The new phi value + + */ + Phi string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the failure detector phi post params +func (o *FailureDetectorPhiPostParams) WithTimeout(timeout time.Duration) *FailureDetectorPhiPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the failure detector phi post params +func (o *FailureDetectorPhiPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the failure detector phi post params +func (o *FailureDetectorPhiPostParams) WithContext(ctx context.Context) *FailureDetectorPhiPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the failure detector phi post params +func (o *FailureDetectorPhiPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the failure detector phi post params +func (o *FailureDetectorPhiPostParams) WithHTTPClient(client *http.Client) *FailureDetectorPhiPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the failure detector phi post params +func (o *FailureDetectorPhiPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPhi adds the phi to the failure detector phi post params +func (o *FailureDetectorPhiPostParams) WithPhi(phi string) *FailureDetectorPhiPostParams { + o.SetPhi(phi) + return o +} + +// SetPhi adds the phi to the failure detector phi post params +func (o *FailureDetectorPhiPostParams) SetPhi(phi string) { + o.Phi = phi +} + +// WriteToRequest writes these params to a swagger request +func (o *FailureDetectorPhiPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param phi + qrPhi := o.Phi + qPhi := qrPhi + if qPhi != "" { + if err := r.SetQueryParam("phi", qPhi); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_phi_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_phi_post_responses.go new file mode 100644 index 0000000000..58943ffccf --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_phi_post_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// FailureDetectorPhiPostReader is a Reader for the FailureDetectorPhiPost structure. +type FailureDetectorPhiPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FailureDetectorPhiPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFailureDetectorPhiPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFailureDetectorPhiPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFailureDetectorPhiPostOK creates a FailureDetectorPhiPostOK with default headers values +func NewFailureDetectorPhiPostOK() *FailureDetectorPhiPostOK { + return &FailureDetectorPhiPostOK{} +} + +/* +FailureDetectorPhiPostOK handles this case with default header values. + +Success +*/ +type FailureDetectorPhiPostOK struct { + Payload interface{} +} + +func (o *FailureDetectorPhiPostOK) GetPayload() interface{} { + return o.Payload +} + +func (o *FailureDetectorPhiPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFailureDetectorPhiPostDefault creates a FailureDetectorPhiPostDefault with default headers values +func NewFailureDetectorPhiPostDefault(code int) *FailureDetectorPhiPostDefault { + return &FailureDetectorPhiPostDefault{ + _statusCode: code, + } +} + +/* +FailureDetectorPhiPostDefault handles this case with default header values. + +internal server error +*/ +type FailureDetectorPhiPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the failure detector phi post default response +func (o *FailureDetectorPhiPostDefault) Code() int { + return o._statusCode +} + +func (o *FailureDetectorPhiPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FailureDetectorPhiPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FailureDetectorPhiPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_simple_states_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_simple_states_get_parameters.go new file mode 100644 index 0000000000..ca8a22361f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_simple_states_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFailureDetectorSimpleStatesGetParams creates a new FailureDetectorSimpleStatesGetParams object +// with the default values initialized. +func NewFailureDetectorSimpleStatesGetParams() *FailureDetectorSimpleStatesGetParams { + + return &FailureDetectorSimpleStatesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFailureDetectorSimpleStatesGetParamsWithTimeout creates a new FailureDetectorSimpleStatesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFailureDetectorSimpleStatesGetParamsWithTimeout(timeout time.Duration) *FailureDetectorSimpleStatesGetParams { + + return &FailureDetectorSimpleStatesGetParams{ + + timeout: timeout, + } +} + +// NewFailureDetectorSimpleStatesGetParamsWithContext creates a new FailureDetectorSimpleStatesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewFailureDetectorSimpleStatesGetParamsWithContext(ctx context.Context) *FailureDetectorSimpleStatesGetParams { + + return &FailureDetectorSimpleStatesGetParams{ + + Context: ctx, + } +} + +// NewFailureDetectorSimpleStatesGetParamsWithHTTPClient creates a new FailureDetectorSimpleStatesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFailureDetectorSimpleStatesGetParamsWithHTTPClient(client *http.Client) *FailureDetectorSimpleStatesGetParams { + + return &FailureDetectorSimpleStatesGetParams{ + HTTPClient: client, + } +} + +/* +FailureDetectorSimpleStatesGetParams contains all the parameters to send to the API endpoint +for the failure detector simple states get operation typically these are written to a http.Request +*/ +type FailureDetectorSimpleStatesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the failure detector simple states get params +func (o *FailureDetectorSimpleStatesGetParams) WithTimeout(timeout time.Duration) *FailureDetectorSimpleStatesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the failure detector simple states get params +func (o *FailureDetectorSimpleStatesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the failure detector simple states get params +func (o *FailureDetectorSimpleStatesGetParams) WithContext(ctx context.Context) *FailureDetectorSimpleStatesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the failure detector simple states get params +func (o *FailureDetectorSimpleStatesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the failure detector simple states get params +func (o *FailureDetectorSimpleStatesGetParams) WithHTTPClient(client *http.Client) *FailureDetectorSimpleStatesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the failure detector simple states get params +func (o *FailureDetectorSimpleStatesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FailureDetectorSimpleStatesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_simple_states_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_simple_states_get_responses.go new file mode 100644 index 0000000000..f321a09e6f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/failure_detector_simple_states_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// FailureDetectorSimpleStatesGetReader is a Reader for the FailureDetectorSimpleStatesGet structure. +type FailureDetectorSimpleStatesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FailureDetectorSimpleStatesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFailureDetectorSimpleStatesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFailureDetectorSimpleStatesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFailureDetectorSimpleStatesGetOK creates a FailureDetectorSimpleStatesGetOK with default headers values +func NewFailureDetectorSimpleStatesGetOK() *FailureDetectorSimpleStatesGetOK { + return &FailureDetectorSimpleStatesGetOK{} +} + +/* +FailureDetectorSimpleStatesGetOK handles this case with default header values. + +Success +*/ +type FailureDetectorSimpleStatesGetOK struct { + Payload []*models.Mapper +} + +func (o *FailureDetectorSimpleStatesGetOK) GetPayload() []*models.Mapper { + return o.Payload +} + +func (o *FailureDetectorSimpleStatesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFailureDetectorSimpleStatesGetDefault creates a FailureDetectorSimpleStatesGetDefault with default headers values +func NewFailureDetectorSimpleStatesGetDefault(code int) *FailureDetectorSimpleStatesGetDefault { + return &FailureDetectorSimpleStatesGetDefault{ + _statusCode: code, + } +} + +/* +FailureDetectorSimpleStatesGetDefault handles this case with default header values. + +internal server error +*/ +type FailureDetectorSimpleStatesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the failure detector simple states get default response +func (o *FailureDetectorSimpleStatesGetDefault) Code() int { + return o._statusCode +} + +func (o *FailureDetectorSimpleStatesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FailureDetectorSimpleStatesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FailureDetectorSimpleStatesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_assassinate_by_addr_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_assassinate_by_addr_post_parameters.go new file mode 100644 index 0000000000..8665150b70 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_assassinate_by_addr_post_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGossiperAssassinateByAddrPostParams creates a new GossiperAssassinateByAddrPostParams object +// with the default values initialized. +func NewGossiperAssassinateByAddrPostParams() *GossiperAssassinateByAddrPostParams { + var () + return &GossiperAssassinateByAddrPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGossiperAssassinateByAddrPostParamsWithTimeout creates a new GossiperAssassinateByAddrPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGossiperAssassinateByAddrPostParamsWithTimeout(timeout time.Duration) *GossiperAssassinateByAddrPostParams { + var () + return &GossiperAssassinateByAddrPostParams{ + + timeout: timeout, + } +} + +// NewGossiperAssassinateByAddrPostParamsWithContext creates a new GossiperAssassinateByAddrPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewGossiperAssassinateByAddrPostParamsWithContext(ctx context.Context) *GossiperAssassinateByAddrPostParams { + var () + return &GossiperAssassinateByAddrPostParams{ + + Context: ctx, + } +} + +// NewGossiperAssassinateByAddrPostParamsWithHTTPClient creates a new GossiperAssassinateByAddrPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGossiperAssassinateByAddrPostParamsWithHTTPClient(client *http.Client) *GossiperAssassinateByAddrPostParams { + var () + return &GossiperAssassinateByAddrPostParams{ + HTTPClient: client, + } +} + +/* +GossiperAssassinateByAddrPostParams contains all the parameters to send to the API endpoint +for the gossiper assassinate by addr post operation typically these are written to a http.Request +*/ +type GossiperAssassinateByAddrPostParams struct { + + /*Addr + The endpoint address + + */ + Addr string + /*Unsafe + Set to True to perform an unsafe assassination + + */ + Unsafe *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the gossiper assassinate by addr post params +func (o *GossiperAssassinateByAddrPostParams) WithTimeout(timeout time.Duration) *GossiperAssassinateByAddrPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the gossiper assassinate by addr post params +func (o *GossiperAssassinateByAddrPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the gossiper assassinate by addr post params +func (o *GossiperAssassinateByAddrPostParams) WithContext(ctx context.Context) *GossiperAssassinateByAddrPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the gossiper assassinate by addr post params +func (o *GossiperAssassinateByAddrPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the gossiper assassinate by addr post params +func (o *GossiperAssassinateByAddrPostParams) WithHTTPClient(client *http.Client) *GossiperAssassinateByAddrPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the gossiper assassinate by addr post params +func (o *GossiperAssassinateByAddrPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAddr adds the addr to the gossiper assassinate by addr post params +func (o *GossiperAssassinateByAddrPostParams) WithAddr(addr string) *GossiperAssassinateByAddrPostParams { + o.SetAddr(addr) + return o +} + +// SetAddr adds the addr to the gossiper assassinate by addr post params +func (o *GossiperAssassinateByAddrPostParams) SetAddr(addr string) { + o.Addr = addr +} + +// WithUnsafe adds the unsafe to the gossiper assassinate by addr post params +func (o *GossiperAssassinateByAddrPostParams) WithUnsafe(unsafe *bool) *GossiperAssassinateByAddrPostParams { + o.SetUnsafe(unsafe) + return o +} + +// SetUnsafe adds the unsafe to the gossiper assassinate by addr post params +func (o *GossiperAssassinateByAddrPostParams) SetUnsafe(unsafe *bool) { + o.Unsafe = unsafe +} + +// WriteToRequest writes these params to a swagger request +func (o *GossiperAssassinateByAddrPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param addr + if err := r.SetPathParam("addr", o.Addr); err != nil { + return err + } + + if o.Unsafe != nil { + + // query param unsafe + var qrUnsafe bool + if o.Unsafe != nil { + qrUnsafe = *o.Unsafe + } + qUnsafe := swag.FormatBool(qrUnsafe) + if qUnsafe != "" { + if err := r.SetQueryParam("unsafe", qUnsafe); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_assassinate_by_addr_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_assassinate_by_addr_post_responses.go new file mode 100644 index 0000000000..188d970313 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_assassinate_by_addr_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// GossiperAssassinateByAddrPostReader is a Reader for the GossiperAssassinateByAddrPost structure. +type GossiperAssassinateByAddrPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GossiperAssassinateByAddrPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGossiperAssassinateByAddrPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGossiperAssassinateByAddrPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGossiperAssassinateByAddrPostOK creates a GossiperAssassinateByAddrPostOK with default headers values +func NewGossiperAssassinateByAddrPostOK() *GossiperAssassinateByAddrPostOK { + return &GossiperAssassinateByAddrPostOK{} +} + +/* +GossiperAssassinateByAddrPostOK handles this case with default header values. + +Success +*/ +type GossiperAssassinateByAddrPostOK struct { +} + +func (o *GossiperAssassinateByAddrPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewGossiperAssassinateByAddrPostDefault creates a GossiperAssassinateByAddrPostDefault with default headers values +func NewGossiperAssassinateByAddrPostDefault(code int) *GossiperAssassinateByAddrPostDefault { + return &GossiperAssassinateByAddrPostDefault{ + _statusCode: code, + } +} + +/* +GossiperAssassinateByAddrPostDefault handles this case with default header values. + +internal server error +*/ +type GossiperAssassinateByAddrPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the gossiper assassinate by addr post default response +func (o *GossiperAssassinateByAddrPostDefault) Code() int { + return o._statusCode +} + +func (o *GossiperAssassinateByAddrPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *GossiperAssassinateByAddrPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *GossiperAssassinateByAddrPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_downtime_by_addr_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_downtime_by_addr_get_parameters.go new file mode 100644 index 0000000000..02a33e659d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_downtime_by_addr_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGossiperDowntimeByAddrGetParams creates a new GossiperDowntimeByAddrGetParams object +// with the default values initialized. +func NewGossiperDowntimeByAddrGetParams() *GossiperDowntimeByAddrGetParams { + var () + return &GossiperDowntimeByAddrGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGossiperDowntimeByAddrGetParamsWithTimeout creates a new GossiperDowntimeByAddrGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGossiperDowntimeByAddrGetParamsWithTimeout(timeout time.Duration) *GossiperDowntimeByAddrGetParams { + var () + return &GossiperDowntimeByAddrGetParams{ + + timeout: timeout, + } +} + +// NewGossiperDowntimeByAddrGetParamsWithContext creates a new GossiperDowntimeByAddrGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewGossiperDowntimeByAddrGetParamsWithContext(ctx context.Context) *GossiperDowntimeByAddrGetParams { + var () + return &GossiperDowntimeByAddrGetParams{ + + Context: ctx, + } +} + +// NewGossiperDowntimeByAddrGetParamsWithHTTPClient creates a new GossiperDowntimeByAddrGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGossiperDowntimeByAddrGetParamsWithHTTPClient(client *http.Client) *GossiperDowntimeByAddrGetParams { + var () + return &GossiperDowntimeByAddrGetParams{ + HTTPClient: client, + } +} + +/* +GossiperDowntimeByAddrGetParams contains all the parameters to send to the API endpoint +for the gossiper downtime by addr get operation typically these are written to a http.Request +*/ +type GossiperDowntimeByAddrGetParams struct { + + /*Addr + The endpoint address + + */ + Addr string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the gossiper downtime by addr get params +func (o *GossiperDowntimeByAddrGetParams) WithTimeout(timeout time.Duration) *GossiperDowntimeByAddrGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the gossiper downtime by addr get params +func (o *GossiperDowntimeByAddrGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the gossiper downtime by addr get params +func (o *GossiperDowntimeByAddrGetParams) WithContext(ctx context.Context) *GossiperDowntimeByAddrGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the gossiper downtime by addr get params +func (o *GossiperDowntimeByAddrGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the gossiper downtime by addr get params +func (o *GossiperDowntimeByAddrGetParams) WithHTTPClient(client *http.Client) *GossiperDowntimeByAddrGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the gossiper downtime by addr get params +func (o *GossiperDowntimeByAddrGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAddr adds the addr to the gossiper downtime by addr get params +func (o *GossiperDowntimeByAddrGetParams) WithAddr(addr string) *GossiperDowntimeByAddrGetParams { + o.SetAddr(addr) + return o +} + +// SetAddr adds the addr to the gossiper downtime by addr get params +func (o *GossiperDowntimeByAddrGetParams) SetAddr(addr string) { + o.Addr = addr +} + +// WriteToRequest writes these params to a swagger request +func (o *GossiperDowntimeByAddrGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param addr + if err := r.SetPathParam("addr", o.Addr); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_downtime_by_addr_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_downtime_by_addr_get_responses.go new file mode 100644 index 0000000000..8274e4c61d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_downtime_by_addr_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// GossiperDowntimeByAddrGetReader is a Reader for the GossiperDowntimeByAddrGet structure. +type GossiperDowntimeByAddrGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GossiperDowntimeByAddrGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGossiperDowntimeByAddrGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGossiperDowntimeByAddrGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGossiperDowntimeByAddrGetOK creates a GossiperDowntimeByAddrGetOK with default headers values +func NewGossiperDowntimeByAddrGetOK() *GossiperDowntimeByAddrGetOK { + return &GossiperDowntimeByAddrGetOK{} +} + +/* +GossiperDowntimeByAddrGetOK handles this case with default header values. + +Success +*/ +type GossiperDowntimeByAddrGetOK struct { + Payload interface{} +} + +func (o *GossiperDowntimeByAddrGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *GossiperDowntimeByAddrGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGossiperDowntimeByAddrGetDefault creates a GossiperDowntimeByAddrGetDefault with default headers values +func NewGossiperDowntimeByAddrGetDefault(code int) *GossiperDowntimeByAddrGetDefault { + return &GossiperDowntimeByAddrGetDefault{ + _statusCode: code, + } +} + +/* +GossiperDowntimeByAddrGetDefault handles this case with default header values. + +internal server error +*/ +type GossiperDowntimeByAddrGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the gossiper downtime by addr get default response +func (o *GossiperDowntimeByAddrGetDefault) Code() int { + return o._statusCode +} + +func (o *GossiperDowntimeByAddrGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *GossiperDowntimeByAddrGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *GossiperDowntimeByAddrGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_endpoint_down_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_endpoint_down_get_parameters.go new file mode 100644 index 0000000000..f7a3d069d5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_endpoint_down_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGossiperEndpointDownGetParams creates a new GossiperEndpointDownGetParams object +// with the default values initialized. +func NewGossiperEndpointDownGetParams() *GossiperEndpointDownGetParams { + + return &GossiperEndpointDownGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGossiperEndpointDownGetParamsWithTimeout creates a new GossiperEndpointDownGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGossiperEndpointDownGetParamsWithTimeout(timeout time.Duration) *GossiperEndpointDownGetParams { + + return &GossiperEndpointDownGetParams{ + + timeout: timeout, + } +} + +// NewGossiperEndpointDownGetParamsWithContext creates a new GossiperEndpointDownGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewGossiperEndpointDownGetParamsWithContext(ctx context.Context) *GossiperEndpointDownGetParams { + + return &GossiperEndpointDownGetParams{ + + Context: ctx, + } +} + +// NewGossiperEndpointDownGetParamsWithHTTPClient creates a new GossiperEndpointDownGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGossiperEndpointDownGetParamsWithHTTPClient(client *http.Client) *GossiperEndpointDownGetParams { + + return &GossiperEndpointDownGetParams{ + HTTPClient: client, + } +} + +/* +GossiperEndpointDownGetParams contains all the parameters to send to the API endpoint +for the gossiper endpoint down get operation typically these are written to a http.Request +*/ +type GossiperEndpointDownGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the gossiper endpoint down get params +func (o *GossiperEndpointDownGetParams) WithTimeout(timeout time.Duration) *GossiperEndpointDownGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the gossiper endpoint down get params +func (o *GossiperEndpointDownGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the gossiper endpoint down get params +func (o *GossiperEndpointDownGetParams) WithContext(ctx context.Context) *GossiperEndpointDownGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the gossiper endpoint down get params +func (o *GossiperEndpointDownGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the gossiper endpoint down get params +func (o *GossiperEndpointDownGetParams) WithHTTPClient(client *http.Client) *GossiperEndpointDownGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the gossiper endpoint down get params +func (o *GossiperEndpointDownGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GossiperEndpointDownGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_endpoint_down_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_endpoint_down_get_responses.go new file mode 100644 index 0000000000..4b86c35f46 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_endpoint_down_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// GossiperEndpointDownGetReader is a Reader for the GossiperEndpointDownGet structure. +type GossiperEndpointDownGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GossiperEndpointDownGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGossiperEndpointDownGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGossiperEndpointDownGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGossiperEndpointDownGetOK creates a GossiperEndpointDownGetOK with default headers values +func NewGossiperEndpointDownGetOK() *GossiperEndpointDownGetOK { + return &GossiperEndpointDownGetOK{} +} + +/* +GossiperEndpointDownGetOK handles this case with default header values. + +Success +*/ +type GossiperEndpointDownGetOK struct { + Payload []string +} + +func (o *GossiperEndpointDownGetOK) GetPayload() []string { + return o.Payload +} + +func (o *GossiperEndpointDownGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGossiperEndpointDownGetDefault creates a GossiperEndpointDownGetDefault with default headers values +func NewGossiperEndpointDownGetDefault(code int) *GossiperEndpointDownGetDefault { + return &GossiperEndpointDownGetDefault{ + _statusCode: code, + } +} + +/* +GossiperEndpointDownGetDefault handles this case with default header values. + +internal server error +*/ +type GossiperEndpointDownGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the gossiper endpoint down get default response +func (o *GossiperEndpointDownGetDefault) Code() int { + return o._statusCode +} + +func (o *GossiperEndpointDownGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *GossiperEndpointDownGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *GossiperEndpointDownGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_endpoint_live_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_endpoint_live_get_parameters.go new file mode 100644 index 0000000000..4b66665fe2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_endpoint_live_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGossiperEndpointLiveGetParams creates a new GossiperEndpointLiveGetParams object +// with the default values initialized. +func NewGossiperEndpointLiveGetParams() *GossiperEndpointLiveGetParams { + + return &GossiperEndpointLiveGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGossiperEndpointLiveGetParamsWithTimeout creates a new GossiperEndpointLiveGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGossiperEndpointLiveGetParamsWithTimeout(timeout time.Duration) *GossiperEndpointLiveGetParams { + + return &GossiperEndpointLiveGetParams{ + + timeout: timeout, + } +} + +// NewGossiperEndpointLiveGetParamsWithContext creates a new GossiperEndpointLiveGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewGossiperEndpointLiveGetParamsWithContext(ctx context.Context) *GossiperEndpointLiveGetParams { + + return &GossiperEndpointLiveGetParams{ + + Context: ctx, + } +} + +// NewGossiperEndpointLiveGetParamsWithHTTPClient creates a new GossiperEndpointLiveGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGossiperEndpointLiveGetParamsWithHTTPClient(client *http.Client) *GossiperEndpointLiveGetParams { + + return &GossiperEndpointLiveGetParams{ + HTTPClient: client, + } +} + +/* +GossiperEndpointLiveGetParams contains all the parameters to send to the API endpoint +for the gossiper endpoint live get operation typically these are written to a http.Request +*/ +type GossiperEndpointLiveGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the gossiper endpoint live get params +func (o *GossiperEndpointLiveGetParams) WithTimeout(timeout time.Duration) *GossiperEndpointLiveGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the gossiper endpoint live get params +func (o *GossiperEndpointLiveGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the gossiper endpoint live get params +func (o *GossiperEndpointLiveGetParams) WithContext(ctx context.Context) *GossiperEndpointLiveGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the gossiper endpoint live get params +func (o *GossiperEndpointLiveGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the gossiper endpoint live get params +func (o *GossiperEndpointLiveGetParams) WithHTTPClient(client *http.Client) *GossiperEndpointLiveGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the gossiper endpoint live get params +func (o *GossiperEndpointLiveGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GossiperEndpointLiveGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_endpoint_live_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_endpoint_live_get_responses.go new file mode 100644 index 0000000000..d8cba3d279 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_endpoint_live_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// GossiperEndpointLiveGetReader is a Reader for the GossiperEndpointLiveGet structure. +type GossiperEndpointLiveGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GossiperEndpointLiveGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGossiperEndpointLiveGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGossiperEndpointLiveGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGossiperEndpointLiveGetOK creates a GossiperEndpointLiveGetOK with default headers values +func NewGossiperEndpointLiveGetOK() *GossiperEndpointLiveGetOK { + return &GossiperEndpointLiveGetOK{} +} + +/* +GossiperEndpointLiveGetOK handles this case with default header values. + +Success +*/ +type GossiperEndpointLiveGetOK struct { + Payload []string +} + +func (o *GossiperEndpointLiveGetOK) GetPayload() []string { + return o.Payload +} + +func (o *GossiperEndpointLiveGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGossiperEndpointLiveGetDefault creates a GossiperEndpointLiveGetDefault with default headers values +func NewGossiperEndpointLiveGetDefault(code int) *GossiperEndpointLiveGetDefault { + return &GossiperEndpointLiveGetDefault{ + _statusCode: code, + } +} + +/* +GossiperEndpointLiveGetDefault handles this case with default header values. + +internal server error +*/ +type GossiperEndpointLiveGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the gossiper endpoint live get default response +func (o *GossiperEndpointLiveGetDefault) Code() int { + return o._statusCode +} + +func (o *GossiperEndpointLiveGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *GossiperEndpointLiveGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *GossiperEndpointLiveGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_generation_number_by_addr_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_generation_number_by_addr_get_parameters.go new file mode 100644 index 0000000000..7e8c6e7aba --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_generation_number_by_addr_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGossiperGenerationNumberByAddrGetParams creates a new GossiperGenerationNumberByAddrGetParams object +// with the default values initialized. +func NewGossiperGenerationNumberByAddrGetParams() *GossiperGenerationNumberByAddrGetParams { + var () + return &GossiperGenerationNumberByAddrGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGossiperGenerationNumberByAddrGetParamsWithTimeout creates a new GossiperGenerationNumberByAddrGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGossiperGenerationNumberByAddrGetParamsWithTimeout(timeout time.Duration) *GossiperGenerationNumberByAddrGetParams { + var () + return &GossiperGenerationNumberByAddrGetParams{ + + timeout: timeout, + } +} + +// NewGossiperGenerationNumberByAddrGetParamsWithContext creates a new GossiperGenerationNumberByAddrGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewGossiperGenerationNumberByAddrGetParamsWithContext(ctx context.Context) *GossiperGenerationNumberByAddrGetParams { + var () + return &GossiperGenerationNumberByAddrGetParams{ + + Context: ctx, + } +} + +// NewGossiperGenerationNumberByAddrGetParamsWithHTTPClient creates a new GossiperGenerationNumberByAddrGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGossiperGenerationNumberByAddrGetParamsWithHTTPClient(client *http.Client) *GossiperGenerationNumberByAddrGetParams { + var () + return &GossiperGenerationNumberByAddrGetParams{ + HTTPClient: client, + } +} + +/* +GossiperGenerationNumberByAddrGetParams contains all the parameters to send to the API endpoint +for the gossiper generation number by addr get operation typically these are written to a http.Request +*/ +type GossiperGenerationNumberByAddrGetParams struct { + + /*Addr + The endpoint address + + */ + Addr string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the gossiper generation number by addr get params +func (o *GossiperGenerationNumberByAddrGetParams) WithTimeout(timeout time.Duration) *GossiperGenerationNumberByAddrGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the gossiper generation number by addr get params +func (o *GossiperGenerationNumberByAddrGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the gossiper generation number by addr get params +func (o *GossiperGenerationNumberByAddrGetParams) WithContext(ctx context.Context) *GossiperGenerationNumberByAddrGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the gossiper generation number by addr get params +func (o *GossiperGenerationNumberByAddrGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the gossiper generation number by addr get params +func (o *GossiperGenerationNumberByAddrGetParams) WithHTTPClient(client *http.Client) *GossiperGenerationNumberByAddrGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the gossiper generation number by addr get params +func (o *GossiperGenerationNumberByAddrGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAddr adds the addr to the gossiper generation number by addr get params +func (o *GossiperGenerationNumberByAddrGetParams) WithAddr(addr string) *GossiperGenerationNumberByAddrGetParams { + o.SetAddr(addr) + return o +} + +// SetAddr adds the addr to the gossiper generation number by addr get params +func (o *GossiperGenerationNumberByAddrGetParams) SetAddr(addr string) { + o.Addr = addr +} + +// WriteToRequest writes these params to a swagger request +func (o *GossiperGenerationNumberByAddrGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param addr + if err := r.SetPathParam("addr", o.Addr); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_generation_number_by_addr_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_generation_number_by_addr_get_responses.go new file mode 100644 index 0000000000..90420a7d79 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_generation_number_by_addr_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// GossiperGenerationNumberByAddrGetReader is a Reader for the GossiperGenerationNumberByAddrGet structure. +type GossiperGenerationNumberByAddrGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GossiperGenerationNumberByAddrGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGossiperGenerationNumberByAddrGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGossiperGenerationNumberByAddrGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGossiperGenerationNumberByAddrGetOK creates a GossiperGenerationNumberByAddrGetOK with default headers values +func NewGossiperGenerationNumberByAddrGetOK() *GossiperGenerationNumberByAddrGetOK { + return &GossiperGenerationNumberByAddrGetOK{} +} + +/* +GossiperGenerationNumberByAddrGetOK handles this case with default header values. + +Success +*/ +type GossiperGenerationNumberByAddrGetOK struct { + Payload int32 +} + +func (o *GossiperGenerationNumberByAddrGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *GossiperGenerationNumberByAddrGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGossiperGenerationNumberByAddrGetDefault creates a GossiperGenerationNumberByAddrGetDefault with default headers values +func NewGossiperGenerationNumberByAddrGetDefault(code int) *GossiperGenerationNumberByAddrGetDefault { + return &GossiperGenerationNumberByAddrGetDefault{ + _statusCode: code, + } +} + +/* +GossiperGenerationNumberByAddrGetDefault handles this case with default header values. + +internal server error +*/ +type GossiperGenerationNumberByAddrGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the gossiper generation number by addr get default response +func (o *GossiperGenerationNumberByAddrGetDefault) Code() int { + return o._statusCode +} + +func (o *GossiperGenerationNumberByAddrGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *GossiperGenerationNumberByAddrGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *GossiperGenerationNumberByAddrGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_heart_beat_version_by_addr_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_heart_beat_version_by_addr_get_parameters.go new file mode 100644 index 0000000000..a8b2c19c9a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_heart_beat_version_by_addr_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGossiperHeartBeatVersionByAddrGetParams creates a new GossiperHeartBeatVersionByAddrGetParams object +// with the default values initialized. +func NewGossiperHeartBeatVersionByAddrGetParams() *GossiperHeartBeatVersionByAddrGetParams { + var () + return &GossiperHeartBeatVersionByAddrGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGossiperHeartBeatVersionByAddrGetParamsWithTimeout creates a new GossiperHeartBeatVersionByAddrGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGossiperHeartBeatVersionByAddrGetParamsWithTimeout(timeout time.Duration) *GossiperHeartBeatVersionByAddrGetParams { + var () + return &GossiperHeartBeatVersionByAddrGetParams{ + + timeout: timeout, + } +} + +// NewGossiperHeartBeatVersionByAddrGetParamsWithContext creates a new GossiperHeartBeatVersionByAddrGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewGossiperHeartBeatVersionByAddrGetParamsWithContext(ctx context.Context) *GossiperHeartBeatVersionByAddrGetParams { + var () + return &GossiperHeartBeatVersionByAddrGetParams{ + + Context: ctx, + } +} + +// NewGossiperHeartBeatVersionByAddrGetParamsWithHTTPClient creates a new GossiperHeartBeatVersionByAddrGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGossiperHeartBeatVersionByAddrGetParamsWithHTTPClient(client *http.Client) *GossiperHeartBeatVersionByAddrGetParams { + var () + return &GossiperHeartBeatVersionByAddrGetParams{ + HTTPClient: client, + } +} + +/* +GossiperHeartBeatVersionByAddrGetParams contains all the parameters to send to the API endpoint +for the gossiper heart beat version by addr get operation typically these are written to a http.Request +*/ +type GossiperHeartBeatVersionByAddrGetParams struct { + + /*Addr + The endpoint address + + */ + Addr string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the gossiper heart beat version by addr get params +func (o *GossiperHeartBeatVersionByAddrGetParams) WithTimeout(timeout time.Duration) *GossiperHeartBeatVersionByAddrGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the gossiper heart beat version by addr get params +func (o *GossiperHeartBeatVersionByAddrGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the gossiper heart beat version by addr get params +func (o *GossiperHeartBeatVersionByAddrGetParams) WithContext(ctx context.Context) *GossiperHeartBeatVersionByAddrGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the gossiper heart beat version by addr get params +func (o *GossiperHeartBeatVersionByAddrGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the gossiper heart beat version by addr get params +func (o *GossiperHeartBeatVersionByAddrGetParams) WithHTTPClient(client *http.Client) *GossiperHeartBeatVersionByAddrGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the gossiper heart beat version by addr get params +func (o *GossiperHeartBeatVersionByAddrGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAddr adds the addr to the gossiper heart beat version by addr get params +func (o *GossiperHeartBeatVersionByAddrGetParams) WithAddr(addr string) *GossiperHeartBeatVersionByAddrGetParams { + o.SetAddr(addr) + return o +} + +// SetAddr adds the addr to the gossiper heart beat version by addr get params +func (o *GossiperHeartBeatVersionByAddrGetParams) SetAddr(addr string) { + o.Addr = addr +} + +// WriteToRequest writes these params to a swagger request +func (o *GossiperHeartBeatVersionByAddrGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param addr + if err := r.SetPathParam("addr", o.Addr); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_heart_beat_version_by_addr_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_heart_beat_version_by_addr_get_responses.go new file mode 100644 index 0000000000..4966b4b09d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/gossiper_heart_beat_version_by_addr_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// GossiperHeartBeatVersionByAddrGetReader is a Reader for the GossiperHeartBeatVersionByAddrGet structure. +type GossiperHeartBeatVersionByAddrGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GossiperHeartBeatVersionByAddrGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGossiperHeartBeatVersionByAddrGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGossiperHeartBeatVersionByAddrGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGossiperHeartBeatVersionByAddrGetOK creates a GossiperHeartBeatVersionByAddrGetOK with default headers values +func NewGossiperHeartBeatVersionByAddrGetOK() *GossiperHeartBeatVersionByAddrGetOK { + return &GossiperHeartBeatVersionByAddrGetOK{} +} + +/* +GossiperHeartBeatVersionByAddrGetOK handles this case with default header values. + +Success +*/ +type GossiperHeartBeatVersionByAddrGetOK struct { + Payload int32 +} + +func (o *GossiperHeartBeatVersionByAddrGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *GossiperHeartBeatVersionByAddrGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGossiperHeartBeatVersionByAddrGetDefault creates a GossiperHeartBeatVersionByAddrGetDefault with default headers values +func NewGossiperHeartBeatVersionByAddrGetDefault(code int) *GossiperHeartBeatVersionByAddrGetDefault { + return &GossiperHeartBeatVersionByAddrGetDefault{ + _statusCode: code, + } +} + +/* +GossiperHeartBeatVersionByAddrGetDefault handles this case with default header values. + +internal server error +*/ +type GossiperHeartBeatVersionByAddrGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the gossiper heart beat version by addr get default response +func (o *GossiperHeartBeatVersionByAddrGetDefault) Code() int { + return o._statusCode +} + +func (o *GossiperHeartBeatVersionByAddrGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *GossiperHeartBeatVersionByAddrGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *GossiperHeartBeatVersionByAddrGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_hints_delete_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_hints_delete_parameters.go new file mode 100644 index 0000000000..7fa2f1a676 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_hints_delete_parameters.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewHintedHandoffHintsDeleteParams creates a new HintedHandoffHintsDeleteParams object +// with the default values initialized. +func NewHintedHandoffHintsDeleteParams() *HintedHandoffHintsDeleteParams { + var () + return &HintedHandoffHintsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewHintedHandoffHintsDeleteParamsWithTimeout creates a new HintedHandoffHintsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewHintedHandoffHintsDeleteParamsWithTimeout(timeout time.Duration) *HintedHandoffHintsDeleteParams { + var () + return &HintedHandoffHintsDeleteParams{ + + timeout: timeout, + } +} + +// NewHintedHandoffHintsDeleteParamsWithContext creates a new HintedHandoffHintsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewHintedHandoffHintsDeleteParamsWithContext(ctx context.Context) *HintedHandoffHintsDeleteParams { + var () + return &HintedHandoffHintsDeleteParams{ + + Context: ctx, + } +} + +// NewHintedHandoffHintsDeleteParamsWithHTTPClient creates a new HintedHandoffHintsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewHintedHandoffHintsDeleteParamsWithHTTPClient(client *http.Client) *HintedHandoffHintsDeleteParams { + var () + return &HintedHandoffHintsDeleteParams{ + HTTPClient: client, + } +} + +/* +HintedHandoffHintsDeleteParams contains all the parameters to send to the API endpoint +for the hinted handoff hints delete operation typically these are written to a http.Request +*/ +type HintedHandoffHintsDeleteParams struct { + + /*Host + Optional String rep. of endpoint address to delete hints for + + */ + Host *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the hinted handoff hints delete params +func (o *HintedHandoffHintsDeleteParams) WithTimeout(timeout time.Duration) *HintedHandoffHintsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the hinted handoff hints delete params +func (o *HintedHandoffHintsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the hinted handoff hints delete params +func (o *HintedHandoffHintsDeleteParams) WithContext(ctx context.Context) *HintedHandoffHintsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the hinted handoff hints delete params +func (o *HintedHandoffHintsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the hinted handoff hints delete params +func (o *HintedHandoffHintsDeleteParams) WithHTTPClient(client *http.Client) *HintedHandoffHintsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the hinted handoff hints delete params +func (o *HintedHandoffHintsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithHost adds the host to the hinted handoff hints delete params +func (o *HintedHandoffHintsDeleteParams) WithHost(host *string) *HintedHandoffHintsDeleteParams { + o.SetHost(host) + return o +} + +// SetHost adds the host to the hinted handoff hints delete params +func (o *HintedHandoffHintsDeleteParams) SetHost(host *string) { + o.Host = host +} + +// WriteToRequest writes these params to a swagger request +func (o *HintedHandoffHintsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Host != nil { + + // query param host + var qrHost string + if o.Host != nil { + qrHost = *o.Host + } + qHost := qrHost + if qHost != "" { + if err := r.SetQueryParam("host", qHost); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_hints_delete_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_hints_delete_responses.go new file mode 100644 index 0000000000..020d75199b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_hints_delete_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// HintedHandoffHintsDeleteReader is a Reader for the HintedHandoffHintsDelete structure. +type HintedHandoffHintsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *HintedHandoffHintsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewHintedHandoffHintsDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewHintedHandoffHintsDeleteDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewHintedHandoffHintsDeleteOK creates a HintedHandoffHintsDeleteOK with default headers values +func NewHintedHandoffHintsDeleteOK() *HintedHandoffHintsDeleteOK { + return &HintedHandoffHintsDeleteOK{} +} + +/* +HintedHandoffHintsDeleteOK handles this case with default header values. + +Success +*/ +type HintedHandoffHintsDeleteOK struct { +} + +func (o *HintedHandoffHintsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewHintedHandoffHintsDeleteDefault creates a HintedHandoffHintsDeleteDefault with default headers values +func NewHintedHandoffHintsDeleteDefault(code int) *HintedHandoffHintsDeleteDefault { + return &HintedHandoffHintsDeleteDefault{ + _statusCode: code, + } +} + +/* +HintedHandoffHintsDeleteDefault handles this case with default header values. + +internal server error +*/ +type HintedHandoffHintsDeleteDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the hinted handoff hints delete default response +func (o *HintedHandoffHintsDeleteDefault) Code() int { + return o._statusCode +} + +func (o *HintedHandoffHintsDeleteDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *HintedHandoffHintsDeleteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *HintedHandoffHintsDeleteDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_hints_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_hints_get_parameters.go new file mode 100644 index 0000000000..e0e946ebae --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_hints_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewHintedHandoffHintsGetParams creates a new HintedHandoffHintsGetParams object +// with the default values initialized. +func NewHintedHandoffHintsGetParams() *HintedHandoffHintsGetParams { + + return &HintedHandoffHintsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewHintedHandoffHintsGetParamsWithTimeout creates a new HintedHandoffHintsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewHintedHandoffHintsGetParamsWithTimeout(timeout time.Duration) *HintedHandoffHintsGetParams { + + return &HintedHandoffHintsGetParams{ + + timeout: timeout, + } +} + +// NewHintedHandoffHintsGetParamsWithContext creates a new HintedHandoffHintsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewHintedHandoffHintsGetParamsWithContext(ctx context.Context) *HintedHandoffHintsGetParams { + + return &HintedHandoffHintsGetParams{ + + Context: ctx, + } +} + +// NewHintedHandoffHintsGetParamsWithHTTPClient creates a new HintedHandoffHintsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewHintedHandoffHintsGetParamsWithHTTPClient(client *http.Client) *HintedHandoffHintsGetParams { + + return &HintedHandoffHintsGetParams{ + HTTPClient: client, + } +} + +/* +HintedHandoffHintsGetParams contains all the parameters to send to the API endpoint +for the hinted handoff hints get operation typically these are written to a http.Request +*/ +type HintedHandoffHintsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the hinted handoff hints get params +func (o *HintedHandoffHintsGetParams) WithTimeout(timeout time.Duration) *HintedHandoffHintsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the hinted handoff hints get params +func (o *HintedHandoffHintsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the hinted handoff hints get params +func (o *HintedHandoffHintsGetParams) WithContext(ctx context.Context) *HintedHandoffHintsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the hinted handoff hints get params +func (o *HintedHandoffHintsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the hinted handoff hints get params +func (o *HintedHandoffHintsGetParams) WithHTTPClient(client *http.Client) *HintedHandoffHintsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the hinted handoff hints get params +func (o *HintedHandoffHintsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *HintedHandoffHintsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_hints_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_hints_get_responses.go new file mode 100644 index 0000000000..d823709e53 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_hints_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// HintedHandoffHintsGetReader is a Reader for the HintedHandoffHintsGet structure. +type HintedHandoffHintsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *HintedHandoffHintsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewHintedHandoffHintsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewHintedHandoffHintsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewHintedHandoffHintsGetOK creates a HintedHandoffHintsGetOK with default headers values +func NewHintedHandoffHintsGetOK() *HintedHandoffHintsGetOK { + return &HintedHandoffHintsGetOK{} +} + +/* +HintedHandoffHintsGetOK handles this case with default header values. + +Success +*/ +type HintedHandoffHintsGetOK struct { + Payload []string +} + +func (o *HintedHandoffHintsGetOK) GetPayload() []string { + return o.Payload +} + +func (o *HintedHandoffHintsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewHintedHandoffHintsGetDefault creates a HintedHandoffHintsGetDefault with default headers values +func NewHintedHandoffHintsGetDefault(code int) *HintedHandoffHintsGetDefault { + return &HintedHandoffHintsGetDefault{ + _statusCode: code, + } +} + +/* +HintedHandoffHintsGetDefault handles this case with default header values. + +internal server error +*/ +type HintedHandoffHintsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the hinted handoff hints get default response +func (o *HintedHandoffHintsGetDefault) Code() int { + return o._statusCode +} + +func (o *HintedHandoffHintsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *HintedHandoffHintsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *HintedHandoffHintsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_metrics_create_hint_by_addr_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_metrics_create_hint_by_addr_get_parameters.go new file mode 100644 index 0000000000..cbc3477990 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_metrics_create_hint_by_addr_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewHintedHandoffMetricsCreateHintByAddrGetParams creates a new HintedHandoffMetricsCreateHintByAddrGetParams object +// with the default values initialized. +func NewHintedHandoffMetricsCreateHintByAddrGetParams() *HintedHandoffMetricsCreateHintByAddrGetParams { + var () + return &HintedHandoffMetricsCreateHintByAddrGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewHintedHandoffMetricsCreateHintByAddrGetParamsWithTimeout creates a new HintedHandoffMetricsCreateHintByAddrGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewHintedHandoffMetricsCreateHintByAddrGetParamsWithTimeout(timeout time.Duration) *HintedHandoffMetricsCreateHintByAddrGetParams { + var () + return &HintedHandoffMetricsCreateHintByAddrGetParams{ + + timeout: timeout, + } +} + +// NewHintedHandoffMetricsCreateHintByAddrGetParamsWithContext creates a new HintedHandoffMetricsCreateHintByAddrGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewHintedHandoffMetricsCreateHintByAddrGetParamsWithContext(ctx context.Context) *HintedHandoffMetricsCreateHintByAddrGetParams { + var () + return &HintedHandoffMetricsCreateHintByAddrGetParams{ + + Context: ctx, + } +} + +// NewHintedHandoffMetricsCreateHintByAddrGetParamsWithHTTPClient creates a new HintedHandoffMetricsCreateHintByAddrGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewHintedHandoffMetricsCreateHintByAddrGetParamsWithHTTPClient(client *http.Client) *HintedHandoffMetricsCreateHintByAddrGetParams { + var () + return &HintedHandoffMetricsCreateHintByAddrGetParams{ + HTTPClient: client, + } +} + +/* +HintedHandoffMetricsCreateHintByAddrGetParams contains all the parameters to send to the API endpoint +for the hinted handoff metrics create hint by addr get operation typically these are written to a http.Request +*/ +type HintedHandoffMetricsCreateHintByAddrGetParams struct { + + /*Addr + The peer address + + */ + Addr string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the hinted handoff metrics create hint by addr get params +func (o *HintedHandoffMetricsCreateHintByAddrGetParams) WithTimeout(timeout time.Duration) *HintedHandoffMetricsCreateHintByAddrGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the hinted handoff metrics create hint by addr get params +func (o *HintedHandoffMetricsCreateHintByAddrGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the hinted handoff metrics create hint by addr get params +func (o *HintedHandoffMetricsCreateHintByAddrGetParams) WithContext(ctx context.Context) *HintedHandoffMetricsCreateHintByAddrGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the hinted handoff metrics create hint by addr get params +func (o *HintedHandoffMetricsCreateHintByAddrGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the hinted handoff metrics create hint by addr get params +func (o *HintedHandoffMetricsCreateHintByAddrGetParams) WithHTTPClient(client *http.Client) *HintedHandoffMetricsCreateHintByAddrGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the hinted handoff metrics create hint by addr get params +func (o *HintedHandoffMetricsCreateHintByAddrGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAddr adds the addr to the hinted handoff metrics create hint by addr get params +func (o *HintedHandoffMetricsCreateHintByAddrGetParams) WithAddr(addr string) *HintedHandoffMetricsCreateHintByAddrGetParams { + o.SetAddr(addr) + return o +} + +// SetAddr adds the addr to the hinted handoff metrics create hint by addr get params +func (o *HintedHandoffMetricsCreateHintByAddrGetParams) SetAddr(addr string) { + o.Addr = addr +} + +// WriteToRequest writes these params to a swagger request +func (o *HintedHandoffMetricsCreateHintByAddrGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param addr + if err := r.SetPathParam("addr", o.Addr); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_metrics_create_hint_by_addr_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_metrics_create_hint_by_addr_get_responses.go new file mode 100644 index 0000000000..4a1a95d150 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_metrics_create_hint_by_addr_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// HintedHandoffMetricsCreateHintByAddrGetReader is a Reader for the HintedHandoffMetricsCreateHintByAddrGet structure. +type HintedHandoffMetricsCreateHintByAddrGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *HintedHandoffMetricsCreateHintByAddrGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewHintedHandoffMetricsCreateHintByAddrGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewHintedHandoffMetricsCreateHintByAddrGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewHintedHandoffMetricsCreateHintByAddrGetOK creates a HintedHandoffMetricsCreateHintByAddrGetOK with default headers values +func NewHintedHandoffMetricsCreateHintByAddrGetOK() *HintedHandoffMetricsCreateHintByAddrGetOK { + return &HintedHandoffMetricsCreateHintByAddrGetOK{} +} + +/* +HintedHandoffMetricsCreateHintByAddrGetOK handles this case with default header values. + +Success +*/ +type HintedHandoffMetricsCreateHintByAddrGetOK struct { + Payload int32 +} + +func (o *HintedHandoffMetricsCreateHintByAddrGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *HintedHandoffMetricsCreateHintByAddrGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewHintedHandoffMetricsCreateHintByAddrGetDefault creates a HintedHandoffMetricsCreateHintByAddrGetDefault with default headers values +func NewHintedHandoffMetricsCreateHintByAddrGetDefault(code int) *HintedHandoffMetricsCreateHintByAddrGetDefault { + return &HintedHandoffMetricsCreateHintByAddrGetDefault{ + _statusCode: code, + } +} + +/* +HintedHandoffMetricsCreateHintByAddrGetDefault handles this case with default header values. + +internal server error +*/ +type HintedHandoffMetricsCreateHintByAddrGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the hinted handoff metrics create hint by addr get default response +func (o *HintedHandoffMetricsCreateHintByAddrGetDefault) Code() int { + return o._statusCode +} + +func (o *HintedHandoffMetricsCreateHintByAddrGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *HintedHandoffMetricsCreateHintByAddrGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *HintedHandoffMetricsCreateHintByAddrGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_metrics_not_stored_hints_by_addr_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_metrics_not_stored_hints_by_addr_get_parameters.go new file mode 100644 index 0000000000..d18c0e820d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_metrics_not_stored_hints_by_addr_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewHintedHandoffMetricsNotStoredHintsByAddrGetParams creates a new HintedHandoffMetricsNotStoredHintsByAddrGetParams object +// with the default values initialized. +func NewHintedHandoffMetricsNotStoredHintsByAddrGetParams() *HintedHandoffMetricsNotStoredHintsByAddrGetParams { + var () + return &HintedHandoffMetricsNotStoredHintsByAddrGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewHintedHandoffMetricsNotStoredHintsByAddrGetParamsWithTimeout creates a new HintedHandoffMetricsNotStoredHintsByAddrGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewHintedHandoffMetricsNotStoredHintsByAddrGetParamsWithTimeout(timeout time.Duration) *HintedHandoffMetricsNotStoredHintsByAddrGetParams { + var () + return &HintedHandoffMetricsNotStoredHintsByAddrGetParams{ + + timeout: timeout, + } +} + +// NewHintedHandoffMetricsNotStoredHintsByAddrGetParamsWithContext creates a new HintedHandoffMetricsNotStoredHintsByAddrGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewHintedHandoffMetricsNotStoredHintsByAddrGetParamsWithContext(ctx context.Context) *HintedHandoffMetricsNotStoredHintsByAddrGetParams { + var () + return &HintedHandoffMetricsNotStoredHintsByAddrGetParams{ + + Context: ctx, + } +} + +// NewHintedHandoffMetricsNotStoredHintsByAddrGetParamsWithHTTPClient creates a new HintedHandoffMetricsNotStoredHintsByAddrGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewHintedHandoffMetricsNotStoredHintsByAddrGetParamsWithHTTPClient(client *http.Client) *HintedHandoffMetricsNotStoredHintsByAddrGetParams { + var () + return &HintedHandoffMetricsNotStoredHintsByAddrGetParams{ + HTTPClient: client, + } +} + +/* +HintedHandoffMetricsNotStoredHintsByAddrGetParams contains all the parameters to send to the API endpoint +for the hinted handoff metrics not stored hints by addr get operation typically these are written to a http.Request +*/ +type HintedHandoffMetricsNotStoredHintsByAddrGetParams struct { + + /*Addr + The peer address + + */ + Addr string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the hinted handoff metrics not stored hints by addr get params +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetParams) WithTimeout(timeout time.Duration) *HintedHandoffMetricsNotStoredHintsByAddrGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the hinted handoff metrics not stored hints by addr get params +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the hinted handoff metrics not stored hints by addr get params +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetParams) WithContext(ctx context.Context) *HintedHandoffMetricsNotStoredHintsByAddrGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the hinted handoff metrics not stored hints by addr get params +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the hinted handoff metrics not stored hints by addr get params +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetParams) WithHTTPClient(client *http.Client) *HintedHandoffMetricsNotStoredHintsByAddrGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the hinted handoff metrics not stored hints by addr get params +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAddr adds the addr to the hinted handoff metrics not stored hints by addr get params +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetParams) WithAddr(addr string) *HintedHandoffMetricsNotStoredHintsByAddrGetParams { + o.SetAddr(addr) + return o +} + +// SetAddr adds the addr to the hinted handoff metrics not stored hints by addr get params +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetParams) SetAddr(addr string) { + o.Addr = addr +} + +// WriteToRequest writes these params to a swagger request +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param addr + if err := r.SetPathParam("addr", o.Addr); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_metrics_not_stored_hints_by_addr_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_metrics_not_stored_hints_by_addr_get_responses.go new file mode 100644 index 0000000000..153dfebdb4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_metrics_not_stored_hints_by_addr_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// HintedHandoffMetricsNotStoredHintsByAddrGetReader is a Reader for the HintedHandoffMetricsNotStoredHintsByAddrGet structure. +type HintedHandoffMetricsNotStoredHintsByAddrGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewHintedHandoffMetricsNotStoredHintsByAddrGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewHintedHandoffMetricsNotStoredHintsByAddrGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewHintedHandoffMetricsNotStoredHintsByAddrGetOK creates a HintedHandoffMetricsNotStoredHintsByAddrGetOK with default headers values +func NewHintedHandoffMetricsNotStoredHintsByAddrGetOK() *HintedHandoffMetricsNotStoredHintsByAddrGetOK { + return &HintedHandoffMetricsNotStoredHintsByAddrGetOK{} +} + +/* +HintedHandoffMetricsNotStoredHintsByAddrGetOK handles this case with default header values. + +Success +*/ +type HintedHandoffMetricsNotStoredHintsByAddrGetOK struct { + Payload int32 +} + +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewHintedHandoffMetricsNotStoredHintsByAddrGetDefault creates a HintedHandoffMetricsNotStoredHintsByAddrGetDefault with default headers values +func NewHintedHandoffMetricsNotStoredHintsByAddrGetDefault(code int) *HintedHandoffMetricsNotStoredHintsByAddrGetDefault { + return &HintedHandoffMetricsNotStoredHintsByAddrGetDefault{ + _statusCode: code, + } +} + +/* +HintedHandoffMetricsNotStoredHintsByAddrGetDefault handles this case with default header values. + +internal server error +*/ +type HintedHandoffMetricsNotStoredHintsByAddrGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the hinted handoff metrics not stored hints by addr get default response +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetDefault) Code() int { + return o._statusCode +} + +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *HintedHandoffMetricsNotStoredHintsByAddrGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_pause_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_pause_post_parameters.go new file mode 100644 index 0000000000..51c6d796b9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_pause_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewHintedHandoffPausePostParams creates a new HintedHandoffPausePostParams object +// with the default values initialized. +func NewHintedHandoffPausePostParams() *HintedHandoffPausePostParams { + var () + return &HintedHandoffPausePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewHintedHandoffPausePostParamsWithTimeout creates a new HintedHandoffPausePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewHintedHandoffPausePostParamsWithTimeout(timeout time.Duration) *HintedHandoffPausePostParams { + var () + return &HintedHandoffPausePostParams{ + + timeout: timeout, + } +} + +// NewHintedHandoffPausePostParamsWithContext creates a new HintedHandoffPausePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewHintedHandoffPausePostParamsWithContext(ctx context.Context) *HintedHandoffPausePostParams { + var () + return &HintedHandoffPausePostParams{ + + Context: ctx, + } +} + +// NewHintedHandoffPausePostParamsWithHTTPClient creates a new HintedHandoffPausePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewHintedHandoffPausePostParamsWithHTTPClient(client *http.Client) *HintedHandoffPausePostParams { + var () + return &HintedHandoffPausePostParams{ + HTTPClient: client, + } +} + +/* +HintedHandoffPausePostParams contains all the parameters to send to the API endpoint +for the hinted handoff pause post operation typically these are written to a http.Request +*/ +type HintedHandoffPausePostParams struct { + + /*Pause + pause status + + */ + Pause bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the hinted handoff pause post params +func (o *HintedHandoffPausePostParams) WithTimeout(timeout time.Duration) *HintedHandoffPausePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the hinted handoff pause post params +func (o *HintedHandoffPausePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the hinted handoff pause post params +func (o *HintedHandoffPausePostParams) WithContext(ctx context.Context) *HintedHandoffPausePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the hinted handoff pause post params +func (o *HintedHandoffPausePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the hinted handoff pause post params +func (o *HintedHandoffPausePostParams) WithHTTPClient(client *http.Client) *HintedHandoffPausePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the hinted handoff pause post params +func (o *HintedHandoffPausePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPause adds the pause to the hinted handoff pause post params +func (o *HintedHandoffPausePostParams) WithPause(pause bool) *HintedHandoffPausePostParams { + o.SetPause(pause) + return o +} + +// SetPause adds the pause to the hinted handoff pause post params +func (o *HintedHandoffPausePostParams) SetPause(pause bool) { + o.Pause = pause +} + +// WriteToRequest writes these params to a swagger request +func (o *HintedHandoffPausePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param pause + qrPause := o.Pause + qPause := swag.FormatBool(qrPause) + if qPause != "" { + if err := r.SetQueryParam("pause", qPause); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_pause_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_pause_post_responses.go new file mode 100644 index 0000000000..d6fc4a9acc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_pause_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// HintedHandoffPausePostReader is a Reader for the HintedHandoffPausePost structure. +type HintedHandoffPausePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *HintedHandoffPausePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewHintedHandoffPausePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewHintedHandoffPausePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewHintedHandoffPausePostOK creates a HintedHandoffPausePostOK with default headers values +func NewHintedHandoffPausePostOK() *HintedHandoffPausePostOK { + return &HintedHandoffPausePostOK{} +} + +/* +HintedHandoffPausePostOK handles this case with default header values. + +Success +*/ +type HintedHandoffPausePostOK struct { +} + +func (o *HintedHandoffPausePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewHintedHandoffPausePostDefault creates a HintedHandoffPausePostDefault with default headers values +func NewHintedHandoffPausePostDefault(code int) *HintedHandoffPausePostDefault { + return &HintedHandoffPausePostDefault{ + _statusCode: code, + } +} + +/* +HintedHandoffPausePostDefault handles this case with default header values. + +internal server error +*/ +type HintedHandoffPausePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the hinted handoff pause post default response +func (o *HintedHandoffPausePostDefault) Code() int { + return o._statusCode +} + +func (o *HintedHandoffPausePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *HintedHandoffPausePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *HintedHandoffPausePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_schedule_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_schedule_post_parameters.go new file mode 100644 index 0000000000..faf770ff55 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_schedule_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewHintedHandoffSchedulePostParams creates a new HintedHandoffSchedulePostParams object +// with the default values initialized. +func NewHintedHandoffSchedulePostParams() *HintedHandoffSchedulePostParams { + var () + return &HintedHandoffSchedulePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewHintedHandoffSchedulePostParamsWithTimeout creates a new HintedHandoffSchedulePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewHintedHandoffSchedulePostParamsWithTimeout(timeout time.Duration) *HintedHandoffSchedulePostParams { + var () + return &HintedHandoffSchedulePostParams{ + + timeout: timeout, + } +} + +// NewHintedHandoffSchedulePostParamsWithContext creates a new HintedHandoffSchedulePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewHintedHandoffSchedulePostParamsWithContext(ctx context.Context) *HintedHandoffSchedulePostParams { + var () + return &HintedHandoffSchedulePostParams{ + + Context: ctx, + } +} + +// NewHintedHandoffSchedulePostParamsWithHTTPClient creates a new HintedHandoffSchedulePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewHintedHandoffSchedulePostParamsWithHTTPClient(client *http.Client) *HintedHandoffSchedulePostParams { + var () + return &HintedHandoffSchedulePostParams{ + HTTPClient: client, + } +} + +/* +HintedHandoffSchedulePostParams contains all the parameters to send to the API endpoint +for the hinted handoff schedule post operation typically these are written to a http.Request +*/ +type HintedHandoffSchedulePostParams struct { + + /*Host + String rep. of endpoint address + + */ + Host string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the hinted handoff schedule post params +func (o *HintedHandoffSchedulePostParams) WithTimeout(timeout time.Duration) *HintedHandoffSchedulePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the hinted handoff schedule post params +func (o *HintedHandoffSchedulePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the hinted handoff schedule post params +func (o *HintedHandoffSchedulePostParams) WithContext(ctx context.Context) *HintedHandoffSchedulePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the hinted handoff schedule post params +func (o *HintedHandoffSchedulePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the hinted handoff schedule post params +func (o *HintedHandoffSchedulePostParams) WithHTTPClient(client *http.Client) *HintedHandoffSchedulePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the hinted handoff schedule post params +func (o *HintedHandoffSchedulePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithHost adds the host to the hinted handoff schedule post params +func (o *HintedHandoffSchedulePostParams) WithHost(host string) *HintedHandoffSchedulePostParams { + o.SetHost(host) + return o +} + +// SetHost adds the host to the hinted handoff schedule post params +func (o *HintedHandoffSchedulePostParams) SetHost(host string) { + o.Host = host +} + +// WriteToRequest writes these params to a swagger request +func (o *HintedHandoffSchedulePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param host + qrHost := o.Host + qHost := qrHost + if qHost != "" { + if err := r.SetQueryParam("host", qHost); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_schedule_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_schedule_post_responses.go new file mode 100644 index 0000000000..bf04e97d60 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/hinted_handoff_schedule_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// HintedHandoffSchedulePostReader is a Reader for the HintedHandoffSchedulePost structure. +type HintedHandoffSchedulePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *HintedHandoffSchedulePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewHintedHandoffSchedulePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewHintedHandoffSchedulePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewHintedHandoffSchedulePostOK creates a HintedHandoffSchedulePostOK with default headers values +func NewHintedHandoffSchedulePostOK() *HintedHandoffSchedulePostOK { + return &HintedHandoffSchedulePostOK{} +} + +/* +HintedHandoffSchedulePostOK handles this case with default header values. + +Success +*/ +type HintedHandoffSchedulePostOK struct { +} + +func (o *HintedHandoffSchedulePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewHintedHandoffSchedulePostDefault creates a HintedHandoffSchedulePostDefault with default headers values +func NewHintedHandoffSchedulePostDefault(code int) *HintedHandoffSchedulePostDefault { + return &HintedHandoffSchedulePostDefault{ + _statusCode: code, + } +} + +/* +HintedHandoffSchedulePostDefault handles this case with default header values. + +internal server error +*/ +type HintedHandoffSchedulePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the hinted handoff schedule post default response +func (o *HintedHandoffSchedulePostDefault) Code() int { + return o._statusCode +} + +func (o *HintedHandoffSchedulePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *HintedHandoffSchedulePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *HintedHandoffSchedulePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/lsa_compact_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/lsa_compact_post_parameters.go new file mode 100644 index 0000000000..8388b51b96 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/lsa_compact_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewLsaCompactPostParams creates a new LsaCompactPostParams object +// with the default values initialized. +func NewLsaCompactPostParams() *LsaCompactPostParams { + + return &LsaCompactPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewLsaCompactPostParamsWithTimeout creates a new LsaCompactPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewLsaCompactPostParamsWithTimeout(timeout time.Duration) *LsaCompactPostParams { + + return &LsaCompactPostParams{ + + timeout: timeout, + } +} + +// NewLsaCompactPostParamsWithContext creates a new LsaCompactPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewLsaCompactPostParamsWithContext(ctx context.Context) *LsaCompactPostParams { + + return &LsaCompactPostParams{ + + Context: ctx, + } +} + +// NewLsaCompactPostParamsWithHTTPClient creates a new LsaCompactPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewLsaCompactPostParamsWithHTTPClient(client *http.Client) *LsaCompactPostParams { + + return &LsaCompactPostParams{ + HTTPClient: client, + } +} + +/* +LsaCompactPostParams contains all the parameters to send to the API endpoint +for the lsa compact post operation typically these are written to a http.Request +*/ +type LsaCompactPostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the lsa compact post params +func (o *LsaCompactPostParams) WithTimeout(timeout time.Duration) *LsaCompactPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the lsa compact post params +func (o *LsaCompactPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the lsa compact post params +func (o *LsaCompactPostParams) WithContext(ctx context.Context) *LsaCompactPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the lsa compact post params +func (o *LsaCompactPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the lsa compact post params +func (o *LsaCompactPostParams) WithHTTPClient(client *http.Client) *LsaCompactPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the lsa compact post params +func (o *LsaCompactPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *LsaCompactPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/lsa_compact_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/lsa_compact_post_responses.go new file mode 100644 index 0000000000..8b48d65bdc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/lsa_compact_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// LsaCompactPostReader is a Reader for the LsaCompactPost structure. +type LsaCompactPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *LsaCompactPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewLsaCompactPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewLsaCompactPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewLsaCompactPostOK creates a LsaCompactPostOK with default headers values +func NewLsaCompactPostOK() *LsaCompactPostOK { + return &LsaCompactPostOK{} +} + +/* +LsaCompactPostOK handles this case with default header values. + +Success +*/ +type LsaCompactPostOK struct { +} + +func (o *LsaCompactPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewLsaCompactPostDefault creates a LsaCompactPostDefault with default headers values +func NewLsaCompactPostDefault(code int) *LsaCompactPostDefault { + return &LsaCompactPostDefault{ + _statusCode: code, + } +} + +/* +LsaCompactPostDefault handles this case with default header values. + +internal server error +*/ +type LsaCompactPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the lsa compact post default response +func (o *LsaCompactPostDefault) Code() int { + return o._statusCode +} + +func (o *LsaCompactPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *LsaCompactPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *LsaCompactPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_dropped_by_ver_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_dropped_by_ver_get_parameters.go new file mode 100644 index 0000000000..4b18dfb114 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_dropped_by_ver_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMessagingServiceMessagesDroppedByVerGetParams creates a new MessagingServiceMessagesDroppedByVerGetParams object +// with the default values initialized. +func NewMessagingServiceMessagesDroppedByVerGetParams() *MessagingServiceMessagesDroppedByVerGetParams { + + return &MessagingServiceMessagesDroppedByVerGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewMessagingServiceMessagesDroppedByVerGetParamsWithTimeout creates a new MessagingServiceMessagesDroppedByVerGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewMessagingServiceMessagesDroppedByVerGetParamsWithTimeout(timeout time.Duration) *MessagingServiceMessagesDroppedByVerGetParams { + + return &MessagingServiceMessagesDroppedByVerGetParams{ + + timeout: timeout, + } +} + +// NewMessagingServiceMessagesDroppedByVerGetParamsWithContext creates a new MessagingServiceMessagesDroppedByVerGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewMessagingServiceMessagesDroppedByVerGetParamsWithContext(ctx context.Context) *MessagingServiceMessagesDroppedByVerGetParams { + + return &MessagingServiceMessagesDroppedByVerGetParams{ + + Context: ctx, + } +} + +// NewMessagingServiceMessagesDroppedByVerGetParamsWithHTTPClient creates a new MessagingServiceMessagesDroppedByVerGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewMessagingServiceMessagesDroppedByVerGetParamsWithHTTPClient(client *http.Client) *MessagingServiceMessagesDroppedByVerGetParams { + + return &MessagingServiceMessagesDroppedByVerGetParams{ + HTTPClient: client, + } +} + +/* +MessagingServiceMessagesDroppedByVerGetParams contains all the parameters to send to the API endpoint +for the messaging service messages dropped by ver get operation typically these are written to a http.Request +*/ +type MessagingServiceMessagesDroppedByVerGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the messaging service messages dropped by ver get params +func (o *MessagingServiceMessagesDroppedByVerGetParams) WithTimeout(timeout time.Duration) *MessagingServiceMessagesDroppedByVerGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the messaging service messages dropped by ver get params +func (o *MessagingServiceMessagesDroppedByVerGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the messaging service messages dropped by ver get params +func (o *MessagingServiceMessagesDroppedByVerGetParams) WithContext(ctx context.Context) *MessagingServiceMessagesDroppedByVerGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the messaging service messages dropped by ver get params +func (o *MessagingServiceMessagesDroppedByVerGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the messaging service messages dropped by ver get params +func (o *MessagingServiceMessagesDroppedByVerGetParams) WithHTTPClient(client *http.Client) *MessagingServiceMessagesDroppedByVerGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the messaging service messages dropped by ver get params +func (o *MessagingServiceMessagesDroppedByVerGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *MessagingServiceMessagesDroppedByVerGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_dropped_by_ver_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_dropped_by_ver_get_responses.go new file mode 100644 index 0000000000..38b22c332b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_dropped_by_ver_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// MessagingServiceMessagesDroppedByVerGetReader is a Reader for the MessagingServiceMessagesDroppedByVerGet structure. +type MessagingServiceMessagesDroppedByVerGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MessagingServiceMessagesDroppedByVerGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMessagingServiceMessagesDroppedByVerGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewMessagingServiceMessagesDroppedByVerGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewMessagingServiceMessagesDroppedByVerGetOK creates a MessagingServiceMessagesDroppedByVerGetOK with default headers values +func NewMessagingServiceMessagesDroppedByVerGetOK() *MessagingServiceMessagesDroppedByVerGetOK { + return &MessagingServiceMessagesDroppedByVerGetOK{} +} + +/* +MessagingServiceMessagesDroppedByVerGetOK handles this case with default header values. + +Success +*/ +type MessagingServiceMessagesDroppedByVerGetOK struct { + Payload []*models.VerbCounter +} + +func (o *MessagingServiceMessagesDroppedByVerGetOK) GetPayload() []*models.VerbCounter { + return o.Payload +} + +func (o *MessagingServiceMessagesDroppedByVerGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMessagingServiceMessagesDroppedByVerGetDefault creates a MessagingServiceMessagesDroppedByVerGetDefault with default headers values +func NewMessagingServiceMessagesDroppedByVerGetDefault(code int) *MessagingServiceMessagesDroppedByVerGetDefault { + return &MessagingServiceMessagesDroppedByVerGetDefault{ + _statusCode: code, + } +} + +/* +MessagingServiceMessagesDroppedByVerGetDefault handles this case with default header values. + +internal server error +*/ +type MessagingServiceMessagesDroppedByVerGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the messaging service messages dropped by ver get default response +func (o *MessagingServiceMessagesDroppedByVerGetDefault) Code() int { + return o._statusCode +} + +func (o *MessagingServiceMessagesDroppedByVerGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *MessagingServiceMessagesDroppedByVerGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *MessagingServiceMessagesDroppedByVerGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_dropped_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_dropped_get_parameters.go new file mode 100644 index 0000000000..4fe7283252 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_dropped_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMessagingServiceMessagesDroppedGetParams creates a new MessagingServiceMessagesDroppedGetParams object +// with the default values initialized. +func NewMessagingServiceMessagesDroppedGetParams() *MessagingServiceMessagesDroppedGetParams { + + return &MessagingServiceMessagesDroppedGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewMessagingServiceMessagesDroppedGetParamsWithTimeout creates a new MessagingServiceMessagesDroppedGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewMessagingServiceMessagesDroppedGetParamsWithTimeout(timeout time.Duration) *MessagingServiceMessagesDroppedGetParams { + + return &MessagingServiceMessagesDroppedGetParams{ + + timeout: timeout, + } +} + +// NewMessagingServiceMessagesDroppedGetParamsWithContext creates a new MessagingServiceMessagesDroppedGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewMessagingServiceMessagesDroppedGetParamsWithContext(ctx context.Context) *MessagingServiceMessagesDroppedGetParams { + + return &MessagingServiceMessagesDroppedGetParams{ + + Context: ctx, + } +} + +// NewMessagingServiceMessagesDroppedGetParamsWithHTTPClient creates a new MessagingServiceMessagesDroppedGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewMessagingServiceMessagesDroppedGetParamsWithHTTPClient(client *http.Client) *MessagingServiceMessagesDroppedGetParams { + + return &MessagingServiceMessagesDroppedGetParams{ + HTTPClient: client, + } +} + +/* +MessagingServiceMessagesDroppedGetParams contains all the parameters to send to the API endpoint +for the messaging service messages dropped get operation typically these are written to a http.Request +*/ +type MessagingServiceMessagesDroppedGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the messaging service messages dropped get params +func (o *MessagingServiceMessagesDroppedGetParams) WithTimeout(timeout time.Duration) *MessagingServiceMessagesDroppedGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the messaging service messages dropped get params +func (o *MessagingServiceMessagesDroppedGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the messaging service messages dropped get params +func (o *MessagingServiceMessagesDroppedGetParams) WithContext(ctx context.Context) *MessagingServiceMessagesDroppedGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the messaging service messages dropped get params +func (o *MessagingServiceMessagesDroppedGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the messaging service messages dropped get params +func (o *MessagingServiceMessagesDroppedGetParams) WithHTTPClient(client *http.Client) *MessagingServiceMessagesDroppedGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the messaging service messages dropped get params +func (o *MessagingServiceMessagesDroppedGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *MessagingServiceMessagesDroppedGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_dropped_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_dropped_get_responses.go new file mode 100644 index 0000000000..35f97b05dc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_dropped_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// MessagingServiceMessagesDroppedGetReader is a Reader for the MessagingServiceMessagesDroppedGet structure. +type MessagingServiceMessagesDroppedGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MessagingServiceMessagesDroppedGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMessagingServiceMessagesDroppedGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewMessagingServiceMessagesDroppedGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewMessagingServiceMessagesDroppedGetOK creates a MessagingServiceMessagesDroppedGetOK with default headers values +func NewMessagingServiceMessagesDroppedGetOK() *MessagingServiceMessagesDroppedGetOK { + return &MessagingServiceMessagesDroppedGetOK{} +} + +/* +MessagingServiceMessagesDroppedGetOK handles this case with default header values. + +Success +*/ +type MessagingServiceMessagesDroppedGetOK struct { + Payload []*models.MessageCounter +} + +func (o *MessagingServiceMessagesDroppedGetOK) GetPayload() []*models.MessageCounter { + return o.Payload +} + +func (o *MessagingServiceMessagesDroppedGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMessagingServiceMessagesDroppedGetDefault creates a MessagingServiceMessagesDroppedGetDefault with default headers values +func NewMessagingServiceMessagesDroppedGetDefault(code int) *MessagingServiceMessagesDroppedGetDefault { + return &MessagingServiceMessagesDroppedGetDefault{ + _statusCode: code, + } +} + +/* +MessagingServiceMessagesDroppedGetDefault handles this case with default header values. + +internal server error +*/ +type MessagingServiceMessagesDroppedGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the messaging service messages dropped get default response +func (o *MessagingServiceMessagesDroppedGetDefault) Code() int { + return o._statusCode +} + +func (o *MessagingServiceMessagesDroppedGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *MessagingServiceMessagesDroppedGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *MessagingServiceMessagesDroppedGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_exception_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_exception_get_parameters.go new file mode 100644 index 0000000000..5c59ac986e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_exception_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMessagingServiceMessagesExceptionGetParams creates a new MessagingServiceMessagesExceptionGetParams object +// with the default values initialized. +func NewMessagingServiceMessagesExceptionGetParams() *MessagingServiceMessagesExceptionGetParams { + + return &MessagingServiceMessagesExceptionGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewMessagingServiceMessagesExceptionGetParamsWithTimeout creates a new MessagingServiceMessagesExceptionGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewMessagingServiceMessagesExceptionGetParamsWithTimeout(timeout time.Duration) *MessagingServiceMessagesExceptionGetParams { + + return &MessagingServiceMessagesExceptionGetParams{ + + timeout: timeout, + } +} + +// NewMessagingServiceMessagesExceptionGetParamsWithContext creates a new MessagingServiceMessagesExceptionGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewMessagingServiceMessagesExceptionGetParamsWithContext(ctx context.Context) *MessagingServiceMessagesExceptionGetParams { + + return &MessagingServiceMessagesExceptionGetParams{ + + Context: ctx, + } +} + +// NewMessagingServiceMessagesExceptionGetParamsWithHTTPClient creates a new MessagingServiceMessagesExceptionGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewMessagingServiceMessagesExceptionGetParamsWithHTTPClient(client *http.Client) *MessagingServiceMessagesExceptionGetParams { + + return &MessagingServiceMessagesExceptionGetParams{ + HTTPClient: client, + } +} + +/* +MessagingServiceMessagesExceptionGetParams contains all the parameters to send to the API endpoint +for the messaging service messages exception get operation typically these are written to a http.Request +*/ +type MessagingServiceMessagesExceptionGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the messaging service messages exception get params +func (o *MessagingServiceMessagesExceptionGetParams) WithTimeout(timeout time.Duration) *MessagingServiceMessagesExceptionGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the messaging service messages exception get params +func (o *MessagingServiceMessagesExceptionGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the messaging service messages exception get params +func (o *MessagingServiceMessagesExceptionGetParams) WithContext(ctx context.Context) *MessagingServiceMessagesExceptionGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the messaging service messages exception get params +func (o *MessagingServiceMessagesExceptionGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the messaging service messages exception get params +func (o *MessagingServiceMessagesExceptionGetParams) WithHTTPClient(client *http.Client) *MessagingServiceMessagesExceptionGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the messaging service messages exception get params +func (o *MessagingServiceMessagesExceptionGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *MessagingServiceMessagesExceptionGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_exception_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_exception_get_responses.go new file mode 100644 index 0000000000..3338be820b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_exception_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// MessagingServiceMessagesExceptionGetReader is a Reader for the MessagingServiceMessagesExceptionGet structure. +type MessagingServiceMessagesExceptionGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MessagingServiceMessagesExceptionGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMessagingServiceMessagesExceptionGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewMessagingServiceMessagesExceptionGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewMessagingServiceMessagesExceptionGetOK creates a MessagingServiceMessagesExceptionGetOK with default headers values +func NewMessagingServiceMessagesExceptionGetOK() *MessagingServiceMessagesExceptionGetOK { + return &MessagingServiceMessagesExceptionGetOK{} +} + +/* +MessagingServiceMessagesExceptionGetOK handles this case with default header values. + +Success +*/ +type MessagingServiceMessagesExceptionGetOK struct { + Payload []*models.MessageCounter +} + +func (o *MessagingServiceMessagesExceptionGetOK) GetPayload() []*models.MessageCounter { + return o.Payload +} + +func (o *MessagingServiceMessagesExceptionGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMessagingServiceMessagesExceptionGetDefault creates a MessagingServiceMessagesExceptionGetDefault with default headers values +func NewMessagingServiceMessagesExceptionGetDefault(code int) *MessagingServiceMessagesExceptionGetDefault { + return &MessagingServiceMessagesExceptionGetDefault{ + _statusCode: code, + } +} + +/* +MessagingServiceMessagesExceptionGetDefault handles this case with default header values. + +internal server error +*/ +type MessagingServiceMessagesExceptionGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the messaging service messages exception get default response +func (o *MessagingServiceMessagesExceptionGetDefault) Code() int { + return o._statusCode +} + +func (o *MessagingServiceMessagesExceptionGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *MessagingServiceMessagesExceptionGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *MessagingServiceMessagesExceptionGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_pending_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_pending_get_parameters.go new file mode 100644 index 0000000000..8607e73da2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_pending_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMessagingServiceMessagesPendingGetParams creates a new MessagingServiceMessagesPendingGetParams object +// with the default values initialized. +func NewMessagingServiceMessagesPendingGetParams() *MessagingServiceMessagesPendingGetParams { + + return &MessagingServiceMessagesPendingGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewMessagingServiceMessagesPendingGetParamsWithTimeout creates a new MessagingServiceMessagesPendingGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewMessagingServiceMessagesPendingGetParamsWithTimeout(timeout time.Duration) *MessagingServiceMessagesPendingGetParams { + + return &MessagingServiceMessagesPendingGetParams{ + + timeout: timeout, + } +} + +// NewMessagingServiceMessagesPendingGetParamsWithContext creates a new MessagingServiceMessagesPendingGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewMessagingServiceMessagesPendingGetParamsWithContext(ctx context.Context) *MessagingServiceMessagesPendingGetParams { + + return &MessagingServiceMessagesPendingGetParams{ + + Context: ctx, + } +} + +// NewMessagingServiceMessagesPendingGetParamsWithHTTPClient creates a new MessagingServiceMessagesPendingGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewMessagingServiceMessagesPendingGetParamsWithHTTPClient(client *http.Client) *MessagingServiceMessagesPendingGetParams { + + return &MessagingServiceMessagesPendingGetParams{ + HTTPClient: client, + } +} + +/* +MessagingServiceMessagesPendingGetParams contains all the parameters to send to the API endpoint +for the messaging service messages pending get operation typically these are written to a http.Request +*/ +type MessagingServiceMessagesPendingGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the messaging service messages pending get params +func (o *MessagingServiceMessagesPendingGetParams) WithTimeout(timeout time.Duration) *MessagingServiceMessagesPendingGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the messaging service messages pending get params +func (o *MessagingServiceMessagesPendingGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the messaging service messages pending get params +func (o *MessagingServiceMessagesPendingGetParams) WithContext(ctx context.Context) *MessagingServiceMessagesPendingGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the messaging service messages pending get params +func (o *MessagingServiceMessagesPendingGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the messaging service messages pending get params +func (o *MessagingServiceMessagesPendingGetParams) WithHTTPClient(client *http.Client) *MessagingServiceMessagesPendingGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the messaging service messages pending get params +func (o *MessagingServiceMessagesPendingGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *MessagingServiceMessagesPendingGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_pending_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_pending_get_responses.go new file mode 100644 index 0000000000..cbcd5cae0d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_pending_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// MessagingServiceMessagesPendingGetReader is a Reader for the MessagingServiceMessagesPendingGet structure. +type MessagingServiceMessagesPendingGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MessagingServiceMessagesPendingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMessagingServiceMessagesPendingGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewMessagingServiceMessagesPendingGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewMessagingServiceMessagesPendingGetOK creates a MessagingServiceMessagesPendingGetOK with default headers values +func NewMessagingServiceMessagesPendingGetOK() *MessagingServiceMessagesPendingGetOK { + return &MessagingServiceMessagesPendingGetOK{} +} + +/* +MessagingServiceMessagesPendingGetOK handles this case with default header values. + +Success +*/ +type MessagingServiceMessagesPendingGetOK struct { + Payload []*models.MessageCounter +} + +func (o *MessagingServiceMessagesPendingGetOK) GetPayload() []*models.MessageCounter { + return o.Payload +} + +func (o *MessagingServiceMessagesPendingGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMessagingServiceMessagesPendingGetDefault creates a MessagingServiceMessagesPendingGetDefault with default headers values +func NewMessagingServiceMessagesPendingGetDefault(code int) *MessagingServiceMessagesPendingGetDefault { + return &MessagingServiceMessagesPendingGetDefault{ + _statusCode: code, + } +} + +/* +MessagingServiceMessagesPendingGetDefault handles this case with default header values. + +internal server error +*/ +type MessagingServiceMessagesPendingGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the messaging service messages pending get default response +func (o *MessagingServiceMessagesPendingGetDefault) Code() int { + return o._statusCode +} + +func (o *MessagingServiceMessagesPendingGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *MessagingServiceMessagesPendingGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *MessagingServiceMessagesPendingGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_replied_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_replied_get_parameters.go new file mode 100644 index 0000000000..7212e47417 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_replied_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMessagingServiceMessagesRepliedGetParams creates a new MessagingServiceMessagesRepliedGetParams object +// with the default values initialized. +func NewMessagingServiceMessagesRepliedGetParams() *MessagingServiceMessagesRepliedGetParams { + + return &MessagingServiceMessagesRepliedGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewMessagingServiceMessagesRepliedGetParamsWithTimeout creates a new MessagingServiceMessagesRepliedGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewMessagingServiceMessagesRepliedGetParamsWithTimeout(timeout time.Duration) *MessagingServiceMessagesRepliedGetParams { + + return &MessagingServiceMessagesRepliedGetParams{ + + timeout: timeout, + } +} + +// NewMessagingServiceMessagesRepliedGetParamsWithContext creates a new MessagingServiceMessagesRepliedGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewMessagingServiceMessagesRepliedGetParamsWithContext(ctx context.Context) *MessagingServiceMessagesRepliedGetParams { + + return &MessagingServiceMessagesRepliedGetParams{ + + Context: ctx, + } +} + +// NewMessagingServiceMessagesRepliedGetParamsWithHTTPClient creates a new MessagingServiceMessagesRepliedGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewMessagingServiceMessagesRepliedGetParamsWithHTTPClient(client *http.Client) *MessagingServiceMessagesRepliedGetParams { + + return &MessagingServiceMessagesRepliedGetParams{ + HTTPClient: client, + } +} + +/* +MessagingServiceMessagesRepliedGetParams contains all the parameters to send to the API endpoint +for the messaging service messages replied get operation typically these are written to a http.Request +*/ +type MessagingServiceMessagesRepliedGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the messaging service messages replied get params +func (o *MessagingServiceMessagesRepliedGetParams) WithTimeout(timeout time.Duration) *MessagingServiceMessagesRepliedGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the messaging service messages replied get params +func (o *MessagingServiceMessagesRepliedGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the messaging service messages replied get params +func (o *MessagingServiceMessagesRepliedGetParams) WithContext(ctx context.Context) *MessagingServiceMessagesRepliedGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the messaging service messages replied get params +func (o *MessagingServiceMessagesRepliedGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the messaging service messages replied get params +func (o *MessagingServiceMessagesRepliedGetParams) WithHTTPClient(client *http.Client) *MessagingServiceMessagesRepliedGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the messaging service messages replied get params +func (o *MessagingServiceMessagesRepliedGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *MessagingServiceMessagesRepliedGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_replied_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_replied_get_responses.go new file mode 100644 index 0000000000..b028987d9a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_replied_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// MessagingServiceMessagesRepliedGetReader is a Reader for the MessagingServiceMessagesRepliedGet structure. +type MessagingServiceMessagesRepliedGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MessagingServiceMessagesRepliedGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMessagingServiceMessagesRepliedGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewMessagingServiceMessagesRepliedGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewMessagingServiceMessagesRepliedGetOK creates a MessagingServiceMessagesRepliedGetOK with default headers values +func NewMessagingServiceMessagesRepliedGetOK() *MessagingServiceMessagesRepliedGetOK { + return &MessagingServiceMessagesRepliedGetOK{} +} + +/* +MessagingServiceMessagesRepliedGetOK handles this case with default header values. + +Success +*/ +type MessagingServiceMessagesRepliedGetOK struct { + Payload []*models.MessageCounter +} + +func (o *MessagingServiceMessagesRepliedGetOK) GetPayload() []*models.MessageCounter { + return o.Payload +} + +func (o *MessagingServiceMessagesRepliedGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMessagingServiceMessagesRepliedGetDefault creates a MessagingServiceMessagesRepliedGetDefault with default headers values +func NewMessagingServiceMessagesRepliedGetDefault(code int) *MessagingServiceMessagesRepliedGetDefault { + return &MessagingServiceMessagesRepliedGetDefault{ + _statusCode: code, + } +} + +/* +MessagingServiceMessagesRepliedGetDefault handles this case with default header values. + +internal server error +*/ +type MessagingServiceMessagesRepliedGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the messaging service messages replied get default response +func (o *MessagingServiceMessagesRepliedGetDefault) Code() int { + return o._statusCode +} + +func (o *MessagingServiceMessagesRepliedGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *MessagingServiceMessagesRepliedGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *MessagingServiceMessagesRepliedGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_respond_completed_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_respond_completed_get_parameters.go new file mode 100644 index 0000000000..9c0d4231b0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_respond_completed_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMessagingServiceMessagesRespondCompletedGetParams creates a new MessagingServiceMessagesRespondCompletedGetParams object +// with the default values initialized. +func NewMessagingServiceMessagesRespondCompletedGetParams() *MessagingServiceMessagesRespondCompletedGetParams { + + return &MessagingServiceMessagesRespondCompletedGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewMessagingServiceMessagesRespondCompletedGetParamsWithTimeout creates a new MessagingServiceMessagesRespondCompletedGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewMessagingServiceMessagesRespondCompletedGetParamsWithTimeout(timeout time.Duration) *MessagingServiceMessagesRespondCompletedGetParams { + + return &MessagingServiceMessagesRespondCompletedGetParams{ + + timeout: timeout, + } +} + +// NewMessagingServiceMessagesRespondCompletedGetParamsWithContext creates a new MessagingServiceMessagesRespondCompletedGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewMessagingServiceMessagesRespondCompletedGetParamsWithContext(ctx context.Context) *MessagingServiceMessagesRespondCompletedGetParams { + + return &MessagingServiceMessagesRespondCompletedGetParams{ + + Context: ctx, + } +} + +// NewMessagingServiceMessagesRespondCompletedGetParamsWithHTTPClient creates a new MessagingServiceMessagesRespondCompletedGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewMessagingServiceMessagesRespondCompletedGetParamsWithHTTPClient(client *http.Client) *MessagingServiceMessagesRespondCompletedGetParams { + + return &MessagingServiceMessagesRespondCompletedGetParams{ + HTTPClient: client, + } +} + +/* +MessagingServiceMessagesRespondCompletedGetParams contains all the parameters to send to the API endpoint +for the messaging service messages respond completed get operation typically these are written to a http.Request +*/ +type MessagingServiceMessagesRespondCompletedGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the messaging service messages respond completed get params +func (o *MessagingServiceMessagesRespondCompletedGetParams) WithTimeout(timeout time.Duration) *MessagingServiceMessagesRespondCompletedGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the messaging service messages respond completed get params +func (o *MessagingServiceMessagesRespondCompletedGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the messaging service messages respond completed get params +func (o *MessagingServiceMessagesRespondCompletedGetParams) WithContext(ctx context.Context) *MessagingServiceMessagesRespondCompletedGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the messaging service messages respond completed get params +func (o *MessagingServiceMessagesRespondCompletedGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the messaging service messages respond completed get params +func (o *MessagingServiceMessagesRespondCompletedGetParams) WithHTTPClient(client *http.Client) *MessagingServiceMessagesRespondCompletedGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the messaging service messages respond completed get params +func (o *MessagingServiceMessagesRespondCompletedGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *MessagingServiceMessagesRespondCompletedGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_respond_completed_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_respond_completed_get_responses.go new file mode 100644 index 0000000000..68f1374756 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_respond_completed_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// MessagingServiceMessagesRespondCompletedGetReader is a Reader for the MessagingServiceMessagesRespondCompletedGet structure. +type MessagingServiceMessagesRespondCompletedGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MessagingServiceMessagesRespondCompletedGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMessagingServiceMessagesRespondCompletedGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewMessagingServiceMessagesRespondCompletedGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewMessagingServiceMessagesRespondCompletedGetOK creates a MessagingServiceMessagesRespondCompletedGetOK with default headers values +func NewMessagingServiceMessagesRespondCompletedGetOK() *MessagingServiceMessagesRespondCompletedGetOK { + return &MessagingServiceMessagesRespondCompletedGetOK{} +} + +/* +MessagingServiceMessagesRespondCompletedGetOK handles this case with default header values. + +Success +*/ +type MessagingServiceMessagesRespondCompletedGetOK struct { + Payload []*models.MessageCounter +} + +func (o *MessagingServiceMessagesRespondCompletedGetOK) GetPayload() []*models.MessageCounter { + return o.Payload +} + +func (o *MessagingServiceMessagesRespondCompletedGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMessagingServiceMessagesRespondCompletedGetDefault creates a MessagingServiceMessagesRespondCompletedGetDefault with default headers values +func NewMessagingServiceMessagesRespondCompletedGetDefault(code int) *MessagingServiceMessagesRespondCompletedGetDefault { + return &MessagingServiceMessagesRespondCompletedGetDefault{ + _statusCode: code, + } +} + +/* +MessagingServiceMessagesRespondCompletedGetDefault handles this case with default header values. + +internal server error +*/ +type MessagingServiceMessagesRespondCompletedGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the messaging service messages respond completed get default response +func (o *MessagingServiceMessagesRespondCompletedGetDefault) Code() int { + return o._statusCode +} + +func (o *MessagingServiceMessagesRespondCompletedGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *MessagingServiceMessagesRespondCompletedGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *MessagingServiceMessagesRespondCompletedGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_respond_pending_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_respond_pending_get_parameters.go new file mode 100644 index 0000000000..f8d8512484 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_respond_pending_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMessagingServiceMessagesRespondPendingGetParams creates a new MessagingServiceMessagesRespondPendingGetParams object +// with the default values initialized. +func NewMessagingServiceMessagesRespondPendingGetParams() *MessagingServiceMessagesRespondPendingGetParams { + + return &MessagingServiceMessagesRespondPendingGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewMessagingServiceMessagesRespondPendingGetParamsWithTimeout creates a new MessagingServiceMessagesRespondPendingGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewMessagingServiceMessagesRespondPendingGetParamsWithTimeout(timeout time.Duration) *MessagingServiceMessagesRespondPendingGetParams { + + return &MessagingServiceMessagesRespondPendingGetParams{ + + timeout: timeout, + } +} + +// NewMessagingServiceMessagesRespondPendingGetParamsWithContext creates a new MessagingServiceMessagesRespondPendingGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewMessagingServiceMessagesRespondPendingGetParamsWithContext(ctx context.Context) *MessagingServiceMessagesRespondPendingGetParams { + + return &MessagingServiceMessagesRespondPendingGetParams{ + + Context: ctx, + } +} + +// NewMessagingServiceMessagesRespondPendingGetParamsWithHTTPClient creates a new MessagingServiceMessagesRespondPendingGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewMessagingServiceMessagesRespondPendingGetParamsWithHTTPClient(client *http.Client) *MessagingServiceMessagesRespondPendingGetParams { + + return &MessagingServiceMessagesRespondPendingGetParams{ + HTTPClient: client, + } +} + +/* +MessagingServiceMessagesRespondPendingGetParams contains all the parameters to send to the API endpoint +for the messaging service messages respond pending get operation typically these are written to a http.Request +*/ +type MessagingServiceMessagesRespondPendingGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the messaging service messages respond pending get params +func (o *MessagingServiceMessagesRespondPendingGetParams) WithTimeout(timeout time.Duration) *MessagingServiceMessagesRespondPendingGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the messaging service messages respond pending get params +func (o *MessagingServiceMessagesRespondPendingGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the messaging service messages respond pending get params +func (o *MessagingServiceMessagesRespondPendingGetParams) WithContext(ctx context.Context) *MessagingServiceMessagesRespondPendingGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the messaging service messages respond pending get params +func (o *MessagingServiceMessagesRespondPendingGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the messaging service messages respond pending get params +func (o *MessagingServiceMessagesRespondPendingGetParams) WithHTTPClient(client *http.Client) *MessagingServiceMessagesRespondPendingGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the messaging service messages respond pending get params +func (o *MessagingServiceMessagesRespondPendingGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *MessagingServiceMessagesRespondPendingGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_respond_pending_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_respond_pending_get_responses.go new file mode 100644 index 0000000000..8ad1fcfc83 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_respond_pending_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// MessagingServiceMessagesRespondPendingGetReader is a Reader for the MessagingServiceMessagesRespondPendingGet structure. +type MessagingServiceMessagesRespondPendingGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MessagingServiceMessagesRespondPendingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMessagingServiceMessagesRespondPendingGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewMessagingServiceMessagesRespondPendingGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewMessagingServiceMessagesRespondPendingGetOK creates a MessagingServiceMessagesRespondPendingGetOK with default headers values +func NewMessagingServiceMessagesRespondPendingGetOK() *MessagingServiceMessagesRespondPendingGetOK { + return &MessagingServiceMessagesRespondPendingGetOK{} +} + +/* +MessagingServiceMessagesRespondPendingGetOK handles this case with default header values. + +Success +*/ +type MessagingServiceMessagesRespondPendingGetOK struct { + Payload []*models.MessageCounter +} + +func (o *MessagingServiceMessagesRespondPendingGetOK) GetPayload() []*models.MessageCounter { + return o.Payload +} + +func (o *MessagingServiceMessagesRespondPendingGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMessagingServiceMessagesRespondPendingGetDefault creates a MessagingServiceMessagesRespondPendingGetDefault with default headers values +func NewMessagingServiceMessagesRespondPendingGetDefault(code int) *MessagingServiceMessagesRespondPendingGetDefault { + return &MessagingServiceMessagesRespondPendingGetDefault{ + _statusCode: code, + } +} + +/* +MessagingServiceMessagesRespondPendingGetDefault handles this case with default header values. + +internal server error +*/ +type MessagingServiceMessagesRespondPendingGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the messaging service messages respond pending get default response +func (o *MessagingServiceMessagesRespondPendingGetDefault) Code() int { + return o._statusCode +} + +func (o *MessagingServiceMessagesRespondPendingGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *MessagingServiceMessagesRespondPendingGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *MessagingServiceMessagesRespondPendingGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_sent_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_sent_get_parameters.go new file mode 100644 index 0000000000..7691e84b0c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_sent_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMessagingServiceMessagesSentGetParams creates a new MessagingServiceMessagesSentGetParams object +// with the default values initialized. +func NewMessagingServiceMessagesSentGetParams() *MessagingServiceMessagesSentGetParams { + + return &MessagingServiceMessagesSentGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewMessagingServiceMessagesSentGetParamsWithTimeout creates a new MessagingServiceMessagesSentGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewMessagingServiceMessagesSentGetParamsWithTimeout(timeout time.Duration) *MessagingServiceMessagesSentGetParams { + + return &MessagingServiceMessagesSentGetParams{ + + timeout: timeout, + } +} + +// NewMessagingServiceMessagesSentGetParamsWithContext creates a new MessagingServiceMessagesSentGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewMessagingServiceMessagesSentGetParamsWithContext(ctx context.Context) *MessagingServiceMessagesSentGetParams { + + return &MessagingServiceMessagesSentGetParams{ + + Context: ctx, + } +} + +// NewMessagingServiceMessagesSentGetParamsWithHTTPClient creates a new MessagingServiceMessagesSentGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewMessagingServiceMessagesSentGetParamsWithHTTPClient(client *http.Client) *MessagingServiceMessagesSentGetParams { + + return &MessagingServiceMessagesSentGetParams{ + HTTPClient: client, + } +} + +/* +MessagingServiceMessagesSentGetParams contains all the parameters to send to the API endpoint +for the messaging service messages sent get operation typically these are written to a http.Request +*/ +type MessagingServiceMessagesSentGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the messaging service messages sent get params +func (o *MessagingServiceMessagesSentGetParams) WithTimeout(timeout time.Duration) *MessagingServiceMessagesSentGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the messaging service messages sent get params +func (o *MessagingServiceMessagesSentGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the messaging service messages sent get params +func (o *MessagingServiceMessagesSentGetParams) WithContext(ctx context.Context) *MessagingServiceMessagesSentGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the messaging service messages sent get params +func (o *MessagingServiceMessagesSentGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the messaging service messages sent get params +func (o *MessagingServiceMessagesSentGetParams) WithHTTPClient(client *http.Client) *MessagingServiceMessagesSentGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the messaging service messages sent get params +func (o *MessagingServiceMessagesSentGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *MessagingServiceMessagesSentGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_sent_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_sent_get_responses.go new file mode 100644 index 0000000000..bbaaa4807f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_sent_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// MessagingServiceMessagesSentGetReader is a Reader for the MessagingServiceMessagesSentGet structure. +type MessagingServiceMessagesSentGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MessagingServiceMessagesSentGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMessagingServiceMessagesSentGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewMessagingServiceMessagesSentGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewMessagingServiceMessagesSentGetOK creates a MessagingServiceMessagesSentGetOK with default headers values +func NewMessagingServiceMessagesSentGetOK() *MessagingServiceMessagesSentGetOK { + return &MessagingServiceMessagesSentGetOK{} +} + +/* +MessagingServiceMessagesSentGetOK handles this case with default header values. + +Success +*/ +type MessagingServiceMessagesSentGetOK struct { + Payload []*models.MessageCounter +} + +func (o *MessagingServiceMessagesSentGetOK) GetPayload() []*models.MessageCounter { + return o.Payload +} + +func (o *MessagingServiceMessagesSentGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMessagingServiceMessagesSentGetDefault creates a MessagingServiceMessagesSentGetDefault with default headers values +func NewMessagingServiceMessagesSentGetDefault(code int) *MessagingServiceMessagesSentGetDefault { + return &MessagingServiceMessagesSentGetDefault{ + _statusCode: code, + } +} + +/* +MessagingServiceMessagesSentGetDefault handles this case with default header values. + +internal server error +*/ +type MessagingServiceMessagesSentGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the messaging service messages sent get default response +func (o *MessagingServiceMessagesSentGetDefault) Code() int { + return o._statusCode +} + +func (o *MessagingServiceMessagesSentGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *MessagingServiceMessagesSentGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *MessagingServiceMessagesSentGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_timeout_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_timeout_get_parameters.go new file mode 100644 index 0000000000..031ec2aa81 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_timeout_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMessagingServiceMessagesTimeoutGetParams creates a new MessagingServiceMessagesTimeoutGetParams object +// with the default values initialized. +func NewMessagingServiceMessagesTimeoutGetParams() *MessagingServiceMessagesTimeoutGetParams { + + return &MessagingServiceMessagesTimeoutGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewMessagingServiceMessagesTimeoutGetParamsWithTimeout creates a new MessagingServiceMessagesTimeoutGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewMessagingServiceMessagesTimeoutGetParamsWithTimeout(timeout time.Duration) *MessagingServiceMessagesTimeoutGetParams { + + return &MessagingServiceMessagesTimeoutGetParams{ + + timeout: timeout, + } +} + +// NewMessagingServiceMessagesTimeoutGetParamsWithContext creates a new MessagingServiceMessagesTimeoutGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewMessagingServiceMessagesTimeoutGetParamsWithContext(ctx context.Context) *MessagingServiceMessagesTimeoutGetParams { + + return &MessagingServiceMessagesTimeoutGetParams{ + + Context: ctx, + } +} + +// NewMessagingServiceMessagesTimeoutGetParamsWithHTTPClient creates a new MessagingServiceMessagesTimeoutGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewMessagingServiceMessagesTimeoutGetParamsWithHTTPClient(client *http.Client) *MessagingServiceMessagesTimeoutGetParams { + + return &MessagingServiceMessagesTimeoutGetParams{ + HTTPClient: client, + } +} + +/* +MessagingServiceMessagesTimeoutGetParams contains all the parameters to send to the API endpoint +for the messaging service messages timeout get operation typically these are written to a http.Request +*/ +type MessagingServiceMessagesTimeoutGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the messaging service messages timeout get params +func (o *MessagingServiceMessagesTimeoutGetParams) WithTimeout(timeout time.Duration) *MessagingServiceMessagesTimeoutGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the messaging service messages timeout get params +func (o *MessagingServiceMessagesTimeoutGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the messaging service messages timeout get params +func (o *MessagingServiceMessagesTimeoutGetParams) WithContext(ctx context.Context) *MessagingServiceMessagesTimeoutGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the messaging service messages timeout get params +func (o *MessagingServiceMessagesTimeoutGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the messaging service messages timeout get params +func (o *MessagingServiceMessagesTimeoutGetParams) WithHTTPClient(client *http.Client) *MessagingServiceMessagesTimeoutGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the messaging service messages timeout get params +func (o *MessagingServiceMessagesTimeoutGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *MessagingServiceMessagesTimeoutGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_timeout_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_timeout_get_responses.go new file mode 100644 index 0000000000..df6b542640 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_messages_timeout_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// MessagingServiceMessagesTimeoutGetReader is a Reader for the MessagingServiceMessagesTimeoutGet structure. +type MessagingServiceMessagesTimeoutGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MessagingServiceMessagesTimeoutGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMessagingServiceMessagesTimeoutGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewMessagingServiceMessagesTimeoutGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewMessagingServiceMessagesTimeoutGetOK creates a MessagingServiceMessagesTimeoutGetOK with default headers values +func NewMessagingServiceMessagesTimeoutGetOK() *MessagingServiceMessagesTimeoutGetOK { + return &MessagingServiceMessagesTimeoutGetOK{} +} + +/* +MessagingServiceMessagesTimeoutGetOK handles this case with default header values. + +Success +*/ +type MessagingServiceMessagesTimeoutGetOK struct { + Payload []*models.MessageCounter +} + +func (o *MessagingServiceMessagesTimeoutGetOK) GetPayload() []*models.MessageCounter { + return o.Payload +} + +func (o *MessagingServiceMessagesTimeoutGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMessagingServiceMessagesTimeoutGetDefault creates a MessagingServiceMessagesTimeoutGetDefault with default headers values +func NewMessagingServiceMessagesTimeoutGetDefault(code int) *MessagingServiceMessagesTimeoutGetDefault { + return &MessagingServiceMessagesTimeoutGetDefault{ + _statusCode: code, + } +} + +/* +MessagingServiceMessagesTimeoutGetDefault handles this case with default header values. + +internal server error +*/ +type MessagingServiceMessagesTimeoutGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the messaging service messages timeout get default response +func (o *MessagingServiceMessagesTimeoutGetDefault) Code() int { + return o._statusCode +} + +func (o *MessagingServiceMessagesTimeoutGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *MessagingServiceMessagesTimeoutGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *MessagingServiceMessagesTimeoutGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_version_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_version_get_parameters.go new file mode 100644 index 0000000000..1da5af9551 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_version_get_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMessagingServiceVersionGetParams creates a new MessagingServiceVersionGetParams object +// with the default values initialized. +func NewMessagingServiceVersionGetParams() *MessagingServiceVersionGetParams { + var () + return &MessagingServiceVersionGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewMessagingServiceVersionGetParamsWithTimeout creates a new MessagingServiceVersionGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewMessagingServiceVersionGetParamsWithTimeout(timeout time.Duration) *MessagingServiceVersionGetParams { + var () + return &MessagingServiceVersionGetParams{ + + timeout: timeout, + } +} + +// NewMessagingServiceVersionGetParamsWithContext creates a new MessagingServiceVersionGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewMessagingServiceVersionGetParamsWithContext(ctx context.Context) *MessagingServiceVersionGetParams { + var () + return &MessagingServiceVersionGetParams{ + + Context: ctx, + } +} + +// NewMessagingServiceVersionGetParamsWithHTTPClient creates a new MessagingServiceVersionGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewMessagingServiceVersionGetParamsWithHTTPClient(client *http.Client) *MessagingServiceVersionGetParams { + var () + return &MessagingServiceVersionGetParams{ + HTTPClient: client, + } +} + +/* +MessagingServiceVersionGetParams contains all the parameters to send to the API endpoint +for the messaging service version get operation typically these are written to a http.Request +*/ +type MessagingServiceVersionGetParams struct { + + /*Addr + Address + + */ + Addr string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the messaging service version get params +func (o *MessagingServiceVersionGetParams) WithTimeout(timeout time.Duration) *MessagingServiceVersionGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the messaging service version get params +func (o *MessagingServiceVersionGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the messaging service version get params +func (o *MessagingServiceVersionGetParams) WithContext(ctx context.Context) *MessagingServiceVersionGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the messaging service version get params +func (o *MessagingServiceVersionGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the messaging service version get params +func (o *MessagingServiceVersionGetParams) WithHTTPClient(client *http.Client) *MessagingServiceVersionGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the messaging service version get params +func (o *MessagingServiceVersionGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAddr adds the addr to the messaging service version get params +func (o *MessagingServiceVersionGetParams) WithAddr(addr string) *MessagingServiceVersionGetParams { + o.SetAddr(addr) + return o +} + +// SetAddr adds the addr to the messaging service version get params +func (o *MessagingServiceVersionGetParams) SetAddr(addr string) { + o.Addr = addr +} + +// WriteToRequest writes these params to a swagger request +func (o *MessagingServiceVersionGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param addr + qrAddr := o.Addr + qAddr := qrAddr + if qAddr != "" { + if err := r.SetQueryParam("addr", qAddr); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_version_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_version_get_responses.go new file mode 100644 index 0000000000..5cb4d30789 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/messaging_service_version_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// MessagingServiceVersionGetReader is a Reader for the MessagingServiceVersionGet structure. +type MessagingServiceVersionGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MessagingServiceVersionGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMessagingServiceVersionGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewMessagingServiceVersionGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewMessagingServiceVersionGetOK creates a MessagingServiceVersionGetOK with default headers values +func NewMessagingServiceVersionGetOK() *MessagingServiceVersionGetOK { + return &MessagingServiceVersionGetOK{} +} + +/* +MessagingServiceVersionGetOK handles this case with default header values. + +Success +*/ +type MessagingServiceVersionGetOK struct { + Payload int32 +} + +func (o *MessagingServiceVersionGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *MessagingServiceVersionGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMessagingServiceVersionGetDefault creates a MessagingServiceVersionGetDefault with default headers values +func NewMessagingServiceVersionGetDefault(code int) *MessagingServiceVersionGetDefault { + return &MessagingServiceVersionGetDefault{ + _statusCode: code, + } +} + +/* +MessagingServiceVersionGetDefault handles this case with default header values. + +internal server error +*/ +type MessagingServiceVersionGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the messaging service version get default response +func (o *MessagingServiceVersionGetDefault) Code() int { + return o._statusCode +} + +func (o *MessagingServiceVersionGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *MessagingServiceVersionGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *MessagingServiceVersionGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/operations_client.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/operations_client.go new file mode 100644 index 0000000000..0e9a09324d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/operations_client.go @@ -0,0 +1,14750 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new operations API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for operations API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + CacheServiceCounterCacheCapacityPost(params *CacheServiceCounterCacheCapacityPostParams) (*CacheServiceCounterCacheCapacityPostOK, error) + + CacheServiceCounterCacheKeysToSaveGet(params *CacheServiceCounterCacheKeysToSaveGetParams) (*CacheServiceCounterCacheKeysToSaveGetOK, error) + + CacheServiceCounterCacheKeysToSavePost(params *CacheServiceCounterCacheKeysToSavePostParams) (*CacheServiceCounterCacheKeysToSavePostOK, error) + + CacheServiceCounterCacheSavePeriodGet(params *CacheServiceCounterCacheSavePeriodGetParams) (*CacheServiceCounterCacheSavePeriodGetOK, error) + + CacheServiceCounterCacheSavePeriodPost(params *CacheServiceCounterCacheSavePeriodPostParams) (*CacheServiceCounterCacheSavePeriodPostOK, error) + + CacheServiceInvalidateCounterCachePost(params *CacheServiceInvalidateCounterCachePostParams) (*CacheServiceInvalidateCounterCachePostOK, error) + + CacheServiceInvalidateKeyCachePost(params *CacheServiceInvalidateKeyCachePostParams) (*CacheServiceInvalidateKeyCachePostOK, error) + + CacheServiceKeyCacheCapacityPost(params *CacheServiceKeyCacheCapacityPostParams) (*CacheServiceKeyCacheCapacityPostOK, error) + + CacheServiceKeyCacheKeysToSaveGet(params *CacheServiceKeyCacheKeysToSaveGetParams) (*CacheServiceKeyCacheKeysToSaveGetOK, error) + + CacheServiceKeyCacheKeysToSavePost(params *CacheServiceKeyCacheKeysToSavePostParams) (*CacheServiceKeyCacheKeysToSavePostOK, error) + + CacheServiceKeyCacheSavePeriodGet(params *CacheServiceKeyCacheSavePeriodGetParams) (*CacheServiceKeyCacheSavePeriodGetOK, error) + + CacheServiceKeyCacheSavePeriodPost(params *CacheServiceKeyCacheSavePeriodPostParams) (*CacheServiceKeyCacheSavePeriodPostOK, error) + + CacheServiceMetricsCounterCapacityGet(params *CacheServiceMetricsCounterCapacityGetParams) (*CacheServiceMetricsCounterCapacityGetOK, error) + + CacheServiceMetricsCounterEntriesGet(params *CacheServiceMetricsCounterEntriesGetParams) (*CacheServiceMetricsCounterEntriesGetOK, error) + + CacheServiceMetricsCounterHitRateGet(params *CacheServiceMetricsCounterHitRateGetParams) (*CacheServiceMetricsCounterHitRateGetOK, error) + + CacheServiceMetricsCounterHitsGet(params *CacheServiceMetricsCounterHitsGetParams) (*CacheServiceMetricsCounterHitsGetOK, error) + + CacheServiceMetricsCounterHitsMovingAvrageGet(params *CacheServiceMetricsCounterHitsMovingAvrageGetParams) (*CacheServiceMetricsCounterHitsMovingAvrageGetOK, error) + + CacheServiceMetricsCounterRequestsGet(params *CacheServiceMetricsCounterRequestsGetParams) (*CacheServiceMetricsCounterRequestsGetOK, error) + + CacheServiceMetricsCounterRequestsMovingAvrageGet(params *CacheServiceMetricsCounterRequestsMovingAvrageGetParams) (*CacheServiceMetricsCounterRequestsMovingAvrageGetOK, error) + + CacheServiceMetricsCounterSizeGet(params *CacheServiceMetricsCounterSizeGetParams) (*CacheServiceMetricsCounterSizeGetOK, error) + + CacheServiceMetricsKeyCapacityGet(params *CacheServiceMetricsKeyCapacityGetParams) (*CacheServiceMetricsKeyCapacityGetOK, error) + + CacheServiceMetricsKeyEntriesGet(params *CacheServiceMetricsKeyEntriesGetParams) (*CacheServiceMetricsKeyEntriesGetOK, error) + + CacheServiceMetricsKeyHitRateGet(params *CacheServiceMetricsKeyHitRateGetParams) (*CacheServiceMetricsKeyHitRateGetOK, error) + + CacheServiceMetricsKeyHitsGet(params *CacheServiceMetricsKeyHitsGetParams) (*CacheServiceMetricsKeyHitsGetOK, error) + + CacheServiceMetricsKeyHitsMovingAvrageGet(params *CacheServiceMetricsKeyHitsMovingAvrageGetParams) (*CacheServiceMetricsKeyHitsMovingAvrageGetOK, error) + + CacheServiceMetricsKeyRequestsGet(params *CacheServiceMetricsKeyRequestsGetParams) (*CacheServiceMetricsKeyRequestsGetOK, error) + + CacheServiceMetricsKeyRequestsMovingAvrageGet(params *CacheServiceMetricsKeyRequestsMovingAvrageGetParams) (*CacheServiceMetricsKeyRequestsMovingAvrageGetOK, error) + + CacheServiceMetricsKeySizeGet(params *CacheServiceMetricsKeySizeGetParams) (*CacheServiceMetricsKeySizeGetOK, error) + + CacheServiceMetricsRowCapacityGet(params *CacheServiceMetricsRowCapacityGetParams) (*CacheServiceMetricsRowCapacityGetOK, error) + + CacheServiceMetricsRowEntriesGet(params *CacheServiceMetricsRowEntriesGetParams) (*CacheServiceMetricsRowEntriesGetOK, error) + + CacheServiceMetricsRowHitRateGet(params *CacheServiceMetricsRowHitRateGetParams) (*CacheServiceMetricsRowHitRateGetOK, error) + + CacheServiceMetricsRowHitsGet(params *CacheServiceMetricsRowHitsGetParams) (*CacheServiceMetricsRowHitsGetOK, error) + + CacheServiceMetricsRowHitsMovingAvrageGet(params *CacheServiceMetricsRowHitsMovingAvrageGetParams) (*CacheServiceMetricsRowHitsMovingAvrageGetOK, error) + + CacheServiceMetricsRowRequestsGet(params *CacheServiceMetricsRowRequestsGetParams) (*CacheServiceMetricsRowRequestsGetOK, error) + + CacheServiceMetricsRowRequestsMovingAvrageGet(params *CacheServiceMetricsRowRequestsMovingAvrageGetParams) (*CacheServiceMetricsRowRequestsMovingAvrageGetOK, error) + + CacheServiceMetricsRowSizeGet(params *CacheServiceMetricsRowSizeGetParams) (*CacheServiceMetricsRowSizeGetOK, error) + + CacheServiceRowCacheCapacityPost(params *CacheServiceRowCacheCapacityPostParams) (*CacheServiceRowCacheCapacityPostOK, error) + + CacheServiceRowCacheKeysToSaveGet(params *CacheServiceRowCacheKeysToSaveGetParams) (*CacheServiceRowCacheKeysToSaveGetOK, error) + + CacheServiceRowCacheKeysToSavePost(params *CacheServiceRowCacheKeysToSavePostParams) (*CacheServiceRowCacheKeysToSavePostOK, error) + + CacheServiceRowCacheSavePeriodGet(params *CacheServiceRowCacheSavePeriodGetParams) (*CacheServiceRowCacheSavePeriodGetOK, error) + + CacheServiceRowCacheSavePeriodPost(params *CacheServiceRowCacheSavePeriodPostParams) (*CacheServiceRowCacheSavePeriodPostOK, error) + + CacheServiceSaveCachesPost(params *CacheServiceSaveCachesPostParams) (*CacheServiceSaveCachesPostOK, error) + + CollectdByPluginidGet(params *CollectdByPluginidGetParams) (*CollectdByPluginidGetOK, error) + + CollectdByPluginidPost(params *CollectdByPluginidPostParams) (*CollectdByPluginidPostOK, error) + + CollectdGet(params *CollectdGetParams) (*CollectdGetOK, error) + + CollectdPost(params *CollectdPostParams) (*CollectdPostOK, error) + + ColumnFamilyAutocompactionByNameDelete(params *ColumnFamilyAutocompactionByNameDeleteParams) (*ColumnFamilyAutocompactionByNameDeleteOK, error) + + ColumnFamilyAutocompactionByNameGet(params *ColumnFamilyAutocompactionByNameGetParams) (*ColumnFamilyAutocompactionByNameGetOK, error) + + ColumnFamilyAutocompactionByNamePost(params *ColumnFamilyAutocompactionByNamePostParams) (*ColumnFamilyAutocompactionByNamePostOK, error) + + ColumnFamilyBuiltIndexesByNameGet(params *ColumnFamilyBuiltIndexesByNameGetParams) (*ColumnFamilyBuiltIndexesByNameGetOK, error) + + ColumnFamilyCompactionByNamePost(params *ColumnFamilyCompactionByNamePostParams) (*ColumnFamilyCompactionByNamePostOK, error) + + ColumnFamilyCompactionStrategyByNameGet(params *ColumnFamilyCompactionStrategyByNameGetParams) (*ColumnFamilyCompactionStrategyByNameGetOK, error) + + ColumnFamilyCompactionStrategyByNamePost(params *ColumnFamilyCompactionStrategyByNamePostParams) (*ColumnFamilyCompactionStrategyByNamePostOK, error) + + ColumnFamilyCompressionParametersByNameGet(params *ColumnFamilyCompressionParametersByNameGetParams) (*ColumnFamilyCompressionParametersByNameGetOK, error) + + ColumnFamilyCompressionParametersByNamePost(params *ColumnFamilyCompressionParametersByNamePostParams) (*ColumnFamilyCompressionParametersByNamePostOK, error) + + ColumnFamilyCrcCheckChanceByNamePost(params *ColumnFamilyCrcCheckChanceByNamePostParams) (*ColumnFamilyCrcCheckChanceByNamePostOK, error) + + ColumnFamilyDroppableRatioByNameGet(params *ColumnFamilyDroppableRatioByNameGetParams) (*ColumnFamilyDroppableRatioByNameGetOK, error) + + ColumnFamilyEstimateKeysByNameGet(params *ColumnFamilyEstimateKeysByNameGetParams) (*ColumnFamilyEstimateKeysByNameGetOK, error) + + ColumnFamilyGet(params *ColumnFamilyGetParams) (*ColumnFamilyGetOK, error) + + ColumnFamilyLoadSstableByNamePost(params *ColumnFamilyLoadSstableByNamePostParams) (*ColumnFamilyLoadSstableByNamePostOK, error) + + ColumnFamilyMajorCompactionByNamePost(params *ColumnFamilyMajorCompactionByNamePostParams) (*ColumnFamilyMajorCompactionByNamePostOK, error) + + ColumnFamilyMaximumCompactionByNameGet(params *ColumnFamilyMaximumCompactionByNameGetParams) (*ColumnFamilyMaximumCompactionByNameGetOK, error) + + ColumnFamilyMaximumCompactionByNamePost(params *ColumnFamilyMaximumCompactionByNamePostParams) (*ColumnFamilyMaximumCompactionByNamePostOK, error) + + ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGet(params *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams) (*ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetOK, error) + + ColumnFamilyMetricsAllMemtablesLiveDataSizeGet(params *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams) (*ColumnFamilyMetricsAllMemtablesLiveDataSizeGetOK, error) + + ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGet(params *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams) (*ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetOK, error) + + ColumnFamilyMetricsAllMemtablesOffHeapSizeGet(params *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams) (*ColumnFamilyMetricsAllMemtablesOffHeapSizeGetOK, error) + + ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGet(params *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams) (*ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetOK, error) + + ColumnFamilyMetricsAllMemtablesOnHeapSizeGet(params *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams) (*ColumnFamilyMetricsAllMemtablesOnHeapSizeGetOK, error) + + ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGet(params *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams) (*ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetOK, error) + + ColumnFamilyMetricsBloomFilterDiskSpaceUsedGet(params *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams) (*ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetOK, error) + + ColumnFamilyMetricsBloomFilterFalsePositivesByNameGet(params *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams) (*ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetOK, error) + + ColumnFamilyMetricsBloomFilterFalsePositivesGet(params *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams) (*ColumnFamilyMetricsBloomFilterFalsePositivesGetOK, error) + + ColumnFamilyMetricsBloomFilterFalseRatioByNameGet(params *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams) (*ColumnFamilyMetricsBloomFilterFalseRatioByNameGetOK, error) + + ColumnFamilyMetricsBloomFilterFalseRatioGet(params *ColumnFamilyMetricsBloomFilterFalseRatioGetParams) (*ColumnFamilyMetricsBloomFilterFalseRatioGetOK, error) + + ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGet(params *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams) (*ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetOK, error) + + ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGet(params *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams) (*ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetOK, error) + + ColumnFamilyMetricsCasCommitByNameGet(params *ColumnFamilyMetricsCasCommitByNameGetParams) (*ColumnFamilyMetricsCasCommitByNameGetOK, error) + + ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGet(params *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams) (*ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetOK, error) + + ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGet(params *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams) (*ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetOK, error) + + ColumnFamilyMetricsCasPrepareByNameGet(params *ColumnFamilyMetricsCasPrepareByNameGetParams) (*ColumnFamilyMetricsCasPrepareByNameGetOK, error) + + ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGet(params *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams) (*ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetOK, error) + + ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGet(params *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams) (*ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetOK, error) + + ColumnFamilyMetricsCasProposeByNameGet(params *ColumnFamilyMetricsCasProposeByNameGetParams) (*ColumnFamilyMetricsCasProposeByNameGetOK, error) + + ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGet(params *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams) (*ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetOK, error) + + ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGet(params *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams) (*ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetOK, error) + + ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGet(params *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams) (*ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetOK, error) + + ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGet(params *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams) (*ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetOK, error) + + ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGet(params *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams) (*ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetOK, error) + + ColumnFamilyMetricsCompressionRatioByNameGet(params *ColumnFamilyMetricsCompressionRatioByNameGetParams) (*ColumnFamilyMetricsCompressionRatioByNameGetOK, error) + + ColumnFamilyMetricsCompressionRatioGet(params *ColumnFamilyMetricsCompressionRatioGetParams) (*ColumnFamilyMetricsCompressionRatioGetOK, error) + + ColumnFamilyMetricsCoordinatorReadGet(params *ColumnFamilyMetricsCoordinatorReadGetParams) (*ColumnFamilyMetricsCoordinatorReadGetOK, error) + + ColumnFamilyMetricsCoordinatorScanGet(params *ColumnFamilyMetricsCoordinatorScanGetParams) (*ColumnFamilyMetricsCoordinatorScanGetOK, error) + + ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGet(params *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams) (*ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetOK, error) + + ColumnFamilyMetricsEstimatedRowCountByNameGet(params *ColumnFamilyMetricsEstimatedRowCountByNameGetParams) (*ColumnFamilyMetricsEstimatedRowCountByNameGetOK, error) + + ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGet(params *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams) (*ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetOK, error) + + ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGet(params *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams) (*ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetOK, error) + + ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGet(params *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams) (*ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetOK, error) + + ColumnFamilyMetricsKeyCacheHitRateByNameGet(params *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams) (*ColumnFamilyMetricsKeyCacheHitRateByNameGetOK, error) + + ColumnFamilyMetricsLiveDiskSpaceUsedByNameGet(params *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams) (*ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetOK, error) + + ColumnFamilyMetricsLiveDiskSpaceUsedGet(params *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams) (*ColumnFamilyMetricsLiveDiskSpaceUsedGetOK, error) + + ColumnFamilyMetricsLiveScannedHistogramByNameGet(params *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams) (*ColumnFamilyMetricsLiveScannedHistogramByNameGetOK, error) + + ColumnFamilyMetricsLiveSsTableCountByNameGet(params *ColumnFamilyMetricsLiveSsTableCountByNameGetParams) (*ColumnFamilyMetricsLiveSsTableCountByNameGetOK, error) + + ColumnFamilyMetricsLiveSsTableCountGet(params *ColumnFamilyMetricsLiveSsTableCountGetParams) (*ColumnFamilyMetricsLiveSsTableCountGetOK, error) + + ColumnFamilyMetricsMaxRowSizeByNameGet(params *ColumnFamilyMetricsMaxRowSizeByNameGetParams) (*ColumnFamilyMetricsMaxRowSizeByNameGetOK, error) + + ColumnFamilyMetricsMaxRowSizeGet(params *ColumnFamilyMetricsMaxRowSizeGetParams) (*ColumnFamilyMetricsMaxRowSizeGetOK, error) + + ColumnFamilyMetricsMeanRowSizeByNameGet(params *ColumnFamilyMetricsMeanRowSizeByNameGetParams) (*ColumnFamilyMetricsMeanRowSizeByNameGetOK, error) + + ColumnFamilyMetricsMeanRowSizeGet(params *ColumnFamilyMetricsMeanRowSizeGetParams) (*ColumnFamilyMetricsMeanRowSizeGetOK, error) + + ColumnFamilyMetricsMemtableColumnsCountByNameGet(params *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams) (*ColumnFamilyMetricsMemtableColumnsCountByNameGetOK, error) + + ColumnFamilyMetricsMemtableColumnsCountGet(params *ColumnFamilyMetricsMemtableColumnsCountGetParams) (*ColumnFamilyMetricsMemtableColumnsCountGetOK, error) + + ColumnFamilyMetricsMemtableLiveDataSizeByNameGet(params *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams) (*ColumnFamilyMetricsMemtableLiveDataSizeByNameGetOK, error) + + ColumnFamilyMetricsMemtableLiveDataSizeGet(params *ColumnFamilyMetricsMemtableLiveDataSizeGetParams) (*ColumnFamilyMetricsMemtableLiveDataSizeGetOK, error) + + ColumnFamilyMetricsMemtableOffHeapSizeByNameGet(params *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams) (*ColumnFamilyMetricsMemtableOffHeapSizeByNameGetOK, error) + + ColumnFamilyMetricsMemtableOffHeapSizeGet(params *ColumnFamilyMetricsMemtableOffHeapSizeGetParams) (*ColumnFamilyMetricsMemtableOffHeapSizeGetOK, error) + + ColumnFamilyMetricsMemtableOnHeapSizeByNameGet(params *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams) (*ColumnFamilyMetricsMemtableOnHeapSizeByNameGetOK, error) + + ColumnFamilyMetricsMemtableOnHeapSizeGet(params *ColumnFamilyMetricsMemtableOnHeapSizeGetParams) (*ColumnFamilyMetricsMemtableOnHeapSizeGetOK, error) + + ColumnFamilyMetricsMemtableSwitchCountByNameGet(params *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams) (*ColumnFamilyMetricsMemtableSwitchCountByNameGetOK, error) + + ColumnFamilyMetricsMemtableSwitchCountGet(params *ColumnFamilyMetricsMemtableSwitchCountGetParams) (*ColumnFamilyMetricsMemtableSwitchCountGetOK, error) + + ColumnFamilyMetricsMinRowSizeByNameGet(params *ColumnFamilyMetricsMinRowSizeByNameGetParams) (*ColumnFamilyMetricsMinRowSizeByNameGetOK, error) + + ColumnFamilyMetricsMinRowSizeGet(params *ColumnFamilyMetricsMinRowSizeGetParams) (*ColumnFamilyMetricsMinRowSizeGetOK, error) + + ColumnFamilyMetricsPendingCompactionsByNameGet(params *ColumnFamilyMetricsPendingCompactionsByNameGetParams) (*ColumnFamilyMetricsPendingCompactionsByNameGetOK, error) + + ColumnFamilyMetricsPendingCompactionsGet(params *ColumnFamilyMetricsPendingCompactionsGetParams) (*ColumnFamilyMetricsPendingCompactionsGetOK, error) + + ColumnFamilyMetricsPendingFlushesByNameGet(params *ColumnFamilyMetricsPendingFlushesByNameGetParams) (*ColumnFamilyMetricsPendingFlushesByNameGetOK, error) + + ColumnFamilyMetricsPendingFlushesGet(params *ColumnFamilyMetricsPendingFlushesGetParams) (*ColumnFamilyMetricsPendingFlushesGetOK, error) + + ColumnFamilyMetricsRangeLatencyByNameGet(params *ColumnFamilyMetricsRangeLatencyByNameGetParams) (*ColumnFamilyMetricsRangeLatencyByNameGetOK, error) + + ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGet(params *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams) (*ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetOK, error) + + ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGet(params *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams) (*ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetOK, error) + + ColumnFamilyMetricsRangeLatencyGet(params *ColumnFamilyMetricsRangeLatencyGetParams) (*ColumnFamilyMetricsRangeLatencyGetOK, error) + + ColumnFamilyMetricsReadByNameGet(params *ColumnFamilyMetricsReadByNameGetParams) (*ColumnFamilyMetricsReadByNameGetOK, error) + + ColumnFamilyMetricsReadGet(params *ColumnFamilyMetricsReadGetParams) (*ColumnFamilyMetricsReadGetOK, error) + + ColumnFamilyMetricsReadLatencyByNameGet(params *ColumnFamilyMetricsReadLatencyByNameGetParams) (*ColumnFamilyMetricsReadLatencyByNameGetOK, error) + + ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGet(params *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams) (*ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetOK, error) + + ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGet(params *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams) (*ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetOK, error) + + ColumnFamilyMetricsReadLatencyGet(params *ColumnFamilyMetricsReadLatencyGetParams) (*ColumnFamilyMetricsReadLatencyGetOK, error) + + ColumnFamilyMetricsReadLatencyHistogramByNameGet(params *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams) (*ColumnFamilyMetricsReadLatencyHistogramByNameGetOK, error) + + ColumnFamilyMetricsReadLatencyHistogramGet(params *ColumnFamilyMetricsReadLatencyHistogramGetParams) (*ColumnFamilyMetricsReadLatencyHistogramGetOK, error) + + ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGet(params *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams) (*ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetOK, error) + + ColumnFamilyMetricsReadLatencyMovingAverageHistogramGet(params *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams) (*ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetOK, error) + + ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGet(params *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams) (*ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetOK, error) + + ColumnFamilyMetricsRecentBloomFilterFalsePositivesGet(params *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams) (*ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetOK, error) + + ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGet(params *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams) (*ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetOK, error) + + ColumnFamilyMetricsRecentBloomFilterFalseRatioGet(params *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams) (*ColumnFamilyMetricsRecentBloomFilterFalseRatioGetOK, error) + + ColumnFamilyMetricsRowCacheHitByNameGet(params *ColumnFamilyMetricsRowCacheHitByNameGetParams) (*ColumnFamilyMetricsRowCacheHitByNameGetOK, error) + + ColumnFamilyMetricsRowCacheHitGet(params *ColumnFamilyMetricsRowCacheHitGetParams) (*ColumnFamilyMetricsRowCacheHitGetOK, error) + + ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGet(params *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams) (*ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetOK, error) + + ColumnFamilyMetricsRowCacheHitOutOfRangeGet(params *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams) (*ColumnFamilyMetricsRowCacheHitOutOfRangeGetOK, error) + + ColumnFamilyMetricsRowCacheMissByNameGet(params *ColumnFamilyMetricsRowCacheMissByNameGetParams) (*ColumnFamilyMetricsRowCacheMissByNameGetOK, error) + + ColumnFamilyMetricsRowCacheMissGet(params *ColumnFamilyMetricsRowCacheMissGetParams) (*ColumnFamilyMetricsRowCacheMissGetOK, error) + + ColumnFamilyMetricsSnapshotsSizeByNameGet(params *ColumnFamilyMetricsSnapshotsSizeByNameGetParams) (*ColumnFamilyMetricsSnapshotsSizeByNameGetOK, error) + + ColumnFamilyMetricsSpeculativeRetriesByNameGet(params *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams) (*ColumnFamilyMetricsSpeculativeRetriesByNameGetOK, error) + + ColumnFamilyMetricsSpeculativeRetriesGet(params *ColumnFamilyMetricsSpeculativeRetriesGetParams) (*ColumnFamilyMetricsSpeculativeRetriesGetOK, error) + + ColumnFamilyMetricsSstablesPerReadHistogramByNameGet(params *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams) (*ColumnFamilyMetricsSstablesPerReadHistogramByNameGetOK, error) + + ColumnFamilyMetricsTombstoneScannedHistogramByNameGet(params *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams) (*ColumnFamilyMetricsTombstoneScannedHistogramByNameGetOK, error) + + ColumnFamilyMetricsTotalDiskSpaceUsedByNameGet(params *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams) (*ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetOK, error) + + ColumnFamilyMetricsTotalDiskSpaceUsedGet(params *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams) (*ColumnFamilyMetricsTotalDiskSpaceUsedGetOK, error) + + ColumnFamilyMetricsTrueSnapshotsSizeGet(params *ColumnFamilyMetricsTrueSnapshotsSizeGetParams) (*ColumnFamilyMetricsTrueSnapshotsSizeGetOK, error) + + ColumnFamilyMetricsWaitingOnFreeMemtableGet(params *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams) (*ColumnFamilyMetricsWaitingOnFreeMemtableGetOK, error) + + ColumnFamilyMetricsWriteByNameGet(params *ColumnFamilyMetricsWriteByNameGetParams) (*ColumnFamilyMetricsWriteByNameGetOK, error) + + ColumnFamilyMetricsWriteGet(params *ColumnFamilyMetricsWriteGetParams) (*ColumnFamilyMetricsWriteGetOK, error) + + ColumnFamilyMetricsWriteLatencyByNameGet(params *ColumnFamilyMetricsWriteLatencyByNameGetParams) (*ColumnFamilyMetricsWriteLatencyByNameGetOK, error) + + ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGet(params *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams) (*ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetOK, error) + + ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGet(params *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams) (*ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetOK, error) + + ColumnFamilyMetricsWriteLatencyGet(params *ColumnFamilyMetricsWriteLatencyGetParams) (*ColumnFamilyMetricsWriteLatencyGetOK, error) + + ColumnFamilyMetricsWriteLatencyHistogramByNameGet(params *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams) (*ColumnFamilyMetricsWriteLatencyHistogramByNameGetOK, error) + + ColumnFamilyMetricsWriteLatencyHistogramGet(params *ColumnFamilyMetricsWriteLatencyHistogramGetParams) (*ColumnFamilyMetricsWriteLatencyHistogramGetOK, error) + + ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGet(params *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams) (*ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetOK, error) + + ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGet(params *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams) (*ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetOK, error) + + ColumnFamilyMinimumCompactionByNameGet(params *ColumnFamilyMinimumCompactionByNameGetParams) (*ColumnFamilyMinimumCompactionByNameGetOK, error) + + ColumnFamilyMinimumCompactionByNamePost(params *ColumnFamilyMinimumCompactionByNamePostParams) (*ColumnFamilyMinimumCompactionByNamePostOK, error) + + ColumnFamilyNameGet(params *ColumnFamilyNameGetParams) (*ColumnFamilyNameGetOK, error) + + ColumnFamilyNameKeyspaceGet(params *ColumnFamilyNameKeyspaceGetParams) (*ColumnFamilyNameKeyspaceGetOK, error) + + ColumnFamilySstablesByKeyByNameGet(params *ColumnFamilySstablesByKeyByNameGetParams) (*ColumnFamilySstablesByKeyByNameGetOK, error) + + ColumnFamilySstablesPerLevelByNameGet(params *ColumnFamilySstablesPerLevelByNameGetParams) (*ColumnFamilySstablesPerLevelByNameGetOK, error) + + ColumnFamilySstablesUnleveledByNameGet(params *ColumnFamilySstablesUnleveledByNameGetParams) (*ColumnFamilySstablesUnleveledByNameGetOK, error) + + CommitLogMetricsWaitingOnCommitGet(params *CommitLogMetricsWaitingOnCommitGetParams) (*CommitLogMetricsWaitingOnCommitGetOK, error) + + CommitLogMetricsWaitingOnSegmentAllocationGet(params *CommitLogMetricsWaitingOnSegmentAllocationGetParams) (*CommitLogMetricsWaitingOnSegmentAllocationGetOK, error) + + CommitlogMetricsCompletedTasksGet(params *CommitlogMetricsCompletedTasksGetParams) (*CommitlogMetricsCompletedTasksGetOK, error) + + CommitlogMetricsPendingTasksGet(params *CommitlogMetricsPendingTasksGetParams) (*CommitlogMetricsPendingTasksGetOK, error) + + CommitlogMetricsTotalCommitLogSizeGet(params *CommitlogMetricsTotalCommitLogSizeGetParams) (*CommitlogMetricsTotalCommitLogSizeGetOK, error) + + CommitlogRecoverByPathPost(params *CommitlogRecoverByPathPostParams) (*CommitlogRecoverByPathPostOK, error) + + CommitlogSegmentsActiveGet(params *CommitlogSegmentsActiveGetParams) (*CommitlogSegmentsActiveGetOK, error) + + CommitlogSegmentsArchivingGet(params *CommitlogSegmentsArchivingGetParams) (*CommitlogSegmentsArchivingGetOK, error) + + CompactionManagerCompactionHistoryGet(params *CompactionManagerCompactionHistoryGetParams) (*CompactionManagerCompactionHistoryGetOK, error) + + CompactionManagerCompactionInfoGet(params *CompactionManagerCompactionInfoGetParams) (*CompactionManagerCompactionInfoGetOK, error) + + CompactionManagerCompactionsGet(params *CompactionManagerCompactionsGetParams) (*CompactionManagerCompactionsGetOK, error) + + CompactionManagerForceUserDefinedCompactionPost(params *CompactionManagerForceUserDefinedCompactionPostParams) (*CompactionManagerForceUserDefinedCompactionPostOK, error) + + CompactionManagerMetricsBytesCompactedGet(params *CompactionManagerMetricsBytesCompactedGetParams) (*CompactionManagerMetricsBytesCompactedGetOK, error) + + CompactionManagerMetricsCompletedTasksGet(params *CompactionManagerMetricsCompletedTasksGetParams) (*CompactionManagerMetricsCompletedTasksGetOK, error) + + CompactionManagerMetricsPendingTasksGet(params *CompactionManagerMetricsPendingTasksGetParams) (*CompactionManagerMetricsPendingTasksGetOK, error) + + CompactionManagerMetricsTotalCompactionsCompletedGet(params *CompactionManagerMetricsTotalCompactionsCompletedGetParams) (*CompactionManagerMetricsTotalCompactionsCompletedGetOK, error) + + CompactionManagerStopCompactionPost(params *CompactionManagerStopCompactionPostParams) (*CompactionManagerStopCompactionPostOK, error) + + FailureDetectorCountEndpointDownGet(params *FailureDetectorCountEndpointDownGetParams) (*FailureDetectorCountEndpointDownGetOK, error) + + FailureDetectorCountEndpointUpGet(params *FailureDetectorCountEndpointUpGetParams) (*FailureDetectorCountEndpointUpGetOK, error) + + FailureDetectorEndpointPhiValuesGet(params *FailureDetectorEndpointPhiValuesGetParams) (*FailureDetectorEndpointPhiValuesGetOK, error) + + FailureDetectorEndpointsGet(params *FailureDetectorEndpointsGetParams) (*FailureDetectorEndpointsGetOK, error) + + FailureDetectorEndpointsStatesByAddrGet(params *FailureDetectorEndpointsStatesByAddrGetParams) (*FailureDetectorEndpointsStatesByAddrGetOK, error) + + FailureDetectorPhiGet(params *FailureDetectorPhiGetParams) (*FailureDetectorPhiGetOK, error) + + FailureDetectorPhiPost(params *FailureDetectorPhiPostParams) (*FailureDetectorPhiPostOK, error) + + FailureDetectorSimpleStatesGet(params *FailureDetectorSimpleStatesGetParams) (*FailureDetectorSimpleStatesGetOK, error) + + GossiperAssassinateByAddrPost(params *GossiperAssassinateByAddrPostParams) (*GossiperAssassinateByAddrPostOK, error) + + GossiperDowntimeByAddrGet(params *GossiperDowntimeByAddrGetParams) (*GossiperDowntimeByAddrGetOK, error) + + GossiperEndpointDownGet(params *GossiperEndpointDownGetParams) (*GossiperEndpointDownGetOK, error) + + GossiperEndpointLiveGet(params *GossiperEndpointLiveGetParams) (*GossiperEndpointLiveGetOK, error) + + GossiperGenerationNumberByAddrGet(params *GossiperGenerationNumberByAddrGetParams) (*GossiperGenerationNumberByAddrGetOK, error) + + GossiperHeartBeatVersionByAddrGet(params *GossiperHeartBeatVersionByAddrGetParams) (*GossiperHeartBeatVersionByAddrGetOK, error) + + HintedHandoffHintsDelete(params *HintedHandoffHintsDeleteParams) (*HintedHandoffHintsDeleteOK, error) + + HintedHandoffHintsGet(params *HintedHandoffHintsGetParams) (*HintedHandoffHintsGetOK, error) + + HintedHandoffMetricsCreateHintByAddrGet(params *HintedHandoffMetricsCreateHintByAddrGetParams) (*HintedHandoffMetricsCreateHintByAddrGetOK, error) + + HintedHandoffMetricsNotStoredHintsByAddrGet(params *HintedHandoffMetricsNotStoredHintsByAddrGetParams) (*HintedHandoffMetricsNotStoredHintsByAddrGetOK, error) + + HintedHandoffPausePost(params *HintedHandoffPausePostParams) (*HintedHandoffPausePostOK, error) + + HintedHandoffSchedulePost(params *HintedHandoffSchedulePostParams) (*HintedHandoffSchedulePostOK, error) + + LsaCompactPost(params *LsaCompactPostParams) (*LsaCompactPostOK, error) + + MessagingServiceMessagesDroppedByVerGet(params *MessagingServiceMessagesDroppedByVerGetParams) (*MessagingServiceMessagesDroppedByVerGetOK, error) + + MessagingServiceMessagesDroppedGet(params *MessagingServiceMessagesDroppedGetParams) (*MessagingServiceMessagesDroppedGetOK, error) + + MessagingServiceMessagesExceptionGet(params *MessagingServiceMessagesExceptionGetParams) (*MessagingServiceMessagesExceptionGetOK, error) + + MessagingServiceMessagesPendingGet(params *MessagingServiceMessagesPendingGetParams) (*MessagingServiceMessagesPendingGetOK, error) + + MessagingServiceMessagesRepliedGet(params *MessagingServiceMessagesRepliedGetParams) (*MessagingServiceMessagesRepliedGetOK, error) + + MessagingServiceMessagesRespondCompletedGet(params *MessagingServiceMessagesRespondCompletedGetParams) (*MessagingServiceMessagesRespondCompletedGetOK, error) + + MessagingServiceMessagesRespondPendingGet(params *MessagingServiceMessagesRespondPendingGetParams) (*MessagingServiceMessagesRespondPendingGetOK, error) + + MessagingServiceMessagesSentGet(params *MessagingServiceMessagesSentGetParams) (*MessagingServiceMessagesSentGetOK, error) + + MessagingServiceMessagesTimeoutGet(params *MessagingServiceMessagesTimeoutGetParams) (*MessagingServiceMessagesTimeoutGetOK, error) + + MessagingServiceVersionGet(params *MessagingServiceVersionGetParams) (*MessagingServiceVersionGetOK, error) + + SnitchDatacenterGet(params *SnitchDatacenterGetParams) (*SnitchDatacenterGetOK, error) + + SnitchNameGet(params *SnitchNameGetParams) (*SnitchNameGetOK, error) + + SnitchRackGet(params *SnitchRackGetParams) (*SnitchRackGetOK, error) + + StorageProxyCasContentionTimeoutGet(params *StorageProxyCasContentionTimeoutGetParams) (*StorageProxyCasContentionTimeoutGetOK, error) + + StorageProxyCasContentionTimeoutPost(params *StorageProxyCasContentionTimeoutPostParams) (*StorageProxyCasContentionTimeoutPostOK, error) + + StorageProxyCounterWriteRPCTimeoutGet(params *StorageProxyCounterWriteRPCTimeoutGetParams) (*StorageProxyCounterWriteRPCTimeoutGetOK, error) + + StorageProxyCounterWriteRPCTimeoutPost(params *StorageProxyCounterWriteRPCTimeoutPostParams) (*StorageProxyCounterWriteRPCTimeoutPostOK, error) + + StorageProxyHintedHandoffEnabledByDcGet(params *StorageProxyHintedHandoffEnabledByDcGetParams) (*StorageProxyHintedHandoffEnabledByDcGetOK, error) + + StorageProxyHintedHandoffEnabledByDcPost(params *StorageProxyHintedHandoffEnabledByDcPostParams) (*StorageProxyHintedHandoffEnabledByDcPostOK, error) + + StorageProxyHintedHandoffEnabledGet(params *StorageProxyHintedHandoffEnabledGetParams) (*StorageProxyHintedHandoffEnabledGetOK, error) + + StorageProxyHintedHandoffEnabledPost(params *StorageProxyHintedHandoffEnabledPostParams) (*StorageProxyHintedHandoffEnabledPostOK, error) + + StorageProxyHintsInProgressGet(params *StorageProxyHintsInProgressGetParams) (*StorageProxyHintsInProgressGetOK, error) + + StorageProxyMaxHintWindowGet(params *StorageProxyMaxHintWindowGetParams) (*StorageProxyMaxHintWindowGetOK, error) + + StorageProxyMaxHintWindowPost(params *StorageProxyMaxHintWindowPostParams) (*StorageProxyMaxHintWindowPostOK, error) + + StorageProxyMaxHintsInProgressGet(params *StorageProxyMaxHintsInProgressGetParams) (*StorageProxyMaxHintsInProgressGetOK, error) + + StorageProxyMaxHintsInProgressPost(params *StorageProxyMaxHintsInProgressPostParams) (*StorageProxyMaxHintsInProgressPostOK, error) + + StorageProxyMetricsCasReadConditionNotMetGet(params *StorageProxyMetricsCasReadConditionNotMetGetParams) (*StorageProxyMetricsCasReadConditionNotMetGetOK, error) + + StorageProxyMetricsCasReadContentionGet(params *StorageProxyMetricsCasReadContentionGetParams) (*StorageProxyMetricsCasReadContentionGetOK, error) + + StorageProxyMetricsCasReadTimeoutsGet(params *StorageProxyMetricsCasReadTimeoutsGetParams) (*StorageProxyMetricsCasReadTimeoutsGetOK, error) + + StorageProxyMetricsCasReadUnavailablesGet(params *StorageProxyMetricsCasReadUnavailablesGetParams) (*StorageProxyMetricsCasReadUnavailablesGetOK, error) + + StorageProxyMetricsCasReadUnfinishedCommitGet(params *StorageProxyMetricsCasReadUnfinishedCommitGetParams) (*StorageProxyMetricsCasReadUnfinishedCommitGetOK, error) + + StorageProxyMetricsCasWriteConditionNotMetGet(params *StorageProxyMetricsCasWriteConditionNotMetGetParams) (*StorageProxyMetricsCasWriteConditionNotMetGetOK, error) + + StorageProxyMetricsCasWriteContentionGet(params *StorageProxyMetricsCasWriteContentionGetParams) (*StorageProxyMetricsCasWriteContentionGetOK, error) + + StorageProxyMetricsCasWriteTimeoutsGet(params *StorageProxyMetricsCasWriteTimeoutsGetParams) (*StorageProxyMetricsCasWriteTimeoutsGetOK, error) + + StorageProxyMetricsCasWriteUnavailablesGet(params *StorageProxyMetricsCasWriteUnavailablesGetParams) (*StorageProxyMetricsCasWriteUnavailablesGetOK, error) + + StorageProxyMetricsCasWriteUnfinishedCommitGet(params *StorageProxyMetricsCasWriteUnfinishedCommitGetParams) (*StorageProxyMetricsCasWriteUnfinishedCommitGetOK, error) + + StorageProxyMetricsRangeEstimatedHistogramGet(params *StorageProxyMetricsRangeEstimatedHistogramGetParams) (*StorageProxyMetricsRangeEstimatedHistogramGetOK, error) + + StorageProxyMetricsRangeGet(params *StorageProxyMetricsRangeGetParams) (*StorageProxyMetricsRangeGetOK, error) + + StorageProxyMetricsRangeHistogramGet(params *StorageProxyMetricsRangeHistogramGetParams) (*StorageProxyMetricsRangeHistogramGetOK, error) + + StorageProxyMetricsRangeMovingAverageHistogramGet(params *StorageProxyMetricsRangeMovingAverageHistogramGetParams) (*StorageProxyMetricsRangeMovingAverageHistogramGetOK, error) + + StorageProxyMetricsRangeTimeoutsGet(params *StorageProxyMetricsRangeTimeoutsGetParams) (*StorageProxyMetricsRangeTimeoutsGetOK, error) + + StorageProxyMetricsRangeTimeoutsRatesGet(params *StorageProxyMetricsRangeTimeoutsRatesGetParams) (*StorageProxyMetricsRangeTimeoutsRatesGetOK, error) + + StorageProxyMetricsRangeUnavailablesGet(params *StorageProxyMetricsRangeUnavailablesGetParams) (*StorageProxyMetricsRangeUnavailablesGetOK, error) + + StorageProxyMetricsRangeUnavailablesRatesGet(params *StorageProxyMetricsRangeUnavailablesRatesGetParams) (*StorageProxyMetricsRangeUnavailablesRatesGetOK, error) + + StorageProxyMetricsReadEstimatedHistogramGet(params *StorageProxyMetricsReadEstimatedHistogramGetParams) (*StorageProxyMetricsReadEstimatedHistogramGetOK, error) + + StorageProxyMetricsReadGet(params *StorageProxyMetricsReadGetParams) (*StorageProxyMetricsReadGetOK, error) + + StorageProxyMetricsReadHistogramGet(params *StorageProxyMetricsReadHistogramGetParams) (*StorageProxyMetricsReadHistogramGetOK, error) + + StorageProxyMetricsReadMovingAverageHistogramGet(params *StorageProxyMetricsReadMovingAverageHistogramGetParams) (*StorageProxyMetricsReadMovingAverageHistogramGetOK, error) + + StorageProxyMetricsReadTimeoutsGet(params *StorageProxyMetricsReadTimeoutsGetParams) (*StorageProxyMetricsReadTimeoutsGetOK, error) + + StorageProxyMetricsReadTimeoutsRatesGet(params *StorageProxyMetricsReadTimeoutsRatesGetParams) (*StorageProxyMetricsReadTimeoutsRatesGetOK, error) + + StorageProxyMetricsReadUnavailablesGet(params *StorageProxyMetricsReadUnavailablesGetParams) (*StorageProxyMetricsReadUnavailablesGetOK, error) + + StorageProxyMetricsReadUnavailablesRatesGet(params *StorageProxyMetricsReadUnavailablesRatesGetParams) (*StorageProxyMetricsReadUnavailablesRatesGetOK, error) + + StorageProxyMetricsWriteEstimatedHistogramGet(params *StorageProxyMetricsWriteEstimatedHistogramGetParams) (*StorageProxyMetricsWriteEstimatedHistogramGetOK, error) + + StorageProxyMetricsWriteGet(params *StorageProxyMetricsWriteGetParams) (*StorageProxyMetricsWriteGetOK, error) + + StorageProxyMetricsWriteHistogramGet(params *StorageProxyMetricsWriteHistogramGetParams) (*StorageProxyMetricsWriteHistogramGetOK, error) + + StorageProxyMetricsWriteMovingAverageHistogramGet(params *StorageProxyMetricsWriteMovingAverageHistogramGetParams) (*StorageProxyMetricsWriteMovingAverageHistogramGetOK, error) + + StorageProxyMetricsWriteTimeoutsGet(params *StorageProxyMetricsWriteTimeoutsGetParams) (*StorageProxyMetricsWriteTimeoutsGetOK, error) + + StorageProxyMetricsWriteTimeoutsRatesGet(params *StorageProxyMetricsWriteTimeoutsRatesGetParams) (*StorageProxyMetricsWriteTimeoutsRatesGetOK, error) + + StorageProxyMetricsWriteUnavailablesGet(params *StorageProxyMetricsWriteUnavailablesGetParams) (*StorageProxyMetricsWriteUnavailablesGetOK, error) + + StorageProxyMetricsWriteUnavailablesRatesGet(params *StorageProxyMetricsWriteUnavailablesRatesGetParams) (*StorageProxyMetricsWriteUnavailablesRatesGetOK, error) + + StorageProxyRangeRPCTimeoutGet(params *StorageProxyRangeRPCTimeoutGetParams) (*StorageProxyRangeRPCTimeoutGetOK, error) + + StorageProxyRangeRPCTimeoutPost(params *StorageProxyRangeRPCTimeoutPostParams) (*StorageProxyRangeRPCTimeoutPostOK, error) + + StorageProxyReadRepairAttemptedGet(params *StorageProxyReadRepairAttemptedGetParams) (*StorageProxyReadRepairAttemptedGetOK, error) + + StorageProxyReadRepairRepairedBackgroundGet(params *StorageProxyReadRepairRepairedBackgroundGetParams) (*StorageProxyReadRepairRepairedBackgroundGetOK, error) + + StorageProxyReadRepairRepairedBlockingGet(params *StorageProxyReadRepairRepairedBlockingGetParams) (*StorageProxyReadRepairRepairedBlockingGetOK, error) + + StorageProxyReadRPCTimeoutGet(params *StorageProxyReadRPCTimeoutGetParams) (*StorageProxyReadRPCTimeoutGetOK, error) + + StorageProxyReadRPCTimeoutPost(params *StorageProxyReadRPCTimeoutPostParams) (*StorageProxyReadRPCTimeoutPostOK, error) + + StorageProxyReloadTriggerClassesPost(params *StorageProxyReloadTriggerClassesPostParams) (*StorageProxyReloadTriggerClassesPostOK, error) + + StorageProxyRPCTimeoutGet(params *StorageProxyRPCTimeoutGetParams) (*StorageProxyRPCTimeoutGetOK, error) + + StorageProxyRPCTimeoutPost(params *StorageProxyRPCTimeoutPostParams) (*StorageProxyRPCTimeoutPostOK, error) + + StorageProxySchemaVersionsGet(params *StorageProxySchemaVersionsGetParams) (*StorageProxySchemaVersionsGetOK, error) + + StorageProxyTotalHintsGet(params *StorageProxyTotalHintsGetParams) (*StorageProxyTotalHintsGetOK, error) + + StorageProxyTruncateRPCTimeoutGet(params *StorageProxyTruncateRPCTimeoutGetParams) (*StorageProxyTruncateRPCTimeoutGetOK, error) + + StorageProxyTruncateRPCTimeoutPost(params *StorageProxyTruncateRPCTimeoutPostParams) (*StorageProxyTruncateRPCTimeoutPostOK, error) + + StorageProxyWriteRPCTimeoutGet(params *StorageProxyWriteRPCTimeoutGetParams) (*StorageProxyWriteRPCTimeoutGetOK, error) + + StorageProxyWriteRPCTimeoutPost(params *StorageProxyWriteRPCTimeoutPostParams) (*StorageProxyWriteRPCTimeoutPostOK, error) + + StorageServiceActiveRepairGet(params *StorageServiceActiveRepairGetParams) (*StorageServiceActiveRepairGetOK, error) + + StorageServiceAutoCompactionByKeyspaceDelete(params *StorageServiceAutoCompactionByKeyspaceDeleteParams) (*StorageServiceAutoCompactionByKeyspaceDeleteOK, error) + + StorageServiceAutoCompactionByKeyspacePost(params *StorageServiceAutoCompactionByKeyspacePostParams) (*StorageServiceAutoCompactionByKeyspacePostOK, error) + + StorageServiceBatchSizeFailureThresholdGet(params *StorageServiceBatchSizeFailureThresholdGetParams) (*StorageServiceBatchSizeFailureThresholdGetOK, error) + + StorageServiceBatchSizeFailureThresholdPost(params *StorageServiceBatchSizeFailureThresholdPostParams) (*StorageServiceBatchSizeFailureThresholdPostOK, error) + + StorageServiceBulkLoadAsyncByPathGet(params *StorageServiceBulkLoadAsyncByPathGetParams) (*StorageServiceBulkLoadAsyncByPathGetOK, error) + + StorageServiceBulkLoadByPathPost(params *StorageServiceBulkLoadByPathPostParams) (*StorageServiceBulkLoadByPathPostOK, error) + + StorageServiceClusterNameGet(params *StorageServiceClusterNameGetParams) (*StorageServiceClusterNameGetOK, error) + + StorageServiceCommitlogGet(params *StorageServiceCommitlogGetParams) (*StorageServiceCommitlogGetOK, error) + + StorageServiceCompactionThroughputGet(params *StorageServiceCompactionThroughputGetParams) (*StorageServiceCompactionThroughputGetOK, error) + + StorageServiceCompactionThroughputPost(params *StorageServiceCompactionThroughputPostParams) (*StorageServiceCompactionThroughputPostOK, error) + + StorageServiceDataFileLocationsGet(params *StorageServiceDataFileLocationsGetParams) (*StorageServiceDataFileLocationsGetOK, error) + + StorageServiceDecommissionPost(params *StorageServiceDecommissionPostParams) (*StorageServiceDecommissionPostOK, error) + + StorageServiceDeliverHintsPost(params *StorageServiceDeliverHintsPostParams) (*StorageServiceDeliverHintsPostOK, error) + + StorageServiceDescribeRingByKeyspaceGet(params *StorageServiceDescribeRingByKeyspaceGetParams) (*StorageServiceDescribeRingByKeyspaceGetOK, error) + + StorageServiceDrainGet(params *StorageServiceDrainGetParams) (*StorageServiceDrainGetOK, error) + + StorageServiceDrainPost(params *StorageServiceDrainPostParams) (*StorageServiceDrainPostOK, error) + + StorageServiceForceRemoveCompletionPost(params *StorageServiceForceRemoveCompletionPostParams) (*StorageServiceForceRemoveCompletionPostOK, error) + + StorageServiceForceTerminatePost(params *StorageServiceForceTerminatePostParams) (*StorageServiceForceTerminatePostOK, error) + + StorageServiceForceTerminateRepairPost(params *StorageServiceForceTerminateRepairPostParams) (*StorageServiceForceTerminateRepairPostOK, error) + + StorageServiceGenerationNumberGet(params *StorageServiceGenerationNumberGetParams) (*StorageServiceGenerationNumberGetOK, error) + + StorageServiceGossipingDelete(params *StorageServiceGossipingDeleteParams) (*StorageServiceGossipingDeleteOK, error) + + StorageServiceGossipingGet(params *StorageServiceGossipingGetParams) (*StorageServiceGossipingGetOK, error) + + StorageServiceGossipingPost(params *StorageServiceGossipingPostParams) (*StorageServiceGossipingPostOK, error) + + StorageServiceHintedHandoffPost(params *StorageServiceHintedHandoffPostParams) (*StorageServiceHintedHandoffPostOK, error) + + StorageServiceHostIDGet(params *StorageServiceHostIDGetParams) (*StorageServiceHostIDGetOK, error) + + StorageServiceHostidLocalGet(params *StorageServiceHostidLocalGetParams) (*StorageServiceHostidLocalGetOK, error) + + StorageServiceIncrementalBackupsGet(params *StorageServiceIncrementalBackupsGetParams) (*StorageServiceIncrementalBackupsGetOK, error) + + StorageServiceIncrementalBackupsPost(params *StorageServiceIncrementalBackupsPostParams) (*StorageServiceIncrementalBackupsPostOK, error) + + StorageServiceIsInitializedGet(params *StorageServiceIsInitializedGetParams) (*StorageServiceIsInitializedGetOK, error) + + StorageServiceIsStartingGet(params *StorageServiceIsStartingGetParams) (*StorageServiceIsStartingGetOK, error) + + StorageServiceJoinRingGet(params *StorageServiceJoinRingGetParams) (*StorageServiceJoinRingGetOK, error) + + StorageServiceJoinRingPost(params *StorageServiceJoinRingPostParams) (*StorageServiceJoinRingPostOK, error) + + StorageServiceKeyspaceCleanupByKeyspacePost(params *StorageServiceKeyspaceCleanupByKeyspacePostParams) (*StorageServiceKeyspaceCleanupByKeyspacePostOK, error) + + StorageServiceKeyspaceCompactionByKeyspacePost(params *StorageServiceKeyspaceCompactionByKeyspacePostParams) (*StorageServiceKeyspaceCompactionByKeyspacePostOK, error) + + StorageServiceKeyspaceFlushByKeyspacePost(params *StorageServiceKeyspaceFlushByKeyspacePostParams) (*StorageServiceKeyspaceFlushByKeyspacePostOK, error) + + StorageServiceKeyspaceScrubByKeyspaceGet(params *StorageServiceKeyspaceScrubByKeyspaceGetParams) (*StorageServiceKeyspaceScrubByKeyspaceGetOK, error) + + StorageServiceKeyspaceUpgradeSstablesByKeyspaceGet(params *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams) (*StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetOK, error) + + StorageServiceKeyspacesGet(params *StorageServiceKeyspacesGetParams) (*StorageServiceKeyspacesGetOK, error) + + StorageServiceLoadGet(params *StorageServiceLoadGetParams) (*StorageServiceLoadGetOK, error) + + StorageServiceLoadMapGet(params *StorageServiceLoadMapGetParams) (*StorageServiceLoadMapGetOK, error) + + StorageServiceLoggingLevelGet(params *StorageServiceLoggingLevelGetParams) (*StorageServiceLoggingLevelGetOK, error) + + StorageServiceLoggingLevelPost(params *StorageServiceLoggingLevelPostParams) (*StorageServiceLoggingLevelPostOK, error) + + StorageServiceMetricsExceptionsGet(params *StorageServiceMetricsExceptionsGetParams) (*StorageServiceMetricsExceptionsGetOK, error) + + StorageServiceMetricsHintsInProgressGet(params *StorageServiceMetricsHintsInProgressGetParams) (*StorageServiceMetricsHintsInProgressGetOK, error) + + StorageServiceMetricsLoadGet(params *StorageServiceMetricsLoadGetParams) (*StorageServiceMetricsLoadGetOK, error) + + StorageServiceMetricsTotalHintsGet(params *StorageServiceMetricsTotalHintsGetParams) (*StorageServiceMetricsTotalHintsGetOK, error) + + StorageServiceMovePost(params *StorageServiceMovePostParams) (*StorageServiceMovePostOK, error) + + StorageServiceNativeTransportDelete(params *StorageServiceNativeTransportDeleteParams) (*StorageServiceNativeTransportDeleteOK, error) + + StorageServiceNativeTransportGet(params *StorageServiceNativeTransportGetParams) (*StorageServiceNativeTransportGetOK, error) + + StorageServiceNativeTransportPost(params *StorageServiceNativeTransportPostParams) (*StorageServiceNativeTransportPostOK, error) + + StorageServiceNaturalEndpointsByKeyspaceGet(params *StorageServiceNaturalEndpointsByKeyspaceGetParams) (*StorageServiceNaturalEndpointsByKeyspaceGetOK, error) + + StorageServiceNodesJoiningGet(params *StorageServiceNodesJoiningGetParams) (*StorageServiceNodesJoiningGetOK, error) + + StorageServiceNodesLeavingGet(params *StorageServiceNodesLeavingGetParams) (*StorageServiceNodesLeavingGetOK, error) + + StorageServiceNodesMovingGet(params *StorageServiceNodesMovingGetParams) (*StorageServiceNodesMovingGetOK, error) + + StorageServiceOperationModeGet(params *StorageServiceOperationModeGetParams) (*StorageServiceOperationModeGetOK, error) + + StorageServiceOwnershipByKeyspaceGet(params *StorageServiceOwnershipByKeyspaceGetParams) (*StorageServiceOwnershipByKeyspaceGetOK, error) + + StorageServiceOwnershipGet(params *StorageServiceOwnershipGetParams) (*StorageServiceOwnershipGetOK, error) + + StorageServicePartitionerNameGet(params *StorageServicePartitionerNameGetParams) (*StorageServicePartitionerNameGetOK, error) + + StorageServicePendingRangeByKeyspaceGet(params *StorageServicePendingRangeByKeyspaceGetParams) (*StorageServicePendingRangeByKeyspaceGetOK, error) + + StorageServiceRangeToEndpointMapByKeyspaceGet(params *StorageServiceRangeToEndpointMapByKeyspaceGetParams) (*StorageServiceRangeToEndpointMapByKeyspaceGetOK, error) + + StorageServiceRebuildPost(params *StorageServiceRebuildPostParams) (*StorageServiceRebuildPostOK, error) + + StorageServiceReleaseVersionGet(params *StorageServiceReleaseVersionGetParams) (*StorageServiceReleaseVersionGetOK, error) + + StorageServiceRelocalSchemaPost(params *StorageServiceRelocalSchemaPostParams) (*StorageServiceRelocalSchemaPostOK, error) + + StorageServiceRemovalStatusGet(params *StorageServiceRemovalStatusGetParams) (*StorageServiceRemovalStatusGetOK, error) + + StorageServiceRemoveNodePost(params *StorageServiceRemoveNodePostParams) (*StorageServiceRemoveNodePostOK, error) + + StorageServiceRepairAsyncByKeyspaceGet(params *StorageServiceRepairAsyncByKeyspaceGetParams) (*StorageServiceRepairAsyncByKeyspaceGetOK, error) + + StorageServiceRepairAsyncByKeyspacePost(params *StorageServiceRepairAsyncByKeyspacePostParams) (*StorageServiceRepairAsyncByKeyspacePostOK, error) + + StorageServiceRepairStatus(params *StorageServiceRepairStatusParams) (*StorageServiceRepairStatusOK, error) + + StorageServiceRescheduleFailedDeletionsPost(params *StorageServiceRescheduleFailedDeletionsPostParams) (*StorageServiceRescheduleFailedDeletionsPostOK, error) + + StorageServiceRPCServerDelete(params *StorageServiceRPCServerDeleteParams) (*StorageServiceRPCServerDeleteOK, error) + + StorageServiceRPCServerGet(params *StorageServiceRPCServerGetParams) (*StorageServiceRPCServerGetOK, error) + + StorageServiceRPCServerPost(params *StorageServiceRPCServerPostParams) (*StorageServiceRPCServerPostOK, error) + + StorageServiceSampleKeyRangeGet(params *StorageServiceSampleKeyRangeGetParams) (*StorageServiceSampleKeyRangeGetOK, error) + + StorageServiceSavedCachesLocationGet(params *StorageServiceSavedCachesLocationGetParams) (*StorageServiceSavedCachesLocationGetOK, error) + + StorageServiceSchemaVersionGet(params *StorageServiceSchemaVersionGetParams) (*StorageServiceSchemaVersionGetOK, error) + + StorageServiceScyllaReleaseVersionGet(params *StorageServiceScyllaReleaseVersionGetParams) (*StorageServiceScyllaReleaseVersionGetOK, error) + + StorageServiceSlowQueryGet(params *StorageServiceSlowQueryGetParams) (*StorageServiceSlowQueryGetOK, error) + + StorageServiceSlowQueryPost(params *StorageServiceSlowQueryPostParams) (*StorageServiceSlowQueryPostOK, error) + + StorageServiceSnapshotsDelete(params *StorageServiceSnapshotsDeleteParams) (*StorageServiceSnapshotsDeleteOK, error) + + StorageServiceSnapshotsGet(params *StorageServiceSnapshotsGetParams) (*StorageServiceSnapshotsGetOK, error) + + StorageServiceSnapshotsPost(params *StorageServiceSnapshotsPostParams) (*StorageServiceSnapshotsPostOK, error) + + StorageServiceSnapshotsSizeTrueGet(params *StorageServiceSnapshotsSizeTrueGetParams) (*StorageServiceSnapshotsSizeTrueGetOK, error) + + StorageServiceSstablesByKeyspacePost(params *StorageServiceSstablesByKeyspacePostParams) (*StorageServiceSstablesByKeyspacePostOK, error) + + StorageServiceStopDaemonPost(params *StorageServiceStopDaemonPostParams) (*StorageServiceStopDaemonPostOK, error) + + StorageServiceStreamThroughputGet(params *StorageServiceStreamThroughputGetParams) (*StorageServiceStreamThroughputGetOK, error) + + StorageServiceStreamThroughputPost(params *StorageServiceStreamThroughputPostParams) (*StorageServiceStreamThroughputPostOK, error) + + StorageServiceTabletsBalancingPost(params *StorageServiceTabletsBalancingPostParams) (*StorageServiceTabletsBalancingPostOK, error) + + StorageServiceTokensByEndpointGet(params *StorageServiceTokensByEndpointGetParams) (*StorageServiceTokensByEndpointGetOK, error) + + StorageServiceTokensEndpointGet(params *StorageServiceTokensEndpointGetParams) (*StorageServiceTokensEndpointGetOK, error) + + StorageServiceTokensGet(params *StorageServiceTokensGetParams) (*StorageServiceTokensGetOK, error) + + StorageServiceTombstoneFailureThresholdGet(params *StorageServiceTombstoneFailureThresholdGetParams) (*StorageServiceTombstoneFailureThresholdGetOK, error) + + StorageServiceTombstoneFailureThresholdPost(params *StorageServiceTombstoneFailureThresholdPostParams) (*StorageServiceTombstoneFailureThresholdPostOK, error) + + StorageServiceTombstoneWarnThresholdGet(params *StorageServiceTombstoneWarnThresholdGetParams) (*StorageServiceTombstoneWarnThresholdGetOK, error) + + StorageServiceTombstoneWarnThresholdPost(params *StorageServiceTombstoneWarnThresholdPostParams) (*StorageServiceTombstoneWarnThresholdPostOK, error) + + StorageServiceTraceProbabilityGet(params *StorageServiceTraceProbabilityGetParams) (*StorageServiceTraceProbabilityGetOK, error) + + StorageServiceTraceProbabilityPost(params *StorageServiceTraceProbabilityPostParams) (*StorageServiceTraceProbabilityPostOK, error) + + StorageServiceTruncateByKeyspacePost(params *StorageServiceTruncateByKeyspacePostParams) (*StorageServiceTruncateByKeyspacePostOK, error) + + StorageServiceUpdateSnitchPost(params *StorageServiceUpdateSnitchPostParams) (*StorageServiceUpdateSnitchPostOK, error) + + StorageServiceViewBuildStatusesByKeyspaceAndViewGet(params *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams) (*StorageServiceViewBuildStatusesByKeyspaceAndViewGetOK, error) + + StreamManagerGet(params *StreamManagerGetParams) (*StreamManagerGetOK, error) + + StreamManagerMetricsIncomingByPeerGet(params *StreamManagerMetricsIncomingByPeerGetParams) (*StreamManagerMetricsIncomingByPeerGetOK, error) + + StreamManagerMetricsIncomingGet(params *StreamManagerMetricsIncomingGetParams) (*StreamManagerMetricsIncomingGetOK, error) + + StreamManagerMetricsOutboundGet(params *StreamManagerMetricsOutboundGetParams) (*StreamManagerMetricsOutboundGetOK, error) + + StreamManagerMetricsOutgoingByPeerGet(params *StreamManagerMetricsOutgoingByPeerGetParams) (*StreamManagerMetricsOutgoingByPeerGetOK, error) + + StreamManagerMetricsOutgoingGet(params *StreamManagerMetricsOutgoingGetParams) (*StreamManagerMetricsOutgoingGetOK, error) + + SystemLoggerByNameGet(params *SystemLoggerByNameGetParams) (*SystemLoggerByNameGetOK, error) + + SystemLoggerByNamePost(params *SystemLoggerByNamePostParams) (*SystemLoggerByNamePostOK, error) + + SystemLoggerGet(params *SystemLoggerGetParams) (*SystemLoggerGetOK, error) + + SystemLoggerPost(params *SystemLoggerPostParams) (*SystemLoggerPostOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +CacheServiceCounterCacheCapacityPost sets counter cache capacity in mb + +set counter cache capacity in mb +*/ +func (a *Client) CacheServiceCounterCacheCapacityPost(params *CacheServiceCounterCacheCapacityPostParams) (*CacheServiceCounterCacheCapacityPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceCounterCacheCapacityPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceCounterCacheCapacityPost", + Method: "POST", + PathPattern: "/cache_service/counter_cache_capacity", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceCounterCacheCapacityPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceCounterCacheCapacityPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceCounterCacheCapacityPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceCounterCacheKeysToSaveGet gets counter cache keys to save + +get counter cache keys to save +*/ +func (a *Client) CacheServiceCounterCacheKeysToSaveGet(params *CacheServiceCounterCacheKeysToSaveGetParams) (*CacheServiceCounterCacheKeysToSaveGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceCounterCacheKeysToSaveGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceCounterCacheKeysToSaveGet", + Method: "GET", + PathPattern: "/cache_service/counter_cache_keys_to_save", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceCounterCacheKeysToSaveGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceCounterCacheKeysToSaveGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceCounterCacheKeysToSaveGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceCounterCacheKeysToSavePost sets counter cache keys to save + +set counter cache keys to save +*/ +func (a *Client) CacheServiceCounterCacheKeysToSavePost(params *CacheServiceCounterCacheKeysToSavePostParams) (*CacheServiceCounterCacheKeysToSavePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceCounterCacheKeysToSavePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceCounterCacheKeysToSavePost", + Method: "POST", + PathPattern: "/cache_service/counter_cache_keys_to_save", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceCounterCacheKeysToSavePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceCounterCacheKeysToSavePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceCounterCacheKeysToSavePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceCounterCacheSavePeriodGet gets counter cache save period in seconds + +get counter cache save period in seconds +*/ +func (a *Client) CacheServiceCounterCacheSavePeriodGet(params *CacheServiceCounterCacheSavePeriodGetParams) (*CacheServiceCounterCacheSavePeriodGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceCounterCacheSavePeriodGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceCounterCacheSavePeriodGet", + Method: "GET", + PathPattern: "/cache_service/counter_cache_save_period", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceCounterCacheSavePeriodGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceCounterCacheSavePeriodGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceCounterCacheSavePeriodGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceCounterCacheSavePeriodPost sets counter cache save period in seconds + +set counter cache save period in seconds +*/ +func (a *Client) CacheServiceCounterCacheSavePeriodPost(params *CacheServiceCounterCacheSavePeriodPostParams) (*CacheServiceCounterCacheSavePeriodPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceCounterCacheSavePeriodPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceCounterCacheSavePeriodPost", + Method: "POST", + PathPattern: "/cache_service/counter_cache_save_period", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceCounterCacheSavePeriodPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceCounterCacheSavePeriodPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceCounterCacheSavePeriodPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceInvalidateCounterCachePost invalidates counter cache + +invalidate counter cache +*/ +func (a *Client) CacheServiceInvalidateCounterCachePost(params *CacheServiceInvalidateCounterCachePostParams) (*CacheServiceInvalidateCounterCachePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceInvalidateCounterCachePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceInvalidateCounterCachePost", + Method: "POST", + PathPattern: "/cache_service/invalidate_counter_cache", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceInvalidateCounterCachePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceInvalidateCounterCachePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceInvalidateCounterCachePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceInvalidateKeyCachePost invalidates key cache + +invalidate the key cache; for use after invalidating row cache +*/ +func (a *Client) CacheServiceInvalidateKeyCachePost(params *CacheServiceInvalidateKeyCachePostParams) (*CacheServiceInvalidateKeyCachePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceInvalidateKeyCachePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceInvalidateKeyCachePost", + Method: "POST", + PathPattern: "/cache_service/invalidate_key_cache", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceInvalidateKeyCachePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceInvalidateKeyCachePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceInvalidateKeyCachePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceKeyCacheCapacityPost sets key cache capacity in mb + +set key cache capacity in mb +*/ +func (a *Client) CacheServiceKeyCacheCapacityPost(params *CacheServiceKeyCacheCapacityPostParams) (*CacheServiceKeyCacheCapacityPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceKeyCacheCapacityPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceKeyCacheCapacityPost", + Method: "POST", + PathPattern: "/cache_service/key_cache_capacity", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceKeyCacheCapacityPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceKeyCacheCapacityPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceKeyCacheCapacityPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceKeyCacheKeysToSaveGet gets key cache keys to save + +get key cache keys to save +*/ +func (a *Client) CacheServiceKeyCacheKeysToSaveGet(params *CacheServiceKeyCacheKeysToSaveGetParams) (*CacheServiceKeyCacheKeysToSaveGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceKeyCacheKeysToSaveGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceKeyCacheKeysToSaveGet", + Method: "GET", + PathPattern: "/cache_service/key_cache_keys_to_save", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceKeyCacheKeysToSaveGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceKeyCacheKeysToSaveGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceKeyCacheKeysToSaveGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceKeyCacheKeysToSavePost sets key cache keys to save + +set key cache keys to save +*/ +func (a *Client) CacheServiceKeyCacheKeysToSavePost(params *CacheServiceKeyCacheKeysToSavePostParams) (*CacheServiceKeyCacheKeysToSavePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceKeyCacheKeysToSavePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceKeyCacheKeysToSavePost", + Method: "POST", + PathPattern: "/cache_service/key_cache_keys_to_save", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceKeyCacheKeysToSavePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceKeyCacheKeysToSavePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceKeyCacheKeysToSavePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceKeyCacheSavePeriodGet gets key cache save period in seconds + +get key cache save period in seconds +*/ +func (a *Client) CacheServiceKeyCacheSavePeriodGet(params *CacheServiceKeyCacheSavePeriodGetParams) (*CacheServiceKeyCacheSavePeriodGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceKeyCacheSavePeriodGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceKeyCacheSavePeriodGet", + Method: "GET", + PathPattern: "/cache_service/key_cache_save_period", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceKeyCacheSavePeriodGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceKeyCacheSavePeriodGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceKeyCacheSavePeriodGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceKeyCacheSavePeriodPost sets key cache save period in seconds + +set key cache save period in seconds +*/ +func (a *Client) CacheServiceKeyCacheSavePeriodPost(params *CacheServiceKeyCacheSavePeriodPostParams) (*CacheServiceKeyCacheSavePeriodPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceKeyCacheSavePeriodPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceKeyCacheSavePeriodPost", + Method: "POST", + PathPattern: "/cache_service/key_cache_save_period", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceKeyCacheSavePeriodPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceKeyCacheSavePeriodPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceKeyCacheSavePeriodPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsCounterCapacityGet gets counter capacity + +Get counter capacity +*/ +func (a *Client) CacheServiceMetricsCounterCapacityGet(params *CacheServiceMetricsCounterCapacityGetParams) (*CacheServiceMetricsCounterCapacityGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsCounterCapacityGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsCounterCapacityGet", + Method: "GET", + PathPattern: "/cache_service/metrics/counter/capacity", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsCounterCapacityGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsCounterCapacityGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsCounterCapacityGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsCounterEntriesGet gets counter entries + +Get counter entries +*/ +func (a *Client) CacheServiceMetricsCounterEntriesGet(params *CacheServiceMetricsCounterEntriesGetParams) (*CacheServiceMetricsCounterEntriesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsCounterEntriesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsCounterEntriesGet", + Method: "GET", + PathPattern: "/cache_service/metrics/counter/entries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsCounterEntriesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsCounterEntriesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsCounterEntriesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsCounterHitRateGet gets counter hit rate + +Get counter hit rate +*/ +func (a *Client) CacheServiceMetricsCounterHitRateGet(params *CacheServiceMetricsCounterHitRateGetParams) (*CacheServiceMetricsCounterHitRateGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsCounterHitRateGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsCounterHitRateGet", + Method: "GET", + PathPattern: "/cache_service/metrics/counter/hit_rate", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsCounterHitRateGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsCounterHitRateGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsCounterHitRateGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsCounterHitsGet gets counter hits + +Get counter hits +*/ +func (a *Client) CacheServiceMetricsCounterHitsGet(params *CacheServiceMetricsCounterHitsGetParams) (*CacheServiceMetricsCounterHitsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsCounterHitsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsCounterHitsGet", + Method: "GET", + PathPattern: "/cache_service/metrics/counter/hits", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsCounterHitsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsCounterHitsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsCounterHitsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsCounterHitsMovingAvrageGet gets counter hits moving avrage + +Get counter hits moving avrage +*/ +func (a *Client) CacheServiceMetricsCounterHitsMovingAvrageGet(params *CacheServiceMetricsCounterHitsMovingAvrageGetParams) (*CacheServiceMetricsCounterHitsMovingAvrageGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsCounterHitsMovingAvrageGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsCounterHitsMovingAvrageGet", + Method: "GET", + PathPattern: "/cache_service/metrics/counter/hits_moving_avrage", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsCounterHitsMovingAvrageGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsCounterHitsMovingAvrageGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsCounterHitsMovingAvrageGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsCounterRequestsGet gets counter requests + +Get counter requests +*/ +func (a *Client) CacheServiceMetricsCounterRequestsGet(params *CacheServiceMetricsCounterRequestsGetParams) (*CacheServiceMetricsCounterRequestsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsCounterRequestsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsCounterRequestsGet", + Method: "GET", + PathPattern: "/cache_service/metrics/counter/requests", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsCounterRequestsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsCounterRequestsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsCounterRequestsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsCounterRequestsMovingAvrageGet gets counter requests moving avrage + +Get counter requests moving avrage +*/ +func (a *Client) CacheServiceMetricsCounterRequestsMovingAvrageGet(params *CacheServiceMetricsCounterRequestsMovingAvrageGetParams) (*CacheServiceMetricsCounterRequestsMovingAvrageGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsCounterRequestsMovingAvrageGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsCounterRequestsMovingAvrageGet", + Method: "GET", + PathPattern: "/cache_service/metrics/counter/requests_moving_avrage", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsCounterRequestsMovingAvrageGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsCounterRequestsMovingAvrageGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsCounterRequestsMovingAvrageGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsCounterSizeGet gets counter size + +Get counter cache waited size +*/ +func (a *Client) CacheServiceMetricsCounterSizeGet(params *CacheServiceMetricsCounterSizeGetParams) (*CacheServiceMetricsCounterSizeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsCounterSizeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsCounterSizeGet", + Method: "GET", + PathPattern: "/cache_service/metrics/counter/size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsCounterSizeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsCounterSizeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsCounterSizeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsKeyCapacityGet gets key capacity + +Get key capacity +*/ +func (a *Client) CacheServiceMetricsKeyCapacityGet(params *CacheServiceMetricsKeyCapacityGetParams) (*CacheServiceMetricsKeyCapacityGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsKeyCapacityGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsKeyCapacityGet", + Method: "GET", + PathPattern: "/cache_service/metrics/key/capacity", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsKeyCapacityGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsKeyCapacityGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsKeyCapacityGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsKeyEntriesGet gets key entries + +Get key entries +*/ +func (a *Client) CacheServiceMetricsKeyEntriesGet(params *CacheServiceMetricsKeyEntriesGetParams) (*CacheServiceMetricsKeyEntriesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsKeyEntriesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsKeyEntriesGet", + Method: "GET", + PathPattern: "/cache_service/metrics/key/entries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsKeyEntriesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsKeyEntriesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsKeyEntriesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsKeyHitRateGet gets key hit rate + +Get key hit rate +*/ +func (a *Client) CacheServiceMetricsKeyHitRateGet(params *CacheServiceMetricsKeyHitRateGetParams) (*CacheServiceMetricsKeyHitRateGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsKeyHitRateGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsKeyHitRateGet", + Method: "GET", + PathPattern: "/cache_service/metrics/key/hit_rate", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsKeyHitRateGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsKeyHitRateGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsKeyHitRateGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsKeyHitsGet gets key hits + +Get key hits +*/ +func (a *Client) CacheServiceMetricsKeyHitsGet(params *CacheServiceMetricsKeyHitsGetParams) (*CacheServiceMetricsKeyHitsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsKeyHitsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsKeyHitsGet", + Method: "GET", + PathPattern: "/cache_service/metrics/key/hits", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsKeyHitsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsKeyHitsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsKeyHitsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsKeyHitsMovingAvrageGet gets key hits moving avrage + +Get key hits moving avrage +*/ +func (a *Client) CacheServiceMetricsKeyHitsMovingAvrageGet(params *CacheServiceMetricsKeyHitsMovingAvrageGetParams) (*CacheServiceMetricsKeyHitsMovingAvrageGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsKeyHitsMovingAvrageGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsKeyHitsMovingAvrageGet", + Method: "GET", + PathPattern: "/cache_service/metrics/key/hits_moving_avrage", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsKeyHitsMovingAvrageGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsKeyHitsMovingAvrageGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsKeyHitsMovingAvrageGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsKeyRequestsGet gets key requests + +Get key requests +*/ +func (a *Client) CacheServiceMetricsKeyRequestsGet(params *CacheServiceMetricsKeyRequestsGetParams) (*CacheServiceMetricsKeyRequestsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsKeyRequestsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsKeyRequestsGet", + Method: "GET", + PathPattern: "/cache_service/metrics/key/requests", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsKeyRequestsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsKeyRequestsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsKeyRequestsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsKeyRequestsMovingAvrageGet gets key requests moving avrage + +Get key requests moving avrage +*/ +func (a *Client) CacheServiceMetricsKeyRequestsMovingAvrageGet(params *CacheServiceMetricsKeyRequestsMovingAvrageGetParams) (*CacheServiceMetricsKeyRequestsMovingAvrageGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsKeyRequestsMovingAvrageGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsKeyRequestsMovingAvrageGet", + Method: "GET", + PathPattern: "/cache_service/metrics/key/requests_moving_avrage", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsKeyRequestsMovingAvrageGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsKeyRequestsMovingAvrageGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsKeyRequestsMovingAvrageGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsKeySizeGet gets key size + +Get key cache waited size +*/ +func (a *Client) CacheServiceMetricsKeySizeGet(params *CacheServiceMetricsKeySizeGetParams) (*CacheServiceMetricsKeySizeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsKeySizeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsKeySizeGet", + Method: "GET", + PathPattern: "/cache_service/metrics/key/size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsKeySizeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsKeySizeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsKeySizeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsRowCapacityGet gets row capacity + +Get row capacity +*/ +func (a *Client) CacheServiceMetricsRowCapacityGet(params *CacheServiceMetricsRowCapacityGetParams) (*CacheServiceMetricsRowCapacityGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsRowCapacityGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsRowCapacityGet", + Method: "GET", + PathPattern: "/cache_service/metrics/row/capacity", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsRowCapacityGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsRowCapacityGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsRowCapacityGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsRowEntriesGet gets row entries + +Get row entries +*/ +func (a *Client) CacheServiceMetricsRowEntriesGet(params *CacheServiceMetricsRowEntriesGetParams) (*CacheServiceMetricsRowEntriesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsRowEntriesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsRowEntriesGet", + Method: "GET", + PathPattern: "/cache_service/metrics/row/entries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsRowEntriesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsRowEntriesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsRowEntriesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsRowHitRateGet gets row hit rate + +Get row hit rate +*/ +func (a *Client) CacheServiceMetricsRowHitRateGet(params *CacheServiceMetricsRowHitRateGetParams) (*CacheServiceMetricsRowHitRateGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsRowHitRateGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsRowHitRateGet", + Method: "GET", + PathPattern: "/cache_service/metrics/row/hit_rate", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsRowHitRateGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsRowHitRateGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsRowHitRateGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsRowHitsGet gets row hits + +Get row hits +*/ +func (a *Client) CacheServiceMetricsRowHitsGet(params *CacheServiceMetricsRowHitsGetParams) (*CacheServiceMetricsRowHitsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsRowHitsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsRowHitsGet", + Method: "GET", + PathPattern: "/cache_service/metrics/row/hits", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsRowHitsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsRowHitsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsRowHitsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsRowHitsMovingAvrageGet gets row hits moving avrage + +Get row hits moving avrage +*/ +func (a *Client) CacheServiceMetricsRowHitsMovingAvrageGet(params *CacheServiceMetricsRowHitsMovingAvrageGetParams) (*CacheServiceMetricsRowHitsMovingAvrageGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsRowHitsMovingAvrageGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsRowHitsMovingAvrageGet", + Method: "GET", + PathPattern: "/cache_service/metrics/row/hits_moving_avrage", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsRowHitsMovingAvrageGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsRowHitsMovingAvrageGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsRowHitsMovingAvrageGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsRowRequestsGet gets row requests + +Get row requests +*/ +func (a *Client) CacheServiceMetricsRowRequestsGet(params *CacheServiceMetricsRowRequestsGetParams) (*CacheServiceMetricsRowRequestsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsRowRequestsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsRowRequestsGet", + Method: "GET", + PathPattern: "/cache_service/metrics/row/requests", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsRowRequestsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsRowRequestsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsRowRequestsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsRowRequestsMovingAvrageGet gets row requests moving avrage + +Get row requests moving avrage +*/ +func (a *Client) CacheServiceMetricsRowRequestsMovingAvrageGet(params *CacheServiceMetricsRowRequestsMovingAvrageGetParams) (*CacheServiceMetricsRowRequestsMovingAvrageGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsRowRequestsMovingAvrageGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsRowRequestsMovingAvrageGet", + Method: "GET", + PathPattern: "/cache_service/metrics/row/requests_moving_avrage", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsRowRequestsMovingAvrageGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsRowRequestsMovingAvrageGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsRowRequestsMovingAvrageGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceMetricsRowSizeGet gets row size + +Get row cache waited size +*/ +func (a *Client) CacheServiceMetricsRowSizeGet(params *CacheServiceMetricsRowSizeGetParams) (*CacheServiceMetricsRowSizeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceMetricsRowSizeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceMetricsRowSizeGet", + Method: "GET", + PathPattern: "/cache_service/metrics/row/size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceMetricsRowSizeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceMetricsRowSizeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceMetricsRowSizeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceRowCacheCapacityPost sets row cache capacity in mb + +set row cache capacity in mb +*/ +func (a *Client) CacheServiceRowCacheCapacityPost(params *CacheServiceRowCacheCapacityPostParams) (*CacheServiceRowCacheCapacityPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceRowCacheCapacityPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceRowCacheCapacityPost", + Method: "POST", + PathPattern: "/cache_service/row_cache_capacity", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceRowCacheCapacityPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceRowCacheCapacityPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceRowCacheCapacityPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceRowCacheKeysToSaveGet gets row cache keys to save + +get row cache keys to save +*/ +func (a *Client) CacheServiceRowCacheKeysToSaveGet(params *CacheServiceRowCacheKeysToSaveGetParams) (*CacheServiceRowCacheKeysToSaveGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceRowCacheKeysToSaveGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceRowCacheKeysToSaveGet", + Method: "GET", + PathPattern: "/cache_service/row_cache_keys_to_save", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceRowCacheKeysToSaveGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceRowCacheKeysToSaveGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceRowCacheKeysToSaveGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceRowCacheKeysToSavePost sets row cache keys to save + +set row cache keys to save +*/ +func (a *Client) CacheServiceRowCacheKeysToSavePost(params *CacheServiceRowCacheKeysToSavePostParams) (*CacheServiceRowCacheKeysToSavePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceRowCacheKeysToSavePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceRowCacheKeysToSavePost", + Method: "POST", + PathPattern: "/cache_service/row_cache_keys_to_save", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceRowCacheKeysToSavePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceRowCacheKeysToSavePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceRowCacheKeysToSavePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceRowCacheSavePeriodGet gets row cache save period in seconds + +get row cache save period in seconds +*/ +func (a *Client) CacheServiceRowCacheSavePeriodGet(params *CacheServiceRowCacheSavePeriodGetParams) (*CacheServiceRowCacheSavePeriodGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceRowCacheSavePeriodGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceRowCacheSavePeriodGet", + Method: "GET", + PathPattern: "/cache_service/row_cache_save_period", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceRowCacheSavePeriodGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceRowCacheSavePeriodGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceRowCacheSavePeriodGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceRowCacheSavePeriodPost sets row cache save period in seconds + +set row cache save period in seconds +*/ +func (a *Client) CacheServiceRowCacheSavePeriodPost(params *CacheServiceRowCacheSavePeriodPostParams) (*CacheServiceRowCacheSavePeriodPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceRowCacheSavePeriodPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceRowCacheSavePeriodPost", + Method: "POST", + PathPattern: "/cache_service/row_cache_save_period", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceRowCacheSavePeriodPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceRowCacheSavePeriodPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceRowCacheSavePeriodPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CacheServiceSaveCachesPost saves caches + +save row and key caches +*/ +func (a *Client) CacheServiceSaveCachesPost(params *CacheServiceSaveCachesPostParams) (*CacheServiceSaveCachesPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCacheServiceSaveCachesPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CacheServiceSaveCachesPost", + Method: "POST", + PathPattern: "/cache_service/save_caches", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CacheServiceSaveCachesPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CacheServiceSaveCachesPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CacheServiceSaveCachesPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CollectdByPluginidGet gets collectd + +Get a collectd value +*/ +func (a *Client) CollectdByPluginidGet(params *CollectdByPluginidGetParams) (*CollectdByPluginidGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCollectdByPluginidGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CollectdByPluginidGet", + Method: "GET", + PathPattern: "/collectd/{pluginid}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CollectdByPluginidGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CollectdByPluginidGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CollectdByPluginidGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CollectdByPluginidPost enables collectd + +Start reporting on one or more collectd metric +*/ +func (a *Client) CollectdByPluginidPost(params *CollectdByPluginidPostParams) (*CollectdByPluginidPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCollectdByPluginidPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CollectdByPluginidPost", + Method: "POST", + PathPattern: "/collectd/{pluginid}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CollectdByPluginidPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CollectdByPluginidPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CollectdByPluginidPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CollectdGet gets collectd items + +Get a list of all collectd metrics and their status +*/ +func (a *Client) CollectdGet(params *CollectdGetParams) (*CollectdGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCollectdGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CollectdGet", + Method: "GET", + PathPattern: "/collectd/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CollectdGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CollectdGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CollectdGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CollectdPost enables all collectd + +Enable or disable all collectd metrics +*/ +func (a *Client) CollectdPost(params *CollectdPostParams) (*CollectdPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCollectdPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CollectdPost", + Method: "POST", + PathPattern: "/collectd/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CollectdPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CollectdPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CollectdPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyAutocompactionByNameDelete disables auto compaction + +Disable table auto compaction +*/ +func (a *Client) ColumnFamilyAutocompactionByNameDelete(params *ColumnFamilyAutocompactionByNameDeleteParams) (*ColumnFamilyAutocompactionByNameDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyAutocompactionByNameDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyAutocompactionByNameDelete", + Method: "DELETE", + PathPattern: "/column_family/autocompaction/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyAutocompactionByNameDeleteReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyAutocompactionByNameDeleteOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyAutocompactionByNameDeleteDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyAutocompactionByNameGet is auto compaction enabled + +check if the auto_compaction property is enabled for a given table +*/ +func (a *Client) ColumnFamilyAutocompactionByNameGet(params *ColumnFamilyAutocompactionByNameGetParams) (*ColumnFamilyAutocompactionByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyAutocompactionByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyAutocompactionByNameGet", + Method: "GET", + PathPattern: "/column_family/autocompaction/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyAutocompactionByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyAutocompactionByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyAutocompactionByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyAutocompactionByNamePost enables auto compaction + +Enable table auto compaction +*/ +func (a *Client) ColumnFamilyAutocompactionByNamePost(params *ColumnFamilyAutocompactionByNamePostParams) (*ColumnFamilyAutocompactionByNamePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyAutocompactionByNamePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyAutocompactionByNamePost", + Method: "POST", + PathPattern: "/column_family/autocompaction/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyAutocompactionByNamePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyAutocompactionByNamePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyAutocompactionByNamePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyBuiltIndexesByNameGet gets built indexes + +Returns a list of the names of the built column indexes for current store +*/ +func (a *Client) ColumnFamilyBuiltIndexesByNameGet(params *ColumnFamilyBuiltIndexesByNameGetParams) (*ColumnFamilyBuiltIndexesByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyBuiltIndexesByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyBuiltIndexesByNameGet", + Method: "GET", + PathPattern: "/column_family/built_indexes/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyBuiltIndexesByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyBuiltIndexesByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyBuiltIndexesByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyCompactionByNamePost sets compaction threshold + +Sets the minumum and maximum number of sstables in queue before compaction kicks off +*/ +func (a *Client) ColumnFamilyCompactionByNamePost(params *ColumnFamilyCompactionByNamePostParams) (*ColumnFamilyCompactionByNamePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyCompactionByNamePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyCompactionByNamePost", + Method: "POST", + PathPattern: "/column_family/compaction/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyCompactionByNamePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyCompactionByNamePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyCompactionByNamePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyCompactionStrategyByNameGet gets compaction strategy class + +Gets the compaction strategy class name +*/ +func (a *Client) ColumnFamilyCompactionStrategyByNameGet(params *ColumnFamilyCompactionStrategyByNameGetParams) (*ColumnFamilyCompactionStrategyByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyCompactionStrategyByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyCompactionStrategyByNameGet", + Method: "GET", + PathPattern: "/column_family/compaction_strategy/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyCompactionStrategyByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyCompactionStrategyByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyCompactionStrategyByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyCompactionStrategyByNamePost sets compaction strategy class + +Sets the compaction strategy by class name +*/ +func (a *Client) ColumnFamilyCompactionStrategyByNamePost(params *ColumnFamilyCompactionStrategyByNamePostParams) (*ColumnFamilyCompactionStrategyByNamePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyCompactionStrategyByNamePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyCompactionStrategyByNamePost", + Method: "POST", + PathPattern: "/column_family/compaction_strategy/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyCompactionStrategyByNamePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyCompactionStrategyByNamePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyCompactionStrategyByNamePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyCompressionParametersByNameGet gets compression parameters + +get the compression parameters +*/ +func (a *Client) ColumnFamilyCompressionParametersByNameGet(params *ColumnFamilyCompressionParametersByNameGetParams) (*ColumnFamilyCompressionParametersByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyCompressionParametersByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyCompressionParametersByNameGet", + Method: "GET", + PathPattern: "/column_family/compression_parameters/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyCompressionParametersByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyCompressionParametersByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyCompressionParametersByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyCompressionParametersByNamePost sets compression parameters + +Sets the compression parameters +*/ +func (a *Client) ColumnFamilyCompressionParametersByNamePost(params *ColumnFamilyCompressionParametersByNamePostParams) (*ColumnFamilyCompressionParametersByNamePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyCompressionParametersByNamePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyCompressionParametersByNamePost", + Method: "POST", + PathPattern: "/column_family/compression_parameters/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyCompressionParametersByNamePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyCompressionParametersByNamePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyCompressionParametersByNamePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyCrcCheckChanceByNamePost sets crc check chance + +Set new crc check chance +*/ +func (a *Client) ColumnFamilyCrcCheckChanceByNamePost(params *ColumnFamilyCrcCheckChanceByNamePostParams) (*ColumnFamilyCrcCheckChanceByNamePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyCrcCheckChanceByNamePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyCrcCheckChanceByNamePost", + Method: "POST", + PathPattern: "/column_family/crc_check_chance/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyCrcCheckChanceByNamePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyCrcCheckChanceByNamePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyCrcCheckChanceByNamePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyDroppableRatioByNameGet gets droppable tombstone ratio + +Get the ratio of droppable tombstones to real columns (and non-droppable tombstones) +*/ +func (a *Client) ColumnFamilyDroppableRatioByNameGet(params *ColumnFamilyDroppableRatioByNameGetParams) (*ColumnFamilyDroppableRatioByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyDroppableRatioByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyDroppableRatioByNameGet", + Method: "GET", + PathPattern: "/column_family/droppable_ratio/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyDroppableRatioByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyDroppableRatioByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyDroppableRatioByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyEstimateKeysByNameGet estimates keys + +Get the estimate keys +*/ +func (a *Client) ColumnFamilyEstimateKeysByNameGet(params *ColumnFamilyEstimateKeysByNameGetParams) (*ColumnFamilyEstimateKeysByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyEstimateKeysByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyEstimateKeysByNameGet", + Method: "GET", + PathPattern: "/column_family/estimate_keys/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyEstimateKeysByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyEstimateKeysByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyEstimateKeysByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyGet gets column family + +Get a list of all column family info +*/ +func (a *Client) ColumnFamilyGet(params *ColumnFamilyGetParams) (*ColumnFamilyGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyGet", + Method: "GET", + PathPattern: "/column_family/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyLoadSstableByNamePost loads new sstables + +Scan through Keyspace/ColumnFamily's data directory determine which SSTables should be loaded and load them +*/ +func (a *Client) ColumnFamilyLoadSstableByNamePost(params *ColumnFamilyLoadSstableByNamePostParams) (*ColumnFamilyLoadSstableByNamePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyLoadSstableByNamePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyLoadSstableByNamePost", + Method: "POST", + PathPattern: "/column_family/load/sstable/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyLoadSstableByNamePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyLoadSstableByNamePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyLoadSstableByNamePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMajorCompactionByNamePost forces major compaction + +Force a major compaction of this column family +*/ +func (a *Client) ColumnFamilyMajorCompactionByNamePost(params *ColumnFamilyMajorCompactionByNamePostParams) (*ColumnFamilyMajorCompactionByNamePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMajorCompactionByNamePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMajorCompactionByNamePost", + Method: "POST", + PathPattern: "/column_family/major_compaction/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMajorCompactionByNamePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMajorCompactionByNamePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMajorCompactionByNamePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMaximumCompactionByNameGet gets maximum compaction threshold + +get the maximum number of sstables in queue before compaction kicks off +*/ +func (a *Client) ColumnFamilyMaximumCompactionByNameGet(params *ColumnFamilyMaximumCompactionByNameGetParams) (*ColumnFamilyMaximumCompactionByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMaximumCompactionByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMaximumCompactionByNameGet", + Method: "GET", + PathPattern: "/column_family/maximum_compaction/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMaximumCompactionByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMaximumCompactionByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMaximumCompactionByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMaximumCompactionByNamePost sets maximum compaction threshold + +Sets the maximum number of sstables in queue before compaction kicks off +*/ +func (a *Client) ColumnFamilyMaximumCompactionByNamePost(params *ColumnFamilyMaximumCompactionByNamePostParams) (*ColumnFamilyMaximumCompactionByNamePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMaximumCompactionByNamePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMaximumCompactionByNamePost", + Method: "POST", + PathPattern: "/column_family/maximum_compaction/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMaximumCompactionByNamePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMaximumCompactionByNamePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMaximumCompactionByNamePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGet gets cf all memtables live data size + +Get all of the column family active and not memtables live data size +*/ +func (a *Client) ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGet(params *ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams) (*ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/all_memtables_live_data_size/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsAllMemtablesLiveDataSizeByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsAllMemtablesLiveDataSizeGet gets all cf all memtables live data size + +Get all memtables active and not of all column family live data size +*/ +func (a *Client) ColumnFamilyMetricsAllMemtablesLiveDataSizeGet(params *ColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams) (*ColumnFamilyMetricsAllMemtablesLiveDataSizeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsAllMemtablesLiveDataSizeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsAllMemtablesLiveDataSizeGet", + Method: "GET", + PathPattern: "/column_family/metrics/all_memtables_live_data_size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsAllMemtablesLiveDataSizeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsAllMemtablesLiveDataSizeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsAllMemtablesLiveDataSizeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGet gets cf all memtables off heap size + +Get all of the column family active and not memtables off heap size +*/ +func (a *Client) ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGet(params *ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams) (*ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/all_memtables_off_heap_size/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsAllMemtablesOffHeapSizeByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsAllMemtablesOffHeapSizeGet gets all cf all memtables off heap size + +Get all memtables active and not of all column family off heap size +*/ +func (a *Client) ColumnFamilyMetricsAllMemtablesOffHeapSizeGet(params *ColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams) (*ColumnFamilyMetricsAllMemtablesOffHeapSizeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsAllMemtablesOffHeapSizeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsAllMemtablesOffHeapSizeGet", + Method: "GET", + PathPattern: "/column_family/metrics/all_memtables_off_heap_size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsAllMemtablesOffHeapSizeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsAllMemtablesOffHeapSizeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsAllMemtablesOffHeapSizeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGet gets cf all memtables on heap size + +Get all of the column family active and not memtables on heap size +*/ +func (a *Client) ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGet(params *ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams) (*ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/all_memtables_on_heap_size/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsAllMemtablesOnHeapSizeByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsAllMemtablesOnHeapSizeGet gets all cf all memtables on heap size + +Get all memtables active and not of all column family on heap size +*/ +func (a *Client) ColumnFamilyMetricsAllMemtablesOnHeapSizeGet(params *ColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams) (*ColumnFamilyMetricsAllMemtablesOnHeapSizeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsAllMemtablesOnHeapSizeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsAllMemtablesOnHeapSizeGet", + Method: "GET", + PathPattern: "/column_family/metrics/all_memtables_on_heap_size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsAllMemtablesOnHeapSizeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsAllMemtablesOnHeapSizeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsAllMemtablesOnHeapSizeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGet gets bloom filter disk space used + +Get bloom filter disk space used +*/ +func (a *Client) ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGet(params *ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams) (*ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/bloom_filter_disk_space_used/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsBloomFilterDiskSpaceUsedByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsBloomFilterDiskSpaceUsedGet gets all bloom filter disk space used + +Get all bloom filter disk space used +*/ +func (a *Client) ColumnFamilyMetricsBloomFilterDiskSpaceUsedGet(params *ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams) (*ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsBloomFilterDiskSpaceUsedGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsBloomFilterDiskSpaceUsedGet", + Method: "GET", + PathPattern: "/column_family/metrics/bloom_filter_disk_space_used", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsBloomFilterDiskSpaceUsedGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsBloomFilterFalsePositivesByNameGet gets bloom filter false positives + +Get bloom filter false positives +*/ +func (a *Client) ColumnFamilyMetricsBloomFilterFalsePositivesByNameGet(params *ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams) (*ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsBloomFilterFalsePositivesByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsBloomFilterFalsePositivesByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/bloom_filter_false_positives/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsBloomFilterFalsePositivesByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsBloomFilterFalsePositivesGet gets all bloom filter false positives + +Get all bloom filter false positives +*/ +func (a *Client) ColumnFamilyMetricsBloomFilterFalsePositivesGet(params *ColumnFamilyMetricsBloomFilterFalsePositivesGetParams) (*ColumnFamilyMetricsBloomFilterFalsePositivesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsBloomFilterFalsePositivesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsBloomFilterFalsePositivesGet", + Method: "GET", + PathPattern: "/column_family/metrics/bloom_filter_false_positives", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsBloomFilterFalsePositivesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsBloomFilterFalsePositivesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsBloomFilterFalsePositivesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsBloomFilterFalseRatioByNameGet gets bloom filter false ratio + +Get bloom filter false ratio +*/ +func (a *Client) ColumnFamilyMetricsBloomFilterFalseRatioByNameGet(params *ColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams) (*ColumnFamilyMetricsBloomFilterFalseRatioByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsBloomFilterFalseRatioByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsBloomFilterFalseRatioByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/bloom_filter_false_ratio/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsBloomFilterFalseRatioByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsBloomFilterFalseRatioByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsBloomFilterFalseRatioByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsBloomFilterFalseRatioGet gets all bloom filter false ratio + +Get all bloom filter false ratio +*/ +func (a *Client) ColumnFamilyMetricsBloomFilterFalseRatioGet(params *ColumnFamilyMetricsBloomFilterFalseRatioGetParams) (*ColumnFamilyMetricsBloomFilterFalseRatioGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsBloomFilterFalseRatioGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsBloomFilterFalseRatioGet", + Method: "GET", + PathPattern: "/column_family/metrics/bloom_filter_false_ratio", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsBloomFilterFalseRatioGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsBloomFilterFalseRatioGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsBloomFilterFalseRatioGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGet gets bloom filter off heap memory used + +Get bloom filter off heap memory used +*/ +func (a *Client) ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGet(params *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams) (*ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/bloom_filter_off_heap_memory_used/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGet gets all bloom filter off heap memory used + +Get all bloom filter off heap memory used +*/ +func (a *Client) ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGet(params *ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams) (*ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGet", + Method: "GET", + PathPattern: "/column_family/metrics/bloom_filter_off_heap_memory_used", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsBloomFilterOffHeapMemoryUsedGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsCasCommitByNameGet gets cas commit + +Get cas commit +*/ +func (a *Client) ColumnFamilyMetricsCasCommitByNameGet(params *ColumnFamilyMetricsCasCommitByNameGetParams) (*ColumnFamilyMetricsCasCommitByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsCasCommitByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsCasCommitByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/cas_commit/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsCasCommitByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsCasCommitByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsCasCommitByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGet gets cas commit estimated histogram + +Get cas commit +*/ +func (a *Client) ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGet(params *ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams) (*ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/cas_commit/estimated_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsCasCommitEstimatedHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGet gets cas commit estimated recent histogram + +Get cas commit +*/ +func (a *Client) ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGet(params *ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams) (*ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/cas_commit/estimated_recent_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsCasCommitEstimatedRecentHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsCasPrepareByNameGet gets cas prepare + +Get cas prepare +*/ +func (a *Client) ColumnFamilyMetricsCasPrepareByNameGet(params *ColumnFamilyMetricsCasPrepareByNameGetParams) (*ColumnFamilyMetricsCasPrepareByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsCasPrepareByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsCasPrepareByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/cas_prepare/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsCasPrepareByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsCasPrepareByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsCasPrepareByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGet gets cas prepare estimated histogram + +Get cas prepare +*/ +func (a *Client) ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGet(params *ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams) (*ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/cas_prepare/estimated_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsCasPrepareEstimatedHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGet gets cas prepare estimated recent histogram + +Get cas prepare +*/ +func (a *Client) ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGet(params *ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams) (*ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/cas_prepare/estimated_recent_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsCasPrepareEstimatedRecentHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsCasProposeByNameGet gets cas propose + +Get cas propose +*/ +func (a *Client) ColumnFamilyMetricsCasProposeByNameGet(params *ColumnFamilyMetricsCasProposeByNameGetParams) (*ColumnFamilyMetricsCasProposeByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsCasProposeByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsCasProposeByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/cas_propose/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsCasProposeByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsCasProposeByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsCasProposeByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGet gets cas propose estimated histogram + +Get cas propose +*/ +func (a *Client) ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGet(params *ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams) (*ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/cas_propose/estimated_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsCasProposeEstimatedHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGet gets cas propose estimated recent histogram + +Get cas propose +*/ +func (a *Client) ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGet(params *ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams) (*ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/cas_propose/estimated_recent_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsCasProposeEstimatedRecentHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGet gets col update time delta histogram + +Get col update time delta histogram +*/ +func (a *Client) ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGet(params *ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams) (*ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/col_update_time_delta_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsColUpdateTimeDeltaHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGet gets compression metadata off heap memory used + +Get compression metadata off heap memory used +*/ +func (a *Client) ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGet(params *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams) (*ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/compression_metadata_off_heap_memory_used/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGet gets all compression metadata off heap memory used + +Get all compression metadata off heap memory used +*/ +func (a *Client) ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGet(params *ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams) (*ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGet", + Method: "GET", + PathPattern: "/column_family/metrics/compression_metadata_off_heap_memory_used", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsCompressionMetadataOffHeapMemoryUsedGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsCompressionRatioByNameGet gets compression ratio + +Get compression ratio +*/ +func (a *Client) ColumnFamilyMetricsCompressionRatioByNameGet(params *ColumnFamilyMetricsCompressionRatioByNameGetParams) (*ColumnFamilyMetricsCompressionRatioByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsCompressionRatioByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsCompressionRatioByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/compression_ratio/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsCompressionRatioByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsCompressionRatioByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsCompressionRatioByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsCompressionRatioGet gets all compression ratio + +Get all compression ratio +*/ +func (a *Client) ColumnFamilyMetricsCompressionRatioGet(params *ColumnFamilyMetricsCompressionRatioGetParams) (*ColumnFamilyMetricsCompressionRatioGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsCompressionRatioGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsCompressionRatioGet", + Method: "GET", + PathPattern: "/column_family/metrics/compression_ratio", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsCompressionRatioGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsCompressionRatioGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsCompressionRatioGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsCoordinatorReadGet gets coordinator read latency + +Get coordinator read latency +*/ +func (a *Client) ColumnFamilyMetricsCoordinatorReadGet(params *ColumnFamilyMetricsCoordinatorReadGetParams) (*ColumnFamilyMetricsCoordinatorReadGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsCoordinatorReadGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsCoordinatorReadGet", + Method: "GET", + PathPattern: "/column_family/metrics/coordinator/read", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsCoordinatorReadGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsCoordinatorReadGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsCoordinatorReadGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsCoordinatorScanGet gets coordinator scan latency + +Get coordinator scan latency +*/ +func (a *Client) ColumnFamilyMetricsCoordinatorScanGet(params *ColumnFamilyMetricsCoordinatorScanGetParams) (*ColumnFamilyMetricsCoordinatorScanGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsCoordinatorScanGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsCoordinatorScanGet", + Method: "GET", + PathPattern: "/column_family/metrics/coordinator/scan", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsCoordinatorScanGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsCoordinatorScanGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsCoordinatorScanGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGet gets estimated column count histogram + +Get estimated column count histogram +*/ +func (a *Client) ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGet(params *ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams) (*ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/estimated_column_count_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsEstimatedColumnCountHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsEstimatedRowCountByNameGet gets estimated row count + +Get estimated row count +*/ +func (a *Client) ColumnFamilyMetricsEstimatedRowCountByNameGet(params *ColumnFamilyMetricsEstimatedRowCountByNameGetParams) (*ColumnFamilyMetricsEstimatedRowCountByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsEstimatedRowCountByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsEstimatedRowCountByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/estimated_row_count/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsEstimatedRowCountByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsEstimatedRowCountByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsEstimatedRowCountByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGet gets estimated row size histogram + +Get estimated row size histogram +*/ +func (a *Client) ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGet(params *ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams) (*ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/estimated_row_size_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsEstimatedRowSizeHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGet gets index summary off heap memory used + +Get index summary off heap memory used +*/ +func (a *Client) ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGet(params *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams) (*ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/index_summary_off_heap_memory_used/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGet gets all index summary off heap memory used + +Get all index summary off heap memory used +*/ +func (a *Client) ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGet(params *ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams) (*ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGet", + Method: "GET", + PathPattern: "/column_family/metrics/index_summary_off_heap_memory_used", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsIndexSummaryOffHeapMemoryUsedGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsKeyCacheHitRateByNameGet gets key cache hit rate + +Get key cache hit rate +*/ +func (a *Client) ColumnFamilyMetricsKeyCacheHitRateByNameGet(params *ColumnFamilyMetricsKeyCacheHitRateByNameGetParams) (*ColumnFamilyMetricsKeyCacheHitRateByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsKeyCacheHitRateByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsKeyCacheHitRateByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/key_cache_hit_rate/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsKeyCacheHitRateByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsKeyCacheHitRateByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsKeyCacheHitRateByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsLiveDiskSpaceUsedByNameGet gets live disk space used + +Get live disk space used +*/ +func (a *Client) ColumnFamilyMetricsLiveDiskSpaceUsedByNameGet(params *ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams) (*ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsLiveDiskSpaceUsedByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsLiveDiskSpaceUsedByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/live_disk_space_used/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsLiveDiskSpaceUsedByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsLiveDiskSpaceUsedGet gets all live disk space used + +Get all live disk space used +*/ +func (a *Client) ColumnFamilyMetricsLiveDiskSpaceUsedGet(params *ColumnFamilyMetricsLiveDiskSpaceUsedGetParams) (*ColumnFamilyMetricsLiveDiskSpaceUsedGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsLiveDiskSpaceUsedGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsLiveDiskSpaceUsedGet", + Method: "GET", + PathPattern: "/column_family/metrics/live_disk_space_used", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsLiveDiskSpaceUsedGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsLiveDiskSpaceUsedGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsLiveDiskSpaceUsedGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsLiveScannedHistogramByNameGet gets live scanned histogram + +Get live scanned histogram +*/ +func (a *Client) ColumnFamilyMetricsLiveScannedHistogramByNameGet(params *ColumnFamilyMetricsLiveScannedHistogramByNameGetParams) (*ColumnFamilyMetricsLiveScannedHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsLiveScannedHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsLiveScannedHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/live_scanned_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsLiveScannedHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsLiveScannedHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsLiveScannedHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsLiveSsTableCountByNameGet gets live ss table count + +Get live ss table count +*/ +func (a *Client) ColumnFamilyMetricsLiveSsTableCountByNameGet(params *ColumnFamilyMetricsLiveSsTableCountByNameGetParams) (*ColumnFamilyMetricsLiveSsTableCountByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsLiveSsTableCountByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsLiveSsTableCountByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/live_ss_table_count/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsLiveSsTableCountByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsLiveSsTableCountByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsLiveSsTableCountByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsLiveSsTableCountGet gets all live ss table count + +Get all live ss table count +*/ +func (a *Client) ColumnFamilyMetricsLiveSsTableCountGet(params *ColumnFamilyMetricsLiveSsTableCountGetParams) (*ColumnFamilyMetricsLiveSsTableCountGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsLiveSsTableCountGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsLiveSsTableCountGet", + Method: "GET", + PathPattern: "/column_family/metrics/live_ss_table_count", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsLiveSsTableCountGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsLiveSsTableCountGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsLiveSsTableCountGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMaxRowSizeByNameGet gets max row size + +Get max row size +*/ +func (a *Client) ColumnFamilyMetricsMaxRowSizeByNameGet(params *ColumnFamilyMetricsMaxRowSizeByNameGetParams) (*ColumnFamilyMetricsMaxRowSizeByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMaxRowSizeByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMaxRowSizeByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/max_row_size/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMaxRowSizeByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMaxRowSizeByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMaxRowSizeByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMaxRowSizeGet gets all max row size + +Get all max row size +*/ +func (a *Client) ColumnFamilyMetricsMaxRowSizeGet(params *ColumnFamilyMetricsMaxRowSizeGetParams) (*ColumnFamilyMetricsMaxRowSizeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMaxRowSizeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMaxRowSizeGet", + Method: "GET", + PathPattern: "/column_family/metrics/max_row_size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMaxRowSizeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMaxRowSizeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMaxRowSizeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMeanRowSizeByNameGet gets mean row size + +Get mean row size +*/ +func (a *Client) ColumnFamilyMetricsMeanRowSizeByNameGet(params *ColumnFamilyMetricsMeanRowSizeByNameGetParams) (*ColumnFamilyMetricsMeanRowSizeByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMeanRowSizeByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMeanRowSizeByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/mean_row_size/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMeanRowSizeByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMeanRowSizeByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMeanRowSizeByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMeanRowSizeGet gets all mean row size + +Get all mean row size +*/ +func (a *Client) ColumnFamilyMetricsMeanRowSizeGet(params *ColumnFamilyMetricsMeanRowSizeGetParams) (*ColumnFamilyMetricsMeanRowSizeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMeanRowSizeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMeanRowSizeGet", + Method: "GET", + PathPattern: "/column_family/metrics/mean_row_size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMeanRowSizeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMeanRowSizeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMeanRowSizeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMemtableColumnsCountByNameGet gets memtable columns count + +get memtable columns count +*/ +func (a *Client) ColumnFamilyMetricsMemtableColumnsCountByNameGet(params *ColumnFamilyMetricsMemtableColumnsCountByNameGetParams) (*ColumnFamilyMetricsMemtableColumnsCountByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMemtableColumnsCountByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMemtableColumnsCountByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/memtable_columns_count/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMemtableColumnsCountByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMemtableColumnsCountByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMemtableColumnsCountByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMemtableColumnsCountGet gets all memtable columns count + +get all memtable columns count +*/ +func (a *Client) ColumnFamilyMetricsMemtableColumnsCountGet(params *ColumnFamilyMetricsMemtableColumnsCountGetParams) (*ColumnFamilyMetricsMemtableColumnsCountGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMemtableColumnsCountGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMemtableColumnsCountGet", + Method: "GET", + PathPattern: "/column_family/metrics/memtable_columns_count/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMemtableColumnsCountGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMemtableColumnsCountGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMemtableColumnsCountGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMemtableLiveDataSizeByNameGet gets memtable live data size + +Get the column family active memtable live data size +*/ +func (a *Client) ColumnFamilyMetricsMemtableLiveDataSizeByNameGet(params *ColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams) (*ColumnFamilyMetricsMemtableLiveDataSizeByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMemtableLiveDataSizeByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMemtableLiveDataSizeByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/memtable_live_data_size/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMemtableLiveDataSizeByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMemtableLiveDataSizeByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMemtableLiveDataSizeByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMemtableLiveDataSizeGet gets all memtable live data size + +Get all active memtable of all column family live data size +*/ +func (a *Client) ColumnFamilyMetricsMemtableLiveDataSizeGet(params *ColumnFamilyMetricsMemtableLiveDataSizeGetParams) (*ColumnFamilyMetricsMemtableLiveDataSizeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMemtableLiveDataSizeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMemtableLiveDataSizeGet", + Method: "GET", + PathPattern: "/column_family/metrics/memtable_live_data_size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMemtableLiveDataSizeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMemtableLiveDataSizeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMemtableLiveDataSizeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMemtableOffHeapSizeByNameGet gets memtable off heap size + +Get the column family active memtable off heap size +*/ +func (a *Client) ColumnFamilyMetricsMemtableOffHeapSizeByNameGet(params *ColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams) (*ColumnFamilyMetricsMemtableOffHeapSizeByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMemtableOffHeapSizeByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMemtableOffHeapSizeByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/memtable_off_heap_size/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMemtableOffHeapSizeByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMemtableOffHeapSizeByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMemtableOffHeapSizeByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMemtableOffHeapSizeGet gets all memtable off heap size + +Get all active memtable of all column family off heap size +*/ +func (a *Client) ColumnFamilyMetricsMemtableOffHeapSizeGet(params *ColumnFamilyMetricsMemtableOffHeapSizeGetParams) (*ColumnFamilyMetricsMemtableOffHeapSizeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMemtableOffHeapSizeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMemtableOffHeapSizeGet", + Method: "GET", + PathPattern: "/column_family/metrics/memtable_off_heap_size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMemtableOffHeapSizeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMemtableOffHeapSizeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMemtableOffHeapSizeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMemtableOnHeapSizeByNameGet gets memtable on heap size + +Get the column family active memtable on heap size +*/ +func (a *Client) ColumnFamilyMetricsMemtableOnHeapSizeByNameGet(params *ColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams) (*ColumnFamilyMetricsMemtableOnHeapSizeByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMemtableOnHeapSizeByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMemtableOnHeapSizeByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/memtable_on_heap_size/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMemtableOnHeapSizeByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMemtableOnHeapSizeByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMemtableOnHeapSizeByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMemtableOnHeapSizeGet gets all memtable on heap size + +Get all active memtable of all column family on heap size +*/ +func (a *Client) ColumnFamilyMetricsMemtableOnHeapSizeGet(params *ColumnFamilyMetricsMemtableOnHeapSizeGetParams) (*ColumnFamilyMetricsMemtableOnHeapSizeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMemtableOnHeapSizeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMemtableOnHeapSizeGet", + Method: "GET", + PathPattern: "/column_family/metrics/memtable_on_heap_size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMemtableOnHeapSizeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMemtableOnHeapSizeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMemtableOnHeapSizeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMemtableSwitchCountByNameGet gets memtable switch count + +Get memtable switch count +*/ +func (a *Client) ColumnFamilyMetricsMemtableSwitchCountByNameGet(params *ColumnFamilyMetricsMemtableSwitchCountByNameGetParams) (*ColumnFamilyMetricsMemtableSwitchCountByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMemtableSwitchCountByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMemtableSwitchCountByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/memtable_switch_count/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMemtableSwitchCountByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMemtableSwitchCountByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMemtableSwitchCountByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMemtableSwitchCountGet gets all memtable switch count + +Get all memtable switch count +*/ +func (a *Client) ColumnFamilyMetricsMemtableSwitchCountGet(params *ColumnFamilyMetricsMemtableSwitchCountGetParams) (*ColumnFamilyMetricsMemtableSwitchCountGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMemtableSwitchCountGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMemtableSwitchCountGet", + Method: "GET", + PathPattern: "/column_family/metrics/memtable_switch_count", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMemtableSwitchCountGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMemtableSwitchCountGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMemtableSwitchCountGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMinRowSizeByNameGet gets min row size + +Get min row size +*/ +func (a *Client) ColumnFamilyMetricsMinRowSizeByNameGet(params *ColumnFamilyMetricsMinRowSizeByNameGetParams) (*ColumnFamilyMetricsMinRowSizeByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMinRowSizeByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMinRowSizeByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/min_row_size/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMinRowSizeByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMinRowSizeByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMinRowSizeByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsMinRowSizeGet gets all min row size + +Get all min row size +*/ +func (a *Client) ColumnFamilyMetricsMinRowSizeGet(params *ColumnFamilyMetricsMinRowSizeGetParams) (*ColumnFamilyMetricsMinRowSizeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsMinRowSizeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsMinRowSizeGet", + Method: "GET", + PathPattern: "/column_family/metrics/min_row_size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsMinRowSizeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsMinRowSizeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsMinRowSizeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsPendingCompactionsByNameGet gets pending compactions + +Get pending compactions +*/ +func (a *Client) ColumnFamilyMetricsPendingCompactionsByNameGet(params *ColumnFamilyMetricsPendingCompactionsByNameGetParams) (*ColumnFamilyMetricsPendingCompactionsByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsPendingCompactionsByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsPendingCompactionsByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/pending_compactions/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsPendingCompactionsByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsPendingCompactionsByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsPendingCompactionsByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsPendingCompactionsGet gets all pending compactions + +Get all pending compactions +*/ +func (a *Client) ColumnFamilyMetricsPendingCompactionsGet(params *ColumnFamilyMetricsPendingCompactionsGetParams) (*ColumnFamilyMetricsPendingCompactionsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsPendingCompactionsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsPendingCompactionsGet", + Method: "GET", + PathPattern: "/column_family/metrics/pending_compactions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsPendingCompactionsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsPendingCompactionsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsPendingCompactionsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsPendingFlushesByNameGet gets pending flushes + +Get pending flushes +*/ +func (a *Client) ColumnFamilyMetricsPendingFlushesByNameGet(params *ColumnFamilyMetricsPendingFlushesByNameGetParams) (*ColumnFamilyMetricsPendingFlushesByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsPendingFlushesByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsPendingFlushesByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/pending_flushes/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsPendingFlushesByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsPendingFlushesByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsPendingFlushesByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsPendingFlushesGet gets all pending flushes + +Get all pending flushes +*/ +func (a *Client) ColumnFamilyMetricsPendingFlushesGet(params *ColumnFamilyMetricsPendingFlushesGetParams) (*ColumnFamilyMetricsPendingFlushesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsPendingFlushesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsPendingFlushesGet", + Method: "GET", + PathPattern: "/column_family/metrics/pending_flushes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsPendingFlushesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsPendingFlushesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsPendingFlushesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsRangeLatencyByNameGet gets range latency + +Get range latency +*/ +func (a *Client) ColumnFamilyMetricsRangeLatencyByNameGet(params *ColumnFamilyMetricsRangeLatencyByNameGetParams) (*ColumnFamilyMetricsRangeLatencyByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsRangeLatencyByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsRangeLatencyByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/range_latency/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsRangeLatencyByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsRangeLatencyByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsRangeLatencyByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGet gets range latency estimated histogram + +Get range latency +*/ +func (a *Client) ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGet(params *ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams) (*ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/range_latency/estimated_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsRangeLatencyEstimatedHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGet gets range latency estimated recent histogram + +Get range latency +*/ +func (a *Client) ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGet(params *ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams) (*ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/range_latency/estimated_recent_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsRangeLatencyEstimatedRecentHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsRangeLatencyGet gets all range latency + +Get all range latency +*/ +func (a *Client) ColumnFamilyMetricsRangeLatencyGet(params *ColumnFamilyMetricsRangeLatencyGetParams) (*ColumnFamilyMetricsRangeLatencyGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsRangeLatencyGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsRangeLatencyGet", + Method: "GET", + PathPattern: "/column_family/metrics/range_latency", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsRangeLatencyGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsRangeLatencyGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsRangeLatencyGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsReadByNameGet gets read + +Get number of reads +*/ +func (a *Client) ColumnFamilyMetricsReadByNameGet(params *ColumnFamilyMetricsReadByNameGetParams) (*ColumnFamilyMetricsReadByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsReadByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsReadByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/read/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsReadByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsReadByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsReadByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsReadGet gets all read + +Get number of reads from all column family, per shard +*/ +func (a *Client) ColumnFamilyMetricsReadGet(params *ColumnFamilyMetricsReadGetParams) (*ColumnFamilyMetricsReadGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsReadGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsReadGet", + Method: "GET", + PathPattern: "/column_family/metrics/read/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsReadGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsReadGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsReadGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsReadLatencyByNameGet gets read latency + +Get read latency +*/ +func (a *Client) ColumnFamilyMetricsReadLatencyByNameGet(params *ColumnFamilyMetricsReadLatencyByNameGetParams) (*ColumnFamilyMetricsReadLatencyByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsReadLatencyByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsReadLatencyByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/read_latency/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsReadLatencyByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsReadLatencyByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsReadLatencyByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGet gets read latency estimated histogram + +Get read latency +*/ +func (a *Client) ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGet(params *ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams) (*ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/read_latency/estimated_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsReadLatencyEstimatedHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGet gets read latency estimated recent histogram + +Get read latency +*/ +func (a *Client) ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGet(params *ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams) (*ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/read_latency/estimated_recent_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsReadLatencyEstimatedRecentHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsReadLatencyGet gets all read latency + +Get all read latency +*/ +func (a *Client) ColumnFamilyMetricsReadLatencyGet(params *ColumnFamilyMetricsReadLatencyGetParams) (*ColumnFamilyMetricsReadLatencyGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsReadLatencyGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsReadLatencyGet", + Method: "GET", + PathPattern: "/column_family/metrics/read_latency", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsReadLatencyGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsReadLatencyGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsReadLatencyGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsReadLatencyHistogramByNameGet gets read latency histogram depricated + +Get read latency histogram +*/ +func (a *Client) ColumnFamilyMetricsReadLatencyHistogramByNameGet(params *ColumnFamilyMetricsReadLatencyHistogramByNameGetParams) (*ColumnFamilyMetricsReadLatencyHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsReadLatencyHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsReadLatencyHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/read_latency/histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsReadLatencyHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsReadLatencyHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsReadLatencyHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsReadLatencyHistogramGet gets all read latency histogram depricated + +Get read latency histogram from all column family +*/ +func (a *Client) ColumnFamilyMetricsReadLatencyHistogramGet(params *ColumnFamilyMetricsReadLatencyHistogramGetParams) (*ColumnFamilyMetricsReadLatencyHistogramGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsReadLatencyHistogramGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsReadLatencyHistogramGet", + Method: "GET", + PathPattern: "/column_family/metrics/read_latency/histogram/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsReadLatencyHistogramGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsReadLatencyHistogramGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsReadLatencyHistogramGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGet gets read latency histogram + +Get read latency moving avrage histogram +*/ +func (a *Client) ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGet(params *ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams) (*ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/read_latency/moving_average_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsReadLatencyMovingAverageHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsReadLatencyMovingAverageHistogramGet gets all read latency histogram + +Get read latency moving avrage histogram from all column family +*/ +func (a *Client) ColumnFamilyMetricsReadLatencyMovingAverageHistogramGet(params *ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams) (*ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsReadLatencyMovingAverageHistogramGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsReadLatencyMovingAverageHistogramGet", + Method: "GET", + PathPattern: "/column_family/metrics/read_latency/moving_average_histogram/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsReadLatencyMovingAverageHistogramGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGet gets recent bloom filter false positives + +Get recent bloom filter false positives +*/ +func (a *Client) ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGet(params *ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams) (*ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/recent_bloom_filter_false_positives/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsRecentBloomFilterFalsePositivesByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalsePositivesGet gets all recent bloom filter false positives + +Get all recent bloom filter false positives +*/ +func (a *Client) ColumnFamilyMetricsRecentBloomFilterFalsePositivesGet(params *ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams) (*ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsRecentBloomFilterFalsePositivesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsRecentBloomFilterFalsePositivesGet", + Method: "GET", + PathPattern: "/column_family/metrics/recent_bloom_filter_false_positives", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsRecentBloomFilterFalsePositivesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGet gets recent bloom filter false ratio + +Get recent bloom filter false ratio +*/ +func (a *Client) ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGet(params *ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams) (*ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/recent_bloom_filter_false_ratio/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsRecentBloomFilterFalseRatioByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsRecentBloomFilterFalseRatioGet gets all recent bloom filter false ratio + +Get all recent bloom filter false ratio +*/ +func (a *Client) ColumnFamilyMetricsRecentBloomFilterFalseRatioGet(params *ColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams) (*ColumnFamilyMetricsRecentBloomFilterFalseRatioGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsRecentBloomFilterFalseRatioGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsRecentBloomFilterFalseRatioGet", + Method: "GET", + PathPattern: "/column_family/metrics/recent_bloom_filter_false_ratio", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsRecentBloomFilterFalseRatioGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsRecentBloomFilterFalseRatioGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsRecentBloomFilterFalseRatioGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsRowCacheHitByNameGet gets row cache hit + +Get row cache hit +*/ +func (a *Client) ColumnFamilyMetricsRowCacheHitByNameGet(params *ColumnFamilyMetricsRowCacheHitByNameGetParams) (*ColumnFamilyMetricsRowCacheHitByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsRowCacheHitByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsRowCacheHitByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/row_cache_hit/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsRowCacheHitByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsRowCacheHitByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsRowCacheHitByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsRowCacheHitGet gets all row cache hit + +Get all row cache hit +*/ +func (a *Client) ColumnFamilyMetricsRowCacheHitGet(params *ColumnFamilyMetricsRowCacheHitGetParams) (*ColumnFamilyMetricsRowCacheHitGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsRowCacheHitGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsRowCacheHitGet", + Method: "GET", + PathPattern: "/column_family/metrics/row_cache_hit", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsRowCacheHitGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsRowCacheHitGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsRowCacheHitGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGet gets row cache hit out of range + +Get row cache hit out of range +*/ +func (a *Client) ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGet(params *ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams) (*ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/row_cache_hit_out_of_range/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsRowCacheHitOutOfRangeByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsRowCacheHitOutOfRangeGet gets all row cache hit out of range + +Get all row cache hit out of range +*/ +func (a *Client) ColumnFamilyMetricsRowCacheHitOutOfRangeGet(params *ColumnFamilyMetricsRowCacheHitOutOfRangeGetParams) (*ColumnFamilyMetricsRowCacheHitOutOfRangeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsRowCacheHitOutOfRangeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsRowCacheHitOutOfRangeGet", + Method: "GET", + PathPattern: "/column_family/metrics/row_cache_hit_out_of_range", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsRowCacheHitOutOfRangeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsRowCacheHitOutOfRangeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsRowCacheHitOutOfRangeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsRowCacheMissByNameGet gets row cache miss + +Get row cache miss +*/ +func (a *Client) ColumnFamilyMetricsRowCacheMissByNameGet(params *ColumnFamilyMetricsRowCacheMissByNameGetParams) (*ColumnFamilyMetricsRowCacheMissByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsRowCacheMissByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsRowCacheMissByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/row_cache_miss/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsRowCacheMissByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsRowCacheMissByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsRowCacheMissByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsRowCacheMissGet gets all row cache miss + +Get all row cache miss +*/ +func (a *Client) ColumnFamilyMetricsRowCacheMissGet(params *ColumnFamilyMetricsRowCacheMissGetParams) (*ColumnFamilyMetricsRowCacheMissGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsRowCacheMissGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsRowCacheMissGet", + Method: "GET", + PathPattern: "/column_family/metrics/row_cache_miss", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsRowCacheMissGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsRowCacheMissGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsRowCacheMissGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsSnapshotsSizeByNameGet gets true snapshots size + +Get true snapshots size +*/ +func (a *Client) ColumnFamilyMetricsSnapshotsSizeByNameGet(params *ColumnFamilyMetricsSnapshotsSizeByNameGetParams) (*ColumnFamilyMetricsSnapshotsSizeByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsSnapshotsSizeByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsSnapshotsSizeByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/snapshots_size/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsSnapshotsSizeByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsSnapshotsSizeByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsSnapshotsSizeByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsSpeculativeRetriesByNameGet gets speculative retries + +Get speculative retries +*/ +func (a *Client) ColumnFamilyMetricsSpeculativeRetriesByNameGet(params *ColumnFamilyMetricsSpeculativeRetriesByNameGetParams) (*ColumnFamilyMetricsSpeculativeRetriesByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsSpeculativeRetriesByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsSpeculativeRetriesByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/speculative_retries/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsSpeculativeRetriesByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsSpeculativeRetriesByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsSpeculativeRetriesByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsSpeculativeRetriesGet gets all speculative retries + +Get all speculative retries +*/ +func (a *Client) ColumnFamilyMetricsSpeculativeRetriesGet(params *ColumnFamilyMetricsSpeculativeRetriesGetParams) (*ColumnFamilyMetricsSpeculativeRetriesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsSpeculativeRetriesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsSpeculativeRetriesGet", + Method: "GET", + PathPattern: "/column_family/metrics/speculative_retries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsSpeculativeRetriesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsSpeculativeRetriesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsSpeculativeRetriesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsSstablesPerReadHistogramByNameGet gets sstables per read histogram + +Get sstables per read histogram +*/ +func (a *Client) ColumnFamilyMetricsSstablesPerReadHistogramByNameGet(params *ColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams) (*ColumnFamilyMetricsSstablesPerReadHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsSstablesPerReadHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsSstablesPerReadHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/sstables_per_read_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsSstablesPerReadHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsSstablesPerReadHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsSstablesPerReadHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsTombstoneScannedHistogramByNameGet gets tombstone scanned histogram + +Get tombstone scanned histogram +*/ +func (a *Client) ColumnFamilyMetricsTombstoneScannedHistogramByNameGet(params *ColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams) (*ColumnFamilyMetricsTombstoneScannedHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsTombstoneScannedHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsTombstoneScannedHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/tombstone_scanned_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsTombstoneScannedHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsTombstoneScannedHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsTombstoneScannedHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsTotalDiskSpaceUsedByNameGet gets total disk space used + +Get total disk space used +*/ +func (a *Client) ColumnFamilyMetricsTotalDiskSpaceUsedByNameGet(params *ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams) (*ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsTotalDiskSpaceUsedByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsTotalDiskSpaceUsedByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/total_disk_space_used/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsTotalDiskSpaceUsedByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsTotalDiskSpaceUsedGet gets all total disk space used + +Get all total disk space used +*/ +func (a *Client) ColumnFamilyMetricsTotalDiskSpaceUsedGet(params *ColumnFamilyMetricsTotalDiskSpaceUsedGetParams) (*ColumnFamilyMetricsTotalDiskSpaceUsedGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsTotalDiskSpaceUsedGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsTotalDiskSpaceUsedGet", + Method: "GET", + PathPattern: "/column_family/metrics/total_disk_space_used", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsTotalDiskSpaceUsedGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsTotalDiskSpaceUsedGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsTotalDiskSpaceUsedGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsTrueSnapshotsSizeGet gets all true snapshots size + +Get all true snapshots size +*/ +func (a *Client) ColumnFamilyMetricsTrueSnapshotsSizeGet(params *ColumnFamilyMetricsTrueSnapshotsSizeGetParams) (*ColumnFamilyMetricsTrueSnapshotsSizeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsTrueSnapshotsSizeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsTrueSnapshotsSizeGet", + Method: "GET", + PathPattern: "/column_family/metrics/true_snapshots_size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsTrueSnapshotsSizeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsTrueSnapshotsSizeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsTrueSnapshotsSizeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsWaitingOnFreeMemtableGet gets waiting on free memtable space + +Get waiting on free memtable space +*/ +func (a *Client) ColumnFamilyMetricsWaitingOnFreeMemtableGet(params *ColumnFamilyMetricsWaitingOnFreeMemtableGetParams) (*ColumnFamilyMetricsWaitingOnFreeMemtableGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsWaitingOnFreeMemtableGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsWaitingOnFreeMemtableGet", + Method: "GET", + PathPattern: "/column_family/metrics/waiting_on_free_memtable", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsWaitingOnFreeMemtableGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsWaitingOnFreeMemtableGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsWaitingOnFreeMemtableGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsWriteByNameGet gets write + +Get number of writes +*/ +func (a *Client) ColumnFamilyMetricsWriteByNameGet(params *ColumnFamilyMetricsWriteByNameGetParams) (*ColumnFamilyMetricsWriteByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsWriteByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsWriteByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/write/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsWriteByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsWriteByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsWriteByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsWriteGet gets all write + +Get number of writes from all column family, per shard +*/ +func (a *Client) ColumnFamilyMetricsWriteGet(params *ColumnFamilyMetricsWriteGetParams) (*ColumnFamilyMetricsWriteGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsWriteGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsWriteGet", + Method: "GET", + PathPattern: "/column_family/metrics/write/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsWriteGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsWriteGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsWriteGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsWriteLatencyByNameGet gets write latency + +Get write latency +*/ +func (a *Client) ColumnFamilyMetricsWriteLatencyByNameGet(params *ColumnFamilyMetricsWriteLatencyByNameGetParams) (*ColumnFamilyMetricsWriteLatencyByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsWriteLatencyByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsWriteLatencyByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/write_latency/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsWriteLatencyByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsWriteLatencyByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsWriteLatencyByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGet gets write latency estimated histogram + +Get write latency +*/ +func (a *Client) ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGet(params *ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams) (*ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/write_latency/estimated_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsWriteLatencyEstimatedHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGet gets write latency estimated recent histogram + +Get write latency +*/ +func (a *Client) ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGet(params *ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams) (*ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/write_latency/estimated_recent_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsWriteLatencyEstimatedRecentHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsWriteLatencyGet gets all write latency + +Get all write latency +*/ +func (a *Client) ColumnFamilyMetricsWriteLatencyGet(params *ColumnFamilyMetricsWriteLatencyGetParams) (*ColumnFamilyMetricsWriteLatencyGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsWriteLatencyGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsWriteLatencyGet", + Method: "GET", + PathPattern: "/column_family/metrics/write_latency", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsWriteLatencyGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsWriteLatencyGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsWriteLatencyGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsWriteLatencyHistogramByNameGet gets write latency histogram depricated + +Get write latency histogram +*/ +func (a *Client) ColumnFamilyMetricsWriteLatencyHistogramByNameGet(params *ColumnFamilyMetricsWriteLatencyHistogramByNameGetParams) (*ColumnFamilyMetricsWriteLatencyHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsWriteLatencyHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsWriteLatencyHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/write_latency/histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsWriteLatencyHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsWriteLatencyHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsWriteLatencyHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsWriteLatencyHistogramGet gets all write latency histogram depricated + +Get write latency histogram of all column family +*/ +func (a *Client) ColumnFamilyMetricsWriteLatencyHistogramGet(params *ColumnFamilyMetricsWriteLatencyHistogramGetParams) (*ColumnFamilyMetricsWriteLatencyHistogramGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsWriteLatencyHistogramGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsWriteLatencyHistogramGet", + Method: "GET", + PathPattern: "/column_family/metrics/write_latency/histogram/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsWriteLatencyHistogramGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsWriteLatencyHistogramGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsWriteLatencyHistogramGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGet gets write latency histogram + +Get write latency moving average histogram +*/ +func (a *Client) ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGet(params *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams) (*ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGet", + Method: "GET", + PathPattern: "/column_family/metrics/write_latency/moving_average_histogram/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsWriteLatencyMovingAverageHistogramByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGet gets all write latency histogram + +Get write latency moving average histogram of all column family +*/ +func (a *Client) ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGet(params *ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams) (*ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGet", + Method: "GET", + PathPattern: "/column_family/metrics/write_latency/moving_average_histogram/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMetricsWriteLatencyMovingAverageHistogramGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMinimumCompactionByNameGet gets minimum compaction threshold + +get the minimum number of sstables in queue before compaction kicks off +*/ +func (a *Client) ColumnFamilyMinimumCompactionByNameGet(params *ColumnFamilyMinimumCompactionByNameGetParams) (*ColumnFamilyMinimumCompactionByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMinimumCompactionByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMinimumCompactionByNameGet", + Method: "GET", + PathPattern: "/column_family/minimum_compaction/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMinimumCompactionByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMinimumCompactionByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMinimumCompactionByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyMinimumCompactionByNamePost sets minimum compaction threshold + +Sets the minimum number of sstables in queue before compaction kicks off +*/ +func (a *Client) ColumnFamilyMinimumCompactionByNamePost(params *ColumnFamilyMinimumCompactionByNamePostParams) (*ColumnFamilyMinimumCompactionByNamePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyMinimumCompactionByNamePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyMinimumCompactionByNamePost", + Method: "POST", + PathPattern: "/column_family/minimum_compaction/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyMinimumCompactionByNamePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyMinimumCompactionByNamePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyMinimumCompactionByNamePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyNameGet gets column family name + +Get a list of all column family names +*/ +func (a *Client) ColumnFamilyNameGet(params *ColumnFamilyNameGetParams) (*ColumnFamilyNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyNameGet", + Method: "GET", + PathPattern: "/column_family/name", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilyNameKeyspaceGet gets column family name keyspace + +Get a list of the key space names +*/ +func (a *Client) ColumnFamilyNameKeyspaceGet(params *ColumnFamilyNameKeyspaceGetParams) (*ColumnFamilyNameKeyspaceGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilyNameKeyspaceGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilyNameKeyspaceGet", + Method: "GET", + PathPattern: "/column_family/name/keyspace", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilyNameKeyspaceGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilyNameKeyspaceGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilyNameKeyspaceGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilySstablesByKeyByNameGet gets sstables for key + +Returns a list of sstable filenames that contain the given partition key on this node +*/ +func (a *Client) ColumnFamilySstablesByKeyByNameGet(params *ColumnFamilySstablesByKeyByNameGetParams) (*ColumnFamilySstablesByKeyByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilySstablesByKeyByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilySstablesByKeyByNameGet", + Method: "GET", + PathPattern: "/column_family/sstables/by_key/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilySstablesByKeyByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilySstablesByKeyByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilySstablesByKeyByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilySstablesPerLevelByNameGet gets sstable count per level + +sstable count for each level. empty unless leveled compaction is used +*/ +func (a *Client) ColumnFamilySstablesPerLevelByNameGet(params *ColumnFamilySstablesPerLevelByNameGetParams) (*ColumnFamilySstablesPerLevelByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilySstablesPerLevelByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilySstablesPerLevelByNameGet", + Method: "GET", + PathPattern: "/column_family/sstables/per_level/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilySstablesPerLevelByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilySstablesPerLevelByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilySstablesPerLevelByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ColumnFamilySstablesUnleveledByNameGet gets unleveled sstables + +the number of SSTables in L0. Always return 0 if Leveled compaction is not enabled. +*/ +func (a *Client) ColumnFamilySstablesUnleveledByNameGet(params *ColumnFamilySstablesUnleveledByNameGetParams) (*ColumnFamilySstablesUnleveledByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewColumnFamilySstablesUnleveledByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ColumnFamilySstablesUnleveledByNameGet", + Method: "GET", + PathPattern: "/column_family/sstables/unleveled/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ColumnFamilySstablesUnleveledByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ColumnFamilySstablesUnleveledByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ColumnFamilySstablesUnleveledByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CommitLogMetricsWaitingOnCommitGet gets waiting on commit + +Get waiting on commit +*/ +func (a *Client) CommitLogMetricsWaitingOnCommitGet(params *CommitLogMetricsWaitingOnCommitGetParams) (*CommitLogMetricsWaitingOnCommitGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCommitLogMetricsWaitingOnCommitGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CommitLogMetricsWaitingOnCommitGet", + Method: "GET", + PathPattern: "/commit_log/metrics/waiting_on_commit", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CommitLogMetricsWaitingOnCommitGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CommitLogMetricsWaitingOnCommitGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CommitLogMetricsWaitingOnCommitGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CommitLogMetricsWaitingOnSegmentAllocationGet gets waiting on segment allocation + +Get waiting on segment allocation +*/ +func (a *Client) CommitLogMetricsWaitingOnSegmentAllocationGet(params *CommitLogMetricsWaitingOnSegmentAllocationGetParams) (*CommitLogMetricsWaitingOnSegmentAllocationGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCommitLogMetricsWaitingOnSegmentAllocationGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CommitLogMetricsWaitingOnSegmentAllocationGet", + Method: "GET", + PathPattern: "/commit_log/metrics/waiting_on_segment_allocation", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CommitLogMetricsWaitingOnSegmentAllocationGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CommitLogMetricsWaitingOnSegmentAllocationGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CommitLogMetricsWaitingOnSegmentAllocationGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CommitlogMetricsCompletedTasksGet gets completed tasks + +Get completed tasks +*/ +func (a *Client) CommitlogMetricsCompletedTasksGet(params *CommitlogMetricsCompletedTasksGetParams) (*CommitlogMetricsCompletedTasksGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCommitlogMetricsCompletedTasksGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CommitlogMetricsCompletedTasksGet", + Method: "GET", + PathPattern: "/commitlog/metrics/completed_tasks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CommitlogMetricsCompletedTasksGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CommitlogMetricsCompletedTasksGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CommitlogMetricsCompletedTasksGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CommitlogMetricsPendingTasksGet gets pending tasks + +Get pending tasks +*/ +func (a *Client) CommitlogMetricsPendingTasksGet(params *CommitlogMetricsPendingTasksGetParams) (*CommitlogMetricsPendingTasksGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCommitlogMetricsPendingTasksGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CommitlogMetricsPendingTasksGet", + Method: "GET", + PathPattern: "/commitlog/metrics/pending_tasks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CommitlogMetricsPendingTasksGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CommitlogMetricsPendingTasksGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CommitlogMetricsPendingTasksGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CommitlogMetricsTotalCommitLogSizeGet gets total commit log size + +Get total commit log size +*/ +func (a *Client) CommitlogMetricsTotalCommitLogSizeGet(params *CommitlogMetricsTotalCommitLogSizeGetParams) (*CommitlogMetricsTotalCommitLogSizeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCommitlogMetricsTotalCommitLogSizeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CommitlogMetricsTotalCommitLogSizeGet", + Method: "GET", + PathPattern: "/commitlog/metrics/total_commit_log_size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CommitlogMetricsTotalCommitLogSizeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CommitlogMetricsTotalCommitLogSizeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CommitlogMetricsTotalCommitLogSizeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CommitlogRecoverByPathPost commitlogs recover + +Recover a single file +*/ +func (a *Client) CommitlogRecoverByPathPost(params *CommitlogRecoverByPathPostParams) (*CommitlogRecoverByPathPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCommitlogRecoverByPathPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CommitlogRecoverByPathPost", + Method: "POST", + PathPattern: "/commitlog/recover/{path}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CommitlogRecoverByPathPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CommitlogRecoverByPathPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CommitlogRecoverByPathPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CommitlogSegmentsActiveGet gets active segment names + +file names (not full paths) of active commit log segments (segments containing unflushed data) +*/ +func (a *Client) CommitlogSegmentsActiveGet(params *CommitlogSegmentsActiveGetParams) (*CommitlogSegmentsActiveGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCommitlogSegmentsActiveGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CommitlogSegmentsActiveGet", + Method: "GET", + PathPattern: "/commitlog/segments/active", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CommitlogSegmentsActiveGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CommitlogSegmentsActiveGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CommitlogSegmentsActiveGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CommitlogSegmentsArchivingGet gets archiving segment names + +Returns files which are pending for archival attempt. Does NOT include failed archive attempts +*/ +func (a *Client) CommitlogSegmentsArchivingGet(params *CommitlogSegmentsArchivingGetParams) (*CommitlogSegmentsArchivingGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCommitlogSegmentsArchivingGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CommitlogSegmentsArchivingGet", + Method: "GET", + PathPattern: "/commitlog/segments/archiving", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CommitlogSegmentsArchivingGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CommitlogSegmentsArchivingGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CommitlogSegmentsArchivingGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CompactionManagerCompactionHistoryGet gets compaction history + +get List of the compaction history +*/ +func (a *Client) CompactionManagerCompactionHistoryGet(params *CompactionManagerCompactionHistoryGetParams) (*CompactionManagerCompactionHistoryGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCompactionManagerCompactionHistoryGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CompactionManagerCompactionHistoryGet", + Method: "GET", + PathPattern: "/compaction_manager/compaction_history", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CompactionManagerCompactionHistoryGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CompactionManagerCompactionHistoryGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CompactionManagerCompactionHistoryGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CompactionManagerCompactionInfoGet gets compaction info + +get a list of all active compaction info +*/ +func (a *Client) CompactionManagerCompactionInfoGet(params *CompactionManagerCompactionInfoGetParams) (*CompactionManagerCompactionInfoGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCompactionManagerCompactionInfoGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CompactionManagerCompactionInfoGet", + Method: "GET", + PathPattern: "/compaction_manager/compaction_info", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CompactionManagerCompactionInfoGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CompactionManagerCompactionInfoGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CompactionManagerCompactionInfoGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CompactionManagerCompactionsGet gets compactions + +get List of running compactions +*/ +func (a *Client) CompactionManagerCompactionsGet(params *CompactionManagerCompactionsGetParams) (*CompactionManagerCompactionsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCompactionManagerCompactionsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CompactionManagerCompactionsGet", + Method: "GET", + PathPattern: "/compaction_manager/compactions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CompactionManagerCompactionsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CompactionManagerCompactionsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CompactionManagerCompactionsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CompactionManagerForceUserDefinedCompactionPost forces user defined compaction + +Triggers the compaction of user specified sstables. You can specify files from various keyspaces and columnfamilies. If you do so, user defined compaction is performed several times to the groups of files in the same keyspace/columnfamily. must contain keyspace and columnfamily name in path(for 2.1+) or file name itself. +*/ +func (a *Client) CompactionManagerForceUserDefinedCompactionPost(params *CompactionManagerForceUserDefinedCompactionPostParams) (*CompactionManagerForceUserDefinedCompactionPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCompactionManagerForceUserDefinedCompactionPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CompactionManagerForceUserDefinedCompactionPost", + Method: "POST", + PathPattern: "/compaction_manager/force_user_defined_compaction", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CompactionManagerForceUserDefinedCompactionPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CompactionManagerForceUserDefinedCompactionPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CompactionManagerForceUserDefinedCompactionPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CompactionManagerMetricsBytesCompactedGet gets bytes compacted + +Get bytes compacted +*/ +func (a *Client) CompactionManagerMetricsBytesCompactedGet(params *CompactionManagerMetricsBytesCompactedGetParams) (*CompactionManagerMetricsBytesCompactedGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCompactionManagerMetricsBytesCompactedGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CompactionManagerMetricsBytesCompactedGet", + Method: "GET", + PathPattern: "/compaction_manager/metrics/bytes_compacted", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CompactionManagerMetricsBytesCompactedGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CompactionManagerMetricsBytesCompactedGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CompactionManagerMetricsBytesCompactedGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CompactionManagerMetricsCompletedTasksGet gets completed tasks1 + +Get completed tasks +*/ +func (a *Client) CompactionManagerMetricsCompletedTasksGet(params *CompactionManagerMetricsCompletedTasksGetParams) (*CompactionManagerMetricsCompletedTasksGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCompactionManagerMetricsCompletedTasksGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CompactionManagerMetricsCompletedTasksGet", + Method: "GET", + PathPattern: "/compaction_manager/metrics/completed_tasks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CompactionManagerMetricsCompletedTasksGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CompactionManagerMetricsCompletedTasksGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CompactionManagerMetricsCompletedTasksGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CompactionManagerMetricsPendingTasksGet gets pending tasks1 + +Get pending tasks +*/ +func (a *Client) CompactionManagerMetricsPendingTasksGet(params *CompactionManagerMetricsPendingTasksGetParams) (*CompactionManagerMetricsPendingTasksGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCompactionManagerMetricsPendingTasksGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CompactionManagerMetricsPendingTasksGet", + Method: "GET", + PathPattern: "/compaction_manager/metrics/pending_tasks", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CompactionManagerMetricsPendingTasksGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CompactionManagerMetricsPendingTasksGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CompactionManagerMetricsPendingTasksGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CompactionManagerMetricsTotalCompactionsCompletedGet gets total compactions completed + +Get total compactions completed +*/ +func (a *Client) CompactionManagerMetricsTotalCompactionsCompletedGet(params *CompactionManagerMetricsTotalCompactionsCompletedGetParams) (*CompactionManagerMetricsTotalCompactionsCompletedGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCompactionManagerMetricsTotalCompactionsCompletedGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CompactionManagerMetricsTotalCompactionsCompletedGet", + Method: "GET", + PathPattern: "/compaction_manager/metrics/total_compactions_completed", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CompactionManagerMetricsTotalCompactionsCompletedGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CompactionManagerMetricsTotalCompactionsCompletedGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CompactionManagerMetricsTotalCompactionsCompletedGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CompactionManagerStopCompactionPost stops compaction + +Stop all running compaction-like tasks having the provided type +*/ +func (a *Client) CompactionManagerStopCompactionPost(params *CompactionManagerStopCompactionPostParams) (*CompactionManagerStopCompactionPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCompactionManagerStopCompactionPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "CompactionManagerStopCompactionPost", + Method: "POST", + PathPattern: "/compaction_manager/stop_compaction", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CompactionManagerStopCompactionPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*CompactionManagerStopCompactionPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CompactionManagerStopCompactionPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FailureDetectorCountEndpointDownGet gets down endpoint count + +Get count down endpoint +*/ +func (a *Client) FailureDetectorCountEndpointDownGet(params *FailureDetectorCountEndpointDownGetParams) (*FailureDetectorCountEndpointDownGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFailureDetectorCountEndpointDownGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "FailureDetectorCountEndpointDownGet", + Method: "GET", + PathPattern: "/failure_detector/count/endpoint/down", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FailureDetectorCountEndpointDownGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FailureDetectorCountEndpointDownGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FailureDetectorCountEndpointDownGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FailureDetectorCountEndpointUpGet gets up endpoint count + +Get count up endpoint +*/ +func (a *Client) FailureDetectorCountEndpointUpGet(params *FailureDetectorCountEndpointUpGetParams) (*FailureDetectorCountEndpointUpGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFailureDetectorCountEndpointUpGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "FailureDetectorCountEndpointUpGet", + Method: "GET", + PathPattern: "/failure_detector/count/endpoint/up", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FailureDetectorCountEndpointUpGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FailureDetectorCountEndpointUpGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FailureDetectorCountEndpointUpGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FailureDetectorEndpointPhiValuesGet gets endpoint phi values + +Get end point phi values +*/ +func (a *Client) FailureDetectorEndpointPhiValuesGet(params *FailureDetectorEndpointPhiValuesGetParams) (*FailureDetectorEndpointPhiValuesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFailureDetectorEndpointPhiValuesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "FailureDetectorEndpointPhiValuesGet", + Method: "GET", + PathPattern: "/failure_detector/endpoint_phi_values", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FailureDetectorEndpointPhiValuesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FailureDetectorEndpointPhiValuesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FailureDetectorEndpointPhiValuesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FailureDetectorEndpointsGet gets all endpoint states + +Get all endpoint states +*/ +func (a *Client) FailureDetectorEndpointsGet(params *FailureDetectorEndpointsGetParams) (*FailureDetectorEndpointsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFailureDetectorEndpointsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "FailureDetectorEndpointsGet", + Method: "GET", + PathPattern: "/failure_detector/endpoints/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FailureDetectorEndpointsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FailureDetectorEndpointsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FailureDetectorEndpointsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FailureDetectorEndpointsStatesByAddrGet gets endpoint state + +Get endpoint states +*/ +func (a *Client) FailureDetectorEndpointsStatesByAddrGet(params *FailureDetectorEndpointsStatesByAddrGetParams) (*FailureDetectorEndpointsStatesByAddrGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFailureDetectorEndpointsStatesByAddrGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "FailureDetectorEndpointsStatesByAddrGet", + Method: "GET", + PathPattern: "/failure_detector/endpoints/states/{addr}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FailureDetectorEndpointsStatesByAddrGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FailureDetectorEndpointsStatesByAddrGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FailureDetectorEndpointsStatesByAddrGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FailureDetectorPhiGet gets phi convict threshold + +Get the phi convict threshold +*/ +func (a *Client) FailureDetectorPhiGet(params *FailureDetectorPhiGetParams) (*FailureDetectorPhiGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFailureDetectorPhiGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "FailureDetectorPhiGet", + Method: "GET", + PathPattern: "/failure_detector/phi", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FailureDetectorPhiGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FailureDetectorPhiGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FailureDetectorPhiGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FailureDetectorPhiPost sets phi convict threshold + +Set the phi convict threshold +*/ +func (a *Client) FailureDetectorPhiPost(params *FailureDetectorPhiPostParams) (*FailureDetectorPhiPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFailureDetectorPhiPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "FailureDetectorPhiPost", + Method: "POST", + PathPattern: "/failure_detector/phi", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FailureDetectorPhiPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FailureDetectorPhiPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FailureDetectorPhiPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FailureDetectorSimpleStatesGet gets simple states + +Get simple_states +*/ +func (a *Client) FailureDetectorSimpleStatesGet(params *FailureDetectorSimpleStatesGetParams) (*FailureDetectorSimpleStatesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFailureDetectorSimpleStatesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "FailureDetectorSimpleStatesGet", + Method: "GET", + PathPattern: "/failure_detector/simple_states", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FailureDetectorSimpleStatesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FailureDetectorSimpleStatesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FailureDetectorSimpleStatesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GossiperAssassinateByAddrPost assassinates endpoint + +Assassinate an end point +*/ +func (a *Client) GossiperAssassinateByAddrPost(params *GossiperAssassinateByAddrPostParams) (*GossiperAssassinateByAddrPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGossiperAssassinateByAddrPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GossiperAssassinateByAddrPost", + Method: "POST", + PathPattern: "/gossiper/assassinate/{addr}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GossiperAssassinateByAddrPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GossiperAssassinateByAddrPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GossiperAssassinateByAddrPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GossiperDowntimeByAddrGet gets endpoint downtime + +Get the downtime of an end point +*/ +func (a *Client) GossiperDowntimeByAddrGet(params *GossiperDowntimeByAddrGetParams) (*GossiperDowntimeByAddrGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGossiperDowntimeByAddrGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GossiperDowntimeByAddrGet", + Method: "GET", + PathPattern: "/gossiper/downtime/{addr}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GossiperDowntimeByAddrGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GossiperDowntimeByAddrGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GossiperDowntimeByAddrGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GossiperEndpointDownGet gets down endpoint + +Get the addreses of the down endpoints +*/ +func (a *Client) GossiperEndpointDownGet(params *GossiperEndpointDownGetParams) (*GossiperEndpointDownGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGossiperEndpointDownGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GossiperEndpointDownGet", + Method: "GET", + PathPattern: "/gossiper/endpoint/down/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GossiperEndpointDownGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GossiperEndpointDownGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GossiperEndpointDownGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GossiperEndpointLiveGet gets live endpoint + +Get the addreses of live endpoints +*/ +func (a *Client) GossiperEndpointLiveGet(params *GossiperEndpointLiveGetParams) (*GossiperEndpointLiveGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGossiperEndpointLiveGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GossiperEndpointLiveGet", + Method: "GET", + PathPattern: "/gossiper/endpoint/live/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GossiperEndpointLiveGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GossiperEndpointLiveGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GossiperEndpointLiveGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GossiperGenerationNumberByAddrGet gets current generation number + +Returns files which are pending for archival attempt. Does NOT include failed archive attempts +*/ +func (a *Client) GossiperGenerationNumberByAddrGet(params *GossiperGenerationNumberByAddrGetParams) (*GossiperGenerationNumberByAddrGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGossiperGenerationNumberByAddrGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GossiperGenerationNumberByAddrGet", + Method: "GET", + PathPattern: "/gossiper/generation_number/{addr}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GossiperGenerationNumberByAddrGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GossiperGenerationNumberByAddrGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GossiperGenerationNumberByAddrGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GossiperHeartBeatVersionByAddrGet gets current heart beat version + +Get heart beat version for a node +*/ +func (a *Client) GossiperHeartBeatVersionByAddrGet(params *GossiperHeartBeatVersionByAddrGetParams) (*GossiperHeartBeatVersionByAddrGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGossiperHeartBeatVersionByAddrGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GossiperHeartBeatVersionByAddrGet", + Method: "GET", + PathPattern: "/gossiper/heart_beat_version/{addr}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GossiperHeartBeatVersionByAddrGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GossiperHeartBeatVersionByAddrGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GossiperHeartBeatVersionByAddrGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +HintedHandoffHintsDelete truncates all hints + +Truncate all the hints +*/ +func (a *Client) HintedHandoffHintsDelete(params *HintedHandoffHintsDeleteParams) (*HintedHandoffHintsDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewHintedHandoffHintsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "HintedHandoffHintsDelete", + Method: "DELETE", + PathPattern: "/hinted_handoff/hints", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &HintedHandoffHintsDeleteReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*HintedHandoffHintsDeleteOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*HintedHandoffHintsDeleteDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +HintedHandoffHintsGet lists endpoints pending hints + +List all the endpoints that this node has hints for. +*/ +func (a *Client) HintedHandoffHintsGet(params *HintedHandoffHintsGetParams) (*HintedHandoffHintsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewHintedHandoffHintsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "HintedHandoffHintsGet", + Method: "GET", + PathPattern: "/hinted_handoff/hints", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &HintedHandoffHintsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*HintedHandoffHintsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*HintedHandoffHintsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +HintedHandoffMetricsCreateHintByAddrGet gets create hint count + +Get create hint count +*/ +func (a *Client) HintedHandoffMetricsCreateHintByAddrGet(params *HintedHandoffMetricsCreateHintByAddrGetParams) (*HintedHandoffMetricsCreateHintByAddrGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewHintedHandoffMetricsCreateHintByAddrGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "HintedHandoffMetricsCreateHintByAddrGet", + Method: "GET", + PathPattern: "/hinted_handoff/metrics/create_hint/{addr}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &HintedHandoffMetricsCreateHintByAddrGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*HintedHandoffMetricsCreateHintByAddrGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*HintedHandoffMetricsCreateHintByAddrGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +HintedHandoffMetricsNotStoredHintsByAddrGet gets not stored hints count + +Get not stored hints count +*/ +func (a *Client) HintedHandoffMetricsNotStoredHintsByAddrGet(params *HintedHandoffMetricsNotStoredHintsByAddrGetParams) (*HintedHandoffMetricsNotStoredHintsByAddrGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewHintedHandoffMetricsNotStoredHintsByAddrGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "HintedHandoffMetricsNotStoredHintsByAddrGet", + Method: "GET", + PathPattern: "/hinted_handoff/metrics/not_stored_hints/{addr}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &HintedHandoffMetricsNotStoredHintsByAddrGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*HintedHandoffMetricsNotStoredHintsByAddrGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*HintedHandoffMetricsNotStoredHintsByAddrGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +HintedHandoffPausePost pauses hints delivery + +pause hints delivery +*/ +func (a *Client) HintedHandoffPausePost(params *HintedHandoffPausePostParams) (*HintedHandoffPausePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewHintedHandoffPausePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "HintedHandoffPausePost", + Method: "POST", + PathPattern: "/hinted_handoff/pause", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &HintedHandoffPausePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*HintedHandoffPausePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*HintedHandoffPausePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +HintedHandoffSchedulePost schedules hint delivery + +force hint delivery to an endpoint +*/ +func (a *Client) HintedHandoffSchedulePost(params *HintedHandoffSchedulePostParams) (*HintedHandoffSchedulePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewHintedHandoffSchedulePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "HintedHandoffSchedulePost", + Method: "POST", + PathPattern: "/hinted_handoff/schedule", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &HintedHandoffSchedulePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*HintedHandoffSchedulePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*HintedHandoffSchedulePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +LsaCompactPost lsas compact + +Force compaction of all regions +*/ +func (a *Client) LsaCompactPost(params *LsaCompactPostParams) (*LsaCompactPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewLsaCompactPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "LsaCompactPost", + Method: "POST", + PathPattern: "/lsa/compact", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &LsaCompactPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*LsaCompactPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*LsaCompactPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +MessagingServiceMessagesDroppedByVerGet gets dropped messages by ver + +Get the number of dropped messages per verb +*/ +func (a *Client) MessagingServiceMessagesDroppedByVerGet(params *MessagingServiceMessagesDroppedByVerGetParams) (*MessagingServiceMessagesDroppedByVerGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMessagingServiceMessagesDroppedByVerGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "MessagingServiceMessagesDroppedByVerGet", + Method: "GET", + PathPattern: "/messaging_service/messages/dropped_by_ver", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &MessagingServiceMessagesDroppedByVerGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*MessagingServiceMessagesDroppedByVerGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*MessagingServiceMessagesDroppedByVerGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +MessagingServiceMessagesDroppedGet gets dropped messages + +Get the number of messages that were dropped before sending +*/ +func (a *Client) MessagingServiceMessagesDroppedGet(params *MessagingServiceMessagesDroppedGetParams) (*MessagingServiceMessagesDroppedGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMessagingServiceMessagesDroppedGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "MessagingServiceMessagesDroppedGet", + Method: "GET", + PathPattern: "/messaging_service/messages/dropped", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &MessagingServiceMessagesDroppedGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*MessagingServiceMessagesDroppedGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*MessagingServiceMessagesDroppedGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +MessagingServiceMessagesExceptionGet gets exception messages + +Get the number of messages return with an exception +*/ +func (a *Client) MessagingServiceMessagesExceptionGet(params *MessagingServiceMessagesExceptionGetParams) (*MessagingServiceMessagesExceptionGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMessagingServiceMessagesExceptionGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "MessagingServiceMessagesExceptionGet", + Method: "GET", + PathPattern: "/messaging_service/messages/exception", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &MessagingServiceMessagesExceptionGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*MessagingServiceMessagesExceptionGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*MessagingServiceMessagesExceptionGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +MessagingServiceMessagesPendingGet gets pending messages + +Get the number of pending messages +*/ +func (a *Client) MessagingServiceMessagesPendingGet(params *MessagingServiceMessagesPendingGetParams) (*MessagingServiceMessagesPendingGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMessagingServiceMessagesPendingGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "MessagingServiceMessagesPendingGet", + Method: "GET", + PathPattern: "/messaging_service/messages/pending", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &MessagingServiceMessagesPendingGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*MessagingServiceMessagesPendingGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*MessagingServiceMessagesPendingGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +MessagingServiceMessagesRepliedGet gets completed messages + +Get the number of replied messages +*/ +func (a *Client) MessagingServiceMessagesRepliedGet(params *MessagingServiceMessagesRepliedGetParams) (*MessagingServiceMessagesRepliedGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMessagingServiceMessagesRepliedGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "MessagingServiceMessagesRepliedGet", + Method: "GET", + PathPattern: "/messaging_service/messages/replied", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &MessagingServiceMessagesRepliedGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*MessagingServiceMessagesRepliedGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*MessagingServiceMessagesRepliedGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +MessagingServiceMessagesRespondCompletedGet gets respond completed messages + +Get the number of completed respond messages +*/ +func (a *Client) MessagingServiceMessagesRespondCompletedGet(params *MessagingServiceMessagesRespondCompletedGetParams) (*MessagingServiceMessagesRespondCompletedGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMessagingServiceMessagesRespondCompletedGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "MessagingServiceMessagesRespondCompletedGet", + Method: "GET", + PathPattern: "/messaging_service/messages/respond_completed", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &MessagingServiceMessagesRespondCompletedGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*MessagingServiceMessagesRespondCompletedGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*MessagingServiceMessagesRespondCompletedGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +MessagingServiceMessagesRespondPendingGet gets respond pending messages + +Get the number of messages waiting for respond +*/ +func (a *Client) MessagingServiceMessagesRespondPendingGet(params *MessagingServiceMessagesRespondPendingGetParams) (*MessagingServiceMessagesRespondPendingGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMessagingServiceMessagesRespondPendingGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "MessagingServiceMessagesRespondPendingGet", + Method: "GET", + PathPattern: "/messaging_service/messages/respond_pending", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &MessagingServiceMessagesRespondPendingGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*MessagingServiceMessagesRespondPendingGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*MessagingServiceMessagesRespondPendingGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +MessagingServiceMessagesSentGet gets sent messages + +Get the number of sent messages +*/ +func (a *Client) MessagingServiceMessagesSentGet(params *MessagingServiceMessagesSentGetParams) (*MessagingServiceMessagesSentGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMessagingServiceMessagesSentGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "MessagingServiceMessagesSentGet", + Method: "GET", + PathPattern: "/messaging_service/messages/sent", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &MessagingServiceMessagesSentGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*MessagingServiceMessagesSentGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*MessagingServiceMessagesSentGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +MessagingServiceMessagesTimeoutGet gets timeout messages + +Get the number of timeout messages +*/ +func (a *Client) MessagingServiceMessagesTimeoutGet(params *MessagingServiceMessagesTimeoutGetParams) (*MessagingServiceMessagesTimeoutGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMessagingServiceMessagesTimeoutGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "MessagingServiceMessagesTimeoutGet", + Method: "GET", + PathPattern: "/messaging_service/messages/timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &MessagingServiceMessagesTimeoutGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*MessagingServiceMessagesTimeoutGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*MessagingServiceMessagesTimeoutGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +MessagingServiceVersionGet gets version + +Get the version number +*/ +func (a *Client) MessagingServiceVersionGet(params *MessagingServiceVersionGetParams) (*MessagingServiceVersionGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMessagingServiceVersionGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "MessagingServiceVersionGet", + Method: "GET", + PathPattern: "/messaging_service/version", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &MessagingServiceVersionGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*MessagingServiceVersionGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*MessagingServiceVersionGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +SnitchDatacenterGet gets datacenter + +Provides the Datacenter name depending on the respective snitch used, given the hostname/ip +*/ +func (a *Client) SnitchDatacenterGet(params *SnitchDatacenterGetParams) (*SnitchDatacenterGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSnitchDatacenterGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "SnitchDatacenterGet", + Method: "GET", + PathPattern: "/snitch/datacenter", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SnitchDatacenterGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SnitchDatacenterGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SnitchDatacenterGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +SnitchNameGet gets snitch name + +Provides the snitch name of the cluster +*/ +func (a *Client) SnitchNameGet(params *SnitchNameGetParams) (*SnitchNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSnitchNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "SnitchNameGet", + Method: "GET", + PathPattern: "/snitch/name", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SnitchNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SnitchNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SnitchNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +SnitchRackGet gets rack + +Provides the Rack name depending on the respective snitch used, given the host name/ip +*/ +func (a *Client) SnitchRackGet(params *SnitchRackGetParams) (*SnitchRackGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSnitchRackGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "SnitchRackGet", + Method: "GET", + PathPattern: "/snitch/rack", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SnitchRackGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SnitchRackGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SnitchRackGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyCasContentionTimeoutGet gets cas contention timeout + +Get CAS contention timeout in seconds +*/ +func (a *Client) StorageProxyCasContentionTimeoutGet(params *StorageProxyCasContentionTimeoutGetParams) (*StorageProxyCasContentionTimeoutGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyCasContentionTimeoutGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyCasContentionTimeoutGet", + Method: "GET", + PathPattern: "/storage_proxy/cas_contention_timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyCasContentionTimeoutGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyCasContentionTimeoutGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyCasContentionTimeoutGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyCasContentionTimeoutPost sets cas contention timeout + +Set CAS contention timeout +*/ +func (a *Client) StorageProxyCasContentionTimeoutPost(params *StorageProxyCasContentionTimeoutPostParams) (*StorageProxyCasContentionTimeoutPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyCasContentionTimeoutPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyCasContentionTimeoutPost", + Method: "POST", + PathPattern: "/storage_proxy/cas_contention_timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyCasContentionTimeoutPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyCasContentionTimeoutPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyCasContentionTimeoutPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyCounterWriteRPCTimeoutGet gets counter write rpc timeout + +Get counter write rpc timeout in seconds +*/ +func (a *Client) StorageProxyCounterWriteRPCTimeoutGet(params *StorageProxyCounterWriteRPCTimeoutGetParams) (*StorageProxyCounterWriteRPCTimeoutGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyCounterWriteRPCTimeoutGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyCounterWriteRpcTimeoutGet", + Method: "GET", + PathPattern: "/storage_proxy/counter_write_rpc_timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyCounterWriteRPCTimeoutGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyCounterWriteRPCTimeoutGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyCounterWriteRPCTimeoutGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyCounterWriteRPCTimeoutPost sets counter write rpc timeout + +Set counter write rpc timeout +*/ +func (a *Client) StorageProxyCounterWriteRPCTimeoutPost(params *StorageProxyCounterWriteRPCTimeoutPostParams) (*StorageProxyCounterWriteRPCTimeoutPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyCounterWriteRPCTimeoutPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyCounterWriteRpcTimeoutPost", + Method: "POST", + PathPattern: "/storage_proxy/counter_write_rpc_timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyCounterWriteRPCTimeoutPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyCounterWriteRPCTimeoutPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyCounterWriteRPCTimeoutPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyHintedHandoffEnabledByDcGet gets hinted handoff enabled by dc + +Get the hinted handoff enabled by dc +*/ +func (a *Client) StorageProxyHintedHandoffEnabledByDcGet(params *StorageProxyHintedHandoffEnabledByDcGetParams) (*StorageProxyHintedHandoffEnabledByDcGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyHintedHandoffEnabledByDcGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyHintedHandoffEnabledByDcGet", + Method: "GET", + PathPattern: "/storage_proxy/hinted_handoff_enabled_by_dc", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyHintedHandoffEnabledByDcGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyHintedHandoffEnabledByDcGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyHintedHandoffEnabledByDcGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyHintedHandoffEnabledByDcPost sets hinted handoff enabled by dc list + +Set the hinted handoff enabled by dc +*/ +func (a *Client) StorageProxyHintedHandoffEnabledByDcPost(params *StorageProxyHintedHandoffEnabledByDcPostParams) (*StorageProxyHintedHandoffEnabledByDcPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyHintedHandoffEnabledByDcPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyHintedHandoffEnabledByDcPost", + Method: "POST", + PathPattern: "/storage_proxy/hinted_handoff_enabled_by_dc", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyHintedHandoffEnabledByDcPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyHintedHandoffEnabledByDcPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyHintedHandoffEnabledByDcPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyHintedHandoffEnabledGet gets hinted handoff enabled + +Return true if hinted handoff enabled +*/ +func (a *Client) StorageProxyHintedHandoffEnabledGet(params *StorageProxyHintedHandoffEnabledGetParams) (*StorageProxyHintedHandoffEnabledGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyHintedHandoffEnabledGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyHintedHandoffEnabledGet", + Method: "GET", + PathPattern: "/storage_proxy/hinted_handoff_enabled", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyHintedHandoffEnabledGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyHintedHandoffEnabledGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyHintedHandoffEnabledGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyHintedHandoffEnabledPost sets hinted handoff enabled + +Set hinted handoff status +*/ +func (a *Client) StorageProxyHintedHandoffEnabledPost(params *StorageProxyHintedHandoffEnabledPostParams) (*StorageProxyHintedHandoffEnabledPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyHintedHandoffEnabledPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyHintedHandoffEnabledPost", + Method: "POST", + PathPattern: "/storage_proxy/hinted_handoff_enabled", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyHintedHandoffEnabledPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyHintedHandoffEnabledPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyHintedHandoffEnabledPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyHintsInProgressGet gets hints in progress + +get hints in progress +*/ +func (a *Client) StorageProxyHintsInProgressGet(params *StorageProxyHintsInProgressGetParams) (*StorageProxyHintsInProgressGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyHintsInProgressGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyHintsInProgressGet", + Method: "GET", + PathPattern: "/storage_proxy/hints_in_progress", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyHintsInProgressGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyHintsInProgressGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyHintsInProgressGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMaxHintWindowGet gets max hint window + +Get the max hint window +*/ +func (a *Client) StorageProxyMaxHintWindowGet(params *StorageProxyMaxHintWindowGetParams) (*StorageProxyMaxHintWindowGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMaxHintWindowGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMaxHintWindowGet", + Method: "GET", + PathPattern: "/storage_proxy/max_hint_window", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMaxHintWindowGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMaxHintWindowGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMaxHintWindowGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMaxHintWindowPost sets max hint window + +Set the max hint window +*/ +func (a *Client) StorageProxyMaxHintWindowPost(params *StorageProxyMaxHintWindowPostParams) (*StorageProxyMaxHintWindowPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMaxHintWindowPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMaxHintWindowPost", + Method: "POST", + PathPattern: "/storage_proxy/max_hint_window", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMaxHintWindowPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMaxHintWindowPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMaxHintWindowPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMaxHintsInProgressGet gets max hints in progress + +Get max hints in progress +*/ +func (a *Client) StorageProxyMaxHintsInProgressGet(params *StorageProxyMaxHintsInProgressGetParams) (*StorageProxyMaxHintsInProgressGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMaxHintsInProgressGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMaxHintsInProgressGet", + Method: "GET", + PathPattern: "/storage_proxy/max_hints_in_progress", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMaxHintsInProgressGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMaxHintsInProgressGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMaxHintsInProgressGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMaxHintsInProgressPost sets max hints in progress + +Set max hints in progress +*/ +func (a *Client) StorageProxyMaxHintsInProgressPost(params *StorageProxyMaxHintsInProgressPostParams) (*StorageProxyMaxHintsInProgressPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMaxHintsInProgressPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMaxHintsInProgressPost", + Method: "POST", + PathPattern: "/storage_proxy/max_hints_in_progress", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMaxHintsInProgressPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMaxHintsInProgressPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMaxHintsInProgressPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsCasReadConditionNotMetGet gets cas read metrics condition not met + +Get cas read metrics +*/ +func (a *Client) StorageProxyMetricsCasReadConditionNotMetGet(params *StorageProxyMetricsCasReadConditionNotMetGetParams) (*StorageProxyMetricsCasReadConditionNotMetGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsCasReadConditionNotMetGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsCasReadConditionNotMetGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/cas_read/condition_not_met", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsCasReadConditionNotMetGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsCasReadConditionNotMetGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsCasReadConditionNotMetGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsCasReadContentionGet gets cas read metrics contention + +Get cas read metrics +*/ +func (a *Client) StorageProxyMetricsCasReadContentionGet(params *StorageProxyMetricsCasReadContentionGetParams) (*StorageProxyMetricsCasReadContentionGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsCasReadContentionGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsCasReadContentionGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/cas_read/contention", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsCasReadContentionGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsCasReadContentionGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsCasReadContentionGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsCasReadTimeoutsGet gets cas read timeouts + +Get CAS read timeout +*/ +func (a *Client) StorageProxyMetricsCasReadTimeoutsGet(params *StorageProxyMetricsCasReadTimeoutsGetParams) (*StorageProxyMetricsCasReadTimeoutsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsCasReadTimeoutsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsCasReadTimeoutsGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/cas_read/timeouts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsCasReadTimeoutsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsCasReadTimeoutsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsCasReadTimeoutsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsCasReadUnavailablesGet gets cas read unavailables + +Get CAS read unavailables +*/ +func (a *Client) StorageProxyMetricsCasReadUnavailablesGet(params *StorageProxyMetricsCasReadUnavailablesGetParams) (*StorageProxyMetricsCasReadUnavailablesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsCasReadUnavailablesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsCasReadUnavailablesGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/cas_read/unavailables", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsCasReadUnavailablesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsCasReadUnavailablesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsCasReadUnavailablesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsCasReadUnfinishedCommitGet gets cas read metrics unfinished commit + +Get cas read metrics +*/ +func (a *Client) StorageProxyMetricsCasReadUnfinishedCommitGet(params *StorageProxyMetricsCasReadUnfinishedCommitGetParams) (*StorageProxyMetricsCasReadUnfinishedCommitGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsCasReadUnfinishedCommitGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsCasReadUnfinishedCommitGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/cas_read/unfinished_commit", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsCasReadUnfinishedCommitGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsCasReadUnfinishedCommitGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsCasReadUnfinishedCommitGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsCasWriteConditionNotMetGet gets cas write metrics condition not met + +Get cas write metrics +*/ +func (a *Client) StorageProxyMetricsCasWriteConditionNotMetGet(params *StorageProxyMetricsCasWriteConditionNotMetGetParams) (*StorageProxyMetricsCasWriteConditionNotMetGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsCasWriteConditionNotMetGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsCasWriteConditionNotMetGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/cas_write/condition_not_met", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsCasWriteConditionNotMetGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsCasWriteConditionNotMetGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsCasWriteConditionNotMetGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsCasWriteContentionGet gets cas write metrics contention + +Get cas write metrics +*/ +func (a *Client) StorageProxyMetricsCasWriteContentionGet(params *StorageProxyMetricsCasWriteContentionGetParams) (*StorageProxyMetricsCasWriteContentionGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsCasWriteContentionGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsCasWriteContentionGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/cas_write/contention", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsCasWriteContentionGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsCasWriteContentionGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsCasWriteContentionGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsCasWriteTimeoutsGet gets cas write timeouts + +Get CAS write timeout +*/ +func (a *Client) StorageProxyMetricsCasWriteTimeoutsGet(params *StorageProxyMetricsCasWriteTimeoutsGetParams) (*StorageProxyMetricsCasWriteTimeoutsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsCasWriteTimeoutsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsCasWriteTimeoutsGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/cas_write/timeouts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsCasWriteTimeoutsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsCasWriteTimeoutsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsCasWriteTimeoutsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsCasWriteUnavailablesGet gets cas write unavailables + +Get CAS write unavailables +*/ +func (a *Client) StorageProxyMetricsCasWriteUnavailablesGet(params *StorageProxyMetricsCasWriteUnavailablesGetParams) (*StorageProxyMetricsCasWriteUnavailablesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsCasWriteUnavailablesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsCasWriteUnavailablesGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/cas_write/unavailables", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsCasWriteUnavailablesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsCasWriteUnavailablesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsCasWriteUnavailablesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsCasWriteUnfinishedCommitGet gets cas write metrics unfinished commit + +Get cas write metrics +*/ +func (a *Client) StorageProxyMetricsCasWriteUnfinishedCommitGet(params *StorageProxyMetricsCasWriteUnfinishedCommitGetParams) (*StorageProxyMetricsCasWriteUnfinishedCommitGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsCasWriteUnfinishedCommitGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsCasWriteUnfinishedCommitGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/cas_write/unfinished_commit", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsCasWriteUnfinishedCommitGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsCasWriteUnfinishedCommitGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsCasWriteUnfinishedCommitGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsRangeEstimatedHistogramGet gets range estimated histogram + +Get range estimated latency +*/ +func (a *Client) StorageProxyMetricsRangeEstimatedHistogramGet(params *StorageProxyMetricsRangeEstimatedHistogramGetParams) (*StorageProxyMetricsRangeEstimatedHistogramGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsRangeEstimatedHistogramGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsRangeEstimatedHistogramGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/range/estimated_histogram/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsRangeEstimatedHistogramGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsRangeEstimatedHistogramGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsRangeEstimatedHistogramGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsRangeGet gets range latency + +Get range latency +*/ +func (a *Client) StorageProxyMetricsRangeGet(params *StorageProxyMetricsRangeGetParams) (*StorageProxyMetricsRangeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsRangeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsRangeGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/range", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsRangeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsRangeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsRangeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsRangeHistogramGet gets range metrics latency histogram depricated + +Get range metrics +*/ +func (a *Client) StorageProxyMetricsRangeHistogramGet(params *StorageProxyMetricsRangeHistogramGetParams) (*StorageProxyMetricsRangeHistogramGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsRangeHistogramGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsRangeHistogramGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/range/histogram", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsRangeHistogramGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsRangeHistogramGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsRangeHistogramGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsRangeMovingAverageHistogramGet gets range metrics latency histogram + +Get range metrics rate and histogram +*/ +func (a *Client) StorageProxyMetricsRangeMovingAverageHistogramGet(params *StorageProxyMetricsRangeMovingAverageHistogramGetParams) (*StorageProxyMetricsRangeMovingAverageHistogramGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsRangeMovingAverageHistogramGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsRangeMovingAverageHistogramGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/range/moving_average_histogram", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsRangeMovingAverageHistogramGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsRangeMovingAverageHistogramGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsRangeMovingAverageHistogramGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsRangeTimeoutsGet gets range metrics timeouts + +Get range metrics +*/ +func (a *Client) StorageProxyMetricsRangeTimeoutsGet(params *StorageProxyMetricsRangeTimeoutsGetParams) (*StorageProxyMetricsRangeTimeoutsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsRangeTimeoutsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsRangeTimeoutsGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/range/timeouts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsRangeTimeoutsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsRangeTimeoutsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsRangeTimeoutsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsRangeTimeoutsRatesGet gets range metrics timeouts rates + +Get range metrics rates +*/ +func (a *Client) StorageProxyMetricsRangeTimeoutsRatesGet(params *StorageProxyMetricsRangeTimeoutsRatesGetParams) (*StorageProxyMetricsRangeTimeoutsRatesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsRangeTimeoutsRatesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsRangeTimeoutsRatesGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/range/timeouts_rates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsRangeTimeoutsRatesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsRangeTimeoutsRatesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsRangeTimeoutsRatesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsRangeUnavailablesGet gets range metrics unavailables + +Get range metrics +*/ +func (a *Client) StorageProxyMetricsRangeUnavailablesGet(params *StorageProxyMetricsRangeUnavailablesGetParams) (*StorageProxyMetricsRangeUnavailablesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsRangeUnavailablesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsRangeUnavailablesGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/range/unavailables", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsRangeUnavailablesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsRangeUnavailablesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsRangeUnavailablesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsRangeUnavailablesRatesGet gets range metrics unavailables rates + +Get range metrics rates +*/ +func (a *Client) StorageProxyMetricsRangeUnavailablesRatesGet(params *StorageProxyMetricsRangeUnavailablesRatesGetParams) (*StorageProxyMetricsRangeUnavailablesRatesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsRangeUnavailablesRatesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsRangeUnavailablesRatesGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/range/unavailables_rates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsRangeUnavailablesRatesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsRangeUnavailablesRatesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsRangeUnavailablesRatesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsReadEstimatedHistogramGet gets read estimated histogram + +Get read estimated latency +*/ +func (a *Client) StorageProxyMetricsReadEstimatedHistogramGet(params *StorageProxyMetricsReadEstimatedHistogramGetParams) (*StorageProxyMetricsReadEstimatedHistogramGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsReadEstimatedHistogramGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsReadEstimatedHistogramGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/read/estimated_histogram/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsReadEstimatedHistogramGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsReadEstimatedHistogramGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsReadEstimatedHistogramGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsReadGet gets read latency + +Get read latency +*/ +func (a *Client) StorageProxyMetricsReadGet(params *StorageProxyMetricsReadGetParams) (*StorageProxyMetricsReadGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsReadGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsReadGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/read", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsReadGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsReadGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsReadGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsReadHistogramGet gets read metrics latency histogram depricated + +Get read metrics +*/ +func (a *Client) StorageProxyMetricsReadHistogramGet(params *StorageProxyMetricsReadHistogramGetParams) (*StorageProxyMetricsReadHistogramGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsReadHistogramGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsReadHistogramGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/read/histogram", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsReadHistogramGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsReadHistogramGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsReadHistogramGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsReadMovingAverageHistogramGet gets read metrics latency histogram + +Get read metrics +*/ +func (a *Client) StorageProxyMetricsReadMovingAverageHistogramGet(params *StorageProxyMetricsReadMovingAverageHistogramGetParams) (*StorageProxyMetricsReadMovingAverageHistogramGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsReadMovingAverageHistogramGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsReadMovingAverageHistogramGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/read/moving_average_histogram", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsReadMovingAverageHistogramGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsReadMovingAverageHistogramGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsReadMovingAverageHistogramGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsReadTimeoutsGet gets read metrics timeouts + +Get read metrics +*/ +func (a *Client) StorageProxyMetricsReadTimeoutsGet(params *StorageProxyMetricsReadTimeoutsGetParams) (*StorageProxyMetricsReadTimeoutsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsReadTimeoutsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsReadTimeoutsGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/read/timeouts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsReadTimeoutsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsReadTimeoutsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsReadTimeoutsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsReadTimeoutsRatesGet gets read metrics timeouts rates + +Get read metrics rates +*/ +func (a *Client) StorageProxyMetricsReadTimeoutsRatesGet(params *StorageProxyMetricsReadTimeoutsRatesGetParams) (*StorageProxyMetricsReadTimeoutsRatesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsReadTimeoutsRatesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsReadTimeoutsRatesGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/read/timeouts_rates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsReadTimeoutsRatesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsReadTimeoutsRatesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsReadTimeoutsRatesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsReadUnavailablesGet gets read metrics unavailables + +Get read metrics +*/ +func (a *Client) StorageProxyMetricsReadUnavailablesGet(params *StorageProxyMetricsReadUnavailablesGetParams) (*StorageProxyMetricsReadUnavailablesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsReadUnavailablesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsReadUnavailablesGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/read/unavailables", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsReadUnavailablesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsReadUnavailablesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsReadUnavailablesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsReadUnavailablesRatesGet gets read metrics unavailables rates + +Get read metrics rates +*/ +func (a *Client) StorageProxyMetricsReadUnavailablesRatesGet(params *StorageProxyMetricsReadUnavailablesRatesGetParams) (*StorageProxyMetricsReadUnavailablesRatesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsReadUnavailablesRatesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsReadUnavailablesRatesGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/read/unavailables_rates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsReadUnavailablesRatesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsReadUnavailablesRatesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsReadUnavailablesRatesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsWriteEstimatedHistogramGet gets write estimated histogram + +Get write estimated latency +*/ +func (a *Client) StorageProxyMetricsWriteEstimatedHistogramGet(params *StorageProxyMetricsWriteEstimatedHistogramGetParams) (*StorageProxyMetricsWriteEstimatedHistogramGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsWriteEstimatedHistogramGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsWriteEstimatedHistogramGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/write/estimated_histogram/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsWriteEstimatedHistogramGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsWriteEstimatedHistogramGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsWriteEstimatedHistogramGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsWriteGet gets write latency + +Get write latency +*/ +func (a *Client) StorageProxyMetricsWriteGet(params *StorageProxyMetricsWriteGetParams) (*StorageProxyMetricsWriteGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsWriteGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsWriteGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/write", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsWriteGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsWriteGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsWriteGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsWriteHistogramGet gets write metrics latency histogram depricated + +Get write metrics +*/ +func (a *Client) StorageProxyMetricsWriteHistogramGet(params *StorageProxyMetricsWriteHistogramGetParams) (*StorageProxyMetricsWriteHistogramGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsWriteHistogramGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsWriteHistogramGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/write/histogram", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsWriteHistogramGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsWriteHistogramGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsWriteHistogramGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsWriteMovingAverageHistogramGet gets write metrics latency histogram + +Get write metrics +*/ +func (a *Client) StorageProxyMetricsWriteMovingAverageHistogramGet(params *StorageProxyMetricsWriteMovingAverageHistogramGetParams) (*StorageProxyMetricsWriteMovingAverageHistogramGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsWriteMovingAverageHistogramGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsWriteMovingAverageHistogramGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/write/moving_average_histogram", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsWriteMovingAverageHistogramGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsWriteMovingAverageHistogramGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsWriteMovingAverageHistogramGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsWriteTimeoutsGet gets write metrics timeouts + +Get write metrics +*/ +func (a *Client) StorageProxyMetricsWriteTimeoutsGet(params *StorageProxyMetricsWriteTimeoutsGetParams) (*StorageProxyMetricsWriteTimeoutsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsWriteTimeoutsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsWriteTimeoutsGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/write/timeouts", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsWriteTimeoutsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsWriteTimeoutsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsWriteTimeoutsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsWriteTimeoutsRatesGet gets write metrics timeouts rates + +Get write metrics rates +*/ +func (a *Client) StorageProxyMetricsWriteTimeoutsRatesGet(params *StorageProxyMetricsWriteTimeoutsRatesGetParams) (*StorageProxyMetricsWriteTimeoutsRatesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsWriteTimeoutsRatesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsWriteTimeoutsRatesGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/write/timeouts_rates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsWriteTimeoutsRatesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsWriteTimeoutsRatesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsWriteTimeoutsRatesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsWriteUnavailablesGet gets write metrics unavailables + +Get write metrics +*/ +func (a *Client) StorageProxyMetricsWriteUnavailablesGet(params *StorageProxyMetricsWriteUnavailablesGetParams) (*StorageProxyMetricsWriteUnavailablesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsWriteUnavailablesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsWriteUnavailablesGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/write/unavailables", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsWriteUnavailablesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsWriteUnavailablesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsWriteUnavailablesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyMetricsWriteUnavailablesRatesGet gets write metrics unavailables rates + +Get write metrics rates +*/ +func (a *Client) StorageProxyMetricsWriteUnavailablesRatesGet(params *StorageProxyMetricsWriteUnavailablesRatesGetParams) (*StorageProxyMetricsWriteUnavailablesRatesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyMetricsWriteUnavailablesRatesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyMetricsWriteUnavailablesRatesGet", + Method: "GET", + PathPattern: "/storage_proxy/metrics/write/unavailables_rates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyMetricsWriteUnavailablesRatesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyMetricsWriteUnavailablesRatesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyMetricsWriteUnavailablesRatesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyRangeRPCTimeoutGet gets range rpc timeout + +Get range rpc timeout in seconds +*/ +func (a *Client) StorageProxyRangeRPCTimeoutGet(params *StorageProxyRangeRPCTimeoutGetParams) (*StorageProxyRangeRPCTimeoutGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyRangeRPCTimeoutGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyRangeRpcTimeoutGet", + Method: "GET", + PathPattern: "/storage_proxy/range_rpc_timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyRangeRPCTimeoutGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyRangeRPCTimeoutGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyRangeRPCTimeoutGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyRangeRPCTimeoutPost sets range rpc timeout + +Set range rpc timeout +*/ +func (a *Client) StorageProxyRangeRPCTimeoutPost(params *StorageProxyRangeRPCTimeoutPostParams) (*StorageProxyRangeRPCTimeoutPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyRangeRPCTimeoutPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyRangeRpcTimeoutPost", + Method: "POST", + PathPattern: "/storage_proxy/range_rpc_timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyRangeRPCTimeoutPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyRangeRPCTimeoutPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyRangeRPCTimeoutPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyReadRepairAttemptedGet gets read repair attempted + +Get read repair attempted +*/ +func (a *Client) StorageProxyReadRepairAttemptedGet(params *StorageProxyReadRepairAttemptedGetParams) (*StorageProxyReadRepairAttemptedGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyReadRepairAttemptedGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyReadRepairAttemptedGet", + Method: "GET", + PathPattern: "/storage_proxy/read_repair_attempted", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyReadRepairAttemptedGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyReadRepairAttemptedGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyReadRepairAttemptedGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyReadRepairRepairedBackgroundGet gets read repair repaired background + +Get read repair repaired background +*/ +func (a *Client) StorageProxyReadRepairRepairedBackgroundGet(params *StorageProxyReadRepairRepairedBackgroundGetParams) (*StorageProxyReadRepairRepairedBackgroundGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyReadRepairRepairedBackgroundGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyReadRepairRepairedBackgroundGet", + Method: "GET", + PathPattern: "/storage_proxy/read_repair_repaired_background", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyReadRepairRepairedBackgroundGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyReadRepairRepairedBackgroundGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyReadRepairRepairedBackgroundGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyReadRepairRepairedBlockingGet gets read repair repaired blocking + +Get read repair repaired blocking +*/ +func (a *Client) StorageProxyReadRepairRepairedBlockingGet(params *StorageProxyReadRepairRepairedBlockingGetParams) (*StorageProxyReadRepairRepairedBlockingGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyReadRepairRepairedBlockingGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyReadRepairRepairedBlockingGet", + Method: "GET", + PathPattern: "/storage_proxy/read_repair_repaired_blocking", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyReadRepairRepairedBlockingGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyReadRepairRepairedBlockingGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyReadRepairRepairedBlockingGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyReadRPCTimeoutGet gets read rpc timeout + +Get the read RPC timeout in seconds +*/ +func (a *Client) StorageProxyReadRPCTimeoutGet(params *StorageProxyReadRPCTimeoutGetParams) (*StorageProxyReadRPCTimeoutGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyReadRPCTimeoutGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyReadRpcTimeoutGet", + Method: "GET", + PathPattern: "/storage_proxy/read_rpc_timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyReadRPCTimeoutGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyReadRPCTimeoutGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyReadRPCTimeoutGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyReadRPCTimeoutPost sets read rpc timeout + +Set the read RPC timeout +*/ +func (a *Client) StorageProxyReadRPCTimeoutPost(params *StorageProxyReadRPCTimeoutPostParams) (*StorageProxyReadRPCTimeoutPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyReadRPCTimeoutPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyReadRpcTimeoutPost", + Method: "POST", + PathPattern: "/storage_proxy/read_rpc_timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyReadRPCTimeoutPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyReadRPCTimeoutPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyReadRPCTimeoutPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyReloadTriggerClassesPost reloads trigger classes + +Reload trigger classes +*/ +func (a *Client) StorageProxyReloadTriggerClassesPost(params *StorageProxyReloadTriggerClassesPostParams) (*StorageProxyReloadTriggerClassesPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyReloadTriggerClassesPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyReloadTriggerClassesPost", + Method: "POST", + PathPattern: "/storage_proxy/reload_trigger_classes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyReloadTriggerClassesPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyReloadTriggerClassesPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyReloadTriggerClassesPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyRPCTimeoutGet gets rpc timeout + +Get the RPC timeout in seconds +*/ +func (a *Client) StorageProxyRPCTimeoutGet(params *StorageProxyRPCTimeoutGetParams) (*StorageProxyRPCTimeoutGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyRPCTimeoutGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyRpcTimeoutGet", + Method: "GET", + PathPattern: "/storage_proxy/rpc_timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyRPCTimeoutGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyRPCTimeoutGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyRPCTimeoutGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyRPCTimeoutPost sets rpc timeout + +Set the RPC timeout +*/ +func (a *Client) StorageProxyRPCTimeoutPost(params *StorageProxyRPCTimeoutPostParams) (*StorageProxyRPCTimeoutPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyRPCTimeoutPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyRpcTimeoutPost", + Method: "POST", + PathPattern: "/storage_proxy/rpc_timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyRPCTimeoutPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyRPCTimeoutPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyRPCTimeoutPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxySchemaVersionsGet gets schema versions + +Get a map of the schema versions +*/ +func (a *Client) StorageProxySchemaVersionsGet(params *StorageProxySchemaVersionsGetParams) (*StorageProxySchemaVersionsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxySchemaVersionsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxySchemaVersionsGet", + Method: "GET", + PathPattern: "/storage_proxy/schema_versions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxySchemaVersionsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxySchemaVersionsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxySchemaVersionsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyTotalHintsGet gets total hints + +Get total hints +*/ +func (a *Client) StorageProxyTotalHintsGet(params *StorageProxyTotalHintsGetParams) (*StorageProxyTotalHintsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyTotalHintsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyTotalHintsGet", + Method: "GET", + PathPattern: "/storage_proxy/total_hints", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyTotalHintsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyTotalHintsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyTotalHintsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyTruncateRPCTimeoutGet gets truncate rpc timeout + +Get truncate rpc timeout in seconds +*/ +func (a *Client) StorageProxyTruncateRPCTimeoutGet(params *StorageProxyTruncateRPCTimeoutGetParams) (*StorageProxyTruncateRPCTimeoutGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyTruncateRPCTimeoutGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyTruncateRpcTimeoutGet", + Method: "GET", + PathPattern: "/storage_proxy/truncate_rpc_timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyTruncateRPCTimeoutGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyTruncateRPCTimeoutGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyTruncateRPCTimeoutGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyTruncateRPCTimeoutPost sets truncate rpc timeout + +Set truncate rpc timeout +*/ +func (a *Client) StorageProxyTruncateRPCTimeoutPost(params *StorageProxyTruncateRPCTimeoutPostParams) (*StorageProxyTruncateRPCTimeoutPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyTruncateRPCTimeoutPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyTruncateRpcTimeoutPost", + Method: "POST", + PathPattern: "/storage_proxy/truncate_rpc_timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyTruncateRPCTimeoutPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyTruncateRPCTimeoutPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyTruncateRPCTimeoutPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyWriteRPCTimeoutGet gets write rpc timeout + +Get the write RPC timeout in seconds +*/ +func (a *Client) StorageProxyWriteRPCTimeoutGet(params *StorageProxyWriteRPCTimeoutGetParams) (*StorageProxyWriteRPCTimeoutGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyWriteRPCTimeoutGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyWriteRpcTimeoutGet", + Method: "GET", + PathPattern: "/storage_proxy/write_rpc_timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyWriteRPCTimeoutGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyWriteRPCTimeoutGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyWriteRPCTimeoutGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageProxyWriteRPCTimeoutPost sets write rpc timeout + +Set the write RPC timeout +*/ +func (a *Client) StorageProxyWriteRPCTimeoutPost(params *StorageProxyWriteRPCTimeoutPostParams) (*StorageProxyWriteRPCTimeoutPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageProxyWriteRPCTimeoutPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageProxyWriteRpcTimeoutPost", + Method: "POST", + PathPattern: "/storage_proxy/write_rpc_timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageProxyWriteRPCTimeoutPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageProxyWriteRPCTimeoutPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageProxyWriteRPCTimeoutPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceActiveRepairGet gets active repair async + +Return an array with the ids of the currently active repairs +*/ +func (a *Client) StorageServiceActiveRepairGet(params *StorageServiceActiveRepairGetParams) (*StorageServiceActiveRepairGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceActiveRepairGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceActiveRepairGet", + Method: "GET", + PathPattern: "/storage_service/active_repair/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceActiveRepairGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceActiveRepairGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceActiveRepairGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceAutoCompactionByKeyspaceDelete disables auto compaction + +Disable auto compaction +*/ +func (a *Client) StorageServiceAutoCompactionByKeyspaceDelete(params *StorageServiceAutoCompactionByKeyspaceDeleteParams) (*StorageServiceAutoCompactionByKeyspaceDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceAutoCompactionByKeyspaceDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceAutoCompactionByKeyspaceDelete", + Method: "DELETE", + PathPattern: "/storage_service/auto_compaction/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceAutoCompactionByKeyspaceDeleteReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceAutoCompactionByKeyspaceDeleteOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceAutoCompactionByKeyspaceDeleteDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceAutoCompactionByKeyspacePost enables auto compaction + +Enable auto compaction +*/ +func (a *Client) StorageServiceAutoCompactionByKeyspacePost(params *StorageServiceAutoCompactionByKeyspacePostParams) (*StorageServiceAutoCompactionByKeyspacePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceAutoCompactionByKeyspacePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceAutoCompactionByKeyspacePost", + Method: "POST", + PathPattern: "/storage_service/auto_compaction/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceAutoCompactionByKeyspacePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceAutoCompactionByKeyspacePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceAutoCompactionByKeyspacePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceBatchSizeFailureThresholdGet gets batch size failure threshold + +Returns the threshold for rejecting queries due to a large batch size +*/ +func (a *Client) StorageServiceBatchSizeFailureThresholdGet(params *StorageServiceBatchSizeFailureThresholdGetParams) (*StorageServiceBatchSizeFailureThresholdGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceBatchSizeFailureThresholdGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceBatchSizeFailureThresholdGet", + Method: "GET", + PathPattern: "/storage_service/batch_size_failure_threshold", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceBatchSizeFailureThresholdGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceBatchSizeFailureThresholdGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceBatchSizeFailureThresholdGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceBatchSizeFailureThresholdPost sets batch size failure threshold + +Sets the threshold for rejecting queries due to a large batch size +*/ +func (a *Client) StorageServiceBatchSizeFailureThresholdPost(params *StorageServiceBatchSizeFailureThresholdPostParams) (*StorageServiceBatchSizeFailureThresholdPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceBatchSizeFailureThresholdPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceBatchSizeFailureThresholdPost", + Method: "POST", + PathPattern: "/storage_service/batch_size_failure_threshold", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceBatchSizeFailureThresholdPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceBatchSizeFailureThresholdPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceBatchSizeFailureThresholdPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceBulkLoadAsyncByPathGet bulks load async + +Starts a bulk load asynchronously and returns the String representation of the planID for the new streaming session. +*/ +func (a *Client) StorageServiceBulkLoadAsyncByPathGet(params *StorageServiceBulkLoadAsyncByPathGetParams) (*StorageServiceBulkLoadAsyncByPathGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceBulkLoadAsyncByPathGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceBulkLoadAsyncByPathGet", + Method: "GET", + PathPattern: "/storage_service/bulk_load_async/{path}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceBulkLoadAsyncByPathGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceBulkLoadAsyncByPathGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceBulkLoadAsyncByPathGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceBulkLoadByPathPost bulks load + +Starts a bulk load and blocks until it completes +*/ +func (a *Client) StorageServiceBulkLoadByPathPost(params *StorageServiceBulkLoadByPathPostParams) (*StorageServiceBulkLoadByPathPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceBulkLoadByPathPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceBulkLoadByPathPost", + Method: "POST", + PathPattern: "/storage_service/bulk_load/{path}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceBulkLoadByPathPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceBulkLoadByPathPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceBulkLoadByPathPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceClusterNameGet gets cluster name + +Returns the name of the cluster +*/ +func (a *Client) StorageServiceClusterNameGet(params *StorageServiceClusterNameGetParams) (*StorageServiceClusterNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceClusterNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceClusterNameGet", + Method: "GET", + PathPattern: "/storage_service/cluster_name", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceClusterNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceClusterNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceClusterNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceCommitlogGet gets commitlog + +Returns the location of the commit log files +*/ +func (a *Client) StorageServiceCommitlogGet(params *StorageServiceCommitlogGetParams) (*StorageServiceCommitlogGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceCommitlogGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceCommitlogGet", + Method: "GET", + PathPattern: "/storage_service/commitlog", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceCommitlogGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceCommitlogGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceCommitlogGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceCompactionThroughputGet gets compaction throughput mb per sec + +get compaction throughput mb per sec +*/ +func (a *Client) StorageServiceCompactionThroughputGet(params *StorageServiceCompactionThroughputGetParams) (*StorageServiceCompactionThroughputGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceCompactionThroughputGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceCompactionThroughputGet", + Method: "GET", + PathPattern: "/storage_service/compaction_throughput", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceCompactionThroughputGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceCompactionThroughputGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceCompactionThroughputGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceCompactionThroughputPost sets compaction throughput mb per sec + +Set compaction throughput mb per sec +*/ +func (a *Client) StorageServiceCompactionThroughputPost(params *StorageServiceCompactionThroughputPostParams) (*StorageServiceCompactionThroughputPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceCompactionThroughputPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceCompactionThroughputPost", + Method: "POST", + PathPattern: "/storage_service/compaction_throughput", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceCompactionThroughputPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceCompactionThroughputPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceCompactionThroughputPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceDataFileLocationsGet gets all data file locations + +Get the list of all data file locations from conf +*/ +func (a *Client) StorageServiceDataFileLocationsGet(params *StorageServiceDataFileLocationsGetParams) (*StorageServiceDataFileLocationsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceDataFileLocationsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceDataFileLocationsGet", + Method: "GET", + PathPattern: "/storage_service/data_file/locations", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceDataFileLocationsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceDataFileLocationsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceDataFileLocationsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceDecommissionPost decommissions + +transfer this node's data to other machines and remove it from service. +*/ +func (a *Client) StorageServiceDecommissionPost(params *StorageServiceDecommissionPostParams) (*StorageServiceDecommissionPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceDecommissionPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceDecommissionPost", + Method: "POST", + PathPattern: "/storage_service/decommission", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceDecommissionPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceDecommissionPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceDecommissionPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceDeliverHintsPost delivers hints +*/ +func (a *Client) StorageServiceDeliverHintsPost(params *StorageServiceDeliverHintsPostParams) (*StorageServiceDeliverHintsPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceDeliverHintsPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceDeliverHintsPost", + Method: "POST", + PathPattern: "/storage_service/deliver_hints", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceDeliverHintsPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceDeliverHintsPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceDeliverHintsPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceDescribeRingByKeyspaceGet describes ring + +The TokenRange for a given keyspace +*/ +func (a *Client) StorageServiceDescribeRingByKeyspaceGet(params *StorageServiceDescribeRingByKeyspaceGetParams) (*StorageServiceDescribeRingByKeyspaceGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceDescribeRingByKeyspaceGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceDescribeRingByKeyspaceGet", + Method: "GET", + PathPattern: "/storage_service/describe_ring/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceDescribeRingByKeyspaceGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceDescribeRingByKeyspaceGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceDescribeRingByKeyspaceGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceDrainGet gets drain progress + +Get the progress of a drain operation +*/ +func (a *Client) StorageServiceDrainGet(params *StorageServiceDrainGetParams) (*StorageServiceDrainGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceDrainGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceDrainGet", + Method: "GET", + PathPattern: "/storage_service/drain", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceDrainGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceDrainGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceDrainGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceDrainPost drains + +makes node unavailable for writes, flushes memtables and replays commitlog +*/ +func (a *Client) StorageServiceDrainPost(params *StorageServiceDrainPostParams) (*StorageServiceDrainPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceDrainPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceDrainPost", + Method: "POST", + PathPattern: "/storage_service/drain", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceDrainPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceDrainPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceDrainPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceForceRemoveCompletionPost forces remove completion + +Force a remove operation to finish. +*/ +func (a *Client) StorageServiceForceRemoveCompletionPost(params *StorageServiceForceRemoveCompletionPostParams) (*StorageServiceForceRemoveCompletionPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceForceRemoveCompletionPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceForceRemoveCompletionPost", + Method: "POST", + PathPattern: "/storage_service/force_remove_completion", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceForceRemoveCompletionPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceForceRemoveCompletionPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceForceRemoveCompletionPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceForceTerminatePost forces terminate all repair sessions + +Force terminate all repair sessions +*/ +func (a *Client) StorageServiceForceTerminatePost(params *StorageServiceForceTerminatePostParams) (*StorageServiceForceTerminatePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceForceTerminatePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceForceTerminatePost", + Method: "POST", + PathPattern: "/storage_service/force_terminate", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceForceTerminatePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceForceTerminatePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceForceTerminatePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceForceTerminateRepairPost forces terminate all repair sessions new + +Force terminate all repair sessions +*/ +func (a *Client) StorageServiceForceTerminateRepairPost(params *StorageServiceForceTerminateRepairPostParams) (*StorageServiceForceTerminateRepairPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceForceTerminateRepairPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceForceTerminateRepairPost", + Method: "POST", + PathPattern: "/storage_service/force_terminate_repair", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceForceTerminateRepairPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceForceTerminateRepairPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceForceTerminateRepairPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceGenerationNumberGet gets current generation number + +Return the generation value for this node. +*/ +func (a *Client) StorageServiceGenerationNumberGet(params *StorageServiceGenerationNumberGetParams) (*StorageServiceGenerationNumberGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceGenerationNumberGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceGenerationNumberGet", + Method: "GET", + PathPattern: "/storage_service/generation_number", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceGenerationNumberGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceGenerationNumberGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceGenerationNumberGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceGossipingDelete stops gossiping + +allows a user to forcibly 'kill' a sick node +*/ +func (a *Client) StorageServiceGossipingDelete(params *StorageServiceGossipingDeleteParams) (*StorageServiceGossipingDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceGossipingDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceGossipingDelete", + Method: "DELETE", + PathPattern: "/storage_service/gossiping", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceGossipingDeleteReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceGossipingDeleteOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceGossipingDeleteDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceGossipingGet is gossip running + +allows a user to see whether gossip is running or not +*/ +func (a *Client) StorageServiceGossipingGet(params *StorageServiceGossipingGetParams) (*StorageServiceGossipingGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceGossipingGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceGossipingGet", + Method: "GET", + PathPattern: "/storage_service/gossiping", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceGossipingGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceGossipingGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceGossipingGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceGossipingPost starts gossiping + +allows a user to recover a forcibly 'killed' node +*/ +func (a *Client) StorageServiceGossipingPost(params *StorageServiceGossipingPostParams) (*StorageServiceGossipingPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceGossipingPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceGossipingPost", + Method: "POST", + PathPattern: "/storage_service/gossiping", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceGossipingPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceGossipingPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceGossipingPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceHintedHandoffPost sets hinted handoff throttle in kb + +Sets the hinted handoff throttle in kb per second, per delivery thread +*/ +func (a *Client) StorageServiceHintedHandoffPost(params *StorageServiceHintedHandoffPostParams) (*StorageServiceHintedHandoffPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceHintedHandoffPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceHintedHandoffPost", + Method: "POST", + PathPattern: "/storage_service/hinted_handoff", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceHintedHandoffPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceHintedHandoffPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceHintedHandoffPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceHostIDGet gets host id map + +Retrieve the mapping of endpoint to host ID +*/ +func (a *Client) StorageServiceHostIDGet(params *StorageServiceHostIDGetParams) (*StorageServiceHostIDGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceHostIDGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceHostIdGet", + Method: "GET", + PathPattern: "/storage_service/host_id", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceHostIDGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceHostIDGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceHostIDGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceHostidLocalGet locals hostid + +Returns the local host id +*/ +func (a *Client) StorageServiceHostidLocalGet(params *StorageServiceHostidLocalGetParams) (*StorageServiceHostidLocalGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceHostidLocalGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceHostidLocalGet", + Method: "GET", + PathPattern: "/storage_service/hostid/local", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceHostidLocalGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceHostidLocalGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceHostidLocalGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceIncrementalBackupsGet is incremental backups enabled + +Check if incremental backup is enabled +*/ +func (a *Client) StorageServiceIncrementalBackupsGet(params *StorageServiceIncrementalBackupsGetParams) (*StorageServiceIncrementalBackupsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceIncrementalBackupsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceIncrementalBackupsGet", + Method: "GET", + PathPattern: "/storage_service/incremental_backups", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceIncrementalBackupsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceIncrementalBackupsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceIncrementalBackupsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceIncrementalBackupsPost sets incremental backups enabled +*/ +func (a *Client) StorageServiceIncrementalBackupsPost(params *StorageServiceIncrementalBackupsPostParams) (*StorageServiceIncrementalBackupsPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceIncrementalBackupsPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceIncrementalBackupsPost", + Method: "POST", + PathPattern: "/storage_service/incremental_backups", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceIncrementalBackupsPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceIncrementalBackupsPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceIncrementalBackupsPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceIsInitializedGet is initialized + +Determine if gossip is enable +*/ +func (a *Client) StorageServiceIsInitializedGet(params *StorageServiceIsInitializedGetParams) (*StorageServiceIsInitializedGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceIsInitializedGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceIsInitializedGet", + Method: "GET", + PathPattern: "/storage_service/is_initialized", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceIsInitializedGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceIsInitializedGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceIsInitializedGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceIsStartingGet is starting + +Returns whether the storage service is starting or not +*/ +func (a *Client) StorageServiceIsStartingGet(params *StorageServiceIsStartingGetParams) (*StorageServiceIsStartingGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceIsStartingGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceIsStartingGet", + Method: "GET", + PathPattern: "/storage_service/is_starting", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceIsStartingGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceIsStartingGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceIsStartingGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceJoinRingGet is joined +*/ +func (a *Client) StorageServiceJoinRingGet(params *StorageServiceJoinRingGetParams) (*StorageServiceJoinRingGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceJoinRingGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceJoinRingGet", + Method: "GET", + PathPattern: "/storage_service/join_ring", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceJoinRingGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceJoinRingGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceJoinRingGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceJoinRingPost joins ring + +Allows a node that have been started without joining the ring to join it +*/ +func (a *Client) StorageServiceJoinRingPost(params *StorageServiceJoinRingPostParams) (*StorageServiceJoinRingPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceJoinRingPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceJoinRingPost", + Method: "POST", + PathPattern: "/storage_service/join_ring", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceJoinRingPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceJoinRingPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceJoinRingPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceKeyspaceCleanupByKeyspacePost forces keyspace cleanup + +Trigger a cleanup of keys on a single keyspace +*/ +func (a *Client) StorageServiceKeyspaceCleanupByKeyspacePost(params *StorageServiceKeyspaceCleanupByKeyspacePostParams) (*StorageServiceKeyspaceCleanupByKeyspacePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceKeyspaceCleanupByKeyspacePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceKeyspaceCleanupByKeyspacePost", + Method: "POST", + PathPattern: "/storage_service/keyspace_cleanup/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceKeyspaceCleanupByKeyspacePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceKeyspaceCleanupByKeyspacePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceKeyspaceCleanupByKeyspacePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceKeyspaceCompactionByKeyspacePost forces keyspace compaction + +Forces major compaction of a single keyspace +*/ +func (a *Client) StorageServiceKeyspaceCompactionByKeyspacePost(params *StorageServiceKeyspaceCompactionByKeyspacePostParams) (*StorageServiceKeyspaceCompactionByKeyspacePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceKeyspaceCompactionByKeyspacePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceKeyspaceCompactionByKeyspacePost", + Method: "POST", + PathPattern: "/storage_service/keyspace_compaction/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceKeyspaceCompactionByKeyspacePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceKeyspaceCompactionByKeyspacePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceKeyspaceCompactionByKeyspacePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceKeyspaceFlushByKeyspacePost forces keyspace flush + +Flush all memtables for the given column families, or all columnfamilies for the given keyspace if none are explicitly listed. +*/ +func (a *Client) StorageServiceKeyspaceFlushByKeyspacePost(params *StorageServiceKeyspaceFlushByKeyspacePostParams) (*StorageServiceKeyspaceFlushByKeyspacePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceKeyspaceFlushByKeyspacePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceKeyspaceFlushByKeyspacePost", + Method: "POST", + PathPattern: "/storage_service/keyspace_flush/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceKeyspaceFlushByKeyspacePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceKeyspaceFlushByKeyspacePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceKeyspaceFlushByKeyspacePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceKeyspaceScrubByKeyspaceGet scrubs + +Scrub (deserialize + reserialize at the latest version, skipping bad rows if any) the given keyspace. If columnFamilies array is empty, all CFs are scrubbed. Scrubbed CFs will be snapshotted first, if disableSnapshot is false +*/ +func (a *Client) StorageServiceKeyspaceScrubByKeyspaceGet(params *StorageServiceKeyspaceScrubByKeyspaceGetParams) (*StorageServiceKeyspaceScrubByKeyspaceGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceKeyspaceScrubByKeyspaceGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceKeyspaceScrubByKeyspaceGet", + Method: "GET", + PathPattern: "/storage_service/keyspace_scrub/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceKeyspaceScrubByKeyspaceGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceKeyspaceScrubByKeyspaceGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceKeyspaceScrubByKeyspaceGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceKeyspaceUpgradeSstablesByKeyspaceGet upgrades sstables + +Rewrite all sstables to the latest version. Unlike scrub, it doesn't skip bad rows and do not snapshot sstables first. +*/ +func (a *Client) StorageServiceKeyspaceUpgradeSstablesByKeyspaceGet(params *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams) (*StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceKeyspaceUpgradeSstablesByKeyspaceGet", + Method: "GET", + PathPattern: "/storage_service/keyspace_upgrade_sstables/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceKeyspacesGet gets keyspaces + +Get the keyspaces +*/ +func (a *Client) StorageServiceKeyspacesGet(params *StorageServiceKeyspacesGetParams) (*StorageServiceKeyspacesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceKeyspacesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceKeyspacesGet", + Method: "GET", + PathPattern: "/storage_service/keyspaces", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceKeyspacesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceKeyspacesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceKeyspacesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceLoadGet gets load + +get load value +*/ +func (a *Client) StorageServiceLoadGet(params *StorageServiceLoadGetParams) (*StorageServiceLoadGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceLoadGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceLoadGet", + Method: "GET", + PathPattern: "/storage_service/load", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceLoadGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceLoadGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceLoadGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceLoadMapGet gets load map + +load value. Keys are IP addresses +*/ +func (a *Client) StorageServiceLoadMapGet(params *StorageServiceLoadMapGetParams) (*StorageServiceLoadMapGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceLoadMapGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceLoadMapGet", + Method: "GET", + PathPattern: "/storage_service/load_map", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceLoadMapGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceLoadMapGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceLoadMapGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceLoggingLevelGet gets logging levels + +get the runtime logging levels +*/ +func (a *Client) StorageServiceLoggingLevelGet(params *StorageServiceLoggingLevelGetParams) (*StorageServiceLoggingLevelGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceLoggingLevelGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceLoggingLevelGet", + Method: "GET", + PathPattern: "/storage_service/logging_level", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceLoggingLevelGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceLoggingLevelGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceLoggingLevelGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceLoggingLevelPost sets logging level + +set the logging level at runtime

If both classQualifer and level are empty/null, it will reload the configuration to reset.
If classQualifer is not empty but level is empty/null, it will set the level to null for the defined classQualifer
If level cannot be parsed, then the level will be defaulted to DEBUG

The logback configuration should have < jmxConfigurator /> set +*/ +func (a *Client) StorageServiceLoggingLevelPost(params *StorageServiceLoggingLevelPostParams) (*StorageServiceLoggingLevelPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceLoggingLevelPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceLoggingLevelPost", + Method: "POST", + PathPattern: "/storage_service/logging_level", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceLoggingLevelPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceLoggingLevelPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceLoggingLevelPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceMetricsExceptionsGet gets exceptions + +Get exceptions +*/ +func (a *Client) StorageServiceMetricsExceptionsGet(params *StorageServiceMetricsExceptionsGetParams) (*StorageServiceMetricsExceptionsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceMetricsExceptionsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceMetricsExceptionsGet", + Method: "GET", + PathPattern: "/storage_service/metrics/exceptions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceMetricsExceptionsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceMetricsExceptionsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceMetricsExceptionsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceMetricsHintsInProgressGet gets total hints in progress + +Get total hints in progress +*/ +func (a *Client) StorageServiceMetricsHintsInProgressGet(params *StorageServiceMetricsHintsInProgressGetParams) (*StorageServiceMetricsHintsInProgressGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceMetricsHintsInProgressGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceMetricsHintsInProgressGet", + Method: "GET", + PathPattern: "/storage_service/metrics/hints_in_progress", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceMetricsHintsInProgressGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceMetricsHintsInProgressGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceMetricsHintsInProgressGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceMetricsLoadGet gets metrics load + +Get load +*/ +func (a *Client) StorageServiceMetricsLoadGet(params *StorageServiceMetricsLoadGetParams) (*StorageServiceMetricsLoadGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceMetricsLoadGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceMetricsLoadGet", + Method: "GET", + PathPattern: "/storage_service/metrics/load", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceMetricsLoadGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceMetricsLoadGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceMetricsLoadGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceMetricsTotalHintsGet gets total hints1 + +Get total hints +*/ +func (a *Client) StorageServiceMetricsTotalHintsGet(params *StorageServiceMetricsTotalHintsGetParams) (*StorageServiceMetricsTotalHintsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceMetricsTotalHintsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceMetricsTotalHintsGet", + Method: "GET", + PathPattern: "/storage_service/metrics/total_hints", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceMetricsTotalHintsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceMetricsTotalHintsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceMetricsTotalHintsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceMovePost moves + +This node will unload its data onto its neighbors, and bootstrap to the new token. +*/ +func (a *Client) StorageServiceMovePost(params *StorageServiceMovePostParams) (*StorageServiceMovePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceMovePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceMovePost", + Method: "POST", + PathPattern: "/storage_service/move", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceMovePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceMovePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceMovePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceNativeTransportDelete stops native transport + +Stop native transport +*/ +func (a *Client) StorageServiceNativeTransportDelete(params *StorageServiceNativeTransportDeleteParams) (*StorageServiceNativeTransportDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceNativeTransportDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceNativeTransportDelete", + Method: "DELETE", + PathPattern: "/storage_service/native_transport", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceNativeTransportDeleteReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceNativeTransportDeleteOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceNativeTransportDeleteDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceNativeTransportGet is native transport running + +Is native transport running +*/ +func (a *Client) StorageServiceNativeTransportGet(params *StorageServiceNativeTransportGetParams) (*StorageServiceNativeTransportGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceNativeTransportGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceNativeTransportGet", + Method: "GET", + PathPattern: "/storage_service/native_transport", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceNativeTransportGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceNativeTransportGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceNativeTransportGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceNativeTransportPost starts native transport + +Start native transport +*/ +func (a *Client) StorageServiceNativeTransportPost(params *StorageServiceNativeTransportPostParams) (*StorageServiceNativeTransportPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceNativeTransportPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceNativeTransportPost", + Method: "POST", + PathPattern: "/storage_service/native_transport", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceNativeTransportPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceNativeTransportPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceNativeTransportPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceNaturalEndpointsByKeyspaceGet gets natural endpoints + +This method returns the N endpoints that are responsible for storing the specified key i.e for replication. the endpoint responsible for this key +*/ +func (a *Client) StorageServiceNaturalEndpointsByKeyspaceGet(params *StorageServiceNaturalEndpointsByKeyspaceGetParams) (*StorageServiceNaturalEndpointsByKeyspaceGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceNaturalEndpointsByKeyspaceGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceNaturalEndpointsByKeyspaceGet", + Method: "GET", + PathPattern: "/storage_service/natural_endpoints/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceNaturalEndpointsByKeyspaceGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceNaturalEndpointsByKeyspaceGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceNaturalEndpointsByKeyspaceGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceNodesJoiningGet gets joining nodes + +Retrieve the list of nodes currently bootstrapping into the ring +*/ +func (a *Client) StorageServiceNodesJoiningGet(params *StorageServiceNodesJoiningGetParams) (*StorageServiceNodesJoiningGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceNodesJoiningGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceNodesJoiningGet", + Method: "GET", + PathPattern: "/storage_service/nodes/joining", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceNodesJoiningGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceNodesJoiningGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceNodesJoiningGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceNodesLeavingGet gets leaving nodes + +Retrieve the list of nodes currently leaving the ring +*/ +func (a *Client) StorageServiceNodesLeavingGet(params *StorageServiceNodesLeavingGetParams) (*StorageServiceNodesLeavingGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceNodesLeavingGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceNodesLeavingGet", + Method: "GET", + PathPattern: "/storage_service/nodes/leaving", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceNodesLeavingGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceNodesLeavingGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceNodesLeavingGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceNodesMovingGet gets moving nodes + +Retrieve the list of nodes currently moving in the ring +*/ +func (a *Client) StorageServiceNodesMovingGet(params *StorageServiceNodesMovingGetParams) (*StorageServiceNodesMovingGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceNodesMovingGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceNodesMovingGet", + Method: "GET", + PathPattern: "/storage_service/nodes/moving", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceNodesMovingGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceNodesMovingGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceNodesMovingGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceOperationModeGet gets operation mode + +Get the operational mode (leaving, joining, normal, decommissioned, client) +*/ +func (a *Client) StorageServiceOperationModeGet(params *StorageServiceOperationModeGetParams) (*StorageServiceOperationModeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceOperationModeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceOperationModeGet", + Method: "GET", + PathPattern: "/storage_service/operation_mode", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceOperationModeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceOperationModeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceOperationModeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceOwnershipByKeyspaceGet gets effective ownership + +Effective ownership is % of the data each node owns given the keyspace +*/ +func (a *Client) StorageServiceOwnershipByKeyspaceGet(params *StorageServiceOwnershipByKeyspaceGetParams) (*StorageServiceOwnershipByKeyspaceGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceOwnershipByKeyspaceGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceOwnershipByKeyspaceGet", + Method: "GET", + PathPattern: "/storage_service/ownership/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceOwnershipByKeyspaceGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceOwnershipByKeyspaceGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceOwnershipByKeyspaceGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceOwnershipGet gets ownership + +The mapping from token -> % of cluster owned by that token +*/ +func (a *Client) StorageServiceOwnershipGet(params *StorageServiceOwnershipGetParams) (*StorageServiceOwnershipGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceOwnershipGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceOwnershipGet", + Method: "GET", + PathPattern: "/storage_service/ownership/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceOwnershipGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceOwnershipGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceOwnershipGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServicePartitionerNameGet gets partitioner name + +Returns the cluster partitioner +*/ +func (a *Client) StorageServicePartitionerNameGet(params *StorageServicePartitionerNameGetParams) (*StorageServicePartitionerNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServicePartitionerNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServicePartitionerNameGet", + Method: "GET", + PathPattern: "/storage_service/partitioner_name", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServicePartitionerNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServicePartitionerNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServicePartitionerNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServicePendingRangeByKeyspaceGet gets pending range to endpoint map + +Retrieve a map of pending ranges to endpoints that describe the ring topology +*/ +func (a *Client) StorageServicePendingRangeByKeyspaceGet(params *StorageServicePendingRangeByKeyspaceGetParams) (*StorageServicePendingRangeByKeyspaceGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServicePendingRangeByKeyspaceGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServicePendingRangeByKeyspaceGet", + Method: "GET", + PathPattern: "/storage_service/pending_range/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServicePendingRangeByKeyspaceGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServicePendingRangeByKeyspaceGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServicePendingRangeByKeyspaceGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceRangeToEndpointMapByKeyspaceGet gets range to endpoint map + +Retrieve a map of range to end points that describe the ring topology of a Cassandra cluster. +*/ +func (a *Client) StorageServiceRangeToEndpointMapByKeyspaceGet(params *StorageServiceRangeToEndpointMapByKeyspaceGetParams) (*StorageServiceRangeToEndpointMapByKeyspaceGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceRangeToEndpointMapByKeyspaceGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceRangeToEndpointMapByKeyspaceGet", + Method: "GET", + PathPattern: "/storage_service/range_to_endpoint_map/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceRangeToEndpointMapByKeyspaceGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceRangeToEndpointMapByKeyspaceGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceRangeToEndpointMapByKeyspaceGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceRebuildPost rebuilds + +Initiate a process of streaming data for which we are responsible from other nodes. It is similar to bootstrap except meant to be used on a node which is already in the cluster (typically containing no data) as an alternative to running repair. +*/ +func (a *Client) StorageServiceRebuildPost(params *StorageServiceRebuildPostParams) (*StorageServiceRebuildPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceRebuildPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceRebuildPost", + Method: "POST", + PathPattern: "/storage_service/rebuild", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceRebuildPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceRebuildPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceRebuildPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceReleaseVersionGet gets release version + +Fetch a string representation of the Cassandra version. +*/ +func (a *Client) StorageServiceReleaseVersionGet(params *StorageServiceReleaseVersionGetParams) (*StorageServiceReleaseVersionGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceReleaseVersionGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceReleaseVersionGet", + Method: "GET", + PathPattern: "/storage_service/release_version", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceReleaseVersionGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceReleaseVersionGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceReleaseVersionGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceRelocalSchemaPost resets local schema + +Reset local schema +*/ +func (a *Client) StorageServiceRelocalSchemaPost(params *StorageServiceRelocalSchemaPostParams) (*StorageServiceRelocalSchemaPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceRelocalSchemaPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceRelocalSchemaPost", + Method: "POST", + PathPattern: "/storage_service/relocal_schema", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceRelocalSchemaPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceRelocalSchemaPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceRelocalSchemaPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceRemovalStatusGet gets removal status + +Get the status of a token removal. +*/ +func (a *Client) StorageServiceRemovalStatusGet(params *StorageServiceRemovalStatusGetParams) (*StorageServiceRemovalStatusGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceRemovalStatusGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceRemovalStatusGet", + Method: "GET", + PathPattern: "/storage_service/removal_status", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceRemovalStatusGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceRemovalStatusGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceRemovalStatusGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceRemoveNodePost removes node + +Removes token (and all data associated with enpoint that had it) from the ring +*/ +func (a *Client) StorageServiceRemoveNodePost(params *StorageServiceRemoveNodePostParams) (*StorageServiceRemoveNodePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceRemoveNodePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceRemoveNodePost", + Method: "POST", + PathPattern: "/storage_service/remove_node", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceRemoveNodePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceRemoveNodePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceRemoveNodePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceRepairAsyncByKeyspaceGet repairs async status + +Track already running repair progress +*/ +func (a *Client) StorageServiceRepairAsyncByKeyspaceGet(params *StorageServiceRepairAsyncByKeyspaceGetParams) (*StorageServiceRepairAsyncByKeyspaceGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceRepairAsyncByKeyspaceGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceRepairAsyncByKeyspaceGet", + Method: "GET", + PathPattern: "/storage_service/repair_async/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceRepairAsyncByKeyspaceGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceRepairAsyncByKeyspaceGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceRepairAsyncByKeyspaceGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceRepairAsyncByKeyspacePost repairs async + +Invoke repair asynchronously. You can track repair progress by using the get supplying id +*/ +func (a *Client) StorageServiceRepairAsyncByKeyspacePost(params *StorageServiceRepairAsyncByKeyspacePostParams) (*StorageServiceRepairAsyncByKeyspacePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceRepairAsyncByKeyspacePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceRepairAsyncByKeyspacePost", + Method: "POST", + PathPattern: "/storage_service/repair_async/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceRepairAsyncByKeyspacePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceRepairAsyncByKeyspacePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceRepairAsyncByKeyspacePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceRepairStatus storages service repair status + +Query the repair status and return when the repair is finished or timeout +*/ +func (a *Client) StorageServiceRepairStatus(params *StorageServiceRepairStatusParams) (*StorageServiceRepairStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceRepairStatusParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceRepairStatus", + Method: "GET", + PathPattern: "/storage_service/repair_status", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceRepairStatusReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceRepairStatusOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceRepairStatusDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceRescheduleFailedDeletionsPost reschedules failed deletions + +Reschedule failed deletions +*/ +func (a *Client) StorageServiceRescheduleFailedDeletionsPost(params *StorageServiceRescheduleFailedDeletionsPostParams) (*StorageServiceRescheduleFailedDeletionsPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceRescheduleFailedDeletionsPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceRescheduleFailedDeletionsPost", + Method: "POST", + PathPattern: "/storage_service/reschedule_failed_deletions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceRescheduleFailedDeletionsPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceRescheduleFailedDeletionsPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceRescheduleFailedDeletionsPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceRPCServerDelete stops rpc server + +Allows a user to disable thrift +*/ +func (a *Client) StorageServiceRPCServerDelete(params *StorageServiceRPCServerDeleteParams) (*StorageServiceRPCServerDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceRPCServerDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceRpcServerDelete", + Method: "DELETE", + PathPattern: "/storage_service/rpc_server", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceRPCServerDeleteReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceRPCServerDeleteOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceRPCServerDeleteDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceRPCServerGet is rpc server running + +Determine if thrift is running +*/ +func (a *Client) StorageServiceRPCServerGet(params *StorageServiceRPCServerGetParams) (*StorageServiceRPCServerGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceRPCServerGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceRpcServerGet", + Method: "GET", + PathPattern: "/storage_service/rpc_server", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceRPCServerGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceRPCServerGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceRPCServerGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceRPCServerPost starts rpc server + +allows a user to reenable thrift +*/ +func (a *Client) StorageServiceRPCServerPost(params *StorageServiceRPCServerPostParams) (*StorageServiceRPCServerPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceRPCServerPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceRpcServerPost", + Method: "POST", + PathPattern: "/storage_service/rpc_server", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceRPCServerPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceRPCServerPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceRPCServerPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceSampleKeyRangeGet samples key range + +Return a List of Tokens representing a sample of keys across all ColumnFamilyStores. +*/ +func (a *Client) StorageServiceSampleKeyRangeGet(params *StorageServiceSampleKeyRangeGetParams) (*StorageServiceSampleKeyRangeGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceSampleKeyRangeGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceSampleKeyRangeGet", + Method: "GET", + PathPattern: "/storage_service/sample_key_range", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceSampleKeyRangeGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceSampleKeyRangeGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceSampleKeyRangeGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceSavedCachesLocationGet gets saved caches location + +Get location of the saved caches dir +*/ +func (a *Client) StorageServiceSavedCachesLocationGet(params *StorageServiceSavedCachesLocationGetParams) (*StorageServiceSavedCachesLocationGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceSavedCachesLocationGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceSavedCachesLocationGet", + Method: "GET", + PathPattern: "/storage_service/saved_caches/location", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceSavedCachesLocationGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceSavedCachesLocationGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceSavedCachesLocationGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceSchemaVersionGet gets schema version + +Fetch a string representation of the current Schema version. +*/ +func (a *Client) StorageServiceSchemaVersionGet(params *StorageServiceSchemaVersionGetParams) (*StorageServiceSchemaVersionGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceSchemaVersionGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceSchemaVersionGet", + Method: "GET", + PathPattern: "/storage_service/schema_version", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceSchemaVersionGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceSchemaVersionGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceSchemaVersionGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceScyllaReleaseVersionGet gets scylla release version + +Fetch a string representation of the Scylla version. +*/ +func (a *Client) StorageServiceScyllaReleaseVersionGet(params *StorageServiceScyllaReleaseVersionGetParams) (*StorageServiceScyllaReleaseVersionGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceScyllaReleaseVersionGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceScyllaReleaseVersionGet", + Method: "GET", + PathPattern: "/storage_service/scylla_release_version", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceScyllaReleaseVersionGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceScyllaReleaseVersionGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceScyllaReleaseVersionGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceSlowQueryGet gets slow query info + +Returns the slow query record configuration. +*/ +func (a *Client) StorageServiceSlowQueryGet(params *StorageServiceSlowQueryGetParams) (*StorageServiceSlowQueryGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceSlowQueryGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceSlowQueryGet", + Method: "GET", + PathPattern: "/storage_service/slow_query", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceSlowQueryGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceSlowQueryGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceSlowQueryGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceSlowQueryPost sets slow query + +Set slow query parameter +*/ +func (a *Client) StorageServiceSlowQueryPost(params *StorageServiceSlowQueryPostParams) (*StorageServiceSlowQueryPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceSlowQueryPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceSlowQueryPost", + Method: "POST", + PathPattern: "/storage_service/slow_query", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceSlowQueryPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceSlowQueryPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceSlowQueryPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceSnapshotsDelete dels snapshot + +Remove the snapshot with the given name from the given keyspaces. If no tag is specified all snapshots will be removed +*/ +func (a *Client) StorageServiceSnapshotsDelete(params *StorageServiceSnapshotsDeleteParams) (*StorageServiceSnapshotsDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceSnapshotsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceSnapshotsDelete", + Method: "DELETE", + PathPattern: "/storage_service/snapshots", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceSnapshotsDeleteReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceSnapshotsDeleteOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceSnapshotsDeleteDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceSnapshotsGet gets snapshot details + +Get the details of all the snapshot +*/ +func (a *Client) StorageServiceSnapshotsGet(params *StorageServiceSnapshotsGetParams) (*StorageServiceSnapshotsGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceSnapshotsGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceSnapshotsGet", + Method: "GET", + PathPattern: "/storage_service/snapshots", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceSnapshotsGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceSnapshotsGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceSnapshotsGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceSnapshotsPost takes snapshot + +Takes the snapshot for the given keyspaces. A snapshot name must be specified. +*/ +func (a *Client) StorageServiceSnapshotsPost(params *StorageServiceSnapshotsPostParams) (*StorageServiceSnapshotsPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceSnapshotsPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceSnapshotsPost", + Method: "POST", + PathPattern: "/storage_service/snapshots", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceSnapshotsPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceSnapshotsPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceSnapshotsPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceSnapshotsSizeTrueGet trues snapshots size + +Get the true size taken by all snapshots across all keyspaces. +*/ +func (a *Client) StorageServiceSnapshotsSizeTrueGet(params *StorageServiceSnapshotsSizeTrueGetParams) (*StorageServiceSnapshotsSizeTrueGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceSnapshotsSizeTrueGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceSnapshotsSizeTrueGet", + Method: "GET", + PathPattern: "/storage_service/snapshots/size/true", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceSnapshotsSizeTrueGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceSnapshotsSizeTrueGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceSnapshotsSizeTrueGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceSstablesByKeyspacePost loads new ss tables + +Load new SSTables to the given keyspace/columnFamily +*/ +func (a *Client) StorageServiceSstablesByKeyspacePost(params *StorageServiceSstablesByKeyspacePostParams) (*StorageServiceSstablesByKeyspacePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceSstablesByKeyspacePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceSstablesByKeyspacePost", + Method: "POST", + PathPattern: "/storage_service/sstables/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceSstablesByKeyspacePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceSstablesByKeyspacePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceSstablesByKeyspacePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceStopDaemonPost stops daemon + +allows a user to forcibly completely stop cassandra +*/ +func (a *Client) StorageServiceStopDaemonPost(params *StorageServiceStopDaemonPostParams) (*StorageServiceStopDaemonPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceStopDaemonPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceStopDaemonPost", + Method: "POST", + PathPattern: "/storage_service/stop_daemon", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceStopDaemonPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceStopDaemonPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceStopDaemonPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceStreamThroughputGet gets stream throughput mb per sec + +Get stream throughput mb per sec +*/ +func (a *Client) StorageServiceStreamThroughputGet(params *StorageServiceStreamThroughputGetParams) (*StorageServiceStreamThroughputGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceStreamThroughputGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceStreamThroughputGet", + Method: "GET", + PathPattern: "/storage_service/stream_throughput", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceStreamThroughputGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceStreamThroughputGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceStreamThroughputGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceStreamThroughputPost sets stream throughput mb per sec + +set stream throughput mb per sec +*/ +func (a *Client) StorageServiceStreamThroughputPost(params *StorageServiceStreamThroughputPostParams) (*StorageServiceStreamThroughputPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceStreamThroughputPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceStreamThroughputPost", + Method: "POST", + PathPattern: "/storage_service/stream_throughput", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceStreamThroughputPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceStreamThroughputPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceStreamThroughputPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceTabletsBalancingPost tablets balancing enable + +Controls tablet load-balancing +*/ +func (a *Client) StorageServiceTabletsBalancingPost(params *StorageServiceTabletsBalancingPostParams) (*StorageServiceTabletsBalancingPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceTabletsBalancingPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceTabletsBalancingPost", + Method: "POST", + PathPattern: "/storage_service/tablets/balancing", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceTabletsBalancingPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceTabletsBalancingPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceTabletsBalancingPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceTokensByEndpointGet gets node tokens + +Returns a list of the tokens for or a specified node +*/ +func (a *Client) StorageServiceTokensByEndpointGet(params *StorageServiceTokensByEndpointGetParams) (*StorageServiceTokensByEndpointGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceTokensByEndpointGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceTokensByEndpointGet", + Method: "GET", + PathPattern: "/storage_service/tokens/{endpoint}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceTokensByEndpointGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceTokensByEndpointGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceTokensByEndpointGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceTokensEndpointGet gets token endpoint + +Returns a list of the tokens endpoint mapping +*/ +func (a *Client) StorageServiceTokensEndpointGet(params *StorageServiceTokensEndpointGetParams) (*StorageServiceTokensEndpointGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceTokensEndpointGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceTokensEndpointGet", + Method: "GET", + PathPattern: "/storage_service/tokens_endpoint", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceTokensEndpointGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceTokensEndpointGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceTokensEndpointGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceTokensGet gets tokens + +Returns a list of the tokens for this node +*/ +func (a *Client) StorageServiceTokensGet(params *StorageServiceTokensGetParams) (*StorageServiceTokensGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceTokensGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceTokensGet", + Method: "GET", + PathPattern: "/storage_service/tokens", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceTokensGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceTokensGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceTokensGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceTombstoneFailureThresholdGet gets tombstone failure threshold +*/ +func (a *Client) StorageServiceTombstoneFailureThresholdGet(params *StorageServiceTombstoneFailureThresholdGetParams) (*StorageServiceTombstoneFailureThresholdGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceTombstoneFailureThresholdGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceTombstoneFailureThresholdGet", + Method: "GET", + PathPattern: "/storage_service/tombstone_failure_threshold", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceTombstoneFailureThresholdGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceTombstoneFailureThresholdGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceTombstoneFailureThresholdGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceTombstoneFailureThresholdPost sets tombstone failure threshold +*/ +func (a *Client) StorageServiceTombstoneFailureThresholdPost(params *StorageServiceTombstoneFailureThresholdPostParams) (*StorageServiceTombstoneFailureThresholdPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceTombstoneFailureThresholdPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceTombstoneFailureThresholdPost", + Method: "POST", + PathPattern: "/storage_service/tombstone_failure_threshold", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceTombstoneFailureThresholdPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceTombstoneFailureThresholdPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceTombstoneFailureThresholdPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceTombstoneWarnThresholdGet gets tombstone warn threshold + +Returns the threshold for warning of queries with many tombstones +*/ +func (a *Client) StorageServiceTombstoneWarnThresholdGet(params *StorageServiceTombstoneWarnThresholdGetParams) (*StorageServiceTombstoneWarnThresholdGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceTombstoneWarnThresholdGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceTombstoneWarnThresholdGet", + Method: "GET", + PathPattern: "/storage_service/tombstone_warn_threshold", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceTombstoneWarnThresholdGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceTombstoneWarnThresholdGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceTombstoneWarnThresholdGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceTombstoneWarnThresholdPost sets tombstone warn threshold + +Sets the threshold for warning queries with many tombstones +*/ +func (a *Client) StorageServiceTombstoneWarnThresholdPost(params *StorageServiceTombstoneWarnThresholdPostParams) (*StorageServiceTombstoneWarnThresholdPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceTombstoneWarnThresholdPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceTombstoneWarnThresholdPost", + Method: "POST", + PathPattern: "/storage_service/tombstone_warn_threshold", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceTombstoneWarnThresholdPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceTombstoneWarnThresholdPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceTombstoneWarnThresholdPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceTraceProbabilityGet gets trace probability + +Returns the configured tracing probability. +*/ +func (a *Client) StorageServiceTraceProbabilityGet(params *StorageServiceTraceProbabilityGetParams) (*StorageServiceTraceProbabilityGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceTraceProbabilityGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceTraceProbabilityGet", + Method: "GET", + PathPattern: "/storage_service/trace_probability", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceTraceProbabilityGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceTraceProbabilityGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceTraceProbabilityGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceTraceProbabilityPost sets trace probability + +Enables/Disables tracing for the whole system. Only thrift requests can start tracing currently +*/ +func (a *Client) StorageServiceTraceProbabilityPost(params *StorageServiceTraceProbabilityPostParams) (*StorageServiceTraceProbabilityPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceTraceProbabilityPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceTraceProbabilityPost", + Method: "POST", + PathPattern: "/storage_service/trace_probability", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceTraceProbabilityPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceTraceProbabilityPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceTraceProbabilityPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceTruncateByKeyspacePost truncates + +Truncates (deletes) the given columnFamily from the provided keyspace. Calling truncate results in actual deletion of all data in the cluster under the given columnFamily and it will fail unless all hosts are up. All data in the given column family will be deleted, but its definition will not be affected. +*/ +func (a *Client) StorageServiceTruncateByKeyspacePost(params *StorageServiceTruncateByKeyspacePostParams) (*StorageServiceTruncateByKeyspacePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceTruncateByKeyspacePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceTruncateByKeyspacePost", + Method: "POST", + PathPattern: "/storage_service/truncate/{keyspace}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceTruncateByKeyspacePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceTruncateByKeyspacePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceTruncateByKeyspacePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceUpdateSnitchPost updates snitch + +Change endpointsnitch class and dynamic-ness (and dynamic attributes) at runtime +*/ +func (a *Client) StorageServiceUpdateSnitchPost(params *StorageServiceUpdateSnitchPostParams) (*StorageServiceUpdateSnitchPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceUpdateSnitchPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceUpdateSnitchPost", + Method: "POST", + PathPattern: "/storage_service/update_snitch", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceUpdateSnitchPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceUpdateSnitchPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceUpdateSnitchPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StorageServiceViewBuildStatusesByKeyspaceAndViewGet views build statuses + +Gets the progress of a materialized view build +*/ +func (a *Client) StorageServiceViewBuildStatusesByKeyspaceAndViewGet(params *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams) (*StorageServiceViewBuildStatusesByKeyspaceAndViewGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceViewBuildStatusesByKeyspaceAndViewGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceViewBuildStatusesByKeyspaceAndViewGet", + Method: "GET", + PathPattern: "/storage_service/view_build_statuses/{keyspace}/{view}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceViewBuildStatusesByKeyspaceAndViewGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceViewBuildStatusesByKeyspaceAndViewGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceViewBuildStatusesByKeyspaceAndViewGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StreamManagerGet gets current streams + +Returns the current state of all ongoing streams. +*/ +func (a *Client) StreamManagerGet(params *StreamManagerGetParams) (*StreamManagerGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStreamManagerGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StreamManagerGet", + Method: "GET", + PathPattern: "/stream_manager/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StreamManagerGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StreamManagerGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StreamManagerGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StreamManagerMetricsIncomingByPeerGet gets total incoming bytes + +Get total incoming bytes +*/ +func (a *Client) StreamManagerMetricsIncomingByPeerGet(params *StreamManagerMetricsIncomingByPeerGetParams) (*StreamManagerMetricsIncomingByPeerGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStreamManagerMetricsIncomingByPeerGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StreamManagerMetricsIncomingByPeerGet", + Method: "GET", + PathPattern: "/stream_manager/metrics/incoming/{peer}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StreamManagerMetricsIncomingByPeerGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StreamManagerMetricsIncomingByPeerGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StreamManagerMetricsIncomingByPeerGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StreamManagerMetricsIncomingGet gets all total incoming bytes + +Get all total incoming bytes +*/ +func (a *Client) StreamManagerMetricsIncomingGet(params *StreamManagerMetricsIncomingGetParams) (*StreamManagerMetricsIncomingGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStreamManagerMetricsIncomingGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StreamManagerMetricsIncomingGet", + Method: "GET", + PathPattern: "/stream_manager/metrics/incoming", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StreamManagerMetricsIncomingGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StreamManagerMetricsIncomingGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StreamManagerMetricsIncomingGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StreamManagerMetricsOutboundGet gets all active streams outbound + +Get number of active outbound streams +*/ +func (a *Client) StreamManagerMetricsOutboundGet(params *StreamManagerMetricsOutboundGetParams) (*StreamManagerMetricsOutboundGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStreamManagerMetricsOutboundGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StreamManagerMetricsOutboundGet", + Method: "GET", + PathPattern: "/stream_manager/metrics/outbound", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StreamManagerMetricsOutboundGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StreamManagerMetricsOutboundGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StreamManagerMetricsOutboundGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StreamManagerMetricsOutgoingByPeerGet gets total outgoing bytes + +Get total outgoing bytes +*/ +func (a *Client) StreamManagerMetricsOutgoingByPeerGet(params *StreamManagerMetricsOutgoingByPeerGetParams) (*StreamManagerMetricsOutgoingByPeerGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStreamManagerMetricsOutgoingByPeerGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StreamManagerMetricsOutgoingByPeerGet", + Method: "GET", + PathPattern: "/stream_manager/metrics/outgoing/{peer}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StreamManagerMetricsOutgoingByPeerGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StreamManagerMetricsOutgoingByPeerGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StreamManagerMetricsOutgoingByPeerGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +StreamManagerMetricsOutgoingGet gets all total outgoing bytes + +Get all total outgoing bytes +*/ +func (a *Client) StreamManagerMetricsOutgoingGet(params *StreamManagerMetricsOutgoingGetParams) (*StreamManagerMetricsOutgoingGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStreamManagerMetricsOutgoingGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StreamManagerMetricsOutgoingGet", + Method: "GET", + PathPattern: "/stream_manager/metrics/outgoing", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StreamManagerMetricsOutgoingGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StreamManagerMetricsOutgoingGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StreamManagerMetricsOutgoingGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +SystemLoggerByNameGet gets logger level + +Get logger level +*/ +func (a *Client) SystemLoggerByNameGet(params *SystemLoggerByNameGetParams) (*SystemLoggerByNameGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSystemLoggerByNameGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "SystemLoggerByNameGet", + Method: "GET", + PathPattern: "/system/logger/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SystemLoggerByNameGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SystemLoggerByNameGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SystemLoggerByNameGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +SystemLoggerByNamePost sets logger level + +Set logger level +*/ +func (a *Client) SystemLoggerByNamePost(params *SystemLoggerByNamePostParams) (*SystemLoggerByNamePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSystemLoggerByNamePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "SystemLoggerByNamePost", + Method: "POST", + PathPattern: "/system/logger/{name}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SystemLoggerByNamePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SystemLoggerByNamePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SystemLoggerByNamePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +SystemLoggerGet gets all logger names + +Get all logger names +*/ +func (a *Client) SystemLoggerGet(params *SystemLoggerGetParams) (*SystemLoggerGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSystemLoggerGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "SystemLoggerGet", + Method: "GET", + PathPattern: "/system/logger", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SystemLoggerGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SystemLoggerGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SystemLoggerGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +SystemLoggerPost sets all logger level + +Set all logger level +*/ +func (a *Client) SystemLoggerPost(params *SystemLoggerPostParams) (*SystemLoggerPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSystemLoggerPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "SystemLoggerPost", + Method: "POST", + PathPattern: "/system/logger", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SystemLoggerPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SystemLoggerPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SystemLoggerPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_datacenter_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_datacenter_get_parameters.go new file mode 100644 index 0000000000..f1f3e1e3be --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_datacenter_get_parameters.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewSnitchDatacenterGetParams creates a new SnitchDatacenterGetParams object +// with the default values initialized. +func NewSnitchDatacenterGetParams() *SnitchDatacenterGetParams { + var () + return &SnitchDatacenterGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSnitchDatacenterGetParamsWithTimeout creates a new SnitchDatacenterGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSnitchDatacenterGetParamsWithTimeout(timeout time.Duration) *SnitchDatacenterGetParams { + var () + return &SnitchDatacenterGetParams{ + + timeout: timeout, + } +} + +// NewSnitchDatacenterGetParamsWithContext creates a new SnitchDatacenterGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewSnitchDatacenterGetParamsWithContext(ctx context.Context) *SnitchDatacenterGetParams { + var () + return &SnitchDatacenterGetParams{ + + Context: ctx, + } +} + +// NewSnitchDatacenterGetParamsWithHTTPClient creates a new SnitchDatacenterGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSnitchDatacenterGetParamsWithHTTPClient(client *http.Client) *SnitchDatacenterGetParams { + var () + return &SnitchDatacenterGetParams{ + HTTPClient: client, + } +} + +/* +SnitchDatacenterGetParams contains all the parameters to send to the API endpoint +for the snitch datacenter get operation typically these are written to a http.Request +*/ +type SnitchDatacenterGetParams struct { + + /*Host + The host name. If absent, the local server broadcast/listen address is used + + */ + Host *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the snitch datacenter get params +func (o *SnitchDatacenterGetParams) WithTimeout(timeout time.Duration) *SnitchDatacenterGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the snitch datacenter get params +func (o *SnitchDatacenterGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the snitch datacenter get params +func (o *SnitchDatacenterGetParams) WithContext(ctx context.Context) *SnitchDatacenterGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the snitch datacenter get params +func (o *SnitchDatacenterGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the snitch datacenter get params +func (o *SnitchDatacenterGetParams) WithHTTPClient(client *http.Client) *SnitchDatacenterGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the snitch datacenter get params +func (o *SnitchDatacenterGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithHost adds the host to the snitch datacenter get params +func (o *SnitchDatacenterGetParams) WithHost(host *string) *SnitchDatacenterGetParams { + o.SetHost(host) + return o +} + +// SetHost adds the host to the snitch datacenter get params +func (o *SnitchDatacenterGetParams) SetHost(host *string) { + o.Host = host +} + +// WriteToRequest writes these params to a swagger request +func (o *SnitchDatacenterGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Host != nil { + + // query param host + var qrHost string + if o.Host != nil { + qrHost = *o.Host + } + qHost := qrHost + if qHost != "" { + if err := r.SetQueryParam("host", qHost); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_datacenter_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_datacenter_get_responses.go new file mode 100644 index 0000000000..d402686679 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_datacenter_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// SnitchDatacenterGetReader is a Reader for the SnitchDatacenterGet structure. +type SnitchDatacenterGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SnitchDatacenterGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSnitchDatacenterGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSnitchDatacenterGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSnitchDatacenterGetOK creates a SnitchDatacenterGetOK with default headers values +func NewSnitchDatacenterGetOK() *SnitchDatacenterGetOK { + return &SnitchDatacenterGetOK{} +} + +/* +SnitchDatacenterGetOK handles this case with default header values. + +Success +*/ +type SnitchDatacenterGetOK struct { + Payload string +} + +func (o *SnitchDatacenterGetOK) GetPayload() string { + return o.Payload +} + +func (o *SnitchDatacenterGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSnitchDatacenterGetDefault creates a SnitchDatacenterGetDefault with default headers values +func NewSnitchDatacenterGetDefault(code int) *SnitchDatacenterGetDefault { + return &SnitchDatacenterGetDefault{ + _statusCode: code, + } +} + +/* +SnitchDatacenterGetDefault handles this case with default header values. + +internal server error +*/ +type SnitchDatacenterGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the snitch datacenter get default response +func (o *SnitchDatacenterGetDefault) Code() int { + return o._statusCode +} + +func (o *SnitchDatacenterGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *SnitchDatacenterGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *SnitchDatacenterGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_name_get_parameters.go new file mode 100644 index 0000000000..6a1e52a346 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_name_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewSnitchNameGetParams creates a new SnitchNameGetParams object +// with the default values initialized. +func NewSnitchNameGetParams() *SnitchNameGetParams { + + return &SnitchNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSnitchNameGetParamsWithTimeout creates a new SnitchNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSnitchNameGetParamsWithTimeout(timeout time.Duration) *SnitchNameGetParams { + + return &SnitchNameGetParams{ + + timeout: timeout, + } +} + +// NewSnitchNameGetParamsWithContext creates a new SnitchNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewSnitchNameGetParamsWithContext(ctx context.Context) *SnitchNameGetParams { + + return &SnitchNameGetParams{ + + Context: ctx, + } +} + +// NewSnitchNameGetParamsWithHTTPClient creates a new SnitchNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSnitchNameGetParamsWithHTTPClient(client *http.Client) *SnitchNameGetParams { + + return &SnitchNameGetParams{ + HTTPClient: client, + } +} + +/* +SnitchNameGetParams contains all the parameters to send to the API endpoint +for the snitch name get operation typically these are written to a http.Request +*/ +type SnitchNameGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the snitch name get params +func (o *SnitchNameGetParams) WithTimeout(timeout time.Duration) *SnitchNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the snitch name get params +func (o *SnitchNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the snitch name get params +func (o *SnitchNameGetParams) WithContext(ctx context.Context) *SnitchNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the snitch name get params +func (o *SnitchNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the snitch name get params +func (o *SnitchNameGetParams) WithHTTPClient(client *http.Client) *SnitchNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the snitch name get params +func (o *SnitchNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *SnitchNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_name_get_responses.go new file mode 100644 index 0000000000..335537799d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// SnitchNameGetReader is a Reader for the SnitchNameGet structure. +type SnitchNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SnitchNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSnitchNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSnitchNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSnitchNameGetOK creates a SnitchNameGetOK with default headers values +func NewSnitchNameGetOK() *SnitchNameGetOK { + return &SnitchNameGetOK{} +} + +/* +SnitchNameGetOK handles this case with default header values. + +Success +*/ +type SnitchNameGetOK struct { + Payload string +} + +func (o *SnitchNameGetOK) GetPayload() string { + return o.Payload +} + +func (o *SnitchNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSnitchNameGetDefault creates a SnitchNameGetDefault with default headers values +func NewSnitchNameGetDefault(code int) *SnitchNameGetDefault { + return &SnitchNameGetDefault{ + _statusCode: code, + } +} + +/* +SnitchNameGetDefault handles this case with default header values. + +internal server error +*/ +type SnitchNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the snitch name get default response +func (o *SnitchNameGetDefault) Code() int { + return o._statusCode +} + +func (o *SnitchNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *SnitchNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *SnitchNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_rack_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_rack_get_parameters.go new file mode 100644 index 0000000000..b11cffded1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_rack_get_parameters.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewSnitchRackGetParams creates a new SnitchRackGetParams object +// with the default values initialized. +func NewSnitchRackGetParams() *SnitchRackGetParams { + var () + return &SnitchRackGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSnitchRackGetParamsWithTimeout creates a new SnitchRackGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSnitchRackGetParamsWithTimeout(timeout time.Duration) *SnitchRackGetParams { + var () + return &SnitchRackGetParams{ + + timeout: timeout, + } +} + +// NewSnitchRackGetParamsWithContext creates a new SnitchRackGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewSnitchRackGetParamsWithContext(ctx context.Context) *SnitchRackGetParams { + var () + return &SnitchRackGetParams{ + + Context: ctx, + } +} + +// NewSnitchRackGetParamsWithHTTPClient creates a new SnitchRackGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSnitchRackGetParamsWithHTTPClient(client *http.Client) *SnitchRackGetParams { + var () + return &SnitchRackGetParams{ + HTTPClient: client, + } +} + +/* +SnitchRackGetParams contains all the parameters to send to the API endpoint +for the snitch rack get operation typically these are written to a http.Request +*/ +type SnitchRackGetParams struct { + + /*Host + The host name. If absent, the local server broadcast/listen address is used + + */ + Host *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the snitch rack get params +func (o *SnitchRackGetParams) WithTimeout(timeout time.Duration) *SnitchRackGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the snitch rack get params +func (o *SnitchRackGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the snitch rack get params +func (o *SnitchRackGetParams) WithContext(ctx context.Context) *SnitchRackGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the snitch rack get params +func (o *SnitchRackGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the snitch rack get params +func (o *SnitchRackGetParams) WithHTTPClient(client *http.Client) *SnitchRackGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the snitch rack get params +func (o *SnitchRackGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithHost adds the host to the snitch rack get params +func (o *SnitchRackGetParams) WithHost(host *string) *SnitchRackGetParams { + o.SetHost(host) + return o +} + +// SetHost adds the host to the snitch rack get params +func (o *SnitchRackGetParams) SetHost(host *string) { + o.Host = host +} + +// WriteToRequest writes these params to a swagger request +func (o *SnitchRackGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Host != nil { + + // query param host + var qrHost string + if o.Host != nil { + qrHost = *o.Host + } + qHost := qrHost + if qHost != "" { + if err := r.SetQueryParam("host", qHost); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_rack_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_rack_get_responses.go new file mode 100644 index 0000000000..75fe44665a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/snitch_rack_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// SnitchRackGetReader is a Reader for the SnitchRackGet structure. +type SnitchRackGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SnitchRackGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSnitchRackGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSnitchRackGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSnitchRackGetOK creates a SnitchRackGetOK with default headers values +func NewSnitchRackGetOK() *SnitchRackGetOK { + return &SnitchRackGetOK{} +} + +/* +SnitchRackGetOK handles this case with default header values. + +Success +*/ +type SnitchRackGetOK struct { + Payload string +} + +func (o *SnitchRackGetOK) GetPayload() string { + return o.Payload +} + +func (o *SnitchRackGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSnitchRackGetDefault creates a SnitchRackGetDefault with default headers values +func NewSnitchRackGetDefault(code int) *SnitchRackGetDefault { + return &SnitchRackGetDefault{ + _statusCode: code, + } +} + +/* +SnitchRackGetDefault handles this case with default header values. + +internal server error +*/ +type SnitchRackGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the snitch rack get default response +func (o *SnitchRackGetDefault) Code() int { + return o._statusCode +} + +func (o *SnitchRackGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *SnitchRackGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *SnitchRackGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_cas_contention_timeout_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_cas_contention_timeout_get_parameters.go new file mode 100644 index 0000000000..d9a9ad87c1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_cas_contention_timeout_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyCasContentionTimeoutGetParams creates a new StorageProxyCasContentionTimeoutGetParams object +// with the default values initialized. +func NewStorageProxyCasContentionTimeoutGetParams() *StorageProxyCasContentionTimeoutGetParams { + + return &StorageProxyCasContentionTimeoutGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyCasContentionTimeoutGetParamsWithTimeout creates a new StorageProxyCasContentionTimeoutGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyCasContentionTimeoutGetParamsWithTimeout(timeout time.Duration) *StorageProxyCasContentionTimeoutGetParams { + + return &StorageProxyCasContentionTimeoutGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyCasContentionTimeoutGetParamsWithContext creates a new StorageProxyCasContentionTimeoutGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyCasContentionTimeoutGetParamsWithContext(ctx context.Context) *StorageProxyCasContentionTimeoutGetParams { + + return &StorageProxyCasContentionTimeoutGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyCasContentionTimeoutGetParamsWithHTTPClient creates a new StorageProxyCasContentionTimeoutGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyCasContentionTimeoutGetParamsWithHTTPClient(client *http.Client) *StorageProxyCasContentionTimeoutGetParams { + + return &StorageProxyCasContentionTimeoutGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyCasContentionTimeoutGetParams contains all the parameters to send to the API endpoint +for the storage proxy cas contention timeout get operation typically these are written to a http.Request +*/ +type StorageProxyCasContentionTimeoutGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy cas contention timeout get params +func (o *StorageProxyCasContentionTimeoutGetParams) WithTimeout(timeout time.Duration) *StorageProxyCasContentionTimeoutGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy cas contention timeout get params +func (o *StorageProxyCasContentionTimeoutGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy cas contention timeout get params +func (o *StorageProxyCasContentionTimeoutGetParams) WithContext(ctx context.Context) *StorageProxyCasContentionTimeoutGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy cas contention timeout get params +func (o *StorageProxyCasContentionTimeoutGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy cas contention timeout get params +func (o *StorageProxyCasContentionTimeoutGetParams) WithHTTPClient(client *http.Client) *StorageProxyCasContentionTimeoutGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy cas contention timeout get params +func (o *StorageProxyCasContentionTimeoutGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyCasContentionTimeoutGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_cas_contention_timeout_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_cas_contention_timeout_get_responses.go new file mode 100644 index 0000000000..5d95215d27 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_cas_contention_timeout_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyCasContentionTimeoutGetReader is a Reader for the StorageProxyCasContentionTimeoutGet structure. +type StorageProxyCasContentionTimeoutGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyCasContentionTimeoutGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyCasContentionTimeoutGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyCasContentionTimeoutGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyCasContentionTimeoutGetOK creates a StorageProxyCasContentionTimeoutGetOK with default headers values +func NewStorageProxyCasContentionTimeoutGetOK() *StorageProxyCasContentionTimeoutGetOK { + return &StorageProxyCasContentionTimeoutGetOK{} +} + +/* +StorageProxyCasContentionTimeoutGetOK handles this case with default header values. + +Success +*/ +type StorageProxyCasContentionTimeoutGetOK struct { + Payload interface{} +} + +func (o *StorageProxyCasContentionTimeoutGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyCasContentionTimeoutGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyCasContentionTimeoutGetDefault creates a StorageProxyCasContentionTimeoutGetDefault with default headers values +func NewStorageProxyCasContentionTimeoutGetDefault(code int) *StorageProxyCasContentionTimeoutGetDefault { + return &StorageProxyCasContentionTimeoutGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyCasContentionTimeoutGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyCasContentionTimeoutGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy cas contention timeout get default response +func (o *StorageProxyCasContentionTimeoutGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyCasContentionTimeoutGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyCasContentionTimeoutGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyCasContentionTimeoutGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_cas_contention_timeout_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_cas_contention_timeout_post_parameters.go new file mode 100644 index 0000000000..516eb67e1c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_cas_contention_timeout_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyCasContentionTimeoutPostParams creates a new StorageProxyCasContentionTimeoutPostParams object +// with the default values initialized. +func NewStorageProxyCasContentionTimeoutPostParams() *StorageProxyCasContentionTimeoutPostParams { + var () + return &StorageProxyCasContentionTimeoutPostParams{ + + requestTimeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyCasContentionTimeoutPostParamsWithTimeout creates a new StorageProxyCasContentionTimeoutPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyCasContentionTimeoutPostParamsWithTimeout(timeout time.Duration) *StorageProxyCasContentionTimeoutPostParams { + var () + return &StorageProxyCasContentionTimeoutPostParams{ + + requestTimeout: timeout, + } +} + +// NewStorageProxyCasContentionTimeoutPostParamsWithContext creates a new StorageProxyCasContentionTimeoutPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyCasContentionTimeoutPostParamsWithContext(ctx context.Context) *StorageProxyCasContentionTimeoutPostParams { + var () + return &StorageProxyCasContentionTimeoutPostParams{ + + Context: ctx, + } +} + +// NewStorageProxyCasContentionTimeoutPostParamsWithHTTPClient creates a new StorageProxyCasContentionTimeoutPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyCasContentionTimeoutPostParamsWithHTTPClient(client *http.Client) *StorageProxyCasContentionTimeoutPostParams { + var () + return &StorageProxyCasContentionTimeoutPostParams{ + HTTPClient: client, + } +} + +/* +StorageProxyCasContentionTimeoutPostParams contains all the parameters to send to the API endpoint +for the storage proxy cas contention timeout post operation typically these are written to a http.Request +*/ +type StorageProxyCasContentionTimeoutPostParams struct { + + /*Timeout + timeout in second + + */ + Timeout string + + requestTimeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithRequestTimeout adds the timeout to the storage proxy cas contention timeout post params +func (o *StorageProxyCasContentionTimeoutPostParams) WithRequestTimeout(timeout time.Duration) *StorageProxyCasContentionTimeoutPostParams { + o.SetRequestTimeout(timeout) + return o +} + +// SetRequestTimeout adds the timeout to the storage proxy cas contention timeout post params +func (o *StorageProxyCasContentionTimeoutPostParams) SetRequestTimeout(timeout time.Duration) { + o.requestTimeout = timeout +} + +// WithContext adds the context to the storage proxy cas contention timeout post params +func (o *StorageProxyCasContentionTimeoutPostParams) WithContext(ctx context.Context) *StorageProxyCasContentionTimeoutPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy cas contention timeout post params +func (o *StorageProxyCasContentionTimeoutPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy cas contention timeout post params +func (o *StorageProxyCasContentionTimeoutPostParams) WithHTTPClient(client *http.Client) *StorageProxyCasContentionTimeoutPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy cas contention timeout post params +func (o *StorageProxyCasContentionTimeoutPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTimeout adds the timeout to the storage proxy cas contention timeout post params +func (o *StorageProxyCasContentionTimeoutPostParams) WithTimeout(timeout string) *StorageProxyCasContentionTimeoutPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy cas contention timeout post params +func (o *StorageProxyCasContentionTimeoutPostParams) SetTimeout(timeout string) { + o.Timeout = timeout +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyCasContentionTimeoutPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.requestTimeout); err != nil { + return err + } + var res []error + + // query param timeout + qrTimeout := o.Timeout + qTimeout := qrTimeout + if qTimeout != "" { + if err := r.SetQueryParam("timeout", qTimeout); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_cas_contention_timeout_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_cas_contention_timeout_post_responses.go new file mode 100644 index 0000000000..2f4be7d1c7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_cas_contention_timeout_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyCasContentionTimeoutPostReader is a Reader for the StorageProxyCasContentionTimeoutPost structure. +type StorageProxyCasContentionTimeoutPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyCasContentionTimeoutPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyCasContentionTimeoutPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyCasContentionTimeoutPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyCasContentionTimeoutPostOK creates a StorageProxyCasContentionTimeoutPostOK with default headers values +func NewStorageProxyCasContentionTimeoutPostOK() *StorageProxyCasContentionTimeoutPostOK { + return &StorageProxyCasContentionTimeoutPostOK{} +} + +/* +StorageProxyCasContentionTimeoutPostOK handles this case with default header values. + +Success +*/ +type StorageProxyCasContentionTimeoutPostOK struct { +} + +func (o *StorageProxyCasContentionTimeoutPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyCasContentionTimeoutPostDefault creates a StorageProxyCasContentionTimeoutPostDefault with default headers values +func NewStorageProxyCasContentionTimeoutPostDefault(code int) *StorageProxyCasContentionTimeoutPostDefault { + return &StorageProxyCasContentionTimeoutPostDefault{ + _statusCode: code, + } +} + +/* +StorageProxyCasContentionTimeoutPostDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyCasContentionTimeoutPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy cas contention timeout post default response +func (o *StorageProxyCasContentionTimeoutPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyCasContentionTimeoutPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyCasContentionTimeoutPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyCasContentionTimeoutPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_counter_write_rpc_timeout_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_counter_write_rpc_timeout_get_parameters.go new file mode 100644 index 0000000000..f242dba937 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_counter_write_rpc_timeout_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyCounterWriteRPCTimeoutGetParams creates a new StorageProxyCounterWriteRPCTimeoutGetParams object +// with the default values initialized. +func NewStorageProxyCounterWriteRPCTimeoutGetParams() *StorageProxyCounterWriteRPCTimeoutGetParams { + + return &StorageProxyCounterWriteRPCTimeoutGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyCounterWriteRPCTimeoutGetParamsWithTimeout creates a new StorageProxyCounterWriteRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyCounterWriteRPCTimeoutGetParamsWithTimeout(timeout time.Duration) *StorageProxyCounterWriteRPCTimeoutGetParams { + + return &StorageProxyCounterWriteRPCTimeoutGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyCounterWriteRPCTimeoutGetParamsWithContext creates a new StorageProxyCounterWriteRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyCounterWriteRPCTimeoutGetParamsWithContext(ctx context.Context) *StorageProxyCounterWriteRPCTimeoutGetParams { + + return &StorageProxyCounterWriteRPCTimeoutGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyCounterWriteRPCTimeoutGetParamsWithHTTPClient creates a new StorageProxyCounterWriteRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyCounterWriteRPCTimeoutGetParamsWithHTTPClient(client *http.Client) *StorageProxyCounterWriteRPCTimeoutGetParams { + + return &StorageProxyCounterWriteRPCTimeoutGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyCounterWriteRPCTimeoutGetParams contains all the parameters to send to the API endpoint +for the storage proxy counter write Rpc timeout get operation typically these are written to a http.Request +*/ +type StorageProxyCounterWriteRPCTimeoutGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy counter write Rpc timeout get params +func (o *StorageProxyCounterWriteRPCTimeoutGetParams) WithTimeout(timeout time.Duration) *StorageProxyCounterWriteRPCTimeoutGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy counter write Rpc timeout get params +func (o *StorageProxyCounterWriteRPCTimeoutGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy counter write Rpc timeout get params +func (o *StorageProxyCounterWriteRPCTimeoutGetParams) WithContext(ctx context.Context) *StorageProxyCounterWriteRPCTimeoutGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy counter write Rpc timeout get params +func (o *StorageProxyCounterWriteRPCTimeoutGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy counter write Rpc timeout get params +func (o *StorageProxyCounterWriteRPCTimeoutGetParams) WithHTTPClient(client *http.Client) *StorageProxyCounterWriteRPCTimeoutGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy counter write Rpc timeout get params +func (o *StorageProxyCounterWriteRPCTimeoutGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyCounterWriteRPCTimeoutGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_counter_write_rpc_timeout_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_counter_write_rpc_timeout_get_responses.go new file mode 100644 index 0000000000..eb84a699b8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_counter_write_rpc_timeout_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyCounterWriteRPCTimeoutGetReader is a Reader for the StorageProxyCounterWriteRPCTimeoutGet structure. +type StorageProxyCounterWriteRPCTimeoutGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyCounterWriteRPCTimeoutGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyCounterWriteRPCTimeoutGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyCounterWriteRPCTimeoutGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyCounterWriteRPCTimeoutGetOK creates a StorageProxyCounterWriteRPCTimeoutGetOK with default headers values +func NewStorageProxyCounterWriteRPCTimeoutGetOK() *StorageProxyCounterWriteRPCTimeoutGetOK { + return &StorageProxyCounterWriteRPCTimeoutGetOK{} +} + +/* +StorageProxyCounterWriteRPCTimeoutGetOK handles this case with default header values. + +Success +*/ +type StorageProxyCounterWriteRPCTimeoutGetOK struct { + Payload interface{} +} + +func (o *StorageProxyCounterWriteRPCTimeoutGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyCounterWriteRPCTimeoutGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyCounterWriteRPCTimeoutGetDefault creates a StorageProxyCounterWriteRPCTimeoutGetDefault with default headers values +func NewStorageProxyCounterWriteRPCTimeoutGetDefault(code int) *StorageProxyCounterWriteRPCTimeoutGetDefault { + return &StorageProxyCounterWriteRPCTimeoutGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyCounterWriteRPCTimeoutGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyCounterWriteRPCTimeoutGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy counter write Rpc timeout get default response +func (o *StorageProxyCounterWriteRPCTimeoutGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyCounterWriteRPCTimeoutGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyCounterWriteRPCTimeoutGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyCounterWriteRPCTimeoutGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_counter_write_rpc_timeout_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_counter_write_rpc_timeout_post_parameters.go new file mode 100644 index 0000000000..8d6e89d47c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_counter_write_rpc_timeout_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyCounterWriteRPCTimeoutPostParams creates a new StorageProxyCounterWriteRPCTimeoutPostParams object +// with the default values initialized. +func NewStorageProxyCounterWriteRPCTimeoutPostParams() *StorageProxyCounterWriteRPCTimeoutPostParams { + var () + return &StorageProxyCounterWriteRPCTimeoutPostParams{ + + requestTimeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyCounterWriteRPCTimeoutPostParamsWithTimeout creates a new StorageProxyCounterWriteRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyCounterWriteRPCTimeoutPostParamsWithTimeout(timeout time.Duration) *StorageProxyCounterWriteRPCTimeoutPostParams { + var () + return &StorageProxyCounterWriteRPCTimeoutPostParams{ + + requestTimeout: timeout, + } +} + +// NewStorageProxyCounterWriteRPCTimeoutPostParamsWithContext creates a new StorageProxyCounterWriteRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyCounterWriteRPCTimeoutPostParamsWithContext(ctx context.Context) *StorageProxyCounterWriteRPCTimeoutPostParams { + var () + return &StorageProxyCounterWriteRPCTimeoutPostParams{ + + Context: ctx, + } +} + +// NewStorageProxyCounterWriteRPCTimeoutPostParamsWithHTTPClient creates a new StorageProxyCounterWriteRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyCounterWriteRPCTimeoutPostParamsWithHTTPClient(client *http.Client) *StorageProxyCounterWriteRPCTimeoutPostParams { + var () + return &StorageProxyCounterWriteRPCTimeoutPostParams{ + HTTPClient: client, + } +} + +/* +StorageProxyCounterWriteRPCTimeoutPostParams contains all the parameters to send to the API endpoint +for the storage proxy counter write Rpc timeout post operation typically these are written to a http.Request +*/ +type StorageProxyCounterWriteRPCTimeoutPostParams struct { + + /*Timeout + timeout in seconds + + */ + Timeout string + + requestTimeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithRequestTimeout adds the timeout to the storage proxy counter write Rpc timeout post params +func (o *StorageProxyCounterWriteRPCTimeoutPostParams) WithRequestTimeout(timeout time.Duration) *StorageProxyCounterWriteRPCTimeoutPostParams { + o.SetRequestTimeout(timeout) + return o +} + +// SetRequestTimeout adds the timeout to the storage proxy counter write Rpc timeout post params +func (o *StorageProxyCounterWriteRPCTimeoutPostParams) SetRequestTimeout(timeout time.Duration) { + o.requestTimeout = timeout +} + +// WithContext adds the context to the storage proxy counter write Rpc timeout post params +func (o *StorageProxyCounterWriteRPCTimeoutPostParams) WithContext(ctx context.Context) *StorageProxyCounterWriteRPCTimeoutPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy counter write Rpc timeout post params +func (o *StorageProxyCounterWriteRPCTimeoutPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy counter write Rpc timeout post params +func (o *StorageProxyCounterWriteRPCTimeoutPostParams) WithHTTPClient(client *http.Client) *StorageProxyCounterWriteRPCTimeoutPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy counter write Rpc timeout post params +func (o *StorageProxyCounterWriteRPCTimeoutPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTimeout adds the timeout to the storage proxy counter write Rpc timeout post params +func (o *StorageProxyCounterWriteRPCTimeoutPostParams) WithTimeout(timeout string) *StorageProxyCounterWriteRPCTimeoutPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy counter write Rpc timeout post params +func (o *StorageProxyCounterWriteRPCTimeoutPostParams) SetTimeout(timeout string) { + o.Timeout = timeout +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyCounterWriteRPCTimeoutPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.requestTimeout); err != nil { + return err + } + var res []error + + // query param timeout + qrTimeout := o.Timeout + qTimeout := qrTimeout + if qTimeout != "" { + if err := r.SetQueryParam("timeout", qTimeout); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_counter_write_rpc_timeout_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_counter_write_rpc_timeout_post_responses.go new file mode 100644 index 0000000000..93c0f49ff2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_counter_write_rpc_timeout_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyCounterWriteRPCTimeoutPostReader is a Reader for the StorageProxyCounterWriteRPCTimeoutPost structure. +type StorageProxyCounterWriteRPCTimeoutPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyCounterWriteRPCTimeoutPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyCounterWriteRPCTimeoutPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyCounterWriteRPCTimeoutPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyCounterWriteRPCTimeoutPostOK creates a StorageProxyCounterWriteRPCTimeoutPostOK with default headers values +func NewStorageProxyCounterWriteRPCTimeoutPostOK() *StorageProxyCounterWriteRPCTimeoutPostOK { + return &StorageProxyCounterWriteRPCTimeoutPostOK{} +} + +/* +StorageProxyCounterWriteRPCTimeoutPostOK handles this case with default header values. + +Success +*/ +type StorageProxyCounterWriteRPCTimeoutPostOK struct { +} + +func (o *StorageProxyCounterWriteRPCTimeoutPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyCounterWriteRPCTimeoutPostDefault creates a StorageProxyCounterWriteRPCTimeoutPostDefault with default headers values +func NewStorageProxyCounterWriteRPCTimeoutPostDefault(code int) *StorageProxyCounterWriteRPCTimeoutPostDefault { + return &StorageProxyCounterWriteRPCTimeoutPostDefault{ + _statusCode: code, + } +} + +/* +StorageProxyCounterWriteRPCTimeoutPostDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyCounterWriteRPCTimeoutPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy counter write Rpc timeout post default response +func (o *StorageProxyCounterWriteRPCTimeoutPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyCounterWriteRPCTimeoutPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyCounterWriteRPCTimeoutPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyCounterWriteRPCTimeoutPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_by_dc_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_by_dc_get_parameters.go new file mode 100644 index 0000000000..2924343364 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_by_dc_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyHintedHandoffEnabledByDcGetParams creates a new StorageProxyHintedHandoffEnabledByDcGetParams object +// with the default values initialized. +func NewStorageProxyHintedHandoffEnabledByDcGetParams() *StorageProxyHintedHandoffEnabledByDcGetParams { + + return &StorageProxyHintedHandoffEnabledByDcGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyHintedHandoffEnabledByDcGetParamsWithTimeout creates a new StorageProxyHintedHandoffEnabledByDcGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyHintedHandoffEnabledByDcGetParamsWithTimeout(timeout time.Duration) *StorageProxyHintedHandoffEnabledByDcGetParams { + + return &StorageProxyHintedHandoffEnabledByDcGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyHintedHandoffEnabledByDcGetParamsWithContext creates a new StorageProxyHintedHandoffEnabledByDcGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyHintedHandoffEnabledByDcGetParamsWithContext(ctx context.Context) *StorageProxyHintedHandoffEnabledByDcGetParams { + + return &StorageProxyHintedHandoffEnabledByDcGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyHintedHandoffEnabledByDcGetParamsWithHTTPClient creates a new StorageProxyHintedHandoffEnabledByDcGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyHintedHandoffEnabledByDcGetParamsWithHTTPClient(client *http.Client) *StorageProxyHintedHandoffEnabledByDcGetParams { + + return &StorageProxyHintedHandoffEnabledByDcGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyHintedHandoffEnabledByDcGetParams contains all the parameters to send to the API endpoint +for the storage proxy hinted handoff enabled by dc get operation typically these are written to a http.Request +*/ +type StorageProxyHintedHandoffEnabledByDcGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy hinted handoff enabled by dc get params +func (o *StorageProxyHintedHandoffEnabledByDcGetParams) WithTimeout(timeout time.Duration) *StorageProxyHintedHandoffEnabledByDcGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy hinted handoff enabled by dc get params +func (o *StorageProxyHintedHandoffEnabledByDcGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy hinted handoff enabled by dc get params +func (o *StorageProxyHintedHandoffEnabledByDcGetParams) WithContext(ctx context.Context) *StorageProxyHintedHandoffEnabledByDcGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy hinted handoff enabled by dc get params +func (o *StorageProxyHintedHandoffEnabledByDcGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy hinted handoff enabled by dc get params +func (o *StorageProxyHintedHandoffEnabledByDcGetParams) WithHTTPClient(client *http.Client) *StorageProxyHintedHandoffEnabledByDcGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy hinted handoff enabled by dc get params +func (o *StorageProxyHintedHandoffEnabledByDcGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyHintedHandoffEnabledByDcGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_by_dc_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_by_dc_get_responses.go new file mode 100644 index 0000000000..11d4512f29 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_by_dc_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyHintedHandoffEnabledByDcGetReader is a Reader for the StorageProxyHintedHandoffEnabledByDcGet structure. +type StorageProxyHintedHandoffEnabledByDcGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyHintedHandoffEnabledByDcGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyHintedHandoffEnabledByDcGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyHintedHandoffEnabledByDcGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyHintedHandoffEnabledByDcGetOK creates a StorageProxyHintedHandoffEnabledByDcGetOK with default headers values +func NewStorageProxyHintedHandoffEnabledByDcGetOK() *StorageProxyHintedHandoffEnabledByDcGetOK { + return &StorageProxyHintedHandoffEnabledByDcGetOK{} +} + +/* +StorageProxyHintedHandoffEnabledByDcGetOK handles this case with default header values. + +Success +*/ +type StorageProxyHintedHandoffEnabledByDcGetOK struct { + Payload []*models.MapperList +} + +func (o *StorageProxyHintedHandoffEnabledByDcGetOK) GetPayload() []*models.MapperList { + return o.Payload +} + +func (o *StorageProxyHintedHandoffEnabledByDcGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyHintedHandoffEnabledByDcGetDefault creates a StorageProxyHintedHandoffEnabledByDcGetDefault with default headers values +func NewStorageProxyHintedHandoffEnabledByDcGetDefault(code int) *StorageProxyHintedHandoffEnabledByDcGetDefault { + return &StorageProxyHintedHandoffEnabledByDcGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyHintedHandoffEnabledByDcGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyHintedHandoffEnabledByDcGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy hinted handoff enabled by dc get default response +func (o *StorageProxyHintedHandoffEnabledByDcGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyHintedHandoffEnabledByDcGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyHintedHandoffEnabledByDcGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyHintedHandoffEnabledByDcGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_by_dc_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_by_dc_post_parameters.go new file mode 100644 index 0000000000..6b58dd4757 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_by_dc_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyHintedHandoffEnabledByDcPostParams creates a new StorageProxyHintedHandoffEnabledByDcPostParams object +// with the default values initialized. +func NewStorageProxyHintedHandoffEnabledByDcPostParams() *StorageProxyHintedHandoffEnabledByDcPostParams { + var () + return &StorageProxyHintedHandoffEnabledByDcPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyHintedHandoffEnabledByDcPostParamsWithTimeout creates a new StorageProxyHintedHandoffEnabledByDcPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyHintedHandoffEnabledByDcPostParamsWithTimeout(timeout time.Duration) *StorageProxyHintedHandoffEnabledByDcPostParams { + var () + return &StorageProxyHintedHandoffEnabledByDcPostParams{ + + timeout: timeout, + } +} + +// NewStorageProxyHintedHandoffEnabledByDcPostParamsWithContext creates a new StorageProxyHintedHandoffEnabledByDcPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyHintedHandoffEnabledByDcPostParamsWithContext(ctx context.Context) *StorageProxyHintedHandoffEnabledByDcPostParams { + var () + return &StorageProxyHintedHandoffEnabledByDcPostParams{ + + Context: ctx, + } +} + +// NewStorageProxyHintedHandoffEnabledByDcPostParamsWithHTTPClient creates a new StorageProxyHintedHandoffEnabledByDcPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyHintedHandoffEnabledByDcPostParamsWithHTTPClient(client *http.Client) *StorageProxyHintedHandoffEnabledByDcPostParams { + var () + return &StorageProxyHintedHandoffEnabledByDcPostParams{ + HTTPClient: client, + } +} + +/* +StorageProxyHintedHandoffEnabledByDcPostParams contains all the parameters to send to the API endpoint +for the storage proxy hinted handoff enabled by dc post operation typically these are written to a http.Request +*/ +type StorageProxyHintedHandoffEnabledByDcPostParams struct { + + /*Dcs + The dcs to enable in the CSV format + + */ + Dcs string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy hinted handoff enabled by dc post params +func (o *StorageProxyHintedHandoffEnabledByDcPostParams) WithTimeout(timeout time.Duration) *StorageProxyHintedHandoffEnabledByDcPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy hinted handoff enabled by dc post params +func (o *StorageProxyHintedHandoffEnabledByDcPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy hinted handoff enabled by dc post params +func (o *StorageProxyHintedHandoffEnabledByDcPostParams) WithContext(ctx context.Context) *StorageProxyHintedHandoffEnabledByDcPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy hinted handoff enabled by dc post params +func (o *StorageProxyHintedHandoffEnabledByDcPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy hinted handoff enabled by dc post params +func (o *StorageProxyHintedHandoffEnabledByDcPostParams) WithHTTPClient(client *http.Client) *StorageProxyHintedHandoffEnabledByDcPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy hinted handoff enabled by dc post params +func (o *StorageProxyHintedHandoffEnabledByDcPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDcs adds the dcs to the storage proxy hinted handoff enabled by dc post params +func (o *StorageProxyHintedHandoffEnabledByDcPostParams) WithDcs(dcs string) *StorageProxyHintedHandoffEnabledByDcPostParams { + o.SetDcs(dcs) + return o +} + +// SetDcs adds the dcs to the storage proxy hinted handoff enabled by dc post params +func (o *StorageProxyHintedHandoffEnabledByDcPostParams) SetDcs(dcs string) { + o.Dcs = dcs +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyHintedHandoffEnabledByDcPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param dcs + qrDcs := o.Dcs + qDcs := qrDcs + if qDcs != "" { + if err := r.SetQueryParam("dcs", qDcs); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_by_dc_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_by_dc_post_responses.go new file mode 100644 index 0000000000..f241dcd83c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_by_dc_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyHintedHandoffEnabledByDcPostReader is a Reader for the StorageProxyHintedHandoffEnabledByDcPost structure. +type StorageProxyHintedHandoffEnabledByDcPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyHintedHandoffEnabledByDcPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyHintedHandoffEnabledByDcPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyHintedHandoffEnabledByDcPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyHintedHandoffEnabledByDcPostOK creates a StorageProxyHintedHandoffEnabledByDcPostOK with default headers values +func NewStorageProxyHintedHandoffEnabledByDcPostOK() *StorageProxyHintedHandoffEnabledByDcPostOK { + return &StorageProxyHintedHandoffEnabledByDcPostOK{} +} + +/* +StorageProxyHintedHandoffEnabledByDcPostOK handles this case with default header values. + +Success +*/ +type StorageProxyHintedHandoffEnabledByDcPostOK struct { +} + +func (o *StorageProxyHintedHandoffEnabledByDcPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyHintedHandoffEnabledByDcPostDefault creates a StorageProxyHintedHandoffEnabledByDcPostDefault with default headers values +func NewStorageProxyHintedHandoffEnabledByDcPostDefault(code int) *StorageProxyHintedHandoffEnabledByDcPostDefault { + return &StorageProxyHintedHandoffEnabledByDcPostDefault{ + _statusCode: code, + } +} + +/* +StorageProxyHintedHandoffEnabledByDcPostDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyHintedHandoffEnabledByDcPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy hinted handoff enabled by dc post default response +func (o *StorageProxyHintedHandoffEnabledByDcPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyHintedHandoffEnabledByDcPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyHintedHandoffEnabledByDcPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyHintedHandoffEnabledByDcPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_get_parameters.go new file mode 100644 index 0000000000..2956c9ee1a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyHintedHandoffEnabledGetParams creates a new StorageProxyHintedHandoffEnabledGetParams object +// with the default values initialized. +func NewStorageProxyHintedHandoffEnabledGetParams() *StorageProxyHintedHandoffEnabledGetParams { + + return &StorageProxyHintedHandoffEnabledGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyHintedHandoffEnabledGetParamsWithTimeout creates a new StorageProxyHintedHandoffEnabledGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyHintedHandoffEnabledGetParamsWithTimeout(timeout time.Duration) *StorageProxyHintedHandoffEnabledGetParams { + + return &StorageProxyHintedHandoffEnabledGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyHintedHandoffEnabledGetParamsWithContext creates a new StorageProxyHintedHandoffEnabledGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyHintedHandoffEnabledGetParamsWithContext(ctx context.Context) *StorageProxyHintedHandoffEnabledGetParams { + + return &StorageProxyHintedHandoffEnabledGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyHintedHandoffEnabledGetParamsWithHTTPClient creates a new StorageProxyHintedHandoffEnabledGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyHintedHandoffEnabledGetParamsWithHTTPClient(client *http.Client) *StorageProxyHintedHandoffEnabledGetParams { + + return &StorageProxyHintedHandoffEnabledGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyHintedHandoffEnabledGetParams contains all the parameters to send to the API endpoint +for the storage proxy hinted handoff enabled get operation typically these are written to a http.Request +*/ +type StorageProxyHintedHandoffEnabledGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy hinted handoff enabled get params +func (o *StorageProxyHintedHandoffEnabledGetParams) WithTimeout(timeout time.Duration) *StorageProxyHintedHandoffEnabledGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy hinted handoff enabled get params +func (o *StorageProxyHintedHandoffEnabledGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy hinted handoff enabled get params +func (o *StorageProxyHintedHandoffEnabledGetParams) WithContext(ctx context.Context) *StorageProxyHintedHandoffEnabledGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy hinted handoff enabled get params +func (o *StorageProxyHintedHandoffEnabledGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy hinted handoff enabled get params +func (o *StorageProxyHintedHandoffEnabledGetParams) WithHTTPClient(client *http.Client) *StorageProxyHintedHandoffEnabledGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy hinted handoff enabled get params +func (o *StorageProxyHintedHandoffEnabledGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyHintedHandoffEnabledGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_get_responses.go new file mode 100644 index 0000000000..1724d039fc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyHintedHandoffEnabledGetReader is a Reader for the StorageProxyHintedHandoffEnabledGet structure. +type StorageProxyHintedHandoffEnabledGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyHintedHandoffEnabledGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyHintedHandoffEnabledGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyHintedHandoffEnabledGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyHintedHandoffEnabledGetOK creates a StorageProxyHintedHandoffEnabledGetOK with default headers values +func NewStorageProxyHintedHandoffEnabledGetOK() *StorageProxyHintedHandoffEnabledGetOK { + return &StorageProxyHintedHandoffEnabledGetOK{} +} + +/* +StorageProxyHintedHandoffEnabledGetOK handles this case with default header values. + +Success +*/ +type StorageProxyHintedHandoffEnabledGetOK struct { + Payload bool +} + +func (o *StorageProxyHintedHandoffEnabledGetOK) GetPayload() bool { + return o.Payload +} + +func (o *StorageProxyHintedHandoffEnabledGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyHintedHandoffEnabledGetDefault creates a StorageProxyHintedHandoffEnabledGetDefault with default headers values +func NewStorageProxyHintedHandoffEnabledGetDefault(code int) *StorageProxyHintedHandoffEnabledGetDefault { + return &StorageProxyHintedHandoffEnabledGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyHintedHandoffEnabledGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyHintedHandoffEnabledGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy hinted handoff enabled get default response +func (o *StorageProxyHintedHandoffEnabledGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyHintedHandoffEnabledGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyHintedHandoffEnabledGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyHintedHandoffEnabledGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_post_parameters.go new file mode 100644 index 0000000000..d0521c4d8f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageProxyHintedHandoffEnabledPostParams creates a new StorageProxyHintedHandoffEnabledPostParams object +// with the default values initialized. +func NewStorageProxyHintedHandoffEnabledPostParams() *StorageProxyHintedHandoffEnabledPostParams { + var () + return &StorageProxyHintedHandoffEnabledPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyHintedHandoffEnabledPostParamsWithTimeout creates a new StorageProxyHintedHandoffEnabledPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyHintedHandoffEnabledPostParamsWithTimeout(timeout time.Duration) *StorageProxyHintedHandoffEnabledPostParams { + var () + return &StorageProxyHintedHandoffEnabledPostParams{ + + timeout: timeout, + } +} + +// NewStorageProxyHintedHandoffEnabledPostParamsWithContext creates a new StorageProxyHintedHandoffEnabledPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyHintedHandoffEnabledPostParamsWithContext(ctx context.Context) *StorageProxyHintedHandoffEnabledPostParams { + var () + return &StorageProxyHintedHandoffEnabledPostParams{ + + Context: ctx, + } +} + +// NewStorageProxyHintedHandoffEnabledPostParamsWithHTTPClient creates a new StorageProxyHintedHandoffEnabledPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyHintedHandoffEnabledPostParamsWithHTTPClient(client *http.Client) *StorageProxyHintedHandoffEnabledPostParams { + var () + return &StorageProxyHintedHandoffEnabledPostParams{ + HTTPClient: client, + } +} + +/* +StorageProxyHintedHandoffEnabledPostParams contains all the parameters to send to the API endpoint +for the storage proxy hinted handoff enabled post operation typically these are written to a http.Request +*/ +type StorageProxyHintedHandoffEnabledPostParams struct { + + /*Enable + Set to true to enable hinted handoff + + */ + Enable bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy hinted handoff enabled post params +func (o *StorageProxyHintedHandoffEnabledPostParams) WithTimeout(timeout time.Duration) *StorageProxyHintedHandoffEnabledPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy hinted handoff enabled post params +func (o *StorageProxyHintedHandoffEnabledPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy hinted handoff enabled post params +func (o *StorageProxyHintedHandoffEnabledPostParams) WithContext(ctx context.Context) *StorageProxyHintedHandoffEnabledPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy hinted handoff enabled post params +func (o *StorageProxyHintedHandoffEnabledPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy hinted handoff enabled post params +func (o *StorageProxyHintedHandoffEnabledPostParams) WithHTTPClient(client *http.Client) *StorageProxyHintedHandoffEnabledPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy hinted handoff enabled post params +func (o *StorageProxyHintedHandoffEnabledPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEnable adds the enable to the storage proxy hinted handoff enabled post params +func (o *StorageProxyHintedHandoffEnabledPostParams) WithEnable(enable bool) *StorageProxyHintedHandoffEnabledPostParams { + o.SetEnable(enable) + return o +} + +// SetEnable adds the enable to the storage proxy hinted handoff enabled post params +func (o *StorageProxyHintedHandoffEnabledPostParams) SetEnable(enable bool) { + o.Enable = enable +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyHintedHandoffEnabledPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param enable + qrEnable := o.Enable + qEnable := swag.FormatBool(qrEnable) + if qEnable != "" { + if err := r.SetQueryParam("enable", qEnable); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_post_responses.go new file mode 100644 index 0000000000..deabfc55c7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hinted_handoff_enabled_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyHintedHandoffEnabledPostReader is a Reader for the StorageProxyHintedHandoffEnabledPost structure. +type StorageProxyHintedHandoffEnabledPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyHintedHandoffEnabledPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyHintedHandoffEnabledPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyHintedHandoffEnabledPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyHintedHandoffEnabledPostOK creates a StorageProxyHintedHandoffEnabledPostOK with default headers values +func NewStorageProxyHintedHandoffEnabledPostOK() *StorageProxyHintedHandoffEnabledPostOK { + return &StorageProxyHintedHandoffEnabledPostOK{} +} + +/* +StorageProxyHintedHandoffEnabledPostOK handles this case with default header values. + +Success +*/ +type StorageProxyHintedHandoffEnabledPostOK struct { +} + +func (o *StorageProxyHintedHandoffEnabledPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyHintedHandoffEnabledPostDefault creates a StorageProxyHintedHandoffEnabledPostDefault with default headers values +func NewStorageProxyHintedHandoffEnabledPostDefault(code int) *StorageProxyHintedHandoffEnabledPostDefault { + return &StorageProxyHintedHandoffEnabledPostDefault{ + _statusCode: code, + } +} + +/* +StorageProxyHintedHandoffEnabledPostDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyHintedHandoffEnabledPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy hinted handoff enabled post default response +func (o *StorageProxyHintedHandoffEnabledPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyHintedHandoffEnabledPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyHintedHandoffEnabledPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyHintedHandoffEnabledPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hints_in_progress_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hints_in_progress_get_parameters.go new file mode 100644 index 0000000000..67ca192613 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hints_in_progress_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyHintsInProgressGetParams creates a new StorageProxyHintsInProgressGetParams object +// with the default values initialized. +func NewStorageProxyHintsInProgressGetParams() *StorageProxyHintsInProgressGetParams { + + return &StorageProxyHintsInProgressGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyHintsInProgressGetParamsWithTimeout creates a new StorageProxyHintsInProgressGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyHintsInProgressGetParamsWithTimeout(timeout time.Duration) *StorageProxyHintsInProgressGetParams { + + return &StorageProxyHintsInProgressGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyHintsInProgressGetParamsWithContext creates a new StorageProxyHintsInProgressGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyHintsInProgressGetParamsWithContext(ctx context.Context) *StorageProxyHintsInProgressGetParams { + + return &StorageProxyHintsInProgressGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyHintsInProgressGetParamsWithHTTPClient creates a new StorageProxyHintsInProgressGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyHintsInProgressGetParamsWithHTTPClient(client *http.Client) *StorageProxyHintsInProgressGetParams { + + return &StorageProxyHintsInProgressGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyHintsInProgressGetParams contains all the parameters to send to the API endpoint +for the storage proxy hints in progress get operation typically these are written to a http.Request +*/ +type StorageProxyHintsInProgressGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy hints in progress get params +func (o *StorageProxyHintsInProgressGetParams) WithTimeout(timeout time.Duration) *StorageProxyHintsInProgressGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy hints in progress get params +func (o *StorageProxyHintsInProgressGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy hints in progress get params +func (o *StorageProxyHintsInProgressGetParams) WithContext(ctx context.Context) *StorageProxyHintsInProgressGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy hints in progress get params +func (o *StorageProxyHintsInProgressGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy hints in progress get params +func (o *StorageProxyHintsInProgressGetParams) WithHTTPClient(client *http.Client) *StorageProxyHintsInProgressGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy hints in progress get params +func (o *StorageProxyHintsInProgressGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyHintsInProgressGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hints_in_progress_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hints_in_progress_get_responses.go new file mode 100644 index 0000000000..7919780b84 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_hints_in_progress_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyHintsInProgressGetReader is a Reader for the StorageProxyHintsInProgressGet structure. +type StorageProxyHintsInProgressGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyHintsInProgressGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyHintsInProgressGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyHintsInProgressGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyHintsInProgressGetOK creates a StorageProxyHintsInProgressGetOK with default headers values +func NewStorageProxyHintsInProgressGetOK() *StorageProxyHintsInProgressGetOK { + return &StorageProxyHintsInProgressGetOK{} +} + +/* +StorageProxyHintsInProgressGetOK handles this case with default header values. + +Success +*/ +type StorageProxyHintsInProgressGetOK struct { + Payload int32 +} + +func (o *StorageProxyHintsInProgressGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyHintsInProgressGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyHintsInProgressGetDefault creates a StorageProxyHintsInProgressGetDefault with default headers values +func NewStorageProxyHintsInProgressGetDefault(code int) *StorageProxyHintsInProgressGetDefault { + return &StorageProxyHintsInProgressGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyHintsInProgressGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyHintsInProgressGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy hints in progress get default response +func (o *StorageProxyHintsInProgressGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyHintsInProgressGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyHintsInProgressGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyHintsInProgressGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hint_window_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hint_window_get_parameters.go new file mode 100644 index 0000000000..2afac1eb53 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hint_window_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMaxHintWindowGetParams creates a new StorageProxyMaxHintWindowGetParams object +// with the default values initialized. +func NewStorageProxyMaxHintWindowGetParams() *StorageProxyMaxHintWindowGetParams { + + return &StorageProxyMaxHintWindowGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMaxHintWindowGetParamsWithTimeout creates a new StorageProxyMaxHintWindowGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMaxHintWindowGetParamsWithTimeout(timeout time.Duration) *StorageProxyMaxHintWindowGetParams { + + return &StorageProxyMaxHintWindowGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMaxHintWindowGetParamsWithContext creates a new StorageProxyMaxHintWindowGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMaxHintWindowGetParamsWithContext(ctx context.Context) *StorageProxyMaxHintWindowGetParams { + + return &StorageProxyMaxHintWindowGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMaxHintWindowGetParamsWithHTTPClient creates a new StorageProxyMaxHintWindowGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMaxHintWindowGetParamsWithHTTPClient(client *http.Client) *StorageProxyMaxHintWindowGetParams { + + return &StorageProxyMaxHintWindowGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMaxHintWindowGetParams contains all the parameters to send to the API endpoint +for the storage proxy max hint window get operation typically these are written to a http.Request +*/ +type StorageProxyMaxHintWindowGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy max hint window get params +func (o *StorageProxyMaxHintWindowGetParams) WithTimeout(timeout time.Duration) *StorageProxyMaxHintWindowGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy max hint window get params +func (o *StorageProxyMaxHintWindowGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy max hint window get params +func (o *StorageProxyMaxHintWindowGetParams) WithContext(ctx context.Context) *StorageProxyMaxHintWindowGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy max hint window get params +func (o *StorageProxyMaxHintWindowGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy max hint window get params +func (o *StorageProxyMaxHintWindowGetParams) WithHTTPClient(client *http.Client) *StorageProxyMaxHintWindowGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy max hint window get params +func (o *StorageProxyMaxHintWindowGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMaxHintWindowGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hint_window_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hint_window_get_responses.go new file mode 100644 index 0000000000..d169895cfc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hint_window_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMaxHintWindowGetReader is a Reader for the StorageProxyMaxHintWindowGet structure. +type StorageProxyMaxHintWindowGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMaxHintWindowGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMaxHintWindowGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMaxHintWindowGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMaxHintWindowGetOK creates a StorageProxyMaxHintWindowGetOK with default headers values +func NewStorageProxyMaxHintWindowGetOK() *StorageProxyMaxHintWindowGetOK { + return &StorageProxyMaxHintWindowGetOK{} +} + +/* +StorageProxyMaxHintWindowGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMaxHintWindowGetOK struct { + Payload int32 +} + +func (o *StorageProxyMaxHintWindowGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyMaxHintWindowGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMaxHintWindowGetDefault creates a StorageProxyMaxHintWindowGetDefault with default headers values +func NewStorageProxyMaxHintWindowGetDefault(code int) *StorageProxyMaxHintWindowGetDefault { + return &StorageProxyMaxHintWindowGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMaxHintWindowGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMaxHintWindowGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy max hint window get default response +func (o *StorageProxyMaxHintWindowGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMaxHintWindowGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMaxHintWindowGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMaxHintWindowGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hint_window_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hint_window_post_parameters.go new file mode 100644 index 0000000000..1408e025c6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hint_window_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageProxyMaxHintWindowPostParams creates a new StorageProxyMaxHintWindowPostParams object +// with the default values initialized. +func NewStorageProxyMaxHintWindowPostParams() *StorageProxyMaxHintWindowPostParams { + var () + return &StorageProxyMaxHintWindowPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMaxHintWindowPostParamsWithTimeout creates a new StorageProxyMaxHintWindowPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMaxHintWindowPostParamsWithTimeout(timeout time.Duration) *StorageProxyMaxHintWindowPostParams { + var () + return &StorageProxyMaxHintWindowPostParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMaxHintWindowPostParamsWithContext creates a new StorageProxyMaxHintWindowPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMaxHintWindowPostParamsWithContext(ctx context.Context) *StorageProxyMaxHintWindowPostParams { + var () + return &StorageProxyMaxHintWindowPostParams{ + + Context: ctx, + } +} + +// NewStorageProxyMaxHintWindowPostParamsWithHTTPClient creates a new StorageProxyMaxHintWindowPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMaxHintWindowPostParamsWithHTTPClient(client *http.Client) *StorageProxyMaxHintWindowPostParams { + var () + return &StorageProxyMaxHintWindowPostParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMaxHintWindowPostParams contains all the parameters to send to the API endpoint +for the storage proxy max hint window post operation typically these are written to a http.Request +*/ +type StorageProxyMaxHintWindowPostParams struct { + + /*Ms + max hint window in ms + + */ + Ms int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy max hint window post params +func (o *StorageProxyMaxHintWindowPostParams) WithTimeout(timeout time.Duration) *StorageProxyMaxHintWindowPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy max hint window post params +func (o *StorageProxyMaxHintWindowPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy max hint window post params +func (o *StorageProxyMaxHintWindowPostParams) WithContext(ctx context.Context) *StorageProxyMaxHintWindowPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy max hint window post params +func (o *StorageProxyMaxHintWindowPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy max hint window post params +func (o *StorageProxyMaxHintWindowPostParams) WithHTTPClient(client *http.Client) *StorageProxyMaxHintWindowPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy max hint window post params +func (o *StorageProxyMaxHintWindowPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMs adds the ms to the storage proxy max hint window post params +func (o *StorageProxyMaxHintWindowPostParams) WithMs(ms int32) *StorageProxyMaxHintWindowPostParams { + o.SetMs(ms) + return o +} + +// SetMs adds the ms to the storage proxy max hint window post params +func (o *StorageProxyMaxHintWindowPostParams) SetMs(ms int32) { + o.Ms = ms +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMaxHintWindowPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param ms + qrMs := o.Ms + qMs := swag.FormatInt32(qrMs) + if qMs != "" { + if err := r.SetQueryParam("ms", qMs); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hint_window_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hint_window_post_responses.go new file mode 100644 index 0000000000..7d9e899ddd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hint_window_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMaxHintWindowPostReader is a Reader for the StorageProxyMaxHintWindowPost structure. +type StorageProxyMaxHintWindowPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMaxHintWindowPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMaxHintWindowPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMaxHintWindowPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMaxHintWindowPostOK creates a StorageProxyMaxHintWindowPostOK with default headers values +func NewStorageProxyMaxHintWindowPostOK() *StorageProxyMaxHintWindowPostOK { + return &StorageProxyMaxHintWindowPostOK{} +} + +/* +StorageProxyMaxHintWindowPostOK handles this case with default header values. + +Success +*/ +type StorageProxyMaxHintWindowPostOK struct { +} + +func (o *StorageProxyMaxHintWindowPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyMaxHintWindowPostDefault creates a StorageProxyMaxHintWindowPostDefault with default headers values +func NewStorageProxyMaxHintWindowPostDefault(code int) *StorageProxyMaxHintWindowPostDefault { + return &StorageProxyMaxHintWindowPostDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMaxHintWindowPostDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMaxHintWindowPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy max hint window post default response +func (o *StorageProxyMaxHintWindowPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMaxHintWindowPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMaxHintWindowPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMaxHintWindowPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hints_in_progress_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hints_in_progress_get_parameters.go new file mode 100644 index 0000000000..4d8d88177f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hints_in_progress_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMaxHintsInProgressGetParams creates a new StorageProxyMaxHintsInProgressGetParams object +// with the default values initialized. +func NewStorageProxyMaxHintsInProgressGetParams() *StorageProxyMaxHintsInProgressGetParams { + + return &StorageProxyMaxHintsInProgressGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMaxHintsInProgressGetParamsWithTimeout creates a new StorageProxyMaxHintsInProgressGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMaxHintsInProgressGetParamsWithTimeout(timeout time.Duration) *StorageProxyMaxHintsInProgressGetParams { + + return &StorageProxyMaxHintsInProgressGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMaxHintsInProgressGetParamsWithContext creates a new StorageProxyMaxHintsInProgressGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMaxHintsInProgressGetParamsWithContext(ctx context.Context) *StorageProxyMaxHintsInProgressGetParams { + + return &StorageProxyMaxHintsInProgressGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMaxHintsInProgressGetParamsWithHTTPClient creates a new StorageProxyMaxHintsInProgressGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMaxHintsInProgressGetParamsWithHTTPClient(client *http.Client) *StorageProxyMaxHintsInProgressGetParams { + + return &StorageProxyMaxHintsInProgressGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMaxHintsInProgressGetParams contains all the parameters to send to the API endpoint +for the storage proxy max hints in progress get operation typically these are written to a http.Request +*/ +type StorageProxyMaxHintsInProgressGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy max hints in progress get params +func (o *StorageProxyMaxHintsInProgressGetParams) WithTimeout(timeout time.Duration) *StorageProxyMaxHintsInProgressGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy max hints in progress get params +func (o *StorageProxyMaxHintsInProgressGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy max hints in progress get params +func (o *StorageProxyMaxHintsInProgressGetParams) WithContext(ctx context.Context) *StorageProxyMaxHintsInProgressGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy max hints in progress get params +func (o *StorageProxyMaxHintsInProgressGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy max hints in progress get params +func (o *StorageProxyMaxHintsInProgressGetParams) WithHTTPClient(client *http.Client) *StorageProxyMaxHintsInProgressGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy max hints in progress get params +func (o *StorageProxyMaxHintsInProgressGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMaxHintsInProgressGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hints_in_progress_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hints_in_progress_get_responses.go new file mode 100644 index 0000000000..4934ed8e4d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hints_in_progress_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMaxHintsInProgressGetReader is a Reader for the StorageProxyMaxHintsInProgressGet structure. +type StorageProxyMaxHintsInProgressGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMaxHintsInProgressGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMaxHintsInProgressGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMaxHintsInProgressGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMaxHintsInProgressGetOK creates a StorageProxyMaxHintsInProgressGetOK with default headers values +func NewStorageProxyMaxHintsInProgressGetOK() *StorageProxyMaxHintsInProgressGetOK { + return &StorageProxyMaxHintsInProgressGetOK{} +} + +/* +StorageProxyMaxHintsInProgressGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMaxHintsInProgressGetOK struct { + Payload int32 +} + +func (o *StorageProxyMaxHintsInProgressGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyMaxHintsInProgressGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMaxHintsInProgressGetDefault creates a StorageProxyMaxHintsInProgressGetDefault with default headers values +func NewStorageProxyMaxHintsInProgressGetDefault(code int) *StorageProxyMaxHintsInProgressGetDefault { + return &StorageProxyMaxHintsInProgressGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMaxHintsInProgressGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMaxHintsInProgressGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy max hints in progress get default response +func (o *StorageProxyMaxHintsInProgressGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMaxHintsInProgressGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMaxHintsInProgressGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMaxHintsInProgressGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hints_in_progress_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hints_in_progress_post_parameters.go new file mode 100644 index 0000000000..28290d47e2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hints_in_progress_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageProxyMaxHintsInProgressPostParams creates a new StorageProxyMaxHintsInProgressPostParams object +// with the default values initialized. +func NewStorageProxyMaxHintsInProgressPostParams() *StorageProxyMaxHintsInProgressPostParams { + var () + return &StorageProxyMaxHintsInProgressPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMaxHintsInProgressPostParamsWithTimeout creates a new StorageProxyMaxHintsInProgressPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMaxHintsInProgressPostParamsWithTimeout(timeout time.Duration) *StorageProxyMaxHintsInProgressPostParams { + var () + return &StorageProxyMaxHintsInProgressPostParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMaxHintsInProgressPostParamsWithContext creates a new StorageProxyMaxHintsInProgressPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMaxHintsInProgressPostParamsWithContext(ctx context.Context) *StorageProxyMaxHintsInProgressPostParams { + var () + return &StorageProxyMaxHintsInProgressPostParams{ + + Context: ctx, + } +} + +// NewStorageProxyMaxHintsInProgressPostParamsWithHTTPClient creates a new StorageProxyMaxHintsInProgressPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMaxHintsInProgressPostParamsWithHTTPClient(client *http.Client) *StorageProxyMaxHintsInProgressPostParams { + var () + return &StorageProxyMaxHintsInProgressPostParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMaxHintsInProgressPostParams contains all the parameters to send to the API endpoint +for the storage proxy max hints in progress post operation typically these are written to a http.Request +*/ +type StorageProxyMaxHintsInProgressPostParams struct { + + /*Qs + max hints in progress + + */ + Qs int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy max hints in progress post params +func (o *StorageProxyMaxHintsInProgressPostParams) WithTimeout(timeout time.Duration) *StorageProxyMaxHintsInProgressPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy max hints in progress post params +func (o *StorageProxyMaxHintsInProgressPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy max hints in progress post params +func (o *StorageProxyMaxHintsInProgressPostParams) WithContext(ctx context.Context) *StorageProxyMaxHintsInProgressPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy max hints in progress post params +func (o *StorageProxyMaxHintsInProgressPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy max hints in progress post params +func (o *StorageProxyMaxHintsInProgressPostParams) WithHTTPClient(client *http.Client) *StorageProxyMaxHintsInProgressPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy max hints in progress post params +func (o *StorageProxyMaxHintsInProgressPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithQs adds the qs to the storage proxy max hints in progress post params +func (o *StorageProxyMaxHintsInProgressPostParams) WithQs(qs int32) *StorageProxyMaxHintsInProgressPostParams { + o.SetQs(qs) + return o +} + +// SetQs adds the qs to the storage proxy max hints in progress post params +func (o *StorageProxyMaxHintsInProgressPostParams) SetQs(qs int32) { + o.Qs = qs +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMaxHintsInProgressPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param qs + qrQs := o.Qs + qQs := swag.FormatInt32(qrQs) + if qQs != "" { + if err := r.SetQueryParam("qs", qQs); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hints_in_progress_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hints_in_progress_post_responses.go new file mode 100644 index 0000000000..48fd75d2e6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_max_hints_in_progress_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMaxHintsInProgressPostReader is a Reader for the StorageProxyMaxHintsInProgressPost structure. +type StorageProxyMaxHintsInProgressPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMaxHintsInProgressPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMaxHintsInProgressPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMaxHintsInProgressPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMaxHintsInProgressPostOK creates a StorageProxyMaxHintsInProgressPostOK with default headers values +func NewStorageProxyMaxHintsInProgressPostOK() *StorageProxyMaxHintsInProgressPostOK { + return &StorageProxyMaxHintsInProgressPostOK{} +} + +/* +StorageProxyMaxHintsInProgressPostOK handles this case with default header values. + +Success +*/ +type StorageProxyMaxHintsInProgressPostOK struct { +} + +func (o *StorageProxyMaxHintsInProgressPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyMaxHintsInProgressPostDefault creates a StorageProxyMaxHintsInProgressPostDefault with default headers values +func NewStorageProxyMaxHintsInProgressPostDefault(code int) *StorageProxyMaxHintsInProgressPostDefault { + return &StorageProxyMaxHintsInProgressPostDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMaxHintsInProgressPostDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMaxHintsInProgressPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy max hints in progress post default response +func (o *StorageProxyMaxHintsInProgressPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMaxHintsInProgressPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMaxHintsInProgressPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMaxHintsInProgressPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_condition_not_met_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_condition_not_met_get_parameters.go new file mode 100644 index 0000000000..862c13e9fd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_condition_not_met_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsCasReadConditionNotMetGetParams creates a new StorageProxyMetricsCasReadConditionNotMetGetParams object +// with the default values initialized. +func NewStorageProxyMetricsCasReadConditionNotMetGetParams() *StorageProxyMetricsCasReadConditionNotMetGetParams { + + return &StorageProxyMetricsCasReadConditionNotMetGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsCasReadConditionNotMetGetParamsWithTimeout creates a new StorageProxyMetricsCasReadConditionNotMetGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsCasReadConditionNotMetGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsCasReadConditionNotMetGetParams { + + return &StorageProxyMetricsCasReadConditionNotMetGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsCasReadConditionNotMetGetParamsWithContext creates a new StorageProxyMetricsCasReadConditionNotMetGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsCasReadConditionNotMetGetParamsWithContext(ctx context.Context) *StorageProxyMetricsCasReadConditionNotMetGetParams { + + return &StorageProxyMetricsCasReadConditionNotMetGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsCasReadConditionNotMetGetParamsWithHTTPClient creates a new StorageProxyMetricsCasReadConditionNotMetGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsCasReadConditionNotMetGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsCasReadConditionNotMetGetParams { + + return &StorageProxyMetricsCasReadConditionNotMetGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsCasReadConditionNotMetGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics cas read condition not met get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsCasReadConditionNotMetGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics cas read condition not met get params +func (o *StorageProxyMetricsCasReadConditionNotMetGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsCasReadConditionNotMetGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics cas read condition not met get params +func (o *StorageProxyMetricsCasReadConditionNotMetGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics cas read condition not met get params +func (o *StorageProxyMetricsCasReadConditionNotMetGetParams) WithContext(ctx context.Context) *StorageProxyMetricsCasReadConditionNotMetGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics cas read condition not met get params +func (o *StorageProxyMetricsCasReadConditionNotMetGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics cas read condition not met get params +func (o *StorageProxyMetricsCasReadConditionNotMetGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsCasReadConditionNotMetGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics cas read condition not met get params +func (o *StorageProxyMetricsCasReadConditionNotMetGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsCasReadConditionNotMetGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_condition_not_met_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_condition_not_met_get_responses.go new file mode 100644 index 0000000000..145884503f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_condition_not_met_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsCasReadConditionNotMetGetReader is a Reader for the StorageProxyMetricsCasReadConditionNotMetGet structure. +type StorageProxyMetricsCasReadConditionNotMetGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsCasReadConditionNotMetGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsCasReadConditionNotMetGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsCasReadConditionNotMetGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsCasReadConditionNotMetGetOK creates a StorageProxyMetricsCasReadConditionNotMetGetOK with default headers values +func NewStorageProxyMetricsCasReadConditionNotMetGetOK() *StorageProxyMetricsCasReadConditionNotMetGetOK { + return &StorageProxyMetricsCasReadConditionNotMetGetOK{} +} + +/* +StorageProxyMetricsCasReadConditionNotMetGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsCasReadConditionNotMetGetOK struct { + Payload int32 +} + +func (o *StorageProxyMetricsCasReadConditionNotMetGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyMetricsCasReadConditionNotMetGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsCasReadConditionNotMetGetDefault creates a StorageProxyMetricsCasReadConditionNotMetGetDefault with default headers values +func NewStorageProxyMetricsCasReadConditionNotMetGetDefault(code int) *StorageProxyMetricsCasReadConditionNotMetGetDefault { + return &StorageProxyMetricsCasReadConditionNotMetGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsCasReadConditionNotMetGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsCasReadConditionNotMetGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics cas read condition not met get default response +func (o *StorageProxyMetricsCasReadConditionNotMetGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsCasReadConditionNotMetGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsCasReadConditionNotMetGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsCasReadConditionNotMetGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_contention_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_contention_get_parameters.go new file mode 100644 index 0000000000..11ed956dbd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_contention_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsCasReadContentionGetParams creates a new StorageProxyMetricsCasReadContentionGetParams object +// with the default values initialized. +func NewStorageProxyMetricsCasReadContentionGetParams() *StorageProxyMetricsCasReadContentionGetParams { + + return &StorageProxyMetricsCasReadContentionGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsCasReadContentionGetParamsWithTimeout creates a new StorageProxyMetricsCasReadContentionGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsCasReadContentionGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsCasReadContentionGetParams { + + return &StorageProxyMetricsCasReadContentionGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsCasReadContentionGetParamsWithContext creates a new StorageProxyMetricsCasReadContentionGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsCasReadContentionGetParamsWithContext(ctx context.Context) *StorageProxyMetricsCasReadContentionGetParams { + + return &StorageProxyMetricsCasReadContentionGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsCasReadContentionGetParamsWithHTTPClient creates a new StorageProxyMetricsCasReadContentionGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsCasReadContentionGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsCasReadContentionGetParams { + + return &StorageProxyMetricsCasReadContentionGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsCasReadContentionGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics cas read contention get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsCasReadContentionGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics cas read contention get params +func (o *StorageProxyMetricsCasReadContentionGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsCasReadContentionGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics cas read contention get params +func (o *StorageProxyMetricsCasReadContentionGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics cas read contention get params +func (o *StorageProxyMetricsCasReadContentionGetParams) WithContext(ctx context.Context) *StorageProxyMetricsCasReadContentionGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics cas read contention get params +func (o *StorageProxyMetricsCasReadContentionGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics cas read contention get params +func (o *StorageProxyMetricsCasReadContentionGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsCasReadContentionGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics cas read contention get params +func (o *StorageProxyMetricsCasReadContentionGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsCasReadContentionGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_contention_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_contention_get_responses.go new file mode 100644 index 0000000000..d1ecf53072 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_contention_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsCasReadContentionGetReader is a Reader for the StorageProxyMetricsCasReadContentionGet structure. +type StorageProxyMetricsCasReadContentionGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsCasReadContentionGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsCasReadContentionGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsCasReadContentionGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsCasReadContentionGetOK creates a StorageProxyMetricsCasReadContentionGetOK with default headers values +func NewStorageProxyMetricsCasReadContentionGetOK() *StorageProxyMetricsCasReadContentionGetOK { + return &StorageProxyMetricsCasReadContentionGetOK{} +} + +/* +StorageProxyMetricsCasReadContentionGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsCasReadContentionGetOK struct { + Payload interface{} +} + +func (o *StorageProxyMetricsCasReadContentionGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyMetricsCasReadContentionGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsCasReadContentionGetDefault creates a StorageProxyMetricsCasReadContentionGetDefault with default headers values +func NewStorageProxyMetricsCasReadContentionGetDefault(code int) *StorageProxyMetricsCasReadContentionGetDefault { + return &StorageProxyMetricsCasReadContentionGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsCasReadContentionGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsCasReadContentionGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics cas read contention get default response +func (o *StorageProxyMetricsCasReadContentionGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsCasReadContentionGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsCasReadContentionGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsCasReadContentionGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_timeouts_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_timeouts_get_parameters.go new file mode 100644 index 0000000000..f06b69f780 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_timeouts_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsCasReadTimeoutsGetParams creates a new StorageProxyMetricsCasReadTimeoutsGetParams object +// with the default values initialized. +func NewStorageProxyMetricsCasReadTimeoutsGetParams() *StorageProxyMetricsCasReadTimeoutsGetParams { + + return &StorageProxyMetricsCasReadTimeoutsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsCasReadTimeoutsGetParamsWithTimeout creates a new StorageProxyMetricsCasReadTimeoutsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsCasReadTimeoutsGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsCasReadTimeoutsGetParams { + + return &StorageProxyMetricsCasReadTimeoutsGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsCasReadTimeoutsGetParamsWithContext creates a new StorageProxyMetricsCasReadTimeoutsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsCasReadTimeoutsGetParamsWithContext(ctx context.Context) *StorageProxyMetricsCasReadTimeoutsGetParams { + + return &StorageProxyMetricsCasReadTimeoutsGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsCasReadTimeoutsGetParamsWithHTTPClient creates a new StorageProxyMetricsCasReadTimeoutsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsCasReadTimeoutsGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsCasReadTimeoutsGetParams { + + return &StorageProxyMetricsCasReadTimeoutsGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsCasReadTimeoutsGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics cas read timeouts get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsCasReadTimeoutsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics cas read timeouts get params +func (o *StorageProxyMetricsCasReadTimeoutsGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsCasReadTimeoutsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics cas read timeouts get params +func (o *StorageProxyMetricsCasReadTimeoutsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics cas read timeouts get params +func (o *StorageProxyMetricsCasReadTimeoutsGetParams) WithContext(ctx context.Context) *StorageProxyMetricsCasReadTimeoutsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics cas read timeouts get params +func (o *StorageProxyMetricsCasReadTimeoutsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics cas read timeouts get params +func (o *StorageProxyMetricsCasReadTimeoutsGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsCasReadTimeoutsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics cas read timeouts get params +func (o *StorageProxyMetricsCasReadTimeoutsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsCasReadTimeoutsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_timeouts_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_timeouts_get_responses.go new file mode 100644 index 0000000000..40cd00e458 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_timeouts_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsCasReadTimeoutsGetReader is a Reader for the StorageProxyMetricsCasReadTimeoutsGet structure. +type StorageProxyMetricsCasReadTimeoutsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsCasReadTimeoutsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsCasReadTimeoutsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsCasReadTimeoutsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsCasReadTimeoutsGetOK creates a StorageProxyMetricsCasReadTimeoutsGetOK with default headers values +func NewStorageProxyMetricsCasReadTimeoutsGetOK() *StorageProxyMetricsCasReadTimeoutsGetOK { + return &StorageProxyMetricsCasReadTimeoutsGetOK{} +} + +/* +StorageProxyMetricsCasReadTimeoutsGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsCasReadTimeoutsGetOK struct { + Payload interface{} +} + +func (o *StorageProxyMetricsCasReadTimeoutsGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyMetricsCasReadTimeoutsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsCasReadTimeoutsGetDefault creates a StorageProxyMetricsCasReadTimeoutsGetDefault with default headers values +func NewStorageProxyMetricsCasReadTimeoutsGetDefault(code int) *StorageProxyMetricsCasReadTimeoutsGetDefault { + return &StorageProxyMetricsCasReadTimeoutsGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsCasReadTimeoutsGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsCasReadTimeoutsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics cas read timeouts get default response +func (o *StorageProxyMetricsCasReadTimeoutsGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsCasReadTimeoutsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsCasReadTimeoutsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsCasReadTimeoutsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_unavailables_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_unavailables_get_parameters.go new file mode 100644 index 0000000000..b5cd01c56c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_unavailables_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsCasReadUnavailablesGetParams creates a new StorageProxyMetricsCasReadUnavailablesGetParams object +// with the default values initialized. +func NewStorageProxyMetricsCasReadUnavailablesGetParams() *StorageProxyMetricsCasReadUnavailablesGetParams { + + return &StorageProxyMetricsCasReadUnavailablesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsCasReadUnavailablesGetParamsWithTimeout creates a new StorageProxyMetricsCasReadUnavailablesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsCasReadUnavailablesGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsCasReadUnavailablesGetParams { + + return &StorageProxyMetricsCasReadUnavailablesGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsCasReadUnavailablesGetParamsWithContext creates a new StorageProxyMetricsCasReadUnavailablesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsCasReadUnavailablesGetParamsWithContext(ctx context.Context) *StorageProxyMetricsCasReadUnavailablesGetParams { + + return &StorageProxyMetricsCasReadUnavailablesGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsCasReadUnavailablesGetParamsWithHTTPClient creates a new StorageProxyMetricsCasReadUnavailablesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsCasReadUnavailablesGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsCasReadUnavailablesGetParams { + + return &StorageProxyMetricsCasReadUnavailablesGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsCasReadUnavailablesGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics cas read unavailables get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsCasReadUnavailablesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics cas read unavailables get params +func (o *StorageProxyMetricsCasReadUnavailablesGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsCasReadUnavailablesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics cas read unavailables get params +func (o *StorageProxyMetricsCasReadUnavailablesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics cas read unavailables get params +func (o *StorageProxyMetricsCasReadUnavailablesGetParams) WithContext(ctx context.Context) *StorageProxyMetricsCasReadUnavailablesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics cas read unavailables get params +func (o *StorageProxyMetricsCasReadUnavailablesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics cas read unavailables get params +func (o *StorageProxyMetricsCasReadUnavailablesGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsCasReadUnavailablesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics cas read unavailables get params +func (o *StorageProxyMetricsCasReadUnavailablesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsCasReadUnavailablesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_unavailables_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_unavailables_get_responses.go new file mode 100644 index 0000000000..e92b86d14c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_unavailables_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsCasReadUnavailablesGetReader is a Reader for the StorageProxyMetricsCasReadUnavailablesGet structure. +type StorageProxyMetricsCasReadUnavailablesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsCasReadUnavailablesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsCasReadUnavailablesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsCasReadUnavailablesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsCasReadUnavailablesGetOK creates a StorageProxyMetricsCasReadUnavailablesGetOK with default headers values +func NewStorageProxyMetricsCasReadUnavailablesGetOK() *StorageProxyMetricsCasReadUnavailablesGetOK { + return &StorageProxyMetricsCasReadUnavailablesGetOK{} +} + +/* +StorageProxyMetricsCasReadUnavailablesGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsCasReadUnavailablesGetOK struct { + Payload interface{} +} + +func (o *StorageProxyMetricsCasReadUnavailablesGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyMetricsCasReadUnavailablesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsCasReadUnavailablesGetDefault creates a StorageProxyMetricsCasReadUnavailablesGetDefault with default headers values +func NewStorageProxyMetricsCasReadUnavailablesGetDefault(code int) *StorageProxyMetricsCasReadUnavailablesGetDefault { + return &StorageProxyMetricsCasReadUnavailablesGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsCasReadUnavailablesGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsCasReadUnavailablesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics cas read unavailables get default response +func (o *StorageProxyMetricsCasReadUnavailablesGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsCasReadUnavailablesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsCasReadUnavailablesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsCasReadUnavailablesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_unfinished_commit_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_unfinished_commit_get_parameters.go new file mode 100644 index 0000000000..f08ddddbf8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_unfinished_commit_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsCasReadUnfinishedCommitGetParams creates a new StorageProxyMetricsCasReadUnfinishedCommitGetParams object +// with the default values initialized. +func NewStorageProxyMetricsCasReadUnfinishedCommitGetParams() *StorageProxyMetricsCasReadUnfinishedCommitGetParams { + + return &StorageProxyMetricsCasReadUnfinishedCommitGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsCasReadUnfinishedCommitGetParamsWithTimeout creates a new StorageProxyMetricsCasReadUnfinishedCommitGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsCasReadUnfinishedCommitGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsCasReadUnfinishedCommitGetParams { + + return &StorageProxyMetricsCasReadUnfinishedCommitGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsCasReadUnfinishedCommitGetParamsWithContext creates a new StorageProxyMetricsCasReadUnfinishedCommitGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsCasReadUnfinishedCommitGetParamsWithContext(ctx context.Context) *StorageProxyMetricsCasReadUnfinishedCommitGetParams { + + return &StorageProxyMetricsCasReadUnfinishedCommitGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsCasReadUnfinishedCommitGetParamsWithHTTPClient creates a new StorageProxyMetricsCasReadUnfinishedCommitGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsCasReadUnfinishedCommitGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsCasReadUnfinishedCommitGetParams { + + return &StorageProxyMetricsCasReadUnfinishedCommitGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsCasReadUnfinishedCommitGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics cas read unfinished commit get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsCasReadUnfinishedCommitGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics cas read unfinished commit get params +func (o *StorageProxyMetricsCasReadUnfinishedCommitGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsCasReadUnfinishedCommitGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics cas read unfinished commit get params +func (o *StorageProxyMetricsCasReadUnfinishedCommitGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics cas read unfinished commit get params +func (o *StorageProxyMetricsCasReadUnfinishedCommitGetParams) WithContext(ctx context.Context) *StorageProxyMetricsCasReadUnfinishedCommitGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics cas read unfinished commit get params +func (o *StorageProxyMetricsCasReadUnfinishedCommitGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics cas read unfinished commit get params +func (o *StorageProxyMetricsCasReadUnfinishedCommitGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsCasReadUnfinishedCommitGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics cas read unfinished commit get params +func (o *StorageProxyMetricsCasReadUnfinishedCommitGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsCasReadUnfinishedCommitGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_unfinished_commit_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_unfinished_commit_get_responses.go new file mode 100644 index 0000000000..116c57252f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_read_unfinished_commit_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsCasReadUnfinishedCommitGetReader is a Reader for the StorageProxyMetricsCasReadUnfinishedCommitGet structure. +type StorageProxyMetricsCasReadUnfinishedCommitGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsCasReadUnfinishedCommitGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsCasReadUnfinishedCommitGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsCasReadUnfinishedCommitGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsCasReadUnfinishedCommitGetOK creates a StorageProxyMetricsCasReadUnfinishedCommitGetOK with default headers values +func NewStorageProxyMetricsCasReadUnfinishedCommitGetOK() *StorageProxyMetricsCasReadUnfinishedCommitGetOK { + return &StorageProxyMetricsCasReadUnfinishedCommitGetOK{} +} + +/* +StorageProxyMetricsCasReadUnfinishedCommitGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsCasReadUnfinishedCommitGetOK struct { + Payload int32 +} + +func (o *StorageProxyMetricsCasReadUnfinishedCommitGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyMetricsCasReadUnfinishedCommitGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsCasReadUnfinishedCommitGetDefault creates a StorageProxyMetricsCasReadUnfinishedCommitGetDefault with default headers values +func NewStorageProxyMetricsCasReadUnfinishedCommitGetDefault(code int) *StorageProxyMetricsCasReadUnfinishedCommitGetDefault { + return &StorageProxyMetricsCasReadUnfinishedCommitGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsCasReadUnfinishedCommitGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsCasReadUnfinishedCommitGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics cas read unfinished commit get default response +func (o *StorageProxyMetricsCasReadUnfinishedCommitGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsCasReadUnfinishedCommitGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsCasReadUnfinishedCommitGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsCasReadUnfinishedCommitGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_condition_not_met_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_condition_not_met_get_parameters.go new file mode 100644 index 0000000000..2bf5732f14 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_condition_not_met_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsCasWriteConditionNotMetGetParams creates a new StorageProxyMetricsCasWriteConditionNotMetGetParams object +// with the default values initialized. +func NewStorageProxyMetricsCasWriteConditionNotMetGetParams() *StorageProxyMetricsCasWriteConditionNotMetGetParams { + + return &StorageProxyMetricsCasWriteConditionNotMetGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsCasWriteConditionNotMetGetParamsWithTimeout creates a new StorageProxyMetricsCasWriteConditionNotMetGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsCasWriteConditionNotMetGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsCasWriteConditionNotMetGetParams { + + return &StorageProxyMetricsCasWriteConditionNotMetGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsCasWriteConditionNotMetGetParamsWithContext creates a new StorageProxyMetricsCasWriteConditionNotMetGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsCasWriteConditionNotMetGetParamsWithContext(ctx context.Context) *StorageProxyMetricsCasWriteConditionNotMetGetParams { + + return &StorageProxyMetricsCasWriteConditionNotMetGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsCasWriteConditionNotMetGetParamsWithHTTPClient creates a new StorageProxyMetricsCasWriteConditionNotMetGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsCasWriteConditionNotMetGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsCasWriteConditionNotMetGetParams { + + return &StorageProxyMetricsCasWriteConditionNotMetGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsCasWriteConditionNotMetGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics cas write condition not met get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsCasWriteConditionNotMetGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics cas write condition not met get params +func (o *StorageProxyMetricsCasWriteConditionNotMetGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsCasWriteConditionNotMetGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics cas write condition not met get params +func (o *StorageProxyMetricsCasWriteConditionNotMetGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics cas write condition not met get params +func (o *StorageProxyMetricsCasWriteConditionNotMetGetParams) WithContext(ctx context.Context) *StorageProxyMetricsCasWriteConditionNotMetGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics cas write condition not met get params +func (o *StorageProxyMetricsCasWriteConditionNotMetGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics cas write condition not met get params +func (o *StorageProxyMetricsCasWriteConditionNotMetGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsCasWriteConditionNotMetGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics cas write condition not met get params +func (o *StorageProxyMetricsCasWriteConditionNotMetGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsCasWriteConditionNotMetGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_condition_not_met_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_condition_not_met_get_responses.go new file mode 100644 index 0000000000..1cc05df719 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_condition_not_met_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsCasWriteConditionNotMetGetReader is a Reader for the StorageProxyMetricsCasWriteConditionNotMetGet structure. +type StorageProxyMetricsCasWriteConditionNotMetGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsCasWriteConditionNotMetGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsCasWriteConditionNotMetGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsCasWriteConditionNotMetGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsCasWriteConditionNotMetGetOK creates a StorageProxyMetricsCasWriteConditionNotMetGetOK with default headers values +func NewStorageProxyMetricsCasWriteConditionNotMetGetOK() *StorageProxyMetricsCasWriteConditionNotMetGetOK { + return &StorageProxyMetricsCasWriteConditionNotMetGetOK{} +} + +/* +StorageProxyMetricsCasWriteConditionNotMetGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsCasWriteConditionNotMetGetOK struct { + Payload int32 +} + +func (o *StorageProxyMetricsCasWriteConditionNotMetGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyMetricsCasWriteConditionNotMetGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsCasWriteConditionNotMetGetDefault creates a StorageProxyMetricsCasWriteConditionNotMetGetDefault with default headers values +func NewStorageProxyMetricsCasWriteConditionNotMetGetDefault(code int) *StorageProxyMetricsCasWriteConditionNotMetGetDefault { + return &StorageProxyMetricsCasWriteConditionNotMetGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsCasWriteConditionNotMetGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsCasWriteConditionNotMetGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics cas write condition not met get default response +func (o *StorageProxyMetricsCasWriteConditionNotMetGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsCasWriteConditionNotMetGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsCasWriteConditionNotMetGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsCasWriteConditionNotMetGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_contention_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_contention_get_parameters.go new file mode 100644 index 0000000000..9cbd1c97c3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_contention_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsCasWriteContentionGetParams creates a new StorageProxyMetricsCasWriteContentionGetParams object +// with the default values initialized. +func NewStorageProxyMetricsCasWriteContentionGetParams() *StorageProxyMetricsCasWriteContentionGetParams { + + return &StorageProxyMetricsCasWriteContentionGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsCasWriteContentionGetParamsWithTimeout creates a new StorageProxyMetricsCasWriteContentionGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsCasWriteContentionGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsCasWriteContentionGetParams { + + return &StorageProxyMetricsCasWriteContentionGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsCasWriteContentionGetParamsWithContext creates a new StorageProxyMetricsCasWriteContentionGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsCasWriteContentionGetParamsWithContext(ctx context.Context) *StorageProxyMetricsCasWriteContentionGetParams { + + return &StorageProxyMetricsCasWriteContentionGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsCasWriteContentionGetParamsWithHTTPClient creates a new StorageProxyMetricsCasWriteContentionGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsCasWriteContentionGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsCasWriteContentionGetParams { + + return &StorageProxyMetricsCasWriteContentionGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsCasWriteContentionGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics cas write contention get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsCasWriteContentionGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics cas write contention get params +func (o *StorageProxyMetricsCasWriteContentionGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsCasWriteContentionGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics cas write contention get params +func (o *StorageProxyMetricsCasWriteContentionGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics cas write contention get params +func (o *StorageProxyMetricsCasWriteContentionGetParams) WithContext(ctx context.Context) *StorageProxyMetricsCasWriteContentionGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics cas write contention get params +func (o *StorageProxyMetricsCasWriteContentionGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics cas write contention get params +func (o *StorageProxyMetricsCasWriteContentionGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsCasWriteContentionGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics cas write contention get params +func (o *StorageProxyMetricsCasWriteContentionGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsCasWriteContentionGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_contention_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_contention_get_responses.go new file mode 100644 index 0000000000..16474b2f05 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_contention_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsCasWriteContentionGetReader is a Reader for the StorageProxyMetricsCasWriteContentionGet structure. +type StorageProxyMetricsCasWriteContentionGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsCasWriteContentionGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsCasWriteContentionGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsCasWriteContentionGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsCasWriteContentionGetOK creates a StorageProxyMetricsCasWriteContentionGetOK with default headers values +func NewStorageProxyMetricsCasWriteContentionGetOK() *StorageProxyMetricsCasWriteContentionGetOK { + return &StorageProxyMetricsCasWriteContentionGetOK{} +} + +/* +StorageProxyMetricsCasWriteContentionGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsCasWriteContentionGetOK struct { + Payload interface{} +} + +func (o *StorageProxyMetricsCasWriteContentionGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyMetricsCasWriteContentionGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsCasWriteContentionGetDefault creates a StorageProxyMetricsCasWriteContentionGetDefault with default headers values +func NewStorageProxyMetricsCasWriteContentionGetDefault(code int) *StorageProxyMetricsCasWriteContentionGetDefault { + return &StorageProxyMetricsCasWriteContentionGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsCasWriteContentionGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsCasWriteContentionGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics cas write contention get default response +func (o *StorageProxyMetricsCasWriteContentionGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsCasWriteContentionGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsCasWriteContentionGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsCasWriteContentionGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_timeouts_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_timeouts_get_parameters.go new file mode 100644 index 0000000000..1f3a7021ea --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_timeouts_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsCasWriteTimeoutsGetParams creates a new StorageProxyMetricsCasWriteTimeoutsGetParams object +// with the default values initialized. +func NewStorageProxyMetricsCasWriteTimeoutsGetParams() *StorageProxyMetricsCasWriteTimeoutsGetParams { + + return &StorageProxyMetricsCasWriteTimeoutsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsCasWriteTimeoutsGetParamsWithTimeout creates a new StorageProxyMetricsCasWriteTimeoutsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsCasWriteTimeoutsGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsCasWriteTimeoutsGetParams { + + return &StorageProxyMetricsCasWriteTimeoutsGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsCasWriteTimeoutsGetParamsWithContext creates a new StorageProxyMetricsCasWriteTimeoutsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsCasWriteTimeoutsGetParamsWithContext(ctx context.Context) *StorageProxyMetricsCasWriteTimeoutsGetParams { + + return &StorageProxyMetricsCasWriteTimeoutsGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsCasWriteTimeoutsGetParamsWithHTTPClient creates a new StorageProxyMetricsCasWriteTimeoutsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsCasWriteTimeoutsGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsCasWriteTimeoutsGetParams { + + return &StorageProxyMetricsCasWriteTimeoutsGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsCasWriteTimeoutsGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics cas write timeouts get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsCasWriteTimeoutsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics cas write timeouts get params +func (o *StorageProxyMetricsCasWriteTimeoutsGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsCasWriteTimeoutsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics cas write timeouts get params +func (o *StorageProxyMetricsCasWriteTimeoutsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics cas write timeouts get params +func (o *StorageProxyMetricsCasWriteTimeoutsGetParams) WithContext(ctx context.Context) *StorageProxyMetricsCasWriteTimeoutsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics cas write timeouts get params +func (o *StorageProxyMetricsCasWriteTimeoutsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics cas write timeouts get params +func (o *StorageProxyMetricsCasWriteTimeoutsGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsCasWriteTimeoutsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics cas write timeouts get params +func (o *StorageProxyMetricsCasWriteTimeoutsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsCasWriteTimeoutsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_timeouts_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_timeouts_get_responses.go new file mode 100644 index 0000000000..caf3ff6b97 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_timeouts_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsCasWriteTimeoutsGetReader is a Reader for the StorageProxyMetricsCasWriteTimeoutsGet structure. +type StorageProxyMetricsCasWriteTimeoutsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsCasWriteTimeoutsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsCasWriteTimeoutsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsCasWriteTimeoutsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsCasWriteTimeoutsGetOK creates a StorageProxyMetricsCasWriteTimeoutsGetOK with default headers values +func NewStorageProxyMetricsCasWriteTimeoutsGetOK() *StorageProxyMetricsCasWriteTimeoutsGetOK { + return &StorageProxyMetricsCasWriteTimeoutsGetOK{} +} + +/* +StorageProxyMetricsCasWriteTimeoutsGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsCasWriteTimeoutsGetOK struct { + Payload interface{} +} + +func (o *StorageProxyMetricsCasWriteTimeoutsGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyMetricsCasWriteTimeoutsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsCasWriteTimeoutsGetDefault creates a StorageProxyMetricsCasWriteTimeoutsGetDefault with default headers values +func NewStorageProxyMetricsCasWriteTimeoutsGetDefault(code int) *StorageProxyMetricsCasWriteTimeoutsGetDefault { + return &StorageProxyMetricsCasWriteTimeoutsGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsCasWriteTimeoutsGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsCasWriteTimeoutsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics cas write timeouts get default response +func (o *StorageProxyMetricsCasWriteTimeoutsGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsCasWriteTimeoutsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsCasWriteTimeoutsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsCasWriteTimeoutsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_unavailables_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_unavailables_get_parameters.go new file mode 100644 index 0000000000..6b20d39355 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_unavailables_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsCasWriteUnavailablesGetParams creates a new StorageProxyMetricsCasWriteUnavailablesGetParams object +// with the default values initialized. +func NewStorageProxyMetricsCasWriteUnavailablesGetParams() *StorageProxyMetricsCasWriteUnavailablesGetParams { + + return &StorageProxyMetricsCasWriteUnavailablesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsCasWriteUnavailablesGetParamsWithTimeout creates a new StorageProxyMetricsCasWriteUnavailablesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsCasWriteUnavailablesGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsCasWriteUnavailablesGetParams { + + return &StorageProxyMetricsCasWriteUnavailablesGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsCasWriteUnavailablesGetParamsWithContext creates a new StorageProxyMetricsCasWriteUnavailablesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsCasWriteUnavailablesGetParamsWithContext(ctx context.Context) *StorageProxyMetricsCasWriteUnavailablesGetParams { + + return &StorageProxyMetricsCasWriteUnavailablesGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsCasWriteUnavailablesGetParamsWithHTTPClient creates a new StorageProxyMetricsCasWriteUnavailablesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsCasWriteUnavailablesGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsCasWriteUnavailablesGetParams { + + return &StorageProxyMetricsCasWriteUnavailablesGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsCasWriteUnavailablesGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics cas write unavailables get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsCasWriteUnavailablesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics cas write unavailables get params +func (o *StorageProxyMetricsCasWriteUnavailablesGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsCasWriteUnavailablesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics cas write unavailables get params +func (o *StorageProxyMetricsCasWriteUnavailablesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics cas write unavailables get params +func (o *StorageProxyMetricsCasWriteUnavailablesGetParams) WithContext(ctx context.Context) *StorageProxyMetricsCasWriteUnavailablesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics cas write unavailables get params +func (o *StorageProxyMetricsCasWriteUnavailablesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics cas write unavailables get params +func (o *StorageProxyMetricsCasWriteUnavailablesGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsCasWriteUnavailablesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics cas write unavailables get params +func (o *StorageProxyMetricsCasWriteUnavailablesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsCasWriteUnavailablesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_unavailables_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_unavailables_get_responses.go new file mode 100644 index 0000000000..7469619bf1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_unavailables_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsCasWriteUnavailablesGetReader is a Reader for the StorageProxyMetricsCasWriteUnavailablesGet structure. +type StorageProxyMetricsCasWriteUnavailablesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsCasWriteUnavailablesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsCasWriteUnavailablesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsCasWriteUnavailablesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsCasWriteUnavailablesGetOK creates a StorageProxyMetricsCasWriteUnavailablesGetOK with default headers values +func NewStorageProxyMetricsCasWriteUnavailablesGetOK() *StorageProxyMetricsCasWriteUnavailablesGetOK { + return &StorageProxyMetricsCasWriteUnavailablesGetOK{} +} + +/* +StorageProxyMetricsCasWriteUnavailablesGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsCasWriteUnavailablesGetOK struct { + Payload interface{} +} + +func (o *StorageProxyMetricsCasWriteUnavailablesGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyMetricsCasWriteUnavailablesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsCasWriteUnavailablesGetDefault creates a StorageProxyMetricsCasWriteUnavailablesGetDefault with default headers values +func NewStorageProxyMetricsCasWriteUnavailablesGetDefault(code int) *StorageProxyMetricsCasWriteUnavailablesGetDefault { + return &StorageProxyMetricsCasWriteUnavailablesGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsCasWriteUnavailablesGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsCasWriteUnavailablesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics cas write unavailables get default response +func (o *StorageProxyMetricsCasWriteUnavailablesGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsCasWriteUnavailablesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsCasWriteUnavailablesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsCasWriteUnavailablesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_unfinished_commit_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_unfinished_commit_get_parameters.go new file mode 100644 index 0000000000..c1924411ae --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_unfinished_commit_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsCasWriteUnfinishedCommitGetParams creates a new StorageProxyMetricsCasWriteUnfinishedCommitGetParams object +// with the default values initialized. +func NewStorageProxyMetricsCasWriteUnfinishedCommitGetParams() *StorageProxyMetricsCasWriteUnfinishedCommitGetParams { + + return &StorageProxyMetricsCasWriteUnfinishedCommitGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsCasWriteUnfinishedCommitGetParamsWithTimeout creates a new StorageProxyMetricsCasWriteUnfinishedCommitGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsCasWriteUnfinishedCommitGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsCasWriteUnfinishedCommitGetParams { + + return &StorageProxyMetricsCasWriteUnfinishedCommitGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsCasWriteUnfinishedCommitGetParamsWithContext creates a new StorageProxyMetricsCasWriteUnfinishedCommitGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsCasWriteUnfinishedCommitGetParamsWithContext(ctx context.Context) *StorageProxyMetricsCasWriteUnfinishedCommitGetParams { + + return &StorageProxyMetricsCasWriteUnfinishedCommitGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsCasWriteUnfinishedCommitGetParamsWithHTTPClient creates a new StorageProxyMetricsCasWriteUnfinishedCommitGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsCasWriteUnfinishedCommitGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsCasWriteUnfinishedCommitGetParams { + + return &StorageProxyMetricsCasWriteUnfinishedCommitGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsCasWriteUnfinishedCommitGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics cas write unfinished commit get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsCasWriteUnfinishedCommitGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics cas write unfinished commit get params +func (o *StorageProxyMetricsCasWriteUnfinishedCommitGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsCasWriteUnfinishedCommitGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics cas write unfinished commit get params +func (o *StorageProxyMetricsCasWriteUnfinishedCommitGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics cas write unfinished commit get params +func (o *StorageProxyMetricsCasWriteUnfinishedCommitGetParams) WithContext(ctx context.Context) *StorageProxyMetricsCasWriteUnfinishedCommitGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics cas write unfinished commit get params +func (o *StorageProxyMetricsCasWriteUnfinishedCommitGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics cas write unfinished commit get params +func (o *StorageProxyMetricsCasWriteUnfinishedCommitGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsCasWriteUnfinishedCommitGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics cas write unfinished commit get params +func (o *StorageProxyMetricsCasWriteUnfinishedCommitGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsCasWriteUnfinishedCommitGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_unfinished_commit_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_unfinished_commit_get_responses.go new file mode 100644 index 0000000000..b06fba84ba --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_cas_write_unfinished_commit_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsCasWriteUnfinishedCommitGetReader is a Reader for the StorageProxyMetricsCasWriteUnfinishedCommitGet structure. +type StorageProxyMetricsCasWriteUnfinishedCommitGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsCasWriteUnfinishedCommitGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsCasWriteUnfinishedCommitGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsCasWriteUnfinishedCommitGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsCasWriteUnfinishedCommitGetOK creates a StorageProxyMetricsCasWriteUnfinishedCommitGetOK with default headers values +func NewStorageProxyMetricsCasWriteUnfinishedCommitGetOK() *StorageProxyMetricsCasWriteUnfinishedCommitGetOK { + return &StorageProxyMetricsCasWriteUnfinishedCommitGetOK{} +} + +/* +StorageProxyMetricsCasWriteUnfinishedCommitGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsCasWriteUnfinishedCommitGetOK struct { + Payload int32 +} + +func (o *StorageProxyMetricsCasWriteUnfinishedCommitGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyMetricsCasWriteUnfinishedCommitGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsCasWriteUnfinishedCommitGetDefault creates a StorageProxyMetricsCasWriteUnfinishedCommitGetDefault with default headers values +func NewStorageProxyMetricsCasWriteUnfinishedCommitGetDefault(code int) *StorageProxyMetricsCasWriteUnfinishedCommitGetDefault { + return &StorageProxyMetricsCasWriteUnfinishedCommitGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsCasWriteUnfinishedCommitGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsCasWriteUnfinishedCommitGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics cas write unfinished commit get default response +func (o *StorageProxyMetricsCasWriteUnfinishedCommitGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsCasWriteUnfinishedCommitGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsCasWriteUnfinishedCommitGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsCasWriteUnfinishedCommitGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_estimated_histogram_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_estimated_histogram_get_parameters.go new file mode 100644 index 0000000000..98c99fbb2b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_estimated_histogram_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsRangeEstimatedHistogramGetParams creates a new StorageProxyMetricsRangeEstimatedHistogramGetParams object +// with the default values initialized. +func NewStorageProxyMetricsRangeEstimatedHistogramGetParams() *StorageProxyMetricsRangeEstimatedHistogramGetParams { + + return &StorageProxyMetricsRangeEstimatedHistogramGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsRangeEstimatedHistogramGetParamsWithTimeout creates a new StorageProxyMetricsRangeEstimatedHistogramGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsRangeEstimatedHistogramGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsRangeEstimatedHistogramGetParams { + + return &StorageProxyMetricsRangeEstimatedHistogramGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsRangeEstimatedHistogramGetParamsWithContext creates a new StorageProxyMetricsRangeEstimatedHistogramGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsRangeEstimatedHistogramGetParamsWithContext(ctx context.Context) *StorageProxyMetricsRangeEstimatedHistogramGetParams { + + return &StorageProxyMetricsRangeEstimatedHistogramGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsRangeEstimatedHistogramGetParamsWithHTTPClient creates a new StorageProxyMetricsRangeEstimatedHistogramGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsRangeEstimatedHistogramGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsRangeEstimatedHistogramGetParams { + + return &StorageProxyMetricsRangeEstimatedHistogramGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsRangeEstimatedHistogramGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics range estimated histogram get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsRangeEstimatedHistogramGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics range estimated histogram get params +func (o *StorageProxyMetricsRangeEstimatedHistogramGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsRangeEstimatedHistogramGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics range estimated histogram get params +func (o *StorageProxyMetricsRangeEstimatedHistogramGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics range estimated histogram get params +func (o *StorageProxyMetricsRangeEstimatedHistogramGetParams) WithContext(ctx context.Context) *StorageProxyMetricsRangeEstimatedHistogramGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics range estimated histogram get params +func (o *StorageProxyMetricsRangeEstimatedHistogramGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics range estimated histogram get params +func (o *StorageProxyMetricsRangeEstimatedHistogramGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsRangeEstimatedHistogramGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics range estimated histogram get params +func (o *StorageProxyMetricsRangeEstimatedHistogramGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsRangeEstimatedHistogramGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_estimated_histogram_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_estimated_histogram_get_responses.go new file mode 100644 index 0000000000..256b87c94f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_estimated_histogram_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsRangeEstimatedHistogramGetReader is a Reader for the StorageProxyMetricsRangeEstimatedHistogramGet structure. +type StorageProxyMetricsRangeEstimatedHistogramGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsRangeEstimatedHistogramGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsRangeEstimatedHistogramGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsRangeEstimatedHistogramGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsRangeEstimatedHistogramGetOK creates a StorageProxyMetricsRangeEstimatedHistogramGetOK with default headers values +func NewStorageProxyMetricsRangeEstimatedHistogramGetOK() *StorageProxyMetricsRangeEstimatedHistogramGetOK { + return &StorageProxyMetricsRangeEstimatedHistogramGetOK{} +} + +/* +StorageProxyMetricsRangeEstimatedHistogramGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsRangeEstimatedHistogramGetOK struct { +} + +func (o *StorageProxyMetricsRangeEstimatedHistogramGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyMetricsRangeEstimatedHistogramGetDefault creates a StorageProxyMetricsRangeEstimatedHistogramGetDefault with default headers values +func NewStorageProxyMetricsRangeEstimatedHistogramGetDefault(code int) *StorageProxyMetricsRangeEstimatedHistogramGetDefault { + return &StorageProxyMetricsRangeEstimatedHistogramGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsRangeEstimatedHistogramGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsRangeEstimatedHistogramGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics range estimated histogram get default response +func (o *StorageProxyMetricsRangeEstimatedHistogramGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsRangeEstimatedHistogramGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsRangeEstimatedHistogramGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsRangeEstimatedHistogramGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_get_parameters.go new file mode 100644 index 0000000000..fb56554f71 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsRangeGetParams creates a new StorageProxyMetricsRangeGetParams object +// with the default values initialized. +func NewStorageProxyMetricsRangeGetParams() *StorageProxyMetricsRangeGetParams { + + return &StorageProxyMetricsRangeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsRangeGetParamsWithTimeout creates a new StorageProxyMetricsRangeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsRangeGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsRangeGetParams { + + return &StorageProxyMetricsRangeGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsRangeGetParamsWithContext creates a new StorageProxyMetricsRangeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsRangeGetParamsWithContext(ctx context.Context) *StorageProxyMetricsRangeGetParams { + + return &StorageProxyMetricsRangeGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsRangeGetParamsWithHTTPClient creates a new StorageProxyMetricsRangeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsRangeGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsRangeGetParams { + + return &StorageProxyMetricsRangeGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsRangeGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics range get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsRangeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics range get params +func (o *StorageProxyMetricsRangeGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsRangeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics range get params +func (o *StorageProxyMetricsRangeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics range get params +func (o *StorageProxyMetricsRangeGetParams) WithContext(ctx context.Context) *StorageProxyMetricsRangeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics range get params +func (o *StorageProxyMetricsRangeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics range get params +func (o *StorageProxyMetricsRangeGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsRangeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics range get params +func (o *StorageProxyMetricsRangeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsRangeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_get_responses.go new file mode 100644 index 0000000000..43893d7b43 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsRangeGetReader is a Reader for the StorageProxyMetricsRangeGet structure. +type StorageProxyMetricsRangeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsRangeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsRangeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsRangeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsRangeGetOK creates a StorageProxyMetricsRangeGetOK with default headers values +func NewStorageProxyMetricsRangeGetOK() *StorageProxyMetricsRangeGetOK { + return &StorageProxyMetricsRangeGetOK{} +} + +/* +StorageProxyMetricsRangeGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsRangeGetOK struct { + Payload int32 +} + +func (o *StorageProxyMetricsRangeGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyMetricsRangeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsRangeGetDefault creates a StorageProxyMetricsRangeGetDefault with default headers values +func NewStorageProxyMetricsRangeGetDefault(code int) *StorageProxyMetricsRangeGetDefault { + return &StorageProxyMetricsRangeGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsRangeGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsRangeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics range get default response +func (o *StorageProxyMetricsRangeGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsRangeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsRangeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsRangeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_histogram_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_histogram_get_parameters.go new file mode 100644 index 0000000000..3a6778c30c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_histogram_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsRangeHistogramGetParams creates a new StorageProxyMetricsRangeHistogramGetParams object +// with the default values initialized. +func NewStorageProxyMetricsRangeHistogramGetParams() *StorageProxyMetricsRangeHistogramGetParams { + + return &StorageProxyMetricsRangeHistogramGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsRangeHistogramGetParamsWithTimeout creates a new StorageProxyMetricsRangeHistogramGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsRangeHistogramGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsRangeHistogramGetParams { + + return &StorageProxyMetricsRangeHistogramGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsRangeHistogramGetParamsWithContext creates a new StorageProxyMetricsRangeHistogramGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsRangeHistogramGetParamsWithContext(ctx context.Context) *StorageProxyMetricsRangeHistogramGetParams { + + return &StorageProxyMetricsRangeHistogramGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsRangeHistogramGetParamsWithHTTPClient creates a new StorageProxyMetricsRangeHistogramGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsRangeHistogramGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsRangeHistogramGetParams { + + return &StorageProxyMetricsRangeHistogramGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsRangeHistogramGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics range histogram get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsRangeHistogramGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics range histogram get params +func (o *StorageProxyMetricsRangeHistogramGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsRangeHistogramGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics range histogram get params +func (o *StorageProxyMetricsRangeHistogramGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics range histogram get params +func (o *StorageProxyMetricsRangeHistogramGetParams) WithContext(ctx context.Context) *StorageProxyMetricsRangeHistogramGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics range histogram get params +func (o *StorageProxyMetricsRangeHistogramGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics range histogram get params +func (o *StorageProxyMetricsRangeHistogramGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsRangeHistogramGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics range histogram get params +func (o *StorageProxyMetricsRangeHistogramGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsRangeHistogramGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_histogram_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_histogram_get_responses.go new file mode 100644 index 0000000000..d34de41013 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_histogram_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsRangeHistogramGetReader is a Reader for the StorageProxyMetricsRangeHistogramGet structure. +type StorageProxyMetricsRangeHistogramGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsRangeHistogramGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsRangeHistogramGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsRangeHistogramGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsRangeHistogramGetOK creates a StorageProxyMetricsRangeHistogramGetOK with default headers values +func NewStorageProxyMetricsRangeHistogramGetOK() *StorageProxyMetricsRangeHistogramGetOK { + return &StorageProxyMetricsRangeHistogramGetOK{} +} + +/* +StorageProxyMetricsRangeHistogramGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsRangeHistogramGetOK struct { +} + +func (o *StorageProxyMetricsRangeHistogramGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyMetricsRangeHistogramGetDefault creates a StorageProxyMetricsRangeHistogramGetDefault with default headers values +func NewStorageProxyMetricsRangeHistogramGetDefault(code int) *StorageProxyMetricsRangeHistogramGetDefault { + return &StorageProxyMetricsRangeHistogramGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsRangeHistogramGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsRangeHistogramGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics range histogram get default response +func (o *StorageProxyMetricsRangeHistogramGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsRangeHistogramGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsRangeHistogramGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsRangeHistogramGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_moving_average_histogram_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_moving_average_histogram_get_parameters.go new file mode 100644 index 0000000000..ab5b051371 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_moving_average_histogram_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsRangeMovingAverageHistogramGetParams creates a new StorageProxyMetricsRangeMovingAverageHistogramGetParams object +// with the default values initialized. +func NewStorageProxyMetricsRangeMovingAverageHistogramGetParams() *StorageProxyMetricsRangeMovingAverageHistogramGetParams { + + return &StorageProxyMetricsRangeMovingAverageHistogramGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsRangeMovingAverageHistogramGetParamsWithTimeout creates a new StorageProxyMetricsRangeMovingAverageHistogramGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsRangeMovingAverageHistogramGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsRangeMovingAverageHistogramGetParams { + + return &StorageProxyMetricsRangeMovingAverageHistogramGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsRangeMovingAverageHistogramGetParamsWithContext creates a new StorageProxyMetricsRangeMovingAverageHistogramGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsRangeMovingAverageHistogramGetParamsWithContext(ctx context.Context) *StorageProxyMetricsRangeMovingAverageHistogramGetParams { + + return &StorageProxyMetricsRangeMovingAverageHistogramGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsRangeMovingAverageHistogramGetParamsWithHTTPClient creates a new StorageProxyMetricsRangeMovingAverageHistogramGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsRangeMovingAverageHistogramGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsRangeMovingAverageHistogramGetParams { + + return &StorageProxyMetricsRangeMovingAverageHistogramGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsRangeMovingAverageHistogramGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics range moving average histogram get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsRangeMovingAverageHistogramGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics range moving average histogram get params +func (o *StorageProxyMetricsRangeMovingAverageHistogramGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsRangeMovingAverageHistogramGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics range moving average histogram get params +func (o *StorageProxyMetricsRangeMovingAverageHistogramGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics range moving average histogram get params +func (o *StorageProxyMetricsRangeMovingAverageHistogramGetParams) WithContext(ctx context.Context) *StorageProxyMetricsRangeMovingAverageHistogramGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics range moving average histogram get params +func (o *StorageProxyMetricsRangeMovingAverageHistogramGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics range moving average histogram get params +func (o *StorageProxyMetricsRangeMovingAverageHistogramGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsRangeMovingAverageHistogramGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics range moving average histogram get params +func (o *StorageProxyMetricsRangeMovingAverageHistogramGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsRangeMovingAverageHistogramGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_moving_average_histogram_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_moving_average_histogram_get_responses.go new file mode 100644 index 0000000000..1d96309af2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_moving_average_histogram_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsRangeMovingAverageHistogramGetReader is a Reader for the StorageProxyMetricsRangeMovingAverageHistogramGet structure. +type StorageProxyMetricsRangeMovingAverageHistogramGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsRangeMovingAverageHistogramGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsRangeMovingAverageHistogramGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsRangeMovingAverageHistogramGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsRangeMovingAverageHistogramGetOK creates a StorageProxyMetricsRangeMovingAverageHistogramGetOK with default headers values +func NewStorageProxyMetricsRangeMovingAverageHistogramGetOK() *StorageProxyMetricsRangeMovingAverageHistogramGetOK { + return &StorageProxyMetricsRangeMovingAverageHistogramGetOK{} +} + +/* +StorageProxyMetricsRangeMovingAverageHistogramGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsRangeMovingAverageHistogramGetOK struct { +} + +func (o *StorageProxyMetricsRangeMovingAverageHistogramGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyMetricsRangeMovingAverageHistogramGetDefault creates a StorageProxyMetricsRangeMovingAverageHistogramGetDefault with default headers values +func NewStorageProxyMetricsRangeMovingAverageHistogramGetDefault(code int) *StorageProxyMetricsRangeMovingAverageHistogramGetDefault { + return &StorageProxyMetricsRangeMovingAverageHistogramGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsRangeMovingAverageHistogramGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsRangeMovingAverageHistogramGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics range moving average histogram get default response +func (o *StorageProxyMetricsRangeMovingAverageHistogramGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsRangeMovingAverageHistogramGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsRangeMovingAverageHistogramGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsRangeMovingAverageHistogramGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_timeouts_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_timeouts_get_parameters.go new file mode 100644 index 0000000000..34bca19f87 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_timeouts_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsRangeTimeoutsGetParams creates a new StorageProxyMetricsRangeTimeoutsGetParams object +// with the default values initialized. +func NewStorageProxyMetricsRangeTimeoutsGetParams() *StorageProxyMetricsRangeTimeoutsGetParams { + + return &StorageProxyMetricsRangeTimeoutsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsRangeTimeoutsGetParamsWithTimeout creates a new StorageProxyMetricsRangeTimeoutsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsRangeTimeoutsGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsRangeTimeoutsGetParams { + + return &StorageProxyMetricsRangeTimeoutsGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsRangeTimeoutsGetParamsWithContext creates a new StorageProxyMetricsRangeTimeoutsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsRangeTimeoutsGetParamsWithContext(ctx context.Context) *StorageProxyMetricsRangeTimeoutsGetParams { + + return &StorageProxyMetricsRangeTimeoutsGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsRangeTimeoutsGetParamsWithHTTPClient creates a new StorageProxyMetricsRangeTimeoutsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsRangeTimeoutsGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsRangeTimeoutsGetParams { + + return &StorageProxyMetricsRangeTimeoutsGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsRangeTimeoutsGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics range timeouts get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsRangeTimeoutsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics range timeouts get params +func (o *StorageProxyMetricsRangeTimeoutsGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsRangeTimeoutsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics range timeouts get params +func (o *StorageProxyMetricsRangeTimeoutsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics range timeouts get params +func (o *StorageProxyMetricsRangeTimeoutsGetParams) WithContext(ctx context.Context) *StorageProxyMetricsRangeTimeoutsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics range timeouts get params +func (o *StorageProxyMetricsRangeTimeoutsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics range timeouts get params +func (o *StorageProxyMetricsRangeTimeoutsGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsRangeTimeoutsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics range timeouts get params +func (o *StorageProxyMetricsRangeTimeoutsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsRangeTimeoutsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_timeouts_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_timeouts_get_responses.go new file mode 100644 index 0000000000..7616474397 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_timeouts_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsRangeTimeoutsGetReader is a Reader for the StorageProxyMetricsRangeTimeoutsGet structure. +type StorageProxyMetricsRangeTimeoutsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsRangeTimeoutsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsRangeTimeoutsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsRangeTimeoutsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsRangeTimeoutsGetOK creates a StorageProxyMetricsRangeTimeoutsGetOK with default headers values +func NewStorageProxyMetricsRangeTimeoutsGetOK() *StorageProxyMetricsRangeTimeoutsGetOK { + return &StorageProxyMetricsRangeTimeoutsGetOK{} +} + +/* +StorageProxyMetricsRangeTimeoutsGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsRangeTimeoutsGetOK struct { + Payload int32 +} + +func (o *StorageProxyMetricsRangeTimeoutsGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyMetricsRangeTimeoutsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsRangeTimeoutsGetDefault creates a StorageProxyMetricsRangeTimeoutsGetDefault with default headers values +func NewStorageProxyMetricsRangeTimeoutsGetDefault(code int) *StorageProxyMetricsRangeTimeoutsGetDefault { + return &StorageProxyMetricsRangeTimeoutsGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsRangeTimeoutsGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsRangeTimeoutsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics range timeouts get default response +func (o *StorageProxyMetricsRangeTimeoutsGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsRangeTimeoutsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsRangeTimeoutsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsRangeTimeoutsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_timeouts_rates_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_timeouts_rates_get_parameters.go new file mode 100644 index 0000000000..be4160f525 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_timeouts_rates_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsRangeTimeoutsRatesGetParams creates a new StorageProxyMetricsRangeTimeoutsRatesGetParams object +// with the default values initialized. +func NewStorageProxyMetricsRangeTimeoutsRatesGetParams() *StorageProxyMetricsRangeTimeoutsRatesGetParams { + + return &StorageProxyMetricsRangeTimeoutsRatesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsRangeTimeoutsRatesGetParamsWithTimeout creates a new StorageProxyMetricsRangeTimeoutsRatesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsRangeTimeoutsRatesGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsRangeTimeoutsRatesGetParams { + + return &StorageProxyMetricsRangeTimeoutsRatesGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsRangeTimeoutsRatesGetParamsWithContext creates a new StorageProxyMetricsRangeTimeoutsRatesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsRangeTimeoutsRatesGetParamsWithContext(ctx context.Context) *StorageProxyMetricsRangeTimeoutsRatesGetParams { + + return &StorageProxyMetricsRangeTimeoutsRatesGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsRangeTimeoutsRatesGetParamsWithHTTPClient creates a new StorageProxyMetricsRangeTimeoutsRatesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsRangeTimeoutsRatesGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsRangeTimeoutsRatesGetParams { + + return &StorageProxyMetricsRangeTimeoutsRatesGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsRangeTimeoutsRatesGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics range timeouts rates get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsRangeTimeoutsRatesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics range timeouts rates get params +func (o *StorageProxyMetricsRangeTimeoutsRatesGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsRangeTimeoutsRatesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics range timeouts rates get params +func (o *StorageProxyMetricsRangeTimeoutsRatesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics range timeouts rates get params +func (o *StorageProxyMetricsRangeTimeoutsRatesGetParams) WithContext(ctx context.Context) *StorageProxyMetricsRangeTimeoutsRatesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics range timeouts rates get params +func (o *StorageProxyMetricsRangeTimeoutsRatesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics range timeouts rates get params +func (o *StorageProxyMetricsRangeTimeoutsRatesGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsRangeTimeoutsRatesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics range timeouts rates get params +func (o *StorageProxyMetricsRangeTimeoutsRatesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsRangeTimeoutsRatesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_timeouts_rates_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_timeouts_rates_get_responses.go new file mode 100644 index 0000000000..51087b98f3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_timeouts_rates_get_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsRangeTimeoutsRatesGetReader is a Reader for the StorageProxyMetricsRangeTimeoutsRatesGet structure. +type StorageProxyMetricsRangeTimeoutsRatesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsRangeTimeoutsRatesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsRangeTimeoutsRatesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsRangeTimeoutsRatesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsRangeTimeoutsRatesGetOK creates a StorageProxyMetricsRangeTimeoutsRatesGetOK with default headers values +func NewStorageProxyMetricsRangeTimeoutsRatesGetOK() *StorageProxyMetricsRangeTimeoutsRatesGetOK { + return &StorageProxyMetricsRangeTimeoutsRatesGetOK{} +} + +/* +StorageProxyMetricsRangeTimeoutsRatesGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsRangeTimeoutsRatesGetOK struct { + Payload *models.RateMovingAverage +} + +func (o *StorageProxyMetricsRangeTimeoutsRatesGetOK) GetPayload() *models.RateMovingAverage { + return o.Payload +} + +func (o *StorageProxyMetricsRangeTimeoutsRatesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RateMovingAverage) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsRangeTimeoutsRatesGetDefault creates a StorageProxyMetricsRangeTimeoutsRatesGetDefault with default headers values +func NewStorageProxyMetricsRangeTimeoutsRatesGetDefault(code int) *StorageProxyMetricsRangeTimeoutsRatesGetDefault { + return &StorageProxyMetricsRangeTimeoutsRatesGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsRangeTimeoutsRatesGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsRangeTimeoutsRatesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics range timeouts rates get default response +func (o *StorageProxyMetricsRangeTimeoutsRatesGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsRangeTimeoutsRatesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsRangeTimeoutsRatesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsRangeTimeoutsRatesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_unavailables_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_unavailables_get_parameters.go new file mode 100644 index 0000000000..1386274f47 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_unavailables_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsRangeUnavailablesGetParams creates a new StorageProxyMetricsRangeUnavailablesGetParams object +// with the default values initialized. +func NewStorageProxyMetricsRangeUnavailablesGetParams() *StorageProxyMetricsRangeUnavailablesGetParams { + + return &StorageProxyMetricsRangeUnavailablesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsRangeUnavailablesGetParamsWithTimeout creates a new StorageProxyMetricsRangeUnavailablesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsRangeUnavailablesGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsRangeUnavailablesGetParams { + + return &StorageProxyMetricsRangeUnavailablesGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsRangeUnavailablesGetParamsWithContext creates a new StorageProxyMetricsRangeUnavailablesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsRangeUnavailablesGetParamsWithContext(ctx context.Context) *StorageProxyMetricsRangeUnavailablesGetParams { + + return &StorageProxyMetricsRangeUnavailablesGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsRangeUnavailablesGetParamsWithHTTPClient creates a new StorageProxyMetricsRangeUnavailablesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsRangeUnavailablesGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsRangeUnavailablesGetParams { + + return &StorageProxyMetricsRangeUnavailablesGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsRangeUnavailablesGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics range unavailables get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsRangeUnavailablesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics range unavailables get params +func (o *StorageProxyMetricsRangeUnavailablesGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsRangeUnavailablesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics range unavailables get params +func (o *StorageProxyMetricsRangeUnavailablesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics range unavailables get params +func (o *StorageProxyMetricsRangeUnavailablesGetParams) WithContext(ctx context.Context) *StorageProxyMetricsRangeUnavailablesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics range unavailables get params +func (o *StorageProxyMetricsRangeUnavailablesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics range unavailables get params +func (o *StorageProxyMetricsRangeUnavailablesGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsRangeUnavailablesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics range unavailables get params +func (o *StorageProxyMetricsRangeUnavailablesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsRangeUnavailablesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_unavailables_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_unavailables_get_responses.go new file mode 100644 index 0000000000..5d9572e46f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_unavailables_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsRangeUnavailablesGetReader is a Reader for the StorageProxyMetricsRangeUnavailablesGet structure. +type StorageProxyMetricsRangeUnavailablesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsRangeUnavailablesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsRangeUnavailablesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsRangeUnavailablesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsRangeUnavailablesGetOK creates a StorageProxyMetricsRangeUnavailablesGetOK with default headers values +func NewStorageProxyMetricsRangeUnavailablesGetOK() *StorageProxyMetricsRangeUnavailablesGetOK { + return &StorageProxyMetricsRangeUnavailablesGetOK{} +} + +/* +StorageProxyMetricsRangeUnavailablesGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsRangeUnavailablesGetOK struct { + Payload int32 +} + +func (o *StorageProxyMetricsRangeUnavailablesGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyMetricsRangeUnavailablesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsRangeUnavailablesGetDefault creates a StorageProxyMetricsRangeUnavailablesGetDefault with default headers values +func NewStorageProxyMetricsRangeUnavailablesGetDefault(code int) *StorageProxyMetricsRangeUnavailablesGetDefault { + return &StorageProxyMetricsRangeUnavailablesGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsRangeUnavailablesGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsRangeUnavailablesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics range unavailables get default response +func (o *StorageProxyMetricsRangeUnavailablesGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsRangeUnavailablesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsRangeUnavailablesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsRangeUnavailablesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_unavailables_rates_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_unavailables_rates_get_parameters.go new file mode 100644 index 0000000000..6efdc82cab --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_unavailables_rates_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsRangeUnavailablesRatesGetParams creates a new StorageProxyMetricsRangeUnavailablesRatesGetParams object +// with the default values initialized. +func NewStorageProxyMetricsRangeUnavailablesRatesGetParams() *StorageProxyMetricsRangeUnavailablesRatesGetParams { + + return &StorageProxyMetricsRangeUnavailablesRatesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsRangeUnavailablesRatesGetParamsWithTimeout creates a new StorageProxyMetricsRangeUnavailablesRatesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsRangeUnavailablesRatesGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsRangeUnavailablesRatesGetParams { + + return &StorageProxyMetricsRangeUnavailablesRatesGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsRangeUnavailablesRatesGetParamsWithContext creates a new StorageProxyMetricsRangeUnavailablesRatesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsRangeUnavailablesRatesGetParamsWithContext(ctx context.Context) *StorageProxyMetricsRangeUnavailablesRatesGetParams { + + return &StorageProxyMetricsRangeUnavailablesRatesGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsRangeUnavailablesRatesGetParamsWithHTTPClient creates a new StorageProxyMetricsRangeUnavailablesRatesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsRangeUnavailablesRatesGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsRangeUnavailablesRatesGetParams { + + return &StorageProxyMetricsRangeUnavailablesRatesGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsRangeUnavailablesRatesGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics range unavailables rates get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsRangeUnavailablesRatesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics range unavailables rates get params +func (o *StorageProxyMetricsRangeUnavailablesRatesGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsRangeUnavailablesRatesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics range unavailables rates get params +func (o *StorageProxyMetricsRangeUnavailablesRatesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics range unavailables rates get params +func (o *StorageProxyMetricsRangeUnavailablesRatesGetParams) WithContext(ctx context.Context) *StorageProxyMetricsRangeUnavailablesRatesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics range unavailables rates get params +func (o *StorageProxyMetricsRangeUnavailablesRatesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics range unavailables rates get params +func (o *StorageProxyMetricsRangeUnavailablesRatesGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsRangeUnavailablesRatesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics range unavailables rates get params +func (o *StorageProxyMetricsRangeUnavailablesRatesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsRangeUnavailablesRatesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_unavailables_rates_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_unavailables_rates_get_responses.go new file mode 100644 index 0000000000..b3111ac8a9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_range_unavailables_rates_get_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsRangeUnavailablesRatesGetReader is a Reader for the StorageProxyMetricsRangeUnavailablesRatesGet structure. +type StorageProxyMetricsRangeUnavailablesRatesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsRangeUnavailablesRatesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsRangeUnavailablesRatesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsRangeUnavailablesRatesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsRangeUnavailablesRatesGetOK creates a StorageProxyMetricsRangeUnavailablesRatesGetOK with default headers values +func NewStorageProxyMetricsRangeUnavailablesRatesGetOK() *StorageProxyMetricsRangeUnavailablesRatesGetOK { + return &StorageProxyMetricsRangeUnavailablesRatesGetOK{} +} + +/* +StorageProxyMetricsRangeUnavailablesRatesGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsRangeUnavailablesRatesGetOK struct { + Payload *models.RateMovingAverage +} + +func (o *StorageProxyMetricsRangeUnavailablesRatesGetOK) GetPayload() *models.RateMovingAverage { + return o.Payload +} + +func (o *StorageProxyMetricsRangeUnavailablesRatesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RateMovingAverage) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsRangeUnavailablesRatesGetDefault creates a StorageProxyMetricsRangeUnavailablesRatesGetDefault with default headers values +func NewStorageProxyMetricsRangeUnavailablesRatesGetDefault(code int) *StorageProxyMetricsRangeUnavailablesRatesGetDefault { + return &StorageProxyMetricsRangeUnavailablesRatesGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsRangeUnavailablesRatesGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsRangeUnavailablesRatesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics range unavailables rates get default response +func (o *StorageProxyMetricsRangeUnavailablesRatesGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsRangeUnavailablesRatesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsRangeUnavailablesRatesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsRangeUnavailablesRatesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_estimated_histogram_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_estimated_histogram_get_parameters.go new file mode 100644 index 0000000000..d9ea7ba0d0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_estimated_histogram_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsReadEstimatedHistogramGetParams creates a new StorageProxyMetricsReadEstimatedHistogramGetParams object +// with the default values initialized. +func NewStorageProxyMetricsReadEstimatedHistogramGetParams() *StorageProxyMetricsReadEstimatedHistogramGetParams { + + return &StorageProxyMetricsReadEstimatedHistogramGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsReadEstimatedHistogramGetParamsWithTimeout creates a new StorageProxyMetricsReadEstimatedHistogramGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsReadEstimatedHistogramGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsReadEstimatedHistogramGetParams { + + return &StorageProxyMetricsReadEstimatedHistogramGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsReadEstimatedHistogramGetParamsWithContext creates a new StorageProxyMetricsReadEstimatedHistogramGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsReadEstimatedHistogramGetParamsWithContext(ctx context.Context) *StorageProxyMetricsReadEstimatedHistogramGetParams { + + return &StorageProxyMetricsReadEstimatedHistogramGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsReadEstimatedHistogramGetParamsWithHTTPClient creates a new StorageProxyMetricsReadEstimatedHistogramGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsReadEstimatedHistogramGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsReadEstimatedHistogramGetParams { + + return &StorageProxyMetricsReadEstimatedHistogramGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsReadEstimatedHistogramGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics read estimated histogram get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsReadEstimatedHistogramGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics read estimated histogram get params +func (o *StorageProxyMetricsReadEstimatedHistogramGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsReadEstimatedHistogramGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics read estimated histogram get params +func (o *StorageProxyMetricsReadEstimatedHistogramGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics read estimated histogram get params +func (o *StorageProxyMetricsReadEstimatedHistogramGetParams) WithContext(ctx context.Context) *StorageProxyMetricsReadEstimatedHistogramGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics read estimated histogram get params +func (o *StorageProxyMetricsReadEstimatedHistogramGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics read estimated histogram get params +func (o *StorageProxyMetricsReadEstimatedHistogramGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsReadEstimatedHistogramGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics read estimated histogram get params +func (o *StorageProxyMetricsReadEstimatedHistogramGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsReadEstimatedHistogramGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_estimated_histogram_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_estimated_histogram_get_responses.go new file mode 100644 index 0000000000..c004f14ea4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_estimated_histogram_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsReadEstimatedHistogramGetReader is a Reader for the StorageProxyMetricsReadEstimatedHistogramGet structure. +type StorageProxyMetricsReadEstimatedHistogramGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsReadEstimatedHistogramGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsReadEstimatedHistogramGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsReadEstimatedHistogramGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsReadEstimatedHistogramGetOK creates a StorageProxyMetricsReadEstimatedHistogramGetOK with default headers values +func NewStorageProxyMetricsReadEstimatedHistogramGetOK() *StorageProxyMetricsReadEstimatedHistogramGetOK { + return &StorageProxyMetricsReadEstimatedHistogramGetOK{} +} + +/* +StorageProxyMetricsReadEstimatedHistogramGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsReadEstimatedHistogramGetOK struct { +} + +func (o *StorageProxyMetricsReadEstimatedHistogramGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyMetricsReadEstimatedHistogramGetDefault creates a StorageProxyMetricsReadEstimatedHistogramGetDefault with default headers values +func NewStorageProxyMetricsReadEstimatedHistogramGetDefault(code int) *StorageProxyMetricsReadEstimatedHistogramGetDefault { + return &StorageProxyMetricsReadEstimatedHistogramGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsReadEstimatedHistogramGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsReadEstimatedHistogramGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics read estimated histogram get default response +func (o *StorageProxyMetricsReadEstimatedHistogramGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsReadEstimatedHistogramGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsReadEstimatedHistogramGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsReadEstimatedHistogramGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_get_parameters.go new file mode 100644 index 0000000000..98e0a9d1da --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsReadGetParams creates a new StorageProxyMetricsReadGetParams object +// with the default values initialized. +func NewStorageProxyMetricsReadGetParams() *StorageProxyMetricsReadGetParams { + + return &StorageProxyMetricsReadGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsReadGetParamsWithTimeout creates a new StorageProxyMetricsReadGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsReadGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsReadGetParams { + + return &StorageProxyMetricsReadGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsReadGetParamsWithContext creates a new StorageProxyMetricsReadGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsReadGetParamsWithContext(ctx context.Context) *StorageProxyMetricsReadGetParams { + + return &StorageProxyMetricsReadGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsReadGetParamsWithHTTPClient creates a new StorageProxyMetricsReadGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsReadGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsReadGetParams { + + return &StorageProxyMetricsReadGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsReadGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics read get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsReadGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics read get params +func (o *StorageProxyMetricsReadGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsReadGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics read get params +func (o *StorageProxyMetricsReadGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics read get params +func (o *StorageProxyMetricsReadGetParams) WithContext(ctx context.Context) *StorageProxyMetricsReadGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics read get params +func (o *StorageProxyMetricsReadGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics read get params +func (o *StorageProxyMetricsReadGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsReadGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics read get params +func (o *StorageProxyMetricsReadGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsReadGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_get_responses.go new file mode 100644 index 0000000000..1838fb0f87 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsReadGetReader is a Reader for the StorageProxyMetricsReadGet structure. +type StorageProxyMetricsReadGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsReadGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsReadGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsReadGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsReadGetOK creates a StorageProxyMetricsReadGetOK with default headers values +func NewStorageProxyMetricsReadGetOK() *StorageProxyMetricsReadGetOK { + return &StorageProxyMetricsReadGetOK{} +} + +/* +StorageProxyMetricsReadGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsReadGetOK struct { + Payload int32 +} + +func (o *StorageProxyMetricsReadGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyMetricsReadGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsReadGetDefault creates a StorageProxyMetricsReadGetDefault with default headers values +func NewStorageProxyMetricsReadGetDefault(code int) *StorageProxyMetricsReadGetDefault { + return &StorageProxyMetricsReadGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsReadGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsReadGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics read get default response +func (o *StorageProxyMetricsReadGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsReadGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsReadGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsReadGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_histogram_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_histogram_get_parameters.go new file mode 100644 index 0000000000..e352814b66 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_histogram_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsReadHistogramGetParams creates a new StorageProxyMetricsReadHistogramGetParams object +// with the default values initialized. +func NewStorageProxyMetricsReadHistogramGetParams() *StorageProxyMetricsReadHistogramGetParams { + + return &StorageProxyMetricsReadHistogramGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsReadHistogramGetParamsWithTimeout creates a new StorageProxyMetricsReadHistogramGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsReadHistogramGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsReadHistogramGetParams { + + return &StorageProxyMetricsReadHistogramGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsReadHistogramGetParamsWithContext creates a new StorageProxyMetricsReadHistogramGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsReadHistogramGetParamsWithContext(ctx context.Context) *StorageProxyMetricsReadHistogramGetParams { + + return &StorageProxyMetricsReadHistogramGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsReadHistogramGetParamsWithHTTPClient creates a new StorageProxyMetricsReadHistogramGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsReadHistogramGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsReadHistogramGetParams { + + return &StorageProxyMetricsReadHistogramGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsReadHistogramGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics read histogram get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsReadHistogramGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics read histogram get params +func (o *StorageProxyMetricsReadHistogramGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsReadHistogramGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics read histogram get params +func (o *StorageProxyMetricsReadHistogramGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics read histogram get params +func (o *StorageProxyMetricsReadHistogramGetParams) WithContext(ctx context.Context) *StorageProxyMetricsReadHistogramGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics read histogram get params +func (o *StorageProxyMetricsReadHistogramGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics read histogram get params +func (o *StorageProxyMetricsReadHistogramGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsReadHistogramGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics read histogram get params +func (o *StorageProxyMetricsReadHistogramGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsReadHistogramGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_histogram_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_histogram_get_responses.go new file mode 100644 index 0000000000..c5681d3705 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_histogram_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsReadHistogramGetReader is a Reader for the StorageProxyMetricsReadHistogramGet structure. +type StorageProxyMetricsReadHistogramGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsReadHistogramGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsReadHistogramGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsReadHistogramGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsReadHistogramGetOK creates a StorageProxyMetricsReadHistogramGetOK with default headers values +func NewStorageProxyMetricsReadHistogramGetOK() *StorageProxyMetricsReadHistogramGetOK { + return &StorageProxyMetricsReadHistogramGetOK{} +} + +/* +StorageProxyMetricsReadHistogramGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsReadHistogramGetOK struct { +} + +func (o *StorageProxyMetricsReadHistogramGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyMetricsReadHistogramGetDefault creates a StorageProxyMetricsReadHistogramGetDefault with default headers values +func NewStorageProxyMetricsReadHistogramGetDefault(code int) *StorageProxyMetricsReadHistogramGetDefault { + return &StorageProxyMetricsReadHistogramGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsReadHistogramGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsReadHistogramGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics read histogram get default response +func (o *StorageProxyMetricsReadHistogramGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsReadHistogramGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsReadHistogramGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsReadHistogramGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_moving_average_histogram_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_moving_average_histogram_get_parameters.go new file mode 100644 index 0000000000..d52706c709 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_moving_average_histogram_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsReadMovingAverageHistogramGetParams creates a new StorageProxyMetricsReadMovingAverageHistogramGetParams object +// with the default values initialized. +func NewStorageProxyMetricsReadMovingAverageHistogramGetParams() *StorageProxyMetricsReadMovingAverageHistogramGetParams { + + return &StorageProxyMetricsReadMovingAverageHistogramGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsReadMovingAverageHistogramGetParamsWithTimeout creates a new StorageProxyMetricsReadMovingAverageHistogramGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsReadMovingAverageHistogramGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsReadMovingAverageHistogramGetParams { + + return &StorageProxyMetricsReadMovingAverageHistogramGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsReadMovingAverageHistogramGetParamsWithContext creates a new StorageProxyMetricsReadMovingAverageHistogramGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsReadMovingAverageHistogramGetParamsWithContext(ctx context.Context) *StorageProxyMetricsReadMovingAverageHistogramGetParams { + + return &StorageProxyMetricsReadMovingAverageHistogramGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsReadMovingAverageHistogramGetParamsWithHTTPClient creates a new StorageProxyMetricsReadMovingAverageHistogramGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsReadMovingAverageHistogramGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsReadMovingAverageHistogramGetParams { + + return &StorageProxyMetricsReadMovingAverageHistogramGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsReadMovingAverageHistogramGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics read moving average histogram get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsReadMovingAverageHistogramGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics read moving average histogram get params +func (o *StorageProxyMetricsReadMovingAverageHistogramGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsReadMovingAverageHistogramGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics read moving average histogram get params +func (o *StorageProxyMetricsReadMovingAverageHistogramGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics read moving average histogram get params +func (o *StorageProxyMetricsReadMovingAverageHistogramGetParams) WithContext(ctx context.Context) *StorageProxyMetricsReadMovingAverageHistogramGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics read moving average histogram get params +func (o *StorageProxyMetricsReadMovingAverageHistogramGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics read moving average histogram get params +func (o *StorageProxyMetricsReadMovingAverageHistogramGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsReadMovingAverageHistogramGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics read moving average histogram get params +func (o *StorageProxyMetricsReadMovingAverageHistogramGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsReadMovingAverageHistogramGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_moving_average_histogram_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_moving_average_histogram_get_responses.go new file mode 100644 index 0000000000..50e304b1c1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_moving_average_histogram_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsReadMovingAverageHistogramGetReader is a Reader for the StorageProxyMetricsReadMovingAverageHistogramGet structure. +type StorageProxyMetricsReadMovingAverageHistogramGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsReadMovingAverageHistogramGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsReadMovingAverageHistogramGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsReadMovingAverageHistogramGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsReadMovingAverageHistogramGetOK creates a StorageProxyMetricsReadMovingAverageHistogramGetOK with default headers values +func NewStorageProxyMetricsReadMovingAverageHistogramGetOK() *StorageProxyMetricsReadMovingAverageHistogramGetOK { + return &StorageProxyMetricsReadMovingAverageHistogramGetOK{} +} + +/* +StorageProxyMetricsReadMovingAverageHistogramGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsReadMovingAverageHistogramGetOK struct { +} + +func (o *StorageProxyMetricsReadMovingAverageHistogramGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyMetricsReadMovingAverageHistogramGetDefault creates a StorageProxyMetricsReadMovingAverageHistogramGetDefault with default headers values +func NewStorageProxyMetricsReadMovingAverageHistogramGetDefault(code int) *StorageProxyMetricsReadMovingAverageHistogramGetDefault { + return &StorageProxyMetricsReadMovingAverageHistogramGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsReadMovingAverageHistogramGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsReadMovingAverageHistogramGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics read moving average histogram get default response +func (o *StorageProxyMetricsReadMovingAverageHistogramGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsReadMovingAverageHistogramGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsReadMovingAverageHistogramGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsReadMovingAverageHistogramGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_timeouts_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_timeouts_get_parameters.go new file mode 100644 index 0000000000..eeca48375f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_timeouts_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsReadTimeoutsGetParams creates a new StorageProxyMetricsReadTimeoutsGetParams object +// with the default values initialized. +func NewStorageProxyMetricsReadTimeoutsGetParams() *StorageProxyMetricsReadTimeoutsGetParams { + + return &StorageProxyMetricsReadTimeoutsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsReadTimeoutsGetParamsWithTimeout creates a new StorageProxyMetricsReadTimeoutsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsReadTimeoutsGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsReadTimeoutsGetParams { + + return &StorageProxyMetricsReadTimeoutsGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsReadTimeoutsGetParamsWithContext creates a new StorageProxyMetricsReadTimeoutsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsReadTimeoutsGetParamsWithContext(ctx context.Context) *StorageProxyMetricsReadTimeoutsGetParams { + + return &StorageProxyMetricsReadTimeoutsGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsReadTimeoutsGetParamsWithHTTPClient creates a new StorageProxyMetricsReadTimeoutsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsReadTimeoutsGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsReadTimeoutsGetParams { + + return &StorageProxyMetricsReadTimeoutsGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsReadTimeoutsGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics read timeouts get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsReadTimeoutsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics read timeouts get params +func (o *StorageProxyMetricsReadTimeoutsGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsReadTimeoutsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics read timeouts get params +func (o *StorageProxyMetricsReadTimeoutsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics read timeouts get params +func (o *StorageProxyMetricsReadTimeoutsGetParams) WithContext(ctx context.Context) *StorageProxyMetricsReadTimeoutsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics read timeouts get params +func (o *StorageProxyMetricsReadTimeoutsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics read timeouts get params +func (o *StorageProxyMetricsReadTimeoutsGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsReadTimeoutsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics read timeouts get params +func (o *StorageProxyMetricsReadTimeoutsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsReadTimeoutsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_timeouts_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_timeouts_get_responses.go new file mode 100644 index 0000000000..ca08315778 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_timeouts_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsReadTimeoutsGetReader is a Reader for the StorageProxyMetricsReadTimeoutsGet structure. +type StorageProxyMetricsReadTimeoutsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsReadTimeoutsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsReadTimeoutsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsReadTimeoutsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsReadTimeoutsGetOK creates a StorageProxyMetricsReadTimeoutsGetOK with default headers values +func NewStorageProxyMetricsReadTimeoutsGetOK() *StorageProxyMetricsReadTimeoutsGetOK { + return &StorageProxyMetricsReadTimeoutsGetOK{} +} + +/* +StorageProxyMetricsReadTimeoutsGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsReadTimeoutsGetOK struct { + Payload int32 +} + +func (o *StorageProxyMetricsReadTimeoutsGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyMetricsReadTimeoutsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsReadTimeoutsGetDefault creates a StorageProxyMetricsReadTimeoutsGetDefault with default headers values +func NewStorageProxyMetricsReadTimeoutsGetDefault(code int) *StorageProxyMetricsReadTimeoutsGetDefault { + return &StorageProxyMetricsReadTimeoutsGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsReadTimeoutsGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsReadTimeoutsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics read timeouts get default response +func (o *StorageProxyMetricsReadTimeoutsGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsReadTimeoutsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsReadTimeoutsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsReadTimeoutsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_timeouts_rates_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_timeouts_rates_get_parameters.go new file mode 100644 index 0000000000..8358addcce --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_timeouts_rates_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsReadTimeoutsRatesGetParams creates a new StorageProxyMetricsReadTimeoutsRatesGetParams object +// with the default values initialized. +func NewStorageProxyMetricsReadTimeoutsRatesGetParams() *StorageProxyMetricsReadTimeoutsRatesGetParams { + + return &StorageProxyMetricsReadTimeoutsRatesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsReadTimeoutsRatesGetParamsWithTimeout creates a new StorageProxyMetricsReadTimeoutsRatesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsReadTimeoutsRatesGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsReadTimeoutsRatesGetParams { + + return &StorageProxyMetricsReadTimeoutsRatesGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsReadTimeoutsRatesGetParamsWithContext creates a new StorageProxyMetricsReadTimeoutsRatesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsReadTimeoutsRatesGetParamsWithContext(ctx context.Context) *StorageProxyMetricsReadTimeoutsRatesGetParams { + + return &StorageProxyMetricsReadTimeoutsRatesGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsReadTimeoutsRatesGetParamsWithHTTPClient creates a new StorageProxyMetricsReadTimeoutsRatesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsReadTimeoutsRatesGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsReadTimeoutsRatesGetParams { + + return &StorageProxyMetricsReadTimeoutsRatesGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsReadTimeoutsRatesGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics read timeouts rates get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsReadTimeoutsRatesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics read timeouts rates get params +func (o *StorageProxyMetricsReadTimeoutsRatesGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsReadTimeoutsRatesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics read timeouts rates get params +func (o *StorageProxyMetricsReadTimeoutsRatesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics read timeouts rates get params +func (o *StorageProxyMetricsReadTimeoutsRatesGetParams) WithContext(ctx context.Context) *StorageProxyMetricsReadTimeoutsRatesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics read timeouts rates get params +func (o *StorageProxyMetricsReadTimeoutsRatesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics read timeouts rates get params +func (o *StorageProxyMetricsReadTimeoutsRatesGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsReadTimeoutsRatesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics read timeouts rates get params +func (o *StorageProxyMetricsReadTimeoutsRatesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsReadTimeoutsRatesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_timeouts_rates_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_timeouts_rates_get_responses.go new file mode 100644 index 0000000000..c46776b36a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_timeouts_rates_get_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsReadTimeoutsRatesGetReader is a Reader for the StorageProxyMetricsReadTimeoutsRatesGet structure. +type StorageProxyMetricsReadTimeoutsRatesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsReadTimeoutsRatesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsReadTimeoutsRatesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsReadTimeoutsRatesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsReadTimeoutsRatesGetOK creates a StorageProxyMetricsReadTimeoutsRatesGetOK with default headers values +func NewStorageProxyMetricsReadTimeoutsRatesGetOK() *StorageProxyMetricsReadTimeoutsRatesGetOK { + return &StorageProxyMetricsReadTimeoutsRatesGetOK{} +} + +/* +StorageProxyMetricsReadTimeoutsRatesGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsReadTimeoutsRatesGetOK struct { + Payload *models.RateMovingAverage +} + +func (o *StorageProxyMetricsReadTimeoutsRatesGetOK) GetPayload() *models.RateMovingAverage { + return o.Payload +} + +func (o *StorageProxyMetricsReadTimeoutsRatesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RateMovingAverage) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsReadTimeoutsRatesGetDefault creates a StorageProxyMetricsReadTimeoutsRatesGetDefault with default headers values +func NewStorageProxyMetricsReadTimeoutsRatesGetDefault(code int) *StorageProxyMetricsReadTimeoutsRatesGetDefault { + return &StorageProxyMetricsReadTimeoutsRatesGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsReadTimeoutsRatesGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsReadTimeoutsRatesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics read timeouts rates get default response +func (o *StorageProxyMetricsReadTimeoutsRatesGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsReadTimeoutsRatesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsReadTimeoutsRatesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsReadTimeoutsRatesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_unavailables_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_unavailables_get_parameters.go new file mode 100644 index 0000000000..e3eda39d4f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_unavailables_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsReadUnavailablesGetParams creates a new StorageProxyMetricsReadUnavailablesGetParams object +// with the default values initialized. +func NewStorageProxyMetricsReadUnavailablesGetParams() *StorageProxyMetricsReadUnavailablesGetParams { + + return &StorageProxyMetricsReadUnavailablesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsReadUnavailablesGetParamsWithTimeout creates a new StorageProxyMetricsReadUnavailablesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsReadUnavailablesGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsReadUnavailablesGetParams { + + return &StorageProxyMetricsReadUnavailablesGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsReadUnavailablesGetParamsWithContext creates a new StorageProxyMetricsReadUnavailablesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsReadUnavailablesGetParamsWithContext(ctx context.Context) *StorageProxyMetricsReadUnavailablesGetParams { + + return &StorageProxyMetricsReadUnavailablesGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsReadUnavailablesGetParamsWithHTTPClient creates a new StorageProxyMetricsReadUnavailablesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsReadUnavailablesGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsReadUnavailablesGetParams { + + return &StorageProxyMetricsReadUnavailablesGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsReadUnavailablesGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics read unavailables get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsReadUnavailablesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics read unavailables get params +func (o *StorageProxyMetricsReadUnavailablesGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsReadUnavailablesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics read unavailables get params +func (o *StorageProxyMetricsReadUnavailablesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics read unavailables get params +func (o *StorageProxyMetricsReadUnavailablesGetParams) WithContext(ctx context.Context) *StorageProxyMetricsReadUnavailablesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics read unavailables get params +func (o *StorageProxyMetricsReadUnavailablesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics read unavailables get params +func (o *StorageProxyMetricsReadUnavailablesGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsReadUnavailablesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics read unavailables get params +func (o *StorageProxyMetricsReadUnavailablesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsReadUnavailablesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_unavailables_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_unavailables_get_responses.go new file mode 100644 index 0000000000..c8b9a08eb1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_unavailables_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsReadUnavailablesGetReader is a Reader for the StorageProxyMetricsReadUnavailablesGet structure. +type StorageProxyMetricsReadUnavailablesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsReadUnavailablesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsReadUnavailablesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsReadUnavailablesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsReadUnavailablesGetOK creates a StorageProxyMetricsReadUnavailablesGetOK with default headers values +func NewStorageProxyMetricsReadUnavailablesGetOK() *StorageProxyMetricsReadUnavailablesGetOK { + return &StorageProxyMetricsReadUnavailablesGetOK{} +} + +/* +StorageProxyMetricsReadUnavailablesGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsReadUnavailablesGetOK struct { + Payload int32 +} + +func (o *StorageProxyMetricsReadUnavailablesGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyMetricsReadUnavailablesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsReadUnavailablesGetDefault creates a StorageProxyMetricsReadUnavailablesGetDefault with default headers values +func NewStorageProxyMetricsReadUnavailablesGetDefault(code int) *StorageProxyMetricsReadUnavailablesGetDefault { + return &StorageProxyMetricsReadUnavailablesGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsReadUnavailablesGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsReadUnavailablesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics read unavailables get default response +func (o *StorageProxyMetricsReadUnavailablesGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsReadUnavailablesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsReadUnavailablesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsReadUnavailablesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_unavailables_rates_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_unavailables_rates_get_parameters.go new file mode 100644 index 0000000000..a7fac6a2f2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_unavailables_rates_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsReadUnavailablesRatesGetParams creates a new StorageProxyMetricsReadUnavailablesRatesGetParams object +// with the default values initialized. +func NewStorageProxyMetricsReadUnavailablesRatesGetParams() *StorageProxyMetricsReadUnavailablesRatesGetParams { + + return &StorageProxyMetricsReadUnavailablesRatesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsReadUnavailablesRatesGetParamsWithTimeout creates a new StorageProxyMetricsReadUnavailablesRatesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsReadUnavailablesRatesGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsReadUnavailablesRatesGetParams { + + return &StorageProxyMetricsReadUnavailablesRatesGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsReadUnavailablesRatesGetParamsWithContext creates a new StorageProxyMetricsReadUnavailablesRatesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsReadUnavailablesRatesGetParamsWithContext(ctx context.Context) *StorageProxyMetricsReadUnavailablesRatesGetParams { + + return &StorageProxyMetricsReadUnavailablesRatesGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsReadUnavailablesRatesGetParamsWithHTTPClient creates a new StorageProxyMetricsReadUnavailablesRatesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsReadUnavailablesRatesGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsReadUnavailablesRatesGetParams { + + return &StorageProxyMetricsReadUnavailablesRatesGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsReadUnavailablesRatesGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics read unavailables rates get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsReadUnavailablesRatesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics read unavailables rates get params +func (o *StorageProxyMetricsReadUnavailablesRatesGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsReadUnavailablesRatesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics read unavailables rates get params +func (o *StorageProxyMetricsReadUnavailablesRatesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics read unavailables rates get params +func (o *StorageProxyMetricsReadUnavailablesRatesGetParams) WithContext(ctx context.Context) *StorageProxyMetricsReadUnavailablesRatesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics read unavailables rates get params +func (o *StorageProxyMetricsReadUnavailablesRatesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics read unavailables rates get params +func (o *StorageProxyMetricsReadUnavailablesRatesGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsReadUnavailablesRatesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics read unavailables rates get params +func (o *StorageProxyMetricsReadUnavailablesRatesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsReadUnavailablesRatesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_unavailables_rates_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_unavailables_rates_get_responses.go new file mode 100644 index 0000000000..886915a532 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_read_unavailables_rates_get_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsReadUnavailablesRatesGetReader is a Reader for the StorageProxyMetricsReadUnavailablesRatesGet structure. +type StorageProxyMetricsReadUnavailablesRatesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsReadUnavailablesRatesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsReadUnavailablesRatesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsReadUnavailablesRatesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsReadUnavailablesRatesGetOK creates a StorageProxyMetricsReadUnavailablesRatesGetOK with default headers values +func NewStorageProxyMetricsReadUnavailablesRatesGetOK() *StorageProxyMetricsReadUnavailablesRatesGetOK { + return &StorageProxyMetricsReadUnavailablesRatesGetOK{} +} + +/* +StorageProxyMetricsReadUnavailablesRatesGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsReadUnavailablesRatesGetOK struct { + Payload *models.RateMovingAverage +} + +func (o *StorageProxyMetricsReadUnavailablesRatesGetOK) GetPayload() *models.RateMovingAverage { + return o.Payload +} + +func (o *StorageProxyMetricsReadUnavailablesRatesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RateMovingAverage) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsReadUnavailablesRatesGetDefault creates a StorageProxyMetricsReadUnavailablesRatesGetDefault with default headers values +func NewStorageProxyMetricsReadUnavailablesRatesGetDefault(code int) *StorageProxyMetricsReadUnavailablesRatesGetDefault { + return &StorageProxyMetricsReadUnavailablesRatesGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsReadUnavailablesRatesGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsReadUnavailablesRatesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics read unavailables rates get default response +func (o *StorageProxyMetricsReadUnavailablesRatesGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsReadUnavailablesRatesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsReadUnavailablesRatesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsReadUnavailablesRatesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_estimated_histogram_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_estimated_histogram_get_parameters.go new file mode 100644 index 0000000000..a50b4ed136 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_estimated_histogram_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsWriteEstimatedHistogramGetParams creates a new StorageProxyMetricsWriteEstimatedHistogramGetParams object +// with the default values initialized. +func NewStorageProxyMetricsWriteEstimatedHistogramGetParams() *StorageProxyMetricsWriteEstimatedHistogramGetParams { + + return &StorageProxyMetricsWriteEstimatedHistogramGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsWriteEstimatedHistogramGetParamsWithTimeout creates a new StorageProxyMetricsWriteEstimatedHistogramGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsWriteEstimatedHistogramGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsWriteEstimatedHistogramGetParams { + + return &StorageProxyMetricsWriteEstimatedHistogramGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsWriteEstimatedHistogramGetParamsWithContext creates a new StorageProxyMetricsWriteEstimatedHistogramGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsWriteEstimatedHistogramGetParamsWithContext(ctx context.Context) *StorageProxyMetricsWriteEstimatedHistogramGetParams { + + return &StorageProxyMetricsWriteEstimatedHistogramGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsWriteEstimatedHistogramGetParamsWithHTTPClient creates a new StorageProxyMetricsWriteEstimatedHistogramGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsWriteEstimatedHistogramGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsWriteEstimatedHistogramGetParams { + + return &StorageProxyMetricsWriteEstimatedHistogramGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsWriteEstimatedHistogramGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics write estimated histogram get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsWriteEstimatedHistogramGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics write estimated histogram get params +func (o *StorageProxyMetricsWriteEstimatedHistogramGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsWriteEstimatedHistogramGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics write estimated histogram get params +func (o *StorageProxyMetricsWriteEstimatedHistogramGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics write estimated histogram get params +func (o *StorageProxyMetricsWriteEstimatedHistogramGetParams) WithContext(ctx context.Context) *StorageProxyMetricsWriteEstimatedHistogramGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics write estimated histogram get params +func (o *StorageProxyMetricsWriteEstimatedHistogramGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics write estimated histogram get params +func (o *StorageProxyMetricsWriteEstimatedHistogramGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsWriteEstimatedHistogramGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics write estimated histogram get params +func (o *StorageProxyMetricsWriteEstimatedHistogramGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsWriteEstimatedHistogramGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_estimated_histogram_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_estimated_histogram_get_responses.go new file mode 100644 index 0000000000..58e3ea86cd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_estimated_histogram_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsWriteEstimatedHistogramGetReader is a Reader for the StorageProxyMetricsWriteEstimatedHistogramGet structure. +type StorageProxyMetricsWriteEstimatedHistogramGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsWriteEstimatedHistogramGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsWriteEstimatedHistogramGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsWriteEstimatedHistogramGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsWriteEstimatedHistogramGetOK creates a StorageProxyMetricsWriteEstimatedHistogramGetOK with default headers values +func NewStorageProxyMetricsWriteEstimatedHistogramGetOK() *StorageProxyMetricsWriteEstimatedHistogramGetOK { + return &StorageProxyMetricsWriteEstimatedHistogramGetOK{} +} + +/* +StorageProxyMetricsWriteEstimatedHistogramGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsWriteEstimatedHistogramGetOK struct { +} + +func (o *StorageProxyMetricsWriteEstimatedHistogramGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyMetricsWriteEstimatedHistogramGetDefault creates a StorageProxyMetricsWriteEstimatedHistogramGetDefault with default headers values +func NewStorageProxyMetricsWriteEstimatedHistogramGetDefault(code int) *StorageProxyMetricsWriteEstimatedHistogramGetDefault { + return &StorageProxyMetricsWriteEstimatedHistogramGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsWriteEstimatedHistogramGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsWriteEstimatedHistogramGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics write estimated histogram get default response +func (o *StorageProxyMetricsWriteEstimatedHistogramGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsWriteEstimatedHistogramGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsWriteEstimatedHistogramGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsWriteEstimatedHistogramGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_get_parameters.go new file mode 100644 index 0000000000..ad43968248 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsWriteGetParams creates a new StorageProxyMetricsWriteGetParams object +// with the default values initialized. +func NewStorageProxyMetricsWriteGetParams() *StorageProxyMetricsWriteGetParams { + + return &StorageProxyMetricsWriteGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsWriteGetParamsWithTimeout creates a new StorageProxyMetricsWriteGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsWriteGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsWriteGetParams { + + return &StorageProxyMetricsWriteGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsWriteGetParamsWithContext creates a new StorageProxyMetricsWriteGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsWriteGetParamsWithContext(ctx context.Context) *StorageProxyMetricsWriteGetParams { + + return &StorageProxyMetricsWriteGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsWriteGetParamsWithHTTPClient creates a new StorageProxyMetricsWriteGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsWriteGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsWriteGetParams { + + return &StorageProxyMetricsWriteGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsWriteGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics write get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsWriteGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics write get params +func (o *StorageProxyMetricsWriteGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsWriteGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics write get params +func (o *StorageProxyMetricsWriteGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics write get params +func (o *StorageProxyMetricsWriteGetParams) WithContext(ctx context.Context) *StorageProxyMetricsWriteGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics write get params +func (o *StorageProxyMetricsWriteGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics write get params +func (o *StorageProxyMetricsWriteGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsWriteGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics write get params +func (o *StorageProxyMetricsWriteGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsWriteGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_get_responses.go new file mode 100644 index 0000000000..00a0d9c12d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsWriteGetReader is a Reader for the StorageProxyMetricsWriteGet structure. +type StorageProxyMetricsWriteGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsWriteGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsWriteGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsWriteGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsWriteGetOK creates a StorageProxyMetricsWriteGetOK with default headers values +func NewStorageProxyMetricsWriteGetOK() *StorageProxyMetricsWriteGetOK { + return &StorageProxyMetricsWriteGetOK{} +} + +/* +StorageProxyMetricsWriteGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsWriteGetOK struct { + Payload int32 +} + +func (o *StorageProxyMetricsWriteGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyMetricsWriteGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsWriteGetDefault creates a StorageProxyMetricsWriteGetDefault with default headers values +func NewStorageProxyMetricsWriteGetDefault(code int) *StorageProxyMetricsWriteGetDefault { + return &StorageProxyMetricsWriteGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsWriteGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsWriteGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics write get default response +func (o *StorageProxyMetricsWriteGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsWriteGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsWriteGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsWriteGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_histogram_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_histogram_get_parameters.go new file mode 100644 index 0000000000..e4bce2c56b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_histogram_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsWriteHistogramGetParams creates a new StorageProxyMetricsWriteHistogramGetParams object +// with the default values initialized. +func NewStorageProxyMetricsWriteHistogramGetParams() *StorageProxyMetricsWriteHistogramGetParams { + + return &StorageProxyMetricsWriteHistogramGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsWriteHistogramGetParamsWithTimeout creates a new StorageProxyMetricsWriteHistogramGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsWriteHistogramGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsWriteHistogramGetParams { + + return &StorageProxyMetricsWriteHistogramGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsWriteHistogramGetParamsWithContext creates a new StorageProxyMetricsWriteHistogramGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsWriteHistogramGetParamsWithContext(ctx context.Context) *StorageProxyMetricsWriteHistogramGetParams { + + return &StorageProxyMetricsWriteHistogramGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsWriteHistogramGetParamsWithHTTPClient creates a new StorageProxyMetricsWriteHistogramGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsWriteHistogramGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsWriteHistogramGetParams { + + return &StorageProxyMetricsWriteHistogramGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsWriteHistogramGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics write histogram get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsWriteHistogramGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics write histogram get params +func (o *StorageProxyMetricsWriteHistogramGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsWriteHistogramGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics write histogram get params +func (o *StorageProxyMetricsWriteHistogramGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics write histogram get params +func (o *StorageProxyMetricsWriteHistogramGetParams) WithContext(ctx context.Context) *StorageProxyMetricsWriteHistogramGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics write histogram get params +func (o *StorageProxyMetricsWriteHistogramGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics write histogram get params +func (o *StorageProxyMetricsWriteHistogramGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsWriteHistogramGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics write histogram get params +func (o *StorageProxyMetricsWriteHistogramGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsWriteHistogramGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_histogram_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_histogram_get_responses.go new file mode 100644 index 0000000000..f5d32e071d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_histogram_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsWriteHistogramGetReader is a Reader for the StorageProxyMetricsWriteHistogramGet structure. +type StorageProxyMetricsWriteHistogramGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsWriteHistogramGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsWriteHistogramGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsWriteHistogramGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsWriteHistogramGetOK creates a StorageProxyMetricsWriteHistogramGetOK with default headers values +func NewStorageProxyMetricsWriteHistogramGetOK() *StorageProxyMetricsWriteHistogramGetOK { + return &StorageProxyMetricsWriteHistogramGetOK{} +} + +/* +StorageProxyMetricsWriteHistogramGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsWriteHistogramGetOK struct { +} + +func (o *StorageProxyMetricsWriteHistogramGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyMetricsWriteHistogramGetDefault creates a StorageProxyMetricsWriteHistogramGetDefault with default headers values +func NewStorageProxyMetricsWriteHistogramGetDefault(code int) *StorageProxyMetricsWriteHistogramGetDefault { + return &StorageProxyMetricsWriteHistogramGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsWriteHistogramGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsWriteHistogramGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics write histogram get default response +func (o *StorageProxyMetricsWriteHistogramGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsWriteHistogramGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsWriteHistogramGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsWriteHistogramGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_moving_average_histogram_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_moving_average_histogram_get_parameters.go new file mode 100644 index 0000000000..33d5dca1c9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_moving_average_histogram_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsWriteMovingAverageHistogramGetParams creates a new StorageProxyMetricsWriteMovingAverageHistogramGetParams object +// with the default values initialized. +func NewStorageProxyMetricsWriteMovingAverageHistogramGetParams() *StorageProxyMetricsWriteMovingAverageHistogramGetParams { + + return &StorageProxyMetricsWriteMovingAverageHistogramGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsWriteMovingAverageHistogramGetParamsWithTimeout creates a new StorageProxyMetricsWriteMovingAverageHistogramGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsWriteMovingAverageHistogramGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsWriteMovingAverageHistogramGetParams { + + return &StorageProxyMetricsWriteMovingAverageHistogramGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsWriteMovingAverageHistogramGetParamsWithContext creates a new StorageProxyMetricsWriteMovingAverageHistogramGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsWriteMovingAverageHistogramGetParamsWithContext(ctx context.Context) *StorageProxyMetricsWriteMovingAverageHistogramGetParams { + + return &StorageProxyMetricsWriteMovingAverageHistogramGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsWriteMovingAverageHistogramGetParamsWithHTTPClient creates a new StorageProxyMetricsWriteMovingAverageHistogramGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsWriteMovingAverageHistogramGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsWriteMovingAverageHistogramGetParams { + + return &StorageProxyMetricsWriteMovingAverageHistogramGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsWriteMovingAverageHistogramGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics write moving average histogram get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsWriteMovingAverageHistogramGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics write moving average histogram get params +func (o *StorageProxyMetricsWriteMovingAverageHistogramGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsWriteMovingAverageHistogramGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics write moving average histogram get params +func (o *StorageProxyMetricsWriteMovingAverageHistogramGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics write moving average histogram get params +func (o *StorageProxyMetricsWriteMovingAverageHistogramGetParams) WithContext(ctx context.Context) *StorageProxyMetricsWriteMovingAverageHistogramGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics write moving average histogram get params +func (o *StorageProxyMetricsWriteMovingAverageHistogramGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics write moving average histogram get params +func (o *StorageProxyMetricsWriteMovingAverageHistogramGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsWriteMovingAverageHistogramGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics write moving average histogram get params +func (o *StorageProxyMetricsWriteMovingAverageHistogramGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsWriteMovingAverageHistogramGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_moving_average_histogram_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_moving_average_histogram_get_responses.go new file mode 100644 index 0000000000..a81140415d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_moving_average_histogram_get_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsWriteMovingAverageHistogramGetReader is a Reader for the StorageProxyMetricsWriteMovingAverageHistogramGet structure. +type StorageProxyMetricsWriteMovingAverageHistogramGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsWriteMovingAverageHistogramGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsWriteMovingAverageHistogramGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsWriteMovingAverageHistogramGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsWriteMovingAverageHistogramGetOK creates a StorageProxyMetricsWriteMovingAverageHistogramGetOK with default headers values +func NewStorageProxyMetricsWriteMovingAverageHistogramGetOK() *StorageProxyMetricsWriteMovingAverageHistogramGetOK { + return &StorageProxyMetricsWriteMovingAverageHistogramGetOK{} +} + +/* +StorageProxyMetricsWriteMovingAverageHistogramGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsWriteMovingAverageHistogramGetOK struct { +} + +func (o *StorageProxyMetricsWriteMovingAverageHistogramGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyMetricsWriteMovingAverageHistogramGetDefault creates a StorageProxyMetricsWriteMovingAverageHistogramGetDefault with default headers values +func NewStorageProxyMetricsWriteMovingAverageHistogramGetDefault(code int) *StorageProxyMetricsWriteMovingAverageHistogramGetDefault { + return &StorageProxyMetricsWriteMovingAverageHistogramGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsWriteMovingAverageHistogramGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsWriteMovingAverageHistogramGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics write moving average histogram get default response +func (o *StorageProxyMetricsWriteMovingAverageHistogramGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsWriteMovingAverageHistogramGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsWriteMovingAverageHistogramGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsWriteMovingAverageHistogramGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_timeouts_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_timeouts_get_parameters.go new file mode 100644 index 0000000000..dbd3613736 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_timeouts_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsWriteTimeoutsGetParams creates a new StorageProxyMetricsWriteTimeoutsGetParams object +// with the default values initialized. +func NewStorageProxyMetricsWriteTimeoutsGetParams() *StorageProxyMetricsWriteTimeoutsGetParams { + + return &StorageProxyMetricsWriteTimeoutsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsWriteTimeoutsGetParamsWithTimeout creates a new StorageProxyMetricsWriteTimeoutsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsWriteTimeoutsGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsWriteTimeoutsGetParams { + + return &StorageProxyMetricsWriteTimeoutsGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsWriteTimeoutsGetParamsWithContext creates a new StorageProxyMetricsWriteTimeoutsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsWriteTimeoutsGetParamsWithContext(ctx context.Context) *StorageProxyMetricsWriteTimeoutsGetParams { + + return &StorageProxyMetricsWriteTimeoutsGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsWriteTimeoutsGetParamsWithHTTPClient creates a new StorageProxyMetricsWriteTimeoutsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsWriteTimeoutsGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsWriteTimeoutsGetParams { + + return &StorageProxyMetricsWriteTimeoutsGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsWriteTimeoutsGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics write timeouts get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsWriteTimeoutsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics write timeouts get params +func (o *StorageProxyMetricsWriteTimeoutsGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsWriteTimeoutsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics write timeouts get params +func (o *StorageProxyMetricsWriteTimeoutsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics write timeouts get params +func (o *StorageProxyMetricsWriteTimeoutsGetParams) WithContext(ctx context.Context) *StorageProxyMetricsWriteTimeoutsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics write timeouts get params +func (o *StorageProxyMetricsWriteTimeoutsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics write timeouts get params +func (o *StorageProxyMetricsWriteTimeoutsGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsWriteTimeoutsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics write timeouts get params +func (o *StorageProxyMetricsWriteTimeoutsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsWriteTimeoutsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_timeouts_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_timeouts_get_responses.go new file mode 100644 index 0000000000..2840b50892 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_timeouts_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsWriteTimeoutsGetReader is a Reader for the StorageProxyMetricsWriteTimeoutsGet structure. +type StorageProxyMetricsWriteTimeoutsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsWriteTimeoutsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsWriteTimeoutsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsWriteTimeoutsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsWriteTimeoutsGetOK creates a StorageProxyMetricsWriteTimeoutsGetOK with default headers values +func NewStorageProxyMetricsWriteTimeoutsGetOK() *StorageProxyMetricsWriteTimeoutsGetOK { + return &StorageProxyMetricsWriteTimeoutsGetOK{} +} + +/* +StorageProxyMetricsWriteTimeoutsGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsWriteTimeoutsGetOK struct { + Payload int32 +} + +func (o *StorageProxyMetricsWriteTimeoutsGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyMetricsWriteTimeoutsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsWriteTimeoutsGetDefault creates a StorageProxyMetricsWriteTimeoutsGetDefault with default headers values +func NewStorageProxyMetricsWriteTimeoutsGetDefault(code int) *StorageProxyMetricsWriteTimeoutsGetDefault { + return &StorageProxyMetricsWriteTimeoutsGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsWriteTimeoutsGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsWriteTimeoutsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics write timeouts get default response +func (o *StorageProxyMetricsWriteTimeoutsGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsWriteTimeoutsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsWriteTimeoutsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsWriteTimeoutsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_timeouts_rates_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_timeouts_rates_get_parameters.go new file mode 100644 index 0000000000..5fd5df1053 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_timeouts_rates_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsWriteTimeoutsRatesGetParams creates a new StorageProxyMetricsWriteTimeoutsRatesGetParams object +// with the default values initialized. +func NewStorageProxyMetricsWriteTimeoutsRatesGetParams() *StorageProxyMetricsWriteTimeoutsRatesGetParams { + + return &StorageProxyMetricsWriteTimeoutsRatesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsWriteTimeoutsRatesGetParamsWithTimeout creates a new StorageProxyMetricsWriteTimeoutsRatesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsWriteTimeoutsRatesGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsWriteTimeoutsRatesGetParams { + + return &StorageProxyMetricsWriteTimeoutsRatesGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsWriteTimeoutsRatesGetParamsWithContext creates a new StorageProxyMetricsWriteTimeoutsRatesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsWriteTimeoutsRatesGetParamsWithContext(ctx context.Context) *StorageProxyMetricsWriteTimeoutsRatesGetParams { + + return &StorageProxyMetricsWriteTimeoutsRatesGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsWriteTimeoutsRatesGetParamsWithHTTPClient creates a new StorageProxyMetricsWriteTimeoutsRatesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsWriteTimeoutsRatesGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsWriteTimeoutsRatesGetParams { + + return &StorageProxyMetricsWriteTimeoutsRatesGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsWriteTimeoutsRatesGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics write timeouts rates get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsWriteTimeoutsRatesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics write timeouts rates get params +func (o *StorageProxyMetricsWriteTimeoutsRatesGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsWriteTimeoutsRatesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics write timeouts rates get params +func (o *StorageProxyMetricsWriteTimeoutsRatesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics write timeouts rates get params +func (o *StorageProxyMetricsWriteTimeoutsRatesGetParams) WithContext(ctx context.Context) *StorageProxyMetricsWriteTimeoutsRatesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics write timeouts rates get params +func (o *StorageProxyMetricsWriteTimeoutsRatesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics write timeouts rates get params +func (o *StorageProxyMetricsWriteTimeoutsRatesGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsWriteTimeoutsRatesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics write timeouts rates get params +func (o *StorageProxyMetricsWriteTimeoutsRatesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsWriteTimeoutsRatesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_timeouts_rates_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_timeouts_rates_get_responses.go new file mode 100644 index 0000000000..bb5ec880b1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_timeouts_rates_get_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsWriteTimeoutsRatesGetReader is a Reader for the StorageProxyMetricsWriteTimeoutsRatesGet structure. +type StorageProxyMetricsWriteTimeoutsRatesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsWriteTimeoutsRatesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsWriteTimeoutsRatesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsWriteTimeoutsRatesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsWriteTimeoutsRatesGetOK creates a StorageProxyMetricsWriteTimeoutsRatesGetOK with default headers values +func NewStorageProxyMetricsWriteTimeoutsRatesGetOK() *StorageProxyMetricsWriteTimeoutsRatesGetOK { + return &StorageProxyMetricsWriteTimeoutsRatesGetOK{} +} + +/* +StorageProxyMetricsWriteTimeoutsRatesGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsWriteTimeoutsRatesGetOK struct { + Payload *models.RateMovingAverage +} + +func (o *StorageProxyMetricsWriteTimeoutsRatesGetOK) GetPayload() *models.RateMovingAverage { + return o.Payload +} + +func (o *StorageProxyMetricsWriteTimeoutsRatesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RateMovingAverage) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsWriteTimeoutsRatesGetDefault creates a StorageProxyMetricsWriteTimeoutsRatesGetDefault with default headers values +func NewStorageProxyMetricsWriteTimeoutsRatesGetDefault(code int) *StorageProxyMetricsWriteTimeoutsRatesGetDefault { + return &StorageProxyMetricsWriteTimeoutsRatesGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsWriteTimeoutsRatesGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsWriteTimeoutsRatesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics write timeouts rates get default response +func (o *StorageProxyMetricsWriteTimeoutsRatesGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsWriteTimeoutsRatesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsWriteTimeoutsRatesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsWriteTimeoutsRatesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_unavailables_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_unavailables_get_parameters.go new file mode 100644 index 0000000000..189ddbac06 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_unavailables_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsWriteUnavailablesGetParams creates a new StorageProxyMetricsWriteUnavailablesGetParams object +// with the default values initialized. +func NewStorageProxyMetricsWriteUnavailablesGetParams() *StorageProxyMetricsWriteUnavailablesGetParams { + + return &StorageProxyMetricsWriteUnavailablesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsWriteUnavailablesGetParamsWithTimeout creates a new StorageProxyMetricsWriteUnavailablesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsWriteUnavailablesGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsWriteUnavailablesGetParams { + + return &StorageProxyMetricsWriteUnavailablesGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsWriteUnavailablesGetParamsWithContext creates a new StorageProxyMetricsWriteUnavailablesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsWriteUnavailablesGetParamsWithContext(ctx context.Context) *StorageProxyMetricsWriteUnavailablesGetParams { + + return &StorageProxyMetricsWriteUnavailablesGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsWriteUnavailablesGetParamsWithHTTPClient creates a new StorageProxyMetricsWriteUnavailablesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsWriteUnavailablesGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsWriteUnavailablesGetParams { + + return &StorageProxyMetricsWriteUnavailablesGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsWriteUnavailablesGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics write unavailables get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsWriteUnavailablesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics write unavailables get params +func (o *StorageProxyMetricsWriteUnavailablesGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsWriteUnavailablesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics write unavailables get params +func (o *StorageProxyMetricsWriteUnavailablesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics write unavailables get params +func (o *StorageProxyMetricsWriteUnavailablesGetParams) WithContext(ctx context.Context) *StorageProxyMetricsWriteUnavailablesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics write unavailables get params +func (o *StorageProxyMetricsWriteUnavailablesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics write unavailables get params +func (o *StorageProxyMetricsWriteUnavailablesGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsWriteUnavailablesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics write unavailables get params +func (o *StorageProxyMetricsWriteUnavailablesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsWriteUnavailablesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_unavailables_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_unavailables_get_responses.go new file mode 100644 index 0000000000..a66d195130 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_unavailables_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsWriteUnavailablesGetReader is a Reader for the StorageProxyMetricsWriteUnavailablesGet structure. +type StorageProxyMetricsWriteUnavailablesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsWriteUnavailablesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsWriteUnavailablesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsWriteUnavailablesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsWriteUnavailablesGetOK creates a StorageProxyMetricsWriteUnavailablesGetOK with default headers values +func NewStorageProxyMetricsWriteUnavailablesGetOK() *StorageProxyMetricsWriteUnavailablesGetOK { + return &StorageProxyMetricsWriteUnavailablesGetOK{} +} + +/* +StorageProxyMetricsWriteUnavailablesGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsWriteUnavailablesGetOK struct { + Payload int32 +} + +func (o *StorageProxyMetricsWriteUnavailablesGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageProxyMetricsWriteUnavailablesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsWriteUnavailablesGetDefault creates a StorageProxyMetricsWriteUnavailablesGetDefault with default headers values +func NewStorageProxyMetricsWriteUnavailablesGetDefault(code int) *StorageProxyMetricsWriteUnavailablesGetDefault { + return &StorageProxyMetricsWriteUnavailablesGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsWriteUnavailablesGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsWriteUnavailablesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics write unavailables get default response +func (o *StorageProxyMetricsWriteUnavailablesGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsWriteUnavailablesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsWriteUnavailablesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsWriteUnavailablesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_unavailables_rates_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_unavailables_rates_get_parameters.go new file mode 100644 index 0000000000..5bc601c32d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_unavailables_rates_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyMetricsWriteUnavailablesRatesGetParams creates a new StorageProxyMetricsWriteUnavailablesRatesGetParams object +// with the default values initialized. +func NewStorageProxyMetricsWriteUnavailablesRatesGetParams() *StorageProxyMetricsWriteUnavailablesRatesGetParams { + + return &StorageProxyMetricsWriteUnavailablesRatesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyMetricsWriteUnavailablesRatesGetParamsWithTimeout creates a new StorageProxyMetricsWriteUnavailablesRatesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyMetricsWriteUnavailablesRatesGetParamsWithTimeout(timeout time.Duration) *StorageProxyMetricsWriteUnavailablesRatesGetParams { + + return &StorageProxyMetricsWriteUnavailablesRatesGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyMetricsWriteUnavailablesRatesGetParamsWithContext creates a new StorageProxyMetricsWriteUnavailablesRatesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyMetricsWriteUnavailablesRatesGetParamsWithContext(ctx context.Context) *StorageProxyMetricsWriteUnavailablesRatesGetParams { + + return &StorageProxyMetricsWriteUnavailablesRatesGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyMetricsWriteUnavailablesRatesGetParamsWithHTTPClient creates a new StorageProxyMetricsWriteUnavailablesRatesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyMetricsWriteUnavailablesRatesGetParamsWithHTTPClient(client *http.Client) *StorageProxyMetricsWriteUnavailablesRatesGetParams { + + return &StorageProxyMetricsWriteUnavailablesRatesGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyMetricsWriteUnavailablesRatesGetParams contains all the parameters to send to the API endpoint +for the storage proxy metrics write unavailables rates get operation typically these are written to a http.Request +*/ +type StorageProxyMetricsWriteUnavailablesRatesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy metrics write unavailables rates get params +func (o *StorageProxyMetricsWriteUnavailablesRatesGetParams) WithTimeout(timeout time.Duration) *StorageProxyMetricsWriteUnavailablesRatesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy metrics write unavailables rates get params +func (o *StorageProxyMetricsWriteUnavailablesRatesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy metrics write unavailables rates get params +func (o *StorageProxyMetricsWriteUnavailablesRatesGetParams) WithContext(ctx context.Context) *StorageProxyMetricsWriteUnavailablesRatesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy metrics write unavailables rates get params +func (o *StorageProxyMetricsWriteUnavailablesRatesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy metrics write unavailables rates get params +func (o *StorageProxyMetricsWriteUnavailablesRatesGetParams) WithHTTPClient(client *http.Client) *StorageProxyMetricsWriteUnavailablesRatesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy metrics write unavailables rates get params +func (o *StorageProxyMetricsWriteUnavailablesRatesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyMetricsWriteUnavailablesRatesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_unavailables_rates_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_unavailables_rates_get_responses.go new file mode 100644 index 0000000000..2733de277f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_metrics_write_unavailables_rates_get_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyMetricsWriteUnavailablesRatesGetReader is a Reader for the StorageProxyMetricsWriteUnavailablesRatesGet structure. +type StorageProxyMetricsWriteUnavailablesRatesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyMetricsWriteUnavailablesRatesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyMetricsWriteUnavailablesRatesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyMetricsWriteUnavailablesRatesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyMetricsWriteUnavailablesRatesGetOK creates a StorageProxyMetricsWriteUnavailablesRatesGetOK with default headers values +func NewStorageProxyMetricsWriteUnavailablesRatesGetOK() *StorageProxyMetricsWriteUnavailablesRatesGetOK { + return &StorageProxyMetricsWriteUnavailablesRatesGetOK{} +} + +/* +StorageProxyMetricsWriteUnavailablesRatesGetOK handles this case with default header values. + +Success +*/ +type StorageProxyMetricsWriteUnavailablesRatesGetOK struct { + Payload *models.RateMovingAverage +} + +func (o *StorageProxyMetricsWriteUnavailablesRatesGetOK) GetPayload() *models.RateMovingAverage { + return o.Payload +} + +func (o *StorageProxyMetricsWriteUnavailablesRatesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RateMovingAverage) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyMetricsWriteUnavailablesRatesGetDefault creates a StorageProxyMetricsWriteUnavailablesRatesGetDefault with default headers values +func NewStorageProxyMetricsWriteUnavailablesRatesGetDefault(code int) *StorageProxyMetricsWriteUnavailablesRatesGetDefault { + return &StorageProxyMetricsWriteUnavailablesRatesGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyMetricsWriteUnavailablesRatesGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyMetricsWriteUnavailablesRatesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy metrics write unavailables rates get default response +func (o *StorageProxyMetricsWriteUnavailablesRatesGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyMetricsWriteUnavailablesRatesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyMetricsWriteUnavailablesRatesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyMetricsWriteUnavailablesRatesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_range_rpc_timeout_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_range_rpc_timeout_get_parameters.go new file mode 100644 index 0000000000..8145a6f738 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_range_rpc_timeout_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyRangeRPCTimeoutGetParams creates a new StorageProxyRangeRPCTimeoutGetParams object +// with the default values initialized. +func NewStorageProxyRangeRPCTimeoutGetParams() *StorageProxyRangeRPCTimeoutGetParams { + + return &StorageProxyRangeRPCTimeoutGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyRangeRPCTimeoutGetParamsWithTimeout creates a new StorageProxyRangeRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyRangeRPCTimeoutGetParamsWithTimeout(timeout time.Duration) *StorageProxyRangeRPCTimeoutGetParams { + + return &StorageProxyRangeRPCTimeoutGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyRangeRPCTimeoutGetParamsWithContext creates a new StorageProxyRangeRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyRangeRPCTimeoutGetParamsWithContext(ctx context.Context) *StorageProxyRangeRPCTimeoutGetParams { + + return &StorageProxyRangeRPCTimeoutGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyRangeRPCTimeoutGetParamsWithHTTPClient creates a new StorageProxyRangeRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyRangeRPCTimeoutGetParamsWithHTTPClient(client *http.Client) *StorageProxyRangeRPCTimeoutGetParams { + + return &StorageProxyRangeRPCTimeoutGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyRangeRPCTimeoutGetParams contains all the parameters to send to the API endpoint +for the storage proxy range Rpc timeout get operation typically these are written to a http.Request +*/ +type StorageProxyRangeRPCTimeoutGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy range Rpc timeout get params +func (o *StorageProxyRangeRPCTimeoutGetParams) WithTimeout(timeout time.Duration) *StorageProxyRangeRPCTimeoutGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy range Rpc timeout get params +func (o *StorageProxyRangeRPCTimeoutGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy range Rpc timeout get params +func (o *StorageProxyRangeRPCTimeoutGetParams) WithContext(ctx context.Context) *StorageProxyRangeRPCTimeoutGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy range Rpc timeout get params +func (o *StorageProxyRangeRPCTimeoutGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy range Rpc timeout get params +func (o *StorageProxyRangeRPCTimeoutGetParams) WithHTTPClient(client *http.Client) *StorageProxyRangeRPCTimeoutGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy range Rpc timeout get params +func (o *StorageProxyRangeRPCTimeoutGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyRangeRPCTimeoutGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_range_rpc_timeout_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_range_rpc_timeout_get_responses.go new file mode 100644 index 0000000000..305eea738f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_range_rpc_timeout_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyRangeRPCTimeoutGetReader is a Reader for the StorageProxyRangeRPCTimeoutGet structure. +type StorageProxyRangeRPCTimeoutGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyRangeRPCTimeoutGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyRangeRPCTimeoutGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyRangeRPCTimeoutGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyRangeRPCTimeoutGetOK creates a StorageProxyRangeRPCTimeoutGetOK with default headers values +func NewStorageProxyRangeRPCTimeoutGetOK() *StorageProxyRangeRPCTimeoutGetOK { + return &StorageProxyRangeRPCTimeoutGetOK{} +} + +/* +StorageProxyRangeRPCTimeoutGetOK handles this case with default header values. + +Success +*/ +type StorageProxyRangeRPCTimeoutGetOK struct { + Payload interface{} +} + +func (o *StorageProxyRangeRPCTimeoutGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyRangeRPCTimeoutGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyRangeRPCTimeoutGetDefault creates a StorageProxyRangeRPCTimeoutGetDefault with default headers values +func NewStorageProxyRangeRPCTimeoutGetDefault(code int) *StorageProxyRangeRPCTimeoutGetDefault { + return &StorageProxyRangeRPCTimeoutGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyRangeRPCTimeoutGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyRangeRPCTimeoutGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy range Rpc timeout get default response +func (o *StorageProxyRangeRPCTimeoutGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyRangeRPCTimeoutGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyRangeRPCTimeoutGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyRangeRPCTimeoutGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_range_rpc_timeout_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_range_rpc_timeout_post_parameters.go new file mode 100644 index 0000000000..ed5b5e94ee --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_range_rpc_timeout_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyRangeRPCTimeoutPostParams creates a new StorageProxyRangeRPCTimeoutPostParams object +// with the default values initialized. +func NewStorageProxyRangeRPCTimeoutPostParams() *StorageProxyRangeRPCTimeoutPostParams { + var () + return &StorageProxyRangeRPCTimeoutPostParams{ + + requestTimeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyRangeRPCTimeoutPostParamsWithTimeout creates a new StorageProxyRangeRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyRangeRPCTimeoutPostParamsWithTimeout(timeout time.Duration) *StorageProxyRangeRPCTimeoutPostParams { + var () + return &StorageProxyRangeRPCTimeoutPostParams{ + + requestTimeout: timeout, + } +} + +// NewStorageProxyRangeRPCTimeoutPostParamsWithContext creates a new StorageProxyRangeRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyRangeRPCTimeoutPostParamsWithContext(ctx context.Context) *StorageProxyRangeRPCTimeoutPostParams { + var () + return &StorageProxyRangeRPCTimeoutPostParams{ + + Context: ctx, + } +} + +// NewStorageProxyRangeRPCTimeoutPostParamsWithHTTPClient creates a new StorageProxyRangeRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyRangeRPCTimeoutPostParamsWithHTTPClient(client *http.Client) *StorageProxyRangeRPCTimeoutPostParams { + var () + return &StorageProxyRangeRPCTimeoutPostParams{ + HTTPClient: client, + } +} + +/* +StorageProxyRangeRPCTimeoutPostParams contains all the parameters to send to the API endpoint +for the storage proxy range Rpc timeout post operation typically these are written to a http.Request +*/ +type StorageProxyRangeRPCTimeoutPostParams struct { + + /*Timeout + timeout in second + + */ + Timeout string + + requestTimeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithRequestTimeout adds the timeout to the storage proxy range Rpc timeout post params +func (o *StorageProxyRangeRPCTimeoutPostParams) WithRequestTimeout(timeout time.Duration) *StorageProxyRangeRPCTimeoutPostParams { + o.SetRequestTimeout(timeout) + return o +} + +// SetRequestTimeout adds the timeout to the storage proxy range Rpc timeout post params +func (o *StorageProxyRangeRPCTimeoutPostParams) SetRequestTimeout(timeout time.Duration) { + o.requestTimeout = timeout +} + +// WithContext adds the context to the storage proxy range Rpc timeout post params +func (o *StorageProxyRangeRPCTimeoutPostParams) WithContext(ctx context.Context) *StorageProxyRangeRPCTimeoutPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy range Rpc timeout post params +func (o *StorageProxyRangeRPCTimeoutPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy range Rpc timeout post params +func (o *StorageProxyRangeRPCTimeoutPostParams) WithHTTPClient(client *http.Client) *StorageProxyRangeRPCTimeoutPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy range Rpc timeout post params +func (o *StorageProxyRangeRPCTimeoutPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTimeout adds the timeout to the storage proxy range Rpc timeout post params +func (o *StorageProxyRangeRPCTimeoutPostParams) WithTimeout(timeout string) *StorageProxyRangeRPCTimeoutPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy range Rpc timeout post params +func (o *StorageProxyRangeRPCTimeoutPostParams) SetTimeout(timeout string) { + o.Timeout = timeout +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyRangeRPCTimeoutPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.requestTimeout); err != nil { + return err + } + var res []error + + // query param timeout + qrTimeout := o.Timeout + qTimeout := qrTimeout + if qTimeout != "" { + if err := r.SetQueryParam("timeout", qTimeout); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_range_rpc_timeout_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_range_rpc_timeout_post_responses.go new file mode 100644 index 0000000000..c3484daf28 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_range_rpc_timeout_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyRangeRPCTimeoutPostReader is a Reader for the StorageProxyRangeRPCTimeoutPost structure. +type StorageProxyRangeRPCTimeoutPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyRangeRPCTimeoutPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyRangeRPCTimeoutPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyRangeRPCTimeoutPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyRangeRPCTimeoutPostOK creates a StorageProxyRangeRPCTimeoutPostOK with default headers values +func NewStorageProxyRangeRPCTimeoutPostOK() *StorageProxyRangeRPCTimeoutPostOK { + return &StorageProxyRangeRPCTimeoutPostOK{} +} + +/* +StorageProxyRangeRPCTimeoutPostOK handles this case with default header values. + +Success +*/ +type StorageProxyRangeRPCTimeoutPostOK struct { +} + +func (o *StorageProxyRangeRPCTimeoutPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyRangeRPCTimeoutPostDefault creates a StorageProxyRangeRPCTimeoutPostDefault with default headers values +func NewStorageProxyRangeRPCTimeoutPostDefault(code int) *StorageProxyRangeRPCTimeoutPostDefault { + return &StorageProxyRangeRPCTimeoutPostDefault{ + _statusCode: code, + } +} + +/* +StorageProxyRangeRPCTimeoutPostDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyRangeRPCTimeoutPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy range Rpc timeout post default response +func (o *StorageProxyRangeRPCTimeoutPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyRangeRPCTimeoutPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyRangeRPCTimeoutPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyRangeRPCTimeoutPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_attempted_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_attempted_get_parameters.go new file mode 100644 index 0000000000..2cf834f9c7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_attempted_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyReadRepairAttemptedGetParams creates a new StorageProxyReadRepairAttemptedGetParams object +// with the default values initialized. +func NewStorageProxyReadRepairAttemptedGetParams() *StorageProxyReadRepairAttemptedGetParams { + + return &StorageProxyReadRepairAttemptedGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyReadRepairAttemptedGetParamsWithTimeout creates a new StorageProxyReadRepairAttemptedGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyReadRepairAttemptedGetParamsWithTimeout(timeout time.Duration) *StorageProxyReadRepairAttemptedGetParams { + + return &StorageProxyReadRepairAttemptedGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyReadRepairAttemptedGetParamsWithContext creates a new StorageProxyReadRepairAttemptedGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyReadRepairAttemptedGetParamsWithContext(ctx context.Context) *StorageProxyReadRepairAttemptedGetParams { + + return &StorageProxyReadRepairAttemptedGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyReadRepairAttemptedGetParamsWithHTTPClient creates a new StorageProxyReadRepairAttemptedGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyReadRepairAttemptedGetParamsWithHTTPClient(client *http.Client) *StorageProxyReadRepairAttemptedGetParams { + + return &StorageProxyReadRepairAttemptedGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyReadRepairAttemptedGetParams contains all the parameters to send to the API endpoint +for the storage proxy read repair attempted get operation typically these are written to a http.Request +*/ +type StorageProxyReadRepairAttemptedGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy read repair attempted get params +func (o *StorageProxyReadRepairAttemptedGetParams) WithTimeout(timeout time.Duration) *StorageProxyReadRepairAttemptedGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy read repair attempted get params +func (o *StorageProxyReadRepairAttemptedGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy read repair attempted get params +func (o *StorageProxyReadRepairAttemptedGetParams) WithContext(ctx context.Context) *StorageProxyReadRepairAttemptedGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy read repair attempted get params +func (o *StorageProxyReadRepairAttemptedGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy read repair attempted get params +func (o *StorageProxyReadRepairAttemptedGetParams) WithHTTPClient(client *http.Client) *StorageProxyReadRepairAttemptedGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy read repair attempted get params +func (o *StorageProxyReadRepairAttemptedGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyReadRepairAttemptedGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_attempted_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_attempted_get_responses.go new file mode 100644 index 0000000000..11af928e00 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_attempted_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyReadRepairAttemptedGetReader is a Reader for the StorageProxyReadRepairAttemptedGet structure. +type StorageProxyReadRepairAttemptedGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyReadRepairAttemptedGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyReadRepairAttemptedGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyReadRepairAttemptedGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyReadRepairAttemptedGetOK creates a StorageProxyReadRepairAttemptedGetOK with default headers values +func NewStorageProxyReadRepairAttemptedGetOK() *StorageProxyReadRepairAttemptedGetOK { + return &StorageProxyReadRepairAttemptedGetOK{} +} + +/* +StorageProxyReadRepairAttemptedGetOK handles this case with default header values. + +Success +*/ +type StorageProxyReadRepairAttemptedGetOK struct { + Payload interface{} +} + +func (o *StorageProxyReadRepairAttemptedGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyReadRepairAttemptedGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyReadRepairAttemptedGetDefault creates a StorageProxyReadRepairAttemptedGetDefault with default headers values +func NewStorageProxyReadRepairAttemptedGetDefault(code int) *StorageProxyReadRepairAttemptedGetDefault { + return &StorageProxyReadRepairAttemptedGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyReadRepairAttemptedGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyReadRepairAttemptedGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy read repair attempted get default response +func (o *StorageProxyReadRepairAttemptedGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyReadRepairAttemptedGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyReadRepairAttemptedGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyReadRepairAttemptedGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_repaired_background_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_repaired_background_get_parameters.go new file mode 100644 index 0000000000..00aa5841c6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_repaired_background_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyReadRepairRepairedBackgroundGetParams creates a new StorageProxyReadRepairRepairedBackgroundGetParams object +// with the default values initialized. +func NewStorageProxyReadRepairRepairedBackgroundGetParams() *StorageProxyReadRepairRepairedBackgroundGetParams { + + return &StorageProxyReadRepairRepairedBackgroundGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyReadRepairRepairedBackgroundGetParamsWithTimeout creates a new StorageProxyReadRepairRepairedBackgroundGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyReadRepairRepairedBackgroundGetParamsWithTimeout(timeout time.Duration) *StorageProxyReadRepairRepairedBackgroundGetParams { + + return &StorageProxyReadRepairRepairedBackgroundGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyReadRepairRepairedBackgroundGetParamsWithContext creates a new StorageProxyReadRepairRepairedBackgroundGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyReadRepairRepairedBackgroundGetParamsWithContext(ctx context.Context) *StorageProxyReadRepairRepairedBackgroundGetParams { + + return &StorageProxyReadRepairRepairedBackgroundGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyReadRepairRepairedBackgroundGetParamsWithHTTPClient creates a new StorageProxyReadRepairRepairedBackgroundGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyReadRepairRepairedBackgroundGetParamsWithHTTPClient(client *http.Client) *StorageProxyReadRepairRepairedBackgroundGetParams { + + return &StorageProxyReadRepairRepairedBackgroundGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyReadRepairRepairedBackgroundGetParams contains all the parameters to send to the API endpoint +for the storage proxy read repair repaired background get operation typically these are written to a http.Request +*/ +type StorageProxyReadRepairRepairedBackgroundGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy read repair repaired background get params +func (o *StorageProxyReadRepairRepairedBackgroundGetParams) WithTimeout(timeout time.Duration) *StorageProxyReadRepairRepairedBackgroundGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy read repair repaired background get params +func (o *StorageProxyReadRepairRepairedBackgroundGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy read repair repaired background get params +func (o *StorageProxyReadRepairRepairedBackgroundGetParams) WithContext(ctx context.Context) *StorageProxyReadRepairRepairedBackgroundGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy read repair repaired background get params +func (o *StorageProxyReadRepairRepairedBackgroundGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy read repair repaired background get params +func (o *StorageProxyReadRepairRepairedBackgroundGetParams) WithHTTPClient(client *http.Client) *StorageProxyReadRepairRepairedBackgroundGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy read repair repaired background get params +func (o *StorageProxyReadRepairRepairedBackgroundGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyReadRepairRepairedBackgroundGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_repaired_background_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_repaired_background_get_responses.go new file mode 100644 index 0000000000..d765b560b3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_repaired_background_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyReadRepairRepairedBackgroundGetReader is a Reader for the StorageProxyReadRepairRepairedBackgroundGet structure. +type StorageProxyReadRepairRepairedBackgroundGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyReadRepairRepairedBackgroundGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyReadRepairRepairedBackgroundGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyReadRepairRepairedBackgroundGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyReadRepairRepairedBackgroundGetOK creates a StorageProxyReadRepairRepairedBackgroundGetOK with default headers values +func NewStorageProxyReadRepairRepairedBackgroundGetOK() *StorageProxyReadRepairRepairedBackgroundGetOK { + return &StorageProxyReadRepairRepairedBackgroundGetOK{} +} + +/* +StorageProxyReadRepairRepairedBackgroundGetOK handles this case with default header values. + +Success +*/ +type StorageProxyReadRepairRepairedBackgroundGetOK struct { + Payload interface{} +} + +func (o *StorageProxyReadRepairRepairedBackgroundGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyReadRepairRepairedBackgroundGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyReadRepairRepairedBackgroundGetDefault creates a StorageProxyReadRepairRepairedBackgroundGetDefault with default headers values +func NewStorageProxyReadRepairRepairedBackgroundGetDefault(code int) *StorageProxyReadRepairRepairedBackgroundGetDefault { + return &StorageProxyReadRepairRepairedBackgroundGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyReadRepairRepairedBackgroundGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyReadRepairRepairedBackgroundGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy read repair repaired background get default response +func (o *StorageProxyReadRepairRepairedBackgroundGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyReadRepairRepairedBackgroundGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyReadRepairRepairedBackgroundGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyReadRepairRepairedBackgroundGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_repaired_blocking_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_repaired_blocking_get_parameters.go new file mode 100644 index 0000000000..7807056b19 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_repaired_blocking_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyReadRepairRepairedBlockingGetParams creates a new StorageProxyReadRepairRepairedBlockingGetParams object +// with the default values initialized. +func NewStorageProxyReadRepairRepairedBlockingGetParams() *StorageProxyReadRepairRepairedBlockingGetParams { + + return &StorageProxyReadRepairRepairedBlockingGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyReadRepairRepairedBlockingGetParamsWithTimeout creates a new StorageProxyReadRepairRepairedBlockingGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyReadRepairRepairedBlockingGetParamsWithTimeout(timeout time.Duration) *StorageProxyReadRepairRepairedBlockingGetParams { + + return &StorageProxyReadRepairRepairedBlockingGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyReadRepairRepairedBlockingGetParamsWithContext creates a new StorageProxyReadRepairRepairedBlockingGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyReadRepairRepairedBlockingGetParamsWithContext(ctx context.Context) *StorageProxyReadRepairRepairedBlockingGetParams { + + return &StorageProxyReadRepairRepairedBlockingGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyReadRepairRepairedBlockingGetParamsWithHTTPClient creates a new StorageProxyReadRepairRepairedBlockingGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyReadRepairRepairedBlockingGetParamsWithHTTPClient(client *http.Client) *StorageProxyReadRepairRepairedBlockingGetParams { + + return &StorageProxyReadRepairRepairedBlockingGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyReadRepairRepairedBlockingGetParams contains all the parameters to send to the API endpoint +for the storage proxy read repair repaired blocking get operation typically these are written to a http.Request +*/ +type StorageProxyReadRepairRepairedBlockingGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy read repair repaired blocking get params +func (o *StorageProxyReadRepairRepairedBlockingGetParams) WithTimeout(timeout time.Duration) *StorageProxyReadRepairRepairedBlockingGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy read repair repaired blocking get params +func (o *StorageProxyReadRepairRepairedBlockingGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy read repair repaired blocking get params +func (o *StorageProxyReadRepairRepairedBlockingGetParams) WithContext(ctx context.Context) *StorageProxyReadRepairRepairedBlockingGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy read repair repaired blocking get params +func (o *StorageProxyReadRepairRepairedBlockingGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy read repair repaired blocking get params +func (o *StorageProxyReadRepairRepairedBlockingGetParams) WithHTTPClient(client *http.Client) *StorageProxyReadRepairRepairedBlockingGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy read repair repaired blocking get params +func (o *StorageProxyReadRepairRepairedBlockingGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyReadRepairRepairedBlockingGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_repaired_blocking_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_repaired_blocking_get_responses.go new file mode 100644 index 0000000000..a5abab9545 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_repair_repaired_blocking_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyReadRepairRepairedBlockingGetReader is a Reader for the StorageProxyReadRepairRepairedBlockingGet structure. +type StorageProxyReadRepairRepairedBlockingGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyReadRepairRepairedBlockingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyReadRepairRepairedBlockingGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyReadRepairRepairedBlockingGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyReadRepairRepairedBlockingGetOK creates a StorageProxyReadRepairRepairedBlockingGetOK with default headers values +func NewStorageProxyReadRepairRepairedBlockingGetOK() *StorageProxyReadRepairRepairedBlockingGetOK { + return &StorageProxyReadRepairRepairedBlockingGetOK{} +} + +/* +StorageProxyReadRepairRepairedBlockingGetOK handles this case with default header values. + +Success +*/ +type StorageProxyReadRepairRepairedBlockingGetOK struct { + Payload interface{} +} + +func (o *StorageProxyReadRepairRepairedBlockingGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyReadRepairRepairedBlockingGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyReadRepairRepairedBlockingGetDefault creates a StorageProxyReadRepairRepairedBlockingGetDefault with default headers values +func NewStorageProxyReadRepairRepairedBlockingGetDefault(code int) *StorageProxyReadRepairRepairedBlockingGetDefault { + return &StorageProxyReadRepairRepairedBlockingGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyReadRepairRepairedBlockingGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyReadRepairRepairedBlockingGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy read repair repaired blocking get default response +func (o *StorageProxyReadRepairRepairedBlockingGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyReadRepairRepairedBlockingGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyReadRepairRepairedBlockingGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyReadRepairRepairedBlockingGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_rpc_timeout_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_rpc_timeout_get_parameters.go new file mode 100644 index 0000000000..9076ce5db2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_rpc_timeout_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyReadRPCTimeoutGetParams creates a new StorageProxyReadRPCTimeoutGetParams object +// with the default values initialized. +func NewStorageProxyReadRPCTimeoutGetParams() *StorageProxyReadRPCTimeoutGetParams { + + return &StorageProxyReadRPCTimeoutGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyReadRPCTimeoutGetParamsWithTimeout creates a new StorageProxyReadRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyReadRPCTimeoutGetParamsWithTimeout(timeout time.Duration) *StorageProxyReadRPCTimeoutGetParams { + + return &StorageProxyReadRPCTimeoutGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyReadRPCTimeoutGetParamsWithContext creates a new StorageProxyReadRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyReadRPCTimeoutGetParamsWithContext(ctx context.Context) *StorageProxyReadRPCTimeoutGetParams { + + return &StorageProxyReadRPCTimeoutGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyReadRPCTimeoutGetParamsWithHTTPClient creates a new StorageProxyReadRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyReadRPCTimeoutGetParamsWithHTTPClient(client *http.Client) *StorageProxyReadRPCTimeoutGetParams { + + return &StorageProxyReadRPCTimeoutGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyReadRPCTimeoutGetParams contains all the parameters to send to the API endpoint +for the storage proxy read Rpc timeout get operation typically these are written to a http.Request +*/ +type StorageProxyReadRPCTimeoutGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy read Rpc timeout get params +func (o *StorageProxyReadRPCTimeoutGetParams) WithTimeout(timeout time.Duration) *StorageProxyReadRPCTimeoutGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy read Rpc timeout get params +func (o *StorageProxyReadRPCTimeoutGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy read Rpc timeout get params +func (o *StorageProxyReadRPCTimeoutGetParams) WithContext(ctx context.Context) *StorageProxyReadRPCTimeoutGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy read Rpc timeout get params +func (o *StorageProxyReadRPCTimeoutGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy read Rpc timeout get params +func (o *StorageProxyReadRPCTimeoutGetParams) WithHTTPClient(client *http.Client) *StorageProxyReadRPCTimeoutGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy read Rpc timeout get params +func (o *StorageProxyReadRPCTimeoutGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyReadRPCTimeoutGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_rpc_timeout_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_rpc_timeout_get_responses.go new file mode 100644 index 0000000000..62a0058144 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_rpc_timeout_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyReadRPCTimeoutGetReader is a Reader for the StorageProxyReadRPCTimeoutGet structure. +type StorageProxyReadRPCTimeoutGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyReadRPCTimeoutGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyReadRPCTimeoutGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyReadRPCTimeoutGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyReadRPCTimeoutGetOK creates a StorageProxyReadRPCTimeoutGetOK with default headers values +func NewStorageProxyReadRPCTimeoutGetOK() *StorageProxyReadRPCTimeoutGetOK { + return &StorageProxyReadRPCTimeoutGetOK{} +} + +/* +StorageProxyReadRPCTimeoutGetOK handles this case with default header values. + +Success +*/ +type StorageProxyReadRPCTimeoutGetOK struct { + Payload interface{} +} + +func (o *StorageProxyReadRPCTimeoutGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyReadRPCTimeoutGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyReadRPCTimeoutGetDefault creates a StorageProxyReadRPCTimeoutGetDefault with default headers values +func NewStorageProxyReadRPCTimeoutGetDefault(code int) *StorageProxyReadRPCTimeoutGetDefault { + return &StorageProxyReadRPCTimeoutGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyReadRPCTimeoutGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyReadRPCTimeoutGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy read Rpc timeout get default response +func (o *StorageProxyReadRPCTimeoutGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyReadRPCTimeoutGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyReadRPCTimeoutGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyReadRPCTimeoutGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_rpc_timeout_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_rpc_timeout_post_parameters.go new file mode 100644 index 0000000000..d48fbaf544 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_rpc_timeout_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyReadRPCTimeoutPostParams creates a new StorageProxyReadRPCTimeoutPostParams object +// with the default values initialized. +func NewStorageProxyReadRPCTimeoutPostParams() *StorageProxyReadRPCTimeoutPostParams { + var () + return &StorageProxyReadRPCTimeoutPostParams{ + + requestTimeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyReadRPCTimeoutPostParamsWithTimeout creates a new StorageProxyReadRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyReadRPCTimeoutPostParamsWithTimeout(timeout time.Duration) *StorageProxyReadRPCTimeoutPostParams { + var () + return &StorageProxyReadRPCTimeoutPostParams{ + + requestTimeout: timeout, + } +} + +// NewStorageProxyReadRPCTimeoutPostParamsWithContext creates a new StorageProxyReadRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyReadRPCTimeoutPostParamsWithContext(ctx context.Context) *StorageProxyReadRPCTimeoutPostParams { + var () + return &StorageProxyReadRPCTimeoutPostParams{ + + Context: ctx, + } +} + +// NewStorageProxyReadRPCTimeoutPostParamsWithHTTPClient creates a new StorageProxyReadRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyReadRPCTimeoutPostParamsWithHTTPClient(client *http.Client) *StorageProxyReadRPCTimeoutPostParams { + var () + return &StorageProxyReadRPCTimeoutPostParams{ + HTTPClient: client, + } +} + +/* +StorageProxyReadRPCTimeoutPostParams contains all the parameters to send to the API endpoint +for the storage proxy read Rpc timeout post operation typically these are written to a http.Request +*/ +type StorageProxyReadRPCTimeoutPostParams struct { + + /*Timeout + The timeout in second + + */ + Timeout string + + requestTimeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithRequestTimeout adds the timeout to the storage proxy read Rpc timeout post params +func (o *StorageProxyReadRPCTimeoutPostParams) WithRequestTimeout(timeout time.Duration) *StorageProxyReadRPCTimeoutPostParams { + o.SetRequestTimeout(timeout) + return o +} + +// SetRequestTimeout adds the timeout to the storage proxy read Rpc timeout post params +func (o *StorageProxyReadRPCTimeoutPostParams) SetRequestTimeout(timeout time.Duration) { + o.requestTimeout = timeout +} + +// WithContext adds the context to the storage proxy read Rpc timeout post params +func (o *StorageProxyReadRPCTimeoutPostParams) WithContext(ctx context.Context) *StorageProxyReadRPCTimeoutPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy read Rpc timeout post params +func (o *StorageProxyReadRPCTimeoutPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy read Rpc timeout post params +func (o *StorageProxyReadRPCTimeoutPostParams) WithHTTPClient(client *http.Client) *StorageProxyReadRPCTimeoutPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy read Rpc timeout post params +func (o *StorageProxyReadRPCTimeoutPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTimeout adds the timeout to the storage proxy read Rpc timeout post params +func (o *StorageProxyReadRPCTimeoutPostParams) WithTimeout(timeout string) *StorageProxyReadRPCTimeoutPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy read Rpc timeout post params +func (o *StorageProxyReadRPCTimeoutPostParams) SetTimeout(timeout string) { + o.Timeout = timeout +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyReadRPCTimeoutPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.requestTimeout); err != nil { + return err + } + var res []error + + // query param timeout + qrTimeout := o.Timeout + qTimeout := qrTimeout + if qTimeout != "" { + if err := r.SetQueryParam("timeout", qTimeout); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_rpc_timeout_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_rpc_timeout_post_responses.go new file mode 100644 index 0000000000..31995bfc23 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_read_rpc_timeout_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyReadRPCTimeoutPostReader is a Reader for the StorageProxyReadRPCTimeoutPost structure. +type StorageProxyReadRPCTimeoutPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyReadRPCTimeoutPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyReadRPCTimeoutPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyReadRPCTimeoutPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyReadRPCTimeoutPostOK creates a StorageProxyReadRPCTimeoutPostOK with default headers values +func NewStorageProxyReadRPCTimeoutPostOK() *StorageProxyReadRPCTimeoutPostOK { + return &StorageProxyReadRPCTimeoutPostOK{} +} + +/* +StorageProxyReadRPCTimeoutPostOK handles this case with default header values. + +Success +*/ +type StorageProxyReadRPCTimeoutPostOK struct { +} + +func (o *StorageProxyReadRPCTimeoutPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyReadRPCTimeoutPostDefault creates a StorageProxyReadRPCTimeoutPostDefault with default headers values +func NewStorageProxyReadRPCTimeoutPostDefault(code int) *StorageProxyReadRPCTimeoutPostDefault { + return &StorageProxyReadRPCTimeoutPostDefault{ + _statusCode: code, + } +} + +/* +StorageProxyReadRPCTimeoutPostDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyReadRPCTimeoutPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy read Rpc timeout post default response +func (o *StorageProxyReadRPCTimeoutPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyReadRPCTimeoutPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyReadRPCTimeoutPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyReadRPCTimeoutPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_reload_trigger_classes_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_reload_trigger_classes_post_parameters.go new file mode 100644 index 0000000000..eb3a1ac5b9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_reload_trigger_classes_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyReloadTriggerClassesPostParams creates a new StorageProxyReloadTriggerClassesPostParams object +// with the default values initialized. +func NewStorageProxyReloadTriggerClassesPostParams() *StorageProxyReloadTriggerClassesPostParams { + + return &StorageProxyReloadTriggerClassesPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyReloadTriggerClassesPostParamsWithTimeout creates a new StorageProxyReloadTriggerClassesPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyReloadTriggerClassesPostParamsWithTimeout(timeout time.Duration) *StorageProxyReloadTriggerClassesPostParams { + + return &StorageProxyReloadTriggerClassesPostParams{ + + timeout: timeout, + } +} + +// NewStorageProxyReloadTriggerClassesPostParamsWithContext creates a new StorageProxyReloadTriggerClassesPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyReloadTriggerClassesPostParamsWithContext(ctx context.Context) *StorageProxyReloadTriggerClassesPostParams { + + return &StorageProxyReloadTriggerClassesPostParams{ + + Context: ctx, + } +} + +// NewStorageProxyReloadTriggerClassesPostParamsWithHTTPClient creates a new StorageProxyReloadTriggerClassesPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyReloadTriggerClassesPostParamsWithHTTPClient(client *http.Client) *StorageProxyReloadTriggerClassesPostParams { + + return &StorageProxyReloadTriggerClassesPostParams{ + HTTPClient: client, + } +} + +/* +StorageProxyReloadTriggerClassesPostParams contains all the parameters to send to the API endpoint +for the storage proxy reload trigger classes post operation typically these are written to a http.Request +*/ +type StorageProxyReloadTriggerClassesPostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy reload trigger classes post params +func (o *StorageProxyReloadTriggerClassesPostParams) WithTimeout(timeout time.Duration) *StorageProxyReloadTriggerClassesPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy reload trigger classes post params +func (o *StorageProxyReloadTriggerClassesPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy reload trigger classes post params +func (o *StorageProxyReloadTriggerClassesPostParams) WithContext(ctx context.Context) *StorageProxyReloadTriggerClassesPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy reload trigger classes post params +func (o *StorageProxyReloadTriggerClassesPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy reload trigger classes post params +func (o *StorageProxyReloadTriggerClassesPostParams) WithHTTPClient(client *http.Client) *StorageProxyReloadTriggerClassesPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy reload trigger classes post params +func (o *StorageProxyReloadTriggerClassesPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyReloadTriggerClassesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_reload_trigger_classes_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_reload_trigger_classes_post_responses.go new file mode 100644 index 0000000000..3b979ad9fa --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_reload_trigger_classes_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyReloadTriggerClassesPostReader is a Reader for the StorageProxyReloadTriggerClassesPost structure. +type StorageProxyReloadTriggerClassesPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyReloadTriggerClassesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyReloadTriggerClassesPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyReloadTriggerClassesPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyReloadTriggerClassesPostOK creates a StorageProxyReloadTriggerClassesPostOK with default headers values +func NewStorageProxyReloadTriggerClassesPostOK() *StorageProxyReloadTriggerClassesPostOK { + return &StorageProxyReloadTriggerClassesPostOK{} +} + +/* +StorageProxyReloadTriggerClassesPostOK handles this case with default header values. + +Success +*/ +type StorageProxyReloadTriggerClassesPostOK struct { +} + +func (o *StorageProxyReloadTriggerClassesPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyReloadTriggerClassesPostDefault creates a StorageProxyReloadTriggerClassesPostDefault with default headers values +func NewStorageProxyReloadTriggerClassesPostDefault(code int) *StorageProxyReloadTriggerClassesPostDefault { + return &StorageProxyReloadTriggerClassesPostDefault{ + _statusCode: code, + } +} + +/* +StorageProxyReloadTriggerClassesPostDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyReloadTriggerClassesPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy reload trigger classes post default response +func (o *StorageProxyReloadTriggerClassesPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyReloadTriggerClassesPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyReloadTriggerClassesPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyReloadTriggerClassesPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_rpc_timeout_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_rpc_timeout_get_parameters.go new file mode 100644 index 0000000000..1976204116 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_rpc_timeout_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyRPCTimeoutGetParams creates a new StorageProxyRPCTimeoutGetParams object +// with the default values initialized. +func NewStorageProxyRPCTimeoutGetParams() *StorageProxyRPCTimeoutGetParams { + + return &StorageProxyRPCTimeoutGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyRPCTimeoutGetParamsWithTimeout creates a new StorageProxyRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyRPCTimeoutGetParamsWithTimeout(timeout time.Duration) *StorageProxyRPCTimeoutGetParams { + + return &StorageProxyRPCTimeoutGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyRPCTimeoutGetParamsWithContext creates a new StorageProxyRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyRPCTimeoutGetParamsWithContext(ctx context.Context) *StorageProxyRPCTimeoutGetParams { + + return &StorageProxyRPCTimeoutGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyRPCTimeoutGetParamsWithHTTPClient creates a new StorageProxyRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyRPCTimeoutGetParamsWithHTTPClient(client *http.Client) *StorageProxyRPCTimeoutGetParams { + + return &StorageProxyRPCTimeoutGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyRPCTimeoutGetParams contains all the parameters to send to the API endpoint +for the storage proxy Rpc timeout get operation typically these are written to a http.Request +*/ +type StorageProxyRPCTimeoutGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy Rpc timeout get params +func (o *StorageProxyRPCTimeoutGetParams) WithTimeout(timeout time.Duration) *StorageProxyRPCTimeoutGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy Rpc timeout get params +func (o *StorageProxyRPCTimeoutGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy Rpc timeout get params +func (o *StorageProxyRPCTimeoutGetParams) WithContext(ctx context.Context) *StorageProxyRPCTimeoutGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy Rpc timeout get params +func (o *StorageProxyRPCTimeoutGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy Rpc timeout get params +func (o *StorageProxyRPCTimeoutGetParams) WithHTTPClient(client *http.Client) *StorageProxyRPCTimeoutGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy Rpc timeout get params +func (o *StorageProxyRPCTimeoutGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyRPCTimeoutGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_rpc_timeout_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_rpc_timeout_get_responses.go new file mode 100644 index 0000000000..0c48c10af5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_rpc_timeout_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyRPCTimeoutGetReader is a Reader for the StorageProxyRPCTimeoutGet structure. +type StorageProxyRPCTimeoutGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyRPCTimeoutGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyRPCTimeoutGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyRPCTimeoutGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyRPCTimeoutGetOK creates a StorageProxyRPCTimeoutGetOK with default headers values +func NewStorageProxyRPCTimeoutGetOK() *StorageProxyRPCTimeoutGetOK { + return &StorageProxyRPCTimeoutGetOK{} +} + +/* +StorageProxyRPCTimeoutGetOK handles this case with default header values. + +Success +*/ +type StorageProxyRPCTimeoutGetOK struct { + Payload interface{} +} + +func (o *StorageProxyRPCTimeoutGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyRPCTimeoutGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyRPCTimeoutGetDefault creates a StorageProxyRPCTimeoutGetDefault with default headers values +func NewStorageProxyRPCTimeoutGetDefault(code int) *StorageProxyRPCTimeoutGetDefault { + return &StorageProxyRPCTimeoutGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyRPCTimeoutGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyRPCTimeoutGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy Rpc timeout get default response +func (o *StorageProxyRPCTimeoutGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyRPCTimeoutGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyRPCTimeoutGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyRPCTimeoutGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_rpc_timeout_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_rpc_timeout_post_parameters.go new file mode 100644 index 0000000000..0f0556a7ba --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_rpc_timeout_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyRPCTimeoutPostParams creates a new StorageProxyRPCTimeoutPostParams object +// with the default values initialized. +func NewStorageProxyRPCTimeoutPostParams() *StorageProxyRPCTimeoutPostParams { + var () + return &StorageProxyRPCTimeoutPostParams{ + + requestTimeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyRPCTimeoutPostParamsWithTimeout creates a new StorageProxyRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyRPCTimeoutPostParamsWithTimeout(timeout time.Duration) *StorageProxyRPCTimeoutPostParams { + var () + return &StorageProxyRPCTimeoutPostParams{ + + requestTimeout: timeout, + } +} + +// NewStorageProxyRPCTimeoutPostParamsWithContext creates a new StorageProxyRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyRPCTimeoutPostParamsWithContext(ctx context.Context) *StorageProxyRPCTimeoutPostParams { + var () + return &StorageProxyRPCTimeoutPostParams{ + + Context: ctx, + } +} + +// NewStorageProxyRPCTimeoutPostParamsWithHTTPClient creates a new StorageProxyRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyRPCTimeoutPostParamsWithHTTPClient(client *http.Client) *StorageProxyRPCTimeoutPostParams { + var () + return &StorageProxyRPCTimeoutPostParams{ + HTTPClient: client, + } +} + +/* +StorageProxyRPCTimeoutPostParams contains all the parameters to send to the API endpoint +for the storage proxy Rpc timeout post operation typically these are written to a http.Request +*/ +type StorageProxyRPCTimeoutPostParams struct { + + /*Timeout + Timeout in seconds + + */ + Timeout string + + requestTimeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithRequestTimeout adds the timeout to the storage proxy Rpc timeout post params +func (o *StorageProxyRPCTimeoutPostParams) WithRequestTimeout(timeout time.Duration) *StorageProxyRPCTimeoutPostParams { + o.SetRequestTimeout(timeout) + return o +} + +// SetRequestTimeout adds the timeout to the storage proxy Rpc timeout post params +func (o *StorageProxyRPCTimeoutPostParams) SetRequestTimeout(timeout time.Duration) { + o.requestTimeout = timeout +} + +// WithContext adds the context to the storage proxy Rpc timeout post params +func (o *StorageProxyRPCTimeoutPostParams) WithContext(ctx context.Context) *StorageProxyRPCTimeoutPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy Rpc timeout post params +func (o *StorageProxyRPCTimeoutPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy Rpc timeout post params +func (o *StorageProxyRPCTimeoutPostParams) WithHTTPClient(client *http.Client) *StorageProxyRPCTimeoutPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy Rpc timeout post params +func (o *StorageProxyRPCTimeoutPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTimeout adds the timeout to the storage proxy Rpc timeout post params +func (o *StorageProxyRPCTimeoutPostParams) WithTimeout(timeout string) *StorageProxyRPCTimeoutPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy Rpc timeout post params +func (o *StorageProxyRPCTimeoutPostParams) SetTimeout(timeout string) { + o.Timeout = timeout +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyRPCTimeoutPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.requestTimeout); err != nil { + return err + } + var res []error + + // query param timeout + qrTimeout := o.Timeout + qTimeout := qrTimeout + if qTimeout != "" { + if err := r.SetQueryParam("timeout", qTimeout); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_rpc_timeout_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_rpc_timeout_post_responses.go new file mode 100644 index 0000000000..9c3a6b7416 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_rpc_timeout_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyRPCTimeoutPostReader is a Reader for the StorageProxyRPCTimeoutPost structure. +type StorageProxyRPCTimeoutPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyRPCTimeoutPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyRPCTimeoutPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyRPCTimeoutPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyRPCTimeoutPostOK creates a StorageProxyRPCTimeoutPostOK with default headers values +func NewStorageProxyRPCTimeoutPostOK() *StorageProxyRPCTimeoutPostOK { + return &StorageProxyRPCTimeoutPostOK{} +} + +/* +StorageProxyRPCTimeoutPostOK handles this case with default header values. + +Success +*/ +type StorageProxyRPCTimeoutPostOK struct { +} + +func (o *StorageProxyRPCTimeoutPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyRPCTimeoutPostDefault creates a StorageProxyRPCTimeoutPostDefault with default headers values +func NewStorageProxyRPCTimeoutPostDefault(code int) *StorageProxyRPCTimeoutPostDefault { + return &StorageProxyRPCTimeoutPostDefault{ + _statusCode: code, + } +} + +/* +StorageProxyRPCTimeoutPostDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyRPCTimeoutPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy Rpc timeout post default response +func (o *StorageProxyRPCTimeoutPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyRPCTimeoutPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyRPCTimeoutPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyRPCTimeoutPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_schema_versions_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_schema_versions_get_parameters.go new file mode 100644 index 0000000000..b238c7adbf --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_schema_versions_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxySchemaVersionsGetParams creates a new StorageProxySchemaVersionsGetParams object +// with the default values initialized. +func NewStorageProxySchemaVersionsGetParams() *StorageProxySchemaVersionsGetParams { + + return &StorageProxySchemaVersionsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxySchemaVersionsGetParamsWithTimeout creates a new StorageProxySchemaVersionsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxySchemaVersionsGetParamsWithTimeout(timeout time.Duration) *StorageProxySchemaVersionsGetParams { + + return &StorageProxySchemaVersionsGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxySchemaVersionsGetParamsWithContext creates a new StorageProxySchemaVersionsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxySchemaVersionsGetParamsWithContext(ctx context.Context) *StorageProxySchemaVersionsGetParams { + + return &StorageProxySchemaVersionsGetParams{ + + Context: ctx, + } +} + +// NewStorageProxySchemaVersionsGetParamsWithHTTPClient creates a new StorageProxySchemaVersionsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxySchemaVersionsGetParamsWithHTTPClient(client *http.Client) *StorageProxySchemaVersionsGetParams { + + return &StorageProxySchemaVersionsGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxySchemaVersionsGetParams contains all the parameters to send to the API endpoint +for the storage proxy schema versions get operation typically these are written to a http.Request +*/ +type StorageProxySchemaVersionsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy schema versions get params +func (o *StorageProxySchemaVersionsGetParams) WithTimeout(timeout time.Duration) *StorageProxySchemaVersionsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy schema versions get params +func (o *StorageProxySchemaVersionsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy schema versions get params +func (o *StorageProxySchemaVersionsGetParams) WithContext(ctx context.Context) *StorageProxySchemaVersionsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy schema versions get params +func (o *StorageProxySchemaVersionsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy schema versions get params +func (o *StorageProxySchemaVersionsGetParams) WithHTTPClient(client *http.Client) *StorageProxySchemaVersionsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy schema versions get params +func (o *StorageProxySchemaVersionsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxySchemaVersionsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_schema_versions_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_schema_versions_get_responses.go new file mode 100644 index 0000000000..640f4d7d8d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_schema_versions_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxySchemaVersionsGetReader is a Reader for the StorageProxySchemaVersionsGet structure. +type StorageProxySchemaVersionsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxySchemaVersionsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxySchemaVersionsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxySchemaVersionsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxySchemaVersionsGetOK creates a StorageProxySchemaVersionsGetOK with default headers values +func NewStorageProxySchemaVersionsGetOK() *StorageProxySchemaVersionsGetOK { + return &StorageProxySchemaVersionsGetOK{} +} + +/* +StorageProxySchemaVersionsGetOK handles this case with default header values. + +Success +*/ +type StorageProxySchemaVersionsGetOK struct { + Payload []*models.MapperList +} + +func (o *StorageProxySchemaVersionsGetOK) GetPayload() []*models.MapperList { + return o.Payload +} + +func (o *StorageProxySchemaVersionsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxySchemaVersionsGetDefault creates a StorageProxySchemaVersionsGetDefault with default headers values +func NewStorageProxySchemaVersionsGetDefault(code int) *StorageProxySchemaVersionsGetDefault { + return &StorageProxySchemaVersionsGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxySchemaVersionsGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxySchemaVersionsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy schema versions get default response +func (o *StorageProxySchemaVersionsGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxySchemaVersionsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxySchemaVersionsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxySchemaVersionsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_total_hints_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_total_hints_get_parameters.go new file mode 100644 index 0000000000..9a5ffc17de --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_total_hints_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyTotalHintsGetParams creates a new StorageProxyTotalHintsGetParams object +// with the default values initialized. +func NewStorageProxyTotalHintsGetParams() *StorageProxyTotalHintsGetParams { + + return &StorageProxyTotalHintsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyTotalHintsGetParamsWithTimeout creates a new StorageProxyTotalHintsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyTotalHintsGetParamsWithTimeout(timeout time.Duration) *StorageProxyTotalHintsGetParams { + + return &StorageProxyTotalHintsGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyTotalHintsGetParamsWithContext creates a new StorageProxyTotalHintsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyTotalHintsGetParamsWithContext(ctx context.Context) *StorageProxyTotalHintsGetParams { + + return &StorageProxyTotalHintsGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyTotalHintsGetParamsWithHTTPClient creates a new StorageProxyTotalHintsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyTotalHintsGetParamsWithHTTPClient(client *http.Client) *StorageProxyTotalHintsGetParams { + + return &StorageProxyTotalHintsGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyTotalHintsGetParams contains all the parameters to send to the API endpoint +for the storage proxy total hints get operation typically these are written to a http.Request +*/ +type StorageProxyTotalHintsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy total hints get params +func (o *StorageProxyTotalHintsGetParams) WithTimeout(timeout time.Duration) *StorageProxyTotalHintsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy total hints get params +func (o *StorageProxyTotalHintsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy total hints get params +func (o *StorageProxyTotalHintsGetParams) WithContext(ctx context.Context) *StorageProxyTotalHintsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy total hints get params +func (o *StorageProxyTotalHintsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy total hints get params +func (o *StorageProxyTotalHintsGetParams) WithHTTPClient(client *http.Client) *StorageProxyTotalHintsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy total hints get params +func (o *StorageProxyTotalHintsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyTotalHintsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_total_hints_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_total_hints_get_responses.go new file mode 100644 index 0000000000..364221ed5d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_total_hints_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyTotalHintsGetReader is a Reader for the StorageProxyTotalHintsGet structure. +type StorageProxyTotalHintsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyTotalHintsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyTotalHintsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyTotalHintsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyTotalHintsGetOK creates a StorageProxyTotalHintsGetOK with default headers values +func NewStorageProxyTotalHintsGetOK() *StorageProxyTotalHintsGetOK { + return &StorageProxyTotalHintsGetOK{} +} + +/* +StorageProxyTotalHintsGetOK handles this case with default header values. + +Success +*/ +type StorageProxyTotalHintsGetOK struct { + Payload interface{} +} + +func (o *StorageProxyTotalHintsGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyTotalHintsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyTotalHintsGetDefault creates a StorageProxyTotalHintsGetDefault with default headers values +func NewStorageProxyTotalHintsGetDefault(code int) *StorageProxyTotalHintsGetDefault { + return &StorageProxyTotalHintsGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyTotalHintsGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyTotalHintsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy total hints get default response +func (o *StorageProxyTotalHintsGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyTotalHintsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyTotalHintsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyTotalHintsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_truncate_rpc_timeout_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_truncate_rpc_timeout_get_parameters.go new file mode 100644 index 0000000000..002feefc9d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_truncate_rpc_timeout_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyTruncateRPCTimeoutGetParams creates a new StorageProxyTruncateRPCTimeoutGetParams object +// with the default values initialized. +func NewStorageProxyTruncateRPCTimeoutGetParams() *StorageProxyTruncateRPCTimeoutGetParams { + + return &StorageProxyTruncateRPCTimeoutGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyTruncateRPCTimeoutGetParamsWithTimeout creates a new StorageProxyTruncateRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyTruncateRPCTimeoutGetParamsWithTimeout(timeout time.Duration) *StorageProxyTruncateRPCTimeoutGetParams { + + return &StorageProxyTruncateRPCTimeoutGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyTruncateRPCTimeoutGetParamsWithContext creates a new StorageProxyTruncateRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyTruncateRPCTimeoutGetParamsWithContext(ctx context.Context) *StorageProxyTruncateRPCTimeoutGetParams { + + return &StorageProxyTruncateRPCTimeoutGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyTruncateRPCTimeoutGetParamsWithHTTPClient creates a new StorageProxyTruncateRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyTruncateRPCTimeoutGetParamsWithHTTPClient(client *http.Client) *StorageProxyTruncateRPCTimeoutGetParams { + + return &StorageProxyTruncateRPCTimeoutGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyTruncateRPCTimeoutGetParams contains all the parameters to send to the API endpoint +for the storage proxy truncate Rpc timeout get operation typically these are written to a http.Request +*/ +type StorageProxyTruncateRPCTimeoutGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy truncate Rpc timeout get params +func (o *StorageProxyTruncateRPCTimeoutGetParams) WithTimeout(timeout time.Duration) *StorageProxyTruncateRPCTimeoutGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy truncate Rpc timeout get params +func (o *StorageProxyTruncateRPCTimeoutGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy truncate Rpc timeout get params +func (o *StorageProxyTruncateRPCTimeoutGetParams) WithContext(ctx context.Context) *StorageProxyTruncateRPCTimeoutGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy truncate Rpc timeout get params +func (o *StorageProxyTruncateRPCTimeoutGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy truncate Rpc timeout get params +func (o *StorageProxyTruncateRPCTimeoutGetParams) WithHTTPClient(client *http.Client) *StorageProxyTruncateRPCTimeoutGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy truncate Rpc timeout get params +func (o *StorageProxyTruncateRPCTimeoutGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyTruncateRPCTimeoutGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_truncate_rpc_timeout_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_truncate_rpc_timeout_get_responses.go new file mode 100644 index 0000000000..4a039c9978 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_truncate_rpc_timeout_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyTruncateRPCTimeoutGetReader is a Reader for the StorageProxyTruncateRPCTimeoutGet structure. +type StorageProxyTruncateRPCTimeoutGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyTruncateRPCTimeoutGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyTruncateRPCTimeoutGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyTruncateRPCTimeoutGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyTruncateRPCTimeoutGetOK creates a StorageProxyTruncateRPCTimeoutGetOK with default headers values +func NewStorageProxyTruncateRPCTimeoutGetOK() *StorageProxyTruncateRPCTimeoutGetOK { + return &StorageProxyTruncateRPCTimeoutGetOK{} +} + +/* +StorageProxyTruncateRPCTimeoutGetOK handles this case with default header values. + +Success +*/ +type StorageProxyTruncateRPCTimeoutGetOK struct { + Payload interface{} +} + +func (o *StorageProxyTruncateRPCTimeoutGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyTruncateRPCTimeoutGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyTruncateRPCTimeoutGetDefault creates a StorageProxyTruncateRPCTimeoutGetDefault with default headers values +func NewStorageProxyTruncateRPCTimeoutGetDefault(code int) *StorageProxyTruncateRPCTimeoutGetDefault { + return &StorageProxyTruncateRPCTimeoutGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyTruncateRPCTimeoutGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyTruncateRPCTimeoutGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy truncate Rpc timeout get default response +func (o *StorageProxyTruncateRPCTimeoutGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyTruncateRPCTimeoutGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyTruncateRPCTimeoutGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyTruncateRPCTimeoutGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_truncate_rpc_timeout_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_truncate_rpc_timeout_post_parameters.go new file mode 100644 index 0000000000..87171067f8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_truncate_rpc_timeout_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyTruncateRPCTimeoutPostParams creates a new StorageProxyTruncateRPCTimeoutPostParams object +// with the default values initialized. +func NewStorageProxyTruncateRPCTimeoutPostParams() *StorageProxyTruncateRPCTimeoutPostParams { + var () + return &StorageProxyTruncateRPCTimeoutPostParams{ + + requestTimeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyTruncateRPCTimeoutPostParamsWithTimeout creates a new StorageProxyTruncateRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyTruncateRPCTimeoutPostParamsWithTimeout(timeout time.Duration) *StorageProxyTruncateRPCTimeoutPostParams { + var () + return &StorageProxyTruncateRPCTimeoutPostParams{ + + requestTimeout: timeout, + } +} + +// NewStorageProxyTruncateRPCTimeoutPostParamsWithContext creates a new StorageProxyTruncateRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyTruncateRPCTimeoutPostParamsWithContext(ctx context.Context) *StorageProxyTruncateRPCTimeoutPostParams { + var () + return &StorageProxyTruncateRPCTimeoutPostParams{ + + Context: ctx, + } +} + +// NewStorageProxyTruncateRPCTimeoutPostParamsWithHTTPClient creates a new StorageProxyTruncateRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyTruncateRPCTimeoutPostParamsWithHTTPClient(client *http.Client) *StorageProxyTruncateRPCTimeoutPostParams { + var () + return &StorageProxyTruncateRPCTimeoutPostParams{ + HTTPClient: client, + } +} + +/* +StorageProxyTruncateRPCTimeoutPostParams contains all the parameters to send to the API endpoint +for the storage proxy truncate Rpc timeout post operation typically these are written to a http.Request +*/ +type StorageProxyTruncateRPCTimeoutPostParams struct { + + /*Timeout + timeout in second + + */ + Timeout string + + requestTimeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithRequestTimeout adds the timeout to the storage proxy truncate Rpc timeout post params +func (o *StorageProxyTruncateRPCTimeoutPostParams) WithRequestTimeout(timeout time.Duration) *StorageProxyTruncateRPCTimeoutPostParams { + o.SetRequestTimeout(timeout) + return o +} + +// SetRequestTimeout adds the timeout to the storage proxy truncate Rpc timeout post params +func (o *StorageProxyTruncateRPCTimeoutPostParams) SetRequestTimeout(timeout time.Duration) { + o.requestTimeout = timeout +} + +// WithContext adds the context to the storage proxy truncate Rpc timeout post params +func (o *StorageProxyTruncateRPCTimeoutPostParams) WithContext(ctx context.Context) *StorageProxyTruncateRPCTimeoutPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy truncate Rpc timeout post params +func (o *StorageProxyTruncateRPCTimeoutPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy truncate Rpc timeout post params +func (o *StorageProxyTruncateRPCTimeoutPostParams) WithHTTPClient(client *http.Client) *StorageProxyTruncateRPCTimeoutPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy truncate Rpc timeout post params +func (o *StorageProxyTruncateRPCTimeoutPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTimeout adds the timeout to the storage proxy truncate Rpc timeout post params +func (o *StorageProxyTruncateRPCTimeoutPostParams) WithTimeout(timeout string) *StorageProxyTruncateRPCTimeoutPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy truncate Rpc timeout post params +func (o *StorageProxyTruncateRPCTimeoutPostParams) SetTimeout(timeout string) { + o.Timeout = timeout +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyTruncateRPCTimeoutPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.requestTimeout); err != nil { + return err + } + var res []error + + // query param timeout + qrTimeout := o.Timeout + qTimeout := qrTimeout + if qTimeout != "" { + if err := r.SetQueryParam("timeout", qTimeout); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_truncate_rpc_timeout_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_truncate_rpc_timeout_post_responses.go new file mode 100644 index 0000000000..484abfa0bf --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_truncate_rpc_timeout_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyTruncateRPCTimeoutPostReader is a Reader for the StorageProxyTruncateRPCTimeoutPost structure. +type StorageProxyTruncateRPCTimeoutPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyTruncateRPCTimeoutPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyTruncateRPCTimeoutPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyTruncateRPCTimeoutPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyTruncateRPCTimeoutPostOK creates a StorageProxyTruncateRPCTimeoutPostOK with default headers values +func NewStorageProxyTruncateRPCTimeoutPostOK() *StorageProxyTruncateRPCTimeoutPostOK { + return &StorageProxyTruncateRPCTimeoutPostOK{} +} + +/* +StorageProxyTruncateRPCTimeoutPostOK handles this case with default header values. + +Success +*/ +type StorageProxyTruncateRPCTimeoutPostOK struct { +} + +func (o *StorageProxyTruncateRPCTimeoutPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyTruncateRPCTimeoutPostDefault creates a StorageProxyTruncateRPCTimeoutPostDefault with default headers values +func NewStorageProxyTruncateRPCTimeoutPostDefault(code int) *StorageProxyTruncateRPCTimeoutPostDefault { + return &StorageProxyTruncateRPCTimeoutPostDefault{ + _statusCode: code, + } +} + +/* +StorageProxyTruncateRPCTimeoutPostDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyTruncateRPCTimeoutPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy truncate Rpc timeout post default response +func (o *StorageProxyTruncateRPCTimeoutPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyTruncateRPCTimeoutPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyTruncateRPCTimeoutPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyTruncateRPCTimeoutPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_write_rpc_timeout_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_write_rpc_timeout_get_parameters.go new file mode 100644 index 0000000000..9a8fa5c2dd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_write_rpc_timeout_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyWriteRPCTimeoutGetParams creates a new StorageProxyWriteRPCTimeoutGetParams object +// with the default values initialized. +func NewStorageProxyWriteRPCTimeoutGetParams() *StorageProxyWriteRPCTimeoutGetParams { + + return &StorageProxyWriteRPCTimeoutGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyWriteRPCTimeoutGetParamsWithTimeout creates a new StorageProxyWriteRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyWriteRPCTimeoutGetParamsWithTimeout(timeout time.Duration) *StorageProxyWriteRPCTimeoutGetParams { + + return &StorageProxyWriteRPCTimeoutGetParams{ + + timeout: timeout, + } +} + +// NewStorageProxyWriteRPCTimeoutGetParamsWithContext creates a new StorageProxyWriteRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyWriteRPCTimeoutGetParamsWithContext(ctx context.Context) *StorageProxyWriteRPCTimeoutGetParams { + + return &StorageProxyWriteRPCTimeoutGetParams{ + + Context: ctx, + } +} + +// NewStorageProxyWriteRPCTimeoutGetParamsWithHTTPClient creates a new StorageProxyWriteRPCTimeoutGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyWriteRPCTimeoutGetParamsWithHTTPClient(client *http.Client) *StorageProxyWriteRPCTimeoutGetParams { + + return &StorageProxyWriteRPCTimeoutGetParams{ + HTTPClient: client, + } +} + +/* +StorageProxyWriteRPCTimeoutGetParams contains all the parameters to send to the API endpoint +for the storage proxy write Rpc timeout get operation typically these are written to a http.Request +*/ +type StorageProxyWriteRPCTimeoutGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage proxy write Rpc timeout get params +func (o *StorageProxyWriteRPCTimeoutGetParams) WithTimeout(timeout time.Duration) *StorageProxyWriteRPCTimeoutGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy write Rpc timeout get params +func (o *StorageProxyWriteRPCTimeoutGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage proxy write Rpc timeout get params +func (o *StorageProxyWriteRPCTimeoutGetParams) WithContext(ctx context.Context) *StorageProxyWriteRPCTimeoutGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy write Rpc timeout get params +func (o *StorageProxyWriteRPCTimeoutGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy write Rpc timeout get params +func (o *StorageProxyWriteRPCTimeoutGetParams) WithHTTPClient(client *http.Client) *StorageProxyWriteRPCTimeoutGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy write Rpc timeout get params +func (o *StorageProxyWriteRPCTimeoutGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyWriteRPCTimeoutGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_write_rpc_timeout_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_write_rpc_timeout_get_responses.go new file mode 100644 index 0000000000..b70bb9b1b8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_write_rpc_timeout_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyWriteRPCTimeoutGetReader is a Reader for the StorageProxyWriteRPCTimeoutGet structure. +type StorageProxyWriteRPCTimeoutGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyWriteRPCTimeoutGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyWriteRPCTimeoutGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyWriteRPCTimeoutGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyWriteRPCTimeoutGetOK creates a StorageProxyWriteRPCTimeoutGetOK with default headers values +func NewStorageProxyWriteRPCTimeoutGetOK() *StorageProxyWriteRPCTimeoutGetOK { + return &StorageProxyWriteRPCTimeoutGetOK{} +} + +/* +StorageProxyWriteRPCTimeoutGetOK handles this case with default header values. + +Success +*/ +type StorageProxyWriteRPCTimeoutGetOK struct { + Payload interface{} +} + +func (o *StorageProxyWriteRPCTimeoutGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageProxyWriteRPCTimeoutGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageProxyWriteRPCTimeoutGetDefault creates a StorageProxyWriteRPCTimeoutGetDefault with default headers values +func NewStorageProxyWriteRPCTimeoutGetDefault(code int) *StorageProxyWriteRPCTimeoutGetDefault { + return &StorageProxyWriteRPCTimeoutGetDefault{ + _statusCode: code, + } +} + +/* +StorageProxyWriteRPCTimeoutGetDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyWriteRPCTimeoutGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy write Rpc timeout get default response +func (o *StorageProxyWriteRPCTimeoutGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyWriteRPCTimeoutGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyWriteRPCTimeoutGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyWriteRPCTimeoutGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_write_rpc_timeout_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_write_rpc_timeout_post_parameters.go new file mode 100644 index 0000000000..444c4355c6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_write_rpc_timeout_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageProxyWriteRPCTimeoutPostParams creates a new StorageProxyWriteRPCTimeoutPostParams object +// with the default values initialized. +func NewStorageProxyWriteRPCTimeoutPostParams() *StorageProxyWriteRPCTimeoutPostParams { + var () + return &StorageProxyWriteRPCTimeoutPostParams{ + + requestTimeout: cr.DefaultTimeout, + } +} + +// NewStorageProxyWriteRPCTimeoutPostParamsWithTimeout creates a new StorageProxyWriteRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageProxyWriteRPCTimeoutPostParamsWithTimeout(timeout time.Duration) *StorageProxyWriteRPCTimeoutPostParams { + var () + return &StorageProxyWriteRPCTimeoutPostParams{ + + requestTimeout: timeout, + } +} + +// NewStorageProxyWriteRPCTimeoutPostParamsWithContext creates a new StorageProxyWriteRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageProxyWriteRPCTimeoutPostParamsWithContext(ctx context.Context) *StorageProxyWriteRPCTimeoutPostParams { + var () + return &StorageProxyWriteRPCTimeoutPostParams{ + + Context: ctx, + } +} + +// NewStorageProxyWriteRPCTimeoutPostParamsWithHTTPClient creates a new StorageProxyWriteRPCTimeoutPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageProxyWriteRPCTimeoutPostParamsWithHTTPClient(client *http.Client) *StorageProxyWriteRPCTimeoutPostParams { + var () + return &StorageProxyWriteRPCTimeoutPostParams{ + HTTPClient: client, + } +} + +/* +StorageProxyWriteRPCTimeoutPostParams contains all the parameters to send to the API endpoint +for the storage proxy write Rpc timeout post operation typically these are written to a http.Request +*/ +type StorageProxyWriteRPCTimeoutPostParams struct { + + /*Timeout + timeout in seconds + + */ + Timeout string + + requestTimeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithRequestTimeout adds the timeout to the storage proxy write Rpc timeout post params +func (o *StorageProxyWriteRPCTimeoutPostParams) WithRequestTimeout(timeout time.Duration) *StorageProxyWriteRPCTimeoutPostParams { + o.SetRequestTimeout(timeout) + return o +} + +// SetRequestTimeout adds the timeout to the storage proxy write Rpc timeout post params +func (o *StorageProxyWriteRPCTimeoutPostParams) SetRequestTimeout(timeout time.Duration) { + o.requestTimeout = timeout +} + +// WithContext adds the context to the storage proxy write Rpc timeout post params +func (o *StorageProxyWriteRPCTimeoutPostParams) WithContext(ctx context.Context) *StorageProxyWriteRPCTimeoutPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage proxy write Rpc timeout post params +func (o *StorageProxyWriteRPCTimeoutPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage proxy write Rpc timeout post params +func (o *StorageProxyWriteRPCTimeoutPostParams) WithHTTPClient(client *http.Client) *StorageProxyWriteRPCTimeoutPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage proxy write Rpc timeout post params +func (o *StorageProxyWriteRPCTimeoutPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTimeout adds the timeout to the storage proxy write Rpc timeout post params +func (o *StorageProxyWriteRPCTimeoutPostParams) WithTimeout(timeout string) *StorageProxyWriteRPCTimeoutPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage proxy write Rpc timeout post params +func (o *StorageProxyWriteRPCTimeoutPostParams) SetTimeout(timeout string) { + o.Timeout = timeout +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageProxyWriteRPCTimeoutPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.requestTimeout); err != nil { + return err + } + var res []error + + // query param timeout + qrTimeout := o.Timeout + qTimeout := qrTimeout + if qTimeout != "" { + if err := r.SetQueryParam("timeout", qTimeout); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_write_rpc_timeout_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_write_rpc_timeout_post_responses.go new file mode 100644 index 0000000000..aaacd551a3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_proxy_write_rpc_timeout_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageProxyWriteRPCTimeoutPostReader is a Reader for the StorageProxyWriteRPCTimeoutPost structure. +type StorageProxyWriteRPCTimeoutPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageProxyWriteRPCTimeoutPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageProxyWriteRPCTimeoutPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageProxyWriteRPCTimeoutPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageProxyWriteRPCTimeoutPostOK creates a StorageProxyWriteRPCTimeoutPostOK with default headers values +func NewStorageProxyWriteRPCTimeoutPostOK() *StorageProxyWriteRPCTimeoutPostOK { + return &StorageProxyWriteRPCTimeoutPostOK{} +} + +/* +StorageProxyWriteRPCTimeoutPostOK handles this case with default header values. + +Success +*/ +type StorageProxyWriteRPCTimeoutPostOK struct { +} + +func (o *StorageProxyWriteRPCTimeoutPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageProxyWriteRPCTimeoutPostDefault creates a StorageProxyWriteRPCTimeoutPostDefault with default headers values +func NewStorageProxyWriteRPCTimeoutPostDefault(code int) *StorageProxyWriteRPCTimeoutPostDefault { + return &StorageProxyWriteRPCTimeoutPostDefault{ + _statusCode: code, + } +} + +/* +StorageProxyWriteRPCTimeoutPostDefault handles this case with default header values. + +internal server error +*/ +type StorageProxyWriteRPCTimeoutPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage proxy write Rpc timeout post default response +func (o *StorageProxyWriteRPCTimeoutPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageProxyWriteRPCTimeoutPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageProxyWriteRPCTimeoutPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageProxyWriteRPCTimeoutPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_active_repair_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_active_repair_get_parameters.go new file mode 100644 index 0000000000..d90dddca9b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_active_repair_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceActiveRepairGetParams creates a new StorageServiceActiveRepairGetParams object +// with the default values initialized. +func NewStorageServiceActiveRepairGetParams() *StorageServiceActiveRepairGetParams { + + return &StorageServiceActiveRepairGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceActiveRepairGetParamsWithTimeout creates a new StorageServiceActiveRepairGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceActiveRepairGetParamsWithTimeout(timeout time.Duration) *StorageServiceActiveRepairGetParams { + + return &StorageServiceActiveRepairGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceActiveRepairGetParamsWithContext creates a new StorageServiceActiveRepairGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceActiveRepairGetParamsWithContext(ctx context.Context) *StorageServiceActiveRepairGetParams { + + return &StorageServiceActiveRepairGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceActiveRepairGetParamsWithHTTPClient creates a new StorageServiceActiveRepairGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceActiveRepairGetParamsWithHTTPClient(client *http.Client) *StorageServiceActiveRepairGetParams { + + return &StorageServiceActiveRepairGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceActiveRepairGetParams contains all the parameters to send to the API endpoint +for the storage service active repair get operation typically these are written to a http.Request +*/ +type StorageServiceActiveRepairGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service active repair get params +func (o *StorageServiceActiveRepairGetParams) WithTimeout(timeout time.Duration) *StorageServiceActiveRepairGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service active repair get params +func (o *StorageServiceActiveRepairGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service active repair get params +func (o *StorageServiceActiveRepairGetParams) WithContext(ctx context.Context) *StorageServiceActiveRepairGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service active repair get params +func (o *StorageServiceActiveRepairGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service active repair get params +func (o *StorageServiceActiveRepairGetParams) WithHTTPClient(client *http.Client) *StorageServiceActiveRepairGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service active repair get params +func (o *StorageServiceActiveRepairGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceActiveRepairGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_active_repair_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_active_repair_get_responses.go new file mode 100644 index 0000000000..200a7a06da --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_active_repair_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceActiveRepairGetReader is a Reader for the StorageServiceActiveRepairGet structure. +type StorageServiceActiveRepairGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceActiveRepairGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceActiveRepairGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceActiveRepairGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceActiveRepairGetOK creates a StorageServiceActiveRepairGetOK with default headers values +func NewStorageServiceActiveRepairGetOK() *StorageServiceActiveRepairGetOK { + return &StorageServiceActiveRepairGetOK{} +} + +/* +StorageServiceActiveRepairGetOK handles this case with default header values. + +Success +*/ +type StorageServiceActiveRepairGetOK struct { + Payload []int32 +} + +func (o *StorageServiceActiveRepairGetOK) GetPayload() []int32 { + return o.Payload +} + +func (o *StorageServiceActiveRepairGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceActiveRepairGetDefault creates a StorageServiceActiveRepairGetDefault with default headers values +func NewStorageServiceActiveRepairGetDefault(code int) *StorageServiceActiveRepairGetDefault { + return &StorageServiceActiveRepairGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceActiveRepairGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceActiveRepairGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service active repair get default response +func (o *StorageServiceActiveRepairGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceActiveRepairGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceActiveRepairGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceActiveRepairGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_auto_compaction_by_keyspace_delete_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_auto_compaction_by_keyspace_delete_parameters.go new file mode 100644 index 0000000000..55c477ad41 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_auto_compaction_by_keyspace_delete_parameters.go @@ -0,0 +1,168 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceAutoCompactionByKeyspaceDeleteParams creates a new StorageServiceAutoCompactionByKeyspaceDeleteParams object +// with the default values initialized. +func NewStorageServiceAutoCompactionByKeyspaceDeleteParams() *StorageServiceAutoCompactionByKeyspaceDeleteParams { + var () + return &StorageServiceAutoCompactionByKeyspaceDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceAutoCompactionByKeyspaceDeleteParamsWithTimeout creates a new StorageServiceAutoCompactionByKeyspaceDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceAutoCompactionByKeyspaceDeleteParamsWithTimeout(timeout time.Duration) *StorageServiceAutoCompactionByKeyspaceDeleteParams { + var () + return &StorageServiceAutoCompactionByKeyspaceDeleteParams{ + + timeout: timeout, + } +} + +// NewStorageServiceAutoCompactionByKeyspaceDeleteParamsWithContext creates a new StorageServiceAutoCompactionByKeyspaceDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceAutoCompactionByKeyspaceDeleteParamsWithContext(ctx context.Context) *StorageServiceAutoCompactionByKeyspaceDeleteParams { + var () + return &StorageServiceAutoCompactionByKeyspaceDeleteParams{ + + Context: ctx, + } +} + +// NewStorageServiceAutoCompactionByKeyspaceDeleteParamsWithHTTPClient creates a new StorageServiceAutoCompactionByKeyspaceDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceAutoCompactionByKeyspaceDeleteParamsWithHTTPClient(client *http.Client) *StorageServiceAutoCompactionByKeyspaceDeleteParams { + var () + return &StorageServiceAutoCompactionByKeyspaceDeleteParams{ + HTTPClient: client, + } +} + +/* +StorageServiceAutoCompactionByKeyspaceDeleteParams contains all the parameters to send to the API endpoint +for the storage service auto compaction by keyspace delete operation typically these are written to a http.Request +*/ +type StorageServiceAutoCompactionByKeyspaceDeleteParams struct { + + /*Cf + Comma seperated column family names + + */ + Cf *string + /*Keyspace + The keyspace + + */ + Keyspace string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service auto compaction by keyspace delete params +func (o *StorageServiceAutoCompactionByKeyspaceDeleteParams) WithTimeout(timeout time.Duration) *StorageServiceAutoCompactionByKeyspaceDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service auto compaction by keyspace delete params +func (o *StorageServiceAutoCompactionByKeyspaceDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service auto compaction by keyspace delete params +func (o *StorageServiceAutoCompactionByKeyspaceDeleteParams) WithContext(ctx context.Context) *StorageServiceAutoCompactionByKeyspaceDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service auto compaction by keyspace delete params +func (o *StorageServiceAutoCompactionByKeyspaceDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service auto compaction by keyspace delete params +func (o *StorageServiceAutoCompactionByKeyspaceDeleteParams) WithHTTPClient(client *http.Client) *StorageServiceAutoCompactionByKeyspaceDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service auto compaction by keyspace delete params +func (o *StorageServiceAutoCompactionByKeyspaceDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCf adds the cf to the storage service auto compaction by keyspace delete params +func (o *StorageServiceAutoCompactionByKeyspaceDeleteParams) WithCf(cf *string) *StorageServiceAutoCompactionByKeyspaceDeleteParams { + o.SetCf(cf) + return o +} + +// SetCf adds the cf to the storage service auto compaction by keyspace delete params +func (o *StorageServiceAutoCompactionByKeyspaceDeleteParams) SetCf(cf *string) { + o.Cf = cf +} + +// WithKeyspace adds the keyspace to the storage service auto compaction by keyspace delete params +func (o *StorageServiceAutoCompactionByKeyspaceDeleteParams) WithKeyspace(keyspace string) *StorageServiceAutoCompactionByKeyspaceDeleteParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service auto compaction by keyspace delete params +func (o *StorageServiceAutoCompactionByKeyspaceDeleteParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceAutoCompactionByKeyspaceDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cf != nil { + + // query param cf + var qrCf string + if o.Cf != nil { + qrCf = *o.Cf + } + qCf := qrCf + if qCf != "" { + if err := r.SetQueryParam("cf", qCf); err != nil { + return err + } + } + + } + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_auto_compaction_by_keyspace_delete_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_auto_compaction_by_keyspace_delete_responses.go new file mode 100644 index 0000000000..28ac8590b5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_auto_compaction_by_keyspace_delete_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceAutoCompactionByKeyspaceDeleteReader is a Reader for the StorageServiceAutoCompactionByKeyspaceDelete structure. +type StorageServiceAutoCompactionByKeyspaceDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceAutoCompactionByKeyspaceDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceAutoCompactionByKeyspaceDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceAutoCompactionByKeyspaceDeleteDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceAutoCompactionByKeyspaceDeleteOK creates a StorageServiceAutoCompactionByKeyspaceDeleteOK with default headers values +func NewStorageServiceAutoCompactionByKeyspaceDeleteOK() *StorageServiceAutoCompactionByKeyspaceDeleteOK { + return &StorageServiceAutoCompactionByKeyspaceDeleteOK{} +} + +/* +StorageServiceAutoCompactionByKeyspaceDeleteOK handles this case with default header values. + +Success +*/ +type StorageServiceAutoCompactionByKeyspaceDeleteOK struct { +} + +func (o *StorageServiceAutoCompactionByKeyspaceDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceAutoCompactionByKeyspaceDeleteDefault creates a StorageServiceAutoCompactionByKeyspaceDeleteDefault with default headers values +func NewStorageServiceAutoCompactionByKeyspaceDeleteDefault(code int) *StorageServiceAutoCompactionByKeyspaceDeleteDefault { + return &StorageServiceAutoCompactionByKeyspaceDeleteDefault{ + _statusCode: code, + } +} + +/* +StorageServiceAutoCompactionByKeyspaceDeleteDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceAutoCompactionByKeyspaceDeleteDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service auto compaction by keyspace delete default response +func (o *StorageServiceAutoCompactionByKeyspaceDeleteDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceAutoCompactionByKeyspaceDeleteDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceAutoCompactionByKeyspaceDeleteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceAutoCompactionByKeyspaceDeleteDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_auto_compaction_by_keyspace_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_auto_compaction_by_keyspace_post_parameters.go new file mode 100644 index 0000000000..297316e107 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_auto_compaction_by_keyspace_post_parameters.go @@ -0,0 +1,168 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceAutoCompactionByKeyspacePostParams creates a new StorageServiceAutoCompactionByKeyspacePostParams object +// with the default values initialized. +func NewStorageServiceAutoCompactionByKeyspacePostParams() *StorageServiceAutoCompactionByKeyspacePostParams { + var () + return &StorageServiceAutoCompactionByKeyspacePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceAutoCompactionByKeyspacePostParamsWithTimeout creates a new StorageServiceAutoCompactionByKeyspacePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceAutoCompactionByKeyspacePostParamsWithTimeout(timeout time.Duration) *StorageServiceAutoCompactionByKeyspacePostParams { + var () + return &StorageServiceAutoCompactionByKeyspacePostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceAutoCompactionByKeyspacePostParamsWithContext creates a new StorageServiceAutoCompactionByKeyspacePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceAutoCompactionByKeyspacePostParamsWithContext(ctx context.Context) *StorageServiceAutoCompactionByKeyspacePostParams { + var () + return &StorageServiceAutoCompactionByKeyspacePostParams{ + + Context: ctx, + } +} + +// NewStorageServiceAutoCompactionByKeyspacePostParamsWithHTTPClient creates a new StorageServiceAutoCompactionByKeyspacePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceAutoCompactionByKeyspacePostParamsWithHTTPClient(client *http.Client) *StorageServiceAutoCompactionByKeyspacePostParams { + var () + return &StorageServiceAutoCompactionByKeyspacePostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceAutoCompactionByKeyspacePostParams contains all the parameters to send to the API endpoint +for the storage service auto compaction by keyspace post operation typically these are written to a http.Request +*/ +type StorageServiceAutoCompactionByKeyspacePostParams struct { + + /*Cf + Comma seperated column family names + + */ + Cf *string + /*Keyspace + The keyspace + + */ + Keyspace string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service auto compaction by keyspace post params +func (o *StorageServiceAutoCompactionByKeyspacePostParams) WithTimeout(timeout time.Duration) *StorageServiceAutoCompactionByKeyspacePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service auto compaction by keyspace post params +func (o *StorageServiceAutoCompactionByKeyspacePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service auto compaction by keyspace post params +func (o *StorageServiceAutoCompactionByKeyspacePostParams) WithContext(ctx context.Context) *StorageServiceAutoCompactionByKeyspacePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service auto compaction by keyspace post params +func (o *StorageServiceAutoCompactionByKeyspacePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service auto compaction by keyspace post params +func (o *StorageServiceAutoCompactionByKeyspacePostParams) WithHTTPClient(client *http.Client) *StorageServiceAutoCompactionByKeyspacePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service auto compaction by keyspace post params +func (o *StorageServiceAutoCompactionByKeyspacePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCf adds the cf to the storage service auto compaction by keyspace post params +func (o *StorageServiceAutoCompactionByKeyspacePostParams) WithCf(cf *string) *StorageServiceAutoCompactionByKeyspacePostParams { + o.SetCf(cf) + return o +} + +// SetCf adds the cf to the storage service auto compaction by keyspace post params +func (o *StorageServiceAutoCompactionByKeyspacePostParams) SetCf(cf *string) { + o.Cf = cf +} + +// WithKeyspace adds the keyspace to the storage service auto compaction by keyspace post params +func (o *StorageServiceAutoCompactionByKeyspacePostParams) WithKeyspace(keyspace string) *StorageServiceAutoCompactionByKeyspacePostParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service auto compaction by keyspace post params +func (o *StorageServiceAutoCompactionByKeyspacePostParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceAutoCompactionByKeyspacePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cf != nil { + + // query param cf + var qrCf string + if o.Cf != nil { + qrCf = *o.Cf + } + qCf := qrCf + if qCf != "" { + if err := r.SetQueryParam("cf", qCf); err != nil { + return err + } + } + + } + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_auto_compaction_by_keyspace_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_auto_compaction_by_keyspace_post_responses.go new file mode 100644 index 0000000000..1b39fb64f7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_auto_compaction_by_keyspace_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceAutoCompactionByKeyspacePostReader is a Reader for the StorageServiceAutoCompactionByKeyspacePost structure. +type StorageServiceAutoCompactionByKeyspacePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceAutoCompactionByKeyspacePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceAutoCompactionByKeyspacePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceAutoCompactionByKeyspacePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceAutoCompactionByKeyspacePostOK creates a StorageServiceAutoCompactionByKeyspacePostOK with default headers values +func NewStorageServiceAutoCompactionByKeyspacePostOK() *StorageServiceAutoCompactionByKeyspacePostOK { + return &StorageServiceAutoCompactionByKeyspacePostOK{} +} + +/* +StorageServiceAutoCompactionByKeyspacePostOK handles this case with default header values. + +Success +*/ +type StorageServiceAutoCompactionByKeyspacePostOK struct { +} + +func (o *StorageServiceAutoCompactionByKeyspacePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceAutoCompactionByKeyspacePostDefault creates a StorageServiceAutoCompactionByKeyspacePostDefault with default headers values +func NewStorageServiceAutoCompactionByKeyspacePostDefault(code int) *StorageServiceAutoCompactionByKeyspacePostDefault { + return &StorageServiceAutoCompactionByKeyspacePostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceAutoCompactionByKeyspacePostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceAutoCompactionByKeyspacePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service auto compaction by keyspace post default response +func (o *StorageServiceAutoCompactionByKeyspacePostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceAutoCompactionByKeyspacePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceAutoCompactionByKeyspacePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceAutoCompactionByKeyspacePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_batch_size_failure_threshold_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_batch_size_failure_threshold_get_parameters.go new file mode 100644 index 0000000000..c8055645e9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_batch_size_failure_threshold_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceBatchSizeFailureThresholdGetParams creates a new StorageServiceBatchSizeFailureThresholdGetParams object +// with the default values initialized. +func NewStorageServiceBatchSizeFailureThresholdGetParams() *StorageServiceBatchSizeFailureThresholdGetParams { + + return &StorageServiceBatchSizeFailureThresholdGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceBatchSizeFailureThresholdGetParamsWithTimeout creates a new StorageServiceBatchSizeFailureThresholdGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceBatchSizeFailureThresholdGetParamsWithTimeout(timeout time.Duration) *StorageServiceBatchSizeFailureThresholdGetParams { + + return &StorageServiceBatchSizeFailureThresholdGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceBatchSizeFailureThresholdGetParamsWithContext creates a new StorageServiceBatchSizeFailureThresholdGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceBatchSizeFailureThresholdGetParamsWithContext(ctx context.Context) *StorageServiceBatchSizeFailureThresholdGetParams { + + return &StorageServiceBatchSizeFailureThresholdGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceBatchSizeFailureThresholdGetParamsWithHTTPClient creates a new StorageServiceBatchSizeFailureThresholdGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceBatchSizeFailureThresholdGetParamsWithHTTPClient(client *http.Client) *StorageServiceBatchSizeFailureThresholdGetParams { + + return &StorageServiceBatchSizeFailureThresholdGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceBatchSizeFailureThresholdGetParams contains all the parameters to send to the API endpoint +for the storage service batch size failure threshold get operation typically these are written to a http.Request +*/ +type StorageServiceBatchSizeFailureThresholdGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service batch size failure threshold get params +func (o *StorageServiceBatchSizeFailureThresholdGetParams) WithTimeout(timeout time.Duration) *StorageServiceBatchSizeFailureThresholdGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service batch size failure threshold get params +func (o *StorageServiceBatchSizeFailureThresholdGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service batch size failure threshold get params +func (o *StorageServiceBatchSizeFailureThresholdGetParams) WithContext(ctx context.Context) *StorageServiceBatchSizeFailureThresholdGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service batch size failure threshold get params +func (o *StorageServiceBatchSizeFailureThresholdGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service batch size failure threshold get params +func (o *StorageServiceBatchSizeFailureThresholdGetParams) WithHTTPClient(client *http.Client) *StorageServiceBatchSizeFailureThresholdGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service batch size failure threshold get params +func (o *StorageServiceBatchSizeFailureThresholdGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceBatchSizeFailureThresholdGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_batch_size_failure_threshold_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_batch_size_failure_threshold_get_responses.go new file mode 100644 index 0000000000..5c3595be0e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_batch_size_failure_threshold_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceBatchSizeFailureThresholdGetReader is a Reader for the StorageServiceBatchSizeFailureThresholdGet structure. +type StorageServiceBatchSizeFailureThresholdGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceBatchSizeFailureThresholdGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceBatchSizeFailureThresholdGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceBatchSizeFailureThresholdGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceBatchSizeFailureThresholdGetOK creates a StorageServiceBatchSizeFailureThresholdGetOK with default headers values +func NewStorageServiceBatchSizeFailureThresholdGetOK() *StorageServiceBatchSizeFailureThresholdGetOK { + return &StorageServiceBatchSizeFailureThresholdGetOK{} +} + +/* +StorageServiceBatchSizeFailureThresholdGetOK handles this case with default header values. + +Success +*/ +type StorageServiceBatchSizeFailureThresholdGetOK struct { + Payload int32 +} + +func (o *StorageServiceBatchSizeFailureThresholdGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageServiceBatchSizeFailureThresholdGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceBatchSizeFailureThresholdGetDefault creates a StorageServiceBatchSizeFailureThresholdGetDefault with default headers values +func NewStorageServiceBatchSizeFailureThresholdGetDefault(code int) *StorageServiceBatchSizeFailureThresholdGetDefault { + return &StorageServiceBatchSizeFailureThresholdGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceBatchSizeFailureThresholdGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceBatchSizeFailureThresholdGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service batch size failure threshold get default response +func (o *StorageServiceBatchSizeFailureThresholdGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceBatchSizeFailureThresholdGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceBatchSizeFailureThresholdGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceBatchSizeFailureThresholdGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_batch_size_failure_threshold_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_batch_size_failure_threshold_post_parameters.go new file mode 100644 index 0000000000..39e45e6ceb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_batch_size_failure_threshold_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceBatchSizeFailureThresholdPostParams creates a new StorageServiceBatchSizeFailureThresholdPostParams object +// with the default values initialized. +func NewStorageServiceBatchSizeFailureThresholdPostParams() *StorageServiceBatchSizeFailureThresholdPostParams { + var () + return &StorageServiceBatchSizeFailureThresholdPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceBatchSizeFailureThresholdPostParamsWithTimeout creates a new StorageServiceBatchSizeFailureThresholdPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceBatchSizeFailureThresholdPostParamsWithTimeout(timeout time.Duration) *StorageServiceBatchSizeFailureThresholdPostParams { + var () + return &StorageServiceBatchSizeFailureThresholdPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceBatchSizeFailureThresholdPostParamsWithContext creates a new StorageServiceBatchSizeFailureThresholdPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceBatchSizeFailureThresholdPostParamsWithContext(ctx context.Context) *StorageServiceBatchSizeFailureThresholdPostParams { + var () + return &StorageServiceBatchSizeFailureThresholdPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceBatchSizeFailureThresholdPostParamsWithHTTPClient creates a new StorageServiceBatchSizeFailureThresholdPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceBatchSizeFailureThresholdPostParamsWithHTTPClient(client *http.Client) *StorageServiceBatchSizeFailureThresholdPostParams { + var () + return &StorageServiceBatchSizeFailureThresholdPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceBatchSizeFailureThresholdPostParams contains all the parameters to send to the API endpoint +for the storage service batch size failure threshold post operation typically these are written to a http.Request +*/ +type StorageServiceBatchSizeFailureThresholdPostParams struct { + + /*Threshold + batch size debug threshold + + */ + Threshold int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service batch size failure threshold post params +func (o *StorageServiceBatchSizeFailureThresholdPostParams) WithTimeout(timeout time.Duration) *StorageServiceBatchSizeFailureThresholdPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service batch size failure threshold post params +func (o *StorageServiceBatchSizeFailureThresholdPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service batch size failure threshold post params +func (o *StorageServiceBatchSizeFailureThresholdPostParams) WithContext(ctx context.Context) *StorageServiceBatchSizeFailureThresholdPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service batch size failure threshold post params +func (o *StorageServiceBatchSizeFailureThresholdPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service batch size failure threshold post params +func (o *StorageServiceBatchSizeFailureThresholdPostParams) WithHTTPClient(client *http.Client) *StorageServiceBatchSizeFailureThresholdPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service batch size failure threshold post params +func (o *StorageServiceBatchSizeFailureThresholdPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithThreshold adds the threshold to the storage service batch size failure threshold post params +func (o *StorageServiceBatchSizeFailureThresholdPostParams) WithThreshold(threshold int32) *StorageServiceBatchSizeFailureThresholdPostParams { + o.SetThreshold(threshold) + return o +} + +// SetThreshold adds the threshold to the storage service batch size failure threshold post params +func (o *StorageServiceBatchSizeFailureThresholdPostParams) SetThreshold(threshold int32) { + o.Threshold = threshold +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceBatchSizeFailureThresholdPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param threshold + qrThreshold := o.Threshold + qThreshold := swag.FormatInt32(qrThreshold) + if qThreshold != "" { + if err := r.SetQueryParam("threshold", qThreshold); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_batch_size_failure_threshold_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_batch_size_failure_threshold_post_responses.go new file mode 100644 index 0000000000..0fb9d8b447 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_batch_size_failure_threshold_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceBatchSizeFailureThresholdPostReader is a Reader for the StorageServiceBatchSizeFailureThresholdPost structure. +type StorageServiceBatchSizeFailureThresholdPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceBatchSizeFailureThresholdPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceBatchSizeFailureThresholdPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceBatchSizeFailureThresholdPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceBatchSizeFailureThresholdPostOK creates a StorageServiceBatchSizeFailureThresholdPostOK with default headers values +func NewStorageServiceBatchSizeFailureThresholdPostOK() *StorageServiceBatchSizeFailureThresholdPostOK { + return &StorageServiceBatchSizeFailureThresholdPostOK{} +} + +/* +StorageServiceBatchSizeFailureThresholdPostOK handles this case with default header values. + +Success +*/ +type StorageServiceBatchSizeFailureThresholdPostOK struct { +} + +func (o *StorageServiceBatchSizeFailureThresholdPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceBatchSizeFailureThresholdPostDefault creates a StorageServiceBatchSizeFailureThresholdPostDefault with default headers values +func NewStorageServiceBatchSizeFailureThresholdPostDefault(code int) *StorageServiceBatchSizeFailureThresholdPostDefault { + return &StorageServiceBatchSizeFailureThresholdPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceBatchSizeFailureThresholdPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceBatchSizeFailureThresholdPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service batch size failure threshold post default response +func (o *StorageServiceBatchSizeFailureThresholdPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceBatchSizeFailureThresholdPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceBatchSizeFailureThresholdPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceBatchSizeFailureThresholdPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_bulk_load_async_by_path_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_bulk_load_async_by_path_get_parameters.go new file mode 100644 index 0000000000..b59a49f3ae --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_bulk_load_async_by_path_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceBulkLoadAsyncByPathGetParams creates a new StorageServiceBulkLoadAsyncByPathGetParams object +// with the default values initialized. +func NewStorageServiceBulkLoadAsyncByPathGetParams() *StorageServiceBulkLoadAsyncByPathGetParams { + var () + return &StorageServiceBulkLoadAsyncByPathGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceBulkLoadAsyncByPathGetParamsWithTimeout creates a new StorageServiceBulkLoadAsyncByPathGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceBulkLoadAsyncByPathGetParamsWithTimeout(timeout time.Duration) *StorageServiceBulkLoadAsyncByPathGetParams { + var () + return &StorageServiceBulkLoadAsyncByPathGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceBulkLoadAsyncByPathGetParamsWithContext creates a new StorageServiceBulkLoadAsyncByPathGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceBulkLoadAsyncByPathGetParamsWithContext(ctx context.Context) *StorageServiceBulkLoadAsyncByPathGetParams { + var () + return &StorageServiceBulkLoadAsyncByPathGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceBulkLoadAsyncByPathGetParamsWithHTTPClient creates a new StorageServiceBulkLoadAsyncByPathGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceBulkLoadAsyncByPathGetParamsWithHTTPClient(client *http.Client) *StorageServiceBulkLoadAsyncByPathGetParams { + var () + return &StorageServiceBulkLoadAsyncByPathGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceBulkLoadAsyncByPathGetParams contains all the parameters to send to the API endpoint +for the storage service bulk load async by path get operation typically these are written to a http.Request +*/ +type StorageServiceBulkLoadAsyncByPathGetParams struct { + + /*Path + Path to directory to load from + + */ + Path string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service bulk load async by path get params +func (o *StorageServiceBulkLoadAsyncByPathGetParams) WithTimeout(timeout time.Duration) *StorageServiceBulkLoadAsyncByPathGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service bulk load async by path get params +func (o *StorageServiceBulkLoadAsyncByPathGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service bulk load async by path get params +func (o *StorageServiceBulkLoadAsyncByPathGetParams) WithContext(ctx context.Context) *StorageServiceBulkLoadAsyncByPathGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service bulk load async by path get params +func (o *StorageServiceBulkLoadAsyncByPathGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service bulk load async by path get params +func (o *StorageServiceBulkLoadAsyncByPathGetParams) WithHTTPClient(client *http.Client) *StorageServiceBulkLoadAsyncByPathGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service bulk load async by path get params +func (o *StorageServiceBulkLoadAsyncByPathGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPath adds the path to the storage service bulk load async by path get params +func (o *StorageServiceBulkLoadAsyncByPathGetParams) WithPath(path string) *StorageServiceBulkLoadAsyncByPathGetParams { + o.SetPath(path) + return o +} + +// SetPath adds the path to the storage service bulk load async by path get params +func (o *StorageServiceBulkLoadAsyncByPathGetParams) SetPath(path string) { + o.Path = path +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceBulkLoadAsyncByPathGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param path + if err := r.SetPathParam("path", o.Path); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_bulk_load_async_by_path_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_bulk_load_async_by_path_get_responses.go new file mode 100644 index 0000000000..1951a32a3c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_bulk_load_async_by_path_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceBulkLoadAsyncByPathGetReader is a Reader for the StorageServiceBulkLoadAsyncByPathGet structure. +type StorageServiceBulkLoadAsyncByPathGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceBulkLoadAsyncByPathGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceBulkLoadAsyncByPathGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceBulkLoadAsyncByPathGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceBulkLoadAsyncByPathGetOK creates a StorageServiceBulkLoadAsyncByPathGetOK with default headers values +func NewStorageServiceBulkLoadAsyncByPathGetOK() *StorageServiceBulkLoadAsyncByPathGetOK { + return &StorageServiceBulkLoadAsyncByPathGetOK{} +} + +/* +StorageServiceBulkLoadAsyncByPathGetOK handles this case with default header values. + +Success +*/ +type StorageServiceBulkLoadAsyncByPathGetOK struct { + Payload string +} + +func (o *StorageServiceBulkLoadAsyncByPathGetOK) GetPayload() string { + return o.Payload +} + +func (o *StorageServiceBulkLoadAsyncByPathGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceBulkLoadAsyncByPathGetDefault creates a StorageServiceBulkLoadAsyncByPathGetDefault with default headers values +func NewStorageServiceBulkLoadAsyncByPathGetDefault(code int) *StorageServiceBulkLoadAsyncByPathGetDefault { + return &StorageServiceBulkLoadAsyncByPathGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceBulkLoadAsyncByPathGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceBulkLoadAsyncByPathGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service bulk load async by path get default response +func (o *StorageServiceBulkLoadAsyncByPathGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceBulkLoadAsyncByPathGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceBulkLoadAsyncByPathGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceBulkLoadAsyncByPathGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_bulk_load_by_path_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_bulk_load_by_path_post_parameters.go new file mode 100644 index 0000000000..80eb4eff24 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_bulk_load_by_path_post_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceBulkLoadByPathPostParams creates a new StorageServiceBulkLoadByPathPostParams object +// with the default values initialized. +func NewStorageServiceBulkLoadByPathPostParams() *StorageServiceBulkLoadByPathPostParams { + var () + return &StorageServiceBulkLoadByPathPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceBulkLoadByPathPostParamsWithTimeout creates a new StorageServiceBulkLoadByPathPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceBulkLoadByPathPostParamsWithTimeout(timeout time.Duration) *StorageServiceBulkLoadByPathPostParams { + var () + return &StorageServiceBulkLoadByPathPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceBulkLoadByPathPostParamsWithContext creates a new StorageServiceBulkLoadByPathPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceBulkLoadByPathPostParamsWithContext(ctx context.Context) *StorageServiceBulkLoadByPathPostParams { + var () + return &StorageServiceBulkLoadByPathPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceBulkLoadByPathPostParamsWithHTTPClient creates a new StorageServiceBulkLoadByPathPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceBulkLoadByPathPostParamsWithHTTPClient(client *http.Client) *StorageServiceBulkLoadByPathPostParams { + var () + return &StorageServiceBulkLoadByPathPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceBulkLoadByPathPostParams contains all the parameters to send to the API endpoint +for the storage service bulk load by path post operation typically these are written to a http.Request +*/ +type StorageServiceBulkLoadByPathPostParams struct { + + /*Path + Path to directory to load from + + */ + Path string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service bulk load by path post params +func (o *StorageServiceBulkLoadByPathPostParams) WithTimeout(timeout time.Duration) *StorageServiceBulkLoadByPathPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service bulk load by path post params +func (o *StorageServiceBulkLoadByPathPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service bulk load by path post params +func (o *StorageServiceBulkLoadByPathPostParams) WithContext(ctx context.Context) *StorageServiceBulkLoadByPathPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service bulk load by path post params +func (o *StorageServiceBulkLoadByPathPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service bulk load by path post params +func (o *StorageServiceBulkLoadByPathPostParams) WithHTTPClient(client *http.Client) *StorageServiceBulkLoadByPathPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service bulk load by path post params +func (o *StorageServiceBulkLoadByPathPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPath adds the path to the storage service bulk load by path post params +func (o *StorageServiceBulkLoadByPathPostParams) WithPath(path string) *StorageServiceBulkLoadByPathPostParams { + o.SetPath(path) + return o +} + +// SetPath adds the path to the storage service bulk load by path post params +func (o *StorageServiceBulkLoadByPathPostParams) SetPath(path string) { + o.Path = path +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceBulkLoadByPathPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param path + if err := r.SetPathParam("path", o.Path); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_bulk_load_by_path_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_bulk_load_by_path_post_responses.go new file mode 100644 index 0000000000..f21a602b6f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_bulk_load_by_path_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceBulkLoadByPathPostReader is a Reader for the StorageServiceBulkLoadByPathPost structure. +type StorageServiceBulkLoadByPathPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceBulkLoadByPathPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceBulkLoadByPathPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceBulkLoadByPathPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceBulkLoadByPathPostOK creates a StorageServiceBulkLoadByPathPostOK with default headers values +func NewStorageServiceBulkLoadByPathPostOK() *StorageServiceBulkLoadByPathPostOK { + return &StorageServiceBulkLoadByPathPostOK{} +} + +/* +StorageServiceBulkLoadByPathPostOK handles this case with default header values. + +Success +*/ +type StorageServiceBulkLoadByPathPostOK struct { +} + +func (o *StorageServiceBulkLoadByPathPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceBulkLoadByPathPostDefault creates a StorageServiceBulkLoadByPathPostDefault with default headers values +func NewStorageServiceBulkLoadByPathPostDefault(code int) *StorageServiceBulkLoadByPathPostDefault { + return &StorageServiceBulkLoadByPathPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceBulkLoadByPathPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceBulkLoadByPathPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service bulk load by path post default response +func (o *StorageServiceBulkLoadByPathPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceBulkLoadByPathPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceBulkLoadByPathPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceBulkLoadByPathPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_cluster_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_cluster_name_get_parameters.go new file mode 100644 index 0000000000..b51a1695d9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_cluster_name_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceClusterNameGetParams creates a new StorageServiceClusterNameGetParams object +// with the default values initialized. +func NewStorageServiceClusterNameGetParams() *StorageServiceClusterNameGetParams { + + return &StorageServiceClusterNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceClusterNameGetParamsWithTimeout creates a new StorageServiceClusterNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceClusterNameGetParamsWithTimeout(timeout time.Duration) *StorageServiceClusterNameGetParams { + + return &StorageServiceClusterNameGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceClusterNameGetParamsWithContext creates a new StorageServiceClusterNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceClusterNameGetParamsWithContext(ctx context.Context) *StorageServiceClusterNameGetParams { + + return &StorageServiceClusterNameGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceClusterNameGetParamsWithHTTPClient creates a new StorageServiceClusterNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceClusterNameGetParamsWithHTTPClient(client *http.Client) *StorageServiceClusterNameGetParams { + + return &StorageServiceClusterNameGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceClusterNameGetParams contains all the parameters to send to the API endpoint +for the storage service cluster name get operation typically these are written to a http.Request +*/ +type StorageServiceClusterNameGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service cluster name get params +func (o *StorageServiceClusterNameGetParams) WithTimeout(timeout time.Duration) *StorageServiceClusterNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service cluster name get params +func (o *StorageServiceClusterNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service cluster name get params +func (o *StorageServiceClusterNameGetParams) WithContext(ctx context.Context) *StorageServiceClusterNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service cluster name get params +func (o *StorageServiceClusterNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service cluster name get params +func (o *StorageServiceClusterNameGetParams) WithHTTPClient(client *http.Client) *StorageServiceClusterNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service cluster name get params +func (o *StorageServiceClusterNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceClusterNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_cluster_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_cluster_name_get_responses.go new file mode 100644 index 0000000000..120f63bdbd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_cluster_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceClusterNameGetReader is a Reader for the StorageServiceClusterNameGet structure. +type StorageServiceClusterNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceClusterNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceClusterNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceClusterNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceClusterNameGetOK creates a StorageServiceClusterNameGetOK with default headers values +func NewStorageServiceClusterNameGetOK() *StorageServiceClusterNameGetOK { + return &StorageServiceClusterNameGetOK{} +} + +/* +StorageServiceClusterNameGetOK handles this case with default header values. + +Success +*/ +type StorageServiceClusterNameGetOK struct { + Payload string +} + +func (o *StorageServiceClusterNameGetOK) GetPayload() string { + return o.Payload +} + +func (o *StorageServiceClusterNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceClusterNameGetDefault creates a StorageServiceClusterNameGetDefault with default headers values +func NewStorageServiceClusterNameGetDefault(code int) *StorageServiceClusterNameGetDefault { + return &StorageServiceClusterNameGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceClusterNameGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceClusterNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service cluster name get default response +func (o *StorageServiceClusterNameGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceClusterNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceClusterNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceClusterNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_commitlog_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_commitlog_get_parameters.go new file mode 100644 index 0000000000..ad32804c42 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_commitlog_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceCommitlogGetParams creates a new StorageServiceCommitlogGetParams object +// with the default values initialized. +func NewStorageServiceCommitlogGetParams() *StorageServiceCommitlogGetParams { + + return &StorageServiceCommitlogGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceCommitlogGetParamsWithTimeout creates a new StorageServiceCommitlogGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceCommitlogGetParamsWithTimeout(timeout time.Duration) *StorageServiceCommitlogGetParams { + + return &StorageServiceCommitlogGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceCommitlogGetParamsWithContext creates a new StorageServiceCommitlogGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceCommitlogGetParamsWithContext(ctx context.Context) *StorageServiceCommitlogGetParams { + + return &StorageServiceCommitlogGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceCommitlogGetParamsWithHTTPClient creates a new StorageServiceCommitlogGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceCommitlogGetParamsWithHTTPClient(client *http.Client) *StorageServiceCommitlogGetParams { + + return &StorageServiceCommitlogGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceCommitlogGetParams contains all the parameters to send to the API endpoint +for the storage service commitlog get operation typically these are written to a http.Request +*/ +type StorageServiceCommitlogGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service commitlog get params +func (o *StorageServiceCommitlogGetParams) WithTimeout(timeout time.Duration) *StorageServiceCommitlogGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service commitlog get params +func (o *StorageServiceCommitlogGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service commitlog get params +func (o *StorageServiceCommitlogGetParams) WithContext(ctx context.Context) *StorageServiceCommitlogGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service commitlog get params +func (o *StorageServiceCommitlogGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service commitlog get params +func (o *StorageServiceCommitlogGetParams) WithHTTPClient(client *http.Client) *StorageServiceCommitlogGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service commitlog get params +func (o *StorageServiceCommitlogGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceCommitlogGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_commitlog_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_commitlog_get_responses.go new file mode 100644 index 0000000000..3cd340cf42 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_commitlog_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceCommitlogGetReader is a Reader for the StorageServiceCommitlogGet structure. +type StorageServiceCommitlogGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceCommitlogGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceCommitlogGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceCommitlogGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceCommitlogGetOK creates a StorageServiceCommitlogGetOK with default headers values +func NewStorageServiceCommitlogGetOK() *StorageServiceCommitlogGetOK { + return &StorageServiceCommitlogGetOK{} +} + +/* +StorageServiceCommitlogGetOK handles this case with default header values. + +Success +*/ +type StorageServiceCommitlogGetOK struct { + Payload string +} + +func (o *StorageServiceCommitlogGetOK) GetPayload() string { + return o.Payload +} + +func (o *StorageServiceCommitlogGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceCommitlogGetDefault creates a StorageServiceCommitlogGetDefault with default headers values +func NewStorageServiceCommitlogGetDefault(code int) *StorageServiceCommitlogGetDefault { + return &StorageServiceCommitlogGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceCommitlogGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceCommitlogGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service commitlog get default response +func (o *StorageServiceCommitlogGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceCommitlogGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceCommitlogGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceCommitlogGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_compaction_throughput_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_compaction_throughput_get_parameters.go new file mode 100644 index 0000000000..5f43f01acf --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_compaction_throughput_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceCompactionThroughputGetParams creates a new StorageServiceCompactionThroughputGetParams object +// with the default values initialized. +func NewStorageServiceCompactionThroughputGetParams() *StorageServiceCompactionThroughputGetParams { + + return &StorageServiceCompactionThroughputGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceCompactionThroughputGetParamsWithTimeout creates a new StorageServiceCompactionThroughputGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceCompactionThroughputGetParamsWithTimeout(timeout time.Duration) *StorageServiceCompactionThroughputGetParams { + + return &StorageServiceCompactionThroughputGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceCompactionThroughputGetParamsWithContext creates a new StorageServiceCompactionThroughputGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceCompactionThroughputGetParamsWithContext(ctx context.Context) *StorageServiceCompactionThroughputGetParams { + + return &StorageServiceCompactionThroughputGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceCompactionThroughputGetParamsWithHTTPClient creates a new StorageServiceCompactionThroughputGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceCompactionThroughputGetParamsWithHTTPClient(client *http.Client) *StorageServiceCompactionThroughputGetParams { + + return &StorageServiceCompactionThroughputGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceCompactionThroughputGetParams contains all the parameters to send to the API endpoint +for the storage service compaction throughput get operation typically these are written to a http.Request +*/ +type StorageServiceCompactionThroughputGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service compaction throughput get params +func (o *StorageServiceCompactionThroughputGetParams) WithTimeout(timeout time.Duration) *StorageServiceCompactionThroughputGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service compaction throughput get params +func (o *StorageServiceCompactionThroughputGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service compaction throughput get params +func (o *StorageServiceCompactionThroughputGetParams) WithContext(ctx context.Context) *StorageServiceCompactionThroughputGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service compaction throughput get params +func (o *StorageServiceCompactionThroughputGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service compaction throughput get params +func (o *StorageServiceCompactionThroughputGetParams) WithHTTPClient(client *http.Client) *StorageServiceCompactionThroughputGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service compaction throughput get params +func (o *StorageServiceCompactionThroughputGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceCompactionThroughputGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_compaction_throughput_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_compaction_throughput_get_responses.go new file mode 100644 index 0000000000..31536bf45f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_compaction_throughput_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceCompactionThroughputGetReader is a Reader for the StorageServiceCompactionThroughputGet structure. +type StorageServiceCompactionThroughputGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceCompactionThroughputGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceCompactionThroughputGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceCompactionThroughputGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceCompactionThroughputGetOK creates a StorageServiceCompactionThroughputGetOK with default headers values +func NewStorageServiceCompactionThroughputGetOK() *StorageServiceCompactionThroughputGetOK { + return &StorageServiceCompactionThroughputGetOK{} +} + +/* +StorageServiceCompactionThroughputGetOK handles this case with default header values. + +Success +*/ +type StorageServiceCompactionThroughputGetOK struct { + Payload int32 +} + +func (o *StorageServiceCompactionThroughputGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageServiceCompactionThroughputGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceCompactionThroughputGetDefault creates a StorageServiceCompactionThroughputGetDefault with default headers values +func NewStorageServiceCompactionThroughputGetDefault(code int) *StorageServiceCompactionThroughputGetDefault { + return &StorageServiceCompactionThroughputGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceCompactionThroughputGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceCompactionThroughputGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service compaction throughput get default response +func (o *StorageServiceCompactionThroughputGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceCompactionThroughputGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceCompactionThroughputGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceCompactionThroughputGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_compaction_throughput_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_compaction_throughput_post_parameters.go new file mode 100644 index 0000000000..d41f18c9c8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_compaction_throughput_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceCompactionThroughputPostParams creates a new StorageServiceCompactionThroughputPostParams object +// with the default values initialized. +func NewStorageServiceCompactionThroughputPostParams() *StorageServiceCompactionThroughputPostParams { + var () + return &StorageServiceCompactionThroughputPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceCompactionThroughputPostParamsWithTimeout creates a new StorageServiceCompactionThroughputPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceCompactionThroughputPostParamsWithTimeout(timeout time.Duration) *StorageServiceCompactionThroughputPostParams { + var () + return &StorageServiceCompactionThroughputPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceCompactionThroughputPostParamsWithContext creates a new StorageServiceCompactionThroughputPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceCompactionThroughputPostParamsWithContext(ctx context.Context) *StorageServiceCompactionThroughputPostParams { + var () + return &StorageServiceCompactionThroughputPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceCompactionThroughputPostParamsWithHTTPClient creates a new StorageServiceCompactionThroughputPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceCompactionThroughputPostParamsWithHTTPClient(client *http.Client) *StorageServiceCompactionThroughputPostParams { + var () + return &StorageServiceCompactionThroughputPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceCompactionThroughputPostParams contains all the parameters to send to the API endpoint +for the storage service compaction throughput post operation typically these are written to a http.Request +*/ +type StorageServiceCompactionThroughputPostParams struct { + + /*Value + compaction throughput + + */ + Value int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service compaction throughput post params +func (o *StorageServiceCompactionThroughputPostParams) WithTimeout(timeout time.Duration) *StorageServiceCompactionThroughputPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service compaction throughput post params +func (o *StorageServiceCompactionThroughputPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service compaction throughput post params +func (o *StorageServiceCompactionThroughputPostParams) WithContext(ctx context.Context) *StorageServiceCompactionThroughputPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service compaction throughput post params +func (o *StorageServiceCompactionThroughputPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service compaction throughput post params +func (o *StorageServiceCompactionThroughputPostParams) WithHTTPClient(client *http.Client) *StorageServiceCompactionThroughputPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service compaction throughput post params +func (o *StorageServiceCompactionThroughputPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithValue adds the value to the storage service compaction throughput post params +func (o *StorageServiceCompactionThroughputPostParams) WithValue(value int32) *StorageServiceCompactionThroughputPostParams { + o.SetValue(value) + return o +} + +// SetValue adds the value to the storage service compaction throughput post params +func (o *StorageServiceCompactionThroughputPostParams) SetValue(value int32) { + o.Value = value +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceCompactionThroughputPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param value + qrValue := o.Value + qValue := swag.FormatInt32(qrValue) + if qValue != "" { + if err := r.SetQueryParam("value", qValue); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_compaction_throughput_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_compaction_throughput_post_responses.go new file mode 100644 index 0000000000..cbaee26e86 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_compaction_throughput_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceCompactionThroughputPostReader is a Reader for the StorageServiceCompactionThroughputPost structure. +type StorageServiceCompactionThroughputPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceCompactionThroughputPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceCompactionThroughputPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceCompactionThroughputPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceCompactionThroughputPostOK creates a StorageServiceCompactionThroughputPostOK with default headers values +func NewStorageServiceCompactionThroughputPostOK() *StorageServiceCompactionThroughputPostOK { + return &StorageServiceCompactionThroughputPostOK{} +} + +/* +StorageServiceCompactionThroughputPostOK handles this case with default header values. + +Success +*/ +type StorageServiceCompactionThroughputPostOK struct { +} + +func (o *StorageServiceCompactionThroughputPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceCompactionThroughputPostDefault creates a StorageServiceCompactionThroughputPostDefault with default headers values +func NewStorageServiceCompactionThroughputPostDefault(code int) *StorageServiceCompactionThroughputPostDefault { + return &StorageServiceCompactionThroughputPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceCompactionThroughputPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceCompactionThroughputPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service compaction throughput post default response +func (o *StorageServiceCompactionThroughputPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceCompactionThroughputPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceCompactionThroughputPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceCompactionThroughputPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_data_file_locations_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_data_file_locations_get_parameters.go new file mode 100644 index 0000000000..696b3f8e50 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_data_file_locations_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceDataFileLocationsGetParams creates a new StorageServiceDataFileLocationsGetParams object +// with the default values initialized. +func NewStorageServiceDataFileLocationsGetParams() *StorageServiceDataFileLocationsGetParams { + + return &StorageServiceDataFileLocationsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceDataFileLocationsGetParamsWithTimeout creates a new StorageServiceDataFileLocationsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceDataFileLocationsGetParamsWithTimeout(timeout time.Duration) *StorageServiceDataFileLocationsGetParams { + + return &StorageServiceDataFileLocationsGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceDataFileLocationsGetParamsWithContext creates a new StorageServiceDataFileLocationsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceDataFileLocationsGetParamsWithContext(ctx context.Context) *StorageServiceDataFileLocationsGetParams { + + return &StorageServiceDataFileLocationsGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceDataFileLocationsGetParamsWithHTTPClient creates a new StorageServiceDataFileLocationsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceDataFileLocationsGetParamsWithHTTPClient(client *http.Client) *StorageServiceDataFileLocationsGetParams { + + return &StorageServiceDataFileLocationsGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceDataFileLocationsGetParams contains all the parameters to send to the API endpoint +for the storage service data file locations get operation typically these are written to a http.Request +*/ +type StorageServiceDataFileLocationsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service data file locations get params +func (o *StorageServiceDataFileLocationsGetParams) WithTimeout(timeout time.Duration) *StorageServiceDataFileLocationsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service data file locations get params +func (o *StorageServiceDataFileLocationsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service data file locations get params +func (o *StorageServiceDataFileLocationsGetParams) WithContext(ctx context.Context) *StorageServiceDataFileLocationsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service data file locations get params +func (o *StorageServiceDataFileLocationsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service data file locations get params +func (o *StorageServiceDataFileLocationsGetParams) WithHTTPClient(client *http.Client) *StorageServiceDataFileLocationsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service data file locations get params +func (o *StorageServiceDataFileLocationsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceDataFileLocationsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_data_file_locations_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_data_file_locations_get_responses.go new file mode 100644 index 0000000000..73a3f955ea --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_data_file_locations_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceDataFileLocationsGetReader is a Reader for the StorageServiceDataFileLocationsGet structure. +type StorageServiceDataFileLocationsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceDataFileLocationsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceDataFileLocationsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceDataFileLocationsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceDataFileLocationsGetOK creates a StorageServiceDataFileLocationsGetOK with default headers values +func NewStorageServiceDataFileLocationsGetOK() *StorageServiceDataFileLocationsGetOK { + return &StorageServiceDataFileLocationsGetOK{} +} + +/* +StorageServiceDataFileLocationsGetOK handles this case with default header values. + +Success +*/ +type StorageServiceDataFileLocationsGetOK struct { + Payload []string +} + +func (o *StorageServiceDataFileLocationsGetOK) GetPayload() []string { + return o.Payload +} + +func (o *StorageServiceDataFileLocationsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceDataFileLocationsGetDefault creates a StorageServiceDataFileLocationsGetDefault with default headers values +func NewStorageServiceDataFileLocationsGetDefault(code int) *StorageServiceDataFileLocationsGetDefault { + return &StorageServiceDataFileLocationsGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceDataFileLocationsGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceDataFileLocationsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service data file locations get default response +func (o *StorageServiceDataFileLocationsGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceDataFileLocationsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceDataFileLocationsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceDataFileLocationsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_decommission_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_decommission_post_parameters.go new file mode 100644 index 0000000000..16981ed389 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_decommission_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceDecommissionPostParams creates a new StorageServiceDecommissionPostParams object +// with the default values initialized. +func NewStorageServiceDecommissionPostParams() *StorageServiceDecommissionPostParams { + + return &StorageServiceDecommissionPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceDecommissionPostParamsWithTimeout creates a new StorageServiceDecommissionPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceDecommissionPostParamsWithTimeout(timeout time.Duration) *StorageServiceDecommissionPostParams { + + return &StorageServiceDecommissionPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceDecommissionPostParamsWithContext creates a new StorageServiceDecommissionPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceDecommissionPostParamsWithContext(ctx context.Context) *StorageServiceDecommissionPostParams { + + return &StorageServiceDecommissionPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceDecommissionPostParamsWithHTTPClient creates a new StorageServiceDecommissionPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceDecommissionPostParamsWithHTTPClient(client *http.Client) *StorageServiceDecommissionPostParams { + + return &StorageServiceDecommissionPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceDecommissionPostParams contains all the parameters to send to the API endpoint +for the storage service decommission post operation typically these are written to a http.Request +*/ +type StorageServiceDecommissionPostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service decommission post params +func (o *StorageServiceDecommissionPostParams) WithTimeout(timeout time.Duration) *StorageServiceDecommissionPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service decommission post params +func (o *StorageServiceDecommissionPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service decommission post params +func (o *StorageServiceDecommissionPostParams) WithContext(ctx context.Context) *StorageServiceDecommissionPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service decommission post params +func (o *StorageServiceDecommissionPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service decommission post params +func (o *StorageServiceDecommissionPostParams) WithHTTPClient(client *http.Client) *StorageServiceDecommissionPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service decommission post params +func (o *StorageServiceDecommissionPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceDecommissionPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_decommission_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_decommission_post_responses.go new file mode 100644 index 0000000000..9548b168b4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_decommission_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceDecommissionPostReader is a Reader for the StorageServiceDecommissionPost structure. +type StorageServiceDecommissionPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceDecommissionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceDecommissionPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceDecommissionPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceDecommissionPostOK creates a StorageServiceDecommissionPostOK with default headers values +func NewStorageServiceDecommissionPostOK() *StorageServiceDecommissionPostOK { + return &StorageServiceDecommissionPostOK{} +} + +/* +StorageServiceDecommissionPostOK handles this case with default header values. + +Success +*/ +type StorageServiceDecommissionPostOK struct { +} + +func (o *StorageServiceDecommissionPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceDecommissionPostDefault creates a StorageServiceDecommissionPostDefault with default headers values +func NewStorageServiceDecommissionPostDefault(code int) *StorageServiceDecommissionPostDefault { + return &StorageServiceDecommissionPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceDecommissionPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceDecommissionPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service decommission post default response +func (o *StorageServiceDecommissionPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceDecommissionPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceDecommissionPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceDecommissionPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_deliver_hints_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_deliver_hints_post_parameters.go new file mode 100644 index 0000000000..5cdb7174ad --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_deliver_hints_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceDeliverHintsPostParams creates a new StorageServiceDeliverHintsPostParams object +// with the default values initialized. +func NewStorageServiceDeliverHintsPostParams() *StorageServiceDeliverHintsPostParams { + var () + return &StorageServiceDeliverHintsPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceDeliverHintsPostParamsWithTimeout creates a new StorageServiceDeliverHintsPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceDeliverHintsPostParamsWithTimeout(timeout time.Duration) *StorageServiceDeliverHintsPostParams { + var () + return &StorageServiceDeliverHintsPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceDeliverHintsPostParamsWithContext creates a new StorageServiceDeliverHintsPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceDeliverHintsPostParamsWithContext(ctx context.Context) *StorageServiceDeliverHintsPostParams { + var () + return &StorageServiceDeliverHintsPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceDeliverHintsPostParamsWithHTTPClient creates a new StorageServiceDeliverHintsPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceDeliverHintsPostParamsWithHTTPClient(client *http.Client) *StorageServiceDeliverHintsPostParams { + var () + return &StorageServiceDeliverHintsPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceDeliverHintsPostParams contains all the parameters to send to the API endpoint +for the storage service deliver hints post operation typically these are written to a http.Request +*/ +type StorageServiceDeliverHintsPostParams struct { + + /*Host + The host name + + */ + Host string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service deliver hints post params +func (o *StorageServiceDeliverHintsPostParams) WithTimeout(timeout time.Duration) *StorageServiceDeliverHintsPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service deliver hints post params +func (o *StorageServiceDeliverHintsPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service deliver hints post params +func (o *StorageServiceDeliverHintsPostParams) WithContext(ctx context.Context) *StorageServiceDeliverHintsPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service deliver hints post params +func (o *StorageServiceDeliverHintsPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service deliver hints post params +func (o *StorageServiceDeliverHintsPostParams) WithHTTPClient(client *http.Client) *StorageServiceDeliverHintsPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service deliver hints post params +func (o *StorageServiceDeliverHintsPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithHost adds the host to the storage service deliver hints post params +func (o *StorageServiceDeliverHintsPostParams) WithHost(host string) *StorageServiceDeliverHintsPostParams { + o.SetHost(host) + return o +} + +// SetHost adds the host to the storage service deliver hints post params +func (o *StorageServiceDeliverHintsPostParams) SetHost(host string) { + o.Host = host +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceDeliverHintsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param host + qrHost := o.Host + qHost := qrHost + if qHost != "" { + if err := r.SetQueryParam("host", qHost); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_deliver_hints_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_deliver_hints_post_responses.go new file mode 100644 index 0000000000..532f57b269 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_deliver_hints_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceDeliverHintsPostReader is a Reader for the StorageServiceDeliverHintsPost structure. +type StorageServiceDeliverHintsPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceDeliverHintsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceDeliverHintsPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceDeliverHintsPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceDeliverHintsPostOK creates a StorageServiceDeliverHintsPostOK with default headers values +func NewStorageServiceDeliverHintsPostOK() *StorageServiceDeliverHintsPostOK { + return &StorageServiceDeliverHintsPostOK{} +} + +/* +StorageServiceDeliverHintsPostOK handles this case with default header values. + +Success +*/ +type StorageServiceDeliverHintsPostOK struct { +} + +func (o *StorageServiceDeliverHintsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceDeliverHintsPostDefault creates a StorageServiceDeliverHintsPostDefault with default headers values +func NewStorageServiceDeliverHintsPostDefault(code int) *StorageServiceDeliverHintsPostDefault { + return &StorageServiceDeliverHintsPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceDeliverHintsPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceDeliverHintsPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service deliver hints post default response +func (o *StorageServiceDeliverHintsPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceDeliverHintsPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceDeliverHintsPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceDeliverHintsPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_describe_ring_by_keyspace_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_describe_ring_by_keyspace_get_parameters.go new file mode 100644 index 0000000000..bc75e1b35c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_describe_ring_by_keyspace_get_parameters.go @@ -0,0 +1,168 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceDescribeRingByKeyspaceGetParams creates a new StorageServiceDescribeRingByKeyspaceGetParams object +// with the default values initialized. +func NewStorageServiceDescribeRingByKeyspaceGetParams() *StorageServiceDescribeRingByKeyspaceGetParams { + var () + return &StorageServiceDescribeRingByKeyspaceGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceDescribeRingByKeyspaceGetParamsWithTimeout creates a new StorageServiceDescribeRingByKeyspaceGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceDescribeRingByKeyspaceGetParamsWithTimeout(timeout time.Duration) *StorageServiceDescribeRingByKeyspaceGetParams { + var () + return &StorageServiceDescribeRingByKeyspaceGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceDescribeRingByKeyspaceGetParamsWithContext creates a new StorageServiceDescribeRingByKeyspaceGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceDescribeRingByKeyspaceGetParamsWithContext(ctx context.Context) *StorageServiceDescribeRingByKeyspaceGetParams { + var () + return &StorageServiceDescribeRingByKeyspaceGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceDescribeRingByKeyspaceGetParamsWithHTTPClient creates a new StorageServiceDescribeRingByKeyspaceGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceDescribeRingByKeyspaceGetParamsWithHTTPClient(client *http.Client) *StorageServiceDescribeRingByKeyspaceGetParams { + var () + return &StorageServiceDescribeRingByKeyspaceGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceDescribeRingByKeyspaceGetParams contains all the parameters to send to the API endpoint +for the storage service describe ring by keyspace get operation typically these are written to a http.Request +*/ +type StorageServiceDescribeRingByKeyspaceGetParams struct { + + /*Keyspace + The keyspace to fetch information about + + */ + Keyspace string + /*Table + The name of table to fetch information about + + */ + Table *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service describe ring by keyspace get params +func (o *StorageServiceDescribeRingByKeyspaceGetParams) WithTimeout(timeout time.Duration) *StorageServiceDescribeRingByKeyspaceGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service describe ring by keyspace get params +func (o *StorageServiceDescribeRingByKeyspaceGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service describe ring by keyspace get params +func (o *StorageServiceDescribeRingByKeyspaceGetParams) WithContext(ctx context.Context) *StorageServiceDescribeRingByKeyspaceGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service describe ring by keyspace get params +func (o *StorageServiceDescribeRingByKeyspaceGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service describe ring by keyspace get params +func (o *StorageServiceDescribeRingByKeyspaceGetParams) WithHTTPClient(client *http.Client) *StorageServiceDescribeRingByKeyspaceGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service describe ring by keyspace get params +func (o *StorageServiceDescribeRingByKeyspaceGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithKeyspace adds the keyspace to the storage service describe ring by keyspace get params +func (o *StorageServiceDescribeRingByKeyspaceGetParams) WithKeyspace(keyspace string) *StorageServiceDescribeRingByKeyspaceGetParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service describe ring by keyspace get params +func (o *StorageServiceDescribeRingByKeyspaceGetParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WithTable adds the table to the storage service describe ring by keyspace get params +func (o *StorageServiceDescribeRingByKeyspaceGetParams) WithTable(table *string) *StorageServiceDescribeRingByKeyspaceGetParams { + o.SetTable(table) + return o +} + +// SetTable adds the table to the storage service describe ring by keyspace get params +func (o *StorageServiceDescribeRingByKeyspaceGetParams) SetTable(table *string) { + o.Table = table +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceDescribeRingByKeyspaceGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if o.Table != nil { + + // query param table + var qrTable string + if o.Table != nil { + qrTable = *o.Table + } + qTable := qrTable + if qTable != "" { + if err := r.SetQueryParam("table", qTable); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_describe_ring_by_keyspace_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_describe_ring_by_keyspace_get_responses.go new file mode 100644 index 0000000000..a414363a07 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_describe_ring_by_keyspace_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceDescribeRingByKeyspaceGetReader is a Reader for the StorageServiceDescribeRingByKeyspaceGet structure. +type StorageServiceDescribeRingByKeyspaceGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceDescribeRingByKeyspaceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceDescribeRingByKeyspaceGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceDescribeRingByKeyspaceGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceDescribeRingByKeyspaceGetOK creates a StorageServiceDescribeRingByKeyspaceGetOK with default headers values +func NewStorageServiceDescribeRingByKeyspaceGetOK() *StorageServiceDescribeRingByKeyspaceGetOK { + return &StorageServiceDescribeRingByKeyspaceGetOK{} +} + +/* +StorageServiceDescribeRingByKeyspaceGetOK handles this case with default header values. + +Success +*/ +type StorageServiceDescribeRingByKeyspaceGetOK struct { + Payload []*models.TokenRange +} + +func (o *StorageServiceDescribeRingByKeyspaceGetOK) GetPayload() []*models.TokenRange { + return o.Payload +} + +func (o *StorageServiceDescribeRingByKeyspaceGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceDescribeRingByKeyspaceGetDefault creates a StorageServiceDescribeRingByKeyspaceGetDefault with default headers values +func NewStorageServiceDescribeRingByKeyspaceGetDefault(code int) *StorageServiceDescribeRingByKeyspaceGetDefault { + return &StorageServiceDescribeRingByKeyspaceGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceDescribeRingByKeyspaceGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceDescribeRingByKeyspaceGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service describe ring by keyspace get default response +func (o *StorageServiceDescribeRingByKeyspaceGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceDescribeRingByKeyspaceGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceDescribeRingByKeyspaceGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceDescribeRingByKeyspaceGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_drain_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_drain_get_parameters.go new file mode 100644 index 0000000000..ad399d765a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_drain_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceDrainGetParams creates a new StorageServiceDrainGetParams object +// with the default values initialized. +func NewStorageServiceDrainGetParams() *StorageServiceDrainGetParams { + + return &StorageServiceDrainGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceDrainGetParamsWithTimeout creates a new StorageServiceDrainGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceDrainGetParamsWithTimeout(timeout time.Duration) *StorageServiceDrainGetParams { + + return &StorageServiceDrainGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceDrainGetParamsWithContext creates a new StorageServiceDrainGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceDrainGetParamsWithContext(ctx context.Context) *StorageServiceDrainGetParams { + + return &StorageServiceDrainGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceDrainGetParamsWithHTTPClient creates a new StorageServiceDrainGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceDrainGetParamsWithHTTPClient(client *http.Client) *StorageServiceDrainGetParams { + + return &StorageServiceDrainGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceDrainGetParams contains all the parameters to send to the API endpoint +for the storage service drain get operation typically these are written to a http.Request +*/ +type StorageServiceDrainGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service drain get params +func (o *StorageServiceDrainGetParams) WithTimeout(timeout time.Duration) *StorageServiceDrainGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service drain get params +func (o *StorageServiceDrainGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service drain get params +func (o *StorageServiceDrainGetParams) WithContext(ctx context.Context) *StorageServiceDrainGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service drain get params +func (o *StorageServiceDrainGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service drain get params +func (o *StorageServiceDrainGetParams) WithHTTPClient(client *http.Client) *StorageServiceDrainGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service drain get params +func (o *StorageServiceDrainGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceDrainGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_drain_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_drain_get_responses.go new file mode 100644 index 0000000000..92f5ba8c9a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_drain_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceDrainGetReader is a Reader for the StorageServiceDrainGet structure. +type StorageServiceDrainGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceDrainGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceDrainGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceDrainGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceDrainGetOK creates a StorageServiceDrainGetOK with default headers values +func NewStorageServiceDrainGetOK() *StorageServiceDrainGetOK { + return &StorageServiceDrainGetOK{} +} + +/* +StorageServiceDrainGetOK handles this case with default header values. + +Success +*/ +type StorageServiceDrainGetOK struct { + Payload string +} + +func (o *StorageServiceDrainGetOK) GetPayload() string { + return o.Payload +} + +func (o *StorageServiceDrainGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceDrainGetDefault creates a StorageServiceDrainGetDefault with default headers values +func NewStorageServiceDrainGetDefault(code int) *StorageServiceDrainGetDefault { + return &StorageServiceDrainGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceDrainGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceDrainGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service drain get default response +func (o *StorageServiceDrainGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceDrainGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceDrainGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceDrainGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_drain_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_drain_post_parameters.go new file mode 100644 index 0000000000..b9530a13ad --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_drain_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceDrainPostParams creates a new StorageServiceDrainPostParams object +// with the default values initialized. +func NewStorageServiceDrainPostParams() *StorageServiceDrainPostParams { + + return &StorageServiceDrainPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceDrainPostParamsWithTimeout creates a new StorageServiceDrainPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceDrainPostParamsWithTimeout(timeout time.Duration) *StorageServiceDrainPostParams { + + return &StorageServiceDrainPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceDrainPostParamsWithContext creates a new StorageServiceDrainPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceDrainPostParamsWithContext(ctx context.Context) *StorageServiceDrainPostParams { + + return &StorageServiceDrainPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceDrainPostParamsWithHTTPClient creates a new StorageServiceDrainPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceDrainPostParamsWithHTTPClient(client *http.Client) *StorageServiceDrainPostParams { + + return &StorageServiceDrainPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceDrainPostParams contains all the parameters to send to the API endpoint +for the storage service drain post operation typically these are written to a http.Request +*/ +type StorageServiceDrainPostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service drain post params +func (o *StorageServiceDrainPostParams) WithTimeout(timeout time.Duration) *StorageServiceDrainPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service drain post params +func (o *StorageServiceDrainPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service drain post params +func (o *StorageServiceDrainPostParams) WithContext(ctx context.Context) *StorageServiceDrainPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service drain post params +func (o *StorageServiceDrainPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service drain post params +func (o *StorageServiceDrainPostParams) WithHTTPClient(client *http.Client) *StorageServiceDrainPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service drain post params +func (o *StorageServiceDrainPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceDrainPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_drain_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_drain_post_responses.go new file mode 100644 index 0000000000..7110764f8e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_drain_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceDrainPostReader is a Reader for the StorageServiceDrainPost structure. +type StorageServiceDrainPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceDrainPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceDrainPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceDrainPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceDrainPostOK creates a StorageServiceDrainPostOK with default headers values +func NewStorageServiceDrainPostOK() *StorageServiceDrainPostOK { + return &StorageServiceDrainPostOK{} +} + +/* +StorageServiceDrainPostOK handles this case with default header values. + +Success +*/ +type StorageServiceDrainPostOK struct { +} + +func (o *StorageServiceDrainPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceDrainPostDefault creates a StorageServiceDrainPostDefault with default headers values +func NewStorageServiceDrainPostDefault(code int) *StorageServiceDrainPostDefault { + return &StorageServiceDrainPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceDrainPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceDrainPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service drain post default response +func (o *StorageServiceDrainPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceDrainPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceDrainPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceDrainPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_remove_completion_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_remove_completion_post_parameters.go new file mode 100644 index 0000000000..3f884d29d5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_remove_completion_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceForceRemoveCompletionPostParams creates a new StorageServiceForceRemoveCompletionPostParams object +// with the default values initialized. +func NewStorageServiceForceRemoveCompletionPostParams() *StorageServiceForceRemoveCompletionPostParams { + + return &StorageServiceForceRemoveCompletionPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceForceRemoveCompletionPostParamsWithTimeout creates a new StorageServiceForceRemoveCompletionPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceForceRemoveCompletionPostParamsWithTimeout(timeout time.Duration) *StorageServiceForceRemoveCompletionPostParams { + + return &StorageServiceForceRemoveCompletionPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceForceRemoveCompletionPostParamsWithContext creates a new StorageServiceForceRemoveCompletionPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceForceRemoveCompletionPostParamsWithContext(ctx context.Context) *StorageServiceForceRemoveCompletionPostParams { + + return &StorageServiceForceRemoveCompletionPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceForceRemoveCompletionPostParamsWithHTTPClient creates a new StorageServiceForceRemoveCompletionPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceForceRemoveCompletionPostParamsWithHTTPClient(client *http.Client) *StorageServiceForceRemoveCompletionPostParams { + + return &StorageServiceForceRemoveCompletionPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceForceRemoveCompletionPostParams contains all the parameters to send to the API endpoint +for the storage service force remove completion post operation typically these are written to a http.Request +*/ +type StorageServiceForceRemoveCompletionPostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service force remove completion post params +func (o *StorageServiceForceRemoveCompletionPostParams) WithTimeout(timeout time.Duration) *StorageServiceForceRemoveCompletionPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service force remove completion post params +func (o *StorageServiceForceRemoveCompletionPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service force remove completion post params +func (o *StorageServiceForceRemoveCompletionPostParams) WithContext(ctx context.Context) *StorageServiceForceRemoveCompletionPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service force remove completion post params +func (o *StorageServiceForceRemoveCompletionPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service force remove completion post params +func (o *StorageServiceForceRemoveCompletionPostParams) WithHTTPClient(client *http.Client) *StorageServiceForceRemoveCompletionPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service force remove completion post params +func (o *StorageServiceForceRemoveCompletionPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceForceRemoveCompletionPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_remove_completion_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_remove_completion_post_responses.go new file mode 100644 index 0000000000..c544ee2e60 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_remove_completion_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceForceRemoveCompletionPostReader is a Reader for the StorageServiceForceRemoveCompletionPost structure. +type StorageServiceForceRemoveCompletionPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceForceRemoveCompletionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceForceRemoveCompletionPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceForceRemoveCompletionPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceForceRemoveCompletionPostOK creates a StorageServiceForceRemoveCompletionPostOK with default headers values +func NewStorageServiceForceRemoveCompletionPostOK() *StorageServiceForceRemoveCompletionPostOK { + return &StorageServiceForceRemoveCompletionPostOK{} +} + +/* +StorageServiceForceRemoveCompletionPostOK handles this case with default header values. + +Success +*/ +type StorageServiceForceRemoveCompletionPostOK struct { +} + +func (o *StorageServiceForceRemoveCompletionPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceForceRemoveCompletionPostDefault creates a StorageServiceForceRemoveCompletionPostDefault with default headers values +func NewStorageServiceForceRemoveCompletionPostDefault(code int) *StorageServiceForceRemoveCompletionPostDefault { + return &StorageServiceForceRemoveCompletionPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceForceRemoveCompletionPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceForceRemoveCompletionPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service force remove completion post default response +func (o *StorageServiceForceRemoveCompletionPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceForceRemoveCompletionPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceForceRemoveCompletionPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceForceRemoveCompletionPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_terminate_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_terminate_post_parameters.go new file mode 100644 index 0000000000..6cf8db11c7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_terminate_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceForceTerminatePostParams creates a new StorageServiceForceTerminatePostParams object +// with the default values initialized. +func NewStorageServiceForceTerminatePostParams() *StorageServiceForceTerminatePostParams { + + return &StorageServiceForceTerminatePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceForceTerminatePostParamsWithTimeout creates a new StorageServiceForceTerminatePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceForceTerminatePostParamsWithTimeout(timeout time.Duration) *StorageServiceForceTerminatePostParams { + + return &StorageServiceForceTerminatePostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceForceTerminatePostParamsWithContext creates a new StorageServiceForceTerminatePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceForceTerminatePostParamsWithContext(ctx context.Context) *StorageServiceForceTerminatePostParams { + + return &StorageServiceForceTerminatePostParams{ + + Context: ctx, + } +} + +// NewStorageServiceForceTerminatePostParamsWithHTTPClient creates a new StorageServiceForceTerminatePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceForceTerminatePostParamsWithHTTPClient(client *http.Client) *StorageServiceForceTerminatePostParams { + + return &StorageServiceForceTerminatePostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceForceTerminatePostParams contains all the parameters to send to the API endpoint +for the storage service force terminate post operation typically these are written to a http.Request +*/ +type StorageServiceForceTerminatePostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service force terminate post params +func (o *StorageServiceForceTerminatePostParams) WithTimeout(timeout time.Duration) *StorageServiceForceTerminatePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service force terminate post params +func (o *StorageServiceForceTerminatePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service force terminate post params +func (o *StorageServiceForceTerminatePostParams) WithContext(ctx context.Context) *StorageServiceForceTerminatePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service force terminate post params +func (o *StorageServiceForceTerminatePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service force terminate post params +func (o *StorageServiceForceTerminatePostParams) WithHTTPClient(client *http.Client) *StorageServiceForceTerminatePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service force terminate post params +func (o *StorageServiceForceTerminatePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceForceTerminatePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_terminate_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_terminate_post_responses.go new file mode 100644 index 0000000000..69ec350b60 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_terminate_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceForceTerminatePostReader is a Reader for the StorageServiceForceTerminatePost structure. +type StorageServiceForceTerminatePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceForceTerminatePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceForceTerminatePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceForceTerminatePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceForceTerminatePostOK creates a StorageServiceForceTerminatePostOK with default headers values +func NewStorageServiceForceTerminatePostOK() *StorageServiceForceTerminatePostOK { + return &StorageServiceForceTerminatePostOK{} +} + +/* +StorageServiceForceTerminatePostOK handles this case with default header values. + +Success +*/ +type StorageServiceForceTerminatePostOK struct { +} + +func (o *StorageServiceForceTerminatePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceForceTerminatePostDefault creates a StorageServiceForceTerminatePostDefault with default headers values +func NewStorageServiceForceTerminatePostDefault(code int) *StorageServiceForceTerminatePostDefault { + return &StorageServiceForceTerminatePostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceForceTerminatePostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceForceTerminatePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service force terminate post default response +func (o *StorageServiceForceTerminatePostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceForceTerminatePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceForceTerminatePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceForceTerminatePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_terminate_repair_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_terminate_repair_post_parameters.go new file mode 100644 index 0000000000..73a0fe37bd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_terminate_repair_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceForceTerminateRepairPostParams creates a new StorageServiceForceTerminateRepairPostParams object +// with the default values initialized. +func NewStorageServiceForceTerminateRepairPostParams() *StorageServiceForceTerminateRepairPostParams { + + return &StorageServiceForceTerminateRepairPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceForceTerminateRepairPostParamsWithTimeout creates a new StorageServiceForceTerminateRepairPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceForceTerminateRepairPostParamsWithTimeout(timeout time.Duration) *StorageServiceForceTerminateRepairPostParams { + + return &StorageServiceForceTerminateRepairPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceForceTerminateRepairPostParamsWithContext creates a new StorageServiceForceTerminateRepairPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceForceTerminateRepairPostParamsWithContext(ctx context.Context) *StorageServiceForceTerminateRepairPostParams { + + return &StorageServiceForceTerminateRepairPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceForceTerminateRepairPostParamsWithHTTPClient creates a new StorageServiceForceTerminateRepairPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceForceTerminateRepairPostParamsWithHTTPClient(client *http.Client) *StorageServiceForceTerminateRepairPostParams { + + return &StorageServiceForceTerminateRepairPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceForceTerminateRepairPostParams contains all the parameters to send to the API endpoint +for the storage service force terminate repair post operation typically these are written to a http.Request +*/ +type StorageServiceForceTerminateRepairPostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service force terminate repair post params +func (o *StorageServiceForceTerminateRepairPostParams) WithTimeout(timeout time.Duration) *StorageServiceForceTerminateRepairPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service force terminate repair post params +func (o *StorageServiceForceTerminateRepairPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service force terminate repair post params +func (o *StorageServiceForceTerminateRepairPostParams) WithContext(ctx context.Context) *StorageServiceForceTerminateRepairPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service force terminate repair post params +func (o *StorageServiceForceTerminateRepairPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service force terminate repair post params +func (o *StorageServiceForceTerminateRepairPostParams) WithHTTPClient(client *http.Client) *StorageServiceForceTerminateRepairPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service force terminate repair post params +func (o *StorageServiceForceTerminateRepairPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceForceTerminateRepairPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_terminate_repair_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_terminate_repair_post_responses.go new file mode 100644 index 0000000000..b16ed6a377 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_force_terminate_repair_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceForceTerminateRepairPostReader is a Reader for the StorageServiceForceTerminateRepairPost structure. +type StorageServiceForceTerminateRepairPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceForceTerminateRepairPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceForceTerminateRepairPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceForceTerminateRepairPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceForceTerminateRepairPostOK creates a StorageServiceForceTerminateRepairPostOK with default headers values +func NewStorageServiceForceTerminateRepairPostOK() *StorageServiceForceTerminateRepairPostOK { + return &StorageServiceForceTerminateRepairPostOK{} +} + +/* +StorageServiceForceTerminateRepairPostOK handles this case with default header values. + +Success +*/ +type StorageServiceForceTerminateRepairPostOK struct { +} + +func (o *StorageServiceForceTerminateRepairPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceForceTerminateRepairPostDefault creates a StorageServiceForceTerminateRepairPostDefault with default headers values +func NewStorageServiceForceTerminateRepairPostDefault(code int) *StorageServiceForceTerminateRepairPostDefault { + return &StorageServiceForceTerminateRepairPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceForceTerminateRepairPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceForceTerminateRepairPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service force terminate repair post default response +func (o *StorageServiceForceTerminateRepairPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceForceTerminateRepairPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceForceTerminateRepairPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceForceTerminateRepairPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_generation_number_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_generation_number_get_parameters.go new file mode 100644 index 0000000000..60248d2e0a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_generation_number_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceGenerationNumberGetParams creates a new StorageServiceGenerationNumberGetParams object +// with the default values initialized. +func NewStorageServiceGenerationNumberGetParams() *StorageServiceGenerationNumberGetParams { + + return &StorageServiceGenerationNumberGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceGenerationNumberGetParamsWithTimeout creates a new StorageServiceGenerationNumberGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceGenerationNumberGetParamsWithTimeout(timeout time.Duration) *StorageServiceGenerationNumberGetParams { + + return &StorageServiceGenerationNumberGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceGenerationNumberGetParamsWithContext creates a new StorageServiceGenerationNumberGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceGenerationNumberGetParamsWithContext(ctx context.Context) *StorageServiceGenerationNumberGetParams { + + return &StorageServiceGenerationNumberGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceGenerationNumberGetParamsWithHTTPClient creates a new StorageServiceGenerationNumberGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceGenerationNumberGetParamsWithHTTPClient(client *http.Client) *StorageServiceGenerationNumberGetParams { + + return &StorageServiceGenerationNumberGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceGenerationNumberGetParams contains all the parameters to send to the API endpoint +for the storage service generation number get operation typically these are written to a http.Request +*/ +type StorageServiceGenerationNumberGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service generation number get params +func (o *StorageServiceGenerationNumberGetParams) WithTimeout(timeout time.Duration) *StorageServiceGenerationNumberGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service generation number get params +func (o *StorageServiceGenerationNumberGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service generation number get params +func (o *StorageServiceGenerationNumberGetParams) WithContext(ctx context.Context) *StorageServiceGenerationNumberGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service generation number get params +func (o *StorageServiceGenerationNumberGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service generation number get params +func (o *StorageServiceGenerationNumberGetParams) WithHTTPClient(client *http.Client) *StorageServiceGenerationNumberGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service generation number get params +func (o *StorageServiceGenerationNumberGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceGenerationNumberGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_generation_number_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_generation_number_get_responses.go new file mode 100644 index 0000000000..048da44a17 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_generation_number_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceGenerationNumberGetReader is a Reader for the StorageServiceGenerationNumberGet structure. +type StorageServiceGenerationNumberGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceGenerationNumberGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceGenerationNumberGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceGenerationNumberGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceGenerationNumberGetOK creates a StorageServiceGenerationNumberGetOK with default headers values +func NewStorageServiceGenerationNumberGetOK() *StorageServiceGenerationNumberGetOK { + return &StorageServiceGenerationNumberGetOK{} +} + +/* +StorageServiceGenerationNumberGetOK handles this case with default header values. + +Success +*/ +type StorageServiceGenerationNumberGetOK struct { + Payload int32 +} + +func (o *StorageServiceGenerationNumberGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageServiceGenerationNumberGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceGenerationNumberGetDefault creates a StorageServiceGenerationNumberGetDefault with default headers values +func NewStorageServiceGenerationNumberGetDefault(code int) *StorageServiceGenerationNumberGetDefault { + return &StorageServiceGenerationNumberGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceGenerationNumberGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceGenerationNumberGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service generation number get default response +func (o *StorageServiceGenerationNumberGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceGenerationNumberGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceGenerationNumberGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceGenerationNumberGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_delete_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_delete_parameters.go new file mode 100644 index 0000000000..d78ce43d52 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_delete_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceGossipingDeleteParams creates a new StorageServiceGossipingDeleteParams object +// with the default values initialized. +func NewStorageServiceGossipingDeleteParams() *StorageServiceGossipingDeleteParams { + + return &StorageServiceGossipingDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceGossipingDeleteParamsWithTimeout creates a new StorageServiceGossipingDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceGossipingDeleteParamsWithTimeout(timeout time.Duration) *StorageServiceGossipingDeleteParams { + + return &StorageServiceGossipingDeleteParams{ + + timeout: timeout, + } +} + +// NewStorageServiceGossipingDeleteParamsWithContext creates a new StorageServiceGossipingDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceGossipingDeleteParamsWithContext(ctx context.Context) *StorageServiceGossipingDeleteParams { + + return &StorageServiceGossipingDeleteParams{ + + Context: ctx, + } +} + +// NewStorageServiceGossipingDeleteParamsWithHTTPClient creates a new StorageServiceGossipingDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceGossipingDeleteParamsWithHTTPClient(client *http.Client) *StorageServiceGossipingDeleteParams { + + return &StorageServiceGossipingDeleteParams{ + HTTPClient: client, + } +} + +/* +StorageServiceGossipingDeleteParams contains all the parameters to send to the API endpoint +for the storage service gossiping delete operation typically these are written to a http.Request +*/ +type StorageServiceGossipingDeleteParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service gossiping delete params +func (o *StorageServiceGossipingDeleteParams) WithTimeout(timeout time.Duration) *StorageServiceGossipingDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service gossiping delete params +func (o *StorageServiceGossipingDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service gossiping delete params +func (o *StorageServiceGossipingDeleteParams) WithContext(ctx context.Context) *StorageServiceGossipingDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service gossiping delete params +func (o *StorageServiceGossipingDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service gossiping delete params +func (o *StorageServiceGossipingDeleteParams) WithHTTPClient(client *http.Client) *StorageServiceGossipingDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service gossiping delete params +func (o *StorageServiceGossipingDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceGossipingDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_delete_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_delete_responses.go new file mode 100644 index 0000000000..739ab09329 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_delete_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceGossipingDeleteReader is a Reader for the StorageServiceGossipingDelete structure. +type StorageServiceGossipingDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceGossipingDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceGossipingDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceGossipingDeleteDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceGossipingDeleteOK creates a StorageServiceGossipingDeleteOK with default headers values +func NewStorageServiceGossipingDeleteOK() *StorageServiceGossipingDeleteOK { + return &StorageServiceGossipingDeleteOK{} +} + +/* +StorageServiceGossipingDeleteOK handles this case with default header values. + +Success +*/ +type StorageServiceGossipingDeleteOK struct { +} + +func (o *StorageServiceGossipingDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceGossipingDeleteDefault creates a StorageServiceGossipingDeleteDefault with default headers values +func NewStorageServiceGossipingDeleteDefault(code int) *StorageServiceGossipingDeleteDefault { + return &StorageServiceGossipingDeleteDefault{ + _statusCode: code, + } +} + +/* +StorageServiceGossipingDeleteDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceGossipingDeleteDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service gossiping delete default response +func (o *StorageServiceGossipingDeleteDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceGossipingDeleteDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceGossipingDeleteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceGossipingDeleteDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_get_parameters.go new file mode 100644 index 0000000000..b1c6b4ab3a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceGossipingGetParams creates a new StorageServiceGossipingGetParams object +// with the default values initialized. +func NewStorageServiceGossipingGetParams() *StorageServiceGossipingGetParams { + + return &StorageServiceGossipingGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceGossipingGetParamsWithTimeout creates a new StorageServiceGossipingGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceGossipingGetParamsWithTimeout(timeout time.Duration) *StorageServiceGossipingGetParams { + + return &StorageServiceGossipingGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceGossipingGetParamsWithContext creates a new StorageServiceGossipingGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceGossipingGetParamsWithContext(ctx context.Context) *StorageServiceGossipingGetParams { + + return &StorageServiceGossipingGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceGossipingGetParamsWithHTTPClient creates a new StorageServiceGossipingGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceGossipingGetParamsWithHTTPClient(client *http.Client) *StorageServiceGossipingGetParams { + + return &StorageServiceGossipingGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceGossipingGetParams contains all the parameters to send to the API endpoint +for the storage service gossiping get operation typically these are written to a http.Request +*/ +type StorageServiceGossipingGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service gossiping get params +func (o *StorageServiceGossipingGetParams) WithTimeout(timeout time.Duration) *StorageServiceGossipingGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service gossiping get params +func (o *StorageServiceGossipingGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service gossiping get params +func (o *StorageServiceGossipingGetParams) WithContext(ctx context.Context) *StorageServiceGossipingGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service gossiping get params +func (o *StorageServiceGossipingGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service gossiping get params +func (o *StorageServiceGossipingGetParams) WithHTTPClient(client *http.Client) *StorageServiceGossipingGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service gossiping get params +func (o *StorageServiceGossipingGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceGossipingGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_get_responses.go new file mode 100644 index 0000000000..a217427569 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceGossipingGetReader is a Reader for the StorageServiceGossipingGet structure. +type StorageServiceGossipingGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceGossipingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceGossipingGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceGossipingGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceGossipingGetOK creates a StorageServiceGossipingGetOK with default headers values +func NewStorageServiceGossipingGetOK() *StorageServiceGossipingGetOK { + return &StorageServiceGossipingGetOK{} +} + +/* +StorageServiceGossipingGetOK handles this case with default header values. + +Success +*/ +type StorageServiceGossipingGetOK struct { + Payload bool +} + +func (o *StorageServiceGossipingGetOK) GetPayload() bool { + return o.Payload +} + +func (o *StorageServiceGossipingGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceGossipingGetDefault creates a StorageServiceGossipingGetDefault with default headers values +func NewStorageServiceGossipingGetDefault(code int) *StorageServiceGossipingGetDefault { + return &StorageServiceGossipingGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceGossipingGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceGossipingGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service gossiping get default response +func (o *StorageServiceGossipingGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceGossipingGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceGossipingGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceGossipingGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_post_parameters.go new file mode 100644 index 0000000000..e03284b05e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceGossipingPostParams creates a new StorageServiceGossipingPostParams object +// with the default values initialized. +func NewStorageServiceGossipingPostParams() *StorageServiceGossipingPostParams { + + return &StorageServiceGossipingPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceGossipingPostParamsWithTimeout creates a new StorageServiceGossipingPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceGossipingPostParamsWithTimeout(timeout time.Duration) *StorageServiceGossipingPostParams { + + return &StorageServiceGossipingPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceGossipingPostParamsWithContext creates a new StorageServiceGossipingPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceGossipingPostParamsWithContext(ctx context.Context) *StorageServiceGossipingPostParams { + + return &StorageServiceGossipingPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceGossipingPostParamsWithHTTPClient creates a new StorageServiceGossipingPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceGossipingPostParamsWithHTTPClient(client *http.Client) *StorageServiceGossipingPostParams { + + return &StorageServiceGossipingPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceGossipingPostParams contains all the parameters to send to the API endpoint +for the storage service gossiping post operation typically these are written to a http.Request +*/ +type StorageServiceGossipingPostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service gossiping post params +func (o *StorageServiceGossipingPostParams) WithTimeout(timeout time.Duration) *StorageServiceGossipingPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service gossiping post params +func (o *StorageServiceGossipingPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service gossiping post params +func (o *StorageServiceGossipingPostParams) WithContext(ctx context.Context) *StorageServiceGossipingPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service gossiping post params +func (o *StorageServiceGossipingPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service gossiping post params +func (o *StorageServiceGossipingPostParams) WithHTTPClient(client *http.Client) *StorageServiceGossipingPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service gossiping post params +func (o *StorageServiceGossipingPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceGossipingPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_post_responses.go new file mode 100644 index 0000000000..83b134204f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_gossiping_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceGossipingPostReader is a Reader for the StorageServiceGossipingPost structure. +type StorageServiceGossipingPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceGossipingPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceGossipingPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceGossipingPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceGossipingPostOK creates a StorageServiceGossipingPostOK with default headers values +func NewStorageServiceGossipingPostOK() *StorageServiceGossipingPostOK { + return &StorageServiceGossipingPostOK{} +} + +/* +StorageServiceGossipingPostOK handles this case with default header values. + +Success +*/ +type StorageServiceGossipingPostOK struct { +} + +func (o *StorageServiceGossipingPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceGossipingPostDefault creates a StorageServiceGossipingPostDefault with default headers values +func NewStorageServiceGossipingPostDefault(code int) *StorageServiceGossipingPostDefault { + return &StorageServiceGossipingPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceGossipingPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceGossipingPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service gossiping post default response +func (o *StorageServiceGossipingPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceGossipingPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceGossipingPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceGossipingPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_hinted_handoff_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_hinted_handoff_post_parameters.go new file mode 100644 index 0000000000..ee72e071c3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_hinted_handoff_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceHintedHandoffPostParams creates a new StorageServiceHintedHandoffPostParams object +// with the default values initialized. +func NewStorageServiceHintedHandoffPostParams() *StorageServiceHintedHandoffPostParams { + var () + return &StorageServiceHintedHandoffPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceHintedHandoffPostParamsWithTimeout creates a new StorageServiceHintedHandoffPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceHintedHandoffPostParamsWithTimeout(timeout time.Duration) *StorageServiceHintedHandoffPostParams { + var () + return &StorageServiceHintedHandoffPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceHintedHandoffPostParamsWithContext creates a new StorageServiceHintedHandoffPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceHintedHandoffPostParamsWithContext(ctx context.Context) *StorageServiceHintedHandoffPostParams { + var () + return &StorageServiceHintedHandoffPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceHintedHandoffPostParamsWithHTTPClient creates a new StorageServiceHintedHandoffPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceHintedHandoffPostParamsWithHTTPClient(client *http.Client) *StorageServiceHintedHandoffPostParams { + var () + return &StorageServiceHintedHandoffPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceHintedHandoffPostParams contains all the parameters to send to the API endpoint +for the storage service hinted handoff post operation typically these are written to a http.Request +*/ +type StorageServiceHintedHandoffPostParams struct { + + /*Throttle + throttle in kb + + */ + Throttle int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service hinted handoff post params +func (o *StorageServiceHintedHandoffPostParams) WithTimeout(timeout time.Duration) *StorageServiceHintedHandoffPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service hinted handoff post params +func (o *StorageServiceHintedHandoffPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service hinted handoff post params +func (o *StorageServiceHintedHandoffPostParams) WithContext(ctx context.Context) *StorageServiceHintedHandoffPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service hinted handoff post params +func (o *StorageServiceHintedHandoffPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service hinted handoff post params +func (o *StorageServiceHintedHandoffPostParams) WithHTTPClient(client *http.Client) *StorageServiceHintedHandoffPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service hinted handoff post params +func (o *StorageServiceHintedHandoffPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithThrottle adds the throttle to the storage service hinted handoff post params +func (o *StorageServiceHintedHandoffPostParams) WithThrottle(throttle int32) *StorageServiceHintedHandoffPostParams { + o.SetThrottle(throttle) + return o +} + +// SetThrottle adds the throttle to the storage service hinted handoff post params +func (o *StorageServiceHintedHandoffPostParams) SetThrottle(throttle int32) { + o.Throttle = throttle +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceHintedHandoffPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param throttle + qrThrottle := o.Throttle + qThrottle := swag.FormatInt32(qrThrottle) + if qThrottle != "" { + if err := r.SetQueryParam("throttle", qThrottle); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_hinted_handoff_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_hinted_handoff_post_responses.go new file mode 100644 index 0000000000..8da55314bf --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_hinted_handoff_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceHintedHandoffPostReader is a Reader for the StorageServiceHintedHandoffPost structure. +type StorageServiceHintedHandoffPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceHintedHandoffPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceHintedHandoffPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceHintedHandoffPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceHintedHandoffPostOK creates a StorageServiceHintedHandoffPostOK with default headers values +func NewStorageServiceHintedHandoffPostOK() *StorageServiceHintedHandoffPostOK { + return &StorageServiceHintedHandoffPostOK{} +} + +/* +StorageServiceHintedHandoffPostOK handles this case with default header values. + +Success +*/ +type StorageServiceHintedHandoffPostOK struct { +} + +func (o *StorageServiceHintedHandoffPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceHintedHandoffPostDefault creates a StorageServiceHintedHandoffPostDefault with default headers values +func NewStorageServiceHintedHandoffPostDefault(code int) *StorageServiceHintedHandoffPostDefault { + return &StorageServiceHintedHandoffPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceHintedHandoffPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceHintedHandoffPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service hinted handoff post default response +func (o *StorageServiceHintedHandoffPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceHintedHandoffPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceHintedHandoffPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceHintedHandoffPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_host_id_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_host_id_get_parameters.go new file mode 100644 index 0000000000..58c81ef765 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_host_id_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceHostIDGetParams creates a new StorageServiceHostIDGetParams object +// with the default values initialized. +func NewStorageServiceHostIDGetParams() *StorageServiceHostIDGetParams { + + return &StorageServiceHostIDGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceHostIDGetParamsWithTimeout creates a new StorageServiceHostIDGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceHostIDGetParamsWithTimeout(timeout time.Duration) *StorageServiceHostIDGetParams { + + return &StorageServiceHostIDGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceHostIDGetParamsWithContext creates a new StorageServiceHostIDGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceHostIDGetParamsWithContext(ctx context.Context) *StorageServiceHostIDGetParams { + + return &StorageServiceHostIDGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceHostIDGetParamsWithHTTPClient creates a new StorageServiceHostIDGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceHostIDGetParamsWithHTTPClient(client *http.Client) *StorageServiceHostIDGetParams { + + return &StorageServiceHostIDGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceHostIDGetParams contains all the parameters to send to the API endpoint +for the storage service host Id get operation typically these are written to a http.Request +*/ +type StorageServiceHostIDGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service host Id get params +func (o *StorageServiceHostIDGetParams) WithTimeout(timeout time.Duration) *StorageServiceHostIDGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service host Id get params +func (o *StorageServiceHostIDGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service host Id get params +func (o *StorageServiceHostIDGetParams) WithContext(ctx context.Context) *StorageServiceHostIDGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service host Id get params +func (o *StorageServiceHostIDGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service host Id get params +func (o *StorageServiceHostIDGetParams) WithHTTPClient(client *http.Client) *StorageServiceHostIDGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service host Id get params +func (o *StorageServiceHostIDGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceHostIDGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_host_id_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_host_id_get_responses.go new file mode 100644 index 0000000000..a5daece41f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_host_id_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceHostIDGetReader is a Reader for the StorageServiceHostIDGet structure. +type StorageServiceHostIDGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceHostIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceHostIDGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceHostIDGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceHostIDGetOK creates a StorageServiceHostIDGetOK with default headers values +func NewStorageServiceHostIDGetOK() *StorageServiceHostIDGetOK { + return &StorageServiceHostIDGetOK{} +} + +/* +StorageServiceHostIDGetOK handles this case with default header values. + +Success +*/ +type StorageServiceHostIDGetOK struct { + Payload []*models.Mapper +} + +func (o *StorageServiceHostIDGetOK) GetPayload() []*models.Mapper { + return o.Payload +} + +func (o *StorageServiceHostIDGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceHostIDGetDefault creates a StorageServiceHostIDGetDefault with default headers values +func NewStorageServiceHostIDGetDefault(code int) *StorageServiceHostIDGetDefault { + return &StorageServiceHostIDGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceHostIDGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceHostIDGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service host Id get default response +func (o *StorageServiceHostIDGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceHostIDGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceHostIDGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceHostIDGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_hostid_local_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_hostid_local_get_parameters.go new file mode 100644 index 0000000000..e607fe51eb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_hostid_local_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceHostidLocalGetParams creates a new StorageServiceHostidLocalGetParams object +// with the default values initialized. +func NewStorageServiceHostidLocalGetParams() *StorageServiceHostidLocalGetParams { + + return &StorageServiceHostidLocalGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceHostidLocalGetParamsWithTimeout creates a new StorageServiceHostidLocalGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceHostidLocalGetParamsWithTimeout(timeout time.Duration) *StorageServiceHostidLocalGetParams { + + return &StorageServiceHostidLocalGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceHostidLocalGetParamsWithContext creates a new StorageServiceHostidLocalGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceHostidLocalGetParamsWithContext(ctx context.Context) *StorageServiceHostidLocalGetParams { + + return &StorageServiceHostidLocalGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceHostidLocalGetParamsWithHTTPClient creates a new StorageServiceHostidLocalGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceHostidLocalGetParamsWithHTTPClient(client *http.Client) *StorageServiceHostidLocalGetParams { + + return &StorageServiceHostidLocalGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceHostidLocalGetParams contains all the parameters to send to the API endpoint +for the storage service hostid local get operation typically these are written to a http.Request +*/ +type StorageServiceHostidLocalGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service hostid local get params +func (o *StorageServiceHostidLocalGetParams) WithTimeout(timeout time.Duration) *StorageServiceHostidLocalGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service hostid local get params +func (o *StorageServiceHostidLocalGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service hostid local get params +func (o *StorageServiceHostidLocalGetParams) WithContext(ctx context.Context) *StorageServiceHostidLocalGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service hostid local get params +func (o *StorageServiceHostidLocalGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service hostid local get params +func (o *StorageServiceHostidLocalGetParams) WithHTTPClient(client *http.Client) *StorageServiceHostidLocalGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service hostid local get params +func (o *StorageServiceHostidLocalGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceHostidLocalGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_hostid_local_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_hostid_local_get_responses.go new file mode 100644 index 0000000000..81ed25e2b9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_hostid_local_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceHostidLocalGetReader is a Reader for the StorageServiceHostidLocalGet structure. +type StorageServiceHostidLocalGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceHostidLocalGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceHostidLocalGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceHostidLocalGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceHostidLocalGetOK creates a StorageServiceHostidLocalGetOK with default headers values +func NewStorageServiceHostidLocalGetOK() *StorageServiceHostidLocalGetOK { + return &StorageServiceHostidLocalGetOK{} +} + +/* +StorageServiceHostidLocalGetOK handles this case with default header values. + +Success +*/ +type StorageServiceHostidLocalGetOK struct { + Payload string +} + +func (o *StorageServiceHostidLocalGetOK) GetPayload() string { + return o.Payload +} + +func (o *StorageServiceHostidLocalGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceHostidLocalGetDefault creates a StorageServiceHostidLocalGetDefault with default headers values +func NewStorageServiceHostidLocalGetDefault(code int) *StorageServiceHostidLocalGetDefault { + return &StorageServiceHostidLocalGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceHostidLocalGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceHostidLocalGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service hostid local get default response +func (o *StorageServiceHostidLocalGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceHostidLocalGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceHostidLocalGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceHostidLocalGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_incremental_backups_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_incremental_backups_get_parameters.go new file mode 100644 index 0000000000..6fd1f51873 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_incremental_backups_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceIncrementalBackupsGetParams creates a new StorageServiceIncrementalBackupsGetParams object +// with the default values initialized. +func NewStorageServiceIncrementalBackupsGetParams() *StorageServiceIncrementalBackupsGetParams { + + return &StorageServiceIncrementalBackupsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceIncrementalBackupsGetParamsWithTimeout creates a new StorageServiceIncrementalBackupsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceIncrementalBackupsGetParamsWithTimeout(timeout time.Duration) *StorageServiceIncrementalBackupsGetParams { + + return &StorageServiceIncrementalBackupsGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceIncrementalBackupsGetParamsWithContext creates a new StorageServiceIncrementalBackupsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceIncrementalBackupsGetParamsWithContext(ctx context.Context) *StorageServiceIncrementalBackupsGetParams { + + return &StorageServiceIncrementalBackupsGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceIncrementalBackupsGetParamsWithHTTPClient creates a new StorageServiceIncrementalBackupsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceIncrementalBackupsGetParamsWithHTTPClient(client *http.Client) *StorageServiceIncrementalBackupsGetParams { + + return &StorageServiceIncrementalBackupsGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceIncrementalBackupsGetParams contains all the parameters to send to the API endpoint +for the storage service incremental backups get operation typically these are written to a http.Request +*/ +type StorageServiceIncrementalBackupsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service incremental backups get params +func (o *StorageServiceIncrementalBackupsGetParams) WithTimeout(timeout time.Duration) *StorageServiceIncrementalBackupsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service incremental backups get params +func (o *StorageServiceIncrementalBackupsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service incremental backups get params +func (o *StorageServiceIncrementalBackupsGetParams) WithContext(ctx context.Context) *StorageServiceIncrementalBackupsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service incremental backups get params +func (o *StorageServiceIncrementalBackupsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service incremental backups get params +func (o *StorageServiceIncrementalBackupsGetParams) WithHTTPClient(client *http.Client) *StorageServiceIncrementalBackupsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service incremental backups get params +func (o *StorageServiceIncrementalBackupsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceIncrementalBackupsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_incremental_backups_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_incremental_backups_get_responses.go new file mode 100644 index 0000000000..e93d95e78c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_incremental_backups_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceIncrementalBackupsGetReader is a Reader for the StorageServiceIncrementalBackupsGet structure. +type StorageServiceIncrementalBackupsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceIncrementalBackupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceIncrementalBackupsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceIncrementalBackupsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceIncrementalBackupsGetOK creates a StorageServiceIncrementalBackupsGetOK with default headers values +func NewStorageServiceIncrementalBackupsGetOK() *StorageServiceIncrementalBackupsGetOK { + return &StorageServiceIncrementalBackupsGetOK{} +} + +/* +StorageServiceIncrementalBackupsGetOK handles this case with default header values. + +Success +*/ +type StorageServiceIncrementalBackupsGetOK struct { + Payload bool +} + +func (o *StorageServiceIncrementalBackupsGetOK) GetPayload() bool { + return o.Payload +} + +func (o *StorageServiceIncrementalBackupsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceIncrementalBackupsGetDefault creates a StorageServiceIncrementalBackupsGetDefault with default headers values +func NewStorageServiceIncrementalBackupsGetDefault(code int) *StorageServiceIncrementalBackupsGetDefault { + return &StorageServiceIncrementalBackupsGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceIncrementalBackupsGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceIncrementalBackupsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service incremental backups get default response +func (o *StorageServiceIncrementalBackupsGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceIncrementalBackupsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceIncrementalBackupsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceIncrementalBackupsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_incremental_backups_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_incremental_backups_post_parameters.go new file mode 100644 index 0000000000..cba4087b10 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_incremental_backups_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceIncrementalBackupsPostParams creates a new StorageServiceIncrementalBackupsPostParams object +// with the default values initialized. +func NewStorageServiceIncrementalBackupsPostParams() *StorageServiceIncrementalBackupsPostParams { + var () + return &StorageServiceIncrementalBackupsPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceIncrementalBackupsPostParamsWithTimeout creates a new StorageServiceIncrementalBackupsPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceIncrementalBackupsPostParamsWithTimeout(timeout time.Duration) *StorageServiceIncrementalBackupsPostParams { + var () + return &StorageServiceIncrementalBackupsPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceIncrementalBackupsPostParamsWithContext creates a new StorageServiceIncrementalBackupsPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceIncrementalBackupsPostParamsWithContext(ctx context.Context) *StorageServiceIncrementalBackupsPostParams { + var () + return &StorageServiceIncrementalBackupsPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceIncrementalBackupsPostParamsWithHTTPClient creates a new StorageServiceIncrementalBackupsPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceIncrementalBackupsPostParamsWithHTTPClient(client *http.Client) *StorageServiceIncrementalBackupsPostParams { + var () + return &StorageServiceIncrementalBackupsPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceIncrementalBackupsPostParams contains all the parameters to send to the API endpoint +for the storage service incremental backups post operation typically these are written to a http.Request +*/ +type StorageServiceIncrementalBackupsPostParams struct { + + /*Value + Set to true for incremental backup enabled + + */ + Value bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service incremental backups post params +func (o *StorageServiceIncrementalBackupsPostParams) WithTimeout(timeout time.Duration) *StorageServiceIncrementalBackupsPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service incremental backups post params +func (o *StorageServiceIncrementalBackupsPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service incremental backups post params +func (o *StorageServiceIncrementalBackupsPostParams) WithContext(ctx context.Context) *StorageServiceIncrementalBackupsPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service incremental backups post params +func (o *StorageServiceIncrementalBackupsPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service incremental backups post params +func (o *StorageServiceIncrementalBackupsPostParams) WithHTTPClient(client *http.Client) *StorageServiceIncrementalBackupsPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service incremental backups post params +func (o *StorageServiceIncrementalBackupsPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithValue adds the value to the storage service incremental backups post params +func (o *StorageServiceIncrementalBackupsPostParams) WithValue(value bool) *StorageServiceIncrementalBackupsPostParams { + o.SetValue(value) + return o +} + +// SetValue adds the value to the storage service incremental backups post params +func (o *StorageServiceIncrementalBackupsPostParams) SetValue(value bool) { + o.Value = value +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceIncrementalBackupsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param value + qrValue := o.Value + qValue := swag.FormatBool(qrValue) + if qValue != "" { + if err := r.SetQueryParam("value", qValue); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_incremental_backups_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_incremental_backups_post_responses.go new file mode 100644 index 0000000000..5524d7efd5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_incremental_backups_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceIncrementalBackupsPostReader is a Reader for the StorageServiceIncrementalBackupsPost structure. +type StorageServiceIncrementalBackupsPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceIncrementalBackupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceIncrementalBackupsPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceIncrementalBackupsPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceIncrementalBackupsPostOK creates a StorageServiceIncrementalBackupsPostOK with default headers values +func NewStorageServiceIncrementalBackupsPostOK() *StorageServiceIncrementalBackupsPostOK { + return &StorageServiceIncrementalBackupsPostOK{} +} + +/* +StorageServiceIncrementalBackupsPostOK handles this case with default header values. + +Success +*/ +type StorageServiceIncrementalBackupsPostOK struct { +} + +func (o *StorageServiceIncrementalBackupsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceIncrementalBackupsPostDefault creates a StorageServiceIncrementalBackupsPostDefault with default headers values +func NewStorageServiceIncrementalBackupsPostDefault(code int) *StorageServiceIncrementalBackupsPostDefault { + return &StorageServiceIncrementalBackupsPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceIncrementalBackupsPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceIncrementalBackupsPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service incremental backups post default response +func (o *StorageServiceIncrementalBackupsPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceIncrementalBackupsPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceIncrementalBackupsPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceIncrementalBackupsPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_is_initialized_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_is_initialized_get_parameters.go new file mode 100644 index 0000000000..3c26148ea8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_is_initialized_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceIsInitializedGetParams creates a new StorageServiceIsInitializedGetParams object +// with the default values initialized. +func NewStorageServiceIsInitializedGetParams() *StorageServiceIsInitializedGetParams { + + return &StorageServiceIsInitializedGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceIsInitializedGetParamsWithTimeout creates a new StorageServiceIsInitializedGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceIsInitializedGetParamsWithTimeout(timeout time.Duration) *StorageServiceIsInitializedGetParams { + + return &StorageServiceIsInitializedGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceIsInitializedGetParamsWithContext creates a new StorageServiceIsInitializedGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceIsInitializedGetParamsWithContext(ctx context.Context) *StorageServiceIsInitializedGetParams { + + return &StorageServiceIsInitializedGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceIsInitializedGetParamsWithHTTPClient creates a new StorageServiceIsInitializedGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceIsInitializedGetParamsWithHTTPClient(client *http.Client) *StorageServiceIsInitializedGetParams { + + return &StorageServiceIsInitializedGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceIsInitializedGetParams contains all the parameters to send to the API endpoint +for the storage service is initialized get operation typically these are written to a http.Request +*/ +type StorageServiceIsInitializedGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service is initialized get params +func (o *StorageServiceIsInitializedGetParams) WithTimeout(timeout time.Duration) *StorageServiceIsInitializedGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service is initialized get params +func (o *StorageServiceIsInitializedGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service is initialized get params +func (o *StorageServiceIsInitializedGetParams) WithContext(ctx context.Context) *StorageServiceIsInitializedGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service is initialized get params +func (o *StorageServiceIsInitializedGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service is initialized get params +func (o *StorageServiceIsInitializedGetParams) WithHTTPClient(client *http.Client) *StorageServiceIsInitializedGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service is initialized get params +func (o *StorageServiceIsInitializedGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceIsInitializedGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_is_initialized_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_is_initialized_get_responses.go new file mode 100644 index 0000000000..8fa4c15cc5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_is_initialized_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceIsInitializedGetReader is a Reader for the StorageServiceIsInitializedGet structure. +type StorageServiceIsInitializedGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceIsInitializedGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceIsInitializedGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceIsInitializedGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceIsInitializedGetOK creates a StorageServiceIsInitializedGetOK with default headers values +func NewStorageServiceIsInitializedGetOK() *StorageServiceIsInitializedGetOK { + return &StorageServiceIsInitializedGetOK{} +} + +/* +StorageServiceIsInitializedGetOK handles this case with default header values. + +Success +*/ +type StorageServiceIsInitializedGetOK struct { + Payload bool +} + +func (o *StorageServiceIsInitializedGetOK) GetPayload() bool { + return o.Payload +} + +func (o *StorageServiceIsInitializedGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceIsInitializedGetDefault creates a StorageServiceIsInitializedGetDefault with default headers values +func NewStorageServiceIsInitializedGetDefault(code int) *StorageServiceIsInitializedGetDefault { + return &StorageServiceIsInitializedGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceIsInitializedGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceIsInitializedGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service is initialized get default response +func (o *StorageServiceIsInitializedGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceIsInitializedGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceIsInitializedGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceIsInitializedGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_is_starting_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_is_starting_get_parameters.go new file mode 100644 index 0000000000..8f19e3456e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_is_starting_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceIsStartingGetParams creates a new StorageServiceIsStartingGetParams object +// with the default values initialized. +func NewStorageServiceIsStartingGetParams() *StorageServiceIsStartingGetParams { + + return &StorageServiceIsStartingGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceIsStartingGetParamsWithTimeout creates a new StorageServiceIsStartingGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceIsStartingGetParamsWithTimeout(timeout time.Duration) *StorageServiceIsStartingGetParams { + + return &StorageServiceIsStartingGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceIsStartingGetParamsWithContext creates a new StorageServiceIsStartingGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceIsStartingGetParamsWithContext(ctx context.Context) *StorageServiceIsStartingGetParams { + + return &StorageServiceIsStartingGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceIsStartingGetParamsWithHTTPClient creates a new StorageServiceIsStartingGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceIsStartingGetParamsWithHTTPClient(client *http.Client) *StorageServiceIsStartingGetParams { + + return &StorageServiceIsStartingGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceIsStartingGetParams contains all the parameters to send to the API endpoint +for the storage service is starting get operation typically these are written to a http.Request +*/ +type StorageServiceIsStartingGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service is starting get params +func (o *StorageServiceIsStartingGetParams) WithTimeout(timeout time.Duration) *StorageServiceIsStartingGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service is starting get params +func (o *StorageServiceIsStartingGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service is starting get params +func (o *StorageServiceIsStartingGetParams) WithContext(ctx context.Context) *StorageServiceIsStartingGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service is starting get params +func (o *StorageServiceIsStartingGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service is starting get params +func (o *StorageServiceIsStartingGetParams) WithHTTPClient(client *http.Client) *StorageServiceIsStartingGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service is starting get params +func (o *StorageServiceIsStartingGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceIsStartingGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_is_starting_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_is_starting_get_responses.go new file mode 100644 index 0000000000..cceabf028f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_is_starting_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceIsStartingGetReader is a Reader for the StorageServiceIsStartingGet structure. +type StorageServiceIsStartingGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceIsStartingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceIsStartingGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceIsStartingGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceIsStartingGetOK creates a StorageServiceIsStartingGetOK with default headers values +func NewStorageServiceIsStartingGetOK() *StorageServiceIsStartingGetOK { + return &StorageServiceIsStartingGetOK{} +} + +/* +StorageServiceIsStartingGetOK handles this case with default header values. + +Success +*/ +type StorageServiceIsStartingGetOK struct { + Payload bool +} + +func (o *StorageServiceIsStartingGetOK) GetPayload() bool { + return o.Payload +} + +func (o *StorageServiceIsStartingGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceIsStartingGetDefault creates a StorageServiceIsStartingGetDefault with default headers values +func NewStorageServiceIsStartingGetDefault(code int) *StorageServiceIsStartingGetDefault { + return &StorageServiceIsStartingGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceIsStartingGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceIsStartingGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service is starting get default response +func (o *StorageServiceIsStartingGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceIsStartingGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceIsStartingGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceIsStartingGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_join_ring_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_join_ring_get_parameters.go new file mode 100644 index 0000000000..857c38eb38 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_join_ring_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceJoinRingGetParams creates a new StorageServiceJoinRingGetParams object +// with the default values initialized. +func NewStorageServiceJoinRingGetParams() *StorageServiceJoinRingGetParams { + + return &StorageServiceJoinRingGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceJoinRingGetParamsWithTimeout creates a new StorageServiceJoinRingGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceJoinRingGetParamsWithTimeout(timeout time.Duration) *StorageServiceJoinRingGetParams { + + return &StorageServiceJoinRingGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceJoinRingGetParamsWithContext creates a new StorageServiceJoinRingGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceJoinRingGetParamsWithContext(ctx context.Context) *StorageServiceJoinRingGetParams { + + return &StorageServiceJoinRingGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceJoinRingGetParamsWithHTTPClient creates a new StorageServiceJoinRingGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceJoinRingGetParamsWithHTTPClient(client *http.Client) *StorageServiceJoinRingGetParams { + + return &StorageServiceJoinRingGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceJoinRingGetParams contains all the parameters to send to the API endpoint +for the storage service join ring get operation typically these are written to a http.Request +*/ +type StorageServiceJoinRingGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service join ring get params +func (o *StorageServiceJoinRingGetParams) WithTimeout(timeout time.Duration) *StorageServiceJoinRingGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service join ring get params +func (o *StorageServiceJoinRingGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service join ring get params +func (o *StorageServiceJoinRingGetParams) WithContext(ctx context.Context) *StorageServiceJoinRingGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service join ring get params +func (o *StorageServiceJoinRingGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service join ring get params +func (o *StorageServiceJoinRingGetParams) WithHTTPClient(client *http.Client) *StorageServiceJoinRingGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service join ring get params +func (o *StorageServiceJoinRingGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceJoinRingGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_join_ring_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_join_ring_get_responses.go new file mode 100644 index 0000000000..9dd853238b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_join_ring_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceJoinRingGetReader is a Reader for the StorageServiceJoinRingGet structure. +type StorageServiceJoinRingGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceJoinRingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceJoinRingGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceJoinRingGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceJoinRingGetOK creates a StorageServiceJoinRingGetOK with default headers values +func NewStorageServiceJoinRingGetOK() *StorageServiceJoinRingGetOK { + return &StorageServiceJoinRingGetOK{} +} + +/* +StorageServiceJoinRingGetOK handles this case with default header values. + +Success +*/ +type StorageServiceJoinRingGetOK struct { + Payload bool +} + +func (o *StorageServiceJoinRingGetOK) GetPayload() bool { + return o.Payload +} + +func (o *StorageServiceJoinRingGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceJoinRingGetDefault creates a StorageServiceJoinRingGetDefault with default headers values +func NewStorageServiceJoinRingGetDefault(code int) *StorageServiceJoinRingGetDefault { + return &StorageServiceJoinRingGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceJoinRingGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceJoinRingGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service join ring get default response +func (o *StorageServiceJoinRingGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceJoinRingGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceJoinRingGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceJoinRingGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_join_ring_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_join_ring_post_parameters.go new file mode 100644 index 0000000000..2b6b20c32a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_join_ring_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceJoinRingPostParams creates a new StorageServiceJoinRingPostParams object +// with the default values initialized. +func NewStorageServiceJoinRingPostParams() *StorageServiceJoinRingPostParams { + + return &StorageServiceJoinRingPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceJoinRingPostParamsWithTimeout creates a new StorageServiceJoinRingPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceJoinRingPostParamsWithTimeout(timeout time.Duration) *StorageServiceJoinRingPostParams { + + return &StorageServiceJoinRingPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceJoinRingPostParamsWithContext creates a new StorageServiceJoinRingPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceJoinRingPostParamsWithContext(ctx context.Context) *StorageServiceJoinRingPostParams { + + return &StorageServiceJoinRingPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceJoinRingPostParamsWithHTTPClient creates a new StorageServiceJoinRingPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceJoinRingPostParamsWithHTTPClient(client *http.Client) *StorageServiceJoinRingPostParams { + + return &StorageServiceJoinRingPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceJoinRingPostParams contains all the parameters to send to the API endpoint +for the storage service join ring post operation typically these are written to a http.Request +*/ +type StorageServiceJoinRingPostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service join ring post params +func (o *StorageServiceJoinRingPostParams) WithTimeout(timeout time.Duration) *StorageServiceJoinRingPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service join ring post params +func (o *StorageServiceJoinRingPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service join ring post params +func (o *StorageServiceJoinRingPostParams) WithContext(ctx context.Context) *StorageServiceJoinRingPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service join ring post params +func (o *StorageServiceJoinRingPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service join ring post params +func (o *StorageServiceJoinRingPostParams) WithHTTPClient(client *http.Client) *StorageServiceJoinRingPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service join ring post params +func (o *StorageServiceJoinRingPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceJoinRingPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_join_ring_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_join_ring_post_responses.go new file mode 100644 index 0000000000..82bd31781a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_join_ring_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceJoinRingPostReader is a Reader for the StorageServiceJoinRingPost structure. +type StorageServiceJoinRingPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceJoinRingPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceJoinRingPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceJoinRingPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceJoinRingPostOK creates a StorageServiceJoinRingPostOK with default headers values +func NewStorageServiceJoinRingPostOK() *StorageServiceJoinRingPostOK { + return &StorageServiceJoinRingPostOK{} +} + +/* +StorageServiceJoinRingPostOK handles this case with default header values. + +Success +*/ +type StorageServiceJoinRingPostOK struct { +} + +func (o *StorageServiceJoinRingPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceJoinRingPostDefault creates a StorageServiceJoinRingPostDefault with default headers values +func NewStorageServiceJoinRingPostDefault(code int) *StorageServiceJoinRingPostDefault { + return &StorageServiceJoinRingPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceJoinRingPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceJoinRingPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service join ring post default response +func (o *StorageServiceJoinRingPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceJoinRingPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceJoinRingPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceJoinRingPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_cleanup_by_keyspace_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_cleanup_by_keyspace_post_parameters.go new file mode 100644 index 0000000000..158b0e1a3c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_cleanup_by_keyspace_post_parameters.go @@ -0,0 +1,168 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceKeyspaceCleanupByKeyspacePostParams creates a new StorageServiceKeyspaceCleanupByKeyspacePostParams object +// with the default values initialized. +func NewStorageServiceKeyspaceCleanupByKeyspacePostParams() *StorageServiceKeyspaceCleanupByKeyspacePostParams { + var () + return &StorageServiceKeyspaceCleanupByKeyspacePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceKeyspaceCleanupByKeyspacePostParamsWithTimeout creates a new StorageServiceKeyspaceCleanupByKeyspacePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceKeyspaceCleanupByKeyspacePostParamsWithTimeout(timeout time.Duration) *StorageServiceKeyspaceCleanupByKeyspacePostParams { + var () + return &StorageServiceKeyspaceCleanupByKeyspacePostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceKeyspaceCleanupByKeyspacePostParamsWithContext creates a new StorageServiceKeyspaceCleanupByKeyspacePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceKeyspaceCleanupByKeyspacePostParamsWithContext(ctx context.Context) *StorageServiceKeyspaceCleanupByKeyspacePostParams { + var () + return &StorageServiceKeyspaceCleanupByKeyspacePostParams{ + + Context: ctx, + } +} + +// NewStorageServiceKeyspaceCleanupByKeyspacePostParamsWithHTTPClient creates a new StorageServiceKeyspaceCleanupByKeyspacePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceKeyspaceCleanupByKeyspacePostParamsWithHTTPClient(client *http.Client) *StorageServiceKeyspaceCleanupByKeyspacePostParams { + var () + return &StorageServiceKeyspaceCleanupByKeyspacePostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceKeyspaceCleanupByKeyspacePostParams contains all the parameters to send to the API endpoint +for the storage service keyspace cleanup by keyspace post operation typically these are written to a http.Request +*/ +type StorageServiceKeyspaceCleanupByKeyspacePostParams struct { + + /*Cf + Comma seperated column family names + + */ + Cf *string + /*Keyspace + The keyspace to query about + + */ + Keyspace string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service keyspace cleanup by keyspace post params +func (o *StorageServiceKeyspaceCleanupByKeyspacePostParams) WithTimeout(timeout time.Duration) *StorageServiceKeyspaceCleanupByKeyspacePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service keyspace cleanup by keyspace post params +func (o *StorageServiceKeyspaceCleanupByKeyspacePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service keyspace cleanup by keyspace post params +func (o *StorageServiceKeyspaceCleanupByKeyspacePostParams) WithContext(ctx context.Context) *StorageServiceKeyspaceCleanupByKeyspacePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service keyspace cleanup by keyspace post params +func (o *StorageServiceKeyspaceCleanupByKeyspacePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service keyspace cleanup by keyspace post params +func (o *StorageServiceKeyspaceCleanupByKeyspacePostParams) WithHTTPClient(client *http.Client) *StorageServiceKeyspaceCleanupByKeyspacePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service keyspace cleanup by keyspace post params +func (o *StorageServiceKeyspaceCleanupByKeyspacePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCf adds the cf to the storage service keyspace cleanup by keyspace post params +func (o *StorageServiceKeyspaceCleanupByKeyspacePostParams) WithCf(cf *string) *StorageServiceKeyspaceCleanupByKeyspacePostParams { + o.SetCf(cf) + return o +} + +// SetCf adds the cf to the storage service keyspace cleanup by keyspace post params +func (o *StorageServiceKeyspaceCleanupByKeyspacePostParams) SetCf(cf *string) { + o.Cf = cf +} + +// WithKeyspace adds the keyspace to the storage service keyspace cleanup by keyspace post params +func (o *StorageServiceKeyspaceCleanupByKeyspacePostParams) WithKeyspace(keyspace string) *StorageServiceKeyspaceCleanupByKeyspacePostParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service keyspace cleanup by keyspace post params +func (o *StorageServiceKeyspaceCleanupByKeyspacePostParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceKeyspaceCleanupByKeyspacePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cf != nil { + + // query param cf + var qrCf string + if o.Cf != nil { + qrCf = *o.Cf + } + qCf := qrCf + if qCf != "" { + if err := r.SetQueryParam("cf", qCf); err != nil { + return err + } + } + + } + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_cleanup_by_keyspace_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_cleanup_by_keyspace_post_responses.go new file mode 100644 index 0000000000..fedf0c771c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_cleanup_by_keyspace_post_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceKeyspaceCleanupByKeyspacePostReader is a Reader for the StorageServiceKeyspaceCleanupByKeyspacePost structure. +type StorageServiceKeyspaceCleanupByKeyspacePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceKeyspaceCleanupByKeyspacePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceKeyspaceCleanupByKeyspacePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceKeyspaceCleanupByKeyspacePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceKeyspaceCleanupByKeyspacePostOK creates a StorageServiceKeyspaceCleanupByKeyspacePostOK with default headers values +func NewStorageServiceKeyspaceCleanupByKeyspacePostOK() *StorageServiceKeyspaceCleanupByKeyspacePostOK { + return &StorageServiceKeyspaceCleanupByKeyspacePostOK{} +} + +/* +StorageServiceKeyspaceCleanupByKeyspacePostOK handles this case with default header values. + +Success +*/ +type StorageServiceKeyspaceCleanupByKeyspacePostOK struct { + Payload int32 +} + +func (o *StorageServiceKeyspaceCleanupByKeyspacePostOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageServiceKeyspaceCleanupByKeyspacePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceKeyspaceCleanupByKeyspacePostDefault creates a StorageServiceKeyspaceCleanupByKeyspacePostDefault with default headers values +func NewStorageServiceKeyspaceCleanupByKeyspacePostDefault(code int) *StorageServiceKeyspaceCleanupByKeyspacePostDefault { + return &StorageServiceKeyspaceCleanupByKeyspacePostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceKeyspaceCleanupByKeyspacePostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceKeyspaceCleanupByKeyspacePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service keyspace cleanup by keyspace post default response +func (o *StorageServiceKeyspaceCleanupByKeyspacePostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceKeyspaceCleanupByKeyspacePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceKeyspaceCleanupByKeyspacePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceKeyspaceCleanupByKeyspacePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_compaction_by_keyspace_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_compaction_by_keyspace_post_parameters.go new file mode 100644 index 0000000000..7ebb83df5d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_compaction_by_keyspace_post_parameters.go @@ -0,0 +1,168 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceKeyspaceCompactionByKeyspacePostParams creates a new StorageServiceKeyspaceCompactionByKeyspacePostParams object +// with the default values initialized. +func NewStorageServiceKeyspaceCompactionByKeyspacePostParams() *StorageServiceKeyspaceCompactionByKeyspacePostParams { + var () + return &StorageServiceKeyspaceCompactionByKeyspacePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceKeyspaceCompactionByKeyspacePostParamsWithTimeout creates a new StorageServiceKeyspaceCompactionByKeyspacePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceKeyspaceCompactionByKeyspacePostParamsWithTimeout(timeout time.Duration) *StorageServiceKeyspaceCompactionByKeyspacePostParams { + var () + return &StorageServiceKeyspaceCompactionByKeyspacePostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceKeyspaceCompactionByKeyspacePostParamsWithContext creates a new StorageServiceKeyspaceCompactionByKeyspacePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceKeyspaceCompactionByKeyspacePostParamsWithContext(ctx context.Context) *StorageServiceKeyspaceCompactionByKeyspacePostParams { + var () + return &StorageServiceKeyspaceCompactionByKeyspacePostParams{ + + Context: ctx, + } +} + +// NewStorageServiceKeyspaceCompactionByKeyspacePostParamsWithHTTPClient creates a new StorageServiceKeyspaceCompactionByKeyspacePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceKeyspaceCompactionByKeyspacePostParamsWithHTTPClient(client *http.Client) *StorageServiceKeyspaceCompactionByKeyspacePostParams { + var () + return &StorageServiceKeyspaceCompactionByKeyspacePostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceKeyspaceCompactionByKeyspacePostParams contains all the parameters to send to the API endpoint +for the storage service keyspace compaction by keyspace post operation typically these are written to a http.Request +*/ +type StorageServiceKeyspaceCompactionByKeyspacePostParams struct { + + /*Cf + Comma seperated column family names + + */ + Cf *string + /*Keyspace + The keyspace to query about + + */ + Keyspace string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service keyspace compaction by keyspace post params +func (o *StorageServiceKeyspaceCompactionByKeyspacePostParams) WithTimeout(timeout time.Duration) *StorageServiceKeyspaceCompactionByKeyspacePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service keyspace compaction by keyspace post params +func (o *StorageServiceKeyspaceCompactionByKeyspacePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service keyspace compaction by keyspace post params +func (o *StorageServiceKeyspaceCompactionByKeyspacePostParams) WithContext(ctx context.Context) *StorageServiceKeyspaceCompactionByKeyspacePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service keyspace compaction by keyspace post params +func (o *StorageServiceKeyspaceCompactionByKeyspacePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service keyspace compaction by keyspace post params +func (o *StorageServiceKeyspaceCompactionByKeyspacePostParams) WithHTTPClient(client *http.Client) *StorageServiceKeyspaceCompactionByKeyspacePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service keyspace compaction by keyspace post params +func (o *StorageServiceKeyspaceCompactionByKeyspacePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCf adds the cf to the storage service keyspace compaction by keyspace post params +func (o *StorageServiceKeyspaceCompactionByKeyspacePostParams) WithCf(cf *string) *StorageServiceKeyspaceCompactionByKeyspacePostParams { + o.SetCf(cf) + return o +} + +// SetCf adds the cf to the storage service keyspace compaction by keyspace post params +func (o *StorageServiceKeyspaceCompactionByKeyspacePostParams) SetCf(cf *string) { + o.Cf = cf +} + +// WithKeyspace adds the keyspace to the storage service keyspace compaction by keyspace post params +func (o *StorageServiceKeyspaceCompactionByKeyspacePostParams) WithKeyspace(keyspace string) *StorageServiceKeyspaceCompactionByKeyspacePostParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service keyspace compaction by keyspace post params +func (o *StorageServiceKeyspaceCompactionByKeyspacePostParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceKeyspaceCompactionByKeyspacePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cf != nil { + + // query param cf + var qrCf string + if o.Cf != nil { + qrCf = *o.Cf + } + qCf := qrCf + if qCf != "" { + if err := r.SetQueryParam("cf", qCf); err != nil { + return err + } + } + + } + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_compaction_by_keyspace_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_compaction_by_keyspace_post_responses.go new file mode 100644 index 0000000000..d9f3d092ad --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_compaction_by_keyspace_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceKeyspaceCompactionByKeyspacePostReader is a Reader for the StorageServiceKeyspaceCompactionByKeyspacePost structure. +type StorageServiceKeyspaceCompactionByKeyspacePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceKeyspaceCompactionByKeyspacePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceKeyspaceCompactionByKeyspacePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceKeyspaceCompactionByKeyspacePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceKeyspaceCompactionByKeyspacePostOK creates a StorageServiceKeyspaceCompactionByKeyspacePostOK with default headers values +func NewStorageServiceKeyspaceCompactionByKeyspacePostOK() *StorageServiceKeyspaceCompactionByKeyspacePostOK { + return &StorageServiceKeyspaceCompactionByKeyspacePostOK{} +} + +/* +StorageServiceKeyspaceCompactionByKeyspacePostOK handles this case with default header values. + +Success +*/ +type StorageServiceKeyspaceCompactionByKeyspacePostOK struct { +} + +func (o *StorageServiceKeyspaceCompactionByKeyspacePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceKeyspaceCompactionByKeyspacePostDefault creates a StorageServiceKeyspaceCompactionByKeyspacePostDefault with default headers values +func NewStorageServiceKeyspaceCompactionByKeyspacePostDefault(code int) *StorageServiceKeyspaceCompactionByKeyspacePostDefault { + return &StorageServiceKeyspaceCompactionByKeyspacePostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceKeyspaceCompactionByKeyspacePostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceKeyspaceCompactionByKeyspacePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service keyspace compaction by keyspace post default response +func (o *StorageServiceKeyspaceCompactionByKeyspacePostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceKeyspaceCompactionByKeyspacePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceKeyspaceCompactionByKeyspacePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceKeyspaceCompactionByKeyspacePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_flush_by_keyspace_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_flush_by_keyspace_post_parameters.go new file mode 100644 index 0000000000..d29e140298 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_flush_by_keyspace_post_parameters.go @@ -0,0 +1,168 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceKeyspaceFlushByKeyspacePostParams creates a new StorageServiceKeyspaceFlushByKeyspacePostParams object +// with the default values initialized. +func NewStorageServiceKeyspaceFlushByKeyspacePostParams() *StorageServiceKeyspaceFlushByKeyspacePostParams { + var () + return &StorageServiceKeyspaceFlushByKeyspacePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceKeyspaceFlushByKeyspacePostParamsWithTimeout creates a new StorageServiceKeyspaceFlushByKeyspacePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceKeyspaceFlushByKeyspacePostParamsWithTimeout(timeout time.Duration) *StorageServiceKeyspaceFlushByKeyspacePostParams { + var () + return &StorageServiceKeyspaceFlushByKeyspacePostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceKeyspaceFlushByKeyspacePostParamsWithContext creates a new StorageServiceKeyspaceFlushByKeyspacePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceKeyspaceFlushByKeyspacePostParamsWithContext(ctx context.Context) *StorageServiceKeyspaceFlushByKeyspacePostParams { + var () + return &StorageServiceKeyspaceFlushByKeyspacePostParams{ + + Context: ctx, + } +} + +// NewStorageServiceKeyspaceFlushByKeyspacePostParamsWithHTTPClient creates a new StorageServiceKeyspaceFlushByKeyspacePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceKeyspaceFlushByKeyspacePostParamsWithHTTPClient(client *http.Client) *StorageServiceKeyspaceFlushByKeyspacePostParams { + var () + return &StorageServiceKeyspaceFlushByKeyspacePostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceKeyspaceFlushByKeyspacePostParams contains all the parameters to send to the API endpoint +for the storage service keyspace flush by keyspace post operation typically these are written to a http.Request +*/ +type StorageServiceKeyspaceFlushByKeyspacePostParams struct { + + /*Cf + Comma seperated column family names + + */ + Cf *string + /*Keyspace + The keyspace to flush + + */ + Keyspace string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service keyspace flush by keyspace post params +func (o *StorageServiceKeyspaceFlushByKeyspacePostParams) WithTimeout(timeout time.Duration) *StorageServiceKeyspaceFlushByKeyspacePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service keyspace flush by keyspace post params +func (o *StorageServiceKeyspaceFlushByKeyspacePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service keyspace flush by keyspace post params +func (o *StorageServiceKeyspaceFlushByKeyspacePostParams) WithContext(ctx context.Context) *StorageServiceKeyspaceFlushByKeyspacePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service keyspace flush by keyspace post params +func (o *StorageServiceKeyspaceFlushByKeyspacePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service keyspace flush by keyspace post params +func (o *StorageServiceKeyspaceFlushByKeyspacePostParams) WithHTTPClient(client *http.Client) *StorageServiceKeyspaceFlushByKeyspacePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service keyspace flush by keyspace post params +func (o *StorageServiceKeyspaceFlushByKeyspacePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCf adds the cf to the storage service keyspace flush by keyspace post params +func (o *StorageServiceKeyspaceFlushByKeyspacePostParams) WithCf(cf *string) *StorageServiceKeyspaceFlushByKeyspacePostParams { + o.SetCf(cf) + return o +} + +// SetCf adds the cf to the storage service keyspace flush by keyspace post params +func (o *StorageServiceKeyspaceFlushByKeyspacePostParams) SetCf(cf *string) { + o.Cf = cf +} + +// WithKeyspace adds the keyspace to the storage service keyspace flush by keyspace post params +func (o *StorageServiceKeyspaceFlushByKeyspacePostParams) WithKeyspace(keyspace string) *StorageServiceKeyspaceFlushByKeyspacePostParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service keyspace flush by keyspace post params +func (o *StorageServiceKeyspaceFlushByKeyspacePostParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceKeyspaceFlushByKeyspacePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cf != nil { + + // query param cf + var qrCf string + if o.Cf != nil { + qrCf = *o.Cf + } + qCf := qrCf + if qCf != "" { + if err := r.SetQueryParam("cf", qCf); err != nil { + return err + } + } + + } + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_flush_by_keyspace_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_flush_by_keyspace_post_responses.go new file mode 100644 index 0000000000..61843ee1f5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_flush_by_keyspace_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceKeyspaceFlushByKeyspacePostReader is a Reader for the StorageServiceKeyspaceFlushByKeyspacePost structure. +type StorageServiceKeyspaceFlushByKeyspacePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceKeyspaceFlushByKeyspacePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceKeyspaceFlushByKeyspacePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceKeyspaceFlushByKeyspacePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceKeyspaceFlushByKeyspacePostOK creates a StorageServiceKeyspaceFlushByKeyspacePostOK with default headers values +func NewStorageServiceKeyspaceFlushByKeyspacePostOK() *StorageServiceKeyspaceFlushByKeyspacePostOK { + return &StorageServiceKeyspaceFlushByKeyspacePostOK{} +} + +/* +StorageServiceKeyspaceFlushByKeyspacePostOK handles this case with default header values. + +Success +*/ +type StorageServiceKeyspaceFlushByKeyspacePostOK struct { +} + +func (o *StorageServiceKeyspaceFlushByKeyspacePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceKeyspaceFlushByKeyspacePostDefault creates a StorageServiceKeyspaceFlushByKeyspacePostDefault with default headers values +func NewStorageServiceKeyspaceFlushByKeyspacePostDefault(code int) *StorageServiceKeyspaceFlushByKeyspacePostDefault { + return &StorageServiceKeyspaceFlushByKeyspacePostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceKeyspaceFlushByKeyspacePostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceKeyspaceFlushByKeyspacePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service keyspace flush by keyspace post default response +func (o *StorageServiceKeyspaceFlushByKeyspacePostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceKeyspaceFlushByKeyspacePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceKeyspaceFlushByKeyspacePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceKeyspaceFlushByKeyspacePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_scrub_by_keyspace_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_scrub_by_keyspace_get_parameters.go new file mode 100644 index 0000000000..184094d80d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_scrub_by_keyspace_get_parameters.go @@ -0,0 +1,233 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceKeyspaceScrubByKeyspaceGetParams creates a new StorageServiceKeyspaceScrubByKeyspaceGetParams object +// with the default values initialized. +func NewStorageServiceKeyspaceScrubByKeyspaceGetParams() *StorageServiceKeyspaceScrubByKeyspaceGetParams { + var () + return &StorageServiceKeyspaceScrubByKeyspaceGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceKeyspaceScrubByKeyspaceGetParamsWithTimeout creates a new StorageServiceKeyspaceScrubByKeyspaceGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceKeyspaceScrubByKeyspaceGetParamsWithTimeout(timeout time.Duration) *StorageServiceKeyspaceScrubByKeyspaceGetParams { + var () + return &StorageServiceKeyspaceScrubByKeyspaceGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceKeyspaceScrubByKeyspaceGetParamsWithContext creates a new StorageServiceKeyspaceScrubByKeyspaceGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceKeyspaceScrubByKeyspaceGetParamsWithContext(ctx context.Context) *StorageServiceKeyspaceScrubByKeyspaceGetParams { + var () + return &StorageServiceKeyspaceScrubByKeyspaceGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceKeyspaceScrubByKeyspaceGetParamsWithHTTPClient creates a new StorageServiceKeyspaceScrubByKeyspaceGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceKeyspaceScrubByKeyspaceGetParamsWithHTTPClient(client *http.Client) *StorageServiceKeyspaceScrubByKeyspaceGetParams { + var () + return &StorageServiceKeyspaceScrubByKeyspaceGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceKeyspaceScrubByKeyspaceGetParams contains all the parameters to send to the API endpoint +for the storage service keyspace scrub by keyspace get operation typically these are written to a http.Request +*/ +type StorageServiceKeyspaceScrubByKeyspaceGetParams struct { + + /*Cf + Comma seperated column family names + + */ + Cf *string + /*DisableSnapshot + When set to true, disable snapshot + + */ + DisableSnapshot *bool + /*Keyspace + The keyspace to query about + + */ + Keyspace string + /*SkipCorrupted + When set to true, skip corrupted + + */ + SkipCorrupted *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service keyspace scrub by keyspace get params +func (o *StorageServiceKeyspaceScrubByKeyspaceGetParams) WithTimeout(timeout time.Duration) *StorageServiceKeyspaceScrubByKeyspaceGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service keyspace scrub by keyspace get params +func (o *StorageServiceKeyspaceScrubByKeyspaceGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service keyspace scrub by keyspace get params +func (o *StorageServiceKeyspaceScrubByKeyspaceGetParams) WithContext(ctx context.Context) *StorageServiceKeyspaceScrubByKeyspaceGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service keyspace scrub by keyspace get params +func (o *StorageServiceKeyspaceScrubByKeyspaceGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service keyspace scrub by keyspace get params +func (o *StorageServiceKeyspaceScrubByKeyspaceGetParams) WithHTTPClient(client *http.Client) *StorageServiceKeyspaceScrubByKeyspaceGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service keyspace scrub by keyspace get params +func (o *StorageServiceKeyspaceScrubByKeyspaceGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCf adds the cf to the storage service keyspace scrub by keyspace get params +func (o *StorageServiceKeyspaceScrubByKeyspaceGetParams) WithCf(cf *string) *StorageServiceKeyspaceScrubByKeyspaceGetParams { + o.SetCf(cf) + return o +} + +// SetCf adds the cf to the storage service keyspace scrub by keyspace get params +func (o *StorageServiceKeyspaceScrubByKeyspaceGetParams) SetCf(cf *string) { + o.Cf = cf +} + +// WithDisableSnapshot adds the disableSnapshot to the storage service keyspace scrub by keyspace get params +func (o *StorageServiceKeyspaceScrubByKeyspaceGetParams) WithDisableSnapshot(disableSnapshot *bool) *StorageServiceKeyspaceScrubByKeyspaceGetParams { + o.SetDisableSnapshot(disableSnapshot) + return o +} + +// SetDisableSnapshot adds the disableSnapshot to the storage service keyspace scrub by keyspace get params +func (o *StorageServiceKeyspaceScrubByKeyspaceGetParams) SetDisableSnapshot(disableSnapshot *bool) { + o.DisableSnapshot = disableSnapshot +} + +// WithKeyspace adds the keyspace to the storage service keyspace scrub by keyspace get params +func (o *StorageServiceKeyspaceScrubByKeyspaceGetParams) WithKeyspace(keyspace string) *StorageServiceKeyspaceScrubByKeyspaceGetParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service keyspace scrub by keyspace get params +func (o *StorageServiceKeyspaceScrubByKeyspaceGetParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WithSkipCorrupted adds the skipCorrupted to the storage service keyspace scrub by keyspace get params +func (o *StorageServiceKeyspaceScrubByKeyspaceGetParams) WithSkipCorrupted(skipCorrupted *bool) *StorageServiceKeyspaceScrubByKeyspaceGetParams { + o.SetSkipCorrupted(skipCorrupted) + return o +} + +// SetSkipCorrupted adds the skipCorrupted to the storage service keyspace scrub by keyspace get params +func (o *StorageServiceKeyspaceScrubByKeyspaceGetParams) SetSkipCorrupted(skipCorrupted *bool) { + o.SkipCorrupted = skipCorrupted +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceKeyspaceScrubByKeyspaceGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cf != nil { + + // query param cf + var qrCf string + if o.Cf != nil { + qrCf = *o.Cf + } + qCf := qrCf + if qCf != "" { + if err := r.SetQueryParam("cf", qCf); err != nil { + return err + } + } + + } + + if o.DisableSnapshot != nil { + + // query param disable_snapshot + var qrDisableSnapshot bool + if o.DisableSnapshot != nil { + qrDisableSnapshot = *o.DisableSnapshot + } + qDisableSnapshot := swag.FormatBool(qrDisableSnapshot) + if qDisableSnapshot != "" { + if err := r.SetQueryParam("disable_snapshot", qDisableSnapshot); err != nil { + return err + } + } + + } + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if o.SkipCorrupted != nil { + + // query param skip_corrupted + var qrSkipCorrupted bool + if o.SkipCorrupted != nil { + qrSkipCorrupted = *o.SkipCorrupted + } + qSkipCorrupted := swag.FormatBool(qrSkipCorrupted) + if qSkipCorrupted != "" { + if err := r.SetQueryParam("skip_corrupted", qSkipCorrupted); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_scrub_by_keyspace_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_scrub_by_keyspace_get_responses.go new file mode 100644 index 0000000000..63f79e5e9c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_scrub_by_keyspace_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceKeyspaceScrubByKeyspaceGetReader is a Reader for the StorageServiceKeyspaceScrubByKeyspaceGet structure. +type StorageServiceKeyspaceScrubByKeyspaceGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceKeyspaceScrubByKeyspaceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceKeyspaceScrubByKeyspaceGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceKeyspaceScrubByKeyspaceGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceKeyspaceScrubByKeyspaceGetOK creates a StorageServiceKeyspaceScrubByKeyspaceGetOK with default headers values +func NewStorageServiceKeyspaceScrubByKeyspaceGetOK() *StorageServiceKeyspaceScrubByKeyspaceGetOK { + return &StorageServiceKeyspaceScrubByKeyspaceGetOK{} +} + +/* +StorageServiceKeyspaceScrubByKeyspaceGetOK handles this case with default header values. + +Success +*/ +type StorageServiceKeyspaceScrubByKeyspaceGetOK struct { + Payload int32 +} + +func (o *StorageServiceKeyspaceScrubByKeyspaceGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageServiceKeyspaceScrubByKeyspaceGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceKeyspaceScrubByKeyspaceGetDefault creates a StorageServiceKeyspaceScrubByKeyspaceGetDefault with default headers values +func NewStorageServiceKeyspaceScrubByKeyspaceGetDefault(code int) *StorageServiceKeyspaceScrubByKeyspaceGetDefault { + return &StorageServiceKeyspaceScrubByKeyspaceGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceKeyspaceScrubByKeyspaceGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceKeyspaceScrubByKeyspaceGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service keyspace scrub by keyspace get default response +func (o *StorageServiceKeyspaceScrubByKeyspaceGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceKeyspaceScrubByKeyspaceGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceKeyspaceScrubByKeyspaceGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceKeyspaceScrubByKeyspaceGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_upgrade_sstables_by_keyspace_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_upgrade_sstables_by_keyspace_get_parameters.go new file mode 100644 index 0000000000..e97ae03208 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_upgrade_sstables_by_keyspace_get_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams creates a new StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams object +// with the default values initialized. +func NewStorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams() *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams { + var () + return &StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParamsWithTimeout creates a new StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParamsWithTimeout(timeout time.Duration) *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams { + var () + return &StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParamsWithContext creates a new StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParamsWithContext(ctx context.Context) *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams { + var () + return &StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParamsWithHTTPClient creates a new StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParamsWithHTTPClient(client *http.Client) *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams { + var () + return &StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams contains all the parameters to send to the API endpoint +for the storage service keyspace upgrade sstables by keyspace get operation typically these are written to a http.Request +*/ +type StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams struct { + + /*Cf + Comma seperated column family names + + */ + Cf *string + /*ExcludeCurrentVersion + When set to true exclude current version + + */ + ExcludeCurrentVersion *bool + /*Keyspace + The keyspace + + */ + Keyspace string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service keyspace upgrade sstables by keyspace get params +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams) WithTimeout(timeout time.Duration) *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service keyspace upgrade sstables by keyspace get params +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service keyspace upgrade sstables by keyspace get params +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams) WithContext(ctx context.Context) *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service keyspace upgrade sstables by keyspace get params +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service keyspace upgrade sstables by keyspace get params +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams) WithHTTPClient(client *http.Client) *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service keyspace upgrade sstables by keyspace get params +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCf adds the cf to the storage service keyspace upgrade sstables by keyspace get params +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams) WithCf(cf *string) *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams { + o.SetCf(cf) + return o +} + +// SetCf adds the cf to the storage service keyspace upgrade sstables by keyspace get params +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams) SetCf(cf *string) { + o.Cf = cf +} + +// WithExcludeCurrentVersion adds the excludeCurrentVersion to the storage service keyspace upgrade sstables by keyspace get params +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams) WithExcludeCurrentVersion(excludeCurrentVersion *bool) *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams { + o.SetExcludeCurrentVersion(excludeCurrentVersion) + return o +} + +// SetExcludeCurrentVersion adds the excludeCurrentVersion to the storage service keyspace upgrade sstables by keyspace get params +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams) SetExcludeCurrentVersion(excludeCurrentVersion *bool) { + o.ExcludeCurrentVersion = excludeCurrentVersion +} + +// WithKeyspace adds the keyspace to the storage service keyspace upgrade sstables by keyspace get params +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams) WithKeyspace(keyspace string) *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service keyspace upgrade sstables by keyspace get params +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cf != nil { + + // query param cf + var qrCf string + if o.Cf != nil { + qrCf = *o.Cf + } + qCf := qrCf + if qCf != "" { + if err := r.SetQueryParam("cf", qCf); err != nil { + return err + } + } + + } + + if o.ExcludeCurrentVersion != nil { + + // query param exclude_current_version + var qrExcludeCurrentVersion bool + if o.ExcludeCurrentVersion != nil { + qrExcludeCurrentVersion = *o.ExcludeCurrentVersion + } + qExcludeCurrentVersion := swag.FormatBool(qrExcludeCurrentVersion) + if qExcludeCurrentVersion != "" { + if err := r.SetQueryParam("exclude_current_version", qExcludeCurrentVersion); err != nil { + return err + } + } + + } + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_upgrade_sstables_by_keyspace_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_upgrade_sstables_by_keyspace_get_responses.go new file mode 100644 index 0000000000..4d3a905ec5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspace_upgrade_sstables_by_keyspace_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetReader is a Reader for the StorageServiceKeyspaceUpgradeSstablesByKeyspaceGet structure. +type StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceKeyspaceUpgradeSstablesByKeyspaceGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceKeyspaceUpgradeSstablesByKeyspaceGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceKeyspaceUpgradeSstablesByKeyspaceGetOK creates a StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetOK with default headers values +func NewStorageServiceKeyspaceUpgradeSstablesByKeyspaceGetOK() *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetOK { + return &StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetOK{} +} + +/* +StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetOK handles this case with default header values. + +Success +*/ +type StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetOK struct { + Payload int32 +} + +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceKeyspaceUpgradeSstablesByKeyspaceGetDefault creates a StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetDefault with default headers values +func NewStorageServiceKeyspaceUpgradeSstablesByKeyspaceGetDefault(code int) *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetDefault { + return &StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service keyspace upgrade sstables by keyspace get default response +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceKeyspaceUpgradeSstablesByKeyspaceGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspaces_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspaces_get_parameters.go new file mode 100644 index 0000000000..19a1b7e915 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspaces_get_parameters.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceKeyspacesGetParams creates a new StorageServiceKeyspacesGetParams object +// with the default values initialized. +func NewStorageServiceKeyspacesGetParams() *StorageServiceKeyspacesGetParams { + var () + return &StorageServiceKeyspacesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceKeyspacesGetParamsWithTimeout creates a new StorageServiceKeyspacesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceKeyspacesGetParamsWithTimeout(timeout time.Duration) *StorageServiceKeyspacesGetParams { + var () + return &StorageServiceKeyspacesGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceKeyspacesGetParamsWithContext creates a new StorageServiceKeyspacesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceKeyspacesGetParamsWithContext(ctx context.Context) *StorageServiceKeyspacesGetParams { + var () + return &StorageServiceKeyspacesGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceKeyspacesGetParamsWithHTTPClient creates a new StorageServiceKeyspacesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceKeyspacesGetParamsWithHTTPClient(client *http.Client) *StorageServiceKeyspacesGetParams { + var () + return &StorageServiceKeyspacesGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceKeyspacesGetParams contains all the parameters to send to the API endpoint +for the storage service keyspaces get operation typically these are written to a http.Request +*/ +type StorageServiceKeyspacesGetParams struct { + + /*Replication + Filter keyspaces for the replication used: vnodes or tablets (default: all) + + */ + Replication *string + /*Type + Which keyspaces to return + + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service keyspaces get params +func (o *StorageServiceKeyspacesGetParams) WithTimeout(timeout time.Duration) *StorageServiceKeyspacesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service keyspaces get params +func (o *StorageServiceKeyspacesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service keyspaces get params +func (o *StorageServiceKeyspacesGetParams) WithContext(ctx context.Context) *StorageServiceKeyspacesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service keyspaces get params +func (o *StorageServiceKeyspacesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service keyspaces get params +func (o *StorageServiceKeyspacesGetParams) WithHTTPClient(client *http.Client) *StorageServiceKeyspacesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service keyspaces get params +func (o *StorageServiceKeyspacesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithReplication adds the replication to the storage service keyspaces get params +func (o *StorageServiceKeyspacesGetParams) WithReplication(replication *string) *StorageServiceKeyspacesGetParams { + o.SetReplication(replication) + return o +} + +// SetReplication adds the replication to the storage service keyspaces get params +func (o *StorageServiceKeyspacesGetParams) SetReplication(replication *string) { + o.Replication = replication +} + +// WithType adds the typeVar to the storage service keyspaces get params +func (o *StorageServiceKeyspacesGetParams) WithType(typeVar *string) *StorageServiceKeyspacesGetParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the storage service keyspaces get params +func (o *StorageServiceKeyspacesGetParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceKeyspacesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Replication != nil { + + // query param replication + var qrReplication string + if o.Replication != nil { + qrReplication = *o.Replication + } + qReplication := qrReplication + if qReplication != "" { + if err := r.SetQueryParam("replication", qReplication); err != nil { + return err + } + } + + } + + if o.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspaces_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspaces_get_responses.go new file mode 100644 index 0000000000..5aae381982 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_keyspaces_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceKeyspacesGetReader is a Reader for the StorageServiceKeyspacesGet structure. +type StorageServiceKeyspacesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceKeyspacesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceKeyspacesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceKeyspacesGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceKeyspacesGetOK creates a StorageServiceKeyspacesGetOK with default headers values +func NewStorageServiceKeyspacesGetOK() *StorageServiceKeyspacesGetOK { + return &StorageServiceKeyspacesGetOK{} +} + +/* +StorageServiceKeyspacesGetOK handles this case with default header values. + +Success +*/ +type StorageServiceKeyspacesGetOK struct { + Payload []string +} + +func (o *StorageServiceKeyspacesGetOK) GetPayload() []string { + return o.Payload +} + +func (o *StorageServiceKeyspacesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceKeyspacesGetDefault creates a StorageServiceKeyspacesGetDefault with default headers values +func NewStorageServiceKeyspacesGetDefault(code int) *StorageServiceKeyspacesGetDefault { + return &StorageServiceKeyspacesGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceKeyspacesGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceKeyspacesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service keyspaces get default response +func (o *StorageServiceKeyspacesGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceKeyspacesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceKeyspacesGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceKeyspacesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_load_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_load_get_parameters.go new file mode 100644 index 0000000000..5b755932de --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_load_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceLoadGetParams creates a new StorageServiceLoadGetParams object +// with the default values initialized. +func NewStorageServiceLoadGetParams() *StorageServiceLoadGetParams { + + return &StorageServiceLoadGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceLoadGetParamsWithTimeout creates a new StorageServiceLoadGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceLoadGetParamsWithTimeout(timeout time.Duration) *StorageServiceLoadGetParams { + + return &StorageServiceLoadGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceLoadGetParamsWithContext creates a new StorageServiceLoadGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceLoadGetParamsWithContext(ctx context.Context) *StorageServiceLoadGetParams { + + return &StorageServiceLoadGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceLoadGetParamsWithHTTPClient creates a new StorageServiceLoadGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceLoadGetParamsWithHTTPClient(client *http.Client) *StorageServiceLoadGetParams { + + return &StorageServiceLoadGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceLoadGetParams contains all the parameters to send to the API endpoint +for the storage service load get operation typically these are written to a http.Request +*/ +type StorageServiceLoadGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service load get params +func (o *StorageServiceLoadGetParams) WithTimeout(timeout time.Duration) *StorageServiceLoadGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service load get params +func (o *StorageServiceLoadGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service load get params +func (o *StorageServiceLoadGetParams) WithContext(ctx context.Context) *StorageServiceLoadGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service load get params +func (o *StorageServiceLoadGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service load get params +func (o *StorageServiceLoadGetParams) WithHTTPClient(client *http.Client) *StorageServiceLoadGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service load get params +func (o *StorageServiceLoadGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceLoadGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_load_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_load_get_responses.go new file mode 100644 index 0000000000..62ed6e3d6a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_load_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceLoadGetReader is a Reader for the StorageServiceLoadGet structure. +type StorageServiceLoadGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceLoadGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceLoadGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceLoadGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceLoadGetOK creates a StorageServiceLoadGetOK with default headers values +func NewStorageServiceLoadGetOK() *StorageServiceLoadGetOK { + return &StorageServiceLoadGetOK{} +} + +/* +StorageServiceLoadGetOK handles this case with default header values. + +Success +*/ +type StorageServiceLoadGetOK struct { + Payload interface{} +} + +func (o *StorageServiceLoadGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageServiceLoadGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceLoadGetDefault creates a StorageServiceLoadGetDefault with default headers values +func NewStorageServiceLoadGetDefault(code int) *StorageServiceLoadGetDefault { + return &StorageServiceLoadGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceLoadGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceLoadGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service load get default response +func (o *StorageServiceLoadGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceLoadGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceLoadGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceLoadGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_load_map_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_load_map_get_parameters.go new file mode 100644 index 0000000000..8dfa59af00 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_load_map_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceLoadMapGetParams creates a new StorageServiceLoadMapGetParams object +// with the default values initialized. +func NewStorageServiceLoadMapGetParams() *StorageServiceLoadMapGetParams { + + return &StorageServiceLoadMapGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceLoadMapGetParamsWithTimeout creates a new StorageServiceLoadMapGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceLoadMapGetParamsWithTimeout(timeout time.Duration) *StorageServiceLoadMapGetParams { + + return &StorageServiceLoadMapGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceLoadMapGetParamsWithContext creates a new StorageServiceLoadMapGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceLoadMapGetParamsWithContext(ctx context.Context) *StorageServiceLoadMapGetParams { + + return &StorageServiceLoadMapGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceLoadMapGetParamsWithHTTPClient creates a new StorageServiceLoadMapGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceLoadMapGetParamsWithHTTPClient(client *http.Client) *StorageServiceLoadMapGetParams { + + return &StorageServiceLoadMapGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceLoadMapGetParams contains all the parameters to send to the API endpoint +for the storage service load map get operation typically these are written to a http.Request +*/ +type StorageServiceLoadMapGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service load map get params +func (o *StorageServiceLoadMapGetParams) WithTimeout(timeout time.Duration) *StorageServiceLoadMapGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service load map get params +func (o *StorageServiceLoadMapGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service load map get params +func (o *StorageServiceLoadMapGetParams) WithContext(ctx context.Context) *StorageServiceLoadMapGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service load map get params +func (o *StorageServiceLoadMapGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service load map get params +func (o *StorageServiceLoadMapGetParams) WithHTTPClient(client *http.Client) *StorageServiceLoadMapGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service load map get params +func (o *StorageServiceLoadMapGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceLoadMapGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_load_map_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_load_map_get_responses.go new file mode 100644 index 0000000000..45ece05225 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_load_map_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceLoadMapGetReader is a Reader for the StorageServiceLoadMapGet structure. +type StorageServiceLoadMapGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceLoadMapGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceLoadMapGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceLoadMapGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceLoadMapGetOK creates a StorageServiceLoadMapGetOK with default headers values +func NewStorageServiceLoadMapGetOK() *StorageServiceLoadMapGetOK { + return &StorageServiceLoadMapGetOK{} +} + +/* +StorageServiceLoadMapGetOK handles this case with default header values. + +Success +*/ +type StorageServiceLoadMapGetOK struct { + Payload []*models.MapStringDouble +} + +func (o *StorageServiceLoadMapGetOK) GetPayload() []*models.MapStringDouble { + return o.Payload +} + +func (o *StorageServiceLoadMapGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceLoadMapGetDefault creates a StorageServiceLoadMapGetDefault with default headers values +func NewStorageServiceLoadMapGetDefault(code int) *StorageServiceLoadMapGetDefault { + return &StorageServiceLoadMapGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceLoadMapGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceLoadMapGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service load map get default response +func (o *StorageServiceLoadMapGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceLoadMapGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceLoadMapGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceLoadMapGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_logging_level_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_logging_level_get_parameters.go new file mode 100644 index 0000000000..f52d345887 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_logging_level_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceLoggingLevelGetParams creates a new StorageServiceLoggingLevelGetParams object +// with the default values initialized. +func NewStorageServiceLoggingLevelGetParams() *StorageServiceLoggingLevelGetParams { + + return &StorageServiceLoggingLevelGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceLoggingLevelGetParamsWithTimeout creates a new StorageServiceLoggingLevelGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceLoggingLevelGetParamsWithTimeout(timeout time.Duration) *StorageServiceLoggingLevelGetParams { + + return &StorageServiceLoggingLevelGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceLoggingLevelGetParamsWithContext creates a new StorageServiceLoggingLevelGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceLoggingLevelGetParamsWithContext(ctx context.Context) *StorageServiceLoggingLevelGetParams { + + return &StorageServiceLoggingLevelGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceLoggingLevelGetParamsWithHTTPClient creates a new StorageServiceLoggingLevelGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceLoggingLevelGetParamsWithHTTPClient(client *http.Client) *StorageServiceLoggingLevelGetParams { + + return &StorageServiceLoggingLevelGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceLoggingLevelGetParams contains all the parameters to send to the API endpoint +for the storage service logging level get operation typically these are written to a http.Request +*/ +type StorageServiceLoggingLevelGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service logging level get params +func (o *StorageServiceLoggingLevelGetParams) WithTimeout(timeout time.Duration) *StorageServiceLoggingLevelGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service logging level get params +func (o *StorageServiceLoggingLevelGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service logging level get params +func (o *StorageServiceLoggingLevelGetParams) WithContext(ctx context.Context) *StorageServiceLoggingLevelGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service logging level get params +func (o *StorageServiceLoggingLevelGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service logging level get params +func (o *StorageServiceLoggingLevelGetParams) WithHTTPClient(client *http.Client) *StorageServiceLoggingLevelGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service logging level get params +func (o *StorageServiceLoggingLevelGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceLoggingLevelGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_logging_level_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_logging_level_get_responses.go new file mode 100644 index 0000000000..cde3b9924a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_logging_level_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceLoggingLevelGetReader is a Reader for the StorageServiceLoggingLevelGet structure. +type StorageServiceLoggingLevelGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceLoggingLevelGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceLoggingLevelGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceLoggingLevelGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceLoggingLevelGetOK creates a StorageServiceLoggingLevelGetOK with default headers values +func NewStorageServiceLoggingLevelGetOK() *StorageServiceLoggingLevelGetOK { + return &StorageServiceLoggingLevelGetOK{} +} + +/* +StorageServiceLoggingLevelGetOK handles this case with default header values. + +Success +*/ +type StorageServiceLoggingLevelGetOK struct { + Payload []*models.Mapper +} + +func (o *StorageServiceLoggingLevelGetOK) GetPayload() []*models.Mapper { + return o.Payload +} + +func (o *StorageServiceLoggingLevelGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceLoggingLevelGetDefault creates a StorageServiceLoggingLevelGetDefault with default headers values +func NewStorageServiceLoggingLevelGetDefault(code int) *StorageServiceLoggingLevelGetDefault { + return &StorageServiceLoggingLevelGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceLoggingLevelGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceLoggingLevelGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service logging level get default response +func (o *StorageServiceLoggingLevelGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceLoggingLevelGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceLoggingLevelGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceLoggingLevelGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_logging_level_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_logging_level_post_parameters.go new file mode 100644 index 0000000000..baa69463cc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_logging_level_post_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceLoggingLevelPostParams creates a new StorageServiceLoggingLevelPostParams object +// with the default values initialized. +func NewStorageServiceLoggingLevelPostParams() *StorageServiceLoggingLevelPostParams { + var () + return &StorageServiceLoggingLevelPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceLoggingLevelPostParamsWithTimeout creates a new StorageServiceLoggingLevelPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceLoggingLevelPostParamsWithTimeout(timeout time.Duration) *StorageServiceLoggingLevelPostParams { + var () + return &StorageServiceLoggingLevelPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceLoggingLevelPostParamsWithContext creates a new StorageServiceLoggingLevelPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceLoggingLevelPostParamsWithContext(ctx context.Context) *StorageServiceLoggingLevelPostParams { + var () + return &StorageServiceLoggingLevelPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceLoggingLevelPostParamsWithHTTPClient creates a new StorageServiceLoggingLevelPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceLoggingLevelPostParamsWithHTTPClient(client *http.Client) *StorageServiceLoggingLevelPostParams { + var () + return &StorageServiceLoggingLevelPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceLoggingLevelPostParams contains all the parameters to send to the API endpoint +for the storage service logging level post operation typically these are written to a http.Request +*/ +type StorageServiceLoggingLevelPostParams struct { + + /*ClassQualifier + The logger's classQualifer + + */ + ClassQualifier string + /*Level + The log level + + */ + Level string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service logging level post params +func (o *StorageServiceLoggingLevelPostParams) WithTimeout(timeout time.Duration) *StorageServiceLoggingLevelPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service logging level post params +func (o *StorageServiceLoggingLevelPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service logging level post params +func (o *StorageServiceLoggingLevelPostParams) WithContext(ctx context.Context) *StorageServiceLoggingLevelPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service logging level post params +func (o *StorageServiceLoggingLevelPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service logging level post params +func (o *StorageServiceLoggingLevelPostParams) WithHTTPClient(client *http.Client) *StorageServiceLoggingLevelPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service logging level post params +func (o *StorageServiceLoggingLevelPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClassQualifier adds the classQualifier to the storage service logging level post params +func (o *StorageServiceLoggingLevelPostParams) WithClassQualifier(classQualifier string) *StorageServiceLoggingLevelPostParams { + o.SetClassQualifier(classQualifier) + return o +} + +// SetClassQualifier adds the classQualifier to the storage service logging level post params +func (o *StorageServiceLoggingLevelPostParams) SetClassQualifier(classQualifier string) { + o.ClassQualifier = classQualifier +} + +// WithLevel adds the level to the storage service logging level post params +func (o *StorageServiceLoggingLevelPostParams) WithLevel(level string) *StorageServiceLoggingLevelPostParams { + o.SetLevel(level) + return o +} + +// SetLevel adds the level to the storage service logging level post params +func (o *StorageServiceLoggingLevelPostParams) SetLevel(level string) { + o.Level = level +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceLoggingLevelPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param class_qualifier + qrClassQualifier := o.ClassQualifier + qClassQualifier := qrClassQualifier + if qClassQualifier != "" { + if err := r.SetQueryParam("class_qualifier", qClassQualifier); err != nil { + return err + } + } + + // query param level + qrLevel := o.Level + qLevel := qrLevel + if qLevel != "" { + if err := r.SetQueryParam("level", qLevel); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_logging_level_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_logging_level_post_responses.go new file mode 100644 index 0000000000..f9dae77e43 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_logging_level_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceLoggingLevelPostReader is a Reader for the StorageServiceLoggingLevelPost structure. +type StorageServiceLoggingLevelPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceLoggingLevelPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceLoggingLevelPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceLoggingLevelPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceLoggingLevelPostOK creates a StorageServiceLoggingLevelPostOK with default headers values +func NewStorageServiceLoggingLevelPostOK() *StorageServiceLoggingLevelPostOK { + return &StorageServiceLoggingLevelPostOK{} +} + +/* +StorageServiceLoggingLevelPostOK handles this case with default header values. + +Success +*/ +type StorageServiceLoggingLevelPostOK struct { +} + +func (o *StorageServiceLoggingLevelPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceLoggingLevelPostDefault creates a StorageServiceLoggingLevelPostDefault with default headers values +func NewStorageServiceLoggingLevelPostDefault(code int) *StorageServiceLoggingLevelPostDefault { + return &StorageServiceLoggingLevelPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceLoggingLevelPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceLoggingLevelPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service logging level post default response +func (o *StorageServiceLoggingLevelPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceLoggingLevelPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceLoggingLevelPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceLoggingLevelPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_exceptions_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_exceptions_get_parameters.go new file mode 100644 index 0000000000..95d6b8f760 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_exceptions_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceMetricsExceptionsGetParams creates a new StorageServiceMetricsExceptionsGetParams object +// with the default values initialized. +func NewStorageServiceMetricsExceptionsGetParams() *StorageServiceMetricsExceptionsGetParams { + + return &StorageServiceMetricsExceptionsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceMetricsExceptionsGetParamsWithTimeout creates a new StorageServiceMetricsExceptionsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceMetricsExceptionsGetParamsWithTimeout(timeout time.Duration) *StorageServiceMetricsExceptionsGetParams { + + return &StorageServiceMetricsExceptionsGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceMetricsExceptionsGetParamsWithContext creates a new StorageServiceMetricsExceptionsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceMetricsExceptionsGetParamsWithContext(ctx context.Context) *StorageServiceMetricsExceptionsGetParams { + + return &StorageServiceMetricsExceptionsGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceMetricsExceptionsGetParamsWithHTTPClient creates a new StorageServiceMetricsExceptionsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceMetricsExceptionsGetParamsWithHTTPClient(client *http.Client) *StorageServiceMetricsExceptionsGetParams { + + return &StorageServiceMetricsExceptionsGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceMetricsExceptionsGetParams contains all the parameters to send to the API endpoint +for the storage service metrics exceptions get operation typically these are written to a http.Request +*/ +type StorageServiceMetricsExceptionsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service metrics exceptions get params +func (o *StorageServiceMetricsExceptionsGetParams) WithTimeout(timeout time.Duration) *StorageServiceMetricsExceptionsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service metrics exceptions get params +func (o *StorageServiceMetricsExceptionsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service metrics exceptions get params +func (o *StorageServiceMetricsExceptionsGetParams) WithContext(ctx context.Context) *StorageServiceMetricsExceptionsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service metrics exceptions get params +func (o *StorageServiceMetricsExceptionsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service metrics exceptions get params +func (o *StorageServiceMetricsExceptionsGetParams) WithHTTPClient(client *http.Client) *StorageServiceMetricsExceptionsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service metrics exceptions get params +func (o *StorageServiceMetricsExceptionsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceMetricsExceptionsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_exceptions_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_exceptions_get_responses.go new file mode 100644 index 0000000000..a9dc2a997d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_exceptions_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceMetricsExceptionsGetReader is a Reader for the StorageServiceMetricsExceptionsGet structure. +type StorageServiceMetricsExceptionsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceMetricsExceptionsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceMetricsExceptionsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceMetricsExceptionsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceMetricsExceptionsGetOK creates a StorageServiceMetricsExceptionsGetOK with default headers values +func NewStorageServiceMetricsExceptionsGetOK() *StorageServiceMetricsExceptionsGetOK { + return &StorageServiceMetricsExceptionsGetOK{} +} + +/* +StorageServiceMetricsExceptionsGetOK handles this case with default header values. + +Success +*/ +type StorageServiceMetricsExceptionsGetOK struct { + Payload int32 +} + +func (o *StorageServiceMetricsExceptionsGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageServiceMetricsExceptionsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceMetricsExceptionsGetDefault creates a StorageServiceMetricsExceptionsGetDefault with default headers values +func NewStorageServiceMetricsExceptionsGetDefault(code int) *StorageServiceMetricsExceptionsGetDefault { + return &StorageServiceMetricsExceptionsGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceMetricsExceptionsGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceMetricsExceptionsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service metrics exceptions get default response +func (o *StorageServiceMetricsExceptionsGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceMetricsExceptionsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceMetricsExceptionsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceMetricsExceptionsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_hints_in_progress_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_hints_in_progress_get_parameters.go new file mode 100644 index 0000000000..8828fde126 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_hints_in_progress_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceMetricsHintsInProgressGetParams creates a new StorageServiceMetricsHintsInProgressGetParams object +// with the default values initialized. +func NewStorageServiceMetricsHintsInProgressGetParams() *StorageServiceMetricsHintsInProgressGetParams { + + return &StorageServiceMetricsHintsInProgressGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceMetricsHintsInProgressGetParamsWithTimeout creates a new StorageServiceMetricsHintsInProgressGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceMetricsHintsInProgressGetParamsWithTimeout(timeout time.Duration) *StorageServiceMetricsHintsInProgressGetParams { + + return &StorageServiceMetricsHintsInProgressGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceMetricsHintsInProgressGetParamsWithContext creates a new StorageServiceMetricsHintsInProgressGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceMetricsHintsInProgressGetParamsWithContext(ctx context.Context) *StorageServiceMetricsHintsInProgressGetParams { + + return &StorageServiceMetricsHintsInProgressGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceMetricsHintsInProgressGetParamsWithHTTPClient creates a new StorageServiceMetricsHintsInProgressGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceMetricsHintsInProgressGetParamsWithHTTPClient(client *http.Client) *StorageServiceMetricsHintsInProgressGetParams { + + return &StorageServiceMetricsHintsInProgressGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceMetricsHintsInProgressGetParams contains all the parameters to send to the API endpoint +for the storage service metrics hints in progress get operation typically these are written to a http.Request +*/ +type StorageServiceMetricsHintsInProgressGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service metrics hints in progress get params +func (o *StorageServiceMetricsHintsInProgressGetParams) WithTimeout(timeout time.Duration) *StorageServiceMetricsHintsInProgressGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service metrics hints in progress get params +func (o *StorageServiceMetricsHintsInProgressGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service metrics hints in progress get params +func (o *StorageServiceMetricsHintsInProgressGetParams) WithContext(ctx context.Context) *StorageServiceMetricsHintsInProgressGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service metrics hints in progress get params +func (o *StorageServiceMetricsHintsInProgressGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service metrics hints in progress get params +func (o *StorageServiceMetricsHintsInProgressGetParams) WithHTTPClient(client *http.Client) *StorageServiceMetricsHintsInProgressGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service metrics hints in progress get params +func (o *StorageServiceMetricsHintsInProgressGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceMetricsHintsInProgressGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_hints_in_progress_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_hints_in_progress_get_responses.go new file mode 100644 index 0000000000..33d8e9fa52 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_hints_in_progress_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceMetricsHintsInProgressGetReader is a Reader for the StorageServiceMetricsHintsInProgressGet structure. +type StorageServiceMetricsHintsInProgressGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceMetricsHintsInProgressGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceMetricsHintsInProgressGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceMetricsHintsInProgressGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceMetricsHintsInProgressGetOK creates a StorageServiceMetricsHintsInProgressGetOK with default headers values +func NewStorageServiceMetricsHintsInProgressGetOK() *StorageServiceMetricsHintsInProgressGetOK { + return &StorageServiceMetricsHintsInProgressGetOK{} +} + +/* +StorageServiceMetricsHintsInProgressGetOK handles this case with default header values. + +Success +*/ +type StorageServiceMetricsHintsInProgressGetOK struct { + Payload int32 +} + +func (o *StorageServiceMetricsHintsInProgressGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageServiceMetricsHintsInProgressGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceMetricsHintsInProgressGetDefault creates a StorageServiceMetricsHintsInProgressGetDefault with default headers values +func NewStorageServiceMetricsHintsInProgressGetDefault(code int) *StorageServiceMetricsHintsInProgressGetDefault { + return &StorageServiceMetricsHintsInProgressGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceMetricsHintsInProgressGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceMetricsHintsInProgressGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service metrics hints in progress get default response +func (o *StorageServiceMetricsHintsInProgressGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceMetricsHintsInProgressGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceMetricsHintsInProgressGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceMetricsHintsInProgressGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_load_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_load_get_parameters.go new file mode 100644 index 0000000000..2632ea1b79 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_load_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceMetricsLoadGetParams creates a new StorageServiceMetricsLoadGetParams object +// with the default values initialized. +func NewStorageServiceMetricsLoadGetParams() *StorageServiceMetricsLoadGetParams { + + return &StorageServiceMetricsLoadGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceMetricsLoadGetParamsWithTimeout creates a new StorageServiceMetricsLoadGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceMetricsLoadGetParamsWithTimeout(timeout time.Duration) *StorageServiceMetricsLoadGetParams { + + return &StorageServiceMetricsLoadGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceMetricsLoadGetParamsWithContext creates a new StorageServiceMetricsLoadGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceMetricsLoadGetParamsWithContext(ctx context.Context) *StorageServiceMetricsLoadGetParams { + + return &StorageServiceMetricsLoadGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceMetricsLoadGetParamsWithHTTPClient creates a new StorageServiceMetricsLoadGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceMetricsLoadGetParamsWithHTTPClient(client *http.Client) *StorageServiceMetricsLoadGetParams { + + return &StorageServiceMetricsLoadGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceMetricsLoadGetParams contains all the parameters to send to the API endpoint +for the storage service metrics load get operation typically these are written to a http.Request +*/ +type StorageServiceMetricsLoadGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service metrics load get params +func (o *StorageServiceMetricsLoadGetParams) WithTimeout(timeout time.Duration) *StorageServiceMetricsLoadGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service metrics load get params +func (o *StorageServiceMetricsLoadGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service metrics load get params +func (o *StorageServiceMetricsLoadGetParams) WithContext(ctx context.Context) *StorageServiceMetricsLoadGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service metrics load get params +func (o *StorageServiceMetricsLoadGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service metrics load get params +func (o *StorageServiceMetricsLoadGetParams) WithHTTPClient(client *http.Client) *StorageServiceMetricsLoadGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service metrics load get params +func (o *StorageServiceMetricsLoadGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceMetricsLoadGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_load_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_load_get_responses.go new file mode 100644 index 0000000000..e563f1288f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_load_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceMetricsLoadGetReader is a Reader for the StorageServiceMetricsLoadGet structure. +type StorageServiceMetricsLoadGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceMetricsLoadGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceMetricsLoadGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceMetricsLoadGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceMetricsLoadGetOK creates a StorageServiceMetricsLoadGetOK with default headers values +func NewStorageServiceMetricsLoadGetOK() *StorageServiceMetricsLoadGetOK { + return &StorageServiceMetricsLoadGetOK{} +} + +/* +StorageServiceMetricsLoadGetOK handles this case with default header values. + +Success +*/ +type StorageServiceMetricsLoadGetOK struct { + Payload int32 +} + +func (o *StorageServiceMetricsLoadGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageServiceMetricsLoadGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceMetricsLoadGetDefault creates a StorageServiceMetricsLoadGetDefault with default headers values +func NewStorageServiceMetricsLoadGetDefault(code int) *StorageServiceMetricsLoadGetDefault { + return &StorageServiceMetricsLoadGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceMetricsLoadGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceMetricsLoadGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service metrics load get default response +func (o *StorageServiceMetricsLoadGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceMetricsLoadGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceMetricsLoadGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceMetricsLoadGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_total_hints_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_total_hints_get_parameters.go new file mode 100644 index 0000000000..3e26ad677c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_total_hints_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceMetricsTotalHintsGetParams creates a new StorageServiceMetricsTotalHintsGetParams object +// with the default values initialized. +func NewStorageServiceMetricsTotalHintsGetParams() *StorageServiceMetricsTotalHintsGetParams { + + return &StorageServiceMetricsTotalHintsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceMetricsTotalHintsGetParamsWithTimeout creates a new StorageServiceMetricsTotalHintsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceMetricsTotalHintsGetParamsWithTimeout(timeout time.Duration) *StorageServiceMetricsTotalHintsGetParams { + + return &StorageServiceMetricsTotalHintsGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceMetricsTotalHintsGetParamsWithContext creates a new StorageServiceMetricsTotalHintsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceMetricsTotalHintsGetParamsWithContext(ctx context.Context) *StorageServiceMetricsTotalHintsGetParams { + + return &StorageServiceMetricsTotalHintsGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceMetricsTotalHintsGetParamsWithHTTPClient creates a new StorageServiceMetricsTotalHintsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceMetricsTotalHintsGetParamsWithHTTPClient(client *http.Client) *StorageServiceMetricsTotalHintsGetParams { + + return &StorageServiceMetricsTotalHintsGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceMetricsTotalHintsGetParams contains all the parameters to send to the API endpoint +for the storage service metrics total hints get operation typically these are written to a http.Request +*/ +type StorageServiceMetricsTotalHintsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service metrics total hints get params +func (o *StorageServiceMetricsTotalHintsGetParams) WithTimeout(timeout time.Duration) *StorageServiceMetricsTotalHintsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service metrics total hints get params +func (o *StorageServiceMetricsTotalHintsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service metrics total hints get params +func (o *StorageServiceMetricsTotalHintsGetParams) WithContext(ctx context.Context) *StorageServiceMetricsTotalHintsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service metrics total hints get params +func (o *StorageServiceMetricsTotalHintsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service metrics total hints get params +func (o *StorageServiceMetricsTotalHintsGetParams) WithHTTPClient(client *http.Client) *StorageServiceMetricsTotalHintsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service metrics total hints get params +func (o *StorageServiceMetricsTotalHintsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceMetricsTotalHintsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_total_hints_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_total_hints_get_responses.go new file mode 100644 index 0000000000..22baca2d1a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_metrics_total_hints_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceMetricsTotalHintsGetReader is a Reader for the StorageServiceMetricsTotalHintsGet structure. +type StorageServiceMetricsTotalHintsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceMetricsTotalHintsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceMetricsTotalHintsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceMetricsTotalHintsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceMetricsTotalHintsGetOK creates a StorageServiceMetricsTotalHintsGetOK with default headers values +func NewStorageServiceMetricsTotalHintsGetOK() *StorageServiceMetricsTotalHintsGetOK { + return &StorageServiceMetricsTotalHintsGetOK{} +} + +/* +StorageServiceMetricsTotalHintsGetOK handles this case with default header values. + +Success +*/ +type StorageServiceMetricsTotalHintsGetOK struct { + Payload int32 +} + +func (o *StorageServiceMetricsTotalHintsGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageServiceMetricsTotalHintsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceMetricsTotalHintsGetDefault creates a StorageServiceMetricsTotalHintsGetDefault with default headers values +func NewStorageServiceMetricsTotalHintsGetDefault(code int) *StorageServiceMetricsTotalHintsGetDefault { + return &StorageServiceMetricsTotalHintsGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceMetricsTotalHintsGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceMetricsTotalHintsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service metrics total hints get default response +func (o *StorageServiceMetricsTotalHintsGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceMetricsTotalHintsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceMetricsTotalHintsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceMetricsTotalHintsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_move_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_move_post_parameters.go new file mode 100644 index 0000000000..72590b8a18 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_move_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceMovePostParams creates a new StorageServiceMovePostParams object +// with the default values initialized. +func NewStorageServiceMovePostParams() *StorageServiceMovePostParams { + var () + return &StorageServiceMovePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceMovePostParamsWithTimeout creates a new StorageServiceMovePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceMovePostParamsWithTimeout(timeout time.Duration) *StorageServiceMovePostParams { + var () + return &StorageServiceMovePostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceMovePostParamsWithContext creates a new StorageServiceMovePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceMovePostParamsWithContext(ctx context.Context) *StorageServiceMovePostParams { + var () + return &StorageServiceMovePostParams{ + + Context: ctx, + } +} + +// NewStorageServiceMovePostParamsWithHTTPClient creates a new StorageServiceMovePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceMovePostParamsWithHTTPClient(client *http.Client) *StorageServiceMovePostParams { + var () + return &StorageServiceMovePostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceMovePostParams contains all the parameters to send to the API endpoint +for the storage service move post operation typically these are written to a http.Request +*/ +type StorageServiceMovePostParams struct { + + /*NewToken + token to move this node to + + */ + NewToken string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service move post params +func (o *StorageServiceMovePostParams) WithTimeout(timeout time.Duration) *StorageServiceMovePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service move post params +func (o *StorageServiceMovePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service move post params +func (o *StorageServiceMovePostParams) WithContext(ctx context.Context) *StorageServiceMovePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service move post params +func (o *StorageServiceMovePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service move post params +func (o *StorageServiceMovePostParams) WithHTTPClient(client *http.Client) *StorageServiceMovePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service move post params +func (o *StorageServiceMovePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNewToken adds the newToken to the storage service move post params +func (o *StorageServiceMovePostParams) WithNewToken(newToken string) *StorageServiceMovePostParams { + o.SetNewToken(newToken) + return o +} + +// SetNewToken adds the newToken to the storage service move post params +func (o *StorageServiceMovePostParams) SetNewToken(newToken string) { + o.NewToken = newToken +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceMovePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param new_token + qrNewToken := o.NewToken + qNewToken := qrNewToken + if qNewToken != "" { + if err := r.SetQueryParam("new_token", qNewToken); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_move_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_move_post_responses.go new file mode 100644 index 0000000000..811c4ab943 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_move_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceMovePostReader is a Reader for the StorageServiceMovePost structure. +type StorageServiceMovePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceMovePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceMovePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceMovePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceMovePostOK creates a StorageServiceMovePostOK with default headers values +func NewStorageServiceMovePostOK() *StorageServiceMovePostOK { + return &StorageServiceMovePostOK{} +} + +/* +StorageServiceMovePostOK handles this case with default header values. + +Success +*/ +type StorageServiceMovePostOK struct { +} + +func (o *StorageServiceMovePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceMovePostDefault creates a StorageServiceMovePostDefault with default headers values +func NewStorageServiceMovePostDefault(code int) *StorageServiceMovePostDefault { + return &StorageServiceMovePostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceMovePostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceMovePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service move post default response +func (o *StorageServiceMovePostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceMovePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceMovePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceMovePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_delete_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_delete_parameters.go new file mode 100644 index 0000000000..6c8d0b8871 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_delete_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceNativeTransportDeleteParams creates a new StorageServiceNativeTransportDeleteParams object +// with the default values initialized. +func NewStorageServiceNativeTransportDeleteParams() *StorageServiceNativeTransportDeleteParams { + + return &StorageServiceNativeTransportDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceNativeTransportDeleteParamsWithTimeout creates a new StorageServiceNativeTransportDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceNativeTransportDeleteParamsWithTimeout(timeout time.Duration) *StorageServiceNativeTransportDeleteParams { + + return &StorageServiceNativeTransportDeleteParams{ + + timeout: timeout, + } +} + +// NewStorageServiceNativeTransportDeleteParamsWithContext creates a new StorageServiceNativeTransportDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceNativeTransportDeleteParamsWithContext(ctx context.Context) *StorageServiceNativeTransportDeleteParams { + + return &StorageServiceNativeTransportDeleteParams{ + + Context: ctx, + } +} + +// NewStorageServiceNativeTransportDeleteParamsWithHTTPClient creates a new StorageServiceNativeTransportDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceNativeTransportDeleteParamsWithHTTPClient(client *http.Client) *StorageServiceNativeTransportDeleteParams { + + return &StorageServiceNativeTransportDeleteParams{ + HTTPClient: client, + } +} + +/* +StorageServiceNativeTransportDeleteParams contains all the parameters to send to the API endpoint +for the storage service native transport delete operation typically these are written to a http.Request +*/ +type StorageServiceNativeTransportDeleteParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service native transport delete params +func (o *StorageServiceNativeTransportDeleteParams) WithTimeout(timeout time.Duration) *StorageServiceNativeTransportDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service native transport delete params +func (o *StorageServiceNativeTransportDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service native transport delete params +func (o *StorageServiceNativeTransportDeleteParams) WithContext(ctx context.Context) *StorageServiceNativeTransportDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service native transport delete params +func (o *StorageServiceNativeTransportDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service native transport delete params +func (o *StorageServiceNativeTransportDeleteParams) WithHTTPClient(client *http.Client) *StorageServiceNativeTransportDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service native transport delete params +func (o *StorageServiceNativeTransportDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceNativeTransportDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_delete_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_delete_responses.go new file mode 100644 index 0000000000..8f5fbcc88d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_delete_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceNativeTransportDeleteReader is a Reader for the StorageServiceNativeTransportDelete structure. +type StorageServiceNativeTransportDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceNativeTransportDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceNativeTransportDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceNativeTransportDeleteDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceNativeTransportDeleteOK creates a StorageServiceNativeTransportDeleteOK with default headers values +func NewStorageServiceNativeTransportDeleteOK() *StorageServiceNativeTransportDeleteOK { + return &StorageServiceNativeTransportDeleteOK{} +} + +/* +StorageServiceNativeTransportDeleteOK handles this case with default header values. + +Success +*/ +type StorageServiceNativeTransportDeleteOK struct { +} + +func (o *StorageServiceNativeTransportDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceNativeTransportDeleteDefault creates a StorageServiceNativeTransportDeleteDefault with default headers values +func NewStorageServiceNativeTransportDeleteDefault(code int) *StorageServiceNativeTransportDeleteDefault { + return &StorageServiceNativeTransportDeleteDefault{ + _statusCode: code, + } +} + +/* +StorageServiceNativeTransportDeleteDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceNativeTransportDeleteDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service native transport delete default response +func (o *StorageServiceNativeTransportDeleteDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceNativeTransportDeleteDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceNativeTransportDeleteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceNativeTransportDeleteDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_get_parameters.go new file mode 100644 index 0000000000..ad2914b9bf --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceNativeTransportGetParams creates a new StorageServiceNativeTransportGetParams object +// with the default values initialized. +func NewStorageServiceNativeTransportGetParams() *StorageServiceNativeTransportGetParams { + + return &StorageServiceNativeTransportGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceNativeTransportGetParamsWithTimeout creates a new StorageServiceNativeTransportGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceNativeTransportGetParamsWithTimeout(timeout time.Duration) *StorageServiceNativeTransportGetParams { + + return &StorageServiceNativeTransportGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceNativeTransportGetParamsWithContext creates a new StorageServiceNativeTransportGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceNativeTransportGetParamsWithContext(ctx context.Context) *StorageServiceNativeTransportGetParams { + + return &StorageServiceNativeTransportGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceNativeTransportGetParamsWithHTTPClient creates a new StorageServiceNativeTransportGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceNativeTransportGetParamsWithHTTPClient(client *http.Client) *StorageServiceNativeTransportGetParams { + + return &StorageServiceNativeTransportGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceNativeTransportGetParams contains all the parameters to send to the API endpoint +for the storage service native transport get operation typically these are written to a http.Request +*/ +type StorageServiceNativeTransportGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service native transport get params +func (o *StorageServiceNativeTransportGetParams) WithTimeout(timeout time.Duration) *StorageServiceNativeTransportGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service native transport get params +func (o *StorageServiceNativeTransportGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service native transport get params +func (o *StorageServiceNativeTransportGetParams) WithContext(ctx context.Context) *StorageServiceNativeTransportGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service native transport get params +func (o *StorageServiceNativeTransportGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service native transport get params +func (o *StorageServiceNativeTransportGetParams) WithHTTPClient(client *http.Client) *StorageServiceNativeTransportGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service native transport get params +func (o *StorageServiceNativeTransportGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceNativeTransportGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_get_responses.go new file mode 100644 index 0000000000..964fc4a06b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceNativeTransportGetReader is a Reader for the StorageServiceNativeTransportGet structure. +type StorageServiceNativeTransportGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceNativeTransportGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceNativeTransportGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceNativeTransportGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceNativeTransportGetOK creates a StorageServiceNativeTransportGetOK with default headers values +func NewStorageServiceNativeTransportGetOK() *StorageServiceNativeTransportGetOK { + return &StorageServiceNativeTransportGetOK{} +} + +/* +StorageServiceNativeTransportGetOK handles this case with default header values. + +Success +*/ +type StorageServiceNativeTransportGetOK struct { + Payload bool +} + +func (o *StorageServiceNativeTransportGetOK) GetPayload() bool { + return o.Payload +} + +func (o *StorageServiceNativeTransportGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceNativeTransportGetDefault creates a StorageServiceNativeTransportGetDefault with default headers values +func NewStorageServiceNativeTransportGetDefault(code int) *StorageServiceNativeTransportGetDefault { + return &StorageServiceNativeTransportGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceNativeTransportGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceNativeTransportGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service native transport get default response +func (o *StorageServiceNativeTransportGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceNativeTransportGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceNativeTransportGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceNativeTransportGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_post_parameters.go new file mode 100644 index 0000000000..270786e272 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceNativeTransportPostParams creates a new StorageServiceNativeTransportPostParams object +// with the default values initialized. +func NewStorageServiceNativeTransportPostParams() *StorageServiceNativeTransportPostParams { + + return &StorageServiceNativeTransportPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceNativeTransportPostParamsWithTimeout creates a new StorageServiceNativeTransportPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceNativeTransportPostParamsWithTimeout(timeout time.Duration) *StorageServiceNativeTransportPostParams { + + return &StorageServiceNativeTransportPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceNativeTransportPostParamsWithContext creates a new StorageServiceNativeTransportPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceNativeTransportPostParamsWithContext(ctx context.Context) *StorageServiceNativeTransportPostParams { + + return &StorageServiceNativeTransportPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceNativeTransportPostParamsWithHTTPClient creates a new StorageServiceNativeTransportPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceNativeTransportPostParamsWithHTTPClient(client *http.Client) *StorageServiceNativeTransportPostParams { + + return &StorageServiceNativeTransportPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceNativeTransportPostParams contains all the parameters to send to the API endpoint +for the storage service native transport post operation typically these are written to a http.Request +*/ +type StorageServiceNativeTransportPostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service native transport post params +func (o *StorageServiceNativeTransportPostParams) WithTimeout(timeout time.Duration) *StorageServiceNativeTransportPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service native transport post params +func (o *StorageServiceNativeTransportPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service native transport post params +func (o *StorageServiceNativeTransportPostParams) WithContext(ctx context.Context) *StorageServiceNativeTransportPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service native transport post params +func (o *StorageServiceNativeTransportPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service native transport post params +func (o *StorageServiceNativeTransportPostParams) WithHTTPClient(client *http.Client) *StorageServiceNativeTransportPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service native transport post params +func (o *StorageServiceNativeTransportPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceNativeTransportPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_post_responses.go new file mode 100644 index 0000000000..96c994a130 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_native_transport_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceNativeTransportPostReader is a Reader for the StorageServiceNativeTransportPost structure. +type StorageServiceNativeTransportPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceNativeTransportPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceNativeTransportPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceNativeTransportPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceNativeTransportPostOK creates a StorageServiceNativeTransportPostOK with default headers values +func NewStorageServiceNativeTransportPostOK() *StorageServiceNativeTransportPostOK { + return &StorageServiceNativeTransportPostOK{} +} + +/* +StorageServiceNativeTransportPostOK handles this case with default header values. + +Success +*/ +type StorageServiceNativeTransportPostOK struct { +} + +func (o *StorageServiceNativeTransportPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceNativeTransportPostDefault creates a StorageServiceNativeTransportPostDefault with default headers values +func NewStorageServiceNativeTransportPostDefault(code int) *StorageServiceNativeTransportPostDefault { + return &StorageServiceNativeTransportPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceNativeTransportPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceNativeTransportPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service native transport post default response +func (o *StorageServiceNativeTransportPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceNativeTransportPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceNativeTransportPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceNativeTransportPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_natural_endpoints_by_keyspace_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_natural_endpoints_by_keyspace_get_parameters.go new file mode 100644 index 0000000000..c6827063fc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_natural_endpoints_by_keyspace_get_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceNaturalEndpointsByKeyspaceGetParams creates a new StorageServiceNaturalEndpointsByKeyspaceGetParams object +// with the default values initialized. +func NewStorageServiceNaturalEndpointsByKeyspaceGetParams() *StorageServiceNaturalEndpointsByKeyspaceGetParams { + var () + return &StorageServiceNaturalEndpointsByKeyspaceGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceNaturalEndpointsByKeyspaceGetParamsWithTimeout creates a new StorageServiceNaturalEndpointsByKeyspaceGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceNaturalEndpointsByKeyspaceGetParamsWithTimeout(timeout time.Duration) *StorageServiceNaturalEndpointsByKeyspaceGetParams { + var () + return &StorageServiceNaturalEndpointsByKeyspaceGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceNaturalEndpointsByKeyspaceGetParamsWithContext creates a new StorageServiceNaturalEndpointsByKeyspaceGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceNaturalEndpointsByKeyspaceGetParamsWithContext(ctx context.Context) *StorageServiceNaturalEndpointsByKeyspaceGetParams { + var () + return &StorageServiceNaturalEndpointsByKeyspaceGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceNaturalEndpointsByKeyspaceGetParamsWithHTTPClient creates a new StorageServiceNaturalEndpointsByKeyspaceGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceNaturalEndpointsByKeyspaceGetParamsWithHTTPClient(client *http.Client) *StorageServiceNaturalEndpointsByKeyspaceGetParams { + var () + return &StorageServiceNaturalEndpointsByKeyspaceGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceNaturalEndpointsByKeyspaceGetParams contains all the parameters to send to the API endpoint +for the storage service natural endpoints by keyspace get operation typically these are written to a http.Request +*/ +type StorageServiceNaturalEndpointsByKeyspaceGetParams struct { + + /*Cf + Column family name + + */ + Cf string + /*Key + key for which we need to find the endpoint return value - the endpoint responsible for this key + + */ + Key string + /*Keyspace + The keyspace to query about + + */ + Keyspace string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service natural endpoints by keyspace get params +func (o *StorageServiceNaturalEndpointsByKeyspaceGetParams) WithTimeout(timeout time.Duration) *StorageServiceNaturalEndpointsByKeyspaceGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service natural endpoints by keyspace get params +func (o *StorageServiceNaturalEndpointsByKeyspaceGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service natural endpoints by keyspace get params +func (o *StorageServiceNaturalEndpointsByKeyspaceGetParams) WithContext(ctx context.Context) *StorageServiceNaturalEndpointsByKeyspaceGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service natural endpoints by keyspace get params +func (o *StorageServiceNaturalEndpointsByKeyspaceGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service natural endpoints by keyspace get params +func (o *StorageServiceNaturalEndpointsByKeyspaceGetParams) WithHTTPClient(client *http.Client) *StorageServiceNaturalEndpointsByKeyspaceGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service natural endpoints by keyspace get params +func (o *StorageServiceNaturalEndpointsByKeyspaceGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCf adds the cf to the storage service natural endpoints by keyspace get params +func (o *StorageServiceNaturalEndpointsByKeyspaceGetParams) WithCf(cf string) *StorageServiceNaturalEndpointsByKeyspaceGetParams { + o.SetCf(cf) + return o +} + +// SetCf adds the cf to the storage service natural endpoints by keyspace get params +func (o *StorageServiceNaturalEndpointsByKeyspaceGetParams) SetCf(cf string) { + o.Cf = cf +} + +// WithKey adds the key to the storage service natural endpoints by keyspace get params +func (o *StorageServiceNaturalEndpointsByKeyspaceGetParams) WithKey(key string) *StorageServiceNaturalEndpointsByKeyspaceGetParams { + o.SetKey(key) + return o +} + +// SetKey adds the key to the storage service natural endpoints by keyspace get params +func (o *StorageServiceNaturalEndpointsByKeyspaceGetParams) SetKey(key string) { + o.Key = key +} + +// WithKeyspace adds the keyspace to the storage service natural endpoints by keyspace get params +func (o *StorageServiceNaturalEndpointsByKeyspaceGetParams) WithKeyspace(keyspace string) *StorageServiceNaturalEndpointsByKeyspaceGetParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service natural endpoints by keyspace get params +func (o *StorageServiceNaturalEndpointsByKeyspaceGetParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceNaturalEndpointsByKeyspaceGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param cf + qrCf := o.Cf + qCf := qrCf + if qCf != "" { + if err := r.SetQueryParam("cf", qCf); err != nil { + return err + } + } + + // query param key + qrKey := o.Key + qKey := qrKey + if qKey != "" { + if err := r.SetQueryParam("key", qKey); err != nil { + return err + } + } + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_natural_endpoints_by_keyspace_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_natural_endpoints_by_keyspace_get_responses.go new file mode 100644 index 0000000000..a6e4279bb8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_natural_endpoints_by_keyspace_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceNaturalEndpointsByKeyspaceGetReader is a Reader for the StorageServiceNaturalEndpointsByKeyspaceGet structure. +type StorageServiceNaturalEndpointsByKeyspaceGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceNaturalEndpointsByKeyspaceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceNaturalEndpointsByKeyspaceGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceNaturalEndpointsByKeyspaceGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceNaturalEndpointsByKeyspaceGetOK creates a StorageServiceNaturalEndpointsByKeyspaceGetOK with default headers values +func NewStorageServiceNaturalEndpointsByKeyspaceGetOK() *StorageServiceNaturalEndpointsByKeyspaceGetOK { + return &StorageServiceNaturalEndpointsByKeyspaceGetOK{} +} + +/* +StorageServiceNaturalEndpointsByKeyspaceGetOK handles this case with default header values. + +Success +*/ +type StorageServiceNaturalEndpointsByKeyspaceGetOK struct { + Payload []string +} + +func (o *StorageServiceNaturalEndpointsByKeyspaceGetOK) GetPayload() []string { + return o.Payload +} + +func (o *StorageServiceNaturalEndpointsByKeyspaceGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceNaturalEndpointsByKeyspaceGetDefault creates a StorageServiceNaturalEndpointsByKeyspaceGetDefault with default headers values +func NewStorageServiceNaturalEndpointsByKeyspaceGetDefault(code int) *StorageServiceNaturalEndpointsByKeyspaceGetDefault { + return &StorageServiceNaturalEndpointsByKeyspaceGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceNaturalEndpointsByKeyspaceGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceNaturalEndpointsByKeyspaceGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service natural endpoints by keyspace get default response +func (o *StorageServiceNaturalEndpointsByKeyspaceGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceNaturalEndpointsByKeyspaceGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceNaturalEndpointsByKeyspaceGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceNaturalEndpointsByKeyspaceGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_joining_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_joining_get_parameters.go new file mode 100644 index 0000000000..21efe66ad2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_joining_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceNodesJoiningGetParams creates a new StorageServiceNodesJoiningGetParams object +// with the default values initialized. +func NewStorageServiceNodesJoiningGetParams() *StorageServiceNodesJoiningGetParams { + + return &StorageServiceNodesJoiningGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceNodesJoiningGetParamsWithTimeout creates a new StorageServiceNodesJoiningGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceNodesJoiningGetParamsWithTimeout(timeout time.Duration) *StorageServiceNodesJoiningGetParams { + + return &StorageServiceNodesJoiningGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceNodesJoiningGetParamsWithContext creates a new StorageServiceNodesJoiningGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceNodesJoiningGetParamsWithContext(ctx context.Context) *StorageServiceNodesJoiningGetParams { + + return &StorageServiceNodesJoiningGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceNodesJoiningGetParamsWithHTTPClient creates a new StorageServiceNodesJoiningGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceNodesJoiningGetParamsWithHTTPClient(client *http.Client) *StorageServiceNodesJoiningGetParams { + + return &StorageServiceNodesJoiningGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceNodesJoiningGetParams contains all the parameters to send to the API endpoint +for the storage service nodes joining get operation typically these are written to a http.Request +*/ +type StorageServiceNodesJoiningGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service nodes joining get params +func (o *StorageServiceNodesJoiningGetParams) WithTimeout(timeout time.Duration) *StorageServiceNodesJoiningGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service nodes joining get params +func (o *StorageServiceNodesJoiningGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service nodes joining get params +func (o *StorageServiceNodesJoiningGetParams) WithContext(ctx context.Context) *StorageServiceNodesJoiningGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service nodes joining get params +func (o *StorageServiceNodesJoiningGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service nodes joining get params +func (o *StorageServiceNodesJoiningGetParams) WithHTTPClient(client *http.Client) *StorageServiceNodesJoiningGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service nodes joining get params +func (o *StorageServiceNodesJoiningGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceNodesJoiningGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_joining_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_joining_get_responses.go new file mode 100644 index 0000000000..cb1f5dacbf --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_joining_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceNodesJoiningGetReader is a Reader for the StorageServiceNodesJoiningGet structure. +type StorageServiceNodesJoiningGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceNodesJoiningGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceNodesJoiningGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceNodesJoiningGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceNodesJoiningGetOK creates a StorageServiceNodesJoiningGetOK with default headers values +func NewStorageServiceNodesJoiningGetOK() *StorageServiceNodesJoiningGetOK { + return &StorageServiceNodesJoiningGetOK{} +} + +/* +StorageServiceNodesJoiningGetOK handles this case with default header values. + +Success +*/ +type StorageServiceNodesJoiningGetOK struct { + Payload []string +} + +func (o *StorageServiceNodesJoiningGetOK) GetPayload() []string { + return o.Payload +} + +func (o *StorageServiceNodesJoiningGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceNodesJoiningGetDefault creates a StorageServiceNodesJoiningGetDefault with default headers values +func NewStorageServiceNodesJoiningGetDefault(code int) *StorageServiceNodesJoiningGetDefault { + return &StorageServiceNodesJoiningGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceNodesJoiningGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceNodesJoiningGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service nodes joining get default response +func (o *StorageServiceNodesJoiningGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceNodesJoiningGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceNodesJoiningGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceNodesJoiningGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_leaving_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_leaving_get_parameters.go new file mode 100644 index 0000000000..23a4354520 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_leaving_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceNodesLeavingGetParams creates a new StorageServiceNodesLeavingGetParams object +// with the default values initialized. +func NewStorageServiceNodesLeavingGetParams() *StorageServiceNodesLeavingGetParams { + + return &StorageServiceNodesLeavingGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceNodesLeavingGetParamsWithTimeout creates a new StorageServiceNodesLeavingGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceNodesLeavingGetParamsWithTimeout(timeout time.Duration) *StorageServiceNodesLeavingGetParams { + + return &StorageServiceNodesLeavingGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceNodesLeavingGetParamsWithContext creates a new StorageServiceNodesLeavingGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceNodesLeavingGetParamsWithContext(ctx context.Context) *StorageServiceNodesLeavingGetParams { + + return &StorageServiceNodesLeavingGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceNodesLeavingGetParamsWithHTTPClient creates a new StorageServiceNodesLeavingGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceNodesLeavingGetParamsWithHTTPClient(client *http.Client) *StorageServiceNodesLeavingGetParams { + + return &StorageServiceNodesLeavingGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceNodesLeavingGetParams contains all the parameters to send to the API endpoint +for the storage service nodes leaving get operation typically these are written to a http.Request +*/ +type StorageServiceNodesLeavingGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service nodes leaving get params +func (o *StorageServiceNodesLeavingGetParams) WithTimeout(timeout time.Duration) *StorageServiceNodesLeavingGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service nodes leaving get params +func (o *StorageServiceNodesLeavingGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service nodes leaving get params +func (o *StorageServiceNodesLeavingGetParams) WithContext(ctx context.Context) *StorageServiceNodesLeavingGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service nodes leaving get params +func (o *StorageServiceNodesLeavingGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service nodes leaving get params +func (o *StorageServiceNodesLeavingGetParams) WithHTTPClient(client *http.Client) *StorageServiceNodesLeavingGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service nodes leaving get params +func (o *StorageServiceNodesLeavingGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceNodesLeavingGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_leaving_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_leaving_get_responses.go new file mode 100644 index 0000000000..14c17a751a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_leaving_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceNodesLeavingGetReader is a Reader for the StorageServiceNodesLeavingGet structure. +type StorageServiceNodesLeavingGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceNodesLeavingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceNodesLeavingGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceNodesLeavingGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceNodesLeavingGetOK creates a StorageServiceNodesLeavingGetOK with default headers values +func NewStorageServiceNodesLeavingGetOK() *StorageServiceNodesLeavingGetOK { + return &StorageServiceNodesLeavingGetOK{} +} + +/* +StorageServiceNodesLeavingGetOK handles this case with default header values. + +Success +*/ +type StorageServiceNodesLeavingGetOK struct { + Payload []string +} + +func (o *StorageServiceNodesLeavingGetOK) GetPayload() []string { + return o.Payload +} + +func (o *StorageServiceNodesLeavingGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceNodesLeavingGetDefault creates a StorageServiceNodesLeavingGetDefault with default headers values +func NewStorageServiceNodesLeavingGetDefault(code int) *StorageServiceNodesLeavingGetDefault { + return &StorageServiceNodesLeavingGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceNodesLeavingGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceNodesLeavingGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service nodes leaving get default response +func (o *StorageServiceNodesLeavingGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceNodesLeavingGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceNodesLeavingGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceNodesLeavingGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_moving_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_moving_get_parameters.go new file mode 100644 index 0000000000..be9eeb4699 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_moving_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceNodesMovingGetParams creates a new StorageServiceNodesMovingGetParams object +// with the default values initialized. +func NewStorageServiceNodesMovingGetParams() *StorageServiceNodesMovingGetParams { + + return &StorageServiceNodesMovingGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceNodesMovingGetParamsWithTimeout creates a new StorageServiceNodesMovingGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceNodesMovingGetParamsWithTimeout(timeout time.Duration) *StorageServiceNodesMovingGetParams { + + return &StorageServiceNodesMovingGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceNodesMovingGetParamsWithContext creates a new StorageServiceNodesMovingGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceNodesMovingGetParamsWithContext(ctx context.Context) *StorageServiceNodesMovingGetParams { + + return &StorageServiceNodesMovingGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceNodesMovingGetParamsWithHTTPClient creates a new StorageServiceNodesMovingGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceNodesMovingGetParamsWithHTTPClient(client *http.Client) *StorageServiceNodesMovingGetParams { + + return &StorageServiceNodesMovingGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceNodesMovingGetParams contains all the parameters to send to the API endpoint +for the storage service nodes moving get operation typically these are written to a http.Request +*/ +type StorageServiceNodesMovingGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service nodes moving get params +func (o *StorageServiceNodesMovingGetParams) WithTimeout(timeout time.Duration) *StorageServiceNodesMovingGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service nodes moving get params +func (o *StorageServiceNodesMovingGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service nodes moving get params +func (o *StorageServiceNodesMovingGetParams) WithContext(ctx context.Context) *StorageServiceNodesMovingGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service nodes moving get params +func (o *StorageServiceNodesMovingGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service nodes moving get params +func (o *StorageServiceNodesMovingGetParams) WithHTTPClient(client *http.Client) *StorageServiceNodesMovingGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service nodes moving get params +func (o *StorageServiceNodesMovingGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceNodesMovingGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_moving_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_moving_get_responses.go new file mode 100644 index 0000000000..72b2e1acbc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_nodes_moving_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceNodesMovingGetReader is a Reader for the StorageServiceNodesMovingGet structure. +type StorageServiceNodesMovingGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceNodesMovingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceNodesMovingGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceNodesMovingGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceNodesMovingGetOK creates a StorageServiceNodesMovingGetOK with default headers values +func NewStorageServiceNodesMovingGetOK() *StorageServiceNodesMovingGetOK { + return &StorageServiceNodesMovingGetOK{} +} + +/* +StorageServiceNodesMovingGetOK handles this case with default header values. + +Success +*/ +type StorageServiceNodesMovingGetOK struct { + Payload []string +} + +func (o *StorageServiceNodesMovingGetOK) GetPayload() []string { + return o.Payload +} + +func (o *StorageServiceNodesMovingGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceNodesMovingGetDefault creates a StorageServiceNodesMovingGetDefault with default headers values +func NewStorageServiceNodesMovingGetDefault(code int) *StorageServiceNodesMovingGetDefault { + return &StorageServiceNodesMovingGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceNodesMovingGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceNodesMovingGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service nodes moving get default response +func (o *StorageServiceNodesMovingGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceNodesMovingGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceNodesMovingGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceNodesMovingGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_operation_mode_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_operation_mode_get_parameters.go new file mode 100644 index 0000000000..0306bcae1c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_operation_mode_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceOperationModeGetParams creates a new StorageServiceOperationModeGetParams object +// with the default values initialized. +func NewStorageServiceOperationModeGetParams() *StorageServiceOperationModeGetParams { + + return &StorageServiceOperationModeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceOperationModeGetParamsWithTimeout creates a new StorageServiceOperationModeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceOperationModeGetParamsWithTimeout(timeout time.Duration) *StorageServiceOperationModeGetParams { + + return &StorageServiceOperationModeGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceOperationModeGetParamsWithContext creates a new StorageServiceOperationModeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceOperationModeGetParamsWithContext(ctx context.Context) *StorageServiceOperationModeGetParams { + + return &StorageServiceOperationModeGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceOperationModeGetParamsWithHTTPClient creates a new StorageServiceOperationModeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceOperationModeGetParamsWithHTTPClient(client *http.Client) *StorageServiceOperationModeGetParams { + + return &StorageServiceOperationModeGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceOperationModeGetParams contains all the parameters to send to the API endpoint +for the storage service operation mode get operation typically these are written to a http.Request +*/ +type StorageServiceOperationModeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service operation mode get params +func (o *StorageServiceOperationModeGetParams) WithTimeout(timeout time.Duration) *StorageServiceOperationModeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service operation mode get params +func (o *StorageServiceOperationModeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service operation mode get params +func (o *StorageServiceOperationModeGetParams) WithContext(ctx context.Context) *StorageServiceOperationModeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service operation mode get params +func (o *StorageServiceOperationModeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service operation mode get params +func (o *StorageServiceOperationModeGetParams) WithHTTPClient(client *http.Client) *StorageServiceOperationModeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service operation mode get params +func (o *StorageServiceOperationModeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceOperationModeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_operation_mode_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_operation_mode_get_responses.go new file mode 100644 index 0000000000..e2171a2f3f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_operation_mode_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceOperationModeGetReader is a Reader for the StorageServiceOperationModeGet structure. +type StorageServiceOperationModeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceOperationModeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceOperationModeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceOperationModeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceOperationModeGetOK creates a StorageServiceOperationModeGetOK with default headers values +func NewStorageServiceOperationModeGetOK() *StorageServiceOperationModeGetOK { + return &StorageServiceOperationModeGetOK{} +} + +/* +StorageServiceOperationModeGetOK handles this case with default header values. + +Success +*/ +type StorageServiceOperationModeGetOK struct { + Payload string +} + +func (o *StorageServiceOperationModeGetOK) GetPayload() string { + return o.Payload +} + +func (o *StorageServiceOperationModeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceOperationModeGetDefault creates a StorageServiceOperationModeGetDefault with default headers values +func NewStorageServiceOperationModeGetDefault(code int) *StorageServiceOperationModeGetDefault { + return &StorageServiceOperationModeGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceOperationModeGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceOperationModeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service operation mode get default response +func (o *StorageServiceOperationModeGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceOperationModeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceOperationModeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceOperationModeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_ownership_by_keyspace_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_ownership_by_keyspace_get_parameters.go new file mode 100644 index 0000000000..8eb4fafe61 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_ownership_by_keyspace_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceOwnershipByKeyspaceGetParams creates a new StorageServiceOwnershipByKeyspaceGetParams object +// with the default values initialized. +func NewStorageServiceOwnershipByKeyspaceGetParams() *StorageServiceOwnershipByKeyspaceGetParams { + var () + return &StorageServiceOwnershipByKeyspaceGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceOwnershipByKeyspaceGetParamsWithTimeout creates a new StorageServiceOwnershipByKeyspaceGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceOwnershipByKeyspaceGetParamsWithTimeout(timeout time.Duration) *StorageServiceOwnershipByKeyspaceGetParams { + var () + return &StorageServiceOwnershipByKeyspaceGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceOwnershipByKeyspaceGetParamsWithContext creates a new StorageServiceOwnershipByKeyspaceGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceOwnershipByKeyspaceGetParamsWithContext(ctx context.Context) *StorageServiceOwnershipByKeyspaceGetParams { + var () + return &StorageServiceOwnershipByKeyspaceGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceOwnershipByKeyspaceGetParamsWithHTTPClient creates a new StorageServiceOwnershipByKeyspaceGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceOwnershipByKeyspaceGetParamsWithHTTPClient(client *http.Client) *StorageServiceOwnershipByKeyspaceGetParams { + var () + return &StorageServiceOwnershipByKeyspaceGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceOwnershipByKeyspaceGetParams contains all the parameters to send to the API endpoint +for the storage service ownership by keyspace get operation typically these are written to a http.Request +*/ +type StorageServiceOwnershipByKeyspaceGetParams struct { + + /*Keyspace + The keyspace to fetch information about + + */ + Keyspace string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service ownership by keyspace get params +func (o *StorageServiceOwnershipByKeyspaceGetParams) WithTimeout(timeout time.Duration) *StorageServiceOwnershipByKeyspaceGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service ownership by keyspace get params +func (o *StorageServiceOwnershipByKeyspaceGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service ownership by keyspace get params +func (o *StorageServiceOwnershipByKeyspaceGetParams) WithContext(ctx context.Context) *StorageServiceOwnershipByKeyspaceGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service ownership by keyspace get params +func (o *StorageServiceOwnershipByKeyspaceGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service ownership by keyspace get params +func (o *StorageServiceOwnershipByKeyspaceGetParams) WithHTTPClient(client *http.Client) *StorageServiceOwnershipByKeyspaceGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service ownership by keyspace get params +func (o *StorageServiceOwnershipByKeyspaceGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithKeyspace adds the keyspace to the storage service ownership by keyspace get params +func (o *StorageServiceOwnershipByKeyspaceGetParams) WithKeyspace(keyspace string) *StorageServiceOwnershipByKeyspaceGetParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service ownership by keyspace get params +func (o *StorageServiceOwnershipByKeyspaceGetParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceOwnershipByKeyspaceGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_ownership_by_keyspace_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_ownership_by_keyspace_get_responses.go new file mode 100644 index 0000000000..467b23fdc6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_ownership_by_keyspace_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceOwnershipByKeyspaceGetReader is a Reader for the StorageServiceOwnershipByKeyspaceGet structure. +type StorageServiceOwnershipByKeyspaceGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceOwnershipByKeyspaceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceOwnershipByKeyspaceGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceOwnershipByKeyspaceGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceOwnershipByKeyspaceGetOK creates a StorageServiceOwnershipByKeyspaceGetOK with default headers values +func NewStorageServiceOwnershipByKeyspaceGetOK() *StorageServiceOwnershipByKeyspaceGetOK { + return &StorageServiceOwnershipByKeyspaceGetOK{} +} + +/* +StorageServiceOwnershipByKeyspaceGetOK handles this case with default header values. + +Success +*/ +type StorageServiceOwnershipByKeyspaceGetOK struct { + Payload []*models.Mapper +} + +func (o *StorageServiceOwnershipByKeyspaceGetOK) GetPayload() []*models.Mapper { + return o.Payload +} + +func (o *StorageServiceOwnershipByKeyspaceGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceOwnershipByKeyspaceGetDefault creates a StorageServiceOwnershipByKeyspaceGetDefault with default headers values +func NewStorageServiceOwnershipByKeyspaceGetDefault(code int) *StorageServiceOwnershipByKeyspaceGetDefault { + return &StorageServiceOwnershipByKeyspaceGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceOwnershipByKeyspaceGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceOwnershipByKeyspaceGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service ownership by keyspace get default response +func (o *StorageServiceOwnershipByKeyspaceGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceOwnershipByKeyspaceGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceOwnershipByKeyspaceGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceOwnershipByKeyspaceGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_ownership_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_ownership_get_parameters.go new file mode 100644 index 0000000000..0c680737cb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_ownership_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceOwnershipGetParams creates a new StorageServiceOwnershipGetParams object +// with the default values initialized. +func NewStorageServiceOwnershipGetParams() *StorageServiceOwnershipGetParams { + + return &StorageServiceOwnershipGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceOwnershipGetParamsWithTimeout creates a new StorageServiceOwnershipGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceOwnershipGetParamsWithTimeout(timeout time.Duration) *StorageServiceOwnershipGetParams { + + return &StorageServiceOwnershipGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceOwnershipGetParamsWithContext creates a new StorageServiceOwnershipGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceOwnershipGetParamsWithContext(ctx context.Context) *StorageServiceOwnershipGetParams { + + return &StorageServiceOwnershipGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceOwnershipGetParamsWithHTTPClient creates a new StorageServiceOwnershipGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceOwnershipGetParamsWithHTTPClient(client *http.Client) *StorageServiceOwnershipGetParams { + + return &StorageServiceOwnershipGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceOwnershipGetParams contains all the parameters to send to the API endpoint +for the storage service ownership get operation typically these are written to a http.Request +*/ +type StorageServiceOwnershipGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service ownership get params +func (o *StorageServiceOwnershipGetParams) WithTimeout(timeout time.Duration) *StorageServiceOwnershipGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service ownership get params +func (o *StorageServiceOwnershipGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service ownership get params +func (o *StorageServiceOwnershipGetParams) WithContext(ctx context.Context) *StorageServiceOwnershipGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service ownership get params +func (o *StorageServiceOwnershipGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service ownership get params +func (o *StorageServiceOwnershipGetParams) WithHTTPClient(client *http.Client) *StorageServiceOwnershipGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service ownership get params +func (o *StorageServiceOwnershipGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceOwnershipGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_ownership_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_ownership_get_responses.go new file mode 100644 index 0000000000..ebe20215d1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_ownership_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceOwnershipGetReader is a Reader for the StorageServiceOwnershipGet structure. +type StorageServiceOwnershipGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceOwnershipGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceOwnershipGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceOwnershipGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceOwnershipGetOK creates a StorageServiceOwnershipGetOK with default headers values +func NewStorageServiceOwnershipGetOK() *StorageServiceOwnershipGetOK { + return &StorageServiceOwnershipGetOK{} +} + +/* +StorageServiceOwnershipGetOK handles this case with default header values. + +Success +*/ +type StorageServiceOwnershipGetOK struct { + Payload []*models.Mapper +} + +func (o *StorageServiceOwnershipGetOK) GetPayload() []*models.Mapper { + return o.Payload +} + +func (o *StorageServiceOwnershipGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceOwnershipGetDefault creates a StorageServiceOwnershipGetDefault with default headers values +func NewStorageServiceOwnershipGetDefault(code int) *StorageServiceOwnershipGetDefault { + return &StorageServiceOwnershipGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceOwnershipGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceOwnershipGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service ownership get default response +func (o *StorageServiceOwnershipGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceOwnershipGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceOwnershipGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceOwnershipGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_partitioner_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_partitioner_name_get_parameters.go new file mode 100644 index 0000000000..63221528df --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_partitioner_name_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServicePartitionerNameGetParams creates a new StorageServicePartitionerNameGetParams object +// with the default values initialized. +func NewStorageServicePartitionerNameGetParams() *StorageServicePartitionerNameGetParams { + + return &StorageServicePartitionerNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServicePartitionerNameGetParamsWithTimeout creates a new StorageServicePartitionerNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServicePartitionerNameGetParamsWithTimeout(timeout time.Duration) *StorageServicePartitionerNameGetParams { + + return &StorageServicePartitionerNameGetParams{ + + timeout: timeout, + } +} + +// NewStorageServicePartitionerNameGetParamsWithContext creates a new StorageServicePartitionerNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServicePartitionerNameGetParamsWithContext(ctx context.Context) *StorageServicePartitionerNameGetParams { + + return &StorageServicePartitionerNameGetParams{ + + Context: ctx, + } +} + +// NewStorageServicePartitionerNameGetParamsWithHTTPClient creates a new StorageServicePartitionerNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServicePartitionerNameGetParamsWithHTTPClient(client *http.Client) *StorageServicePartitionerNameGetParams { + + return &StorageServicePartitionerNameGetParams{ + HTTPClient: client, + } +} + +/* +StorageServicePartitionerNameGetParams contains all the parameters to send to the API endpoint +for the storage service partitioner name get operation typically these are written to a http.Request +*/ +type StorageServicePartitionerNameGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service partitioner name get params +func (o *StorageServicePartitionerNameGetParams) WithTimeout(timeout time.Duration) *StorageServicePartitionerNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service partitioner name get params +func (o *StorageServicePartitionerNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service partitioner name get params +func (o *StorageServicePartitionerNameGetParams) WithContext(ctx context.Context) *StorageServicePartitionerNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service partitioner name get params +func (o *StorageServicePartitionerNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service partitioner name get params +func (o *StorageServicePartitionerNameGetParams) WithHTTPClient(client *http.Client) *StorageServicePartitionerNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service partitioner name get params +func (o *StorageServicePartitionerNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServicePartitionerNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_partitioner_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_partitioner_name_get_responses.go new file mode 100644 index 0000000000..3eeb9e21a6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_partitioner_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServicePartitionerNameGetReader is a Reader for the StorageServicePartitionerNameGet structure. +type StorageServicePartitionerNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServicePartitionerNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServicePartitionerNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServicePartitionerNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServicePartitionerNameGetOK creates a StorageServicePartitionerNameGetOK with default headers values +func NewStorageServicePartitionerNameGetOK() *StorageServicePartitionerNameGetOK { + return &StorageServicePartitionerNameGetOK{} +} + +/* +StorageServicePartitionerNameGetOK handles this case with default header values. + +Success +*/ +type StorageServicePartitionerNameGetOK struct { + Payload string +} + +func (o *StorageServicePartitionerNameGetOK) GetPayload() string { + return o.Payload +} + +func (o *StorageServicePartitionerNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServicePartitionerNameGetDefault creates a StorageServicePartitionerNameGetDefault with default headers values +func NewStorageServicePartitionerNameGetDefault(code int) *StorageServicePartitionerNameGetDefault { + return &StorageServicePartitionerNameGetDefault{ + _statusCode: code, + } +} + +/* +StorageServicePartitionerNameGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServicePartitionerNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service partitioner name get default response +func (o *StorageServicePartitionerNameGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServicePartitionerNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServicePartitionerNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServicePartitionerNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_pending_range_by_keyspace_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_pending_range_by_keyspace_get_parameters.go new file mode 100644 index 0000000000..59745aaab9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_pending_range_by_keyspace_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServicePendingRangeByKeyspaceGetParams creates a new StorageServicePendingRangeByKeyspaceGetParams object +// with the default values initialized. +func NewStorageServicePendingRangeByKeyspaceGetParams() *StorageServicePendingRangeByKeyspaceGetParams { + var () + return &StorageServicePendingRangeByKeyspaceGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServicePendingRangeByKeyspaceGetParamsWithTimeout creates a new StorageServicePendingRangeByKeyspaceGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServicePendingRangeByKeyspaceGetParamsWithTimeout(timeout time.Duration) *StorageServicePendingRangeByKeyspaceGetParams { + var () + return &StorageServicePendingRangeByKeyspaceGetParams{ + + timeout: timeout, + } +} + +// NewStorageServicePendingRangeByKeyspaceGetParamsWithContext creates a new StorageServicePendingRangeByKeyspaceGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServicePendingRangeByKeyspaceGetParamsWithContext(ctx context.Context) *StorageServicePendingRangeByKeyspaceGetParams { + var () + return &StorageServicePendingRangeByKeyspaceGetParams{ + + Context: ctx, + } +} + +// NewStorageServicePendingRangeByKeyspaceGetParamsWithHTTPClient creates a new StorageServicePendingRangeByKeyspaceGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServicePendingRangeByKeyspaceGetParamsWithHTTPClient(client *http.Client) *StorageServicePendingRangeByKeyspaceGetParams { + var () + return &StorageServicePendingRangeByKeyspaceGetParams{ + HTTPClient: client, + } +} + +/* +StorageServicePendingRangeByKeyspaceGetParams contains all the parameters to send to the API endpoint +for the storage service pending range by keyspace get operation typically these are written to a http.Request +*/ +type StorageServicePendingRangeByKeyspaceGetParams struct { + + /*Keyspace + The keyspace to query about + + */ + Keyspace string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service pending range by keyspace get params +func (o *StorageServicePendingRangeByKeyspaceGetParams) WithTimeout(timeout time.Duration) *StorageServicePendingRangeByKeyspaceGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service pending range by keyspace get params +func (o *StorageServicePendingRangeByKeyspaceGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service pending range by keyspace get params +func (o *StorageServicePendingRangeByKeyspaceGetParams) WithContext(ctx context.Context) *StorageServicePendingRangeByKeyspaceGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service pending range by keyspace get params +func (o *StorageServicePendingRangeByKeyspaceGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service pending range by keyspace get params +func (o *StorageServicePendingRangeByKeyspaceGetParams) WithHTTPClient(client *http.Client) *StorageServicePendingRangeByKeyspaceGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service pending range by keyspace get params +func (o *StorageServicePendingRangeByKeyspaceGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithKeyspace adds the keyspace to the storage service pending range by keyspace get params +func (o *StorageServicePendingRangeByKeyspaceGetParams) WithKeyspace(keyspace string) *StorageServicePendingRangeByKeyspaceGetParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service pending range by keyspace get params +func (o *StorageServicePendingRangeByKeyspaceGetParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServicePendingRangeByKeyspaceGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_pending_range_by_keyspace_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_pending_range_by_keyspace_get_responses.go new file mode 100644 index 0000000000..67a3f877dc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_pending_range_by_keyspace_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServicePendingRangeByKeyspaceGetReader is a Reader for the StorageServicePendingRangeByKeyspaceGet structure. +type StorageServicePendingRangeByKeyspaceGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServicePendingRangeByKeyspaceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServicePendingRangeByKeyspaceGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServicePendingRangeByKeyspaceGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServicePendingRangeByKeyspaceGetOK creates a StorageServicePendingRangeByKeyspaceGetOK with default headers values +func NewStorageServicePendingRangeByKeyspaceGetOK() *StorageServicePendingRangeByKeyspaceGetOK { + return &StorageServicePendingRangeByKeyspaceGetOK{} +} + +/* +StorageServicePendingRangeByKeyspaceGetOK handles this case with default header values. + +Success +*/ +type StorageServicePendingRangeByKeyspaceGetOK struct { + Payload []*models.MaplistMapper +} + +func (o *StorageServicePendingRangeByKeyspaceGetOK) GetPayload() []*models.MaplistMapper { + return o.Payload +} + +func (o *StorageServicePendingRangeByKeyspaceGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServicePendingRangeByKeyspaceGetDefault creates a StorageServicePendingRangeByKeyspaceGetDefault with default headers values +func NewStorageServicePendingRangeByKeyspaceGetDefault(code int) *StorageServicePendingRangeByKeyspaceGetDefault { + return &StorageServicePendingRangeByKeyspaceGetDefault{ + _statusCode: code, + } +} + +/* +StorageServicePendingRangeByKeyspaceGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServicePendingRangeByKeyspaceGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service pending range by keyspace get default response +func (o *StorageServicePendingRangeByKeyspaceGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServicePendingRangeByKeyspaceGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServicePendingRangeByKeyspaceGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServicePendingRangeByKeyspaceGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_range_to_endpoint_map_by_keyspace_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_range_to_endpoint_map_by_keyspace_get_parameters.go new file mode 100644 index 0000000000..10e3b7b518 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_range_to_endpoint_map_by_keyspace_get_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceRangeToEndpointMapByKeyspaceGetParams creates a new StorageServiceRangeToEndpointMapByKeyspaceGetParams object +// with the default values initialized. +func NewStorageServiceRangeToEndpointMapByKeyspaceGetParams() *StorageServiceRangeToEndpointMapByKeyspaceGetParams { + var () + return &StorageServiceRangeToEndpointMapByKeyspaceGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceRangeToEndpointMapByKeyspaceGetParamsWithTimeout creates a new StorageServiceRangeToEndpointMapByKeyspaceGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceRangeToEndpointMapByKeyspaceGetParamsWithTimeout(timeout time.Duration) *StorageServiceRangeToEndpointMapByKeyspaceGetParams { + var () + return &StorageServiceRangeToEndpointMapByKeyspaceGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceRangeToEndpointMapByKeyspaceGetParamsWithContext creates a new StorageServiceRangeToEndpointMapByKeyspaceGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceRangeToEndpointMapByKeyspaceGetParamsWithContext(ctx context.Context) *StorageServiceRangeToEndpointMapByKeyspaceGetParams { + var () + return &StorageServiceRangeToEndpointMapByKeyspaceGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceRangeToEndpointMapByKeyspaceGetParamsWithHTTPClient creates a new StorageServiceRangeToEndpointMapByKeyspaceGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceRangeToEndpointMapByKeyspaceGetParamsWithHTTPClient(client *http.Client) *StorageServiceRangeToEndpointMapByKeyspaceGetParams { + var () + return &StorageServiceRangeToEndpointMapByKeyspaceGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceRangeToEndpointMapByKeyspaceGetParams contains all the parameters to send to the API endpoint +for the storage service range to endpoint map by keyspace get operation typically these are written to a http.Request +*/ +type StorageServiceRangeToEndpointMapByKeyspaceGetParams struct { + + /*Keyspace + The keyspace to query about + + */ + Keyspace string + /*RPC + When set to true, return the rpc address + + */ + RPC *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service range to endpoint map by keyspace get params +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetParams) WithTimeout(timeout time.Duration) *StorageServiceRangeToEndpointMapByKeyspaceGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service range to endpoint map by keyspace get params +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service range to endpoint map by keyspace get params +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetParams) WithContext(ctx context.Context) *StorageServiceRangeToEndpointMapByKeyspaceGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service range to endpoint map by keyspace get params +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service range to endpoint map by keyspace get params +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetParams) WithHTTPClient(client *http.Client) *StorageServiceRangeToEndpointMapByKeyspaceGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service range to endpoint map by keyspace get params +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithKeyspace adds the keyspace to the storage service range to endpoint map by keyspace get params +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetParams) WithKeyspace(keyspace string) *StorageServiceRangeToEndpointMapByKeyspaceGetParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service range to endpoint map by keyspace get params +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WithRPC adds the rpc to the storage service range to endpoint map by keyspace get params +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetParams) WithRPC(rpc *bool) *StorageServiceRangeToEndpointMapByKeyspaceGetParams { + o.SetRPC(rpc) + return o +} + +// SetRPC adds the rpc to the storage service range to endpoint map by keyspace get params +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetParams) SetRPC(rpc *bool) { + o.RPC = rpc +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if o.RPC != nil { + + // query param rpc + var qrRPC bool + if o.RPC != nil { + qrRPC = *o.RPC + } + qRPC := swag.FormatBool(qrRPC) + if qRPC != "" { + if err := r.SetQueryParam("rpc", qRPC); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_range_to_endpoint_map_by_keyspace_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_range_to_endpoint_map_by_keyspace_get_responses.go new file mode 100644 index 0000000000..6610a29472 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_range_to_endpoint_map_by_keyspace_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceRangeToEndpointMapByKeyspaceGetReader is a Reader for the StorageServiceRangeToEndpointMapByKeyspaceGet structure. +type StorageServiceRangeToEndpointMapByKeyspaceGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceRangeToEndpointMapByKeyspaceGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceRangeToEndpointMapByKeyspaceGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceRangeToEndpointMapByKeyspaceGetOK creates a StorageServiceRangeToEndpointMapByKeyspaceGetOK with default headers values +func NewStorageServiceRangeToEndpointMapByKeyspaceGetOK() *StorageServiceRangeToEndpointMapByKeyspaceGetOK { + return &StorageServiceRangeToEndpointMapByKeyspaceGetOK{} +} + +/* +StorageServiceRangeToEndpointMapByKeyspaceGetOK handles this case with default header values. + +Success +*/ +type StorageServiceRangeToEndpointMapByKeyspaceGetOK struct { + Payload []*models.MaplistMapper +} + +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetOK) GetPayload() []*models.MaplistMapper { + return o.Payload +} + +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceRangeToEndpointMapByKeyspaceGetDefault creates a StorageServiceRangeToEndpointMapByKeyspaceGetDefault with default headers values +func NewStorageServiceRangeToEndpointMapByKeyspaceGetDefault(code int) *StorageServiceRangeToEndpointMapByKeyspaceGetDefault { + return &StorageServiceRangeToEndpointMapByKeyspaceGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceRangeToEndpointMapByKeyspaceGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceRangeToEndpointMapByKeyspaceGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service range to endpoint map by keyspace get default response +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceRangeToEndpointMapByKeyspaceGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rebuild_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rebuild_post_parameters.go new file mode 100644 index 0000000000..f4853c9281 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rebuild_post_parameters.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceRebuildPostParams creates a new StorageServiceRebuildPostParams object +// with the default values initialized. +func NewStorageServiceRebuildPostParams() *StorageServiceRebuildPostParams { + var () + return &StorageServiceRebuildPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceRebuildPostParamsWithTimeout creates a new StorageServiceRebuildPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceRebuildPostParamsWithTimeout(timeout time.Duration) *StorageServiceRebuildPostParams { + var () + return &StorageServiceRebuildPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceRebuildPostParamsWithContext creates a new StorageServiceRebuildPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceRebuildPostParamsWithContext(ctx context.Context) *StorageServiceRebuildPostParams { + var () + return &StorageServiceRebuildPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceRebuildPostParamsWithHTTPClient creates a new StorageServiceRebuildPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceRebuildPostParamsWithHTTPClient(client *http.Client) *StorageServiceRebuildPostParams { + var () + return &StorageServiceRebuildPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceRebuildPostParams contains all the parameters to send to the API endpoint +for the storage service rebuild post operation typically these are written to a http.Request +*/ +type StorageServiceRebuildPostParams struct { + + /*SourceDc + Name of DC from which to select sources for streaming or none to pick any node + + */ + SourceDc *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service rebuild post params +func (o *StorageServiceRebuildPostParams) WithTimeout(timeout time.Duration) *StorageServiceRebuildPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service rebuild post params +func (o *StorageServiceRebuildPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service rebuild post params +func (o *StorageServiceRebuildPostParams) WithContext(ctx context.Context) *StorageServiceRebuildPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service rebuild post params +func (o *StorageServiceRebuildPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service rebuild post params +func (o *StorageServiceRebuildPostParams) WithHTTPClient(client *http.Client) *StorageServiceRebuildPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service rebuild post params +func (o *StorageServiceRebuildPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSourceDc adds the sourceDc to the storage service rebuild post params +func (o *StorageServiceRebuildPostParams) WithSourceDc(sourceDc *string) *StorageServiceRebuildPostParams { + o.SetSourceDc(sourceDc) + return o +} + +// SetSourceDc adds the sourceDc to the storage service rebuild post params +func (o *StorageServiceRebuildPostParams) SetSourceDc(sourceDc *string) { + o.SourceDc = sourceDc +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceRebuildPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.SourceDc != nil { + + // query param source_dc + var qrSourceDc string + if o.SourceDc != nil { + qrSourceDc = *o.SourceDc + } + qSourceDc := qrSourceDc + if qSourceDc != "" { + if err := r.SetQueryParam("source_dc", qSourceDc); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rebuild_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rebuild_post_responses.go new file mode 100644 index 0000000000..b433f62afc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rebuild_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceRebuildPostReader is a Reader for the StorageServiceRebuildPost structure. +type StorageServiceRebuildPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceRebuildPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceRebuildPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceRebuildPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceRebuildPostOK creates a StorageServiceRebuildPostOK with default headers values +func NewStorageServiceRebuildPostOK() *StorageServiceRebuildPostOK { + return &StorageServiceRebuildPostOK{} +} + +/* +StorageServiceRebuildPostOK handles this case with default header values. + +Success +*/ +type StorageServiceRebuildPostOK struct { +} + +func (o *StorageServiceRebuildPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceRebuildPostDefault creates a StorageServiceRebuildPostDefault with default headers values +func NewStorageServiceRebuildPostDefault(code int) *StorageServiceRebuildPostDefault { + return &StorageServiceRebuildPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceRebuildPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceRebuildPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service rebuild post default response +func (o *StorageServiceRebuildPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceRebuildPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceRebuildPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceRebuildPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_release_version_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_release_version_get_parameters.go new file mode 100644 index 0000000000..ba74ad2f46 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_release_version_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceReleaseVersionGetParams creates a new StorageServiceReleaseVersionGetParams object +// with the default values initialized. +func NewStorageServiceReleaseVersionGetParams() *StorageServiceReleaseVersionGetParams { + + return &StorageServiceReleaseVersionGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceReleaseVersionGetParamsWithTimeout creates a new StorageServiceReleaseVersionGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceReleaseVersionGetParamsWithTimeout(timeout time.Duration) *StorageServiceReleaseVersionGetParams { + + return &StorageServiceReleaseVersionGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceReleaseVersionGetParamsWithContext creates a new StorageServiceReleaseVersionGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceReleaseVersionGetParamsWithContext(ctx context.Context) *StorageServiceReleaseVersionGetParams { + + return &StorageServiceReleaseVersionGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceReleaseVersionGetParamsWithHTTPClient creates a new StorageServiceReleaseVersionGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceReleaseVersionGetParamsWithHTTPClient(client *http.Client) *StorageServiceReleaseVersionGetParams { + + return &StorageServiceReleaseVersionGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceReleaseVersionGetParams contains all the parameters to send to the API endpoint +for the storage service release version get operation typically these are written to a http.Request +*/ +type StorageServiceReleaseVersionGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service release version get params +func (o *StorageServiceReleaseVersionGetParams) WithTimeout(timeout time.Duration) *StorageServiceReleaseVersionGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service release version get params +func (o *StorageServiceReleaseVersionGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service release version get params +func (o *StorageServiceReleaseVersionGetParams) WithContext(ctx context.Context) *StorageServiceReleaseVersionGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service release version get params +func (o *StorageServiceReleaseVersionGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service release version get params +func (o *StorageServiceReleaseVersionGetParams) WithHTTPClient(client *http.Client) *StorageServiceReleaseVersionGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service release version get params +func (o *StorageServiceReleaseVersionGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceReleaseVersionGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_release_version_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_release_version_get_responses.go new file mode 100644 index 0000000000..a8e2b11a82 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_release_version_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceReleaseVersionGetReader is a Reader for the StorageServiceReleaseVersionGet structure. +type StorageServiceReleaseVersionGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceReleaseVersionGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceReleaseVersionGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceReleaseVersionGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceReleaseVersionGetOK creates a StorageServiceReleaseVersionGetOK with default headers values +func NewStorageServiceReleaseVersionGetOK() *StorageServiceReleaseVersionGetOK { + return &StorageServiceReleaseVersionGetOK{} +} + +/* +StorageServiceReleaseVersionGetOK handles this case with default header values. + +Success +*/ +type StorageServiceReleaseVersionGetOK struct { + Payload string +} + +func (o *StorageServiceReleaseVersionGetOK) GetPayload() string { + return o.Payload +} + +func (o *StorageServiceReleaseVersionGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceReleaseVersionGetDefault creates a StorageServiceReleaseVersionGetDefault with default headers values +func NewStorageServiceReleaseVersionGetDefault(code int) *StorageServiceReleaseVersionGetDefault { + return &StorageServiceReleaseVersionGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceReleaseVersionGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceReleaseVersionGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service release version get default response +func (o *StorageServiceReleaseVersionGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceReleaseVersionGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceReleaseVersionGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceReleaseVersionGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_relocal_schema_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_relocal_schema_post_parameters.go new file mode 100644 index 0000000000..2d97124b80 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_relocal_schema_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceRelocalSchemaPostParams creates a new StorageServiceRelocalSchemaPostParams object +// with the default values initialized. +func NewStorageServiceRelocalSchemaPostParams() *StorageServiceRelocalSchemaPostParams { + + return &StorageServiceRelocalSchemaPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceRelocalSchemaPostParamsWithTimeout creates a new StorageServiceRelocalSchemaPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceRelocalSchemaPostParamsWithTimeout(timeout time.Duration) *StorageServiceRelocalSchemaPostParams { + + return &StorageServiceRelocalSchemaPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceRelocalSchemaPostParamsWithContext creates a new StorageServiceRelocalSchemaPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceRelocalSchemaPostParamsWithContext(ctx context.Context) *StorageServiceRelocalSchemaPostParams { + + return &StorageServiceRelocalSchemaPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceRelocalSchemaPostParamsWithHTTPClient creates a new StorageServiceRelocalSchemaPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceRelocalSchemaPostParamsWithHTTPClient(client *http.Client) *StorageServiceRelocalSchemaPostParams { + + return &StorageServiceRelocalSchemaPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceRelocalSchemaPostParams contains all the parameters to send to the API endpoint +for the storage service relocal schema post operation typically these are written to a http.Request +*/ +type StorageServiceRelocalSchemaPostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service relocal schema post params +func (o *StorageServiceRelocalSchemaPostParams) WithTimeout(timeout time.Duration) *StorageServiceRelocalSchemaPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service relocal schema post params +func (o *StorageServiceRelocalSchemaPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service relocal schema post params +func (o *StorageServiceRelocalSchemaPostParams) WithContext(ctx context.Context) *StorageServiceRelocalSchemaPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service relocal schema post params +func (o *StorageServiceRelocalSchemaPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service relocal schema post params +func (o *StorageServiceRelocalSchemaPostParams) WithHTTPClient(client *http.Client) *StorageServiceRelocalSchemaPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service relocal schema post params +func (o *StorageServiceRelocalSchemaPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceRelocalSchemaPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_relocal_schema_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_relocal_schema_post_responses.go new file mode 100644 index 0000000000..502b058fbb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_relocal_schema_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceRelocalSchemaPostReader is a Reader for the StorageServiceRelocalSchemaPost structure. +type StorageServiceRelocalSchemaPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceRelocalSchemaPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceRelocalSchemaPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceRelocalSchemaPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceRelocalSchemaPostOK creates a StorageServiceRelocalSchemaPostOK with default headers values +func NewStorageServiceRelocalSchemaPostOK() *StorageServiceRelocalSchemaPostOK { + return &StorageServiceRelocalSchemaPostOK{} +} + +/* +StorageServiceRelocalSchemaPostOK handles this case with default header values. + +Success +*/ +type StorageServiceRelocalSchemaPostOK struct { +} + +func (o *StorageServiceRelocalSchemaPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceRelocalSchemaPostDefault creates a StorageServiceRelocalSchemaPostDefault with default headers values +func NewStorageServiceRelocalSchemaPostDefault(code int) *StorageServiceRelocalSchemaPostDefault { + return &StorageServiceRelocalSchemaPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceRelocalSchemaPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceRelocalSchemaPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service relocal schema post default response +func (o *StorageServiceRelocalSchemaPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceRelocalSchemaPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceRelocalSchemaPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceRelocalSchemaPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_removal_status_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_removal_status_get_parameters.go new file mode 100644 index 0000000000..235e573f4a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_removal_status_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceRemovalStatusGetParams creates a new StorageServiceRemovalStatusGetParams object +// with the default values initialized. +func NewStorageServiceRemovalStatusGetParams() *StorageServiceRemovalStatusGetParams { + + return &StorageServiceRemovalStatusGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceRemovalStatusGetParamsWithTimeout creates a new StorageServiceRemovalStatusGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceRemovalStatusGetParamsWithTimeout(timeout time.Duration) *StorageServiceRemovalStatusGetParams { + + return &StorageServiceRemovalStatusGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceRemovalStatusGetParamsWithContext creates a new StorageServiceRemovalStatusGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceRemovalStatusGetParamsWithContext(ctx context.Context) *StorageServiceRemovalStatusGetParams { + + return &StorageServiceRemovalStatusGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceRemovalStatusGetParamsWithHTTPClient creates a new StorageServiceRemovalStatusGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceRemovalStatusGetParamsWithHTTPClient(client *http.Client) *StorageServiceRemovalStatusGetParams { + + return &StorageServiceRemovalStatusGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceRemovalStatusGetParams contains all the parameters to send to the API endpoint +for the storage service removal status get operation typically these are written to a http.Request +*/ +type StorageServiceRemovalStatusGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service removal status get params +func (o *StorageServiceRemovalStatusGetParams) WithTimeout(timeout time.Duration) *StorageServiceRemovalStatusGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service removal status get params +func (o *StorageServiceRemovalStatusGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service removal status get params +func (o *StorageServiceRemovalStatusGetParams) WithContext(ctx context.Context) *StorageServiceRemovalStatusGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service removal status get params +func (o *StorageServiceRemovalStatusGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service removal status get params +func (o *StorageServiceRemovalStatusGetParams) WithHTTPClient(client *http.Client) *StorageServiceRemovalStatusGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service removal status get params +func (o *StorageServiceRemovalStatusGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceRemovalStatusGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_removal_status_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_removal_status_get_responses.go new file mode 100644 index 0000000000..41923ee362 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_removal_status_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceRemovalStatusGetReader is a Reader for the StorageServiceRemovalStatusGet structure. +type StorageServiceRemovalStatusGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceRemovalStatusGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceRemovalStatusGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceRemovalStatusGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceRemovalStatusGetOK creates a StorageServiceRemovalStatusGetOK with default headers values +func NewStorageServiceRemovalStatusGetOK() *StorageServiceRemovalStatusGetOK { + return &StorageServiceRemovalStatusGetOK{} +} + +/* +StorageServiceRemovalStatusGetOK handles this case with default header values. + +Success +*/ +type StorageServiceRemovalStatusGetOK struct { + Payload string +} + +func (o *StorageServiceRemovalStatusGetOK) GetPayload() string { + return o.Payload +} + +func (o *StorageServiceRemovalStatusGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceRemovalStatusGetDefault creates a StorageServiceRemovalStatusGetDefault with default headers values +func NewStorageServiceRemovalStatusGetDefault(code int) *StorageServiceRemovalStatusGetDefault { + return &StorageServiceRemovalStatusGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceRemovalStatusGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceRemovalStatusGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service removal status get default response +func (o *StorageServiceRemovalStatusGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceRemovalStatusGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceRemovalStatusGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceRemovalStatusGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_remove_node_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_remove_node_post_parameters.go new file mode 100644 index 0000000000..708be26ee4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_remove_node_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceRemoveNodePostParams creates a new StorageServiceRemoveNodePostParams object +// with the default values initialized. +func NewStorageServiceRemoveNodePostParams() *StorageServiceRemoveNodePostParams { + var () + return &StorageServiceRemoveNodePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceRemoveNodePostParamsWithTimeout creates a new StorageServiceRemoveNodePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceRemoveNodePostParamsWithTimeout(timeout time.Duration) *StorageServiceRemoveNodePostParams { + var () + return &StorageServiceRemoveNodePostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceRemoveNodePostParamsWithContext creates a new StorageServiceRemoveNodePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceRemoveNodePostParamsWithContext(ctx context.Context) *StorageServiceRemoveNodePostParams { + var () + return &StorageServiceRemoveNodePostParams{ + + Context: ctx, + } +} + +// NewStorageServiceRemoveNodePostParamsWithHTTPClient creates a new StorageServiceRemoveNodePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceRemoveNodePostParamsWithHTTPClient(client *http.Client) *StorageServiceRemoveNodePostParams { + var () + return &StorageServiceRemoveNodePostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceRemoveNodePostParams contains all the parameters to send to the API endpoint +for the storage service remove node post operation typically these are written to a http.Request +*/ +type StorageServiceRemoveNodePostParams struct { + + /*HostID + Remove the node with host_id from the cluster + + */ + HostID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service remove node post params +func (o *StorageServiceRemoveNodePostParams) WithTimeout(timeout time.Duration) *StorageServiceRemoveNodePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service remove node post params +func (o *StorageServiceRemoveNodePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service remove node post params +func (o *StorageServiceRemoveNodePostParams) WithContext(ctx context.Context) *StorageServiceRemoveNodePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service remove node post params +func (o *StorageServiceRemoveNodePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service remove node post params +func (o *StorageServiceRemoveNodePostParams) WithHTTPClient(client *http.Client) *StorageServiceRemoveNodePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service remove node post params +func (o *StorageServiceRemoveNodePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithHostID adds the hostID to the storage service remove node post params +func (o *StorageServiceRemoveNodePostParams) WithHostID(hostID string) *StorageServiceRemoveNodePostParams { + o.SetHostID(hostID) + return o +} + +// SetHostID adds the hostId to the storage service remove node post params +func (o *StorageServiceRemoveNodePostParams) SetHostID(hostID string) { + o.HostID = hostID +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceRemoveNodePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param host_id + qrHostID := o.HostID + qHostID := qrHostID + if qHostID != "" { + if err := r.SetQueryParam("host_id", qHostID); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_remove_node_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_remove_node_post_responses.go new file mode 100644 index 0000000000..97fb90700d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_remove_node_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceRemoveNodePostReader is a Reader for the StorageServiceRemoveNodePost structure. +type StorageServiceRemoveNodePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceRemoveNodePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceRemoveNodePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceRemoveNodePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceRemoveNodePostOK creates a StorageServiceRemoveNodePostOK with default headers values +func NewStorageServiceRemoveNodePostOK() *StorageServiceRemoveNodePostOK { + return &StorageServiceRemoveNodePostOK{} +} + +/* +StorageServiceRemoveNodePostOK handles this case with default header values. + +Success +*/ +type StorageServiceRemoveNodePostOK struct { +} + +func (o *StorageServiceRemoveNodePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceRemoveNodePostDefault creates a StorageServiceRemoveNodePostDefault with default headers values +func NewStorageServiceRemoveNodePostDefault(code int) *StorageServiceRemoveNodePostDefault { + return &StorageServiceRemoveNodePostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceRemoveNodePostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceRemoveNodePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service remove node post default response +func (o *StorageServiceRemoveNodePostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceRemoveNodePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceRemoveNodePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceRemoveNodePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_async_by_keyspace_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_async_by_keyspace_get_parameters.go new file mode 100644 index 0000000000..fbd9f705cd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_async_by_keyspace_get_parameters.go @@ -0,0 +1,162 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceRepairAsyncByKeyspaceGetParams creates a new StorageServiceRepairAsyncByKeyspaceGetParams object +// with the default values initialized. +func NewStorageServiceRepairAsyncByKeyspaceGetParams() *StorageServiceRepairAsyncByKeyspaceGetParams { + var () + return &StorageServiceRepairAsyncByKeyspaceGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceRepairAsyncByKeyspaceGetParamsWithTimeout creates a new StorageServiceRepairAsyncByKeyspaceGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceRepairAsyncByKeyspaceGetParamsWithTimeout(timeout time.Duration) *StorageServiceRepairAsyncByKeyspaceGetParams { + var () + return &StorageServiceRepairAsyncByKeyspaceGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceRepairAsyncByKeyspaceGetParamsWithContext creates a new StorageServiceRepairAsyncByKeyspaceGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceRepairAsyncByKeyspaceGetParamsWithContext(ctx context.Context) *StorageServiceRepairAsyncByKeyspaceGetParams { + var () + return &StorageServiceRepairAsyncByKeyspaceGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceRepairAsyncByKeyspaceGetParamsWithHTTPClient creates a new StorageServiceRepairAsyncByKeyspaceGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceRepairAsyncByKeyspaceGetParamsWithHTTPClient(client *http.Client) *StorageServiceRepairAsyncByKeyspaceGetParams { + var () + return &StorageServiceRepairAsyncByKeyspaceGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceRepairAsyncByKeyspaceGetParams contains all the parameters to send to the API endpoint +for the storage service repair async by keyspace get operation typically these are written to a http.Request +*/ +type StorageServiceRepairAsyncByKeyspaceGetParams struct { + + /*ID + The repair ID to check for status + + */ + ID int32 + /*Keyspace + The keyspace repair is running on + + */ + Keyspace string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service repair async by keyspace get params +func (o *StorageServiceRepairAsyncByKeyspaceGetParams) WithTimeout(timeout time.Duration) *StorageServiceRepairAsyncByKeyspaceGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service repair async by keyspace get params +func (o *StorageServiceRepairAsyncByKeyspaceGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service repair async by keyspace get params +func (o *StorageServiceRepairAsyncByKeyspaceGetParams) WithContext(ctx context.Context) *StorageServiceRepairAsyncByKeyspaceGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service repair async by keyspace get params +func (o *StorageServiceRepairAsyncByKeyspaceGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service repair async by keyspace get params +func (o *StorageServiceRepairAsyncByKeyspaceGetParams) WithHTTPClient(client *http.Client) *StorageServiceRepairAsyncByKeyspaceGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service repair async by keyspace get params +func (o *StorageServiceRepairAsyncByKeyspaceGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the storage service repair async by keyspace get params +func (o *StorageServiceRepairAsyncByKeyspaceGetParams) WithID(id int32) *StorageServiceRepairAsyncByKeyspaceGetParams { + o.SetID(id) + return o +} + +// SetID adds the id to the storage service repair async by keyspace get params +func (o *StorageServiceRepairAsyncByKeyspaceGetParams) SetID(id int32) { + o.ID = id +} + +// WithKeyspace adds the keyspace to the storage service repair async by keyspace get params +func (o *StorageServiceRepairAsyncByKeyspaceGetParams) WithKeyspace(keyspace string) *StorageServiceRepairAsyncByKeyspaceGetParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service repair async by keyspace get params +func (o *StorageServiceRepairAsyncByKeyspaceGetParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceRepairAsyncByKeyspaceGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param id + qrID := o.ID + qID := swag.FormatInt32(qrID) + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_async_by_keyspace_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_async_by_keyspace_get_responses.go new file mode 100644 index 0000000000..7601759450 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_async_by_keyspace_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceRepairAsyncByKeyspaceGetReader is a Reader for the StorageServiceRepairAsyncByKeyspaceGet structure. +type StorageServiceRepairAsyncByKeyspaceGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceRepairAsyncByKeyspaceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceRepairAsyncByKeyspaceGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceRepairAsyncByKeyspaceGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceRepairAsyncByKeyspaceGetOK creates a StorageServiceRepairAsyncByKeyspaceGetOK with default headers values +func NewStorageServiceRepairAsyncByKeyspaceGetOK() *StorageServiceRepairAsyncByKeyspaceGetOK { + return &StorageServiceRepairAsyncByKeyspaceGetOK{} +} + +/* +StorageServiceRepairAsyncByKeyspaceGetOK handles this case with default header values. + +Success +*/ +type StorageServiceRepairAsyncByKeyspaceGetOK struct { + Payload models.RepairAsyncStatusResponse +} + +func (o *StorageServiceRepairAsyncByKeyspaceGetOK) GetPayload() models.RepairAsyncStatusResponse { + return o.Payload +} + +func (o *StorageServiceRepairAsyncByKeyspaceGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceRepairAsyncByKeyspaceGetDefault creates a StorageServiceRepairAsyncByKeyspaceGetDefault with default headers values +func NewStorageServiceRepairAsyncByKeyspaceGetDefault(code int) *StorageServiceRepairAsyncByKeyspaceGetDefault { + return &StorageServiceRepairAsyncByKeyspaceGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceRepairAsyncByKeyspaceGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceRepairAsyncByKeyspaceGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service repair async by keyspace get default response +func (o *StorageServiceRepairAsyncByKeyspaceGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceRepairAsyncByKeyspaceGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceRepairAsyncByKeyspaceGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceRepairAsyncByKeyspaceGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_async_by_keyspace_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_async_by_keyspace_post_parameters.go new file mode 100644 index 0000000000..6f2cd14a16 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_async_by_keyspace_post_parameters.go @@ -0,0 +1,584 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceRepairAsyncByKeyspacePostParams creates a new StorageServiceRepairAsyncByKeyspacePostParams object +// with the default values initialized. +func NewStorageServiceRepairAsyncByKeyspacePostParams() *StorageServiceRepairAsyncByKeyspacePostParams { + var () + return &StorageServiceRepairAsyncByKeyspacePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceRepairAsyncByKeyspacePostParamsWithTimeout creates a new StorageServiceRepairAsyncByKeyspacePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceRepairAsyncByKeyspacePostParamsWithTimeout(timeout time.Duration) *StorageServiceRepairAsyncByKeyspacePostParams { + var () + return &StorageServiceRepairAsyncByKeyspacePostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceRepairAsyncByKeyspacePostParamsWithContext creates a new StorageServiceRepairAsyncByKeyspacePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceRepairAsyncByKeyspacePostParamsWithContext(ctx context.Context) *StorageServiceRepairAsyncByKeyspacePostParams { + var () + return &StorageServiceRepairAsyncByKeyspacePostParams{ + + Context: ctx, + } +} + +// NewStorageServiceRepairAsyncByKeyspacePostParamsWithHTTPClient creates a new StorageServiceRepairAsyncByKeyspacePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceRepairAsyncByKeyspacePostParamsWithHTTPClient(client *http.Client) *StorageServiceRepairAsyncByKeyspacePostParams { + var () + return &StorageServiceRepairAsyncByKeyspacePostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceRepairAsyncByKeyspacePostParams contains all the parameters to send to the API endpoint +for the storage service repair async by keyspace post operation typically these are written to a http.Request +*/ +type StorageServiceRepairAsyncByKeyspacePostParams struct { + + /*ColumnFamilies + Which column families to repair in the given keyspace. Multiple columns families can be named separated by commas. If this option is missing, all column families in the keyspace are repaired. + + */ + ColumnFamilies *string + /*DataCenters + Which data centers are to participate in this repair. Multiple data centers can be listed separated by commas. + + */ + DataCenters *string + /*EndToken + Token on which to end repair + + */ + EndToken *string + /*Hosts + Which hosts are to participate in this repair. Multiple hosts can be listed separated by commas. + + */ + Hosts *string + /*IgnoreNodes + Which hosts are to ignore in this repair. Multiple hosts can be listed separated by commas. + + */ + IgnoreNodes *string + /*Incremental + If the value is the string 'true' with any capitalization, perform incremental repair. + + */ + Incremental *string + /*JobThreads + An integer specifying the parallelism on each node. + + */ + JobThreads *string + /*Keyspace + The keyspace to repair + + */ + Keyspace string + /*Parallelism + Repair parallelism, can be 0 (sequential), 1 (parallel) or 2 (datacenter-aware). + + */ + Parallelism *string + /*PrimaryRange + If the value is the string 'true' with any capitalization, repair only the first range returned by the partitioner. + + */ + PrimaryRange *string + /*Ranges + An explicit list of ranges to repair, overriding the default choice. Each range is expressed as token1:token2, and multiple ranges can be given as a comma separated list. + + */ + Ranges *string + /*RangesParallelism + An integer specifying the number of ranges to repair in parallel by user request. If this number is bigger than the max_repair_ranges_in_parallel calculated by Scylla core, the smaller one will be used. + + */ + RangesParallelism *string + /*SmallTableOptimization + If the value is the string 'true' with any capitalization, perform small table optimization. When this option is enabled, user can send the repair request to any of the nodes in the cluster. There is no need to send repair requests to multiple nodes. All token ranges for the table will be repaired automatically. + + */ + SmallTableOptimization *string + /*StartToken + Token on which to begin repair + + */ + StartToken *string + /*Trace + If the value is the string 'true' with any capitalization, enable tracing of the repair. + + */ + Trace *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithTimeout(timeout time.Duration) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithContext(ctx context.Context) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithHTTPClient(client *http.Client) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithColumnFamilies adds the columnFamilies to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithColumnFamilies(columnFamilies *string) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetColumnFamilies(columnFamilies) + return o +} + +// SetColumnFamilies adds the columnFamilies to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetColumnFamilies(columnFamilies *string) { + o.ColumnFamilies = columnFamilies +} + +// WithDataCenters adds the dataCenters to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithDataCenters(dataCenters *string) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetDataCenters(dataCenters) + return o +} + +// SetDataCenters adds the dataCenters to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetDataCenters(dataCenters *string) { + o.DataCenters = dataCenters +} + +// WithEndToken adds the endToken to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithEndToken(endToken *string) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetEndToken(endToken) + return o +} + +// SetEndToken adds the endToken to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetEndToken(endToken *string) { + o.EndToken = endToken +} + +// WithHosts adds the hosts to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithHosts(hosts *string) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetHosts(hosts) + return o +} + +// SetHosts adds the hosts to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetHosts(hosts *string) { + o.Hosts = hosts +} + +// WithIgnoreNodes adds the ignoreNodes to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithIgnoreNodes(ignoreNodes *string) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetIgnoreNodes(ignoreNodes) + return o +} + +// SetIgnoreNodes adds the ignoreNodes to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetIgnoreNodes(ignoreNodes *string) { + o.IgnoreNodes = ignoreNodes +} + +// WithIncremental adds the incremental to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithIncremental(incremental *string) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetIncremental(incremental) + return o +} + +// SetIncremental adds the incremental to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetIncremental(incremental *string) { + o.Incremental = incremental +} + +// WithJobThreads adds the jobThreads to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithJobThreads(jobThreads *string) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetJobThreads(jobThreads) + return o +} + +// SetJobThreads adds the jobThreads to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetJobThreads(jobThreads *string) { + o.JobThreads = jobThreads +} + +// WithKeyspace adds the keyspace to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithKeyspace(keyspace string) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WithParallelism adds the parallelism to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithParallelism(parallelism *string) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetParallelism(parallelism) + return o +} + +// SetParallelism adds the parallelism to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetParallelism(parallelism *string) { + o.Parallelism = parallelism +} + +// WithPrimaryRange adds the primaryRange to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithPrimaryRange(primaryRange *string) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetPrimaryRange(primaryRange) + return o +} + +// SetPrimaryRange adds the primaryRange to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetPrimaryRange(primaryRange *string) { + o.PrimaryRange = primaryRange +} + +// WithRanges adds the ranges to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithRanges(ranges *string) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetRanges(ranges) + return o +} + +// SetRanges adds the ranges to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetRanges(ranges *string) { + o.Ranges = ranges +} + +// WithRangesParallelism adds the rangesParallelism to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithRangesParallelism(rangesParallelism *string) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetRangesParallelism(rangesParallelism) + return o +} + +// SetRangesParallelism adds the rangesParallelism to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetRangesParallelism(rangesParallelism *string) { + o.RangesParallelism = rangesParallelism +} + +// WithSmallTableOptimization adds the smallTableOptimization to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithSmallTableOptimization(smallTableOptimization *string) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetSmallTableOptimization(smallTableOptimization) + return o +} + +// SetSmallTableOptimization adds the smallTableOptimization to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetSmallTableOptimization(smallTableOptimization *string) { + o.SmallTableOptimization = smallTableOptimization +} + +// WithStartToken adds the startToken to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithStartToken(startToken *string) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetStartToken(startToken) + return o +} + +// SetStartToken adds the startToken to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetStartToken(startToken *string) { + o.StartToken = startToken +} + +// WithTrace adds the trace to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WithTrace(trace *string) *StorageServiceRepairAsyncByKeyspacePostParams { + o.SetTrace(trace) + return o +} + +// SetTrace adds the trace to the storage service repair async by keyspace post params +func (o *StorageServiceRepairAsyncByKeyspacePostParams) SetTrace(trace *string) { + o.Trace = trace +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceRepairAsyncByKeyspacePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ColumnFamilies != nil { + + // query param columnFamilies + var qrColumnFamilies string + if o.ColumnFamilies != nil { + qrColumnFamilies = *o.ColumnFamilies + } + qColumnFamilies := qrColumnFamilies + if qColumnFamilies != "" { + if err := r.SetQueryParam("columnFamilies", qColumnFamilies); err != nil { + return err + } + } + + } + + if o.DataCenters != nil { + + // query param dataCenters + var qrDataCenters string + if o.DataCenters != nil { + qrDataCenters = *o.DataCenters + } + qDataCenters := qrDataCenters + if qDataCenters != "" { + if err := r.SetQueryParam("dataCenters", qDataCenters); err != nil { + return err + } + } + + } + + if o.EndToken != nil { + + // query param endToken + var qrEndToken string + if o.EndToken != nil { + qrEndToken = *o.EndToken + } + qEndToken := qrEndToken + if qEndToken != "" { + if err := r.SetQueryParam("endToken", qEndToken); err != nil { + return err + } + } + + } + + if o.Hosts != nil { + + // query param hosts + var qrHosts string + if o.Hosts != nil { + qrHosts = *o.Hosts + } + qHosts := qrHosts + if qHosts != "" { + if err := r.SetQueryParam("hosts", qHosts); err != nil { + return err + } + } + + } + + if o.IgnoreNodes != nil { + + // query param ignore_nodes + var qrIgnoreNodes string + if o.IgnoreNodes != nil { + qrIgnoreNodes = *o.IgnoreNodes + } + qIgnoreNodes := qrIgnoreNodes + if qIgnoreNodes != "" { + if err := r.SetQueryParam("ignore_nodes", qIgnoreNodes); err != nil { + return err + } + } + + } + + if o.Incremental != nil { + + // query param incremental + var qrIncremental string + if o.Incremental != nil { + qrIncremental = *o.Incremental + } + qIncremental := qrIncremental + if qIncremental != "" { + if err := r.SetQueryParam("incremental", qIncremental); err != nil { + return err + } + } + + } + + if o.JobThreads != nil { + + // query param jobThreads + var qrJobThreads string + if o.JobThreads != nil { + qrJobThreads = *o.JobThreads + } + qJobThreads := qrJobThreads + if qJobThreads != "" { + if err := r.SetQueryParam("jobThreads", qJobThreads); err != nil { + return err + } + } + + } + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if o.Parallelism != nil { + + // query param parallelism + var qrParallelism string + if o.Parallelism != nil { + qrParallelism = *o.Parallelism + } + qParallelism := qrParallelism + if qParallelism != "" { + if err := r.SetQueryParam("parallelism", qParallelism); err != nil { + return err + } + } + + } + + if o.PrimaryRange != nil { + + // query param primaryRange + var qrPrimaryRange string + if o.PrimaryRange != nil { + qrPrimaryRange = *o.PrimaryRange + } + qPrimaryRange := qrPrimaryRange + if qPrimaryRange != "" { + if err := r.SetQueryParam("primaryRange", qPrimaryRange); err != nil { + return err + } + } + + } + + if o.Ranges != nil { + + // query param ranges + var qrRanges string + if o.Ranges != nil { + qrRanges = *o.Ranges + } + qRanges := qrRanges + if qRanges != "" { + if err := r.SetQueryParam("ranges", qRanges); err != nil { + return err + } + } + + } + + if o.RangesParallelism != nil { + + // query param ranges_parallelism + var qrRangesParallelism string + if o.RangesParallelism != nil { + qrRangesParallelism = *o.RangesParallelism + } + qRangesParallelism := qrRangesParallelism + if qRangesParallelism != "" { + if err := r.SetQueryParam("ranges_parallelism", qRangesParallelism); err != nil { + return err + } + } + + } + + if o.SmallTableOptimization != nil { + + // query param small_table_optimization + var qrSmallTableOptimization string + if o.SmallTableOptimization != nil { + qrSmallTableOptimization = *o.SmallTableOptimization + } + qSmallTableOptimization := qrSmallTableOptimization + if qSmallTableOptimization != "" { + if err := r.SetQueryParam("small_table_optimization", qSmallTableOptimization); err != nil { + return err + } + } + + } + + if o.StartToken != nil { + + // query param startToken + var qrStartToken string + if o.StartToken != nil { + qrStartToken = *o.StartToken + } + qStartToken := qrStartToken + if qStartToken != "" { + if err := r.SetQueryParam("startToken", qStartToken); err != nil { + return err + } + } + + } + + if o.Trace != nil { + + // query param trace + var qrTrace string + if o.Trace != nil { + qrTrace = *o.Trace + } + qTrace := qrTrace + if qTrace != "" { + if err := r.SetQueryParam("trace", qTrace); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_async_by_keyspace_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_async_by_keyspace_post_responses.go new file mode 100644 index 0000000000..cb0b212e0d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_async_by_keyspace_post_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceRepairAsyncByKeyspacePostReader is a Reader for the StorageServiceRepairAsyncByKeyspacePost structure. +type StorageServiceRepairAsyncByKeyspacePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceRepairAsyncByKeyspacePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceRepairAsyncByKeyspacePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceRepairAsyncByKeyspacePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceRepairAsyncByKeyspacePostOK creates a StorageServiceRepairAsyncByKeyspacePostOK with default headers values +func NewStorageServiceRepairAsyncByKeyspacePostOK() *StorageServiceRepairAsyncByKeyspacePostOK { + return &StorageServiceRepairAsyncByKeyspacePostOK{} +} + +/* +StorageServiceRepairAsyncByKeyspacePostOK handles this case with default header values. + +Success +*/ +type StorageServiceRepairAsyncByKeyspacePostOK struct { + Payload int32 +} + +func (o *StorageServiceRepairAsyncByKeyspacePostOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageServiceRepairAsyncByKeyspacePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceRepairAsyncByKeyspacePostDefault creates a StorageServiceRepairAsyncByKeyspacePostDefault with default headers values +func NewStorageServiceRepairAsyncByKeyspacePostDefault(code int) *StorageServiceRepairAsyncByKeyspacePostDefault { + return &StorageServiceRepairAsyncByKeyspacePostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceRepairAsyncByKeyspacePostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceRepairAsyncByKeyspacePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service repair async by keyspace post default response +func (o *StorageServiceRepairAsyncByKeyspacePostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceRepairAsyncByKeyspacePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceRepairAsyncByKeyspacePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceRepairAsyncByKeyspacePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_status_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_status_parameters.go new file mode 100644 index 0000000000..32d8e62964 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_status_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceRepairStatusParams creates a new StorageServiceRepairStatusParams object +// with the default values initialized. +func NewStorageServiceRepairStatusParams() *StorageServiceRepairStatusParams { + var () + return &StorageServiceRepairStatusParams{ + + requestTimeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceRepairStatusParamsWithTimeout creates a new StorageServiceRepairStatusParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceRepairStatusParamsWithTimeout(timeout time.Duration) *StorageServiceRepairStatusParams { + var () + return &StorageServiceRepairStatusParams{ + + requestTimeout: timeout, + } +} + +// NewStorageServiceRepairStatusParamsWithContext creates a new StorageServiceRepairStatusParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceRepairStatusParamsWithContext(ctx context.Context) *StorageServiceRepairStatusParams { + var () + return &StorageServiceRepairStatusParams{ + + Context: ctx, + } +} + +// NewStorageServiceRepairStatusParamsWithHTTPClient creates a new StorageServiceRepairStatusParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceRepairStatusParamsWithHTTPClient(client *http.Client) *StorageServiceRepairStatusParams { + var () + return &StorageServiceRepairStatusParams{ + HTTPClient: client, + } +} + +/* +StorageServiceRepairStatusParams contains all the parameters to send to the API endpoint +for the storage service repair status operation typically these are written to a http.Request +*/ +type StorageServiceRepairStatusParams struct { + + /*ID + The repair ID to check for status + + */ + ID int32 + /*Timeout + Seconds to wait before the query returns even if the repair is not finished. The value -1 or not providing this parameter means no timeout + + */ + Timeout *int64 + + requestTimeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithRequestTimeout adds the timeout to the storage service repair status params +func (o *StorageServiceRepairStatusParams) WithRequestTimeout(timeout time.Duration) *StorageServiceRepairStatusParams { + o.SetRequestTimeout(timeout) + return o +} + +// SetRequestTimeout adds the timeout to the storage service repair status params +func (o *StorageServiceRepairStatusParams) SetRequestTimeout(timeout time.Duration) { + o.requestTimeout = timeout +} + +// WithContext adds the context to the storage service repair status params +func (o *StorageServiceRepairStatusParams) WithContext(ctx context.Context) *StorageServiceRepairStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service repair status params +func (o *StorageServiceRepairStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service repair status params +func (o *StorageServiceRepairStatusParams) WithHTTPClient(client *http.Client) *StorageServiceRepairStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service repair status params +func (o *StorageServiceRepairStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the storage service repair status params +func (o *StorageServiceRepairStatusParams) WithID(id int32) *StorageServiceRepairStatusParams { + o.SetID(id) + return o +} + +// SetID adds the id to the storage service repair status params +func (o *StorageServiceRepairStatusParams) SetID(id int32) { + o.ID = id +} + +// WithTimeout adds the timeout to the storage service repair status params +func (o *StorageServiceRepairStatusParams) WithTimeout(timeout *int64) *StorageServiceRepairStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service repair status params +func (o *StorageServiceRepairStatusParams) SetTimeout(timeout *int64) { + o.Timeout = timeout +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceRepairStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.requestTimeout); err != nil { + return err + } + var res []error + + // query param id + qrID := o.ID + qID := swag.FormatInt32(qrID) + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + if o.Timeout != nil { + + // query param timeout + var qrTimeout int64 + if o.Timeout != nil { + qrTimeout = *o.Timeout + } + qTimeout := swag.FormatInt64(qrTimeout) + if qTimeout != "" { + if err := r.SetQueryParam("timeout", qTimeout); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_status_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_status_responses.go new file mode 100644 index 0000000000..f3d224cd48 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_repair_status_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceRepairStatusReader is a Reader for the StorageServiceRepairStatus structure. +type StorageServiceRepairStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceRepairStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceRepairStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceRepairStatusDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceRepairStatusOK creates a StorageServiceRepairStatusOK with default headers values +func NewStorageServiceRepairStatusOK() *StorageServiceRepairStatusOK { + return &StorageServiceRepairStatusOK{} +} + +/* +StorageServiceRepairStatusOK handles this case with default header values. + +Repair status value +*/ +type StorageServiceRepairStatusOK struct { + Payload models.RepairAsyncStatusResponse +} + +func (o *StorageServiceRepairStatusOK) GetPayload() models.RepairAsyncStatusResponse { + return o.Payload +} + +func (o *StorageServiceRepairStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceRepairStatusDefault creates a StorageServiceRepairStatusDefault with default headers values +func NewStorageServiceRepairStatusDefault(code int) *StorageServiceRepairStatusDefault { + return &StorageServiceRepairStatusDefault{ + _statusCode: code, + } +} + +/* +StorageServiceRepairStatusDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceRepairStatusDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service repair status default response +func (o *StorageServiceRepairStatusDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceRepairStatusDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceRepairStatusDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceRepairStatusDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_reschedule_failed_deletions_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_reschedule_failed_deletions_post_parameters.go new file mode 100644 index 0000000000..094ac4e684 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_reschedule_failed_deletions_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceRescheduleFailedDeletionsPostParams creates a new StorageServiceRescheduleFailedDeletionsPostParams object +// with the default values initialized. +func NewStorageServiceRescheduleFailedDeletionsPostParams() *StorageServiceRescheduleFailedDeletionsPostParams { + + return &StorageServiceRescheduleFailedDeletionsPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceRescheduleFailedDeletionsPostParamsWithTimeout creates a new StorageServiceRescheduleFailedDeletionsPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceRescheduleFailedDeletionsPostParamsWithTimeout(timeout time.Duration) *StorageServiceRescheduleFailedDeletionsPostParams { + + return &StorageServiceRescheduleFailedDeletionsPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceRescheduleFailedDeletionsPostParamsWithContext creates a new StorageServiceRescheduleFailedDeletionsPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceRescheduleFailedDeletionsPostParamsWithContext(ctx context.Context) *StorageServiceRescheduleFailedDeletionsPostParams { + + return &StorageServiceRescheduleFailedDeletionsPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceRescheduleFailedDeletionsPostParamsWithHTTPClient creates a new StorageServiceRescheduleFailedDeletionsPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceRescheduleFailedDeletionsPostParamsWithHTTPClient(client *http.Client) *StorageServiceRescheduleFailedDeletionsPostParams { + + return &StorageServiceRescheduleFailedDeletionsPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceRescheduleFailedDeletionsPostParams contains all the parameters to send to the API endpoint +for the storage service reschedule failed deletions post operation typically these are written to a http.Request +*/ +type StorageServiceRescheduleFailedDeletionsPostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service reschedule failed deletions post params +func (o *StorageServiceRescheduleFailedDeletionsPostParams) WithTimeout(timeout time.Duration) *StorageServiceRescheduleFailedDeletionsPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service reschedule failed deletions post params +func (o *StorageServiceRescheduleFailedDeletionsPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service reschedule failed deletions post params +func (o *StorageServiceRescheduleFailedDeletionsPostParams) WithContext(ctx context.Context) *StorageServiceRescheduleFailedDeletionsPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service reschedule failed deletions post params +func (o *StorageServiceRescheduleFailedDeletionsPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service reschedule failed deletions post params +func (o *StorageServiceRescheduleFailedDeletionsPostParams) WithHTTPClient(client *http.Client) *StorageServiceRescheduleFailedDeletionsPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service reschedule failed deletions post params +func (o *StorageServiceRescheduleFailedDeletionsPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceRescheduleFailedDeletionsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_reschedule_failed_deletions_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_reschedule_failed_deletions_post_responses.go new file mode 100644 index 0000000000..747d18db56 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_reschedule_failed_deletions_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceRescheduleFailedDeletionsPostReader is a Reader for the StorageServiceRescheduleFailedDeletionsPost structure. +type StorageServiceRescheduleFailedDeletionsPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceRescheduleFailedDeletionsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceRescheduleFailedDeletionsPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceRescheduleFailedDeletionsPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceRescheduleFailedDeletionsPostOK creates a StorageServiceRescheduleFailedDeletionsPostOK with default headers values +func NewStorageServiceRescheduleFailedDeletionsPostOK() *StorageServiceRescheduleFailedDeletionsPostOK { + return &StorageServiceRescheduleFailedDeletionsPostOK{} +} + +/* +StorageServiceRescheduleFailedDeletionsPostOK handles this case with default header values. + +Success +*/ +type StorageServiceRescheduleFailedDeletionsPostOK struct { +} + +func (o *StorageServiceRescheduleFailedDeletionsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceRescheduleFailedDeletionsPostDefault creates a StorageServiceRescheduleFailedDeletionsPostDefault with default headers values +func NewStorageServiceRescheduleFailedDeletionsPostDefault(code int) *StorageServiceRescheduleFailedDeletionsPostDefault { + return &StorageServiceRescheduleFailedDeletionsPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceRescheduleFailedDeletionsPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceRescheduleFailedDeletionsPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service reschedule failed deletions post default response +func (o *StorageServiceRescheduleFailedDeletionsPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceRescheduleFailedDeletionsPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceRescheduleFailedDeletionsPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceRescheduleFailedDeletionsPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_delete_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_delete_parameters.go new file mode 100644 index 0000000000..01805f5ffd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_delete_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceRPCServerDeleteParams creates a new StorageServiceRPCServerDeleteParams object +// with the default values initialized. +func NewStorageServiceRPCServerDeleteParams() *StorageServiceRPCServerDeleteParams { + + return &StorageServiceRPCServerDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceRPCServerDeleteParamsWithTimeout creates a new StorageServiceRPCServerDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceRPCServerDeleteParamsWithTimeout(timeout time.Duration) *StorageServiceRPCServerDeleteParams { + + return &StorageServiceRPCServerDeleteParams{ + + timeout: timeout, + } +} + +// NewStorageServiceRPCServerDeleteParamsWithContext creates a new StorageServiceRPCServerDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceRPCServerDeleteParamsWithContext(ctx context.Context) *StorageServiceRPCServerDeleteParams { + + return &StorageServiceRPCServerDeleteParams{ + + Context: ctx, + } +} + +// NewStorageServiceRPCServerDeleteParamsWithHTTPClient creates a new StorageServiceRPCServerDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceRPCServerDeleteParamsWithHTTPClient(client *http.Client) *StorageServiceRPCServerDeleteParams { + + return &StorageServiceRPCServerDeleteParams{ + HTTPClient: client, + } +} + +/* +StorageServiceRPCServerDeleteParams contains all the parameters to send to the API endpoint +for the storage service Rpc server delete operation typically these are written to a http.Request +*/ +type StorageServiceRPCServerDeleteParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service Rpc server delete params +func (o *StorageServiceRPCServerDeleteParams) WithTimeout(timeout time.Duration) *StorageServiceRPCServerDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service Rpc server delete params +func (o *StorageServiceRPCServerDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service Rpc server delete params +func (o *StorageServiceRPCServerDeleteParams) WithContext(ctx context.Context) *StorageServiceRPCServerDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service Rpc server delete params +func (o *StorageServiceRPCServerDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service Rpc server delete params +func (o *StorageServiceRPCServerDeleteParams) WithHTTPClient(client *http.Client) *StorageServiceRPCServerDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service Rpc server delete params +func (o *StorageServiceRPCServerDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceRPCServerDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_delete_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_delete_responses.go new file mode 100644 index 0000000000..74b2ee53db --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_delete_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceRPCServerDeleteReader is a Reader for the StorageServiceRPCServerDelete structure. +type StorageServiceRPCServerDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceRPCServerDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceRPCServerDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceRPCServerDeleteDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceRPCServerDeleteOK creates a StorageServiceRPCServerDeleteOK with default headers values +func NewStorageServiceRPCServerDeleteOK() *StorageServiceRPCServerDeleteOK { + return &StorageServiceRPCServerDeleteOK{} +} + +/* +StorageServiceRPCServerDeleteOK handles this case with default header values. + +Success +*/ +type StorageServiceRPCServerDeleteOK struct { +} + +func (o *StorageServiceRPCServerDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceRPCServerDeleteDefault creates a StorageServiceRPCServerDeleteDefault with default headers values +func NewStorageServiceRPCServerDeleteDefault(code int) *StorageServiceRPCServerDeleteDefault { + return &StorageServiceRPCServerDeleteDefault{ + _statusCode: code, + } +} + +/* +StorageServiceRPCServerDeleteDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceRPCServerDeleteDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service Rpc server delete default response +func (o *StorageServiceRPCServerDeleteDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceRPCServerDeleteDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceRPCServerDeleteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceRPCServerDeleteDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_get_parameters.go new file mode 100644 index 0000000000..1c3a0ea581 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceRPCServerGetParams creates a new StorageServiceRPCServerGetParams object +// with the default values initialized. +func NewStorageServiceRPCServerGetParams() *StorageServiceRPCServerGetParams { + + return &StorageServiceRPCServerGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceRPCServerGetParamsWithTimeout creates a new StorageServiceRPCServerGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceRPCServerGetParamsWithTimeout(timeout time.Duration) *StorageServiceRPCServerGetParams { + + return &StorageServiceRPCServerGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceRPCServerGetParamsWithContext creates a new StorageServiceRPCServerGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceRPCServerGetParamsWithContext(ctx context.Context) *StorageServiceRPCServerGetParams { + + return &StorageServiceRPCServerGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceRPCServerGetParamsWithHTTPClient creates a new StorageServiceRPCServerGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceRPCServerGetParamsWithHTTPClient(client *http.Client) *StorageServiceRPCServerGetParams { + + return &StorageServiceRPCServerGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceRPCServerGetParams contains all the parameters to send to the API endpoint +for the storage service Rpc server get operation typically these are written to a http.Request +*/ +type StorageServiceRPCServerGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service Rpc server get params +func (o *StorageServiceRPCServerGetParams) WithTimeout(timeout time.Duration) *StorageServiceRPCServerGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service Rpc server get params +func (o *StorageServiceRPCServerGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service Rpc server get params +func (o *StorageServiceRPCServerGetParams) WithContext(ctx context.Context) *StorageServiceRPCServerGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service Rpc server get params +func (o *StorageServiceRPCServerGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service Rpc server get params +func (o *StorageServiceRPCServerGetParams) WithHTTPClient(client *http.Client) *StorageServiceRPCServerGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service Rpc server get params +func (o *StorageServiceRPCServerGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceRPCServerGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_get_responses.go new file mode 100644 index 0000000000..841a23ed6a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceRPCServerGetReader is a Reader for the StorageServiceRPCServerGet structure. +type StorageServiceRPCServerGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceRPCServerGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceRPCServerGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceRPCServerGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceRPCServerGetOK creates a StorageServiceRPCServerGetOK with default headers values +func NewStorageServiceRPCServerGetOK() *StorageServiceRPCServerGetOK { + return &StorageServiceRPCServerGetOK{} +} + +/* +StorageServiceRPCServerGetOK handles this case with default header values. + +Success +*/ +type StorageServiceRPCServerGetOK struct { + Payload bool +} + +func (o *StorageServiceRPCServerGetOK) GetPayload() bool { + return o.Payload +} + +func (o *StorageServiceRPCServerGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceRPCServerGetDefault creates a StorageServiceRPCServerGetDefault with default headers values +func NewStorageServiceRPCServerGetDefault(code int) *StorageServiceRPCServerGetDefault { + return &StorageServiceRPCServerGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceRPCServerGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceRPCServerGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service Rpc server get default response +func (o *StorageServiceRPCServerGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceRPCServerGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceRPCServerGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceRPCServerGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_post_parameters.go new file mode 100644 index 0000000000..33b7f87d7c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceRPCServerPostParams creates a new StorageServiceRPCServerPostParams object +// with the default values initialized. +func NewStorageServiceRPCServerPostParams() *StorageServiceRPCServerPostParams { + + return &StorageServiceRPCServerPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceRPCServerPostParamsWithTimeout creates a new StorageServiceRPCServerPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceRPCServerPostParamsWithTimeout(timeout time.Duration) *StorageServiceRPCServerPostParams { + + return &StorageServiceRPCServerPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceRPCServerPostParamsWithContext creates a new StorageServiceRPCServerPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceRPCServerPostParamsWithContext(ctx context.Context) *StorageServiceRPCServerPostParams { + + return &StorageServiceRPCServerPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceRPCServerPostParamsWithHTTPClient creates a new StorageServiceRPCServerPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceRPCServerPostParamsWithHTTPClient(client *http.Client) *StorageServiceRPCServerPostParams { + + return &StorageServiceRPCServerPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceRPCServerPostParams contains all the parameters to send to the API endpoint +for the storage service Rpc server post operation typically these are written to a http.Request +*/ +type StorageServiceRPCServerPostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service Rpc server post params +func (o *StorageServiceRPCServerPostParams) WithTimeout(timeout time.Duration) *StorageServiceRPCServerPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service Rpc server post params +func (o *StorageServiceRPCServerPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service Rpc server post params +func (o *StorageServiceRPCServerPostParams) WithContext(ctx context.Context) *StorageServiceRPCServerPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service Rpc server post params +func (o *StorageServiceRPCServerPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service Rpc server post params +func (o *StorageServiceRPCServerPostParams) WithHTTPClient(client *http.Client) *StorageServiceRPCServerPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service Rpc server post params +func (o *StorageServiceRPCServerPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceRPCServerPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_post_responses.go new file mode 100644 index 0000000000..fe01555e69 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_rpc_server_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceRPCServerPostReader is a Reader for the StorageServiceRPCServerPost structure. +type StorageServiceRPCServerPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceRPCServerPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceRPCServerPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceRPCServerPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceRPCServerPostOK creates a StorageServiceRPCServerPostOK with default headers values +func NewStorageServiceRPCServerPostOK() *StorageServiceRPCServerPostOK { + return &StorageServiceRPCServerPostOK{} +} + +/* +StorageServiceRPCServerPostOK handles this case with default header values. + +Success +*/ +type StorageServiceRPCServerPostOK struct { +} + +func (o *StorageServiceRPCServerPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceRPCServerPostDefault creates a StorageServiceRPCServerPostDefault with default headers values +func NewStorageServiceRPCServerPostDefault(code int) *StorageServiceRPCServerPostDefault { + return &StorageServiceRPCServerPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceRPCServerPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceRPCServerPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service Rpc server post default response +func (o *StorageServiceRPCServerPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceRPCServerPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceRPCServerPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceRPCServerPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_sample_key_range_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_sample_key_range_get_parameters.go new file mode 100644 index 0000000000..2f5f5557f4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_sample_key_range_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceSampleKeyRangeGetParams creates a new StorageServiceSampleKeyRangeGetParams object +// with the default values initialized. +func NewStorageServiceSampleKeyRangeGetParams() *StorageServiceSampleKeyRangeGetParams { + + return &StorageServiceSampleKeyRangeGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceSampleKeyRangeGetParamsWithTimeout creates a new StorageServiceSampleKeyRangeGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceSampleKeyRangeGetParamsWithTimeout(timeout time.Duration) *StorageServiceSampleKeyRangeGetParams { + + return &StorageServiceSampleKeyRangeGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceSampleKeyRangeGetParamsWithContext creates a new StorageServiceSampleKeyRangeGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceSampleKeyRangeGetParamsWithContext(ctx context.Context) *StorageServiceSampleKeyRangeGetParams { + + return &StorageServiceSampleKeyRangeGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceSampleKeyRangeGetParamsWithHTTPClient creates a new StorageServiceSampleKeyRangeGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceSampleKeyRangeGetParamsWithHTTPClient(client *http.Client) *StorageServiceSampleKeyRangeGetParams { + + return &StorageServiceSampleKeyRangeGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceSampleKeyRangeGetParams contains all the parameters to send to the API endpoint +for the storage service sample key range get operation typically these are written to a http.Request +*/ +type StorageServiceSampleKeyRangeGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service sample key range get params +func (o *StorageServiceSampleKeyRangeGetParams) WithTimeout(timeout time.Duration) *StorageServiceSampleKeyRangeGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service sample key range get params +func (o *StorageServiceSampleKeyRangeGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service sample key range get params +func (o *StorageServiceSampleKeyRangeGetParams) WithContext(ctx context.Context) *StorageServiceSampleKeyRangeGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service sample key range get params +func (o *StorageServiceSampleKeyRangeGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service sample key range get params +func (o *StorageServiceSampleKeyRangeGetParams) WithHTTPClient(client *http.Client) *StorageServiceSampleKeyRangeGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service sample key range get params +func (o *StorageServiceSampleKeyRangeGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceSampleKeyRangeGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_sample_key_range_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_sample_key_range_get_responses.go new file mode 100644 index 0000000000..3da0c7914f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_sample_key_range_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceSampleKeyRangeGetReader is a Reader for the StorageServiceSampleKeyRangeGet structure. +type StorageServiceSampleKeyRangeGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceSampleKeyRangeGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceSampleKeyRangeGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceSampleKeyRangeGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceSampleKeyRangeGetOK creates a StorageServiceSampleKeyRangeGetOK with default headers values +func NewStorageServiceSampleKeyRangeGetOK() *StorageServiceSampleKeyRangeGetOK { + return &StorageServiceSampleKeyRangeGetOK{} +} + +/* +StorageServiceSampleKeyRangeGetOK handles this case with default header values. + +Success +*/ +type StorageServiceSampleKeyRangeGetOK struct { + Payload []string +} + +func (o *StorageServiceSampleKeyRangeGetOK) GetPayload() []string { + return o.Payload +} + +func (o *StorageServiceSampleKeyRangeGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceSampleKeyRangeGetDefault creates a StorageServiceSampleKeyRangeGetDefault with default headers values +func NewStorageServiceSampleKeyRangeGetDefault(code int) *StorageServiceSampleKeyRangeGetDefault { + return &StorageServiceSampleKeyRangeGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceSampleKeyRangeGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceSampleKeyRangeGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service sample key range get default response +func (o *StorageServiceSampleKeyRangeGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceSampleKeyRangeGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceSampleKeyRangeGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceSampleKeyRangeGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_saved_caches_location_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_saved_caches_location_get_parameters.go new file mode 100644 index 0000000000..f216a226aa --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_saved_caches_location_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceSavedCachesLocationGetParams creates a new StorageServiceSavedCachesLocationGetParams object +// with the default values initialized. +func NewStorageServiceSavedCachesLocationGetParams() *StorageServiceSavedCachesLocationGetParams { + + return &StorageServiceSavedCachesLocationGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceSavedCachesLocationGetParamsWithTimeout creates a new StorageServiceSavedCachesLocationGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceSavedCachesLocationGetParamsWithTimeout(timeout time.Duration) *StorageServiceSavedCachesLocationGetParams { + + return &StorageServiceSavedCachesLocationGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceSavedCachesLocationGetParamsWithContext creates a new StorageServiceSavedCachesLocationGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceSavedCachesLocationGetParamsWithContext(ctx context.Context) *StorageServiceSavedCachesLocationGetParams { + + return &StorageServiceSavedCachesLocationGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceSavedCachesLocationGetParamsWithHTTPClient creates a new StorageServiceSavedCachesLocationGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceSavedCachesLocationGetParamsWithHTTPClient(client *http.Client) *StorageServiceSavedCachesLocationGetParams { + + return &StorageServiceSavedCachesLocationGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceSavedCachesLocationGetParams contains all the parameters to send to the API endpoint +for the storage service saved caches location get operation typically these are written to a http.Request +*/ +type StorageServiceSavedCachesLocationGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service saved caches location get params +func (o *StorageServiceSavedCachesLocationGetParams) WithTimeout(timeout time.Duration) *StorageServiceSavedCachesLocationGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service saved caches location get params +func (o *StorageServiceSavedCachesLocationGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service saved caches location get params +func (o *StorageServiceSavedCachesLocationGetParams) WithContext(ctx context.Context) *StorageServiceSavedCachesLocationGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service saved caches location get params +func (o *StorageServiceSavedCachesLocationGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service saved caches location get params +func (o *StorageServiceSavedCachesLocationGetParams) WithHTTPClient(client *http.Client) *StorageServiceSavedCachesLocationGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service saved caches location get params +func (o *StorageServiceSavedCachesLocationGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceSavedCachesLocationGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_saved_caches_location_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_saved_caches_location_get_responses.go new file mode 100644 index 0000000000..f9d56ad2d7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_saved_caches_location_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceSavedCachesLocationGetReader is a Reader for the StorageServiceSavedCachesLocationGet structure. +type StorageServiceSavedCachesLocationGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceSavedCachesLocationGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceSavedCachesLocationGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceSavedCachesLocationGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceSavedCachesLocationGetOK creates a StorageServiceSavedCachesLocationGetOK with default headers values +func NewStorageServiceSavedCachesLocationGetOK() *StorageServiceSavedCachesLocationGetOK { + return &StorageServiceSavedCachesLocationGetOK{} +} + +/* +StorageServiceSavedCachesLocationGetOK handles this case with default header values. + +Success +*/ +type StorageServiceSavedCachesLocationGetOK struct { + Payload string +} + +func (o *StorageServiceSavedCachesLocationGetOK) GetPayload() string { + return o.Payload +} + +func (o *StorageServiceSavedCachesLocationGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceSavedCachesLocationGetDefault creates a StorageServiceSavedCachesLocationGetDefault with default headers values +func NewStorageServiceSavedCachesLocationGetDefault(code int) *StorageServiceSavedCachesLocationGetDefault { + return &StorageServiceSavedCachesLocationGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceSavedCachesLocationGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceSavedCachesLocationGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service saved caches location get default response +func (o *StorageServiceSavedCachesLocationGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceSavedCachesLocationGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceSavedCachesLocationGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceSavedCachesLocationGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_schema_version_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_schema_version_get_parameters.go new file mode 100644 index 0000000000..4050f48863 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_schema_version_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceSchemaVersionGetParams creates a new StorageServiceSchemaVersionGetParams object +// with the default values initialized. +func NewStorageServiceSchemaVersionGetParams() *StorageServiceSchemaVersionGetParams { + + return &StorageServiceSchemaVersionGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceSchemaVersionGetParamsWithTimeout creates a new StorageServiceSchemaVersionGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceSchemaVersionGetParamsWithTimeout(timeout time.Duration) *StorageServiceSchemaVersionGetParams { + + return &StorageServiceSchemaVersionGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceSchemaVersionGetParamsWithContext creates a new StorageServiceSchemaVersionGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceSchemaVersionGetParamsWithContext(ctx context.Context) *StorageServiceSchemaVersionGetParams { + + return &StorageServiceSchemaVersionGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceSchemaVersionGetParamsWithHTTPClient creates a new StorageServiceSchemaVersionGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceSchemaVersionGetParamsWithHTTPClient(client *http.Client) *StorageServiceSchemaVersionGetParams { + + return &StorageServiceSchemaVersionGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceSchemaVersionGetParams contains all the parameters to send to the API endpoint +for the storage service schema version get operation typically these are written to a http.Request +*/ +type StorageServiceSchemaVersionGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service schema version get params +func (o *StorageServiceSchemaVersionGetParams) WithTimeout(timeout time.Duration) *StorageServiceSchemaVersionGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service schema version get params +func (o *StorageServiceSchemaVersionGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service schema version get params +func (o *StorageServiceSchemaVersionGetParams) WithContext(ctx context.Context) *StorageServiceSchemaVersionGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service schema version get params +func (o *StorageServiceSchemaVersionGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service schema version get params +func (o *StorageServiceSchemaVersionGetParams) WithHTTPClient(client *http.Client) *StorageServiceSchemaVersionGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service schema version get params +func (o *StorageServiceSchemaVersionGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceSchemaVersionGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_schema_version_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_schema_version_get_responses.go new file mode 100644 index 0000000000..f7c12a6634 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_schema_version_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceSchemaVersionGetReader is a Reader for the StorageServiceSchemaVersionGet structure. +type StorageServiceSchemaVersionGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceSchemaVersionGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceSchemaVersionGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceSchemaVersionGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceSchemaVersionGetOK creates a StorageServiceSchemaVersionGetOK with default headers values +func NewStorageServiceSchemaVersionGetOK() *StorageServiceSchemaVersionGetOK { + return &StorageServiceSchemaVersionGetOK{} +} + +/* +StorageServiceSchemaVersionGetOK handles this case with default header values. + +Success +*/ +type StorageServiceSchemaVersionGetOK struct { + Payload string +} + +func (o *StorageServiceSchemaVersionGetOK) GetPayload() string { + return o.Payload +} + +func (o *StorageServiceSchemaVersionGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceSchemaVersionGetDefault creates a StorageServiceSchemaVersionGetDefault with default headers values +func NewStorageServiceSchemaVersionGetDefault(code int) *StorageServiceSchemaVersionGetDefault { + return &StorageServiceSchemaVersionGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceSchemaVersionGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceSchemaVersionGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service schema version get default response +func (o *StorageServiceSchemaVersionGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceSchemaVersionGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceSchemaVersionGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceSchemaVersionGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_scylla_release_version_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_scylla_release_version_get_parameters.go new file mode 100644 index 0000000000..4298278f55 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_scylla_release_version_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceScyllaReleaseVersionGetParams creates a new StorageServiceScyllaReleaseVersionGetParams object +// with the default values initialized. +func NewStorageServiceScyllaReleaseVersionGetParams() *StorageServiceScyllaReleaseVersionGetParams { + + return &StorageServiceScyllaReleaseVersionGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceScyllaReleaseVersionGetParamsWithTimeout creates a new StorageServiceScyllaReleaseVersionGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceScyllaReleaseVersionGetParamsWithTimeout(timeout time.Duration) *StorageServiceScyllaReleaseVersionGetParams { + + return &StorageServiceScyllaReleaseVersionGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceScyllaReleaseVersionGetParamsWithContext creates a new StorageServiceScyllaReleaseVersionGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceScyllaReleaseVersionGetParamsWithContext(ctx context.Context) *StorageServiceScyllaReleaseVersionGetParams { + + return &StorageServiceScyllaReleaseVersionGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceScyllaReleaseVersionGetParamsWithHTTPClient creates a new StorageServiceScyllaReleaseVersionGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceScyllaReleaseVersionGetParamsWithHTTPClient(client *http.Client) *StorageServiceScyllaReleaseVersionGetParams { + + return &StorageServiceScyllaReleaseVersionGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceScyllaReleaseVersionGetParams contains all the parameters to send to the API endpoint +for the storage service scylla release version get operation typically these are written to a http.Request +*/ +type StorageServiceScyllaReleaseVersionGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service scylla release version get params +func (o *StorageServiceScyllaReleaseVersionGetParams) WithTimeout(timeout time.Duration) *StorageServiceScyllaReleaseVersionGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service scylla release version get params +func (o *StorageServiceScyllaReleaseVersionGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service scylla release version get params +func (o *StorageServiceScyllaReleaseVersionGetParams) WithContext(ctx context.Context) *StorageServiceScyllaReleaseVersionGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service scylla release version get params +func (o *StorageServiceScyllaReleaseVersionGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service scylla release version get params +func (o *StorageServiceScyllaReleaseVersionGetParams) WithHTTPClient(client *http.Client) *StorageServiceScyllaReleaseVersionGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service scylla release version get params +func (o *StorageServiceScyllaReleaseVersionGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceScyllaReleaseVersionGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_scylla_release_version_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_scylla_release_version_get_responses.go new file mode 100644 index 0000000000..6ebb9a2450 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_scylla_release_version_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceScyllaReleaseVersionGetReader is a Reader for the StorageServiceScyllaReleaseVersionGet structure. +type StorageServiceScyllaReleaseVersionGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceScyllaReleaseVersionGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceScyllaReleaseVersionGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceScyllaReleaseVersionGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceScyllaReleaseVersionGetOK creates a StorageServiceScyllaReleaseVersionGetOK with default headers values +func NewStorageServiceScyllaReleaseVersionGetOK() *StorageServiceScyllaReleaseVersionGetOK { + return &StorageServiceScyllaReleaseVersionGetOK{} +} + +/* +StorageServiceScyllaReleaseVersionGetOK handles this case with default header values. + +Success +*/ +type StorageServiceScyllaReleaseVersionGetOK struct { + Payload string +} + +func (o *StorageServiceScyllaReleaseVersionGetOK) GetPayload() string { + return o.Payload +} + +func (o *StorageServiceScyllaReleaseVersionGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceScyllaReleaseVersionGetDefault creates a StorageServiceScyllaReleaseVersionGetDefault with default headers values +func NewStorageServiceScyllaReleaseVersionGetDefault(code int) *StorageServiceScyllaReleaseVersionGetDefault { + return &StorageServiceScyllaReleaseVersionGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceScyllaReleaseVersionGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceScyllaReleaseVersionGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service scylla release version get default response +func (o *StorageServiceScyllaReleaseVersionGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceScyllaReleaseVersionGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceScyllaReleaseVersionGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceScyllaReleaseVersionGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_slow_query_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_slow_query_get_parameters.go new file mode 100644 index 0000000000..5809eac4b0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_slow_query_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceSlowQueryGetParams creates a new StorageServiceSlowQueryGetParams object +// with the default values initialized. +func NewStorageServiceSlowQueryGetParams() *StorageServiceSlowQueryGetParams { + + return &StorageServiceSlowQueryGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceSlowQueryGetParamsWithTimeout creates a new StorageServiceSlowQueryGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceSlowQueryGetParamsWithTimeout(timeout time.Duration) *StorageServiceSlowQueryGetParams { + + return &StorageServiceSlowQueryGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceSlowQueryGetParamsWithContext creates a new StorageServiceSlowQueryGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceSlowQueryGetParamsWithContext(ctx context.Context) *StorageServiceSlowQueryGetParams { + + return &StorageServiceSlowQueryGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceSlowQueryGetParamsWithHTTPClient creates a new StorageServiceSlowQueryGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceSlowQueryGetParamsWithHTTPClient(client *http.Client) *StorageServiceSlowQueryGetParams { + + return &StorageServiceSlowQueryGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceSlowQueryGetParams contains all the parameters to send to the API endpoint +for the storage service slow query get operation typically these are written to a http.Request +*/ +type StorageServiceSlowQueryGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service slow query get params +func (o *StorageServiceSlowQueryGetParams) WithTimeout(timeout time.Duration) *StorageServiceSlowQueryGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service slow query get params +func (o *StorageServiceSlowQueryGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service slow query get params +func (o *StorageServiceSlowQueryGetParams) WithContext(ctx context.Context) *StorageServiceSlowQueryGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service slow query get params +func (o *StorageServiceSlowQueryGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service slow query get params +func (o *StorageServiceSlowQueryGetParams) WithHTTPClient(client *http.Client) *StorageServiceSlowQueryGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service slow query get params +func (o *StorageServiceSlowQueryGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceSlowQueryGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_slow_query_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_slow_query_get_responses.go new file mode 100644 index 0000000000..d63ee9057f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_slow_query_get_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceSlowQueryGetReader is a Reader for the StorageServiceSlowQueryGet structure. +type StorageServiceSlowQueryGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceSlowQueryGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceSlowQueryGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceSlowQueryGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceSlowQueryGetOK creates a StorageServiceSlowQueryGetOK with default headers values +func NewStorageServiceSlowQueryGetOK() *StorageServiceSlowQueryGetOK { + return &StorageServiceSlowQueryGetOK{} +} + +/* +StorageServiceSlowQueryGetOK handles this case with default header values. + +Success +*/ +type StorageServiceSlowQueryGetOK struct { + Payload *models.SlowQueryInfo +} + +func (o *StorageServiceSlowQueryGetOK) GetPayload() *models.SlowQueryInfo { + return o.Payload +} + +func (o *StorageServiceSlowQueryGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SlowQueryInfo) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceSlowQueryGetDefault creates a StorageServiceSlowQueryGetDefault with default headers values +func NewStorageServiceSlowQueryGetDefault(code int) *StorageServiceSlowQueryGetDefault { + return &StorageServiceSlowQueryGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceSlowQueryGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceSlowQueryGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service slow query get default response +func (o *StorageServiceSlowQueryGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceSlowQueryGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceSlowQueryGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceSlowQueryGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_slow_query_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_slow_query_post_parameters.go new file mode 100644 index 0000000000..48c9347ceb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_slow_query_post_parameters.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceSlowQueryPostParams creates a new StorageServiceSlowQueryPostParams object +// with the default values initialized. +func NewStorageServiceSlowQueryPostParams() *StorageServiceSlowQueryPostParams { + var () + return &StorageServiceSlowQueryPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceSlowQueryPostParamsWithTimeout creates a new StorageServiceSlowQueryPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceSlowQueryPostParamsWithTimeout(timeout time.Duration) *StorageServiceSlowQueryPostParams { + var () + return &StorageServiceSlowQueryPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceSlowQueryPostParamsWithContext creates a new StorageServiceSlowQueryPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceSlowQueryPostParamsWithContext(ctx context.Context) *StorageServiceSlowQueryPostParams { + var () + return &StorageServiceSlowQueryPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceSlowQueryPostParamsWithHTTPClient creates a new StorageServiceSlowQueryPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceSlowQueryPostParamsWithHTTPClient(client *http.Client) *StorageServiceSlowQueryPostParams { + var () + return &StorageServiceSlowQueryPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceSlowQueryPostParams contains all the parameters to send to the API endpoint +for the storage service slow query post operation typically these are written to a http.Request +*/ +type StorageServiceSlowQueryPostParams struct { + + /*Enable + set it to true to enable, anything else to disable + + */ + Enable *bool + /*Threshold + Slow query record threshold in microseconds + + */ + Threshold *string + /*TTL + TTL in seconds + + */ + TTL *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service slow query post params +func (o *StorageServiceSlowQueryPostParams) WithTimeout(timeout time.Duration) *StorageServiceSlowQueryPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service slow query post params +func (o *StorageServiceSlowQueryPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service slow query post params +func (o *StorageServiceSlowQueryPostParams) WithContext(ctx context.Context) *StorageServiceSlowQueryPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service slow query post params +func (o *StorageServiceSlowQueryPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service slow query post params +func (o *StorageServiceSlowQueryPostParams) WithHTTPClient(client *http.Client) *StorageServiceSlowQueryPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service slow query post params +func (o *StorageServiceSlowQueryPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEnable adds the enable to the storage service slow query post params +func (o *StorageServiceSlowQueryPostParams) WithEnable(enable *bool) *StorageServiceSlowQueryPostParams { + o.SetEnable(enable) + return o +} + +// SetEnable adds the enable to the storage service slow query post params +func (o *StorageServiceSlowQueryPostParams) SetEnable(enable *bool) { + o.Enable = enable +} + +// WithThreshold adds the threshold to the storage service slow query post params +func (o *StorageServiceSlowQueryPostParams) WithThreshold(threshold *string) *StorageServiceSlowQueryPostParams { + o.SetThreshold(threshold) + return o +} + +// SetThreshold adds the threshold to the storage service slow query post params +func (o *StorageServiceSlowQueryPostParams) SetThreshold(threshold *string) { + o.Threshold = threshold +} + +// WithTTL adds the ttl to the storage service slow query post params +func (o *StorageServiceSlowQueryPostParams) WithTTL(ttl *string) *StorageServiceSlowQueryPostParams { + o.SetTTL(ttl) + return o +} + +// SetTTL adds the ttl to the storage service slow query post params +func (o *StorageServiceSlowQueryPostParams) SetTTL(ttl *string) { + o.TTL = ttl +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceSlowQueryPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Enable != nil { + + // query param enable + var qrEnable bool + if o.Enable != nil { + qrEnable = *o.Enable + } + qEnable := swag.FormatBool(qrEnable) + if qEnable != "" { + if err := r.SetQueryParam("enable", qEnable); err != nil { + return err + } + } + + } + + if o.Threshold != nil { + + // query param threshold + var qrThreshold string + if o.Threshold != nil { + qrThreshold = *o.Threshold + } + qThreshold := qrThreshold + if qThreshold != "" { + if err := r.SetQueryParam("threshold", qThreshold); err != nil { + return err + } + } + + } + + if o.TTL != nil { + + // query param ttl + var qrTTL string + if o.TTL != nil { + qrTTL = *o.TTL + } + qTTL := qrTTL + if qTTL != "" { + if err := r.SetQueryParam("ttl", qTTL); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_slow_query_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_slow_query_post_responses.go new file mode 100644 index 0000000000..1fd31e358c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_slow_query_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceSlowQueryPostReader is a Reader for the StorageServiceSlowQueryPost structure. +type StorageServiceSlowQueryPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceSlowQueryPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceSlowQueryPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceSlowQueryPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceSlowQueryPostOK creates a StorageServiceSlowQueryPostOK with default headers values +func NewStorageServiceSlowQueryPostOK() *StorageServiceSlowQueryPostOK { + return &StorageServiceSlowQueryPostOK{} +} + +/* +StorageServiceSlowQueryPostOK handles this case with default header values. + +Success +*/ +type StorageServiceSlowQueryPostOK struct { +} + +func (o *StorageServiceSlowQueryPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceSlowQueryPostDefault creates a StorageServiceSlowQueryPostDefault with default headers values +func NewStorageServiceSlowQueryPostDefault(code int) *StorageServiceSlowQueryPostDefault { + return &StorageServiceSlowQueryPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceSlowQueryPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceSlowQueryPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service slow query post default response +func (o *StorageServiceSlowQueryPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceSlowQueryPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceSlowQueryPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceSlowQueryPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_delete_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_delete_parameters.go new file mode 100644 index 0000000000..2d442506b5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_delete_parameters.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceSnapshotsDeleteParams creates a new StorageServiceSnapshotsDeleteParams object +// with the default values initialized. +func NewStorageServiceSnapshotsDeleteParams() *StorageServiceSnapshotsDeleteParams { + var () + return &StorageServiceSnapshotsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceSnapshotsDeleteParamsWithTimeout creates a new StorageServiceSnapshotsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceSnapshotsDeleteParamsWithTimeout(timeout time.Duration) *StorageServiceSnapshotsDeleteParams { + var () + return &StorageServiceSnapshotsDeleteParams{ + + timeout: timeout, + } +} + +// NewStorageServiceSnapshotsDeleteParamsWithContext creates a new StorageServiceSnapshotsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceSnapshotsDeleteParamsWithContext(ctx context.Context) *StorageServiceSnapshotsDeleteParams { + var () + return &StorageServiceSnapshotsDeleteParams{ + + Context: ctx, + } +} + +// NewStorageServiceSnapshotsDeleteParamsWithHTTPClient creates a new StorageServiceSnapshotsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceSnapshotsDeleteParamsWithHTTPClient(client *http.Client) *StorageServiceSnapshotsDeleteParams { + var () + return &StorageServiceSnapshotsDeleteParams{ + HTTPClient: client, + } +} + +/* +StorageServiceSnapshotsDeleteParams contains all the parameters to send to the API endpoint +for the storage service snapshots delete operation typically these are written to a http.Request +*/ +type StorageServiceSnapshotsDeleteParams struct { + + /*Cf + an optional table name that its snapshot will be deleted + + */ + Cf *string + /*Kn + Comma seperated keyspaces name to snapshot + + */ + Kn *string + /*Tag + the tag given to the snapshot + + */ + Tag *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service snapshots delete params +func (o *StorageServiceSnapshotsDeleteParams) WithTimeout(timeout time.Duration) *StorageServiceSnapshotsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service snapshots delete params +func (o *StorageServiceSnapshotsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service snapshots delete params +func (o *StorageServiceSnapshotsDeleteParams) WithContext(ctx context.Context) *StorageServiceSnapshotsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service snapshots delete params +func (o *StorageServiceSnapshotsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service snapshots delete params +func (o *StorageServiceSnapshotsDeleteParams) WithHTTPClient(client *http.Client) *StorageServiceSnapshotsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service snapshots delete params +func (o *StorageServiceSnapshotsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCf adds the cf to the storage service snapshots delete params +func (o *StorageServiceSnapshotsDeleteParams) WithCf(cf *string) *StorageServiceSnapshotsDeleteParams { + o.SetCf(cf) + return o +} + +// SetCf adds the cf to the storage service snapshots delete params +func (o *StorageServiceSnapshotsDeleteParams) SetCf(cf *string) { + o.Cf = cf +} + +// WithKn adds the kn to the storage service snapshots delete params +func (o *StorageServiceSnapshotsDeleteParams) WithKn(kn *string) *StorageServiceSnapshotsDeleteParams { + o.SetKn(kn) + return o +} + +// SetKn adds the kn to the storage service snapshots delete params +func (o *StorageServiceSnapshotsDeleteParams) SetKn(kn *string) { + o.Kn = kn +} + +// WithTag adds the tag to the storage service snapshots delete params +func (o *StorageServiceSnapshotsDeleteParams) WithTag(tag *string) *StorageServiceSnapshotsDeleteParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the storage service snapshots delete params +func (o *StorageServiceSnapshotsDeleteParams) SetTag(tag *string) { + o.Tag = tag +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceSnapshotsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cf != nil { + + // query param cf + var qrCf string + if o.Cf != nil { + qrCf = *o.Cf + } + qCf := qrCf + if qCf != "" { + if err := r.SetQueryParam("cf", qCf); err != nil { + return err + } + } + + } + + if o.Kn != nil { + + // query param kn + var qrKn string + if o.Kn != nil { + qrKn = *o.Kn + } + qKn := qrKn + if qKn != "" { + if err := r.SetQueryParam("kn", qKn); err != nil { + return err + } + } + + } + + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_delete_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_delete_responses.go new file mode 100644 index 0000000000..1423834d18 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_delete_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceSnapshotsDeleteReader is a Reader for the StorageServiceSnapshotsDelete structure. +type StorageServiceSnapshotsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceSnapshotsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceSnapshotsDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceSnapshotsDeleteDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceSnapshotsDeleteOK creates a StorageServiceSnapshotsDeleteOK with default headers values +func NewStorageServiceSnapshotsDeleteOK() *StorageServiceSnapshotsDeleteOK { + return &StorageServiceSnapshotsDeleteOK{} +} + +/* +StorageServiceSnapshotsDeleteOK handles this case with default header values. + +Success +*/ +type StorageServiceSnapshotsDeleteOK struct { +} + +func (o *StorageServiceSnapshotsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceSnapshotsDeleteDefault creates a StorageServiceSnapshotsDeleteDefault with default headers values +func NewStorageServiceSnapshotsDeleteDefault(code int) *StorageServiceSnapshotsDeleteDefault { + return &StorageServiceSnapshotsDeleteDefault{ + _statusCode: code, + } +} + +/* +StorageServiceSnapshotsDeleteDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceSnapshotsDeleteDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service snapshots delete default response +func (o *StorageServiceSnapshotsDeleteDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceSnapshotsDeleteDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceSnapshotsDeleteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceSnapshotsDeleteDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_get_parameters.go new file mode 100644 index 0000000000..0b826f2db9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceSnapshotsGetParams creates a new StorageServiceSnapshotsGetParams object +// with the default values initialized. +func NewStorageServiceSnapshotsGetParams() *StorageServiceSnapshotsGetParams { + + return &StorageServiceSnapshotsGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceSnapshotsGetParamsWithTimeout creates a new StorageServiceSnapshotsGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceSnapshotsGetParamsWithTimeout(timeout time.Duration) *StorageServiceSnapshotsGetParams { + + return &StorageServiceSnapshotsGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceSnapshotsGetParamsWithContext creates a new StorageServiceSnapshotsGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceSnapshotsGetParamsWithContext(ctx context.Context) *StorageServiceSnapshotsGetParams { + + return &StorageServiceSnapshotsGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceSnapshotsGetParamsWithHTTPClient creates a new StorageServiceSnapshotsGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceSnapshotsGetParamsWithHTTPClient(client *http.Client) *StorageServiceSnapshotsGetParams { + + return &StorageServiceSnapshotsGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceSnapshotsGetParams contains all the parameters to send to the API endpoint +for the storage service snapshots get operation typically these are written to a http.Request +*/ +type StorageServiceSnapshotsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service snapshots get params +func (o *StorageServiceSnapshotsGetParams) WithTimeout(timeout time.Duration) *StorageServiceSnapshotsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service snapshots get params +func (o *StorageServiceSnapshotsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service snapshots get params +func (o *StorageServiceSnapshotsGetParams) WithContext(ctx context.Context) *StorageServiceSnapshotsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service snapshots get params +func (o *StorageServiceSnapshotsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service snapshots get params +func (o *StorageServiceSnapshotsGetParams) WithHTTPClient(client *http.Client) *StorageServiceSnapshotsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service snapshots get params +func (o *StorageServiceSnapshotsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceSnapshotsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_get_responses.go new file mode 100644 index 0000000000..cbd784d1c1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceSnapshotsGetReader is a Reader for the StorageServiceSnapshotsGet structure. +type StorageServiceSnapshotsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceSnapshotsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceSnapshotsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceSnapshotsGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceSnapshotsGetOK creates a StorageServiceSnapshotsGetOK with default headers values +func NewStorageServiceSnapshotsGetOK() *StorageServiceSnapshotsGetOK { + return &StorageServiceSnapshotsGetOK{} +} + +/* +StorageServiceSnapshotsGetOK handles this case with default header values. + +Success +*/ +type StorageServiceSnapshotsGetOK struct { + Payload []*models.Snapshots +} + +func (o *StorageServiceSnapshotsGetOK) GetPayload() []*models.Snapshots { + return o.Payload +} + +func (o *StorageServiceSnapshotsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceSnapshotsGetDefault creates a StorageServiceSnapshotsGetDefault with default headers values +func NewStorageServiceSnapshotsGetDefault(code int) *StorageServiceSnapshotsGetDefault { + return &StorageServiceSnapshotsGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceSnapshotsGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceSnapshotsGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service snapshots get default response +func (o *StorageServiceSnapshotsGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceSnapshotsGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceSnapshotsGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceSnapshotsGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_post_parameters.go new file mode 100644 index 0000000000..169a3a9ba1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_post_parameters.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceSnapshotsPostParams creates a new StorageServiceSnapshotsPostParams object +// with the default values initialized. +func NewStorageServiceSnapshotsPostParams() *StorageServiceSnapshotsPostParams { + var () + return &StorageServiceSnapshotsPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceSnapshotsPostParamsWithTimeout creates a new StorageServiceSnapshotsPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceSnapshotsPostParamsWithTimeout(timeout time.Duration) *StorageServiceSnapshotsPostParams { + var () + return &StorageServiceSnapshotsPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceSnapshotsPostParamsWithContext creates a new StorageServiceSnapshotsPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceSnapshotsPostParamsWithContext(ctx context.Context) *StorageServiceSnapshotsPostParams { + var () + return &StorageServiceSnapshotsPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceSnapshotsPostParamsWithHTTPClient creates a new StorageServiceSnapshotsPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceSnapshotsPostParamsWithHTTPClient(client *http.Client) *StorageServiceSnapshotsPostParams { + var () + return &StorageServiceSnapshotsPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceSnapshotsPostParams contains all the parameters to send to the API endpoint +for the storage service snapshots post operation typically these are written to a http.Request +*/ +type StorageServiceSnapshotsPostParams struct { + + /*Cf + the column family to snapshot + + */ + Cf *string + /*Kn + Comma seperated keyspaces name to snapshot + + */ + Kn *string + /*Tag + the tag given to the snapshot + + */ + Tag *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service snapshots post params +func (o *StorageServiceSnapshotsPostParams) WithTimeout(timeout time.Duration) *StorageServiceSnapshotsPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service snapshots post params +func (o *StorageServiceSnapshotsPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service snapshots post params +func (o *StorageServiceSnapshotsPostParams) WithContext(ctx context.Context) *StorageServiceSnapshotsPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service snapshots post params +func (o *StorageServiceSnapshotsPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service snapshots post params +func (o *StorageServiceSnapshotsPostParams) WithHTTPClient(client *http.Client) *StorageServiceSnapshotsPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service snapshots post params +func (o *StorageServiceSnapshotsPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCf adds the cf to the storage service snapshots post params +func (o *StorageServiceSnapshotsPostParams) WithCf(cf *string) *StorageServiceSnapshotsPostParams { + o.SetCf(cf) + return o +} + +// SetCf adds the cf to the storage service snapshots post params +func (o *StorageServiceSnapshotsPostParams) SetCf(cf *string) { + o.Cf = cf +} + +// WithKn adds the kn to the storage service snapshots post params +func (o *StorageServiceSnapshotsPostParams) WithKn(kn *string) *StorageServiceSnapshotsPostParams { + o.SetKn(kn) + return o +} + +// SetKn adds the kn to the storage service snapshots post params +func (o *StorageServiceSnapshotsPostParams) SetKn(kn *string) { + o.Kn = kn +} + +// WithTag adds the tag to the storage service snapshots post params +func (o *StorageServiceSnapshotsPostParams) WithTag(tag *string) *StorageServiceSnapshotsPostParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the storage service snapshots post params +func (o *StorageServiceSnapshotsPostParams) SetTag(tag *string) { + o.Tag = tag +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceSnapshotsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cf != nil { + + // query param cf + var qrCf string + if o.Cf != nil { + qrCf = *o.Cf + } + qCf := qrCf + if qCf != "" { + if err := r.SetQueryParam("cf", qCf); err != nil { + return err + } + } + + } + + if o.Kn != nil { + + // query param kn + var qrKn string + if o.Kn != nil { + qrKn = *o.Kn + } + qKn := qrKn + if qKn != "" { + if err := r.SetQueryParam("kn", qKn); err != nil { + return err + } + } + + } + + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_post_responses.go new file mode 100644 index 0000000000..f35738ccfb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceSnapshotsPostReader is a Reader for the StorageServiceSnapshotsPost structure. +type StorageServiceSnapshotsPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceSnapshotsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceSnapshotsPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceSnapshotsPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceSnapshotsPostOK creates a StorageServiceSnapshotsPostOK with default headers values +func NewStorageServiceSnapshotsPostOK() *StorageServiceSnapshotsPostOK { + return &StorageServiceSnapshotsPostOK{} +} + +/* +StorageServiceSnapshotsPostOK handles this case with default header values. + +Success +*/ +type StorageServiceSnapshotsPostOK struct { +} + +func (o *StorageServiceSnapshotsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceSnapshotsPostDefault creates a StorageServiceSnapshotsPostDefault with default headers values +func NewStorageServiceSnapshotsPostDefault(code int) *StorageServiceSnapshotsPostDefault { + return &StorageServiceSnapshotsPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceSnapshotsPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceSnapshotsPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service snapshots post default response +func (o *StorageServiceSnapshotsPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceSnapshotsPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceSnapshotsPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceSnapshotsPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_size_true_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_size_true_get_parameters.go new file mode 100644 index 0000000000..209ba42253 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_size_true_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceSnapshotsSizeTrueGetParams creates a new StorageServiceSnapshotsSizeTrueGetParams object +// with the default values initialized. +func NewStorageServiceSnapshotsSizeTrueGetParams() *StorageServiceSnapshotsSizeTrueGetParams { + + return &StorageServiceSnapshotsSizeTrueGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceSnapshotsSizeTrueGetParamsWithTimeout creates a new StorageServiceSnapshotsSizeTrueGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceSnapshotsSizeTrueGetParamsWithTimeout(timeout time.Duration) *StorageServiceSnapshotsSizeTrueGetParams { + + return &StorageServiceSnapshotsSizeTrueGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceSnapshotsSizeTrueGetParamsWithContext creates a new StorageServiceSnapshotsSizeTrueGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceSnapshotsSizeTrueGetParamsWithContext(ctx context.Context) *StorageServiceSnapshotsSizeTrueGetParams { + + return &StorageServiceSnapshotsSizeTrueGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceSnapshotsSizeTrueGetParamsWithHTTPClient creates a new StorageServiceSnapshotsSizeTrueGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceSnapshotsSizeTrueGetParamsWithHTTPClient(client *http.Client) *StorageServiceSnapshotsSizeTrueGetParams { + + return &StorageServiceSnapshotsSizeTrueGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceSnapshotsSizeTrueGetParams contains all the parameters to send to the API endpoint +for the storage service snapshots size true get operation typically these are written to a http.Request +*/ +type StorageServiceSnapshotsSizeTrueGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service snapshots size true get params +func (o *StorageServiceSnapshotsSizeTrueGetParams) WithTimeout(timeout time.Duration) *StorageServiceSnapshotsSizeTrueGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service snapshots size true get params +func (o *StorageServiceSnapshotsSizeTrueGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service snapshots size true get params +func (o *StorageServiceSnapshotsSizeTrueGetParams) WithContext(ctx context.Context) *StorageServiceSnapshotsSizeTrueGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service snapshots size true get params +func (o *StorageServiceSnapshotsSizeTrueGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service snapshots size true get params +func (o *StorageServiceSnapshotsSizeTrueGetParams) WithHTTPClient(client *http.Client) *StorageServiceSnapshotsSizeTrueGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service snapshots size true get params +func (o *StorageServiceSnapshotsSizeTrueGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceSnapshotsSizeTrueGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_size_true_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_size_true_get_responses.go new file mode 100644 index 0000000000..4dc4063012 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_snapshots_size_true_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceSnapshotsSizeTrueGetReader is a Reader for the StorageServiceSnapshotsSizeTrueGet structure. +type StorageServiceSnapshotsSizeTrueGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceSnapshotsSizeTrueGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceSnapshotsSizeTrueGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceSnapshotsSizeTrueGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceSnapshotsSizeTrueGetOK creates a StorageServiceSnapshotsSizeTrueGetOK with default headers values +func NewStorageServiceSnapshotsSizeTrueGetOK() *StorageServiceSnapshotsSizeTrueGetOK { + return &StorageServiceSnapshotsSizeTrueGetOK{} +} + +/* +StorageServiceSnapshotsSizeTrueGetOK handles this case with default header values. + +Success +*/ +type StorageServiceSnapshotsSizeTrueGetOK struct { + Payload interface{} +} + +func (o *StorageServiceSnapshotsSizeTrueGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageServiceSnapshotsSizeTrueGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceSnapshotsSizeTrueGetDefault creates a StorageServiceSnapshotsSizeTrueGetDefault with default headers values +func NewStorageServiceSnapshotsSizeTrueGetDefault(code int) *StorageServiceSnapshotsSizeTrueGetDefault { + return &StorageServiceSnapshotsSizeTrueGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceSnapshotsSizeTrueGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceSnapshotsSizeTrueGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service snapshots size true get default response +func (o *StorageServiceSnapshotsSizeTrueGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceSnapshotsSizeTrueGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceSnapshotsSizeTrueGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceSnapshotsSizeTrueGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_sstables_by_keyspace_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_sstables_by_keyspace_post_parameters.go new file mode 100644 index 0000000000..7298674e2a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_sstables_by_keyspace_post_parameters.go @@ -0,0 +1,226 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceSstablesByKeyspacePostParams creates a new StorageServiceSstablesByKeyspacePostParams object +// with the default values initialized. +func NewStorageServiceSstablesByKeyspacePostParams() *StorageServiceSstablesByKeyspacePostParams { + var () + return &StorageServiceSstablesByKeyspacePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceSstablesByKeyspacePostParamsWithTimeout creates a new StorageServiceSstablesByKeyspacePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceSstablesByKeyspacePostParamsWithTimeout(timeout time.Duration) *StorageServiceSstablesByKeyspacePostParams { + var () + return &StorageServiceSstablesByKeyspacePostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceSstablesByKeyspacePostParamsWithContext creates a new StorageServiceSstablesByKeyspacePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceSstablesByKeyspacePostParamsWithContext(ctx context.Context) *StorageServiceSstablesByKeyspacePostParams { + var () + return &StorageServiceSstablesByKeyspacePostParams{ + + Context: ctx, + } +} + +// NewStorageServiceSstablesByKeyspacePostParamsWithHTTPClient creates a new StorageServiceSstablesByKeyspacePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceSstablesByKeyspacePostParamsWithHTTPClient(client *http.Client) *StorageServiceSstablesByKeyspacePostParams { + var () + return &StorageServiceSstablesByKeyspacePostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceSstablesByKeyspacePostParams contains all the parameters to send to the API endpoint +for the storage service sstables by keyspace post operation typically these are written to a http.Request +*/ +type StorageServiceSstablesByKeyspacePostParams struct { + + /*Cf + Column family name + + */ + Cf string + /*Keyspace + The keyspace + + */ + Keyspace string + /*LoadAndStream + Load the sstables and stream to all replica nodes that owns the data + + */ + LoadAndStream *bool + /*PrimaryReplicaOnly + Load the sstables and stream to primary replica node that owns the data. Repair is needed after the load and stream process + + */ + PrimaryReplicaOnly *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service sstables by keyspace post params +func (o *StorageServiceSstablesByKeyspacePostParams) WithTimeout(timeout time.Duration) *StorageServiceSstablesByKeyspacePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service sstables by keyspace post params +func (o *StorageServiceSstablesByKeyspacePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service sstables by keyspace post params +func (o *StorageServiceSstablesByKeyspacePostParams) WithContext(ctx context.Context) *StorageServiceSstablesByKeyspacePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service sstables by keyspace post params +func (o *StorageServiceSstablesByKeyspacePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service sstables by keyspace post params +func (o *StorageServiceSstablesByKeyspacePostParams) WithHTTPClient(client *http.Client) *StorageServiceSstablesByKeyspacePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service sstables by keyspace post params +func (o *StorageServiceSstablesByKeyspacePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCf adds the cf to the storage service sstables by keyspace post params +func (o *StorageServiceSstablesByKeyspacePostParams) WithCf(cf string) *StorageServiceSstablesByKeyspacePostParams { + o.SetCf(cf) + return o +} + +// SetCf adds the cf to the storage service sstables by keyspace post params +func (o *StorageServiceSstablesByKeyspacePostParams) SetCf(cf string) { + o.Cf = cf +} + +// WithKeyspace adds the keyspace to the storage service sstables by keyspace post params +func (o *StorageServiceSstablesByKeyspacePostParams) WithKeyspace(keyspace string) *StorageServiceSstablesByKeyspacePostParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service sstables by keyspace post params +func (o *StorageServiceSstablesByKeyspacePostParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WithLoadAndStream adds the loadAndStream to the storage service sstables by keyspace post params +func (o *StorageServiceSstablesByKeyspacePostParams) WithLoadAndStream(loadAndStream *bool) *StorageServiceSstablesByKeyspacePostParams { + o.SetLoadAndStream(loadAndStream) + return o +} + +// SetLoadAndStream adds the loadAndStream to the storage service sstables by keyspace post params +func (o *StorageServiceSstablesByKeyspacePostParams) SetLoadAndStream(loadAndStream *bool) { + o.LoadAndStream = loadAndStream +} + +// WithPrimaryReplicaOnly adds the primaryReplicaOnly to the storage service sstables by keyspace post params +func (o *StorageServiceSstablesByKeyspacePostParams) WithPrimaryReplicaOnly(primaryReplicaOnly *bool) *StorageServiceSstablesByKeyspacePostParams { + o.SetPrimaryReplicaOnly(primaryReplicaOnly) + return o +} + +// SetPrimaryReplicaOnly adds the primaryReplicaOnly to the storage service sstables by keyspace post params +func (o *StorageServiceSstablesByKeyspacePostParams) SetPrimaryReplicaOnly(primaryReplicaOnly *bool) { + o.PrimaryReplicaOnly = primaryReplicaOnly +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceSstablesByKeyspacePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param cf + qrCf := o.Cf + qCf := qrCf + if qCf != "" { + if err := r.SetQueryParam("cf", qCf); err != nil { + return err + } + } + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if o.LoadAndStream != nil { + + // query param load_and_stream + var qrLoadAndStream bool + if o.LoadAndStream != nil { + qrLoadAndStream = *o.LoadAndStream + } + qLoadAndStream := swag.FormatBool(qrLoadAndStream) + if qLoadAndStream != "" { + if err := r.SetQueryParam("load_and_stream", qLoadAndStream); err != nil { + return err + } + } + + } + + if o.PrimaryReplicaOnly != nil { + + // query param primary_replica_only + var qrPrimaryReplicaOnly bool + if o.PrimaryReplicaOnly != nil { + qrPrimaryReplicaOnly = *o.PrimaryReplicaOnly + } + qPrimaryReplicaOnly := swag.FormatBool(qrPrimaryReplicaOnly) + if qPrimaryReplicaOnly != "" { + if err := r.SetQueryParam("primary_replica_only", qPrimaryReplicaOnly); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_sstables_by_keyspace_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_sstables_by_keyspace_post_responses.go new file mode 100644 index 0000000000..0c0c3037e1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_sstables_by_keyspace_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceSstablesByKeyspacePostReader is a Reader for the StorageServiceSstablesByKeyspacePost structure. +type StorageServiceSstablesByKeyspacePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceSstablesByKeyspacePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceSstablesByKeyspacePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceSstablesByKeyspacePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceSstablesByKeyspacePostOK creates a StorageServiceSstablesByKeyspacePostOK with default headers values +func NewStorageServiceSstablesByKeyspacePostOK() *StorageServiceSstablesByKeyspacePostOK { + return &StorageServiceSstablesByKeyspacePostOK{} +} + +/* +StorageServiceSstablesByKeyspacePostOK handles this case with default header values. + +Success +*/ +type StorageServiceSstablesByKeyspacePostOK struct { +} + +func (o *StorageServiceSstablesByKeyspacePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceSstablesByKeyspacePostDefault creates a StorageServiceSstablesByKeyspacePostDefault with default headers values +func NewStorageServiceSstablesByKeyspacePostDefault(code int) *StorageServiceSstablesByKeyspacePostDefault { + return &StorageServiceSstablesByKeyspacePostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceSstablesByKeyspacePostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceSstablesByKeyspacePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service sstables by keyspace post default response +func (o *StorageServiceSstablesByKeyspacePostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceSstablesByKeyspacePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceSstablesByKeyspacePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceSstablesByKeyspacePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stop_daemon_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stop_daemon_post_parameters.go new file mode 100644 index 0000000000..07572379cf --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stop_daemon_post_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceStopDaemonPostParams creates a new StorageServiceStopDaemonPostParams object +// with the default values initialized. +func NewStorageServiceStopDaemonPostParams() *StorageServiceStopDaemonPostParams { + + return &StorageServiceStopDaemonPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceStopDaemonPostParamsWithTimeout creates a new StorageServiceStopDaemonPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceStopDaemonPostParamsWithTimeout(timeout time.Duration) *StorageServiceStopDaemonPostParams { + + return &StorageServiceStopDaemonPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceStopDaemonPostParamsWithContext creates a new StorageServiceStopDaemonPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceStopDaemonPostParamsWithContext(ctx context.Context) *StorageServiceStopDaemonPostParams { + + return &StorageServiceStopDaemonPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceStopDaemonPostParamsWithHTTPClient creates a new StorageServiceStopDaemonPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceStopDaemonPostParamsWithHTTPClient(client *http.Client) *StorageServiceStopDaemonPostParams { + + return &StorageServiceStopDaemonPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceStopDaemonPostParams contains all the parameters to send to the API endpoint +for the storage service stop daemon post operation typically these are written to a http.Request +*/ +type StorageServiceStopDaemonPostParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service stop daemon post params +func (o *StorageServiceStopDaemonPostParams) WithTimeout(timeout time.Duration) *StorageServiceStopDaemonPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service stop daemon post params +func (o *StorageServiceStopDaemonPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service stop daemon post params +func (o *StorageServiceStopDaemonPostParams) WithContext(ctx context.Context) *StorageServiceStopDaemonPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service stop daemon post params +func (o *StorageServiceStopDaemonPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service stop daemon post params +func (o *StorageServiceStopDaemonPostParams) WithHTTPClient(client *http.Client) *StorageServiceStopDaemonPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service stop daemon post params +func (o *StorageServiceStopDaemonPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceStopDaemonPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stop_daemon_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stop_daemon_post_responses.go new file mode 100644 index 0000000000..e0686eb1eb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stop_daemon_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceStopDaemonPostReader is a Reader for the StorageServiceStopDaemonPost structure. +type StorageServiceStopDaemonPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceStopDaemonPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceStopDaemonPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceStopDaemonPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceStopDaemonPostOK creates a StorageServiceStopDaemonPostOK with default headers values +func NewStorageServiceStopDaemonPostOK() *StorageServiceStopDaemonPostOK { + return &StorageServiceStopDaemonPostOK{} +} + +/* +StorageServiceStopDaemonPostOK handles this case with default header values. + +Success +*/ +type StorageServiceStopDaemonPostOK struct { +} + +func (o *StorageServiceStopDaemonPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceStopDaemonPostDefault creates a StorageServiceStopDaemonPostDefault with default headers values +func NewStorageServiceStopDaemonPostDefault(code int) *StorageServiceStopDaemonPostDefault { + return &StorageServiceStopDaemonPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceStopDaemonPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceStopDaemonPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service stop daemon post default response +func (o *StorageServiceStopDaemonPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceStopDaemonPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceStopDaemonPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceStopDaemonPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stream_throughput_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stream_throughput_get_parameters.go new file mode 100644 index 0000000000..581005330a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stream_throughput_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceStreamThroughputGetParams creates a new StorageServiceStreamThroughputGetParams object +// with the default values initialized. +func NewStorageServiceStreamThroughputGetParams() *StorageServiceStreamThroughputGetParams { + + return &StorageServiceStreamThroughputGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceStreamThroughputGetParamsWithTimeout creates a new StorageServiceStreamThroughputGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceStreamThroughputGetParamsWithTimeout(timeout time.Duration) *StorageServiceStreamThroughputGetParams { + + return &StorageServiceStreamThroughputGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceStreamThroughputGetParamsWithContext creates a new StorageServiceStreamThroughputGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceStreamThroughputGetParamsWithContext(ctx context.Context) *StorageServiceStreamThroughputGetParams { + + return &StorageServiceStreamThroughputGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceStreamThroughputGetParamsWithHTTPClient creates a new StorageServiceStreamThroughputGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceStreamThroughputGetParamsWithHTTPClient(client *http.Client) *StorageServiceStreamThroughputGetParams { + + return &StorageServiceStreamThroughputGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceStreamThroughputGetParams contains all the parameters to send to the API endpoint +for the storage service stream throughput get operation typically these are written to a http.Request +*/ +type StorageServiceStreamThroughputGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service stream throughput get params +func (o *StorageServiceStreamThroughputGetParams) WithTimeout(timeout time.Duration) *StorageServiceStreamThroughputGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service stream throughput get params +func (o *StorageServiceStreamThroughputGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service stream throughput get params +func (o *StorageServiceStreamThroughputGetParams) WithContext(ctx context.Context) *StorageServiceStreamThroughputGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service stream throughput get params +func (o *StorageServiceStreamThroughputGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service stream throughput get params +func (o *StorageServiceStreamThroughputGetParams) WithHTTPClient(client *http.Client) *StorageServiceStreamThroughputGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service stream throughput get params +func (o *StorageServiceStreamThroughputGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceStreamThroughputGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stream_throughput_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stream_throughput_get_responses.go new file mode 100644 index 0000000000..094c63d709 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stream_throughput_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceStreamThroughputGetReader is a Reader for the StorageServiceStreamThroughputGet structure. +type StorageServiceStreamThroughputGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceStreamThroughputGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceStreamThroughputGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceStreamThroughputGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceStreamThroughputGetOK creates a StorageServiceStreamThroughputGetOK with default headers values +func NewStorageServiceStreamThroughputGetOK() *StorageServiceStreamThroughputGetOK { + return &StorageServiceStreamThroughputGetOK{} +} + +/* +StorageServiceStreamThroughputGetOK handles this case with default header values. + +Success +*/ +type StorageServiceStreamThroughputGetOK struct { + Payload int32 +} + +func (o *StorageServiceStreamThroughputGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageServiceStreamThroughputGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceStreamThroughputGetDefault creates a StorageServiceStreamThroughputGetDefault with default headers values +func NewStorageServiceStreamThroughputGetDefault(code int) *StorageServiceStreamThroughputGetDefault { + return &StorageServiceStreamThroughputGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceStreamThroughputGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceStreamThroughputGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service stream throughput get default response +func (o *StorageServiceStreamThroughputGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceStreamThroughputGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceStreamThroughputGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceStreamThroughputGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stream_throughput_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stream_throughput_post_parameters.go new file mode 100644 index 0000000000..9ec5bf7205 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stream_throughput_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceStreamThroughputPostParams creates a new StorageServiceStreamThroughputPostParams object +// with the default values initialized. +func NewStorageServiceStreamThroughputPostParams() *StorageServiceStreamThroughputPostParams { + var () + return &StorageServiceStreamThroughputPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceStreamThroughputPostParamsWithTimeout creates a new StorageServiceStreamThroughputPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceStreamThroughputPostParamsWithTimeout(timeout time.Duration) *StorageServiceStreamThroughputPostParams { + var () + return &StorageServiceStreamThroughputPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceStreamThroughputPostParamsWithContext creates a new StorageServiceStreamThroughputPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceStreamThroughputPostParamsWithContext(ctx context.Context) *StorageServiceStreamThroughputPostParams { + var () + return &StorageServiceStreamThroughputPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceStreamThroughputPostParamsWithHTTPClient creates a new StorageServiceStreamThroughputPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceStreamThroughputPostParamsWithHTTPClient(client *http.Client) *StorageServiceStreamThroughputPostParams { + var () + return &StorageServiceStreamThroughputPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceStreamThroughputPostParams contains all the parameters to send to the API endpoint +for the storage service stream throughput post operation typically these are written to a http.Request +*/ +type StorageServiceStreamThroughputPostParams struct { + + /*Value + Stream throughput + + */ + Value int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service stream throughput post params +func (o *StorageServiceStreamThroughputPostParams) WithTimeout(timeout time.Duration) *StorageServiceStreamThroughputPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service stream throughput post params +func (o *StorageServiceStreamThroughputPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service stream throughput post params +func (o *StorageServiceStreamThroughputPostParams) WithContext(ctx context.Context) *StorageServiceStreamThroughputPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service stream throughput post params +func (o *StorageServiceStreamThroughputPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service stream throughput post params +func (o *StorageServiceStreamThroughputPostParams) WithHTTPClient(client *http.Client) *StorageServiceStreamThroughputPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service stream throughput post params +func (o *StorageServiceStreamThroughputPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithValue adds the value to the storage service stream throughput post params +func (o *StorageServiceStreamThroughputPostParams) WithValue(value int32) *StorageServiceStreamThroughputPostParams { + o.SetValue(value) + return o +} + +// SetValue adds the value to the storage service stream throughput post params +func (o *StorageServiceStreamThroughputPostParams) SetValue(value int32) { + o.Value = value +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceStreamThroughputPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param value + qrValue := o.Value + qValue := swag.FormatInt32(qrValue) + if qValue != "" { + if err := r.SetQueryParam("value", qValue); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stream_throughput_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stream_throughput_post_responses.go new file mode 100644 index 0000000000..2aea7b6c38 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_stream_throughput_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceStreamThroughputPostReader is a Reader for the StorageServiceStreamThroughputPost structure. +type StorageServiceStreamThroughputPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceStreamThroughputPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceStreamThroughputPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceStreamThroughputPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceStreamThroughputPostOK creates a StorageServiceStreamThroughputPostOK with default headers values +func NewStorageServiceStreamThroughputPostOK() *StorageServiceStreamThroughputPostOK { + return &StorageServiceStreamThroughputPostOK{} +} + +/* +StorageServiceStreamThroughputPostOK handles this case with default header values. + +Success +*/ +type StorageServiceStreamThroughputPostOK struct { +} + +func (o *StorageServiceStreamThroughputPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceStreamThroughputPostDefault creates a StorageServiceStreamThroughputPostDefault with default headers values +func NewStorageServiceStreamThroughputPostDefault(code int) *StorageServiceStreamThroughputPostDefault { + return &StorageServiceStreamThroughputPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceStreamThroughputPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceStreamThroughputPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service stream throughput post default response +func (o *StorageServiceStreamThroughputPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceStreamThroughputPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceStreamThroughputPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceStreamThroughputPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tablets_balancing_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tablets_balancing_post_parameters.go new file mode 100644 index 0000000000..6e2e1948e0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tablets_balancing_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceTabletsBalancingPostParams creates a new StorageServiceTabletsBalancingPostParams object +// with the default values initialized. +func NewStorageServiceTabletsBalancingPostParams() *StorageServiceTabletsBalancingPostParams { + var () + return &StorageServiceTabletsBalancingPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceTabletsBalancingPostParamsWithTimeout creates a new StorageServiceTabletsBalancingPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceTabletsBalancingPostParamsWithTimeout(timeout time.Duration) *StorageServiceTabletsBalancingPostParams { + var () + return &StorageServiceTabletsBalancingPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceTabletsBalancingPostParamsWithContext creates a new StorageServiceTabletsBalancingPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceTabletsBalancingPostParamsWithContext(ctx context.Context) *StorageServiceTabletsBalancingPostParams { + var () + return &StorageServiceTabletsBalancingPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceTabletsBalancingPostParamsWithHTTPClient creates a new StorageServiceTabletsBalancingPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceTabletsBalancingPostParamsWithHTTPClient(client *http.Client) *StorageServiceTabletsBalancingPostParams { + var () + return &StorageServiceTabletsBalancingPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceTabletsBalancingPostParams contains all the parameters to send to the API endpoint +for the storage service tablets balancing post operation typically these are written to a http.Request +*/ +type StorageServiceTabletsBalancingPostParams struct { + + /*Enabled + When set to false, tablet load balancing is disabled + + */ + Enabled bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service tablets balancing post params +func (o *StorageServiceTabletsBalancingPostParams) WithTimeout(timeout time.Duration) *StorageServiceTabletsBalancingPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service tablets balancing post params +func (o *StorageServiceTabletsBalancingPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service tablets balancing post params +func (o *StorageServiceTabletsBalancingPostParams) WithContext(ctx context.Context) *StorageServiceTabletsBalancingPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service tablets balancing post params +func (o *StorageServiceTabletsBalancingPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service tablets balancing post params +func (o *StorageServiceTabletsBalancingPostParams) WithHTTPClient(client *http.Client) *StorageServiceTabletsBalancingPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service tablets balancing post params +func (o *StorageServiceTabletsBalancingPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEnabled adds the enabled to the storage service tablets balancing post params +func (o *StorageServiceTabletsBalancingPostParams) WithEnabled(enabled bool) *StorageServiceTabletsBalancingPostParams { + o.SetEnabled(enabled) + return o +} + +// SetEnabled adds the enabled to the storage service tablets balancing post params +func (o *StorageServiceTabletsBalancingPostParams) SetEnabled(enabled bool) { + o.Enabled = enabled +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceTabletsBalancingPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param enabled + qrEnabled := o.Enabled + qEnabled := swag.FormatBool(qrEnabled) + if qEnabled != "" { + if err := r.SetQueryParam("enabled", qEnabled); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tablets_balancing_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tablets_balancing_post_responses.go new file mode 100644 index 0000000000..0426d4b6c6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tablets_balancing_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceTabletsBalancingPostReader is a Reader for the StorageServiceTabletsBalancingPost structure. +type StorageServiceTabletsBalancingPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceTabletsBalancingPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceTabletsBalancingPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceTabletsBalancingPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceTabletsBalancingPostOK creates a StorageServiceTabletsBalancingPostOK with default headers values +func NewStorageServiceTabletsBalancingPostOK() *StorageServiceTabletsBalancingPostOK { + return &StorageServiceTabletsBalancingPostOK{} +} + +/* +StorageServiceTabletsBalancingPostOK handles this case with default header values. + +Success +*/ +type StorageServiceTabletsBalancingPostOK struct { +} + +func (o *StorageServiceTabletsBalancingPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceTabletsBalancingPostDefault creates a StorageServiceTabletsBalancingPostDefault with default headers values +func NewStorageServiceTabletsBalancingPostDefault(code int) *StorageServiceTabletsBalancingPostDefault { + return &StorageServiceTabletsBalancingPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceTabletsBalancingPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceTabletsBalancingPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service tablets balancing post default response +func (o *StorageServiceTabletsBalancingPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceTabletsBalancingPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceTabletsBalancingPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceTabletsBalancingPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_by_endpoint_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_by_endpoint_get_parameters.go new file mode 100644 index 0000000000..08332b224e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_by_endpoint_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceTokensByEndpointGetParams creates a new StorageServiceTokensByEndpointGetParams object +// with the default values initialized. +func NewStorageServiceTokensByEndpointGetParams() *StorageServiceTokensByEndpointGetParams { + var () + return &StorageServiceTokensByEndpointGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceTokensByEndpointGetParamsWithTimeout creates a new StorageServiceTokensByEndpointGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceTokensByEndpointGetParamsWithTimeout(timeout time.Duration) *StorageServiceTokensByEndpointGetParams { + var () + return &StorageServiceTokensByEndpointGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceTokensByEndpointGetParamsWithContext creates a new StorageServiceTokensByEndpointGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceTokensByEndpointGetParamsWithContext(ctx context.Context) *StorageServiceTokensByEndpointGetParams { + var () + return &StorageServiceTokensByEndpointGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceTokensByEndpointGetParamsWithHTTPClient creates a new StorageServiceTokensByEndpointGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceTokensByEndpointGetParamsWithHTTPClient(client *http.Client) *StorageServiceTokensByEndpointGetParams { + var () + return &StorageServiceTokensByEndpointGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceTokensByEndpointGetParams contains all the parameters to send to the API endpoint +for the storage service tokens by endpoint get operation typically these are written to a http.Request +*/ +type StorageServiceTokensByEndpointGetParams struct { + + /*Endpoint + The endpoint + + */ + Endpoint string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service tokens by endpoint get params +func (o *StorageServiceTokensByEndpointGetParams) WithTimeout(timeout time.Duration) *StorageServiceTokensByEndpointGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service tokens by endpoint get params +func (o *StorageServiceTokensByEndpointGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service tokens by endpoint get params +func (o *StorageServiceTokensByEndpointGetParams) WithContext(ctx context.Context) *StorageServiceTokensByEndpointGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service tokens by endpoint get params +func (o *StorageServiceTokensByEndpointGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service tokens by endpoint get params +func (o *StorageServiceTokensByEndpointGetParams) WithHTTPClient(client *http.Client) *StorageServiceTokensByEndpointGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service tokens by endpoint get params +func (o *StorageServiceTokensByEndpointGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEndpoint adds the endpoint to the storage service tokens by endpoint get params +func (o *StorageServiceTokensByEndpointGetParams) WithEndpoint(endpoint string) *StorageServiceTokensByEndpointGetParams { + o.SetEndpoint(endpoint) + return o +} + +// SetEndpoint adds the endpoint to the storage service tokens by endpoint get params +func (o *StorageServiceTokensByEndpointGetParams) SetEndpoint(endpoint string) { + o.Endpoint = endpoint +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceTokensByEndpointGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param endpoint + if err := r.SetPathParam("endpoint", o.Endpoint); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_by_endpoint_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_by_endpoint_get_responses.go new file mode 100644 index 0000000000..1a16a90a56 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_by_endpoint_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceTokensByEndpointGetReader is a Reader for the StorageServiceTokensByEndpointGet structure. +type StorageServiceTokensByEndpointGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceTokensByEndpointGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceTokensByEndpointGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceTokensByEndpointGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceTokensByEndpointGetOK creates a StorageServiceTokensByEndpointGetOK with default headers values +func NewStorageServiceTokensByEndpointGetOK() *StorageServiceTokensByEndpointGetOK { + return &StorageServiceTokensByEndpointGetOK{} +} + +/* +StorageServiceTokensByEndpointGetOK handles this case with default header values. + +Success +*/ +type StorageServiceTokensByEndpointGetOK struct { + Payload []string +} + +func (o *StorageServiceTokensByEndpointGetOK) GetPayload() []string { + return o.Payload +} + +func (o *StorageServiceTokensByEndpointGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceTokensByEndpointGetDefault creates a StorageServiceTokensByEndpointGetDefault with default headers values +func NewStorageServiceTokensByEndpointGetDefault(code int) *StorageServiceTokensByEndpointGetDefault { + return &StorageServiceTokensByEndpointGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceTokensByEndpointGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceTokensByEndpointGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service tokens by endpoint get default response +func (o *StorageServiceTokensByEndpointGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceTokensByEndpointGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceTokensByEndpointGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceTokensByEndpointGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_endpoint_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_endpoint_get_parameters.go new file mode 100644 index 0000000000..79f625bb7b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_endpoint_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceTokensEndpointGetParams creates a new StorageServiceTokensEndpointGetParams object +// with the default values initialized. +func NewStorageServiceTokensEndpointGetParams() *StorageServiceTokensEndpointGetParams { + + return &StorageServiceTokensEndpointGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceTokensEndpointGetParamsWithTimeout creates a new StorageServiceTokensEndpointGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceTokensEndpointGetParamsWithTimeout(timeout time.Duration) *StorageServiceTokensEndpointGetParams { + + return &StorageServiceTokensEndpointGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceTokensEndpointGetParamsWithContext creates a new StorageServiceTokensEndpointGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceTokensEndpointGetParamsWithContext(ctx context.Context) *StorageServiceTokensEndpointGetParams { + + return &StorageServiceTokensEndpointGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceTokensEndpointGetParamsWithHTTPClient creates a new StorageServiceTokensEndpointGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceTokensEndpointGetParamsWithHTTPClient(client *http.Client) *StorageServiceTokensEndpointGetParams { + + return &StorageServiceTokensEndpointGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceTokensEndpointGetParams contains all the parameters to send to the API endpoint +for the storage service tokens endpoint get operation typically these are written to a http.Request +*/ +type StorageServiceTokensEndpointGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service tokens endpoint get params +func (o *StorageServiceTokensEndpointGetParams) WithTimeout(timeout time.Duration) *StorageServiceTokensEndpointGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service tokens endpoint get params +func (o *StorageServiceTokensEndpointGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service tokens endpoint get params +func (o *StorageServiceTokensEndpointGetParams) WithContext(ctx context.Context) *StorageServiceTokensEndpointGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service tokens endpoint get params +func (o *StorageServiceTokensEndpointGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service tokens endpoint get params +func (o *StorageServiceTokensEndpointGetParams) WithHTTPClient(client *http.Client) *StorageServiceTokensEndpointGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service tokens endpoint get params +func (o *StorageServiceTokensEndpointGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceTokensEndpointGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_endpoint_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_endpoint_get_responses.go new file mode 100644 index 0000000000..73c60f941a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_endpoint_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceTokensEndpointGetReader is a Reader for the StorageServiceTokensEndpointGet structure. +type StorageServiceTokensEndpointGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceTokensEndpointGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceTokensEndpointGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceTokensEndpointGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceTokensEndpointGetOK creates a StorageServiceTokensEndpointGetOK with default headers values +func NewStorageServiceTokensEndpointGetOK() *StorageServiceTokensEndpointGetOK { + return &StorageServiceTokensEndpointGetOK{} +} + +/* +StorageServiceTokensEndpointGetOK handles this case with default header values. + +Success +*/ +type StorageServiceTokensEndpointGetOK struct { + Payload []*models.Mapper +} + +func (o *StorageServiceTokensEndpointGetOK) GetPayload() []*models.Mapper { + return o.Payload +} + +func (o *StorageServiceTokensEndpointGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceTokensEndpointGetDefault creates a StorageServiceTokensEndpointGetDefault with default headers values +func NewStorageServiceTokensEndpointGetDefault(code int) *StorageServiceTokensEndpointGetDefault { + return &StorageServiceTokensEndpointGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceTokensEndpointGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceTokensEndpointGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service tokens endpoint get default response +func (o *StorageServiceTokensEndpointGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceTokensEndpointGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceTokensEndpointGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceTokensEndpointGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_get_parameters.go new file mode 100644 index 0000000000..8a7efa2cdb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceTokensGetParams creates a new StorageServiceTokensGetParams object +// with the default values initialized. +func NewStorageServiceTokensGetParams() *StorageServiceTokensGetParams { + + return &StorageServiceTokensGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceTokensGetParamsWithTimeout creates a new StorageServiceTokensGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceTokensGetParamsWithTimeout(timeout time.Duration) *StorageServiceTokensGetParams { + + return &StorageServiceTokensGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceTokensGetParamsWithContext creates a new StorageServiceTokensGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceTokensGetParamsWithContext(ctx context.Context) *StorageServiceTokensGetParams { + + return &StorageServiceTokensGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceTokensGetParamsWithHTTPClient creates a new StorageServiceTokensGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceTokensGetParamsWithHTTPClient(client *http.Client) *StorageServiceTokensGetParams { + + return &StorageServiceTokensGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceTokensGetParams contains all the parameters to send to the API endpoint +for the storage service tokens get operation typically these are written to a http.Request +*/ +type StorageServiceTokensGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service tokens get params +func (o *StorageServiceTokensGetParams) WithTimeout(timeout time.Duration) *StorageServiceTokensGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service tokens get params +func (o *StorageServiceTokensGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service tokens get params +func (o *StorageServiceTokensGetParams) WithContext(ctx context.Context) *StorageServiceTokensGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service tokens get params +func (o *StorageServiceTokensGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service tokens get params +func (o *StorageServiceTokensGetParams) WithHTTPClient(client *http.Client) *StorageServiceTokensGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service tokens get params +func (o *StorageServiceTokensGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceTokensGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_get_responses.go new file mode 100644 index 0000000000..71c4dcd3e1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tokens_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceTokensGetReader is a Reader for the StorageServiceTokensGet structure. +type StorageServiceTokensGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceTokensGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceTokensGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceTokensGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceTokensGetOK creates a StorageServiceTokensGetOK with default headers values +func NewStorageServiceTokensGetOK() *StorageServiceTokensGetOK { + return &StorageServiceTokensGetOK{} +} + +/* +StorageServiceTokensGetOK handles this case with default header values. + +Success +*/ +type StorageServiceTokensGetOK struct { + Payload []string +} + +func (o *StorageServiceTokensGetOK) GetPayload() []string { + return o.Payload +} + +func (o *StorageServiceTokensGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceTokensGetDefault creates a StorageServiceTokensGetDefault with default headers values +func NewStorageServiceTokensGetDefault(code int) *StorageServiceTokensGetDefault { + return &StorageServiceTokensGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceTokensGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceTokensGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service tokens get default response +func (o *StorageServiceTokensGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceTokensGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceTokensGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceTokensGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_failure_threshold_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_failure_threshold_get_parameters.go new file mode 100644 index 0000000000..4cb08c1d81 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_failure_threshold_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceTombstoneFailureThresholdGetParams creates a new StorageServiceTombstoneFailureThresholdGetParams object +// with the default values initialized. +func NewStorageServiceTombstoneFailureThresholdGetParams() *StorageServiceTombstoneFailureThresholdGetParams { + + return &StorageServiceTombstoneFailureThresholdGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceTombstoneFailureThresholdGetParamsWithTimeout creates a new StorageServiceTombstoneFailureThresholdGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceTombstoneFailureThresholdGetParamsWithTimeout(timeout time.Duration) *StorageServiceTombstoneFailureThresholdGetParams { + + return &StorageServiceTombstoneFailureThresholdGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceTombstoneFailureThresholdGetParamsWithContext creates a new StorageServiceTombstoneFailureThresholdGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceTombstoneFailureThresholdGetParamsWithContext(ctx context.Context) *StorageServiceTombstoneFailureThresholdGetParams { + + return &StorageServiceTombstoneFailureThresholdGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceTombstoneFailureThresholdGetParamsWithHTTPClient creates a new StorageServiceTombstoneFailureThresholdGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceTombstoneFailureThresholdGetParamsWithHTTPClient(client *http.Client) *StorageServiceTombstoneFailureThresholdGetParams { + + return &StorageServiceTombstoneFailureThresholdGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceTombstoneFailureThresholdGetParams contains all the parameters to send to the API endpoint +for the storage service tombstone failure threshold get operation typically these are written to a http.Request +*/ +type StorageServiceTombstoneFailureThresholdGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service tombstone failure threshold get params +func (o *StorageServiceTombstoneFailureThresholdGetParams) WithTimeout(timeout time.Duration) *StorageServiceTombstoneFailureThresholdGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service tombstone failure threshold get params +func (o *StorageServiceTombstoneFailureThresholdGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service tombstone failure threshold get params +func (o *StorageServiceTombstoneFailureThresholdGetParams) WithContext(ctx context.Context) *StorageServiceTombstoneFailureThresholdGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service tombstone failure threshold get params +func (o *StorageServiceTombstoneFailureThresholdGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service tombstone failure threshold get params +func (o *StorageServiceTombstoneFailureThresholdGetParams) WithHTTPClient(client *http.Client) *StorageServiceTombstoneFailureThresholdGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service tombstone failure threshold get params +func (o *StorageServiceTombstoneFailureThresholdGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceTombstoneFailureThresholdGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_failure_threshold_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_failure_threshold_get_responses.go new file mode 100644 index 0000000000..0eaea9895c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_failure_threshold_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceTombstoneFailureThresholdGetReader is a Reader for the StorageServiceTombstoneFailureThresholdGet structure. +type StorageServiceTombstoneFailureThresholdGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceTombstoneFailureThresholdGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceTombstoneFailureThresholdGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceTombstoneFailureThresholdGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceTombstoneFailureThresholdGetOK creates a StorageServiceTombstoneFailureThresholdGetOK with default headers values +func NewStorageServiceTombstoneFailureThresholdGetOK() *StorageServiceTombstoneFailureThresholdGetOK { + return &StorageServiceTombstoneFailureThresholdGetOK{} +} + +/* +StorageServiceTombstoneFailureThresholdGetOK handles this case with default header values. + +Success +*/ +type StorageServiceTombstoneFailureThresholdGetOK struct { + Payload int32 +} + +func (o *StorageServiceTombstoneFailureThresholdGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageServiceTombstoneFailureThresholdGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceTombstoneFailureThresholdGetDefault creates a StorageServiceTombstoneFailureThresholdGetDefault with default headers values +func NewStorageServiceTombstoneFailureThresholdGetDefault(code int) *StorageServiceTombstoneFailureThresholdGetDefault { + return &StorageServiceTombstoneFailureThresholdGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceTombstoneFailureThresholdGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceTombstoneFailureThresholdGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service tombstone failure threshold get default response +func (o *StorageServiceTombstoneFailureThresholdGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceTombstoneFailureThresholdGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceTombstoneFailureThresholdGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceTombstoneFailureThresholdGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_failure_threshold_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_failure_threshold_post_parameters.go new file mode 100644 index 0000000000..3084d0f871 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_failure_threshold_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceTombstoneFailureThresholdPostParams creates a new StorageServiceTombstoneFailureThresholdPostParams object +// with the default values initialized. +func NewStorageServiceTombstoneFailureThresholdPostParams() *StorageServiceTombstoneFailureThresholdPostParams { + var () + return &StorageServiceTombstoneFailureThresholdPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceTombstoneFailureThresholdPostParamsWithTimeout creates a new StorageServiceTombstoneFailureThresholdPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceTombstoneFailureThresholdPostParamsWithTimeout(timeout time.Duration) *StorageServiceTombstoneFailureThresholdPostParams { + var () + return &StorageServiceTombstoneFailureThresholdPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceTombstoneFailureThresholdPostParamsWithContext creates a new StorageServiceTombstoneFailureThresholdPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceTombstoneFailureThresholdPostParamsWithContext(ctx context.Context) *StorageServiceTombstoneFailureThresholdPostParams { + var () + return &StorageServiceTombstoneFailureThresholdPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceTombstoneFailureThresholdPostParamsWithHTTPClient creates a new StorageServiceTombstoneFailureThresholdPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceTombstoneFailureThresholdPostParamsWithHTTPClient(client *http.Client) *StorageServiceTombstoneFailureThresholdPostParams { + var () + return &StorageServiceTombstoneFailureThresholdPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceTombstoneFailureThresholdPostParams contains all the parameters to send to the API endpoint +for the storage service tombstone failure threshold post operation typically these are written to a http.Request +*/ +type StorageServiceTombstoneFailureThresholdPostParams struct { + + /*TombstoneDebugThreshold + tombstone debug threshold + + */ + TombstoneDebugThreshold int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service tombstone failure threshold post params +func (o *StorageServiceTombstoneFailureThresholdPostParams) WithTimeout(timeout time.Duration) *StorageServiceTombstoneFailureThresholdPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service tombstone failure threshold post params +func (o *StorageServiceTombstoneFailureThresholdPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service tombstone failure threshold post params +func (o *StorageServiceTombstoneFailureThresholdPostParams) WithContext(ctx context.Context) *StorageServiceTombstoneFailureThresholdPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service tombstone failure threshold post params +func (o *StorageServiceTombstoneFailureThresholdPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service tombstone failure threshold post params +func (o *StorageServiceTombstoneFailureThresholdPostParams) WithHTTPClient(client *http.Client) *StorageServiceTombstoneFailureThresholdPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service tombstone failure threshold post params +func (o *StorageServiceTombstoneFailureThresholdPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTombstoneDebugThreshold adds the tombstoneDebugThreshold to the storage service tombstone failure threshold post params +func (o *StorageServiceTombstoneFailureThresholdPostParams) WithTombstoneDebugThreshold(tombstoneDebugThreshold int32) *StorageServiceTombstoneFailureThresholdPostParams { + o.SetTombstoneDebugThreshold(tombstoneDebugThreshold) + return o +} + +// SetTombstoneDebugThreshold adds the tombstoneDebugThreshold to the storage service tombstone failure threshold post params +func (o *StorageServiceTombstoneFailureThresholdPostParams) SetTombstoneDebugThreshold(tombstoneDebugThreshold int32) { + o.TombstoneDebugThreshold = tombstoneDebugThreshold +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceTombstoneFailureThresholdPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param tombstone_debug_threshold + qrTombstoneDebugThreshold := o.TombstoneDebugThreshold + qTombstoneDebugThreshold := swag.FormatInt32(qrTombstoneDebugThreshold) + if qTombstoneDebugThreshold != "" { + if err := r.SetQueryParam("tombstone_debug_threshold", qTombstoneDebugThreshold); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_failure_threshold_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_failure_threshold_post_responses.go new file mode 100644 index 0000000000..a663727123 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_failure_threshold_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceTombstoneFailureThresholdPostReader is a Reader for the StorageServiceTombstoneFailureThresholdPost structure. +type StorageServiceTombstoneFailureThresholdPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceTombstoneFailureThresholdPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceTombstoneFailureThresholdPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceTombstoneFailureThresholdPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceTombstoneFailureThresholdPostOK creates a StorageServiceTombstoneFailureThresholdPostOK with default headers values +func NewStorageServiceTombstoneFailureThresholdPostOK() *StorageServiceTombstoneFailureThresholdPostOK { + return &StorageServiceTombstoneFailureThresholdPostOK{} +} + +/* +StorageServiceTombstoneFailureThresholdPostOK handles this case with default header values. + +Success +*/ +type StorageServiceTombstoneFailureThresholdPostOK struct { +} + +func (o *StorageServiceTombstoneFailureThresholdPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceTombstoneFailureThresholdPostDefault creates a StorageServiceTombstoneFailureThresholdPostDefault with default headers values +func NewStorageServiceTombstoneFailureThresholdPostDefault(code int) *StorageServiceTombstoneFailureThresholdPostDefault { + return &StorageServiceTombstoneFailureThresholdPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceTombstoneFailureThresholdPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceTombstoneFailureThresholdPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service tombstone failure threshold post default response +func (o *StorageServiceTombstoneFailureThresholdPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceTombstoneFailureThresholdPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceTombstoneFailureThresholdPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceTombstoneFailureThresholdPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_warn_threshold_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_warn_threshold_get_parameters.go new file mode 100644 index 0000000000..cf1bba0dd1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_warn_threshold_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceTombstoneWarnThresholdGetParams creates a new StorageServiceTombstoneWarnThresholdGetParams object +// with the default values initialized. +func NewStorageServiceTombstoneWarnThresholdGetParams() *StorageServiceTombstoneWarnThresholdGetParams { + + return &StorageServiceTombstoneWarnThresholdGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceTombstoneWarnThresholdGetParamsWithTimeout creates a new StorageServiceTombstoneWarnThresholdGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceTombstoneWarnThresholdGetParamsWithTimeout(timeout time.Duration) *StorageServiceTombstoneWarnThresholdGetParams { + + return &StorageServiceTombstoneWarnThresholdGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceTombstoneWarnThresholdGetParamsWithContext creates a new StorageServiceTombstoneWarnThresholdGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceTombstoneWarnThresholdGetParamsWithContext(ctx context.Context) *StorageServiceTombstoneWarnThresholdGetParams { + + return &StorageServiceTombstoneWarnThresholdGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceTombstoneWarnThresholdGetParamsWithHTTPClient creates a new StorageServiceTombstoneWarnThresholdGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceTombstoneWarnThresholdGetParamsWithHTTPClient(client *http.Client) *StorageServiceTombstoneWarnThresholdGetParams { + + return &StorageServiceTombstoneWarnThresholdGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceTombstoneWarnThresholdGetParams contains all the parameters to send to the API endpoint +for the storage service tombstone warn threshold get operation typically these are written to a http.Request +*/ +type StorageServiceTombstoneWarnThresholdGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service tombstone warn threshold get params +func (o *StorageServiceTombstoneWarnThresholdGetParams) WithTimeout(timeout time.Duration) *StorageServiceTombstoneWarnThresholdGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service tombstone warn threshold get params +func (o *StorageServiceTombstoneWarnThresholdGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service tombstone warn threshold get params +func (o *StorageServiceTombstoneWarnThresholdGetParams) WithContext(ctx context.Context) *StorageServiceTombstoneWarnThresholdGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service tombstone warn threshold get params +func (o *StorageServiceTombstoneWarnThresholdGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service tombstone warn threshold get params +func (o *StorageServiceTombstoneWarnThresholdGetParams) WithHTTPClient(client *http.Client) *StorageServiceTombstoneWarnThresholdGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service tombstone warn threshold get params +func (o *StorageServiceTombstoneWarnThresholdGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceTombstoneWarnThresholdGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_warn_threshold_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_warn_threshold_get_responses.go new file mode 100644 index 0000000000..1dc27ec9f0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_warn_threshold_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceTombstoneWarnThresholdGetReader is a Reader for the StorageServiceTombstoneWarnThresholdGet structure. +type StorageServiceTombstoneWarnThresholdGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceTombstoneWarnThresholdGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceTombstoneWarnThresholdGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceTombstoneWarnThresholdGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceTombstoneWarnThresholdGetOK creates a StorageServiceTombstoneWarnThresholdGetOK with default headers values +func NewStorageServiceTombstoneWarnThresholdGetOK() *StorageServiceTombstoneWarnThresholdGetOK { + return &StorageServiceTombstoneWarnThresholdGetOK{} +} + +/* +StorageServiceTombstoneWarnThresholdGetOK handles this case with default header values. + +Success +*/ +type StorageServiceTombstoneWarnThresholdGetOK struct { + Payload int32 +} + +func (o *StorageServiceTombstoneWarnThresholdGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StorageServiceTombstoneWarnThresholdGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceTombstoneWarnThresholdGetDefault creates a StorageServiceTombstoneWarnThresholdGetDefault with default headers values +func NewStorageServiceTombstoneWarnThresholdGetDefault(code int) *StorageServiceTombstoneWarnThresholdGetDefault { + return &StorageServiceTombstoneWarnThresholdGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceTombstoneWarnThresholdGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceTombstoneWarnThresholdGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service tombstone warn threshold get default response +func (o *StorageServiceTombstoneWarnThresholdGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceTombstoneWarnThresholdGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceTombstoneWarnThresholdGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceTombstoneWarnThresholdGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_warn_threshold_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_warn_threshold_post_parameters.go new file mode 100644 index 0000000000..e1fcf893ca --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_warn_threshold_post_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceTombstoneWarnThresholdPostParams creates a new StorageServiceTombstoneWarnThresholdPostParams object +// with the default values initialized. +func NewStorageServiceTombstoneWarnThresholdPostParams() *StorageServiceTombstoneWarnThresholdPostParams { + var () + return &StorageServiceTombstoneWarnThresholdPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceTombstoneWarnThresholdPostParamsWithTimeout creates a new StorageServiceTombstoneWarnThresholdPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceTombstoneWarnThresholdPostParamsWithTimeout(timeout time.Duration) *StorageServiceTombstoneWarnThresholdPostParams { + var () + return &StorageServiceTombstoneWarnThresholdPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceTombstoneWarnThresholdPostParamsWithContext creates a new StorageServiceTombstoneWarnThresholdPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceTombstoneWarnThresholdPostParamsWithContext(ctx context.Context) *StorageServiceTombstoneWarnThresholdPostParams { + var () + return &StorageServiceTombstoneWarnThresholdPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceTombstoneWarnThresholdPostParamsWithHTTPClient creates a new StorageServiceTombstoneWarnThresholdPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceTombstoneWarnThresholdPostParamsWithHTTPClient(client *http.Client) *StorageServiceTombstoneWarnThresholdPostParams { + var () + return &StorageServiceTombstoneWarnThresholdPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceTombstoneWarnThresholdPostParams contains all the parameters to send to the API endpoint +for the storage service tombstone warn threshold post operation typically these are written to a http.Request +*/ +type StorageServiceTombstoneWarnThresholdPostParams struct { + + /*DebugThreshold + tombstone debug threshold + + */ + DebugThreshold int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service tombstone warn threshold post params +func (o *StorageServiceTombstoneWarnThresholdPostParams) WithTimeout(timeout time.Duration) *StorageServiceTombstoneWarnThresholdPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service tombstone warn threshold post params +func (o *StorageServiceTombstoneWarnThresholdPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service tombstone warn threshold post params +func (o *StorageServiceTombstoneWarnThresholdPostParams) WithContext(ctx context.Context) *StorageServiceTombstoneWarnThresholdPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service tombstone warn threshold post params +func (o *StorageServiceTombstoneWarnThresholdPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service tombstone warn threshold post params +func (o *StorageServiceTombstoneWarnThresholdPostParams) WithHTTPClient(client *http.Client) *StorageServiceTombstoneWarnThresholdPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service tombstone warn threshold post params +func (o *StorageServiceTombstoneWarnThresholdPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDebugThreshold adds the debugThreshold to the storage service tombstone warn threshold post params +func (o *StorageServiceTombstoneWarnThresholdPostParams) WithDebugThreshold(debugThreshold int32) *StorageServiceTombstoneWarnThresholdPostParams { + o.SetDebugThreshold(debugThreshold) + return o +} + +// SetDebugThreshold adds the debugThreshold to the storage service tombstone warn threshold post params +func (o *StorageServiceTombstoneWarnThresholdPostParams) SetDebugThreshold(debugThreshold int32) { + o.DebugThreshold = debugThreshold +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceTombstoneWarnThresholdPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param debug_threshold + qrDebugThreshold := o.DebugThreshold + qDebugThreshold := swag.FormatInt32(qrDebugThreshold) + if qDebugThreshold != "" { + if err := r.SetQueryParam("debug_threshold", qDebugThreshold); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_warn_threshold_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_warn_threshold_post_responses.go new file mode 100644 index 0000000000..f11dcefb44 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_tombstone_warn_threshold_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceTombstoneWarnThresholdPostReader is a Reader for the StorageServiceTombstoneWarnThresholdPost structure. +type StorageServiceTombstoneWarnThresholdPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceTombstoneWarnThresholdPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceTombstoneWarnThresholdPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceTombstoneWarnThresholdPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceTombstoneWarnThresholdPostOK creates a StorageServiceTombstoneWarnThresholdPostOK with default headers values +func NewStorageServiceTombstoneWarnThresholdPostOK() *StorageServiceTombstoneWarnThresholdPostOK { + return &StorageServiceTombstoneWarnThresholdPostOK{} +} + +/* +StorageServiceTombstoneWarnThresholdPostOK handles this case with default header values. + +Success +*/ +type StorageServiceTombstoneWarnThresholdPostOK struct { +} + +func (o *StorageServiceTombstoneWarnThresholdPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceTombstoneWarnThresholdPostDefault creates a StorageServiceTombstoneWarnThresholdPostDefault with default headers values +func NewStorageServiceTombstoneWarnThresholdPostDefault(code int) *StorageServiceTombstoneWarnThresholdPostDefault { + return &StorageServiceTombstoneWarnThresholdPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceTombstoneWarnThresholdPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceTombstoneWarnThresholdPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service tombstone warn threshold post default response +func (o *StorageServiceTombstoneWarnThresholdPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceTombstoneWarnThresholdPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceTombstoneWarnThresholdPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceTombstoneWarnThresholdPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_trace_probability_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_trace_probability_get_parameters.go new file mode 100644 index 0000000000..4299566074 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_trace_probability_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceTraceProbabilityGetParams creates a new StorageServiceTraceProbabilityGetParams object +// with the default values initialized. +func NewStorageServiceTraceProbabilityGetParams() *StorageServiceTraceProbabilityGetParams { + + return &StorageServiceTraceProbabilityGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceTraceProbabilityGetParamsWithTimeout creates a new StorageServiceTraceProbabilityGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceTraceProbabilityGetParamsWithTimeout(timeout time.Duration) *StorageServiceTraceProbabilityGetParams { + + return &StorageServiceTraceProbabilityGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceTraceProbabilityGetParamsWithContext creates a new StorageServiceTraceProbabilityGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceTraceProbabilityGetParamsWithContext(ctx context.Context) *StorageServiceTraceProbabilityGetParams { + + return &StorageServiceTraceProbabilityGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceTraceProbabilityGetParamsWithHTTPClient creates a new StorageServiceTraceProbabilityGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceTraceProbabilityGetParamsWithHTTPClient(client *http.Client) *StorageServiceTraceProbabilityGetParams { + + return &StorageServiceTraceProbabilityGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceTraceProbabilityGetParams contains all the parameters to send to the API endpoint +for the storage service trace probability get operation typically these are written to a http.Request +*/ +type StorageServiceTraceProbabilityGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service trace probability get params +func (o *StorageServiceTraceProbabilityGetParams) WithTimeout(timeout time.Duration) *StorageServiceTraceProbabilityGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service trace probability get params +func (o *StorageServiceTraceProbabilityGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service trace probability get params +func (o *StorageServiceTraceProbabilityGetParams) WithContext(ctx context.Context) *StorageServiceTraceProbabilityGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service trace probability get params +func (o *StorageServiceTraceProbabilityGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service trace probability get params +func (o *StorageServiceTraceProbabilityGetParams) WithHTTPClient(client *http.Client) *StorageServiceTraceProbabilityGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service trace probability get params +func (o *StorageServiceTraceProbabilityGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceTraceProbabilityGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_trace_probability_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_trace_probability_get_responses.go new file mode 100644 index 0000000000..90e872d3e8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_trace_probability_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceTraceProbabilityGetReader is a Reader for the StorageServiceTraceProbabilityGet structure. +type StorageServiceTraceProbabilityGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceTraceProbabilityGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceTraceProbabilityGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceTraceProbabilityGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceTraceProbabilityGetOK creates a StorageServiceTraceProbabilityGetOK with default headers values +func NewStorageServiceTraceProbabilityGetOK() *StorageServiceTraceProbabilityGetOK { + return &StorageServiceTraceProbabilityGetOK{} +} + +/* +StorageServiceTraceProbabilityGetOK handles this case with default header values. + +Success +*/ +type StorageServiceTraceProbabilityGetOK struct { + Payload interface{} +} + +func (o *StorageServiceTraceProbabilityGetOK) GetPayload() interface{} { + return o.Payload +} + +func (o *StorageServiceTraceProbabilityGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceTraceProbabilityGetDefault creates a StorageServiceTraceProbabilityGetDefault with default headers values +func NewStorageServiceTraceProbabilityGetDefault(code int) *StorageServiceTraceProbabilityGetDefault { + return &StorageServiceTraceProbabilityGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceTraceProbabilityGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceTraceProbabilityGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service trace probability get default response +func (o *StorageServiceTraceProbabilityGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceTraceProbabilityGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceTraceProbabilityGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceTraceProbabilityGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_trace_probability_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_trace_probability_post_parameters.go new file mode 100644 index 0000000000..f0fb066b1d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_trace_probability_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceTraceProbabilityPostParams creates a new StorageServiceTraceProbabilityPostParams object +// with the default values initialized. +func NewStorageServiceTraceProbabilityPostParams() *StorageServiceTraceProbabilityPostParams { + var () + return &StorageServiceTraceProbabilityPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceTraceProbabilityPostParamsWithTimeout creates a new StorageServiceTraceProbabilityPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceTraceProbabilityPostParamsWithTimeout(timeout time.Duration) *StorageServiceTraceProbabilityPostParams { + var () + return &StorageServiceTraceProbabilityPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceTraceProbabilityPostParamsWithContext creates a new StorageServiceTraceProbabilityPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceTraceProbabilityPostParamsWithContext(ctx context.Context) *StorageServiceTraceProbabilityPostParams { + var () + return &StorageServiceTraceProbabilityPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceTraceProbabilityPostParamsWithHTTPClient creates a new StorageServiceTraceProbabilityPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceTraceProbabilityPostParamsWithHTTPClient(client *http.Client) *StorageServiceTraceProbabilityPostParams { + var () + return &StorageServiceTraceProbabilityPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceTraceProbabilityPostParams contains all the parameters to send to the API endpoint +for the storage service trace probability post operation typically these are written to a http.Request +*/ +type StorageServiceTraceProbabilityPostParams struct { + + /*Probability + [0,1] will enable tracing on a partial number of requests with the provided probability. 0 will disable tracing and 1 will enable tracing for all requests (which mich severely cripple the system) + + */ + Probability string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service trace probability post params +func (o *StorageServiceTraceProbabilityPostParams) WithTimeout(timeout time.Duration) *StorageServiceTraceProbabilityPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service trace probability post params +func (o *StorageServiceTraceProbabilityPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service trace probability post params +func (o *StorageServiceTraceProbabilityPostParams) WithContext(ctx context.Context) *StorageServiceTraceProbabilityPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service trace probability post params +func (o *StorageServiceTraceProbabilityPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service trace probability post params +func (o *StorageServiceTraceProbabilityPostParams) WithHTTPClient(client *http.Client) *StorageServiceTraceProbabilityPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service trace probability post params +func (o *StorageServiceTraceProbabilityPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithProbability adds the probability to the storage service trace probability post params +func (o *StorageServiceTraceProbabilityPostParams) WithProbability(probability string) *StorageServiceTraceProbabilityPostParams { + o.SetProbability(probability) + return o +} + +// SetProbability adds the probability to the storage service trace probability post params +func (o *StorageServiceTraceProbabilityPostParams) SetProbability(probability string) { + o.Probability = probability +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceTraceProbabilityPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param probability + qrProbability := o.Probability + qProbability := qrProbability + if qProbability != "" { + if err := r.SetQueryParam("probability", qProbability); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_trace_probability_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_trace_probability_post_responses.go new file mode 100644 index 0000000000..ac922c2adc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_trace_probability_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceTraceProbabilityPostReader is a Reader for the StorageServiceTraceProbabilityPost structure. +type StorageServiceTraceProbabilityPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceTraceProbabilityPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceTraceProbabilityPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceTraceProbabilityPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceTraceProbabilityPostOK creates a StorageServiceTraceProbabilityPostOK with default headers values +func NewStorageServiceTraceProbabilityPostOK() *StorageServiceTraceProbabilityPostOK { + return &StorageServiceTraceProbabilityPostOK{} +} + +/* +StorageServiceTraceProbabilityPostOK handles this case with default header values. + +Success +*/ +type StorageServiceTraceProbabilityPostOK struct { +} + +func (o *StorageServiceTraceProbabilityPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceTraceProbabilityPostDefault creates a StorageServiceTraceProbabilityPostDefault with default headers values +func NewStorageServiceTraceProbabilityPostDefault(code int) *StorageServiceTraceProbabilityPostDefault { + return &StorageServiceTraceProbabilityPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceTraceProbabilityPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceTraceProbabilityPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service trace probability post default response +func (o *StorageServiceTraceProbabilityPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceTraceProbabilityPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceTraceProbabilityPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceTraceProbabilityPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_truncate_by_keyspace_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_truncate_by_keyspace_post_parameters.go new file mode 100644 index 0000000000..3cdc0cb784 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_truncate_by_keyspace_post_parameters.go @@ -0,0 +1,168 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceTruncateByKeyspacePostParams creates a new StorageServiceTruncateByKeyspacePostParams object +// with the default values initialized. +func NewStorageServiceTruncateByKeyspacePostParams() *StorageServiceTruncateByKeyspacePostParams { + var () + return &StorageServiceTruncateByKeyspacePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceTruncateByKeyspacePostParamsWithTimeout creates a new StorageServiceTruncateByKeyspacePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceTruncateByKeyspacePostParamsWithTimeout(timeout time.Duration) *StorageServiceTruncateByKeyspacePostParams { + var () + return &StorageServiceTruncateByKeyspacePostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceTruncateByKeyspacePostParamsWithContext creates a new StorageServiceTruncateByKeyspacePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceTruncateByKeyspacePostParamsWithContext(ctx context.Context) *StorageServiceTruncateByKeyspacePostParams { + var () + return &StorageServiceTruncateByKeyspacePostParams{ + + Context: ctx, + } +} + +// NewStorageServiceTruncateByKeyspacePostParamsWithHTTPClient creates a new StorageServiceTruncateByKeyspacePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceTruncateByKeyspacePostParamsWithHTTPClient(client *http.Client) *StorageServiceTruncateByKeyspacePostParams { + var () + return &StorageServiceTruncateByKeyspacePostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceTruncateByKeyspacePostParams contains all the parameters to send to the API endpoint +for the storage service truncate by keyspace post operation typically these are written to a http.Request +*/ +type StorageServiceTruncateByKeyspacePostParams struct { + + /*Cf + Column family name + + */ + Cf *string + /*Keyspace + The keyspace + + */ + Keyspace string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service truncate by keyspace post params +func (o *StorageServiceTruncateByKeyspacePostParams) WithTimeout(timeout time.Duration) *StorageServiceTruncateByKeyspacePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service truncate by keyspace post params +func (o *StorageServiceTruncateByKeyspacePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service truncate by keyspace post params +func (o *StorageServiceTruncateByKeyspacePostParams) WithContext(ctx context.Context) *StorageServiceTruncateByKeyspacePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service truncate by keyspace post params +func (o *StorageServiceTruncateByKeyspacePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service truncate by keyspace post params +func (o *StorageServiceTruncateByKeyspacePostParams) WithHTTPClient(client *http.Client) *StorageServiceTruncateByKeyspacePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service truncate by keyspace post params +func (o *StorageServiceTruncateByKeyspacePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCf adds the cf to the storage service truncate by keyspace post params +func (o *StorageServiceTruncateByKeyspacePostParams) WithCf(cf *string) *StorageServiceTruncateByKeyspacePostParams { + o.SetCf(cf) + return o +} + +// SetCf adds the cf to the storage service truncate by keyspace post params +func (o *StorageServiceTruncateByKeyspacePostParams) SetCf(cf *string) { + o.Cf = cf +} + +// WithKeyspace adds the keyspace to the storage service truncate by keyspace post params +func (o *StorageServiceTruncateByKeyspacePostParams) WithKeyspace(keyspace string) *StorageServiceTruncateByKeyspacePostParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service truncate by keyspace post params +func (o *StorageServiceTruncateByKeyspacePostParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceTruncateByKeyspacePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cf != nil { + + // query param cf + var qrCf string + if o.Cf != nil { + qrCf = *o.Cf + } + qCf := qrCf + if qCf != "" { + if err := r.SetQueryParam("cf", qCf); err != nil { + return err + } + } + + } + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_truncate_by_keyspace_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_truncate_by_keyspace_post_responses.go new file mode 100644 index 0000000000..a6def4a087 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_truncate_by_keyspace_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceTruncateByKeyspacePostReader is a Reader for the StorageServiceTruncateByKeyspacePost structure. +type StorageServiceTruncateByKeyspacePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceTruncateByKeyspacePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceTruncateByKeyspacePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceTruncateByKeyspacePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceTruncateByKeyspacePostOK creates a StorageServiceTruncateByKeyspacePostOK with default headers values +func NewStorageServiceTruncateByKeyspacePostOK() *StorageServiceTruncateByKeyspacePostOK { + return &StorageServiceTruncateByKeyspacePostOK{} +} + +/* +StorageServiceTruncateByKeyspacePostOK handles this case with default header values. + +Success +*/ +type StorageServiceTruncateByKeyspacePostOK struct { +} + +func (o *StorageServiceTruncateByKeyspacePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceTruncateByKeyspacePostDefault creates a StorageServiceTruncateByKeyspacePostDefault with default headers values +func NewStorageServiceTruncateByKeyspacePostDefault(code int) *StorageServiceTruncateByKeyspacePostDefault { + return &StorageServiceTruncateByKeyspacePostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceTruncateByKeyspacePostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceTruncateByKeyspacePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service truncate by keyspace post default response +func (o *StorageServiceTruncateByKeyspacePostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceTruncateByKeyspacePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceTruncateByKeyspacePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceTruncateByKeyspacePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_update_snitch_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_update_snitch_post_parameters.go new file mode 100644 index 0000000000..2a3f2a59da --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_update_snitch_post_parameters.go @@ -0,0 +1,262 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewStorageServiceUpdateSnitchPostParams creates a new StorageServiceUpdateSnitchPostParams object +// with the default values initialized. +func NewStorageServiceUpdateSnitchPostParams() *StorageServiceUpdateSnitchPostParams { + var () + return &StorageServiceUpdateSnitchPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceUpdateSnitchPostParamsWithTimeout creates a new StorageServiceUpdateSnitchPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceUpdateSnitchPostParamsWithTimeout(timeout time.Duration) *StorageServiceUpdateSnitchPostParams { + var () + return &StorageServiceUpdateSnitchPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceUpdateSnitchPostParamsWithContext creates a new StorageServiceUpdateSnitchPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceUpdateSnitchPostParamsWithContext(ctx context.Context) *StorageServiceUpdateSnitchPostParams { + var () + return &StorageServiceUpdateSnitchPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceUpdateSnitchPostParamsWithHTTPClient creates a new StorageServiceUpdateSnitchPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceUpdateSnitchPostParamsWithHTTPClient(client *http.Client) *StorageServiceUpdateSnitchPostParams { + var () + return &StorageServiceUpdateSnitchPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceUpdateSnitchPostParams contains all the parameters to send to the API endpoint +for the storage service update snitch post operation typically these are written to a http.Request +*/ +type StorageServiceUpdateSnitchPostParams struct { + + /*Dynamic + When true dynamicsnitch is used + + */ + Dynamic bool + /*DynamicBadnessThreshold + Dynamic badness threshold, (default 0.0) + + */ + DynamicBadnessThreshold *string + /*DynamicResetInterval + integer, in ms (default 600,000) + + */ + DynamicResetInterval *int32 + /*DynamicUpdateInterval + integer, in ms (default 100) + + */ + DynamicUpdateInterval *int32 + /*EpSnitchClassName + The canonical path name for a class implementing IEndpointSnitch + + */ + EpSnitchClassName string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) WithTimeout(timeout time.Duration) *StorageServiceUpdateSnitchPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) WithContext(ctx context.Context) *StorageServiceUpdateSnitchPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) WithHTTPClient(client *http.Client) *StorageServiceUpdateSnitchPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDynamic adds the dynamic to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) WithDynamic(dynamic bool) *StorageServiceUpdateSnitchPostParams { + o.SetDynamic(dynamic) + return o +} + +// SetDynamic adds the dynamic to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) SetDynamic(dynamic bool) { + o.Dynamic = dynamic +} + +// WithDynamicBadnessThreshold adds the dynamicBadnessThreshold to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) WithDynamicBadnessThreshold(dynamicBadnessThreshold *string) *StorageServiceUpdateSnitchPostParams { + o.SetDynamicBadnessThreshold(dynamicBadnessThreshold) + return o +} + +// SetDynamicBadnessThreshold adds the dynamicBadnessThreshold to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) SetDynamicBadnessThreshold(dynamicBadnessThreshold *string) { + o.DynamicBadnessThreshold = dynamicBadnessThreshold +} + +// WithDynamicResetInterval adds the dynamicResetInterval to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) WithDynamicResetInterval(dynamicResetInterval *int32) *StorageServiceUpdateSnitchPostParams { + o.SetDynamicResetInterval(dynamicResetInterval) + return o +} + +// SetDynamicResetInterval adds the dynamicResetInterval to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) SetDynamicResetInterval(dynamicResetInterval *int32) { + o.DynamicResetInterval = dynamicResetInterval +} + +// WithDynamicUpdateInterval adds the dynamicUpdateInterval to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) WithDynamicUpdateInterval(dynamicUpdateInterval *int32) *StorageServiceUpdateSnitchPostParams { + o.SetDynamicUpdateInterval(dynamicUpdateInterval) + return o +} + +// SetDynamicUpdateInterval adds the dynamicUpdateInterval to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) SetDynamicUpdateInterval(dynamicUpdateInterval *int32) { + o.DynamicUpdateInterval = dynamicUpdateInterval +} + +// WithEpSnitchClassName adds the epSnitchClassName to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) WithEpSnitchClassName(epSnitchClassName string) *StorageServiceUpdateSnitchPostParams { + o.SetEpSnitchClassName(epSnitchClassName) + return o +} + +// SetEpSnitchClassName adds the epSnitchClassName to the storage service update snitch post params +func (o *StorageServiceUpdateSnitchPostParams) SetEpSnitchClassName(epSnitchClassName string) { + o.EpSnitchClassName = epSnitchClassName +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceUpdateSnitchPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param dynamic + qrDynamic := o.Dynamic + qDynamic := swag.FormatBool(qrDynamic) + if qDynamic != "" { + if err := r.SetQueryParam("dynamic", qDynamic); err != nil { + return err + } + } + + if o.DynamicBadnessThreshold != nil { + + // query param dynamic_badness_threshold + var qrDynamicBadnessThreshold string + if o.DynamicBadnessThreshold != nil { + qrDynamicBadnessThreshold = *o.DynamicBadnessThreshold + } + qDynamicBadnessThreshold := qrDynamicBadnessThreshold + if qDynamicBadnessThreshold != "" { + if err := r.SetQueryParam("dynamic_badness_threshold", qDynamicBadnessThreshold); err != nil { + return err + } + } + + } + + if o.DynamicResetInterval != nil { + + // query param dynamic_reset_interval + var qrDynamicResetInterval int32 + if o.DynamicResetInterval != nil { + qrDynamicResetInterval = *o.DynamicResetInterval + } + qDynamicResetInterval := swag.FormatInt32(qrDynamicResetInterval) + if qDynamicResetInterval != "" { + if err := r.SetQueryParam("dynamic_reset_interval", qDynamicResetInterval); err != nil { + return err + } + } + + } + + if o.DynamicUpdateInterval != nil { + + // query param dynamic_update_interval + var qrDynamicUpdateInterval int32 + if o.DynamicUpdateInterval != nil { + qrDynamicUpdateInterval = *o.DynamicUpdateInterval + } + qDynamicUpdateInterval := swag.FormatInt32(qrDynamicUpdateInterval) + if qDynamicUpdateInterval != "" { + if err := r.SetQueryParam("dynamic_update_interval", qDynamicUpdateInterval); err != nil { + return err + } + } + + } + + // query param ep_snitch_class_name + qrEpSnitchClassName := o.EpSnitchClassName + qEpSnitchClassName := qrEpSnitchClassName + if qEpSnitchClassName != "" { + if err := r.SetQueryParam("ep_snitch_class_name", qEpSnitchClassName); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_update_snitch_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_update_snitch_post_responses.go new file mode 100644 index 0000000000..d9da748800 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_update_snitch_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceUpdateSnitchPostReader is a Reader for the StorageServiceUpdateSnitchPost structure. +type StorageServiceUpdateSnitchPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceUpdateSnitchPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceUpdateSnitchPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceUpdateSnitchPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceUpdateSnitchPostOK creates a StorageServiceUpdateSnitchPostOK with default headers values +func NewStorageServiceUpdateSnitchPostOK() *StorageServiceUpdateSnitchPostOK { + return &StorageServiceUpdateSnitchPostOK{} +} + +/* +StorageServiceUpdateSnitchPostOK handles this case with default header values. + +Success +*/ +type StorageServiceUpdateSnitchPostOK struct { +} + +func (o *StorageServiceUpdateSnitchPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceUpdateSnitchPostDefault creates a StorageServiceUpdateSnitchPostDefault with default headers values +func NewStorageServiceUpdateSnitchPostDefault(code int) *StorageServiceUpdateSnitchPostDefault { + return &StorageServiceUpdateSnitchPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceUpdateSnitchPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceUpdateSnitchPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service update snitch post default response +func (o *StorageServiceUpdateSnitchPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceUpdateSnitchPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceUpdateSnitchPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceUpdateSnitchPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_view_build_statuses_by_keyspace_and_view_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_view_build_statuses_by_keyspace_and_view_get_parameters.go new file mode 100644 index 0000000000..01bd82b472 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_view_build_statuses_by_keyspace_and_view_get_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStorageServiceViewBuildStatusesByKeyspaceAndViewGetParams creates a new StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams object +// with the default values initialized. +func NewStorageServiceViewBuildStatusesByKeyspaceAndViewGetParams() *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams { + var () + return &StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceViewBuildStatusesByKeyspaceAndViewGetParamsWithTimeout creates a new StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceViewBuildStatusesByKeyspaceAndViewGetParamsWithTimeout(timeout time.Duration) *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams { + var () + return &StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams{ + + timeout: timeout, + } +} + +// NewStorageServiceViewBuildStatusesByKeyspaceAndViewGetParamsWithContext creates a new StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceViewBuildStatusesByKeyspaceAndViewGetParamsWithContext(ctx context.Context) *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams { + var () + return &StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams{ + + Context: ctx, + } +} + +// NewStorageServiceViewBuildStatusesByKeyspaceAndViewGetParamsWithHTTPClient creates a new StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceViewBuildStatusesByKeyspaceAndViewGetParamsWithHTTPClient(client *http.Client) *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams { + var () + return &StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams{ + HTTPClient: client, + } +} + +/* +StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams contains all the parameters to send to the API endpoint +for the storage service view build statuses by keyspace and view get operation typically these are written to a http.Request +*/ +type StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams struct { + + /*Keyspace + The keyspace + + */ + Keyspace string + /*View + View name + + */ + View string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service view build statuses by keyspace and view get params +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams) WithTimeout(timeout time.Duration) *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service view build statuses by keyspace and view get params +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service view build statuses by keyspace and view get params +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams) WithContext(ctx context.Context) *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service view build statuses by keyspace and view get params +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service view build statuses by keyspace and view get params +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams) WithHTTPClient(client *http.Client) *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service view build statuses by keyspace and view get params +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithKeyspace adds the keyspace to the storage service view build statuses by keyspace and view get params +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams) WithKeyspace(keyspace string) *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service view build statuses by keyspace and view get params +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WithView adds the view to the storage service view build statuses by keyspace and view get params +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams) WithView(view string) *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams { + o.SetView(view) + return o +} + +// SetView adds the view to the storage service view build statuses by keyspace and view get params +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams) SetView(view string) { + o.View = view +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param keyspace + if err := r.SetPathParam("keyspace", o.Keyspace); err != nil { + return err + } + + // path param view + if err := r.SetPathParam("view", o.View); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_view_build_statuses_by_keyspace_and_view_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_view_build_statuses_by_keyspace_and_view_get_responses.go new file mode 100644 index 0000000000..6a9f27ec52 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_view_build_statuses_by_keyspace_and_view_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceViewBuildStatusesByKeyspaceAndViewGetReader is a Reader for the StorageServiceViewBuildStatusesByKeyspaceAndViewGet structure. +type StorageServiceViewBuildStatusesByKeyspaceAndViewGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceViewBuildStatusesByKeyspaceAndViewGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceViewBuildStatusesByKeyspaceAndViewGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStorageServiceViewBuildStatusesByKeyspaceAndViewGetOK creates a StorageServiceViewBuildStatusesByKeyspaceAndViewGetOK with default headers values +func NewStorageServiceViewBuildStatusesByKeyspaceAndViewGetOK() *StorageServiceViewBuildStatusesByKeyspaceAndViewGetOK { + return &StorageServiceViewBuildStatusesByKeyspaceAndViewGetOK{} +} + +/* +StorageServiceViewBuildStatusesByKeyspaceAndViewGetOK handles this case with default header values. + +Success +*/ +type StorageServiceViewBuildStatusesByKeyspaceAndViewGetOK struct { + Payload []*models.Mapper +} + +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetOK) GetPayload() []*models.Mapper { + return o.Payload +} + +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStorageServiceViewBuildStatusesByKeyspaceAndViewGetDefault creates a StorageServiceViewBuildStatusesByKeyspaceAndViewGetDefault with default headers values +func NewStorageServiceViewBuildStatusesByKeyspaceAndViewGetDefault(code int) *StorageServiceViewBuildStatusesByKeyspaceAndViewGetDefault { + return &StorageServiceViewBuildStatusesByKeyspaceAndViewGetDefault{ + _statusCode: code, + } +} + +/* +StorageServiceViewBuildStatusesByKeyspaceAndViewGetDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceViewBuildStatusesByKeyspaceAndViewGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service view build statuses by keyspace and view get default response +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StorageServiceViewBuildStatusesByKeyspaceAndViewGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_get_parameters.go new file mode 100644 index 0000000000..57bf515d03 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStreamManagerGetParams creates a new StreamManagerGetParams object +// with the default values initialized. +func NewStreamManagerGetParams() *StreamManagerGetParams { + + return &StreamManagerGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStreamManagerGetParamsWithTimeout creates a new StreamManagerGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStreamManagerGetParamsWithTimeout(timeout time.Duration) *StreamManagerGetParams { + + return &StreamManagerGetParams{ + + timeout: timeout, + } +} + +// NewStreamManagerGetParamsWithContext creates a new StreamManagerGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStreamManagerGetParamsWithContext(ctx context.Context) *StreamManagerGetParams { + + return &StreamManagerGetParams{ + + Context: ctx, + } +} + +// NewStreamManagerGetParamsWithHTTPClient creates a new StreamManagerGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStreamManagerGetParamsWithHTTPClient(client *http.Client) *StreamManagerGetParams { + + return &StreamManagerGetParams{ + HTTPClient: client, + } +} + +/* +StreamManagerGetParams contains all the parameters to send to the API endpoint +for the stream manager get operation typically these are written to a http.Request +*/ +type StreamManagerGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the stream manager get params +func (o *StreamManagerGetParams) WithTimeout(timeout time.Duration) *StreamManagerGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the stream manager get params +func (o *StreamManagerGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the stream manager get params +func (o *StreamManagerGetParams) WithContext(ctx context.Context) *StreamManagerGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the stream manager get params +func (o *StreamManagerGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the stream manager get params +func (o *StreamManagerGetParams) WithHTTPClient(client *http.Client) *StreamManagerGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the stream manager get params +func (o *StreamManagerGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StreamManagerGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_get_responses.go new file mode 100644 index 0000000000..3ac7909dbd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StreamManagerGetReader is a Reader for the StreamManagerGet structure. +type StreamManagerGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StreamManagerGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStreamManagerGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStreamManagerGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStreamManagerGetOK creates a StreamManagerGetOK with default headers values +func NewStreamManagerGetOK() *StreamManagerGetOK { + return &StreamManagerGetOK{} +} + +/* +StreamManagerGetOK handles this case with default header values. + +Success +*/ +type StreamManagerGetOK struct { + Payload []*models.StreamState +} + +func (o *StreamManagerGetOK) GetPayload() []*models.StreamState { + return o.Payload +} + +func (o *StreamManagerGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStreamManagerGetDefault creates a StreamManagerGetDefault with default headers values +func NewStreamManagerGetDefault(code int) *StreamManagerGetDefault { + return &StreamManagerGetDefault{ + _statusCode: code, + } +} + +/* +StreamManagerGetDefault handles this case with default header values. + +internal server error +*/ +type StreamManagerGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the stream manager get default response +func (o *StreamManagerGetDefault) Code() int { + return o._statusCode +} + +func (o *StreamManagerGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StreamManagerGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StreamManagerGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_incoming_by_peer_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_incoming_by_peer_get_parameters.go new file mode 100644 index 0000000000..8800970c18 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_incoming_by_peer_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStreamManagerMetricsIncomingByPeerGetParams creates a new StreamManagerMetricsIncomingByPeerGetParams object +// with the default values initialized. +func NewStreamManagerMetricsIncomingByPeerGetParams() *StreamManagerMetricsIncomingByPeerGetParams { + var () + return &StreamManagerMetricsIncomingByPeerGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStreamManagerMetricsIncomingByPeerGetParamsWithTimeout creates a new StreamManagerMetricsIncomingByPeerGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStreamManagerMetricsIncomingByPeerGetParamsWithTimeout(timeout time.Duration) *StreamManagerMetricsIncomingByPeerGetParams { + var () + return &StreamManagerMetricsIncomingByPeerGetParams{ + + timeout: timeout, + } +} + +// NewStreamManagerMetricsIncomingByPeerGetParamsWithContext creates a new StreamManagerMetricsIncomingByPeerGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStreamManagerMetricsIncomingByPeerGetParamsWithContext(ctx context.Context) *StreamManagerMetricsIncomingByPeerGetParams { + var () + return &StreamManagerMetricsIncomingByPeerGetParams{ + + Context: ctx, + } +} + +// NewStreamManagerMetricsIncomingByPeerGetParamsWithHTTPClient creates a new StreamManagerMetricsIncomingByPeerGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStreamManagerMetricsIncomingByPeerGetParamsWithHTTPClient(client *http.Client) *StreamManagerMetricsIncomingByPeerGetParams { + var () + return &StreamManagerMetricsIncomingByPeerGetParams{ + HTTPClient: client, + } +} + +/* +StreamManagerMetricsIncomingByPeerGetParams contains all the parameters to send to the API endpoint +for the stream manager metrics incoming by peer get operation typically these are written to a http.Request +*/ +type StreamManagerMetricsIncomingByPeerGetParams struct { + + /*Peer + The stream peer + + */ + Peer string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the stream manager metrics incoming by peer get params +func (o *StreamManagerMetricsIncomingByPeerGetParams) WithTimeout(timeout time.Duration) *StreamManagerMetricsIncomingByPeerGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the stream manager metrics incoming by peer get params +func (o *StreamManagerMetricsIncomingByPeerGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the stream manager metrics incoming by peer get params +func (o *StreamManagerMetricsIncomingByPeerGetParams) WithContext(ctx context.Context) *StreamManagerMetricsIncomingByPeerGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the stream manager metrics incoming by peer get params +func (o *StreamManagerMetricsIncomingByPeerGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the stream manager metrics incoming by peer get params +func (o *StreamManagerMetricsIncomingByPeerGetParams) WithHTTPClient(client *http.Client) *StreamManagerMetricsIncomingByPeerGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the stream manager metrics incoming by peer get params +func (o *StreamManagerMetricsIncomingByPeerGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPeer adds the peer to the stream manager metrics incoming by peer get params +func (o *StreamManagerMetricsIncomingByPeerGetParams) WithPeer(peer string) *StreamManagerMetricsIncomingByPeerGetParams { + o.SetPeer(peer) + return o +} + +// SetPeer adds the peer to the stream manager metrics incoming by peer get params +func (o *StreamManagerMetricsIncomingByPeerGetParams) SetPeer(peer string) { + o.Peer = peer +} + +// WriteToRequest writes these params to a swagger request +func (o *StreamManagerMetricsIncomingByPeerGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param peer + if err := r.SetPathParam("peer", o.Peer); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_incoming_by_peer_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_incoming_by_peer_get_responses.go new file mode 100644 index 0000000000..de5e5679e7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_incoming_by_peer_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StreamManagerMetricsIncomingByPeerGetReader is a Reader for the StreamManagerMetricsIncomingByPeerGet structure. +type StreamManagerMetricsIncomingByPeerGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StreamManagerMetricsIncomingByPeerGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStreamManagerMetricsIncomingByPeerGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStreamManagerMetricsIncomingByPeerGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStreamManagerMetricsIncomingByPeerGetOK creates a StreamManagerMetricsIncomingByPeerGetOK with default headers values +func NewStreamManagerMetricsIncomingByPeerGetOK() *StreamManagerMetricsIncomingByPeerGetOK { + return &StreamManagerMetricsIncomingByPeerGetOK{} +} + +/* +StreamManagerMetricsIncomingByPeerGetOK handles this case with default header values. + +Success +*/ +type StreamManagerMetricsIncomingByPeerGetOK struct { + Payload int32 +} + +func (o *StreamManagerMetricsIncomingByPeerGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StreamManagerMetricsIncomingByPeerGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStreamManagerMetricsIncomingByPeerGetDefault creates a StreamManagerMetricsIncomingByPeerGetDefault with default headers values +func NewStreamManagerMetricsIncomingByPeerGetDefault(code int) *StreamManagerMetricsIncomingByPeerGetDefault { + return &StreamManagerMetricsIncomingByPeerGetDefault{ + _statusCode: code, + } +} + +/* +StreamManagerMetricsIncomingByPeerGetDefault handles this case with default header values. + +internal server error +*/ +type StreamManagerMetricsIncomingByPeerGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the stream manager metrics incoming by peer get default response +func (o *StreamManagerMetricsIncomingByPeerGetDefault) Code() int { + return o._statusCode +} + +func (o *StreamManagerMetricsIncomingByPeerGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StreamManagerMetricsIncomingByPeerGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StreamManagerMetricsIncomingByPeerGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_incoming_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_incoming_get_parameters.go new file mode 100644 index 0000000000..8bafb284fd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_incoming_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStreamManagerMetricsIncomingGetParams creates a new StreamManagerMetricsIncomingGetParams object +// with the default values initialized. +func NewStreamManagerMetricsIncomingGetParams() *StreamManagerMetricsIncomingGetParams { + + return &StreamManagerMetricsIncomingGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStreamManagerMetricsIncomingGetParamsWithTimeout creates a new StreamManagerMetricsIncomingGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStreamManagerMetricsIncomingGetParamsWithTimeout(timeout time.Duration) *StreamManagerMetricsIncomingGetParams { + + return &StreamManagerMetricsIncomingGetParams{ + + timeout: timeout, + } +} + +// NewStreamManagerMetricsIncomingGetParamsWithContext creates a new StreamManagerMetricsIncomingGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStreamManagerMetricsIncomingGetParamsWithContext(ctx context.Context) *StreamManagerMetricsIncomingGetParams { + + return &StreamManagerMetricsIncomingGetParams{ + + Context: ctx, + } +} + +// NewStreamManagerMetricsIncomingGetParamsWithHTTPClient creates a new StreamManagerMetricsIncomingGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStreamManagerMetricsIncomingGetParamsWithHTTPClient(client *http.Client) *StreamManagerMetricsIncomingGetParams { + + return &StreamManagerMetricsIncomingGetParams{ + HTTPClient: client, + } +} + +/* +StreamManagerMetricsIncomingGetParams contains all the parameters to send to the API endpoint +for the stream manager metrics incoming get operation typically these are written to a http.Request +*/ +type StreamManagerMetricsIncomingGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the stream manager metrics incoming get params +func (o *StreamManagerMetricsIncomingGetParams) WithTimeout(timeout time.Duration) *StreamManagerMetricsIncomingGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the stream manager metrics incoming get params +func (o *StreamManagerMetricsIncomingGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the stream manager metrics incoming get params +func (o *StreamManagerMetricsIncomingGetParams) WithContext(ctx context.Context) *StreamManagerMetricsIncomingGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the stream manager metrics incoming get params +func (o *StreamManagerMetricsIncomingGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the stream manager metrics incoming get params +func (o *StreamManagerMetricsIncomingGetParams) WithHTTPClient(client *http.Client) *StreamManagerMetricsIncomingGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the stream manager metrics incoming get params +func (o *StreamManagerMetricsIncomingGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StreamManagerMetricsIncomingGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_incoming_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_incoming_get_responses.go new file mode 100644 index 0000000000..9469907ee7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_incoming_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StreamManagerMetricsIncomingGetReader is a Reader for the StreamManagerMetricsIncomingGet structure. +type StreamManagerMetricsIncomingGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StreamManagerMetricsIncomingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStreamManagerMetricsIncomingGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStreamManagerMetricsIncomingGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStreamManagerMetricsIncomingGetOK creates a StreamManagerMetricsIncomingGetOK with default headers values +func NewStreamManagerMetricsIncomingGetOK() *StreamManagerMetricsIncomingGetOK { + return &StreamManagerMetricsIncomingGetOK{} +} + +/* +StreamManagerMetricsIncomingGetOK handles this case with default header values. + +Success +*/ +type StreamManagerMetricsIncomingGetOK struct { + Payload int32 +} + +func (o *StreamManagerMetricsIncomingGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StreamManagerMetricsIncomingGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStreamManagerMetricsIncomingGetDefault creates a StreamManagerMetricsIncomingGetDefault with default headers values +func NewStreamManagerMetricsIncomingGetDefault(code int) *StreamManagerMetricsIncomingGetDefault { + return &StreamManagerMetricsIncomingGetDefault{ + _statusCode: code, + } +} + +/* +StreamManagerMetricsIncomingGetDefault handles this case with default header values. + +internal server error +*/ +type StreamManagerMetricsIncomingGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the stream manager metrics incoming get default response +func (o *StreamManagerMetricsIncomingGetDefault) Code() int { + return o._statusCode +} + +func (o *StreamManagerMetricsIncomingGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StreamManagerMetricsIncomingGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StreamManagerMetricsIncomingGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outbound_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outbound_get_parameters.go new file mode 100644 index 0000000000..fef090ab38 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outbound_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStreamManagerMetricsOutboundGetParams creates a new StreamManagerMetricsOutboundGetParams object +// with the default values initialized. +func NewStreamManagerMetricsOutboundGetParams() *StreamManagerMetricsOutboundGetParams { + + return &StreamManagerMetricsOutboundGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStreamManagerMetricsOutboundGetParamsWithTimeout creates a new StreamManagerMetricsOutboundGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStreamManagerMetricsOutboundGetParamsWithTimeout(timeout time.Duration) *StreamManagerMetricsOutboundGetParams { + + return &StreamManagerMetricsOutboundGetParams{ + + timeout: timeout, + } +} + +// NewStreamManagerMetricsOutboundGetParamsWithContext creates a new StreamManagerMetricsOutboundGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStreamManagerMetricsOutboundGetParamsWithContext(ctx context.Context) *StreamManagerMetricsOutboundGetParams { + + return &StreamManagerMetricsOutboundGetParams{ + + Context: ctx, + } +} + +// NewStreamManagerMetricsOutboundGetParamsWithHTTPClient creates a new StreamManagerMetricsOutboundGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStreamManagerMetricsOutboundGetParamsWithHTTPClient(client *http.Client) *StreamManagerMetricsOutboundGetParams { + + return &StreamManagerMetricsOutboundGetParams{ + HTTPClient: client, + } +} + +/* +StreamManagerMetricsOutboundGetParams contains all the parameters to send to the API endpoint +for the stream manager metrics outbound get operation typically these are written to a http.Request +*/ +type StreamManagerMetricsOutboundGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the stream manager metrics outbound get params +func (o *StreamManagerMetricsOutboundGetParams) WithTimeout(timeout time.Duration) *StreamManagerMetricsOutboundGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the stream manager metrics outbound get params +func (o *StreamManagerMetricsOutboundGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the stream manager metrics outbound get params +func (o *StreamManagerMetricsOutboundGetParams) WithContext(ctx context.Context) *StreamManagerMetricsOutboundGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the stream manager metrics outbound get params +func (o *StreamManagerMetricsOutboundGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the stream manager metrics outbound get params +func (o *StreamManagerMetricsOutboundGetParams) WithHTTPClient(client *http.Client) *StreamManagerMetricsOutboundGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the stream manager metrics outbound get params +func (o *StreamManagerMetricsOutboundGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StreamManagerMetricsOutboundGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outbound_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outbound_get_responses.go new file mode 100644 index 0000000000..ec2cb11906 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outbound_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StreamManagerMetricsOutboundGetReader is a Reader for the StreamManagerMetricsOutboundGet structure. +type StreamManagerMetricsOutboundGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StreamManagerMetricsOutboundGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStreamManagerMetricsOutboundGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStreamManagerMetricsOutboundGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStreamManagerMetricsOutboundGetOK creates a StreamManagerMetricsOutboundGetOK with default headers values +func NewStreamManagerMetricsOutboundGetOK() *StreamManagerMetricsOutboundGetOK { + return &StreamManagerMetricsOutboundGetOK{} +} + +/* +StreamManagerMetricsOutboundGetOK handles this case with default header values. + +Success +*/ +type StreamManagerMetricsOutboundGetOK struct { + Payload int32 +} + +func (o *StreamManagerMetricsOutboundGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StreamManagerMetricsOutboundGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStreamManagerMetricsOutboundGetDefault creates a StreamManagerMetricsOutboundGetDefault with default headers values +func NewStreamManagerMetricsOutboundGetDefault(code int) *StreamManagerMetricsOutboundGetDefault { + return &StreamManagerMetricsOutboundGetDefault{ + _statusCode: code, + } +} + +/* +StreamManagerMetricsOutboundGetDefault handles this case with default header values. + +internal server error +*/ +type StreamManagerMetricsOutboundGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the stream manager metrics outbound get default response +func (o *StreamManagerMetricsOutboundGetDefault) Code() int { + return o._statusCode +} + +func (o *StreamManagerMetricsOutboundGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StreamManagerMetricsOutboundGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StreamManagerMetricsOutboundGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outgoing_by_peer_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outgoing_by_peer_get_parameters.go new file mode 100644 index 0000000000..0b2c4fddd4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outgoing_by_peer_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStreamManagerMetricsOutgoingByPeerGetParams creates a new StreamManagerMetricsOutgoingByPeerGetParams object +// with the default values initialized. +func NewStreamManagerMetricsOutgoingByPeerGetParams() *StreamManagerMetricsOutgoingByPeerGetParams { + var () + return &StreamManagerMetricsOutgoingByPeerGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStreamManagerMetricsOutgoingByPeerGetParamsWithTimeout creates a new StreamManagerMetricsOutgoingByPeerGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStreamManagerMetricsOutgoingByPeerGetParamsWithTimeout(timeout time.Duration) *StreamManagerMetricsOutgoingByPeerGetParams { + var () + return &StreamManagerMetricsOutgoingByPeerGetParams{ + + timeout: timeout, + } +} + +// NewStreamManagerMetricsOutgoingByPeerGetParamsWithContext creates a new StreamManagerMetricsOutgoingByPeerGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStreamManagerMetricsOutgoingByPeerGetParamsWithContext(ctx context.Context) *StreamManagerMetricsOutgoingByPeerGetParams { + var () + return &StreamManagerMetricsOutgoingByPeerGetParams{ + + Context: ctx, + } +} + +// NewStreamManagerMetricsOutgoingByPeerGetParamsWithHTTPClient creates a new StreamManagerMetricsOutgoingByPeerGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStreamManagerMetricsOutgoingByPeerGetParamsWithHTTPClient(client *http.Client) *StreamManagerMetricsOutgoingByPeerGetParams { + var () + return &StreamManagerMetricsOutgoingByPeerGetParams{ + HTTPClient: client, + } +} + +/* +StreamManagerMetricsOutgoingByPeerGetParams contains all the parameters to send to the API endpoint +for the stream manager metrics outgoing by peer get operation typically these are written to a http.Request +*/ +type StreamManagerMetricsOutgoingByPeerGetParams struct { + + /*Peer + The stream peer + + */ + Peer string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the stream manager metrics outgoing by peer get params +func (o *StreamManagerMetricsOutgoingByPeerGetParams) WithTimeout(timeout time.Duration) *StreamManagerMetricsOutgoingByPeerGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the stream manager metrics outgoing by peer get params +func (o *StreamManagerMetricsOutgoingByPeerGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the stream manager metrics outgoing by peer get params +func (o *StreamManagerMetricsOutgoingByPeerGetParams) WithContext(ctx context.Context) *StreamManagerMetricsOutgoingByPeerGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the stream manager metrics outgoing by peer get params +func (o *StreamManagerMetricsOutgoingByPeerGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the stream manager metrics outgoing by peer get params +func (o *StreamManagerMetricsOutgoingByPeerGetParams) WithHTTPClient(client *http.Client) *StreamManagerMetricsOutgoingByPeerGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the stream manager metrics outgoing by peer get params +func (o *StreamManagerMetricsOutgoingByPeerGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPeer adds the peer to the stream manager metrics outgoing by peer get params +func (o *StreamManagerMetricsOutgoingByPeerGetParams) WithPeer(peer string) *StreamManagerMetricsOutgoingByPeerGetParams { + o.SetPeer(peer) + return o +} + +// SetPeer adds the peer to the stream manager metrics outgoing by peer get params +func (o *StreamManagerMetricsOutgoingByPeerGetParams) SetPeer(peer string) { + o.Peer = peer +} + +// WriteToRequest writes these params to a swagger request +func (o *StreamManagerMetricsOutgoingByPeerGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param peer + if err := r.SetPathParam("peer", o.Peer); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outgoing_by_peer_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outgoing_by_peer_get_responses.go new file mode 100644 index 0000000000..c9a23f42dd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outgoing_by_peer_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StreamManagerMetricsOutgoingByPeerGetReader is a Reader for the StreamManagerMetricsOutgoingByPeerGet structure. +type StreamManagerMetricsOutgoingByPeerGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StreamManagerMetricsOutgoingByPeerGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStreamManagerMetricsOutgoingByPeerGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStreamManagerMetricsOutgoingByPeerGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStreamManagerMetricsOutgoingByPeerGetOK creates a StreamManagerMetricsOutgoingByPeerGetOK with default headers values +func NewStreamManagerMetricsOutgoingByPeerGetOK() *StreamManagerMetricsOutgoingByPeerGetOK { + return &StreamManagerMetricsOutgoingByPeerGetOK{} +} + +/* +StreamManagerMetricsOutgoingByPeerGetOK handles this case with default header values. + +Success +*/ +type StreamManagerMetricsOutgoingByPeerGetOK struct { + Payload int32 +} + +func (o *StreamManagerMetricsOutgoingByPeerGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StreamManagerMetricsOutgoingByPeerGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStreamManagerMetricsOutgoingByPeerGetDefault creates a StreamManagerMetricsOutgoingByPeerGetDefault with default headers values +func NewStreamManagerMetricsOutgoingByPeerGetDefault(code int) *StreamManagerMetricsOutgoingByPeerGetDefault { + return &StreamManagerMetricsOutgoingByPeerGetDefault{ + _statusCode: code, + } +} + +/* +StreamManagerMetricsOutgoingByPeerGetDefault handles this case with default header values. + +internal server error +*/ +type StreamManagerMetricsOutgoingByPeerGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the stream manager metrics outgoing by peer get default response +func (o *StreamManagerMetricsOutgoingByPeerGetDefault) Code() int { + return o._statusCode +} + +func (o *StreamManagerMetricsOutgoingByPeerGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StreamManagerMetricsOutgoingByPeerGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StreamManagerMetricsOutgoingByPeerGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outgoing_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outgoing_get_parameters.go new file mode 100644 index 0000000000..b7f963d4c5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outgoing_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewStreamManagerMetricsOutgoingGetParams creates a new StreamManagerMetricsOutgoingGetParams object +// with the default values initialized. +func NewStreamManagerMetricsOutgoingGetParams() *StreamManagerMetricsOutgoingGetParams { + + return &StreamManagerMetricsOutgoingGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStreamManagerMetricsOutgoingGetParamsWithTimeout creates a new StreamManagerMetricsOutgoingGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStreamManagerMetricsOutgoingGetParamsWithTimeout(timeout time.Duration) *StreamManagerMetricsOutgoingGetParams { + + return &StreamManagerMetricsOutgoingGetParams{ + + timeout: timeout, + } +} + +// NewStreamManagerMetricsOutgoingGetParamsWithContext creates a new StreamManagerMetricsOutgoingGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewStreamManagerMetricsOutgoingGetParamsWithContext(ctx context.Context) *StreamManagerMetricsOutgoingGetParams { + + return &StreamManagerMetricsOutgoingGetParams{ + + Context: ctx, + } +} + +// NewStreamManagerMetricsOutgoingGetParamsWithHTTPClient creates a new StreamManagerMetricsOutgoingGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStreamManagerMetricsOutgoingGetParamsWithHTTPClient(client *http.Client) *StreamManagerMetricsOutgoingGetParams { + + return &StreamManagerMetricsOutgoingGetParams{ + HTTPClient: client, + } +} + +/* +StreamManagerMetricsOutgoingGetParams contains all the parameters to send to the API endpoint +for the stream manager metrics outgoing get operation typically these are written to a http.Request +*/ +type StreamManagerMetricsOutgoingGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the stream manager metrics outgoing get params +func (o *StreamManagerMetricsOutgoingGetParams) WithTimeout(timeout time.Duration) *StreamManagerMetricsOutgoingGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the stream manager metrics outgoing get params +func (o *StreamManagerMetricsOutgoingGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the stream manager metrics outgoing get params +func (o *StreamManagerMetricsOutgoingGetParams) WithContext(ctx context.Context) *StreamManagerMetricsOutgoingGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the stream manager metrics outgoing get params +func (o *StreamManagerMetricsOutgoingGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the stream manager metrics outgoing get params +func (o *StreamManagerMetricsOutgoingGetParams) WithHTTPClient(client *http.Client) *StreamManagerMetricsOutgoingGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the stream manager metrics outgoing get params +func (o *StreamManagerMetricsOutgoingGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *StreamManagerMetricsOutgoingGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outgoing_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outgoing_get_responses.go new file mode 100644 index 0000000000..26124af916 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/stream_manager_metrics_outgoing_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StreamManagerMetricsOutgoingGetReader is a Reader for the StreamManagerMetricsOutgoingGet structure. +type StreamManagerMetricsOutgoingGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StreamManagerMetricsOutgoingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStreamManagerMetricsOutgoingGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStreamManagerMetricsOutgoingGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewStreamManagerMetricsOutgoingGetOK creates a StreamManagerMetricsOutgoingGetOK with default headers values +func NewStreamManagerMetricsOutgoingGetOK() *StreamManagerMetricsOutgoingGetOK { + return &StreamManagerMetricsOutgoingGetOK{} +} + +/* +StreamManagerMetricsOutgoingGetOK handles this case with default header values. + +Success +*/ +type StreamManagerMetricsOutgoingGetOK struct { + Payload int32 +} + +func (o *StreamManagerMetricsOutgoingGetOK) GetPayload() int32 { + return o.Payload +} + +func (o *StreamManagerMetricsOutgoingGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewStreamManagerMetricsOutgoingGetDefault creates a StreamManagerMetricsOutgoingGetDefault with default headers values +func NewStreamManagerMetricsOutgoingGetDefault(code int) *StreamManagerMetricsOutgoingGetDefault { + return &StreamManagerMetricsOutgoingGetDefault{ + _statusCode: code, + } +} + +/* +StreamManagerMetricsOutgoingGetDefault handles this case with default header values. + +internal server error +*/ +type StreamManagerMetricsOutgoingGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the stream manager metrics outgoing get default response +func (o *StreamManagerMetricsOutgoingGetDefault) Code() int { + return o._statusCode +} + +func (o *StreamManagerMetricsOutgoingGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StreamManagerMetricsOutgoingGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *StreamManagerMetricsOutgoingGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_by_name_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_by_name_get_parameters.go new file mode 100644 index 0000000000..5e0a082c56 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_by_name_get_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewSystemLoggerByNameGetParams creates a new SystemLoggerByNameGetParams object +// with the default values initialized. +func NewSystemLoggerByNameGetParams() *SystemLoggerByNameGetParams { + var () + return &SystemLoggerByNameGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSystemLoggerByNameGetParamsWithTimeout creates a new SystemLoggerByNameGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSystemLoggerByNameGetParamsWithTimeout(timeout time.Duration) *SystemLoggerByNameGetParams { + var () + return &SystemLoggerByNameGetParams{ + + timeout: timeout, + } +} + +// NewSystemLoggerByNameGetParamsWithContext creates a new SystemLoggerByNameGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewSystemLoggerByNameGetParamsWithContext(ctx context.Context) *SystemLoggerByNameGetParams { + var () + return &SystemLoggerByNameGetParams{ + + Context: ctx, + } +} + +// NewSystemLoggerByNameGetParamsWithHTTPClient creates a new SystemLoggerByNameGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSystemLoggerByNameGetParamsWithHTTPClient(client *http.Client) *SystemLoggerByNameGetParams { + var () + return &SystemLoggerByNameGetParams{ + HTTPClient: client, + } +} + +/* +SystemLoggerByNameGetParams contains all the parameters to send to the API endpoint +for the system logger by name get operation typically these are written to a http.Request +*/ +type SystemLoggerByNameGetParams struct { + + /*Name + The logger to query about + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the system logger by name get params +func (o *SystemLoggerByNameGetParams) WithTimeout(timeout time.Duration) *SystemLoggerByNameGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the system logger by name get params +func (o *SystemLoggerByNameGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the system logger by name get params +func (o *SystemLoggerByNameGetParams) WithContext(ctx context.Context) *SystemLoggerByNameGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the system logger by name get params +func (o *SystemLoggerByNameGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the system logger by name get params +func (o *SystemLoggerByNameGetParams) WithHTTPClient(client *http.Client) *SystemLoggerByNameGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the system logger by name get params +func (o *SystemLoggerByNameGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the system logger by name get params +func (o *SystemLoggerByNameGetParams) WithName(name string) *SystemLoggerByNameGetParams { + o.SetName(name) + return o +} + +// SetName adds the name to the system logger by name get params +func (o *SystemLoggerByNameGetParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *SystemLoggerByNameGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_by_name_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_by_name_get_responses.go new file mode 100644 index 0000000000..afc8b57db7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_by_name_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// SystemLoggerByNameGetReader is a Reader for the SystemLoggerByNameGet structure. +type SystemLoggerByNameGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SystemLoggerByNameGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSystemLoggerByNameGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSystemLoggerByNameGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSystemLoggerByNameGetOK creates a SystemLoggerByNameGetOK with default headers values +func NewSystemLoggerByNameGetOK() *SystemLoggerByNameGetOK { + return &SystemLoggerByNameGetOK{} +} + +/* +SystemLoggerByNameGetOK handles this case with default header values. + +Success +*/ +type SystemLoggerByNameGetOK struct { + Payload string +} + +func (o *SystemLoggerByNameGetOK) GetPayload() string { + return o.Payload +} + +func (o *SystemLoggerByNameGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSystemLoggerByNameGetDefault creates a SystemLoggerByNameGetDefault with default headers values +func NewSystemLoggerByNameGetDefault(code int) *SystemLoggerByNameGetDefault { + return &SystemLoggerByNameGetDefault{ + _statusCode: code, + } +} + +/* +SystemLoggerByNameGetDefault handles this case with default header values. + +internal server error +*/ +type SystemLoggerByNameGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the system logger by name get default response +func (o *SystemLoggerByNameGetDefault) Code() int { + return o._statusCode +} + +func (o *SystemLoggerByNameGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *SystemLoggerByNameGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *SystemLoggerByNameGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_by_name_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_by_name_post_parameters.go new file mode 100644 index 0000000000..65db85ad8c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_by_name_post_parameters.go @@ -0,0 +1,161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewSystemLoggerByNamePostParams creates a new SystemLoggerByNamePostParams object +// with the default values initialized. +func NewSystemLoggerByNamePostParams() *SystemLoggerByNamePostParams { + var () + return &SystemLoggerByNamePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSystemLoggerByNamePostParamsWithTimeout creates a new SystemLoggerByNamePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSystemLoggerByNamePostParamsWithTimeout(timeout time.Duration) *SystemLoggerByNamePostParams { + var () + return &SystemLoggerByNamePostParams{ + + timeout: timeout, + } +} + +// NewSystemLoggerByNamePostParamsWithContext creates a new SystemLoggerByNamePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewSystemLoggerByNamePostParamsWithContext(ctx context.Context) *SystemLoggerByNamePostParams { + var () + return &SystemLoggerByNamePostParams{ + + Context: ctx, + } +} + +// NewSystemLoggerByNamePostParamsWithHTTPClient creates a new SystemLoggerByNamePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSystemLoggerByNamePostParamsWithHTTPClient(client *http.Client) *SystemLoggerByNamePostParams { + var () + return &SystemLoggerByNamePostParams{ + HTTPClient: client, + } +} + +/* +SystemLoggerByNamePostParams contains all the parameters to send to the API endpoint +for the system logger by name post operation typically these are written to a http.Request +*/ +type SystemLoggerByNamePostParams struct { + + /*Level + The new log level + + */ + Level string + /*Name + The logger to query about + + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the system logger by name post params +func (o *SystemLoggerByNamePostParams) WithTimeout(timeout time.Duration) *SystemLoggerByNamePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the system logger by name post params +func (o *SystemLoggerByNamePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the system logger by name post params +func (o *SystemLoggerByNamePostParams) WithContext(ctx context.Context) *SystemLoggerByNamePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the system logger by name post params +func (o *SystemLoggerByNamePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the system logger by name post params +func (o *SystemLoggerByNamePostParams) WithHTTPClient(client *http.Client) *SystemLoggerByNamePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the system logger by name post params +func (o *SystemLoggerByNamePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLevel adds the level to the system logger by name post params +func (o *SystemLoggerByNamePostParams) WithLevel(level string) *SystemLoggerByNamePostParams { + o.SetLevel(level) + return o +} + +// SetLevel adds the level to the system logger by name post params +func (o *SystemLoggerByNamePostParams) SetLevel(level string) { + o.Level = level +} + +// WithName adds the name to the system logger by name post params +func (o *SystemLoggerByNamePostParams) WithName(name string) *SystemLoggerByNamePostParams { + o.SetName(name) + return o +} + +// SetName adds the name to the system logger by name post params +func (o *SystemLoggerByNamePostParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *SystemLoggerByNamePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param level + qrLevel := o.Level + qLevel := qrLevel + if qLevel != "" { + if err := r.SetQueryParam("level", qLevel); err != nil { + return err + } + } + + // path param name + if err := r.SetPathParam("name", o.Name); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_by_name_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_by_name_post_responses.go new file mode 100644 index 0000000000..4215ecaad6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_by_name_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// SystemLoggerByNamePostReader is a Reader for the SystemLoggerByNamePost structure. +type SystemLoggerByNamePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SystemLoggerByNamePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSystemLoggerByNamePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSystemLoggerByNamePostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSystemLoggerByNamePostOK creates a SystemLoggerByNamePostOK with default headers values +func NewSystemLoggerByNamePostOK() *SystemLoggerByNamePostOK { + return &SystemLoggerByNamePostOK{} +} + +/* +SystemLoggerByNamePostOK handles this case with default header values. + +Success +*/ +type SystemLoggerByNamePostOK struct { +} + +func (o *SystemLoggerByNamePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewSystemLoggerByNamePostDefault creates a SystemLoggerByNamePostDefault with default headers values +func NewSystemLoggerByNamePostDefault(code int) *SystemLoggerByNamePostDefault { + return &SystemLoggerByNamePostDefault{ + _statusCode: code, + } +} + +/* +SystemLoggerByNamePostDefault handles this case with default header values. + +internal server error +*/ +type SystemLoggerByNamePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the system logger by name post default response +func (o *SystemLoggerByNamePostDefault) Code() int { + return o._statusCode +} + +func (o *SystemLoggerByNamePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *SystemLoggerByNamePostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *SystemLoggerByNamePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_get_parameters.go new file mode 100644 index 0000000000..f70d1eea53 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_get_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewSystemLoggerGetParams creates a new SystemLoggerGetParams object +// with the default values initialized. +func NewSystemLoggerGetParams() *SystemLoggerGetParams { + + return &SystemLoggerGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSystemLoggerGetParamsWithTimeout creates a new SystemLoggerGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSystemLoggerGetParamsWithTimeout(timeout time.Duration) *SystemLoggerGetParams { + + return &SystemLoggerGetParams{ + + timeout: timeout, + } +} + +// NewSystemLoggerGetParamsWithContext creates a new SystemLoggerGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewSystemLoggerGetParamsWithContext(ctx context.Context) *SystemLoggerGetParams { + + return &SystemLoggerGetParams{ + + Context: ctx, + } +} + +// NewSystemLoggerGetParamsWithHTTPClient creates a new SystemLoggerGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSystemLoggerGetParamsWithHTTPClient(client *http.Client) *SystemLoggerGetParams { + + return &SystemLoggerGetParams{ + HTTPClient: client, + } +} + +/* +SystemLoggerGetParams contains all the parameters to send to the API endpoint +for the system logger get operation typically these are written to a http.Request +*/ +type SystemLoggerGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the system logger get params +func (o *SystemLoggerGetParams) WithTimeout(timeout time.Duration) *SystemLoggerGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the system logger get params +func (o *SystemLoggerGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the system logger get params +func (o *SystemLoggerGetParams) WithContext(ctx context.Context) *SystemLoggerGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the system logger get params +func (o *SystemLoggerGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the system logger get params +func (o *SystemLoggerGetParams) WithHTTPClient(client *http.Client) *SystemLoggerGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the system logger get params +func (o *SystemLoggerGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *SystemLoggerGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_get_responses.go new file mode 100644 index 0000000000..36a0c46fb6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_get_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// SystemLoggerGetReader is a Reader for the SystemLoggerGet structure. +type SystemLoggerGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SystemLoggerGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSystemLoggerGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSystemLoggerGetDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSystemLoggerGetOK creates a SystemLoggerGetOK with default headers values +func NewSystemLoggerGetOK() *SystemLoggerGetOK { + return &SystemLoggerGetOK{} +} + +/* +SystemLoggerGetOK handles this case with default header values. + +Success +*/ +type SystemLoggerGetOK struct { + Payload []string +} + +func (o *SystemLoggerGetOK) GetPayload() []string { + return o.Payload +} + +func (o *SystemLoggerGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSystemLoggerGetDefault creates a SystemLoggerGetDefault with default headers values +func NewSystemLoggerGetDefault(code int) *SystemLoggerGetDefault { + return &SystemLoggerGetDefault{ + _statusCode: code, + } +} + +/* +SystemLoggerGetDefault handles this case with default header values. + +internal server error +*/ +type SystemLoggerGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the system logger get default response +func (o *SystemLoggerGetDefault) Code() int { + return o._statusCode +} + +func (o *SystemLoggerGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *SystemLoggerGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *SystemLoggerGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_post_parameters.go new file mode 100644 index 0000000000..4106bce392 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_post_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewSystemLoggerPostParams creates a new SystemLoggerPostParams object +// with the default values initialized. +func NewSystemLoggerPostParams() *SystemLoggerPostParams { + var () + return &SystemLoggerPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSystemLoggerPostParamsWithTimeout creates a new SystemLoggerPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSystemLoggerPostParamsWithTimeout(timeout time.Duration) *SystemLoggerPostParams { + var () + return &SystemLoggerPostParams{ + + timeout: timeout, + } +} + +// NewSystemLoggerPostParamsWithContext creates a new SystemLoggerPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewSystemLoggerPostParamsWithContext(ctx context.Context) *SystemLoggerPostParams { + var () + return &SystemLoggerPostParams{ + + Context: ctx, + } +} + +// NewSystemLoggerPostParamsWithHTTPClient creates a new SystemLoggerPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSystemLoggerPostParamsWithHTTPClient(client *http.Client) *SystemLoggerPostParams { + var () + return &SystemLoggerPostParams{ + HTTPClient: client, + } +} + +/* +SystemLoggerPostParams contains all the parameters to send to the API endpoint +for the system logger post operation typically these are written to a http.Request +*/ +type SystemLoggerPostParams struct { + + /*Level + The new log level + + */ + Level string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the system logger post params +func (o *SystemLoggerPostParams) WithTimeout(timeout time.Duration) *SystemLoggerPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the system logger post params +func (o *SystemLoggerPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the system logger post params +func (o *SystemLoggerPostParams) WithContext(ctx context.Context) *SystemLoggerPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the system logger post params +func (o *SystemLoggerPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the system logger post params +func (o *SystemLoggerPostParams) WithHTTPClient(client *http.Client) *SystemLoggerPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the system logger post params +func (o *SystemLoggerPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLevel adds the level to the system logger post params +func (o *SystemLoggerPostParams) WithLevel(level string) *SystemLoggerPostParams { + o.SetLevel(level) + return o +} + +// SetLevel adds the level to the system logger post params +func (o *SystemLoggerPostParams) SetLevel(level string) { + o.Level = level +} + +// WriteToRequest writes these params to a swagger request +func (o *SystemLoggerPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param level + qrLevel := o.Level + qLevel := qrLevel + if qLevel != "" { + if err := r.SetQueryParam("level", qLevel); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_post_responses.go new file mode 100644 index 0000000000..849bd9a313 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/system_logger_post_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// SystemLoggerPostReader is a Reader for the SystemLoggerPost structure. +type SystemLoggerPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SystemLoggerPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSystemLoggerPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSystemLoggerPostDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSystemLoggerPostOK creates a SystemLoggerPostOK with default headers values +func NewSystemLoggerPostOK() *SystemLoggerPostOK { + return &SystemLoggerPostOK{} +} + +/* +SystemLoggerPostOK handles this case with default header values. + +Success +*/ +type SystemLoggerPostOK struct { +} + +func (o *SystemLoggerPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewSystemLoggerPostDefault creates a SystemLoggerPostDefault with default headers values +func NewSystemLoggerPostDefault(code int) *SystemLoggerPostDefault { + return &SystemLoggerPostDefault{ + _statusCode: code, + } +} + +/* +SystemLoggerPostDefault handles this case with default header values. + +internal server error +*/ +type SystemLoggerPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the system logger post default response +func (o *SystemLoggerPostDefault) Code() int { + return o._statusCode +} + +func (o *SystemLoggerPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *SystemLoggerPostDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *SystemLoggerPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/scylla_v1_client.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/scylla_v1_client.go new file mode 100644 index 0000000000..593127d247 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/scylla_v1_client.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations" +) + +// Default scylla v1 HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "scylla-manager.magic.host" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new scylla v1 HTTP client. +func NewHTTPClient(formats strfmt.Registry) *ScyllaV1 { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new scylla v1 HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *ScyllaV1 { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new scylla v1 client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *ScyllaV1 { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(ScyllaV1) + cli.Transport = transport + cli.Operations = operations.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// ScyllaV1 is a client for scylla v1 +type ScyllaV1 struct { + Operations operations.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *ScyllaV1) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Operations.SetTransport(transport) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/collectd_metric_status.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/collectd_metric_status.go new file mode 100644 index 0000000000..d2b5d5961e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/collectd_metric_status.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CollectdMetricStatus collectd_metric_status +// +// # Holds a collectd id and an enable flag +// +// swagger:model collectd_metric_status +type CollectdMetricStatus struct { + + // Is the metric enabled + Enable bool `json:"enable,omitempty"` + + // id + ID *TypeInstanceID `json:"id,omitempty"` +} + +// Validate validates this collectd metric status +func (m *CollectdMetricStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CollectdMetricStatus) validateID(formats strfmt.Registry) error { + + if swag.IsZero(m.ID) { // not required + return nil + } + + if m.ID != nil { + if err := m.ID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("id") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CollectdMetricStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CollectdMetricStatus) UnmarshalBinary(b []byte) error { + var res CollectdMetricStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/collectd_value.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/collectd_value.go new file mode 100644 index 0000000000..ef166e52e2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/collectd_value.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CollectdValue collectd_value +// +// # Holds a collectd value +// +// swagger:model collectd_value +type CollectdValue struct { + + // An array of values + Values []interface{} `json:"values"` +} + +// Validate validates this collectd value +func (m *CollectdValue) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CollectdValue) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CollectdValue) UnmarshalBinary(b []byte) error { + var res CollectdValue + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/column_family_info.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/column_family_info.go new file mode 100644 index 0000000000..386b8b9908 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/column_family_info.go @@ -0,0 +1,51 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ColumnFamilyInfo column_family_info +// +// # Information about column family +// +// swagger:model column_family_info +type ColumnFamilyInfo struct { + + // The column family + Cf string `json:"cf,omitempty"` + + // The Keyspace + Ks string `json:"ks,omitempty"` + + // The column family type + Type string `json:"type,omitempty"` +} + +// Validate validates this column family info +func (m *ColumnFamilyInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ColumnFamilyInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ColumnFamilyInfo) UnmarshalBinary(b []byte) error { + var res ColumnFamilyInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/compaction_info.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/compaction_info.go new file mode 100644 index 0000000000..2595a70d3c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/compaction_info.go @@ -0,0 +1,54 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CompactionInfo compaction_info +// +// # A key value mapping +// +// swagger:model compaction_info +type CompactionInfo struct { + + // The current completed + Completed interface{} `json:"completed,omitempty"` + + // The operation type + OperationType string `json:"operation_type,omitempty"` + + // The total to compact + Total interface{} `json:"total,omitempty"` + + // The compacted unit + Unit string `json:"unit,omitempty"` +} + +// Validate validates this compaction info +func (m *CompactionInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CompactionInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CompactionInfo) UnmarshalBinary(b []byte) error { + var res CompactionInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/direction.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/direction.go new file mode 100644 index 0000000000..cdb2114628 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/direction.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// Direction Direction +// +// # The file name +// +// swagger:model Direction +type Direction string + +const ( + + // DirectionOUT captures enum value "OUT" + DirectionOUT Direction = "OUT" + + // DirectionIN captures enum value "IN" + DirectionIN Direction = "IN" +) + +// for schema +var directionEnum []interface{} + +func init() { + var res []Direction + if err := json.Unmarshal([]byte(`["OUT","IN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + directionEnum = append(directionEnum, v) + } +} + +func (m Direction) validateDirectionEnum(path, location string, value Direction) error { + if err := validate.EnumCase(path, location, value, directionEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this direction +func (m Direction) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateDirectionEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/endpoint_detail.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/endpoint_detail.go new file mode 100644 index 0000000000..3613a66da1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/endpoint_detail.go @@ -0,0 +1,51 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EndpointDetail endpoint_detail +// +// # Endpoint detail +// +// swagger:model endpoint_detail +type EndpointDetail struct { + + // The endpoint datacenter + Datacenter string `json:"datacenter,omitempty"` + + // The endpoint host + Host string `json:"host,omitempty"` + + // The endpoint rack + Rack string `json:"rack,omitempty"` +} + +// Validate validates this endpoint detail +func (m *EndpointDetail) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *EndpointDetail) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EndpointDetail) UnmarshalBinary(b []byte) error { + var res EndpointDetail + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/endpoint_phi_value.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/endpoint_phi_value.go new file mode 100644 index 0000000000..7476f83fda --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/endpoint_phi_value.go @@ -0,0 +1,48 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EndpointPhiValue endpoint_phi_value +// +// # Holds phi value for a single end point +// +// swagger:model endpoint_phi_value +type EndpointPhiValue struct { + + // end point address + Endpoint string `json:"endpoint,omitempty"` + + // Phi value + Phi interface{} `json:"phi,omitempty"` +} + +// Validate validates this endpoint phi value +func (m *EndpointPhiValue) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *EndpointPhiValue) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EndpointPhiValue) UnmarshalBinary(b []byte) error { + var res EndpointPhiValue + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/endpoint_state.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/endpoint_state.go new file mode 100644 index 0000000000..8b93814a6e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/endpoint_state.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EndpointState endpoint_state +// +// # Holds an endpoint state +// +// swagger:model endpoint_state +type EndpointState struct { + + // The endpoint address + Addrs string `json:"addrs,omitempty"` + + // Is the endpoint alive + ApplicationState []*VersionValue `json:"application_state"` + + // The heart beat generation + Generation int32 `json:"generation,omitempty"` + + // Is the endpoint alive + IsAlive bool `json:"is_alive,omitempty"` + + // The update timestamp + UpdateTime interface{} `json:"update_time,omitempty"` + + // The heart beat version + Version int32 `json:"version,omitempty"` +} + +// Validate validates this endpoint state +func (m *EndpointState) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApplicationState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EndpointState) validateApplicationState(formats strfmt.Registry) error { + + if swag.IsZero(m.ApplicationState) { // not required + return nil + } + + for i := 0; i < len(m.ApplicationState); i++ { + if swag.IsZero(m.ApplicationState[i]) { // not required + continue + } + + if m.ApplicationState[i] != nil { + if err := m.ApplicationState[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("application_state" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EndpointState) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EndpointState) UnmarshalBinary(b []byte) error { + var res EndpointState + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/error_model.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/error_model.go new file mode 100644 index 0000000000..9887571ce7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/error_model.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ErrorModel error model +// +// swagger:model ErrorModel +type ErrorModel struct { + + // code + Code int64 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` +} + +// Validate validates this error model +func (m *ErrorModel) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ErrorModel) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ErrorModel) UnmarshalBinary(b []byte) error { + var res ErrorModel + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/estimated_histogram.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/estimated_histogram.go new file mode 100644 index 0000000000..acccc928e0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/estimated_histogram.go @@ -0,0 +1,48 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EstimatedHistogram estimated_histogram +// +// # An estimated histogram values +// +// swagger:model estimated_histogram +type EstimatedHistogram struct { + + // The series of values to which the counts in `buckets` correspond + BucketOffsets []interface{} `json:"bucket_offsets"` + + // The histogram buckets + Buckets []interface{} `json:"buckets"` +} + +// Validate validates this estimated histogram +func (m *EstimatedHistogram) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *EstimatedHistogram) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EstimatedHistogram) UnmarshalBinary(b []byte) error { + var res EstimatedHistogram + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/histogram.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/histogram.go new file mode 100644 index 0000000000..54b8102a4c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/histogram.go @@ -0,0 +1,63 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Histogram histogram +// +// # A histogram values +// +// swagger:model histogram +type Histogram struct { + + // Total count so far + Count interface{} `json:"count,omitempty"` + + // The max so far + Max interface{} `json:"max,omitempty"` + + // The mean + Mean interface{} `json:"mean,omitempty"` + + // The min so far + Min interface{} `json:"min,omitempty"` + + // A sample containing the last n elements + Sample []interface{} `json:"sample"` + + // Total sum so far + Sum interface{} `json:"sum,omitempty"` + + // The variance + Variance interface{} `json:"variance,omitempty"` +} + +// Validate validates this histogram +func (m *Histogram) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Histogram) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Histogram) UnmarshalBinary(b []byte) error { + var res Histogram + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/history.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/history.go new file mode 100644 index 0000000000..3ea3fff627 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/history.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// History history +// +// # Compaction history information +// +// swagger:model history +type History struct { + + // Bytes in + BytesIn interface{} `json:"bytes_in,omitempty"` + + // Bytes out + BytesOut interface{} `json:"bytes_out,omitempty"` + + // The column family name + Cf string `json:"cf,omitempty"` + + // The time of compaction + CompactedAt interface{} `json:"compacted_at,omitempty"` + + // The UUID + ID string `json:"id,omitempty"` + + // The keyspace name + Ks string `json:"ks,omitempty"` + + // The merged rows + RowsMerged []*RowMerged `json:"rows_merged"` +} + +// Validate validates this history +func (m *History) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRowsMerged(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *History) validateRowsMerged(formats strfmt.Registry) error { + + if swag.IsZero(m.RowsMerged) { // not required + return nil + } + + for i := 0; i < len(m.RowsMerged); i++ { + if swag.IsZero(m.RowsMerged[i]) { // not required + continue + } + + if m.RowsMerged[i] != nil { + if err := m.RowsMerged[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rows_merged" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *History) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *History) UnmarshalBinary(b []byte) error { + var res History + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/level.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/level.go new file mode 100644 index 0000000000..038a049e2a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/level.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// Level level +// +// swagger:model level +type Level string + +const ( + + // LevelError captures enum value "error" + LevelError Level = "error" + + // LevelWarn captures enum value "warn" + LevelWarn Level = "warn" + + // LevelInfo captures enum value "info" + LevelInfo Level = "info" + + // LevelDebug captures enum value "debug" + LevelDebug Level = "debug" + + // LevelTrace captures enum value "trace" + LevelTrace Level = "trace" +) + +// for schema +var levelEnum []interface{} + +func init() { + var res []Level + if err := json.Unmarshal([]byte(`["error","warn","info","debug","trace"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + levelEnum = append(levelEnum, v) + } +} + +func (m Level) validateLevelEnum(path, location string, value Level) error { + if err := validate.EnumCase(path, location, value, levelEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this level +func (m Level) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateLevelEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/map_string_double.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/map_string_double.go new file mode 100644 index 0000000000..133adcb96c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/map_string_double.go @@ -0,0 +1,48 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MapStringDouble map_string_double +// +// # A key value mapping between a string and a double +// +// swagger:model map_string_double +type MapStringDouble struct { + + // The key + Key string `json:"key,omitempty"` + + // The value + Value interface{} `json:"value,omitempty"` +} + +// Validate validates this map string double +func (m *MapStringDouble) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MapStringDouble) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MapStringDouble) UnmarshalBinary(b []byte) error { + var res MapStringDouble + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/maplist_mapper.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/maplist_mapper.go new file mode 100644 index 0000000000..9d8950b968 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/maplist_mapper.go @@ -0,0 +1,48 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MaplistMapper maplist_mapper +// +// # A key value mapping, where key and value are list +// +// swagger:model maplist_mapper +type MaplistMapper struct { + + // The key + Key []string `json:"key"` + + // The value + Value []string `json:"value"` +} + +// Validate validates this maplist mapper +func (m *MaplistMapper) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MaplistMapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MaplistMapper) UnmarshalBinary(b []byte) error { + var res MaplistMapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/mapper.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/mapper.go new file mode 100644 index 0000000000..f7b7426538 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/mapper.go @@ -0,0 +1,48 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Mapper mapper +// +// # A key value mapping +// +// swagger:model mapper +type Mapper struct { + + // The key + Key string `json:"key,omitempty"` + + // The value + Value string `json:"value,omitempty"` +} + +// Validate validates this mapper +func (m *Mapper) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Mapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Mapper) UnmarshalBinary(b []byte) error { + var res Mapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/mapper_list.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/mapper_list.go new file mode 100644 index 0000000000..63295b8850 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/mapper_list.go @@ -0,0 +1,48 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MapperList mapper_list +// +// # Holds a key value which is a list +// +// swagger:model mapper_list +type MapperList struct { + + // The key + Key string `json:"key,omitempty"` + + // The value + Value []string `json:"value"` +} + +// Validate validates this mapper list +func (m *MapperList) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MapperList) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MapperList) UnmarshalBinary(b []byte) error { + var res MapperList + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/message_counter.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/message_counter.go new file mode 100644 index 0000000000..03f07f79a9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/message_counter.go @@ -0,0 +1,48 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MessageCounter message_counter +// +// # Holds command counters +// +// swagger:model message_counter +type MessageCounter struct { + + // key + Key string `json:"key,omitempty"` + + // value + Value interface{} `json:"value,omitempty"` +} + +// Validate validates this message counter +func (m *MessageCounter) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MessageCounter) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MessageCounter) UnmarshalBinary(b []byte) error { + var res MessageCounter + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/progress_info.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/progress_info.go new file mode 100644 index 0000000000..bf4028c313 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/progress_info.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProgressInfo progress_info +// +// # File transfer progress +// +// swagger:model progress_info +type ProgressInfo struct { + + // The current bytes + CurrentBytes interface{} `json:"current_bytes,omitempty"` + + // direction + Direction Direction `json:"direction,omitempty"` + + // The file name + FileName string `json:"file_name,omitempty"` + + // The peer address + Peer string `json:"peer,omitempty"` + + // The session index + SessionIndex int32 `json:"session_index,omitempty"` + + // The total bytes + TotalBytes interface{} `json:"total_bytes,omitempty"` +} + +// Validate validates this progress info +func (m *ProgressInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDirection(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProgressInfo) validateDirection(formats strfmt.Registry) error { + + if swag.IsZero(m.Direction) { // not required + return nil + } + + if err := m.Direction.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("direction") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProgressInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProgressInfo) UnmarshalBinary(b []byte) error { + var res ProgressInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/progress_info_mapper.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/progress_info_mapper.go new file mode 100644 index 0000000000..92a1d86c8a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/progress_info_mapper.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProgressInfoMapper progress_info_mapper +// +// # A mapping between file and its progress info +// +// swagger:model progress_info_mapper +type ProgressInfoMapper struct { + + // The key + Key string `json:"key,omitempty"` + + // value + Value *ProgressInfo `json:"value,omitempty"` +} + +// Validate validates this progress info mapper +func (m *ProgressInfoMapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProgressInfoMapper) validateValue(formats strfmt.Registry) error { + + if swag.IsZero(m.Value) { // not required + return nil + } + + if m.Value != nil { + if err := m.Value.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("value") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProgressInfoMapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProgressInfoMapper) UnmarshalBinary(b []byte) error { + var res ProgressInfoMapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/rate_moving_average.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/rate_moving_average.go new file mode 100644 index 0000000000..93eeb6173d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/rate_moving_average.go @@ -0,0 +1,51 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RateMovingAverage rate_moving_average +// +// # A meter metric which measures mean throughput and one, five, and fifteen-minute exponentially-weighted moving average throughputs +// +// swagger:model rate_moving_average +type RateMovingAverage struct { + + // Total number of events from startup + Count interface{} `json:"count,omitempty"` + + // The mean rate from startup + MeanRate interface{} `json:"mean_rate,omitempty"` + + // One, five and fifteen mintues rates + Rates []interface{} `json:"rates"` +} + +// Validate validates this rate moving average +func (m *RateMovingAverage) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RateMovingAverage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RateMovingAverage) UnmarshalBinary(b []byte) error { + var res RateMovingAverage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/rate_moving_average_and_histogram.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/rate_moving_average_and_histogram.go new file mode 100644 index 0000000000..5b5a527016 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/rate_moving_average_and_histogram.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RateMovingAverageAndHistogram rate_moving_average_and_histogram +// +// # A timer metric which aggregates timing durations and provides duration statistics, plus throughput statistics +// +// swagger:model rate_moving_average_and_histogram +type RateMovingAverageAndHistogram struct { + + // hist + Hist *Histogram `json:"hist,omitempty"` + + // meter + Meter *RateMovingAverage `json:"meter,omitempty"` +} + +// Validate validates this rate moving average and histogram +func (m *RateMovingAverageAndHistogram) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHist(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeter(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RateMovingAverageAndHistogram) validateHist(formats strfmt.Registry) error { + + if swag.IsZero(m.Hist) { // not required + return nil + } + + if m.Hist != nil { + if err := m.Hist.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hist") + } + return err + } + } + + return nil +} + +func (m *RateMovingAverageAndHistogram) validateMeter(formats strfmt.Registry) error { + + if swag.IsZero(m.Meter) { // not required + return nil + } + + if m.Meter != nil { + if err := m.Meter.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meter") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RateMovingAverageAndHistogram) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RateMovingAverageAndHistogram) UnmarshalBinary(b []byte) error { + var res RateMovingAverageAndHistogram + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/repair_async_status_response.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/repair_async_status_response.go new file mode 100644 index 0000000000..3277746666 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/repair_async_status_response.go @@ -0,0 +1,66 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// RepairAsyncStatusResponse repair_async_statusResponse +// +// swagger:model repair_async_statusResponse +type RepairAsyncStatusResponse string + +const ( + + // RepairAsyncStatusResponseRUNNING captures enum value "RUNNING" + RepairAsyncStatusResponseRUNNING RepairAsyncStatusResponse = "RUNNING" + + // RepairAsyncStatusResponseSUCCESSFUL captures enum value "SUCCESSFUL" + RepairAsyncStatusResponseSUCCESSFUL RepairAsyncStatusResponse = "SUCCESSFUL" + + // RepairAsyncStatusResponseFAILED captures enum value "FAILED" + RepairAsyncStatusResponseFAILED RepairAsyncStatusResponse = "FAILED" +) + +// for schema +var repairAsyncStatusResponseEnum []interface{} + +func init() { + var res []RepairAsyncStatusResponse + if err := json.Unmarshal([]byte(`["RUNNING","SUCCESSFUL","FAILED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + repairAsyncStatusResponseEnum = append(repairAsyncStatusResponseEnum, v) + } +} + +func (m RepairAsyncStatusResponse) validateRepairAsyncStatusResponseEnum(path, location string, value RepairAsyncStatusResponse) error { + if err := validate.EnumCase(path, location, value, repairAsyncStatusResponseEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this repair async status response +func (m RepairAsyncStatusResponse) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateRepairAsyncStatusResponseEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/row_merged.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/row_merged.go new file mode 100644 index 0000000000..f24f950ba8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/row_merged.go @@ -0,0 +1,48 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RowMerged row_merged +// +// # A row merged information +// +// swagger:model row_merged +type RowMerged struct { + + // The number of sstable + Key int32 `json:"key,omitempty"` + + // The number or row compacted + Value interface{} `json:"value,omitempty"` +} + +// Validate validates this row merged +func (m *RowMerged) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RowMerged) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RowMerged) UnmarshalBinary(b []byte) error { + var res RowMerged + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/slow_query_info.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/slow_query_info.go new file mode 100644 index 0000000000..1b0d9ffb31 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/slow_query_info.go @@ -0,0 +1,51 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SlowQueryInfo slow_query_info +// +// # Slow query triggering information +// +// swagger:model slow_query_info +type SlowQueryInfo struct { + + // Is slow query logging enable or disable + Enable bool `json:"enable,omitempty"` + + // The slow query logging threshold in microseconds. Queries that takes longer, will be logged + Threshold interface{} `json:"threshold,omitempty"` + + // The slow query TTL in seconds + TTL interface{} `json:"ttl,omitempty"` +} + +// Validate validates this slow query info +func (m *SlowQueryInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SlowQueryInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SlowQueryInfo) UnmarshalBinary(b []byte) error { + var res SlowQueryInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/snapshot.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/snapshot.go new file mode 100644 index 0000000000..f3cdcc1a9f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/snapshot.go @@ -0,0 +1,54 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Snapshot snapshot +// +// # Snapshot detail +// +// swagger:model snapshot +type Snapshot struct { + + // The column family + Cf string `json:"cf,omitempty"` + + // The key space snapshot key + Ks string `json:"ks,omitempty"` + + // The live snapshot size + Live interface{} `json:"live,omitempty"` + + // The total snapshot size + Total interface{} `json:"total,omitempty"` +} + +// Validate validates this snapshot +func (m *Snapshot) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Snapshot) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Snapshot) UnmarshalBinary(b []byte) error { + var res Snapshot + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/snapshots.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/snapshots.go new file mode 100644 index 0000000000..b2964b65ef --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/snapshots.go @@ -0,0 +1,85 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Snapshots snapshots +// +// # List of Snapshot detail +// +// swagger:model snapshots +type Snapshots struct { + + // The snapshot key + Key string `json:"key,omitempty"` + + // The column family + Value []*Snapshot `json:"value"` +} + +// Validate validates this snapshots +func (m *Snapshots) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Snapshots) validateValue(formats strfmt.Registry) error { + + if swag.IsZero(m.Value) { // not required + return nil + } + + for i := 0; i < len(m.Value); i++ { + if swag.IsZero(m.Value[i]) { // not required + continue + } + + if m.Value[i] != nil { + if err := m.Value[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("value" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Snapshots) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Snapshots) UnmarshalBinary(b []byte) error { + var res Snapshots + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/state.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/state.go new file mode 100644 index 0000000000..15e50640a5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/state.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// State State +// +// # Current session state +// +// swagger:model State +type State string + +const ( + + // StateINITIALIZED captures enum value "INITIALIZED" + StateINITIALIZED State = "INITIALIZED" + + // StatePREPARING captures enum value "PREPARING" + StatePREPARING State = "PREPARING" + + // StateSTREAMING captures enum value "STREAMING" + StateSTREAMING State = "STREAMING" + + // StateWAITCOMPLETE captures enum value "WAIT_COMPLETE" + StateWAITCOMPLETE State = "WAIT_COMPLETE" + + // StateCOMPLETE captures enum value "COMPLETE" + StateCOMPLETE State = "COMPLETE" + + // StateFAILED captures enum value "FAILED" + StateFAILED State = "FAILED" +) + +// for schema +var stateEnum []interface{} + +func init() { + var res []State + if err := json.Unmarshal([]byte(`["INITIALIZED","PREPARING","STREAMING","WAIT_COMPLETE","COMPLETE","FAILED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + stateEnum = append(stateEnum, v) + } +} + +func (m State) validateStateEnum(path, location string, value State) error { + if err := validate.EnumCase(path, location, value, stateEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this state +func (m State) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateStateEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/stream_info.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/stream_info.go new file mode 100644 index 0000000000..11000e7d41 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/stream_info.go @@ -0,0 +1,210 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// StreamInfo stream_info +// +// # Stream session info +// +// swagger:model stream_info +type StreamInfo struct { + + // connecting + Connecting string `json:"connecting,omitempty"` + + // The peer + Peer string `json:"peer,omitempty"` + + // Receiving files + ReceivingFiles []*ProgressInfoMapper `json:"receiving_files"` + + // Receiving summaries + ReceivingSummaries []*StreamSummary `json:"receiving_summaries"` + + // Sending files + SendingFiles []*ProgressInfoMapper `json:"sending_files"` + + // Sending summaries + SendingSummaries []*StreamSummary `json:"sending_summaries"` + + // The session index + SessionIndex int32 `json:"session_index,omitempty"` + + // state + State State `json:"state,omitempty"` +} + +// Validate validates this stream info +func (m *StreamInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateReceivingFiles(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReceivingSummaries(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSendingFiles(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSendingSummaries(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StreamInfo) validateReceivingFiles(formats strfmt.Registry) error { + + if swag.IsZero(m.ReceivingFiles) { // not required + return nil + } + + for i := 0; i < len(m.ReceivingFiles); i++ { + if swag.IsZero(m.ReceivingFiles[i]) { // not required + continue + } + + if m.ReceivingFiles[i] != nil { + if err := m.ReceivingFiles[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("receiving_files" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *StreamInfo) validateReceivingSummaries(formats strfmt.Registry) error { + + if swag.IsZero(m.ReceivingSummaries) { // not required + return nil + } + + for i := 0; i < len(m.ReceivingSummaries); i++ { + if swag.IsZero(m.ReceivingSummaries[i]) { // not required + continue + } + + if m.ReceivingSummaries[i] != nil { + if err := m.ReceivingSummaries[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("receiving_summaries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *StreamInfo) validateSendingFiles(formats strfmt.Registry) error { + + if swag.IsZero(m.SendingFiles) { // not required + return nil + } + + for i := 0; i < len(m.SendingFiles); i++ { + if swag.IsZero(m.SendingFiles[i]) { // not required + continue + } + + if m.SendingFiles[i] != nil { + if err := m.SendingFiles[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sending_files" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *StreamInfo) validateSendingSummaries(formats strfmt.Registry) error { + + if swag.IsZero(m.SendingSummaries) { // not required + return nil + } + + for i := 0; i < len(m.SendingSummaries); i++ { + if swag.IsZero(m.SendingSummaries[i]) { // not required + continue + } + + if m.SendingSummaries[i] != nil { + if err := m.SendingSummaries[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sending_summaries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *StreamInfo) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *StreamInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StreamInfo) UnmarshalBinary(b []byte) error { + var res StreamInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/stream_state.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/stream_state.go new file mode 100644 index 0000000000..b9ace137ba --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/stream_state.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// StreamState stream_state +// +// # Current snapshot of streaming progress +// +// swagger:model stream_state +type StreamState struct { + + // The stream description + Description string `json:"description,omitempty"` + + // Plan UUID + PlanID string `json:"plan_id,omitempty"` + + // The sessions info + Sessions []*StreamInfo `json:"sessions"` +} + +// Validate validates this stream state +func (m *StreamState) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSessions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StreamState) validateSessions(formats strfmt.Registry) error { + + if swag.IsZero(m.Sessions) { // not required + return nil + } + + for i := 0; i < len(m.Sessions); i++ { + if swag.IsZero(m.Sessions[i]) { // not required + continue + } + + if m.Sessions[i] != nil { + if err := m.Sessions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sessions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *StreamState) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StreamState) UnmarshalBinary(b []byte) error { + var res StreamState + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/stream_summary.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/stream_summary.go new file mode 100644 index 0000000000..af9165a576 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/stream_summary.go @@ -0,0 +1,51 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// StreamSummary stream_summary +// +// # Stream summary info +// +// swagger:model stream_summary +type StreamSummary struct { + + // The ID + CfID string `json:"cf_id,omitempty"` + + // Number of files to transfer. Can be 0 if nothing to transfer for some streaming request. + Files int32 `json:"files,omitempty"` + + // total size + TotalSize interface{} `json:"total_size,omitempty"` +} + +// Validate validates this stream summary +func (m *StreamSummary) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *StreamSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StreamSummary) UnmarshalBinary(b []byte) error { + var res StreamSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/summary.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/summary.go new file mode 100644 index 0000000000..9dddef8016 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/summary.go @@ -0,0 +1,63 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Summary summary +// +// # A compaction summary object +// +// swagger:model summary +type Summary struct { + + // The column family name + Cf string `json:"cf,omitempty"` + + // The number of units completed + Completed interface{} `json:"completed,omitempty"` + + // The UUID + ID string `json:"id,omitempty"` + + // The keyspace name + Ks string `json:"ks,omitempty"` + + // The task compaction type + TaskType string `json:"task_type,omitempty"` + + // The total number of units + Total interface{} `json:"total,omitempty"` + + // The units being used + Unit string `json:"unit,omitempty"` +} + +// Validate validates this summary +func (m *Summary) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Summary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Summary) UnmarshalBinary(b []byte) error { + var res Summary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/token_range.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/token_range.go new file mode 100644 index 0000000000..3b05b32d47 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/token_range.go @@ -0,0 +1,94 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TokenRange token_range +// +// # Endpoint range information +// +// swagger:model token_range +type TokenRange struct { + + // The range start token + EndToken string `json:"end_token,omitempty"` + + // The endpoint details + EndpointDetails []*EndpointDetail `json:"endpoint_details"` + + // The endpoints + Endpoints []string `json:"endpoints"` + + // The rpc endpoints + RPCEndpoints []string `json:"rpc_endpoints"` + + // The range start token + StartToken string `json:"start_token,omitempty"` +} + +// Validate validates this token range +func (m *TokenRange) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEndpointDetails(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TokenRange) validateEndpointDetails(formats strfmt.Registry) error { + + if swag.IsZero(m.EndpointDetails) { // not required + return nil + } + + for i := 0; i < len(m.EndpointDetails); i++ { + if swag.IsZero(m.EndpointDetails[i]) { // not required + continue + } + + if m.EndpointDetails[i] != nil { + if err := m.EndpointDetails[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("endpoint_details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TokenRange) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TokenRange) UnmarshalBinary(b []byte) error { + var res TokenRange + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/type.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/type.go new file mode 100644 index 0000000000..14acdb8d31 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/type.go @@ -0,0 +1,66 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// Type type +// +// swagger:model type +type Type string + +const ( + + // TypeAll captures enum value "all" + TypeAll Type = "all" + + // TypeUser captures enum value "user" + TypeUser Type = "user" + + // TypeNonLocalStrategy captures enum value "non_local_strategy" + TypeNonLocalStrategy Type = "non_local_strategy" +) + +// for schema +var typeEnum []interface{} + +func init() { + var res []Type + if err := json.Unmarshal([]byte(`["all","user","non_local_strategy"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + typeEnum = append(typeEnum, v) + } +} + +func (m Type) validateTypeEnum(path, location string, value Type) error { + if err := validate.EnumCase(path, location, value, typeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this type +func (m Type) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/type_instance_id.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/type_instance_id.go new file mode 100644 index 0000000000..dd00aa469d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/type_instance_id.go @@ -0,0 +1,54 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TypeInstanceID type_instance_id +// +// # A type instance ID +// +// swagger:model type_instance_id +type TypeInstanceID struct { + + // The plugin ID + Plugin string `json:"plugin,omitempty"` + + // The plugin instance + PluginInstance string `json:"plugin_instance,omitempty"` + + // The plugin type + Type string `json:"type,omitempty"` + + // The plugin type instance + TypeInstance string `json:"type_instance,omitempty"` +} + +// Validate validates this type instance id +func (m *TypeInstanceID) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TypeInstanceID) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TypeInstanceID) UnmarshalBinary(b []byte) error { + var res TypeInstanceID + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/verb.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/verb.go new file mode 100644 index 0000000000..83fe15ea2c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/verb.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// Verb Verb +// +// swagger:model Verb +type Verb string + +const ( + + // VerbCLIENTID captures enum value "CLIENT_ID" + VerbCLIENTID Verb = "CLIENT_ID" + + // VerbMUTATION captures enum value "MUTATION" + VerbMUTATION Verb = "MUTATION" + + // VerbMUTATIONDONE captures enum value "MUTATION_DONE" + VerbMUTATIONDONE Verb = "MUTATION_DONE" + + // VerbREADDATA captures enum value "READ_DATA" + VerbREADDATA Verb = "READ_DATA" + + // VerbREADMUTATIONDATA captures enum value "READ_MUTATION_DATA" + VerbREADMUTATIONDATA Verb = "READ_MUTATION_DATA" + + // VerbREADDIGEST captures enum value "READ_DIGEST" + VerbREADDIGEST Verb = "READ_DIGEST" + + // VerbGOSSIPECHO captures enum value "GOSSIP_ECHO" + VerbGOSSIPECHO Verb = "GOSSIP_ECHO" + + // VerbGOSSIPDIGESTSYN captures enum value "GOSSIP_DIGEST_SYN" + VerbGOSSIPDIGESTSYN Verb = "GOSSIP_DIGEST_SYN" + + // VerbGOSSIPDIGESTACK2 captures enum value "GOSSIP_DIGEST_ACK2" + VerbGOSSIPDIGESTACK2 Verb = "GOSSIP_DIGEST_ACK2" + + // VerbGOSSIPSHUTDOWN captures enum value "GOSSIP_SHUTDOWN" + VerbGOSSIPSHUTDOWN Verb = "GOSSIP_SHUTDOWN" + + // VerbDEFINITIONSUPDATE captures enum value "DEFINITIONS_UPDATE" + VerbDEFINITIONSUPDATE Verb = "DEFINITIONS_UPDATE" + + // VerbTRUNCATE captures enum value "TRUNCATE" + VerbTRUNCATE Verb = "TRUNCATE" + + // VerbREPLICATIONFINISHED captures enum value "REPLICATION_FINISHED" + VerbREPLICATIONFINISHED Verb = "REPLICATION_FINISHED" + + // VerbMIGRATIONREQUEST captures enum value "MIGRATION_REQUEST" + VerbMIGRATIONREQUEST Verb = "MIGRATION_REQUEST" + + // VerbPREPAREMESSAGE captures enum value "PREPARE_MESSAGE" + VerbPREPAREMESSAGE Verb = "PREPARE_MESSAGE" + + // VerbPREPAREDONEMESSAGE captures enum value "PREPARE_DONE_MESSAGE" + VerbPREPAREDONEMESSAGE Verb = "PREPARE_DONE_MESSAGE" + + // VerbSTREAMMUTATION captures enum value "STREAM_MUTATION" + VerbSTREAMMUTATION Verb = "STREAM_MUTATION" + + // VerbSTREAMMUTATIONDONE captures enum value "STREAM_MUTATION_DONE" + VerbSTREAMMUTATIONDONE Verb = "STREAM_MUTATION_DONE" + + // VerbCOMPLETEMESSAGE captures enum value "COMPLETE_MESSAGE" + VerbCOMPLETEMESSAGE Verb = "COMPLETE_MESSAGE" + + // VerbREPAIRCHECKSUMRANGE captures enum value "REPAIR_CHECKSUM_RANGE" + VerbREPAIRCHECKSUMRANGE Verb = "REPAIR_CHECKSUM_RANGE" + + // VerbGETSCHEMAVERSION captures enum value "GET_SCHEMA_VERSION" + VerbGETSCHEMAVERSION Verb = "GET_SCHEMA_VERSION" +) + +// for schema +var verbEnum []interface{} + +func init() { + var res []Verb + if err := json.Unmarshal([]byte(`["CLIENT_ID","MUTATION","MUTATION_DONE","READ_DATA","READ_MUTATION_DATA","READ_DIGEST","GOSSIP_ECHO","GOSSIP_DIGEST_SYN","GOSSIP_DIGEST_ACK2","GOSSIP_SHUTDOWN","DEFINITIONS_UPDATE","TRUNCATE","REPLICATION_FINISHED","MIGRATION_REQUEST","PREPARE_MESSAGE","PREPARE_DONE_MESSAGE","STREAM_MUTATION","STREAM_MUTATION_DONE","COMPLETE_MESSAGE","REPAIR_CHECKSUM_RANGE","GET_SCHEMA_VERSION"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + verbEnum = append(verbEnum, v) + } +} + +func (m Verb) validateVerbEnum(path, location string, value Verb) error { + if err := validate.EnumCase(path, location, value, verbEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this verb +func (m Verb) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateVerbEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/verb_counter.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/verb_counter.go new file mode 100644 index 0000000000..7da0ed9318 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/verb_counter.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VerbCounter verb_counter +// +// # Holds verb counters +// +// swagger:model verb_counter +type VerbCounter struct { + + // count + Count interface{} `json:"count,omitempty"` + + // verb + Verb Verb `json:"verb,omitempty"` +} + +// Validate validates this verb counter +func (m *VerbCounter) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateVerb(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VerbCounter) validateVerb(formats strfmt.Registry) error { + + if swag.IsZero(m.Verb) { // not required + return nil + } + + if err := m.Verb.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("verb") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VerbCounter) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VerbCounter) UnmarshalBinary(b []byte) error { + var res VerbCounter + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/version_value.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/version_value.go new file mode 100644 index 0000000000..4f54d28e0b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/version_value.go @@ -0,0 +1,51 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VersionValue version_value +// +// # Holds a version value for an application state +// +// swagger:model version_value +type VersionValue struct { + + // The application state enum index + ApplicationState int32 `json:"application_state,omitempty"` + + // The version value + Value string `json:"value,omitempty"` + + // The application state version + Version int32 `json:"version,omitempty"` +} + +// Validate validates this version value +func (m *VersionValue) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VersionValue) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VersionValue) UnmarshalBinary(b []byte) error { + var res VersionValue + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/config_client.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/config_client.go new file mode 100644 index 0000000000..2933fced0a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/config_client.go @@ -0,0 +1,6652 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new config API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for config API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + FindConfigAbortOnLsaBadAlloc(params *FindConfigAbortOnLsaBadAllocParams) (*FindConfigAbortOnLsaBadAllocOK, error) + + FindConfigAlternatorAddress(params *FindConfigAlternatorAddressParams) (*FindConfigAlternatorAddressOK, error) + + FindConfigAlternatorEnforceAuthorization(params *FindConfigAlternatorEnforceAuthorizationParams) (*FindConfigAlternatorEnforceAuthorizationOK, error) + + FindConfigAlternatorHTTPSPort(params *FindConfigAlternatorHTTPSPortParams) (*FindConfigAlternatorHTTPSPortOK, error) + + FindConfigAlternatorPort(params *FindConfigAlternatorPortParams) (*FindConfigAlternatorPortOK, error) + + FindConfigAPIAddress(params *FindConfigAPIAddressParams) (*FindConfigAPIAddressOK, error) + + FindConfigAPIDocDir(params *FindConfigAPIDocDirParams) (*FindConfigAPIDocDirOK, error) + + FindConfigAPIPort(params *FindConfigAPIPortParams) (*FindConfigAPIPortOK, error) + + FindConfigAPIUIDir(params *FindConfigAPIUIDirParams) (*FindConfigAPIUIDirOK, error) + + FindConfigAuthenticator(params *FindConfigAuthenticatorParams) (*FindConfigAuthenticatorOK, error) + + FindConfigAuthorizer(params *FindConfigAuthorizerParams) (*FindConfigAuthorizerOK, error) + + FindConfigAutoAdjustFlushQuota(params *FindConfigAutoAdjustFlushQuotaParams) (*FindConfigAutoAdjustFlushQuotaOK, error) + + FindConfigAutoBootstrap(params *FindConfigAutoBootstrapParams) (*FindConfigAutoBootstrapOK, error) + + FindConfigAutoSnapshot(params *FindConfigAutoSnapshotParams) (*FindConfigAutoSnapshotOK, error) + + FindConfigBackgroundWriterSchedulingQuota(params *FindConfigBackgroundWriterSchedulingQuotaParams) (*FindConfigBackgroundWriterSchedulingQuotaOK, error) + + FindConfigBatchSizeFailThresholdInKb(params *FindConfigBatchSizeFailThresholdInKbParams) (*FindConfigBatchSizeFailThresholdInKbOK, error) + + FindConfigBatchSizeWarnThresholdInKb(params *FindConfigBatchSizeWarnThresholdInKbParams) (*FindConfigBatchSizeWarnThresholdInKbOK, error) + + FindConfigBatchlogReplayThrottleInKb(params *FindConfigBatchlogReplayThrottleInKbParams) (*FindConfigBatchlogReplayThrottleInKbOK, error) + + FindConfigBroadcastAddress(params *FindConfigBroadcastAddressParams) (*FindConfigBroadcastAddressOK, error) + + FindConfigBroadcastRPCAddress(params *FindConfigBroadcastRPCAddressParams) (*FindConfigBroadcastRPCAddressOK, error) + + FindConfigCacheHitRateReadBalancing(params *FindConfigCacheHitRateReadBalancingParams) (*FindConfigCacheHitRateReadBalancingOK, error) + + FindConfigCasContentionTimeoutInMs(params *FindConfigCasContentionTimeoutInMsParams) (*FindConfigCasContentionTimeoutInMsOK, error) + + FindConfigClientEncryptionOptions(params *FindConfigClientEncryptionOptionsParams) (*FindConfigClientEncryptionOptionsOK, error) + + FindConfigClusterName(params *FindConfigClusterNameParams) (*FindConfigClusterNameOK, error) + + FindConfigColumnIndexSizeInKb(params *FindConfigColumnIndexSizeInKbParams) (*FindConfigColumnIndexSizeInKbOK, error) + + FindConfigCommitFailurePolicy(params *FindConfigCommitFailurePolicyParams) (*FindConfigCommitFailurePolicyOK, error) + + FindConfigCommitlogDirectory(params *FindConfigCommitlogDirectoryParams) (*FindConfigCommitlogDirectoryOK, error) + + FindConfigCommitlogReuseSegments(params *FindConfigCommitlogReuseSegmentsParams) (*FindConfigCommitlogReuseSegmentsOK, error) + + FindConfigCommitlogSegmentSizeInMb(params *FindConfigCommitlogSegmentSizeInMbParams) (*FindConfigCommitlogSegmentSizeInMbOK, error) + + FindConfigCommitlogSync(params *FindConfigCommitlogSyncParams) (*FindConfigCommitlogSyncOK, error) + + FindConfigCommitlogSyncBatchWindowInMs(params *FindConfigCommitlogSyncBatchWindowInMsParams) (*FindConfigCommitlogSyncBatchWindowInMsOK, error) + + FindConfigCommitlogSyncPeriodInMs(params *FindConfigCommitlogSyncPeriodInMsParams) (*FindConfigCommitlogSyncPeriodInMsOK, error) + + FindConfigCommitlogTotalSpaceInMb(params *FindConfigCommitlogTotalSpaceInMbParams) (*FindConfigCommitlogTotalSpaceInMbOK, error) + + FindConfigCommitlogUseoDsync(params *FindConfigCommitlogUseoDsyncParams) (*FindConfigCommitlogUseODsyncOK, error) + + FindConfigCompactionEnforceMinThreshold(params *FindConfigCompactionEnforceMinThresholdParams) (*FindConfigCompactionEnforceMinThresholdOK, error) + + FindConfigCompactionLargeCellWarningThresholdMb(params *FindConfigCompactionLargeCellWarningThresholdMbParams) (*FindConfigCompactionLargeCellWarningThresholdMbOK, error) + + FindConfigCompactionLargePartitionWarningThresholdMb(params *FindConfigCompactionLargePartitionWarningThresholdMbParams) (*FindConfigCompactionLargePartitionWarningThresholdMbOK, error) + + FindConfigCompactionLargeRowWarningThresholdMb(params *FindConfigCompactionLargeRowWarningThresholdMbParams) (*FindConfigCompactionLargeRowWarningThresholdMbOK, error) + + FindConfigCompactionPreheatKeyCache(params *FindConfigCompactionPreheatKeyCacheParams) (*FindConfigCompactionPreheatKeyCacheOK, error) + + FindConfigCompactionRowsCountWarningThreshold(params *FindConfigCompactionRowsCountWarningThresholdParams) (*FindConfigCompactionRowsCountWarningThresholdOK, error) + + FindConfigCompactionStaticShares(params *FindConfigCompactionStaticSharesParams) (*FindConfigCompactionStaticSharesOK, error) + + FindConfigCompactionThroughputMbPerSec(params *FindConfigCompactionThroughputMbPerSecParams) (*FindConfigCompactionThroughputMbPerSecOK, error) + + FindConfigConcurrentCompactors(params *FindConfigConcurrentCompactorsParams) (*FindConfigConcurrentCompactorsOK, error) + + FindConfigConcurrentCounterWrites(params *FindConfigConcurrentCounterWritesParams) (*FindConfigConcurrentCounterWritesOK, error) + + FindConfigConcurrentReads(params *FindConfigConcurrentReadsParams) (*FindConfigConcurrentReadsOK, error) + + FindConfigConcurrentWrites(params *FindConfigConcurrentWritesParams) (*FindConfigConcurrentWritesOK, error) + + FindConfigConsistentClusterManagement(params *FindConfigConsistentClusterManagementParams) (*FindConfigConsistentClusterManagementOK, error) + + FindConfigConsistentRangemovement(params *FindConfigConsistentRangemovementParams) (*FindConfigConsistentRangemovementOK, error) + + FindConfigCounterCacheKeysToSave(params *FindConfigCounterCacheKeysToSaveParams) (*FindConfigCounterCacheKeysToSaveOK, error) + + FindConfigCounterCacheSavePeriod(params *FindConfigCounterCacheSavePeriodParams) (*FindConfigCounterCacheSavePeriodOK, error) + + FindConfigCounterCacheSizeInMb(params *FindConfigCounterCacheSizeInMbParams) (*FindConfigCounterCacheSizeInMbOK, error) + + FindConfigCounterWriteRequestTimeoutInMs(params *FindConfigCounterWriteRequestTimeoutInMsParams) (*FindConfigCounterWriteRequestTimeoutInMsOK, error) + + FindConfigCPUScheduler(params *FindConfigCPUSchedulerParams) (*FindConfigCPUSchedulerOK, error) + + FindConfigCrossNodeTimeout(params *FindConfigCrossNodeTimeoutParams) (*FindConfigCrossNodeTimeoutOK, error) + + FindConfigDataFileDirectories(params *FindConfigDataFileDirectoriesParams) (*FindConfigDataFileDirectoriesOK, error) + + FindConfigDefaultLogLevel(params *FindConfigDefaultLogLevelParams) (*FindConfigDefaultLogLevelOK, error) + + FindConfigDefragmentMemoryOnIdle(params *FindConfigDefragmentMemoryOnIdleParams) (*FindConfigDefragmentMemoryOnIdleOK, error) + + FindConfigDeveloperMode(params *FindConfigDeveloperModeParams) (*FindConfigDeveloperModeOK, error) + + FindConfigDiskFailurePolicy(params *FindConfigDiskFailurePolicyParams) (*FindConfigDiskFailurePolicyOK, error) + + FindConfigDynamicSnitchBadnessThreshold(params *FindConfigDynamicSnitchBadnessThresholdParams) (*FindConfigDynamicSnitchBadnessThresholdOK, error) + + FindConfigDynamicSnitchResetIntervalInMs(params *FindConfigDynamicSnitchResetIntervalInMsParams) (*FindConfigDynamicSnitchResetIntervalInMsOK, error) + + FindConfigDynamicSnitchUpdateIntervalInMs(params *FindConfigDynamicSnitchUpdateIntervalInMsParams) (*FindConfigDynamicSnitchUpdateIntervalInMsOK, error) + + FindConfigEnableCache(params *FindConfigEnableCacheParams) (*FindConfigEnableCacheOK, error) + + FindConfigEnableCommitlog(params *FindConfigEnableCommitlogParams) (*FindConfigEnableCommitlogOK, error) + + FindConfigEnableDangerousDirectImportOfCassandraCounters(params *FindConfigEnableDangerousDirectImportOfCassandraCountersParams) (*FindConfigEnableDangerousDirectImportOfCassandraCountersOK, error) + + FindConfigEnableDeprecatedPartitioners(params *FindConfigEnableDeprecatedPartitionersParams) (*FindConfigEnableDeprecatedPartitionersOK, error) + + FindConfigEnableInMemoryDataStore(params *FindConfigEnableInMemoryDataStoreParams) (*FindConfigEnableInMemoryDataStoreOK, error) + + FindConfigEnableKeyspaceColumnFamilyMetrics(params *FindConfigEnableKeyspaceColumnFamilyMetricsParams) (*FindConfigEnableKeyspaceColumnFamilyMetricsOK, error) + + FindConfigEnableShardAwareDrivers(params *FindConfigEnableShardAwareDriversParams) (*FindConfigEnableShardAwareDriversOK, error) + + FindConfigEnableSstableDataIntegrityCheck(params *FindConfigEnableSstableDataIntegrityCheckParams) (*FindConfigEnableSstableDataIntegrityCheckOK, error) + + FindConfigEnableSstablesMcFormat(params *FindConfigEnableSstablesMcFormatParams) (*FindConfigEnableSstablesMcFormatOK, error) + + FindConfigEnableTablets(params *FindConfigEnableTabletsParams) (*FindConfigEnableTabletsOK, error) + + FindConfigEndpointSnitch(params *FindConfigEndpointSnitchParams) (*FindConfigEndpointSnitchOK, error) + + FindConfigExperimental(params *FindConfigExperimentalParams) (*FindConfigExperimentalOK, error) + + FindConfigFdInitialValueMs(params *FindConfigFdInitialValueMsParams) (*FindConfigFdInitialValueMsOK, error) + + FindConfigFdMaxIntervalMs(params *FindConfigFdMaxIntervalMsParams) (*FindConfigFdMaxIntervalMsOK, error) + + FindConfigFileCacheSizeInMb(params *FindConfigFileCacheSizeInMbParams) (*FindConfigFileCacheSizeInMbOK, error) + + FindConfigHintedHandoffEnabled(params *FindConfigHintedHandoffEnabledParams) (*FindConfigHintedHandoffEnabledOK, error) + + FindConfigHintedHandoffThrottleInKb(params *FindConfigHintedHandoffThrottleInKbParams) (*FindConfigHintedHandoffThrottleInKbOK, error) + + FindConfigHintsDirectory(params *FindConfigHintsDirectoryParams) (*FindConfigHintsDirectoryOK, error) + + FindConfigInMemoryCompactionLimitInMb(params *FindConfigInMemoryCompactionLimitInMbParams) (*FindConfigInMemoryCompactionLimitInMbOK, error) + + FindConfigIncrementalBackups(params *FindConfigIncrementalBackupsParams) (*FindConfigIncrementalBackupsOK, error) + + FindConfigIndexSummaryCapacityInMb(params *FindConfigIndexSummaryCapacityInMbParams) (*FindConfigIndexSummaryCapacityInMbOK, error) + + FindConfigIndexSummaryResizeIntervalInMinutes(params *FindConfigIndexSummaryResizeIntervalInMinutesParams) (*FindConfigIndexSummaryResizeIntervalInMinutesOK, error) + + FindConfigInitialToken(params *FindConfigInitialTokenParams) (*FindConfigInitialTokenOK, error) + + FindConfigInterDcStreamThroughputOutboundMegabitsPerSec(params *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams) (*FindConfigInterDcStreamThroughputOutboundMegabitsPerSecOK, error) + + FindConfigInterDcTCPNodelay(params *FindConfigInterDcTCPNodelayParams) (*FindConfigInterDcTCPNodelayOK, error) + + FindConfigInternodeAuthenticator(params *FindConfigInternodeAuthenticatorParams) (*FindConfigInternodeAuthenticatorOK, error) + + FindConfigInternodeCompression(params *FindConfigInternodeCompressionParams) (*FindConfigInternodeCompressionOK, error) + + FindConfigInternodeRecvBuffSizeInBytes(params *FindConfigInternodeRecvBuffSizeInBytesParams) (*FindConfigInternodeRecvBuffSizeInBytesOK, error) + + FindConfigInternodeSendBuffSizeInBytes(params *FindConfigInternodeSendBuffSizeInBytesParams) (*FindConfigInternodeSendBuffSizeInBytesOK, error) + + FindConfigJoinRing(params *FindConfigJoinRingParams) (*FindConfigJoinRingOK, error) + + FindConfigKeyCacheKeysToSave(params *FindConfigKeyCacheKeysToSaveParams) (*FindConfigKeyCacheKeysToSaveOK, error) + + FindConfigKeyCacheSavePeriod(params *FindConfigKeyCacheSavePeriodParams) (*FindConfigKeyCacheSavePeriodOK, error) + + FindConfigKeyCacheSizeInMb(params *FindConfigKeyCacheSizeInMbParams) (*FindConfigKeyCacheSizeInMbOK, error) + + FindConfigLargeMemoryAllocationWarningThreshold(params *FindConfigLargeMemoryAllocationWarningThresholdParams) (*FindConfigLargeMemoryAllocationWarningThresholdOK, error) + + FindConfigListenAddress(params *FindConfigListenAddressParams) (*FindConfigListenAddressOK, error) + + FindConfigListenInterface(params *FindConfigListenInterfaceParams) (*FindConfigListenInterfaceOK, error) + + FindConfigListenOnBroadcastAddress(params *FindConfigListenOnBroadcastAddressParams) (*FindConfigListenOnBroadcastAddressOK, error) + + FindConfigLoadBalance(params *FindConfigLoadBalanceParams) (*FindConfigLoadBalanceOK, error) + + FindConfigLoadRingState(params *FindConfigLoadRingStateParams) (*FindConfigLoadRingStateOK, error) + + FindConfigLogToStdout(params *FindConfigLogToStdoutParams) (*FindConfigLogToStdoutOK, error) + + FindConfigLogToSyslog(params *FindConfigLogToSyslogParams) (*FindConfigLogToSyslogOK, error) + + FindConfigLoggerLogLevel(params *FindConfigLoggerLogLevelParams) (*FindConfigLoggerLogLevelOK, error) + + FindConfigLsaReclamationStep(params *FindConfigLsaReclamationStepParams) (*FindConfigLsaReclamationStepOK, error) + + FindConfigMaxHintWindowInMs(params *FindConfigMaxHintWindowInMsParams) (*FindConfigMaxHintWindowInMsOK, error) + + FindConfigMaxHintsDeliveryThreads(params *FindConfigMaxHintsDeliveryThreadsParams) (*FindConfigMaxHintsDeliveryThreadsOK, error) + + FindConfigMemoryAllocator(params *FindConfigMemoryAllocatorParams) (*FindConfigMemoryAllocatorOK, error) + + FindConfigMemtableAllocationType(params *FindConfigMemtableAllocationTypeParams) (*FindConfigMemtableAllocationTypeOK, error) + + FindConfigMemtableCleanupThreshold(params *FindConfigMemtableCleanupThresholdParams) (*FindConfigMemtableCleanupThresholdOK, error) + + FindConfigMemtableFlushQueueSize(params *FindConfigMemtableFlushQueueSizeParams) (*FindConfigMemtableFlushQueueSizeOK, error) + + FindConfigMemtableFlushStaticShares(params *FindConfigMemtableFlushStaticSharesParams) (*FindConfigMemtableFlushStaticSharesOK, error) + + FindConfigMemtableFlushWriters(params *FindConfigMemtableFlushWritersParams) (*FindConfigMemtableFlushWritersOK, error) + + FindConfigMemtableHeapSpaceInMb(params *FindConfigMemtableHeapSpaceInMbParams) (*FindConfigMemtableHeapSpaceInMbOK, error) + + FindConfigMemtableOffheapSpaceInMb(params *FindConfigMemtableOffheapSpaceInMbParams) (*FindConfigMemtableOffheapSpaceInMbOK, error) + + FindConfigMemtableTotalSpaceInMb(params *FindConfigMemtableTotalSpaceInMbParams) (*FindConfigMemtableTotalSpaceInMbOK, error) + + FindConfigMurmur3PartitionerIgnoreMsbBits(params *FindConfigMurmur3PartitionerIgnoreMsbBitsParams) (*FindConfigMurmur3PartitionerIgnoreMsbBitsOK, error) + + FindConfigNativeTransportMaxFrameSizeInMb(params *FindConfigNativeTransportMaxFrameSizeInMbParams) (*FindConfigNativeTransportMaxFrameSizeInMbOK, error) + + FindConfigNativeTransportMaxThreads(params *FindConfigNativeTransportMaxThreadsParams) (*FindConfigNativeTransportMaxThreadsOK, error) + + FindConfigNativeTransportPort(params *FindConfigNativeTransportPortParams) (*FindConfigNativeTransportPortOK, error) + + FindConfigNativeTransportPortSsl(params *FindConfigNativeTransportPortSslParams) (*FindConfigNativeTransportPortSslOK, error) + + FindConfigNumTokens(params *FindConfigNumTokensParams) (*FindConfigNumTokensOK, error) + + FindConfigOverrideDecommission(params *FindConfigOverrideDecommissionParams) (*FindConfigOverrideDecommissionOK, error) + + FindConfigPartitioner(params *FindConfigPartitionerParams) (*FindConfigPartitionerOK, error) + + FindConfigPermissionsCacheMaxEntries(params *FindConfigPermissionsCacheMaxEntriesParams) (*FindConfigPermissionsCacheMaxEntriesOK, error) + + FindConfigPermissionsUpdateIntervalInMs(params *FindConfigPermissionsUpdateIntervalInMsParams) (*FindConfigPermissionsUpdateIntervalInMsOK, error) + + FindConfigPermissionsValidityInMs(params *FindConfigPermissionsValidityInMsParams) (*FindConfigPermissionsValidityInMsOK, error) + + FindConfigPhiConvictThreshold(params *FindConfigPhiConvictThresholdParams) (*FindConfigPhiConvictThresholdOK, error) + + FindConfigPreheatKernelPageCache(params *FindConfigPreheatKernelPageCacheParams) (*FindConfigPreheatKernelPageCacheOK, error) + + FindConfigPrometheusAddress(params *FindConfigPrometheusAddressParams) (*FindConfigPrometheusAddressOK, error) + + FindConfigPrometheusPort(params *FindConfigPrometheusPortParams) (*FindConfigPrometheusPortOK, error) + + FindConfigPrometheusPrefix(params *FindConfigPrometheusPrefixParams) (*FindConfigPrometheusPrefixOK, error) + + FindConfigRangeRequestTimeoutInMs(params *FindConfigRangeRequestTimeoutInMsParams) (*FindConfigRangeRequestTimeoutInMsOK, error) + + FindConfigReadRequestTimeoutInMs(params *FindConfigReadRequestTimeoutInMsParams) (*FindConfigReadRequestTimeoutInMsOK, error) + + FindConfigReduceCacheCapacityTo(params *FindConfigReduceCacheCapacityToParams) (*FindConfigReduceCacheCapacityToOK, error) + + FindConfigReduceCacheSizesAt(params *FindConfigReduceCacheSizesAtParams) (*FindConfigReduceCacheSizesAtOK, error) + + FindConfigReplaceNode(params *FindConfigReplaceNodeParams) (*FindConfigReplaceNodeOK, error) + + FindConfigReplaceToken(params *FindConfigReplaceTokenParams) (*FindConfigReplaceTokenOK, error) + + FindConfigRequestScheduler(params *FindConfigRequestSchedulerParams) (*FindConfigRequestSchedulerOK, error) + + FindConfigRequestSchedulerID(params *FindConfigRequestSchedulerIDParams) (*FindConfigRequestSchedulerIDOK, error) + + FindConfigRequestSchedulerOptions(params *FindConfigRequestSchedulerOptionsParams) (*FindConfigRequestSchedulerOptionsOK, error) + + FindConfigRequestTimeoutInMs(params *FindConfigRequestTimeoutInMsParams) (*FindConfigRequestTimeoutInMsOK, error) + + FindConfigRingDelayMs(params *FindConfigRingDelayMsParams) (*FindConfigRingDelayMsOK, error) + + FindConfigRoleManager(params *FindConfigRoleManagerParams) (*FindConfigRoleManagerOK, error) + + FindConfigRowCacheKeysToSave(params *FindConfigRowCacheKeysToSaveParams) (*FindConfigRowCacheKeysToSaveOK, error) + + FindConfigRowCacheSavePeriod(params *FindConfigRowCacheSavePeriodParams) (*FindConfigRowCacheSavePeriodOK, error) + + FindConfigRowCacheSizeInMb(params *FindConfigRowCacheSizeInMbParams) (*FindConfigRowCacheSizeInMbOK, error) + + FindConfigRPCAddress(params *FindConfigRPCAddressParams) (*FindConfigRPCAddressOK, error) + + FindConfigRPCInterface(params *FindConfigRPCInterfaceParams) (*FindConfigRPCInterfaceOK, error) + + FindConfigRPCKeepalive(params *FindConfigRPCKeepaliveParams) (*FindConfigRPCKeepaliveOK, error) + + FindConfigRPCMaxThreads(params *FindConfigRPCMaxThreadsParams) (*FindConfigRPCMaxThreadsOK, error) + + FindConfigRPCMinThreads(params *FindConfigRPCMinThreadsParams) (*FindConfigRPCMinThreadsOK, error) + + FindConfigRPCPort(params *FindConfigRPCPortParams) (*FindConfigRPCPortOK, error) + + FindConfigRPCRecvBuffSizeInBytes(params *FindConfigRPCRecvBuffSizeInBytesParams) (*FindConfigRPCRecvBuffSizeInBytesOK, error) + + FindConfigRPCSendBuffSizeInBytes(params *FindConfigRPCSendBuffSizeInBytesParams) (*FindConfigRPCSendBuffSizeInBytesOK, error) + + FindConfigRPCServerType(params *FindConfigRPCServerTypeParams) (*FindConfigRPCServerTypeOK, error) + + FindConfigSavedCachesDirectory(params *FindConfigSavedCachesDirectoryParams) (*FindConfigSavedCachesDirectoryOK, error) + + FindConfigSeedProvider(params *FindConfigSeedProviderParams) (*FindConfigSeedProviderOK, error) + + FindConfigServerEncryptionOptions(params *FindConfigServerEncryptionOptionsParams) (*FindConfigServerEncryptionOptionsOK, error) + + FindConfigShadowRoundMs(params *FindConfigShadowRoundMsParams) (*FindConfigShadowRoundMsOK, error) + + FindConfigShutdownAnnounceInMs(params *FindConfigShutdownAnnounceInMsParams) (*FindConfigShutdownAnnounceInMsOK, error) + + FindConfigSkipWaitForGossipToSettle(params *FindConfigSkipWaitForGossipToSettleParams) (*FindConfigSkipWaitForGossipToSettleOK, error) + + FindConfigSnapshotBeforeCompaction(params *FindConfigSnapshotBeforeCompactionParams) (*FindConfigSnapshotBeforeCompactionOK, error) + + FindConfigSslStoragePort(params *FindConfigSslStoragePortParams) (*FindConfigSslStoragePortOK, error) + + FindConfigSstablePreemptiveOpenIntervalInMb(params *FindConfigSstablePreemptiveOpenIntervalInMbParams) (*FindConfigSstablePreemptiveOpenIntervalInMbOK, error) + + FindConfigSstableSummaryRatio(params *FindConfigSstableSummaryRatioParams) (*FindConfigSstableSummaryRatioOK, error) + + FindConfigStartNativeTransport(params *FindConfigStartNativeTransportParams) (*FindConfigStartNativeTransportOK, error) + + FindConfigStartRPC(params *FindConfigStartRPCParams) (*FindConfigStartRPCOK, error) + + FindConfigStoragePort(params *FindConfigStoragePortParams) (*FindConfigStoragePortOK, error) + + FindConfigStreamThroughputOutboundMegabitsPerSec(params *FindConfigStreamThroughputOutboundMegabitsPerSecParams) (*FindConfigStreamThroughputOutboundMegabitsPerSecOK, error) + + FindConfigStreamingSocketTimeoutInMs(params *FindConfigStreamingSocketTimeoutInMsParams) (*FindConfigStreamingSocketTimeoutInMsOK, error) + + FindConfigThriftFramedTransportSizeInMb(params *FindConfigThriftFramedTransportSizeInMbParams) (*FindConfigThriftFramedTransportSizeInMbOK, error) + + FindConfigThriftMaxMessageLengthInMb(params *FindConfigThriftMaxMessageLengthInMbParams) (*FindConfigThriftMaxMessageLengthInMbOK, error) + + FindConfigTombstoneFailureThreshold(params *FindConfigTombstoneFailureThresholdParams) (*FindConfigTombstoneFailureThresholdOK, error) + + FindConfigTombstoneWarnThreshold(params *FindConfigTombstoneWarnThresholdParams) (*FindConfigTombstoneWarnThresholdOK, error) + + FindConfigTrickleFsync(params *FindConfigTrickleFsyncParams) (*FindConfigTrickleFsyncOK, error) + + FindConfigTrickleFsyncIntervalInKb(params *FindConfigTrickleFsyncIntervalInKbParams) (*FindConfigTrickleFsyncIntervalInKbOK, error) + + FindConfigTruncateRequestTimeoutInMs(params *FindConfigTruncateRequestTimeoutInMsParams) (*FindConfigTruncateRequestTimeoutInMsOK, error) + + FindConfigUUIDSstableIdentifiersEnabled(params *FindConfigUUIDSstableIdentifiersEnabledParams) (*FindConfigUUIDSstableIdentifiersEnabledOK, error) + + FindConfigViewBuilding(params *FindConfigViewBuildingParams) (*FindConfigViewBuildingOK, error) + + FindConfigViewHintsDirectory(params *FindConfigViewHintsDirectoryParams) (*FindConfigViewHintsDirectoryOK, error) + + FindConfigVirtualDirtySoftLimit(params *FindConfigVirtualDirtySoftLimitParams) (*FindConfigVirtualDirtySoftLimitOK, error) + + FindConfigVolatileSystemKeyspaceForTesting(params *FindConfigVolatileSystemKeyspaceForTestingParams) (*FindConfigVolatileSystemKeyspaceForTestingOK, error) + + FindConfigWriteRequestTimeoutInMs(params *FindConfigWriteRequestTimeoutInMsParams) (*FindConfigWriteRequestTimeoutInMsOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +FindConfigAbortOnLsaBadAlloc Abort when allocation in LSA region fails +*/ +func (a *Client) FindConfigAbortOnLsaBadAlloc(params *FindConfigAbortOnLsaBadAllocParams) (*FindConfigAbortOnLsaBadAllocOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigAbortOnLsaBadAllocParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_abort_on_lsa_bad_alloc", + Method: "GET", + PathPattern: "/config/abort_on_lsa_bad_alloc", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigAbortOnLsaBadAllocReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigAbortOnLsaBadAllocOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigAbortOnLsaBadAllocDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigAlternatorAddress The listen address for Alternator client connections +*/ +func (a *Client) FindConfigAlternatorAddress(params *FindConfigAlternatorAddressParams) (*FindConfigAlternatorAddressOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigAlternatorAddressParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_alternator_address", + Method: "GET", + PathPattern: "/config/alternator_address", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigAlternatorAddressReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigAlternatorAddressOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigAlternatorAddressDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigAlternatorEnforceAuthorization Whether alternator requires authorization +*/ +func (a *Client) FindConfigAlternatorEnforceAuthorization(params *FindConfigAlternatorEnforceAuthorizationParams) (*FindConfigAlternatorEnforceAuthorizationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigAlternatorEnforceAuthorizationParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_alternator_enforce_authorization", + Method: "GET", + PathPattern: "/config/alternator_enforce_authorization", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigAlternatorEnforceAuthorizationReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigAlternatorEnforceAuthorizationOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigAlternatorEnforceAuthorizationDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigAlternatorHTTPSPort The listen port for Alternator HTTPS client connections +*/ +func (a *Client) FindConfigAlternatorHTTPSPort(params *FindConfigAlternatorHTTPSPortParams) (*FindConfigAlternatorHTTPSPortOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigAlternatorHTTPSPortParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_alternator_https_port", + Method: "GET", + PathPattern: "/config/alternator_https_port", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigAlternatorHTTPSPortReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigAlternatorHTTPSPortOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigAlternatorHTTPSPortDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigAlternatorPort The listen port for Alternator client connections +*/ +func (a *Client) FindConfigAlternatorPort(params *FindConfigAlternatorPortParams) (*FindConfigAlternatorPortOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigAlternatorPortParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_alternator_port", + Method: "GET", + PathPattern: "/config/alternator_port", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigAlternatorPortReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigAlternatorPortOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigAlternatorPortDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigAPIAddress Http Rest API address +*/ +func (a *Client) FindConfigAPIAddress(params *FindConfigAPIAddressParams) (*FindConfigAPIAddressOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigAPIAddressParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_api_address", + Method: "GET", + PathPattern: "/config/api_address", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigAPIAddressReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigAPIAddressOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigAPIAddressDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigAPIDocDir The API definition file directory +*/ +func (a *Client) FindConfigAPIDocDir(params *FindConfigAPIDocDirParams) (*FindConfigAPIDocDirOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigAPIDocDirParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_api_doc_dir", + Method: "GET", + PathPattern: "/config/api_doc_dir", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigAPIDocDirReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigAPIDocDirOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigAPIDocDirDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigAPIPort Http Rest API port +*/ +func (a *Client) FindConfigAPIPort(params *FindConfigAPIPortParams) (*FindConfigAPIPortOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigAPIPortParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_api_port", + Method: "GET", + PathPattern: "/config/api_port", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigAPIPortReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigAPIPortOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigAPIPortDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigAPIUIDir The directory location of the API GUI +*/ +func (a *Client) FindConfigAPIUIDir(params *FindConfigAPIUIDirParams) (*FindConfigAPIUIDirOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigAPIUIDirParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_api_ui_dir", + Method: "GET", + PathPattern: "/config/api_ui_dir", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigAPIUIDirReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigAPIUIDirOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigAPIUIDirDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigAuthenticator The authentication backend, used to identify users. The available authenticators are: + + org.apache.cassandra.auth.AllowAllAuthenticator : Disables authentication; no checks are performed. + org.apache.cassandra.auth.PasswordAuthenticator : Authenticates users with user names and hashed passwords stored in the system_auth.credentials table. If you use the default, 1, and the node with the lone replica goes down, you will not be able to log into the cluster because the system_auth keyspace was not replicated. + +Related information: Internal authentication +*/ +func (a *Client) FindConfigAuthenticator(params *FindConfigAuthenticatorParams) (*FindConfigAuthenticatorOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigAuthenticatorParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_authenticator", + Method: "GET", + PathPattern: "/config/authenticator", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigAuthenticatorReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigAuthenticatorOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigAuthenticatorDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigAuthorizer The authorization backend. It implements IAuthenticator, which limits access and provides permissions. The available authorizers are: + + AllowAllAuthorizer : Disables authorization; allows any action to any user. + CassandraAuthorizer : Stores permissions in system_auth.permissions table. If you use the default, 1, and the node with the lone replica goes down, you will not be able to log into the cluster because the system_auth keyspace was not replicated. + +Related information: Object permissions +*/ +func (a *Client) FindConfigAuthorizer(params *FindConfigAuthorizerParams) (*FindConfigAuthorizerOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigAuthorizerParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_authorizer", + Method: "GET", + PathPattern: "/config/authorizer", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigAuthorizerReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigAuthorizerOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigAuthorizerDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigAutoAdjustFlushQuota true: auto-adjust memtable shares for flush processes +*/ +func (a *Client) FindConfigAutoAdjustFlushQuota(params *FindConfigAutoAdjustFlushQuotaParams) (*FindConfigAutoAdjustFlushQuotaOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigAutoAdjustFlushQuotaParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_auto_adjust_flush_quota", + Method: "GET", + PathPattern: "/config/auto_adjust_flush_quota", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigAutoAdjustFlushQuotaReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigAutoAdjustFlushQuotaOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigAutoAdjustFlushQuotaDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigAutoBootstrap This setting has been removed from default configuration. It makes new (non-seed) nodes automatically migrate the right data to themselves. Do not set this to false unless you really know what you are doing. + +Related information: Initializing a multiple node cluster (single data center) and Initializing a multiple node cluster (multiple data centers). +*/ +func (a *Client) FindConfigAutoBootstrap(params *FindConfigAutoBootstrapParams) (*FindConfigAutoBootstrapOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigAutoBootstrapParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_auto_bootstrap", + Method: "GET", + PathPattern: "/config/auto_bootstrap", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigAutoBootstrapReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigAutoBootstrapOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigAutoBootstrapDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigAutoSnapshot Enable or disable whether a snapshot is taken of the data before keyspace truncation or dropping of tables. To prevent data loss, using the default setting is strongly advised. If you set to false, you will lose data on truncation or drop. +*/ +func (a *Client) FindConfigAutoSnapshot(params *FindConfigAutoSnapshotParams) (*FindConfigAutoSnapshotOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigAutoSnapshotParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_auto_snapshot", + Method: "GET", + PathPattern: "/config/auto_snapshot", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigAutoSnapshotReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigAutoSnapshotOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigAutoSnapshotDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigBackgroundWriterSchedulingQuota max cpu usage ratio (between 0 and 1) for compaction process. Not intended for setting in normal operations. Setting it to 1 or higher will disable it, recommended operational setting is 0.5. +*/ +func (a *Client) FindConfigBackgroundWriterSchedulingQuota(params *FindConfigBackgroundWriterSchedulingQuotaParams) (*FindConfigBackgroundWriterSchedulingQuotaOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigBackgroundWriterSchedulingQuotaParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_background_writer_scheduling_quota", + Method: "GET", + PathPattern: "/config/background_writer_scheduling_quota", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigBackgroundWriterSchedulingQuotaReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigBackgroundWriterSchedulingQuotaOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigBackgroundWriterSchedulingQuotaDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigBatchSizeFailThresholdInKb Fail any multiple-partition batch exceeding this value. 50kb (10x warn threshold) by default. +*/ +func (a *Client) FindConfigBatchSizeFailThresholdInKb(params *FindConfigBatchSizeFailThresholdInKbParams) (*FindConfigBatchSizeFailThresholdInKbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigBatchSizeFailThresholdInKbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_batch_size_fail_threshold_in_kb", + Method: "GET", + PathPattern: "/config/batch_size_fail_threshold_in_kb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigBatchSizeFailThresholdInKbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigBatchSizeFailThresholdInKbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigBatchSizeFailThresholdInKbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigBatchSizeWarnThresholdInKb Log WARN on any batch size exceeding this value in kilobytes. Caution should be taken on increasing the size of this threshold as it can lead to node instability. +*/ +func (a *Client) FindConfigBatchSizeWarnThresholdInKb(params *FindConfigBatchSizeWarnThresholdInKbParams) (*FindConfigBatchSizeWarnThresholdInKbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigBatchSizeWarnThresholdInKbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_batch_size_warn_threshold_in_kb", + Method: "GET", + PathPattern: "/config/batch_size_warn_threshold_in_kb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigBatchSizeWarnThresholdInKbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigBatchSizeWarnThresholdInKbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigBatchSizeWarnThresholdInKbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigBatchlogReplayThrottleInKb Total maximum throttle. Throttling is reduced proportionally to the number of nodes in the cluster. +*/ +func (a *Client) FindConfigBatchlogReplayThrottleInKb(params *FindConfigBatchlogReplayThrottleInKbParams) (*FindConfigBatchlogReplayThrottleInKbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigBatchlogReplayThrottleInKbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_batchlog_replay_throttle_in_kb", + Method: "GET", + PathPattern: "/config/batchlog_replay_throttle_in_kb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigBatchlogReplayThrottleInKbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigBatchlogReplayThrottleInKbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigBatchlogReplayThrottleInKbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigBroadcastAddress The IP address a node tells other nodes in the cluster to contact it by. It allows public and private address to be different. For example, use the broadcast_address parameter in topologies where not all nodes have access to other nodes by their private IP addresses. + +If your Scylla cluster is deployed across multiple Amazon EC2 regions and you use the EC2MultiRegionSnitch , set the broadcast_address to public IP address of the node and the listen_address to the private IP. +*/ +func (a *Client) FindConfigBroadcastAddress(params *FindConfigBroadcastAddressParams) (*FindConfigBroadcastAddressOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigBroadcastAddressParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_broadcast_address", + Method: "GET", + PathPattern: "/config/broadcast_address", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigBroadcastAddressReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigBroadcastAddressOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigBroadcastAddressDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigBroadcastRPCAddress RPC address to broadcast to drivers and other Scylla nodes. This cannot be set to 0.0.0.0. If blank, it is set to the value of the rpc_address or rpc_interface. If rpc_address or rpc_interfaceis set to 0.0.0.0, this property must be set. +*/ +func (a *Client) FindConfigBroadcastRPCAddress(params *FindConfigBroadcastRPCAddressParams) (*FindConfigBroadcastRPCAddressOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigBroadcastRPCAddressParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_broadcast_rpc_address", + Method: "GET", + PathPattern: "/config/broadcast_rpc_address", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigBroadcastRPCAddressReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigBroadcastRPCAddressOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigBroadcastRPCAddressDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCacheHitRateReadBalancing This boolean controls whether the replicas for read query will be choosen based on cache hit ratio +*/ +func (a *Client) FindConfigCacheHitRateReadBalancing(params *FindConfigCacheHitRateReadBalancingParams) (*FindConfigCacheHitRateReadBalancingOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCacheHitRateReadBalancingParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_cache_hit_rate_read_balancing", + Method: "GET", + PathPattern: "/config/cache_hit_rate_read_balancing", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCacheHitRateReadBalancingReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCacheHitRateReadBalancingOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCacheHitRateReadBalancingDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCasContentionTimeoutInMs The time that the coordinator continues to retry a CAS (compare and set) operation that contends with other proposals for the same row. +*/ +func (a *Client) FindConfigCasContentionTimeoutInMs(params *FindConfigCasContentionTimeoutInMsParams) (*FindConfigCasContentionTimeoutInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCasContentionTimeoutInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_cas_contention_timeout_in_ms", + Method: "GET", + PathPattern: "/config/cas_contention_timeout_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCasContentionTimeoutInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCasContentionTimeoutInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCasContentionTimeoutInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigClientEncryptionOptions Enable or disable client-to-node encryption. You must also generate keys and provide the appropriate key and certificate. No custom encryption options are currently enabled. The available options are: + + enabled : (Default: false ) To enable, set to true. + certificate: (Default: conf/scylla.crt) The location of a PEM-encoded x509 certificate used to identify and encrypt the client/server communication. + keyfile: (Default: conf/scylla.key) PEM Key file associated with certificate. + +truststore : (Default: ) Location of the truststore containing the trusted certificate for authenticating remote servers. + +The advanced settings are: + + priority_string : GnuTLS priority string controlling TLS algorithms used/allowed. + require_client_auth : (Default: false ) Enables or disables certificate authentication. + +Related information: Client-to-node encryption +*/ +func (a *Client) FindConfigClientEncryptionOptions(params *FindConfigClientEncryptionOptionsParams) (*FindConfigClientEncryptionOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigClientEncryptionOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_client_encryption_options", + Method: "GET", + PathPattern: "/config/client_encryption_options", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigClientEncryptionOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigClientEncryptionOptionsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigClientEncryptionOptionsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigClusterName The name of the cluster; used to prevent machines in one logical cluster from joining another. All nodes participating in a cluster must have the same value. +*/ +func (a *Client) FindConfigClusterName(params *FindConfigClusterNameParams) (*FindConfigClusterNameOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigClusterNameParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_cluster_name", + Method: "GET", + PathPattern: "/config/cluster_name", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigClusterNameReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigClusterNameOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigClusterNameDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigColumnIndexSizeInKb Granularity of the index of rows within a partition. For huge rows, decrease this setting to improve seek time. If you use key cache, be careful not to make this setting too large because key cache will be overwhelmed. If you're unsure of the size of the rows, it's best to use the default setting. +*/ +func (a *Client) FindConfigColumnIndexSizeInKb(params *FindConfigColumnIndexSizeInKbParams) (*FindConfigColumnIndexSizeInKbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigColumnIndexSizeInKbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_column_index_size_in_kb", + Method: "GET", + PathPattern: "/config/column_index_size_in_kb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigColumnIndexSizeInKbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigColumnIndexSizeInKbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigColumnIndexSizeInKbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigCommitFailurePolicy Policy for commit disk failures: + +die Shut down gossip and Thrift and kill the JVM, so the node can be replaced. +stop Shut down gossip and Thrift, leaving the node effectively dead, but can be inspected using JMX. +stop_commit Shut down the commit log, letting writes collect but continuing to service reads (as in pre-2.0.5 Cassandra). +ignore Ignore fatal errors and let the batches fail. +*/ +func (a *Client) FindConfigCommitFailurePolicy(params *FindConfigCommitFailurePolicyParams) (*FindConfigCommitFailurePolicyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCommitFailurePolicyParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_commit_failure_policy", + Method: "GET", + PathPattern: "/config/commit_failure_policy", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCommitFailurePolicyReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCommitFailurePolicyOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCommitFailurePolicyDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCommitlogDirectory The directory where the commit log is stored. For optimal write performance, it is recommended the commit log be on a separate disk partition (ideally, a separate physical device) from the data file directories. +*/ +func (a *Client) FindConfigCommitlogDirectory(params *FindConfigCommitlogDirectoryParams) (*FindConfigCommitlogDirectoryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCommitlogDirectoryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_commitlog_directory", + Method: "GET", + PathPattern: "/config/commitlog_directory", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCommitlogDirectoryReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCommitlogDirectoryOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCommitlogDirectoryDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCommitlogReuseSegments Whether or not to re-use commitlog segments when finished instead of deleting them. Can improve commitlog latency on some file systems. +*/ +func (a *Client) FindConfigCommitlogReuseSegments(params *FindConfigCommitlogReuseSegmentsParams) (*FindConfigCommitlogReuseSegmentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCommitlogReuseSegmentsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_commitlog_reuse_segments", + Method: "GET", + PathPattern: "/config/commitlog_reuse_segments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCommitlogReuseSegmentsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCommitlogReuseSegmentsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCommitlogReuseSegmentsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigCommitlogSegmentSizeInMb Sets the size of the individual commitlog file segments. A commitlog segment may be archived, deleted, or recycled after all its data has been flushed to SSTables. This amount of data can potentially include commitlog segments from every table in the system. The default size is usually suitable for most commitlog archiving, but if you want a finer granularity, 8 or 16 MB is reasonable. See Commit log archive configuration. + +Related information: Commit log archive configuration +*/ +func (a *Client) FindConfigCommitlogSegmentSizeInMb(params *FindConfigCommitlogSegmentSizeInMbParams) (*FindConfigCommitlogSegmentSizeInMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCommitlogSegmentSizeInMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_commitlog_segment_size_in_mb", + Method: "GET", + PathPattern: "/config/commitlog_segment_size_in_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCommitlogSegmentSizeInMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCommitlogSegmentSizeInMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCommitlogSegmentSizeInMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigCommitlogSync The method that Scylla uses to acknowledge writes in milliseconds: + + periodic : Used with commitlog_sync_period_in_ms (Default: 10000 - 10 seconds ) to control how often the commit log is synchronized to disk. Periodic syncs are acknowledged immediately. + batch : Used with commitlog_sync_batch_window_in_ms (Default: disabled **) to control how long Scylla waits for other writes before performing a sync. When using this method, writes are not acknowledged until fsynced to disk. + +Related information: Durability +*/ +func (a *Client) FindConfigCommitlogSync(params *FindConfigCommitlogSyncParams) (*FindConfigCommitlogSyncOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCommitlogSyncParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_commitlog_sync", + Method: "GET", + PathPattern: "/config/commitlog_sync", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCommitlogSyncReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCommitlogSyncOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCommitlogSyncDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCommitlogSyncBatchWindowInMs Controls how long the system waits for other writes before performing a sync in ”batch” mode. +*/ +func (a *Client) FindConfigCommitlogSyncBatchWindowInMs(params *FindConfigCommitlogSyncBatchWindowInMsParams) (*FindConfigCommitlogSyncBatchWindowInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCommitlogSyncBatchWindowInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_commitlog_sync_batch_window_in_ms", + Method: "GET", + PathPattern: "/config/commitlog_sync_batch_window_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCommitlogSyncBatchWindowInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCommitlogSyncBatchWindowInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCommitlogSyncBatchWindowInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCommitlogSyncPeriodInMs Controls how long the system waits for other writes before performing a sync in ”periodic” mode. +*/ +func (a *Client) FindConfigCommitlogSyncPeriodInMs(params *FindConfigCommitlogSyncPeriodInMsParams) (*FindConfigCommitlogSyncPeriodInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCommitlogSyncPeriodInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_commitlog_sync_period_in_ms", + Method: "GET", + PathPattern: "/config/commitlog_sync_period_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCommitlogSyncPeriodInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCommitlogSyncPeriodInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCommitlogSyncPeriodInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigCommitlogTotalSpaceInMb Total space used for commitlogs. If the used space goes above this value, Scylla rounds up to the next nearest segment multiple and flushes memtables to disk for the oldest commitlog segments, removing those log segments. This reduces the amount of data to replay on startup, and prevents infrequently-updated tables from indefinitely keeping commitlog segments. A small total commitlog space tends to cause more flush activity on less-active tables. + +Related information: Configuring memtable throughput +*/ +func (a *Client) FindConfigCommitlogTotalSpaceInMb(params *FindConfigCommitlogTotalSpaceInMbParams) (*FindConfigCommitlogTotalSpaceInMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCommitlogTotalSpaceInMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_commitlog_total_space_in_mb", + Method: "GET", + PathPattern: "/config/commitlog_total_space_in_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCommitlogTotalSpaceInMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCommitlogTotalSpaceInMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCommitlogTotalSpaceInMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCommitlogUseoDsync Whether or not to use O_DSYNC mode for commitlog segments IO. Can improve commitlog latency on some file systems. +*/ +func (a *Client) FindConfigCommitlogUseoDsync(params *FindConfigCommitlogUseoDsyncParams) (*FindConfigCommitlogUseODsyncOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCommitlogUseoDsyncParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_commitlog_use_o_dsync", + Method: "GET", + PathPattern: "/config/commitlog_use_o_dsync", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCommitlogUseoDsyncReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCommitlogUseODsyncOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCommitlogUseoDsyncDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCompactionEnforceMinThreshold If set to true, enforce the min_threshold option for compactions strictly. If false (default), Scylla may decide to compact even if below min_threshold +*/ +func (a *Client) FindConfigCompactionEnforceMinThreshold(params *FindConfigCompactionEnforceMinThresholdParams) (*FindConfigCompactionEnforceMinThresholdOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCompactionEnforceMinThresholdParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_compaction_enforce_min_threshold", + Method: "GET", + PathPattern: "/config/compaction_enforce_min_threshold", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCompactionEnforceMinThresholdReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCompactionEnforceMinThresholdOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCompactionEnforceMinThresholdDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCompactionLargeCellWarningThresholdMb Log a warning when writing cells larger than this value +*/ +func (a *Client) FindConfigCompactionLargeCellWarningThresholdMb(params *FindConfigCompactionLargeCellWarningThresholdMbParams) (*FindConfigCompactionLargeCellWarningThresholdMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCompactionLargeCellWarningThresholdMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_compaction_large_cell_warning_threshold_mb", + Method: "GET", + PathPattern: "/config/compaction_large_cell_warning_threshold_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCompactionLargeCellWarningThresholdMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCompactionLargeCellWarningThresholdMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCompactionLargeCellWarningThresholdMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCompactionLargePartitionWarningThresholdMb Log a warning when writing partitions larger than this value +*/ +func (a *Client) FindConfigCompactionLargePartitionWarningThresholdMb(params *FindConfigCompactionLargePartitionWarningThresholdMbParams) (*FindConfigCompactionLargePartitionWarningThresholdMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCompactionLargePartitionWarningThresholdMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_compaction_large_partition_warning_threshold_mb", + Method: "GET", + PathPattern: "/config/compaction_large_partition_warning_threshold_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCompactionLargePartitionWarningThresholdMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCompactionLargePartitionWarningThresholdMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCompactionLargePartitionWarningThresholdMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCompactionLargeRowWarningThresholdMb Log a warning when writing rows larger than this value +*/ +func (a *Client) FindConfigCompactionLargeRowWarningThresholdMb(params *FindConfigCompactionLargeRowWarningThresholdMbParams) (*FindConfigCompactionLargeRowWarningThresholdMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCompactionLargeRowWarningThresholdMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_compaction_large_row_warning_threshold_mb", + Method: "GET", + PathPattern: "/config/compaction_large_row_warning_threshold_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCompactionLargeRowWarningThresholdMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCompactionLargeRowWarningThresholdMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCompactionLargeRowWarningThresholdMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCompactionPreheatKeyCache When set to true , cached row keys are tracked during compaction, and re-cached to their new positions in the compacted SSTable. If you have extremely large key caches for tables, set the value to false ; see Global row and key caches properties. +*/ +func (a *Client) FindConfigCompactionPreheatKeyCache(params *FindConfigCompactionPreheatKeyCacheParams) (*FindConfigCompactionPreheatKeyCacheOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCompactionPreheatKeyCacheParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_compaction_preheat_key_cache", + Method: "GET", + PathPattern: "/config/compaction_preheat_key_cache", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCompactionPreheatKeyCacheReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCompactionPreheatKeyCacheOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCompactionPreheatKeyCacheDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCompactionRowsCountWarningThreshold Log a warning when writing a number of rows larger than this value +*/ +func (a *Client) FindConfigCompactionRowsCountWarningThreshold(params *FindConfigCompactionRowsCountWarningThresholdParams) (*FindConfigCompactionRowsCountWarningThresholdOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCompactionRowsCountWarningThresholdParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_compaction_rows_count_warning_threshold", + Method: "GET", + PathPattern: "/config/compaction_rows_count_warning_threshold", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCompactionRowsCountWarningThresholdReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCompactionRowsCountWarningThresholdOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCompactionRowsCountWarningThresholdDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCompactionStaticShares If set to higher than 0, ignore the controller's output and set the compaction shares statically. Do not set this unless you know what you are doing and suspect a problem in the controller. This option will be retired when the controller reaches more maturity +*/ +func (a *Client) FindConfigCompactionStaticShares(params *FindConfigCompactionStaticSharesParams) (*FindConfigCompactionStaticSharesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCompactionStaticSharesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_compaction_static_shares", + Method: "GET", + PathPattern: "/config/compaction_static_shares", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCompactionStaticSharesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCompactionStaticSharesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCompactionStaticSharesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigCompactionThroughputMbPerSec Throttles compaction to the specified total throughput across the entire system. The faster you insert data, the faster you need to compact in order to keep the SSTable count down. The recommended Value is 16 to 32 times the rate of write throughput (in MBs/second). Setting the value to 0 disables compaction throttling. + +Related information: Configuring compaction +*/ +func (a *Client) FindConfigCompactionThroughputMbPerSec(params *FindConfigCompactionThroughputMbPerSecParams) (*FindConfigCompactionThroughputMbPerSecOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCompactionThroughputMbPerSecParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_compaction_throughput_mb_per_sec", + Method: "GET", + PathPattern: "/config/compaction_throughput_mb_per_sec", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCompactionThroughputMbPerSecReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCompactionThroughputMbPerSecOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCompactionThroughputMbPerSecDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigConcurrentCompactors Sets the number of concurrent compaction processes allowed to run simultaneously on a node, not including validation compactions for anti-entropy repair. Simultaneous compactions help preserve read performance in a mixed read-write workload by mitigating the tendency of small SSTables to accumulate during a single long-running compaction. If compactions run too slowly or too fast, change compaction_throughput_mb_per_sec first. +*/ +func (a *Client) FindConfigConcurrentCompactors(params *FindConfigConcurrentCompactorsParams) (*FindConfigConcurrentCompactorsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigConcurrentCompactorsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_concurrent_compactors", + Method: "GET", + PathPattern: "/config/concurrent_compactors", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigConcurrentCompactorsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigConcurrentCompactorsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigConcurrentCompactorsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigConcurrentCounterWrites Counter writes read the current values before incrementing and writing them back. The recommended value is (16 × number_of_drives) . +*/ +func (a *Client) FindConfigConcurrentCounterWrites(params *FindConfigConcurrentCounterWritesParams) (*FindConfigConcurrentCounterWritesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigConcurrentCounterWritesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_concurrent_counter_writes", + Method: "GET", + PathPattern: "/config/concurrent_counter_writes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigConcurrentCounterWritesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigConcurrentCounterWritesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigConcurrentCounterWritesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigConcurrentReads For workloads with more data than can fit in memory, the bottleneck is reads fetching data from disk. Setting to (16 × number_of_drives) allows operations to queue low enough in the stack so that the OS and drives can reorder them. +*/ +func (a *Client) FindConfigConcurrentReads(params *FindConfigConcurrentReadsParams) (*FindConfigConcurrentReadsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigConcurrentReadsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_concurrent_reads", + Method: "GET", + PathPattern: "/config/concurrent_reads", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigConcurrentReadsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigConcurrentReadsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigConcurrentReadsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigConcurrentWrites Writes in Cassandra are rarely I/O bound, so the ideal number of concurrent writes depends on the number of CPU cores in your system. The recommended value is (8 x number_of_cpu_cores). +*/ +func (a *Client) FindConfigConcurrentWrites(params *FindConfigConcurrentWritesParams) (*FindConfigConcurrentWritesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigConcurrentWritesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_concurrent_writes", + Method: "GET", + PathPattern: "/config/concurrent_writes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigConcurrentWritesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigConcurrentWritesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigConcurrentWritesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigConsistentClusterManagement Return true if node uses RAFT for cluster management and DDL. +*/ +func (a *Client) FindConfigConsistentClusterManagement(params *FindConfigConsistentClusterManagementParams) (*FindConfigConsistentClusterManagementOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigConsistentClusterManagementParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_consistent_cluster_management", + Method: "GET", + PathPattern: "/config/consistent_cluster_management", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigConsistentClusterManagementReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigConsistentClusterManagementOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigConsistentClusterManagementDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigConsistentRangemovement When set to true, range movements will be consistent. It means: 1) it will refuse to bootstrap a new node if other bootstrapping/leaving/moving nodes detected. 2) data will be streamed to a new node only from the node which is no longer responsible for the token range. Same as -Dcassandra.consistent.rangemovement in cassandra +*/ +func (a *Client) FindConfigConsistentRangemovement(params *FindConfigConsistentRangemovementParams) (*FindConfigConsistentRangemovementOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigConsistentRangemovementParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_consistent_rangemovement", + Method: "GET", + PathPattern: "/config/consistent_rangemovement", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigConsistentRangemovementReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigConsistentRangemovementOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigConsistentRangemovementDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCounterCacheKeysToSave Number of keys from the counter cache to save. When disabled all keys are saved. +*/ +func (a *Client) FindConfigCounterCacheKeysToSave(params *FindConfigCounterCacheKeysToSaveParams) (*FindConfigCounterCacheKeysToSaveOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCounterCacheKeysToSaveParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_counter_cache_keys_to_save", + Method: "GET", + PathPattern: "/config/counter_cache_keys_to_save", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCounterCacheKeysToSaveReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCounterCacheKeysToSaveOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCounterCacheKeysToSaveDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCounterCacheSavePeriod Duration after which Cassandra should save the counter cache (keys only). Caches are saved to saved_caches_directory. +*/ +func (a *Client) FindConfigCounterCacheSavePeriod(params *FindConfigCounterCacheSavePeriodParams) (*FindConfigCounterCacheSavePeriodOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCounterCacheSavePeriodParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_counter_cache_save_period", + Method: "GET", + PathPattern: "/config/counter_cache_save_period", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCounterCacheSavePeriodReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCounterCacheSavePeriodOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCounterCacheSavePeriodDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCounterCacheSizeInMb When no value is specified a minimum of 2.5% of Heap or 50MB. If you perform counter deletes and rely on low gc_grace_seconds, you should disable the counter cache. To disable, set to 0 +*/ +func (a *Client) FindConfigCounterCacheSizeInMb(params *FindConfigCounterCacheSizeInMbParams) (*FindConfigCounterCacheSizeInMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCounterCacheSizeInMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_counter_cache_size_in_mb", + Method: "GET", + PathPattern: "/config/counter_cache_size_in_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCounterCacheSizeInMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCounterCacheSizeInMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCounterCacheSizeInMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCounterWriteRequestTimeoutInMs The time that the coordinator waits for counter writes to complete. +*/ +func (a *Client) FindConfigCounterWriteRequestTimeoutInMs(params *FindConfigCounterWriteRequestTimeoutInMsParams) (*FindConfigCounterWriteRequestTimeoutInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCounterWriteRequestTimeoutInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_counter_write_request_timeout_in_ms", + Method: "GET", + PathPattern: "/config/counter_write_request_timeout_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCounterWriteRequestTimeoutInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCounterWriteRequestTimeoutInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCounterWriteRequestTimeoutInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigCPUScheduler Enable cpu scheduling +*/ +func (a *Client) FindConfigCPUScheduler(params *FindConfigCPUSchedulerParams) (*FindConfigCPUSchedulerOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCPUSchedulerParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_cpu_scheduler", + Method: "GET", + PathPattern: "/config/cpu_scheduler", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCPUSchedulerReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCPUSchedulerOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCPUSchedulerDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigCrossNodeTimeout Enable or disable operation timeout information exchange between nodes (to accurately measure request timeouts). If disabled Cassandra assumes the request was forwarded to the replica instantly by the coordinator. + +CAUTION: +Before enabling this property make sure NTP (network time protocol) is installed and the times are synchronized between the nodes. +*/ +func (a *Client) FindConfigCrossNodeTimeout(params *FindConfigCrossNodeTimeoutParams) (*FindConfigCrossNodeTimeoutOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigCrossNodeTimeoutParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_cross_node_timeout", + Method: "GET", + PathPattern: "/config/cross_node_timeout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigCrossNodeTimeoutReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigCrossNodeTimeoutOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigCrossNodeTimeoutDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigDataFileDirectories The directory location where table data (SSTables) is stored +*/ +func (a *Client) FindConfigDataFileDirectories(params *FindConfigDataFileDirectoriesParams) (*FindConfigDataFileDirectoriesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigDataFileDirectoriesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_data_file_directories", + Method: "GET", + PathPattern: "/config/data_file_directories", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigDataFileDirectoriesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigDataFileDirectoriesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigDataFileDirectoriesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigDefaultLogLevel Default Log level +*/ +func (a *Client) FindConfigDefaultLogLevel(params *FindConfigDefaultLogLevelParams) (*FindConfigDefaultLogLevelOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigDefaultLogLevelParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_default_log_level", + Method: "GET", + PathPattern: "/config/default_log_level", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigDefaultLogLevelReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigDefaultLogLevelOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigDefaultLogLevelDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigDefragmentMemoryOnIdle When set to true, will defragment memory when the cpu is idle. This reduces the amount of work Scylla performs when processing client requests. +*/ +func (a *Client) FindConfigDefragmentMemoryOnIdle(params *FindConfigDefragmentMemoryOnIdleParams) (*FindConfigDefragmentMemoryOnIdleOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigDefragmentMemoryOnIdleParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_defragment_memory_on_idle", + Method: "GET", + PathPattern: "/config/defragment_memory_on_idle", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigDefragmentMemoryOnIdleReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigDefragmentMemoryOnIdleOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigDefragmentMemoryOnIdleDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigDeveloperMode Relax environment checks. Setting to true can reduce performance and reliability significantly. +*/ +func (a *Client) FindConfigDeveloperMode(params *FindConfigDeveloperModeParams) (*FindConfigDeveloperModeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigDeveloperModeParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_developer_mode", + Method: "GET", + PathPattern: "/config/developer_mode", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigDeveloperModeReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigDeveloperModeOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigDeveloperModeDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigDiskFailurePolicy Sets how Scylla responds to disk failure. Recommend settings are stop or best_effort. + + die Shut down gossip and Thrift and kill the JVM for any file system errors or single SSTable errors, so the node can be replaced. + stop_paranoid Shut down gossip and Thrift even for single SSTable errors. + stop Shut down gossip and Thrift, leaving the node effectively dead, but available for inspection using JMX. + best_effort Stop using the failed disk and respond to requests based on the remaining available SSTables. This means you will see obsolete data at consistency level of ONE. + ignore Ignores fatal errors and lets the requests fail; all file system errors are logged but otherwise ignored. Scylla acts as in versions prior to Cassandra 1.2. + +Related information: Handling Disk Failures In Cassandra 1.2 blog and Recovering from a single disk failure using JBOD. +*/ +func (a *Client) FindConfigDiskFailurePolicy(params *FindConfigDiskFailurePolicyParams) (*FindConfigDiskFailurePolicyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigDiskFailurePolicyParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_disk_failure_policy", + Method: "GET", + PathPattern: "/config/disk_failure_policy", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigDiskFailurePolicyReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigDiskFailurePolicyOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigDiskFailurePolicyDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigDynamicSnitchBadnessThreshold Sets the performance threshold for dynamically routing requests away from a poorly performing node. A value of 0.2 means Cassandra continues to prefer the static snitch values until the node response time is 20% worse than the best performing node. Until the threshold is reached, incoming client requests are statically routed to the closest replica (as determined by the snitch). Having requests consistently routed to a given replica can help keep a working set of data hot when read repair is less than 1. +*/ +func (a *Client) FindConfigDynamicSnitchBadnessThreshold(params *FindConfigDynamicSnitchBadnessThresholdParams) (*FindConfigDynamicSnitchBadnessThresholdOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigDynamicSnitchBadnessThresholdParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_dynamic_snitch_badness_threshold", + Method: "GET", + PathPattern: "/config/dynamic_snitch_badness_threshold", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigDynamicSnitchBadnessThresholdReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigDynamicSnitchBadnessThresholdOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigDynamicSnitchBadnessThresholdDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigDynamicSnitchResetIntervalInMs Time interval in milliseconds to reset all node scores, which allows a bad node to recover. +*/ +func (a *Client) FindConfigDynamicSnitchResetIntervalInMs(params *FindConfigDynamicSnitchResetIntervalInMsParams) (*FindConfigDynamicSnitchResetIntervalInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigDynamicSnitchResetIntervalInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_dynamic_snitch_reset_interval_in_ms", + Method: "GET", + PathPattern: "/config/dynamic_snitch_reset_interval_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigDynamicSnitchResetIntervalInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigDynamicSnitchResetIntervalInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigDynamicSnitchResetIntervalInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigDynamicSnitchUpdateIntervalInMs The time interval for how often the snitch calculates node scores. Because score calculation is CPU intensive, be careful when reducing this interval. +*/ +func (a *Client) FindConfigDynamicSnitchUpdateIntervalInMs(params *FindConfigDynamicSnitchUpdateIntervalInMsParams) (*FindConfigDynamicSnitchUpdateIntervalInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigDynamicSnitchUpdateIntervalInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_dynamic_snitch_update_interval_in_ms", + Method: "GET", + PathPattern: "/config/dynamic_snitch_update_interval_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigDynamicSnitchUpdateIntervalInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigDynamicSnitchUpdateIntervalInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigDynamicSnitchUpdateIntervalInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigEnableCache Enable cache +*/ +func (a *Client) FindConfigEnableCache(params *FindConfigEnableCacheParams) (*FindConfigEnableCacheOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigEnableCacheParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_enable_cache", + Method: "GET", + PathPattern: "/config/enable_cache", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigEnableCacheReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigEnableCacheOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigEnableCacheDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigEnableCommitlog Enable commitlog +*/ +func (a *Client) FindConfigEnableCommitlog(params *FindConfigEnableCommitlogParams) (*FindConfigEnableCommitlogOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigEnableCommitlogParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_enable_commitlog", + Method: "GET", + PathPattern: "/config/enable_commitlog", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigEnableCommitlogReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigEnableCommitlogOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigEnableCommitlogDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigEnableDangerousDirectImportOfCassandraCounters Only turn this option on if you want to import tables from Cassandra containing counters, and you are SURE that no counters in that table were created in a version earlier than Cassandra 2.1. It is not enough to have ever since upgraded to newer versions of Cassandra. If you EVER used a version earlier than 2.1 in the cluster where these SSTables come from, DO NOT TURN ON THIS OPTION! You will corrupt your data. You have been warned. +*/ +func (a *Client) FindConfigEnableDangerousDirectImportOfCassandraCounters(params *FindConfigEnableDangerousDirectImportOfCassandraCountersParams) (*FindConfigEnableDangerousDirectImportOfCassandraCountersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigEnableDangerousDirectImportOfCassandraCountersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_enable_dangerous_direct_import_of_cassandra_counters", + Method: "GET", + PathPattern: "/config/enable_dangerous_direct_import_of_cassandra_counters", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigEnableDangerousDirectImportOfCassandraCountersReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigEnableDangerousDirectImportOfCassandraCountersOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigEnableDangerousDirectImportOfCassandraCountersDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigEnableDeprecatedPartitioners Enable the byteordered and murmurs partitioners. These partitioners are deprecated and will be removed in a future version. +*/ +func (a *Client) FindConfigEnableDeprecatedPartitioners(params *FindConfigEnableDeprecatedPartitionersParams) (*FindConfigEnableDeprecatedPartitionersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigEnableDeprecatedPartitionersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_enable_deprecated_partitioners", + Method: "GET", + PathPattern: "/config/enable_deprecated_partitioners", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigEnableDeprecatedPartitionersReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigEnableDeprecatedPartitionersOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigEnableDeprecatedPartitionersDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigEnableInMemoryDataStore Enable in memory mode (system tables are always persisted) +*/ +func (a *Client) FindConfigEnableInMemoryDataStore(params *FindConfigEnableInMemoryDataStoreParams) (*FindConfigEnableInMemoryDataStoreOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigEnableInMemoryDataStoreParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_enable_in_memory_data_store", + Method: "GET", + PathPattern: "/config/enable_in_memory_data_store", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigEnableInMemoryDataStoreReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigEnableInMemoryDataStoreOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigEnableInMemoryDataStoreDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigEnableKeyspaceColumnFamilyMetrics Enable per keyspace and per column family metrics reporting +*/ +func (a *Client) FindConfigEnableKeyspaceColumnFamilyMetrics(params *FindConfigEnableKeyspaceColumnFamilyMetricsParams) (*FindConfigEnableKeyspaceColumnFamilyMetricsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigEnableKeyspaceColumnFamilyMetricsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_enable_keyspace_column_family_metrics", + Method: "GET", + PathPattern: "/config/enable_keyspace_column_family_metrics", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigEnableKeyspaceColumnFamilyMetricsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigEnableKeyspaceColumnFamilyMetricsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigEnableKeyspaceColumnFamilyMetricsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigEnableShardAwareDrivers Enable native transport drivers to use connection-per-shard for better performance +*/ +func (a *Client) FindConfigEnableShardAwareDrivers(params *FindConfigEnableShardAwareDriversParams) (*FindConfigEnableShardAwareDriversOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigEnableShardAwareDriversParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_enable_shard_aware_drivers", + Method: "GET", + PathPattern: "/config/enable_shard_aware_drivers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigEnableShardAwareDriversReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigEnableShardAwareDriversOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigEnableShardAwareDriversDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigEnableSstableDataIntegrityCheck Enable interposer which checks for integrity of every sstable write. Performance is affected to some extent as a result. Useful to help debugging problems that may arise at another layers. +*/ +func (a *Client) FindConfigEnableSstableDataIntegrityCheck(params *FindConfigEnableSstableDataIntegrityCheckParams) (*FindConfigEnableSstableDataIntegrityCheckOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigEnableSstableDataIntegrityCheckParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_enable_sstable_data_integrity_check", + Method: "GET", + PathPattern: "/config/enable_sstable_data_integrity_check", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigEnableSstableDataIntegrityCheckReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigEnableSstableDataIntegrityCheckOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigEnableSstableDataIntegrityCheckDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigEnableSstablesMcFormat Enable SSTables 'mc' format to be used as the default file format +*/ +func (a *Client) FindConfigEnableSstablesMcFormat(params *FindConfigEnableSstablesMcFormatParams) (*FindConfigEnableSstablesMcFormatOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigEnableSstablesMcFormatParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_enable_sstables_mc_format", + Method: "GET", + PathPattern: "/config/enable_sstables_mc_format", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigEnableSstablesMcFormatReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigEnableSstablesMcFormatOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigEnableSstablesMcFormatDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigEnableTablets Return true if tablets are enabled. +*/ +func (a *Client) FindConfigEnableTablets(params *FindConfigEnableTabletsParams) (*FindConfigEnableTabletsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigEnableTabletsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_enable_tablets", + Method: "GET", + PathPattern: "/config/enable_tablets", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigEnableTabletsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigEnableTabletsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigEnableTabletsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigEndpointSnitch Set to a class that implements the IEndpointSnitch. Scylla uses snitches for locating nodes and routing requests. + + SimpleSnitch: Use for single-data center deployments or single-zone in public clouds. Does not recognize data center or rack information. It treats strategy order as proximity, which can improve cache locality when disabling read repair. + + GossipingPropertyFileSnitch: Recommended for production. The rack and data center for the local node are defined in the cassandra-rackdc.properties file and propagated to other nodes via gossip. To allow migration from the PropertyFileSnitch, it uses the cassandra-topology.properties file if it is present. + + Ec2Snitch: For EC2 deployments in a single region. Loads region and availability zone information from the EC2 API. The region is treated as the data center and the availability zone as the rack. Uses only private IPs. Subsequently it does not work across multiple regions. + + Ec2MultiRegionSnitch: Uses public IPs as the broadcast_address to allow cross-region connectivity. This means you must also set seed addresses to the public IP and open the storage_port or ssl_storage_port on the public IP firewall. For intra-region traffic, Scylla switches to the private IP after establishing a connection. + + GoogleCloudSnitch: For deployments on Google Cloud Platform across one or more regions. The region is treated as a datacenter and the availability zone is treated as a rack within the datacenter. The communication should occur over private IPs within the same logical network. + + RackInferringSnitch: Proximity is determined by rack and data center, which are assumed to correspond to the 3rd and 2nd octet of each node's IP address, respectively. This snitch is best used as an example for writing a custom snitch class (unless this happens to match your deployment conventions). + +Related information: Snitches +*/ +func (a *Client) FindConfigEndpointSnitch(params *FindConfigEndpointSnitchParams) (*FindConfigEndpointSnitchOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigEndpointSnitchParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_endpoint_snitch", + Method: "GET", + PathPattern: "/config/endpoint_snitch", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigEndpointSnitchReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigEndpointSnitchOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigEndpointSnitchDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigExperimental Set to true to unlock experimental features. +*/ +func (a *Client) FindConfigExperimental(params *FindConfigExperimentalParams) (*FindConfigExperimentalOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigExperimentalParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_experimental", + Method: "GET", + PathPattern: "/config/experimental", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigExperimentalReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigExperimentalOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigExperimentalDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigFdInitialValueMs The initial failure_detector interval time in milliseconds. +*/ +func (a *Client) FindConfigFdInitialValueMs(params *FindConfigFdInitialValueMsParams) (*FindConfigFdInitialValueMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigFdInitialValueMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_fd_initial_value_ms", + Method: "GET", + PathPattern: "/config/fd_initial_value_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigFdInitialValueMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigFdInitialValueMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigFdInitialValueMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigFdMaxIntervalMs The maximum failure_detector interval time in milliseconds. Interval larger than the maximum will be ignored. Larger cluster may need to increase the default. +*/ +func (a *Client) FindConfigFdMaxIntervalMs(params *FindConfigFdMaxIntervalMsParams) (*FindConfigFdMaxIntervalMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigFdMaxIntervalMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_fd_max_interval_ms", + Method: "GET", + PathPattern: "/config/fd_max_interval_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigFdMaxIntervalMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigFdMaxIntervalMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigFdMaxIntervalMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigFileCacheSizeInMb Total memory to use for SSTable-reading buffers. +*/ +func (a *Client) FindConfigFileCacheSizeInMb(params *FindConfigFileCacheSizeInMbParams) (*FindConfigFileCacheSizeInMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigFileCacheSizeInMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_file_cache_size_in_mb", + Method: "GET", + PathPattern: "/config/file_cache_size_in_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigFileCacheSizeInMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigFileCacheSizeInMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigFileCacheSizeInMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigHintedHandoffEnabled Enable or disable hinted handoff. To enable per data center, add data center list. For example: hinted_handoff_enabled: DC1,DC2. A hint indicates that the write needs to be replayed to an unavailable node. Related information: About hinted handoff writes +*/ +func (a *Client) FindConfigHintedHandoffEnabled(params *FindConfigHintedHandoffEnabledParams) (*FindConfigHintedHandoffEnabledOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigHintedHandoffEnabledParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_hinted_handoff_enabled", + Method: "GET", + PathPattern: "/config/hinted_handoff_enabled", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigHintedHandoffEnabledReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigHintedHandoffEnabledOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigHintedHandoffEnabledDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigHintedHandoffThrottleInKb Maximum throttle per delivery thread in kilobytes per second. This rate reduces proportionally to the number of nodes in the cluster. For example, if there are two nodes in the cluster, each delivery thread will use the maximum rate. If there are three, each node will throttle to half of the maximum, since the two nodes are expected to deliver hints simultaneously. +*/ +func (a *Client) FindConfigHintedHandoffThrottleInKb(params *FindConfigHintedHandoffThrottleInKbParams) (*FindConfigHintedHandoffThrottleInKbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigHintedHandoffThrottleInKbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_hinted_handoff_throttle_in_kb", + Method: "GET", + PathPattern: "/config/hinted_handoff_throttle_in_kb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigHintedHandoffThrottleInKbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigHintedHandoffThrottleInKbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigHintedHandoffThrottleInKbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigHintsDirectory The directory where hints files are stored if hinted handoff is enabled. +*/ +func (a *Client) FindConfigHintsDirectory(params *FindConfigHintsDirectoryParams) (*FindConfigHintsDirectoryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigHintsDirectoryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_hints_directory", + Method: "GET", + PathPattern: "/config/hints_directory", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigHintsDirectoryReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigHintsDirectoryOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigHintsDirectoryDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigInMemoryCompactionLimitInMb Size limit for rows being compacted in memory. Larger rows spill to disk and use a slower two-pass compaction process. When this occurs, a message is logged specifying the row key. The recommended value is 5 to 10 percent of the available Java heap size. +*/ +func (a *Client) FindConfigInMemoryCompactionLimitInMb(params *FindConfigInMemoryCompactionLimitInMbParams) (*FindConfigInMemoryCompactionLimitInMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigInMemoryCompactionLimitInMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_in_memory_compaction_limit_in_mb", + Method: "GET", + PathPattern: "/config/in_memory_compaction_limit_in_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigInMemoryCompactionLimitInMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigInMemoryCompactionLimitInMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigInMemoryCompactionLimitInMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigIncrementalBackups Backs up data updated since the last snapshot was taken. When enabled, Scylla creates a hard link to each SSTable flushed or streamed locally in a backups/ subdirectory of the keyspace data. Removing these links is the operator's responsibility. + +Related information: Enabling incremental backups +*/ +func (a *Client) FindConfigIncrementalBackups(params *FindConfigIncrementalBackupsParams) (*FindConfigIncrementalBackupsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigIncrementalBackupsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_incremental_backups", + Method: "GET", + PathPattern: "/config/incremental_backups", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigIncrementalBackupsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigIncrementalBackupsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigIncrementalBackupsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigIndexSummaryCapacityInMb Fixed memory pool size in MB for SSTable index summaries. If the memory usage of all index summaries exceeds this limit, any SSTables with low read rates shrink their index summaries to meet this limit. This is a best-effort process. In extreme conditions, Cassandra may need to use more than this amount of memory. +*/ +func (a *Client) FindConfigIndexSummaryCapacityInMb(params *FindConfigIndexSummaryCapacityInMbParams) (*FindConfigIndexSummaryCapacityInMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigIndexSummaryCapacityInMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_index_summary_capacity_in_mb", + Method: "GET", + PathPattern: "/config/index_summary_capacity_in_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigIndexSummaryCapacityInMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigIndexSummaryCapacityInMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigIndexSummaryCapacityInMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigIndexSummaryResizeIntervalInMinutes How frequently index summaries should be re-sampled. This is done periodically to redistribute memory from the fixed-size pool to SSTables proportional their recent read rates. To disable, set to -1. This leaves existing index summaries at their current sampling level. +*/ +func (a *Client) FindConfigIndexSummaryResizeIntervalInMinutes(params *FindConfigIndexSummaryResizeIntervalInMinutesParams) (*FindConfigIndexSummaryResizeIntervalInMinutesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigIndexSummaryResizeIntervalInMinutesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_index_summary_resize_interval_in_minutes", + Method: "GET", + PathPattern: "/config/index_summary_resize_interval_in_minutes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigIndexSummaryResizeIntervalInMinutesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigIndexSummaryResizeIntervalInMinutesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigIndexSummaryResizeIntervalInMinutesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigInitialToken Used in the single-node-per-token architecture, where a node owns exactly one contiguous range in the ring space. Setting this property overrides num_tokens. + +If you not using vnodes or have num_tokens set it to 1 or unspecified (#num_tokens), you should always specify this parameter when setting up a production cluster for the first time and when adding capacity. For more information, see this parameter in the Cassandra 1.1 Node and Cluster Configuration documentation. +This parameter can be used with num_tokens (vnodes ) in special cases such as Restoring from a snapshot. +*/ +func (a *Client) FindConfigInitialToken(params *FindConfigInitialTokenParams) (*FindConfigInitialTokenOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigInitialTokenParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_initial_token", + Method: "GET", + PathPattern: "/config/initial_token", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigInitialTokenReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigInitialTokenOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigInitialTokenDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigInterDcStreamThroughputOutboundMegabitsPerSec Throttles all streaming file transfer between the data centers. This setting allows throttles streaming throughput betweens data centers in addition to throttling all network stream traffic as configured with stream_throughput_outbound_megabits_per_sec. +*/ +func (a *Client) FindConfigInterDcStreamThroughputOutboundMegabitsPerSec(params *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams) (*FindConfigInterDcStreamThroughputOutboundMegabitsPerSecOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_inter_dc_stream_throughput_outbound_megabits_per_sec", + Method: "GET", + PathPattern: "/config/inter_dc_stream_throughput_outbound_megabits_per_sec", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigInterDcStreamThroughputOutboundMegabitsPerSecReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigInterDcStreamThroughputOutboundMegabitsPerSecOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigInterDcStreamThroughputOutboundMegabitsPerSecDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigInterDcTCPNodelay Enable or disable tcp_nodelay for inter-data center communication. When disabled larger, but fewer, network packets are sent. This reduces overhead from the TCP protocol itself. However, if cross data-center responses are blocked, it will increase latency. +*/ +func (a *Client) FindConfigInterDcTCPNodelay(params *FindConfigInterDcTCPNodelayParams) (*FindConfigInterDcTCPNodelayOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigInterDcTCPNodelayParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_inter_dc_tcp_nodelay", + Method: "GET", + PathPattern: "/config/inter_dc_tcp_nodelay", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigInterDcTCPNodelayReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigInterDcTCPNodelayOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigInterDcTCPNodelayDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigInternodeAuthenticator Internode authentication backend. It implements org.apache.cassandra.auth.AllowAllInternodeAuthenticator to allows or disallow connections from peer nodes. +*/ +func (a *Client) FindConfigInternodeAuthenticator(params *FindConfigInternodeAuthenticatorParams) (*FindConfigInternodeAuthenticatorOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigInternodeAuthenticatorParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_internode_authenticator", + Method: "GET", + PathPattern: "/config/internode_authenticator", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigInternodeAuthenticatorReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigInternodeAuthenticatorOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigInternodeAuthenticatorDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigInternodeCompression Controls whether traffic between nodes is compressed. The valid values are: + +all: All traffic is compressed. +dc : Traffic between data centers is compressed. +none : No compression. +*/ +func (a *Client) FindConfigInternodeCompression(params *FindConfigInternodeCompressionParams) (*FindConfigInternodeCompressionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigInternodeCompressionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_internode_compression", + Method: "GET", + PathPattern: "/config/internode_compression", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigInternodeCompressionReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigInternodeCompressionOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigInternodeCompressionDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigInternodeRecvBuffSizeInBytes Sets the receiving socket buffer size in bytes for inter-node calls. +*/ +func (a *Client) FindConfigInternodeRecvBuffSizeInBytes(params *FindConfigInternodeRecvBuffSizeInBytesParams) (*FindConfigInternodeRecvBuffSizeInBytesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigInternodeRecvBuffSizeInBytesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_internode_recv_buff_size_in_bytes", + Method: "GET", + PathPattern: "/config/internode_recv_buff_size_in_bytes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigInternodeRecvBuffSizeInBytesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigInternodeRecvBuffSizeInBytesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigInternodeRecvBuffSizeInBytesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigInternodeSendBuffSizeInBytes Sets the sending socket buffer size in bytes for inter-node calls. + +When setting this parameter and internode_recv_buff_size_in_bytes, the buffer size is limited by net.core.wmem_max. When unset, buffer size is defined by net.ipv4.tcp_wmem. See man tcp and: + + /proc/sys/net/core/wmem_max + /proc/sys/net/core/rmem_max + /proc/sys/net/ipv4/tcp_wmem + /proc/sys/net/ipv4/tcp_wmem +*/ +func (a *Client) FindConfigInternodeSendBuffSizeInBytes(params *FindConfigInternodeSendBuffSizeInBytesParams) (*FindConfigInternodeSendBuffSizeInBytesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigInternodeSendBuffSizeInBytesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_internode_send_buff_size_in_bytes", + Method: "GET", + PathPattern: "/config/internode_send_buff_size_in_bytes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigInternodeSendBuffSizeInBytesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigInternodeSendBuffSizeInBytesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigInternodeSendBuffSizeInBytesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigJoinRing When set to true, a node will join the token ring. When set to false, a node will not join the token ring. User can use nodetool join to initiate ring joinging later. Same as -Dcassandra.join_ring in cassandra. +*/ +func (a *Client) FindConfigJoinRing(params *FindConfigJoinRingParams) (*FindConfigJoinRingOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigJoinRingParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_join_ring", + Method: "GET", + PathPattern: "/config/join_ring", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigJoinRingReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigJoinRingOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigJoinRingDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigKeyCacheKeysToSave Number of keys from the key cache to save. (0: all) +*/ +func (a *Client) FindConfigKeyCacheKeysToSave(params *FindConfigKeyCacheKeysToSaveParams) (*FindConfigKeyCacheKeysToSaveOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigKeyCacheKeysToSaveParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_key_cache_keys_to_save", + Method: "GET", + PathPattern: "/config/key_cache_keys_to_save", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigKeyCacheKeysToSaveReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigKeyCacheKeysToSaveOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigKeyCacheKeysToSaveDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigKeyCacheSavePeriod Duration in seconds that keys are saved in cache. Caches are saved to saved_caches_directory. Saved caches greatly improve cold-start speeds and has relatively little effect on I/O. +*/ +func (a *Client) FindConfigKeyCacheSavePeriod(params *FindConfigKeyCacheSavePeriodParams) (*FindConfigKeyCacheSavePeriodOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigKeyCacheSavePeriodParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_key_cache_save_period", + Method: "GET", + PathPattern: "/config/key_cache_save_period", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigKeyCacheSavePeriodReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigKeyCacheSavePeriodOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigKeyCacheSavePeriodDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigKeyCacheSizeInMb A global cache setting for tables. It is the maximum size of the key cache in memory. To disable set to 0. + +Related information: nodetool setcachecapacity. +*/ +func (a *Client) FindConfigKeyCacheSizeInMb(params *FindConfigKeyCacheSizeInMbParams) (*FindConfigKeyCacheSizeInMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigKeyCacheSizeInMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_key_cache_size_in_mb", + Method: "GET", + PathPattern: "/config/key_cache_size_in_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigKeyCacheSizeInMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigKeyCacheSizeInMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigKeyCacheSizeInMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigLargeMemoryAllocationWarningThreshold Warn about memory allocations above this size; set to zero to disable +*/ +func (a *Client) FindConfigLargeMemoryAllocationWarningThreshold(params *FindConfigLargeMemoryAllocationWarningThresholdParams) (*FindConfigLargeMemoryAllocationWarningThresholdOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigLargeMemoryAllocationWarningThresholdParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_large_memory_allocation_warning_threshold", + Method: "GET", + PathPattern: "/config/large_memory_allocation_warning_threshold", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigLargeMemoryAllocationWarningThresholdReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigLargeMemoryAllocationWarningThresholdOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigLargeMemoryAllocationWarningThresholdDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigListenAddress The IP address or hostname that Scylla binds to for connecting to other Scylla nodes. Set this parameter or listen_interface, not both. You must change the default setting for multiple nodes to communicate: + +Generally set to empty. If the node is properly configured (host name, name resolution, and so on), Scylla uses InetAddress.getLocalHost() to get the local address from the system. +For a single node cluster, you can use the default setting (localhost). +If Scylla can't find the correct address, you must specify the IP address or host name. +Never specify 0.0.0.0; it is always wrong. +*/ +func (a *Client) FindConfigListenAddress(params *FindConfigListenAddressParams) (*FindConfigListenAddressOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigListenAddressParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_listen_address", + Method: "GET", + PathPattern: "/config/listen_address", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigListenAddressReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigListenAddressOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigListenAddressDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigListenInterface The interface that Scylla binds to for connecting to other Scylla nodes. Interfaces must correspond to a single address, IP aliasing is not supported. See listen_address. +*/ +func (a *Client) FindConfigListenInterface(params *FindConfigListenInterfaceParams) (*FindConfigListenInterfaceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigListenInterfaceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_listen_interface", + Method: "GET", + PathPattern: "/config/listen_interface", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigListenInterfaceReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigListenInterfaceOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigListenInterfaceDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigListenOnBroadcastAddress When using multiple physical network interfaces, set this to true to listen on broadcast_address in addition to the listen_address, allowing nodes to communicate in both interfaces. Ignore this property if the network configuration automatically routes between the public and private networks such as EC2. +*/ +func (a *Client) FindConfigListenOnBroadcastAddress(params *FindConfigListenOnBroadcastAddressParams) (*FindConfigListenOnBroadcastAddressOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigListenOnBroadcastAddressParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_listen_on_broadcast_address", + Method: "GET", + PathPattern: "/config/listen_on_broadcast_address", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigListenOnBroadcastAddressReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigListenOnBroadcastAddressOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigListenOnBroadcastAddressDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigLoadBalance CQL request load balancing: 'none' or round-robin' +*/ +func (a *Client) FindConfigLoadBalance(params *FindConfigLoadBalanceParams) (*FindConfigLoadBalanceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigLoadBalanceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_load_balance", + Method: "GET", + PathPattern: "/config/load_balance", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigLoadBalanceReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigLoadBalanceOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigLoadBalanceDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigLoadRingState When set to true, load tokens and host_ids previously saved. Same as -Dcassandra.load_ring_state in cassandra. +*/ +func (a *Client) FindConfigLoadRingState(params *FindConfigLoadRingStateParams) (*FindConfigLoadRingStateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigLoadRingStateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_load_ring_state", + Method: "GET", + PathPattern: "/config/load_ring_state", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigLoadRingStateReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigLoadRingStateOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigLoadRingStateDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigLogToStdout Log to stdout +*/ +func (a *Client) FindConfigLogToStdout(params *FindConfigLogToStdoutParams) (*FindConfigLogToStdoutOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigLogToStdoutParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_log_to_stdout", + Method: "GET", + PathPattern: "/config/log_to_stdout", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigLogToStdoutReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigLogToStdoutOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigLogToStdoutDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigLogToSyslog Log to syslog +*/ +func (a *Client) FindConfigLogToSyslog(params *FindConfigLogToSyslogParams) (*FindConfigLogToSyslogOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigLogToSyslogParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_log_to_syslog", + Method: "GET", + PathPattern: "/config/log_to_syslog", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigLogToSyslogReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigLogToSyslogOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigLogToSyslogDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigLoggerLogLevel Logger log levels +*/ +func (a *Client) FindConfigLoggerLogLevel(params *FindConfigLoggerLogLevelParams) (*FindConfigLoggerLogLevelOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigLoggerLogLevelParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_logger_log_level", + Method: "GET", + PathPattern: "/config/logger_log_level", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigLoggerLogLevelReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigLoggerLogLevelOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigLoggerLogLevelDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigLsaReclamationStep Minimum number of segments to reclaim in a single step +*/ +func (a *Client) FindConfigLsaReclamationStep(params *FindConfigLsaReclamationStepParams) (*FindConfigLsaReclamationStepOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigLsaReclamationStepParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_lsa_reclamation_step", + Method: "GET", + PathPattern: "/config/lsa_reclamation_step", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigLsaReclamationStepReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigLsaReclamationStepOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigLsaReclamationStepDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigMaxHintWindowInMs Maximum amount of time that hints are generates hints for an unresponsive node. After this interval, new hints are no longer generated until the node is back up and responsive. If the node goes down again, a new interval begins. This setting can prevent a sudden demand for resources when a node is brought back online and the rest of the cluster attempts to replay a large volume of hinted writes. + +Related information: Failure detection and recovery +*/ +func (a *Client) FindConfigMaxHintWindowInMs(params *FindConfigMaxHintWindowInMsParams) (*FindConfigMaxHintWindowInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigMaxHintWindowInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_max_hint_window_in_ms", + Method: "GET", + PathPattern: "/config/max_hint_window_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigMaxHintWindowInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigMaxHintWindowInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigMaxHintWindowInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigMaxHintsDeliveryThreads Number of threads with which to deliver hints. In multiple data-center deployments, consider increasing this number because cross data-center handoff is generally slower. +*/ +func (a *Client) FindConfigMaxHintsDeliveryThreads(params *FindConfigMaxHintsDeliveryThreadsParams) (*FindConfigMaxHintsDeliveryThreadsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigMaxHintsDeliveryThreadsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_max_hints_delivery_threads", + Method: "GET", + PathPattern: "/config/max_hints_delivery_threads", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigMaxHintsDeliveryThreadsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigMaxHintsDeliveryThreadsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigMaxHintsDeliveryThreadsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigMemoryAllocator The off-heap memory allocator. In addition to caches, this property affects storage engine meta data. Supported values: + NativeAllocator + JEMallocAllocator + +Experiments show that jemalloc saves some memory compared to the native allocator because it is more fragmentation resistant. To use, install jemalloc as a library and modify cassandra-env.sh (instructions in file). +*/ +func (a *Client) FindConfigMemoryAllocator(params *FindConfigMemoryAllocatorParams) (*FindConfigMemoryAllocatorOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigMemoryAllocatorParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_memory_allocator", + Method: "GET", + PathPattern: "/config/memory_allocator", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigMemoryAllocatorReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigMemoryAllocatorOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigMemoryAllocatorDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigMemtableAllocationType Specify the way Cassandra allocates and manages memtable memory. See Off-heap memtables in Cassandra 2.1. Options are: + +heap_buffers On heap NIO (non-blocking I/O) buffers. +offheap_buffers Off heap (direct) NIO buffers. +offheap_objects Native memory, eliminating NIO buffer heap overhead. +*/ +func (a *Client) FindConfigMemtableAllocationType(params *FindConfigMemtableAllocationTypeParams) (*FindConfigMemtableAllocationTypeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigMemtableAllocationTypeParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_memtable_allocation_type", + Method: "GET", + PathPattern: "/config/memtable_allocation_type", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigMemtableAllocationTypeReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigMemtableAllocationTypeOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigMemtableAllocationTypeDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigMemtableCleanupThreshold Ratio of occupied non-flushing memtable size to total permitted size for triggering a flush of the largest memtable. Larger values mean larger flushes and less compaction, but also less concurrent flush activity, which can make it difficult to keep your disks saturated under heavy write load. +*/ +func (a *Client) FindConfigMemtableCleanupThreshold(params *FindConfigMemtableCleanupThresholdParams) (*FindConfigMemtableCleanupThresholdOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigMemtableCleanupThresholdParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_memtable_cleanup_threshold", + Method: "GET", + PathPattern: "/config/memtable_cleanup_threshold", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigMemtableCleanupThresholdReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigMemtableCleanupThresholdOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigMemtableCleanupThresholdDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigMemtableFlushQueueSize The number of full memtables to allow pending flush (memtables waiting for a write thread). At a minimum, set to the maximum number of indexes created on a single table. + +Related information: Flushing data from the memtable +*/ +func (a *Client) FindConfigMemtableFlushQueueSize(params *FindConfigMemtableFlushQueueSizeParams) (*FindConfigMemtableFlushQueueSizeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigMemtableFlushQueueSizeParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_memtable_flush_queue_size", + Method: "GET", + PathPattern: "/config/memtable_flush_queue_size", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigMemtableFlushQueueSizeReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigMemtableFlushQueueSizeOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigMemtableFlushQueueSizeDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigMemtableFlushStaticShares If set to higher than 0, ignore the controller's output and set the memtable shares statically. Do not set this unless you know what you are doing and suspect a problem in the controller. This option will be retired when the controller reaches more maturity +*/ +func (a *Client) FindConfigMemtableFlushStaticShares(params *FindConfigMemtableFlushStaticSharesParams) (*FindConfigMemtableFlushStaticSharesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigMemtableFlushStaticSharesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_memtable_flush_static_shares", + Method: "GET", + PathPattern: "/config/memtable_flush_static_shares", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigMemtableFlushStaticSharesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigMemtableFlushStaticSharesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigMemtableFlushStaticSharesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigMemtableFlushWriters Sets the number of memtable flush writer threads. These threads are blocked by disk I/O, and each one holds a memtable in memory while blocked. If you have a large Java heap size and many data directories, you can increase the value for better flush performance. +*/ +func (a *Client) FindConfigMemtableFlushWriters(params *FindConfigMemtableFlushWritersParams) (*FindConfigMemtableFlushWritersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigMemtableFlushWritersParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_memtable_flush_writers", + Method: "GET", + PathPattern: "/config/memtable_flush_writers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigMemtableFlushWritersReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigMemtableFlushWritersOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigMemtableFlushWritersDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigMemtableHeapSpaceInMb Total permitted memory to use for memtables. Triggers a flush based on memtable_cleanup_threshold. Cassandra stops accepting writes when the limit is exceeded until a flush completes. If unset, sets to default. +*/ +func (a *Client) FindConfigMemtableHeapSpaceInMb(params *FindConfigMemtableHeapSpaceInMbParams) (*FindConfigMemtableHeapSpaceInMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigMemtableHeapSpaceInMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_memtable_heap_space_in_mb", + Method: "GET", + PathPattern: "/config/memtable_heap_space_in_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigMemtableHeapSpaceInMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigMemtableHeapSpaceInMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigMemtableHeapSpaceInMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigMemtableOffheapSpaceInMb See memtable_heap_space_in_mb +*/ +func (a *Client) FindConfigMemtableOffheapSpaceInMb(params *FindConfigMemtableOffheapSpaceInMbParams) (*FindConfigMemtableOffheapSpaceInMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigMemtableOffheapSpaceInMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_memtable_offheap_space_in_mb", + Method: "GET", + PathPattern: "/config/memtable_offheap_space_in_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigMemtableOffheapSpaceInMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigMemtableOffheapSpaceInMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigMemtableOffheapSpaceInMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigMemtableTotalSpaceInMb Specifies the total memory used for all memtables on a node. This replaces the per-table storage settings memtable_operations_in_millions and memtable_throughput_in_mb. +*/ +func (a *Client) FindConfigMemtableTotalSpaceInMb(params *FindConfigMemtableTotalSpaceInMbParams) (*FindConfigMemtableTotalSpaceInMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigMemtableTotalSpaceInMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_memtable_total_space_in_mb", + Method: "GET", + PathPattern: "/config/memtable_total_space_in_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigMemtableTotalSpaceInMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigMemtableTotalSpaceInMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigMemtableTotalSpaceInMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigMurmur3PartitionerIgnoreMsbBits Number of most siginificant token bits to ignore in murmur3 partitioner; increase for very large clusters +*/ +func (a *Client) FindConfigMurmur3PartitionerIgnoreMsbBits(params *FindConfigMurmur3PartitionerIgnoreMsbBitsParams) (*FindConfigMurmur3PartitionerIgnoreMsbBitsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigMurmur3PartitionerIgnoreMsbBitsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_murmur3_partitioner_ignore_msb_bits", + Method: "GET", + PathPattern: "/config/murmur3_partitioner_ignore_msb_bits", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigMurmur3PartitionerIgnoreMsbBitsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigMurmur3PartitionerIgnoreMsbBitsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigMurmur3PartitionerIgnoreMsbBitsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigNativeTransportMaxFrameSizeInMb The maximum size of allowed frame. Frame (requests) larger than this are rejected as invalid. +*/ +func (a *Client) FindConfigNativeTransportMaxFrameSizeInMb(params *FindConfigNativeTransportMaxFrameSizeInMbParams) (*FindConfigNativeTransportMaxFrameSizeInMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigNativeTransportMaxFrameSizeInMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_native_transport_max_frame_size_in_mb", + Method: "GET", + PathPattern: "/config/native_transport_max_frame_size_in_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigNativeTransportMaxFrameSizeInMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigNativeTransportMaxFrameSizeInMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigNativeTransportMaxFrameSizeInMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigNativeTransportMaxThreads The maximum number of thread handling requests. The meaning is the same as rpc_max_threads. + +Default is different (128 versus unlimited). +No corresponding native_transport_min_threads. +Idle threads are stopped after 30 seconds. +*/ +func (a *Client) FindConfigNativeTransportMaxThreads(params *FindConfigNativeTransportMaxThreadsParams) (*FindConfigNativeTransportMaxThreadsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigNativeTransportMaxThreadsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_native_transport_max_threads", + Method: "GET", + PathPattern: "/config/native_transport_max_threads", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigNativeTransportMaxThreadsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigNativeTransportMaxThreadsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigNativeTransportMaxThreadsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigNativeTransportPort Port on which the CQL native transport listens for clients. +*/ +func (a *Client) FindConfigNativeTransportPort(params *FindConfigNativeTransportPortParams) (*FindConfigNativeTransportPortOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigNativeTransportPortParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_native_transport_port", + Method: "GET", + PathPattern: "/config/native_transport_port", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigNativeTransportPortReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigNativeTransportPortOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigNativeTransportPortDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigNativeTransportPortSsl Port on which the CQL TLS native transport listens for clients.Enabling client encryption and keeping native_transport_port_ssl disabled will use encryptionfor native_transport_port. Setting native_transport_port_ssl to a different valuefrom native_transport_port will use encryption for native_transport_port_ssl whilekeeping native_transport_port unencrypted +*/ +func (a *Client) FindConfigNativeTransportPortSsl(params *FindConfigNativeTransportPortSslParams) (*FindConfigNativeTransportPortSslOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigNativeTransportPortSslParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_native_transport_port_ssl", + Method: "GET", + PathPattern: "/config/native_transport_port_ssl", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigNativeTransportPortSslReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigNativeTransportPortSslOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigNativeTransportPortSslDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigNumTokens Defines the number of tokens randomly assigned to this node on the ring when using virtual nodes (vnodes). The more tokens, relative to other nodes, the larger the proportion of data that the node stores. Generally all nodes should have the same number of tokens assuming equal hardware capability. The recommended value is 256. If unspecified (#num_tokens), Scylla uses 1 (equivalent to #num_tokens : 1) for legacy compatibility and uses the initial_token setting. + +If not using vnodes, comment #num_tokens : 256 or set num_tokens : 1 and use initial_token. If you already have an existing cluster with one token per node and wish to migrate to vnodes, see Enabling virtual nodes on an existing production cluster. +Note: If using DataStax Enterprise, the default setting of this property depends on the type of node and type of install. +*/ +func (a *Client) FindConfigNumTokens(params *FindConfigNumTokensParams) (*FindConfigNumTokensOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigNumTokensParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_num_tokens", + Method: "GET", + PathPattern: "/config/num_tokens", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigNumTokensReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigNumTokensOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigNumTokensDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigOverrideDecommission Set true to force a decommissioned node to join the cluster +*/ +func (a *Client) FindConfigOverrideDecommission(params *FindConfigOverrideDecommissionParams) (*FindConfigOverrideDecommissionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigOverrideDecommissionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_override_decommission", + Method: "GET", + PathPattern: "/config/override_decommission", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigOverrideDecommissionReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigOverrideDecommissionOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigOverrideDecommissionDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigPartitioner Distributes rows (by partition key) across all nodes in the cluster. Any IPartitioner may be used, including your own as long as it is in the class path. For new clusters use the default partitioner. + +Scylla provides the following partitioners for backwards compatibility: + + RandomPartitioner + ByteOrderedPartitioner + OrderPreservingPartitioner (deprecated) + +Related information: Partitioners +*/ +func (a *Client) FindConfigPartitioner(params *FindConfigPartitionerParams) (*FindConfigPartitionerOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigPartitionerParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_partitioner", + Method: "GET", + PathPattern: "/config/partitioner", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigPartitionerReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigPartitionerOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigPartitionerDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigPermissionsCacheMaxEntries Maximum cached permission entries. Must have a non-zero value if permissions caching is enabled (see a permissions_validity_in_ms description). +*/ +func (a *Client) FindConfigPermissionsCacheMaxEntries(params *FindConfigPermissionsCacheMaxEntriesParams) (*FindConfigPermissionsCacheMaxEntriesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigPermissionsCacheMaxEntriesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_permissions_cache_max_entries", + Method: "GET", + PathPattern: "/config/permissions_cache_max_entries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigPermissionsCacheMaxEntriesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigPermissionsCacheMaxEntriesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigPermissionsCacheMaxEntriesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigPermissionsUpdateIntervalInMs Refresh interval for permissions cache (if enabled). After this interval, cache entries become eligible for refresh. An async reload is scheduled every permissions_update_interval_in_ms time period and the old value is returned until it completes. If permissions_validity_in_ms has a non-zero value, then this property must also have a non-zero value. It's recommended to set this value to be at least 3 times smaller than the permissions_validity_in_ms. +*/ +func (a *Client) FindConfigPermissionsUpdateIntervalInMs(params *FindConfigPermissionsUpdateIntervalInMsParams) (*FindConfigPermissionsUpdateIntervalInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigPermissionsUpdateIntervalInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_permissions_update_interval_in_ms", + Method: "GET", + PathPattern: "/config/permissions_update_interval_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigPermissionsUpdateIntervalInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigPermissionsUpdateIntervalInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigPermissionsUpdateIntervalInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigPermissionsValidityInMs How long permissions in cache remain valid. Depending on the authorizer, such as CassandraAuthorizer, fetching permissions can be resource intensive. Permissions caching is disabled when this property is set to 0 or when AllowAllAuthorizer is used. The cached value is considered valid as long as both its value is not older than the permissions_validity_in_ms and the cached value has been read at least once during the permissions_validity_in_ms time frame. If any of these two conditions doesn't hold the cached value is going to be evicted from the cache. + +Related information: Object permissions +*/ +func (a *Client) FindConfigPermissionsValidityInMs(params *FindConfigPermissionsValidityInMsParams) (*FindConfigPermissionsValidityInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigPermissionsValidityInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_permissions_validity_in_ms", + Method: "GET", + PathPattern: "/config/permissions_validity_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigPermissionsValidityInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigPermissionsValidityInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigPermissionsValidityInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigPhiConvictThreshold Adjusts the sensitivity of the failure detector on an exponential scale. Generally this setting never needs adjusting. + +Related information: Failure detection and recovery +*/ +func (a *Client) FindConfigPhiConvictThreshold(params *FindConfigPhiConvictThresholdParams) (*FindConfigPhiConvictThresholdOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigPhiConvictThresholdParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_phi_convict_threshold", + Method: "GET", + PathPattern: "/config/phi_convict_threshold", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigPhiConvictThresholdReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigPhiConvictThresholdOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigPhiConvictThresholdDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigPreheatKernelPageCache Enable or disable kernel page cache preheating from contents of the key cache after compaction. When enabled it preheats only first page (4KB) of each row to optimize for sequential access. It can be harmful for fat rows, see CASSANDRA-4937 for more details. +*/ +func (a *Client) FindConfigPreheatKernelPageCache(params *FindConfigPreheatKernelPageCacheParams) (*FindConfigPreheatKernelPageCacheOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigPreheatKernelPageCacheParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_preheat_kernel_page_cache", + Method: "GET", + PathPattern: "/config/preheat_kernel_page_cache", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigPreheatKernelPageCacheReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigPreheatKernelPageCacheOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigPreheatKernelPageCacheDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigPrometheusAddress Prometheus listening address +*/ +func (a *Client) FindConfigPrometheusAddress(params *FindConfigPrometheusAddressParams) (*FindConfigPrometheusAddressOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigPrometheusAddressParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_prometheus_address", + Method: "GET", + PathPattern: "/config/prometheus_address", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigPrometheusAddressReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigPrometheusAddressOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigPrometheusAddressDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigPrometheusPort Prometheus port, set to zero to disable +*/ +func (a *Client) FindConfigPrometheusPort(params *FindConfigPrometheusPortParams) (*FindConfigPrometheusPortOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigPrometheusPortParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_prometheus_port", + Method: "GET", + PathPattern: "/config/prometheus_port", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigPrometheusPortReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigPrometheusPortOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigPrometheusPortDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigPrometheusPrefix Set the prefix of the exported Prometheus metrics. Changing this will break Scylla's dashboard compatibility, do not change unless you know what you are doing. +*/ +func (a *Client) FindConfigPrometheusPrefix(params *FindConfigPrometheusPrefixParams) (*FindConfigPrometheusPrefixOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigPrometheusPrefixParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_prometheus_prefix", + Method: "GET", + PathPattern: "/config/prometheus_prefix", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigPrometheusPrefixReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigPrometheusPrefixOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigPrometheusPrefixDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigRangeRequestTimeoutInMs The time in milliseconds that the coordinator waits for sequential or index scans to complete. +*/ +func (a *Client) FindConfigRangeRequestTimeoutInMs(params *FindConfigRangeRequestTimeoutInMsParams) (*FindConfigRangeRequestTimeoutInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRangeRequestTimeoutInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_range_request_timeout_in_ms", + Method: "GET", + PathPattern: "/config/range_request_timeout_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRangeRequestTimeoutInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRangeRequestTimeoutInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRangeRequestTimeoutInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigReadRequestTimeoutInMs The time that the coordinator waits for read operations to complete +*/ +func (a *Client) FindConfigReadRequestTimeoutInMs(params *FindConfigReadRequestTimeoutInMsParams) (*FindConfigReadRequestTimeoutInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigReadRequestTimeoutInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_read_request_timeout_in_ms", + Method: "GET", + PathPattern: "/config/read_request_timeout_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigReadRequestTimeoutInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigReadRequestTimeoutInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigReadRequestTimeoutInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigReduceCacheCapacityTo Sets the size percentage to which maximum cache capacity is reduced when Java heap usage reaches the threshold defined by reduce_cache_sizes_at. Together with flush_largest_memtables_at, these properties constitute an emergency measure for preventing sudden out-of-memory (OOM) errors. +*/ +func (a *Client) FindConfigReduceCacheCapacityTo(params *FindConfigReduceCacheCapacityToParams) (*FindConfigReduceCacheCapacityToOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigReduceCacheCapacityToParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_reduce_cache_capacity_to", + Method: "GET", + PathPattern: "/config/reduce_cache_capacity_to", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigReduceCacheCapacityToReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigReduceCacheCapacityToOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigReduceCacheCapacityToDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigReduceCacheSizesAt When Java heap usage (after a full concurrent mark sweep (CMS) garbage collection) exceeds this percentage, Cassandra reduces the cache capacity to the fraction of the current size as specified by reduce_cache_capacity_to. To disable, set the value to 1.0. +*/ +func (a *Client) FindConfigReduceCacheSizesAt(params *FindConfigReduceCacheSizesAtParams) (*FindConfigReduceCacheSizesAtOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigReduceCacheSizesAtParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_reduce_cache_sizes_at", + Method: "GET", + PathPattern: "/config/reduce_cache_sizes_at", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigReduceCacheSizesAtReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigReduceCacheSizesAtOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigReduceCacheSizesAtDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigReplaceNode The UUID of the node to replace. Same as -Dcassandra.replace_node in cssandra. +*/ +func (a *Client) FindConfigReplaceNode(params *FindConfigReplaceNodeParams) (*FindConfigReplaceNodeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigReplaceNodeParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_replace_node", + Method: "GET", + PathPattern: "/config/replace_node", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigReplaceNodeReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigReplaceNodeOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigReplaceNodeDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigReplaceToken The tokens of the node to replace. Same as -Dcassandra.replace_token in cassandra. +*/ +func (a *Client) FindConfigReplaceToken(params *FindConfigReplaceTokenParams) (*FindConfigReplaceTokenOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigReplaceTokenParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_replace_token", + Method: "GET", + PathPattern: "/config/replace_token", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigReplaceTokenReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigReplaceTokenOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigReplaceTokenDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigRequestScheduler Defines a scheduler to handle incoming client requests according to a defined policy. This scheduler is useful for throttling client requests in single clusters containing multiple keyspaces. This parameter is specifically for requests from the client and does not affect inter-node communication. Valid values are: + +org.apache.cassandra.scheduler.NoScheduler No scheduling takes place. +org.apache.cassandra.scheduler.RoundRobinScheduler Round robin of client requests to a node with a separate queue for each request_scheduler_id property. +A Java class that implements the RequestScheduler interface. +*/ +func (a *Client) FindConfigRequestScheduler(params *FindConfigRequestSchedulerParams) (*FindConfigRequestSchedulerOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRequestSchedulerParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_request_scheduler", + Method: "GET", + PathPattern: "/config/request_scheduler", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRequestSchedulerReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRequestSchedulerOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRequestSchedulerDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigRequestSchedulerID An identifier on which to perform request scheduling. Currently the only valid value is keyspace. See weights. +*/ +func (a *Client) FindConfigRequestSchedulerID(params *FindConfigRequestSchedulerIDParams) (*FindConfigRequestSchedulerIDOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRequestSchedulerIDParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_request_scheduler_id", + Method: "GET", + PathPattern: "/config/request_scheduler_id", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRequestSchedulerIDReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRequestSchedulerIDOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRequestSchedulerIDDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigRequestSchedulerOptions Contains a list of properties that define configuration options for request_scheduler: + +throttle_limit: The number of in-flight requests per client. Requests beyond this limit are queued up until running requests complete. Recommended value is ((concurrent_reads + concurrent_writes) × 2) +default_weight: (Default: 1 **) How many requests are handled during each turn of the RoundRobin. +weights: (Default: Keyspace: 1) Takes a list of keyspaces. It sets how many requests are handled during each turn of the RoundRobin, based on the request_scheduler_id. +*/ +func (a *Client) FindConfigRequestSchedulerOptions(params *FindConfigRequestSchedulerOptionsParams) (*FindConfigRequestSchedulerOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRequestSchedulerOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_request_scheduler_options", + Method: "GET", + PathPattern: "/config/request_scheduler_options", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRequestSchedulerOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRequestSchedulerOptionsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRequestSchedulerOptionsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigRequestTimeoutInMs The default timeout for other, miscellaneous operations. + +Related information: About hinted handoff writes +*/ +func (a *Client) FindConfigRequestTimeoutInMs(params *FindConfigRequestTimeoutInMsParams) (*FindConfigRequestTimeoutInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRequestTimeoutInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_request_timeout_in_ms", + Method: "GET", + PathPattern: "/config/request_timeout_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRequestTimeoutInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRequestTimeoutInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRequestTimeoutInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigRingDelayMs Time a node waits to hear from other nodes before joining the ring in milliseconds. Same as -Dcassandra.ring_delay_ms in cassandra. +*/ +func (a *Client) FindConfigRingDelayMs(params *FindConfigRingDelayMsParams) (*FindConfigRingDelayMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRingDelayMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_ring_delay_ms", + Method: "GET", + PathPattern: "/config/ring_delay_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRingDelayMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRingDelayMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRingDelayMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigRoleManager The role-management backend, used to maintain grantts and memberships between roles. + +The available role-managers are: + + CassandraRoleManager : Stores role data in the system_auth keyspace. +*/ +func (a *Client) FindConfigRoleManager(params *FindConfigRoleManagerParams) (*FindConfigRoleManagerOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRoleManagerParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_role_manager", + Method: "GET", + PathPattern: "/config/role_manager", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRoleManagerReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRoleManagerOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRoleManagerDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigRowCacheKeysToSave Number of keys from the row cache to save. +*/ +func (a *Client) FindConfigRowCacheKeysToSave(params *FindConfigRowCacheKeysToSaveParams) (*FindConfigRowCacheKeysToSaveOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRowCacheKeysToSaveParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_row_cache_keys_to_save", + Method: "GET", + PathPattern: "/config/row_cache_keys_to_save", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRowCacheKeysToSaveReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRowCacheKeysToSaveOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRowCacheKeysToSaveDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigRowCacheSavePeriod Duration in seconds that rows are saved in cache. Caches are saved to saved_caches_directory. +*/ +func (a *Client) FindConfigRowCacheSavePeriod(params *FindConfigRowCacheSavePeriodParams) (*FindConfigRowCacheSavePeriodOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRowCacheSavePeriodParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_row_cache_save_period", + Method: "GET", + PathPattern: "/config/row_cache_save_period", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRowCacheSavePeriodReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRowCacheSavePeriodOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRowCacheSavePeriodDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigRowCacheSizeInMb Maximum size of the row cache in memory. Row cache can save more time than key_cache_size_in_mb, but is space-intensive because it contains the entire row. Use the row cache only for hot rows or static rows. If you reduce the size, you may not get you hottest keys loaded on start up. +*/ +func (a *Client) FindConfigRowCacheSizeInMb(params *FindConfigRowCacheSizeInMbParams) (*FindConfigRowCacheSizeInMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRowCacheSizeInMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_row_cache_size_in_mb", + Method: "GET", + PathPattern: "/config/row_cache_size_in_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRowCacheSizeInMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRowCacheSizeInMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRowCacheSizeInMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigRPCAddress The listen address for client connections (Thrift RPC service and native transport).Valid values are: + + unset: Resolves the address using the hostname configuration of the node. If left unset, the hostname must resolve to the IP address of this node using /etc/hostname, /etc/hosts, or DNS. + 0.0.0.0 : Listens on all configured interfaces, but you must set the broadcast_rpc_address to a value other than 0.0.0.0. + IP address + hostname + +Related information: Network +*/ +func (a *Client) FindConfigRPCAddress(params *FindConfigRPCAddressParams) (*FindConfigRPCAddressOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRPCAddressParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_rpc_address", + Method: "GET", + PathPattern: "/config/rpc_address", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRPCAddressReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRPCAddressOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRPCAddressDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigRPCInterface The listen address for client connections. Interfaces must correspond to a single address, IP aliasing is not supported. See rpc_address. +*/ +func (a *Client) FindConfigRPCInterface(params *FindConfigRPCInterfaceParams) (*FindConfigRPCInterfaceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRPCInterfaceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_rpc_interface", + Method: "GET", + PathPattern: "/config/rpc_interface", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRPCInterfaceReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRPCInterfaceOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRPCInterfaceDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigRPCKeepalive Enable or disable keepalive on client connections (RPC or native). +*/ +func (a *Client) FindConfigRPCKeepalive(params *FindConfigRPCKeepaliveParams) (*FindConfigRPCKeepaliveOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRPCKeepaliveParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_rpc_keepalive", + Method: "GET", + PathPattern: "/config/rpc_keepalive", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRPCKeepaliveReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRPCKeepaliveOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRPCKeepaliveDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigRPCMaxThreads Regardless of your choice of RPC server (rpc_server_type), the number of maximum requests in the RPC thread pool dictates how many concurrent requests are possible. However, if you are using the parameter sync in the rpc_server_type, it also dictates the number of clients that can be connected. For a large number of client connections, this could cause excessive memory usage for the thread stack. Connection pooling on the client side is highly recommended. Setting a maximum thread pool size acts as a safeguard against misbehaved clients. If the maximum is reached, Cassandra blocks additional connections until a client disconnects. +*/ +func (a *Client) FindConfigRPCMaxThreads(params *FindConfigRPCMaxThreadsParams) (*FindConfigRPCMaxThreadsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRPCMaxThreadsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_rpc_max_threads", + Method: "GET", + PathPattern: "/config/rpc_max_threads", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRPCMaxThreadsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRPCMaxThreadsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRPCMaxThreadsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigRPCMinThreads Sets the minimum thread pool size for remote procedure calls. +*/ +func (a *Client) FindConfigRPCMinThreads(params *FindConfigRPCMinThreadsParams) (*FindConfigRPCMinThreadsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRPCMinThreadsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_rpc_min_threads", + Method: "GET", + PathPattern: "/config/rpc_min_threads", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRPCMinThreadsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRPCMinThreadsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRPCMinThreadsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigRPCPort Thrift port for client connections. +*/ +func (a *Client) FindConfigRPCPort(params *FindConfigRPCPortParams) (*FindConfigRPCPortOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRPCPortParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_rpc_port", + Method: "GET", + PathPattern: "/config/rpc_port", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRPCPortReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRPCPortOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRPCPortDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigRPCRecvBuffSizeInBytes Sets the receiving socket buffer size for remote procedure calls. +*/ +func (a *Client) FindConfigRPCRecvBuffSizeInBytes(params *FindConfigRPCRecvBuffSizeInBytesParams) (*FindConfigRPCRecvBuffSizeInBytesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRPCRecvBuffSizeInBytesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_rpc_recv_buff_size_in_bytes", + Method: "GET", + PathPattern: "/config/rpc_recv_buff_size_in_bytes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRPCRecvBuffSizeInBytesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRPCRecvBuffSizeInBytesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRPCRecvBuffSizeInBytesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigRPCSendBuffSizeInBytes Sets the sending socket buffer size in bytes for remote procedure calls. +*/ +func (a *Client) FindConfigRPCSendBuffSizeInBytes(params *FindConfigRPCSendBuffSizeInBytesParams) (*FindConfigRPCSendBuffSizeInBytesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRPCSendBuffSizeInBytesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_rpc_send_buff_size_in_bytes", + Method: "GET", + PathPattern: "/config/rpc_send_buff_size_in_bytes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRPCSendBuffSizeInBytesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRPCSendBuffSizeInBytesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRPCSendBuffSizeInBytesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigRPCServerType Cassandra provides three options for the RPC server. On Windows, sync is about 30% slower than hsha. On Linux, sync and hsha performance is about the same, but hsha uses less memory. + +sync (Default One thread per Thrift connection.) For a very large number of clients, memory is the limiting factor. On a 64-bit JVM, 180KB is the minimum stack size per thread and corresponds to your use of virtual memory. Physical memory may be limited depending on use of stack space. +hsh Half synchronous, half asynchronous. All Thrift clients are handled asynchronously using a small number of threads that does not vary with the number of clients and thus scales well to many clients. The RPC requests are synchronous (one thread per active request). + + Note: When selecting this option, you must change the default value (unlimited) of rpc_max_threads. + +Your own RPC server: You must provide a fully-qualified class name of an o.a.c.t.TServerFactory that can create a server instance. +*/ +func (a *Client) FindConfigRPCServerType(params *FindConfigRPCServerTypeParams) (*FindConfigRPCServerTypeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigRPCServerTypeParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_rpc_server_type", + Method: "GET", + PathPattern: "/config/rpc_server_type", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigRPCServerTypeReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigRPCServerTypeOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigRPCServerTypeDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigSavedCachesDirectory The directory location where table key and row caches are stored. +*/ +func (a *Client) FindConfigSavedCachesDirectory(params *FindConfigSavedCachesDirectoryParams) (*FindConfigSavedCachesDirectoryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigSavedCachesDirectoryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_saved_caches_directory", + Method: "GET", + PathPattern: "/config/saved_caches_directory", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigSavedCachesDirectoryReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigSavedCachesDirectoryOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigSavedCachesDirectoryDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigSeedProvider The addresses of hosts deemed contact points. Scylla nodes use the -seeds list to find each other and learn the topology of the ring. + + class_name (Default: org.apache.cassandra.locator.SimpleSeedProvider) + The class within Scylla that handles the seed logic. It can be customized, but this is typically not required. + - seeds (Default: 127.0.0.1) A comma-delimited list of IP addresses used by gossip for bootstrapping new nodes joining a cluster. When running multiple nodes, you must change the list from the default value. In multiple data-center clusters, the seed list should include at least one node from each data center (replication group). More than a single seed node per data center is recommended for fault tolerance. Otherwise, gossip has to communicate with another data center when bootstrapping a node. Making every node a seed node is not recommended because of increased maintenance and reduced gossip performance. Gossip optimization is not critical, but it is recommended to use a small seed list (approximately three nodes per data center). + +Related information: Initializing a multiple node cluster (single data center) and Initializing a multiple node cluster (multiple data centers). +*/ +func (a *Client) FindConfigSeedProvider(params *FindConfigSeedProviderParams) (*FindConfigSeedProviderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigSeedProviderParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_seed_provider", + Method: "GET", + PathPattern: "/config/seed_provider", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigSeedProviderReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigSeedProviderOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigSeedProviderDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigServerEncryptionOptions Enable or disable inter-node encryption. You must also generate keys and provide the appropriate key and trust store locations and passwords. No custom encryption options are currently enabled. The available options are: + +internode_encryption : (Default: none ) Enable or disable encryption of inter-node communication using the TLS_RSA_WITH_AES_128_CBC_SHA cipher suite for authentication, key exchange, and encryption of data transfers. The available inter-node options are: + + all : Encrypt all inter-node communications. + none : No encryption. + dc : Encrypt the traffic between the data centers (server only). + rack : Encrypt the traffic between the racks(server only). + +certificate : (Default: conf/scylla.crt) The location of a PEM-encoded x509 certificate used to identify and encrypt the internode communication. +keyfile : (Default: conf/scylla.key) PEM Key file associated with certificate. +truststore : (Default: ) Location of the truststore containing the trusted certificate for authenticating remote servers. + +The advanced settings are: + + priority_string : GnuTLS priority string controlling TLS algorithms used/allowed. + require_client_auth : (Default: false ) Enables or disables certificate authentication. + +Related information: Node-to-node encryption +*/ +func (a *Client) FindConfigServerEncryptionOptions(params *FindConfigServerEncryptionOptionsParams) (*FindConfigServerEncryptionOptionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigServerEncryptionOptionsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_server_encryption_options", + Method: "GET", + PathPattern: "/config/server_encryption_options", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigServerEncryptionOptionsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigServerEncryptionOptionsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigServerEncryptionOptionsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigShadowRoundMs The maximum gossip shadow round time. Can be used to reduce the gossip feature check time during node boot up. +*/ +func (a *Client) FindConfigShadowRoundMs(params *FindConfigShadowRoundMsParams) (*FindConfigShadowRoundMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigShadowRoundMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_shadow_round_ms", + Method: "GET", + PathPattern: "/config/shadow_round_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigShadowRoundMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigShadowRoundMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigShadowRoundMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigShutdownAnnounceInMs Time a node waits after sending gossip shutdown message in milliseconds. Same as -Dcassandra.shutdown_announce_in_ms in cassandra. +*/ +func (a *Client) FindConfigShutdownAnnounceInMs(params *FindConfigShutdownAnnounceInMsParams) (*FindConfigShutdownAnnounceInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigShutdownAnnounceInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_shutdown_announce_in_ms", + Method: "GET", + PathPattern: "/config/shutdown_announce_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigShutdownAnnounceInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigShutdownAnnounceInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigShutdownAnnounceInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigSkipWaitForGossipToSettle An integer to configure the wait for gossip to settle. -1: wait normally, 0: do not wait at all, n: wait for at most n polls. Same as -Dcassandra.skip_wait_for_gossip_to_settle in cassandra. +*/ +func (a *Client) FindConfigSkipWaitForGossipToSettle(params *FindConfigSkipWaitForGossipToSettleParams) (*FindConfigSkipWaitForGossipToSettleOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigSkipWaitForGossipToSettleParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_skip_wait_for_gossip_to_settle", + Method: "GET", + PathPattern: "/config/skip_wait_for_gossip_to_settle", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigSkipWaitForGossipToSettleReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigSkipWaitForGossipToSettleOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigSkipWaitForGossipToSettleDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigSnapshotBeforeCompaction Enable or disable taking a snapshot before each compaction. This option is useful to back up data when there is a data format change. Be careful using this option because Cassandra does not clean up older snapshots automatically. + +Related information: Configuring compaction +*/ +func (a *Client) FindConfigSnapshotBeforeCompaction(params *FindConfigSnapshotBeforeCompactionParams) (*FindConfigSnapshotBeforeCompactionOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigSnapshotBeforeCompactionParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_snapshot_before_compaction", + Method: "GET", + PathPattern: "/config/snapshot_before_compaction", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigSnapshotBeforeCompactionReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigSnapshotBeforeCompactionOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigSnapshotBeforeCompactionDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigSslStoragePort The SSL port for encrypted communication. Unused unless enabled in encryption_options. +*/ +func (a *Client) FindConfigSslStoragePort(params *FindConfigSslStoragePortParams) (*FindConfigSslStoragePortOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigSslStoragePortParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_ssl_storage_port", + Method: "GET", + PathPattern: "/config/ssl_storage_port", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigSslStoragePortReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigSslStoragePortOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigSslStoragePortDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigSstablePreemptiveOpenIntervalInMb When compacting, the replacement opens SSTables before they are completely written and uses in place of the prior SSTables for any range previously written. This setting helps to smoothly transfer reads between the SSTables by reducing page cache churn and keeps hot rows hot. +*/ +func (a *Client) FindConfigSstablePreemptiveOpenIntervalInMb(params *FindConfigSstablePreemptiveOpenIntervalInMbParams) (*FindConfigSstablePreemptiveOpenIntervalInMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigSstablePreemptiveOpenIntervalInMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_sstable_preemptive_open_interval_in_mb", + Method: "GET", + PathPattern: "/config/sstable_preemptive_open_interval_in_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigSstablePreemptiveOpenIntervalInMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigSstablePreemptiveOpenIntervalInMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigSstablePreemptiveOpenIntervalInMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigSstableSummaryRatio Enforces that 1 byte of summary is written for every N (2000 by default) bytes written to data file. Value must be between 0 and 1. +*/ +func (a *Client) FindConfigSstableSummaryRatio(params *FindConfigSstableSummaryRatioParams) (*FindConfigSstableSummaryRatioOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigSstableSummaryRatioParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_sstable_summary_ratio", + Method: "GET", + PathPattern: "/config/sstable_summary_ratio", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigSstableSummaryRatioReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigSstableSummaryRatioOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigSstableSummaryRatioDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigStartNativeTransport Enable or disable the native transport server. Uses the same address as the rpc_address, but the port is different from the rpc_port. See native_transport_port. +*/ +func (a *Client) FindConfigStartNativeTransport(params *FindConfigStartNativeTransportParams) (*FindConfigStartNativeTransportOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigStartNativeTransportParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_start_native_transport", + Method: "GET", + PathPattern: "/config/start_native_transport", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigStartNativeTransportReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigStartNativeTransportOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigStartNativeTransportDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigStartRPC Starts the Thrift RPC server +*/ +func (a *Client) FindConfigStartRPC(params *FindConfigStartRPCParams) (*FindConfigStartRPCOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigStartRPCParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_start_rpc", + Method: "GET", + PathPattern: "/config/start_rpc", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigStartRPCReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigStartRPCOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigStartRPCDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigStoragePort The port for inter-node communication. +*/ +func (a *Client) FindConfigStoragePort(params *FindConfigStoragePortParams) (*FindConfigStoragePortOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigStoragePortParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_storage_port", + Method: "GET", + PathPattern: "/config/storage_port", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigStoragePortReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigStoragePortOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigStoragePortDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigStreamThroughputOutboundMegabitsPerSec Throttles all outbound streaming file transfers on a node to the specified throughput. Cassandra does mostly sequential I/O when streaming data during bootstrap or repair, which can lead to saturating the network connection and degrading client (RPC) performance. +*/ +func (a *Client) FindConfigStreamThroughputOutboundMegabitsPerSec(params *FindConfigStreamThroughputOutboundMegabitsPerSecParams) (*FindConfigStreamThroughputOutboundMegabitsPerSecOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigStreamThroughputOutboundMegabitsPerSecParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_stream_throughput_outbound_megabits_per_sec", + Method: "GET", + PathPattern: "/config/stream_throughput_outbound_megabits_per_sec", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigStreamThroughputOutboundMegabitsPerSecReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigStreamThroughputOutboundMegabitsPerSecOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigStreamThroughputOutboundMegabitsPerSecDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigStreamingSocketTimeoutInMs Enable or disable socket timeout for streaming operations. When a timeout occurs during streaming, streaming is retried from the start of the current file. Avoid setting this value too low, as it can result in a significant amount of data re-streaming. +*/ +func (a *Client) FindConfigStreamingSocketTimeoutInMs(params *FindConfigStreamingSocketTimeoutInMsParams) (*FindConfigStreamingSocketTimeoutInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigStreamingSocketTimeoutInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_streaming_socket_timeout_in_ms", + Method: "GET", + PathPattern: "/config/streaming_socket_timeout_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigStreamingSocketTimeoutInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigStreamingSocketTimeoutInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigStreamingSocketTimeoutInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigThriftFramedTransportSizeInMb Frame size (maximum field length) for Thrift. The frame is the row or part of the row the application is inserting. +*/ +func (a *Client) FindConfigThriftFramedTransportSizeInMb(params *FindConfigThriftFramedTransportSizeInMbParams) (*FindConfigThriftFramedTransportSizeInMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigThriftFramedTransportSizeInMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_thrift_framed_transport_size_in_mb", + Method: "GET", + PathPattern: "/config/thrift_framed_transport_size_in_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigThriftFramedTransportSizeInMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigThriftFramedTransportSizeInMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigThriftFramedTransportSizeInMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigThriftMaxMessageLengthInMb The maximum length of a Thrift message in megabytes, including all fields and internal Thrift overhead (1 byte of overhead for each frame). Message length is usually used in conjunction with batches. A frame length greater than or equal to 24 accommodates a batch with four inserts, each of which is 24 bytes. The required message length is greater than or equal to 24+24+24+24+4 (number of frames). +*/ +func (a *Client) FindConfigThriftMaxMessageLengthInMb(params *FindConfigThriftMaxMessageLengthInMbParams) (*FindConfigThriftMaxMessageLengthInMbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigThriftMaxMessageLengthInMbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_thrift_max_message_length_in_mb", + Method: "GET", + PathPattern: "/config/thrift_max_message_length_in_mb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigThriftMaxMessageLengthInMbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigThriftMaxMessageLengthInMbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigThriftMaxMessageLengthInMbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigTombstoneFailureThreshold The maximum number of tombstones a query can scan before aborting. +*/ +func (a *Client) FindConfigTombstoneFailureThreshold(params *FindConfigTombstoneFailureThresholdParams) (*FindConfigTombstoneFailureThresholdOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigTombstoneFailureThresholdParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_tombstone_failure_threshold", + Method: "GET", + PathPattern: "/config/tombstone_failure_threshold", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigTombstoneFailureThresholdReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigTombstoneFailureThresholdOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigTombstoneFailureThresholdDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigTombstoneWarnThreshold The maximum number of tombstones a query can scan before warning. +*/ +func (a *Client) FindConfigTombstoneWarnThreshold(params *FindConfigTombstoneWarnThresholdParams) (*FindConfigTombstoneWarnThresholdOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigTombstoneWarnThresholdParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_tombstone_warn_threshold", + Method: "GET", + PathPattern: "/config/tombstone_warn_threshold", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigTombstoneWarnThresholdReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigTombstoneWarnThresholdOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigTombstoneWarnThresholdDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigTrickleFsync When doing sequential writing, enabling this option tells fsync to force the operating system to flush the dirty buffers at a set interval trickle_fsync_interval_in_kb. Enable this parameter to avoid sudden dirty buffer flushing from impacting read latencies. Recommended to use on SSDs, but not on HDDs. +*/ +func (a *Client) FindConfigTrickleFsync(params *FindConfigTrickleFsyncParams) (*FindConfigTrickleFsyncOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigTrickleFsyncParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_trickle_fsync", + Method: "GET", + PathPattern: "/config/trickle_fsync", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigTrickleFsyncReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigTrickleFsyncOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigTrickleFsyncDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigTrickleFsyncIntervalInKb Sets the size of the fsync in kilobytes. +*/ +func (a *Client) FindConfigTrickleFsyncIntervalInKb(params *FindConfigTrickleFsyncIntervalInKbParams) (*FindConfigTrickleFsyncIntervalInKbOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigTrickleFsyncIntervalInKbParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_trickle_fsync_interval_in_kb", + Method: "GET", + PathPattern: "/config/trickle_fsync_interval_in_kb", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigTrickleFsyncIntervalInKbReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigTrickleFsyncIntervalInKbOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigTrickleFsyncIntervalInKbDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigTruncateRequestTimeoutInMs The time that the coordinator waits for truncates (remove all data from a table) to complete. The long default value allows for a snapshot to be taken before removing the data. If auto_snapshot is disabled (not recommended), you can reduce this time. +*/ +func (a *Client) FindConfigTruncateRequestTimeoutInMs(params *FindConfigTruncateRequestTimeoutInMsParams) (*FindConfigTruncateRequestTimeoutInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigTruncateRequestTimeoutInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_truncate_request_timeout_in_ms", + Method: "GET", + PathPattern: "/config/truncate_request_timeout_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigTruncateRequestTimeoutInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigTruncateRequestTimeoutInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigTruncateRequestTimeoutInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigUUIDSstableIdentifiersEnabled Return true if node is using uuid sstable format: me-3g7k_098r_4wtqo2asamoc1i8h9n-big-CompressionInfo.db +*/ +func (a *Client) FindConfigUUIDSstableIdentifiersEnabled(params *FindConfigUUIDSstableIdentifiersEnabledParams) (*FindConfigUUIDSstableIdentifiersEnabledOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigUUIDSstableIdentifiersEnabledParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_uuid_sstable_identifiers_enabled", + Method: "GET", + PathPattern: "/config/uuid_sstable_identifiers_enabled", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigUUIDSstableIdentifiersEnabledReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigUUIDSstableIdentifiersEnabledOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigUUIDSstableIdentifiersEnabledDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigViewBuilding Enable view building; should only be set to false when the node is experience issues due to view building +*/ +func (a *Client) FindConfigViewBuilding(params *FindConfigViewBuildingParams) (*FindConfigViewBuildingOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigViewBuildingParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_view_building", + Method: "GET", + PathPattern: "/config/view_building", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigViewBuildingReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigViewBuildingOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigViewBuildingDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigViewHintsDirectory The directory where materialized-view updates are stored while a view replica is unreachable. +*/ +func (a *Client) FindConfigViewHintsDirectory(params *FindConfigViewHintsDirectoryParams) (*FindConfigViewHintsDirectoryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigViewHintsDirectoryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_view_hints_directory", + Method: "GET", + PathPattern: "/config/view_hints_directory", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigViewHintsDirectoryReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigViewHintsDirectoryOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigViewHintsDirectoryDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigVirtualDirtySoftLimit Soft limit of virtual dirty memory expressed as a portion of the hard limit +*/ +func (a *Client) FindConfigVirtualDirtySoftLimit(params *FindConfigVirtualDirtySoftLimitParams) (*FindConfigVirtualDirtySoftLimitOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigVirtualDirtySoftLimitParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_virtual_dirty_soft_limit", + Method: "GET", + PathPattern: "/config/virtual_dirty_soft_limit", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigVirtualDirtySoftLimitReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigVirtualDirtySoftLimitOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigVirtualDirtySoftLimitDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +FindConfigVolatileSystemKeyspaceForTesting Don't persist system keyspace - testing only! +*/ +func (a *Client) FindConfigVolatileSystemKeyspaceForTesting(params *FindConfigVolatileSystemKeyspaceForTestingParams) (*FindConfigVolatileSystemKeyspaceForTestingOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigVolatileSystemKeyspaceForTestingParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_volatile_system_keyspace_for_testing", + Method: "GET", + PathPattern: "/config/volatile_system_keyspace_for_testing", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigVolatileSystemKeyspaceForTestingReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigVolatileSystemKeyspaceForTestingOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigVolatileSystemKeyspaceForTestingDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + FindConfigWriteRequestTimeoutInMs The time in milliseconds that the coordinator waits for write operations to complete. + +Related information: About hinted handoff writes +*/ +func (a *Client) FindConfigWriteRequestTimeoutInMs(params *FindConfigWriteRequestTimeoutInMsParams) (*FindConfigWriteRequestTimeoutInMsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigWriteRequestTimeoutInMsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_write_request_timeout_in_ms", + Method: "GET", + PathPattern: "/config/write_request_timeout_in_ms", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigWriteRequestTimeoutInMsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigWriteRequestTimeoutInMsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigWriteRequestTimeoutInMsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_abort_on_lsa_bad_alloc_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_abort_on_lsa_bad_alloc_parameters.go new file mode 100644 index 0000000000..77ca653a46 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_abort_on_lsa_bad_alloc_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigAbortOnLsaBadAllocParams creates a new FindConfigAbortOnLsaBadAllocParams object +// with the default values initialized. +func NewFindConfigAbortOnLsaBadAllocParams() *FindConfigAbortOnLsaBadAllocParams { + + return &FindConfigAbortOnLsaBadAllocParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigAbortOnLsaBadAllocParamsWithTimeout creates a new FindConfigAbortOnLsaBadAllocParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigAbortOnLsaBadAllocParamsWithTimeout(timeout time.Duration) *FindConfigAbortOnLsaBadAllocParams { + + return &FindConfigAbortOnLsaBadAllocParams{ + + timeout: timeout, + } +} + +// NewFindConfigAbortOnLsaBadAllocParamsWithContext creates a new FindConfigAbortOnLsaBadAllocParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigAbortOnLsaBadAllocParamsWithContext(ctx context.Context) *FindConfigAbortOnLsaBadAllocParams { + + return &FindConfigAbortOnLsaBadAllocParams{ + + Context: ctx, + } +} + +// NewFindConfigAbortOnLsaBadAllocParamsWithHTTPClient creates a new FindConfigAbortOnLsaBadAllocParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigAbortOnLsaBadAllocParamsWithHTTPClient(client *http.Client) *FindConfigAbortOnLsaBadAllocParams { + + return &FindConfigAbortOnLsaBadAllocParams{ + HTTPClient: client, + } +} + +/* +FindConfigAbortOnLsaBadAllocParams contains all the parameters to send to the API endpoint +for the find config abort on lsa bad alloc operation typically these are written to a http.Request +*/ +type FindConfigAbortOnLsaBadAllocParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config abort on lsa bad alloc params +func (o *FindConfigAbortOnLsaBadAllocParams) WithTimeout(timeout time.Duration) *FindConfigAbortOnLsaBadAllocParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config abort on lsa bad alloc params +func (o *FindConfigAbortOnLsaBadAllocParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config abort on lsa bad alloc params +func (o *FindConfigAbortOnLsaBadAllocParams) WithContext(ctx context.Context) *FindConfigAbortOnLsaBadAllocParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config abort on lsa bad alloc params +func (o *FindConfigAbortOnLsaBadAllocParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config abort on lsa bad alloc params +func (o *FindConfigAbortOnLsaBadAllocParams) WithHTTPClient(client *http.Client) *FindConfigAbortOnLsaBadAllocParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config abort on lsa bad alloc params +func (o *FindConfigAbortOnLsaBadAllocParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigAbortOnLsaBadAllocParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_abort_on_lsa_bad_alloc_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_abort_on_lsa_bad_alloc_responses.go new file mode 100644 index 0000000000..9f6330fbdd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_abort_on_lsa_bad_alloc_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigAbortOnLsaBadAllocReader is a Reader for the FindConfigAbortOnLsaBadAlloc structure. +type FindConfigAbortOnLsaBadAllocReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigAbortOnLsaBadAllocReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigAbortOnLsaBadAllocOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigAbortOnLsaBadAllocDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigAbortOnLsaBadAllocOK creates a FindConfigAbortOnLsaBadAllocOK with default headers values +func NewFindConfigAbortOnLsaBadAllocOK() *FindConfigAbortOnLsaBadAllocOK { + return &FindConfigAbortOnLsaBadAllocOK{} +} + +/* +FindConfigAbortOnLsaBadAllocOK handles this case with default header values. + +Config value +*/ +type FindConfigAbortOnLsaBadAllocOK struct { + Payload bool +} + +func (o *FindConfigAbortOnLsaBadAllocOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigAbortOnLsaBadAllocOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigAbortOnLsaBadAllocDefault creates a FindConfigAbortOnLsaBadAllocDefault with default headers values +func NewFindConfigAbortOnLsaBadAllocDefault(code int) *FindConfigAbortOnLsaBadAllocDefault { + return &FindConfigAbortOnLsaBadAllocDefault{ + _statusCode: code, + } +} + +/* +FindConfigAbortOnLsaBadAllocDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigAbortOnLsaBadAllocDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config abort on lsa bad alloc default response +func (o *FindConfigAbortOnLsaBadAllocDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigAbortOnLsaBadAllocDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigAbortOnLsaBadAllocDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigAbortOnLsaBadAllocDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_address_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_address_parameters.go new file mode 100644 index 0000000000..3f1278acd6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_address_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigAlternatorAddressParams creates a new FindConfigAlternatorAddressParams object +// with the default values initialized. +func NewFindConfigAlternatorAddressParams() *FindConfigAlternatorAddressParams { + + return &FindConfigAlternatorAddressParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigAlternatorAddressParamsWithTimeout creates a new FindConfigAlternatorAddressParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigAlternatorAddressParamsWithTimeout(timeout time.Duration) *FindConfigAlternatorAddressParams { + + return &FindConfigAlternatorAddressParams{ + + timeout: timeout, + } +} + +// NewFindConfigAlternatorAddressParamsWithContext creates a new FindConfigAlternatorAddressParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigAlternatorAddressParamsWithContext(ctx context.Context) *FindConfigAlternatorAddressParams { + + return &FindConfigAlternatorAddressParams{ + + Context: ctx, + } +} + +// NewFindConfigAlternatorAddressParamsWithHTTPClient creates a new FindConfigAlternatorAddressParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigAlternatorAddressParamsWithHTTPClient(client *http.Client) *FindConfigAlternatorAddressParams { + + return &FindConfigAlternatorAddressParams{ + HTTPClient: client, + } +} + +/* +FindConfigAlternatorAddressParams contains all the parameters to send to the API endpoint +for the find config alternator address operation typically these are written to a http.Request +*/ +type FindConfigAlternatorAddressParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config alternator address params +func (o *FindConfigAlternatorAddressParams) WithTimeout(timeout time.Duration) *FindConfigAlternatorAddressParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config alternator address params +func (o *FindConfigAlternatorAddressParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config alternator address params +func (o *FindConfigAlternatorAddressParams) WithContext(ctx context.Context) *FindConfigAlternatorAddressParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config alternator address params +func (o *FindConfigAlternatorAddressParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config alternator address params +func (o *FindConfigAlternatorAddressParams) WithHTTPClient(client *http.Client) *FindConfigAlternatorAddressParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config alternator address params +func (o *FindConfigAlternatorAddressParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigAlternatorAddressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_address_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_address_responses.go new file mode 100644 index 0000000000..d61b6dbd7f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_address_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigAlternatorAddressReader is a Reader for the FindConfigAlternatorAddress structure. +type FindConfigAlternatorAddressReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigAlternatorAddressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigAlternatorAddressOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigAlternatorAddressDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigAlternatorAddressOK creates a FindConfigAlternatorAddressOK with default headers values +func NewFindConfigAlternatorAddressOK() *FindConfigAlternatorAddressOK { + return &FindConfigAlternatorAddressOK{} +} + +/* +FindConfigAlternatorAddressOK handles this case with default header values. + +Config value +*/ +type FindConfigAlternatorAddressOK struct { + Payload string +} + +func (o *FindConfigAlternatorAddressOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigAlternatorAddressOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigAlternatorAddressDefault creates a FindConfigAlternatorAddressDefault with default headers values +func NewFindConfigAlternatorAddressDefault(code int) *FindConfigAlternatorAddressDefault { + return &FindConfigAlternatorAddressDefault{ + _statusCode: code, + } +} + +/* +FindConfigAlternatorAddressDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigAlternatorAddressDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config alternator address default response +func (o *FindConfigAlternatorAddressDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigAlternatorAddressDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigAlternatorAddressDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigAlternatorAddressDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_enforce_authorization_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_enforce_authorization_parameters.go new file mode 100644 index 0000000000..f82d5919e8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_enforce_authorization_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigAlternatorEnforceAuthorizationParams creates a new FindConfigAlternatorEnforceAuthorizationParams object +// with the default values initialized. +func NewFindConfigAlternatorEnforceAuthorizationParams() *FindConfigAlternatorEnforceAuthorizationParams { + + return &FindConfigAlternatorEnforceAuthorizationParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigAlternatorEnforceAuthorizationParamsWithTimeout creates a new FindConfigAlternatorEnforceAuthorizationParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigAlternatorEnforceAuthorizationParamsWithTimeout(timeout time.Duration) *FindConfigAlternatorEnforceAuthorizationParams { + + return &FindConfigAlternatorEnforceAuthorizationParams{ + + timeout: timeout, + } +} + +// NewFindConfigAlternatorEnforceAuthorizationParamsWithContext creates a new FindConfigAlternatorEnforceAuthorizationParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigAlternatorEnforceAuthorizationParamsWithContext(ctx context.Context) *FindConfigAlternatorEnforceAuthorizationParams { + + return &FindConfigAlternatorEnforceAuthorizationParams{ + + Context: ctx, + } +} + +// NewFindConfigAlternatorEnforceAuthorizationParamsWithHTTPClient creates a new FindConfigAlternatorEnforceAuthorizationParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigAlternatorEnforceAuthorizationParamsWithHTTPClient(client *http.Client) *FindConfigAlternatorEnforceAuthorizationParams { + + return &FindConfigAlternatorEnforceAuthorizationParams{ + HTTPClient: client, + } +} + +/* +FindConfigAlternatorEnforceAuthorizationParams contains all the parameters to send to the API endpoint +for the find config alternator enforce authorization operation typically these are written to a http.Request +*/ +type FindConfigAlternatorEnforceAuthorizationParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config alternator enforce authorization params +func (o *FindConfigAlternatorEnforceAuthorizationParams) WithTimeout(timeout time.Duration) *FindConfigAlternatorEnforceAuthorizationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config alternator enforce authorization params +func (o *FindConfigAlternatorEnforceAuthorizationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config alternator enforce authorization params +func (o *FindConfigAlternatorEnforceAuthorizationParams) WithContext(ctx context.Context) *FindConfigAlternatorEnforceAuthorizationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config alternator enforce authorization params +func (o *FindConfigAlternatorEnforceAuthorizationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config alternator enforce authorization params +func (o *FindConfigAlternatorEnforceAuthorizationParams) WithHTTPClient(client *http.Client) *FindConfigAlternatorEnforceAuthorizationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config alternator enforce authorization params +func (o *FindConfigAlternatorEnforceAuthorizationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigAlternatorEnforceAuthorizationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_enforce_authorization_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_enforce_authorization_responses.go new file mode 100644 index 0000000000..e484c42e2e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_enforce_authorization_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigAlternatorEnforceAuthorizationReader is a Reader for the FindConfigAlternatorEnforceAuthorization structure. +type FindConfigAlternatorEnforceAuthorizationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigAlternatorEnforceAuthorizationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigAlternatorEnforceAuthorizationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigAlternatorEnforceAuthorizationDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigAlternatorEnforceAuthorizationOK creates a FindConfigAlternatorEnforceAuthorizationOK with default headers values +func NewFindConfigAlternatorEnforceAuthorizationOK() *FindConfigAlternatorEnforceAuthorizationOK { + return &FindConfigAlternatorEnforceAuthorizationOK{} +} + +/* +FindConfigAlternatorEnforceAuthorizationOK handles this case with default header values. + +Config value +*/ +type FindConfigAlternatorEnforceAuthorizationOK struct { + Payload bool +} + +func (o *FindConfigAlternatorEnforceAuthorizationOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigAlternatorEnforceAuthorizationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigAlternatorEnforceAuthorizationDefault creates a FindConfigAlternatorEnforceAuthorizationDefault with default headers values +func NewFindConfigAlternatorEnforceAuthorizationDefault(code int) *FindConfigAlternatorEnforceAuthorizationDefault { + return &FindConfigAlternatorEnforceAuthorizationDefault{ + _statusCode: code, + } +} + +/* +FindConfigAlternatorEnforceAuthorizationDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigAlternatorEnforceAuthorizationDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config alternator enforce authorization default response +func (o *FindConfigAlternatorEnforceAuthorizationDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigAlternatorEnforceAuthorizationDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigAlternatorEnforceAuthorizationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigAlternatorEnforceAuthorizationDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_https_port_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_https_port_parameters.go new file mode 100644 index 0000000000..66b3525730 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_https_port_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigAlternatorHTTPSPortParams creates a new FindConfigAlternatorHTTPSPortParams object +// with the default values initialized. +func NewFindConfigAlternatorHTTPSPortParams() *FindConfigAlternatorHTTPSPortParams { + + return &FindConfigAlternatorHTTPSPortParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigAlternatorHTTPSPortParamsWithTimeout creates a new FindConfigAlternatorHTTPSPortParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigAlternatorHTTPSPortParamsWithTimeout(timeout time.Duration) *FindConfigAlternatorHTTPSPortParams { + + return &FindConfigAlternatorHTTPSPortParams{ + + timeout: timeout, + } +} + +// NewFindConfigAlternatorHTTPSPortParamsWithContext creates a new FindConfigAlternatorHTTPSPortParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigAlternatorHTTPSPortParamsWithContext(ctx context.Context) *FindConfigAlternatorHTTPSPortParams { + + return &FindConfigAlternatorHTTPSPortParams{ + + Context: ctx, + } +} + +// NewFindConfigAlternatorHTTPSPortParamsWithHTTPClient creates a new FindConfigAlternatorHTTPSPortParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigAlternatorHTTPSPortParamsWithHTTPClient(client *http.Client) *FindConfigAlternatorHTTPSPortParams { + + return &FindConfigAlternatorHTTPSPortParams{ + HTTPClient: client, + } +} + +/* +FindConfigAlternatorHTTPSPortParams contains all the parameters to send to the API endpoint +for the find config alternator https port operation typically these are written to a http.Request +*/ +type FindConfigAlternatorHTTPSPortParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config alternator https port params +func (o *FindConfigAlternatorHTTPSPortParams) WithTimeout(timeout time.Duration) *FindConfigAlternatorHTTPSPortParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config alternator https port params +func (o *FindConfigAlternatorHTTPSPortParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config alternator https port params +func (o *FindConfigAlternatorHTTPSPortParams) WithContext(ctx context.Context) *FindConfigAlternatorHTTPSPortParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config alternator https port params +func (o *FindConfigAlternatorHTTPSPortParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config alternator https port params +func (o *FindConfigAlternatorHTTPSPortParams) WithHTTPClient(client *http.Client) *FindConfigAlternatorHTTPSPortParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config alternator https port params +func (o *FindConfigAlternatorHTTPSPortParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigAlternatorHTTPSPortParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_https_port_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_https_port_responses.go new file mode 100644 index 0000000000..7019a6455b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_https_port_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigAlternatorHTTPSPortReader is a Reader for the FindConfigAlternatorHTTPSPort structure. +type FindConfigAlternatorHTTPSPortReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigAlternatorHTTPSPortReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigAlternatorHTTPSPortOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigAlternatorHTTPSPortDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigAlternatorHTTPSPortOK creates a FindConfigAlternatorHTTPSPortOK with default headers values +func NewFindConfigAlternatorHTTPSPortOK() *FindConfigAlternatorHTTPSPortOK { + return &FindConfigAlternatorHTTPSPortOK{} +} + +/* +FindConfigAlternatorHTTPSPortOK handles this case with default header values. + +Config value +*/ +type FindConfigAlternatorHTTPSPortOK struct { + Payload int64 +} + +func (o *FindConfigAlternatorHTTPSPortOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigAlternatorHTTPSPortOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigAlternatorHTTPSPortDefault creates a FindConfigAlternatorHTTPSPortDefault with default headers values +func NewFindConfigAlternatorHTTPSPortDefault(code int) *FindConfigAlternatorHTTPSPortDefault { + return &FindConfigAlternatorHTTPSPortDefault{ + _statusCode: code, + } +} + +/* +FindConfigAlternatorHTTPSPortDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigAlternatorHTTPSPortDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config alternator https port default response +func (o *FindConfigAlternatorHTTPSPortDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigAlternatorHTTPSPortDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigAlternatorHTTPSPortDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigAlternatorHTTPSPortDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_port_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_port_parameters.go new file mode 100644 index 0000000000..5cf22903de --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_port_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigAlternatorPortParams creates a new FindConfigAlternatorPortParams object +// with the default values initialized. +func NewFindConfigAlternatorPortParams() *FindConfigAlternatorPortParams { + + return &FindConfigAlternatorPortParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigAlternatorPortParamsWithTimeout creates a new FindConfigAlternatorPortParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigAlternatorPortParamsWithTimeout(timeout time.Duration) *FindConfigAlternatorPortParams { + + return &FindConfigAlternatorPortParams{ + + timeout: timeout, + } +} + +// NewFindConfigAlternatorPortParamsWithContext creates a new FindConfigAlternatorPortParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigAlternatorPortParamsWithContext(ctx context.Context) *FindConfigAlternatorPortParams { + + return &FindConfigAlternatorPortParams{ + + Context: ctx, + } +} + +// NewFindConfigAlternatorPortParamsWithHTTPClient creates a new FindConfigAlternatorPortParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigAlternatorPortParamsWithHTTPClient(client *http.Client) *FindConfigAlternatorPortParams { + + return &FindConfigAlternatorPortParams{ + HTTPClient: client, + } +} + +/* +FindConfigAlternatorPortParams contains all the parameters to send to the API endpoint +for the find config alternator port operation typically these are written to a http.Request +*/ +type FindConfigAlternatorPortParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config alternator port params +func (o *FindConfigAlternatorPortParams) WithTimeout(timeout time.Duration) *FindConfigAlternatorPortParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config alternator port params +func (o *FindConfigAlternatorPortParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config alternator port params +func (o *FindConfigAlternatorPortParams) WithContext(ctx context.Context) *FindConfigAlternatorPortParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config alternator port params +func (o *FindConfigAlternatorPortParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config alternator port params +func (o *FindConfigAlternatorPortParams) WithHTTPClient(client *http.Client) *FindConfigAlternatorPortParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config alternator port params +func (o *FindConfigAlternatorPortParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigAlternatorPortParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_port_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_port_responses.go new file mode 100644 index 0000000000..2484fcbb42 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_alternator_port_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigAlternatorPortReader is a Reader for the FindConfigAlternatorPort structure. +type FindConfigAlternatorPortReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigAlternatorPortReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigAlternatorPortOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigAlternatorPortDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigAlternatorPortOK creates a FindConfigAlternatorPortOK with default headers values +func NewFindConfigAlternatorPortOK() *FindConfigAlternatorPortOK { + return &FindConfigAlternatorPortOK{} +} + +/* +FindConfigAlternatorPortOK handles this case with default header values. + +Config value +*/ +type FindConfigAlternatorPortOK struct { + Payload int64 +} + +func (o *FindConfigAlternatorPortOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigAlternatorPortOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigAlternatorPortDefault creates a FindConfigAlternatorPortDefault with default headers values +func NewFindConfigAlternatorPortDefault(code int) *FindConfigAlternatorPortDefault { + return &FindConfigAlternatorPortDefault{ + _statusCode: code, + } +} + +/* +FindConfigAlternatorPortDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigAlternatorPortDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config alternator port default response +func (o *FindConfigAlternatorPortDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigAlternatorPortDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigAlternatorPortDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigAlternatorPortDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_address_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_address_parameters.go new file mode 100644 index 0000000000..b9cf9d7971 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_address_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigAPIAddressParams creates a new FindConfigAPIAddressParams object +// with the default values initialized. +func NewFindConfigAPIAddressParams() *FindConfigAPIAddressParams { + + return &FindConfigAPIAddressParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigAPIAddressParamsWithTimeout creates a new FindConfigAPIAddressParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigAPIAddressParamsWithTimeout(timeout time.Duration) *FindConfigAPIAddressParams { + + return &FindConfigAPIAddressParams{ + + timeout: timeout, + } +} + +// NewFindConfigAPIAddressParamsWithContext creates a new FindConfigAPIAddressParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigAPIAddressParamsWithContext(ctx context.Context) *FindConfigAPIAddressParams { + + return &FindConfigAPIAddressParams{ + + Context: ctx, + } +} + +// NewFindConfigAPIAddressParamsWithHTTPClient creates a new FindConfigAPIAddressParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigAPIAddressParamsWithHTTPClient(client *http.Client) *FindConfigAPIAddressParams { + + return &FindConfigAPIAddressParams{ + HTTPClient: client, + } +} + +/* +FindConfigAPIAddressParams contains all the parameters to send to the API endpoint +for the find config api address operation typically these are written to a http.Request +*/ +type FindConfigAPIAddressParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config api address params +func (o *FindConfigAPIAddressParams) WithTimeout(timeout time.Duration) *FindConfigAPIAddressParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config api address params +func (o *FindConfigAPIAddressParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config api address params +func (o *FindConfigAPIAddressParams) WithContext(ctx context.Context) *FindConfigAPIAddressParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config api address params +func (o *FindConfigAPIAddressParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config api address params +func (o *FindConfigAPIAddressParams) WithHTTPClient(client *http.Client) *FindConfigAPIAddressParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config api address params +func (o *FindConfigAPIAddressParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigAPIAddressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_address_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_address_responses.go new file mode 100644 index 0000000000..bc9c0db62b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_address_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigAPIAddressReader is a Reader for the FindConfigAPIAddress structure. +type FindConfigAPIAddressReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigAPIAddressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigAPIAddressOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigAPIAddressDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigAPIAddressOK creates a FindConfigAPIAddressOK with default headers values +func NewFindConfigAPIAddressOK() *FindConfigAPIAddressOK { + return &FindConfigAPIAddressOK{} +} + +/* +FindConfigAPIAddressOK handles this case with default header values. + +Config value +*/ +type FindConfigAPIAddressOK struct { + Payload string +} + +func (o *FindConfigAPIAddressOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigAPIAddressOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigAPIAddressDefault creates a FindConfigAPIAddressDefault with default headers values +func NewFindConfigAPIAddressDefault(code int) *FindConfigAPIAddressDefault { + return &FindConfigAPIAddressDefault{ + _statusCode: code, + } +} + +/* +FindConfigAPIAddressDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigAPIAddressDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config api address default response +func (o *FindConfigAPIAddressDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigAPIAddressDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigAPIAddressDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigAPIAddressDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_doc_dir_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_doc_dir_parameters.go new file mode 100644 index 0000000000..d0780ab629 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_doc_dir_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigAPIDocDirParams creates a new FindConfigAPIDocDirParams object +// with the default values initialized. +func NewFindConfigAPIDocDirParams() *FindConfigAPIDocDirParams { + + return &FindConfigAPIDocDirParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigAPIDocDirParamsWithTimeout creates a new FindConfigAPIDocDirParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigAPIDocDirParamsWithTimeout(timeout time.Duration) *FindConfigAPIDocDirParams { + + return &FindConfigAPIDocDirParams{ + + timeout: timeout, + } +} + +// NewFindConfigAPIDocDirParamsWithContext creates a new FindConfigAPIDocDirParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigAPIDocDirParamsWithContext(ctx context.Context) *FindConfigAPIDocDirParams { + + return &FindConfigAPIDocDirParams{ + + Context: ctx, + } +} + +// NewFindConfigAPIDocDirParamsWithHTTPClient creates a new FindConfigAPIDocDirParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigAPIDocDirParamsWithHTTPClient(client *http.Client) *FindConfigAPIDocDirParams { + + return &FindConfigAPIDocDirParams{ + HTTPClient: client, + } +} + +/* +FindConfigAPIDocDirParams contains all the parameters to send to the API endpoint +for the find config api doc dir operation typically these are written to a http.Request +*/ +type FindConfigAPIDocDirParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config api doc dir params +func (o *FindConfigAPIDocDirParams) WithTimeout(timeout time.Duration) *FindConfigAPIDocDirParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config api doc dir params +func (o *FindConfigAPIDocDirParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config api doc dir params +func (o *FindConfigAPIDocDirParams) WithContext(ctx context.Context) *FindConfigAPIDocDirParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config api doc dir params +func (o *FindConfigAPIDocDirParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config api doc dir params +func (o *FindConfigAPIDocDirParams) WithHTTPClient(client *http.Client) *FindConfigAPIDocDirParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config api doc dir params +func (o *FindConfigAPIDocDirParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigAPIDocDirParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_doc_dir_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_doc_dir_responses.go new file mode 100644 index 0000000000..e8e69ff313 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_doc_dir_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigAPIDocDirReader is a Reader for the FindConfigAPIDocDir structure. +type FindConfigAPIDocDirReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigAPIDocDirReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigAPIDocDirOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigAPIDocDirDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigAPIDocDirOK creates a FindConfigAPIDocDirOK with default headers values +func NewFindConfigAPIDocDirOK() *FindConfigAPIDocDirOK { + return &FindConfigAPIDocDirOK{} +} + +/* +FindConfigAPIDocDirOK handles this case with default header values. + +Config value +*/ +type FindConfigAPIDocDirOK struct { + Payload string +} + +func (o *FindConfigAPIDocDirOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigAPIDocDirOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigAPIDocDirDefault creates a FindConfigAPIDocDirDefault with default headers values +func NewFindConfigAPIDocDirDefault(code int) *FindConfigAPIDocDirDefault { + return &FindConfigAPIDocDirDefault{ + _statusCode: code, + } +} + +/* +FindConfigAPIDocDirDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigAPIDocDirDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config api doc dir default response +func (o *FindConfigAPIDocDirDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigAPIDocDirDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigAPIDocDirDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigAPIDocDirDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_port_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_port_parameters.go new file mode 100644 index 0000000000..d336f25643 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_port_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigAPIPortParams creates a new FindConfigAPIPortParams object +// with the default values initialized. +func NewFindConfigAPIPortParams() *FindConfigAPIPortParams { + + return &FindConfigAPIPortParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigAPIPortParamsWithTimeout creates a new FindConfigAPIPortParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigAPIPortParamsWithTimeout(timeout time.Duration) *FindConfigAPIPortParams { + + return &FindConfigAPIPortParams{ + + timeout: timeout, + } +} + +// NewFindConfigAPIPortParamsWithContext creates a new FindConfigAPIPortParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigAPIPortParamsWithContext(ctx context.Context) *FindConfigAPIPortParams { + + return &FindConfigAPIPortParams{ + + Context: ctx, + } +} + +// NewFindConfigAPIPortParamsWithHTTPClient creates a new FindConfigAPIPortParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigAPIPortParamsWithHTTPClient(client *http.Client) *FindConfigAPIPortParams { + + return &FindConfigAPIPortParams{ + HTTPClient: client, + } +} + +/* +FindConfigAPIPortParams contains all the parameters to send to the API endpoint +for the find config api port operation typically these are written to a http.Request +*/ +type FindConfigAPIPortParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config api port params +func (o *FindConfigAPIPortParams) WithTimeout(timeout time.Duration) *FindConfigAPIPortParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config api port params +func (o *FindConfigAPIPortParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config api port params +func (o *FindConfigAPIPortParams) WithContext(ctx context.Context) *FindConfigAPIPortParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config api port params +func (o *FindConfigAPIPortParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config api port params +func (o *FindConfigAPIPortParams) WithHTTPClient(client *http.Client) *FindConfigAPIPortParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config api port params +func (o *FindConfigAPIPortParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigAPIPortParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_port_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_port_responses.go new file mode 100644 index 0000000000..f71b952219 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_port_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigAPIPortReader is a Reader for the FindConfigAPIPort structure. +type FindConfigAPIPortReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigAPIPortReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigAPIPortOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigAPIPortDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigAPIPortOK creates a FindConfigAPIPortOK with default headers values +func NewFindConfigAPIPortOK() *FindConfigAPIPortOK { + return &FindConfigAPIPortOK{} +} + +/* +FindConfigAPIPortOK handles this case with default header values. + +Config value +*/ +type FindConfigAPIPortOK struct { + Payload int64 +} + +func (o *FindConfigAPIPortOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigAPIPortOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigAPIPortDefault creates a FindConfigAPIPortDefault with default headers values +func NewFindConfigAPIPortDefault(code int) *FindConfigAPIPortDefault { + return &FindConfigAPIPortDefault{ + _statusCode: code, + } +} + +/* +FindConfigAPIPortDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigAPIPortDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config api port default response +func (o *FindConfigAPIPortDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigAPIPortDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigAPIPortDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigAPIPortDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_ui_dir_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_ui_dir_parameters.go new file mode 100644 index 0000000000..5fbb417c3a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_ui_dir_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigAPIUIDirParams creates a new FindConfigAPIUIDirParams object +// with the default values initialized. +func NewFindConfigAPIUIDirParams() *FindConfigAPIUIDirParams { + + return &FindConfigAPIUIDirParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigAPIUIDirParamsWithTimeout creates a new FindConfigAPIUIDirParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigAPIUIDirParamsWithTimeout(timeout time.Duration) *FindConfigAPIUIDirParams { + + return &FindConfigAPIUIDirParams{ + + timeout: timeout, + } +} + +// NewFindConfigAPIUIDirParamsWithContext creates a new FindConfigAPIUIDirParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigAPIUIDirParamsWithContext(ctx context.Context) *FindConfigAPIUIDirParams { + + return &FindConfigAPIUIDirParams{ + + Context: ctx, + } +} + +// NewFindConfigAPIUIDirParamsWithHTTPClient creates a new FindConfigAPIUIDirParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigAPIUIDirParamsWithHTTPClient(client *http.Client) *FindConfigAPIUIDirParams { + + return &FindConfigAPIUIDirParams{ + HTTPClient: client, + } +} + +/* +FindConfigAPIUIDirParams contains all the parameters to send to the API endpoint +for the find config api ui dir operation typically these are written to a http.Request +*/ +type FindConfigAPIUIDirParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config api ui dir params +func (o *FindConfigAPIUIDirParams) WithTimeout(timeout time.Duration) *FindConfigAPIUIDirParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config api ui dir params +func (o *FindConfigAPIUIDirParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config api ui dir params +func (o *FindConfigAPIUIDirParams) WithContext(ctx context.Context) *FindConfigAPIUIDirParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config api ui dir params +func (o *FindConfigAPIUIDirParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config api ui dir params +func (o *FindConfigAPIUIDirParams) WithHTTPClient(client *http.Client) *FindConfigAPIUIDirParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config api ui dir params +func (o *FindConfigAPIUIDirParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigAPIUIDirParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_ui_dir_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_ui_dir_responses.go new file mode 100644 index 0000000000..2fb22ac96a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_api_ui_dir_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigAPIUIDirReader is a Reader for the FindConfigAPIUIDir structure. +type FindConfigAPIUIDirReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigAPIUIDirReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigAPIUIDirOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigAPIUIDirDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigAPIUIDirOK creates a FindConfigAPIUIDirOK with default headers values +func NewFindConfigAPIUIDirOK() *FindConfigAPIUIDirOK { + return &FindConfigAPIUIDirOK{} +} + +/* +FindConfigAPIUIDirOK handles this case with default header values. + +Config value +*/ +type FindConfigAPIUIDirOK struct { + Payload string +} + +func (o *FindConfigAPIUIDirOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigAPIUIDirOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigAPIUIDirDefault creates a FindConfigAPIUIDirDefault with default headers values +func NewFindConfigAPIUIDirDefault(code int) *FindConfigAPIUIDirDefault { + return &FindConfigAPIUIDirDefault{ + _statusCode: code, + } +} + +/* +FindConfigAPIUIDirDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigAPIUIDirDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config api ui dir default response +func (o *FindConfigAPIUIDirDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigAPIUIDirDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigAPIUIDirDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigAPIUIDirDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_authenticator_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_authenticator_parameters.go new file mode 100644 index 0000000000..9778189004 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_authenticator_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigAuthenticatorParams creates a new FindConfigAuthenticatorParams object +// with the default values initialized. +func NewFindConfigAuthenticatorParams() *FindConfigAuthenticatorParams { + + return &FindConfigAuthenticatorParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigAuthenticatorParamsWithTimeout creates a new FindConfigAuthenticatorParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigAuthenticatorParamsWithTimeout(timeout time.Duration) *FindConfigAuthenticatorParams { + + return &FindConfigAuthenticatorParams{ + + timeout: timeout, + } +} + +// NewFindConfigAuthenticatorParamsWithContext creates a new FindConfigAuthenticatorParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigAuthenticatorParamsWithContext(ctx context.Context) *FindConfigAuthenticatorParams { + + return &FindConfigAuthenticatorParams{ + + Context: ctx, + } +} + +// NewFindConfigAuthenticatorParamsWithHTTPClient creates a new FindConfigAuthenticatorParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigAuthenticatorParamsWithHTTPClient(client *http.Client) *FindConfigAuthenticatorParams { + + return &FindConfigAuthenticatorParams{ + HTTPClient: client, + } +} + +/* +FindConfigAuthenticatorParams contains all the parameters to send to the API endpoint +for the find config authenticator operation typically these are written to a http.Request +*/ +type FindConfigAuthenticatorParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config authenticator params +func (o *FindConfigAuthenticatorParams) WithTimeout(timeout time.Duration) *FindConfigAuthenticatorParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config authenticator params +func (o *FindConfigAuthenticatorParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config authenticator params +func (o *FindConfigAuthenticatorParams) WithContext(ctx context.Context) *FindConfigAuthenticatorParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config authenticator params +func (o *FindConfigAuthenticatorParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config authenticator params +func (o *FindConfigAuthenticatorParams) WithHTTPClient(client *http.Client) *FindConfigAuthenticatorParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config authenticator params +func (o *FindConfigAuthenticatorParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_authenticator_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_authenticator_responses.go new file mode 100644 index 0000000000..f638bb7206 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_authenticator_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigAuthenticatorReader is a Reader for the FindConfigAuthenticator structure. +type FindConfigAuthenticatorReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigAuthenticatorOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigAuthenticatorDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigAuthenticatorOK creates a FindConfigAuthenticatorOK with default headers values +func NewFindConfigAuthenticatorOK() *FindConfigAuthenticatorOK { + return &FindConfigAuthenticatorOK{} +} + +/* +FindConfigAuthenticatorOK handles this case with default header values. + +Config value +*/ +type FindConfigAuthenticatorOK struct { + Payload string +} + +func (o *FindConfigAuthenticatorOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigAuthenticatorDefault creates a FindConfigAuthenticatorDefault with default headers values +func NewFindConfigAuthenticatorDefault(code int) *FindConfigAuthenticatorDefault { + return &FindConfigAuthenticatorDefault{ + _statusCode: code, + } +} + +/* +FindConfigAuthenticatorDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigAuthenticatorDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config authenticator default response +func (o *FindConfigAuthenticatorDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigAuthenticatorDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigAuthenticatorDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigAuthenticatorDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_authorizer_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_authorizer_parameters.go new file mode 100644 index 0000000000..0c48493df8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_authorizer_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigAuthorizerParams creates a new FindConfigAuthorizerParams object +// with the default values initialized. +func NewFindConfigAuthorizerParams() *FindConfigAuthorizerParams { + + return &FindConfigAuthorizerParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigAuthorizerParamsWithTimeout creates a new FindConfigAuthorizerParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigAuthorizerParamsWithTimeout(timeout time.Duration) *FindConfigAuthorizerParams { + + return &FindConfigAuthorizerParams{ + + timeout: timeout, + } +} + +// NewFindConfigAuthorizerParamsWithContext creates a new FindConfigAuthorizerParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigAuthorizerParamsWithContext(ctx context.Context) *FindConfigAuthorizerParams { + + return &FindConfigAuthorizerParams{ + + Context: ctx, + } +} + +// NewFindConfigAuthorizerParamsWithHTTPClient creates a new FindConfigAuthorizerParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigAuthorizerParamsWithHTTPClient(client *http.Client) *FindConfigAuthorizerParams { + + return &FindConfigAuthorizerParams{ + HTTPClient: client, + } +} + +/* +FindConfigAuthorizerParams contains all the parameters to send to the API endpoint +for the find config authorizer operation typically these are written to a http.Request +*/ +type FindConfigAuthorizerParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config authorizer params +func (o *FindConfigAuthorizerParams) WithTimeout(timeout time.Duration) *FindConfigAuthorizerParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config authorizer params +func (o *FindConfigAuthorizerParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config authorizer params +func (o *FindConfigAuthorizerParams) WithContext(ctx context.Context) *FindConfigAuthorizerParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config authorizer params +func (o *FindConfigAuthorizerParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config authorizer params +func (o *FindConfigAuthorizerParams) WithHTTPClient(client *http.Client) *FindConfigAuthorizerParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config authorizer params +func (o *FindConfigAuthorizerParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigAuthorizerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_authorizer_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_authorizer_responses.go new file mode 100644 index 0000000000..5683020ad3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_authorizer_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigAuthorizerReader is a Reader for the FindConfigAuthorizer structure. +type FindConfigAuthorizerReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigAuthorizerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigAuthorizerOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigAuthorizerDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigAuthorizerOK creates a FindConfigAuthorizerOK with default headers values +func NewFindConfigAuthorizerOK() *FindConfigAuthorizerOK { + return &FindConfigAuthorizerOK{} +} + +/* +FindConfigAuthorizerOK handles this case with default header values. + +Config value +*/ +type FindConfigAuthorizerOK struct { + Payload string +} + +func (o *FindConfigAuthorizerOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigAuthorizerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigAuthorizerDefault creates a FindConfigAuthorizerDefault with default headers values +func NewFindConfigAuthorizerDefault(code int) *FindConfigAuthorizerDefault { + return &FindConfigAuthorizerDefault{ + _statusCode: code, + } +} + +/* +FindConfigAuthorizerDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigAuthorizerDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config authorizer default response +func (o *FindConfigAuthorizerDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigAuthorizerDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigAuthorizerDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigAuthorizerDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_adjust_flush_quota_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_adjust_flush_quota_parameters.go new file mode 100644 index 0000000000..9f3a02f91e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_adjust_flush_quota_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigAutoAdjustFlushQuotaParams creates a new FindConfigAutoAdjustFlushQuotaParams object +// with the default values initialized. +func NewFindConfigAutoAdjustFlushQuotaParams() *FindConfigAutoAdjustFlushQuotaParams { + + return &FindConfigAutoAdjustFlushQuotaParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigAutoAdjustFlushQuotaParamsWithTimeout creates a new FindConfigAutoAdjustFlushQuotaParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigAutoAdjustFlushQuotaParamsWithTimeout(timeout time.Duration) *FindConfigAutoAdjustFlushQuotaParams { + + return &FindConfigAutoAdjustFlushQuotaParams{ + + timeout: timeout, + } +} + +// NewFindConfigAutoAdjustFlushQuotaParamsWithContext creates a new FindConfigAutoAdjustFlushQuotaParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigAutoAdjustFlushQuotaParamsWithContext(ctx context.Context) *FindConfigAutoAdjustFlushQuotaParams { + + return &FindConfigAutoAdjustFlushQuotaParams{ + + Context: ctx, + } +} + +// NewFindConfigAutoAdjustFlushQuotaParamsWithHTTPClient creates a new FindConfigAutoAdjustFlushQuotaParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigAutoAdjustFlushQuotaParamsWithHTTPClient(client *http.Client) *FindConfigAutoAdjustFlushQuotaParams { + + return &FindConfigAutoAdjustFlushQuotaParams{ + HTTPClient: client, + } +} + +/* +FindConfigAutoAdjustFlushQuotaParams contains all the parameters to send to the API endpoint +for the find config auto adjust flush quota operation typically these are written to a http.Request +*/ +type FindConfigAutoAdjustFlushQuotaParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config auto adjust flush quota params +func (o *FindConfigAutoAdjustFlushQuotaParams) WithTimeout(timeout time.Duration) *FindConfigAutoAdjustFlushQuotaParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config auto adjust flush quota params +func (o *FindConfigAutoAdjustFlushQuotaParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config auto adjust flush quota params +func (o *FindConfigAutoAdjustFlushQuotaParams) WithContext(ctx context.Context) *FindConfigAutoAdjustFlushQuotaParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config auto adjust flush quota params +func (o *FindConfigAutoAdjustFlushQuotaParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config auto adjust flush quota params +func (o *FindConfigAutoAdjustFlushQuotaParams) WithHTTPClient(client *http.Client) *FindConfigAutoAdjustFlushQuotaParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config auto adjust flush quota params +func (o *FindConfigAutoAdjustFlushQuotaParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigAutoAdjustFlushQuotaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_adjust_flush_quota_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_adjust_flush_quota_responses.go new file mode 100644 index 0000000000..502efa5c7b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_adjust_flush_quota_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigAutoAdjustFlushQuotaReader is a Reader for the FindConfigAutoAdjustFlushQuota structure. +type FindConfigAutoAdjustFlushQuotaReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigAutoAdjustFlushQuotaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigAutoAdjustFlushQuotaOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigAutoAdjustFlushQuotaDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigAutoAdjustFlushQuotaOK creates a FindConfigAutoAdjustFlushQuotaOK with default headers values +func NewFindConfigAutoAdjustFlushQuotaOK() *FindConfigAutoAdjustFlushQuotaOK { + return &FindConfigAutoAdjustFlushQuotaOK{} +} + +/* +FindConfigAutoAdjustFlushQuotaOK handles this case with default header values. + +Config value +*/ +type FindConfigAutoAdjustFlushQuotaOK struct { + Payload bool +} + +func (o *FindConfigAutoAdjustFlushQuotaOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigAutoAdjustFlushQuotaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigAutoAdjustFlushQuotaDefault creates a FindConfigAutoAdjustFlushQuotaDefault with default headers values +func NewFindConfigAutoAdjustFlushQuotaDefault(code int) *FindConfigAutoAdjustFlushQuotaDefault { + return &FindConfigAutoAdjustFlushQuotaDefault{ + _statusCode: code, + } +} + +/* +FindConfigAutoAdjustFlushQuotaDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigAutoAdjustFlushQuotaDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config auto adjust flush quota default response +func (o *FindConfigAutoAdjustFlushQuotaDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigAutoAdjustFlushQuotaDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigAutoAdjustFlushQuotaDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigAutoAdjustFlushQuotaDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_bootstrap_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_bootstrap_parameters.go new file mode 100644 index 0000000000..9d73bd2fbf --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_bootstrap_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigAutoBootstrapParams creates a new FindConfigAutoBootstrapParams object +// with the default values initialized. +func NewFindConfigAutoBootstrapParams() *FindConfigAutoBootstrapParams { + + return &FindConfigAutoBootstrapParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigAutoBootstrapParamsWithTimeout creates a new FindConfigAutoBootstrapParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigAutoBootstrapParamsWithTimeout(timeout time.Duration) *FindConfigAutoBootstrapParams { + + return &FindConfigAutoBootstrapParams{ + + timeout: timeout, + } +} + +// NewFindConfigAutoBootstrapParamsWithContext creates a new FindConfigAutoBootstrapParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigAutoBootstrapParamsWithContext(ctx context.Context) *FindConfigAutoBootstrapParams { + + return &FindConfigAutoBootstrapParams{ + + Context: ctx, + } +} + +// NewFindConfigAutoBootstrapParamsWithHTTPClient creates a new FindConfigAutoBootstrapParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigAutoBootstrapParamsWithHTTPClient(client *http.Client) *FindConfigAutoBootstrapParams { + + return &FindConfigAutoBootstrapParams{ + HTTPClient: client, + } +} + +/* +FindConfigAutoBootstrapParams contains all the parameters to send to the API endpoint +for the find config auto bootstrap operation typically these are written to a http.Request +*/ +type FindConfigAutoBootstrapParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config auto bootstrap params +func (o *FindConfigAutoBootstrapParams) WithTimeout(timeout time.Duration) *FindConfigAutoBootstrapParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config auto bootstrap params +func (o *FindConfigAutoBootstrapParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config auto bootstrap params +func (o *FindConfigAutoBootstrapParams) WithContext(ctx context.Context) *FindConfigAutoBootstrapParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config auto bootstrap params +func (o *FindConfigAutoBootstrapParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config auto bootstrap params +func (o *FindConfigAutoBootstrapParams) WithHTTPClient(client *http.Client) *FindConfigAutoBootstrapParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config auto bootstrap params +func (o *FindConfigAutoBootstrapParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigAutoBootstrapParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_bootstrap_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_bootstrap_responses.go new file mode 100644 index 0000000000..2132becae3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_bootstrap_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigAutoBootstrapReader is a Reader for the FindConfigAutoBootstrap structure. +type FindConfigAutoBootstrapReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigAutoBootstrapReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigAutoBootstrapOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigAutoBootstrapDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigAutoBootstrapOK creates a FindConfigAutoBootstrapOK with default headers values +func NewFindConfigAutoBootstrapOK() *FindConfigAutoBootstrapOK { + return &FindConfigAutoBootstrapOK{} +} + +/* +FindConfigAutoBootstrapOK handles this case with default header values. + +Config value +*/ +type FindConfigAutoBootstrapOK struct { + Payload bool +} + +func (o *FindConfigAutoBootstrapOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigAutoBootstrapOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigAutoBootstrapDefault creates a FindConfigAutoBootstrapDefault with default headers values +func NewFindConfigAutoBootstrapDefault(code int) *FindConfigAutoBootstrapDefault { + return &FindConfigAutoBootstrapDefault{ + _statusCode: code, + } +} + +/* +FindConfigAutoBootstrapDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigAutoBootstrapDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config auto bootstrap default response +func (o *FindConfigAutoBootstrapDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigAutoBootstrapDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigAutoBootstrapDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigAutoBootstrapDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_snapshot_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_snapshot_parameters.go new file mode 100644 index 0000000000..6ce6dd83ae --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_snapshot_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigAutoSnapshotParams creates a new FindConfigAutoSnapshotParams object +// with the default values initialized. +func NewFindConfigAutoSnapshotParams() *FindConfigAutoSnapshotParams { + + return &FindConfigAutoSnapshotParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigAutoSnapshotParamsWithTimeout creates a new FindConfigAutoSnapshotParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigAutoSnapshotParamsWithTimeout(timeout time.Duration) *FindConfigAutoSnapshotParams { + + return &FindConfigAutoSnapshotParams{ + + timeout: timeout, + } +} + +// NewFindConfigAutoSnapshotParamsWithContext creates a new FindConfigAutoSnapshotParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigAutoSnapshotParamsWithContext(ctx context.Context) *FindConfigAutoSnapshotParams { + + return &FindConfigAutoSnapshotParams{ + + Context: ctx, + } +} + +// NewFindConfigAutoSnapshotParamsWithHTTPClient creates a new FindConfigAutoSnapshotParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigAutoSnapshotParamsWithHTTPClient(client *http.Client) *FindConfigAutoSnapshotParams { + + return &FindConfigAutoSnapshotParams{ + HTTPClient: client, + } +} + +/* +FindConfigAutoSnapshotParams contains all the parameters to send to the API endpoint +for the find config auto snapshot operation typically these are written to a http.Request +*/ +type FindConfigAutoSnapshotParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config auto snapshot params +func (o *FindConfigAutoSnapshotParams) WithTimeout(timeout time.Duration) *FindConfigAutoSnapshotParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config auto snapshot params +func (o *FindConfigAutoSnapshotParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config auto snapshot params +func (o *FindConfigAutoSnapshotParams) WithContext(ctx context.Context) *FindConfigAutoSnapshotParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config auto snapshot params +func (o *FindConfigAutoSnapshotParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config auto snapshot params +func (o *FindConfigAutoSnapshotParams) WithHTTPClient(client *http.Client) *FindConfigAutoSnapshotParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config auto snapshot params +func (o *FindConfigAutoSnapshotParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigAutoSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_snapshot_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_snapshot_responses.go new file mode 100644 index 0000000000..2ee4f0d0b6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_auto_snapshot_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigAutoSnapshotReader is a Reader for the FindConfigAutoSnapshot structure. +type FindConfigAutoSnapshotReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigAutoSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigAutoSnapshotOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigAutoSnapshotDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigAutoSnapshotOK creates a FindConfigAutoSnapshotOK with default headers values +func NewFindConfigAutoSnapshotOK() *FindConfigAutoSnapshotOK { + return &FindConfigAutoSnapshotOK{} +} + +/* +FindConfigAutoSnapshotOK handles this case with default header values. + +Config value +*/ +type FindConfigAutoSnapshotOK struct { + Payload bool +} + +func (o *FindConfigAutoSnapshotOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigAutoSnapshotOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigAutoSnapshotDefault creates a FindConfigAutoSnapshotDefault with default headers values +func NewFindConfigAutoSnapshotDefault(code int) *FindConfigAutoSnapshotDefault { + return &FindConfigAutoSnapshotDefault{ + _statusCode: code, + } +} + +/* +FindConfigAutoSnapshotDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigAutoSnapshotDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config auto snapshot default response +func (o *FindConfigAutoSnapshotDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigAutoSnapshotDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigAutoSnapshotDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigAutoSnapshotDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_background_writer_scheduling_quota_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_background_writer_scheduling_quota_parameters.go new file mode 100644 index 0000000000..03c7d8747d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_background_writer_scheduling_quota_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigBackgroundWriterSchedulingQuotaParams creates a new FindConfigBackgroundWriterSchedulingQuotaParams object +// with the default values initialized. +func NewFindConfigBackgroundWriterSchedulingQuotaParams() *FindConfigBackgroundWriterSchedulingQuotaParams { + + return &FindConfigBackgroundWriterSchedulingQuotaParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigBackgroundWriterSchedulingQuotaParamsWithTimeout creates a new FindConfigBackgroundWriterSchedulingQuotaParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigBackgroundWriterSchedulingQuotaParamsWithTimeout(timeout time.Duration) *FindConfigBackgroundWriterSchedulingQuotaParams { + + return &FindConfigBackgroundWriterSchedulingQuotaParams{ + + timeout: timeout, + } +} + +// NewFindConfigBackgroundWriterSchedulingQuotaParamsWithContext creates a new FindConfigBackgroundWriterSchedulingQuotaParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigBackgroundWriterSchedulingQuotaParamsWithContext(ctx context.Context) *FindConfigBackgroundWriterSchedulingQuotaParams { + + return &FindConfigBackgroundWriterSchedulingQuotaParams{ + + Context: ctx, + } +} + +// NewFindConfigBackgroundWriterSchedulingQuotaParamsWithHTTPClient creates a new FindConfigBackgroundWriterSchedulingQuotaParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigBackgroundWriterSchedulingQuotaParamsWithHTTPClient(client *http.Client) *FindConfigBackgroundWriterSchedulingQuotaParams { + + return &FindConfigBackgroundWriterSchedulingQuotaParams{ + HTTPClient: client, + } +} + +/* +FindConfigBackgroundWriterSchedulingQuotaParams contains all the parameters to send to the API endpoint +for the find config background writer scheduling quota operation typically these are written to a http.Request +*/ +type FindConfigBackgroundWriterSchedulingQuotaParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config background writer scheduling quota params +func (o *FindConfigBackgroundWriterSchedulingQuotaParams) WithTimeout(timeout time.Duration) *FindConfigBackgroundWriterSchedulingQuotaParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config background writer scheduling quota params +func (o *FindConfigBackgroundWriterSchedulingQuotaParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config background writer scheduling quota params +func (o *FindConfigBackgroundWriterSchedulingQuotaParams) WithContext(ctx context.Context) *FindConfigBackgroundWriterSchedulingQuotaParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config background writer scheduling quota params +func (o *FindConfigBackgroundWriterSchedulingQuotaParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config background writer scheduling quota params +func (o *FindConfigBackgroundWriterSchedulingQuotaParams) WithHTTPClient(client *http.Client) *FindConfigBackgroundWriterSchedulingQuotaParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config background writer scheduling quota params +func (o *FindConfigBackgroundWriterSchedulingQuotaParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigBackgroundWriterSchedulingQuotaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_background_writer_scheduling_quota_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_background_writer_scheduling_quota_responses.go new file mode 100644 index 0000000000..86f0616565 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_background_writer_scheduling_quota_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigBackgroundWriterSchedulingQuotaReader is a Reader for the FindConfigBackgroundWriterSchedulingQuota structure. +type FindConfigBackgroundWriterSchedulingQuotaReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigBackgroundWriterSchedulingQuotaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigBackgroundWriterSchedulingQuotaOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigBackgroundWriterSchedulingQuotaDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigBackgroundWriterSchedulingQuotaOK creates a FindConfigBackgroundWriterSchedulingQuotaOK with default headers values +func NewFindConfigBackgroundWriterSchedulingQuotaOK() *FindConfigBackgroundWriterSchedulingQuotaOK { + return &FindConfigBackgroundWriterSchedulingQuotaOK{} +} + +/* +FindConfigBackgroundWriterSchedulingQuotaOK handles this case with default header values. + +Config value +*/ +type FindConfigBackgroundWriterSchedulingQuotaOK struct { + Payload float64 +} + +func (o *FindConfigBackgroundWriterSchedulingQuotaOK) GetPayload() float64 { + return o.Payload +} + +func (o *FindConfigBackgroundWriterSchedulingQuotaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigBackgroundWriterSchedulingQuotaDefault creates a FindConfigBackgroundWriterSchedulingQuotaDefault with default headers values +func NewFindConfigBackgroundWriterSchedulingQuotaDefault(code int) *FindConfigBackgroundWriterSchedulingQuotaDefault { + return &FindConfigBackgroundWriterSchedulingQuotaDefault{ + _statusCode: code, + } +} + +/* +FindConfigBackgroundWriterSchedulingQuotaDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigBackgroundWriterSchedulingQuotaDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config background writer scheduling quota default response +func (o *FindConfigBackgroundWriterSchedulingQuotaDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigBackgroundWriterSchedulingQuotaDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigBackgroundWriterSchedulingQuotaDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigBackgroundWriterSchedulingQuotaDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batch_size_fail_threshold_in_kb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batch_size_fail_threshold_in_kb_parameters.go new file mode 100644 index 0000000000..d0ebb4df6d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batch_size_fail_threshold_in_kb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigBatchSizeFailThresholdInKbParams creates a new FindConfigBatchSizeFailThresholdInKbParams object +// with the default values initialized. +func NewFindConfigBatchSizeFailThresholdInKbParams() *FindConfigBatchSizeFailThresholdInKbParams { + + return &FindConfigBatchSizeFailThresholdInKbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigBatchSizeFailThresholdInKbParamsWithTimeout creates a new FindConfigBatchSizeFailThresholdInKbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigBatchSizeFailThresholdInKbParamsWithTimeout(timeout time.Duration) *FindConfigBatchSizeFailThresholdInKbParams { + + return &FindConfigBatchSizeFailThresholdInKbParams{ + + timeout: timeout, + } +} + +// NewFindConfigBatchSizeFailThresholdInKbParamsWithContext creates a new FindConfigBatchSizeFailThresholdInKbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigBatchSizeFailThresholdInKbParamsWithContext(ctx context.Context) *FindConfigBatchSizeFailThresholdInKbParams { + + return &FindConfigBatchSizeFailThresholdInKbParams{ + + Context: ctx, + } +} + +// NewFindConfigBatchSizeFailThresholdInKbParamsWithHTTPClient creates a new FindConfigBatchSizeFailThresholdInKbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigBatchSizeFailThresholdInKbParamsWithHTTPClient(client *http.Client) *FindConfigBatchSizeFailThresholdInKbParams { + + return &FindConfigBatchSizeFailThresholdInKbParams{ + HTTPClient: client, + } +} + +/* +FindConfigBatchSizeFailThresholdInKbParams contains all the parameters to send to the API endpoint +for the find config batch size fail threshold in kb operation typically these are written to a http.Request +*/ +type FindConfigBatchSizeFailThresholdInKbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config batch size fail threshold in kb params +func (o *FindConfigBatchSizeFailThresholdInKbParams) WithTimeout(timeout time.Duration) *FindConfigBatchSizeFailThresholdInKbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config batch size fail threshold in kb params +func (o *FindConfigBatchSizeFailThresholdInKbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config batch size fail threshold in kb params +func (o *FindConfigBatchSizeFailThresholdInKbParams) WithContext(ctx context.Context) *FindConfigBatchSizeFailThresholdInKbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config batch size fail threshold in kb params +func (o *FindConfigBatchSizeFailThresholdInKbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config batch size fail threshold in kb params +func (o *FindConfigBatchSizeFailThresholdInKbParams) WithHTTPClient(client *http.Client) *FindConfigBatchSizeFailThresholdInKbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config batch size fail threshold in kb params +func (o *FindConfigBatchSizeFailThresholdInKbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigBatchSizeFailThresholdInKbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batch_size_fail_threshold_in_kb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batch_size_fail_threshold_in_kb_responses.go new file mode 100644 index 0000000000..797b3dcffd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batch_size_fail_threshold_in_kb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigBatchSizeFailThresholdInKbReader is a Reader for the FindConfigBatchSizeFailThresholdInKb structure. +type FindConfigBatchSizeFailThresholdInKbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigBatchSizeFailThresholdInKbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigBatchSizeFailThresholdInKbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigBatchSizeFailThresholdInKbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigBatchSizeFailThresholdInKbOK creates a FindConfigBatchSizeFailThresholdInKbOK with default headers values +func NewFindConfigBatchSizeFailThresholdInKbOK() *FindConfigBatchSizeFailThresholdInKbOK { + return &FindConfigBatchSizeFailThresholdInKbOK{} +} + +/* +FindConfigBatchSizeFailThresholdInKbOK handles this case with default header values. + +Config value +*/ +type FindConfigBatchSizeFailThresholdInKbOK struct { + Payload int64 +} + +func (o *FindConfigBatchSizeFailThresholdInKbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigBatchSizeFailThresholdInKbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigBatchSizeFailThresholdInKbDefault creates a FindConfigBatchSizeFailThresholdInKbDefault with default headers values +func NewFindConfigBatchSizeFailThresholdInKbDefault(code int) *FindConfigBatchSizeFailThresholdInKbDefault { + return &FindConfigBatchSizeFailThresholdInKbDefault{ + _statusCode: code, + } +} + +/* +FindConfigBatchSizeFailThresholdInKbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigBatchSizeFailThresholdInKbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config batch size fail threshold in kb default response +func (o *FindConfigBatchSizeFailThresholdInKbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigBatchSizeFailThresholdInKbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigBatchSizeFailThresholdInKbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigBatchSizeFailThresholdInKbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batch_size_warn_threshold_in_kb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batch_size_warn_threshold_in_kb_parameters.go new file mode 100644 index 0000000000..51a108bae6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batch_size_warn_threshold_in_kb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigBatchSizeWarnThresholdInKbParams creates a new FindConfigBatchSizeWarnThresholdInKbParams object +// with the default values initialized. +func NewFindConfigBatchSizeWarnThresholdInKbParams() *FindConfigBatchSizeWarnThresholdInKbParams { + + return &FindConfigBatchSizeWarnThresholdInKbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigBatchSizeWarnThresholdInKbParamsWithTimeout creates a new FindConfigBatchSizeWarnThresholdInKbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigBatchSizeWarnThresholdInKbParamsWithTimeout(timeout time.Duration) *FindConfigBatchSizeWarnThresholdInKbParams { + + return &FindConfigBatchSizeWarnThresholdInKbParams{ + + timeout: timeout, + } +} + +// NewFindConfigBatchSizeWarnThresholdInKbParamsWithContext creates a new FindConfigBatchSizeWarnThresholdInKbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigBatchSizeWarnThresholdInKbParamsWithContext(ctx context.Context) *FindConfigBatchSizeWarnThresholdInKbParams { + + return &FindConfigBatchSizeWarnThresholdInKbParams{ + + Context: ctx, + } +} + +// NewFindConfigBatchSizeWarnThresholdInKbParamsWithHTTPClient creates a new FindConfigBatchSizeWarnThresholdInKbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigBatchSizeWarnThresholdInKbParamsWithHTTPClient(client *http.Client) *FindConfigBatchSizeWarnThresholdInKbParams { + + return &FindConfigBatchSizeWarnThresholdInKbParams{ + HTTPClient: client, + } +} + +/* +FindConfigBatchSizeWarnThresholdInKbParams contains all the parameters to send to the API endpoint +for the find config batch size warn threshold in kb operation typically these are written to a http.Request +*/ +type FindConfigBatchSizeWarnThresholdInKbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config batch size warn threshold in kb params +func (o *FindConfigBatchSizeWarnThresholdInKbParams) WithTimeout(timeout time.Duration) *FindConfigBatchSizeWarnThresholdInKbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config batch size warn threshold in kb params +func (o *FindConfigBatchSizeWarnThresholdInKbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config batch size warn threshold in kb params +func (o *FindConfigBatchSizeWarnThresholdInKbParams) WithContext(ctx context.Context) *FindConfigBatchSizeWarnThresholdInKbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config batch size warn threshold in kb params +func (o *FindConfigBatchSizeWarnThresholdInKbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config batch size warn threshold in kb params +func (o *FindConfigBatchSizeWarnThresholdInKbParams) WithHTTPClient(client *http.Client) *FindConfigBatchSizeWarnThresholdInKbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config batch size warn threshold in kb params +func (o *FindConfigBatchSizeWarnThresholdInKbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigBatchSizeWarnThresholdInKbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batch_size_warn_threshold_in_kb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batch_size_warn_threshold_in_kb_responses.go new file mode 100644 index 0000000000..5eabac32fa --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batch_size_warn_threshold_in_kb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigBatchSizeWarnThresholdInKbReader is a Reader for the FindConfigBatchSizeWarnThresholdInKb structure. +type FindConfigBatchSizeWarnThresholdInKbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigBatchSizeWarnThresholdInKbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigBatchSizeWarnThresholdInKbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigBatchSizeWarnThresholdInKbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigBatchSizeWarnThresholdInKbOK creates a FindConfigBatchSizeWarnThresholdInKbOK with default headers values +func NewFindConfigBatchSizeWarnThresholdInKbOK() *FindConfigBatchSizeWarnThresholdInKbOK { + return &FindConfigBatchSizeWarnThresholdInKbOK{} +} + +/* +FindConfigBatchSizeWarnThresholdInKbOK handles this case with default header values. + +Config value +*/ +type FindConfigBatchSizeWarnThresholdInKbOK struct { + Payload int64 +} + +func (o *FindConfigBatchSizeWarnThresholdInKbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigBatchSizeWarnThresholdInKbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigBatchSizeWarnThresholdInKbDefault creates a FindConfigBatchSizeWarnThresholdInKbDefault with default headers values +func NewFindConfigBatchSizeWarnThresholdInKbDefault(code int) *FindConfigBatchSizeWarnThresholdInKbDefault { + return &FindConfigBatchSizeWarnThresholdInKbDefault{ + _statusCode: code, + } +} + +/* +FindConfigBatchSizeWarnThresholdInKbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigBatchSizeWarnThresholdInKbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config batch size warn threshold in kb default response +func (o *FindConfigBatchSizeWarnThresholdInKbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigBatchSizeWarnThresholdInKbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigBatchSizeWarnThresholdInKbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigBatchSizeWarnThresholdInKbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batchlog_replay_throttle_in_kb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batchlog_replay_throttle_in_kb_parameters.go new file mode 100644 index 0000000000..881be05bf1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batchlog_replay_throttle_in_kb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigBatchlogReplayThrottleInKbParams creates a new FindConfigBatchlogReplayThrottleInKbParams object +// with the default values initialized. +func NewFindConfigBatchlogReplayThrottleInKbParams() *FindConfigBatchlogReplayThrottleInKbParams { + + return &FindConfigBatchlogReplayThrottleInKbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigBatchlogReplayThrottleInKbParamsWithTimeout creates a new FindConfigBatchlogReplayThrottleInKbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigBatchlogReplayThrottleInKbParamsWithTimeout(timeout time.Duration) *FindConfigBatchlogReplayThrottleInKbParams { + + return &FindConfigBatchlogReplayThrottleInKbParams{ + + timeout: timeout, + } +} + +// NewFindConfigBatchlogReplayThrottleInKbParamsWithContext creates a new FindConfigBatchlogReplayThrottleInKbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigBatchlogReplayThrottleInKbParamsWithContext(ctx context.Context) *FindConfigBatchlogReplayThrottleInKbParams { + + return &FindConfigBatchlogReplayThrottleInKbParams{ + + Context: ctx, + } +} + +// NewFindConfigBatchlogReplayThrottleInKbParamsWithHTTPClient creates a new FindConfigBatchlogReplayThrottleInKbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigBatchlogReplayThrottleInKbParamsWithHTTPClient(client *http.Client) *FindConfigBatchlogReplayThrottleInKbParams { + + return &FindConfigBatchlogReplayThrottleInKbParams{ + HTTPClient: client, + } +} + +/* +FindConfigBatchlogReplayThrottleInKbParams contains all the parameters to send to the API endpoint +for the find config batchlog replay throttle in kb operation typically these are written to a http.Request +*/ +type FindConfigBatchlogReplayThrottleInKbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config batchlog replay throttle in kb params +func (o *FindConfigBatchlogReplayThrottleInKbParams) WithTimeout(timeout time.Duration) *FindConfigBatchlogReplayThrottleInKbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config batchlog replay throttle in kb params +func (o *FindConfigBatchlogReplayThrottleInKbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config batchlog replay throttle in kb params +func (o *FindConfigBatchlogReplayThrottleInKbParams) WithContext(ctx context.Context) *FindConfigBatchlogReplayThrottleInKbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config batchlog replay throttle in kb params +func (o *FindConfigBatchlogReplayThrottleInKbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config batchlog replay throttle in kb params +func (o *FindConfigBatchlogReplayThrottleInKbParams) WithHTTPClient(client *http.Client) *FindConfigBatchlogReplayThrottleInKbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config batchlog replay throttle in kb params +func (o *FindConfigBatchlogReplayThrottleInKbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigBatchlogReplayThrottleInKbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batchlog_replay_throttle_in_kb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batchlog_replay_throttle_in_kb_responses.go new file mode 100644 index 0000000000..6c39f3944a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_batchlog_replay_throttle_in_kb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigBatchlogReplayThrottleInKbReader is a Reader for the FindConfigBatchlogReplayThrottleInKb structure. +type FindConfigBatchlogReplayThrottleInKbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigBatchlogReplayThrottleInKbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigBatchlogReplayThrottleInKbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigBatchlogReplayThrottleInKbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigBatchlogReplayThrottleInKbOK creates a FindConfigBatchlogReplayThrottleInKbOK with default headers values +func NewFindConfigBatchlogReplayThrottleInKbOK() *FindConfigBatchlogReplayThrottleInKbOK { + return &FindConfigBatchlogReplayThrottleInKbOK{} +} + +/* +FindConfigBatchlogReplayThrottleInKbOK handles this case with default header values. + +Config value +*/ +type FindConfigBatchlogReplayThrottleInKbOK struct { + Payload int64 +} + +func (o *FindConfigBatchlogReplayThrottleInKbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigBatchlogReplayThrottleInKbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigBatchlogReplayThrottleInKbDefault creates a FindConfigBatchlogReplayThrottleInKbDefault with default headers values +func NewFindConfigBatchlogReplayThrottleInKbDefault(code int) *FindConfigBatchlogReplayThrottleInKbDefault { + return &FindConfigBatchlogReplayThrottleInKbDefault{ + _statusCode: code, + } +} + +/* +FindConfigBatchlogReplayThrottleInKbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigBatchlogReplayThrottleInKbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config batchlog replay throttle in kb default response +func (o *FindConfigBatchlogReplayThrottleInKbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigBatchlogReplayThrottleInKbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigBatchlogReplayThrottleInKbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigBatchlogReplayThrottleInKbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_broadcast_address_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_broadcast_address_parameters.go new file mode 100644 index 0000000000..d9b6584905 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_broadcast_address_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigBroadcastAddressParams creates a new FindConfigBroadcastAddressParams object +// with the default values initialized. +func NewFindConfigBroadcastAddressParams() *FindConfigBroadcastAddressParams { + + return &FindConfigBroadcastAddressParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigBroadcastAddressParamsWithTimeout creates a new FindConfigBroadcastAddressParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigBroadcastAddressParamsWithTimeout(timeout time.Duration) *FindConfigBroadcastAddressParams { + + return &FindConfigBroadcastAddressParams{ + + timeout: timeout, + } +} + +// NewFindConfigBroadcastAddressParamsWithContext creates a new FindConfigBroadcastAddressParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigBroadcastAddressParamsWithContext(ctx context.Context) *FindConfigBroadcastAddressParams { + + return &FindConfigBroadcastAddressParams{ + + Context: ctx, + } +} + +// NewFindConfigBroadcastAddressParamsWithHTTPClient creates a new FindConfigBroadcastAddressParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigBroadcastAddressParamsWithHTTPClient(client *http.Client) *FindConfigBroadcastAddressParams { + + return &FindConfigBroadcastAddressParams{ + HTTPClient: client, + } +} + +/* +FindConfigBroadcastAddressParams contains all the parameters to send to the API endpoint +for the find config broadcast address operation typically these are written to a http.Request +*/ +type FindConfigBroadcastAddressParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config broadcast address params +func (o *FindConfigBroadcastAddressParams) WithTimeout(timeout time.Duration) *FindConfigBroadcastAddressParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config broadcast address params +func (o *FindConfigBroadcastAddressParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config broadcast address params +func (o *FindConfigBroadcastAddressParams) WithContext(ctx context.Context) *FindConfigBroadcastAddressParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config broadcast address params +func (o *FindConfigBroadcastAddressParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config broadcast address params +func (o *FindConfigBroadcastAddressParams) WithHTTPClient(client *http.Client) *FindConfigBroadcastAddressParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config broadcast address params +func (o *FindConfigBroadcastAddressParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigBroadcastAddressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_broadcast_address_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_broadcast_address_responses.go new file mode 100644 index 0000000000..6796c1b8e1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_broadcast_address_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigBroadcastAddressReader is a Reader for the FindConfigBroadcastAddress structure. +type FindConfigBroadcastAddressReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigBroadcastAddressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigBroadcastAddressOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigBroadcastAddressDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigBroadcastAddressOK creates a FindConfigBroadcastAddressOK with default headers values +func NewFindConfigBroadcastAddressOK() *FindConfigBroadcastAddressOK { + return &FindConfigBroadcastAddressOK{} +} + +/* +FindConfigBroadcastAddressOK handles this case with default header values. + +Config value +*/ +type FindConfigBroadcastAddressOK struct { + Payload string +} + +func (o *FindConfigBroadcastAddressOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigBroadcastAddressOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigBroadcastAddressDefault creates a FindConfigBroadcastAddressDefault with default headers values +func NewFindConfigBroadcastAddressDefault(code int) *FindConfigBroadcastAddressDefault { + return &FindConfigBroadcastAddressDefault{ + _statusCode: code, + } +} + +/* +FindConfigBroadcastAddressDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigBroadcastAddressDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config broadcast address default response +func (o *FindConfigBroadcastAddressDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigBroadcastAddressDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigBroadcastAddressDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigBroadcastAddressDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_broadcast_rpc_address_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_broadcast_rpc_address_parameters.go new file mode 100644 index 0000000000..d677b903d0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_broadcast_rpc_address_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigBroadcastRPCAddressParams creates a new FindConfigBroadcastRPCAddressParams object +// with the default values initialized. +func NewFindConfigBroadcastRPCAddressParams() *FindConfigBroadcastRPCAddressParams { + + return &FindConfigBroadcastRPCAddressParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigBroadcastRPCAddressParamsWithTimeout creates a new FindConfigBroadcastRPCAddressParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigBroadcastRPCAddressParamsWithTimeout(timeout time.Duration) *FindConfigBroadcastRPCAddressParams { + + return &FindConfigBroadcastRPCAddressParams{ + + timeout: timeout, + } +} + +// NewFindConfigBroadcastRPCAddressParamsWithContext creates a new FindConfigBroadcastRPCAddressParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigBroadcastRPCAddressParamsWithContext(ctx context.Context) *FindConfigBroadcastRPCAddressParams { + + return &FindConfigBroadcastRPCAddressParams{ + + Context: ctx, + } +} + +// NewFindConfigBroadcastRPCAddressParamsWithHTTPClient creates a new FindConfigBroadcastRPCAddressParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigBroadcastRPCAddressParamsWithHTTPClient(client *http.Client) *FindConfigBroadcastRPCAddressParams { + + return &FindConfigBroadcastRPCAddressParams{ + HTTPClient: client, + } +} + +/* +FindConfigBroadcastRPCAddressParams contains all the parameters to send to the API endpoint +for the find config broadcast rpc address operation typically these are written to a http.Request +*/ +type FindConfigBroadcastRPCAddressParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config broadcast rpc address params +func (o *FindConfigBroadcastRPCAddressParams) WithTimeout(timeout time.Duration) *FindConfigBroadcastRPCAddressParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config broadcast rpc address params +func (o *FindConfigBroadcastRPCAddressParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config broadcast rpc address params +func (o *FindConfigBroadcastRPCAddressParams) WithContext(ctx context.Context) *FindConfigBroadcastRPCAddressParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config broadcast rpc address params +func (o *FindConfigBroadcastRPCAddressParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config broadcast rpc address params +func (o *FindConfigBroadcastRPCAddressParams) WithHTTPClient(client *http.Client) *FindConfigBroadcastRPCAddressParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config broadcast rpc address params +func (o *FindConfigBroadcastRPCAddressParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigBroadcastRPCAddressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_broadcast_rpc_address_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_broadcast_rpc_address_responses.go new file mode 100644 index 0000000000..bf1fce08ba --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_broadcast_rpc_address_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigBroadcastRPCAddressReader is a Reader for the FindConfigBroadcastRPCAddress structure. +type FindConfigBroadcastRPCAddressReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigBroadcastRPCAddressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigBroadcastRPCAddressOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigBroadcastRPCAddressDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigBroadcastRPCAddressOK creates a FindConfigBroadcastRPCAddressOK with default headers values +func NewFindConfigBroadcastRPCAddressOK() *FindConfigBroadcastRPCAddressOK { + return &FindConfigBroadcastRPCAddressOK{} +} + +/* +FindConfigBroadcastRPCAddressOK handles this case with default header values. + +Config value +*/ +type FindConfigBroadcastRPCAddressOK struct { + Payload string +} + +func (o *FindConfigBroadcastRPCAddressOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigBroadcastRPCAddressOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigBroadcastRPCAddressDefault creates a FindConfigBroadcastRPCAddressDefault with default headers values +func NewFindConfigBroadcastRPCAddressDefault(code int) *FindConfigBroadcastRPCAddressDefault { + return &FindConfigBroadcastRPCAddressDefault{ + _statusCode: code, + } +} + +/* +FindConfigBroadcastRPCAddressDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigBroadcastRPCAddressDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config broadcast rpc address default response +func (o *FindConfigBroadcastRPCAddressDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigBroadcastRPCAddressDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigBroadcastRPCAddressDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigBroadcastRPCAddressDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cache_hit_rate_read_balancing_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cache_hit_rate_read_balancing_parameters.go new file mode 100644 index 0000000000..4eb96427af --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cache_hit_rate_read_balancing_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCacheHitRateReadBalancingParams creates a new FindConfigCacheHitRateReadBalancingParams object +// with the default values initialized. +func NewFindConfigCacheHitRateReadBalancingParams() *FindConfigCacheHitRateReadBalancingParams { + + return &FindConfigCacheHitRateReadBalancingParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCacheHitRateReadBalancingParamsWithTimeout creates a new FindConfigCacheHitRateReadBalancingParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCacheHitRateReadBalancingParamsWithTimeout(timeout time.Duration) *FindConfigCacheHitRateReadBalancingParams { + + return &FindConfigCacheHitRateReadBalancingParams{ + + timeout: timeout, + } +} + +// NewFindConfigCacheHitRateReadBalancingParamsWithContext creates a new FindConfigCacheHitRateReadBalancingParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCacheHitRateReadBalancingParamsWithContext(ctx context.Context) *FindConfigCacheHitRateReadBalancingParams { + + return &FindConfigCacheHitRateReadBalancingParams{ + + Context: ctx, + } +} + +// NewFindConfigCacheHitRateReadBalancingParamsWithHTTPClient creates a new FindConfigCacheHitRateReadBalancingParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCacheHitRateReadBalancingParamsWithHTTPClient(client *http.Client) *FindConfigCacheHitRateReadBalancingParams { + + return &FindConfigCacheHitRateReadBalancingParams{ + HTTPClient: client, + } +} + +/* +FindConfigCacheHitRateReadBalancingParams contains all the parameters to send to the API endpoint +for the find config cache hit rate read balancing operation typically these are written to a http.Request +*/ +type FindConfigCacheHitRateReadBalancingParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config cache hit rate read balancing params +func (o *FindConfigCacheHitRateReadBalancingParams) WithTimeout(timeout time.Duration) *FindConfigCacheHitRateReadBalancingParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config cache hit rate read balancing params +func (o *FindConfigCacheHitRateReadBalancingParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config cache hit rate read balancing params +func (o *FindConfigCacheHitRateReadBalancingParams) WithContext(ctx context.Context) *FindConfigCacheHitRateReadBalancingParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config cache hit rate read balancing params +func (o *FindConfigCacheHitRateReadBalancingParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config cache hit rate read balancing params +func (o *FindConfigCacheHitRateReadBalancingParams) WithHTTPClient(client *http.Client) *FindConfigCacheHitRateReadBalancingParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config cache hit rate read balancing params +func (o *FindConfigCacheHitRateReadBalancingParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCacheHitRateReadBalancingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cache_hit_rate_read_balancing_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cache_hit_rate_read_balancing_responses.go new file mode 100644 index 0000000000..2110ef146c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cache_hit_rate_read_balancing_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCacheHitRateReadBalancingReader is a Reader for the FindConfigCacheHitRateReadBalancing structure. +type FindConfigCacheHitRateReadBalancingReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCacheHitRateReadBalancingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCacheHitRateReadBalancingOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCacheHitRateReadBalancingDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCacheHitRateReadBalancingOK creates a FindConfigCacheHitRateReadBalancingOK with default headers values +func NewFindConfigCacheHitRateReadBalancingOK() *FindConfigCacheHitRateReadBalancingOK { + return &FindConfigCacheHitRateReadBalancingOK{} +} + +/* +FindConfigCacheHitRateReadBalancingOK handles this case with default header values. + +Config value +*/ +type FindConfigCacheHitRateReadBalancingOK struct { + Payload bool +} + +func (o *FindConfigCacheHitRateReadBalancingOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigCacheHitRateReadBalancingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCacheHitRateReadBalancingDefault creates a FindConfigCacheHitRateReadBalancingDefault with default headers values +func NewFindConfigCacheHitRateReadBalancingDefault(code int) *FindConfigCacheHitRateReadBalancingDefault { + return &FindConfigCacheHitRateReadBalancingDefault{ + _statusCode: code, + } +} + +/* +FindConfigCacheHitRateReadBalancingDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCacheHitRateReadBalancingDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config cache hit rate read balancing default response +func (o *FindConfigCacheHitRateReadBalancingDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCacheHitRateReadBalancingDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCacheHitRateReadBalancingDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCacheHitRateReadBalancingDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cas_contention_timeout_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cas_contention_timeout_in_ms_parameters.go new file mode 100644 index 0000000000..da89c7dae8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cas_contention_timeout_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCasContentionTimeoutInMsParams creates a new FindConfigCasContentionTimeoutInMsParams object +// with the default values initialized. +func NewFindConfigCasContentionTimeoutInMsParams() *FindConfigCasContentionTimeoutInMsParams { + + return &FindConfigCasContentionTimeoutInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCasContentionTimeoutInMsParamsWithTimeout creates a new FindConfigCasContentionTimeoutInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCasContentionTimeoutInMsParamsWithTimeout(timeout time.Duration) *FindConfigCasContentionTimeoutInMsParams { + + return &FindConfigCasContentionTimeoutInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigCasContentionTimeoutInMsParamsWithContext creates a new FindConfigCasContentionTimeoutInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCasContentionTimeoutInMsParamsWithContext(ctx context.Context) *FindConfigCasContentionTimeoutInMsParams { + + return &FindConfigCasContentionTimeoutInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigCasContentionTimeoutInMsParamsWithHTTPClient creates a new FindConfigCasContentionTimeoutInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCasContentionTimeoutInMsParamsWithHTTPClient(client *http.Client) *FindConfigCasContentionTimeoutInMsParams { + + return &FindConfigCasContentionTimeoutInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigCasContentionTimeoutInMsParams contains all the parameters to send to the API endpoint +for the find config cas contention timeout in ms operation typically these are written to a http.Request +*/ +type FindConfigCasContentionTimeoutInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config cas contention timeout in ms params +func (o *FindConfigCasContentionTimeoutInMsParams) WithTimeout(timeout time.Duration) *FindConfigCasContentionTimeoutInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config cas contention timeout in ms params +func (o *FindConfigCasContentionTimeoutInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config cas contention timeout in ms params +func (o *FindConfigCasContentionTimeoutInMsParams) WithContext(ctx context.Context) *FindConfigCasContentionTimeoutInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config cas contention timeout in ms params +func (o *FindConfigCasContentionTimeoutInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config cas contention timeout in ms params +func (o *FindConfigCasContentionTimeoutInMsParams) WithHTTPClient(client *http.Client) *FindConfigCasContentionTimeoutInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config cas contention timeout in ms params +func (o *FindConfigCasContentionTimeoutInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCasContentionTimeoutInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cas_contention_timeout_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cas_contention_timeout_in_ms_responses.go new file mode 100644 index 0000000000..bda6e4b0b4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cas_contention_timeout_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCasContentionTimeoutInMsReader is a Reader for the FindConfigCasContentionTimeoutInMs structure. +type FindConfigCasContentionTimeoutInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCasContentionTimeoutInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCasContentionTimeoutInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCasContentionTimeoutInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCasContentionTimeoutInMsOK creates a FindConfigCasContentionTimeoutInMsOK with default headers values +func NewFindConfigCasContentionTimeoutInMsOK() *FindConfigCasContentionTimeoutInMsOK { + return &FindConfigCasContentionTimeoutInMsOK{} +} + +/* +FindConfigCasContentionTimeoutInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigCasContentionTimeoutInMsOK struct { + Payload int64 +} + +func (o *FindConfigCasContentionTimeoutInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigCasContentionTimeoutInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCasContentionTimeoutInMsDefault creates a FindConfigCasContentionTimeoutInMsDefault with default headers values +func NewFindConfigCasContentionTimeoutInMsDefault(code int) *FindConfigCasContentionTimeoutInMsDefault { + return &FindConfigCasContentionTimeoutInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigCasContentionTimeoutInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCasContentionTimeoutInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config cas contention timeout in ms default response +func (o *FindConfigCasContentionTimeoutInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCasContentionTimeoutInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCasContentionTimeoutInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCasContentionTimeoutInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_client_encryption_options_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_client_encryption_options_parameters.go new file mode 100644 index 0000000000..fdc092c699 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_client_encryption_options_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigClientEncryptionOptionsParams creates a new FindConfigClientEncryptionOptionsParams object +// with the default values initialized. +func NewFindConfigClientEncryptionOptionsParams() *FindConfigClientEncryptionOptionsParams { + + return &FindConfigClientEncryptionOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigClientEncryptionOptionsParamsWithTimeout creates a new FindConfigClientEncryptionOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigClientEncryptionOptionsParamsWithTimeout(timeout time.Duration) *FindConfigClientEncryptionOptionsParams { + + return &FindConfigClientEncryptionOptionsParams{ + + timeout: timeout, + } +} + +// NewFindConfigClientEncryptionOptionsParamsWithContext creates a new FindConfigClientEncryptionOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigClientEncryptionOptionsParamsWithContext(ctx context.Context) *FindConfigClientEncryptionOptionsParams { + + return &FindConfigClientEncryptionOptionsParams{ + + Context: ctx, + } +} + +// NewFindConfigClientEncryptionOptionsParamsWithHTTPClient creates a new FindConfigClientEncryptionOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigClientEncryptionOptionsParamsWithHTTPClient(client *http.Client) *FindConfigClientEncryptionOptionsParams { + + return &FindConfigClientEncryptionOptionsParams{ + HTTPClient: client, + } +} + +/* +FindConfigClientEncryptionOptionsParams contains all the parameters to send to the API endpoint +for the find config client encryption options operation typically these are written to a http.Request +*/ +type FindConfigClientEncryptionOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config client encryption options params +func (o *FindConfigClientEncryptionOptionsParams) WithTimeout(timeout time.Duration) *FindConfigClientEncryptionOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config client encryption options params +func (o *FindConfigClientEncryptionOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config client encryption options params +func (o *FindConfigClientEncryptionOptionsParams) WithContext(ctx context.Context) *FindConfigClientEncryptionOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config client encryption options params +func (o *FindConfigClientEncryptionOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config client encryption options params +func (o *FindConfigClientEncryptionOptionsParams) WithHTTPClient(client *http.Client) *FindConfigClientEncryptionOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config client encryption options params +func (o *FindConfigClientEncryptionOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigClientEncryptionOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_client_encryption_options_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_client_encryption_options_responses.go new file mode 100644 index 0000000000..3c30d10e5a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_client_encryption_options_responses.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigClientEncryptionOptionsReader is a Reader for the FindConfigClientEncryptionOptions structure. +type FindConfigClientEncryptionOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigClientEncryptionOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigClientEncryptionOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigClientEncryptionOptionsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigClientEncryptionOptionsOK creates a FindConfigClientEncryptionOptionsOK with default headers values +func NewFindConfigClientEncryptionOptionsOK() *FindConfigClientEncryptionOptionsOK { + return &FindConfigClientEncryptionOptionsOK{} +} + +/* +FindConfigClientEncryptionOptionsOK handles this case with default header values. + +Config value +*/ +type FindConfigClientEncryptionOptionsOK struct { + Payload *models.ClientEncryptionOptions +} + +func (o *FindConfigClientEncryptionOptionsOK) GetPayload() *models.ClientEncryptionOptions { + return o.Payload +} + +func (o *FindConfigClientEncryptionOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClientEncryptionOptions) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigClientEncryptionOptionsDefault creates a FindConfigClientEncryptionOptionsDefault with default headers values +func NewFindConfigClientEncryptionOptionsDefault(code int) *FindConfigClientEncryptionOptionsDefault { + return &FindConfigClientEncryptionOptionsDefault{ + _statusCode: code, + } +} + +/* +FindConfigClientEncryptionOptionsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigClientEncryptionOptionsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config client encryption options default response +func (o *FindConfigClientEncryptionOptionsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigClientEncryptionOptionsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigClientEncryptionOptionsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigClientEncryptionOptionsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cluster_name_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cluster_name_parameters.go new file mode 100644 index 0000000000..e1715f6e5f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cluster_name_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigClusterNameParams creates a new FindConfigClusterNameParams object +// with the default values initialized. +func NewFindConfigClusterNameParams() *FindConfigClusterNameParams { + + return &FindConfigClusterNameParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigClusterNameParamsWithTimeout creates a new FindConfigClusterNameParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigClusterNameParamsWithTimeout(timeout time.Duration) *FindConfigClusterNameParams { + + return &FindConfigClusterNameParams{ + + timeout: timeout, + } +} + +// NewFindConfigClusterNameParamsWithContext creates a new FindConfigClusterNameParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigClusterNameParamsWithContext(ctx context.Context) *FindConfigClusterNameParams { + + return &FindConfigClusterNameParams{ + + Context: ctx, + } +} + +// NewFindConfigClusterNameParamsWithHTTPClient creates a new FindConfigClusterNameParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigClusterNameParamsWithHTTPClient(client *http.Client) *FindConfigClusterNameParams { + + return &FindConfigClusterNameParams{ + HTTPClient: client, + } +} + +/* +FindConfigClusterNameParams contains all the parameters to send to the API endpoint +for the find config cluster name operation typically these are written to a http.Request +*/ +type FindConfigClusterNameParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config cluster name params +func (o *FindConfigClusterNameParams) WithTimeout(timeout time.Duration) *FindConfigClusterNameParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config cluster name params +func (o *FindConfigClusterNameParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config cluster name params +func (o *FindConfigClusterNameParams) WithContext(ctx context.Context) *FindConfigClusterNameParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config cluster name params +func (o *FindConfigClusterNameParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config cluster name params +func (o *FindConfigClusterNameParams) WithHTTPClient(client *http.Client) *FindConfigClusterNameParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config cluster name params +func (o *FindConfigClusterNameParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigClusterNameParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cluster_name_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cluster_name_responses.go new file mode 100644 index 0000000000..13686eb5fd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cluster_name_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigClusterNameReader is a Reader for the FindConfigClusterName structure. +type FindConfigClusterNameReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigClusterNameReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigClusterNameOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigClusterNameDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigClusterNameOK creates a FindConfigClusterNameOK with default headers values +func NewFindConfigClusterNameOK() *FindConfigClusterNameOK { + return &FindConfigClusterNameOK{} +} + +/* +FindConfigClusterNameOK handles this case with default header values. + +Config value +*/ +type FindConfigClusterNameOK struct { + Payload string +} + +func (o *FindConfigClusterNameOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigClusterNameOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigClusterNameDefault creates a FindConfigClusterNameDefault with default headers values +func NewFindConfigClusterNameDefault(code int) *FindConfigClusterNameDefault { + return &FindConfigClusterNameDefault{ + _statusCode: code, + } +} + +/* +FindConfigClusterNameDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigClusterNameDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config cluster name default response +func (o *FindConfigClusterNameDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigClusterNameDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigClusterNameDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigClusterNameDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_column_index_size_in_kb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_column_index_size_in_kb_parameters.go new file mode 100644 index 0000000000..6594af387d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_column_index_size_in_kb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigColumnIndexSizeInKbParams creates a new FindConfigColumnIndexSizeInKbParams object +// with the default values initialized. +func NewFindConfigColumnIndexSizeInKbParams() *FindConfigColumnIndexSizeInKbParams { + + return &FindConfigColumnIndexSizeInKbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigColumnIndexSizeInKbParamsWithTimeout creates a new FindConfigColumnIndexSizeInKbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigColumnIndexSizeInKbParamsWithTimeout(timeout time.Duration) *FindConfigColumnIndexSizeInKbParams { + + return &FindConfigColumnIndexSizeInKbParams{ + + timeout: timeout, + } +} + +// NewFindConfigColumnIndexSizeInKbParamsWithContext creates a new FindConfigColumnIndexSizeInKbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigColumnIndexSizeInKbParamsWithContext(ctx context.Context) *FindConfigColumnIndexSizeInKbParams { + + return &FindConfigColumnIndexSizeInKbParams{ + + Context: ctx, + } +} + +// NewFindConfigColumnIndexSizeInKbParamsWithHTTPClient creates a new FindConfigColumnIndexSizeInKbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigColumnIndexSizeInKbParamsWithHTTPClient(client *http.Client) *FindConfigColumnIndexSizeInKbParams { + + return &FindConfigColumnIndexSizeInKbParams{ + HTTPClient: client, + } +} + +/* +FindConfigColumnIndexSizeInKbParams contains all the parameters to send to the API endpoint +for the find config column index size in kb operation typically these are written to a http.Request +*/ +type FindConfigColumnIndexSizeInKbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config column index size in kb params +func (o *FindConfigColumnIndexSizeInKbParams) WithTimeout(timeout time.Duration) *FindConfigColumnIndexSizeInKbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config column index size in kb params +func (o *FindConfigColumnIndexSizeInKbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config column index size in kb params +func (o *FindConfigColumnIndexSizeInKbParams) WithContext(ctx context.Context) *FindConfigColumnIndexSizeInKbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config column index size in kb params +func (o *FindConfigColumnIndexSizeInKbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config column index size in kb params +func (o *FindConfigColumnIndexSizeInKbParams) WithHTTPClient(client *http.Client) *FindConfigColumnIndexSizeInKbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config column index size in kb params +func (o *FindConfigColumnIndexSizeInKbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigColumnIndexSizeInKbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_column_index_size_in_kb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_column_index_size_in_kb_responses.go new file mode 100644 index 0000000000..d74569dc82 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_column_index_size_in_kb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigColumnIndexSizeInKbReader is a Reader for the FindConfigColumnIndexSizeInKb structure. +type FindConfigColumnIndexSizeInKbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigColumnIndexSizeInKbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigColumnIndexSizeInKbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigColumnIndexSizeInKbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigColumnIndexSizeInKbOK creates a FindConfigColumnIndexSizeInKbOK with default headers values +func NewFindConfigColumnIndexSizeInKbOK() *FindConfigColumnIndexSizeInKbOK { + return &FindConfigColumnIndexSizeInKbOK{} +} + +/* +FindConfigColumnIndexSizeInKbOK handles this case with default header values. + +Config value +*/ +type FindConfigColumnIndexSizeInKbOK struct { + Payload int64 +} + +func (o *FindConfigColumnIndexSizeInKbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigColumnIndexSizeInKbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigColumnIndexSizeInKbDefault creates a FindConfigColumnIndexSizeInKbDefault with default headers values +func NewFindConfigColumnIndexSizeInKbDefault(code int) *FindConfigColumnIndexSizeInKbDefault { + return &FindConfigColumnIndexSizeInKbDefault{ + _statusCode: code, + } +} + +/* +FindConfigColumnIndexSizeInKbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigColumnIndexSizeInKbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config column index size in kb default response +func (o *FindConfigColumnIndexSizeInKbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigColumnIndexSizeInKbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigColumnIndexSizeInKbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigColumnIndexSizeInKbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commit_failure_policy_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commit_failure_policy_parameters.go new file mode 100644 index 0000000000..4ab4bd75b0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commit_failure_policy_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCommitFailurePolicyParams creates a new FindConfigCommitFailurePolicyParams object +// with the default values initialized. +func NewFindConfigCommitFailurePolicyParams() *FindConfigCommitFailurePolicyParams { + + return &FindConfigCommitFailurePolicyParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCommitFailurePolicyParamsWithTimeout creates a new FindConfigCommitFailurePolicyParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCommitFailurePolicyParamsWithTimeout(timeout time.Duration) *FindConfigCommitFailurePolicyParams { + + return &FindConfigCommitFailurePolicyParams{ + + timeout: timeout, + } +} + +// NewFindConfigCommitFailurePolicyParamsWithContext creates a new FindConfigCommitFailurePolicyParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCommitFailurePolicyParamsWithContext(ctx context.Context) *FindConfigCommitFailurePolicyParams { + + return &FindConfigCommitFailurePolicyParams{ + + Context: ctx, + } +} + +// NewFindConfigCommitFailurePolicyParamsWithHTTPClient creates a new FindConfigCommitFailurePolicyParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCommitFailurePolicyParamsWithHTTPClient(client *http.Client) *FindConfigCommitFailurePolicyParams { + + return &FindConfigCommitFailurePolicyParams{ + HTTPClient: client, + } +} + +/* +FindConfigCommitFailurePolicyParams contains all the parameters to send to the API endpoint +for the find config commit failure policy operation typically these are written to a http.Request +*/ +type FindConfigCommitFailurePolicyParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config commit failure policy params +func (o *FindConfigCommitFailurePolicyParams) WithTimeout(timeout time.Duration) *FindConfigCommitFailurePolicyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config commit failure policy params +func (o *FindConfigCommitFailurePolicyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config commit failure policy params +func (o *FindConfigCommitFailurePolicyParams) WithContext(ctx context.Context) *FindConfigCommitFailurePolicyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config commit failure policy params +func (o *FindConfigCommitFailurePolicyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config commit failure policy params +func (o *FindConfigCommitFailurePolicyParams) WithHTTPClient(client *http.Client) *FindConfigCommitFailurePolicyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config commit failure policy params +func (o *FindConfigCommitFailurePolicyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCommitFailurePolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commit_failure_policy_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commit_failure_policy_responses.go new file mode 100644 index 0000000000..bd575c174d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commit_failure_policy_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCommitFailurePolicyReader is a Reader for the FindConfigCommitFailurePolicy structure. +type FindConfigCommitFailurePolicyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCommitFailurePolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCommitFailurePolicyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCommitFailurePolicyDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCommitFailurePolicyOK creates a FindConfigCommitFailurePolicyOK with default headers values +func NewFindConfigCommitFailurePolicyOK() *FindConfigCommitFailurePolicyOK { + return &FindConfigCommitFailurePolicyOK{} +} + +/* +FindConfigCommitFailurePolicyOK handles this case with default header values. + +Config value +*/ +type FindConfigCommitFailurePolicyOK struct { + Payload string +} + +func (o *FindConfigCommitFailurePolicyOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigCommitFailurePolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCommitFailurePolicyDefault creates a FindConfigCommitFailurePolicyDefault with default headers values +func NewFindConfigCommitFailurePolicyDefault(code int) *FindConfigCommitFailurePolicyDefault { + return &FindConfigCommitFailurePolicyDefault{ + _statusCode: code, + } +} + +/* +FindConfigCommitFailurePolicyDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCommitFailurePolicyDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config commit failure policy default response +func (o *FindConfigCommitFailurePolicyDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCommitFailurePolicyDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCommitFailurePolicyDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCommitFailurePolicyDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_directory_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_directory_parameters.go new file mode 100644 index 0000000000..7dcbd7b1f9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_directory_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCommitlogDirectoryParams creates a new FindConfigCommitlogDirectoryParams object +// with the default values initialized. +func NewFindConfigCommitlogDirectoryParams() *FindConfigCommitlogDirectoryParams { + + return &FindConfigCommitlogDirectoryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCommitlogDirectoryParamsWithTimeout creates a new FindConfigCommitlogDirectoryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCommitlogDirectoryParamsWithTimeout(timeout time.Duration) *FindConfigCommitlogDirectoryParams { + + return &FindConfigCommitlogDirectoryParams{ + + timeout: timeout, + } +} + +// NewFindConfigCommitlogDirectoryParamsWithContext creates a new FindConfigCommitlogDirectoryParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCommitlogDirectoryParamsWithContext(ctx context.Context) *FindConfigCommitlogDirectoryParams { + + return &FindConfigCommitlogDirectoryParams{ + + Context: ctx, + } +} + +// NewFindConfigCommitlogDirectoryParamsWithHTTPClient creates a new FindConfigCommitlogDirectoryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCommitlogDirectoryParamsWithHTTPClient(client *http.Client) *FindConfigCommitlogDirectoryParams { + + return &FindConfigCommitlogDirectoryParams{ + HTTPClient: client, + } +} + +/* +FindConfigCommitlogDirectoryParams contains all the parameters to send to the API endpoint +for the find config commitlog directory operation typically these are written to a http.Request +*/ +type FindConfigCommitlogDirectoryParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config commitlog directory params +func (o *FindConfigCommitlogDirectoryParams) WithTimeout(timeout time.Duration) *FindConfigCommitlogDirectoryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config commitlog directory params +func (o *FindConfigCommitlogDirectoryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config commitlog directory params +func (o *FindConfigCommitlogDirectoryParams) WithContext(ctx context.Context) *FindConfigCommitlogDirectoryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config commitlog directory params +func (o *FindConfigCommitlogDirectoryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config commitlog directory params +func (o *FindConfigCommitlogDirectoryParams) WithHTTPClient(client *http.Client) *FindConfigCommitlogDirectoryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config commitlog directory params +func (o *FindConfigCommitlogDirectoryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCommitlogDirectoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_directory_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_directory_responses.go new file mode 100644 index 0000000000..ddaecbae8e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_directory_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCommitlogDirectoryReader is a Reader for the FindConfigCommitlogDirectory structure. +type FindConfigCommitlogDirectoryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCommitlogDirectoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCommitlogDirectoryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCommitlogDirectoryDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCommitlogDirectoryOK creates a FindConfigCommitlogDirectoryOK with default headers values +func NewFindConfigCommitlogDirectoryOK() *FindConfigCommitlogDirectoryOK { + return &FindConfigCommitlogDirectoryOK{} +} + +/* +FindConfigCommitlogDirectoryOK handles this case with default header values. + +Config value +*/ +type FindConfigCommitlogDirectoryOK struct { + Payload string +} + +func (o *FindConfigCommitlogDirectoryOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigCommitlogDirectoryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCommitlogDirectoryDefault creates a FindConfigCommitlogDirectoryDefault with default headers values +func NewFindConfigCommitlogDirectoryDefault(code int) *FindConfigCommitlogDirectoryDefault { + return &FindConfigCommitlogDirectoryDefault{ + _statusCode: code, + } +} + +/* +FindConfigCommitlogDirectoryDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCommitlogDirectoryDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config commitlog directory default response +func (o *FindConfigCommitlogDirectoryDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCommitlogDirectoryDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCommitlogDirectoryDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCommitlogDirectoryDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_reuse_segments_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_reuse_segments_parameters.go new file mode 100644 index 0000000000..9452947ea1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_reuse_segments_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCommitlogReuseSegmentsParams creates a new FindConfigCommitlogReuseSegmentsParams object +// with the default values initialized. +func NewFindConfigCommitlogReuseSegmentsParams() *FindConfigCommitlogReuseSegmentsParams { + + return &FindConfigCommitlogReuseSegmentsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCommitlogReuseSegmentsParamsWithTimeout creates a new FindConfigCommitlogReuseSegmentsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCommitlogReuseSegmentsParamsWithTimeout(timeout time.Duration) *FindConfigCommitlogReuseSegmentsParams { + + return &FindConfigCommitlogReuseSegmentsParams{ + + timeout: timeout, + } +} + +// NewFindConfigCommitlogReuseSegmentsParamsWithContext creates a new FindConfigCommitlogReuseSegmentsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCommitlogReuseSegmentsParamsWithContext(ctx context.Context) *FindConfigCommitlogReuseSegmentsParams { + + return &FindConfigCommitlogReuseSegmentsParams{ + + Context: ctx, + } +} + +// NewFindConfigCommitlogReuseSegmentsParamsWithHTTPClient creates a new FindConfigCommitlogReuseSegmentsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCommitlogReuseSegmentsParamsWithHTTPClient(client *http.Client) *FindConfigCommitlogReuseSegmentsParams { + + return &FindConfigCommitlogReuseSegmentsParams{ + HTTPClient: client, + } +} + +/* +FindConfigCommitlogReuseSegmentsParams contains all the parameters to send to the API endpoint +for the find config commitlog reuse segments operation typically these are written to a http.Request +*/ +type FindConfigCommitlogReuseSegmentsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config commitlog reuse segments params +func (o *FindConfigCommitlogReuseSegmentsParams) WithTimeout(timeout time.Duration) *FindConfigCommitlogReuseSegmentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config commitlog reuse segments params +func (o *FindConfigCommitlogReuseSegmentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config commitlog reuse segments params +func (o *FindConfigCommitlogReuseSegmentsParams) WithContext(ctx context.Context) *FindConfigCommitlogReuseSegmentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config commitlog reuse segments params +func (o *FindConfigCommitlogReuseSegmentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config commitlog reuse segments params +func (o *FindConfigCommitlogReuseSegmentsParams) WithHTTPClient(client *http.Client) *FindConfigCommitlogReuseSegmentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config commitlog reuse segments params +func (o *FindConfigCommitlogReuseSegmentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCommitlogReuseSegmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_reuse_segments_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_reuse_segments_responses.go new file mode 100644 index 0000000000..e1b6320bed --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_reuse_segments_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCommitlogReuseSegmentsReader is a Reader for the FindConfigCommitlogReuseSegments structure. +type FindConfigCommitlogReuseSegmentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCommitlogReuseSegmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCommitlogReuseSegmentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCommitlogReuseSegmentsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCommitlogReuseSegmentsOK creates a FindConfigCommitlogReuseSegmentsOK with default headers values +func NewFindConfigCommitlogReuseSegmentsOK() *FindConfigCommitlogReuseSegmentsOK { + return &FindConfigCommitlogReuseSegmentsOK{} +} + +/* +FindConfigCommitlogReuseSegmentsOK handles this case with default header values. + +Config value +*/ +type FindConfigCommitlogReuseSegmentsOK struct { + Payload bool +} + +func (o *FindConfigCommitlogReuseSegmentsOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigCommitlogReuseSegmentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCommitlogReuseSegmentsDefault creates a FindConfigCommitlogReuseSegmentsDefault with default headers values +func NewFindConfigCommitlogReuseSegmentsDefault(code int) *FindConfigCommitlogReuseSegmentsDefault { + return &FindConfigCommitlogReuseSegmentsDefault{ + _statusCode: code, + } +} + +/* +FindConfigCommitlogReuseSegmentsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCommitlogReuseSegmentsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config commitlog reuse segments default response +func (o *FindConfigCommitlogReuseSegmentsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCommitlogReuseSegmentsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCommitlogReuseSegmentsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCommitlogReuseSegmentsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_segment_size_in_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_segment_size_in_mb_parameters.go new file mode 100644 index 0000000000..4791c73cae --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_segment_size_in_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCommitlogSegmentSizeInMbParams creates a new FindConfigCommitlogSegmentSizeInMbParams object +// with the default values initialized. +func NewFindConfigCommitlogSegmentSizeInMbParams() *FindConfigCommitlogSegmentSizeInMbParams { + + return &FindConfigCommitlogSegmentSizeInMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCommitlogSegmentSizeInMbParamsWithTimeout creates a new FindConfigCommitlogSegmentSizeInMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCommitlogSegmentSizeInMbParamsWithTimeout(timeout time.Duration) *FindConfigCommitlogSegmentSizeInMbParams { + + return &FindConfigCommitlogSegmentSizeInMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigCommitlogSegmentSizeInMbParamsWithContext creates a new FindConfigCommitlogSegmentSizeInMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCommitlogSegmentSizeInMbParamsWithContext(ctx context.Context) *FindConfigCommitlogSegmentSizeInMbParams { + + return &FindConfigCommitlogSegmentSizeInMbParams{ + + Context: ctx, + } +} + +// NewFindConfigCommitlogSegmentSizeInMbParamsWithHTTPClient creates a new FindConfigCommitlogSegmentSizeInMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCommitlogSegmentSizeInMbParamsWithHTTPClient(client *http.Client) *FindConfigCommitlogSegmentSizeInMbParams { + + return &FindConfigCommitlogSegmentSizeInMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigCommitlogSegmentSizeInMbParams contains all the parameters to send to the API endpoint +for the find config commitlog segment size in mb operation typically these are written to a http.Request +*/ +type FindConfigCommitlogSegmentSizeInMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config commitlog segment size in mb params +func (o *FindConfigCommitlogSegmentSizeInMbParams) WithTimeout(timeout time.Duration) *FindConfigCommitlogSegmentSizeInMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config commitlog segment size in mb params +func (o *FindConfigCommitlogSegmentSizeInMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config commitlog segment size in mb params +func (o *FindConfigCommitlogSegmentSizeInMbParams) WithContext(ctx context.Context) *FindConfigCommitlogSegmentSizeInMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config commitlog segment size in mb params +func (o *FindConfigCommitlogSegmentSizeInMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config commitlog segment size in mb params +func (o *FindConfigCommitlogSegmentSizeInMbParams) WithHTTPClient(client *http.Client) *FindConfigCommitlogSegmentSizeInMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config commitlog segment size in mb params +func (o *FindConfigCommitlogSegmentSizeInMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCommitlogSegmentSizeInMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_segment_size_in_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_segment_size_in_mb_responses.go new file mode 100644 index 0000000000..0677b63e60 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_segment_size_in_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCommitlogSegmentSizeInMbReader is a Reader for the FindConfigCommitlogSegmentSizeInMb structure. +type FindConfigCommitlogSegmentSizeInMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCommitlogSegmentSizeInMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCommitlogSegmentSizeInMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCommitlogSegmentSizeInMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCommitlogSegmentSizeInMbOK creates a FindConfigCommitlogSegmentSizeInMbOK with default headers values +func NewFindConfigCommitlogSegmentSizeInMbOK() *FindConfigCommitlogSegmentSizeInMbOK { + return &FindConfigCommitlogSegmentSizeInMbOK{} +} + +/* +FindConfigCommitlogSegmentSizeInMbOK handles this case with default header values. + +Config value +*/ +type FindConfigCommitlogSegmentSizeInMbOK struct { + Payload int64 +} + +func (o *FindConfigCommitlogSegmentSizeInMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigCommitlogSegmentSizeInMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCommitlogSegmentSizeInMbDefault creates a FindConfigCommitlogSegmentSizeInMbDefault with default headers values +func NewFindConfigCommitlogSegmentSizeInMbDefault(code int) *FindConfigCommitlogSegmentSizeInMbDefault { + return &FindConfigCommitlogSegmentSizeInMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigCommitlogSegmentSizeInMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCommitlogSegmentSizeInMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config commitlog segment size in mb default response +func (o *FindConfigCommitlogSegmentSizeInMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCommitlogSegmentSizeInMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCommitlogSegmentSizeInMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCommitlogSegmentSizeInMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_batch_window_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_batch_window_in_ms_parameters.go new file mode 100644 index 0000000000..4bb3705b8a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_batch_window_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCommitlogSyncBatchWindowInMsParams creates a new FindConfigCommitlogSyncBatchWindowInMsParams object +// with the default values initialized. +func NewFindConfigCommitlogSyncBatchWindowInMsParams() *FindConfigCommitlogSyncBatchWindowInMsParams { + + return &FindConfigCommitlogSyncBatchWindowInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCommitlogSyncBatchWindowInMsParamsWithTimeout creates a new FindConfigCommitlogSyncBatchWindowInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCommitlogSyncBatchWindowInMsParamsWithTimeout(timeout time.Duration) *FindConfigCommitlogSyncBatchWindowInMsParams { + + return &FindConfigCommitlogSyncBatchWindowInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigCommitlogSyncBatchWindowInMsParamsWithContext creates a new FindConfigCommitlogSyncBatchWindowInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCommitlogSyncBatchWindowInMsParamsWithContext(ctx context.Context) *FindConfigCommitlogSyncBatchWindowInMsParams { + + return &FindConfigCommitlogSyncBatchWindowInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigCommitlogSyncBatchWindowInMsParamsWithHTTPClient creates a new FindConfigCommitlogSyncBatchWindowInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCommitlogSyncBatchWindowInMsParamsWithHTTPClient(client *http.Client) *FindConfigCommitlogSyncBatchWindowInMsParams { + + return &FindConfigCommitlogSyncBatchWindowInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigCommitlogSyncBatchWindowInMsParams contains all the parameters to send to the API endpoint +for the find config commitlog sync batch window in ms operation typically these are written to a http.Request +*/ +type FindConfigCommitlogSyncBatchWindowInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config commitlog sync batch window in ms params +func (o *FindConfigCommitlogSyncBatchWindowInMsParams) WithTimeout(timeout time.Duration) *FindConfigCommitlogSyncBatchWindowInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config commitlog sync batch window in ms params +func (o *FindConfigCommitlogSyncBatchWindowInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config commitlog sync batch window in ms params +func (o *FindConfigCommitlogSyncBatchWindowInMsParams) WithContext(ctx context.Context) *FindConfigCommitlogSyncBatchWindowInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config commitlog sync batch window in ms params +func (o *FindConfigCommitlogSyncBatchWindowInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config commitlog sync batch window in ms params +func (o *FindConfigCommitlogSyncBatchWindowInMsParams) WithHTTPClient(client *http.Client) *FindConfigCommitlogSyncBatchWindowInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config commitlog sync batch window in ms params +func (o *FindConfigCommitlogSyncBatchWindowInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCommitlogSyncBatchWindowInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_batch_window_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_batch_window_in_ms_responses.go new file mode 100644 index 0000000000..a3257d683f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_batch_window_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCommitlogSyncBatchWindowInMsReader is a Reader for the FindConfigCommitlogSyncBatchWindowInMs structure. +type FindConfigCommitlogSyncBatchWindowInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCommitlogSyncBatchWindowInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCommitlogSyncBatchWindowInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCommitlogSyncBatchWindowInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCommitlogSyncBatchWindowInMsOK creates a FindConfigCommitlogSyncBatchWindowInMsOK with default headers values +func NewFindConfigCommitlogSyncBatchWindowInMsOK() *FindConfigCommitlogSyncBatchWindowInMsOK { + return &FindConfigCommitlogSyncBatchWindowInMsOK{} +} + +/* +FindConfigCommitlogSyncBatchWindowInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigCommitlogSyncBatchWindowInMsOK struct { + Payload int64 +} + +func (o *FindConfigCommitlogSyncBatchWindowInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigCommitlogSyncBatchWindowInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCommitlogSyncBatchWindowInMsDefault creates a FindConfigCommitlogSyncBatchWindowInMsDefault with default headers values +func NewFindConfigCommitlogSyncBatchWindowInMsDefault(code int) *FindConfigCommitlogSyncBatchWindowInMsDefault { + return &FindConfigCommitlogSyncBatchWindowInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigCommitlogSyncBatchWindowInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCommitlogSyncBatchWindowInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config commitlog sync batch window in ms default response +func (o *FindConfigCommitlogSyncBatchWindowInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCommitlogSyncBatchWindowInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCommitlogSyncBatchWindowInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCommitlogSyncBatchWindowInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_parameters.go new file mode 100644 index 0000000000..8c5ba7d1ee --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCommitlogSyncParams creates a new FindConfigCommitlogSyncParams object +// with the default values initialized. +func NewFindConfigCommitlogSyncParams() *FindConfigCommitlogSyncParams { + + return &FindConfigCommitlogSyncParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCommitlogSyncParamsWithTimeout creates a new FindConfigCommitlogSyncParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCommitlogSyncParamsWithTimeout(timeout time.Duration) *FindConfigCommitlogSyncParams { + + return &FindConfigCommitlogSyncParams{ + + timeout: timeout, + } +} + +// NewFindConfigCommitlogSyncParamsWithContext creates a new FindConfigCommitlogSyncParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCommitlogSyncParamsWithContext(ctx context.Context) *FindConfigCommitlogSyncParams { + + return &FindConfigCommitlogSyncParams{ + + Context: ctx, + } +} + +// NewFindConfigCommitlogSyncParamsWithHTTPClient creates a new FindConfigCommitlogSyncParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCommitlogSyncParamsWithHTTPClient(client *http.Client) *FindConfigCommitlogSyncParams { + + return &FindConfigCommitlogSyncParams{ + HTTPClient: client, + } +} + +/* +FindConfigCommitlogSyncParams contains all the parameters to send to the API endpoint +for the find config commitlog sync operation typically these are written to a http.Request +*/ +type FindConfigCommitlogSyncParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config commitlog sync params +func (o *FindConfigCommitlogSyncParams) WithTimeout(timeout time.Duration) *FindConfigCommitlogSyncParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config commitlog sync params +func (o *FindConfigCommitlogSyncParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config commitlog sync params +func (o *FindConfigCommitlogSyncParams) WithContext(ctx context.Context) *FindConfigCommitlogSyncParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config commitlog sync params +func (o *FindConfigCommitlogSyncParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config commitlog sync params +func (o *FindConfigCommitlogSyncParams) WithHTTPClient(client *http.Client) *FindConfigCommitlogSyncParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config commitlog sync params +func (o *FindConfigCommitlogSyncParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCommitlogSyncParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_period_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_period_in_ms_parameters.go new file mode 100644 index 0000000000..f7dd5c2ddf --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_period_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCommitlogSyncPeriodInMsParams creates a new FindConfigCommitlogSyncPeriodInMsParams object +// with the default values initialized. +func NewFindConfigCommitlogSyncPeriodInMsParams() *FindConfigCommitlogSyncPeriodInMsParams { + + return &FindConfigCommitlogSyncPeriodInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCommitlogSyncPeriodInMsParamsWithTimeout creates a new FindConfigCommitlogSyncPeriodInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCommitlogSyncPeriodInMsParamsWithTimeout(timeout time.Duration) *FindConfigCommitlogSyncPeriodInMsParams { + + return &FindConfigCommitlogSyncPeriodInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigCommitlogSyncPeriodInMsParamsWithContext creates a new FindConfigCommitlogSyncPeriodInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCommitlogSyncPeriodInMsParamsWithContext(ctx context.Context) *FindConfigCommitlogSyncPeriodInMsParams { + + return &FindConfigCommitlogSyncPeriodInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigCommitlogSyncPeriodInMsParamsWithHTTPClient creates a new FindConfigCommitlogSyncPeriodInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCommitlogSyncPeriodInMsParamsWithHTTPClient(client *http.Client) *FindConfigCommitlogSyncPeriodInMsParams { + + return &FindConfigCommitlogSyncPeriodInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigCommitlogSyncPeriodInMsParams contains all the parameters to send to the API endpoint +for the find config commitlog sync period in ms operation typically these are written to a http.Request +*/ +type FindConfigCommitlogSyncPeriodInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config commitlog sync period in ms params +func (o *FindConfigCommitlogSyncPeriodInMsParams) WithTimeout(timeout time.Duration) *FindConfigCommitlogSyncPeriodInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config commitlog sync period in ms params +func (o *FindConfigCommitlogSyncPeriodInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config commitlog sync period in ms params +func (o *FindConfigCommitlogSyncPeriodInMsParams) WithContext(ctx context.Context) *FindConfigCommitlogSyncPeriodInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config commitlog sync period in ms params +func (o *FindConfigCommitlogSyncPeriodInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config commitlog sync period in ms params +func (o *FindConfigCommitlogSyncPeriodInMsParams) WithHTTPClient(client *http.Client) *FindConfigCommitlogSyncPeriodInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config commitlog sync period in ms params +func (o *FindConfigCommitlogSyncPeriodInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCommitlogSyncPeriodInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_period_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_period_in_ms_responses.go new file mode 100644 index 0000000000..7da56e40d6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_period_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCommitlogSyncPeriodInMsReader is a Reader for the FindConfigCommitlogSyncPeriodInMs structure. +type FindConfigCommitlogSyncPeriodInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCommitlogSyncPeriodInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCommitlogSyncPeriodInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCommitlogSyncPeriodInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCommitlogSyncPeriodInMsOK creates a FindConfigCommitlogSyncPeriodInMsOK with default headers values +func NewFindConfigCommitlogSyncPeriodInMsOK() *FindConfigCommitlogSyncPeriodInMsOK { + return &FindConfigCommitlogSyncPeriodInMsOK{} +} + +/* +FindConfigCommitlogSyncPeriodInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigCommitlogSyncPeriodInMsOK struct { + Payload int64 +} + +func (o *FindConfigCommitlogSyncPeriodInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigCommitlogSyncPeriodInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCommitlogSyncPeriodInMsDefault creates a FindConfigCommitlogSyncPeriodInMsDefault with default headers values +func NewFindConfigCommitlogSyncPeriodInMsDefault(code int) *FindConfigCommitlogSyncPeriodInMsDefault { + return &FindConfigCommitlogSyncPeriodInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigCommitlogSyncPeriodInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCommitlogSyncPeriodInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config commitlog sync period in ms default response +func (o *FindConfigCommitlogSyncPeriodInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCommitlogSyncPeriodInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCommitlogSyncPeriodInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCommitlogSyncPeriodInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_responses.go new file mode 100644 index 0000000000..479391bce3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_sync_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCommitlogSyncReader is a Reader for the FindConfigCommitlogSync structure. +type FindConfigCommitlogSyncReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCommitlogSyncReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCommitlogSyncOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCommitlogSyncDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCommitlogSyncOK creates a FindConfigCommitlogSyncOK with default headers values +func NewFindConfigCommitlogSyncOK() *FindConfigCommitlogSyncOK { + return &FindConfigCommitlogSyncOK{} +} + +/* +FindConfigCommitlogSyncOK handles this case with default header values. + +Config value +*/ +type FindConfigCommitlogSyncOK struct { + Payload string +} + +func (o *FindConfigCommitlogSyncOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigCommitlogSyncOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCommitlogSyncDefault creates a FindConfigCommitlogSyncDefault with default headers values +func NewFindConfigCommitlogSyncDefault(code int) *FindConfigCommitlogSyncDefault { + return &FindConfigCommitlogSyncDefault{ + _statusCode: code, + } +} + +/* +FindConfigCommitlogSyncDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCommitlogSyncDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config commitlog sync default response +func (o *FindConfigCommitlogSyncDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCommitlogSyncDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCommitlogSyncDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCommitlogSyncDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_total_space_in_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_total_space_in_mb_parameters.go new file mode 100644 index 0000000000..ba72738fd9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_total_space_in_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCommitlogTotalSpaceInMbParams creates a new FindConfigCommitlogTotalSpaceInMbParams object +// with the default values initialized. +func NewFindConfigCommitlogTotalSpaceInMbParams() *FindConfigCommitlogTotalSpaceInMbParams { + + return &FindConfigCommitlogTotalSpaceInMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCommitlogTotalSpaceInMbParamsWithTimeout creates a new FindConfigCommitlogTotalSpaceInMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCommitlogTotalSpaceInMbParamsWithTimeout(timeout time.Duration) *FindConfigCommitlogTotalSpaceInMbParams { + + return &FindConfigCommitlogTotalSpaceInMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigCommitlogTotalSpaceInMbParamsWithContext creates a new FindConfigCommitlogTotalSpaceInMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCommitlogTotalSpaceInMbParamsWithContext(ctx context.Context) *FindConfigCommitlogTotalSpaceInMbParams { + + return &FindConfigCommitlogTotalSpaceInMbParams{ + + Context: ctx, + } +} + +// NewFindConfigCommitlogTotalSpaceInMbParamsWithHTTPClient creates a new FindConfigCommitlogTotalSpaceInMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCommitlogTotalSpaceInMbParamsWithHTTPClient(client *http.Client) *FindConfigCommitlogTotalSpaceInMbParams { + + return &FindConfigCommitlogTotalSpaceInMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigCommitlogTotalSpaceInMbParams contains all the parameters to send to the API endpoint +for the find config commitlog total space in mb operation typically these are written to a http.Request +*/ +type FindConfigCommitlogTotalSpaceInMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config commitlog total space in mb params +func (o *FindConfigCommitlogTotalSpaceInMbParams) WithTimeout(timeout time.Duration) *FindConfigCommitlogTotalSpaceInMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config commitlog total space in mb params +func (o *FindConfigCommitlogTotalSpaceInMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config commitlog total space in mb params +func (o *FindConfigCommitlogTotalSpaceInMbParams) WithContext(ctx context.Context) *FindConfigCommitlogTotalSpaceInMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config commitlog total space in mb params +func (o *FindConfigCommitlogTotalSpaceInMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config commitlog total space in mb params +func (o *FindConfigCommitlogTotalSpaceInMbParams) WithHTTPClient(client *http.Client) *FindConfigCommitlogTotalSpaceInMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config commitlog total space in mb params +func (o *FindConfigCommitlogTotalSpaceInMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCommitlogTotalSpaceInMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_total_space_in_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_total_space_in_mb_responses.go new file mode 100644 index 0000000000..e2bd77c0f6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_total_space_in_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCommitlogTotalSpaceInMbReader is a Reader for the FindConfigCommitlogTotalSpaceInMb structure. +type FindConfigCommitlogTotalSpaceInMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCommitlogTotalSpaceInMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCommitlogTotalSpaceInMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCommitlogTotalSpaceInMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCommitlogTotalSpaceInMbOK creates a FindConfigCommitlogTotalSpaceInMbOK with default headers values +func NewFindConfigCommitlogTotalSpaceInMbOK() *FindConfigCommitlogTotalSpaceInMbOK { + return &FindConfigCommitlogTotalSpaceInMbOK{} +} + +/* +FindConfigCommitlogTotalSpaceInMbOK handles this case with default header values. + +Config value +*/ +type FindConfigCommitlogTotalSpaceInMbOK struct { + Payload int64 +} + +func (o *FindConfigCommitlogTotalSpaceInMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigCommitlogTotalSpaceInMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCommitlogTotalSpaceInMbDefault creates a FindConfigCommitlogTotalSpaceInMbDefault with default headers values +func NewFindConfigCommitlogTotalSpaceInMbDefault(code int) *FindConfigCommitlogTotalSpaceInMbDefault { + return &FindConfigCommitlogTotalSpaceInMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigCommitlogTotalSpaceInMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCommitlogTotalSpaceInMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config commitlog total space in mb default response +func (o *FindConfigCommitlogTotalSpaceInMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCommitlogTotalSpaceInMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCommitlogTotalSpaceInMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCommitlogTotalSpaceInMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_useo_dsync_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_useo_dsync_parameters.go new file mode 100644 index 0000000000..fef5437af8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_useo_dsync_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCommitlogUseoDsyncParams creates a new FindConfigCommitlogUseoDsyncParams object +// with the default values initialized. +func NewFindConfigCommitlogUseoDsyncParams() *FindConfigCommitlogUseoDsyncParams { + + return &FindConfigCommitlogUseoDsyncParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCommitlogUseoDsyncParamsWithTimeout creates a new FindConfigCommitlogUseoDsyncParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCommitlogUseoDsyncParamsWithTimeout(timeout time.Duration) *FindConfigCommitlogUseoDsyncParams { + + return &FindConfigCommitlogUseoDsyncParams{ + + timeout: timeout, + } +} + +// NewFindConfigCommitlogUseoDsyncParamsWithContext creates a new FindConfigCommitlogUseoDsyncParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCommitlogUseoDsyncParamsWithContext(ctx context.Context) *FindConfigCommitlogUseoDsyncParams { + + return &FindConfigCommitlogUseoDsyncParams{ + + Context: ctx, + } +} + +// NewFindConfigCommitlogUseoDsyncParamsWithHTTPClient creates a new FindConfigCommitlogUseoDsyncParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCommitlogUseoDsyncParamsWithHTTPClient(client *http.Client) *FindConfigCommitlogUseoDsyncParams { + + return &FindConfigCommitlogUseoDsyncParams{ + HTTPClient: client, + } +} + +/* +FindConfigCommitlogUseoDsyncParams contains all the parameters to send to the API endpoint +for the find config commitlog use o dsync operation typically these are written to a http.Request +*/ +type FindConfigCommitlogUseoDsyncParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config commitlog use o dsync params +func (o *FindConfigCommitlogUseoDsyncParams) WithTimeout(timeout time.Duration) *FindConfigCommitlogUseoDsyncParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config commitlog use o dsync params +func (o *FindConfigCommitlogUseoDsyncParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config commitlog use o dsync params +func (o *FindConfigCommitlogUseoDsyncParams) WithContext(ctx context.Context) *FindConfigCommitlogUseoDsyncParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config commitlog use o dsync params +func (o *FindConfigCommitlogUseoDsyncParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config commitlog use o dsync params +func (o *FindConfigCommitlogUseoDsyncParams) WithHTTPClient(client *http.Client) *FindConfigCommitlogUseoDsyncParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config commitlog use o dsync params +func (o *FindConfigCommitlogUseoDsyncParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCommitlogUseoDsyncParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_useo_dsync_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_useo_dsync_responses.go new file mode 100644 index 0000000000..4d4ba360d5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_commitlog_useo_dsync_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCommitlogUseoDsyncReader is a Reader for the FindConfigCommitlogUseoDsync structure. +type FindConfigCommitlogUseoDsyncReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCommitlogUseoDsyncReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCommitlogUseODsyncOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCommitlogUseoDsyncDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCommitlogUseODsyncOK creates a FindConfigCommitlogUseODsyncOK with default headers values +func NewFindConfigCommitlogUseODsyncOK() *FindConfigCommitlogUseODsyncOK { + return &FindConfigCommitlogUseODsyncOK{} +} + +/* +FindConfigCommitlogUseODsyncOK handles this case with default header values. + +Config value +*/ +type FindConfigCommitlogUseODsyncOK struct { + Payload bool +} + +func (o *FindConfigCommitlogUseODsyncOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigCommitlogUseODsyncOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCommitlogUseoDsyncDefault creates a FindConfigCommitlogUseoDsyncDefault with default headers values +func NewFindConfigCommitlogUseoDsyncDefault(code int) *FindConfigCommitlogUseoDsyncDefault { + return &FindConfigCommitlogUseoDsyncDefault{ + _statusCode: code, + } +} + +/* +FindConfigCommitlogUseoDsyncDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCommitlogUseoDsyncDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config commitlog use o dsync default response +func (o *FindConfigCommitlogUseoDsyncDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCommitlogUseoDsyncDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCommitlogUseoDsyncDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCommitlogUseoDsyncDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_enforce_min_threshold_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_enforce_min_threshold_parameters.go new file mode 100644 index 0000000000..1f7fcff544 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_enforce_min_threshold_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCompactionEnforceMinThresholdParams creates a new FindConfigCompactionEnforceMinThresholdParams object +// with the default values initialized. +func NewFindConfigCompactionEnforceMinThresholdParams() *FindConfigCompactionEnforceMinThresholdParams { + + return &FindConfigCompactionEnforceMinThresholdParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCompactionEnforceMinThresholdParamsWithTimeout creates a new FindConfigCompactionEnforceMinThresholdParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCompactionEnforceMinThresholdParamsWithTimeout(timeout time.Duration) *FindConfigCompactionEnforceMinThresholdParams { + + return &FindConfigCompactionEnforceMinThresholdParams{ + + timeout: timeout, + } +} + +// NewFindConfigCompactionEnforceMinThresholdParamsWithContext creates a new FindConfigCompactionEnforceMinThresholdParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCompactionEnforceMinThresholdParamsWithContext(ctx context.Context) *FindConfigCompactionEnforceMinThresholdParams { + + return &FindConfigCompactionEnforceMinThresholdParams{ + + Context: ctx, + } +} + +// NewFindConfigCompactionEnforceMinThresholdParamsWithHTTPClient creates a new FindConfigCompactionEnforceMinThresholdParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCompactionEnforceMinThresholdParamsWithHTTPClient(client *http.Client) *FindConfigCompactionEnforceMinThresholdParams { + + return &FindConfigCompactionEnforceMinThresholdParams{ + HTTPClient: client, + } +} + +/* +FindConfigCompactionEnforceMinThresholdParams contains all the parameters to send to the API endpoint +for the find config compaction enforce min threshold operation typically these are written to a http.Request +*/ +type FindConfigCompactionEnforceMinThresholdParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config compaction enforce min threshold params +func (o *FindConfigCompactionEnforceMinThresholdParams) WithTimeout(timeout time.Duration) *FindConfigCompactionEnforceMinThresholdParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config compaction enforce min threshold params +func (o *FindConfigCompactionEnforceMinThresholdParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config compaction enforce min threshold params +func (o *FindConfigCompactionEnforceMinThresholdParams) WithContext(ctx context.Context) *FindConfigCompactionEnforceMinThresholdParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config compaction enforce min threshold params +func (o *FindConfigCompactionEnforceMinThresholdParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config compaction enforce min threshold params +func (o *FindConfigCompactionEnforceMinThresholdParams) WithHTTPClient(client *http.Client) *FindConfigCompactionEnforceMinThresholdParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config compaction enforce min threshold params +func (o *FindConfigCompactionEnforceMinThresholdParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCompactionEnforceMinThresholdParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_enforce_min_threshold_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_enforce_min_threshold_responses.go new file mode 100644 index 0000000000..5795744add --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_enforce_min_threshold_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCompactionEnforceMinThresholdReader is a Reader for the FindConfigCompactionEnforceMinThreshold structure. +type FindConfigCompactionEnforceMinThresholdReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCompactionEnforceMinThresholdReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCompactionEnforceMinThresholdOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCompactionEnforceMinThresholdDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCompactionEnforceMinThresholdOK creates a FindConfigCompactionEnforceMinThresholdOK with default headers values +func NewFindConfigCompactionEnforceMinThresholdOK() *FindConfigCompactionEnforceMinThresholdOK { + return &FindConfigCompactionEnforceMinThresholdOK{} +} + +/* +FindConfigCompactionEnforceMinThresholdOK handles this case with default header values. + +Config value +*/ +type FindConfigCompactionEnforceMinThresholdOK struct { + Payload bool +} + +func (o *FindConfigCompactionEnforceMinThresholdOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigCompactionEnforceMinThresholdOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCompactionEnforceMinThresholdDefault creates a FindConfigCompactionEnforceMinThresholdDefault with default headers values +func NewFindConfigCompactionEnforceMinThresholdDefault(code int) *FindConfigCompactionEnforceMinThresholdDefault { + return &FindConfigCompactionEnforceMinThresholdDefault{ + _statusCode: code, + } +} + +/* +FindConfigCompactionEnforceMinThresholdDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCompactionEnforceMinThresholdDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config compaction enforce min threshold default response +func (o *FindConfigCompactionEnforceMinThresholdDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCompactionEnforceMinThresholdDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCompactionEnforceMinThresholdDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCompactionEnforceMinThresholdDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_cell_warning_threshold_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_cell_warning_threshold_mb_parameters.go new file mode 100644 index 0000000000..71dab2dc2b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_cell_warning_threshold_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCompactionLargeCellWarningThresholdMbParams creates a new FindConfigCompactionLargeCellWarningThresholdMbParams object +// with the default values initialized. +func NewFindConfigCompactionLargeCellWarningThresholdMbParams() *FindConfigCompactionLargeCellWarningThresholdMbParams { + + return &FindConfigCompactionLargeCellWarningThresholdMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCompactionLargeCellWarningThresholdMbParamsWithTimeout creates a new FindConfigCompactionLargeCellWarningThresholdMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCompactionLargeCellWarningThresholdMbParamsWithTimeout(timeout time.Duration) *FindConfigCompactionLargeCellWarningThresholdMbParams { + + return &FindConfigCompactionLargeCellWarningThresholdMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigCompactionLargeCellWarningThresholdMbParamsWithContext creates a new FindConfigCompactionLargeCellWarningThresholdMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCompactionLargeCellWarningThresholdMbParamsWithContext(ctx context.Context) *FindConfigCompactionLargeCellWarningThresholdMbParams { + + return &FindConfigCompactionLargeCellWarningThresholdMbParams{ + + Context: ctx, + } +} + +// NewFindConfigCompactionLargeCellWarningThresholdMbParamsWithHTTPClient creates a new FindConfigCompactionLargeCellWarningThresholdMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCompactionLargeCellWarningThresholdMbParamsWithHTTPClient(client *http.Client) *FindConfigCompactionLargeCellWarningThresholdMbParams { + + return &FindConfigCompactionLargeCellWarningThresholdMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigCompactionLargeCellWarningThresholdMbParams contains all the parameters to send to the API endpoint +for the find config compaction large cell warning threshold mb operation typically these are written to a http.Request +*/ +type FindConfigCompactionLargeCellWarningThresholdMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config compaction large cell warning threshold mb params +func (o *FindConfigCompactionLargeCellWarningThresholdMbParams) WithTimeout(timeout time.Duration) *FindConfigCompactionLargeCellWarningThresholdMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config compaction large cell warning threshold mb params +func (o *FindConfigCompactionLargeCellWarningThresholdMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config compaction large cell warning threshold mb params +func (o *FindConfigCompactionLargeCellWarningThresholdMbParams) WithContext(ctx context.Context) *FindConfigCompactionLargeCellWarningThresholdMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config compaction large cell warning threshold mb params +func (o *FindConfigCompactionLargeCellWarningThresholdMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config compaction large cell warning threshold mb params +func (o *FindConfigCompactionLargeCellWarningThresholdMbParams) WithHTTPClient(client *http.Client) *FindConfigCompactionLargeCellWarningThresholdMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config compaction large cell warning threshold mb params +func (o *FindConfigCompactionLargeCellWarningThresholdMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCompactionLargeCellWarningThresholdMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_cell_warning_threshold_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_cell_warning_threshold_mb_responses.go new file mode 100644 index 0000000000..00d531e8b7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_cell_warning_threshold_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCompactionLargeCellWarningThresholdMbReader is a Reader for the FindConfigCompactionLargeCellWarningThresholdMb structure. +type FindConfigCompactionLargeCellWarningThresholdMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCompactionLargeCellWarningThresholdMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCompactionLargeCellWarningThresholdMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCompactionLargeCellWarningThresholdMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCompactionLargeCellWarningThresholdMbOK creates a FindConfigCompactionLargeCellWarningThresholdMbOK with default headers values +func NewFindConfigCompactionLargeCellWarningThresholdMbOK() *FindConfigCompactionLargeCellWarningThresholdMbOK { + return &FindConfigCompactionLargeCellWarningThresholdMbOK{} +} + +/* +FindConfigCompactionLargeCellWarningThresholdMbOK handles this case with default header values. + +Config value +*/ +type FindConfigCompactionLargeCellWarningThresholdMbOK struct { + Payload int64 +} + +func (o *FindConfigCompactionLargeCellWarningThresholdMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigCompactionLargeCellWarningThresholdMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCompactionLargeCellWarningThresholdMbDefault creates a FindConfigCompactionLargeCellWarningThresholdMbDefault with default headers values +func NewFindConfigCompactionLargeCellWarningThresholdMbDefault(code int) *FindConfigCompactionLargeCellWarningThresholdMbDefault { + return &FindConfigCompactionLargeCellWarningThresholdMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigCompactionLargeCellWarningThresholdMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCompactionLargeCellWarningThresholdMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config compaction large cell warning threshold mb default response +func (o *FindConfigCompactionLargeCellWarningThresholdMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCompactionLargeCellWarningThresholdMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCompactionLargeCellWarningThresholdMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCompactionLargeCellWarningThresholdMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_partition_warning_threshold_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_partition_warning_threshold_mb_parameters.go new file mode 100644 index 0000000000..56ba39a736 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_partition_warning_threshold_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCompactionLargePartitionWarningThresholdMbParams creates a new FindConfigCompactionLargePartitionWarningThresholdMbParams object +// with the default values initialized. +func NewFindConfigCompactionLargePartitionWarningThresholdMbParams() *FindConfigCompactionLargePartitionWarningThresholdMbParams { + + return &FindConfigCompactionLargePartitionWarningThresholdMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCompactionLargePartitionWarningThresholdMbParamsWithTimeout creates a new FindConfigCompactionLargePartitionWarningThresholdMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCompactionLargePartitionWarningThresholdMbParamsWithTimeout(timeout time.Duration) *FindConfigCompactionLargePartitionWarningThresholdMbParams { + + return &FindConfigCompactionLargePartitionWarningThresholdMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigCompactionLargePartitionWarningThresholdMbParamsWithContext creates a new FindConfigCompactionLargePartitionWarningThresholdMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCompactionLargePartitionWarningThresholdMbParamsWithContext(ctx context.Context) *FindConfigCompactionLargePartitionWarningThresholdMbParams { + + return &FindConfigCompactionLargePartitionWarningThresholdMbParams{ + + Context: ctx, + } +} + +// NewFindConfigCompactionLargePartitionWarningThresholdMbParamsWithHTTPClient creates a new FindConfigCompactionLargePartitionWarningThresholdMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCompactionLargePartitionWarningThresholdMbParamsWithHTTPClient(client *http.Client) *FindConfigCompactionLargePartitionWarningThresholdMbParams { + + return &FindConfigCompactionLargePartitionWarningThresholdMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigCompactionLargePartitionWarningThresholdMbParams contains all the parameters to send to the API endpoint +for the find config compaction large partition warning threshold mb operation typically these are written to a http.Request +*/ +type FindConfigCompactionLargePartitionWarningThresholdMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config compaction large partition warning threshold mb params +func (o *FindConfigCompactionLargePartitionWarningThresholdMbParams) WithTimeout(timeout time.Duration) *FindConfigCompactionLargePartitionWarningThresholdMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config compaction large partition warning threshold mb params +func (o *FindConfigCompactionLargePartitionWarningThresholdMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config compaction large partition warning threshold mb params +func (o *FindConfigCompactionLargePartitionWarningThresholdMbParams) WithContext(ctx context.Context) *FindConfigCompactionLargePartitionWarningThresholdMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config compaction large partition warning threshold mb params +func (o *FindConfigCompactionLargePartitionWarningThresholdMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config compaction large partition warning threshold mb params +func (o *FindConfigCompactionLargePartitionWarningThresholdMbParams) WithHTTPClient(client *http.Client) *FindConfigCompactionLargePartitionWarningThresholdMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config compaction large partition warning threshold mb params +func (o *FindConfigCompactionLargePartitionWarningThresholdMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCompactionLargePartitionWarningThresholdMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_partition_warning_threshold_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_partition_warning_threshold_mb_responses.go new file mode 100644 index 0000000000..73762fc4ce --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_partition_warning_threshold_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCompactionLargePartitionWarningThresholdMbReader is a Reader for the FindConfigCompactionLargePartitionWarningThresholdMb structure. +type FindConfigCompactionLargePartitionWarningThresholdMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCompactionLargePartitionWarningThresholdMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCompactionLargePartitionWarningThresholdMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCompactionLargePartitionWarningThresholdMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCompactionLargePartitionWarningThresholdMbOK creates a FindConfigCompactionLargePartitionWarningThresholdMbOK with default headers values +func NewFindConfigCompactionLargePartitionWarningThresholdMbOK() *FindConfigCompactionLargePartitionWarningThresholdMbOK { + return &FindConfigCompactionLargePartitionWarningThresholdMbOK{} +} + +/* +FindConfigCompactionLargePartitionWarningThresholdMbOK handles this case with default header values. + +Config value +*/ +type FindConfigCompactionLargePartitionWarningThresholdMbOK struct { + Payload int64 +} + +func (o *FindConfigCompactionLargePartitionWarningThresholdMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigCompactionLargePartitionWarningThresholdMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCompactionLargePartitionWarningThresholdMbDefault creates a FindConfigCompactionLargePartitionWarningThresholdMbDefault with default headers values +func NewFindConfigCompactionLargePartitionWarningThresholdMbDefault(code int) *FindConfigCompactionLargePartitionWarningThresholdMbDefault { + return &FindConfigCompactionLargePartitionWarningThresholdMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigCompactionLargePartitionWarningThresholdMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCompactionLargePartitionWarningThresholdMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config compaction large partition warning threshold mb default response +func (o *FindConfigCompactionLargePartitionWarningThresholdMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCompactionLargePartitionWarningThresholdMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCompactionLargePartitionWarningThresholdMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCompactionLargePartitionWarningThresholdMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_row_warning_threshold_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_row_warning_threshold_mb_parameters.go new file mode 100644 index 0000000000..0377ebeb53 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_row_warning_threshold_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCompactionLargeRowWarningThresholdMbParams creates a new FindConfigCompactionLargeRowWarningThresholdMbParams object +// with the default values initialized. +func NewFindConfigCompactionLargeRowWarningThresholdMbParams() *FindConfigCompactionLargeRowWarningThresholdMbParams { + + return &FindConfigCompactionLargeRowWarningThresholdMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCompactionLargeRowWarningThresholdMbParamsWithTimeout creates a new FindConfigCompactionLargeRowWarningThresholdMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCompactionLargeRowWarningThresholdMbParamsWithTimeout(timeout time.Duration) *FindConfigCompactionLargeRowWarningThresholdMbParams { + + return &FindConfigCompactionLargeRowWarningThresholdMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigCompactionLargeRowWarningThresholdMbParamsWithContext creates a new FindConfigCompactionLargeRowWarningThresholdMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCompactionLargeRowWarningThresholdMbParamsWithContext(ctx context.Context) *FindConfigCompactionLargeRowWarningThresholdMbParams { + + return &FindConfigCompactionLargeRowWarningThresholdMbParams{ + + Context: ctx, + } +} + +// NewFindConfigCompactionLargeRowWarningThresholdMbParamsWithHTTPClient creates a new FindConfigCompactionLargeRowWarningThresholdMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCompactionLargeRowWarningThresholdMbParamsWithHTTPClient(client *http.Client) *FindConfigCompactionLargeRowWarningThresholdMbParams { + + return &FindConfigCompactionLargeRowWarningThresholdMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigCompactionLargeRowWarningThresholdMbParams contains all the parameters to send to the API endpoint +for the find config compaction large row warning threshold mb operation typically these are written to a http.Request +*/ +type FindConfigCompactionLargeRowWarningThresholdMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config compaction large row warning threshold mb params +func (o *FindConfigCompactionLargeRowWarningThresholdMbParams) WithTimeout(timeout time.Duration) *FindConfigCompactionLargeRowWarningThresholdMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config compaction large row warning threshold mb params +func (o *FindConfigCompactionLargeRowWarningThresholdMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config compaction large row warning threshold mb params +func (o *FindConfigCompactionLargeRowWarningThresholdMbParams) WithContext(ctx context.Context) *FindConfigCompactionLargeRowWarningThresholdMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config compaction large row warning threshold mb params +func (o *FindConfigCompactionLargeRowWarningThresholdMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config compaction large row warning threshold mb params +func (o *FindConfigCompactionLargeRowWarningThresholdMbParams) WithHTTPClient(client *http.Client) *FindConfigCompactionLargeRowWarningThresholdMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config compaction large row warning threshold mb params +func (o *FindConfigCompactionLargeRowWarningThresholdMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCompactionLargeRowWarningThresholdMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_row_warning_threshold_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_row_warning_threshold_mb_responses.go new file mode 100644 index 0000000000..e9b19f384c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_large_row_warning_threshold_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCompactionLargeRowWarningThresholdMbReader is a Reader for the FindConfigCompactionLargeRowWarningThresholdMb structure. +type FindConfigCompactionLargeRowWarningThresholdMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCompactionLargeRowWarningThresholdMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCompactionLargeRowWarningThresholdMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCompactionLargeRowWarningThresholdMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCompactionLargeRowWarningThresholdMbOK creates a FindConfigCompactionLargeRowWarningThresholdMbOK with default headers values +func NewFindConfigCompactionLargeRowWarningThresholdMbOK() *FindConfigCompactionLargeRowWarningThresholdMbOK { + return &FindConfigCompactionLargeRowWarningThresholdMbOK{} +} + +/* +FindConfigCompactionLargeRowWarningThresholdMbOK handles this case with default header values. + +Config value +*/ +type FindConfigCompactionLargeRowWarningThresholdMbOK struct { + Payload int64 +} + +func (o *FindConfigCompactionLargeRowWarningThresholdMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigCompactionLargeRowWarningThresholdMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCompactionLargeRowWarningThresholdMbDefault creates a FindConfigCompactionLargeRowWarningThresholdMbDefault with default headers values +func NewFindConfigCompactionLargeRowWarningThresholdMbDefault(code int) *FindConfigCompactionLargeRowWarningThresholdMbDefault { + return &FindConfigCompactionLargeRowWarningThresholdMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigCompactionLargeRowWarningThresholdMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCompactionLargeRowWarningThresholdMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config compaction large row warning threshold mb default response +func (o *FindConfigCompactionLargeRowWarningThresholdMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCompactionLargeRowWarningThresholdMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCompactionLargeRowWarningThresholdMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCompactionLargeRowWarningThresholdMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_preheat_key_cache_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_preheat_key_cache_parameters.go new file mode 100644 index 0000000000..0d35dad2d8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_preheat_key_cache_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCompactionPreheatKeyCacheParams creates a new FindConfigCompactionPreheatKeyCacheParams object +// with the default values initialized. +func NewFindConfigCompactionPreheatKeyCacheParams() *FindConfigCompactionPreheatKeyCacheParams { + + return &FindConfigCompactionPreheatKeyCacheParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCompactionPreheatKeyCacheParamsWithTimeout creates a new FindConfigCompactionPreheatKeyCacheParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCompactionPreheatKeyCacheParamsWithTimeout(timeout time.Duration) *FindConfigCompactionPreheatKeyCacheParams { + + return &FindConfigCompactionPreheatKeyCacheParams{ + + timeout: timeout, + } +} + +// NewFindConfigCompactionPreheatKeyCacheParamsWithContext creates a new FindConfigCompactionPreheatKeyCacheParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCompactionPreheatKeyCacheParamsWithContext(ctx context.Context) *FindConfigCompactionPreheatKeyCacheParams { + + return &FindConfigCompactionPreheatKeyCacheParams{ + + Context: ctx, + } +} + +// NewFindConfigCompactionPreheatKeyCacheParamsWithHTTPClient creates a new FindConfigCompactionPreheatKeyCacheParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCompactionPreheatKeyCacheParamsWithHTTPClient(client *http.Client) *FindConfigCompactionPreheatKeyCacheParams { + + return &FindConfigCompactionPreheatKeyCacheParams{ + HTTPClient: client, + } +} + +/* +FindConfigCompactionPreheatKeyCacheParams contains all the parameters to send to the API endpoint +for the find config compaction preheat key cache operation typically these are written to a http.Request +*/ +type FindConfigCompactionPreheatKeyCacheParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config compaction preheat key cache params +func (o *FindConfigCompactionPreheatKeyCacheParams) WithTimeout(timeout time.Duration) *FindConfigCompactionPreheatKeyCacheParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config compaction preheat key cache params +func (o *FindConfigCompactionPreheatKeyCacheParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config compaction preheat key cache params +func (o *FindConfigCompactionPreheatKeyCacheParams) WithContext(ctx context.Context) *FindConfigCompactionPreheatKeyCacheParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config compaction preheat key cache params +func (o *FindConfigCompactionPreheatKeyCacheParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config compaction preheat key cache params +func (o *FindConfigCompactionPreheatKeyCacheParams) WithHTTPClient(client *http.Client) *FindConfigCompactionPreheatKeyCacheParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config compaction preheat key cache params +func (o *FindConfigCompactionPreheatKeyCacheParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCompactionPreheatKeyCacheParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_preheat_key_cache_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_preheat_key_cache_responses.go new file mode 100644 index 0000000000..4dc09c40a0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_preheat_key_cache_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCompactionPreheatKeyCacheReader is a Reader for the FindConfigCompactionPreheatKeyCache structure. +type FindConfigCompactionPreheatKeyCacheReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCompactionPreheatKeyCacheReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCompactionPreheatKeyCacheOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCompactionPreheatKeyCacheDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCompactionPreheatKeyCacheOK creates a FindConfigCompactionPreheatKeyCacheOK with default headers values +func NewFindConfigCompactionPreheatKeyCacheOK() *FindConfigCompactionPreheatKeyCacheOK { + return &FindConfigCompactionPreheatKeyCacheOK{} +} + +/* +FindConfigCompactionPreheatKeyCacheOK handles this case with default header values. + +Config value +*/ +type FindConfigCompactionPreheatKeyCacheOK struct { + Payload bool +} + +func (o *FindConfigCompactionPreheatKeyCacheOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigCompactionPreheatKeyCacheOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCompactionPreheatKeyCacheDefault creates a FindConfigCompactionPreheatKeyCacheDefault with default headers values +func NewFindConfigCompactionPreheatKeyCacheDefault(code int) *FindConfigCompactionPreheatKeyCacheDefault { + return &FindConfigCompactionPreheatKeyCacheDefault{ + _statusCode: code, + } +} + +/* +FindConfigCompactionPreheatKeyCacheDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCompactionPreheatKeyCacheDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config compaction preheat key cache default response +func (o *FindConfigCompactionPreheatKeyCacheDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCompactionPreheatKeyCacheDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCompactionPreheatKeyCacheDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCompactionPreheatKeyCacheDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_rows_count_warning_threshold_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_rows_count_warning_threshold_parameters.go new file mode 100644 index 0000000000..b9eb40ba15 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_rows_count_warning_threshold_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCompactionRowsCountWarningThresholdParams creates a new FindConfigCompactionRowsCountWarningThresholdParams object +// with the default values initialized. +func NewFindConfigCompactionRowsCountWarningThresholdParams() *FindConfigCompactionRowsCountWarningThresholdParams { + + return &FindConfigCompactionRowsCountWarningThresholdParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCompactionRowsCountWarningThresholdParamsWithTimeout creates a new FindConfigCompactionRowsCountWarningThresholdParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCompactionRowsCountWarningThresholdParamsWithTimeout(timeout time.Duration) *FindConfigCompactionRowsCountWarningThresholdParams { + + return &FindConfigCompactionRowsCountWarningThresholdParams{ + + timeout: timeout, + } +} + +// NewFindConfigCompactionRowsCountWarningThresholdParamsWithContext creates a new FindConfigCompactionRowsCountWarningThresholdParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCompactionRowsCountWarningThresholdParamsWithContext(ctx context.Context) *FindConfigCompactionRowsCountWarningThresholdParams { + + return &FindConfigCompactionRowsCountWarningThresholdParams{ + + Context: ctx, + } +} + +// NewFindConfigCompactionRowsCountWarningThresholdParamsWithHTTPClient creates a new FindConfigCompactionRowsCountWarningThresholdParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCompactionRowsCountWarningThresholdParamsWithHTTPClient(client *http.Client) *FindConfigCompactionRowsCountWarningThresholdParams { + + return &FindConfigCompactionRowsCountWarningThresholdParams{ + HTTPClient: client, + } +} + +/* +FindConfigCompactionRowsCountWarningThresholdParams contains all the parameters to send to the API endpoint +for the find config compaction rows count warning threshold operation typically these are written to a http.Request +*/ +type FindConfigCompactionRowsCountWarningThresholdParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config compaction rows count warning threshold params +func (o *FindConfigCompactionRowsCountWarningThresholdParams) WithTimeout(timeout time.Duration) *FindConfigCompactionRowsCountWarningThresholdParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config compaction rows count warning threshold params +func (o *FindConfigCompactionRowsCountWarningThresholdParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config compaction rows count warning threshold params +func (o *FindConfigCompactionRowsCountWarningThresholdParams) WithContext(ctx context.Context) *FindConfigCompactionRowsCountWarningThresholdParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config compaction rows count warning threshold params +func (o *FindConfigCompactionRowsCountWarningThresholdParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config compaction rows count warning threshold params +func (o *FindConfigCompactionRowsCountWarningThresholdParams) WithHTTPClient(client *http.Client) *FindConfigCompactionRowsCountWarningThresholdParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config compaction rows count warning threshold params +func (o *FindConfigCompactionRowsCountWarningThresholdParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCompactionRowsCountWarningThresholdParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_rows_count_warning_threshold_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_rows_count_warning_threshold_responses.go new file mode 100644 index 0000000000..463234bfa1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_rows_count_warning_threshold_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCompactionRowsCountWarningThresholdReader is a Reader for the FindConfigCompactionRowsCountWarningThreshold structure. +type FindConfigCompactionRowsCountWarningThresholdReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCompactionRowsCountWarningThresholdReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCompactionRowsCountWarningThresholdOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCompactionRowsCountWarningThresholdDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCompactionRowsCountWarningThresholdOK creates a FindConfigCompactionRowsCountWarningThresholdOK with default headers values +func NewFindConfigCompactionRowsCountWarningThresholdOK() *FindConfigCompactionRowsCountWarningThresholdOK { + return &FindConfigCompactionRowsCountWarningThresholdOK{} +} + +/* +FindConfigCompactionRowsCountWarningThresholdOK handles this case with default header values. + +Config value +*/ +type FindConfigCompactionRowsCountWarningThresholdOK struct { + Payload int64 +} + +func (o *FindConfigCompactionRowsCountWarningThresholdOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigCompactionRowsCountWarningThresholdOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCompactionRowsCountWarningThresholdDefault creates a FindConfigCompactionRowsCountWarningThresholdDefault with default headers values +func NewFindConfigCompactionRowsCountWarningThresholdDefault(code int) *FindConfigCompactionRowsCountWarningThresholdDefault { + return &FindConfigCompactionRowsCountWarningThresholdDefault{ + _statusCode: code, + } +} + +/* +FindConfigCompactionRowsCountWarningThresholdDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCompactionRowsCountWarningThresholdDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config compaction rows count warning threshold default response +func (o *FindConfigCompactionRowsCountWarningThresholdDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCompactionRowsCountWarningThresholdDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCompactionRowsCountWarningThresholdDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCompactionRowsCountWarningThresholdDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_static_shares_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_static_shares_parameters.go new file mode 100644 index 0000000000..0df61e228e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_static_shares_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCompactionStaticSharesParams creates a new FindConfigCompactionStaticSharesParams object +// with the default values initialized. +func NewFindConfigCompactionStaticSharesParams() *FindConfigCompactionStaticSharesParams { + + return &FindConfigCompactionStaticSharesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCompactionStaticSharesParamsWithTimeout creates a new FindConfigCompactionStaticSharesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCompactionStaticSharesParamsWithTimeout(timeout time.Duration) *FindConfigCompactionStaticSharesParams { + + return &FindConfigCompactionStaticSharesParams{ + + timeout: timeout, + } +} + +// NewFindConfigCompactionStaticSharesParamsWithContext creates a new FindConfigCompactionStaticSharesParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCompactionStaticSharesParamsWithContext(ctx context.Context) *FindConfigCompactionStaticSharesParams { + + return &FindConfigCompactionStaticSharesParams{ + + Context: ctx, + } +} + +// NewFindConfigCompactionStaticSharesParamsWithHTTPClient creates a new FindConfigCompactionStaticSharesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCompactionStaticSharesParamsWithHTTPClient(client *http.Client) *FindConfigCompactionStaticSharesParams { + + return &FindConfigCompactionStaticSharesParams{ + HTTPClient: client, + } +} + +/* +FindConfigCompactionStaticSharesParams contains all the parameters to send to the API endpoint +for the find config compaction static shares operation typically these are written to a http.Request +*/ +type FindConfigCompactionStaticSharesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config compaction static shares params +func (o *FindConfigCompactionStaticSharesParams) WithTimeout(timeout time.Duration) *FindConfigCompactionStaticSharesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config compaction static shares params +func (o *FindConfigCompactionStaticSharesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config compaction static shares params +func (o *FindConfigCompactionStaticSharesParams) WithContext(ctx context.Context) *FindConfigCompactionStaticSharesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config compaction static shares params +func (o *FindConfigCompactionStaticSharesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config compaction static shares params +func (o *FindConfigCompactionStaticSharesParams) WithHTTPClient(client *http.Client) *FindConfigCompactionStaticSharesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config compaction static shares params +func (o *FindConfigCompactionStaticSharesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCompactionStaticSharesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_static_shares_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_static_shares_responses.go new file mode 100644 index 0000000000..fdbaa0a265 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_static_shares_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCompactionStaticSharesReader is a Reader for the FindConfigCompactionStaticShares structure. +type FindConfigCompactionStaticSharesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCompactionStaticSharesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCompactionStaticSharesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCompactionStaticSharesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCompactionStaticSharesOK creates a FindConfigCompactionStaticSharesOK with default headers values +func NewFindConfigCompactionStaticSharesOK() *FindConfigCompactionStaticSharesOK { + return &FindConfigCompactionStaticSharesOK{} +} + +/* +FindConfigCompactionStaticSharesOK handles this case with default header values. + +Config value +*/ +type FindConfigCompactionStaticSharesOK struct { + Payload float64 +} + +func (o *FindConfigCompactionStaticSharesOK) GetPayload() float64 { + return o.Payload +} + +func (o *FindConfigCompactionStaticSharesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCompactionStaticSharesDefault creates a FindConfigCompactionStaticSharesDefault with default headers values +func NewFindConfigCompactionStaticSharesDefault(code int) *FindConfigCompactionStaticSharesDefault { + return &FindConfigCompactionStaticSharesDefault{ + _statusCode: code, + } +} + +/* +FindConfigCompactionStaticSharesDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCompactionStaticSharesDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config compaction static shares default response +func (o *FindConfigCompactionStaticSharesDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCompactionStaticSharesDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCompactionStaticSharesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCompactionStaticSharesDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_throughput_mb_per_sec_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_throughput_mb_per_sec_parameters.go new file mode 100644 index 0000000000..7d1e75f40e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_throughput_mb_per_sec_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCompactionThroughputMbPerSecParams creates a new FindConfigCompactionThroughputMbPerSecParams object +// with the default values initialized. +func NewFindConfigCompactionThroughputMbPerSecParams() *FindConfigCompactionThroughputMbPerSecParams { + + return &FindConfigCompactionThroughputMbPerSecParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCompactionThroughputMbPerSecParamsWithTimeout creates a new FindConfigCompactionThroughputMbPerSecParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCompactionThroughputMbPerSecParamsWithTimeout(timeout time.Duration) *FindConfigCompactionThroughputMbPerSecParams { + + return &FindConfigCompactionThroughputMbPerSecParams{ + + timeout: timeout, + } +} + +// NewFindConfigCompactionThroughputMbPerSecParamsWithContext creates a new FindConfigCompactionThroughputMbPerSecParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCompactionThroughputMbPerSecParamsWithContext(ctx context.Context) *FindConfigCompactionThroughputMbPerSecParams { + + return &FindConfigCompactionThroughputMbPerSecParams{ + + Context: ctx, + } +} + +// NewFindConfigCompactionThroughputMbPerSecParamsWithHTTPClient creates a new FindConfigCompactionThroughputMbPerSecParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCompactionThroughputMbPerSecParamsWithHTTPClient(client *http.Client) *FindConfigCompactionThroughputMbPerSecParams { + + return &FindConfigCompactionThroughputMbPerSecParams{ + HTTPClient: client, + } +} + +/* +FindConfigCompactionThroughputMbPerSecParams contains all the parameters to send to the API endpoint +for the find config compaction throughput mb per sec operation typically these are written to a http.Request +*/ +type FindConfigCompactionThroughputMbPerSecParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config compaction throughput mb per sec params +func (o *FindConfigCompactionThroughputMbPerSecParams) WithTimeout(timeout time.Duration) *FindConfigCompactionThroughputMbPerSecParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config compaction throughput mb per sec params +func (o *FindConfigCompactionThroughputMbPerSecParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config compaction throughput mb per sec params +func (o *FindConfigCompactionThroughputMbPerSecParams) WithContext(ctx context.Context) *FindConfigCompactionThroughputMbPerSecParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config compaction throughput mb per sec params +func (o *FindConfigCompactionThroughputMbPerSecParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config compaction throughput mb per sec params +func (o *FindConfigCompactionThroughputMbPerSecParams) WithHTTPClient(client *http.Client) *FindConfigCompactionThroughputMbPerSecParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config compaction throughput mb per sec params +func (o *FindConfigCompactionThroughputMbPerSecParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCompactionThroughputMbPerSecParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_throughput_mb_per_sec_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_throughput_mb_per_sec_responses.go new file mode 100644 index 0000000000..530018abfb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_compaction_throughput_mb_per_sec_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCompactionThroughputMbPerSecReader is a Reader for the FindConfigCompactionThroughputMbPerSec structure. +type FindConfigCompactionThroughputMbPerSecReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCompactionThroughputMbPerSecReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCompactionThroughputMbPerSecOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCompactionThroughputMbPerSecDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCompactionThroughputMbPerSecOK creates a FindConfigCompactionThroughputMbPerSecOK with default headers values +func NewFindConfigCompactionThroughputMbPerSecOK() *FindConfigCompactionThroughputMbPerSecOK { + return &FindConfigCompactionThroughputMbPerSecOK{} +} + +/* +FindConfigCompactionThroughputMbPerSecOK handles this case with default header values. + +Config value +*/ +type FindConfigCompactionThroughputMbPerSecOK struct { + Payload int64 +} + +func (o *FindConfigCompactionThroughputMbPerSecOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigCompactionThroughputMbPerSecOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCompactionThroughputMbPerSecDefault creates a FindConfigCompactionThroughputMbPerSecDefault with default headers values +func NewFindConfigCompactionThroughputMbPerSecDefault(code int) *FindConfigCompactionThroughputMbPerSecDefault { + return &FindConfigCompactionThroughputMbPerSecDefault{ + _statusCode: code, + } +} + +/* +FindConfigCompactionThroughputMbPerSecDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCompactionThroughputMbPerSecDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config compaction throughput mb per sec default response +func (o *FindConfigCompactionThroughputMbPerSecDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCompactionThroughputMbPerSecDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCompactionThroughputMbPerSecDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCompactionThroughputMbPerSecDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_compactors_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_compactors_parameters.go new file mode 100644 index 0000000000..69eca25dee --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_compactors_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigConcurrentCompactorsParams creates a new FindConfigConcurrentCompactorsParams object +// with the default values initialized. +func NewFindConfigConcurrentCompactorsParams() *FindConfigConcurrentCompactorsParams { + + return &FindConfigConcurrentCompactorsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigConcurrentCompactorsParamsWithTimeout creates a new FindConfigConcurrentCompactorsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigConcurrentCompactorsParamsWithTimeout(timeout time.Duration) *FindConfigConcurrentCompactorsParams { + + return &FindConfigConcurrentCompactorsParams{ + + timeout: timeout, + } +} + +// NewFindConfigConcurrentCompactorsParamsWithContext creates a new FindConfigConcurrentCompactorsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigConcurrentCompactorsParamsWithContext(ctx context.Context) *FindConfigConcurrentCompactorsParams { + + return &FindConfigConcurrentCompactorsParams{ + + Context: ctx, + } +} + +// NewFindConfigConcurrentCompactorsParamsWithHTTPClient creates a new FindConfigConcurrentCompactorsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigConcurrentCompactorsParamsWithHTTPClient(client *http.Client) *FindConfigConcurrentCompactorsParams { + + return &FindConfigConcurrentCompactorsParams{ + HTTPClient: client, + } +} + +/* +FindConfigConcurrentCompactorsParams contains all the parameters to send to the API endpoint +for the find config concurrent compactors operation typically these are written to a http.Request +*/ +type FindConfigConcurrentCompactorsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config concurrent compactors params +func (o *FindConfigConcurrentCompactorsParams) WithTimeout(timeout time.Duration) *FindConfigConcurrentCompactorsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config concurrent compactors params +func (o *FindConfigConcurrentCompactorsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config concurrent compactors params +func (o *FindConfigConcurrentCompactorsParams) WithContext(ctx context.Context) *FindConfigConcurrentCompactorsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config concurrent compactors params +func (o *FindConfigConcurrentCompactorsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config concurrent compactors params +func (o *FindConfigConcurrentCompactorsParams) WithHTTPClient(client *http.Client) *FindConfigConcurrentCompactorsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config concurrent compactors params +func (o *FindConfigConcurrentCompactorsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigConcurrentCompactorsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_compactors_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_compactors_responses.go new file mode 100644 index 0000000000..5d2bd20e8d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_compactors_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigConcurrentCompactorsReader is a Reader for the FindConfigConcurrentCompactors structure. +type FindConfigConcurrentCompactorsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigConcurrentCompactorsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigConcurrentCompactorsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigConcurrentCompactorsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigConcurrentCompactorsOK creates a FindConfigConcurrentCompactorsOK with default headers values +func NewFindConfigConcurrentCompactorsOK() *FindConfigConcurrentCompactorsOK { + return &FindConfigConcurrentCompactorsOK{} +} + +/* +FindConfigConcurrentCompactorsOK handles this case with default header values. + +Config value +*/ +type FindConfigConcurrentCompactorsOK struct { + Payload int64 +} + +func (o *FindConfigConcurrentCompactorsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigConcurrentCompactorsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigConcurrentCompactorsDefault creates a FindConfigConcurrentCompactorsDefault with default headers values +func NewFindConfigConcurrentCompactorsDefault(code int) *FindConfigConcurrentCompactorsDefault { + return &FindConfigConcurrentCompactorsDefault{ + _statusCode: code, + } +} + +/* +FindConfigConcurrentCompactorsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigConcurrentCompactorsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config concurrent compactors default response +func (o *FindConfigConcurrentCompactorsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigConcurrentCompactorsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigConcurrentCompactorsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigConcurrentCompactorsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_counter_writes_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_counter_writes_parameters.go new file mode 100644 index 0000000000..e841322bc9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_counter_writes_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigConcurrentCounterWritesParams creates a new FindConfigConcurrentCounterWritesParams object +// with the default values initialized. +func NewFindConfigConcurrentCounterWritesParams() *FindConfigConcurrentCounterWritesParams { + + return &FindConfigConcurrentCounterWritesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigConcurrentCounterWritesParamsWithTimeout creates a new FindConfigConcurrentCounterWritesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigConcurrentCounterWritesParamsWithTimeout(timeout time.Duration) *FindConfigConcurrentCounterWritesParams { + + return &FindConfigConcurrentCounterWritesParams{ + + timeout: timeout, + } +} + +// NewFindConfigConcurrentCounterWritesParamsWithContext creates a new FindConfigConcurrentCounterWritesParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigConcurrentCounterWritesParamsWithContext(ctx context.Context) *FindConfigConcurrentCounterWritesParams { + + return &FindConfigConcurrentCounterWritesParams{ + + Context: ctx, + } +} + +// NewFindConfigConcurrentCounterWritesParamsWithHTTPClient creates a new FindConfigConcurrentCounterWritesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigConcurrentCounterWritesParamsWithHTTPClient(client *http.Client) *FindConfigConcurrentCounterWritesParams { + + return &FindConfigConcurrentCounterWritesParams{ + HTTPClient: client, + } +} + +/* +FindConfigConcurrentCounterWritesParams contains all the parameters to send to the API endpoint +for the find config concurrent counter writes operation typically these are written to a http.Request +*/ +type FindConfigConcurrentCounterWritesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config concurrent counter writes params +func (o *FindConfigConcurrentCounterWritesParams) WithTimeout(timeout time.Duration) *FindConfigConcurrentCounterWritesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config concurrent counter writes params +func (o *FindConfigConcurrentCounterWritesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config concurrent counter writes params +func (o *FindConfigConcurrentCounterWritesParams) WithContext(ctx context.Context) *FindConfigConcurrentCounterWritesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config concurrent counter writes params +func (o *FindConfigConcurrentCounterWritesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config concurrent counter writes params +func (o *FindConfigConcurrentCounterWritesParams) WithHTTPClient(client *http.Client) *FindConfigConcurrentCounterWritesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config concurrent counter writes params +func (o *FindConfigConcurrentCounterWritesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigConcurrentCounterWritesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_counter_writes_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_counter_writes_responses.go new file mode 100644 index 0000000000..a48b78d9dd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_counter_writes_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigConcurrentCounterWritesReader is a Reader for the FindConfigConcurrentCounterWrites structure. +type FindConfigConcurrentCounterWritesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigConcurrentCounterWritesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigConcurrentCounterWritesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigConcurrentCounterWritesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigConcurrentCounterWritesOK creates a FindConfigConcurrentCounterWritesOK with default headers values +func NewFindConfigConcurrentCounterWritesOK() *FindConfigConcurrentCounterWritesOK { + return &FindConfigConcurrentCounterWritesOK{} +} + +/* +FindConfigConcurrentCounterWritesOK handles this case with default header values. + +Config value +*/ +type FindConfigConcurrentCounterWritesOK struct { + Payload int64 +} + +func (o *FindConfigConcurrentCounterWritesOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigConcurrentCounterWritesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigConcurrentCounterWritesDefault creates a FindConfigConcurrentCounterWritesDefault with default headers values +func NewFindConfigConcurrentCounterWritesDefault(code int) *FindConfigConcurrentCounterWritesDefault { + return &FindConfigConcurrentCounterWritesDefault{ + _statusCode: code, + } +} + +/* +FindConfigConcurrentCounterWritesDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigConcurrentCounterWritesDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config concurrent counter writes default response +func (o *FindConfigConcurrentCounterWritesDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigConcurrentCounterWritesDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigConcurrentCounterWritesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigConcurrentCounterWritesDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_reads_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_reads_parameters.go new file mode 100644 index 0000000000..e7506404b6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_reads_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigConcurrentReadsParams creates a new FindConfigConcurrentReadsParams object +// with the default values initialized. +func NewFindConfigConcurrentReadsParams() *FindConfigConcurrentReadsParams { + + return &FindConfigConcurrentReadsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigConcurrentReadsParamsWithTimeout creates a new FindConfigConcurrentReadsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigConcurrentReadsParamsWithTimeout(timeout time.Duration) *FindConfigConcurrentReadsParams { + + return &FindConfigConcurrentReadsParams{ + + timeout: timeout, + } +} + +// NewFindConfigConcurrentReadsParamsWithContext creates a new FindConfigConcurrentReadsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigConcurrentReadsParamsWithContext(ctx context.Context) *FindConfigConcurrentReadsParams { + + return &FindConfigConcurrentReadsParams{ + + Context: ctx, + } +} + +// NewFindConfigConcurrentReadsParamsWithHTTPClient creates a new FindConfigConcurrentReadsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigConcurrentReadsParamsWithHTTPClient(client *http.Client) *FindConfigConcurrentReadsParams { + + return &FindConfigConcurrentReadsParams{ + HTTPClient: client, + } +} + +/* +FindConfigConcurrentReadsParams contains all the parameters to send to the API endpoint +for the find config concurrent reads operation typically these are written to a http.Request +*/ +type FindConfigConcurrentReadsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config concurrent reads params +func (o *FindConfigConcurrentReadsParams) WithTimeout(timeout time.Duration) *FindConfigConcurrentReadsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config concurrent reads params +func (o *FindConfigConcurrentReadsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config concurrent reads params +func (o *FindConfigConcurrentReadsParams) WithContext(ctx context.Context) *FindConfigConcurrentReadsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config concurrent reads params +func (o *FindConfigConcurrentReadsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config concurrent reads params +func (o *FindConfigConcurrentReadsParams) WithHTTPClient(client *http.Client) *FindConfigConcurrentReadsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config concurrent reads params +func (o *FindConfigConcurrentReadsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigConcurrentReadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_reads_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_reads_responses.go new file mode 100644 index 0000000000..f8dae54cbb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_reads_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigConcurrentReadsReader is a Reader for the FindConfigConcurrentReads structure. +type FindConfigConcurrentReadsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigConcurrentReadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigConcurrentReadsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigConcurrentReadsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigConcurrentReadsOK creates a FindConfigConcurrentReadsOK with default headers values +func NewFindConfigConcurrentReadsOK() *FindConfigConcurrentReadsOK { + return &FindConfigConcurrentReadsOK{} +} + +/* +FindConfigConcurrentReadsOK handles this case with default header values. + +Config value +*/ +type FindConfigConcurrentReadsOK struct { + Payload int64 +} + +func (o *FindConfigConcurrentReadsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigConcurrentReadsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigConcurrentReadsDefault creates a FindConfigConcurrentReadsDefault with default headers values +func NewFindConfigConcurrentReadsDefault(code int) *FindConfigConcurrentReadsDefault { + return &FindConfigConcurrentReadsDefault{ + _statusCode: code, + } +} + +/* +FindConfigConcurrentReadsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigConcurrentReadsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config concurrent reads default response +func (o *FindConfigConcurrentReadsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigConcurrentReadsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigConcurrentReadsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigConcurrentReadsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_writes_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_writes_parameters.go new file mode 100644 index 0000000000..2e2208b467 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_writes_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigConcurrentWritesParams creates a new FindConfigConcurrentWritesParams object +// with the default values initialized. +func NewFindConfigConcurrentWritesParams() *FindConfigConcurrentWritesParams { + + return &FindConfigConcurrentWritesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigConcurrentWritesParamsWithTimeout creates a new FindConfigConcurrentWritesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigConcurrentWritesParamsWithTimeout(timeout time.Duration) *FindConfigConcurrentWritesParams { + + return &FindConfigConcurrentWritesParams{ + + timeout: timeout, + } +} + +// NewFindConfigConcurrentWritesParamsWithContext creates a new FindConfigConcurrentWritesParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigConcurrentWritesParamsWithContext(ctx context.Context) *FindConfigConcurrentWritesParams { + + return &FindConfigConcurrentWritesParams{ + + Context: ctx, + } +} + +// NewFindConfigConcurrentWritesParamsWithHTTPClient creates a new FindConfigConcurrentWritesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigConcurrentWritesParamsWithHTTPClient(client *http.Client) *FindConfigConcurrentWritesParams { + + return &FindConfigConcurrentWritesParams{ + HTTPClient: client, + } +} + +/* +FindConfigConcurrentWritesParams contains all the parameters to send to the API endpoint +for the find config concurrent writes operation typically these are written to a http.Request +*/ +type FindConfigConcurrentWritesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config concurrent writes params +func (o *FindConfigConcurrentWritesParams) WithTimeout(timeout time.Duration) *FindConfigConcurrentWritesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config concurrent writes params +func (o *FindConfigConcurrentWritesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config concurrent writes params +func (o *FindConfigConcurrentWritesParams) WithContext(ctx context.Context) *FindConfigConcurrentWritesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config concurrent writes params +func (o *FindConfigConcurrentWritesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config concurrent writes params +func (o *FindConfigConcurrentWritesParams) WithHTTPClient(client *http.Client) *FindConfigConcurrentWritesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config concurrent writes params +func (o *FindConfigConcurrentWritesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigConcurrentWritesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_writes_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_writes_responses.go new file mode 100644 index 0000000000..071fefb5ad --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_concurrent_writes_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigConcurrentWritesReader is a Reader for the FindConfigConcurrentWrites structure. +type FindConfigConcurrentWritesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigConcurrentWritesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigConcurrentWritesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigConcurrentWritesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigConcurrentWritesOK creates a FindConfigConcurrentWritesOK with default headers values +func NewFindConfigConcurrentWritesOK() *FindConfigConcurrentWritesOK { + return &FindConfigConcurrentWritesOK{} +} + +/* +FindConfigConcurrentWritesOK handles this case with default header values. + +Config value +*/ +type FindConfigConcurrentWritesOK struct { + Payload int64 +} + +func (o *FindConfigConcurrentWritesOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigConcurrentWritesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigConcurrentWritesDefault creates a FindConfigConcurrentWritesDefault with default headers values +func NewFindConfigConcurrentWritesDefault(code int) *FindConfigConcurrentWritesDefault { + return &FindConfigConcurrentWritesDefault{ + _statusCode: code, + } +} + +/* +FindConfigConcurrentWritesDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigConcurrentWritesDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config concurrent writes default response +func (o *FindConfigConcurrentWritesDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigConcurrentWritesDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigConcurrentWritesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigConcurrentWritesDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_consistent_cluster_management_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_consistent_cluster_management_parameters.go new file mode 100644 index 0000000000..692b79ba92 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_consistent_cluster_management_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigConsistentClusterManagementParams creates a new FindConfigConsistentClusterManagementParams object +// with the default values initialized. +func NewFindConfigConsistentClusterManagementParams() *FindConfigConsistentClusterManagementParams { + + return &FindConfigConsistentClusterManagementParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigConsistentClusterManagementParamsWithTimeout creates a new FindConfigConsistentClusterManagementParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigConsistentClusterManagementParamsWithTimeout(timeout time.Duration) *FindConfigConsistentClusterManagementParams { + + return &FindConfigConsistentClusterManagementParams{ + + timeout: timeout, + } +} + +// NewFindConfigConsistentClusterManagementParamsWithContext creates a new FindConfigConsistentClusterManagementParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigConsistentClusterManagementParamsWithContext(ctx context.Context) *FindConfigConsistentClusterManagementParams { + + return &FindConfigConsistentClusterManagementParams{ + + Context: ctx, + } +} + +// NewFindConfigConsistentClusterManagementParamsWithHTTPClient creates a new FindConfigConsistentClusterManagementParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigConsistentClusterManagementParamsWithHTTPClient(client *http.Client) *FindConfigConsistentClusterManagementParams { + + return &FindConfigConsistentClusterManagementParams{ + HTTPClient: client, + } +} + +/* +FindConfigConsistentClusterManagementParams contains all the parameters to send to the API endpoint +for the find config consistent cluster management operation typically these are written to a http.Request +*/ +type FindConfigConsistentClusterManagementParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config consistent cluster management params +func (o *FindConfigConsistentClusterManagementParams) WithTimeout(timeout time.Duration) *FindConfigConsistentClusterManagementParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config consistent cluster management params +func (o *FindConfigConsistentClusterManagementParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config consistent cluster management params +func (o *FindConfigConsistentClusterManagementParams) WithContext(ctx context.Context) *FindConfigConsistentClusterManagementParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config consistent cluster management params +func (o *FindConfigConsistentClusterManagementParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config consistent cluster management params +func (o *FindConfigConsistentClusterManagementParams) WithHTTPClient(client *http.Client) *FindConfigConsistentClusterManagementParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config consistent cluster management params +func (o *FindConfigConsistentClusterManagementParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigConsistentClusterManagementParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_consistent_cluster_management_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_consistent_cluster_management_responses.go new file mode 100644 index 0000000000..7cef53f909 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_consistent_cluster_management_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigConsistentClusterManagementReader is a Reader for the FindConfigConsistentClusterManagement structure. +type FindConfigConsistentClusterManagementReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigConsistentClusterManagementReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigConsistentClusterManagementOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigConsistentClusterManagementDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigConsistentClusterManagementOK creates a FindConfigConsistentClusterManagementOK with default headers values +func NewFindConfigConsistentClusterManagementOK() *FindConfigConsistentClusterManagementOK { + return &FindConfigConsistentClusterManagementOK{} +} + +/* +FindConfigConsistentClusterManagementOK handles this case with default header values. + +Config value +*/ +type FindConfigConsistentClusterManagementOK struct { + Payload bool +} + +func (o *FindConfigConsistentClusterManagementOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigConsistentClusterManagementOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigConsistentClusterManagementDefault creates a FindConfigConsistentClusterManagementDefault with default headers values +func NewFindConfigConsistentClusterManagementDefault(code int) *FindConfigConsistentClusterManagementDefault { + return &FindConfigConsistentClusterManagementDefault{ + _statusCode: code, + } +} + +/* +FindConfigConsistentClusterManagementDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigConsistentClusterManagementDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config consistent cluster management default response +func (o *FindConfigConsistentClusterManagementDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigConsistentClusterManagementDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigConsistentClusterManagementDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigConsistentClusterManagementDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_consistent_rangemovement_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_consistent_rangemovement_parameters.go new file mode 100644 index 0000000000..f8176d7dfb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_consistent_rangemovement_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigConsistentRangemovementParams creates a new FindConfigConsistentRangemovementParams object +// with the default values initialized. +func NewFindConfigConsistentRangemovementParams() *FindConfigConsistentRangemovementParams { + + return &FindConfigConsistentRangemovementParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigConsistentRangemovementParamsWithTimeout creates a new FindConfigConsistentRangemovementParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigConsistentRangemovementParamsWithTimeout(timeout time.Duration) *FindConfigConsistentRangemovementParams { + + return &FindConfigConsistentRangemovementParams{ + + timeout: timeout, + } +} + +// NewFindConfigConsistentRangemovementParamsWithContext creates a new FindConfigConsistentRangemovementParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigConsistentRangemovementParamsWithContext(ctx context.Context) *FindConfigConsistentRangemovementParams { + + return &FindConfigConsistentRangemovementParams{ + + Context: ctx, + } +} + +// NewFindConfigConsistentRangemovementParamsWithHTTPClient creates a new FindConfigConsistentRangemovementParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigConsistentRangemovementParamsWithHTTPClient(client *http.Client) *FindConfigConsistentRangemovementParams { + + return &FindConfigConsistentRangemovementParams{ + HTTPClient: client, + } +} + +/* +FindConfigConsistentRangemovementParams contains all the parameters to send to the API endpoint +for the find config consistent rangemovement operation typically these are written to a http.Request +*/ +type FindConfigConsistentRangemovementParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config consistent rangemovement params +func (o *FindConfigConsistentRangemovementParams) WithTimeout(timeout time.Duration) *FindConfigConsistentRangemovementParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config consistent rangemovement params +func (o *FindConfigConsistentRangemovementParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config consistent rangemovement params +func (o *FindConfigConsistentRangemovementParams) WithContext(ctx context.Context) *FindConfigConsistentRangemovementParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config consistent rangemovement params +func (o *FindConfigConsistentRangemovementParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config consistent rangemovement params +func (o *FindConfigConsistentRangemovementParams) WithHTTPClient(client *http.Client) *FindConfigConsistentRangemovementParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config consistent rangemovement params +func (o *FindConfigConsistentRangemovementParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigConsistentRangemovementParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_consistent_rangemovement_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_consistent_rangemovement_responses.go new file mode 100644 index 0000000000..ed97cd9569 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_consistent_rangemovement_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigConsistentRangemovementReader is a Reader for the FindConfigConsistentRangemovement structure. +type FindConfigConsistentRangemovementReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigConsistentRangemovementReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigConsistentRangemovementOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigConsistentRangemovementDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigConsistentRangemovementOK creates a FindConfigConsistentRangemovementOK with default headers values +func NewFindConfigConsistentRangemovementOK() *FindConfigConsistentRangemovementOK { + return &FindConfigConsistentRangemovementOK{} +} + +/* +FindConfigConsistentRangemovementOK handles this case with default header values. + +Config value +*/ +type FindConfigConsistentRangemovementOK struct { + Payload bool +} + +func (o *FindConfigConsistentRangemovementOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigConsistentRangemovementOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigConsistentRangemovementDefault creates a FindConfigConsistentRangemovementDefault with default headers values +func NewFindConfigConsistentRangemovementDefault(code int) *FindConfigConsistentRangemovementDefault { + return &FindConfigConsistentRangemovementDefault{ + _statusCode: code, + } +} + +/* +FindConfigConsistentRangemovementDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigConsistentRangemovementDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config consistent rangemovement default response +func (o *FindConfigConsistentRangemovementDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigConsistentRangemovementDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigConsistentRangemovementDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigConsistentRangemovementDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_keys_to_save_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_keys_to_save_parameters.go new file mode 100644 index 0000000000..3c76ed753c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_keys_to_save_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCounterCacheKeysToSaveParams creates a new FindConfigCounterCacheKeysToSaveParams object +// with the default values initialized. +func NewFindConfigCounterCacheKeysToSaveParams() *FindConfigCounterCacheKeysToSaveParams { + + return &FindConfigCounterCacheKeysToSaveParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCounterCacheKeysToSaveParamsWithTimeout creates a new FindConfigCounterCacheKeysToSaveParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCounterCacheKeysToSaveParamsWithTimeout(timeout time.Duration) *FindConfigCounterCacheKeysToSaveParams { + + return &FindConfigCounterCacheKeysToSaveParams{ + + timeout: timeout, + } +} + +// NewFindConfigCounterCacheKeysToSaveParamsWithContext creates a new FindConfigCounterCacheKeysToSaveParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCounterCacheKeysToSaveParamsWithContext(ctx context.Context) *FindConfigCounterCacheKeysToSaveParams { + + return &FindConfigCounterCacheKeysToSaveParams{ + + Context: ctx, + } +} + +// NewFindConfigCounterCacheKeysToSaveParamsWithHTTPClient creates a new FindConfigCounterCacheKeysToSaveParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCounterCacheKeysToSaveParamsWithHTTPClient(client *http.Client) *FindConfigCounterCacheKeysToSaveParams { + + return &FindConfigCounterCacheKeysToSaveParams{ + HTTPClient: client, + } +} + +/* +FindConfigCounterCacheKeysToSaveParams contains all the parameters to send to the API endpoint +for the find config counter cache keys to save operation typically these are written to a http.Request +*/ +type FindConfigCounterCacheKeysToSaveParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config counter cache keys to save params +func (o *FindConfigCounterCacheKeysToSaveParams) WithTimeout(timeout time.Duration) *FindConfigCounterCacheKeysToSaveParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config counter cache keys to save params +func (o *FindConfigCounterCacheKeysToSaveParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config counter cache keys to save params +func (o *FindConfigCounterCacheKeysToSaveParams) WithContext(ctx context.Context) *FindConfigCounterCacheKeysToSaveParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config counter cache keys to save params +func (o *FindConfigCounterCacheKeysToSaveParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config counter cache keys to save params +func (o *FindConfigCounterCacheKeysToSaveParams) WithHTTPClient(client *http.Client) *FindConfigCounterCacheKeysToSaveParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config counter cache keys to save params +func (o *FindConfigCounterCacheKeysToSaveParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCounterCacheKeysToSaveParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_keys_to_save_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_keys_to_save_responses.go new file mode 100644 index 0000000000..a1d1216679 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_keys_to_save_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCounterCacheKeysToSaveReader is a Reader for the FindConfigCounterCacheKeysToSave structure. +type FindConfigCounterCacheKeysToSaveReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCounterCacheKeysToSaveReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCounterCacheKeysToSaveOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCounterCacheKeysToSaveDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCounterCacheKeysToSaveOK creates a FindConfigCounterCacheKeysToSaveOK with default headers values +func NewFindConfigCounterCacheKeysToSaveOK() *FindConfigCounterCacheKeysToSaveOK { + return &FindConfigCounterCacheKeysToSaveOK{} +} + +/* +FindConfigCounterCacheKeysToSaveOK handles this case with default header values. + +Config value +*/ +type FindConfigCounterCacheKeysToSaveOK struct { + Payload int64 +} + +func (o *FindConfigCounterCacheKeysToSaveOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigCounterCacheKeysToSaveOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCounterCacheKeysToSaveDefault creates a FindConfigCounterCacheKeysToSaveDefault with default headers values +func NewFindConfigCounterCacheKeysToSaveDefault(code int) *FindConfigCounterCacheKeysToSaveDefault { + return &FindConfigCounterCacheKeysToSaveDefault{ + _statusCode: code, + } +} + +/* +FindConfigCounterCacheKeysToSaveDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCounterCacheKeysToSaveDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config counter cache keys to save default response +func (o *FindConfigCounterCacheKeysToSaveDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCounterCacheKeysToSaveDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCounterCacheKeysToSaveDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCounterCacheKeysToSaveDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_save_period_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_save_period_parameters.go new file mode 100644 index 0000000000..2b44949760 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_save_period_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCounterCacheSavePeriodParams creates a new FindConfigCounterCacheSavePeriodParams object +// with the default values initialized. +func NewFindConfigCounterCacheSavePeriodParams() *FindConfigCounterCacheSavePeriodParams { + + return &FindConfigCounterCacheSavePeriodParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCounterCacheSavePeriodParamsWithTimeout creates a new FindConfigCounterCacheSavePeriodParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCounterCacheSavePeriodParamsWithTimeout(timeout time.Duration) *FindConfigCounterCacheSavePeriodParams { + + return &FindConfigCounterCacheSavePeriodParams{ + + timeout: timeout, + } +} + +// NewFindConfigCounterCacheSavePeriodParamsWithContext creates a new FindConfigCounterCacheSavePeriodParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCounterCacheSavePeriodParamsWithContext(ctx context.Context) *FindConfigCounterCacheSavePeriodParams { + + return &FindConfigCounterCacheSavePeriodParams{ + + Context: ctx, + } +} + +// NewFindConfigCounterCacheSavePeriodParamsWithHTTPClient creates a new FindConfigCounterCacheSavePeriodParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCounterCacheSavePeriodParamsWithHTTPClient(client *http.Client) *FindConfigCounterCacheSavePeriodParams { + + return &FindConfigCounterCacheSavePeriodParams{ + HTTPClient: client, + } +} + +/* +FindConfigCounterCacheSavePeriodParams contains all the parameters to send to the API endpoint +for the find config counter cache save period operation typically these are written to a http.Request +*/ +type FindConfigCounterCacheSavePeriodParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config counter cache save period params +func (o *FindConfigCounterCacheSavePeriodParams) WithTimeout(timeout time.Duration) *FindConfigCounterCacheSavePeriodParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config counter cache save period params +func (o *FindConfigCounterCacheSavePeriodParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config counter cache save period params +func (o *FindConfigCounterCacheSavePeriodParams) WithContext(ctx context.Context) *FindConfigCounterCacheSavePeriodParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config counter cache save period params +func (o *FindConfigCounterCacheSavePeriodParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config counter cache save period params +func (o *FindConfigCounterCacheSavePeriodParams) WithHTTPClient(client *http.Client) *FindConfigCounterCacheSavePeriodParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config counter cache save period params +func (o *FindConfigCounterCacheSavePeriodParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCounterCacheSavePeriodParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_save_period_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_save_period_responses.go new file mode 100644 index 0000000000..966c7ed5e4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_save_period_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCounterCacheSavePeriodReader is a Reader for the FindConfigCounterCacheSavePeriod structure. +type FindConfigCounterCacheSavePeriodReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCounterCacheSavePeriodReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCounterCacheSavePeriodOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCounterCacheSavePeriodDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCounterCacheSavePeriodOK creates a FindConfigCounterCacheSavePeriodOK with default headers values +func NewFindConfigCounterCacheSavePeriodOK() *FindConfigCounterCacheSavePeriodOK { + return &FindConfigCounterCacheSavePeriodOK{} +} + +/* +FindConfigCounterCacheSavePeriodOK handles this case with default header values. + +Config value +*/ +type FindConfigCounterCacheSavePeriodOK struct { + Payload int64 +} + +func (o *FindConfigCounterCacheSavePeriodOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigCounterCacheSavePeriodOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCounterCacheSavePeriodDefault creates a FindConfigCounterCacheSavePeriodDefault with default headers values +func NewFindConfigCounterCacheSavePeriodDefault(code int) *FindConfigCounterCacheSavePeriodDefault { + return &FindConfigCounterCacheSavePeriodDefault{ + _statusCode: code, + } +} + +/* +FindConfigCounterCacheSavePeriodDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCounterCacheSavePeriodDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config counter cache save period default response +func (o *FindConfigCounterCacheSavePeriodDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCounterCacheSavePeriodDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCounterCacheSavePeriodDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCounterCacheSavePeriodDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_size_in_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_size_in_mb_parameters.go new file mode 100644 index 0000000000..d517c2897a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_size_in_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCounterCacheSizeInMbParams creates a new FindConfigCounterCacheSizeInMbParams object +// with the default values initialized. +func NewFindConfigCounterCacheSizeInMbParams() *FindConfigCounterCacheSizeInMbParams { + + return &FindConfigCounterCacheSizeInMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCounterCacheSizeInMbParamsWithTimeout creates a new FindConfigCounterCacheSizeInMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCounterCacheSizeInMbParamsWithTimeout(timeout time.Duration) *FindConfigCounterCacheSizeInMbParams { + + return &FindConfigCounterCacheSizeInMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigCounterCacheSizeInMbParamsWithContext creates a new FindConfigCounterCacheSizeInMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCounterCacheSizeInMbParamsWithContext(ctx context.Context) *FindConfigCounterCacheSizeInMbParams { + + return &FindConfigCounterCacheSizeInMbParams{ + + Context: ctx, + } +} + +// NewFindConfigCounterCacheSizeInMbParamsWithHTTPClient creates a new FindConfigCounterCacheSizeInMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCounterCacheSizeInMbParamsWithHTTPClient(client *http.Client) *FindConfigCounterCacheSizeInMbParams { + + return &FindConfigCounterCacheSizeInMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigCounterCacheSizeInMbParams contains all the parameters to send to the API endpoint +for the find config counter cache size in mb operation typically these are written to a http.Request +*/ +type FindConfigCounterCacheSizeInMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config counter cache size in mb params +func (o *FindConfigCounterCacheSizeInMbParams) WithTimeout(timeout time.Duration) *FindConfigCounterCacheSizeInMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config counter cache size in mb params +func (o *FindConfigCounterCacheSizeInMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config counter cache size in mb params +func (o *FindConfigCounterCacheSizeInMbParams) WithContext(ctx context.Context) *FindConfigCounterCacheSizeInMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config counter cache size in mb params +func (o *FindConfigCounterCacheSizeInMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config counter cache size in mb params +func (o *FindConfigCounterCacheSizeInMbParams) WithHTTPClient(client *http.Client) *FindConfigCounterCacheSizeInMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config counter cache size in mb params +func (o *FindConfigCounterCacheSizeInMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCounterCacheSizeInMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_size_in_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_size_in_mb_responses.go new file mode 100644 index 0000000000..996a74c80c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_cache_size_in_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCounterCacheSizeInMbReader is a Reader for the FindConfigCounterCacheSizeInMb structure. +type FindConfigCounterCacheSizeInMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCounterCacheSizeInMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCounterCacheSizeInMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCounterCacheSizeInMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCounterCacheSizeInMbOK creates a FindConfigCounterCacheSizeInMbOK with default headers values +func NewFindConfigCounterCacheSizeInMbOK() *FindConfigCounterCacheSizeInMbOK { + return &FindConfigCounterCacheSizeInMbOK{} +} + +/* +FindConfigCounterCacheSizeInMbOK handles this case with default header values. + +Config value +*/ +type FindConfigCounterCacheSizeInMbOK struct { + Payload int64 +} + +func (o *FindConfigCounterCacheSizeInMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigCounterCacheSizeInMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCounterCacheSizeInMbDefault creates a FindConfigCounterCacheSizeInMbDefault with default headers values +func NewFindConfigCounterCacheSizeInMbDefault(code int) *FindConfigCounterCacheSizeInMbDefault { + return &FindConfigCounterCacheSizeInMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigCounterCacheSizeInMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCounterCacheSizeInMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config counter cache size in mb default response +func (o *FindConfigCounterCacheSizeInMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCounterCacheSizeInMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCounterCacheSizeInMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCounterCacheSizeInMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_write_request_timeout_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_write_request_timeout_in_ms_parameters.go new file mode 100644 index 0000000000..aadc6cbab6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_write_request_timeout_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCounterWriteRequestTimeoutInMsParams creates a new FindConfigCounterWriteRequestTimeoutInMsParams object +// with the default values initialized. +func NewFindConfigCounterWriteRequestTimeoutInMsParams() *FindConfigCounterWriteRequestTimeoutInMsParams { + + return &FindConfigCounterWriteRequestTimeoutInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCounterWriteRequestTimeoutInMsParamsWithTimeout creates a new FindConfigCounterWriteRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCounterWriteRequestTimeoutInMsParamsWithTimeout(timeout time.Duration) *FindConfigCounterWriteRequestTimeoutInMsParams { + + return &FindConfigCounterWriteRequestTimeoutInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigCounterWriteRequestTimeoutInMsParamsWithContext creates a new FindConfigCounterWriteRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCounterWriteRequestTimeoutInMsParamsWithContext(ctx context.Context) *FindConfigCounterWriteRequestTimeoutInMsParams { + + return &FindConfigCounterWriteRequestTimeoutInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigCounterWriteRequestTimeoutInMsParamsWithHTTPClient creates a new FindConfigCounterWriteRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCounterWriteRequestTimeoutInMsParamsWithHTTPClient(client *http.Client) *FindConfigCounterWriteRequestTimeoutInMsParams { + + return &FindConfigCounterWriteRequestTimeoutInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigCounterWriteRequestTimeoutInMsParams contains all the parameters to send to the API endpoint +for the find config counter write request timeout in ms operation typically these are written to a http.Request +*/ +type FindConfigCounterWriteRequestTimeoutInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config counter write request timeout in ms params +func (o *FindConfigCounterWriteRequestTimeoutInMsParams) WithTimeout(timeout time.Duration) *FindConfigCounterWriteRequestTimeoutInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config counter write request timeout in ms params +func (o *FindConfigCounterWriteRequestTimeoutInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config counter write request timeout in ms params +func (o *FindConfigCounterWriteRequestTimeoutInMsParams) WithContext(ctx context.Context) *FindConfigCounterWriteRequestTimeoutInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config counter write request timeout in ms params +func (o *FindConfigCounterWriteRequestTimeoutInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config counter write request timeout in ms params +func (o *FindConfigCounterWriteRequestTimeoutInMsParams) WithHTTPClient(client *http.Client) *FindConfigCounterWriteRequestTimeoutInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config counter write request timeout in ms params +func (o *FindConfigCounterWriteRequestTimeoutInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCounterWriteRequestTimeoutInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_write_request_timeout_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_write_request_timeout_in_ms_responses.go new file mode 100644 index 0000000000..3d2a81eedd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_counter_write_request_timeout_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCounterWriteRequestTimeoutInMsReader is a Reader for the FindConfigCounterWriteRequestTimeoutInMs structure. +type FindConfigCounterWriteRequestTimeoutInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCounterWriteRequestTimeoutInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCounterWriteRequestTimeoutInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCounterWriteRequestTimeoutInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCounterWriteRequestTimeoutInMsOK creates a FindConfigCounterWriteRequestTimeoutInMsOK with default headers values +func NewFindConfigCounterWriteRequestTimeoutInMsOK() *FindConfigCounterWriteRequestTimeoutInMsOK { + return &FindConfigCounterWriteRequestTimeoutInMsOK{} +} + +/* +FindConfigCounterWriteRequestTimeoutInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigCounterWriteRequestTimeoutInMsOK struct { + Payload int64 +} + +func (o *FindConfigCounterWriteRequestTimeoutInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigCounterWriteRequestTimeoutInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCounterWriteRequestTimeoutInMsDefault creates a FindConfigCounterWriteRequestTimeoutInMsDefault with default headers values +func NewFindConfigCounterWriteRequestTimeoutInMsDefault(code int) *FindConfigCounterWriteRequestTimeoutInMsDefault { + return &FindConfigCounterWriteRequestTimeoutInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigCounterWriteRequestTimeoutInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCounterWriteRequestTimeoutInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config counter write request timeout in ms default response +func (o *FindConfigCounterWriteRequestTimeoutInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCounterWriteRequestTimeoutInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCounterWriteRequestTimeoutInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCounterWriteRequestTimeoutInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cpu_scheduler_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cpu_scheduler_parameters.go new file mode 100644 index 0000000000..4f648d9465 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cpu_scheduler_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCPUSchedulerParams creates a new FindConfigCPUSchedulerParams object +// with the default values initialized. +func NewFindConfigCPUSchedulerParams() *FindConfigCPUSchedulerParams { + + return &FindConfigCPUSchedulerParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCPUSchedulerParamsWithTimeout creates a new FindConfigCPUSchedulerParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCPUSchedulerParamsWithTimeout(timeout time.Duration) *FindConfigCPUSchedulerParams { + + return &FindConfigCPUSchedulerParams{ + + timeout: timeout, + } +} + +// NewFindConfigCPUSchedulerParamsWithContext creates a new FindConfigCPUSchedulerParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCPUSchedulerParamsWithContext(ctx context.Context) *FindConfigCPUSchedulerParams { + + return &FindConfigCPUSchedulerParams{ + + Context: ctx, + } +} + +// NewFindConfigCPUSchedulerParamsWithHTTPClient creates a new FindConfigCPUSchedulerParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCPUSchedulerParamsWithHTTPClient(client *http.Client) *FindConfigCPUSchedulerParams { + + return &FindConfigCPUSchedulerParams{ + HTTPClient: client, + } +} + +/* +FindConfigCPUSchedulerParams contains all the parameters to send to the API endpoint +for the find config cpu scheduler operation typically these are written to a http.Request +*/ +type FindConfigCPUSchedulerParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config cpu scheduler params +func (o *FindConfigCPUSchedulerParams) WithTimeout(timeout time.Duration) *FindConfigCPUSchedulerParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config cpu scheduler params +func (o *FindConfigCPUSchedulerParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config cpu scheduler params +func (o *FindConfigCPUSchedulerParams) WithContext(ctx context.Context) *FindConfigCPUSchedulerParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config cpu scheduler params +func (o *FindConfigCPUSchedulerParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config cpu scheduler params +func (o *FindConfigCPUSchedulerParams) WithHTTPClient(client *http.Client) *FindConfigCPUSchedulerParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config cpu scheduler params +func (o *FindConfigCPUSchedulerParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCPUSchedulerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cpu_scheduler_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cpu_scheduler_responses.go new file mode 100644 index 0000000000..cf8771d6dd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cpu_scheduler_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCPUSchedulerReader is a Reader for the FindConfigCPUScheduler structure. +type FindConfigCPUSchedulerReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCPUSchedulerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCPUSchedulerOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCPUSchedulerDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCPUSchedulerOK creates a FindConfigCPUSchedulerOK with default headers values +func NewFindConfigCPUSchedulerOK() *FindConfigCPUSchedulerOK { + return &FindConfigCPUSchedulerOK{} +} + +/* +FindConfigCPUSchedulerOK handles this case with default header values. + +Config value +*/ +type FindConfigCPUSchedulerOK struct { + Payload bool +} + +func (o *FindConfigCPUSchedulerOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigCPUSchedulerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCPUSchedulerDefault creates a FindConfigCPUSchedulerDefault with default headers values +func NewFindConfigCPUSchedulerDefault(code int) *FindConfigCPUSchedulerDefault { + return &FindConfigCPUSchedulerDefault{ + _statusCode: code, + } +} + +/* +FindConfigCPUSchedulerDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCPUSchedulerDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config cpu scheduler default response +func (o *FindConfigCPUSchedulerDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCPUSchedulerDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCPUSchedulerDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCPUSchedulerDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cross_node_timeout_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cross_node_timeout_parameters.go new file mode 100644 index 0000000000..dd3122b38e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cross_node_timeout_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigCrossNodeTimeoutParams creates a new FindConfigCrossNodeTimeoutParams object +// with the default values initialized. +func NewFindConfigCrossNodeTimeoutParams() *FindConfigCrossNodeTimeoutParams { + + return &FindConfigCrossNodeTimeoutParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigCrossNodeTimeoutParamsWithTimeout creates a new FindConfigCrossNodeTimeoutParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigCrossNodeTimeoutParamsWithTimeout(timeout time.Duration) *FindConfigCrossNodeTimeoutParams { + + return &FindConfigCrossNodeTimeoutParams{ + + timeout: timeout, + } +} + +// NewFindConfigCrossNodeTimeoutParamsWithContext creates a new FindConfigCrossNodeTimeoutParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigCrossNodeTimeoutParamsWithContext(ctx context.Context) *FindConfigCrossNodeTimeoutParams { + + return &FindConfigCrossNodeTimeoutParams{ + + Context: ctx, + } +} + +// NewFindConfigCrossNodeTimeoutParamsWithHTTPClient creates a new FindConfigCrossNodeTimeoutParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigCrossNodeTimeoutParamsWithHTTPClient(client *http.Client) *FindConfigCrossNodeTimeoutParams { + + return &FindConfigCrossNodeTimeoutParams{ + HTTPClient: client, + } +} + +/* +FindConfigCrossNodeTimeoutParams contains all the parameters to send to the API endpoint +for the find config cross node timeout operation typically these are written to a http.Request +*/ +type FindConfigCrossNodeTimeoutParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config cross node timeout params +func (o *FindConfigCrossNodeTimeoutParams) WithTimeout(timeout time.Duration) *FindConfigCrossNodeTimeoutParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config cross node timeout params +func (o *FindConfigCrossNodeTimeoutParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config cross node timeout params +func (o *FindConfigCrossNodeTimeoutParams) WithContext(ctx context.Context) *FindConfigCrossNodeTimeoutParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config cross node timeout params +func (o *FindConfigCrossNodeTimeoutParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config cross node timeout params +func (o *FindConfigCrossNodeTimeoutParams) WithHTTPClient(client *http.Client) *FindConfigCrossNodeTimeoutParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config cross node timeout params +func (o *FindConfigCrossNodeTimeoutParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigCrossNodeTimeoutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cross_node_timeout_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cross_node_timeout_responses.go new file mode 100644 index 0000000000..67a97bc92c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_cross_node_timeout_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigCrossNodeTimeoutReader is a Reader for the FindConfigCrossNodeTimeout structure. +type FindConfigCrossNodeTimeoutReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigCrossNodeTimeoutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigCrossNodeTimeoutOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigCrossNodeTimeoutDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigCrossNodeTimeoutOK creates a FindConfigCrossNodeTimeoutOK with default headers values +func NewFindConfigCrossNodeTimeoutOK() *FindConfigCrossNodeTimeoutOK { + return &FindConfigCrossNodeTimeoutOK{} +} + +/* +FindConfigCrossNodeTimeoutOK handles this case with default header values. + +Config value +*/ +type FindConfigCrossNodeTimeoutOK struct { + Payload bool +} + +func (o *FindConfigCrossNodeTimeoutOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigCrossNodeTimeoutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigCrossNodeTimeoutDefault creates a FindConfigCrossNodeTimeoutDefault with default headers values +func NewFindConfigCrossNodeTimeoutDefault(code int) *FindConfigCrossNodeTimeoutDefault { + return &FindConfigCrossNodeTimeoutDefault{ + _statusCode: code, + } +} + +/* +FindConfigCrossNodeTimeoutDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigCrossNodeTimeoutDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config cross node timeout default response +func (o *FindConfigCrossNodeTimeoutDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigCrossNodeTimeoutDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigCrossNodeTimeoutDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigCrossNodeTimeoutDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_data_file_directories_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_data_file_directories_parameters.go new file mode 100644 index 0000000000..a5121c8cb0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_data_file_directories_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigDataFileDirectoriesParams creates a new FindConfigDataFileDirectoriesParams object +// with the default values initialized. +func NewFindConfigDataFileDirectoriesParams() *FindConfigDataFileDirectoriesParams { + + return &FindConfigDataFileDirectoriesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigDataFileDirectoriesParamsWithTimeout creates a new FindConfigDataFileDirectoriesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigDataFileDirectoriesParamsWithTimeout(timeout time.Duration) *FindConfigDataFileDirectoriesParams { + + return &FindConfigDataFileDirectoriesParams{ + + timeout: timeout, + } +} + +// NewFindConfigDataFileDirectoriesParamsWithContext creates a new FindConfigDataFileDirectoriesParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigDataFileDirectoriesParamsWithContext(ctx context.Context) *FindConfigDataFileDirectoriesParams { + + return &FindConfigDataFileDirectoriesParams{ + + Context: ctx, + } +} + +// NewFindConfigDataFileDirectoriesParamsWithHTTPClient creates a new FindConfigDataFileDirectoriesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigDataFileDirectoriesParamsWithHTTPClient(client *http.Client) *FindConfigDataFileDirectoriesParams { + + return &FindConfigDataFileDirectoriesParams{ + HTTPClient: client, + } +} + +/* +FindConfigDataFileDirectoriesParams contains all the parameters to send to the API endpoint +for the find config data file directories operation typically these are written to a http.Request +*/ +type FindConfigDataFileDirectoriesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config data file directories params +func (o *FindConfigDataFileDirectoriesParams) WithTimeout(timeout time.Duration) *FindConfigDataFileDirectoriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config data file directories params +func (o *FindConfigDataFileDirectoriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config data file directories params +func (o *FindConfigDataFileDirectoriesParams) WithContext(ctx context.Context) *FindConfigDataFileDirectoriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config data file directories params +func (o *FindConfigDataFileDirectoriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config data file directories params +func (o *FindConfigDataFileDirectoriesParams) WithHTTPClient(client *http.Client) *FindConfigDataFileDirectoriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config data file directories params +func (o *FindConfigDataFileDirectoriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigDataFileDirectoriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_data_file_directories_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_data_file_directories_responses.go new file mode 100644 index 0000000000..12797a1e40 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_data_file_directories_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigDataFileDirectoriesReader is a Reader for the FindConfigDataFileDirectories structure. +type FindConfigDataFileDirectoriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigDataFileDirectoriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigDataFileDirectoriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigDataFileDirectoriesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigDataFileDirectoriesOK creates a FindConfigDataFileDirectoriesOK with default headers values +func NewFindConfigDataFileDirectoriesOK() *FindConfigDataFileDirectoriesOK { + return &FindConfigDataFileDirectoriesOK{} +} + +/* +FindConfigDataFileDirectoriesOK handles this case with default header values. + +Config value +*/ +type FindConfigDataFileDirectoriesOK struct { + Payload []string +} + +func (o *FindConfigDataFileDirectoriesOK) GetPayload() []string { + return o.Payload +} + +func (o *FindConfigDataFileDirectoriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigDataFileDirectoriesDefault creates a FindConfigDataFileDirectoriesDefault with default headers values +func NewFindConfigDataFileDirectoriesDefault(code int) *FindConfigDataFileDirectoriesDefault { + return &FindConfigDataFileDirectoriesDefault{ + _statusCode: code, + } +} + +/* +FindConfigDataFileDirectoriesDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigDataFileDirectoriesDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config data file directories default response +func (o *FindConfigDataFileDirectoriesDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigDataFileDirectoriesDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigDataFileDirectoriesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigDataFileDirectoriesDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_default_log_level_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_default_log_level_parameters.go new file mode 100644 index 0000000000..8fba9fbe24 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_default_log_level_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigDefaultLogLevelParams creates a new FindConfigDefaultLogLevelParams object +// with the default values initialized. +func NewFindConfigDefaultLogLevelParams() *FindConfigDefaultLogLevelParams { + + return &FindConfigDefaultLogLevelParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigDefaultLogLevelParamsWithTimeout creates a new FindConfigDefaultLogLevelParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigDefaultLogLevelParamsWithTimeout(timeout time.Duration) *FindConfigDefaultLogLevelParams { + + return &FindConfigDefaultLogLevelParams{ + + timeout: timeout, + } +} + +// NewFindConfigDefaultLogLevelParamsWithContext creates a new FindConfigDefaultLogLevelParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigDefaultLogLevelParamsWithContext(ctx context.Context) *FindConfigDefaultLogLevelParams { + + return &FindConfigDefaultLogLevelParams{ + + Context: ctx, + } +} + +// NewFindConfigDefaultLogLevelParamsWithHTTPClient creates a new FindConfigDefaultLogLevelParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigDefaultLogLevelParamsWithHTTPClient(client *http.Client) *FindConfigDefaultLogLevelParams { + + return &FindConfigDefaultLogLevelParams{ + HTTPClient: client, + } +} + +/* +FindConfigDefaultLogLevelParams contains all the parameters to send to the API endpoint +for the find config default log level operation typically these are written to a http.Request +*/ +type FindConfigDefaultLogLevelParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config default log level params +func (o *FindConfigDefaultLogLevelParams) WithTimeout(timeout time.Duration) *FindConfigDefaultLogLevelParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config default log level params +func (o *FindConfigDefaultLogLevelParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config default log level params +func (o *FindConfigDefaultLogLevelParams) WithContext(ctx context.Context) *FindConfigDefaultLogLevelParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config default log level params +func (o *FindConfigDefaultLogLevelParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config default log level params +func (o *FindConfigDefaultLogLevelParams) WithHTTPClient(client *http.Client) *FindConfigDefaultLogLevelParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config default log level params +func (o *FindConfigDefaultLogLevelParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigDefaultLogLevelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_default_log_level_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_default_log_level_responses.go new file mode 100644 index 0000000000..3ab76b6e3e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_default_log_level_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigDefaultLogLevelReader is a Reader for the FindConfigDefaultLogLevel structure. +type FindConfigDefaultLogLevelReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigDefaultLogLevelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigDefaultLogLevelOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigDefaultLogLevelDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigDefaultLogLevelOK creates a FindConfigDefaultLogLevelOK with default headers values +func NewFindConfigDefaultLogLevelOK() *FindConfigDefaultLogLevelOK { + return &FindConfigDefaultLogLevelOK{} +} + +/* +FindConfigDefaultLogLevelOK handles this case with default header values. + +Config value +*/ +type FindConfigDefaultLogLevelOK struct { + Payload string +} + +func (o *FindConfigDefaultLogLevelOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigDefaultLogLevelOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigDefaultLogLevelDefault creates a FindConfigDefaultLogLevelDefault with default headers values +func NewFindConfigDefaultLogLevelDefault(code int) *FindConfigDefaultLogLevelDefault { + return &FindConfigDefaultLogLevelDefault{ + _statusCode: code, + } +} + +/* +FindConfigDefaultLogLevelDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigDefaultLogLevelDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config default log level default response +func (o *FindConfigDefaultLogLevelDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigDefaultLogLevelDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigDefaultLogLevelDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigDefaultLogLevelDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_defragment_memory_on_idle_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_defragment_memory_on_idle_parameters.go new file mode 100644 index 0000000000..31f1699805 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_defragment_memory_on_idle_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigDefragmentMemoryOnIdleParams creates a new FindConfigDefragmentMemoryOnIdleParams object +// with the default values initialized. +func NewFindConfigDefragmentMemoryOnIdleParams() *FindConfigDefragmentMemoryOnIdleParams { + + return &FindConfigDefragmentMemoryOnIdleParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigDefragmentMemoryOnIdleParamsWithTimeout creates a new FindConfigDefragmentMemoryOnIdleParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigDefragmentMemoryOnIdleParamsWithTimeout(timeout time.Duration) *FindConfigDefragmentMemoryOnIdleParams { + + return &FindConfigDefragmentMemoryOnIdleParams{ + + timeout: timeout, + } +} + +// NewFindConfigDefragmentMemoryOnIdleParamsWithContext creates a new FindConfigDefragmentMemoryOnIdleParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigDefragmentMemoryOnIdleParamsWithContext(ctx context.Context) *FindConfigDefragmentMemoryOnIdleParams { + + return &FindConfigDefragmentMemoryOnIdleParams{ + + Context: ctx, + } +} + +// NewFindConfigDefragmentMemoryOnIdleParamsWithHTTPClient creates a new FindConfigDefragmentMemoryOnIdleParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigDefragmentMemoryOnIdleParamsWithHTTPClient(client *http.Client) *FindConfigDefragmentMemoryOnIdleParams { + + return &FindConfigDefragmentMemoryOnIdleParams{ + HTTPClient: client, + } +} + +/* +FindConfigDefragmentMemoryOnIdleParams contains all the parameters to send to the API endpoint +for the find config defragment memory on idle operation typically these are written to a http.Request +*/ +type FindConfigDefragmentMemoryOnIdleParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config defragment memory on idle params +func (o *FindConfigDefragmentMemoryOnIdleParams) WithTimeout(timeout time.Duration) *FindConfigDefragmentMemoryOnIdleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config defragment memory on idle params +func (o *FindConfigDefragmentMemoryOnIdleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config defragment memory on idle params +func (o *FindConfigDefragmentMemoryOnIdleParams) WithContext(ctx context.Context) *FindConfigDefragmentMemoryOnIdleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config defragment memory on idle params +func (o *FindConfigDefragmentMemoryOnIdleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config defragment memory on idle params +func (o *FindConfigDefragmentMemoryOnIdleParams) WithHTTPClient(client *http.Client) *FindConfigDefragmentMemoryOnIdleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config defragment memory on idle params +func (o *FindConfigDefragmentMemoryOnIdleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigDefragmentMemoryOnIdleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_defragment_memory_on_idle_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_defragment_memory_on_idle_responses.go new file mode 100644 index 0000000000..cdced0be12 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_defragment_memory_on_idle_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigDefragmentMemoryOnIdleReader is a Reader for the FindConfigDefragmentMemoryOnIdle structure. +type FindConfigDefragmentMemoryOnIdleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigDefragmentMemoryOnIdleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigDefragmentMemoryOnIdleOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigDefragmentMemoryOnIdleDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigDefragmentMemoryOnIdleOK creates a FindConfigDefragmentMemoryOnIdleOK with default headers values +func NewFindConfigDefragmentMemoryOnIdleOK() *FindConfigDefragmentMemoryOnIdleOK { + return &FindConfigDefragmentMemoryOnIdleOK{} +} + +/* +FindConfigDefragmentMemoryOnIdleOK handles this case with default header values. + +Config value +*/ +type FindConfigDefragmentMemoryOnIdleOK struct { + Payload bool +} + +func (o *FindConfigDefragmentMemoryOnIdleOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigDefragmentMemoryOnIdleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigDefragmentMemoryOnIdleDefault creates a FindConfigDefragmentMemoryOnIdleDefault with default headers values +func NewFindConfigDefragmentMemoryOnIdleDefault(code int) *FindConfigDefragmentMemoryOnIdleDefault { + return &FindConfigDefragmentMemoryOnIdleDefault{ + _statusCode: code, + } +} + +/* +FindConfigDefragmentMemoryOnIdleDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigDefragmentMemoryOnIdleDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config defragment memory on idle default response +func (o *FindConfigDefragmentMemoryOnIdleDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigDefragmentMemoryOnIdleDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigDefragmentMemoryOnIdleDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigDefragmentMemoryOnIdleDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_developer_mode_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_developer_mode_parameters.go new file mode 100644 index 0000000000..2df5b6607b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_developer_mode_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigDeveloperModeParams creates a new FindConfigDeveloperModeParams object +// with the default values initialized. +func NewFindConfigDeveloperModeParams() *FindConfigDeveloperModeParams { + + return &FindConfigDeveloperModeParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigDeveloperModeParamsWithTimeout creates a new FindConfigDeveloperModeParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigDeveloperModeParamsWithTimeout(timeout time.Duration) *FindConfigDeveloperModeParams { + + return &FindConfigDeveloperModeParams{ + + timeout: timeout, + } +} + +// NewFindConfigDeveloperModeParamsWithContext creates a new FindConfigDeveloperModeParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigDeveloperModeParamsWithContext(ctx context.Context) *FindConfigDeveloperModeParams { + + return &FindConfigDeveloperModeParams{ + + Context: ctx, + } +} + +// NewFindConfigDeveloperModeParamsWithHTTPClient creates a new FindConfigDeveloperModeParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigDeveloperModeParamsWithHTTPClient(client *http.Client) *FindConfigDeveloperModeParams { + + return &FindConfigDeveloperModeParams{ + HTTPClient: client, + } +} + +/* +FindConfigDeveloperModeParams contains all the parameters to send to the API endpoint +for the find config developer mode operation typically these are written to a http.Request +*/ +type FindConfigDeveloperModeParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config developer mode params +func (o *FindConfigDeveloperModeParams) WithTimeout(timeout time.Duration) *FindConfigDeveloperModeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config developer mode params +func (o *FindConfigDeveloperModeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config developer mode params +func (o *FindConfigDeveloperModeParams) WithContext(ctx context.Context) *FindConfigDeveloperModeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config developer mode params +func (o *FindConfigDeveloperModeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config developer mode params +func (o *FindConfigDeveloperModeParams) WithHTTPClient(client *http.Client) *FindConfigDeveloperModeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config developer mode params +func (o *FindConfigDeveloperModeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigDeveloperModeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_developer_mode_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_developer_mode_responses.go new file mode 100644 index 0000000000..dead89bffe --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_developer_mode_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigDeveloperModeReader is a Reader for the FindConfigDeveloperMode structure. +type FindConfigDeveloperModeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigDeveloperModeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigDeveloperModeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigDeveloperModeDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigDeveloperModeOK creates a FindConfigDeveloperModeOK with default headers values +func NewFindConfigDeveloperModeOK() *FindConfigDeveloperModeOK { + return &FindConfigDeveloperModeOK{} +} + +/* +FindConfigDeveloperModeOK handles this case with default header values. + +Config value +*/ +type FindConfigDeveloperModeOK struct { + Payload bool +} + +func (o *FindConfigDeveloperModeOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigDeveloperModeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigDeveloperModeDefault creates a FindConfigDeveloperModeDefault with default headers values +func NewFindConfigDeveloperModeDefault(code int) *FindConfigDeveloperModeDefault { + return &FindConfigDeveloperModeDefault{ + _statusCode: code, + } +} + +/* +FindConfigDeveloperModeDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigDeveloperModeDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config developer mode default response +func (o *FindConfigDeveloperModeDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigDeveloperModeDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigDeveloperModeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigDeveloperModeDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_disk_failure_policy_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_disk_failure_policy_parameters.go new file mode 100644 index 0000000000..f93d17aca3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_disk_failure_policy_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigDiskFailurePolicyParams creates a new FindConfigDiskFailurePolicyParams object +// with the default values initialized. +func NewFindConfigDiskFailurePolicyParams() *FindConfigDiskFailurePolicyParams { + + return &FindConfigDiskFailurePolicyParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigDiskFailurePolicyParamsWithTimeout creates a new FindConfigDiskFailurePolicyParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigDiskFailurePolicyParamsWithTimeout(timeout time.Duration) *FindConfigDiskFailurePolicyParams { + + return &FindConfigDiskFailurePolicyParams{ + + timeout: timeout, + } +} + +// NewFindConfigDiskFailurePolicyParamsWithContext creates a new FindConfigDiskFailurePolicyParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigDiskFailurePolicyParamsWithContext(ctx context.Context) *FindConfigDiskFailurePolicyParams { + + return &FindConfigDiskFailurePolicyParams{ + + Context: ctx, + } +} + +// NewFindConfigDiskFailurePolicyParamsWithHTTPClient creates a new FindConfigDiskFailurePolicyParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigDiskFailurePolicyParamsWithHTTPClient(client *http.Client) *FindConfigDiskFailurePolicyParams { + + return &FindConfigDiskFailurePolicyParams{ + HTTPClient: client, + } +} + +/* +FindConfigDiskFailurePolicyParams contains all the parameters to send to the API endpoint +for the find config disk failure policy operation typically these are written to a http.Request +*/ +type FindConfigDiskFailurePolicyParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config disk failure policy params +func (o *FindConfigDiskFailurePolicyParams) WithTimeout(timeout time.Duration) *FindConfigDiskFailurePolicyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config disk failure policy params +func (o *FindConfigDiskFailurePolicyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config disk failure policy params +func (o *FindConfigDiskFailurePolicyParams) WithContext(ctx context.Context) *FindConfigDiskFailurePolicyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config disk failure policy params +func (o *FindConfigDiskFailurePolicyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config disk failure policy params +func (o *FindConfigDiskFailurePolicyParams) WithHTTPClient(client *http.Client) *FindConfigDiskFailurePolicyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config disk failure policy params +func (o *FindConfigDiskFailurePolicyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigDiskFailurePolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_disk_failure_policy_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_disk_failure_policy_responses.go new file mode 100644 index 0000000000..e236b39f7b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_disk_failure_policy_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigDiskFailurePolicyReader is a Reader for the FindConfigDiskFailurePolicy structure. +type FindConfigDiskFailurePolicyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigDiskFailurePolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigDiskFailurePolicyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigDiskFailurePolicyDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigDiskFailurePolicyOK creates a FindConfigDiskFailurePolicyOK with default headers values +func NewFindConfigDiskFailurePolicyOK() *FindConfigDiskFailurePolicyOK { + return &FindConfigDiskFailurePolicyOK{} +} + +/* +FindConfigDiskFailurePolicyOK handles this case with default header values. + +Config value +*/ +type FindConfigDiskFailurePolicyOK struct { + Payload string +} + +func (o *FindConfigDiskFailurePolicyOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigDiskFailurePolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigDiskFailurePolicyDefault creates a FindConfigDiskFailurePolicyDefault with default headers values +func NewFindConfigDiskFailurePolicyDefault(code int) *FindConfigDiskFailurePolicyDefault { + return &FindConfigDiskFailurePolicyDefault{ + _statusCode: code, + } +} + +/* +FindConfigDiskFailurePolicyDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigDiskFailurePolicyDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config disk failure policy default response +func (o *FindConfigDiskFailurePolicyDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigDiskFailurePolicyDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigDiskFailurePolicyDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigDiskFailurePolicyDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_badness_threshold_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_badness_threshold_parameters.go new file mode 100644 index 0000000000..0808ac8beb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_badness_threshold_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigDynamicSnitchBadnessThresholdParams creates a new FindConfigDynamicSnitchBadnessThresholdParams object +// with the default values initialized. +func NewFindConfigDynamicSnitchBadnessThresholdParams() *FindConfigDynamicSnitchBadnessThresholdParams { + + return &FindConfigDynamicSnitchBadnessThresholdParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigDynamicSnitchBadnessThresholdParamsWithTimeout creates a new FindConfigDynamicSnitchBadnessThresholdParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigDynamicSnitchBadnessThresholdParamsWithTimeout(timeout time.Duration) *FindConfigDynamicSnitchBadnessThresholdParams { + + return &FindConfigDynamicSnitchBadnessThresholdParams{ + + timeout: timeout, + } +} + +// NewFindConfigDynamicSnitchBadnessThresholdParamsWithContext creates a new FindConfigDynamicSnitchBadnessThresholdParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigDynamicSnitchBadnessThresholdParamsWithContext(ctx context.Context) *FindConfigDynamicSnitchBadnessThresholdParams { + + return &FindConfigDynamicSnitchBadnessThresholdParams{ + + Context: ctx, + } +} + +// NewFindConfigDynamicSnitchBadnessThresholdParamsWithHTTPClient creates a new FindConfigDynamicSnitchBadnessThresholdParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigDynamicSnitchBadnessThresholdParamsWithHTTPClient(client *http.Client) *FindConfigDynamicSnitchBadnessThresholdParams { + + return &FindConfigDynamicSnitchBadnessThresholdParams{ + HTTPClient: client, + } +} + +/* +FindConfigDynamicSnitchBadnessThresholdParams contains all the parameters to send to the API endpoint +for the find config dynamic snitch badness threshold operation typically these are written to a http.Request +*/ +type FindConfigDynamicSnitchBadnessThresholdParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config dynamic snitch badness threshold params +func (o *FindConfigDynamicSnitchBadnessThresholdParams) WithTimeout(timeout time.Duration) *FindConfigDynamicSnitchBadnessThresholdParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config dynamic snitch badness threshold params +func (o *FindConfigDynamicSnitchBadnessThresholdParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config dynamic snitch badness threshold params +func (o *FindConfigDynamicSnitchBadnessThresholdParams) WithContext(ctx context.Context) *FindConfigDynamicSnitchBadnessThresholdParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config dynamic snitch badness threshold params +func (o *FindConfigDynamicSnitchBadnessThresholdParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config dynamic snitch badness threshold params +func (o *FindConfigDynamicSnitchBadnessThresholdParams) WithHTTPClient(client *http.Client) *FindConfigDynamicSnitchBadnessThresholdParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config dynamic snitch badness threshold params +func (o *FindConfigDynamicSnitchBadnessThresholdParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigDynamicSnitchBadnessThresholdParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_badness_threshold_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_badness_threshold_responses.go new file mode 100644 index 0000000000..fab9795fee --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_badness_threshold_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigDynamicSnitchBadnessThresholdReader is a Reader for the FindConfigDynamicSnitchBadnessThreshold structure. +type FindConfigDynamicSnitchBadnessThresholdReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigDynamicSnitchBadnessThresholdReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigDynamicSnitchBadnessThresholdOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigDynamicSnitchBadnessThresholdDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigDynamicSnitchBadnessThresholdOK creates a FindConfigDynamicSnitchBadnessThresholdOK with default headers values +func NewFindConfigDynamicSnitchBadnessThresholdOK() *FindConfigDynamicSnitchBadnessThresholdOK { + return &FindConfigDynamicSnitchBadnessThresholdOK{} +} + +/* +FindConfigDynamicSnitchBadnessThresholdOK handles this case with default header values. + +Config value +*/ +type FindConfigDynamicSnitchBadnessThresholdOK struct { + Payload float64 +} + +func (o *FindConfigDynamicSnitchBadnessThresholdOK) GetPayload() float64 { + return o.Payload +} + +func (o *FindConfigDynamicSnitchBadnessThresholdOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigDynamicSnitchBadnessThresholdDefault creates a FindConfigDynamicSnitchBadnessThresholdDefault with default headers values +func NewFindConfigDynamicSnitchBadnessThresholdDefault(code int) *FindConfigDynamicSnitchBadnessThresholdDefault { + return &FindConfigDynamicSnitchBadnessThresholdDefault{ + _statusCode: code, + } +} + +/* +FindConfigDynamicSnitchBadnessThresholdDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigDynamicSnitchBadnessThresholdDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config dynamic snitch badness threshold default response +func (o *FindConfigDynamicSnitchBadnessThresholdDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigDynamicSnitchBadnessThresholdDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigDynamicSnitchBadnessThresholdDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigDynamicSnitchBadnessThresholdDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_reset_interval_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_reset_interval_in_ms_parameters.go new file mode 100644 index 0000000000..1da0fbba74 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_reset_interval_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigDynamicSnitchResetIntervalInMsParams creates a new FindConfigDynamicSnitchResetIntervalInMsParams object +// with the default values initialized. +func NewFindConfigDynamicSnitchResetIntervalInMsParams() *FindConfigDynamicSnitchResetIntervalInMsParams { + + return &FindConfigDynamicSnitchResetIntervalInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigDynamicSnitchResetIntervalInMsParamsWithTimeout creates a new FindConfigDynamicSnitchResetIntervalInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigDynamicSnitchResetIntervalInMsParamsWithTimeout(timeout time.Duration) *FindConfigDynamicSnitchResetIntervalInMsParams { + + return &FindConfigDynamicSnitchResetIntervalInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigDynamicSnitchResetIntervalInMsParamsWithContext creates a new FindConfigDynamicSnitchResetIntervalInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigDynamicSnitchResetIntervalInMsParamsWithContext(ctx context.Context) *FindConfigDynamicSnitchResetIntervalInMsParams { + + return &FindConfigDynamicSnitchResetIntervalInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigDynamicSnitchResetIntervalInMsParamsWithHTTPClient creates a new FindConfigDynamicSnitchResetIntervalInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigDynamicSnitchResetIntervalInMsParamsWithHTTPClient(client *http.Client) *FindConfigDynamicSnitchResetIntervalInMsParams { + + return &FindConfigDynamicSnitchResetIntervalInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigDynamicSnitchResetIntervalInMsParams contains all the parameters to send to the API endpoint +for the find config dynamic snitch reset interval in ms operation typically these are written to a http.Request +*/ +type FindConfigDynamicSnitchResetIntervalInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config dynamic snitch reset interval in ms params +func (o *FindConfigDynamicSnitchResetIntervalInMsParams) WithTimeout(timeout time.Duration) *FindConfigDynamicSnitchResetIntervalInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config dynamic snitch reset interval in ms params +func (o *FindConfigDynamicSnitchResetIntervalInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config dynamic snitch reset interval in ms params +func (o *FindConfigDynamicSnitchResetIntervalInMsParams) WithContext(ctx context.Context) *FindConfigDynamicSnitchResetIntervalInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config dynamic snitch reset interval in ms params +func (o *FindConfigDynamicSnitchResetIntervalInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config dynamic snitch reset interval in ms params +func (o *FindConfigDynamicSnitchResetIntervalInMsParams) WithHTTPClient(client *http.Client) *FindConfigDynamicSnitchResetIntervalInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config dynamic snitch reset interval in ms params +func (o *FindConfigDynamicSnitchResetIntervalInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigDynamicSnitchResetIntervalInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_reset_interval_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_reset_interval_in_ms_responses.go new file mode 100644 index 0000000000..760e2534d1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_reset_interval_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigDynamicSnitchResetIntervalInMsReader is a Reader for the FindConfigDynamicSnitchResetIntervalInMs structure. +type FindConfigDynamicSnitchResetIntervalInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigDynamicSnitchResetIntervalInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigDynamicSnitchResetIntervalInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigDynamicSnitchResetIntervalInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigDynamicSnitchResetIntervalInMsOK creates a FindConfigDynamicSnitchResetIntervalInMsOK with default headers values +func NewFindConfigDynamicSnitchResetIntervalInMsOK() *FindConfigDynamicSnitchResetIntervalInMsOK { + return &FindConfigDynamicSnitchResetIntervalInMsOK{} +} + +/* +FindConfigDynamicSnitchResetIntervalInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigDynamicSnitchResetIntervalInMsOK struct { + Payload int64 +} + +func (o *FindConfigDynamicSnitchResetIntervalInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigDynamicSnitchResetIntervalInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigDynamicSnitchResetIntervalInMsDefault creates a FindConfigDynamicSnitchResetIntervalInMsDefault with default headers values +func NewFindConfigDynamicSnitchResetIntervalInMsDefault(code int) *FindConfigDynamicSnitchResetIntervalInMsDefault { + return &FindConfigDynamicSnitchResetIntervalInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigDynamicSnitchResetIntervalInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigDynamicSnitchResetIntervalInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config dynamic snitch reset interval in ms default response +func (o *FindConfigDynamicSnitchResetIntervalInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigDynamicSnitchResetIntervalInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigDynamicSnitchResetIntervalInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigDynamicSnitchResetIntervalInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_update_interval_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_update_interval_in_ms_parameters.go new file mode 100644 index 0000000000..63fd6ace1d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_update_interval_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigDynamicSnitchUpdateIntervalInMsParams creates a new FindConfigDynamicSnitchUpdateIntervalInMsParams object +// with the default values initialized. +func NewFindConfigDynamicSnitchUpdateIntervalInMsParams() *FindConfigDynamicSnitchUpdateIntervalInMsParams { + + return &FindConfigDynamicSnitchUpdateIntervalInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigDynamicSnitchUpdateIntervalInMsParamsWithTimeout creates a new FindConfigDynamicSnitchUpdateIntervalInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigDynamicSnitchUpdateIntervalInMsParamsWithTimeout(timeout time.Duration) *FindConfigDynamicSnitchUpdateIntervalInMsParams { + + return &FindConfigDynamicSnitchUpdateIntervalInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigDynamicSnitchUpdateIntervalInMsParamsWithContext creates a new FindConfigDynamicSnitchUpdateIntervalInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigDynamicSnitchUpdateIntervalInMsParamsWithContext(ctx context.Context) *FindConfigDynamicSnitchUpdateIntervalInMsParams { + + return &FindConfigDynamicSnitchUpdateIntervalInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigDynamicSnitchUpdateIntervalInMsParamsWithHTTPClient creates a new FindConfigDynamicSnitchUpdateIntervalInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigDynamicSnitchUpdateIntervalInMsParamsWithHTTPClient(client *http.Client) *FindConfigDynamicSnitchUpdateIntervalInMsParams { + + return &FindConfigDynamicSnitchUpdateIntervalInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigDynamicSnitchUpdateIntervalInMsParams contains all the parameters to send to the API endpoint +for the find config dynamic snitch update interval in ms operation typically these are written to a http.Request +*/ +type FindConfigDynamicSnitchUpdateIntervalInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config dynamic snitch update interval in ms params +func (o *FindConfigDynamicSnitchUpdateIntervalInMsParams) WithTimeout(timeout time.Duration) *FindConfigDynamicSnitchUpdateIntervalInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config dynamic snitch update interval in ms params +func (o *FindConfigDynamicSnitchUpdateIntervalInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config dynamic snitch update interval in ms params +func (o *FindConfigDynamicSnitchUpdateIntervalInMsParams) WithContext(ctx context.Context) *FindConfigDynamicSnitchUpdateIntervalInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config dynamic snitch update interval in ms params +func (o *FindConfigDynamicSnitchUpdateIntervalInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config dynamic snitch update interval in ms params +func (o *FindConfigDynamicSnitchUpdateIntervalInMsParams) WithHTTPClient(client *http.Client) *FindConfigDynamicSnitchUpdateIntervalInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config dynamic snitch update interval in ms params +func (o *FindConfigDynamicSnitchUpdateIntervalInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigDynamicSnitchUpdateIntervalInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_update_interval_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_update_interval_in_ms_responses.go new file mode 100644 index 0000000000..184d9b9363 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_dynamic_snitch_update_interval_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigDynamicSnitchUpdateIntervalInMsReader is a Reader for the FindConfigDynamicSnitchUpdateIntervalInMs structure. +type FindConfigDynamicSnitchUpdateIntervalInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigDynamicSnitchUpdateIntervalInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigDynamicSnitchUpdateIntervalInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigDynamicSnitchUpdateIntervalInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigDynamicSnitchUpdateIntervalInMsOK creates a FindConfigDynamicSnitchUpdateIntervalInMsOK with default headers values +func NewFindConfigDynamicSnitchUpdateIntervalInMsOK() *FindConfigDynamicSnitchUpdateIntervalInMsOK { + return &FindConfigDynamicSnitchUpdateIntervalInMsOK{} +} + +/* +FindConfigDynamicSnitchUpdateIntervalInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigDynamicSnitchUpdateIntervalInMsOK struct { + Payload int64 +} + +func (o *FindConfigDynamicSnitchUpdateIntervalInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigDynamicSnitchUpdateIntervalInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigDynamicSnitchUpdateIntervalInMsDefault creates a FindConfigDynamicSnitchUpdateIntervalInMsDefault with default headers values +func NewFindConfigDynamicSnitchUpdateIntervalInMsDefault(code int) *FindConfigDynamicSnitchUpdateIntervalInMsDefault { + return &FindConfigDynamicSnitchUpdateIntervalInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigDynamicSnitchUpdateIntervalInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigDynamicSnitchUpdateIntervalInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config dynamic snitch update interval in ms default response +func (o *FindConfigDynamicSnitchUpdateIntervalInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigDynamicSnitchUpdateIntervalInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigDynamicSnitchUpdateIntervalInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigDynamicSnitchUpdateIntervalInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_cache_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_cache_parameters.go new file mode 100644 index 0000000000..848d9b8e26 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_cache_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigEnableCacheParams creates a new FindConfigEnableCacheParams object +// with the default values initialized. +func NewFindConfigEnableCacheParams() *FindConfigEnableCacheParams { + + return &FindConfigEnableCacheParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigEnableCacheParamsWithTimeout creates a new FindConfigEnableCacheParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigEnableCacheParamsWithTimeout(timeout time.Duration) *FindConfigEnableCacheParams { + + return &FindConfigEnableCacheParams{ + + timeout: timeout, + } +} + +// NewFindConfigEnableCacheParamsWithContext creates a new FindConfigEnableCacheParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigEnableCacheParamsWithContext(ctx context.Context) *FindConfigEnableCacheParams { + + return &FindConfigEnableCacheParams{ + + Context: ctx, + } +} + +// NewFindConfigEnableCacheParamsWithHTTPClient creates a new FindConfigEnableCacheParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigEnableCacheParamsWithHTTPClient(client *http.Client) *FindConfigEnableCacheParams { + + return &FindConfigEnableCacheParams{ + HTTPClient: client, + } +} + +/* +FindConfigEnableCacheParams contains all the parameters to send to the API endpoint +for the find config enable cache operation typically these are written to a http.Request +*/ +type FindConfigEnableCacheParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config enable cache params +func (o *FindConfigEnableCacheParams) WithTimeout(timeout time.Duration) *FindConfigEnableCacheParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config enable cache params +func (o *FindConfigEnableCacheParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config enable cache params +func (o *FindConfigEnableCacheParams) WithContext(ctx context.Context) *FindConfigEnableCacheParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config enable cache params +func (o *FindConfigEnableCacheParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config enable cache params +func (o *FindConfigEnableCacheParams) WithHTTPClient(client *http.Client) *FindConfigEnableCacheParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config enable cache params +func (o *FindConfigEnableCacheParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigEnableCacheParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_cache_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_cache_responses.go new file mode 100644 index 0000000000..5e998b0939 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_cache_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigEnableCacheReader is a Reader for the FindConfigEnableCache structure. +type FindConfigEnableCacheReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigEnableCacheReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigEnableCacheOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigEnableCacheDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigEnableCacheOK creates a FindConfigEnableCacheOK with default headers values +func NewFindConfigEnableCacheOK() *FindConfigEnableCacheOK { + return &FindConfigEnableCacheOK{} +} + +/* +FindConfigEnableCacheOK handles this case with default header values. + +Config value +*/ +type FindConfigEnableCacheOK struct { + Payload bool +} + +func (o *FindConfigEnableCacheOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigEnableCacheOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigEnableCacheDefault creates a FindConfigEnableCacheDefault with default headers values +func NewFindConfigEnableCacheDefault(code int) *FindConfigEnableCacheDefault { + return &FindConfigEnableCacheDefault{ + _statusCode: code, + } +} + +/* +FindConfigEnableCacheDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigEnableCacheDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config enable cache default response +func (o *FindConfigEnableCacheDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigEnableCacheDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigEnableCacheDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigEnableCacheDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_commitlog_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_commitlog_parameters.go new file mode 100644 index 0000000000..8a3d55e69b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_commitlog_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigEnableCommitlogParams creates a new FindConfigEnableCommitlogParams object +// with the default values initialized. +func NewFindConfigEnableCommitlogParams() *FindConfigEnableCommitlogParams { + + return &FindConfigEnableCommitlogParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigEnableCommitlogParamsWithTimeout creates a new FindConfigEnableCommitlogParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigEnableCommitlogParamsWithTimeout(timeout time.Duration) *FindConfigEnableCommitlogParams { + + return &FindConfigEnableCommitlogParams{ + + timeout: timeout, + } +} + +// NewFindConfigEnableCommitlogParamsWithContext creates a new FindConfigEnableCommitlogParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigEnableCommitlogParamsWithContext(ctx context.Context) *FindConfigEnableCommitlogParams { + + return &FindConfigEnableCommitlogParams{ + + Context: ctx, + } +} + +// NewFindConfigEnableCommitlogParamsWithHTTPClient creates a new FindConfigEnableCommitlogParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigEnableCommitlogParamsWithHTTPClient(client *http.Client) *FindConfigEnableCommitlogParams { + + return &FindConfigEnableCommitlogParams{ + HTTPClient: client, + } +} + +/* +FindConfigEnableCommitlogParams contains all the parameters to send to the API endpoint +for the find config enable commitlog operation typically these are written to a http.Request +*/ +type FindConfigEnableCommitlogParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config enable commitlog params +func (o *FindConfigEnableCommitlogParams) WithTimeout(timeout time.Duration) *FindConfigEnableCommitlogParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config enable commitlog params +func (o *FindConfigEnableCommitlogParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config enable commitlog params +func (o *FindConfigEnableCommitlogParams) WithContext(ctx context.Context) *FindConfigEnableCommitlogParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config enable commitlog params +func (o *FindConfigEnableCommitlogParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config enable commitlog params +func (o *FindConfigEnableCommitlogParams) WithHTTPClient(client *http.Client) *FindConfigEnableCommitlogParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config enable commitlog params +func (o *FindConfigEnableCommitlogParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigEnableCommitlogParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_commitlog_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_commitlog_responses.go new file mode 100644 index 0000000000..e99c48a5d4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_commitlog_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigEnableCommitlogReader is a Reader for the FindConfigEnableCommitlog structure. +type FindConfigEnableCommitlogReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigEnableCommitlogReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigEnableCommitlogOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigEnableCommitlogDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigEnableCommitlogOK creates a FindConfigEnableCommitlogOK with default headers values +func NewFindConfigEnableCommitlogOK() *FindConfigEnableCommitlogOK { + return &FindConfigEnableCommitlogOK{} +} + +/* +FindConfigEnableCommitlogOK handles this case with default header values. + +Config value +*/ +type FindConfigEnableCommitlogOK struct { + Payload bool +} + +func (o *FindConfigEnableCommitlogOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigEnableCommitlogOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigEnableCommitlogDefault creates a FindConfigEnableCommitlogDefault with default headers values +func NewFindConfigEnableCommitlogDefault(code int) *FindConfigEnableCommitlogDefault { + return &FindConfigEnableCommitlogDefault{ + _statusCode: code, + } +} + +/* +FindConfigEnableCommitlogDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigEnableCommitlogDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config enable commitlog default response +func (o *FindConfigEnableCommitlogDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigEnableCommitlogDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigEnableCommitlogDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigEnableCommitlogDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_dangerous_direct_import_of_cassandra_counters_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_dangerous_direct_import_of_cassandra_counters_parameters.go new file mode 100644 index 0000000000..a4be468969 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_dangerous_direct_import_of_cassandra_counters_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigEnableDangerousDirectImportOfCassandraCountersParams creates a new FindConfigEnableDangerousDirectImportOfCassandraCountersParams object +// with the default values initialized. +func NewFindConfigEnableDangerousDirectImportOfCassandraCountersParams() *FindConfigEnableDangerousDirectImportOfCassandraCountersParams { + + return &FindConfigEnableDangerousDirectImportOfCassandraCountersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigEnableDangerousDirectImportOfCassandraCountersParamsWithTimeout creates a new FindConfigEnableDangerousDirectImportOfCassandraCountersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigEnableDangerousDirectImportOfCassandraCountersParamsWithTimeout(timeout time.Duration) *FindConfigEnableDangerousDirectImportOfCassandraCountersParams { + + return &FindConfigEnableDangerousDirectImportOfCassandraCountersParams{ + + timeout: timeout, + } +} + +// NewFindConfigEnableDangerousDirectImportOfCassandraCountersParamsWithContext creates a new FindConfigEnableDangerousDirectImportOfCassandraCountersParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigEnableDangerousDirectImportOfCassandraCountersParamsWithContext(ctx context.Context) *FindConfigEnableDangerousDirectImportOfCassandraCountersParams { + + return &FindConfigEnableDangerousDirectImportOfCassandraCountersParams{ + + Context: ctx, + } +} + +// NewFindConfigEnableDangerousDirectImportOfCassandraCountersParamsWithHTTPClient creates a new FindConfigEnableDangerousDirectImportOfCassandraCountersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigEnableDangerousDirectImportOfCassandraCountersParamsWithHTTPClient(client *http.Client) *FindConfigEnableDangerousDirectImportOfCassandraCountersParams { + + return &FindConfigEnableDangerousDirectImportOfCassandraCountersParams{ + HTTPClient: client, + } +} + +/* +FindConfigEnableDangerousDirectImportOfCassandraCountersParams contains all the parameters to send to the API endpoint +for the find config enable dangerous direct import of cassandra counters operation typically these are written to a http.Request +*/ +type FindConfigEnableDangerousDirectImportOfCassandraCountersParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config enable dangerous direct import of cassandra counters params +func (o *FindConfigEnableDangerousDirectImportOfCassandraCountersParams) WithTimeout(timeout time.Duration) *FindConfigEnableDangerousDirectImportOfCassandraCountersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config enable dangerous direct import of cassandra counters params +func (o *FindConfigEnableDangerousDirectImportOfCassandraCountersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config enable dangerous direct import of cassandra counters params +func (o *FindConfigEnableDangerousDirectImportOfCassandraCountersParams) WithContext(ctx context.Context) *FindConfigEnableDangerousDirectImportOfCassandraCountersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config enable dangerous direct import of cassandra counters params +func (o *FindConfigEnableDangerousDirectImportOfCassandraCountersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config enable dangerous direct import of cassandra counters params +func (o *FindConfigEnableDangerousDirectImportOfCassandraCountersParams) WithHTTPClient(client *http.Client) *FindConfigEnableDangerousDirectImportOfCassandraCountersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config enable dangerous direct import of cassandra counters params +func (o *FindConfigEnableDangerousDirectImportOfCassandraCountersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigEnableDangerousDirectImportOfCassandraCountersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_dangerous_direct_import_of_cassandra_counters_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_dangerous_direct_import_of_cassandra_counters_responses.go new file mode 100644 index 0000000000..c562580b7d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_dangerous_direct_import_of_cassandra_counters_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigEnableDangerousDirectImportOfCassandraCountersReader is a Reader for the FindConfigEnableDangerousDirectImportOfCassandraCounters structure. +type FindConfigEnableDangerousDirectImportOfCassandraCountersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigEnableDangerousDirectImportOfCassandraCountersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigEnableDangerousDirectImportOfCassandraCountersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigEnableDangerousDirectImportOfCassandraCountersDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigEnableDangerousDirectImportOfCassandraCountersOK creates a FindConfigEnableDangerousDirectImportOfCassandraCountersOK with default headers values +func NewFindConfigEnableDangerousDirectImportOfCassandraCountersOK() *FindConfigEnableDangerousDirectImportOfCassandraCountersOK { + return &FindConfigEnableDangerousDirectImportOfCassandraCountersOK{} +} + +/* +FindConfigEnableDangerousDirectImportOfCassandraCountersOK handles this case with default header values. + +Config value +*/ +type FindConfigEnableDangerousDirectImportOfCassandraCountersOK struct { + Payload bool +} + +func (o *FindConfigEnableDangerousDirectImportOfCassandraCountersOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigEnableDangerousDirectImportOfCassandraCountersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigEnableDangerousDirectImportOfCassandraCountersDefault creates a FindConfigEnableDangerousDirectImportOfCassandraCountersDefault with default headers values +func NewFindConfigEnableDangerousDirectImportOfCassandraCountersDefault(code int) *FindConfigEnableDangerousDirectImportOfCassandraCountersDefault { + return &FindConfigEnableDangerousDirectImportOfCassandraCountersDefault{ + _statusCode: code, + } +} + +/* +FindConfigEnableDangerousDirectImportOfCassandraCountersDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigEnableDangerousDirectImportOfCassandraCountersDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config enable dangerous direct import of cassandra counters default response +func (o *FindConfigEnableDangerousDirectImportOfCassandraCountersDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigEnableDangerousDirectImportOfCassandraCountersDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigEnableDangerousDirectImportOfCassandraCountersDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigEnableDangerousDirectImportOfCassandraCountersDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_deprecated_partitioners_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_deprecated_partitioners_parameters.go new file mode 100644 index 0000000000..137ab80c82 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_deprecated_partitioners_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigEnableDeprecatedPartitionersParams creates a new FindConfigEnableDeprecatedPartitionersParams object +// with the default values initialized. +func NewFindConfigEnableDeprecatedPartitionersParams() *FindConfigEnableDeprecatedPartitionersParams { + + return &FindConfigEnableDeprecatedPartitionersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigEnableDeprecatedPartitionersParamsWithTimeout creates a new FindConfigEnableDeprecatedPartitionersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigEnableDeprecatedPartitionersParamsWithTimeout(timeout time.Duration) *FindConfigEnableDeprecatedPartitionersParams { + + return &FindConfigEnableDeprecatedPartitionersParams{ + + timeout: timeout, + } +} + +// NewFindConfigEnableDeprecatedPartitionersParamsWithContext creates a new FindConfigEnableDeprecatedPartitionersParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigEnableDeprecatedPartitionersParamsWithContext(ctx context.Context) *FindConfigEnableDeprecatedPartitionersParams { + + return &FindConfigEnableDeprecatedPartitionersParams{ + + Context: ctx, + } +} + +// NewFindConfigEnableDeprecatedPartitionersParamsWithHTTPClient creates a new FindConfigEnableDeprecatedPartitionersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigEnableDeprecatedPartitionersParamsWithHTTPClient(client *http.Client) *FindConfigEnableDeprecatedPartitionersParams { + + return &FindConfigEnableDeprecatedPartitionersParams{ + HTTPClient: client, + } +} + +/* +FindConfigEnableDeprecatedPartitionersParams contains all the parameters to send to the API endpoint +for the find config enable deprecated partitioners operation typically these are written to a http.Request +*/ +type FindConfigEnableDeprecatedPartitionersParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config enable deprecated partitioners params +func (o *FindConfigEnableDeprecatedPartitionersParams) WithTimeout(timeout time.Duration) *FindConfigEnableDeprecatedPartitionersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config enable deprecated partitioners params +func (o *FindConfigEnableDeprecatedPartitionersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config enable deprecated partitioners params +func (o *FindConfigEnableDeprecatedPartitionersParams) WithContext(ctx context.Context) *FindConfigEnableDeprecatedPartitionersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config enable deprecated partitioners params +func (o *FindConfigEnableDeprecatedPartitionersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config enable deprecated partitioners params +func (o *FindConfigEnableDeprecatedPartitionersParams) WithHTTPClient(client *http.Client) *FindConfigEnableDeprecatedPartitionersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config enable deprecated partitioners params +func (o *FindConfigEnableDeprecatedPartitionersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigEnableDeprecatedPartitionersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_deprecated_partitioners_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_deprecated_partitioners_responses.go new file mode 100644 index 0000000000..e17eba4308 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_deprecated_partitioners_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigEnableDeprecatedPartitionersReader is a Reader for the FindConfigEnableDeprecatedPartitioners structure. +type FindConfigEnableDeprecatedPartitionersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigEnableDeprecatedPartitionersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigEnableDeprecatedPartitionersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigEnableDeprecatedPartitionersDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigEnableDeprecatedPartitionersOK creates a FindConfigEnableDeprecatedPartitionersOK with default headers values +func NewFindConfigEnableDeprecatedPartitionersOK() *FindConfigEnableDeprecatedPartitionersOK { + return &FindConfigEnableDeprecatedPartitionersOK{} +} + +/* +FindConfigEnableDeprecatedPartitionersOK handles this case with default header values. + +Config value +*/ +type FindConfigEnableDeprecatedPartitionersOK struct { + Payload bool +} + +func (o *FindConfigEnableDeprecatedPartitionersOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigEnableDeprecatedPartitionersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigEnableDeprecatedPartitionersDefault creates a FindConfigEnableDeprecatedPartitionersDefault with default headers values +func NewFindConfigEnableDeprecatedPartitionersDefault(code int) *FindConfigEnableDeprecatedPartitionersDefault { + return &FindConfigEnableDeprecatedPartitionersDefault{ + _statusCode: code, + } +} + +/* +FindConfigEnableDeprecatedPartitionersDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigEnableDeprecatedPartitionersDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config enable deprecated partitioners default response +func (o *FindConfigEnableDeprecatedPartitionersDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigEnableDeprecatedPartitionersDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigEnableDeprecatedPartitionersDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigEnableDeprecatedPartitionersDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_in_memory_data_store_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_in_memory_data_store_parameters.go new file mode 100644 index 0000000000..07a740d2ff --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_in_memory_data_store_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigEnableInMemoryDataStoreParams creates a new FindConfigEnableInMemoryDataStoreParams object +// with the default values initialized. +func NewFindConfigEnableInMemoryDataStoreParams() *FindConfigEnableInMemoryDataStoreParams { + + return &FindConfigEnableInMemoryDataStoreParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigEnableInMemoryDataStoreParamsWithTimeout creates a new FindConfigEnableInMemoryDataStoreParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigEnableInMemoryDataStoreParamsWithTimeout(timeout time.Duration) *FindConfigEnableInMemoryDataStoreParams { + + return &FindConfigEnableInMemoryDataStoreParams{ + + timeout: timeout, + } +} + +// NewFindConfigEnableInMemoryDataStoreParamsWithContext creates a new FindConfigEnableInMemoryDataStoreParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigEnableInMemoryDataStoreParamsWithContext(ctx context.Context) *FindConfigEnableInMemoryDataStoreParams { + + return &FindConfigEnableInMemoryDataStoreParams{ + + Context: ctx, + } +} + +// NewFindConfigEnableInMemoryDataStoreParamsWithHTTPClient creates a new FindConfigEnableInMemoryDataStoreParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigEnableInMemoryDataStoreParamsWithHTTPClient(client *http.Client) *FindConfigEnableInMemoryDataStoreParams { + + return &FindConfigEnableInMemoryDataStoreParams{ + HTTPClient: client, + } +} + +/* +FindConfigEnableInMemoryDataStoreParams contains all the parameters to send to the API endpoint +for the find config enable in memory data store operation typically these are written to a http.Request +*/ +type FindConfigEnableInMemoryDataStoreParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config enable in memory data store params +func (o *FindConfigEnableInMemoryDataStoreParams) WithTimeout(timeout time.Duration) *FindConfigEnableInMemoryDataStoreParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config enable in memory data store params +func (o *FindConfigEnableInMemoryDataStoreParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config enable in memory data store params +func (o *FindConfigEnableInMemoryDataStoreParams) WithContext(ctx context.Context) *FindConfigEnableInMemoryDataStoreParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config enable in memory data store params +func (o *FindConfigEnableInMemoryDataStoreParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config enable in memory data store params +func (o *FindConfigEnableInMemoryDataStoreParams) WithHTTPClient(client *http.Client) *FindConfigEnableInMemoryDataStoreParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config enable in memory data store params +func (o *FindConfigEnableInMemoryDataStoreParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigEnableInMemoryDataStoreParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_in_memory_data_store_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_in_memory_data_store_responses.go new file mode 100644 index 0000000000..aa9e2a58ca --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_in_memory_data_store_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigEnableInMemoryDataStoreReader is a Reader for the FindConfigEnableInMemoryDataStore structure. +type FindConfigEnableInMemoryDataStoreReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigEnableInMemoryDataStoreReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigEnableInMemoryDataStoreOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigEnableInMemoryDataStoreDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigEnableInMemoryDataStoreOK creates a FindConfigEnableInMemoryDataStoreOK with default headers values +func NewFindConfigEnableInMemoryDataStoreOK() *FindConfigEnableInMemoryDataStoreOK { + return &FindConfigEnableInMemoryDataStoreOK{} +} + +/* +FindConfigEnableInMemoryDataStoreOK handles this case with default header values. + +Config value +*/ +type FindConfigEnableInMemoryDataStoreOK struct { + Payload bool +} + +func (o *FindConfigEnableInMemoryDataStoreOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigEnableInMemoryDataStoreOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigEnableInMemoryDataStoreDefault creates a FindConfigEnableInMemoryDataStoreDefault with default headers values +func NewFindConfigEnableInMemoryDataStoreDefault(code int) *FindConfigEnableInMemoryDataStoreDefault { + return &FindConfigEnableInMemoryDataStoreDefault{ + _statusCode: code, + } +} + +/* +FindConfigEnableInMemoryDataStoreDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigEnableInMemoryDataStoreDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config enable in memory data store default response +func (o *FindConfigEnableInMemoryDataStoreDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigEnableInMemoryDataStoreDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigEnableInMemoryDataStoreDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigEnableInMemoryDataStoreDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_keyspace_column_family_metrics_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_keyspace_column_family_metrics_parameters.go new file mode 100644 index 0000000000..6cc99b6ebe --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_keyspace_column_family_metrics_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigEnableKeyspaceColumnFamilyMetricsParams creates a new FindConfigEnableKeyspaceColumnFamilyMetricsParams object +// with the default values initialized. +func NewFindConfigEnableKeyspaceColumnFamilyMetricsParams() *FindConfigEnableKeyspaceColumnFamilyMetricsParams { + + return &FindConfigEnableKeyspaceColumnFamilyMetricsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigEnableKeyspaceColumnFamilyMetricsParamsWithTimeout creates a new FindConfigEnableKeyspaceColumnFamilyMetricsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigEnableKeyspaceColumnFamilyMetricsParamsWithTimeout(timeout time.Duration) *FindConfigEnableKeyspaceColumnFamilyMetricsParams { + + return &FindConfigEnableKeyspaceColumnFamilyMetricsParams{ + + timeout: timeout, + } +} + +// NewFindConfigEnableKeyspaceColumnFamilyMetricsParamsWithContext creates a new FindConfigEnableKeyspaceColumnFamilyMetricsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigEnableKeyspaceColumnFamilyMetricsParamsWithContext(ctx context.Context) *FindConfigEnableKeyspaceColumnFamilyMetricsParams { + + return &FindConfigEnableKeyspaceColumnFamilyMetricsParams{ + + Context: ctx, + } +} + +// NewFindConfigEnableKeyspaceColumnFamilyMetricsParamsWithHTTPClient creates a new FindConfigEnableKeyspaceColumnFamilyMetricsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigEnableKeyspaceColumnFamilyMetricsParamsWithHTTPClient(client *http.Client) *FindConfigEnableKeyspaceColumnFamilyMetricsParams { + + return &FindConfigEnableKeyspaceColumnFamilyMetricsParams{ + HTTPClient: client, + } +} + +/* +FindConfigEnableKeyspaceColumnFamilyMetricsParams contains all the parameters to send to the API endpoint +for the find config enable keyspace column family metrics operation typically these are written to a http.Request +*/ +type FindConfigEnableKeyspaceColumnFamilyMetricsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config enable keyspace column family metrics params +func (o *FindConfigEnableKeyspaceColumnFamilyMetricsParams) WithTimeout(timeout time.Duration) *FindConfigEnableKeyspaceColumnFamilyMetricsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config enable keyspace column family metrics params +func (o *FindConfigEnableKeyspaceColumnFamilyMetricsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config enable keyspace column family metrics params +func (o *FindConfigEnableKeyspaceColumnFamilyMetricsParams) WithContext(ctx context.Context) *FindConfigEnableKeyspaceColumnFamilyMetricsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config enable keyspace column family metrics params +func (o *FindConfigEnableKeyspaceColumnFamilyMetricsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config enable keyspace column family metrics params +func (o *FindConfigEnableKeyspaceColumnFamilyMetricsParams) WithHTTPClient(client *http.Client) *FindConfigEnableKeyspaceColumnFamilyMetricsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config enable keyspace column family metrics params +func (o *FindConfigEnableKeyspaceColumnFamilyMetricsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigEnableKeyspaceColumnFamilyMetricsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_keyspace_column_family_metrics_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_keyspace_column_family_metrics_responses.go new file mode 100644 index 0000000000..863e9c6a5f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_keyspace_column_family_metrics_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigEnableKeyspaceColumnFamilyMetricsReader is a Reader for the FindConfigEnableKeyspaceColumnFamilyMetrics structure. +type FindConfigEnableKeyspaceColumnFamilyMetricsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigEnableKeyspaceColumnFamilyMetricsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigEnableKeyspaceColumnFamilyMetricsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigEnableKeyspaceColumnFamilyMetricsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigEnableKeyspaceColumnFamilyMetricsOK creates a FindConfigEnableKeyspaceColumnFamilyMetricsOK with default headers values +func NewFindConfigEnableKeyspaceColumnFamilyMetricsOK() *FindConfigEnableKeyspaceColumnFamilyMetricsOK { + return &FindConfigEnableKeyspaceColumnFamilyMetricsOK{} +} + +/* +FindConfigEnableKeyspaceColumnFamilyMetricsOK handles this case with default header values. + +Config value +*/ +type FindConfigEnableKeyspaceColumnFamilyMetricsOK struct { + Payload bool +} + +func (o *FindConfigEnableKeyspaceColumnFamilyMetricsOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigEnableKeyspaceColumnFamilyMetricsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigEnableKeyspaceColumnFamilyMetricsDefault creates a FindConfigEnableKeyspaceColumnFamilyMetricsDefault with default headers values +func NewFindConfigEnableKeyspaceColumnFamilyMetricsDefault(code int) *FindConfigEnableKeyspaceColumnFamilyMetricsDefault { + return &FindConfigEnableKeyspaceColumnFamilyMetricsDefault{ + _statusCode: code, + } +} + +/* +FindConfigEnableKeyspaceColumnFamilyMetricsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigEnableKeyspaceColumnFamilyMetricsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config enable keyspace column family metrics default response +func (o *FindConfigEnableKeyspaceColumnFamilyMetricsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigEnableKeyspaceColumnFamilyMetricsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigEnableKeyspaceColumnFamilyMetricsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigEnableKeyspaceColumnFamilyMetricsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_shard_aware_drivers_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_shard_aware_drivers_parameters.go new file mode 100644 index 0000000000..e532a086d6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_shard_aware_drivers_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigEnableShardAwareDriversParams creates a new FindConfigEnableShardAwareDriversParams object +// with the default values initialized. +func NewFindConfigEnableShardAwareDriversParams() *FindConfigEnableShardAwareDriversParams { + + return &FindConfigEnableShardAwareDriversParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigEnableShardAwareDriversParamsWithTimeout creates a new FindConfigEnableShardAwareDriversParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigEnableShardAwareDriversParamsWithTimeout(timeout time.Duration) *FindConfigEnableShardAwareDriversParams { + + return &FindConfigEnableShardAwareDriversParams{ + + timeout: timeout, + } +} + +// NewFindConfigEnableShardAwareDriversParamsWithContext creates a new FindConfigEnableShardAwareDriversParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigEnableShardAwareDriversParamsWithContext(ctx context.Context) *FindConfigEnableShardAwareDriversParams { + + return &FindConfigEnableShardAwareDriversParams{ + + Context: ctx, + } +} + +// NewFindConfigEnableShardAwareDriversParamsWithHTTPClient creates a new FindConfigEnableShardAwareDriversParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigEnableShardAwareDriversParamsWithHTTPClient(client *http.Client) *FindConfigEnableShardAwareDriversParams { + + return &FindConfigEnableShardAwareDriversParams{ + HTTPClient: client, + } +} + +/* +FindConfigEnableShardAwareDriversParams contains all the parameters to send to the API endpoint +for the find config enable shard aware drivers operation typically these are written to a http.Request +*/ +type FindConfigEnableShardAwareDriversParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config enable shard aware drivers params +func (o *FindConfigEnableShardAwareDriversParams) WithTimeout(timeout time.Duration) *FindConfigEnableShardAwareDriversParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config enable shard aware drivers params +func (o *FindConfigEnableShardAwareDriversParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config enable shard aware drivers params +func (o *FindConfigEnableShardAwareDriversParams) WithContext(ctx context.Context) *FindConfigEnableShardAwareDriversParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config enable shard aware drivers params +func (o *FindConfigEnableShardAwareDriversParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config enable shard aware drivers params +func (o *FindConfigEnableShardAwareDriversParams) WithHTTPClient(client *http.Client) *FindConfigEnableShardAwareDriversParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config enable shard aware drivers params +func (o *FindConfigEnableShardAwareDriversParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigEnableShardAwareDriversParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_shard_aware_drivers_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_shard_aware_drivers_responses.go new file mode 100644 index 0000000000..505e6c1f98 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_shard_aware_drivers_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigEnableShardAwareDriversReader is a Reader for the FindConfigEnableShardAwareDrivers structure. +type FindConfigEnableShardAwareDriversReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigEnableShardAwareDriversReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigEnableShardAwareDriversOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigEnableShardAwareDriversDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigEnableShardAwareDriversOK creates a FindConfigEnableShardAwareDriversOK with default headers values +func NewFindConfigEnableShardAwareDriversOK() *FindConfigEnableShardAwareDriversOK { + return &FindConfigEnableShardAwareDriversOK{} +} + +/* +FindConfigEnableShardAwareDriversOK handles this case with default header values. + +Config value +*/ +type FindConfigEnableShardAwareDriversOK struct { + Payload bool +} + +func (o *FindConfigEnableShardAwareDriversOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigEnableShardAwareDriversOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigEnableShardAwareDriversDefault creates a FindConfigEnableShardAwareDriversDefault with default headers values +func NewFindConfigEnableShardAwareDriversDefault(code int) *FindConfigEnableShardAwareDriversDefault { + return &FindConfigEnableShardAwareDriversDefault{ + _statusCode: code, + } +} + +/* +FindConfigEnableShardAwareDriversDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigEnableShardAwareDriversDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config enable shard aware drivers default response +func (o *FindConfigEnableShardAwareDriversDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigEnableShardAwareDriversDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigEnableShardAwareDriversDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigEnableShardAwareDriversDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_sstable_data_integrity_check_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_sstable_data_integrity_check_parameters.go new file mode 100644 index 0000000000..de1d40638f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_sstable_data_integrity_check_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigEnableSstableDataIntegrityCheckParams creates a new FindConfigEnableSstableDataIntegrityCheckParams object +// with the default values initialized. +func NewFindConfigEnableSstableDataIntegrityCheckParams() *FindConfigEnableSstableDataIntegrityCheckParams { + + return &FindConfigEnableSstableDataIntegrityCheckParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigEnableSstableDataIntegrityCheckParamsWithTimeout creates a new FindConfigEnableSstableDataIntegrityCheckParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigEnableSstableDataIntegrityCheckParamsWithTimeout(timeout time.Duration) *FindConfigEnableSstableDataIntegrityCheckParams { + + return &FindConfigEnableSstableDataIntegrityCheckParams{ + + timeout: timeout, + } +} + +// NewFindConfigEnableSstableDataIntegrityCheckParamsWithContext creates a new FindConfigEnableSstableDataIntegrityCheckParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigEnableSstableDataIntegrityCheckParamsWithContext(ctx context.Context) *FindConfigEnableSstableDataIntegrityCheckParams { + + return &FindConfigEnableSstableDataIntegrityCheckParams{ + + Context: ctx, + } +} + +// NewFindConfigEnableSstableDataIntegrityCheckParamsWithHTTPClient creates a new FindConfigEnableSstableDataIntegrityCheckParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigEnableSstableDataIntegrityCheckParamsWithHTTPClient(client *http.Client) *FindConfigEnableSstableDataIntegrityCheckParams { + + return &FindConfigEnableSstableDataIntegrityCheckParams{ + HTTPClient: client, + } +} + +/* +FindConfigEnableSstableDataIntegrityCheckParams contains all the parameters to send to the API endpoint +for the find config enable sstable data integrity check operation typically these are written to a http.Request +*/ +type FindConfigEnableSstableDataIntegrityCheckParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config enable sstable data integrity check params +func (o *FindConfigEnableSstableDataIntegrityCheckParams) WithTimeout(timeout time.Duration) *FindConfigEnableSstableDataIntegrityCheckParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config enable sstable data integrity check params +func (o *FindConfigEnableSstableDataIntegrityCheckParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config enable sstable data integrity check params +func (o *FindConfigEnableSstableDataIntegrityCheckParams) WithContext(ctx context.Context) *FindConfigEnableSstableDataIntegrityCheckParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config enable sstable data integrity check params +func (o *FindConfigEnableSstableDataIntegrityCheckParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config enable sstable data integrity check params +func (o *FindConfigEnableSstableDataIntegrityCheckParams) WithHTTPClient(client *http.Client) *FindConfigEnableSstableDataIntegrityCheckParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config enable sstable data integrity check params +func (o *FindConfigEnableSstableDataIntegrityCheckParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigEnableSstableDataIntegrityCheckParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_sstable_data_integrity_check_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_sstable_data_integrity_check_responses.go new file mode 100644 index 0000000000..62d03edc7c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_sstable_data_integrity_check_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigEnableSstableDataIntegrityCheckReader is a Reader for the FindConfigEnableSstableDataIntegrityCheck structure. +type FindConfigEnableSstableDataIntegrityCheckReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigEnableSstableDataIntegrityCheckReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigEnableSstableDataIntegrityCheckOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigEnableSstableDataIntegrityCheckDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigEnableSstableDataIntegrityCheckOK creates a FindConfigEnableSstableDataIntegrityCheckOK with default headers values +func NewFindConfigEnableSstableDataIntegrityCheckOK() *FindConfigEnableSstableDataIntegrityCheckOK { + return &FindConfigEnableSstableDataIntegrityCheckOK{} +} + +/* +FindConfigEnableSstableDataIntegrityCheckOK handles this case with default header values. + +Config value +*/ +type FindConfigEnableSstableDataIntegrityCheckOK struct { + Payload bool +} + +func (o *FindConfigEnableSstableDataIntegrityCheckOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigEnableSstableDataIntegrityCheckOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigEnableSstableDataIntegrityCheckDefault creates a FindConfigEnableSstableDataIntegrityCheckDefault with default headers values +func NewFindConfigEnableSstableDataIntegrityCheckDefault(code int) *FindConfigEnableSstableDataIntegrityCheckDefault { + return &FindConfigEnableSstableDataIntegrityCheckDefault{ + _statusCode: code, + } +} + +/* +FindConfigEnableSstableDataIntegrityCheckDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigEnableSstableDataIntegrityCheckDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config enable sstable data integrity check default response +func (o *FindConfigEnableSstableDataIntegrityCheckDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigEnableSstableDataIntegrityCheckDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigEnableSstableDataIntegrityCheckDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigEnableSstableDataIntegrityCheckDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_sstables_mc_format_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_sstables_mc_format_parameters.go new file mode 100644 index 0000000000..0efb9484d6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_sstables_mc_format_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigEnableSstablesMcFormatParams creates a new FindConfigEnableSstablesMcFormatParams object +// with the default values initialized. +func NewFindConfigEnableSstablesMcFormatParams() *FindConfigEnableSstablesMcFormatParams { + + return &FindConfigEnableSstablesMcFormatParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigEnableSstablesMcFormatParamsWithTimeout creates a new FindConfigEnableSstablesMcFormatParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigEnableSstablesMcFormatParamsWithTimeout(timeout time.Duration) *FindConfigEnableSstablesMcFormatParams { + + return &FindConfigEnableSstablesMcFormatParams{ + + timeout: timeout, + } +} + +// NewFindConfigEnableSstablesMcFormatParamsWithContext creates a new FindConfigEnableSstablesMcFormatParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigEnableSstablesMcFormatParamsWithContext(ctx context.Context) *FindConfigEnableSstablesMcFormatParams { + + return &FindConfigEnableSstablesMcFormatParams{ + + Context: ctx, + } +} + +// NewFindConfigEnableSstablesMcFormatParamsWithHTTPClient creates a new FindConfigEnableSstablesMcFormatParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigEnableSstablesMcFormatParamsWithHTTPClient(client *http.Client) *FindConfigEnableSstablesMcFormatParams { + + return &FindConfigEnableSstablesMcFormatParams{ + HTTPClient: client, + } +} + +/* +FindConfigEnableSstablesMcFormatParams contains all the parameters to send to the API endpoint +for the find config enable sstables mc format operation typically these are written to a http.Request +*/ +type FindConfigEnableSstablesMcFormatParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config enable sstables mc format params +func (o *FindConfigEnableSstablesMcFormatParams) WithTimeout(timeout time.Duration) *FindConfigEnableSstablesMcFormatParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config enable sstables mc format params +func (o *FindConfigEnableSstablesMcFormatParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config enable sstables mc format params +func (o *FindConfigEnableSstablesMcFormatParams) WithContext(ctx context.Context) *FindConfigEnableSstablesMcFormatParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config enable sstables mc format params +func (o *FindConfigEnableSstablesMcFormatParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config enable sstables mc format params +func (o *FindConfigEnableSstablesMcFormatParams) WithHTTPClient(client *http.Client) *FindConfigEnableSstablesMcFormatParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config enable sstables mc format params +func (o *FindConfigEnableSstablesMcFormatParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigEnableSstablesMcFormatParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_sstables_mc_format_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_sstables_mc_format_responses.go new file mode 100644 index 0000000000..60115e3ca6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_sstables_mc_format_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigEnableSstablesMcFormatReader is a Reader for the FindConfigEnableSstablesMcFormat structure. +type FindConfigEnableSstablesMcFormatReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigEnableSstablesMcFormatReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigEnableSstablesMcFormatOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigEnableSstablesMcFormatDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigEnableSstablesMcFormatOK creates a FindConfigEnableSstablesMcFormatOK with default headers values +func NewFindConfigEnableSstablesMcFormatOK() *FindConfigEnableSstablesMcFormatOK { + return &FindConfigEnableSstablesMcFormatOK{} +} + +/* +FindConfigEnableSstablesMcFormatOK handles this case with default header values. + +Config value +*/ +type FindConfigEnableSstablesMcFormatOK struct { + Payload bool +} + +func (o *FindConfigEnableSstablesMcFormatOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigEnableSstablesMcFormatOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigEnableSstablesMcFormatDefault creates a FindConfigEnableSstablesMcFormatDefault with default headers values +func NewFindConfigEnableSstablesMcFormatDefault(code int) *FindConfigEnableSstablesMcFormatDefault { + return &FindConfigEnableSstablesMcFormatDefault{ + _statusCode: code, + } +} + +/* +FindConfigEnableSstablesMcFormatDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigEnableSstablesMcFormatDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config enable sstables mc format default response +func (o *FindConfigEnableSstablesMcFormatDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigEnableSstablesMcFormatDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigEnableSstablesMcFormatDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigEnableSstablesMcFormatDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_tablets_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_tablets_parameters.go new file mode 100644 index 0000000000..fdca5c08f3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_tablets_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigEnableTabletsParams creates a new FindConfigEnableTabletsParams object +// with the default values initialized. +func NewFindConfigEnableTabletsParams() *FindConfigEnableTabletsParams { + + return &FindConfigEnableTabletsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigEnableTabletsParamsWithTimeout creates a new FindConfigEnableTabletsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigEnableTabletsParamsWithTimeout(timeout time.Duration) *FindConfigEnableTabletsParams { + + return &FindConfigEnableTabletsParams{ + + timeout: timeout, + } +} + +// NewFindConfigEnableTabletsParamsWithContext creates a new FindConfigEnableTabletsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigEnableTabletsParamsWithContext(ctx context.Context) *FindConfigEnableTabletsParams { + + return &FindConfigEnableTabletsParams{ + + Context: ctx, + } +} + +// NewFindConfigEnableTabletsParamsWithHTTPClient creates a new FindConfigEnableTabletsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigEnableTabletsParamsWithHTTPClient(client *http.Client) *FindConfigEnableTabletsParams { + + return &FindConfigEnableTabletsParams{ + HTTPClient: client, + } +} + +/* +FindConfigEnableTabletsParams contains all the parameters to send to the API endpoint +for the find config enable tablets operation typically these are written to a http.Request +*/ +type FindConfigEnableTabletsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config enable tablets params +func (o *FindConfigEnableTabletsParams) WithTimeout(timeout time.Duration) *FindConfigEnableTabletsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config enable tablets params +func (o *FindConfigEnableTabletsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config enable tablets params +func (o *FindConfigEnableTabletsParams) WithContext(ctx context.Context) *FindConfigEnableTabletsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config enable tablets params +func (o *FindConfigEnableTabletsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config enable tablets params +func (o *FindConfigEnableTabletsParams) WithHTTPClient(client *http.Client) *FindConfigEnableTabletsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config enable tablets params +func (o *FindConfigEnableTabletsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigEnableTabletsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_tablets_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_tablets_responses.go new file mode 100644 index 0000000000..946b5dfa2d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_enable_tablets_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigEnableTabletsReader is a Reader for the FindConfigEnableTablets structure. +type FindConfigEnableTabletsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigEnableTabletsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigEnableTabletsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigEnableTabletsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigEnableTabletsOK creates a FindConfigEnableTabletsOK with default headers values +func NewFindConfigEnableTabletsOK() *FindConfigEnableTabletsOK { + return &FindConfigEnableTabletsOK{} +} + +/* +FindConfigEnableTabletsOK handles this case with default header values. + +Config value +*/ +type FindConfigEnableTabletsOK struct { + Payload bool +} + +func (o *FindConfigEnableTabletsOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigEnableTabletsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigEnableTabletsDefault creates a FindConfigEnableTabletsDefault with default headers values +func NewFindConfigEnableTabletsDefault(code int) *FindConfigEnableTabletsDefault { + return &FindConfigEnableTabletsDefault{ + _statusCode: code, + } +} + +/* +FindConfigEnableTabletsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigEnableTabletsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config enable tablets default response +func (o *FindConfigEnableTabletsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigEnableTabletsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigEnableTabletsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigEnableTabletsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_endpoint_snitch_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_endpoint_snitch_parameters.go new file mode 100644 index 0000000000..46f5a1ec32 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_endpoint_snitch_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigEndpointSnitchParams creates a new FindConfigEndpointSnitchParams object +// with the default values initialized. +func NewFindConfigEndpointSnitchParams() *FindConfigEndpointSnitchParams { + + return &FindConfigEndpointSnitchParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigEndpointSnitchParamsWithTimeout creates a new FindConfigEndpointSnitchParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigEndpointSnitchParamsWithTimeout(timeout time.Duration) *FindConfigEndpointSnitchParams { + + return &FindConfigEndpointSnitchParams{ + + timeout: timeout, + } +} + +// NewFindConfigEndpointSnitchParamsWithContext creates a new FindConfigEndpointSnitchParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigEndpointSnitchParamsWithContext(ctx context.Context) *FindConfigEndpointSnitchParams { + + return &FindConfigEndpointSnitchParams{ + + Context: ctx, + } +} + +// NewFindConfigEndpointSnitchParamsWithHTTPClient creates a new FindConfigEndpointSnitchParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigEndpointSnitchParamsWithHTTPClient(client *http.Client) *FindConfigEndpointSnitchParams { + + return &FindConfigEndpointSnitchParams{ + HTTPClient: client, + } +} + +/* +FindConfigEndpointSnitchParams contains all the parameters to send to the API endpoint +for the find config endpoint snitch operation typically these are written to a http.Request +*/ +type FindConfigEndpointSnitchParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config endpoint snitch params +func (o *FindConfigEndpointSnitchParams) WithTimeout(timeout time.Duration) *FindConfigEndpointSnitchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config endpoint snitch params +func (o *FindConfigEndpointSnitchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config endpoint snitch params +func (o *FindConfigEndpointSnitchParams) WithContext(ctx context.Context) *FindConfigEndpointSnitchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config endpoint snitch params +func (o *FindConfigEndpointSnitchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config endpoint snitch params +func (o *FindConfigEndpointSnitchParams) WithHTTPClient(client *http.Client) *FindConfigEndpointSnitchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config endpoint snitch params +func (o *FindConfigEndpointSnitchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigEndpointSnitchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_endpoint_snitch_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_endpoint_snitch_responses.go new file mode 100644 index 0000000000..e6d95d46a9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_endpoint_snitch_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigEndpointSnitchReader is a Reader for the FindConfigEndpointSnitch structure. +type FindConfigEndpointSnitchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigEndpointSnitchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigEndpointSnitchOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigEndpointSnitchDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigEndpointSnitchOK creates a FindConfigEndpointSnitchOK with default headers values +func NewFindConfigEndpointSnitchOK() *FindConfigEndpointSnitchOK { + return &FindConfigEndpointSnitchOK{} +} + +/* +FindConfigEndpointSnitchOK handles this case with default header values. + +Config value +*/ +type FindConfigEndpointSnitchOK struct { + Payload string +} + +func (o *FindConfigEndpointSnitchOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigEndpointSnitchOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigEndpointSnitchDefault creates a FindConfigEndpointSnitchDefault with default headers values +func NewFindConfigEndpointSnitchDefault(code int) *FindConfigEndpointSnitchDefault { + return &FindConfigEndpointSnitchDefault{ + _statusCode: code, + } +} + +/* +FindConfigEndpointSnitchDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigEndpointSnitchDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config endpoint snitch default response +func (o *FindConfigEndpointSnitchDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigEndpointSnitchDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigEndpointSnitchDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigEndpointSnitchDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_experimental_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_experimental_parameters.go new file mode 100644 index 0000000000..a398adef9f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_experimental_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigExperimentalParams creates a new FindConfigExperimentalParams object +// with the default values initialized. +func NewFindConfigExperimentalParams() *FindConfigExperimentalParams { + + return &FindConfigExperimentalParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigExperimentalParamsWithTimeout creates a new FindConfigExperimentalParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigExperimentalParamsWithTimeout(timeout time.Duration) *FindConfigExperimentalParams { + + return &FindConfigExperimentalParams{ + + timeout: timeout, + } +} + +// NewFindConfigExperimentalParamsWithContext creates a new FindConfigExperimentalParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigExperimentalParamsWithContext(ctx context.Context) *FindConfigExperimentalParams { + + return &FindConfigExperimentalParams{ + + Context: ctx, + } +} + +// NewFindConfigExperimentalParamsWithHTTPClient creates a new FindConfigExperimentalParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigExperimentalParamsWithHTTPClient(client *http.Client) *FindConfigExperimentalParams { + + return &FindConfigExperimentalParams{ + HTTPClient: client, + } +} + +/* +FindConfigExperimentalParams contains all the parameters to send to the API endpoint +for the find config experimental operation typically these are written to a http.Request +*/ +type FindConfigExperimentalParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config experimental params +func (o *FindConfigExperimentalParams) WithTimeout(timeout time.Duration) *FindConfigExperimentalParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config experimental params +func (o *FindConfigExperimentalParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config experimental params +func (o *FindConfigExperimentalParams) WithContext(ctx context.Context) *FindConfigExperimentalParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config experimental params +func (o *FindConfigExperimentalParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config experimental params +func (o *FindConfigExperimentalParams) WithHTTPClient(client *http.Client) *FindConfigExperimentalParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config experimental params +func (o *FindConfigExperimentalParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigExperimentalParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_experimental_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_experimental_responses.go new file mode 100644 index 0000000000..25e785cba6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_experimental_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigExperimentalReader is a Reader for the FindConfigExperimental structure. +type FindConfigExperimentalReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigExperimentalReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigExperimentalOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigExperimentalDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigExperimentalOK creates a FindConfigExperimentalOK with default headers values +func NewFindConfigExperimentalOK() *FindConfigExperimentalOK { + return &FindConfigExperimentalOK{} +} + +/* +FindConfigExperimentalOK handles this case with default header values. + +Config value +*/ +type FindConfigExperimentalOK struct { + Payload bool +} + +func (o *FindConfigExperimentalOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigExperimentalOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigExperimentalDefault creates a FindConfigExperimentalDefault with default headers values +func NewFindConfigExperimentalDefault(code int) *FindConfigExperimentalDefault { + return &FindConfigExperimentalDefault{ + _statusCode: code, + } +} + +/* +FindConfigExperimentalDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigExperimentalDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config experimental default response +func (o *FindConfigExperimentalDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigExperimentalDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigExperimentalDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigExperimentalDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_fd_initial_value_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_fd_initial_value_ms_parameters.go new file mode 100644 index 0000000000..2ddd1e7377 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_fd_initial_value_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigFdInitialValueMsParams creates a new FindConfigFdInitialValueMsParams object +// with the default values initialized. +func NewFindConfigFdInitialValueMsParams() *FindConfigFdInitialValueMsParams { + + return &FindConfigFdInitialValueMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigFdInitialValueMsParamsWithTimeout creates a new FindConfigFdInitialValueMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigFdInitialValueMsParamsWithTimeout(timeout time.Duration) *FindConfigFdInitialValueMsParams { + + return &FindConfigFdInitialValueMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigFdInitialValueMsParamsWithContext creates a new FindConfigFdInitialValueMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigFdInitialValueMsParamsWithContext(ctx context.Context) *FindConfigFdInitialValueMsParams { + + return &FindConfigFdInitialValueMsParams{ + + Context: ctx, + } +} + +// NewFindConfigFdInitialValueMsParamsWithHTTPClient creates a new FindConfigFdInitialValueMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigFdInitialValueMsParamsWithHTTPClient(client *http.Client) *FindConfigFdInitialValueMsParams { + + return &FindConfigFdInitialValueMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigFdInitialValueMsParams contains all the parameters to send to the API endpoint +for the find config fd initial value ms operation typically these are written to a http.Request +*/ +type FindConfigFdInitialValueMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config fd initial value ms params +func (o *FindConfigFdInitialValueMsParams) WithTimeout(timeout time.Duration) *FindConfigFdInitialValueMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config fd initial value ms params +func (o *FindConfigFdInitialValueMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config fd initial value ms params +func (o *FindConfigFdInitialValueMsParams) WithContext(ctx context.Context) *FindConfigFdInitialValueMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config fd initial value ms params +func (o *FindConfigFdInitialValueMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config fd initial value ms params +func (o *FindConfigFdInitialValueMsParams) WithHTTPClient(client *http.Client) *FindConfigFdInitialValueMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config fd initial value ms params +func (o *FindConfigFdInitialValueMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigFdInitialValueMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_fd_initial_value_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_fd_initial_value_ms_responses.go new file mode 100644 index 0000000000..f9aab81d6d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_fd_initial_value_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigFdInitialValueMsReader is a Reader for the FindConfigFdInitialValueMs structure. +type FindConfigFdInitialValueMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigFdInitialValueMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigFdInitialValueMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigFdInitialValueMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigFdInitialValueMsOK creates a FindConfigFdInitialValueMsOK with default headers values +func NewFindConfigFdInitialValueMsOK() *FindConfigFdInitialValueMsOK { + return &FindConfigFdInitialValueMsOK{} +} + +/* +FindConfigFdInitialValueMsOK handles this case with default header values. + +Config value +*/ +type FindConfigFdInitialValueMsOK struct { + Payload int64 +} + +func (o *FindConfigFdInitialValueMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigFdInitialValueMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigFdInitialValueMsDefault creates a FindConfigFdInitialValueMsDefault with default headers values +func NewFindConfigFdInitialValueMsDefault(code int) *FindConfigFdInitialValueMsDefault { + return &FindConfigFdInitialValueMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigFdInitialValueMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigFdInitialValueMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config fd initial value ms default response +func (o *FindConfigFdInitialValueMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigFdInitialValueMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigFdInitialValueMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigFdInitialValueMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_fd_max_interval_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_fd_max_interval_ms_parameters.go new file mode 100644 index 0000000000..2c2734af59 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_fd_max_interval_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigFdMaxIntervalMsParams creates a new FindConfigFdMaxIntervalMsParams object +// with the default values initialized. +func NewFindConfigFdMaxIntervalMsParams() *FindConfigFdMaxIntervalMsParams { + + return &FindConfigFdMaxIntervalMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigFdMaxIntervalMsParamsWithTimeout creates a new FindConfigFdMaxIntervalMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigFdMaxIntervalMsParamsWithTimeout(timeout time.Duration) *FindConfigFdMaxIntervalMsParams { + + return &FindConfigFdMaxIntervalMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigFdMaxIntervalMsParamsWithContext creates a new FindConfigFdMaxIntervalMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigFdMaxIntervalMsParamsWithContext(ctx context.Context) *FindConfigFdMaxIntervalMsParams { + + return &FindConfigFdMaxIntervalMsParams{ + + Context: ctx, + } +} + +// NewFindConfigFdMaxIntervalMsParamsWithHTTPClient creates a new FindConfigFdMaxIntervalMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigFdMaxIntervalMsParamsWithHTTPClient(client *http.Client) *FindConfigFdMaxIntervalMsParams { + + return &FindConfigFdMaxIntervalMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigFdMaxIntervalMsParams contains all the parameters to send to the API endpoint +for the find config fd max interval ms operation typically these are written to a http.Request +*/ +type FindConfigFdMaxIntervalMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config fd max interval ms params +func (o *FindConfigFdMaxIntervalMsParams) WithTimeout(timeout time.Duration) *FindConfigFdMaxIntervalMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config fd max interval ms params +func (o *FindConfigFdMaxIntervalMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config fd max interval ms params +func (o *FindConfigFdMaxIntervalMsParams) WithContext(ctx context.Context) *FindConfigFdMaxIntervalMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config fd max interval ms params +func (o *FindConfigFdMaxIntervalMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config fd max interval ms params +func (o *FindConfigFdMaxIntervalMsParams) WithHTTPClient(client *http.Client) *FindConfigFdMaxIntervalMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config fd max interval ms params +func (o *FindConfigFdMaxIntervalMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigFdMaxIntervalMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_fd_max_interval_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_fd_max_interval_ms_responses.go new file mode 100644 index 0000000000..16ef3ee647 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_fd_max_interval_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigFdMaxIntervalMsReader is a Reader for the FindConfigFdMaxIntervalMs structure. +type FindConfigFdMaxIntervalMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigFdMaxIntervalMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigFdMaxIntervalMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigFdMaxIntervalMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigFdMaxIntervalMsOK creates a FindConfigFdMaxIntervalMsOK with default headers values +func NewFindConfigFdMaxIntervalMsOK() *FindConfigFdMaxIntervalMsOK { + return &FindConfigFdMaxIntervalMsOK{} +} + +/* +FindConfigFdMaxIntervalMsOK handles this case with default header values. + +Config value +*/ +type FindConfigFdMaxIntervalMsOK struct { + Payload int64 +} + +func (o *FindConfigFdMaxIntervalMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigFdMaxIntervalMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigFdMaxIntervalMsDefault creates a FindConfigFdMaxIntervalMsDefault with default headers values +func NewFindConfigFdMaxIntervalMsDefault(code int) *FindConfigFdMaxIntervalMsDefault { + return &FindConfigFdMaxIntervalMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigFdMaxIntervalMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigFdMaxIntervalMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config fd max interval ms default response +func (o *FindConfigFdMaxIntervalMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigFdMaxIntervalMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigFdMaxIntervalMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigFdMaxIntervalMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_file_cache_size_in_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_file_cache_size_in_mb_parameters.go new file mode 100644 index 0000000000..b97422ad7d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_file_cache_size_in_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigFileCacheSizeInMbParams creates a new FindConfigFileCacheSizeInMbParams object +// with the default values initialized. +func NewFindConfigFileCacheSizeInMbParams() *FindConfigFileCacheSizeInMbParams { + + return &FindConfigFileCacheSizeInMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigFileCacheSizeInMbParamsWithTimeout creates a new FindConfigFileCacheSizeInMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigFileCacheSizeInMbParamsWithTimeout(timeout time.Duration) *FindConfigFileCacheSizeInMbParams { + + return &FindConfigFileCacheSizeInMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigFileCacheSizeInMbParamsWithContext creates a new FindConfigFileCacheSizeInMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigFileCacheSizeInMbParamsWithContext(ctx context.Context) *FindConfigFileCacheSizeInMbParams { + + return &FindConfigFileCacheSizeInMbParams{ + + Context: ctx, + } +} + +// NewFindConfigFileCacheSizeInMbParamsWithHTTPClient creates a new FindConfigFileCacheSizeInMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigFileCacheSizeInMbParamsWithHTTPClient(client *http.Client) *FindConfigFileCacheSizeInMbParams { + + return &FindConfigFileCacheSizeInMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigFileCacheSizeInMbParams contains all the parameters to send to the API endpoint +for the find config file cache size in mb operation typically these are written to a http.Request +*/ +type FindConfigFileCacheSizeInMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config file cache size in mb params +func (o *FindConfigFileCacheSizeInMbParams) WithTimeout(timeout time.Duration) *FindConfigFileCacheSizeInMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config file cache size in mb params +func (o *FindConfigFileCacheSizeInMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config file cache size in mb params +func (o *FindConfigFileCacheSizeInMbParams) WithContext(ctx context.Context) *FindConfigFileCacheSizeInMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config file cache size in mb params +func (o *FindConfigFileCacheSizeInMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config file cache size in mb params +func (o *FindConfigFileCacheSizeInMbParams) WithHTTPClient(client *http.Client) *FindConfigFileCacheSizeInMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config file cache size in mb params +func (o *FindConfigFileCacheSizeInMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigFileCacheSizeInMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_file_cache_size_in_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_file_cache_size_in_mb_responses.go new file mode 100644 index 0000000000..1510462707 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_file_cache_size_in_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigFileCacheSizeInMbReader is a Reader for the FindConfigFileCacheSizeInMb structure. +type FindConfigFileCacheSizeInMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigFileCacheSizeInMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigFileCacheSizeInMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigFileCacheSizeInMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigFileCacheSizeInMbOK creates a FindConfigFileCacheSizeInMbOK with default headers values +func NewFindConfigFileCacheSizeInMbOK() *FindConfigFileCacheSizeInMbOK { + return &FindConfigFileCacheSizeInMbOK{} +} + +/* +FindConfigFileCacheSizeInMbOK handles this case with default header values. + +Config value +*/ +type FindConfigFileCacheSizeInMbOK struct { + Payload int64 +} + +func (o *FindConfigFileCacheSizeInMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigFileCacheSizeInMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigFileCacheSizeInMbDefault creates a FindConfigFileCacheSizeInMbDefault with default headers values +func NewFindConfigFileCacheSizeInMbDefault(code int) *FindConfigFileCacheSizeInMbDefault { + return &FindConfigFileCacheSizeInMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigFileCacheSizeInMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigFileCacheSizeInMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config file cache size in mb default response +func (o *FindConfigFileCacheSizeInMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigFileCacheSizeInMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigFileCacheSizeInMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigFileCacheSizeInMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hinted_handoff_enabled_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hinted_handoff_enabled_parameters.go new file mode 100644 index 0000000000..85fed76ebd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hinted_handoff_enabled_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigHintedHandoffEnabledParams creates a new FindConfigHintedHandoffEnabledParams object +// with the default values initialized. +func NewFindConfigHintedHandoffEnabledParams() *FindConfigHintedHandoffEnabledParams { + + return &FindConfigHintedHandoffEnabledParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigHintedHandoffEnabledParamsWithTimeout creates a new FindConfigHintedHandoffEnabledParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigHintedHandoffEnabledParamsWithTimeout(timeout time.Duration) *FindConfigHintedHandoffEnabledParams { + + return &FindConfigHintedHandoffEnabledParams{ + + timeout: timeout, + } +} + +// NewFindConfigHintedHandoffEnabledParamsWithContext creates a new FindConfigHintedHandoffEnabledParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigHintedHandoffEnabledParamsWithContext(ctx context.Context) *FindConfigHintedHandoffEnabledParams { + + return &FindConfigHintedHandoffEnabledParams{ + + Context: ctx, + } +} + +// NewFindConfigHintedHandoffEnabledParamsWithHTTPClient creates a new FindConfigHintedHandoffEnabledParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigHintedHandoffEnabledParamsWithHTTPClient(client *http.Client) *FindConfigHintedHandoffEnabledParams { + + return &FindConfigHintedHandoffEnabledParams{ + HTTPClient: client, + } +} + +/* +FindConfigHintedHandoffEnabledParams contains all the parameters to send to the API endpoint +for the find config hinted handoff enabled operation typically these are written to a http.Request +*/ +type FindConfigHintedHandoffEnabledParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config hinted handoff enabled params +func (o *FindConfigHintedHandoffEnabledParams) WithTimeout(timeout time.Duration) *FindConfigHintedHandoffEnabledParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config hinted handoff enabled params +func (o *FindConfigHintedHandoffEnabledParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config hinted handoff enabled params +func (o *FindConfigHintedHandoffEnabledParams) WithContext(ctx context.Context) *FindConfigHintedHandoffEnabledParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config hinted handoff enabled params +func (o *FindConfigHintedHandoffEnabledParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config hinted handoff enabled params +func (o *FindConfigHintedHandoffEnabledParams) WithHTTPClient(client *http.Client) *FindConfigHintedHandoffEnabledParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config hinted handoff enabled params +func (o *FindConfigHintedHandoffEnabledParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigHintedHandoffEnabledParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hinted_handoff_enabled_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hinted_handoff_enabled_responses.go new file mode 100644 index 0000000000..9e228552b0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hinted_handoff_enabled_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigHintedHandoffEnabledReader is a Reader for the FindConfigHintedHandoffEnabled structure. +type FindConfigHintedHandoffEnabledReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigHintedHandoffEnabledReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigHintedHandoffEnabledOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigHintedHandoffEnabledDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigHintedHandoffEnabledOK creates a FindConfigHintedHandoffEnabledOK with default headers values +func NewFindConfigHintedHandoffEnabledOK() *FindConfigHintedHandoffEnabledOK { + return &FindConfigHintedHandoffEnabledOK{} +} + +/* +FindConfigHintedHandoffEnabledOK handles this case with default header values. + +Config value +*/ +type FindConfigHintedHandoffEnabledOK struct { + Payload string +} + +func (o *FindConfigHintedHandoffEnabledOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigHintedHandoffEnabledOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigHintedHandoffEnabledDefault creates a FindConfigHintedHandoffEnabledDefault with default headers values +func NewFindConfigHintedHandoffEnabledDefault(code int) *FindConfigHintedHandoffEnabledDefault { + return &FindConfigHintedHandoffEnabledDefault{ + _statusCode: code, + } +} + +/* +FindConfigHintedHandoffEnabledDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigHintedHandoffEnabledDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config hinted handoff enabled default response +func (o *FindConfigHintedHandoffEnabledDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigHintedHandoffEnabledDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigHintedHandoffEnabledDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigHintedHandoffEnabledDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hinted_handoff_throttle_in_kb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hinted_handoff_throttle_in_kb_parameters.go new file mode 100644 index 0000000000..f87c75fc8f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hinted_handoff_throttle_in_kb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigHintedHandoffThrottleInKbParams creates a new FindConfigHintedHandoffThrottleInKbParams object +// with the default values initialized. +func NewFindConfigHintedHandoffThrottleInKbParams() *FindConfigHintedHandoffThrottleInKbParams { + + return &FindConfigHintedHandoffThrottleInKbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigHintedHandoffThrottleInKbParamsWithTimeout creates a new FindConfigHintedHandoffThrottleInKbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigHintedHandoffThrottleInKbParamsWithTimeout(timeout time.Duration) *FindConfigHintedHandoffThrottleInKbParams { + + return &FindConfigHintedHandoffThrottleInKbParams{ + + timeout: timeout, + } +} + +// NewFindConfigHintedHandoffThrottleInKbParamsWithContext creates a new FindConfigHintedHandoffThrottleInKbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigHintedHandoffThrottleInKbParamsWithContext(ctx context.Context) *FindConfigHintedHandoffThrottleInKbParams { + + return &FindConfigHintedHandoffThrottleInKbParams{ + + Context: ctx, + } +} + +// NewFindConfigHintedHandoffThrottleInKbParamsWithHTTPClient creates a new FindConfigHintedHandoffThrottleInKbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigHintedHandoffThrottleInKbParamsWithHTTPClient(client *http.Client) *FindConfigHintedHandoffThrottleInKbParams { + + return &FindConfigHintedHandoffThrottleInKbParams{ + HTTPClient: client, + } +} + +/* +FindConfigHintedHandoffThrottleInKbParams contains all the parameters to send to the API endpoint +for the find config hinted handoff throttle in kb operation typically these are written to a http.Request +*/ +type FindConfigHintedHandoffThrottleInKbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config hinted handoff throttle in kb params +func (o *FindConfigHintedHandoffThrottleInKbParams) WithTimeout(timeout time.Duration) *FindConfigHintedHandoffThrottleInKbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config hinted handoff throttle in kb params +func (o *FindConfigHintedHandoffThrottleInKbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config hinted handoff throttle in kb params +func (o *FindConfigHintedHandoffThrottleInKbParams) WithContext(ctx context.Context) *FindConfigHintedHandoffThrottleInKbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config hinted handoff throttle in kb params +func (o *FindConfigHintedHandoffThrottleInKbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config hinted handoff throttle in kb params +func (o *FindConfigHintedHandoffThrottleInKbParams) WithHTTPClient(client *http.Client) *FindConfigHintedHandoffThrottleInKbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config hinted handoff throttle in kb params +func (o *FindConfigHintedHandoffThrottleInKbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigHintedHandoffThrottleInKbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hinted_handoff_throttle_in_kb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hinted_handoff_throttle_in_kb_responses.go new file mode 100644 index 0000000000..30bc8094a2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hinted_handoff_throttle_in_kb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigHintedHandoffThrottleInKbReader is a Reader for the FindConfigHintedHandoffThrottleInKb structure. +type FindConfigHintedHandoffThrottleInKbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigHintedHandoffThrottleInKbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigHintedHandoffThrottleInKbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigHintedHandoffThrottleInKbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigHintedHandoffThrottleInKbOK creates a FindConfigHintedHandoffThrottleInKbOK with default headers values +func NewFindConfigHintedHandoffThrottleInKbOK() *FindConfigHintedHandoffThrottleInKbOK { + return &FindConfigHintedHandoffThrottleInKbOK{} +} + +/* +FindConfigHintedHandoffThrottleInKbOK handles this case with default header values. + +Config value +*/ +type FindConfigHintedHandoffThrottleInKbOK struct { + Payload int64 +} + +func (o *FindConfigHintedHandoffThrottleInKbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigHintedHandoffThrottleInKbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigHintedHandoffThrottleInKbDefault creates a FindConfigHintedHandoffThrottleInKbDefault with default headers values +func NewFindConfigHintedHandoffThrottleInKbDefault(code int) *FindConfigHintedHandoffThrottleInKbDefault { + return &FindConfigHintedHandoffThrottleInKbDefault{ + _statusCode: code, + } +} + +/* +FindConfigHintedHandoffThrottleInKbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigHintedHandoffThrottleInKbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config hinted handoff throttle in kb default response +func (o *FindConfigHintedHandoffThrottleInKbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigHintedHandoffThrottleInKbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigHintedHandoffThrottleInKbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigHintedHandoffThrottleInKbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hints_directory_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hints_directory_parameters.go new file mode 100644 index 0000000000..ef3bf712fd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hints_directory_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigHintsDirectoryParams creates a new FindConfigHintsDirectoryParams object +// with the default values initialized. +func NewFindConfigHintsDirectoryParams() *FindConfigHintsDirectoryParams { + + return &FindConfigHintsDirectoryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigHintsDirectoryParamsWithTimeout creates a new FindConfigHintsDirectoryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigHintsDirectoryParamsWithTimeout(timeout time.Duration) *FindConfigHintsDirectoryParams { + + return &FindConfigHintsDirectoryParams{ + + timeout: timeout, + } +} + +// NewFindConfigHintsDirectoryParamsWithContext creates a new FindConfigHintsDirectoryParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigHintsDirectoryParamsWithContext(ctx context.Context) *FindConfigHintsDirectoryParams { + + return &FindConfigHintsDirectoryParams{ + + Context: ctx, + } +} + +// NewFindConfigHintsDirectoryParamsWithHTTPClient creates a new FindConfigHintsDirectoryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigHintsDirectoryParamsWithHTTPClient(client *http.Client) *FindConfigHintsDirectoryParams { + + return &FindConfigHintsDirectoryParams{ + HTTPClient: client, + } +} + +/* +FindConfigHintsDirectoryParams contains all the parameters to send to the API endpoint +for the find config hints directory operation typically these are written to a http.Request +*/ +type FindConfigHintsDirectoryParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config hints directory params +func (o *FindConfigHintsDirectoryParams) WithTimeout(timeout time.Duration) *FindConfigHintsDirectoryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config hints directory params +func (o *FindConfigHintsDirectoryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config hints directory params +func (o *FindConfigHintsDirectoryParams) WithContext(ctx context.Context) *FindConfigHintsDirectoryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config hints directory params +func (o *FindConfigHintsDirectoryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config hints directory params +func (o *FindConfigHintsDirectoryParams) WithHTTPClient(client *http.Client) *FindConfigHintsDirectoryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config hints directory params +func (o *FindConfigHintsDirectoryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigHintsDirectoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hints_directory_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hints_directory_responses.go new file mode 100644 index 0000000000..864679aad7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_hints_directory_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigHintsDirectoryReader is a Reader for the FindConfigHintsDirectory structure. +type FindConfigHintsDirectoryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigHintsDirectoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigHintsDirectoryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigHintsDirectoryDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigHintsDirectoryOK creates a FindConfigHintsDirectoryOK with default headers values +func NewFindConfigHintsDirectoryOK() *FindConfigHintsDirectoryOK { + return &FindConfigHintsDirectoryOK{} +} + +/* +FindConfigHintsDirectoryOK handles this case with default header values. + +Config value +*/ +type FindConfigHintsDirectoryOK struct { + Payload string +} + +func (o *FindConfigHintsDirectoryOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigHintsDirectoryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigHintsDirectoryDefault creates a FindConfigHintsDirectoryDefault with default headers values +func NewFindConfigHintsDirectoryDefault(code int) *FindConfigHintsDirectoryDefault { + return &FindConfigHintsDirectoryDefault{ + _statusCode: code, + } +} + +/* +FindConfigHintsDirectoryDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigHintsDirectoryDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config hints directory default response +func (o *FindConfigHintsDirectoryDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigHintsDirectoryDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigHintsDirectoryDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigHintsDirectoryDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_in_memory_compaction_limit_in_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_in_memory_compaction_limit_in_mb_parameters.go new file mode 100644 index 0000000000..c5ef4c8989 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_in_memory_compaction_limit_in_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigInMemoryCompactionLimitInMbParams creates a new FindConfigInMemoryCompactionLimitInMbParams object +// with the default values initialized. +func NewFindConfigInMemoryCompactionLimitInMbParams() *FindConfigInMemoryCompactionLimitInMbParams { + + return &FindConfigInMemoryCompactionLimitInMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigInMemoryCompactionLimitInMbParamsWithTimeout creates a new FindConfigInMemoryCompactionLimitInMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigInMemoryCompactionLimitInMbParamsWithTimeout(timeout time.Duration) *FindConfigInMemoryCompactionLimitInMbParams { + + return &FindConfigInMemoryCompactionLimitInMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigInMemoryCompactionLimitInMbParamsWithContext creates a new FindConfigInMemoryCompactionLimitInMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigInMemoryCompactionLimitInMbParamsWithContext(ctx context.Context) *FindConfigInMemoryCompactionLimitInMbParams { + + return &FindConfigInMemoryCompactionLimitInMbParams{ + + Context: ctx, + } +} + +// NewFindConfigInMemoryCompactionLimitInMbParamsWithHTTPClient creates a new FindConfigInMemoryCompactionLimitInMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigInMemoryCompactionLimitInMbParamsWithHTTPClient(client *http.Client) *FindConfigInMemoryCompactionLimitInMbParams { + + return &FindConfigInMemoryCompactionLimitInMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigInMemoryCompactionLimitInMbParams contains all the parameters to send to the API endpoint +for the find config in memory compaction limit in mb operation typically these are written to a http.Request +*/ +type FindConfigInMemoryCompactionLimitInMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config in memory compaction limit in mb params +func (o *FindConfigInMemoryCompactionLimitInMbParams) WithTimeout(timeout time.Duration) *FindConfigInMemoryCompactionLimitInMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config in memory compaction limit in mb params +func (o *FindConfigInMemoryCompactionLimitInMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config in memory compaction limit in mb params +func (o *FindConfigInMemoryCompactionLimitInMbParams) WithContext(ctx context.Context) *FindConfigInMemoryCompactionLimitInMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config in memory compaction limit in mb params +func (o *FindConfigInMemoryCompactionLimitInMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config in memory compaction limit in mb params +func (o *FindConfigInMemoryCompactionLimitInMbParams) WithHTTPClient(client *http.Client) *FindConfigInMemoryCompactionLimitInMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config in memory compaction limit in mb params +func (o *FindConfigInMemoryCompactionLimitInMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigInMemoryCompactionLimitInMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_in_memory_compaction_limit_in_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_in_memory_compaction_limit_in_mb_responses.go new file mode 100644 index 0000000000..6e22d0225c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_in_memory_compaction_limit_in_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigInMemoryCompactionLimitInMbReader is a Reader for the FindConfigInMemoryCompactionLimitInMb structure. +type FindConfigInMemoryCompactionLimitInMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigInMemoryCompactionLimitInMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigInMemoryCompactionLimitInMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigInMemoryCompactionLimitInMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigInMemoryCompactionLimitInMbOK creates a FindConfigInMemoryCompactionLimitInMbOK with default headers values +func NewFindConfigInMemoryCompactionLimitInMbOK() *FindConfigInMemoryCompactionLimitInMbOK { + return &FindConfigInMemoryCompactionLimitInMbOK{} +} + +/* +FindConfigInMemoryCompactionLimitInMbOK handles this case with default header values. + +Config value +*/ +type FindConfigInMemoryCompactionLimitInMbOK struct { + Payload int64 +} + +func (o *FindConfigInMemoryCompactionLimitInMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigInMemoryCompactionLimitInMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigInMemoryCompactionLimitInMbDefault creates a FindConfigInMemoryCompactionLimitInMbDefault with default headers values +func NewFindConfigInMemoryCompactionLimitInMbDefault(code int) *FindConfigInMemoryCompactionLimitInMbDefault { + return &FindConfigInMemoryCompactionLimitInMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigInMemoryCompactionLimitInMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigInMemoryCompactionLimitInMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config in memory compaction limit in mb default response +func (o *FindConfigInMemoryCompactionLimitInMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigInMemoryCompactionLimitInMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigInMemoryCompactionLimitInMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigInMemoryCompactionLimitInMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_incremental_backups_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_incremental_backups_parameters.go new file mode 100644 index 0000000000..b55f93f0a5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_incremental_backups_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigIncrementalBackupsParams creates a new FindConfigIncrementalBackupsParams object +// with the default values initialized. +func NewFindConfigIncrementalBackupsParams() *FindConfigIncrementalBackupsParams { + + return &FindConfigIncrementalBackupsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigIncrementalBackupsParamsWithTimeout creates a new FindConfigIncrementalBackupsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigIncrementalBackupsParamsWithTimeout(timeout time.Duration) *FindConfigIncrementalBackupsParams { + + return &FindConfigIncrementalBackupsParams{ + + timeout: timeout, + } +} + +// NewFindConfigIncrementalBackupsParamsWithContext creates a new FindConfigIncrementalBackupsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigIncrementalBackupsParamsWithContext(ctx context.Context) *FindConfigIncrementalBackupsParams { + + return &FindConfigIncrementalBackupsParams{ + + Context: ctx, + } +} + +// NewFindConfigIncrementalBackupsParamsWithHTTPClient creates a new FindConfigIncrementalBackupsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigIncrementalBackupsParamsWithHTTPClient(client *http.Client) *FindConfigIncrementalBackupsParams { + + return &FindConfigIncrementalBackupsParams{ + HTTPClient: client, + } +} + +/* +FindConfigIncrementalBackupsParams contains all the parameters to send to the API endpoint +for the find config incremental backups operation typically these are written to a http.Request +*/ +type FindConfigIncrementalBackupsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config incremental backups params +func (o *FindConfigIncrementalBackupsParams) WithTimeout(timeout time.Duration) *FindConfigIncrementalBackupsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config incremental backups params +func (o *FindConfigIncrementalBackupsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config incremental backups params +func (o *FindConfigIncrementalBackupsParams) WithContext(ctx context.Context) *FindConfigIncrementalBackupsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config incremental backups params +func (o *FindConfigIncrementalBackupsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config incremental backups params +func (o *FindConfigIncrementalBackupsParams) WithHTTPClient(client *http.Client) *FindConfigIncrementalBackupsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config incremental backups params +func (o *FindConfigIncrementalBackupsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigIncrementalBackupsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_incremental_backups_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_incremental_backups_responses.go new file mode 100644 index 0000000000..28e8d8f8a3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_incremental_backups_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigIncrementalBackupsReader is a Reader for the FindConfigIncrementalBackups structure. +type FindConfigIncrementalBackupsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigIncrementalBackupsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigIncrementalBackupsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigIncrementalBackupsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigIncrementalBackupsOK creates a FindConfigIncrementalBackupsOK with default headers values +func NewFindConfigIncrementalBackupsOK() *FindConfigIncrementalBackupsOK { + return &FindConfigIncrementalBackupsOK{} +} + +/* +FindConfigIncrementalBackupsOK handles this case with default header values. + +Config value +*/ +type FindConfigIncrementalBackupsOK struct { + Payload bool +} + +func (o *FindConfigIncrementalBackupsOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigIncrementalBackupsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigIncrementalBackupsDefault creates a FindConfigIncrementalBackupsDefault with default headers values +func NewFindConfigIncrementalBackupsDefault(code int) *FindConfigIncrementalBackupsDefault { + return &FindConfigIncrementalBackupsDefault{ + _statusCode: code, + } +} + +/* +FindConfigIncrementalBackupsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigIncrementalBackupsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config incremental backups default response +func (o *FindConfigIncrementalBackupsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigIncrementalBackupsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigIncrementalBackupsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigIncrementalBackupsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_index_summary_capacity_in_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_index_summary_capacity_in_mb_parameters.go new file mode 100644 index 0000000000..c49cb4e6e7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_index_summary_capacity_in_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigIndexSummaryCapacityInMbParams creates a new FindConfigIndexSummaryCapacityInMbParams object +// with the default values initialized. +func NewFindConfigIndexSummaryCapacityInMbParams() *FindConfigIndexSummaryCapacityInMbParams { + + return &FindConfigIndexSummaryCapacityInMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigIndexSummaryCapacityInMbParamsWithTimeout creates a new FindConfigIndexSummaryCapacityInMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigIndexSummaryCapacityInMbParamsWithTimeout(timeout time.Duration) *FindConfigIndexSummaryCapacityInMbParams { + + return &FindConfigIndexSummaryCapacityInMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigIndexSummaryCapacityInMbParamsWithContext creates a new FindConfigIndexSummaryCapacityInMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigIndexSummaryCapacityInMbParamsWithContext(ctx context.Context) *FindConfigIndexSummaryCapacityInMbParams { + + return &FindConfigIndexSummaryCapacityInMbParams{ + + Context: ctx, + } +} + +// NewFindConfigIndexSummaryCapacityInMbParamsWithHTTPClient creates a new FindConfigIndexSummaryCapacityInMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigIndexSummaryCapacityInMbParamsWithHTTPClient(client *http.Client) *FindConfigIndexSummaryCapacityInMbParams { + + return &FindConfigIndexSummaryCapacityInMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigIndexSummaryCapacityInMbParams contains all the parameters to send to the API endpoint +for the find config index summary capacity in mb operation typically these are written to a http.Request +*/ +type FindConfigIndexSummaryCapacityInMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config index summary capacity in mb params +func (o *FindConfigIndexSummaryCapacityInMbParams) WithTimeout(timeout time.Duration) *FindConfigIndexSummaryCapacityInMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config index summary capacity in mb params +func (o *FindConfigIndexSummaryCapacityInMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config index summary capacity in mb params +func (o *FindConfigIndexSummaryCapacityInMbParams) WithContext(ctx context.Context) *FindConfigIndexSummaryCapacityInMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config index summary capacity in mb params +func (o *FindConfigIndexSummaryCapacityInMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config index summary capacity in mb params +func (o *FindConfigIndexSummaryCapacityInMbParams) WithHTTPClient(client *http.Client) *FindConfigIndexSummaryCapacityInMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config index summary capacity in mb params +func (o *FindConfigIndexSummaryCapacityInMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigIndexSummaryCapacityInMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_index_summary_capacity_in_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_index_summary_capacity_in_mb_responses.go new file mode 100644 index 0000000000..d6d6e40fc3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_index_summary_capacity_in_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigIndexSummaryCapacityInMbReader is a Reader for the FindConfigIndexSummaryCapacityInMb structure. +type FindConfigIndexSummaryCapacityInMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigIndexSummaryCapacityInMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigIndexSummaryCapacityInMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigIndexSummaryCapacityInMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigIndexSummaryCapacityInMbOK creates a FindConfigIndexSummaryCapacityInMbOK with default headers values +func NewFindConfigIndexSummaryCapacityInMbOK() *FindConfigIndexSummaryCapacityInMbOK { + return &FindConfigIndexSummaryCapacityInMbOK{} +} + +/* +FindConfigIndexSummaryCapacityInMbOK handles this case with default header values. + +Config value +*/ +type FindConfigIndexSummaryCapacityInMbOK struct { + Payload int64 +} + +func (o *FindConfigIndexSummaryCapacityInMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigIndexSummaryCapacityInMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigIndexSummaryCapacityInMbDefault creates a FindConfigIndexSummaryCapacityInMbDefault with default headers values +func NewFindConfigIndexSummaryCapacityInMbDefault(code int) *FindConfigIndexSummaryCapacityInMbDefault { + return &FindConfigIndexSummaryCapacityInMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigIndexSummaryCapacityInMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigIndexSummaryCapacityInMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config index summary capacity in mb default response +func (o *FindConfigIndexSummaryCapacityInMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigIndexSummaryCapacityInMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigIndexSummaryCapacityInMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigIndexSummaryCapacityInMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_index_summary_resize_interval_in_minutes_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_index_summary_resize_interval_in_minutes_parameters.go new file mode 100644 index 0000000000..f038617ef9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_index_summary_resize_interval_in_minutes_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigIndexSummaryResizeIntervalInMinutesParams creates a new FindConfigIndexSummaryResizeIntervalInMinutesParams object +// with the default values initialized. +func NewFindConfigIndexSummaryResizeIntervalInMinutesParams() *FindConfigIndexSummaryResizeIntervalInMinutesParams { + + return &FindConfigIndexSummaryResizeIntervalInMinutesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigIndexSummaryResizeIntervalInMinutesParamsWithTimeout creates a new FindConfigIndexSummaryResizeIntervalInMinutesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigIndexSummaryResizeIntervalInMinutesParamsWithTimeout(timeout time.Duration) *FindConfigIndexSummaryResizeIntervalInMinutesParams { + + return &FindConfigIndexSummaryResizeIntervalInMinutesParams{ + + timeout: timeout, + } +} + +// NewFindConfigIndexSummaryResizeIntervalInMinutesParamsWithContext creates a new FindConfigIndexSummaryResizeIntervalInMinutesParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigIndexSummaryResizeIntervalInMinutesParamsWithContext(ctx context.Context) *FindConfigIndexSummaryResizeIntervalInMinutesParams { + + return &FindConfigIndexSummaryResizeIntervalInMinutesParams{ + + Context: ctx, + } +} + +// NewFindConfigIndexSummaryResizeIntervalInMinutesParamsWithHTTPClient creates a new FindConfigIndexSummaryResizeIntervalInMinutesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigIndexSummaryResizeIntervalInMinutesParamsWithHTTPClient(client *http.Client) *FindConfigIndexSummaryResizeIntervalInMinutesParams { + + return &FindConfigIndexSummaryResizeIntervalInMinutesParams{ + HTTPClient: client, + } +} + +/* +FindConfigIndexSummaryResizeIntervalInMinutesParams contains all the parameters to send to the API endpoint +for the find config index summary resize interval in minutes operation typically these are written to a http.Request +*/ +type FindConfigIndexSummaryResizeIntervalInMinutesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config index summary resize interval in minutes params +func (o *FindConfigIndexSummaryResizeIntervalInMinutesParams) WithTimeout(timeout time.Duration) *FindConfigIndexSummaryResizeIntervalInMinutesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config index summary resize interval in minutes params +func (o *FindConfigIndexSummaryResizeIntervalInMinutesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config index summary resize interval in minutes params +func (o *FindConfigIndexSummaryResizeIntervalInMinutesParams) WithContext(ctx context.Context) *FindConfigIndexSummaryResizeIntervalInMinutesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config index summary resize interval in minutes params +func (o *FindConfigIndexSummaryResizeIntervalInMinutesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config index summary resize interval in minutes params +func (o *FindConfigIndexSummaryResizeIntervalInMinutesParams) WithHTTPClient(client *http.Client) *FindConfigIndexSummaryResizeIntervalInMinutesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config index summary resize interval in minutes params +func (o *FindConfigIndexSummaryResizeIntervalInMinutesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigIndexSummaryResizeIntervalInMinutesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_index_summary_resize_interval_in_minutes_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_index_summary_resize_interval_in_minutes_responses.go new file mode 100644 index 0000000000..e15812013d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_index_summary_resize_interval_in_minutes_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigIndexSummaryResizeIntervalInMinutesReader is a Reader for the FindConfigIndexSummaryResizeIntervalInMinutes structure. +type FindConfigIndexSummaryResizeIntervalInMinutesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigIndexSummaryResizeIntervalInMinutesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigIndexSummaryResizeIntervalInMinutesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigIndexSummaryResizeIntervalInMinutesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigIndexSummaryResizeIntervalInMinutesOK creates a FindConfigIndexSummaryResizeIntervalInMinutesOK with default headers values +func NewFindConfigIndexSummaryResizeIntervalInMinutesOK() *FindConfigIndexSummaryResizeIntervalInMinutesOK { + return &FindConfigIndexSummaryResizeIntervalInMinutesOK{} +} + +/* +FindConfigIndexSummaryResizeIntervalInMinutesOK handles this case with default header values. + +Config value +*/ +type FindConfigIndexSummaryResizeIntervalInMinutesOK struct { + Payload int64 +} + +func (o *FindConfigIndexSummaryResizeIntervalInMinutesOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigIndexSummaryResizeIntervalInMinutesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigIndexSummaryResizeIntervalInMinutesDefault creates a FindConfigIndexSummaryResizeIntervalInMinutesDefault with default headers values +func NewFindConfigIndexSummaryResizeIntervalInMinutesDefault(code int) *FindConfigIndexSummaryResizeIntervalInMinutesDefault { + return &FindConfigIndexSummaryResizeIntervalInMinutesDefault{ + _statusCode: code, + } +} + +/* +FindConfigIndexSummaryResizeIntervalInMinutesDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigIndexSummaryResizeIntervalInMinutesDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config index summary resize interval in minutes default response +func (o *FindConfigIndexSummaryResizeIntervalInMinutesDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigIndexSummaryResizeIntervalInMinutesDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigIndexSummaryResizeIntervalInMinutesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigIndexSummaryResizeIntervalInMinutesDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_initial_token_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_initial_token_parameters.go new file mode 100644 index 0000000000..037ed28212 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_initial_token_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigInitialTokenParams creates a new FindConfigInitialTokenParams object +// with the default values initialized. +func NewFindConfigInitialTokenParams() *FindConfigInitialTokenParams { + + return &FindConfigInitialTokenParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigInitialTokenParamsWithTimeout creates a new FindConfigInitialTokenParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigInitialTokenParamsWithTimeout(timeout time.Duration) *FindConfigInitialTokenParams { + + return &FindConfigInitialTokenParams{ + + timeout: timeout, + } +} + +// NewFindConfigInitialTokenParamsWithContext creates a new FindConfigInitialTokenParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigInitialTokenParamsWithContext(ctx context.Context) *FindConfigInitialTokenParams { + + return &FindConfigInitialTokenParams{ + + Context: ctx, + } +} + +// NewFindConfigInitialTokenParamsWithHTTPClient creates a new FindConfigInitialTokenParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigInitialTokenParamsWithHTTPClient(client *http.Client) *FindConfigInitialTokenParams { + + return &FindConfigInitialTokenParams{ + HTTPClient: client, + } +} + +/* +FindConfigInitialTokenParams contains all the parameters to send to the API endpoint +for the find config initial token operation typically these are written to a http.Request +*/ +type FindConfigInitialTokenParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config initial token params +func (o *FindConfigInitialTokenParams) WithTimeout(timeout time.Duration) *FindConfigInitialTokenParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config initial token params +func (o *FindConfigInitialTokenParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config initial token params +func (o *FindConfigInitialTokenParams) WithContext(ctx context.Context) *FindConfigInitialTokenParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config initial token params +func (o *FindConfigInitialTokenParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config initial token params +func (o *FindConfigInitialTokenParams) WithHTTPClient(client *http.Client) *FindConfigInitialTokenParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config initial token params +func (o *FindConfigInitialTokenParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigInitialTokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_initial_token_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_initial_token_responses.go new file mode 100644 index 0000000000..f2ea2c7bc4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_initial_token_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigInitialTokenReader is a Reader for the FindConfigInitialToken structure. +type FindConfigInitialTokenReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigInitialTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigInitialTokenOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigInitialTokenDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigInitialTokenOK creates a FindConfigInitialTokenOK with default headers values +func NewFindConfigInitialTokenOK() *FindConfigInitialTokenOK { + return &FindConfigInitialTokenOK{} +} + +/* +FindConfigInitialTokenOK handles this case with default header values. + +Config value +*/ +type FindConfigInitialTokenOK struct { + Payload string +} + +func (o *FindConfigInitialTokenOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigInitialTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigInitialTokenDefault creates a FindConfigInitialTokenDefault with default headers values +func NewFindConfigInitialTokenDefault(code int) *FindConfigInitialTokenDefault { + return &FindConfigInitialTokenDefault{ + _statusCode: code, + } +} + +/* +FindConfigInitialTokenDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigInitialTokenDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config initial token default response +func (o *FindConfigInitialTokenDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigInitialTokenDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigInitialTokenDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigInitialTokenDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_inter_dc_stream_throughput_outbound_megabits_per_sec_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_inter_dc_stream_throughput_outbound_megabits_per_sec_parameters.go new file mode 100644 index 0000000000..8706a0ab78 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_inter_dc_stream_throughput_outbound_megabits_per_sec_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams creates a new FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams object +// with the default values initialized. +func NewFindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams() *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams { + + return &FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigInterDcStreamThroughputOutboundMegabitsPerSecParamsWithTimeout creates a new FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigInterDcStreamThroughputOutboundMegabitsPerSecParamsWithTimeout(timeout time.Duration) *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams { + + return &FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams{ + + timeout: timeout, + } +} + +// NewFindConfigInterDcStreamThroughputOutboundMegabitsPerSecParamsWithContext creates a new FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigInterDcStreamThroughputOutboundMegabitsPerSecParamsWithContext(ctx context.Context) *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams { + + return &FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams{ + + Context: ctx, + } +} + +// NewFindConfigInterDcStreamThroughputOutboundMegabitsPerSecParamsWithHTTPClient creates a new FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigInterDcStreamThroughputOutboundMegabitsPerSecParamsWithHTTPClient(client *http.Client) *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams { + + return &FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams{ + HTTPClient: client, + } +} + +/* +FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams contains all the parameters to send to the API endpoint +for the find config inter dc stream throughput outbound megabits per sec operation typically these are written to a http.Request +*/ +type FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config inter dc stream throughput outbound megabits per sec params +func (o *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams) WithTimeout(timeout time.Duration) *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config inter dc stream throughput outbound megabits per sec params +func (o *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config inter dc stream throughput outbound megabits per sec params +func (o *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams) WithContext(ctx context.Context) *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config inter dc stream throughput outbound megabits per sec params +func (o *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config inter dc stream throughput outbound megabits per sec params +func (o *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams) WithHTTPClient(client *http.Client) *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config inter dc stream throughput outbound megabits per sec params +func (o *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_inter_dc_stream_throughput_outbound_megabits_per_sec_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_inter_dc_stream_throughput_outbound_megabits_per_sec_responses.go new file mode 100644 index 0000000000..da132f051d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_inter_dc_stream_throughput_outbound_megabits_per_sec_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigInterDcStreamThroughputOutboundMegabitsPerSecReader is a Reader for the FindConfigInterDcStreamThroughputOutboundMegabitsPerSec structure. +type FindConfigInterDcStreamThroughputOutboundMegabitsPerSecReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigInterDcStreamThroughputOutboundMegabitsPerSecOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigInterDcStreamThroughputOutboundMegabitsPerSecDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigInterDcStreamThroughputOutboundMegabitsPerSecOK creates a FindConfigInterDcStreamThroughputOutboundMegabitsPerSecOK with default headers values +func NewFindConfigInterDcStreamThroughputOutboundMegabitsPerSecOK() *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecOK { + return &FindConfigInterDcStreamThroughputOutboundMegabitsPerSecOK{} +} + +/* +FindConfigInterDcStreamThroughputOutboundMegabitsPerSecOK handles this case with default header values. + +Config value +*/ +type FindConfigInterDcStreamThroughputOutboundMegabitsPerSecOK struct { + Payload int64 +} + +func (o *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigInterDcStreamThroughputOutboundMegabitsPerSecDefault creates a FindConfigInterDcStreamThroughputOutboundMegabitsPerSecDefault with default headers values +func NewFindConfigInterDcStreamThroughputOutboundMegabitsPerSecDefault(code int) *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecDefault { + return &FindConfigInterDcStreamThroughputOutboundMegabitsPerSecDefault{ + _statusCode: code, + } +} + +/* +FindConfigInterDcStreamThroughputOutboundMegabitsPerSecDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigInterDcStreamThroughputOutboundMegabitsPerSecDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config inter dc stream throughput outbound megabits per sec default response +func (o *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigInterDcStreamThroughputOutboundMegabitsPerSecDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_inter_dc_tcp_nodelay_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_inter_dc_tcp_nodelay_parameters.go new file mode 100644 index 0000000000..d6b6054f22 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_inter_dc_tcp_nodelay_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigInterDcTCPNodelayParams creates a new FindConfigInterDcTCPNodelayParams object +// with the default values initialized. +func NewFindConfigInterDcTCPNodelayParams() *FindConfigInterDcTCPNodelayParams { + + return &FindConfigInterDcTCPNodelayParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigInterDcTCPNodelayParamsWithTimeout creates a new FindConfigInterDcTCPNodelayParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigInterDcTCPNodelayParamsWithTimeout(timeout time.Duration) *FindConfigInterDcTCPNodelayParams { + + return &FindConfigInterDcTCPNodelayParams{ + + timeout: timeout, + } +} + +// NewFindConfigInterDcTCPNodelayParamsWithContext creates a new FindConfigInterDcTCPNodelayParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigInterDcTCPNodelayParamsWithContext(ctx context.Context) *FindConfigInterDcTCPNodelayParams { + + return &FindConfigInterDcTCPNodelayParams{ + + Context: ctx, + } +} + +// NewFindConfigInterDcTCPNodelayParamsWithHTTPClient creates a new FindConfigInterDcTCPNodelayParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigInterDcTCPNodelayParamsWithHTTPClient(client *http.Client) *FindConfigInterDcTCPNodelayParams { + + return &FindConfigInterDcTCPNodelayParams{ + HTTPClient: client, + } +} + +/* +FindConfigInterDcTCPNodelayParams contains all the parameters to send to the API endpoint +for the find config inter dc tcp nodelay operation typically these are written to a http.Request +*/ +type FindConfigInterDcTCPNodelayParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config inter dc tcp nodelay params +func (o *FindConfigInterDcTCPNodelayParams) WithTimeout(timeout time.Duration) *FindConfigInterDcTCPNodelayParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config inter dc tcp nodelay params +func (o *FindConfigInterDcTCPNodelayParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config inter dc tcp nodelay params +func (o *FindConfigInterDcTCPNodelayParams) WithContext(ctx context.Context) *FindConfigInterDcTCPNodelayParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config inter dc tcp nodelay params +func (o *FindConfigInterDcTCPNodelayParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config inter dc tcp nodelay params +func (o *FindConfigInterDcTCPNodelayParams) WithHTTPClient(client *http.Client) *FindConfigInterDcTCPNodelayParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config inter dc tcp nodelay params +func (o *FindConfigInterDcTCPNodelayParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigInterDcTCPNodelayParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_inter_dc_tcp_nodelay_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_inter_dc_tcp_nodelay_responses.go new file mode 100644 index 0000000000..c2c17e3b94 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_inter_dc_tcp_nodelay_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigInterDcTCPNodelayReader is a Reader for the FindConfigInterDcTCPNodelay structure. +type FindConfigInterDcTCPNodelayReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigInterDcTCPNodelayReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigInterDcTCPNodelayOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigInterDcTCPNodelayDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigInterDcTCPNodelayOK creates a FindConfigInterDcTCPNodelayOK with default headers values +func NewFindConfigInterDcTCPNodelayOK() *FindConfigInterDcTCPNodelayOK { + return &FindConfigInterDcTCPNodelayOK{} +} + +/* +FindConfigInterDcTCPNodelayOK handles this case with default header values. + +Config value +*/ +type FindConfigInterDcTCPNodelayOK struct { + Payload bool +} + +func (o *FindConfigInterDcTCPNodelayOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigInterDcTCPNodelayOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigInterDcTCPNodelayDefault creates a FindConfigInterDcTCPNodelayDefault with default headers values +func NewFindConfigInterDcTCPNodelayDefault(code int) *FindConfigInterDcTCPNodelayDefault { + return &FindConfigInterDcTCPNodelayDefault{ + _statusCode: code, + } +} + +/* +FindConfigInterDcTCPNodelayDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigInterDcTCPNodelayDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config inter dc tcp nodelay default response +func (o *FindConfigInterDcTCPNodelayDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigInterDcTCPNodelayDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigInterDcTCPNodelayDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigInterDcTCPNodelayDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_authenticator_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_authenticator_parameters.go new file mode 100644 index 0000000000..28ced9e7bb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_authenticator_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigInternodeAuthenticatorParams creates a new FindConfigInternodeAuthenticatorParams object +// with the default values initialized. +func NewFindConfigInternodeAuthenticatorParams() *FindConfigInternodeAuthenticatorParams { + + return &FindConfigInternodeAuthenticatorParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigInternodeAuthenticatorParamsWithTimeout creates a new FindConfigInternodeAuthenticatorParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigInternodeAuthenticatorParamsWithTimeout(timeout time.Duration) *FindConfigInternodeAuthenticatorParams { + + return &FindConfigInternodeAuthenticatorParams{ + + timeout: timeout, + } +} + +// NewFindConfigInternodeAuthenticatorParamsWithContext creates a new FindConfigInternodeAuthenticatorParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigInternodeAuthenticatorParamsWithContext(ctx context.Context) *FindConfigInternodeAuthenticatorParams { + + return &FindConfigInternodeAuthenticatorParams{ + + Context: ctx, + } +} + +// NewFindConfigInternodeAuthenticatorParamsWithHTTPClient creates a new FindConfigInternodeAuthenticatorParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigInternodeAuthenticatorParamsWithHTTPClient(client *http.Client) *FindConfigInternodeAuthenticatorParams { + + return &FindConfigInternodeAuthenticatorParams{ + HTTPClient: client, + } +} + +/* +FindConfigInternodeAuthenticatorParams contains all the parameters to send to the API endpoint +for the find config internode authenticator operation typically these are written to a http.Request +*/ +type FindConfigInternodeAuthenticatorParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config internode authenticator params +func (o *FindConfigInternodeAuthenticatorParams) WithTimeout(timeout time.Duration) *FindConfigInternodeAuthenticatorParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config internode authenticator params +func (o *FindConfigInternodeAuthenticatorParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config internode authenticator params +func (o *FindConfigInternodeAuthenticatorParams) WithContext(ctx context.Context) *FindConfigInternodeAuthenticatorParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config internode authenticator params +func (o *FindConfigInternodeAuthenticatorParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config internode authenticator params +func (o *FindConfigInternodeAuthenticatorParams) WithHTTPClient(client *http.Client) *FindConfigInternodeAuthenticatorParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config internode authenticator params +func (o *FindConfigInternodeAuthenticatorParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigInternodeAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_authenticator_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_authenticator_responses.go new file mode 100644 index 0000000000..c5ff359f56 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_authenticator_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigInternodeAuthenticatorReader is a Reader for the FindConfigInternodeAuthenticator structure. +type FindConfigInternodeAuthenticatorReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigInternodeAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigInternodeAuthenticatorOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigInternodeAuthenticatorDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigInternodeAuthenticatorOK creates a FindConfigInternodeAuthenticatorOK with default headers values +func NewFindConfigInternodeAuthenticatorOK() *FindConfigInternodeAuthenticatorOK { + return &FindConfigInternodeAuthenticatorOK{} +} + +/* +FindConfigInternodeAuthenticatorOK handles this case with default header values. + +Config value +*/ +type FindConfigInternodeAuthenticatorOK struct { + Payload string +} + +func (o *FindConfigInternodeAuthenticatorOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigInternodeAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigInternodeAuthenticatorDefault creates a FindConfigInternodeAuthenticatorDefault with default headers values +func NewFindConfigInternodeAuthenticatorDefault(code int) *FindConfigInternodeAuthenticatorDefault { + return &FindConfigInternodeAuthenticatorDefault{ + _statusCode: code, + } +} + +/* +FindConfigInternodeAuthenticatorDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigInternodeAuthenticatorDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config internode authenticator default response +func (o *FindConfigInternodeAuthenticatorDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigInternodeAuthenticatorDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigInternodeAuthenticatorDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigInternodeAuthenticatorDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_compression_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_compression_parameters.go new file mode 100644 index 0000000000..39e2f75f4c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_compression_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigInternodeCompressionParams creates a new FindConfigInternodeCompressionParams object +// with the default values initialized. +func NewFindConfigInternodeCompressionParams() *FindConfigInternodeCompressionParams { + + return &FindConfigInternodeCompressionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigInternodeCompressionParamsWithTimeout creates a new FindConfigInternodeCompressionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigInternodeCompressionParamsWithTimeout(timeout time.Duration) *FindConfigInternodeCompressionParams { + + return &FindConfigInternodeCompressionParams{ + + timeout: timeout, + } +} + +// NewFindConfigInternodeCompressionParamsWithContext creates a new FindConfigInternodeCompressionParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigInternodeCompressionParamsWithContext(ctx context.Context) *FindConfigInternodeCompressionParams { + + return &FindConfigInternodeCompressionParams{ + + Context: ctx, + } +} + +// NewFindConfigInternodeCompressionParamsWithHTTPClient creates a new FindConfigInternodeCompressionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigInternodeCompressionParamsWithHTTPClient(client *http.Client) *FindConfigInternodeCompressionParams { + + return &FindConfigInternodeCompressionParams{ + HTTPClient: client, + } +} + +/* +FindConfigInternodeCompressionParams contains all the parameters to send to the API endpoint +for the find config internode compression operation typically these are written to a http.Request +*/ +type FindConfigInternodeCompressionParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config internode compression params +func (o *FindConfigInternodeCompressionParams) WithTimeout(timeout time.Duration) *FindConfigInternodeCompressionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config internode compression params +func (o *FindConfigInternodeCompressionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config internode compression params +func (o *FindConfigInternodeCompressionParams) WithContext(ctx context.Context) *FindConfigInternodeCompressionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config internode compression params +func (o *FindConfigInternodeCompressionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config internode compression params +func (o *FindConfigInternodeCompressionParams) WithHTTPClient(client *http.Client) *FindConfigInternodeCompressionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config internode compression params +func (o *FindConfigInternodeCompressionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigInternodeCompressionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_compression_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_compression_responses.go new file mode 100644 index 0000000000..64ec357280 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_compression_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigInternodeCompressionReader is a Reader for the FindConfigInternodeCompression structure. +type FindConfigInternodeCompressionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigInternodeCompressionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigInternodeCompressionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigInternodeCompressionDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigInternodeCompressionOK creates a FindConfigInternodeCompressionOK with default headers values +func NewFindConfigInternodeCompressionOK() *FindConfigInternodeCompressionOK { + return &FindConfigInternodeCompressionOK{} +} + +/* +FindConfigInternodeCompressionOK handles this case with default header values. + +Config value +*/ +type FindConfigInternodeCompressionOK struct { + Payload string +} + +func (o *FindConfigInternodeCompressionOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigInternodeCompressionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigInternodeCompressionDefault creates a FindConfigInternodeCompressionDefault with default headers values +func NewFindConfigInternodeCompressionDefault(code int) *FindConfigInternodeCompressionDefault { + return &FindConfigInternodeCompressionDefault{ + _statusCode: code, + } +} + +/* +FindConfigInternodeCompressionDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigInternodeCompressionDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config internode compression default response +func (o *FindConfigInternodeCompressionDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigInternodeCompressionDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigInternodeCompressionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigInternodeCompressionDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_recv_buff_size_in_bytes_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_recv_buff_size_in_bytes_parameters.go new file mode 100644 index 0000000000..34e10cf8d0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_recv_buff_size_in_bytes_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigInternodeRecvBuffSizeInBytesParams creates a new FindConfigInternodeRecvBuffSizeInBytesParams object +// with the default values initialized. +func NewFindConfigInternodeRecvBuffSizeInBytesParams() *FindConfigInternodeRecvBuffSizeInBytesParams { + + return &FindConfigInternodeRecvBuffSizeInBytesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigInternodeRecvBuffSizeInBytesParamsWithTimeout creates a new FindConfigInternodeRecvBuffSizeInBytesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigInternodeRecvBuffSizeInBytesParamsWithTimeout(timeout time.Duration) *FindConfigInternodeRecvBuffSizeInBytesParams { + + return &FindConfigInternodeRecvBuffSizeInBytesParams{ + + timeout: timeout, + } +} + +// NewFindConfigInternodeRecvBuffSizeInBytesParamsWithContext creates a new FindConfigInternodeRecvBuffSizeInBytesParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigInternodeRecvBuffSizeInBytesParamsWithContext(ctx context.Context) *FindConfigInternodeRecvBuffSizeInBytesParams { + + return &FindConfigInternodeRecvBuffSizeInBytesParams{ + + Context: ctx, + } +} + +// NewFindConfigInternodeRecvBuffSizeInBytesParamsWithHTTPClient creates a new FindConfigInternodeRecvBuffSizeInBytesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigInternodeRecvBuffSizeInBytesParamsWithHTTPClient(client *http.Client) *FindConfigInternodeRecvBuffSizeInBytesParams { + + return &FindConfigInternodeRecvBuffSizeInBytesParams{ + HTTPClient: client, + } +} + +/* +FindConfigInternodeRecvBuffSizeInBytesParams contains all the parameters to send to the API endpoint +for the find config internode recv buff size in bytes operation typically these are written to a http.Request +*/ +type FindConfigInternodeRecvBuffSizeInBytesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config internode recv buff size in bytes params +func (o *FindConfigInternodeRecvBuffSizeInBytesParams) WithTimeout(timeout time.Duration) *FindConfigInternodeRecvBuffSizeInBytesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config internode recv buff size in bytes params +func (o *FindConfigInternodeRecvBuffSizeInBytesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config internode recv buff size in bytes params +func (o *FindConfigInternodeRecvBuffSizeInBytesParams) WithContext(ctx context.Context) *FindConfigInternodeRecvBuffSizeInBytesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config internode recv buff size in bytes params +func (o *FindConfigInternodeRecvBuffSizeInBytesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config internode recv buff size in bytes params +func (o *FindConfigInternodeRecvBuffSizeInBytesParams) WithHTTPClient(client *http.Client) *FindConfigInternodeRecvBuffSizeInBytesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config internode recv buff size in bytes params +func (o *FindConfigInternodeRecvBuffSizeInBytesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigInternodeRecvBuffSizeInBytesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_recv_buff_size_in_bytes_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_recv_buff_size_in_bytes_responses.go new file mode 100644 index 0000000000..4a6627975d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_recv_buff_size_in_bytes_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigInternodeRecvBuffSizeInBytesReader is a Reader for the FindConfigInternodeRecvBuffSizeInBytes structure. +type FindConfigInternodeRecvBuffSizeInBytesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigInternodeRecvBuffSizeInBytesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigInternodeRecvBuffSizeInBytesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigInternodeRecvBuffSizeInBytesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigInternodeRecvBuffSizeInBytesOK creates a FindConfigInternodeRecvBuffSizeInBytesOK with default headers values +func NewFindConfigInternodeRecvBuffSizeInBytesOK() *FindConfigInternodeRecvBuffSizeInBytesOK { + return &FindConfigInternodeRecvBuffSizeInBytesOK{} +} + +/* +FindConfigInternodeRecvBuffSizeInBytesOK handles this case with default header values. + +Config value +*/ +type FindConfigInternodeRecvBuffSizeInBytesOK struct { + Payload int64 +} + +func (o *FindConfigInternodeRecvBuffSizeInBytesOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigInternodeRecvBuffSizeInBytesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigInternodeRecvBuffSizeInBytesDefault creates a FindConfigInternodeRecvBuffSizeInBytesDefault with default headers values +func NewFindConfigInternodeRecvBuffSizeInBytesDefault(code int) *FindConfigInternodeRecvBuffSizeInBytesDefault { + return &FindConfigInternodeRecvBuffSizeInBytesDefault{ + _statusCode: code, + } +} + +/* +FindConfigInternodeRecvBuffSizeInBytesDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigInternodeRecvBuffSizeInBytesDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config internode recv buff size in bytes default response +func (o *FindConfigInternodeRecvBuffSizeInBytesDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigInternodeRecvBuffSizeInBytesDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigInternodeRecvBuffSizeInBytesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigInternodeRecvBuffSizeInBytesDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_send_buff_size_in_bytes_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_send_buff_size_in_bytes_parameters.go new file mode 100644 index 0000000000..37c24aa22c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_send_buff_size_in_bytes_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigInternodeSendBuffSizeInBytesParams creates a new FindConfigInternodeSendBuffSizeInBytesParams object +// with the default values initialized. +func NewFindConfigInternodeSendBuffSizeInBytesParams() *FindConfigInternodeSendBuffSizeInBytesParams { + + return &FindConfigInternodeSendBuffSizeInBytesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigInternodeSendBuffSizeInBytesParamsWithTimeout creates a new FindConfigInternodeSendBuffSizeInBytesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigInternodeSendBuffSizeInBytesParamsWithTimeout(timeout time.Duration) *FindConfigInternodeSendBuffSizeInBytesParams { + + return &FindConfigInternodeSendBuffSizeInBytesParams{ + + timeout: timeout, + } +} + +// NewFindConfigInternodeSendBuffSizeInBytesParamsWithContext creates a new FindConfigInternodeSendBuffSizeInBytesParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigInternodeSendBuffSizeInBytesParamsWithContext(ctx context.Context) *FindConfigInternodeSendBuffSizeInBytesParams { + + return &FindConfigInternodeSendBuffSizeInBytesParams{ + + Context: ctx, + } +} + +// NewFindConfigInternodeSendBuffSizeInBytesParamsWithHTTPClient creates a new FindConfigInternodeSendBuffSizeInBytesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigInternodeSendBuffSizeInBytesParamsWithHTTPClient(client *http.Client) *FindConfigInternodeSendBuffSizeInBytesParams { + + return &FindConfigInternodeSendBuffSizeInBytesParams{ + HTTPClient: client, + } +} + +/* +FindConfigInternodeSendBuffSizeInBytesParams contains all the parameters to send to the API endpoint +for the find config internode send buff size in bytes operation typically these are written to a http.Request +*/ +type FindConfigInternodeSendBuffSizeInBytesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config internode send buff size in bytes params +func (o *FindConfigInternodeSendBuffSizeInBytesParams) WithTimeout(timeout time.Duration) *FindConfigInternodeSendBuffSizeInBytesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config internode send buff size in bytes params +func (o *FindConfigInternodeSendBuffSizeInBytesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config internode send buff size in bytes params +func (o *FindConfigInternodeSendBuffSizeInBytesParams) WithContext(ctx context.Context) *FindConfigInternodeSendBuffSizeInBytesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config internode send buff size in bytes params +func (o *FindConfigInternodeSendBuffSizeInBytesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config internode send buff size in bytes params +func (o *FindConfigInternodeSendBuffSizeInBytesParams) WithHTTPClient(client *http.Client) *FindConfigInternodeSendBuffSizeInBytesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config internode send buff size in bytes params +func (o *FindConfigInternodeSendBuffSizeInBytesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigInternodeSendBuffSizeInBytesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_send_buff_size_in_bytes_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_send_buff_size_in_bytes_responses.go new file mode 100644 index 0000000000..244f2ac424 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_internode_send_buff_size_in_bytes_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigInternodeSendBuffSizeInBytesReader is a Reader for the FindConfigInternodeSendBuffSizeInBytes structure. +type FindConfigInternodeSendBuffSizeInBytesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigInternodeSendBuffSizeInBytesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigInternodeSendBuffSizeInBytesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigInternodeSendBuffSizeInBytesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigInternodeSendBuffSizeInBytesOK creates a FindConfigInternodeSendBuffSizeInBytesOK with default headers values +func NewFindConfigInternodeSendBuffSizeInBytesOK() *FindConfigInternodeSendBuffSizeInBytesOK { + return &FindConfigInternodeSendBuffSizeInBytesOK{} +} + +/* +FindConfigInternodeSendBuffSizeInBytesOK handles this case with default header values. + +Config value +*/ +type FindConfigInternodeSendBuffSizeInBytesOK struct { + Payload int64 +} + +func (o *FindConfigInternodeSendBuffSizeInBytesOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigInternodeSendBuffSizeInBytesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigInternodeSendBuffSizeInBytesDefault creates a FindConfigInternodeSendBuffSizeInBytesDefault with default headers values +func NewFindConfigInternodeSendBuffSizeInBytesDefault(code int) *FindConfigInternodeSendBuffSizeInBytesDefault { + return &FindConfigInternodeSendBuffSizeInBytesDefault{ + _statusCode: code, + } +} + +/* +FindConfigInternodeSendBuffSizeInBytesDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigInternodeSendBuffSizeInBytesDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config internode send buff size in bytes default response +func (o *FindConfigInternodeSendBuffSizeInBytesDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigInternodeSendBuffSizeInBytesDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigInternodeSendBuffSizeInBytesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigInternodeSendBuffSizeInBytesDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_join_ring_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_join_ring_parameters.go new file mode 100644 index 0000000000..58331904fe --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_join_ring_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigJoinRingParams creates a new FindConfigJoinRingParams object +// with the default values initialized. +func NewFindConfigJoinRingParams() *FindConfigJoinRingParams { + + return &FindConfigJoinRingParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigJoinRingParamsWithTimeout creates a new FindConfigJoinRingParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigJoinRingParamsWithTimeout(timeout time.Duration) *FindConfigJoinRingParams { + + return &FindConfigJoinRingParams{ + + timeout: timeout, + } +} + +// NewFindConfigJoinRingParamsWithContext creates a new FindConfigJoinRingParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigJoinRingParamsWithContext(ctx context.Context) *FindConfigJoinRingParams { + + return &FindConfigJoinRingParams{ + + Context: ctx, + } +} + +// NewFindConfigJoinRingParamsWithHTTPClient creates a new FindConfigJoinRingParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigJoinRingParamsWithHTTPClient(client *http.Client) *FindConfigJoinRingParams { + + return &FindConfigJoinRingParams{ + HTTPClient: client, + } +} + +/* +FindConfigJoinRingParams contains all the parameters to send to the API endpoint +for the find config join ring operation typically these are written to a http.Request +*/ +type FindConfigJoinRingParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config join ring params +func (o *FindConfigJoinRingParams) WithTimeout(timeout time.Duration) *FindConfigJoinRingParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config join ring params +func (o *FindConfigJoinRingParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config join ring params +func (o *FindConfigJoinRingParams) WithContext(ctx context.Context) *FindConfigJoinRingParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config join ring params +func (o *FindConfigJoinRingParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config join ring params +func (o *FindConfigJoinRingParams) WithHTTPClient(client *http.Client) *FindConfigJoinRingParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config join ring params +func (o *FindConfigJoinRingParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigJoinRingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_join_ring_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_join_ring_responses.go new file mode 100644 index 0000000000..77229477d4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_join_ring_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigJoinRingReader is a Reader for the FindConfigJoinRing structure. +type FindConfigJoinRingReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigJoinRingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigJoinRingOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigJoinRingDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigJoinRingOK creates a FindConfigJoinRingOK with default headers values +func NewFindConfigJoinRingOK() *FindConfigJoinRingOK { + return &FindConfigJoinRingOK{} +} + +/* +FindConfigJoinRingOK handles this case with default header values. + +Config value +*/ +type FindConfigJoinRingOK struct { + Payload bool +} + +func (o *FindConfigJoinRingOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigJoinRingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigJoinRingDefault creates a FindConfigJoinRingDefault with default headers values +func NewFindConfigJoinRingDefault(code int) *FindConfigJoinRingDefault { + return &FindConfigJoinRingDefault{ + _statusCode: code, + } +} + +/* +FindConfigJoinRingDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigJoinRingDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config join ring default response +func (o *FindConfigJoinRingDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigJoinRingDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigJoinRingDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigJoinRingDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_keys_to_save_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_keys_to_save_parameters.go new file mode 100644 index 0000000000..33e2b3fa5c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_keys_to_save_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigKeyCacheKeysToSaveParams creates a new FindConfigKeyCacheKeysToSaveParams object +// with the default values initialized. +func NewFindConfigKeyCacheKeysToSaveParams() *FindConfigKeyCacheKeysToSaveParams { + + return &FindConfigKeyCacheKeysToSaveParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigKeyCacheKeysToSaveParamsWithTimeout creates a new FindConfigKeyCacheKeysToSaveParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigKeyCacheKeysToSaveParamsWithTimeout(timeout time.Duration) *FindConfigKeyCacheKeysToSaveParams { + + return &FindConfigKeyCacheKeysToSaveParams{ + + timeout: timeout, + } +} + +// NewFindConfigKeyCacheKeysToSaveParamsWithContext creates a new FindConfigKeyCacheKeysToSaveParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigKeyCacheKeysToSaveParamsWithContext(ctx context.Context) *FindConfigKeyCacheKeysToSaveParams { + + return &FindConfigKeyCacheKeysToSaveParams{ + + Context: ctx, + } +} + +// NewFindConfigKeyCacheKeysToSaveParamsWithHTTPClient creates a new FindConfigKeyCacheKeysToSaveParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigKeyCacheKeysToSaveParamsWithHTTPClient(client *http.Client) *FindConfigKeyCacheKeysToSaveParams { + + return &FindConfigKeyCacheKeysToSaveParams{ + HTTPClient: client, + } +} + +/* +FindConfigKeyCacheKeysToSaveParams contains all the parameters to send to the API endpoint +for the find config key cache keys to save operation typically these are written to a http.Request +*/ +type FindConfigKeyCacheKeysToSaveParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config key cache keys to save params +func (o *FindConfigKeyCacheKeysToSaveParams) WithTimeout(timeout time.Duration) *FindConfigKeyCacheKeysToSaveParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config key cache keys to save params +func (o *FindConfigKeyCacheKeysToSaveParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config key cache keys to save params +func (o *FindConfigKeyCacheKeysToSaveParams) WithContext(ctx context.Context) *FindConfigKeyCacheKeysToSaveParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config key cache keys to save params +func (o *FindConfigKeyCacheKeysToSaveParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config key cache keys to save params +func (o *FindConfigKeyCacheKeysToSaveParams) WithHTTPClient(client *http.Client) *FindConfigKeyCacheKeysToSaveParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config key cache keys to save params +func (o *FindConfigKeyCacheKeysToSaveParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigKeyCacheKeysToSaveParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_keys_to_save_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_keys_to_save_responses.go new file mode 100644 index 0000000000..0b9bc47a3b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_keys_to_save_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigKeyCacheKeysToSaveReader is a Reader for the FindConfigKeyCacheKeysToSave structure. +type FindConfigKeyCacheKeysToSaveReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigKeyCacheKeysToSaveReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigKeyCacheKeysToSaveOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigKeyCacheKeysToSaveDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigKeyCacheKeysToSaveOK creates a FindConfigKeyCacheKeysToSaveOK with default headers values +func NewFindConfigKeyCacheKeysToSaveOK() *FindConfigKeyCacheKeysToSaveOK { + return &FindConfigKeyCacheKeysToSaveOK{} +} + +/* +FindConfigKeyCacheKeysToSaveOK handles this case with default header values. + +Config value +*/ +type FindConfigKeyCacheKeysToSaveOK struct { + Payload int64 +} + +func (o *FindConfigKeyCacheKeysToSaveOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigKeyCacheKeysToSaveOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigKeyCacheKeysToSaveDefault creates a FindConfigKeyCacheKeysToSaveDefault with default headers values +func NewFindConfigKeyCacheKeysToSaveDefault(code int) *FindConfigKeyCacheKeysToSaveDefault { + return &FindConfigKeyCacheKeysToSaveDefault{ + _statusCode: code, + } +} + +/* +FindConfigKeyCacheKeysToSaveDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigKeyCacheKeysToSaveDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config key cache keys to save default response +func (o *FindConfigKeyCacheKeysToSaveDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigKeyCacheKeysToSaveDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigKeyCacheKeysToSaveDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigKeyCacheKeysToSaveDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_save_period_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_save_period_parameters.go new file mode 100644 index 0000000000..08fe254036 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_save_period_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigKeyCacheSavePeriodParams creates a new FindConfigKeyCacheSavePeriodParams object +// with the default values initialized. +func NewFindConfigKeyCacheSavePeriodParams() *FindConfigKeyCacheSavePeriodParams { + + return &FindConfigKeyCacheSavePeriodParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigKeyCacheSavePeriodParamsWithTimeout creates a new FindConfigKeyCacheSavePeriodParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigKeyCacheSavePeriodParamsWithTimeout(timeout time.Duration) *FindConfigKeyCacheSavePeriodParams { + + return &FindConfigKeyCacheSavePeriodParams{ + + timeout: timeout, + } +} + +// NewFindConfigKeyCacheSavePeriodParamsWithContext creates a new FindConfigKeyCacheSavePeriodParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigKeyCacheSavePeriodParamsWithContext(ctx context.Context) *FindConfigKeyCacheSavePeriodParams { + + return &FindConfigKeyCacheSavePeriodParams{ + + Context: ctx, + } +} + +// NewFindConfigKeyCacheSavePeriodParamsWithHTTPClient creates a new FindConfigKeyCacheSavePeriodParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigKeyCacheSavePeriodParamsWithHTTPClient(client *http.Client) *FindConfigKeyCacheSavePeriodParams { + + return &FindConfigKeyCacheSavePeriodParams{ + HTTPClient: client, + } +} + +/* +FindConfigKeyCacheSavePeriodParams contains all the parameters to send to the API endpoint +for the find config key cache save period operation typically these are written to a http.Request +*/ +type FindConfigKeyCacheSavePeriodParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config key cache save period params +func (o *FindConfigKeyCacheSavePeriodParams) WithTimeout(timeout time.Duration) *FindConfigKeyCacheSavePeriodParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config key cache save period params +func (o *FindConfigKeyCacheSavePeriodParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config key cache save period params +func (o *FindConfigKeyCacheSavePeriodParams) WithContext(ctx context.Context) *FindConfigKeyCacheSavePeriodParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config key cache save period params +func (o *FindConfigKeyCacheSavePeriodParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config key cache save period params +func (o *FindConfigKeyCacheSavePeriodParams) WithHTTPClient(client *http.Client) *FindConfigKeyCacheSavePeriodParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config key cache save period params +func (o *FindConfigKeyCacheSavePeriodParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigKeyCacheSavePeriodParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_save_period_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_save_period_responses.go new file mode 100644 index 0000000000..d77f634756 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_save_period_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigKeyCacheSavePeriodReader is a Reader for the FindConfigKeyCacheSavePeriod structure. +type FindConfigKeyCacheSavePeriodReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigKeyCacheSavePeriodReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigKeyCacheSavePeriodOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigKeyCacheSavePeriodDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigKeyCacheSavePeriodOK creates a FindConfigKeyCacheSavePeriodOK with default headers values +func NewFindConfigKeyCacheSavePeriodOK() *FindConfigKeyCacheSavePeriodOK { + return &FindConfigKeyCacheSavePeriodOK{} +} + +/* +FindConfigKeyCacheSavePeriodOK handles this case with default header values. + +Config value +*/ +type FindConfigKeyCacheSavePeriodOK struct { + Payload int64 +} + +func (o *FindConfigKeyCacheSavePeriodOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigKeyCacheSavePeriodOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigKeyCacheSavePeriodDefault creates a FindConfigKeyCacheSavePeriodDefault with default headers values +func NewFindConfigKeyCacheSavePeriodDefault(code int) *FindConfigKeyCacheSavePeriodDefault { + return &FindConfigKeyCacheSavePeriodDefault{ + _statusCode: code, + } +} + +/* +FindConfigKeyCacheSavePeriodDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigKeyCacheSavePeriodDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config key cache save period default response +func (o *FindConfigKeyCacheSavePeriodDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigKeyCacheSavePeriodDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigKeyCacheSavePeriodDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigKeyCacheSavePeriodDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_size_in_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_size_in_mb_parameters.go new file mode 100644 index 0000000000..74c3d0adda --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_size_in_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigKeyCacheSizeInMbParams creates a new FindConfigKeyCacheSizeInMbParams object +// with the default values initialized. +func NewFindConfigKeyCacheSizeInMbParams() *FindConfigKeyCacheSizeInMbParams { + + return &FindConfigKeyCacheSizeInMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigKeyCacheSizeInMbParamsWithTimeout creates a new FindConfigKeyCacheSizeInMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigKeyCacheSizeInMbParamsWithTimeout(timeout time.Duration) *FindConfigKeyCacheSizeInMbParams { + + return &FindConfigKeyCacheSizeInMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigKeyCacheSizeInMbParamsWithContext creates a new FindConfigKeyCacheSizeInMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigKeyCacheSizeInMbParamsWithContext(ctx context.Context) *FindConfigKeyCacheSizeInMbParams { + + return &FindConfigKeyCacheSizeInMbParams{ + + Context: ctx, + } +} + +// NewFindConfigKeyCacheSizeInMbParamsWithHTTPClient creates a new FindConfigKeyCacheSizeInMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigKeyCacheSizeInMbParamsWithHTTPClient(client *http.Client) *FindConfigKeyCacheSizeInMbParams { + + return &FindConfigKeyCacheSizeInMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigKeyCacheSizeInMbParams contains all the parameters to send to the API endpoint +for the find config key cache size in mb operation typically these are written to a http.Request +*/ +type FindConfigKeyCacheSizeInMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config key cache size in mb params +func (o *FindConfigKeyCacheSizeInMbParams) WithTimeout(timeout time.Duration) *FindConfigKeyCacheSizeInMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config key cache size in mb params +func (o *FindConfigKeyCacheSizeInMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config key cache size in mb params +func (o *FindConfigKeyCacheSizeInMbParams) WithContext(ctx context.Context) *FindConfigKeyCacheSizeInMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config key cache size in mb params +func (o *FindConfigKeyCacheSizeInMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config key cache size in mb params +func (o *FindConfigKeyCacheSizeInMbParams) WithHTTPClient(client *http.Client) *FindConfigKeyCacheSizeInMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config key cache size in mb params +func (o *FindConfigKeyCacheSizeInMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigKeyCacheSizeInMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_size_in_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_size_in_mb_responses.go new file mode 100644 index 0000000000..a6df456e3e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_key_cache_size_in_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigKeyCacheSizeInMbReader is a Reader for the FindConfigKeyCacheSizeInMb structure. +type FindConfigKeyCacheSizeInMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigKeyCacheSizeInMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigKeyCacheSizeInMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigKeyCacheSizeInMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigKeyCacheSizeInMbOK creates a FindConfigKeyCacheSizeInMbOK with default headers values +func NewFindConfigKeyCacheSizeInMbOK() *FindConfigKeyCacheSizeInMbOK { + return &FindConfigKeyCacheSizeInMbOK{} +} + +/* +FindConfigKeyCacheSizeInMbOK handles this case with default header values. + +Config value +*/ +type FindConfigKeyCacheSizeInMbOK struct { + Payload int64 +} + +func (o *FindConfigKeyCacheSizeInMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigKeyCacheSizeInMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigKeyCacheSizeInMbDefault creates a FindConfigKeyCacheSizeInMbDefault with default headers values +func NewFindConfigKeyCacheSizeInMbDefault(code int) *FindConfigKeyCacheSizeInMbDefault { + return &FindConfigKeyCacheSizeInMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigKeyCacheSizeInMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigKeyCacheSizeInMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config key cache size in mb default response +func (o *FindConfigKeyCacheSizeInMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigKeyCacheSizeInMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigKeyCacheSizeInMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigKeyCacheSizeInMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_large_memory_allocation_warning_threshold_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_large_memory_allocation_warning_threshold_parameters.go new file mode 100644 index 0000000000..c79fc408d8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_large_memory_allocation_warning_threshold_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigLargeMemoryAllocationWarningThresholdParams creates a new FindConfigLargeMemoryAllocationWarningThresholdParams object +// with the default values initialized. +func NewFindConfigLargeMemoryAllocationWarningThresholdParams() *FindConfigLargeMemoryAllocationWarningThresholdParams { + + return &FindConfigLargeMemoryAllocationWarningThresholdParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigLargeMemoryAllocationWarningThresholdParamsWithTimeout creates a new FindConfigLargeMemoryAllocationWarningThresholdParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigLargeMemoryAllocationWarningThresholdParamsWithTimeout(timeout time.Duration) *FindConfigLargeMemoryAllocationWarningThresholdParams { + + return &FindConfigLargeMemoryAllocationWarningThresholdParams{ + + timeout: timeout, + } +} + +// NewFindConfigLargeMemoryAllocationWarningThresholdParamsWithContext creates a new FindConfigLargeMemoryAllocationWarningThresholdParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigLargeMemoryAllocationWarningThresholdParamsWithContext(ctx context.Context) *FindConfigLargeMemoryAllocationWarningThresholdParams { + + return &FindConfigLargeMemoryAllocationWarningThresholdParams{ + + Context: ctx, + } +} + +// NewFindConfigLargeMemoryAllocationWarningThresholdParamsWithHTTPClient creates a new FindConfigLargeMemoryAllocationWarningThresholdParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigLargeMemoryAllocationWarningThresholdParamsWithHTTPClient(client *http.Client) *FindConfigLargeMemoryAllocationWarningThresholdParams { + + return &FindConfigLargeMemoryAllocationWarningThresholdParams{ + HTTPClient: client, + } +} + +/* +FindConfigLargeMemoryAllocationWarningThresholdParams contains all the parameters to send to the API endpoint +for the find config large memory allocation warning threshold operation typically these are written to a http.Request +*/ +type FindConfigLargeMemoryAllocationWarningThresholdParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config large memory allocation warning threshold params +func (o *FindConfigLargeMemoryAllocationWarningThresholdParams) WithTimeout(timeout time.Duration) *FindConfigLargeMemoryAllocationWarningThresholdParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config large memory allocation warning threshold params +func (o *FindConfigLargeMemoryAllocationWarningThresholdParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config large memory allocation warning threshold params +func (o *FindConfigLargeMemoryAllocationWarningThresholdParams) WithContext(ctx context.Context) *FindConfigLargeMemoryAllocationWarningThresholdParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config large memory allocation warning threshold params +func (o *FindConfigLargeMemoryAllocationWarningThresholdParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config large memory allocation warning threshold params +func (o *FindConfigLargeMemoryAllocationWarningThresholdParams) WithHTTPClient(client *http.Client) *FindConfigLargeMemoryAllocationWarningThresholdParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config large memory allocation warning threshold params +func (o *FindConfigLargeMemoryAllocationWarningThresholdParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigLargeMemoryAllocationWarningThresholdParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_large_memory_allocation_warning_threshold_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_large_memory_allocation_warning_threshold_responses.go new file mode 100644 index 0000000000..85be34f8da --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_large_memory_allocation_warning_threshold_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigLargeMemoryAllocationWarningThresholdReader is a Reader for the FindConfigLargeMemoryAllocationWarningThreshold structure. +type FindConfigLargeMemoryAllocationWarningThresholdReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigLargeMemoryAllocationWarningThresholdReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigLargeMemoryAllocationWarningThresholdOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigLargeMemoryAllocationWarningThresholdDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigLargeMemoryAllocationWarningThresholdOK creates a FindConfigLargeMemoryAllocationWarningThresholdOK with default headers values +func NewFindConfigLargeMemoryAllocationWarningThresholdOK() *FindConfigLargeMemoryAllocationWarningThresholdOK { + return &FindConfigLargeMemoryAllocationWarningThresholdOK{} +} + +/* +FindConfigLargeMemoryAllocationWarningThresholdOK handles this case with default header values. + +Config value +*/ +type FindConfigLargeMemoryAllocationWarningThresholdOK struct { + Payload int64 +} + +func (o *FindConfigLargeMemoryAllocationWarningThresholdOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigLargeMemoryAllocationWarningThresholdOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigLargeMemoryAllocationWarningThresholdDefault creates a FindConfigLargeMemoryAllocationWarningThresholdDefault with default headers values +func NewFindConfigLargeMemoryAllocationWarningThresholdDefault(code int) *FindConfigLargeMemoryAllocationWarningThresholdDefault { + return &FindConfigLargeMemoryAllocationWarningThresholdDefault{ + _statusCode: code, + } +} + +/* +FindConfigLargeMemoryAllocationWarningThresholdDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigLargeMemoryAllocationWarningThresholdDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config large memory allocation warning threshold default response +func (o *FindConfigLargeMemoryAllocationWarningThresholdDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigLargeMemoryAllocationWarningThresholdDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigLargeMemoryAllocationWarningThresholdDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigLargeMemoryAllocationWarningThresholdDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_address_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_address_parameters.go new file mode 100644 index 0000000000..a9b170e64e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_address_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigListenAddressParams creates a new FindConfigListenAddressParams object +// with the default values initialized. +func NewFindConfigListenAddressParams() *FindConfigListenAddressParams { + + return &FindConfigListenAddressParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigListenAddressParamsWithTimeout creates a new FindConfigListenAddressParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigListenAddressParamsWithTimeout(timeout time.Duration) *FindConfigListenAddressParams { + + return &FindConfigListenAddressParams{ + + timeout: timeout, + } +} + +// NewFindConfigListenAddressParamsWithContext creates a new FindConfigListenAddressParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigListenAddressParamsWithContext(ctx context.Context) *FindConfigListenAddressParams { + + return &FindConfigListenAddressParams{ + + Context: ctx, + } +} + +// NewFindConfigListenAddressParamsWithHTTPClient creates a new FindConfigListenAddressParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigListenAddressParamsWithHTTPClient(client *http.Client) *FindConfigListenAddressParams { + + return &FindConfigListenAddressParams{ + HTTPClient: client, + } +} + +/* +FindConfigListenAddressParams contains all the parameters to send to the API endpoint +for the find config listen address operation typically these are written to a http.Request +*/ +type FindConfigListenAddressParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config listen address params +func (o *FindConfigListenAddressParams) WithTimeout(timeout time.Duration) *FindConfigListenAddressParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config listen address params +func (o *FindConfigListenAddressParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config listen address params +func (o *FindConfigListenAddressParams) WithContext(ctx context.Context) *FindConfigListenAddressParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config listen address params +func (o *FindConfigListenAddressParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config listen address params +func (o *FindConfigListenAddressParams) WithHTTPClient(client *http.Client) *FindConfigListenAddressParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config listen address params +func (o *FindConfigListenAddressParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigListenAddressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_address_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_address_responses.go new file mode 100644 index 0000000000..419fa65338 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_address_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigListenAddressReader is a Reader for the FindConfigListenAddress structure. +type FindConfigListenAddressReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigListenAddressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigListenAddressOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigListenAddressDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigListenAddressOK creates a FindConfigListenAddressOK with default headers values +func NewFindConfigListenAddressOK() *FindConfigListenAddressOK { + return &FindConfigListenAddressOK{} +} + +/* +FindConfigListenAddressOK handles this case with default header values. + +Config value +*/ +type FindConfigListenAddressOK struct { + Payload string +} + +func (o *FindConfigListenAddressOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigListenAddressOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigListenAddressDefault creates a FindConfigListenAddressDefault with default headers values +func NewFindConfigListenAddressDefault(code int) *FindConfigListenAddressDefault { + return &FindConfigListenAddressDefault{ + _statusCode: code, + } +} + +/* +FindConfigListenAddressDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigListenAddressDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config listen address default response +func (o *FindConfigListenAddressDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigListenAddressDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigListenAddressDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigListenAddressDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_interface_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_interface_parameters.go new file mode 100644 index 0000000000..da55e93176 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_interface_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigListenInterfaceParams creates a new FindConfigListenInterfaceParams object +// with the default values initialized. +func NewFindConfigListenInterfaceParams() *FindConfigListenInterfaceParams { + + return &FindConfigListenInterfaceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigListenInterfaceParamsWithTimeout creates a new FindConfigListenInterfaceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigListenInterfaceParamsWithTimeout(timeout time.Duration) *FindConfigListenInterfaceParams { + + return &FindConfigListenInterfaceParams{ + + timeout: timeout, + } +} + +// NewFindConfigListenInterfaceParamsWithContext creates a new FindConfigListenInterfaceParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigListenInterfaceParamsWithContext(ctx context.Context) *FindConfigListenInterfaceParams { + + return &FindConfigListenInterfaceParams{ + + Context: ctx, + } +} + +// NewFindConfigListenInterfaceParamsWithHTTPClient creates a new FindConfigListenInterfaceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigListenInterfaceParamsWithHTTPClient(client *http.Client) *FindConfigListenInterfaceParams { + + return &FindConfigListenInterfaceParams{ + HTTPClient: client, + } +} + +/* +FindConfigListenInterfaceParams contains all the parameters to send to the API endpoint +for the find config listen interface operation typically these are written to a http.Request +*/ +type FindConfigListenInterfaceParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config listen interface params +func (o *FindConfigListenInterfaceParams) WithTimeout(timeout time.Duration) *FindConfigListenInterfaceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config listen interface params +func (o *FindConfigListenInterfaceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config listen interface params +func (o *FindConfigListenInterfaceParams) WithContext(ctx context.Context) *FindConfigListenInterfaceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config listen interface params +func (o *FindConfigListenInterfaceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config listen interface params +func (o *FindConfigListenInterfaceParams) WithHTTPClient(client *http.Client) *FindConfigListenInterfaceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config listen interface params +func (o *FindConfigListenInterfaceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigListenInterfaceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_interface_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_interface_responses.go new file mode 100644 index 0000000000..8ec3983700 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_interface_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigListenInterfaceReader is a Reader for the FindConfigListenInterface structure. +type FindConfigListenInterfaceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigListenInterfaceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigListenInterfaceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigListenInterfaceDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigListenInterfaceOK creates a FindConfigListenInterfaceOK with default headers values +func NewFindConfigListenInterfaceOK() *FindConfigListenInterfaceOK { + return &FindConfigListenInterfaceOK{} +} + +/* +FindConfigListenInterfaceOK handles this case with default header values. + +Config value +*/ +type FindConfigListenInterfaceOK struct { + Payload string +} + +func (o *FindConfigListenInterfaceOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigListenInterfaceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigListenInterfaceDefault creates a FindConfigListenInterfaceDefault with default headers values +func NewFindConfigListenInterfaceDefault(code int) *FindConfigListenInterfaceDefault { + return &FindConfigListenInterfaceDefault{ + _statusCode: code, + } +} + +/* +FindConfigListenInterfaceDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigListenInterfaceDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config listen interface default response +func (o *FindConfigListenInterfaceDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigListenInterfaceDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigListenInterfaceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigListenInterfaceDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_on_broadcast_address_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_on_broadcast_address_parameters.go new file mode 100644 index 0000000000..3d7314983f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_on_broadcast_address_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigListenOnBroadcastAddressParams creates a new FindConfigListenOnBroadcastAddressParams object +// with the default values initialized. +func NewFindConfigListenOnBroadcastAddressParams() *FindConfigListenOnBroadcastAddressParams { + + return &FindConfigListenOnBroadcastAddressParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigListenOnBroadcastAddressParamsWithTimeout creates a new FindConfigListenOnBroadcastAddressParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigListenOnBroadcastAddressParamsWithTimeout(timeout time.Duration) *FindConfigListenOnBroadcastAddressParams { + + return &FindConfigListenOnBroadcastAddressParams{ + + timeout: timeout, + } +} + +// NewFindConfigListenOnBroadcastAddressParamsWithContext creates a new FindConfigListenOnBroadcastAddressParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigListenOnBroadcastAddressParamsWithContext(ctx context.Context) *FindConfigListenOnBroadcastAddressParams { + + return &FindConfigListenOnBroadcastAddressParams{ + + Context: ctx, + } +} + +// NewFindConfigListenOnBroadcastAddressParamsWithHTTPClient creates a new FindConfigListenOnBroadcastAddressParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigListenOnBroadcastAddressParamsWithHTTPClient(client *http.Client) *FindConfigListenOnBroadcastAddressParams { + + return &FindConfigListenOnBroadcastAddressParams{ + HTTPClient: client, + } +} + +/* +FindConfigListenOnBroadcastAddressParams contains all the parameters to send to the API endpoint +for the find config listen on broadcast address operation typically these are written to a http.Request +*/ +type FindConfigListenOnBroadcastAddressParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config listen on broadcast address params +func (o *FindConfigListenOnBroadcastAddressParams) WithTimeout(timeout time.Duration) *FindConfigListenOnBroadcastAddressParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config listen on broadcast address params +func (o *FindConfigListenOnBroadcastAddressParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config listen on broadcast address params +func (o *FindConfigListenOnBroadcastAddressParams) WithContext(ctx context.Context) *FindConfigListenOnBroadcastAddressParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config listen on broadcast address params +func (o *FindConfigListenOnBroadcastAddressParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config listen on broadcast address params +func (o *FindConfigListenOnBroadcastAddressParams) WithHTTPClient(client *http.Client) *FindConfigListenOnBroadcastAddressParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config listen on broadcast address params +func (o *FindConfigListenOnBroadcastAddressParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigListenOnBroadcastAddressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_on_broadcast_address_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_on_broadcast_address_responses.go new file mode 100644 index 0000000000..b0bef0c03e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_listen_on_broadcast_address_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigListenOnBroadcastAddressReader is a Reader for the FindConfigListenOnBroadcastAddress structure. +type FindConfigListenOnBroadcastAddressReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigListenOnBroadcastAddressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigListenOnBroadcastAddressOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigListenOnBroadcastAddressDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigListenOnBroadcastAddressOK creates a FindConfigListenOnBroadcastAddressOK with default headers values +func NewFindConfigListenOnBroadcastAddressOK() *FindConfigListenOnBroadcastAddressOK { + return &FindConfigListenOnBroadcastAddressOK{} +} + +/* +FindConfigListenOnBroadcastAddressOK handles this case with default header values. + +Config value +*/ +type FindConfigListenOnBroadcastAddressOK struct { + Payload bool +} + +func (o *FindConfigListenOnBroadcastAddressOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigListenOnBroadcastAddressOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigListenOnBroadcastAddressDefault creates a FindConfigListenOnBroadcastAddressDefault with default headers values +func NewFindConfigListenOnBroadcastAddressDefault(code int) *FindConfigListenOnBroadcastAddressDefault { + return &FindConfigListenOnBroadcastAddressDefault{ + _statusCode: code, + } +} + +/* +FindConfigListenOnBroadcastAddressDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigListenOnBroadcastAddressDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config listen on broadcast address default response +func (o *FindConfigListenOnBroadcastAddressDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigListenOnBroadcastAddressDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigListenOnBroadcastAddressDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigListenOnBroadcastAddressDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_load_balance_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_load_balance_parameters.go new file mode 100644 index 0000000000..a40e870a9d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_load_balance_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigLoadBalanceParams creates a new FindConfigLoadBalanceParams object +// with the default values initialized. +func NewFindConfigLoadBalanceParams() *FindConfigLoadBalanceParams { + + return &FindConfigLoadBalanceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigLoadBalanceParamsWithTimeout creates a new FindConfigLoadBalanceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigLoadBalanceParamsWithTimeout(timeout time.Duration) *FindConfigLoadBalanceParams { + + return &FindConfigLoadBalanceParams{ + + timeout: timeout, + } +} + +// NewFindConfigLoadBalanceParamsWithContext creates a new FindConfigLoadBalanceParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigLoadBalanceParamsWithContext(ctx context.Context) *FindConfigLoadBalanceParams { + + return &FindConfigLoadBalanceParams{ + + Context: ctx, + } +} + +// NewFindConfigLoadBalanceParamsWithHTTPClient creates a new FindConfigLoadBalanceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigLoadBalanceParamsWithHTTPClient(client *http.Client) *FindConfigLoadBalanceParams { + + return &FindConfigLoadBalanceParams{ + HTTPClient: client, + } +} + +/* +FindConfigLoadBalanceParams contains all the parameters to send to the API endpoint +for the find config load balance operation typically these are written to a http.Request +*/ +type FindConfigLoadBalanceParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config load balance params +func (o *FindConfigLoadBalanceParams) WithTimeout(timeout time.Duration) *FindConfigLoadBalanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config load balance params +func (o *FindConfigLoadBalanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config load balance params +func (o *FindConfigLoadBalanceParams) WithContext(ctx context.Context) *FindConfigLoadBalanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config load balance params +func (o *FindConfigLoadBalanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config load balance params +func (o *FindConfigLoadBalanceParams) WithHTTPClient(client *http.Client) *FindConfigLoadBalanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config load balance params +func (o *FindConfigLoadBalanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigLoadBalanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_load_balance_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_load_balance_responses.go new file mode 100644 index 0000000000..b681adaa27 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_load_balance_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigLoadBalanceReader is a Reader for the FindConfigLoadBalance structure. +type FindConfigLoadBalanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigLoadBalanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigLoadBalanceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigLoadBalanceDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigLoadBalanceOK creates a FindConfigLoadBalanceOK with default headers values +func NewFindConfigLoadBalanceOK() *FindConfigLoadBalanceOK { + return &FindConfigLoadBalanceOK{} +} + +/* +FindConfigLoadBalanceOK handles this case with default header values. + +Config value +*/ +type FindConfigLoadBalanceOK struct { + Payload string +} + +func (o *FindConfigLoadBalanceOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigLoadBalanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigLoadBalanceDefault creates a FindConfigLoadBalanceDefault with default headers values +func NewFindConfigLoadBalanceDefault(code int) *FindConfigLoadBalanceDefault { + return &FindConfigLoadBalanceDefault{ + _statusCode: code, + } +} + +/* +FindConfigLoadBalanceDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigLoadBalanceDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config load balance default response +func (o *FindConfigLoadBalanceDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigLoadBalanceDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigLoadBalanceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigLoadBalanceDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_load_ring_state_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_load_ring_state_parameters.go new file mode 100644 index 0000000000..290c158cd6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_load_ring_state_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigLoadRingStateParams creates a new FindConfigLoadRingStateParams object +// with the default values initialized. +func NewFindConfigLoadRingStateParams() *FindConfigLoadRingStateParams { + + return &FindConfigLoadRingStateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigLoadRingStateParamsWithTimeout creates a new FindConfigLoadRingStateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigLoadRingStateParamsWithTimeout(timeout time.Duration) *FindConfigLoadRingStateParams { + + return &FindConfigLoadRingStateParams{ + + timeout: timeout, + } +} + +// NewFindConfigLoadRingStateParamsWithContext creates a new FindConfigLoadRingStateParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigLoadRingStateParamsWithContext(ctx context.Context) *FindConfigLoadRingStateParams { + + return &FindConfigLoadRingStateParams{ + + Context: ctx, + } +} + +// NewFindConfigLoadRingStateParamsWithHTTPClient creates a new FindConfigLoadRingStateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigLoadRingStateParamsWithHTTPClient(client *http.Client) *FindConfigLoadRingStateParams { + + return &FindConfigLoadRingStateParams{ + HTTPClient: client, + } +} + +/* +FindConfigLoadRingStateParams contains all the parameters to send to the API endpoint +for the find config load ring state operation typically these are written to a http.Request +*/ +type FindConfigLoadRingStateParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config load ring state params +func (o *FindConfigLoadRingStateParams) WithTimeout(timeout time.Duration) *FindConfigLoadRingStateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config load ring state params +func (o *FindConfigLoadRingStateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config load ring state params +func (o *FindConfigLoadRingStateParams) WithContext(ctx context.Context) *FindConfigLoadRingStateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config load ring state params +func (o *FindConfigLoadRingStateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config load ring state params +func (o *FindConfigLoadRingStateParams) WithHTTPClient(client *http.Client) *FindConfigLoadRingStateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config load ring state params +func (o *FindConfigLoadRingStateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigLoadRingStateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_load_ring_state_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_load_ring_state_responses.go new file mode 100644 index 0000000000..3e6352dc01 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_load_ring_state_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigLoadRingStateReader is a Reader for the FindConfigLoadRingState structure. +type FindConfigLoadRingStateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigLoadRingStateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigLoadRingStateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigLoadRingStateDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigLoadRingStateOK creates a FindConfigLoadRingStateOK with default headers values +func NewFindConfigLoadRingStateOK() *FindConfigLoadRingStateOK { + return &FindConfigLoadRingStateOK{} +} + +/* +FindConfigLoadRingStateOK handles this case with default header values. + +Config value +*/ +type FindConfigLoadRingStateOK struct { + Payload bool +} + +func (o *FindConfigLoadRingStateOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigLoadRingStateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigLoadRingStateDefault creates a FindConfigLoadRingStateDefault with default headers values +func NewFindConfigLoadRingStateDefault(code int) *FindConfigLoadRingStateDefault { + return &FindConfigLoadRingStateDefault{ + _statusCode: code, + } +} + +/* +FindConfigLoadRingStateDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigLoadRingStateDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config load ring state default response +func (o *FindConfigLoadRingStateDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigLoadRingStateDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigLoadRingStateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigLoadRingStateDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_log_to_stdout_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_log_to_stdout_parameters.go new file mode 100644 index 0000000000..32180b8a29 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_log_to_stdout_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigLogToStdoutParams creates a new FindConfigLogToStdoutParams object +// with the default values initialized. +func NewFindConfigLogToStdoutParams() *FindConfigLogToStdoutParams { + + return &FindConfigLogToStdoutParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigLogToStdoutParamsWithTimeout creates a new FindConfigLogToStdoutParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigLogToStdoutParamsWithTimeout(timeout time.Duration) *FindConfigLogToStdoutParams { + + return &FindConfigLogToStdoutParams{ + + timeout: timeout, + } +} + +// NewFindConfigLogToStdoutParamsWithContext creates a new FindConfigLogToStdoutParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigLogToStdoutParamsWithContext(ctx context.Context) *FindConfigLogToStdoutParams { + + return &FindConfigLogToStdoutParams{ + + Context: ctx, + } +} + +// NewFindConfigLogToStdoutParamsWithHTTPClient creates a new FindConfigLogToStdoutParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigLogToStdoutParamsWithHTTPClient(client *http.Client) *FindConfigLogToStdoutParams { + + return &FindConfigLogToStdoutParams{ + HTTPClient: client, + } +} + +/* +FindConfigLogToStdoutParams contains all the parameters to send to the API endpoint +for the find config log to stdout operation typically these are written to a http.Request +*/ +type FindConfigLogToStdoutParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config log to stdout params +func (o *FindConfigLogToStdoutParams) WithTimeout(timeout time.Duration) *FindConfigLogToStdoutParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config log to stdout params +func (o *FindConfigLogToStdoutParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config log to stdout params +func (o *FindConfigLogToStdoutParams) WithContext(ctx context.Context) *FindConfigLogToStdoutParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config log to stdout params +func (o *FindConfigLogToStdoutParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config log to stdout params +func (o *FindConfigLogToStdoutParams) WithHTTPClient(client *http.Client) *FindConfigLogToStdoutParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config log to stdout params +func (o *FindConfigLogToStdoutParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigLogToStdoutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_log_to_stdout_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_log_to_stdout_responses.go new file mode 100644 index 0000000000..769d4632fd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_log_to_stdout_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigLogToStdoutReader is a Reader for the FindConfigLogToStdout structure. +type FindConfigLogToStdoutReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigLogToStdoutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigLogToStdoutOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigLogToStdoutDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigLogToStdoutOK creates a FindConfigLogToStdoutOK with default headers values +func NewFindConfigLogToStdoutOK() *FindConfigLogToStdoutOK { + return &FindConfigLogToStdoutOK{} +} + +/* +FindConfigLogToStdoutOK handles this case with default header values. + +Config value +*/ +type FindConfigLogToStdoutOK struct { + Payload bool +} + +func (o *FindConfigLogToStdoutOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigLogToStdoutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigLogToStdoutDefault creates a FindConfigLogToStdoutDefault with default headers values +func NewFindConfigLogToStdoutDefault(code int) *FindConfigLogToStdoutDefault { + return &FindConfigLogToStdoutDefault{ + _statusCode: code, + } +} + +/* +FindConfigLogToStdoutDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigLogToStdoutDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config log to stdout default response +func (o *FindConfigLogToStdoutDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigLogToStdoutDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigLogToStdoutDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigLogToStdoutDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_log_to_syslog_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_log_to_syslog_parameters.go new file mode 100644 index 0000000000..cd33acbd51 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_log_to_syslog_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigLogToSyslogParams creates a new FindConfigLogToSyslogParams object +// with the default values initialized. +func NewFindConfigLogToSyslogParams() *FindConfigLogToSyslogParams { + + return &FindConfigLogToSyslogParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigLogToSyslogParamsWithTimeout creates a new FindConfigLogToSyslogParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigLogToSyslogParamsWithTimeout(timeout time.Duration) *FindConfigLogToSyslogParams { + + return &FindConfigLogToSyslogParams{ + + timeout: timeout, + } +} + +// NewFindConfigLogToSyslogParamsWithContext creates a new FindConfigLogToSyslogParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigLogToSyslogParamsWithContext(ctx context.Context) *FindConfigLogToSyslogParams { + + return &FindConfigLogToSyslogParams{ + + Context: ctx, + } +} + +// NewFindConfigLogToSyslogParamsWithHTTPClient creates a new FindConfigLogToSyslogParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigLogToSyslogParamsWithHTTPClient(client *http.Client) *FindConfigLogToSyslogParams { + + return &FindConfigLogToSyslogParams{ + HTTPClient: client, + } +} + +/* +FindConfigLogToSyslogParams contains all the parameters to send to the API endpoint +for the find config log to syslog operation typically these are written to a http.Request +*/ +type FindConfigLogToSyslogParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config log to syslog params +func (o *FindConfigLogToSyslogParams) WithTimeout(timeout time.Duration) *FindConfigLogToSyslogParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config log to syslog params +func (o *FindConfigLogToSyslogParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config log to syslog params +func (o *FindConfigLogToSyslogParams) WithContext(ctx context.Context) *FindConfigLogToSyslogParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config log to syslog params +func (o *FindConfigLogToSyslogParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config log to syslog params +func (o *FindConfigLogToSyslogParams) WithHTTPClient(client *http.Client) *FindConfigLogToSyslogParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config log to syslog params +func (o *FindConfigLogToSyslogParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigLogToSyslogParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_log_to_syslog_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_log_to_syslog_responses.go new file mode 100644 index 0000000000..1f30ad1507 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_log_to_syslog_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigLogToSyslogReader is a Reader for the FindConfigLogToSyslog structure. +type FindConfigLogToSyslogReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigLogToSyslogReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigLogToSyslogOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigLogToSyslogDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigLogToSyslogOK creates a FindConfigLogToSyslogOK with default headers values +func NewFindConfigLogToSyslogOK() *FindConfigLogToSyslogOK { + return &FindConfigLogToSyslogOK{} +} + +/* +FindConfigLogToSyslogOK handles this case with default header values. + +Config value +*/ +type FindConfigLogToSyslogOK struct { + Payload bool +} + +func (o *FindConfigLogToSyslogOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigLogToSyslogOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigLogToSyslogDefault creates a FindConfigLogToSyslogDefault with default headers values +func NewFindConfigLogToSyslogDefault(code int) *FindConfigLogToSyslogDefault { + return &FindConfigLogToSyslogDefault{ + _statusCode: code, + } +} + +/* +FindConfigLogToSyslogDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigLogToSyslogDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config log to syslog default response +func (o *FindConfigLogToSyslogDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigLogToSyslogDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigLogToSyslogDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigLogToSyslogDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_logger_log_level_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_logger_log_level_parameters.go new file mode 100644 index 0000000000..4671581e1f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_logger_log_level_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigLoggerLogLevelParams creates a new FindConfigLoggerLogLevelParams object +// with the default values initialized. +func NewFindConfigLoggerLogLevelParams() *FindConfigLoggerLogLevelParams { + + return &FindConfigLoggerLogLevelParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigLoggerLogLevelParamsWithTimeout creates a new FindConfigLoggerLogLevelParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigLoggerLogLevelParamsWithTimeout(timeout time.Duration) *FindConfigLoggerLogLevelParams { + + return &FindConfigLoggerLogLevelParams{ + + timeout: timeout, + } +} + +// NewFindConfigLoggerLogLevelParamsWithContext creates a new FindConfigLoggerLogLevelParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigLoggerLogLevelParamsWithContext(ctx context.Context) *FindConfigLoggerLogLevelParams { + + return &FindConfigLoggerLogLevelParams{ + + Context: ctx, + } +} + +// NewFindConfigLoggerLogLevelParamsWithHTTPClient creates a new FindConfigLoggerLogLevelParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigLoggerLogLevelParamsWithHTTPClient(client *http.Client) *FindConfigLoggerLogLevelParams { + + return &FindConfigLoggerLogLevelParams{ + HTTPClient: client, + } +} + +/* +FindConfigLoggerLogLevelParams contains all the parameters to send to the API endpoint +for the find config logger log level operation typically these are written to a http.Request +*/ +type FindConfigLoggerLogLevelParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config logger log level params +func (o *FindConfigLoggerLogLevelParams) WithTimeout(timeout time.Duration) *FindConfigLoggerLogLevelParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config logger log level params +func (o *FindConfigLoggerLogLevelParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config logger log level params +func (o *FindConfigLoggerLogLevelParams) WithContext(ctx context.Context) *FindConfigLoggerLogLevelParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config logger log level params +func (o *FindConfigLoggerLogLevelParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config logger log level params +func (o *FindConfigLoggerLogLevelParams) WithHTTPClient(client *http.Client) *FindConfigLoggerLogLevelParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config logger log level params +func (o *FindConfigLoggerLogLevelParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigLoggerLogLevelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_logger_log_level_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_logger_log_level_responses.go new file mode 100644 index 0000000000..9fc3c1f0eb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_logger_log_level_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigLoggerLogLevelReader is a Reader for the FindConfigLoggerLogLevel structure. +type FindConfigLoggerLogLevelReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigLoggerLogLevelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigLoggerLogLevelOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigLoggerLogLevelDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigLoggerLogLevelOK creates a FindConfigLoggerLogLevelOK with default headers values +func NewFindConfigLoggerLogLevelOK() *FindConfigLoggerLogLevelOK { + return &FindConfigLoggerLogLevelOK{} +} + +/* +FindConfigLoggerLogLevelOK handles this case with default header values. + +Config value +*/ +type FindConfigLoggerLogLevelOK struct { + Payload []string +} + +func (o *FindConfigLoggerLogLevelOK) GetPayload() []string { + return o.Payload +} + +func (o *FindConfigLoggerLogLevelOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigLoggerLogLevelDefault creates a FindConfigLoggerLogLevelDefault with default headers values +func NewFindConfigLoggerLogLevelDefault(code int) *FindConfigLoggerLogLevelDefault { + return &FindConfigLoggerLogLevelDefault{ + _statusCode: code, + } +} + +/* +FindConfigLoggerLogLevelDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigLoggerLogLevelDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config logger log level default response +func (o *FindConfigLoggerLogLevelDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigLoggerLogLevelDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigLoggerLogLevelDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigLoggerLogLevelDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_lsa_reclamation_step_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_lsa_reclamation_step_parameters.go new file mode 100644 index 0000000000..2d96d41472 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_lsa_reclamation_step_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigLsaReclamationStepParams creates a new FindConfigLsaReclamationStepParams object +// with the default values initialized. +func NewFindConfigLsaReclamationStepParams() *FindConfigLsaReclamationStepParams { + + return &FindConfigLsaReclamationStepParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigLsaReclamationStepParamsWithTimeout creates a new FindConfigLsaReclamationStepParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigLsaReclamationStepParamsWithTimeout(timeout time.Duration) *FindConfigLsaReclamationStepParams { + + return &FindConfigLsaReclamationStepParams{ + + timeout: timeout, + } +} + +// NewFindConfigLsaReclamationStepParamsWithContext creates a new FindConfigLsaReclamationStepParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigLsaReclamationStepParamsWithContext(ctx context.Context) *FindConfigLsaReclamationStepParams { + + return &FindConfigLsaReclamationStepParams{ + + Context: ctx, + } +} + +// NewFindConfigLsaReclamationStepParamsWithHTTPClient creates a new FindConfigLsaReclamationStepParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigLsaReclamationStepParamsWithHTTPClient(client *http.Client) *FindConfigLsaReclamationStepParams { + + return &FindConfigLsaReclamationStepParams{ + HTTPClient: client, + } +} + +/* +FindConfigLsaReclamationStepParams contains all the parameters to send to the API endpoint +for the find config lsa reclamation step operation typically these are written to a http.Request +*/ +type FindConfigLsaReclamationStepParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config lsa reclamation step params +func (o *FindConfigLsaReclamationStepParams) WithTimeout(timeout time.Duration) *FindConfigLsaReclamationStepParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config lsa reclamation step params +func (o *FindConfigLsaReclamationStepParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config lsa reclamation step params +func (o *FindConfigLsaReclamationStepParams) WithContext(ctx context.Context) *FindConfigLsaReclamationStepParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config lsa reclamation step params +func (o *FindConfigLsaReclamationStepParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config lsa reclamation step params +func (o *FindConfigLsaReclamationStepParams) WithHTTPClient(client *http.Client) *FindConfigLsaReclamationStepParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config lsa reclamation step params +func (o *FindConfigLsaReclamationStepParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigLsaReclamationStepParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_lsa_reclamation_step_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_lsa_reclamation_step_responses.go new file mode 100644 index 0000000000..13b4bd2c07 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_lsa_reclamation_step_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigLsaReclamationStepReader is a Reader for the FindConfigLsaReclamationStep structure. +type FindConfigLsaReclamationStepReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigLsaReclamationStepReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigLsaReclamationStepOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigLsaReclamationStepDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigLsaReclamationStepOK creates a FindConfigLsaReclamationStepOK with default headers values +func NewFindConfigLsaReclamationStepOK() *FindConfigLsaReclamationStepOK { + return &FindConfigLsaReclamationStepOK{} +} + +/* +FindConfigLsaReclamationStepOK handles this case with default header values. + +Config value +*/ +type FindConfigLsaReclamationStepOK struct { + Payload int64 +} + +func (o *FindConfigLsaReclamationStepOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigLsaReclamationStepOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigLsaReclamationStepDefault creates a FindConfigLsaReclamationStepDefault with default headers values +func NewFindConfigLsaReclamationStepDefault(code int) *FindConfigLsaReclamationStepDefault { + return &FindConfigLsaReclamationStepDefault{ + _statusCode: code, + } +} + +/* +FindConfigLsaReclamationStepDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigLsaReclamationStepDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config lsa reclamation step default response +func (o *FindConfigLsaReclamationStepDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigLsaReclamationStepDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigLsaReclamationStepDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigLsaReclamationStepDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_max_hint_window_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_max_hint_window_in_ms_parameters.go new file mode 100644 index 0000000000..89d4672060 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_max_hint_window_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigMaxHintWindowInMsParams creates a new FindConfigMaxHintWindowInMsParams object +// with the default values initialized. +func NewFindConfigMaxHintWindowInMsParams() *FindConfigMaxHintWindowInMsParams { + + return &FindConfigMaxHintWindowInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigMaxHintWindowInMsParamsWithTimeout creates a new FindConfigMaxHintWindowInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigMaxHintWindowInMsParamsWithTimeout(timeout time.Duration) *FindConfigMaxHintWindowInMsParams { + + return &FindConfigMaxHintWindowInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigMaxHintWindowInMsParamsWithContext creates a new FindConfigMaxHintWindowInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigMaxHintWindowInMsParamsWithContext(ctx context.Context) *FindConfigMaxHintWindowInMsParams { + + return &FindConfigMaxHintWindowInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigMaxHintWindowInMsParamsWithHTTPClient creates a new FindConfigMaxHintWindowInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigMaxHintWindowInMsParamsWithHTTPClient(client *http.Client) *FindConfigMaxHintWindowInMsParams { + + return &FindConfigMaxHintWindowInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigMaxHintWindowInMsParams contains all the parameters to send to the API endpoint +for the find config max hint window in ms operation typically these are written to a http.Request +*/ +type FindConfigMaxHintWindowInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config max hint window in ms params +func (o *FindConfigMaxHintWindowInMsParams) WithTimeout(timeout time.Duration) *FindConfigMaxHintWindowInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config max hint window in ms params +func (o *FindConfigMaxHintWindowInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config max hint window in ms params +func (o *FindConfigMaxHintWindowInMsParams) WithContext(ctx context.Context) *FindConfigMaxHintWindowInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config max hint window in ms params +func (o *FindConfigMaxHintWindowInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config max hint window in ms params +func (o *FindConfigMaxHintWindowInMsParams) WithHTTPClient(client *http.Client) *FindConfigMaxHintWindowInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config max hint window in ms params +func (o *FindConfigMaxHintWindowInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigMaxHintWindowInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_max_hint_window_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_max_hint_window_in_ms_responses.go new file mode 100644 index 0000000000..4249efd02c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_max_hint_window_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigMaxHintWindowInMsReader is a Reader for the FindConfigMaxHintWindowInMs structure. +type FindConfigMaxHintWindowInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigMaxHintWindowInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigMaxHintWindowInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigMaxHintWindowInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigMaxHintWindowInMsOK creates a FindConfigMaxHintWindowInMsOK with default headers values +func NewFindConfigMaxHintWindowInMsOK() *FindConfigMaxHintWindowInMsOK { + return &FindConfigMaxHintWindowInMsOK{} +} + +/* +FindConfigMaxHintWindowInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigMaxHintWindowInMsOK struct { + Payload int64 +} + +func (o *FindConfigMaxHintWindowInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigMaxHintWindowInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigMaxHintWindowInMsDefault creates a FindConfigMaxHintWindowInMsDefault with default headers values +func NewFindConfigMaxHintWindowInMsDefault(code int) *FindConfigMaxHintWindowInMsDefault { + return &FindConfigMaxHintWindowInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigMaxHintWindowInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigMaxHintWindowInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config max hint window in ms default response +func (o *FindConfigMaxHintWindowInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigMaxHintWindowInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigMaxHintWindowInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigMaxHintWindowInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_max_hints_delivery_threads_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_max_hints_delivery_threads_parameters.go new file mode 100644 index 0000000000..0897f87d5f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_max_hints_delivery_threads_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigMaxHintsDeliveryThreadsParams creates a new FindConfigMaxHintsDeliveryThreadsParams object +// with the default values initialized. +func NewFindConfigMaxHintsDeliveryThreadsParams() *FindConfigMaxHintsDeliveryThreadsParams { + + return &FindConfigMaxHintsDeliveryThreadsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigMaxHintsDeliveryThreadsParamsWithTimeout creates a new FindConfigMaxHintsDeliveryThreadsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigMaxHintsDeliveryThreadsParamsWithTimeout(timeout time.Duration) *FindConfigMaxHintsDeliveryThreadsParams { + + return &FindConfigMaxHintsDeliveryThreadsParams{ + + timeout: timeout, + } +} + +// NewFindConfigMaxHintsDeliveryThreadsParamsWithContext creates a new FindConfigMaxHintsDeliveryThreadsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigMaxHintsDeliveryThreadsParamsWithContext(ctx context.Context) *FindConfigMaxHintsDeliveryThreadsParams { + + return &FindConfigMaxHintsDeliveryThreadsParams{ + + Context: ctx, + } +} + +// NewFindConfigMaxHintsDeliveryThreadsParamsWithHTTPClient creates a new FindConfigMaxHintsDeliveryThreadsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigMaxHintsDeliveryThreadsParamsWithHTTPClient(client *http.Client) *FindConfigMaxHintsDeliveryThreadsParams { + + return &FindConfigMaxHintsDeliveryThreadsParams{ + HTTPClient: client, + } +} + +/* +FindConfigMaxHintsDeliveryThreadsParams contains all the parameters to send to the API endpoint +for the find config max hints delivery threads operation typically these are written to a http.Request +*/ +type FindConfigMaxHintsDeliveryThreadsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config max hints delivery threads params +func (o *FindConfigMaxHintsDeliveryThreadsParams) WithTimeout(timeout time.Duration) *FindConfigMaxHintsDeliveryThreadsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config max hints delivery threads params +func (o *FindConfigMaxHintsDeliveryThreadsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config max hints delivery threads params +func (o *FindConfigMaxHintsDeliveryThreadsParams) WithContext(ctx context.Context) *FindConfigMaxHintsDeliveryThreadsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config max hints delivery threads params +func (o *FindConfigMaxHintsDeliveryThreadsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config max hints delivery threads params +func (o *FindConfigMaxHintsDeliveryThreadsParams) WithHTTPClient(client *http.Client) *FindConfigMaxHintsDeliveryThreadsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config max hints delivery threads params +func (o *FindConfigMaxHintsDeliveryThreadsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigMaxHintsDeliveryThreadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_max_hints_delivery_threads_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_max_hints_delivery_threads_responses.go new file mode 100644 index 0000000000..a5f350f39a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_max_hints_delivery_threads_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigMaxHintsDeliveryThreadsReader is a Reader for the FindConfigMaxHintsDeliveryThreads structure. +type FindConfigMaxHintsDeliveryThreadsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigMaxHintsDeliveryThreadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigMaxHintsDeliveryThreadsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigMaxHintsDeliveryThreadsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigMaxHintsDeliveryThreadsOK creates a FindConfigMaxHintsDeliveryThreadsOK with default headers values +func NewFindConfigMaxHintsDeliveryThreadsOK() *FindConfigMaxHintsDeliveryThreadsOK { + return &FindConfigMaxHintsDeliveryThreadsOK{} +} + +/* +FindConfigMaxHintsDeliveryThreadsOK handles this case with default header values. + +Config value +*/ +type FindConfigMaxHintsDeliveryThreadsOK struct { + Payload int64 +} + +func (o *FindConfigMaxHintsDeliveryThreadsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigMaxHintsDeliveryThreadsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigMaxHintsDeliveryThreadsDefault creates a FindConfigMaxHintsDeliveryThreadsDefault with default headers values +func NewFindConfigMaxHintsDeliveryThreadsDefault(code int) *FindConfigMaxHintsDeliveryThreadsDefault { + return &FindConfigMaxHintsDeliveryThreadsDefault{ + _statusCode: code, + } +} + +/* +FindConfigMaxHintsDeliveryThreadsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigMaxHintsDeliveryThreadsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config max hints delivery threads default response +func (o *FindConfigMaxHintsDeliveryThreadsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigMaxHintsDeliveryThreadsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigMaxHintsDeliveryThreadsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigMaxHintsDeliveryThreadsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memory_allocator_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memory_allocator_parameters.go new file mode 100644 index 0000000000..f9f44bd14a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memory_allocator_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigMemoryAllocatorParams creates a new FindConfigMemoryAllocatorParams object +// with the default values initialized. +func NewFindConfigMemoryAllocatorParams() *FindConfigMemoryAllocatorParams { + + return &FindConfigMemoryAllocatorParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigMemoryAllocatorParamsWithTimeout creates a new FindConfigMemoryAllocatorParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigMemoryAllocatorParamsWithTimeout(timeout time.Duration) *FindConfigMemoryAllocatorParams { + + return &FindConfigMemoryAllocatorParams{ + + timeout: timeout, + } +} + +// NewFindConfigMemoryAllocatorParamsWithContext creates a new FindConfigMemoryAllocatorParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigMemoryAllocatorParamsWithContext(ctx context.Context) *FindConfigMemoryAllocatorParams { + + return &FindConfigMemoryAllocatorParams{ + + Context: ctx, + } +} + +// NewFindConfigMemoryAllocatorParamsWithHTTPClient creates a new FindConfigMemoryAllocatorParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigMemoryAllocatorParamsWithHTTPClient(client *http.Client) *FindConfigMemoryAllocatorParams { + + return &FindConfigMemoryAllocatorParams{ + HTTPClient: client, + } +} + +/* +FindConfigMemoryAllocatorParams contains all the parameters to send to the API endpoint +for the find config memory allocator operation typically these are written to a http.Request +*/ +type FindConfigMemoryAllocatorParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config memory allocator params +func (o *FindConfigMemoryAllocatorParams) WithTimeout(timeout time.Duration) *FindConfigMemoryAllocatorParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config memory allocator params +func (o *FindConfigMemoryAllocatorParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config memory allocator params +func (o *FindConfigMemoryAllocatorParams) WithContext(ctx context.Context) *FindConfigMemoryAllocatorParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config memory allocator params +func (o *FindConfigMemoryAllocatorParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config memory allocator params +func (o *FindConfigMemoryAllocatorParams) WithHTTPClient(client *http.Client) *FindConfigMemoryAllocatorParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config memory allocator params +func (o *FindConfigMemoryAllocatorParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigMemoryAllocatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memory_allocator_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memory_allocator_responses.go new file mode 100644 index 0000000000..06c459c391 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memory_allocator_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigMemoryAllocatorReader is a Reader for the FindConfigMemoryAllocator structure. +type FindConfigMemoryAllocatorReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigMemoryAllocatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigMemoryAllocatorOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigMemoryAllocatorDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigMemoryAllocatorOK creates a FindConfigMemoryAllocatorOK with default headers values +func NewFindConfigMemoryAllocatorOK() *FindConfigMemoryAllocatorOK { + return &FindConfigMemoryAllocatorOK{} +} + +/* +FindConfigMemoryAllocatorOK handles this case with default header values. + +Config value +*/ +type FindConfigMemoryAllocatorOK struct { + Payload string +} + +func (o *FindConfigMemoryAllocatorOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigMemoryAllocatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigMemoryAllocatorDefault creates a FindConfigMemoryAllocatorDefault with default headers values +func NewFindConfigMemoryAllocatorDefault(code int) *FindConfigMemoryAllocatorDefault { + return &FindConfigMemoryAllocatorDefault{ + _statusCode: code, + } +} + +/* +FindConfigMemoryAllocatorDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigMemoryAllocatorDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config memory allocator default response +func (o *FindConfigMemoryAllocatorDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigMemoryAllocatorDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigMemoryAllocatorDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigMemoryAllocatorDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_allocation_type_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_allocation_type_parameters.go new file mode 100644 index 0000000000..68335b8705 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_allocation_type_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigMemtableAllocationTypeParams creates a new FindConfigMemtableAllocationTypeParams object +// with the default values initialized. +func NewFindConfigMemtableAllocationTypeParams() *FindConfigMemtableAllocationTypeParams { + + return &FindConfigMemtableAllocationTypeParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigMemtableAllocationTypeParamsWithTimeout creates a new FindConfigMemtableAllocationTypeParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigMemtableAllocationTypeParamsWithTimeout(timeout time.Duration) *FindConfigMemtableAllocationTypeParams { + + return &FindConfigMemtableAllocationTypeParams{ + + timeout: timeout, + } +} + +// NewFindConfigMemtableAllocationTypeParamsWithContext creates a new FindConfigMemtableAllocationTypeParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigMemtableAllocationTypeParamsWithContext(ctx context.Context) *FindConfigMemtableAllocationTypeParams { + + return &FindConfigMemtableAllocationTypeParams{ + + Context: ctx, + } +} + +// NewFindConfigMemtableAllocationTypeParamsWithHTTPClient creates a new FindConfigMemtableAllocationTypeParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigMemtableAllocationTypeParamsWithHTTPClient(client *http.Client) *FindConfigMemtableAllocationTypeParams { + + return &FindConfigMemtableAllocationTypeParams{ + HTTPClient: client, + } +} + +/* +FindConfigMemtableAllocationTypeParams contains all the parameters to send to the API endpoint +for the find config memtable allocation type operation typically these are written to a http.Request +*/ +type FindConfigMemtableAllocationTypeParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config memtable allocation type params +func (o *FindConfigMemtableAllocationTypeParams) WithTimeout(timeout time.Duration) *FindConfigMemtableAllocationTypeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config memtable allocation type params +func (o *FindConfigMemtableAllocationTypeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config memtable allocation type params +func (o *FindConfigMemtableAllocationTypeParams) WithContext(ctx context.Context) *FindConfigMemtableAllocationTypeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config memtable allocation type params +func (o *FindConfigMemtableAllocationTypeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config memtable allocation type params +func (o *FindConfigMemtableAllocationTypeParams) WithHTTPClient(client *http.Client) *FindConfigMemtableAllocationTypeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config memtable allocation type params +func (o *FindConfigMemtableAllocationTypeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigMemtableAllocationTypeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_allocation_type_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_allocation_type_responses.go new file mode 100644 index 0000000000..5c334e823a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_allocation_type_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigMemtableAllocationTypeReader is a Reader for the FindConfigMemtableAllocationType structure. +type FindConfigMemtableAllocationTypeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigMemtableAllocationTypeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigMemtableAllocationTypeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigMemtableAllocationTypeDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigMemtableAllocationTypeOK creates a FindConfigMemtableAllocationTypeOK with default headers values +func NewFindConfigMemtableAllocationTypeOK() *FindConfigMemtableAllocationTypeOK { + return &FindConfigMemtableAllocationTypeOK{} +} + +/* +FindConfigMemtableAllocationTypeOK handles this case with default header values. + +Config value +*/ +type FindConfigMemtableAllocationTypeOK struct { + Payload string +} + +func (o *FindConfigMemtableAllocationTypeOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigMemtableAllocationTypeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigMemtableAllocationTypeDefault creates a FindConfigMemtableAllocationTypeDefault with default headers values +func NewFindConfigMemtableAllocationTypeDefault(code int) *FindConfigMemtableAllocationTypeDefault { + return &FindConfigMemtableAllocationTypeDefault{ + _statusCode: code, + } +} + +/* +FindConfigMemtableAllocationTypeDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigMemtableAllocationTypeDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config memtable allocation type default response +func (o *FindConfigMemtableAllocationTypeDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigMemtableAllocationTypeDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigMemtableAllocationTypeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigMemtableAllocationTypeDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_cleanup_threshold_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_cleanup_threshold_parameters.go new file mode 100644 index 0000000000..3c924bd156 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_cleanup_threshold_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigMemtableCleanupThresholdParams creates a new FindConfigMemtableCleanupThresholdParams object +// with the default values initialized. +func NewFindConfigMemtableCleanupThresholdParams() *FindConfigMemtableCleanupThresholdParams { + + return &FindConfigMemtableCleanupThresholdParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigMemtableCleanupThresholdParamsWithTimeout creates a new FindConfigMemtableCleanupThresholdParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigMemtableCleanupThresholdParamsWithTimeout(timeout time.Duration) *FindConfigMemtableCleanupThresholdParams { + + return &FindConfigMemtableCleanupThresholdParams{ + + timeout: timeout, + } +} + +// NewFindConfigMemtableCleanupThresholdParamsWithContext creates a new FindConfigMemtableCleanupThresholdParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigMemtableCleanupThresholdParamsWithContext(ctx context.Context) *FindConfigMemtableCleanupThresholdParams { + + return &FindConfigMemtableCleanupThresholdParams{ + + Context: ctx, + } +} + +// NewFindConfigMemtableCleanupThresholdParamsWithHTTPClient creates a new FindConfigMemtableCleanupThresholdParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigMemtableCleanupThresholdParamsWithHTTPClient(client *http.Client) *FindConfigMemtableCleanupThresholdParams { + + return &FindConfigMemtableCleanupThresholdParams{ + HTTPClient: client, + } +} + +/* +FindConfigMemtableCleanupThresholdParams contains all the parameters to send to the API endpoint +for the find config memtable cleanup threshold operation typically these are written to a http.Request +*/ +type FindConfigMemtableCleanupThresholdParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config memtable cleanup threshold params +func (o *FindConfigMemtableCleanupThresholdParams) WithTimeout(timeout time.Duration) *FindConfigMemtableCleanupThresholdParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config memtable cleanup threshold params +func (o *FindConfigMemtableCleanupThresholdParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config memtable cleanup threshold params +func (o *FindConfigMemtableCleanupThresholdParams) WithContext(ctx context.Context) *FindConfigMemtableCleanupThresholdParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config memtable cleanup threshold params +func (o *FindConfigMemtableCleanupThresholdParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config memtable cleanup threshold params +func (o *FindConfigMemtableCleanupThresholdParams) WithHTTPClient(client *http.Client) *FindConfigMemtableCleanupThresholdParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config memtable cleanup threshold params +func (o *FindConfigMemtableCleanupThresholdParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigMemtableCleanupThresholdParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_cleanup_threshold_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_cleanup_threshold_responses.go new file mode 100644 index 0000000000..3c68ed4526 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_cleanup_threshold_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigMemtableCleanupThresholdReader is a Reader for the FindConfigMemtableCleanupThreshold structure. +type FindConfigMemtableCleanupThresholdReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigMemtableCleanupThresholdReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigMemtableCleanupThresholdOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigMemtableCleanupThresholdDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigMemtableCleanupThresholdOK creates a FindConfigMemtableCleanupThresholdOK with default headers values +func NewFindConfigMemtableCleanupThresholdOK() *FindConfigMemtableCleanupThresholdOK { + return &FindConfigMemtableCleanupThresholdOK{} +} + +/* +FindConfigMemtableCleanupThresholdOK handles this case with default header values. + +Config value +*/ +type FindConfigMemtableCleanupThresholdOK struct { + Payload float64 +} + +func (o *FindConfigMemtableCleanupThresholdOK) GetPayload() float64 { + return o.Payload +} + +func (o *FindConfigMemtableCleanupThresholdOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigMemtableCleanupThresholdDefault creates a FindConfigMemtableCleanupThresholdDefault with default headers values +func NewFindConfigMemtableCleanupThresholdDefault(code int) *FindConfigMemtableCleanupThresholdDefault { + return &FindConfigMemtableCleanupThresholdDefault{ + _statusCode: code, + } +} + +/* +FindConfigMemtableCleanupThresholdDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigMemtableCleanupThresholdDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config memtable cleanup threshold default response +func (o *FindConfigMemtableCleanupThresholdDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigMemtableCleanupThresholdDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigMemtableCleanupThresholdDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigMemtableCleanupThresholdDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_queue_size_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_queue_size_parameters.go new file mode 100644 index 0000000000..09c8c26e95 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_queue_size_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigMemtableFlushQueueSizeParams creates a new FindConfigMemtableFlushQueueSizeParams object +// with the default values initialized. +func NewFindConfigMemtableFlushQueueSizeParams() *FindConfigMemtableFlushQueueSizeParams { + + return &FindConfigMemtableFlushQueueSizeParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigMemtableFlushQueueSizeParamsWithTimeout creates a new FindConfigMemtableFlushQueueSizeParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigMemtableFlushQueueSizeParamsWithTimeout(timeout time.Duration) *FindConfigMemtableFlushQueueSizeParams { + + return &FindConfigMemtableFlushQueueSizeParams{ + + timeout: timeout, + } +} + +// NewFindConfigMemtableFlushQueueSizeParamsWithContext creates a new FindConfigMemtableFlushQueueSizeParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigMemtableFlushQueueSizeParamsWithContext(ctx context.Context) *FindConfigMemtableFlushQueueSizeParams { + + return &FindConfigMemtableFlushQueueSizeParams{ + + Context: ctx, + } +} + +// NewFindConfigMemtableFlushQueueSizeParamsWithHTTPClient creates a new FindConfigMemtableFlushQueueSizeParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigMemtableFlushQueueSizeParamsWithHTTPClient(client *http.Client) *FindConfigMemtableFlushQueueSizeParams { + + return &FindConfigMemtableFlushQueueSizeParams{ + HTTPClient: client, + } +} + +/* +FindConfigMemtableFlushQueueSizeParams contains all the parameters to send to the API endpoint +for the find config memtable flush queue size operation typically these are written to a http.Request +*/ +type FindConfigMemtableFlushQueueSizeParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config memtable flush queue size params +func (o *FindConfigMemtableFlushQueueSizeParams) WithTimeout(timeout time.Duration) *FindConfigMemtableFlushQueueSizeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config memtable flush queue size params +func (o *FindConfigMemtableFlushQueueSizeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config memtable flush queue size params +func (o *FindConfigMemtableFlushQueueSizeParams) WithContext(ctx context.Context) *FindConfigMemtableFlushQueueSizeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config memtable flush queue size params +func (o *FindConfigMemtableFlushQueueSizeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config memtable flush queue size params +func (o *FindConfigMemtableFlushQueueSizeParams) WithHTTPClient(client *http.Client) *FindConfigMemtableFlushQueueSizeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config memtable flush queue size params +func (o *FindConfigMemtableFlushQueueSizeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigMemtableFlushQueueSizeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_queue_size_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_queue_size_responses.go new file mode 100644 index 0000000000..e042c8aa14 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_queue_size_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigMemtableFlushQueueSizeReader is a Reader for the FindConfigMemtableFlushQueueSize structure. +type FindConfigMemtableFlushQueueSizeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigMemtableFlushQueueSizeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigMemtableFlushQueueSizeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigMemtableFlushQueueSizeDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigMemtableFlushQueueSizeOK creates a FindConfigMemtableFlushQueueSizeOK with default headers values +func NewFindConfigMemtableFlushQueueSizeOK() *FindConfigMemtableFlushQueueSizeOK { + return &FindConfigMemtableFlushQueueSizeOK{} +} + +/* +FindConfigMemtableFlushQueueSizeOK handles this case with default header values. + +Config value +*/ +type FindConfigMemtableFlushQueueSizeOK struct { + Payload int64 +} + +func (o *FindConfigMemtableFlushQueueSizeOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigMemtableFlushQueueSizeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigMemtableFlushQueueSizeDefault creates a FindConfigMemtableFlushQueueSizeDefault with default headers values +func NewFindConfigMemtableFlushQueueSizeDefault(code int) *FindConfigMemtableFlushQueueSizeDefault { + return &FindConfigMemtableFlushQueueSizeDefault{ + _statusCode: code, + } +} + +/* +FindConfigMemtableFlushQueueSizeDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigMemtableFlushQueueSizeDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config memtable flush queue size default response +func (o *FindConfigMemtableFlushQueueSizeDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigMemtableFlushQueueSizeDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigMemtableFlushQueueSizeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigMemtableFlushQueueSizeDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_static_shares_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_static_shares_parameters.go new file mode 100644 index 0000000000..930ecc0578 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_static_shares_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigMemtableFlushStaticSharesParams creates a new FindConfigMemtableFlushStaticSharesParams object +// with the default values initialized. +func NewFindConfigMemtableFlushStaticSharesParams() *FindConfigMemtableFlushStaticSharesParams { + + return &FindConfigMemtableFlushStaticSharesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigMemtableFlushStaticSharesParamsWithTimeout creates a new FindConfigMemtableFlushStaticSharesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigMemtableFlushStaticSharesParamsWithTimeout(timeout time.Duration) *FindConfigMemtableFlushStaticSharesParams { + + return &FindConfigMemtableFlushStaticSharesParams{ + + timeout: timeout, + } +} + +// NewFindConfigMemtableFlushStaticSharesParamsWithContext creates a new FindConfigMemtableFlushStaticSharesParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigMemtableFlushStaticSharesParamsWithContext(ctx context.Context) *FindConfigMemtableFlushStaticSharesParams { + + return &FindConfigMemtableFlushStaticSharesParams{ + + Context: ctx, + } +} + +// NewFindConfigMemtableFlushStaticSharesParamsWithHTTPClient creates a new FindConfigMemtableFlushStaticSharesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigMemtableFlushStaticSharesParamsWithHTTPClient(client *http.Client) *FindConfigMemtableFlushStaticSharesParams { + + return &FindConfigMemtableFlushStaticSharesParams{ + HTTPClient: client, + } +} + +/* +FindConfigMemtableFlushStaticSharesParams contains all the parameters to send to the API endpoint +for the find config memtable flush static shares operation typically these are written to a http.Request +*/ +type FindConfigMemtableFlushStaticSharesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config memtable flush static shares params +func (o *FindConfigMemtableFlushStaticSharesParams) WithTimeout(timeout time.Duration) *FindConfigMemtableFlushStaticSharesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config memtable flush static shares params +func (o *FindConfigMemtableFlushStaticSharesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config memtable flush static shares params +func (o *FindConfigMemtableFlushStaticSharesParams) WithContext(ctx context.Context) *FindConfigMemtableFlushStaticSharesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config memtable flush static shares params +func (o *FindConfigMemtableFlushStaticSharesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config memtable flush static shares params +func (o *FindConfigMemtableFlushStaticSharesParams) WithHTTPClient(client *http.Client) *FindConfigMemtableFlushStaticSharesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config memtable flush static shares params +func (o *FindConfigMemtableFlushStaticSharesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigMemtableFlushStaticSharesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_static_shares_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_static_shares_responses.go new file mode 100644 index 0000000000..73a34edc87 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_static_shares_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigMemtableFlushStaticSharesReader is a Reader for the FindConfigMemtableFlushStaticShares structure. +type FindConfigMemtableFlushStaticSharesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigMemtableFlushStaticSharesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigMemtableFlushStaticSharesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigMemtableFlushStaticSharesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigMemtableFlushStaticSharesOK creates a FindConfigMemtableFlushStaticSharesOK with default headers values +func NewFindConfigMemtableFlushStaticSharesOK() *FindConfigMemtableFlushStaticSharesOK { + return &FindConfigMemtableFlushStaticSharesOK{} +} + +/* +FindConfigMemtableFlushStaticSharesOK handles this case with default header values. + +Config value +*/ +type FindConfigMemtableFlushStaticSharesOK struct { + Payload float64 +} + +func (o *FindConfigMemtableFlushStaticSharesOK) GetPayload() float64 { + return o.Payload +} + +func (o *FindConfigMemtableFlushStaticSharesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigMemtableFlushStaticSharesDefault creates a FindConfigMemtableFlushStaticSharesDefault with default headers values +func NewFindConfigMemtableFlushStaticSharesDefault(code int) *FindConfigMemtableFlushStaticSharesDefault { + return &FindConfigMemtableFlushStaticSharesDefault{ + _statusCode: code, + } +} + +/* +FindConfigMemtableFlushStaticSharesDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigMemtableFlushStaticSharesDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config memtable flush static shares default response +func (o *FindConfigMemtableFlushStaticSharesDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigMemtableFlushStaticSharesDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigMemtableFlushStaticSharesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigMemtableFlushStaticSharesDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_writers_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_writers_parameters.go new file mode 100644 index 0000000000..e842a2f5f8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_writers_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigMemtableFlushWritersParams creates a new FindConfigMemtableFlushWritersParams object +// with the default values initialized. +func NewFindConfigMemtableFlushWritersParams() *FindConfigMemtableFlushWritersParams { + + return &FindConfigMemtableFlushWritersParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigMemtableFlushWritersParamsWithTimeout creates a new FindConfigMemtableFlushWritersParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigMemtableFlushWritersParamsWithTimeout(timeout time.Duration) *FindConfigMemtableFlushWritersParams { + + return &FindConfigMemtableFlushWritersParams{ + + timeout: timeout, + } +} + +// NewFindConfigMemtableFlushWritersParamsWithContext creates a new FindConfigMemtableFlushWritersParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigMemtableFlushWritersParamsWithContext(ctx context.Context) *FindConfigMemtableFlushWritersParams { + + return &FindConfigMemtableFlushWritersParams{ + + Context: ctx, + } +} + +// NewFindConfigMemtableFlushWritersParamsWithHTTPClient creates a new FindConfigMemtableFlushWritersParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigMemtableFlushWritersParamsWithHTTPClient(client *http.Client) *FindConfigMemtableFlushWritersParams { + + return &FindConfigMemtableFlushWritersParams{ + HTTPClient: client, + } +} + +/* +FindConfigMemtableFlushWritersParams contains all the parameters to send to the API endpoint +for the find config memtable flush writers operation typically these are written to a http.Request +*/ +type FindConfigMemtableFlushWritersParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config memtable flush writers params +func (o *FindConfigMemtableFlushWritersParams) WithTimeout(timeout time.Duration) *FindConfigMemtableFlushWritersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config memtable flush writers params +func (o *FindConfigMemtableFlushWritersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config memtable flush writers params +func (o *FindConfigMemtableFlushWritersParams) WithContext(ctx context.Context) *FindConfigMemtableFlushWritersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config memtable flush writers params +func (o *FindConfigMemtableFlushWritersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config memtable flush writers params +func (o *FindConfigMemtableFlushWritersParams) WithHTTPClient(client *http.Client) *FindConfigMemtableFlushWritersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config memtable flush writers params +func (o *FindConfigMemtableFlushWritersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigMemtableFlushWritersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_writers_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_writers_responses.go new file mode 100644 index 0000000000..5e06e44519 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_flush_writers_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigMemtableFlushWritersReader is a Reader for the FindConfigMemtableFlushWriters structure. +type FindConfigMemtableFlushWritersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigMemtableFlushWritersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigMemtableFlushWritersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigMemtableFlushWritersDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigMemtableFlushWritersOK creates a FindConfigMemtableFlushWritersOK with default headers values +func NewFindConfigMemtableFlushWritersOK() *FindConfigMemtableFlushWritersOK { + return &FindConfigMemtableFlushWritersOK{} +} + +/* +FindConfigMemtableFlushWritersOK handles this case with default header values. + +Config value +*/ +type FindConfigMemtableFlushWritersOK struct { + Payload int64 +} + +func (o *FindConfigMemtableFlushWritersOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigMemtableFlushWritersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigMemtableFlushWritersDefault creates a FindConfigMemtableFlushWritersDefault with default headers values +func NewFindConfigMemtableFlushWritersDefault(code int) *FindConfigMemtableFlushWritersDefault { + return &FindConfigMemtableFlushWritersDefault{ + _statusCode: code, + } +} + +/* +FindConfigMemtableFlushWritersDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigMemtableFlushWritersDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config memtable flush writers default response +func (o *FindConfigMemtableFlushWritersDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigMemtableFlushWritersDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigMemtableFlushWritersDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigMemtableFlushWritersDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_heap_space_in_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_heap_space_in_mb_parameters.go new file mode 100644 index 0000000000..eab74d9684 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_heap_space_in_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigMemtableHeapSpaceInMbParams creates a new FindConfigMemtableHeapSpaceInMbParams object +// with the default values initialized. +func NewFindConfigMemtableHeapSpaceInMbParams() *FindConfigMemtableHeapSpaceInMbParams { + + return &FindConfigMemtableHeapSpaceInMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigMemtableHeapSpaceInMbParamsWithTimeout creates a new FindConfigMemtableHeapSpaceInMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigMemtableHeapSpaceInMbParamsWithTimeout(timeout time.Duration) *FindConfigMemtableHeapSpaceInMbParams { + + return &FindConfigMemtableHeapSpaceInMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigMemtableHeapSpaceInMbParamsWithContext creates a new FindConfigMemtableHeapSpaceInMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigMemtableHeapSpaceInMbParamsWithContext(ctx context.Context) *FindConfigMemtableHeapSpaceInMbParams { + + return &FindConfigMemtableHeapSpaceInMbParams{ + + Context: ctx, + } +} + +// NewFindConfigMemtableHeapSpaceInMbParamsWithHTTPClient creates a new FindConfigMemtableHeapSpaceInMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigMemtableHeapSpaceInMbParamsWithHTTPClient(client *http.Client) *FindConfigMemtableHeapSpaceInMbParams { + + return &FindConfigMemtableHeapSpaceInMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigMemtableHeapSpaceInMbParams contains all the parameters to send to the API endpoint +for the find config memtable heap space in mb operation typically these are written to a http.Request +*/ +type FindConfigMemtableHeapSpaceInMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config memtable heap space in mb params +func (o *FindConfigMemtableHeapSpaceInMbParams) WithTimeout(timeout time.Duration) *FindConfigMemtableHeapSpaceInMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config memtable heap space in mb params +func (o *FindConfigMemtableHeapSpaceInMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config memtable heap space in mb params +func (o *FindConfigMemtableHeapSpaceInMbParams) WithContext(ctx context.Context) *FindConfigMemtableHeapSpaceInMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config memtable heap space in mb params +func (o *FindConfigMemtableHeapSpaceInMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config memtable heap space in mb params +func (o *FindConfigMemtableHeapSpaceInMbParams) WithHTTPClient(client *http.Client) *FindConfigMemtableHeapSpaceInMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config memtable heap space in mb params +func (o *FindConfigMemtableHeapSpaceInMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigMemtableHeapSpaceInMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_heap_space_in_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_heap_space_in_mb_responses.go new file mode 100644 index 0000000000..8b49e2e3bd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_heap_space_in_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigMemtableHeapSpaceInMbReader is a Reader for the FindConfigMemtableHeapSpaceInMb structure. +type FindConfigMemtableHeapSpaceInMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigMemtableHeapSpaceInMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigMemtableHeapSpaceInMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigMemtableHeapSpaceInMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigMemtableHeapSpaceInMbOK creates a FindConfigMemtableHeapSpaceInMbOK with default headers values +func NewFindConfigMemtableHeapSpaceInMbOK() *FindConfigMemtableHeapSpaceInMbOK { + return &FindConfigMemtableHeapSpaceInMbOK{} +} + +/* +FindConfigMemtableHeapSpaceInMbOK handles this case with default header values. + +Config value +*/ +type FindConfigMemtableHeapSpaceInMbOK struct { + Payload int64 +} + +func (o *FindConfigMemtableHeapSpaceInMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigMemtableHeapSpaceInMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigMemtableHeapSpaceInMbDefault creates a FindConfigMemtableHeapSpaceInMbDefault with default headers values +func NewFindConfigMemtableHeapSpaceInMbDefault(code int) *FindConfigMemtableHeapSpaceInMbDefault { + return &FindConfigMemtableHeapSpaceInMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigMemtableHeapSpaceInMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigMemtableHeapSpaceInMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config memtable heap space in mb default response +func (o *FindConfigMemtableHeapSpaceInMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigMemtableHeapSpaceInMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigMemtableHeapSpaceInMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigMemtableHeapSpaceInMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_offheap_space_in_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_offheap_space_in_mb_parameters.go new file mode 100644 index 0000000000..5a5beab8b5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_offheap_space_in_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigMemtableOffheapSpaceInMbParams creates a new FindConfigMemtableOffheapSpaceInMbParams object +// with the default values initialized. +func NewFindConfigMemtableOffheapSpaceInMbParams() *FindConfigMemtableOffheapSpaceInMbParams { + + return &FindConfigMemtableOffheapSpaceInMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigMemtableOffheapSpaceInMbParamsWithTimeout creates a new FindConfigMemtableOffheapSpaceInMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigMemtableOffheapSpaceInMbParamsWithTimeout(timeout time.Duration) *FindConfigMemtableOffheapSpaceInMbParams { + + return &FindConfigMemtableOffheapSpaceInMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigMemtableOffheapSpaceInMbParamsWithContext creates a new FindConfigMemtableOffheapSpaceInMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigMemtableOffheapSpaceInMbParamsWithContext(ctx context.Context) *FindConfigMemtableOffheapSpaceInMbParams { + + return &FindConfigMemtableOffheapSpaceInMbParams{ + + Context: ctx, + } +} + +// NewFindConfigMemtableOffheapSpaceInMbParamsWithHTTPClient creates a new FindConfigMemtableOffheapSpaceInMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigMemtableOffheapSpaceInMbParamsWithHTTPClient(client *http.Client) *FindConfigMemtableOffheapSpaceInMbParams { + + return &FindConfigMemtableOffheapSpaceInMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigMemtableOffheapSpaceInMbParams contains all the parameters to send to the API endpoint +for the find config memtable offheap space in mb operation typically these are written to a http.Request +*/ +type FindConfigMemtableOffheapSpaceInMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config memtable offheap space in mb params +func (o *FindConfigMemtableOffheapSpaceInMbParams) WithTimeout(timeout time.Duration) *FindConfigMemtableOffheapSpaceInMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config memtable offheap space in mb params +func (o *FindConfigMemtableOffheapSpaceInMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config memtable offheap space in mb params +func (o *FindConfigMemtableOffheapSpaceInMbParams) WithContext(ctx context.Context) *FindConfigMemtableOffheapSpaceInMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config memtable offheap space in mb params +func (o *FindConfigMemtableOffheapSpaceInMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config memtable offheap space in mb params +func (o *FindConfigMemtableOffheapSpaceInMbParams) WithHTTPClient(client *http.Client) *FindConfigMemtableOffheapSpaceInMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config memtable offheap space in mb params +func (o *FindConfigMemtableOffheapSpaceInMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigMemtableOffheapSpaceInMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_offheap_space_in_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_offheap_space_in_mb_responses.go new file mode 100644 index 0000000000..a2b3fbc820 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_offheap_space_in_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigMemtableOffheapSpaceInMbReader is a Reader for the FindConfigMemtableOffheapSpaceInMb structure. +type FindConfigMemtableOffheapSpaceInMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigMemtableOffheapSpaceInMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigMemtableOffheapSpaceInMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigMemtableOffheapSpaceInMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigMemtableOffheapSpaceInMbOK creates a FindConfigMemtableOffheapSpaceInMbOK with default headers values +func NewFindConfigMemtableOffheapSpaceInMbOK() *FindConfigMemtableOffheapSpaceInMbOK { + return &FindConfigMemtableOffheapSpaceInMbOK{} +} + +/* +FindConfigMemtableOffheapSpaceInMbOK handles this case with default header values. + +Config value +*/ +type FindConfigMemtableOffheapSpaceInMbOK struct { + Payload int64 +} + +func (o *FindConfigMemtableOffheapSpaceInMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigMemtableOffheapSpaceInMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigMemtableOffheapSpaceInMbDefault creates a FindConfigMemtableOffheapSpaceInMbDefault with default headers values +func NewFindConfigMemtableOffheapSpaceInMbDefault(code int) *FindConfigMemtableOffheapSpaceInMbDefault { + return &FindConfigMemtableOffheapSpaceInMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigMemtableOffheapSpaceInMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigMemtableOffheapSpaceInMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config memtable offheap space in mb default response +func (o *FindConfigMemtableOffheapSpaceInMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigMemtableOffheapSpaceInMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigMemtableOffheapSpaceInMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigMemtableOffheapSpaceInMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_total_space_in_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_total_space_in_mb_parameters.go new file mode 100644 index 0000000000..5523e5e8a3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_total_space_in_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigMemtableTotalSpaceInMbParams creates a new FindConfigMemtableTotalSpaceInMbParams object +// with the default values initialized. +func NewFindConfigMemtableTotalSpaceInMbParams() *FindConfigMemtableTotalSpaceInMbParams { + + return &FindConfigMemtableTotalSpaceInMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigMemtableTotalSpaceInMbParamsWithTimeout creates a new FindConfigMemtableTotalSpaceInMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigMemtableTotalSpaceInMbParamsWithTimeout(timeout time.Duration) *FindConfigMemtableTotalSpaceInMbParams { + + return &FindConfigMemtableTotalSpaceInMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigMemtableTotalSpaceInMbParamsWithContext creates a new FindConfigMemtableTotalSpaceInMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigMemtableTotalSpaceInMbParamsWithContext(ctx context.Context) *FindConfigMemtableTotalSpaceInMbParams { + + return &FindConfigMemtableTotalSpaceInMbParams{ + + Context: ctx, + } +} + +// NewFindConfigMemtableTotalSpaceInMbParamsWithHTTPClient creates a new FindConfigMemtableTotalSpaceInMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigMemtableTotalSpaceInMbParamsWithHTTPClient(client *http.Client) *FindConfigMemtableTotalSpaceInMbParams { + + return &FindConfigMemtableTotalSpaceInMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigMemtableTotalSpaceInMbParams contains all the parameters to send to the API endpoint +for the find config memtable total space in mb operation typically these are written to a http.Request +*/ +type FindConfigMemtableTotalSpaceInMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config memtable total space in mb params +func (o *FindConfigMemtableTotalSpaceInMbParams) WithTimeout(timeout time.Duration) *FindConfigMemtableTotalSpaceInMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config memtable total space in mb params +func (o *FindConfigMemtableTotalSpaceInMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config memtable total space in mb params +func (o *FindConfigMemtableTotalSpaceInMbParams) WithContext(ctx context.Context) *FindConfigMemtableTotalSpaceInMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config memtable total space in mb params +func (o *FindConfigMemtableTotalSpaceInMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config memtable total space in mb params +func (o *FindConfigMemtableTotalSpaceInMbParams) WithHTTPClient(client *http.Client) *FindConfigMemtableTotalSpaceInMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config memtable total space in mb params +func (o *FindConfigMemtableTotalSpaceInMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigMemtableTotalSpaceInMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_total_space_in_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_total_space_in_mb_responses.go new file mode 100644 index 0000000000..40d628f4d7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_memtable_total_space_in_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigMemtableTotalSpaceInMbReader is a Reader for the FindConfigMemtableTotalSpaceInMb structure. +type FindConfigMemtableTotalSpaceInMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigMemtableTotalSpaceInMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigMemtableTotalSpaceInMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigMemtableTotalSpaceInMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigMemtableTotalSpaceInMbOK creates a FindConfigMemtableTotalSpaceInMbOK with default headers values +func NewFindConfigMemtableTotalSpaceInMbOK() *FindConfigMemtableTotalSpaceInMbOK { + return &FindConfigMemtableTotalSpaceInMbOK{} +} + +/* +FindConfigMemtableTotalSpaceInMbOK handles this case with default header values. + +Config value +*/ +type FindConfigMemtableTotalSpaceInMbOK struct { + Payload int64 +} + +func (o *FindConfigMemtableTotalSpaceInMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigMemtableTotalSpaceInMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigMemtableTotalSpaceInMbDefault creates a FindConfigMemtableTotalSpaceInMbDefault with default headers values +func NewFindConfigMemtableTotalSpaceInMbDefault(code int) *FindConfigMemtableTotalSpaceInMbDefault { + return &FindConfigMemtableTotalSpaceInMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigMemtableTotalSpaceInMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigMemtableTotalSpaceInMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config memtable total space in mb default response +func (o *FindConfigMemtableTotalSpaceInMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigMemtableTotalSpaceInMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigMemtableTotalSpaceInMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigMemtableTotalSpaceInMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_murmur3_partitioner_ignore_msb_bits_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_murmur3_partitioner_ignore_msb_bits_parameters.go new file mode 100644 index 0000000000..7e6f73ed76 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_murmur3_partitioner_ignore_msb_bits_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigMurmur3PartitionerIgnoreMsbBitsParams creates a new FindConfigMurmur3PartitionerIgnoreMsbBitsParams object +// with the default values initialized. +func NewFindConfigMurmur3PartitionerIgnoreMsbBitsParams() *FindConfigMurmur3PartitionerIgnoreMsbBitsParams { + + return &FindConfigMurmur3PartitionerIgnoreMsbBitsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigMurmur3PartitionerIgnoreMsbBitsParamsWithTimeout creates a new FindConfigMurmur3PartitionerIgnoreMsbBitsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigMurmur3PartitionerIgnoreMsbBitsParamsWithTimeout(timeout time.Duration) *FindConfigMurmur3PartitionerIgnoreMsbBitsParams { + + return &FindConfigMurmur3PartitionerIgnoreMsbBitsParams{ + + timeout: timeout, + } +} + +// NewFindConfigMurmur3PartitionerIgnoreMsbBitsParamsWithContext creates a new FindConfigMurmur3PartitionerIgnoreMsbBitsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigMurmur3PartitionerIgnoreMsbBitsParamsWithContext(ctx context.Context) *FindConfigMurmur3PartitionerIgnoreMsbBitsParams { + + return &FindConfigMurmur3PartitionerIgnoreMsbBitsParams{ + + Context: ctx, + } +} + +// NewFindConfigMurmur3PartitionerIgnoreMsbBitsParamsWithHTTPClient creates a new FindConfigMurmur3PartitionerIgnoreMsbBitsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigMurmur3PartitionerIgnoreMsbBitsParamsWithHTTPClient(client *http.Client) *FindConfigMurmur3PartitionerIgnoreMsbBitsParams { + + return &FindConfigMurmur3PartitionerIgnoreMsbBitsParams{ + HTTPClient: client, + } +} + +/* +FindConfigMurmur3PartitionerIgnoreMsbBitsParams contains all the parameters to send to the API endpoint +for the find config murmur3 partitioner ignore msb bits operation typically these are written to a http.Request +*/ +type FindConfigMurmur3PartitionerIgnoreMsbBitsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config murmur3 partitioner ignore msb bits params +func (o *FindConfigMurmur3PartitionerIgnoreMsbBitsParams) WithTimeout(timeout time.Duration) *FindConfigMurmur3PartitionerIgnoreMsbBitsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config murmur3 partitioner ignore msb bits params +func (o *FindConfigMurmur3PartitionerIgnoreMsbBitsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config murmur3 partitioner ignore msb bits params +func (o *FindConfigMurmur3PartitionerIgnoreMsbBitsParams) WithContext(ctx context.Context) *FindConfigMurmur3PartitionerIgnoreMsbBitsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config murmur3 partitioner ignore msb bits params +func (o *FindConfigMurmur3PartitionerIgnoreMsbBitsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config murmur3 partitioner ignore msb bits params +func (o *FindConfigMurmur3PartitionerIgnoreMsbBitsParams) WithHTTPClient(client *http.Client) *FindConfigMurmur3PartitionerIgnoreMsbBitsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config murmur3 partitioner ignore msb bits params +func (o *FindConfigMurmur3PartitionerIgnoreMsbBitsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigMurmur3PartitionerIgnoreMsbBitsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_murmur3_partitioner_ignore_msb_bits_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_murmur3_partitioner_ignore_msb_bits_responses.go new file mode 100644 index 0000000000..84725710e7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_murmur3_partitioner_ignore_msb_bits_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigMurmur3PartitionerIgnoreMsbBitsReader is a Reader for the FindConfigMurmur3PartitionerIgnoreMsbBits structure. +type FindConfigMurmur3PartitionerIgnoreMsbBitsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigMurmur3PartitionerIgnoreMsbBitsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigMurmur3PartitionerIgnoreMsbBitsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigMurmur3PartitionerIgnoreMsbBitsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigMurmur3PartitionerIgnoreMsbBitsOK creates a FindConfigMurmur3PartitionerIgnoreMsbBitsOK with default headers values +func NewFindConfigMurmur3PartitionerIgnoreMsbBitsOK() *FindConfigMurmur3PartitionerIgnoreMsbBitsOK { + return &FindConfigMurmur3PartitionerIgnoreMsbBitsOK{} +} + +/* +FindConfigMurmur3PartitionerIgnoreMsbBitsOK handles this case with default header values. + +Config value +*/ +type FindConfigMurmur3PartitionerIgnoreMsbBitsOK struct { + Payload int64 +} + +func (o *FindConfigMurmur3PartitionerIgnoreMsbBitsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigMurmur3PartitionerIgnoreMsbBitsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigMurmur3PartitionerIgnoreMsbBitsDefault creates a FindConfigMurmur3PartitionerIgnoreMsbBitsDefault with default headers values +func NewFindConfigMurmur3PartitionerIgnoreMsbBitsDefault(code int) *FindConfigMurmur3PartitionerIgnoreMsbBitsDefault { + return &FindConfigMurmur3PartitionerIgnoreMsbBitsDefault{ + _statusCode: code, + } +} + +/* +FindConfigMurmur3PartitionerIgnoreMsbBitsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigMurmur3PartitionerIgnoreMsbBitsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config murmur3 partitioner ignore msb bits default response +func (o *FindConfigMurmur3PartitionerIgnoreMsbBitsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigMurmur3PartitionerIgnoreMsbBitsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigMurmur3PartitionerIgnoreMsbBitsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigMurmur3PartitionerIgnoreMsbBitsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_max_frame_size_in_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_max_frame_size_in_mb_parameters.go new file mode 100644 index 0000000000..a03d9e26e3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_max_frame_size_in_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigNativeTransportMaxFrameSizeInMbParams creates a new FindConfigNativeTransportMaxFrameSizeInMbParams object +// with the default values initialized. +func NewFindConfigNativeTransportMaxFrameSizeInMbParams() *FindConfigNativeTransportMaxFrameSizeInMbParams { + + return &FindConfigNativeTransportMaxFrameSizeInMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigNativeTransportMaxFrameSizeInMbParamsWithTimeout creates a new FindConfigNativeTransportMaxFrameSizeInMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigNativeTransportMaxFrameSizeInMbParamsWithTimeout(timeout time.Duration) *FindConfigNativeTransportMaxFrameSizeInMbParams { + + return &FindConfigNativeTransportMaxFrameSizeInMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigNativeTransportMaxFrameSizeInMbParamsWithContext creates a new FindConfigNativeTransportMaxFrameSizeInMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigNativeTransportMaxFrameSizeInMbParamsWithContext(ctx context.Context) *FindConfigNativeTransportMaxFrameSizeInMbParams { + + return &FindConfigNativeTransportMaxFrameSizeInMbParams{ + + Context: ctx, + } +} + +// NewFindConfigNativeTransportMaxFrameSizeInMbParamsWithHTTPClient creates a new FindConfigNativeTransportMaxFrameSizeInMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigNativeTransportMaxFrameSizeInMbParamsWithHTTPClient(client *http.Client) *FindConfigNativeTransportMaxFrameSizeInMbParams { + + return &FindConfigNativeTransportMaxFrameSizeInMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigNativeTransportMaxFrameSizeInMbParams contains all the parameters to send to the API endpoint +for the find config native transport max frame size in mb operation typically these are written to a http.Request +*/ +type FindConfigNativeTransportMaxFrameSizeInMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config native transport max frame size in mb params +func (o *FindConfigNativeTransportMaxFrameSizeInMbParams) WithTimeout(timeout time.Duration) *FindConfigNativeTransportMaxFrameSizeInMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config native transport max frame size in mb params +func (o *FindConfigNativeTransportMaxFrameSizeInMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config native transport max frame size in mb params +func (o *FindConfigNativeTransportMaxFrameSizeInMbParams) WithContext(ctx context.Context) *FindConfigNativeTransportMaxFrameSizeInMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config native transport max frame size in mb params +func (o *FindConfigNativeTransportMaxFrameSizeInMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config native transport max frame size in mb params +func (o *FindConfigNativeTransportMaxFrameSizeInMbParams) WithHTTPClient(client *http.Client) *FindConfigNativeTransportMaxFrameSizeInMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config native transport max frame size in mb params +func (o *FindConfigNativeTransportMaxFrameSizeInMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigNativeTransportMaxFrameSizeInMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_max_frame_size_in_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_max_frame_size_in_mb_responses.go new file mode 100644 index 0000000000..54767d6cfb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_max_frame_size_in_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigNativeTransportMaxFrameSizeInMbReader is a Reader for the FindConfigNativeTransportMaxFrameSizeInMb structure. +type FindConfigNativeTransportMaxFrameSizeInMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigNativeTransportMaxFrameSizeInMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigNativeTransportMaxFrameSizeInMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigNativeTransportMaxFrameSizeInMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigNativeTransportMaxFrameSizeInMbOK creates a FindConfigNativeTransportMaxFrameSizeInMbOK with default headers values +func NewFindConfigNativeTransportMaxFrameSizeInMbOK() *FindConfigNativeTransportMaxFrameSizeInMbOK { + return &FindConfigNativeTransportMaxFrameSizeInMbOK{} +} + +/* +FindConfigNativeTransportMaxFrameSizeInMbOK handles this case with default header values. + +Config value +*/ +type FindConfigNativeTransportMaxFrameSizeInMbOK struct { + Payload int64 +} + +func (o *FindConfigNativeTransportMaxFrameSizeInMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigNativeTransportMaxFrameSizeInMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigNativeTransportMaxFrameSizeInMbDefault creates a FindConfigNativeTransportMaxFrameSizeInMbDefault with default headers values +func NewFindConfigNativeTransportMaxFrameSizeInMbDefault(code int) *FindConfigNativeTransportMaxFrameSizeInMbDefault { + return &FindConfigNativeTransportMaxFrameSizeInMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigNativeTransportMaxFrameSizeInMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigNativeTransportMaxFrameSizeInMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config native transport max frame size in mb default response +func (o *FindConfigNativeTransportMaxFrameSizeInMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigNativeTransportMaxFrameSizeInMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigNativeTransportMaxFrameSizeInMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigNativeTransportMaxFrameSizeInMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_max_threads_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_max_threads_parameters.go new file mode 100644 index 0000000000..4b46ce001a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_max_threads_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigNativeTransportMaxThreadsParams creates a new FindConfigNativeTransportMaxThreadsParams object +// with the default values initialized. +func NewFindConfigNativeTransportMaxThreadsParams() *FindConfigNativeTransportMaxThreadsParams { + + return &FindConfigNativeTransportMaxThreadsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigNativeTransportMaxThreadsParamsWithTimeout creates a new FindConfigNativeTransportMaxThreadsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigNativeTransportMaxThreadsParamsWithTimeout(timeout time.Duration) *FindConfigNativeTransportMaxThreadsParams { + + return &FindConfigNativeTransportMaxThreadsParams{ + + timeout: timeout, + } +} + +// NewFindConfigNativeTransportMaxThreadsParamsWithContext creates a new FindConfigNativeTransportMaxThreadsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigNativeTransportMaxThreadsParamsWithContext(ctx context.Context) *FindConfigNativeTransportMaxThreadsParams { + + return &FindConfigNativeTransportMaxThreadsParams{ + + Context: ctx, + } +} + +// NewFindConfigNativeTransportMaxThreadsParamsWithHTTPClient creates a new FindConfigNativeTransportMaxThreadsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigNativeTransportMaxThreadsParamsWithHTTPClient(client *http.Client) *FindConfigNativeTransportMaxThreadsParams { + + return &FindConfigNativeTransportMaxThreadsParams{ + HTTPClient: client, + } +} + +/* +FindConfigNativeTransportMaxThreadsParams contains all the parameters to send to the API endpoint +for the find config native transport max threads operation typically these are written to a http.Request +*/ +type FindConfigNativeTransportMaxThreadsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config native transport max threads params +func (o *FindConfigNativeTransportMaxThreadsParams) WithTimeout(timeout time.Duration) *FindConfigNativeTransportMaxThreadsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config native transport max threads params +func (o *FindConfigNativeTransportMaxThreadsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config native transport max threads params +func (o *FindConfigNativeTransportMaxThreadsParams) WithContext(ctx context.Context) *FindConfigNativeTransportMaxThreadsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config native transport max threads params +func (o *FindConfigNativeTransportMaxThreadsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config native transport max threads params +func (o *FindConfigNativeTransportMaxThreadsParams) WithHTTPClient(client *http.Client) *FindConfigNativeTransportMaxThreadsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config native transport max threads params +func (o *FindConfigNativeTransportMaxThreadsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigNativeTransportMaxThreadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_max_threads_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_max_threads_responses.go new file mode 100644 index 0000000000..dbbb10543f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_max_threads_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigNativeTransportMaxThreadsReader is a Reader for the FindConfigNativeTransportMaxThreads structure. +type FindConfigNativeTransportMaxThreadsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigNativeTransportMaxThreadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigNativeTransportMaxThreadsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigNativeTransportMaxThreadsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigNativeTransportMaxThreadsOK creates a FindConfigNativeTransportMaxThreadsOK with default headers values +func NewFindConfigNativeTransportMaxThreadsOK() *FindConfigNativeTransportMaxThreadsOK { + return &FindConfigNativeTransportMaxThreadsOK{} +} + +/* +FindConfigNativeTransportMaxThreadsOK handles this case with default header values. + +Config value +*/ +type FindConfigNativeTransportMaxThreadsOK struct { + Payload int64 +} + +func (o *FindConfigNativeTransportMaxThreadsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigNativeTransportMaxThreadsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigNativeTransportMaxThreadsDefault creates a FindConfigNativeTransportMaxThreadsDefault with default headers values +func NewFindConfigNativeTransportMaxThreadsDefault(code int) *FindConfigNativeTransportMaxThreadsDefault { + return &FindConfigNativeTransportMaxThreadsDefault{ + _statusCode: code, + } +} + +/* +FindConfigNativeTransportMaxThreadsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigNativeTransportMaxThreadsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config native transport max threads default response +func (o *FindConfigNativeTransportMaxThreadsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigNativeTransportMaxThreadsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigNativeTransportMaxThreadsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigNativeTransportMaxThreadsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_port_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_port_parameters.go new file mode 100644 index 0000000000..55b929caf1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_port_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigNativeTransportPortParams creates a new FindConfigNativeTransportPortParams object +// with the default values initialized. +func NewFindConfigNativeTransportPortParams() *FindConfigNativeTransportPortParams { + + return &FindConfigNativeTransportPortParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigNativeTransportPortParamsWithTimeout creates a new FindConfigNativeTransportPortParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigNativeTransportPortParamsWithTimeout(timeout time.Duration) *FindConfigNativeTransportPortParams { + + return &FindConfigNativeTransportPortParams{ + + timeout: timeout, + } +} + +// NewFindConfigNativeTransportPortParamsWithContext creates a new FindConfigNativeTransportPortParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigNativeTransportPortParamsWithContext(ctx context.Context) *FindConfigNativeTransportPortParams { + + return &FindConfigNativeTransportPortParams{ + + Context: ctx, + } +} + +// NewFindConfigNativeTransportPortParamsWithHTTPClient creates a new FindConfigNativeTransportPortParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigNativeTransportPortParamsWithHTTPClient(client *http.Client) *FindConfigNativeTransportPortParams { + + return &FindConfigNativeTransportPortParams{ + HTTPClient: client, + } +} + +/* +FindConfigNativeTransportPortParams contains all the parameters to send to the API endpoint +for the find config native transport port operation typically these are written to a http.Request +*/ +type FindConfigNativeTransportPortParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config native transport port params +func (o *FindConfigNativeTransportPortParams) WithTimeout(timeout time.Duration) *FindConfigNativeTransportPortParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config native transport port params +func (o *FindConfigNativeTransportPortParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config native transport port params +func (o *FindConfigNativeTransportPortParams) WithContext(ctx context.Context) *FindConfigNativeTransportPortParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config native transport port params +func (o *FindConfigNativeTransportPortParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config native transport port params +func (o *FindConfigNativeTransportPortParams) WithHTTPClient(client *http.Client) *FindConfigNativeTransportPortParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config native transport port params +func (o *FindConfigNativeTransportPortParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigNativeTransportPortParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_port_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_port_responses.go new file mode 100644 index 0000000000..d0ffe8af1e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_port_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigNativeTransportPortReader is a Reader for the FindConfigNativeTransportPort structure. +type FindConfigNativeTransportPortReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigNativeTransportPortReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigNativeTransportPortOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigNativeTransportPortDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigNativeTransportPortOK creates a FindConfigNativeTransportPortOK with default headers values +func NewFindConfigNativeTransportPortOK() *FindConfigNativeTransportPortOK { + return &FindConfigNativeTransportPortOK{} +} + +/* +FindConfigNativeTransportPortOK handles this case with default header values. + +Config value +*/ +type FindConfigNativeTransportPortOK struct { + Payload int64 +} + +func (o *FindConfigNativeTransportPortOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigNativeTransportPortOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigNativeTransportPortDefault creates a FindConfigNativeTransportPortDefault with default headers values +func NewFindConfigNativeTransportPortDefault(code int) *FindConfigNativeTransportPortDefault { + return &FindConfigNativeTransportPortDefault{ + _statusCode: code, + } +} + +/* +FindConfigNativeTransportPortDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigNativeTransportPortDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config native transport port default response +func (o *FindConfigNativeTransportPortDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigNativeTransportPortDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigNativeTransportPortDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigNativeTransportPortDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_port_ssl_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_port_ssl_parameters.go new file mode 100644 index 0000000000..a377569994 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_port_ssl_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigNativeTransportPortSslParams creates a new FindConfigNativeTransportPortSslParams object +// with the default values initialized. +func NewFindConfigNativeTransportPortSslParams() *FindConfigNativeTransportPortSslParams { + + return &FindConfigNativeTransportPortSslParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigNativeTransportPortSslParamsWithTimeout creates a new FindConfigNativeTransportPortSslParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigNativeTransportPortSslParamsWithTimeout(timeout time.Duration) *FindConfigNativeTransportPortSslParams { + + return &FindConfigNativeTransportPortSslParams{ + + timeout: timeout, + } +} + +// NewFindConfigNativeTransportPortSslParamsWithContext creates a new FindConfigNativeTransportPortSslParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigNativeTransportPortSslParamsWithContext(ctx context.Context) *FindConfigNativeTransportPortSslParams { + + return &FindConfigNativeTransportPortSslParams{ + + Context: ctx, + } +} + +// NewFindConfigNativeTransportPortSslParamsWithHTTPClient creates a new FindConfigNativeTransportPortSslParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigNativeTransportPortSslParamsWithHTTPClient(client *http.Client) *FindConfigNativeTransportPortSslParams { + + return &FindConfigNativeTransportPortSslParams{ + HTTPClient: client, + } +} + +/* +FindConfigNativeTransportPortSslParams contains all the parameters to send to the API endpoint +for the find config native transport port ssl operation typically these are written to a http.Request +*/ +type FindConfigNativeTransportPortSslParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config native transport port ssl params +func (o *FindConfigNativeTransportPortSslParams) WithTimeout(timeout time.Duration) *FindConfigNativeTransportPortSslParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config native transport port ssl params +func (o *FindConfigNativeTransportPortSslParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config native transport port ssl params +func (o *FindConfigNativeTransportPortSslParams) WithContext(ctx context.Context) *FindConfigNativeTransportPortSslParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config native transport port ssl params +func (o *FindConfigNativeTransportPortSslParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config native transport port ssl params +func (o *FindConfigNativeTransportPortSslParams) WithHTTPClient(client *http.Client) *FindConfigNativeTransportPortSslParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config native transport port ssl params +func (o *FindConfigNativeTransportPortSslParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigNativeTransportPortSslParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_port_ssl_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_port_ssl_responses.go new file mode 100644 index 0000000000..7813ea40b4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_native_transport_port_ssl_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigNativeTransportPortSslReader is a Reader for the FindConfigNativeTransportPortSsl structure. +type FindConfigNativeTransportPortSslReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigNativeTransportPortSslReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigNativeTransportPortSslOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigNativeTransportPortSslDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigNativeTransportPortSslOK creates a FindConfigNativeTransportPortSslOK with default headers values +func NewFindConfigNativeTransportPortSslOK() *FindConfigNativeTransportPortSslOK { + return &FindConfigNativeTransportPortSslOK{} +} + +/* +FindConfigNativeTransportPortSslOK handles this case with default header values. + +Config value +*/ +type FindConfigNativeTransportPortSslOK struct { + Payload int64 +} + +func (o *FindConfigNativeTransportPortSslOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigNativeTransportPortSslOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigNativeTransportPortSslDefault creates a FindConfigNativeTransportPortSslDefault with default headers values +func NewFindConfigNativeTransportPortSslDefault(code int) *FindConfigNativeTransportPortSslDefault { + return &FindConfigNativeTransportPortSslDefault{ + _statusCode: code, + } +} + +/* +FindConfigNativeTransportPortSslDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigNativeTransportPortSslDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config native transport port ssl default response +func (o *FindConfigNativeTransportPortSslDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigNativeTransportPortSslDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigNativeTransportPortSslDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigNativeTransportPortSslDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_num_tokens_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_num_tokens_parameters.go new file mode 100644 index 0000000000..da86b11c18 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_num_tokens_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigNumTokensParams creates a new FindConfigNumTokensParams object +// with the default values initialized. +func NewFindConfigNumTokensParams() *FindConfigNumTokensParams { + + return &FindConfigNumTokensParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigNumTokensParamsWithTimeout creates a new FindConfigNumTokensParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigNumTokensParamsWithTimeout(timeout time.Duration) *FindConfigNumTokensParams { + + return &FindConfigNumTokensParams{ + + timeout: timeout, + } +} + +// NewFindConfigNumTokensParamsWithContext creates a new FindConfigNumTokensParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigNumTokensParamsWithContext(ctx context.Context) *FindConfigNumTokensParams { + + return &FindConfigNumTokensParams{ + + Context: ctx, + } +} + +// NewFindConfigNumTokensParamsWithHTTPClient creates a new FindConfigNumTokensParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigNumTokensParamsWithHTTPClient(client *http.Client) *FindConfigNumTokensParams { + + return &FindConfigNumTokensParams{ + HTTPClient: client, + } +} + +/* +FindConfigNumTokensParams contains all the parameters to send to the API endpoint +for the find config num tokens operation typically these are written to a http.Request +*/ +type FindConfigNumTokensParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config num tokens params +func (o *FindConfigNumTokensParams) WithTimeout(timeout time.Duration) *FindConfigNumTokensParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config num tokens params +func (o *FindConfigNumTokensParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config num tokens params +func (o *FindConfigNumTokensParams) WithContext(ctx context.Context) *FindConfigNumTokensParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config num tokens params +func (o *FindConfigNumTokensParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config num tokens params +func (o *FindConfigNumTokensParams) WithHTTPClient(client *http.Client) *FindConfigNumTokensParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config num tokens params +func (o *FindConfigNumTokensParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigNumTokensParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_num_tokens_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_num_tokens_responses.go new file mode 100644 index 0000000000..d882ad4506 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_num_tokens_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigNumTokensReader is a Reader for the FindConfigNumTokens structure. +type FindConfigNumTokensReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigNumTokensReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigNumTokensOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigNumTokensDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigNumTokensOK creates a FindConfigNumTokensOK with default headers values +func NewFindConfigNumTokensOK() *FindConfigNumTokensOK { + return &FindConfigNumTokensOK{} +} + +/* +FindConfigNumTokensOK handles this case with default header values. + +Config value +*/ +type FindConfigNumTokensOK struct { + Payload int64 +} + +func (o *FindConfigNumTokensOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigNumTokensOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigNumTokensDefault creates a FindConfigNumTokensDefault with default headers values +func NewFindConfigNumTokensDefault(code int) *FindConfigNumTokensDefault { + return &FindConfigNumTokensDefault{ + _statusCode: code, + } +} + +/* +FindConfigNumTokensDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigNumTokensDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config num tokens default response +func (o *FindConfigNumTokensDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigNumTokensDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigNumTokensDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigNumTokensDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_override_decommission_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_override_decommission_parameters.go new file mode 100644 index 0000000000..3845f4c65e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_override_decommission_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigOverrideDecommissionParams creates a new FindConfigOverrideDecommissionParams object +// with the default values initialized. +func NewFindConfigOverrideDecommissionParams() *FindConfigOverrideDecommissionParams { + + return &FindConfigOverrideDecommissionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigOverrideDecommissionParamsWithTimeout creates a new FindConfigOverrideDecommissionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigOverrideDecommissionParamsWithTimeout(timeout time.Duration) *FindConfigOverrideDecommissionParams { + + return &FindConfigOverrideDecommissionParams{ + + timeout: timeout, + } +} + +// NewFindConfigOverrideDecommissionParamsWithContext creates a new FindConfigOverrideDecommissionParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigOverrideDecommissionParamsWithContext(ctx context.Context) *FindConfigOverrideDecommissionParams { + + return &FindConfigOverrideDecommissionParams{ + + Context: ctx, + } +} + +// NewFindConfigOverrideDecommissionParamsWithHTTPClient creates a new FindConfigOverrideDecommissionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigOverrideDecommissionParamsWithHTTPClient(client *http.Client) *FindConfigOverrideDecommissionParams { + + return &FindConfigOverrideDecommissionParams{ + HTTPClient: client, + } +} + +/* +FindConfigOverrideDecommissionParams contains all the parameters to send to the API endpoint +for the find config override decommission operation typically these are written to a http.Request +*/ +type FindConfigOverrideDecommissionParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config override decommission params +func (o *FindConfigOverrideDecommissionParams) WithTimeout(timeout time.Duration) *FindConfigOverrideDecommissionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config override decommission params +func (o *FindConfigOverrideDecommissionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config override decommission params +func (o *FindConfigOverrideDecommissionParams) WithContext(ctx context.Context) *FindConfigOverrideDecommissionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config override decommission params +func (o *FindConfigOverrideDecommissionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config override decommission params +func (o *FindConfigOverrideDecommissionParams) WithHTTPClient(client *http.Client) *FindConfigOverrideDecommissionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config override decommission params +func (o *FindConfigOverrideDecommissionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigOverrideDecommissionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_override_decommission_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_override_decommission_responses.go new file mode 100644 index 0000000000..9eb8db659d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_override_decommission_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigOverrideDecommissionReader is a Reader for the FindConfigOverrideDecommission structure. +type FindConfigOverrideDecommissionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigOverrideDecommissionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigOverrideDecommissionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigOverrideDecommissionDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigOverrideDecommissionOK creates a FindConfigOverrideDecommissionOK with default headers values +func NewFindConfigOverrideDecommissionOK() *FindConfigOverrideDecommissionOK { + return &FindConfigOverrideDecommissionOK{} +} + +/* +FindConfigOverrideDecommissionOK handles this case with default header values. + +Config value +*/ +type FindConfigOverrideDecommissionOK struct { + Payload bool +} + +func (o *FindConfigOverrideDecommissionOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigOverrideDecommissionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigOverrideDecommissionDefault creates a FindConfigOverrideDecommissionDefault with default headers values +func NewFindConfigOverrideDecommissionDefault(code int) *FindConfigOverrideDecommissionDefault { + return &FindConfigOverrideDecommissionDefault{ + _statusCode: code, + } +} + +/* +FindConfigOverrideDecommissionDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigOverrideDecommissionDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config override decommission default response +func (o *FindConfigOverrideDecommissionDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigOverrideDecommissionDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigOverrideDecommissionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigOverrideDecommissionDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_partitioner_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_partitioner_parameters.go new file mode 100644 index 0000000000..534356c548 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_partitioner_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigPartitionerParams creates a new FindConfigPartitionerParams object +// with the default values initialized. +func NewFindConfigPartitionerParams() *FindConfigPartitionerParams { + + return &FindConfigPartitionerParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigPartitionerParamsWithTimeout creates a new FindConfigPartitionerParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigPartitionerParamsWithTimeout(timeout time.Duration) *FindConfigPartitionerParams { + + return &FindConfigPartitionerParams{ + + timeout: timeout, + } +} + +// NewFindConfigPartitionerParamsWithContext creates a new FindConfigPartitionerParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigPartitionerParamsWithContext(ctx context.Context) *FindConfigPartitionerParams { + + return &FindConfigPartitionerParams{ + + Context: ctx, + } +} + +// NewFindConfigPartitionerParamsWithHTTPClient creates a new FindConfigPartitionerParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigPartitionerParamsWithHTTPClient(client *http.Client) *FindConfigPartitionerParams { + + return &FindConfigPartitionerParams{ + HTTPClient: client, + } +} + +/* +FindConfigPartitionerParams contains all the parameters to send to the API endpoint +for the find config partitioner operation typically these are written to a http.Request +*/ +type FindConfigPartitionerParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config partitioner params +func (o *FindConfigPartitionerParams) WithTimeout(timeout time.Duration) *FindConfigPartitionerParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config partitioner params +func (o *FindConfigPartitionerParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config partitioner params +func (o *FindConfigPartitionerParams) WithContext(ctx context.Context) *FindConfigPartitionerParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config partitioner params +func (o *FindConfigPartitionerParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config partitioner params +func (o *FindConfigPartitionerParams) WithHTTPClient(client *http.Client) *FindConfigPartitionerParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config partitioner params +func (o *FindConfigPartitionerParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigPartitionerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_partitioner_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_partitioner_responses.go new file mode 100644 index 0000000000..4309568ff3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_partitioner_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigPartitionerReader is a Reader for the FindConfigPartitioner structure. +type FindConfigPartitionerReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigPartitionerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigPartitionerOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigPartitionerDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigPartitionerOK creates a FindConfigPartitionerOK with default headers values +func NewFindConfigPartitionerOK() *FindConfigPartitionerOK { + return &FindConfigPartitionerOK{} +} + +/* +FindConfigPartitionerOK handles this case with default header values. + +Config value +*/ +type FindConfigPartitionerOK struct { + Payload string +} + +func (o *FindConfigPartitionerOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigPartitionerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigPartitionerDefault creates a FindConfigPartitionerDefault with default headers values +func NewFindConfigPartitionerDefault(code int) *FindConfigPartitionerDefault { + return &FindConfigPartitionerDefault{ + _statusCode: code, + } +} + +/* +FindConfigPartitionerDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigPartitionerDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config partitioner default response +func (o *FindConfigPartitionerDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigPartitionerDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigPartitionerDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigPartitionerDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_cache_max_entries_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_cache_max_entries_parameters.go new file mode 100644 index 0000000000..c548d94d84 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_cache_max_entries_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigPermissionsCacheMaxEntriesParams creates a new FindConfigPermissionsCacheMaxEntriesParams object +// with the default values initialized. +func NewFindConfigPermissionsCacheMaxEntriesParams() *FindConfigPermissionsCacheMaxEntriesParams { + + return &FindConfigPermissionsCacheMaxEntriesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigPermissionsCacheMaxEntriesParamsWithTimeout creates a new FindConfigPermissionsCacheMaxEntriesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigPermissionsCacheMaxEntriesParamsWithTimeout(timeout time.Duration) *FindConfigPermissionsCacheMaxEntriesParams { + + return &FindConfigPermissionsCacheMaxEntriesParams{ + + timeout: timeout, + } +} + +// NewFindConfigPermissionsCacheMaxEntriesParamsWithContext creates a new FindConfigPermissionsCacheMaxEntriesParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigPermissionsCacheMaxEntriesParamsWithContext(ctx context.Context) *FindConfigPermissionsCacheMaxEntriesParams { + + return &FindConfigPermissionsCacheMaxEntriesParams{ + + Context: ctx, + } +} + +// NewFindConfigPermissionsCacheMaxEntriesParamsWithHTTPClient creates a new FindConfigPermissionsCacheMaxEntriesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigPermissionsCacheMaxEntriesParamsWithHTTPClient(client *http.Client) *FindConfigPermissionsCacheMaxEntriesParams { + + return &FindConfigPermissionsCacheMaxEntriesParams{ + HTTPClient: client, + } +} + +/* +FindConfigPermissionsCacheMaxEntriesParams contains all the parameters to send to the API endpoint +for the find config permissions cache max entries operation typically these are written to a http.Request +*/ +type FindConfigPermissionsCacheMaxEntriesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config permissions cache max entries params +func (o *FindConfigPermissionsCacheMaxEntriesParams) WithTimeout(timeout time.Duration) *FindConfigPermissionsCacheMaxEntriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config permissions cache max entries params +func (o *FindConfigPermissionsCacheMaxEntriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config permissions cache max entries params +func (o *FindConfigPermissionsCacheMaxEntriesParams) WithContext(ctx context.Context) *FindConfigPermissionsCacheMaxEntriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config permissions cache max entries params +func (o *FindConfigPermissionsCacheMaxEntriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config permissions cache max entries params +func (o *FindConfigPermissionsCacheMaxEntriesParams) WithHTTPClient(client *http.Client) *FindConfigPermissionsCacheMaxEntriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config permissions cache max entries params +func (o *FindConfigPermissionsCacheMaxEntriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigPermissionsCacheMaxEntriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_cache_max_entries_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_cache_max_entries_responses.go new file mode 100644 index 0000000000..8c95ae92a5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_cache_max_entries_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigPermissionsCacheMaxEntriesReader is a Reader for the FindConfigPermissionsCacheMaxEntries structure. +type FindConfigPermissionsCacheMaxEntriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigPermissionsCacheMaxEntriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigPermissionsCacheMaxEntriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigPermissionsCacheMaxEntriesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigPermissionsCacheMaxEntriesOK creates a FindConfigPermissionsCacheMaxEntriesOK with default headers values +func NewFindConfigPermissionsCacheMaxEntriesOK() *FindConfigPermissionsCacheMaxEntriesOK { + return &FindConfigPermissionsCacheMaxEntriesOK{} +} + +/* +FindConfigPermissionsCacheMaxEntriesOK handles this case with default header values. + +Config value +*/ +type FindConfigPermissionsCacheMaxEntriesOK struct { + Payload int64 +} + +func (o *FindConfigPermissionsCacheMaxEntriesOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigPermissionsCacheMaxEntriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigPermissionsCacheMaxEntriesDefault creates a FindConfigPermissionsCacheMaxEntriesDefault with default headers values +func NewFindConfigPermissionsCacheMaxEntriesDefault(code int) *FindConfigPermissionsCacheMaxEntriesDefault { + return &FindConfigPermissionsCacheMaxEntriesDefault{ + _statusCode: code, + } +} + +/* +FindConfigPermissionsCacheMaxEntriesDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigPermissionsCacheMaxEntriesDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config permissions cache max entries default response +func (o *FindConfigPermissionsCacheMaxEntriesDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigPermissionsCacheMaxEntriesDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigPermissionsCacheMaxEntriesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigPermissionsCacheMaxEntriesDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_update_interval_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_update_interval_in_ms_parameters.go new file mode 100644 index 0000000000..67eb7c0d27 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_update_interval_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigPermissionsUpdateIntervalInMsParams creates a new FindConfigPermissionsUpdateIntervalInMsParams object +// with the default values initialized. +func NewFindConfigPermissionsUpdateIntervalInMsParams() *FindConfigPermissionsUpdateIntervalInMsParams { + + return &FindConfigPermissionsUpdateIntervalInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigPermissionsUpdateIntervalInMsParamsWithTimeout creates a new FindConfigPermissionsUpdateIntervalInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigPermissionsUpdateIntervalInMsParamsWithTimeout(timeout time.Duration) *FindConfigPermissionsUpdateIntervalInMsParams { + + return &FindConfigPermissionsUpdateIntervalInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigPermissionsUpdateIntervalInMsParamsWithContext creates a new FindConfigPermissionsUpdateIntervalInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigPermissionsUpdateIntervalInMsParamsWithContext(ctx context.Context) *FindConfigPermissionsUpdateIntervalInMsParams { + + return &FindConfigPermissionsUpdateIntervalInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigPermissionsUpdateIntervalInMsParamsWithHTTPClient creates a new FindConfigPermissionsUpdateIntervalInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigPermissionsUpdateIntervalInMsParamsWithHTTPClient(client *http.Client) *FindConfigPermissionsUpdateIntervalInMsParams { + + return &FindConfigPermissionsUpdateIntervalInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigPermissionsUpdateIntervalInMsParams contains all the parameters to send to the API endpoint +for the find config permissions update interval in ms operation typically these are written to a http.Request +*/ +type FindConfigPermissionsUpdateIntervalInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config permissions update interval in ms params +func (o *FindConfigPermissionsUpdateIntervalInMsParams) WithTimeout(timeout time.Duration) *FindConfigPermissionsUpdateIntervalInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config permissions update interval in ms params +func (o *FindConfigPermissionsUpdateIntervalInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config permissions update interval in ms params +func (o *FindConfigPermissionsUpdateIntervalInMsParams) WithContext(ctx context.Context) *FindConfigPermissionsUpdateIntervalInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config permissions update interval in ms params +func (o *FindConfigPermissionsUpdateIntervalInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config permissions update interval in ms params +func (o *FindConfigPermissionsUpdateIntervalInMsParams) WithHTTPClient(client *http.Client) *FindConfigPermissionsUpdateIntervalInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config permissions update interval in ms params +func (o *FindConfigPermissionsUpdateIntervalInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigPermissionsUpdateIntervalInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_update_interval_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_update_interval_in_ms_responses.go new file mode 100644 index 0000000000..c2edd964d7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_update_interval_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigPermissionsUpdateIntervalInMsReader is a Reader for the FindConfigPermissionsUpdateIntervalInMs structure. +type FindConfigPermissionsUpdateIntervalInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigPermissionsUpdateIntervalInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigPermissionsUpdateIntervalInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigPermissionsUpdateIntervalInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigPermissionsUpdateIntervalInMsOK creates a FindConfigPermissionsUpdateIntervalInMsOK with default headers values +func NewFindConfigPermissionsUpdateIntervalInMsOK() *FindConfigPermissionsUpdateIntervalInMsOK { + return &FindConfigPermissionsUpdateIntervalInMsOK{} +} + +/* +FindConfigPermissionsUpdateIntervalInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigPermissionsUpdateIntervalInMsOK struct { + Payload int64 +} + +func (o *FindConfigPermissionsUpdateIntervalInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigPermissionsUpdateIntervalInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigPermissionsUpdateIntervalInMsDefault creates a FindConfigPermissionsUpdateIntervalInMsDefault with default headers values +func NewFindConfigPermissionsUpdateIntervalInMsDefault(code int) *FindConfigPermissionsUpdateIntervalInMsDefault { + return &FindConfigPermissionsUpdateIntervalInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigPermissionsUpdateIntervalInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigPermissionsUpdateIntervalInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config permissions update interval in ms default response +func (o *FindConfigPermissionsUpdateIntervalInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigPermissionsUpdateIntervalInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigPermissionsUpdateIntervalInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigPermissionsUpdateIntervalInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_validity_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_validity_in_ms_parameters.go new file mode 100644 index 0000000000..01c7f8b5c9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_validity_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigPermissionsValidityInMsParams creates a new FindConfigPermissionsValidityInMsParams object +// with the default values initialized. +func NewFindConfigPermissionsValidityInMsParams() *FindConfigPermissionsValidityInMsParams { + + return &FindConfigPermissionsValidityInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigPermissionsValidityInMsParamsWithTimeout creates a new FindConfigPermissionsValidityInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigPermissionsValidityInMsParamsWithTimeout(timeout time.Duration) *FindConfigPermissionsValidityInMsParams { + + return &FindConfigPermissionsValidityInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigPermissionsValidityInMsParamsWithContext creates a new FindConfigPermissionsValidityInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigPermissionsValidityInMsParamsWithContext(ctx context.Context) *FindConfigPermissionsValidityInMsParams { + + return &FindConfigPermissionsValidityInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigPermissionsValidityInMsParamsWithHTTPClient creates a new FindConfigPermissionsValidityInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigPermissionsValidityInMsParamsWithHTTPClient(client *http.Client) *FindConfigPermissionsValidityInMsParams { + + return &FindConfigPermissionsValidityInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigPermissionsValidityInMsParams contains all the parameters to send to the API endpoint +for the find config permissions validity in ms operation typically these are written to a http.Request +*/ +type FindConfigPermissionsValidityInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config permissions validity in ms params +func (o *FindConfigPermissionsValidityInMsParams) WithTimeout(timeout time.Duration) *FindConfigPermissionsValidityInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config permissions validity in ms params +func (o *FindConfigPermissionsValidityInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config permissions validity in ms params +func (o *FindConfigPermissionsValidityInMsParams) WithContext(ctx context.Context) *FindConfigPermissionsValidityInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config permissions validity in ms params +func (o *FindConfigPermissionsValidityInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config permissions validity in ms params +func (o *FindConfigPermissionsValidityInMsParams) WithHTTPClient(client *http.Client) *FindConfigPermissionsValidityInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config permissions validity in ms params +func (o *FindConfigPermissionsValidityInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigPermissionsValidityInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_validity_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_validity_in_ms_responses.go new file mode 100644 index 0000000000..8c0c62cc89 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_permissions_validity_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigPermissionsValidityInMsReader is a Reader for the FindConfigPermissionsValidityInMs structure. +type FindConfigPermissionsValidityInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigPermissionsValidityInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigPermissionsValidityInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigPermissionsValidityInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigPermissionsValidityInMsOK creates a FindConfigPermissionsValidityInMsOK with default headers values +func NewFindConfigPermissionsValidityInMsOK() *FindConfigPermissionsValidityInMsOK { + return &FindConfigPermissionsValidityInMsOK{} +} + +/* +FindConfigPermissionsValidityInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigPermissionsValidityInMsOK struct { + Payload int64 +} + +func (o *FindConfigPermissionsValidityInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigPermissionsValidityInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigPermissionsValidityInMsDefault creates a FindConfigPermissionsValidityInMsDefault with default headers values +func NewFindConfigPermissionsValidityInMsDefault(code int) *FindConfigPermissionsValidityInMsDefault { + return &FindConfigPermissionsValidityInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigPermissionsValidityInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigPermissionsValidityInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config permissions validity in ms default response +func (o *FindConfigPermissionsValidityInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigPermissionsValidityInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigPermissionsValidityInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigPermissionsValidityInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_phi_convict_threshold_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_phi_convict_threshold_parameters.go new file mode 100644 index 0000000000..d2bb467a89 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_phi_convict_threshold_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigPhiConvictThresholdParams creates a new FindConfigPhiConvictThresholdParams object +// with the default values initialized. +func NewFindConfigPhiConvictThresholdParams() *FindConfigPhiConvictThresholdParams { + + return &FindConfigPhiConvictThresholdParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigPhiConvictThresholdParamsWithTimeout creates a new FindConfigPhiConvictThresholdParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigPhiConvictThresholdParamsWithTimeout(timeout time.Duration) *FindConfigPhiConvictThresholdParams { + + return &FindConfigPhiConvictThresholdParams{ + + timeout: timeout, + } +} + +// NewFindConfigPhiConvictThresholdParamsWithContext creates a new FindConfigPhiConvictThresholdParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigPhiConvictThresholdParamsWithContext(ctx context.Context) *FindConfigPhiConvictThresholdParams { + + return &FindConfigPhiConvictThresholdParams{ + + Context: ctx, + } +} + +// NewFindConfigPhiConvictThresholdParamsWithHTTPClient creates a new FindConfigPhiConvictThresholdParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigPhiConvictThresholdParamsWithHTTPClient(client *http.Client) *FindConfigPhiConvictThresholdParams { + + return &FindConfigPhiConvictThresholdParams{ + HTTPClient: client, + } +} + +/* +FindConfigPhiConvictThresholdParams contains all the parameters to send to the API endpoint +for the find config phi convict threshold operation typically these are written to a http.Request +*/ +type FindConfigPhiConvictThresholdParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config phi convict threshold params +func (o *FindConfigPhiConvictThresholdParams) WithTimeout(timeout time.Duration) *FindConfigPhiConvictThresholdParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config phi convict threshold params +func (o *FindConfigPhiConvictThresholdParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config phi convict threshold params +func (o *FindConfigPhiConvictThresholdParams) WithContext(ctx context.Context) *FindConfigPhiConvictThresholdParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config phi convict threshold params +func (o *FindConfigPhiConvictThresholdParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config phi convict threshold params +func (o *FindConfigPhiConvictThresholdParams) WithHTTPClient(client *http.Client) *FindConfigPhiConvictThresholdParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config phi convict threshold params +func (o *FindConfigPhiConvictThresholdParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigPhiConvictThresholdParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_phi_convict_threshold_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_phi_convict_threshold_responses.go new file mode 100644 index 0000000000..78cdcbb176 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_phi_convict_threshold_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigPhiConvictThresholdReader is a Reader for the FindConfigPhiConvictThreshold structure. +type FindConfigPhiConvictThresholdReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigPhiConvictThresholdReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigPhiConvictThresholdOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigPhiConvictThresholdDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigPhiConvictThresholdOK creates a FindConfigPhiConvictThresholdOK with default headers values +func NewFindConfigPhiConvictThresholdOK() *FindConfigPhiConvictThresholdOK { + return &FindConfigPhiConvictThresholdOK{} +} + +/* +FindConfigPhiConvictThresholdOK handles this case with default header values. + +Config value +*/ +type FindConfigPhiConvictThresholdOK struct { + Payload int64 +} + +func (o *FindConfigPhiConvictThresholdOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigPhiConvictThresholdOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigPhiConvictThresholdDefault creates a FindConfigPhiConvictThresholdDefault with default headers values +func NewFindConfigPhiConvictThresholdDefault(code int) *FindConfigPhiConvictThresholdDefault { + return &FindConfigPhiConvictThresholdDefault{ + _statusCode: code, + } +} + +/* +FindConfigPhiConvictThresholdDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigPhiConvictThresholdDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config phi convict threshold default response +func (o *FindConfigPhiConvictThresholdDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigPhiConvictThresholdDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigPhiConvictThresholdDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigPhiConvictThresholdDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_preheat_kernel_page_cache_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_preheat_kernel_page_cache_parameters.go new file mode 100644 index 0000000000..22a5d22abd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_preheat_kernel_page_cache_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigPreheatKernelPageCacheParams creates a new FindConfigPreheatKernelPageCacheParams object +// with the default values initialized. +func NewFindConfigPreheatKernelPageCacheParams() *FindConfigPreheatKernelPageCacheParams { + + return &FindConfigPreheatKernelPageCacheParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigPreheatKernelPageCacheParamsWithTimeout creates a new FindConfigPreheatKernelPageCacheParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigPreheatKernelPageCacheParamsWithTimeout(timeout time.Duration) *FindConfigPreheatKernelPageCacheParams { + + return &FindConfigPreheatKernelPageCacheParams{ + + timeout: timeout, + } +} + +// NewFindConfigPreheatKernelPageCacheParamsWithContext creates a new FindConfigPreheatKernelPageCacheParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigPreheatKernelPageCacheParamsWithContext(ctx context.Context) *FindConfigPreheatKernelPageCacheParams { + + return &FindConfigPreheatKernelPageCacheParams{ + + Context: ctx, + } +} + +// NewFindConfigPreheatKernelPageCacheParamsWithHTTPClient creates a new FindConfigPreheatKernelPageCacheParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigPreheatKernelPageCacheParamsWithHTTPClient(client *http.Client) *FindConfigPreheatKernelPageCacheParams { + + return &FindConfigPreheatKernelPageCacheParams{ + HTTPClient: client, + } +} + +/* +FindConfigPreheatKernelPageCacheParams contains all the parameters to send to the API endpoint +for the find config preheat kernel page cache operation typically these are written to a http.Request +*/ +type FindConfigPreheatKernelPageCacheParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config preheat kernel page cache params +func (o *FindConfigPreheatKernelPageCacheParams) WithTimeout(timeout time.Duration) *FindConfigPreheatKernelPageCacheParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config preheat kernel page cache params +func (o *FindConfigPreheatKernelPageCacheParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config preheat kernel page cache params +func (o *FindConfigPreheatKernelPageCacheParams) WithContext(ctx context.Context) *FindConfigPreheatKernelPageCacheParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config preheat kernel page cache params +func (o *FindConfigPreheatKernelPageCacheParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config preheat kernel page cache params +func (o *FindConfigPreheatKernelPageCacheParams) WithHTTPClient(client *http.Client) *FindConfigPreheatKernelPageCacheParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config preheat kernel page cache params +func (o *FindConfigPreheatKernelPageCacheParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigPreheatKernelPageCacheParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_preheat_kernel_page_cache_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_preheat_kernel_page_cache_responses.go new file mode 100644 index 0000000000..9e28a8d8fd --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_preheat_kernel_page_cache_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigPreheatKernelPageCacheReader is a Reader for the FindConfigPreheatKernelPageCache structure. +type FindConfigPreheatKernelPageCacheReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigPreheatKernelPageCacheReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigPreheatKernelPageCacheOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigPreheatKernelPageCacheDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigPreheatKernelPageCacheOK creates a FindConfigPreheatKernelPageCacheOK with default headers values +func NewFindConfigPreheatKernelPageCacheOK() *FindConfigPreheatKernelPageCacheOK { + return &FindConfigPreheatKernelPageCacheOK{} +} + +/* +FindConfigPreheatKernelPageCacheOK handles this case with default header values. + +Config value +*/ +type FindConfigPreheatKernelPageCacheOK struct { + Payload bool +} + +func (o *FindConfigPreheatKernelPageCacheOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigPreheatKernelPageCacheOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigPreheatKernelPageCacheDefault creates a FindConfigPreheatKernelPageCacheDefault with default headers values +func NewFindConfigPreheatKernelPageCacheDefault(code int) *FindConfigPreheatKernelPageCacheDefault { + return &FindConfigPreheatKernelPageCacheDefault{ + _statusCode: code, + } +} + +/* +FindConfigPreheatKernelPageCacheDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigPreheatKernelPageCacheDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config preheat kernel page cache default response +func (o *FindConfigPreheatKernelPageCacheDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigPreheatKernelPageCacheDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigPreheatKernelPageCacheDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigPreheatKernelPageCacheDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_address_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_address_parameters.go new file mode 100644 index 0000000000..2679993b19 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_address_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigPrometheusAddressParams creates a new FindConfigPrometheusAddressParams object +// with the default values initialized. +func NewFindConfigPrometheusAddressParams() *FindConfigPrometheusAddressParams { + + return &FindConfigPrometheusAddressParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigPrometheusAddressParamsWithTimeout creates a new FindConfigPrometheusAddressParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigPrometheusAddressParamsWithTimeout(timeout time.Duration) *FindConfigPrometheusAddressParams { + + return &FindConfigPrometheusAddressParams{ + + timeout: timeout, + } +} + +// NewFindConfigPrometheusAddressParamsWithContext creates a new FindConfigPrometheusAddressParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigPrometheusAddressParamsWithContext(ctx context.Context) *FindConfigPrometheusAddressParams { + + return &FindConfigPrometheusAddressParams{ + + Context: ctx, + } +} + +// NewFindConfigPrometheusAddressParamsWithHTTPClient creates a new FindConfigPrometheusAddressParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigPrometheusAddressParamsWithHTTPClient(client *http.Client) *FindConfigPrometheusAddressParams { + + return &FindConfigPrometheusAddressParams{ + HTTPClient: client, + } +} + +/* +FindConfigPrometheusAddressParams contains all the parameters to send to the API endpoint +for the find config prometheus address operation typically these are written to a http.Request +*/ +type FindConfigPrometheusAddressParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config prometheus address params +func (o *FindConfigPrometheusAddressParams) WithTimeout(timeout time.Duration) *FindConfigPrometheusAddressParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config prometheus address params +func (o *FindConfigPrometheusAddressParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config prometheus address params +func (o *FindConfigPrometheusAddressParams) WithContext(ctx context.Context) *FindConfigPrometheusAddressParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config prometheus address params +func (o *FindConfigPrometheusAddressParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config prometheus address params +func (o *FindConfigPrometheusAddressParams) WithHTTPClient(client *http.Client) *FindConfigPrometheusAddressParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config prometheus address params +func (o *FindConfigPrometheusAddressParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigPrometheusAddressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_address_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_address_responses.go new file mode 100644 index 0000000000..1b257c3d4b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_address_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigPrometheusAddressReader is a Reader for the FindConfigPrometheusAddress structure. +type FindConfigPrometheusAddressReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigPrometheusAddressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigPrometheusAddressOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigPrometheusAddressDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigPrometheusAddressOK creates a FindConfigPrometheusAddressOK with default headers values +func NewFindConfigPrometheusAddressOK() *FindConfigPrometheusAddressOK { + return &FindConfigPrometheusAddressOK{} +} + +/* +FindConfigPrometheusAddressOK handles this case with default header values. + +Config value +*/ +type FindConfigPrometheusAddressOK struct { + Payload string +} + +func (o *FindConfigPrometheusAddressOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigPrometheusAddressOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigPrometheusAddressDefault creates a FindConfigPrometheusAddressDefault with default headers values +func NewFindConfigPrometheusAddressDefault(code int) *FindConfigPrometheusAddressDefault { + return &FindConfigPrometheusAddressDefault{ + _statusCode: code, + } +} + +/* +FindConfigPrometheusAddressDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigPrometheusAddressDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config prometheus address default response +func (o *FindConfigPrometheusAddressDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigPrometheusAddressDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigPrometheusAddressDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigPrometheusAddressDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_port_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_port_parameters.go new file mode 100644 index 0000000000..0af89913f8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_port_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigPrometheusPortParams creates a new FindConfigPrometheusPortParams object +// with the default values initialized. +func NewFindConfigPrometheusPortParams() *FindConfigPrometheusPortParams { + + return &FindConfigPrometheusPortParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigPrometheusPortParamsWithTimeout creates a new FindConfigPrometheusPortParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigPrometheusPortParamsWithTimeout(timeout time.Duration) *FindConfigPrometheusPortParams { + + return &FindConfigPrometheusPortParams{ + + timeout: timeout, + } +} + +// NewFindConfigPrometheusPortParamsWithContext creates a new FindConfigPrometheusPortParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigPrometheusPortParamsWithContext(ctx context.Context) *FindConfigPrometheusPortParams { + + return &FindConfigPrometheusPortParams{ + + Context: ctx, + } +} + +// NewFindConfigPrometheusPortParamsWithHTTPClient creates a new FindConfigPrometheusPortParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigPrometheusPortParamsWithHTTPClient(client *http.Client) *FindConfigPrometheusPortParams { + + return &FindConfigPrometheusPortParams{ + HTTPClient: client, + } +} + +/* +FindConfigPrometheusPortParams contains all the parameters to send to the API endpoint +for the find config prometheus port operation typically these are written to a http.Request +*/ +type FindConfigPrometheusPortParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config prometheus port params +func (o *FindConfigPrometheusPortParams) WithTimeout(timeout time.Duration) *FindConfigPrometheusPortParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config prometheus port params +func (o *FindConfigPrometheusPortParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config prometheus port params +func (o *FindConfigPrometheusPortParams) WithContext(ctx context.Context) *FindConfigPrometheusPortParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config prometheus port params +func (o *FindConfigPrometheusPortParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config prometheus port params +func (o *FindConfigPrometheusPortParams) WithHTTPClient(client *http.Client) *FindConfigPrometheusPortParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config prometheus port params +func (o *FindConfigPrometheusPortParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigPrometheusPortParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_port_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_port_responses.go new file mode 100644 index 0000000000..0ac5f98d5b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_port_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigPrometheusPortReader is a Reader for the FindConfigPrometheusPort structure. +type FindConfigPrometheusPortReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigPrometheusPortReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigPrometheusPortOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigPrometheusPortDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigPrometheusPortOK creates a FindConfigPrometheusPortOK with default headers values +func NewFindConfigPrometheusPortOK() *FindConfigPrometheusPortOK { + return &FindConfigPrometheusPortOK{} +} + +/* +FindConfigPrometheusPortOK handles this case with default header values. + +Config value +*/ +type FindConfigPrometheusPortOK struct { + Payload int64 +} + +func (o *FindConfigPrometheusPortOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigPrometheusPortOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigPrometheusPortDefault creates a FindConfigPrometheusPortDefault with default headers values +func NewFindConfigPrometheusPortDefault(code int) *FindConfigPrometheusPortDefault { + return &FindConfigPrometheusPortDefault{ + _statusCode: code, + } +} + +/* +FindConfigPrometheusPortDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigPrometheusPortDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config prometheus port default response +func (o *FindConfigPrometheusPortDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigPrometheusPortDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigPrometheusPortDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigPrometheusPortDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_prefix_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_prefix_parameters.go new file mode 100644 index 0000000000..35a7c99458 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_prefix_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigPrometheusPrefixParams creates a new FindConfigPrometheusPrefixParams object +// with the default values initialized. +func NewFindConfigPrometheusPrefixParams() *FindConfigPrometheusPrefixParams { + + return &FindConfigPrometheusPrefixParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigPrometheusPrefixParamsWithTimeout creates a new FindConfigPrometheusPrefixParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigPrometheusPrefixParamsWithTimeout(timeout time.Duration) *FindConfigPrometheusPrefixParams { + + return &FindConfigPrometheusPrefixParams{ + + timeout: timeout, + } +} + +// NewFindConfigPrometheusPrefixParamsWithContext creates a new FindConfigPrometheusPrefixParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigPrometheusPrefixParamsWithContext(ctx context.Context) *FindConfigPrometheusPrefixParams { + + return &FindConfigPrometheusPrefixParams{ + + Context: ctx, + } +} + +// NewFindConfigPrometheusPrefixParamsWithHTTPClient creates a new FindConfigPrometheusPrefixParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigPrometheusPrefixParamsWithHTTPClient(client *http.Client) *FindConfigPrometheusPrefixParams { + + return &FindConfigPrometheusPrefixParams{ + HTTPClient: client, + } +} + +/* +FindConfigPrometheusPrefixParams contains all the parameters to send to the API endpoint +for the find config prometheus prefix operation typically these are written to a http.Request +*/ +type FindConfigPrometheusPrefixParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config prometheus prefix params +func (o *FindConfigPrometheusPrefixParams) WithTimeout(timeout time.Duration) *FindConfigPrometheusPrefixParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config prometheus prefix params +func (o *FindConfigPrometheusPrefixParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config prometheus prefix params +func (o *FindConfigPrometheusPrefixParams) WithContext(ctx context.Context) *FindConfigPrometheusPrefixParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config prometheus prefix params +func (o *FindConfigPrometheusPrefixParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config prometheus prefix params +func (o *FindConfigPrometheusPrefixParams) WithHTTPClient(client *http.Client) *FindConfigPrometheusPrefixParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config prometheus prefix params +func (o *FindConfigPrometheusPrefixParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigPrometheusPrefixParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_prefix_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_prefix_responses.go new file mode 100644 index 0000000000..465293ee24 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_prometheus_prefix_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigPrometheusPrefixReader is a Reader for the FindConfigPrometheusPrefix structure. +type FindConfigPrometheusPrefixReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigPrometheusPrefixReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigPrometheusPrefixOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigPrometheusPrefixDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigPrometheusPrefixOK creates a FindConfigPrometheusPrefixOK with default headers values +func NewFindConfigPrometheusPrefixOK() *FindConfigPrometheusPrefixOK { + return &FindConfigPrometheusPrefixOK{} +} + +/* +FindConfigPrometheusPrefixOK handles this case with default header values. + +Config value +*/ +type FindConfigPrometheusPrefixOK struct { + Payload string +} + +func (o *FindConfigPrometheusPrefixOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigPrometheusPrefixOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigPrometheusPrefixDefault creates a FindConfigPrometheusPrefixDefault with default headers values +func NewFindConfigPrometheusPrefixDefault(code int) *FindConfigPrometheusPrefixDefault { + return &FindConfigPrometheusPrefixDefault{ + _statusCode: code, + } +} + +/* +FindConfigPrometheusPrefixDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigPrometheusPrefixDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config prometheus prefix default response +func (o *FindConfigPrometheusPrefixDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigPrometheusPrefixDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigPrometheusPrefixDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigPrometheusPrefixDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_range_request_timeout_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_range_request_timeout_in_ms_parameters.go new file mode 100644 index 0000000000..831e317e8f --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_range_request_timeout_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRangeRequestTimeoutInMsParams creates a new FindConfigRangeRequestTimeoutInMsParams object +// with the default values initialized. +func NewFindConfigRangeRequestTimeoutInMsParams() *FindConfigRangeRequestTimeoutInMsParams { + + return &FindConfigRangeRequestTimeoutInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRangeRequestTimeoutInMsParamsWithTimeout creates a new FindConfigRangeRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRangeRequestTimeoutInMsParamsWithTimeout(timeout time.Duration) *FindConfigRangeRequestTimeoutInMsParams { + + return &FindConfigRangeRequestTimeoutInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigRangeRequestTimeoutInMsParamsWithContext creates a new FindConfigRangeRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRangeRequestTimeoutInMsParamsWithContext(ctx context.Context) *FindConfigRangeRequestTimeoutInMsParams { + + return &FindConfigRangeRequestTimeoutInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigRangeRequestTimeoutInMsParamsWithHTTPClient creates a new FindConfigRangeRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRangeRequestTimeoutInMsParamsWithHTTPClient(client *http.Client) *FindConfigRangeRequestTimeoutInMsParams { + + return &FindConfigRangeRequestTimeoutInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigRangeRequestTimeoutInMsParams contains all the parameters to send to the API endpoint +for the find config range request timeout in ms operation typically these are written to a http.Request +*/ +type FindConfigRangeRequestTimeoutInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config range request timeout in ms params +func (o *FindConfigRangeRequestTimeoutInMsParams) WithTimeout(timeout time.Duration) *FindConfigRangeRequestTimeoutInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config range request timeout in ms params +func (o *FindConfigRangeRequestTimeoutInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config range request timeout in ms params +func (o *FindConfigRangeRequestTimeoutInMsParams) WithContext(ctx context.Context) *FindConfigRangeRequestTimeoutInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config range request timeout in ms params +func (o *FindConfigRangeRequestTimeoutInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config range request timeout in ms params +func (o *FindConfigRangeRequestTimeoutInMsParams) WithHTTPClient(client *http.Client) *FindConfigRangeRequestTimeoutInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config range request timeout in ms params +func (o *FindConfigRangeRequestTimeoutInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRangeRequestTimeoutInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_range_request_timeout_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_range_request_timeout_in_ms_responses.go new file mode 100644 index 0000000000..762a1b8110 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_range_request_timeout_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRangeRequestTimeoutInMsReader is a Reader for the FindConfigRangeRequestTimeoutInMs structure. +type FindConfigRangeRequestTimeoutInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRangeRequestTimeoutInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRangeRequestTimeoutInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRangeRequestTimeoutInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRangeRequestTimeoutInMsOK creates a FindConfigRangeRequestTimeoutInMsOK with default headers values +func NewFindConfigRangeRequestTimeoutInMsOK() *FindConfigRangeRequestTimeoutInMsOK { + return &FindConfigRangeRequestTimeoutInMsOK{} +} + +/* +FindConfigRangeRequestTimeoutInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigRangeRequestTimeoutInMsOK struct { + Payload int64 +} + +func (o *FindConfigRangeRequestTimeoutInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigRangeRequestTimeoutInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRangeRequestTimeoutInMsDefault creates a FindConfigRangeRequestTimeoutInMsDefault with default headers values +func NewFindConfigRangeRequestTimeoutInMsDefault(code int) *FindConfigRangeRequestTimeoutInMsDefault { + return &FindConfigRangeRequestTimeoutInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigRangeRequestTimeoutInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRangeRequestTimeoutInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config range request timeout in ms default response +func (o *FindConfigRangeRequestTimeoutInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRangeRequestTimeoutInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRangeRequestTimeoutInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRangeRequestTimeoutInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_read_request_timeout_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_read_request_timeout_in_ms_parameters.go new file mode 100644 index 0000000000..0b1547e93e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_read_request_timeout_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigReadRequestTimeoutInMsParams creates a new FindConfigReadRequestTimeoutInMsParams object +// with the default values initialized. +func NewFindConfigReadRequestTimeoutInMsParams() *FindConfigReadRequestTimeoutInMsParams { + + return &FindConfigReadRequestTimeoutInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigReadRequestTimeoutInMsParamsWithTimeout creates a new FindConfigReadRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigReadRequestTimeoutInMsParamsWithTimeout(timeout time.Duration) *FindConfigReadRequestTimeoutInMsParams { + + return &FindConfigReadRequestTimeoutInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigReadRequestTimeoutInMsParamsWithContext creates a new FindConfigReadRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigReadRequestTimeoutInMsParamsWithContext(ctx context.Context) *FindConfigReadRequestTimeoutInMsParams { + + return &FindConfigReadRequestTimeoutInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigReadRequestTimeoutInMsParamsWithHTTPClient creates a new FindConfigReadRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigReadRequestTimeoutInMsParamsWithHTTPClient(client *http.Client) *FindConfigReadRequestTimeoutInMsParams { + + return &FindConfigReadRequestTimeoutInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigReadRequestTimeoutInMsParams contains all the parameters to send to the API endpoint +for the find config read request timeout in ms operation typically these are written to a http.Request +*/ +type FindConfigReadRequestTimeoutInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config read request timeout in ms params +func (o *FindConfigReadRequestTimeoutInMsParams) WithTimeout(timeout time.Duration) *FindConfigReadRequestTimeoutInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config read request timeout in ms params +func (o *FindConfigReadRequestTimeoutInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config read request timeout in ms params +func (o *FindConfigReadRequestTimeoutInMsParams) WithContext(ctx context.Context) *FindConfigReadRequestTimeoutInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config read request timeout in ms params +func (o *FindConfigReadRequestTimeoutInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config read request timeout in ms params +func (o *FindConfigReadRequestTimeoutInMsParams) WithHTTPClient(client *http.Client) *FindConfigReadRequestTimeoutInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config read request timeout in ms params +func (o *FindConfigReadRequestTimeoutInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigReadRequestTimeoutInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_read_request_timeout_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_read_request_timeout_in_ms_responses.go new file mode 100644 index 0000000000..1a1175541b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_read_request_timeout_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigReadRequestTimeoutInMsReader is a Reader for the FindConfigReadRequestTimeoutInMs structure. +type FindConfigReadRequestTimeoutInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigReadRequestTimeoutInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigReadRequestTimeoutInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigReadRequestTimeoutInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigReadRequestTimeoutInMsOK creates a FindConfigReadRequestTimeoutInMsOK with default headers values +func NewFindConfigReadRequestTimeoutInMsOK() *FindConfigReadRequestTimeoutInMsOK { + return &FindConfigReadRequestTimeoutInMsOK{} +} + +/* +FindConfigReadRequestTimeoutInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigReadRequestTimeoutInMsOK struct { + Payload int64 +} + +func (o *FindConfigReadRequestTimeoutInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigReadRequestTimeoutInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigReadRequestTimeoutInMsDefault creates a FindConfigReadRequestTimeoutInMsDefault with default headers values +func NewFindConfigReadRequestTimeoutInMsDefault(code int) *FindConfigReadRequestTimeoutInMsDefault { + return &FindConfigReadRequestTimeoutInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigReadRequestTimeoutInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigReadRequestTimeoutInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config read request timeout in ms default response +func (o *FindConfigReadRequestTimeoutInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigReadRequestTimeoutInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigReadRequestTimeoutInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigReadRequestTimeoutInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_reduce_cache_capacity_to_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_reduce_cache_capacity_to_parameters.go new file mode 100644 index 0000000000..35e855d0b1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_reduce_cache_capacity_to_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigReduceCacheCapacityToParams creates a new FindConfigReduceCacheCapacityToParams object +// with the default values initialized. +func NewFindConfigReduceCacheCapacityToParams() *FindConfigReduceCacheCapacityToParams { + + return &FindConfigReduceCacheCapacityToParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigReduceCacheCapacityToParamsWithTimeout creates a new FindConfigReduceCacheCapacityToParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigReduceCacheCapacityToParamsWithTimeout(timeout time.Duration) *FindConfigReduceCacheCapacityToParams { + + return &FindConfigReduceCacheCapacityToParams{ + + timeout: timeout, + } +} + +// NewFindConfigReduceCacheCapacityToParamsWithContext creates a new FindConfigReduceCacheCapacityToParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigReduceCacheCapacityToParamsWithContext(ctx context.Context) *FindConfigReduceCacheCapacityToParams { + + return &FindConfigReduceCacheCapacityToParams{ + + Context: ctx, + } +} + +// NewFindConfigReduceCacheCapacityToParamsWithHTTPClient creates a new FindConfigReduceCacheCapacityToParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigReduceCacheCapacityToParamsWithHTTPClient(client *http.Client) *FindConfigReduceCacheCapacityToParams { + + return &FindConfigReduceCacheCapacityToParams{ + HTTPClient: client, + } +} + +/* +FindConfigReduceCacheCapacityToParams contains all the parameters to send to the API endpoint +for the find config reduce cache capacity to operation typically these are written to a http.Request +*/ +type FindConfigReduceCacheCapacityToParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config reduce cache capacity to params +func (o *FindConfigReduceCacheCapacityToParams) WithTimeout(timeout time.Duration) *FindConfigReduceCacheCapacityToParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config reduce cache capacity to params +func (o *FindConfigReduceCacheCapacityToParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config reduce cache capacity to params +func (o *FindConfigReduceCacheCapacityToParams) WithContext(ctx context.Context) *FindConfigReduceCacheCapacityToParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config reduce cache capacity to params +func (o *FindConfigReduceCacheCapacityToParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config reduce cache capacity to params +func (o *FindConfigReduceCacheCapacityToParams) WithHTTPClient(client *http.Client) *FindConfigReduceCacheCapacityToParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config reduce cache capacity to params +func (o *FindConfigReduceCacheCapacityToParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigReduceCacheCapacityToParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_reduce_cache_capacity_to_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_reduce_cache_capacity_to_responses.go new file mode 100644 index 0000000000..2131895206 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_reduce_cache_capacity_to_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigReduceCacheCapacityToReader is a Reader for the FindConfigReduceCacheCapacityTo structure. +type FindConfigReduceCacheCapacityToReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigReduceCacheCapacityToReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigReduceCacheCapacityToOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigReduceCacheCapacityToDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigReduceCacheCapacityToOK creates a FindConfigReduceCacheCapacityToOK with default headers values +func NewFindConfigReduceCacheCapacityToOK() *FindConfigReduceCacheCapacityToOK { + return &FindConfigReduceCacheCapacityToOK{} +} + +/* +FindConfigReduceCacheCapacityToOK handles this case with default header values. + +Config value +*/ +type FindConfigReduceCacheCapacityToOK struct { + Payload float64 +} + +func (o *FindConfigReduceCacheCapacityToOK) GetPayload() float64 { + return o.Payload +} + +func (o *FindConfigReduceCacheCapacityToOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigReduceCacheCapacityToDefault creates a FindConfigReduceCacheCapacityToDefault with default headers values +func NewFindConfigReduceCacheCapacityToDefault(code int) *FindConfigReduceCacheCapacityToDefault { + return &FindConfigReduceCacheCapacityToDefault{ + _statusCode: code, + } +} + +/* +FindConfigReduceCacheCapacityToDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigReduceCacheCapacityToDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config reduce cache capacity to default response +func (o *FindConfigReduceCacheCapacityToDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigReduceCacheCapacityToDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigReduceCacheCapacityToDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigReduceCacheCapacityToDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_reduce_cache_sizes_at_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_reduce_cache_sizes_at_parameters.go new file mode 100644 index 0000000000..a8fd0bcf24 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_reduce_cache_sizes_at_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigReduceCacheSizesAtParams creates a new FindConfigReduceCacheSizesAtParams object +// with the default values initialized. +func NewFindConfigReduceCacheSizesAtParams() *FindConfigReduceCacheSizesAtParams { + + return &FindConfigReduceCacheSizesAtParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigReduceCacheSizesAtParamsWithTimeout creates a new FindConfigReduceCacheSizesAtParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigReduceCacheSizesAtParamsWithTimeout(timeout time.Duration) *FindConfigReduceCacheSizesAtParams { + + return &FindConfigReduceCacheSizesAtParams{ + + timeout: timeout, + } +} + +// NewFindConfigReduceCacheSizesAtParamsWithContext creates a new FindConfigReduceCacheSizesAtParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigReduceCacheSizesAtParamsWithContext(ctx context.Context) *FindConfigReduceCacheSizesAtParams { + + return &FindConfigReduceCacheSizesAtParams{ + + Context: ctx, + } +} + +// NewFindConfigReduceCacheSizesAtParamsWithHTTPClient creates a new FindConfigReduceCacheSizesAtParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigReduceCacheSizesAtParamsWithHTTPClient(client *http.Client) *FindConfigReduceCacheSizesAtParams { + + return &FindConfigReduceCacheSizesAtParams{ + HTTPClient: client, + } +} + +/* +FindConfigReduceCacheSizesAtParams contains all the parameters to send to the API endpoint +for the find config reduce cache sizes at operation typically these are written to a http.Request +*/ +type FindConfigReduceCacheSizesAtParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config reduce cache sizes at params +func (o *FindConfigReduceCacheSizesAtParams) WithTimeout(timeout time.Duration) *FindConfigReduceCacheSizesAtParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config reduce cache sizes at params +func (o *FindConfigReduceCacheSizesAtParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config reduce cache sizes at params +func (o *FindConfigReduceCacheSizesAtParams) WithContext(ctx context.Context) *FindConfigReduceCacheSizesAtParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config reduce cache sizes at params +func (o *FindConfigReduceCacheSizesAtParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config reduce cache sizes at params +func (o *FindConfigReduceCacheSizesAtParams) WithHTTPClient(client *http.Client) *FindConfigReduceCacheSizesAtParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config reduce cache sizes at params +func (o *FindConfigReduceCacheSizesAtParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigReduceCacheSizesAtParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_reduce_cache_sizes_at_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_reduce_cache_sizes_at_responses.go new file mode 100644 index 0000000000..d20e0b45f1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_reduce_cache_sizes_at_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigReduceCacheSizesAtReader is a Reader for the FindConfigReduceCacheSizesAt structure. +type FindConfigReduceCacheSizesAtReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigReduceCacheSizesAtReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigReduceCacheSizesAtOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigReduceCacheSizesAtDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigReduceCacheSizesAtOK creates a FindConfigReduceCacheSizesAtOK with default headers values +func NewFindConfigReduceCacheSizesAtOK() *FindConfigReduceCacheSizesAtOK { + return &FindConfigReduceCacheSizesAtOK{} +} + +/* +FindConfigReduceCacheSizesAtOK handles this case with default header values. + +Config value +*/ +type FindConfigReduceCacheSizesAtOK struct { + Payload float64 +} + +func (o *FindConfigReduceCacheSizesAtOK) GetPayload() float64 { + return o.Payload +} + +func (o *FindConfigReduceCacheSizesAtOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigReduceCacheSizesAtDefault creates a FindConfigReduceCacheSizesAtDefault with default headers values +func NewFindConfigReduceCacheSizesAtDefault(code int) *FindConfigReduceCacheSizesAtDefault { + return &FindConfigReduceCacheSizesAtDefault{ + _statusCode: code, + } +} + +/* +FindConfigReduceCacheSizesAtDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigReduceCacheSizesAtDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config reduce cache sizes at default response +func (o *FindConfigReduceCacheSizesAtDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigReduceCacheSizesAtDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigReduceCacheSizesAtDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigReduceCacheSizesAtDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_replace_node_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_replace_node_parameters.go new file mode 100644 index 0000000000..512e28b12a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_replace_node_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigReplaceNodeParams creates a new FindConfigReplaceNodeParams object +// with the default values initialized. +func NewFindConfigReplaceNodeParams() *FindConfigReplaceNodeParams { + + return &FindConfigReplaceNodeParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigReplaceNodeParamsWithTimeout creates a new FindConfigReplaceNodeParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigReplaceNodeParamsWithTimeout(timeout time.Duration) *FindConfigReplaceNodeParams { + + return &FindConfigReplaceNodeParams{ + + timeout: timeout, + } +} + +// NewFindConfigReplaceNodeParamsWithContext creates a new FindConfigReplaceNodeParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigReplaceNodeParamsWithContext(ctx context.Context) *FindConfigReplaceNodeParams { + + return &FindConfigReplaceNodeParams{ + + Context: ctx, + } +} + +// NewFindConfigReplaceNodeParamsWithHTTPClient creates a new FindConfigReplaceNodeParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigReplaceNodeParamsWithHTTPClient(client *http.Client) *FindConfigReplaceNodeParams { + + return &FindConfigReplaceNodeParams{ + HTTPClient: client, + } +} + +/* +FindConfigReplaceNodeParams contains all the parameters to send to the API endpoint +for the find config replace node operation typically these are written to a http.Request +*/ +type FindConfigReplaceNodeParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config replace node params +func (o *FindConfigReplaceNodeParams) WithTimeout(timeout time.Duration) *FindConfigReplaceNodeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config replace node params +func (o *FindConfigReplaceNodeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config replace node params +func (o *FindConfigReplaceNodeParams) WithContext(ctx context.Context) *FindConfigReplaceNodeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config replace node params +func (o *FindConfigReplaceNodeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config replace node params +func (o *FindConfigReplaceNodeParams) WithHTTPClient(client *http.Client) *FindConfigReplaceNodeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config replace node params +func (o *FindConfigReplaceNodeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigReplaceNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_replace_node_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_replace_node_responses.go new file mode 100644 index 0000000000..fcfc32ddb3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_replace_node_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigReplaceNodeReader is a Reader for the FindConfigReplaceNode structure. +type FindConfigReplaceNodeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigReplaceNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigReplaceNodeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigReplaceNodeDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigReplaceNodeOK creates a FindConfigReplaceNodeOK with default headers values +func NewFindConfigReplaceNodeOK() *FindConfigReplaceNodeOK { + return &FindConfigReplaceNodeOK{} +} + +/* +FindConfigReplaceNodeOK handles this case with default header values. + +Config value +*/ +type FindConfigReplaceNodeOK struct { + Payload string +} + +func (o *FindConfigReplaceNodeOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigReplaceNodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigReplaceNodeDefault creates a FindConfigReplaceNodeDefault with default headers values +func NewFindConfigReplaceNodeDefault(code int) *FindConfigReplaceNodeDefault { + return &FindConfigReplaceNodeDefault{ + _statusCode: code, + } +} + +/* +FindConfigReplaceNodeDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigReplaceNodeDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config replace node default response +func (o *FindConfigReplaceNodeDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigReplaceNodeDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigReplaceNodeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigReplaceNodeDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_replace_token_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_replace_token_parameters.go new file mode 100644 index 0000000000..fd034e4214 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_replace_token_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigReplaceTokenParams creates a new FindConfigReplaceTokenParams object +// with the default values initialized. +func NewFindConfigReplaceTokenParams() *FindConfigReplaceTokenParams { + + return &FindConfigReplaceTokenParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigReplaceTokenParamsWithTimeout creates a new FindConfigReplaceTokenParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigReplaceTokenParamsWithTimeout(timeout time.Duration) *FindConfigReplaceTokenParams { + + return &FindConfigReplaceTokenParams{ + + timeout: timeout, + } +} + +// NewFindConfigReplaceTokenParamsWithContext creates a new FindConfigReplaceTokenParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigReplaceTokenParamsWithContext(ctx context.Context) *FindConfigReplaceTokenParams { + + return &FindConfigReplaceTokenParams{ + + Context: ctx, + } +} + +// NewFindConfigReplaceTokenParamsWithHTTPClient creates a new FindConfigReplaceTokenParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigReplaceTokenParamsWithHTTPClient(client *http.Client) *FindConfigReplaceTokenParams { + + return &FindConfigReplaceTokenParams{ + HTTPClient: client, + } +} + +/* +FindConfigReplaceTokenParams contains all the parameters to send to the API endpoint +for the find config replace token operation typically these are written to a http.Request +*/ +type FindConfigReplaceTokenParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config replace token params +func (o *FindConfigReplaceTokenParams) WithTimeout(timeout time.Duration) *FindConfigReplaceTokenParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config replace token params +func (o *FindConfigReplaceTokenParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config replace token params +func (o *FindConfigReplaceTokenParams) WithContext(ctx context.Context) *FindConfigReplaceTokenParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config replace token params +func (o *FindConfigReplaceTokenParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config replace token params +func (o *FindConfigReplaceTokenParams) WithHTTPClient(client *http.Client) *FindConfigReplaceTokenParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config replace token params +func (o *FindConfigReplaceTokenParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigReplaceTokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_replace_token_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_replace_token_responses.go new file mode 100644 index 0000000000..5a3ce523b2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_replace_token_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigReplaceTokenReader is a Reader for the FindConfigReplaceToken structure. +type FindConfigReplaceTokenReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigReplaceTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigReplaceTokenOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigReplaceTokenDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigReplaceTokenOK creates a FindConfigReplaceTokenOK with default headers values +func NewFindConfigReplaceTokenOK() *FindConfigReplaceTokenOK { + return &FindConfigReplaceTokenOK{} +} + +/* +FindConfigReplaceTokenOK handles this case with default header values. + +Config value +*/ +type FindConfigReplaceTokenOK struct { + Payload string +} + +func (o *FindConfigReplaceTokenOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigReplaceTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigReplaceTokenDefault creates a FindConfigReplaceTokenDefault with default headers values +func NewFindConfigReplaceTokenDefault(code int) *FindConfigReplaceTokenDefault { + return &FindConfigReplaceTokenDefault{ + _statusCode: code, + } +} + +/* +FindConfigReplaceTokenDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigReplaceTokenDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config replace token default response +func (o *FindConfigReplaceTokenDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigReplaceTokenDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigReplaceTokenDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigReplaceTokenDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_id_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_id_parameters.go new file mode 100644 index 0000000000..3fc1313831 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_id_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRequestSchedulerIDParams creates a new FindConfigRequestSchedulerIDParams object +// with the default values initialized. +func NewFindConfigRequestSchedulerIDParams() *FindConfigRequestSchedulerIDParams { + + return &FindConfigRequestSchedulerIDParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRequestSchedulerIDParamsWithTimeout creates a new FindConfigRequestSchedulerIDParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRequestSchedulerIDParamsWithTimeout(timeout time.Duration) *FindConfigRequestSchedulerIDParams { + + return &FindConfigRequestSchedulerIDParams{ + + timeout: timeout, + } +} + +// NewFindConfigRequestSchedulerIDParamsWithContext creates a new FindConfigRequestSchedulerIDParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRequestSchedulerIDParamsWithContext(ctx context.Context) *FindConfigRequestSchedulerIDParams { + + return &FindConfigRequestSchedulerIDParams{ + + Context: ctx, + } +} + +// NewFindConfigRequestSchedulerIDParamsWithHTTPClient creates a new FindConfigRequestSchedulerIDParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRequestSchedulerIDParamsWithHTTPClient(client *http.Client) *FindConfigRequestSchedulerIDParams { + + return &FindConfigRequestSchedulerIDParams{ + HTTPClient: client, + } +} + +/* +FindConfigRequestSchedulerIDParams contains all the parameters to send to the API endpoint +for the find config request scheduler id operation typically these are written to a http.Request +*/ +type FindConfigRequestSchedulerIDParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config request scheduler id params +func (o *FindConfigRequestSchedulerIDParams) WithTimeout(timeout time.Duration) *FindConfigRequestSchedulerIDParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config request scheduler id params +func (o *FindConfigRequestSchedulerIDParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config request scheduler id params +func (o *FindConfigRequestSchedulerIDParams) WithContext(ctx context.Context) *FindConfigRequestSchedulerIDParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config request scheduler id params +func (o *FindConfigRequestSchedulerIDParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config request scheduler id params +func (o *FindConfigRequestSchedulerIDParams) WithHTTPClient(client *http.Client) *FindConfigRequestSchedulerIDParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config request scheduler id params +func (o *FindConfigRequestSchedulerIDParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRequestSchedulerIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_id_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_id_responses.go new file mode 100644 index 0000000000..bd03a8a24c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_id_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRequestSchedulerIDReader is a Reader for the FindConfigRequestSchedulerID structure. +type FindConfigRequestSchedulerIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRequestSchedulerIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRequestSchedulerIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRequestSchedulerIDDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRequestSchedulerIDOK creates a FindConfigRequestSchedulerIDOK with default headers values +func NewFindConfigRequestSchedulerIDOK() *FindConfigRequestSchedulerIDOK { + return &FindConfigRequestSchedulerIDOK{} +} + +/* +FindConfigRequestSchedulerIDOK handles this case with default header values. + +Config value +*/ +type FindConfigRequestSchedulerIDOK struct { + Payload string +} + +func (o *FindConfigRequestSchedulerIDOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigRequestSchedulerIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRequestSchedulerIDDefault creates a FindConfigRequestSchedulerIDDefault with default headers values +func NewFindConfigRequestSchedulerIDDefault(code int) *FindConfigRequestSchedulerIDDefault { + return &FindConfigRequestSchedulerIDDefault{ + _statusCode: code, + } +} + +/* +FindConfigRequestSchedulerIDDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRequestSchedulerIDDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config request scheduler id default response +func (o *FindConfigRequestSchedulerIDDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRequestSchedulerIDDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRequestSchedulerIDDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRequestSchedulerIDDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_options_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_options_parameters.go new file mode 100644 index 0000000000..a0991856a6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_options_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRequestSchedulerOptionsParams creates a new FindConfigRequestSchedulerOptionsParams object +// with the default values initialized. +func NewFindConfigRequestSchedulerOptionsParams() *FindConfigRequestSchedulerOptionsParams { + + return &FindConfigRequestSchedulerOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRequestSchedulerOptionsParamsWithTimeout creates a new FindConfigRequestSchedulerOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRequestSchedulerOptionsParamsWithTimeout(timeout time.Duration) *FindConfigRequestSchedulerOptionsParams { + + return &FindConfigRequestSchedulerOptionsParams{ + + timeout: timeout, + } +} + +// NewFindConfigRequestSchedulerOptionsParamsWithContext creates a new FindConfigRequestSchedulerOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRequestSchedulerOptionsParamsWithContext(ctx context.Context) *FindConfigRequestSchedulerOptionsParams { + + return &FindConfigRequestSchedulerOptionsParams{ + + Context: ctx, + } +} + +// NewFindConfigRequestSchedulerOptionsParamsWithHTTPClient creates a new FindConfigRequestSchedulerOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRequestSchedulerOptionsParamsWithHTTPClient(client *http.Client) *FindConfigRequestSchedulerOptionsParams { + + return &FindConfigRequestSchedulerOptionsParams{ + HTTPClient: client, + } +} + +/* +FindConfigRequestSchedulerOptionsParams contains all the parameters to send to the API endpoint +for the find config request scheduler options operation typically these are written to a http.Request +*/ +type FindConfigRequestSchedulerOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config request scheduler options params +func (o *FindConfigRequestSchedulerOptionsParams) WithTimeout(timeout time.Duration) *FindConfigRequestSchedulerOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config request scheduler options params +func (o *FindConfigRequestSchedulerOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config request scheduler options params +func (o *FindConfigRequestSchedulerOptionsParams) WithContext(ctx context.Context) *FindConfigRequestSchedulerOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config request scheduler options params +func (o *FindConfigRequestSchedulerOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config request scheduler options params +func (o *FindConfigRequestSchedulerOptionsParams) WithHTTPClient(client *http.Client) *FindConfigRequestSchedulerOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config request scheduler options params +func (o *FindConfigRequestSchedulerOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRequestSchedulerOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_options_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_options_responses.go new file mode 100644 index 0000000000..b3cbebed3d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_options_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRequestSchedulerOptionsReader is a Reader for the FindConfigRequestSchedulerOptions structure. +type FindConfigRequestSchedulerOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRequestSchedulerOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRequestSchedulerOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRequestSchedulerOptionsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRequestSchedulerOptionsOK creates a FindConfigRequestSchedulerOptionsOK with default headers values +func NewFindConfigRequestSchedulerOptionsOK() *FindConfigRequestSchedulerOptionsOK { + return &FindConfigRequestSchedulerOptionsOK{} +} + +/* +FindConfigRequestSchedulerOptionsOK handles this case with default header values. + +Config value +*/ +type FindConfigRequestSchedulerOptionsOK struct { + Payload []string +} + +func (o *FindConfigRequestSchedulerOptionsOK) GetPayload() []string { + return o.Payload +} + +func (o *FindConfigRequestSchedulerOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRequestSchedulerOptionsDefault creates a FindConfigRequestSchedulerOptionsDefault with default headers values +func NewFindConfigRequestSchedulerOptionsDefault(code int) *FindConfigRequestSchedulerOptionsDefault { + return &FindConfigRequestSchedulerOptionsDefault{ + _statusCode: code, + } +} + +/* +FindConfigRequestSchedulerOptionsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRequestSchedulerOptionsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config request scheduler options default response +func (o *FindConfigRequestSchedulerOptionsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRequestSchedulerOptionsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRequestSchedulerOptionsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRequestSchedulerOptionsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_parameters.go new file mode 100644 index 0000000000..54ba69cbd2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRequestSchedulerParams creates a new FindConfigRequestSchedulerParams object +// with the default values initialized. +func NewFindConfigRequestSchedulerParams() *FindConfigRequestSchedulerParams { + + return &FindConfigRequestSchedulerParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRequestSchedulerParamsWithTimeout creates a new FindConfigRequestSchedulerParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRequestSchedulerParamsWithTimeout(timeout time.Duration) *FindConfigRequestSchedulerParams { + + return &FindConfigRequestSchedulerParams{ + + timeout: timeout, + } +} + +// NewFindConfigRequestSchedulerParamsWithContext creates a new FindConfigRequestSchedulerParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRequestSchedulerParamsWithContext(ctx context.Context) *FindConfigRequestSchedulerParams { + + return &FindConfigRequestSchedulerParams{ + + Context: ctx, + } +} + +// NewFindConfigRequestSchedulerParamsWithHTTPClient creates a new FindConfigRequestSchedulerParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRequestSchedulerParamsWithHTTPClient(client *http.Client) *FindConfigRequestSchedulerParams { + + return &FindConfigRequestSchedulerParams{ + HTTPClient: client, + } +} + +/* +FindConfigRequestSchedulerParams contains all the parameters to send to the API endpoint +for the find config request scheduler operation typically these are written to a http.Request +*/ +type FindConfigRequestSchedulerParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config request scheduler params +func (o *FindConfigRequestSchedulerParams) WithTimeout(timeout time.Duration) *FindConfigRequestSchedulerParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config request scheduler params +func (o *FindConfigRequestSchedulerParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config request scheduler params +func (o *FindConfigRequestSchedulerParams) WithContext(ctx context.Context) *FindConfigRequestSchedulerParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config request scheduler params +func (o *FindConfigRequestSchedulerParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config request scheduler params +func (o *FindConfigRequestSchedulerParams) WithHTTPClient(client *http.Client) *FindConfigRequestSchedulerParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config request scheduler params +func (o *FindConfigRequestSchedulerParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRequestSchedulerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_responses.go new file mode 100644 index 0000000000..a342bb7ef4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_scheduler_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRequestSchedulerReader is a Reader for the FindConfigRequestScheduler structure. +type FindConfigRequestSchedulerReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRequestSchedulerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRequestSchedulerOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRequestSchedulerDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRequestSchedulerOK creates a FindConfigRequestSchedulerOK with default headers values +func NewFindConfigRequestSchedulerOK() *FindConfigRequestSchedulerOK { + return &FindConfigRequestSchedulerOK{} +} + +/* +FindConfigRequestSchedulerOK handles this case with default header values. + +Config value +*/ +type FindConfigRequestSchedulerOK struct { + Payload string +} + +func (o *FindConfigRequestSchedulerOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigRequestSchedulerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRequestSchedulerDefault creates a FindConfigRequestSchedulerDefault with default headers values +func NewFindConfigRequestSchedulerDefault(code int) *FindConfigRequestSchedulerDefault { + return &FindConfigRequestSchedulerDefault{ + _statusCode: code, + } +} + +/* +FindConfigRequestSchedulerDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRequestSchedulerDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config request scheduler default response +func (o *FindConfigRequestSchedulerDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRequestSchedulerDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRequestSchedulerDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRequestSchedulerDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_timeout_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_timeout_in_ms_parameters.go new file mode 100644 index 0000000000..f6b37c4c92 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_timeout_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRequestTimeoutInMsParams creates a new FindConfigRequestTimeoutInMsParams object +// with the default values initialized. +func NewFindConfigRequestTimeoutInMsParams() *FindConfigRequestTimeoutInMsParams { + + return &FindConfigRequestTimeoutInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRequestTimeoutInMsParamsWithTimeout creates a new FindConfigRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRequestTimeoutInMsParamsWithTimeout(timeout time.Duration) *FindConfigRequestTimeoutInMsParams { + + return &FindConfigRequestTimeoutInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigRequestTimeoutInMsParamsWithContext creates a new FindConfigRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRequestTimeoutInMsParamsWithContext(ctx context.Context) *FindConfigRequestTimeoutInMsParams { + + return &FindConfigRequestTimeoutInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigRequestTimeoutInMsParamsWithHTTPClient creates a new FindConfigRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRequestTimeoutInMsParamsWithHTTPClient(client *http.Client) *FindConfigRequestTimeoutInMsParams { + + return &FindConfigRequestTimeoutInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigRequestTimeoutInMsParams contains all the parameters to send to the API endpoint +for the find config request timeout in ms operation typically these are written to a http.Request +*/ +type FindConfigRequestTimeoutInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config request timeout in ms params +func (o *FindConfigRequestTimeoutInMsParams) WithTimeout(timeout time.Duration) *FindConfigRequestTimeoutInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config request timeout in ms params +func (o *FindConfigRequestTimeoutInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config request timeout in ms params +func (o *FindConfigRequestTimeoutInMsParams) WithContext(ctx context.Context) *FindConfigRequestTimeoutInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config request timeout in ms params +func (o *FindConfigRequestTimeoutInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config request timeout in ms params +func (o *FindConfigRequestTimeoutInMsParams) WithHTTPClient(client *http.Client) *FindConfigRequestTimeoutInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config request timeout in ms params +func (o *FindConfigRequestTimeoutInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRequestTimeoutInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_timeout_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_timeout_in_ms_responses.go new file mode 100644 index 0000000000..aa6aae3780 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_request_timeout_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRequestTimeoutInMsReader is a Reader for the FindConfigRequestTimeoutInMs structure. +type FindConfigRequestTimeoutInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRequestTimeoutInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRequestTimeoutInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRequestTimeoutInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRequestTimeoutInMsOK creates a FindConfigRequestTimeoutInMsOK with default headers values +func NewFindConfigRequestTimeoutInMsOK() *FindConfigRequestTimeoutInMsOK { + return &FindConfigRequestTimeoutInMsOK{} +} + +/* +FindConfigRequestTimeoutInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigRequestTimeoutInMsOK struct { + Payload int64 +} + +func (o *FindConfigRequestTimeoutInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigRequestTimeoutInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRequestTimeoutInMsDefault creates a FindConfigRequestTimeoutInMsDefault with default headers values +func NewFindConfigRequestTimeoutInMsDefault(code int) *FindConfigRequestTimeoutInMsDefault { + return &FindConfigRequestTimeoutInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigRequestTimeoutInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRequestTimeoutInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config request timeout in ms default response +func (o *FindConfigRequestTimeoutInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRequestTimeoutInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRequestTimeoutInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRequestTimeoutInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_ring_delay_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_ring_delay_ms_parameters.go new file mode 100644 index 0000000000..5a70db3f46 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_ring_delay_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRingDelayMsParams creates a new FindConfigRingDelayMsParams object +// with the default values initialized. +func NewFindConfigRingDelayMsParams() *FindConfigRingDelayMsParams { + + return &FindConfigRingDelayMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRingDelayMsParamsWithTimeout creates a new FindConfigRingDelayMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRingDelayMsParamsWithTimeout(timeout time.Duration) *FindConfigRingDelayMsParams { + + return &FindConfigRingDelayMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigRingDelayMsParamsWithContext creates a new FindConfigRingDelayMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRingDelayMsParamsWithContext(ctx context.Context) *FindConfigRingDelayMsParams { + + return &FindConfigRingDelayMsParams{ + + Context: ctx, + } +} + +// NewFindConfigRingDelayMsParamsWithHTTPClient creates a new FindConfigRingDelayMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRingDelayMsParamsWithHTTPClient(client *http.Client) *FindConfigRingDelayMsParams { + + return &FindConfigRingDelayMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigRingDelayMsParams contains all the parameters to send to the API endpoint +for the find config ring delay ms operation typically these are written to a http.Request +*/ +type FindConfigRingDelayMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config ring delay ms params +func (o *FindConfigRingDelayMsParams) WithTimeout(timeout time.Duration) *FindConfigRingDelayMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config ring delay ms params +func (o *FindConfigRingDelayMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config ring delay ms params +func (o *FindConfigRingDelayMsParams) WithContext(ctx context.Context) *FindConfigRingDelayMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config ring delay ms params +func (o *FindConfigRingDelayMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config ring delay ms params +func (o *FindConfigRingDelayMsParams) WithHTTPClient(client *http.Client) *FindConfigRingDelayMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config ring delay ms params +func (o *FindConfigRingDelayMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRingDelayMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_ring_delay_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_ring_delay_ms_responses.go new file mode 100644 index 0000000000..bb1a4202c4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_ring_delay_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRingDelayMsReader is a Reader for the FindConfigRingDelayMs structure. +type FindConfigRingDelayMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRingDelayMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRingDelayMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRingDelayMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRingDelayMsOK creates a FindConfigRingDelayMsOK with default headers values +func NewFindConfigRingDelayMsOK() *FindConfigRingDelayMsOK { + return &FindConfigRingDelayMsOK{} +} + +/* +FindConfigRingDelayMsOK handles this case with default header values. + +Config value +*/ +type FindConfigRingDelayMsOK struct { + Payload int64 +} + +func (o *FindConfigRingDelayMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigRingDelayMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRingDelayMsDefault creates a FindConfigRingDelayMsDefault with default headers values +func NewFindConfigRingDelayMsDefault(code int) *FindConfigRingDelayMsDefault { + return &FindConfigRingDelayMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigRingDelayMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRingDelayMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config ring delay ms default response +func (o *FindConfigRingDelayMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRingDelayMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRingDelayMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRingDelayMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_role_manager_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_role_manager_parameters.go new file mode 100644 index 0000000000..b7542b6c7b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_role_manager_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRoleManagerParams creates a new FindConfigRoleManagerParams object +// with the default values initialized. +func NewFindConfigRoleManagerParams() *FindConfigRoleManagerParams { + + return &FindConfigRoleManagerParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRoleManagerParamsWithTimeout creates a new FindConfigRoleManagerParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRoleManagerParamsWithTimeout(timeout time.Duration) *FindConfigRoleManagerParams { + + return &FindConfigRoleManagerParams{ + + timeout: timeout, + } +} + +// NewFindConfigRoleManagerParamsWithContext creates a new FindConfigRoleManagerParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRoleManagerParamsWithContext(ctx context.Context) *FindConfigRoleManagerParams { + + return &FindConfigRoleManagerParams{ + + Context: ctx, + } +} + +// NewFindConfigRoleManagerParamsWithHTTPClient creates a new FindConfigRoleManagerParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRoleManagerParamsWithHTTPClient(client *http.Client) *FindConfigRoleManagerParams { + + return &FindConfigRoleManagerParams{ + HTTPClient: client, + } +} + +/* +FindConfigRoleManagerParams contains all the parameters to send to the API endpoint +for the find config role manager operation typically these are written to a http.Request +*/ +type FindConfigRoleManagerParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config role manager params +func (o *FindConfigRoleManagerParams) WithTimeout(timeout time.Duration) *FindConfigRoleManagerParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config role manager params +func (o *FindConfigRoleManagerParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config role manager params +func (o *FindConfigRoleManagerParams) WithContext(ctx context.Context) *FindConfigRoleManagerParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config role manager params +func (o *FindConfigRoleManagerParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config role manager params +func (o *FindConfigRoleManagerParams) WithHTTPClient(client *http.Client) *FindConfigRoleManagerParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config role manager params +func (o *FindConfigRoleManagerParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRoleManagerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_role_manager_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_role_manager_responses.go new file mode 100644 index 0000000000..428b06ca35 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_role_manager_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRoleManagerReader is a Reader for the FindConfigRoleManager structure. +type FindConfigRoleManagerReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRoleManagerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRoleManagerOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRoleManagerDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRoleManagerOK creates a FindConfigRoleManagerOK with default headers values +func NewFindConfigRoleManagerOK() *FindConfigRoleManagerOK { + return &FindConfigRoleManagerOK{} +} + +/* +FindConfigRoleManagerOK handles this case with default header values. + +Config value +*/ +type FindConfigRoleManagerOK struct { + Payload string +} + +func (o *FindConfigRoleManagerOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigRoleManagerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRoleManagerDefault creates a FindConfigRoleManagerDefault with default headers values +func NewFindConfigRoleManagerDefault(code int) *FindConfigRoleManagerDefault { + return &FindConfigRoleManagerDefault{ + _statusCode: code, + } +} + +/* +FindConfigRoleManagerDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRoleManagerDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config role manager default response +func (o *FindConfigRoleManagerDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRoleManagerDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRoleManagerDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRoleManagerDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_keys_to_save_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_keys_to_save_parameters.go new file mode 100644 index 0000000000..7900ca5cc7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_keys_to_save_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRowCacheKeysToSaveParams creates a new FindConfigRowCacheKeysToSaveParams object +// with the default values initialized. +func NewFindConfigRowCacheKeysToSaveParams() *FindConfigRowCacheKeysToSaveParams { + + return &FindConfigRowCacheKeysToSaveParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRowCacheKeysToSaveParamsWithTimeout creates a new FindConfigRowCacheKeysToSaveParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRowCacheKeysToSaveParamsWithTimeout(timeout time.Duration) *FindConfigRowCacheKeysToSaveParams { + + return &FindConfigRowCacheKeysToSaveParams{ + + timeout: timeout, + } +} + +// NewFindConfigRowCacheKeysToSaveParamsWithContext creates a new FindConfigRowCacheKeysToSaveParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRowCacheKeysToSaveParamsWithContext(ctx context.Context) *FindConfigRowCacheKeysToSaveParams { + + return &FindConfigRowCacheKeysToSaveParams{ + + Context: ctx, + } +} + +// NewFindConfigRowCacheKeysToSaveParamsWithHTTPClient creates a new FindConfigRowCacheKeysToSaveParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRowCacheKeysToSaveParamsWithHTTPClient(client *http.Client) *FindConfigRowCacheKeysToSaveParams { + + return &FindConfigRowCacheKeysToSaveParams{ + HTTPClient: client, + } +} + +/* +FindConfigRowCacheKeysToSaveParams contains all the parameters to send to the API endpoint +for the find config row cache keys to save operation typically these are written to a http.Request +*/ +type FindConfigRowCacheKeysToSaveParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config row cache keys to save params +func (o *FindConfigRowCacheKeysToSaveParams) WithTimeout(timeout time.Duration) *FindConfigRowCacheKeysToSaveParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config row cache keys to save params +func (o *FindConfigRowCacheKeysToSaveParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config row cache keys to save params +func (o *FindConfigRowCacheKeysToSaveParams) WithContext(ctx context.Context) *FindConfigRowCacheKeysToSaveParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config row cache keys to save params +func (o *FindConfigRowCacheKeysToSaveParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config row cache keys to save params +func (o *FindConfigRowCacheKeysToSaveParams) WithHTTPClient(client *http.Client) *FindConfigRowCacheKeysToSaveParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config row cache keys to save params +func (o *FindConfigRowCacheKeysToSaveParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRowCacheKeysToSaveParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_keys_to_save_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_keys_to_save_responses.go new file mode 100644 index 0000000000..40929ae312 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_keys_to_save_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRowCacheKeysToSaveReader is a Reader for the FindConfigRowCacheKeysToSave structure. +type FindConfigRowCacheKeysToSaveReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRowCacheKeysToSaveReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRowCacheKeysToSaveOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRowCacheKeysToSaveDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRowCacheKeysToSaveOK creates a FindConfigRowCacheKeysToSaveOK with default headers values +func NewFindConfigRowCacheKeysToSaveOK() *FindConfigRowCacheKeysToSaveOK { + return &FindConfigRowCacheKeysToSaveOK{} +} + +/* +FindConfigRowCacheKeysToSaveOK handles this case with default header values. + +Config value +*/ +type FindConfigRowCacheKeysToSaveOK struct { + Payload int64 +} + +func (o *FindConfigRowCacheKeysToSaveOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigRowCacheKeysToSaveOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRowCacheKeysToSaveDefault creates a FindConfigRowCacheKeysToSaveDefault with default headers values +func NewFindConfigRowCacheKeysToSaveDefault(code int) *FindConfigRowCacheKeysToSaveDefault { + return &FindConfigRowCacheKeysToSaveDefault{ + _statusCode: code, + } +} + +/* +FindConfigRowCacheKeysToSaveDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRowCacheKeysToSaveDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config row cache keys to save default response +func (o *FindConfigRowCacheKeysToSaveDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRowCacheKeysToSaveDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRowCacheKeysToSaveDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRowCacheKeysToSaveDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_save_period_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_save_period_parameters.go new file mode 100644 index 0000000000..71b0bb9708 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_save_period_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRowCacheSavePeriodParams creates a new FindConfigRowCacheSavePeriodParams object +// with the default values initialized. +func NewFindConfigRowCacheSavePeriodParams() *FindConfigRowCacheSavePeriodParams { + + return &FindConfigRowCacheSavePeriodParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRowCacheSavePeriodParamsWithTimeout creates a new FindConfigRowCacheSavePeriodParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRowCacheSavePeriodParamsWithTimeout(timeout time.Duration) *FindConfigRowCacheSavePeriodParams { + + return &FindConfigRowCacheSavePeriodParams{ + + timeout: timeout, + } +} + +// NewFindConfigRowCacheSavePeriodParamsWithContext creates a new FindConfigRowCacheSavePeriodParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRowCacheSavePeriodParamsWithContext(ctx context.Context) *FindConfigRowCacheSavePeriodParams { + + return &FindConfigRowCacheSavePeriodParams{ + + Context: ctx, + } +} + +// NewFindConfigRowCacheSavePeriodParamsWithHTTPClient creates a new FindConfigRowCacheSavePeriodParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRowCacheSavePeriodParamsWithHTTPClient(client *http.Client) *FindConfigRowCacheSavePeriodParams { + + return &FindConfigRowCacheSavePeriodParams{ + HTTPClient: client, + } +} + +/* +FindConfigRowCacheSavePeriodParams contains all the parameters to send to the API endpoint +for the find config row cache save period operation typically these are written to a http.Request +*/ +type FindConfigRowCacheSavePeriodParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config row cache save period params +func (o *FindConfigRowCacheSavePeriodParams) WithTimeout(timeout time.Duration) *FindConfigRowCacheSavePeriodParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config row cache save period params +func (o *FindConfigRowCacheSavePeriodParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config row cache save period params +func (o *FindConfigRowCacheSavePeriodParams) WithContext(ctx context.Context) *FindConfigRowCacheSavePeriodParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config row cache save period params +func (o *FindConfigRowCacheSavePeriodParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config row cache save period params +func (o *FindConfigRowCacheSavePeriodParams) WithHTTPClient(client *http.Client) *FindConfigRowCacheSavePeriodParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config row cache save period params +func (o *FindConfigRowCacheSavePeriodParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRowCacheSavePeriodParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_save_period_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_save_period_responses.go new file mode 100644 index 0000000000..4cc8e05ac0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_save_period_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRowCacheSavePeriodReader is a Reader for the FindConfigRowCacheSavePeriod structure. +type FindConfigRowCacheSavePeriodReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRowCacheSavePeriodReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRowCacheSavePeriodOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRowCacheSavePeriodDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRowCacheSavePeriodOK creates a FindConfigRowCacheSavePeriodOK with default headers values +func NewFindConfigRowCacheSavePeriodOK() *FindConfigRowCacheSavePeriodOK { + return &FindConfigRowCacheSavePeriodOK{} +} + +/* +FindConfigRowCacheSavePeriodOK handles this case with default header values. + +Config value +*/ +type FindConfigRowCacheSavePeriodOK struct { + Payload int64 +} + +func (o *FindConfigRowCacheSavePeriodOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigRowCacheSavePeriodOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRowCacheSavePeriodDefault creates a FindConfigRowCacheSavePeriodDefault with default headers values +func NewFindConfigRowCacheSavePeriodDefault(code int) *FindConfigRowCacheSavePeriodDefault { + return &FindConfigRowCacheSavePeriodDefault{ + _statusCode: code, + } +} + +/* +FindConfigRowCacheSavePeriodDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRowCacheSavePeriodDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config row cache save period default response +func (o *FindConfigRowCacheSavePeriodDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRowCacheSavePeriodDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRowCacheSavePeriodDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRowCacheSavePeriodDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_size_in_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_size_in_mb_parameters.go new file mode 100644 index 0000000000..44958b2472 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_size_in_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRowCacheSizeInMbParams creates a new FindConfigRowCacheSizeInMbParams object +// with the default values initialized. +func NewFindConfigRowCacheSizeInMbParams() *FindConfigRowCacheSizeInMbParams { + + return &FindConfigRowCacheSizeInMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRowCacheSizeInMbParamsWithTimeout creates a new FindConfigRowCacheSizeInMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRowCacheSizeInMbParamsWithTimeout(timeout time.Duration) *FindConfigRowCacheSizeInMbParams { + + return &FindConfigRowCacheSizeInMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigRowCacheSizeInMbParamsWithContext creates a new FindConfigRowCacheSizeInMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRowCacheSizeInMbParamsWithContext(ctx context.Context) *FindConfigRowCacheSizeInMbParams { + + return &FindConfigRowCacheSizeInMbParams{ + + Context: ctx, + } +} + +// NewFindConfigRowCacheSizeInMbParamsWithHTTPClient creates a new FindConfigRowCacheSizeInMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRowCacheSizeInMbParamsWithHTTPClient(client *http.Client) *FindConfigRowCacheSizeInMbParams { + + return &FindConfigRowCacheSizeInMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigRowCacheSizeInMbParams contains all the parameters to send to the API endpoint +for the find config row cache size in mb operation typically these are written to a http.Request +*/ +type FindConfigRowCacheSizeInMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config row cache size in mb params +func (o *FindConfigRowCacheSizeInMbParams) WithTimeout(timeout time.Duration) *FindConfigRowCacheSizeInMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config row cache size in mb params +func (o *FindConfigRowCacheSizeInMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config row cache size in mb params +func (o *FindConfigRowCacheSizeInMbParams) WithContext(ctx context.Context) *FindConfigRowCacheSizeInMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config row cache size in mb params +func (o *FindConfigRowCacheSizeInMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config row cache size in mb params +func (o *FindConfigRowCacheSizeInMbParams) WithHTTPClient(client *http.Client) *FindConfigRowCacheSizeInMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config row cache size in mb params +func (o *FindConfigRowCacheSizeInMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRowCacheSizeInMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_size_in_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_size_in_mb_responses.go new file mode 100644 index 0000000000..3fcd49c6cb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_row_cache_size_in_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRowCacheSizeInMbReader is a Reader for the FindConfigRowCacheSizeInMb structure. +type FindConfigRowCacheSizeInMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRowCacheSizeInMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRowCacheSizeInMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRowCacheSizeInMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRowCacheSizeInMbOK creates a FindConfigRowCacheSizeInMbOK with default headers values +func NewFindConfigRowCacheSizeInMbOK() *FindConfigRowCacheSizeInMbOK { + return &FindConfigRowCacheSizeInMbOK{} +} + +/* +FindConfigRowCacheSizeInMbOK handles this case with default header values. + +Config value +*/ +type FindConfigRowCacheSizeInMbOK struct { + Payload int64 +} + +func (o *FindConfigRowCacheSizeInMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigRowCacheSizeInMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRowCacheSizeInMbDefault creates a FindConfigRowCacheSizeInMbDefault with default headers values +func NewFindConfigRowCacheSizeInMbDefault(code int) *FindConfigRowCacheSizeInMbDefault { + return &FindConfigRowCacheSizeInMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigRowCacheSizeInMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRowCacheSizeInMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config row cache size in mb default response +func (o *FindConfigRowCacheSizeInMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRowCacheSizeInMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRowCacheSizeInMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRowCacheSizeInMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_address_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_address_parameters.go new file mode 100644 index 0000000000..07688bc649 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_address_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRPCAddressParams creates a new FindConfigRPCAddressParams object +// with the default values initialized. +func NewFindConfigRPCAddressParams() *FindConfigRPCAddressParams { + + return &FindConfigRPCAddressParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRPCAddressParamsWithTimeout creates a new FindConfigRPCAddressParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRPCAddressParamsWithTimeout(timeout time.Duration) *FindConfigRPCAddressParams { + + return &FindConfigRPCAddressParams{ + + timeout: timeout, + } +} + +// NewFindConfigRPCAddressParamsWithContext creates a new FindConfigRPCAddressParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRPCAddressParamsWithContext(ctx context.Context) *FindConfigRPCAddressParams { + + return &FindConfigRPCAddressParams{ + + Context: ctx, + } +} + +// NewFindConfigRPCAddressParamsWithHTTPClient creates a new FindConfigRPCAddressParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRPCAddressParamsWithHTTPClient(client *http.Client) *FindConfigRPCAddressParams { + + return &FindConfigRPCAddressParams{ + HTTPClient: client, + } +} + +/* +FindConfigRPCAddressParams contains all the parameters to send to the API endpoint +for the find config rpc address operation typically these are written to a http.Request +*/ +type FindConfigRPCAddressParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config rpc address params +func (o *FindConfigRPCAddressParams) WithTimeout(timeout time.Duration) *FindConfigRPCAddressParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config rpc address params +func (o *FindConfigRPCAddressParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config rpc address params +func (o *FindConfigRPCAddressParams) WithContext(ctx context.Context) *FindConfigRPCAddressParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config rpc address params +func (o *FindConfigRPCAddressParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config rpc address params +func (o *FindConfigRPCAddressParams) WithHTTPClient(client *http.Client) *FindConfigRPCAddressParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config rpc address params +func (o *FindConfigRPCAddressParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRPCAddressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_address_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_address_responses.go new file mode 100644 index 0000000000..7639bc2174 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_address_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRPCAddressReader is a Reader for the FindConfigRPCAddress structure. +type FindConfigRPCAddressReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRPCAddressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRPCAddressOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRPCAddressDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRPCAddressOK creates a FindConfigRPCAddressOK with default headers values +func NewFindConfigRPCAddressOK() *FindConfigRPCAddressOK { + return &FindConfigRPCAddressOK{} +} + +/* +FindConfigRPCAddressOK handles this case with default header values. + +Config value +*/ +type FindConfigRPCAddressOK struct { + Payload string +} + +func (o *FindConfigRPCAddressOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigRPCAddressOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRPCAddressDefault creates a FindConfigRPCAddressDefault with default headers values +func NewFindConfigRPCAddressDefault(code int) *FindConfigRPCAddressDefault { + return &FindConfigRPCAddressDefault{ + _statusCode: code, + } +} + +/* +FindConfigRPCAddressDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRPCAddressDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config rpc address default response +func (o *FindConfigRPCAddressDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRPCAddressDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRPCAddressDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRPCAddressDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_interface_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_interface_parameters.go new file mode 100644 index 0000000000..1e880de257 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_interface_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRPCInterfaceParams creates a new FindConfigRPCInterfaceParams object +// with the default values initialized. +func NewFindConfigRPCInterfaceParams() *FindConfigRPCInterfaceParams { + + return &FindConfigRPCInterfaceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRPCInterfaceParamsWithTimeout creates a new FindConfigRPCInterfaceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRPCInterfaceParamsWithTimeout(timeout time.Duration) *FindConfigRPCInterfaceParams { + + return &FindConfigRPCInterfaceParams{ + + timeout: timeout, + } +} + +// NewFindConfigRPCInterfaceParamsWithContext creates a new FindConfigRPCInterfaceParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRPCInterfaceParamsWithContext(ctx context.Context) *FindConfigRPCInterfaceParams { + + return &FindConfigRPCInterfaceParams{ + + Context: ctx, + } +} + +// NewFindConfigRPCInterfaceParamsWithHTTPClient creates a new FindConfigRPCInterfaceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRPCInterfaceParamsWithHTTPClient(client *http.Client) *FindConfigRPCInterfaceParams { + + return &FindConfigRPCInterfaceParams{ + HTTPClient: client, + } +} + +/* +FindConfigRPCInterfaceParams contains all the parameters to send to the API endpoint +for the find config rpc interface operation typically these are written to a http.Request +*/ +type FindConfigRPCInterfaceParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config rpc interface params +func (o *FindConfigRPCInterfaceParams) WithTimeout(timeout time.Duration) *FindConfigRPCInterfaceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config rpc interface params +func (o *FindConfigRPCInterfaceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config rpc interface params +func (o *FindConfigRPCInterfaceParams) WithContext(ctx context.Context) *FindConfigRPCInterfaceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config rpc interface params +func (o *FindConfigRPCInterfaceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config rpc interface params +func (o *FindConfigRPCInterfaceParams) WithHTTPClient(client *http.Client) *FindConfigRPCInterfaceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config rpc interface params +func (o *FindConfigRPCInterfaceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRPCInterfaceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_interface_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_interface_responses.go new file mode 100644 index 0000000000..58969f608d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_interface_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRPCInterfaceReader is a Reader for the FindConfigRPCInterface structure. +type FindConfigRPCInterfaceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRPCInterfaceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRPCInterfaceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRPCInterfaceDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRPCInterfaceOK creates a FindConfigRPCInterfaceOK with default headers values +func NewFindConfigRPCInterfaceOK() *FindConfigRPCInterfaceOK { + return &FindConfigRPCInterfaceOK{} +} + +/* +FindConfigRPCInterfaceOK handles this case with default header values. + +Config value +*/ +type FindConfigRPCInterfaceOK struct { + Payload string +} + +func (o *FindConfigRPCInterfaceOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigRPCInterfaceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRPCInterfaceDefault creates a FindConfigRPCInterfaceDefault with default headers values +func NewFindConfigRPCInterfaceDefault(code int) *FindConfigRPCInterfaceDefault { + return &FindConfigRPCInterfaceDefault{ + _statusCode: code, + } +} + +/* +FindConfigRPCInterfaceDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRPCInterfaceDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config rpc interface default response +func (o *FindConfigRPCInterfaceDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRPCInterfaceDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRPCInterfaceDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRPCInterfaceDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_keepalive_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_keepalive_parameters.go new file mode 100644 index 0000000000..ad6da43094 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_keepalive_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRPCKeepaliveParams creates a new FindConfigRPCKeepaliveParams object +// with the default values initialized. +func NewFindConfigRPCKeepaliveParams() *FindConfigRPCKeepaliveParams { + + return &FindConfigRPCKeepaliveParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRPCKeepaliveParamsWithTimeout creates a new FindConfigRPCKeepaliveParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRPCKeepaliveParamsWithTimeout(timeout time.Duration) *FindConfigRPCKeepaliveParams { + + return &FindConfigRPCKeepaliveParams{ + + timeout: timeout, + } +} + +// NewFindConfigRPCKeepaliveParamsWithContext creates a new FindConfigRPCKeepaliveParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRPCKeepaliveParamsWithContext(ctx context.Context) *FindConfigRPCKeepaliveParams { + + return &FindConfigRPCKeepaliveParams{ + + Context: ctx, + } +} + +// NewFindConfigRPCKeepaliveParamsWithHTTPClient creates a new FindConfigRPCKeepaliveParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRPCKeepaliveParamsWithHTTPClient(client *http.Client) *FindConfigRPCKeepaliveParams { + + return &FindConfigRPCKeepaliveParams{ + HTTPClient: client, + } +} + +/* +FindConfigRPCKeepaliveParams contains all the parameters to send to the API endpoint +for the find config rpc keepalive operation typically these are written to a http.Request +*/ +type FindConfigRPCKeepaliveParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config rpc keepalive params +func (o *FindConfigRPCKeepaliveParams) WithTimeout(timeout time.Duration) *FindConfigRPCKeepaliveParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config rpc keepalive params +func (o *FindConfigRPCKeepaliveParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config rpc keepalive params +func (o *FindConfigRPCKeepaliveParams) WithContext(ctx context.Context) *FindConfigRPCKeepaliveParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config rpc keepalive params +func (o *FindConfigRPCKeepaliveParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config rpc keepalive params +func (o *FindConfigRPCKeepaliveParams) WithHTTPClient(client *http.Client) *FindConfigRPCKeepaliveParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config rpc keepalive params +func (o *FindConfigRPCKeepaliveParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRPCKeepaliveParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_keepalive_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_keepalive_responses.go new file mode 100644 index 0000000000..6f96c48e9a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_keepalive_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRPCKeepaliveReader is a Reader for the FindConfigRPCKeepalive structure. +type FindConfigRPCKeepaliveReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRPCKeepaliveReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRPCKeepaliveOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRPCKeepaliveDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRPCKeepaliveOK creates a FindConfigRPCKeepaliveOK with default headers values +func NewFindConfigRPCKeepaliveOK() *FindConfigRPCKeepaliveOK { + return &FindConfigRPCKeepaliveOK{} +} + +/* +FindConfigRPCKeepaliveOK handles this case with default header values. + +Config value +*/ +type FindConfigRPCKeepaliveOK struct { + Payload bool +} + +func (o *FindConfigRPCKeepaliveOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigRPCKeepaliveOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRPCKeepaliveDefault creates a FindConfigRPCKeepaliveDefault with default headers values +func NewFindConfigRPCKeepaliveDefault(code int) *FindConfigRPCKeepaliveDefault { + return &FindConfigRPCKeepaliveDefault{ + _statusCode: code, + } +} + +/* +FindConfigRPCKeepaliveDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRPCKeepaliveDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config rpc keepalive default response +func (o *FindConfigRPCKeepaliveDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRPCKeepaliveDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRPCKeepaliveDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRPCKeepaliveDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_max_threads_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_max_threads_parameters.go new file mode 100644 index 0000000000..aa9f057c1c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_max_threads_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRPCMaxThreadsParams creates a new FindConfigRPCMaxThreadsParams object +// with the default values initialized. +func NewFindConfigRPCMaxThreadsParams() *FindConfigRPCMaxThreadsParams { + + return &FindConfigRPCMaxThreadsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRPCMaxThreadsParamsWithTimeout creates a new FindConfigRPCMaxThreadsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRPCMaxThreadsParamsWithTimeout(timeout time.Duration) *FindConfigRPCMaxThreadsParams { + + return &FindConfigRPCMaxThreadsParams{ + + timeout: timeout, + } +} + +// NewFindConfigRPCMaxThreadsParamsWithContext creates a new FindConfigRPCMaxThreadsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRPCMaxThreadsParamsWithContext(ctx context.Context) *FindConfigRPCMaxThreadsParams { + + return &FindConfigRPCMaxThreadsParams{ + + Context: ctx, + } +} + +// NewFindConfigRPCMaxThreadsParamsWithHTTPClient creates a new FindConfigRPCMaxThreadsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRPCMaxThreadsParamsWithHTTPClient(client *http.Client) *FindConfigRPCMaxThreadsParams { + + return &FindConfigRPCMaxThreadsParams{ + HTTPClient: client, + } +} + +/* +FindConfigRPCMaxThreadsParams contains all the parameters to send to the API endpoint +for the find config rpc max threads operation typically these are written to a http.Request +*/ +type FindConfigRPCMaxThreadsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config rpc max threads params +func (o *FindConfigRPCMaxThreadsParams) WithTimeout(timeout time.Duration) *FindConfigRPCMaxThreadsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config rpc max threads params +func (o *FindConfigRPCMaxThreadsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config rpc max threads params +func (o *FindConfigRPCMaxThreadsParams) WithContext(ctx context.Context) *FindConfigRPCMaxThreadsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config rpc max threads params +func (o *FindConfigRPCMaxThreadsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config rpc max threads params +func (o *FindConfigRPCMaxThreadsParams) WithHTTPClient(client *http.Client) *FindConfigRPCMaxThreadsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config rpc max threads params +func (o *FindConfigRPCMaxThreadsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRPCMaxThreadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_max_threads_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_max_threads_responses.go new file mode 100644 index 0000000000..3c051d36aa --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_max_threads_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRPCMaxThreadsReader is a Reader for the FindConfigRPCMaxThreads structure. +type FindConfigRPCMaxThreadsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRPCMaxThreadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRPCMaxThreadsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRPCMaxThreadsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRPCMaxThreadsOK creates a FindConfigRPCMaxThreadsOK with default headers values +func NewFindConfigRPCMaxThreadsOK() *FindConfigRPCMaxThreadsOK { + return &FindConfigRPCMaxThreadsOK{} +} + +/* +FindConfigRPCMaxThreadsOK handles this case with default header values. + +Config value +*/ +type FindConfigRPCMaxThreadsOK struct { + Payload int64 +} + +func (o *FindConfigRPCMaxThreadsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigRPCMaxThreadsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRPCMaxThreadsDefault creates a FindConfigRPCMaxThreadsDefault with default headers values +func NewFindConfigRPCMaxThreadsDefault(code int) *FindConfigRPCMaxThreadsDefault { + return &FindConfigRPCMaxThreadsDefault{ + _statusCode: code, + } +} + +/* +FindConfigRPCMaxThreadsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRPCMaxThreadsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config rpc max threads default response +func (o *FindConfigRPCMaxThreadsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRPCMaxThreadsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRPCMaxThreadsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRPCMaxThreadsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_min_threads_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_min_threads_parameters.go new file mode 100644 index 0000000000..a961eb0226 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_min_threads_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRPCMinThreadsParams creates a new FindConfigRPCMinThreadsParams object +// with the default values initialized. +func NewFindConfigRPCMinThreadsParams() *FindConfigRPCMinThreadsParams { + + return &FindConfigRPCMinThreadsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRPCMinThreadsParamsWithTimeout creates a new FindConfigRPCMinThreadsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRPCMinThreadsParamsWithTimeout(timeout time.Duration) *FindConfigRPCMinThreadsParams { + + return &FindConfigRPCMinThreadsParams{ + + timeout: timeout, + } +} + +// NewFindConfigRPCMinThreadsParamsWithContext creates a new FindConfigRPCMinThreadsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRPCMinThreadsParamsWithContext(ctx context.Context) *FindConfigRPCMinThreadsParams { + + return &FindConfigRPCMinThreadsParams{ + + Context: ctx, + } +} + +// NewFindConfigRPCMinThreadsParamsWithHTTPClient creates a new FindConfigRPCMinThreadsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRPCMinThreadsParamsWithHTTPClient(client *http.Client) *FindConfigRPCMinThreadsParams { + + return &FindConfigRPCMinThreadsParams{ + HTTPClient: client, + } +} + +/* +FindConfigRPCMinThreadsParams contains all the parameters to send to the API endpoint +for the find config rpc min threads operation typically these are written to a http.Request +*/ +type FindConfigRPCMinThreadsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config rpc min threads params +func (o *FindConfigRPCMinThreadsParams) WithTimeout(timeout time.Duration) *FindConfigRPCMinThreadsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config rpc min threads params +func (o *FindConfigRPCMinThreadsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config rpc min threads params +func (o *FindConfigRPCMinThreadsParams) WithContext(ctx context.Context) *FindConfigRPCMinThreadsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config rpc min threads params +func (o *FindConfigRPCMinThreadsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config rpc min threads params +func (o *FindConfigRPCMinThreadsParams) WithHTTPClient(client *http.Client) *FindConfigRPCMinThreadsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config rpc min threads params +func (o *FindConfigRPCMinThreadsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRPCMinThreadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_min_threads_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_min_threads_responses.go new file mode 100644 index 0000000000..6e4641516d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_min_threads_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRPCMinThreadsReader is a Reader for the FindConfigRPCMinThreads structure. +type FindConfigRPCMinThreadsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRPCMinThreadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRPCMinThreadsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRPCMinThreadsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRPCMinThreadsOK creates a FindConfigRPCMinThreadsOK with default headers values +func NewFindConfigRPCMinThreadsOK() *FindConfigRPCMinThreadsOK { + return &FindConfigRPCMinThreadsOK{} +} + +/* +FindConfigRPCMinThreadsOK handles this case with default header values. + +Config value +*/ +type FindConfigRPCMinThreadsOK struct { + Payload int64 +} + +func (o *FindConfigRPCMinThreadsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigRPCMinThreadsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRPCMinThreadsDefault creates a FindConfigRPCMinThreadsDefault with default headers values +func NewFindConfigRPCMinThreadsDefault(code int) *FindConfigRPCMinThreadsDefault { + return &FindConfigRPCMinThreadsDefault{ + _statusCode: code, + } +} + +/* +FindConfigRPCMinThreadsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRPCMinThreadsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config rpc min threads default response +func (o *FindConfigRPCMinThreadsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRPCMinThreadsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRPCMinThreadsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRPCMinThreadsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_port_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_port_parameters.go new file mode 100644 index 0000000000..35c1e54fb2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_port_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRPCPortParams creates a new FindConfigRPCPortParams object +// with the default values initialized. +func NewFindConfigRPCPortParams() *FindConfigRPCPortParams { + + return &FindConfigRPCPortParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRPCPortParamsWithTimeout creates a new FindConfigRPCPortParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRPCPortParamsWithTimeout(timeout time.Duration) *FindConfigRPCPortParams { + + return &FindConfigRPCPortParams{ + + timeout: timeout, + } +} + +// NewFindConfigRPCPortParamsWithContext creates a new FindConfigRPCPortParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRPCPortParamsWithContext(ctx context.Context) *FindConfigRPCPortParams { + + return &FindConfigRPCPortParams{ + + Context: ctx, + } +} + +// NewFindConfigRPCPortParamsWithHTTPClient creates a new FindConfigRPCPortParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRPCPortParamsWithHTTPClient(client *http.Client) *FindConfigRPCPortParams { + + return &FindConfigRPCPortParams{ + HTTPClient: client, + } +} + +/* +FindConfigRPCPortParams contains all the parameters to send to the API endpoint +for the find config rpc port operation typically these are written to a http.Request +*/ +type FindConfigRPCPortParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config rpc port params +func (o *FindConfigRPCPortParams) WithTimeout(timeout time.Duration) *FindConfigRPCPortParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config rpc port params +func (o *FindConfigRPCPortParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config rpc port params +func (o *FindConfigRPCPortParams) WithContext(ctx context.Context) *FindConfigRPCPortParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config rpc port params +func (o *FindConfigRPCPortParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config rpc port params +func (o *FindConfigRPCPortParams) WithHTTPClient(client *http.Client) *FindConfigRPCPortParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config rpc port params +func (o *FindConfigRPCPortParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRPCPortParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_port_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_port_responses.go new file mode 100644 index 0000000000..040f6daa92 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_port_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRPCPortReader is a Reader for the FindConfigRPCPort structure. +type FindConfigRPCPortReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRPCPortReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRPCPortOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRPCPortDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRPCPortOK creates a FindConfigRPCPortOK with default headers values +func NewFindConfigRPCPortOK() *FindConfigRPCPortOK { + return &FindConfigRPCPortOK{} +} + +/* +FindConfigRPCPortOK handles this case with default header values. + +Config value +*/ +type FindConfigRPCPortOK struct { + Payload int64 +} + +func (o *FindConfigRPCPortOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigRPCPortOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRPCPortDefault creates a FindConfigRPCPortDefault with default headers values +func NewFindConfigRPCPortDefault(code int) *FindConfigRPCPortDefault { + return &FindConfigRPCPortDefault{ + _statusCode: code, + } +} + +/* +FindConfigRPCPortDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRPCPortDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config rpc port default response +func (o *FindConfigRPCPortDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRPCPortDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRPCPortDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRPCPortDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_recv_buff_size_in_bytes_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_recv_buff_size_in_bytes_parameters.go new file mode 100644 index 0000000000..b5fa566d56 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_recv_buff_size_in_bytes_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRPCRecvBuffSizeInBytesParams creates a new FindConfigRPCRecvBuffSizeInBytesParams object +// with the default values initialized. +func NewFindConfigRPCRecvBuffSizeInBytesParams() *FindConfigRPCRecvBuffSizeInBytesParams { + + return &FindConfigRPCRecvBuffSizeInBytesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRPCRecvBuffSizeInBytesParamsWithTimeout creates a new FindConfigRPCRecvBuffSizeInBytesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRPCRecvBuffSizeInBytesParamsWithTimeout(timeout time.Duration) *FindConfigRPCRecvBuffSizeInBytesParams { + + return &FindConfigRPCRecvBuffSizeInBytesParams{ + + timeout: timeout, + } +} + +// NewFindConfigRPCRecvBuffSizeInBytesParamsWithContext creates a new FindConfigRPCRecvBuffSizeInBytesParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRPCRecvBuffSizeInBytesParamsWithContext(ctx context.Context) *FindConfigRPCRecvBuffSizeInBytesParams { + + return &FindConfigRPCRecvBuffSizeInBytesParams{ + + Context: ctx, + } +} + +// NewFindConfigRPCRecvBuffSizeInBytesParamsWithHTTPClient creates a new FindConfigRPCRecvBuffSizeInBytesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRPCRecvBuffSizeInBytesParamsWithHTTPClient(client *http.Client) *FindConfigRPCRecvBuffSizeInBytesParams { + + return &FindConfigRPCRecvBuffSizeInBytesParams{ + HTTPClient: client, + } +} + +/* +FindConfigRPCRecvBuffSizeInBytesParams contains all the parameters to send to the API endpoint +for the find config rpc recv buff size in bytes operation typically these are written to a http.Request +*/ +type FindConfigRPCRecvBuffSizeInBytesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config rpc recv buff size in bytes params +func (o *FindConfigRPCRecvBuffSizeInBytesParams) WithTimeout(timeout time.Duration) *FindConfigRPCRecvBuffSizeInBytesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config rpc recv buff size in bytes params +func (o *FindConfigRPCRecvBuffSizeInBytesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config rpc recv buff size in bytes params +func (o *FindConfigRPCRecvBuffSizeInBytesParams) WithContext(ctx context.Context) *FindConfigRPCRecvBuffSizeInBytesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config rpc recv buff size in bytes params +func (o *FindConfigRPCRecvBuffSizeInBytesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config rpc recv buff size in bytes params +func (o *FindConfigRPCRecvBuffSizeInBytesParams) WithHTTPClient(client *http.Client) *FindConfigRPCRecvBuffSizeInBytesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config rpc recv buff size in bytes params +func (o *FindConfigRPCRecvBuffSizeInBytesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRPCRecvBuffSizeInBytesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_recv_buff_size_in_bytes_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_recv_buff_size_in_bytes_responses.go new file mode 100644 index 0000000000..fa3ce31b81 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_recv_buff_size_in_bytes_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRPCRecvBuffSizeInBytesReader is a Reader for the FindConfigRPCRecvBuffSizeInBytes structure. +type FindConfigRPCRecvBuffSizeInBytesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRPCRecvBuffSizeInBytesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRPCRecvBuffSizeInBytesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRPCRecvBuffSizeInBytesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRPCRecvBuffSizeInBytesOK creates a FindConfigRPCRecvBuffSizeInBytesOK with default headers values +func NewFindConfigRPCRecvBuffSizeInBytesOK() *FindConfigRPCRecvBuffSizeInBytesOK { + return &FindConfigRPCRecvBuffSizeInBytesOK{} +} + +/* +FindConfigRPCRecvBuffSizeInBytesOK handles this case with default header values. + +Config value +*/ +type FindConfigRPCRecvBuffSizeInBytesOK struct { + Payload int64 +} + +func (o *FindConfigRPCRecvBuffSizeInBytesOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigRPCRecvBuffSizeInBytesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRPCRecvBuffSizeInBytesDefault creates a FindConfigRPCRecvBuffSizeInBytesDefault with default headers values +func NewFindConfigRPCRecvBuffSizeInBytesDefault(code int) *FindConfigRPCRecvBuffSizeInBytesDefault { + return &FindConfigRPCRecvBuffSizeInBytesDefault{ + _statusCode: code, + } +} + +/* +FindConfigRPCRecvBuffSizeInBytesDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRPCRecvBuffSizeInBytesDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config rpc recv buff size in bytes default response +func (o *FindConfigRPCRecvBuffSizeInBytesDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRPCRecvBuffSizeInBytesDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRPCRecvBuffSizeInBytesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRPCRecvBuffSizeInBytesDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_send_buff_size_in_bytes_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_send_buff_size_in_bytes_parameters.go new file mode 100644 index 0000000000..1b4d0a1a9c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_send_buff_size_in_bytes_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRPCSendBuffSizeInBytesParams creates a new FindConfigRPCSendBuffSizeInBytesParams object +// with the default values initialized. +func NewFindConfigRPCSendBuffSizeInBytesParams() *FindConfigRPCSendBuffSizeInBytesParams { + + return &FindConfigRPCSendBuffSizeInBytesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRPCSendBuffSizeInBytesParamsWithTimeout creates a new FindConfigRPCSendBuffSizeInBytesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRPCSendBuffSizeInBytesParamsWithTimeout(timeout time.Duration) *FindConfigRPCSendBuffSizeInBytesParams { + + return &FindConfigRPCSendBuffSizeInBytesParams{ + + timeout: timeout, + } +} + +// NewFindConfigRPCSendBuffSizeInBytesParamsWithContext creates a new FindConfigRPCSendBuffSizeInBytesParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRPCSendBuffSizeInBytesParamsWithContext(ctx context.Context) *FindConfigRPCSendBuffSizeInBytesParams { + + return &FindConfigRPCSendBuffSizeInBytesParams{ + + Context: ctx, + } +} + +// NewFindConfigRPCSendBuffSizeInBytesParamsWithHTTPClient creates a new FindConfigRPCSendBuffSizeInBytesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRPCSendBuffSizeInBytesParamsWithHTTPClient(client *http.Client) *FindConfigRPCSendBuffSizeInBytesParams { + + return &FindConfigRPCSendBuffSizeInBytesParams{ + HTTPClient: client, + } +} + +/* +FindConfigRPCSendBuffSizeInBytesParams contains all the parameters to send to the API endpoint +for the find config rpc send buff size in bytes operation typically these are written to a http.Request +*/ +type FindConfigRPCSendBuffSizeInBytesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config rpc send buff size in bytes params +func (o *FindConfigRPCSendBuffSizeInBytesParams) WithTimeout(timeout time.Duration) *FindConfigRPCSendBuffSizeInBytesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config rpc send buff size in bytes params +func (o *FindConfigRPCSendBuffSizeInBytesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config rpc send buff size in bytes params +func (o *FindConfigRPCSendBuffSizeInBytesParams) WithContext(ctx context.Context) *FindConfigRPCSendBuffSizeInBytesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config rpc send buff size in bytes params +func (o *FindConfigRPCSendBuffSizeInBytesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config rpc send buff size in bytes params +func (o *FindConfigRPCSendBuffSizeInBytesParams) WithHTTPClient(client *http.Client) *FindConfigRPCSendBuffSizeInBytesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config rpc send buff size in bytes params +func (o *FindConfigRPCSendBuffSizeInBytesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRPCSendBuffSizeInBytesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_send_buff_size_in_bytes_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_send_buff_size_in_bytes_responses.go new file mode 100644 index 0000000000..6f046d7f0e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_send_buff_size_in_bytes_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRPCSendBuffSizeInBytesReader is a Reader for the FindConfigRPCSendBuffSizeInBytes structure. +type FindConfigRPCSendBuffSizeInBytesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRPCSendBuffSizeInBytesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRPCSendBuffSizeInBytesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRPCSendBuffSizeInBytesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRPCSendBuffSizeInBytesOK creates a FindConfigRPCSendBuffSizeInBytesOK with default headers values +func NewFindConfigRPCSendBuffSizeInBytesOK() *FindConfigRPCSendBuffSizeInBytesOK { + return &FindConfigRPCSendBuffSizeInBytesOK{} +} + +/* +FindConfigRPCSendBuffSizeInBytesOK handles this case with default header values. + +Config value +*/ +type FindConfigRPCSendBuffSizeInBytesOK struct { + Payload int64 +} + +func (o *FindConfigRPCSendBuffSizeInBytesOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigRPCSendBuffSizeInBytesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRPCSendBuffSizeInBytesDefault creates a FindConfigRPCSendBuffSizeInBytesDefault with default headers values +func NewFindConfigRPCSendBuffSizeInBytesDefault(code int) *FindConfigRPCSendBuffSizeInBytesDefault { + return &FindConfigRPCSendBuffSizeInBytesDefault{ + _statusCode: code, + } +} + +/* +FindConfigRPCSendBuffSizeInBytesDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRPCSendBuffSizeInBytesDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config rpc send buff size in bytes default response +func (o *FindConfigRPCSendBuffSizeInBytesDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRPCSendBuffSizeInBytesDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRPCSendBuffSizeInBytesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRPCSendBuffSizeInBytesDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_server_type_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_server_type_parameters.go new file mode 100644 index 0000000000..bb6d1ae559 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_server_type_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigRPCServerTypeParams creates a new FindConfigRPCServerTypeParams object +// with the default values initialized. +func NewFindConfigRPCServerTypeParams() *FindConfigRPCServerTypeParams { + + return &FindConfigRPCServerTypeParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigRPCServerTypeParamsWithTimeout creates a new FindConfigRPCServerTypeParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigRPCServerTypeParamsWithTimeout(timeout time.Duration) *FindConfigRPCServerTypeParams { + + return &FindConfigRPCServerTypeParams{ + + timeout: timeout, + } +} + +// NewFindConfigRPCServerTypeParamsWithContext creates a new FindConfigRPCServerTypeParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigRPCServerTypeParamsWithContext(ctx context.Context) *FindConfigRPCServerTypeParams { + + return &FindConfigRPCServerTypeParams{ + + Context: ctx, + } +} + +// NewFindConfigRPCServerTypeParamsWithHTTPClient creates a new FindConfigRPCServerTypeParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigRPCServerTypeParamsWithHTTPClient(client *http.Client) *FindConfigRPCServerTypeParams { + + return &FindConfigRPCServerTypeParams{ + HTTPClient: client, + } +} + +/* +FindConfigRPCServerTypeParams contains all the parameters to send to the API endpoint +for the find config rpc server type operation typically these are written to a http.Request +*/ +type FindConfigRPCServerTypeParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config rpc server type params +func (o *FindConfigRPCServerTypeParams) WithTimeout(timeout time.Duration) *FindConfigRPCServerTypeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config rpc server type params +func (o *FindConfigRPCServerTypeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config rpc server type params +func (o *FindConfigRPCServerTypeParams) WithContext(ctx context.Context) *FindConfigRPCServerTypeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config rpc server type params +func (o *FindConfigRPCServerTypeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config rpc server type params +func (o *FindConfigRPCServerTypeParams) WithHTTPClient(client *http.Client) *FindConfigRPCServerTypeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config rpc server type params +func (o *FindConfigRPCServerTypeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigRPCServerTypeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_server_type_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_server_type_responses.go new file mode 100644 index 0000000000..0f645edfd1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_rpc_server_type_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigRPCServerTypeReader is a Reader for the FindConfigRPCServerType structure. +type FindConfigRPCServerTypeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigRPCServerTypeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigRPCServerTypeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigRPCServerTypeDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigRPCServerTypeOK creates a FindConfigRPCServerTypeOK with default headers values +func NewFindConfigRPCServerTypeOK() *FindConfigRPCServerTypeOK { + return &FindConfigRPCServerTypeOK{} +} + +/* +FindConfigRPCServerTypeOK handles this case with default header values. + +Config value +*/ +type FindConfigRPCServerTypeOK struct { + Payload string +} + +func (o *FindConfigRPCServerTypeOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigRPCServerTypeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigRPCServerTypeDefault creates a FindConfigRPCServerTypeDefault with default headers values +func NewFindConfigRPCServerTypeDefault(code int) *FindConfigRPCServerTypeDefault { + return &FindConfigRPCServerTypeDefault{ + _statusCode: code, + } +} + +/* +FindConfigRPCServerTypeDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigRPCServerTypeDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config rpc server type default response +func (o *FindConfigRPCServerTypeDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigRPCServerTypeDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigRPCServerTypeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigRPCServerTypeDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_saved_caches_directory_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_saved_caches_directory_parameters.go new file mode 100644 index 0000000000..4fcb8237f0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_saved_caches_directory_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigSavedCachesDirectoryParams creates a new FindConfigSavedCachesDirectoryParams object +// with the default values initialized. +func NewFindConfigSavedCachesDirectoryParams() *FindConfigSavedCachesDirectoryParams { + + return &FindConfigSavedCachesDirectoryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigSavedCachesDirectoryParamsWithTimeout creates a new FindConfigSavedCachesDirectoryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigSavedCachesDirectoryParamsWithTimeout(timeout time.Duration) *FindConfigSavedCachesDirectoryParams { + + return &FindConfigSavedCachesDirectoryParams{ + + timeout: timeout, + } +} + +// NewFindConfigSavedCachesDirectoryParamsWithContext creates a new FindConfigSavedCachesDirectoryParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigSavedCachesDirectoryParamsWithContext(ctx context.Context) *FindConfigSavedCachesDirectoryParams { + + return &FindConfigSavedCachesDirectoryParams{ + + Context: ctx, + } +} + +// NewFindConfigSavedCachesDirectoryParamsWithHTTPClient creates a new FindConfigSavedCachesDirectoryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigSavedCachesDirectoryParamsWithHTTPClient(client *http.Client) *FindConfigSavedCachesDirectoryParams { + + return &FindConfigSavedCachesDirectoryParams{ + HTTPClient: client, + } +} + +/* +FindConfigSavedCachesDirectoryParams contains all the parameters to send to the API endpoint +for the find config saved caches directory operation typically these are written to a http.Request +*/ +type FindConfigSavedCachesDirectoryParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config saved caches directory params +func (o *FindConfigSavedCachesDirectoryParams) WithTimeout(timeout time.Duration) *FindConfigSavedCachesDirectoryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config saved caches directory params +func (o *FindConfigSavedCachesDirectoryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config saved caches directory params +func (o *FindConfigSavedCachesDirectoryParams) WithContext(ctx context.Context) *FindConfigSavedCachesDirectoryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config saved caches directory params +func (o *FindConfigSavedCachesDirectoryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config saved caches directory params +func (o *FindConfigSavedCachesDirectoryParams) WithHTTPClient(client *http.Client) *FindConfigSavedCachesDirectoryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config saved caches directory params +func (o *FindConfigSavedCachesDirectoryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigSavedCachesDirectoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_saved_caches_directory_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_saved_caches_directory_responses.go new file mode 100644 index 0000000000..6aa3b621dc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_saved_caches_directory_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigSavedCachesDirectoryReader is a Reader for the FindConfigSavedCachesDirectory structure. +type FindConfigSavedCachesDirectoryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigSavedCachesDirectoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigSavedCachesDirectoryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigSavedCachesDirectoryDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigSavedCachesDirectoryOK creates a FindConfigSavedCachesDirectoryOK with default headers values +func NewFindConfigSavedCachesDirectoryOK() *FindConfigSavedCachesDirectoryOK { + return &FindConfigSavedCachesDirectoryOK{} +} + +/* +FindConfigSavedCachesDirectoryOK handles this case with default header values. + +Config value +*/ +type FindConfigSavedCachesDirectoryOK struct { + Payload string +} + +func (o *FindConfigSavedCachesDirectoryOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigSavedCachesDirectoryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigSavedCachesDirectoryDefault creates a FindConfigSavedCachesDirectoryDefault with default headers values +func NewFindConfigSavedCachesDirectoryDefault(code int) *FindConfigSavedCachesDirectoryDefault { + return &FindConfigSavedCachesDirectoryDefault{ + _statusCode: code, + } +} + +/* +FindConfigSavedCachesDirectoryDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigSavedCachesDirectoryDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config saved caches directory default response +func (o *FindConfigSavedCachesDirectoryDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigSavedCachesDirectoryDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigSavedCachesDirectoryDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigSavedCachesDirectoryDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_seed_provider_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_seed_provider_parameters.go new file mode 100644 index 0000000000..fda3b50125 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_seed_provider_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigSeedProviderParams creates a new FindConfigSeedProviderParams object +// with the default values initialized. +func NewFindConfigSeedProviderParams() *FindConfigSeedProviderParams { + + return &FindConfigSeedProviderParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigSeedProviderParamsWithTimeout creates a new FindConfigSeedProviderParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigSeedProviderParamsWithTimeout(timeout time.Duration) *FindConfigSeedProviderParams { + + return &FindConfigSeedProviderParams{ + + timeout: timeout, + } +} + +// NewFindConfigSeedProviderParamsWithContext creates a new FindConfigSeedProviderParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigSeedProviderParamsWithContext(ctx context.Context) *FindConfigSeedProviderParams { + + return &FindConfigSeedProviderParams{ + + Context: ctx, + } +} + +// NewFindConfigSeedProviderParamsWithHTTPClient creates a new FindConfigSeedProviderParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigSeedProviderParamsWithHTTPClient(client *http.Client) *FindConfigSeedProviderParams { + + return &FindConfigSeedProviderParams{ + HTTPClient: client, + } +} + +/* +FindConfigSeedProviderParams contains all the parameters to send to the API endpoint +for the find config seed provider operation typically these are written to a http.Request +*/ +type FindConfigSeedProviderParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config seed provider params +func (o *FindConfigSeedProviderParams) WithTimeout(timeout time.Duration) *FindConfigSeedProviderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config seed provider params +func (o *FindConfigSeedProviderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config seed provider params +func (o *FindConfigSeedProviderParams) WithContext(ctx context.Context) *FindConfigSeedProviderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config seed provider params +func (o *FindConfigSeedProviderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config seed provider params +func (o *FindConfigSeedProviderParams) WithHTTPClient(client *http.Client) *FindConfigSeedProviderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config seed provider params +func (o *FindConfigSeedProviderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigSeedProviderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_seed_provider_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_seed_provider_responses.go new file mode 100644 index 0000000000..a7b4e976e9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_seed_provider_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigSeedProviderReader is a Reader for the FindConfigSeedProvider structure. +type FindConfigSeedProviderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigSeedProviderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigSeedProviderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigSeedProviderDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigSeedProviderOK creates a FindConfigSeedProviderOK with default headers values +func NewFindConfigSeedProviderOK() *FindConfigSeedProviderOK { + return &FindConfigSeedProviderOK{} +} + +/* +FindConfigSeedProviderOK handles this case with default header values. + +Config value +*/ +type FindConfigSeedProviderOK struct { + Payload []string +} + +func (o *FindConfigSeedProviderOK) GetPayload() []string { + return o.Payload +} + +func (o *FindConfigSeedProviderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigSeedProviderDefault creates a FindConfigSeedProviderDefault with default headers values +func NewFindConfigSeedProviderDefault(code int) *FindConfigSeedProviderDefault { + return &FindConfigSeedProviderDefault{ + _statusCode: code, + } +} + +/* +FindConfigSeedProviderDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigSeedProviderDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config seed provider default response +func (o *FindConfigSeedProviderDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigSeedProviderDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigSeedProviderDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigSeedProviderDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_server_encryption_options_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_server_encryption_options_parameters.go new file mode 100644 index 0000000000..5104649929 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_server_encryption_options_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigServerEncryptionOptionsParams creates a new FindConfigServerEncryptionOptionsParams object +// with the default values initialized. +func NewFindConfigServerEncryptionOptionsParams() *FindConfigServerEncryptionOptionsParams { + + return &FindConfigServerEncryptionOptionsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigServerEncryptionOptionsParamsWithTimeout creates a new FindConfigServerEncryptionOptionsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigServerEncryptionOptionsParamsWithTimeout(timeout time.Duration) *FindConfigServerEncryptionOptionsParams { + + return &FindConfigServerEncryptionOptionsParams{ + + timeout: timeout, + } +} + +// NewFindConfigServerEncryptionOptionsParamsWithContext creates a new FindConfigServerEncryptionOptionsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigServerEncryptionOptionsParamsWithContext(ctx context.Context) *FindConfigServerEncryptionOptionsParams { + + return &FindConfigServerEncryptionOptionsParams{ + + Context: ctx, + } +} + +// NewFindConfigServerEncryptionOptionsParamsWithHTTPClient creates a new FindConfigServerEncryptionOptionsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigServerEncryptionOptionsParamsWithHTTPClient(client *http.Client) *FindConfigServerEncryptionOptionsParams { + + return &FindConfigServerEncryptionOptionsParams{ + HTTPClient: client, + } +} + +/* +FindConfigServerEncryptionOptionsParams contains all the parameters to send to the API endpoint +for the find config server encryption options operation typically these are written to a http.Request +*/ +type FindConfigServerEncryptionOptionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config server encryption options params +func (o *FindConfigServerEncryptionOptionsParams) WithTimeout(timeout time.Duration) *FindConfigServerEncryptionOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config server encryption options params +func (o *FindConfigServerEncryptionOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config server encryption options params +func (o *FindConfigServerEncryptionOptionsParams) WithContext(ctx context.Context) *FindConfigServerEncryptionOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config server encryption options params +func (o *FindConfigServerEncryptionOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config server encryption options params +func (o *FindConfigServerEncryptionOptionsParams) WithHTTPClient(client *http.Client) *FindConfigServerEncryptionOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config server encryption options params +func (o *FindConfigServerEncryptionOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigServerEncryptionOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_server_encryption_options_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_server_encryption_options_responses.go new file mode 100644 index 0000000000..4e3022be84 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_server_encryption_options_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigServerEncryptionOptionsReader is a Reader for the FindConfigServerEncryptionOptions structure. +type FindConfigServerEncryptionOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigServerEncryptionOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigServerEncryptionOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigServerEncryptionOptionsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigServerEncryptionOptionsOK creates a FindConfigServerEncryptionOptionsOK with default headers values +func NewFindConfigServerEncryptionOptionsOK() *FindConfigServerEncryptionOptionsOK { + return &FindConfigServerEncryptionOptionsOK{} +} + +/* +FindConfigServerEncryptionOptionsOK handles this case with default header values. + +Config value +*/ +type FindConfigServerEncryptionOptionsOK struct { + Payload []string +} + +func (o *FindConfigServerEncryptionOptionsOK) GetPayload() []string { + return o.Payload +} + +func (o *FindConfigServerEncryptionOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigServerEncryptionOptionsDefault creates a FindConfigServerEncryptionOptionsDefault with default headers values +func NewFindConfigServerEncryptionOptionsDefault(code int) *FindConfigServerEncryptionOptionsDefault { + return &FindConfigServerEncryptionOptionsDefault{ + _statusCode: code, + } +} + +/* +FindConfigServerEncryptionOptionsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigServerEncryptionOptionsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config server encryption options default response +func (o *FindConfigServerEncryptionOptionsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigServerEncryptionOptionsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigServerEncryptionOptionsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigServerEncryptionOptionsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_shadow_round_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_shadow_round_ms_parameters.go new file mode 100644 index 0000000000..d586771044 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_shadow_round_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigShadowRoundMsParams creates a new FindConfigShadowRoundMsParams object +// with the default values initialized. +func NewFindConfigShadowRoundMsParams() *FindConfigShadowRoundMsParams { + + return &FindConfigShadowRoundMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigShadowRoundMsParamsWithTimeout creates a new FindConfigShadowRoundMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigShadowRoundMsParamsWithTimeout(timeout time.Duration) *FindConfigShadowRoundMsParams { + + return &FindConfigShadowRoundMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigShadowRoundMsParamsWithContext creates a new FindConfigShadowRoundMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigShadowRoundMsParamsWithContext(ctx context.Context) *FindConfigShadowRoundMsParams { + + return &FindConfigShadowRoundMsParams{ + + Context: ctx, + } +} + +// NewFindConfigShadowRoundMsParamsWithHTTPClient creates a new FindConfigShadowRoundMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigShadowRoundMsParamsWithHTTPClient(client *http.Client) *FindConfigShadowRoundMsParams { + + return &FindConfigShadowRoundMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigShadowRoundMsParams contains all the parameters to send to the API endpoint +for the find config shadow round ms operation typically these are written to a http.Request +*/ +type FindConfigShadowRoundMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config shadow round ms params +func (o *FindConfigShadowRoundMsParams) WithTimeout(timeout time.Duration) *FindConfigShadowRoundMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config shadow round ms params +func (o *FindConfigShadowRoundMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config shadow round ms params +func (o *FindConfigShadowRoundMsParams) WithContext(ctx context.Context) *FindConfigShadowRoundMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config shadow round ms params +func (o *FindConfigShadowRoundMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config shadow round ms params +func (o *FindConfigShadowRoundMsParams) WithHTTPClient(client *http.Client) *FindConfigShadowRoundMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config shadow round ms params +func (o *FindConfigShadowRoundMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigShadowRoundMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_shadow_round_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_shadow_round_ms_responses.go new file mode 100644 index 0000000000..92a4613c26 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_shadow_round_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigShadowRoundMsReader is a Reader for the FindConfigShadowRoundMs structure. +type FindConfigShadowRoundMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigShadowRoundMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigShadowRoundMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigShadowRoundMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigShadowRoundMsOK creates a FindConfigShadowRoundMsOK with default headers values +func NewFindConfigShadowRoundMsOK() *FindConfigShadowRoundMsOK { + return &FindConfigShadowRoundMsOK{} +} + +/* +FindConfigShadowRoundMsOK handles this case with default header values. + +Config value +*/ +type FindConfigShadowRoundMsOK struct { + Payload int64 +} + +func (o *FindConfigShadowRoundMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigShadowRoundMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigShadowRoundMsDefault creates a FindConfigShadowRoundMsDefault with default headers values +func NewFindConfigShadowRoundMsDefault(code int) *FindConfigShadowRoundMsDefault { + return &FindConfigShadowRoundMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigShadowRoundMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigShadowRoundMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config shadow round ms default response +func (o *FindConfigShadowRoundMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigShadowRoundMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigShadowRoundMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigShadowRoundMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_shutdown_announce_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_shutdown_announce_in_ms_parameters.go new file mode 100644 index 0000000000..510f7a41b9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_shutdown_announce_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigShutdownAnnounceInMsParams creates a new FindConfigShutdownAnnounceInMsParams object +// with the default values initialized. +func NewFindConfigShutdownAnnounceInMsParams() *FindConfigShutdownAnnounceInMsParams { + + return &FindConfigShutdownAnnounceInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigShutdownAnnounceInMsParamsWithTimeout creates a new FindConfigShutdownAnnounceInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigShutdownAnnounceInMsParamsWithTimeout(timeout time.Duration) *FindConfigShutdownAnnounceInMsParams { + + return &FindConfigShutdownAnnounceInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigShutdownAnnounceInMsParamsWithContext creates a new FindConfigShutdownAnnounceInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigShutdownAnnounceInMsParamsWithContext(ctx context.Context) *FindConfigShutdownAnnounceInMsParams { + + return &FindConfigShutdownAnnounceInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigShutdownAnnounceInMsParamsWithHTTPClient creates a new FindConfigShutdownAnnounceInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigShutdownAnnounceInMsParamsWithHTTPClient(client *http.Client) *FindConfigShutdownAnnounceInMsParams { + + return &FindConfigShutdownAnnounceInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigShutdownAnnounceInMsParams contains all the parameters to send to the API endpoint +for the find config shutdown announce in ms operation typically these are written to a http.Request +*/ +type FindConfigShutdownAnnounceInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config shutdown announce in ms params +func (o *FindConfigShutdownAnnounceInMsParams) WithTimeout(timeout time.Duration) *FindConfigShutdownAnnounceInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config shutdown announce in ms params +func (o *FindConfigShutdownAnnounceInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config shutdown announce in ms params +func (o *FindConfigShutdownAnnounceInMsParams) WithContext(ctx context.Context) *FindConfigShutdownAnnounceInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config shutdown announce in ms params +func (o *FindConfigShutdownAnnounceInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config shutdown announce in ms params +func (o *FindConfigShutdownAnnounceInMsParams) WithHTTPClient(client *http.Client) *FindConfigShutdownAnnounceInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config shutdown announce in ms params +func (o *FindConfigShutdownAnnounceInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigShutdownAnnounceInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_shutdown_announce_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_shutdown_announce_in_ms_responses.go new file mode 100644 index 0000000000..ff29c8dfb4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_shutdown_announce_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigShutdownAnnounceInMsReader is a Reader for the FindConfigShutdownAnnounceInMs structure. +type FindConfigShutdownAnnounceInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigShutdownAnnounceInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigShutdownAnnounceInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigShutdownAnnounceInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigShutdownAnnounceInMsOK creates a FindConfigShutdownAnnounceInMsOK with default headers values +func NewFindConfigShutdownAnnounceInMsOK() *FindConfigShutdownAnnounceInMsOK { + return &FindConfigShutdownAnnounceInMsOK{} +} + +/* +FindConfigShutdownAnnounceInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigShutdownAnnounceInMsOK struct { + Payload int64 +} + +func (o *FindConfigShutdownAnnounceInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigShutdownAnnounceInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigShutdownAnnounceInMsDefault creates a FindConfigShutdownAnnounceInMsDefault with default headers values +func NewFindConfigShutdownAnnounceInMsDefault(code int) *FindConfigShutdownAnnounceInMsDefault { + return &FindConfigShutdownAnnounceInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigShutdownAnnounceInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigShutdownAnnounceInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config shutdown announce in ms default response +func (o *FindConfigShutdownAnnounceInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigShutdownAnnounceInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigShutdownAnnounceInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigShutdownAnnounceInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_skip_wait_for_gossip_to_settle_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_skip_wait_for_gossip_to_settle_parameters.go new file mode 100644 index 0000000000..cc8f4aee9d --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_skip_wait_for_gossip_to_settle_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigSkipWaitForGossipToSettleParams creates a new FindConfigSkipWaitForGossipToSettleParams object +// with the default values initialized. +func NewFindConfigSkipWaitForGossipToSettleParams() *FindConfigSkipWaitForGossipToSettleParams { + + return &FindConfigSkipWaitForGossipToSettleParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigSkipWaitForGossipToSettleParamsWithTimeout creates a new FindConfigSkipWaitForGossipToSettleParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigSkipWaitForGossipToSettleParamsWithTimeout(timeout time.Duration) *FindConfigSkipWaitForGossipToSettleParams { + + return &FindConfigSkipWaitForGossipToSettleParams{ + + timeout: timeout, + } +} + +// NewFindConfigSkipWaitForGossipToSettleParamsWithContext creates a new FindConfigSkipWaitForGossipToSettleParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigSkipWaitForGossipToSettleParamsWithContext(ctx context.Context) *FindConfigSkipWaitForGossipToSettleParams { + + return &FindConfigSkipWaitForGossipToSettleParams{ + + Context: ctx, + } +} + +// NewFindConfigSkipWaitForGossipToSettleParamsWithHTTPClient creates a new FindConfigSkipWaitForGossipToSettleParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigSkipWaitForGossipToSettleParamsWithHTTPClient(client *http.Client) *FindConfigSkipWaitForGossipToSettleParams { + + return &FindConfigSkipWaitForGossipToSettleParams{ + HTTPClient: client, + } +} + +/* +FindConfigSkipWaitForGossipToSettleParams contains all the parameters to send to the API endpoint +for the find config skip wait for gossip to settle operation typically these are written to a http.Request +*/ +type FindConfigSkipWaitForGossipToSettleParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config skip wait for gossip to settle params +func (o *FindConfigSkipWaitForGossipToSettleParams) WithTimeout(timeout time.Duration) *FindConfigSkipWaitForGossipToSettleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config skip wait for gossip to settle params +func (o *FindConfigSkipWaitForGossipToSettleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config skip wait for gossip to settle params +func (o *FindConfigSkipWaitForGossipToSettleParams) WithContext(ctx context.Context) *FindConfigSkipWaitForGossipToSettleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config skip wait for gossip to settle params +func (o *FindConfigSkipWaitForGossipToSettleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config skip wait for gossip to settle params +func (o *FindConfigSkipWaitForGossipToSettleParams) WithHTTPClient(client *http.Client) *FindConfigSkipWaitForGossipToSettleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config skip wait for gossip to settle params +func (o *FindConfigSkipWaitForGossipToSettleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigSkipWaitForGossipToSettleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_skip_wait_for_gossip_to_settle_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_skip_wait_for_gossip_to_settle_responses.go new file mode 100644 index 0000000000..693ee3d918 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_skip_wait_for_gossip_to_settle_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigSkipWaitForGossipToSettleReader is a Reader for the FindConfigSkipWaitForGossipToSettle structure. +type FindConfigSkipWaitForGossipToSettleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigSkipWaitForGossipToSettleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigSkipWaitForGossipToSettleOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigSkipWaitForGossipToSettleDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigSkipWaitForGossipToSettleOK creates a FindConfigSkipWaitForGossipToSettleOK with default headers values +func NewFindConfigSkipWaitForGossipToSettleOK() *FindConfigSkipWaitForGossipToSettleOK { + return &FindConfigSkipWaitForGossipToSettleOK{} +} + +/* +FindConfigSkipWaitForGossipToSettleOK handles this case with default header values. + +Config value +*/ +type FindConfigSkipWaitForGossipToSettleOK struct { + Payload int64 +} + +func (o *FindConfigSkipWaitForGossipToSettleOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigSkipWaitForGossipToSettleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigSkipWaitForGossipToSettleDefault creates a FindConfigSkipWaitForGossipToSettleDefault with default headers values +func NewFindConfigSkipWaitForGossipToSettleDefault(code int) *FindConfigSkipWaitForGossipToSettleDefault { + return &FindConfigSkipWaitForGossipToSettleDefault{ + _statusCode: code, + } +} + +/* +FindConfigSkipWaitForGossipToSettleDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigSkipWaitForGossipToSettleDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config skip wait for gossip to settle default response +func (o *FindConfigSkipWaitForGossipToSettleDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigSkipWaitForGossipToSettleDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigSkipWaitForGossipToSettleDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigSkipWaitForGossipToSettleDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_snapshot_before_compaction_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_snapshot_before_compaction_parameters.go new file mode 100644 index 0000000000..131e68cd58 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_snapshot_before_compaction_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigSnapshotBeforeCompactionParams creates a new FindConfigSnapshotBeforeCompactionParams object +// with the default values initialized. +func NewFindConfigSnapshotBeforeCompactionParams() *FindConfigSnapshotBeforeCompactionParams { + + return &FindConfigSnapshotBeforeCompactionParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigSnapshotBeforeCompactionParamsWithTimeout creates a new FindConfigSnapshotBeforeCompactionParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigSnapshotBeforeCompactionParamsWithTimeout(timeout time.Duration) *FindConfigSnapshotBeforeCompactionParams { + + return &FindConfigSnapshotBeforeCompactionParams{ + + timeout: timeout, + } +} + +// NewFindConfigSnapshotBeforeCompactionParamsWithContext creates a new FindConfigSnapshotBeforeCompactionParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigSnapshotBeforeCompactionParamsWithContext(ctx context.Context) *FindConfigSnapshotBeforeCompactionParams { + + return &FindConfigSnapshotBeforeCompactionParams{ + + Context: ctx, + } +} + +// NewFindConfigSnapshotBeforeCompactionParamsWithHTTPClient creates a new FindConfigSnapshotBeforeCompactionParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigSnapshotBeforeCompactionParamsWithHTTPClient(client *http.Client) *FindConfigSnapshotBeforeCompactionParams { + + return &FindConfigSnapshotBeforeCompactionParams{ + HTTPClient: client, + } +} + +/* +FindConfigSnapshotBeforeCompactionParams contains all the parameters to send to the API endpoint +for the find config snapshot before compaction operation typically these are written to a http.Request +*/ +type FindConfigSnapshotBeforeCompactionParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config snapshot before compaction params +func (o *FindConfigSnapshotBeforeCompactionParams) WithTimeout(timeout time.Duration) *FindConfigSnapshotBeforeCompactionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config snapshot before compaction params +func (o *FindConfigSnapshotBeforeCompactionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config snapshot before compaction params +func (o *FindConfigSnapshotBeforeCompactionParams) WithContext(ctx context.Context) *FindConfigSnapshotBeforeCompactionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config snapshot before compaction params +func (o *FindConfigSnapshotBeforeCompactionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config snapshot before compaction params +func (o *FindConfigSnapshotBeforeCompactionParams) WithHTTPClient(client *http.Client) *FindConfigSnapshotBeforeCompactionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config snapshot before compaction params +func (o *FindConfigSnapshotBeforeCompactionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigSnapshotBeforeCompactionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_snapshot_before_compaction_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_snapshot_before_compaction_responses.go new file mode 100644 index 0000000000..8dfb4584cf --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_snapshot_before_compaction_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigSnapshotBeforeCompactionReader is a Reader for the FindConfigSnapshotBeforeCompaction structure. +type FindConfigSnapshotBeforeCompactionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigSnapshotBeforeCompactionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigSnapshotBeforeCompactionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigSnapshotBeforeCompactionDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigSnapshotBeforeCompactionOK creates a FindConfigSnapshotBeforeCompactionOK with default headers values +func NewFindConfigSnapshotBeforeCompactionOK() *FindConfigSnapshotBeforeCompactionOK { + return &FindConfigSnapshotBeforeCompactionOK{} +} + +/* +FindConfigSnapshotBeforeCompactionOK handles this case with default header values. + +Config value +*/ +type FindConfigSnapshotBeforeCompactionOK struct { + Payload bool +} + +func (o *FindConfigSnapshotBeforeCompactionOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigSnapshotBeforeCompactionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigSnapshotBeforeCompactionDefault creates a FindConfigSnapshotBeforeCompactionDefault with default headers values +func NewFindConfigSnapshotBeforeCompactionDefault(code int) *FindConfigSnapshotBeforeCompactionDefault { + return &FindConfigSnapshotBeforeCompactionDefault{ + _statusCode: code, + } +} + +/* +FindConfigSnapshotBeforeCompactionDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigSnapshotBeforeCompactionDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config snapshot before compaction default response +func (o *FindConfigSnapshotBeforeCompactionDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigSnapshotBeforeCompactionDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigSnapshotBeforeCompactionDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigSnapshotBeforeCompactionDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_ssl_storage_port_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_ssl_storage_port_parameters.go new file mode 100644 index 0000000000..56e627ceec --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_ssl_storage_port_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigSslStoragePortParams creates a new FindConfigSslStoragePortParams object +// with the default values initialized. +func NewFindConfigSslStoragePortParams() *FindConfigSslStoragePortParams { + + return &FindConfigSslStoragePortParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigSslStoragePortParamsWithTimeout creates a new FindConfigSslStoragePortParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigSslStoragePortParamsWithTimeout(timeout time.Duration) *FindConfigSslStoragePortParams { + + return &FindConfigSslStoragePortParams{ + + timeout: timeout, + } +} + +// NewFindConfigSslStoragePortParamsWithContext creates a new FindConfigSslStoragePortParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigSslStoragePortParamsWithContext(ctx context.Context) *FindConfigSslStoragePortParams { + + return &FindConfigSslStoragePortParams{ + + Context: ctx, + } +} + +// NewFindConfigSslStoragePortParamsWithHTTPClient creates a new FindConfigSslStoragePortParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigSslStoragePortParamsWithHTTPClient(client *http.Client) *FindConfigSslStoragePortParams { + + return &FindConfigSslStoragePortParams{ + HTTPClient: client, + } +} + +/* +FindConfigSslStoragePortParams contains all the parameters to send to the API endpoint +for the find config ssl storage port operation typically these are written to a http.Request +*/ +type FindConfigSslStoragePortParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config ssl storage port params +func (o *FindConfigSslStoragePortParams) WithTimeout(timeout time.Duration) *FindConfigSslStoragePortParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config ssl storage port params +func (o *FindConfigSslStoragePortParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config ssl storage port params +func (o *FindConfigSslStoragePortParams) WithContext(ctx context.Context) *FindConfigSslStoragePortParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config ssl storage port params +func (o *FindConfigSslStoragePortParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config ssl storage port params +func (o *FindConfigSslStoragePortParams) WithHTTPClient(client *http.Client) *FindConfigSslStoragePortParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config ssl storage port params +func (o *FindConfigSslStoragePortParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigSslStoragePortParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_ssl_storage_port_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_ssl_storage_port_responses.go new file mode 100644 index 0000000000..cb5f46028a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_ssl_storage_port_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigSslStoragePortReader is a Reader for the FindConfigSslStoragePort structure. +type FindConfigSslStoragePortReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigSslStoragePortReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigSslStoragePortOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigSslStoragePortDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigSslStoragePortOK creates a FindConfigSslStoragePortOK with default headers values +func NewFindConfigSslStoragePortOK() *FindConfigSslStoragePortOK { + return &FindConfigSslStoragePortOK{} +} + +/* +FindConfigSslStoragePortOK handles this case with default header values. + +Config value +*/ +type FindConfigSslStoragePortOK struct { + Payload int64 +} + +func (o *FindConfigSslStoragePortOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigSslStoragePortOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigSslStoragePortDefault creates a FindConfigSslStoragePortDefault with default headers values +func NewFindConfigSslStoragePortDefault(code int) *FindConfigSslStoragePortDefault { + return &FindConfigSslStoragePortDefault{ + _statusCode: code, + } +} + +/* +FindConfigSslStoragePortDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigSslStoragePortDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config ssl storage port default response +func (o *FindConfigSslStoragePortDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigSslStoragePortDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigSslStoragePortDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigSslStoragePortDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_sstable_preemptive_open_interval_in_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_sstable_preemptive_open_interval_in_mb_parameters.go new file mode 100644 index 0000000000..f37b91eafa --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_sstable_preemptive_open_interval_in_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigSstablePreemptiveOpenIntervalInMbParams creates a new FindConfigSstablePreemptiveOpenIntervalInMbParams object +// with the default values initialized. +func NewFindConfigSstablePreemptiveOpenIntervalInMbParams() *FindConfigSstablePreemptiveOpenIntervalInMbParams { + + return &FindConfigSstablePreemptiveOpenIntervalInMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigSstablePreemptiveOpenIntervalInMbParamsWithTimeout creates a new FindConfigSstablePreemptiveOpenIntervalInMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigSstablePreemptiveOpenIntervalInMbParamsWithTimeout(timeout time.Duration) *FindConfigSstablePreemptiveOpenIntervalInMbParams { + + return &FindConfigSstablePreemptiveOpenIntervalInMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigSstablePreemptiveOpenIntervalInMbParamsWithContext creates a new FindConfigSstablePreemptiveOpenIntervalInMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigSstablePreemptiveOpenIntervalInMbParamsWithContext(ctx context.Context) *FindConfigSstablePreemptiveOpenIntervalInMbParams { + + return &FindConfigSstablePreemptiveOpenIntervalInMbParams{ + + Context: ctx, + } +} + +// NewFindConfigSstablePreemptiveOpenIntervalInMbParamsWithHTTPClient creates a new FindConfigSstablePreemptiveOpenIntervalInMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigSstablePreemptiveOpenIntervalInMbParamsWithHTTPClient(client *http.Client) *FindConfigSstablePreemptiveOpenIntervalInMbParams { + + return &FindConfigSstablePreemptiveOpenIntervalInMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigSstablePreemptiveOpenIntervalInMbParams contains all the parameters to send to the API endpoint +for the find config sstable preemptive open interval in mb operation typically these are written to a http.Request +*/ +type FindConfigSstablePreemptiveOpenIntervalInMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config sstable preemptive open interval in mb params +func (o *FindConfigSstablePreemptiveOpenIntervalInMbParams) WithTimeout(timeout time.Duration) *FindConfigSstablePreemptiveOpenIntervalInMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config sstable preemptive open interval in mb params +func (o *FindConfigSstablePreemptiveOpenIntervalInMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config sstable preemptive open interval in mb params +func (o *FindConfigSstablePreemptiveOpenIntervalInMbParams) WithContext(ctx context.Context) *FindConfigSstablePreemptiveOpenIntervalInMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config sstable preemptive open interval in mb params +func (o *FindConfigSstablePreemptiveOpenIntervalInMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config sstable preemptive open interval in mb params +func (o *FindConfigSstablePreemptiveOpenIntervalInMbParams) WithHTTPClient(client *http.Client) *FindConfigSstablePreemptiveOpenIntervalInMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config sstable preemptive open interval in mb params +func (o *FindConfigSstablePreemptiveOpenIntervalInMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigSstablePreemptiveOpenIntervalInMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_sstable_preemptive_open_interval_in_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_sstable_preemptive_open_interval_in_mb_responses.go new file mode 100644 index 0000000000..1b4caf8665 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_sstable_preemptive_open_interval_in_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigSstablePreemptiveOpenIntervalInMbReader is a Reader for the FindConfigSstablePreemptiveOpenIntervalInMb structure. +type FindConfigSstablePreemptiveOpenIntervalInMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigSstablePreemptiveOpenIntervalInMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigSstablePreemptiveOpenIntervalInMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigSstablePreemptiveOpenIntervalInMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigSstablePreemptiveOpenIntervalInMbOK creates a FindConfigSstablePreemptiveOpenIntervalInMbOK with default headers values +func NewFindConfigSstablePreemptiveOpenIntervalInMbOK() *FindConfigSstablePreemptiveOpenIntervalInMbOK { + return &FindConfigSstablePreemptiveOpenIntervalInMbOK{} +} + +/* +FindConfigSstablePreemptiveOpenIntervalInMbOK handles this case with default header values. + +Config value +*/ +type FindConfigSstablePreemptiveOpenIntervalInMbOK struct { + Payload int64 +} + +func (o *FindConfigSstablePreemptiveOpenIntervalInMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigSstablePreemptiveOpenIntervalInMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigSstablePreemptiveOpenIntervalInMbDefault creates a FindConfigSstablePreemptiveOpenIntervalInMbDefault with default headers values +func NewFindConfigSstablePreemptiveOpenIntervalInMbDefault(code int) *FindConfigSstablePreemptiveOpenIntervalInMbDefault { + return &FindConfigSstablePreemptiveOpenIntervalInMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigSstablePreemptiveOpenIntervalInMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigSstablePreemptiveOpenIntervalInMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config sstable preemptive open interval in mb default response +func (o *FindConfigSstablePreemptiveOpenIntervalInMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigSstablePreemptiveOpenIntervalInMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigSstablePreemptiveOpenIntervalInMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigSstablePreemptiveOpenIntervalInMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_sstable_summary_ratio_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_sstable_summary_ratio_parameters.go new file mode 100644 index 0000000000..4d5b9333d3 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_sstable_summary_ratio_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigSstableSummaryRatioParams creates a new FindConfigSstableSummaryRatioParams object +// with the default values initialized. +func NewFindConfigSstableSummaryRatioParams() *FindConfigSstableSummaryRatioParams { + + return &FindConfigSstableSummaryRatioParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigSstableSummaryRatioParamsWithTimeout creates a new FindConfigSstableSummaryRatioParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigSstableSummaryRatioParamsWithTimeout(timeout time.Duration) *FindConfigSstableSummaryRatioParams { + + return &FindConfigSstableSummaryRatioParams{ + + timeout: timeout, + } +} + +// NewFindConfigSstableSummaryRatioParamsWithContext creates a new FindConfigSstableSummaryRatioParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigSstableSummaryRatioParamsWithContext(ctx context.Context) *FindConfigSstableSummaryRatioParams { + + return &FindConfigSstableSummaryRatioParams{ + + Context: ctx, + } +} + +// NewFindConfigSstableSummaryRatioParamsWithHTTPClient creates a new FindConfigSstableSummaryRatioParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigSstableSummaryRatioParamsWithHTTPClient(client *http.Client) *FindConfigSstableSummaryRatioParams { + + return &FindConfigSstableSummaryRatioParams{ + HTTPClient: client, + } +} + +/* +FindConfigSstableSummaryRatioParams contains all the parameters to send to the API endpoint +for the find config sstable summary ratio operation typically these are written to a http.Request +*/ +type FindConfigSstableSummaryRatioParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config sstable summary ratio params +func (o *FindConfigSstableSummaryRatioParams) WithTimeout(timeout time.Duration) *FindConfigSstableSummaryRatioParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config sstable summary ratio params +func (o *FindConfigSstableSummaryRatioParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config sstable summary ratio params +func (o *FindConfigSstableSummaryRatioParams) WithContext(ctx context.Context) *FindConfigSstableSummaryRatioParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config sstable summary ratio params +func (o *FindConfigSstableSummaryRatioParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config sstable summary ratio params +func (o *FindConfigSstableSummaryRatioParams) WithHTTPClient(client *http.Client) *FindConfigSstableSummaryRatioParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config sstable summary ratio params +func (o *FindConfigSstableSummaryRatioParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigSstableSummaryRatioParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_sstable_summary_ratio_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_sstable_summary_ratio_responses.go new file mode 100644 index 0000000000..07bbad6155 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_sstable_summary_ratio_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigSstableSummaryRatioReader is a Reader for the FindConfigSstableSummaryRatio structure. +type FindConfigSstableSummaryRatioReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigSstableSummaryRatioReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigSstableSummaryRatioOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigSstableSummaryRatioDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigSstableSummaryRatioOK creates a FindConfigSstableSummaryRatioOK with default headers values +func NewFindConfigSstableSummaryRatioOK() *FindConfigSstableSummaryRatioOK { + return &FindConfigSstableSummaryRatioOK{} +} + +/* +FindConfigSstableSummaryRatioOK handles this case with default header values. + +Config value +*/ +type FindConfigSstableSummaryRatioOK struct { + Payload float64 +} + +func (o *FindConfigSstableSummaryRatioOK) GetPayload() float64 { + return o.Payload +} + +func (o *FindConfigSstableSummaryRatioOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigSstableSummaryRatioDefault creates a FindConfigSstableSummaryRatioDefault with default headers values +func NewFindConfigSstableSummaryRatioDefault(code int) *FindConfigSstableSummaryRatioDefault { + return &FindConfigSstableSummaryRatioDefault{ + _statusCode: code, + } +} + +/* +FindConfigSstableSummaryRatioDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigSstableSummaryRatioDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config sstable summary ratio default response +func (o *FindConfigSstableSummaryRatioDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigSstableSummaryRatioDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigSstableSummaryRatioDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigSstableSummaryRatioDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_start_native_transport_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_start_native_transport_parameters.go new file mode 100644 index 0000000000..4132b7ac1b --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_start_native_transport_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigStartNativeTransportParams creates a new FindConfigStartNativeTransportParams object +// with the default values initialized. +func NewFindConfigStartNativeTransportParams() *FindConfigStartNativeTransportParams { + + return &FindConfigStartNativeTransportParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigStartNativeTransportParamsWithTimeout creates a new FindConfigStartNativeTransportParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigStartNativeTransportParamsWithTimeout(timeout time.Duration) *FindConfigStartNativeTransportParams { + + return &FindConfigStartNativeTransportParams{ + + timeout: timeout, + } +} + +// NewFindConfigStartNativeTransportParamsWithContext creates a new FindConfigStartNativeTransportParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigStartNativeTransportParamsWithContext(ctx context.Context) *FindConfigStartNativeTransportParams { + + return &FindConfigStartNativeTransportParams{ + + Context: ctx, + } +} + +// NewFindConfigStartNativeTransportParamsWithHTTPClient creates a new FindConfigStartNativeTransportParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigStartNativeTransportParamsWithHTTPClient(client *http.Client) *FindConfigStartNativeTransportParams { + + return &FindConfigStartNativeTransportParams{ + HTTPClient: client, + } +} + +/* +FindConfigStartNativeTransportParams contains all the parameters to send to the API endpoint +for the find config start native transport operation typically these are written to a http.Request +*/ +type FindConfigStartNativeTransportParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config start native transport params +func (o *FindConfigStartNativeTransportParams) WithTimeout(timeout time.Duration) *FindConfigStartNativeTransportParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config start native transport params +func (o *FindConfigStartNativeTransportParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config start native transport params +func (o *FindConfigStartNativeTransportParams) WithContext(ctx context.Context) *FindConfigStartNativeTransportParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config start native transport params +func (o *FindConfigStartNativeTransportParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config start native transport params +func (o *FindConfigStartNativeTransportParams) WithHTTPClient(client *http.Client) *FindConfigStartNativeTransportParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config start native transport params +func (o *FindConfigStartNativeTransportParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigStartNativeTransportParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_start_native_transport_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_start_native_transport_responses.go new file mode 100644 index 0000000000..ab83805185 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_start_native_transport_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigStartNativeTransportReader is a Reader for the FindConfigStartNativeTransport structure. +type FindConfigStartNativeTransportReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigStartNativeTransportReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigStartNativeTransportOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigStartNativeTransportDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigStartNativeTransportOK creates a FindConfigStartNativeTransportOK with default headers values +func NewFindConfigStartNativeTransportOK() *FindConfigStartNativeTransportOK { + return &FindConfigStartNativeTransportOK{} +} + +/* +FindConfigStartNativeTransportOK handles this case with default header values. + +Config value +*/ +type FindConfigStartNativeTransportOK struct { + Payload bool +} + +func (o *FindConfigStartNativeTransportOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigStartNativeTransportOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigStartNativeTransportDefault creates a FindConfigStartNativeTransportDefault with default headers values +func NewFindConfigStartNativeTransportDefault(code int) *FindConfigStartNativeTransportDefault { + return &FindConfigStartNativeTransportDefault{ + _statusCode: code, + } +} + +/* +FindConfigStartNativeTransportDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigStartNativeTransportDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config start native transport default response +func (o *FindConfigStartNativeTransportDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigStartNativeTransportDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigStartNativeTransportDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigStartNativeTransportDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_start_rpc_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_start_rpc_parameters.go new file mode 100644 index 0000000000..3a429c5dde --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_start_rpc_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigStartRPCParams creates a new FindConfigStartRPCParams object +// with the default values initialized. +func NewFindConfigStartRPCParams() *FindConfigStartRPCParams { + + return &FindConfigStartRPCParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigStartRPCParamsWithTimeout creates a new FindConfigStartRPCParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigStartRPCParamsWithTimeout(timeout time.Duration) *FindConfigStartRPCParams { + + return &FindConfigStartRPCParams{ + + timeout: timeout, + } +} + +// NewFindConfigStartRPCParamsWithContext creates a new FindConfigStartRPCParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigStartRPCParamsWithContext(ctx context.Context) *FindConfigStartRPCParams { + + return &FindConfigStartRPCParams{ + + Context: ctx, + } +} + +// NewFindConfigStartRPCParamsWithHTTPClient creates a new FindConfigStartRPCParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigStartRPCParamsWithHTTPClient(client *http.Client) *FindConfigStartRPCParams { + + return &FindConfigStartRPCParams{ + HTTPClient: client, + } +} + +/* +FindConfigStartRPCParams contains all the parameters to send to the API endpoint +for the find config start rpc operation typically these are written to a http.Request +*/ +type FindConfigStartRPCParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config start rpc params +func (o *FindConfigStartRPCParams) WithTimeout(timeout time.Duration) *FindConfigStartRPCParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config start rpc params +func (o *FindConfigStartRPCParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config start rpc params +func (o *FindConfigStartRPCParams) WithContext(ctx context.Context) *FindConfigStartRPCParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config start rpc params +func (o *FindConfigStartRPCParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config start rpc params +func (o *FindConfigStartRPCParams) WithHTTPClient(client *http.Client) *FindConfigStartRPCParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config start rpc params +func (o *FindConfigStartRPCParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigStartRPCParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_start_rpc_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_start_rpc_responses.go new file mode 100644 index 0000000000..7b41284a6a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_start_rpc_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigStartRPCReader is a Reader for the FindConfigStartRPC structure. +type FindConfigStartRPCReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigStartRPCReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigStartRPCOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigStartRPCDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigStartRPCOK creates a FindConfigStartRPCOK with default headers values +func NewFindConfigStartRPCOK() *FindConfigStartRPCOK { + return &FindConfigStartRPCOK{} +} + +/* +FindConfigStartRPCOK handles this case with default header values. + +Config value +*/ +type FindConfigStartRPCOK struct { + Payload bool +} + +func (o *FindConfigStartRPCOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigStartRPCOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigStartRPCDefault creates a FindConfigStartRPCDefault with default headers values +func NewFindConfigStartRPCDefault(code int) *FindConfigStartRPCDefault { + return &FindConfigStartRPCDefault{ + _statusCode: code, + } +} + +/* +FindConfigStartRPCDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigStartRPCDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config start rpc default response +func (o *FindConfigStartRPCDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigStartRPCDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigStartRPCDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigStartRPCDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_storage_port_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_storage_port_parameters.go new file mode 100644 index 0000000000..657d628929 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_storage_port_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigStoragePortParams creates a new FindConfigStoragePortParams object +// with the default values initialized. +func NewFindConfigStoragePortParams() *FindConfigStoragePortParams { + + return &FindConfigStoragePortParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigStoragePortParamsWithTimeout creates a new FindConfigStoragePortParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigStoragePortParamsWithTimeout(timeout time.Duration) *FindConfigStoragePortParams { + + return &FindConfigStoragePortParams{ + + timeout: timeout, + } +} + +// NewFindConfigStoragePortParamsWithContext creates a new FindConfigStoragePortParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigStoragePortParamsWithContext(ctx context.Context) *FindConfigStoragePortParams { + + return &FindConfigStoragePortParams{ + + Context: ctx, + } +} + +// NewFindConfigStoragePortParamsWithHTTPClient creates a new FindConfigStoragePortParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigStoragePortParamsWithHTTPClient(client *http.Client) *FindConfigStoragePortParams { + + return &FindConfigStoragePortParams{ + HTTPClient: client, + } +} + +/* +FindConfigStoragePortParams contains all the parameters to send to the API endpoint +for the find config storage port operation typically these are written to a http.Request +*/ +type FindConfigStoragePortParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config storage port params +func (o *FindConfigStoragePortParams) WithTimeout(timeout time.Duration) *FindConfigStoragePortParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config storage port params +func (o *FindConfigStoragePortParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config storage port params +func (o *FindConfigStoragePortParams) WithContext(ctx context.Context) *FindConfigStoragePortParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config storage port params +func (o *FindConfigStoragePortParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config storage port params +func (o *FindConfigStoragePortParams) WithHTTPClient(client *http.Client) *FindConfigStoragePortParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config storage port params +func (o *FindConfigStoragePortParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigStoragePortParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_storage_port_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_storage_port_responses.go new file mode 100644 index 0000000000..d5802d3d90 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_storage_port_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigStoragePortReader is a Reader for the FindConfigStoragePort structure. +type FindConfigStoragePortReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigStoragePortReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigStoragePortOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigStoragePortDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigStoragePortOK creates a FindConfigStoragePortOK with default headers values +func NewFindConfigStoragePortOK() *FindConfigStoragePortOK { + return &FindConfigStoragePortOK{} +} + +/* +FindConfigStoragePortOK handles this case with default header values. + +Config value +*/ +type FindConfigStoragePortOK struct { + Payload int64 +} + +func (o *FindConfigStoragePortOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigStoragePortOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigStoragePortDefault creates a FindConfigStoragePortDefault with default headers values +func NewFindConfigStoragePortDefault(code int) *FindConfigStoragePortDefault { + return &FindConfigStoragePortDefault{ + _statusCode: code, + } +} + +/* +FindConfigStoragePortDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigStoragePortDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config storage port default response +func (o *FindConfigStoragePortDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigStoragePortDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigStoragePortDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigStoragePortDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_stream_throughput_outbound_megabits_per_sec_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_stream_throughput_outbound_megabits_per_sec_parameters.go new file mode 100644 index 0000000000..c01b2b73ad --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_stream_throughput_outbound_megabits_per_sec_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigStreamThroughputOutboundMegabitsPerSecParams creates a new FindConfigStreamThroughputOutboundMegabitsPerSecParams object +// with the default values initialized. +func NewFindConfigStreamThroughputOutboundMegabitsPerSecParams() *FindConfigStreamThroughputOutboundMegabitsPerSecParams { + + return &FindConfigStreamThroughputOutboundMegabitsPerSecParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigStreamThroughputOutboundMegabitsPerSecParamsWithTimeout creates a new FindConfigStreamThroughputOutboundMegabitsPerSecParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigStreamThroughputOutboundMegabitsPerSecParamsWithTimeout(timeout time.Duration) *FindConfigStreamThroughputOutboundMegabitsPerSecParams { + + return &FindConfigStreamThroughputOutboundMegabitsPerSecParams{ + + timeout: timeout, + } +} + +// NewFindConfigStreamThroughputOutboundMegabitsPerSecParamsWithContext creates a new FindConfigStreamThroughputOutboundMegabitsPerSecParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigStreamThroughputOutboundMegabitsPerSecParamsWithContext(ctx context.Context) *FindConfigStreamThroughputOutboundMegabitsPerSecParams { + + return &FindConfigStreamThroughputOutboundMegabitsPerSecParams{ + + Context: ctx, + } +} + +// NewFindConfigStreamThroughputOutboundMegabitsPerSecParamsWithHTTPClient creates a new FindConfigStreamThroughputOutboundMegabitsPerSecParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigStreamThroughputOutboundMegabitsPerSecParamsWithHTTPClient(client *http.Client) *FindConfigStreamThroughputOutboundMegabitsPerSecParams { + + return &FindConfigStreamThroughputOutboundMegabitsPerSecParams{ + HTTPClient: client, + } +} + +/* +FindConfigStreamThroughputOutboundMegabitsPerSecParams contains all the parameters to send to the API endpoint +for the find config stream throughput outbound megabits per sec operation typically these are written to a http.Request +*/ +type FindConfigStreamThroughputOutboundMegabitsPerSecParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config stream throughput outbound megabits per sec params +func (o *FindConfigStreamThroughputOutboundMegabitsPerSecParams) WithTimeout(timeout time.Duration) *FindConfigStreamThroughputOutboundMegabitsPerSecParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config stream throughput outbound megabits per sec params +func (o *FindConfigStreamThroughputOutboundMegabitsPerSecParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config stream throughput outbound megabits per sec params +func (o *FindConfigStreamThroughputOutboundMegabitsPerSecParams) WithContext(ctx context.Context) *FindConfigStreamThroughputOutboundMegabitsPerSecParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config stream throughput outbound megabits per sec params +func (o *FindConfigStreamThroughputOutboundMegabitsPerSecParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config stream throughput outbound megabits per sec params +func (o *FindConfigStreamThroughputOutboundMegabitsPerSecParams) WithHTTPClient(client *http.Client) *FindConfigStreamThroughputOutboundMegabitsPerSecParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config stream throughput outbound megabits per sec params +func (o *FindConfigStreamThroughputOutboundMegabitsPerSecParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigStreamThroughputOutboundMegabitsPerSecParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_stream_throughput_outbound_megabits_per_sec_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_stream_throughput_outbound_megabits_per_sec_responses.go new file mode 100644 index 0000000000..9cbf6ea4cc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_stream_throughput_outbound_megabits_per_sec_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigStreamThroughputOutboundMegabitsPerSecReader is a Reader for the FindConfigStreamThroughputOutboundMegabitsPerSec structure. +type FindConfigStreamThroughputOutboundMegabitsPerSecReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigStreamThroughputOutboundMegabitsPerSecReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigStreamThroughputOutboundMegabitsPerSecOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigStreamThroughputOutboundMegabitsPerSecDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigStreamThroughputOutboundMegabitsPerSecOK creates a FindConfigStreamThroughputOutboundMegabitsPerSecOK with default headers values +func NewFindConfigStreamThroughputOutboundMegabitsPerSecOK() *FindConfigStreamThroughputOutboundMegabitsPerSecOK { + return &FindConfigStreamThroughputOutboundMegabitsPerSecOK{} +} + +/* +FindConfigStreamThroughputOutboundMegabitsPerSecOK handles this case with default header values. + +Config value +*/ +type FindConfigStreamThroughputOutboundMegabitsPerSecOK struct { + Payload int64 +} + +func (o *FindConfigStreamThroughputOutboundMegabitsPerSecOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigStreamThroughputOutboundMegabitsPerSecOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigStreamThroughputOutboundMegabitsPerSecDefault creates a FindConfigStreamThroughputOutboundMegabitsPerSecDefault with default headers values +func NewFindConfigStreamThroughputOutboundMegabitsPerSecDefault(code int) *FindConfigStreamThroughputOutboundMegabitsPerSecDefault { + return &FindConfigStreamThroughputOutboundMegabitsPerSecDefault{ + _statusCode: code, + } +} + +/* +FindConfigStreamThroughputOutboundMegabitsPerSecDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigStreamThroughputOutboundMegabitsPerSecDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config stream throughput outbound megabits per sec default response +func (o *FindConfigStreamThroughputOutboundMegabitsPerSecDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigStreamThroughputOutboundMegabitsPerSecDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigStreamThroughputOutboundMegabitsPerSecDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigStreamThroughputOutboundMegabitsPerSecDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_streaming_socket_timeout_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_streaming_socket_timeout_in_ms_parameters.go new file mode 100644 index 0000000000..85c3332ba8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_streaming_socket_timeout_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigStreamingSocketTimeoutInMsParams creates a new FindConfigStreamingSocketTimeoutInMsParams object +// with the default values initialized. +func NewFindConfigStreamingSocketTimeoutInMsParams() *FindConfigStreamingSocketTimeoutInMsParams { + + return &FindConfigStreamingSocketTimeoutInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigStreamingSocketTimeoutInMsParamsWithTimeout creates a new FindConfigStreamingSocketTimeoutInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigStreamingSocketTimeoutInMsParamsWithTimeout(timeout time.Duration) *FindConfigStreamingSocketTimeoutInMsParams { + + return &FindConfigStreamingSocketTimeoutInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigStreamingSocketTimeoutInMsParamsWithContext creates a new FindConfigStreamingSocketTimeoutInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigStreamingSocketTimeoutInMsParamsWithContext(ctx context.Context) *FindConfigStreamingSocketTimeoutInMsParams { + + return &FindConfigStreamingSocketTimeoutInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigStreamingSocketTimeoutInMsParamsWithHTTPClient creates a new FindConfigStreamingSocketTimeoutInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigStreamingSocketTimeoutInMsParamsWithHTTPClient(client *http.Client) *FindConfigStreamingSocketTimeoutInMsParams { + + return &FindConfigStreamingSocketTimeoutInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigStreamingSocketTimeoutInMsParams contains all the parameters to send to the API endpoint +for the find config streaming socket timeout in ms operation typically these are written to a http.Request +*/ +type FindConfigStreamingSocketTimeoutInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config streaming socket timeout in ms params +func (o *FindConfigStreamingSocketTimeoutInMsParams) WithTimeout(timeout time.Duration) *FindConfigStreamingSocketTimeoutInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config streaming socket timeout in ms params +func (o *FindConfigStreamingSocketTimeoutInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config streaming socket timeout in ms params +func (o *FindConfigStreamingSocketTimeoutInMsParams) WithContext(ctx context.Context) *FindConfigStreamingSocketTimeoutInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config streaming socket timeout in ms params +func (o *FindConfigStreamingSocketTimeoutInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config streaming socket timeout in ms params +func (o *FindConfigStreamingSocketTimeoutInMsParams) WithHTTPClient(client *http.Client) *FindConfigStreamingSocketTimeoutInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config streaming socket timeout in ms params +func (o *FindConfigStreamingSocketTimeoutInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigStreamingSocketTimeoutInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_streaming_socket_timeout_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_streaming_socket_timeout_in_ms_responses.go new file mode 100644 index 0000000000..ef02996ffa --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_streaming_socket_timeout_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigStreamingSocketTimeoutInMsReader is a Reader for the FindConfigStreamingSocketTimeoutInMs structure. +type FindConfigStreamingSocketTimeoutInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigStreamingSocketTimeoutInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigStreamingSocketTimeoutInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigStreamingSocketTimeoutInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigStreamingSocketTimeoutInMsOK creates a FindConfigStreamingSocketTimeoutInMsOK with default headers values +func NewFindConfigStreamingSocketTimeoutInMsOK() *FindConfigStreamingSocketTimeoutInMsOK { + return &FindConfigStreamingSocketTimeoutInMsOK{} +} + +/* +FindConfigStreamingSocketTimeoutInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigStreamingSocketTimeoutInMsOK struct { + Payload int64 +} + +func (o *FindConfigStreamingSocketTimeoutInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigStreamingSocketTimeoutInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigStreamingSocketTimeoutInMsDefault creates a FindConfigStreamingSocketTimeoutInMsDefault with default headers values +func NewFindConfigStreamingSocketTimeoutInMsDefault(code int) *FindConfigStreamingSocketTimeoutInMsDefault { + return &FindConfigStreamingSocketTimeoutInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigStreamingSocketTimeoutInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigStreamingSocketTimeoutInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config streaming socket timeout in ms default response +func (o *FindConfigStreamingSocketTimeoutInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigStreamingSocketTimeoutInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigStreamingSocketTimeoutInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigStreamingSocketTimeoutInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_thrift_framed_transport_size_in_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_thrift_framed_transport_size_in_mb_parameters.go new file mode 100644 index 0000000000..9d4177a2c1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_thrift_framed_transport_size_in_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigThriftFramedTransportSizeInMbParams creates a new FindConfigThriftFramedTransportSizeInMbParams object +// with the default values initialized. +func NewFindConfigThriftFramedTransportSizeInMbParams() *FindConfigThriftFramedTransportSizeInMbParams { + + return &FindConfigThriftFramedTransportSizeInMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigThriftFramedTransportSizeInMbParamsWithTimeout creates a new FindConfigThriftFramedTransportSizeInMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigThriftFramedTransportSizeInMbParamsWithTimeout(timeout time.Duration) *FindConfigThriftFramedTransportSizeInMbParams { + + return &FindConfigThriftFramedTransportSizeInMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigThriftFramedTransportSizeInMbParamsWithContext creates a new FindConfigThriftFramedTransportSizeInMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigThriftFramedTransportSizeInMbParamsWithContext(ctx context.Context) *FindConfigThriftFramedTransportSizeInMbParams { + + return &FindConfigThriftFramedTransportSizeInMbParams{ + + Context: ctx, + } +} + +// NewFindConfigThriftFramedTransportSizeInMbParamsWithHTTPClient creates a new FindConfigThriftFramedTransportSizeInMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigThriftFramedTransportSizeInMbParamsWithHTTPClient(client *http.Client) *FindConfigThriftFramedTransportSizeInMbParams { + + return &FindConfigThriftFramedTransportSizeInMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigThriftFramedTransportSizeInMbParams contains all the parameters to send to the API endpoint +for the find config thrift framed transport size in mb operation typically these are written to a http.Request +*/ +type FindConfigThriftFramedTransportSizeInMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config thrift framed transport size in mb params +func (o *FindConfigThriftFramedTransportSizeInMbParams) WithTimeout(timeout time.Duration) *FindConfigThriftFramedTransportSizeInMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config thrift framed transport size in mb params +func (o *FindConfigThriftFramedTransportSizeInMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config thrift framed transport size in mb params +func (o *FindConfigThriftFramedTransportSizeInMbParams) WithContext(ctx context.Context) *FindConfigThriftFramedTransportSizeInMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config thrift framed transport size in mb params +func (o *FindConfigThriftFramedTransportSizeInMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config thrift framed transport size in mb params +func (o *FindConfigThriftFramedTransportSizeInMbParams) WithHTTPClient(client *http.Client) *FindConfigThriftFramedTransportSizeInMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config thrift framed transport size in mb params +func (o *FindConfigThriftFramedTransportSizeInMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigThriftFramedTransportSizeInMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_thrift_framed_transport_size_in_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_thrift_framed_transport_size_in_mb_responses.go new file mode 100644 index 0000000000..2ab118da16 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_thrift_framed_transport_size_in_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigThriftFramedTransportSizeInMbReader is a Reader for the FindConfigThriftFramedTransportSizeInMb structure. +type FindConfigThriftFramedTransportSizeInMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigThriftFramedTransportSizeInMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigThriftFramedTransportSizeInMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigThriftFramedTransportSizeInMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigThriftFramedTransportSizeInMbOK creates a FindConfigThriftFramedTransportSizeInMbOK with default headers values +func NewFindConfigThriftFramedTransportSizeInMbOK() *FindConfigThriftFramedTransportSizeInMbOK { + return &FindConfigThriftFramedTransportSizeInMbOK{} +} + +/* +FindConfigThriftFramedTransportSizeInMbOK handles this case with default header values. + +Config value +*/ +type FindConfigThriftFramedTransportSizeInMbOK struct { + Payload int64 +} + +func (o *FindConfigThriftFramedTransportSizeInMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigThriftFramedTransportSizeInMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigThriftFramedTransportSizeInMbDefault creates a FindConfigThriftFramedTransportSizeInMbDefault with default headers values +func NewFindConfigThriftFramedTransportSizeInMbDefault(code int) *FindConfigThriftFramedTransportSizeInMbDefault { + return &FindConfigThriftFramedTransportSizeInMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigThriftFramedTransportSizeInMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigThriftFramedTransportSizeInMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config thrift framed transport size in mb default response +func (o *FindConfigThriftFramedTransportSizeInMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigThriftFramedTransportSizeInMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigThriftFramedTransportSizeInMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigThriftFramedTransportSizeInMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_thrift_max_message_length_in_mb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_thrift_max_message_length_in_mb_parameters.go new file mode 100644 index 0000000000..945fa0fedc --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_thrift_max_message_length_in_mb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigThriftMaxMessageLengthInMbParams creates a new FindConfigThriftMaxMessageLengthInMbParams object +// with the default values initialized. +func NewFindConfigThriftMaxMessageLengthInMbParams() *FindConfigThriftMaxMessageLengthInMbParams { + + return &FindConfigThriftMaxMessageLengthInMbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigThriftMaxMessageLengthInMbParamsWithTimeout creates a new FindConfigThriftMaxMessageLengthInMbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigThriftMaxMessageLengthInMbParamsWithTimeout(timeout time.Duration) *FindConfigThriftMaxMessageLengthInMbParams { + + return &FindConfigThriftMaxMessageLengthInMbParams{ + + timeout: timeout, + } +} + +// NewFindConfigThriftMaxMessageLengthInMbParamsWithContext creates a new FindConfigThriftMaxMessageLengthInMbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigThriftMaxMessageLengthInMbParamsWithContext(ctx context.Context) *FindConfigThriftMaxMessageLengthInMbParams { + + return &FindConfigThriftMaxMessageLengthInMbParams{ + + Context: ctx, + } +} + +// NewFindConfigThriftMaxMessageLengthInMbParamsWithHTTPClient creates a new FindConfigThriftMaxMessageLengthInMbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigThriftMaxMessageLengthInMbParamsWithHTTPClient(client *http.Client) *FindConfigThriftMaxMessageLengthInMbParams { + + return &FindConfigThriftMaxMessageLengthInMbParams{ + HTTPClient: client, + } +} + +/* +FindConfigThriftMaxMessageLengthInMbParams contains all the parameters to send to the API endpoint +for the find config thrift max message length in mb operation typically these are written to a http.Request +*/ +type FindConfigThriftMaxMessageLengthInMbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config thrift max message length in mb params +func (o *FindConfigThriftMaxMessageLengthInMbParams) WithTimeout(timeout time.Duration) *FindConfigThriftMaxMessageLengthInMbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config thrift max message length in mb params +func (o *FindConfigThriftMaxMessageLengthInMbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config thrift max message length in mb params +func (o *FindConfigThriftMaxMessageLengthInMbParams) WithContext(ctx context.Context) *FindConfigThriftMaxMessageLengthInMbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config thrift max message length in mb params +func (o *FindConfigThriftMaxMessageLengthInMbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config thrift max message length in mb params +func (o *FindConfigThriftMaxMessageLengthInMbParams) WithHTTPClient(client *http.Client) *FindConfigThriftMaxMessageLengthInMbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config thrift max message length in mb params +func (o *FindConfigThriftMaxMessageLengthInMbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigThriftMaxMessageLengthInMbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_thrift_max_message_length_in_mb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_thrift_max_message_length_in_mb_responses.go new file mode 100644 index 0000000000..2f0f2f111e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_thrift_max_message_length_in_mb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigThriftMaxMessageLengthInMbReader is a Reader for the FindConfigThriftMaxMessageLengthInMb structure. +type FindConfigThriftMaxMessageLengthInMbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigThriftMaxMessageLengthInMbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigThriftMaxMessageLengthInMbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigThriftMaxMessageLengthInMbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigThriftMaxMessageLengthInMbOK creates a FindConfigThriftMaxMessageLengthInMbOK with default headers values +func NewFindConfigThriftMaxMessageLengthInMbOK() *FindConfigThriftMaxMessageLengthInMbOK { + return &FindConfigThriftMaxMessageLengthInMbOK{} +} + +/* +FindConfigThriftMaxMessageLengthInMbOK handles this case with default header values. + +Config value +*/ +type FindConfigThriftMaxMessageLengthInMbOK struct { + Payload int64 +} + +func (o *FindConfigThriftMaxMessageLengthInMbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigThriftMaxMessageLengthInMbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigThriftMaxMessageLengthInMbDefault creates a FindConfigThriftMaxMessageLengthInMbDefault with default headers values +func NewFindConfigThriftMaxMessageLengthInMbDefault(code int) *FindConfigThriftMaxMessageLengthInMbDefault { + return &FindConfigThriftMaxMessageLengthInMbDefault{ + _statusCode: code, + } +} + +/* +FindConfigThriftMaxMessageLengthInMbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigThriftMaxMessageLengthInMbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config thrift max message length in mb default response +func (o *FindConfigThriftMaxMessageLengthInMbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigThriftMaxMessageLengthInMbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigThriftMaxMessageLengthInMbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigThriftMaxMessageLengthInMbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_tombstone_failure_threshold_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_tombstone_failure_threshold_parameters.go new file mode 100644 index 0000000000..3a61b34a0c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_tombstone_failure_threshold_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigTombstoneFailureThresholdParams creates a new FindConfigTombstoneFailureThresholdParams object +// with the default values initialized. +func NewFindConfigTombstoneFailureThresholdParams() *FindConfigTombstoneFailureThresholdParams { + + return &FindConfigTombstoneFailureThresholdParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigTombstoneFailureThresholdParamsWithTimeout creates a new FindConfigTombstoneFailureThresholdParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigTombstoneFailureThresholdParamsWithTimeout(timeout time.Duration) *FindConfigTombstoneFailureThresholdParams { + + return &FindConfigTombstoneFailureThresholdParams{ + + timeout: timeout, + } +} + +// NewFindConfigTombstoneFailureThresholdParamsWithContext creates a new FindConfigTombstoneFailureThresholdParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigTombstoneFailureThresholdParamsWithContext(ctx context.Context) *FindConfigTombstoneFailureThresholdParams { + + return &FindConfigTombstoneFailureThresholdParams{ + + Context: ctx, + } +} + +// NewFindConfigTombstoneFailureThresholdParamsWithHTTPClient creates a new FindConfigTombstoneFailureThresholdParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigTombstoneFailureThresholdParamsWithHTTPClient(client *http.Client) *FindConfigTombstoneFailureThresholdParams { + + return &FindConfigTombstoneFailureThresholdParams{ + HTTPClient: client, + } +} + +/* +FindConfigTombstoneFailureThresholdParams contains all the parameters to send to the API endpoint +for the find config tombstone failure threshold operation typically these are written to a http.Request +*/ +type FindConfigTombstoneFailureThresholdParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config tombstone failure threshold params +func (o *FindConfigTombstoneFailureThresholdParams) WithTimeout(timeout time.Duration) *FindConfigTombstoneFailureThresholdParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config tombstone failure threshold params +func (o *FindConfigTombstoneFailureThresholdParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config tombstone failure threshold params +func (o *FindConfigTombstoneFailureThresholdParams) WithContext(ctx context.Context) *FindConfigTombstoneFailureThresholdParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config tombstone failure threshold params +func (o *FindConfigTombstoneFailureThresholdParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config tombstone failure threshold params +func (o *FindConfigTombstoneFailureThresholdParams) WithHTTPClient(client *http.Client) *FindConfigTombstoneFailureThresholdParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config tombstone failure threshold params +func (o *FindConfigTombstoneFailureThresholdParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigTombstoneFailureThresholdParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_tombstone_failure_threshold_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_tombstone_failure_threshold_responses.go new file mode 100644 index 0000000000..0213b8fbeb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_tombstone_failure_threshold_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigTombstoneFailureThresholdReader is a Reader for the FindConfigTombstoneFailureThreshold structure. +type FindConfigTombstoneFailureThresholdReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigTombstoneFailureThresholdReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigTombstoneFailureThresholdOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigTombstoneFailureThresholdDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigTombstoneFailureThresholdOK creates a FindConfigTombstoneFailureThresholdOK with default headers values +func NewFindConfigTombstoneFailureThresholdOK() *FindConfigTombstoneFailureThresholdOK { + return &FindConfigTombstoneFailureThresholdOK{} +} + +/* +FindConfigTombstoneFailureThresholdOK handles this case with default header values. + +Config value +*/ +type FindConfigTombstoneFailureThresholdOK struct { + Payload int64 +} + +func (o *FindConfigTombstoneFailureThresholdOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigTombstoneFailureThresholdOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigTombstoneFailureThresholdDefault creates a FindConfigTombstoneFailureThresholdDefault with default headers values +func NewFindConfigTombstoneFailureThresholdDefault(code int) *FindConfigTombstoneFailureThresholdDefault { + return &FindConfigTombstoneFailureThresholdDefault{ + _statusCode: code, + } +} + +/* +FindConfigTombstoneFailureThresholdDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigTombstoneFailureThresholdDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config tombstone failure threshold default response +func (o *FindConfigTombstoneFailureThresholdDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigTombstoneFailureThresholdDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigTombstoneFailureThresholdDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigTombstoneFailureThresholdDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_tombstone_warn_threshold_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_tombstone_warn_threshold_parameters.go new file mode 100644 index 0000000000..31346beb44 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_tombstone_warn_threshold_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigTombstoneWarnThresholdParams creates a new FindConfigTombstoneWarnThresholdParams object +// with the default values initialized. +func NewFindConfigTombstoneWarnThresholdParams() *FindConfigTombstoneWarnThresholdParams { + + return &FindConfigTombstoneWarnThresholdParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigTombstoneWarnThresholdParamsWithTimeout creates a new FindConfigTombstoneWarnThresholdParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigTombstoneWarnThresholdParamsWithTimeout(timeout time.Duration) *FindConfigTombstoneWarnThresholdParams { + + return &FindConfigTombstoneWarnThresholdParams{ + + timeout: timeout, + } +} + +// NewFindConfigTombstoneWarnThresholdParamsWithContext creates a new FindConfigTombstoneWarnThresholdParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigTombstoneWarnThresholdParamsWithContext(ctx context.Context) *FindConfigTombstoneWarnThresholdParams { + + return &FindConfigTombstoneWarnThresholdParams{ + + Context: ctx, + } +} + +// NewFindConfigTombstoneWarnThresholdParamsWithHTTPClient creates a new FindConfigTombstoneWarnThresholdParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigTombstoneWarnThresholdParamsWithHTTPClient(client *http.Client) *FindConfigTombstoneWarnThresholdParams { + + return &FindConfigTombstoneWarnThresholdParams{ + HTTPClient: client, + } +} + +/* +FindConfigTombstoneWarnThresholdParams contains all the parameters to send to the API endpoint +for the find config tombstone warn threshold operation typically these are written to a http.Request +*/ +type FindConfigTombstoneWarnThresholdParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config tombstone warn threshold params +func (o *FindConfigTombstoneWarnThresholdParams) WithTimeout(timeout time.Duration) *FindConfigTombstoneWarnThresholdParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config tombstone warn threshold params +func (o *FindConfigTombstoneWarnThresholdParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config tombstone warn threshold params +func (o *FindConfigTombstoneWarnThresholdParams) WithContext(ctx context.Context) *FindConfigTombstoneWarnThresholdParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config tombstone warn threshold params +func (o *FindConfigTombstoneWarnThresholdParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config tombstone warn threshold params +func (o *FindConfigTombstoneWarnThresholdParams) WithHTTPClient(client *http.Client) *FindConfigTombstoneWarnThresholdParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config tombstone warn threshold params +func (o *FindConfigTombstoneWarnThresholdParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigTombstoneWarnThresholdParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_tombstone_warn_threshold_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_tombstone_warn_threshold_responses.go new file mode 100644 index 0000000000..d0967467d0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_tombstone_warn_threshold_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigTombstoneWarnThresholdReader is a Reader for the FindConfigTombstoneWarnThreshold structure. +type FindConfigTombstoneWarnThresholdReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigTombstoneWarnThresholdReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigTombstoneWarnThresholdOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigTombstoneWarnThresholdDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigTombstoneWarnThresholdOK creates a FindConfigTombstoneWarnThresholdOK with default headers values +func NewFindConfigTombstoneWarnThresholdOK() *FindConfigTombstoneWarnThresholdOK { + return &FindConfigTombstoneWarnThresholdOK{} +} + +/* +FindConfigTombstoneWarnThresholdOK handles this case with default header values. + +Config value +*/ +type FindConfigTombstoneWarnThresholdOK struct { + Payload int64 +} + +func (o *FindConfigTombstoneWarnThresholdOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigTombstoneWarnThresholdOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigTombstoneWarnThresholdDefault creates a FindConfigTombstoneWarnThresholdDefault with default headers values +func NewFindConfigTombstoneWarnThresholdDefault(code int) *FindConfigTombstoneWarnThresholdDefault { + return &FindConfigTombstoneWarnThresholdDefault{ + _statusCode: code, + } +} + +/* +FindConfigTombstoneWarnThresholdDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigTombstoneWarnThresholdDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config tombstone warn threshold default response +func (o *FindConfigTombstoneWarnThresholdDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigTombstoneWarnThresholdDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigTombstoneWarnThresholdDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigTombstoneWarnThresholdDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_trickle_fsync_interval_in_kb_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_trickle_fsync_interval_in_kb_parameters.go new file mode 100644 index 0000000000..b38bce775a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_trickle_fsync_interval_in_kb_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigTrickleFsyncIntervalInKbParams creates a new FindConfigTrickleFsyncIntervalInKbParams object +// with the default values initialized. +func NewFindConfigTrickleFsyncIntervalInKbParams() *FindConfigTrickleFsyncIntervalInKbParams { + + return &FindConfigTrickleFsyncIntervalInKbParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigTrickleFsyncIntervalInKbParamsWithTimeout creates a new FindConfigTrickleFsyncIntervalInKbParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigTrickleFsyncIntervalInKbParamsWithTimeout(timeout time.Duration) *FindConfigTrickleFsyncIntervalInKbParams { + + return &FindConfigTrickleFsyncIntervalInKbParams{ + + timeout: timeout, + } +} + +// NewFindConfigTrickleFsyncIntervalInKbParamsWithContext creates a new FindConfigTrickleFsyncIntervalInKbParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigTrickleFsyncIntervalInKbParamsWithContext(ctx context.Context) *FindConfigTrickleFsyncIntervalInKbParams { + + return &FindConfigTrickleFsyncIntervalInKbParams{ + + Context: ctx, + } +} + +// NewFindConfigTrickleFsyncIntervalInKbParamsWithHTTPClient creates a new FindConfigTrickleFsyncIntervalInKbParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigTrickleFsyncIntervalInKbParamsWithHTTPClient(client *http.Client) *FindConfigTrickleFsyncIntervalInKbParams { + + return &FindConfigTrickleFsyncIntervalInKbParams{ + HTTPClient: client, + } +} + +/* +FindConfigTrickleFsyncIntervalInKbParams contains all the parameters to send to the API endpoint +for the find config trickle fsync interval in kb operation typically these are written to a http.Request +*/ +type FindConfigTrickleFsyncIntervalInKbParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config trickle fsync interval in kb params +func (o *FindConfigTrickleFsyncIntervalInKbParams) WithTimeout(timeout time.Duration) *FindConfigTrickleFsyncIntervalInKbParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config trickle fsync interval in kb params +func (o *FindConfigTrickleFsyncIntervalInKbParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config trickle fsync interval in kb params +func (o *FindConfigTrickleFsyncIntervalInKbParams) WithContext(ctx context.Context) *FindConfigTrickleFsyncIntervalInKbParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config trickle fsync interval in kb params +func (o *FindConfigTrickleFsyncIntervalInKbParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config trickle fsync interval in kb params +func (o *FindConfigTrickleFsyncIntervalInKbParams) WithHTTPClient(client *http.Client) *FindConfigTrickleFsyncIntervalInKbParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config trickle fsync interval in kb params +func (o *FindConfigTrickleFsyncIntervalInKbParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigTrickleFsyncIntervalInKbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_trickle_fsync_interval_in_kb_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_trickle_fsync_interval_in_kb_responses.go new file mode 100644 index 0000000000..d4e3db6336 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_trickle_fsync_interval_in_kb_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigTrickleFsyncIntervalInKbReader is a Reader for the FindConfigTrickleFsyncIntervalInKb structure. +type FindConfigTrickleFsyncIntervalInKbReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigTrickleFsyncIntervalInKbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigTrickleFsyncIntervalInKbOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigTrickleFsyncIntervalInKbDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigTrickleFsyncIntervalInKbOK creates a FindConfigTrickleFsyncIntervalInKbOK with default headers values +func NewFindConfigTrickleFsyncIntervalInKbOK() *FindConfigTrickleFsyncIntervalInKbOK { + return &FindConfigTrickleFsyncIntervalInKbOK{} +} + +/* +FindConfigTrickleFsyncIntervalInKbOK handles this case with default header values. + +Config value +*/ +type FindConfigTrickleFsyncIntervalInKbOK struct { + Payload int64 +} + +func (o *FindConfigTrickleFsyncIntervalInKbOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigTrickleFsyncIntervalInKbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigTrickleFsyncIntervalInKbDefault creates a FindConfigTrickleFsyncIntervalInKbDefault with default headers values +func NewFindConfigTrickleFsyncIntervalInKbDefault(code int) *FindConfigTrickleFsyncIntervalInKbDefault { + return &FindConfigTrickleFsyncIntervalInKbDefault{ + _statusCode: code, + } +} + +/* +FindConfigTrickleFsyncIntervalInKbDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigTrickleFsyncIntervalInKbDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config trickle fsync interval in kb default response +func (o *FindConfigTrickleFsyncIntervalInKbDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigTrickleFsyncIntervalInKbDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigTrickleFsyncIntervalInKbDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigTrickleFsyncIntervalInKbDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_trickle_fsync_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_trickle_fsync_parameters.go new file mode 100644 index 0000000000..c26d03a583 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_trickle_fsync_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigTrickleFsyncParams creates a new FindConfigTrickleFsyncParams object +// with the default values initialized. +func NewFindConfigTrickleFsyncParams() *FindConfigTrickleFsyncParams { + + return &FindConfigTrickleFsyncParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigTrickleFsyncParamsWithTimeout creates a new FindConfigTrickleFsyncParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigTrickleFsyncParamsWithTimeout(timeout time.Duration) *FindConfigTrickleFsyncParams { + + return &FindConfigTrickleFsyncParams{ + + timeout: timeout, + } +} + +// NewFindConfigTrickleFsyncParamsWithContext creates a new FindConfigTrickleFsyncParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigTrickleFsyncParamsWithContext(ctx context.Context) *FindConfigTrickleFsyncParams { + + return &FindConfigTrickleFsyncParams{ + + Context: ctx, + } +} + +// NewFindConfigTrickleFsyncParamsWithHTTPClient creates a new FindConfigTrickleFsyncParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigTrickleFsyncParamsWithHTTPClient(client *http.Client) *FindConfigTrickleFsyncParams { + + return &FindConfigTrickleFsyncParams{ + HTTPClient: client, + } +} + +/* +FindConfigTrickleFsyncParams contains all the parameters to send to the API endpoint +for the find config trickle fsync operation typically these are written to a http.Request +*/ +type FindConfigTrickleFsyncParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config trickle fsync params +func (o *FindConfigTrickleFsyncParams) WithTimeout(timeout time.Duration) *FindConfigTrickleFsyncParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config trickle fsync params +func (o *FindConfigTrickleFsyncParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config trickle fsync params +func (o *FindConfigTrickleFsyncParams) WithContext(ctx context.Context) *FindConfigTrickleFsyncParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config trickle fsync params +func (o *FindConfigTrickleFsyncParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config trickle fsync params +func (o *FindConfigTrickleFsyncParams) WithHTTPClient(client *http.Client) *FindConfigTrickleFsyncParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config trickle fsync params +func (o *FindConfigTrickleFsyncParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigTrickleFsyncParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_trickle_fsync_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_trickle_fsync_responses.go new file mode 100644 index 0000000000..a8d777f30c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_trickle_fsync_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigTrickleFsyncReader is a Reader for the FindConfigTrickleFsync structure. +type FindConfigTrickleFsyncReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigTrickleFsyncReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigTrickleFsyncOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigTrickleFsyncDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigTrickleFsyncOK creates a FindConfigTrickleFsyncOK with default headers values +func NewFindConfigTrickleFsyncOK() *FindConfigTrickleFsyncOK { + return &FindConfigTrickleFsyncOK{} +} + +/* +FindConfigTrickleFsyncOK handles this case with default header values. + +Config value +*/ +type FindConfigTrickleFsyncOK struct { + Payload bool +} + +func (o *FindConfigTrickleFsyncOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigTrickleFsyncOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigTrickleFsyncDefault creates a FindConfigTrickleFsyncDefault with default headers values +func NewFindConfigTrickleFsyncDefault(code int) *FindConfigTrickleFsyncDefault { + return &FindConfigTrickleFsyncDefault{ + _statusCode: code, + } +} + +/* +FindConfigTrickleFsyncDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigTrickleFsyncDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config trickle fsync default response +func (o *FindConfigTrickleFsyncDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigTrickleFsyncDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigTrickleFsyncDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigTrickleFsyncDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_truncate_request_timeout_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_truncate_request_timeout_in_ms_parameters.go new file mode 100644 index 0000000000..a490f23a3c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_truncate_request_timeout_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigTruncateRequestTimeoutInMsParams creates a new FindConfigTruncateRequestTimeoutInMsParams object +// with the default values initialized. +func NewFindConfigTruncateRequestTimeoutInMsParams() *FindConfigTruncateRequestTimeoutInMsParams { + + return &FindConfigTruncateRequestTimeoutInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigTruncateRequestTimeoutInMsParamsWithTimeout creates a new FindConfigTruncateRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigTruncateRequestTimeoutInMsParamsWithTimeout(timeout time.Duration) *FindConfigTruncateRequestTimeoutInMsParams { + + return &FindConfigTruncateRequestTimeoutInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigTruncateRequestTimeoutInMsParamsWithContext creates a new FindConfigTruncateRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigTruncateRequestTimeoutInMsParamsWithContext(ctx context.Context) *FindConfigTruncateRequestTimeoutInMsParams { + + return &FindConfigTruncateRequestTimeoutInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigTruncateRequestTimeoutInMsParamsWithHTTPClient creates a new FindConfigTruncateRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigTruncateRequestTimeoutInMsParamsWithHTTPClient(client *http.Client) *FindConfigTruncateRequestTimeoutInMsParams { + + return &FindConfigTruncateRequestTimeoutInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigTruncateRequestTimeoutInMsParams contains all the parameters to send to the API endpoint +for the find config truncate request timeout in ms operation typically these are written to a http.Request +*/ +type FindConfigTruncateRequestTimeoutInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config truncate request timeout in ms params +func (o *FindConfigTruncateRequestTimeoutInMsParams) WithTimeout(timeout time.Duration) *FindConfigTruncateRequestTimeoutInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config truncate request timeout in ms params +func (o *FindConfigTruncateRequestTimeoutInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config truncate request timeout in ms params +func (o *FindConfigTruncateRequestTimeoutInMsParams) WithContext(ctx context.Context) *FindConfigTruncateRequestTimeoutInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config truncate request timeout in ms params +func (o *FindConfigTruncateRequestTimeoutInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config truncate request timeout in ms params +func (o *FindConfigTruncateRequestTimeoutInMsParams) WithHTTPClient(client *http.Client) *FindConfigTruncateRequestTimeoutInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config truncate request timeout in ms params +func (o *FindConfigTruncateRequestTimeoutInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigTruncateRequestTimeoutInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_truncate_request_timeout_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_truncate_request_timeout_in_ms_responses.go new file mode 100644 index 0000000000..b26a7938e6 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_truncate_request_timeout_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigTruncateRequestTimeoutInMsReader is a Reader for the FindConfigTruncateRequestTimeoutInMs structure. +type FindConfigTruncateRequestTimeoutInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigTruncateRequestTimeoutInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigTruncateRequestTimeoutInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigTruncateRequestTimeoutInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigTruncateRequestTimeoutInMsOK creates a FindConfigTruncateRequestTimeoutInMsOK with default headers values +func NewFindConfigTruncateRequestTimeoutInMsOK() *FindConfigTruncateRequestTimeoutInMsOK { + return &FindConfigTruncateRequestTimeoutInMsOK{} +} + +/* +FindConfigTruncateRequestTimeoutInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigTruncateRequestTimeoutInMsOK struct { + Payload int64 +} + +func (o *FindConfigTruncateRequestTimeoutInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigTruncateRequestTimeoutInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigTruncateRequestTimeoutInMsDefault creates a FindConfigTruncateRequestTimeoutInMsDefault with default headers values +func NewFindConfigTruncateRequestTimeoutInMsDefault(code int) *FindConfigTruncateRequestTimeoutInMsDefault { + return &FindConfigTruncateRequestTimeoutInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigTruncateRequestTimeoutInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigTruncateRequestTimeoutInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config truncate request timeout in ms default response +func (o *FindConfigTruncateRequestTimeoutInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigTruncateRequestTimeoutInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigTruncateRequestTimeoutInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigTruncateRequestTimeoutInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_uuid_sstable_identifiers_enabled_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_uuid_sstable_identifiers_enabled_parameters.go new file mode 100644 index 0000000000..f1eb2172a1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_uuid_sstable_identifiers_enabled_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigUUIDSstableIdentifiersEnabledParams creates a new FindConfigUUIDSstableIdentifiersEnabledParams object +// with the default values initialized. +func NewFindConfigUUIDSstableIdentifiersEnabledParams() *FindConfigUUIDSstableIdentifiersEnabledParams { + + return &FindConfigUUIDSstableIdentifiersEnabledParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigUUIDSstableIdentifiersEnabledParamsWithTimeout creates a new FindConfigUUIDSstableIdentifiersEnabledParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigUUIDSstableIdentifiersEnabledParamsWithTimeout(timeout time.Duration) *FindConfigUUIDSstableIdentifiersEnabledParams { + + return &FindConfigUUIDSstableIdentifiersEnabledParams{ + + timeout: timeout, + } +} + +// NewFindConfigUUIDSstableIdentifiersEnabledParamsWithContext creates a new FindConfigUUIDSstableIdentifiersEnabledParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigUUIDSstableIdentifiersEnabledParamsWithContext(ctx context.Context) *FindConfigUUIDSstableIdentifiersEnabledParams { + + return &FindConfigUUIDSstableIdentifiersEnabledParams{ + + Context: ctx, + } +} + +// NewFindConfigUUIDSstableIdentifiersEnabledParamsWithHTTPClient creates a new FindConfigUUIDSstableIdentifiersEnabledParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigUUIDSstableIdentifiersEnabledParamsWithHTTPClient(client *http.Client) *FindConfigUUIDSstableIdentifiersEnabledParams { + + return &FindConfigUUIDSstableIdentifiersEnabledParams{ + HTTPClient: client, + } +} + +/* +FindConfigUUIDSstableIdentifiersEnabledParams contains all the parameters to send to the API endpoint +for the find config uuid sstable identifiers enabled operation typically these are written to a http.Request +*/ +type FindConfigUUIDSstableIdentifiersEnabledParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config uuid sstable identifiers enabled params +func (o *FindConfigUUIDSstableIdentifiersEnabledParams) WithTimeout(timeout time.Duration) *FindConfigUUIDSstableIdentifiersEnabledParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config uuid sstable identifiers enabled params +func (o *FindConfigUUIDSstableIdentifiersEnabledParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config uuid sstable identifiers enabled params +func (o *FindConfigUUIDSstableIdentifiersEnabledParams) WithContext(ctx context.Context) *FindConfigUUIDSstableIdentifiersEnabledParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config uuid sstable identifiers enabled params +func (o *FindConfigUUIDSstableIdentifiersEnabledParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config uuid sstable identifiers enabled params +func (o *FindConfigUUIDSstableIdentifiersEnabledParams) WithHTTPClient(client *http.Client) *FindConfigUUIDSstableIdentifiersEnabledParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config uuid sstable identifiers enabled params +func (o *FindConfigUUIDSstableIdentifiersEnabledParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigUUIDSstableIdentifiersEnabledParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_uuid_sstable_identifiers_enabled_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_uuid_sstable_identifiers_enabled_responses.go new file mode 100644 index 0000000000..86ddd1a202 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_uuid_sstable_identifiers_enabled_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigUUIDSstableIdentifiersEnabledReader is a Reader for the FindConfigUUIDSstableIdentifiersEnabled structure. +type FindConfigUUIDSstableIdentifiersEnabledReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigUUIDSstableIdentifiersEnabledReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigUUIDSstableIdentifiersEnabledOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigUUIDSstableIdentifiersEnabledDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigUUIDSstableIdentifiersEnabledOK creates a FindConfigUUIDSstableIdentifiersEnabledOK with default headers values +func NewFindConfigUUIDSstableIdentifiersEnabledOK() *FindConfigUUIDSstableIdentifiersEnabledOK { + return &FindConfigUUIDSstableIdentifiersEnabledOK{} +} + +/* +FindConfigUUIDSstableIdentifiersEnabledOK handles this case with default header values. + +Config value +*/ +type FindConfigUUIDSstableIdentifiersEnabledOK struct { + Payload bool +} + +func (o *FindConfigUUIDSstableIdentifiersEnabledOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigUUIDSstableIdentifiersEnabledOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigUUIDSstableIdentifiersEnabledDefault creates a FindConfigUUIDSstableIdentifiersEnabledDefault with default headers values +func NewFindConfigUUIDSstableIdentifiersEnabledDefault(code int) *FindConfigUUIDSstableIdentifiersEnabledDefault { + return &FindConfigUUIDSstableIdentifiersEnabledDefault{ + _statusCode: code, + } +} + +/* +FindConfigUUIDSstableIdentifiersEnabledDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigUUIDSstableIdentifiersEnabledDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config uuid sstable identifiers enabled default response +func (o *FindConfigUUIDSstableIdentifiersEnabledDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigUUIDSstableIdentifiersEnabledDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigUUIDSstableIdentifiersEnabledDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigUUIDSstableIdentifiersEnabledDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_view_building_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_view_building_parameters.go new file mode 100644 index 0000000000..d07e30d383 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_view_building_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigViewBuildingParams creates a new FindConfigViewBuildingParams object +// with the default values initialized. +func NewFindConfigViewBuildingParams() *FindConfigViewBuildingParams { + + return &FindConfigViewBuildingParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigViewBuildingParamsWithTimeout creates a new FindConfigViewBuildingParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigViewBuildingParamsWithTimeout(timeout time.Duration) *FindConfigViewBuildingParams { + + return &FindConfigViewBuildingParams{ + + timeout: timeout, + } +} + +// NewFindConfigViewBuildingParamsWithContext creates a new FindConfigViewBuildingParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigViewBuildingParamsWithContext(ctx context.Context) *FindConfigViewBuildingParams { + + return &FindConfigViewBuildingParams{ + + Context: ctx, + } +} + +// NewFindConfigViewBuildingParamsWithHTTPClient creates a new FindConfigViewBuildingParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigViewBuildingParamsWithHTTPClient(client *http.Client) *FindConfigViewBuildingParams { + + return &FindConfigViewBuildingParams{ + HTTPClient: client, + } +} + +/* +FindConfigViewBuildingParams contains all the parameters to send to the API endpoint +for the find config view building operation typically these are written to a http.Request +*/ +type FindConfigViewBuildingParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config view building params +func (o *FindConfigViewBuildingParams) WithTimeout(timeout time.Duration) *FindConfigViewBuildingParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config view building params +func (o *FindConfigViewBuildingParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config view building params +func (o *FindConfigViewBuildingParams) WithContext(ctx context.Context) *FindConfigViewBuildingParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config view building params +func (o *FindConfigViewBuildingParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config view building params +func (o *FindConfigViewBuildingParams) WithHTTPClient(client *http.Client) *FindConfigViewBuildingParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config view building params +func (o *FindConfigViewBuildingParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigViewBuildingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_view_building_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_view_building_responses.go new file mode 100644 index 0000000000..d5959f3dcb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_view_building_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigViewBuildingReader is a Reader for the FindConfigViewBuilding structure. +type FindConfigViewBuildingReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigViewBuildingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigViewBuildingOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigViewBuildingDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigViewBuildingOK creates a FindConfigViewBuildingOK with default headers values +func NewFindConfigViewBuildingOK() *FindConfigViewBuildingOK { + return &FindConfigViewBuildingOK{} +} + +/* +FindConfigViewBuildingOK handles this case with default header values. + +Config value +*/ +type FindConfigViewBuildingOK struct { + Payload bool +} + +func (o *FindConfigViewBuildingOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigViewBuildingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigViewBuildingDefault creates a FindConfigViewBuildingDefault with default headers values +func NewFindConfigViewBuildingDefault(code int) *FindConfigViewBuildingDefault { + return &FindConfigViewBuildingDefault{ + _statusCode: code, + } +} + +/* +FindConfigViewBuildingDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigViewBuildingDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config view building default response +func (o *FindConfigViewBuildingDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigViewBuildingDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigViewBuildingDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigViewBuildingDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_view_hints_directory_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_view_hints_directory_parameters.go new file mode 100644 index 0000000000..2c93737f8e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_view_hints_directory_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigViewHintsDirectoryParams creates a new FindConfigViewHintsDirectoryParams object +// with the default values initialized. +func NewFindConfigViewHintsDirectoryParams() *FindConfigViewHintsDirectoryParams { + + return &FindConfigViewHintsDirectoryParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigViewHintsDirectoryParamsWithTimeout creates a new FindConfigViewHintsDirectoryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigViewHintsDirectoryParamsWithTimeout(timeout time.Duration) *FindConfigViewHintsDirectoryParams { + + return &FindConfigViewHintsDirectoryParams{ + + timeout: timeout, + } +} + +// NewFindConfigViewHintsDirectoryParamsWithContext creates a new FindConfigViewHintsDirectoryParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigViewHintsDirectoryParamsWithContext(ctx context.Context) *FindConfigViewHintsDirectoryParams { + + return &FindConfigViewHintsDirectoryParams{ + + Context: ctx, + } +} + +// NewFindConfigViewHintsDirectoryParamsWithHTTPClient creates a new FindConfigViewHintsDirectoryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigViewHintsDirectoryParamsWithHTTPClient(client *http.Client) *FindConfigViewHintsDirectoryParams { + + return &FindConfigViewHintsDirectoryParams{ + HTTPClient: client, + } +} + +/* +FindConfigViewHintsDirectoryParams contains all the parameters to send to the API endpoint +for the find config view hints directory operation typically these are written to a http.Request +*/ +type FindConfigViewHintsDirectoryParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config view hints directory params +func (o *FindConfigViewHintsDirectoryParams) WithTimeout(timeout time.Duration) *FindConfigViewHintsDirectoryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config view hints directory params +func (o *FindConfigViewHintsDirectoryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config view hints directory params +func (o *FindConfigViewHintsDirectoryParams) WithContext(ctx context.Context) *FindConfigViewHintsDirectoryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config view hints directory params +func (o *FindConfigViewHintsDirectoryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config view hints directory params +func (o *FindConfigViewHintsDirectoryParams) WithHTTPClient(client *http.Client) *FindConfigViewHintsDirectoryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config view hints directory params +func (o *FindConfigViewHintsDirectoryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigViewHintsDirectoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_view_hints_directory_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_view_hints_directory_responses.go new file mode 100644 index 0000000000..1251a591d9 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_view_hints_directory_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigViewHintsDirectoryReader is a Reader for the FindConfigViewHintsDirectory structure. +type FindConfigViewHintsDirectoryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigViewHintsDirectoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigViewHintsDirectoryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigViewHintsDirectoryDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigViewHintsDirectoryOK creates a FindConfigViewHintsDirectoryOK with default headers values +func NewFindConfigViewHintsDirectoryOK() *FindConfigViewHintsDirectoryOK { + return &FindConfigViewHintsDirectoryOK{} +} + +/* +FindConfigViewHintsDirectoryOK handles this case with default header values. + +Config value +*/ +type FindConfigViewHintsDirectoryOK struct { + Payload string +} + +func (o *FindConfigViewHintsDirectoryOK) GetPayload() string { + return o.Payload +} + +func (o *FindConfigViewHintsDirectoryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigViewHintsDirectoryDefault creates a FindConfigViewHintsDirectoryDefault with default headers values +func NewFindConfigViewHintsDirectoryDefault(code int) *FindConfigViewHintsDirectoryDefault { + return &FindConfigViewHintsDirectoryDefault{ + _statusCode: code, + } +} + +/* +FindConfigViewHintsDirectoryDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigViewHintsDirectoryDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config view hints directory default response +func (o *FindConfigViewHintsDirectoryDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigViewHintsDirectoryDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigViewHintsDirectoryDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigViewHintsDirectoryDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_virtual_dirty_soft_limit_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_virtual_dirty_soft_limit_parameters.go new file mode 100644 index 0000000000..e2e8733183 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_virtual_dirty_soft_limit_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigVirtualDirtySoftLimitParams creates a new FindConfigVirtualDirtySoftLimitParams object +// with the default values initialized. +func NewFindConfigVirtualDirtySoftLimitParams() *FindConfigVirtualDirtySoftLimitParams { + + return &FindConfigVirtualDirtySoftLimitParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigVirtualDirtySoftLimitParamsWithTimeout creates a new FindConfigVirtualDirtySoftLimitParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigVirtualDirtySoftLimitParamsWithTimeout(timeout time.Duration) *FindConfigVirtualDirtySoftLimitParams { + + return &FindConfigVirtualDirtySoftLimitParams{ + + timeout: timeout, + } +} + +// NewFindConfigVirtualDirtySoftLimitParamsWithContext creates a new FindConfigVirtualDirtySoftLimitParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigVirtualDirtySoftLimitParamsWithContext(ctx context.Context) *FindConfigVirtualDirtySoftLimitParams { + + return &FindConfigVirtualDirtySoftLimitParams{ + + Context: ctx, + } +} + +// NewFindConfigVirtualDirtySoftLimitParamsWithHTTPClient creates a new FindConfigVirtualDirtySoftLimitParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigVirtualDirtySoftLimitParamsWithHTTPClient(client *http.Client) *FindConfigVirtualDirtySoftLimitParams { + + return &FindConfigVirtualDirtySoftLimitParams{ + HTTPClient: client, + } +} + +/* +FindConfigVirtualDirtySoftLimitParams contains all the parameters to send to the API endpoint +for the find config virtual dirty soft limit operation typically these are written to a http.Request +*/ +type FindConfigVirtualDirtySoftLimitParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config virtual dirty soft limit params +func (o *FindConfigVirtualDirtySoftLimitParams) WithTimeout(timeout time.Duration) *FindConfigVirtualDirtySoftLimitParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config virtual dirty soft limit params +func (o *FindConfigVirtualDirtySoftLimitParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config virtual dirty soft limit params +func (o *FindConfigVirtualDirtySoftLimitParams) WithContext(ctx context.Context) *FindConfigVirtualDirtySoftLimitParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config virtual dirty soft limit params +func (o *FindConfigVirtualDirtySoftLimitParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config virtual dirty soft limit params +func (o *FindConfigVirtualDirtySoftLimitParams) WithHTTPClient(client *http.Client) *FindConfigVirtualDirtySoftLimitParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config virtual dirty soft limit params +func (o *FindConfigVirtualDirtySoftLimitParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigVirtualDirtySoftLimitParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_virtual_dirty_soft_limit_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_virtual_dirty_soft_limit_responses.go new file mode 100644 index 0000000000..e72e94337e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_virtual_dirty_soft_limit_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigVirtualDirtySoftLimitReader is a Reader for the FindConfigVirtualDirtySoftLimit structure. +type FindConfigVirtualDirtySoftLimitReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigVirtualDirtySoftLimitReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigVirtualDirtySoftLimitOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigVirtualDirtySoftLimitDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigVirtualDirtySoftLimitOK creates a FindConfigVirtualDirtySoftLimitOK with default headers values +func NewFindConfigVirtualDirtySoftLimitOK() *FindConfigVirtualDirtySoftLimitOK { + return &FindConfigVirtualDirtySoftLimitOK{} +} + +/* +FindConfigVirtualDirtySoftLimitOK handles this case with default header values. + +Config value +*/ +type FindConfigVirtualDirtySoftLimitOK struct { + Payload float64 +} + +func (o *FindConfigVirtualDirtySoftLimitOK) GetPayload() float64 { + return o.Payload +} + +func (o *FindConfigVirtualDirtySoftLimitOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigVirtualDirtySoftLimitDefault creates a FindConfigVirtualDirtySoftLimitDefault with default headers values +func NewFindConfigVirtualDirtySoftLimitDefault(code int) *FindConfigVirtualDirtySoftLimitDefault { + return &FindConfigVirtualDirtySoftLimitDefault{ + _statusCode: code, + } +} + +/* +FindConfigVirtualDirtySoftLimitDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigVirtualDirtySoftLimitDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config virtual dirty soft limit default response +func (o *FindConfigVirtualDirtySoftLimitDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigVirtualDirtySoftLimitDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigVirtualDirtySoftLimitDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigVirtualDirtySoftLimitDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_volatile_system_keyspace_for_testing_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_volatile_system_keyspace_for_testing_parameters.go new file mode 100644 index 0000000000..e114f669d4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_volatile_system_keyspace_for_testing_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigVolatileSystemKeyspaceForTestingParams creates a new FindConfigVolatileSystemKeyspaceForTestingParams object +// with the default values initialized. +func NewFindConfigVolatileSystemKeyspaceForTestingParams() *FindConfigVolatileSystemKeyspaceForTestingParams { + + return &FindConfigVolatileSystemKeyspaceForTestingParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigVolatileSystemKeyspaceForTestingParamsWithTimeout creates a new FindConfigVolatileSystemKeyspaceForTestingParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigVolatileSystemKeyspaceForTestingParamsWithTimeout(timeout time.Duration) *FindConfigVolatileSystemKeyspaceForTestingParams { + + return &FindConfigVolatileSystemKeyspaceForTestingParams{ + + timeout: timeout, + } +} + +// NewFindConfigVolatileSystemKeyspaceForTestingParamsWithContext creates a new FindConfigVolatileSystemKeyspaceForTestingParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigVolatileSystemKeyspaceForTestingParamsWithContext(ctx context.Context) *FindConfigVolatileSystemKeyspaceForTestingParams { + + return &FindConfigVolatileSystemKeyspaceForTestingParams{ + + Context: ctx, + } +} + +// NewFindConfigVolatileSystemKeyspaceForTestingParamsWithHTTPClient creates a new FindConfigVolatileSystemKeyspaceForTestingParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigVolatileSystemKeyspaceForTestingParamsWithHTTPClient(client *http.Client) *FindConfigVolatileSystemKeyspaceForTestingParams { + + return &FindConfigVolatileSystemKeyspaceForTestingParams{ + HTTPClient: client, + } +} + +/* +FindConfigVolatileSystemKeyspaceForTestingParams contains all the parameters to send to the API endpoint +for the find config volatile system keyspace for testing operation typically these are written to a http.Request +*/ +type FindConfigVolatileSystemKeyspaceForTestingParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config volatile system keyspace for testing params +func (o *FindConfigVolatileSystemKeyspaceForTestingParams) WithTimeout(timeout time.Duration) *FindConfigVolatileSystemKeyspaceForTestingParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config volatile system keyspace for testing params +func (o *FindConfigVolatileSystemKeyspaceForTestingParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config volatile system keyspace for testing params +func (o *FindConfigVolatileSystemKeyspaceForTestingParams) WithContext(ctx context.Context) *FindConfigVolatileSystemKeyspaceForTestingParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config volatile system keyspace for testing params +func (o *FindConfigVolatileSystemKeyspaceForTestingParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config volatile system keyspace for testing params +func (o *FindConfigVolatileSystemKeyspaceForTestingParams) WithHTTPClient(client *http.Client) *FindConfigVolatileSystemKeyspaceForTestingParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config volatile system keyspace for testing params +func (o *FindConfigVolatileSystemKeyspaceForTestingParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigVolatileSystemKeyspaceForTestingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_volatile_system_keyspace_for_testing_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_volatile_system_keyspace_for_testing_responses.go new file mode 100644 index 0000000000..7a6f2ed540 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_volatile_system_keyspace_for_testing_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigVolatileSystemKeyspaceForTestingReader is a Reader for the FindConfigVolatileSystemKeyspaceForTesting structure. +type FindConfigVolatileSystemKeyspaceForTestingReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigVolatileSystemKeyspaceForTestingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigVolatileSystemKeyspaceForTestingOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigVolatileSystemKeyspaceForTestingDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigVolatileSystemKeyspaceForTestingOK creates a FindConfigVolatileSystemKeyspaceForTestingOK with default headers values +func NewFindConfigVolatileSystemKeyspaceForTestingOK() *FindConfigVolatileSystemKeyspaceForTestingOK { + return &FindConfigVolatileSystemKeyspaceForTestingOK{} +} + +/* +FindConfigVolatileSystemKeyspaceForTestingOK handles this case with default header values. + +Config value +*/ +type FindConfigVolatileSystemKeyspaceForTestingOK struct { + Payload bool +} + +func (o *FindConfigVolatileSystemKeyspaceForTestingOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigVolatileSystemKeyspaceForTestingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigVolatileSystemKeyspaceForTestingDefault creates a FindConfigVolatileSystemKeyspaceForTestingDefault with default headers values +func NewFindConfigVolatileSystemKeyspaceForTestingDefault(code int) *FindConfigVolatileSystemKeyspaceForTestingDefault { + return &FindConfigVolatileSystemKeyspaceForTestingDefault{ + _statusCode: code, + } +} + +/* +FindConfigVolatileSystemKeyspaceForTestingDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigVolatileSystemKeyspaceForTestingDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config volatile system keyspace for testing default response +func (o *FindConfigVolatileSystemKeyspaceForTestingDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigVolatileSystemKeyspaceForTestingDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigVolatileSystemKeyspaceForTestingDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigVolatileSystemKeyspaceForTestingDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_write_request_timeout_in_ms_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_write_request_timeout_in_ms_parameters.go new file mode 100644 index 0000000000..9eed34ac39 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_write_request_timeout_in_ms_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewFindConfigWriteRequestTimeoutInMsParams creates a new FindConfigWriteRequestTimeoutInMsParams object +// with the default values initialized. +func NewFindConfigWriteRequestTimeoutInMsParams() *FindConfigWriteRequestTimeoutInMsParams { + + return &FindConfigWriteRequestTimeoutInMsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigWriteRequestTimeoutInMsParamsWithTimeout creates a new FindConfigWriteRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigWriteRequestTimeoutInMsParamsWithTimeout(timeout time.Duration) *FindConfigWriteRequestTimeoutInMsParams { + + return &FindConfigWriteRequestTimeoutInMsParams{ + + timeout: timeout, + } +} + +// NewFindConfigWriteRequestTimeoutInMsParamsWithContext creates a new FindConfigWriteRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigWriteRequestTimeoutInMsParamsWithContext(ctx context.Context) *FindConfigWriteRequestTimeoutInMsParams { + + return &FindConfigWriteRequestTimeoutInMsParams{ + + Context: ctx, + } +} + +// NewFindConfigWriteRequestTimeoutInMsParamsWithHTTPClient creates a new FindConfigWriteRequestTimeoutInMsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigWriteRequestTimeoutInMsParamsWithHTTPClient(client *http.Client) *FindConfigWriteRequestTimeoutInMsParams { + + return &FindConfigWriteRequestTimeoutInMsParams{ + HTTPClient: client, + } +} + +/* +FindConfigWriteRequestTimeoutInMsParams contains all the parameters to send to the API endpoint +for the find config write request timeout in ms operation typically these are written to a http.Request +*/ +type FindConfigWriteRequestTimeoutInMsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config write request timeout in ms params +func (o *FindConfigWriteRequestTimeoutInMsParams) WithTimeout(timeout time.Duration) *FindConfigWriteRequestTimeoutInMsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config write request timeout in ms params +func (o *FindConfigWriteRequestTimeoutInMsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config write request timeout in ms params +func (o *FindConfigWriteRequestTimeoutInMsParams) WithContext(ctx context.Context) *FindConfigWriteRequestTimeoutInMsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config write request timeout in ms params +func (o *FindConfigWriteRequestTimeoutInMsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config write request timeout in ms params +func (o *FindConfigWriteRequestTimeoutInMsParams) WithHTTPClient(client *http.Client) *FindConfigWriteRequestTimeoutInMsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config write request timeout in ms params +func (o *FindConfigWriteRequestTimeoutInMsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigWriteRequestTimeoutInMsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_write_request_timeout_in_ms_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_write_request_timeout_in_ms_responses.go new file mode 100644 index 0000000000..72dcdaac2c --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config/find_config_write_request_timeout_in_ms_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigWriteRequestTimeoutInMsReader is a Reader for the FindConfigWriteRequestTimeoutInMs structure. +type FindConfigWriteRequestTimeoutInMsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigWriteRequestTimeoutInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigWriteRequestTimeoutInMsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigWriteRequestTimeoutInMsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewFindConfigWriteRequestTimeoutInMsOK creates a FindConfigWriteRequestTimeoutInMsOK with default headers values +func NewFindConfigWriteRequestTimeoutInMsOK() *FindConfigWriteRequestTimeoutInMsOK { + return &FindConfigWriteRequestTimeoutInMsOK{} +} + +/* +FindConfigWriteRequestTimeoutInMsOK handles this case with default header values. + +Config value +*/ +type FindConfigWriteRequestTimeoutInMsOK struct { + Payload int64 +} + +func (o *FindConfigWriteRequestTimeoutInMsOK) GetPayload() int64 { + return o.Payload +} + +func (o *FindConfigWriteRequestTimeoutInMsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewFindConfigWriteRequestTimeoutInMsDefault creates a FindConfigWriteRequestTimeoutInMsDefault with default headers values +func NewFindConfigWriteRequestTimeoutInMsDefault(code int) *FindConfigWriteRequestTimeoutInMsDefault { + return &FindConfigWriteRequestTimeoutInMsDefault{ + _statusCode: code, + } +} + +/* +FindConfigWriteRequestTimeoutInMsDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigWriteRequestTimeoutInMsDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config write request timeout in ms default response +func (o *FindConfigWriteRequestTimeoutInMsDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigWriteRequestTimeoutInMsDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigWriteRequestTimeoutInMsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigWriteRequestTimeoutInMsDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/scylla_v2_client.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/scylla_v2_client.go new file mode 100644 index 0000000000..54bf9ff84e --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/scylla_v2_client.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config" +) + +// Default scylla v2 HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "scylla-manager.magic.host" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/v2" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new scylla v2 HTTP client. +func NewHTTPClient(formats strfmt.Registry) *ScyllaV2 { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new scylla v2 HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *ScyllaV2 { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new scylla v2 client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *ScyllaV2 { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(ScyllaV2) + cli.Transport = transport + cli.Config = config.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// ScyllaV2 is a client for scylla v2 +type ScyllaV2 struct { + Config config.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *ScyllaV2) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Config.SetTransport(transport) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models/client_encryption_options.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models/client_encryption_options.go new file mode 100644 index 0000000000..5b6dc3bc8a --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models/client_encryption_options.go @@ -0,0 +1,52 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ClientEncryptionOptions client encryption options +// +// swagger:model ClientEncryptionOptions +type ClientEncryptionOptions struct { + + // certificate + Certificate string `json:"certificate,omitempty"` + + // enabled + Enabled string `json:"enabled,omitempty"` + + // keyfile + Keyfile string `json:"keyfile,omitempty"` + + // require client auth + RequireClientAuth string `json:"require_client_auth,omitempty"` +} + +// Validate validates this client encryption options +func (m *ClientEncryptionOptions) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ClientEncryptionOptions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ClientEncryptionOptions) UnmarshalBinary(b []byte) error { + var res ClientEncryptionOptions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models/error_model.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models/error_model.go new file mode 100644 index 0000000000..9887571ce7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models/error_model.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ErrorModel error model +// +// swagger:model ErrorModel +type ErrorModel struct { + + // code + Code int64 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` +} + +// Validate validates this error model +func (m *ErrorModel) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ErrorModel) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ErrorModel) UnmarshalBinary(b []byte) error { + var res ErrorModel + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bson.go b/vendor/go.mongodb.org/mongo-driver/bson/bson.go index ae1a87faa7..a0d8185826 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bson.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bson.go @@ -7,8 +7,6 @@ // Based on gopkg.in/mgo.v2/bson by Gustavo Niemeyer // See THIRD-PARTY-NOTICES for original license terms. -// +build go1.9 - package bson // import "go.mongodb.org/mongo-driver/bson" import ( @@ -25,9 +23,11 @@ type Zeroer interface { // D is an ordered representation of a BSON document. This type should be used when the order of the elements matters, // such as MongoDB command documents. If the order of the elements does not matter, an M should be used instead. // +// A D should not be constructed with duplicate key names, as that can cause undefined server behavior. +// // Example usage: // -// bson.D{{"foo", "bar"}, {"hello", "world"}, {"pi", 3.14159}} +// bson.D{{"foo", "bar"}, {"hello", "world"}, {"pi", 3.14159}} type D = primitive.D // E represents a BSON element for a D. It is usually used inside a D. @@ -39,12 +39,12 @@ type E = primitive.E // // Example usage: // -// bson.M{"foo": "bar", "hello": "world", "pi": 3.14159} +// bson.M{"foo": "bar", "hello": "world", "pi": 3.14159} type M = primitive.M // An A is an ordered representation of a BSON array. // // Example usage: // -// bson.A{"bar", "world", 3.14159, bson.D{{"qux", 12345}}} +// bson.A{"bar", "world", 3.14159, bson.D{{"qux", 12345}}} type A = primitive.A diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bson_1_8.go b/vendor/go.mongodb.org/mongo-driver/bson/bson_1_8.go deleted file mode 100644 index bbe7792848..0000000000 --- a/vendor/go.mongodb.org/mongo-driver/bson/bson_1_8.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (C) MongoDB, Inc. 2017-present. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. You may obtain -// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - -// +build !go1.9 - -package bson // import "go.mongodb.org/mongo-driver/bson" - -import ( - "math" - "strconv" - "strings" -) - -// Zeroer allows custom struct types to implement a report of zero -// state. All struct types that don't implement Zeroer or where IsZero -// returns false are considered to be not zero. -type Zeroer interface { - IsZero() bool -} - -// D is an ordered representation of a BSON document. This type should be used when the order of the elements matters, -// such as MongoDB command documents. If the order of the elements does not matter, an M should be used instead. -// -// Example usage: -// -// bson.D{{"foo", "bar"}, {"hello", "world"}, {"pi", 3.14159}} -type D []E - -// Map creates a map from the elements of the D. -func (d D) Map() M { - m := make(M, len(d)) - for _, e := range d { - m[e.Key] = e.Value - } - return m -} - -// E represents a BSON element for a D. It is usually used inside a D. -type E struct { - Key string - Value interface{} -} - -// M is an unordered representation of a BSON document. This type should be used when the order of the elements does not -// matter. This type is handled as a regular map[string]interface{} when encoding and decoding. Elements will be -// serialized in an undefined, random order. If the order of the elements matters, a D should be used instead. -// -// Example usage: -// -// bson.M{"foo": "bar", "hello": "world", "pi": 3.14159} -type M map[string]interface{} - -// An A is an ordered representation of a BSON array. -// -// Example usage: -// -// bson.A{"bar", "world", 3.14159, bson.D{{"qux", 12345}}} -type A []interface{} - -func formatDouble(f float64) string { - var s string - if math.IsInf(f, 1) { - s = "Infinity" - } else if math.IsInf(f, -1) { - s = "-Infinity" - } else if math.IsNaN(f) { - s = "NaN" - } else { - // Print exactly one decimalType place for integers; otherwise, print as many are necessary to - // perfectly represent it. - s = strconv.FormatFloat(f, 'G', -1, 64) - if !strings.ContainsRune(s, '.') { - s += ".0" - } - } - - return s -} diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/array_codec.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/array_codec.go index 4e24f9eed6..652aa48b85 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/array_codec.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/array_codec.go @@ -14,17 +14,22 @@ import ( ) // ArrayCodec is the Codec used for bsoncore.Array values. +// +// Deprecated: ArrayCodec will not be directly accessible in Go Driver 2.0. type ArrayCodec struct{} var defaultArrayCodec = NewArrayCodec() // NewArrayCodec returns an ArrayCodec. +// +// Deprecated: NewArrayCodec will not be available in Go Driver 2.0. See +// [ArrayCodec] for more details. func NewArrayCodec() *ArrayCodec { return &ArrayCodec{} } // EncodeValue is the ValueEncoder for bsoncore.Array values. -func (ac *ArrayCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +func (ac *ArrayCodec) EncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tCoreArray { return ValueEncoderError{Name: "CoreArrayEncodeValue", Types: []reflect.Type{tCoreArray}, Received: val} } @@ -34,7 +39,7 @@ func (ac *ArrayCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val r } // DecodeValue is the ValueDecoder for bsoncore.Array values. -func (ac *ArrayCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { +func (ac *ArrayCodec) DecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tCoreArray { return ValueDecoderError{Name: "CoreArrayDecodeValue", Types: []reflect.Type{tCoreArray}, Received: val} } diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/bsoncodec.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/bsoncodec.go index 2c861b5cd3..0693bd432f 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/bsoncodec.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/bsoncodec.go @@ -13,6 +13,7 @@ import ( "go.mongodb.org/mongo-driver/bson/bsonrw" "go.mongodb.org/mongo-driver/bson/bsontype" + "go.mongodb.org/mongo-driver/bson/primitive" ) var ( @@ -22,6 +23,8 @@ var ( // Marshaler is an interface implemented by types that can marshal themselves // into a BSON document represented as bytes. The bytes returned must be a valid // BSON document if the error is nil. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Marshaler] instead. type Marshaler interface { MarshalBSON() ([]byte, error) } @@ -30,6 +33,8 @@ type Marshaler interface { // themselves into a BSON value as bytes. The type must be the valid type for // the bytes returned. The bytes and byte type together must be valid if the // error is nil. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.ValueMarshaler] instead. type ValueMarshaler interface { MarshalBSONValue() (bsontype.Type, []byte, error) } @@ -38,14 +43,18 @@ type ValueMarshaler interface { // document representation of themselves. The BSON bytes can be assumed to be // valid. UnmarshalBSON must copy the BSON bytes if it wishes to retain the data // after returning. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Unmarshaler] instead. type Unmarshaler interface { UnmarshalBSON([]byte) error } // ValueUnmarshaler is an interface implemented by types that can unmarshal a -// BSON value representaiton of themselves. The BSON bytes and type can be +// BSON value representation of themselves. The BSON bytes and type can be // assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it // wishes to retain the data after returning. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.ValueUnmarshaler] instead. type ValueUnmarshaler interface { UnmarshalBSONValue(bsontype.Type, []byte) error } @@ -110,23 +119,176 @@ func (vde ValueDecoderError) Error() string { // value. type EncodeContext struct { *Registry + + // MinSize causes the Encoder to marshal Go integer values (int, int8, int16, int32, int64, + // uint, uint8, uint16, uint32, or uint64) as the minimum BSON int size (either 32 or 64 bits) + // that can represent the integer value. + // + // Deprecated: Use bson.Encoder.IntMinSize instead. MinSize bool + + errorOnInlineDuplicates bool + stringifyMapKeysWithFmt bool + nilMapAsEmpty bool + nilSliceAsEmpty bool + nilByteSliceAsEmpty bool + omitZeroStruct bool + useJSONStructTags bool +} + +// ErrorOnInlineDuplicates causes the Encoder to return an error if there is a duplicate field in +// the marshaled BSON when the "inline" struct tag option is set. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.ErrorOnInlineDuplicates] instead. +func (ec *EncodeContext) ErrorOnInlineDuplicates() { + ec.errorOnInlineDuplicates = true +} + +// StringifyMapKeysWithFmt causes the Encoder to convert Go map keys to BSON document field name +// strings using fmt.Sprintf() instead of the default string conversion logic. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.StringifyMapKeysWithFmt] instead. +func (ec *EncodeContext) StringifyMapKeysWithFmt() { + ec.stringifyMapKeysWithFmt = true +} + +// NilMapAsEmpty causes the Encoder to marshal nil Go maps as empty BSON documents instead of BSON +// null. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.NilMapAsEmpty] instead. +func (ec *EncodeContext) NilMapAsEmpty() { + ec.nilMapAsEmpty = true +} + +// NilSliceAsEmpty causes the Encoder to marshal nil Go slices as empty BSON arrays instead of BSON +// null. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.NilSliceAsEmpty] instead. +func (ec *EncodeContext) NilSliceAsEmpty() { + ec.nilSliceAsEmpty = true +} + +// NilByteSliceAsEmpty causes the Encoder to marshal nil Go byte slices as empty BSON binary values +// instead of BSON null. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.NilByteSliceAsEmpty] instead. +func (ec *EncodeContext) NilByteSliceAsEmpty() { + ec.nilByteSliceAsEmpty = true +} + +// OmitZeroStruct causes the Encoder to consider the zero value for a struct (e.g. MyStruct{}) +// as empty and omit it from the marshaled BSON when the "omitempty" struct tag option is set. +// +// Note that the Encoder only examines exported struct fields when determining if a struct is the +// zero value. It considers pointers to a zero struct value (e.g. &MyStruct{}) not empty. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.OmitZeroStruct] instead. +func (ec *EncodeContext) OmitZeroStruct() { + ec.omitZeroStruct = true +} + +// UseJSONStructTags causes the Encoder to fall back to using the "json" struct tag if a "bson" +// struct tag is not specified. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.UseJSONStructTags] instead. +func (ec *EncodeContext) UseJSONStructTags() { + ec.useJSONStructTags = true } // DecodeContext is the contextual information required for a Codec to decode a // value. type DecodeContext struct { *Registry + + // Truncate, if true, instructs decoders to to truncate the fractional part of BSON "double" + // values when attempting to unmarshal them into a Go integer (int, int8, int16, int32, int64, + // uint, uint8, uint16, uint32, or uint64) struct field. The truncation logic does not apply to + // BSON "decimal128" values. + // + // Deprecated: Use bson.Decoder.AllowTruncatingDoubles instead. Truncate bool + // Ancestor is the type of a containing document. This is mainly used to determine what type // should be used when decoding an embedded document into an empty interface. For example, if // Ancestor is a bson.M, BSON embedded document values being decoded into an empty interface // will be decoded into a bson.M. + // + // Deprecated: Use bson.Decoder.DefaultDocumentM or bson.Decoder.DefaultDocumentD instead. Ancestor reflect.Type + + // defaultDocumentType specifies the Go type to decode top-level and nested BSON documents into. In particular, the + // usage for this field is restricted to data typed as "interface{}" or "map[string]interface{}". If DocumentType is + // set to a type that a BSON document cannot be unmarshaled into (e.g. "string"), unmarshalling will result in an + // error. DocumentType overrides the Ancestor field. + defaultDocumentType reflect.Type + + binaryAsSlice bool + useJSONStructTags bool + useLocalTimeZone bool + zeroMaps bool + zeroStructs bool +} + +// BinaryAsSlice causes the Decoder to unmarshal BSON binary field values that are the "Generic" or +// "Old" BSON binary subtype as a Go byte slice instead of a primitive.Binary. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.BinaryAsSlice] instead. +func (dc *DecodeContext) BinaryAsSlice() { + dc.binaryAsSlice = true } -// ValueCodec is the interface that groups the methods to encode and decode +// UseJSONStructTags causes the Decoder to fall back to using the "json" struct tag if a "bson" +// struct tag is not specified. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.UseJSONStructTags] instead. +func (dc *DecodeContext) UseJSONStructTags() { + dc.useJSONStructTags = true +} + +// UseLocalTimeZone causes the Decoder to unmarshal time.Time values in the local timezone instead +// of the UTC timezone. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.UseLocalTimeZone] instead. +func (dc *DecodeContext) UseLocalTimeZone() { + dc.useLocalTimeZone = true +} + +// ZeroMaps causes the Decoder to delete any existing values from Go maps in the destination value +// passed to Decode before unmarshaling BSON documents into them. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.ZeroMaps] instead. +func (dc *DecodeContext) ZeroMaps() { + dc.zeroMaps = true +} + +// ZeroStructs causes the Decoder to delete any existing values from Go structs in the destination +// value passed to Decode before unmarshaling BSON documents into them. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.ZeroStructs] instead. +func (dc *DecodeContext) ZeroStructs() { + dc.zeroStructs = true +} + +// DefaultDocumentM causes the Decoder to always unmarshal documents into the primitive.M type. This +// behavior is restricted to data typed as "interface{}" or "map[string]interface{}". +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.DefaultDocumentM] instead. +func (dc *DecodeContext) DefaultDocumentM() { + dc.defaultDocumentType = reflect.TypeOf(primitive.M{}) +} + +// DefaultDocumentD causes the Decoder to always unmarshal documents into the primitive.D type. This +// behavior is restricted to data typed as "interface{}" or "map[string]interface{}". +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.DefaultDocumentD] instead. +func (dc *DecodeContext) DefaultDocumentD() { + dc.defaultDocumentType = reflect.TypeOf(primitive.D{}) +} + +// ValueCodec is an interface for encoding and decoding a reflect.Value. // values. +// +// Deprecated: Use [ValueEncoder] and [ValueDecoder] instead. type ValueCodec interface { ValueEncoder ValueDecoder @@ -211,6 +373,10 @@ func decodeTypeOrValueWithInfo(vd ValueDecoder, td typeDecoder, dc DecodeContext // CodecZeroer is the interface implemented by Codecs that can also determine if // a value of the type that would be encoded is zero. +// +// Deprecated: Defining custom rules for the zero/empty value will not be supported in Go Driver +// 2.0. Users who want to omit empty complex values should use a pointer field and set the value to +// nil instead. type CodecZeroer interface { IsTypeZero(interface{}) bool } diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/byte_slice_codec.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/byte_slice_codec.go index 5a916cc159..0134b5a94b 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/byte_slice_codec.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/byte_slice_codec.go @@ -16,18 +16,45 @@ import ( ) // ByteSliceCodec is the Codec used for []byte values. +// +// Deprecated: ByteSliceCodec will not be directly configurable in Go Driver +// 2.0. To configure the byte slice encode and decode behavior, use the +// configuration methods on a [go.mongodb.org/mongo-driver/bson.Encoder] or +// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the byte slice +// encode and decode behavior for a mongo.Client, use +// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions]. +// +// For example, to configure a mongo.Client to encode nil byte slices as empty +// BSON binary values, use: +// +// opt := options.Client().SetBSONOptions(&options.BSONOptions{ +// NilByteSliceAsEmpty: true, +// }) +// +// See the deprecation notice for each field in ByteSliceCodec for the +// corresponding settings. type ByteSliceCodec struct { + // EncodeNilAsEmpty causes EncodeValue to marshal nil Go byte slices as empty BSON binary values + // instead of BSON null. + // + // Deprecated: Use bson.Encoder.NilByteSliceAsEmpty or options.BSONOptions.NilByteSliceAsEmpty + // instead. EncodeNilAsEmpty bool } var ( defaultByteSliceCodec = NewByteSliceCodec() - _ ValueCodec = defaultByteSliceCodec + // Assert that defaultByteSliceCodec satisfies the typeDecoder interface, which allows it to be + // used by collection type decoders (e.g. map, slice, etc) to set individual values in a + // collection. _ typeDecoder = defaultByteSliceCodec ) -// NewByteSliceCodec returns a StringCodec with options opts. +// NewByteSliceCodec returns a ByteSliceCodec with options opts. +// +// Deprecated: NewByteSliceCodec will not be available in Go Driver 2.0. See +// [ByteSliceCodec] for more details. func NewByteSliceCodec(opts ...*bsonoptions.ByteSliceCodecOptions) *ByteSliceCodec { byteSliceOpt := bsonoptions.MergeByteSliceCodecOptions(opts...) codec := ByteSliceCodec{} @@ -42,13 +69,13 @@ func (bsc *ByteSliceCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, if !val.IsValid() || val.Type() != tByteSlice { return ValueEncoderError{Name: "ByteSliceEncodeValue", Types: []reflect.Type{tByteSlice}, Received: val} } - if val.IsNil() && !bsc.EncodeNilAsEmpty { + if val.IsNil() && !bsc.EncodeNilAsEmpty && !ec.nilByteSliceAsEmpty { return vw.WriteNull() } return vw.WriteBinary(val.Interface().([]byte)) } -func (bsc *ByteSliceCodec) decodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (bsc *ByteSliceCodec) decodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t != tByteSlice { return emptyValue, ValueDecoderError{ Name: "ByteSliceDecodeValue", diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/codec_cache.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/codec_cache.go new file mode 100644 index 0000000000..844b50299f --- /dev/null +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/codec_cache.go @@ -0,0 +1,166 @@ +// Copyright (C) MongoDB, Inc. 2017-present. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +package bsoncodec + +import ( + "reflect" + "sync" + "sync/atomic" +) + +// Runtime check that the kind encoder and decoder caches can store any valid +// reflect.Kind constant. +func init() { + if s := reflect.Kind(len(kindEncoderCache{}.entries)).String(); s != "kind27" { + panic("The capacity of kindEncoderCache is too small.\n" + + "This is due to a new type being added to reflect.Kind.") + } +} + +// statically assert array size +var _ = (kindEncoderCache{}).entries[reflect.UnsafePointer] +var _ = (kindDecoderCache{}).entries[reflect.UnsafePointer] + +type typeEncoderCache struct { + cache sync.Map // map[reflect.Type]ValueEncoder +} + +func (c *typeEncoderCache) Store(rt reflect.Type, enc ValueEncoder) { + c.cache.Store(rt, enc) +} + +func (c *typeEncoderCache) Load(rt reflect.Type) (ValueEncoder, bool) { + if v, _ := c.cache.Load(rt); v != nil { + return v.(ValueEncoder), true + } + return nil, false +} + +func (c *typeEncoderCache) LoadOrStore(rt reflect.Type, enc ValueEncoder) ValueEncoder { + if v, loaded := c.cache.LoadOrStore(rt, enc); loaded { + enc = v.(ValueEncoder) + } + return enc +} + +func (c *typeEncoderCache) Clone() *typeEncoderCache { + cc := new(typeEncoderCache) + c.cache.Range(func(k, v interface{}) bool { + if k != nil && v != nil { + cc.cache.Store(k, v) + } + return true + }) + return cc +} + +type typeDecoderCache struct { + cache sync.Map // map[reflect.Type]ValueDecoder +} + +func (c *typeDecoderCache) Store(rt reflect.Type, dec ValueDecoder) { + c.cache.Store(rt, dec) +} + +func (c *typeDecoderCache) Load(rt reflect.Type) (ValueDecoder, bool) { + if v, _ := c.cache.Load(rt); v != nil { + return v.(ValueDecoder), true + } + return nil, false +} + +func (c *typeDecoderCache) LoadOrStore(rt reflect.Type, dec ValueDecoder) ValueDecoder { + if v, loaded := c.cache.LoadOrStore(rt, dec); loaded { + dec = v.(ValueDecoder) + } + return dec +} + +func (c *typeDecoderCache) Clone() *typeDecoderCache { + cc := new(typeDecoderCache) + c.cache.Range(func(k, v interface{}) bool { + if k != nil && v != nil { + cc.cache.Store(k, v) + } + return true + }) + return cc +} + +// atomic.Value requires that all calls to Store() have the same concrete type +// so we wrap the ValueEncoder with a kindEncoderCacheEntry to ensure the type +// is always the same (since different concrete types may implement the +// ValueEncoder interface). +type kindEncoderCacheEntry struct { + enc ValueEncoder +} + +type kindEncoderCache struct { + entries [reflect.UnsafePointer + 1]atomic.Value // *kindEncoderCacheEntry +} + +func (c *kindEncoderCache) Store(rt reflect.Kind, enc ValueEncoder) { + if enc != nil && rt < reflect.Kind(len(c.entries)) { + c.entries[rt].Store(&kindEncoderCacheEntry{enc: enc}) + } +} + +func (c *kindEncoderCache) Load(rt reflect.Kind) (ValueEncoder, bool) { + if rt < reflect.Kind(len(c.entries)) { + if ent, ok := c.entries[rt].Load().(*kindEncoderCacheEntry); ok { + return ent.enc, ent.enc != nil + } + } + return nil, false +} + +func (c *kindEncoderCache) Clone() *kindEncoderCache { + cc := new(kindEncoderCache) + for i, v := range c.entries { + if val := v.Load(); val != nil { + cc.entries[i].Store(val) + } + } + return cc +} + +// atomic.Value requires that all calls to Store() have the same concrete type +// so we wrap the ValueDecoder with a kindDecoderCacheEntry to ensure the type +// is always the same (since different concrete types may implement the +// ValueDecoder interface). +type kindDecoderCacheEntry struct { + dec ValueDecoder +} + +type kindDecoderCache struct { + entries [reflect.UnsafePointer + 1]atomic.Value // *kindDecoderCacheEntry +} + +func (c *kindDecoderCache) Store(rt reflect.Kind, dec ValueDecoder) { + if rt < reflect.Kind(len(c.entries)) { + c.entries[rt].Store(&kindDecoderCacheEntry{dec: dec}) + } +} + +func (c *kindDecoderCache) Load(rt reflect.Kind) (ValueDecoder, bool) { + if rt < reflect.Kind(len(c.entries)) { + if ent, ok := c.entries[rt].Load().(*kindDecoderCacheEntry); ok { + return ent.dec, ent.dec != nil + } + } + return nil, false +} + +func (c *kindDecoderCache) Clone() *kindDecoderCache { + cc := new(kindDecoderCache) + for i, v := range c.entries { + if val := v.Load(); val != nil { + cc.entries[i].Store(val) + } + } + return cc +} diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go index 18919e3c40..7e08aab35e 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go @@ -24,7 +24,7 @@ import ( var ( defaultValueDecoders DefaultValueDecoders - errCannotTruncate = errors.New("float64 can only be truncated to an integer type when truncation is enabled") + errCannotTruncate = errors.New("float64 can only be truncated to a lower precision type when truncation is enabled") ) type decodeBinaryError struct { @@ -41,21 +41,27 @@ func newDefaultStructCodec() *StructCodec { if err != nil { // This function is called from the codec registration path, so errors can't be propagated. If there's an error // constructing the StructCodec, we panic to avoid losing it. - panic(fmt.Errorf("error creating default StructCodec: %v", err)) + panic(fmt.Errorf("error creating default StructCodec: %w", err)) } return codec } // DefaultValueDecoders is a namespace type for the default ValueDecoders used // when creating a registry. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. type DefaultValueDecoders struct{} // RegisterDefaultDecoders will register the decoder methods attached to DefaultValueDecoders with // the provided RegistryBuilder. // -// There is no support for decoding map[string]interface{} becuase there is no decoder for +// There is no support for decoding map[string]interface{} because there is no decoder for // interface{}, so users must either register this decoder themselves or use the -// EmptyInterfaceDecoder avaialble in the bson package. +// EmptyInterfaceDecoder available in the bson package. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) RegisterDefaultDecoders(rb *RegistryBuilder) { if rb == nil { panic(errors.New("argument to RegisterDefaultDecoders must not be nil")) @@ -132,6 +138,9 @@ func (dvd DefaultValueDecoders) RegisterDefaultDecoders(rb *RegistryBuilder) { } // DDecodeValue is the ValueDecoderFunc for primitive.D instances. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) DDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.IsValid() || !val.CanSet() || val.Type() != tD { return ValueDecoderError{Name: "DDecodeValue", Kinds: []reflect.Kind{reflect.Slice}, Received: val} @@ -169,7 +178,7 @@ func (dvd DefaultValueDecoders) DDecodeValue(dc DecodeContext, vr bsonrw.ValueRe for { key, elemVr, err := dr.ReadElement() - if err == bsonrw.ErrEOD { + if errors.Is(err, bsonrw.ErrEOD) { break } else if err != nil { return err @@ -188,7 +197,7 @@ func (dvd DefaultValueDecoders) DDecodeValue(dc DecodeContext, vr bsonrw.ValueRe return nil } -func (dvd DefaultValueDecoders) booleanDecodeType(dctx DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (dvd DefaultValueDecoders) booleanDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t.Kind() != reflect.Bool { return emptyValue, ValueDecoderError{ Name: "BooleanDecodeValue", @@ -235,6 +244,9 @@ func (dvd DefaultValueDecoders) booleanDecodeType(dctx DecodeContext, vr bsonrw. } // BooleanDecodeValue is the ValueDecoderFunc for bool types. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) BooleanDecodeValue(dctx DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.IsValid() || !val.CanSet() || val.Kind() != reflect.Bool { return ValueDecoderError{Name: "BooleanDecodeValue", Kinds: []reflect.Kind{reflect.Bool}, Received: val} @@ -333,6 +345,9 @@ func (DefaultValueDecoders) intDecodeType(dc DecodeContext, vr bsonrw.ValueReade } // IntDecodeValue is the ValueDecoderFunc for int types. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) IntDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() { return ValueDecoderError{ @@ -434,7 +449,7 @@ func (dvd DefaultValueDecoders) UintDecodeValue(dc DecodeContext, vr bsonrw.Valu return nil } -func (dvd DefaultValueDecoders) floatDecodeType(ec DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (dvd DefaultValueDecoders) floatDecodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { var f float64 var err error switch vrType := vr.Type(); vrType { @@ -477,7 +492,7 @@ func (dvd DefaultValueDecoders) floatDecodeType(ec DecodeContext, vr bsonrw.Valu switch t.Kind() { case reflect.Float32: - if !ec.Truncate && float64(float32(f)) != f { + if !dc.Truncate && float64(float32(f)) != f { return emptyValue, errCannotTruncate } @@ -494,6 +509,9 @@ func (dvd DefaultValueDecoders) floatDecodeType(ec DecodeContext, vr bsonrw.Valu } // FloatDecodeValue is the ValueDecoderFunc for float types. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) FloatDecodeValue(ec DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() { return ValueDecoderError{ @@ -515,7 +533,7 @@ func (dvd DefaultValueDecoders) FloatDecodeValue(ec DecodeContext, vr bsonrw.Val // StringDecodeValue is the ValueDecoderFunc for string types. // // Deprecated: StringDecodeValue is not registered by default. Use StringCodec.DecodeValue instead. -func (dvd DefaultValueDecoders) StringDecodeValue(dctx DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { +func (dvd DefaultValueDecoders) StringDecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { var str string var err error switch vr.Type() { @@ -536,7 +554,7 @@ func (dvd DefaultValueDecoders) StringDecodeValue(dctx DecodeContext, vr bsonrw. return nil } -func (DefaultValueDecoders) javaScriptDecodeType(dctx DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (DefaultValueDecoders) javaScriptDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t != tJavaScript { return emptyValue, ValueDecoderError{ Name: "JavaScriptDecodeValue", @@ -565,6 +583,9 @@ func (DefaultValueDecoders) javaScriptDecodeType(dctx DecodeContext, vr bsonrw.V } // JavaScriptDecodeValue is the ValueDecoderFunc for the primitive.JavaScript type. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) JavaScriptDecodeValue(dctx DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tJavaScript { return ValueDecoderError{Name: "JavaScriptDecodeValue", Types: []reflect.Type{tJavaScript}, Received: val} @@ -579,7 +600,7 @@ func (dvd DefaultValueDecoders) JavaScriptDecodeValue(dctx DecodeContext, vr bso return nil } -func (DefaultValueDecoders) symbolDecodeType(dctx DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (DefaultValueDecoders) symbolDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t != tSymbol { return emptyValue, ValueDecoderError{ Name: "SymbolDecodeValue", @@ -620,6 +641,9 @@ func (DefaultValueDecoders) symbolDecodeType(dctx DecodeContext, vr bsonrw.Value } // SymbolDecodeValue is the ValueDecoderFunc for the primitive.Symbol type. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) SymbolDecodeValue(dctx DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tSymbol { return ValueDecoderError{Name: "SymbolDecodeValue", Types: []reflect.Type{tSymbol}, Received: val} @@ -634,7 +658,7 @@ func (dvd DefaultValueDecoders) SymbolDecodeValue(dctx DecodeContext, vr bsonrw. return nil } -func (DefaultValueDecoders) binaryDecodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (DefaultValueDecoders) binaryDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t != tBinary { return emptyValue, ValueDecoderError{ Name: "BinaryDecodeValue", @@ -664,6 +688,9 @@ func (DefaultValueDecoders) binaryDecodeType(dc DecodeContext, vr bsonrw.ValueRe } // BinaryDecodeValue is the ValueDecoderFunc for Binary. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) BinaryDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tBinary { return ValueDecoderError{Name: "BinaryDecodeValue", Types: []reflect.Type{tBinary}, Received: val} @@ -678,7 +705,7 @@ func (dvd DefaultValueDecoders) BinaryDecodeValue(dc DecodeContext, vr bsonrw.Va return nil } -func (DefaultValueDecoders) undefinedDecodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (DefaultValueDecoders) undefinedDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t != tUndefined { return emptyValue, ValueDecoderError{ Name: "UndefinedDecodeValue", @@ -704,6 +731,9 @@ func (DefaultValueDecoders) undefinedDecodeType(dc DecodeContext, vr bsonrw.Valu } // UndefinedDecodeValue is the ValueDecoderFunc for Undefined. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) UndefinedDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tUndefined { return ValueDecoderError{Name: "UndefinedDecodeValue", Types: []reflect.Type{tUndefined}, Received: val} @@ -719,7 +749,7 @@ func (dvd DefaultValueDecoders) UndefinedDecodeValue(dc DecodeContext, vr bsonrw } // Accept both 12-byte string and pretty-printed 24-byte hex string formats. -func (dvd DefaultValueDecoders) objectIDDecodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (dvd DefaultValueDecoders) objectIDDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t != tOID { return emptyValue, ValueDecoderError{ Name: "ObjectIDDecodeValue", @@ -765,6 +795,9 @@ func (dvd DefaultValueDecoders) objectIDDecodeType(dc DecodeContext, vr bsonrw.V } // ObjectIDDecodeValue is the ValueDecoderFunc for primitive.ObjectID. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) ObjectIDDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tOID { return ValueDecoderError{Name: "ObjectIDDecodeValue", Types: []reflect.Type{tOID}, Received: val} @@ -779,7 +812,7 @@ func (dvd DefaultValueDecoders) ObjectIDDecodeValue(dc DecodeContext, vr bsonrw. return nil } -func (DefaultValueDecoders) dateTimeDecodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (DefaultValueDecoders) dateTimeDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t != tDateTime { return emptyValue, ValueDecoderError{ Name: "DateTimeDecodeValue", @@ -808,6 +841,9 @@ func (DefaultValueDecoders) dateTimeDecodeType(dc DecodeContext, vr bsonrw.Value } // DateTimeDecodeValue is the ValueDecoderFunc for DateTime. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) DateTimeDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tDateTime { return ValueDecoderError{Name: "DateTimeDecodeValue", Types: []reflect.Type{tDateTime}, Received: val} @@ -822,7 +858,7 @@ func (dvd DefaultValueDecoders) DateTimeDecodeValue(dc DecodeContext, vr bsonrw. return nil } -func (DefaultValueDecoders) nullDecodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (DefaultValueDecoders) nullDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t != tNull { return emptyValue, ValueDecoderError{ Name: "NullDecodeValue", @@ -848,6 +884,9 @@ func (DefaultValueDecoders) nullDecodeType(dc DecodeContext, vr bsonrw.ValueRead } // NullDecodeValue is the ValueDecoderFunc for Null. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) NullDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tNull { return ValueDecoderError{Name: "NullDecodeValue", Types: []reflect.Type{tNull}, Received: val} @@ -862,7 +901,7 @@ func (dvd DefaultValueDecoders) NullDecodeValue(dc DecodeContext, vr bsonrw.Valu return nil } -func (DefaultValueDecoders) regexDecodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (DefaultValueDecoders) regexDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t != tRegex { return emptyValue, ValueDecoderError{ Name: "RegexDecodeValue", @@ -891,6 +930,9 @@ func (DefaultValueDecoders) regexDecodeType(dc DecodeContext, vr bsonrw.ValueRea } // RegexDecodeValue is the ValueDecoderFunc for Regex. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) RegexDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tRegex { return ValueDecoderError{Name: "RegexDecodeValue", Types: []reflect.Type{tRegex}, Received: val} @@ -905,7 +947,7 @@ func (dvd DefaultValueDecoders) RegexDecodeValue(dc DecodeContext, vr bsonrw.Val return nil } -func (DefaultValueDecoders) dBPointerDecodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (DefaultValueDecoders) dBPointerDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t != tDBPointer { return emptyValue, ValueDecoderError{ Name: "DBPointerDecodeValue", @@ -935,6 +977,9 @@ func (DefaultValueDecoders) dBPointerDecodeType(dc DecodeContext, vr bsonrw.Valu } // DBPointerDecodeValue is the ValueDecoderFunc for DBPointer. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) DBPointerDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tDBPointer { return ValueDecoderError{Name: "DBPointerDecodeValue", Types: []reflect.Type{tDBPointer}, Received: val} @@ -949,7 +994,7 @@ func (dvd DefaultValueDecoders) DBPointerDecodeValue(dc DecodeContext, vr bsonrw return nil } -func (DefaultValueDecoders) timestampDecodeType(dc DecodeContext, vr bsonrw.ValueReader, reflectType reflect.Type) (reflect.Value, error) { +func (DefaultValueDecoders) timestampDecodeType(_ DecodeContext, vr bsonrw.ValueReader, reflectType reflect.Type) (reflect.Value, error) { if reflectType != tTimestamp { return emptyValue, ValueDecoderError{ Name: "TimestampDecodeValue", @@ -978,6 +1023,9 @@ func (DefaultValueDecoders) timestampDecodeType(dc DecodeContext, vr bsonrw.Valu } // TimestampDecodeValue is the ValueDecoderFunc for Timestamp. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) TimestampDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tTimestamp { return ValueDecoderError{Name: "TimestampDecodeValue", Types: []reflect.Type{tTimestamp}, Received: val} @@ -992,7 +1040,7 @@ func (dvd DefaultValueDecoders) TimestampDecodeValue(dc DecodeContext, vr bsonrw return nil } -func (DefaultValueDecoders) minKeyDecodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (DefaultValueDecoders) minKeyDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t != tMinKey { return emptyValue, ValueDecoderError{ Name: "MinKeyDecodeValue", @@ -1020,6 +1068,9 @@ func (DefaultValueDecoders) minKeyDecodeType(dc DecodeContext, vr bsonrw.ValueRe } // MinKeyDecodeValue is the ValueDecoderFunc for MinKey. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) MinKeyDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tMinKey { return ValueDecoderError{Name: "MinKeyDecodeValue", Types: []reflect.Type{tMinKey}, Received: val} @@ -1034,7 +1085,7 @@ func (dvd DefaultValueDecoders) MinKeyDecodeValue(dc DecodeContext, vr bsonrw.Va return nil } -func (DefaultValueDecoders) maxKeyDecodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (DefaultValueDecoders) maxKeyDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t != tMaxKey { return emptyValue, ValueDecoderError{ Name: "MaxKeyDecodeValue", @@ -1062,6 +1113,9 @@ func (DefaultValueDecoders) maxKeyDecodeType(dc DecodeContext, vr bsonrw.ValueRe } // MaxKeyDecodeValue is the ValueDecoderFunc for MaxKey. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) MaxKeyDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tMaxKey { return ValueDecoderError{Name: "MaxKeyDecodeValue", Types: []reflect.Type{tMaxKey}, Received: val} @@ -1076,7 +1130,7 @@ func (dvd DefaultValueDecoders) MaxKeyDecodeValue(dc DecodeContext, vr bsonrw.Va return nil } -func (dvd DefaultValueDecoders) decimal128DecodeType(dctx DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (dvd DefaultValueDecoders) decimal128DecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t != tDecimal { return emptyValue, ValueDecoderError{ Name: "Decimal128DecodeValue", @@ -1105,6 +1159,9 @@ func (dvd DefaultValueDecoders) decimal128DecodeType(dctx DecodeContext, vr bson } // Decimal128DecodeValue is the ValueDecoderFunc for primitive.Decimal128. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) Decimal128DecodeValue(dctx DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tDecimal { return ValueDecoderError{Name: "Decimal128DecodeValue", Types: []reflect.Type{tDecimal}, Received: val} @@ -1119,7 +1176,7 @@ func (dvd DefaultValueDecoders) Decimal128DecodeValue(dctx DecodeContext, vr bso return nil } -func (dvd DefaultValueDecoders) jsonNumberDecodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (dvd DefaultValueDecoders) jsonNumberDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t != tJSONNumber { return emptyValue, ValueDecoderError{ Name: "JSONNumberDecodeValue", @@ -1164,6 +1221,9 @@ func (dvd DefaultValueDecoders) jsonNumberDecodeType(dc DecodeContext, vr bsonrw } // JSONNumberDecodeValue is the ValueDecoderFunc for json.Number. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) JSONNumberDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tJSONNumber { return ValueDecoderError{Name: "JSONNumberDecodeValue", Types: []reflect.Type{tJSONNumber}, Received: val} @@ -1178,7 +1238,7 @@ func (dvd DefaultValueDecoders) JSONNumberDecodeValue(dc DecodeContext, vr bsonr return nil } -func (dvd DefaultValueDecoders) urlDecodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (dvd DefaultValueDecoders) urlDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t != tURL { return emptyValue, ValueDecoderError{ Name: "URLDecodeValue", @@ -1213,6 +1273,9 @@ func (dvd DefaultValueDecoders) urlDecodeType(dc DecodeContext, vr bsonrw.ValueR } // URLDecodeValue is the ValueDecoderFunc for url.URL. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) URLDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tURL { return ValueDecoderError{Name: "URLDecodeValue", Types: []reflect.Type{tURL}, Received: val} @@ -1230,7 +1293,7 @@ func (dvd DefaultValueDecoders) URLDecodeValue(dc DecodeContext, vr bsonrw.Value // TimeDecodeValue is the ValueDecoderFunc for time.Time. // // Deprecated: TimeDecodeValue is not registered by default. Use TimeCodec.DecodeValue instead. -func (dvd DefaultValueDecoders) TimeDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { +func (dvd DefaultValueDecoders) TimeDecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if vr.Type() != bsontype.DateTime { return fmt.Errorf("cannot decode %v into a time.Time", vr.Type()) } @@ -1251,7 +1314,7 @@ func (dvd DefaultValueDecoders) TimeDecodeValue(dc DecodeContext, vr bsonrw.Valu // ByteSliceDecodeValue is the ValueDecoderFunc for []byte. // // Deprecated: ByteSliceDecodeValue is not registered by default. Use ByteSliceCodec.DecodeValue instead. -func (dvd DefaultValueDecoders) ByteSliceDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { +func (dvd DefaultValueDecoders) ByteSliceDecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if vr.Type() != bsontype.Binary && vr.Type() != bsontype.Null { return fmt.Errorf("cannot decode %v into a []byte", vr.Type()) } @@ -1316,7 +1379,7 @@ func (dvd DefaultValueDecoders) MapDecodeValue(dc DecodeContext, vr bsonrw.Value keyType := val.Type().Key() for { key, vr, err := dr.ReadElement() - if err == bsonrw.ErrEOD { + if errors.Is(err, bsonrw.ErrEOD) { break } if err != nil { @@ -1336,6 +1399,9 @@ func (dvd DefaultValueDecoders) MapDecodeValue(dc DecodeContext, vr bsonrw.Value } // ArrayDecodeValue is the ValueDecoderFunc for array types. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) ArrayDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.IsValid() || val.Kind() != reflect.Array { return ValueDecoderError{Name: "ArrayDecodeValue", Kinds: []reflect.Kind{reflect.Array}, Received: val} @@ -1447,7 +1513,10 @@ func (dvd DefaultValueDecoders) SliceDecodeValue(dc DecodeContext, vr bsonrw.Val } // ValueUnmarshalerDecodeValue is the ValueDecoderFunc for ValueUnmarshaler implementations. -func (dvd DefaultValueDecoders) ValueUnmarshalerDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. +func (dvd DefaultValueDecoders) ValueUnmarshalerDecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.IsValid() || (!val.Type().Implements(tValueUnmarshaler) && !reflect.PtrTo(val.Type()).Implements(tValueUnmarshaler)) { return ValueDecoderError{Name: "ValueUnmarshalerDecodeValue", Types: []reflect.Type{tValueUnmarshaler}, Received: val} } @@ -1463,7 +1532,7 @@ func (dvd DefaultValueDecoders) ValueUnmarshalerDecodeValue(dc DecodeContext, vr if !val.CanAddr() { return ValueDecoderError{Name: "ValueUnmarshalerDecodeValue", Types: []reflect.Type{tValueUnmarshaler}, Received: val} } - val = val.Addr() // If they type doesn't implement the interface, a pointer to it must. + val = val.Addr() // If the type doesn't implement the interface, a pointer to it must. } t, src, err := bsonrw.Copier{}.CopyValueToBytes(vr) @@ -1471,16 +1540,19 @@ func (dvd DefaultValueDecoders) ValueUnmarshalerDecodeValue(dc DecodeContext, vr return err } - fn := val.Convert(tValueUnmarshaler).MethodByName("UnmarshalBSONValue") - errVal := fn.Call([]reflect.Value{reflect.ValueOf(t), reflect.ValueOf(src)})[0] - if !errVal.IsNil() { - return errVal.Interface().(error) + m, ok := val.Interface().(ValueUnmarshaler) + if !ok { + // NB: this error should be unreachable due to the above checks + return ValueDecoderError{Name: "ValueUnmarshalerDecodeValue", Types: []reflect.Type{tValueUnmarshaler}, Received: val} } - return nil + return m.UnmarshalBSONValue(t, src) } // UnmarshalerDecodeValue is the ValueDecoderFunc for Unmarshaler implementations. -func (dvd DefaultValueDecoders) UnmarshalerDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. +func (dvd DefaultValueDecoders) UnmarshalerDecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.IsValid() || (!val.Type().Implements(tUnmarshaler) && !reflect.PtrTo(val.Type()).Implements(tUnmarshaler)) { return ValueDecoderError{Name: "UnmarshalerDecodeValue", Types: []reflect.Type{tUnmarshaler}, Received: val} } @@ -1492,24 +1564,36 @@ func (dvd DefaultValueDecoders) UnmarshalerDecodeValue(dc DecodeContext, vr bson val.Set(reflect.New(val.Type().Elem())) } + _, src, err := bsonrw.Copier{}.CopyValueToBytes(vr) + if err != nil { + return err + } + + // If the target Go value is a pointer and the BSON field value is empty, set the value to the + // zero value of the pointer (nil) and don't call UnmarshalBSON. UnmarshalBSON has no way to + // change the pointer value from within the function (only the value at the pointer address), + // so it can't set the pointer to "nil" itself. Since the most common Go value for an empty BSON + // field value is "nil", we set "nil" here and don't call UnmarshalBSON. This behavior matches + // the behavior of the Go "encoding/json" unmarshaler when the target Go value is a pointer and + // the JSON field value is "null". + if val.Kind() == reflect.Ptr && len(src) == 0 { + val.Set(reflect.Zero(val.Type())) + return nil + } + if !val.Type().Implements(tUnmarshaler) { if !val.CanAddr() { return ValueDecoderError{Name: "UnmarshalerDecodeValue", Types: []reflect.Type{tUnmarshaler}, Received: val} } - val = val.Addr() // If they type doesn't implement the interface, a pointer to it must. + val = val.Addr() // If the type doesn't implement the interface, a pointer to it must. } - _, src, err := bsonrw.Copier{}.CopyValueToBytes(vr) - if err != nil { - return err - } - - fn := val.Convert(tUnmarshaler).MethodByName("UnmarshalBSON") - errVal := fn.Call([]reflect.Value{reflect.ValueOf(src)})[0] - if !errVal.IsNil() { - return errVal.Interface().(error) + m, ok := val.Interface().(Unmarshaler) + if !ok { + // NB: this error should be unreachable due to the above checks + return ValueDecoderError{Name: "UnmarshalerDecodeValue", Types: []reflect.Type{tUnmarshaler}, Received: val} } - return nil + return m.UnmarshalBSON(src) } // EmptyInterfaceDecodeValue is the ValueDecoderFunc for interface{}. @@ -1553,7 +1637,10 @@ func (dvd DefaultValueDecoders) EmptyInterfaceDecodeValue(dc DecodeContext, vr b } // CoreDocumentDecodeValue is the ValueDecoderFunc for bsoncore.Document. -func (DefaultValueDecoders) CoreDocumentDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. +func (DefaultValueDecoders) CoreDocumentDecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tCoreDocument { return ValueDecoderError{Name: "CoreDocumentDecodeValue", Types: []reflect.Type{tCoreDocument}, Received: val} } @@ -1588,7 +1675,7 @@ func (dvd DefaultValueDecoders) decodeDefault(dc DecodeContext, vr bsonrw.ValueR idx := 0 for { vr, err := ar.ReadValue() - if err == bsonrw.ErrEOA { + if errors.Is(err, bsonrw.ErrEOA) { break } if err != nil { @@ -1659,6 +1746,9 @@ func (dvd DefaultValueDecoders) codeWithScopeDecodeType(dc DecodeContext, vr bso } // CodeWithScopeDecodeValue is the ValueDecoderFunc for CodeWithScope. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value decoders registered. func (dvd DefaultValueDecoders) CodeWithScopeDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tCodeWithScope { return ValueDecoderError{Name: "CodeWithScopeDecodeValue", Types: []reflect.Type{tCodeWithScope}, Received: val} @@ -1697,7 +1787,7 @@ func (DefaultValueDecoders) decodeElemsFromDocumentReader(dc DecodeContext, dr b elems := make([]reflect.Value, 0) for { key, vr, err := dr.ReadElement() - if err == bsonrw.ErrEOD { + if errors.Is(err, bsonrw.ErrEOD) { break } if err != nil { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go index 49a0c3f14b..4751ae995e 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go @@ -30,7 +30,7 @@ var errInvalidValue = errors.New("cannot encode invalid element") var sliceWriterPool = sync.Pool{ New: func() interface{} { - sw := make(bsonrw.SliceWriter, 0, 0) + sw := make(bsonrw.SliceWriter, 0) return &sw }, } @@ -58,10 +58,16 @@ func encodeElement(ec EncodeContext, dw bsonrw.DocumentWriter, e primitive.E) er // DefaultValueEncoders is a namespace type for the default ValueEncoders used // when creating a registry. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. type DefaultValueEncoders struct{} // RegisterDefaultEncoders will register the encoder methods attached to DefaultValueEncoders with // the provided RegistryBuilder. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. func (dve DefaultValueEncoders) RegisterDefaultEncoders(rb *RegistryBuilder) { if rb == nil { panic(errors.New("argument to RegisterDefaultEncoders must not be nil")) @@ -113,7 +119,10 @@ func (dve DefaultValueEncoders) RegisterDefaultEncoders(rb *RegistryBuilder) { } // BooleanEncodeValue is the ValueEncoderFunc for bool types. -func (dve DefaultValueEncoders) BooleanEncodeValue(ectx EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (dve DefaultValueEncoders) BooleanEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Kind() != reflect.Bool { return ValueEncoderError{Name: "BooleanEncodeValue", Kinds: []reflect.Kind{reflect.Bool}, Received: val} } @@ -125,6 +134,9 @@ func fitsIn32Bits(i int64) bool { } // IntEncodeValue is the ValueEncoderFunc for int types. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. func (dve DefaultValueEncoders) IntEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { switch val.Kind() { case reflect.Int8, reflect.Int16, reflect.Int32: @@ -176,7 +188,10 @@ func (dve DefaultValueEncoders) UintEncodeValue(ec EncodeContext, vw bsonrw.Valu } // FloatEncodeValue is the ValueEncoderFunc for float types. -func (dve DefaultValueEncoders) FloatEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (dve DefaultValueEncoders) FloatEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { switch val.Kind() { case reflect.Float32, reflect.Float64: return vw.WriteDouble(val.Float()) @@ -188,7 +203,7 @@ func (dve DefaultValueEncoders) FloatEncodeValue(ec EncodeContext, vw bsonrw.Val // StringEncodeValue is the ValueEncoderFunc for string types. // // Deprecated: StringEncodeValue is not registered by default. Use StringCodec.EncodeValue instead. -func (dve DefaultValueEncoders) StringEncodeValue(ectx EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +func (dve DefaultValueEncoders) StringEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if val.Kind() != reflect.String { return ValueEncoderError{ Name: "StringEncodeValue", @@ -201,7 +216,10 @@ func (dve DefaultValueEncoders) StringEncodeValue(ectx EncodeContext, vw bsonrw. } // ObjectIDEncodeValue is the ValueEncoderFunc for primitive.ObjectID. -func (dve DefaultValueEncoders) ObjectIDEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (dve DefaultValueEncoders) ObjectIDEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tOID { return ValueEncoderError{Name: "ObjectIDEncodeValue", Types: []reflect.Type{tOID}, Received: val} } @@ -209,7 +227,10 @@ func (dve DefaultValueEncoders) ObjectIDEncodeValue(ec EncodeContext, vw bsonrw. } // Decimal128EncodeValue is the ValueEncoderFunc for primitive.Decimal128. -func (dve DefaultValueEncoders) Decimal128EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (dve DefaultValueEncoders) Decimal128EncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tDecimal { return ValueEncoderError{Name: "Decimal128EncodeValue", Types: []reflect.Type{tDecimal}, Received: val} } @@ -217,6 +238,9 @@ func (dve DefaultValueEncoders) Decimal128EncodeValue(ec EncodeContext, vw bsonr } // JSONNumberEncodeValue is the ValueEncoderFunc for json.Number. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. func (dve DefaultValueEncoders) JSONNumberEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tJSONNumber { return ValueEncoderError{Name: "JSONNumberEncodeValue", Types: []reflect.Type{tJSONNumber}, Received: val} @@ -237,7 +261,10 @@ func (dve DefaultValueEncoders) JSONNumberEncodeValue(ec EncodeContext, vw bsonr } // URLEncodeValue is the ValueEncoderFunc for url.URL. -func (dve DefaultValueEncoders) URLEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (dve DefaultValueEncoders) URLEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tURL { return ValueEncoderError{Name: "URLEncodeValue", Types: []reflect.Type{tURL}, Received: val} } @@ -248,7 +275,7 @@ func (dve DefaultValueEncoders) URLEncodeValue(ec EncodeContext, vw bsonrw.Value // TimeEncodeValue is the ValueEncoderFunc for time.TIme. // // Deprecated: TimeEncodeValue is not registered by default. Use TimeCodec.EncodeValue instead. -func (dve DefaultValueEncoders) TimeEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +func (dve DefaultValueEncoders) TimeEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tTime { return ValueEncoderError{Name: "TimeEncodeValue", Types: []reflect.Type{tTime}, Received: val} } @@ -260,7 +287,7 @@ func (dve DefaultValueEncoders) TimeEncodeValue(ec EncodeContext, vw bsonrw.Valu // ByteSliceEncodeValue is the ValueEncoderFunc for []byte. // // Deprecated: ByteSliceEncodeValue is not registered by default. Use ByteSliceCodec.EncodeValue instead. -func (dve DefaultValueEncoders) ByteSliceEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +func (dve DefaultValueEncoders) ByteSliceEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tByteSlice { return ValueEncoderError{Name: "ByteSliceEncodeValue", Types: []reflect.Type{tByteSlice}, Received: val} } @@ -316,7 +343,7 @@ func (dve DefaultValueEncoders) mapEncodeValue(ec EncodeContext, dw bsonrw.Docum } currEncoder, currVal, lookupErr := dve.lookupElementEncoder(ec, encoder, val.MapIndex(key)) - if lookupErr != nil && lookupErr != errInvalidValue { + if lookupErr != nil && !errors.Is(lookupErr, errInvalidValue) { return lookupErr } @@ -325,7 +352,7 @@ func (dve DefaultValueEncoders) mapEncodeValue(ec EncodeContext, dw bsonrw.Docum return err } - if lookupErr == errInvalidValue { + if errors.Is(lookupErr, errInvalidValue) { err = vw.WriteNull() if err != nil { return err @@ -333,14 +360,7 @@ func (dve DefaultValueEncoders) mapEncodeValue(ec EncodeContext, dw bsonrw.Docum continue } - if enc, ok := currEncoder.(ValueEncoder); ok { - err = enc.EncodeValue(ec, vw, currVal) - if err != nil { - return err - } - continue - } - err = encoder.EncodeValue(ec, vw, currVal) + err = currEncoder.EncodeValue(ec, vw, currVal) if err != nil { return err } @@ -350,6 +370,9 @@ func (dve DefaultValueEncoders) mapEncodeValue(ec EncodeContext, dw bsonrw.Docum } // ArrayEncodeValue is the ValueEncoderFunc for array types. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. func (dve DefaultValueEncoders) ArrayEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Kind() != reflect.Array { return ValueEncoderError{Name: "ArrayEncodeValue", Kinds: []reflect.Kind{reflect.Array}, Received: val} @@ -395,7 +418,7 @@ func (dve DefaultValueEncoders) ArrayEncodeValue(ec EncodeContext, vw bsonrw.Val for idx := 0; idx < val.Len(); idx++ { currEncoder, currVal, lookupErr := dve.lookupElementEncoder(ec, encoder, val.Index(idx)) - if lookupErr != nil && lookupErr != errInvalidValue { + if lookupErr != nil && !errors.Is(lookupErr, errInvalidValue) { return lookupErr } @@ -404,7 +427,7 @@ func (dve DefaultValueEncoders) ArrayEncodeValue(ec EncodeContext, vw bsonrw.Val return err } - if lookupErr == errInvalidValue { + if errors.Is(lookupErr, errInvalidValue) { err = vw.WriteNull() if err != nil { return err @@ -464,7 +487,7 @@ func (dve DefaultValueEncoders) SliceEncodeValue(ec EncodeContext, vw bsonrw.Val for idx := 0; idx < val.Len(); idx++ { currEncoder, currVal, lookupErr := dve.lookupElementEncoder(ec, encoder, val.Index(idx)) - if lookupErr != nil && lookupErr != errInvalidValue { + if lookupErr != nil && !errors.Is(lookupErr, errInvalidValue) { return lookupErr } @@ -473,7 +496,7 @@ func (dve DefaultValueEncoders) SliceEncodeValue(ec EncodeContext, vw bsonrw.Val return err } - if lookupErr == errInvalidValue { + if errors.Is(lookupErr, errInvalidValue) { err = vw.WriteNull() if err != nil { return err @@ -522,7 +545,10 @@ func (dve DefaultValueEncoders) EmptyInterfaceEncodeValue(ec EncodeContext, vw b } // ValueMarshalerEncodeValue is the ValueEncoderFunc for ValueMarshaler implementations. -func (dve DefaultValueEncoders) ValueMarshalerEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (dve DefaultValueEncoders) ValueMarshalerEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { // Either val or a pointer to val must implement ValueMarshaler switch { case !val.IsValid(): @@ -538,17 +564,22 @@ func (dve DefaultValueEncoders) ValueMarshalerEncodeValue(ec EncodeContext, vw b return ValueEncoderError{Name: "ValueMarshalerEncodeValue", Types: []reflect.Type{tValueMarshaler}, Received: val} } - fn := val.Convert(tValueMarshaler).MethodByName("MarshalBSONValue") - returns := fn.Call(nil) - if !returns[2].IsNil() { - return returns[2].Interface().(error) + m, ok := val.Interface().(ValueMarshaler) + if !ok { + return vw.WriteNull() + } + t, data, err := m.MarshalBSONValue() + if err != nil { + return err } - t, data := returns[0].Interface().(bsontype.Type), returns[1].Interface().([]byte) return bsonrw.Copier{}.CopyValueFromBytes(vw, t, data) } // MarshalerEncodeValue is the ValueEncoderFunc for Marshaler implementations. -func (dve DefaultValueEncoders) MarshalerEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (dve DefaultValueEncoders) MarshalerEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { // Either val or a pointer to val must implement Marshaler switch { case !val.IsValid(): @@ -564,16 +595,21 @@ func (dve DefaultValueEncoders) MarshalerEncodeValue(ec EncodeContext, vw bsonrw return ValueEncoderError{Name: "MarshalerEncodeValue", Types: []reflect.Type{tMarshaler}, Received: val} } - fn := val.Convert(tMarshaler).MethodByName("MarshalBSON") - returns := fn.Call(nil) - if !returns[1].IsNil() { - return returns[1].Interface().(error) + m, ok := val.Interface().(Marshaler) + if !ok { + return vw.WriteNull() + } + data, err := m.MarshalBSON() + if err != nil { + return err } - data := returns[0].Interface().([]byte) return bsonrw.Copier{}.CopyValueFromBytes(vw, bsontype.EmbeddedDocument, data) } // ProxyEncodeValue is the ValueEncoderFunc for Proxy implementations. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. func (dve DefaultValueEncoders) ProxyEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { // Either val or a pointer to val must implement Proxy switch { @@ -590,27 +626,38 @@ func (dve DefaultValueEncoders) ProxyEncodeValue(ec EncodeContext, vw bsonrw.Val return ValueEncoderError{Name: "ProxyEncodeValue", Types: []reflect.Type{tProxy}, Received: val} } - fn := val.Convert(tProxy).MethodByName("ProxyBSON") - returns := fn.Call(nil) - if !returns[1].IsNil() { - return returns[1].Interface().(error) + m, ok := val.Interface().(Proxy) + if !ok { + return vw.WriteNull() + } + v, err := m.ProxyBSON() + if err != nil { + return err + } + if v == nil { + encoder, err := ec.LookupEncoder(nil) + if err != nil { + return err + } + return encoder.EncodeValue(ec, vw, reflect.ValueOf(nil)) } - data := returns[0] - var encoder ValueEncoder - var err error - if data.Elem().IsValid() { - encoder, err = ec.LookupEncoder(data.Elem().Type()) - } else { - encoder, err = ec.LookupEncoder(nil) + vv := reflect.ValueOf(v) + switch vv.Kind() { + case reflect.Ptr, reflect.Interface: + vv = vv.Elem() } + encoder, err := ec.LookupEncoder(vv.Type()) if err != nil { return err } - return encoder.EncodeValue(ec, vw, data.Elem()) + return encoder.EncodeValue(ec, vw, vv) } // JavaScriptEncodeValue is the ValueEncoderFunc for the primitive.JavaScript type. -func (DefaultValueEncoders) JavaScriptEncodeValue(ectx EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (DefaultValueEncoders) JavaScriptEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tJavaScript { return ValueEncoderError{Name: "JavaScriptEncodeValue", Types: []reflect.Type{tJavaScript}, Received: val} } @@ -619,7 +666,10 @@ func (DefaultValueEncoders) JavaScriptEncodeValue(ectx EncodeContext, vw bsonrw. } // SymbolEncodeValue is the ValueEncoderFunc for the primitive.Symbol type. -func (DefaultValueEncoders) SymbolEncodeValue(ectx EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (DefaultValueEncoders) SymbolEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tSymbol { return ValueEncoderError{Name: "SymbolEncodeValue", Types: []reflect.Type{tSymbol}, Received: val} } @@ -628,7 +678,10 @@ func (DefaultValueEncoders) SymbolEncodeValue(ectx EncodeContext, vw bsonrw.Valu } // BinaryEncodeValue is the ValueEncoderFunc for Binary. -func (DefaultValueEncoders) BinaryEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (DefaultValueEncoders) BinaryEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tBinary { return ValueEncoderError{Name: "BinaryEncodeValue", Types: []reflect.Type{tBinary}, Received: val} } @@ -638,7 +691,10 @@ func (DefaultValueEncoders) BinaryEncodeValue(ec EncodeContext, vw bsonrw.ValueW } // UndefinedEncodeValue is the ValueEncoderFunc for Undefined. -func (DefaultValueEncoders) UndefinedEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (DefaultValueEncoders) UndefinedEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tUndefined { return ValueEncoderError{Name: "UndefinedEncodeValue", Types: []reflect.Type{tUndefined}, Received: val} } @@ -647,7 +703,10 @@ func (DefaultValueEncoders) UndefinedEncodeValue(ec EncodeContext, vw bsonrw.Val } // DateTimeEncodeValue is the ValueEncoderFunc for DateTime. -func (DefaultValueEncoders) DateTimeEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (DefaultValueEncoders) DateTimeEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tDateTime { return ValueEncoderError{Name: "DateTimeEncodeValue", Types: []reflect.Type{tDateTime}, Received: val} } @@ -656,7 +715,10 @@ func (DefaultValueEncoders) DateTimeEncodeValue(ec EncodeContext, vw bsonrw.Valu } // NullEncodeValue is the ValueEncoderFunc for Null. -func (DefaultValueEncoders) NullEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (DefaultValueEncoders) NullEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tNull { return ValueEncoderError{Name: "NullEncodeValue", Types: []reflect.Type{tNull}, Received: val} } @@ -665,7 +727,10 @@ func (DefaultValueEncoders) NullEncodeValue(ec EncodeContext, vw bsonrw.ValueWri } // RegexEncodeValue is the ValueEncoderFunc for Regex. -func (DefaultValueEncoders) RegexEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (DefaultValueEncoders) RegexEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tRegex { return ValueEncoderError{Name: "RegexEncodeValue", Types: []reflect.Type{tRegex}, Received: val} } @@ -676,7 +741,10 @@ func (DefaultValueEncoders) RegexEncodeValue(ec EncodeContext, vw bsonrw.ValueWr } // DBPointerEncodeValue is the ValueEncoderFunc for DBPointer. -func (DefaultValueEncoders) DBPointerEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (DefaultValueEncoders) DBPointerEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tDBPointer { return ValueEncoderError{Name: "DBPointerEncodeValue", Types: []reflect.Type{tDBPointer}, Received: val} } @@ -687,7 +755,10 @@ func (DefaultValueEncoders) DBPointerEncodeValue(ec EncodeContext, vw bsonrw.Val } // TimestampEncodeValue is the ValueEncoderFunc for Timestamp. -func (DefaultValueEncoders) TimestampEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (DefaultValueEncoders) TimestampEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tTimestamp { return ValueEncoderError{Name: "TimestampEncodeValue", Types: []reflect.Type{tTimestamp}, Received: val} } @@ -698,7 +769,10 @@ func (DefaultValueEncoders) TimestampEncodeValue(ec EncodeContext, vw bsonrw.Val } // MinKeyEncodeValue is the ValueEncoderFunc for MinKey. -func (DefaultValueEncoders) MinKeyEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (DefaultValueEncoders) MinKeyEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tMinKey { return ValueEncoderError{Name: "MinKeyEncodeValue", Types: []reflect.Type{tMinKey}, Received: val} } @@ -707,7 +781,10 @@ func (DefaultValueEncoders) MinKeyEncodeValue(ec EncodeContext, vw bsonrw.ValueW } // MaxKeyEncodeValue is the ValueEncoderFunc for MaxKey. -func (DefaultValueEncoders) MaxKeyEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (DefaultValueEncoders) MaxKeyEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tMaxKey { return ValueEncoderError{Name: "MaxKeyEncodeValue", Types: []reflect.Type{tMaxKey}, Received: val} } @@ -716,7 +793,10 @@ func (DefaultValueEncoders) MaxKeyEncodeValue(ec EncodeContext, vw bsonrw.ValueW } // CoreDocumentEncodeValue is the ValueEncoderFunc for bsoncore.Document. -func (DefaultValueEncoders) CoreDocumentEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. +func (DefaultValueEncoders) CoreDocumentEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tCoreDocument { return ValueEncoderError{Name: "CoreDocumentEncodeValue", Types: []reflect.Type{tCoreDocument}, Received: val} } @@ -727,6 +807,9 @@ func (DefaultValueEncoders) CoreDocumentEncodeValue(ec EncodeContext, vw bsonrw. } // CodeWithScopeEncodeValue is the ValueEncoderFunc for CodeWithScope. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default +// value encoders registered. func (dve DefaultValueEncoders) CodeWithScopeEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tCodeWithScope { return ValueEncoderError{Name: "CodeWithScopeEncodeValue", Types: []reflect.Type{tCodeWithScope}, Received: val} diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/doc.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/doc.go index c1e20f9489..4613e5a1ec 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/doc.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/doc.go @@ -1,3 +1,9 @@ +// Copyright (C) MongoDB, Inc. 2022-present. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + // Package bsoncodec provides a system for encoding values to BSON representations and decoding // values from BSON representations. This package considers both binary BSON and ExtendedJSON as // BSON representations. The types in this package enable a flexible system for handling this @@ -11,7 +17,7 @@ // 2) A Registry that holds these ValueEncoders and ValueDecoders and provides methods for // retrieving them. // -// ValueEncoders and ValueDecoders +// # ValueEncoders and ValueDecoders // // The ValueEncoder interface is implemented by types that can encode a provided Go type to BSON. // The value to encode is provided as a reflect.Value and a bsonrw.ValueWriter is used within the @@ -25,55 +31,60 @@ // allow the use of a function with the correct signature as a ValueDecoder. A DecodeContext // instance is provided and serves similar functionality to the EncodeContext. // -// Registry and RegistryBuilder +// # Registry // -// A Registry is an immutable store for ValueEncoders, ValueDecoders, and a type map. See the Registry type -// documentation for examples of registering various custom encoders and decoders. A Registry can be constructed using a -// RegistryBuilder, which handles three main types of codecs: +// A Registry is a store for ValueEncoders, ValueDecoders, and a type map. See the Registry type +// documentation for examples of registering various custom encoders and decoders. A Registry can +// have three main types of codecs: // -// 1. Type encoders/decoders - These can be registered using the RegisterTypeEncoder and RegisterTypeDecoder methods. -// The registered codec will be invoked when encoding/decoding a value whose type matches the registered type exactly. -// If the registered type is an interface, the codec will be invoked when encoding or decoding values whose type is the -// interface, but not for values with concrete types that implement the interface. +// 1. Type encoders/decoders - These can be registered using the RegisterTypeEncoder and +// RegisterTypeDecoder methods. The registered codec will be invoked when encoding/decoding a value +// whose type matches the registered type exactly. +// If the registered type is an interface, the codec will be invoked when encoding or decoding +// values whose type is the interface, but not for values with concrete types that implement the +// interface. // -// 2. Hook encoders/decoders - These can be registered using the RegisterHookEncoder and RegisterHookDecoder methods. -// These methods only accept interface types and the registered codecs will be invoked when encoding or decoding values -// whose types implement the interface. An example of a hook defined by the driver is bson.Marshaler. The driver will -// call the MarshalBSON method for any value whose type implements bson.Marshaler, regardless of the value's concrete -// type. +// 2. Hook encoders/decoders - These can be registered using the RegisterHookEncoder and +// RegisterHookDecoder methods. These methods only accept interface types and the registered codecs +// will be invoked when encoding or decoding values whose types implement the interface. An example +// of a hook defined by the driver is bson.Marshaler. The driver will call the MarshalBSON method +// for any value whose type implements bson.Marshaler, regardless of the value's concrete type. // -// 3. Type map entries - This can be used to associate a BSON type with a Go type. These type associations are used when -// decoding into a bson.D/bson.M or a struct field of type interface{}. For example, by default, BSON int32 and int64 -// values decode as Go int32 and int64 instances, respectively, when decoding into a bson.D. The following code would -// change the behavior so these values decode as Go int instances instead: +// 3. Type map entries - This can be used to associate a BSON type with a Go type. These type +// associations are used when decoding into a bson.D/bson.M or a struct field of type interface{}. +// For example, by default, BSON int32 and int64 values decode as Go int32 and int64 instances, +// respectively, when decoding into a bson.D. The following code would change the behavior so these +// values decode as Go int instances instead: // -// intType := reflect.TypeOf(int(0)) -// registryBuilder.RegisterTypeMapEntry(bsontype.Int32, intType).RegisterTypeMapEntry(bsontype.Int64, intType) +// intType := reflect.TypeOf(int(0)) +// registry.RegisterTypeMapEntry(bsontype.Int32, intType).RegisterTypeMapEntry(bsontype.Int64, intType) // -// 4. Kind encoder/decoders - These can be registered using the RegisterDefaultEncoder and RegisterDefaultDecoder -// methods. The registered codec will be invoked when encoding or decoding values whose reflect.Kind matches the -// registered reflect.Kind as long as the value's type doesn't match a registered type or hook encoder/decoder first. -// These methods should be used to change the behavior for all values for a specific kind. +// 4. Kind encoder/decoders - These can be registered using the RegisterDefaultEncoder and +// RegisterDefaultDecoder methods. The registered codec will be invoked when encoding or decoding +// values whose reflect.Kind matches the registered reflect.Kind as long as the value's type doesn't +// match a registered type or hook encoder/decoder first. These methods should be used to change the +// behavior for all values for a specific kind. // -// Registry Lookup Procedure +// # Registry Lookup Procedure // // When looking up an encoder in a Registry, the precedence rules are as follows: // // 1. A type encoder registered for the exact type of the value. // -// 2. A hook encoder registered for an interface that is implemented by the value or by a pointer to the value. If the -// value matches multiple hooks (e.g. the type implements bsoncodec.Marshaler and bsoncodec.ValueMarshaler), the first -// one registered will be selected. Note that registries constructed using bson.NewRegistryBuilder have driver-defined -// hooks registered for the bsoncodec.Marshaler, bsoncodec.ValueMarshaler, and bsoncodec.Proxy interfaces, so those -// will take precedence over any new hooks. +// 2. A hook encoder registered for an interface that is implemented by the value or by a pointer to +// the value. If the value matches multiple hooks (e.g. the type implements bsoncodec.Marshaler and +// bsoncodec.ValueMarshaler), the first one registered will be selected. Note that registries +// constructed using bson.NewRegistry have driver-defined hooks registered for the +// bsoncodec.Marshaler, bsoncodec.ValueMarshaler, and bsoncodec.Proxy interfaces, so those will take +// precedence over any new hooks. // // 3. A kind encoder registered for the value's kind. // -// If all of these lookups fail to find an encoder, an error of type ErrNoEncoder is returned. The same precedence -// rules apply for decoders, with the exception that an error of type ErrNoDecoder will be returned if no decoder is -// found. +// If all of these lookups fail to find an encoder, an error of type ErrNoEncoder is returned. The +// same precedence rules apply for decoders, with the exception that an error of type ErrNoDecoder +// will be returned if no decoder is found. // -// DefaultValueEncoders and DefaultValueDecoders +// # DefaultValueEncoders and DefaultValueDecoders // // The DefaultValueEncoders and DefaultValueDecoders types provide a full set of ValueEncoders and // ValueDecoders for handling a wide range of Go types, including all of the types within the diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/empty_interface_codec.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/empty_interface_codec.go index a15636d0a8..098368f071 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/empty_interface_codec.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/empty_interface_codec.go @@ -16,18 +16,44 @@ import ( ) // EmptyInterfaceCodec is the Codec used for interface{} values. +// +// Deprecated: EmptyInterfaceCodec will not be directly configurable in Go +// Driver 2.0. To configure the empty interface encode and decode behavior, use +// the configuration methods on a [go.mongodb.org/mongo-driver/bson.Encoder] or +// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the empty interface +// encode and decode behavior for a mongo.Client, use +// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions]. +// +// For example, to configure a mongo.Client to unmarshal BSON binary field +// values as a Go byte slice, use: +// +// opt := options.Client().SetBSONOptions(&options.BSONOptions{ +// BinaryAsSlice: true, +// }) +// +// See the deprecation notice for each field in EmptyInterfaceCodec for the +// corresponding settings. type EmptyInterfaceCodec struct { + // DecodeBinaryAsSlice causes DecodeValue to unmarshal BSON binary field values that are the + // "Generic" or "Old" BSON binary subtype as a Go byte slice instead of a primitive.Binary. + // + // Deprecated: Use bson.Decoder.BinaryAsSlice or options.BSONOptions.BinaryAsSlice instead. DecodeBinaryAsSlice bool } var ( defaultEmptyInterfaceCodec = NewEmptyInterfaceCodec() - _ ValueCodec = defaultEmptyInterfaceCodec + // Assert that defaultEmptyInterfaceCodec satisfies the typeDecoder interface, which allows it + // to be used by collection type decoders (e.g. map, slice, etc) to set individual values in a + // collection. _ typeDecoder = defaultEmptyInterfaceCodec ) // NewEmptyInterfaceCodec returns a EmptyInterfaceCodec with options opts. +// +// Deprecated: NewEmptyInterfaceCodec will not be available in Go Driver 2.0. See +// [EmptyInterfaceCodec] for more details. func NewEmptyInterfaceCodec(opts ...*bsonoptions.EmptyInterfaceCodecOptions) *EmptyInterfaceCodec { interfaceOpt := bsonoptions.MergeEmptyInterfaceCodecOptions(opts...) @@ -57,11 +83,18 @@ func (eic EmptyInterfaceCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWrit func (eic EmptyInterfaceCodec) getEmptyInterfaceDecodeType(dc DecodeContext, valueType bsontype.Type) (reflect.Type, error) { isDocument := valueType == bsontype.Type(0) || valueType == bsontype.EmbeddedDocument - if isDocument && dc.Ancestor != nil { - // Using ancestor information rather than looking up the type map entry forces consistent decoding. - // If we're decoding into a bson.D, subdocuments should also be decoded as bson.D, even if a type map entry - // has been registered. - return dc.Ancestor, nil + if isDocument { + if dc.defaultDocumentType != nil { + // If the bsontype is an embedded document and the DocumentType is set on the DecodeContext, then return + // that type. + return dc.defaultDocumentType, nil + } + if dc.Ancestor != nil { + // Using ancestor information rather than looking up the type map entry forces consistent decoding. + // If we're decoding into a bson.D, subdocuments should also be decoded as bson.D, even if a type map entry + // has been registered. + return dc.Ancestor, nil + } } rtype, err := dc.LookupTypeMapEntry(valueType) @@ -114,7 +147,7 @@ func (eic EmptyInterfaceCodec) decodeType(dc DecodeContext, vr bsonrw.ValueReade return emptyValue, err } - if eic.DecodeBinaryAsSlice && rtype == tBinary { + if (eic.DecodeBinaryAsSlice || dc.binaryAsSlice) && rtype == tBinary { binElem := elem.Interface().(primitive.Binary) if binElem.Subtype == bsontype.BinaryGeneric || binElem.Subtype == bsontype.BinaryBinaryOld { elem = reflect.ValueOf(binElem.Data) diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go index fbb8ef427c..d7e00ffa8d 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go @@ -7,6 +7,8 @@ package bsoncodec import ( + "encoding" + "errors" "fmt" "reflect" "strconv" @@ -19,14 +21,44 @@ import ( var defaultMapCodec = NewMapCodec() // MapCodec is the Codec used for map values. +// +// Deprecated: MapCodec will not be directly configurable in Go Driver 2.0. To +// configure the map encode and decode behavior, use the configuration methods +// on a [go.mongodb.org/mongo-driver/bson.Encoder] or +// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the map encode and +// decode behavior for a mongo.Client, use +// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions]. +// +// For example, to configure a mongo.Client to marshal nil Go maps as empty BSON +// documents, use: +// +// opt := options.Client().SetBSONOptions(&options.BSONOptions{ +// NilMapAsEmpty: true, +// }) +// +// See the deprecation notice for each field in MapCodec for the corresponding +// settings. type MapCodec struct { - DecodeZerosMap bool - EncodeNilAsEmpty bool + // DecodeZerosMap causes DecodeValue to delete any existing values from Go maps in the destination + // value passed to Decode before unmarshaling BSON documents into them. + // + // Deprecated: Use bson.Decoder.ZeroMaps or options.BSONOptions.ZeroMaps instead. + DecodeZerosMap bool + + // EncodeNilAsEmpty causes EncodeValue to marshal nil Go maps as empty BSON documents instead of + // BSON null. + // + // Deprecated: Use bson.Encoder.NilMapAsEmpty or options.BSONOptions.NilMapAsEmpty instead. + EncodeNilAsEmpty bool + + // EncodeKeysWithStringer causes the Encoder to convert Go map keys to BSON document field name + // strings using fmt.Sprintf() instead of the default string conversion logic. + // + // Deprecated: Use bson.Encoder.StringifyMapKeysWithFmt or + // options.BSONOptions.StringifyMapKeysWithFmt instead. EncodeKeysWithStringer bool } -var _ ValueCodec = &MapCodec{} - // KeyMarshaler is the interface implemented by an object that can marshal itself into a string key. // This applies to types used as map keys and is similar to encoding.TextMarshaler. type KeyMarshaler interface { @@ -44,6 +76,9 @@ type KeyUnmarshaler interface { } // NewMapCodec returns a MapCodec with options opts. +// +// Deprecated: NewMapCodec will not be available in Go Driver 2.0. See +// [MapCodec] for more details. func NewMapCodec(opts ...*bsonoptions.MapCodecOptions) *MapCodec { mapOpt := bsonoptions.MergeMapCodecOptions(opts...) @@ -66,7 +101,7 @@ func (mc *MapCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val ref return ValueEncoderError{Name: "MapEncodeValue", Kinds: []reflect.Kind{reflect.Map}, Received: val} } - if val.IsNil() && !mc.EncodeNilAsEmpty { + if val.IsNil() && !mc.EncodeNilAsEmpty && !ec.nilMapAsEmpty { // If we have a nil map but we can't WriteNull, that means we're probably trying to encode // to a TopLevel document. We can't currently tell if this is what actually happened, but if // there's a deeper underlying problem, the error will also be returned from WriteDocument, @@ -99,7 +134,7 @@ func (mc *MapCodec) mapEncodeValue(ec EncodeContext, dw bsonrw.DocumentWriter, v keys := val.MapKeys() for _, key := range keys { - keyStr, err := mc.encodeKey(key) + keyStr, err := mc.encodeKey(key, ec.stringifyMapKeysWithFmt) if err != nil { return err } @@ -109,7 +144,7 @@ func (mc *MapCodec) mapEncodeValue(ec EncodeContext, dw bsonrw.DocumentWriter, v } currEncoder, currVal, lookupErr := defaultValueEncoders.lookupElementEncoder(ec, encoder, val.MapIndex(key)) - if lookupErr != nil && lookupErr != errInvalidValue { + if lookupErr != nil && !errors.Is(lookupErr, errInvalidValue) { return lookupErr } @@ -118,7 +153,7 @@ func (mc *MapCodec) mapEncodeValue(ec EncodeContext, dw bsonrw.DocumentWriter, v return err } - if lookupErr == errInvalidValue { + if errors.Is(lookupErr, errInvalidValue) { err = vw.WriteNull() if err != nil { return err @@ -126,14 +161,7 @@ func (mc *MapCodec) mapEncodeValue(ec EncodeContext, dw bsonrw.DocumentWriter, v continue } - if enc, ok := currEncoder.(ValueEncoder); ok { - err = enc.EncodeValue(ec, vw, currVal) - if err != nil { - return err - } - continue - } - err = encoder.EncodeValue(ec, vw, currVal) + err = currEncoder.EncodeValue(ec, vw, currVal) if err != nil { return err } @@ -169,7 +197,7 @@ func (mc *MapCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val ref val.Set(reflect.MakeMap(val.Type())) } - if val.Len() > 0 && mc.DecodeZerosMap { + if val.Len() > 0 && (mc.DecodeZerosMap || dc.zeroMaps) { clearMap(val) } @@ -188,7 +216,7 @@ func (mc *MapCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val ref for { key, vr, err := dr.ReadElement() - if err == bsonrw.ErrEOD { + if errors.Is(err, bsonrw.ErrEOD) { break } if err != nil { @@ -217,8 +245,8 @@ func clearMap(m reflect.Value) { } } -func (mc *MapCodec) encodeKey(val reflect.Value) (string, error) { - if mc.EncodeKeysWithStringer { +func (mc *MapCodec) encodeKey(val reflect.Value, encodeKeysWithStringer bool) (string, error) { + if mc.EncodeKeysWithStringer || encodeKeysWithStringer { return fmt.Sprint(val), nil } @@ -237,6 +265,19 @@ func (mc *MapCodec) encodeKey(val reflect.Value) (string, error) { } return "", err } + // keys implement encoding.TextMarshaler are marshaled. + if km, ok := val.Interface().(encoding.TextMarshaler); ok { + if val.Kind() == reflect.Ptr && val.IsNil() { + return "", nil + } + + buf, err := km.MarshalText() + if err != nil { + return "", err + } + + return string(buf), nil + } switch val.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: @@ -248,6 +289,7 @@ func (mc *MapCodec) encodeKey(val reflect.Value) (string, error) { } var keyUnmarshalerType = reflect.TypeOf((*KeyUnmarshaler)(nil)).Elem() +var textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() func (mc *MapCodec) decodeKey(key string, keyType reflect.Type) (reflect.Value, error) { keyVal := reflect.ValueOf(key) @@ -259,23 +301,27 @@ func (mc *MapCodec) decodeKey(key string, keyType reflect.Type) (reflect.Value, v := keyVal.Interface().(KeyUnmarshaler) err = v.UnmarshalKey(key) keyVal = keyVal.Elem() + // Try to decode encoding.TextUnmarshalers. + case reflect.PtrTo(keyType).Implements(textUnmarshalerType): + keyVal = reflect.New(keyType) + v := keyVal.Interface().(encoding.TextUnmarshaler) + err = v.UnmarshalText([]byte(key)) + keyVal = keyVal.Elem() // Otherwise, go to type specific behavior default: switch keyType.Kind() { case reflect.String: keyVal = reflect.ValueOf(key).Convert(keyType) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - s := string(key) - n, parseErr := strconv.ParseInt(s, 10, 64) + n, parseErr := strconv.ParseInt(key, 10, 64) if parseErr != nil || reflect.Zero(keyType).OverflowInt(n) { - err = fmt.Errorf("failed to unmarshal number key %v", s) + err = fmt.Errorf("failed to unmarshal number key %v", key) } keyVal = reflect.ValueOf(n).Convert(keyType) case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - s := string(key) - n, parseErr := strconv.ParseUint(s, 10, 64) + n, parseErr := strconv.ParseUint(key, 10, 64) if parseErr != nil || reflect.Zero(keyType).OverflowUint(n) { - err = fmt.Errorf("failed to unmarshal number key %v", s) + err = fmt.Errorf("failed to unmarshal number key %v", key) break } keyVal = reflect.ValueOf(n).Convert(keyType) @@ -283,7 +329,7 @@ func (mc *MapCodec) decodeKey(key string, keyType reflect.Type) (reflect.Value, if mc.EncodeKeysWithStringer { parsed, err := strconv.ParseFloat(key, 64) if err != nil { - return keyVal, fmt.Errorf("Map key is defined to be a decimal type (%v) but got error %v", keyType.Kind(), err) + return keyVal, fmt.Errorf("Map key is defined to be a decimal type (%v) but got error %w", keyType.Kind(), err) } keyVal = reflect.ValueOf(parsed) break diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/pointer_codec.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/pointer_codec.go index 616a3e701b..ddfa4a33e1 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/pointer_codec.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/pointer_codec.go @@ -8,7 +8,6 @@ package bsoncodec import ( "reflect" - "sync" "go.mongodb.org/mongo-driver/bson/bsonrw" "go.mongodb.org/mongo-driver/bson/bsontype" @@ -18,18 +17,28 @@ var _ ValueEncoder = &PointerCodec{} var _ ValueDecoder = &PointerCodec{} // PointerCodec is the Codec used for pointers. +// +// Deprecated: PointerCodec will not be directly accessible in Go Driver 2.0. To +// override the default pointer encode and decode behavior, create a new registry +// with [go.mongodb.org/mongo-driver/bson.NewRegistry] and register a new +// encoder and decoder for pointers. +// +// For example, +// +// reg := bson.NewRegistry() +// reg.RegisterKindEncoder(reflect.Ptr, myPointerEncoder) +// reg.RegisterKindDecoder(reflect.Ptr, myPointerDecoder) type PointerCodec struct { - ecache map[reflect.Type]ValueEncoder - dcache map[reflect.Type]ValueDecoder - l sync.RWMutex + ecache typeEncoderCache + dcache typeDecoderCache } // NewPointerCodec returns a PointerCodec that has been initialized. +// +// Deprecated: NewPointerCodec will not be available in Go Driver 2.0. See +// [PointerCodec] for more details. func NewPointerCodec() *PointerCodec { - return &PointerCodec{ - ecache: make(map[reflect.Type]ValueEncoder), - dcache: make(map[reflect.Type]ValueDecoder), - } + return &PointerCodec{} } // EncodeValue handles encoding a pointer by either encoding it to BSON Null if the pointer is nil @@ -46,24 +55,19 @@ func (pc *PointerCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val return vw.WriteNull() } - pc.l.RLock() - enc, ok := pc.ecache[val.Type()] - pc.l.RUnlock() - if ok { - if enc == nil { - return ErrNoEncoder{Type: val.Type()} + typ := val.Type() + if v, ok := pc.ecache.Load(typ); ok { + if v == nil { + return ErrNoEncoder{Type: typ} } - return enc.EncodeValue(ec, vw, val.Elem()) + return v.EncodeValue(ec, vw, val.Elem()) } - - enc, err := ec.LookupEncoder(val.Type().Elem()) - pc.l.Lock() - pc.ecache[val.Type()] = enc - pc.l.Unlock() + // TODO(charlie): handle concurrent requests for the same type + enc, err := ec.LookupEncoder(typ.Elem()) + enc = pc.ecache.LoadOrStore(typ, enc) if err != nil { return err } - return enc.EncodeValue(ec, vw, val.Elem()) } @@ -74,36 +78,31 @@ func (pc *PointerCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val return ValueDecoderError{Name: "PointerCodec.DecodeValue", Kinds: []reflect.Kind{reflect.Ptr}, Received: val} } + typ := val.Type() if vr.Type() == bsontype.Null { - val.Set(reflect.Zero(val.Type())) + val.Set(reflect.Zero(typ)) return vr.ReadNull() } if vr.Type() == bsontype.Undefined { - val.Set(reflect.Zero(val.Type())) + val.Set(reflect.Zero(typ)) return vr.ReadUndefined() } if val.IsNil() { - val.Set(reflect.New(val.Type().Elem())) + val.Set(reflect.New(typ.Elem())) } - pc.l.RLock() - dec, ok := pc.dcache[val.Type()] - pc.l.RUnlock() - if ok { - if dec == nil { - return ErrNoDecoder{Type: val.Type()} + if v, ok := pc.dcache.Load(typ); ok { + if v == nil { + return ErrNoDecoder{Type: typ} } - return dec.DecodeValue(dc, vr, val.Elem()) + return v.DecodeValue(dc, vr, val.Elem()) } - - dec, err := dc.LookupDecoder(val.Type().Elem()) - pc.l.Lock() - pc.dcache[val.Type()] = dec - pc.l.Unlock() + // TODO(charlie): handle concurrent requests for the same type + dec, err := dc.LookupDecoder(typ.Elem()) + dec = pc.dcache.LoadOrStore(typ, dec) if err != nil { return err } - return dec.DecodeValue(dc, vr, val.Elem()) } diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go index 60abffb248..196c491bbb 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go @@ -16,12 +16,18 @@ import ( ) // ErrNilType is returned when nil is passed to either LookupEncoder or LookupDecoder. +// +// Deprecated: ErrNilType will not be supported in Go Driver 2.0. var ErrNilType = errors.New("cannot perform a decoder lookup on ") // ErrNotPointer is returned when a non-pointer type is provided to LookupDecoder. +// +// Deprecated: ErrNotPointer will not be supported in Go Driver 2.0. var ErrNotPointer = errors.New("non-pointer provided to LookupDecoder") // ErrNoEncoder is returned when there wasn't an encoder available for a type. +// +// Deprecated: ErrNoEncoder will not be supported in Go Driver 2.0. type ErrNoEncoder struct { Type reflect.Type } @@ -34,6 +40,8 @@ func (ene ErrNoEncoder) Error() string { } // ErrNoDecoder is returned when there wasn't a decoder available for a type. +// +// Deprecated: ErrNoDecoder will not be supported in Go Driver 2.0. type ErrNoDecoder struct { Type reflect.Type } @@ -43,6 +51,8 @@ func (end ErrNoDecoder) Error() string { } // ErrNoTypeMapEntry is returned when there wasn't a type available for the provided BSON type. +// +// Deprecated: ErrNoTypeMapEntry will not be supported in Go Driver 2.0. type ErrNoTypeMapEntry struct { Type bsontype.Type } @@ -52,69 +62,30 @@ func (entme ErrNoTypeMapEntry) Error() string { } // ErrNotInterface is returned when the provided type is not an interface. +// +// Deprecated: ErrNotInterface will not be supported in Go Driver 2.0. var ErrNotInterface = errors.New("The provided type is not an interface") -var defaultRegistry *Registry - -func init() { - defaultRegistry = buildDefaultRegistry() -} - // A RegistryBuilder is used to build a Registry. This type is not goroutine // safe. +// +// Deprecated: Use Registry instead. type RegistryBuilder struct { - typeEncoders map[reflect.Type]ValueEncoder - interfaceEncoders []interfaceValueEncoder - kindEncoders map[reflect.Kind]ValueEncoder - - typeDecoders map[reflect.Type]ValueDecoder - interfaceDecoders []interfaceValueDecoder - kindDecoders map[reflect.Kind]ValueDecoder - - typeMap map[bsontype.Type]reflect.Type -} - -// A Registry is used to store and retrieve codecs for types and interfaces. This type is the main -// typed passed around and Encoders and Decoders are constructed from it. -type Registry struct { - typeEncoders map[reflect.Type]ValueEncoder - typeDecoders map[reflect.Type]ValueDecoder - - interfaceEncoders []interfaceValueEncoder - interfaceDecoders []interfaceValueDecoder - - kindEncoders map[reflect.Kind]ValueEncoder - kindDecoders map[reflect.Kind]ValueDecoder - - typeMap map[bsontype.Type]reflect.Type - - mu sync.RWMutex + registry *Registry } // NewRegistryBuilder creates a new empty RegistryBuilder. +// +// Deprecated: Use NewRegistry instead. func NewRegistryBuilder() *RegistryBuilder { return &RegistryBuilder{ - typeEncoders: make(map[reflect.Type]ValueEncoder), - typeDecoders: make(map[reflect.Type]ValueDecoder), - - interfaceEncoders: make([]interfaceValueEncoder, 0), - interfaceDecoders: make([]interfaceValueDecoder, 0), - - kindEncoders: make(map[reflect.Kind]ValueEncoder), - kindDecoders: make(map[reflect.Kind]ValueDecoder), - - typeMap: make(map[bsontype.Type]reflect.Type), + registry: NewRegistry(), } } -func buildDefaultRegistry() *Registry { - rb := NewRegistryBuilder() - defaultValueEncoders.RegisterDefaultEncoders(rb) - defaultValueDecoders.RegisterDefaultDecoders(rb) - return rb.Build() -} - // RegisterCodec will register the provided ValueCodec for the provided type. +// +// Deprecated: Use Registry.RegisterTypeEncoder and Registry.RegisterTypeDecoder instead. func (rb *RegistryBuilder) RegisterCodec(t reflect.Type, codec ValueCodec) *RegistryBuilder { rb.RegisterTypeEncoder(t, codec) rb.RegisterTypeDecoder(t, codec) @@ -126,31 +97,22 @@ func (rb *RegistryBuilder) RegisterCodec(t reflect.Type, codec ValueCodec) *Regi // The type will be used directly, so an encoder can be registered for a type and a different encoder can be registered // for a pointer to that type. // -// If the given type is an interface, the encoder will be called when marshalling a type that is that interface. It -// will not be called when marshalling a non-interface type that implements the interface. +// If the given type is an interface, the encoder will be called when marshaling a type that is that interface. It +// will not be called when marshaling a non-interface type that implements the interface. +// +// Deprecated: Use Registry.RegisterTypeEncoder instead. func (rb *RegistryBuilder) RegisterTypeEncoder(t reflect.Type, enc ValueEncoder) *RegistryBuilder { - rb.typeEncoders[t] = enc + rb.registry.RegisterTypeEncoder(t, enc) return rb } // RegisterHookEncoder will register an encoder for the provided interface type t. This encoder will be called when -// marshalling a type if the type implements t or a pointer to the type implements t. If the provided type is not +// marshaling a type if the type implements t or a pointer to the type implements t. If the provided type is not // an interface (i.e. t.Kind() != reflect.Interface), this method will panic. +// +// Deprecated: Use Registry.RegisterInterfaceEncoder instead. func (rb *RegistryBuilder) RegisterHookEncoder(t reflect.Type, enc ValueEncoder) *RegistryBuilder { - if t.Kind() != reflect.Interface { - panicStr := fmt.Sprintf("RegisterHookEncoder expects a type with kind reflect.Interface, "+ - "got type %s with kind %s", t, t.Kind()) - panic(panicStr) - } - - for idx, encoder := range rb.interfaceEncoders { - if encoder.i == t { - rb.interfaceEncoders[idx].ve = enc - return rb - } - } - - rb.interfaceEncoders = append(rb.interfaceEncoders, interfaceValueEncoder{i: t, ve: enc}) + rb.registry.RegisterInterfaceEncoder(t, enc) return rb } @@ -159,97 +121,78 @@ func (rb *RegistryBuilder) RegisterHookEncoder(t reflect.Type, enc ValueEncoder) // The type will be used directly, so a decoder can be registered for a type and a different decoder can be registered // for a pointer to that type. // -// If the given type is an interface, the decoder will be called when unmarshalling into a type that is that interface. -// It will not be called when unmarshalling into a non-interface type that implements the interface. +// If the given type is an interface, the decoder will be called when unmarshaling into a type that is that interface. +// It will not be called when unmarshaling into a non-interface type that implements the interface. +// +// Deprecated: Use Registry.RegisterTypeDecoder instead. func (rb *RegistryBuilder) RegisterTypeDecoder(t reflect.Type, dec ValueDecoder) *RegistryBuilder { - rb.typeDecoders[t] = dec + rb.registry.RegisterTypeDecoder(t, dec) return rb } // RegisterHookDecoder will register an decoder for the provided interface type t. This decoder will be called when -// unmarshalling into a type if the type implements t or a pointer to the type implements t. If the provided type is not +// unmarshaling into a type if the type implements t or a pointer to the type implements t. If the provided type is not // an interface (i.e. t.Kind() != reflect.Interface), this method will panic. +// +// Deprecated: Use Registry.RegisterInterfaceDecoder instead. func (rb *RegistryBuilder) RegisterHookDecoder(t reflect.Type, dec ValueDecoder) *RegistryBuilder { - if t.Kind() != reflect.Interface { - panicStr := fmt.Sprintf("RegisterHookDecoder expects a type with kind reflect.Interface, "+ - "got type %s with kind %s", t, t.Kind()) - panic(panicStr) - } - - for idx, decoder := range rb.interfaceDecoders { - if decoder.i == t { - rb.interfaceDecoders[idx].vd = dec - return rb - } - } - - rb.interfaceDecoders = append(rb.interfaceDecoders, interfaceValueDecoder{i: t, vd: dec}) + rb.registry.RegisterInterfaceDecoder(t, dec) return rb } // RegisterEncoder registers the provided type and encoder pair. // -// Deprecated: Use RegisterTypeEncoder or RegisterHookEncoder instead. +// Deprecated: Use Registry.RegisterTypeEncoder or Registry.RegisterInterfaceEncoder instead. func (rb *RegistryBuilder) RegisterEncoder(t reflect.Type, enc ValueEncoder) *RegistryBuilder { if t == tEmpty { - rb.typeEncoders[t] = enc + rb.registry.RegisterTypeEncoder(t, enc) return rb } switch t.Kind() { case reflect.Interface: - for idx, ir := range rb.interfaceEncoders { - if ir.i == t { - rb.interfaceEncoders[idx].ve = enc - return rb - } - } - - rb.interfaceEncoders = append(rb.interfaceEncoders, interfaceValueEncoder{i: t, ve: enc}) + rb.registry.RegisterInterfaceEncoder(t, enc) default: - rb.typeEncoders[t] = enc + rb.registry.RegisterTypeEncoder(t, enc) } return rb } // RegisterDecoder registers the provided type and decoder pair. // -// Deprecated: Use RegisterTypeDecoder or RegisterHookDecoder instead. +// Deprecated: Use Registry.RegisterTypeDecoder or Registry.RegisterInterfaceDecoder instead. func (rb *RegistryBuilder) RegisterDecoder(t reflect.Type, dec ValueDecoder) *RegistryBuilder { if t == nil { - rb.typeDecoders[nil] = dec + rb.registry.RegisterTypeDecoder(t, dec) return rb } if t == tEmpty { - rb.typeDecoders[t] = dec + rb.registry.RegisterTypeDecoder(t, dec) return rb } switch t.Kind() { case reflect.Interface: - for idx, ir := range rb.interfaceDecoders { - if ir.i == t { - rb.interfaceDecoders[idx].vd = dec - return rb - } - } - - rb.interfaceDecoders = append(rb.interfaceDecoders, interfaceValueDecoder{i: t, vd: dec}) + rb.registry.RegisterInterfaceDecoder(t, dec) default: - rb.typeDecoders[t] = dec + rb.registry.RegisterTypeDecoder(t, dec) } return rb } -// RegisterDefaultEncoder will registr the provided ValueEncoder to the provided +// RegisterDefaultEncoder will register the provided ValueEncoder to the provided // kind. +// +// Deprecated: Use Registry.RegisterKindEncoder instead. func (rb *RegistryBuilder) RegisterDefaultEncoder(kind reflect.Kind, enc ValueEncoder) *RegistryBuilder { - rb.kindEncoders[kind] = enc + rb.registry.RegisterKindEncoder(kind, enc) return rb } // RegisterDefaultDecoder will register the provided ValueDecoder to the // provided kind. +// +// Deprecated: Use Registry.RegisterKindDecoder instead. func (rb *RegistryBuilder) RegisterDefaultDecoder(kind reflect.Kind, dec ValueDecoder) *RegistryBuilder { - rb.kindDecoders[kind] = dec + rb.registry.RegisterKindDecoder(kind, dec) return rb } @@ -260,121 +203,235 @@ func (rb *RegistryBuilder) RegisterDefaultDecoder(kind reflect.Kind, dec ValueDe // By default, BSON documents will decode into interface{} values as bson.D. To change the default type for BSON // documents, a type map entry for bsontype.EmbeddedDocument should be registered. For example, to force BSON documents // to decode to bson.Raw, use the following code: +// // rb.RegisterTypeMapEntry(bsontype.EmbeddedDocument, reflect.TypeOf(bson.Raw{})) +// +// Deprecated: Use Registry.RegisterTypeMapEntry instead. func (rb *RegistryBuilder) RegisterTypeMapEntry(bt bsontype.Type, rt reflect.Type) *RegistryBuilder { - rb.typeMap[bt] = rt + rb.registry.RegisterTypeMapEntry(bt, rt) return rb } // Build creates a Registry from the current state of this RegistryBuilder. +// +// Deprecated: Use NewRegistry instead. func (rb *RegistryBuilder) Build() *Registry { - registry := new(Registry) - - registry.typeEncoders = make(map[reflect.Type]ValueEncoder) - for t, enc := range rb.typeEncoders { - registry.typeEncoders[t] = enc + r := &Registry{ + interfaceEncoders: append([]interfaceValueEncoder(nil), rb.registry.interfaceEncoders...), + interfaceDecoders: append([]interfaceValueDecoder(nil), rb.registry.interfaceDecoders...), + typeEncoders: rb.registry.typeEncoders.Clone(), + typeDecoders: rb.registry.typeDecoders.Clone(), + kindEncoders: rb.registry.kindEncoders.Clone(), + kindDecoders: rb.registry.kindDecoders.Clone(), } + rb.registry.typeMap.Range(func(k, v interface{}) bool { + if k != nil && v != nil { + r.typeMap.Store(k, v) + } + return true + }) + return r +} - registry.typeDecoders = make(map[reflect.Type]ValueDecoder) - for t, dec := range rb.typeDecoders { - registry.typeDecoders[t] = dec +// A Registry is used to store and retrieve codecs for types and interfaces. This type is the main +// typed passed around and Encoders and Decoders are constructed from it. +type Registry struct { + interfaceEncoders []interfaceValueEncoder + interfaceDecoders []interfaceValueDecoder + typeEncoders *typeEncoderCache + typeDecoders *typeDecoderCache + kindEncoders *kindEncoderCache + kindDecoders *kindDecoderCache + typeMap sync.Map // map[bsontype.Type]reflect.Type +} + +// NewRegistry creates a new empty Registry. +func NewRegistry() *Registry { + return &Registry{ + typeEncoders: new(typeEncoderCache), + typeDecoders: new(typeDecoderCache), + kindEncoders: new(kindEncoderCache), + kindDecoders: new(kindDecoderCache), } +} - registry.interfaceEncoders = make([]interfaceValueEncoder, len(rb.interfaceEncoders)) - copy(registry.interfaceEncoders, rb.interfaceEncoders) +// RegisterTypeEncoder registers the provided ValueEncoder for the provided type. +// +// The type will be used as provided, so an encoder can be registered for a type and a different +// encoder can be registered for a pointer to that type. +// +// If the given type is an interface, the encoder will be called when marshaling a type that is +// that interface. It will not be called when marshaling a non-interface type that implements the +// interface. To get the latter behavior, call RegisterHookEncoder instead. +// +// RegisterTypeEncoder should not be called concurrently with any other Registry method. +func (r *Registry) RegisterTypeEncoder(valueType reflect.Type, enc ValueEncoder) { + r.typeEncoders.Store(valueType, enc) +} - registry.interfaceDecoders = make([]interfaceValueDecoder, len(rb.interfaceDecoders)) - copy(registry.interfaceDecoders, rb.interfaceDecoders) +// RegisterTypeDecoder registers the provided ValueDecoder for the provided type. +// +// The type will be used as provided, so a decoder can be registered for a type and a different +// decoder can be registered for a pointer to that type. +// +// If the given type is an interface, the decoder will be called when unmarshaling into a type that +// is that interface. It will not be called when unmarshaling into a non-interface type that +// implements the interface. To get the latter behavior, call RegisterHookDecoder instead. +// +// RegisterTypeDecoder should not be called concurrently with any other Registry method. +func (r *Registry) RegisterTypeDecoder(valueType reflect.Type, dec ValueDecoder) { + r.typeDecoders.Store(valueType, dec) +} - registry.kindEncoders = make(map[reflect.Kind]ValueEncoder) - for kind, enc := range rb.kindEncoders { - registry.kindEncoders[kind] = enc +// RegisterKindEncoder registers the provided ValueEncoder for the provided kind. +// +// Use RegisterKindEncoder to register an encoder for any type with the same underlying kind. For +// example, consider the type MyInt defined as +// +// type MyInt int32 +// +// To define an encoder for MyInt and int32, use RegisterKindEncoder like +// +// reg.RegisterKindEncoder(reflect.Int32, myEncoder) +// +// RegisterKindEncoder should not be called concurrently with any other Registry method. +func (r *Registry) RegisterKindEncoder(kind reflect.Kind, enc ValueEncoder) { + r.kindEncoders.Store(kind, enc) +} + +// RegisterKindDecoder registers the provided ValueDecoder for the provided kind. +// +// Use RegisterKindDecoder to register a decoder for any type with the same underlying kind. For +// example, consider the type MyInt defined as +// +// type MyInt int32 +// +// To define an decoder for MyInt and int32, use RegisterKindDecoder like +// +// reg.RegisterKindDecoder(reflect.Int32, myDecoder) +// +// RegisterKindDecoder should not be called concurrently with any other Registry method. +func (r *Registry) RegisterKindDecoder(kind reflect.Kind, dec ValueDecoder) { + r.kindDecoders.Store(kind, dec) +} + +// RegisterInterfaceEncoder registers an encoder for the provided interface type iface. This encoder will +// be called when marshaling a type if the type implements iface or a pointer to the type +// implements iface. If the provided type is not an interface +// (i.e. iface.Kind() != reflect.Interface), this method will panic. +// +// RegisterInterfaceEncoder should not be called concurrently with any other Registry method. +func (r *Registry) RegisterInterfaceEncoder(iface reflect.Type, enc ValueEncoder) { + if iface.Kind() != reflect.Interface { + panicStr := fmt.Errorf("RegisterInterfaceEncoder expects a type with kind reflect.Interface, "+ + "got type %s with kind %s", iface, iface.Kind()) + panic(panicStr) } - registry.kindDecoders = make(map[reflect.Kind]ValueDecoder) - for kind, dec := range rb.kindDecoders { - registry.kindDecoders[kind] = dec + for idx, encoder := range r.interfaceEncoders { + if encoder.i == iface { + r.interfaceEncoders[idx].ve = enc + return + } } - registry.typeMap = make(map[bsontype.Type]reflect.Type) - for bt, rt := range rb.typeMap { - registry.typeMap[bt] = rt + r.interfaceEncoders = append(r.interfaceEncoders, interfaceValueEncoder{i: iface, ve: enc}) +} + +// RegisterInterfaceDecoder registers an decoder for the provided interface type iface. This decoder will +// be called when unmarshaling into a type if the type implements iface or a pointer to the type +// implements iface. If the provided type is not an interface (i.e. iface.Kind() != reflect.Interface), +// this method will panic. +// +// RegisterInterfaceDecoder should not be called concurrently with any other Registry method. +func (r *Registry) RegisterInterfaceDecoder(iface reflect.Type, dec ValueDecoder) { + if iface.Kind() != reflect.Interface { + panicStr := fmt.Errorf("RegisterInterfaceDecoder expects a type with kind reflect.Interface, "+ + "got type %s with kind %s", iface, iface.Kind()) + panic(panicStr) } - return registry + for idx, decoder := range r.interfaceDecoders { + if decoder.i == iface { + r.interfaceDecoders[idx].vd = dec + return + } + } + + r.interfaceDecoders = append(r.interfaceDecoders, interfaceValueDecoder{i: iface, vd: dec}) +} + +// RegisterTypeMapEntry will register the provided type to the BSON type. The primary usage for this +// mapping is decoding situations where an empty interface is used and a default type needs to be +// created and decoded into. +// +// By default, BSON documents will decode into interface{} values as bson.D. To change the default type for BSON +// documents, a type map entry for bsontype.EmbeddedDocument should be registered. For example, to force BSON documents +// to decode to bson.Raw, use the following code: +// +// reg.RegisterTypeMapEntry(bsontype.EmbeddedDocument, reflect.TypeOf(bson.Raw{})) +func (r *Registry) RegisterTypeMapEntry(bt bsontype.Type, rt reflect.Type) { + r.typeMap.Store(bt, rt) } -// LookupEncoder inspects the registry for an encoder for the given type. The lookup precendence works as follows: +// LookupEncoder returns the first matching encoder in the Registry. It uses the following lookup +// order: // -// 1. An encoder registered for the exact type. If the given type represents an interface, an encoder registered using -// RegisterTypeEncoder for the interface will be selected. +// 1. An encoder registered for the exact type. If the given type is an interface, an encoder +// registered using RegisterTypeEncoder for that interface will be selected. // -// 2. An encoder registered using RegisterHookEncoder for an interface implemented by the type or by a pointer to the -// type. +// 2. An encoder registered using RegisterInterfaceEncoder for an interface implemented by the type +// or by a pointer to the type. // -// 3. An encoder registered for the reflect.Kind of the value. +// 3. An encoder registered using RegisterKindEncoder for the kind of value. // -// If no encoder is found, an error of type ErrNoEncoder is returned. -func (r *Registry) LookupEncoder(t reflect.Type) (ValueEncoder, error) { - encodererr := ErrNoEncoder{Type: t} - r.mu.RLock() - enc, found := r.lookupTypeEncoder(t) - r.mu.RUnlock() +// If no encoder is found, an error of type ErrNoEncoder is returned. LookupEncoder is safe for +// concurrent use by multiple goroutines after all codecs and encoders are registered. +func (r *Registry) LookupEncoder(valueType reflect.Type) (ValueEncoder, error) { + if valueType == nil { + return nil, ErrNoEncoder{Type: valueType} + } + enc, found := r.lookupTypeEncoder(valueType) if found { if enc == nil { - return nil, ErrNoEncoder{Type: t} + return nil, ErrNoEncoder{Type: valueType} } return enc, nil } - enc, found = r.lookupInterfaceEncoder(t, true) + enc, found = r.lookupInterfaceEncoder(valueType, true) if found { - r.mu.Lock() - r.typeEncoders[t] = enc - r.mu.Unlock() - return enc, nil + return r.typeEncoders.LoadOrStore(valueType, enc), nil } - if t == nil { - r.mu.Lock() - r.typeEncoders[t] = nil - r.mu.Unlock() - return nil, encodererr - } - - enc, found = r.kindEncoders[t.Kind()] - if !found { - r.mu.Lock() - r.typeEncoders[t] = nil - r.mu.Unlock() - return nil, encodererr + if v, ok := r.kindEncoders.Load(valueType.Kind()); ok { + return r.storeTypeEncoder(valueType, v), nil } + return nil, ErrNoEncoder{Type: valueType} +} - r.mu.Lock() - r.typeEncoders[t] = enc - r.mu.Unlock() - return enc, nil +func (r *Registry) storeTypeEncoder(rt reflect.Type, enc ValueEncoder) ValueEncoder { + return r.typeEncoders.LoadOrStore(rt, enc) } -func (r *Registry) lookupTypeEncoder(t reflect.Type) (ValueEncoder, bool) { - enc, found := r.typeEncoders[t] - return enc, found +func (r *Registry) lookupTypeEncoder(rt reflect.Type) (ValueEncoder, bool) { + return r.typeEncoders.Load(rt) } -func (r *Registry) lookupInterfaceEncoder(t reflect.Type, allowAddr bool) (ValueEncoder, bool) { - if t == nil { +func (r *Registry) lookupInterfaceEncoder(valueType reflect.Type, allowAddr bool) (ValueEncoder, bool) { + if valueType == nil { return nil, false } for _, ienc := range r.interfaceEncoders { - if t.Implements(ienc.i) { + if valueType.Implements(ienc.i) { return ienc.ve, true } - if allowAddr && t.Kind() != reflect.Ptr && reflect.PtrTo(t).Implements(ienc.i) { - // if *t implements an interface, this will catch if t implements an interface further ahead - // in interfaceEncoders - defaultEnc, found := r.lookupInterfaceEncoder(t, false) + if allowAddr && valueType.Kind() != reflect.Ptr && reflect.PtrTo(valueType).Implements(ienc.i) { + // if *t implements an interface, this will catch if t implements an interface further + // ahead in interfaceEncoders + defaultEnc, found := r.lookupInterfaceEncoder(valueType, false) if !found { - defaultEnc, _ = r.kindEncoders[t.Kind()] + defaultEnc, _ = r.kindEncoders.Load(valueType.Kind()) } return newCondAddrEncoder(ienc.ve, defaultEnc), true } @@ -382,70 +439,61 @@ func (r *Registry) lookupInterfaceEncoder(t reflect.Type, allowAddr bool) (Value return nil, false } -// LookupDecoder inspects the registry for an decoder for the given type. The lookup precendence works as follows: +// LookupDecoder returns the first matching decoder in the Registry. It uses the following lookup +// order: // -// 1. A decoder registered for the exact type. If the given type represents an interface, a decoder registered using -// RegisterTypeDecoder for the interface will be selected. +// 1. A decoder registered for the exact type. If the given type is an interface, a decoder +// registered using RegisterTypeDecoder for that interface will be selected. // -// 2. A decoder registered using RegisterHookDecoder for an interface implemented by the type or by a pointer to the -// type. +// 2. A decoder registered using RegisterInterfaceDecoder for an interface implemented by the type or by +// a pointer to the type. // -// 3. A decoder registered for the reflect.Kind of the value. +// 3. A decoder registered using RegisterKindDecoder for the kind of value. // -// If no decoder is found, an error of type ErrNoDecoder is returned. -func (r *Registry) LookupDecoder(t reflect.Type) (ValueDecoder, error) { - if t == nil { +// If no decoder is found, an error of type ErrNoDecoder is returned. LookupDecoder is safe for +// concurrent use by multiple goroutines after all codecs and decoders are registered. +func (r *Registry) LookupDecoder(valueType reflect.Type) (ValueDecoder, error) { + if valueType == nil { return nil, ErrNilType } - decodererr := ErrNoDecoder{Type: t} - r.mu.RLock() - dec, found := r.lookupTypeDecoder(t) - r.mu.RUnlock() + dec, found := r.lookupTypeDecoder(valueType) if found { if dec == nil { - return nil, ErrNoDecoder{Type: t} + return nil, ErrNoDecoder{Type: valueType} } return dec, nil } - dec, found = r.lookupInterfaceDecoder(t, true) + dec, found = r.lookupInterfaceDecoder(valueType, true) if found { - r.mu.Lock() - r.typeDecoders[t] = dec - r.mu.Unlock() - return dec, nil + return r.storeTypeDecoder(valueType, dec), nil } - dec, found = r.kindDecoders[t.Kind()] - if !found { - r.mu.Lock() - r.typeDecoders[t] = nil - r.mu.Unlock() - return nil, decodererr + if v, ok := r.kindDecoders.Load(valueType.Kind()); ok { + return r.storeTypeDecoder(valueType, v), nil } + return nil, ErrNoDecoder{Type: valueType} +} - r.mu.Lock() - r.typeDecoders[t] = dec - r.mu.Unlock() - return dec, nil +func (r *Registry) lookupTypeDecoder(valueType reflect.Type) (ValueDecoder, bool) { + return r.typeDecoders.Load(valueType) } -func (r *Registry) lookupTypeDecoder(t reflect.Type) (ValueDecoder, bool) { - dec, found := r.typeDecoders[t] - return dec, found +func (r *Registry) storeTypeDecoder(typ reflect.Type, dec ValueDecoder) ValueDecoder { + return r.typeDecoders.LoadOrStore(typ, dec) } -func (r *Registry) lookupInterfaceDecoder(t reflect.Type, allowAddr bool) (ValueDecoder, bool) { +func (r *Registry) lookupInterfaceDecoder(valueType reflect.Type, allowAddr bool) (ValueDecoder, bool) { for _, idec := range r.interfaceDecoders { - if t.Implements(idec.i) { + if valueType.Implements(idec.i) { return idec.vd, true } - if allowAddr && t.Kind() != reflect.Ptr && reflect.PtrTo(t).Implements(idec.i) { - // if *t implements an interface, this will catch if t implements an interface further ahead - // in interfaceDecoders - defaultDec, found := r.lookupInterfaceDecoder(t, false) + if allowAddr && valueType.Kind() != reflect.Ptr && reflect.PtrTo(valueType).Implements(idec.i) { + // if *t implements an interface, this will catch if t implements an interface further + // ahead in interfaceDecoders + defaultDec, found := r.lookupInterfaceDecoder(valueType, false) if !found { - defaultDec, _ = r.kindDecoders[t.Kind()] + defaultDec, _ = r.kindDecoders.Load(valueType.Kind()) } return newCondAddrDecoder(idec.vd, defaultDec), true } @@ -455,12 +503,14 @@ func (r *Registry) lookupInterfaceDecoder(t reflect.Type, allowAddr bool) (Value // LookupTypeMapEntry inspects the registry's type map for a Go type for the corresponding BSON // type. If no type is found, ErrNoTypeMapEntry is returned. +// +// LookupTypeMapEntry should not be called concurrently with any other Registry method. func (r *Registry) LookupTypeMapEntry(bt bsontype.Type) (reflect.Type, error) { - t, ok := r.typeMap[bt] - if !ok || t == nil { + v, ok := r.typeMap.Load(bt) + if v == nil || !ok { return nil, ErrNoTypeMapEntry{Type: bt} } - return t, nil + return v.(reflect.Type), nil } type interfaceValueEncoder struct { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/slice_codec.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/slice_codec.go index 3c1b6b860a..14c9fd2564 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/slice_codec.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/slice_codec.go @@ -7,6 +7,7 @@ package bsoncodec import ( + "errors" "fmt" "reflect" @@ -19,13 +20,35 @@ import ( var defaultSliceCodec = NewSliceCodec() // SliceCodec is the Codec used for slice values. +// +// Deprecated: SliceCodec will not be directly configurable in Go Driver 2.0. To +// configure the slice encode and decode behavior, use the configuration methods +// on a [go.mongodb.org/mongo-driver/bson.Encoder] or +// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the slice encode and +// decode behavior for a mongo.Client, use +// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions]. +// +// For example, to configure a mongo.Client to marshal nil Go slices as empty +// BSON arrays, use: +// +// opt := options.Client().SetBSONOptions(&options.BSONOptions{ +// NilSliceAsEmpty: true, +// }) +// +// See the deprecation notice for each field in SliceCodec for the corresponding +// settings. type SliceCodec struct { + // EncodeNilAsEmpty causes EncodeValue to marshal nil Go slices as empty BSON arrays instead of + // BSON null. + // + // Deprecated: Use bson.Encoder.NilSliceAsEmpty instead. EncodeNilAsEmpty bool } -var _ ValueCodec = &MapCodec{} - // NewSliceCodec returns a MapCodec with options opts. +// +// Deprecated: NewSliceCodec will not be available in Go Driver 2.0. See +// [SliceCodec] for more details. func NewSliceCodec(opts ...*bsonoptions.SliceCodecOptions) *SliceCodec { sliceOpt := bsonoptions.MergeSliceCodecOptions(opts...) @@ -42,21 +65,19 @@ func (sc SliceCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val re return ValueEncoderError{Name: "SliceEncodeValue", Kinds: []reflect.Kind{reflect.Slice}, Received: val} } - if val.IsNil() && !sc.EncodeNilAsEmpty { + if val.IsNil() && !sc.EncodeNilAsEmpty && !ec.nilSliceAsEmpty { return vw.WriteNull() } // If we have a []byte we want to treat it as a binary instead of as an array. if val.Type().Elem() == tByte { - var byteSlice []byte - for idx := 0; idx < val.Len(); idx++ { - byteSlice = append(byteSlice, val.Index(idx).Interface().(byte)) - } + byteSlice := make([]byte, val.Len()) + reflect.Copy(reflect.ValueOf(byteSlice), val) return vw.WriteBinary(byteSlice) } // If we have a []primitive.E we want to treat it as a document instead of as an array. - if val.Type().ConvertibleTo(tD) { + if val.Type() == tD || val.Type().ConvertibleTo(tD) { d := val.Convert(tD).Interface().(primitive.D) dw, err := vw.WriteDocument() @@ -87,7 +108,7 @@ func (sc SliceCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val re for idx := 0; idx < val.Len(); idx++ { currEncoder, currVal, lookupErr := defaultValueEncoders.lookupElementEncoder(ec, encoder, val.Index(idx)) - if lookupErr != nil && lookupErr != errInvalidValue { + if lookupErr != nil && !errors.Is(lookupErr, errInvalidValue) { return lookupErr } @@ -96,7 +117,7 @@ func (sc SliceCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val re return err } - if lookupErr == errInvalidValue { + if errors.Is(lookupErr, errInvalidValue) { err = vw.WriteNull() if err != nil { return err @@ -145,11 +166,8 @@ func (sc *SliceCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val r if val.IsNil() { val.Set(reflect.MakeSlice(val.Type(), 0, len(data))) } - val.SetLen(0) - for _, elem := range data { - val.Set(reflect.Append(val, reflect.ValueOf(elem))) - } + val.Set(reflect.AppendSlice(val, reflect.ValueOf(data))) return nil case bsontype.String: if sliceType := val.Type().Elem(); sliceType != tByte { @@ -164,11 +182,8 @@ func (sc *SliceCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val r if val.IsNil() { val.Set(reflect.MakeSlice(val.Type(), 0, len(byteStr))) } - val.SetLen(0) - for _, elem := range byteStr { - val.Set(reflect.Append(val, reflect.ValueOf(elem))) - } + val.Set(reflect.AppendSlice(val, reflect.ValueOf(byteStr))) return nil default: return fmt.Errorf("cannot decode %v into a slice", vrType) diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/string_codec.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/string_codec.go index 5332b7c3b5..a8f885a854 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/string_codec.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/string_codec.go @@ -15,26 +15,46 @@ import ( "go.mongodb.org/mongo-driver/bson/bsontype" ) -// StringCodec is the Codec used for struct values. +// StringCodec is the Codec used for string values. +// +// Deprecated: StringCodec will not be directly accessible in Go Driver 2.0. To +// override the default string encode and decode behavior, create a new registry +// with [go.mongodb.org/mongo-driver/bson.NewRegistry] and register a new +// encoder and decoder for strings. +// +// For example, +// +// reg := bson.NewRegistry() +// reg.RegisterKindEncoder(reflect.String, myStringEncoder) +// reg.RegisterKindDecoder(reflect.String, myStringDecoder) type StringCodec struct { + // DecodeObjectIDAsHex specifies if object IDs should be decoded as their hex representation. + // If false, a string made from the raw object ID bytes will be used. Defaults to true. + // + // Deprecated: Decoding object IDs as raw bytes will not be supported in Go Driver 2.0. DecodeObjectIDAsHex bool } var ( defaultStringCodec = NewStringCodec() - _ ValueCodec = defaultStringCodec + // Assert that defaultStringCodec satisfies the typeDecoder interface, which allows it to be + // used by collection type decoders (e.g. map, slice, etc) to set individual values in a + // collection. _ typeDecoder = defaultStringCodec ) // NewStringCodec returns a StringCodec with options opts. +// +// Deprecated: NewStringCodec will not be available in Go Driver 2.0. See +// [StringCodec] for more details. func NewStringCodec(opts ...*bsonoptions.StringCodecOptions) *StringCodec { stringOpt := bsonoptions.MergeStringCodecOptions(opts...) return &StringCodec{*stringOpt.DecodeObjectIDAsHex} } // EncodeValue is the ValueEncoder for string types. -func (sc *StringCodec) EncodeValue(ectx EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +func (sc *StringCodec) EncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if val.Kind() != reflect.String { return ValueEncoderError{ Name: "StringEncodeValue", @@ -46,7 +66,7 @@ func (sc *StringCodec) EncodeValue(ectx EncodeContext, vw bsonrw.ValueWriter, va return vw.WriteString(val.String()) } -func (sc *StringCodec) decodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { +func (sc *StringCodec) decodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) { if t.Kind() != reflect.String { return emptyValue, ValueDecoderError{ Name: "StringDecodeValue", @@ -71,6 +91,7 @@ func (sc *StringCodec) decodeType(dc DecodeContext, vr bsonrw.ValueReader, t ref if sc.DecodeObjectIDAsHex { str = oid.Hex() } else { + // TODO(GODRIVER-2796): Return an error here instead of decoding to a garbled string. byteArray := [12]byte(oid) str = string(byteArray[:]) } diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go index 9ce901782f..f8d9690c13 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go @@ -59,14 +59,58 @@ type Zeroer interface { } // StructCodec is the Codec used for struct values. +// +// Deprecated: StructCodec will not be directly configurable in Go Driver 2.0. +// To configure the struct encode and decode behavior, use the configuration +// methods on a [go.mongodb.org/mongo-driver/bson.Encoder] or +// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the struct encode +// and decode behavior for a mongo.Client, use +// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions]. +// +// For example, to configure a mongo.Client to omit zero-value structs when +// using the "omitempty" struct tag, use: +// +// opt := options.Client().SetBSONOptions(&options.BSONOptions{ +// OmitZeroStruct: true, +// }) +// +// See the deprecation notice for each field in StructCodec for the corresponding +// settings. type StructCodec struct { - cache map[reflect.Type]*structDescription - l sync.RWMutex - parser StructTagParser - DecodeZeroStruct bool - DecodeDeepZeroInline bool - EncodeOmitDefaultStruct bool - AllowUnexportedFields bool + cache sync.Map // map[reflect.Type]*structDescription + parser StructTagParser + + // DecodeZeroStruct causes DecodeValue to delete any existing values from Go structs in the + // destination value passed to Decode before unmarshaling BSON documents into them. + // + // Deprecated: Use bson.Decoder.ZeroStructs or options.BSONOptions.ZeroStructs instead. + DecodeZeroStruct bool + + // DecodeDeepZeroInline causes DecodeValue to delete any existing values from Go structs in the + // destination value passed to Decode before unmarshaling BSON documents into them. + // + // Deprecated: DecodeDeepZeroInline will not be supported in Go Driver 2.0. + DecodeDeepZeroInline bool + + // EncodeOmitDefaultStruct causes the Encoder to consider the zero value for a struct (e.g. + // MyStruct{}) as empty and omit it from the marshaled BSON when the "omitempty" struct tag + // option is set. + // + // Deprecated: Use bson.Encoder.OmitZeroStruct or options.BSONOptions.OmitZeroStruct instead. + EncodeOmitDefaultStruct bool + + // AllowUnexportedFields allows encoding and decoding values from un-exported struct fields. + // + // Deprecated: AllowUnexportedFields does not work on recent versions of Go and will not be + // supported in Go Driver 2.0. + AllowUnexportedFields bool + + // OverwriteDuplicatedInlinedFields, if false, causes EncodeValue to return an error if there is + // a duplicate field in the marshaled BSON when the "inline" struct tag option is set. The + // default value is true. + // + // Deprecated: Use bson.Encoder.ErrorOnInlineDuplicates or + // options.BSONOptions.ErrorOnInlineDuplicates instead. OverwriteDuplicatedInlinedFields bool } @@ -74,6 +118,9 @@ var _ ValueEncoder = &StructCodec{} var _ ValueDecoder = &StructCodec{} // NewStructCodec returns a StructCodec that uses p for struct tag parsing. +// +// Deprecated: NewStructCodec will not be available in Go Driver 2.0. See +// [StructCodec] for more details. func NewStructCodec(p StructTagParser, opts ...*bsonoptions.StructCodecOptions) (*StructCodec, error) { if p == nil { return nil, errors.New("a StructTagParser must be provided to NewStructCodec") @@ -82,7 +129,6 @@ func NewStructCodec(p StructTagParser, opts ...*bsonoptions.StructCodecOptions) structOpt := bsonoptions.MergeStructCodecOptions(opts...) codec := &StructCodec{ - cache: make(map[reflect.Type]*structDescription), parser: p, } @@ -106,12 +152,12 @@ func NewStructCodec(p StructTagParser, opts ...*bsonoptions.StructCodecOptions) } // EncodeValue handles encoding generic struct types. -func (sc *StructCodec) EncodeValue(r EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +func (sc *StructCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Kind() != reflect.Struct { return ValueEncoderError{Name: "StructCodec.EncodeValue", Kinds: []reflect.Kind{reflect.Struct}, Received: val} } - sd, err := sc.describeStruct(r.Registry, val.Type()) + sd, err := sc.describeStruct(ec.Registry, val.Type(), ec.useJSONStructTags, ec.errorOnInlineDuplicates) if err != nil { return err } @@ -131,13 +177,13 @@ func (sc *StructCodec) EncodeValue(r EncodeContext, vw bsonrw.ValueWriter, val r } } - desc.encoder, rv, err = defaultValueEncoders.lookupElementEncoder(r, desc.encoder, rv) + desc.encoder, rv, err = defaultValueEncoders.lookupElementEncoder(ec, desc.encoder, rv) - if err != nil && err != errInvalidValue { + if err != nil && !errors.Is(err, errInvalidValue) { return err } - if err == errInvalidValue { + if errors.Is(err, errInvalidValue) { if desc.omitEmpty { continue } @@ -158,17 +204,17 @@ func (sc *StructCodec) EncodeValue(r EncodeContext, vw bsonrw.ValueWriter, val r encoder := desc.encoder - var isZero bool - rvInterface := rv.Interface() + var empty bool if cz, ok := encoder.(CodecZeroer); ok { - isZero = cz.IsTypeZero(rvInterface) + empty = cz.IsTypeZero(rv.Interface()) } else if rv.Kind() == reflect.Interface { - // sc.isZero will not treat an interface rv as an interface, so we need to check for the zero interface separately. - isZero = rv.IsNil() + // isEmpty will not treat an interface rv as an interface, so we need to check for the + // nil interface separately. + empty = rv.IsNil() } else { - isZero = sc.isZero(rvInterface) + empty = isEmpty(rv, sc.EncodeOmitDefaultStruct || ec.omitZeroStruct) } - if desc.omitEmpty && isZero { + if desc.omitEmpty && empty { continue } @@ -177,7 +223,17 @@ func (sc *StructCodec) EncodeValue(r EncodeContext, vw bsonrw.ValueWriter, val r return err } - ectx := EncodeContext{Registry: r.Registry, MinSize: desc.minSize} + ectx := EncodeContext{ + Registry: ec.Registry, + MinSize: desc.minSize || ec.MinSize, + errorOnInlineDuplicates: ec.errorOnInlineDuplicates, + stringifyMapKeysWithFmt: ec.stringifyMapKeysWithFmt, + nilMapAsEmpty: ec.nilMapAsEmpty, + nilSliceAsEmpty: ec.nilSliceAsEmpty, + nilByteSliceAsEmpty: ec.nilByteSliceAsEmpty, + omitZeroStruct: ec.omitZeroStruct, + useJSONStructTags: ec.useJSONStructTags, + } err = encoder.EncodeValue(ectx, vw2, rv) if err != nil { return err @@ -191,15 +247,15 @@ func (sc *StructCodec) EncodeValue(r EncodeContext, vw bsonrw.ValueWriter, val r return exists } - return defaultMapCodec.mapEncodeValue(r, dw, rv, collisionFn) + return defaultMapCodec.mapEncodeValue(ec, dw, rv, collisionFn) } return dw.WriteDocumentEnd() } func newDecodeError(key string, original error) error { - de, ok := original.(*DecodeError) - if !ok { + var de *DecodeError + if !errors.As(original, &de) { return &DecodeError{ keys: []string{key}, wrapped: original, @@ -213,7 +269,7 @@ func newDecodeError(key string, original error) error { // DecodeValue implements the Codec interface. // By default, map types in val will not be cleared. If a map has existing key/value pairs, it will be extended with the new ones from vr. // For slices, the decoder will set the length of the slice to zero and append all elements. The underlying array will not be cleared. -func (sc *StructCodec) DecodeValue(r DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { +func (sc *StructCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Kind() != reflect.Struct { return ValueDecoderError{Name: "StructCodec.DecodeValue", Kinds: []reflect.Kind{reflect.Struct}, Received: val} } @@ -238,12 +294,12 @@ func (sc *StructCodec) DecodeValue(r DecodeContext, vr bsonrw.ValueReader, val r return fmt.Errorf("cannot decode %v into a %s", vrType, val.Type()) } - sd, err := sc.describeStruct(r.Registry, val.Type()) + sd, err := sc.describeStruct(dc.Registry, val.Type(), dc.useJSONStructTags, false) if err != nil { return err } - if sc.DecodeZeroStruct { + if sc.DecodeZeroStruct || dc.zeroStructs { val.Set(reflect.Zero(val.Type())) } if sc.DecodeDeepZeroInline && sd.inline { @@ -254,7 +310,7 @@ func (sc *StructCodec) DecodeValue(r DecodeContext, vr bsonrw.ValueReader, val r var inlineMap reflect.Value if sd.inlineMap >= 0 { inlineMap = val.Field(sd.inlineMap) - decoder, err = r.LookupDecoder(inlineMap.Type().Elem()) + decoder, err = dc.LookupDecoder(inlineMap.Type().Elem()) if err != nil { return err } @@ -267,7 +323,7 @@ func (sc *StructCodec) DecodeValue(r DecodeContext, vr bsonrw.ValueReader, val r for { name, vr, err := dr.ReadElement() - if err == bsonrw.ErrEOD { + if errors.Is(err, bsonrw.ErrEOD) { break } if err != nil { @@ -298,8 +354,8 @@ func (sc *StructCodec) DecodeValue(r DecodeContext, vr bsonrw.ValueReader, val r } elem := reflect.New(inlineMap.Type().Elem()).Elem() - r.Ancestor = inlineMap.Type() - err = decoder.DecodeValue(r, vr, elem) + dc.Ancestor = inlineMap.Type() + err = decoder.DecodeValue(dc, vr, elem) if err != nil { return err } @@ -326,19 +382,22 @@ func (sc *StructCodec) DecodeValue(r DecodeContext, vr bsonrw.ValueReader, val r } field = field.Addr() - dctx := DecodeContext{Registry: r.Registry, Truncate: fd.truncate || r.Truncate} + dctx := DecodeContext{ + Registry: dc.Registry, + Truncate: fd.truncate || dc.Truncate, + defaultDocumentType: dc.defaultDocumentType, + binaryAsSlice: dc.binaryAsSlice, + useJSONStructTags: dc.useJSONStructTags, + useLocalTimeZone: dc.useLocalTimeZone, + zeroMaps: dc.zeroMaps, + zeroStructs: dc.zeroStructs, + } + if fd.decoder == nil { return newDecodeError(fd.name, ErrNoDecoder{Type: field.Elem().Type()}) } - if decoder, ok := fd.decoder.(ValueDecoder); ok { - err = decoder.DecodeValue(dctx, vr, field.Elem()) - if err != nil { - return newDecodeError(fd.name, err) - } - continue - } - err = fd.decoder.DecodeValue(dctx, vr, field) + err = fd.decoder.DecodeValue(dctx, vr, field.Elem()) if err != nil { return newDecodeError(fd.name, err) } @@ -347,51 +406,35 @@ func (sc *StructCodec) DecodeValue(r DecodeContext, vr bsonrw.ValueReader, val r return nil } -func (sc *StructCodec) isZero(i interface{}) bool { - v := reflect.ValueOf(i) - - // check the value validity - if !v.IsValid() { - return true +func isEmpty(v reflect.Value, omitZeroStruct bool) bool { + kind := v.Kind() + if (kind != reflect.Ptr || !v.IsNil()) && v.Type().Implements(tZeroer) { + return v.Interface().(Zeroer).IsZero() } - - if z, ok := v.Interface().(Zeroer); ok && (v.Kind() != reflect.Ptr || !v.IsNil()) { - return z.IsZero() - } - - switch v.Kind() { + switch kind { case reflect.Array, reflect.Map, reflect.Slice, reflect.String: return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() case reflect.Struct: - if sc.EncodeOmitDefaultStruct { - vt := v.Type() - if vt == tTime { - return v.Interface().(time.Time).IsZero() + if !omitZeroStruct { + return false + } + vt := v.Type() + if vt == tTime { + return v.Interface().(time.Time).IsZero() + } + numField := vt.NumField() + for i := 0; i < numField; i++ { + ff := vt.Field(i) + if ff.PkgPath != "" && !ff.Anonymous { + continue // Private field } - for i := 0; i < v.NumField(); i++ { - if vt.Field(i).PkgPath != "" && !vt.Field(i).Anonymous { - continue // Private field - } - fld := v.Field(i) - if !sc.isZero(fld.Interface()) { - return false - } + if !isEmpty(v.Field(i), omitZeroStruct) { + return false } - return true } + return true } - - return false + return !v.IsValid() || v.IsZero() } type structDescription struct { @@ -442,16 +485,35 @@ func (bi byIndex) Less(i, j int) bool { return len(bi[i].inline) < len(bi[j].inline) } -func (sc *StructCodec) describeStruct(r *Registry, t reflect.Type) (*structDescription, error) { +func (sc *StructCodec) describeStruct( + r *Registry, + t reflect.Type, + useJSONStructTags bool, + errorOnDuplicates bool, +) (*structDescription, error) { // We need to analyze the struct, including getting the tags, collecting // information about inlining, and create a map of the field name to the field. - sc.l.RLock() - ds, exists := sc.cache[t] - sc.l.RUnlock() - if exists { - return ds, nil + if v, ok := sc.cache.Load(t); ok { + return v.(*structDescription), nil + } + // TODO(charlie): Only describe the struct once when called + // concurrently with the same type. + ds, err := sc.describeStructSlow(r, t, useJSONStructTags, errorOnDuplicates) + if err != nil { + return nil, err + } + if v, loaded := sc.cache.LoadOrStore(t, ds); loaded { + ds = v.(*structDescription) } + return ds, nil +} +func (sc *StructCodec) describeStructSlow( + r *Registry, + t reflect.Type, + useJSONStructTags bool, + errorOnDuplicates bool, +) (*structDescription, error) { numFields := t.NumField() sd := &structDescription{ fm: make(map[string]fieldDescription, numFields), @@ -484,7 +546,14 @@ func (sc *StructCodec) describeStruct(r *Registry, t reflect.Type) (*structDescr decoder: decoder, } - stags, err := sc.parser.ParseStructTags(sf) + var stags StructTags + // If the caller requested that we use JSON struct tags, use the JSONFallbackStructTagParser + // instead of the parser defined on the codec. + if useJSONStructTags { + stags, err = JSONFallbackStructTagParser.ParseStructTags(sf) + } else { + stags, err = sc.parser.ParseStructTags(sf) + } if err != nil { return nil, err } @@ -514,7 +583,7 @@ func (sc *StructCodec) describeStruct(r *Registry, t reflect.Type) (*structDescr } fallthrough case reflect.Struct: - inlinesf, err := sc.describeStruct(r, sfType) + inlinesf, err := sc.describeStruct(r, sfType, useJSONStructTags, errorOnDuplicates) if err != nil { return nil, err } @@ -566,8 +635,8 @@ func (sc *StructCodec) describeStruct(r *Registry, t reflect.Type) (*structDescr continue } dominant, ok := dominantField(fields[i : i+advance]) - if !ok || !sc.OverwriteDuplicatedInlinedFields { - return nil, fmt.Errorf("struct %s) duplicated key %s", t.String(), name) + if !ok || !sc.OverwriteDuplicatedInlinedFields || errorOnDuplicates { + return nil, fmt.Errorf("struct %s has duplicated key %s", t.String(), name) } sd.fl = append(sd.fl, dominant) sd.fm[name] = dominant @@ -575,10 +644,6 @@ func (sc *StructCodec) describeStruct(r *Registry, t reflect.Type) (*structDescr sort.Sort(byIndex(sd.fl)) - sc.l.Lock() - sc.cache[t] = sd - sc.l.Unlock() - return sd, nil } @@ -636,21 +701,21 @@ func getInlineField(val reflect.Value, index []int) (reflect.Value, error) { // DeepZero returns recursive zero object func deepZero(st reflect.Type) (result reflect.Value) { - result = reflect.Indirect(reflect.New(st)) - - if result.Kind() == reflect.Struct { - for i := 0; i < result.NumField(); i++ { - if f := result.Field(i); f.Kind() == reflect.Ptr { - if f.CanInterface() { - if ft := reflect.TypeOf(f.Interface()); ft.Elem().Kind() == reflect.Struct { - result.Field(i).Set(recursivePointerTo(deepZero(ft.Elem()))) - } + if st.Kind() == reflect.Struct { + numField := st.NumField() + for i := 0; i < numField; i++ { + if result == emptyValue { + result = reflect.Indirect(reflect.New(st)) + } + f := result.Field(i) + if f.CanInterface() { + if f.Type().Kind() == reflect.Struct { + result.Field(i).Set(recursivePointerTo(deepZero(f.Type().Elem()))) } } } } - - return + return result } // recursivePointerTo calls reflect.New(v.Type) but recursively for its fields inside diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_tag_parser.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_tag_parser.go index 6f406c1623..18d85bfb03 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_tag_parser.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_tag_parser.go @@ -12,12 +12,16 @@ import ( ) // StructTagParser returns the struct tags for a given struct field. +// +// Deprecated: Defining custom BSON struct tag parsers will not be supported in Go Driver 2.0. type StructTagParser interface { ParseStructTags(reflect.StructField) (StructTags, error) } // StructTagParserFunc is an adapter that allows a generic function to be used // as a StructTagParser. +// +// Deprecated: Defining custom BSON struct tag parsers will not be supported in Go Driver 2.0. type StructTagParserFunc func(reflect.StructField) (StructTags, error) // ParseStructTags implements the StructTagParser interface. @@ -34,23 +38,23 @@ func (stpf StructTagParserFunc) ParseStructTags(sf reflect.StructField) (StructT // // The properties are defined below: // -// OmitEmpty Only include the field if it's not set to the zero value for the type or to -// empty slices or maps. +// OmitEmpty Only include the field if it's not set to the zero value for the type or to +// empty slices or maps. // -// MinSize Marshal an integer of a type larger than 32 bits value as an int32, if that's -// feasible while preserving the numeric value. +// MinSize Marshal an integer of a type larger than 32 bits value as an int32, if that's +// feasible while preserving the numeric value. // -// Truncate When unmarshaling a BSON double, it is permitted to lose precision to fit within -// a float32. +// Truncate When unmarshaling a BSON double, it is permitted to lose precision to fit within +// a float32. // -// Inline Inline the field, which must be a struct or a map, causing all of its fields -// or keys to be processed as if they were part of the outer struct. For maps, -// keys must not conflict with the bson keys of other struct fields. +// Inline Inline the field, which must be a struct or a map, causing all of its fields +// or keys to be processed as if they were part of the outer struct. For maps, +// keys must not conflict with the bson keys of other struct fields. // -// Skip This struct field should be skipped. This is usually denoted by parsing a "-" -// for the name. +// Skip This struct field should be skipped. This is usually denoted by parsing a "-" +// for the name. // -// TODO(skriptble): Add tags for undefined as nil and for null as nil. +// Deprecated: Defining custom BSON struct tag parsers will not be supported in Go Driver 2.0. type StructTags struct { Name string OmitEmpty bool @@ -67,24 +71,26 @@ type StructTags struct { // If there is no name in the struct tag fields, the struct field name is lowercased. // The tag formats accepted are: // -// "[][,[,]]" +// "[][,[,]]" // -// `(...) bson:"[][,[,]]" (...)` +// `(...) bson:"[][,[,]]" (...)` // // An example: // -// type T struct { -// A bool -// B int "myb" -// C string "myc,omitempty" -// D string `bson:",omitempty" json:"jsonkey"` -// E int64 ",minsize" -// F int64 "myf,omitempty,minsize" -// } +// type T struct { +// A bool +// B int "myb" +// C string "myc,omitempty" +// D string `bson:",omitempty" json:"jsonkey"` +// E int64 ",minsize" +// F int64 "myf,omitempty,minsize" +// } // // A struct tag either consisting entirely of '-' or with a bson key with a // value consisting entirely of '-' will return a StructTags with Skip true and // the remaining fields will be their default values. +// +// Deprecated: DefaultStructTagParser will be removed in Go Driver 2.0. var DefaultStructTagParser StructTagParserFunc = func(sf reflect.StructField) (StructTags, error) { key := strings.ToLower(sf.Name) tag, ok := sf.Tag.Lookup("bson") @@ -125,6 +131,9 @@ func parseTags(key string, tag string) (StructTags, error) { // JSONFallbackStructTagParser has the same behavior as DefaultStructTagParser // but will also fallback to parsing the json tag instead on a field where the // bson tag isn't available. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.UseJSONStructTags] and +// [go.mongodb.org/mongo-driver/bson.Decoder.UseJSONStructTags] instead. var JSONFallbackStructTagParser StructTagParserFunc = func(sf reflect.StructField) (StructTags, error) { key := strings.ToLower(sf.Name) tag, ok := sf.Tag.Lookup("bson") diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/time_codec.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/time_codec.go index ec7e30f724..22fb762c41 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/time_codec.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/time_codec.go @@ -22,18 +22,42 @@ const ( ) // TimeCodec is the Codec used for time.Time values. +// +// Deprecated: TimeCodec will not be directly configurable in Go Driver 2.0. +// To configure the time.Time encode and decode behavior, use the configuration +// methods on a [go.mongodb.org/mongo-driver/bson.Encoder] or +// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the time.Time encode +// and decode behavior for a mongo.Client, use +// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions]. +// +// For example, to configure a mongo.Client to ..., use: +// +// opt := options.Client().SetBSONOptions(&options.BSONOptions{ +// UseLocalTimeZone: true, +// }) +// +// See the deprecation notice for each field in TimeCodec for the corresponding +// settings. type TimeCodec struct { + // UseLocalTimeZone specifies if we should decode into the local time zone. Defaults to false. + // + // Deprecated: Use bson.Decoder.UseLocalTimeZone or options.BSONOptions.UseLocalTimeZone + // instead. UseLocalTimeZone bool } var ( defaultTimeCodec = NewTimeCodec() - _ ValueCodec = defaultTimeCodec + // Assert that defaultTimeCodec satisfies the typeDecoder interface, which allows it to be used + // by collection type decoders (e.g. map, slice, etc) to set individual values in a collection. _ typeDecoder = defaultTimeCodec ) // NewTimeCodec returns a TimeCodec with options opts. +// +// Deprecated: NewTimeCodec will not be available in Go Driver 2.0. See +// [TimeCodec] for more details. func NewTimeCodec(opts ...*bsonoptions.TimeCodecOptions) *TimeCodec { timeOpt := bsonoptions.MergeTimeCodecOptions(opts...) @@ -95,7 +119,7 @@ func (tc *TimeCodec) decodeType(dc DecodeContext, vr bsonrw.ValueReader, t refle return emptyValue, fmt.Errorf("cannot decode %v into a time.Time", vrType) } - if !tc.UseLocalTimeZone { + if !tc.UseLocalTimeZone && !dc.useLocalTimeZone { timeVal = timeVal.UTC() } return reflect.ValueOf(timeVal), nil @@ -117,7 +141,7 @@ func (tc *TimeCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val re } // EncodeValue is the ValueEncoderFunc for time.TIme. -func (tc *TimeCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +func (tc *TimeCodec) EncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tTime { return ValueEncoderError{Name: "TimeEncodeValue", Types: []reflect.Type{tTime}, Received: val} } diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go index fb5b51084d..6ade17b7d3 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go @@ -16,36 +16,12 @@ import ( "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" ) -var ptBool = reflect.TypeOf((*bool)(nil)) -var ptInt8 = reflect.TypeOf((*int8)(nil)) -var ptInt16 = reflect.TypeOf((*int16)(nil)) -var ptInt32 = reflect.TypeOf((*int32)(nil)) -var ptInt64 = reflect.TypeOf((*int64)(nil)) -var ptInt = reflect.TypeOf((*int)(nil)) -var ptUint8 = reflect.TypeOf((*uint8)(nil)) -var ptUint16 = reflect.TypeOf((*uint16)(nil)) -var ptUint32 = reflect.TypeOf((*uint32)(nil)) -var ptUint64 = reflect.TypeOf((*uint64)(nil)) -var ptUint = reflect.TypeOf((*uint)(nil)) -var ptFloat32 = reflect.TypeOf((*float32)(nil)) -var ptFloat64 = reflect.TypeOf((*float64)(nil)) -var ptString = reflect.TypeOf((*string)(nil)) - var tBool = reflect.TypeOf(false) -var tFloat32 = reflect.TypeOf(float32(0)) var tFloat64 = reflect.TypeOf(float64(0)) -var tInt = reflect.TypeOf(int(0)) -var tInt8 = reflect.TypeOf(int8(0)) -var tInt16 = reflect.TypeOf(int16(0)) var tInt32 = reflect.TypeOf(int32(0)) var tInt64 = reflect.TypeOf(int64(0)) var tString = reflect.TypeOf("") var tTime = reflect.TypeOf(time.Time{}) -var tUint = reflect.TypeOf(uint(0)) -var tUint8 = reflect.TypeOf(uint8(0)) -var tUint16 = reflect.TypeOf(uint16(0)) -var tUint32 = reflect.TypeOf(uint32(0)) -var tUint64 = reflect.TypeOf(uint64(0)) var tEmpty = reflect.TypeOf((*interface{})(nil)).Elem() var tByteSlice = reflect.TypeOf([]byte(nil)) @@ -58,6 +34,7 @@ var tValueUnmarshaler = reflect.TypeOf((*ValueUnmarshaler)(nil)).Elem() var tMarshaler = reflect.TypeOf((*Marshaler)(nil)).Elem() var tUnmarshaler = reflect.TypeOf((*Unmarshaler)(nil)).Elem() var tProxy = reflect.TypeOf((*Proxy)(nil)).Elem() +var tZeroer = reflect.TypeOf((*Zeroer)(nil)).Elem() var tBinary = reflect.TypeOf(primitive.Binary{}) var tUndefined = reflect.TypeOf(primitive.Undefined{}) @@ -74,7 +51,6 @@ var tDecimal = reflect.TypeOf(primitive.Decimal128{}) var tMinKey = reflect.TypeOf(primitive.MinKey{}) var tMaxKey = reflect.TypeOf(primitive.MaxKey{}) var tD = reflect.TypeOf(primitive.D{}) -var tM = reflect.TypeOf(primitive.M{}) var tA = reflect.TypeOf(primitive.A{}) var tE = reflect.TypeOf(primitive.E{}) diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go index 0b21ce999c..8525472769 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go @@ -17,18 +17,43 @@ import ( ) // UIntCodec is the Codec used for uint values. +// +// Deprecated: UIntCodec will not be directly configurable in Go Driver 2.0. To +// configure the uint encode and decode behavior, use the configuration methods +// on a [go.mongodb.org/mongo-driver/bson.Encoder] or +// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the uint encode and +// decode behavior for a mongo.Client, use +// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions]. +// +// For example, to configure a mongo.Client to marshal Go uint values as the +// minimum BSON int size that can represent the value, use: +// +// opt := options.Client().SetBSONOptions(&options.BSONOptions{ +// IntMinSize: true, +// }) +// +// See the deprecation notice for each field in UIntCodec for the corresponding +// settings. type UIntCodec struct { + // EncodeToMinSize causes EncodeValue to marshal Go uint values (excluding uint64) as the + // minimum BSON int size (either 32-bit or 64-bit) that can represent the integer value. + // + // Deprecated: Use bson.Encoder.IntMinSize or options.BSONOptions.IntMinSize instead. EncodeToMinSize bool } var ( defaultUIntCodec = NewUIntCodec() - _ ValueCodec = defaultUIntCodec + // Assert that defaultUIntCodec satisfies the typeDecoder interface, which allows it to be used + // by collection type decoders (e.g. map, slice, etc) to set individual values in a collection. _ typeDecoder = defaultUIntCodec ) // NewUIntCodec returns a UIntCodec with options opts. +// +// Deprecated: NewUIntCodec will not be available in Go Driver 2.0. See +// [UIntCodec] for more details. func NewUIntCodec(opts ...*bsonoptions.UIntCodecOptions) *UIntCodec { uintOpt := bsonoptions.MergeUIntCodecOptions(opts...) diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/byte_slice_codec_options.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/byte_slice_codec_options.go index b1256a4dca..996bd17127 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/byte_slice_codec_options.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/byte_slice_codec_options.go @@ -7,22 +7,33 @@ package bsonoptions // ByteSliceCodecOptions represents all possible options for byte slice encoding and decoding. +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. type ByteSliceCodecOptions struct { EncodeNilAsEmpty *bool // Specifies if a nil byte slice should encode as an empty binary instead of null. Defaults to false. } // ByteSliceCodec creates a new *ByteSliceCodecOptions +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. func ByteSliceCodec() *ByteSliceCodecOptions { return &ByteSliceCodecOptions{} } // SetEncodeNilAsEmpty specifies if a nil byte slice should encode as an empty binary instead of null. Defaults to false. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.NilByteSliceAsEmpty] instead. func (bs *ByteSliceCodecOptions) SetEncodeNilAsEmpty(b bool) *ByteSliceCodecOptions { bs.EncodeNilAsEmpty = &b return bs } // MergeByteSliceCodecOptions combines the given *ByteSliceCodecOptions into a single *ByteSliceCodecOptions in a last one wins fashion. +// +// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a +// single options struct instead. func MergeByteSliceCodecOptions(opts ...*ByteSliceCodecOptions) *ByteSliceCodecOptions { bs := ByteSliceCodec() for _, opt := range opts { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/doc.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/doc.go new file mode 100644 index 0000000000..c40973c8d4 --- /dev/null +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/doc.go @@ -0,0 +1,8 @@ +// Copyright (C) MongoDB, Inc. 2022-present. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +// Package bsonoptions defines the optional configurations for the BSON codecs. +package bsonoptions diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/empty_interface_codec_options.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/empty_interface_codec_options.go index 6caaa000e6..f522c7e03f 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/empty_interface_codec_options.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/empty_interface_codec_options.go @@ -7,22 +7,33 @@ package bsonoptions // EmptyInterfaceCodecOptions represents all possible options for interface{} encoding and decoding. +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. type EmptyInterfaceCodecOptions struct { DecodeBinaryAsSlice *bool // Specifies if Old and Generic type binarys should default to []slice instead of primitive.Binary. Defaults to false. } // EmptyInterfaceCodec creates a new *EmptyInterfaceCodecOptions +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. func EmptyInterfaceCodec() *EmptyInterfaceCodecOptions { return &EmptyInterfaceCodecOptions{} } // SetDecodeBinaryAsSlice specifies if Old and Generic type binarys should default to []slice instead of primitive.Binary. Defaults to false. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.BinaryAsSlice] instead. func (e *EmptyInterfaceCodecOptions) SetDecodeBinaryAsSlice(b bool) *EmptyInterfaceCodecOptions { e.DecodeBinaryAsSlice = &b return e } // MergeEmptyInterfaceCodecOptions combines the given *EmptyInterfaceCodecOptions into a single *EmptyInterfaceCodecOptions in a last one wins fashion. +// +// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a +// single options struct instead. func MergeEmptyInterfaceCodecOptions(opts ...*EmptyInterfaceCodecOptions) *EmptyInterfaceCodecOptions { e := EmptyInterfaceCodec() for _, opt := range opts { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/map_codec_options.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/map_codec_options.go index 7a6a880b88..a7a7c1d980 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/map_codec_options.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/map_codec_options.go @@ -7,6 +7,9 @@ package bsonoptions // MapCodecOptions represents all possible options for map encoding and decoding. +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. type MapCodecOptions struct { DecodeZerosMap *bool // Specifies if the map should be zeroed before decoding into it. Defaults to false. EncodeNilAsEmpty *bool // Specifies if a nil map should encode as an empty document instead of null. Defaults to false. @@ -19,17 +22,24 @@ type MapCodecOptions struct { } // MapCodec creates a new *MapCodecOptions +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. func MapCodec() *MapCodecOptions { return &MapCodecOptions{} } // SetDecodeZerosMap specifies if the map should be zeroed before decoding into it. Defaults to false. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.ZeroMaps] instead. func (t *MapCodecOptions) SetDecodeZerosMap(b bool) *MapCodecOptions { t.DecodeZerosMap = &b return t } // SetEncodeNilAsEmpty specifies if a nil map should encode as an empty document instead of null. Defaults to false. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.NilMapAsEmpty] instead. func (t *MapCodecOptions) SetEncodeNilAsEmpty(b bool) *MapCodecOptions { t.EncodeNilAsEmpty = &b return t @@ -40,12 +50,17 @@ func (t *MapCodecOptions) SetEncodeNilAsEmpty(b bool) *MapCodecOptions { // type must either be a string, an integer type, or implement bsoncodec.KeyUnmarshaler. If true, keys are encoded with // fmt.Sprint() and the encoding key type must be a string, an integer type, or a float. If true, the use of Stringer // will override TextMarshaler/TextUnmarshaler. Defaults to false. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.StringifyMapKeysWithFmt] instead. func (t *MapCodecOptions) SetEncodeKeysWithStringer(b bool) *MapCodecOptions { t.EncodeKeysWithStringer = &b return t } // MergeMapCodecOptions combines the given *MapCodecOptions into a single *MapCodecOptions in a last one wins fashion. +// +// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a +// single options struct instead. func MergeMapCodecOptions(opts ...*MapCodecOptions) *MapCodecOptions { s := MapCodec() for _, opt := range opts { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/slice_codec_options.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/slice_codec_options.go index ef965e4b41..3c1e4f35ba 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/slice_codec_options.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/slice_codec_options.go @@ -7,22 +7,33 @@ package bsonoptions // SliceCodecOptions represents all possible options for slice encoding and decoding. +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. type SliceCodecOptions struct { EncodeNilAsEmpty *bool // Specifies if a nil slice should encode as an empty array instead of null. Defaults to false. } // SliceCodec creates a new *SliceCodecOptions +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. func SliceCodec() *SliceCodecOptions { return &SliceCodecOptions{} } // SetEncodeNilAsEmpty specifies if a nil slice should encode as an empty array instead of null. Defaults to false. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.NilSliceAsEmpty] instead. func (s *SliceCodecOptions) SetEncodeNilAsEmpty(b bool) *SliceCodecOptions { s.EncodeNilAsEmpty = &b return s } // MergeSliceCodecOptions combines the given *SliceCodecOptions into a single *SliceCodecOptions in a last one wins fashion. +// +// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a +// single options struct instead. func MergeSliceCodecOptions(opts ...*SliceCodecOptions) *SliceCodecOptions { s := SliceCodec() for _, opt := range opts { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go index 65964f4207..f8b76f996e 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go @@ -9,23 +9,34 @@ package bsonoptions var defaultDecodeOIDAsHex = true // StringCodecOptions represents all possible options for string encoding and decoding. +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. type StringCodecOptions struct { DecodeObjectIDAsHex *bool // Specifies if we should decode ObjectID as the hex value. Defaults to true. } // StringCodec creates a new *StringCodecOptions +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. func StringCodec() *StringCodecOptions { return &StringCodecOptions{} } // SetDecodeObjectIDAsHex specifies if object IDs should be decoded as their hex representation. If false, a string made // from the raw object ID bytes will be used. Defaults to true. +// +// Deprecated: Decoding object IDs as raw bytes will not be supported in Go Driver 2.0. func (t *StringCodecOptions) SetDecodeObjectIDAsHex(b bool) *StringCodecOptions { t.DecodeObjectIDAsHex = &b return t } // MergeStringCodecOptions combines the given *StringCodecOptions into a single *StringCodecOptions in a last one wins fashion. +// +// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a +// single options struct instead. func MergeStringCodecOptions(opts ...*StringCodecOptions) *StringCodecOptions { s := &StringCodecOptions{&defaultDecodeOIDAsHex} for _, opt := range opts { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/struct_codec_options.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/struct_codec_options.go index 78d1dd8668..1cbfa32e8b 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/struct_codec_options.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/struct_codec_options.go @@ -9,6 +9,9 @@ package bsonoptions var defaultOverwriteDuplicatedInlinedFields = true // StructCodecOptions represents all possible options for struct encoding and decoding. +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. type StructCodecOptions struct { DecodeZeroStruct *bool // Specifies if structs should be zeroed before decoding into them. Defaults to false. DecodeDeepZeroInline *bool // Specifies if structs should be recursively zeroed when a inline value is decoded. Defaults to false. @@ -18,17 +21,24 @@ type StructCodecOptions struct { } // StructCodec creates a new *StructCodecOptions +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. func StructCodec() *StructCodecOptions { return &StructCodecOptions{} } // SetDecodeZeroStruct specifies if structs should be zeroed before decoding into them. Defaults to false. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.ZeroStructs] instead. func (t *StructCodecOptions) SetDecodeZeroStruct(b bool) *StructCodecOptions { t.DecodeZeroStruct = &b return t } // SetDecodeDeepZeroInline specifies if structs should be zeroed before decoding into them. Defaults to false. +// +// Deprecated: DecodeDeepZeroInline will not be supported in Go Driver 2.0. func (t *StructCodecOptions) SetDecodeDeepZeroInline(b bool) *StructCodecOptions { t.DecodeDeepZeroInline = &b return t @@ -36,6 +46,8 @@ func (t *StructCodecOptions) SetDecodeDeepZeroInline(b bool) *StructCodecOptions // SetEncodeOmitDefaultStruct specifies if default structs should be considered empty by omitempty. A default struct has all // its values set to their default value. Defaults to false. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.OmitZeroStruct] instead. func (t *StructCodecOptions) SetEncodeOmitDefaultStruct(b bool) *StructCodecOptions { t.EncodeOmitDefaultStruct = &b return t @@ -45,18 +57,26 @@ func (t *StructCodecOptions) SetEncodeOmitDefaultStruct(b bool) *StructCodecOpti // same bson key. When true and decoding, values will be written to the outermost struct with a matching key, and when // encoding, keys will have the value of the top-most matching field. When false, decoding and encoding will error if // there are duplicate keys after the struct is inlined. Defaults to true. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.ErrorOnInlineDuplicates] instead. func (t *StructCodecOptions) SetOverwriteDuplicatedInlinedFields(b bool) *StructCodecOptions { t.OverwriteDuplicatedInlinedFields = &b return t } // SetAllowUnexportedFields specifies if unexported fields should be marshaled/unmarshaled. Defaults to false. +// +// Deprecated: AllowUnexportedFields does not work on recent versions of Go and will not be +// supported in Go Driver 2.0. func (t *StructCodecOptions) SetAllowUnexportedFields(b bool) *StructCodecOptions { t.AllowUnexportedFields = &b return t } // MergeStructCodecOptions combines the given *StructCodecOptions into a single *StructCodecOptions in a last one wins fashion. +// +// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a +// single options struct instead. func MergeStructCodecOptions(opts ...*StructCodecOptions) *StructCodecOptions { s := &StructCodecOptions{ OverwriteDuplicatedInlinedFields: &defaultOverwriteDuplicatedInlinedFields, diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/time_codec_options.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/time_codec_options.go index 13496d1217..3f38433d22 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/time_codec_options.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/time_codec_options.go @@ -7,22 +7,33 @@ package bsonoptions // TimeCodecOptions represents all possible options for time.Time encoding and decoding. +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. type TimeCodecOptions struct { UseLocalTimeZone *bool // Specifies if we should decode into the local time zone. Defaults to false. } // TimeCodec creates a new *TimeCodecOptions +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. func TimeCodec() *TimeCodecOptions { return &TimeCodecOptions{} } // SetUseLocalTimeZone specifies if we should decode into the local time zone. Defaults to false. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.UseLocalTimeZone] instead. func (t *TimeCodecOptions) SetUseLocalTimeZone(b bool) *TimeCodecOptions { t.UseLocalTimeZone = &b return t } // MergeTimeCodecOptions combines the given *TimeCodecOptions into a single *TimeCodecOptions in a last one wins fashion. +// +// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a +// single options struct instead. func MergeTimeCodecOptions(opts ...*TimeCodecOptions) *TimeCodecOptions { t := TimeCodec() for _, opt := range opts { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/uint_codec_options.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/uint_codec_options.go index e08b7f192e..5091e4d963 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/uint_codec_options.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/uint_codec_options.go @@ -7,22 +7,33 @@ package bsonoptions // UIntCodecOptions represents all possible options for uint encoding and decoding. +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. type UIntCodecOptions struct { EncodeToMinSize *bool // Specifies if all uints except uint64 should be decoded to minimum size bsontype. Defaults to false. } // UIntCodec creates a new *UIntCodecOptions +// +// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal +// and unmarshal behavior instead. func UIntCodec() *UIntCodecOptions { return &UIntCodecOptions{} } // SetEncodeToMinSize specifies if all uints except uint64 should be decoded to minimum size bsontype. Defaults to false. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.IntMinSize] instead. func (u *UIntCodecOptions) SetEncodeToMinSize(b bool) *UIntCodecOptions { u.EncodeToMinSize = &b return u } // MergeUIntCodecOptions combines the given *UIntCodecOptions into a single *UIntCodecOptions in a last one wins fashion. +// +// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a +// single options struct instead. func MergeUIntCodecOptions(opts ...*UIntCodecOptions) *UIntCodecOptions { u := UIntCodec() for _, opt := range opts { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/copier.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/copier.go index 5cdf6460bc..1e25570b85 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/copier.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/copier.go @@ -7,6 +7,7 @@ package bsonrw import ( + "errors" "fmt" "io" @@ -17,20 +18,32 @@ import ( // Copier is a type that allows copying between ValueReaders, ValueWriters, and // []byte values. +// +// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be +// supported in Go Driver 2.0. type Copier struct{} // NewCopier creates a new copier with the given registry. If a nil registry is provided // a default registry is used. +// +// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be +// supported in Go Driver 2.0. func NewCopier() Copier { return Copier{} } // CopyDocument handles copying a document from src to dst. +// +// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be +// supported in Go Driver 2.0. func CopyDocument(dst ValueWriter, src ValueReader) error { return Copier{}.CopyDocument(dst, src) } // CopyDocument handles copying one document from the src to the dst. +// +// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be +// supported in Go Driver 2.0. func (c Copier) CopyDocument(dst ValueWriter, src ValueReader) error { dr, err := src.ReadDocument() if err != nil { @@ -47,6 +60,9 @@ func (c Copier) CopyDocument(dst ValueWriter, src ValueReader) error { // CopyArrayFromBytes copies the values from a BSON array represented as a // []byte to a ValueWriter. +// +// Deprecated: Copying BSON arrays using the ValueWriter and ValueReader interfaces will not be +// supported in Go Driver 2.0. func (c Copier) CopyArrayFromBytes(dst ValueWriter, src []byte) error { aw, err := dst.WriteArray() if err != nil { @@ -63,6 +79,9 @@ func (c Copier) CopyArrayFromBytes(dst ValueWriter, src []byte) error { // CopyDocumentFromBytes copies the values from a BSON document represented as a // []byte to a ValueWriter. +// +// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be +// supported in Go Driver 2.0. func (c Copier) CopyDocumentFromBytes(dst ValueWriter, src []byte) error { dw, err := dst.WriteDocument() if err != nil { @@ -81,6 +100,9 @@ type writeElementFn func(key string) (ValueWriter, error) // CopyBytesToArrayWriter copies the values from a BSON Array represented as a []byte to an // ArrayWriter. +// +// Deprecated: Copying BSON arrays using the ArrayWriter interface will not be supported in Go +// Driver 2.0. func (c Copier) CopyBytesToArrayWriter(dst ArrayWriter, src []byte) error { wef := func(_ string) (ValueWriter, error) { return dst.WriteArrayElement() @@ -91,6 +113,9 @@ func (c Copier) CopyBytesToArrayWriter(dst ArrayWriter, src []byte) error { // CopyBytesToDocumentWriter copies the values from a BSON document represented as a []byte to a // DocumentWriter. +// +// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be +// supported in Go Driver 2.0. func (c Copier) CopyBytesToDocumentWriter(dst DocumentWriter, src []byte) error { wef := func(key string) (ValueWriter, error) { return dst.WriteDocumentElement(key) @@ -100,7 +125,7 @@ func (c Copier) CopyBytesToDocumentWriter(dst DocumentWriter, src []byte) error } func (c Copier) copyBytesToValueWriter(src []byte, wef writeElementFn) error { - // TODO(skriptble): Create errors types here. Anything thats a tag should be a property. + // TODO(skriptble): Create errors types here. Anything that is a tag should be a property. length, rem, ok := bsoncore.ReadLength(src) if !ok { return fmt.Errorf("couldn't read length from src, not enough bytes. length=%d", len(src)) @@ -150,12 +175,18 @@ func (c Copier) copyBytesToValueWriter(src []byte, wef writeElementFn) error { // CopyDocumentToBytes copies an entire document from the ValueReader and // returns it as bytes. +// +// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be +// supported in Go Driver 2.0. func (c Copier) CopyDocumentToBytes(src ValueReader) ([]byte, error) { return c.AppendDocumentBytes(nil, src) } // AppendDocumentBytes functions the same as CopyDocumentToBytes, but will // append the result to dst. +// +// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be +// supported in Go Driver 2.0. func (c Copier) AppendDocumentBytes(dst []byte, src ValueReader) ([]byte, error) { if br, ok := src.(BytesReader); ok { _, dst, err := br.ReadValueBytes(dst) @@ -163,7 +194,7 @@ func (c Copier) AppendDocumentBytes(dst []byte, src ValueReader) ([]byte, error) } vw := vwPool.Get().(*valueWriter) - defer vwPool.Put(vw) + defer putValueWriter(vw) vw.reset(dst) @@ -173,6 +204,9 @@ func (c Copier) AppendDocumentBytes(dst []byte, src ValueReader) ([]byte, error) } // AppendArrayBytes copies an array from the ValueReader to dst. +// +// Deprecated: Copying BSON arrays using the ValueWriter and ValueReader interfaces will not be +// supported in Go Driver 2.0. func (c Copier) AppendArrayBytes(dst []byte, src ValueReader) ([]byte, error) { if br, ok := src.(BytesReader); ok { _, dst, err := br.ReadValueBytes(dst) @@ -180,7 +214,7 @@ func (c Copier) AppendArrayBytes(dst []byte, src ValueReader) ([]byte, error) { } vw := vwPool.Get().(*valueWriter) - defer vwPool.Put(vw) + defer putValueWriter(vw) vw.reset(dst) @@ -190,6 +224,8 @@ func (c Copier) AppendArrayBytes(dst []byte, src ValueReader) ([]byte, error) { } // CopyValueFromBytes will write the value represtend by t and src to dst. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.UnmarshalValue] instead. func (c Copier) CopyValueFromBytes(dst ValueWriter, t bsontype.Type, src []byte) error { if wvb, ok := dst.(BytesWriter); ok { return wvb.WriteValueBytes(t, src) @@ -206,19 +242,24 @@ func (c Copier) CopyValueFromBytes(dst ValueWriter, t bsontype.Type, src []byte) // CopyValueToBytes copies a value from src and returns it as a bsontype.Type and a // []byte. +// +// Deprecated: Use [go.mongodb.org/mongo-driver/bson.MarshalValue] instead. func (c Copier) CopyValueToBytes(src ValueReader) (bsontype.Type, []byte, error) { return c.AppendValueBytes(nil, src) } // AppendValueBytes functions the same as CopyValueToBytes, but will append the // result to dst. +// +// Deprecated: Appending individual BSON elements to an existing slice will not be supported in Go +// Driver 2.0. func (c Copier) AppendValueBytes(dst []byte, src ValueReader) (bsontype.Type, []byte, error) { if br, ok := src.(BytesReader); ok { return br.ReadValueBytes(dst) } vw := vwPool.Get().(*valueWriter) - defer vwPool.Put(vw) + defer putValueWriter(vw) start := len(dst) @@ -234,6 +275,9 @@ func (c Copier) AppendValueBytes(dst []byte, src ValueReader) (bsontype.Type, [] } // CopyValue will copy a single value from src to dst. +// +// Deprecated: Copying BSON values using the ValueWriter and ValueReader interfaces will not be +// supported in Go Driver 2.0. func (c Copier) CopyValue(dst ValueWriter, src ValueReader) error { var err error switch src.Type() { @@ -399,7 +443,7 @@ func (c Copier) copyArray(dst ValueWriter, src ValueReader) error { for { vr, err := ar.ReadValue() - if err == ErrEOA { + if errors.Is(err, ErrEOA) { break } if err != nil { @@ -423,7 +467,7 @@ func (c Copier) copyArray(dst ValueWriter, src ValueReader) error { func (c Copier) copyDocumentCore(dw DocumentWriter, dr DocumentReader) error { for { key, vr, err := dr.ReadElement() - if err == ErrEOD { + if errors.Is(err, ErrEOD) { break } if err != nil { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go index 8a690e37ce..bb52a0ec3d 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go @@ -313,7 +313,7 @@ func (ejp *extJSONParser) readValue(t bsontype.Type) (*extJSONValue, error) { // convert hex to bytes bytes, err := hex.DecodeString(uuidNoHyphens) if err != nil { - return nil, fmt.Errorf("$uuid value does not follow RFC 4122 format regarding hex bytes: %v", err) + return nil, fmt.Errorf("$uuid value does not follow RFC 4122 format regarding hex bytes: %w", err) } ejp.advanceState() @@ -423,7 +423,7 @@ func (ejp *extJSONParser) readValue(t bsontype.Type) (*extJSONValue, error) { if ejp.canonical { return nil, invalidJSONErrorForType("object", t) } - return nil, invalidJSONErrorForType("ISO-8601 Internet Date/Time Format as decribed in RFC-3339", t) + return nil, invalidJSONErrorForType("ISO-8601 Internet Date/Time Format as described in RFC-3339", t) } ejp.advanceState() diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go index b83012b21c..59ddfc4485 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go @@ -7,6 +7,7 @@ package bsonrw import ( + "errors" "fmt" "io" "sync" @@ -16,11 +17,15 @@ import ( ) // ExtJSONValueReaderPool is a pool for ValueReaders that read ExtJSON. +// +// Deprecated: ExtJSONValueReaderPool will not be supported in Go Driver 2.0. type ExtJSONValueReaderPool struct { pool sync.Pool } // NewExtJSONValueReaderPool instantiates a new ExtJSONValueReaderPool. +// +// Deprecated: ExtJSONValueReaderPool will not be supported in Go Driver 2.0. func NewExtJSONValueReaderPool() *ExtJSONValueReaderPool { return &ExtJSONValueReaderPool{ pool: sync.Pool{ @@ -32,6 +37,8 @@ func NewExtJSONValueReaderPool() *ExtJSONValueReaderPool { } // Get retrieves a ValueReader from the pool and uses src as the underlying ExtJSON. +// +// Deprecated: ExtJSONValueReaderPool will not be supported in Go Driver 2.0. func (bvrp *ExtJSONValueReaderPool) Get(r io.Reader, canonical bool) (ValueReader, error) { vr := bvrp.pool.Get().(*extJSONValueReader) return vr.reset(r, canonical) @@ -39,6 +46,8 @@ func (bvrp *ExtJSONValueReaderPool) Get(r io.Reader, canonical bool) (ValueReade // Put inserts a ValueReader into the pool. If the ValueReader is not a ExtJSON ValueReader nothing // is inserted into the pool and ok will be false. +// +// Deprecated: ExtJSONValueReaderPool will not be supported in Go Driver 2.0. func (bvrp *ExtJSONValueReaderPool) Put(vr ValueReader) (ok bool) { bvr, ok := vr.(*extJSONValueReader) if !ok { @@ -164,6 +173,23 @@ func (ejvr *extJSONValueReader) skipObject() { depth := 1 for depth > 0 { ejvr.p.advanceState() + + // If object is empty, raise depth and continue. When emptyObject is true, the + // parser has already read both the opening and closing brackets of an empty + // object ("{}"), so the next valid token will be part of the parent document, + // not part of the nested document. + // + // If there is a comma, there are remaining fields, emptyObject must be set back + // to false, and comma must be skipped with advanceState(). + if ejvr.p.emptyObject { + if ejvr.p.s == jpsSawComma { + ejvr.p.emptyObject = false + ejvr.p.advanceState() + } + depth-- + continue + } + switch ejvr.p.s { case jpsSawBeginObject, jpsSawBeginArray: depth++ @@ -588,7 +614,7 @@ func (ejvr *extJSONValueReader) ReadElement() (string, ValueReader, error) { name, t, err := ejvr.p.readKey() if err != nil { - if err == ErrEOD { + if errors.Is(err, ErrEOD) { if ejvr.stack[ejvr.frame].mode == mCodeWithScope { _, err := ejvr.p.peekType() if err != nil { @@ -615,7 +641,7 @@ func (ejvr *extJSONValueReader) ReadValue() (ValueReader, error) { t, err := ejvr.p.peekType() if err != nil { - if err == ErrEOA { + if errors.Is(err, ErrEOA) { ejvr.pop() } diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go index 7bcf662135..9695704246 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go @@ -19,7 +19,7 @@ import ( ) func wrapperKeyBSONType(key string) bsontype.Type { - switch string(key) { + switch key { case "$numberInt": return bsontype.Int32 case "$numberLong": @@ -46,12 +46,6 @@ func wrapperKeyBSONType(key string) bsontype.Type { return bsontype.DBPointer case "$date": return bsontype.DateTime - case "$ref": - fallthrough - case "$id": - fallthrough - case "$db": - return bsontype.EmbeddedDocument // dbrefs aren't bson types case "$minKey": return bsontype.MinKey case "$maxKey": @@ -275,7 +269,7 @@ func (ejv *extJSONValue) parseDouble() (float64, error) { return 0, fmt.Errorf("$numberDouble value should be string, but instead is %s", ejv.t) } - switch string(ejv.v.(string)) { + switch ejv.v.(string) { case "Infinity": return math.Inf(1), nil case "-Infinity": @@ -370,7 +364,7 @@ func (ejv *extJSONValue) parseRegex() (pattern, options string, err error) { for i, key := range regexObj.keys { val := regexObj.values[i] - switch string(key) { + switch key { case "pattern": if patFound { return "", "", errors.New("duplicate pattern key in $regularExpression") diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_writer.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_writer.go index 605e41a138..bb9303167c 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_writer.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_writer.go @@ -10,7 +10,6 @@ import ( "bytes" "encoding/base64" "fmt" - "go.mongodb.org/mongo-driver/bson/primitive" "io" "math" "sort" @@ -19,20 +18,20 @@ import ( "sync" "time" "unicode/utf8" -) -var ejvwPool = sync.Pool{ - New: func() interface{} { - return new(extJSONValueWriter) - }, -} + "go.mongodb.org/mongo-driver/bson/primitive" +) // ExtJSONValueWriterPool is a pool for ExtJSON ValueWriters. +// +// Deprecated: ExtJSONValueWriterPool will not be supported in Go Driver 2.0. type ExtJSONValueWriterPool struct { pool sync.Pool } // NewExtJSONValueWriterPool creates a new pool for ValueWriter instances that write to ExtJSON. +// +// Deprecated: ExtJSONValueWriterPool will not be supported in Go Driver 2.0. func NewExtJSONValueWriterPool() *ExtJSONValueWriterPool { return &ExtJSONValueWriterPool{ pool: sync.Pool{ @@ -44,6 +43,8 @@ func NewExtJSONValueWriterPool() *ExtJSONValueWriterPool { } // Get retrieves a ExtJSON ValueWriter from the pool and resets it to use w as the destination. +// +// Deprecated: ExtJSONValueWriterPool will not be supported in Go Driver 2.0. func (bvwp *ExtJSONValueWriterPool) Get(w io.Writer, canonical, escapeHTML bool) ValueWriter { vw := bvwp.pool.Get().(*extJSONValueWriter) if writer, ok := w.(*SliceWriter); ok { @@ -58,6 +59,8 @@ func (bvwp *ExtJSONValueWriterPool) Get(w io.Writer, canonical, escapeHTML bool) // Put inserts a ValueWriter into the pool. If the ValueWriter is not a ExtJSON ValueWriter, nothing // happens and ok will be false. +// +// Deprecated: ExtJSONValueWriterPool will not be supported in Go Driver 2.0. func (bvwp *ExtJSONValueWriterPool) Put(vw ValueWriter) (ok bool) { bvw, ok := vw.(*extJSONValueWriter) if !ok { @@ -85,6 +88,7 @@ type extJSONValueWriter struct { frame int64 canonical bool escapeHTML bool + newlines bool } // NewExtJSONValueWriter creates a ValueWriter that writes Extended JSON to w. @@ -93,10 +97,13 @@ func NewExtJSONValueWriter(w io.Writer, canonical, escapeHTML bool) (ValueWriter return nil, errNilWriter } - return newExtJSONWriter(w, canonical, escapeHTML), nil + // Enable newlines for all Extended JSON value writers created by NewExtJSONValueWriter. We + // expect these value writers to be used with an Encoder, which should add newlines after + // encoded Extended JSON documents. + return newExtJSONWriter(w, canonical, escapeHTML, true), nil } -func newExtJSONWriter(w io.Writer, canonical, escapeHTML bool) *extJSONValueWriter { +func newExtJSONWriter(w io.Writer, canonical, escapeHTML, newlines bool) *extJSONValueWriter { stack := make([]ejvwState, 1, 5) stack[0] = ejvwState{mode: mTopLevel} @@ -106,6 +113,7 @@ func newExtJSONWriter(w io.Writer, canonical, escapeHTML bool) *extJSONValueWrit stack: stack, canonical: canonical, escapeHTML: escapeHTML, + newlines: newlines, } } @@ -569,6 +577,12 @@ func (ejvw *extJSONValueWriter) WriteDocumentEnd() error { case mDocument: ejvw.buf = append(ejvw.buf, ',') case mTopLevel: + // If the value writer has newlines enabled, end top-level documents with a newline so that + // multiple documents encoded to the same writer are separated by newlines. That matches the + // Go json.Encoder behavior and also works with bsonrw.NewExtJSONValueReader. + if ejvw.newlines { + ejvw.buf = append(ejvw.buf, '\n') + } if ejvw.w != nil { if _, err := ejvw.w.Write(ejvw.buf); err != nil { return err diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/json_scanner.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/json_scanner.go index 212f348348..43f3e4f383 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/json_scanner.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/json_scanner.go @@ -13,8 +13,8 @@ import ( "io" "math" "strconv" - "strings" "unicode" + "unicode/utf16" ) type jsonTokenType byte @@ -58,7 +58,7 @@ func (js *jsonScanner) nextToken() (*jsonToken, error) { c, err = js.readNextByte() } - if err == io.EOF { + if errors.Is(err, io.EOF) { return &jsonToken{t: jttEOF}, nil } else if err != nil { return nil, err @@ -162,6 +162,31 @@ func isValueTerminator(c byte) bool { return c == ',' || c == '}' || c == ']' || isWhiteSpace(c) } +// getu4 decodes the 4-byte hex sequence from the beginning of s, returning the hex value as a rune, +// or it returns -1. Note that the "\u" from the unicode escape sequence should not be present. +// It is copied and lightly modified from the Go JSON decode function at +// https://github.com/golang/go/blob/1b0a0316802b8048d69da49dc23c5a5ab08e8ae8/src/encoding/json/decode.go#L1169-L1188 +func getu4(s []byte) rune { + if len(s) < 4 { + return -1 + } + var r rune + for _, c := range s[:4] { + switch { + case '0' <= c && c <= '9': + c = c - '0' + case 'a' <= c && c <= 'f': + c = c - 'a' + 10 + case 'A' <= c && c <= 'F': + c = c - 'A' + 10 + default: + return -1 + } + r = r*16 + rune(c) + } + return r +} + // scanString reads from an opening '"' to a closing '"' and handles escaped characters func (js *jsonScanner) scanString() (*jsonToken, error) { var b bytes.Buffer @@ -173,15 +198,24 @@ func (js *jsonScanner) scanString() (*jsonToken, error) { for { c, err = js.readNextByte() if err != nil { - if err == io.EOF { + if errors.Is(err, io.EOF) { return nil, errors.New("end of input in JSON string") } return nil, err } + evalNextChar: switch c { case '\\': c, err = js.readNextByte() + if err != nil { + if errors.Is(err, io.EOF) { + return nil, errors.New("end of input in JSON string") + } + return nil, err + } + + evalNextEscapeChar: switch c { case '"', '\\', '/': b.WriteByte(c) @@ -202,13 +236,68 @@ func (js *jsonScanner) scanString() (*jsonToken, error) { return nil, fmt.Errorf("invalid unicode sequence in JSON string: %s", us) } - s := fmt.Sprintf(`\u%s`, us) - s, err = strconv.Unquote(strings.Replace(strconv.Quote(s), `\\u`, `\u`, 1)) - if err != nil { - return nil, err + rn := getu4(us) + + // If the rune we just decoded is the high or low value of a possible surrogate pair, + // try to decode the next sequence as the low value of a surrogate pair. We're + // expecting the next sequence to be another Unicode escape sequence (e.g. "\uDD1E"), + // but need to handle cases where the input is not a valid surrogate pair. + // For more context on unicode surrogate pairs, see: + // https://www.christianfscott.com/rust-chars-vs-go-runes/ + // https://www.unicode.org/glossary/#high_surrogate_code_point + if utf16.IsSurrogate(rn) { + c, err = js.readNextByte() + if err != nil { + if errors.Is(err, io.EOF) { + return nil, errors.New("end of input in JSON string") + } + return nil, err + } + + // If the next value isn't the beginning of a backslash escape sequence, write + // the Unicode replacement character for the surrogate value and goto the + // beginning of the next char eval block. + if c != '\\' { + b.WriteRune(unicode.ReplacementChar) + goto evalNextChar + } + + c, err = js.readNextByte() + if err != nil { + if errors.Is(err, io.EOF) { + return nil, errors.New("end of input in JSON string") + } + return nil, err + } + + // If the next value isn't the beginning of a unicode escape sequence, write the + // Unicode replacement character for the surrogate value and goto the beginning + // of the next escape char eval block. + if c != 'u' { + b.WriteRune(unicode.ReplacementChar) + goto evalNextEscapeChar + } + + err = js.readNNextBytes(us, 4, 0) + if err != nil { + return nil, fmt.Errorf("invalid unicode sequence in JSON string: %s", us) + } + + rn2 := getu4(us) + + // Try to decode the pair of runes as a utf16 surrogate pair. If that fails, write + // the Unicode replacement character for the surrogate value and the 2nd decoded rune. + if rnPair := utf16.DecodeRune(rn, rn2); rnPair != unicode.ReplacementChar { + b.WriteRune(rnPair) + } else { + b.WriteRune(unicode.ReplacementChar) + b.WriteRune(rn2) + } + + break } - b.WriteString(s) + b.WriteRune(rn) default: return nil, fmt.Errorf("invalid escape sequence in JSON string '\\%c'", c) } @@ -236,17 +325,17 @@ func (js *jsonScanner) scanLiteral(first byte) (*jsonToken, error) { c5, err := js.readNextByte() - if bytes.Equal([]byte("true"), lit) && (isValueTerminator(c5) || err == io.EOF) { + if bytes.Equal([]byte("true"), lit) && (isValueTerminator(c5) || errors.Is(err, io.EOF)) { js.pos = int(math.Max(0, float64(js.pos-1))) return &jsonToken{t: jttBool, v: true, p: p}, nil - } else if bytes.Equal([]byte("null"), lit) && (isValueTerminator(c5) || err == io.EOF) { + } else if bytes.Equal([]byte("null"), lit) && (isValueTerminator(c5) || errors.Is(err, io.EOF)) { js.pos = int(math.Max(0, float64(js.pos-1))) return &jsonToken{t: jttNull, v: nil, p: p}, nil } else if bytes.Equal([]byte("fals"), lit) { if c5 == 'e' { c5, err = js.readNextByte() - if isValueTerminator(c5) || err == io.EOF { + if isValueTerminator(c5) || errors.Is(err, io.EOF) { js.pos = int(math.Max(0, float64(js.pos-1))) return &jsonToken{t: jttBool, v: false, p: p}, nil } @@ -295,7 +384,7 @@ func (js *jsonScanner) scanNumber(first byte) (*jsonToken, error) { for { c, err = js.readNextByte() - if err != nil && err != io.EOF { + if err != nil && !errors.Is(err, io.EOF) { return nil, err } @@ -324,7 +413,7 @@ func (js *jsonScanner) scanNumber(first byte) (*jsonToken, error) { case '}', ']', ',': s = nssDone default: - if isWhiteSpace(c) || err == io.EOF { + if isWhiteSpace(c) || errors.Is(err, io.EOF) { s = nssDone } else { s = nssInvalid @@ -341,7 +430,7 @@ func (js *jsonScanner) scanNumber(first byte) (*jsonToken, error) { case '}', ']', ',': s = nssDone default: - if isWhiteSpace(c) || err == io.EOF { + if isWhiteSpace(c) || errors.Is(err, io.EOF) { s = nssDone } else if isDigit(c) { s = nssSawIntegerDigits @@ -366,7 +455,7 @@ func (js *jsonScanner) scanNumber(first byte) (*jsonToken, error) { case '}', ']', ',': s = nssDone default: - if isWhiteSpace(c) || err == io.EOF { + if isWhiteSpace(c) || errors.Is(err, io.EOF) { s = nssDone } else if isDigit(c) { s = nssSawFractionDigits @@ -401,7 +490,7 @@ func (js *jsonScanner) scanNumber(first byte) (*jsonToken, error) { case '}', ']', ',': s = nssDone default: - if isWhiteSpace(c) || err == io.EOF { + if isWhiteSpace(c) || errors.Is(err, io.EOF) { s = nssDone } else if isDigit(c) { s = nssSawExponentDigits diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/reader.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/reader.go index 0b8fa28d57..324b10b616 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/reader.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/reader.go @@ -58,6 +58,8 @@ type ValueReader interface { // types that implement ValueReader may also implement this interface. // // The bytes of the value will be appended to dst. +// +// Deprecated: BytesReader will not be supported in Go Driver 2.0. type BytesReader interface { ReadValueBytes(dst []byte) (bsontype.Type, []byte, error) } diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go index 55378093a2..a242bb57cf 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go @@ -28,11 +28,15 @@ var vrPool = sync.Pool{ } // BSONValueReaderPool is a pool for ValueReaders that read BSON. +// +// Deprecated: BSONValueReaderPool will not be supported in Go Driver 2.0. type BSONValueReaderPool struct { pool sync.Pool } // NewBSONValueReaderPool instantiates a new BSONValueReaderPool. +// +// Deprecated: BSONValueReaderPool will not be supported in Go Driver 2.0. func NewBSONValueReaderPool() *BSONValueReaderPool { return &BSONValueReaderPool{ pool: sync.Pool{ @@ -44,6 +48,8 @@ func NewBSONValueReaderPool() *BSONValueReaderPool { } // Get retrieves a ValueReader from the pool and uses src as the underlying BSON. +// +// Deprecated: BSONValueReaderPool will not be supported in Go Driver 2.0. func (bvrp *BSONValueReaderPool) Get(src []byte) ValueReader { vr := bvrp.pool.Get().(*valueReader) vr.reset(src) @@ -52,6 +58,8 @@ func (bvrp *BSONValueReaderPool) Get(src []byte) ValueReader { // Put inserts a ValueReader into the pool. If the ValueReader is not a BSON ValueReader nothing // is inserted into the pool and ok will be false. +// +// Deprecated: BSONValueReaderPool will not be supported in Go Driver 2.0. func (bvrp *BSONValueReaderPool) Put(vr ValueReader) (ok bool) { bvr, ok := vr.(*valueReader) if !ok { @@ -86,12 +94,11 @@ type valueReader struct { // NewBSONDocumentReader returns a ValueReader using b for the underlying BSON // representation. Parameter b must be a BSON Document. -// -// TODO(skriptble): There's a lack of symmetry between the reader and writer, since the reader takes -// a []byte while the writer takes an io.Writer. We should have two versions of each, one that takes -// a []byte and one that takes an io.Reader or io.Writer. The []byte version will need to return a -// thing that can return the finished []byte since it might be reallocated when appended to. func NewBSONDocumentReader(b []byte) ValueReader { + // TODO(skriptble): There's a lack of symmetry between the reader and writer, since the reader takes a []byte while the + // TODO writer takes an io.Writer. We should have two versions of each, one that takes a []byte and one that takes an + // TODO io.Reader or io.Writer. The []byte version will need to return a thing that can return the finished []byte since + // TODO it might be reallocated when appended to. return newValueReader(b) } @@ -384,9 +391,13 @@ func (vr *valueReader) ReadBinary() (b []byte, btype byte, err error) { if err != nil { return nil, 0, err } + // Make a copy of the returned byte slice because it's just a subslice from the valueReader's + // buffer and is not safe to return in the unmarshaled value. + cp := make([]byte, len(b)) + copy(cp, b) vr.pop() - return b, btype, nil + return cp, btype, nil } func (vr *valueReader) ReadBoolean() (bool, error) { @@ -728,8 +739,7 @@ func (vr *valueReader) ReadValue() (ValueReader, error) { return nil, ErrEOA } - _, err = vr.readCString() - if err != nil { + if err := vr.skipCString(); err != nil { return nil, err } @@ -737,6 +747,9 @@ func (vr *valueReader) ReadValue() (ValueReader, error) { return vr, nil } +// readBytes reads length bytes from the valueReader starting at the current offset. Note that the +// returned byte slice is a subslice from the valueReader buffer and must be converted or copied +// before returning in an unmarshaled value. func (vr *valueReader) readBytes(length int32) ([]byte, error) { if length < 0 { return nil, fmt.Errorf("invalid length: %d", length) @@ -748,6 +761,7 @@ func (vr *valueReader) readBytes(length int32) ([]byte, error) { start := vr.offset vr.offset += int64(length) + return vr.d[start : start+int64(length)], nil } @@ -779,25 +793,24 @@ func (vr *valueReader) readByte() (byte, error) { return vr.d[vr.offset-1], nil } -func (vr *valueReader) readCString() (string, error) { +func (vr *valueReader) skipCString() error { idx := bytes.IndexByte(vr.d[vr.offset:], 0x00) if idx < 0 { - return "", io.EOF + return io.EOF } - start := vr.offset - // idx does not include the null byte vr.offset += int64(idx) + 1 - return string(vr.d[start : start+int64(idx)]), nil + return nil } -func (vr *valueReader) skipCString() error { +func (vr *valueReader) readCString() (string, error) { idx := bytes.IndexByte(vr.d[vr.offset:], 0x00) if idx < 0 { - return io.EOF + return "", io.EOF } + start := vr.offset // idx does not include the null byte vr.offset += int64(idx) + 1 - return nil + return string(vr.d[start : start+int64(idx)]), nil } func (vr *valueReader) readString() (string, error) { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_writer.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_writer.go index 7b7d7ad3f2..311518a80d 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_writer.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_writer.go @@ -28,12 +28,23 @@ var vwPool = sync.Pool{ }, } +func putValueWriter(vw *valueWriter) { + if vw != nil { + vw.w = nil // don't leak the writer + vwPool.Put(vw) + } +} + // BSONValueWriterPool is a pool for BSON ValueWriters. +// +// Deprecated: BSONValueWriterPool will not be supported in Go Driver 2.0. type BSONValueWriterPool struct { pool sync.Pool } // NewBSONValueWriterPool creates a new pool for ValueWriter instances that write to BSON. +// +// Deprecated: BSONValueWriterPool will not be supported in Go Driver 2.0. func NewBSONValueWriterPool() *BSONValueWriterPool { return &BSONValueWriterPool{ pool: sync.Pool{ @@ -45,19 +56,21 @@ func NewBSONValueWriterPool() *BSONValueWriterPool { } // Get retrieves a BSON ValueWriter from the pool and resets it to use w as the destination. +// +// Deprecated: BSONValueWriterPool will not be supported in Go Driver 2.0. func (bvwp *BSONValueWriterPool) Get(w io.Writer) ValueWriter { vw := bvwp.pool.Get().(*valueWriter) - if writer, ok := w.(*SliceWriter); ok { - vw.reset(*writer) - vw.w = writer - return vw - } + + // TODO: Having to call reset here with the same buffer doesn't really make sense. + vw.reset(vw.buf) vw.buf = vw.buf[:0] vw.w = w return vw } // GetAtModeElement retrieves a ValueWriterFlusher from the pool and resets it to use w as the destination. +// +// Deprecated: BSONValueWriterPool will not be supported in Go Driver 2.0. func (bvwp *BSONValueWriterPool) GetAtModeElement(w io.Writer) ValueWriterFlusher { vw := bvwp.Get(w).(*valueWriter) vw.push(mElement) @@ -66,17 +79,14 @@ func (bvwp *BSONValueWriterPool) GetAtModeElement(w io.Writer) ValueWriterFlushe // Put inserts a ValueWriter into the pool. If the ValueWriter is not a BSON ValueWriter, nothing // happens and ok will be false. +// +// Deprecated: BSONValueWriterPool will not be supported in Go Driver 2.0. func (bvwp *BSONValueWriterPool) Put(vw ValueWriter) (ok bool) { bvw, ok := vw.(*valueWriter) if !ok { return false } - if _, ok := bvw.w.(*SliceWriter); ok { - bvw.buf = nil - } - bvw.w = nil - bvwp.pool.Put(bvw) return true } @@ -146,32 +156,21 @@ type valueWriter struct { } func (vw *valueWriter) advanceFrame() { - if vw.frame+1 >= int64(len(vw.stack)) { // We need to grow the stack - length := len(vw.stack) - if length+1 >= cap(vw.stack) { - // double it - buf := make([]vwState, 2*cap(vw.stack)+1) - copy(buf, vw.stack) - vw.stack = buf - } - vw.stack = vw.stack[:length+1] - } vw.frame++ + if vw.frame >= int64(len(vw.stack)) { + vw.stack = append(vw.stack, vwState{}) + } } func (vw *valueWriter) push(m mode) { vw.advanceFrame() // Clean the stack - vw.stack[vw.frame].mode = m - vw.stack[vw.frame].key = "" - vw.stack[vw.frame].arrkey = 0 - vw.stack[vw.frame].start = 0 + vw.stack[vw.frame] = vwState{mode: m} - vw.stack[vw.frame].mode = m switch m { case mDocument, mArray, mCodeWithScope: - vw.reserveLength() + vw.reserveLength() // WARN: this is not needed } } @@ -210,6 +209,7 @@ func newValueWriter(w io.Writer) *valueWriter { return vw } +// TODO: only used in tests func newValueWriterFromSlice(buf []byte) *valueWriter { vw := new(valueWriter) stack := make([]vwState, 1, 5) @@ -246,17 +246,16 @@ func (vw *valueWriter) invalidTransitionError(destination mode, name string, mod } func (vw *valueWriter) writeElementHeader(t bsontype.Type, destination mode, callerName string, addmodes ...mode) error { - switch vw.stack[vw.frame].mode { + frame := &vw.stack[vw.frame] + switch frame.mode { case mElement: - key := vw.stack[vw.frame].key + key := frame.key if !isValidCString(key) { return errors.New("BSON element key cannot contain null bytes") } - - vw.buf = bsoncore.AppendHeader(vw.buf, t, key) + vw.appendHeader(t, key) case mValue: - // TODO: Do this with a cache of the first 1000 or so array keys. - vw.buf = bsoncore.AppendHeader(vw.buf, t, strconv.Itoa(vw.stack[vw.frame].arrkey)) + vw.appendIntHeader(t, frame.arrkey) default: modes := []mode{mElement, mValue} if addmodes != nil { @@ -536,7 +535,7 @@ func (vw *valueWriter) WriteDocumentEnd() error { vw.pop() if vw.stack[vw.frame].mode == mCodeWithScope { - // We ignore the error here because of the gaurantee of writeLength. + // We ignore the error here because of the guarantee of writeLength. // See the docs for writeLength for more info. _ = vw.writeLength() vw.pop() @@ -549,10 +548,6 @@ func (vw *valueWriter) Flush() error { return nil } - if sw, ok := vw.w.(*SliceWriter); ok { - *sw = vw.buf - return nil - } if _, err := vw.w.Write(vw.buf); err != nil { return err } @@ -602,9 +597,11 @@ func (vw *valueWriter) writeLength() error { if length > maxSize { return errMaxDocumentSizeExceeded{size: int64(len(vw.buf))} } - length = length - int(vw.stack[vw.frame].start) - start := vw.stack[vw.frame].start + frame := &vw.stack[vw.frame] + length = length - int(frame.start) + start := frame.start + _ = vw.buf[start+3] // BCE vw.buf[start+0] = byte(length) vw.buf[start+1] = byte(length >> 8) vw.buf[start+2] = byte(length >> 16) @@ -613,5 +610,31 @@ func (vw *valueWriter) writeLength() error { } func isValidCString(cs string) bool { - return !strings.ContainsRune(cs, '\x00') + // Disallow the zero byte in a cstring because the zero byte is used as the + // terminating character. + // + // It's safe to check bytes instead of runes because all multibyte UTF-8 + // code points start with (binary) 11xxxxxx or 10xxxxxx, so 00000000 (i.e. + // 0) will never be part of a multibyte UTF-8 code point. This logic is the + // same as the "r < utf8.RuneSelf" case in strings.IndexRune but can be + // inlined. + // + // https://cs.opensource.google/go/go/+/refs/tags/go1.21.1:src/strings/strings.go;l=127 + return strings.IndexByte(cs, 0) == -1 +} + +// appendHeader is the same as bsoncore.AppendHeader but does not check if the +// key is a valid C string since the caller has already checked for that. +// +// The caller of this function must check if key is a valid C string. +func (vw *valueWriter) appendHeader(t bsontype.Type, key string) { + vw.buf = bsoncore.AppendType(vw.buf, t) + vw.buf = append(vw.buf, key...) + vw.buf = append(vw.buf, 0x00) +} + +func (vw *valueWriter) appendIntHeader(t bsontype.Type, key int) { + vw.buf = bsoncore.AppendType(vw.buf, t) + vw.buf = strconv.AppendInt(vw.buf, int64(key), 10) + vw.buf = append(vw.buf, 0x00) } diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/writer.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/writer.go index 7644df1290..628f452932 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/writer.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/writer.go @@ -56,6 +56,8 @@ type ValueWriter interface { } // ValueWriterFlusher is a superset of ValueWriter that exposes functionality to flush to the underlying buffer. +// +// Deprecated: ValueWriterFlusher will not be supported in Go Driver 2.0. type ValueWriterFlusher interface { ValueWriter Flush() error @@ -64,39 +66,22 @@ type ValueWriterFlusher interface { // BytesWriter is the interface used to write BSON bytes to a ValueWriter. // This interface is meant to be a superset of ValueWriter, so that types that // implement ValueWriter may also implement this interface. +// +// Deprecated: BytesWriter will not be supported in Go Driver 2.0. type BytesWriter interface { WriteValueBytes(t bsontype.Type, b []byte) error } // SliceWriter allows a pointer to a slice of bytes to be used as an io.Writer. +// +// Deprecated: SliceWriter will not be supported in Go Driver 2.0. type SliceWriter []byte +// Write writes the bytes to the underlying slice. +// +// Deprecated: SliceWriter will not be supported in Go Driver 2.0. func (sw *SliceWriter) Write(p []byte) (int, error) { written := len(p) *sw = append(*sw, p...) return written, nil } - -type writer []byte - -func (w *writer) Write(p []byte) (int, error) { - index := len(*w) - return w.WriteAt(p, int64(index)) -} - -func (w *writer) WriteAt(p []byte, off int64) (int, error) { - newend := off + int64(len(p)) - if newend < int64(len(*w)) { - newend = int64(len(*w)) - } - - if newend > int64(cap(*w)) { - buf := make([]byte, int64(2*cap(*w))+newend) - copy(buf, *w) - *w = buf - } - - *w = []byte(*w)[:newend] - copy([]byte(*w)[off:], p) - return len(p), nil -} diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsontype/bsontype.go b/vendor/go.mongodb.org/mongo-driver/bson/bsontype/bsontype.go index 63a59ca08f..255d9909e3 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsontype/bsontype.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsontype/bsontype.go @@ -8,7 +8,9 @@ // a stringifier for the Type to enable easier debugging when working with BSON. package bsontype // import "go.mongodb.org/mongo-driver/bson/bsontype" -// These constants uniquely refer to each BSON type. +// BSON element types as described in https://bsonspec.org/spec.html. +// +// Deprecated: Use bson.Type* constants instead. const ( Double Type = 0x01 String Type = 0x02 @@ -31,13 +33,21 @@ const ( Decimal128 Type = 0x13 MinKey Type = 0xFF MaxKey Type = 0x7F +) +// BSON binary element subtypes as described in https://bsonspec.org/spec.html. +// +// Deprecated: Use the bson.TypeBinary* constants instead. +const ( BinaryGeneric byte = 0x00 BinaryFunction byte = 0x01 BinaryBinaryOld byte = 0x02 BinaryUUIDOld byte = 0x03 BinaryUUID byte = 0x04 BinaryMD5 byte = 0x05 + BinaryEncrypted byte = 0x06 + BinaryColumn byte = 0x07 + BinarySensitive byte = 0x08 BinaryUserDefined byte = 0x80 ) @@ -93,3 +103,14 @@ func (bt Type) String() string { return "invalid" } } + +// IsValid will return true if the Type is valid. +func (bt Type) IsValid() bool { + switch bt { + case Double, String, EmbeddedDocument, Array, Binary, Undefined, ObjectID, Boolean, DateTime, Null, Regex, + DBPointer, JavaScript, Symbol, CodeWithScope, Int32, Timestamp, Int64, Decimal128, MinKey, MaxKey: + return true + default: + return false + } +} diff --git a/vendor/go.mongodb.org/mongo-driver/bson/decoder.go b/vendor/go.mongodb.org/mongo-driver/bson/decoder.go index 7f6b7694f9..eac74cd399 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/decoder.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/decoder.go @@ -33,6 +33,17 @@ var decPool = sync.Pool{ type Decoder struct { dc bsoncodec.DecodeContext vr bsonrw.ValueReader + + // We persist defaultDocumentM and defaultDocumentD on the Decoder to prevent overwriting from + // (*Decoder).SetContext. + defaultDocumentM bool + defaultDocumentD bool + + binaryAsSlice bool + useJSONStructTags bool + useLocalTimeZone bool + zeroMaps bool + zeroStructs bool } // NewDecoder returns a new decoder that uses the DefaultRegistry to read from vr. @@ -48,6 +59,9 @@ func NewDecoder(vr bsonrw.ValueReader) (*Decoder, error) { } // NewDecoderWithContext returns a new decoder that uses DecodeContext dc to read from vr. +// +// Deprecated: Use [NewDecoder] and use the Decoder configuration methods set the desired unmarshal +// behavior instead. func NewDecoderWithContext(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader) (*Decoder, error) { if dc.Registry == nil { dc.Registry = DefaultRegistry @@ -65,8 +79,7 @@ func NewDecoderWithContext(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader) (* // Decode reads the next BSON document from the stream and decodes it into the // value pointed to by val. // -// The documentation for Unmarshal contains details about of BSON into a Go -// value. +// See [Unmarshal] for details about BSON unmarshaling behavior. func (d *Decoder) Decode(val interface{}) error { if unmarshaler, ok := val.(Unmarshaler); ok { // TODO(skriptble): Reuse a []byte here and use the AppendDocumentBytes method. @@ -95,24 +108,101 @@ func (d *Decoder) Decode(val interface{}) error { if err != nil { return err } + + if d.defaultDocumentM { + d.dc.DefaultDocumentM() + } + if d.defaultDocumentD { + d.dc.DefaultDocumentD() + } + if d.binaryAsSlice { + d.dc.BinaryAsSlice() + } + if d.useJSONStructTags { + d.dc.UseJSONStructTags() + } + if d.useLocalTimeZone { + d.dc.UseLocalTimeZone() + } + if d.zeroMaps { + d.dc.ZeroMaps() + } + if d.zeroStructs { + d.dc.ZeroStructs() + } + return decoder.DecodeValue(d.dc, d.vr, rval) } // Reset will reset the state of the decoder, using the same *DecodeContext used in // the original construction but using vr for reading. func (d *Decoder) Reset(vr bsonrw.ValueReader) error { + // TODO:(GODRIVER-2719): Remove error return value. d.vr = vr return nil } // SetRegistry replaces the current registry of the decoder with r. func (d *Decoder) SetRegistry(r *bsoncodec.Registry) error { + // TODO:(GODRIVER-2719): Remove error return value. d.dc.Registry = r return nil } // SetContext replaces the current registry of the decoder with dc. +// +// Deprecated: Use the Decoder configuration methods to set the desired unmarshal behavior instead. func (d *Decoder) SetContext(dc bsoncodec.DecodeContext) error { + // TODO:(GODRIVER-2719): Remove error return value. d.dc = dc return nil } + +// DefaultDocumentM causes the Decoder to always unmarshal documents into the primitive.M type. This +// behavior is restricted to data typed as "interface{}" or "map[string]interface{}". +func (d *Decoder) DefaultDocumentM() { + d.defaultDocumentM = true +} + +// DefaultDocumentD causes the Decoder to always unmarshal documents into the primitive.D type. This +// behavior is restricted to data typed as "interface{}" or "map[string]interface{}". +func (d *Decoder) DefaultDocumentD() { + d.defaultDocumentD = true +} + +// AllowTruncatingDoubles causes the Decoder to truncate the fractional part of BSON "double" values +// when attempting to unmarshal them into a Go integer (int, int8, int16, int32, or int64) struct +// field. The truncation logic does not apply to BSON "decimal128" values. +func (d *Decoder) AllowTruncatingDoubles() { + d.dc.Truncate = true +} + +// BinaryAsSlice causes the Decoder to unmarshal BSON binary field values that are the "Generic" or +// "Old" BSON binary subtype as a Go byte slice instead of a primitive.Binary. +func (d *Decoder) BinaryAsSlice() { + d.binaryAsSlice = true +} + +// UseJSONStructTags causes the Decoder to fall back to using the "json" struct tag if a "bson" +// struct tag is not specified. +func (d *Decoder) UseJSONStructTags() { + d.useJSONStructTags = true +} + +// UseLocalTimeZone causes the Decoder to unmarshal time.Time values in the local timezone instead +// of the UTC timezone. +func (d *Decoder) UseLocalTimeZone() { + d.useLocalTimeZone = true +} + +// ZeroMaps causes the Decoder to delete any existing values from Go maps in the destination value +// passed to Decode before unmarshaling BSON documents into them. +func (d *Decoder) ZeroMaps() { + d.zeroMaps = true +} + +// ZeroStructs causes the Decoder to delete any existing values from Go structs in the destination +// value passed to Decode before unmarshaling BSON documents into them. +func (d *Decoder) ZeroStructs() { + d.zeroStructs = true +} diff --git a/vendor/go.mongodb.org/mongo-driver/bson/doc.go b/vendor/go.mongodb.org/mongo-driver/bson/doc.go index 16341568dc..af6098475e 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/doc.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/doc.go @@ -6,131 +6,134 @@ // Package bson is a library for reading, writing, and manipulating BSON. BSON is a binary serialization format used to // store documents and make remote procedure calls in MongoDB. The BSON specification is located at https://bsonspec.org. -// The BSON library handles marshalling and unmarshalling of values through a configurable codec system. For a description -// of the codec system and examples of registering custom codecs, see the bsoncodec package. +// The BSON library handles marshaling and unmarshaling of values through a configurable codec system. For a description +// of the codec system and examples of registering custom codecs, see the bsoncodec package. For additional information +// and usage examples, check out the [Work with BSON] page in the Go Driver docs site. // -// Raw BSON +// # Raw BSON // // The Raw family of types is used to validate and retrieve elements from a slice of bytes. This // type is most useful when you want do lookups on BSON bytes without unmarshaling it into another // type. // // Example: -// var raw bson.Raw = ... // bytes from somewhere -// err := raw.Validate() -// if err != nil { return err } -// val := raw.Lookup("foo") -// i32, ok := val.Int32OK() -// // do something with i32... // -// Native Go Types +// var raw bson.Raw = ... // bytes from somewhere +// err := raw.Validate() +// if err != nil { return err } +// val := raw.Lookup("foo") +// i32, ok := val.Int32OK() +// // do something with i32... +// +// # Native Go Types // // The D and M types defined in this package can be used to build representations of BSON using native Go types. D is a // slice and M is a map. For more information about the use cases for these types, see the documentation on the type // definitions. // +// Note that a D should not be constructed with duplicate key names, as that can cause undefined server behavior. +// // Example: -// bson.D{{"foo", "bar"}, {"hello", "world"}, {"pi", 3.14159}} -// bson.M{"foo": "bar", "hello": "world", "pi": 3.14159} -// -// When decoding BSON to a D or M, the following type mappings apply when unmarshalling: -// -// 1. BSON int32 unmarshals to an int32. -// 2. BSON int64 unmarshals to an int64. -// 3. BSON double unmarshals to a float64. -// 4. BSON string unmarshals to a string. -// 5. BSON boolean unmarshals to a bool. -// 6. BSON embedded document unmarshals to the parent type (i.e. D for a D, M for an M). -// 7. BSON array unmarshals to a bson.A. -// 8. BSON ObjectId unmarshals to a primitive.ObjectID. -// 9. BSON datetime unmarshals to a primitive.DateTime. -// 10. BSON binary unmarshals to a primitive.Binary. -// 11. BSON regular expression unmarshals to a primitive.Regex. -// 12. BSON JavaScript unmarshals to a primitive.JavaScript. -// 13. BSON code with scope unmarshals to a primitive.CodeWithScope. -// 14. BSON timestamp unmarshals to an primitive.Timestamp. -// 15. BSON 128-bit decimal unmarshals to an primitive.Decimal128. -// 16. BSON min key unmarshals to an primitive.MinKey. -// 17. BSON max key unmarshals to an primitive.MaxKey. -// 18. BSON undefined unmarshals to a primitive.Undefined. -// 19. BSON null unmarshals to nil. -// 20. BSON DBPointer unmarshals to a primitive.DBPointer. -// 21. BSON symbol unmarshals to a primitive.Symbol. -// -// The above mappings also apply when marshalling a D or M to BSON. Some other useful marshalling mappings are: -// -// 1. time.Time marshals to a BSON datetime. -// 2. int8, int16, and int32 marshal to a BSON int32. -// 3. int marshals to a BSON int32 if the value is between math.MinInt32 and math.MaxInt32, inclusive, and a BSON int64 -// otherwise. -// 4. int64 marshals to BSON int64. -// 5. uint8 and uint16 marshal to a BSON int32. -// 6. uint, uint32, and uint64 marshal to a BSON int32 if the value is between math.MinInt32 and math.MaxInt32, -// inclusive, and BSON int64 otherwise. -// 7. BSON null and undefined values will unmarshal into the zero value of a field (e.g. unmarshalling a BSON null or -// undefined value into a string will yield the empty string.). -// -// Structs -// -// Structs can be marshalled/unmarshalled to/from BSON or Extended JSON. When transforming structs to/from BSON or Extended +// +// bson.D{{"foo", "bar"}, {"hello", "world"}, {"pi", 3.14159}} +// bson.M{"foo": "bar", "hello": "world", "pi": 3.14159} +// +// When decoding BSON to a D or M, the following type mappings apply when unmarshaling: +// +// 1. BSON int32 unmarshals to an int32. +// 2. BSON int64 unmarshals to an int64. +// 3. BSON double unmarshals to a float64. +// 4. BSON string unmarshals to a string. +// 5. BSON boolean unmarshals to a bool. +// 6. BSON embedded document unmarshals to the parent type (i.e. D for a D, M for an M). +// 7. BSON array unmarshals to a bson.A. +// 8. BSON ObjectId unmarshals to a primitive.ObjectID. +// 9. BSON datetime unmarshals to a primitive.DateTime. +// 10. BSON binary unmarshals to a primitive.Binary. +// 11. BSON regular expression unmarshals to a primitive.Regex. +// 12. BSON JavaScript unmarshals to a primitive.JavaScript. +// 13. BSON code with scope unmarshals to a primitive.CodeWithScope. +// 14. BSON timestamp unmarshals to an primitive.Timestamp. +// 15. BSON 128-bit decimal unmarshals to an primitive.Decimal128. +// 16. BSON min key unmarshals to an primitive.MinKey. +// 17. BSON max key unmarshals to an primitive.MaxKey. +// 18. BSON undefined unmarshals to a primitive.Undefined. +// 19. BSON null unmarshals to nil. +// 20. BSON DBPointer unmarshals to a primitive.DBPointer. +// 21. BSON symbol unmarshals to a primitive.Symbol. +// +// The above mappings also apply when marshaling a D or M to BSON. Some other useful marshaling mappings are: +// +// 1. time.Time marshals to a BSON datetime. +// 2. int8, int16, and int32 marshal to a BSON int32. +// 3. int marshals to a BSON int32 if the value is between math.MinInt32 and math.MaxInt32, inclusive, and a BSON int64 +// otherwise. +// 4. int64 marshals to BSON int64 (unless [Encoder.IntMinSize] is set). +// 5. uint8 and uint16 marshal to a BSON int32. +// 6. uint, uint32, and uint64 marshal to a BSON int64 (unless [Encoder.IntMinSize] is set). +// 7. BSON null and undefined values will unmarshal into the zero value of a field (e.g. unmarshaling a BSON null or +// undefined value into a string will yield the empty string.). +// +// # Structs +// +// Structs can be marshaled/unmarshaled to/from BSON or Extended JSON. When transforming structs to/from BSON or Extended // JSON, the following rules apply: // -// 1. Only exported fields in structs will be marshalled or unmarshalled. +// 1. Only exported fields in structs will be marshaled or unmarshaled. // -// 2. When marshalling a struct, each field will be lowercased to generate the key for the corresponding BSON element. -// For example, a struct field named "Foo" will generate key "foo". This can be overriden via a struct tag (e.g. +// 2. When marshaling a struct, each field will be lowercased to generate the key for the corresponding BSON element. +// For example, a struct field named "Foo" will generate key "foo". This can be overridden via a struct tag (e.g. // `bson:"fooField"` to generate key "fooField" instead). // -// 3. An embedded struct field is marshalled as a subdocument. The key will be the lowercased name of the field's type. +// 3. An embedded struct field is marshaled as a subdocument. The key will be the lowercased name of the field's type. // -// 4. A pointer field is marshalled as the underlying type if the pointer is non-nil. If the pointer is nil, it is -// marshalled as a BSON null value. +// 4. A pointer field is marshaled as the underlying type if the pointer is non-nil. If the pointer is nil, it is +// marshaled as a BSON null value. // -// 5. When unmarshalling, a field of type interface{} will follow the D/M type mappings listed above. BSON documents -// unmarshalled into an interface{} field will be unmarshalled as a D. +// 5. When unmarshaling, a field of type interface{} will follow the D/M type mappings listed above. BSON documents +// unmarshaled into an interface{} field will be unmarshaled as a D. // // The encoding of each struct field can be customized by the "bson" struct tag. // // This tag behavior is configurable, and different struct tag behavior can be configured by initializing a new -// bsoncodec.StructCodec with the desired tag parser and registering that StructCodec onto the Registry. By default, JSON tags -// are not honored, but that can be enabled by creating a StructCodec with JSONFallbackStructTagParser, like below: +// bsoncodec.StructCodec with the desired tag parser and registering that StructCodec onto the Registry. By default, JSON +// tags are not honored, but that can be enabled by creating a StructCodec with JSONFallbackStructTagParser, like below: // // Example: -// structcodec, _ := bsoncodec.NewStructCodec(bsoncodec.JSONFallbackStructTagParser) +// +// structcodec, _ := bsoncodec.NewStructCodec(bsoncodec.JSONFallbackStructTagParser) // // The bson tag gives the name of the field, possibly followed by a comma-separated list of options. -// The name may be empty in order to specify options without overriding the default field name. The following options can be used -// to configure behavior: -// -// 1. omitempty: If the omitempty struct tag is specified on a field, the field will not be marshalled if it is set to -// the zero value. Fields with language primitive types such as integers, booleans, and strings are considered empty if -// their value is equal to the zero value for the type (i.e. 0 for integers, false for booleans, and "" for strings). -// Slices, maps, and arrays are considered empty if they are of length zero. Interfaces and pointers are considered -// empty if their value is nil. By default, structs are only considered empty if the struct type implements the -// bsoncodec.Zeroer interface and the IsZero method returns true. Struct fields whose types do not implement Zeroer are -// never considered empty and will be marshalled as embedded documents. +// The name may be empty in order to specify options without overriding the default field name. The following options can +// be used to configure behavior: +// +// 1. omitempty: If the omitempty struct tag is specified on a field, the field will be omitted from the marshaling if +// the field has an empty value, defined as false, 0, a nil pointer, a nil interface value, and any empty array, +// slice, map, or string. // NOTE: It is recommended that this tag be used for all slice and map fields. // -// 2. minsize: If the minsize struct tag is specified on a field of type int64, uint, uint32, or uint64 and the value of -// the field can fit in a signed int32, the field will be serialized as a BSON int32 rather than a BSON int64. For other -// types, this tag is ignored. +// 2. minsize: If the minsize struct tag is specified on a field of type int64, uint, uint32, or uint64 and the value of +// the field can fit in a signed int32, the field will be serialized as a BSON int32 rather than a BSON int64. For +// other types, this tag is ignored. +// +// 3. truncate: If the truncate struct tag is specified on a field with a non-float numeric type, BSON doubles +// unmarshaled into that field will be truncated at the decimal point. For example, if 3.14 is unmarshaled into a +// field of type int, it will be unmarshaled as 3. If this tag is not specified, the decoder will throw an error if +// the value cannot be decoded without losing precision. For float64 or non-numeric types, this tag is ignored. // -// 3. truncate: If the truncate struct tag is specified on a field with a non-float numeric type, BSON doubles unmarshalled -// into that field will be trucated at the decimal point. For example, if 3.14 is unmarshalled into a field of type int, -// it will be unmarshalled as 3. If this tag is not specified, the decoder will throw an error if the value cannot be -// decoded without losing precision. For float64 or non-numeric types, this tag is ignored. +// 4. inline: If the inline struct tag is specified for a struct or map field, the field will be "flattened" when +// marshaling and "un-flattened" when unmarshaling. This means that all of the fields in that struct/map will be +// pulled up one level and will become top-level fields rather than being fields in a nested document. For example, +// if a map field named "Map" with value map[string]interface{}{"foo": "bar"} is inlined, the resulting document will +// be {"foo": "bar"} instead of {"map": {"foo": "bar"}}. There can only be one inlined map field in a struct. If +// there are duplicated fields in the resulting document when an inlined struct is marshaled, the inlined field will +// be overwritten. If there are duplicated fields in the resulting document when an inlined map is marshaled, an +// error will be returned. This tag can be used with fields that are pointers to structs. If an inlined pointer field +// is nil, it will not be marshaled. For fields that are not maps or structs, this tag is ignored. // -// 4. inline: If the inline struct tag is specified for a struct or map field, the field will be "flattened" when -// marshalling and "un-flattened" when unmarshalling. This means that all of the fields in that struct/map will be -// pulled up one level and will become top-level fields rather than being fields in a nested document. For example, if a -// map field named "Map" with value map[string]interface{}{"foo": "bar"} is inlined, the resulting document will be -// {"foo": "bar"} instead of {"map": {"foo": "bar"}}. There can only be one inlined map field in a struct. If there are -// duplicated fields in the resulting document when an inlined struct is marshalled, the inlined field will be overwritten. -// If there are duplicated fields in the resulting document when an inlined map is marshalled, an error will be returned. -// This tag can be used with fields that are pointers to structs. If an inlined pointer field is nil, it will not be -// marshalled. For fields that are not maps or structs, this tag is ignored. +// # Marshaling and Unmarshaling // -// Marshalling and Unmarshalling +// Manually marshaling and unmarshaling can be done with the Marshal and Unmarshal family of functions. // -// Manually marshalling and unmarshalling can be done with the Marshal and Unmarshal family of functions. +// [Work with BSON]: https://www.mongodb.com/docs/drivers/go/current/fundamentals/bson/ package bson diff --git a/vendor/go.mongodb.org/mongo-driver/bson/encoder.go b/vendor/go.mongodb.org/mongo-driver/bson/encoder.go index fe5125d086..0be2a97fbc 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/encoder.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/encoder.go @@ -29,10 +29,20 @@ var encPool = sync.Pool{ type Encoder struct { ec bsoncodec.EncodeContext vw bsonrw.ValueWriter + + errorOnInlineDuplicates bool + intMinSize bool + stringifyMapKeysWithFmt bool + nilMapAsEmpty bool + nilSliceAsEmpty bool + nilByteSliceAsEmpty bool + omitZeroStruct bool + useJSONStructTags bool } // NewEncoder returns a new encoder that uses the DefaultRegistry to write to vw. func NewEncoder(vw bsonrw.ValueWriter) (*Encoder, error) { + // TODO:(GODRIVER-2719): Remove error return value. if vw == nil { return nil, errors.New("cannot create a new Encoder with a nil ValueWriter") } @@ -44,6 +54,9 @@ func NewEncoder(vw bsonrw.ValueWriter) (*Encoder, error) { } // NewEncoderWithContext returns a new encoder that uses EncodeContext ec to write to vw. +// +// Deprecated: Use [NewEncoder] and use the Encoder configuration methods to set the desired marshal +// behavior instead. func NewEncoderWithContext(ec bsoncodec.EncodeContext, vw bsonrw.ValueWriter) (*Encoder, error) { if ec.Registry == nil { ec = bsoncodec.EncodeContext{Registry: DefaultRegistry} @@ -60,8 +73,7 @@ func NewEncoderWithContext(ec bsoncodec.EncodeContext, vw bsonrw.ValueWriter) (* // Encode writes the BSON encoding of val to the stream. // -// The documentation for Marshal contains details about the conversion of Go -// values to BSON. +// See [Marshal] for details about BSON marshaling behavior. func (e *Encoder) Encode(val interface{}) error { if marshaler, ok := val.(Marshaler); ok { // TODO(skriptble): Should we have a MarshalAppender interface so that we can have []byte reuse? @@ -76,24 +88,112 @@ func (e *Encoder) Encode(val interface{}) error { if err != nil { return err } + + // Copy the configurations applied to the Encoder over to the EncodeContext, which actually + // communicates those configurations to the default ValueEncoders. + if e.errorOnInlineDuplicates { + e.ec.ErrorOnInlineDuplicates() + } + if e.intMinSize { + e.ec.MinSize = true + } + if e.stringifyMapKeysWithFmt { + e.ec.StringifyMapKeysWithFmt() + } + if e.nilMapAsEmpty { + e.ec.NilMapAsEmpty() + } + if e.nilSliceAsEmpty { + e.ec.NilSliceAsEmpty() + } + if e.nilByteSliceAsEmpty { + e.ec.NilByteSliceAsEmpty() + } + if e.omitZeroStruct { + e.ec.OmitZeroStruct() + } + if e.useJSONStructTags { + e.ec.UseJSONStructTags() + } + return encoder.EncodeValue(e.ec, e.vw, reflect.ValueOf(val)) } -// Reset will reset the state of the encoder, using the same *EncodeContext used in +// Reset will reset the state of the Encoder, using the same *EncodeContext used in // the original construction but using vw. func (e *Encoder) Reset(vw bsonrw.ValueWriter) error { + // TODO:(GODRIVER-2719): Remove error return value. e.vw = vw return nil } -// SetRegistry replaces the current registry of the encoder with r. +// SetRegistry replaces the current registry of the Encoder with r. func (e *Encoder) SetRegistry(r *bsoncodec.Registry) error { + // TODO:(GODRIVER-2719): Remove error return value. e.ec.Registry = r return nil } -// SetContext replaces the current EncodeContext of the encoder with er. +// SetContext replaces the current EncodeContext of the encoder with ec. +// +// Deprecated: Use the Encoder configuration methods set the desired marshal behavior instead. func (e *Encoder) SetContext(ec bsoncodec.EncodeContext) error { + // TODO:(GODRIVER-2719): Remove error return value. e.ec = ec return nil } + +// ErrorOnInlineDuplicates causes the Encoder to return an error if there is a duplicate field in +// the marshaled BSON when the "inline" struct tag option is set. +func (e *Encoder) ErrorOnInlineDuplicates() { + e.errorOnInlineDuplicates = true +} + +// IntMinSize causes the Encoder to marshal Go integer values (int, int8, int16, int32, int64, uint, +// uint8, uint16, uint32, or uint64) as the minimum BSON int size (either 32 or 64 bits) that can +// represent the integer value. +func (e *Encoder) IntMinSize() { + e.intMinSize = true +} + +// StringifyMapKeysWithFmt causes the Encoder to convert Go map keys to BSON document field name +// strings using fmt.Sprint instead of the default string conversion logic. +func (e *Encoder) StringifyMapKeysWithFmt() { + e.stringifyMapKeysWithFmt = true +} + +// NilMapAsEmpty causes the Encoder to marshal nil Go maps as empty BSON documents instead of BSON +// null. +func (e *Encoder) NilMapAsEmpty() { + e.nilMapAsEmpty = true +} + +// NilSliceAsEmpty causes the Encoder to marshal nil Go slices as empty BSON arrays instead of BSON +// null. +func (e *Encoder) NilSliceAsEmpty() { + e.nilSliceAsEmpty = true +} + +// NilByteSliceAsEmpty causes the Encoder to marshal nil Go byte slices as empty BSON binary values +// instead of BSON null. +func (e *Encoder) NilByteSliceAsEmpty() { + e.nilByteSliceAsEmpty = true +} + +// TODO(GODRIVER-2820): Update the description to remove the note about only examining exported +// TODO struct fields once the logic is updated to also inspect private struct fields. + +// OmitZeroStruct causes the Encoder to consider the zero value for a struct (e.g. MyStruct{}) +// as empty and omit it from the marshaled BSON when the "omitempty" struct tag option is set. +// +// Note that the Encoder only examines exported struct fields when determining if a struct is the +// zero value. It considers pointers to a zero struct value (e.g. &MyStruct{}) not empty. +func (e *Encoder) OmitZeroStruct() { + e.omitZeroStruct = true +} + +// UseJSONStructTags causes the Encoder to fall back to using the "json" struct tag if a "bson" +// struct tag is not specified. +func (e *Encoder) UseJSONStructTags() { + e.useJSONStructTags = true +} diff --git a/vendor/go.mongodb.org/mongo-driver/bson/marshal.go b/vendor/go.mongodb.org/mongo-driver/bson/marshal.go index 381822af53..17ce6697e0 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/marshal.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/marshal.go @@ -7,6 +7,10 @@ package bson import ( + "bytes" + "encoding/json" + "sync" + "go.mongodb.org/mongo-driver/bson/bsoncodec" "go.mongodb.org/mongo-driver/bson/bsonrw" "go.mongodb.org/mongo-driver/bson/bsontype" @@ -17,17 +21,23 @@ const defaultDstCap = 256 var bvwPool = bsonrw.NewBSONValueWriterPool() var extjPool = bsonrw.NewExtJSONValueWriterPool() -// Marshaler is an interface implemented by types that can marshal themselves -// into a BSON document represented as bytes. The bytes returned must be a valid -// BSON document if the error is nil. +// Marshaler is the interface implemented by types that can marshal themselves +// into a valid BSON document. +// +// Implementations of Marshaler must return a full BSON document. To create +// custom BSON marshaling behavior for individual values in a BSON document, +// implement the ValueMarshaler interface instead. type Marshaler interface { MarshalBSON() ([]byte, error) } -// ValueMarshaler is an interface implemented by types that can marshal -// themselves into a BSON value as bytes. The type must be the valid type for -// the bytes returned. The bytes and byte type together must be valid if the -// error is nil. +// ValueMarshaler is the interface implemented by types that can marshal +// themselves into a valid BSON value. The format of the returned bytes must +// match the returned type. +// +// Implementations of ValueMarshaler must return an individual BSON value. To +// create custom BSON marshaling behavior for an entire BSON document, implement +// the Marshaler interface instead. type ValueMarshaler interface { MarshalBSONValue() (bsontype.Type, []byte, error) } @@ -45,37 +55,141 @@ func Marshal(val interface{}) ([]byte, error) { // MarshalAppend will encode val as a BSON document and append the bytes to dst. If dst is not large enough to hold the // bytes, it will be grown. If val is not a type that can be transformed into a document, MarshalValueAppend should be // used instead. +// +// Deprecated: Use [NewEncoder] and pass the dst byte slice (wrapped by a bytes.Buffer) into +// [bsonrw.NewBSONValueWriter]: +// +// buf := bytes.NewBuffer(dst) +// vw, err := bsonrw.NewBSONValueWriter(buf) +// if err != nil { +// panic(err) +// } +// enc, err := bson.NewEncoder(vw) +// if err != nil { +// panic(err) +// } +// +// See [Encoder] for more examples. func MarshalAppend(dst []byte, val interface{}) ([]byte, error) { return MarshalAppendWithRegistry(DefaultRegistry, dst, val) } // MarshalWithRegistry returns the BSON encoding of val as a BSON document. If val is not a type that can be transformed // into a document, MarshalValueWithRegistry should be used instead. +// +// Deprecated: Use [NewEncoder] and specify the Registry by calling [Encoder.SetRegistry] instead: +// +// buf := new(bytes.Buffer) +// vw, err := bsonrw.NewBSONValueWriter(buf) +// if err != nil { +// panic(err) +// } +// enc, err := bson.NewEncoder(vw) +// if err != nil { +// panic(err) +// } +// enc.SetRegistry(reg) +// +// See [Encoder] for more examples. func MarshalWithRegistry(r *bsoncodec.Registry, val interface{}) ([]byte, error) { - dst := make([]byte, 0, 256) // TODO: make the default cap a constant + dst := make([]byte, 0) return MarshalAppendWithRegistry(r, dst, val) } // MarshalWithContext returns the BSON encoding of val as a BSON document using EncodeContext ec. If val is not a type // that can be transformed into a document, MarshalValueWithContext should be used instead. +// +// Deprecated: Use [NewEncoder] and use the Encoder configuration methods to set the desired marshal +// behavior instead: +// +// buf := bytes.NewBuffer(dst) +// vw, err := bsonrw.NewBSONValueWriter(buf) +// if err != nil { +// panic(err) +// } +// enc, err := bson.NewEncoder(vw) +// if err != nil { +// panic(err) +// } +// enc.IntMinSize() +// +// See [Encoder] for more examples. func MarshalWithContext(ec bsoncodec.EncodeContext, val interface{}) ([]byte, error) { - dst := make([]byte, 0, 256) // TODO: make the default cap a constant + dst := make([]byte, 0) return MarshalAppendWithContext(ec, dst, val) } // MarshalAppendWithRegistry will encode val as a BSON document using Registry r and append the bytes to dst. If dst is // not large enough to hold the bytes, it will be grown. If val is not a type that can be transformed into a document, // MarshalValueAppendWithRegistry should be used instead. +// +// Deprecated: Use [NewEncoder], and pass the dst byte slice (wrapped by a bytes.Buffer) into +// [bsonrw.NewBSONValueWriter], and specify the Registry by calling [Encoder.SetRegistry] instead: +// +// buf := bytes.NewBuffer(dst) +// vw, err := bsonrw.NewBSONValueWriter(buf) +// if err != nil { +// panic(err) +// } +// enc, err := bson.NewEncoder(vw) +// if err != nil { +// panic(err) +// } +// enc.SetRegistry(reg) +// +// See [Encoder] for more examples. func MarshalAppendWithRegistry(r *bsoncodec.Registry, dst []byte, val interface{}) ([]byte, error) { return MarshalAppendWithContext(bsoncodec.EncodeContext{Registry: r}, dst, val) } +// Pool of buffers for marshalling BSON. +var bufPool = sync.Pool{ + New: func() interface{} { + return new(bytes.Buffer) + }, +} + // MarshalAppendWithContext will encode val as a BSON document using Registry r and EncodeContext ec and append the // bytes to dst. If dst is not large enough to hold the bytes, it will be grown. If val is not a type that can be // transformed into a document, MarshalValueAppendWithContext should be used instead. +// +// Deprecated: Use [NewEncoder], pass the dst byte slice (wrapped by a bytes.Buffer) into +// [bsonrw.NewBSONValueWriter], and use the Encoder configuration methods to set the desired marshal +// behavior instead: +// +// buf := bytes.NewBuffer(dst) +// vw, err := bsonrw.NewBSONValueWriter(buf) +// if err != nil { +// panic(err) +// } +// enc, err := bson.NewEncoder(vw) +// if err != nil { +// panic(err) +// } +// enc.IntMinSize() +// +// See [Encoder] for more examples. func MarshalAppendWithContext(ec bsoncodec.EncodeContext, dst []byte, val interface{}) ([]byte, error) { - sw := new(bsonrw.SliceWriter) - *sw = dst + sw := bufPool.Get().(*bytes.Buffer) + defer func() { + // Proper usage of a sync.Pool requires each entry to have approximately + // the same memory cost. To obtain this property when the stored type + // contains a variably-sized buffer, we add a hard limit on the maximum + // buffer to place back in the pool. We limit the size to 16MiB because + // that's the maximum wire message size supported by any current MongoDB + // server. + // + // Comment based on + // https://cs.opensource.google/go/go/+/refs/tags/go1.19:src/fmt/print.go;l=147 + // + // Recycle byte slices that are smaller than 16MiB and at least half + // occupied. + if sw.Cap() < 16*1024*1024 && sw.Cap()/2 < sw.Len() { + bufPool.Put(sw) + } + }() + + sw.Reset() vw := bvwPool.Get(sw) defer bvwPool.Put(vw) @@ -96,7 +210,7 @@ func MarshalAppendWithContext(ec bsoncodec.EncodeContext, dst []byte, val interf return nil, err } - return *sw, nil + return append(dst, sw.Bytes()...), nil } // MarshalValue returns the BSON encoding of val. @@ -109,30 +223,45 @@ func MarshalValue(val interface{}) (bsontype.Type, []byte, error) { // MarshalValueAppend will append the BSON encoding of val to dst. If dst is not large enough to hold the BSON encoding // of val, dst will be grown. +// +// Deprecated: Appending individual BSON elements to an existing slice will not be supported in Go +// Driver 2.0. func MarshalValueAppend(dst []byte, val interface{}) (bsontype.Type, []byte, error) { return MarshalValueAppendWithRegistry(DefaultRegistry, dst, val) } // MarshalValueWithRegistry returns the BSON encoding of val using Registry r. +// +// Deprecated: Using a custom registry to marshal individual BSON values will not be supported in Go +// Driver 2.0. func MarshalValueWithRegistry(r *bsoncodec.Registry, val interface{}) (bsontype.Type, []byte, error) { - dst := make([]byte, 0, defaultDstCap) + dst := make([]byte, 0) return MarshalValueAppendWithRegistry(r, dst, val) } // MarshalValueWithContext returns the BSON encoding of val using EncodeContext ec. +// +// Deprecated: Using a custom EncodeContext to marshal individual BSON elements will not be +// supported in Go Driver 2.0. func MarshalValueWithContext(ec bsoncodec.EncodeContext, val interface{}) (bsontype.Type, []byte, error) { - dst := make([]byte, 0, defaultDstCap) + dst := make([]byte, 0) return MarshalValueAppendWithContext(ec, dst, val) } // MarshalValueAppendWithRegistry will append the BSON encoding of val to dst using Registry r. If dst is not large // enough to hold the BSON encoding of val, dst will be grown. +// +// Deprecated: Appending individual BSON elements to an existing slice will not be supported in Go +// Driver 2.0. func MarshalValueAppendWithRegistry(r *bsoncodec.Registry, dst []byte, val interface{}) (bsontype.Type, []byte, error) { return MarshalValueAppendWithContext(bsoncodec.EncodeContext{Registry: r}, dst, val) } // MarshalValueAppendWithContext will append the BSON encoding of val to dst using EncodeContext ec. If dst is not large // enough to hold the BSON encoding of val, dst will be grown. +// +// Deprecated: Appending individual BSON elements to an existing slice will not be supported in Go +// Driver 2.0. func MarshalValueAppendWithContext(ec bsoncodec.EncodeContext, dst []byte, val interface{}) (bsontype.Type, []byte, error) { // get a ValueWriter configured to write to dst sw := new(bsonrw.SliceWriter) @@ -170,17 +299,63 @@ func MarshalExtJSON(val interface{}, canonical, escapeHTML bool) ([]byte, error) // MarshalExtJSONAppend will append the extended JSON encoding of val to dst. // If dst is not large enough to hold the extended JSON encoding of val, dst // will be grown. +// +// Deprecated: Use [NewEncoder] and pass the dst byte slice (wrapped by a bytes.Buffer) into +// [bsonrw.NewExtJSONValueWriter] instead: +// +// buf := bytes.NewBuffer(dst) +// vw, err := bsonrw.NewExtJSONValueWriter(buf, true, false) +// if err != nil { +// panic(err) +// } +// enc, err := bson.NewEncoder(vw) +// if err != nil { +// panic(err) +// } +// +// See [Encoder] for more examples. func MarshalExtJSONAppend(dst []byte, val interface{}, canonical, escapeHTML bool) ([]byte, error) { return MarshalExtJSONAppendWithRegistry(DefaultRegistry, dst, val, canonical, escapeHTML) } // MarshalExtJSONWithRegistry returns the extended JSON encoding of val using Registry r. +// +// Deprecated: Use [NewEncoder] and specify the Registry by calling [Encoder.SetRegistry] instead: +// +// buf := new(bytes.Buffer) +// vw, err := bsonrw.NewBSONValueWriter(buf) +// if err != nil { +// panic(err) +// } +// enc, err := bson.NewEncoder(vw) +// if err != nil { +// panic(err) +// } +// enc.SetRegistry(reg) +// +// See [Encoder] for more examples. func MarshalExtJSONWithRegistry(r *bsoncodec.Registry, val interface{}, canonical, escapeHTML bool) ([]byte, error) { dst := make([]byte, 0, defaultDstCap) return MarshalExtJSONAppendWithContext(bsoncodec.EncodeContext{Registry: r}, dst, val, canonical, escapeHTML) } // MarshalExtJSONWithContext returns the extended JSON encoding of val using Registry r. +// +// Deprecated: Use [NewEncoder] and use the Encoder configuration methods to set the desired marshal +// behavior instead: +// +// buf := new(bytes.Buffer) +// vw, err := bsonrw.NewBSONValueWriter(buf) +// if err != nil { +// panic(err) +// } +// enc, err := bson.NewEncoder(vw) +// if err != nil { +// panic(err) +// } +// enc.IntMinSize() +// +// See [Encoder] for more examples. func MarshalExtJSONWithContext(ec bsoncodec.EncodeContext, val interface{}, canonical, escapeHTML bool) ([]byte, error) { dst := make([]byte, 0, defaultDstCap) return MarshalExtJSONAppendWithContext(ec, dst, val, canonical, escapeHTML) @@ -189,6 +364,22 @@ func MarshalExtJSONWithContext(ec bsoncodec.EncodeContext, val interface{}, cano // MarshalExtJSONAppendWithRegistry will append the extended JSON encoding of // val to dst using Registry r. If dst is not large enough to hold the BSON // encoding of val, dst will be grown. +// +// Deprecated: Use [NewEncoder], pass the dst byte slice (wrapped by a bytes.Buffer) into +// [bsonrw.NewExtJSONValueWriter], and specify the Registry by calling [Encoder.SetRegistry] +// instead: +// +// buf := bytes.NewBuffer(dst) +// vw, err := bsonrw.NewExtJSONValueWriter(buf, true, false) +// if err != nil { +// panic(err) +// } +// enc, err := bson.NewEncoder(vw) +// if err != nil { +// panic(err) +// } +// +// See [Encoder] for more examples. func MarshalExtJSONAppendWithRegistry(r *bsoncodec.Registry, dst []byte, val interface{}, canonical, escapeHTML bool) ([]byte, error) { return MarshalExtJSONAppendWithContext(bsoncodec.EncodeContext{Registry: r}, dst, val, canonical, escapeHTML) } @@ -196,6 +387,23 @@ func MarshalExtJSONAppendWithRegistry(r *bsoncodec.Registry, dst []byte, val int // MarshalExtJSONAppendWithContext will append the extended JSON encoding of // val to dst using Registry r. If dst is not large enough to hold the BSON // encoding of val, dst will be grown. +// +// Deprecated: Use [NewEncoder], pass the dst byte slice (wrapped by a bytes.Buffer) into +// [bsonrw.NewExtJSONValueWriter], and use the Encoder configuration methods to set the desired marshal +// behavior instead: +// +// buf := bytes.NewBuffer(dst) +// vw, err := bsonrw.NewExtJSONValueWriter(buf, true, false) +// if err != nil { +// panic(err) +// } +// enc, err := bson.NewEncoder(vw) +// if err != nil { +// panic(err) +// } +// enc.IntMinSize() +// +// See [Encoder] for more examples. func MarshalExtJSONAppendWithContext(ec bsoncodec.EncodeContext, dst []byte, val interface{}, canonical, escapeHTML bool) ([]byte, error) { sw := new(bsonrw.SliceWriter) *sw = dst @@ -221,3 +429,25 @@ func MarshalExtJSONAppendWithContext(ec bsoncodec.EncodeContext, dst []byte, val return *sw, nil } + +// IndentExtJSON will prefix and indent the provided extended JSON src and append it to dst. +func IndentExtJSON(dst *bytes.Buffer, src []byte, prefix, indent string) error { + return json.Indent(dst, src, prefix, indent) +} + +// MarshalExtJSONIndent returns the extended JSON encoding of val with each line with prefixed +// and indented. +func MarshalExtJSONIndent(val interface{}, canonical, escapeHTML bool, prefix, indent string) ([]byte, error) { + marshaled, err := MarshalExtJSON(val, canonical, escapeHTML) + if err != nil { + return nil, err + } + + var buf bytes.Buffer + err = IndentExtJSON(&buf, marshaled, prefix, indent) + if err != nil { + return nil, err + } + + return buf.Bytes(), nil +} diff --git a/vendor/go.mongodb.org/mongo-driver/bson/primitive/decimal.go b/vendor/go.mongodb.org/mongo-driver/bson/primitive/decimal.go index a57e1d6987..08c39514be 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/primitive/decimal.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/primitive/decimal.go @@ -133,11 +133,9 @@ Loop: } // BigInt returns significand as big.Int and exponent, bi * 10 ^ exp. -func (d Decimal128) BigInt() (bi *big.Int, exp int, err error) { +func (d Decimal128) BigInt() (*big.Int, int, error) { high, low := d.GetBytes() - var posSign bool // positive sign - - posSign = high>>63&1 == 0 + posSign := high>>63&1 == 0 // positive sign switch high >> 58 & (1<<5 - 1) { case 0x1F: @@ -149,6 +147,7 @@ func (d Decimal128) BigInt() (bi *big.Int, exp int, err error) { return nil, 0, ErrParseNegInf } + var exp int if high>>61&3 == 3 { // Bits: 1*sign 2*ignored 14*exponent 111*significand. // Implicit 0b100 prefix in significand. @@ -165,13 +164,10 @@ func (d Decimal128) BigInt() (bi *big.Int, exp int, err error) { // Would be handled by the logic below, but that's trivial and common. if high == 0 && low == 0 && exp == 0 { - if posSign { - return new(big.Int), 0, nil - } return new(big.Int), 0, nil } - bi = big.NewInt(0) + bi := big.NewInt(0) const host32bit = ^uint(0)>>32 == 0 if host32bit { bi.SetBits([]big.Word{big.Word(low), big.Word(low >> 32), big.Word(high), big.Word(high >> 32)}) @@ -182,7 +178,7 @@ func (d Decimal128) BigInt() (bi *big.Int, exp int, err error) { if !posSign { return bi.Neg(bi), exp, nil } - return + return bi, exp, nil } // IsNaN returns whether d is NaN. @@ -192,10 +188,9 @@ func (d Decimal128) IsNaN() bool { // IsInf returns: // -// +1 d == Infinity -// 0 other case -// -1 d == -Infinity -// +// +1 d == Infinity +// 0 other case +// -1 d == -Infinity func (d Decimal128) IsInf() int { if d.h>>58&(1<<5-1) != 0x1E { return 0 @@ -330,6 +325,7 @@ func ParseDecimal128(s string) (Decimal128, error) { return dErr(s) } + // Parse the significand (i.e. the non-exponent part) as a big.Int. bi, ok := new(big.Int).SetString(intPart+decPart, 10) if !ok { return dErr(s) @@ -362,6 +358,19 @@ func ParseDecimal128FromBigInt(bi *big.Int, exp int) (Decimal128, bool) { q := new(big.Int) r := new(big.Int) + // If the significand is zero, the logical value will always be zero, independent of the + // exponent. However, the loops for handling out-of-range exponent values below may be extremely + // slow for zero values because the significand never changes. Limit the exponent value to the + // supported range here to prevent entering the loops below. + if bi.Cmp(zero) == 0 { + if exp > MaxDecimal128Exp { + exp = MaxDecimal128Exp + } + if exp < MinDecimal128Exp { + exp = MinDecimal128Exp + } + } + for bigIntCmpAbs(bi, maxS) == 1 { bi, _ = q.QuoRem(bi, ten, r) if r.Cmp(zero) != 0 { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/primitive/objectid.go b/vendor/go.mongodb.org/mongo-driver/bson/primitive/objectid.go index 30aaafe6d9..c130e3ff19 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/primitive/objectid.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/primitive/objectid.go @@ -10,8 +10,8 @@ package primitive import ( - "bytes" "crypto/rand" + "encoding" "encoding/binary" "encoding/hex" "encoding/json" @@ -34,6 +34,9 @@ var NilObjectID ObjectID var objectIDCounter = readRandomUint32() var processUnique = processUniqueBytes() +var _ encoding.TextMarshaler = ObjectID{} +var _ encoding.TextUnmarshaler = &ObjectID{} + // NewObjectID generates a new ObjectID. func NewObjectID() ObjectID { return NewObjectIDFromTimestamp(time.Now()) @@ -58,7 +61,9 @@ func (id ObjectID) Timestamp() time.Time { // Hex returns the hex encoding of the ObjectID as a string. func (id ObjectID) Hex() string { - return hex.EncodeToString(id[:]) + var buf [24]byte + hex.Encode(buf[:], id[:]) + return string(buf[:]) } func (id ObjectID) String() string { @@ -67,33 +72,50 @@ func (id ObjectID) String() string { // IsZero returns true if id is the empty ObjectID. func (id ObjectID) IsZero() bool { - return bytes.Equal(id[:], NilObjectID[:]) + return id == NilObjectID } // ObjectIDFromHex creates a new ObjectID from a hex string. It returns an error if the hex string is not a // valid ObjectID. func ObjectIDFromHex(s string) (ObjectID, error) { - b, err := hex.DecodeString(s) - if err != nil { - return NilObjectID, err - } - - if len(b) != 12 { + if len(s) != 24 { return NilObjectID, ErrInvalidHex } var oid [12]byte - copy(oid[:], b[:]) + _, err := hex.Decode(oid[:], []byte(s)) + if err != nil { + return NilObjectID, err + } return oid, nil } // IsValidObjectID returns true if the provided hex string represents a valid ObjectID and false if not. +// +// Deprecated: Use ObjectIDFromHex and check the error instead. func IsValidObjectID(s string) bool { _, err := ObjectIDFromHex(s) return err == nil } +// MarshalText returns the ObjectID as UTF-8-encoded text. Implementing this allows us to use ObjectID +// as a map key when marshalling JSON. See https://pkg.go.dev/encoding#TextMarshaler +func (id ObjectID) MarshalText() ([]byte, error) { + return []byte(id.Hex()), nil +} + +// UnmarshalText populates the byte slice with the ObjectID. Implementing this allows us to use ObjectID +// as a map key when unmarshalling JSON. See https://pkg.go.dev/encoding#TextUnmarshaler +func (id *ObjectID) UnmarshalText(b []byte) error { + oid, err := ObjectIDFromHex(string(b)) + if err != nil { + return err + } + *id = oid + return nil +} + // MarshalJSON returns the ObjectID as a string func (id ObjectID) MarshalJSON() ([]byte, error) { return json.Marshal(id.Hex()) @@ -161,7 +183,7 @@ func processUniqueBytes() [5]byte { var b [5]byte _, err := io.ReadFull(rand.Reader, b[:]) if err != nil { - panic(fmt.Errorf("cannot initialize objectid package with crypto.rand.Reader: %v", err)) + panic(fmt.Errorf("cannot initialize objectid package with crypto.rand.Reader: %w", err)) } return b @@ -171,7 +193,7 @@ func readRandomUint32() uint32 { var b [4]byte _, err := io.ReadFull(rand.Reader, b[:]) if err != nil { - panic(fmt.Errorf("cannot initialize objectid package with crypto.rand.Reader: %v", err)) + panic(fmt.Errorf("cannot initialize objectid package with crypto.rand.Reader: %w", err)) } return (uint32(b[0]) << 0) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24) diff --git a/vendor/go.mongodb.org/mongo-driver/bson/primitive/primitive.go b/vendor/go.mongodb.org/mongo-driver/bson/primitive/primitive.go index 5420496b57..65f4fbb949 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/primitive/primitive.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/primitive/primitive.go @@ -4,7 +4,7 @@ // not use this file except in compliance with the License. You may obtain // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Package primitive contains types similar to Go primitives for BSON types can do not have direct +// Package primitive contains types similar to Go primitives for BSON types that do not have direct // Go primitive representations. package primitive // import "go.mongodb.org/mongo-driver/bson/primitive" @@ -21,7 +21,7 @@ type Binary struct { Data []byte } -// Equal compares bp to bp2 and returns true is the are equal. +// Equal compares bp to bp2 and returns true if they are equal. func (bp Binary) Equal(bp2 Binary) bool { if bp.Subtype != bp2.Subtype { return false @@ -29,7 +29,7 @@ func (bp Binary) Equal(bp2 Binary) bool { return bytes.Equal(bp.Data, bp2.Data) } -// IsZero returns if bp is the empty Binary +// IsZero returns if bp is the empty Binary. func (bp Binary) IsZero() bool { return bp.Subtype == 0 && len(bp.Data) == 0 } @@ -43,9 +43,9 @@ type DateTime int64 var _ json.Marshaler = DateTime(0) var _ json.Unmarshaler = (*DateTime)(nil) -// MarshalJSON marshal to time type +// MarshalJSON marshal to time type. func (d DateTime) MarshalJSON() ([]byte, error) { - return json.Marshal(d.Time()) + return json.Marshal(d.Time().UTC()) } // UnmarshalJSON creates a primitive.DateTime from a JSON string. @@ -89,12 +89,12 @@ func (rp Regex) String() string { return fmt.Sprintf(`{"pattern": "%s", "options": "%s"}`, rp.Pattern, rp.Options) } -// Equal compares rp to rp2 and returns true is the are equal. +// Equal compares rp to rp2 and returns true if they are equal. func (rp Regex) Equal(rp2 Regex) bool { return rp.Pattern == rp2.Pattern && rp.Options == rp2.Options } -// IsZero returns if rp is the empty Regex +// IsZero returns if rp is the empty Regex. func (rp Regex) IsZero() bool { return rp.Pattern == "" && rp.Options == "" } @@ -109,12 +109,12 @@ func (d DBPointer) String() string { return fmt.Sprintf(`{"db": "%s", "pointer": "%s"}`, d.DB, d.Pointer) } -// Equal compares d to d2 and returns true is the are equal. +// Equal compares d to d2 and returns true if they are equal. func (d DBPointer) Equal(d2 DBPointer) bool { - return d.DB == d2.DB && bytes.Equal(d.Pointer[:], d2.Pointer[:]) + return d == d2 } -// IsZero returns if d is the empty DBPointer +// IsZero returns if d is the empty DBPointer. func (d DBPointer) IsZero() bool { return d.DB == "" && d.Pointer.IsZero() } @@ -141,34 +141,45 @@ type Timestamp struct { I uint32 } -// Equal compares tp to tp2 and returns true is the are equal. +// After reports whether the time instant tp is after tp2. +func (tp Timestamp) After(tp2 Timestamp) bool { + return tp.T > tp2.T || (tp.T == tp2.T && tp.I > tp2.I) +} + +// Before reports whether the time instant tp is before tp2. +func (tp Timestamp) Before(tp2 Timestamp) bool { + return tp.T < tp2.T || (tp.T == tp2.T && tp.I < tp2.I) +} + +// Equal compares tp to tp2 and returns true if they are equal. func (tp Timestamp) Equal(tp2 Timestamp) bool { return tp.T == tp2.T && tp.I == tp2.I } -// IsZero returns if tp is the zero Timestamp +// IsZero returns if tp is the zero Timestamp. func (tp Timestamp) IsZero() bool { return tp.T == 0 && tp.I == 0 } -// CompareTimestamp returns an integer comparing two Timestamps, where T is compared first, followed by I. -// Returns 0 if tp = tp2, 1 if tp > tp2, -1 if tp < tp2. -func CompareTimestamp(tp, tp2 Timestamp) int { - if tp.Equal(tp2) { +// Compare compares the time instant tp with tp2. If tp is before tp2, it returns -1; if tp is after +// tp2, it returns +1; if they're the same, it returns 0. +func (tp Timestamp) Compare(tp2 Timestamp) int { + switch { + case tp.Equal(tp2): return 0 - } - - if tp.T > tp2.T { - return 1 - } - if tp.T < tp2.T { + case tp.Before(tp2): return -1 + default: + return +1 } - // Compare I values because T values are equal - if tp.I > tp2.I { - return 1 - } - return -1 +} + +// CompareTimestamp compares the time instant tp with tp2. If tp is before tp2, it returns -1; if tp is after +// tp2, it returns +1; if they're the same, it returns 0. +// +// Deprecated: Use Timestamp.Compare instead. +func CompareTimestamp(tp, tp2 Timestamp) int { + return tp.Compare(tp2) } // MinKey represents the BSON minkey value. @@ -182,10 +193,13 @@ type MaxKey struct{} // // Example usage: // -// bson.D{{"foo", "bar"}, {"hello", "world"}, {"pi", 3.14159}} +// bson.D{{"foo", "bar"}, {"hello", "world"}, {"pi", 3.14159}} type D []E // Map creates a map from the elements of the D. +// +// Deprecated: Converting directly from a D to an M will not be supported in Go Driver 2.0. Instead, +// users should marshal the D to BSON using bson.Marshal and unmarshal it to M using bson.Unmarshal. func (d D) Map() M { m := make(M, len(d)) for _, e := range d { @@ -206,12 +220,12 @@ type E struct { // // Example usage: // -// bson.M{"foo": "bar", "hello": "world", "pi": 3.14159}. +// bson.M{"foo": "bar", "hello": "world", "pi": 3.14159} type M map[string]interface{} // An A is an ordered representation of a BSON array. // // Example usage: // -// bson.A{"bar", "world", 3.14159, bson.D{{"qux", 12345}}} +// bson.A{"bar", "world", 3.14159, bson.D{{"qux", 12345}}} type A []interface{} diff --git a/vendor/go.mongodb.org/mongo-driver/bson/primitive_codecs.go b/vendor/go.mongodb.org/mongo-driver/bson/primitive_codecs.go index f397fa2d58..ff32a87a79 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/primitive_codecs.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/primitive_codecs.go @@ -8,20 +8,30 @@ package bson import ( "errors" + "fmt" "reflect" "go.mongodb.org/mongo-driver/bson/bsoncodec" "go.mongodb.org/mongo-driver/bson/bsonrw" ) +var tRawValue = reflect.TypeOf(RawValue{}) +var tRaw = reflect.TypeOf(Raw(nil)) + var primitiveCodecs PrimitiveCodecs // PrimitiveCodecs is a namespace for all of the default bsoncodec.Codecs for the primitive types // defined in this package. +// +// Deprecated: Use bson.NewRegistry to get a registry with all primitive encoders and decoders +// registered. type PrimitiveCodecs struct{} // RegisterPrimitiveCodecs will register the encode and decode methods attached to PrimitiveCodecs // with the provided RegistryBuilder. if rb is nil, a new empty RegistryBuilder will be created. +// +// Deprecated: Use bson.NewRegistry to get a registry with all primitive encoders and decoders +// registered. func (pc PrimitiveCodecs) RegisterPrimitiveCodecs(rb *bsoncodec.RegistryBuilder) { if rb == nil { panic(errors.New("argument to RegisterPrimitiveCodecs must not be nil")) @@ -35,18 +45,35 @@ func (pc PrimitiveCodecs) RegisterPrimitiveCodecs(rb *bsoncodec.RegistryBuilder) } // RawValueEncodeValue is the ValueEncoderFunc for RawValue. -func (PrimitiveCodecs) RawValueEncodeValue(ec bsoncodec.EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// If the RawValue's Type is "invalid" and the RawValue's Value is not empty or +// nil, then this method will return an error. +// +// Deprecated: Use bson.NewRegistry to get a registry with all primitive +// encoders and decoders registered. +func (PrimitiveCodecs) RawValueEncodeValue(_ bsoncodec.EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tRawValue { - return bsoncodec.ValueEncoderError{Name: "RawValueEncodeValue", Types: []reflect.Type{tRawValue}, Received: val} + return bsoncodec.ValueEncoderError{ + Name: "RawValueEncodeValue", + Types: []reflect.Type{tRawValue}, + Received: val, + } } rawvalue := val.Interface().(RawValue) + if !rawvalue.Type.IsValid() { + return fmt.Errorf("the RawValue Type specifies an invalid BSON type: %#x", byte(rawvalue.Type)) + } + return bsonrw.Copier{}.CopyValueFromBytes(vw, rawvalue.Type, rawvalue.Value) } // RawValueDecodeValue is the ValueDecoderFunc for RawValue. -func (PrimitiveCodecs) RawValueDecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { +// +// Deprecated: Use bson.NewRegistry to get a registry with all primitive encoders and decoders +// registered. +func (PrimitiveCodecs) RawValueDecodeValue(_ bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tRawValue { return bsoncodec.ValueDecoderError{Name: "RawValueDecodeValue", Types: []reflect.Type{tRawValue}, Received: val} } @@ -61,7 +88,10 @@ func (PrimitiveCodecs) RawValueDecodeValue(dc bsoncodec.DecodeContext, vr bsonrw } // RawEncodeValue is the ValueEncoderFunc for Reader. -func (PrimitiveCodecs) RawEncodeValue(ec bsoncodec.EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { +// +// Deprecated: Use bson.NewRegistry to get a registry with all primitive encoders and decoders +// registered. +func (PrimitiveCodecs) RawEncodeValue(_ bsoncodec.EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error { if !val.IsValid() || val.Type() != tRaw { return bsoncodec.ValueEncoderError{Name: "RawEncodeValue", Types: []reflect.Type{tRaw}, Received: val} } @@ -72,7 +102,10 @@ func (PrimitiveCodecs) RawEncodeValue(ec bsoncodec.EncodeContext, vw bsonrw.Valu } // RawDecodeValue is the ValueDecoderFunc for Reader. -func (PrimitiveCodecs) RawDecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { +// +// Deprecated: Use bson.NewRegistry to get a registry with all primitive encoders and decoders +// registered. +func (PrimitiveCodecs) RawDecodeValue(_ bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error { if !val.CanSet() || val.Type() != tRaw { return bsoncodec.ValueDecoderError{Name: "RawDecodeValue", Types: []reflect.Type{tRaw}, Received: val} } @@ -87,25 +120,3 @@ func (PrimitiveCodecs) RawDecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.Valu val.Set(reflect.ValueOf(rdr)) return err } - -func (pc PrimitiveCodecs) encodeRaw(ec bsoncodec.EncodeContext, dw bsonrw.DocumentWriter, raw Raw) error { - var copier bsonrw.Copier - elems, err := raw.Elements() - if err != nil { - return err - } - for _, elem := range elems { - dvw, err := dw.WriteDocumentElement(elem.Key()) - if err != nil { - return err - } - - val := elem.Value() - err = copier.CopyValueFromBytes(dvw, val.Type, val.Value) - if err != nil { - return err - } - } - - return dw.WriteDocumentEnd() -} diff --git a/vendor/go.mongodb.org/mongo-driver/bson/raw.go b/vendor/go.mongodb.org/mongo-driver/bson/raw.go index 2aae9f56ab..130da61ba0 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/raw.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/raw.go @@ -15,20 +15,28 @@ import ( // ErrNilReader indicates that an operation was attempted on a nil bson.Reader. var ErrNilReader = errors.New("nil reader") -var errValidateDone = errors.New("validation loop complete") -// Raw is a wrapper around a byte slice. It will interpret the slice as a -// BSON document. This type is a wrapper around a bsoncore.Document. Errors returned from the -// methods on this type and associated types come from the bsoncore package. +// Raw is a raw encoded BSON document. It can be used to delay BSON document decoding or precompute +// a BSON encoded document. +// +// A Raw must be a full BSON document. Use the RawValue type for individual BSON values. type Raw []byte -// NewFromIOReader reads in a document from the given io.Reader and constructs a Raw from -// it. -func NewFromIOReader(r io.Reader) (Raw, error) { +// ReadDocument reads a BSON document from the io.Reader and returns it as a bson.Raw. If the +// reader contains multiple BSON documents, only the first document is read. +func ReadDocument(r io.Reader) (Raw, error) { doc, err := bsoncore.NewDocumentFromReader(r) return Raw(doc), err } +// NewFromIOReader reads a BSON document from the io.Reader and returns it as a bson.Raw. If the +// reader contains multiple BSON documents, only the first document is read. +// +// Deprecated: Use ReadDocument instead. +func NewFromIOReader(r io.Reader) (Raw, error) { + return ReadDocument(r) +} + // Validate validates the document. This method only validates the first document in // the slice, to validate other documents, the slice must be resliced. func (r Raw) Validate() (err error) { return bsoncore.Document(r).Validate() } @@ -52,12 +60,19 @@ func (r Raw) LookupErr(key ...string) (RawValue, error) { // elements. If the document is not valid, the elements up to the invalid point will be returned // along with an error. func (r Raw) Elements() ([]RawElement, error) { - elems, err := bsoncore.Document(r).Elements() + doc := bsoncore.Document(r) + if len(doc) == 0 { + return nil, nil + } + elems, err := doc.Elements() + if err != nil { + return nil, err + } relems := make([]RawElement, 0, len(elems)) for _, elem := range elems { relems = append(relems, RawElement(elem)) } - return relems, err + return relems, nil } // Values returns this document as a slice of values. The returned slice will contain valid values. @@ -82,11 +97,5 @@ func (r Raw) IndexErr(index uint) (RawElement, error) { return RawElement(elem), err } -// String implements the fmt.Stringer interface. +// String returns the BSON document encoded as Extended JSON. func (r Raw) String() string { return bsoncore.Document(r).String() } - -// readi32 is a helper function for reading an int32 from slice of bytes. -func readi32(b []byte) int32 { - _ = b[3] // bounds check hint to compiler; see golang.org/issue/14808 - return int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24 -} diff --git a/vendor/go.mongodb.org/mongo-driver/bson/raw_element.go b/vendor/go.mongodb.org/mongo-driver/bson/raw_element.go index 006f503a30..8ce13c2cc7 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/raw_element.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/raw_element.go @@ -10,10 +10,7 @@ import ( "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" ) -// RawElement represents a BSON element in byte form. This type provides a simple way to -// transform a slice of bytes into a BSON element and extract information from it. -// -// RawElement is a thin wrapper around a bsoncore.Element. +// RawElement is a raw encoded BSON document or array element. type RawElement []byte // Key returns the key for this element. If the element is not valid, this method returns an empty @@ -36,7 +33,7 @@ func (re RawElement) ValueErr() (RawValue, error) { // Validate ensures re is a valid BSON element. func (re RawElement) Validate() error { return bsoncore.Element(re).Validate() } -// String implements the fmt.Stringer interface. The output will be in extended JSON format. +// String returns the BSON element encoded as Extended JSON. func (re RawElement) String() string { doc := bsoncore.BuildDocument(nil, re) j, err := MarshalExtJSON(Raw(doc), true, false) diff --git a/vendor/go.mongodb.org/mongo-driver/bson/raw_value.go b/vendor/go.mongodb.org/mongo-driver/bson/raw_value.go index 75297f30fe..4d1bfb3160 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/raw_value.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/raw_value.go @@ -26,11 +26,10 @@ var ErrNilContext = errors.New("DecodeContext cannot be nil") // ErrNilRegistry is returned when the provided registry is nil. var ErrNilRegistry = errors.New("Registry cannot be nil") -// RawValue represents a BSON value in byte form. It can be used to hold unprocessed BSON or to -// defer processing of BSON. Type is the BSON type of the value and Value are the raw bytes that -// represent the element. +// RawValue is a raw encoded BSON value. It can be used to delay BSON value decoding or precompute +// BSON encoded value. Type is the BSON type of the value and Value is the raw encoded BSON value. // -// This type wraps bsoncore.Value for most of it's functionality. +// A RawValue must be an individual BSON value. Use the Raw type for full BSON documents. type RawValue struct { Type bsontype.Type Value []byte @@ -38,6 +37,12 @@ type RawValue struct { r *bsoncodec.Registry } +// IsZero reports whether the RawValue is zero, i.e. no data is present on +// the RawValue. It returns true if Type is 0 and Value is empty or nil. +func (rv RawValue) IsZero() bool { + return rv.Type == 0x00 && len(rv.Value) == 0 +} + // Unmarshal deserializes BSON into the provided val. If RawValue cannot be unmarshaled into val, an // error is returned. This method will use the registry used to create the RawValue, if the RawValue // was created from partial BSON processing, or it will use the default registry. Users wishing to @@ -268,10 +273,16 @@ func (rv RawValue) Int32OK() (int32, bool) { return convertToCoreValue(rv).Int32 // AsInt32 returns a BSON number as an int32. If the BSON type is not a numeric one, this method // will panic. +// +// Deprecated: Use AsInt64 instead. If an int32 is required, convert the returned value to an int32 +// and perform any required overflow/underflow checking. func (rv RawValue) AsInt32() int32 { return convertToCoreValue(rv).AsInt32() } // AsInt32OK is the same as AsInt32, except that it returns a boolean instead of // panicking. +// +// Deprecated: Use AsInt64OK instead. If an int32 is required, convert the returned value to an +// int32 and perform any required overflow/underflow checking. func (rv RawValue) AsInt32OK() (int32, bool) { return convertToCoreValue(rv).AsInt32OK() } // Timestamp returns the BSON timestamp value the Value represents. It panics if the value is a diff --git a/vendor/go.mongodb.org/mongo-driver/bson/registry.go b/vendor/go.mongodb.org/mongo-driver/bson/registry.go index 09062d2085..b5b0f35687 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/registry.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/registry.go @@ -6,15 +6,19 @@ package bson -import "go.mongodb.org/mongo-driver/bson/bsoncodec" +import ( + "go.mongodb.org/mongo-driver/bson/bsoncodec" +) // DefaultRegistry is the default bsoncodec.Registry. It contains the default codecs and the // primitive codecs. -var DefaultRegistry = NewRegistryBuilder().Build() +var DefaultRegistry = NewRegistry() // NewRegistryBuilder creates a new RegistryBuilder configured with the default encoders and -// deocders from the bsoncodec.DefaultValueEncoders and bsoncodec.DefaultValueDecoders types and the +// decoders from the bsoncodec.DefaultValueEncoders and bsoncodec.DefaultValueDecoders types and the // PrimitiveCodecs type in this package. +// +// Deprecated: Use NewRegistry instead. func NewRegistryBuilder() *bsoncodec.RegistryBuilder { rb := bsoncodec.NewRegistryBuilder() bsoncodec.DefaultValueEncoders{}.RegisterDefaultEncoders(rb) @@ -22,3 +26,10 @@ func NewRegistryBuilder() *bsoncodec.RegistryBuilder { primitiveCodecs.RegisterPrimitiveCodecs(rb) return rb } + +// NewRegistry creates a new Registry configured with the default encoders and decoders from the +// bsoncodec.DefaultValueEncoders and bsoncodec.DefaultValueDecoders types and the PrimitiveCodecs +// type in this package. +func NewRegistry() *bsoncodec.Registry { + return NewRegistryBuilder().Build() +} diff --git a/vendor/go.mongodb.org/mongo-driver/bson/types.go b/vendor/go.mongodb.org/mongo-driver/bson/types.go index bf91f691ad..ef39812467 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/types.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/types.go @@ -7,14 +7,10 @@ package bson import ( - "reflect" - "time" - "go.mongodb.org/mongo-driver/bson/bsontype" - "go.mongodb.org/mongo-driver/bson/primitive" ) -// These constants uniquely refer to each BSON type. +// BSON element types as described in https://bsonspec.org/spec.html. const ( TypeDouble = bsontype.Double TypeString = bsontype.String @@ -39,47 +35,16 @@ const ( TypeMaxKey = bsontype.MaxKey ) -var tBinary = reflect.TypeOf(primitive.Binary{}) -var tBool = reflect.TypeOf(false) -var tCodeWithScope = reflect.TypeOf(primitive.CodeWithScope{}) -var tDBPointer = reflect.TypeOf(primitive.DBPointer{}) -var tDecimal = reflect.TypeOf(primitive.Decimal128{}) -var tD = reflect.TypeOf(D{}) -var tA = reflect.TypeOf(A{}) -var tDateTime = reflect.TypeOf(primitive.DateTime(0)) -var tUndefined = reflect.TypeOf(primitive.Undefined{}) -var tNull = reflect.TypeOf(primitive.Null{}) -var tRawValue = reflect.TypeOf(RawValue{}) -var tFloat32 = reflect.TypeOf(float32(0)) -var tFloat64 = reflect.TypeOf(float64(0)) -var tInt = reflect.TypeOf(int(0)) -var tInt8 = reflect.TypeOf(int8(0)) -var tInt16 = reflect.TypeOf(int16(0)) -var tInt32 = reflect.TypeOf(int32(0)) -var tInt64 = reflect.TypeOf(int64(0)) -var tJavaScript = reflect.TypeOf(primitive.JavaScript("")) -var tOID = reflect.TypeOf(primitive.ObjectID{}) -var tRaw = reflect.TypeOf(Raw(nil)) -var tRegex = reflect.TypeOf(primitive.Regex{}) -var tString = reflect.TypeOf("") -var tSymbol = reflect.TypeOf(primitive.Symbol("")) -var tTime = reflect.TypeOf(time.Time{}) -var tTimestamp = reflect.TypeOf(primitive.Timestamp{}) -var tUint = reflect.TypeOf(uint(0)) -var tUint8 = reflect.TypeOf(uint8(0)) -var tUint16 = reflect.TypeOf(uint16(0)) -var tUint32 = reflect.TypeOf(uint32(0)) -var tUint64 = reflect.TypeOf(uint64(0)) -var tMinKey = reflect.TypeOf(primitive.MinKey{}) -var tMaxKey = reflect.TypeOf(primitive.MaxKey{}) - -var tEmpty = reflect.TypeOf((*interface{})(nil)).Elem() -var tEmptySlice = reflect.TypeOf([]interface{}(nil)) - -var zeroVal reflect.Value - -// this references the quantity of milliseconds between zero time and -// the unix epoch. useful for making sure that we convert time.Time -// objects correctly to match the legacy bson library's handling of -// time.Time values. -const zeroEpochMs = int64(62135596800000) +// BSON binary element subtypes as described in https://bsonspec.org/spec.html. +const ( + TypeBinaryGeneric = bsontype.BinaryGeneric + TypeBinaryFunction = bsontype.BinaryFunction + TypeBinaryBinaryOld = bsontype.BinaryBinaryOld + TypeBinaryUUIDOld = bsontype.BinaryUUIDOld + TypeBinaryUUID = bsontype.BinaryUUID + TypeBinaryMD5 = bsontype.BinaryMD5 + TypeBinaryEncrypted = bsontype.BinaryEncrypted + TypeBinaryColumn = bsontype.BinaryColumn + TypeBinarySensitive = bsontype.BinarySensitive + TypeBinaryUserDefined = bsontype.BinaryUserDefined +) diff --git a/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go b/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go index 6f9ca04d3c..66da17ee01 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go @@ -14,18 +14,26 @@ import ( "go.mongodb.org/mongo-driver/bson/bsontype" ) -// Unmarshaler is an interface implemented by types that can unmarshal a BSON -// document representation of themselves. The BSON bytes can be assumed to be -// valid. UnmarshalBSON must copy the BSON bytes if it wishes to retain the data -// after returning. +// Unmarshaler is the interface implemented by types that can unmarshal a BSON +// document representation of themselves. The input can be assumed to be a valid +// encoding of a BSON document. UnmarshalBSON must copy the JSON data if it +// wishes to retain the data after returning. +// +// Unmarshaler is only used to unmarshal full BSON documents. To create custom +// BSON unmarshaling behavior for individual values in a BSON document, +// implement the ValueUnmarshaler interface instead. type Unmarshaler interface { UnmarshalBSON([]byte) error } -// ValueUnmarshaler is an interface implemented by types that can unmarshal a -// BSON value representaiton of themselves. The BSON bytes and type can be -// assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it -// wishes to retain the data after returning. +// ValueUnmarshaler is the interface implemented by types that can unmarshal a +// BSON value representation of themselves. The input can be assumed to be a +// valid encoding of a BSON value. UnmarshalBSONValue must copy the BSON value +// bytes if it wishes to retain the data after returning. +// +// ValueUnmarshaler is only used to unmarshal individual values in a BSON +// document. To create custom BSON unmarshaling behavior for an entire BSON +// document, implement the Unmarshaler interface instead. type ValueUnmarshaler interface { UnmarshalBSONValue(bsontype.Type, []byte) error } @@ -40,6 +48,16 @@ func Unmarshal(data []byte, val interface{}) error { // UnmarshalWithRegistry parses the BSON-encoded data using Registry r and // stores the result in the value pointed to by val. If val is nil or not // a pointer, UnmarshalWithRegistry returns InvalidUnmarshalError. +// +// Deprecated: Use [NewDecoder] and specify the Registry by calling [Decoder.SetRegistry] instead: +// +// dec, err := bson.NewDecoder(bsonrw.NewBSONDocumentReader(data)) +// if err != nil { +// panic(err) +// } +// dec.SetRegistry(reg) +// +// See [Decoder] for more examples. func UnmarshalWithRegistry(r *bsoncodec.Registry, data []byte, val interface{}) error { vr := bsonrw.NewBSONDocumentReader(data) return unmarshalFromReader(bsoncodec.DecodeContext{Registry: r}, vr, val) @@ -48,11 +66,40 @@ func UnmarshalWithRegistry(r *bsoncodec.Registry, data []byte, val interface{}) // UnmarshalWithContext parses the BSON-encoded data using DecodeContext dc and // stores the result in the value pointed to by val. If val is nil or not // a pointer, UnmarshalWithRegistry returns InvalidUnmarshalError. +// +// Deprecated: Use [NewDecoder] and use the Decoder configuration methods to set the desired unmarshal +// behavior instead: +// +// dec, err := bson.NewDecoder(bsonrw.NewBSONDocumentReader(data)) +// if err != nil { +// panic(err) +// } +// dec.DefaultDocumentM() +// +// See [Decoder] for more examples. func UnmarshalWithContext(dc bsoncodec.DecodeContext, data []byte, val interface{}) error { vr := bsonrw.NewBSONDocumentReader(data) return unmarshalFromReader(dc, vr, val) } +// UnmarshalValue parses the BSON value of type t with bson.DefaultRegistry and +// stores the result in the value pointed to by val. If val is nil or not a pointer, +// UnmarshalValue returns an error. +func UnmarshalValue(t bsontype.Type, data []byte, val interface{}) error { + return UnmarshalValueWithRegistry(DefaultRegistry, t, data, val) +} + +// UnmarshalValueWithRegistry parses the BSON value of type t with registry r and +// stores the result in the value pointed to by val. If val is nil or not a pointer, +// UnmarshalValue returns an error. +// +// Deprecated: Using a custom registry to unmarshal individual BSON values will not be supported in +// Go Driver 2.0. +func UnmarshalValueWithRegistry(r *bsoncodec.Registry, t bsontype.Type, data []byte, val interface{}) error { + vr := bsonrw.NewBSONValueReader(t, data) + return unmarshalFromReader(bsoncodec.DecodeContext{Registry: r}, vr, val) +} + // UnmarshalExtJSON parses the extended JSON-encoded data and stores the result // in the value pointed to by val. If val is nil or not a pointer, Unmarshal // returns InvalidUnmarshalError. @@ -63,6 +110,20 @@ func UnmarshalExtJSON(data []byte, canonical bool, val interface{}) error { // UnmarshalExtJSONWithRegistry parses the extended JSON-encoded data using // Registry r and stores the result in the value pointed to by val. If val is // nil or not a pointer, UnmarshalWithRegistry returns InvalidUnmarshalError. +// +// Deprecated: Use [NewDecoder] and specify the Registry by calling [Decoder.SetRegistry] instead: +// +// vr, err := bsonrw.NewExtJSONValueReader(bytes.NewReader(data), true) +// if err != nil { +// panic(err) +// } +// dec, err := bson.NewDecoder(vr) +// if err != nil { +// panic(err) +// } +// dec.SetRegistry(reg) +// +// See [Decoder] for more examples. func UnmarshalExtJSONWithRegistry(r *bsoncodec.Registry, data []byte, canonical bool, val interface{}) error { ejvr, err := bsonrw.NewExtJSONValueReader(bytes.NewReader(data), canonical) if err != nil { @@ -75,6 +136,21 @@ func UnmarshalExtJSONWithRegistry(r *bsoncodec.Registry, data []byte, canonical // UnmarshalExtJSONWithContext parses the extended JSON-encoded data using // DecodeContext dc and stores the result in the value pointed to by val. If val is // nil or not a pointer, UnmarshalWithRegistry returns InvalidUnmarshalError. +// +// Deprecated: Use [NewDecoder] and use the Decoder configuration methods to set the desired unmarshal +// behavior instead: +// +// vr, err := bsonrw.NewExtJSONValueReader(bytes.NewReader(data), true) +// if err != nil { +// panic(err) +// } +// dec, err := bson.NewDecoder(vr) +// if err != nil { +// panic(err) +// } +// dec.DefaultDocumentM() +// +// See [Decoder] for more examples. func UnmarshalExtJSONWithContext(dc bsoncodec.DecodeContext, data []byte, canonical bool, val interface{}) error { ejvr, err := bsonrw.NewExtJSONValueReader(bytes.NewReader(data), canonical) if err != nil { diff --git a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/array.go b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/array.go index 8ea60ba3c6..6bc0afa700 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/array.go +++ b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/array.go @@ -7,10 +7,10 @@ package bsoncore import ( - "bytes" "fmt" "io" "strconv" + "strings" ) // NewArrayLengthError creates and returns an error for when the length of an array exceeds the @@ -53,7 +53,7 @@ func (a Array) DebugString() string { if len(a) < 5 { return "" } - var buf bytes.Buffer + var buf strings.Builder buf.WriteString("Array") length, rem, _ := ReadLength(a) // We know we have enough bytes to read the length buf.WriteByte('(') @@ -69,7 +69,7 @@ func (a Array) DebugString() string { buf.WriteString(fmt.Sprintf("", length)) break } - fmt.Fprintf(&buf, "%s", elem.Value().DebugString()) + buf.WriteString(elem.Value().DebugString()) if length != 1 { buf.WriteByte(',') } @@ -85,7 +85,7 @@ func (a Array) String() string { if len(a) < 5 { return "" } - var buf bytes.Buffer + var buf strings.Builder buf.WriteByte('[') length, rem, _ := ReadLength(a) // We know we have enough bytes to read the length @@ -100,7 +100,7 @@ func (a Array) String() string { if !ok { return "" } - fmt.Fprintf(&buf, "%s", elem.Value().String()) + buf.WriteString(elem.Value().String()) if length > 1 { buf.WriteByte(',') } diff --git a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bson_documentbuilder.go b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bson_documentbuilder.go index b0d45212db..52162f8aa0 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bson_documentbuilder.go +++ b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bson_documentbuilder.go @@ -45,7 +45,7 @@ func (db *DocumentBuilder) AppendInt32(key string, i32 int32) *DocumentBuilder { return db } -// AppendDocument will append a bson embeded document element using key +// AppendDocument will append a bson embedded document element using key // and doc to DocumentBuilder.doc func (db *DocumentBuilder) AppendDocument(key string, doc []byte) *DocumentBuilder { db.doc = AppendDocumentElement(db.doc, key, doc) diff --git a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go index 97ef1b85d5..88133293ea 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go +++ b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go @@ -4,25 +4,6 @@ // not use this file except in compliance with the License. You may obtain // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Package bsoncore contains functions that can be used to encode and decode BSON -// elements and values to or from a slice of bytes. These functions are aimed at -// allowing low level manipulation of BSON and can be used to build a higher -// level BSON library. -// -// The Read* functions within this package return the values of the element and -// a boolean indicating if the values are valid. A boolean was used instead of -// an error because any error that would be returned would be the same: not -// enough bytes. This library attempts to do no validation, it will only return -// false if there are not enough bytes for an item to be read. For example, the -// ReadDocument function checks the length, if that length is larger than the -// number of bytes availble, it will return false, if there are enough bytes, it -// will return those bytes and true. It is the consumers responsibility to -// validate those bytes. -// -// The Append* functions within this package will append the type value to the -// given dst slice. If the slice has enough capacity, it will not grow the -// slice. The Append*Element functions within this package operate in the same -// way, but additionally append the BSON type and the key before the value. package bsoncore // import "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" import ( @@ -65,11 +46,10 @@ func AppendHeader(dst []byte, t bsontype.Type, key string) []byte { // return append(AppendType(dst, t), key+string(0x00)...) } -// TODO(skriptble): All of the Read* functions should return src resliced to start just after what -// was read. +// TODO(skriptble): All of the Read* functions should return src resliced to start just after what was read. // ReadType will return the first byte of the provided []byte as a type. If -// there is no availble byte, false is returned. +// there is no available byte, false is returned. func ReadType(src []byte) (bsontype.Type, []byte, bool) { if len(src) < 1 { return 0, src, false @@ -197,12 +177,13 @@ func ReadString(src []byte) (string, []byte, bool) { // AppendDocumentStart reserves a document's length and returns the index where the length begins. // This index can later be used to write the length of the document. -// -// TODO(skriptble): We really need AppendDocumentStart and AppendDocumentEnd. -// AppendDocumentStart would handle calling ReserveLength and providing the index of the start of -// the document. AppendDocumentEnd would handle taking that start index, adding the null byte, -// calculating the length, and filling in the length at the start of the document. -func AppendDocumentStart(dst []byte) (index int32, b []byte) { return ReserveLength(dst) } +func AppendDocumentStart(dst []byte) (index int32, b []byte) { + // TODO(skriptble): We really need AppendDocumentStart and AppendDocumentEnd. AppendDocumentStart would handle calling + // TODO ReserveLength and providing the index of the start of the document. AppendDocumentEnd would handle taking that + // TODO start index, adding the null byte, calculating the length, and filling in the length at the start of the + // TODO document. + return ReserveLength(dst) +} // AppendDocumentStartInline functions the same as AppendDocumentStart but takes a pointer to the // index int32 which allows this function to be used inline. @@ -231,7 +212,7 @@ func AppendDocumentEnd(dst []byte, index int32) ([]byte, error) { // AppendDocument will append doc to dst and return the extended buffer. func AppendDocument(dst []byte, doc []byte) []byte { return append(dst, doc...) } -// AppendDocumentElement will append a BSON embeded document element using key +// AppendDocumentElement will append a BSON embedded document element using key // and doc to dst and return the extended buffer. func AppendDocumentElement(dst []byte, key string, doc []byte) []byte { return AppendDocument(AppendHeader(dst, bsontype.EmbeddedDocument, key), doc) @@ -254,7 +235,7 @@ func BuildDocumentValue(elems ...[]byte) Value { return Value{Type: bsontype.EmbeddedDocument, Data: BuildDocument(nil, elems...)} } -// BuildDocumentElement will append a BSON embedded document elemnt using key and the provided +// BuildDocumentElement will append a BSON embedded document element using key and the provided // elements and return the extended buffer. func BuildDocumentElement(dst []byte, key string, elems ...[]byte) []byte { return BuildDocument(AppendHeader(dst, bsontype.EmbeddedDocument, key), elems...) @@ -308,7 +289,7 @@ func BuildArrayElement(dst []byte, key string, values ...Value) []byte { // ReadArray will read an array from src. If there are not enough bytes it // will return false. -func ReadArray(src []byte) (arr Document, rem []byte, ok bool) { return readLengthBytes(src) } +func ReadArray(src []byte) (arr Array, rem []byte, ok bool) { return readLengthBytes(src) } // AppendBinary will append subtype and b to dst and return the extended buffer. func AppendBinary(dst []byte, subtype byte, b []byte) []byte { @@ -844,6 +825,9 @@ func readLengthBytes(src []byte) ([]byte, []byte, bool) { if !ok { return nil, src, false } + if l < 4 { + return nil, src, false + } if len(src) < int(l) { return nil, src, false } diff --git a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/doc.go b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/doc.go new file mode 100644 index 0000000000..6837b53fc5 --- /dev/null +++ b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/doc.go @@ -0,0 +1,29 @@ +// Copyright (C) MongoDB, Inc. 2022-present. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +// Package bsoncore contains functions that can be used to encode and decode BSON +// elements and values to or from a slice of bytes. These functions are aimed at +// allowing low level manipulation of BSON and can be used to build a higher +// level BSON library. +// +// The Read* functions within this package return the values of the element and +// a boolean indicating if the values are valid. A boolean was used instead of +// an error because any error that would be returned would be the same: not +// enough bytes. This library attempts to do no validation, it will only return +// false if there are not enough bytes for an item to be read. For example, the +// ReadDocument function checks the length, if that length is larger than the +// number of bytes available, it will return false, if there are enough bytes, it +// will return those bytes and true. It is the consumers responsibility to +// validate those bytes. +// +// The Append* functions within this package will append the type value to the +// given dst slice. If the slice has enough capacity, it will not grow the +// slice. The Append*Element functions within this package operate in the same +// way, but additionally append the BSON type and the key before the value. +// +// Warning: Package bsoncore is unstable and there is no backward compatibility +// guarantee. It is experimental and subject to change. +package bsoncore diff --git a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/document.go b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/document.go index b77c593ede..3f360f1ae1 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/document.go +++ b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/document.go @@ -7,13 +7,12 @@ package bsoncore import ( - "bytes" "errors" "fmt" "io" "strconv" + "strings" - "github.com/go-stack/stack" "go.mongodb.org/mongo-driver/bson/bsontype" ) @@ -37,13 +36,12 @@ func lengthError(bufferType string, length, rem int) error { type InsufficientBytesError struct { Source []byte Remaining []byte - Stack stack.CallStack } -// NewInsufficientBytesError creates a new InsufficientBytesError with the given Document, remaining -// bytes, and the current stack. +// NewInsufficientBytesError creates a new InsufficientBytesError with the given Document and +// remaining bytes. func NewInsufficientBytesError(src, rem []byte) InsufficientBytesError { - return InsufficientBytesError{Source: src, Remaining: rem, Stack: stack.Trace().TrimRuntime()} + return InsufficientBytesError{Source: src, Remaining: rem} } // Error implements the error interface. @@ -51,28 +49,6 @@ func (ibe InsufficientBytesError) Error() string { return "too few bytes to read next component" } -// ErrorStack returns a string representing the stack at the point where the error occurred. -func (ibe InsufficientBytesError) ErrorStack() string { - s := bytes.NewBufferString("too few bytes to read next component: [") - - for i, call := range ibe.Stack { - if i != 0 { - s.WriteString(", ") - } - - // go vet doesn't like %k even though it's part of stack's API, so we move the format - // string so it doesn't complain. (We also can't make it a constant, or go vet still - // complains.) - callFormat := "%k.%n %v" - - s.WriteString(fmt.Sprintf(callFormat, call, call, call)) - } - - s.WriteRune(']') - - return s.String() -} - // Equal checks that err2 also is an ErrTooSmall. func (ibe InsufficientBytesError) Equal(err2 error) bool { switch err2.(type) { @@ -200,7 +176,8 @@ func (d Document) LookupErr(key ...string) (Value, error) { } return val, nil case bsontype.Array: - val, err := elem.Value().Array().LookupErr(key[1:]...) + // Convert to Document to continue Lookup recursion. + val, err := Document(elem.Value().Array()).LookupErr(key[1:]...) if err != nil { return Value{}, err } @@ -260,7 +237,7 @@ func (d Document) DebugString() string { if len(d) < 5 { return "" } - var buf bytes.Buffer + var buf strings.Builder buf.WriteString("Document") length, rem, _ := ReadLength(d) // We know we have enough bytes to read the length buf.WriteByte('(') @@ -276,7 +253,7 @@ func (d Document) DebugString() string { buf.WriteString(fmt.Sprintf("", length)) break } - fmt.Fprintf(&buf, "%s ", elem.DebugString()) + buf.WriteString(elem.DebugString()) } buf.WriteByte('}') @@ -289,7 +266,7 @@ func (d Document) String() string { if len(d) < 5 { return "" } - var buf bytes.Buffer + var buf strings.Builder buf.WriteByte('{') length, rem, _ := ReadLength(d) // We know we have enough bytes to read the length @@ -308,7 +285,7 @@ func (d Document) String() string { if !ok { return "" } - fmt.Fprintf(&buf, "%s", elem.String()) + buf.WriteString(elem.String()) first = false } buf.WriteByte('}') diff --git a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/document_sequence.go b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/document_sequence.go index 04d162faa1..e35bd0cd9a 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/document_sequence.go +++ b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/document_sequence.go @@ -1,3 +1,9 @@ +// Copyright (C) MongoDB, Inc. 2022-present. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + package bsoncore import ( @@ -90,8 +96,8 @@ func (ds *DocumentSequence) Empty() bool { } } -//ResetIterator resets the iteration point for the Next method to the beginning of the document -//sequence. +// ResetIterator resets the iteration point for the Next method to the beginning of the document +// sequence. func (ds *DocumentSequence) ResetIterator() { if ds == nil { return diff --git a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/element.go b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/element.go index 3acb4222b2..1fe0897c91 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/element.go +++ b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/element.go @@ -129,7 +129,7 @@ func (e Element) String() string { if !valid { return "" } - return fmt.Sprintf(`"%s": %v`, key, val) + return "\"" + string(key) + "\": " + val.String() } // DebugString outputs a human readable version of RawElement. It will attempt to stringify the diff --git a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/value.go b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/value.go index ca29815495..69c1f9edbb 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/value.go +++ b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/value.go @@ -59,8 +59,6 @@ func (v Value) IsNumber() bool { // AsInt32 returns a BSON number as an int32. If the BSON type is not a numeric one, this method // will panic. -// -// TODO(skriptble): Add support for Decimal128. func (v Value) AsInt32() int32 { if !v.IsNumber() { panic(ElementTypeError{"bsoncore.Value.AsInt32", v.Type}) @@ -93,8 +91,6 @@ func (v Value) AsInt32() int32 { // AsInt32OK functions the same as AsInt32 but returns a boolean instead of panicking. False // indicates an error. -// -// TODO(skriptble): Add support for Decimal128. func (v Value) AsInt32OK() (int32, bool) { if !v.IsNumber() { return 0, false @@ -127,8 +123,6 @@ func (v Value) AsInt32OK() (int32, bool) { // AsInt64 returns a BSON number as an int64. If the BSON type is not a numeric one, this method // will panic. -// -// TODO(skriptble): Add support for Decimal128. func (v Value) AsInt64() int64 { if !v.IsNumber() { panic(ElementTypeError{"bsoncore.Value.AsInt64", v.Type}) @@ -162,8 +156,6 @@ func (v Value) AsInt64() int64 { // AsInt64OK functions the same as AsInt64 but returns a boolean instead of panicking. False // indicates an error. -// -// TODO(skriptble): Add support for Decimal128. func (v Value) AsInt64OK() (int64, bool) { if !v.IsNumber() { return 0, false @@ -198,21 +190,14 @@ func (v Value) AsInt64OK() (int64, bool) { // AsFloat64 returns a BSON number as an float64. If the BSON type is not a numeric one, this method // will panic. // -// TODO(skriptble): Add support for Decimal128. -func (v Value) AsFloat64() float64 { return 0 } +// TODO(GODRIVER-2751): Implement AsFloat64. +// func (v Value) AsFloat64() float64 // AsFloat64OK functions the same as AsFloat64 but returns a boolean instead of panicking. False // indicates an error. // -// TODO(skriptble): Add support for Decimal128. -func (v Value) AsFloat64OK() (float64, bool) { return 0, false } - -// Add will add this value to another. This is currently only implemented for strings and numbers. -// If either value is a string, the other type is coerced into a string and added to the other. -// -// This method will alter v and will attempt to reuse the []byte of v. If the []byte is too small, -// it will be expanded. -func (v *Value) Add(v2 Value) error { return nil } +// TODO(GODRIVER-2751): Implement AsFloat64OK. +// func (v Value) AsFloat64OK() (float64, bool) // Equal compaes v to v2 and returns true if they are equal. func (v Value) Equal(v2 Value) bool { @@ -250,7 +235,7 @@ func (v Value) String() string { if !ok { return "" } - return docAsArray(arr, false) + return arr.String() case bsontype.Binary: subtype, data, ok := v.BinaryOK() if !ok { @@ -323,7 +308,7 @@ func (v Value) String() string { if !ok { return "" } - return fmt.Sprintf(`{"$timestamp":{"t":"%s","i":"%s"}}`, strconv.FormatUint(uint64(t), 10), strconv.FormatUint(uint64(i), 10)) + return fmt.Sprintf(`{"$timestamp":{"t":%v,"i":%v}}`, t, i) case bsontype.Int64: i64, ok := v.Int64OK() if !ok { @@ -366,7 +351,7 @@ func (v Value) DebugString() string { if !ok { return "" } - return docAsArray(arr, true) + return arr.DebugString() case bsontype.CodeWithScope: code, scope, ok := v.CodeWithScopeOK() if !ok { @@ -464,7 +449,7 @@ func (v Value) DocumentOK() (Document, bool) { // Array returns the BSON array the Value represents as an Array. It panics if the // value is a BSON type other than array. -func (v Value) Array() Document { +func (v Value) Array() Array { if v.Type != bsontype.Array { panic(ElementTypeError{"bsoncore.Value.Array", v.Type}) } @@ -477,7 +462,7 @@ func (v Value) Array() Document { // ArrayOK is the same as Array, except it returns a boolean instead // of panicking. -func (v Value) ArrayOK() (Document, bool) { +func (v Value) ArrayOK() (Array, bool) { if v.Type != bsontype.Array { return nil, false } @@ -602,7 +587,7 @@ func (v Value) Time() time.Time { if !ok { panic(NewInsufficientBytesError(v.Data, v.Data)) } - return time.Unix(int64(dt)/1000, int64(dt)%1000*1000000) + return time.Unix(dt/1000, dt%1000*1000000) } // TimeOK is the same as Time, except it returns a boolean instead of @@ -615,7 +600,7 @@ func (v Value) TimeOK() (time.Time, bool) { if !ok { return time.Time{}, false } - return time.Unix(int64(dt)/1000, int64(dt)%1000*1000000), true + return time.Unix(dt/1000, dt%1000*1000000), true } // Regex returns the BSON regex value the Value represents. It panics if the value is a BSON @@ -978,38 +963,3 @@ func sortStringAlphebeticAscending(s string) string { sort.Sort(ss) return string([]rune(ss)) } - -func docAsArray(d Document, debug bool) string { - if len(d) < 5 { - return "" - } - var buf bytes.Buffer - buf.WriteByte('[') - - length, rem, _ := ReadLength(d) // We know we have enough bytes to read the length - - length -= 4 - - var elem Element - var ok bool - first := true - for length > 1 { - if !first { - buf.WriteByte(',') - } - elem, rem, ok = ReadElement(rem) - length -= int32(len(elem)) - if !ok { - return "" - } - if debug { - fmt.Fprintf(&buf, "%s ", elem.Value().DebugString()) - } else { - fmt.Fprintf(&buf, "%s", elem.Value()) - } - first = false - } - buf.WriteByte(']') - - return buf.String() -} diff --git a/vendor/go.opentelemetry.io/otel/.codespellignore b/vendor/go.opentelemetry.io/otel/.codespellignore new file mode 100644 index 0000000000..120b63a9c7 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.codespellignore @@ -0,0 +1,7 @@ +ot +fo +te +collison +consequentially +ans +nam diff --git a/vendor/go.opentelemetry.io/otel/.codespellrc b/vendor/go.opentelemetry.io/otel/.codespellrc new file mode 100644 index 0000000000..4afbb1fb3b --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.codespellrc @@ -0,0 +1,10 @@ +# https://github.com/codespell-project/codespell +[codespell] +builtin = clear,rare,informal +check-filenames = +check-hidden = +ignore-words = .codespellignore +interactive = 1 +skip = .git,go.mod,go.sum,semconv,venv,.tools +uri-ignore-words-list = * +write = diff --git a/vendor/go.opentelemetry.io/otel/.gitattributes b/vendor/go.opentelemetry.io/otel/.gitattributes new file mode 100644 index 0000000000..314766e91b --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.gitattributes @@ -0,0 +1,3 @@ +* text=auto eol=lf +*.{cmd,[cC][mM][dD]} text eol=crlf +*.{bat,[bB][aA][tT]} text eol=crlf diff --git a/vendor/go.opentelemetry.io/otel/.gitignore b/vendor/go.opentelemetry.io/otel/.gitignore new file mode 100644 index 0000000000..895c7664be --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.gitignore @@ -0,0 +1,22 @@ +.DS_Store +Thumbs.db + +.tools/ +venv/ +.idea/ +.vscode/ +*.iml +*.so +coverage.* +go.work +go.work.sum + +gen/ + +/example/dice/dice +/example/namedtracer/namedtracer +/example/otel-collector/otel-collector +/example/opencensus/opencensus +/example/passthrough/passthrough +/example/prometheus/prometheus +/example/zipkin/zipkin diff --git a/vendor/go.opentelemetry.io/otel/.gitmodules b/vendor/go.opentelemetry.io/otel/.gitmodules new file mode 100644 index 0000000000..38a1f56982 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.gitmodules @@ -0,0 +1,3 @@ +[submodule "opentelemetry-proto"] + path = exporters/otlp/internal/opentelemetry-proto + url = https://github.com/open-telemetry/opentelemetry-proto diff --git a/vendor/go.opentelemetry.io/otel/.golangci.yml b/vendor/go.opentelemetry.io/otel/.golangci.yml new file mode 100644 index 0000000000..a62511f382 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.golangci.yml @@ -0,0 +1,296 @@ +# See https://github.com/golangci/golangci-lint#config-file +run: + issues-exit-code: 1 #Default + tests: true #Default + +linters: + # Disable everything by default so upgrades to not include new "default + # enabled" linters. + disable-all: true + # Specifically enable linters we want to use. + enable: + - depguard + - errcheck + - godot + - gofumpt + - goimports + - gosec + - gosimple + - govet + - ineffassign + - misspell + - revive + - staticcheck + - typecheck + - unused + +issues: + # Maximum issues count per one linter. + # Set to 0 to disable. + # Default: 50 + # Setting to unlimited so the linter only is run once to debug all issues. + max-issues-per-linter: 0 + # Maximum count of issues with the same text. + # Set to 0 to disable. + # Default: 3 + # Setting to unlimited so the linter only is run once to debug all issues. + max-same-issues: 0 + # Excluding configuration per-path, per-linter, per-text and per-source. + exclude-rules: + # TODO: Having appropriate comments for exported objects helps development, + # even for objects in internal packages. Appropriate comments for all + # exported objects should be added and this exclusion removed. + - path: '.*internal/.*' + text: "exported (method|function|type|const) (.+) should have comment or be unexported" + linters: + - revive + # Yes, they are, but it's okay in a test. + - path: _test\.go + text: "exported func.*returns unexported type.*which can be annoying to use" + linters: + - revive + # Example test functions should be treated like main. + - path: example.*_test\.go + text: "calls to (.+) only in main[(][)] or init[(][)] functions" + linters: + - revive + # It's okay to not run gosec in a test. + - path: _test\.go + linters: + - gosec + # Igonoring gosec G404: Use of weak random number generator (math/rand instead of crypto/rand) + # as we commonly use it in tests and examples. + - text: "G404:" + linters: + - gosec + # Igonoring gosec G402: TLS MinVersion too low + # as the https://pkg.go.dev/crypto/tls#Config handles MinVersion default well. + - text: "G402: TLS MinVersion too low." + linters: + - gosec + include: + # revive exported should have comment or be unexported. + - EXC0012 + # revive package comment should be of the form ... + - EXC0013 + +linters-settings: + depguard: + rules: + non-tests: + files: + - "!$test" + - "!**/*test/*.go" + - "!**/internal/matchers/*.go" + deny: + - pkg: "testing" + - pkg: "github.com/stretchr/testify" + - pkg: "crypto/md5" + - pkg: "crypto/sha1" + - pkg: "crypto/**/pkix" + otlp-internal: + files: + - "!**/exporters/otlp/internal/**/*.go" + deny: + - pkg: "go.opentelemetry.io/otel/exporters/otlp/internal" + desc: Do not use cross-module internal packages. + otlptrace-internal: + files: + - "!**/exporters/otlp/otlptrace/*.go" + - "!**/exporters/otlp/otlptrace/internal/**.go" + deny: + - pkg: "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal" + desc: Do not use cross-module internal packages. + otlpmetric-internal: + files: + - "!**/exporters/otlp/otlpmetric/internal/*.go" + - "!**/exporters/otlp/otlpmetric/internal/**/*.go" + deny: + - pkg: "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal" + desc: Do not use cross-module internal packages. + otel-internal: + files: + - "**/sdk/*.go" + - "**/sdk/**/*.go" + - "**/exporters/*.go" + - "**/exporters/**/*.go" + - "**/schema/*.go" + - "**/schema/**/*.go" + - "**/metric/*.go" + - "**/metric/**/*.go" + - "**/bridge/*.go" + - "**/bridge/**/*.go" + - "**/example/*.go" + - "**/example/**/*.go" + - "**/trace/*.go" + - "**/trace/**/*.go" + deny: + - pkg: "go.opentelemetry.io/otel/internal$" + desc: Do not use cross-module internal packages. + - pkg: "go.opentelemetry.io/otel/internal/attribute" + desc: Do not use cross-module internal packages. + - pkg: "go.opentelemetry.io/otel/internal/internaltest" + desc: Do not use cross-module internal packages. + - pkg: "go.opentelemetry.io/otel/internal/matchers" + desc: Do not use cross-module internal packages. + godot: + exclude: + # Exclude links. + - '^ *\[[^]]+\]:' + # Exclude sentence fragments for lists. + - '^[ ]*[-•]' + # Exclude sentences prefixing a list. + - ':$' + goimports: + local-prefixes: go.opentelemetry.io + misspell: + locale: US + ignore-words: + - cancelled + revive: + # Sets the default failure confidence. + # This means that linting errors with less than 0.8 confidence will be ignored. + # Default: 0.8 + confidence: 0.01 + rules: + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#blank-imports + - name: blank-imports + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr + - name: bool-literal-in-expr + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#constant-logical-expr + - name: constant-logical-expr + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-as-argument + # TODO (#3372) re-enable linter when it is compatible. https://github.com/golangci/golangci-lint/issues/3280 + - name: context-as-argument + disabled: true + arguments: + allowTypesBefore: "*testing.T" + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-keys-type + - name: context-keys-type + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#deep-exit + - name: deep-exit + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#defer + - name: defer + disabled: false + arguments: + - ["call-chain", "loop"] + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#dot-imports + - name: dot-imports + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#duplicated-imports + - name: duplicated-imports + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#early-return + - name: early-return + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-block + - name: empty-block + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines + - name: empty-lines + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-naming + - name: error-naming + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-return + - name: error-return + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-strings + - name: error-strings + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#errorf + - name: errorf + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#exported + - name: exported + disabled: false + arguments: + - "sayRepetitiveInsteadOfStutters" + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#flag-parameter + - name: flag-parameter + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#identical-branches + - name: identical-branches + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return + - name: if-return + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#increment-decrement + - name: increment-decrement + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#indent-error-flow + - name: indent-error-flow + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#import-shadowing + - name: import-shadowing + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#package-comments + - name: package-comments + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range + - name: range + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-in-closure + - name: range-val-in-closure + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-address + - name: range-val-address + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redefines-builtin-id + - name: redefines-builtin-id + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-format + - name: string-format + disabled: false + arguments: + - - panic + - '/^[^\n]*$/' + - must not contain line breaks + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag + - name: struct-tag + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#superfluous-else + - name: superfluous-else + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#time-equal + - name: time-equal + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming + - name: var-naming + disabled: false + arguments: + - ["ID"] # AllowList + - ["Otel", "Aws", "Gcp"] # DenyList + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-declaration + - name: var-declaration + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unconditional-recursion + - name: unconditional-recursion + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return + - name: unexported-return + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error + - name: unhandled-error + disabled: false + arguments: + - "fmt.Fprint" + - "fmt.Fprintf" + - "fmt.Fprintln" + - "fmt.Print" + - "fmt.Printf" + - "fmt.Println" + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unnecessary-stmt + - name: unnecessary-stmt + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break + - name: useless-break + disabled: false + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#waitgroup-by-value + - name: waitgroup-by-value + disabled: false diff --git a/vendor/go.opentelemetry.io/otel/.lycheeignore b/vendor/go.opentelemetry.io/otel/.lycheeignore new file mode 100644 index 0000000000..40d62fa2eb --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.lycheeignore @@ -0,0 +1,6 @@ +http://localhost +http://jaeger-collector +https://github.com/open-telemetry/opentelemetry-go/milestone/ +https://github.com/open-telemetry/opentelemetry-go/projects +file:///home/runner/work/opentelemetry-go/opentelemetry-go/libraries +file:///home/runner/work/opentelemetry-go/opentelemetry-go/manual diff --git a/vendor/go.opentelemetry.io/otel/.markdownlint.yaml b/vendor/go.opentelemetry.io/otel/.markdownlint.yaml new file mode 100644 index 0000000000..3202496c35 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/.markdownlint.yaml @@ -0,0 +1,29 @@ +# Default state for all rules +default: true + +# ul-style +MD004: false + +# hard-tabs +MD010: false + +# line-length +MD013: false + +# no-duplicate-header +MD024: + siblings_only: true + +#single-title +MD025: false + +# ol-prefix +MD029: + style: ordered + +# no-inline-html +MD033: false + +# fenced-code-language +MD040: false + diff --git a/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/vendor/go.opentelemetry.io/otel/CHANGELOG.md new file mode 100644 index 0000000000..98f2d20438 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/CHANGELOG.md @@ -0,0 +1,2939 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). + +This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [1.24.0/0.46.0/0.0.1-alpha] 2024-02-23 + +This release is the last to support [Go 1.20]. +The next release will require at least [Go 1.21]. + +### Added + +- Support [Go 1.22]. (#4890) +- Add exemplar support to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4900) +- Add exemplar support to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4900) +- The `go.opentelemetry.io/otel/log` module is added. + This module includes OpenTelemetry Go's implementation of the Logs Bridge API. + This module is in an alpha state, it is subject to breaking changes. + See our [versioning policy](./VERSIONING.md) for more info. (#4961) + +### Fixed + +- Fix registration of multiple callbacks when using the global meter provider from `go.opentelemetry.io/otel`. (#4945) +- Fix negative buckets in output of exponential histograms. (#4956) + +## [1.23.1] 2024-02-07 + +### Fixed + +- Register all callbacks passed during observable instrument creation instead of just the last one multiple times in `go.opentelemetry.io/otel/sdk/metric`. (#4888) + +## [1.23.0] 2024-02-06 + +This release contains the first stable, `v1`, release of the following modules: + +- `go.opentelemetry.io/otel/bridge/opencensus` +- `go.opentelemetry.io/otel/bridge/opencensus/test` +- `go.opentelemetry.io/otel/example/opencensus` +- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` +- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` +- `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` + +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- Add `WithEndpointURL` option to the `exporters/otlp/otlpmetric/otlpmetricgrpc`, `exporters/otlp/otlpmetric/otlpmetrichttp`, `exporters/otlp/otlptrace/otlptracegrpc` and `exporters/otlp/otlptrace/otlptracehttp` packages. (#4808) +- Experimental exemplar exporting is added to the metric SDK. + See [metric documentation](./sdk/metric/internal/x/README.md#exemplars) for more information about this feature and how to enable it. (#4871) +- `ErrSchemaURLConflict` is added to `go.opentelemetry.io/otel/sdk/resource`. + This error is returned when a merge of two `Resource`s with different (non-empty) schema URL is attempted. (#4876) + +### Changed + +- The `Merge` and `New` functions in `go.opentelemetry.io/otel/sdk/resource` now returns a partial result if there is a schema URL merge conflict. + Instead of returning `nil` when two `Resource`s with different (non-empty) schema URLs are merged the merged `Resource`, along with the new `ErrSchemaURLConflict` error, is returned. + It is up to the user to decide if they want to use the returned `Resource` or not. + It may have desired attributes overwritten or include stale semantic conventions. (#4876) + +### Fixed + +- Fix `ContainerID` resource detection on systemd when cgroup path has a colon. (#4449) +- Fix `go.opentelemetry.io/otel/sdk/metric` to cache instruments to avoid leaking memory when the same instrument is created multiple times. (#4820) +- Fix missing `Mix` and `Max` values for `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` by introducing `MarshalText` and `MarshalJSON` for the `Extrema` type in `go.opentelemetry.io/sdk/metric/metricdata`. (#4827) + +## [1.23.0-rc.1] 2024-01-18 + +This is a release candidate for the v1.23.0 release. +That release is expected to include the `v1` release of the following modules: + +- `go.opentelemetry.io/otel/bridge/opencensus` +- `go.opentelemetry.io/otel/bridge/opencensus/test` +- `go.opentelemetry.io/otel/example/opencensus` +- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` +- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` +- `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` + +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +## [1.22.0/0.45.0] 2024-01-17 + +### Added + +- The `go.opentelemetry.io/otel/semconv/v1.22.0` package. + The package contains semantic conventions from the `v1.22.0` version of the OpenTelemetry Semantic Conventions. (#4735) +- The `go.opentelemetry.io/otel/semconv/v1.23.0` package. + The package contains semantic conventions from the `v1.23.0` version of the OpenTelemetry Semantic Conventions. (#4746) +- The `go.opentelemetry.io/otel/semconv/v1.23.1` package. + The package contains semantic conventions from the `v1.23.1` version of the OpenTelemetry Semantic Conventions. (#4749) +- The `go.opentelemetry.io/otel/semconv/v1.24.0` package. + The package contains semantic conventions from the `v1.24.0` version of the OpenTelemetry Semantic Conventions. (#4770) +- Add `WithResourceAsConstantLabels` option to apply resource attributes for every metric emitted by the Prometheus exporter. (#4733) +- Experimental cardinality limiting is added to the metric SDK. + See [metric documentation](./sdk/metric/internal/x/README.md#cardinality-limit) for more information about this feature and how to enable it. (#4457) +- Add `NewMemberRaw` and `NewKeyValuePropertyRaw` in `go.opentelemetry.io/otel/baggage`. (#4804) + +### Changed + +- Upgrade all use of `go.opentelemetry.io/otel/semconv` to use `v1.24.0`. (#4754) +- Update transformations in `go.opentelemetry.io/otel/exporters/zipkin` to follow `v1.24.0` version of the OpenTelemetry specification. (#4754) +- Record synchronous measurements when the passed context is canceled instead of dropping in `go.opentelemetry.io/otel/sdk/metric`. + If you do not want to make a measurement when the context is cancelled, you need to handle it yourself (e.g `if ctx.Err() != nil`). (#4671) +- Improve `go.opentelemetry.io/otel/trace.TraceState`'s performance. (#4722) +- Improve `go.opentelemetry.io/otel/propagation.TraceContext`'s performance. (#4721) +- Improve `go.opentelemetry.io/otel/baggage` performance. (#4743) +- Improve performance of the `(*Set).Filter` method in `go.opentelemetry.io/otel/attribute` when the passed filter does not filter out any attributes from the set. (#4774) +- `Member.String` in `go.opentelemetry.io/otel/baggage` percent-encodes only when necessary. (#4775) +- Improve `go.opentelemetry.io/otel/trace.Span`'s performance when adding multiple attributes. (#4818) +- `Property.Value` in `go.opentelemetry.io/otel/baggage` now returns a raw string instead of a percent-encoded value. (#4804) + +### Fixed + +- Fix `Parse` in `go.opentelemetry.io/otel/baggage` to validate member value before percent-decoding. (#4755) +- Fix whitespace encoding of `Member.String` in `go.opentelemetry.io/otel/baggage`. (#4756) +- Fix observable not registered error when the asynchronous instrument has a drop aggregation in `go.opentelemetry.io/otel/sdk/metric`. (#4772) +- Fix baggage item key so that it is not canonicalized in `go.opentelemetry.io/otel/bridge/opentracing`. (#4776) +- Fix `go.opentelemetry.io/otel/bridge/opentracing` to properly handle baggage values that requires escaping during propagation. (#4804) +- Fix a bug where using multiple readers resulted in incorrect asynchronous counter values in `go.opentelemetry.io/otel/sdk/metric`. (#4742) + +## [1.21.0/0.44.0] 2023-11-16 + +### Removed + +- Remove the deprecated `go.opentelemetry.io/otel/bridge/opencensus.NewTracer`. (#4706) +- Remove the deprecated `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` module. (#4707) +- Remove the deprecated `go.opentelemetry.io/otel/example/view` module. (#4708) +- Remove the deprecated `go.opentelemetry.io/otel/example/fib` module. (#4723) + +### Fixed + +- Do not parse non-protobuf responses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4719) +- Do not parse non-protobuf responses in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4719) + +## [1.20.0/0.43.0] 2023-11-10 + +This release brings a breaking change for custom trace API implementations. Some interfaces (`TracerProvider`, `Tracer`, `Span`) now embed the `go.opentelemetry.io/otel/trace/embedded` types. Implementors need to update their implementations based on what they want the default behavior to be. See the "API Implementations" section of the [trace API] package documentation for more information about how to accomplish this. + +### Added + +- Add `go.opentelemetry.io/otel/bridge/opencensus.InstallTraceBridge`, which installs the OpenCensus trace bridge, and replaces `opencensus.NewTracer`. (#4567) +- Add scope version to trace and metric bridges in `go.opentelemetry.io/otel/bridge/opencensus`. (#4584) +- Add the `go.opentelemetry.io/otel/trace/embedded` package to be embedded in the exported trace API interfaces. (#4620) +- Add the `go.opentelemetry.io/otel/trace/noop` package as a default no-op implementation of the trace API. (#4620) +- Add context propagation in `go.opentelemetry.io/otel/example/dice`. (#4644) +- Add view configuration to `go.opentelemetry.io/otel/example/prometheus`. (#4649) +- Add `go.opentelemetry.io/otel/metric.WithExplicitBucketBoundaries`, which allows defining default explicit bucket boundaries when creating histogram instruments. (#4603) +- Add `Version` function in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4660) +- Add `Version` function in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4660) +- Add Summary, SummaryDataPoint, and QuantileValue to `go.opentelemetry.io/sdk/metric/metricdata`. (#4622) +- `go.opentelemetry.io/otel/bridge/opencensus.NewMetricProducer` now supports exemplars from OpenCensus. (#4585) +- Add support for `WithExplicitBucketBoundaries` in `go.opentelemetry.io/otel/sdk/metric`. (#4605) +- Add support for Summary metrics in `go.opentelemetry.io/otel/bridge/opencensus`. (#4668) + +### Deprecated + +- Deprecate `go.opentelemetry.io/otel/bridge/opencensus.NewTracer` in favor of `opencensus.InstallTraceBridge`. (#4567) +- Deprecate `go.opentelemetry.io/otel/example/fib` package is in favor of `go.opentelemetry.io/otel/example/dice`. (#4618) +- Deprecate `go.opentelemetry.io/otel/trace.NewNoopTracerProvider`. + Use the added `NewTracerProvider` function in `go.opentelemetry.io/otel/trace/noop` instead. (#4620) +- Deprecate `go.opentelemetry.io/otel/example/view` package in favor of `go.opentelemetry.io/otel/example/prometheus`. (#4649) +- Deprecate `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4693) + +### Changed + +- `go.opentelemetry.io/otel/bridge/opencensus.NewMetricProducer` returns a `*MetricProducer` struct instead of the metric.Producer interface. (#4583) +- The `TracerProvider` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.TracerProvider` type. + This extends the `TracerProvider` interface and is is a breaking change for any existing implementation. + Implementors need to update their implementations based on what they want the default behavior of the interface to be. + See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620) +- The `Tracer` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.Tracer` type. + This extends the `Tracer` interface and is is a breaking change for any existing implementation. + Implementors need to update their implementations based on what they want the default behavior of the interface to be. + See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620) +- The `Span` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.Span` type. + This extends the `Span` interface and is is a breaking change for any existing implementation. + Implementors need to update their implementations based on what they want the default behavior of the interface to be. + See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620) +- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` does no longer depend on `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4660) +- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` does no longer depend on `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4660) +- Retry for `502 Bad Gateway` and `504 Gateway Timeout` HTTP statuses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4670) +- Retry for `502 Bad Gateway` and `504 Gateway Timeout` HTTP statuses in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4670) +- Retry for `RESOURCE_EXHAUSTED` only if RetryInfo is returned in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4669) +- Retry for `RESOURCE_EXHAUSTED` only if RetryInfo is returned in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#4669) +- Retry temporary HTTP request failures in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4679) +- Retry temporary HTTP request failures in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4679) + +### Fixed + +- Fix improper parsing of characters such us `+`, `/` by `Parse` in `go.opentelemetry.io/otel/baggage` as they were rendered as a whitespace. (#4667) +- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_RESOURCE_ATTRIBUTES` in `go.opentelemetry.io/otel/sdk/resource` as they were rendered as a whitespace. (#4699) +- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_METRICS_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` as they were rendered as a whitespace. (#4699) +- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_METRICS_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` as they were rendered as a whitespace. (#4699) +- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_TRACES_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracegrpc` as they were rendered as a whitespace. (#4699) +- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_TRACES_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracehttp` as they were rendered as a whitespace. (#4699) +- In `go.opentelemetry.op/otel/exporters/prometheus`, the exporter no longer `Collect`s metrics after `Shutdown` is invoked. (#4648) +- Fix documentation for `WithCompressor` in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#4695) +- Fix documentation for `WithCompressor` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4695) + +## [1.19.0/0.42.0/0.0.7] 2023-09-28 + +This release contains the first stable release of the OpenTelemetry Go [metric SDK]. +Our project stability guarantees now apply to the `go.opentelemetry.io/otel/sdk/metric` package. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- Add the "Roll the dice" getting started application example in `go.opentelemetry.io/otel/example/dice`. (#4539) +- The `WithWriter` and `WithPrettyPrint` options to `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` to set a custom `io.Writer`, and allow displaying the output in human-readable JSON. (#4507) + +### Changed + +- Allow '/' characters in metric instrument names. (#4501) +- The exporter in `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` does not prettify its output by default anymore. (#4507) +- Upgrade `gopkg.io/yaml` from `v2` to `v3` in `go.opentelemetry.io/otel/schema`. (#4535) + +### Fixed + +- In `go.opentelemetry.op/otel/exporters/prometheus`, don't try to create the Prometheus metric on every `Collect` if we know the scope is invalid. (#4499) + +### Removed + +- Remove `"go.opentelemetry.io/otel/bridge/opencensus".NewMetricExporter`, which is replaced by `NewMetricProducer`. (#4566) + +## [1.19.0-rc.1/0.42.0-rc.1] 2023-09-14 + +This is a release candidate for the v1.19.0/v0.42.0 release. +That release is expected to include the `v1` release of the OpenTelemetry Go metric SDK and will provide stability guarantees of that SDK. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Changed + +- Allow '/' characters in metric instrument names. (#4501) + +### Fixed + +- In `go.opentelemetry.op/otel/exporters/prometheus`, don't try to create the prometheus metric on every `Collect` if we know the scope is invalid. (#4499) + +## [1.18.0/0.41.0/0.0.6] 2023-09-12 + +This release drops the compatibility guarantee of [Go 1.19]. + +### Added + +- Add `WithProducer` option in `go.opentelemetry.op/otel/exporters/prometheus` to restore the ability to register producers on the prometheus exporter's manual reader. (#4473) +- Add `IgnoreValue` option in `go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest` to allow ignoring values when comparing metrics. (#4447) + +### Changed + +- Use a `TestingT` interface instead of `*testing.T` struct in `go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest`. (#4483) + +### Deprecated + +- The `NewMetricExporter` in `go.opentelemetry.io/otel/bridge/opencensus` was deprecated in `v0.35.0` (#3541). + The deprecation notice format for the function has been corrected to trigger Go documentation and build tooling. (#4470) + +### Removed + +- Removed the deprecated `go.opentelemetry.io/otel/exporters/jaeger` package. (#4467) +- Removed the deprecated `go.opentelemetry.io/otel/example/jaeger` package. (#4467) +- Removed the deprecated `go.opentelemetry.io/otel/sdk/metric/aggregation` package. (#4468) +- Removed the deprecated internal packages in `go.opentelemetry.io/otel/exporters/otlp` and its sub-packages. (#4469) +- Dropped guaranteed support for versions of Go less than 1.20. (#4481) + +## [1.17.0/0.40.0/0.0.5] 2023-08-28 + +### Added + +- Export the `ManualReader` struct in `go.opentelemetry.io/otel/sdk/metric`. (#4244) +- Export the `PeriodicReader` struct in `go.opentelemetry.io/otel/sdk/metric`. (#4244) +- Add support for exponential histogram aggregations. + A histogram can be configured as an exponential histogram using a view with `"go.opentelemetry.io/otel/sdk/metric".ExponentialHistogram` as the aggregation. (#4245) +- Export the `Exporter` struct in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4272) +- Export the `Exporter` struct in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4272) +- The exporters in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` now support the `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` environment variable. (#4287) +- Add `WithoutCounterSuffixes` option in `go.opentelemetry.io/otel/exporters/prometheus` to disable addition of `_total` suffixes. (#4306) +- Add info and debug logging to the metric SDK in `go.opentelemetry.io/otel/sdk/metric`. (#4315) +- The `go.opentelemetry.io/otel/semconv/v1.21.0` package. + The package contains semantic conventions from the `v1.21.0` version of the OpenTelemetry Semantic Conventions. (#4362) +- Accept 201 to 299 HTTP status as success in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` and `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4365) +- Document the `Temporality` and `Aggregation` methods of the `"go.opentelemetry.io/otel/sdk/metric".Exporter"` need to be concurrent safe. (#4381) +- Expand the set of units supported by the Prometheus exporter, and don't add unit suffixes if they are already present in `go.opentelemetry.op/otel/exporters/prometheus` (#4374) +- Move the `Aggregation` interface and its implementations from `go.opentelemetry.io/otel/sdk/metric/aggregation` to `go.opentelemetry.io/otel/sdk/metric`. (#4435) +- The exporters in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` now support the `OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION` environment variable. (#4437) +- Add the `NewAllowKeysFilter` and `NewDenyKeysFilter` functions to `go.opentelemetry.io/otel/attribute` to allow convenient creation of allow-keys and deny-keys filters. (#4444) +- Support Go 1.21. (#4463) + +### Changed + +- Starting from `v1.21.0` of semantic conventions, `go.opentelemetry.io/otel/semconv/{version}/httpconv` and `go.opentelemetry.io/otel/semconv/{version}/netconv` packages will no longer be published. (#4145) +- Log duplicate instrument conflict at a warning level instead of info in `go.opentelemetry.io/otel/sdk/metric`. (#4202) +- Return an error on the creation of new instruments in `go.opentelemetry.io/otel/sdk/metric` if their name doesn't pass regexp validation. (#4210) +- `NewManualReader` in `go.opentelemetry.io/otel/sdk/metric` returns `*ManualReader` instead of `Reader`. (#4244) +- `NewPeriodicReader` in `go.opentelemetry.io/otel/sdk/metric` returns `*PeriodicReader` instead of `Reader`. (#4244) +- Count the Collect time in the `PeriodicReader` timeout in `go.opentelemetry.io/otel/sdk/metric`. (#4221) +- The function `New` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` returns `*Exporter` instead of `"go.opentelemetry.io/otel/sdk/metric".Exporter`. (#4272) +- The function `New` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` returns `*Exporter` instead of `"go.opentelemetry.io/otel/sdk/metric".Exporter`. (#4272) +- If an attribute set is omitted from an async callback, the previous value will no longer be exported in `go.opentelemetry.io/otel/sdk/metric`. (#4290) +- If an attribute set is observed multiple times in an async callback in `go.opentelemetry.io/otel/sdk/metric`, the values will be summed instead of the last observation winning. (#4289) +- Allow the explicit bucket histogram aggregation to be used for the up-down counter, observable counter, observable up-down counter, and observable gauge in the `go.opentelemetry.io/otel/sdk/metric` package. (#4332) +- Restrict `Meter`s in `go.opentelemetry.io/otel/sdk/metric` to only register and collect instruments it created. (#4333) +- `PeriodicReader.Shutdown` and `PeriodicReader.ForceFlush` in `go.opentelemetry.io/otel/sdk/metric` now apply the periodic reader's timeout to the operation if the user provided context does not contain a deadline. (#4356, #4377) +- Upgrade all use of `go.opentelemetry.io/otel/semconv` to use `v1.21.0`. (#4408) +- Increase instrument name maximum length from 63 to 255 characters in `go.opentelemetry.io/otel/sdk/metric`. (#4434) +- Add `go.opentelemetry.op/otel/sdk/metric.WithProducer` as an `Option` for `"go.opentelemetry.io/otel/sdk/metric".NewManualReader` and `"go.opentelemetry.io/otel/sdk/metric".NewPeriodicReader`. (#4346) + +### Removed + +- Remove `Reader.RegisterProducer` in `go.opentelemetry.io/otel/metric`. + Use the added `WithProducer` option instead. (#4346) +- Remove `Reader.ForceFlush` in `go.opentelemetry.io/otel/metric`. + Notice that `PeriodicReader.ForceFlush` is still available. (#4375) + +### Fixed + +- Correctly format log messages from the `go.opentelemetry.io/otel/exporters/zipkin` exporter. (#4143) +- Log an error for calls to `NewView` in `go.opentelemetry.io/otel/sdk/metric` that have empty criteria. (#4307) +- Fix `"go.opentelemetry.io/otel/sdk/resource".WithHostID()` to not set an empty `host.id`. (#4317) +- Use the instrument identifying fields to cache aggregators and determine duplicate instrument registrations in `go.opentelemetry.io/otel/sdk/metric`. (#4337) +- Detect duplicate instruments for case-insensitive names in `go.opentelemetry.io/otel/sdk/metric`. (#4338) +- The `ManualReader` will not panic if `AggregationSelector` returns `nil` in `go.opentelemetry.io/otel/sdk/metric`. (#4350) +- If a `Reader`'s `AggregationSelector` returns `nil` or `DefaultAggregation` the pipeline will use the default aggregation. (#4350) +- Log a suggested view that fixes instrument conflicts in `go.opentelemetry.io/otel/sdk/metric`. (#4349) +- Fix possible panic, deadlock and race condition in batch span processor in `go.opentelemetry.io/otel/sdk/trace`. (#4353) +- Improve context cancellation handling in batch span processor's `ForceFlush` in `go.opentelemetry.io/otel/sdk/trace`. (#4369) +- Decouple `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` using gotmpl. (#4397, #3846) +- Decouple `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal` using gotmpl. (#4404, #3846) +- Decouple `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal` using gotmpl. (#4407, #3846) +- Decouple `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` using gotmpl. (#4400, #3846) +- Decouple `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal` from `go.opentelemetry.io/otel/exporters/otlp/internal` and `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` using gotmpl. (#4401, #3846) +- Do not block the metric SDK when OTLP metric exports are blocked in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#3925, #4395) +- Do not append `_total` if the counter already has that suffix for the Prometheus exproter in `go.opentelemetry.io/otel/exporter/prometheus`. (#4373) +- Fix resource detection data race in `go.opentelemetry.io/otel/sdk/resource`. (#4409) +- Use the first-seen instrument name during instrument name conflicts in `go.opentelemetry.io/otel/sdk/metric`. (#4428) + +### Deprecated + +- The `go.opentelemetry.io/otel/exporters/jaeger` package is deprecated. + OpenTelemetry dropped support for Jaeger exporter in July 2023. + Use `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` + or `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` instead. (#4423) +- The `go.opentelemetry.io/otel/example/jaeger` package is deprecated. (#4423) +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal` package is deprecated. (#4420) +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal/oconf` package is deprecated. (#4420) +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal/otest` package is deprecated. (#4420) +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/internal/transform` package is deprecated. (#4420) +- The `go.opentelemetry.io/otel/exporters/otlp/internal` package is deprecated. (#4421) +- The `go.opentelemetry.io/otel/exporters/otlp/internal/envconfig` package is deprecated. (#4421) +- The `go.opentelemetry.io/otel/exporters/otlp/internal/retry` package is deprecated. (#4421) +- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal` package is deprecated. (#4425) +- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/envconfig` package is deprecated. (#4425) +- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig` package is deprecated. (#4425) +- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlptracetest` package is deprecated. (#4425) +- The `go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/retry` package is deprecated. (#4425) +- The `go.opentelemetry.io/otel/sdk/metric/aggregation` package is deprecated. + Use the aggregation types added to `go.opentelemetry.io/otel/sdk/metric` instead. (#4435) + +## [1.16.0/0.39.0] 2023-05-18 + +This release contains the first stable release of the OpenTelemetry Go [metric API]. +Our project stability guarantees now apply to the `go.opentelemetry.io/otel/metric` package. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- The `go.opentelemetry.io/otel/semconv/v1.19.0` package. + The package contains semantic conventions from the `v1.19.0` version of the OpenTelemetry specification. (#3848) +- The `go.opentelemetry.io/otel/semconv/v1.20.0` package. + The package contains semantic conventions from the `v1.20.0` version of the OpenTelemetry specification. (#4078) +- The Exponential Histogram data types in `go.opentelemetry.io/otel/sdk/metric/metricdata`. (#4165) +- OTLP metrics exporter now supports the Exponential Histogram Data Type. (#4222) +- Fix serialization of `time.Time` zero values in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` packages. (#4271) + +### Changed + +- Use `strings.Cut()` instead of `string.SplitN()` for better readability and memory use. (#4049) +- `MeterProvider` returns noop meters once it has been shutdown. (#4154) + +### Removed + +- The deprecated `go.opentelemetry.io/otel/metric/instrument` package is removed. + Use `go.opentelemetry.io/otel/metric` instead. (#4055) + +### Fixed + +- Fix build for BSD based systems in `go.opentelemetry.io/otel/sdk/resource`. (#4077) + +## [1.16.0-rc.1/0.39.0-rc.1] 2023-05-03 + +This is a release candidate for the v1.16.0/v0.39.0 release. +That release is expected to include the `v1` release of the OpenTelemetry Go metric API and will provide stability guarantees of that API. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- Support global `MeterProvider` in `go.opentelemetry.io/otel`. (#4039) + - Use `Meter` for a `metric.Meter` from the global `metric.MeterProvider`. + - Use `GetMeterProivder` for a global `metric.MeterProvider`. + - Use `SetMeterProivder` to set the global `metric.MeterProvider`. + +### Changed + +- Move the `go.opentelemetry.io/otel/metric` module to the `stable-v1` module set. + This stages the metric API to be released as a stable module. (#4038) + +### Removed + +- The `go.opentelemetry.io/otel/metric/global` package is removed. + Use `go.opentelemetry.io/otel` instead. (#4039) + +## [1.15.1/0.38.1] 2023-05-02 + +### Fixed + +- Remove unused imports from `sdk/resource/host_id_bsd.go` which caused build failures. (#4040, #4041) + +## [1.15.0/0.38.0] 2023-04-27 + +### Added + +- The `go.opentelemetry.io/otel/metric/embedded` package. (#3916) +- The `Version` function to `go.opentelemetry.io/otel/sdk` to return the SDK version. (#3949) +- Add a `WithNamespace` option to `go.opentelemetry.io/otel/exporters/prometheus` to allow users to prefix metrics with a namespace. (#3970) +- The following configuration types were added to `go.opentelemetry.io/otel/metric/instrument` to be used in the configuration of measurement methods. (#3971) + - The `AddConfig` used to hold configuration for addition measurements + - `NewAddConfig` used to create a new `AddConfig` + - `AddOption` used to configure an `AddConfig` + - The `RecordConfig` used to hold configuration for recorded measurements + - `NewRecordConfig` used to create a new `RecordConfig` + - `RecordOption` used to configure a `RecordConfig` + - The `ObserveConfig` used to hold configuration for observed measurements + - `NewObserveConfig` used to create a new `ObserveConfig` + - `ObserveOption` used to configure an `ObserveConfig` +- `WithAttributeSet` and `WithAttributes` are added to `go.opentelemetry.io/otel/metric/instrument`. + They return an option used during a measurement that defines the attribute Set associated with the measurement. (#3971) +- The `Version` function to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` to return the OTLP metrics client version. (#3956) +- The `Version` function to `go.opentelemetry.io/otel/exporters/otlp/otlptrace` to return the OTLP trace client version. (#3956) + +### Changed + +- The `Extrema` in `go.opentelemetry.io/otel/sdk/metric/metricdata` is redefined with a generic argument of `[N int64 | float64]`. (#3870) +- Update all exported interfaces from `go.opentelemetry.io/otel/metric` to embed their corresponding interface from `go.opentelemetry.io/otel/metric/embedded`. + This adds an implementation requirement to set the interface default behavior for unimplemented methods. (#3916) +- Move No-Op implementation from `go.opentelemetry.io/otel/metric` into its own package `go.opentelemetry.io/otel/metric/noop`. (#3941) + - `metric.NewNoopMeterProvider` is replaced with `noop.NewMeterProvider` +- Add all the methods from `"go.opentelemetry.io/otel/trace".SpanContext` to `bridgeSpanContext` by embedding `otel.SpanContext` in `bridgeSpanContext`. (#3966) +- Wrap `UploadMetrics` error in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/` to improve error message when encountering generic grpc errors. (#3974) +- The measurement methods for all instruments in `go.opentelemetry.io/otel/metric/instrument` accept an option instead of the variadic `"go.opentelemetry.io/otel/attribute".KeyValue`. (#3971) + - The `Int64Counter.Add` method now accepts `...AddOption` + - The `Float64Counter.Add` method now accepts `...AddOption` + - The `Int64UpDownCounter.Add` method now accepts `...AddOption` + - The `Float64UpDownCounter.Add` method now accepts `...AddOption` + - The `Int64Histogram.Record` method now accepts `...RecordOption` + - The `Float64Histogram.Record` method now accepts `...RecordOption` + - The `Int64Observer.Observe` method now accepts `...ObserveOption` + - The `Float64Observer.Observe` method now accepts `...ObserveOption` +- The `Observer` methods in `go.opentelemetry.io/otel/metric` accept an option instead of the variadic `"go.opentelemetry.io/otel/attribute".KeyValue`. (#3971) + - The `Observer.ObserveInt64` method now accepts `...ObserveOption` + - The `Observer.ObserveFloat64` method now accepts `...ObserveOption` +- Move global metric back to `go.opentelemetry.io/otel/metric/global` from `go.opentelemetry.io/otel`. (#3986) + +### Fixed + +- `TracerProvider` allows calling `Tracer()` while it's shutting down. + It used to deadlock. (#3924) +- Use the SDK version for the Telemetry SDK resource detector in `go.opentelemetry.io/otel/sdk/resource`. (#3949) +- Fix a data race in `SpanProcessor` returned by `NewSimpleSpanProcessor` in `go.opentelemetry.io/otel/sdk/trace`. (#3951) +- Automatically figure out the default aggregation with `aggregation.Default`. (#3967) + +### Deprecated + +- The `go.opentelemetry.io/otel/metric/instrument` package is deprecated. + Use the equivalent types added to `go.opentelemetry.io/otel/metric` instead. (#4018) + +## [1.15.0-rc.2/0.38.0-rc.2] 2023-03-23 + +This is a release candidate for the v1.15.0/v0.38.0 release. +That release will include the `v1` release of the OpenTelemetry Go metric API and will provide stability guarantees of that API. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +### Added + +- The `WithHostID` option to `go.opentelemetry.io/otel/sdk/resource`. (#3812) +- The `WithoutTimestamps` option to `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` to sets all timestamps to zero. (#3828) +- The new `Exemplar` type is added to `go.opentelemetry.io/otel/sdk/metric/metricdata`. + Both the `DataPoint` and `HistogramDataPoint` types from that package have a new field of `Exemplars` containing the sampled exemplars for their timeseries. (#3849) +- Configuration for each metric instrument in `go.opentelemetry.io/otel/sdk/metric/instrument`. (#3895) +- The internal logging introduces a warning level verbosity equal to `V(1)`. (#3900) +- Added a log message warning about usage of `SimpleSpanProcessor` in production environments. (#3854) + +### Changed + +- Optimize memory allocation when creation a new `Set` using `NewSet` or `NewSetWithFiltered` in `go.opentelemetry.io/otel/attribute`. (#3832) +- Optimize memory allocation when creation new metric instruments in `go.opentelemetry.io/otel/sdk/metric`. (#3832) +- Avoid creating new objects on all calls to `WithDeferredSetup` and `SkipContextSetup` in OpenTracing bridge. (#3833) +- The `New` and `Detect` functions from `go.opentelemetry.io/otel/sdk/resource` return errors that wrap underlying errors instead of just containing the underlying error strings. (#3844) +- Both the `Histogram` and `HistogramDataPoint` are redefined with a generic argument of `[N int64 | float64]` in `go.opentelemetry.io/otel/sdk/metric/metricdata`. (#3849) +- The metric `Export` interface from `go.opentelemetry.io/otel/sdk/metric` accepts a `*ResourceMetrics` instead of `ResourceMetrics`. (#3853) +- Rename `Asynchronous` to `Observable` in `go.opentelemetry.io/otel/metric/instrument`. (#3892) +- Rename `Int64ObserverOption` to `Int64ObservableOption` in `go.opentelemetry.io/otel/metric/instrument`. (#3895) +- Rename `Float64ObserverOption` to `Float64ObservableOption` in `go.opentelemetry.io/otel/metric/instrument`. (#3895) +- The internal logging changes the verbosity level of info to `V(4)`, the verbosity level of debug to `V(8)`. (#3900) + +### Fixed + +- `TracerProvider` consistently doesn't allow to register a `SpanProcessor` after shutdown. (#3845) + +### Removed + +- The deprecated `go.opentelemetry.io/otel/metric/global` package is removed. (#3829) +- The unneeded `Synchronous` interface in `go.opentelemetry.io/otel/metric/instrument` was removed. (#3892) +- The `Float64ObserverConfig` and `NewFloat64ObserverConfig` in `go.opentelemetry.io/otel/sdk/metric/instrument`. + Use the added `float64` instrument configuration instead. (#3895) +- The `Int64ObserverConfig` and `NewInt64ObserverConfig` in `go.opentelemetry.io/otel/sdk/metric/instrument`. + Use the added `int64` instrument configuration instead. (#3895) +- The `NewNoopMeter` function in `go.opentelemetry.io/otel/metric`, use `NewMeterProvider().Meter("")` instead. (#3893) + +## [1.15.0-rc.1/0.38.0-rc.1] 2023-03-01 + +This is a release candidate for the v1.15.0/v0.38.0 release. +That release will include the `v1` release of the OpenTelemetry Go metric API and will provide stability guarantees of that API. +See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. + +This release drops the compatibility guarantee of [Go 1.18]. + +### Added + +- Support global `MeterProvider` in `go.opentelemetry.io/otel`. (#3818) + - Use `Meter` for a `metric.Meter` from the global `metric.MeterProvider`. + - Use `GetMeterProivder` for a global `metric.MeterProvider`. + - Use `SetMeterProivder` to set the global `metric.MeterProvider`. + +### Changed + +- Dropped compatibility testing for [Go 1.18]. + The project no longer guarantees support for this version of Go. (#3813) + +### Fixed + +- Handle empty environment variable as it they were not set. (#3764) +- Clarify the `httpconv` and `netconv` packages in `go.opentelemetry.io/otel/semconv/*` provide tracing semantic conventions. (#3823) +- Fix race conditions in `go.opentelemetry.io/otel/exporters/metric/prometheus` that could cause a panic. (#3899) +- Fix sending nil `scopeInfo` to metrics channel in `go.opentelemetry.io/otel/exporters/metric/prometheus` that could cause a panic in `github.com/prometheus/client_golang/prometheus`. (#3899) + +### Deprecated + +- The `go.opentelemetry.io/otel/metric/global` package is deprecated. + Use `go.opentelemetry.io/otel` instead. (#3818) + +### Removed + +- The deprecated `go.opentelemetry.io/otel/metric/unit` package is removed. (#3814) + +## [1.14.0/0.37.0/0.0.4] 2023-02-27 + +This release is the last to support [Go 1.18]. +The next release will require at least [Go 1.19]. + +### Added + +- The `event` type semantic conventions are added to `go.opentelemetry.io/otel/semconv/v1.17.0`. (#3697) +- Support [Go 1.20]. (#3693) +- The `go.opentelemetry.io/otel/semconv/v1.18.0` package. + The package contains semantic conventions from the `v1.18.0` version of the OpenTelemetry specification. (#3719) + - The following `const` renames from `go.opentelemetry.io/otel/semconv/v1.17.0` are included: + - `OtelScopeNameKey` -> `OTelScopeNameKey` + - `OtelScopeVersionKey` -> `OTelScopeVersionKey` + - `OtelLibraryNameKey` -> `OTelLibraryNameKey` + - `OtelLibraryVersionKey` -> `OTelLibraryVersionKey` + - `OtelStatusCodeKey` -> `OTelStatusCodeKey` + - `OtelStatusDescriptionKey` -> `OTelStatusDescriptionKey` + - `OtelStatusCodeOk` -> `OTelStatusCodeOk` + - `OtelStatusCodeError` -> `OTelStatusCodeError` + - The following `func` renames from `go.opentelemetry.io/otel/semconv/v1.17.0` are included: + - `OtelScopeName` -> `OTelScopeName` + - `OtelScopeVersion` -> `OTelScopeVersion` + - `OtelLibraryName` -> `OTelLibraryName` + - `OtelLibraryVersion` -> `OTelLibraryVersion` + - `OtelStatusDescription` -> `OTelStatusDescription` +- A `IsSampled` method is added to the `SpanContext` implementation in `go.opentelemetry.io/otel/bridge/opentracing` to expose the span sampled state. + See the [README](./bridge/opentracing/README.md) for more information. (#3570) +- The `WithInstrumentationAttributes` option to `go.opentelemetry.io/otel/metric`. (#3738) +- The `WithInstrumentationAttributes` option to `go.opentelemetry.io/otel/trace`. (#3739) +- The following environment variables are supported by the periodic `Reader` in `go.opentelemetry.io/otel/sdk/metric`. (#3763) + - `OTEL_METRIC_EXPORT_INTERVAL` sets the time between collections and exports. + - `OTEL_METRIC_EXPORT_TIMEOUT` sets the timeout an export is attempted. + +### Changed + +- Fall-back to `TextMapCarrier` when it's not `HttpHeader`s in `go.opentelemetry.io/otel/bridge/opentracing`. (#3679) +- The `Collect` method of the `"go.opentelemetry.io/otel/sdk/metric".Reader` interface is updated to accept the `metricdata.ResourceMetrics` value the collection will be made into. + This change is made to enable memory reuse by SDK users. (#3732) +- The `WithUnit` option in `go.opentelemetry.io/otel/sdk/metric/instrument` is updated to accept a `string` for the unit value. (#3776) + +### Fixed + +- Ensure `go.opentelemetry.io/otel` does not use generics. (#3723, #3725) +- Multi-reader `MeterProvider`s now export metrics for all readers, instead of just the first reader. (#3720, #3724) +- Remove use of deprecated `"math/rand".Seed` in `go.opentelemetry.io/otel/example/prometheus`. (#3733) +- Do not silently drop unknown schema data with `Parse` in `go.opentelemetry.io/otel/schema/v1.1`. (#3743) +- Data race issue in OTLP exporter retry mechanism. (#3755, #3756) +- Wrapping empty errors when exporting in `go.opentelemetry.io/otel/sdk/metric`. (#3698, #3772) +- Incorrect "all" and "resource" definition for schema files in `go.opentelemetry.io/otel/schema/v1.1`. (#3777) + +### Deprecated + +- The `go.opentelemetry.io/otel/metric/unit` package is deprecated. + Use the equivalent unit string instead. (#3776) + - Use `"1"` instead of `unit.Dimensionless` + - Use `"By"` instead of `unit.Bytes` + - Use `"ms"` instead of `unit.Milliseconds` + +## [1.13.0/0.36.0] 2023-02-07 + +### Added + +- Attribute `KeyValue` creations functions to `go.opentelemetry.io/otel/semconv/v1.17.0` for all non-enum semantic conventions. + These functions ensure semantic convention type correctness. (#3675) + +### Fixed + +- Removed the `http.target` attribute from being added by `ServerRequest` in the following packages. (#3687) + - `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv` + - `go.opentelemetry.io/otel/semconv/v1.14.0/httpconv` + - `go.opentelemetry.io/otel/semconv/v1.15.0/httpconv` + - `go.opentelemetry.io/otel/semconv/v1.16.0/httpconv` + - `go.opentelemetry.io/otel/semconv/v1.17.0/httpconv` + +### Removed + +- The deprecated `go.opentelemetry.io/otel/metric/instrument/asyncfloat64` package is removed. (#3631) +- The deprecated `go.opentelemetry.io/otel/metric/instrument/asyncint64` package is removed. (#3631) +- The deprecated `go.opentelemetry.io/otel/metric/instrument/syncfloat64` package is removed. (#3631) +- The deprecated `go.opentelemetry.io/otel/metric/instrument/syncint64` package is removed. (#3631) + +## [1.12.0/0.35.0] 2023-01-28 + +### Added + +- The `WithInt64Callback` option to `go.opentelemetry.io/otel/metric/instrument`. + This options is used to configure `int64` Observer callbacks during their creation. (#3507) +- The `WithFloat64Callback` option to `go.opentelemetry.io/otel/metric/instrument`. + This options is used to configure `float64` Observer callbacks during their creation. (#3507) +- The `Producer` interface and `Reader.RegisterProducer(Producer)` to `go.opentelemetry.io/otel/sdk/metric`. + These additions are used to enable external metric Producers. (#3524) +- The `Callback` function type to `go.opentelemetry.io/otel/metric`. + This new named function type is registered with a `Meter`. (#3564) +- The `go.opentelemetry.io/otel/semconv/v1.13.0` package. + The package contains semantic conventions from the `v1.13.0` version of the OpenTelemetry specification. (#3499) + - The `EndUserAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is merged into `ClientRequest` and `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `HTTPAttributesFromHTTPStatusCode` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is merged into `ClientResponse` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `HTTPClientAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ClientRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `HTTPServerAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `HTTPServerMetricAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `NetAttributesFromHTTPRequest` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is split into `Transport` in `go.opentelemetry.io/otel/semconv/v1.13.0/netconv` and `ClientRequest` or `ServerRequest` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `SpanStatusFromHTTPStatusCode` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is replaced by `ClientStatus` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `SpanStatusFromHTTPStatusCodeAndSpanKind` function in `go.opentelemetry.io/otel/semconv/v1.12.0` is split into `ClientStatus` and `ServerStatus` in `go.opentelemetry.io/otel/semconv/v1.13.0/httpconv`. + - The `Client` function is included in `go.opentelemetry.io/otel/semconv/v1.13.0/netconv` to generate attributes for a `net.Conn`. + - The `Server` function is included in `go.opentelemetry.io/otel/semconv/v1.13.0/netconv` to generate attributes for a `net.Listener`. +- The `go.opentelemetry.io/otel/semconv/v1.14.0` package. + The package contains semantic conventions from the `v1.14.0` version of the OpenTelemetry specification. (#3566) +- The `go.opentelemetry.io/otel/semconv/v1.15.0` package. + The package contains semantic conventions from the `v1.15.0` version of the OpenTelemetry specification. (#3578) +- The `go.opentelemetry.io/otel/semconv/v1.16.0` package. + The package contains semantic conventions from the `v1.16.0` version of the OpenTelemetry specification. (#3579) +- Metric instruments to `go.opentelemetry.io/otel/metric/instrument`. + These instruments are use as replacements of the deprecated `go.opentelemetry.io/otel/metric/instrument/{asyncfloat64,asyncint64,syncfloat64,syncint64}` packages.(#3575, #3586) + - `Float64ObservableCounter` replaces the `asyncfloat64.Counter` + - `Float64ObservableUpDownCounter` replaces the `asyncfloat64.UpDownCounter` + - `Float64ObservableGauge` replaces the `asyncfloat64.Gauge` + - `Int64ObservableCounter` replaces the `asyncint64.Counter` + - `Int64ObservableUpDownCounter` replaces the `asyncint64.UpDownCounter` + - `Int64ObservableGauge` replaces the `asyncint64.Gauge` + - `Float64Counter` replaces the `syncfloat64.Counter` + - `Float64UpDownCounter` replaces the `syncfloat64.UpDownCounter` + - `Float64Histogram` replaces the `syncfloat64.Histogram` + - `Int64Counter` replaces the `syncint64.Counter` + - `Int64UpDownCounter` replaces the `syncint64.UpDownCounter` + - `Int64Histogram` replaces the `syncint64.Histogram` +- `NewTracerProvider` to `go.opentelemetry.io/otel/bridge/opentracing`. + This is used to create `WrapperTracer` instances from a `TracerProvider`. (#3116) +- The `Extrema` type to `go.opentelemetry.io/otel/sdk/metric/metricdata`. + This type is used to represent min/max values and still be able to distinguish unset and zero values. (#3487) +- The `go.opentelemetry.io/otel/semconv/v1.17.0` package. + The package contains semantic conventions from the `v1.17.0` version of the OpenTelemetry specification. (#3599) + +### Changed + +- Jaeger and Zipkin exporter use `github.com/go-logr/logr` as the logging interface, and add the `WithLogr` option. (#3497, #3500) +- Instrument configuration in `go.opentelemetry.io/otel/metric/instrument` is split into specific options and configuration based on the instrument type. (#3507) + - Use the added `Int64Option` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/syncint64`. + - Use the added `Float64Option` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/syncfloat64`. + - Use the added `Int64ObserverOption` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/asyncint64`. + - Use the added `Float64ObserverOption` type to configure instruments from `go.opentelemetry.io/otel/metric/instrument/asyncfloat64`. +- Return a `Registration` from the `RegisterCallback` method of a `Meter` in the `go.opentelemetry.io/otel/metric` package. + This `Registration` can be used to unregister callbacks. (#3522) +- Global error handler uses an atomic value instead of a mutex. (#3543) +- Add `NewMetricProducer` to `go.opentelemetry.io/otel/bridge/opencensus`, which can be used to pass OpenCensus metrics to an OpenTelemetry Reader. (#3541) +- Global logger uses an atomic value instead of a mutex. (#3545) +- The `Shutdown` method of the `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` releases all computational resources when called the first time. (#3551) +- The `Sampler` returned from `TraceIDRatioBased` `go.opentelemetry.io/otel/sdk/trace` now uses the rightmost bits for sampling decisions. + This fixes random sampling when using ID generators like `xray.IDGenerator` and increasing parity with other language implementations. (#3557) +- Errors from `go.opentelemetry.io/otel/exporters/otlp/otlptrace` exporters are wrapped in errors identifying their signal name. + Existing users of the exporters attempting to identify specific errors will need to use `errors.Unwrap()` to get the underlying error. (#3516) +- Exporters from `go.opentelemetry.io/otel/exporters/otlp` will print the final retryable error message when attempts to retry time out. (#3514) +- The instrument kind names in `go.opentelemetry.io/otel/sdk/metric` are updated to match the API. (#3562) + - `InstrumentKindSyncCounter` is renamed to `InstrumentKindCounter` + - `InstrumentKindSyncUpDownCounter` is renamed to `InstrumentKindUpDownCounter` + - `InstrumentKindSyncHistogram` is renamed to `InstrumentKindHistogram` + - `InstrumentKindAsyncCounter` is renamed to `InstrumentKindObservableCounter` + - `InstrumentKindAsyncUpDownCounter` is renamed to `InstrumentKindObservableUpDownCounter` + - `InstrumentKindAsyncGauge` is renamed to `InstrumentKindObservableGauge` +- The `RegisterCallback` method of the `Meter` in `go.opentelemetry.io/otel/metric` changed. + - The named `Callback` replaces the inline function parameter. (#3564) + - `Callback` is required to return an error. (#3576) + - `Callback` accepts the added `Observer` parameter added. + This new parameter is used by `Callback` implementations to observe values for asynchronous instruments instead of calling the `Observe` method of the instrument directly. (#3584) + - The slice of `instrument.Asynchronous` is now passed as a variadic argument. (#3587) +- The exporter from `go.opentelemetry.io/otel/exporters/zipkin` is updated to use the `v1.16.0` version of semantic conventions. + This means it no longer uses the removed `net.peer.ip` or `http.host` attributes to determine the remote endpoint. + Instead it uses the `net.sock.peer` attributes. (#3581) +- The `Min` and `Max` fields of the `HistogramDataPoint` in `go.opentelemetry.io/otel/sdk/metric/metricdata` are now defined with the added `Extrema` type instead of a `*float64`. (#3487) + +### Fixed + +- Asynchronous instruments that use sum aggregators and attribute filters correctly add values from equivalent attribute sets that have been filtered. (#3439, #3549) +- The `RegisterCallback` method of the `Meter` from `go.opentelemetry.io/otel/sdk/metric` only registers a callback for instruments created by that meter. + Trying to register a callback with instruments from a different meter will result in an error being returned. (#3584) + +### Deprecated + +- The `NewMetricExporter` in `go.opentelemetry.io/otel/bridge/opencensus` is deprecated. + Use `NewMetricProducer` instead. (#3541) +- The `go.opentelemetry.io/otel/metric/instrument/asyncfloat64` package is deprecated. + Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) +- The `go.opentelemetry.io/otel/metric/instrument/asyncint64` package is deprecated. + Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) +- The `go.opentelemetry.io/otel/metric/instrument/syncfloat64` package is deprecated. + Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) +- The `go.opentelemetry.io/otel/metric/instrument/syncint64` package is deprecated. + Use the instruments from `go.opentelemetry.io/otel/metric/instrument` instead. (#3575) +- The `NewWrappedTracerProvider` in `go.opentelemetry.io/otel/bridge/opentracing` is now deprecated. + Use `NewTracerProvider` instead. (#3116) + +### Removed + +- The deprecated `go.opentelemetry.io/otel/sdk/metric/view` package is removed. (#3520) +- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/asyncint64` is removed. + Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) + - The `Counter` method is replaced by `Meter.Int64ObservableCounter` + - The `UpDownCounter` method is replaced by `Meter.Int64ObservableUpDownCounter` + - The `Gauge` method is replaced by `Meter.Int64ObservableGauge` +- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/asyncfloat64` is removed. + Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) + - The `Counter` method is replaced by `Meter.Float64ObservableCounter` + - The `UpDownCounter` method is replaced by `Meter.Float64ObservableUpDownCounter` + - The `Gauge` method is replaced by `Meter.Float64ObservableGauge` +- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/syncint64` is removed. + Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) + - The `Counter` method is replaced by `Meter.Int64Counter` + - The `UpDownCounter` method is replaced by `Meter.Int64UpDownCounter` + - The `Histogram` method is replaced by `Meter.Int64Histogram` +- The `InstrumentProvider` from `go.opentelemetry.io/otel/sdk/metric/syncfloat64` is removed. + Use the new creation methods of the `Meter` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3530) + - The `Counter` method is replaced by `Meter.Float64Counter` + - The `UpDownCounter` method is replaced by `Meter.Float64UpDownCounter` + - The `Histogram` method is replaced by `Meter.Float64Histogram` + +## [1.11.2/0.34.0] 2022-12-05 + +### Added + +- The `WithView` `Option` is added to the `go.opentelemetry.io/otel/sdk/metric` package. + This option is used to configure the view(s) a `MeterProvider` will use for all `Reader`s that are registered with it. (#3387) +- Add Instrumentation Scope and Version as info metric and label in Prometheus exporter. + This can be disabled using the `WithoutScopeInfo()` option added to that package.(#3273, #3357) +- OTLP exporters now recognize: (#3363) + - `OTEL_EXPORTER_OTLP_INSECURE` + - `OTEL_EXPORTER_OTLP_TRACES_INSECURE` + - `OTEL_EXPORTER_OTLP_METRICS_INSECURE` + - `OTEL_EXPORTER_OTLP_CLIENT_KEY` + - `OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY` + - `OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY` + - `OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE` + - `OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE` + - `OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE` +- The `View` type and related `NewView` function to create a view according to the OpenTelemetry specification are added to `go.opentelemetry.io/otel/sdk/metric`. + These additions are replacements for the `View` type and `New` function from `go.opentelemetry.io/otel/sdk/metric/view`. (#3459) +- The `Instrument` and `InstrumentKind` type are added to `go.opentelemetry.io/otel/sdk/metric`. + These additions are replacements for the `Instrument` and `InstrumentKind` types from `go.opentelemetry.io/otel/sdk/metric/view`. (#3459) +- The `Stream` type is added to `go.opentelemetry.io/otel/sdk/metric` to define a metric data stream a view will produce. (#3459) +- The `AssertHasAttributes` allows instrument authors to test that datapoints returned have appropriate attributes. (#3487) + +### Changed + +- The `"go.opentelemetry.io/otel/sdk/metric".WithReader` option no longer accepts views to associate with the `Reader`. + Instead, views are now registered directly with the `MeterProvider` via the new `WithView` option. + The views registered with the `MeterProvider` apply to all `Reader`s. (#3387) +- The `Temporality(view.InstrumentKind) metricdata.Temporality` and `Aggregation(view.InstrumentKind) aggregation.Aggregation` methods are added to the `"go.opentelemetry.io/otel/sdk/metric".Exporter` interface. (#3260) +- The `Temporality(view.InstrumentKind) metricdata.Temporality` and `Aggregation(view.InstrumentKind) aggregation.Aggregation` methods are added to the `"go.opentelemetry.io/otel/exporters/otlp/otlpmetric".Client` interface. (#3260) +- The `WithTemporalitySelector` and `WithAggregationSelector` `ReaderOption`s have been changed to `ManualReaderOption`s in the `go.opentelemetry.io/otel/sdk/metric` package. (#3260) +- The periodic reader in the `go.opentelemetry.io/otel/sdk/metric` package now uses the temporality and aggregation selectors from its configured exporter instead of accepting them as options. (#3260) + +### Fixed + +- The `go.opentelemetry.io/otel/exporters/prometheus` exporter fixes duplicated `_total` suffixes. (#3369) +- Remove comparable requirement for `Reader`s. (#3387) +- Cumulative metrics from the OpenCensus bridge (`go.opentelemetry.io/otel/bridge/opencensus`) are defined as monotonic sums, instead of non-monotonic. (#3389) +- Asynchronous counters (`Counter` and `UpDownCounter`) from the metric SDK now produce delta sums when configured with delta temporality. (#3398) +- Exported `Status` codes in the `go.opentelemetry.io/otel/exporters/zipkin` exporter are now exported as all upper case values. (#3340) +- `Aggregation`s from `go.opentelemetry.io/otel/sdk/metric` with no data are not exported. (#3394, #3436) +- Re-enabled Attribute Filters in the Metric SDK. (#3396) +- Asynchronous callbacks are only called if they are registered with at least one instrument that does not use drop aggragation. (#3408) +- Do not report empty partial-success responses in the `go.opentelemetry.io/otel/exporters/otlp` exporters. (#3438, #3432) +- Handle partial success responses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` exporters. (#3162, #3440) +- Prevent duplicate Prometheus description, unit, and type. (#3469) +- Prevents panic when using incorrect `attribute.Value.As[Type]Slice()`. (#3489) + +### Removed + +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric.Client` interface is removed. (#3486) +- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric.New` function is removed. Use the `otlpmetric[http|grpc].New` directly. (#3486) + +### Deprecated + +- The `go.opentelemetry.io/otel/sdk/metric/view` package is deprecated. + Use `Instrument`, `InstrumentKind`, `View`, and `NewView` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3476) + +## [1.11.1/0.33.0] 2022-10-19 + +### Added + +- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` registers with a Prometheus registerer on creation. + By default, it will register with the default Prometheus registerer. + A non-default registerer can be used by passing the `WithRegisterer` option. (#3239) +- Added the `WithAggregationSelector` option to the `go.opentelemetry.io/otel/exporters/prometheus` package to change the default `AggregationSelector` used. (#3341) +- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` converts the `Resource` associated with metric exports into a `target_info` metric. (#3285) + +### Changed + +- The `"go.opentelemetry.io/otel/exporters/prometheus".New` function is updated to return an error. + It will return an error if the exporter fails to register with Prometheus. (#3239) + +### Fixed + +- The URL-encoded values from the `OTEL_RESOURCE_ATTRIBUTES` environment variable are decoded. (#2963) +- The `baggage.NewMember` function decodes the `value` parameter instead of directly using it. + This fixes the implementation to be compliant with the W3C specification. (#3226) +- Slice attributes of the `attribute` package are now comparable based on their value, not instance. (#3108 #3252) +- The `Shutdown` and `ForceFlush` methods of the `"go.opentelemetry.io/otel/sdk/trace".TraceProvider` no longer return an error when no processor is registered. (#3268) +- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` cumulatively sums histogram buckets. (#3281) +- The sum of each histogram data point is now uniquely exported by the `go.opentelemetry.io/otel/exporters/otlpmetric` exporters. (#3284, #3293) +- Recorded values for asynchronous counters (`Counter` and `UpDownCounter`) are interpreted as exact, not incremental, sum values by the metric SDK. (#3350, #3278) +- `UpDownCounters` are now correctly output as Prometheus gauges in the `go.opentelemetry.io/otel/exporters/prometheus` exporter. (#3358) +- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` no longer describes the metrics it will send to Prometheus on startup. + Instead the exporter is defined as an "unchecked" collector for Prometheus. + This fixes the `reader is not registered` warning currently emitted on startup. (#3291 #3342) +- The `go.opentelemetry.io/otel/exporters/prometheus` exporter now correctly adds `_total` suffixes to counter metrics. (#3360) +- The `go.opentelemetry.io/otel/exporters/prometheus` exporter now adds a unit suffix to metric names. + This can be disabled using the `WithoutUnits()` option added to that package. (#3352) + +## [1.11.0/0.32.3] 2022-10-12 + +### Added + +- Add default User-Agent header to OTLP exporter requests (`go.opentelemetry.io/otel/exporters/otlptrace/otlptracegrpc` and `go.opentelemetry.io/otel/exporters/otlptrace/otlptracehttp`). (#3261) + +### Changed + +- `span.SetStatus` has been updated such that calls that lower the status are now no-ops. (#3214) +- Upgrade `golang.org/x/sys/unix` from `v0.0.0-20210423185535-09eb48e85fd7` to `v0.0.0-20220919091848-fb04ddd9f9c8`. + This addresses [GO-2022-0493](https://pkg.go.dev/vuln/GO-2022-0493). (#3235) + +## [0.32.2] Metric SDK (Alpha) - 2022-10-11 + +### Added + +- Added an example of using metric views to customize instruments. (#3177) +- Add default User-Agent header to OTLP exporter requests (`go.opentelemetry.io/otel/exporters/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlpmetric/otlpmetrichttp`). (#3261) + +### Changed + +- Flush pending measurements with the `PeriodicReader` in the `go.opentelemetry.io/otel/sdk/metric` when `ForceFlush` or `Shutdown` are called. (#3220) +- Update histogram default bounds to match the requirements of the latest specification. (#3222) +- Encode the HTTP status code in the OpenTracing bridge (`go.opentelemetry.io/otel/bridge/opentracing`) as an integer. (#3265) + +### Fixed + +- Use default view if instrument does not match any registered view of a reader. (#3224, #3237) +- Return the same instrument every time a user makes the exact same instrument creation call. (#3229, #3251) +- Return the existing instrument when a view transforms a creation call to match an existing instrument. (#3240, #3251) +- Log a warning when a conflicting instrument (e.g. description, unit, data-type) is created instead of returning an error. (#3251) +- The OpenCensus bridge no longer sends empty batches of metrics. (#3263) + +## [0.32.1] Metric SDK (Alpha) - 2022-09-22 + +### Changed + +- The Prometheus exporter sanitizes OpenTelemetry instrument names when exporting. + Invalid characters are replaced with `_`. (#3212) + +### Added + +- The metric portion of the OpenCensus bridge (`go.opentelemetry.io/otel/bridge/opencensus`) has been reintroduced. (#3192) +- The OpenCensus bridge example (`go.opentelemetry.io/otel/example/opencensus`) has been reintroduced. (#3206) + +### Fixed + +- Updated go.mods to point to valid versions of the sdk. (#3216) +- Set the `MeterProvider` resource on all exported metric data. (#3218) + +## [0.32.0] Revised Metric SDK (Alpha) - 2022-09-18 + +### Changed + +- The metric SDK in `go.opentelemetry.io/otel/sdk/metric` is completely refactored to comply with the OpenTelemetry specification. + Please see the package documentation for how the new SDK is initialized and configured. (#3175) +- Update the minimum supported go version to go1.18. Removes support for go1.17 (#3179) + +### Removed + +- The metric portion of the OpenCensus bridge (`go.opentelemetry.io/otel/bridge/opencensus`) has been removed. + A new bridge compliant with the revised metric SDK will be added back in a future release. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/aggregator/histogram` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/aggregator/sum` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/aggregator` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/controller/basic` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/controller/controllertest` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/controller/time` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/export/aggregation` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/export` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/metrictest` package is removed. + A replacement package that supports the new metric SDK will be added back in a future release. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/number` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/processor/basic` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/processor/processortest` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/processor/reducer` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/registry` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/sdkapi` package is removed, see the new metric SDK. (#3175) +- The `go.opentelemetry.io/otel/sdk/metric/selector/simple` package is removed, see the new metric SDK. (#3175) +- The `"go.opentelemetry.io/otel/sdk/metric".ErrUninitializedInstrument` variable was removed. (#3175) +- The `"go.opentelemetry.io/otel/sdk/metric".ErrBadInstrument` variable was removed. (#3175) +- The `"go.opentelemetry.io/otel/sdk/metric".Accumulator` type was removed, see the `MeterProvider`in the new metric SDK. (#3175) +- The `"go.opentelemetry.io/otel/sdk/metric".NewAccumulator` function was removed, see `NewMeterProvider`in the new metric SDK. (#3175) +- The deprecated `"go.opentelemetry.io/otel/sdk/metric".AtomicFieldOffsets` function was removed. (#3175) + +## [1.10.0] - 2022-09-09 + +### Added + +- Support Go 1.19. (#3077) + Include compatibility testing and document support. (#3077) +- Support the OTLP ExportTracePartialSuccess response; these are passed to the registered error handler. (#3106) +- Upgrade go.opentelemetry.io/proto/otlp from v0.18.0 to v0.19.0 (#3107) + +### Changed + +- Fix misidentification of OpenTelemetry `SpanKind` in OpenTracing bridge (`go.opentelemetry.io/otel/bridge/opentracing`). (#3096) +- Attempting to start a span with a nil `context` will no longer cause a panic. (#3110) +- All exporters will be shutdown even if one reports an error (#3091) +- Ensure valid UTF-8 when truncating over-length attribute values. (#3156) + +## [1.9.0/0.0.3] - 2022-08-01 + +### Added + +- Add support for Schema Files format 1.1.x (metric "split" transform) with the new `go.opentelemetry.io/otel/schema/v1.1` package. (#2999) +- Add the `go.opentelemetry.io/otel/semconv/v1.11.0` package. + The package contains semantic conventions from the `v1.11.0` version of the OpenTelemetry specification. (#3009) +- Add the `go.opentelemetry.io/otel/semconv/v1.12.0` package. + The package contains semantic conventions from the `v1.12.0` version of the OpenTelemetry specification. (#3010) +- Add the `http.method` attribute to HTTP server metric from all `go.opentelemetry.io/otel/semconv/*` packages. (#3018) + +### Fixed + +- Invalid warning for context setup being deferred in `go.opentelemetry.io/otel/bridge/opentracing` package. (#3029) + +## [1.8.0/0.31.0] - 2022-07-08 + +### Added + +- Add support for `opentracing.TextMap` format in the `Inject` and `Extract` methods +of the `"go.opentelemetry.io/otel/bridge/opentracing".BridgeTracer` type. (#2911) + +### Changed + +- The `crosslink` make target has been updated to use the `go.opentelemetry.io/build-tools/crosslink` package. (#2886) +- In the `go.opentelemetry.io/otel/sdk/instrumentation` package rename `Library` to `Scope` and alias `Library` as `Scope` (#2976) +- Move metric no-op implementation form `nonrecording` to `metric` package. (#2866) + +### Removed + +- Support for go1.16. Support is now only for go1.17 and go1.18 (#2917) + +### Deprecated + +- The `Library` struct in the `go.opentelemetry.io/otel/sdk/instrumentation` package is deprecated. + Use the equivalent `Scope` struct instead. (#2977) +- The `ReadOnlySpan.InstrumentationLibrary` method from the `go.opentelemetry.io/otel/sdk/trace` package is deprecated. + Use the equivalent `ReadOnlySpan.InstrumentationScope` method instead. (#2977) + +## [1.7.0/0.30.0] - 2022-04-28 + +### Added + +- Add the `go.opentelemetry.io/otel/semconv/v1.8.0` package. + The package contains semantic conventions from the `v1.8.0` version of the OpenTelemetry specification. (#2763) +- Add the `go.opentelemetry.io/otel/semconv/v1.9.0` package. + The package contains semantic conventions from the `v1.9.0` version of the OpenTelemetry specification. (#2792) +- Add the `go.opentelemetry.io/otel/semconv/v1.10.0` package. + The package contains semantic conventions from the `v1.10.0` version of the OpenTelemetry specification. (#2842) +- Added an in-memory exporter to metrictest to aid testing with a full SDK. (#2776) + +### Fixed + +- Globally delegated instruments are unwrapped before delegating asynchronous callbacks. (#2784) +- Remove import of `testing` package in non-tests builds of the `go.opentelemetry.io/otel` package. (#2786) + +### Changed + +- The `WithLabelEncoder` option from the `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` package is renamed to `WithAttributeEncoder`. (#2790) +- The `LabelFilterSelector` interface from `go.opentelemetry.io/otel/sdk/metric/processor/reducer` is renamed to `AttributeFilterSelector`. + The method included in the renamed interface also changed from `LabelFilterFor` to `AttributeFilterFor`. (#2790) +- The `Metadata.Labels` method from the `go.opentelemetry.io/otel/sdk/metric/export` package is renamed to `Metadata.Attributes`. + Consequentially, the `Record` type from the same package also has had the embedded method renamed. (#2790) + +### Deprecated + +- The `Iterator.Label` method in the `go.opentelemetry.io/otel/attribute` package is deprecated. + Use the equivalent `Iterator.Attribute` method instead. (#2790) +- The `Iterator.IndexedLabel` method in the `go.opentelemetry.io/otel/attribute` package is deprecated. + Use the equivalent `Iterator.IndexedAttribute` method instead. (#2790) +- The `MergeIterator.Label` method in the `go.opentelemetry.io/otel/attribute` package is deprecated. + Use the equivalent `MergeIterator.Attribute` method instead. (#2790) + +### Removed + +- Removed the `Batch` type from the `go.opentelemetry.io/otel/sdk/metric/metrictest` package. (#2864) +- Removed the `Measurement` type from the `go.opentelemetry.io/otel/sdk/metric/metrictest` package. (#2864) + +## [0.29.0] - 2022-04-11 + +### Added + +- The metrics global package was added back into several test files. (#2764) +- The `Meter` function is added back to the `go.opentelemetry.io/otel/metric/global` package. + This function is a convenience function equivalent to calling `global.MeterProvider().Meter(...)`. (#2750) + +### Removed + +- Removed module the `go.opentelemetry.io/otel/sdk/export/metric`. + Use the `go.opentelemetry.io/otel/sdk/metric` module instead. (#2720) + +### Changed + +- Don't panic anymore when setting a global MeterProvider to itself. (#2749) +- Upgrade `go.opentelemetry.io/proto/otlp` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` from `v0.12.1` to `v0.15.0`. + This replaces the use of the now deprecated `InstrumentationLibrary` and `InstrumentationLibraryMetrics` types and fields in the proto library with the equivalent `InstrumentationScope` and `ScopeMetrics`. (#2748) + +## [1.6.3] - 2022-04-07 + +### Fixed + +- Allow non-comparable global `MeterProvider`, `TracerProvider`, and `TextMapPropagator` types to be set. (#2772, #2773) + +## [1.6.2] - 2022-04-06 + +### Changed + +- Don't panic anymore when setting a global TracerProvider or TextMapPropagator to itself. (#2749) +- Upgrade `go.opentelemetry.io/proto/otlp` in `go.opentelemetry.io/otel/exporters/otlp/otlptrace` from `v0.12.1` to `v0.15.0`. + This replaces the use of the now deprecated `InstrumentationLibrary` and `InstrumentationLibrarySpans` types and fields in the proto library with the equivalent `InstrumentationScope` and `ScopeSpans`. (#2748) + +## [1.6.1] - 2022-03-28 + +### Fixed + +- The `go.opentelemetry.io/otel/schema/*` packages now use the correct schema URL for their `SchemaURL` constant. + Instead of using `"https://opentelemetry.io/schemas/v"` they now use the correct URL without a `v` prefix, `"https://opentelemetry.io/schemas/"`. (#2743, #2744) + +### Security + +- Upgrade `go.opentelemetry.io/proto/otlp` from `v0.12.0` to `v0.12.1`. + This includes an indirect upgrade of `github.com/grpc-ecosystem/grpc-gateway` which resolves [a vulnerability](https://nvd.nist.gov/vuln/detail/CVE-2019-11254) from `gopkg.in/yaml.v2` in version `v2.2.3`. (#2724, #2728) + +## [1.6.0/0.28.0] - 2022-03-23 + +### ⚠️ Notice ⚠️ + +This update is a breaking change of the unstable Metrics API. +Code instrumented with the `go.opentelemetry.io/otel/metric` will need to be modified. + +### Added + +- Add metrics exponential histogram support. + New mapping functions have been made available in `sdk/metric/aggregator/exponential/mapping` for other OpenTelemetry projects to take dependencies on. (#2502) +- Add Go 1.18 to our compatibility tests. (#2679) +- Allow configuring the Sampler with the `OTEL_TRACES_SAMPLER` and `OTEL_TRACES_SAMPLER_ARG` environment variables. (#2305, #2517) +- Add the `metric/global` for obtaining and setting the global `MeterProvider`. (#2660) + +### Changed + +- The metrics API has been significantly changed to match the revised OpenTelemetry specification. + High-level changes include: + + - Synchronous and asynchronous instruments are now handled by independent `InstrumentProvider`s. + These `InstrumentProvider`s are managed with a `Meter`. + - Synchronous and asynchronous instruments are grouped into their own packages based on value types. + - Asynchronous callbacks can now be registered with a `Meter`. + + Be sure to check out the metric module documentation for more information on how to use the revised API. (#2587, #2660) + +### Fixed + +- Fallback to general attribute limits when span specific ones are not set in the environment. (#2675, #2677) + +## [1.5.0] - 2022-03-16 + +### Added + +- Log the Exporters configuration in the TracerProviders message. (#2578) +- Added support to configure the span limits with environment variables. + The following environment variables are supported. (#2606, #2637) + - `OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT` + - `OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT` + - `OTEL_SPAN_EVENT_COUNT_LIMIT` + - `OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT` + - `OTEL_SPAN_LINK_COUNT_LIMIT` + - `OTEL_LINK_ATTRIBUTE_COUNT_LIMIT` + + If the provided environment variables are invalid (negative), the default values would be used. +- Rename the `gc` runtime name to `go` (#2560) +- Add resource container ID detection. (#2418) +- Add span attribute value length limit. + The new `AttributeValueLengthLimit` field is added to the `"go.opentelemetry.io/otel/sdk/trace".SpanLimits` type to configure this limit for a `TracerProvider`. + The default limit for this resource is "unlimited". (#2637) +- Add the `WithRawSpanLimits` option to `go.opentelemetry.io/otel/sdk/trace`. + This option replaces the `WithSpanLimits` option. + Zero or negative values will not be changed to the default value like `WithSpanLimits` does. + Setting a limit to zero will effectively disable the related resource it limits and setting to a negative value will mean that resource is unlimited. + Consequentially, limits should be constructed using `NewSpanLimits` and updated accordingly. (#2637) + +### Changed + +- Drop oldest tracestate `Member` when capacity is reached. (#2592) +- Add event and link drop counts to the exported data from the `oltptrace` exporter. (#2601) +- Unify path cleaning functionally in the `otlpmetric` and `otlptrace` configuration. (#2639) +- Change the debug message from the `sdk/trace.BatchSpanProcessor` to reflect the count is cumulative. (#2640) +- Introduce new internal `envconfig` package for OTLP exporters. (#2608) +- If `http.Request.Host` is empty, fall back to use `URL.Host` when populating `http.host` in the `semconv` packages. (#2661) + +### Fixed + +- Remove the OTLP trace exporter limit of SpanEvents when exporting. (#2616) +- Default to port `4318` instead of `4317` for the `otlpmetrichttp` and `otlptracehttp` client. (#2614, #2625) +- Unlimited span limits are now supported (negative values). (#2636, #2637) + +### Deprecated + +- Deprecated `"go.opentelemetry.io/otel/sdk/trace".WithSpanLimits`. + Use `WithRawSpanLimits` instead. + That option allows setting unlimited and zero limits, this option does not. + This option will be kept until the next major version incremented release. (#2637) + +## [1.4.1] - 2022-02-16 + +### Fixed + +- Fix race condition in reading the dropped spans number for the `BatchSpanProcessor`. (#2615) + +## [1.4.0] - 2022-02-11 + +### Added + +- Use `OTEL_EXPORTER_ZIPKIN_ENDPOINT` environment variable to specify zipkin collector endpoint. (#2490) +- Log the configuration of `TracerProvider`s, and `Tracer`s for debugging. + To enable use a logger with Verbosity (V level) `>=1`. (#2500) +- Added support to configure the batch span-processor with environment variables. + The following environment variables are used. (#2515) + - `OTEL_BSP_SCHEDULE_DELAY` + - `OTEL_BSP_EXPORT_TIMEOUT` + - `OTEL_BSP_MAX_QUEUE_SIZE`. + - `OTEL_BSP_MAX_EXPORT_BATCH_SIZE` + +### Changed + +- Zipkin exporter exports `Resource` attributes in the `Tags` field. (#2589) + +### Deprecated + +- Deprecate module the `go.opentelemetry.io/otel/sdk/export/metric`. + Use the `go.opentelemetry.io/otel/sdk/metric` module instead. (#2382) +- Deprecate `"go.opentelemetry.io/otel/sdk/metric".AtomicFieldOffsets`. (#2445) + +### Fixed + +- Fixed the instrument kind for noop async instruments to correctly report an implementation. (#2461) +- Fix UDP packets overflowing with Jaeger payloads. (#2489, #2512) +- Change the `otlpmetric.Client` interface's `UploadMetrics` method to accept a single `ResourceMetrics` instead of a slice of them. (#2491) +- Specify explicit buckets in Prometheus example, fixing issue where example only has `+inf` bucket. (#2419, #2493) +- W3C baggage will now decode urlescaped values. (#2529) +- Baggage members are now only validated once, when calling `NewMember` and not also when adding it to the baggage itself. (#2522) +- The order attributes are dropped from spans in the `go.opentelemetry.io/otel/sdk/trace` package when capacity is reached is fixed to be in compliance with the OpenTelemetry specification. + Instead of dropping the least-recently-used attribute, the last added attribute is dropped. + This drop order still only applies to attributes with unique keys not already contained in the span. + If an attribute is added with a key already contained in the span, that attribute is updated to the new value being added. (#2576) + +### Removed + +- Updated `go.opentelemetry.io/proto/otlp` from `v0.11.0` to `v0.12.0`. This version removes a number of deprecated methods. (#2546) + - [`Metric.GetIntGauge()`](https://pkg.go.dev/go.opentelemetry.io/proto/otlp@v0.11.0/metrics/v1#Metric.GetIntGauge) + - [`Metric.GetIntHistogram()`](https://pkg.go.dev/go.opentelemetry.io/proto/otlp@v0.11.0/metrics/v1#Metric.GetIntHistogram) + - [`Metric.GetIntSum()`](https://pkg.go.dev/go.opentelemetry.io/proto/otlp@v0.11.0/metrics/v1#Metric.GetIntSum) + +## [1.3.0] - 2021-12-10 + +### ⚠️ Notice ⚠️ + +We have updated the project minimum supported Go version to 1.16 + +### Added + +- Added an internal Logger. + This can be used by the SDK and API to provide users with feedback of the internal state. + To enable verbose logs configure the logger which will print V(1) logs. For debugging information configure to print V(5) logs. (#2343) +- Add the `WithRetry` `Option` and the `RetryConfig` type to the `go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetrichttp` package to specify retry behavior consistently. (#2425) +- Add `SpanStatusFromHTTPStatusCodeAndSpanKind` to all `semconv` packages to return a span status code similar to `SpanStatusFromHTTPStatusCode`, but exclude `4XX` HTTP errors as span errors if the span is of server kind. (#2296) + +### Changed + +- The `"go.opentelemetry.io/otel/exporter/otel/otlptrace/otlptracegrpc".Client` now uses the underlying gRPC `ClientConn` to handle name resolution, TCP connection establishment (with retries and backoff) and TLS handshakes, and handling errors on established connections by re-resolving the name and reconnecting. (#2329) +- The `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetricgrpc".Client` now uses the underlying gRPC `ClientConn` to handle name resolution, TCP connection establishment (with retries and backoff) and TLS handshakes, and handling errors on established connections by re-resolving the name and reconnecting. (#2425) +- The `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetricgrpc".RetrySettings` type is renamed to `RetryConfig`. (#2425) +- The `go.opentelemetry.io/otel/exporter/otel/*` gRPC exporters now default to using the host's root CA set if none are provided by the user and `WithInsecure` is not specified. (#2432) +- Change `resource.Default` to be evaluated the first time it is called, rather than on import. This allows the caller the option to update `OTEL_RESOURCE_ATTRIBUTES` first, such as with `os.Setenv`. (#2371) + +### Fixed + +- The `go.opentelemetry.io/otel/exporter/otel/*` exporters are updated to handle per-signal and universal endpoints according to the OpenTelemetry specification. + Any per-signal endpoint set via an `OTEL_EXPORTER_OTLP__ENDPOINT` environment variable is now used without modification of the path. + When `OTEL_EXPORTER_OTLP_ENDPOINT` is set, if it contains a path, that path is used as a base path which per-signal paths are appended to. (#2433) +- Basic metric controller updated to use sync.Map to avoid blocking calls (#2381) +- The `go.opentelemetry.io/otel/exporter/jaeger` correctly sets the `otel.status_code` value to be a string of `ERROR` or `OK` instead of an integer code. (#2439, #2440) + +### Deprecated + +- Deprecated the `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetrichttp".WithMaxAttempts` `Option`, use the new `WithRetry` `Option` instead. (#2425) +- Deprecated the `"go.opentelemetry.io/otel/exporter/otel/otlpmetric/otlpmetrichttp".WithBackoff` `Option`, use the new `WithRetry` `Option` instead. (#2425) + +### Removed + +- Remove the metric Processor's ability to convert cumulative to delta aggregation temporality. (#2350) +- Remove the metric Bound Instruments interface and implementations. (#2399) +- Remove the metric MinMaxSumCount kind aggregation and the corresponding OTLP export path. (#2423) +- Metric SDK removes the "exact" aggregator for histogram instruments, as it performed a non-standard aggregation for OTLP export (creating repeated Gauge points) and worked its way into a number of confusing examples. (#2348) + +## [1.2.0] - 2021-11-12 + +### Changed + +- Metric SDK `export.ExportKind`, `export.ExportKindSelector` types have been renamed to `aggregation.Temporality` and `aggregation.TemporalitySelector` respectively to keep in line with current specification and protocol along with built-in selectors (e.g., `aggregation.CumulativeTemporalitySelector`, ...). (#2274) +- The Metric `Exporter` interface now requires a `TemporalitySelector` method instead of an `ExportKindSelector`. (#2274) +- Metrics API cleanup. The `metric/sdkapi` package has been created to relocate the API-to-SDK interface: + - The following interface types simply moved from `metric` to `metric/sdkapi`: `Descriptor`, `MeterImpl`, `InstrumentImpl`, `SyncImpl`, `BoundSyncImpl`, `AsyncImpl`, `AsyncRunner`, `AsyncSingleRunner`, and `AsyncBatchRunner` + - The following struct types moved and are replaced with type aliases, since they are exposed to the user: `Observation`, `Measurement`. + - The No-op implementations of sync and async instruments are no longer exported, new functions `sdkapi.NewNoopAsyncInstrument()` and `sdkapi.NewNoopSyncInstrument()` are provided instead. (#2271) +- Update the SDK `BatchSpanProcessor` to export all queued spans when `ForceFlush` is called. (#2080, #2335) + +### Added + +- Add the `"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc".WithGRPCConn` option so the exporter can reuse an existing gRPC connection. (#2002) +- Added a new `schema` module to help parse Schema Files in OTEP 0152 format. (#2267) +- Added a new `MapCarrier` to the `go.opentelemetry.io/otel/propagation` package to hold propagated cross-cutting concerns as a `map[string]string` held in memory. (#2334) + +## [1.1.0] - 2021-10-27 + +### Added + +- Add the `"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc".WithGRPCConn` option so the exporter can reuse an existing gRPC connection. (#2002) +- Add the `go.opentelemetry.io/otel/semconv/v1.7.0` package. + The package contains semantic conventions from the `v1.7.0` version of the OpenTelemetry specification. (#2320) +- Add the `go.opentelemetry.io/otel/semconv/v1.6.1` package. + The package contains semantic conventions from the `v1.6.1` version of the OpenTelemetry specification. (#2321) +- Add the `go.opentelemetry.io/otel/semconv/v1.5.0` package. + The package contains semantic conventions from the `v1.5.0` version of the OpenTelemetry specification. (#2322) + - When upgrading from the `semconv/v1.4.0` package note the following name changes: + - `K8SReplicasetUIDKey` -> `K8SReplicaSetUIDKey` + - `K8SReplicasetNameKey` -> `K8SReplicaSetNameKey` + - `K8SStatefulsetUIDKey` -> `K8SStatefulSetUIDKey` + - `k8SStatefulsetNameKey` -> `K8SStatefulSetNameKey` + - `K8SDaemonsetUIDKey` -> `K8SDaemonSetUIDKey` + - `K8SDaemonsetNameKey` -> `K8SDaemonSetNameKey` + +### Changed + +- Links added to a span will be dropped by the SDK if they contain an invalid span context (#2275). + +### Fixed + +- The `"go.opentelemetry.io/otel/semconv/v1.4.0".HTTPServerAttributesFromHTTPRequest` now correctly only sets the HTTP client IP attribute even if the connection was routed with proxies and there are multiple addresses in the `X-Forwarded-For` header. (#2282, #2284) +- The `"go.opentelemetry.io/otel/semconv/v1.4.0".NetAttributesFromHTTPRequest` function correctly handles IPv6 addresses as IP addresses and sets the correct net peer IP instead of the net peer hostname attribute. (#2283, #2285) +- The simple span processor shutdown method deterministically returns the exporter error status if it simultaneously finishes when the deadline is reached. (#2290, #2289) + +## [1.0.1] - 2021-10-01 + +### Fixed + +- json stdout exporter no longer crashes due to concurrency bug. (#2265) + +## [Metrics 0.24.0] - 2021-10-01 + +### Changed + +- NoopMeterProvider is now private and NewNoopMeterProvider must be used to obtain a noopMeterProvider. (#2237) +- The Metric SDK `Export()` function takes a new two-level reader interface for iterating over results one instrumentation library at a time. (#2197) + - The former `"go.opentelemetry.io/otel/sdk/export/metric".CheckpointSet` is renamed `Reader`. + - The new interface is named `"go.opentelemetry.io/otel/sdk/export/metric".InstrumentationLibraryReader`. + +## [1.0.0] - 2021-09-20 + +This is the first stable release for the project. +This release includes an API and SDK for the tracing signal that will comply with the stability guarantees defined by the projects [versioning policy](./VERSIONING.md). + +### Added + +- OTLP trace exporter now sets the `SchemaURL` field in the exported telemetry if the Tracer has `WithSchemaURL` option. (#2242) + +### Fixed + +- Slice-valued attributes can correctly be used as map keys. (#2223) + +### Removed + +- Removed the `"go.opentelemetry.io/otel/exporters/zipkin".WithSDKOptions` function. (#2248) +- Removed the deprecated package `go.opentelemetry.io/otel/oteltest`. (#2234) +- Removed the deprecated package `go.opentelemetry.io/otel/bridge/opencensus/utils`. (#2233) +- Removed deprecated functions, types, and methods from `go.opentelemetry.io/otel/attribute` package. + Use the typed functions and methods added to the package instead. (#2235) + - The `Key.Array` method is removed. + - The `Array` function is removed. + - The `Any` function is removed. + - The `ArrayValue` function is removed. + - The `AsArray` function is removed. + +## [1.0.0-RC3] - 2021-09-02 + +### Added + +- Added `ErrorHandlerFunc` to use a function as an `"go.opentelemetry.io/otel".ErrorHandler`. (#2149) +- Added `"go.opentelemetry.io/otel/trace".WithStackTrace` option to add a stack trace when using `span.RecordError` or when panic is handled in `span.End`. (#2163) +- Added typed slice attribute types and functionality to the `go.opentelemetry.io/otel/attribute` package to replace the existing array type and functions. (#2162) + - `BoolSlice`, `IntSlice`, `Int64Slice`, `Float64Slice`, and `StringSlice` replace the use of the `Array` function in the package. +- Added the `go.opentelemetry.io/otel/example/fib` example package. + Included is an example application that computes Fibonacci numbers. (#2203) + +### Changed + +- Metric instruments have been renamed to match the (feature-frozen) metric API specification: + - ValueRecorder becomes Histogram + - ValueObserver becomes Gauge + - SumObserver becomes CounterObserver + - UpDownSumObserver becomes UpDownCounterObserver + The API exported from this project is still considered experimental. (#2202) +- Metric SDK/API implementation type `InstrumentKind` moves into `sdkapi` sub-package. (#2091) +- The Metrics SDK export record no longer contains a Resource pointer, the SDK `"go.opentelemetry.io/otel/sdk/trace/export/metric".Exporter.Export()` function for push-based exporters now takes a single Resource argument, pull-based exporters use `"go.opentelemetry.io/otel/sdk/metric/controller/basic".Controller.Resource()`. (#2120) +- The JSON output of the `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` is harmonized now such that the output is "plain" JSON objects after each other of the form `{ ... } { ... } { ... }`. Earlier the JSON objects describing a span were wrapped in a slice for each `Exporter.ExportSpans` call, like `[ { ... } ][ { ... } { ... } ]`. Outputting JSON object directly after each other is consistent with JSON loggers, and a bit easier to parse and read. (#2196) +- Update the `NewTracerConfig`, `NewSpanStartConfig`, `NewSpanEndConfig`, and `NewEventConfig` function in the `go.opentelemetry.io/otel/trace` package to return their respective configurations as structs instead of pointers to the struct. (#2212) + +### Deprecated + +- The `go.opentelemetry.io/otel/bridge/opencensus/utils` package is deprecated. + All functionality from this package now exists in the `go.opentelemetry.io/otel/bridge/opencensus` package. + The functions from that package should be used instead. (#2166) +- The `"go.opentelemetry.io/otel/attribute".Array` function and the related `ARRAY` value type is deprecated. + Use the typed `*Slice` functions and types added to the package instead. (#2162) +- The `"go.opentelemetry.io/otel/attribute".Any` function is deprecated. + Use the typed functions instead. (#2181) +- The `go.opentelemetry.io/otel/oteltest` package is deprecated. + The `"go.opentelemetry.io/otel/sdk/trace/tracetest".SpanRecorder` can be registered with the default SDK (`go.opentelemetry.io/otel/sdk/trace`) as a `SpanProcessor` and used as a replacement for this deprecated package. (#2188) + +### Removed + +- Removed metrics test package `go.opentelemetry.io/otel/sdk/export/metric/metrictest`. (#2105) + +### Fixed + +- The `fromEnv` detector no longer throws an error when `OTEL_RESOURCE_ATTRIBUTES` environment variable is not set or empty. (#2138) +- Setting the global `ErrorHandler` with `"go.opentelemetry.io/otel".SetErrorHandler` multiple times is now supported. (#2160, #2140) +- The `"go.opentelemetry.io/otel/attribute".Any` function now supports `int32` values. (#2169) +- Multiple calls to `"go.opentelemetry.io/otel/sdk/metric/controller/basic".WithResource()` are handled correctly, and when no resources are provided `"go.opentelemetry.io/otel/sdk/resource".Default()` is used. (#2120) +- The `WithoutTimestamps` option for the `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` exporter causes the exporter to correctly omit timestamps. (#2195) +- Fixed typos in resources.go. (#2201) + +## [1.0.0-RC2] - 2021-07-26 + +### Added + +- Added `WithOSDescription` resource configuration option to set OS (Operating System) description resource attribute (`os.description`). (#1840) +- Added `WithOS` resource configuration option to set all OS (Operating System) resource attributes at once. (#1840) +- Added the `WithRetry` option to the `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` package. + This option is a replacement for the removed `WithMaxAttempts` and `WithBackoff` options. (#2095) +- Added API `LinkFromContext` to return Link which encapsulates SpanContext from provided context and also encapsulates attributes. (#2115) +- Added a new `Link` type under the SDK `otel/sdk/trace` package that counts the number of attributes that were dropped for surpassing the `AttributePerLinkCountLimit` configured in the Span's `SpanLimits`. + This new type replaces the equal-named API `Link` type found in the `otel/trace` package for most usages within the SDK. + For example, instances of this type are now returned by the `Links()` function of `ReadOnlySpan`s provided in places like the `OnEnd` function of `SpanProcessor` implementations. (#2118) +- Added the `SpanRecorder` type to the `go.opentelemetry.io/otel/skd/trace/tracetest` package. + This type can be used with the default SDK as a `SpanProcessor` during testing. (#2132) + +### Changed + +- The `SpanModels` function is now exported from the `go.opentelemetry.io/otel/exporters/zipkin` package to convert OpenTelemetry spans into Zipkin model spans. (#2027) +- Rename the `"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc".RetrySettings` to `RetryConfig`. (#2095) + +### Deprecated + +- The `TextMapCarrier` and `TextMapPropagator` from the `go.opentelemetry.io/otel/oteltest` package and their associated creation functions (`TextMapCarrier`, `NewTextMapPropagator`) are deprecated. (#2114) +- The `Harness` type from the `go.opentelemetry.io/otel/oteltest` package and its associated creation function, `NewHarness` are deprecated and will be removed in the next release. (#2123) +- The `TraceStateFromKeyValues` function from the `go.opentelemetry.io/otel/oteltest` package is deprecated. + Use the `trace.ParseTraceState` function instead. (#2122) + +### Removed + +- Removed the deprecated package `go.opentelemetry.io/otel/exporters/trace/jaeger`. (#2020) +- Removed the deprecated package `go.opentelemetry.io/otel/exporters/trace/zipkin`. (#2020) +- Removed the `"go.opentelemetry.io/otel/sdk/resource".WithBuiltinDetectors` function. + The explicit `With*` options for every built-in detector should be used instead. (#2026 #2097) +- Removed the `WithMaxAttempts` and `WithBackoff` options from the `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` package. + The retry logic of the package has been updated to match the `otlptracegrpc` package and accordingly a `WithRetry` option is added that should be used instead. (#2095) +- Removed `DroppedAttributeCount` field from `otel/trace.Link` struct. (#2118) + +### Fixed + +- When using WithNewRoot, don't use the parent context for making sampling decisions. (#2032) +- `oteltest.Tracer` now creates a valid `SpanContext` when using `WithNewRoot`. (#2073) +- OS type detector now sets the correct `dragonflybsd` value for DragonFly BSD. (#2092) +- The OTel span status is correctly transformed into the OTLP status in the `go.opentelemetry.io/otel/exporters/otlp/otlptrace` package. + This fix will by default set the status to `Unset` if it is not explicitly set to `Ok` or `Error`. (#2099 #2102) +- The `Inject` method for the `"go.opentelemetry.io/otel/propagation".TraceContext` type no longer injects empty `tracestate` values. (#2108) +- Use `6831` as default Jaeger agent port instead of `6832`. (#2131) + +## [Experimental Metrics v0.22.0] - 2021-07-19 + +### Added + +- Adds HTTP support for OTLP metrics exporter. (#2022) + +### Removed + +- Removed the deprecated package `go.opentelemetry.io/otel/exporters/metric/prometheus`. (#2020) + +## [1.0.0-RC1] / 0.21.0 - 2021-06-18 + +With this release we are introducing a split in module versions. The tracing API and SDK are entering the `v1.0.0` Release Candidate phase with `v1.0.0-RC1` +while the experimental metrics API and SDK continue with `v0.x` releases at `v0.21.0`. Modules at major version 1 or greater will not depend on modules +with major version 0. + +### Added + +- Adds `otlpgrpc.WithRetry`option for configuring the retry policy for transient errors on the otlp/gRPC exporter. (#1832) + - The following status codes are defined as transient errors: + | gRPC Status Code | Description | + | ---------------- | ----------- | + | 1 | Cancelled | + | 4 | Deadline Exceeded | + | 8 | Resource Exhausted | + | 10 | Aborted | + | 10 | Out of Range | + | 14 | Unavailable | + | 15 | Data Loss | +- Added `Status` type to the `go.opentelemetry.io/otel/sdk/trace` package to represent the status of a span. (#1874) +- Added `SpanStub` type and its associated functions to the `go.opentelemetry.io/otel/sdk/trace/tracetest` package. + This type can be used as a testing replacement for the `SpanSnapshot` that was removed from the `go.opentelemetry.io/otel/sdk/trace` package. (#1873) +- Adds support for scheme in `OTEL_EXPORTER_OTLP_ENDPOINT` according to the spec. (#1886) +- Adds `trace.WithSchemaURL` option for configuring the tracer with a Schema URL. (#1889) +- Added an example of using OpenTelemetry Go as a trace context forwarder. (#1912) +- `ParseTraceState` is added to the `go.opentelemetry.io/otel/trace` package. + It can be used to decode a `TraceState` from a `tracestate` header string value. (#1937) +- Added `Len` method to the `TraceState` type in the `go.opentelemetry.io/otel/trace` package. + This method returns the number of list-members the `TraceState` holds. (#1937) +- Creates package `go.opentelemetry.io/otel/exporters/otlp/otlptrace` that defines a trace exporter that uses a `otlptrace.Client` to send data. + Creates package `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` implementing a gRPC `otlptrace.Client` and offers convenience functions, `NewExportPipeline` and `InstallNewPipeline`, to setup and install a `otlptrace.Exporter` in tracing .(#1922) +- Added `Baggage`, `Member`, and `Property` types to the `go.opentelemetry.io/otel/baggage` package along with their related functions. (#1967) +- Added `ContextWithBaggage`, `ContextWithoutBaggage`, and `FromContext` functions to the `go.opentelemetry.io/otel/baggage` package. + These functions replace the `Set`, `Value`, `ContextWithValue`, `ContextWithoutValue`, and `ContextWithEmpty` functions from that package and directly work with the new `Baggage` type. (#1967) +- The `OTEL_SERVICE_NAME` environment variable is the preferred source for `service.name`, used by the environment resource detector if a service name is present both there and in `OTEL_RESOURCE_ATTRIBUTES`. (#1969) +- Creates package `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` implementing an HTTP `otlptrace.Client` and offers convenience functions, `NewExportPipeline` and `InstallNewPipeline`, to setup and install a `otlptrace.Exporter` in tracing. (#1963) +- Changes `go.opentelemetry.io/otel/sdk/resource.NewWithAttributes` to require a schema URL. The old function is still available as `resource.NewSchemaless`. This is a breaking change. (#1938) +- Several builtin resource detectors now correctly populate the schema URL. (#1938) +- Creates package `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` that defines a metrics exporter that uses a `otlpmetric.Client` to send data. +- Creates package `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` implementing a gRPC `otlpmetric.Client` and offers convenience functions, `New` and `NewUnstarted`, to create an `otlpmetric.Exporter`.(#1991) +- Added `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` exporter. (#2005) +- Added `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` exporter. (#2005) +- Added a `TracerProvider()` method to the `"go.opentelemetry.io/otel/trace".Span` interface. This can be used to obtain a `TracerProvider` from a given span that utilizes the same trace processing pipeline. (#2009) + +### Changed + +- Make `NewSplitDriver` from `go.opentelemetry.io/otel/exporters/otlp` take variadic arguments instead of a `SplitConfig` item. + `NewSplitDriver` now automatically implements an internal `noopDriver` for `SplitConfig` fields that are not initialized. (#1798) +- `resource.New()` now creates a Resource without builtin detectors. Previous behavior is now achieved by using `WithBuiltinDetectors` Option. (#1810) +- Move the `Event` type from the `go.opentelemetry.io/otel` package to the `go.opentelemetry.io/otel/sdk/trace` package. (#1846) +- CI builds validate against last two versions of Go, dropping 1.14 and adding 1.16. (#1865) +- BatchSpanProcessor now report export failures when calling `ForceFlush()` method. (#1860) +- `Set.Encoded(Encoder)` no longer caches the result of an encoding. (#1855) +- Renamed `CloudZoneKey` to `CloudAvailabilityZoneKey` in Resource semantic conventions according to spec. (#1871) +- The `StatusCode` and `StatusMessage` methods of the `ReadOnlySpan` interface and the `Span` produced by the `go.opentelemetry.io/otel/sdk/trace` package have been replaced with a single `Status` method. + This method returns the status of a span using the new `Status` type. (#1874) +- Updated `ExportSpans` method of the`SpanExporter` interface type to accept `ReadOnlySpan`s instead of the removed `SpanSnapshot`. + This brings the export interface into compliance with the specification in that it now accepts an explicitly immutable type instead of just an implied one. (#1873) +- Unembed `SpanContext` in `Link`. (#1877) +- Generate Semantic conventions from the specification YAML. (#1891) +- Spans created by the global `Tracer` obtained from `go.opentelemetry.io/otel`, prior to a functioning `TracerProvider` being set, now propagate the span context from their parent if one exists. (#1901) +- The `"go.opentelemetry.io/otel".Tracer` function now accepts tracer options. (#1902) +- Move the `go.opentelemetry.io/otel/unit` package to `go.opentelemetry.io/otel/metric/unit`. (#1903) +- Changed `go.opentelemetry.io/otel/trace.TracerConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config.) (#1921) +- Changed `go.opentelemetry.io/otel/trace.SpanConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config). (#1921) +- Changed `span.End()` now only accepts Options that are allowed at `End()`. (#1921) +- Changed `go.opentelemetry.io/otel/metric.InstrumentConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config). (#1921) +- Changed `go.opentelemetry.io/otel/metric.MeterConfig` to conform to the [Contributing guidelines](CONTRIBUTING.md#config). (#1921) +- Refactored option types according to the contribution style guide. (#1882) +- Move the `go.opentelemetry.io/otel/trace.TraceStateFromKeyValues` function to the `go.opentelemetry.io/otel/oteltest` package. + This function is preserved for testing purposes where it may be useful to create a `TraceState` from `attribute.KeyValue`s, but it is not intended for production use. + The new `ParseTraceState` function should be used to create a `TraceState`. (#1931) +- Updated `MarshalJSON` method of the `go.opentelemetry.io/otel/trace.TraceState` type to marshal the type into the string representation of the `TraceState`. (#1931) +- The `TraceState.Delete` method from the `go.opentelemetry.io/otel/trace` package no longer returns an error in addition to a `TraceState`. (#1931) +- Updated `Get` method of the `TraceState` type from the `go.opentelemetry.io/otel/trace` package to accept a `string` instead of an `attribute.Key` type. (#1931) +- Updated `Insert` method of the `TraceState` type from the `go.opentelemetry.io/otel/trace` package to accept a pair of `string`s instead of an `attribute.KeyValue` type. (#1931) +- Updated `Delete` method of the `TraceState` type from the `go.opentelemetry.io/otel/trace` package to accept a `string` instead of an `attribute.Key` type. (#1931) +- Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/stdout` package. (#1985) +- Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/metric/prometheus` package. (#1985) +- Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/trace/jaeger` package. (#1985) +- Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/trace/zipkin` package. (#1985) +- Renamed `NewExporter` to `New` in the `go.opentelemetry.io/otel/exporters/otlp` package. (#1985) +- Renamed `NewUnstartedExporter` to `NewUnstarted` in the `go.opentelemetry.io/otel/exporters/otlp` package. (#1985) +- The `go.opentelemetry.io/otel/semconv` package has been moved to `go.opentelemetry.io/otel/semconv/v1.4.0` to allow for multiple [telemetry schema](https://github.com/open-telemetry/oteps/blob/main/text/0152-telemetry-schemas.md) versions to be used concurrently. (#1987) +- Metrics test helpers in `go.opentelemetry.io/otel/oteltest` have been moved to `go.opentelemetry.io/otel/metric/metrictest`. (#1988) + +### Deprecated + +- The `go.opentelemetry.io/otel/exporters/metric/prometheus` is deprecated, use `go.opentelemetry.io/otel/exporters/prometheus` instead. (#1993) +- The `go.opentelemetry.io/otel/exporters/trace/jaeger` is deprecated, use `go.opentelemetry.io/otel/exporters/jaeger` instead. (#1993) +- The `go.opentelemetry.io/otel/exporters/trace/zipkin` is deprecated, use `go.opentelemetry.io/otel/exporters/zipkin` instead. (#1993) + +### Removed + +- Removed `resource.WithoutBuiltin()`. Use `resource.New()`. (#1810) +- Unexported types `resource.FromEnv`, `resource.Host`, and `resource.TelemetrySDK`, Use the corresponding `With*()` to use individually. (#1810) +- Removed the `Tracer` and `IsRecording` method from the `ReadOnlySpan` in the `go.opentelemetry.io/otel/sdk/trace`. + The `Tracer` method is not a required to be included in this interface and given the mutable nature of the tracer that is associated with a span, this method is not appropriate. + The `IsRecording` method returns if the span is recording or not. + A read-only span value does not need to know if updates to it will be recorded or not. + By definition, it cannot be updated so there is no point in communicating if an update is recorded. (#1873) +- Removed the `SpanSnapshot` type from the `go.opentelemetry.io/otel/sdk/trace` package. + The use of this type has been replaced with the use of the explicitly immutable `ReadOnlySpan` type. + When a concrete representation of a read-only span is needed for testing, the newly added `SpanStub` in the `go.opentelemetry.io/otel/sdk/trace/tracetest` package should be used. (#1873) +- Removed the `Tracer` method from the `Span` interface in the `go.opentelemetry.io/otel/trace` package. + Using the same tracer that created a span introduces the error where an instrumentation library's `Tracer` is used by other code instead of their own. + The `"go.opentelemetry.io/otel".Tracer` function or a `TracerProvider` should be used to acquire a library specific `Tracer` instead. (#1900) + - The `TracerProvider()` method on the `Span` interface may also be used to obtain a `TracerProvider` using the same trace processing pipeline. (#2009) +- The `http.url` attribute generated by `HTTPClientAttributesFromHTTPRequest` will no longer include username or password information. (#1919) +- Removed `IsEmpty` method of the `TraceState` type in the `go.opentelemetry.io/otel/trace` package in favor of using the added `TraceState.Len` method. (#1931) +- Removed `Set`, `Value`, `ContextWithValue`, `ContextWithoutValue`, and `ContextWithEmpty` functions in the `go.opentelemetry.io/otel/baggage` package. + Handling of baggage is now done using the added `Baggage` type and related context functions (`ContextWithBaggage`, `ContextWithoutBaggage`, and `FromContext`) in that package. (#1967) +- The `InstallNewPipeline` and `NewExportPipeline` creation functions in all the exporters (prometheus, otlp, stdout, jaeger, and zipkin) have been removed. + These functions were deemed premature attempts to provide convenience that did not achieve this aim. (#1985) +- The `go.opentelemetry.io/otel/exporters/otlp` exporter has been removed. Use `go.opentelemetry.io/otel/exporters/otlp/otlptrace` instead. (#1990) +- The `go.opentelemetry.io/otel/exporters/stdout` exporter has been removed. Use `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` or `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` instead. (#2005) + +### Fixed + +- Only report errors from the `"go.opentelemetry.io/otel/sdk/resource".Environment` function when they are not `nil`. (#1850, #1851) +- The `Shutdown` method of the simple `SpanProcessor` in the `go.opentelemetry.io/otel/sdk/trace` package now honors the context deadline or cancellation. (#1616, #1856) +- BatchSpanProcessor now drops span batches that failed to be exported. (#1860) +- Use `http://localhost:14268/api/traces` as default Jaeger collector endpoint instead of `http://localhost:14250`. (#1898) +- Allow trailing and leading whitespace in the parsing of a `tracestate` header. (#1931) +- Add logic to determine if the channel is closed to fix Jaeger exporter test panic with close closed channel. (#1870, #1973) +- Avoid transport security when OTLP endpoint is a Unix socket. (#2001) + +### Security + +## [0.20.0] - 2021-04-23 + +### Added + +- The OTLP exporter now has two new convenience functions, `NewExportPipeline` and `InstallNewPipeline`, setup and install the exporter in tracing and metrics pipelines. (#1373) +- Adds semantic conventions for exceptions. (#1492) +- Added Jaeger Environment variables: `OTEL_EXPORTER_JAEGER_AGENT_HOST`, `OTEL_EXPORTER_JAEGER_AGENT_PORT` + These environment variables can be used to override Jaeger agent hostname and port (#1752) +- Option `ExportTimeout` was added to batch span processor. (#1755) +- `trace.TraceFlags` is now a defined type over `byte` and `WithSampled(bool) TraceFlags` and `IsSampled() bool` methods have been added to it. (#1770) +- The `Event` and `Link` struct types from the `go.opentelemetry.io/otel` package now include a `DroppedAttributeCount` field to record the number of attributes that were not recorded due to configured limits being reached. (#1771) +- The Jaeger exporter now reports dropped attributes for a Span event in the exported log. (#1771) +- Adds test to check BatchSpanProcessor ignores `OnEnd` and `ForceFlush` post `Shutdown`. (#1772) +- Extract resource attributes from the `OTEL_RESOURCE_ATTRIBUTES` environment variable and merge them with the `resource.Default` resource as well as resources provided to the `TracerProvider` and metric `Controller`. (#1785) +- Added `WithOSType` resource configuration option to set OS (Operating System) type resource attribute (`os.type`). (#1788) +- Added `WithProcess*` resource configuration options to set Process resource attributes. (#1788) + - `process.pid` + - `process.executable.name` + - `process.executable.path` + - `process.command_args` + - `process.owner` + - `process.runtime.name` + - `process.runtime.version` + - `process.runtime.description` +- Adds `k8s.node.name` and `k8s.node.uid` attribute keys to the `semconv` package. (#1789) +- Added support for configuring OTLP/HTTP and OTLP/gRPC Endpoints, TLS Certificates, Headers, Compression and Timeout via Environment Variables. (#1758, #1769 and #1811) + - `OTEL_EXPORTER_OTLP_ENDPOINT` + - `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` + - `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` + - `OTEL_EXPORTER_OTLP_HEADERS` + - `OTEL_EXPORTER_OTLP_TRACES_HEADERS` + - `OTEL_EXPORTER_OTLP_METRICS_HEADERS` + - `OTEL_EXPORTER_OTLP_COMPRESSION` + - `OTEL_EXPORTER_OTLP_TRACES_COMPRESSION` + - `OTEL_EXPORTER_OTLP_METRICS_COMPRESSION` + - `OTEL_EXPORTER_OTLP_TIMEOUT` + - `OTEL_EXPORTER_OTLP_TRACES_TIMEOUT` + - `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` + - `OTEL_EXPORTER_OTLP_CERTIFICATE` + - `OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE` + - `OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE` +- Adds `otlpgrpc.WithTimeout` option for configuring timeout to the otlp/gRPC exporter. (#1821) +- Adds `jaeger.WithMaxPacketSize` option for configuring maximum UDP packet size used when connecting to the Jaeger agent. (#1853) + +### Fixed + +- The `Span.IsRecording` implementation from `go.opentelemetry.io/otel/sdk/trace` always returns false when not being sampled. (#1750) +- The Jaeger exporter now correctly sets tags for the Span status code and message. + This means it uses the correct tag keys (`"otel.status_code"`, `"otel.status_description"`) and does not set the status message as a tag unless it is set on the span. (#1761) +- The Jaeger exporter now correctly records Span event's names using the `"event"` key for a tag. + Additionally, this tag is overridden, as specified in the OTel specification, if the event contains an attribute with that key. (#1768) +- Zipkin Exporter: Ensure mapping between OTel and Zipkin span data complies with the specification. (#1688) +- Fixed typo for default service name in Jaeger Exporter. (#1797) +- Fix flaky OTLP for the reconnnection of the client connection. (#1527, #1814) +- Fix Jaeger exporter dropping of span batches that exceed the UDP packet size limit. + Instead, the exporter now splits the batch into smaller sendable batches. (#1828) + +### Changed + +- Span `RecordError` now records an `exception` event to comply with the semantic convention specification. (#1492) +- Jaeger exporter was updated to use thrift v0.14.1. (#1712) +- Migrate from using internally built and maintained version of the OTLP to the one hosted at `go.opentelemetry.io/proto/otlp`. (#1713) +- Migrate from using `github.com/gogo/protobuf` to `google.golang.org/protobuf` to match `go.opentelemetry.io/proto/otlp`. (#1713) +- The storage of a local or remote Span in a `context.Context` using its SpanContext is unified to store just the current Span. + The Span's SpanContext can now self-identify as being remote or not. + This means that `"go.opentelemetry.io/otel/trace".ContextWithRemoteSpanContext` will now overwrite any existing current Span, not just existing remote Spans, and make it the current Span in a `context.Context`. (#1731) +- Improve OTLP/gRPC exporter connection errors. (#1737) +- Information about a parent span context in a `"go.opentelemetry.io/otel/export/trace".SpanSnapshot` is unified in a new `Parent` field. + The existing `ParentSpanID` and `HasRemoteParent` fields are removed in favor of this. (#1748) +- The `ParentContext` field of the `"go.opentelemetry.io/otel/sdk/trace".SamplingParameters` is updated to hold a `context.Context` containing the parent span. + This changes it to make `SamplingParameters` conform with the OpenTelemetry specification. (#1749) +- Updated Jaeger Environment Variables: `JAEGER_ENDPOINT`, `JAEGER_USER`, `JAEGER_PASSWORD` + to `OTEL_EXPORTER_JAEGER_ENDPOINT`, `OTEL_EXPORTER_JAEGER_USER`, `OTEL_EXPORTER_JAEGER_PASSWORD` in compliance with OTel specification. (#1752) +- Modify `BatchSpanProcessor.ForceFlush` to abort after timeout/cancellation. (#1757) +- The `DroppedAttributeCount` field of the `Span` in the `go.opentelemetry.io/otel` package now only represents the number of attributes dropped for the span itself. + It no longer is a conglomerate of itself, events, and link attributes that have been dropped. (#1771) +- Make `ExportSpans` in Jaeger Exporter honor context deadline. (#1773) +- Modify Zipkin Exporter default service name, use default resource's serviceName instead of empty. (#1777) +- The `go.opentelemetry.io/otel/sdk/export/trace` package is merged into the `go.opentelemetry.io/otel/sdk/trace` package. (#1778) +- The prometheus.InstallNewPipeline example is moved from comment to example test (#1796) +- The convenience functions for the stdout exporter have been updated to return the `TracerProvider` implementation and enable the shutdown of the exporter. (#1800) +- Replace the flush function returned from the Jaeger exporter's convenience creation functions (`InstallNewPipeline` and `NewExportPipeline`) with the `TracerProvider` implementation they create. + This enables the caller to shutdown and flush using the related `TracerProvider` methods. (#1822) +- Updated the Jaeger exporter to have a default endpoint, `http://localhost:14250`, for the collector. (#1824) +- Changed the function `WithCollectorEndpoint` in the Jaeger exporter to no longer accept an endpoint as an argument. + The endpoint can be passed with the `CollectorEndpointOption` using the `WithEndpoint` function or by setting the `OTEL_EXPORTER_JAEGER_ENDPOINT` environment variable value appropriately. (#1824) +- The Jaeger exporter no longer batches exported spans itself, instead it relies on the SDK's `BatchSpanProcessor` for this functionality. (#1830) +- The Jaeger exporter creation functions (`NewRawExporter`, `NewExportPipeline`, and `InstallNewPipeline`) no longer accept the removed `Option` type as a variadic argument. (#1830) + +### Removed + +- Removed Jaeger Environment variables: `JAEGER_SERVICE_NAME`, `JAEGER_DISABLED`, `JAEGER_TAGS` + These environment variables will no longer be used to override values of the Jaeger exporter (#1752) +- No longer set the links for a `Span` in `go.opentelemetry.io/otel/sdk/trace` that is configured to be a new root. + This is unspecified behavior that the OpenTelemetry community plans to standardize in the future. + To prevent backwards incompatible changes when it is specified, these links are removed. (#1726) +- Setting error status while recording error with Span from oteltest package. (#1729) +- The concept of a remote and local Span stored in a context is unified to just the current Span. + Because of this `"go.opentelemetry.io/otel/trace".RemoteSpanContextFromContext` is removed as it is no longer needed. + Instead, `"go.opentelemetry.io/otel/trace".SpanContextFromContex` can be used to return the current Span. + If needed, that Span's `SpanContext.IsRemote()` can then be used to determine if it is remote or not. (#1731) +- The `HasRemoteParent` field of the `"go.opentelemetry.io/otel/sdk/trace".SamplingParameters` is removed. + This field is redundant to the information returned from the `Remote` method of the `SpanContext` held in the `ParentContext` field. (#1749) +- The `trace.FlagsDebug` and `trace.FlagsDeferred` constants have been removed and will be localized to the B3 propagator. (#1770) +- Remove `Process` configuration, `WithProcessFromEnv` and `ProcessFromEnv`, and type from the Jaeger exporter package. + The information that could be configured in the `Process` struct should be configured in a `Resource` instead. (#1776, #1804) +- Remove the `WithDisabled` option from the Jaeger exporter. + To disable the exporter unregister it from the `TracerProvider` or use a no-operation `TracerProvider`. (#1806) +- Removed the functions `CollectorEndpointFromEnv` and `WithCollectorEndpointOptionFromEnv` from the Jaeger exporter. + These functions for retrieving specific environment variable values are redundant of other internal functions and + are not intended for end user use. (#1824) +- Removed the Jaeger exporter `WithSDKOptions` `Option`. + This option was used to set SDK options for the exporter creation convenience functions. + These functions are provided as a way to easily setup or install the exporter with what are deemed reasonable SDK settings for common use cases. + If the SDK needs to be configured differently, the `NewRawExporter` function and direct setup of the SDK with the desired settings should be used. (#1825) +- The `WithBufferMaxCount` and `WithBatchMaxCount` `Option`s from the Jaeger exporter are removed. + The exporter no longer batches exports, instead relying on the SDK's `BatchSpanProcessor` for this functionality. (#1830) +- The Jaeger exporter `Option` type is removed. + The type is no longer used by the exporter to configure anything. + All the previous configurations these options provided were duplicates of SDK configuration. + They have been removed in favor of using the SDK configuration and focuses the exporter configuration to be only about the endpoints it will send telemetry to. (#1830) + +## [0.19.0] - 2021-03-18 + +### Added + +- Added `Marshaler` config option to `otlphttp` to enable otlp over json or protobufs. (#1586) +- A `ForceFlush` method to the `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` to flush all registered `SpanProcessor`s. (#1608) +- Added `WithSampler` and `WithSpanLimits` to tracer provider. (#1633, #1702) +- `"go.opentelemetry.io/otel/trace".SpanContext` now has a `remote` property, and `IsRemote()` predicate, that is true when the `SpanContext` has been extracted from remote context data. (#1701) +- A `Valid` method to the `"go.opentelemetry.io/otel/attribute".KeyValue` type. (#1703) + +### Changed + +- `trace.SpanContext` is now immutable and has no exported fields. (#1573) + - `trace.NewSpanContext()` can be used in conjunction with the `trace.SpanContextConfig` struct to initialize a new `SpanContext` where all values are known. +- Update the `ForceFlush` method signature to the `"go.opentelemetry.io/otel/sdk/trace".SpanProcessor` to accept a `context.Context` and return an error. (#1608) +- Update the `Shutdown` method to the `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` return an error on shutdown failure. (#1608) +- The SimpleSpanProcessor will now shut down the enclosed `SpanExporter` and gracefully ignore subsequent calls to `OnEnd` after `Shutdown` is called. (#1612) +- `"go.opentelemetry.io/sdk/metric/controller.basic".WithPusher` is replaced with `WithExporter` to provide consistent naming across project. (#1656) +- Added non-empty string check for trace `Attribute` keys. (#1659) +- Add `description` to SpanStatus only when `StatusCode` is set to error. (#1662) +- Jaeger exporter falls back to `resource.Default`'s `service.name` if the exported Span does not have one. (#1673) +- Jaeger exporter populates Jaeger's Span Process from Resource. (#1673) +- Renamed the `LabelSet` method of `"go.opentelemetry.io/otel/sdk/resource".Resource` to `Set`. (#1692) +- Changed `WithSDK` to `WithSDKOptions` to accept variadic arguments of `TracerProviderOption` type in `go.opentelemetry.io/otel/exporters/trace/jaeger` package. (#1693) +- Changed `WithSDK` to `WithSDKOptions` to accept variadic arguments of `TracerProviderOption` type in `go.opentelemetry.io/otel/exporters/trace/zipkin` package. (#1693) + +### Removed + +- Removed `serviceName` parameter from Zipkin exporter and uses resource instead. (#1549) +- Removed `WithConfig` from tracer provider to avoid overriding configuration. (#1633) +- Removed the exported `SimpleSpanProcessor` and `BatchSpanProcessor` structs. + These are now returned as a SpanProcessor interface from their respective constructors. (#1638) +- Removed `WithRecord()` from `trace.SpanOption` when creating a span. (#1660) +- Removed setting status to `Error` while recording an error as a span event in `RecordError`. (#1663) +- Removed `jaeger.WithProcess` configuration option. (#1673) +- Removed `ApplyConfig` method from `"go.opentelemetry.io/otel/sdk/trace".TracerProvider` and the now unneeded `Config` struct. (#1693) + +### Fixed + +- Jaeger Exporter: Ensure mapping between OTEL and Jaeger span data complies with the specification. (#1626) +- `SamplingResult.TraceState` is correctly propagated to a newly created span's `SpanContext`. (#1655) +- The `otel-collector` example now correctly flushes metric events prior to shutting down the exporter. (#1678) +- Do not set span status message in `SpanStatusFromHTTPStatusCode` if it can be inferred from `http.status_code`. (#1681) +- Synchronization issues in global trace delegate implementation. (#1686) +- Reduced excess memory usage by global `TracerProvider`. (#1687) + +## [0.18.0] - 2021-03-03 + +### Added + +- Added `resource.Default()` for use with meter and tracer providers. (#1507) +- `AttributePerEventCountLimit` and `AttributePerLinkCountLimit` for `SpanLimits`. (#1535) +- Added `Keys()` method to `propagation.TextMapCarrier` and `propagation.HeaderCarrier` to adapt `http.Header` to this interface. (#1544) +- Added `code` attributes to `go.opentelemetry.io/otel/semconv` package. (#1558) +- Compatibility testing suite in the CI system for the following systems. (#1567) + | OS | Go Version | Architecture | + | ------- | ---------- | ------------ | + | Ubuntu | 1.15 | amd64 | + | Ubuntu | 1.14 | amd64 | + | Ubuntu | 1.15 | 386 | + | Ubuntu | 1.14 | 386 | + | MacOS | 1.15 | amd64 | + | MacOS | 1.14 | amd64 | + | Windows | 1.15 | amd64 | + | Windows | 1.14 | amd64 | + | Windows | 1.15 | 386 | + | Windows | 1.14 | 386 | + +### Changed + +- Replaced interface `oteltest.SpanRecorder` with its existing implementation + `StandardSpanRecorder`. (#1542) +- Default span limit values to 128. (#1535) +- Rename `MaxEventsPerSpan`, `MaxAttributesPerSpan` and `MaxLinksPerSpan` to `EventCountLimit`, `AttributeCountLimit` and `LinkCountLimit`, and move these fields into `SpanLimits`. (#1535) +- Renamed the `otel/label` package to `otel/attribute`. (#1541) +- Vendor the Jaeger exporter's dependency on Apache Thrift. (#1551) +- Parallelize the CI linting and testing. (#1567) +- Stagger timestamps in exact aggregator tests. (#1569) +- Changed all examples to use `WithBatchTimeout(5 * time.Second)` rather than `WithBatchTimeout(5)`. (#1621) +- Prevent end-users from implementing some interfaces (#1575) + + ``` + "otel/exporters/otlp/otlphttp".Option + "otel/exporters/stdout".Option + "otel/oteltest".Option + "otel/trace".TracerOption + "otel/trace".SpanOption + "otel/trace".EventOption + "otel/trace".LifeCycleOption + "otel/trace".InstrumentationOption + "otel/sdk/resource".Option + "otel/sdk/trace".ParentBasedSamplerOption + "otel/sdk/trace".ReadOnlySpan + "otel/sdk/trace".ReadWriteSpan + ``` + +### Removed + +- Removed attempt to resample spans upon changing the span name with `span.SetName()`. (#1545) +- The `test-benchmark` is no longer a dependency of the `precommit` make target. (#1567) +- Removed the `test-386` make target. + This was replaced with a full compatibility testing suite (i.e. multi OS/arch) in the CI system. (#1567) + +### Fixed + +- The sequential timing check of timestamps in the stdout exporter are now setup explicitly to be sequential (#1571). (#1572) +- Windows build of Jaeger tests now compiles with OS specific functions (#1576). (#1577) +- The sequential timing check of timestamps of go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue are now setup explicitly to be sequential (#1578). (#1579) +- Validate tracestate header keys with vendors according to the W3C TraceContext specification (#1475). (#1581) +- The OTLP exporter includes related labels for translations of a GaugeArray (#1563). (#1570) + +## [0.17.0] - 2021-02-12 + +### Changed + +- Rename project default branch from `master` to `main`. (#1505) +- Reverse order in which `Resource` attributes are merged, per change in spec. (#1501) +- Add tooling to maintain "replace" directives in go.mod files automatically. (#1528) +- Create new modules: otel/metric, otel/trace, otel/oteltest, otel/sdk/export/metric, otel/sdk/metric (#1528) +- Move metric-related public global APIs from otel to otel/metric/global. (#1528) + +## Fixed + +- Fixed otlpgrpc reconnection issue. +- The example code in the README.md of `go.opentelemetry.io/otel/exporters/otlp` is moved to a compiled example test and used the new `WithAddress` instead of `WithEndpoint`. (#1513) +- The otel-collector example now uses the default OTLP receiver port of the collector. + +## [0.16.0] - 2021-01-13 + +### Added + +- Add the `ReadOnlySpan` and `ReadWriteSpan` interfaces to provide better control for accessing span data. (#1360) +- `NewGRPCDriver` function returns a `ProtocolDriver` that maintains a single gRPC connection to the collector. (#1369) +- Added documentation about the project's versioning policy. (#1388) +- Added `NewSplitDriver` for OTLP exporter that allows sending traces and metrics to different endpoints. (#1418) +- Added codeql workflow to GitHub Actions (#1428) +- Added Gosec workflow to GitHub Actions (#1429) +- Add new HTTP driver for OTLP exporter in `exporters/otlp/otlphttp`. Currently it only supports the binary protobuf payloads. (#1420) +- Add an OpenCensus exporter bridge. (#1444) + +### Changed + +- Rename `internal/testing` to `internal/internaltest`. (#1449) +- Rename `export.SpanData` to `export.SpanSnapshot` and use it only for exporting spans. (#1360) +- Store the parent's full `SpanContext` rather than just its span ID in the `span` struct. (#1360) +- Improve span duration accuracy. (#1360) +- Migrated CI/CD from CircleCI to GitHub Actions (#1382) +- Remove duplicate checkout from GitHub Actions workflow (#1407) +- Metric `array` aggregator renamed `exact` to match its `aggregation.Kind` (#1412) +- Metric `exact` aggregator includes per-point timestamps (#1412) +- Metric stdout exporter uses MinMaxSumCount aggregator for ValueRecorder instruments (#1412) +- `NewExporter` from `exporters/otlp` now takes a `ProtocolDriver` as a parameter. (#1369) +- Many OTLP Exporter options became gRPC ProtocolDriver options. (#1369) +- Unify endpoint API that related to OTel exporter. (#1401) +- Optimize metric histogram aggregator to re-use its slice of buckets. (#1435) +- Metric aggregator Count() and histogram Bucket.Counts are consistently `uint64`. (1430) +- Histogram aggregator accepts functional options, uses default boundaries if none given. (#1434) +- `SamplingResult` now passed a `Tracestate` from the parent `SpanContext` (#1432) +- Moved gRPC driver for OTLP exporter to `exporters/otlp/otlpgrpc`. (#1420) +- The `TraceContext` propagator now correctly propagates `TraceState` through the `SpanContext`. (#1447) +- Metric Push and Pull Controller components are combined into a single "basic" Controller: + - `WithExporter()` and `Start()` to configure Push behavior + - `Start()` is optional; use `Collect()` and `ForEach()` for Pull behavior + - `Start()` and `Stop()` accept Context. (#1378) +- The `Event` type is moved from the `otel/sdk/export/trace` package to the `otel/trace` API package. (#1452) + +### Removed + +- Remove `errUninitializedSpan` as its only usage is now obsolete. (#1360) +- Remove Metric export functionality related to quantiles and summary data points: this is not specified (#1412) +- Remove DDSketch metric aggregator; our intention is to re-introduce this as an option of the histogram aggregator after [new OTLP histogram data types](https://github.com/open-telemetry/opentelemetry-proto/pull/226) are released (#1412) + +### Fixed + +- `BatchSpanProcessor.Shutdown()` will now shutdown underlying `export.SpanExporter`. (#1443) + +## [0.15.0] - 2020-12-10 + +### Added + +- The `WithIDGenerator` `TracerProviderOption` is added to the `go.opentelemetry.io/otel/trace` package to configure an `IDGenerator` for the `TracerProvider`. (#1363) + +### Changed + +- The Zipkin exporter now uses the Span status code to determine. (#1328) +- `NewExporter` and `Start` functions in `go.opentelemetry.io/otel/exporters/otlp` now receive `context.Context` as a first parameter. (#1357) +- Move the OpenCensus example into `example` directory. (#1359) +- Moved the SDK's `internal.IDGenerator` interface in to the `sdk/trace` package to enable support for externally-defined ID generators. (#1363) +- Bump `github.com/google/go-cmp` from 0.5.3 to 0.5.4 (#1374) +- Bump `github.com/golangci/golangci-lint` in `/internal/tools` (#1375) + +### Fixed + +- Metric SDK `SumObserver` and `UpDownSumObserver` instruments correctness fixes. (#1381) + +## [0.14.0] - 2020-11-19 + +### Added + +- An `EventOption` and the related `NewEventConfig` function are added to the `go.opentelemetry.io/otel` package to configure Span events. (#1254) +- A `TextMapPropagator` and associated `TextMapCarrier` are added to the `go.opentelemetry.io/otel/oteltest` package to test `TextMap` type propagators and their use. (#1259) +- `SpanContextFromContext` returns `SpanContext` from context. (#1255) +- `TraceState` has been added to `SpanContext`. (#1340) +- `DeploymentEnvironmentKey` added to `go.opentelemetry.io/otel/semconv` package. (#1323) +- Add an OpenCensus to OpenTelemetry tracing bridge. (#1305) +- Add a parent context argument to `SpanProcessor.OnStart` to follow the specification. (#1333) +- Add missing tests for `sdk/trace/attributes_map.go`. (#1337) + +### Changed + +- Move the `go.opentelemetry.io/otel/api/trace` package into `go.opentelemetry.io/otel/trace` with the following changes. (#1229) (#1307) + - `ID` has been renamed to `TraceID`. + - `IDFromHex` has been renamed to `TraceIDFromHex`. + - `EmptySpanContext` is removed. +- Move the `go.opentelemetry.io/otel/api/trace/tracetest` package into `go.opentelemetry.io/otel/oteltest`. (#1229) +- OTLP Exporter updates: + - supports OTLP v0.6.0 (#1230, #1354) + - supports configurable aggregation temporality (default: Cumulative, optional: Stateless). (#1296) +- The Sampler is now called on local child spans. (#1233) +- The `Kind` type from the `go.opentelemetry.io/otel/api/metric` package was renamed to `InstrumentKind` to more specifically describe what it is and avoid semantic ambiguity. (#1240) +- The `MetricKind` method of the `Descriptor` type in the `go.opentelemetry.io/otel/api/metric` package was renamed to `Descriptor.InstrumentKind`. + This matches the returned type and fixes misuse of the term metric. (#1240) +- Move test harness from the `go.opentelemetry.io/otel/api/apitest` package into `go.opentelemetry.io/otel/oteltest`. (#1241) +- Move the `go.opentelemetry.io/otel/api/metric/metrictest` package into `go.opentelemetry.io/oteltest` as part of #964. (#1252) +- Move the `go.opentelemetry.io/otel/api/metric` package into `go.opentelemetry.io/otel/metric` as part of #1303. (#1321) +- Move the `go.opentelemetry.io/otel/api/metric/registry` package into `go.opentelemetry.io/otel/metric/registry` as a part of #1303. (#1316) +- Move the `Number` type (together with related functions) from `go.opentelemetry.io/otel/api/metric` package into `go.opentelemetry.io/otel/metric/number` as a part of #1303. (#1316) +- The function signature of the Span `AddEvent` method in `go.opentelemetry.io/otel` is updated to no longer take an unused context and instead take a required name and a variable number of `EventOption`s. (#1254) +- The function signature of the Span `RecordError` method in `go.opentelemetry.io/otel` is updated to no longer take an unused context and instead take a required error value and a variable number of `EventOption`s. (#1254) +- Move the `go.opentelemetry.io/otel/api/global` package to `go.opentelemetry.io/otel`. (#1262) (#1330) +- Move the `Version` function from `go.opentelemetry.io/otel/sdk` to `go.opentelemetry.io/otel`. (#1330) +- Rename correlation context header from `"otcorrelations"` to `"baggage"` to match the OpenTelemetry specification. (#1267) +- Fix `Code.UnmarshalJSON` to work with valid JSON only. (#1276) +- The `resource.New()` method changes signature to support builtin attributes and functional options, including `telemetry.sdk.*` and + `host.name` semantic conventions; the former method is renamed `resource.NewWithAttributes`. (#1235) +- The Prometheus exporter now exports non-monotonic counters (i.e. `UpDownCounter`s) as gauges. (#1210) +- Correct the `Span.End` method documentation in the `otel` API to state updates are not allowed on a span after it has ended. (#1310) +- Updated span collection limits for attribute, event and link counts to 1000 (#1318) +- Renamed `semconv.HTTPUrlKey` to `semconv.HTTPURLKey`. (#1338) + +### Removed + +- The `ErrInvalidHexID`, `ErrInvalidTraceIDLength`, `ErrInvalidSpanIDLength`, `ErrInvalidSpanIDLength`, or `ErrNilSpanID` from the `go.opentelemetry.io/otel` package are unexported now. (#1243) +- The `AddEventWithTimestamp` method on the `Span` interface in `go.opentelemetry.io/otel` is removed due to its redundancy. + It is replaced by using the `AddEvent` method with a `WithTimestamp` option. (#1254) +- The `MockSpan` and `MockTracer` types are removed from `go.opentelemetry.io/otel/oteltest`. + `Tracer` and `Span` from the same module should be used in their place instead. (#1306) +- `WorkerCount` option is removed from `go.opentelemetry.io/otel/exporters/otlp`. (#1350) +- Remove the following labels types: INT32, UINT32, UINT64 and FLOAT32. (#1314) + +### Fixed + +- Rename `MergeItererator` to `MergeIterator` in the `go.opentelemetry.io/otel/label` package. (#1244) +- The `go.opentelemetry.io/otel/api/global` packages global TextMapPropagator now delegates functionality to a globally set delegate for all previously returned propagators. (#1258) +- Fix condition in `label.Any`. (#1299) +- Fix global `TracerProvider` to pass options to its configured provider. (#1329) +- Fix missing handler for `ExactKind` aggregator in OTLP metrics transformer (#1309) + +## [0.13.0] - 2020-10-08 + +### Added + +- OTLP Metric exporter supports Histogram aggregation. (#1209) +- The `Code` struct from the `go.opentelemetry.io/otel/codes` package now supports JSON marshaling and unmarshaling as well as implements the `Stringer` interface. (#1214) +- A Baggage API to implement the OpenTelemetry specification. (#1217) +- Add Shutdown method to sdk/trace/provider, shutdown processors in the order they were registered. (#1227) + +### Changed + +- Set default propagator to no-op propagator. (#1184) +- The `HTTPSupplier`, `HTTPExtractor`, `HTTPInjector`, and `HTTPPropagator` from the `go.opentelemetry.io/otel/api/propagation` package were replaced with unified `TextMapCarrier` and `TextMapPropagator` in the `go.opentelemetry.io/otel/propagation` package. (#1212) (#1325) +- The `New` function from the `go.opentelemetry.io/otel/api/propagation` package was replaced with `NewCompositeTextMapPropagator` in the `go.opentelemetry.io/otel` package. (#1212) +- The status codes of the `go.opentelemetry.io/otel/codes` package have been updated to match the latest OpenTelemetry specification. + They now are `Unset`, `Error`, and `Ok`. + They no longer track the gRPC codes. (#1214) +- The `StatusCode` field of the `SpanData` struct in the `go.opentelemetry.io/otel/sdk/export/trace` package now uses the codes package from this package instead of the gRPC project. (#1214) +- Move the `go.opentelemetry.io/otel/api/baggage` package into `go.opentelemetry.io/otel/baggage`. (#1217) (#1325) +- A `Shutdown` method of `SpanProcessor` and all its implementations receives a context and returns an error. (#1264) + +### Fixed + +- Copies of data from arrays and slices passed to `go.opentelemetry.io/otel/label.ArrayValue()` are now used in the returned `Value` instead of using the mutable data itself. (#1226) + +### Removed + +- The `ExtractHTTP` and `InjectHTTP` functions from the `go.opentelemetry.io/otel/api/propagation` package were removed. (#1212) +- The `Propagators` interface from the `go.opentelemetry.io/otel/api/propagation` package was removed to conform to the OpenTelemetry specification. + The explicit `TextMapPropagator` type can be used in its place as this is the `Propagator` type the specification defines. (#1212) +- The `SetAttribute` method of the `Span` from the `go.opentelemetry.io/otel/api/trace` package was removed given its redundancy with the `SetAttributes` method. (#1216) +- The internal implementation of Baggage storage is removed in favor of using the new Baggage API functionality. (#1217) +- Remove duplicate hostname key `HostHostNameKey` in Resource semantic conventions. (#1219) +- Nested array/slice support has been removed. (#1226) + +## [0.12.0] - 2020-09-24 + +### Added + +- A `SpanConfigure` function in `go.opentelemetry.io/otel/api/trace` to create a new `SpanConfig` from `SpanOption`s. (#1108) +- In the `go.opentelemetry.io/otel/api/trace` package, `NewTracerConfig` was added to construct new `TracerConfig`s. + This addition was made to conform with our project option conventions. (#1155) +- Instrumentation library information was added to the Zipkin exporter. (#1119) +- The `SpanProcessor` interface now has a `ForceFlush()` method. (#1166) +- More semantic conventions for k8s as resource attributes. (#1167) + +### Changed + +- Add reconnecting udp connection type to Jaeger exporter. + This change adds a new optional implementation of the udp conn interface used to detect changes to an agent's host dns record. + It then adopts the new destination address to ensure the exporter doesn't get stuck. This change was ported from jaegertracing/jaeger-client-go#520. (#1063) +- Replace `StartOption` and `EndOption` in `go.opentelemetry.io/otel/api/trace` with `SpanOption`. + This change is matched by replacing the `StartConfig` and `EndConfig` with a unified `SpanConfig`. (#1108) +- Replace the `LinkedTo` span option in `go.opentelemetry.io/otel/api/trace` with `WithLinks`. + This is be more consistent with our other option patterns, i.e. passing the item to be configured directly instead of its component parts, and provides a cleaner function signature. (#1108) +- The `go.opentelemetry.io/otel/api/trace` `TracerOption` was changed to an interface to conform to project option conventions. (#1109) +- Move the `B3` and `TraceContext` from within the `go.opentelemetry.io/otel/api/trace` package to their own `go.opentelemetry.io/otel/propagators` package. + This removal of the propagators is reflective of the OpenTelemetry specification for these propagators as well as cleans up the `go.opentelemetry.io/otel/api/trace` API. (#1118) +- Rename Jaeger tags used for instrumentation library information to reflect changes in OpenTelemetry specification. (#1119) +- Rename `ProbabilitySampler` to `TraceIDRatioBased` and change semantics to ignore parent span sampling status. (#1115) +- Move `tools` package under `internal`. (#1141) +- Move `go.opentelemetry.io/otel/api/correlation` package to `go.opentelemetry.io/otel/api/baggage`. (#1142) + The `correlation.CorrelationContext` propagator has been renamed `baggage.Baggage`. Other exported functions and types are unchanged. +- Rename `ParentOrElse` sampler to `ParentBased` and allow setting samplers depending on parent span. (#1153) +- In the `go.opentelemetry.io/otel/api/trace` package, `SpanConfigure` was renamed to `NewSpanConfig`. (#1155) +- Change `dependabot.yml` to add a `Skip Changelog` label to dependabot-sourced PRs. (#1161) +- The [configuration style guide](https://github.com/open-telemetry/opentelemetry-go/blob/master/CONTRIBUTING.md#config) has been updated to + recommend the use of `newConfig()` instead of `configure()`. (#1163) +- The `otlp.Config` type has been unexported and changed to `otlp.config`, along with its initializer. (#1163) +- Ensure exported interface types include parameter names and update the + Style Guide to reflect this styling rule. (#1172) +- Don't consider unset environment variable for resource detection to be an error. (#1170) +- Rename `go.opentelemetry.io/otel/api/metric.ConfigureInstrument` to `NewInstrumentConfig` and + `go.opentelemetry.io/otel/api/metric.ConfigureMeter` to `NewMeterConfig`. +- ValueObserver instruments use LastValue aggregator by default. (#1165) +- OTLP Metric exporter supports LastValue aggregation. (#1165) +- Move the `go.opentelemetry.io/otel/api/unit` package to `go.opentelemetry.io/otel/unit`. (#1185) +- Rename `Provider` to `MeterProvider` in the `go.opentelemetry.io/otel/api/metric` package. (#1190) +- Rename `NoopProvider` to `NoopMeterProvider` in the `go.opentelemetry.io/otel/api/metric` package. (#1190) +- Rename `NewProvider` to `NewMeterProvider` in the `go.opentelemetry.io/otel/api/metric/metrictest` package. (#1190) +- Rename `Provider` to `MeterProvider` in the `go.opentelemetry.io/otel/api/metric/registry` package. (#1190) +- Rename `NewProvider` to `NewMeterProvider` in the `go.opentelemetry.io/otel/api/metri/registryc` package. (#1190) +- Rename `Provider` to `TracerProvider` in the `go.opentelemetry.io/otel/api/trace` package. (#1190) +- Rename `NoopProvider` to `NoopTracerProvider` in the `go.opentelemetry.io/otel/api/trace` package. (#1190) +- Rename `Provider` to `TracerProvider` in the `go.opentelemetry.io/otel/api/trace/tracetest` package. (#1190) +- Rename `NewProvider` to `NewTracerProvider` in the `go.opentelemetry.io/otel/api/trace/tracetest` package. (#1190) +- Rename `WrapperProvider` to `WrapperTracerProvider` in the `go.opentelemetry.io/otel/bridge/opentracing` package. (#1190) +- Rename `NewWrapperProvider` to `NewWrapperTracerProvider` in the `go.opentelemetry.io/otel/bridge/opentracing` package. (#1190) +- Rename `Provider` method of the pull controller to `MeterProvider` in the `go.opentelemetry.io/otel/sdk/metric/controller/pull` package. (#1190) +- Rename `Provider` method of the push controller to `MeterProvider` in the `go.opentelemetry.io/otel/sdk/metric/controller/push` package. (#1190) +- Rename `ProviderOptions` to `TracerProviderConfig` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Rename `ProviderOption` to `TracerProviderOption` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Rename `Provider` to `TracerProvider` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Rename `NewProvider` to `NewTracerProvider` in the `go.opentelemetry.io/otel/sdk/trace` package. (#1190) +- Renamed `SamplingDecision` values to comply with OpenTelemetry specification change. (#1192) +- Renamed Zipkin attribute names from `ot.status_code & ot.status_description` to `otel.status_code & otel.status_description`. (#1201) +- The default SDK now invokes registered `SpanProcessor`s in the order they were registered with the `TracerProvider`. (#1195) +- Add test of spans being processed by the `SpanProcessor`s in the order they were registered. (#1203) + +### Removed + +- Remove the B3 propagator from `go.opentelemetry.io/otel/propagators`. It is now located in the + `go.opentelemetry.io/contrib/propagators/` module. (#1191) +- Remove the semantic convention for HTTP status text, `HTTPStatusTextKey` from package `go.opentelemetry.io/otel/semconv`. (#1194) + +### Fixed + +- Zipkin example no longer mentions `ParentSampler`, corrected to `ParentBased`. (#1171) +- Fix missing shutdown processor in otel-collector example. (#1186) +- Fix missing shutdown processor in basic and namedtracer examples. (#1197) + +## [0.11.0] - 2020-08-24 + +### Added + +- Support for exporting array-valued attributes via OTLP. (#992) +- `Noop` and `InMemory` `SpanBatcher` implementations to help with testing integrations. (#994) +- Support for filtering metric label sets. (#1047) +- A dimensionality-reducing metric Processor. (#1057) +- Integration tests for more OTel Collector Attribute types. (#1062) +- A new `WithSpanProcessor` `ProviderOption` is added to the `go.opentelemetry.io/otel/sdk/trace` package to create a `Provider` and automatically register the `SpanProcessor`. (#1078) + +### Changed + +- Rename `sdk/metric/processor/test` to `sdk/metric/processor/processortest`. (#1049) +- Rename `sdk/metric/controller/test` to `sdk/metric/controller/controllertest`. (#1049) +- Rename `api/testharness` to `api/apitest`. (#1049) +- Rename `api/trace/testtrace` to `api/trace/tracetest`. (#1049) +- Change Metric Processor to merge multiple observations. (#1024) +- The `go.opentelemetry.io/otel/bridge/opentracing` bridge package has been made into its own module. + This removes the package dependencies of this bridge from the rest of the OpenTelemetry based project. (#1038) +- Renamed `go.opentelemetry.io/otel/api/standard` package to `go.opentelemetry.io/otel/semconv` to avoid the ambiguous and generic name `standard` and better describe the package as containing OpenTelemetry semantic conventions. (#1016) +- The environment variable used for resource detection has been changed from `OTEL_RESOURCE_LABELS` to `OTEL_RESOURCE_ATTRIBUTES` (#1042) +- Replace `WithSyncer` with `WithBatcher` in examples. (#1044) +- Replace the `google.golang.org/grpc/codes` dependency in the API with an equivalent `go.opentelemetry.io/otel/codes` package. (#1046) +- Merge the `go.opentelemetry.io/otel/api/label` and `go.opentelemetry.io/otel/api/kv` into the new `go.opentelemetry.io/otel/label` package. (#1060) +- Unify Callback Function Naming. + Rename `*Callback` with `*Func`. (#1061) +- CI builds validate against last two versions of Go, dropping 1.13 and adding 1.15. (#1064) +- The `go.opentelemetry.io/otel/sdk/export/trace` interfaces `SpanSyncer` and `SpanBatcher` have been replaced with a specification compliant `Exporter` interface. + This interface still supports the export of `SpanData`, but only as a slice. + Implementation are also required now to return any error from `ExportSpans` if one occurs as well as implement a `Shutdown` method for exporter clean-up. (#1078) +- The `go.opentelemetry.io/otel/sdk/trace` `NewBatchSpanProcessor` function no longer returns an error. + If a `nil` exporter is passed as an argument to this function, instead of it returning an error, it now returns a `BatchSpanProcessor` that handles the export of `SpanData` by not taking any action. (#1078) +- The `go.opentelemetry.io/otel/sdk/trace` `NewProvider` function to create a `Provider` no longer returns an error, instead only a `*Provider`. + This change is related to `NewBatchSpanProcessor` not returning an error which was the only error this function would return. (#1078) + +### Removed + +- Duplicate, unused API sampler interface. (#999) + Use the [`Sampler` interface](https://github.com/open-telemetry/opentelemetry-go/blob/v0.11.0/sdk/trace/sampling.go) provided by the SDK instead. +- The `grpctrace` instrumentation was moved to the `go.opentelemetry.io/contrib` repository and out of this repository. + This move includes moving the `grpc` example to the `go.opentelemetry.io/contrib` as well. (#1027) +- The `WithSpan` method of the `Tracer` interface. + The functionality this method provided was limited compared to what a user can provide themselves. + It was removed with the understanding that if there is sufficient user need it can be added back based on actual user usage. (#1043) +- The `RegisterSpanProcessor` and `UnregisterSpanProcessor` functions. + These were holdovers from an approach prior to the TracerProvider design. They were not used anymore. (#1077) +- The `oterror` package. (#1026) +- The `othttp` and `httptrace` instrumentations were moved to `go.opentelemetry.io/contrib`. (#1032) + +### Fixed + +- The `semconv.HTTPServerMetricAttributesFromHTTPRequest()` function no longer generates the high-cardinality `http.request.content.length` label. (#1031) +- Correct instrumentation version tag in Jaeger exporter. (#1037) +- The SDK span will now set an error event if the `End` method is called during a panic (i.e. it was deferred). (#1043) +- Move internally generated protobuf code from the `go.opentelemetry.io/otel` to the OTLP exporter to reduce dependency overhead. (#1050) +- The `otel-collector` example referenced outdated collector processors. (#1006) + +## [0.10.0] - 2020-07-29 + +This release migrates the default OpenTelemetry SDK into its own Go module, decoupling the SDK from the API and reducing dependencies for instrumentation packages. + +### Added + +- The Zipkin exporter now has `NewExportPipeline` and `InstallNewPipeline` constructor functions to match the common pattern. + These function build a new exporter with default SDK options and register the exporter with the `global` package respectively. (#944) +- Add propagator option for gRPC instrumentation. (#986) +- The `testtrace` package now tracks the `trace.SpanKind` for each span. (#987) + +### Changed + +- Replace the `RegisterGlobal` `Option` in the Jaeger exporter with an `InstallNewPipeline` constructor function. + This matches the other exporter constructor patterns and will register a new exporter after building it with default configuration. (#944) +- The trace (`go.opentelemetry.io/otel/exporters/trace/stdout`) and metric (`go.opentelemetry.io/otel/exporters/metric/stdout`) `stdout` exporters are now merged into a single exporter at `go.opentelemetry.io/otel/exporters/stdout`. + This new exporter was made into its own Go module to follow the pattern of all exporters and decouple it from the `go.opentelemetry.io/otel` module. (#956, #963) +- Move the `go.opentelemetry.io/otel/exporters/test` test package to `go.opentelemetry.io/otel/sdk/export/metric/metrictest`. (#962) +- The `go.opentelemetry.io/otel/api/kv/value` package was merged into the parent `go.opentelemetry.io/otel/api/kv` package. (#968) + - `value.Bool` was replaced with `kv.BoolValue`. + - `value.Int64` was replaced with `kv.Int64Value`. + - `value.Uint64` was replaced with `kv.Uint64Value`. + - `value.Float64` was replaced with `kv.Float64Value`. + - `value.Int32` was replaced with `kv.Int32Value`. + - `value.Uint32` was replaced with `kv.Uint32Value`. + - `value.Float32` was replaced with `kv.Float32Value`. + - `value.String` was replaced with `kv.StringValue`. + - `value.Int` was replaced with `kv.IntValue`. + - `value.Uint` was replaced with `kv.UintValue`. + - `value.Array` was replaced with `kv.ArrayValue`. +- Rename `Infer` to `Any` in the `go.opentelemetry.io/otel/api/kv` package. (#972) +- Change `othttp` to use the `httpsnoop` package to wrap the `ResponseWriter` so that optional interfaces (`http.Hijacker`, `http.Flusher`, etc.) that are implemented by the original `ResponseWriter`are also implemented by the wrapped `ResponseWriter`. (#979) +- Rename `go.opentelemetry.io/otel/sdk/metric/aggregator/test` package to `go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest`. (#980) +- Make the SDK into its own Go module called `go.opentelemetry.io/otel/sdk`. (#985) +- Changed the default trace `Sampler` from `AlwaysOn` to `ParentOrElse(AlwaysOn)`. (#989) + +### Removed + +- The `IndexedAttribute` function from the `go.opentelemetry.io/otel/api/label` package was removed in favor of `IndexedLabel` which it was synonymous with. (#970) + +### Fixed + +- Bump github.com/golangci/golangci-lint from 1.28.3 to 1.29.0 in /tools. (#953) +- Bump github.com/google/go-cmp from 0.5.0 to 0.5.1. (#957) +- Use `global.Handle` for span export errors in the OTLP exporter. (#946) +- Correct Go language formatting in the README documentation. (#961) +- Remove default SDK dependencies from the `go.opentelemetry.io/otel/api` package. (#977) +- Remove default SDK dependencies from the `go.opentelemetry.io/otel/instrumentation` package. (#983) +- Move documented examples for `go.opentelemetry.io/otel/instrumentation/grpctrace` interceptors into Go example tests. (#984) + +## [0.9.0] - 2020-07-20 + +### Added + +- A new Resource Detector interface is included to allow resources to be automatically detected and included. (#939) +- A Detector to automatically detect resources from an environment variable. (#939) +- Github action to generate protobuf Go bindings locally in `internal/opentelemetry-proto-gen`. (#938) +- OTLP .proto files from `open-telemetry/opentelemetry-proto` imported as a git submodule under `internal/opentelemetry-proto`. + References to `github.com/open-telemetry/opentelemetry-proto` changed to `go.opentelemetry.io/otel/internal/opentelemetry-proto-gen`. (#942) + +### Changed + +- Non-nil value `struct`s for key-value pairs will be marshalled using JSON rather than `Sprintf`. (#948) + +### Removed + +- Removed dependency on `github.com/open-telemetry/opentelemetry-collector`. (#943) + +## [0.8.0] - 2020-07-09 + +### Added + +- The `B3Encoding` type to represent the B3 encoding(s) the B3 propagator can inject. + A value for HTTP supported encodings (Multiple Header: `MultipleHeader`, Single Header: `SingleHeader`) are included. (#882) +- The `FlagsDeferred` trace flag to indicate if the trace sampling decision has been deferred. (#882) +- The `FlagsDebug` trace flag to indicate if the trace is a debug trace. (#882) +- Add `peer.service` semantic attribute. (#898) +- Add database-specific semantic attributes. (#899) +- Add semantic convention for `faas.coldstart` and `container.id`. (#909) +- Add http content size semantic conventions. (#905) +- Include `http.request_content_length` in HTTP request basic attributes. (#905) +- Add semantic conventions for operating system process resource attribute keys. (#919) +- The Jaeger exporter now has a `WithBatchMaxCount` option to specify the maximum number of spans sent in a batch. (#931) + +### Changed + +- Update `CONTRIBUTING.md` to ask for updates to `CHANGELOG.md` with each pull request. (#879) +- Use lowercase header names for B3 Multiple Headers. (#881) +- The B3 propagator `SingleHeader` field has been replaced with `InjectEncoding`. + This new field can be set to combinations of the `B3Encoding` bitmasks and will inject trace information in these encodings. + If no encoding is set, the propagator will default to `MultipleHeader` encoding. (#882) +- The B3 propagator now extracts from either HTTP encoding of B3 (Single Header or Multiple Header) based on what is contained in the header. + Preference is given to Single Header encoding with Multiple Header being the fallback if Single Header is not found or is invalid. + This behavior change is made to dynamically support all correctly encoded traces received instead of having to guess the expected encoding prior to receiving. (#882) +- Extend semantic conventions for RPC. (#900) +- To match constant naming conventions in the `api/standard` package, the `FaaS*` key names are appended with a suffix of `Key`. (#920) + - `"api/standard".FaaSName` -> `FaaSNameKey` + - `"api/standard".FaaSID` -> `FaaSIDKey` + - `"api/standard".FaaSVersion` -> `FaaSVersionKey` + - `"api/standard".FaaSInstance` -> `FaaSInstanceKey` + +### Removed + +- The `FlagsUnused` trace flag is removed. + The purpose of this flag was to act as the inverse of `FlagsSampled`, the inverse of `FlagsSampled` is used instead. (#882) +- The B3 header constants (`B3SingleHeader`, `B3DebugFlagHeader`, `B3TraceIDHeader`, `B3SpanIDHeader`, `B3SampledHeader`, `B3ParentSpanIDHeader`) are removed. + If B3 header keys are needed [the authoritative OpenZipkin package constants](https://pkg.go.dev/github.com/openzipkin/zipkin-go@v0.2.2/propagation/b3?tab=doc#pkg-constants) should be used instead. (#882) + +### Fixed + +- The B3 Single Header name is now correctly `b3` instead of the previous `X-B3`. (#881) +- The B3 propagator now correctly supports sampling only values (`b3: 0`, `b3: 1`, or `b3: d`) for a Single B3 Header. (#882) +- The B3 propagator now propagates the debug flag. + This removes the behavior of changing the debug flag into a set sampling bit. + Instead, this now follow the B3 specification and omits the `X-B3-Sampling` header. (#882) +- The B3 propagator now tracks "unset" sampling state (meaning "defer the decision") and does not set the `X-B3-Sampling` header when injecting. (#882) +- Bump github.com/itchyny/gojq from 0.10.3 to 0.10.4 in /tools. (#883) +- Bump github.com/opentracing/opentracing-go from v1.1.1-0.20190913142402-a7454ce5950e to v1.2.0. (#885) +- The tracing time conversion for OTLP spans is now correctly set to `UnixNano`. (#896) +- Ensure span status is not set to `Unknown` when no HTTP status code is provided as it is assumed to be `200 OK`. (#908) +- Ensure `httptrace.clientTracer` closes `http.headers` span. (#912) +- Prometheus exporter will not apply stale updates or forget inactive metrics. (#903) +- Add test for api.standard `HTTPClientAttributesFromHTTPRequest`. (#905) +- Bump github.com/golangci/golangci-lint from 1.27.0 to 1.28.1 in /tools. (#901, #913) +- Update otel-colector example to use the v0.5.0 collector. (#915) +- The `grpctrace` instrumentation uses a span name conforming to the OpenTelemetry semantic conventions (does not contain a leading slash (`/`)). (#922) +- The `grpctrace` instrumentation includes an `rpc.method` attribute now set to the gRPC method name. (#900, #922) +- The `grpctrace` instrumentation `rpc.service` attribute now contains the package name if one exists. + This is in accordance with OpenTelemetry semantic conventions. (#922) +- Correlation Context extractor will no longer insert an empty map into the returned context when no valid values are extracted. (#923) +- Bump google.golang.org/api from 0.28.0 to 0.29.0 in /exporters/trace/jaeger. (#925) +- Bump github.com/itchyny/gojq from 0.10.4 to 0.11.0 in /tools. (#926) +- Bump github.com/golangci/golangci-lint from 1.28.1 to 1.28.2 in /tools. (#930) + +## [0.7.0] - 2020-06-26 + +This release implements the v0.5.0 version of the OpenTelemetry specification. + +### Added + +- The othttp instrumentation now includes default metrics. (#861) +- This CHANGELOG file to track all changes in the project going forward. +- Support for array type attributes. (#798) +- Apply transitive dependabot go.mod dependency updates as part of a new automatic Github workflow. (#844) +- Timestamps are now passed to exporters for each export. (#835) +- Add new `Accumulation` type to metric SDK to transport telemetry from `Accumulator`s to `Processor`s. + This replaces the prior `Record` `struct` use for this purpose. (#835) +- New dependabot integration to automate package upgrades. (#814) +- `Meter` and `Tracer` implementations accept instrumentation version version as an optional argument. + This instrumentation version is passed on to exporters. (#811) (#805) (#802) +- The OTLP exporter includes the instrumentation version in telemetry it exports. (#811) +- Environment variables for Jaeger exporter are supported. (#796) +- New `aggregation.Kind` in the export metric API. (#808) +- New example that uses OTLP and the collector. (#790) +- Handle errors in the span `SetName` during span initialization. (#791) +- Default service config to enable retries for retry-able failed requests in the OTLP exporter and an option to override this default. (#777) +- New `go.opentelemetry.io/otel/api/oterror` package to uniformly support error handling and definitions for the project. (#778) +- New `global` default implementation of the `go.opentelemetry.io/otel/api/oterror.Handler` interface to be used to handle errors prior to an user defined `Handler`. + There is also functionality for the user to register their `Handler` as well as a convenience function `Handle` to handle an error with this global `Handler`(#778) +- Options to specify propagators for httptrace and grpctrace instrumentation. (#784) +- The required `application/json` header for the Zipkin exporter is included in all exports. (#774) +- Integrate HTTP semantics helpers from the contrib repository into the `api/standard` package. #769 + +### Changed + +- Rename `Integrator` to `Processor` in the metric SDK. (#863) +- Rename `AggregationSelector` to `AggregatorSelector`. (#859) +- Rename `SynchronizedCopy` to `SynchronizedMove`. (#858) +- Rename `simple` integrator to `basic` integrator. (#857) +- Merge otlp collector examples. (#841) +- Change the metric SDK to support cumulative, delta, and pass-through exporters directly. + With these changes, cumulative and delta specific exporters are able to request the correct kind of aggregation from the SDK. (#840) +- The `Aggregator.Checkpoint` API is renamed to `SynchronizedCopy` and adds an argument, a different `Aggregator` into which the copy is stored. (#812) +- The `export.Aggregator` contract is that `Update()` and `SynchronizedCopy()` are synchronized with each other. + All the aggregation interfaces (`Sum`, `LastValue`, ...) are not meant to be synchronized, as the caller is expected to synchronize aggregators at a higher level after the `Accumulator`. + Some of the `Aggregators` used unnecessary locking and that has been cleaned up. (#812) +- Use of `metric.Number` was replaced by `int64` now that we use `sync.Mutex` in the `MinMaxSumCount` and `Histogram` `Aggregators`. (#812) +- Replace `AlwaysParentSample` with `ParentSample(fallback)` to match the OpenTelemetry v0.5.0 specification. (#810) +- Rename `sdk/export/metric/aggregator` to `sdk/export/metric/aggregation`. #808 +- Send configured headers with every request in the OTLP exporter, instead of just on connection creation. (#806) +- Update error handling for any one off error handlers, replacing, instead, with the `global.Handle` function. (#791) +- Rename `plugin` directory to `instrumentation` to match the OpenTelemetry specification. (#779) +- Makes the argument order to Histogram and DDSketch `New()` consistent. (#781) + +### Removed + +- `Uint64NumberKind` and related functions from the API. (#864) +- Context arguments from `Aggregator.Checkpoint` and `Integrator.Process` as they were unused. (#803) +- `SpanID` is no longer included in parameters for sampling decision to match the OpenTelemetry specification. (#775) + +### Fixed + +- Upgrade OTLP exporter to opentelemetry-proto matching the opentelemetry-collector v0.4.0 release. (#866) +- Allow changes to `go.sum` and `go.mod` when running dependabot tidy-up. (#871) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1. (#824) +- Bump github.com/prometheus/client_golang from 1.7.0 to 1.7.1 in /exporters/metric/prometheus. (#867) +- Bump google.golang.org/grpc from 1.29.1 to 1.30.0 in /exporters/trace/jaeger. (#853) +- Bump google.golang.org/grpc from 1.29.1 to 1.30.0 in /exporters/trace/zipkin. (#854) +- Bumps github.com/golang/protobuf from 1.3.2 to 1.4.2 (#848) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/otlp (#817) +- Bump github.com/golangci/golangci-lint from 1.25.1 to 1.27.0 in /tools (#828) +- Bump github.com/prometheus/client_golang from 1.5.0 to 1.7.0 in /exporters/metric/prometheus (#838) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/trace/jaeger (#829) +- Bump github.com/benbjohnson/clock from 1.0.0 to 1.0.3 (#815) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/trace/zipkin (#823) +- Bump github.com/itchyny/gojq from 0.10.1 to 0.10.3 in /tools (#830) +- Bump github.com/stretchr/testify from 1.4.0 to 1.6.1 in /exporters/metric/prometheus (#822) +- Bump google.golang.org/grpc from 1.27.1 to 1.29.1 in /exporters/trace/zipkin (#820) +- Bump google.golang.org/grpc from 1.27.1 to 1.29.1 in /exporters/trace/jaeger (#831) +- Bump github.com/google/go-cmp from 0.4.0 to 0.5.0 (#836) +- Bump github.com/google/go-cmp from 0.4.0 to 0.5.0 in /exporters/trace/jaeger (#837) +- Bump github.com/google/go-cmp from 0.4.0 to 0.5.0 in /exporters/otlp (#839) +- Bump google.golang.org/api from 0.20.0 to 0.28.0 in /exporters/trace/jaeger (#843) +- Set span status from HTTP status code in the othttp instrumentation. (#832) +- Fixed typo in push controller comment. (#834) +- The `Aggregator` testing has been updated and cleaned. (#812) +- `metric.Number(0)` expressions are replaced by `0` where possible. (#812) +- Fixed `global` `handler_test.go` test failure. #804 +- Fixed `BatchSpanProcessor.Shutdown` to wait until all spans are processed. (#766) +- Fixed OTLP example's accidental early close of exporter. (#807) +- Ensure zipkin exporter reads and closes response body. (#788) +- Update instrumentation to use `api/standard` keys instead of custom keys. (#782) +- Clean up tools and RELEASING documentation. (#762) + +## [0.6.0] - 2020-05-21 + +### Added + +- Support for `Resource`s in the prometheus exporter. (#757) +- New pull controller. (#751) +- New `UpDownSumObserver` instrument. (#750) +- OpenTelemetry collector demo. (#711) +- New `SumObserver` instrument. (#747) +- New `UpDownCounter` instrument. (#745) +- New timeout `Option` and configuration function `WithTimeout` to the push controller. (#742) +- New `api/standards` package to implement semantic conventions and standard key-value generation. (#731) + +### Changed + +- Rename `Register*` functions in the metric API to `New*` for all `Observer` instruments. (#761) +- Use `[]float64` for histogram boundaries, not `[]metric.Number`. (#758) +- Change OTLP example to use exporter as a trace `Syncer` instead of as an unneeded `Batcher`. (#756) +- Replace `WithResourceAttributes()` with `WithResource()` in the trace SDK. (#754) +- The prometheus exporter now uses the new pull controller. (#751) +- Rename `ScheduleDelayMillis` to `BatchTimeout` in the trace `BatchSpanProcessor`.(#752) +- Support use of synchronous instruments in asynchronous callbacks (#725) +- Move `Resource` from the `Export` method parameter into the metric export `Record`. (#739) +- Rename `Observer` instrument to `ValueObserver`. (#734) +- The push controller now has a method (`Provider()`) to return a `metric.Provider` instead of the old `Meter` method that acted as a `metric.Provider`. (#738) +- Replace `Measure` instrument by `ValueRecorder` instrument. (#732) +- Rename correlation context header from `"Correlation-Context"` to `"otcorrelations"` to match the OpenTelemetry specification. (#727) + +### Fixed + +- Ensure gRPC `ClientStream` override methods do not panic in grpctrace package. (#755) +- Disable parts of `BatchSpanProcessor` test until a fix is found. (#743) +- Fix `string` case in `kv` `Infer` function. (#746) +- Fix panic in grpctrace client interceptors. (#740) +- Refactor the `api/metrics` push controller and add `CheckpointSet` synchronization. (#737) +- Rewrite span batch process queue batching logic. (#719) +- Remove the push controller named Meter map. (#738) +- Fix Histogram aggregator initial state (fix #735). (#736) +- Ensure golang alpine image is running `golang-1.14` for examples. (#733) +- Added test for grpctrace `UnaryInterceptorClient`. (#695) +- Rearrange `api/metric` code layout. (#724) + +## [0.5.0] - 2020-05-13 + +### Added + +- Batch `Observer` callback support. (#717) +- Alias `api` types to root package of project. (#696) +- Create basic `othttp.Transport` for simple client instrumentation. (#678) +- `SetAttribute(string, interface{})` to the trace API. (#674) +- Jaeger exporter option that allows user to specify custom http client. (#671) +- `Stringer` and `Infer` methods to `key`s. (#662) + +### Changed + +- Rename `NewKey` in the `kv` package to just `Key`. (#721) +- Move `core` and `key` to `kv` package. (#720) +- Make the metric API `Meter` a `struct` so the abstract `MeterImpl` can be passed and simplify implementation. (#709) +- Rename SDK `Batcher` to `Integrator` to match draft OpenTelemetry SDK specification. (#710) +- Rename SDK `Ungrouped` integrator to `simple.Integrator` to match draft OpenTelemetry SDK specification. (#710) +- Rename SDK `SDK` `struct` to `Accumulator` to match draft OpenTelemetry SDK specification. (#710) +- Move `Number` from `core` to `api/metric` package. (#706) +- Move `SpanContext` from `core` to `trace` package. (#692) +- Change traceparent header from `Traceparent` to `traceparent` to implement the W3C specification. (#681) + +### Fixed + +- Update tooling to run generators in all submodules. (#705) +- gRPC interceptor regexp to match methods without a service name. (#683) +- Use a `const` for padding 64-bit B3 trace IDs. (#701) +- Update `mockZipkin` listen address from `:0` to `127.0.0.1:0`. (#700) +- Left-pad 64-bit B3 trace IDs with zero. (#698) +- Propagate at least the first W3C tracestate header. (#694) +- Remove internal `StateLocker` implementation. (#688) +- Increase instance size CI system uses. (#690) +- Add a `key` benchmark and use reflection in `key.Infer()`. (#679) +- Fix internal `global` test by using `global.Meter` with `RecordBatch()`. (#680) +- Reimplement histogram using mutex instead of `StateLocker`. (#669) +- Switch `MinMaxSumCount` to a mutex lock implementation instead of `StateLocker`. (#667) +- Update documentation to not include any references to `WithKeys`. (#672) +- Correct misspelling. (#668) +- Fix clobbering of the span context if extraction fails. (#656) +- Bump `golangci-lint` and work around the corrupting bug. (#666) (#670) + +## [0.4.3] - 2020-04-24 + +### Added + +- `Dockerfile` and `docker-compose.yml` to run example code. (#635) +- New `grpctrace` package that provides gRPC client and server interceptors for both unary and stream connections. (#621) +- New `api/label` package, providing common label set implementation. (#651) +- Support for JSON marshaling of `Resources`. (#654) +- `TraceID` and `SpanID` implementations for `Stringer` interface. (#642) +- `RemoteAddrKey` in the othttp plugin to include the HTTP client address in top-level spans. (#627) +- `WithSpanFormatter` option to the othttp plugin. (#617) +- Updated README to include section for compatible libraries and include reference to the contrib repository. (#612) +- The prometheus exporter now supports exporting histograms. (#601) +- A `String` method to the `Resource` to return a hashable identifier for a now unique resource. (#613) +- An `Iter` method to the `Resource` to return an array `AttributeIterator`. (#613) +- An `Equal` method to the `Resource` test the equivalence of resources. (#613) +- An iterable structure (`AttributeIterator`) for `Resource` attributes. + +### Changed + +- zipkin export's `NewExporter` now requires a `serviceName` argument to ensure this needed values is provided. (#644) +- Pass `Resources` through the metrics export pipeline. (#659) + +### Removed + +- `WithKeys` option from the metric API. (#639) + +### Fixed + +- Use the `label.Set.Equivalent` value instead of an encoding in the batcher. (#658) +- Correct typo `trace.Exporter` to `trace.SpanSyncer` in comments. (#653) +- Use type names for return values in jaeger exporter. (#648) +- Increase the visibility of the `api/key` package by updating comments and fixing usages locally. (#650) +- `Checkpoint` only after `Update`; Keep records in the `sync.Map` longer. (#647) +- Do not cache `reflect.ValueOf()` in metric Labels. (#649) +- Batch metrics exported from the OTLP exporter based on `Resource` and labels. (#626) +- Add error wrapping to the prometheus exporter. (#631) +- Update the OTLP exporter batching of traces to use a unique `string` representation of an associated `Resource` as the batching key. (#623) +- Update OTLP `SpanData` transform to only include the `ParentSpanID` if one exists. (#614) +- Update `Resource` internal representation to uniquely and reliably identify resources. (#613) +- Check return value from `CheckpointSet.ForEach` in prometheus exporter. (#622) +- Ensure spans created by httptrace client tracer reflect operation structure. (#618) +- Create a new recorder rather than reuse when multiple observations in same epoch for asynchronous instruments. #610 +- The default port the OTLP exporter uses to connect to the OpenTelemetry collector is updated to match the one the collector listens on by default. (#611) + +## [0.4.2] - 2020-03-31 + +### Fixed + +- Fix `pre_release.sh` to update version in `sdk/opentelemetry.go`. (#607) +- Fix time conversion from internal to OTLP in OTLP exporter. (#606) + +## [0.4.1] - 2020-03-31 + +### Fixed + +- Update `tag.sh` to create signed tags. (#604) + +## [0.4.0] - 2020-03-30 + +### Added + +- New API package `api/metric/registry` that exposes a `MeterImpl` wrapper for use by SDKs to generate unique instruments. (#580) +- Script to verify examples after a new release. (#579) + +### Removed + +- The dogstatsd exporter due to lack of support. + This additionally removes support for statsd. (#591) +- `LabelSet` from the metric API. + This is replaced by a `[]core.KeyValue` slice. (#595) +- `Labels` from the metric API's `Meter` interface. (#595) + +### Changed + +- The metric `export.Labels` became an interface which the SDK implements and the `export` package provides a simple, immutable implementation of this interface intended for testing purposes. (#574) +- Renamed `internal/metric.Meter` to `MeterImpl`. (#580) +- Renamed `api/global/internal.obsImpl` to `asyncImpl`. (#580) + +### Fixed + +- Corrected missing return in mock span. (#582) +- Update License header for all source files to match CNCF guidelines and include a test to ensure it is present. (#586) (#596) +- Update to v0.3.0 of the OTLP in the OTLP exporter. (#588) +- Update pre-release script to be compatible between GNU and BSD based systems. (#592) +- Add a `RecordBatch` benchmark. (#594) +- Moved span transforms of the OTLP exporter to the internal package. (#593) +- Build both go-1.13 and go-1.14 in circleci to test for all supported versions of Go. (#569) +- Removed unneeded allocation on empty labels in OLTP exporter. (#597) +- Update `BatchedSpanProcessor` to process the queue until no data but respect max batch size. (#599) +- Update project documentation godoc.org links to pkg.go.dev. (#602) + +## [0.3.0] - 2020-03-21 + +This is a first official beta release, which provides almost fully complete metrics, tracing, and context propagation functionality. +There is still a possibility of breaking changes. + +### Added + +- Add `Observer` metric instrument. (#474) +- Add global `Propagators` functionality to enable deferred initialization for propagators registered before the first Meter SDK is installed. (#494) +- Simplified export setup pipeline for the jaeger exporter to match other exporters. (#459) +- The zipkin trace exporter. (#495) +- The OTLP exporter to export metric and trace telemetry to the OpenTelemetry collector. (#497) (#544) (#545) +- Add `StatusMessage` field to the trace `Span`. (#524) +- Context propagation in OpenTracing bridge in terms of OpenTelemetry context propagation. (#525) +- The `Resource` type was added to the SDK. (#528) +- The global API now supports a `Tracer` and `Meter` function as shortcuts to getting a global `*Provider` and calling these methods directly. (#538) +- The metric API now defines a generic `MeterImpl` interface to support general purpose `Meter` construction. + Additionally, `SyncImpl` and `AsyncImpl` are added to support general purpose instrument construction. (#560) +- A metric `Kind` is added to represent the `MeasureKind`, `ObserverKind`, and `CounterKind`. (#560) +- Scripts to better automate the release process. (#576) + +### Changed + +- Default to to use `AlwaysSampler` instead of `ProbabilitySampler` to match OpenTelemetry specification. (#506) +- Renamed `AlwaysSampleSampler` to `AlwaysOnSampler` in the trace API. (#511) +- Renamed `NeverSampleSampler` to `AlwaysOffSampler` in the trace API. (#511) +- The `Status` field of the `Span` was changed to `StatusCode` to disambiguate with the added `StatusMessage`. (#524) +- Updated the trace `Sampler` interface conform to the OpenTelemetry specification. (#531) +- Rename metric API `Options` to `Config`. (#541) +- Rename metric `Counter` aggregator to be `Sum`. (#541) +- Unify metric options into `Option` from instrument specific options. (#541) +- The trace API's `TraceProvider` now support `Resource`s. (#545) +- Correct error in zipkin module name. (#548) +- The jaeger trace exporter now supports `Resource`s. (#551) +- Metric SDK now supports `Resource`s. + The `WithResource` option was added to configure a `Resource` on creation and the `Resource` method was added to the metric `Descriptor` to return the associated `Resource`. (#552) +- Replace `ErrNoLastValue` and `ErrEmptyDataSet` by `ErrNoData` in the metric SDK. (#557) +- The stdout trace exporter now supports `Resource`s. (#558) +- The metric `Descriptor` is now included at the API instead of the SDK. (#560) +- Replace `Ordered` with an iterator in `export.Labels`. (#567) + +### Removed + +- The vendor specific Stackdriver. It is now hosted on 3rd party vendor infrastructure. (#452) +- The `Unregister` method for metric observers as it is not in the OpenTelemetry specification. (#560) +- `GetDescriptor` from the metric SDK. (#575) +- The `Gauge` instrument from the metric API. (#537) + +### Fixed + +- Make histogram aggregator checkpoint consistent. (#438) +- Update README with import instructions and how to build and test. (#505) +- The default label encoding was updated to be unique. (#508) +- Use `NewRoot` in the othttp plugin for public endpoints. (#513) +- Fix data race in `BatchedSpanProcessor`. (#518) +- Skip test-386 for Mac OS 10.15.x (Catalina and upwards). #521 +- Use a variable-size array to represent ordered labels in maps. (#523) +- Update the OTLP protobuf and update changed import path. (#532) +- Use `StateLocker` implementation in `MinMaxSumCount`. (#546) +- Eliminate goroutine leak in histogram stress test. (#547) +- Update OTLP exporter with latest protobuf. (#550) +- Add filters to the othttp plugin. (#556) +- Provide an implementation of the `Header*` filters that do not depend on Go 1.14. (#565) +- Encode labels once during checkpoint. + The checkpoint function is executed in a single thread so we can do the encoding lazily before passing the encoded version of labels to the exporter. + This is a cheap and quick way to avoid encoding the labels on every collection interval. (#572) +- Run coverage over all packages in `COVERAGE_MOD_DIR`. (#573) + +## [0.2.3] - 2020-03-04 + +### Added + +- `RecordError` method on `Span`s in the trace API to Simplify adding error events to spans. (#473) +- Configurable push frequency for exporters setup pipeline. (#504) + +### Changed + +- Rename the `exporter` directory to `exporters`. + The `go.opentelemetry.io/otel/exporter/trace/jaeger` package was mistakenly released with a `v1.0.0` tag instead of `v0.1.0`. + This resulted in all subsequent releases not becoming the default latest. + A consequence of this was that all `go get`s pulled in the incompatible `v0.1.0` release of that package when pulling in more recent packages from other otel packages. + Renaming the `exporter` directory to `exporters` fixes this issue by renaming the package and therefore clearing any existing dependency tags. + Consequentially, this action also renames *all* exporter packages. (#502) + +### Removed + +- The `CorrelationContextHeader` constant in the `correlation` package is no longer exported. (#503) + +## [0.2.2] - 2020-02-27 + +### Added + +- `HTTPSupplier` interface in the propagation API to specify methods to retrieve and store a single value for a key to be associated with a carrier. (#467) +- `HTTPExtractor` interface in the propagation API to extract information from an `HTTPSupplier` into a context. (#467) +- `HTTPInjector` interface in the propagation API to inject information into an `HTTPSupplier.` (#467) +- `Config` and configuring `Option` to the propagator API. (#467) +- `Propagators` interface in the propagation API to contain the set of injectors and extractors for all supported carrier formats. (#467) +- `HTTPPropagator` interface in the propagation API to inject and extract from an `HTTPSupplier.` (#467) +- `WithInjectors` and `WithExtractors` functions to the propagator API to configure injectors and extractors to use. (#467) +- `ExtractHTTP` and `InjectHTTP` functions to apply configured HTTP extractors and injectors to a passed context. (#467) +- Histogram aggregator. (#433) +- `DefaultPropagator` function and have it return `trace.TraceContext` as the default context propagator. (#456) +- `AlwaysParentSample` sampler to the trace API. (#455) +- `WithNewRoot` option function to the trace API to specify the created span should be considered a root span. (#451) + +### Changed + +- Renamed `WithMap` to `ContextWithMap` in the correlation package. (#481) +- Renamed `FromContext` to `MapFromContext` in the correlation package. (#481) +- Move correlation context propagation to correlation package. (#479) +- Do not default to putting remote span context into links. (#480) +- `Tracer.WithSpan` updated to accept `StartOptions`. (#472) +- Renamed `MetricKind` to `Kind` to not stutter in the type usage. (#432) +- Renamed the `export` package to `metric` to match directory structure. (#432) +- Rename the `api/distributedcontext` package to `api/correlation`. (#444) +- Rename the `api/propagators` package to `api/propagation`. (#444) +- Move the propagators from the `propagators` package into the `trace` API package. (#444) +- Update `Float64Gauge`, `Int64Gauge`, `Float64Counter`, `Int64Counter`, `Float64Measure`, and `Int64Measure` metric methods to use value receivers instead of pointers. (#462) +- Moved all dependencies of tools package to a tools directory. (#466) + +### Removed + +- Binary propagators. (#467) +- NOOP propagator. (#467) + +### Fixed + +- Upgraded `github.com/golangci/golangci-lint` from `v1.21.0` to `v1.23.6` in `tools/`. (#492) +- Fix a possible nil-dereference crash (#478) +- Correct comments for `InstallNewPipeline` in the stdout exporter. (#483) +- Correct comments for `InstallNewPipeline` in the dogstatsd exporter. (#484) +- Correct comments for `InstallNewPipeline` in the prometheus exporter. (#482) +- Initialize `onError` based on `Config` in prometheus exporter. (#486) +- Correct module name in prometheus exporter README. (#475) +- Removed tracer name prefix from span names. (#430) +- Fix `aggregator_test.go` import package comment. (#431) +- Improved detail in stdout exporter. (#436) +- Fix a dependency issue (generate target should depend on stringer, not lint target) in Makefile. (#442) +- Reorders the Makefile targets within `precommit` target so we generate files and build the code before doing linting, so we can get much nicer errors about syntax errors from the compiler. (#442) +- Reword function documentation in gRPC plugin. (#446) +- Send the `span.kind` tag to Jaeger from the jaeger exporter. (#441) +- Fix `metadataSupplier` in the jaeger exporter to overwrite the header if existing instead of appending to it. (#441) +- Upgraded to Go 1.13 in CI. (#465) +- Correct opentelemetry.io URL in trace SDK documentation. (#464) +- Refactored reference counting logic in SDK determination of stale records. (#468) +- Add call to `runtime.Gosched` in instrument `acquireHandle` logic to not block the collector. (#469) + +## [0.2.1.1] - 2020-01-13 + +### Fixed + +- Use stateful batcher on Prometheus exporter fixing regression introduced in #395. (#428) + +## [0.2.1] - 2020-01-08 + +### Added + +- Global meter forwarding implementation. + This enables deferred initialization for metric instruments registered before the first Meter SDK is installed. (#392) +- Global trace forwarding implementation. + This enables deferred initialization for tracers registered before the first Trace SDK is installed. (#406) +- Standardize export pipeline creation in all exporters. (#395) +- A testing, organization, and comments for 64-bit field alignment. (#418) +- Script to tag all modules in the project. (#414) + +### Changed + +- Renamed `propagation` package to `propagators`. (#362) +- Renamed `B3Propagator` propagator to `B3`. (#362) +- Renamed `TextFormatPropagator` propagator to `TextFormat`. (#362) +- Renamed `BinaryPropagator` propagator to `Binary`. (#362) +- Renamed `BinaryFormatPropagator` propagator to `BinaryFormat`. (#362) +- Renamed `NoopTextFormatPropagator` propagator to `NoopTextFormat`. (#362) +- Renamed `TraceContextPropagator` propagator to `TraceContext`. (#362) +- Renamed `SpanOption` to `StartOption` in the trace API. (#369) +- Renamed `StartOptions` to `StartConfig` in the trace API. (#369) +- Renamed `EndOptions` to `EndConfig` in the trace API. (#369) +- `Number` now has a pointer receiver for its methods. (#375) +- Renamed `CurrentSpan` to `SpanFromContext` in the trace API. (#379) +- Renamed `SetCurrentSpan` to `ContextWithSpan` in the trace API. (#379) +- Renamed `Message` in Event to `Name` in the trace API. (#389) +- Prometheus exporter no longer aggregates metrics, instead it only exports them. (#385) +- Renamed `HandleImpl` to `BoundInstrumentImpl` in the metric API. (#400) +- Renamed `Float64CounterHandle` to `Float64CounterBoundInstrument` in the metric API. (#400) +- Renamed `Int64CounterHandle` to `Int64CounterBoundInstrument` in the metric API. (#400) +- Renamed `Float64GaugeHandle` to `Float64GaugeBoundInstrument` in the metric API. (#400) +- Renamed `Int64GaugeHandle` to `Int64GaugeBoundInstrument` in the metric API. (#400) +- Renamed `Float64MeasureHandle` to `Float64MeasureBoundInstrument` in the metric API. (#400) +- Renamed `Int64MeasureHandle` to `Int64MeasureBoundInstrument` in the metric API. (#400) +- Renamed `Release` method for bound instruments in the metric API to `Unbind`. (#400) +- Renamed `AcquireHandle` method for bound instruments in the metric API to `Bind`. (#400) +- Renamed the `File` option in the stdout exporter to `Writer`. (#404) +- Renamed all `Options` to `Config` for all metric exports where this wasn't already the case. + +### Fixed + +- Aggregator import path corrected. (#421) +- Correct links in README. (#368) +- The README was updated to match latest code changes in its examples. (#374) +- Don't capitalize error statements. (#375) +- Fix ignored errors. (#375) +- Fix ambiguous variable naming. (#375) +- Removed unnecessary type casting. (#375) +- Use named parameters. (#375) +- Updated release schedule. (#378) +- Correct http-stackdriver example module name. (#394) +- Removed the `http.request` span in `httptrace` package. (#397) +- Add comments in the metrics SDK (#399) +- Initialize checkpoint when creating ddsketch aggregator to prevent panic when merging into a empty one. (#402) (#403) +- Add documentation of compatible exporters in the README. (#405) +- Typo fix. (#408) +- Simplify span check logic in SDK tracer implementation. (#419) + +## [0.2.0] - 2019-12-03 + +### Added + +- Unary gRPC tracing example. (#351) +- Prometheus exporter. (#334) +- Dogstatsd metrics exporter. (#326) + +### Changed + +- Rename `MaxSumCount` aggregation to `MinMaxSumCount` and add the `Min` interface for this aggregation. (#352) +- Rename `GetMeter` to `Meter`. (#357) +- Rename `HTTPTraceContextPropagator` to `TraceContextPropagator`. (#355) +- Rename `HTTPB3Propagator` to `B3Propagator`. (#355) +- Rename `HTTPTraceContextPropagator` to `TraceContextPropagator`. (#355) +- Move `/global` package to `/api/global`. (#356) +- Rename `GetTracer` to `Tracer`. (#347) + +### Removed + +- `SetAttribute` from the `Span` interface in the trace API. (#361) +- `AddLink` from the `Span` interface in the trace API. (#349) +- `Link` from the `Span` interface in the trace API. (#349) + +### Fixed + +- Exclude example directories from coverage report. (#365) +- Lint make target now implements automatic fixes with `golangci-lint` before a second run to report the remaining issues. (#360) +- Drop `GO111MODULE` environment variable in Makefile as Go 1.13 is the project specified minimum version and this is environment variable is not needed for that version of Go. (#359) +- Run the race checker for all test. (#354) +- Redundant commands in the Makefile are removed. (#354) +- Split the `generate` and `lint` targets of the Makefile. (#354) +- Renames `circle-ci` target to more generic `ci` in Makefile. (#354) +- Add example Prometheus binary to gitignore. (#358) +- Support negative numbers with the `MaxSumCount`. (#335) +- Resolve race conditions in `push_test.go` identified in #339. (#340) +- Use `/usr/bin/env bash` as a shebang in scripts rather than `/bin/bash`. (#336) +- Trace benchmark now tests both `AlwaysSample` and `NeverSample`. + Previously it was testing `AlwaysSample` twice. (#325) +- Trace benchmark now uses a `[]byte` for `TraceID` to fix failing test. (#325) +- Added a trace benchmark to test variadic functions in `setAttribute` vs `setAttributes` (#325) +- The `defaultkeys` batcher was only using the encoded label set as its map key while building a checkpoint. + This allowed distinct label sets through, but any metrics sharing a label set could be overwritten or merged incorrectly. + This was corrected. (#333) + +## [0.1.2] - 2019-11-18 + +### Fixed + +- Optimized the `simplelru` map for attributes to reduce the number of allocations. (#328) +- Removed unnecessary unslicing of parameters that are already a slice. (#324) + +## [0.1.1] - 2019-11-18 + +This release contains a Metrics SDK with stdout exporter and supports basic aggregations such as counter, gauges, array, maxsumcount, and ddsketch. + +### Added + +- Metrics stdout export pipeline. (#265) +- Array aggregation for raw measure metrics. (#282) +- The core.Value now have a `MarshalJSON` method. (#281) + +### Removed + +- `WithService`, `WithResources`, and `WithComponent` methods of tracers. (#314) +- Prefix slash in `Tracer.Start()` for the Jaeger example. (#292) + +### Changed + +- Allocation in LabelSet construction to reduce GC overhead. (#318) +- `trace.WithAttributes` to append values instead of replacing (#315) +- Use a formula for tolerance in sampling tests. (#298) +- Move export types into trace and metric-specific sub-directories. (#289) +- `SpanKind` back to being based on an `int` type. (#288) + +### Fixed + +- URL to OpenTelemetry website in README. (#323) +- Name of othttp default tracer. (#321) +- `ExportSpans` for the stackdriver exporter now handles `nil` context. (#294) +- CI modules cache to correctly restore/save from/to the cache. (#316) +- Fix metric SDK race condition between `LoadOrStore` and the assignment `rec.recorder = i.meter.exporter.AggregatorFor(rec)`. (#293) +- README now reflects the new code structure introduced with these changes. (#291) +- Make the basic example work. (#279) + +## [0.1.0] - 2019-11-04 + +This is the first release of open-telemetry go library. +It contains api and sdk for trace and meter. + +### Added + +- Initial OpenTelemetry trace and metric API prototypes. +- Initial OpenTelemetry trace, metric, and export SDK packages. +- A wireframe bridge to support compatibility with OpenTracing. +- Example code for a basic, http-stackdriver, http, jaeger, and named tracer setup. +- Exporters for Jaeger, Stackdriver, and stdout. +- Propagators for binary, B3, and trace-context protocols. +- Project information and guidelines in the form of a README and CONTRIBUTING. +- Tools to build the project and a Makefile to automate the process. +- Apache-2.0 license. +- CircleCI build CI manifest files. +- CODEOWNERS file to track owners of this project. + +[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.24.0...HEAD +[1.24.0/0.46.0/0.0.1-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.24.0 +[1.23.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.1 +[1.23.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.0 +[1.23.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.0-rc.1 +[1.22.0/0.45.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.22.0 +[1.21.0/0.44.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.21.0 +[1.20.0/0.43.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.20.0 +[1.19.0/0.42.0/0.0.7]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.19.0 +[1.19.0-rc.1/0.42.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.19.0-rc.1 +[1.18.0/0.41.0/0.0.6]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.18.0 +[1.17.0/0.40.0/0.0.5]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.17.0 +[1.16.0/0.39.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.16.0 +[1.16.0-rc.1/0.39.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.16.0-rc.1 +[1.15.1/0.38.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.1 +[1.15.0/0.38.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.0 +[1.15.0-rc.2/0.38.0-rc.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.0-rc.2 +[1.15.0-rc.1/0.38.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.15.0-rc.1 +[1.14.0/0.37.0/0.0.4]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.14.0 +[1.13.0/0.36.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.13.0 +[1.12.0/0.35.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.12.0 +[1.11.2/0.34.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.2 +[1.11.1/0.33.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.1 +[1.11.0/0.32.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.0 +[0.32.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/sdk/metric/v0.32.2 +[0.32.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/sdk/metric/v0.32.1 +[0.32.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/sdk/metric/v0.32.0 +[1.10.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.10.0 +[1.9.0/0.0.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.9.0 +[1.8.0/0.31.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.8.0 +[1.7.0/0.30.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.7.0 +[0.29.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/metric/v0.29.0 +[1.6.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.3 +[1.6.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.2 +[1.6.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.1 +[1.6.0/0.28.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.6.0 +[1.5.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.5.0 +[1.4.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.4.1 +[1.4.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.4.0 +[1.3.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.3.0 +[1.2.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.2.0 +[1.1.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.1.0 +[1.0.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.1 +[Metrics 0.24.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/metric/v0.24.0 +[1.0.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0 +[1.0.0-RC3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0-RC3 +[1.0.0-RC2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0-RC2 +[Experimental Metrics v0.22.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/metric/v0.22.0 +[1.0.0-RC1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.0.0-RC1 +[0.20.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.20.0 +[0.19.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.19.0 +[0.18.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.18.0 +[0.17.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.17.0 +[0.16.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.16.0 +[0.15.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.15.0 +[0.14.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.14.0 +[0.13.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.13.0 +[0.12.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.12.0 +[0.11.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.11.0 +[0.10.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.10.0 +[0.9.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.9.0 +[0.8.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.8.0 +[0.7.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.7.0 +[0.6.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.6.0 +[0.5.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.5.0 +[0.4.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.3 +[0.4.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.2 +[0.4.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.1 +[0.4.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.0 +[0.3.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.3.0 +[0.2.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.3 +[0.2.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.2 +[0.2.1.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.1.1 +[0.2.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.1 +[0.2.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.2.0 +[0.1.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.2 +[0.1.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.1 +[0.1.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.0 + +[Go 1.22]: https://go.dev/doc/go1.22 +[Go 1.21]: https://go.dev/doc/go1.21 +[Go 1.20]: https://go.dev/doc/go1.20 +[Go 1.19]: https://go.dev/doc/go1.19 +[Go 1.18]: https://go.dev/doc/go1.18 + +[metric API]:https://pkg.go.dev/go.opentelemetry.io/otel/metric +[metric SDK]:https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric +[trace API]:https://pkg.go.dev/go.opentelemetry.io/otel/trace diff --git a/vendor/go.opentelemetry.io/otel/CODEOWNERS b/vendor/go.opentelemetry.io/otel/CODEOWNERS new file mode 100644 index 0000000000..31d336d922 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/CODEOWNERS @@ -0,0 +1,17 @@ +##################################################### +# +# List of approvers for this repository +# +##################################################### +# +# Learn about membership in OpenTelemetry community: +# https://github.com/open-telemetry/community/blob/main/community-membership.md +# +# +# Learn about CODEOWNERS file format: +# https://help.github.com/en/articles/about-code-owners +# + +* @MrAlias @Aneurysm9 @evantorrie @XSAM @dashpole @MadVikingGod @pellared @hanyuancheung @dmathieu + +CODEOWNERS @MrAlias @MadVikingGod @pellared @dashpole \ No newline at end of file diff --git a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md new file mode 100644 index 0000000000..c9f2bac55b --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md @@ -0,0 +1,645 @@ +# Contributing to opentelemetry-go + +The Go special interest group (SIG) meets regularly. See the +OpenTelemetry +[community](https://github.com/open-telemetry/community#golang-sdk) +repo for information on this and other language SIGs. + +See the [public meeting +notes](https://docs.google.com/document/d/1E5e7Ld0NuU1iVvf-42tOBpu2VBBLYnh73GJuITGJTTU/edit) +for a summary description of past meetings. To request edit access, +join the meeting or get in touch on +[Slack](https://cloud-native.slack.com/archives/C01NPAXACKT). + +## Development + +You can view and edit the source code by cloning this repository: + +```sh +git clone https://github.com/open-telemetry/opentelemetry-go.git +``` + +Run `make test` to run the tests instead of `go test`. + +There are some generated files checked into the repo. To make sure +that the generated files are up-to-date, run `make` (or `make +precommit` - the `precommit` target is the default). + +The `precommit` target also fixes the formatting of the code and +checks the status of the go module files. + +Additionally, there is a `codespell` target that checks for common +typos in the code. It is not run by default, but you can run it +manually with `make codespell`. It will set up a virtual environment +in `venv` and install `codespell` there. + +If after running `make precommit` the output of `git status` contains +`nothing to commit, working tree clean` then it means that everything +is up-to-date and properly formatted. + +## Pull Requests + +### How to Send Pull Requests + +Everyone is welcome to contribute code to `opentelemetry-go` via +GitHub pull requests (PRs). + +To create a new PR, fork the project in GitHub and clone the upstream +repo: + +```sh +go get -d go.opentelemetry.io/otel +``` + +(This may print some warning about "build constraints exclude all Go +files", just ignore it.) + +This will put the project in `${GOPATH}/src/go.opentelemetry.io/otel`. You +can alternatively use `git` directly with: + +```sh +git clone https://github.com/open-telemetry/opentelemetry-go +``` + +(Note that `git clone` is *not* using the `go.opentelemetry.io/otel` name - +that name is a kind of a redirector to GitHub that `go get` can +understand, but `git` does not.) + +This would put the project in the `opentelemetry-go` directory in +current working directory. + +Enter the newly created directory and add your fork as a new remote: + +```sh +git remote add git@github.com:/opentelemetry-go +``` + +Check out a new branch, make modifications, run linters and tests, update +`CHANGELOG.md`, and push the branch to your fork: + +```sh +git checkout -b +# edit files +# update changelog +make precommit +git add -p +git commit +git push +``` + +Open a pull request against the main `opentelemetry-go` repo. Be sure to add the pull +request ID to the entry you added to `CHANGELOG.md`. + +Avoid rebasing and force-pushing to your branch to facilitate reviewing the pull request. +Rewriting Git history makes it difficult to keep track of iterations during code review. +All pull requests are squashed to a single commit upon merge to `main`. + +### How to Receive Comments + +* If the PR is not ready for review, please put `[WIP]` in the title, + tag it as `work-in-progress`, or mark it as + [`draft`](https://github.blog/2019-02-14-introducing-draft-pull-requests/). +* Make sure CLA is signed and CI is clear. + +### How to Get PRs Merged + +A PR is considered **ready to merge** when: + +* It has received two qualified approvals[^1]. + + This is not enforced through automation, but needs to be validated by the + maintainer merging. + * The qualified approvals need to be from [Approver]s/[Maintainer]s + affiliated with different companies. Two qualified approvals from + [Approver]s or [Maintainer]s affiliated with the same company counts as a + single qualified approval. + * PRs introducing changes that have already been discussed and consensus + reached only need one qualified approval. The discussion and resolution + needs to be linked to the PR. + * Trivial changes[^2] only need one qualified approval. + +* All feedback has been addressed. + * All PR comments and suggestions are resolved. + * All GitHub Pull Request reviews with a status of "Request changes" have + been addressed. Another review by the objecting reviewer with a different + status can be submitted to clear the original review, or the review can be + dismissed by a [Maintainer] when the issues from the original review have + been addressed. + * Any comments or reviews that cannot be resolved between the PR author and + reviewers can be submitted to the community [Approver]s and [Maintainer]s + during the weekly SIG meeting. If consensus is reached among the + [Approver]s and [Maintainer]s during the SIG meeting the objections to the + PR may be dismissed or resolved or the PR closed by a [Maintainer]. + * Any substantive changes to the PR require existing Approval reviews be + cleared unless the approver explicitly states that their approval persists + across changes. This includes changes resulting from other feedback. + [Approver]s and [Maintainer]s can help in clearing reviews and they should + be consulted if there are any questions. + +* The PR branch is up to date with the base branch it is merging into. + * To ensure this does not block the PR, it should be configured to allow + maintainers to update it. + +* It has been open for review for at least one working day. This gives people + reasonable time to review. + * Trivial changes[^2] do not have to wait for one day and may be merged with + a single [Maintainer]'s approval. + +* All required GitHub workflows have succeeded. +* Urgent fix can take exception as long as it has been actively communicated + among [Maintainer]s. + +Any [Maintainer] can merge the PR once the above criteria have been met. + +[^1]: A qualified approval is a GitHub Pull Request review with "Approve" + status from an OpenTelemetry Go [Approver] or [Maintainer]. +[^2]: Trivial changes include: typo corrections, cosmetic non-substantive + changes, documentation corrections or updates, dependency updates, etc. + +## Design Choices + +As with other OpenTelemetry clients, opentelemetry-go follows the +[OpenTelemetry Specification](https://opentelemetry.io/docs/specs/otel). + +It's especially valuable to read through the [library +guidelines](https://opentelemetry.io/docs/specs/otel/library-guidelines). + +### Focus on Capabilities, Not Structure Compliance + +OpenTelemetry is an evolving specification, one where the desires and +use cases are clear, but the method to satisfy those uses cases are +not. + +As such, Contributions should provide functionality and behavior that +conforms to the specification, but the interface and structure is +flexible. + +It is preferable to have contributions follow the idioms of the +language rather than conform to specific API names or argument +patterns in the spec. + +For a deeper discussion, see +[this](https://github.com/open-telemetry/opentelemetry-specification/issues/165). + +## Documentation + +Each (non-internal, non-test) package must be documented using +[Go Doc Comments](https://go.dev/doc/comment), +preferably in a `doc.go` file. + +Prefer using [Examples](https://pkg.go.dev/testing#hdr-Examples) +instead of putting code snippets in Go doc comments. +In some cases, you can even create [Testable Examples](https://go.dev/blog/examples). + +You can install and run a "local Go Doc site" in the following way: + + ```sh + go install golang.org/x/pkgsite/cmd/pkgsite@latest + pkgsite + ``` + +[`go.opentelemetry.io/otel/metric`](https://pkg.go.dev/go.opentelemetry.io/otel/metric) +is an example of a very well-documented package. + +## Style Guide + +One of the primary goals of this project is that it is actually used by +developers. With this goal in mind the project strives to build +user-friendly and idiomatic Go code adhering to the Go community's best +practices. + +For a non-comprehensive but foundational overview of these best practices +the [Effective Go](https://golang.org/doc/effective_go.html) documentation +is an excellent starting place. + +As a convenience for developers building this project the `make precommit` +will format, lint, validate, and in some cases fix the changes you plan to +submit. This check will need to pass for your changes to be able to be +merged. + +In addition to idiomatic Go, the project has adopted certain standards for +implementations of common patterns. These standards should be followed as a +default, and if they are not followed documentation needs to be included as +to the reasons why. + +### Configuration + +When creating an instantiation function for a complex `type T struct`, it is +useful to allow variable number of options to be applied. However, the strong +type system of Go restricts the function design options. There are a few ways +to solve this problem, but we have landed on the following design. + +#### `config` + +Configuration should be held in a `struct` named `config`, or prefixed with +specific type name this Configuration applies to if there are multiple +`config` in the package. This type must contain configuration options. + +```go +// config contains configuration options for a thing. +type config struct { + // options ... +} +``` + +In general the `config` type will not need to be used externally to the +package and should be unexported. If, however, it is expected that the user +will likely want to build custom options for the configuration, the `config` +should be exported. Please, include in the documentation for the `config` +how the user can extend the configuration. + +It is important that internal `config` are not shared across package boundaries. +Meaning a `config` from one package should not be directly used by another. The +one exception is the API packages. The configs from the base API, eg. +`go.opentelemetry.io/otel/trace.TracerConfig` and +`go.opentelemetry.io/otel/metric.InstrumentConfig`, are intended to be consumed +by the SDK therefore it is expected that these are exported. + +When a config is exported we want to maintain forward and backward +compatibility, to achieve this no fields should be exported but should +instead be accessed by methods. + +Optionally, it is common to include a `newConfig` function (with the same +naming scheme). This function wraps any defaults setting and looping over +all options to create a configured `config`. + +```go +// newConfig returns an appropriately configured config. +func newConfig(options ...Option) config { + // Set default values for config. + config := config{/* […] */} + for _, option := range options { + config = option.apply(config) + } + // Perform any validation here. + return config +} +``` + +If validation of the `config` options is also performed this can return an +error as well that is expected to be handled by the instantiation function +or propagated to the user. + +Given the design goal of not having the user need to work with the `config`, +the `newConfig` function should also be unexported. + +#### `Option` + +To set the value of the options a `config` contains, a corresponding +`Option` interface type should be used. + +```go +type Option interface { + apply(config) config +} +``` + +Having `apply` unexported makes sure that it will not be used externally. +Moreover, the interface becomes sealed so the user cannot easily implement +the interface on its own. + +The `apply` method should return a modified version of the passed config. +This approach, instead of passing a pointer, is used to prevent the config from being allocated to the heap. + +The name of the interface should be prefixed in the same way the +corresponding `config` is (if at all). + +#### Options + +All user configurable options for a `config` must have a related unexported +implementation of the `Option` interface and an exported configuration +function that wraps this implementation. + +The wrapping function name should be prefixed with `With*` (or in the +special case of a boolean options `Without*`) and should have the following +function signature. + +```go +func With*(…) Option { … } +``` + +##### `bool` Options + +```go +type defaultFalseOption bool + +func (o defaultFalseOption) apply(c config) config { + c.Bool = bool(o) + return c +} + +// WithOption sets a T to have an option included. +func WithOption() Option { + return defaultFalseOption(true) +} +``` + +```go +type defaultTrueOption bool + +func (o defaultTrueOption) apply(c config) config { + c.Bool = bool(o) + return c +} + +// WithoutOption sets a T to have Bool option excluded. +func WithoutOption() Option { + return defaultTrueOption(false) +} +``` + +##### Declared Type Options + +```go +type myTypeOption struct { + MyType MyType +} + +func (o myTypeOption) apply(c config) config { + c.MyType = o.MyType + return c +} + +// WithMyType sets T to have include MyType. +func WithMyType(t MyType) Option { + return myTypeOption{t} +} +``` + +##### Functional Options + +```go +type optionFunc func(config) config + +func (fn optionFunc) apply(c config) config { + return fn(c) +} + +// WithMyType sets t as MyType. +func WithMyType(t MyType) Option { + return optionFunc(func(c config) config { + c.MyType = t + return c + }) +} +``` + +#### Instantiation + +Using this configuration pattern to configure instantiation with a `NewT` +function. + +```go +func NewT(options ...Option) T {…} +``` + +Any required parameters can be declared before the variadic `options`. + +#### Dealing with Overlap + +Sometimes there are multiple complex `struct` that share common +configuration and also have distinct configuration. To avoid repeated +portions of `config`s, a common `config` can be used with the union of +options being handled with the `Option` interface. + +For example. + +```go +// config holds options for all animals. +type config struct { + Weight float64 + Color string + MaxAltitude float64 +} + +// DogOption apply Dog specific options. +type DogOption interface { + applyDog(config) config +} + +// BirdOption apply Bird specific options. +type BirdOption interface { + applyBird(config) config +} + +// Option apply options for all animals. +type Option interface { + BirdOption + DogOption +} + +type weightOption float64 + +func (o weightOption) applyDog(c config) config { + c.Weight = float64(o) + return c +} + +func (o weightOption) applyBird(c config) config { + c.Weight = float64(o) + return c +} + +func WithWeight(w float64) Option { return weightOption(w) } + +type furColorOption string + +func (o furColorOption) applyDog(c config) config { + c.Color = string(o) + return c +} + +func WithFurColor(c string) DogOption { return furColorOption(c) } + +type maxAltitudeOption float64 + +func (o maxAltitudeOption) applyBird(c config) config { + c.MaxAltitude = float64(o) + return c +} + +func WithMaxAltitude(a float64) BirdOption { return maxAltitudeOption(a) } + +func NewDog(name string, o ...DogOption) Dog {…} +func NewBird(name string, o ...BirdOption) Bird {…} +``` + +### Interfaces + +To allow other developers to better comprehend the code, it is important +to ensure it is sufficiently documented. One simple measure that contributes +to this aim is self-documenting by naming method parameters. Therefore, +where appropriate, methods of every exported interface type should have +their parameters appropriately named. + +#### Interface Stability + +All exported stable interfaces that include the following warning in their +documentation are allowed to be extended with additional methods. + +> Warning: methods may be added to this interface in minor releases. + +These interfaces are defined by the OpenTelemetry specification and will be +updated as the specification evolves. + +Otherwise, stable interfaces MUST NOT be modified. + +#### How to Change Specification Interfaces + +When an API change must be made, we will update the SDK with the new method one +release before the API change. This will allow the SDK one version before the +API change to work seamlessly with the new API. + +If an incompatible version of the SDK is used with the new API the application +will fail to compile. + +#### How Not to Change Specification Interfaces + +We have explored using a v2 of the API to change interfaces and found that there +was no way to introduce a v2 and have it work seamlessly with the v1 of the API. +Problems happened with libraries that upgraded to v2 when an application did not, +and would not produce any telemetry. + +More detail of the approaches considered and their limitations can be found in +the [Use a V2 API to evolve interfaces](https://github.com/open-telemetry/opentelemetry-go/issues/3920) +issue. + +#### How to Change Other Interfaces + +If new functionality is needed for an interface that cannot be changed it MUST +be added by including an additional interface. That added interface can be a +simple interface for the specific functionality that you want to add or it can +be a super-set of the original interface. For example, if you wanted to a +`Close` method to the `Exporter` interface: + +```go +type Exporter interface { + Export() +} +``` + +A new interface, `Closer`, can be added: + +```go +type Closer interface { + Close() +} +``` + +Code that is passed the `Exporter` interface can now check to see if the passed +value also satisfies the new interface. E.g. + +```go +func caller(e Exporter) { + /* ... */ + if c, ok := e.(Closer); ok { + c.Close() + } + /* ... */ +} +``` + +Alternatively, a new type that is the super-set of an `Exporter` can be created. + +```go +type ClosingExporter struct { + Exporter + Close() +} +``` + +This new type can be used similar to the simple interface above in that a +passed `Exporter` type can be asserted to satisfy the `ClosingExporter` type +and the `Close` method called. + +This super-set approach can be useful if there is explicit behavior that needs +to be coupled with the original type and passed as a unified type to a new +function, but, because of this coupling, it also limits the applicability of +the added functionality. If there exist other interfaces where this +functionality should be added, each one will need their own super-set +interfaces and will duplicate the pattern. For this reason, the simple targeted +interface that defines the specific functionality should be preferred. + +### Testing + +The tests should never leak goroutines. + +Use the term `ConcurrentSafe` in the test name when it aims to verify the +absence of race conditions. + +### Internal packages + +The use of internal packages should be scoped to a single module. A sub-module +should never import from a parent internal package. This creates a coupling +between the two modules where a user can upgrade the parent without the child +and if the internal package API has changed it will fail to upgrade[^3]. + +There are two known exceptions to this rule: + +- `go.opentelemetry.io/otel/internal/global` + - This package manages global state for all of opentelemetry-go. It needs to + be a single package in order to ensure the uniqueness of the global state. +- `go.opentelemetry.io/otel/internal/baggage` + - This package provides values in a `context.Context` that need to be + recognized by `go.opentelemetry.io/otel/baggage` and + `go.opentelemetry.io/otel/bridge/opentracing` but remain private. + +If you have duplicate code in multiple modules, make that code into a Go +template stored in `go.opentelemetry.io/otel/internal/shared` and use [gotmpl] +to render the templates in the desired locations. See [#4404] for an example of +this. + +[^3]: https://github.com/open-telemetry/opentelemetry-go/issues/3548 + +### Ignoring context cancellation + +OpenTelemetry API implementations need to ignore the cancellation of the context that are +passed when recording a value (e.g. starting a span, recording a measurement, emitting a log). +Recording methods should not return an error describing the cancellation state of the context +when they complete, nor should they abort any work. + +This rule may not apply if the OpenTelemetry specification defines a timeout mechanism for +the method. In that case the context cancellation can be used for the timeout with the +restriction that this behavior is documented for the method. Otherwise, timeouts +are expected to be handled by the user calling the API, not the implementation. + +Stoppage of the telemetry pipeline is handled by calling the appropriate `Shutdown` method +of a provider. It is assumed the context passed from a user is not used for this purpose. + +Outside of the direct recording of telemetry from the API (e.g. exporting telemetry, +force flushing telemetry, shutting down a signal provider) the context cancellation +should be honored. This means all work done on behalf of the user provided context +should be canceled. + +## Approvers and Maintainers + +### Approvers + +- [Evan Torrie](https://github.com/evantorrie), Verizon Media +- [Sam Xie](https://github.com/XSAM), Cisco/AppDynamics +- [Chester Cheung](https://github.com/hanyuancheung), Tencent +- [Damien Mathieu](https://github.com/dmathieu), Elastic +- [Anthony Mirabella](https://github.com/Aneurysm9), AWS + +### Maintainers + +- [David Ashpole](https://github.com/dashpole), Google +- [Aaron Clawson](https://github.com/MadVikingGod), LightStep +- [Robert Pająk](https://github.com/pellared), Splunk +- [Tyler Yahn](https://github.com/MrAlias), Splunk + +### Emeritus + +- [Liz Fong-Jones](https://github.com/lizthegrey), Honeycomb +- [Gustavo Silva Paiva](https://github.com/paivagustavo), LightStep +- [Josh MacDonald](https://github.com/jmacd), LightStep + +### Become an Approver or a Maintainer + +See the [community membership document in OpenTelemetry community +repo](https://github.com/open-telemetry/community/blob/main/community-membership.md). + +[Approver]: #approvers +[Maintainer]: #maintainers +[gotmpl]: https://pkg.go.dev/go.opentelemetry.io/build-tools/gotmpl +[#4404]: https://github.com/open-telemetry/opentelemetry-go/pull/4404 diff --git a/vendor/go.opentelemetry.io/otel/LICENSE b/vendor/go.opentelemetry.io/otel/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/LICENSE @@ -0,0 +1,201 @@ + 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/go.opentelemetry.io/otel/Makefile b/vendor/go.opentelemetry.io/otel/Makefile new file mode 100644 index 0000000000..6de95219be --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/Makefile @@ -0,0 +1,318 @@ +# Copyright The OpenTelemetry 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. + +TOOLS_MOD_DIR := ./internal/tools + +ALL_DOCS := $(shell find . -name '*.md' -type f | sort) +ALL_GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort) +OTEL_GO_MOD_DIRS := $(filter-out $(TOOLS_MOD_DIR), $(ALL_GO_MOD_DIRS)) +ALL_COVERAGE_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | grep -E -v '^./example|^$(TOOLS_MOD_DIR)' | sort) + +GO = go +TIMEOUT = 60 + +.DEFAULT_GOAL := precommit + +.PHONY: precommit ci +precommit: generate dependabot-generate license-check misspell go-mod-tidy golangci-lint-fix test-default +ci: generate dependabot-check license-check lint vanity-import-check build test-default check-clean-work-tree test-coverage + +# Tools + +TOOLS = $(CURDIR)/.tools + +$(TOOLS): + @mkdir -p $@ +$(TOOLS)/%: | $(TOOLS) + cd $(TOOLS_MOD_DIR) && \ + $(GO) build -o $@ $(PACKAGE) + +MULTIMOD = $(TOOLS)/multimod +$(TOOLS)/multimod: PACKAGE=go.opentelemetry.io/build-tools/multimod + +SEMCONVGEN = $(TOOLS)/semconvgen +$(TOOLS)/semconvgen: PACKAGE=go.opentelemetry.io/build-tools/semconvgen + +CROSSLINK = $(TOOLS)/crosslink +$(TOOLS)/crosslink: PACKAGE=go.opentelemetry.io/build-tools/crosslink + +SEMCONVKIT = $(TOOLS)/semconvkit +$(TOOLS)/semconvkit: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/semconvkit + +DBOTCONF = $(TOOLS)/dbotconf +$(TOOLS)/dbotconf: PACKAGE=go.opentelemetry.io/build-tools/dbotconf + +GOLANGCI_LINT = $(TOOLS)/golangci-lint +$(TOOLS)/golangci-lint: PACKAGE=github.com/golangci/golangci-lint/cmd/golangci-lint + +MISSPELL = $(TOOLS)/misspell +$(TOOLS)/misspell: PACKAGE=github.com/client9/misspell/cmd/misspell + +GOCOVMERGE = $(TOOLS)/gocovmerge +$(TOOLS)/gocovmerge: PACKAGE=github.com/wadey/gocovmerge + +STRINGER = $(TOOLS)/stringer +$(TOOLS)/stringer: PACKAGE=golang.org/x/tools/cmd/stringer + +PORTO = $(TOOLS)/porto +$(TOOLS)/porto: PACKAGE=github.com/jcchavezs/porto/cmd/porto + +GOJQ = $(TOOLS)/gojq +$(TOOLS)/gojq: PACKAGE=github.com/itchyny/gojq/cmd/gojq + +GOTMPL = $(TOOLS)/gotmpl +$(GOTMPL): PACKAGE=go.opentelemetry.io/build-tools/gotmpl + +GORELEASE = $(TOOLS)/gorelease +$(GORELEASE): PACKAGE=golang.org/x/exp/cmd/gorelease + +GOVULNCHECK = $(TOOLS)/govulncheck +$(TOOLS)/govulncheck: PACKAGE=golang.org/x/vuln/cmd/govulncheck + +.PHONY: tools +tools: $(CROSSLINK) $(DBOTCONF) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(GOJQ) $(SEMCONVGEN) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE) + +# Virtualized python tools via docker + +# The directory where the virtual environment is created. +VENVDIR := venv + +# The directory where the python tools are installed. +PYTOOLS := $(VENVDIR)/bin + +# The pip executable in the virtual environment. +PIP := $(PYTOOLS)/pip + +# The directory in the docker image where the current directory is mounted. +WORKDIR := /workdir + +# The python image to use for the virtual environment. +PYTHONIMAGE := python:3.11.3-slim-bullseye + +# Run the python image with the current directory mounted. +DOCKERPY := docker run --rm -v "$(CURDIR):$(WORKDIR)" -w $(WORKDIR) $(PYTHONIMAGE) + +# Create a virtual environment for Python tools. +$(PYTOOLS): +# The `--upgrade` flag is needed to ensure that the virtual environment is +# created with the latest pip version. + @$(DOCKERPY) bash -c "python3 -m venv $(VENVDIR) && $(PIP) install --upgrade pip" + +# Install python packages into the virtual environment. +$(PYTOOLS)/%: | $(PYTOOLS) + @$(DOCKERPY) $(PIP) install -r requirements.txt + +CODESPELL = $(PYTOOLS)/codespell +$(CODESPELL): PACKAGE=codespell + +# Generate + +.PHONY: generate +generate: go-generate vanity-import-fix + +.PHONY: go-generate +go-generate: $(OTEL_GO_MOD_DIRS:%=go-generate/%) +go-generate/%: DIR=$* +go-generate/%: | $(STRINGER) $(GOTMPL) + @echo "$(GO) generate $(DIR)/..." \ + && cd $(DIR) \ + && PATH="$(TOOLS):$${PATH}" $(GO) generate ./... + +.PHONY: vanity-import-fix +vanity-import-fix: | $(PORTO) + @$(PORTO) --include-internal -w . + +# Generate go.work file for local development. +.PHONY: go-work +go-work: | $(CROSSLINK) + $(CROSSLINK) work --root=$(shell pwd) + +# Build + +.PHONY: build + +build: $(OTEL_GO_MOD_DIRS:%=build/%) $(OTEL_GO_MOD_DIRS:%=build-tests/%) +build/%: DIR=$* +build/%: + @echo "$(GO) build $(DIR)/..." \ + && cd $(DIR) \ + && $(GO) build ./... + +build-tests/%: DIR=$* +build-tests/%: + @echo "$(GO) build tests $(DIR)/..." \ + && cd $(DIR) \ + && $(GO) list ./... \ + | grep -v third_party \ + | xargs $(GO) test -vet=off -run xxxxxMatchNothingxxxxx >/dev/null + +# Tests + +TEST_TARGETS := test-default test-bench test-short test-verbose test-race +.PHONY: $(TEST_TARGETS) test +test-default test-race: ARGS=-race +test-bench: ARGS=-run=xxxxxMatchNothingxxxxx -test.benchtime=1ms -bench=. +test-short: ARGS=-short +test-verbose: ARGS=-v -race +$(TEST_TARGETS): test +test: $(OTEL_GO_MOD_DIRS:%=test/%) +test/%: DIR=$* +test/%: + @echo "$(GO) test -timeout $(TIMEOUT)s $(ARGS) $(DIR)/..." \ + && cd $(DIR) \ + && $(GO) list ./... \ + | grep -v third_party \ + | xargs $(GO) test -timeout $(TIMEOUT)s $(ARGS) + +COVERAGE_MODE = atomic +COVERAGE_PROFILE = coverage.out +.PHONY: test-coverage +test-coverage: | $(GOCOVMERGE) + @set -e; \ + printf "" > coverage.txt; \ + for dir in $(ALL_COVERAGE_MOD_DIRS); do \ + echo "$(GO) test -coverpkg=go.opentelemetry.io/otel/... -covermode=$(COVERAGE_MODE) -coverprofile="$(COVERAGE_PROFILE)" $${dir}/..."; \ + (cd "$${dir}" && \ + $(GO) list ./... \ + | grep -v third_party \ + | grep -v 'semconv/v.*' \ + | xargs $(GO) test -coverpkg=./... -covermode=$(COVERAGE_MODE) -coverprofile="$(COVERAGE_PROFILE)" && \ + $(GO) tool cover -html=coverage.out -o coverage.html); \ + done; \ + $(GOCOVMERGE) $$(find . -name coverage.out) > coverage.txt + +# Adding a directory will include all benchmarks in that directory if a filter is not specified. +BENCHMARK_TARGETS := sdk/trace +.PHONY: benchmark +benchmark: $(BENCHMARK_TARGETS:%=benchmark/%) +BENCHMARK_FILTER = . +# You can override the filter for a particular directory by adding a rule here. +benchmark/sdk/trace: BENCHMARK_FILTER = SpanWithAttributes_8/AlwaysSample +benchmark/%: + @echo "$(GO) test -timeout $(TIMEOUT)s -run=xxxxxMatchNothingxxxxx -bench=$(BENCHMARK_FILTER) $*..." \ + && cd $* \ + $(foreach filter, $(BENCHMARK_FILTER), && $(GO) test -timeout $(TIMEOUT)s -run=xxxxxMatchNothingxxxxx -bench=$(filter)) + +.PHONY: golangci-lint golangci-lint-fix +golangci-lint-fix: ARGS=--fix +golangci-lint-fix: golangci-lint +golangci-lint: $(OTEL_GO_MOD_DIRS:%=golangci-lint/%) +golangci-lint/%: DIR=$* +golangci-lint/%: | $(GOLANGCI_LINT) + @echo 'golangci-lint $(if $(ARGS),$(ARGS) ,)$(DIR)' \ + && cd $(DIR) \ + && $(GOLANGCI_LINT) run --allow-serial-runners $(ARGS) + +.PHONY: crosslink +crosslink: | $(CROSSLINK) + @echo "Updating intra-repository dependencies in all go modules" \ + && $(CROSSLINK) --root=$(shell pwd) --prune + +.PHONY: go-mod-tidy +go-mod-tidy: $(ALL_GO_MOD_DIRS:%=go-mod-tidy/%) +go-mod-tidy/%: DIR=$* +go-mod-tidy/%: | crosslink + @echo "$(GO) mod tidy in $(DIR)" \ + && cd $(DIR) \ + && $(GO) mod tidy -compat=1.20 + +.PHONY: lint-modules +lint-modules: go-mod-tidy + +.PHONY: lint +lint: misspell lint-modules golangci-lint govulncheck + +.PHONY: vanity-import-check +vanity-import-check: | $(PORTO) + @$(PORTO) --include-internal -l . || ( echo "(run: make vanity-import-fix)"; exit 1 ) + +.PHONY: misspell +misspell: | $(MISSPELL) + @$(MISSPELL) -w $(ALL_DOCS) + +.PHONY: govulncheck +govulncheck: $(OTEL_GO_MOD_DIRS:%=govulncheck/%) +govulncheck/%: DIR=$* +govulncheck/%: | $(GOVULNCHECK) + @echo "govulncheck ./... in $(DIR)" \ + && cd $(DIR) \ + && $(GOVULNCHECK) ./... + +.PHONY: codespell +codespell: | $(CODESPELL) + @$(DOCKERPY) $(CODESPELL) + +.PHONY: license-check +license-check: + @licRes=$$(for f in $$(find . -type f \( -iname '*.go' -o -iname '*.sh' \) ! -path '**/third_party/*' ! -path './.git/*' ) ; do \ + awk '/Copyright The OpenTelemetry Authors|generated|GENERATED/ && NR<=4 { found=1; next } END { if (!found) print FILENAME }' $$f; \ + done); \ + if [ -n "$${licRes}" ]; then \ + echo "license header checking failed:"; echo "$${licRes}"; \ + exit 1; \ + fi + +DEPENDABOT_CONFIG = .github/dependabot.yml +.PHONY: dependabot-check +dependabot-check: | $(DBOTCONF) + @$(DBOTCONF) verify $(DEPENDABOT_CONFIG) || ( echo "(run: make dependabot-generate)"; exit 1 ) + +.PHONY: dependabot-generate +dependabot-generate: | $(DBOTCONF) + @$(DBOTCONF) generate > $(DEPENDABOT_CONFIG) + +.PHONY: check-clean-work-tree +check-clean-work-tree: + @if ! git diff --quiet; then \ + echo; \ + echo 'Working tree is not clean, did you forget to run "make precommit"?'; \ + echo; \ + git status; \ + exit 1; \ + fi + +SEMCONVPKG ?= "semconv/" +.PHONY: semconv-generate +semconv-generate: | $(SEMCONVGEN) $(SEMCONVKIT) + [ "$(TAG)" ] || ( echo "TAG unset: missing opentelemetry semantic-conventions tag"; exit 1 ) + [ "$(OTEL_SEMCONV_REPO)" ] || ( echo "OTEL_SEMCONV_REPO unset: missing path to opentelemetry semantic-conventions repo"; exit 1 ) + $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=span -p conventionType=trace -f trace.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)" + $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=attribute_group -p conventionType=trace -f attribute_group.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)" + $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=event -p conventionType=event -f event.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)" + $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=resource -p conventionType=resource -f resource.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)" + $(SEMCONVKIT) -output "$(SEMCONVPKG)/$(TAG)" -tag "$(TAG)" + +.PHONY: gorelease +gorelease: $(OTEL_GO_MOD_DIRS:%=gorelease/%) +gorelease/%: DIR=$* +gorelease/%:| $(GORELEASE) + @echo "gorelease in $(DIR):" \ + && cd $(DIR) \ + && $(GORELEASE) \ + || echo "" + +.PHONY: prerelease +prerelease: | $(MULTIMOD) + @[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 ) + $(MULTIMOD) verify && $(MULTIMOD) prerelease -m ${MODSET} + +COMMIT ?= "HEAD" +.PHONY: add-tags +add-tags: | $(MULTIMOD) + @[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 ) + $(MULTIMOD) verify && $(MULTIMOD) tag -m ${MODSET} -c ${COMMIT} + +.PHONY: lint-markdown +lint-markdown: + docker run -v "$(CURDIR):$(WORKDIR)" avtodev/markdown-lint:v1 -c $(WORKDIR)/.markdownlint.yaml $(WORKDIR)/**/*.md diff --git a/vendor/go.opentelemetry.io/otel/README.md b/vendor/go.opentelemetry.io/otel/README.md new file mode 100644 index 0000000000..7766259a5c --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/README.md @@ -0,0 +1,112 @@ +# OpenTelemetry-Go + +[![CI](https://github.com/open-telemetry/opentelemetry-go/workflows/ci/badge.svg)](https://github.com/open-telemetry/opentelemetry-go/actions?query=workflow%3Aci+branch%3Amain) +[![codecov.io](https://codecov.io/gh/open-telemetry/opentelemetry-go/coverage.svg?branch=main)](https://app.codecov.io/gh/open-telemetry/opentelemetry-go?branch=main) +[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel)](https://pkg.go.dev/go.opentelemetry.io/otel) +[![Go Report Card](https://goreportcard.com/badge/go.opentelemetry.io/otel)](https://goreportcard.com/report/go.opentelemetry.io/otel) +[![Slack](https://img.shields.io/badge/slack-@cncf/otel--go-brightgreen.svg?logo=slack)](https://cloud-native.slack.com/archives/C01NPAXACKT) + +OpenTelemetry-Go is the [Go](https://golang.org/) implementation of [OpenTelemetry](https://opentelemetry.io/). +It provides a set of APIs to directly measure performance and behavior of your software and send this data to observability platforms. + +## Project Status + +| Signal | Status | +|---------|--------------------| +| Traces | Stable | +| Metrics | Stable | +| Logs | In development[^1] | + +Progress and status specific to this repository is tracked in our +[project boards](https://github.com/open-telemetry/opentelemetry-go/projects) +and +[milestones](https://github.com/open-telemetry/opentelemetry-go/milestones). + +Project versioning information and stability guarantees can be found in the +[versioning documentation](VERSIONING.md). + +[^1]: https://github.com/orgs/open-telemetry/projects/43 + +### Compatibility + +OpenTelemetry-Go ensures compatibility with the current supported versions of +the [Go language](https://golang.org/doc/devel/release#policy): + +> Each major Go release is supported until there are two newer major releases. +> For example, Go 1.5 was supported until the Go 1.7 release, and Go 1.6 was supported until the Go 1.8 release. + +For versions of Go that are no longer supported upstream, opentelemetry-go will +stop ensuring compatibility with these versions in the following manner: + +- A minor release of opentelemetry-go will be made to add support for the new + supported release of Go. +- The following minor release of opentelemetry-go will remove compatibility + testing for the oldest (now archived upstream) version of Go. This, and + future, releases of opentelemetry-go may include features only supported by + the currently supported versions of Go. + +Currently, this project supports the following environments. + +| OS | Go Version | Architecture | +|---------|------------|--------------| +| Ubuntu | 1.22 | amd64 | +| Ubuntu | 1.21 | amd64 | +| Ubuntu | 1.20 | amd64 | +| Ubuntu | 1.22 | 386 | +| Ubuntu | 1.21 | 386 | +| Ubuntu | 1.20 | 386 | +| MacOS | 1.22 | amd64 | +| MacOS | 1.21 | amd64 | +| MacOS | 1.20 | amd64 | +| Windows | 1.22 | amd64 | +| Windows | 1.21 | amd64 | +| Windows | 1.20 | amd64 | +| Windows | 1.22 | 386 | +| Windows | 1.21 | 386 | +| Windows | 1.20 | 386 | + +While this project should work for other systems, no compatibility guarantees +are made for those systems currently. + +## Getting Started + +You can find a getting started guide on [opentelemetry.io](https://opentelemetry.io/docs/languages/go/getting-started/). + +OpenTelemetry's goal is to provide a single set of APIs to capture distributed +traces and metrics from your application and send them to an observability +platform. This project allows you to do just that for applications written in +Go. There are two steps to this process: instrument your application, and +configure an exporter. + +### Instrumentation + +To start capturing distributed traces and metric events from your application +it first needs to be instrumented. The easiest way to do this is by using an +instrumentation library for your code. Be sure to check out [the officially +supported instrumentation +libraries](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation). + +If you need to extend the telemetry an instrumentation library provides or want +to build your own instrumentation for your application directly you will need +to use the +[Go otel](https://pkg.go.dev/go.opentelemetry.io/otel) +package. The included [examples](./example/) are a good way to see some +practical uses of this process. + +### Export + +Now that your application is instrumented to collect telemetry, it needs an +export pipeline to send that telemetry to an observability platform. + +All officially supported exporters for the OpenTelemetry project are contained in the [exporters directory](./exporters). + +| Exporter | Metrics | Traces | +|---------------------------------------|:-------:|:------:| +| [OTLP](./exporters/otlp/) | ✓ | ✓ | +| [Prometheus](./exporters/prometheus/) | ✓ | | +| [stdout](./exporters/stdout/) | ✓ | ✓ | +| [Zipkin](./exporters/zipkin/) | | ✓ | + +## Contributing + +See the [contributing documentation](CONTRIBUTING.md). diff --git a/vendor/go.opentelemetry.io/otel/RELEASING.md b/vendor/go.opentelemetry.io/otel/RELEASING.md new file mode 100644 index 0000000000..d2691d0bd8 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/RELEASING.md @@ -0,0 +1,139 @@ +# Release Process + +## Semantic Convention Generation + +New versions of the [OpenTelemetry Semantic Conventions] mean new versions of the `semconv` package need to be generated. +The `semconv-generate` make target is used for this. + +1. Checkout a local copy of the [OpenTelemetry Semantic Conventions] to the desired release tag. +2. Pull the latest `otel/semconvgen` image: `docker pull otel/semconvgen:latest` +3. Run the `make semconv-generate ...` target from this repository. + +For example, + +```sh +export TAG="v1.21.0" # Change to the release version you are generating. +export OTEL_SEMCONV_REPO="/absolute/path/to/opentelemetry/semantic-conventions" +docker pull otel/semconvgen:latest +make semconv-generate # Uses the exported TAG and OTEL_SEMCONV_REPO. +``` + +This should create a new sub-package of [`semconv`](./semconv). +Ensure things look correct before submitting a pull request to include the addition. + +## Breaking changes validation + +You can run `make gorelease` that runs [gorelease](https://pkg.go.dev/golang.org/x/exp/cmd/gorelease) to ensure that there are no unwanted changes done in the public API. + +You can check/report problems with `gorelease` [here](https://golang.org/issues/26420). + +## Pre-Release + +First, decide which module sets will be released and update their versions +in `versions.yaml`. Commit this change to a new branch. + +Update go.mod for submodules to depend on the new release which will happen in the next step. + +1. Run the `prerelease` make target. It creates a branch + `prerelease__` that will contain all release changes. + + ``` + make prerelease MODSET= + ``` + +2. Verify the changes. + + ``` + git diff ...prerelease__ + ``` + + This should have changed the version for all modules to be ``. + If these changes look correct, merge them into your pre-release branch: + + ```go + git merge prerelease__ + ``` + +3. Update the [Changelog](./CHANGELOG.md). + - Make sure all relevant changes for this release are included and are in language that non-contributors to the project can understand. + To verify this, you can look directly at the commits since the ``. + + ``` + git --no-pager log --pretty=oneline "..HEAD" + ``` + + - Move all the `Unreleased` changes into a new section following the title scheme (`[] - `). + - Update all the appropriate links at the bottom. + +4. Push the changes to upstream and create a Pull Request on GitHub. + Be sure to include the curated changes from the [Changelog](./CHANGELOG.md) in the description. + +## Tag + +Once the Pull Request with all the version changes has been approved and merged it is time to tag the merged commit. + +***IMPORTANT***: It is critical you use the same tag that you used in the Pre-Release step! +Failure to do so will leave things in a broken state. As long as you do not +change `versions.yaml` between pre-release and this step, things should be fine. + +***IMPORTANT***: [There is currently no way to remove an incorrectly tagged version of a Go module](https://github.com/golang/go/issues/34189). +It is critical you make sure the version you push upstream is correct. +[Failure to do so will lead to minor emergencies and tough to work around](https://github.com/open-telemetry/opentelemetry-go/issues/331). + +1. For each module set that will be released, run the `add-tags` make target + using the `` of the commit on the main branch for the merged Pull Request. + + ``` + make add-tags MODSET= COMMIT= + ``` + + It should only be necessary to provide an explicit `COMMIT` value if the + current `HEAD` of your working directory is not the correct commit. + +2. Push tags to the upstream remote (not your fork: `github.com/open-telemetry/opentelemetry-go.git`). + Make sure you push all sub-modules as well. + + ``` + git push upstream + git push upstream + ... + ``` + +## Release + +Finally create a Release for the new `` on GitHub. +The release body should include all the release notes from the Changelog for this release. + +## Verify Examples + +After releasing verify that examples build outside of the repository. + +``` +./verify_examples.sh +``` + +The script copies examples into a different directory removes any `replace` declarations in `go.mod` and builds them. +This ensures they build with the published release, not the local copy. + +## Post-Release + +### Contrib Repository + +Once verified be sure to [make a release for the `contrib` repository](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/RELEASING.md) that uses this release. + +### Website Documentation + +Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/languages/go]. +Importantly, bump any package versions referenced to be the latest one you just released and ensure all code examples still compile and are accurate. + +[OpenTelemetry Semantic Conventions]: https://github.com/open-telemetry/semantic-conventions +[Go instrumentation documentation]: https://opentelemetry.io/docs/languages/go/ +[content/en/docs/languages/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/languages/go + +### Demo Repository + +Bump the dependencies in the following Go services: + +- [`accountingservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/accountingservice) +- [`checkoutservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/checkoutservice) +- [`productcatalogservice`](https://github.com/open-telemetry/opentelemetry-demo/tree/main/src/productcatalogservice) diff --git a/vendor/go.opentelemetry.io/otel/VERSIONING.md b/vendor/go.opentelemetry.io/otel/VERSIONING.md new file mode 100644 index 0000000000..412f1e362b --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/VERSIONING.md @@ -0,0 +1,224 @@ +# Versioning + +This document describes the versioning policy for this repository. This policy +is designed so the following goals can be achieved. + +**Users are provided a codebase of value that is stable and secure.** + +## Policy + +* Versioning of this project will be idiomatic of a Go project using [Go + modules](https://github.com/golang/go/wiki/Modules). + * [Semantic import + versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) + will be used. + * Versions will comply with [semver + 2.0](https://semver.org/spec/v2.0.0.html) with the following exceptions. + * New methods may be added to exported API interfaces. All exported + interfaces that fall within this exception will include the following + paragraph in their public documentation. + + > Warning: methods may be added to this interface in minor releases. + + * If a module is version `v2` or higher, the major version of the module + must be included as a `/vN` at the end of the module paths used in + `go.mod` files (e.g., `module go.opentelemetry.io/otel/v2`, `require + go.opentelemetry.io/otel/v2 v2.0.1`) and in the package import path + (e.g., `import "go.opentelemetry.io/otel/v2/trace"`). This includes the + paths used in `go get` commands (e.g., `go get + go.opentelemetry.io/otel/v2@v2.0.1`. Note there is both a `/v2` and a + `@v2.0.1` in that example. One way to think about it is that the module + name now includes the `/v2`, so include `/v2` whenever you are using the + module name). + * If a module is version `v0` or `v1`, do not include the major version in + either the module path or the import path. + * Modules will be used to encapsulate signals and components. + * Experimental modules still under active development will be versioned at + `v0` to imply the stability guarantee defined by + [semver](https://semver.org/spec/v2.0.0.html#spec-item-4). + + > Major version zero (0.y.z) is for initial development. Anything MAY + > change at any time. The public API SHOULD NOT be considered stable. + + * Mature modules for which we guarantee a stable public API will be versioned + with a major version greater than `v0`. + * The decision to make a module stable will be made on a case-by-case + basis by the maintainers of this project. + * Experimental modules will start their versioning at `v0.0.0` and will + increment their minor version when backwards incompatible changes are + released and increment their patch version when backwards compatible + changes are released. + * All stable modules that use the same major version number will use the + same entire version number. + * Stable modules may be released with an incremented minor or patch + version even though that module has not been changed, but rather so + that it will remain at the same version as other stable modules that + did undergo change. + * When an experimental module becomes stable a new stable module version + will be released and will include this now stable module. The new + stable module version will be an increment of the minor version number + and will be applied to all existing stable modules as well as the newly + stable module being released. +* Versioning of the associated [contrib + repository](https://github.com/open-telemetry/opentelemetry-go-contrib) of + this project will be idiomatic of a Go project using [Go + modules](https://github.com/golang/go/wiki/Modules). + * [Semantic import + versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) + will be used. + * Versions will comply with [semver 2.0](https://semver.org/spec/v2.0.0.html). + * If a module is version `v2` or higher, the + major version of the module must be included as a `/vN` at the end of the + module paths used in `go.mod` files (e.g., `module + go.opentelemetry.io/contrib/instrumentation/host/v2`, `require + go.opentelemetry.io/contrib/instrumentation/host/v2 v2.0.1`) and in the + package import path (e.g., `import + "go.opentelemetry.io/contrib/instrumentation/host/v2"`). This includes + the paths used in `go get` commands (e.g., `go get + go.opentelemetry.io/contrib/instrumentation/host/v2@v2.0.1`. Note there + is both a `/v2` and a `@v2.0.1` in that example. One way to think about + it is that the module name now includes the `/v2`, so include `/v2` + whenever you are using the module name). + * If a module is version `v0` or `v1`, do not include the major version + in either the module path or the import path. + * In addition to public APIs, telemetry produced by stable instrumentation + will remain stable and backwards compatible. This is to avoid breaking + alerts and dashboard. + * Modules will be used to encapsulate instrumentation, detectors, exporters, + propagators, and any other independent sets of related components. + * Experimental modules still under active development will be versioned at + `v0` to imply the stability guarantee defined by + [semver](https://semver.org/spec/v2.0.0.html#spec-item-4). + + > Major version zero (0.y.z) is for initial development. Anything MAY + > change at any time. The public API SHOULD NOT be considered stable. + + * Mature modules for which we guarantee a stable public API and telemetry will + be versioned with a major version greater than `v0`. + * Experimental modules will start their versioning at `v0.0.0` and will + increment their minor version when backwards incompatible changes are + released and increment their patch version when backwards compatible + changes are released. + * Stable contrib modules cannot depend on experimental modules from this + project. + * All stable contrib modules of the same major version with this project + will use the same entire version as this project. + * Stable modules may be released with an incremented minor or patch + version even though that module's code has not been changed. Instead + the only change that will have been included is to have updated that + modules dependency on this project's stable APIs. + * When an experimental module in contrib becomes stable a new stable + module version will be released and will include this now stable + module. The new stable module version will be an increment of the minor + version number and will be applied to all existing stable contrib + modules, this project's modules, and the newly stable module being + released. + * Contrib modules will be kept up to date with this project's releases. + * Due to the dependency contrib modules will implicitly have on this + project's modules the release of stable contrib modules to match the + released version number will be staggered after this project's release. + There is no explicit time guarantee for how long after this projects + release the contrib release will be. Effort should be made to keep them + as close in time as possible. + * No additional stable release in this project can be made until the + contrib repository has a matching stable release. + * No release can be made in the contrib repository after this project's + stable release except for a stable release of the contrib repository. +* GitHub releases will be made for all releases. +* Go modules will be made available at Go package mirrors. + +## Example Versioning Lifecycle + +To better understand the implementation of the above policy the following +example is provided. This project is simplified to include only the following +modules and their versions: + +* `otel`: `v0.14.0` +* `otel/trace`: `v0.14.0` +* `otel/metric`: `v0.14.0` +* `otel/baggage`: `v0.14.0` +* `otel/sdk/trace`: `v0.14.0` +* `otel/sdk/metric`: `v0.14.0` + +These modules have been developed to a point where the `otel/trace`, +`otel/baggage`, and `otel/sdk/trace` modules have reached a point that they +should be considered for a stable release. The `otel/metric` and +`otel/sdk/metric` are still under active development and the `otel` module +depends on both `otel/trace` and `otel/metric`. + +The `otel` package is refactored to remove its dependencies on `otel/metric` so +it can be released as stable as well. With that done the following release +candidates are made: + +* `otel`: `v1.0.0-RC1` +* `otel/trace`: `v1.0.0-RC1` +* `otel/baggage`: `v1.0.0-RC1` +* `otel/sdk/trace`: `v1.0.0-RC1` + +The `otel/metric` and `otel/sdk/metric` modules remain at `v0.14.0`. + +A few minor issues are discovered in the `otel/trace` package. These issues are +resolved with some minor, but backwards incompatible, changes and are released +as a second release candidate: + +* `otel`: `v1.0.0-RC2` +* `otel/trace`: `v1.0.0-RC2` +* `otel/baggage`: `v1.0.0-RC2` +* `otel/sdk/trace`: `v1.0.0-RC2` + +Notice that all module version numbers are incremented to adhere to our +versioning policy. + +After these release candidates have been evaluated to satisfaction, they are +released as version `v1.0.0`. + +* `otel`: `v1.0.0` +* `otel/trace`: `v1.0.0` +* `otel/baggage`: `v1.0.0` +* `otel/sdk/trace`: `v1.0.0` + +Since both the `go` utility and the Go module system support [the semantic +versioning definition of +precedence](https://semver.org/spec/v2.0.0.html#spec-item-11), this release +will correctly be interpreted as the successor to the previous release +candidates. + +Active development of this project continues. The `otel/metric` module now has +backwards incompatible changes to its API that need to be released and the +`otel/baggage` module has a minor bug fix that needs to be released. The +following release is made: + +* `otel`: `v1.0.1` +* `otel/trace`: `v1.0.1` +* `otel/metric`: `v0.15.0` +* `otel/baggage`: `v1.0.1` +* `otel/sdk/trace`: `v1.0.1` +* `otel/sdk/metric`: `v0.15.0` + +Notice that, again, all stable module versions are incremented in unison and +the `otel/sdk/metric` package, which depends on the `otel/metric` package, also +bumped its version. This bump of the `otel/sdk/metric` package makes sense +given their coupling, though it is not explicitly required by our versioning +policy. + +As we progress, the `otel/metric` and `otel/sdk/metric` packages have reached a +point where they should be evaluated for stability. The `otel` module is +reintegrated with the `otel/metric` package and the following release is made: + +* `otel`: `v1.1.0-RC1` +* `otel/trace`: `v1.1.0-RC1` +* `otel/metric`: `v1.1.0-RC1` +* `otel/baggage`: `v1.1.0-RC1` +* `otel/sdk/trace`: `v1.1.0-RC1` +* `otel/sdk/metric`: `v1.1.0-RC1` + +All the modules are evaluated and determined to a viable stable release. They +are then released as version `v1.1.0` (the minor version is incremented to +indicate the addition of new signal). + +* `otel`: `v1.1.0` +* `otel/trace`: `v1.1.0` +* `otel/metric`: `v1.1.0` +* `otel/baggage`: `v1.1.0` +* `otel/sdk/trace`: `v1.1.0` +* `otel/sdk/metric`: `v1.1.0` diff --git a/vendor/go.opentelemetry.io/otel/attribute/doc.go b/vendor/go.opentelemetry.io/otel/attribute/doc.go new file mode 100644 index 0000000000..dafe7424df --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/doc.go @@ -0,0 +1,16 @@ +// Copyright The OpenTelemetry 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 attribute provides key and value attributes. +package attribute // import "go.opentelemetry.io/otel/attribute" diff --git a/vendor/go.opentelemetry.io/otel/attribute/encoder.go b/vendor/go.opentelemetry.io/otel/attribute/encoder.go new file mode 100644 index 0000000000..fe2bc5766c --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/encoder.go @@ -0,0 +1,146 @@ +// Copyright The OpenTelemetry 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 attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "bytes" + "sync" + "sync/atomic" +) + +type ( + // Encoder is a mechanism for serializing an attribute set into a specific + // string representation that supports caching, to avoid repeated + // serialization. An example could be an exporter encoding the attribute + // set into a wire representation. + Encoder interface { + // Encode returns the serialized encoding of the attribute set using + // its Iterator. This result may be cached by a attribute.Set. + Encode(iterator Iterator) string + + // ID returns a value that is unique for each class of attribute + // encoder. Attribute encoders allocate these using `NewEncoderID`. + ID() EncoderID + } + + // EncoderID is used to identify distinct Encoder + // implementations, for caching encoded results. + EncoderID struct { + value uint64 + } + + // defaultAttrEncoder uses a sync.Pool of buffers to reduce the number of + // allocations used in encoding attributes. This implementation encodes a + // comma-separated list of key=value, with '/'-escaping of '=', ',', and + // '\'. + defaultAttrEncoder struct { + // pool is a pool of attribute set builders. The buffers in this pool + // grow to a size that most attribute encodings will not allocate new + // memory. + pool sync.Pool // *bytes.Buffer + } +) + +// escapeChar is used to ensure uniqueness of the attribute encoding where +// keys or values contain either '=' or ','. Since there is no parser needed +// for this encoding and its only requirement is to be unique, this choice is +// arbitrary. Users will see these in some exporters (e.g., stdout), so the +// backslash ('\') is used as a conventional choice. +const escapeChar = '\\' + +var ( + _ Encoder = &defaultAttrEncoder{} + + // encoderIDCounter is for generating IDs for other attribute encoders. + encoderIDCounter uint64 + + defaultEncoderOnce sync.Once + defaultEncoderID = NewEncoderID() + defaultEncoderInstance *defaultAttrEncoder +) + +// NewEncoderID returns a unique attribute encoder ID. It should be called +// once per each type of attribute encoder. Preferably in init() or in var +// definition. +func NewEncoderID() EncoderID { + return EncoderID{value: atomic.AddUint64(&encoderIDCounter, 1)} +} + +// DefaultEncoder returns an attribute encoder that encodes attributes in such +// a way that each escaped attribute's key is followed by an equal sign and +// then by an escaped attribute's value. All key-value pairs are separated by +// a comma. +// +// Escaping is done by prepending a backslash before either a backslash, equal +// sign or a comma. +func DefaultEncoder() Encoder { + defaultEncoderOnce.Do(func() { + defaultEncoderInstance = &defaultAttrEncoder{ + pool: sync.Pool{ + New: func() interface{} { + return &bytes.Buffer{} + }, + }, + } + }) + return defaultEncoderInstance +} + +// Encode is a part of an implementation of the AttributeEncoder interface. +func (d *defaultAttrEncoder) Encode(iter Iterator) string { + buf := d.pool.Get().(*bytes.Buffer) + defer d.pool.Put(buf) + buf.Reset() + + for iter.Next() { + i, keyValue := iter.IndexedAttribute() + if i > 0 { + _, _ = buf.WriteRune(',') + } + copyAndEscape(buf, string(keyValue.Key)) + + _, _ = buf.WriteRune('=') + + if keyValue.Value.Type() == STRING { + copyAndEscape(buf, keyValue.Value.AsString()) + } else { + _, _ = buf.WriteString(keyValue.Value.Emit()) + } + } + return buf.String() +} + +// ID is a part of an implementation of the AttributeEncoder interface. +func (*defaultAttrEncoder) ID() EncoderID { + return defaultEncoderID +} + +// copyAndEscape escapes `=`, `,` and its own escape character (`\`), +// making the default encoding unique. +func copyAndEscape(buf *bytes.Buffer, val string) { + for _, ch := range val { + switch ch { + case '=', ',', escapeChar: + _, _ = buf.WriteRune(escapeChar) + } + _, _ = buf.WriteRune(ch) + } +} + +// Valid returns true if this encoder ID was allocated by +// `NewEncoderID`. Invalid encoder IDs will not be cached. +func (id EncoderID) Valid() bool { + return id.value != 0 +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/filter.go b/vendor/go.opentelemetry.io/otel/attribute/filter.go new file mode 100644 index 0000000000..638c213d59 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/filter.go @@ -0,0 +1,60 @@ +// Copyright The OpenTelemetry 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 attribute // import "go.opentelemetry.io/otel/attribute" + +// Filter supports removing certain attributes from attribute sets. When +// the filter returns true, the attribute will be kept in the filtered +// attribute set. When the filter returns false, the attribute is excluded +// from the filtered attribute set, and the attribute instead appears in +// the removed list of excluded attributes. +type Filter func(KeyValue) bool + +// NewAllowKeysFilter returns a Filter that only allows attributes with one of +// the provided keys. +// +// If keys is empty a deny-all filter is returned. +func NewAllowKeysFilter(keys ...Key) Filter { + if len(keys) <= 0 { + return func(kv KeyValue) bool { return false } + } + + allowed := make(map[Key]struct{}) + for _, k := range keys { + allowed[k] = struct{}{} + } + return func(kv KeyValue) bool { + _, ok := allowed[kv.Key] + return ok + } +} + +// NewDenyKeysFilter returns a Filter that only allows attributes +// that do not have one of the provided keys. +// +// If keys is empty an allow-all filter is returned. +func NewDenyKeysFilter(keys ...Key) Filter { + if len(keys) <= 0 { + return func(kv KeyValue) bool { return true } + } + + forbid := make(map[Key]struct{}) + for _, k := range keys { + forbid[k] = struct{}{} + } + return func(kv KeyValue) bool { + _, ok := forbid[kv.Key] + return !ok + } +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/iterator.go b/vendor/go.opentelemetry.io/otel/attribute/iterator.go new file mode 100644 index 0000000000..841b271fb7 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/iterator.go @@ -0,0 +1,161 @@ +// Copyright The OpenTelemetry 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 attribute // import "go.opentelemetry.io/otel/attribute" + +// Iterator allows iterating over the set of attributes in order, sorted by +// key. +type Iterator struct { + storage *Set + idx int +} + +// MergeIterator supports iterating over two sets of attributes while +// eliminating duplicate values from the combined set. The first iterator +// value takes precedence. +type MergeIterator struct { + one oneIterator + two oneIterator + current KeyValue +} + +type oneIterator struct { + iter Iterator + done bool + attr KeyValue +} + +// Next moves the iterator to the next position. Returns false if there are no +// more attributes. +func (i *Iterator) Next() bool { + i.idx++ + return i.idx < i.Len() +} + +// Label returns current KeyValue. Must be called only after Next returns +// true. +// +// Deprecated: Use Attribute instead. +func (i *Iterator) Label() KeyValue { + return i.Attribute() +} + +// Attribute returns the current KeyValue of the Iterator. It must be called +// only after Next returns true. +func (i *Iterator) Attribute() KeyValue { + kv, _ := i.storage.Get(i.idx) + return kv +} + +// IndexedLabel returns current index and attribute. Must be called only +// after Next returns true. +// +// Deprecated: Use IndexedAttribute instead. +func (i *Iterator) IndexedLabel() (int, KeyValue) { + return i.idx, i.Attribute() +} + +// IndexedAttribute returns current index and attribute. Must be called only +// after Next returns true. +func (i *Iterator) IndexedAttribute() (int, KeyValue) { + return i.idx, i.Attribute() +} + +// Len returns a number of attributes in the iterated set. +func (i *Iterator) Len() int { + return i.storage.Len() +} + +// ToSlice is a convenience function that creates a slice of attributes from +// the passed iterator. The iterator is set up to start from the beginning +// before creating the slice. +func (i *Iterator) ToSlice() []KeyValue { + l := i.Len() + if l == 0 { + return nil + } + i.idx = -1 + slice := make([]KeyValue, 0, l) + for i.Next() { + slice = append(slice, i.Attribute()) + } + return slice +} + +// NewMergeIterator returns a MergeIterator for merging two attribute sets. +// Duplicates are resolved by taking the value from the first set. +func NewMergeIterator(s1, s2 *Set) MergeIterator { + mi := MergeIterator{ + one: makeOne(s1.Iter()), + two: makeOne(s2.Iter()), + } + return mi +} + +func makeOne(iter Iterator) oneIterator { + oi := oneIterator{ + iter: iter, + } + oi.advance() + return oi +} + +func (oi *oneIterator) advance() { + if oi.done = !oi.iter.Next(); !oi.done { + oi.attr = oi.iter.Attribute() + } +} + +// Next returns true if there is another attribute available. +func (m *MergeIterator) Next() bool { + if m.one.done && m.two.done { + return false + } + if m.one.done { + m.current = m.two.attr + m.two.advance() + return true + } + if m.two.done { + m.current = m.one.attr + m.one.advance() + return true + } + if m.one.attr.Key == m.two.attr.Key { + m.current = m.one.attr // first iterator attribute value wins + m.one.advance() + m.two.advance() + return true + } + if m.one.attr.Key < m.two.attr.Key { + m.current = m.one.attr + m.one.advance() + return true + } + m.current = m.two.attr + m.two.advance() + return true +} + +// Label returns the current value after Next() returns true. +// +// Deprecated: Use Attribute instead. +func (m *MergeIterator) Label() KeyValue { + return m.current +} + +// Attribute returns the current value after Next() returns true. +func (m *MergeIterator) Attribute() KeyValue { + return m.current +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/key.go b/vendor/go.opentelemetry.io/otel/attribute/key.go new file mode 100644 index 0000000000..0656a04e43 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/key.go @@ -0,0 +1,134 @@ +// Copyright The OpenTelemetry 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 attribute // import "go.opentelemetry.io/otel/attribute" + +// Key represents the key part in key-value pairs. It's a string. The +// allowed character set in the key depends on the use of the key. +type Key string + +// Bool creates a KeyValue instance with a BOOL Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Bool(name, value). +func (k Key) Bool(v bool) KeyValue { + return KeyValue{ + Key: k, + Value: BoolValue(v), + } +} + +// BoolSlice creates a KeyValue instance with a BOOLSLICE Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- BoolSlice(name, value). +func (k Key) BoolSlice(v []bool) KeyValue { + return KeyValue{ + Key: k, + Value: BoolSliceValue(v), + } +} + +// Int creates a KeyValue instance with an INT64 Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Int(name, value). +func (k Key) Int(v int) KeyValue { + return KeyValue{ + Key: k, + Value: IntValue(v), + } +} + +// IntSlice creates a KeyValue instance with an INT64SLICE Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- IntSlice(name, value). +func (k Key) IntSlice(v []int) KeyValue { + return KeyValue{ + Key: k, + Value: IntSliceValue(v), + } +} + +// Int64 creates a KeyValue instance with an INT64 Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Int64(name, value). +func (k Key) Int64(v int64) KeyValue { + return KeyValue{ + Key: k, + Value: Int64Value(v), + } +} + +// Int64Slice creates a KeyValue instance with an INT64SLICE Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Int64Slice(name, value). +func (k Key) Int64Slice(v []int64) KeyValue { + return KeyValue{ + Key: k, + Value: Int64SliceValue(v), + } +} + +// Float64 creates a KeyValue instance with a FLOAT64 Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Float64(name, value). +func (k Key) Float64(v float64) KeyValue { + return KeyValue{ + Key: k, + Value: Float64Value(v), + } +} + +// Float64Slice creates a KeyValue instance with a FLOAT64SLICE Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- Float64(name, value). +func (k Key) Float64Slice(v []float64) KeyValue { + return KeyValue{ + Key: k, + Value: Float64SliceValue(v), + } +} + +// String creates a KeyValue instance with a STRING Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- String(name, value). +func (k Key) String(v string) KeyValue { + return KeyValue{ + Key: k, + Value: StringValue(v), + } +} + +// StringSlice creates a KeyValue instance with a STRINGSLICE Value. +// +// If creating both a key and value at the same time, use the provided +// convenience function instead -- StringSlice(name, value). +func (k Key) StringSlice(v []string) KeyValue { + return KeyValue{ + Key: k, + Value: StringSliceValue(v), + } +} + +// Defined returns true for non-empty keys. +func (k Key) Defined() bool { + return len(k) != 0 +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/kv.go b/vendor/go.opentelemetry.io/otel/attribute/kv.go new file mode 100644 index 0000000000..1ddf3ce058 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/kv.go @@ -0,0 +1,86 @@ +// Copyright The OpenTelemetry 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 attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "fmt" +) + +// KeyValue holds a key and value pair. +type KeyValue struct { + Key Key + Value Value +} + +// Valid returns if kv is a valid OpenTelemetry attribute. +func (kv KeyValue) Valid() bool { + return kv.Key.Defined() && kv.Value.Type() != INVALID +} + +// Bool creates a KeyValue with a BOOL Value type. +func Bool(k string, v bool) KeyValue { + return Key(k).Bool(v) +} + +// BoolSlice creates a KeyValue with a BOOLSLICE Value type. +func BoolSlice(k string, v []bool) KeyValue { + return Key(k).BoolSlice(v) +} + +// Int creates a KeyValue with an INT64 Value type. +func Int(k string, v int) KeyValue { + return Key(k).Int(v) +} + +// IntSlice creates a KeyValue with an INT64SLICE Value type. +func IntSlice(k string, v []int) KeyValue { + return Key(k).IntSlice(v) +} + +// Int64 creates a KeyValue with an INT64 Value type. +func Int64(k string, v int64) KeyValue { + return Key(k).Int64(v) +} + +// Int64Slice creates a KeyValue with an INT64SLICE Value type. +func Int64Slice(k string, v []int64) KeyValue { + return Key(k).Int64Slice(v) +} + +// Float64 creates a KeyValue with a FLOAT64 Value type. +func Float64(k string, v float64) KeyValue { + return Key(k).Float64(v) +} + +// Float64Slice creates a KeyValue with a FLOAT64SLICE Value type. +func Float64Slice(k string, v []float64) KeyValue { + return Key(k).Float64Slice(v) +} + +// String creates a KeyValue with a STRING Value type. +func String(k, v string) KeyValue { + return Key(k).String(v) +} + +// StringSlice creates a KeyValue with a STRINGSLICE Value type. +func StringSlice(k string, v []string) KeyValue { + return Key(k).StringSlice(v) +} + +// Stringer creates a new key-value pair with a passed name and a string +// value generated by the passed Stringer interface. +func Stringer(k string, v fmt.Stringer) KeyValue { + return Key(k).String(v.String()) +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/set.go b/vendor/go.opentelemetry.io/otel/attribute/set.go new file mode 100644 index 0000000000..fb6da51450 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/set.go @@ -0,0 +1,452 @@ +// Copyright The OpenTelemetry 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 attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "encoding/json" + "reflect" + "sort" + "sync" +) + +type ( + // Set is the representation for a distinct attribute set. It manages an + // immutable set of attributes, with an internal cache for storing + // attribute encodings. + // + // This type supports the Equivalent method of comparison using values of + // type Distinct. + Set struct { + equivalent Distinct + } + + // Distinct wraps a variable-size array of KeyValue, constructed with keys + // in sorted order. This can be used as a map key or for equality checking + // between Sets. + Distinct struct { + iface interface{} + } + + // Sortable implements sort.Interface, used for sorting KeyValue. This is + // an exported type to support a memory optimization. A pointer to one of + // these is needed for the call to sort.Stable(), which the caller may + // provide in order to avoid an allocation. See NewSetWithSortable(). + Sortable []KeyValue +) + +var ( + // keyValueType is used in computeDistinctReflect. + keyValueType = reflect.TypeOf(KeyValue{}) + + // emptySet is returned for empty attribute sets. + emptySet = &Set{ + equivalent: Distinct{ + iface: [0]KeyValue{}, + }, + } + + // sortables is a pool of Sortables used to create Sets with a user does + // not provide one. + sortables = sync.Pool{ + New: func() interface{} { return new(Sortable) }, + } +) + +// EmptySet returns a reference to a Set with no elements. +// +// This is a convenience provided for optimized calling utility. +func EmptySet() *Set { + return emptySet +} + +// reflectValue abbreviates reflect.ValueOf(d). +func (d Distinct) reflectValue() reflect.Value { + return reflect.ValueOf(d.iface) +} + +// Valid returns true if this value refers to a valid Set. +func (d Distinct) Valid() bool { + return d.iface != nil +} + +// Len returns the number of attributes in this set. +func (l *Set) Len() int { + if l == nil || !l.equivalent.Valid() { + return 0 + } + return l.equivalent.reflectValue().Len() +} + +// Get returns the KeyValue at ordered position idx in this set. +func (l *Set) Get(idx int) (KeyValue, bool) { + if l == nil || !l.equivalent.Valid() { + return KeyValue{}, false + } + value := l.equivalent.reflectValue() + + if idx >= 0 && idx < value.Len() { + // Note: The Go compiler successfully avoids an allocation for + // the interface{} conversion here: + return value.Index(idx).Interface().(KeyValue), true + } + + return KeyValue{}, false +} + +// Value returns the value of a specified key in this set. +func (l *Set) Value(k Key) (Value, bool) { + if l == nil || !l.equivalent.Valid() { + return Value{}, false + } + rValue := l.equivalent.reflectValue() + vlen := rValue.Len() + + idx := sort.Search(vlen, func(idx int) bool { + return rValue.Index(idx).Interface().(KeyValue).Key >= k + }) + if idx >= vlen { + return Value{}, false + } + keyValue := rValue.Index(idx).Interface().(KeyValue) + if k == keyValue.Key { + return keyValue.Value, true + } + return Value{}, false +} + +// HasValue tests whether a key is defined in this set. +func (l *Set) HasValue(k Key) bool { + if l == nil { + return false + } + _, ok := l.Value(k) + return ok +} + +// Iter returns an iterator for visiting the attributes in this set. +func (l *Set) Iter() Iterator { + return Iterator{ + storage: l, + idx: -1, + } +} + +// ToSlice returns the set of attributes belonging to this set, sorted, where +// keys appear no more than once. +func (l *Set) ToSlice() []KeyValue { + iter := l.Iter() + return iter.ToSlice() +} + +// Equivalent returns a value that may be used as a map key. The Distinct type +// guarantees that the result will equal the equivalent. Distinct value of any +// attribute set with the same elements as this, where sets are made unique by +// choosing the last value in the input for any given key. +func (l *Set) Equivalent() Distinct { + if l == nil || !l.equivalent.Valid() { + return emptySet.equivalent + } + return l.equivalent +} + +// Equals returns true if the argument set is equivalent to this set. +func (l *Set) Equals(o *Set) bool { + return l.Equivalent() == o.Equivalent() +} + +// Encoded returns the encoded form of this set, according to encoder. +func (l *Set) Encoded(encoder Encoder) string { + if l == nil || encoder == nil { + return "" + } + + return encoder.Encode(l.Iter()) +} + +func empty() Set { + return Set{ + equivalent: emptySet.equivalent, + } +} + +// NewSet returns a new Set. See the documentation for +// NewSetWithSortableFiltered for more details. +// +// Except for empty sets, this method adds an additional allocation compared +// with calls that include a Sortable. +func NewSet(kvs ...KeyValue) Set { + // Check for empty set. + if len(kvs) == 0 { + return empty() + } + srt := sortables.Get().(*Sortable) + s, _ := NewSetWithSortableFiltered(kvs, srt, nil) + sortables.Put(srt) + return s +} + +// NewSetWithSortable returns a new Set. See the documentation for +// NewSetWithSortableFiltered for more details. +// +// This call includes a Sortable option as a memory optimization. +func NewSetWithSortable(kvs []KeyValue, tmp *Sortable) Set { + // Check for empty set. + if len(kvs) == 0 { + return empty() + } + s, _ := NewSetWithSortableFiltered(kvs, tmp, nil) + return s +} + +// NewSetWithFiltered returns a new Set. See the documentation for +// NewSetWithSortableFiltered for more details. +// +// This call includes a Filter to include/exclude attribute keys from the +// return value. Excluded keys are returned as a slice of attribute values. +func NewSetWithFiltered(kvs []KeyValue, filter Filter) (Set, []KeyValue) { + // Check for empty set. + if len(kvs) == 0 { + return empty(), nil + } + srt := sortables.Get().(*Sortable) + s, filtered := NewSetWithSortableFiltered(kvs, srt, filter) + sortables.Put(srt) + return s, filtered +} + +// NewSetWithSortableFiltered returns a new Set. +// +// Duplicate keys are eliminated by taking the last value. This +// re-orders the input slice so that unique last-values are contiguous +// at the end of the slice. +// +// This ensures the following: +// +// - Last-value-wins semantics +// - Caller sees the reordering, but doesn't lose values +// - Repeated call preserve last-value wins. +// +// Note that methods are defined on Set, although this returns Set. Callers +// can avoid memory allocations by: +// +// - allocating a Sortable for use as a temporary in this method +// - allocating a Set for storing the return value of this constructor. +// +// The result maintains a cache of encoded attributes, by attribute.EncoderID. +// This value should not be copied after its first use. +// +// The second []KeyValue return value is a list of attributes that were +// excluded by the Filter (if non-nil). +func NewSetWithSortableFiltered(kvs []KeyValue, tmp *Sortable, filter Filter) (Set, []KeyValue) { + // Check for empty set. + if len(kvs) == 0 { + return empty(), nil + } + + *tmp = kvs + + // Stable sort so the following de-duplication can implement + // last-value-wins semantics. + sort.Stable(tmp) + + *tmp = nil + + position := len(kvs) - 1 + offset := position - 1 + + // The requirements stated above require that the stable + // result be placed in the end of the input slice, while + // overwritten values are swapped to the beginning. + // + // De-duplicate with last-value-wins semantics. Preserve + // duplicate values at the beginning of the input slice. + for ; offset >= 0; offset-- { + if kvs[offset].Key == kvs[position].Key { + continue + } + position-- + kvs[offset], kvs[position] = kvs[position], kvs[offset] + } + kvs = kvs[position:] + + if filter != nil { + if div := filteredToFront(kvs, filter); div != 0 { + return Set{equivalent: computeDistinct(kvs[div:])}, kvs[:div] + } + } + return Set{equivalent: computeDistinct(kvs)}, nil +} + +// filteredToFront filters slice in-place using keep function. All KeyValues that need to +// be removed are moved to the front. All KeyValues that need to be kept are +// moved (in-order) to the back. The index for the first KeyValue to be kept is +// returned. +func filteredToFront(slice []KeyValue, keep Filter) int { + n := len(slice) + j := n + for i := n - 1; i >= 0; i-- { + if keep(slice[i]) { + j-- + slice[i], slice[j] = slice[j], slice[i] + } + } + return j +} + +// Filter returns a filtered copy of this Set. See the documentation for +// NewSetWithSortableFiltered for more details. +func (l *Set) Filter(re Filter) (Set, []KeyValue) { + if re == nil { + return *l, nil + } + + // Iterate in reverse to the first attribute that will be filtered out. + n := l.Len() + first := n - 1 + for ; first >= 0; first-- { + kv, _ := l.Get(first) + if !re(kv) { + break + } + } + + // No attributes will be dropped, return the immutable Set l and nil. + if first < 0 { + return *l, nil + } + + // Copy now that we know we need to return a modified set. + // + // Do not do this in-place on the underlying storage of *Set l. Sets are + // immutable and filtering should not change this. + slice := l.ToSlice() + + // Don't re-iterate the slice if only slice[0] is filtered. + if first == 0 { + // It is safe to assume len(slice) >= 1 given we found at least one + // attribute above that needs to be filtered out. + return Set{equivalent: computeDistinct(slice[1:])}, slice[:1] + } + + // Move the filtered slice[first] to the front (preserving order). + kv := slice[first] + copy(slice[1:first+1], slice[:first]) + slice[0] = kv + + // Do not re-evaluate re(slice[first+1:]). + div := filteredToFront(slice[1:first+1], re) + 1 + return Set{equivalent: computeDistinct(slice[div:])}, slice[:div] +} + +// computeDistinct returns a Distinct using either the fixed- or +// reflect-oriented code path, depending on the size of the input. The input +// slice is assumed to already be sorted and de-duplicated. +func computeDistinct(kvs []KeyValue) Distinct { + iface := computeDistinctFixed(kvs) + if iface == nil { + iface = computeDistinctReflect(kvs) + } + return Distinct{ + iface: iface, + } +} + +// computeDistinctFixed computes a Distinct for small slices. It returns nil +// if the input is too large for this code path. +func computeDistinctFixed(kvs []KeyValue) interface{} { + switch len(kvs) { + case 1: + ptr := new([1]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 2: + ptr := new([2]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 3: + ptr := new([3]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 4: + ptr := new([4]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 5: + ptr := new([5]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 6: + ptr := new([6]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 7: + ptr := new([7]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 8: + ptr := new([8]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 9: + ptr := new([9]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + case 10: + ptr := new([10]KeyValue) + copy((*ptr)[:], kvs) + return *ptr + default: + return nil + } +} + +// computeDistinctReflect computes a Distinct using reflection, works for any +// size input. +func computeDistinctReflect(kvs []KeyValue) interface{} { + at := reflect.New(reflect.ArrayOf(len(kvs), keyValueType)).Elem() + for i, keyValue := range kvs { + *(at.Index(i).Addr().Interface().(*KeyValue)) = keyValue + } + return at.Interface() +} + +// MarshalJSON returns the JSON encoding of the Set. +func (l *Set) MarshalJSON() ([]byte, error) { + return json.Marshal(l.equivalent.iface) +} + +// MarshalLog is the marshaling function used by the logging system to represent this Set. +func (l Set) MarshalLog() interface{} { + kvs := make(map[string]string) + for _, kv := range l.ToSlice() { + kvs[string(kv.Key)] = kv.Value.Emit() + } + return kvs +} + +// Len implements sort.Interface. +func (l *Sortable) Len() int { + return len(*l) +} + +// Swap implements sort.Interface. +func (l *Sortable) Swap(i, j int) { + (*l)[i], (*l)[j] = (*l)[j], (*l)[i] +} + +// Less implements sort.Interface. +func (l *Sortable) Less(i, j int) bool { + return (*l)[i].Key < (*l)[j].Key +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/type_string.go b/vendor/go.opentelemetry.io/otel/attribute/type_string.go new file mode 100644 index 0000000000..e584b24776 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/type_string.go @@ -0,0 +1,31 @@ +// Code generated by "stringer -type=Type"; DO NOT EDIT. + +package attribute + +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[INVALID-0] + _ = x[BOOL-1] + _ = x[INT64-2] + _ = x[FLOAT64-3] + _ = x[STRING-4] + _ = x[BOOLSLICE-5] + _ = x[INT64SLICE-6] + _ = x[FLOAT64SLICE-7] + _ = x[STRINGSLICE-8] +} + +const _Type_name = "INVALIDBOOLINT64FLOAT64STRINGBOOLSLICEINT64SLICEFLOAT64SLICESTRINGSLICE" + +var _Type_index = [...]uint8{0, 7, 11, 16, 23, 29, 38, 48, 60, 71} + +func (i Type) String() string { + if i < 0 || i >= Type(len(_Type_index)-1) { + return "Type(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _Type_name[_Type_index[i]:_Type_index[i+1]] +} diff --git a/vendor/go.opentelemetry.io/otel/attribute/value.go b/vendor/go.opentelemetry.io/otel/attribute/value.go new file mode 100644 index 0000000000..cb21dd5c09 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/attribute/value.go @@ -0,0 +1,270 @@ +// Copyright The OpenTelemetry 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 attribute // import "go.opentelemetry.io/otel/attribute" + +import ( + "encoding/json" + "fmt" + "reflect" + "strconv" + + "go.opentelemetry.io/otel/internal" + "go.opentelemetry.io/otel/internal/attribute" +) + +//go:generate stringer -type=Type + +// Type describes the type of the data Value holds. +type Type int // nolint: revive // redefines builtin Type. + +// Value represents the value part in key-value pairs. +type Value struct { + vtype Type + numeric uint64 + stringly string + slice interface{} +} + +const ( + // INVALID is used for a Value with no value set. + INVALID Type = iota + // BOOL is a boolean Type Value. + BOOL + // INT64 is a 64-bit signed integral Type Value. + INT64 + // FLOAT64 is a 64-bit floating point Type Value. + FLOAT64 + // STRING is a string Type Value. + STRING + // BOOLSLICE is a slice of booleans Type Value. + BOOLSLICE + // INT64SLICE is a slice of 64-bit signed integral numbers Type Value. + INT64SLICE + // FLOAT64SLICE is a slice of 64-bit floating point numbers Type Value. + FLOAT64SLICE + // STRINGSLICE is a slice of strings Type Value. + STRINGSLICE +) + +// BoolValue creates a BOOL Value. +func BoolValue(v bool) Value { + return Value{ + vtype: BOOL, + numeric: internal.BoolToRaw(v), + } +} + +// BoolSliceValue creates a BOOLSLICE Value. +func BoolSliceValue(v []bool) Value { + return Value{vtype: BOOLSLICE, slice: attribute.BoolSliceValue(v)} +} + +// IntValue creates an INT64 Value. +func IntValue(v int) Value { + return Int64Value(int64(v)) +} + +// IntSliceValue creates an INTSLICE Value. +func IntSliceValue(v []int) Value { + var int64Val int64 + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(int64Val))) + for i, val := range v { + cp.Elem().Index(i).SetInt(int64(val)) + } + return Value{ + vtype: INT64SLICE, + slice: cp.Elem().Interface(), + } +} + +// Int64Value creates an INT64 Value. +func Int64Value(v int64) Value { + return Value{ + vtype: INT64, + numeric: internal.Int64ToRaw(v), + } +} + +// Int64SliceValue creates an INT64SLICE Value. +func Int64SliceValue(v []int64) Value { + return Value{vtype: INT64SLICE, slice: attribute.Int64SliceValue(v)} +} + +// Float64Value creates a FLOAT64 Value. +func Float64Value(v float64) Value { + return Value{ + vtype: FLOAT64, + numeric: internal.Float64ToRaw(v), + } +} + +// Float64SliceValue creates a FLOAT64SLICE Value. +func Float64SliceValue(v []float64) Value { + return Value{vtype: FLOAT64SLICE, slice: attribute.Float64SliceValue(v)} +} + +// StringValue creates a STRING Value. +func StringValue(v string) Value { + return Value{ + vtype: STRING, + stringly: v, + } +} + +// StringSliceValue creates a STRINGSLICE Value. +func StringSliceValue(v []string) Value { + return Value{vtype: STRINGSLICE, slice: attribute.StringSliceValue(v)} +} + +// Type returns a type of the Value. +func (v Value) Type() Type { + return v.vtype +} + +// AsBool returns the bool value. Make sure that the Value's type is +// BOOL. +func (v Value) AsBool() bool { + return internal.RawToBool(v.numeric) +} + +// AsBoolSlice returns the []bool value. Make sure that the Value's type is +// BOOLSLICE. +func (v Value) AsBoolSlice() []bool { + if v.vtype != BOOLSLICE { + return nil + } + return v.asBoolSlice() +} + +func (v Value) asBoolSlice() []bool { + return attribute.AsBoolSlice(v.slice) +} + +// AsInt64 returns the int64 value. Make sure that the Value's type is +// INT64. +func (v Value) AsInt64() int64 { + return internal.RawToInt64(v.numeric) +} + +// AsInt64Slice returns the []int64 value. Make sure that the Value's type is +// INT64SLICE. +func (v Value) AsInt64Slice() []int64 { + if v.vtype != INT64SLICE { + return nil + } + return v.asInt64Slice() +} + +func (v Value) asInt64Slice() []int64 { + return attribute.AsInt64Slice(v.slice) +} + +// AsFloat64 returns the float64 value. Make sure that the Value's +// type is FLOAT64. +func (v Value) AsFloat64() float64 { + return internal.RawToFloat64(v.numeric) +} + +// AsFloat64Slice returns the []float64 value. Make sure that the Value's type is +// FLOAT64SLICE. +func (v Value) AsFloat64Slice() []float64 { + if v.vtype != FLOAT64SLICE { + return nil + } + return v.asFloat64Slice() +} + +func (v Value) asFloat64Slice() []float64 { + return attribute.AsFloat64Slice(v.slice) +} + +// AsString returns the string value. Make sure that the Value's type +// is STRING. +func (v Value) AsString() string { + return v.stringly +} + +// AsStringSlice returns the []string value. Make sure that the Value's type is +// STRINGSLICE. +func (v Value) AsStringSlice() []string { + if v.vtype != STRINGSLICE { + return nil + } + return v.asStringSlice() +} + +func (v Value) asStringSlice() []string { + return attribute.AsStringSlice(v.slice) +} + +type unknownValueType struct{} + +// AsInterface returns Value's data as interface{}. +func (v Value) AsInterface() interface{} { + switch v.Type() { + case BOOL: + return v.AsBool() + case BOOLSLICE: + return v.asBoolSlice() + case INT64: + return v.AsInt64() + case INT64SLICE: + return v.asInt64Slice() + case FLOAT64: + return v.AsFloat64() + case FLOAT64SLICE: + return v.asFloat64Slice() + case STRING: + return v.stringly + case STRINGSLICE: + return v.asStringSlice() + } + return unknownValueType{} +} + +// Emit returns a string representation of Value's data. +func (v Value) Emit() string { + switch v.Type() { + case BOOLSLICE: + return fmt.Sprint(v.asBoolSlice()) + case BOOL: + return strconv.FormatBool(v.AsBool()) + case INT64SLICE: + return fmt.Sprint(v.asInt64Slice()) + case INT64: + return strconv.FormatInt(v.AsInt64(), 10) + case FLOAT64SLICE: + return fmt.Sprint(v.asFloat64Slice()) + case FLOAT64: + return fmt.Sprint(v.AsFloat64()) + case STRINGSLICE: + return fmt.Sprint(v.asStringSlice()) + case STRING: + return v.stringly + default: + return "unknown" + } +} + +// MarshalJSON returns the JSON encoding of the Value. +func (v Value) MarshalJSON() ([]byte, error) { + var jsonVal struct { + Type string + Value interface{} + } + jsonVal.Type = v.Type().String() + jsonVal.Value = v.AsInterface() + return json.Marshal(jsonVal) +} diff --git a/vendor/go.opentelemetry.io/otel/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/baggage/baggage.go new file mode 100644 index 0000000000..7d27cf77d5 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/baggage/baggage.go @@ -0,0 +1,744 @@ +// Copyright The OpenTelemetry 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 baggage // import "go.opentelemetry.io/otel/baggage" + +import ( + "errors" + "fmt" + "net/url" + "strings" + + "go.opentelemetry.io/otel/internal/baggage" +) + +const ( + maxMembers = 180 + maxBytesPerMembers = 4096 + maxBytesPerBaggageString = 8192 + + listDelimiter = "," + keyValueDelimiter = "=" + propertyDelimiter = ";" +) + +var ( + errInvalidKey = errors.New("invalid key") + errInvalidValue = errors.New("invalid value") + errInvalidProperty = errors.New("invalid baggage list-member property") + errInvalidMember = errors.New("invalid baggage list-member") + errMemberNumber = errors.New("too many list-members in baggage-string") + errMemberBytes = errors.New("list-member too large") + errBaggageBytes = errors.New("baggage-string too large") +) + +// Property is an additional metadata entry for a baggage list-member. +type Property struct { + key, value string + + // hasValue indicates if a zero-value value means the property does not + // have a value or if it was the zero-value. + hasValue bool +} + +// NewKeyProperty returns a new Property for key. +// +// If key is invalid, an error will be returned. +func NewKeyProperty(key string) (Property, error) { + if !validateKey(key) { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key) + } + + p := Property{key: key} + return p, nil +} + +// NewKeyValueProperty returns a new Property for key with value. +// +// The passed key must be compliant with W3C Baggage specification. +// The passed value must be precent-encoded as defined in W3C Baggage specification. +// +// Notice: Consider using [NewKeyValuePropertyRaw] instead +// that does not require precent-encoding of the value. +func NewKeyValueProperty(key, value string) (Property, error) { + if !validateValue(value) { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value) + } + decodedValue, err := url.PathUnescape(value) + if err != nil { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value) + } + return NewKeyValuePropertyRaw(key, decodedValue) +} + +// NewKeyValuePropertyRaw returns a new Property for key with value. +// +// The passed key must be compliant with W3C Baggage specification. +func NewKeyValuePropertyRaw(key, value string) (Property, error) { + if !validateKey(key) { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key) + } + + p := Property{ + key: key, + value: value, + hasValue: true, + } + return p, nil +} + +func newInvalidProperty() Property { + return Property{} +} + +// parseProperty attempts to decode a Property from the passed string. It +// returns an error if the input is invalid according to the W3C Baggage +// specification. +func parseProperty(property string) (Property, error) { + if property == "" { + return newInvalidProperty(), nil + } + + p, ok := parsePropertyInternal(property) + if !ok { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidProperty, property) + } + + return p, nil +} + +// validate ensures p conforms to the W3C Baggage specification, returning an +// error otherwise. +func (p Property) validate() error { + errFunc := func(err error) error { + return fmt.Errorf("invalid property: %w", err) + } + + if !validateKey(p.key) { + return errFunc(fmt.Errorf("%w: %q", errInvalidKey, p.key)) + } + if !p.hasValue && p.value != "" { + return errFunc(errors.New("inconsistent value")) + } + return nil +} + +// Key returns the Property key. +func (p Property) Key() string { + return p.key +} + +// Value returns the Property value. Additionally, a boolean value is returned +// indicating if the returned value is the empty if the Property has a value +// that is empty or if the value is not set. +func (p Property) Value() (string, bool) { + return p.value, p.hasValue +} + +// String encodes Property into a header string compliant with the W3C Baggage +// specification. +func (p Property) String() string { + if p.hasValue { + return fmt.Sprintf("%s%s%v", p.key, keyValueDelimiter, valueEscape(p.value)) + } + return p.key +} + +type properties []Property + +func fromInternalProperties(iProps []baggage.Property) properties { + if len(iProps) == 0 { + return nil + } + + props := make(properties, len(iProps)) + for i, p := range iProps { + props[i] = Property{ + key: p.Key, + value: p.Value, + hasValue: p.HasValue, + } + } + return props +} + +func (p properties) asInternal() []baggage.Property { + if len(p) == 0 { + return nil + } + + iProps := make([]baggage.Property, len(p)) + for i, prop := range p { + iProps[i] = baggage.Property{ + Key: prop.key, + Value: prop.value, + HasValue: prop.hasValue, + } + } + return iProps +} + +func (p properties) Copy() properties { + if len(p) == 0 { + return nil + } + + props := make(properties, len(p)) + copy(props, p) + return props +} + +// validate ensures each Property in p conforms to the W3C Baggage +// specification, returning an error otherwise. +func (p properties) validate() error { + for _, prop := range p { + if err := prop.validate(); err != nil { + return err + } + } + return nil +} + +// String encodes properties into a header string compliant with the W3C Baggage +// specification. +func (p properties) String() string { + props := make([]string, len(p)) + for i, prop := range p { + props[i] = prop.String() + } + return strings.Join(props, propertyDelimiter) +} + +// Member is a list-member of a baggage-string as defined by the W3C Baggage +// specification. +type Member struct { + key, value string + properties properties + + // hasData indicates whether the created property contains data or not. + // Properties that do not contain data are invalid with no other check + // required. + hasData bool +} + +// NewMemberRaw returns a new Member from the passed arguments. +// +// The passed key must be compliant with W3C Baggage specification. +// The passed value must be precent-encoded as defined in W3C Baggage specification. +// +// Notice: Consider using [NewMemberRaw] instead +// that does not require precent-encoding of the value. +func NewMember(key, value string, props ...Property) (Member, error) { + if !validateValue(value) { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value) + } + decodedValue, err := url.PathUnescape(value) + if err != nil { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value) + } + return NewMemberRaw(key, decodedValue, props...) +} + +// NewMemberRaw returns a new Member from the passed arguments. +// +// The passed key must be compliant with W3C Baggage specification. +func NewMemberRaw(key, value string, props ...Property) (Member, error) { + m := Member{ + key: key, + value: value, + properties: properties(props).Copy(), + hasData: true, + } + if err := m.validate(); err != nil { + return newInvalidMember(), err + } + return m, nil +} + +func newInvalidMember() Member { + return Member{} +} + +// parseMember attempts to decode a Member from the passed string. It returns +// an error if the input is invalid according to the W3C Baggage +// specification. +func parseMember(member string) (Member, error) { + if n := len(member); n > maxBytesPerMembers { + return newInvalidMember(), fmt.Errorf("%w: %d", errMemberBytes, n) + } + + var props properties + keyValue, properties, found := strings.Cut(member, propertyDelimiter) + if found { + // Parse the member properties. + for _, pStr := range strings.Split(properties, propertyDelimiter) { + p, err := parseProperty(pStr) + if err != nil { + return newInvalidMember(), err + } + props = append(props, p) + } + } + // Parse the member key/value pair. + + // Take into account a value can contain equal signs (=). + k, v, found := strings.Cut(keyValue, keyValueDelimiter) + if !found { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidMember, member) + } + // "Leading and trailing whitespaces are allowed but MUST be trimmed + // when converting the header into a data structure." + key := strings.TrimSpace(k) + if !validateKey(key) { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidKey, key) + } + + val := strings.TrimSpace(v) + if !validateValue(val) { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, v) + } + + // Decode a precent-encoded value. + value, err := url.PathUnescape(val) + if err != nil { + return newInvalidMember(), fmt.Errorf("%w: %v", errInvalidValue, err) + } + return Member{key: key, value: value, properties: props, hasData: true}, nil +} + +// validate ensures m conforms to the W3C Baggage specification. +// A key must be an ASCII string, returning an error otherwise. +func (m Member) validate() error { + if !m.hasData { + return fmt.Errorf("%w: %q", errInvalidMember, m) + } + + if !validateKey(m.key) { + return fmt.Errorf("%w: %q", errInvalidKey, m.key) + } + return m.properties.validate() +} + +// Key returns the Member key. +func (m Member) Key() string { return m.key } + +// Value returns the Member value. +func (m Member) Value() string { return m.value } + +// Properties returns a copy of the Member properties. +func (m Member) Properties() []Property { return m.properties.Copy() } + +// String encodes Member into a header string compliant with the W3C Baggage +// specification. +func (m Member) String() string { + // A key is just an ASCII string. A value is restricted to be + // US-ASCII characters excluding CTLs, whitespace, + // DQUOTE, comma, semicolon, and backslash. + s := fmt.Sprintf("%s%s%s", m.key, keyValueDelimiter, valueEscape(m.value)) + if len(m.properties) > 0 { + s = fmt.Sprintf("%s%s%s", s, propertyDelimiter, m.properties.String()) + } + return s +} + +// Baggage is a list of baggage members representing the baggage-string as +// defined by the W3C Baggage specification. +type Baggage struct { //nolint:golint + list baggage.List +} + +// New returns a new valid Baggage. It returns an error if it results in a +// Baggage exceeding limits set in that specification. +// +// It expects all the provided members to have already been validated. +func New(members ...Member) (Baggage, error) { + if len(members) == 0 { + return Baggage{}, nil + } + + b := make(baggage.List) + for _, m := range members { + if !m.hasData { + return Baggage{}, errInvalidMember + } + + // OpenTelemetry resolves duplicates by last-one-wins. + b[m.key] = baggage.Item{ + Value: m.value, + Properties: m.properties.asInternal(), + } + } + + // Check member numbers after deduplication. + if len(b) > maxMembers { + return Baggage{}, errMemberNumber + } + + bag := Baggage{b} + if n := len(bag.String()); n > maxBytesPerBaggageString { + return Baggage{}, fmt.Errorf("%w: %d", errBaggageBytes, n) + } + + return bag, nil +} + +// Parse attempts to decode a baggage-string from the passed string. It +// returns an error if the input is invalid according to the W3C Baggage +// specification. +// +// If there are duplicate list-members contained in baggage, the last one +// defined (reading left-to-right) will be the only one kept. This diverges +// from the W3C Baggage specification which allows duplicate list-members, but +// conforms to the OpenTelemetry Baggage specification. +func Parse(bStr string) (Baggage, error) { + if bStr == "" { + return Baggage{}, nil + } + + if n := len(bStr); n > maxBytesPerBaggageString { + return Baggage{}, fmt.Errorf("%w: %d", errBaggageBytes, n) + } + + b := make(baggage.List) + for _, memberStr := range strings.Split(bStr, listDelimiter) { + m, err := parseMember(memberStr) + if err != nil { + return Baggage{}, err + } + // OpenTelemetry resolves duplicates by last-one-wins. + b[m.key] = baggage.Item{ + Value: m.value, + Properties: m.properties.asInternal(), + } + } + + // OpenTelemetry does not allow for duplicate list-members, but the W3C + // specification does. Now that we have deduplicated, ensure the baggage + // does not exceed list-member limits. + if len(b) > maxMembers { + return Baggage{}, errMemberNumber + } + + return Baggage{b}, nil +} + +// Member returns the baggage list-member identified by key. +// +// If there is no list-member matching the passed key the returned Member will +// be a zero-value Member. +// The returned member is not validated, as we assume the validation happened +// when it was added to the Baggage. +func (b Baggage) Member(key string) Member { + v, ok := b.list[key] + if !ok { + // We do not need to worry about distinguishing between the situation + // where a zero-valued Member is included in the Baggage because a + // zero-valued Member is invalid according to the W3C Baggage + // specification (it has an empty key). + return newInvalidMember() + } + + return Member{ + key: key, + value: v.Value, + properties: fromInternalProperties(v.Properties), + hasData: true, + } +} + +// Members returns all the baggage list-members. +// The order of the returned list-members does not have significance. +// +// The returned members are not validated, as we assume the validation happened +// when they were added to the Baggage. +func (b Baggage) Members() []Member { + if len(b.list) == 0 { + return nil + } + + members := make([]Member, 0, len(b.list)) + for k, v := range b.list { + members = append(members, Member{ + key: k, + value: v.Value, + properties: fromInternalProperties(v.Properties), + hasData: true, + }) + } + return members +} + +// SetMember returns a copy the Baggage with the member included. If the +// baggage contains a Member with the same key the existing Member is +// replaced. +// +// If member is invalid according to the W3C Baggage specification, an error +// is returned with the original Baggage. +func (b Baggage) SetMember(member Member) (Baggage, error) { + if !member.hasData { + return b, errInvalidMember + } + + n := len(b.list) + if _, ok := b.list[member.key]; !ok { + n++ + } + list := make(baggage.List, n) + + for k, v := range b.list { + // Do not copy if we are just going to overwrite. + if k == member.key { + continue + } + list[k] = v + } + + list[member.key] = baggage.Item{ + Value: member.value, + Properties: member.properties.asInternal(), + } + + return Baggage{list: list}, nil +} + +// DeleteMember returns a copy of the Baggage with the list-member identified +// by key removed. +func (b Baggage) DeleteMember(key string) Baggage { + n := len(b.list) + if _, ok := b.list[key]; ok { + n-- + } + list := make(baggage.List, n) + + for k, v := range b.list { + if k == key { + continue + } + list[k] = v + } + + return Baggage{list: list} +} + +// Len returns the number of list-members in the Baggage. +func (b Baggage) Len() int { + return len(b.list) +} + +// String encodes Baggage into a header string compliant with the W3C Baggage +// specification. +func (b Baggage) String() string { + members := make([]string, 0, len(b.list)) + for k, v := range b.list { + members = append(members, Member{ + key: k, + value: v.Value, + properties: fromInternalProperties(v.Properties), + }.String()) + } + return strings.Join(members, listDelimiter) +} + +// parsePropertyInternal attempts to decode a Property from the passed string. +// It follows the spec at https://www.w3.org/TR/baggage/#definition. +func parsePropertyInternal(s string) (p Property, ok bool) { + // For the entire function we will use " key = value " as an example. + // Attempting to parse the key. + // First skip spaces at the beginning "< >key = value " (they could be empty). + index := skipSpace(s, 0) + + // Parse the key: " = value ". + keyStart := index + keyEnd := index + for _, c := range s[keyStart:] { + if !validateKeyChar(c) { + break + } + keyEnd++ + } + + // If we couldn't find any valid key character, + // it means the key is either empty or invalid. + if keyStart == keyEnd { + return + } + + // Skip spaces after the key: " key< >= value ". + index = skipSpace(s, keyEnd) + + if index == len(s) { + // A key can have no value, like: " key ". + ok = true + p.key = s[keyStart:keyEnd] + return + } + + // If we have not reached the end and we can't find the '=' delimiter, + // it means the property is invalid. + if s[index] != keyValueDelimiter[0] { + return + } + + // Attempting to parse the value. + // Match: " key =< >value ". + index = skipSpace(s, index+1) + + // Match the value string: " key = ". + // A valid property can be: " key =". + // Therefore, we don't have to check if the value is empty. + valueStart := index + valueEnd := index + for _, c := range s[valueStart:] { + if !validateValueChar(c) { + break + } + valueEnd++ + } + + // Skip all trailing whitespaces: " key = value< >". + index = skipSpace(s, valueEnd) + + // If after looking for the value and skipping whitespaces + // we have not reached the end, it means the property is + // invalid, something like: " key = value value1". + if index != len(s) { + return + } + + // Decode a precent-encoded value. + value, err := url.PathUnescape(s[valueStart:valueEnd]) + if err != nil { + return + } + + ok = true + p.key = s[keyStart:keyEnd] + p.hasValue = true + + p.value = value + return +} + +func skipSpace(s string, offset int) int { + i := offset + for ; i < len(s); i++ { + c := s[i] + if c != ' ' && c != '\t' { + break + } + } + return i +} + +func validateKey(s string) bool { + if len(s) == 0 { + return false + } + + for _, c := range s { + if !validateKeyChar(c) { + return false + } + } + + return true +} + +func validateKeyChar(c int32) bool { + return (c >= 0x23 && c <= 0x27) || + (c >= 0x30 && c <= 0x39) || + (c >= 0x41 && c <= 0x5a) || + (c >= 0x5e && c <= 0x7a) || + c == 0x21 || + c == 0x2a || + c == 0x2b || + c == 0x2d || + c == 0x2e || + c == 0x7c || + c == 0x7e +} + +func validateValue(s string) bool { + for _, c := range s { + if !validateValueChar(c) { + return false + } + } + + return true +} + +func validateValueChar(c int32) bool { + return c == 0x21 || + (c >= 0x23 && c <= 0x2b) || + (c >= 0x2d && c <= 0x3a) || + (c >= 0x3c && c <= 0x5b) || + (c >= 0x5d && c <= 0x7e) +} + +// valueEscape escapes the string so it can be safely placed inside a baggage value, +// replacing special characters with %XX sequences as needed. +// +// The implementation is based on: +// https://github.com/golang/go/blob/f6509cf5cdbb5787061b784973782933c47f1782/src/net/url/url.go#L285. +func valueEscape(s string) string { + hexCount := 0 + for i := 0; i < len(s); i++ { + c := s[i] + if shouldEscape(c) { + hexCount++ + } + } + + if hexCount == 0 { + return s + } + + var buf [64]byte + var t []byte + + required := len(s) + 2*hexCount + if required <= len(buf) { + t = buf[:required] + } else { + t = make([]byte, required) + } + + j := 0 + for i := 0; i < len(s); i++ { + c := s[i] + if shouldEscape(s[i]) { + const upperhex = "0123456789ABCDEF" + t[j] = '%' + t[j+1] = upperhex[c>>4] + t[j+2] = upperhex[c&15] + j += 3 + } else { + t[j] = c + j++ + } + } + + return string(t) +} + +// shouldEscape returns true if the specified byte should be escaped when +// appearing in a baggage value string. +func shouldEscape(c byte) bool { + if c == '%' { + // The percent character must be encoded so that percent-encoding can work. + return true + } + return !validateValueChar(int32(c)) +} diff --git a/vendor/go.opentelemetry.io/otel/baggage/context.go b/vendor/go.opentelemetry.io/otel/baggage/context.go new file mode 100644 index 0000000000..24b34b7564 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/baggage/context.go @@ -0,0 +1,39 @@ +// Copyright The OpenTelemetry 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 baggage // import "go.opentelemetry.io/otel/baggage" + +import ( + "context" + + "go.opentelemetry.io/otel/internal/baggage" +) + +// ContextWithBaggage returns a copy of parent with baggage. +func ContextWithBaggage(parent context.Context, b Baggage) context.Context { + // Delegate so any hooks for the OpenTracing bridge are handled. + return baggage.ContextWithList(parent, b.list) +} + +// ContextWithoutBaggage returns a copy of parent with no baggage. +func ContextWithoutBaggage(parent context.Context) context.Context { + // Delegate so any hooks for the OpenTracing bridge are handled. + return baggage.ContextWithList(parent, nil) +} + +// FromContext returns the baggage contained in ctx. +func FromContext(ctx context.Context) Baggage { + // Delegate so any hooks for the OpenTracing bridge are handled. + return Baggage{list: baggage.ListFromContext(ctx)} +} diff --git a/vendor/go.opentelemetry.io/otel/baggage/doc.go b/vendor/go.opentelemetry.io/otel/baggage/doc.go new file mode 100644 index 0000000000..4545100df6 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/baggage/doc.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry 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 baggage provides functionality for storing and retrieving +baggage items in Go context. For propagating the baggage, see the +go.opentelemetry.io/otel/propagation package. +*/ +package baggage // import "go.opentelemetry.io/otel/baggage" diff --git a/vendor/go.opentelemetry.io/otel/codes/codes.go b/vendor/go.opentelemetry.io/otel/codes/codes.go new file mode 100644 index 0000000000..587ebae4e3 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/codes/codes.go @@ -0,0 +1,116 @@ +// Copyright The OpenTelemetry 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 codes // import "go.opentelemetry.io/otel/codes" + +import ( + "encoding/json" + "fmt" + "strconv" +) + +const ( + // Unset is the default status code. + Unset Code = 0 + + // Error indicates the operation contains an error. + // + // NOTE: The error code in OTLP is 2. + // The value of this enum is only relevant to the internals + // of the Go SDK. + Error Code = 1 + + // Ok indicates operation has been validated by an Application developers + // or Operator to have completed successfully, or contain no error. + // + // NOTE: The Ok code in OTLP is 1. + // The value of this enum is only relevant to the internals + // of the Go SDK. + Ok Code = 2 + + maxCode = 3 +) + +// Code is an 32-bit representation of a status state. +type Code uint32 + +var codeToStr = map[Code]string{ + Unset: "Unset", + Error: "Error", + Ok: "Ok", +} + +var strToCode = map[string]Code{ + `"Unset"`: Unset, + `"Error"`: Error, + `"Ok"`: Ok, +} + +// String returns the Code as a string. +func (c Code) String() string { + return codeToStr[c] +} + +// UnmarshalJSON unmarshals b into the Code. +// +// This is based on the functionality in the gRPC codes package: +// https://github.com/grpc/grpc-go/blob/bb64fee312b46ebee26be43364a7a966033521b1/codes/codes.go#L218-L244 +func (c *Code) UnmarshalJSON(b []byte) error { + // From json.Unmarshaler: By convention, to approximate the behavior of + // Unmarshal itself, Unmarshalers implement UnmarshalJSON([]byte("null")) as + // a no-op. + if string(b) == "null" { + return nil + } + if c == nil { + return fmt.Errorf("nil receiver passed to UnmarshalJSON") + } + + var x interface{} + if err := json.Unmarshal(b, &x); err != nil { + return err + } + switch x.(type) { + case string: + if jc, ok := strToCode[string(b)]; ok { + *c = jc + return nil + } + return fmt.Errorf("invalid code: %q", string(b)) + case float64: + if ci, err := strconv.ParseUint(string(b), 10, 32); err == nil { + if ci >= maxCode { + return fmt.Errorf("invalid code: %q", ci) + } + + *c = Code(ci) + return nil + } + return fmt.Errorf("invalid code: %q", string(b)) + default: + return fmt.Errorf("invalid code: %q", string(b)) + } +} + +// MarshalJSON returns c as the JSON encoding of c. +func (c *Code) MarshalJSON() ([]byte, error) { + if c == nil { + return []byte("null"), nil + } + str, ok := codeToStr[*c] + if !ok { + return nil, fmt.Errorf("invalid code: %d", *c) + } + return []byte(fmt.Sprintf("%q", str)), nil +} diff --git a/vendor/go.opentelemetry.io/otel/codes/doc.go b/vendor/go.opentelemetry.io/otel/codes/doc.go new file mode 100644 index 0000000000..4e328fbb4b --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/codes/doc.go @@ -0,0 +1,21 @@ +// Copyright The OpenTelemetry 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 codes defines the canonical error codes used by OpenTelemetry. + +It conforms to [the OpenTelemetry +specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/trace/api.md#set-status). +*/ +package codes // import "go.opentelemetry.io/otel/codes" diff --git a/vendor/go.opentelemetry.io/otel/doc.go b/vendor/go.opentelemetry.io/otel/doc.go new file mode 100644 index 0000000000..36d7c24e88 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/doc.go @@ -0,0 +1,34 @@ +// Copyright The OpenTelemetry 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 otel provides global access to the OpenTelemetry API. The subpackages of +the otel package provide an implementation of the OpenTelemetry API. + +The provided API is used to instrument code and measure data about that code's +performance and operation. The measured data, by default, is not processed or +transmitted anywhere. An implementation of the OpenTelemetry SDK, like the +default SDK implementation (go.opentelemetry.io/otel/sdk), and associated +exporters are used to process and transport this data. + +To read the getting started guide, see https://opentelemetry.io/docs/languages/go/getting-started/. + +To read more about tracing, see go.opentelemetry.io/otel/trace. + +To read more about metrics, see go.opentelemetry.io/otel/metric. + +To read more about propagation, see go.opentelemetry.io/otel/propagation and +go.opentelemetry.io/otel/baggage. +*/ +package otel // import "go.opentelemetry.io/otel" diff --git a/vendor/go.opentelemetry.io/otel/error_handler.go b/vendor/go.opentelemetry.io/otel/error_handler.go new file mode 100644 index 0000000000..72fad85412 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/error_handler.go @@ -0,0 +1,38 @@ +// Copyright The OpenTelemetry 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 otel // import "go.opentelemetry.io/otel" + +// ErrorHandler handles irremediable events. +type ErrorHandler interface { + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Handle handles any error deemed irremediable by an OpenTelemetry + // component. + Handle(error) + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. +} + +// ErrorHandlerFunc is a convenience adapter to allow the use of a function +// as an ErrorHandler. +type ErrorHandlerFunc func(error) + +var _ ErrorHandler = ErrorHandlerFunc(nil) + +// Handle handles the irremediable error by calling the ErrorHandlerFunc itself. +func (f ErrorHandlerFunc) Handle(err error) { + f(err) +} diff --git a/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh b/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh new file mode 100644 index 0000000000..9a58fb1d37 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +# Copyright The OpenTelemetry 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 -euo pipefail + +top_dir='.' +if [[ $# -gt 0 ]]; then + top_dir="${1}" +fi + +p=$(pwd) +mod_dirs=() + +# Note `mapfile` does not exist in older bash versions: +# https://stackoverflow.com/questions/41475261/need-alternative-to-readarray-mapfile-for-script-on-older-version-of-bash + +while IFS= read -r line; do + mod_dirs+=("$line") +done < <(find "${top_dir}" -type f -name 'go.mod' -exec dirname {} \; | sort) + +for mod_dir in "${mod_dirs[@]}"; do + cd "${mod_dir}" + + while IFS= read -r line; do + echo ".${line#${p}}" + done < <(go list --find -f '{{.Name}}|{{.Dir}}' ./... | grep '^main|' | cut -f 2- -d '|') + cd "${p}" +done diff --git a/vendor/go.opentelemetry.io/otel/handler.go b/vendor/go.opentelemetry.io/otel/handler.go new file mode 100644 index 0000000000..4115fe3bbb --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/handler.go @@ -0,0 +1,48 @@ +// Copyright The OpenTelemetry 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 otel // import "go.opentelemetry.io/otel" + +import ( + "go.opentelemetry.io/otel/internal/global" +) + +var ( + // Compile-time check global.ErrDelegator implements ErrorHandler. + _ ErrorHandler = (*global.ErrDelegator)(nil) + // Compile-time check global.ErrLogger implements ErrorHandler. + _ ErrorHandler = (*global.ErrLogger)(nil) +) + +// GetErrorHandler returns the global ErrorHandler instance. +// +// The default ErrorHandler instance returned will log all errors to STDERR +// until an override ErrorHandler is set with SetErrorHandler. All +// ErrorHandler returned prior to this will automatically forward errors to +// the set instance instead of logging. +// +// Subsequent calls to SetErrorHandler after the first will not forward errors +// to the new ErrorHandler for prior returned instances. +func GetErrorHandler() ErrorHandler { return global.GetErrorHandler() } + +// SetErrorHandler sets the global ErrorHandler to h. +// +// The first time this is called all ErrorHandler previously returned from +// GetErrorHandler will send errors to h instead of the default logging +// ErrorHandler. Subsequent calls will set the global ErrorHandler, but not +// delegate errors to h. +func SetErrorHandler(h ErrorHandler) { global.SetErrorHandler(h) } + +// Handle is a convenience function for ErrorHandler().Handle(err). +func Handle(err error) { global.Handle(err) } diff --git a/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go b/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go new file mode 100644 index 0000000000..622c3ee3f2 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go @@ -0,0 +1,111 @@ +// Copyright The OpenTelemetry 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 attribute provide several helper functions for some commonly used +logic of processing attributes. +*/ +package attribute // import "go.opentelemetry.io/otel/internal/attribute" + +import ( + "reflect" +) + +// BoolSliceValue converts a bool slice into an array with same elements as slice. +func BoolSliceValue(v []bool) interface{} { + var zero bool + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]bool), v) + return cp.Elem().Interface() +} + +// Int64SliceValue converts an int64 slice into an array with same elements as slice. +func Int64SliceValue(v []int64) interface{} { + var zero int64 + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]int64), v) + return cp.Elem().Interface() +} + +// Float64SliceValue converts a float64 slice into an array with same elements as slice. +func Float64SliceValue(v []float64) interface{} { + var zero float64 + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]float64), v) + return cp.Elem().Interface() +} + +// StringSliceValue converts a string slice into an array with same elements as slice. +func StringSliceValue(v []string) interface{} { + var zero string + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))) + copy(cp.Elem().Slice(0, len(v)).Interface().([]string), v) + return cp.Elem().Interface() +} + +// AsBoolSlice converts a bool array into a slice into with same elements as array. +func AsBoolSlice(v interface{}) []bool { + rv := reflect.ValueOf(v) + if rv.Type().Kind() != reflect.Array { + return nil + } + var zero bool + correctLen := rv.Len() + correctType := reflect.ArrayOf(correctLen, reflect.TypeOf(zero)) + cpy := reflect.New(correctType) + _ = reflect.Copy(cpy.Elem(), rv) + return cpy.Elem().Slice(0, correctLen).Interface().([]bool) +} + +// AsInt64Slice converts an int64 array into a slice into with same elements as array. +func AsInt64Slice(v interface{}) []int64 { + rv := reflect.ValueOf(v) + if rv.Type().Kind() != reflect.Array { + return nil + } + var zero int64 + correctLen := rv.Len() + correctType := reflect.ArrayOf(correctLen, reflect.TypeOf(zero)) + cpy := reflect.New(correctType) + _ = reflect.Copy(cpy.Elem(), rv) + return cpy.Elem().Slice(0, correctLen).Interface().([]int64) +} + +// AsFloat64Slice converts a float64 array into a slice into with same elements as array. +func AsFloat64Slice(v interface{}) []float64 { + rv := reflect.ValueOf(v) + if rv.Type().Kind() != reflect.Array { + return nil + } + var zero float64 + correctLen := rv.Len() + correctType := reflect.ArrayOf(correctLen, reflect.TypeOf(zero)) + cpy := reflect.New(correctType) + _ = reflect.Copy(cpy.Elem(), rv) + return cpy.Elem().Slice(0, correctLen).Interface().([]float64) +} + +// AsStringSlice converts a string array into a slice into with same elements as array. +func AsStringSlice(v interface{}) []string { + rv := reflect.ValueOf(v) + if rv.Type().Kind() != reflect.Array { + return nil + } + var zero string + correctLen := rv.Len() + correctType := reflect.ArrayOf(correctLen, reflect.TypeOf(zero)) + cpy := reflect.New(correctType) + _ = reflect.Copy(cpy.Elem(), rv) + return cpy.Elem().Slice(0, correctLen).Interface().([]string) +} diff --git a/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go new file mode 100644 index 0000000000..b96e5408e6 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go @@ -0,0 +1,43 @@ +// Copyright The OpenTelemetry 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 baggage provides base types and functionality to store and retrieve +baggage in Go context. This package exists because the OpenTracing bridge to +OpenTelemetry needs to synchronize state whenever baggage for a context is +modified and that context contains an OpenTracing span. If it were not for +this need this package would not need to exist and the +`go.opentelemetry.io/otel/baggage` package would be the singular place where +W3C baggage is handled. +*/ +package baggage // import "go.opentelemetry.io/otel/internal/baggage" + +// List is the collection of baggage members. The W3C allows for duplicates, +// but OpenTelemetry does not, therefore, this is represented as a map. +type List map[string]Item + +// Item is the value and metadata properties part of a list-member. +type Item struct { + Value string + Properties []Property +} + +// Property is a metadata entry for a list-member. +type Property struct { + Key, Value string + + // HasValue indicates if a zero-value value means the property does not + // have a value or if it was the zero-value. + HasValue bool +} diff --git a/vendor/go.opentelemetry.io/otel/internal/baggage/context.go b/vendor/go.opentelemetry.io/otel/internal/baggage/context.go new file mode 100644 index 0000000000..4469700d9c --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/baggage/context.go @@ -0,0 +1,92 @@ +// Copyright The OpenTelemetry 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 baggage // import "go.opentelemetry.io/otel/internal/baggage" + +import "context" + +type baggageContextKeyType int + +const baggageKey baggageContextKeyType = iota + +// SetHookFunc is a callback called when storing baggage in the context. +type SetHookFunc func(context.Context, List) context.Context + +// GetHookFunc is a callback called when getting baggage from the context. +type GetHookFunc func(context.Context, List) List + +type baggageState struct { + list List + + setHook SetHookFunc + getHook GetHookFunc +} + +// ContextWithSetHook returns a copy of parent with hook configured to be +// invoked every time ContextWithBaggage is called. +// +// Passing nil SetHookFunc creates a context with no set hook to call. +func ContextWithSetHook(parent context.Context, hook SetHookFunc) context.Context { + var s baggageState + if v, ok := parent.Value(baggageKey).(baggageState); ok { + s = v + } + + s.setHook = hook + return context.WithValue(parent, baggageKey, s) +} + +// ContextWithGetHook returns a copy of parent with hook configured to be +// invoked every time FromContext is called. +// +// Passing nil GetHookFunc creates a context with no get hook to call. +func ContextWithGetHook(parent context.Context, hook GetHookFunc) context.Context { + var s baggageState + if v, ok := parent.Value(baggageKey).(baggageState); ok { + s = v + } + + s.getHook = hook + return context.WithValue(parent, baggageKey, s) +} + +// ContextWithList returns a copy of parent with baggage. Passing nil list +// returns a context without any baggage. +func ContextWithList(parent context.Context, list List) context.Context { + var s baggageState + if v, ok := parent.Value(baggageKey).(baggageState); ok { + s = v + } + + s.list = list + ctx := context.WithValue(parent, baggageKey, s) + if s.setHook != nil { + ctx = s.setHook(ctx, list) + } + + return ctx +} + +// ListFromContext returns the baggage contained in ctx. +func ListFromContext(ctx context.Context) List { + switch v := ctx.Value(baggageKey).(type) { + case baggageState: + if v.getHook != nil { + return v.getHook(ctx, v.list) + } + return v.list + default: + return nil + } +} diff --git a/vendor/go.opentelemetry.io/otel/internal/gen.go b/vendor/go.opentelemetry.io/otel/internal/gen.go new file mode 100644 index 0000000000..f532f07e9e --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/gen.go @@ -0,0 +1,29 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal // import "go.opentelemetry.io/otel/internal" + +//go:generate gotmpl --body=./shared/matchers/expectation.go.tmpl "--data={}" --out=matchers/expectation.go +//go:generate gotmpl --body=./shared/matchers/expecter.go.tmpl "--data={}" --out=matchers/expecter.go +//go:generate gotmpl --body=./shared/matchers/temporal_matcher.go.tmpl "--data={}" --out=matchers/temporal_matcher.go + +//go:generate gotmpl --body=./shared/internaltest/alignment.go.tmpl "--data={}" --out=internaltest/alignment.go +//go:generate gotmpl --body=./shared/internaltest/env.go.tmpl "--data={}" --out=internaltest/env.go +//go:generate gotmpl --body=./shared/internaltest/env_test.go.tmpl "--data={}" --out=internaltest/env_test.go +//go:generate gotmpl --body=./shared/internaltest/errors.go.tmpl "--data={}" --out=internaltest/errors.go +//go:generate gotmpl --body=./shared/internaltest/harness.go.tmpl "--data={\"matchersImportPath\": \"go.opentelemetry.io/otel/internal/matchers\"}" --out=internaltest/harness.go +//go:generate gotmpl --body=./shared/internaltest/text_map_carrier.go.tmpl "--data={}" --out=internaltest/text_map_carrier.go +//go:generate gotmpl --body=./shared/internaltest/text_map_carrier_test.go.tmpl "--data={}" --out=internaltest/text_map_carrier_test.go +//go:generate gotmpl --body=./shared/internaltest/text_map_propagator.go.tmpl "--data={}" --out=internaltest/text_map_propagator.go +//go:generate gotmpl --body=./shared/internaltest/text_map_propagator_test.go.tmpl "--data={}" --out=internaltest/text_map_propagator_test.go diff --git a/vendor/go.opentelemetry.io/otel/internal/global/handler.go b/vendor/go.opentelemetry.io/otel/internal/global/handler.go new file mode 100644 index 0000000000..5e9b830479 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/handler.go @@ -0,0 +1,102 @@ +// Copyright The OpenTelemetry 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 global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "log" + "os" + "sync/atomic" +) + +var ( + // GlobalErrorHandler provides an ErrorHandler that can be used + // throughout an OpenTelemetry instrumented project. When a user + // specified ErrorHandler is registered (`SetErrorHandler`) all calls to + // `Handle` and will be delegated to the registered ErrorHandler. + GlobalErrorHandler = defaultErrorHandler() + + // Compile-time check that delegator implements ErrorHandler. + _ ErrorHandler = (*ErrDelegator)(nil) + // Compile-time check that errLogger implements ErrorHandler. + _ ErrorHandler = (*ErrLogger)(nil) +) + +// ErrorHandler handles irremediable events. +type ErrorHandler interface { + // Handle handles any error deemed irremediable by an OpenTelemetry + // component. + Handle(error) +} + +type ErrDelegator struct { + delegate atomic.Pointer[ErrorHandler] +} + +func (d *ErrDelegator) Handle(err error) { + d.getDelegate().Handle(err) +} + +func (d *ErrDelegator) getDelegate() ErrorHandler { + return *d.delegate.Load() +} + +// setDelegate sets the ErrorHandler delegate. +func (d *ErrDelegator) setDelegate(eh ErrorHandler) { + d.delegate.Store(&eh) +} + +func defaultErrorHandler() *ErrDelegator { + d := &ErrDelegator{} + d.setDelegate(&ErrLogger{l: log.New(os.Stderr, "", log.LstdFlags)}) + return d +} + +// ErrLogger logs errors if no delegate is set, otherwise they are delegated. +type ErrLogger struct { + l *log.Logger +} + +// Handle logs err if no delegate is set, otherwise it is delegated. +func (h *ErrLogger) Handle(err error) { + h.l.Print(err) +} + +// GetErrorHandler returns the global ErrorHandler instance. +// +// The default ErrorHandler instance returned will log all errors to STDERR +// until an override ErrorHandler is set with SetErrorHandler. All +// ErrorHandler returned prior to this will automatically forward errors to +// the set instance instead of logging. +// +// Subsequent calls to SetErrorHandler after the first will not forward errors +// to the new ErrorHandler for prior returned instances. +func GetErrorHandler() ErrorHandler { + return GlobalErrorHandler +} + +// SetErrorHandler sets the global ErrorHandler to h. +// +// The first time this is called all ErrorHandler previously returned from +// GetErrorHandler will send errors to h instead of the default logging +// ErrorHandler. Subsequent calls will set the global ErrorHandler, but not +// delegate errors to h. +func SetErrorHandler(h ErrorHandler) { + GlobalErrorHandler.setDelegate(h) +} + +// Handle is a convenience function for ErrorHandler().Handle(err). +func Handle(err error) { + GetErrorHandler().Handle(err) +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/instruments.go b/vendor/go.opentelemetry.io/otel/internal/global/instruments.go new file mode 100644 index 0000000000..ebb13c2067 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/instruments.go @@ -0,0 +1,371 @@ +// Copyright The OpenTelemetry 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 global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "context" + "sync/atomic" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/embedded" +) + +// unwrapper unwraps to return the underlying instrument implementation. +type unwrapper interface { + Unwrap() metric.Observable +} + +type afCounter struct { + embedded.Float64ObservableCounter + metric.Float64Observable + + name string + opts []metric.Float64ObservableCounterOption + + delegate atomic.Value // metric.Float64ObservableCounter +} + +var ( + _ unwrapper = (*afCounter)(nil) + _ metric.Float64ObservableCounter = (*afCounter)(nil) +) + +func (i *afCounter) setDelegate(m metric.Meter) { + ctr, err := m.Float64ObservableCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *afCounter) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Float64ObservableCounter) + } + return nil +} + +type afUpDownCounter struct { + embedded.Float64ObservableUpDownCounter + metric.Float64Observable + + name string + opts []metric.Float64ObservableUpDownCounterOption + + delegate atomic.Value // metric.Float64ObservableUpDownCounter +} + +var ( + _ unwrapper = (*afUpDownCounter)(nil) + _ metric.Float64ObservableUpDownCounter = (*afUpDownCounter)(nil) +) + +func (i *afUpDownCounter) setDelegate(m metric.Meter) { + ctr, err := m.Float64ObservableUpDownCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *afUpDownCounter) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Float64ObservableUpDownCounter) + } + return nil +} + +type afGauge struct { + embedded.Float64ObservableGauge + metric.Float64Observable + + name string + opts []metric.Float64ObservableGaugeOption + + delegate atomic.Value // metric.Float64ObservableGauge +} + +var ( + _ unwrapper = (*afGauge)(nil) + _ metric.Float64ObservableGauge = (*afGauge)(nil) +) + +func (i *afGauge) setDelegate(m metric.Meter) { + ctr, err := m.Float64ObservableGauge(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *afGauge) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Float64ObservableGauge) + } + return nil +} + +type aiCounter struct { + embedded.Int64ObservableCounter + metric.Int64Observable + + name string + opts []metric.Int64ObservableCounterOption + + delegate atomic.Value // metric.Int64ObservableCounter +} + +var ( + _ unwrapper = (*aiCounter)(nil) + _ metric.Int64ObservableCounter = (*aiCounter)(nil) +) + +func (i *aiCounter) setDelegate(m metric.Meter) { + ctr, err := m.Int64ObservableCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *aiCounter) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Int64ObservableCounter) + } + return nil +} + +type aiUpDownCounter struct { + embedded.Int64ObservableUpDownCounter + metric.Int64Observable + + name string + opts []metric.Int64ObservableUpDownCounterOption + + delegate atomic.Value // metric.Int64ObservableUpDownCounter +} + +var ( + _ unwrapper = (*aiUpDownCounter)(nil) + _ metric.Int64ObservableUpDownCounter = (*aiUpDownCounter)(nil) +) + +func (i *aiUpDownCounter) setDelegate(m metric.Meter) { + ctr, err := m.Int64ObservableUpDownCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *aiUpDownCounter) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Int64ObservableUpDownCounter) + } + return nil +} + +type aiGauge struct { + embedded.Int64ObservableGauge + metric.Int64Observable + + name string + opts []metric.Int64ObservableGaugeOption + + delegate atomic.Value // metric.Int64ObservableGauge +} + +var ( + _ unwrapper = (*aiGauge)(nil) + _ metric.Int64ObservableGauge = (*aiGauge)(nil) +) + +func (i *aiGauge) setDelegate(m metric.Meter) { + ctr, err := m.Int64ObservableGauge(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *aiGauge) Unwrap() metric.Observable { + if ctr := i.delegate.Load(); ctr != nil { + return ctr.(metric.Int64ObservableGauge) + } + return nil +} + +// Sync Instruments. +type sfCounter struct { + embedded.Float64Counter + + name string + opts []metric.Float64CounterOption + + delegate atomic.Value // metric.Float64Counter +} + +var _ metric.Float64Counter = (*sfCounter)(nil) + +func (i *sfCounter) setDelegate(m metric.Meter) { + ctr, err := m.Float64Counter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *sfCounter) Add(ctx context.Context, incr float64, opts ...metric.AddOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Float64Counter).Add(ctx, incr, opts...) + } +} + +type sfUpDownCounter struct { + embedded.Float64UpDownCounter + + name string + opts []metric.Float64UpDownCounterOption + + delegate atomic.Value // metric.Float64UpDownCounter +} + +var _ metric.Float64UpDownCounter = (*sfUpDownCounter)(nil) + +func (i *sfUpDownCounter) setDelegate(m metric.Meter) { + ctr, err := m.Float64UpDownCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *sfUpDownCounter) Add(ctx context.Context, incr float64, opts ...metric.AddOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Float64UpDownCounter).Add(ctx, incr, opts...) + } +} + +type sfHistogram struct { + embedded.Float64Histogram + + name string + opts []metric.Float64HistogramOption + + delegate atomic.Value // metric.Float64Histogram +} + +var _ metric.Float64Histogram = (*sfHistogram)(nil) + +func (i *sfHistogram) setDelegate(m metric.Meter) { + ctr, err := m.Float64Histogram(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *sfHistogram) Record(ctx context.Context, x float64, opts ...metric.RecordOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Float64Histogram).Record(ctx, x, opts...) + } +} + +type siCounter struct { + embedded.Int64Counter + + name string + opts []metric.Int64CounterOption + + delegate atomic.Value // metric.Int64Counter +} + +var _ metric.Int64Counter = (*siCounter)(nil) + +func (i *siCounter) setDelegate(m metric.Meter) { + ctr, err := m.Int64Counter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *siCounter) Add(ctx context.Context, x int64, opts ...metric.AddOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Int64Counter).Add(ctx, x, opts...) + } +} + +type siUpDownCounter struct { + embedded.Int64UpDownCounter + + name string + opts []metric.Int64UpDownCounterOption + + delegate atomic.Value // metric.Int64UpDownCounter +} + +var _ metric.Int64UpDownCounter = (*siUpDownCounter)(nil) + +func (i *siUpDownCounter) setDelegate(m metric.Meter) { + ctr, err := m.Int64UpDownCounter(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *siUpDownCounter) Add(ctx context.Context, x int64, opts ...metric.AddOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Int64UpDownCounter).Add(ctx, x, opts...) + } +} + +type siHistogram struct { + embedded.Int64Histogram + + name string + opts []metric.Int64HistogramOption + + delegate atomic.Value // metric.Int64Histogram +} + +var _ metric.Int64Histogram = (*siHistogram)(nil) + +func (i *siHistogram) setDelegate(m metric.Meter) { + ctr, err := m.Int64Histogram(i.name, i.opts...) + if err != nil { + GetErrorHandler().Handle(err) + return + } + i.delegate.Store(ctr) +} + +func (i *siHistogram) Record(ctx context.Context, x int64, opts ...metric.RecordOption) { + if ctr := i.delegate.Load(); ctr != nil { + ctr.(metric.Int64Histogram).Record(ctx, x, opts...) + } +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go new file mode 100644 index 0000000000..c6f305a2b7 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go @@ -0,0 +1,69 @@ +// Copyright The OpenTelemetry 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 global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "log" + "os" + "sync/atomic" + + "github.com/go-logr/logr" + "github.com/go-logr/stdr" +) + +// globalLogger is the logging interface used within the otel api and sdk provide details of the internals. +// +// The default logger uses stdr which is backed by the standard `log.Logger` +// interface. This logger will only show messages at the Error Level. +var globalLogger atomic.Pointer[logr.Logger] + +func init() { + SetLogger(stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile))) +} + +// SetLogger overrides the globalLogger with l. +// +// To see Warn messages use a logger with `l.V(1).Enabled() == true` +// To see Info messages use a logger with `l.V(4).Enabled() == true` +// To see Debug messages use a logger with `l.V(8).Enabled() == true`. +func SetLogger(l logr.Logger) { + globalLogger.Store(&l) +} + +func getLogger() logr.Logger { + return *globalLogger.Load() +} + +// Info prints messages about the general state of the API or SDK. +// This should usually be less than 5 messages a minute. +func Info(msg string, keysAndValues ...interface{}) { + getLogger().V(4).Info(msg, keysAndValues...) +} + +// Error prints messages about exceptional states of the API or SDK. +func Error(err error, msg string, keysAndValues ...interface{}) { + getLogger().Error(err, msg, keysAndValues...) +} + +// Debug prints messages about all internal changes in the API or SDK. +func Debug(msg string, keysAndValues ...interface{}) { + getLogger().V(8).Info(msg, keysAndValues...) +} + +// Warn prints messages about warnings in the API or SDK. +// Not an error but is likely more important than an informational event. +func Warn(msg string, keysAndValues ...interface{}) { + getLogger().V(1).Info(msg, keysAndValues...) +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/meter.go b/vendor/go.opentelemetry.io/otel/internal/global/meter.go new file mode 100644 index 0000000000..7ed61c0e25 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/meter.go @@ -0,0 +1,356 @@ +// Copyright The OpenTelemetry 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 global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "container/list" + "sync" + "sync/atomic" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/embedded" +) + +// meterProvider is a placeholder for a configured SDK MeterProvider. +// +// All MeterProvider functionality is forwarded to a delegate once +// configured. +type meterProvider struct { + embedded.MeterProvider + + mtx sync.Mutex + meters map[il]*meter + + delegate metric.MeterProvider +} + +// setDelegate configures p to delegate all MeterProvider functionality to +// provider. +// +// All Meters provided prior to this function call are switched out to be +// Meters provided by provider. All instruments and callbacks are recreated and +// delegated. +// +// It is guaranteed by the caller that this happens only once. +func (p *meterProvider) setDelegate(provider metric.MeterProvider) { + p.mtx.Lock() + defer p.mtx.Unlock() + + p.delegate = provider + + if len(p.meters) == 0 { + return + } + + for _, meter := range p.meters { + meter.setDelegate(provider) + } + + p.meters = nil +} + +// Meter implements MeterProvider. +func (p *meterProvider) Meter(name string, opts ...metric.MeterOption) metric.Meter { + p.mtx.Lock() + defer p.mtx.Unlock() + + if p.delegate != nil { + return p.delegate.Meter(name, opts...) + } + + // At this moment it is guaranteed that no sdk is installed, save the meter in the meters map. + + c := metric.NewMeterConfig(opts...) + key := il{ + name: name, + version: c.InstrumentationVersion(), + } + + if p.meters == nil { + p.meters = make(map[il]*meter) + } + + if val, ok := p.meters[key]; ok { + return val + } + + t := &meter{name: name, opts: opts} + p.meters[key] = t + return t +} + +// meter is a placeholder for a metric.Meter. +// +// All Meter functionality is forwarded to a delegate once configured. +// Otherwise, all functionality is forwarded to a NoopMeter. +type meter struct { + embedded.Meter + + name string + opts []metric.MeterOption + + mtx sync.Mutex + instruments []delegatedInstrument + + registry list.List + + delegate atomic.Value // metric.Meter +} + +type delegatedInstrument interface { + setDelegate(metric.Meter) +} + +// setDelegate configures m to delegate all Meter functionality to Meters +// created by provider. +// +// All subsequent calls to the Meter methods will be passed to the delegate. +// +// It is guaranteed by the caller that this happens only once. +func (m *meter) setDelegate(provider metric.MeterProvider) { + meter := provider.Meter(m.name, m.opts...) + m.delegate.Store(meter) + + m.mtx.Lock() + defer m.mtx.Unlock() + + for _, inst := range m.instruments { + inst.setDelegate(meter) + } + + var n *list.Element + for e := m.registry.Front(); e != nil; e = n { + r := e.Value.(*registration) + r.setDelegate(meter) + n = e.Next() + m.registry.Remove(e) + } + + m.instruments = nil + m.registry.Init() +} + +func (m *meter) Int64Counter(name string, options ...metric.Int64CounterOption) (metric.Int64Counter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64Counter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &siCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Int64UpDownCounter(name string, options ...metric.Int64UpDownCounterOption) (metric.Int64UpDownCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64UpDownCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &siUpDownCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Int64Histogram(name string, options ...metric.Int64HistogramOption) (metric.Int64Histogram, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64Histogram(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &siHistogram{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Int64ObservableCounter(name string, options ...metric.Int64ObservableCounterOption) (metric.Int64ObservableCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64ObservableCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &aiCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Int64ObservableUpDownCounter(name string, options ...metric.Int64ObservableUpDownCounterOption) (metric.Int64ObservableUpDownCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64ObservableUpDownCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &aiUpDownCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Int64ObservableGauge(name string, options ...metric.Int64ObservableGaugeOption) (metric.Int64ObservableGauge, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Int64ObservableGauge(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &aiGauge{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64Counter(name string, options ...metric.Float64CounterOption) (metric.Float64Counter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64Counter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &sfCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64UpDownCounter(name string, options ...metric.Float64UpDownCounterOption) (metric.Float64UpDownCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64UpDownCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &sfUpDownCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64Histogram(name string, options ...metric.Float64HistogramOption) (metric.Float64Histogram, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64Histogram(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &sfHistogram{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64ObservableCounter(name string, options ...metric.Float64ObservableCounterOption) (metric.Float64ObservableCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64ObservableCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &afCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64ObservableUpDownCounter(name string, options ...metric.Float64ObservableUpDownCounterOption) (metric.Float64ObservableUpDownCounter, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64ObservableUpDownCounter(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &afUpDownCounter{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +func (m *meter) Float64ObservableGauge(name string, options ...metric.Float64ObservableGaugeOption) (metric.Float64ObservableGauge, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + return del.Float64ObservableGauge(name, options...) + } + m.mtx.Lock() + defer m.mtx.Unlock() + i := &afGauge{name: name, opts: options} + m.instruments = append(m.instruments, i) + return i, nil +} + +// RegisterCallback captures the function that will be called during Collect. +func (m *meter) RegisterCallback(f metric.Callback, insts ...metric.Observable) (metric.Registration, error) { + if del, ok := m.delegate.Load().(metric.Meter); ok { + insts = unwrapInstruments(insts) + return del.RegisterCallback(f, insts...) + } + + m.mtx.Lock() + defer m.mtx.Unlock() + + reg := ®istration{instruments: insts, function: f} + e := m.registry.PushBack(reg) + reg.unreg = func() error { + m.mtx.Lock() + _ = m.registry.Remove(e) + m.mtx.Unlock() + return nil + } + return reg, nil +} + +type wrapped interface { + unwrap() metric.Observable +} + +func unwrapInstruments(instruments []metric.Observable) []metric.Observable { + out := make([]metric.Observable, 0, len(instruments)) + + for _, inst := range instruments { + if in, ok := inst.(wrapped); ok { + out = append(out, in.unwrap()) + } else { + out = append(out, inst) + } + } + + return out +} + +type registration struct { + embedded.Registration + + instruments []metric.Observable + function metric.Callback + + unreg func() error + unregMu sync.Mutex +} + +func (c *registration) setDelegate(m metric.Meter) { + insts := unwrapInstruments(c.instruments) + + c.unregMu.Lock() + defer c.unregMu.Unlock() + + if c.unreg == nil { + // Unregister already called. + return + } + + reg, err := m.RegisterCallback(c.function, insts...) + if err != nil { + GetErrorHandler().Handle(err) + } + + c.unreg = reg.Unregister +} + +func (c *registration) Unregister() error { + c.unregMu.Lock() + defer c.unregMu.Unlock() + if c.unreg == nil { + // Unregister already called. + return nil + } + + var err error + err, c.unreg = c.unreg(), nil + return err +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/propagator.go b/vendor/go.opentelemetry.io/otel/internal/global/propagator.go new file mode 100644 index 0000000000..06bac35c2f --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/propagator.go @@ -0,0 +1,82 @@ +// Copyright The OpenTelemetry 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 global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "context" + "sync" + + "go.opentelemetry.io/otel/propagation" +) + +// textMapPropagator is a default TextMapPropagator that delegates calls to a +// registered delegate if one is set, otherwise it defaults to delegating the +// calls to a the default no-op propagation.TextMapPropagator. +type textMapPropagator struct { + mtx sync.Mutex + once sync.Once + delegate propagation.TextMapPropagator + noop propagation.TextMapPropagator +} + +// Compile-time guarantee that textMapPropagator implements the +// propagation.TextMapPropagator interface. +var _ propagation.TextMapPropagator = (*textMapPropagator)(nil) + +func newTextMapPropagator() *textMapPropagator { + return &textMapPropagator{ + noop: propagation.NewCompositeTextMapPropagator(), + } +} + +// SetDelegate sets a delegate propagation.TextMapPropagator that all calls are +// forwarded to. Delegation can only be performed once, all subsequent calls +// perform no delegation. +func (p *textMapPropagator) SetDelegate(delegate propagation.TextMapPropagator) { + if delegate == nil { + return + } + + p.mtx.Lock() + p.once.Do(func() { p.delegate = delegate }) + p.mtx.Unlock() +} + +// effectiveDelegate returns the current delegate of p if one is set, +// otherwise the default noop TextMapPropagator is returned. This method +// can be called concurrently. +func (p *textMapPropagator) effectiveDelegate() propagation.TextMapPropagator { + p.mtx.Lock() + defer p.mtx.Unlock() + if p.delegate != nil { + return p.delegate + } + return p.noop +} + +// Inject set cross-cutting concerns from the Context into the carrier. +func (p *textMapPropagator) Inject(ctx context.Context, carrier propagation.TextMapCarrier) { + p.effectiveDelegate().Inject(ctx, carrier) +} + +// Extract reads cross-cutting concerns from the carrier into a Context. +func (p *textMapPropagator) Extract(ctx context.Context, carrier propagation.TextMapCarrier) context.Context { + return p.effectiveDelegate().Extract(ctx, carrier) +} + +// Fields returns the keys whose values are set with Inject. +func (p *textMapPropagator) Fields() []string { + return p.effectiveDelegate().Fields() +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/state.go b/vendor/go.opentelemetry.io/otel/internal/global/state.go new file mode 100644 index 0000000000..386c8bfdc0 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/state.go @@ -0,0 +1,156 @@ +// Copyright The OpenTelemetry 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 global // import "go.opentelemetry.io/otel/internal/global" + +import ( + "errors" + "sync" + "sync/atomic" + + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/propagation" + "go.opentelemetry.io/otel/trace" +) + +type ( + tracerProviderHolder struct { + tp trace.TracerProvider + } + + propagatorsHolder struct { + tm propagation.TextMapPropagator + } + + meterProviderHolder struct { + mp metric.MeterProvider + } +) + +var ( + globalTracer = defaultTracerValue() + globalPropagators = defaultPropagatorsValue() + globalMeterProvider = defaultMeterProvider() + + delegateTraceOnce sync.Once + delegateTextMapPropagatorOnce sync.Once + delegateMeterOnce sync.Once +) + +// TracerProvider is the internal implementation for global.TracerProvider. +func TracerProvider() trace.TracerProvider { + return globalTracer.Load().(tracerProviderHolder).tp +} + +// SetTracerProvider is the internal implementation for global.SetTracerProvider. +func SetTracerProvider(tp trace.TracerProvider) { + current := TracerProvider() + + if _, cOk := current.(*tracerProvider); cOk { + if _, tpOk := tp.(*tracerProvider); tpOk && current == tp { + // Do not assign the default delegating TracerProvider to delegate + // to itself. + Error( + errors.New("no delegate configured in tracer provider"), + "Setting tracer provider to its current value. No delegate will be configured", + ) + return + } + } + + delegateTraceOnce.Do(func() { + if def, ok := current.(*tracerProvider); ok { + def.setDelegate(tp) + } + }) + globalTracer.Store(tracerProviderHolder{tp: tp}) +} + +// TextMapPropagator is the internal implementation for global.TextMapPropagator. +func TextMapPropagator() propagation.TextMapPropagator { + return globalPropagators.Load().(propagatorsHolder).tm +} + +// SetTextMapPropagator is the internal implementation for global.SetTextMapPropagator. +func SetTextMapPropagator(p propagation.TextMapPropagator) { + current := TextMapPropagator() + + if _, cOk := current.(*textMapPropagator); cOk { + if _, pOk := p.(*textMapPropagator); pOk && current == p { + // Do not assign the default delegating TextMapPropagator to + // delegate to itself. + Error( + errors.New("no delegate configured in text map propagator"), + "Setting text map propagator to its current value. No delegate will be configured", + ) + return + } + } + + // For the textMapPropagator already returned by TextMapPropagator + // delegate to p. + delegateTextMapPropagatorOnce.Do(func() { + if def, ok := current.(*textMapPropagator); ok { + def.SetDelegate(p) + } + }) + // Return p when subsequent calls to TextMapPropagator are made. + globalPropagators.Store(propagatorsHolder{tm: p}) +} + +// MeterProvider is the internal implementation for global.MeterProvider. +func MeterProvider() metric.MeterProvider { + return globalMeterProvider.Load().(meterProviderHolder).mp +} + +// SetMeterProvider is the internal implementation for global.SetMeterProvider. +func SetMeterProvider(mp metric.MeterProvider) { + current := MeterProvider() + if _, cOk := current.(*meterProvider); cOk { + if _, mpOk := mp.(*meterProvider); mpOk && current == mp { + // Do not assign the default delegating MeterProvider to delegate + // to itself. + Error( + errors.New("no delegate configured in meter provider"), + "Setting meter provider to its current value. No delegate will be configured", + ) + return + } + } + + delegateMeterOnce.Do(func() { + if def, ok := current.(*meterProvider); ok { + def.setDelegate(mp) + } + }) + globalMeterProvider.Store(meterProviderHolder{mp: mp}) +} + +func defaultTracerValue() *atomic.Value { + v := &atomic.Value{} + v.Store(tracerProviderHolder{tp: &tracerProvider{}}) + return v +} + +func defaultPropagatorsValue() *atomic.Value { + v := &atomic.Value{} + v.Store(propagatorsHolder{tm: newTextMapPropagator()}) + return v +} + +func defaultMeterProvider() *atomic.Value { + v := &atomic.Value{} + v.Store(meterProviderHolder{mp: &meterProvider{}}) + return v +} diff --git a/vendor/go.opentelemetry.io/otel/internal/global/trace.go b/vendor/go.opentelemetry.io/otel/internal/global/trace.go new file mode 100644 index 0000000000..3f61ec12a3 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/global/trace.go @@ -0,0 +1,199 @@ +// Copyright The OpenTelemetry 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 global // import "go.opentelemetry.io/otel/internal/global" + +/* +This file contains the forwarding implementation of the TracerProvider used as +the default global instance. Prior to initialization of an SDK, Tracers +returned by the global TracerProvider will provide no-op functionality. This +means that all Span created prior to initialization are no-op Spans. + +Once an SDK has been initialized, all provided no-op Tracers are swapped for +Tracers provided by the SDK defined TracerProvider. However, any Span started +prior to this initialization does not change its behavior. Meaning, the Span +remains a no-op Span. + +The implementation to track and swap Tracers locks all new Tracer creation +until the swap is complete. This assumes that this operation is not +performance-critical. If that assumption is incorrect, be sure to configure an +SDK prior to any Tracer creation. +*/ + +import ( + "context" + "sync" + "sync/atomic" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace" + "go.opentelemetry.io/otel/trace/embedded" +) + +// tracerProvider is a placeholder for a configured SDK TracerProvider. +// +// All TracerProvider functionality is forwarded to a delegate once +// configured. +type tracerProvider struct { + embedded.TracerProvider + + mtx sync.Mutex + tracers map[il]*tracer + delegate trace.TracerProvider +} + +// Compile-time guarantee that tracerProvider implements the TracerProvider +// interface. +var _ trace.TracerProvider = &tracerProvider{} + +// setDelegate configures p to delegate all TracerProvider functionality to +// provider. +// +// All Tracers provided prior to this function call are switched out to be +// Tracers provided by provider. +// +// It is guaranteed by the caller that this happens only once. +func (p *tracerProvider) setDelegate(provider trace.TracerProvider) { + p.mtx.Lock() + defer p.mtx.Unlock() + + p.delegate = provider + + if len(p.tracers) == 0 { + return + } + + for _, t := range p.tracers { + t.setDelegate(provider) + } + + p.tracers = nil +} + +// Tracer implements TracerProvider. +func (p *tracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.Tracer { + p.mtx.Lock() + defer p.mtx.Unlock() + + if p.delegate != nil { + return p.delegate.Tracer(name, opts...) + } + + // At this moment it is guaranteed that no sdk is installed, save the tracer in the tracers map. + + c := trace.NewTracerConfig(opts...) + key := il{ + name: name, + version: c.InstrumentationVersion(), + } + + if p.tracers == nil { + p.tracers = make(map[il]*tracer) + } + + if val, ok := p.tracers[key]; ok { + return val + } + + t := &tracer{name: name, opts: opts, provider: p} + p.tracers[key] = t + return t +} + +type il struct { + name string + version string +} + +// tracer is a placeholder for a trace.Tracer. +// +// All Tracer functionality is forwarded to a delegate once configured. +// Otherwise, all functionality is forwarded to a NoopTracer. +type tracer struct { + embedded.Tracer + + name string + opts []trace.TracerOption + provider *tracerProvider + + delegate atomic.Value +} + +// Compile-time guarantee that tracer implements the trace.Tracer interface. +var _ trace.Tracer = &tracer{} + +// setDelegate configures t to delegate all Tracer functionality to Tracers +// created by provider. +// +// All subsequent calls to the Tracer methods will be passed to the delegate. +// +// It is guaranteed by the caller that this happens only once. +func (t *tracer) setDelegate(provider trace.TracerProvider) { + t.delegate.Store(provider.Tracer(t.name, t.opts...)) +} + +// Start implements trace.Tracer by forwarding the call to t.delegate if +// set, otherwise it forwards the call to a NoopTracer. +func (t *tracer) Start(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span) { + delegate := t.delegate.Load() + if delegate != nil { + return delegate.(trace.Tracer).Start(ctx, name, opts...) + } + + s := nonRecordingSpan{sc: trace.SpanContextFromContext(ctx), tracer: t} + ctx = trace.ContextWithSpan(ctx, s) + return ctx, s +} + +// nonRecordingSpan is a minimal implementation of a Span that wraps a +// SpanContext. It performs no operations other than to return the wrapped +// SpanContext. +type nonRecordingSpan struct { + embedded.Span + + sc trace.SpanContext + tracer *tracer +} + +var _ trace.Span = nonRecordingSpan{} + +// SpanContext returns the wrapped SpanContext. +func (s nonRecordingSpan) SpanContext() trace.SpanContext { return s.sc } + +// IsRecording always returns false. +func (nonRecordingSpan) IsRecording() bool { return false } + +// SetStatus does nothing. +func (nonRecordingSpan) SetStatus(codes.Code, string) {} + +// SetError does nothing. +func (nonRecordingSpan) SetError(bool) {} + +// SetAttributes does nothing. +func (nonRecordingSpan) SetAttributes(...attribute.KeyValue) {} + +// End does nothing. +func (nonRecordingSpan) End(...trace.SpanEndOption) {} + +// RecordError does nothing. +func (nonRecordingSpan) RecordError(error, ...trace.EventOption) {} + +// AddEvent does nothing. +func (nonRecordingSpan) AddEvent(string, ...trace.EventOption) {} + +// SetName does nothing. +func (nonRecordingSpan) SetName(string) {} + +func (s nonRecordingSpan) TracerProvider() trace.TracerProvider { return s.tracer.provider } diff --git a/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go b/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go new file mode 100644 index 0000000000..e07e794000 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go @@ -0,0 +1,55 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal // import "go.opentelemetry.io/otel/internal" + +import ( + "math" + "unsafe" +) + +func BoolToRaw(b bool) uint64 { // nolint:revive // b is not a control flag. + if b { + return 1 + } + return 0 +} + +func RawToBool(r uint64) bool { + return r != 0 +} + +func Int64ToRaw(i int64) uint64 { + return uint64(i) +} + +func RawToInt64(r uint64) int64 { + return int64(r) +} + +func Float64ToRaw(f float64) uint64 { + return math.Float64bits(f) +} + +func RawToFloat64(r uint64) float64 { + return math.Float64frombits(r) +} + +func RawPtrToFloat64Ptr(r *uint64) *float64 { + return (*float64)(unsafe.Pointer(r)) +} + +func RawPtrToInt64Ptr(r *uint64) *int64 { + return (*int64)(unsafe.Pointer(r)) +} diff --git a/vendor/go.opentelemetry.io/otel/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal_logging.go new file mode 100644 index 0000000000..c4f8acd5d8 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/internal_logging.go @@ -0,0 +1,26 @@ +// Copyright The OpenTelemetry 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 otel // import "go.opentelemetry.io/otel" + +import ( + "github.com/go-logr/logr" + + "go.opentelemetry.io/otel/internal/global" +) + +// SetLogger configures the logger used internally to opentelemetry. +func SetLogger(logger logr.Logger) { + global.SetLogger(logger) +} diff --git a/vendor/go.opentelemetry.io/otel/metric.go b/vendor/go.opentelemetry.io/otel/metric.go new file mode 100644 index 0000000000..f955171951 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric.go @@ -0,0 +1,53 @@ +// Copyright The OpenTelemetry 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 otel // import "go.opentelemetry.io/otel" + +import ( + "go.opentelemetry.io/otel/internal/global" + "go.opentelemetry.io/otel/metric" +) + +// Meter returns a Meter from the global MeterProvider. The name must be the +// name of the library providing instrumentation. This name may be the same as +// the instrumented code only if that code provides built-in instrumentation. +// If the name is empty, then a implementation defined default name will be +// used instead. +// +// If this is called before a global MeterProvider is registered the returned +// Meter will be a No-op implementation of a Meter. When a global MeterProvider +// is registered for the first time, the returned Meter, and all the +// instruments it has created or will create, are recreated automatically from +// the new MeterProvider. +// +// This is short for GetMeterProvider().Meter(name). +func Meter(name string, opts ...metric.MeterOption) metric.Meter { + return GetMeterProvider().Meter(name, opts...) +} + +// GetMeterProvider returns the registered global meter provider. +// +// If no global GetMeterProvider has been registered, a No-op GetMeterProvider +// implementation is returned. When a global GetMeterProvider is registered for +// the first time, the returned GetMeterProvider, and all the Meters it has +// created or will create, are recreated automatically from the new +// GetMeterProvider. +func GetMeterProvider() metric.MeterProvider { + return global.MeterProvider() +} + +// SetMeterProvider registers mp as the global MeterProvider. +func SetMeterProvider(mp metric.MeterProvider) { + global.SetMeterProvider(mp) +} diff --git a/vendor/go.opentelemetry.io/otel/metric/LICENSE b/vendor/go.opentelemetry.io/otel/metric/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/LICENSE @@ -0,0 +1,201 @@ + 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/go.opentelemetry.io/otel/metric/asyncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go new file mode 100644 index 0000000000..072baa8e8d --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go @@ -0,0 +1,271 @@ +// Copyright The OpenTelemetry 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 metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/metric/embedded" +) + +// Float64Observable describes a set of instruments used asynchronously to +// record float64 measurements once per collection cycle. Observations of +// these instruments are only made within a callback. +// +// Warning: Methods may be added to this interface in minor releases. +type Float64Observable interface { + Observable + + float64Observable() +} + +// Float64ObservableCounter is an instrument used to asynchronously record +// increasing float64 measurements once per collection cycle. Observations are +// only made within a callback for this instrument. The value observed is +// assumed the to be the cumulative sum of the count. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for +// unimplemented methods. +type Float64ObservableCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64ObservableCounter + + Float64Observable +} + +// Float64ObservableCounterConfig contains options for asynchronous counter +// instruments that record int64 values. +type Float64ObservableCounterConfig struct { + description string + unit string + callbacks []Float64Callback +} + +// NewFloat64ObservableCounterConfig returns a new +// [Float64ObservableCounterConfig] with all opts applied. +func NewFloat64ObservableCounterConfig(opts ...Float64ObservableCounterOption) Float64ObservableCounterConfig { + var config Float64ObservableCounterConfig + for _, o := range opts { + config = o.applyFloat64ObservableCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Float64ObservableCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64ObservableCounterConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Float64ObservableCounterConfig) Callbacks() []Float64Callback { + return c.callbacks +} + +// Float64ObservableCounterOption applies options to a +// [Float64ObservableCounterConfig]. See [Float64ObservableOption] and +// [InstrumentOption] for other options that can be used as a +// Float64ObservableCounterOption. +type Float64ObservableCounterOption interface { + applyFloat64ObservableCounter(Float64ObservableCounterConfig) Float64ObservableCounterConfig +} + +// Float64ObservableUpDownCounter is an instrument used to asynchronously +// record float64 measurements once per collection cycle. Observations are only +// made within a callback for this instrument. The value observed is assumed +// the to be the cumulative sum of the count. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64ObservableUpDownCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64ObservableUpDownCounter + + Float64Observable +} + +// Float64ObservableUpDownCounterConfig contains options for asynchronous +// counter instruments that record int64 values. +type Float64ObservableUpDownCounterConfig struct { + description string + unit string + callbacks []Float64Callback +} + +// NewFloat64ObservableUpDownCounterConfig returns a new +// [Float64ObservableUpDownCounterConfig] with all opts applied. +func NewFloat64ObservableUpDownCounterConfig(opts ...Float64ObservableUpDownCounterOption) Float64ObservableUpDownCounterConfig { + var config Float64ObservableUpDownCounterConfig + for _, o := range opts { + config = o.applyFloat64ObservableUpDownCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Float64ObservableUpDownCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64ObservableUpDownCounterConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Float64ObservableUpDownCounterConfig) Callbacks() []Float64Callback { + return c.callbacks +} + +// Float64ObservableUpDownCounterOption applies options to a +// [Float64ObservableUpDownCounterConfig]. See [Float64ObservableOption] and +// [InstrumentOption] for other options that can be used as a +// Float64ObservableUpDownCounterOption. +type Float64ObservableUpDownCounterOption interface { + applyFloat64ObservableUpDownCounter(Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig +} + +// Float64ObservableGauge is an instrument used to asynchronously record +// instantaneous float64 measurements once per collection cycle. Observations +// are only made within a callback for this instrument. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64ObservableGauge interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64ObservableGauge + + Float64Observable +} + +// Float64ObservableGaugeConfig contains options for asynchronous counter +// instruments that record int64 values. +type Float64ObservableGaugeConfig struct { + description string + unit string + callbacks []Float64Callback +} + +// NewFloat64ObservableGaugeConfig returns a new [Float64ObservableGaugeConfig] +// with all opts applied. +func NewFloat64ObservableGaugeConfig(opts ...Float64ObservableGaugeOption) Float64ObservableGaugeConfig { + var config Float64ObservableGaugeConfig + for _, o := range opts { + config = o.applyFloat64ObservableGauge(config) + } + return config +} + +// Description returns the configured description. +func (c Float64ObservableGaugeConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64ObservableGaugeConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Float64ObservableGaugeConfig) Callbacks() []Float64Callback { + return c.callbacks +} + +// Float64ObservableGaugeOption applies options to a +// [Float64ObservableGaugeConfig]. See [Float64ObservableOption] and +// [InstrumentOption] for other options that can be used as a +// Float64ObservableGaugeOption. +type Float64ObservableGaugeOption interface { + applyFloat64ObservableGauge(Float64ObservableGaugeConfig) Float64ObservableGaugeConfig +} + +// Float64Observer is a recorder of float64 measurements. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64Observer interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64Observer + + // Observe records the float64 value. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Observe(value float64, options ...ObserveOption) +} + +// Float64Callback is a function registered with a Meter that makes +// observations for a Float64Observerable instrument it is registered with. +// Calls to the Float64Observer record measurement values for the +// Float64Observable. +// +// The function needs to complete in a finite amount of time and the deadline +// of the passed context is expected to be honored. +// +// The function needs to make unique observations across all registered +// Float64Callbacks. Meaning, it should not report measurements with the same +// attributes as another Float64Callbacks also registered for the same +// instrument. +// +// The function needs to be concurrent safe. +type Float64Callback func(context.Context, Float64Observer) error + +// Float64ObservableOption applies options to float64 Observer instruments. +type Float64ObservableOption interface { + Float64ObservableCounterOption + Float64ObservableUpDownCounterOption + Float64ObservableGaugeOption +} + +type float64CallbackOpt struct { + cback Float64Callback +} + +func (o float64CallbackOpt) applyFloat64ObservableCounter(cfg Float64ObservableCounterConfig) Float64ObservableCounterConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +func (o float64CallbackOpt) applyFloat64ObservableUpDownCounter(cfg Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +func (o float64CallbackOpt) applyFloat64ObservableGauge(cfg Float64ObservableGaugeConfig) Float64ObservableGaugeConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +// WithFloat64Callback adds callback to be called for an instrument. +func WithFloat64Callback(callback Float64Callback) Float64ObservableOption { + return float64CallbackOpt{callback} +} diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncint64.go b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go new file mode 100644 index 0000000000..9bd6ebf020 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go @@ -0,0 +1,269 @@ +// Copyright The OpenTelemetry 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 metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/metric/embedded" +) + +// Int64Observable describes a set of instruments used asynchronously to record +// int64 measurements once per collection cycle. Observations of these +// instruments are only made within a callback. +// +// Warning: Methods may be added to this interface in minor releases. +type Int64Observable interface { + Observable + + int64Observable() +} + +// Int64ObservableCounter is an instrument used to asynchronously record +// increasing int64 measurements once per collection cycle. Observations are +// only made within a callback for this instrument. The value observed is +// assumed the to be the cumulative sum of the count. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64ObservableCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64ObservableCounter + + Int64Observable +} + +// Int64ObservableCounterConfig contains options for asynchronous counter +// instruments that record int64 values. +type Int64ObservableCounterConfig struct { + description string + unit string + callbacks []Int64Callback +} + +// NewInt64ObservableCounterConfig returns a new [Int64ObservableCounterConfig] +// with all opts applied. +func NewInt64ObservableCounterConfig(opts ...Int64ObservableCounterOption) Int64ObservableCounterConfig { + var config Int64ObservableCounterConfig + for _, o := range opts { + config = o.applyInt64ObservableCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Int64ObservableCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64ObservableCounterConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Int64ObservableCounterConfig) Callbacks() []Int64Callback { + return c.callbacks +} + +// Int64ObservableCounterOption applies options to a +// [Int64ObservableCounterConfig]. See [Int64ObservableOption] and +// [InstrumentOption] for other options that can be used as an +// Int64ObservableCounterOption. +type Int64ObservableCounterOption interface { + applyInt64ObservableCounter(Int64ObservableCounterConfig) Int64ObservableCounterConfig +} + +// Int64ObservableUpDownCounter is an instrument used to asynchronously record +// int64 measurements once per collection cycle. Observations are only made +// within a callback for this instrument. The value observed is assumed the to +// be the cumulative sum of the count. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64ObservableUpDownCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64ObservableUpDownCounter + + Int64Observable +} + +// Int64ObservableUpDownCounterConfig contains options for asynchronous counter +// instruments that record int64 values. +type Int64ObservableUpDownCounterConfig struct { + description string + unit string + callbacks []Int64Callback +} + +// NewInt64ObservableUpDownCounterConfig returns a new +// [Int64ObservableUpDownCounterConfig] with all opts applied. +func NewInt64ObservableUpDownCounterConfig(opts ...Int64ObservableUpDownCounterOption) Int64ObservableUpDownCounterConfig { + var config Int64ObservableUpDownCounterConfig + for _, o := range opts { + config = o.applyInt64ObservableUpDownCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Int64ObservableUpDownCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64ObservableUpDownCounterConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Int64ObservableUpDownCounterConfig) Callbacks() []Int64Callback { + return c.callbacks +} + +// Int64ObservableUpDownCounterOption applies options to a +// [Int64ObservableUpDownCounterConfig]. See [Int64ObservableOption] and +// [InstrumentOption] for other options that can be used as an +// Int64ObservableUpDownCounterOption. +type Int64ObservableUpDownCounterOption interface { + applyInt64ObservableUpDownCounter(Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig +} + +// Int64ObservableGauge is an instrument used to asynchronously record +// instantaneous int64 measurements once per collection cycle. Observations are +// only made within a callback for this instrument. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64ObservableGauge interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64ObservableGauge + + Int64Observable +} + +// Int64ObservableGaugeConfig contains options for asynchronous counter +// instruments that record int64 values. +type Int64ObservableGaugeConfig struct { + description string + unit string + callbacks []Int64Callback +} + +// NewInt64ObservableGaugeConfig returns a new [Int64ObservableGaugeConfig] +// with all opts applied. +func NewInt64ObservableGaugeConfig(opts ...Int64ObservableGaugeOption) Int64ObservableGaugeConfig { + var config Int64ObservableGaugeConfig + for _, o := range opts { + config = o.applyInt64ObservableGauge(config) + } + return config +} + +// Description returns the configured description. +func (c Int64ObservableGaugeConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64ObservableGaugeConfig) Unit() string { + return c.unit +} + +// Callbacks returns the configured callbacks. +func (c Int64ObservableGaugeConfig) Callbacks() []Int64Callback { + return c.callbacks +} + +// Int64ObservableGaugeOption applies options to a +// [Int64ObservableGaugeConfig]. See [Int64ObservableOption] and +// [InstrumentOption] for other options that can be used as an +// Int64ObservableGaugeOption. +type Int64ObservableGaugeOption interface { + applyInt64ObservableGauge(Int64ObservableGaugeConfig) Int64ObservableGaugeConfig +} + +// Int64Observer is a recorder of int64 measurements. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64Observer interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64Observer + + // Observe records the int64 value. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Observe(value int64, options ...ObserveOption) +} + +// Int64Callback is a function registered with a Meter that makes observations +// for an Int64Observerable instrument it is registered with. Calls to the +// Int64Observer record measurement values for the Int64Observable. +// +// The function needs to complete in a finite amount of time and the deadline +// of the passed context is expected to be honored. +// +// The function needs to make unique observations across all registered +// Int64Callbacks. Meaning, it should not report measurements with the same +// attributes as another Int64Callbacks also registered for the same +// instrument. +// +// The function needs to be concurrent safe. +type Int64Callback func(context.Context, Int64Observer) error + +// Int64ObservableOption applies options to int64 Observer instruments. +type Int64ObservableOption interface { + Int64ObservableCounterOption + Int64ObservableUpDownCounterOption + Int64ObservableGaugeOption +} + +type int64CallbackOpt struct { + cback Int64Callback +} + +func (o int64CallbackOpt) applyInt64ObservableCounter(cfg Int64ObservableCounterConfig) Int64ObservableCounterConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +func (o int64CallbackOpt) applyInt64ObservableUpDownCounter(cfg Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +func (o int64CallbackOpt) applyInt64ObservableGauge(cfg Int64ObservableGaugeConfig) Int64ObservableGaugeConfig { + cfg.callbacks = append(cfg.callbacks, o.cback) + return cfg +} + +// WithInt64Callback adds callback to be called for an instrument. +func WithInt64Callback(callback Int64Callback) Int64ObservableOption { + return int64CallbackOpt{callback} +} diff --git a/vendor/go.opentelemetry.io/otel/metric/config.go b/vendor/go.opentelemetry.io/otel/metric/config.go new file mode 100644 index 0000000000..778ad2d748 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/config.go @@ -0,0 +1,92 @@ +// Copyright The OpenTelemetry 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 metric // import "go.opentelemetry.io/otel/metric" + +import "go.opentelemetry.io/otel/attribute" + +// MeterConfig contains options for Meters. +type MeterConfig struct { + instrumentationVersion string + schemaURL string + attrs attribute.Set + + // Ensure forward compatibility by explicitly making this not comparable. + noCmp [0]func() //nolint: unused // This is indeed used. +} + +// InstrumentationVersion returns the version of the library providing +// instrumentation. +func (cfg MeterConfig) InstrumentationVersion() string { + return cfg.instrumentationVersion +} + +// InstrumentationAttributes returns the attributes associated with the library +// providing instrumentation. +func (cfg MeterConfig) InstrumentationAttributes() attribute.Set { + return cfg.attrs +} + +// SchemaURL is the schema_url of the library providing instrumentation. +func (cfg MeterConfig) SchemaURL() string { + return cfg.schemaURL +} + +// MeterOption is an interface for applying Meter options. +type MeterOption interface { + // applyMeter is used to set a MeterOption value of a MeterConfig. + applyMeter(MeterConfig) MeterConfig +} + +// NewMeterConfig creates a new MeterConfig and applies +// all the given options. +func NewMeterConfig(opts ...MeterOption) MeterConfig { + var config MeterConfig + for _, o := range opts { + config = o.applyMeter(config) + } + return config +} + +type meterOptionFunc func(MeterConfig) MeterConfig + +func (fn meterOptionFunc) applyMeter(cfg MeterConfig) MeterConfig { + return fn(cfg) +} + +// WithInstrumentationVersion sets the instrumentation version. +func WithInstrumentationVersion(version string) MeterOption { + return meterOptionFunc(func(config MeterConfig) MeterConfig { + config.instrumentationVersion = version + return config + }) +} + +// WithInstrumentationAttributes sets the instrumentation attributes. +// +// The passed attributes will be de-duplicated. +func WithInstrumentationAttributes(attr ...attribute.KeyValue) MeterOption { + return meterOptionFunc(func(config MeterConfig) MeterConfig { + config.attrs = attribute.NewSet(attr...) + return config + }) +} + +// WithSchemaURL sets the schema URL. +func WithSchemaURL(schemaURL string) MeterOption { + return meterOptionFunc(func(config MeterConfig) MeterConfig { + config.schemaURL = schemaURL + return config + }) +} diff --git a/vendor/go.opentelemetry.io/otel/metric/doc.go b/vendor/go.opentelemetry.io/otel/metric/doc.go new file mode 100644 index 0000000000..54716e13b3 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/doc.go @@ -0,0 +1,170 @@ +// Copyright The OpenTelemetry 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 metric provides the OpenTelemetry API used to measure metrics about +source code operation. + +This API is separate from its implementation so the instrumentation built from +it is reusable. See [go.opentelemetry.io/otel/sdk/metric] for the official +OpenTelemetry implementation of this API. + +All measurements made with this package are made via instruments. These +instruments are created by a [Meter] which itself is created by a +[MeterProvider]. Applications need to accept a [MeterProvider] implementation +as a starting point when instrumenting. This can be done directly, or by using +the OpenTelemetry global MeterProvider via [GetMeterProvider]. Using an +appropriately named [Meter] from the accepted [MeterProvider], instrumentation +can then be built from the [Meter]'s instruments. + +# Instruments + +Each instrument is designed to make measurements of a particular type. Broadly, +all instruments fall into two overlapping logical categories: asynchronous or +synchronous, and int64 or float64. + +All synchronous instruments ([Int64Counter], [Int64UpDownCounter], +[Int64Histogram], [Float64Counter], [Float64UpDownCounter], and +[Float64Histogram]) are used to measure the operation and performance of source +code during the source code execution. These instruments only make measurements +when the source code they instrument is run. + +All asynchronous instruments ([Int64ObservableCounter], +[Int64ObservableUpDownCounter], [Int64ObservableGauge], +[Float64ObservableCounter], [Float64ObservableUpDownCounter], and +[Float64ObservableGauge]) are used to measure metrics outside of the execution +of source code. They are said to make "observations" via a callback function +called once every measurement collection cycle. + +Each instrument is also grouped by the value type it measures. Either int64 or +float64. The value being measured will dictate which instrument in these +categories to use. + +Outside of these two broad categories, instruments are described by the +function they are designed to serve. All Counters ([Int64Counter], +[Float64Counter], [Int64ObservableCounter], and [Float64ObservableCounter]) are +designed to measure values that never decrease in value, but instead only +incrementally increase in value. UpDownCounters ([Int64UpDownCounter], +[Float64UpDownCounter], [Int64ObservableUpDownCounter], and +[Float64ObservableUpDownCounter]) on the other hand, are designed to measure +values that can increase and decrease. When more information needs to be +conveyed about all the synchronous measurements made during a collection cycle, +a Histogram ([Int64Histogram] and [Float64Histogram]) should be used. Finally, +when just the most recent measurement needs to be conveyed about an +asynchronous measurement, a Gauge ([Int64ObservableGauge] and +[Float64ObservableGauge]) should be used. + +See the [OpenTelemetry documentation] for more information about instruments +and their intended use. + +# Measurements + +Measurements are made by recording values and information about the values with +an instrument. How these measurements are recorded depends on the instrument. + +Measurements for synchronous instruments ([Int64Counter], [Int64UpDownCounter], +[Int64Histogram], [Float64Counter], [Float64UpDownCounter], and +[Float64Histogram]) are recorded using the instrument methods directly. All +counter instruments have an Add method that is used to measure an increment +value, and all histogram instruments have a Record method to measure a data +point. + +Asynchronous instruments ([Int64ObservableCounter], +[Int64ObservableUpDownCounter], [Int64ObservableGauge], +[Float64ObservableCounter], [Float64ObservableUpDownCounter], and +[Float64ObservableGauge]) record measurements within a callback function. The +callback is registered with the Meter which ensures the callback is called once +per collection cycle. A callback can be registered two ways: during the +instrument's creation using an option, or later using the RegisterCallback +method of the [Meter] that created the instrument. + +If the following criteria are met, an option ([WithInt64Callback] or +[WithFloat64Callback]) can be used during the asynchronous instrument's +creation to register a callback ([Int64Callback] or [Float64Callback], +respectively): + + - The measurement process is known when the instrument is created + - Only that instrument will make a measurement within the callback + - The callback never needs to be unregistered + +If the criteria are not met, use the RegisterCallback method of the [Meter] that +created the instrument to register a [Callback]. + +# API Implementations + +This package does not conform to the standard Go versioning policy, all of its +interfaces may have methods added to them without a package major version bump. +This non-standard API evolution could surprise an uninformed implementation +author. They could unknowingly build their implementation in a way that would +result in a runtime panic for their users that update to the new API. + +The API is designed to help inform an instrumentation author about this +non-standard API evolution. It requires them to choose a default behavior for +unimplemented interface methods. There are three behavior choices they can +make: + + - Compilation failure + - Panic + - Default to another implementation + +All interfaces in this API embed a corresponding interface from +[go.opentelemetry.io/otel/metric/embedded]. If an author wants the default +behavior of their implementations to be a compilation failure, signaling to +their users they need to update to the latest version of that implementation, +they need to embed the corresponding interface from +[go.opentelemetry.io/otel/metric/embedded] in their implementation. For +example, + + import "go.opentelemetry.io/otel/metric/embedded" + + type MeterProvider struct { + embedded.MeterProvider + // ... + } + +If an author wants the default behavior of their implementations to a panic, +they need to embed the API interface directly. + + import "go.opentelemetry.io/otel/metric" + + type MeterProvider struct { + metric.MeterProvider + // ... + } + +This is not a recommended behavior as it could lead to publishing packages that +contain runtime panics when users update other package that use newer versions +of [go.opentelemetry.io/otel/metric]. + +Finally, an author can embed another implementation in theirs. The embedded +implementation will be used for methods not defined by the author. For example, +an author who wants to default to silently dropping the call can use +[go.opentelemetry.io/otel/metric/noop]: + + import "go.opentelemetry.io/otel/metric/noop" + + type MeterProvider struct { + noop.MeterProvider + // ... + } + +It is strongly recommended that authors only embed +[go.opentelemetry.io/otel/metric/noop] if they choose this default behavior. +That implementation is the only one OpenTelemetry authors can guarantee will +fully implement all the API interfaces when a user updates their API. + +[OpenTelemetry documentation]: https://opentelemetry.io/docs/concepts/signals/metrics/ +[GetMeterProvider]: https://pkg.go.dev/go.opentelemetry.io/otel#GetMeterProvider +*/ +package metric // import "go.opentelemetry.io/otel/metric" diff --git a/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go b/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go new file mode 100644 index 0000000000..ae0bdbd2e6 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go @@ -0,0 +1,234 @@ +// Copyright The OpenTelemetry 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 embedded provides interfaces embedded within the [OpenTelemetry +// metric API]. +// +// Implementers of the [OpenTelemetry metric API] can embed the relevant type +// from this package into their implementation directly. Doing so will result +// in a compilation error for users when the [OpenTelemetry metric API] is +// extended (which is something that can happen without a major version bump of +// the API package). +// +// [OpenTelemetry metric API]: https://pkg.go.dev/go.opentelemetry.io/otel/metric +package embedded // import "go.opentelemetry.io/otel/metric/embedded" + +// MeterProvider is embedded in +// [go.opentelemetry.io/otel/metric.MeterProvider]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.MeterProvider] if you want users to +// experience a compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/metric.MeterProvider] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type MeterProvider interface{ meterProvider() } + +// Meter is embedded in [go.opentelemetry.io/otel/metric.Meter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Meter] if you want users to experience a +// compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/metric.Meter] interface +// is extended (which is something that can happen without a major version bump +// of the API package). +type Meter interface{ meter() } + +// Float64Observer is embedded in +// [go.opentelemetry.io/otel/metric.Float64Observer]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64Observer] if you want +// users to experience a compilation error, signaling they need to update to +// your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64Observer] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Float64Observer interface{ float64Observer() } + +// Int64Observer is embedded in +// [go.opentelemetry.io/otel/metric.Int64Observer]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64Observer] if you want users +// to experience a compilation error, signaling they need to update to your +// latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64Observer] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Int64Observer interface{ int64Observer() } + +// Observer is embedded in [go.opentelemetry.io/otel/metric.Observer]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Observer] if you want users to experience a +// compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/metric.Observer] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Observer interface{ observer() } + +// Registration is embedded in [go.opentelemetry.io/otel/metric.Registration]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Registration] if you want users to +// experience a compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/metric.Registration] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Registration interface{ registration() } + +// Float64Counter is embedded in +// [go.opentelemetry.io/otel/metric.Float64Counter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64Counter] if you want +// users to experience a compilation error, signaling they need to update to +// your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64Counter] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Float64Counter interface{ float64Counter() } + +// Float64Histogram is embedded in +// [go.opentelemetry.io/otel/metric.Float64Histogram]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64Histogram] if you want +// users to experience a compilation error, signaling they need to update to +// your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64Histogram] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Float64Histogram interface{ float64Histogram() } + +// Float64ObservableCounter is embedded in +// [go.opentelemetry.io/otel/metric.Float64ObservableCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64ObservableCounter] if you +// want users to experience a compilation error, signaling they need to update +// to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64ObservableCounter] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Float64ObservableCounter interface{ float64ObservableCounter() } + +// Float64ObservableGauge is embedded in +// [go.opentelemetry.io/otel/metric.Float64ObservableGauge]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64ObservableGauge] if you +// want users to experience a compilation error, signaling they need to update +// to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64ObservableGauge] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Float64ObservableGauge interface{ float64ObservableGauge() } + +// Float64ObservableUpDownCounter is embedded in +// [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter] +// if you want users to experience a compilation error, signaling they need to +// update to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Float64ObservableUpDownCounter interface{ float64ObservableUpDownCounter() } + +// Float64UpDownCounter is embedded in +// [go.opentelemetry.io/otel/metric.Float64UpDownCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Float64UpDownCounter] if you +// want users to experience a compilation error, signaling they need to update +// to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Float64UpDownCounter] interface +// is extended (which is something that can happen without a major version bump +// of the API package). +type Float64UpDownCounter interface{ float64UpDownCounter() } + +// Int64Counter is embedded in +// [go.opentelemetry.io/otel/metric.Int64Counter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64Counter] if you want users +// to experience a compilation error, signaling they need to update to your +// latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64Counter] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Int64Counter interface{ int64Counter() } + +// Int64Histogram is embedded in +// [go.opentelemetry.io/otel/metric.Int64Histogram]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64Histogram] if you want +// users to experience a compilation error, signaling they need to update to +// your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64Histogram] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Int64Histogram interface{ int64Histogram() } + +// Int64ObservableCounter is embedded in +// [go.opentelemetry.io/otel/metric.Int64ObservableCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64ObservableCounter] if you +// want users to experience a compilation error, signaling they need to update +// to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64ObservableCounter] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Int64ObservableCounter interface{ int64ObservableCounter() } + +// Int64ObservableGauge is embedded in +// [go.opentelemetry.io/otel/metric.Int64ObservableGauge]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64ObservableGauge] if you +// want users to experience a compilation error, signaling they need to update +// to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64ObservableGauge] interface +// is extended (which is something that can happen without a major version bump +// of the API package). +type Int64ObservableGauge interface{ int64ObservableGauge() } + +// Int64ObservableUpDownCounter is embedded in +// [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter] if +// you want users to experience a compilation error, signaling they need to +// update to your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type Int64ObservableUpDownCounter interface{ int64ObservableUpDownCounter() } + +// Int64UpDownCounter is embedded in +// [go.opentelemetry.io/otel/metric.Int64UpDownCounter]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/metric.Int64UpDownCounter] if you want +// users to experience a compilation error, signaling they need to update to +// your latest implementation, when the +// [go.opentelemetry.io/otel/metric.Int64UpDownCounter] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Int64UpDownCounter interface{ int64UpDownCounter() } diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument.go b/vendor/go.opentelemetry.io/otel/metric/instrument.go new file mode 100644 index 0000000000..be89cd5334 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/instrument.go @@ -0,0 +1,357 @@ +// Copyright The OpenTelemetry 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 metric // import "go.opentelemetry.io/otel/metric" + +import "go.opentelemetry.io/otel/attribute" + +// Observable is used as a grouping mechanism for all instruments that are +// updated within a Callback. +type Observable interface { + observable() +} + +// InstrumentOption applies options to all instruments. +type InstrumentOption interface { + Int64CounterOption + Int64UpDownCounterOption + Int64HistogramOption + Int64ObservableCounterOption + Int64ObservableUpDownCounterOption + Int64ObservableGaugeOption + + Float64CounterOption + Float64UpDownCounterOption + Float64HistogramOption + Float64ObservableCounterOption + Float64ObservableUpDownCounterOption + Float64ObservableGaugeOption +} + +// HistogramOption applies options to histogram instruments. +type HistogramOption interface { + Int64HistogramOption + Float64HistogramOption +} + +type descOpt string + +func (o descOpt) applyFloat64Counter(c Float64CounterConfig) Float64CounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyFloat64UpDownCounter(c Float64UpDownCounterConfig) Float64UpDownCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64HistogramConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyFloat64ObservableUpDownCounter(c Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyFloat64ObservableGauge(c Float64ObservableGaugeConfig) Float64ObservableGaugeConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64Counter(c Int64CounterConfig) Int64CounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64UpDownCounter(c Int64UpDownCounterConfig) Int64UpDownCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64ObservableUpDownCounter(c Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig { + c.description = string(o) + return c +} + +func (o descOpt) applyInt64ObservableGauge(c Int64ObservableGaugeConfig) Int64ObservableGaugeConfig { + c.description = string(o) + return c +} + +// WithDescription sets the instrument description. +func WithDescription(desc string) InstrumentOption { return descOpt(desc) } + +type unitOpt string + +func (o unitOpt) applyFloat64Counter(c Float64CounterConfig) Float64CounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyFloat64UpDownCounter(c Float64UpDownCounterConfig) Float64UpDownCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64HistogramConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyFloat64ObservableUpDownCounter(c Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyFloat64ObservableGauge(c Float64ObservableGaugeConfig) Float64ObservableGaugeConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64Counter(c Int64CounterConfig) Int64CounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64UpDownCounter(c Int64UpDownCounterConfig) Int64UpDownCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64ObservableUpDownCounter(c Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig { + c.unit = string(o) + return c +} + +func (o unitOpt) applyInt64ObservableGauge(c Int64ObservableGaugeConfig) Int64ObservableGaugeConfig { + c.unit = string(o) + return c +} + +// WithUnit sets the instrument unit. +// +// The unit u should be defined using the appropriate [UCUM](https://ucum.org) case-sensitive code. +func WithUnit(u string) InstrumentOption { return unitOpt(u) } + +// WithExplicitBucketBoundaries sets the instrument explicit bucket boundaries. +// +// This option is considered "advisory", and may be ignored by API implementations. +func WithExplicitBucketBoundaries(bounds ...float64) HistogramOption { return bucketOpt(bounds) } + +type bucketOpt []float64 + +func (o bucketOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64HistogramConfig { + c.explicitBucketBoundaries = o + return c +} + +func (o bucketOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfig { + c.explicitBucketBoundaries = o + return c +} + +// AddOption applies options to an addition measurement. See +// [MeasurementOption] for other options that can be used as an AddOption. +type AddOption interface { + applyAdd(AddConfig) AddConfig +} + +// AddConfig contains options for an addition measurement. +type AddConfig struct { + attrs attribute.Set +} + +// NewAddConfig returns a new [AddConfig] with all opts applied. +func NewAddConfig(opts []AddOption) AddConfig { + config := AddConfig{attrs: *attribute.EmptySet()} + for _, o := range opts { + config = o.applyAdd(config) + } + return config +} + +// Attributes returns the configured attribute set. +func (c AddConfig) Attributes() attribute.Set { + return c.attrs +} + +// RecordOption applies options to an addition measurement. See +// [MeasurementOption] for other options that can be used as a RecordOption. +type RecordOption interface { + applyRecord(RecordConfig) RecordConfig +} + +// RecordConfig contains options for a recorded measurement. +type RecordConfig struct { + attrs attribute.Set +} + +// NewRecordConfig returns a new [RecordConfig] with all opts applied. +func NewRecordConfig(opts []RecordOption) RecordConfig { + config := RecordConfig{attrs: *attribute.EmptySet()} + for _, o := range opts { + config = o.applyRecord(config) + } + return config +} + +// Attributes returns the configured attribute set. +func (c RecordConfig) Attributes() attribute.Set { + return c.attrs +} + +// ObserveOption applies options to an addition measurement. See +// [MeasurementOption] for other options that can be used as a ObserveOption. +type ObserveOption interface { + applyObserve(ObserveConfig) ObserveConfig +} + +// ObserveConfig contains options for an observed measurement. +type ObserveConfig struct { + attrs attribute.Set +} + +// NewObserveConfig returns a new [ObserveConfig] with all opts applied. +func NewObserveConfig(opts []ObserveOption) ObserveConfig { + config := ObserveConfig{attrs: *attribute.EmptySet()} + for _, o := range opts { + config = o.applyObserve(config) + } + return config +} + +// Attributes returns the configured attribute set. +func (c ObserveConfig) Attributes() attribute.Set { + return c.attrs +} + +// MeasurementOption applies options to all instrument measurement. +type MeasurementOption interface { + AddOption + RecordOption + ObserveOption +} + +type attrOpt struct { + set attribute.Set +} + +// mergeSets returns the union of keys between a and b. Any duplicate keys will +// use the value associated with b. +func mergeSets(a, b attribute.Set) attribute.Set { + // NewMergeIterator uses the first value for any duplicates. + iter := attribute.NewMergeIterator(&b, &a) + merged := make([]attribute.KeyValue, 0, a.Len()+b.Len()) + for iter.Next() { + merged = append(merged, iter.Attribute()) + } + return attribute.NewSet(merged...) +} + +func (o attrOpt) applyAdd(c AddConfig) AddConfig { + switch { + case o.set.Len() == 0: + case c.attrs.Len() == 0: + c.attrs = o.set + default: + c.attrs = mergeSets(c.attrs, o.set) + } + return c +} + +func (o attrOpt) applyRecord(c RecordConfig) RecordConfig { + switch { + case o.set.Len() == 0: + case c.attrs.Len() == 0: + c.attrs = o.set + default: + c.attrs = mergeSets(c.attrs, o.set) + } + return c +} + +func (o attrOpt) applyObserve(c ObserveConfig) ObserveConfig { + switch { + case o.set.Len() == 0: + case c.attrs.Len() == 0: + c.attrs = o.set + default: + c.attrs = mergeSets(c.attrs, o.set) + } + return c +} + +// WithAttributeSet sets the attribute Set associated with a measurement is +// made with. +// +// If multiple WithAttributeSet or WithAttributes options are passed the +// attributes will be merged together in the order they are passed. Attributes +// with duplicate keys will use the last value passed. +func WithAttributeSet(attributes attribute.Set) MeasurementOption { + return attrOpt{set: attributes} +} + +// WithAttributes converts attributes into an attribute Set and sets the Set to +// be associated with a measurement. This is shorthand for: +// +// cp := make([]attribute.KeyValue, len(attributes)) +// copy(cp, attributes) +// WithAttributes(attribute.NewSet(cp...)) +// +// [attribute.NewSet] may modify the passed attributes so this will make a copy +// of attributes before creating a set in order to ensure this function is +// concurrent safe. This makes this option function less optimized in +// comparison to [WithAttributeSet]. Therefore, [WithAttributeSet] should be +// preferred for performance sensitive code. +// +// See [WithAttributeSet] for information about how multiple WithAttributes are +// merged. +func WithAttributes(attributes ...attribute.KeyValue) MeasurementOption { + cp := make([]attribute.KeyValue, len(attributes)) + copy(cp, attributes) + return attrOpt{set: attribute.NewSet(cp...)} +} diff --git a/vendor/go.opentelemetry.io/otel/metric/meter.go b/vendor/go.opentelemetry.io/otel/metric/meter.go new file mode 100644 index 0000000000..2520bc74af --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/meter.go @@ -0,0 +1,212 @@ +// Copyright The OpenTelemetry 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 metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/metric/embedded" +) + +// MeterProvider provides access to named Meter instances, for instrumenting +// an application or package. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type MeterProvider interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.MeterProvider + + // Meter returns a new Meter with the provided name and configuration. + // + // A Meter should be scoped at most to a single package. The name needs to + // be unique so it does not collide with other names used by + // an application, nor other applications. To achieve this, the import path + // of the instrumentation package is recommended to be used as name. + // + // If the name is empty, then an implementation defined default name will + // be used instead. + Meter(name string, opts ...MeterOption) Meter +} + +// Meter provides access to instrument instances for recording metrics. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Meter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Meter + + // Int64Counter returns a new Int64Counter instrument identified by name + // and configured with options. The instrument is used to synchronously + // record increasing int64 measurements during a computational operation. + Int64Counter(name string, options ...Int64CounterOption) (Int64Counter, error) + // Int64UpDownCounter returns a new Int64UpDownCounter instrument + // identified by name and configured with options. The instrument is used + // to synchronously record int64 measurements during a computational + // operation. + Int64UpDownCounter(name string, options ...Int64UpDownCounterOption) (Int64UpDownCounter, error) + // Int64Histogram returns a new Int64Histogram instrument identified by + // name and configured with options. The instrument is used to + // synchronously record the distribution of int64 measurements during a + // computational operation. + Int64Histogram(name string, options ...Int64HistogramOption) (Int64Histogram, error) + // Int64ObservableCounter returns a new Int64ObservableCounter identified + // by name and configured with options. The instrument is used to + // asynchronously record increasing int64 measurements once per a + // measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithInt64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Int64ObservableCounter(name string, options ...Int64ObservableCounterOption) (Int64ObservableCounter, error) + // Int64ObservableUpDownCounter returns a new Int64ObservableUpDownCounter + // instrument identified by name and configured with options. The + // instrument is used to asynchronously record int64 measurements once per + // a measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithInt64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Int64ObservableUpDownCounter(name string, options ...Int64ObservableUpDownCounterOption) (Int64ObservableUpDownCounter, error) + // Int64ObservableGauge returns a new Int64ObservableGauge instrument + // identified by name and configured with options. The instrument is used + // to asynchronously record instantaneous int64 measurements once per a + // measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithInt64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Int64ObservableGauge(name string, options ...Int64ObservableGaugeOption) (Int64ObservableGauge, error) + + // Float64Counter returns a new Float64Counter instrument identified by + // name and configured with options. The instrument is used to + // synchronously record increasing float64 measurements during a + // computational operation. + Float64Counter(name string, options ...Float64CounterOption) (Float64Counter, error) + // Float64UpDownCounter returns a new Float64UpDownCounter instrument + // identified by name and configured with options. The instrument is used + // to synchronously record float64 measurements during a computational + // operation. + Float64UpDownCounter(name string, options ...Float64UpDownCounterOption) (Float64UpDownCounter, error) + // Float64Histogram returns a new Float64Histogram instrument identified by + // name and configured with options. The instrument is used to + // synchronously record the distribution of float64 measurements during a + // computational operation. + Float64Histogram(name string, options ...Float64HistogramOption) (Float64Histogram, error) + // Float64ObservableCounter returns a new Float64ObservableCounter + // instrument identified by name and configured with options. The + // instrument is used to asynchronously record increasing float64 + // measurements once per a measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithFloat64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Float64ObservableCounter(name string, options ...Float64ObservableCounterOption) (Float64ObservableCounter, error) + // Float64ObservableUpDownCounter returns a new + // Float64ObservableUpDownCounter instrument identified by name and + // configured with options. The instrument is used to asynchronously record + // float64 measurements once per a measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithFloat64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Float64ObservableUpDownCounter(name string, options ...Float64ObservableUpDownCounterOption) (Float64ObservableUpDownCounter, error) + // Float64ObservableGauge returns a new Float64ObservableGauge instrument + // identified by name and configured with options. The instrument is used + // to asynchronously record instantaneous float64 measurements once per a + // measurement collection cycle. + // + // Measurements for the returned instrument are made via a callback. Use + // the WithFloat64Callback option to register the callback here, or use the + // RegisterCallback method of this Meter to register one later. See the + // Measurements section of the package documentation for more information. + Float64ObservableGauge(name string, options ...Float64ObservableGaugeOption) (Float64ObservableGauge, error) + + // RegisterCallback registers f to be called during the collection of a + // measurement cycle. + // + // If Unregister of the returned Registration is called, f needs to be + // unregistered and not called during collection. + // + // The instruments f is registered with are the only instruments that f may + // observe values for. + // + // If no instruments are passed, f should not be registered nor called + // during collection. + // + // The function f needs to be concurrent safe. + RegisterCallback(f Callback, instruments ...Observable) (Registration, error) +} + +// Callback is a function registered with a Meter that makes observations for +// the set of instruments it is registered with. The Observer parameter is used +// to record measurement observations for these instruments. +// +// The function needs to complete in a finite amount of time and the deadline +// of the passed context is expected to be honored. +// +// The function needs to make unique observations across all registered +// Callbacks. Meaning, it should not report measurements for an instrument with +// the same attributes as another Callback will report. +// +// The function needs to be concurrent safe. +type Callback func(context.Context, Observer) error + +// Observer records measurements for multiple instruments in a Callback. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Observer interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Observer + + // ObserveFloat64 records the float64 value for obsrv. + ObserveFloat64(obsrv Float64Observable, value float64, opts ...ObserveOption) + // ObserveInt64 records the int64 value for obsrv. + ObserveInt64(obsrv Int64Observable, value int64, opts ...ObserveOption) +} + +// Registration is an token representing the unique registration of a callback +// for a set of instruments with a Meter. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Registration interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Registration + + // Unregister removes the callback registration from a Meter. + // + // This method needs to be idempotent and concurrent safe. + Unregister() error +} diff --git a/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go new file mode 100644 index 0000000000..0a4825ae6a --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go @@ -0,0 +1,185 @@ +// Copyright The OpenTelemetry 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 metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/metric/embedded" +) + +// Float64Counter is an instrument that records increasing float64 values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64Counter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64Counter + + // Add records a change to the counter. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Add(ctx context.Context, incr float64, options ...AddOption) +} + +// Float64CounterConfig contains options for synchronous counter instruments that +// record int64 values. +type Float64CounterConfig struct { + description string + unit string +} + +// NewFloat64CounterConfig returns a new [Float64CounterConfig] with all opts +// applied. +func NewFloat64CounterConfig(opts ...Float64CounterOption) Float64CounterConfig { + var config Float64CounterConfig + for _, o := range opts { + config = o.applyFloat64Counter(config) + } + return config +} + +// Description returns the configured description. +func (c Float64CounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64CounterConfig) Unit() string { + return c.unit +} + +// Float64CounterOption applies options to a [Float64CounterConfig]. See +// [InstrumentOption] for other options that can be used as a +// Float64CounterOption. +type Float64CounterOption interface { + applyFloat64Counter(Float64CounterConfig) Float64CounterConfig +} + +// Float64UpDownCounter is an instrument that records increasing or decreasing +// float64 values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64UpDownCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64UpDownCounter + + // Add records a change to the counter. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Add(ctx context.Context, incr float64, options ...AddOption) +} + +// Float64UpDownCounterConfig contains options for synchronous counter +// instruments that record int64 values. +type Float64UpDownCounterConfig struct { + description string + unit string +} + +// NewFloat64UpDownCounterConfig returns a new [Float64UpDownCounterConfig] +// with all opts applied. +func NewFloat64UpDownCounterConfig(opts ...Float64UpDownCounterOption) Float64UpDownCounterConfig { + var config Float64UpDownCounterConfig + for _, o := range opts { + config = o.applyFloat64UpDownCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Float64UpDownCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64UpDownCounterConfig) Unit() string { + return c.unit +} + +// Float64UpDownCounterOption applies options to a +// [Float64UpDownCounterConfig]. See [InstrumentOption] for other options that +// can be used as a Float64UpDownCounterOption. +type Float64UpDownCounterOption interface { + applyFloat64UpDownCounter(Float64UpDownCounterConfig) Float64UpDownCounterConfig +} + +// Float64Histogram is an instrument that records a distribution of float64 +// values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Float64Histogram interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Float64Histogram + + // Record adds an additional value to the distribution. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Record(ctx context.Context, incr float64, options ...RecordOption) +} + +// Float64HistogramConfig contains options for synchronous counter instruments +// that record int64 values. +type Float64HistogramConfig struct { + description string + unit string + explicitBucketBoundaries []float64 +} + +// NewFloat64HistogramConfig returns a new [Float64HistogramConfig] with all +// opts applied. +func NewFloat64HistogramConfig(opts ...Float64HistogramOption) Float64HistogramConfig { + var config Float64HistogramConfig + for _, o := range opts { + config = o.applyFloat64Histogram(config) + } + return config +} + +// Description returns the configured description. +func (c Float64HistogramConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Float64HistogramConfig) Unit() string { + return c.unit +} + +// ExplicitBucketBoundaries returns the configured explicit bucket boundaries. +func (c Float64HistogramConfig) ExplicitBucketBoundaries() []float64 { + return c.explicitBucketBoundaries +} + +// Float64HistogramOption applies options to a [Float64HistogramConfig]. See +// [InstrumentOption] for other options that can be used as a +// Float64HistogramOption. +type Float64HistogramOption interface { + applyFloat64Histogram(Float64HistogramConfig) Float64HistogramConfig +} diff --git a/vendor/go.opentelemetry.io/otel/metric/syncint64.go b/vendor/go.opentelemetry.io/otel/metric/syncint64.go new file mode 100644 index 0000000000..56667d32fc --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/metric/syncint64.go @@ -0,0 +1,185 @@ +// Copyright The OpenTelemetry 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 metric // import "go.opentelemetry.io/otel/metric" + +import ( + "context" + + "go.opentelemetry.io/otel/metric/embedded" +) + +// Int64Counter is an instrument that records increasing int64 values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64Counter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64Counter + + // Add records a change to the counter. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Add(ctx context.Context, incr int64, options ...AddOption) +} + +// Int64CounterConfig contains options for synchronous counter instruments that +// record int64 values. +type Int64CounterConfig struct { + description string + unit string +} + +// NewInt64CounterConfig returns a new [Int64CounterConfig] with all opts +// applied. +func NewInt64CounterConfig(opts ...Int64CounterOption) Int64CounterConfig { + var config Int64CounterConfig + for _, o := range opts { + config = o.applyInt64Counter(config) + } + return config +} + +// Description returns the configured description. +func (c Int64CounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64CounterConfig) Unit() string { + return c.unit +} + +// Int64CounterOption applies options to a [Int64CounterConfig]. See +// [InstrumentOption] for other options that can be used as an +// Int64CounterOption. +type Int64CounterOption interface { + applyInt64Counter(Int64CounterConfig) Int64CounterConfig +} + +// Int64UpDownCounter is an instrument that records increasing or decreasing +// int64 values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64UpDownCounter interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64UpDownCounter + + // Add records a change to the counter. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Add(ctx context.Context, incr int64, options ...AddOption) +} + +// Int64UpDownCounterConfig contains options for synchronous counter +// instruments that record int64 values. +type Int64UpDownCounterConfig struct { + description string + unit string +} + +// NewInt64UpDownCounterConfig returns a new [Int64UpDownCounterConfig] with +// all opts applied. +func NewInt64UpDownCounterConfig(opts ...Int64UpDownCounterOption) Int64UpDownCounterConfig { + var config Int64UpDownCounterConfig + for _, o := range opts { + config = o.applyInt64UpDownCounter(config) + } + return config +} + +// Description returns the configured description. +func (c Int64UpDownCounterConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64UpDownCounterConfig) Unit() string { + return c.unit +} + +// Int64UpDownCounterOption applies options to a [Int64UpDownCounterConfig]. +// See [InstrumentOption] for other options that can be used as an +// Int64UpDownCounterOption. +type Int64UpDownCounterOption interface { + applyInt64UpDownCounter(Int64UpDownCounterConfig) Int64UpDownCounterConfig +} + +// Int64Histogram is an instrument that records a distribution of int64 +// values. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Int64Histogram interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Int64Histogram + + // Record adds an additional value to the distribution. + // + // Use the WithAttributeSet (or, if performance is not a concern, + // the WithAttributes) option to include measurement attributes. + Record(ctx context.Context, incr int64, options ...RecordOption) +} + +// Int64HistogramConfig contains options for synchronous counter instruments +// that record int64 values. +type Int64HistogramConfig struct { + description string + unit string + explicitBucketBoundaries []float64 +} + +// NewInt64HistogramConfig returns a new [Int64HistogramConfig] with all opts +// applied. +func NewInt64HistogramConfig(opts ...Int64HistogramOption) Int64HistogramConfig { + var config Int64HistogramConfig + for _, o := range opts { + config = o.applyInt64Histogram(config) + } + return config +} + +// Description returns the configured description. +func (c Int64HistogramConfig) Description() string { + return c.description +} + +// Unit returns the configured unit. +func (c Int64HistogramConfig) Unit() string { + return c.unit +} + +// ExplicitBucketBoundaries returns the configured explicit bucket boundaries. +func (c Int64HistogramConfig) ExplicitBucketBoundaries() []float64 { + return c.explicitBucketBoundaries +} + +// Int64HistogramOption applies options to a [Int64HistogramConfig]. See +// [InstrumentOption] for other options that can be used as an +// Int64HistogramOption. +type Int64HistogramOption interface { + applyInt64Histogram(Int64HistogramConfig) Int64HistogramConfig +} diff --git a/vendor/go.opentelemetry.io/otel/propagation.go b/vendor/go.opentelemetry.io/otel/propagation.go new file mode 100644 index 0000000000..d29aaa32c0 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation.go @@ -0,0 +1,31 @@ +// Copyright The OpenTelemetry 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 otel // import "go.opentelemetry.io/otel" + +import ( + "go.opentelemetry.io/otel/internal/global" + "go.opentelemetry.io/otel/propagation" +) + +// GetTextMapPropagator returns the global TextMapPropagator. If none has been +// set, a No-Op TextMapPropagator is returned. +func GetTextMapPropagator() propagation.TextMapPropagator { + return global.TextMapPropagator() +} + +// SetTextMapPropagator sets propagator as the global TextMapPropagator. +func SetTextMapPropagator(propagator propagation.TextMapPropagator) { + global.SetTextMapPropagator(propagator) +} diff --git a/vendor/go.opentelemetry.io/otel/propagation/baggage.go b/vendor/go.opentelemetry.io/otel/propagation/baggage.go new file mode 100644 index 0000000000..303cdf1cbf --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation/baggage.go @@ -0,0 +1,58 @@ +// Copyright The OpenTelemetry 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 propagation // import "go.opentelemetry.io/otel/propagation" + +import ( + "context" + + "go.opentelemetry.io/otel/baggage" +) + +const baggageHeader = "baggage" + +// Baggage is a propagator that supports the W3C Baggage format. +// +// This propagates user-defined baggage associated with a trace. The complete +// specification is defined at https://www.w3.org/TR/baggage/. +type Baggage struct{} + +var _ TextMapPropagator = Baggage{} + +// Inject sets baggage key-values from ctx into the carrier. +func (b Baggage) Inject(ctx context.Context, carrier TextMapCarrier) { + bStr := baggage.FromContext(ctx).String() + if bStr != "" { + carrier.Set(baggageHeader, bStr) + } +} + +// Extract returns a copy of parent with the baggage from the carrier added. +func (b Baggage) Extract(parent context.Context, carrier TextMapCarrier) context.Context { + bStr := carrier.Get(baggageHeader) + if bStr == "" { + return parent + } + + bag, err := baggage.Parse(bStr) + if err != nil { + return parent + } + return baggage.ContextWithBaggage(parent, bag) +} + +// Fields returns the keys who's values are set with Inject. +func (b Baggage) Fields() []string { + return []string{baggageHeader} +} diff --git a/vendor/go.opentelemetry.io/otel/propagation/doc.go b/vendor/go.opentelemetry.io/otel/propagation/doc.go new file mode 100644 index 0000000000..c119eb2858 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation/doc.go @@ -0,0 +1,24 @@ +// Copyright The OpenTelemetry 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 propagation contains OpenTelemetry context propagators. + +OpenTelemetry propagators are used to extract and inject context data from and +into messages exchanged by applications. The propagator supported by this +package is the W3C Trace Context encoding +(https://www.w3.org/TR/trace-context/), and W3C Baggage +(https://www.w3.org/TR/baggage/). +*/ +package propagation // import "go.opentelemetry.io/otel/propagation" diff --git a/vendor/go.opentelemetry.io/otel/propagation/propagation.go b/vendor/go.opentelemetry.io/otel/propagation/propagation.go new file mode 100644 index 0000000000..c94438f73a --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation/propagation.go @@ -0,0 +1,153 @@ +// Copyright The OpenTelemetry 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 propagation // import "go.opentelemetry.io/otel/propagation" + +import ( + "context" + "net/http" +) + +// TextMapCarrier is the storage medium used by a TextMapPropagator. +type TextMapCarrier interface { + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Get returns the value associated with the passed key. + Get(key string) string + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Set stores the key-value pair. + Set(key string, value string) + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Keys lists the keys stored in this carrier. + Keys() []string + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. +} + +// MapCarrier is a TextMapCarrier that uses a map held in memory as a storage +// medium for propagated key-value pairs. +type MapCarrier map[string]string + +// Compile time check that MapCarrier implements the TextMapCarrier. +var _ TextMapCarrier = MapCarrier{} + +// Get returns the value associated with the passed key. +func (c MapCarrier) Get(key string) string { + return c[key] +} + +// Set stores the key-value pair. +func (c MapCarrier) Set(key, value string) { + c[key] = value +} + +// Keys lists the keys stored in this carrier. +func (c MapCarrier) Keys() []string { + keys := make([]string, 0, len(c)) + for k := range c { + keys = append(keys, k) + } + return keys +} + +// HeaderCarrier adapts http.Header to satisfy the TextMapCarrier interface. +type HeaderCarrier http.Header + +// Get returns the value associated with the passed key. +func (hc HeaderCarrier) Get(key string) string { + return http.Header(hc).Get(key) +} + +// Set stores the key-value pair. +func (hc HeaderCarrier) Set(key string, value string) { + http.Header(hc).Set(key, value) +} + +// Keys lists the keys stored in this carrier. +func (hc HeaderCarrier) Keys() []string { + keys := make([]string, 0, len(hc)) + for k := range hc { + keys = append(keys, k) + } + return keys +} + +// TextMapPropagator propagates cross-cutting concerns as key-value text +// pairs within a carrier that travels in-band across process boundaries. +type TextMapPropagator interface { + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Inject set cross-cutting concerns from the Context into the carrier. + Inject(ctx context.Context, carrier TextMapCarrier) + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Extract reads cross-cutting concerns from the carrier into a Context. + Extract(ctx context.Context, carrier TextMapCarrier) context.Context + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. + + // Fields returns the keys whose values are set with Inject. + Fields() []string + // DO NOT CHANGE: any modification will not be backwards compatible and + // must never be done outside of a new major release. +} + +type compositeTextMapPropagator []TextMapPropagator + +func (p compositeTextMapPropagator) Inject(ctx context.Context, carrier TextMapCarrier) { + for _, i := range p { + i.Inject(ctx, carrier) + } +} + +func (p compositeTextMapPropagator) Extract(ctx context.Context, carrier TextMapCarrier) context.Context { + for _, i := range p { + ctx = i.Extract(ctx, carrier) + } + return ctx +} + +func (p compositeTextMapPropagator) Fields() []string { + unique := make(map[string]struct{}) + for _, i := range p { + for _, k := range i.Fields() { + unique[k] = struct{}{} + } + } + + fields := make([]string, 0, len(unique)) + for k := range unique { + fields = append(fields, k) + } + return fields +} + +// NewCompositeTextMapPropagator returns a unified TextMapPropagator from the +// group of passed TextMapPropagator. This allows different cross-cutting +// concerns to be propagates in a unified manner. +// +// The returned TextMapPropagator will inject and extract cross-cutting +// concerns in the order the TextMapPropagators were provided. Additionally, +// the Fields method will return a de-duplicated slice of the keys that are +// set with the Inject method. +func NewCompositeTextMapPropagator(p ...TextMapPropagator) TextMapPropagator { + return compositeTextMapPropagator(p) +} diff --git a/vendor/go.opentelemetry.io/otel/propagation/trace_context.go b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go new file mode 100644 index 0000000000..63e5d62221 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go @@ -0,0 +1,167 @@ +// Copyright The OpenTelemetry 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 propagation // import "go.opentelemetry.io/otel/propagation" + +import ( + "context" + "encoding/hex" + "fmt" + "strings" + + "go.opentelemetry.io/otel/trace" +) + +const ( + supportedVersion = 0 + maxVersion = 254 + traceparentHeader = "traceparent" + tracestateHeader = "tracestate" + delimiter = "-" +) + +// TraceContext is a propagator that supports the W3C Trace Context format +// (https://www.w3.org/TR/trace-context/) +// +// This propagator will propagate the traceparent and tracestate headers to +// guarantee traces are not broken. It is up to the users of this propagator +// to choose if they want to participate in a trace by modifying the +// traceparent header and relevant parts of the tracestate header containing +// their proprietary information. +type TraceContext struct{} + +var ( + _ TextMapPropagator = TraceContext{} + versionPart = fmt.Sprintf("%.2X", supportedVersion) +) + +// Inject set tracecontext from the Context into the carrier. +func (tc TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) { + sc := trace.SpanContextFromContext(ctx) + if !sc.IsValid() { + return + } + + if ts := sc.TraceState().String(); ts != "" { + carrier.Set(tracestateHeader, ts) + } + + // Clear all flags other than the trace-context supported sampling bit. + flags := sc.TraceFlags() & trace.FlagsSampled + + var sb strings.Builder + sb.Grow(2 + 32 + 16 + 2 + 3) + _, _ = sb.WriteString(versionPart) + traceID := sc.TraceID() + spanID := sc.SpanID() + flagByte := [1]byte{byte(flags)} + var buf [32]byte + for _, src := range [][]byte{traceID[:], spanID[:], flagByte[:]} { + _ = sb.WriteByte(delimiter[0]) + n := hex.Encode(buf[:], src) + _, _ = sb.Write(buf[:n]) + } + carrier.Set(traceparentHeader, sb.String()) +} + +// Extract reads tracecontext from the carrier into a returned Context. +// +// The returned Context will be a copy of ctx and contain the extracted +// tracecontext as the remote SpanContext. If the extracted tracecontext is +// invalid, the passed ctx will be returned directly instead. +func (tc TraceContext) Extract(ctx context.Context, carrier TextMapCarrier) context.Context { + sc := tc.extract(carrier) + if !sc.IsValid() { + return ctx + } + return trace.ContextWithRemoteSpanContext(ctx, sc) +} + +func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext { + h := carrier.Get(traceparentHeader) + if h == "" { + return trace.SpanContext{} + } + + var ver [1]byte + if !extractPart(ver[:], &h, 2) { + return trace.SpanContext{} + } + version := int(ver[0]) + if version > maxVersion { + return trace.SpanContext{} + } + + var scc trace.SpanContextConfig + if !extractPart(scc.TraceID[:], &h, 32) { + return trace.SpanContext{} + } + if !extractPart(scc.SpanID[:], &h, 16) { + return trace.SpanContext{} + } + + var opts [1]byte + if !extractPart(opts[:], &h, 2) { + return trace.SpanContext{} + } + if version == 0 && (h != "" || opts[0] > 2) { + // version 0 not allow extra + // version 0 not allow other flag + return trace.SpanContext{} + } + + // Clear all flags other than the trace-context supported sampling bit. + scc.TraceFlags = trace.TraceFlags(opts[0]) & trace.FlagsSampled + + // Ignore the error returned here. Failure to parse tracestate MUST NOT + // affect the parsing of traceparent according to the W3C tracecontext + // specification. + scc.TraceState, _ = trace.ParseTraceState(carrier.Get(tracestateHeader)) + scc.Remote = true + + sc := trace.NewSpanContext(scc) + if !sc.IsValid() { + return trace.SpanContext{} + } + + return sc +} + +// upperHex detect hex is upper case Unicode characters. +func upperHex(v string) bool { + for _, c := range v { + if c >= 'A' && c <= 'F' { + return true + } + } + return false +} + +func extractPart(dst []byte, h *string, n int) bool { + part, left, _ := strings.Cut(*h, delimiter) + *h = left + // hex.Decode decodes unsupported upper-case characters, so exclude explicitly. + if len(part) != n || upperHex(part) { + return false + } + if p, err := hex.Decode(dst, []byte(part)); err != nil || p != n/2 { + return false + } + return true +} + +// Fields returns the keys who's values are set with Inject. +func (tc TraceContext) Fields() []string { + return []string{traceparentHeader, tracestateHeader} +} diff --git a/vendor/go.opentelemetry.io/otel/requirements.txt b/vendor/go.opentelemetry.io/otel/requirements.txt new file mode 100644 index 0000000000..e0a43e1384 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/requirements.txt @@ -0,0 +1 @@ +codespell==2.2.6 diff --git a/vendor/go.opentelemetry.io/otel/semconv/internal/v2/http.go b/vendor/go.opentelemetry.io/otel/semconv/internal/v2/http.go new file mode 100644 index 0000000000..12d6b520f5 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/internal/v2/http.go @@ -0,0 +1,404 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal // import "go.opentelemetry.io/otel/semconv/internal/v2" + +import ( + "fmt" + "net/http" + "strings" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" +) + +// HTTPConv are the HTTP semantic convention attributes defined for a version +// of the OpenTelemetry specification. +type HTTPConv struct { + NetConv *NetConv + + EnduserIDKey attribute.Key + HTTPClientIPKey attribute.Key + HTTPFlavorKey attribute.Key + HTTPMethodKey attribute.Key + HTTPRequestContentLengthKey attribute.Key + HTTPResponseContentLengthKey attribute.Key + HTTPRouteKey attribute.Key + HTTPSchemeHTTP attribute.KeyValue + HTTPSchemeHTTPS attribute.KeyValue + HTTPStatusCodeKey attribute.Key + HTTPTargetKey attribute.Key + HTTPURLKey attribute.Key + HTTPUserAgentKey attribute.Key +} + +// ClientResponse returns attributes for an HTTP response received by a client +// from a server. The following attributes are returned if the related values +// are defined in resp: "http.status.code", "http.response_content_length". +// +// This does not add all OpenTelemetry required attributes for an HTTP event, +// it assumes ClientRequest was used to create the span with a complete set of +// attributes. If a complete set of attributes can be generated using the +// request contained in resp. For example: +// +// append(ClientResponse(resp), ClientRequest(resp.Request)...) +func (c *HTTPConv) ClientResponse(resp *http.Response) []attribute.KeyValue { + var n int + if resp.StatusCode > 0 { + n++ + } + if resp.ContentLength > 0 { + n++ + } + + attrs := make([]attribute.KeyValue, 0, n) + if resp.StatusCode > 0 { + attrs = append(attrs, c.HTTPStatusCodeKey.Int(resp.StatusCode)) + } + if resp.ContentLength > 0 { + attrs = append(attrs, c.HTTPResponseContentLengthKey.Int(int(resp.ContentLength))) + } + return attrs +} + +// ClientRequest returns attributes for an HTTP request made by a client. The +// following attributes are always returned: "http.url", "http.flavor", +// "http.method", "net.peer.name". The following attributes are returned if the +// related values are defined in req: "net.peer.port", "http.user_agent", +// "http.request_content_length", "enduser.id". +func (c *HTTPConv) ClientRequest(req *http.Request) []attribute.KeyValue { + n := 3 // URL, peer name, proto, and method. + var h string + if req.URL != nil { + h = req.URL.Host + } + peer, p := firstHostPort(h, req.Header.Get("Host")) + port := requiredHTTPPort(req.URL != nil && req.URL.Scheme == "https", p) + if port > 0 { + n++ + } + useragent := req.UserAgent() + if useragent != "" { + n++ + } + if req.ContentLength > 0 { + n++ + } + userID, _, hasUserID := req.BasicAuth() + if hasUserID { + n++ + } + attrs := make([]attribute.KeyValue, 0, n) + + attrs = append(attrs, c.method(req.Method)) + attrs = append(attrs, c.proto(req.Proto)) + + var u string + if req.URL != nil { + // Remove any username/password info that may be in the URL. + userinfo := req.URL.User + req.URL.User = nil + u = req.URL.String() + // Restore any username/password info that was removed. + req.URL.User = userinfo + } + attrs = append(attrs, c.HTTPURLKey.String(u)) + + attrs = append(attrs, c.NetConv.PeerName(peer)) + if port > 0 { + attrs = append(attrs, c.NetConv.PeerPort(port)) + } + + if useragent != "" { + attrs = append(attrs, c.HTTPUserAgentKey.String(useragent)) + } + + if l := req.ContentLength; l > 0 { + attrs = append(attrs, c.HTTPRequestContentLengthKey.Int64(l)) + } + + if hasUserID { + attrs = append(attrs, c.EnduserIDKey.String(userID)) + } + + return attrs +} + +// ServerRequest returns attributes for an HTTP request received by a server. +// +// The server must be the primary server name if it is known. For example this +// would be the ServerName directive +// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache +// server, and the server_name directive +// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an +// nginx server. More generically, the primary server name would be the host +// header value that matches the default virtual host of an HTTP server. It +// should include the host identifier and if a port is used to route to the +// server that port identifier should be included as an appropriate port +// suffix. +// +// If the primary server name is not known, server should be an empty string. +// The req Host will be used to determine the server instead. +// +// The following attributes are always returned: "http.method", "http.scheme", +// "http.flavor", "http.target", "net.host.name". The following attributes are +// returned if they related values are defined in req: "net.host.port", +// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id", +// "http.client_ip". +func (c *HTTPConv) ServerRequest(server string, req *http.Request) []attribute.KeyValue { + // TODO: This currently does not add the specification required + // `http.target` attribute. It has too high of a cardinality to safely be + // added. An alternate should be added, or this comment removed, when it is + // addressed by the specification. If it is ultimately decided to continue + // not including the attribute, the HTTPTargetKey field of the HTTPConv + // should be removed as well. + + n := 4 // Method, scheme, proto, and host name. + var host string + var p int + if server == "" { + host, p = splitHostPort(req.Host) + } else { + // Prioritize the primary server name. + host, p = splitHostPort(server) + if p < 0 { + _, p = splitHostPort(req.Host) + } + } + hostPort := requiredHTTPPort(req.TLS != nil, p) + if hostPort > 0 { + n++ + } + peer, peerPort := splitHostPort(req.RemoteAddr) + if peer != "" { + n++ + if peerPort > 0 { + n++ + } + } + useragent := req.UserAgent() + if useragent != "" { + n++ + } + userID, _, hasUserID := req.BasicAuth() + if hasUserID { + n++ + } + clientIP := serverClientIP(req.Header.Get("X-Forwarded-For")) + if clientIP != "" { + n++ + } + attrs := make([]attribute.KeyValue, 0, n) + + attrs = append(attrs, c.method(req.Method)) + attrs = append(attrs, c.scheme(req.TLS != nil)) + attrs = append(attrs, c.proto(req.Proto)) + attrs = append(attrs, c.NetConv.HostName(host)) + + if hostPort > 0 { + attrs = append(attrs, c.NetConv.HostPort(hostPort)) + } + + if peer != "" { + // The Go HTTP server sets RemoteAddr to "IP:port", this will not be a + // file-path that would be interpreted with a sock family. + attrs = append(attrs, c.NetConv.SockPeerAddr(peer)) + if peerPort > 0 { + attrs = append(attrs, c.NetConv.SockPeerPort(peerPort)) + } + } + + if useragent != "" { + attrs = append(attrs, c.HTTPUserAgentKey.String(useragent)) + } + + if hasUserID { + attrs = append(attrs, c.EnduserIDKey.String(userID)) + } + + if clientIP != "" { + attrs = append(attrs, c.HTTPClientIPKey.String(clientIP)) + } + + return attrs +} + +func (c *HTTPConv) method(method string) attribute.KeyValue { + if method == "" { + return c.HTTPMethodKey.String(http.MethodGet) + } + return c.HTTPMethodKey.String(method) +} + +func (c *HTTPConv) scheme(https bool) attribute.KeyValue { // nolint:revive + if https { + return c.HTTPSchemeHTTPS + } + return c.HTTPSchemeHTTP +} + +func (c *HTTPConv) proto(proto string) attribute.KeyValue { + switch proto { + case "HTTP/1.0": + return c.HTTPFlavorKey.String("1.0") + case "HTTP/1.1": + return c.HTTPFlavorKey.String("1.1") + case "HTTP/2": + return c.HTTPFlavorKey.String("2.0") + case "HTTP/3": + return c.HTTPFlavorKey.String("3.0") + default: + return c.HTTPFlavorKey.String(proto) + } +} + +func serverClientIP(xForwardedFor string) string { + if idx := strings.Index(xForwardedFor, ","); idx >= 0 { + xForwardedFor = xForwardedFor[:idx] + } + return xForwardedFor +} + +func requiredHTTPPort(https bool, port int) int { // nolint:revive + if https { + if port > 0 && port != 443 { + return port + } + } else { + if port > 0 && port != 80 { + return port + } + } + return -1 +} + +// Return the request host and port from the first non-empty source. +func firstHostPort(source ...string) (host string, port int) { + for _, hostport := range source { + host, port = splitHostPort(hostport) + if host != "" || port > 0 { + break + } + } + return +} + +// RequestHeader returns the contents of h as OpenTelemetry attributes. +func (c *HTTPConv) RequestHeader(h http.Header) []attribute.KeyValue { + return c.header("http.request.header", h) +} + +// ResponseHeader returns the contents of h as OpenTelemetry attributes. +func (c *HTTPConv) ResponseHeader(h http.Header) []attribute.KeyValue { + return c.header("http.response.header", h) +} + +func (c *HTTPConv) header(prefix string, h http.Header) []attribute.KeyValue { + key := func(k string) attribute.Key { + k = strings.ToLower(k) + k = strings.ReplaceAll(k, "-", "_") + k = fmt.Sprintf("%s.%s", prefix, k) + return attribute.Key(k) + } + + attrs := make([]attribute.KeyValue, 0, len(h)) + for k, v := range h { + attrs = append(attrs, key(k).StringSlice(v)) + } + return attrs +} + +// ClientStatus returns a span status code and message for an HTTP status code +// value received by a client. +func (c *HTTPConv) ClientStatus(code int) (codes.Code, string) { + stat, valid := validateHTTPStatusCode(code) + if !valid { + return stat, fmt.Sprintf("Invalid HTTP status code %d", code) + } + return stat, "" +} + +// ServerStatus returns a span status code and message for an HTTP status code +// value returned by a server. Status codes in the 400-499 range are not +// returned as errors. +func (c *HTTPConv) ServerStatus(code int) (codes.Code, string) { + stat, valid := validateHTTPStatusCode(code) + if !valid { + return stat, fmt.Sprintf("Invalid HTTP status code %d", code) + } + + if code/100 == 4 { + return codes.Unset, "" + } + return stat, "" +} + +type codeRange struct { + fromInclusive int + toInclusive int +} + +func (r codeRange) contains(code int) bool { + return r.fromInclusive <= code && code <= r.toInclusive +} + +var validRangesPerCategory = map[int][]codeRange{ + 1: { + {http.StatusContinue, http.StatusEarlyHints}, + }, + 2: { + {http.StatusOK, http.StatusAlreadyReported}, + {http.StatusIMUsed, http.StatusIMUsed}, + }, + 3: { + {http.StatusMultipleChoices, http.StatusUseProxy}, + {http.StatusTemporaryRedirect, http.StatusPermanentRedirect}, + }, + 4: { + {http.StatusBadRequest, http.StatusTeapot}, // yes, teapot is so useful… + {http.StatusMisdirectedRequest, http.StatusUpgradeRequired}, + {http.StatusPreconditionRequired, http.StatusTooManyRequests}, + {http.StatusRequestHeaderFieldsTooLarge, http.StatusRequestHeaderFieldsTooLarge}, + {http.StatusUnavailableForLegalReasons, http.StatusUnavailableForLegalReasons}, + }, + 5: { + {http.StatusInternalServerError, http.StatusLoopDetected}, + {http.StatusNotExtended, http.StatusNetworkAuthenticationRequired}, + }, +} + +// validateHTTPStatusCode validates the HTTP status code and returns +// corresponding span status code. If the `code` is not a valid HTTP status +// code, returns span status Error and false. +func validateHTTPStatusCode(code int) (codes.Code, bool) { + category := code / 100 + ranges, ok := validRangesPerCategory[category] + if !ok { + return codes.Error, false + } + ok = false + for _, crange := range ranges { + ok = crange.contains(code) + if ok { + break + } + } + if !ok { + return codes.Error, false + } + if category > 0 && category < 4 { + return codes.Unset, true + } + return codes.Error, true +} diff --git a/vendor/go.opentelemetry.io/otel/semconv/internal/v2/net.go b/vendor/go.opentelemetry.io/otel/semconv/internal/v2/net.go new file mode 100644 index 0000000000..4a711133a0 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/internal/v2/net.go @@ -0,0 +1,324 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal // import "go.opentelemetry.io/otel/semconv/internal/v2" + +import ( + "net" + "strconv" + "strings" + + "go.opentelemetry.io/otel/attribute" +) + +// NetConv are the network semantic convention attributes defined for a version +// of the OpenTelemetry specification. +type NetConv struct { + NetHostNameKey attribute.Key + NetHostPortKey attribute.Key + NetPeerNameKey attribute.Key + NetPeerPortKey attribute.Key + NetSockFamilyKey attribute.Key + NetSockPeerAddrKey attribute.Key + NetSockPeerPortKey attribute.Key + NetSockHostAddrKey attribute.Key + NetSockHostPortKey attribute.Key + NetTransportOther attribute.KeyValue + NetTransportTCP attribute.KeyValue + NetTransportUDP attribute.KeyValue + NetTransportInProc attribute.KeyValue +} + +func (c *NetConv) Transport(network string) attribute.KeyValue { + switch network { + case "tcp", "tcp4", "tcp6": + return c.NetTransportTCP + case "udp", "udp4", "udp6": + return c.NetTransportUDP + case "unix", "unixgram", "unixpacket": + return c.NetTransportInProc + default: + // "ip:*", "ip4:*", and "ip6:*" all are considered other. + return c.NetTransportOther + } +} + +// Host returns attributes for a network host address. +func (c *NetConv) Host(address string) []attribute.KeyValue { + h, p := splitHostPort(address) + var n int + if h != "" { + n++ + if p > 0 { + n++ + } + } + + if n == 0 { + return nil + } + + attrs := make([]attribute.KeyValue, 0, n) + attrs = append(attrs, c.HostName(h)) + if p > 0 { + attrs = append(attrs, c.HostPort(int(p))) + } + return attrs +} + +// Server returns attributes for a network listener listening at address. See +// net.Listen for information about acceptable address values, address should +// be the same as the one used to create ln. If ln is nil, only network host +// attributes will be returned that describe address. Otherwise, the socket +// level information about ln will also be included. +func (c *NetConv) Server(address string, ln net.Listener) []attribute.KeyValue { + if ln == nil { + return c.Host(address) + } + + lAddr := ln.Addr() + if lAddr == nil { + return c.Host(address) + } + + hostName, hostPort := splitHostPort(address) + sockHostAddr, sockHostPort := splitHostPort(lAddr.String()) + network := lAddr.Network() + sockFamily := family(network, sockHostAddr) + + n := nonZeroStr(hostName, network, sockHostAddr, sockFamily) + n += positiveInt(hostPort, sockHostPort) + attr := make([]attribute.KeyValue, 0, n) + if hostName != "" { + attr = append(attr, c.HostName(hostName)) + if hostPort > 0 { + // Only if net.host.name is set should net.host.port be. + attr = append(attr, c.HostPort(hostPort)) + } + } + if network != "" { + attr = append(attr, c.Transport(network)) + } + if sockFamily != "" { + attr = append(attr, c.NetSockFamilyKey.String(sockFamily)) + } + if sockHostAddr != "" { + attr = append(attr, c.NetSockHostAddrKey.String(sockHostAddr)) + if sockHostPort > 0 { + // Only if net.sock.host.addr is set should net.sock.host.port be. + attr = append(attr, c.NetSockHostPortKey.Int(sockHostPort)) + } + } + return attr +} + +func (c *NetConv) HostName(name string) attribute.KeyValue { + return c.NetHostNameKey.String(name) +} + +func (c *NetConv) HostPort(port int) attribute.KeyValue { + return c.NetHostPortKey.Int(port) +} + +// Client returns attributes for a client network connection to address. See +// net.Dial for information about acceptable address values, address should be +// the same as the one used to create conn. If conn is nil, only network peer +// attributes will be returned that describe address. Otherwise, the socket +// level information about conn will also be included. +func (c *NetConv) Client(address string, conn net.Conn) []attribute.KeyValue { + if conn == nil { + return c.Peer(address) + } + + lAddr, rAddr := conn.LocalAddr(), conn.RemoteAddr() + + var network string + switch { + case lAddr != nil: + network = lAddr.Network() + case rAddr != nil: + network = rAddr.Network() + default: + return c.Peer(address) + } + + peerName, peerPort := splitHostPort(address) + var ( + sockFamily string + sockPeerAddr string + sockPeerPort int + sockHostAddr string + sockHostPort int + ) + + if lAddr != nil { + sockHostAddr, sockHostPort = splitHostPort(lAddr.String()) + } + + if rAddr != nil { + sockPeerAddr, sockPeerPort = splitHostPort(rAddr.String()) + } + + switch { + case sockHostAddr != "": + sockFamily = family(network, sockHostAddr) + case sockPeerAddr != "": + sockFamily = family(network, sockPeerAddr) + } + + n := nonZeroStr(peerName, network, sockPeerAddr, sockHostAddr, sockFamily) + n += positiveInt(peerPort, sockPeerPort, sockHostPort) + attr := make([]attribute.KeyValue, 0, n) + if peerName != "" { + attr = append(attr, c.PeerName(peerName)) + if peerPort > 0 { + // Only if net.peer.name is set should net.peer.port be. + attr = append(attr, c.PeerPort(peerPort)) + } + } + if network != "" { + attr = append(attr, c.Transport(network)) + } + if sockFamily != "" { + attr = append(attr, c.NetSockFamilyKey.String(sockFamily)) + } + if sockPeerAddr != "" { + attr = append(attr, c.NetSockPeerAddrKey.String(sockPeerAddr)) + if sockPeerPort > 0 { + // Only if net.sock.peer.addr is set should net.sock.peer.port be. + attr = append(attr, c.NetSockPeerPortKey.Int(sockPeerPort)) + } + } + if sockHostAddr != "" { + attr = append(attr, c.NetSockHostAddrKey.String(sockHostAddr)) + if sockHostPort > 0 { + // Only if net.sock.host.addr is set should net.sock.host.port be. + attr = append(attr, c.NetSockHostPortKey.Int(sockHostPort)) + } + } + return attr +} + +func family(network, address string) string { + switch network { + case "unix", "unixgram", "unixpacket": + return "unix" + default: + if ip := net.ParseIP(address); ip != nil { + if ip.To4() == nil { + return "inet6" + } + return "inet" + } + } + return "" +} + +func nonZeroStr(strs ...string) int { + var n int + for _, str := range strs { + if str != "" { + n++ + } + } + return n +} + +func positiveInt(ints ...int) int { + var n int + for _, i := range ints { + if i > 0 { + n++ + } + } + return n +} + +// Peer returns attributes for a network peer address. +func (c *NetConv) Peer(address string) []attribute.KeyValue { + h, p := splitHostPort(address) + var n int + if h != "" { + n++ + if p > 0 { + n++ + } + } + + if n == 0 { + return nil + } + + attrs := make([]attribute.KeyValue, 0, n) + attrs = append(attrs, c.PeerName(h)) + if p > 0 { + attrs = append(attrs, c.PeerPort(int(p))) + } + return attrs +} + +func (c *NetConv) PeerName(name string) attribute.KeyValue { + return c.NetPeerNameKey.String(name) +} + +func (c *NetConv) PeerPort(port int) attribute.KeyValue { + return c.NetPeerPortKey.Int(port) +} + +func (c *NetConv) SockPeerAddr(addr string) attribute.KeyValue { + return c.NetSockPeerAddrKey.String(addr) +} + +func (c *NetConv) SockPeerPort(port int) attribute.KeyValue { + return c.NetSockPeerPortKey.Int(port) +} + +// splitHostPort splits a network address hostport of the form "host", +// "host%zone", "[host]", "[host%zone], "host:port", "host%zone:port", +// "[host]:port", "[host%zone]:port", or ":port" into host or host%zone and +// port. +// +// An empty host is returned if it is not provided or unparsable. A negative +// port is returned if it is not provided or unparsable. +func splitHostPort(hostport string) (host string, port int) { + port = -1 + + if strings.HasPrefix(hostport, "[") { + addrEnd := strings.LastIndex(hostport, "]") + if addrEnd < 0 { + // Invalid hostport. + return + } + if i := strings.LastIndex(hostport[addrEnd:], ":"); i < 0 { + host = hostport[1:addrEnd] + return + } + } else { + if i := strings.LastIndex(hostport, ":"); i < 0 { + host = hostport + return + } + } + + host, pStr, err := net.SplitHostPort(hostport) + if err != nil { + return + } + + p, err := strconv.ParseUint(pStr, 10, 16) + if err != nil { + return + } + return host, int(p) +} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go new file mode 100644 index 0000000000..71a1f7748d --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry 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 semconv implements OpenTelemetry semantic conventions. +// +// OpenTelemetry semantic conventions are agreed standardized naming +// patterns for OpenTelemetry things. This package represents the conventions +// as of the v1.17.0 version of the OpenTelemetry specification. +package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0" diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go new file mode 100644 index 0000000000..679c40c4de --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go @@ -0,0 +1,199 @@ +// Copyright The OpenTelemetry 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 from semantic convention specification. DO NOT EDIT. + +package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0" + +import "go.opentelemetry.io/otel/attribute" + +// This semantic convention defines the attributes used to represent a feature +// flag evaluation as an event. +const ( + // FeatureFlagKeyKey is the attribute Key conforming to the + // "feature_flag.key" semantic conventions. It represents the unique + // identifier of the feature flag. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'logo-color' + FeatureFlagKeyKey = attribute.Key("feature_flag.key") + + // FeatureFlagProviderNameKey is the attribute Key conforming to the + // "feature_flag.provider_name" semantic conventions. It represents the + // name of the service provider that performs the flag evaluation. + // + // Type: string + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'Flag Manager' + FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider_name") + + // FeatureFlagVariantKey is the attribute Key conforming to the + // "feature_flag.variant" semantic conventions. It represents the sHOULD be + // a semantic identifier for a value. If one is unavailable, a stringified + // version of the value can be used. + // + // Type: string + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'red', 'true', 'on' + // Note: A semantic identifier, commonly referred to as a variant, provides + // a means + // for referring to a value without including the value itself. This can + // provide additional context for understanding the meaning behind a value. + // For example, the variant `red` maybe be used for the value `#c05543`. + // + // A stringified version of the value can be used in situations where a + // semantic identifier is unavailable. String representation of the value + // should be determined by the implementer. + FeatureFlagVariantKey = attribute.Key("feature_flag.variant") +) + +// FeatureFlagKey returns an attribute KeyValue conforming to the +// "feature_flag.key" semantic conventions. It represents the unique identifier +// of the feature flag. +func FeatureFlagKey(val string) attribute.KeyValue { + return FeatureFlagKeyKey.String(val) +} + +// FeatureFlagProviderName returns an attribute KeyValue conforming to the +// "feature_flag.provider_name" semantic conventions. It represents the name of +// the service provider that performs the flag evaluation. +func FeatureFlagProviderName(val string) attribute.KeyValue { + return FeatureFlagProviderNameKey.String(val) +} + +// FeatureFlagVariant returns an attribute KeyValue conforming to the +// "feature_flag.variant" semantic conventions. It represents the sHOULD be a +// semantic identifier for a value. If one is unavailable, a stringified +// version of the value can be used. +func FeatureFlagVariant(val string) attribute.KeyValue { + return FeatureFlagVariantKey.String(val) +} + +// RPC received/sent message. +const ( + // MessageTypeKey is the attribute Key conforming to the "message.type" + // semantic conventions. It represents the whether this is a received or + // sent message. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + MessageTypeKey = attribute.Key("message.type") + + // MessageIDKey is the attribute Key conforming to the "message.id" + // semantic conventions. It represents the mUST be calculated as two + // different counters starting from `1` one for sent messages and one for + // received message. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Note: This way we guarantee that the values will be consistent between + // different implementations. + MessageIDKey = attribute.Key("message.id") + + // MessageCompressedSizeKey is the attribute Key conforming to the + // "message.compressed_size" semantic conventions. It represents the + // compressed size of the message in bytes. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + MessageCompressedSizeKey = attribute.Key("message.compressed_size") + + // MessageUncompressedSizeKey is the attribute Key conforming to the + // "message.uncompressed_size" semantic conventions. It represents the + // uncompressed size of the message in bytes. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + MessageUncompressedSizeKey = attribute.Key("message.uncompressed_size") +) + +var ( + // sent + MessageTypeSent = MessageTypeKey.String("SENT") + // received + MessageTypeReceived = MessageTypeKey.String("RECEIVED") +) + +// MessageID returns an attribute KeyValue conforming to the "message.id" +// semantic conventions. It represents the mUST be calculated as two different +// counters starting from `1` one for sent messages and one for received +// message. +func MessageID(val int) attribute.KeyValue { + return MessageIDKey.Int(val) +} + +// MessageCompressedSize returns an attribute KeyValue conforming to the +// "message.compressed_size" semantic conventions. It represents the compressed +// size of the message in bytes. +func MessageCompressedSize(val int) attribute.KeyValue { + return MessageCompressedSizeKey.Int(val) +} + +// MessageUncompressedSize returns an attribute KeyValue conforming to the +// "message.uncompressed_size" semantic conventions. It represents the +// uncompressed size of the message in bytes. +func MessageUncompressedSize(val int) attribute.KeyValue { + return MessageUncompressedSizeKey.Int(val) +} + +// The attributes used to report a single exception associated with a span. +const ( + // ExceptionEscapedKey is the attribute Key conforming to the + // "exception.escaped" semantic conventions. It represents the sHOULD be + // set to true if the exception event is recorded at a point where it is + // known that the exception is escaping the scope of the span. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + // Note: An exception is considered to have escaped (or left) the scope of + // a span, + // if that span is ended while the exception is still logically "in + // flight". + // This may be actually "in flight" in some languages (e.g. if the + // exception + // is passed to a Context manager's `__exit__` method in Python) but will + // usually be caught at the point of recording the exception in most + // languages. + // + // It is usually not possible to determine at the point where an exception + // is thrown + // whether it will escape the scope of a span. + // However, it is trivial to know that an exception + // will escape, if one checks for an active exception just before ending + // the span, + // as done in the [example above](#recording-an-exception). + // + // It follows that an exception may still escape the scope of the span + // even if the `exception.escaped` attribute was not set or set to false, + // since the event might have been recorded at a time where it was not + // clear whether the exception will escape. + ExceptionEscapedKey = attribute.Key("exception.escaped") +) + +// ExceptionEscaped returns an attribute KeyValue conforming to the +// "exception.escaped" semantic conventions. It represents the sHOULD be set to +// true if the exception event is recorded at a point where it is known that +// the exception is escaping the scope of the span. +func ExceptionEscaped(val bool) attribute.KeyValue { + return ExceptionEscapedKey.Bool(val) +} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go new file mode 100644 index 0000000000..9b8c559de4 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry 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 semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0" + +const ( + // ExceptionEventName is the name of the Span event representing an exception. + ExceptionEventName = "exception" +) diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go new file mode 100644 index 0000000000..d5c4b5c136 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go @@ -0,0 +1,21 @@ +// Copyright The OpenTelemetry 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 semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0" + +// HTTP scheme attributes. +var ( + HTTPSchemeHTTP = HTTPSchemeKey.String("http") + HTTPSchemeHTTPS = HTTPSchemeKey.String("https") +) diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv/http.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv/http.go new file mode 100644 index 0000000000..fc43808fe4 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv/http.go @@ -0,0 +1,152 @@ +// Copyright The OpenTelemetry 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 httpconv provides OpenTelemetry HTTP semantic conventions for +// tracing telemetry. +package httpconv // import "go.opentelemetry.io/otel/semconv/v1.17.0/httpconv" + +import ( + "net/http" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/semconv/internal/v2" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" +) + +var ( + nc = &internal.NetConv{ + NetHostNameKey: semconv.NetHostNameKey, + NetHostPortKey: semconv.NetHostPortKey, + NetPeerNameKey: semconv.NetPeerNameKey, + NetPeerPortKey: semconv.NetPeerPortKey, + NetSockPeerAddrKey: semconv.NetSockPeerAddrKey, + NetSockPeerPortKey: semconv.NetSockPeerPortKey, + NetTransportOther: semconv.NetTransportOther, + NetTransportTCP: semconv.NetTransportTCP, + NetTransportUDP: semconv.NetTransportUDP, + NetTransportInProc: semconv.NetTransportInProc, + } + + hc = &internal.HTTPConv{ + NetConv: nc, + + EnduserIDKey: semconv.EnduserIDKey, + HTTPClientIPKey: semconv.HTTPClientIPKey, + HTTPFlavorKey: semconv.HTTPFlavorKey, + HTTPMethodKey: semconv.HTTPMethodKey, + HTTPRequestContentLengthKey: semconv.HTTPRequestContentLengthKey, + HTTPResponseContentLengthKey: semconv.HTTPResponseContentLengthKey, + HTTPRouteKey: semconv.HTTPRouteKey, + HTTPSchemeHTTP: semconv.HTTPSchemeHTTP, + HTTPSchemeHTTPS: semconv.HTTPSchemeHTTPS, + HTTPStatusCodeKey: semconv.HTTPStatusCodeKey, + HTTPTargetKey: semconv.HTTPTargetKey, + HTTPURLKey: semconv.HTTPURLKey, + HTTPUserAgentKey: semconv.HTTPUserAgentKey, + } +) + +// ClientResponse returns trace attributes for an HTTP response received by a +// client from a server. It will return the following attributes if the related +// values are defined in resp: "http.status.code", +// "http.response_content_length". +// +// This does not add all OpenTelemetry required attributes for an HTTP event, +// it assumes ClientRequest was used to create the span with a complete set of +// attributes. If a complete set of attributes can be generated using the +// request contained in resp. For example: +// +// append(ClientResponse(resp), ClientRequest(resp.Request)...) +func ClientResponse(resp *http.Response) []attribute.KeyValue { + return hc.ClientResponse(resp) +} + +// ClientRequest returns trace attributes for an HTTP request made by a client. +// The following attributes are always returned: "http.url", "http.flavor", +// "http.method", "net.peer.name". The following attributes are returned if the +// related values are defined in req: "net.peer.port", "http.user_agent", +// "http.request_content_length", "enduser.id". +func ClientRequest(req *http.Request) []attribute.KeyValue { + return hc.ClientRequest(req) +} + +// ClientStatus returns a span status code and message for an HTTP status code +// value received by a client. +func ClientStatus(code int) (codes.Code, string) { + return hc.ClientStatus(code) +} + +// ServerRequest returns trace attributes for an HTTP request received by a +// server. +// +// The server must be the primary server name if it is known. For example this +// would be the ServerName directive +// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache +// server, and the server_name directive +// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an +// nginx server. More generically, the primary server name would be the host +// header value that matches the default virtual host of an HTTP server. It +// should include the host identifier and if a port is used to route to the +// server that port identifier should be included as an appropriate port +// suffix. +// +// If the primary server name is not known, server should be an empty string. +// The req Host will be used to determine the server instead. +// +// The following attributes are always returned: "http.method", "http.scheme", +// "http.flavor", "http.target", "net.host.name". The following attributes are +// returned if they related values are defined in req: "net.host.port", +// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id", +// "http.client_ip". +func ServerRequest(server string, req *http.Request) []attribute.KeyValue { + return hc.ServerRequest(server, req) +} + +// ServerStatus returns a span status code and message for an HTTP status code +// value returned by a server. Status codes in the 400-499 range are not +// returned as errors. +func ServerStatus(code int) (codes.Code, string) { + return hc.ServerStatus(code) +} + +// RequestHeader returns the contents of h as attributes. +// +// Instrumentation should require an explicit configuration of which headers to +// captured and then prune what they pass here. Including all headers can be a +// security risk - explicit configuration helps avoid leaking sensitive +// information. +// +// The User-Agent header is already captured in the http.user_agent attribute +// from ClientRequest and ServerRequest. Instrumentation may provide an option +// to capture that header here even though it is not recommended. Otherwise, +// instrumentation should filter that out of what is passed. +func RequestHeader(h http.Header) []attribute.KeyValue { + return hc.RequestHeader(h) +} + +// ResponseHeader returns the contents of h as attributes. +// +// Instrumentation should require an explicit configuration of which headers to +// captured and then prune what they pass here. Including all headers can be a +// security risk - explicit configuration helps avoid leaking sensitive +// information. +// +// The User-Agent header is already captured in the http.user_agent attribute +// from ClientRequest and ServerRequest. Instrumentation may provide an option +// to capture that header here even though it is not recommended. Otherwise, +// instrumentation should filter that out of what is passed. +func ResponseHeader(h http.Header) []attribute.KeyValue { + return hc.ResponseHeader(h) +} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go new file mode 100644 index 0000000000..39a2eab3a6 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go @@ -0,0 +1,2010 @@ +// Copyright The OpenTelemetry 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 from semantic convention specification. DO NOT EDIT. + +package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0" + +import "go.opentelemetry.io/otel/attribute" + +// The web browser in which the application represented by the resource is +// running. The `browser.*` attributes MUST be used only for resources that +// represent applications running in a web browser (regardless of whether +// running on a mobile or desktop device). +const ( + // BrowserBrandsKey is the attribute Key conforming to the "browser.brands" + // semantic conventions. It represents the array of brand name and version + // separated by a space + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: ' Not A;Brand 99', 'Chromium 99', 'Chrome 99' + // Note: This value is intended to be taken from the [UA client hints + // API](https://wicg.github.io/ua-client-hints/#interface) + // (`navigator.userAgentData.brands`). + BrowserBrandsKey = attribute.Key("browser.brands") + + // BrowserPlatformKey is the attribute Key conforming to the + // "browser.platform" semantic conventions. It represents the platform on + // which the browser is running + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Windows', 'macOS', 'Android' + // Note: This value is intended to be taken from the [UA client hints + // API](https://wicg.github.io/ua-client-hints/#interface) + // (`navigator.userAgentData.platform`). If unavailable, the legacy + // `navigator.platform` API SHOULD NOT be used instead and this attribute + // SHOULD be left unset in order for the values to be consistent. + // The list of possible values is defined in the [W3C User-Agent Client + // Hints + // specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). + // Note that some (but not all) of these values can overlap with values in + // the [`os.type` and `os.name` attributes](./os.md). However, for + // consistency, the values in the `browser.platform` attribute should + // capture the exact value that the user agent provides. + BrowserPlatformKey = attribute.Key("browser.platform") + + // BrowserMobileKey is the attribute Key conforming to the "browser.mobile" + // semantic conventions. It represents a boolean that is true if the + // browser is running on a mobile device + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + // Note: This value is intended to be taken from the [UA client hints + // API](https://wicg.github.io/ua-client-hints/#interface) + // (`navigator.userAgentData.mobile`). If unavailable, this attribute + // SHOULD be left unset. + BrowserMobileKey = attribute.Key("browser.mobile") + + // BrowserUserAgentKey is the attribute Key conforming to the + // "browser.user_agent" semantic conventions. It represents the full + // user-agent string provided by the browser + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) + // AppleWebKit/537.36 (KHTML, ' + // 'like Gecko) Chrome/95.0.4638.54 Safari/537.36' + // Note: The user-agent value SHOULD be provided only from browsers that do + // not have a mechanism to retrieve brands and platform individually from + // the User-Agent Client Hints API. To retrieve the value, the legacy + // `navigator.userAgent` API can be used. + BrowserUserAgentKey = attribute.Key("browser.user_agent") + + // BrowserLanguageKey is the attribute Key conforming to the + // "browser.language" semantic conventions. It represents the preferred + // language of the user using the browser + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'en', 'en-US', 'fr', 'fr-FR' + // Note: This value is intended to be taken from the Navigator API + // `navigator.language`. + BrowserLanguageKey = attribute.Key("browser.language") +) + +// BrowserBrands returns an attribute KeyValue conforming to the +// "browser.brands" semantic conventions. It represents the array of brand name +// and version separated by a space +func BrowserBrands(val ...string) attribute.KeyValue { + return BrowserBrandsKey.StringSlice(val) +} + +// BrowserPlatform returns an attribute KeyValue conforming to the +// "browser.platform" semantic conventions. It represents the platform on which +// the browser is running +func BrowserPlatform(val string) attribute.KeyValue { + return BrowserPlatformKey.String(val) +} + +// BrowserMobile returns an attribute KeyValue conforming to the +// "browser.mobile" semantic conventions. It represents a boolean that is true +// if the browser is running on a mobile device +func BrowserMobile(val bool) attribute.KeyValue { + return BrowserMobileKey.Bool(val) +} + +// BrowserUserAgent returns an attribute KeyValue conforming to the +// "browser.user_agent" semantic conventions. It represents the full user-agent +// string provided by the browser +func BrowserUserAgent(val string) attribute.KeyValue { + return BrowserUserAgentKey.String(val) +} + +// BrowserLanguage returns an attribute KeyValue conforming to the +// "browser.language" semantic conventions. It represents the preferred +// language of the user using the browser +func BrowserLanguage(val string) attribute.KeyValue { + return BrowserLanguageKey.String(val) +} + +// A cloud environment (e.g. GCP, Azure, AWS) +const ( + // CloudProviderKey is the attribute Key conforming to the "cloud.provider" + // semantic conventions. It represents the name of the cloud provider. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + CloudProviderKey = attribute.Key("cloud.provider") + + // CloudAccountIDKey is the attribute Key conforming to the + // "cloud.account.id" semantic conventions. It represents the cloud account + // ID the resource is assigned to. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '111111111111', 'opentelemetry' + CloudAccountIDKey = attribute.Key("cloud.account.id") + + // CloudRegionKey is the attribute Key conforming to the "cloud.region" + // semantic conventions. It represents the geographical region the resource + // is running. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'us-central1', 'us-east-1' + // Note: Refer to your provider's docs to see the available regions, for + // example [Alibaba Cloud + // regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS + // regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), + // [Azure + // regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), + // [Google Cloud regions](https://cloud.google.com/about/locations), or + // [Tencent Cloud + // regions](https://intl.cloud.tencent.com/document/product/213/6091). + CloudRegionKey = attribute.Key("cloud.region") + + // CloudAvailabilityZoneKey is the attribute Key conforming to the + // "cloud.availability_zone" semantic conventions. It represents the cloud + // regions often have multiple, isolated locations known as zones to + // increase availability. Availability zone represents the zone where the + // resource is running. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'us-east-1c' + // Note: Availability zones are called "zones" on Alibaba Cloud and Google + // Cloud. + CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone") + + // CloudPlatformKey is the attribute Key conforming to the "cloud.platform" + // semantic conventions. It represents the cloud platform in use. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Note: The prefix of the service SHOULD match the one specified in + // `cloud.provider`. + CloudPlatformKey = attribute.Key("cloud.platform") +) + +var ( + // Alibaba Cloud + CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud") + // Amazon Web Services + CloudProviderAWS = CloudProviderKey.String("aws") + // Microsoft Azure + CloudProviderAzure = CloudProviderKey.String("azure") + // Google Cloud Platform + CloudProviderGCP = CloudProviderKey.String("gcp") + // IBM Cloud + CloudProviderIbmCloud = CloudProviderKey.String("ibm_cloud") + // Tencent Cloud + CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud") +) + +var ( + // Alibaba Cloud Elastic Compute Service + CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs") + // Alibaba Cloud Function Compute + CloudPlatformAlibabaCloudFc = CloudPlatformKey.String("alibaba_cloud_fc") + // Red Hat OpenShift on Alibaba Cloud + CloudPlatformAlibabaCloudOpenshift = CloudPlatformKey.String("alibaba_cloud_openshift") + // AWS Elastic Compute Cloud + CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2") + // AWS Elastic Container Service + CloudPlatformAWSECS = CloudPlatformKey.String("aws_ecs") + // AWS Elastic Kubernetes Service + CloudPlatformAWSEKS = CloudPlatformKey.String("aws_eks") + // AWS Lambda + CloudPlatformAWSLambda = CloudPlatformKey.String("aws_lambda") + // AWS Elastic Beanstalk + CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk") + // AWS App Runner + CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner") + // Red Hat OpenShift on AWS (ROSA) + CloudPlatformAWSOpenshift = CloudPlatformKey.String("aws_openshift") + // Azure Virtual Machines + CloudPlatformAzureVM = CloudPlatformKey.String("azure_vm") + // Azure Container Instances + CloudPlatformAzureContainerInstances = CloudPlatformKey.String("azure_container_instances") + // Azure Kubernetes Service + CloudPlatformAzureAKS = CloudPlatformKey.String("azure_aks") + // Azure Functions + CloudPlatformAzureFunctions = CloudPlatformKey.String("azure_functions") + // Azure App Service + CloudPlatformAzureAppService = CloudPlatformKey.String("azure_app_service") + // Azure Red Hat OpenShift + CloudPlatformAzureOpenshift = CloudPlatformKey.String("azure_openshift") + // Google Cloud Compute Engine (GCE) + CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine") + // Google Cloud Run + CloudPlatformGCPCloudRun = CloudPlatformKey.String("gcp_cloud_run") + // Google Cloud Kubernetes Engine (GKE) + CloudPlatformGCPKubernetesEngine = CloudPlatformKey.String("gcp_kubernetes_engine") + // Google Cloud Functions (GCF) + CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions") + // Google Cloud App Engine (GAE) + CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine") + // Red Hat OpenShift on Google Cloud + CloudPlatformGoogleCloudOpenshift = CloudPlatformKey.String("google_cloud_openshift") + // Red Hat OpenShift on IBM Cloud + CloudPlatformIbmCloudOpenshift = CloudPlatformKey.String("ibm_cloud_openshift") + // Tencent Cloud Cloud Virtual Machine (CVM) + CloudPlatformTencentCloudCvm = CloudPlatformKey.String("tencent_cloud_cvm") + // Tencent Cloud Elastic Kubernetes Service (EKS) + CloudPlatformTencentCloudEKS = CloudPlatformKey.String("tencent_cloud_eks") + // Tencent Cloud Serverless Cloud Function (SCF) + CloudPlatformTencentCloudScf = CloudPlatformKey.String("tencent_cloud_scf") +) + +// CloudAccountID returns an attribute KeyValue conforming to the +// "cloud.account.id" semantic conventions. It represents the cloud account ID +// the resource is assigned to. +func CloudAccountID(val string) attribute.KeyValue { + return CloudAccountIDKey.String(val) +} + +// CloudRegion returns an attribute KeyValue conforming to the +// "cloud.region" semantic conventions. It represents the geographical region +// the resource is running. +func CloudRegion(val string) attribute.KeyValue { + return CloudRegionKey.String(val) +} + +// CloudAvailabilityZone returns an attribute KeyValue conforming to the +// "cloud.availability_zone" semantic conventions. It represents the cloud +// regions often have multiple, isolated locations known as zones to increase +// availability. Availability zone represents the zone where the resource is +// running. +func CloudAvailabilityZone(val string) attribute.KeyValue { + return CloudAvailabilityZoneKey.String(val) +} + +// Resources used by AWS Elastic Container Service (ECS). +const ( + // AWSECSContainerARNKey is the attribute Key conforming to the + // "aws.ecs.container.arn" semantic conventions. It represents the Amazon + // Resource Name (ARN) of an [ECS container + // instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: + // 'arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9' + AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn") + + // AWSECSClusterARNKey is the attribute Key conforming to the + // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an + // [ECS + // cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster' + AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn") + + // AWSECSLaunchtypeKey is the attribute Key conforming to the + // "aws.ecs.launchtype" semantic conventions. It represents the [launch + // type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) + // for an ECS task. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype") + + // AWSECSTaskARNKey is the attribute Key conforming to the + // "aws.ecs.task.arn" semantic conventions. It represents the ARN of an + // [ECS task + // definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: + // 'arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b' + AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn") + + // AWSECSTaskFamilyKey is the attribute Key conforming to the + // "aws.ecs.task.family" semantic conventions. It represents the task + // definition family this task definition is a member of. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry-family' + AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family") + + // AWSECSTaskRevisionKey is the attribute Key conforming to the + // "aws.ecs.task.revision" semantic conventions. It represents the revision + // for this task definition. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '8', '26' + AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision") +) + +var ( + // ec2 + AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2") + // fargate + AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate") +) + +// AWSECSContainerARN returns an attribute KeyValue conforming to the +// "aws.ecs.container.arn" semantic conventions. It represents the Amazon +// Resource Name (ARN) of an [ECS container +// instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). +func AWSECSContainerARN(val string) attribute.KeyValue { + return AWSECSContainerARNKey.String(val) +} + +// AWSECSClusterARN returns an attribute KeyValue conforming to the +// "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an [ECS +// cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). +func AWSECSClusterARN(val string) attribute.KeyValue { + return AWSECSClusterARNKey.String(val) +} + +// AWSECSTaskARN returns an attribute KeyValue conforming to the +// "aws.ecs.task.arn" semantic conventions. It represents the ARN of an [ECS +// task +// definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). +func AWSECSTaskARN(val string) attribute.KeyValue { + return AWSECSTaskARNKey.String(val) +} + +// AWSECSTaskFamily returns an attribute KeyValue conforming to the +// "aws.ecs.task.family" semantic conventions. It represents the task +// definition family this task definition is a member of. +func AWSECSTaskFamily(val string) attribute.KeyValue { + return AWSECSTaskFamilyKey.String(val) +} + +// AWSECSTaskRevision returns an attribute KeyValue conforming to the +// "aws.ecs.task.revision" semantic conventions. It represents the revision for +// this task definition. +func AWSECSTaskRevision(val string) attribute.KeyValue { + return AWSECSTaskRevisionKey.String(val) +} + +// Resources used by AWS Elastic Kubernetes Service (EKS). +const ( + // AWSEKSClusterARNKey is the attribute Key conforming to the + // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an + // EKS cluster. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster' + AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn") +) + +// AWSEKSClusterARN returns an attribute KeyValue conforming to the +// "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS +// cluster. +func AWSEKSClusterARN(val string) attribute.KeyValue { + return AWSEKSClusterARNKey.String(val) +} + +// Resources specific to Amazon Web Services. +const ( + // AWSLogGroupNamesKey is the attribute Key conforming to the + // "aws.log.group.names" semantic conventions. It represents the name(s) of + // the AWS log group(s) an application is writing to. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: '/aws/lambda/my-function', 'opentelemetry-service' + // Note: Multiple log groups must be supported for cases like + // multi-container applications, where a single application has sidecar + // containers, and each write to their own log group. + AWSLogGroupNamesKey = attribute.Key("aws.log.group.names") + + // AWSLogGroupARNsKey is the attribute Key conforming to the + // "aws.log.group.arns" semantic conventions. It represents the Amazon + // Resource Name(s) (ARN) of the AWS log group(s). + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: + // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*' + // Note: See the [log group ARN format + // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). + AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns") + + // AWSLogStreamNamesKey is the attribute Key conforming to the + // "aws.log.stream.names" semantic conventions. It represents the name(s) + // of the AWS log stream(s) an application is writing to. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: 'logs/main/10838bed-421f-43ef-870a-f43feacbbb5b' + AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names") + + // AWSLogStreamARNsKey is the attribute Key conforming to the + // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of + // the AWS log stream(s). + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: + // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b' + // Note: See the [log stream ARN format + // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). + // One log group can contain several log streams, so these ARNs necessarily + // identify both a log group and a log stream. + AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns") +) + +// AWSLogGroupNames returns an attribute KeyValue conforming to the +// "aws.log.group.names" semantic conventions. It represents the name(s) of the +// AWS log group(s) an application is writing to. +func AWSLogGroupNames(val ...string) attribute.KeyValue { + return AWSLogGroupNamesKey.StringSlice(val) +} + +// AWSLogGroupARNs returns an attribute KeyValue conforming to the +// "aws.log.group.arns" semantic conventions. It represents the Amazon Resource +// Name(s) (ARN) of the AWS log group(s). +func AWSLogGroupARNs(val ...string) attribute.KeyValue { + return AWSLogGroupARNsKey.StringSlice(val) +} + +// AWSLogStreamNames returns an attribute KeyValue conforming to the +// "aws.log.stream.names" semantic conventions. It represents the name(s) of +// the AWS log stream(s) an application is writing to. +func AWSLogStreamNames(val ...string) attribute.KeyValue { + return AWSLogStreamNamesKey.StringSlice(val) +} + +// AWSLogStreamARNs returns an attribute KeyValue conforming to the +// "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the +// AWS log stream(s). +func AWSLogStreamARNs(val ...string) attribute.KeyValue { + return AWSLogStreamARNsKey.StringSlice(val) +} + +// A container instance. +const ( + // ContainerNameKey is the attribute Key conforming to the "container.name" + // semantic conventions. It represents the container name used by container + // runtime. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry-autoconf' + ContainerNameKey = attribute.Key("container.name") + + // ContainerIDKey is the attribute Key conforming to the "container.id" + // semantic conventions. It represents the container ID. Usually a UUID, as + // for example used to [identify Docker + // containers](https://docs.docker.com/engine/reference/run/#container-identification). + // The UUID might be abbreviated. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'a3bf90e006b2' + ContainerIDKey = attribute.Key("container.id") + + // ContainerRuntimeKey is the attribute Key conforming to the + // "container.runtime" semantic conventions. It represents the container + // runtime managing this container. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'docker', 'containerd', 'rkt' + ContainerRuntimeKey = attribute.Key("container.runtime") + + // ContainerImageNameKey is the attribute Key conforming to the + // "container.image.name" semantic conventions. It represents the name of + // the image the container was built on. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'gcr.io/opentelemetry/operator' + ContainerImageNameKey = attribute.Key("container.image.name") + + // ContainerImageTagKey is the attribute Key conforming to the + // "container.image.tag" semantic conventions. It represents the container + // image tag. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '0.1' + ContainerImageTagKey = attribute.Key("container.image.tag") +) + +// ContainerName returns an attribute KeyValue conforming to the +// "container.name" semantic conventions. It represents the container name used +// by container runtime. +func ContainerName(val string) attribute.KeyValue { + return ContainerNameKey.String(val) +} + +// ContainerID returns an attribute KeyValue conforming to the +// "container.id" semantic conventions. It represents the container ID. Usually +// a UUID, as for example used to [identify Docker +// containers](https://docs.docker.com/engine/reference/run/#container-identification). +// The UUID might be abbreviated. +func ContainerID(val string) attribute.KeyValue { + return ContainerIDKey.String(val) +} + +// ContainerRuntime returns an attribute KeyValue conforming to the +// "container.runtime" semantic conventions. It represents the container +// runtime managing this container. +func ContainerRuntime(val string) attribute.KeyValue { + return ContainerRuntimeKey.String(val) +} + +// ContainerImageName returns an attribute KeyValue conforming to the +// "container.image.name" semantic conventions. It represents the name of the +// image the container was built on. +func ContainerImageName(val string) attribute.KeyValue { + return ContainerImageNameKey.String(val) +} + +// ContainerImageTag returns an attribute KeyValue conforming to the +// "container.image.tag" semantic conventions. It represents the container +// image tag. +func ContainerImageTag(val string) attribute.KeyValue { + return ContainerImageTagKey.String(val) +} + +// The software deployment. +const ( + // DeploymentEnvironmentKey is the attribute Key conforming to the + // "deployment.environment" semantic conventions. It represents the name of + // the [deployment + // environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka + // deployment tier). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'staging', 'production' + DeploymentEnvironmentKey = attribute.Key("deployment.environment") +) + +// DeploymentEnvironment returns an attribute KeyValue conforming to the +// "deployment.environment" semantic conventions. It represents the name of the +// [deployment +// environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka +// deployment tier). +func DeploymentEnvironment(val string) attribute.KeyValue { + return DeploymentEnvironmentKey.String(val) +} + +// The device on which the process represented by this resource is running. +const ( + // DeviceIDKey is the attribute Key conforming to the "device.id" semantic + // conventions. It represents a unique identifier representing the device + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '2ab2916d-a51f-4ac8-80ee-45ac31a28092' + // Note: The device identifier MUST only be defined using the values + // outlined below. This value is not an advertising identifier and MUST NOT + // be used as such. On iOS (Swift or Objective-C), this value MUST be equal + // to the [vendor + // identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). + // On Android (Java or Kotlin), this value MUST be equal to the Firebase + // Installation ID or a globally unique UUID which is persisted across + // sessions in your application. More information can be found + // [here](https://developer.android.com/training/articles/user-data-ids) on + // best practices and exact implementation details. Caution should be taken + // when storing personal data or anything which can identify a user. GDPR + // and data protection laws may apply, ensure you do your own due + // diligence. + DeviceIDKey = attribute.Key("device.id") + + // DeviceModelIdentifierKey is the attribute Key conforming to the + // "device.model.identifier" semantic conventions. It represents the model + // identifier for the device + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'iPhone3,4', 'SM-G920F' + // Note: It's recommended this value represents a machine readable version + // of the model identifier rather than the market or consumer-friendly name + // of the device. + DeviceModelIdentifierKey = attribute.Key("device.model.identifier") + + // DeviceModelNameKey is the attribute Key conforming to the + // "device.model.name" semantic conventions. It represents the marketing + // name for the device model + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'iPhone 6s Plus', 'Samsung Galaxy S6' + // Note: It's recommended this value represents a human readable version of + // the device model rather than a machine readable alternative. + DeviceModelNameKey = attribute.Key("device.model.name") + + // DeviceManufacturerKey is the attribute Key conforming to the + // "device.manufacturer" semantic conventions. It represents the name of + // the device manufacturer + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Apple', 'Samsung' + // Note: The Android OS provides this field via + // [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). + // iOS apps SHOULD hardcode the value `Apple`. + DeviceManufacturerKey = attribute.Key("device.manufacturer") +) + +// DeviceID returns an attribute KeyValue conforming to the "device.id" +// semantic conventions. It represents a unique identifier representing the +// device +func DeviceID(val string) attribute.KeyValue { + return DeviceIDKey.String(val) +} + +// DeviceModelIdentifier returns an attribute KeyValue conforming to the +// "device.model.identifier" semantic conventions. It represents the model +// identifier for the device +func DeviceModelIdentifier(val string) attribute.KeyValue { + return DeviceModelIdentifierKey.String(val) +} + +// DeviceModelName returns an attribute KeyValue conforming to the +// "device.model.name" semantic conventions. It represents the marketing name +// for the device model +func DeviceModelName(val string) attribute.KeyValue { + return DeviceModelNameKey.String(val) +} + +// DeviceManufacturer returns an attribute KeyValue conforming to the +// "device.manufacturer" semantic conventions. It represents the name of the +// device manufacturer +func DeviceManufacturer(val string) attribute.KeyValue { + return DeviceManufacturerKey.String(val) +} + +// A serverless instance. +const ( + // FaaSNameKey is the attribute Key conforming to the "faas.name" semantic + // conventions. It represents the name of the single function that this + // runtime instance executes. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'my-function', 'myazurefunctionapp/some-function-name' + // Note: This is the name of the function as configured/deployed on the + // FaaS + // platform and is usually different from the name of the callback + // function (which may be stored in the + // [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) + // span attributes). + // + // For some cloud providers, the above definition is ambiguous. The + // following + // definition of function name MUST be used for this attribute + // (and consequently the span name) for the listed cloud + // providers/products: + // + // * **Azure:** The full name `/`, i.e., function app name + // followed by a forward slash followed by the function name (this form + // can also be seen in the resource JSON for the function). + // This means that a span attribute MUST be used, as an Azure function + // app can host multiple functions that would usually share + // a TracerProvider (see also the `faas.id` attribute). + FaaSNameKey = attribute.Key("faas.name") + + // FaaSIDKey is the attribute Key conforming to the "faas.id" semantic + // conventions. It represents the unique ID of the single function that + // this runtime instance executes. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'arn:aws:lambda:us-west-2:123456789012:function:my-function' + // Note: On some cloud providers, it may not be possible to determine the + // full ID at startup, + // so consider setting `faas.id` as a span attribute instead. + // + // The exact value to use for `faas.id` depends on the cloud provider: + // + // * **AWS Lambda:** The function + // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). + // Take care not to use the "invoked ARN" directly but replace any + // [alias + // suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) + // with the resolved function version, as the same runtime instance may + // be invokable with + // multiple different aliases. + // * **GCP:** The [URI of the + // resource](https://cloud.google.com/iam/docs/full-resource-names) + // * **Azure:** The [Fully Qualified Resource + // ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id) + // of the invoked function, + // *not* the function app, having the form + // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. + // This means that a span attribute MUST be used, as an Azure function + // app can host multiple functions that would usually share + // a TracerProvider. + FaaSIDKey = attribute.Key("faas.id") + + // FaaSVersionKey is the attribute Key conforming to the "faas.version" + // semantic conventions. It represents the immutable version of the + // function being executed. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '26', 'pinkfroid-00002' + // Note: Depending on the cloud provider and platform, use: + // + // * **AWS Lambda:** The [function + // version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) + // (an integer represented as a decimal string). + // * **Google Cloud Run:** The + // [revision](https://cloud.google.com/run/docs/managing/revisions) + // (i.e., the function name plus the revision suffix). + // * **Google Cloud Functions:** The value of the + // [`K_REVISION` environment + // variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). + // * **Azure Functions:** Not applicable. Do not set this attribute. + FaaSVersionKey = attribute.Key("faas.version") + + // FaaSInstanceKey is the attribute Key conforming to the "faas.instance" + // semantic conventions. It represents the execution environment ID as a + // string, that will be potentially reused for other invocations to the + // same function/function version. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de' + // Note: * **AWS Lambda:** Use the (full) log stream name. + FaaSInstanceKey = attribute.Key("faas.instance") + + // FaaSMaxMemoryKey is the attribute Key conforming to the + // "faas.max_memory" semantic conventions. It represents the amount of + // memory available to the serverless function in MiB. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 128 + // Note: It's recommended to set this attribute since e.g. too little + // memory can easily stop a Java AWS Lambda function from working + // correctly. On AWS Lambda, the environment variable + // `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information. + FaaSMaxMemoryKey = attribute.Key("faas.max_memory") +) + +// FaaSName returns an attribute KeyValue conforming to the "faas.name" +// semantic conventions. It represents the name of the single function that +// this runtime instance executes. +func FaaSName(val string) attribute.KeyValue { + return FaaSNameKey.String(val) +} + +// FaaSID returns an attribute KeyValue conforming to the "faas.id" semantic +// conventions. It represents the unique ID of the single function that this +// runtime instance executes. +func FaaSID(val string) attribute.KeyValue { + return FaaSIDKey.String(val) +} + +// FaaSVersion returns an attribute KeyValue conforming to the +// "faas.version" semantic conventions. It represents the immutable version of +// the function being executed. +func FaaSVersion(val string) attribute.KeyValue { + return FaaSVersionKey.String(val) +} + +// FaaSInstance returns an attribute KeyValue conforming to the +// "faas.instance" semantic conventions. It represents the execution +// environment ID as a string, that will be potentially reused for other +// invocations to the same function/function version. +func FaaSInstance(val string) attribute.KeyValue { + return FaaSInstanceKey.String(val) +} + +// FaaSMaxMemory returns an attribute KeyValue conforming to the +// "faas.max_memory" semantic conventions. It represents the amount of memory +// available to the serverless function in MiB. +func FaaSMaxMemory(val int) attribute.KeyValue { + return FaaSMaxMemoryKey.Int(val) +} + +// A host is defined as a general computing instance. +const ( + // HostIDKey is the attribute Key conforming to the "host.id" semantic + // conventions. It represents the unique host ID. For Cloud, this must be + // the instance_id assigned by the cloud provider. For non-containerized + // Linux systems, the `machine-id` located in `/etc/machine-id` or + // `/var/lib/dbus/machine-id` may be used. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'fdbf79e8af94cb7f9e8df36789187052' + HostIDKey = attribute.Key("host.id") + + // HostNameKey is the attribute Key conforming to the "host.name" semantic + // conventions. It represents the name of the host. On Unix systems, it may + // contain what the hostname command returns, or the fully qualified + // hostname, or another name specified by the user. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry-test' + HostNameKey = attribute.Key("host.name") + + // HostTypeKey is the attribute Key conforming to the "host.type" semantic + // conventions. It represents the type of host. For Cloud, this must be the + // machine type. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'n1-standard-1' + HostTypeKey = attribute.Key("host.type") + + // HostArchKey is the attribute Key conforming to the "host.arch" semantic + // conventions. It represents the CPU architecture the host system is + // running on. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + HostArchKey = attribute.Key("host.arch") + + // HostImageNameKey is the attribute Key conforming to the + // "host.image.name" semantic conventions. It represents the name of the VM + // image or OS install the host was instantiated from. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905' + HostImageNameKey = attribute.Key("host.image.name") + + // HostImageIDKey is the attribute Key conforming to the "host.image.id" + // semantic conventions. It represents the vM image ID. For Cloud, this + // value is from the provider. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'ami-07b06b442921831e5' + HostImageIDKey = attribute.Key("host.image.id") + + // HostImageVersionKey is the attribute Key conforming to the + // "host.image.version" semantic conventions. It represents the version + // string of the VM image as defined in [Version + // Attributes](README.md#version-attributes). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '0.1' + HostImageVersionKey = attribute.Key("host.image.version") +) + +var ( + // AMD64 + HostArchAMD64 = HostArchKey.String("amd64") + // ARM32 + HostArchARM32 = HostArchKey.String("arm32") + // ARM64 + HostArchARM64 = HostArchKey.String("arm64") + // Itanium + HostArchIA64 = HostArchKey.String("ia64") + // 32-bit PowerPC + HostArchPPC32 = HostArchKey.String("ppc32") + // 64-bit PowerPC + HostArchPPC64 = HostArchKey.String("ppc64") + // IBM z/Architecture + HostArchS390x = HostArchKey.String("s390x") + // 32-bit x86 + HostArchX86 = HostArchKey.String("x86") +) + +// HostID returns an attribute KeyValue conforming to the "host.id" semantic +// conventions. It represents the unique host ID. For Cloud, this must be the +// instance_id assigned by the cloud provider. For non-containerized Linux +// systems, the `machine-id` located in `/etc/machine-id` or +// `/var/lib/dbus/machine-id` may be used. +func HostID(val string) attribute.KeyValue { + return HostIDKey.String(val) +} + +// HostName returns an attribute KeyValue conforming to the "host.name" +// semantic conventions. It represents the name of the host. On Unix systems, +// it may contain what the hostname command returns, or the fully qualified +// hostname, or another name specified by the user. +func HostName(val string) attribute.KeyValue { + return HostNameKey.String(val) +} + +// HostType returns an attribute KeyValue conforming to the "host.type" +// semantic conventions. It represents the type of host. For Cloud, this must +// be the machine type. +func HostType(val string) attribute.KeyValue { + return HostTypeKey.String(val) +} + +// HostImageName returns an attribute KeyValue conforming to the +// "host.image.name" semantic conventions. It represents the name of the VM +// image or OS install the host was instantiated from. +func HostImageName(val string) attribute.KeyValue { + return HostImageNameKey.String(val) +} + +// HostImageID returns an attribute KeyValue conforming to the +// "host.image.id" semantic conventions. It represents the vM image ID. For +// Cloud, this value is from the provider. +func HostImageID(val string) attribute.KeyValue { + return HostImageIDKey.String(val) +} + +// HostImageVersion returns an attribute KeyValue conforming to the +// "host.image.version" semantic conventions. It represents the version string +// of the VM image as defined in [Version +// Attributes](README.md#version-attributes). +func HostImageVersion(val string) attribute.KeyValue { + return HostImageVersionKey.String(val) +} + +// A Kubernetes Cluster. +const ( + // K8SClusterNameKey is the attribute Key conforming to the + // "k8s.cluster.name" semantic conventions. It represents the name of the + // cluster. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry-cluster' + K8SClusterNameKey = attribute.Key("k8s.cluster.name") +) + +// K8SClusterName returns an attribute KeyValue conforming to the +// "k8s.cluster.name" semantic conventions. It represents the name of the +// cluster. +func K8SClusterName(val string) attribute.KeyValue { + return K8SClusterNameKey.String(val) +} + +// A Kubernetes Node object. +const ( + // K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name" + // semantic conventions. It represents the name of the Node. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'node-1' + K8SNodeNameKey = attribute.Key("k8s.node.name") + + // K8SNodeUIDKey is the attribute Key conforming to the "k8s.node.uid" + // semantic conventions. It represents the UID of the Node. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2' + K8SNodeUIDKey = attribute.Key("k8s.node.uid") +) + +// K8SNodeName returns an attribute KeyValue conforming to the +// "k8s.node.name" semantic conventions. It represents the name of the Node. +func K8SNodeName(val string) attribute.KeyValue { + return K8SNodeNameKey.String(val) +} + +// K8SNodeUID returns an attribute KeyValue conforming to the "k8s.node.uid" +// semantic conventions. It represents the UID of the Node. +func K8SNodeUID(val string) attribute.KeyValue { + return K8SNodeUIDKey.String(val) +} + +// A Kubernetes Namespace. +const ( + // K8SNamespaceNameKey is the attribute Key conforming to the + // "k8s.namespace.name" semantic conventions. It represents the name of the + // namespace that the pod is running in. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'default' + K8SNamespaceNameKey = attribute.Key("k8s.namespace.name") +) + +// K8SNamespaceName returns an attribute KeyValue conforming to the +// "k8s.namespace.name" semantic conventions. It represents the name of the +// namespace that the pod is running in. +func K8SNamespaceName(val string) attribute.KeyValue { + return K8SNamespaceNameKey.String(val) +} + +// A Kubernetes Pod object. +const ( + // K8SPodUIDKey is the attribute Key conforming to the "k8s.pod.uid" + // semantic conventions. It represents the UID of the Pod. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SPodUIDKey = attribute.Key("k8s.pod.uid") + + // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name" + // semantic conventions. It represents the name of the Pod. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry-pod-autoconf' + K8SPodNameKey = attribute.Key("k8s.pod.name") +) + +// K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid" +// semantic conventions. It represents the UID of the Pod. +func K8SPodUID(val string) attribute.KeyValue { + return K8SPodUIDKey.String(val) +} + +// K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name" +// semantic conventions. It represents the name of the Pod. +func K8SPodName(val string) attribute.KeyValue { + return K8SPodNameKey.String(val) +} + +// A container in a +// [PodTemplate](https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates). +const ( + // K8SContainerNameKey is the attribute Key conforming to the + // "k8s.container.name" semantic conventions. It represents the name of the + // Container from Pod specification, must be unique within a Pod. Container + // runtime usually uses different globally unique name (`container.name`). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'redis' + K8SContainerNameKey = attribute.Key("k8s.container.name") + + // K8SContainerRestartCountKey is the attribute Key conforming to the + // "k8s.container.restart_count" semantic conventions. It represents the + // number of times the container was restarted. This attribute can be used + // to identify a particular container (running or stopped) within a + // container spec. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 0, 2 + K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count") +) + +// K8SContainerName returns an attribute KeyValue conforming to the +// "k8s.container.name" semantic conventions. It represents the name of the +// Container from Pod specification, must be unique within a Pod. Container +// runtime usually uses different globally unique name (`container.name`). +func K8SContainerName(val string) attribute.KeyValue { + return K8SContainerNameKey.String(val) +} + +// K8SContainerRestartCount returns an attribute KeyValue conforming to the +// "k8s.container.restart_count" semantic conventions. It represents the number +// of times the container was restarted. This attribute can be used to identify +// a particular container (running or stopped) within a container spec. +func K8SContainerRestartCount(val int) attribute.KeyValue { + return K8SContainerRestartCountKey.Int(val) +} + +// A Kubernetes ReplicaSet object. +const ( + // K8SReplicaSetUIDKey is the attribute Key conforming to the + // "k8s.replicaset.uid" semantic conventions. It represents the UID of the + // ReplicaSet. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid") + + // K8SReplicaSetNameKey is the attribute Key conforming to the + // "k8s.replicaset.name" semantic conventions. It represents the name of + // the ReplicaSet. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry' + K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name") +) + +// K8SReplicaSetUID returns an attribute KeyValue conforming to the +// "k8s.replicaset.uid" semantic conventions. It represents the UID of the +// ReplicaSet. +func K8SReplicaSetUID(val string) attribute.KeyValue { + return K8SReplicaSetUIDKey.String(val) +} + +// K8SReplicaSetName returns an attribute KeyValue conforming to the +// "k8s.replicaset.name" semantic conventions. It represents the name of the +// ReplicaSet. +func K8SReplicaSetName(val string) attribute.KeyValue { + return K8SReplicaSetNameKey.String(val) +} + +// A Kubernetes Deployment object. +const ( + // K8SDeploymentUIDKey is the attribute Key conforming to the + // "k8s.deployment.uid" semantic conventions. It represents the UID of the + // Deployment. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid") + + // K8SDeploymentNameKey is the attribute Key conforming to the + // "k8s.deployment.name" semantic conventions. It represents the name of + // the Deployment. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry' + K8SDeploymentNameKey = attribute.Key("k8s.deployment.name") +) + +// K8SDeploymentUID returns an attribute KeyValue conforming to the +// "k8s.deployment.uid" semantic conventions. It represents the UID of the +// Deployment. +func K8SDeploymentUID(val string) attribute.KeyValue { + return K8SDeploymentUIDKey.String(val) +} + +// K8SDeploymentName returns an attribute KeyValue conforming to the +// "k8s.deployment.name" semantic conventions. It represents the name of the +// Deployment. +func K8SDeploymentName(val string) attribute.KeyValue { + return K8SDeploymentNameKey.String(val) +} + +// A Kubernetes StatefulSet object. +const ( + // K8SStatefulSetUIDKey is the attribute Key conforming to the + // "k8s.statefulset.uid" semantic conventions. It represents the UID of the + // StatefulSet. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid") + + // K8SStatefulSetNameKey is the attribute Key conforming to the + // "k8s.statefulset.name" semantic conventions. It represents the name of + // the StatefulSet. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry' + K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name") +) + +// K8SStatefulSetUID returns an attribute KeyValue conforming to the +// "k8s.statefulset.uid" semantic conventions. It represents the UID of the +// StatefulSet. +func K8SStatefulSetUID(val string) attribute.KeyValue { + return K8SStatefulSetUIDKey.String(val) +} + +// K8SStatefulSetName returns an attribute KeyValue conforming to the +// "k8s.statefulset.name" semantic conventions. It represents the name of the +// StatefulSet. +func K8SStatefulSetName(val string) attribute.KeyValue { + return K8SStatefulSetNameKey.String(val) +} + +// A Kubernetes DaemonSet object. +const ( + // K8SDaemonSetUIDKey is the attribute Key conforming to the + // "k8s.daemonset.uid" semantic conventions. It represents the UID of the + // DaemonSet. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid") + + // K8SDaemonSetNameKey is the attribute Key conforming to the + // "k8s.daemonset.name" semantic conventions. It represents the name of the + // DaemonSet. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry' + K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name") +) + +// K8SDaemonSetUID returns an attribute KeyValue conforming to the +// "k8s.daemonset.uid" semantic conventions. It represents the UID of the +// DaemonSet. +func K8SDaemonSetUID(val string) attribute.KeyValue { + return K8SDaemonSetUIDKey.String(val) +} + +// K8SDaemonSetName returns an attribute KeyValue conforming to the +// "k8s.daemonset.name" semantic conventions. It represents the name of the +// DaemonSet. +func K8SDaemonSetName(val string) attribute.KeyValue { + return K8SDaemonSetNameKey.String(val) +} + +// A Kubernetes Job object. +const ( + // K8SJobUIDKey is the attribute Key conforming to the "k8s.job.uid" + // semantic conventions. It represents the UID of the Job. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SJobUIDKey = attribute.Key("k8s.job.uid") + + // K8SJobNameKey is the attribute Key conforming to the "k8s.job.name" + // semantic conventions. It represents the name of the Job. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry' + K8SJobNameKey = attribute.Key("k8s.job.name") +) + +// K8SJobUID returns an attribute KeyValue conforming to the "k8s.job.uid" +// semantic conventions. It represents the UID of the Job. +func K8SJobUID(val string) attribute.KeyValue { + return K8SJobUIDKey.String(val) +} + +// K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name" +// semantic conventions. It represents the name of the Job. +func K8SJobName(val string) attribute.KeyValue { + return K8SJobNameKey.String(val) +} + +// A Kubernetes CronJob object. +const ( + // K8SCronJobUIDKey is the attribute Key conforming to the + // "k8s.cronjob.uid" semantic conventions. It represents the UID of the + // CronJob. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid") + + // K8SCronJobNameKey is the attribute Key conforming to the + // "k8s.cronjob.name" semantic conventions. It represents the name of the + // CronJob. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry' + K8SCronJobNameKey = attribute.Key("k8s.cronjob.name") +) + +// K8SCronJobUID returns an attribute KeyValue conforming to the +// "k8s.cronjob.uid" semantic conventions. It represents the UID of the +// CronJob. +func K8SCronJobUID(val string) attribute.KeyValue { + return K8SCronJobUIDKey.String(val) +} + +// K8SCronJobName returns an attribute KeyValue conforming to the +// "k8s.cronjob.name" semantic conventions. It represents the name of the +// CronJob. +func K8SCronJobName(val string) attribute.KeyValue { + return K8SCronJobNameKey.String(val) +} + +// The operating system (OS) on which the process represented by this resource +// is running. +const ( + // OSTypeKey is the attribute Key conforming to the "os.type" semantic + // conventions. It represents the operating system type. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + OSTypeKey = attribute.Key("os.type") + + // OSDescriptionKey is the attribute Key conforming to the "os.description" + // semantic conventions. It represents the human readable (not intended to + // be parsed) OS version information, like e.g. reported by `ver` or + // `lsb_release -a` commands. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Microsoft Windows [Version 10.0.18363.778]', 'Ubuntu 18.04.1 + // LTS' + OSDescriptionKey = attribute.Key("os.description") + + // OSNameKey is the attribute Key conforming to the "os.name" semantic + // conventions. It represents the human readable operating system name. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'iOS', 'Android', 'Ubuntu' + OSNameKey = attribute.Key("os.name") + + // OSVersionKey is the attribute Key conforming to the "os.version" + // semantic conventions. It represents the version string of the operating + // system as defined in [Version + // Attributes](../../resource/semantic_conventions/README.md#version-attributes). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '14.2.1', '18.04.1' + OSVersionKey = attribute.Key("os.version") +) + +var ( + // Microsoft Windows + OSTypeWindows = OSTypeKey.String("windows") + // Linux + OSTypeLinux = OSTypeKey.String("linux") + // Apple Darwin + OSTypeDarwin = OSTypeKey.String("darwin") + // FreeBSD + OSTypeFreeBSD = OSTypeKey.String("freebsd") + // NetBSD + OSTypeNetBSD = OSTypeKey.String("netbsd") + // OpenBSD + OSTypeOpenBSD = OSTypeKey.String("openbsd") + // DragonFly BSD + OSTypeDragonflyBSD = OSTypeKey.String("dragonflybsd") + // HP-UX (Hewlett Packard Unix) + OSTypeHPUX = OSTypeKey.String("hpux") + // AIX (Advanced Interactive eXecutive) + OSTypeAIX = OSTypeKey.String("aix") + // SunOS, Oracle Solaris + OSTypeSolaris = OSTypeKey.String("solaris") + // IBM z/OS + OSTypeZOS = OSTypeKey.String("z_os") +) + +// OSDescription returns an attribute KeyValue conforming to the +// "os.description" semantic conventions. It represents the human readable (not +// intended to be parsed) OS version information, like e.g. reported by `ver` +// or `lsb_release -a` commands. +func OSDescription(val string) attribute.KeyValue { + return OSDescriptionKey.String(val) +} + +// OSName returns an attribute KeyValue conforming to the "os.name" semantic +// conventions. It represents the human readable operating system name. +func OSName(val string) attribute.KeyValue { + return OSNameKey.String(val) +} + +// OSVersion returns an attribute KeyValue conforming to the "os.version" +// semantic conventions. It represents the version string of the operating +// system as defined in [Version +// Attributes](../../resource/semantic_conventions/README.md#version-attributes). +func OSVersion(val string) attribute.KeyValue { + return OSVersionKey.String(val) +} + +// An operating system process. +const ( + // ProcessPIDKey is the attribute Key conforming to the "process.pid" + // semantic conventions. It represents the process identifier (PID). + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 1234 + ProcessPIDKey = attribute.Key("process.pid") + + // ProcessParentPIDKey is the attribute Key conforming to the + // "process.parent_pid" semantic conventions. It represents the parent + // Process identifier (PID). + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 111 + ProcessParentPIDKey = attribute.Key("process.parent_pid") + + // ProcessExecutableNameKey is the attribute Key conforming to the + // "process.executable.name" semantic conventions. It represents the name + // of the process executable. On Linux based systems, can be set to the + // `Name` in `proc/[pid]/status`. On Windows, can be set to the base name + // of `GetProcessImageFileNameW`. + // + // Type: string + // RequirementLevel: ConditionallyRequired (See alternative attributes + // below.) + // Stability: stable + // Examples: 'otelcol' + ProcessExecutableNameKey = attribute.Key("process.executable.name") + + // ProcessExecutablePathKey is the attribute Key conforming to the + // "process.executable.path" semantic conventions. It represents the full + // path to the process executable. On Linux based systems, can be set to + // the target of `proc/[pid]/exe`. On Windows, can be set to the result of + // `GetProcessImageFileNameW`. + // + // Type: string + // RequirementLevel: ConditionallyRequired (See alternative attributes + // below.) + // Stability: stable + // Examples: '/usr/bin/cmd/otelcol' + ProcessExecutablePathKey = attribute.Key("process.executable.path") + + // ProcessCommandKey is the attribute Key conforming to the + // "process.command" semantic conventions. It represents the command used + // to launch the process (i.e. the command name). On Linux based systems, + // can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can + // be set to the first parameter extracted from `GetCommandLineW`. + // + // Type: string + // RequirementLevel: ConditionallyRequired (See alternative attributes + // below.) + // Stability: stable + // Examples: 'cmd/otelcol' + ProcessCommandKey = attribute.Key("process.command") + + // ProcessCommandLineKey is the attribute Key conforming to the + // "process.command_line" semantic conventions. It represents the full + // command used to launch the process as a single string representing the + // full command. On Windows, can be set to the result of `GetCommandLineW`. + // Do not set this if you have to assemble it just for monitoring; use + // `process.command_args` instead. + // + // Type: string + // RequirementLevel: ConditionallyRequired (See alternative attributes + // below.) + // Stability: stable + // Examples: 'C:\\cmd\\otecol --config="my directory\\config.yaml"' + ProcessCommandLineKey = attribute.Key("process.command_line") + + // ProcessCommandArgsKey is the attribute Key conforming to the + // "process.command_args" semantic conventions. It represents the all the + // command arguments (including the command/executable itself) as received + // by the process. On Linux-based systems (and some other Unixoid systems + // supporting procfs), can be set according to the list of null-delimited + // strings extracted from `proc/[pid]/cmdline`. For libc-based executables, + // this would be the full argv vector passed to `main`. + // + // Type: string[] + // RequirementLevel: ConditionallyRequired (See alternative attributes + // below.) + // Stability: stable + // Examples: 'cmd/otecol', '--config=config.yaml' + ProcessCommandArgsKey = attribute.Key("process.command_args") + + // ProcessOwnerKey is the attribute Key conforming to the "process.owner" + // semantic conventions. It represents the username of the user that owns + // the process. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'root' + ProcessOwnerKey = attribute.Key("process.owner") +) + +// ProcessPID returns an attribute KeyValue conforming to the "process.pid" +// semantic conventions. It represents the process identifier (PID). +func ProcessPID(val int) attribute.KeyValue { + return ProcessPIDKey.Int(val) +} + +// ProcessParentPID returns an attribute KeyValue conforming to the +// "process.parent_pid" semantic conventions. It represents the parent Process +// identifier (PID). +func ProcessParentPID(val int) attribute.KeyValue { + return ProcessParentPIDKey.Int(val) +} + +// ProcessExecutableName returns an attribute KeyValue conforming to the +// "process.executable.name" semantic conventions. It represents the name of +// the process executable. On Linux based systems, can be set to the `Name` in +// `proc/[pid]/status`. On Windows, can be set to the base name of +// `GetProcessImageFileNameW`. +func ProcessExecutableName(val string) attribute.KeyValue { + return ProcessExecutableNameKey.String(val) +} + +// ProcessExecutablePath returns an attribute KeyValue conforming to the +// "process.executable.path" semantic conventions. It represents the full path +// to the process executable. On Linux based systems, can be set to the target +// of `proc/[pid]/exe`. On Windows, can be set to the result of +// `GetProcessImageFileNameW`. +func ProcessExecutablePath(val string) attribute.KeyValue { + return ProcessExecutablePathKey.String(val) +} + +// ProcessCommand returns an attribute KeyValue conforming to the +// "process.command" semantic conventions. It represents the command used to +// launch the process (i.e. the command name). On Linux based systems, can be +// set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to +// the first parameter extracted from `GetCommandLineW`. +func ProcessCommand(val string) attribute.KeyValue { + return ProcessCommandKey.String(val) +} + +// ProcessCommandLine returns an attribute KeyValue conforming to the +// "process.command_line" semantic conventions. It represents the full command +// used to launch the process as a single string representing the full command. +// On Windows, can be set to the result of `GetCommandLineW`. Do not set this +// if you have to assemble it just for monitoring; use `process.command_args` +// instead. +func ProcessCommandLine(val string) attribute.KeyValue { + return ProcessCommandLineKey.String(val) +} + +// ProcessCommandArgs returns an attribute KeyValue conforming to the +// "process.command_args" semantic conventions. It represents the all the +// command arguments (including the command/executable itself) as received by +// the process. On Linux-based systems (and some other Unixoid systems +// supporting procfs), can be set according to the list of null-delimited +// strings extracted from `proc/[pid]/cmdline`. For libc-based executables, +// this would be the full argv vector passed to `main`. +func ProcessCommandArgs(val ...string) attribute.KeyValue { + return ProcessCommandArgsKey.StringSlice(val) +} + +// ProcessOwner returns an attribute KeyValue conforming to the +// "process.owner" semantic conventions. It represents the username of the user +// that owns the process. +func ProcessOwner(val string) attribute.KeyValue { + return ProcessOwnerKey.String(val) +} + +// The single (language) runtime instance which is monitored. +const ( + // ProcessRuntimeNameKey is the attribute Key conforming to the + // "process.runtime.name" semantic conventions. It represents the name of + // the runtime of this process. For compiled native binaries, this SHOULD + // be the name of the compiler. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'OpenJDK Runtime Environment' + ProcessRuntimeNameKey = attribute.Key("process.runtime.name") + + // ProcessRuntimeVersionKey is the attribute Key conforming to the + // "process.runtime.version" semantic conventions. It represents the + // version of the runtime of this process, as returned by the runtime + // without modification. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '14.0.2' + ProcessRuntimeVersionKey = attribute.Key("process.runtime.version") + + // ProcessRuntimeDescriptionKey is the attribute Key conforming to the + // "process.runtime.description" semantic conventions. It represents an + // additional description about the runtime of the process, for example a + // specific vendor customization of the runtime environment. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0' + ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description") +) + +// ProcessRuntimeName returns an attribute KeyValue conforming to the +// "process.runtime.name" semantic conventions. It represents the name of the +// runtime of this process. For compiled native binaries, this SHOULD be the +// name of the compiler. +func ProcessRuntimeName(val string) attribute.KeyValue { + return ProcessRuntimeNameKey.String(val) +} + +// ProcessRuntimeVersion returns an attribute KeyValue conforming to the +// "process.runtime.version" semantic conventions. It represents the version of +// the runtime of this process, as returned by the runtime without +// modification. +func ProcessRuntimeVersion(val string) attribute.KeyValue { + return ProcessRuntimeVersionKey.String(val) +} + +// ProcessRuntimeDescription returns an attribute KeyValue conforming to the +// "process.runtime.description" semantic conventions. It represents an +// additional description about the runtime of the process, for example a +// specific vendor customization of the runtime environment. +func ProcessRuntimeDescription(val string) attribute.KeyValue { + return ProcessRuntimeDescriptionKey.String(val) +} + +// A service instance. +const ( + // ServiceNameKey is the attribute Key conforming to the "service.name" + // semantic conventions. It represents the logical name of the service. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'shoppingcart' + // Note: MUST be the same for all instances of horizontally scaled + // services. If the value was not specified, SDKs MUST fallback to + // `unknown_service:` concatenated with + // [`process.executable.name`](process.md#process), e.g. + // `unknown_service:bash`. If `process.executable.name` is not available, + // the value MUST be set to `unknown_service`. + ServiceNameKey = attribute.Key("service.name") + + // ServiceNamespaceKey is the attribute Key conforming to the + // "service.namespace" semantic conventions. It represents a namespace for + // `service.name`. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Shop' + // Note: A string value having a meaning that helps to distinguish a group + // of services, for example the team name that owns a group of services. + // `service.name` is expected to be unique within the same namespace. If + // `service.namespace` is not specified in the Resource then `service.name` + // is expected to be unique for all services that have no explicit + // namespace defined (so the empty/unspecified namespace is simply one more + // valid namespace). Zero-length namespace string is assumed equal to + // unspecified namespace. + ServiceNamespaceKey = attribute.Key("service.namespace") + + // ServiceInstanceIDKey is the attribute Key conforming to the + // "service.instance.id" semantic conventions. It represents the string ID + // of the service instance. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '627cc493-f310-47de-96bd-71410b7dec09' + // Note: MUST be unique for each instance of the same + // `service.namespace,service.name` pair (in other words + // `service.namespace,service.name,service.instance.id` triplet MUST be + // globally unique). The ID helps to distinguish instances of the same + // service that exist at the same time (e.g. instances of a horizontally + // scaled service). It is preferable for the ID to be persistent and stay + // the same for the lifetime of the service instance, however it is + // acceptable that the ID is ephemeral and changes during important + // lifetime events for the service (e.g. service restarts). If the service + // has no inherent unique ID that can be used as the value of this + // attribute it is recommended to generate a random Version 1 or Version 4 + // RFC 4122 UUID (services aiming for reproducible UUIDs may also use + // Version 5, see RFC 4122 for more recommendations). + ServiceInstanceIDKey = attribute.Key("service.instance.id") + + // ServiceVersionKey is the attribute Key conforming to the + // "service.version" semantic conventions. It represents the version string + // of the service API or implementation. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '2.0.0' + ServiceVersionKey = attribute.Key("service.version") +) + +// ServiceName returns an attribute KeyValue conforming to the +// "service.name" semantic conventions. It represents the logical name of the +// service. +func ServiceName(val string) attribute.KeyValue { + return ServiceNameKey.String(val) +} + +// ServiceNamespace returns an attribute KeyValue conforming to the +// "service.namespace" semantic conventions. It represents a namespace for +// `service.name`. +func ServiceNamespace(val string) attribute.KeyValue { + return ServiceNamespaceKey.String(val) +} + +// ServiceInstanceID returns an attribute KeyValue conforming to the +// "service.instance.id" semantic conventions. It represents the string ID of +// the service instance. +func ServiceInstanceID(val string) attribute.KeyValue { + return ServiceInstanceIDKey.String(val) +} + +// ServiceVersion returns an attribute KeyValue conforming to the +// "service.version" semantic conventions. It represents the version string of +// the service API or implementation. +func ServiceVersion(val string) attribute.KeyValue { + return ServiceVersionKey.String(val) +} + +// The telemetry SDK used to capture data recorded by the instrumentation +// libraries. +const ( + // TelemetrySDKNameKey is the attribute Key conforming to the + // "telemetry.sdk.name" semantic conventions. It represents the name of the + // telemetry SDK as defined above. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'opentelemetry' + TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name") + + // TelemetrySDKLanguageKey is the attribute Key conforming to the + // "telemetry.sdk.language" semantic conventions. It represents the + // language of the telemetry SDK. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language") + + // TelemetrySDKVersionKey is the attribute Key conforming to the + // "telemetry.sdk.version" semantic conventions. It represents the version + // string of the telemetry SDK. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '1.2.3' + TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version") + + // TelemetryAutoVersionKey is the attribute Key conforming to the + // "telemetry.auto.version" semantic conventions. It represents the version + // string of the auto instrumentation agent, if used. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '1.2.3' + TelemetryAutoVersionKey = attribute.Key("telemetry.auto.version") +) + +var ( + // cpp + TelemetrySDKLanguageCPP = TelemetrySDKLanguageKey.String("cpp") + // dotnet + TelemetrySDKLanguageDotnet = TelemetrySDKLanguageKey.String("dotnet") + // erlang + TelemetrySDKLanguageErlang = TelemetrySDKLanguageKey.String("erlang") + // go + TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go") + // java + TelemetrySDKLanguageJava = TelemetrySDKLanguageKey.String("java") + // nodejs + TelemetrySDKLanguageNodejs = TelemetrySDKLanguageKey.String("nodejs") + // php + TelemetrySDKLanguagePHP = TelemetrySDKLanguageKey.String("php") + // python + TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python") + // ruby + TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby") + // webjs + TelemetrySDKLanguageWebjs = TelemetrySDKLanguageKey.String("webjs") + // swift + TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift") +) + +// TelemetrySDKName returns an attribute KeyValue conforming to the +// "telemetry.sdk.name" semantic conventions. It represents the name of the +// telemetry SDK as defined above. +func TelemetrySDKName(val string) attribute.KeyValue { + return TelemetrySDKNameKey.String(val) +} + +// TelemetrySDKVersion returns an attribute KeyValue conforming to the +// "telemetry.sdk.version" semantic conventions. It represents the version +// string of the telemetry SDK. +func TelemetrySDKVersion(val string) attribute.KeyValue { + return TelemetrySDKVersionKey.String(val) +} + +// TelemetryAutoVersion returns an attribute KeyValue conforming to the +// "telemetry.auto.version" semantic conventions. It represents the version +// string of the auto instrumentation agent, if used. +func TelemetryAutoVersion(val string) attribute.KeyValue { + return TelemetryAutoVersionKey.String(val) +} + +// Resource describing the packaged software running the application code. Web +// engines are typically executed using process.runtime. +const ( + // WebEngineNameKey is the attribute Key conforming to the "webengine.name" + // semantic conventions. It represents the name of the web engine. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'WildFly' + WebEngineNameKey = attribute.Key("webengine.name") + + // WebEngineVersionKey is the attribute Key conforming to the + // "webengine.version" semantic conventions. It represents the version of + // the web engine. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '21.0.0' + WebEngineVersionKey = attribute.Key("webengine.version") + + // WebEngineDescriptionKey is the attribute Key conforming to the + // "webengine.description" semantic conventions. It represents the + // additional description of the web engine (e.g. detailed version and + // edition information). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - + // 2.2.2.Final' + WebEngineDescriptionKey = attribute.Key("webengine.description") +) + +// WebEngineName returns an attribute KeyValue conforming to the +// "webengine.name" semantic conventions. It represents the name of the web +// engine. +func WebEngineName(val string) attribute.KeyValue { + return WebEngineNameKey.String(val) +} + +// WebEngineVersion returns an attribute KeyValue conforming to the +// "webengine.version" semantic conventions. It represents the version of the +// web engine. +func WebEngineVersion(val string) attribute.KeyValue { + return WebEngineVersionKey.String(val) +} + +// WebEngineDescription returns an attribute KeyValue conforming to the +// "webengine.description" semantic conventions. It represents the additional +// description of the web engine (e.g. detailed version and edition +// information). +func WebEngineDescription(val string) attribute.KeyValue { + return WebEngineDescriptionKey.String(val) +} + +// Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's +// concepts. +const ( + // OtelScopeNameKey is the attribute Key conforming to the + // "otel.scope.name" semantic conventions. It represents the name of the + // instrumentation scope - (`InstrumentationScope.Name` in OTLP). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'io.opentelemetry.contrib.mongodb' + OtelScopeNameKey = attribute.Key("otel.scope.name") + + // OtelScopeVersionKey is the attribute Key conforming to the + // "otel.scope.version" semantic conventions. It represents the version of + // the instrumentation scope - (`InstrumentationScope.Version` in OTLP). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '1.0.0' + OtelScopeVersionKey = attribute.Key("otel.scope.version") +) + +// OtelScopeName returns an attribute KeyValue conforming to the +// "otel.scope.name" semantic conventions. It represents the name of the +// instrumentation scope - (`InstrumentationScope.Name` in OTLP). +func OtelScopeName(val string) attribute.KeyValue { + return OtelScopeNameKey.String(val) +} + +// OtelScopeVersion returns an attribute KeyValue conforming to the +// "otel.scope.version" semantic conventions. It represents the version of the +// instrumentation scope - (`InstrumentationScope.Version` in OTLP). +func OtelScopeVersion(val string) attribute.KeyValue { + return OtelScopeVersionKey.String(val) +} + +// Span attributes used by non-OTLP exporters to represent OpenTelemetry +// Scope's concepts. +const ( + // OtelLibraryNameKey is the attribute Key conforming to the + // "otel.library.name" semantic conventions. It represents the deprecated, + // use the `otel.scope.name` attribute. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 'io.opentelemetry.contrib.mongodb' + OtelLibraryNameKey = attribute.Key("otel.library.name") + + // OtelLibraryVersionKey is the attribute Key conforming to the + // "otel.library.version" semantic conventions. It represents the + // deprecated, use the `otel.scope.version` attribute. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: '1.0.0' + OtelLibraryVersionKey = attribute.Key("otel.library.version") +) + +// OtelLibraryName returns an attribute KeyValue conforming to the +// "otel.library.name" semantic conventions. It represents the deprecated, use +// the `otel.scope.name` attribute. +func OtelLibraryName(val string) attribute.KeyValue { + return OtelLibraryNameKey.String(val) +} + +// OtelLibraryVersion returns an attribute KeyValue conforming to the +// "otel.library.version" semantic conventions. It represents the deprecated, +// use the `otel.scope.version` attribute. +func OtelLibraryVersion(val string) attribute.KeyValue { + return OtelLibraryVersionKey.String(val) +} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go new file mode 100644 index 0000000000..42fc525d16 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry 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 semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0" + +// SchemaURL is the schema URL that matches the version of the semantic conventions +// that this package defines. Semconv packages starting from v1.4.0 must declare +// non-empty schema URL in the form https://opentelemetry.io/schemas/ +const SchemaURL = "https://opentelemetry.io/schemas/1.17.0" diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go new file mode 100644 index 0000000000..8c4a7299d2 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go @@ -0,0 +1,3375 @@ +// Copyright The OpenTelemetry 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 from semantic convention specification. DO NOT EDIT. + +package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0" + +import "go.opentelemetry.io/otel/attribute" + +// The shared attributes used to report a single exception associated with a +// span or log. +const ( + // ExceptionTypeKey is the attribute Key conforming to the "exception.type" + // semantic conventions. It represents the type of the exception (its + // fully-qualified class name, if applicable). The dynamic type of the + // exception should be preferred over the static type in languages that + // support it. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'java.net.ConnectException', 'OSError' + ExceptionTypeKey = attribute.Key("exception.type") + + // ExceptionMessageKey is the attribute Key conforming to the + // "exception.message" semantic conventions. It represents the exception + // message. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Division by zero', "Can't convert 'int' object to str + // implicitly" + ExceptionMessageKey = attribute.Key("exception.message") + + // ExceptionStacktraceKey is the attribute Key conforming to the + // "exception.stacktrace" semantic conventions. It represents a stacktrace + // as a string in the natural representation for the language runtime. The + // representation is to be determined and documented by each language SIG. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test + // exception\\n at ' + // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at ' + // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at ' + // 'com.example.GenerateTrace.main(GenerateTrace.java:5)' + ExceptionStacktraceKey = attribute.Key("exception.stacktrace") +) + +// ExceptionType returns an attribute KeyValue conforming to the +// "exception.type" semantic conventions. It represents the type of the +// exception (its fully-qualified class name, if applicable). The dynamic type +// of the exception should be preferred over the static type in languages that +// support it. +func ExceptionType(val string) attribute.KeyValue { + return ExceptionTypeKey.String(val) +} + +// ExceptionMessage returns an attribute KeyValue conforming to the +// "exception.message" semantic conventions. It represents the exception +// message. +func ExceptionMessage(val string) attribute.KeyValue { + return ExceptionMessageKey.String(val) +} + +// ExceptionStacktrace returns an attribute KeyValue conforming to the +// "exception.stacktrace" semantic conventions. It represents a stacktrace as a +// string in the natural representation for the language runtime. The +// representation is to be determined and documented by each language SIG. +func ExceptionStacktrace(val string) attribute.KeyValue { + return ExceptionStacktraceKey.String(val) +} + +// Attributes for Events represented using Log Records. +const ( + // EventNameKey is the attribute Key conforming to the "event.name" + // semantic conventions. It represents the name identifies the event. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'click', 'exception' + EventNameKey = attribute.Key("event.name") + + // EventDomainKey is the attribute Key conforming to the "event.domain" + // semantic conventions. It represents the domain identifies the business + // context for the events. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + // Note: Events across different domains may have same `event.name`, yet be + // unrelated events. + EventDomainKey = attribute.Key("event.domain") +) + +var ( + // Events from browser apps + EventDomainBrowser = EventDomainKey.String("browser") + // Events from mobile apps + EventDomainDevice = EventDomainKey.String("device") + // Events from Kubernetes + EventDomainK8S = EventDomainKey.String("k8s") +) + +// EventName returns an attribute KeyValue conforming to the "event.name" +// semantic conventions. It represents the name identifies the event. +func EventName(val string) attribute.KeyValue { + return EventNameKey.String(val) +} + +// Span attributes used by AWS Lambda (in addition to general `faas` +// attributes). +const ( + // AWSLambdaInvokedARNKey is the attribute Key conforming to the + // "aws.lambda.invoked_arn" semantic conventions. It represents the full + // invoked ARN as provided on the `Context` passed to the function + // (`Lambda-Runtime-Invoked-Function-ARN` header on the + // `/runtime/invocation/next` applicable). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias' + // Note: This may be different from `faas.id` if an alias is involved. + AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn") +) + +// AWSLambdaInvokedARN returns an attribute KeyValue conforming to the +// "aws.lambda.invoked_arn" semantic conventions. It represents the full +// invoked ARN as provided on the `Context` passed to the function +// (`Lambda-Runtime-Invoked-Function-ARN` header on the +// `/runtime/invocation/next` applicable). +func AWSLambdaInvokedARN(val string) attribute.KeyValue { + return AWSLambdaInvokedARNKey.String(val) +} + +// Attributes for CloudEvents. CloudEvents is a specification on how to define +// event data in a standard way. These attributes can be attached to spans when +// performing operations with CloudEvents, regardless of the protocol being +// used. +const ( + // CloudeventsEventIDKey is the attribute Key conforming to the + // "cloudevents.event_id" semantic conventions. It represents the + // [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) + // uniquely identifies the event. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: '123e4567-e89b-12d3-a456-426614174000', '0001' + CloudeventsEventIDKey = attribute.Key("cloudevents.event_id") + + // CloudeventsEventSourceKey is the attribute Key conforming to the + // "cloudevents.event_source" semantic conventions. It represents the + // [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) + // identifies the context in which an event happened. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'https://github.com/cloudevents', + // '/cloudevents/spec/pull/123', 'my-service' + CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source") + + // CloudeventsEventSpecVersionKey is the attribute Key conforming to the + // "cloudevents.event_spec_version" semantic conventions. It represents the + // [version of the CloudEvents + // specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) + // which the event uses. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '1.0' + CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version") + + // CloudeventsEventTypeKey is the attribute Key conforming to the + // "cloudevents.event_type" semantic conventions. It represents the + // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) + // contains a value describing the type of event related to the originating + // occurrence. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'com.github.pull_request.opened', + // 'com.example.object.deleted.v2' + CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type") + + // CloudeventsEventSubjectKey is the attribute Key conforming to the + // "cloudevents.event_subject" semantic conventions. It represents the + // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) + // of the event in the context of the event producer (identified by + // source). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'mynewfile.jpg' + CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject") +) + +// CloudeventsEventID returns an attribute KeyValue conforming to the +// "cloudevents.event_id" semantic conventions. It represents the +// [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) +// uniquely identifies the event. +func CloudeventsEventID(val string) attribute.KeyValue { + return CloudeventsEventIDKey.String(val) +} + +// CloudeventsEventSource returns an attribute KeyValue conforming to the +// "cloudevents.event_source" semantic conventions. It represents the +// [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) +// identifies the context in which an event happened. +func CloudeventsEventSource(val string) attribute.KeyValue { + return CloudeventsEventSourceKey.String(val) +} + +// CloudeventsEventSpecVersion returns an attribute KeyValue conforming to +// the "cloudevents.event_spec_version" semantic conventions. It represents the +// [version of the CloudEvents +// specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) +// which the event uses. +func CloudeventsEventSpecVersion(val string) attribute.KeyValue { + return CloudeventsEventSpecVersionKey.String(val) +} + +// CloudeventsEventType returns an attribute KeyValue conforming to the +// "cloudevents.event_type" semantic conventions. It represents the +// [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) +// contains a value describing the type of event related to the originating +// occurrence. +func CloudeventsEventType(val string) attribute.KeyValue { + return CloudeventsEventTypeKey.String(val) +} + +// CloudeventsEventSubject returns an attribute KeyValue conforming to the +// "cloudevents.event_subject" semantic conventions. It represents the +// [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) +// of the event in the context of the event producer (identified by source). +func CloudeventsEventSubject(val string) attribute.KeyValue { + return CloudeventsEventSubjectKey.String(val) +} + +// Semantic conventions for the OpenTracing Shim +const ( + // OpentracingRefTypeKey is the attribute Key conforming to the + // "opentracing.ref_type" semantic conventions. It represents the + // parent-child Reference type + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Note: The causal relationship between a child Span and a parent Span. + OpentracingRefTypeKey = attribute.Key("opentracing.ref_type") +) + +var ( + // The parent Span depends on the child Span in some capacity + OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of") + // The parent Span does not depend in any way on the result of the child Span + OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from") +) + +// The attributes used to perform database client calls. +const ( + // DBSystemKey is the attribute Key conforming to the "db.system" semantic + // conventions. It represents an identifier for the database management + // system (DBMS) product being used. See below for a list of well-known + // identifiers. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + DBSystemKey = attribute.Key("db.system") + + // DBConnectionStringKey is the attribute Key conforming to the + // "db.connection_string" semantic conventions. It represents the + // connection string used to connect to the database. It is recommended to + // remove embedded credentials. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Server=(localdb)\\v11.0;Integrated Security=true;' + DBConnectionStringKey = attribute.Key("db.connection_string") + + // DBUserKey is the attribute Key conforming to the "db.user" semantic + // conventions. It represents the username for accessing the database. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'readonly_user', 'reporting_user' + DBUserKey = attribute.Key("db.user") + + // DBJDBCDriverClassnameKey is the attribute Key conforming to the + // "db.jdbc.driver_classname" semantic conventions. It represents the + // fully-qualified class name of the [Java Database Connectivity + // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) + // driver used to connect. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'org.postgresql.Driver', + // 'com.microsoft.sqlserver.jdbc.SQLServerDriver' + DBJDBCDriverClassnameKey = attribute.Key("db.jdbc.driver_classname") + + // DBNameKey is the attribute Key conforming to the "db.name" semantic + // conventions. It represents the this attribute is used to report the name + // of the database being accessed. For commands that switch the database, + // this should be set to the target database (even if the command fails). + // + // Type: string + // RequirementLevel: ConditionallyRequired (If applicable.) + // Stability: stable + // Examples: 'customers', 'main' + // Note: In some SQL databases, the database name to be used is called + // "schema name". In case there are multiple layers that could be + // considered for database name (e.g. Oracle instance name and schema + // name), the database name to be used is the more specific layer (e.g. + // Oracle schema name). + DBNameKey = attribute.Key("db.name") + + // DBStatementKey is the attribute Key conforming to the "db.statement" + // semantic conventions. It represents the database statement being + // executed. + // + // Type: string + // RequirementLevel: ConditionallyRequired (If applicable and not + // explicitly disabled via instrumentation configuration.) + // Stability: stable + // Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"' + // Note: The value may be sanitized to exclude sensitive information. + DBStatementKey = attribute.Key("db.statement") + + // DBOperationKey is the attribute Key conforming to the "db.operation" + // semantic conventions. It represents the name of the operation being + // executed, e.g. the [MongoDB command + // name](https://docs.mongodb.com/manual/reference/command/#database-operations) + // such as `findAndModify`, or the SQL keyword. + // + // Type: string + // RequirementLevel: ConditionallyRequired (If `db.statement` is not + // applicable.) + // Stability: stable + // Examples: 'findAndModify', 'HMSET', 'SELECT' + // Note: When setting this to an SQL keyword, it is not recommended to + // attempt any client-side parsing of `db.statement` just to get this + // property, but it should be set if the operation name is provided by the + // library being instrumented. If the SQL statement has an ambiguous + // operation, or performs more than one operation, this value may be + // omitted. + DBOperationKey = attribute.Key("db.operation") +) + +var ( + // Some other SQL database. Fallback only. See notes + DBSystemOtherSQL = DBSystemKey.String("other_sql") + // Microsoft SQL Server + DBSystemMSSQL = DBSystemKey.String("mssql") + // MySQL + DBSystemMySQL = DBSystemKey.String("mysql") + // Oracle Database + DBSystemOracle = DBSystemKey.String("oracle") + // IBM DB2 + DBSystemDB2 = DBSystemKey.String("db2") + // PostgreSQL + DBSystemPostgreSQL = DBSystemKey.String("postgresql") + // Amazon Redshift + DBSystemRedshift = DBSystemKey.String("redshift") + // Apache Hive + DBSystemHive = DBSystemKey.String("hive") + // Cloudscape + DBSystemCloudscape = DBSystemKey.String("cloudscape") + // HyperSQL DataBase + DBSystemHSQLDB = DBSystemKey.String("hsqldb") + // Progress Database + DBSystemProgress = DBSystemKey.String("progress") + // SAP MaxDB + DBSystemMaxDB = DBSystemKey.String("maxdb") + // SAP HANA + DBSystemHanaDB = DBSystemKey.String("hanadb") + // Ingres + DBSystemIngres = DBSystemKey.String("ingres") + // FirstSQL + DBSystemFirstSQL = DBSystemKey.String("firstsql") + // EnterpriseDB + DBSystemEDB = DBSystemKey.String("edb") + // InterSystems Caché + DBSystemCache = DBSystemKey.String("cache") + // Adabas (Adaptable Database System) + DBSystemAdabas = DBSystemKey.String("adabas") + // Firebird + DBSystemFirebird = DBSystemKey.String("firebird") + // Apache Derby + DBSystemDerby = DBSystemKey.String("derby") + // FileMaker + DBSystemFilemaker = DBSystemKey.String("filemaker") + // Informix + DBSystemInformix = DBSystemKey.String("informix") + // InstantDB + DBSystemInstantDB = DBSystemKey.String("instantdb") + // InterBase + DBSystemInterbase = DBSystemKey.String("interbase") + // MariaDB + DBSystemMariaDB = DBSystemKey.String("mariadb") + // Netezza + DBSystemNetezza = DBSystemKey.String("netezza") + // Pervasive PSQL + DBSystemPervasive = DBSystemKey.String("pervasive") + // PointBase + DBSystemPointbase = DBSystemKey.String("pointbase") + // SQLite + DBSystemSqlite = DBSystemKey.String("sqlite") + // Sybase + DBSystemSybase = DBSystemKey.String("sybase") + // Teradata + DBSystemTeradata = DBSystemKey.String("teradata") + // Vertica + DBSystemVertica = DBSystemKey.String("vertica") + // H2 + DBSystemH2 = DBSystemKey.String("h2") + // ColdFusion IMQ + DBSystemColdfusion = DBSystemKey.String("coldfusion") + // Apache Cassandra + DBSystemCassandra = DBSystemKey.String("cassandra") + // Apache HBase + DBSystemHBase = DBSystemKey.String("hbase") + // MongoDB + DBSystemMongoDB = DBSystemKey.String("mongodb") + // Redis + DBSystemRedis = DBSystemKey.String("redis") + // Couchbase + DBSystemCouchbase = DBSystemKey.String("couchbase") + // CouchDB + DBSystemCouchDB = DBSystemKey.String("couchdb") + // Microsoft Azure Cosmos DB + DBSystemCosmosDB = DBSystemKey.String("cosmosdb") + // Amazon DynamoDB + DBSystemDynamoDB = DBSystemKey.String("dynamodb") + // Neo4j + DBSystemNeo4j = DBSystemKey.String("neo4j") + // Apache Geode + DBSystemGeode = DBSystemKey.String("geode") + // Elasticsearch + DBSystemElasticsearch = DBSystemKey.String("elasticsearch") + // Memcached + DBSystemMemcached = DBSystemKey.String("memcached") + // CockroachDB + DBSystemCockroachdb = DBSystemKey.String("cockroachdb") + // OpenSearch + DBSystemOpensearch = DBSystemKey.String("opensearch") + // ClickHouse + DBSystemClickhouse = DBSystemKey.String("clickhouse") +) + +// DBConnectionString returns an attribute KeyValue conforming to the +// "db.connection_string" semantic conventions. It represents the connection +// string used to connect to the database. It is recommended to remove embedded +// credentials. +func DBConnectionString(val string) attribute.KeyValue { + return DBConnectionStringKey.String(val) +} + +// DBUser returns an attribute KeyValue conforming to the "db.user" semantic +// conventions. It represents the username for accessing the database. +func DBUser(val string) attribute.KeyValue { + return DBUserKey.String(val) +} + +// DBJDBCDriverClassname returns an attribute KeyValue conforming to the +// "db.jdbc.driver_classname" semantic conventions. It represents the +// fully-qualified class name of the [Java Database Connectivity +// (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver +// used to connect. +func DBJDBCDriverClassname(val string) attribute.KeyValue { + return DBJDBCDriverClassnameKey.String(val) +} + +// DBName returns an attribute KeyValue conforming to the "db.name" semantic +// conventions. It represents the this attribute is used to report the name of +// the database being accessed. For commands that switch the database, this +// should be set to the target database (even if the command fails). +func DBName(val string) attribute.KeyValue { + return DBNameKey.String(val) +} + +// DBStatement returns an attribute KeyValue conforming to the +// "db.statement" semantic conventions. It represents the database statement +// being executed. +func DBStatement(val string) attribute.KeyValue { + return DBStatementKey.String(val) +} + +// DBOperation returns an attribute KeyValue conforming to the +// "db.operation" semantic conventions. It represents the name of the operation +// being executed, e.g. the [MongoDB command +// name](https://docs.mongodb.com/manual/reference/command/#database-operations) +// such as `findAndModify`, or the SQL keyword. +func DBOperation(val string) attribute.KeyValue { + return DBOperationKey.String(val) +} + +// Connection-level attributes for Microsoft SQL Server +const ( + // DBMSSQLInstanceNameKey is the attribute Key conforming to the + // "db.mssql.instance_name" semantic conventions. It represents the + // Microsoft SQL Server [instance + // name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) + // connecting to. This name is used to determine the port of a named + // instance. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'MSSQLSERVER' + // Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no + // longer required (but still recommended if non-standard). + DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name") +) + +// DBMSSQLInstanceName returns an attribute KeyValue conforming to the +// "db.mssql.instance_name" semantic conventions. It represents the Microsoft +// SQL Server [instance +// name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) +// connecting to. This name is used to determine the port of a named instance. +func DBMSSQLInstanceName(val string) attribute.KeyValue { + return DBMSSQLInstanceNameKey.String(val) +} + +// Call-level attributes for Cassandra +const ( + // DBCassandraPageSizeKey is the attribute Key conforming to the + // "db.cassandra.page_size" semantic conventions. It represents the fetch + // size used for paging, i.e. how many rows will be returned at once. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 5000 + DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size") + + // DBCassandraConsistencyLevelKey is the attribute Key conforming to the + // "db.cassandra.consistency_level" semantic conventions. It represents the + // consistency level of the query. Based on consistency values from + // [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level") + + // DBCassandraTableKey is the attribute Key conforming to the + // "db.cassandra.table" semantic conventions. It represents the name of the + // primary table that the operation is acting upon, including the keyspace + // name (if applicable). + // + // Type: string + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'mytable' + // Note: This mirrors the db.sql.table attribute but references cassandra + // rather than sql. It is not recommended to attempt any client-side + // parsing of `db.statement` just to get this property, but it should be + // set if it is provided by the library being instrumented. If the + // operation is acting upon an anonymous table, or more than one table, + // this value MUST NOT be set. + DBCassandraTableKey = attribute.Key("db.cassandra.table") + + // DBCassandraIdempotenceKey is the attribute Key conforming to the + // "db.cassandra.idempotence" semantic conventions. It represents the + // whether or not the query is idempotent. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence") + + // DBCassandraSpeculativeExecutionCountKey is the attribute Key conforming + // to the "db.cassandra.speculative_execution_count" semantic conventions. + // It represents the number of times a query was speculatively executed. + // Not set or `0` if the query was not executed speculatively. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 0, 2 + DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count") + + // DBCassandraCoordinatorIDKey is the attribute Key conforming to the + // "db.cassandra.coordinator.id" semantic conventions. It represents the ID + // of the coordinating node for a query. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af' + DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id") + + // DBCassandraCoordinatorDCKey is the attribute Key conforming to the + // "db.cassandra.coordinator.dc" semantic conventions. It represents the + // data center of the coordinating node for a query. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'us-west-2' + DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc") +) + +var ( + // all + DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all") + // each_quorum + DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum") + // quorum + DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum") + // local_quorum + DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum") + // one + DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one") + // two + DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two") + // three + DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three") + // local_one + DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one") + // any + DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any") + // serial + DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial") + // local_serial + DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial") +) + +// DBCassandraPageSize returns an attribute KeyValue conforming to the +// "db.cassandra.page_size" semantic conventions. It represents the fetch size +// used for paging, i.e. how many rows will be returned at once. +func DBCassandraPageSize(val int) attribute.KeyValue { + return DBCassandraPageSizeKey.Int(val) +} + +// DBCassandraTable returns an attribute KeyValue conforming to the +// "db.cassandra.table" semantic conventions. It represents the name of the +// primary table that the operation is acting upon, including the keyspace name +// (if applicable). +func DBCassandraTable(val string) attribute.KeyValue { + return DBCassandraTableKey.String(val) +} + +// DBCassandraIdempotence returns an attribute KeyValue conforming to the +// "db.cassandra.idempotence" semantic conventions. It represents the whether +// or not the query is idempotent. +func DBCassandraIdempotence(val bool) attribute.KeyValue { + return DBCassandraIdempotenceKey.Bool(val) +} + +// DBCassandraSpeculativeExecutionCount returns an attribute KeyValue +// conforming to the "db.cassandra.speculative_execution_count" semantic +// conventions. It represents the number of times a query was speculatively +// executed. Not set or `0` if the query was not executed speculatively. +func DBCassandraSpeculativeExecutionCount(val int) attribute.KeyValue { + return DBCassandraSpeculativeExecutionCountKey.Int(val) +} + +// DBCassandraCoordinatorID returns an attribute KeyValue conforming to the +// "db.cassandra.coordinator.id" semantic conventions. It represents the ID of +// the coordinating node for a query. +func DBCassandraCoordinatorID(val string) attribute.KeyValue { + return DBCassandraCoordinatorIDKey.String(val) +} + +// DBCassandraCoordinatorDC returns an attribute KeyValue conforming to the +// "db.cassandra.coordinator.dc" semantic conventions. It represents the data +// center of the coordinating node for a query. +func DBCassandraCoordinatorDC(val string) attribute.KeyValue { + return DBCassandraCoordinatorDCKey.String(val) +} + +// Call-level attributes for Redis +const ( + // DBRedisDBIndexKey is the attribute Key conforming to the + // "db.redis.database_index" semantic conventions. It represents the index + // of the database being accessed as used in the [`SELECT` + // command](https://redis.io/commands/select), provided as an integer. To + // be used instead of the generic `db.name` attribute. + // + // Type: int + // RequirementLevel: ConditionallyRequired (If other than the default + // database (`0`).) + // Stability: stable + // Examples: 0, 1, 15 + DBRedisDBIndexKey = attribute.Key("db.redis.database_index") +) + +// DBRedisDBIndex returns an attribute KeyValue conforming to the +// "db.redis.database_index" semantic conventions. It represents the index of +// the database being accessed as used in the [`SELECT` +// command](https://redis.io/commands/select), provided as an integer. To be +// used instead of the generic `db.name` attribute. +func DBRedisDBIndex(val int) attribute.KeyValue { + return DBRedisDBIndexKey.Int(val) +} + +// Call-level attributes for MongoDB +const ( + // DBMongoDBCollectionKey is the attribute Key conforming to the + // "db.mongodb.collection" semantic conventions. It represents the + // collection being accessed within the database stated in `db.name`. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'customers', 'products' + DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection") +) + +// DBMongoDBCollection returns an attribute KeyValue conforming to the +// "db.mongodb.collection" semantic conventions. It represents the collection +// being accessed within the database stated in `db.name`. +func DBMongoDBCollection(val string) attribute.KeyValue { + return DBMongoDBCollectionKey.String(val) +} + +// Call-level attributes for SQL databases +const ( + // DBSQLTableKey is the attribute Key conforming to the "db.sql.table" + // semantic conventions. It represents the name of the primary table that + // the operation is acting upon, including the database name (if + // applicable). + // + // Type: string + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'public.users', 'customers' + // Note: It is not recommended to attempt any client-side parsing of + // `db.statement` just to get this property, but it should be set if it is + // provided by the library being instrumented. If the operation is acting + // upon an anonymous table, or more than one table, this value MUST NOT be + // set. + DBSQLTableKey = attribute.Key("db.sql.table") +) + +// DBSQLTable returns an attribute KeyValue conforming to the "db.sql.table" +// semantic conventions. It represents the name of the primary table that the +// operation is acting upon, including the database name (if applicable). +func DBSQLTable(val string) attribute.KeyValue { + return DBSQLTableKey.String(val) +} + +// Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's +// concepts. +const ( + // OtelStatusCodeKey is the attribute Key conforming to the + // "otel.status_code" semantic conventions. It represents the name of the + // code, either "OK" or "ERROR". MUST NOT be set if the status code is + // UNSET. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + OtelStatusCodeKey = attribute.Key("otel.status_code") + + // OtelStatusDescriptionKey is the attribute Key conforming to the + // "otel.status_description" semantic conventions. It represents the + // description of the Status if it has a value, otherwise not set. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'resource not found' + OtelStatusDescriptionKey = attribute.Key("otel.status_description") +) + +var ( + // The operation has been validated by an Application developer or Operator to have completed successfully + OtelStatusCodeOk = OtelStatusCodeKey.String("OK") + // The operation contains an error + OtelStatusCodeError = OtelStatusCodeKey.String("ERROR") +) + +// OtelStatusDescription returns an attribute KeyValue conforming to the +// "otel.status_description" semantic conventions. It represents the +// description of the Status if it has a value, otherwise not set. +func OtelStatusDescription(val string) attribute.KeyValue { + return OtelStatusDescriptionKey.String(val) +} + +// This semantic convention describes an instance of a function that runs +// without provisioning or managing of servers (also known as serverless +// functions or Function as a Service (FaaS)) with spans. +const ( + // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger" + // semantic conventions. It represents the type of the trigger which caused + // this function execution. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Note: For the server/consumer span on the incoming side, + // `faas.trigger` MUST be set. + // + // Clients invoking FaaS instances usually cannot set `faas.trigger`, + // since they would typically need to look in the payload to determine + // the event type. If clients set it, it should be the same as the + // trigger that corresponding incoming would have (i.e., this has + // nothing to do with the underlying transport used to make the API + // call to invoke the lambda, which is often HTTP). + FaaSTriggerKey = attribute.Key("faas.trigger") + + // FaaSExecutionKey is the attribute Key conforming to the "faas.execution" + // semantic conventions. It represents the execution ID of the current + // function execution. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28' + FaaSExecutionKey = attribute.Key("faas.execution") +) + +var ( + // A response to some data source operation such as a database or filesystem read/write + FaaSTriggerDatasource = FaaSTriggerKey.String("datasource") + // To provide an answer to an inbound HTTP request + FaaSTriggerHTTP = FaaSTriggerKey.String("http") + // A function is set to be executed when messages are sent to a messaging system + FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub") + // A function is scheduled to be executed regularly + FaaSTriggerTimer = FaaSTriggerKey.String("timer") + // If none of the others apply + FaaSTriggerOther = FaaSTriggerKey.String("other") +) + +// FaaSExecution returns an attribute KeyValue conforming to the +// "faas.execution" semantic conventions. It represents the execution ID of the +// current function execution. +func FaaSExecution(val string) attribute.KeyValue { + return FaaSExecutionKey.String(val) +} + +// Semantic Convention for FaaS triggered as a response to some data source +// operation such as a database or filesystem read/write. +const ( + // FaaSDocumentCollectionKey is the attribute Key conforming to the + // "faas.document.collection" semantic conventions. It represents the name + // of the source on which the triggering operation was performed. For + // example, in Cloud Storage or S3 corresponds to the bucket name, and in + // Cosmos DB to the database name. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'myBucketName', 'myDBName' + FaaSDocumentCollectionKey = attribute.Key("faas.document.collection") + + // FaaSDocumentOperationKey is the attribute Key conforming to the + // "faas.document.operation" semantic conventions. It represents the + // describes the type of the operation that was performed on the data. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + FaaSDocumentOperationKey = attribute.Key("faas.document.operation") + + // FaaSDocumentTimeKey is the attribute Key conforming to the + // "faas.document.time" semantic conventions. It represents a string + // containing the time when the data was accessed in the [ISO + // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format + // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '2020-01-23T13:47:06Z' + FaaSDocumentTimeKey = attribute.Key("faas.document.time") + + // FaaSDocumentNameKey is the attribute Key conforming to the + // "faas.document.name" semantic conventions. It represents the document + // name/table subjected to the operation. For example, in Cloud Storage or + // S3 is the name of the file, and in Cosmos DB the table name. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'myFile.txt', 'myTableName' + FaaSDocumentNameKey = attribute.Key("faas.document.name") +) + +var ( + // When a new object is created + FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert") + // When an object is modified + FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit") + // When an object is deleted + FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete") +) + +// FaaSDocumentCollection returns an attribute KeyValue conforming to the +// "faas.document.collection" semantic conventions. It represents the name of +// the source on which the triggering operation was performed. For example, in +// Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the +// database name. +func FaaSDocumentCollection(val string) attribute.KeyValue { + return FaaSDocumentCollectionKey.String(val) +} + +// FaaSDocumentTime returns an attribute KeyValue conforming to the +// "faas.document.time" semantic conventions. It represents a string containing +// the time when the data was accessed in the [ISO +// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format +// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +func FaaSDocumentTime(val string) attribute.KeyValue { + return FaaSDocumentTimeKey.String(val) +} + +// FaaSDocumentName returns an attribute KeyValue conforming to the +// "faas.document.name" semantic conventions. It represents the document +// name/table subjected to the operation. For example, in Cloud Storage or S3 +// is the name of the file, and in Cosmos DB the table name. +func FaaSDocumentName(val string) attribute.KeyValue { + return FaaSDocumentNameKey.String(val) +} + +// Semantic Convention for FaaS scheduled to be executed regularly. +const ( + // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic + // conventions. It represents a string containing the function invocation + // time in the [ISO + // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format + // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '2020-01-23T13:47:06Z' + FaaSTimeKey = attribute.Key("faas.time") + + // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic + // conventions. It represents a string containing the schedule period as + // [Cron + // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '0/5 * * * ? *' + FaaSCronKey = attribute.Key("faas.cron") +) + +// FaaSTime returns an attribute KeyValue conforming to the "faas.time" +// semantic conventions. It represents a string containing the function +// invocation time in the [ISO +// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format +// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +func FaaSTime(val string) attribute.KeyValue { + return FaaSTimeKey.String(val) +} + +// FaaSCron returns an attribute KeyValue conforming to the "faas.cron" +// semantic conventions. It represents a string containing the schedule period +// as [Cron +// Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). +func FaaSCron(val string) attribute.KeyValue { + return FaaSCronKey.String(val) +} + +// Contains additional attributes for incoming FaaS spans. +const ( + // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart" + // semantic conventions. It represents a boolean that is true if the + // serverless function is executed for the first time (aka cold-start). + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + FaaSColdstartKey = attribute.Key("faas.coldstart") +) + +// FaaSColdstart returns an attribute KeyValue conforming to the +// "faas.coldstart" semantic conventions. It represents a boolean that is true +// if the serverless function is executed for the first time (aka cold-start). +func FaaSColdstart(val bool) attribute.KeyValue { + return FaaSColdstartKey.Bool(val) +} + +// Contains additional attributes for outgoing FaaS spans. +const ( + // FaaSInvokedNameKey is the attribute Key conforming to the + // "faas.invoked_name" semantic conventions. It represents the name of the + // invoked function. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'my-function' + // Note: SHOULD be equal to the `faas.name` resource attribute of the + // invoked function. + FaaSInvokedNameKey = attribute.Key("faas.invoked_name") + + // FaaSInvokedProviderKey is the attribute Key conforming to the + // "faas.invoked_provider" semantic conventions. It represents the cloud + // provider of the invoked function. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + // Note: SHOULD be equal to the `cloud.provider` resource attribute of the + // invoked function. + FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider") + + // FaaSInvokedRegionKey is the attribute Key conforming to the + // "faas.invoked_region" semantic conventions. It represents the cloud + // region of the invoked function. + // + // Type: string + // RequirementLevel: ConditionallyRequired (For some cloud providers, like + // AWS or GCP, the region in which a function is hosted is essential to + // uniquely identify the function and also part of its endpoint. Since it's + // part of the endpoint being called, the region is always known to + // clients. In these cases, `faas.invoked_region` MUST be set accordingly. + // If the region is unknown to the client or not required for identifying + // the invoked function, setting `faas.invoked_region` is optional.) + // Stability: stable + // Examples: 'eu-central-1' + // Note: SHOULD be equal to the `cloud.region` resource attribute of the + // invoked function. + FaaSInvokedRegionKey = attribute.Key("faas.invoked_region") +) + +var ( + // Alibaba Cloud + FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud") + // Amazon Web Services + FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws") + // Microsoft Azure + FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure") + // Google Cloud Platform + FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp") + // Tencent Cloud + FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud") +) + +// FaaSInvokedName returns an attribute KeyValue conforming to the +// "faas.invoked_name" semantic conventions. It represents the name of the +// invoked function. +func FaaSInvokedName(val string) attribute.KeyValue { + return FaaSInvokedNameKey.String(val) +} + +// FaaSInvokedRegion returns an attribute KeyValue conforming to the +// "faas.invoked_region" semantic conventions. It represents the cloud region +// of the invoked function. +func FaaSInvokedRegion(val string) attribute.KeyValue { + return FaaSInvokedRegionKey.String(val) +} + +// These attributes may be used for any network related operation. +const ( + // NetTransportKey is the attribute Key conforming to the "net.transport" + // semantic conventions. It represents the transport protocol used. See + // note below. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + NetTransportKey = attribute.Key("net.transport") + + // NetAppProtocolNameKey is the attribute Key conforming to the + // "net.app.protocol.name" semantic conventions. It represents the + // application layer protocol used. The value SHOULD be normalized to + // lowercase. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'amqp', 'http', 'mqtt' + NetAppProtocolNameKey = attribute.Key("net.app.protocol.name") + + // NetAppProtocolVersionKey is the attribute Key conforming to the + // "net.app.protocol.version" semantic conventions. It represents the + // version of the application layer protocol used. See note below. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '3.1.1' + // Note: `net.app.protocol.version` refers to the version of the protocol + // used and might be different from the protocol client's version. If the + // HTTP client used has a version of `0.27.2`, but sends HTTP version + // `1.1`, this attribute should be set to `1.1`. + NetAppProtocolVersionKey = attribute.Key("net.app.protocol.version") + + // NetSockPeerNameKey is the attribute Key conforming to the + // "net.sock.peer.name" semantic conventions. It represents the remote + // socket peer name. + // + // Type: string + // RequirementLevel: Recommended (If available and different from + // `net.peer.name` and if `net.sock.peer.addr` is set.) + // Stability: stable + // Examples: 'proxy.example.com' + NetSockPeerNameKey = attribute.Key("net.sock.peer.name") + + // NetSockPeerAddrKey is the attribute Key conforming to the + // "net.sock.peer.addr" semantic conventions. It represents the remote + // socket peer address: IPv4 or IPv6 for internet protocols, path for local + // communication, + // [etc](https://man7.org/linux/man-pages/man7/address_families.7.html). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '127.0.0.1', '/tmp/mysql.sock' + NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr") + + // NetSockPeerPortKey is the attribute Key conforming to the + // "net.sock.peer.port" semantic conventions. It represents the remote + // socket peer port. + // + // Type: int + // RequirementLevel: Recommended (If defined for the address family and if + // different than `net.peer.port` and if `net.sock.peer.addr` is set.) + // Stability: stable + // Examples: 16456 + NetSockPeerPortKey = attribute.Key("net.sock.peer.port") + + // NetSockFamilyKey is the attribute Key conforming to the + // "net.sock.family" semantic conventions. It represents the protocol + // [address + // family](https://man7.org/linux/man-pages/man7/address_families.7.html) + // which is used for communication. + // + // Type: Enum + // RequirementLevel: ConditionallyRequired (If different than `inet` and if + // any of `net.sock.peer.addr` or `net.sock.host.addr` are set. Consumers + // of telemetry SHOULD accept both IPv4 and IPv6 formats for the address in + // `net.sock.peer.addr` if `net.sock.family` is not set. This is to support + // instrumentations that follow previous versions of this document.) + // Stability: stable + // Examples: 'inet6', 'bluetooth' + NetSockFamilyKey = attribute.Key("net.sock.family") + + // NetPeerNameKey is the attribute Key conforming to the "net.peer.name" + // semantic conventions. It represents the logical remote hostname, see + // note below. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'example.com' + // Note: `net.peer.name` SHOULD NOT be set if capturing it would require an + // extra DNS lookup. + NetPeerNameKey = attribute.Key("net.peer.name") + + // NetPeerPortKey is the attribute Key conforming to the "net.peer.port" + // semantic conventions. It represents the logical remote port number + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 80, 8080, 443 + NetPeerPortKey = attribute.Key("net.peer.port") + + // NetHostNameKey is the attribute Key conforming to the "net.host.name" + // semantic conventions. It represents the logical local hostname or + // similar, see note below. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'localhost' + NetHostNameKey = attribute.Key("net.host.name") + + // NetHostPortKey is the attribute Key conforming to the "net.host.port" + // semantic conventions. It represents the logical local port number, + // preferably the one that the peer used to connect + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 8080 + NetHostPortKey = attribute.Key("net.host.port") + + // NetSockHostAddrKey is the attribute Key conforming to the + // "net.sock.host.addr" semantic conventions. It represents the local + // socket address. Useful in case of a multi-IP host. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '192.168.0.1' + NetSockHostAddrKey = attribute.Key("net.sock.host.addr") + + // NetSockHostPortKey is the attribute Key conforming to the + // "net.sock.host.port" semantic conventions. It represents the local + // socket port number. + // + // Type: int + // RequirementLevel: Recommended (If defined for the address family and if + // different than `net.host.port` and if `net.sock.host.addr` is set.) + // Stability: stable + // Examples: 35555 + NetSockHostPortKey = attribute.Key("net.sock.host.port") + + // NetHostConnectionTypeKey is the attribute Key conforming to the + // "net.host.connection.type" semantic conventions. It represents the + // internet connection type currently being used by the host. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Examples: 'wifi' + NetHostConnectionTypeKey = attribute.Key("net.host.connection.type") + + // NetHostConnectionSubtypeKey is the attribute Key conforming to the + // "net.host.connection.subtype" semantic conventions. It represents the + // this describes more details regarding the connection.type. It may be the + // type of cell technology connection, but it could be used for describing + // details about a wifi connection. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Examples: 'LTE' + NetHostConnectionSubtypeKey = attribute.Key("net.host.connection.subtype") + + // NetHostCarrierNameKey is the attribute Key conforming to the + // "net.host.carrier.name" semantic conventions. It represents the name of + // the mobile carrier. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'sprint' + NetHostCarrierNameKey = attribute.Key("net.host.carrier.name") + + // NetHostCarrierMccKey is the attribute Key conforming to the + // "net.host.carrier.mcc" semantic conventions. It represents the mobile + // carrier country code. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '310' + NetHostCarrierMccKey = attribute.Key("net.host.carrier.mcc") + + // NetHostCarrierMncKey is the attribute Key conforming to the + // "net.host.carrier.mnc" semantic conventions. It represents the mobile + // carrier network code. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '001' + NetHostCarrierMncKey = attribute.Key("net.host.carrier.mnc") + + // NetHostCarrierIccKey is the attribute Key conforming to the + // "net.host.carrier.icc" semantic conventions. It represents the ISO + // 3166-1 alpha-2 2-character country code associated with the mobile + // carrier network. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'DE' + NetHostCarrierIccKey = attribute.Key("net.host.carrier.icc") +) + +var ( + // ip_tcp + NetTransportTCP = NetTransportKey.String("ip_tcp") + // ip_udp + NetTransportUDP = NetTransportKey.String("ip_udp") + // Named or anonymous pipe. See note below + NetTransportPipe = NetTransportKey.String("pipe") + // In-process communication + NetTransportInProc = NetTransportKey.String("inproc") + // Something else (non IP-based) + NetTransportOther = NetTransportKey.String("other") +) + +var ( + // IPv4 address + NetSockFamilyInet = NetSockFamilyKey.String("inet") + // IPv6 address + NetSockFamilyInet6 = NetSockFamilyKey.String("inet6") + // Unix domain socket path + NetSockFamilyUnix = NetSockFamilyKey.String("unix") +) + +var ( + // wifi + NetHostConnectionTypeWifi = NetHostConnectionTypeKey.String("wifi") + // wired + NetHostConnectionTypeWired = NetHostConnectionTypeKey.String("wired") + // cell + NetHostConnectionTypeCell = NetHostConnectionTypeKey.String("cell") + // unavailable + NetHostConnectionTypeUnavailable = NetHostConnectionTypeKey.String("unavailable") + // unknown + NetHostConnectionTypeUnknown = NetHostConnectionTypeKey.String("unknown") +) + +var ( + // GPRS + NetHostConnectionSubtypeGprs = NetHostConnectionSubtypeKey.String("gprs") + // EDGE + NetHostConnectionSubtypeEdge = NetHostConnectionSubtypeKey.String("edge") + // UMTS + NetHostConnectionSubtypeUmts = NetHostConnectionSubtypeKey.String("umts") + // CDMA + NetHostConnectionSubtypeCdma = NetHostConnectionSubtypeKey.String("cdma") + // EVDO Rel. 0 + NetHostConnectionSubtypeEvdo0 = NetHostConnectionSubtypeKey.String("evdo_0") + // EVDO Rev. A + NetHostConnectionSubtypeEvdoA = NetHostConnectionSubtypeKey.String("evdo_a") + // CDMA2000 1XRTT + NetHostConnectionSubtypeCdma20001xrtt = NetHostConnectionSubtypeKey.String("cdma2000_1xrtt") + // HSDPA + NetHostConnectionSubtypeHsdpa = NetHostConnectionSubtypeKey.String("hsdpa") + // HSUPA + NetHostConnectionSubtypeHsupa = NetHostConnectionSubtypeKey.String("hsupa") + // HSPA + NetHostConnectionSubtypeHspa = NetHostConnectionSubtypeKey.String("hspa") + // IDEN + NetHostConnectionSubtypeIden = NetHostConnectionSubtypeKey.String("iden") + // EVDO Rev. B + NetHostConnectionSubtypeEvdoB = NetHostConnectionSubtypeKey.String("evdo_b") + // LTE + NetHostConnectionSubtypeLte = NetHostConnectionSubtypeKey.String("lte") + // EHRPD + NetHostConnectionSubtypeEhrpd = NetHostConnectionSubtypeKey.String("ehrpd") + // HSPAP + NetHostConnectionSubtypeHspap = NetHostConnectionSubtypeKey.String("hspap") + // GSM + NetHostConnectionSubtypeGsm = NetHostConnectionSubtypeKey.String("gsm") + // TD-SCDMA + NetHostConnectionSubtypeTdScdma = NetHostConnectionSubtypeKey.String("td_scdma") + // IWLAN + NetHostConnectionSubtypeIwlan = NetHostConnectionSubtypeKey.String("iwlan") + // 5G NR (New Radio) + NetHostConnectionSubtypeNr = NetHostConnectionSubtypeKey.String("nr") + // 5G NRNSA (New Radio Non-Standalone) + NetHostConnectionSubtypeNrnsa = NetHostConnectionSubtypeKey.String("nrnsa") + // LTE CA + NetHostConnectionSubtypeLteCa = NetHostConnectionSubtypeKey.String("lte_ca") +) + +// NetAppProtocolName returns an attribute KeyValue conforming to the +// "net.app.protocol.name" semantic conventions. It represents the application +// layer protocol used. The value SHOULD be normalized to lowercase. +func NetAppProtocolName(val string) attribute.KeyValue { + return NetAppProtocolNameKey.String(val) +} + +// NetAppProtocolVersion returns an attribute KeyValue conforming to the +// "net.app.protocol.version" semantic conventions. It represents the version +// of the application layer protocol used. See note below. +func NetAppProtocolVersion(val string) attribute.KeyValue { + return NetAppProtocolVersionKey.String(val) +} + +// NetSockPeerName returns an attribute KeyValue conforming to the +// "net.sock.peer.name" semantic conventions. It represents the remote socket +// peer name. +func NetSockPeerName(val string) attribute.KeyValue { + return NetSockPeerNameKey.String(val) +} + +// NetSockPeerAddr returns an attribute KeyValue conforming to the +// "net.sock.peer.addr" semantic conventions. It represents the remote socket +// peer address: IPv4 or IPv6 for internet protocols, path for local +// communication, +// [etc](https://man7.org/linux/man-pages/man7/address_families.7.html). +func NetSockPeerAddr(val string) attribute.KeyValue { + return NetSockPeerAddrKey.String(val) +} + +// NetSockPeerPort returns an attribute KeyValue conforming to the +// "net.sock.peer.port" semantic conventions. It represents the remote socket +// peer port. +func NetSockPeerPort(val int) attribute.KeyValue { + return NetSockPeerPortKey.Int(val) +} + +// NetPeerName returns an attribute KeyValue conforming to the +// "net.peer.name" semantic conventions. It represents the logical remote +// hostname, see note below. +func NetPeerName(val string) attribute.KeyValue { + return NetPeerNameKey.String(val) +} + +// NetPeerPort returns an attribute KeyValue conforming to the +// "net.peer.port" semantic conventions. It represents the logical remote port +// number +func NetPeerPort(val int) attribute.KeyValue { + return NetPeerPortKey.Int(val) +} + +// NetHostName returns an attribute KeyValue conforming to the +// "net.host.name" semantic conventions. It represents the logical local +// hostname or similar, see note below. +func NetHostName(val string) attribute.KeyValue { + return NetHostNameKey.String(val) +} + +// NetHostPort returns an attribute KeyValue conforming to the +// "net.host.port" semantic conventions. It represents the logical local port +// number, preferably the one that the peer used to connect +func NetHostPort(val int) attribute.KeyValue { + return NetHostPortKey.Int(val) +} + +// NetSockHostAddr returns an attribute KeyValue conforming to the +// "net.sock.host.addr" semantic conventions. It represents the local socket +// address. Useful in case of a multi-IP host. +func NetSockHostAddr(val string) attribute.KeyValue { + return NetSockHostAddrKey.String(val) +} + +// NetSockHostPort returns an attribute KeyValue conforming to the +// "net.sock.host.port" semantic conventions. It represents the local socket +// port number. +func NetSockHostPort(val int) attribute.KeyValue { + return NetSockHostPortKey.Int(val) +} + +// NetHostCarrierName returns an attribute KeyValue conforming to the +// "net.host.carrier.name" semantic conventions. It represents the name of the +// mobile carrier. +func NetHostCarrierName(val string) attribute.KeyValue { + return NetHostCarrierNameKey.String(val) +} + +// NetHostCarrierMcc returns an attribute KeyValue conforming to the +// "net.host.carrier.mcc" semantic conventions. It represents the mobile +// carrier country code. +func NetHostCarrierMcc(val string) attribute.KeyValue { + return NetHostCarrierMccKey.String(val) +} + +// NetHostCarrierMnc returns an attribute KeyValue conforming to the +// "net.host.carrier.mnc" semantic conventions. It represents the mobile +// carrier network code. +func NetHostCarrierMnc(val string) attribute.KeyValue { + return NetHostCarrierMncKey.String(val) +} + +// NetHostCarrierIcc returns an attribute KeyValue conforming to the +// "net.host.carrier.icc" semantic conventions. It represents the ISO 3166-1 +// alpha-2 2-character country code associated with the mobile carrier network. +func NetHostCarrierIcc(val string) attribute.KeyValue { + return NetHostCarrierIccKey.String(val) +} + +// Operations that access some remote service. +const ( + // PeerServiceKey is the attribute Key conforming to the "peer.service" + // semantic conventions. It represents the + // [`service.name`](../../resource/semantic_conventions/README.md#service) + // of the remote service. SHOULD be equal to the actual `service.name` + // resource attribute of the remote service if any. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'AuthTokenCache' + PeerServiceKey = attribute.Key("peer.service") +) + +// PeerService returns an attribute KeyValue conforming to the +// "peer.service" semantic conventions. It represents the +// [`service.name`](../../resource/semantic_conventions/README.md#service) of +// the remote service. SHOULD be equal to the actual `service.name` resource +// attribute of the remote service if any. +func PeerService(val string) attribute.KeyValue { + return PeerServiceKey.String(val) +} + +// These attributes may be used for any operation with an authenticated and/or +// authorized enduser. +const ( + // EnduserIDKey is the attribute Key conforming to the "enduser.id" + // semantic conventions. It represents the username or client_id extracted + // from the access token or + // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header + // in the inbound request from outside the system. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'username' + EnduserIDKey = attribute.Key("enduser.id") + + // EnduserRoleKey is the attribute Key conforming to the "enduser.role" + // semantic conventions. It represents the actual/assumed role the client + // is making the request under extracted from token or application security + // context. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'admin' + EnduserRoleKey = attribute.Key("enduser.role") + + // EnduserScopeKey is the attribute Key conforming to the "enduser.scope" + // semantic conventions. It represents the scopes or granted authorities + // the client currently possesses extracted from token or application + // security context. The value would come from the scope associated with an + // [OAuth 2.0 Access + // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute + // value in a [SAML 2.0 + // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'read:message, write:files' + EnduserScopeKey = attribute.Key("enduser.scope") +) + +// EnduserID returns an attribute KeyValue conforming to the "enduser.id" +// semantic conventions. It represents the username or client_id extracted from +// the access token or +// [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in +// the inbound request from outside the system. +func EnduserID(val string) attribute.KeyValue { + return EnduserIDKey.String(val) +} + +// EnduserRole returns an attribute KeyValue conforming to the +// "enduser.role" semantic conventions. It represents the actual/assumed role +// the client is making the request under extracted from token or application +// security context. +func EnduserRole(val string) attribute.KeyValue { + return EnduserRoleKey.String(val) +} + +// EnduserScope returns an attribute KeyValue conforming to the +// "enduser.scope" semantic conventions. It represents the scopes or granted +// authorities the client currently possesses extracted from token or +// application security context. The value would come from the scope associated +// with an [OAuth 2.0 Access +// Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute +// value in a [SAML 2.0 +// Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). +func EnduserScope(val string) attribute.KeyValue { + return EnduserScopeKey.String(val) +} + +// These attributes may be used for any operation to store information about a +// thread that started a span. +const ( + // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic + // conventions. It represents the current "managed" thread ID (as opposed + // to OS thread ID). + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 42 + ThreadIDKey = attribute.Key("thread.id") + + // ThreadNameKey is the attribute Key conforming to the "thread.name" + // semantic conventions. It represents the current thread name. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'main' + ThreadNameKey = attribute.Key("thread.name") +) + +// ThreadID returns an attribute KeyValue conforming to the "thread.id" +// semantic conventions. It represents the current "managed" thread ID (as +// opposed to OS thread ID). +func ThreadID(val int) attribute.KeyValue { + return ThreadIDKey.Int(val) +} + +// ThreadName returns an attribute KeyValue conforming to the "thread.name" +// semantic conventions. It represents the current thread name. +func ThreadName(val string) attribute.KeyValue { + return ThreadNameKey.String(val) +} + +// These attributes allow to report this unit of code and therefore to provide +// more context about the span. +const ( + // CodeFunctionKey is the attribute Key conforming to the "code.function" + // semantic conventions. It represents the method or function name, or + // equivalent (usually rightmost part of the code unit's name). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'serveRequest' + CodeFunctionKey = attribute.Key("code.function") + + // CodeNamespaceKey is the attribute Key conforming to the "code.namespace" + // semantic conventions. It represents the "namespace" within which + // `code.function` is defined. Usually the qualified class or module name, + // such that `code.namespace` + some separator + `code.function` form a + // unique identifier for the code unit. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'com.example.MyHTTPService' + CodeNamespaceKey = attribute.Key("code.namespace") + + // CodeFilepathKey is the attribute Key conforming to the "code.filepath" + // semantic conventions. It represents the source code file name that + // identifies the code unit as uniquely as possible (preferably an absolute + // file path). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '/usr/local/MyApplication/content_root/app/index.php' + CodeFilepathKey = attribute.Key("code.filepath") + + // CodeLineNumberKey is the attribute Key conforming to the "code.lineno" + // semantic conventions. It represents the line number in `code.filepath` + // best representing the operation. It SHOULD point within the code unit + // named in `code.function`. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 42 + CodeLineNumberKey = attribute.Key("code.lineno") + + // CodeColumnKey is the attribute Key conforming to the "code.column" + // semantic conventions. It represents the column number in `code.filepath` + // best representing the operation. It SHOULD point within the code unit + // named in `code.function`. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 16 + CodeColumnKey = attribute.Key("code.column") +) + +// CodeFunction returns an attribute KeyValue conforming to the +// "code.function" semantic conventions. It represents the method or function +// name, or equivalent (usually rightmost part of the code unit's name). +func CodeFunction(val string) attribute.KeyValue { + return CodeFunctionKey.String(val) +} + +// CodeNamespace returns an attribute KeyValue conforming to the +// "code.namespace" semantic conventions. It represents the "namespace" within +// which `code.function` is defined. Usually the qualified class or module +// name, such that `code.namespace` + some separator + `code.function` form a +// unique identifier for the code unit. +func CodeNamespace(val string) attribute.KeyValue { + return CodeNamespaceKey.String(val) +} + +// CodeFilepath returns an attribute KeyValue conforming to the +// "code.filepath" semantic conventions. It represents the source code file +// name that identifies the code unit as uniquely as possible (preferably an +// absolute file path). +func CodeFilepath(val string) attribute.KeyValue { + return CodeFilepathKey.String(val) +} + +// CodeLineNumber returns an attribute KeyValue conforming to the "code.lineno" +// semantic conventions. It represents the line number in `code.filepath` best +// representing the operation. It SHOULD point within the code unit named in +// `code.function`. +func CodeLineNumber(val int) attribute.KeyValue { + return CodeLineNumberKey.Int(val) +} + +// CodeColumn returns an attribute KeyValue conforming to the "code.column" +// semantic conventions. It represents the column number in `code.filepath` +// best representing the operation. It SHOULD point within the code unit named +// in `code.function`. +func CodeColumn(val int) attribute.KeyValue { + return CodeColumnKey.Int(val) +} + +// Semantic conventions for HTTP client and server Spans. +const ( + // HTTPMethodKey is the attribute Key conforming to the "http.method" + // semantic conventions. It represents the hTTP request method. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'GET', 'POST', 'HEAD' + HTTPMethodKey = attribute.Key("http.method") + + // HTTPStatusCodeKey is the attribute Key conforming to the + // "http.status_code" semantic conventions. It represents the [HTTP + // response status code](https://tools.ietf.org/html/rfc7231#section-6). + // + // Type: int + // RequirementLevel: ConditionallyRequired (If and only if one was + // received/sent.) + // Stability: stable + // Examples: 200 + HTTPStatusCodeKey = attribute.Key("http.status_code") + + // HTTPFlavorKey is the attribute Key conforming to the "http.flavor" + // semantic conventions. It represents the kind of HTTP protocol used. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Note: If `net.transport` is not specified, it can be assumed to be + // `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is + // assumed. + HTTPFlavorKey = attribute.Key("http.flavor") + + // HTTPUserAgentKey is the attribute Key conforming to the + // "http.user_agent" semantic conventions. It represents the value of the + // [HTTP + // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) + // header sent by the client. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'CERN-LineMode/2.15 libwww/2.17b3' + HTTPUserAgentKey = attribute.Key("http.user_agent") + + // HTTPRequestContentLengthKey is the attribute Key conforming to the + // "http.request_content_length" semantic conventions. It represents the + // size of the request payload body in bytes. This is the number of bytes + // transferred excluding headers and is often, but not always, present as + // the + // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) + // header. For requests using transport encoding, this should be the + // compressed size. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 3495 + HTTPRequestContentLengthKey = attribute.Key("http.request_content_length") + + // HTTPResponseContentLengthKey is the attribute Key conforming to the + // "http.response_content_length" semantic conventions. It represents the + // size of the response payload body in bytes. This is the number of bytes + // transferred excluding headers and is often, but not always, present as + // the + // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) + // header. For requests using transport encoding, this should be the + // compressed size. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 3495 + HTTPResponseContentLengthKey = attribute.Key("http.response_content_length") +) + +var ( + // HTTP/1.0 + HTTPFlavorHTTP10 = HTTPFlavorKey.String("1.0") + // HTTP/1.1 + HTTPFlavorHTTP11 = HTTPFlavorKey.String("1.1") + // HTTP/2 + HTTPFlavorHTTP20 = HTTPFlavorKey.String("2.0") + // HTTP/3 + HTTPFlavorHTTP30 = HTTPFlavorKey.String("3.0") + // SPDY protocol + HTTPFlavorSPDY = HTTPFlavorKey.String("SPDY") + // QUIC protocol + HTTPFlavorQUIC = HTTPFlavorKey.String("QUIC") +) + +// HTTPMethod returns an attribute KeyValue conforming to the "http.method" +// semantic conventions. It represents the hTTP request method. +func HTTPMethod(val string) attribute.KeyValue { + return HTTPMethodKey.String(val) +} + +// HTTPStatusCode returns an attribute KeyValue conforming to the +// "http.status_code" semantic conventions. It represents the [HTTP response +// status code](https://tools.ietf.org/html/rfc7231#section-6). +func HTTPStatusCode(val int) attribute.KeyValue { + return HTTPStatusCodeKey.Int(val) +} + +// HTTPUserAgent returns an attribute KeyValue conforming to the +// "http.user_agent" semantic conventions. It represents the value of the [HTTP +// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) +// header sent by the client. +func HTTPUserAgent(val string) attribute.KeyValue { + return HTTPUserAgentKey.String(val) +} + +// HTTPRequestContentLength returns an attribute KeyValue conforming to the +// "http.request_content_length" semantic conventions. It represents the size +// of the request payload body in bytes. This is the number of bytes +// transferred excluding headers and is often, but not always, present as the +// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) +// header. For requests using transport encoding, this should be the compressed +// size. +func HTTPRequestContentLength(val int) attribute.KeyValue { + return HTTPRequestContentLengthKey.Int(val) +} + +// HTTPResponseContentLength returns an attribute KeyValue conforming to the +// "http.response_content_length" semantic conventions. It represents the size +// of the response payload body in bytes. This is the number of bytes +// transferred excluding headers and is often, but not always, present as the +// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) +// header. For requests using transport encoding, this should be the compressed +// size. +func HTTPResponseContentLength(val int) attribute.KeyValue { + return HTTPResponseContentLengthKey.Int(val) +} + +// Semantic Convention for HTTP Client +const ( + // HTTPURLKey is the attribute Key conforming to the "http.url" semantic + // conventions. It represents the full HTTP request URL in the form + // `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is + // not transmitted over HTTP, but if it is known, it should be included + // nevertheless. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv' + // Note: `http.url` MUST NOT contain credentials passed via URL in form of + // `https://username:password@www.example.com/`. In such case the + // attribute's value should be `https://www.example.com/`. + HTTPURLKey = attribute.Key("http.url") + + // HTTPResendCountKey is the attribute Key conforming to the + // "http.resend_count" semantic conventions. It represents the ordinal + // number of request resending attempt (for any reason, including + // redirects). + // + // Type: int + // RequirementLevel: Recommended (if and only if request was retried.) + // Stability: stable + // Examples: 3 + // Note: The resend count SHOULD be updated each time an HTTP request gets + // resent by the client, regardless of what was the cause of the resending + // (e.g. redirection, authorization failure, 503 Server Unavailable, + // network issues, or any other). + HTTPResendCountKey = attribute.Key("http.resend_count") +) + +// HTTPURL returns an attribute KeyValue conforming to the "http.url" +// semantic conventions. It represents the full HTTP request URL in the form +// `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not +// transmitted over HTTP, but if it is known, it should be included +// nevertheless. +func HTTPURL(val string) attribute.KeyValue { + return HTTPURLKey.String(val) +} + +// HTTPResendCount returns an attribute KeyValue conforming to the +// "http.resend_count" semantic conventions. It represents the ordinal number +// of request resending attempt (for any reason, including redirects). +func HTTPResendCount(val int) attribute.KeyValue { + return HTTPResendCountKey.Int(val) +} + +// Semantic Convention for HTTP Server +const ( + // HTTPSchemeKey is the attribute Key conforming to the "http.scheme" + // semantic conventions. It represents the URI scheme identifying the used + // protocol. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'http', 'https' + HTTPSchemeKey = attribute.Key("http.scheme") + + // HTTPTargetKey is the attribute Key conforming to the "http.target" + // semantic conventions. It represents the full request target as passed in + // a HTTP request line or equivalent. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: '/path/12314/?q=ddds' + HTTPTargetKey = attribute.Key("http.target") + + // HTTPRouteKey is the attribute Key conforming to the "http.route" + // semantic conventions. It represents the matched route (path template in + // the format used by the respective server framework). See note below + // + // Type: string + // RequirementLevel: ConditionallyRequired (If and only if it's available) + // Stability: stable + // Examples: '/users/:userID?', '{controller}/{action}/{id?}' + // Note: 'http.route' MUST NOT be populated when this is not supported by + // the HTTP server framework as the route attribute should have + // low-cardinality and the URI path can NOT substitute it. + HTTPRouteKey = attribute.Key("http.route") + + // HTTPClientIPKey is the attribute Key conforming to the "http.client_ip" + // semantic conventions. It represents the IP address of the original + // client behind all proxies, if known (e.g. from + // [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '83.164.160.102' + // Note: This is not necessarily the same as `net.sock.peer.addr`, which + // would + // identify the network-level peer, which may be a proxy. + // + // This attribute should be set when a source of information different + // from the one used for `net.sock.peer.addr`, is available even if that + // other + // source just confirms the same value as `net.sock.peer.addr`. + // Rationale: For `net.sock.peer.addr`, one typically does not know if it + // comes from a proxy, reverse proxy, or the actual client. Setting + // `http.client_ip` when it's the same as `net.sock.peer.addr` means that + // one is at least somewhat confident that the address is not that of + // the closest proxy. + HTTPClientIPKey = attribute.Key("http.client_ip") +) + +// HTTPScheme returns an attribute KeyValue conforming to the "http.scheme" +// semantic conventions. It represents the URI scheme identifying the used +// protocol. +func HTTPScheme(val string) attribute.KeyValue { + return HTTPSchemeKey.String(val) +} + +// HTTPTarget returns an attribute KeyValue conforming to the "http.target" +// semantic conventions. It represents the full request target as passed in a +// HTTP request line or equivalent. +func HTTPTarget(val string) attribute.KeyValue { + return HTTPTargetKey.String(val) +} + +// HTTPRoute returns an attribute KeyValue conforming to the "http.route" +// semantic conventions. It represents the matched route (path template in the +// format used by the respective server framework). See note below +func HTTPRoute(val string) attribute.KeyValue { + return HTTPRouteKey.String(val) +} + +// HTTPClientIP returns an attribute KeyValue conforming to the +// "http.client_ip" semantic conventions. It represents the IP address of the +// original client behind all proxies, if known (e.g. from +// [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). +func HTTPClientIP(val string) attribute.KeyValue { + return HTTPClientIPKey.String(val) +} + +// Attributes that exist for multiple DynamoDB request types. +const ( + // AWSDynamoDBTableNamesKey is the attribute Key conforming to the + // "aws.dynamodb.table_names" semantic conventions. It represents the keys + // in the `RequestItems` object field. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Users', 'Cats' + AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names") + + // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the + // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the + // JSON-serialized value of each item in the `ConsumedCapacity` response + // field. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": { + // "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, + // "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" : + // { "CapacityUnits": number, "ReadCapacityUnits": number, + // "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table": + // { "CapacityUnits": number, "ReadCapacityUnits": number, + // "WriteCapacityUnits": number }, "TableName": "string", + // "WriteCapacityUnits": number }' + AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity") + + // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to + // the "aws.dynamodb.item_collection_metrics" semantic conventions. It + // represents the JSON-serialized value of the `ItemCollectionMetrics` + // response field. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B": + // blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { + // "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], + // "NULL": boolean, "S": "string", "SS": [ "string" ] } }, + // "SizeEstimateRangeGB": [ number ] } ] }' + AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics") + + // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to + // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It + // represents the value of the `ProvisionedThroughput.ReadCapacityUnits` + // request parameter. + // + // Type: double + // RequirementLevel: Optional + // Stability: stable + // Examples: 1.0, 2.0 + AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity") + + // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming + // to the "aws.dynamodb.provisioned_write_capacity" semantic conventions. + // It represents the value of the + // `ProvisionedThroughput.WriteCapacityUnits` request parameter. + // + // Type: double + // RequirementLevel: Optional + // Stability: stable + // Examples: 1.0, 2.0 + AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity") + + // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the + // "aws.dynamodb.consistent_read" semantic conventions. It represents the + // value of the `ConsistentRead` request parameter. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read") + + // AWSDynamoDBProjectionKey is the attribute Key conforming to the + // "aws.dynamodb.projection" semantic conventions. It represents the value + // of the `ProjectionExpression` request parameter. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Title', 'Title, Price, Color', 'Title, Description, + // RelatedItems, ProductReviews' + AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection") + + // AWSDynamoDBLimitKey is the attribute Key conforming to the + // "aws.dynamodb.limit" semantic conventions. It represents the value of + // the `Limit` request parameter. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 10 + AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit") + + // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the + // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the + // value of the `AttributesToGet` request parameter. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: 'lives', 'id' + AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get") + + // AWSDynamoDBIndexNameKey is the attribute Key conforming to the + // "aws.dynamodb.index_name" semantic conventions. It represents the value + // of the `IndexName` request parameter. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'name_to_group' + AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name") + + // AWSDynamoDBSelectKey is the attribute Key conforming to the + // "aws.dynamodb.select" semantic conventions. It represents the value of + // the `Select` request parameter. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'ALL_ATTRIBUTES', 'COUNT' + AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select") +) + +// AWSDynamoDBTableNames returns an attribute KeyValue conforming to the +// "aws.dynamodb.table_names" semantic conventions. It represents the keys in +// the `RequestItems` object field. +func AWSDynamoDBTableNames(val ...string) attribute.KeyValue { + return AWSDynamoDBTableNamesKey.StringSlice(val) +} + +// AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to +// the "aws.dynamodb.consumed_capacity" semantic conventions. It represents the +// JSON-serialized value of each item in the `ConsumedCapacity` response field. +func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue { + return AWSDynamoDBConsumedCapacityKey.StringSlice(val) +} + +// AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming +// to the "aws.dynamodb.item_collection_metrics" semantic conventions. It +// represents the JSON-serialized value of the `ItemCollectionMetrics` response +// field. +func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue { + return AWSDynamoDBItemCollectionMetricsKey.String(val) +} + +// AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue +// conforming to the "aws.dynamodb.provisioned_read_capacity" semantic +// conventions. It represents the value of the +// `ProvisionedThroughput.ReadCapacityUnits` request parameter. +func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue { + return AWSDynamoDBProvisionedReadCapacityKey.Float64(val) +} + +// AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue +// conforming to the "aws.dynamodb.provisioned_write_capacity" semantic +// conventions. It represents the value of the +// `ProvisionedThroughput.WriteCapacityUnits` request parameter. +func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue { + return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val) +} + +// AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the +// "aws.dynamodb.consistent_read" semantic conventions. It represents the value +// of the `ConsistentRead` request parameter. +func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue { + return AWSDynamoDBConsistentReadKey.Bool(val) +} + +// AWSDynamoDBProjection returns an attribute KeyValue conforming to the +// "aws.dynamodb.projection" semantic conventions. It represents the value of +// the `ProjectionExpression` request parameter. +func AWSDynamoDBProjection(val string) attribute.KeyValue { + return AWSDynamoDBProjectionKey.String(val) +} + +// AWSDynamoDBLimit returns an attribute KeyValue conforming to the +// "aws.dynamodb.limit" semantic conventions. It represents the value of the +// `Limit` request parameter. +func AWSDynamoDBLimit(val int) attribute.KeyValue { + return AWSDynamoDBLimitKey.Int(val) +} + +// AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to +// the "aws.dynamodb.attributes_to_get" semantic conventions. It represents the +// value of the `AttributesToGet` request parameter. +func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue { + return AWSDynamoDBAttributesToGetKey.StringSlice(val) +} + +// AWSDynamoDBIndexName returns an attribute KeyValue conforming to the +// "aws.dynamodb.index_name" semantic conventions. It represents the value of +// the `IndexName` request parameter. +func AWSDynamoDBIndexName(val string) attribute.KeyValue { + return AWSDynamoDBIndexNameKey.String(val) +} + +// AWSDynamoDBSelect returns an attribute KeyValue conforming to the +// "aws.dynamodb.select" semantic conventions. It represents the value of the +// `Select` request parameter. +func AWSDynamoDBSelect(val string) attribute.KeyValue { + return AWSDynamoDBSelectKey.String(val) +} + +// DynamoDB.CreateTable +const ( + // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to + // the "aws.dynamodb.global_secondary_indexes" semantic conventions. It + // represents the JSON-serialized value of each item of the + // `GlobalSecondaryIndexes` request field + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName": + // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ + // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { + // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }' + AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes") + + // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to + // the "aws.dynamodb.local_secondary_indexes" semantic conventions. It + // represents the JSON-serialized value of each item of the + // `LocalSecondaryIndexes` request field. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: '{ "IndexARN": "string", "IndexName": "string", + // "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ { + // "AttributeName": "string", "KeyType": "string" } ], "Projection": { + // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }' + AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes") +) + +// AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue +// conforming to the "aws.dynamodb.global_secondary_indexes" semantic +// conventions. It represents the JSON-serialized value of each item of the +// `GlobalSecondaryIndexes` request field +func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue { + return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val) +} + +// AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming +// to the "aws.dynamodb.local_secondary_indexes" semantic conventions. It +// represents the JSON-serialized value of each item of the +// `LocalSecondaryIndexes` request field. +func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue { + return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val) +} + +// DynamoDB.ListTables +const ( + // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the + // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents + // the value of the `ExclusiveStartTableName` request parameter. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Users', 'CatsTable' + AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table") + + // AWSDynamoDBTableCountKey is the attribute Key conforming to the + // "aws.dynamodb.table_count" semantic conventions. It represents the the + // number of items in the `TableNames` response parameter. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 20 + AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count") +) + +// AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming +// to the "aws.dynamodb.exclusive_start_table" semantic conventions. It +// represents the value of the `ExclusiveStartTableName` request parameter. +func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue { + return AWSDynamoDBExclusiveStartTableKey.String(val) +} + +// AWSDynamoDBTableCount returns an attribute KeyValue conforming to the +// "aws.dynamodb.table_count" semantic conventions. It represents the the +// number of items in the `TableNames` response parameter. +func AWSDynamoDBTableCount(val int) attribute.KeyValue { + return AWSDynamoDBTableCountKey.Int(val) +} + +// DynamoDB.Query +const ( + // AWSDynamoDBScanForwardKey is the attribute Key conforming to the + // "aws.dynamodb.scan_forward" semantic conventions. It represents the + // value of the `ScanIndexForward` request parameter. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward") +) + +// AWSDynamoDBScanForward returns an attribute KeyValue conforming to the +// "aws.dynamodb.scan_forward" semantic conventions. It represents the value of +// the `ScanIndexForward` request parameter. +func AWSDynamoDBScanForward(val bool) attribute.KeyValue { + return AWSDynamoDBScanForwardKey.Bool(val) +} + +// DynamoDB.Scan +const ( + // AWSDynamoDBSegmentKey is the attribute Key conforming to the + // "aws.dynamodb.segment" semantic conventions. It represents the value of + // the `Segment` request parameter. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 10 + AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment") + + // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the + // "aws.dynamodb.total_segments" semantic conventions. It represents the + // value of the `TotalSegments` request parameter. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 100 + AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments") + + // AWSDynamoDBCountKey is the attribute Key conforming to the + // "aws.dynamodb.count" semantic conventions. It represents the value of + // the `Count` response parameter. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 10 + AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count") + + // AWSDynamoDBScannedCountKey is the attribute Key conforming to the + // "aws.dynamodb.scanned_count" semantic conventions. It represents the + // value of the `ScannedCount` response parameter. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 50 + AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count") +) + +// AWSDynamoDBSegment returns an attribute KeyValue conforming to the +// "aws.dynamodb.segment" semantic conventions. It represents the value of the +// `Segment` request parameter. +func AWSDynamoDBSegment(val int) attribute.KeyValue { + return AWSDynamoDBSegmentKey.Int(val) +} + +// AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the +// "aws.dynamodb.total_segments" semantic conventions. It represents the value +// of the `TotalSegments` request parameter. +func AWSDynamoDBTotalSegments(val int) attribute.KeyValue { + return AWSDynamoDBTotalSegmentsKey.Int(val) +} + +// AWSDynamoDBCount returns an attribute KeyValue conforming to the +// "aws.dynamodb.count" semantic conventions. It represents the value of the +// `Count` response parameter. +func AWSDynamoDBCount(val int) attribute.KeyValue { + return AWSDynamoDBCountKey.Int(val) +} + +// AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the +// "aws.dynamodb.scanned_count" semantic conventions. It represents the value +// of the `ScannedCount` response parameter. +func AWSDynamoDBScannedCount(val int) attribute.KeyValue { + return AWSDynamoDBScannedCountKey.Int(val) +} + +// DynamoDB.UpdateTable +const ( + // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to + // the "aws.dynamodb.attribute_definitions" semantic conventions. It + // represents the JSON-serialized value of each item in the + // `AttributeDefinitions` request field. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: '{ "AttributeName": "string", "AttributeType": "string" }' + AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions") + + // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key + // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic + // conventions. It represents the JSON-serialized value of each item in the + // the `GlobalSecondaryIndexUpdates` request field. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ { + // "AttributeName": "string", "KeyType": "string" } ], "Projection": { + // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, + // "ProvisionedThroughput": { "ReadCapacityUnits": number, + // "WriteCapacityUnits": number } }' + AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates") +) + +// AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming +// to the "aws.dynamodb.attribute_definitions" semantic conventions. It +// represents the JSON-serialized value of each item in the +// `AttributeDefinitions` request field. +func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue { + return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val) +} + +// AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue +// conforming to the "aws.dynamodb.global_secondary_index_updates" semantic +// conventions. It represents the JSON-serialized value of each item in the the +// `GlobalSecondaryIndexUpdates` request field. +func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue { + return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val) +} + +// Semantic conventions to apply when instrumenting the GraphQL implementation. +// They map GraphQL operations to attributes on a Span. +const ( + // GraphqlOperationNameKey is the attribute Key conforming to the + // "graphql.operation.name" semantic conventions. It represents the name of + // the operation being executed. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'findBookByID' + GraphqlOperationNameKey = attribute.Key("graphql.operation.name") + + // GraphqlOperationTypeKey is the attribute Key conforming to the + // "graphql.operation.type" semantic conventions. It represents the type of + // the operation being executed. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Examples: 'query', 'mutation', 'subscription' + GraphqlOperationTypeKey = attribute.Key("graphql.operation.type") + + // GraphqlDocumentKey is the attribute Key conforming to the + // "graphql.document" semantic conventions. It represents the GraphQL + // document being executed. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'query findBookByID { bookByID(id: ?) { name } }' + // Note: The value may be sanitized to exclude sensitive information. + GraphqlDocumentKey = attribute.Key("graphql.document") +) + +var ( + // GraphQL query + GraphqlOperationTypeQuery = GraphqlOperationTypeKey.String("query") + // GraphQL mutation + GraphqlOperationTypeMutation = GraphqlOperationTypeKey.String("mutation") + // GraphQL subscription + GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription") +) + +// GraphqlOperationName returns an attribute KeyValue conforming to the +// "graphql.operation.name" semantic conventions. It represents the name of the +// operation being executed. +func GraphqlOperationName(val string) attribute.KeyValue { + return GraphqlOperationNameKey.String(val) +} + +// GraphqlDocument returns an attribute KeyValue conforming to the +// "graphql.document" semantic conventions. It represents the GraphQL document +// being executed. +func GraphqlDocument(val string) attribute.KeyValue { + return GraphqlDocumentKey.String(val) +} + +// Semantic convention describing per-message attributes populated on messaging +// spans or links. +const ( + // MessagingMessageIDKey is the attribute Key conforming to the + // "messaging.message.id" semantic conventions. It represents a value used + // by the messaging system as an identifier for the message, represented as + // a string. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '452a7c7c7c7048c2f887f61572b18fc2' + MessagingMessageIDKey = attribute.Key("messaging.message.id") + + // MessagingMessageConversationIDKey is the attribute Key conforming to the + // "messaging.message.conversation_id" semantic conventions. It represents + // the [conversation ID](#conversations) identifying the conversation to + // which the message belongs, represented as a string. Sometimes called + // "Correlation ID". + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'MyConversationID' + MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id") + + // MessagingMessagePayloadSizeBytesKey is the attribute Key conforming to + // the "messaging.message.payload_size_bytes" semantic conventions. It + // represents the (uncompressed) size of the message payload in bytes. Also + // use this attribute if it is unknown whether the compressed or + // uncompressed payload size is reported. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 2738 + MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message.payload_size_bytes") + + // MessagingMessagePayloadCompressedSizeBytesKey is the attribute Key + // conforming to the "messaging.message.payload_compressed_size_bytes" + // semantic conventions. It represents the compressed size of the message + // payload in bytes. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 2048 + MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message.payload_compressed_size_bytes") +) + +// MessagingMessageID returns an attribute KeyValue conforming to the +// "messaging.message.id" semantic conventions. It represents a value used by +// the messaging system as an identifier for the message, represented as a +// string. +func MessagingMessageID(val string) attribute.KeyValue { + return MessagingMessageIDKey.String(val) +} + +// MessagingMessageConversationID returns an attribute KeyValue conforming +// to the "messaging.message.conversation_id" semantic conventions. It +// represents the [conversation ID](#conversations) identifying the +// conversation to which the message belongs, represented as a string. +// Sometimes called "Correlation ID". +func MessagingMessageConversationID(val string) attribute.KeyValue { + return MessagingMessageConversationIDKey.String(val) +} + +// MessagingMessagePayloadSizeBytes returns an attribute KeyValue conforming +// to the "messaging.message.payload_size_bytes" semantic conventions. It +// represents the (uncompressed) size of the message payload in bytes. Also use +// this attribute if it is unknown whether the compressed or uncompressed +// payload size is reported. +func MessagingMessagePayloadSizeBytes(val int) attribute.KeyValue { + return MessagingMessagePayloadSizeBytesKey.Int(val) +} + +// MessagingMessagePayloadCompressedSizeBytes returns an attribute KeyValue +// conforming to the "messaging.message.payload_compressed_size_bytes" semantic +// conventions. It represents the compressed size of the message payload in +// bytes. +func MessagingMessagePayloadCompressedSizeBytes(val int) attribute.KeyValue { + return MessagingMessagePayloadCompressedSizeBytesKey.Int(val) +} + +// Semantic convention for attributes that describe messaging destination on +// broker +const ( + // MessagingDestinationNameKey is the attribute Key conforming to the + // "messaging.destination.name" semantic conventions. It represents the + // message destination name + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'MyQueue', 'MyTopic' + // Note: Destination name SHOULD uniquely identify a specific queue, topic + // or other entity within the broker. If + // the broker does not have such notion, the destination name SHOULD + // uniquely identify the broker. + MessagingDestinationNameKey = attribute.Key("messaging.destination.name") + + // MessagingDestinationKindKey is the attribute Key conforming to the + // "messaging.destination.kind" semantic conventions. It represents the + // kind of message destination + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + MessagingDestinationKindKey = attribute.Key("messaging.destination.kind") + + // MessagingDestinationTemplateKey is the attribute Key conforming to the + // "messaging.destination.template" semantic conventions. It represents the + // low cardinality representation of the messaging destination name + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '/customers/{customerID}' + // Note: Destination names could be constructed from templates. An example + // would be a destination name involving a user name or product id. + // Although the destination name in this case is of high cardinality, the + // underlying template is of low cardinality and can be effectively used + // for grouping and aggregation. + MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template") + + // MessagingDestinationTemporaryKey is the attribute Key conforming to the + // "messaging.destination.temporary" semantic conventions. It represents a + // boolean that is true if the message destination is temporary and might + // not exist anymore after messages are processed. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary") + + // MessagingDestinationAnonymousKey is the attribute Key conforming to the + // "messaging.destination.anonymous" semantic conventions. It represents a + // boolean that is true if the message destination is anonymous (could be + // unnamed or have auto-generated name). + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous") +) + +var ( + // A message sent to a queue + MessagingDestinationKindQueue = MessagingDestinationKindKey.String("queue") + // A message sent to a topic + MessagingDestinationKindTopic = MessagingDestinationKindKey.String("topic") +) + +// MessagingDestinationName returns an attribute KeyValue conforming to the +// "messaging.destination.name" semantic conventions. It represents the message +// destination name +func MessagingDestinationName(val string) attribute.KeyValue { + return MessagingDestinationNameKey.String(val) +} + +// MessagingDestinationTemplate returns an attribute KeyValue conforming to +// the "messaging.destination.template" semantic conventions. It represents the +// low cardinality representation of the messaging destination name +func MessagingDestinationTemplate(val string) attribute.KeyValue { + return MessagingDestinationTemplateKey.String(val) +} + +// MessagingDestinationTemporary returns an attribute KeyValue conforming to +// the "messaging.destination.temporary" semantic conventions. It represents a +// boolean that is true if the message destination is temporary and might not +// exist anymore after messages are processed. +func MessagingDestinationTemporary(val bool) attribute.KeyValue { + return MessagingDestinationTemporaryKey.Bool(val) +} + +// MessagingDestinationAnonymous returns an attribute KeyValue conforming to +// the "messaging.destination.anonymous" semantic conventions. It represents a +// boolean that is true if the message destination is anonymous (could be +// unnamed or have auto-generated name). +func MessagingDestinationAnonymous(val bool) attribute.KeyValue { + return MessagingDestinationAnonymousKey.Bool(val) +} + +// Semantic convention for attributes that describe messaging source on broker +const ( + // MessagingSourceNameKey is the attribute Key conforming to the + // "messaging.source.name" semantic conventions. It represents the message + // source name + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'MyQueue', 'MyTopic' + // Note: Source name SHOULD uniquely identify a specific queue, topic, or + // other entity within the broker. If + // the broker does not have such notion, the source name SHOULD uniquely + // identify the broker. + MessagingSourceNameKey = attribute.Key("messaging.source.name") + + // MessagingSourceKindKey is the attribute Key conforming to the + // "messaging.source.kind" semantic conventions. It represents the kind of + // message source + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + MessagingSourceKindKey = attribute.Key("messaging.source.kind") + + // MessagingSourceTemplateKey is the attribute Key conforming to the + // "messaging.source.template" semantic conventions. It represents the low + // cardinality representation of the messaging source name + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '/customers/{customerID}' + // Note: Source names could be constructed from templates. An example would + // be a source name involving a user name or product id. Although the + // source name in this case is of high cardinality, the underlying template + // is of low cardinality and can be effectively used for grouping and + // aggregation. + MessagingSourceTemplateKey = attribute.Key("messaging.source.template") + + // MessagingSourceTemporaryKey is the attribute Key conforming to the + // "messaging.source.temporary" semantic conventions. It represents a + // boolean that is true if the message source is temporary and might not + // exist anymore after messages are processed. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + MessagingSourceTemporaryKey = attribute.Key("messaging.source.temporary") + + // MessagingSourceAnonymousKey is the attribute Key conforming to the + // "messaging.source.anonymous" semantic conventions. It represents a + // boolean that is true if the message source is anonymous (could be + // unnamed or have auto-generated name). + // + // Type: boolean + // RequirementLevel: Optional + // Stability: stable + MessagingSourceAnonymousKey = attribute.Key("messaging.source.anonymous") +) + +var ( + // A message received from a queue + MessagingSourceKindQueue = MessagingSourceKindKey.String("queue") + // A message received from a topic + MessagingSourceKindTopic = MessagingSourceKindKey.String("topic") +) + +// MessagingSourceName returns an attribute KeyValue conforming to the +// "messaging.source.name" semantic conventions. It represents the message +// source name +func MessagingSourceName(val string) attribute.KeyValue { + return MessagingSourceNameKey.String(val) +} + +// MessagingSourceTemplate returns an attribute KeyValue conforming to the +// "messaging.source.template" semantic conventions. It represents the low +// cardinality representation of the messaging source name +func MessagingSourceTemplate(val string) attribute.KeyValue { + return MessagingSourceTemplateKey.String(val) +} + +// MessagingSourceTemporary returns an attribute KeyValue conforming to the +// "messaging.source.temporary" semantic conventions. It represents a boolean +// that is true if the message source is temporary and might not exist anymore +// after messages are processed. +func MessagingSourceTemporary(val bool) attribute.KeyValue { + return MessagingSourceTemporaryKey.Bool(val) +} + +// MessagingSourceAnonymous returns an attribute KeyValue conforming to the +// "messaging.source.anonymous" semantic conventions. It represents a boolean +// that is true if the message source is anonymous (could be unnamed or have +// auto-generated name). +func MessagingSourceAnonymous(val bool) attribute.KeyValue { + return MessagingSourceAnonymousKey.Bool(val) +} + +// General attributes used in messaging systems. +const ( + // MessagingSystemKey is the attribute Key conforming to the + // "messaging.system" semantic conventions. It represents a string + // identifying the messaging system. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS' + MessagingSystemKey = attribute.Key("messaging.system") + + // MessagingOperationKey is the attribute Key conforming to the + // "messaging.operation" semantic conventions. It represents a string + // identifying the kind of messaging operation as defined in the [Operation + // names](#operation-names) section above. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + // Note: If a custom value is used, it MUST be of low cardinality. + MessagingOperationKey = attribute.Key("messaging.operation") + + // MessagingBatchMessageCountKey is the attribute Key conforming to the + // "messaging.batch.message_count" semantic conventions. It represents the + // number of messages sent, received, or processed in the scope of the + // batching operation. + // + // Type: int + // RequirementLevel: ConditionallyRequired (If the span describes an + // operation on a batch of messages.) + // Stability: stable + // Examples: 0, 1, 2 + // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on + // spans that operate with a single message. When a messaging client + // library supports both batch and single-message API for the same + // operation, instrumentations SHOULD use `messaging.batch.message_count` + // for batching APIs and SHOULD NOT use it for single-message APIs. + MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count") +) + +var ( + // publish + MessagingOperationPublish = MessagingOperationKey.String("publish") + // receive + MessagingOperationReceive = MessagingOperationKey.String("receive") + // process + MessagingOperationProcess = MessagingOperationKey.String("process") +) + +// MessagingSystem returns an attribute KeyValue conforming to the +// "messaging.system" semantic conventions. It represents a string identifying +// the messaging system. +func MessagingSystem(val string) attribute.KeyValue { + return MessagingSystemKey.String(val) +} + +// MessagingBatchMessageCount returns an attribute KeyValue conforming to +// the "messaging.batch.message_count" semantic conventions. It represents the +// number of messages sent, received, or processed in the scope of the batching +// operation. +func MessagingBatchMessageCount(val int) attribute.KeyValue { + return MessagingBatchMessageCountKey.Int(val) +} + +// Semantic convention for a consumer of messages received from a messaging +// system +const ( + // MessagingConsumerIDKey is the attribute Key conforming to the + // "messaging.consumer.id" semantic conventions. It represents the + // identifier for the consumer receiving a message. For Kafka, set it to + // `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if + // both are present, or only `messaging.kafka.consumer.group`. For brokers, + // such as RabbitMQ and Artemis, set it to the `client_id` of the client + // consuming the message. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'mygroup - client-6' + MessagingConsumerIDKey = attribute.Key("messaging.consumer.id") +) + +// MessagingConsumerID returns an attribute KeyValue conforming to the +// "messaging.consumer.id" semantic conventions. It represents the identifier +// for the consumer receiving a message. For Kafka, set it to +// `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if both +// are present, or only `messaging.kafka.consumer.group`. For brokers, such as +// RabbitMQ and Artemis, set it to the `client_id` of the client consuming the +// message. +func MessagingConsumerID(val string) attribute.KeyValue { + return MessagingConsumerIDKey.String(val) +} + +// Attributes for RabbitMQ +const ( + // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key + // conforming to the "messaging.rabbitmq.destination.routing_key" semantic + // conventions. It represents the rabbitMQ message routing key. + // + // Type: string + // RequirementLevel: ConditionallyRequired (If not empty.) + // Stability: stable + // Examples: 'myKey' + MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key") +) + +// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue +// conforming to the "messaging.rabbitmq.destination.routing_key" semantic +// conventions. It represents the rabbitMQ message routing key. +func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue { + return MessagingRabbitmqDestinationRoutingKeyKey.String(val) +} + +// Attributes for Apache Kafka +const ( + // MessagingKafkaMessageKeyKey is the attribute Key conforming to the + // "messaging.kafka.message.key" semantic conventions. It represents the + // message keys in Kafka are used for grouping alike messages to ensure + // they're processed on the same partition. They differ from + // `messaging.message.id` in that they're not unique. If the key is `null`, + // the attribute MUST NOT be set. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'myKey' + // Note: If the key type is not string, it's string representation has to + // be supplied for the attribute. If the key has no unambiguous, canonical + // string form, don't include its value. + MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key") + + // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the + // "messaging.kafka.consumer.group" semantic conventions. It represents the + // name of the Kafka Consumer Group that is handling the message. Only + // applies to consumers, not producers. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'my-group' + MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group") + + // MessagingKafkaClientIDKey is the attribute Key conforming to the + // "messaging.kafka.client_id" semantic conventions. It represents the + // client ID for the Consumer or Producer that is handling the message. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'client-5' + MessagingKafkaClientIDKey = attribute.Key("messaging.kafka.client_id") + + // MessagingKafkaDestinationPartitionKey is the attribute Key conforming to + // the "messaging.kafka.destination.partition" semantic conventions. It + // represents the partition the message is sent to. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 2 + MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition") + + // MessagingKafkaSourcePartitionKey is the attribute Key conforming to the + // "messaging.kafka.source.partition" semantic conventions. It represents + // the partition the message is received from. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 2 + MessagingKafkaSourcePartitionKey = attribute.Key("messaging.kafka.source.partition") + + // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the + // "messaging.kafka.message.offset" semantic conventions. It represents the + // offset of a record in the corresponding Kafka partition. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 42 + MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset") + + // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the + // "messaging.kafka.message.tombstone" semantic conventions. It represents + // a boolean that is true if the message is a tombstone. + // + // Type: boolean + // RequirementLevel: ConditionallyRequired (If value is `true`. When + // missing, the value is assumed to be `false`.) + // Stability: stable + MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone") +) + +// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the +// "messaging.kafka.message.key" semantic conventions. It represents the +// message keys in Kafka are used for grouping alike messages to ensure they're +// processed on the same partition. They differ from `messaging.message.id` in +// that they're not unique. If the key is `null`, the attribute MUST NOT be +// set. +func MessagingKafkaMessageKey(val string) attribute.KeyValue { + return MessagingKafkaMessageKeyKey.String(val) +} + +// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to +// the "messaging.kafka.consumer.group" semantic conventions. It represents the +// name of the Kafka Consumer Group that is handling the message. Only applies +// to consumers, not producers. +func MessagingKafkaConsumerGroup(val string) attribute.KeyValue { + return MessagingKafkaConsumerGroupKey.String(val) +} + +// MessagingKafkaClientID returns an attribute KeyValue conforming to the +// "messaging.kafka.client_id" semantic conventions. It represents the client +// ID for the Consumer or Producer that is handling the message. +func MessagingKafkaClientID(val string) attribute.KeyValue { + return MessagingKafkaClientIDKey.String(val) +} + +// MessagingKafkaDestinationPartition returns an attribute KeyValue +// conforming to the "messaging.kafka.destination.partition" semantic +// conventions. It represents the partition the message is sent to. +func MessagingKafkaDestinationPartition(val int) attribute.KeyValue { + return MessagingKafkaDestinationPartitionKey.Int(val) +} + +// MessagingKafkaSourcePartition returns an attribute KeyValue conforming to +// the "messaging.kafka.source.partition" semantic conventions. It represents +// the partition the message is received from. +func MessagingKafkaSourcePartition(val int) attribute.KeyValue { + return MessagingKafkaSourcePartitionKey.Int(val) +} + +// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to +// the "messaging.kafka.message.offset" semantic conventions. It represents the +// offset of a record in the corresponding Kafka partition. +func MessagingKafkaMessageOffset(val int) attribute.KeyValue { + return MessagingKafkaMessageOffsetKey.Int(val) +} + +// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming +// to the "messaging.kafka.message.tombstone" semantic conventions. It +// represents a boolean that is true if the message is a tombstone. +func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue { + return MessagingKafkaMessageTombstoneKey.Bool(val) +} + +// Attributes for Apache RocketMQ +const ( + // MessagingRocketmqNamespaceKey is the attribute Key conforming to the + // "messaging.rocketmq.namespace" semantic conventions. It represents the + // namespace of RocketMQ resources, resources in different namespaces are + // individual. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'myNamespace' + MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace") + + // MessagingRocketmqClientGroupKey is the attribute Key conforming to the + // "messaging.rocketmq.client_group" semantic conventions. It represents + // the name of the RocketMQ producer/consumer group that is handling the + // message. The client type is identified by the SpanKind. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'myConsumerGroup' + MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group") + + // MessagingRocketmqClientIDKey is the attribute Key conforming to the + // "messaging.rocketmq.client_id" semantic conventions. It represents the + // unique identifier for each client. + // + // Type: string + // RequirementLevel: Required + // Stability: stable + // Examples: 'myhost@8742@s8083jm' + MessagingRocketmqClientIDKey = attribute.Key("messaging.rocketmq.client_id") + + // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key + // conforming to the "messaging.rocketmq.message.delivery_timestamp" + // semantic conventions. It represents the timestamp in milliseconds that + // the delay message is expected to be delivered to consumer. + // + // Type: int + // RequirementLevel: ConditionallyRequired (If the message type is delay + // and delay time level is not specified.) + // Stability: stable + // Examples: 1665987217045 + MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp") + + // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key + // conforming to the "messaging.rocketmq.message.delay_time_level" semantic + // conventions. It represents the delay time level for delay message, which + // determines the message delay time. + // + // Type: int + // RequirementLevel: ConditionallyRequired (If the message type is delay + // and delivery timestamp is not specified.) + // Stability: stable + // Examples: 3 + MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level") + + // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the + // "messaging.rocketmq.message.group" semantic conventions. It represents + // the it is essential for FIFO message. Messages that belong to the same + // message group are always processed one by one within the same consumer + // group. + // + // Type: string + // RequirementLevel: ConditionallyRequired (If the message type is FIFO.) + // Stability: stable + // Examples: 'myMessageGroup' + MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group") + + // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the + // "messaging.rocketmq.message.type" semantic conventions. It represents + // the type of message. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type") + + // MessagingRocketmqMessageTagKey is the attribute Key conforming to the + // "messaging.rocketmq.message.tag" semantic conventions. It represents the + // secondary classifier of message besides topic. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'tagA' + MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag") + + // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the + // "messaging.rocketmq.message.keys" semantic conventions. It represents + // the key(s) of message, another way to mark message besides message id. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: stable + // Examples: 'keyA', 'keyB' + MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys") + + // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to + // the "messaging.rocketmq.consumption_model" semantic conventions. It + // represents the model of message consumption. This only applies to + // consumer spans. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model") +) + +var ( + // Normal message + MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal") + // FIFO message + MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo") + // Delay message + MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay") + // Transaction message + MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction") +) + +var ( + // Clustering consumption model + MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering") + // Broadcasting consumption model + MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting") +) + +// MessagingRocketmqNamespace returns an attribute KeyValue conforming to +// the "messaging.rocketmq.namespace" semantic conventions. It represents the +// namespace of RocketMQ resources, resources in different namespaces are +// individual. +func MessagingRocketmqNamespace(val string) attribute.KeyValue { + return MessagingRocketmqNamespaceKey.String(val) +} + +// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to +// the "messaging.rocketmq.client_group" semantic conventions. It represents +// the name of the RocketMQ producer/consumer group that is handling the +// message. The client type is identified by the SpanKind. +func MessagingRocketmqClientGroup(val string) attribute.KeyValue { + return MessagingRocketmqClientGroupKey.String(val) +} + +// MessagingRocketmqClientID returns an attribute KeyValue conforming to the +// "messaging.rocketmq.client_id" semantic conventions. It represents the +// unique identifier for each client. +func MessagingRocketmqClientID(val string) attribute.KeyValue { + return MessagingRocketmqClientIDKey.String(val) +} + +// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue +// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic +// conventions. It represents the timestamp in milliseconds that the delay +// message is expected to be delivered to consumer. +func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue { + return MessagingRocketmqMessageDeliveryTimestampKey.Int(val) +} + +// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue +// conforming to the "messaging.rocketmq.message.delay_time_level" semantic +// conventions. It represents the delay time level for delay message, which +// determines the message delay time. +func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue { + return MessagingRocketmqMessageDelayTimeLevelKey.Int(val) +} + +// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to +// the "messaging.rocketmq.message.group" semantic conventions. It represents +// the it is essential for FIFO message. Messages that belong to the same +// message group are always processed one by one within the same consumer +// group. +func MessagingRocketmqMessageGroup(val string) attribute.KeyValue { + return MessagingRocketmqMessageGroupKey.String(val) +} + +// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to +// the "messaging.rocketmq.message.tag" semantic conventions. It represents the +// secondary classifier of message besides topic. +func MessagingRocketmqMessageTag(val string) attribute.KeyValue { + return MessagingRocketmqMessageTagKey.String(val) +} + +// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to +// the "messaging.rocketmq.message.keys" semantic conventions. It represents +// the key(s) of message, another way to mark message besides message id. +func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue { + return MessagingRocketmqMessageKeysKey.StringSlice(val) +} + +// Semantic conventions for remote procedure calls. +const ( + // RPCSystemKey is the attribute Key conforming to the "rpc.system" + // semantic conventions. It represents a string identifying the remoting + // system. See below for a list of well-known identifiers. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + RPCSystemKey = attribute.Key("rpc.system") + + // RPCServiceKey is the attribute Key conforming to the "rpc.service" + // semantic conventions. It represents the full (logical) name of the + // service being called, including its package name, if applicable. + // + // Type: string + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'myservice.EchoService' + // Note: This is the logical name of the service from the RPC interface + // perspective, which can be different from the name of any implementing + // class. The `code.namespace` attribute may be used to store the latter + // (despite the attribute name, it may include a class name; e.g., class + // with method actually executing the call on the server side, RPC client + // stub class on the client side). + RPCServiceKey = attribute.Key("rpc.service") + + // RPCMethodKey is the attribute Key conforming to the "rpc.method" + // semantic conventions. It represents the name of the (logical) method + // being called, must be equal to the $method part in the span name. + // + // Type: string + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'exampleMethod' + // Note: This is the logical name of the method from the RPC interface + // perspective, which can be different from the name of any implementing + // method/function. The `code.function` attribute may be used to store the + // latter (e.g., method actually executing the call on the server side, RPC + // client stub method on the client side). + RPCMethodKey = attribute.Key("rpc.method") +) + +var ( + // gRPC + RPCSystemGRPC = RPCSystemKey.String("grpc") + // Java RMI + RPCSystemJavaRmi = RPCSystemKey.String("java_rmi") + // .NET WCF + RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf") + // Apache Dubbo + RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo") +) + +// RPCService returns an attribute KeyValue conforming to the "rpc.service" +// semantic conventions. It represents the full (logical) name of the service +// being called, including its package name, if applicable. +func RPCService(val string) attribute.KeyValue { + return RPCServiceKey.String(val) +} + +// RPCMethod returns an attribute KeyValue conforming to the "rpc.method" +// semantic conventions. It represents the name of the (logical) method being +// called, must be equal to the $method part in the span name. +func RPCMethod(val string) attribute.KeyValue { + return RPCMethodKey.String(val) +} + +// Tech-specific attributes for gRPC. +const ( + // RPCGRPCStatusCodeKey is the attribute Key conforming to the + // "rpc.grpc.status_code" semantic conventions. It represents the [numeric + // status + // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of + // the gRPC request. + // + // Type: Enum + // RequirementLevel: Required + // Stability: stable + RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") +) + +var ( + // OK + RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0) + // CANCELLED + RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1) + // UNKNOWN + RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2) + // INVALID_ARGUMENT + RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3) + // DEADLINE_EXCEEDED + RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4) + // NOT_FOUND + RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5) + // ALREADY_EXISTS + RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6) + // PERMISSION_DENIED + RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7) + // RESOURCE_EXHAUSTED + RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8) + // FAILED_PRECONDITION + RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9) + // ABORTED + RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10) + // OUT_OF_RANGE + RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11) + // UNIMPLEMENTED + RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12) + // INTERNAL + RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13) + // UNAVAILABLE + RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14) + // DATA_LOSS + RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15) + // UNAUTHENTICATED + RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16) +) + +// Tech-specific attributes for [JSON RPC](https://www.jsonrpc.org/). +const ( + // RPCJsonrpcVersionKey is the attribute Key conforming to the + // "rpc.jsonrpc.version" semantic conventions. It represents the protocol + // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 + // does not specify this, the value can be omitted. + // + // Type: string + // RequirementLevel: ConditionallyRequired (If other than the default + // version (`1.0`)) + // Stability: stable + // Examples: '2.0', '1.0' + RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version") + + // RPCJsonrpcRequestIDKey is the attribute Key conforming to the + // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` + // property of request or response. Since protocol allows id to be int, + // string, `null` or missing (for notifications), value is expected to be + // cast to string for simplicity. Use empty string in case of `null` value. + // Omit entirely if this is a notification. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '10', 'request-7', '' + RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id") + + // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the + // "rpc.jsonrpc.error_code" semantic conventions. It represents the + // `error.code` property of response if it is an error response. + // + // Type: int + // RequirementLevel: ConditionallyRequired (If response is not successful.) + // Stability: stable + // Examples: -32700, 100 + RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code") + + // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the + // "rpc.jsonrpc.error_message" semantic conventions. It represents the + // `error.message` property of response if it is an error response. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'Parse error', 'User already exists' + RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message") +) + +// RPCJsonrpcVersion returns an attribute KeyValue conforming to the +// "rpc.jsonrpc.version" semantic conventions. It represents the protocol +// version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 +// does not specify this, the value can be omitted. +func RPCJsonrpcVersion(val string) attribute.KeyValue { + return RPCJsonrpcVersionKey.String(val) +} + +// RPCJsonrpcRequestID returns an attribute KeyValue conforming to the +// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` +// property of request or response. Since protocol allows id to be int, string, +// `null` or missing (for notifications), value is expected to be cast to +// string for simplicity. Use empty string in case of `null` value. Omit +// entirely if this is a notification. +func RPCJsonrpcRequestID(val string) attribute.KeyValue { + return RPCJsonrpcRequestIDKey.String(val) +} + +// RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the +// "rpc.jsonrpc.error_code" semantic conventions. It represents the +// `error.code` property of response if it is an error response. +func RPCJsonrpcErrorCode(val int) attribute.KeyValue { + return RPCJsonrpcErrorCodeKey.Int(val) +} + +// RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the +// "rpc.jsonrpc.error_message" semantic conventions. It represents the +// `error.message` property of response if it is an error response. +func RPCJsonrpcErrorMessage(val string) attribute.KeyValue { + return RPCJsonrpcErrorMessageKey.String(val) +} diff --git a/vendor/go.opentelemetry.io/otel/trace.go b/vendor/go.opentelemetry.io/otel/trace.go new file mode 100644 index 0000000000..caf7249de8 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace.go @@ -0,0 +1,47 @@ +// Copyright The OpenTelemetry 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 otel // import "go.opentelemetry.io/otel" + +import ( + "go.opentelemetry.io/otel/internal/global" + "go.opentelemetry.io/otel/trace" +) + +// Tracer creates a named tracer that implements Tracer interface. +// If the name is an empty string then provider uses default name. +// +// This is short for GetTracerProvider().Tracer(name, opts...) +func Tracer(name string, opts ...trace.TracerOption) trace.Tracer { + return GetTracerProvider().Tracer(name, opts...) +} + +// GetTracerProvider returns the registered global trace provider. +// If none is registered then an instance of NoopTracerProvider is returned. +// +// Use the trace provider to create a named tracer. E.g. +// +// tracer := otel.GetTracerProvider().Tracer("example.com/foo") +// +// or +// +// tracer := otel.Tracer("example.com/foo") +func GetTracerProvider() trace.TracerProvider { + return global.TracerProvider() +} + +// SetTracerProvider registers `tp` as the global trace provider. +func SetTracerProvider(tp trace.TracerProvider) { + global.SetTracerProvider(tp) +} diff --git a/vendor/go.opentelemetry.io/otel/trace/LICENSE b/vendor/go.opentelemetry.io/otel/trace/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/LICENSE @@ -0,0 +1,201 @@ + 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/go.opentelemetry.io/otel/trace/config.go b/vendor/go.opentelemetry.io/otel/trace/config.go new file mode 100644 index 0000000000..3aadc66cf7 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/config.go @@ -0,0 +1,334 @@ +// Copyright The OpenTelemetry 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 trace // import "go.opentelemetry.io/otel/trace" + +import ( + "time" + + "go.opentelemetry.io/otel/attribute" +) + +// TracerConfig is a group of options for a Tracer. +type TracerConfig struct { + instrumentationVersion string + // Schema URL of the telemetry emitted by the Tracer. + schemaURL string + attrs attribute.Set +} + +// InstrumentationVersion returns the version of the library providing instrumentation. +func (t *TracerConfig) InstrumentationVersion() string { + return t.instrumentationVersion +} + +// InstrumentationAttributes returns the attributes associated with the library +// providing instrumentation. +func (t *TracerConfig) InstrumentationAttributes() attribute.Set { + return t.attrs +} + +// SchemaURL returns the Schema URL of the telemetry emitted by the Tracer. +func (t *TracerConfig) SchemaURL() string { + return t.schemaURL +} + +// NewTracerConfig applies all the options to a returned TracerConfig. +func NewTracerConfig(options ...TracerOption) TracerConfig { + var config TracerConfig + for _, option := range options { + config = option.apply(config) + } + return config +} + +// TracerOption applies an option to a TracerConfig. +type TracerOption interface { + apply(TracerConfig) TracerConfig +} + +type tracerOptionFunc func(TracerConfig) TracerConfig + +func (fn tracerOptionFunc) apply(cfg TracerConfig) TracerConfig { + return fn(cfg) +} + +// SpanConfig is a group of options for a Span. +type SpanConfig struct { + attributes []attribute.KeyValue + timestamp time.Time + links []Link + newRoot bool + spanKind SpanKind + stackTrace bool +} + +// Attributes describe the associated qualities of a Span. +func (cfg *SpanConfig) Attributes() []attribute.KeyValue { + return cfg.attributes +} + +// Timestamp is a time in a Span life-cycle. +func (cfg *SpanConfig) Timestamp() time.Time { + return cfg.timestamp +} + +// StackTrace checks whether stack trace capturing is enabled. +func (cfg *SpanConfig) StackTrace() bool { + return cfg.stackTrace +} + +// Links are the associations a Span has with other Spans. +func (cfg *SpanConfig) Links() []Link { + return cfg.links +} + +// NewRoot identifies a Span as the root Span for a new trace. This is +// commonly used when an existing trace crosses trust boundaries and the +// remote parent span context should be ignored for security. +func (cfg *SpanConfig) NewRoot() bool { + return cfg.newRoot +} + +// SpanKind is the role a Span has in a trace. +func (cfg *SpanConfig) SpanKind() SpanKind { + return cfg.spanKind +} + +// NewSpanStartConfig applies all the options to a returned SpanConfig. +// No validation is performed on the returned SpanConfig (e.g. no uniqueness +// checking or bounding of data), it is left to the SDK to perform this +// action. +func NewSpanStartConfig(options ...SpanStartOption) SpanConfig { + var c SpanConfig + for _, option := range options { + c = option.applySpanStart(c) + } + return c +} + +// NewSpanEndConfig applies all the options to a returned SpanConfig. +// No validation is performed on the returned SpanConfig (e.g. no uniqueness +// checking or bounding of data), it is left to the SDK to perform this +// action. +func NewSpanEndConfig(options ...SpanEndOption) SpanConfig { + var c SpanConfig + for _, option := range options { + c = option.applySpanEnd(c) + } + return c +} + +// SpanStartOption applies an option to a SpanConfig. These options are applicable +// only when the span is created. +type SpanStartOption interface { + applySpanStart(SpanConfig) SpanConfig +} + +type spanOptionFunc func(SpanConfig) SpanConfig + +func (fn spanOptionFunc) applySpanStart(cfg SpanConfig) SpanConfig { + return fn(cfg) +} + +// SpanEndOption applies an option to a SpanConfig. These options are +// applicable only when the span is ended. +type SpanEndOption interface { + applySpanEnd(SpanConfig) SpanConfig +} + +// EventConfig is a group of options for an Event. +type EventConfig struct { + attributes []attribute.KeyValue + timestamp time.Time + stackTrace bool +} + +// Attributes describe the associated qualities of an Event. +func (cfg *EventConfig) Attributes() []attribute.KeyValue { + return cfg.attributes +} + +// Timestamp is a time in an Event life-cycle. +func (cfg *EventConfig) Timestamp() time.Time { + return cfg.timestamp +} + +// StackTrace checks whether stack trace capturing is enabled. +func (cfg *EventConfig) StackTrace() bool { + return cfg.stackTrace +} + +// NewEventConfig applies all the EventOptions to a returned EventConfig. If no +// timestamp option is passed, the returned EventConfig will have a Timestamp +// set to the call time, otherwise no validation is performed on the returned +// EventConfig. +func NewEventConfig(options ...EventOption) EventConfig { + var c EventConfig + for _, option := range options { + c = option.applyEvent(c) + } + if c.timestamp.IsZero() { + c.timestamp = time.Now() + } + return c +} + +// EventOption applies span event options to an EventConfig. +type EventOption interface { + applyEvent(EventConfig) EventConfig +} + +// SpanOption are options that can be used at both the beginning and end of a span. +type SpanOption interface { + SpanStartOption + SpanEndOption +} + +// SpanStartEventOption are options that can be used at the start of a span, or with an event. +type SpanStartEventOption interface { + SpanStartOption + EventOption +} + +// SpanEndEventOption are options that can be used at the end of a span, or with an event. +type SpanEndEventOption interface { + SpanEndOption + EventOption +} + +type attributeOption []attribute.KeyValue + +func (o attributeOption) applySpan(c SpanConfig) SpanConfig { + c.attributes = append(c.attributes, []attribute.KeyValue(o)...) + return c +} +func (o attributeOption) applySpanStart(c SpanConfig) SpanConfig { return o.applySpan(c) } +func (o attributeOption) applyEvent(c EventConfig) EventConfig { + c.attributes = append(c.attributes, []attribute.KeyValue(o)...) + return c +} + +var _ SpanStartEventOption = attributeOption{} + +// WithAttributes adds the attributes related to a span life-cycle event. +// These attributes are used to describe the work a Span represents when this +// option is provided to a Span's start or end events. Otherwise, these +// attributes provide additional information about the event being recorded +// (e.g. error, state change, processing progress, system event). +// +// If multiple of these options are passed the attributes of each successive +// option will extend the attributes instead of overwriting. There is no +// guarantee of uniqueness in the resulting attributes. +func WithAttributes(attributes ...attribute.KeyValue) SpanStartEventOption { + return attributeOption(attributes) +} + +// SpanEventOption are options that can be used with an event or a span. +type SpanEventOption interface { + SpanOption + EventOption +} + +type timestampOption time.Time + +func (o timestampOption) applySpan(c SpanConfig) SpanConfig { + c.timestamp = time.Time(o) + return c +} +func (o timestampOption) applySpanStart(c SpanConfig) SpanConfig { return o.applySpan(c) } +func (o timestampOption) applySpanEnd(c SpanConfig) SpanConfig { return o.applySpan(c) } +func (o timestampOption) applyEvent(c EventConfig) EventConfig { + c.timestamp = time.Time(o) + return c +} + +var _ SpanEventOption = timestampOption{} + +// WithTimestamp sets the time of a Span or Event life-cycle moment (e.g. +// started, stopped, errored). +func WithTimestamp(t time.Time) SpanEventOption { + return timestampOption(t) +} + +type stackTraceOption bool + +func (o stackTraceOption) applyEvent(c EventConfig) EventConfig { + c.stackTrace = bool(o) + return c +} + +func (o stackTraceOption) applySpan(c SpanConfig) SpanConfig { + c.stackTrace = bool(o) + return c +} +func (o stackTraceOption) applySpanEnd(c SpanConfig) SpanConfig { return o.applySpan(c) } + +// WithStackTrace sets the flag to capture the error with stack trace (e.g. true, false). +func WithStackTrace(b bool) SpanEndEventOption { + return stackTraceOption(b) +} + +// WithLinks adds links to a Span. The links are added to the existing Span +// links, i.e. this does not overwrite. Links with invalid span context are ignored. +func WithLinks(links ...Link) SpanStartOption { + return spanOptionFunc(func(cfg SpanConfig) SpanConfig { + cfg.links = append(cfg.links, links...) + return cfg + }) +} + +// WithNewRoot specifies that the Span should be treated as a root Span. Any +// existing parent span context will be ignored when defining the Span's trace +// identifiers. +func WithNewRoot() SpanStartOption { + return spanOptionFunc(func(cfg SpanConfig) SpanConfig { + cfg.newRoot = true + return cfg + }) +} + +// WithSpanKind sets the SpanKind of a Span. +func WithSpanKind(kind SpanKind) SpanStartOption { + return spanOptionFunc(func(cfg SpanConfig) SpanConfig { + cfg.spanKind = kind + return cfg + }) +} + +// WithInstrumentationVersion sets the instrumentation version. +func WithInstrumentationVersion(version string) TracerOption { + return tracerOptionFunc(func(cfg TracerConfig) TracerConfig { + cfg.instrumentationVersion = version + return cfg + }) +} + +// WithInstrumentationAttributes sets the instrumentation attributes. +// +// The passed attributes will be de-duplicated. +func WithInstrumentationAttributes(attr ...attribute.KeyValue) TracerOption { + return tracerOptionFunc(func(config TracerConfig) TracerConfig { + config.attrs = attribute.NewSet(attr...) + return config + }) +} + +// WithSchemaURL sets the schema URL for the Tracer. +func WithSchemaURL(schemaURL string) TracerOption { + return tracerOptionFunc(func(cfg TracerConfig) TracerConfig { + cfg.schemaURL = schemaURL + return cfg + }) +} diff --git a/vendor/go.opentelemetry.io/otel/trace/context.go b/vendor/go.opentelemetry.io/otel/trace/context.go new file mode 100644 index 0000000000..76f9a083c4 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/context.go @@ -0,0 +1,61 @@ +// Copyright The OpenTelemetry 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 trace // import "go.opentelemetry.io/otel/trace" + +import "context" + +type traceContextKeyType int + +const currentSpanKey traceContextKeyType = iota + +// ContextWithSpan returns a copy of parent with span set as the current Span. +func ContextWithSpan(parent context.Context, span Span) context.Context { + return context.WithValue(parent, currentSpanKey, span) +} + +// ContextWithSpanContext returns a copy of parent with sc as the current +// Span. The Span implementation that wraps sc is non-recording and performs +// no operations other than to return sc as the SpanContext from the +// SpanContext method. +func ContextWithSpanContext(parent context.Context, sc SpanContext) context.Context { + return ContextWithSpan(parent, nonRecordingSpan{sc: sc}) +} + +// ContextWithRemoteSpanContext returns a copy of parent with rsc set explicly +// as a remote SpanContext and as the current Span. The Span implementation +// that wraps rsc is non-recording and performs no operations other than to +// return rsc as the SpanContext from the SpanContext method. +func ContextWithRemoteSpanContext(parent context.Context, rsc SpanContext) context.Context { + return ContextWithSpanContext(parent, rsc.WithRemote(true)) +} + +// SpanFromContext returns the current Span from ctx. +// +// If no Span is currently set in ctx an implementation of a Span that +// performs no operations is returned. +func SpanFromContext(ctx context.Context) Span { + if ctx == nil { + return noopSpan{} + } + if span, ok := ctx.Value(currentSpanKey).(Span); ok { + return span + } + return noopSpan{} +} + +// SpanContextFromContext returns the current Span's SpanContext. +func SpanContextFromContext(ctx context.Context) SpanContext { + return SpanFromContext(ctx).SpanContext() +} diff --git a/vendor/go.opentelemetry.io/otel/trace/doc.go b/vendor/go.opentelemetry.io/otel/trace/doc.go new file mode 100644 index 0000000000..440f3d7565 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/doc.go @@ -0,0 +1,130 @@ +// Copyright The OpenTelemetry 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 trace provides an implementation of the tracing part of the +OpenTelemetry API. + +To participate in distributed traces a Span needs to be created for the +operation being performed as part of a traced workflow. In its simplest form: + + var tracer trace.Tracer + + func init() { + tracer = otel.Tracer("instrumentation/package/name") + } + + func operation(ctx context.Context) { + var span trace.Span + ctx, span = tracer.Start(ctx, "operation") + defer span.End() + // ... + } + +A Tracer is unique to the instrumentation and is used to create Spans. +Instrumentation should be designed to accept a TracerProvider from which it +can create its own unique Tracer. Alternatively, the registered global +TracerProvider from the go.opentelemetry.io/otel package can be used as +a default. + + const ( + name = "instrumentation/package/name" + version = "0.1.0" + ) + + type Instrumentation struct { + tracer trace.Tracer + } + + func NewInstrumentation(tp trace.TracerProvider) *Instrumentation { + if tp == nil { + tp = otel.TracerProvider() + } + return &Instrumentation{ + tracer: tp.Tracer(name, trace.WithInstrumentationVersion(version)), + } + } + + func operation(ctx context.Context, inst *Instrumentation) { + var span trace.Span + ctx, span = inst.tracer.Start(ctx, "operation") + defer span.End() + // ... + } + +# API Implementations + +This package does not conform to the standard Go versioning policy; all of its +interfaces may have methods added to them without a package major version bump. +This non-standard API evolution could surprise an uninformed implementation +author. They could unknowingly build their implementation in a way that would +result in a runtime panic for their users that update to the new API. + +The API is designed to help inform an instrumentation author about this +non-standard API evolution. It requires them to choose a default behavior for +unimplemented interface methods. There are three behavior choices they can +make: + + - Compilation failure + - Panic + - Default to another implementation + +All interfaces in this API embed a corresponding interface from +[go.opentelemetry.io/otel/trace/embedded]. If an author wants the default +behavior of their implementations to be a compilation failure, signaling to +their users they need to update to the latest version of that implementation, +they need to embed the corresponding interface from +[go.opentelemetry.io/otel/trace/embedded] in their implementation. For +example, + + import "go.opentelemetry.io/otel/trace/embedded" + + type TracerProvider struct { + embedded.TracerProvider + // ... + } + +If an author wants the default behavior of their implementations to panic, they +can embed the API interface directly. + + import "go.opentelemetry.io/otel/trace" + + type TracerProvider struct { + trace.TracerProvider + // ... + } + +This option is not recommended. It will lead to publishing packages that +contain runtime panics when users update to newer versions of +[go.opentelemetry.io/otel/trace], which may be done with a trasitive +dependency. + +Finally, an author can embed another implementation in theirs. The embedded +implementation will be used for methods not defined by the author. For example, +an author who wants to default to silently dropping the call can use +[go.opentelemetry.io/otel/trace/noop]: + + import "go.opentelemetry.io/otel/trace/noop" + + type TracerProvider struct { + noop.TracerProvider + // ... + } + +It is strongly recommended that authors only embed +[go.opentelemetry.io/otel/trace/noop] if they choose this default behavior. +That implementation is the only one OpenTelemetry authors can guarantee will +fully implement all the API interfaces when a user updates their API. +*/ +package trace // import "go.opentelemetry.io/otel/trace" diff --git a/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go b/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go new file mode 100644 index 0000000000..898db5a754 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go @@ -0,0 +1,56 @@ +// Copyright The OpenTelemetry 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 embedded provides interfaces embedded within the [OpenTelemetry +// trace API]. +// +// Implementers of the [OpenTelemetry trace API] can embed the relevant type +// from this package into their implementation directly. Doing so will result +// in a compilation error for users when the [OpenTelemetry trace API] is +// extended (which is something that can happen without a major version bump of +// the API package). +// +// [OpenTelemetry trace API]: https://pkg.go.dev/go.opentelemetry.io/otel/trace +package embedded // import "go.opentelemetry.io/otel/trace/embedded" + +// TracerProvider is embedded in +// [go.opentelemetry.io/otel/trace.TracerProvider]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/trace.TracerProvider] if you want users to +// experience a compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/trace.TracerProvider] +// interface is extended (which is something that can happen without a major +// version bump of the API package). +type TracerProvider interface{ tracerProvider() } + +// Tracer is embedded in [go.opentelemetry.io/otel/trace.Tracer]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/trace.Tracer] if you want users to experience a +// compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/trace.Tracer] interface +// is extended (which is something that can happen without a major version bump +// of the API package). +type Tracer interface{ tracer() } + +// Span is embedded in [go.opentelemetry.io/otel/trace.Span]. +// +// Embed this interface in your implementation of the +// [go.opentelemetry.io/otel/trace.Span] if you want users to experience a +// compilation error, signaling they need to update to your latest +// implementation, when the [go.opentelemetry.io/otel/trace.Span] interface is +// extended (which is something that can happen without a major version bump of +// the API package). +type Span interface{ span() } diff --git a/vendor/go.opentelemetry.io/otel/trace/nonrecording.go b/vendor/go.opentelemetry.io/otel/trace/nonrecording.go new file mode 100644 index 0000000000..88fcb81611 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/nonrecording.go @@ -0,0 +1,27 @@ +// Copyright The OpenTelemetry 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 trace // import "go.opentelemetry.io/otel/trace" + +// nonRecordingSpan is a minimal implementation of a Span that wraps a +// SpanContext. It performs no operations other than to return the wrapped +// SpanContext. +type nonRecordingSpan struct { + noopSpan + + sc SpanContext +} + +// SpanContext returns the wrapped SpanContext. +func (s nonRecordingSpan) SpanContext() SpanContext { return s.sc } diff --git a/vendor/go.opentelemetry.io/otel/trace/noop.go b/vendor/go.opentelemetry.io/otel/trace/noop.go new file mode 100644 index 0000000000..c125491cae --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/noop.go @@ -0,0 +1,93 @@ +// Copyright The OpenTelemetry 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 trace // import "go.opentelemetry.io/otel/trace" + +import ( + "context" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace/embedded" +) + +// NewNoopTracerProvider returns an implementation of TracerProvider that +// performs no operations. The Tracer and Spans created from the returned +// TracerProvider also perform no operations. +// +// Deprecated: Use [go.opentelemetry.io/otel/trace/noop.NewTracerProvider] +// instead. +func NewNoopTracerProvider() TracerProvider { + return noopTracerProvider{} +} + +type noopTracerProvider struct{ embedded.TracerProvider } + +var _ TracerProvider = noopTracerProvider{} + +// Tracer returns noop implementation of Tracer. +func (p noopTracerProvider) Tracer(string, ...TracerOption) Tracer { + return noopTracer{} +} + +// noopTracer is an implementation of Tracer that performs no operations. +type noopTracer struct{ embedded.Tracer } + +var _ Tracer = noopTracer{} + +// Start carries forward a non-recording Span, if one is present in the context, otherwise it +// creates a no-op Span. +func (t noopTracer) Start(ctx context.Context, name string, _ ...SpanStartOption) (context.Context, Span) { + span := SpanFromContext(ctx) + if _, ok := span.(nonRecordingSpan); !ok { + // span is likely already a noopSpan, but let's be sure + span = noopSpan{} + } + return ContextWithSpan(ctx, span), span +} + +// noopSpan is an implementation of Span that performs no operations. +type noopSpan struct{ embedded.Span } + +var _ Span = noopSpan{} + +// SpanContext returns an empty span context. +func (noopSpan) SpanContext() SpanContext { return SpanContext{} } + +// IsRecording always returns false. +func (noopSpan) IsRecording() bool { return false } + +// SetStatus does nothing. +func (noopSpan) SetStatus(codes.Code, string) {} + +// SetError does nothing. +func (noopSpan) SetError(bool) {} + +// SetAttributes does nothing. +func (noopSpan) SetAttributes(...attribute.KeyValue) {} + +// End does nothing. +func (noopSpan) End(...SpanEndOption) {} + +// RecordError does nothing. +func (noopSpan) RecordError(error, ...EventOption) {} + +// AddEvent does nothing. +func (noopSpan) AddEvent(string, ...EventOption) {} + +// SetName does nothing. +func (noopSpan) SetName(string) {} + +// TracerProvider returns a no-op TracerProvider. +func (noopSpan) TracerProvider() TracerProvider { return noopTracerProvider{} } diff --git a/vendor/go.opentelemetry.io/otel/trace/trace.go b/vendor/go.opentelemetry.io/otel/trace/trace.go new file mode 100644 index 0000000000..26a4b2260e --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/trace.go @@ -0,0 +1,577 @@ +// Copyright The OpenTelemetry 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 trace // import "go.opentelemetry.io/otel/trace" + +import ( + "bytes" + "context" + "encoding/hex" + "encoding/json" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace/embedded" +) + +const ( + // FlagsSampled is a bitmask with the sampled bit set. A SpanContext + // with the sampling bit set means the span is sampled. + FlagsSampled = TraceFlags(0x01) + + errInvalidHexID errorConst = "trace-id and span-id can only contain [0-9a-f] characters, all lowercase" + + errInvalidTraceIDLength errorConst = "hex encoded trace-id must have length equals to 32" + errNilTraceID errorConst = "trace-id can't be all zero" + + errInvalidSpanIDLength errorConst = "hex encoded span-id must have length equals to 16" + errNilSpanID errorConst = "span-id can't be all zero" +) + +type errorConst string + +func (e errorConst) Error() string { + return string(e) +} + +// TraceID is a unique identity of a trace. +// nolint:revive // revive complains about stutter of `trace.TraceID`. +type TraceID [16]byte + +var ( + nilTraceID TraceID + _ json.Marshaler = nilTraceID +) + +// IsValid checks whether the trace TraceID is valid. A valid trace ID does +// not consist of zeros only. +func (t TraceID) IsValid() bool { + return !bytes.Equal(t[:], nilTraceID[:]) +} + +// MarshalJSON implements a custom marshal function to encode TraceID +// as a hex string. +func (t TraceID) MarshalJSON() ([]byte, error) { + return json.Marshal(t.String()) +} + +// String returns the hex string representation form of a TraceID. +func (t TraceID) String() string { + return hex.EncodeToString(t[:]) +} + +// SpanID is a unique identity of a span in a trace. +type SpanID [8]byte + +var ( + nilSpanID SpanID + _ json.Marshaler = nilSpanID +) + +// IsValid checks whether the SpanID is valid. A valid SpanID does not consist +// of zeros only. +func (s SpanID) IsValid() bool { + return !bytes.Equal(s[:], nilSpanID[:]) +} + +// MarshalJSON implements a custom marshal function to encode SpanID +// as a hex string. +func (s SpanID) MarshalJSON() ([]byte, error) { + return json.Marshal(s.String()) +} + +// String returns the hex string representation form of a SpanID. +func (s SpanID) String() string { + return hex.EncodeToString(s[:]) +} + +// TraceIDFromHex returns a TraceID from a hex string if it is compliant with +// the W3C trace-context specification. See more at +// https://www.w3.org/TR/trace-context/#trace-id +// nolint:revive // revive complains about stutter of `trace.TraceIDFromHex`. +func TraceIDFromHex(h string) (TraceID, error) { + t := TraceID{} + if len(h) != 32 { + return t, errInvalidTraceIDLength + } + + if err := decodeHex(h, t[:]); err != nil { + return t, err + } + + if !t.IsValid() { + return t, errNilTraceID + } + return t, nil +} + +// SpanIDFromHex returns a SpanID from a hex string if it is compliant +// with the w3c trace-context specification. +// See more at https://www.w3.org/TR/trace-context/#parent-id +func SpanIDFromHex(h string) (SpanID, error) { + s := SpanID{} + if len(h) != 16 { + return s, errInvalidSpanIDLength + } + + if err := decodeHex(h, s[:]); err != nil { + return s, err + } + + if !s.IsValid() { + return s, errNilSpanID + } + return s, nil +} + +func decodeHex(h string, b []byte) error { + for _, r := range h { + switch { + case 'a' <= r && r <= 'f': + continue + case '0' <= r && r <= '9': + continue + default: + return errInvalidHexID + } + } + + decoded, err := hex.DecodeString(h) + if err != nil { + return err + } + + copy(b, decoded) + return nil +} + +// TraceFlags contains flags that can be set on a SpanContext. +type TraceFlags byte //nolint:revive // revive complains about stutter of `trace.TraceFlags`. + +// IsSampled returns if the sampling bit is set in the TraceFlags. +func (tf TraceFlags) IsSampled() bool { + return tf&FlagsSampled == FlagsSampled +} + +// WithSampled sets the sampling bit in a new copy of the TraceFlags. +func (tf TraceFlags) WithSampled(sampled bool) TraceFlags { // nolint:revive // sampled is not a control flag. + if sampled { + return tf | FlagsSampled + } + + return tf &^ FlagsSampled +} + +// MarshalJSON implements a custom marshal function to encode TraceFlags +// as a hex string. +func (tf TraceFlags) MarshalJSON() ([]byte, error) { + return json.Marshal(tf.String()) +} + +// String returns the hex string representation form of TraceFlags. +func (tf TraceFlags) String() string { + return hex.EncodeToString([]byte{byte(tf)}[:]) +} + +// SpanContextConfig contains mutable fields usable for constructing +// an immutable SpanContext. +type SpanContextConfig struct { + TraceID TraceID + SpanID SpanID + TraceFlags TraceFlags + TraceState TraceState + Remote bool +} + +// NewSpanContext constructs a SpanContext using values from the provided +// SpanContextConfig. +func NewSpanContext(config SpanContextConfig) SpanContext { + return SpanContext{ + traceID: config.TraceID, + spanID: config.SpanID, + traceFlags: config.TraceFlags, + traceState: config.TraceState, + remote: config.Remote, + } +} + +// SpanContext contains identifying trace information about a Span. +type SpanContext struct { + traceID TraceID + spanID SpanID + traceFlags TraceFlags + traceState TraceState + remote bool +} + +var _ json.Marshaler = SpanContext{} + +// IsValid returns if the SpanContext is valid. A valid span context has a +// valid TraceID and SpanID. +func (sc SpanContext) IsValid() bool { + return sc.HasTraceID() && sc.HasSpanID() +} + +// IsRemote indicates whether the SpanContext represents a remotely-created Span. +func (sc SpanContext) IsRemote() bool { + return sc.remote +} + +// WithRemote returns a copy of sc with the Remote property set to remote. +func (sc SpanContext) WithRemote(remote bool) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: sc.spanID, + traceFlags: sc.traceFlags, + traceState: sc.traceState, + remote: remote, + } +} + +// TraceID returns the TraceID from the SpanContext. +func (sc SpanContext) TraceID() TraceID { + return sc.traceID +} + +// HasTraceID checks if the SpanContext has a valid TraceID. +func (sc SpanContext) HasTraceID() bool { + return sc.traceID.IsValid() +} + +// WithTraceID returns a new SpanContext with the TraceID replaced. +func (sc SpanContext) WithTraceID(traceID TraceID) SpanContext { + return SpanContext{ + traceID: traceID, + spanID: sc.spanID, + traceFlags: sc.traceFlags, + traceState: sc.traceState, + remote: sc.remote, + } +} + +// SpanID returns the SpanID from the SpanContext. +func (sc SpanContext) SpanID() SpanID { + return sc.spanID +} + +// HasSpanID checks if the SpanContext has a valid SpanID. +func (sc SpanContext) HasSpanID() bool { + return sc.spanID.IsValid() +} + +// WithSpanID returns a new SpanContext with the SpanID replaced. +func (sc SpanContext) WithSpanID(spanID SpanID) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: spanID, + traceFlags: sc.traceFlags, + traceState: sc.traceState, + remote: sc.remote, + } +} + +// TraceFlags returns the flags from the SpanContext. +func (sc SpanContext) TraceFlags() TraceFlags { + return sc.traceFlags +} + +// IsSampled returns if the sampling bit is set in the SpanContext's TraceFlags. +func (sc SpanContext) IsSampled() bool { + return sc.traceFlags.IsSampled() +} + +// WithTraceFlags returns a new SpanContext with the TraceFlags replaced. +func (sc SpanContext) WithTraceFlags(flags TraceFlags) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: sc.spanID, + traceFlags: flags, + traceState: sc.traceState, + remote: sc.remote, + } +} + +// TraceState returns the TraceState from the SpanContext. +func (sc SpanContext) TraceState() TraceState { + return sc.traceState +} + +// WithTraceState returns a new SpanContext with the TraceState replaced. +func (sc SpanContext) WithTraceState(state TraceState) SpanContext { + return SpanContext{ + traceID: sc.traceID, + spanID: sc.spanID, + traceFlags: sc.traceFlags, + traceState: state, + remote: sc.remote, + } +} + +// Equal is a predicate that determines whether two SpanContext values are equal. +func (sc SpanContext) Equal(other SpanContext) bool { + return sc.traceID == other.traceID && + sc.spanID == other.spanID && + sc.traceFlags == other.traceFlags && + sc.traceState.String() == other.traceState.String() && + sc.remote == other.remote +} + +// MarshalJSON implements a custom marshal function to encode a SpanContext. +func (sc SpanContext) MarshalJSON() ([]byte, error) { + return json.Marshal(SpanContextConfig{ + TraceID: sc.traceID, + SpanID: sc.spanID, + TraceFlags: sc.traceFlags, + TraceState: sc.traceState, + Remote: sc.remote, + }) +} + +// Span is the individual component of a trace. It represents a single named +// and timed operation of a workflow that is traced. A Tracer is used to +// create a Span and it is then up to the operation the Span represents to +// properly end the Span when the operation itself ends. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Span interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Span + + // End completes the Span. The Span is considered complete and ready to be + // delivered through the rest of the telemetry pipeline after this method + // is called. Therefore, updates to the Span are not allowed after this + // method has been called. + End(options ...SpanEndOption) + + // AddEvent adds an event with the provided name and options. + AddEvent(name string, options ...EventOption) + + // IsRecording returns the recording state of the Span. It will return + // true if the Span is active and events can be recorded. + IsRecording() bool + + // RecordError will record err as an exception span event for this span. An + // additional call to SetStatus is required if the Status of the Span should + // be set to Error, as this method does not change the Span status. If this + // span is not being recorded or err is nil then this method does nothing. + RecordError(err error, options ...EventOption) + + // SpanContext returns the SpanContext of the Span. The returned SpanContext + // is usable even after the End method has been called for the Span. + SpanContext() SpanContext + + // SetStatus sets the status of the Span in the form of a code and a + // description, provided the status hasn't already been set to a higher + // value before (OK > Error > Unset). The description is only included in a + // status when the code is for an error. + SetStatus(code codes.Code, description string) + + // SetName sets the Span name. + SetName(name string) + + // SetAttributes sets kv as attributes of the Span. If a key from kv + // already exists for an attribute of the Span it will be overwritten with + // the value contained in kv. + SetAttributes(kv ...attribute.KeyValue) + + // TracerProvider returns a TracerProvider that can be used to generate + // additional Spans on the same telemetry pipeline as the current Span. + TracerProvider() TracerProvider +} + +// Link is the relationship between two Spans. The relationship can be within +// the same Trace or across different Traces. +// +// For example, a Link is used in the following situations: +// +// 1. Batch Processing: A batch of operations may contain operations +// associated with one or more traces/spans. Since there can only be one +// parent SpanContext, a Link is used to keep reference to the +// SpanContext of all operations in the batch. +// 2. Public Endpoint: A SpanContext for an in incoming client request on a +// public endpoint should be considered untrusted. In such a case, a new +// trace with its own identity and sampling decision needs to be created, +// but this new trace needs to be related to the original trace in some +// form. A Link is used to keep reference to the original SpanContext and +// track the relationship. +type Link struct { + // SpanContext of the linked Span. + SpanContext SpanContext + + // Attributes describe the aspects of the link. + Attributes []attribute.KeyValue +} + +// LinkFromContext returns a link encapsulating the SpanContext in the provided ctx. +func LinkFromContext(ctx context.Context, attrs ...attribute.KeyValue) Link { + return Link{ + SpanContext: SpanContextFromContext(ctx), + Attributes: attrs, + } +} + +// SpanKind is the role a Span plays in a Trace. +type SpanKind int + +// As a convenience, these match the proto definition, see +// https://github.com/open-telemetry/opentelemetry-proto/blob/30d237e1ff3ab7aa50e0922b5bebdd93505090af/opentelemetry/proto/trace/v1/trace.proto#L101-L129 +// +// The unspecified value is not a valid `SpanKind`. Use `ValidateSpanKind()` +// to coerce a span kind to a valid value. +const ( + // SpanKindUnspecified is an unspecified SpanKind and is not a valid + // SpanKind. SpanKindUnspecified should be replaced with SpanKindInternal + // if it is received. + SpanKindUnspecified SpanKind = 0 + // SpanKindInternal is a SpanKind for a Span that represents an internal + // operation within an application. + SpanKindInternal SpanKind = 1 + // SpanKindServer is a SpanKind for a Span that represents the operation + // of handling a request from a client. + SpanKindServer SpanKind = 2 + // SpanKindClient is a SpanKind for a Span that represents the operation + // of client making a request to a server. + SpanKindClient SpanKind = 3 + // SpanKindProducer is a SpanKind for a Span that represents the operation + // of a producer sending a message to a message broker. Unlike + // SpanKindClient and SpanKindServer, there is often no direct + // relationship between this kind of Span and a SpanKindConsumer kind. A + // SpanKindProducer Span will end once the message is accepted by the + // message broker which might not overlap with the processing of that + // message. + SpanKindProducer SpanKind = 4 + // SpanKindConsumer is a SpanKind for a Span that represents the operation + // of a consumer receiving a message from a message broker. Like + // SpanKindProducer Spans, there is often no direct relationship between + // this Span and the Span that produced the message. + SpanKindConsumer SpanKind = 5 +) + +// ValidateSpanKind returns a valid span kind value. This will coerce +// invalid values into the default value, SpanKindInternal. +func ValidateSpanKind(spanKind SpanKind) SpanKind { + switch spanKind { + case SpanKindInternal, + SpanKindServer, + SpanKindClient, + SpanKindProducer, + SpanKindConsumer: + // valid + return spanKind + default: + return SpanKindInternal + } +} + +// String returns the specified name of the SpanKind in lower-case. +func (sk SpanKind) String() string { + switch sk { + case SpanKindInternal: + return "internal" + case SpanKindServer: + return "server" + case SpanKindClient: + return "client" + case SpanKindProducer: + return "producer" + case SpanKindConsumer: + return "consumer" + default: + return "unspecified" + } +} + +// Tracer is the creator of Spans. +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type Tracer interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.Tracer + + // Start creates a span and a context.Context containing the newly-created span. + // + // If the context.Context provided in `ctx` contains a Span then the newly-created + // Span will be a child of that span, otherwise it will be a root span. This behavior + // can be overridden by providing `WithNewRoot()` as a SpanOption, causing the + // newly-created Span to be a root span even if `ctx` contains a Span. + // + // When creating a Span it is recommended to provide all known span attributes using + // the `WithAttributes()` SpanOption as samplers will only have access to the + // attributes provided when a Span is created. + // + // Any Span that is created MUST also be ended. This is the responsibility of the user. + // Implementations of this API may leak memory or other resources if Spans are not ended. + Start(ctx context.Context, spanName string, opts ...SpanStartOption) (context.Context, Span) +} + +// TracerProvider provides Tracers that are used by instrumentation code to +// trace computational workflows. +// +// A TracerProvider is the collection destination of all Spans from Tracers it +// provides, it represents a unique telemetry collection pipeline. How that +// pipeline is defined, meaning how those Spans are collected, processed, and +// where they are exported, depends on its implementation. Instrumentation +// authors do not need to define this implementation, rather just use the +// provided Tracers to instrument code. +// +// Commonly, instrumentation code will accept a TracerProvider implementation +// at runtime from its users or it can simply use the globally registered one +// (see https://pkg.go.dev/go.opentelemetry.io/otel#GetTracerProvider). +// +// Warning: Methods may be added to this interface in minor releases. See +// package documentation on API implementation for information on how to set +// default behavior for unimplemented methods. +type TracerProvider interface { + // Users of the interface can ignore this. This embedded type is only used + // by implementations of this interface. See the "API Implementations" + // section of the package documentation for more information. + embedded.TracerProvider + + // Tracer returns a unique Tracer scoped to be used by instrumentation code + // to trace computational workflows. The scope and identity of that + // instrumentation code is uniquely defined by the name and options passed. + // + // The passed name needs to uniquely identify instrumentation code. + // Therefore, it is recommended that name is the Go package name of the + // library providing instrumentation (note: not the code being + // instrumented). Instrumentation libraries can have multiple versions, + // therefore, the WithInstrumentationVersion option should be used to + // distinguish these different codebases. Additionally, instrumentation + // libraries may sometimes use traces to communicate different domains of + // workflow data (i.e. using spans to communicate workflow events only). If + // this is the case, the WithScopeAttributes option should be used to + // uniquely identify Tracers that handle the different domains of workflow + // data. + // + // If the same name and options are passed multiple times, the same Tracer + // will be returned (it is up to the implementation if this will be the + // same underlying instance of that Tracer or not). It is not necessary to + // call this multiple times with the same name and options to get an + // up-to-date Tracer. All implementations will ensure any TracerProvider + // configuration changes are propagated to all provided Tracers. + // + // If name is empty, then an implementation defined default name will be + // used instead. + // + // This method is safe to call concurrently. + Tracer(name string, options ...TracerOption) Tracer +} diff --git a/vendor/go.opentelemetry.io/otel/trace/tracestate.go b/vendor/go.opentelemetry.io/otel/trace/tracestate.go new file mode 100644 index 0000000000..db936ba5b7 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/trace/tracestate.go @@ -0,0 +1,331 @@ +// Copyright The OpenTelemetry 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 trace // import "go.opentelemetry.io/otel/trace" + +import ( + "encoding/json" + "fmt" + "strings" +) + +const ( + maxListMembers = 32 + + listDelimiters = "," + memberDelimiter = "=" + + errInvalidKey errorConst = "invalid tracestate key" + errInvalidValue errorConst = "invalid tracestate value" + errInvalidMember errorConst = "invalid tracestate list-member" + errMemberNumber errorConst = "too many list-members in tracestate" + errDuplicate errorConst = "duplicate list-member in tracestate" +) + +type member struct { + Key string + Value string +} + +// according to (chr = %x20 / (nblk-char = %x21-2B / %x2D-3C / %x3E-7E) ) +// means (chr = %x20-2B / %x2D-3C / %x3E-7E) . +func checkValueChar(v byte) bool { + return v >= '\x20' && v <= '\x7e' && v != '\x2c' && v != '\x3d' +} + +// according to (nblk-chr = %x21-2B / %x2D-3C / %x3E-7E) . +func checkValueLast(v byte) bool { + return v >= '\x21' && v <= '\x7e' && v != '\x2c' && v != '\x3d' +} + +// based on the W3C Trace Context specification +// +// value = (0*255(chr)) nblk-chr +// nblk-chr = %x21-2B / %x2D-3C / %x3E-7E +// chr = %x20 / nblk-chr +// +// see https://www.w3.org/TR/trace-context-1/#value +func checkValue(val string) bool { + n := len(val) + if n == 0 || n > 256 { + return false + } + for i := 0; i < n-1; i++ { + if !checkValueChar(val[i]) { + return false + } + } + return checkValueLast(val[n-1]) +} + +func checkKeyRemain(key string) bool { + // ( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ) + for _, v := range key { + if isAlphaNum(byte(v)) { + continue + } + switch v { + case '_', '-', '*', '/': + continue + } + return false + } + return true +} + +// according to +// +// simple-key = lcalpha (0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) +// system-id = lcalpha (0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) +// +// param n is remain part length, should be 255 in simple-key or 13 in system-id. +func checkKeyPart(key string, n int) bool { + if len(key) == 0 { + return false + } + first := key[0] // key's first char + ret := len(key[1:]) <= n + ret = ret && first >= 'a' && first <= 'z' + return ret && checkKeyRemain(key[1:]) +} + +func isAlphaNum(c byte) bool { + if c >= 'a' && c <= 'z' { + return true + } + return c >= '0' && c <= '9' +} + +// according to +// +// tenant-id = ( lcalpha / DIGIT ) 0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ) +// +// param n is remain part length, should be 240 exactly. +func checkKeyTenant(key string, n int) bool { + if len(key) == 0 { + return false + } + return isAlphaNum(key[0]) && len(key[1:]) <= n && checkKeyRemain(key[1:]) +} + +// based on the W3C Trace Context specification +// +// key = simple-key / multi-tenant-key +// simple-key = lcalpha (0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) +// multi-tenant-key = tenant-id "@" system-id +// tenant-id = ( lcalpha / DIGIT ) (0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) +// system-id = lcalpha (0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) +// lcalpha = %x61-7A ; a-z +// +// see https://www.w3.org/TR/trace-context-1/#tracestate-header. +func checkKey(key string) bool { + tenant, system, ok := strings.Cut(key, "@") + if !ok { + return checkKeyPart(key, 255) + } + return checkKeyTenant(tenant, 240) && checkKeyPart(system, 13) +} + +func newMember(key, value string) (member, error) { + if !checkKey(key) { + return member{}, errInvalidKey + } + if !checkValue(value) { + return member{}, errInvalidValue + } + return member{Key: key, Value: value}, nil +} + +func parseMember(m string) (member, error) { + key, val, ok := strings.Cut(m, memberDelimiter) + if !ok { + return member{}, fmt.Errorf("%w: %s", errInvalidMember, m) + } + key = strings.TrimLeft(key, " \t") + val = strings.TrimRight(val, " \t") + result, e := newMember(key, val) + if e != nil { + return member{}, fmt.Errorf("%w: %s", errInvalidMember, m) + } + return result, nil +} + +// String encodes member into a string compliant with the W3C Trace Context +// specification. +func (m member) String() string { + return m.Key + "=" + m.Value +} + +// TraceState provides additional vendor-specific trace identification +// information across different distributed tracing systems. It represents an +// immutable list consisting of key/value pairs, each pair is referred to as a +// list-member. +// +// TraceState conforms to the W3C Trace Context specification +// (https://www.w3.org/TR/trace-context-1). All operations that create or copy +// a TraceState do so by validating all input and will only produce TraceState +// that conform to the specification. Specifically, this means that all +// list-member's key/value pairs are valid, no duplicate list-members exist, +// and the maximum number of list-members (32) is not exceeded. +type TraceState struct { //nolint:revive // revive complains about stutter of `trace.TraceState` + // list is the members in order. + list []member +} + +var _ json.Marshaler = TraceState{} + +// ParseTraceState attempts to decode a TraceState from the passed +// string. It returns an error if the input is invalid according to the W3C +// Trace Context specification. +func ParseTraceState(ts string) (TraceState, error) { + if ts == "" { + return TraceState{}, nil + } + + wrapErr := func(err error) error { + return fmt.Errorf("failed to parse tracestate: %w", err) + } + + var members []member + found := make(map[string]struct{}) + for ts != "" { + var memberStr string + memberStr, ts, _ = strings.Cut(ts, listDelimiters) + if len(memberStr) == 0 { + continue + } + + m, err := parseMember(memberStr) + if err != nil { + return TraceState{}, wrapErr(err) + } + + if _, ok := found[m.Key]; ok { + return TraceState{}, wrapErr(errDuplicate) + } + found[m.Key] = struct{}{} + + members = append(members, m) + if n := len(members); n > maxListMembers { + return TraceState{}, wrapErr(errMemberNumber) + } + } + + return TraceState{list: members}, nil +} + +// MarshalJSON marshals the TraceState into JSON. +func (ts TraceState) MarshalJSON() ([]byte, error) { + return json.Marshal(ts.String()) +} + +// String encodes the TraceState into a string compliant with the W3C +// Trace Context specification. The returned string will be invalid if the +// TraceState contains any invalid members. +func (ts TraceState) String() string { + if len(ts.list) == 0 { + return "" + } + var n int + n += len(ts.list) // member delimiters: '=' + n += len(ts.list) - 1 // list delimiters: ',' + for _, mem := range ts.list { + n += len(mem.Key) + n += len(mem.Value) + } + + var sb strings.Builder + sb.Grow(n) + _, _ = sb.WriteString(ts.list[0].Key) + _ = sb.WriteByte('=') + _, _ = sb.WriteString(ts.list[0].Value) + for i := 1; i < len(ts.list); i++ { + _ = sb.WriteByte(listDelimiters[0]) + _, _ = sb.WriteString(ts.list[i].Key) + _ = sb.WriteByte('=') + _, _ = sb.WriteString(ts.list[i].Value) + } + return sb.String() +} + +// Get returns the value paired with key from the corresponding TraceState +// list-member if it exists, otherwise an empty string is returned. +func (ts TraceState) Get(key string) string { + for _, member := range ts.list { + if member.Key == key { + return member.Value + } + } + + return "" +} + +// Insert adds a new list-member defined by the key/value pair to the +// TraceState. If a list-member already exists for the given key, that +// list-member's value is updated. The new or updated list-member is always +// moved to the beginning of the TraceState as specified by the W3C Trace +// Context specification. +// +// If key or value are invalid according to the W3C Trace Context +// specification an error is returned with the original TraceState. +// +// If adding a new list-member means the TraceState would have more members +// then is allowed, the new list-member will be inserted and the right-most +// list-member will be dropped in the returned TraceState. +func (ts TraceState) Insert(key, value string) (TraceState, error) { + m, err := newMember(key, value) + if err != nil { + return ts, err + } + n := len(ts.list) + found := n + for i := range ts.list { + if ts.list[i].Key == key { + found = i + } + } + cTS := TraceState{} + if found == n && n < maxListMembers { + cTS.list = make([]member, n+1) + } else { + cTS.list = make([]member, n) + } + cTS.list[0] = m + // When the number of members exceeds capacity, drop the "right-most". + copy(cTS.list[1:], ts.list[0:found]) + if found < n { + copy(cTS.list[1+found:], ts.list[found+1:]) + } + return cTS, nil +} + +// Delete returns a copy of the TraceState with the list-member identified by +// key removed. +func (ts TraceState) Delete(key string) TraceState { + members := make([]member, ts.Len()) + copy(members, ts.list) + for i, member := range ts.list { + if member.Key == key { + members = append(members[:i], members[i+1:]...) + // TraceState should contain no duplicate members. + break + } + } + return TraceState{list: members} +} + +// Len returns the number of list-members in the TraceState. +func (ts TraceState) Len() int { + return len(ts.list) +} diff --git a/vendor/go.opentelemetry.io/otel/verify_examples.sh b/vendor/go.opentelemetry.io/otel/verify_examples.sh new file mode 100644 index 0000000000..dbb61a4227 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/verify_examples.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +# Copyright The OpenTelemetry 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 -euo pipefail + +cd $(dirname $0) +TOOLS_DIR=$(pwd)/.tools + +if [ -z "${GOPATH}" ] ; then + printf "GOPATH is not defined.\n" + exit -1 +fi + +if [ ! -d "${GOPATH}" ] ; then + printf "GOPATH ${GOPATH} is invalid \n" + exit -1 +fi + +# Pre-requisites +if ! git diff --quiet; then \ + git status + printf "\n\nError: working tree is not clean\n" + exit -1 +fi + +if [ "$(git tag --contains $(git log -1 --pretty=format:"%H"))" = "" ] ; then + printf "$(git log -1)" + printf "\n\nError: HEAD is not pointing to a tagged version" +fi + +make ${TOOLS_DIR}/gojq + +DIR_TMP="${GOPATH}/src/oteltmp/" +rm -rf $DIR_TMP +mkdir -p $DIR_TMP + +printf "Copy examples to ${DIR_TMP}\n" +cp -a ./example ${DIR_TMP} + +# Update go.mod files +printf "Update go.mod: rename module and remove replace\n" + +PACKAGE_DIRS=$(find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; | egrep 'example' | sed 's/^\.\///' | sort) + +for dir in $PACKAGE_DIRS; do + printf " Update go.mod for $dir\n" + (cd "${DIR_TMP}/${dir}" && \ + # replaces is ("mod1" "mod2" …) + replaces=($(go mod edit -json | ${TOOLS_DIR}/gojq '.Replace[].Old.Path')) && \ + # strip double quotes + replaces=("${replaces[@]%\"}") && \ + replaces=("${replaces[@]#\"}") && \ + # make an array (-dropreplace=mod1 -dropreplace=mod2 …) + dropreplaces=("${replaces[@]/#/-dropreplace=}") && \ + go mod edit -module "oteltmp/${dir}" "${dropreplaces[@]}" && \ + go mod tidy) +done +printf "Update done:\n\n" + +# Build directories that contain main package. These directories are different than +# directories that contain go.mod files. +printf "Build examples:\n" +EXAMPLES=$(./get_main_pkgs.sh ./example) +for ex in $EXAMPLES; do + printf " Build $ex in ${DIR_TMP}/${ex}\n" + (cd "${DIR_TMP}/${ex}" && \ + go build .) +done + +# Cleanup +printf "Remove copied files.\n" +rm -rf $DIR_TMP diff --git a/vendor/go.opentelemetry.io/otel/version.go b/vendor/go.opentelemetry.io/otel/version.go new file mode 100644 index 0000000000..7b2993a1fe --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/version.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry 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 otel // import "go.opentelemetry.io/otel" + +// Version is the current release version of OpenTelemetry in use. +func Version() string { + return "1.24.0" +} diff --git a/vendor/go.opentelemetry.io/otel/versions.yaml b/vendor/go.opentelemetry.io/otel/versions.yaml new file mode 100644 index 0000000000..1b556e6782 --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/versions.yaml @@ -0,0 +1,56 @@ +# Copyright The OpenTelemetry 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. + +module-sets: + stable-v1: + version: v1.24.0 + modules: + - go.opentelemetry.io/otel + - go.opentelemetry.io/otel/bridge/opencensus + - go.opentelemetry.io/otel/bridge/opencensus/test + - go.opentelemetry.io/otel/bridge/opentracing + - go.opentelemetry.io/otel/bridge/opentracing/test + - go.opentelemetry.io/otel/example/dice + - go.opentelemetry.io/otel/example/namedtracer + - go.opentelemetry.io/otel/example/opencensus + - go.opentelemetry.io/otel/example/otel-collector + - go.opentelemetry.io/otel/example/passthrough + - go.opentelemetry.io/otel/example/zipkin + - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc + - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp + - go.opentelemetry.io/otel/exporters/otlp/otlptrace + - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc + - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp + - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric + - go.opentelemetry.io/otel/exporters/stdout/stdouttrace + - go.opentelemetry.io/otel/exporters/zipkin + - go.opentelemetry.io/otel/metric + - go.opentelemetry.io/otel/sdk + - go.opentelemetry.io/otel/sdk/metric + - go.opentelemetry.io/otel/trace + experimental-metrics: + version: v0.46.0 + modules: + - go.opentelemetry.io/otel/example/prometheus + - go.opentelemetry.io/otel/exporters/prometheus + experimental-logs: + version: v0.0.1-alpha + modules: + - go.opentelemetry.io/otel/log + experimental-schema: + version: v0.0.7 + modules: + - go.opentelemetry.io/otel/schema +excluded-modules: + - go.opentelemetry.io/otel/internal/tools diff --git a/vendor/go.uber.org/atomic/.gitignore b/vendor/go.uber.org/atomic/.gitignore index c3fa253893..2e337a0ed5 100644 --- a/vendor/go.uber.org/atomic/.gitignore +++ b/vendor/go.uber.org/atomic/.gitignore @@ -10,3 +10,6 @@ lint.log # Profiling output *.prof + +# Output of fossa analyzer +/fossa diff --git a/vendor/go.uber.org/atomic/.travis.yml b/vendor/go.uber.org/atomic/.travis.yml deleted file mode 100644 index 13d0a4f254..0000000000 --- a/vendor/go.uber.org/atomic/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -sudo: false -language: go -go_import_path: go.uber.org/atomic - -env: - global: - - GO111MODULE=on - -matrix: - include: - - go: oldstable - - go: stable - env: LINT=1 - -cache: - directories: - - vendor - -before_install: - - go version - -script: - - test -z "$LINT" || make lint - - make cover - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/go.uber.org/atomic/CHANGELOG.md b/vendor/go.uber.org/atomic/CHANGELOG.md index 24c0274dc3..6f87f33fa9 100644 --- a/vendor/go.uber.org/atomic/CHANGELOG.md +++ b/vendor/go.uber.org/atomic/CHANGELOG.md @@ -4,6 +4,47 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.11.0] - 2023-05-02 +### Fixed +- Fix initialization of `Value` wrappers. + +### Added +- Add `String` method to `atomic.Pointer[T]` type allowing users to safely print +underlying values of pointers. + +[1.11.0]: https://github.com/uber-go/atomic/compare/v1.10.0...v1.11.0 + +## [1.10.0] - 2022-08-11 +### Added +- Add `atomic.Float32` type for atomic operations on `float32`. +- Add `CompareAndSwap` and `Swap` methods to `atomic.String`, `atomic.Error`, + and `atomic.Value`. +- Add generic `atomic.Pointer[T]` type for atomic operations on pointers of any + type. This is present only for Go 1.18 or higher, and is a drop-in for + replacement for the standard library's `sync/atomic.Pointer` type. + +### Changed +- Deprecate `CAS` methods on all types in favor of corresponding + `CompareAndSwap` methods. + +Thanks to @eNV25 and @icpd for their contributions to this release. + +[1.10.0]: https://github.com/uber-go/atomic/compare/v1.9.0...v1.10.0 + +## [1.9.0] - 2021-07-15 +### Added +- Add `Float64.Swap` to match int atomic operations. +- Add `atomic.Time` type for atomic operations on `time.Time` values. + +[1.9.0]: https://github.com/uber-go/atomic/compare/v1.8.0...v1.9.0 + +## [1.8.0] - 2021-06-09 +### Added +- Add `atomic.Uintptr` type for atomic operations on `uintptr` values. +- Add `atomic.UnsafePointer` type for atomic operations on `unsafe.Pointer` values. + +[1.8.0]: https://github.com/uber-go/atomic/compare/v1.7.0...v1.8.0 + ## [1.7.0] - 2020-09-14 ### Added - Support JSON serialization and deserialization of primitive atomic types. @@ -15,32 +56,46 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed - Remove dependency on `golang.org/x/{lint, tools}`. +[1.7.0]: https://github.com/uber-go/atomic/compare/v1.6.0...v1.7.0 + ## [1.6.0] - 2020-02-24 ### Changed - Drop library dependency on `golang.org/x/{lint, tools}`. +[1.6.0]: https://github.com/uber-go/atomic/compare/v1.5.1...v1.6.0 + ## [1.5.1] - 2019-11-19 - Fix bug where `Bool.CAS` and `Bool.Toggle` do work correctly together causing `CAS` to fail even though the old value matches. +[1.5.1]: https://github.com/uber-go/atomic/compare/v1.5.0...v1.5.1 + ## [1.5.0] - 2019-10-29 ### Changed - With Go modules, only the `go.uber.org/atomic` import path is supported now. If you need to use the old import path, please add a `replace` directive to your `go.mod`. +[1.5.0]: https://github.com/uber-go/atomic/compare/v1.4.0...v1.5.0 + ## [1.4.0] - 2019-05-01 ### Added - Add `atomic.Error` type for atomic operations on `error` values. +[1.4.0]: https://github.com/uber-go/atomic/compare/v1.3.2...v1.4.0 + ## [1.3.2] - 2018-05-02 ### Added - Add `atomic.Duration` type for atomic operations on `time.Duration` values. +[1.3.2]: https://github.com/uber-go/atomic/compare/v1.3.1...v1.3.2 + ## [1.3.1] - 2017-11-14 ### Fixed - Revert optimization for `atomic.String.Store("")` which caused data races. +[1.3.1]: https://github.com/uber-go/atomic/compare/v1.3.0...v1.3.1 + ## [1.3.0] - 2017-11-13 ### Added - Add `atomic.Bool.CAS` for compare-and-swap semantics on bools. @@ -48,10 +103,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Optimize `atomic.String.Store("")` by avoiding an allocation. +[1.3.0]: https://github.com/uber-go/atomic/compare/v1.2.0...v1.3.0 + ## [1.2.0] - 2017-04-12 ### Added - Shadow `atomic.Value` from `sync/atomic`. +[1.2.0]: https://github.com/uber-go/atomic/compare/v1.1.0...v1.2.0 + ## [1.1.0] - 2017-03-10 ### Added - Add atomic `Float64` type. @@ -59,18 +118,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Support new `go.uber.org/atomic` import path. +[1.1.0]: https://github.com/uber-go/atomic/compare/v1.0.0...v1.1.0 + ## [1.0.0] - 2016-07-18 - Initial release. -[1.7.0]: https://github.com/uber-go/atomic/compare/v1.6.0...v1.7.0 -[1.6.0]: https://github.com/uber-go/atomic/compare/v1.5.1...v1.6.0 -[1.5.1]: https://github.com/uber-go/atomic/compare/v1.5.0...v1.5.1 -[1.5.0]: https://github.com/uber-go/atomic/compare/v1.4.0...v1.5.0 -[1.4.0]: https://github.com/uber-go/atomic/compare/v1.3.2...v1.4.0 -[1.3.2]: https://github.com/uber-go/atomic/compare/v1.3.1...v1.3.2 -[1.3.1]: https://github.com/uber-go/atomic/compare/v1.3.0...v1.3.1 -[1.3.0]: https://github.com/uber-go/atomic/compare/v1.2.0...v1.3.0 -[1.2.0]: https://github.com/uber-go/atomic/compare/v1.1.0...v1.2.0 -[1.1.0]: https://github.com/uber-go/atomic/compare/v1.0.0...v1.1.0 [1.0.0]: https://github.com/uber-go/atomic/releases/tag/v1.0.0 diff --git a/vendor/go.uber.org/atomic/Makefile b/vendor/go.uber.org/atomic/Makefile index 1b1376d425..46c945b32b 100644 --- a/vendor/go.uber.org/atomic/Makefile +++ b/vendor/go.uber.org/atomic/Makefile @@ -69,6 +69,7 @@ generate: $(GEN_ATOMICINT) $(GEN_ATOMICWRAPPER) generatenodirty: @[ -z "$$(git status --porcelain)" ] || ( \ echo "Working tree is dirty. Commit your changes first."; \ + git status; \ exit 1 ) @make generate @status=$$(git status --porcelain); \ diff --git a/vendor/go.uber.org/atomic/README.md b/vendor/go.uber.org/atomic/README.md index ade0c20f16..96b47a1f12 100644 --- a/vendor/go.uber.org/atomic/README.md +++ b/vendor/go.uber.org/atomic/README.md @@ -55,8 +55,8 @@ Released under the [MIT License](LICENSE.txt). [doc-img]: https://godoc.org/github.com/uber-go/atomic?status.svg [doc]: https://godoc.org/go.uber.org/atomic -[ci-img]: https://travis-ci.com/uber-go/atomic.svg?branch=master -[ci]: https://travis-ci.com/uber-go/atomic +[ci-img]: https://github.com/uber-go/atomic/actions/workflows/go.yml/badge.svg +[ci]: https://github.com/uber-go/atomic/actions/workflows/go.yml [cov-img]: https://codecov.io/gh/uber-go/atomic/branch/master/graph/badge.svg [cov]: https://codecov.io/gh/uber-go/atomic [reportcard-img]: https://goreportcard.com/badge/go.uber.org/atomic diff --git a/vendor/go.uber.org/atomic/bool.go b/vendor/go.uber.org/atomic/bool.go index 9cf1914b1f..f0a2ddd148 100644 --- a/vendor/go.uber.org/atomic/bool.go +++ b/vendor/go.uber.org/atomic/bool.go @@ -1,6 +1,6 @@ // @generated Code generated by gen-atomicwrapper. -// Copyright (c) 2020 Uber Technologies, Inc. +// Copyright (c) 2020-2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -36,10 +36,10 @@ type Bool struct { var _zeroBool bool // NewBool creates a new Bool. -func NewBool(v bool) *Bool { +func NewBool(val bool) *Bool { x := &Bool{} - if v != _zeroBool { - x.Store(v) + if val != _zeroBool { + x.Store(val) } return x } @@ -50,19 +50,26 @@ func (x *Bool) Load() bool { } // Store atomically stores the passed bool. -func (x *Bool) Store(v bool) { - x.v.Store(boolToInt(v)) +func (x *Bool) Store(val bool) { + x.v.Store(boolToInt(val)) } // CAS is an atomic compare-and-swap for bool values. -func (x *Bool) CAS(o, n bool) bool { - return x.v.CAS(boolToInt(o), boolToInt(n)) +// +// Deprecated: Use CompareAndSwap. +func (x *Bool) CAS(old, new bool) (swapped bool) { + return x.CompareAndSwap(old, new) +} + +// CompareAndSwap is an atomic compare-and-swap for bool values. +func (x *Bool) CompareAndSwap(old, new bool) (swapped bool) { + return x.v.CompareAndSwap(boolToInt(old), boolToInt(new)) } // Swap atomically stores the given bool and returns the old // value. -func (x *Bool) Swap(o bool) bool { - return truthy(x.v.Swap(boolToInt(o))) +func (x *Bool) Swap(val bool) (old bool) { + return truthy(x.v.Swap(boolToInt(val))) } // MarshalJSON encodes the wrapped bool into JSON. diff --git a/vendor/go.uber.org/atomic/bool_ext.go b/vendor/go.uber.org/atomic/bool_ext.go index c7bf7a827a..a2e60e9873 100644 --- a/vendor/go.uber.org/atomic/bool_ext.go +++ b/vendor/go.uber.org/atomic/bool_ext.go @@ -38,7 +38,7 @@ func boolToInt(b bool) uint32 { } // Toggle atomically negates the Boolean and returns the previous value. -func (b *Bool) Toggle() bool { +func (b *Bool) Toggle() (old bool) { for { old := b.Load() if b.CAS(old, !old) { diff --git a/vendor/go.uber.org/atomic/duration.go b/vendor/go.uber.org/atomic/duration.go index 027cfcb20b..7c23868fc8 100644 --- a/vendor/go.uber.org/atomic/duration.go +++ b/vendor/go.uber.org/atomic/duration.go @@ -1,6 +1,6 @@ // @generated Code generated by gen-atomicwrapper. -// Copyright (c) 2020 Uber Technologies, Inc. +// Copyright (c) 2020-2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -37,10 +37,10 @@ type Duration struct { var _zeroDuration time.Duration // NewDuration creates a new Duration. -func NewDuration(v time.Duration) *Duration { +func NewDuration(val time.Duration) *Duration { x := &Duration{} - if v != _zeroDuration { - x.Store(v) + if val != _zeroDuration { + x.Store(val) } return x } @@ -51,19 +51,26 @@ func (x *Duration) Load() time.Duration { } // Store atomically stores the passed time.Duration. -func (x *Duration) Store(v time.Duration) { - x.v.Store(int64(v)) +func (x *Duration) Store(val time.Duration) { + x.v.Store(int64(val)) } // CAS is an atomic compare-and-swap for time.Duration values. -func (x *Duration) CAS(o, n time.Duration) bool { - return x.v.CAS(int64(o), int64(n)) +// +// Deprecated: Use CompareAndSwap. +func (x *Duration) CAS(old, new time.Duration) (swapped bool) { + return x.CompareAndSwap(old, new) +} + +// CompareAndSwap is an atomic compare-and-swap for time.Duration values. +func (x *Duration) CompareAndSwap(old, new time.Duration) (swapped bool) { + return x.v.CompareAndSwap(int64(old), int64(new)) } // Swap atomically stores the given time.Duration and returns the old // value. -func (x *Duration) Swap(o time.Duration) time.Duration { - return time.Duration(x.v.Swap(int64(o))) +func (x *Duration) Swap(val time.Duration) (old time.Duration) { + return time.Duration(x.v.Swap(int64(val))) } // MarshalJSON encodes the wrapped time.Duration into JSON. diff --git a/vendor/go.uber.org/atomic/duration_ext.go b/vendor/go.uber.org/atomic/duration_ext.go index 6273b66bd6..4c18b0a9ed 100644 --- a/vendor/go.uber.org/atomic/duration_ext.go +++ b/vendor/go.uber.org/atomic/duration_ext.go @@ -25,13 +25,13 @@ import "time" //go:generate bin/gen-atomicwrapper -name=Duration -type=time.Duration -wrapped=Int64 -pack=int64 -unpack=time.Duration -cas -swap -json -imports time -file=duration.go // Add atomically adds to the wrapped time.Duration and returns the new value. -func (d *Duration) Add(n time.Duration) time.Duration { - return time.Duration(d.v.Add(int64(n))) +func (d *Duration) Add(delta time.Duration) time.Duration { + return time.Duration(d.v.Add(int64(delta))) } // Sub atomically subtracts from the wrapped time.Duration and returns the new value. -func (d *Duration) Sub(n time.Duration) time.Duration { - return time.Duration(d.v.Sub(int64(n))) +func (d *Duration) Sub(delta time.Duration) time.Duration { + return time.Duration(d.v.Sub(int64(delta))) } // String encodes the wrapped value as a string. diff --git a/vendor/go.uber.org/atomic/error.go b/vendor/go.uber.org/atomic/error.go index a6166fbea0..b7e3f1291a 100644 --- a/vendor/go.uber.org/atomic/error.go +++ b/vendor/go.uber.org/atomic/error.go @@ -1,6 +1,6 @@ // @generated Code generated by gen-atomicwrapper. -// Copyright (c) 2020 Uber Technologies, Inc. +// Copyright (c) 2020-2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -32,10 +32,10 @@ type Error struct { var _zeroError error // NewError creates a new Error. -func NewError(v error) *Error { +func NewError(val error) *Error { x := &Error{} - if v != _zeroError { - x.Store(v) + if val != _zeroError { + x.Store(val) } return x } @@ -46,6 +46,27 @@ func (x *Error) Load() error { } // Store atomically stores the passed error. -func (x *Error) Store(v error) { - x.v.Store(packError(v)) +func (x *Error) Store(val error) { + x.v.Store(packError(val)) +} + +// CompareAndSwap is an atomic compare-and-swap for error values. +func (x *Error) CompareAndSwap(old, new error) (swapped bool) { + if x.v.CompareAndSwap(packError(old), packError(new)) { + return true + } + + if old == _zeroError { + // If the old value is the empty value, then it's possible the + // underlying Value hasn't been set and is nil, so retry with nil. + return x.v.CompareAndSwap(nil, packError(new)) + } + + return false +} + +// Swap atomically stores the given error and returns the old +// value. +func (x *Error) Swap(val error) (old error) { + return unpackError(x.v.Swap(packError(val))) } diff --git a/vendor/go.uber.org/atomic/error_ext.go b/vendor/go.uber.org/atomic/error_ext.go index ffe0be21cb..d31fb633bb 100644 --- a/vendor/go.uber.org/atomic/error_ext.go +++ b/vendor/go.uber.org/atomic/error_ext.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Uber Technologies, Inc. +// Copyright (c) 2020-2022 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -23,7 +23,7 @@ package atomic // atomic.Value panics on nil inputs, or if the underlying type changes. // Stabilize by always storing a custom struct that we control. -//go:generate bin/gen-atomicwrapper -name=Error -type=error -wrapped=Value -pack=packError -unpack=unpackError -file=error.go +//go:generate bin/gen-atomicwrapper -name=Error -type=error -wrapped=Value -pack=packError -unpack=unpackError -compareandswap -swap -file=error.go type packedError struct{ Value error } diff --git a/vendor/go.uber.org/atomic/float32.go b/vendor/go.uber.org/atomic/float32.go new file mode 100644 index 0000000000..62c36334fd --- /dev/null +++ b/vendor/go.uber.org/atomic/float32.go @@ -0,0 +1,77 @@ +// @generated Code generated by gen-atomicwrapper. + +// Copyright (c) 2020-2023 Uber Technologies, Inc. +// +// 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. + +package atomic + +import ( + "encoding/json" + "math" +) + +// Float32 is an atomic type-safe wrapper for float32 values. +type Float32 struct { + _ nocmp // disallow non-atomic comparison + + v Uint32 +} + +var _zeroFloat32 float32 + +// NewFloat32 creates a new Float32. +func NewFloat32(val float32) *Float32 { + x := &Float32{} + if val != _zeroFloat32 { + x.Store(val) + } + return x +} + +// Load atomically loads the wrapped float32. +func (x *Float32) Load() float32 { + return math.Float32frombits(x.v.Load()) +} + +// Store atomically stores the passed float32. +func (x *Float32) Store(val float32) { + x.v.Store(math.Float32bits(val)) +} + +// Swap atomically stores the given float32 and returns the old +// value. +func (x *Float32) Swap(val float32) (old float32) { + return math.Float32frombits(x.v.Swap(math.Float32bits(val))) +} + +// MarshalJSON encodes the wrapped float32 into JSON. +func (x *Float32) MarshalJSON() ([]byte, error) { + return json.Marshal(x.Load()) +} + +// UnmarshalJSON decodes a float32 from JSON. +func (x *Float32) UnmarshalJSON(b []byte) error { + var v float32 + if err := json.Unmarshal(b, &v); err != nil { + return err + } + x.Store(v) + return nil +} diff --git a/vendor/go.uber.org/atomic/float32_ext.go b/vendor/go.uber.org/atomic/float32_ext.go new file mode 100644 index 0000000000..b0cd8d9c82 --- /dev/null +++ b/vendor/go.uber.org/atomic/float32_ext.go @@ -0,0 +1,76 @@ +// Copyright (c) 2020-2022 Uber Technologies, Inc. +// +// 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. + +package atomic + +import ( + "math" + "strconv" +) + +//go:generate bin/gen-atomicwrapper -name=Float32 -type=float32 -wrapped=Uint32 -pack=math.Float32bits -unpack=math.Float32frombits -swap -json -imports math -file=float32.go + +// Add atomically adds to the wrapped float32 and returns the new value. +func (f *Float32) Add(delta float32) float32 { + for { + old := f.Load() + new := old + delta + if f.CAS(old, new) { + return new + } + } +} + +// Sub atomically subtracts from the wrapped float32 and returns the new value. +func (f *Float32) Sub(delta float32) float32 { + return f.Add(-delta) +} + +// CAS is an atomic compare-and-swap for float32 values. +// +// Deprecated: Use CompareAndSwap +func (f *Float32) CAS(old, new float32) (swapped bool) { + return f.CompareAndSwap(old, new) +} + +// CompareAndSwap is an atomic compare-and-swap for float32 values. +// +// Note: CompareAndSwap handles NaN incorrectly. NaN != NaN using Go's inbuilt operators +// but CompareAndSwap allows a stored NaN to compare equal to a passed in NaN. +// This avoids typical CompareAndSwap loops from blocking forever, e.g., +// +// for { +// old := atom.Load() +// new = f(old) +// if atom.CompareAndSwap(old, new) { +// break +// } +// } +// +// If CompareAndSwap did not match NaN to match, then the above would loop forever. +func (f *Float32) CompareAndSwap(old, new float32) (swapped bool) { + return f.v.CompareAndSwap(math.Float32bits(old), math.Float32bits(new)) +} + +// String encodes the wrapped value as a string. +func (f *Float32) String() string { + // 'g' is the behavior for floats with %v. + return strconv.FormatFloat(float64(f.Load()), 'g', -1, 32) +} diff --git a/vendor/go.uber.org/atomic/float64.go b/vendor/go.uber.org/atomic/float64.go index 0719060207..5bc11caabe 100644 --- a/vendor/go.uber.org/atomic/float64.go +++ b/vendor/go.uber.org/atomic/float64.go @@ -1,6 +1,6 @@ // @generated Code generated by gen-atomicwrapper. -// Copyright (c) 2020 Uber Technologies, Inc. +// Copyright (c) 2020-2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -37,10 +37,10 @@ type Float64 struct { var _zeroFloat64 float64 // NewFloat64 creates a new Float64. -func NewFloat64(v float64) *Float64 { +func NewFloat64(val float64) *Float64 { x := &Float64{} - if v != _zeroFloat64 { - x.Store(v) + if val != _zeroFloat64 { + x.Store(val) } return x } @@ -51,13 +51,14 @@ func (x *Float64) Load() float64 { } // Store atomically stores the passed float64. -func (x *Float64) Store(v float64) { - x.v.Store(math.Float64bits(v)) +func (x *Float64) Store(val float64) { + x.v.Store(math.Float64bits(val)) } -// CAS is an atomic compare-and-swap for float64 values. -func (x *Float64) CAS(o, n float64) bool { - return x.v.CAS(math.Float64bits(o), math.Float64bits(n)) +// Swap atomically stores the given float64 and returns the old +// value. +func (x *Float64) Swap(val float64) (old float64) { + return math.Float64frombits(x.v.Swap(math.Float64bits(val))) } // MarshalJSON encodes the wrapped float64 into JSON. diff --git a/vendor/go.uber.org/atomic/float64_ext.go b/vendor/go.uber.org/atomic/float64_ext.go index 927b1add74..48c52b0abf 100644 --- a/vendor/go.uber.org/atomic/float64_ext.go +++ b/vendor/go.uber.org/atomic/float64_ext.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Uber Technologies, Inc. +// Copyright (c) 2020-2022 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,15 +20,18 @@ package atomic -import "strconv" +import ( + "math" + "strconv" +) -//go:generate bin/gen-atomicwrapper -name=Float64 -type=float64 -wrapped=Uint64 -pack=math.Float64bits -unpack=math.Float64frombits -cas -json -imports math -file=float64.go +//go:generate bin/gen-atomicwrapper -name=Float64 -type=float64 -wrapped=Uint64 -pack=math.Float64bits -unpack=math.Float64frombits -swap -json -imports math -file=float64.go // Add atomically adds to the wrapped float64 and returns the new value. -func (f *Float64) Add(s float64) float64 { +func (f *Float64) Add(delta float64) float64 { for { old := f.Load() - new := old + s + new := old + delta if f.CAS(old, new) { return new } @@ -36,8 +39,34 @@ func (f *Float64) Add(s float64) float64 { } // Sub atomically subtracts from the wrapped float64 and returns the new value. -func (f *Float64) Sub(s float64) float64 { - return f.Add(-s) +func (f *Float64) Sub(delta float64) float64 { + return f.Add(-delta) +} + +// CAS is an atomic compare-and-swap for float64 values. +// +// Deprecated: Use CompareAndSwap +func (f *Float64) CAS(old, new float64) (swapped bool) { + return f.CompareAndSwap(old, new) +} + +// CompareAndSwap is an atomic compare-and-swap for float64 values. +// +// Note: CompareAndSwap handles NaN incorrectly. NaN != NaN using Go's inbuilt operators +// but CompareAndSwap allows a stored NaN to compare equal to a passed in NaN. +// This avoids typical CompareAndSwap loops from blocking forever, e.g., +// +// for { +// old := atom.Load() +// new = f(old) +// if atom.CompareAndSwap(old, new) { +// break +// } +// } +// +// If CompareAndSwap did not match NaN to match, then the above would loop forever. +func (f *Float64) CompareAndSwap(old, new float64) (swapped bool) { + return f.v.CompareAndSwap(math.Float64bits(old), math.Float64bits(new)) } // String encodes the wrapped value as a string. diff --git a/vendor/go.uber.org/atomic/gen.go b/vendor/go.uber.org/atomic/gen.go index 50d6b24858..1e9ef4f879 100644 --- a/vendor/go.uber.org/atomic/gen.go +++ b/vendor/go.uber.org/atomic/gen.go @@ -24,3 +24,4 @@ package atomic //go:generate bin/gen-atomicint -name=Int64 -wrapped=int64 -file=int64.go //go:generate bin/gen-atomicint -name=Uint32 -wrapped=uint32 -unsigned -file=uint32.go //go:generate bin/gen-atomicint -name=Uint64 -wrapped=uint64 -unsigned -file=uint64.go +//go:generate bin/gen-atomicint -name=Uintptr -wrapped=uintptr -unsigned -file=uintptr.go diff --git a/vendor/go.uber.org/atomic/int32.go b/vendor/go.uber.org/atomic/int32.go index 18ae56493e..5320eac10f 100644 --- a/vendor/go.uber.org/atomic/int32.go +++ b/vendor/go.uber.org/atomic/int32.go @@ -1,6 +1,6 @@ // @generated Code generated by gen-atomicint. -// Copyright (c) 2020 Uber Technologies, Inc. +// Copyright (c) 2020-2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -36,8 +36,8 @@ type Int32 struct { } // NewInt32 creates a new Int32. -func NewInt32(i int32) *Int32 { - return &Int32{v: i} +func NewInt32(val int32) *Int32 { + return &Int32{v: val} } // Load atomically loads the wrapped value. @@ -46,13 +46,13 @@ func (i *Int32) Load() int32 { } // Add atomically adds to the wrapped int32 and returns the new value. -func (i *Int32) Add(n int32) int32 { - return atomic.AddInt32(&i.v, n) +func (i *Int32) Add(delta int32) int32 { + return atomic.AddInt32(&i.v, delta) } // Sub atomically subtracts from the wrapped int32 and returns the new value. -func (i *Int32) Sub(n int32) int32 { - return atomic.AddInt32(&i.v, -n) +func (i *Int32) Sub(delta int32) int32 { + return atomic.AddInt32(&i.v, -delta) } // Inc atomically increments the wrapped int32 and returns the new value. @@ -66,18 +66,25 @@ func (i *Int32) Dec() int32 { } // CAS is an atomic compare-and-swap. -func (i *Int32) CAS(old, new int32) bool { +// +// Deprecated: Use CompareAndSwap. +func (i *Int32) CAS(old, new int32) (swapped bool) { + return i.CompareAndSwap(old, new) +} + +// CompareAndSwap is an atomic compare-and-swap. +func (i *Int32) CompareAndSwap(old, new int32) (swapped bool) { return atomic.CompareAndSwapInt32(&i.v, old, new) } // Store atomically stores the passed value. -func (i *Int32) Store(n int32) { - atomic.StoreInt32(&i.v, n) +func (i *Int32) Store(val int32) { + atomic.StoreInt32(&i.v, val) } // Swap atomically swaps the wrapped int32 and returns the old value. -func (i *Int32) Swap(n int32) int32 { - return atomic.SwapInt32(&i.v, n) +func (i *Int32) Swap(val int32) (old int32) { + return atomic.SwapInt32(&i.v, val) } // MarshalJSON encodes the wrapped int32 into JSON. diff --git a/vendor/go.uber.org/atomic/int64.go b/vendor/go.uber.org/atomic/int64.go index 2bcbbfaa95..460821d009 100644 --- a/vendor/go.uber.org/atomic/int64.go +++ b/vendor/go.uber.org/atomic/int64.go @@ -1,6 +1,6 @@ // @generated Code generated by gen-atomicint. -// Copyright (c) 2020 Uber Technologies, Inc. +// Copyright (c) 2020-2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -36,8 +36,8 @@ type Int64 struct { } // NewInt64 creates a new Int64. -func NewInt64(i int64) *Int64 { - return &Int64{v: i} +func NewInt64(val int64) *Int64 { + return &Int64{v: val} } // Load atomically loads the wrapped value. @@ -46,13 +46,13 @@ func (i *Int64) Load() int64 { } // Add atomically adds to the wrapped int64 and returns the new value. -func (i *Int64) Add(n int64) int64 { - return atomic.AddInt64(&i.v, n) +func (i *Int64) Add(delta int64) int64 { + return atomic.AddInt64(&i.v, delta) } // Sub atomically subtracts from the wrapped int64 and returns the new value. -func (i *Int64) Sub(n int64) int64 { - return atomic.AddInt64(&i.v, -n) +func (i *Int64) Sub(delta int64) int64 { + return atomic.AddInt64(&i.v, -delta) } // Inc atomically increments the wrapped int64 and returns the new value. @@ -66,18 +66,25 @@ func (i *Int64) Dec() int64 { } // CAS is an atomic compare-and-swap. -func (i *Int64) CAS(old, new int64) bool { +// +// Deprecated: Use CompareAndSwap. +func (i *Int64) CAS(old, new int64) (swapped bool) { + return i.CompareAndSwap(old, new) +} + +// CompareAndSwap is an atomic compare-and-swap. +func (i *Int64) CompareAndSwap(old, new int64) (swapped bool) { return atomic.CompareAndSwapInt64(&i.v, old, new) } // Store atomically stores the passed value. -func (i *Int64) Store(n int64) { - atomic.StoreInt64(&i.v, n) +func (i *Int64) Store(val int64) { + atomic.StoreInt64(&i.v, val) } // Swap atomically swaps the wrapped int64 and returns the old value. -func (i *Int64) Swap(n int64) int64 { - return atomic.SwapInt64(&i.v, n) +func (i *Int64) Swap(val int64) (old int64) { + return atomic.SwapInt64(&i.v, val) } // MarshalJSON encodes the wrapped int64 into JSON. diff --git a/vendor/go.uber.org/atomic/nocmp.go b/vendor/go.uber.org/atomic/nocmp.go index a8201cb4a1..54b74174ab 100644 --- a/vendor/go.uber.org/atomic/nocmp.go +++ b/vendor/go.uber.org/atomic/nocmp.go @@ -23,13 +23,13 @@ package atomic // nocmp is an uncomparable struct. Embed this inside another struct to make // it uncomparable. // -// type Foo struct { -// nocmp -// // ... -// } +// type Foo struct { +// nocmp +// // ... +// } // // This DOES NOT: // -// - Disallow shallow copies of structs -// - Disallow comparison of pointers to uncomparable structs +// - Disallow shallow copies of structs +// - Disallow comparison of pointers to uncomparable structs type nocmp [0]func() diff --git a/vendor/go.uber.org/atomic/pointer_go118.go b/vendor/go.uber.org/atomic/pointer_go118.go new file mode 100644 index 0000000000..1fb6c03b26 --- /dev/null +++ b/vendor/go.uber.org/atomic/pointer_go118.go @@ -0,0 +1,31 @@ +// Copyright (c) 2022 Uber Technologies, Inc. +// +// 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. + +//go:build go1.18 +// +build go1.18 + +package atomic + +import "fmt" + +// String returns a human readable representation of a Pointer's underlying value. +func (p *Pointer[T]) String() string { + return fmt.Sprint(p.Load()) +} diff --git a/vendor/go.uber.org/atomic/pointer_go118_pre119.go b/vendor/go.uber.org/atomic/pointer_go118_pre119.go new file mode 100644 index 0000000000..e0f47dba46 --- /dev/null +++ b/vendor/go.uber.org/atomic/pointer_go118_pre119.go @@ -0,0 +1,60 @@ +// Copyright (c) 2022 Uber Technologies, Inc. +// +// 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. + +//go:build go1.18 && !go1.19 +// +build go1.18,!go1.19 + +package atomic + +import "unsafe" + +type Pointer[T any] struct { + _ nocmp // disallow non-atomic comparison + p UnsafePointer +} + +// NewPointer creates a new Pointer. +func NewPointer[T any](v *T) *Pointer[T] { + var p Pointer[T] + if v != nil { + p.p.Store(unsafe.Pointer(v)) + } + return &p +} + +// Load atomically loads the wrapped value. +func (p *Pointer[T]) Load() *T { + return (*T)(p.p.Load()) +} + +// Store atomically stores the passed value. +func (p *Pointer[T]) Store(val *T) { + p.p.Store(unsafe.Pointer(val)) +} + +// Swap atomically swaps the wrapped pointer and returns the old value. +func (p *Pointer[T]) Swap(val *T) (old *T) { + return (*T)(p.p.Swap(unsafe.Pointer(val))) +} + +// CompareAndSwap is an atomic compare-and-swap. +func (p *Pointer[T]) CompareAndSwap(old, new *T) (swapped bool) { + return p.p.CompareAndSwap(unsafe.Pointer(old), unsafe.Pointer(new)) +} diff --git a/vendor/go.uber.org/atomic/pointer_go119.go b/vendor/go.uber.org/atomic/pointer_go119.go new file mode 100644 index 0000000000..6726f17ad6 --- /dev/null +++ b/vendor/go.uber.org/atomic/pointer_go119.go @@ -0,0 +1,61 @@ +// Copyright (c) 2022 Uber Technologies, Inc. +// +// 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. + +//go:build go1.19 +// +build go1.19 + +package atomic + +import "sync/atomic" + +// Pointer is an atomic pointer of type *T. +type Pointer[T any] struct { + _ nocmp // disallow non-atomic comparison + p atomic.Pointer[T] +} + +// NewPointer creates a new Pointer. +func NewPointer[T any](v *T) *Pointer[T] { + var p Pointer[T] + if v != nil { + p.p.Store(v) + } + return &p +} + +// Load atomically loads the wrapped value. +func (p *Pointer[T]) Load() *T { + return p.p.Load() +} + +// Store atomically stores the passed value. +func (p *Pointer[T]) Store(val *T) { + p.p.Store(val) +} + +// Swap atomically swaps the wrapped pointer and returns the old value. +func (p *Pointer[T]) Swap(val *T) (old *T) { + return p.p.Swap(val) +} + +// CompareAndSwap is an atomic compare-and-swap. +func (p *Pointer[T]) CompareAndSwap(old, new *T) (swapped bool) { + return p.p.CompareAndSwap(old, new) +} diff --git a/vendor/go.uber.org/atomic/string.go b/vendor/go.uber.org/atomic/string.go index 225b7a2be0..061466c5bd 100644 --- a/vendor/go.uber.org/atomic/string.go +++ b/vendor/go.uber.org/atomic/string.go @@ -1,6 +1,6 @@ // @generated Code generated by gen-atomicwrapper. -// Copyright (c) 2020 Uber Technologies, Inc. +// Copyright (c) 2020-2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -32,23 +32,41 @@ type String struct { var _zeroString string // NewString creates a new String. -func NewString(v string) *String { +func NewString(val string) *String { x := &String{} - if v != _zeroString { - x.Store(v) + if val != _zeroString { + x.Store(val) } return x } // Load atomically loads the wrapped string. func (x *String) Load() string { - if v := x.v.Load(); v != nil { - return v.(string) - } - return _zeroString + return unpackString(x.v.Load()) } // Store atomically stores the passed string. -func (x *String) Store(v string) { - x.v.Store(v) +func (x *String) Store(val string) { + x.v.Store(packString(val)) +} + +// CompareAndSwap is an atomic compare-and-swap for string values. +func (x *String) CompareAndSwap(old, new string) (swapped bool) { + if x.v.CompareAndSwap(packString(old), packString(new)) { + return true + } + + if old == _zeroString { + // If the old value is the empty value, then it's possible the + // underlying Value hasn't been set and is nil, so retry with nil. + return x.v.CompareAndSwap(nil, packString(new)) + } + + return false +} + +// Swap atomically stores the given string and returns the old +// value. +func (x *String) Swap(val string) (old string) { + return unpackString(x.v.Swap(packString(val))) } diff --git a/vendor/go.uber.org/atomic/string_ext.go b/vendor/go.uber.org/atomic/string_ext.go index 3a9558213d..019109c86b 100644 --- a/vendor/go.uber.org/atomic/string_ext.go +++ b/vendor/go.uber.org/atomic/string_ext.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020 Uber Technologies, Inc. +// Copyright (c) 2020-2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,7 +20,18 @@ package atomic -//go:generate bin/gen-atomicwrapper -name=String -type=string -wrapped=Value -file=string.go +//go:generate bin/gen-atomicwrapper -name=String -type=string -wrapped Value -pack packString -unpack unpackString -compareandswap -swap -file=string.go + +func packString(s string) interface{} { + return s +} + +func unpackString(v interface{}) string { + if s, ok := v.(string); ok { + return s + } + return "" +} // String returns the wrapped value. func (s *String) String() string { diff --git a/vendor/go.uber.org/atomic/time.go b/vendor/go.uber.org/atomic/time.go new file mode 100644 index 0000000000..cc2a230c00 --- /dev/null +++ b/vendor/go.uber.org/atomic/time.go @@ -0,0 +1,55 @@ +// @generated Code generated by gen-atomicwrapper. + +// Copyright (c) 2020-2023 Uber Technologies, Inc. +// +// 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. + +package atomic + +import ( + "time" +) + +// Time is an atomic type-safe wrapper for time.Time values. +type Time struct { + _ nocmp // disallow non-atomic comparison + + v Value +} + +var _zeroTime time.Time + +// NewTime creates a new Time. +func NewTime(val time.Time) *Time { + x := &Time{} + if val != _zeroTime { + x.Store(val) + } + return x +} + +// Load atomically loads the wrapped time.Time. +func (x *Time) Load() time.Time { + return unpackTime(x.v.Load()) +} + +// Store atomically stores the passed time.Time. +func (x *Time) Store(val time.Time) { + x.v.Store(packTime(val)) +} diff --git a/vendor/go.uber.org/atomic/time_ext.go b/vendor/go.uber.org/atomic/time_ext.go new file mode 100644 index 0000000000..1e3dc978aa --- /dev/null +++ b/vendor/go.uber.org/atomic/time_ext.go @@ -0,0 +1,36 @@ +// Copyright (c) 2021 Uber Technologies, Inc. +// +// 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. + +package atomic + +import "time" + +//go:generate bin/gen-atomicwrapper -name=Time -type=time.Time -wrapped=Value -pack=packTime -unpack=unpackTime -imports time -file=time.go + +func packTime(t time.Time) interface{} { + return t +} + +func unpackTime(v interface{}) time.Time { + if t, ok := v.(time.Time); ok { + return t + } + return time.Time{} +} diff --git a/vendor/go.uber.org/atomic/uint32.go b/vendor/go.uber.org/atomic/uint32.go index a973aba1a6..4adc294ac2 100644 --- a/vendor/go.uber.org/atomic/uint32.go +++ b/vendor/go.uber.org/atomic/uint32.go @@ -1,6 +1,6 @@ // @generated Code generated by gen-atomicint. -// Copyright (c) 2020 Uber Technologies, Inc. +// Copyright (c) 2020-2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -36,8 +36,8 @@ type Uint32 struct { } // NewUint32 creates a new Uint32. -func NewUint32(i uint32) *Uint32 { - return &Uint32{v: i} +func NewUint32(val uint32) *Uint32 { + return &Uint32{v: val} } // Load atomically loads the wrapped value. @@ -46,13 +46,13 @@ func (i *Uint32) Load() uint32 { } // Add atomically adds to the wrapped uint32 and returns the new value. -func (i *Uint32) Add(n uint32) uint32 { - return atomic.AddUint32(&i.v, n) +func (i *Uint32) Add(delta uint32) uint32 { + return atomic.AddUint32(&i.v, delta) } // Sub atomically subtracts from the wrapped uint32 and returns the new value. -func (i *Uint32) Sub(n uint32) uint32 { - return atomic.AddUint32(&i.v, ^(n - 1)) +func (i *Uint32) Sub(delta uint32) uint32 { + return atomic.AddUint32(&i.v, ^(delta - 1)) } // Inc atomically increments the wrapped uint32 and returns the new value. @@ -66,18 +66,25 @@ func (i *Uint32) Dec() uint32 { } // CAS is an atomic compare-and-swap. -func (i *Uint32) CAS(old, new uint32) bool { +// +// Deprecated: Use CompareAndSwap. +func (i *Uint32) CAS(old, new uint32) (swapped bool) { + return i.CompareAndSwap(old, new) +} + +// CompareAndSwap is an atomic compare-and-swap. +func (i *Uint32) CompareAndSwap(old, new uint32) (swapped bool) { return atomic.CompareAndSwapUint32(&i.v, old, new) } // Store atomically stores the passed value. -func (i *Uint32) Store(n uint32) { - atomic.StoreUint32(&i.v, n) +func (i *Uint32) Store(val uint32) { + atomic.StoreUint32(&i.v, val) } // Swap atomically swaps the wrapped uint32 and returns the old value. -func (i *Uint32) Swap(n uint32) uint32 { - return atomic.SwapUint32(&i.v, n) +func (i *Uint32) Swap(val uint32) (old uint32) { + return atomic.SwapUint32(&i.v, val) } // MarshalJSON encodes the wrapped uint32 into JSON. diff --git a/vendor/go.uber.org/atomic/uint64.go b/vendor/go.uber.org/atomic/uint64.go index 3b6c71fd5a..0e2eddb303 100644 --- a/vendor/go.uber.org/atomic/uint64.go +++ b/vendor/go.uber.org/atomic/uint64.go @@ -1,6 +1,6 @@ // @generated Code generated by gen-atomicint. -// Copyright (c) 2020 Uber Technologies, Inc. +// Copyright (c) 2020-2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -36,8 +36,8 @@ type Uint64 struct { } // NewUint64 creates a new Uint64. -func NewUint64(i uint64) *Uint64 { - return &Uint64{v: i} +func NewUint64(val uint64) *Uint64 { + return &Uint64{v: val} } // Load atomically loads the wrapped value. @@ -46,13 +46,13 @@ func (i *Uint64) Load() uint64 { } // Add atomically adds to the wrapped uint64 and returns the new value. -func (i *Uint64) Add(n uint64) uint64 { - return atomic.AddUint64(&i.v, n) +func (i *Uint64) Add(delta uint64) uint64 { + return atomic.AddUint64(&i.v, delta) } // Sub atomically subtracts from the wrapped uint64 and returns the new value. -func (i *Uint64) Sub(n uint64) uint64 { - return atomic.AddUint64(&i.v, ^(n - 1)) +func (i *Uint64) Sub(delta uint64) uint64 { + return atomic.AddUint64(&i.v, ^(delta - 1)) } // Inc atomically increments the wrapped uint64 and returns the new value. @@ -66,18 +66,25 @@ func (i *Uint64) Dec() uint64 { } // CAS is an atomic compare-and-swap. -func (i *Uint64) CAS(old, new uint64) bool { +// +// Deprecated: Use CompareAndSwap. +func (i *Uint64) CAS(old, new uint64) (swapped bool) { + return i.CompareAndSwap(old, new) +} + +// CompareAndSwap is an atomic compare-and-swap. +func (i *Uint64) CompareAndSwap(old, new uint64) (swapped bool) { return atomic.CompareAndSwapUint64(&i.v, old, new) } // Store atomically stores the passed value. -func (i *Uint64) Store(n uint64) { - atomic.StoreUint64(&i.v, n) +func (i *Uint64) Store(val uint64) { + atomic.StoreUint64(&i.v, val) } // Swap atomically swaps the wrapped uint64 and returns the old value. -func (i *Uint64) Swap(n uint64) uint64 { - return atomic.SwapUint64(&i.v, n) +func (i *Uint64) Swap(val uint64) (old uint64) { + return atomic.SwapUint64(&i.v, val) } // MarshalJSON encodes the wrapped uint64 into JSON. diff --git a/vendor/go.uber.org/atomic/uintptr.go b/vendor/go.uber.org/atomic/uintptr.go new file mode 100644 index 0000000000..7d5b000d61 --- /dev/null +++ b/vendor/go.uber.org/atomic/uintptr.go @@ -0,0 +1,109 @@ +// @generated Code generated by gen-atomicint. + +// Copyright (c) 2020-2023 Uber Technologies, Inc. +// +// 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. + +package atomic + +import ( + "encoding/json" + "strconv" + "sync/atomic" +) + +// Uintptr is an atomic wrapper around uintptr. +type Uintptr struct { + _ nocmp // disallow non-atomic comparison + + v uintptr +} + +// NewUintptr creates a new Uintptr. +func NewUintptr(val uintptr) *Uintptr { + return &Uintptr{v: val} +} + +// Load atomically loads the wrapped value. +func (i *Uintptr) Load() uintptr { + return atomic.LoadUintptr(&i.v) +} + +// Add atomically adds to the wrapped uintptr and returns the new value. +func (i *Uintptr) Add(delta uintptr) uintptr { + return atomic.AddUintptr(&i.v, delta) +} + +// Sub atomically subtracts from the wrapped uintptr and returns the new value. +func (i *Uintptr) Sub(delta uintptr) uintptr { + return atomic.AddUintptr(&i.v, ^(delta - 1)) +} + +// Inc atomically increments the wrapped uintptr and returns the new value. +func (i *Uintptr) Inc() uintptr { + return i.Add(1) +} + +// Dec atomically decrements the wrapped uintptr and returns the new value. +func (i *Uintptr) Dec() uintptr { + return i.Sub(1) +} + +// CAS is an atomic compare-and-swap. +// +// Deprecated: Use CompareAndSwap. +func (i *Uintptr) CAS(old, new uintptr) (swapped bool) { + return i.CompareAndSwap(old, new) +} + +// CompareAndSwap is an atomic compare-and-swap. +func (i *Uintptr) CompareAndSwap(old, new uintptr) (swapped bool) { + return atomic.CompareAndSwapUintptr(&i.v, old, new) +} + +// Store atomically stores the passed value. +func (i *Uintptr) Store(val uintptr) { + atomic.StoreUintptr(&i.v, val) +} + +// Swap atomically swaps the wrapped uintptr and returns the old value. +func (i *Uintptr) Swap(val uintptr) (old uintptr) { + return atomic.SwapUintptr(&i.v, val) +} + +// MarshalJSON encodes the wrapped uintptr into JSON. +func (i *Uintptr) MarshalJSON() ([]byte, error) { + return json.Marshal(i.Load()) +} + +// UnmarshalJSON decodes JSON into the wrapped uintptr. +func (i *Uintptr) UnmarshalJSON(b []byte) error { + var v uintptr + if err := json.Unmarshal(b, &v); err != nil { + return err + } + i.Store(v) + return nil +} + +// String encodes the wrapped value as a string. +func (i *Uintptr) String() string { + v := i.Load() + return strconv.FormatUint(uint64(v), 10) +} diff --git a/vendor/go.uber.org/atomic/unsafe_pointer.go b/vendor/go.uber.org/atomic/unsafe_pointer.go new file mode 100644 index 0000000000..34868baf6a --- /dev/null +++ b/vendor/go.uber.org/atomic/unsafe_pointer.go @@ -0,0 +1,65 @@ +// Copyright (c) 2021-2022 Uber Technologies, Inc. +// +// 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. + +package atomic + +import ( + "sync/atomic" + "unsafe" +) + +// UnsafePointer is an atomic wrapper around unsafe.Pointer. +type UnsafePointer struct { + _ nocmp // disallow non-atomic comparison + + v unsafe.Pointer +} + +// NewUnsafePointer creates a new UnsafePointer. +func NewUnsafePointer(val unsafe.Pointer) *UnsafePointer { + return &UnsafePointer{v: val} +} + +// Load atomically loads the wrapped value. +func (p *UnsafePointer) Load() unsafe.Pointer { + return atomic.LoadPointer(&p.v) +} + +// Store atomically stores the passed value. +func (p *UnsafePointer) Store(val unsafe.Pointer) { + atomic.StorePointer(&p.v, val) +} + +// Swap atomically swaps the wrapped unsafe.Pointer and returns the old value. +func (p *UnsafePointer) Swap(val unsafe.Pointer) (old unsafe.Pointer) { + return atomic.SwapPointer(&p.v, val) +} + +// CAS is an atomic compare-and-swap. +// +// Deprecated: Use CompareAndSwap +func (p *UnsafePointer) CAS(old, new unsafe.Pointer) (swapped bool) { + return p.CompareAndSwap(old, new) +} + +// CompareAndSwap is an atomic compare-and-swap. +func (p *UnsafePointer) CompareAndSwap(old, new unsafe.Pointer) (swapped bool) { + return atomic.CompareAndSwapPointer(&p.v, old, new) +} diff --git a/vendor/go.uber.org/atomic/value.go b/vendor/go.uber.org/atomic/value.go index 671f3a3824..52caedb9a5 100644 --- a/vendor/go.uber.org/atomic/value.go +++ b/vendor/go.uber.org/atomic/value.go @@ -25,7 +25,7 @@ import "sync/atomic" // Value shadows the type of the same name from sync/atomic // https://godoc.org/sync/atomic#Value type Value struct { - atomic.Value - _ nocmp // disallow non-atomic comparison + + atomic.Value } diff --git a/vendor/go.uber.org/multierr/.travis.yml b/vendor/go.uber.org/multierr/.travis.yml deleted file mode 100644 index 8636ab42ad..0000000000 --- a/vendor/go.uber.org/multierr/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -sudo: false -language: go -go_import_path: go.uber.org/multierr - -env: - global: - - GO111MODULE=on - -go: - - oldstable - - stable - -before_install: -- go version - -script: -- | - set -e - make lint - make cover - -after_success: -- bash <(curl -s https://codecov.io/bash) diff --git a/vendor/go.uber.org/multierr/CHANGELOG.md b/vendor/go.uber.org/multierr/CHANGELOG.md index 6f1db9ef4a..f8177b978c 100644 --- a/vendor/go.uber.org/multierr/CHANGELOG.md +++ b/vendor/go.uber.org/multierr/CHANGELOG.md @@ -1,6 +1,41 @@ Releases ======== +v1.11.0 (2023-03-28) +==================== +- `Errors` now supports any error that implements multiple-error + interface. +- Add `Every` function to allow checking if all errors in the chain + satisfies `errors.Is` against the target error. + +v1.10.0 (2023-03-08) +==================== + +- Comply with Go 1.20's multiple-error interface. +- Drop Go 1.18 support. + Per the support policy, only Go 1.19 and 1.20 are supported now. +- Drop all non-test external dependencies. + +v1.9.0 (2022-12-12) +=================== + +- Add `AppendFunc` that allow passsing functions to similar to + `AppendInvoke`. + +- Bump up yaml.v3 dependency to 3.0.1. + +v1.8.0 (2022-02-28) +=================== + +- `Combine`: perform zero allocations when there are no errors. + + +v1.7.0 (2021-05-06) +=================== + +- Add `AppendInvoke` to append into errors from `defer` blocks. + + v1.6.0 (2020-09-14) =================== diff --git a/vendor/go.uber.org/multierr/LICENSE.txt b/vendor/go.uber.org/multierr/LICENSE.txt index 858e02475f..413e30f7ce 100644 --- a/vendor/go.uber.org/multierr/LICENSE.txt +++ b/vendor/go.uber.org/multierr/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2017 Uber Technologies, Inc. +Copyright (c) 2017-2021 Uber Technologies, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/go.uber.org/multierr/Makefile b/vendor/go.uber.org/multierr/Makefile index 316004400b..dcb6fe723c 100644 --- a/vendor/go.uber.org/multierr/Makefile +++ b/vendor/go.uber.org/multierr/Makefile @@ -34,9 +34,5 @@ lint: gofmt golint staticcheck .PHONY: cover cover: - go test -coverprofile=cover.out -coverpkg=./... -v ./... + go test -race -coverprofile=cover.out -coverpkg=./... -v ./... go tool cover -html=cover.out -o cover.html - -update-license: - @cd tools && go install go.uber.org/tools/update-license - @$(GOBIN)/update-license $(GO_FILES) diff --git a/vendor/go.uber.org/multierr/README.md b/vendor/go.uber.org/multierr/README.md index 751bd65e58..5ab6ac40f4 100644 --- a/vendor/go.uber.org/multierr/README.md +++ b/vendor/go.uber.org/multierr/README.md @@ -2,9 +2,29 @@ `multierr` allows combining one or more Go `error`s together. +## Features + +- **Idiomatic**: + multierr follows best practices in Go, and keeps your code idiomatic. + - It keeps the underlying error type hidden, + allowing you to deal in `error` values exclusively. + - It provides APIs to safely append into an error from a `defer` statement. +- **Performant**: + multierr is optimized for performance: + - It avoids allocations where possible. + - It utilizes slice resizing semantics to optimize common cases + like appending into the same error object from a loop. +- **Interoperable**: + multierr interoperates with the Go standard library's error APIs seamlessly: + - The `errors.Is` and `errors.As` functions *just work*. +- **Lightweight**: + multierr comes with virtually no dependencies. + ## Installation - go get -u go.uber.org/multierr +```bash +go get -u go.uber.org/multierr@latest +``` ## Status @@ -15,9 +35,9 @@ Stable: No breaking changes will be made before 2.0. Released under the [MIT License]. [MIT License]: LICENSE.txt -[doc-img]: https://godoc.org/go.uber.org/multierr?status.svg -[doc]: https://godoc.org/go.uber.org/multierr -[ci-img]: https://travis-ci.com/uber-go/multierr.svg?branch=master +[doc-img]: https://pkg.go.dev/badge/go.uber.org/multierr +[doc]: https://pkg.go.dev/go.uber.org/multierr +[ci-img]: https://github.com/uber-go/multierr/actions/workflows/go.yml/badge.svg [cov-img]: https://codecov.io/gh/uber-go/multierr/branch/master/graph/badge.svg -[ci]: https://travis-ci.com/uber-go/multierr +[ci]: https://github.com/uber-go/multierr/actions/workflows/go.yml [cov]: https://codecov.io/gh/uber-go/multierr diff --git a/vendor/go.uber.org/multierr/error.go b/vendor/go.uber.org/multierr/error.go index 5c9b67d537..3a828b2dff 100644 --- a/vendor/go.uber.org/multierr/error.go +++ b/vendor/go.uber.org/multierr/error.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Uber Technologies, Inc. +// Copyright (c) 2017-2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -20,54 +20,109 @@ // Package multierr allows combining one or more errors together. // -// Overview +// # Overview // // Errors can be combined with the use of the Combine function. // -// multierr.Combine( -// reader.Close(), -// writer.Close(), -// conn.Close(), -// ) +// multierr.Combine( +// reader.Close(), +// writer.Close(), +// conn.Close(), +// ) // // If only two errors are being combined, the Append function may be used // instead. // -// err = multierr.Append(reader.Close(), writer.Close()) -// -// This makes it possible to record resource cleanup failures from deferred -// blocks with the help of named return values. -// -// func sendRequest(req Request) (err error) { -// conn, err := openConnection() -// if err != nil { -// return err -// } -// defer func() { -// err = multierr.Append(err, conn.Close()) -// }() -// // ... -// } +// err = multierr.Append(reader.Close(), writer.Close()) // // The underlying list of errors for a returned error object may be retrieved // with the Errors function. // -// errors := multierr.Errors(err) -// if len(errors) > 0 { -// fmt.Println("The following errors occurred:", errors) -// } +// errors := multierr.Errors(err) +// if len(errors) > 0 { +// fmt.Println("The following errors occurred:", errors) +// } +// +// # Appending from a loop +// +// You sometimes need to append into an error from a loop. +// +// var err error +// for _, item := range items { +// err = multierr.Append(err, process(item)) +// } +// +// Cases like this may require knowledge of whether an individual instance +// failed. This usually requires introduction of a new variable. +// +// var err error +// for _, item := range items { +// if perr := process(item); perr != nil { +// log.Warn("skipping item", item) +// err = multierr.Append(err, perr) +// } +// } +// +// multierr includes AppendInto to simplify cases like this. +// +// var err error +// for _, item := range items { +// if multierr.AppendInto(&err, process(item)) { +// log.Warn("skipping item", item) +// } +// } +// +// This will append the error into the err variable, and return true if that +// individual error was non-nil. // -// Advanced Usage +// See [AppendInto] for more information. +// +// # Deferred Functions +// +// Go makes it possible to modify the return value of a function in a defer +// block if the function was using named returns. This makes it possible to +// record resource cleanup failures from deferred blocks. +// +// func sendRequest(req Request) (err error) { +// conn, err := openConnection() +// if err != nil { +// return err +// } +// defer func() { +// err = multierr.Append(err, conn.Close()) +// }() +// // ... +// } +// +// multierr provides the Invoker type and AppendInvoke function to make cases +// like the above simpler and obviate the need for a closure. The following is +// roughly equivalent to the example above. +// +// func sendRequest(req Request) (err error) { +// conn, err := openConnection() +// if err != nil { +// return err +// } +// defer multierr.AppendInvoke(&err, multierr.Close(conn)) +// // ... +// } +// +// See [AppendInvoke] and [Invoker] for more information. +// +// NOTE: If you're modifying an error from inside a defer, you MUST use a named +// return value for that function. +// +// # Advanced Usage // // Errors returned by Combine and Append MAY implement the following // interface. // -// type errorGroup interface { -// // Returns a slice containing the underlying list of errors. -// // -// // This slice MUST NOT be modified by the caller. -// Errors() []error -// } +// type errorGroup interface { +// // Returns a slice containing the underlying list of errors. +// // +// // This slice MUST NOT be modified by the caller. +// Errors() []error +// } // // Note that if you need access to list of errors behind a multierr error, you // should prefer using the Errors function. That said, if you need cheap @@ -76,23 +131,23 @@ // because errors returned by Combine and Append are not guaranteed to // implement this interface. // -// var errors []error -// group, ok := err.(errorGroup) -// if ok { -// errors = group.Errors() -// } else { -// errors = []error{err} -// } +// var errors []error +// group, ok := err.(errorGroup) +// if ok { +// errors = group.Errors() +// } else { +// errors = []error{err} +// } package multierr // import "go.uber.org/multierr" import ( "bytes" + "errors" "fmt" "io" "strings" "sync" - - "go.uber.org/atomic" + "sync/atomic" ) var ( @@ -132,34 +187,15 @@ type errorGroup interface { // Errors returns a slice containing zero or more errors that the supplied // error is composed of. If the error is nil, a nil slice is returned. // -// err := multierr.Append(r.Close(), w.Close()) -// errors := multierr.Errors(err) +// err := multierr.Append(r.Close(), w.Close()) +// errors := multierr.Errors(err) // // If the error is not composed of other errors, the returned slice contains // just the error that was passed in. // // Callers of this function are free to modify the returned slice. func Errors(err error) []error { - if err == nil { - return nil - } - - // Note that we're casting to multiError, not errorGroup. Our contract is - // that returned errors MAY implement errorGroup. Errors, however, only - // has special behavior for multierr-specific error objects. - // - // This behavior can be expanded in the future but I think it's prudent to - // start with as little as possible in terms of contract and possibility - // of misuse. - eg, ok := err.(*multiError) - if !ok { - return []error{err} - } - - errors := eg.Errors() - result := make([]error, len(errors)) - copy(result, errors) - return result + return extractErrors(err) } // multiError is an error that holds one or more errors. @@ -174,8 +210,6 @@ type multiError struct { errors []error } -var _ errorGroup = (*multiError)(nil) - // Errors returns the list of underlying errors. // // This slice MUST NOT be modified. @@ -201,6 +235,17 @@ func (merr *multiError) Error() string { return result } +// Every compares every error in the given err against the given target error +// using [errors.Is], and returns true only if every comparison returned true. +func Every(err error, target error) bool { + for _, e := range extractErrors(err) { + if !errors.Is(e, target) { + return false + } + } + return true +} + func (merr *multiError) Format(f fmt.State, c rune) { if c == 'v' && f.Flag('+') { merr.writeMultiline(f) @@ -292,6 +337,14 @@ func inspect(errors []error) (res inspectResult) { // fromSlice converts the given list of errors into a single error. func fromSlice(errors []error) error { + // Don't pay to inspect small slices. + switch len(errors) { + case 0: + return nil + case 1: + return errors[0] + } + res := inspect(errors) switch res.Count { case 0: @@ -301,8 +354,12 @@ func fromSlice(errors []error) error { return errors[res.FirstErrorIdx] case len(errors): if !res.ContainsMultiError { - // already flat - return &multiError{errors: errors} + // Error list is flat. Make a copy of it + // Otherwise "errors" escapes to the heap + // unconditionally for all other cases. + // This lets us optimize for the "no errors" case. + out := append(([]error)(nil), errors...) + return &multiError{errors: out} } } @@ -327,32 +384,32 @@ func fromSlice(errors []error) error { // If zero arguments were passed or if all items are nil, a nil error is // returned. // -// Combine(nil, nil) // == nil +// Combine(nil, nil) // == nil // // If only a single error was passed, it is returned as-is. // -// Combine(err) // == err +// Combine(err) // == err // // Combine skips over nil arguments so this function may be used to combine // together errors from operations that fail independently of each other. // -// multierr.Combine( -// reader.Close(), -// writer.Close(), -// pipe.Close(), -// ) +// multierr.Combine( +// reader.Close(), +// writer.Close(), +// pipe.Close(), +// ) // // If any of the passed errors is a multierr error, it will be flattened along // with the other errors. // -// multierr.Combine(multierr.Combine(err1, err2), err3) -// // is the same as -// multierr.Combine(err1, err2, err3) +// multierr.Combine(multierr.Combine(err1, err2), err3) +// // is the same as +// multierr.Combine(err1, err2, err3) // // The returned error formats into a readable multi-line error message if // formatted with %+v. // -// fmt.Sprintf("%+v", multierr.Combine(err1, err2)) +// fmt.Sprintf("%+v", multierr.Combine(err1, err2)) func Combine(errors ...error) error { return fromSlice(errors) } @@ -362,16 +419,19 @@ func Combine(errors ...error) error { // This function is a specialization of Combine for the common case where // there are only two errors. // -// err = multierr.Append(reader.Close(), writer.Close()) +// err = multierr.Append(reader.Close(), writer.Close()) // // The following pattern may also be used to record failure of deferred // operations without losing information about the original error. // -// func doSomething(..) (err error) { -// f := acquireResource() -// defer func() { -// err = multierr.Append(err, f.Close()) -// }() +// func doSomething(..) (err error) { +// f := acquireResource() +// defer func() { +// err = multierr.Append(err, f.Close()) +// }() +// +// Note that the variable MUST be a named return to append an error to it from +// the defer statement. See also [AppendInvoke]. func Append(left error, right error) error { switch { case left == nil: @@ -401,37 +461,37 @@ func Append(left error, right error) error { // AppendInto appends an error into the destination of an error pointer and // returns whether the error being appended was non-nil. // -// var err error -// multierr.AppendInto(&err, r.Close()) -// multierr.AppendInto(&err, w.Close()) +// var err error +// multierr.AppendInto(&err, r.Close()) +// multierr.AppendInto(&err, w.Close()) // // The above is equivalent to, // -// err := multierr.Append(r.Close(), w.Close()) +// err := multierr.Append(r.Close(), w.Close()) // // As AppendInto reports whether the provided error was non-nil, it may be // used to build a multierr error in a loop more ergonomically. For example: // -// var err error -// for line := range lines { -// var item Item -// if multierr.AppendInto(&err, parse(line, &item)) { -// continue -// } -// items = append(items, item) -// } -// -// Compare this with a verison that relies solely on Append: -// -// var err error -// for line := range lines { -// var item Item -// if parseErr := parse(line, &item); parseErr != nil { -// err = multierr.Append(err, parseErr) -// continue -// } -// items = append(items, item) -// } +// var err error +// for line := range lines { +// var item Item +// if multierr.AppendInto(&err, parse(line, &item)) { +// continue +// } +// items = append(items, item) +// } +// +// Compare this with a version that relies solely on Append: +// +// var err error +// for line := range lines { +// var item Item +// if parseErr := parse(line, &item); parseErr != nil { +// err = multierr.Append(err, parseErr) +// continue +// } +// items = append(items, item) +// } func AppendInto(into *error, err error) (errored bool) { if into == nil { // We panic if 'into' is nil. This is not documented above @@ -447,3 +507,140 @@ func AppendInto(into *error, err error) (errored bool) { *into = Append(*into, err) return true } + +// Invoker is an operation that may fail with an error. Use it with +// AppendInvoke to append the result of calling the function into an error. +// This allows you to conveniently defer capture of failing operations. +// +// See also, [Close] and [Invoke]. +type Invoker interface { + Invoke() error +} + +// Invoke wraps a function which may fail with an error to match the Invoker +// interface. Use it to supply functions matching this signature to +// AppendInvoke. +// +// For example, +// +// func processReader(r io.Reader) (err error) { +// scanner := bufio.NewScanner(r) +// defer multierr.AppendInvoke(&err, multierr.Invoke(scanner.Err)) +// for scanner.Scan() { +// // ... +// } +// // ... +// } +// +// In this example, the following line will construct the Invoker right away, +// but defer the invocation of scanner.Err() until the function returns. +// +// defer multierr.AppendInvoke(&err, multierr.Invoke(scanner.Err)) +// +// Note that the error you're appending to from the defer statement MUST be a +// named return. +type Invoke func() error + +// Invoke calls the supplied function and returns its result. +func (i Invoke) Invoke() error { return i() } + +// Close builds an Invoker that closes the provided io.Closer. Use it with +// AppendInvoke to close io.Closers and append their results into an error. +// +// For example, +// +// func processFile(path string) (err error) { +// f, err := os.Open(path) +// if err != nil { +// return err +// } +// defer multierr.AppendInvoke(&err, multierr.Close(f)) +// return processReader(f) +// } +// +// In this example, multierr.Close will construct the Invoker right away, but +// defer the invocation of f.Close until the function returns. +// +// defer multierr.AppendInvoke(&err, multierr.Close(f)) +// +// Note that the error you're appending to from the defer statement MUST be a +// named return. +func Close(closer io.Closer) Invoker { + return Invoke(closer.Close) +} + +// AppendInvoke appends the result of calling the given Invoker into the +// provided error pointer. Use it with named returns to safely defer +// invocation of fallible operations until a function returns, and capture the +// resulting errors. +// +// func doSomething(...) (err error) { +// // ... +// f, err := openFile(..) +// if err != nil { +// return err +// } +// +// // multierr will call f.Close() when this function returns and +// // if the operation fails, its append its error into the +// // returned error. +// defer multierr.AppendInvoke(&err, multierr.Close(f)) +// +// scanner := bufio.NewScanner(f) +// // Similarly, this scheduled scanner.Err to be called and +// // inspected when the function returns and append its error +// // into the returned error. +// defer multierr.AppendInvoke(&err, multierr.Invoke(scanner.Err)) +// +// // ... +// } +// +// NOTE: If used with a defer, the error variable MUST be a named return. +// +// Without defer, AppendInvoke behaves exactly like AppendInto. +// +// err := // ... +// multierr.AppendInvoke(&err, mutltierr.Invoke(foo)) +// +// // ...is roughly equivalent to... +// +// err := // ... +// multierr.AppendInto(&err, foo()) +// +// The advantage of the indirection introduced by Invoker is to make it easy +// to defer the invocation of a function. Without this indirection, the +// invoked function will be evaluated at the time of the defer block rather +// than when the function returns. +// +// // BAD: This is likely not what the caller intended. This will evaluate +// // foo() right away and append its result into the error when the +// // function returns. +// defer multierr.AppendInto(&err, foo()) +// +// // GOOD: This will defer invocation of foo unutil the function returns. +// defer multierr.AppendInvoke(&err, multierr.Invoke(foo)) +// +// multierr provides a few Invoker implementations out of the box for +// convenience. See [Invoker] for more information. +func AppendInvoke(into *error, invoker Invoker) { + AppendInto(into, invoker.Invoke()) +} + +// AppendFunc is a shorthand for [AppendInvoke]. +// It allows using function or method value directly +// without having to wrap it into an [Invoker] interface. +// +// func doSomething(...) (err error) { +// w, err := startWorker(...) +// if err != nil { +// return err +// } +// +// // multierr will call w.Stop() when this function returns and +// // if the operation fails, it appends its error into the +// // returned error. +// defer multierr.AppendFunc(&err, w.Stop) +// } +func AppendFunc(into *error, fn func() error) { + AppendInvoke(into, Invoke(fn)) +} diff --git a/vendor/go.uber.org/multierr/error_post_go120.go b/vendor/go.uber.org/multierr/error_post_go120.go new file mode 100644 index 0000000000..a173f9c251 --- /dev/null +++ b/vendor/go.uber.org/multierr/error_post_go120.go @@ -0,0 +1,48 @@ +// Copyright (c) 2017-2023 Uber Technologies, Inc. +// +// 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. + +//go:build go1.20 +// +build go1.20 + +package multierr + +// Unwrap returns a list of errors wrapped by this multierr. +func (merr *multiError) Unwrap() []error { + return merr.Errors() +} + +type multipleErrors interface { + Unwrap() []error +} + +func extractErrors(err error) []error { + if err == nil { + return nil + } + + // check if the given err is an Unwrapable error that + // implements multipleErrors interface. + eg, ok := err.(multipleErrors) + if !ok { + return []error{err} + } + + return append(([]error)(nil), eg.Unwrap()...) +} diff --git a/vendor/go.uber.org/multierr/error_pre_go120.go b/vendor/go.uber.org/multierr/error_pre_go120.go new file mode 100644 index 0000000000..93872a3fcd --- /dev/null +++ b/vendor/go.uber.org/multierr/error_pre_go120.go @@ -0,0 +1,79 @@ +// Copyright (c) 2017-2023 Uber Technologies, Inc. +// +// 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. + +//go:build !go1.20 +// +build !go1.20 + +package multierr + +import "errors" + +// Versions of Go before 1.20 did not support the Unwrap() []error method. +// This provides a similar behavior by implementing the Is(..) and As(..) +// methods. +// See the errors.Join proposal for details: +// https://github.com/golang/go/issues/53435 + +// As attempts to find the first error in the error list that matches the type +// of the value that target points to. +// +// This function allows errors.As to traverse the values stored on the +// multierr error. +func (merr *multiError) As(target interface{}) bool { + for _, err := range merr.Errors() { + if errors.As(err, target) { + return true + } + } + return false +} + +// Is attempts to match the provided error against errors in the error list. +// +// This function allows errors.Is to traverse the values stored on the +// multierr error. +func (merr *multiError) Is(target error) bool { + for _, err := range merr.Errors() { + if errors.Is(err, target) { + return true + } + } + return false +} + +func extractErrors(err error) []error { + if err == nil { + return nil + } + + // Note that we're casting to multiError, not errorGroup. Our contract is + // that returned errors MAY implement errorGroup. Errors, however, only + // has special behavior for multierr-specific error objects. + // + // This behavior can be expanded in the future but I think it's prudent to + // start with as little as possible in terms of contract and possibility + // of misuse. + eg, ok := err.(*multiError) + if !ok { + return []error{err} + } + + return append(([]error)(nil), eg.Errors()...) +} diff --git a/vendor/go.uber.org/multierr/glide.yaml b/vendor/go.uber.org/multierr/glide.yaml deleted file mode 100644 index 6ef084ec24..0000000000 --- a/vendor/go.uber.org/multierr/glide.yaml +++ /dev/null @@ -1,8 +0,0 @@ -package: go.uber.org/multierr -import: -- package: go.uber.org/atomic - version: ^1 -testImport: -- package: github.com/stretchr/testify - subpackages: - - assert diff --git a/vendor/go.uber.org/multierr/go113.go b/vendor/go.uber.org/multierr/go113.go deleted file mode 100644 index 264b0eac0d..0000000000 --- a/vendor/go.uber.org/multierr/go113.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2019 Uber Technologies, Inc. -// -// 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. - -// +build go1.13 - -package multierr - -import "errors" - -// As attempts to find the first error in the error list that matches the type -// of the value that target points to. -// -// This function allows errors.As to traverse the values stored on the -// multierr error. -func (merr *multiError) As(target interface{}) bool { - for _, err := range merr.Errors() { - if errors.As(err, target) { - return true - } - } - return false -} - -// Is attempts to match the provided error against errors in the error list. -// -// This function allows errors.Is to traverse the values stored on the -// multierr error. -func (merr *multiError) Is(target error) bool { - for _, err := range merr.Errors() { - if errors.Is(err, target) { - return true - } - } - return false -} diff --git a/vendor/golang.org/x/crypto/LICENSE b/vendor/golang.org/x/crypto/LICENSE index 6a66aea5ea..2a7cf70da6 100644 --- a/vendor/golang.org/x/crypto/LICENSE +++ b/vendor/golang.org/x/crypto/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. 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 + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/vendor/golang.org/x/crypto/bcrypt/bcrypt.go b/vendor/golang.org/x/crypto/bcrypt/bcrypt.go index 5577c0f939..dc9311870a 100644 --- a/vendor/golang.org/x/crypto/bcrypt/bcrypt.go +++ b/vendor/golang.org/x/crypto/bcrypt/bcrypt.go @@ -4,7 +4,7 @@ // Package bcrypt implements Provos and Mazières's bcrypt adaptive hashing // algorithm. See http://www.usenix.org/event/usenix99/provos/provos.pdf -package bcrypt // import "golang.org/x/crypto/bcrypt" +package bcrypt // The code is a port of Provos and Mazières's C implementation. import ( diff --git a/vendor/golang.org/x/crypto/blowfish/cipher.go b/vendor/golang.org/x/crypto/blowfish/cipher.go index 213bf204af..0898956807 100644 --- a/vendor/golang.org/x/crypto/blowfish/cipher.go +++ b/vendor/golang.org/x/crypto/blowfish/cipher.go @@ -11,7 +11,7 @@ // Deprecated: any new system should use AES (from crypto/aes, if necessary in // an AEAD mode like crypto/cipher.NewGCM) or XChaCha20-Poly1305 (from // golang.org/x/crypto/chacha20poly1305). -package blowfish // import "golang.org/x/crypto/blowfish" +package blowfish // The code is a port of Bruce Schneier's C implementation. // See https://www.schneier.com/blowfish.html. diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s index 66aebae258..c672ccf698 100644 --- a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s +++ b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s @@ -33,6 +33,9 @@ #define CONSTBASE R16 #define BLOCKS R17 +// for VPERMXOR +#define MASK R18 + DATA consts<>+0x00(SB)/8, $0x3320646e61707865 DATA consts<>+0x08(SB)/8, $0x6b20657479622d32 DATA consts<>+0x10(SB)/8, $0x0000000000000001 @@ -53,7 +56,11 @@ DATA consts<>+0x80(SB)/8, $0x6b2065746b206574 DATA consts<>+0x88(SB)/8, $0x6b2065746b206574 DATA consts<>+0x90(SB)/8, $0x0000000100000000 DATA consts<>+0x98(SB)/8, $0x0000000300000002 -GLOBL consts<>(SB), RODATA, $0xa0 +DATA consts<>+0xa0(SB)/8, $0x5566774411223300 +DATA consts<>+0xa8(SB)/8, $0xddeeffcc99aabb88 +DATA consts<>+0xb0(SB)/8, $0x6677445522330011 +DATA consts<>+0xb8(SB)/8, $0xeeffccddaabb8899 +GLOBL consts<>(SB), RODATA, $0xc0 //func chaCha20_ctr32_vsx(out, inp *byte, len int, key *[8]uint32, counter *uint32) TEXT ·chaCha20_ctr32_vsx(SB),NOSPLIT,$64-40 @@ -70,6 +77,9 @@ TEXT ·chaCha20_ctr32_vsx(SB),NOSPLIT,$64-40 MOVD $48, R10 MOVD $64, R11 SRD $6, LEN, BLOCKS + // for VPERMXOR + MOVD $consts<>+0xa0(SB), MASK + MOVD $16, R20 // V16 LXVW4X (CONSTBASE)(R0), VS48 ADD $80,CONSTBASE @@ -87,6 +97,10 @@ TEXT ·chaCha20_ctr32_vsx(SB),NOSPLIT,$64-40 // V28 LXVW4X (CONSTBASE)(R11), VS60 + // Load mask constants for VPERMXOR + LXVW4X (MASK)(R0), V20 + LXVW4X (MASK)(R20), V21 + // splat slot from V19 -> V26 VSPLTW $0, V19, V26 @@ -97,7 +111,7 @@ TEXT ·chaCha20_ctr32_vsx(SB),NOSPLIT,$64-40 MOVD $10, R14 MOVD R14, CTR - + PCALIGN $16 loop_outer_vsx: // V0, V1, V2, V3 LXVW4X (R0)(CONSTBASE), VS32 @@ -128,22 +142,17 @@ loop_outer_vsx: VSPLTISW $12, V28 VSPLTISW $8, V29 VSPLTISW $7, V30 - + PCALIGN $16 loop_vsx: VADDUWM V0, V4, V0 VADDUWM V1, V5, V1 VADDUWM V2, V6, V2 VADDUWM V3, V7, V3 - VXOR V12, V0, V12 - VXOR V13, V1, V13 - VXOR V14, V2, V14 - VXOR V15, V3, V15 - - VRLW V12, V27, V12 - VRLW V13, V27, V13 - VRLW V14, V27, V14 - VRLW V15, V27, V15 + VPERMXOR V12, V0, V21, V12 + VPERMXOR V13, V1, V21, V13 + VPERMXOR V14, V2, V21, V14 + VPERMXOR V15, V3, V21, V15 VADDUWM V8, V12, V8 VADDUWM V9, V13, V9 @@ -165,15 +174,10 @@ loop_vsx: VADDUWM V2, V6, V2 VADDUWM V3, V7, V3 - VXOR V12, V0, V12 - VXOR V13, V1, V13 - VXOR V14, V2, V14 - VXOR V15, V3, V15 - - VRLW V12, V29, V12 - VRLW V13, V29, V13 - VRLW V14, V29, V14 - VRLW V15, V29, V15 + VPERMXOR V12, V0, V20, V12 + VPERMXOR V13, V1, V20, V13 + VPERMXOR V14, V2, V20, V14 + VPERMXOR V15, V3, V20, V15 VADDUWM V8, V12, V8 VADDUWM V9, V13, V9 @@ -195,15 +199,10 @@ loop_vsx: VADDUWM V2, V7, V2 VADDUWM V3, V4, V3 - VXOR V15, V0, V15 - VXOR V12, V1, V12 - VXOR V13, V2, V13 - VXOR V14, V3, V14 - - VRLW V15, V27, V15 - VRLW V12, V27, V12 - VRLW V13, V27, V13 - VRLW V14, V27, V14 + VPERMXOR V15, V0, V21, V15 + VPERMXOR V12, V1, V21, V12 + VPERMXOR V13, V2, V21, V13 + VPERMXOR V14, V3, V21, V14 VADDUWM V10, V15, V10 VADDUWM V11, V12, V11 @@ -225,15 +224,10 @@ loop_vsx: VADDUWM V2, V7, V2 VADDUWM V3, V4, V3 - VXOR V15, V0, V15 - VXOR V12, V1, V12 - VXOR V13, V2, V13 - VXOR V14, V3, V14 - - VRLW V15, V29, V15 - VRLW V12, V29, V12 - VRLW V13, V29, V13 - VRLW V14, V29, V14 + VPERMXOR V15, V0, V20, V15 + VPERMXOR V12, V1, V20, V12 + VPERMXOR V13, V2, V20, V13 + VPERMXOR V14, V3, V20, V14 VADDUWM V10, V15, V10 VADDUWM V11, V12, V11 @@ -249,48 +243,48 @@ loop_vsx: VRLW V6, V30, V6 VRLW V7, V30, V7 VRLW V4, V30, V4 - BC 16, LT, loop_vsx + BDNZ loop_vsx VADDUWM V12, V26, V12 - WORD $0x13600F8C // VMRGEW V0, V1, V27 - WORD $0x13821F8C // VMRGEW V2, V3, V28 + VMRGEW V0, V1, V27 + VMRGEW V2, V3, V28 - WORD $0x10000E8C // VMRGOW V0, V1, V0 - WORD $0x10421E8C // VMRGOW V2, V3, V2 + VMRGOW V0, V1, V0 + VMRGOW V2, V3, V2 - WORD $0x13A42F8C // VMRGEW V4, V5, V29 - WORD $0x13C63F8C // VMRGEW V6, V7, V30 + VMRGEW V4, V5, V29 + VMRGEW V6, V7, V30 XXPERMDI VS32, VS34, $0, VS33 XXPERMDI VS32, VS34, $3, VS35 XXPERMDI VS59, VS60, $0, VS32 XXPERMDI VS59, VS60, $3, VS34 - WORD $0x10842E8C // VMRGOW V4, V5, V4 - WORD $0x10C63E8C // VMRGOW V6, V7, V6 + VMRGOW V4, V5, V4 + VMRGOW V6, V7, V6 - WORD $0x13684F8C // VMRGEW V8, V9, V27 - WORD $0x138A5F8C // VMRGEW V10, V11, V28 + VMRGEW V8, V9, V27 + VMRGEW V10, V11, V28 XXPERMDI VS36, VS38, $0, VS37 XXPERMDI VS36, VS38, $3, VS39 XXPERMDI VS61, VS62, $0, VS36 XXPERMDI VS61, VS62, $3, VS38 - WORD $0x11084E8C // VMRGOW V8, V9, V8 - WORD $0x114A5E8C // VMRGOW V10, V11, V10 + VMRGOW V8, V9, V8 + VMRGOW V10, V11, V10 - WORD $0x13AC6F8C // VMRGEW V12, V13, V29 - WORD $0x13CE7F8C // VMRGEW V14, V15, V30 + VMRGEW V12, V13, V29 + VMRGEW V14, V15, V30 XXPERMDI VS40, VS42, $0, VS41 XXPERMDI VS40, VS42, $3, VS43 XXPERMDI VS59, VS60, $0, VS40 XXPERMDI VS59, VS60, $3, VS42 - WORD $0x118C6E8C // VMRGOW V12, V13, V12 - WORD $0x11CE7E8C // VMRGOW V14, V15, V14 + VMRGOW V12, V13, V12 + VMRGOW V14, V15, V14 VSPLTISW $4, V27 VADDUWM V26, V27, V26 @@ -431,7 +425,7 @@ tail_vsx: ADD $-1, R11, R12 ADD $-1, INP ADD $-1, OUT - + PCALIGN $16 looptail_vsx: // Copying the result to OUT // in bytes. @@ -439,7 +433,7 @@ looptail_vsx: MOVBZU 1(INP), TMP XOR KEY, TMP, KEY MOVBU KEY, 1(OUT) - BC 16, LT, looptail_vsx + BDNZ looptail_vsx // Clear the stack values STXVW4X VS48, (R11)(R0) diff --git a/vendor/golang.org/x/crypto/curve25519/curve25519.go b/vendor/golang.org/x/crypto/curve25519/curve25519.go index 00f963ea20..21ca3b2ee4 100644 --- a/vendor/golang.org/x/crypto/curve25519/curve25519.go +++ b/vendor/golang.org/x/crypto/curve25519/curve25519.go @@ -6,9 +6,11 @@ // performs scalar multiplication on the elliptic curve known as Curve25519. // See RFC 7748. // -// Starting in Go 1.20, this package is a wrapper for the X25519 implementation +// This package is a wrapper for the X25519 implementation // in the crypto/ecdh package. -package curve25519 // import "golang.org/x/crypto/curve25519" +package curve25519 + +import "crypto/ecdh" // ScalarMult sets dst to the product scalar * point. // @@ -16,7 +18,13 @@ package curve25519 // import "golang.org/x/crypto/curve25519" // zeroes, irrespective of the scalar. Instead, use the X25519 function, which // will return an error. func ScalarMult(dst, scalar, point *[32]byte) { - scalarMult(dst, scalar, point) + if _, err := x25519(dst, scalar[:], point[:]); err != nil { + // The only error condition for x25519 when the inputs are 32 bytes long + // is if the output would have been the all-zero value. + for i := range dst { + dst[i] = 0 + } + } } // ScalarBaseMult sets dst to the product scalar * base where base is the @@ -25,7 +33,12 @@ func ScalarMult(dst, scalar, point *[32]byte) { // It is recommended to use the X25519 function with Basepoint instead, as // copying into fixed size arrays can lead to unexpected bugs. func ScalarBaseMult(dst, scalar *[32]byte) { - scalarBaseMult(dst, scalar) + curve := ecdh.X25519() + priv, err := curve.NewPrivateKey(scalar[:]) + if err != nil { + panic("curve25519: internal error: scalarBaseMult was not 32 bytes") + } + copy(dst[:], priv.PublicKey().Bytes()) } const ( @@ -57,3 +70,21 @@ func X25519(scalar, point []byte) ([]byte, error) { var dst [32]byte return x25519(&dst, scalar, point) } + +func x25519(dst *[32]byte, scalar, point []byte) ([]byte, error) { + curve := ecdh.X25519() + pub, err := curve.NewPublicKey(point) + if err != nil { + return nil, err + } + priv, err := curve.NewPrivateKey(scalar) + if err != nil { + return nil, err + } + out, err := priv.ECDH(pub) + if err != nil { + return nil, err + } + copy(dst[:], out) + return dst[:], nil +} diff --git a/vendor/golang.org/x/crypto/curve25519/curve25519_compat.go b/vendor/golang.org/x/crypto/curve25519/curve25519_compat.go deleted file mode 100644 index ba647e8d77..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/curve25519_compat.go +++ /dev/null @@ -1,105 +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. - -//go:build !go1.20 - -package curve25519 - -import ( - "crypto/subtle" - "errors" - "strconv" - - "golang.org/x/crypto/curve25519/internal/field" -) - -func scalarMult(dst, scalar, point *[32]byte) { - var e [32]byte - - copy(e[:], scalar[:]) - e[0] &= 248 - e[31] &= 127 - e[31] |= 64 - - var x1, x2, z2, x3, z3, tmp0, tmp1 field.Element - x1.SetBytes(point[:]) - x2.One() - x3.Set(&x1) - z3.One() - - swap := 0 - for pos := 254; pos >= 0; pos-- { - b := e[pos/8] >> uint(pos&7) - b &= 1 - swap ^= int(b) - x2.Swap(&x3, swap) - z2.Swap(&z3, swap) - swap = int(b) - - tmp0.Subtract(&x3, &z3) - tmp1.Subtract(&x2, &z2) - x2.Add(&x2, &z2) - z2.Add(&x3, &z3) - z3.Multiply(&tmp0, &x2) - z2.Multiply(&z2, &tmp1) - tmp0.Square(&tmp1) - tmp1.Square(&x2) - x3.Add(&z3, &z2) - z2.Subtract(&z3, &z2) - x2.Multiply(&tmp1, &tmp0) - tmp1.Subtract(&tmp1, &tmp0) - z2.Square(&z2) - - z3.Mult32(&tmp1, 121666) - x3.Square(&x3) - tmp0.Add(&tmp0, &z3) - z3.Multiply(&x1, &z2) - z2.Multiply(&tmp1, &tmp0) - } - - x2.Swap(&x3, swap) - z2.Swap(&z3, swap) - - z2.Invert(&z2) - x2.Multiply(&x2, &z2) - copy(dst[:], x2.Bytes()) -} - -func scalarBaseMult(dst, scalar *[32]byte) { - checkBasepoint() - scalarMult(dst, scalar, &basePoint) -} - -func x25519(dst *[32]byte, scalar, point []byte) ([]byte, error) { - var in [32]byte - if l := len(scalar); l != 32 { - return nil, errors.New("bad scalar length: " + strconv.Itoa(l) + ", expected 32") - } - if l := len(point); l != 32 { - return nil, errors.New("bad point length: " + strconv.Itoa(l) + ", expected 32") - } - copy(in[:], scalar) - if &point[0] == &Basepoint[0] { - scalarBaseMult(dst, &in) - } else { - var base, zero [32]byte - copy(base[:], point) - scalarMult(dst, &in, &base) - if subtle.ConstantTimeCompare(dst[:], zero[:]) == 1 { - return nil, errors.New("bad input point: low order point") - } - } - return dst[:], nil -} - -func checkBasepoint() { - if subtle.ConstantTimeCompare(Basepoint, []byte{ - 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }) != 1 { - panic("curve25519: global Basepoint value was modified") - } -} diff --git a/vendor/golang.org/x/crypto/curve25519/curve25519_go120.go b/vendor/golang.org/x/crypto/curve25519/curve25519_go120.go deleted file mode 100644 index 627df49727..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/curve25519_go120.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 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:build go1.20 - -package curve25519 - -import "crypto/ecdh" - -func x25519(dst *[32]byte, scalar, point []byte) ([]byte, error) { - curve := ecdh.X25519() - pub, err := curve.NewPublicKey(point) - if err != nil { - return nil, err - } - priv, err := curve.NewPrivateKey(scalar) - if err != nil { - return nil, err - } - out, err := priv.ECDH(pub) - if err != nil { - return nil, err - } - copy(dst[:], out) - return dst[:], nil -} - -func scalarMult(dst, scalar, point *[32]byte) { - if _, err := x25519(dst, scalar[:], point[:]); err != nil { - // The only error condition for x25519 when the inputs are 32 bytes long - // is if the output would have been the all-zero value. - for i := range dst { - dst[i] = 0 - } - } -} - -func scalarBaseMult(dst, scalar *[32]byte) { - curve := ecdh.X25519() - priv, err := curve.NewPrivateKey(scalar[:]) - if err != nil { - panic("curve25519: internal error: scalarBaseMult was not 32 bytes") - } - copy(dst[:], priv.PublicKey().Bytes()) -} diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/README b/vendor/golang.org/x/crypto/curve25519/internal/field/README deleted file mode 100644 index e25bca7dc8..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/internal/field/README +++ /dev/null @@ -1,7 +0,0 @@ -This package is kept in sync with crypto/ed25519/internal/edwards25519/field in -the standard library. - -If there are any changes in the standard library that need to be synced to this -package, run sync.sh. It will not overwrite any local changes made since the -previous sync, so it's ok to land changes in this package first, and then sync -to the standard library later. diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe.go b/vendor/golang.org/x/crypto/curve25519/internal/field/fe.go deleted file mode 100644 index ca841ad99e..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/internal/field/fe.go +++ /dev/null @@ -1,416 +0,0 @@ -// Copyright (c) 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 field implements fast arithmetic modulo 2^255-19. -package field - -import ( - "crypto/subtle" - "encoding/binary" - "math/bits" -) - -// Element represents an element of the field GF(2^255-19). Note that this -// is not a cryptographically secure group, and should only be used to interact -// with edwards25519.Point coordinates. -// -// This type works similarly to math/big.Int, and all arguments and receivers -// are allowed to alias. -// -// The zero value is a valid zero element. -type Element struct { - // An element t represents the integer - // t.l0 + t.l1*2^51 + t.l2*2^102 + t.l3*2^153 + t.l4*2^204 - // - // Between operations, all limbs are expected to be lower than 2^52. - l0 uint64 - l1 uint64 - l2 uint64 - l3 uint64 - l4 uint64 -} - -const maskLow51Bits uint64 = (1 << 51) - 1 - -var feZero = &Element{0, 0, 0, 0, 0} - -// Zero sets v = 0, and returns v. -func (v *Element) Zero() *Element { - *v = *feZero - return v -} - -var feOne = &Element{1, 0, 0, 0, 0} - -// One sets v = 1, and returns v. -func (v *Element) One() *Element { - *v = *feOne - return v -} - -// reduce reduces v modulo 2^255 - 19 and returns it. -func (v *Element) reduce() *Element { - v.carryPropagate() - - // After the light reduction we now have a field element representation - // v < 2^255 + 2^13 * 19, but need v < 2^255 - 19. - - // If v >= 2^255 - 19, then v + 19 >= 2^255, which would overflow 2^255 - 1, - // generating a carry. That is, c will be 0 if v < 2^255 - 19, and 1 otherwise. - c := (v.l0 + 19) >> 51 - c = (v.l1 + c) >> 51 - c = (v.l2 + c) >> 51 - c = (v.l3 + c) >> 51 - c = (v.l4 + c) >> 51 - - // If v < 2^255 - 19 and c = 0, this will be a no-op. Otherwise, it's - // effectively applying the reduction identity to the carry. - v.l0 += 19 * c - - v.l1 += v.l0 >> 51 - v.l0 = v.l0 & maskLow51Bits - v.l2 += v.l1 >> 51 - v.l1 = v.l1 & maskLow51Bits - v.l3 += v.l2 >> 51 - v.l2 = v.l2 & maskLow51Bits - v.l4 += v.l3 >> 51 - v.l3 = v.l3 & maskLow51Bits - // no additional carry - v.l4 = v.l4 & maskLow51Bits - - return v -} - -// Add sets v = a + b, and returns v. -func (v *Element) Add(a, b *Element) *Element { - v.l0 = a.l0 + b.l0 - v.l1 = a.l1 + b.l1 - v.l2 = a.l2 + b.l2 - v.l3 = a.l3 + b.l3 - v.l4 = a.l4 + b.l4 - // Using the generic implementation here is actually faster than the - // assembly. Probably because the body of this function is so simple that - // the compiler can figure out better optimizations by inlining the carry - // propagation. TODO - return v.carryPropagateGeneric() -} - -// Subtract sets v = a - b, and returns v. -func (v *Element) Subtract(a, b *Element) *Element { - // We first add 2 * p, to guarantee the subtraction won't underflow, and - // then subtract b (which can be up to 2^255 + 2^13 * 19). - v.l0 = (a.l0 + 0xFFFFFFFFFFFDA) - b.l0 - v.l1 = (a.l1 + 0xFFFFFFFFFFFFE) - b.l1 - v.l2 = (a.l2 + 0xFFFFFFFFFFFFE) - b.l2 - v.l3 = (a.l3 + 0xFFFFFFFFFFFFE) - b.l3 - v.l4 = (a.l4 + 0xFFFFFFFFFFFFE) - b.l4 - return v.carryPropagate() -} - -// Negate sets v = -a, and returns v. -func (v *Element) Negate(a *Element) *Element { - return v.Subtract(feZero, a) -} - -// Invert sets v = 1/z mod p, and returns v. -// -// If z == 0, Invert returns v = 0. -func (v *Element) Invert(z *Element) *Element { - // Inversion is implemented as exponentiation with exponent p − 2. It uses the - // same sequence of 255 squarings and 11 multiplications as [Curve25519]. - var z2, z9, z11, z2_5_0, z2_10_0, z2_20_0, z2_50_0, z2_100_0, t Element - - z2.Square(z) // 2 - t.Square(&z2) // 4 - t.Square(&t) // 8 - z9.Multiply(&t, z) // 9 - z11.Multiply(&z9, &z2) // 11 - t.Square(&z11) // 22 - z2_5_0.Multiply(&t, &z9) // 31 = 2^5 - 2^0 - - t.Square(&z2_5_0) // 2^6 - 2^1 - for i := 0; i < 4; i++ { - t.Square(&t) // 2^10 - 2^5 - } - z2_10_0.Multiply(&t, &z2_5_0) // 2^10 - 2^0 - - t.Square(&z2_10_0) // 2^11 - 2^1 - for i := 0; i < 9; i++ { - t.Square(&t) // 2^20 - 2^10 - } - z2_20_0.Multiply(&t, &z2_10_0) // 2^20 - 2^0 - - t.Square(&z2_20_0) // 2^21 - 2^1 - for i := 0; i < 19; i++ { - t.Square(&t) // 2^40 - 2^20 - } - t.Multiply(&t, &z2_20_0) // 2^40 - 2^0 - - t.Square(&t) // 2^41 - 2^1 - for i := 0; i < 9; i++ { - t.Square(&t) // 2^50 - 2^10 - } - z2_50_0.Multiply(&t, &z2_10_0) // 2^50 - 2^0 - - t.Square(&z2_50_0) // 2^51 - 2^1 - for i := 0; i < 49; i++ { - t.Square(&t) // 2^100 - 2^50 - } - z2_100_0.Multiply(&t, &z2_50_0) // 2^100 - 2^0 - - t.Square(&z2_100_0) // 2^101 - 2^1 - for i := 0; i < 99; i++ { - t.Square(&t) // 2^200 - 2^100 - } - t.Multiply(&t, &z2_100_0) // 2^200 - 2^0 - - t.Square(&t) // 2^201 - 2^1 - for i := 0; i < 49; i++ { - t.Square(&t) // 2^250 - 2^50 - } - t.Multiply(&t, &z2_50_0) // 2^250 - 2^0 - - t.Square(&t) // 2^251 - 2^1 - t.Square(&t) // 2^252 - 2^2 - t.Square(&t) // 2^253 - 2^3 - t.Square(&t) // 2^254 - 2^4 - t.Square(&t) // 2^255 - 2^5 - - return v.Multiply(&t, &z11) // 2^255 - 21 -} - -// Set sets v = a, and returns v. -func (v *Element) Set(a *Element) *Element { - *v = *a - return v -} - -// SetBytes sets v to x, which must be a 32-byte little-endian encoding. -// -// Consistent with RFC 7748, the most significant bit (the high bit of the -// last byte) is ignored, and non-canonical values (2^255-19 through 2^255-1) -// are accepted. Note that this is laxer than specified by RFC 8032. -func (v *Element) SetBytes(x []byte) *Element { - if len(x) != 32 { - panic("edwards25519: invalid field element input size") - } - - // Bits 0:51 (bytes 0:8, bits 0:64, shift 0, mask 51). - v.l0 = binary.LittleEndian.Uint64(x[0:8]) - v.l0 &= maskLow51Bits - // Bits 51:102 (bytes 6:14, bits 48:112, shift 3, mask 51). - v.l1 = binary.LittleEndian.Uint64(x[6:14]) >> 3 - v.l1 &= maskLow51Bits - // Bits 102:153 (bytes 12:20, bits 96:160, shift 6, mask 51). - v.l2 = binary.LittleEndian.Uint64(x[12:20]) >> 6 - v.l2 &= maskLow51Bits - // Bits 153:204 (bytes 19:27, bits 152:216, shift 1, mask 51). - v.l3 = binary.LittleEndian.Uint64(x[19:27]) >> 1 - v.l3 &= maskLow51Bits - // Bits 204:251 (bytes 24:32, bits 192:256, shift 12, mask 51). - // Note: not bytes 25:33, shift 4, to avoid overread. - v.l4 = binary.LittleEndian.Uint64(x[24:32]) >> 12 - v.l4 &= maskLow51Bits - - return v -} - -// Bytes returns the canonical 32-byte little-endian encoding of v. -func (v *Element) Bytes() []byte { - // This function is outlined to make the allocations inline in the caller - // rather than happen on the heap. - var out [32]byte - return v.bytes(&out) -} - -func (v *Element) bytes(out *[32]byte) []byte { - t := *v - t.reduce() - - var buf [8]byte - for i, l := range [5]uint64{t.l0, t.l1, t.l2, t.l3, t.l4} { - bitsOffset := i * 51 - binary.LittleEndian.PutUint64(buf[:], l<= len(out) { - break - } - out[off] |= bb - } - } - - return out[:] -} - -// Equal returns 1 if v and u are equal, and 0 otherwise. -func (v *Element) Equal(u *Element) int { - sa, sv := u.Bytes(), v.Bytes() - return subtle.ConstantTimeCompare(sa, sv) -} - -// mask64Bits returns 0xffffffff if cond is 1, and 0 otherwise. -func mask64Bits(cond int) uint64 { return ^(uint64(cond) - 1) } - -// Select sets v to a if cond == 1, and to b if cond == 0. -func (v *Element) Select(a, b *Element, cond int) *Element { - m := mask64Bits(cond) - v.l0 = (m & a.l0) | (^m & b.l0) - v.l1 = (m & a.l1) | (^m & b.l1) - v.l2 = (m & a.l2) | (^m & b.l2) - v.l3 = (m & a.l3) | (^m & b.l3) - v.l4 = (m & a.l4) | (^m & b.l4) - return v -} - -// Swap swaps v and u if cond == 1 or leaves them unchanged if cond == 0, and returns v. -func (v *Element) Swap(u *Element, cond int) { - m := mask64Bits(cond) - t := m & (v.l0 ^ u.l0) - v.l0 ^= t - u.l0 ^= t - t = m & (v.l1 ^ u.l1) - v.l1 ^= t - u.l1 ^= t - t = m & (v.l2 ^ u.l2) - v.l2 ^= t - u.l2 ^= t - t = m & (v.l3 ^ u.l3) - v.l3 ^= t - u.l3 ^= t - t = m & (v.l4 ^ u.l4) - v.l4 ^= t - u.l4 ^= t -} - -// IsNegative returns 1 if v is negative, and 0 otherwise. -func (v *Element) IsNegative() int { - return int(v.Bytes()[0] & 1) -} - -// Absolute sets v to |u|, and returns v. -func (v *Element) Absolute(u *Element) *Element { - return v.Select(new(Element).Negate(u), u, u.IsNegative()) -} - -// Multiply sets v = x * y, and returns v. -func (v *Element) Multiply(x, y *Element) *Element { - feMul(v, x, y) - return v -} - -// Square sets v = x * x, and returns v. -func (v *Element) Square(x *Element) *Element { - feSquare(v, x) - return v -} - -// Mult32 sets v = x * y, and returns v. -func (v *Element) Mult32(x *Element, y uint32) *Element { - x0lo, x0hi := mul51(x.l0, y) - x1lo, x1hi := mul51(x.l1, y) - x2lo, x2hi := mul51(x.l2, y) - x3lo, x3hi := mul51(x.l3, y) - x4lo, x4hi := mul51(x.l4, y) - v.l0 = x0lo + 19*x4hi // carried over per the reduction identity - v.l1 = x1lo + x0hi - v.l2 = x2lo + x1hi - v.l3 = x3lo + x2hi - v.l4 = x4lo + x3hi - // The hi portions are going to be only 32 bits, plus any previous excess, - // so we can skip the carry propagation. - return v -} - -// mul51 returns lo + hi * 2⁵¹ = a * b. -func mul51(a uint64, b uint32) (lo uint64, hi uint64) { - mh, ml := bits.Mul64(a, uint64(b)) - lo = ml & maskLow51Bits - hi = (mh << 13) | (ml >> 51) - return -} - -// Pow22523 set v = x^((p-5)/8), and returns v. (p-5)/8 is 2^252-3. -func (v *Element) Pow22523(x *Element) *Element { - var t0, t1, t2 Element - - t0.Square(x) // x^2 - t1.Square(&t0) // x^4 - t1.Square(&t1) // x^8 - t1.Multiply(x, &t1) // x^9 - t0.Multiply(&t0, &t1) // x^11 - t0.Square(&t0) // x^22 - t0.Multiply(&t1, &t0) // x^31 - t1.Square(&t0) // x^62 - for i := 1; i < 5; i++ { // x^992 - t1.Square(&t1) - } - t0.Multiply(&t1, &t0) // x^1023 -> 1023 = 2^10 - 1 - t1.Square(&t0) // 2^11 - 2 - for i := 1; i < 10; i++ { // 2^20 - 2^10 - t1.Square(&t1) - } - t1.Multiply(&t1, &t0) // 2^20 - 1 - t2.Square(&t1) // 2^21 - 2 - for i := 1; i < 20; i++ { // 2^40 - 2^20 - t2.Square(&t2) - } - t1.Multiply(&t2, &t1) // 2^40 - 1 - t1.Square(&t1) // 2^41 - 2 - for i := 1; i < 10; i++ { // 2^50 - 2^10 - t1.Square(&t1) - } - t0.Multiply(&t1, &t0) // 2^50 - 1 - t1.Square(&t0) // 2^51 - 2 - for i := 1; i < 50; i++ { // 2^100 - 2^50 - t1.Square(&t1) - } - t1.Multiply(&t1, &t0) // 2^100 - 1 - t2.Square(&t1) // 2^101 - 2 - for i := 1; i < 100; i++ { // 2^200 - 2^100 - t2.Square(&t2) - } - t1.Multiply(&t2, &t1) // 2^200 - 1 - t1.Square(&t1) // 2^201 - 2 - for i := 1; i < 50; i++ { // 2^250 - 2^50 - t1.Square(&t1) - } - t0.Multiply(&t1, &t0) // 2^250 - 1 - t0.Square(&t0) // 2^251 - 2 - t0.Square(&t0) // 2^252 - 4 - return v.Multiply(&t0, x) // 2^252 - 3 -> x^(2^252-3) -} - -// sqrtM1 is 2^((p-1)/4), which squared is equal to -1 by Euler's Criterion. -var sqrtM1 = &Element{1718705420411056, 234908883556509, - 2233514472574048, 2117202627021982, 765476049583133} - -// SqrtRatio sets r to the non-negative square root of the ratio of u and v. -// -// If u/v is square, SqrtRatio returns r and 1. If u/v is not square, SqrtRatio -// sets r according to Section 4.3 of draft-irtf-cfrg-ristretto255-decaf448-00, -// and returns r and 0. -func (r *Element) SqrtRatio(u, v *Element) (rr *Element, wasSquare int) { - var a, b Element - - // r = (u * v3) * (u * v7)^((p-5)/8) - v2 := a.Square(v) - uv3 := b.Multiply(u, b.Multiply(v2, v)) - uv7 := a.Multiply(uv3, a.Square(v2)) - r.Multiply(uv3, r.Pow22523(uv7)) - - check := a.Multiply(v, a.Square(r)) // check = v * r^2 - - uNeg := b.Negate(u) - correctSignSqrt := check.Equal(u) - flippedSignSqrt := check.Equal(uNeg) - flippedSignSqrtI := check.Equal(uNeg.Multiply(uNeg, sqrtM1)) - - rPrime := b.Multiply(r, sqrtM1) // r_prime = SQRT_M1 * r - // r = CT_SELECT(r_prime IF flipped_sign_sqrt | flipped_sign_sqrt_i ELSE r) - r.Select(rPrime, r, flippedSignSqrt|flippedSignSqrtI) - - r.Absolute(r) // Choose the nonnegative square root. - return r, correctSignSqrt | flippedSignSqrt -} diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.go b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.go deleted file mode 100644 index 70c541692c..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT. - -//go:build amd64 && gc && !purego - -package field - -// feMul sets out = a * b. It works like feMulGeneric. -// -//go:noescape -func feMul(out *Element, a *Element, b *Element) - -// feSquare sets out = a * a. It works like feSquareGeneric. -// -//go:noescape -func feSquare(out *Element, a *Element) diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.s b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.s deleted file mode 100644 index 60817acc41..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.s +++ /dev/null @@ -1,378 +0,0 @@ -// Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT. - -//go:build amd64 && gc && !purego - -#include "textflag.h" - -// func feMul(out *Element, a *Element, b *Element) -TEXT ·feMul(SB), NOSPLIT, $0-24 - MOVQ a+8(FP), CX - MOVQ b+16(FP), BX - - // r0 = a0×b0 - MOVQ (CX), AX - MULQ (BX) - MOVQ AX, DI - MOVQ DX, SI - - // r0 += 19×a1×b4 - MOVQ 8(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 32(BX) - ADDQ AX, DI - ADCQ DX, SI - - // r0 += 19×a2×b3 - MOVQ 16(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 24(BX) - ADDQ AX, DI - ADCQ DX, SI - - // r0 += 19×a3×b2 - MOVQ 24(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 16(BX) - ADDQ AX, DI - ADCQ DX, SI - - // r0 += 19×a4×b1 - MOVQ 32(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 8(BX) - ADDQ AX, DI - ADCQ DX, SI - - // r1 = a0×b1 - MOVQ (CX), AX - MULQ 8(BX) - MOVQ AX, R9 - MOVQ DX, R8 - - // r1 += a1×b0 - MOVQ 8(CX), AX - MULQ (BX) - ADDQ AX, R9 - ADCQ DX, R8 - - // r1 += 19×a2×b4 - MOVQ 16(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 32(BX) - ADDQ AX, R9 - ADCQ DX, R8 - - // r1 += 19×a3×b3 - MOVQ 24(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 24(BX) - ADDQ AX, R9 - ADCQ DX, R8 - - // r1 += 19×a4×b2 - MOVQ 32(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 16(BX) - ADDQ AX, R9 - ADCQ DX, R8 - - // r2 = a0×b2 - MOVQ (CX), AX - MULQ 16(BX) - MOVQ AX, R11 - MOVQ DX, R10 - - // r2 += a1×b1 - MOVQ 8(CX), AX - MULQ 8(BX) - ADDQ AX, R11 - ADCQ DX, R10 - - // r2 += a2×b0 - MOVQ 16(CX), AX - MULQ (BX) - ADDQ AX, R11 - ADCQ DX, R10 - - // r2 += 19×a3×b4 - MOVQ 24(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 32(BX) - ADDQ AX, R11 - ADCQ DX, R10 - - // r2 += 19×a4×b3 - MOVQ 32(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 24(BX) - ADDQ AX, R11 - ADCQ DX, R10 - - // r3 = a0×b3 - MOVQ (CX), AX - MULQ 24(BX) - MOVQ AX, R13 - MOVQ DX, R12 - - // r3 += a1×b2 - MOVQ 8(CX), AX - MULQ 16(BX) - ADDQ AX, R13 - ADCQ DX, R12 - - // r3 += a2×b1 - MOVQ 16(CX), AX - MULQ 8(BX) - ADDQ AX, R13 - ADCQ DX, R12 - - // r3 += a3×b0 - MOVQ 24(CX), AX - MULQ (BX) - ADDQ AX, R13 - ADCQ DX, R12 - - // r3 += 19×a4×b4 - MOVQ 32(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 32(BX) - ADDQ AX, R13 - ADCQ DX, R12 - - // r4 = a0×b4 - MOVQ (CX), AX - MULQ 32(BX) - MOVQ AX, R15 - MOVQ DX, R14 - - // r4 += a1×b3 - MOVQ 8(CX), AX - MULQ 24(BX) - ADDQ AX, R15 - ADCQ DX, R14 - - // r4 += a2×b2 - MOVQ 16(CX), AX - MULQ 16(BX) - ADDQ AX, R15 - ADCQ DX, R14 - - // r4 += a3×b1 - MOVQ 24(CX), AX - MULQ 8(BX) - ADDQ AX, R15 - ADCQ DX, R14 - - // r4 += a4×b0 - MOVQ 32(CX), AX - MULQ (BX) - ADDQ AX, R15 - ADCQ DX, R14 - - // First reduction chain - MOVQ $0x0007ffffffffffff, AX - SHLQ $0x0d, DI, SI - SHLQ $0x0d, R9, R8 - SHLQ $0x0d, R11, R10 - SHLQ $0x0d, R13, R12 - SHLQ $0x0d, R15, R14 - ANDQ AX, DI - IMUL3Q $0x13, R14, R14 - ADDQ R14, DI - ANDQ AX, R9 - ADDQ SI, R9 - ANDQ AX, R11 - ADDQ R8, R11 - ANDQ AX, R13 - ADDQ R10, R13 - ANDQ AX, R15 - ADDQ R12, R15 - - // Second reduction chain (carryPropagate) - MOVQ DI, SI - SHRQ $0x33, SI - MOVQ R9, R8 - SHRQ $0x33, R8 - MOVQ R11, R10 - SHRQ $0x33, R10 - MOVQ R13, R12 - SHRQ $0x33, R12 - MOVQ R15, R14 - SHRQ $0x33, R14 - ANDQ AX, DI - IMUL3Q $0x13, R14, R14 - ADDQ R14, DI - ANDQ AX, R9 - ADDQ SI, R9 - ANDQ AX, R11 - ADDQ R8, R11 - ANDQ AX, R13 - ADDQ R10, R13 - ANDQ AX, R15 - ADDQ R12, R15 - - // Store output - MOVQ out+0(FP), AX - MOVQ DI, (AX) - MOVQ R9, 8(AX) - MOVQ R11, 16(AX) - MOVQ R13, 24(AX) - MOVQ R15, 32(AX) - RET - -// func feSquare(out *Element, a *Element) -TEXT ·feSquare(SB), NOSPLIT, $0-16 - MOVQ a+8(FP), CX - - // r0 = l0×l0 - MOVQ (CX), AX - MULQ (CX) - MOVQ AX, SI - MOVQ DX, BX - - // r0 += 38×l1×l4 - MOVQ 8(CX), AX - IMUL3Q $0x26, AX, AX - MULQ 32(CX) - ADDQ AX, SI - ADCQ DX, BX - - // r0 += 38×l2×l3 - MOVQ 16(CX), AX - IMUL3Q $0x26, AX, AX - MULQ 24(CX) - ADDQ AX, SI - ADCQ DX, BX - - // r1 = 2×l0×l1 - MOVQ (CX), AX - SHLQ $0x01, AX - MULQ 8(CX) - MOVQ AX, R8 - MOVQ DX, DI - - // r1 += 38×l2×l4 - MOVQ 16(CX), AX - IMUL3Q $0x26, AX, AX - MULQ 32(CX) - ADDQ AX, R8 - ADCQ DX, DI - - // r1 += 19×l3×l3 - MOVQ 24(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 24(CX) - ADDQ AX, R8 - ADCQ DX, DI - - // r2 = 2×l0×l2 - MOVQ (CX), AX - SHLQ $0x01, AX - MULQ 16(CX) - MOVQ AX, R10 - MOVQ DX, R9 - - // r2 += l1×l1 - MOVQ 8(CX), AX - MULQ 8(CX) - ADDQ AX, R10 - ADCQ DX, R9 - - // r2 += 38×l3×l4 - MOVQ 24(CX), AX - IMUL3Q $0x26, AX, AX - MULQ 32(CX) - ADDQ AX, R10 - ADCQ DX, R9 - - // r3 = 2×l0×l3 - MOVQ (CX), AX - SHLQ $0x01, AX - MULQ 24(CX) - MOVQ AX, R12 - MOVQ DX, R11 - - // r3 += 2×l1×l2 - MOVQ 8(CX), AX - IMUL3Q $0x02, AX, AX - MULQ 16(CX) - ADDQ AX, R12 - ADCQ DX, R11 - - // r3 += 19×l4×l4 - MOVQ 32(CX), AX - IMUL3Q $0x13, AX, AX - MULQ 32(CX) - ADDQ AX, R12 - ADCQ DX, R11 - - // r4 = 2×l0×l4 - MOVQ (CX), AX - SHLQ $0x01, AX - MULQ 32(CX) - MOVQ AX, R14 - MOVQ DX, R13 - - // r4 += 2×l1×l3 - MOVQ 8(CX), AX - IMUL3Q $0x02, AX, AX - MULQ 24(CX) - ADDQ AX, R14 - ADCQ DX, R13 - - // r4 += l2×l2 - MOVQ 16(CX), AX - MULQ 16(CX) - ADDQ AX, R14 - ADCQ DX, R13 - - // First reduction chain - MOVQ $0x0007ffffffffffff, AX - SHLQ $0x0d, SI, BX - SHLQ $0x0d, R8, DI - SHLQ $0x0d, R10, R9 - SHLQ $0x0d, R12, R11 - SHLQ $0x0d, R14, R13 - ANDQ AX, SI - IMUL3Q $0x13, R13, R13 - ADDQ R13, SI - ANDQ AX, R8 - ADDQ BX, R8 - ANDQ AX, R10 - ADDQ DI, R10 - ANDQ AX, R12 - ADDQ R9, R12 - ANDQ AX, R14 - ADDQ R11, R14 - - // Second reduction chain (carryPropagate) - MOVQ SI, BX - SHRQ $0x33, BX - MOVQ R8, DI - SHRQ $0x33, DI - MOVQ R10, R9 - SHRQ $0x33, R9 - MOVQ R12, R11 - SHRQ $0x33, R11 - MOVQ R14, R13 - SHRQ $0x33, R13 - ANDQ AX, SI - IMUL3Q $0x13, R13, R13 - ADDQ R13, SI - ANDQ AX, R8 - ADDQ BX, R8 - ANDQ AX, R10 - ADDQ DI, R10 - ANDQ AX, R12 - ADDQ R9, R12 - ANDQ AX, R14 - ADDQ R11, R14 - - // Store output - MOVQ out+0(FP), AX - MOVQ SI, (AX) - MOVQ R8, 8(AX) - MOVQ R10, 16(AX) - MOVQ R12, 24(AX) - MOVQ R14, 32(AX) - RET diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64_noasm.go b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64_noasm.go deleted file mode 100644 index 9da280d1d8..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64_noasm.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 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. - -//go:build !amd64 || !gc || purego - -package field - -func feMul(v, x, y *Element) { feMulGeneric(v, x, y) } - -func feSquare(v, x *Element) { feSquareGeneric(v, x) } diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.go b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.go deleted file mode 100644 index 075fe9b925..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2020 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:build arm64 && gc && !purego - -package field - -//go:noescape -func carryPropagate(v *Element) - -func (v *Element) carryPropagate() *Element { - carryPropagate(v) - return v -} diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.s b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.s deleted file mode 100644 index 3126a43419..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.s +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2020 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:build arm64 && gc && !purego - -#include "textflag.h" - -// carryPropagate works exactly like carryPropagateGeneric and uses the -// same AND, ADD, and LSR+MADD instructions emitted by the compiler, but -// avoids loading R0-R4 twice and uses LDP and STP. -// -// See https://golang.org/issues/43145 for the main compiler issue. -// -// func carryPropagate(v *Element) -TEXT ·carryPropagate(SB),NOFRAME|NOSPLIT,$0-8 - MOVD v+0(FP), R20 - - LDP 0(R20), (R0, R1) - LDP 16(R20), (R2, R3) - MOVD 32(R20), R4 - - AND $0x7ffffffffffff, R0, R10 - AND $0x7ffffffffffff, R1, R11 - AND $0x7ffffffffffff, R2, R12 - AND $0x7ffffffffffff, R3, R13 - AND $0x7ffffffffffff, R4, R14 - - ADD R0>>51, R11, R11 - ADD R1>>51, R12, R12 - ADD R2>>51, R13, R13 - ADD R3>>51, R14, R14 - // R4>>51 * 19 + R10 -> R10 - LSR $51, R4, R21 - MOVD $19, R22 - MADD R22, R10, R21, R10 - - STP (R10, R11), 0(R20) - STP (R12, R13), 16(R20) - MOVD R14, 32(R20) - - RET diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64_noasm.go b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64_noasm.go deleted file mode 100644 index fc029ac12d..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64_noasm.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2021 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:build !arm64 || !gc || purego - -package field - -func (v *Element) carryPropagate() *Element { - return v.carryPropagateGeneric() -} diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_generic.go b/vendor/golang.org/x/crypto/curve25519/internal/field/fe_generic.go deleted file mode 100644 index 2671217da5..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/internal/field/fe_generic.go +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (c) 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 field - -import "math/bits" - -// uint128 holds a 128-bit number as two 64-bit limbs, for use with the -// bits.Mul64 and bits.Add64 intrinsics. -type uint128 struct { - lo, hi uint64 -} - -// mul64 returns a * b. -func mul64(a, b uint64) uint128 { - hi, lo := bits.Mul64(a, b) - return uint128{lo, hi} -} - -// addMul64 returns v + a * b. -func addMul64(v uint128, a, b uint64) uint128 { - hi, lo := bits.Mul64(a, b) - lo, c := bits.Add64(lo, v.lo, 0) - hi, _ = bits.Add64(hi, v.hi, c) - return uint128{lo, hi} -} - -// shiftRightBy51 returns a >> 51. a is assumed to be at most 115 bits. -func shiftRightBy51(a uint128) uint64 { - return (a.hi << (64 - 51)) | (a.lo >> 51) -} - -func feMulGeneric(v, a, b *Element) { - a0 := a.l0 - a1 := a.l1 - a2 := a.l2 - a3 := a.l3 - a4 := a.l4 - - b0 := b.l0 - b1 := b.l1 - b2 := b.l2 - b3 := b.l3 - b4 := b.l4 - - // Limb multiplication works like pen-and-paper columnar multiplication, but - // with 51-bit limbs instead of digits. - // - // a4 a3 a2 a1 a0 x - // b4 b3 b2 b1 b0 = - // ------------------------ - // a4b0 a3b0 a2b0 a1b0 a0b0 + - // a4b1 a3b1 a2b1 a1b1 a0b1 + - // a4b2 a3b2 a2b2 a1b2 a0b2 + - // a4b3 a3b3 a2b3 a1b3 a0b3 + - // a4b4 a3b4 a2b4 a1b4 a0b4 = - // ---------------------------------------------- - // r8 r7 r6 r5 r4 r3 r2 r1 r0 - // - // We can then use the reduction identity (a * 2²⁵⁵ + b = a * 19 + b) to - // reduce the limbs that would overflow 255 bits. r5 * 2²⁵⁵ becomes 19 * r5, - // r6 * 2³⁰⁶ becomes 19 * r6 * 2⁵¹, etc. - // - // Reduction can be carried out simultaneously to multiplication. For - // example, we do not compute r5: whenever the result of a multiplication - // belongs to r5, like a1b4, we multiply it by 19 and add the result to r0. - // - // a4b0 a3b0 a2b0 a1b0 a0b0 + - // a3b1 a2b1 a1b1 a0b1 19×a4b1 + - // a2b2 a1b2 a0b2 19×a4b2 19×a3b2 + - // a1b3 a0b3 19×a4b3 19×a3b3 19×a2b3 + - // a0b4 19×a4b4 19×a3b4 19×a2b4 19×a1b4 = - // -------------------------------------- - // r4 r3 r2 r1 r0 - // - // Finally we add up the columns into wide, overlapping limbs. - - a1_19 := a1 * 19 - a2_19 := a2 * 19 - a3_19 := a3 * 19 - a4_19 := a4 * 19 - - // r0 = a0×b0 + 19×(a1×b4 + a2×b3 + a3×b2 + a4×b1) - r0 := mul64(a0, b0) - r0 = addMul64(r0, a1_19, b4) - r0 = addMul64(r0, a2_19, b3) - r0 = addMul64(r0, a3_19, b2) - r0 = addMul64(r0, a4_19, b1) - - // r1 = a0×b1 + a1×b0 + 19×(a2×b4 + a3×b3 + a4×b2) - r1 := mul64(a0, b1) - r1 = addMul64(r1, a1, b0) - r1 = addMul64(r1, a2_19, b4) - r1 = addMul64(r1, a3_19, b3) - r1 = addMul64(r1, a4_19, b2) - - // r2 = a0×b2 + a1×b1 + a2×b0 + 19×(a3×b4 + a4×b3) - r2 := mul64(a0, b2) - r2 = addMul64(r2, a1, b1) - r2 = addMul64(r2, a2, b0) - r2 = addMul64(r2, a3_19, b4) - r2 = addMul64(r2, a4_19, b3) - - // r3 = a0×b3 + a1×b2 + a2×b1 + a3×b0 + 19×a4×b4 - r3 := mul64(a0, b3) - r3 = addMul64(r3, a1, b2) - r3 = addMul64(r3, a2, b1) - r3 = addMul64(r3, a3, b0) - r3 = addMul64(r3, a4_19, b4) - - // r4 = a0×b4 + a1×b3 + a2×b2 + a3×b1 + a4×b0 - r4 := mul64(a0, b4) - r4 = addMul64(r4, a1, b3) - r4 = addMul64(r4, a2, b2) - r4 = addMul64(r4, a3, b1) - r4 = addMul64(r4, a4, b0) - - // After the multiplication, we need to reduce (carry) the five coefficients - // to obtain a result with limbs that are at most slightly larger than 2⁵¹, - // to respect the Element invariant. - // - // Overall, the reduction works the same as carryPropagate, except with - // wider inputs: we take the carry for each coefficient by shifting it right - // by 51, and add it to the limb above it. The top carry is multiplied by 19 - // according to the reduction identity and added to the lowest limb. - // - // The largest coefficient (r0) will be at most 111 bits, which guarantees - // that all carries are at most 111 - 51 = 60 bits, which fits in a uint64. - // - // r0 = a0×b0 + 19×(a1×b4 + a2×b3 + a3×b2 + a4×b1) - // r0 < 2⁵²×2⁵² + 19×(2⁵²×2⁵² + 2⁵²×2⁵² + 2⁵²×2⁵² + 2⁵²×2⁵²) - // r0 < (1 + 19 × 4) × 2⁵² × 2⁵² - // r0 < 2⁷ × 2⁵² × 2⁵² - // r0 < 2¹¹¹ - // - // Moreover, the top coefficient (r4) is at most 107 bits, so c4 is at most - // 56 bits, and c4 * 19 is at most 61 bits, which again fits in a uint64 and - // allows us to easily apply the reduction identity. - // - // r4 = a0×b4 + a1×b3 + a2×b2 + a3×b1 + a4×b0 - // r4 < 5 × 2⁵² × 2⁵² - // r4 < 2¹⁰⁷ - // - - c0 := shiftRightBy51(r0) - c1 := shiftRightBy51(r1) - c2 := shiftRightBy51(r2) - c3 := shiftRightBy51(r3) - c4 := shiftRightBy51(r4) - - rr0 := r0.lo&maskLow51Bits + c4*19 - rr1 := r1.lo&maskLow51Bits + c0 - rr2 := r2.lo&maskLow51Bits + c1 - rr3 := r3.lo&maskLow51Bits + c2 - rr4 := r4.lo&maskLow51Bits + c3 - - // Now all coefficients fit into 64-bit registers but are still too large to - // be passed around as a Element. We therefore do one last carry chain, - // where the carries will be small enough to fit in the wiggle room above 2⁵¹. - *v = Element{rr0, rr1, rr2, rr3, rr4} - v.carryPropagate() -} - -func feSquareGeneric(v, a *Element) { - l0 := a.l0 - l1 := a.l1 - l2 := a.l2 - l3 := a.l3 - l4 := a.l4 - - // Squaring works precisely like multiplication above, but thanks to its - // symmetry we get to group a few terms together. - // - // l4 l3 l2 l1 l0 x - // l4 l3 l2 l1 l0 = - // ------------------------ - // l4l0 l3l0 l2l0 l1l0 l0l0 + - // l4l1 l3l1 l2l1 l1l1 l0l1 + - // l4l2 l3l2 l2l2 l1l2 l0l2 + - // l4l3 l3l3 l2l3 l1l3 l0l3 + - // l4l4 l3l4 l2l4 l1l4 l0l4 = - // ---------------------------------------------- - // r8 r7 r6 r5 r4 r3 r2 r1 r0 - // - // l4l0 l3l0 l2l0 l1l0 l0l0 + - // l3l1 l2l1 l1l1 l0l1 19×l4l1 + - // l2l2 l1l2 l0l2 19×l4l2 19×l3l2 + - // l1l3 l0l3 19×l4l3 19×l3l3 19×l2l3 + - // l0l4 19×l4l4 19×l3l4 19×l2l4 19×l1l4 = - // -------------------------------------- - // r4 r3 r2 r1 r0 - // - // With precomputed 2×, 19×, and 2×19× terms, we can compute each limb with - // only three Mul64 and four Add64, instead of five and eight. - - l0_2 := l0 * 2 - l1_2 := l1 * 2 - - l1_38 := l1 * 38 - l2_38 := l2 * 38 - l3_38 := l3 * 38 - - l3_19 := l3 * 19 - l4_19 := l4 * 19 - - // r0 = l0×l0 + 19×(l1×l4 + l2×l3 + l3×l2 + l4×l1) = l0×l0 + 19×2×(l1×l4 + l2×l3) - r0 := mul64(l0, l0) - r0 = addMul64(r0, l1_38, l4) - r0 = addMul64(r0, l2_38, l3) - - // r1 = l0×l1 + l1×l0 + 19×(l2×l4 + l3×l3 + l4×l2) = 2×l0×l1 + 19×2×l2×l4 + 19×l3×l3 - r1 := mul64(l0_2, l1) - r1 = addMul64(r1, l2_38, l4) - r1 = addMul64(r1, l3_19, l3) - - // r2 = l0×l2 + l1×l1 + l2×l0 + 19×(l3×l4 + l4×l3) = 2×l0×l2 + l1×l1 + 19×2×l3×l4 - r2 := mul64(l0_2, l2) - r2 = addMul64(r2, l1, l1) - r2 = addMul64(r2, l3_38, l4) - - // r3 = l0×l3 + l1×l2 + l2×l1 + l3×l0 + 19×l4×l4 = 2×l0×l3 + 2×l1×l2 + 19×l4×l4 - r3 := mul64(l0_2, l3) - r3 = addMul64(r3, l1_2, l2) - r3 = addMul64(r3, l4_19, l4) - - // r4 = l0×l4 + l1×l3 + l2×l2 + l3×l1 + l4×l0 = 2×l0×l4 + 2×l1×l3 + l2×l2 - r4 := mul64(l0_2, l4) - r4 = addMul64(r4, l1_2, l3) - r4 = addMul64(r4, l2, l2) - - c0 := shiftRightBy51(r0) - c1 := shiftRightBy51(r1) - c2 := shiftRightBy51(r2) - c3 := shiftRightBy51(r3) - c4 := shiftRightBy51(r4) - - rr0 := r0.lo&maskLow51Bits + c4*19 - rr1 := r1.lo&maskLow51Bits + c0 - rr2 := r2.lo&maskLow51Bits + c1 - rr3 := r3.lo&maskLow51Bits + c2 - rr4 := r4.lo&maskLow51Bits + c3 - - *v = Element{rr0, rr1, rr2, rr3, rr4} - v.carryPropagate() -} - -// carryPropagateGeneric brings the limbs below 52 bits by applying the reduction -// identity (a * 2²⁵⁵ + b = a * 19 + b) to the l4 carry. TODO inline -func (v *Element) carryPropagateGeneric() *Element { - c0 := v.l0 >> 51 - c1 := v.l1 >> 51 - c2 := v.l2 >> 51 - c3 := v.l3 >> 51 - c4 := v.l4 >> 51 - - v.l0 = v.l0&maskLow51Bits + c4*19 - v.l1 = v.l1&maskLow51Bits + c0 - v.l2 = v.l2&maskLow51Bits + c1 - v.l3 = v.l3&maskLow51Bits + c2 - v.l4 = v.l4&maskLow51Bits + c3 - - return v -} diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/sync.checkpoint b/vendor/golang.org/x/crypto/curve25519/internal/field/sync.checkpoint deleted file mode 100644 index e3685f95ca..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/internal/field/sync.checkpoint +++ /dev/null @@ -1 +0,0 @@ -b0c49ae9f59d233526f8934262c5bbbe14d4358d diff --git a/vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh b/vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh deleted file mode 100644 index 1ba22a8b4c..0000000000 --- a/vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh +++ /dev/null @@ -1,19 +0,0 @@ -#! /bin/bash -set -euo pipefail - -cd "$(git rev-parse --show-toplevel)" - -STD_PATH=src/crypto/ed25519/internal/edwards25519/field -LOCAL_PATH=curve25519/internal/field -LAST_SYNC_REF=$(cat $LOCAL_PATH/sync.checkpoint) - -git fetch https://go.googlesource.com/go master - -if git diff --quiet $LAST_SYNC_REF:$STD_PATH FETCH_HEAD:$STD_PATH; then - echo "No changes." -else - NEW_REF=$(git rev-parse FETCH_HEAD | tee $LOCAL_PATH/sync.checkpoint) - echo "Applying changes from $LAST_SYNC_REF to $NEW_REF..." - git diff $LAST_SYNC_REF:$STD_PATH FETCH_HEAD:$STD_PATH | \ - git apply -3 --directory=$LOCAL_PATH -fi diff --git a/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go b/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go index f3c3242a04..1fe600ad03 100644 --- a/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go +++ b/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go @@ -32,7 +32,7 @@ chunk size. This package is interoperable with NaCl: https://nacl.cr.yp.to/secretbox.html. */ -package secretbox // import "golang.org/x/crypto/nacl/secretbox" +package secretbox import ( "golang.org/x/crypto/internal/alias" diff --git a/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go b/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go index 904b57e01d..28cd99c7f3 100644 --- a/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go +++ b/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go @@ -16,7 +16,7 @@ Hash Functions SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512 for HMAC. To choose, you can pass the `New` functions from the different SHA packages to pbkdf2.Key. */ -package pbkdf2 // import "golang.org/x/crypto/pbkdf2" +package pbkdf2 import ( "crypto/hmac" diff --git a/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go b/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go index 3fd05b2751..3685b34458 100644 --- a/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go +++ b/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. // Package salsa provides low-level access to functions in the Salsa family. -package salsa // import "golang.org/x/crypto/salsa20/salsa" +package salsa import "math/bits" diff --git a/vendor/golang.org/x/crypto/scrypt/scrypt.go b/vendor/golang.org/x/crypto/scrypt/scrypt.go index c971a99fa6..76fa40fb20 100644 --- a/vendor/golang.org/x/crypto/scrypt/scrypt.go +++ b/vendor/golang.org/x/crypto/scrypt/scrypt.go @@ -5,7 +5,7 @@ // Package scrypt implements the scrypt key derivation function as defined in // Colin Percival's paper "Stronger Key Derivation via Sequential Memory-Hard // Functions" (https://www.tarsnap.com/scrypt/scrypt.pdf). -package scrypt // import "golang.org/x/crypto/scrypt" +package scrypt import ( "crypto/sha256" diff --git a/vendor/golang.org/x/crypto/ssh/client_auth.go b/vendor/golang.org/x/crypto/ssh/client_auth.go index 34bf089d0b..b93961010d 100644 --- a/vendor/golang.org/x/crypto/ssh/client_auth.go +++ b/vendor/golang.org/x/crypto/ssh/client_auth.go @@ -71,6 +71,10 @@ func (c *connection) clientAuthenticate(config *ClientConfig) error { for auth := AuthMethod(new(noneAuth)); auth != nil; { ok, methods, err := auth.auth(sessionID, config.User, c.transport, config.Rand, extensions) if err != nil { + // On disconnect, return error immediately + if _, ok := err.(*disconnectMsg); ok { + return err + } // We return the error later if there is no other method left to // try. ok = authFailure @@ -404,10 +408,10 @@ func validateKey(key PublicKey, algo string, user string, c packetConn) (bool, e return false, err } - return confirmKeyAck(key, algo, c) + return confirmKeyAck(key, c) } -func confirmKeyAck(key PublicKey, algo string, c packetConn) (bool, error) { +func confirmKeyAck(key PublicKey, c packetConn) (bool, error) { pubKey := key.Marshal() for { @@ -425,7 +429,15 @@ func confirmKeyAck(key PublicKey, algo string, c packetConn) (bool, error) { if err := Unmarshal(packet, &msg); err != nil { return false, err } - if msg.Algo != algo || !bytes.Equal(msg.PubKey, pubKey) { + // According to RFC 4252 Section 7 the algorithm in + // SSH_MSG_USERAUTH_PK_OK should match that of the request but some + // servers send the key type instead. OpenSSH allows any algorithm + // that matches the public key, so we do the same. + // https://github.com/openssh/openssh-portable/blob/86bdd385/sshconnect2.c#L709 + if !contains(algorithmsForKeyFormat(key.Type()), msg.Algo) { + return false, nil + } + if !bytes.Equal(msg.PubKey, pubKey) { return false, nil } return true, nil diff --git a/vendor/golang.org/x/crypto/ssh/doc.go b/vendor/golang.org/x/crypto/ssh/doc.go index edbe63340d..f5d352fe3a 100644 --- a/vendor/golang.org/x/crypto/ssh/doc.go +++ b/vendor/golang.org/x/crypto/ssh/doc.go @@ -20,4 +20,4 @@ References: This package does not fall under the stability promise of the Go language itself, so its API may be changed when pressing needs arise. */ -package ssh // import "golang.org/x/crypto/ssh" +package ssh diff --git a/vendor/golang.org/x/crypto/ssh/keys.go b/vendor/golang.org/x/crypto/ssh/keys.go index df4ebdada5..98e6706d5d 100644 --- a/vendor/golang.org/x/crypto/ssh/keys.go +++ b/vendor/golang.org/x/crypto/ssh/keys.go @@ -488,7 +488,49 @@ func (r *rsaPublicKey) Verify(data []byte, sig *Signature) error { h := hash.New() h.Write(data) digest := h.Sum(nil) - return rsa.VerifyPKCS1v15((*rsa.PublicKey)(r), hash, digest, sig.Blob) + + // Signatures in PKCS1v15 must match the key's modulus in + // length. However with SSH, some signers provide RSA + // signatures which are missing the MSB 0's of the bignum + // represented. With ssh-rsa signatures, this is encouraged by + // the spec (even though e.g. OpenSSH will give the full + // length unconditionally). With rsa-sha2-* signatures, the + // verifier is allowed to support these, even though they are + // out of spec. See RFC 4253 Section 6.6 for ssh-rsa and RFC + // 8332 Section 3 for rsa-sha2-* details. + // + // In practice: + // * OpenSSH always allows "short" signatures: + // https://github.com/openssh/openssh-portable/blob/V_9_8_P1/ssh-rsa.c#L526 + // but always generates padded signatures: + // https://github.com/openssh/openssh-portable/blob/V_9_8_P1/ssh-rsa.c#L439 + // + // * PuTTY versions 0.81 and earlier will generate short + // signatures for all RSA signature variants. Note that + // PuTTY is embedded in other software, such as WinSCP and + // FileZilla. At the time of writing, a patch has been + // applied to PuTTY to generate padded signatures for + // rsa-sha2-*, but not yet released: + // https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=a5bcf3d384e1bf15a51a6923c3724cbbee022d8e + // + // * SSH.NET versions 2024.0.0 and earlier will generate short + // signatures for all RSA signature variants, fixed in 2024.1.0: + // https://github.com/sshnet/SSH.NET/releases/tag/2024.1.0 + // + // As a result, we pad these up to the key size by inserting + // leading 0's. + // + // Note that support for short signatures with rsa-sha2-* may + // be removed in the future due to such signatures not being + // allowed by the spec. + blob := sig.Blob + keySize := (*rsa.PublicKey)(r).Size() + if len(blob) < keySize { + padded := make([]byte, keySize) + copy(padded[keySize-len(blob):], blob) + blob = padded + } + return rsa.VerifyPKCS1v15((*rsa.PublicKey)(r), hash, digest, blob) } func (r *rsaPublicKey) CryptoPublicKey() crypto.PublicKey { @@ -904,6 +946,10 @@ func (k *skECDSAPublicKey) Verify(data []byte, sig *Signature) error { return errors.New("ssh: signature did not verify") } +func (k *skECDSAPublicKey) CryptoPublicKey() crypto.PublicKey { + return &k.PublicKey +} + type skEd25519PublicKey struct { // application is a URL-like string, typically "ssh:" for SSH. // see openssh/PROTOCOL.u2f for details. @@ -1000,6 +1046,10 @@ func (k *skEd25519PublicKey) Verify(data []byte, sig *Signature) error { return nil } +func (k *skEd25519PublicKey) CryptoPublicKey() crypto.PublicKey { + return k.PublicKey +} + // NewSignerFromKey takes an *rsa.PrivateKey, *dsa.PrivateKey, // *ecdsa.PrivateKey or any other crypto.Signer and returns a // corresponding Signer instance. ECDSA keys must use P-256, P-384 or diff --git a/vendor/golang.org/x/crypto/ssh/server.go b/vendor/golang.org/x/crypto/ssh/server.go index c2dfe3268c..3ca9e89e22 100644 --- a/vendor/golang.org/x/crypto/ssh/server.go +++ b/vendor/golang.org/x/crypto/ssh/server.go @@ -426,6 +426,35 @@ func (l ServerAuthError) Error() string { return "[" + strings.Join(errs, ", ") + "]" } +// ServerAuthCallbacks defines server-side authentication callbacks. +type ServerAuthCallbacks struct { + // PasswordCallback behaves like [ServerConfig.PasswordCallback]. + PasswordCallback func(conn ConnMetadata, password []byte) (*Permissions, error) + + // PublicKeyCallback behaves like [ServerConfig.PublicKeyCallback]. + PublicKeyCallback func(conn ConnMetadata, key PublicKey) (*Permissions, error) + + // KeyboardInteractiveCallback behaves like [ServerConfig.KeyboardInteractiveCallback]. + KeyboardInteractiveCallback func(conn ConnMetadata, client KeyboardInteractiveChallenge) (*Permissions, error) + + // GSSAPIWithMICConfig behaves like [ServerConfig.GSSAPIWithMICConfig]. + GSSAPIWithMICConfig *GSSAPIWithMICConfig +} + +// PartialSuccessError can be returned by any of the [ServerConfig] +// authentication callbacks to indicate to the client that authentication has +// partially succeeded, but further steps are required. +type PartialSuccessError struct { + // Next defines the authentication callbacks to apply to further steps. The + // available methods communicated to the client are based on the non-nil + // ServerAuthCallbacks fields. + Next ServerAuthCallbacks +} + +func (p *PartialSuccessError) Error() string { + return "ssh: authenticated with partial success" +} + // ErrNoAuth is the error value returned if no // authentication method has been passed yet. This happens as a normal // part of the authentication loop, since the client first tries @@ -433,14 +462,42 @@ func (l ServerAuthError) Error() string { // It is returned in ServerAuthError.Errors from NewServerConn. var ErrNoAuth = errors.New("ssh: no auth passed yet") +// BannerError is an error that can be returned by authentication handlers in +// ServerConfig to send a banner message to the client. +type BannerError struct { + Err error + Message string +} + +func (b *BannerError) Unwrap() error { + return b.Err +} + +func (b *BannerError) Error() string { + if b.Err == nil { + return b.Message + } + return b.Err.Error() +} + func (s *connection) serverAuthenticate(config *ServerConfig) (*Permissions, error) { sessionID := s.transport.getSessionID() var cache pubKeyCache var perms *Permissions authFailures := 0 + noneAuthCount := 0 var authErrs []error var displayedBanner bool + partialSuccessReturned := false + // Set the initial authentication callbacks from the config. They can be + // changed if a PartialSuccessError is returned. + authConfig := ServerAuthCallbacks{ + PasswordCallback: config.PasswordCallback, + PublicKeyCallback: config.PublicKeyCallback, + KeyboardInteractiveCallback: config.KeyboardInteractiveCallback, + GSSAPIWithMICConfig: config.GSSAPIWithMICConfig, + } userAuthLoop: for { @@ -471,6 +528,11 @@ userAuthLoop: return nil, errors.New("ssh: client attempted to negotiate for unknown service: " + userAuthReq.Service) } + if s.user != userAuthReq.User && partialSuccessReturned { + return nil, fmt.Errorf("ssh: client changed the user after a partial success authentication, previous user %q, current user %q", + s.user, userAuthReq.User) + } + s.user = userAuthReq.User if !displayedBanner && config.BannerCallback != nil { @@ -491,20 +553,18 @@ userAuthLoop: switch userAuthReq.Method { case "none": - if config.NoClientAuth { + noneAuthCount++ + // We don't allow none authentication after a partial success + // response. + if config.NoClientAuth && !partialSuccessReturned { if config.NoClientAuthCallback != nil { perms, authErr = config.NoClientAuthCallback(s) } else { authErr = nil } } - - // allow initial attempt of 'none' without penalty - if authFailures == 0 { - authFailures-- - } case "password": - if config.PasswordCallback == nil { + if authConfig.PasswordCallback == nil { authErr = errors.New("ssh: password auth not configured") break } @@ -518,17 +578,17 @@ userAuthLoop: return nil, parseError(msgUserAuthRequest) } - perms, authErr = config.PasswordCallback(s, password) + perms, authErr = authConfig.PasswordCallback(s, password) case "keyboard-interactive": - if config.KeyboardInteractiveCallback == nil { + if authConfig.KeyboardInteractiveCallback == nil { authErr = errors.New("ssh: keyboard-interactive auth not configured") break } prompter := &sshClientKeyboardInteractive{s} - perms, authErr = config.KeyboardInteractiveCallback(s, prompter.Challenge) + perms, authErr = authConfig.KeyboardInteractiveCallback(s, prompter.Challenge) case "publickey": - if config.PublicKeyCallback == nil { + if authConfig.PublicKeyCallback == nil { authErr = errors.New("ssh: publickey auth not configured") break } @@ -562,11 +622,18 @@ userAuthLoop: if !ok { candidate.user = s.user candidate.pubKeyData = pubKeyData - candidate.perms, candidate.result = config.PublicKeyCallback(s, pubKey) - if candidate.result == nil && candidate.perms != nil && candidate.perms.CriticalOptions != nil && candidate.perms.CriticalOptions[sourceAddressCriticalOption] != "" { - candidate.result = checkSourceAddress( + candidate.perms, candidate.result = authConfig.PublicKeyCallback(s, pubKey) + _, isPartialSuccessError := candidate.result.(*PartialSuccessError) + + if (candidate.result == nil || isPartialSuccessError) && + candidate.perms != nil && + candidate.perms.CriticalOptions != nil && + candidate.perms.CriticalOptions[sourceAddressCriticalOption] != "" { + if err := checkSourceAddress( s.RemoteAddr(), - candidate.perms.CriticalOptions[sourceAddressCriticalOption]) + candidate.perms.CriticalOptions[sourceAddressCriticalOption]); err != nil { + candidate.result = err + } } cache.add(candidate) } @@ -578,8 +645,8 @@ userAuthLoop: if len(payload) > 0 { return nil, parseError(msgUserAuthRequest) } - - if candidate.result == nil { + _, isPartialSuccessError := candidate.result.(*PartialSuccessError) + if candidate.result == nil || isPartialSuccessError { okMsg := userAuthPubKeyOkMsg{ Algo: algo, PubKey: pubKeyData, @@ -629,11 +696,11 @@ userAuthLoop: perms = candidate.perms } case "gssapi-with-mic": - if config.GSSAPIWithMICConfig == nil { + if authConfig.GSSAPIWithMICConfig == nil { authErr = errors.New("ssh: gssapi-with-mic auth not configured") break } - gssapiConfig := config.GSSAPIWithMICConfig + gssapiConfig := authConfig.GSSAPIWithMICConfig userAuthRequestGSSAPI, err := parseGSSAPIPayload(userAuthReq.Payload) if err != nil { return nil, parseError(msgUserAuthRequest) @@ -685,53 +752,86 @@ userAuthLoop: config.AuthLogCallback(s, userAuthReq.Method, authErr) } + var bannerErr *BannerError + if errors.As(authErr, &bannerErr) { + if bannerErr.Message != "" { + bannerMsg := &userAuthBannerMsg{ + Message: bannerErr.Message, + } + if err := s.transport.writePacket(Marshal(bannerMsg)); err != nil { + return nil, err + } + } + } + if authErr == nil { break userAuthLoop } - authFailures++ - if config.MaxAuthTries > 0 && authFailures >= config.MaxAuthTries { - // If we have hit the max attempts, don't bother sending the - // final SSH_MSG_USERAUTH_FAILURE message, since there are - // no more authentication methods which can be attempted, - // and this message may cause the client to re-attempt - // authentication while we send the disconnect message. - // Continue, and trigger the disconnect at the start of - // the loop. - // - // The SSH specification is somewhat confusing about this, - // RFC 4252 Section 5.1 requires each authentication failure - // be responded to with a respective SSH_MSG_USERAUTH_FAILURE - // message, but Section 4 says the server should disconnect - // after some number of attempts, but it isn't explicit which - // message should take precedence (i.e. should there be a failure - // message than a disconnect message, or if we are going to - // disconnect, should we only send that message.) - // - // Either way, OpenSSH disconnects immediately after the last - // failed authnetication attempt, and given they are typically - // considered the golden implementation it seems reasonable - // to match that behavior. - continue + var failureMsg userAuthFailureMsg + + if partialSuccess, ok := authErr.(*PartialSuccessError); ok { + // After a partial success error we don't allow changing the user + // name and execute the NoClientAuthCallback. + partialSuccessReturned = true + + // In case a partial success is returned, the server may send + // a new set of authentication methods. + authConfig = partialSuccess.Next + + // Reset pubkey cache, as the new PublicKeyCallback might + // accept a different set of public keys. + cache = pubKeyCache{} + + // Send back a partial success message to the user. + failureMsg.PartialSuccess = true + } else { + // Allow initial attempt of 'none' without penalty. + if authFailures > 0 || userAuthReq.Method != "none" || noneAuthCount != 1 { + authFailures++ + } + if config.MaxAuthTries > 0 && authFailures >= config.MaxAuthTries { + // If we have hit the max attempts, don't bother sending the + // final SSH_MSG_USERAUTH_FAILURE message, since there are + // no more authentication methods which can be attempted, + // and this message may cause the client to re-attempt + // authentication while we send the disconnect message. + // Continue, and trigger the disconnect at the start of + // the loop. + // + // The SSH specification is somewhat confusing about this, + // RFC 4252 Section 5.1 requires each authentication failure + // be responded to with a respective SSH_MSG_USERAUTH_FAILURE + // message, but Section 4 says the server should disconnect + // after some number of attempts, but it isn't explicit which + // message should take precedence (i.e. should there be a failure + // message than a disconnect message, or if we are going to + // disconnect, should we only send that message.) + // + // Either way, OpenSSH disconnects immediately after the last + // failed authentication attempt, and given they are typically + // considered the golden implementation it seems reasonable + // to match that behavior. + continue + } } - var failureMsg userAuthFailureMsg - if config.PasswordCallback != nil { + if authConfig.PasswordCallback != nil { failureMsg.Methods = append(failureMsg.Methods, "password") } - if config.PublicKeyCallback != nil { + if authConfig.PublicKeyCallback != nil { failureMsg.Methods = append(failureMsg.Methods, "publickey") } - if config.KeyboardInteractiveCallback != nil { + if authConfig.KeyboardInteractiveCallback != nil { failureMsg.Methods = append(failureMsg.Methods, "keyboard-interactive") } - if config.GSSAPIWithMICConfig != nil && config.GSSAPIWithMICConfig.Server != nil && - config.GSSAPIWithMICConfig.AllowLogin != nil { + if authConfig.GSSAPIWithMICConfig != nil && authConfig.GSSAPIWithMICConfig.Server != nil && + authConfig.GSSAPIWithMICConfig.AllowLogin != nil { failureMsg.Methods = append(failureMsg.Methods, "gssapi-with-mic") } if len(failureMsg.Methods) == 0 { - return nil, errors.New("ssh: no authentication methods configured but NoClientAuth is also false") + return nil, errors.New("ssh: no authentication methods available") } if err := s.transport.writePacket(Marshal(&failureMsg)); err != nil { diff --git a/vendor/golang.org/x/mod/LICENSE b/vendor/golang.org/x/mod/LICENSE index 6a66aea5ea..2a7cf70da6 100644 --- a/vendor/golang.org/x/mod/LICENSE +++ b/vendor/golang.org/x/mod/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. 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 + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go b/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go index 2681af35af..150f887e7a 100644 --- a/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go +++ b/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go @@ -13,7 +13,7 @@ import ( "sync" ) -// Regexp is a wrapper around regexp.Regexp, where the underlying regexp will be +// Regexp is a wrapper around [regexp.Regexp], where the underlying regexp will be // compiled the first time it is needed. type Regexp struct { str string diff --git a/vendor/golang.org/x/mod/modfile/print.go b/vendor/golang.org/x/mod/modfile/print.go index 524f93022a..2a0123d4b9 100644 --- a/vendor/golang.org/x/mod/modfile/print.go +++ b/vendor/golang.org/x/mod/modfile/print.go @@ -16,7 +16,13 @@ import ( func Format(f *FileSyntax) []byte { pr := &printer{} pr.file(f) - return pr.Bytes() + + // remove trailing blank lines + b := pr.Bytes() + for len(b) > 0 && b[len(b)-1] == '\n' && (len(b) == 1 || b[len(b)-2] == '\n') { + b = b[:len(b)-1] + } + return b } // A printer collects the state during printing of a file or expression. @@ -59,7 +65,11 @@ func (p *printer) newline() { } p.trim() - p.printf("\n") + if b := p.Bytes(); len(b) == 0 || (len(b) >= 2 && b[len(b)-1] == '\n' && b[len(b)-2] == '\n') { + // skip the blank line at top of file or after a blank line + } else { + p.printf("\n") + } for i := 0; i < p.margin; i++ { p.printf("\t") } diff --git a/vendor/golang.org/x/mod/modfile/read.go b/vendor/golang.org/x/mod/modfile/read.go index a503bc2105..de1b98211a 100644 --- a/vendor/golang.org/x/mod/modfile/read.go +++ b/vendor/golang.org/x/mod/modfile/read.go @@ -65,7 +65,7 @@ type Comments struct { } // Comment returns the receiver. This isn't useful by itself, but -// a Comments struct is embedded into all the expression +// a [Comments] struct is embedded into all the expression // implementation types, and this gives each of those a Comment // method to satisfy the Expr interface. func (c *Comments) Comment() *Comments { @@ -225,9 +225,10 @@ func (x *FileSyntax) Cleanup() { if ww == 0 { continue } - if ww == 1 { - // Collapse block into single line. - line := &Line{ + if ww == 1 && len(stmt.RParen.Comments.Before) == 0 { + // Collapse block into single line but keep the Line reference used by the + // parsed File structure. + *stmt.Line[0] = Line{ Comments: Comments{ Before: commentsAdd(stmt.Before, stmt.Line[0].Before), Suffix: commentsAdd(stmt.Line[0].Suffix, stmt.Suffix), @@ -235,7 +236,7 @@ func (x *FileSyntax) Cleanup() { }, Token: stringsAdd(stmt.Token, stmt.Line[0].Token), } - x.Stmt[w] = line + x.Stmt[w] = stmt.Line[0] w++ continue } diff --git a/vendor/golang.org/x/mod/modfile/rule.go b/vendor/golang.org/x/mod/modfile/rule.go index 6bcde8fabe..3e4a1d0ab4 100644 --- a/vendor/golang.org/x/mod/modfile/rule.go +++ b/vendor/golang.org/x/mod/modfile/rule.go @@ -5,17 +5,17 @@ // Package modfile implements a parser and formatter for go.mod files. // // The go.mod syntax is described in -// https://golang.org/cmd/go/#hdr-The_go_mod_file. +// https://pkg.go.dev/cmd/go/#hdr-The_go_mod_file. // -// The Parse and ParseLax functions both parse a go.mod file and return an +// The [Parse] and [ParseLax] functions both parse a go.mod file and return an // abstract syntax tree. ParseLax ignores unknown statements and may be used to // parse go.mod files that may have been developed with newer versions of Go. // -// The File struct returned by Parse and ParseLax represent an abstract -// go.mod file. File has several methods like AddNewRequire and DropReplace -// that can be used to programmatically edit a file. +// The [File] struct returned by Parse and ParseLax represent an abstract +// go.mod file. File has several methods like [File.AddNewRequire] and +// [File.DropReplace] that can be used to programmatically edit a file. // -// The Format function formats a File back to a byte slice which can be +// The [Format] function formats a File back to a byte slice which can be // written to a file. package modfile @@ -35,12 +35,15 @@ import ( // A File is the parsed, interpreted form of a go.mod file. type File struct { - Module *Module - Go *Go - Require []*Require - Exclude []*Exclude - Replace []*Replace - Retract []*Retract + Module *Module + Go *Go + Toolchain *Toolchain + Godebug []*Godebug + Require []*Require + Exclude []*Exclude + Replace []*Replace + Retract []*Retract + Tool []*Tool Syntax *FileSyntax } @@ -58,6 +61,19 @@ type Go struct { Syntax *Line } +// A Toolchain is the toolchain statement. +type Toolchain struct { + Name string // "go1.21rc1" + Syntax *Line +} + +// A Godebug is a single godebug key=value statement. +type Godebug struct { + Key string + Value string + Syntax *Line +} + // An Exclude is a single exclude statement. type Exclude struct { Mod module.Version @@ -78,6 +94,12 @@ type Retract struct { Syntax *Line } +// A Tool is a single tool statement. +type Tool struct { + Path string + Syntax *Line +} + // A VersionInterval represents a range of versions with upper and lower bounds. // Intervals are closed: both bounds are included. When Low is equal to High, // the interval may refer to a single version ('v1.2.3') or an interval @@ -219,7 +241,7 @@ var dontFixRetract VersionFixer = func(_, vers string) (string, error) { // data is the content of the file. // // fix is an optional function that canonicalizes module versions. -// If fix is nil, all module versions must be canonical (module.CanonicalVersion +// If fix is nil, all module versions must be canonical ([module.CanonicalVersion] // must return the same string). func Parse(file string, data []byte, fix VersionFixer) (*File, error) { return parseToFile(file, data, fix, true) @@ -282,7 +304,7 @@ func parseToFile(file string, data []byte, fix VersionFixer, strict bool) (parse }) } continue - case "module", "require", "exclude", "replace", "retract": + case "module", "godebug", "require", "exclude", "replace", "retract", "tool": for _, l := range x.Line { f.add(&errs, x, l, x.Token[0], l.Token, fix, strict) } @@ -296,9 +318,16 @@ func parseToFile(file string, data []byte, fix VersionFixer, strict bool) (parse return f, nil } -var GoVersionRE = lazyregexp.New(`^([1-9][0-9]*)\.(0|[1-9][0-9]*)$`) +var GoVersionRE = lazyregexp.New(`^([1-9][0-9]*)\.(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))?([a-z]+[0-9]+)?$`) var laxGoVersionRE = lazyregexp.New(`^v?(([1-9][0-9]*)\.(0|[1-9][0-9]*))([^0-9].*)$`) +// Toolchains must be named beginning with `go1`, +// like "go1.20.3" or "go1.20.3-gccgo". As a special case, "default" is also permitted. +// Note that this regexp is a much looser condition than go/version.IsValid, +// for forward compatibility. +// (This code has to be work to identify new toolchains even if we tweak the syntax in the future.) +var ToolchainRE = lazyregexp.New(`^default$|^go1($|\.)`) + func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, args []string, fix VersionFixer, strict bool) { // If strict is false, this module is a dependency. // We ignore all unknown directives as well as main-module-only @@ -356,7 +385,7 @@ func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, a } } if !fixed { - errorf("invalid go version '%s': must match format 1.23", args[0]) + errorf("invalid go version '%s': must match format 1.23.0", args[0]) return } } @@ -364,6 +393,21 @@ func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, a f.Go = &Go{Syntax: line} f.Go.Version = args[0] + case "toolchain": + if f.Toolchain != nil { + errorf("repeated toolchain statement") + return + } + if len(args) != 1 { + errorf("toolchain directive expects exactly one argument") + return + } else if !ToolchainRE.MatchString(args[0]) { + errorf("invalid toolchain version '%s': must match format go1.23.0 or default", args[0]) + return + } + f.Toolchain = &Toolchain{Syntax: line} + f.Toolchain.Name = args[0] + case "module": if f.Module != nil { errorf("repeated module statement") @@ -385,6 +429,22 @@ func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, a } f.Module.Mod = module.Version{Path: s} + case "godebug": + if len(args) != 1 || strings.ContainsAny(args[0], "\"`',") { + errorf("usage: godebug key=value") + return + } + key, value, ok := strings.Cut(args[0], "=") + if !ok { + errorf("usage: godebug key=value") + return + } + f.Godebug = append(f.Godebug, &Godebug{ + Key: key, + Value: value, + Syntax: line, + }) + case "require", "exclude": if len(args) != 2 { errorf("usage: %s module/path v1.2.3", verb) @@ -456,6 +516,21 @@ func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, a Syntax: line, } f.Retract = append(f.Retract, retract) + + case "tool": + if len(args) != 1 { + errorf("tool directive expects exactly one argument") + return + } + s, err := parseString(&args[0]) + if err != nil { + errorf("invalid quoted string: %v", err) + return + } + f.Tool = append(f.Tool, &Tool{ + Path: s, + Syntax: line, + }) } } @@ -516,7 +591,7 @@ func parseReplace(filename string, line *Line, verb string, args []string, fix V if strings.Contains(ns, "@") { return nil, errorf("replacement module must match format 'path version', not 'path@version'") } - return nil, errorf("replacement module without version must be directory path (rooted or starting with ./ or ../)") + return nil, errorf("replacement module without version must be directory path (rooted or starting with . or ..)") } if filepath.Separator == '/' && strings.Contains(ns, `\`) { return nil, errorf("replacement directory appears to be Windows path (on a non-windows system)") @@ -529,7 +604,6 @@ func parseReplace(filename string, line *Line, verb string, args []string, fix V } if IsDirectoryPath(ns) { return nil, errorf("replacement module directory path %q cannot have version", ns) - } } return &Replace{ @@ -605,13 +679,45 @@ func (f *WorkFile) add(errs *ErrorList, line *Line, verb string, args []string, errorf("go directive expects exactly one argument") return } else if !GoVersionRE.MatchString(args[0]) { - errorf("invalid go version '%s': must match format 1.23", args[0]) + errorf("invalid go version '%s': must match format 1.23.0", args[0]) return } f.Go = &Go{Syntax: line} f.Go.Version = args[0] + case "toolchain": + if f.Toolchain != nil { + errorf("repeated toolchain statement") + return + } + if len(args) != 1 { + errorf("toolchain directive expects exactly one argument") + return + } else if !ToolchainRE.MatchString(args[0]) { + errorf("invalid toolchain version '%s': must match format go1.23.0 or default", args[0]) + return + } + + f.Toolchain = &Toolchain{Syntax: line} + f.Toolchain.Name = args[0] + + case "godebug": + if len(args) != 1 || strings.ContainsAny(args[0], "\"`',") { + errorf("usage: godebug key=value") + return + } + key, value, ok := strings.Cut(args[0], "=") + if !ok { + errorf("usage: godebug key=value") + return + } + f.Godebug = append(f.Godebug, &Godebug{ + Key: key, + Value: value, + Syntax: line, + }) + case "use": if len(args) != 1 { errorf("usage: %s local/dir", verb) @@ -637,14 +743,15 @@ func (f *WorkFile) add(errs *ErrorList, line *Line, verb string, args []string, } } -// IsDirectoryPath reports whether the given path should be interpreted -// as a directory path. Just like on the go command line, relative paths +// IsDirectoryPath reports whether the given path should be interpreted as a directory path. +// Just like on the go command line, relative paths starting with a '.' or '..' path component // and rooted paths are directory paths; the rest are module paths. func IsDirectoryPath(ns string) bool { // Because go.mod files can move from one system to another, // we check all known path syntaxes, both Unix and Windows. - return strings.HasPrefix(ns, "./") || strings.HasPrefix(ns, "../") || strings.HasPrefix(ns, "/") || - strings.HasPrefix(ns, `.\`) || strings.HasPrefix(ns, `..\`) || strings.HasPrefix(ns, `\`) || + return ns == "." || strings.HasPrefix(ns, "./") || strings.HasPrefix(ns, `.\`) || + ns == ".." || strings.HasPrefix(ns, "../") || strings.HasPrefix(ns, `..\`) || + strings.HasPrefix(ns, "/") || strings.HasPrefix(ns, `\`) || len(ns) >= 2 && ('A' <= ns[0] && ns[0] <= 'Z' || 'a' <= ns[0] && ns[0] <= 'z') && ns[1] == ':' } @@ -881,11 +988,20 @@ func (f *File) Format() ([]byte, error) { } // Cleanup cleans up the file f after any edit operations. -// To avoid quadratic behavior, modifications like DropRequire +// To avoid quadratic behavior, modifications like [File.DropRequire] // clear the entry but do not remove it from the slice. // Cleanup cleans out all the cleared entries. func (f *File) Cleanup() { w := 0 + for _, g := range f.Godebug { + if g.Key != "" { + f.Godebug[w] = g + w++ + } + } + f.Godebug = f.Godebug[:w] + + w = 0 for _, r := range f.Require { if r.Mod.Path != "" { f.Require[w] = r @@ -926,12 +1042,14 @@ func (f *File) Cleanup() { func (f *File) AddGoStmt(version string) error { if !GoVersionRE.MatchString(version) { - return fmt.Errorf("invalid language version string %q", version) + return fmt.Errorf("invalid language version %q", version) } if f.Go == nil { var hint Expr if f.Module != nil && f.Module.Syntax != nil { hint = f.Module.Syntax + } else if f.Syntax == nil { + f.Syntax = new(FileSyntax) } f.Go = &Go{ Version: version, @@ -944,6 +1062,83 @@ func (f *File) AddGoStmt(version string) error { return nil } +// DropGoStmt deletes the go statement from the file. +func (f *File) DropGoStmt() { + if f.Go != nil { + f.Go.Syntax.markRemoved() + f.Go = nil + } +} + +// DropToolchainStmt deletes the toolchain statement from the file. +func (f *File) DropToolchainStmt() { + if f.Toolchain != nil { + f.Toolchain.Syntax.markRemoved() + f.Toolchain = nil + } +} + +func (f *File) AddToolchainStmt(name string) error { + if !ToolchainRE.MatchString(name) { + return fmt.Errorf("invalid toolchain name %q", name) + } + if f.Toolchain == nil { + var hint Expr + if f.Go != nil && f.Go.Syntax != nil { + hint = f.Go.Syntax + } else if f.Module != nil && f.Module.Syntax != nil { + hint = f.Module.Syntax + } + f.Toolchain = &Toolchain{ + Name: name, + Syntax: f.Syntax.addLine(hint, "toolchain", name), + } + } else { + f.Toolchain.Name = name + f.Syntax.updateLine(f.Toolchain.Syntax, "toolchain", name) + } + return nil +} + +// AddGodebug sets the first godebug line for key to value, +// preserving any existing comments for that line and removing all +// other godebug lines for key. +// +// If no line currently exists for key, AddGodebug adds a new line +// at the end of the last godebug block. +func (f *File) AddGodebug(key, value string) error { + need := true + for _, g := range f.Godebug { + if g.Key == key { + if need { + g.Value = value + f.Syntax.updateLine(g.Syntax, "godebug", key+"="+value) + need = false + } else { + g.Syntax.markRemoved() + *g = Godebug{} + } + } + } + + if need { + f.addNewGodebug(key, value) + } + return nil +} + +// addNewGodebug adds a new godebug key=value line at the end +// of the last godebug block, regardless of any existing godebug lines for key. +func (f *File) addNewGodebug(key, value string) { + line := f.Syntax.addLine(nil, "godebug", key+"="+value) + g := &Godebug{ + Key: key, + Value: value, + Syntax: line, + } + f.Godebug = append(f.Godebug, g) +} + // AddRequire sets the first require line for path to version vers, // preserving any existing comments for that line and removing all // other lines for path. @@ -995,8 +1190,8 @@ func (f *File) AddNewRequire(path, vers string, indirect bool) { // The requirements in req must specify at most one distinct version for each // module path. // -// If any existing requirements may be removed, the caller should call Cleanup -// after all edits are complete. +// If any existing requirements may be removed, the caller should call +// [File.Cleanup] after all edits are complete. func (f *File) SetRequire(req []*Require) { type elem struct { version string @@ -1251,6 +1446,16 @@ func (f *File) SetRequireSeparateIndirect(req []*Require) { f.SortBlocks() } +func (f *File) DropGodebug(key string) error { + for _, g := range f.Godebug { + if g.Key == key { + g.Syntax.markRemoved() + *g = Godebug{} + } + } + return nil +} + func (f *File) DropRequire(path string) error { for _, r := range f.Require { if r.Mod.Path == path { @@ -1384,16 +1589,54 @@ func (f *File) DropRetract(vi VersionInterval) error { return nil } +// AddTool adds a new tool directive with the given path. +// It does nothing if the tool line already exists. +func (f *File) AddTool(path string) error { + for _, t := range f.Tool { + if t.Path == path { + return nil + } + } + + f.Tool = append(f.Tool, &Tool{ + Path: path, + Syntax: f.Syntax.addLine(nil, "tool", path), + }) + + f.SortBlocks() + return nil +} + +// RemoveTool removes a tool directive with the given path. +// It does nothing if no such tool directive exists. +func (f *File) DropTool(path string) error { + for _, t := range f.Tool { + if t.Path == path { + t.Syntax.markRemoved() + *t = Tool{} + } + } + return nil +} + func (f *File) SortBlocks() { f.removeDups() // otherwise sorting is unsafe + // semanticSortForExcludeVersionV is the Go version (plus leading "v") at which + // lines in exclude blocks start to use semantic sort instead of lexicographic sort. + // See go.dev/issue/60028. + const semanticSortForExcludeVersionV = "v1.21" + useSemanticSortForExclude := f.Go != nil && semver.Compare("v"+f.Go.Version, semanticSortForExcludeVersionV) >= 0 + for _, stmt := range f.Syntax.Stmt { block, ok := stmt.(*LineBlock) if !ok { continue } less := lineLess - if block.Token[0] == "retract" { + if block.Token[0] == "exclude" && useSemanticSortForExclude { + less = lineExcludeLess + } else if block.Token[0] == "retract" { less = lineRetractLess } sort.SliceStable(block.Line, func(i, j int) bool { @@ -1402,9 +1645,9 @@ func (f *File) SortBlocks() { } } -// removeDups removes duplicate exclude and replace directives. +// removeDups removes duplicate exclude, replace and tool directives. // -// Earlier exclude directives take priority. +// Earlier exclude and tool directives take priority. // // Later replace directives take priority. // @@ -1414,10 +1657,10 @@ func (f *File) SortBlocks() { // retract directives are not de-duplicated since comments are // meaningful, and versions may be retracted multiple times. func (f *File) removeDups() { - removeDups(f.Syntax, &f.Exclude, &f.Replace) + removeDups(f.Syntax, &f.Exclude, &f.Replace, &f.Tool) } -func removeDups(syntax *FileSyntax, exclude *[]*Exclude, replace *[]*Replace) { +func removeDups(syntax *FileSyntax, exclude *[]*Exclude, replace *[]*Replace, tool *[]*Tool) { kill := make(map[*Line]bool) // Remove duplicate excludes. @@ -1458,6 +1701,24 @@ func removeDups(syntax *FileSyntax, exclude *[]*Exclude, replace *[]*Replace) { } *replace = repl + if tool != nil { + haveTool := make(map[string]bool) + for _, t := range *tool { + if haveTool[t.Path] { + kill[t.Syntax] = true + continue + } + haveTool[t.Path] = true + } + var newTool []*Tool + for _, t := range *tool { + if !kill[t.Syntax] { + newTool = append(newTool, t) + } + } + *tool = newTool + } + // Duplicate require and retract directives are not removed. // Drop killed statements from the syntax tree. @@ -1496,6 +1757,22 @@ func lineLess(li, lj *Line) bool { return len(li.Token) < len(lj.Token) } +// lineExcludeLess reports whether li should be sorted before lj for lines in +// an "exclude" block. +func lineExcludeLess(li, lj *Line) bool { + if len(li.Token) != 2 || len(lj.Token) != 2 { + // Not a known exclude specification. + // Fall back to sorting lexicographically. + return lineLess(li, lj) + } + // An exclude specification has two tokens: ModulePath and Version. + // Compare module path by string order and version by semver rules. + if pi, pj := li.Token[0], lj.Token[0]; pi != pj { + return pi < pj + } + return semver.Compare(li.Token[1], lj.Token[1]) < 0 +} + // lineRetractLess returns whether li should be sorted before lj for lines in // a "retract" block. It treats each line as a version interval. Single versions // are compared as if they were intervals with the same low and high version. diff --git a/vendor/golang.org/x/mod/modfile/work.go b/vendor/golang.org/x/mod/modfile/work.go index 0c0e521525..5387d0c265 100644 --- a/vendor/golang.org/x/mod/modfile/work.go +++ b/vendor/golang.org/x/mod/modfile/work.go @@ -12,9 +12,11 @@ import ( // A WorkFile is the parsed, interpreted form of a go.work file. type WorkFile struct { - Go *Go - Use []*Use - Replace []*Replace + Go *Go + Toolchain *Toolchain + Godebug []*Godebug + Use []*Use + Replace []*Replace Syntax *FileSyntax } @@ -33,7 +35,7 @@ type Use struct { // data is the content of the file. // // fix is an optional function that canonicalizes module versions. -// If fix is nil, all module versions must be canonical (module.CanonicalVersion +// If fix is nil, all module versions must be canonical ([module.CanonicalVersion] // must return the same string). func ParseWork(file string, data []byte, fix VersionFixer) (*WorkFile, error) { fs, err := parse(file, data) @@ -67,7 +69,7 @@ func ParseWork(file string, data []byte, fix VersionFixer) (*WorkFile, error) { Err: fmt.Errorf("unknown block type: %s", strings.Join(x.Token, " ")), }) continue - case "use", "replace": + case "godebug", "use", "replace": for _, l := range x.Line { f.add(&errs, l, x.Token[0], l.Token, fix) } @@ -82,7 +84,7 @@ func ParseWork(file string, data []byte, fix VersionFixer) (*WorkFile, error) { } // Cleanup cleans up the file f after any edit operations. -// To avoid quadratic behavior, modifications like DropRequire +// To avoid quadratic behavior, modifications like [WorkFile.DropRequire] // clear the entry but do not remove it from the slice. // Cleanup cleans out all the cleared entries. func (f *WorkFile) Cleanup() { @@ -109,7 +111,7 @@ func (f *WorkFile) Cleanup() { func (f *WorkFile) AddGoStmt(version string) error { if !GoVersionRE.MatchString(version) { - return fmt.Errorf("invalid language version string %q", version) + return fmt.Errorf("invalid language version %q", version) } if f.Go == nil { stmt := &Line{Token: []string{"go", version}} @@ -117,7 +119,7 @@ func (f *WorkFile) AddGoStmt(version string) error { Version: version, Syntax: stmt, } - // Find the first non-comment-only block that's and add + // Find the first non-comment-only block and add // the go statement before it. That will keep file comments at the top. i := 0 for i = 0; i < len(f.Syntax.Stmt); i++ { @@ -133,6 +135,105 @@ func (f *WorkFile) AddGoStmt(version string) error { return nil } +func (f *WorkFile) AddToolchainStmt(name string) error { + if !ToolchainRE.MatchString(name) { + return fmt.Errorf("invalid toolchain name %q", name) + } + if f.Toolchain == nil { + stmt := &Line{Token: []string{"toolchain", name}} + f.Toolchain = &Toolchain{ + Name: name, + Syntax: stmt, + } + // Find the go line and add the toolchain line after it. + // Or else find the first non-comment-only block and add + // the toolchain line before it. That will keep file comments at the top. + i := 0 + for i = 0; i < len(f.Syntax.Stmt); i++ { + if line, ok := f.Syntax.Stmt[i].(*Line); ok && len(line.Token) > 0 && line.Token[0] == "go" { + i++ + goto Found + } + } + for i = 0; i < len(f.Syntax.Stmt); i++ { + if _, ok := f.Syntax.Stmt[i].(*CommentBlock); !ok { + break + } + } + Found: + f.Syntax.Stmt = append(append(f.Syntax.Stmt[:i:i], stmt), f.Syntax.Stmt[i:]...) + } else { + f.Toolchain.Name = name + f.Syntax.updateLine(f.Toolchain.Syntax, "toolchain", name) + } + return nil +} + +// DropGoStmt deletes the go statement from the file. +func (f *WorkFile) DropGoStmt() { + if f.Go != nil { + f.Go.Syntax.markRemoved() + f.Go = nil + } +} + +// DropToolchainStmt deletes the toolchain statement from the file. +func (f *WorkFile) DropToolchainStmt() { + if f.Toolchain != nil { + f.Toolchain.Syntax.markRemoved() + f.Toolchain = nil + } +} + +// AddGodebug sets the first godebug line for key to value, +// preserving any existing comments for that line and removing all +// other godebug lines for key. +// +// If no line currently exists for key, AddGodebug adds a new line +// at the end of the last godebug block. +func (f *WorkFile) AddGodebug(key, value string) error { + need := true + for _, g := range f.Godebug { + if g.Key == key { + if need { + g.Value = value + f.Syntax.updateLine(g.Syntax, "godebug", key+"="+value) + need = false + } else { + g.Syntax.markRemoved() + *g = Godebug{} + } + } + } + + if need { + f.addNewGodebug(key, value) + } + return nil +} + +// addNewGodebug adds a new godebug key=value line at the end +// of the last godebug block, regardless of any existing godebug lines for key. +func (f *WorkFile) addNewGodebug(key, value string) { + line := f.Syntax.addLine(nil, "godebug", key+"="+value) + g := &Godebug{ + Key: key, + Value: value, + Syntax: line, + } + f.Godebug = append(f.Godebug, g) +} + +func (f *WorkFile) DropGodebug(key string) error { + for _, g := range f.Godebug { + if g.Key == key { + g.Syntax.markRemoved() + *g = Godebug{} + } + } + return nil +} + func (f *WorkFile) AddUse(diskPath, modulePath string) error { need := true for _, d := range f.Use { @@ -230,5 +331,5 @@ func (f *WorkFile) SortBlocks() { // retract directives are not de-duplicated since comments are // meaningful, and versions may be retracted multiple times. func (f *WorkFile) removeDups() { - removeDups(f.Syntax, nil, &f.Replace) + removeDups(f.Syntax, nil, &f.Replace, nil) } diff --git a/vendor/golang.org/x/mod/module/module.go b/vendor/golang.org/x/mod/module/module.go index e9dec6e614..2a364b229b 100644 --- a/vendor/golang.org/x/mod/module/module.go +++ b/vendor/golang.org/x/mod/module/module.go @@ -4,7 +4,7 @@ // Package module defines the module.Version type along with support code. // -// The module.Version type is a simple Path, Version pair: +// The [module.Version] type is a simple Path, Version pair: // // type Version struct { // Path string @@ -12,7 +12,7 @@ // } // // There are no restrictions imposed directly by use of this structure, -// but additional checking functions, most notably Check, verify that +// but additional checking functions, most notably [Check], verify that // a particular path, version pair is valid. // // # Escaped Paths @@ -140,7 +140,7 @@ type ModuleError struct { Err error } -// VersionError returns a ModuleError derived from a Version and 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 @@ -169,7 +169,7 @@ 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 +// A [ModuleError] may wrap an InvalidVersionError, but an InvalidVersionError // must not wrap a ModuleError. type InvalidVersionError struct { Version string @@ -193,8 +193,8 @@ func (e *InvalidVersionError) Error() string { func (e *InvalidVersionError) Unwrap() error { return e.Err } // An InvalidPathError indicates a module, import, or file path doesn't -// satisfy all naming constraints. See CheckPath, CheckImportPath, -// and CheckFilePath for specific restrictions. +// satisfy all naming constraints. See [CheckPath], [CheckImportPath], +// and [CheckFilePath] for specific restrictions. type InvalidPathError struct { Kind string // "module", "import", or "file" Path string @@ -294,7 +294,7 @@ func fileNameOK(r rune) bool { } // CheckPath checks that a module path is valid. -// A valid module path is a valid import path, as checked by CheckImportPath, +// A valid module path is a valid import path, as checked by [CheckImportPath], // with three 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, @@ -380,7 +380,7 @@ const ( // checkPath returns an error describing why the path is not valid. // Because these checks apply to module, import, and file paths, // and because other checks may be applied, the caller is expected to wrap -// this error with InvalidPathError. +// this error with [InvalidPathError]. func checkPath(path string, kind pathKind) error { if !utf8.ValidString(path) { return fmt.Errorf("invalid UTF-8") @@ -532,7 +532,7 @@ var badWindowsNames = []string{ // 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". +// 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) @@ -582,7 +582,7 @@ func splitGopkgIn(path string) (prefix, pathMajor string, ok bool) { // MatchPathMajor reports whether the semantic version v // matches the path major version pathMajor. // -// MatchPathMajor returns true if and only if CheckPathMajor returns nil. +// MatchPathMajor returns true if and only if [CheckPathMajor] returns nil. func MatchPathMajor(v, pathMajor string) bool { return CheckPathMajor(v, pathMajor) == nil } @@ -622,7 +622,7 @@ func CheckPathMajor(v, pathMajor string) error { // 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 +// 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 { @@ -643,7 +643,7 @@ func PathMajorPrefix(pathMajor string) string { } // 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". +// It is the same as [semver.Canonical] except that it preserves the special build suffix "+incompatible". func CanonicalVersion(v string) string { cv := semver.Canonical(v) if semver.Build(v) == "+incompatible" { @@ -652,8 +652,8 @@ func CanonicalVersion(v string) string { 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) +// 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) { @@ -793,7 +793,7 @@ func unescapeString(escaped string) (string, bool) { } // MatchPrefixPatterns reports whether any path prefix of target matches one of -// the glob patterns (as defined by path.Match) in the comma-separated globs +// the glob patterns (as defined by [path.Match]) in the comma-separated globs // list. This implements the algorithm used when matching a module path to the // GOPRIVATE environment variable, as described by 'go help module-private'. // diff --git a/vendor/golang.org/x/mod/module/pseudo.go b/vendor/golang.org/x/mod/module/pseudo.go index f04ad37886..9cf19d3254 100644 --- a/vendor/golang.org/x/mod/module/pseudo.go +++ b/vendor/golang.org/x/mod/module/pseudo.go @@ -125,7 +125,7 @@ func IsPseudoVersion(v string) bool { } // IsZeroPseudoVersion returns whether v is a pseudo-version with a zero base, -// timestamp, and revision, as returned by ZeroPseudoVersion. +// timestamp, and revision, as returned by [ZeroPseudoVersion]. func IsZeroPseudoVersion(v string) bool { return v == ZeroPseudoVersion(semver.Major(v)) } diff --git a/vendor/golang.org/x/mod/semver/semver.go b/vendor/golang.org/x/mod/semver/semver.go index a30a22bf20..9a2dfd33a7 100644 --- a/vendor/golang.org/x/mod/semver/semver.go +++ b/vendor/golang.org/x/mod/semver/semver.go @@ -140,7 +140,7 @@ func Compare(v, w string) int { // Max canonicalizes its arguments and then returns the version string // that compares greater. // -// Deprecated: use Compare instead. In most cases, returning a canonicalized +// Deprecated: use [Compare] instead. In most cases, returning a canonicalized // version is not expected or desired. func Max(v, w string) string { v = Canonical(v) @@ -151,7 +151,7 @@ func Max(v, w string) string { return w } -// ByVersion implements sort.Interface for sorting semantic version strings. +// ByVersion implements [sort.Interface] for sorting semantic version strings. type ByVersion []string func (vs ByVersion) Len() int { return len(vs) } @@ -164,7 +164,7 @@ func (vs ByVersion) Less(i, j int) bool { return vs[i] < vs[j] } -// Sort sorts a list of semantic version strings using ByVersion. +// Sort sorts a list of semantic version strings using [ByVersion]. func Sort(list []string) { sort.Sort(ByVersion(list)) } diff --git a/vendor/golang.org/x/net/LICENSE b/vendor/golang.org/x/net/LICENSE index 6a66aea5ea..2a7cf70da6 100644 --- a/vendor/golang.org/x/net/LICENSE +++ b/vendor/golang.org/x/net/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. 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 + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/vendor/golang.org/x/net/http/httpguts/httplex.go b/vendor/golang.org/x/net/http/httpguts/httplex.go index 6e071e8524..9b4de94019 100644 --- a/vendor/golang.org/x/net/http/httpguts/httplex.go +++ b/vendor/golang.org/x/net/http/httpguts/httplex.go @@ -12,7 +12,7 @@ import ( "golang.org/x/net/idna" ) -var isTokenTable = [127]bool{ +var isTokenTable = [256]bool{ '!': true, '#': true, '$': true, @@ -93,12 +93,7 @@ var isTokenTable = [127]bool{ } func IsTokenRune(r rune) bool { - i := int(r) - return i < len(isTokenTable) && isTokenTable[i] -} - -func isNotToken(r rune) bool { - return !IsTokenRune(r) + return r < utf8.RuneSelf && isTokenTable[byte(r)] } // HeaderValuesContainsToken reports whether any string in values @@ -202,8 +197,8 @@ func ValidHeaderFieldName(v string) bool { if len(v) == 0 { return false } - for _, r := range v { - if !IsTokenRune(r) { + for i := 0; i < len(v); i++ { + if !isTokenTable[v[i]] { return false } } diff --git a/vendor/golang.org/x/net/http2/frame.go b/vendor/golang.org/x/net/http2/frame.go index 43557ab7e9..105c3b279c 100644 --- a/vendor/golang.org/x/net/http2/frame.go +++ b/vendor/golang.org/x/net/http2/frame.go @@ -490,6 +490,9 @@ func terminalReadFrameError(err error) bool { // returned error is ErrFrameTooLarge. Other errors may be of type // ConnectionError, StreamError, or anything else from the underlying // reader. +// +// If ReadFrame returns an error and a non-nil Frame, the Frame's StreamID +// indicates the stream responsible for the error. func (fr *Framer) ReadFrame() (Frame, error) { fr.errDetail = nil if fr.lastFrame != nil { @@ -1521,7 +1524,7 @@ func (fr *Framer) maxHeaderStringLen() int { // readMetaFrame returns 0 or more CONTINUATION frames from fr and // merge them into the provided hf and returns a MetaHeadersFrame // with the decoded hpack values. -func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) { +func (fr *Framer) readMetaFrame(hf *HeadersFrame) (Frame, error) { if fr.AllowIllegalReads { return nil, errors.New("illegal use of AllowIllegalReads with ReadMetaHeaders") } @@ -1592,7 +1595,7 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) { } // It would be nice to send a RST_STREAM before sending the GOAWAY, // but the structure of the server's frame writer makes this difficult. - return nil, ConnectionError(ErrCodeProtocol) + return mh, ConnectionError(ErrCodeProtocol) } // Also close the connection after any CONTINUATION frame following an @@ -1604,11 +1607,11 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) { } // It would be nice to send a RST_STREAM before sending the GOAWAY, // but the structure of the server's frame writer makes this difficult. - return nil, ConnectionError(ErrCodeProtocol) + return mh, ConnectionError(ErrCodeProtocol) } if _, err := hdec.Write(frag); err != nil { - return nil, ConnectionError(ErrCodeCompression) + return mh, ConnectionError(ErrCodeCompression) } if hc.HeadersEnded() { @@ -1625,7 +1628,7 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) { mh.HeadersFrame.invalidate() if err := hdec.Close(); err != nil { - return nil, ConnectionError(ErrCodeCompression) + return mh, ConnectionError(ErrCodeCompression) } if invalid != nil { fr.errDetail = invalid diff --git a/vendor/golang.org/x/net/http2/http2.go b/vendor/golang.org/x/net/http2/http2.go index 6f2df28187..003e649f30 100644 --- a/vendor/golang.org/x/net/http2/http2.go +++ b/vendor/golang.org/x/net/http2/http2.go @@ -17,6 +17,7 @@ package http2 // import "golang.org/x/net/http2" import ( "bufio" + "context" "crypto/tls" "fmt" "io" @@ -26,6 +27,7 @@ import ( "strconv" "strings" "sync" + "time" "golang.org/x/net/http/httpguts" ) @@ -210,12 +212,6 @@ type stringWriter interface { WriteString(s string) (n int, err error) } -// A gate lets two goroutines coordinate their activities. -type gate chan struct{} - -func (g gate) Done() { g <- struct{}{} } -func (g gate) Wait() { <-g } - // A closeWaiter is like a sync.WaitGroup but only goes 1 to 0 (open to closed). type closeWaiter chan struct{} @@ -383,3 +379,14 @@ func validPseudoPath(v string) bool { // makes that struct also non-comparable, and generally doesn't add // any size (as long as it's first). type incomparable [0]func() + +// synctestGroupInterface is the methods of synctestGroup used by Server and Transport. +// It's defined as an interface here to let us keep synctestGroup entirely test-only +// and not a part of non-test builds. +type synctestGroupInterface interface { + Join() + Now() time.Time + NewTimer(d time.Duration) timer + AfterFunc(d time.Duration, f func()) timer + ContextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) +} diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index ce2e8b40ee..6c349f3ec6 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -154,6 +154,39 @@ type Server struct { // so that we don't embed a Mutex in this struct, which will make the // struct non-copyable, which might break some callers. state *serverInternalState + + // Synchronization group used for testing. + // Outside of tests, this is nil. + group synctestGroupInterface +} + +func (s *Server) markNewGoroutine() { + if s.group != nil { + s.group.Join() + } +} + +func (s *Server) now() time.Time { + if s.group != nil { + return s.group.Now() + } + return time.Now() +} + +// newTimer creates a new time.Timer, or a synthetic timer in tests. +func (s *Server) newTimer(d time.Duration) timer { + if s.group != nil { + return s.group.NewTimer(d) + } + return timeTimer{time.NewTimer(d)} +} + +// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests. +func (s *Server) afterFunc(d time.Duration, f func()) timer { + if s.group != nil { + return s.group.AfterFunc(d, f) + } + return timeTimer{time.AfterFunc(d, f)} } func (s *Server) initialConnRecvWindowSize() int32 { @@ -400,6 +433,10 @@ func (o *ServeConnOpts) handler() http.Handler { // // The opts parameter is optional. If nil, default values are used. func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { + s.serveConn(c, opts, nil) +} + +func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverConn)) { baseCtx, cancel := serverConnBaseContext(c, opts) defer cancel() @@ -426,6 +463,9 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { pushEnabled: true, sawClientPreface: opts.SawClientPreface, } + if newf != nil { + newf(sc) + } s.state.registerConn(sc) defer s.state.unregisterConn(sc) @@ -599,8 +639,8 @@ type serverConn struct { inFrameScheduleLoop bool // whether we're in the scheduleFrameWrite loop needToSendGoAway bool // we need to schedule a GOAWAY frame write goAwayCode ErrCode - shutdownTimer *time.Timer // nil until used - idleTimer *time.Timer // nil if unused + shutdownTimer timer // nil until used + idleTimer timer // nil if unused // Owned by the writeFrameAsync goroutine: headerWriteBuf bytes.Buffer @@ -649,12 +689,12 @@ type stream struct { flow outflow // limits writing from Handler to client inflow inflow // 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 - wroteHeaders bool // whether we wrote headers (not status 100) - readDeadline *time.Timer // nil if unused - writeDeadline *time.Timer // nil if unused - closeErr error // set before cw is closed + resetQueued bool // RST_STREAM queued for write; set by sc.resetStream + gotTrailerHeader bool // HEADER frame for trailers was seen + wroteHeaders bool // whether we wrote headers (not status 100) + readDeadline timer // nil if unused + writeDeadline timer // nil if unused + closeErr error // set before cw is closed trailer http.Header // accumulated trailers reqTrailer http.Header // handler's Request.Trailer @@ -732,11 +772,7 @@ func isClosedConnError(err error) bool { return false } - // TODO: remove this string search and be more like the Windows - // case below. That might involve modifying the standard library - // to return better error types. - str := err.Error() - if strings.Contains(str, "use of closed network connection") { + if errors.Is(err, net.ErrClosed) { return true } @@ -815,8 +851,9 @@ type readFrameResult struct { // consumer is done with the frame. // It's run on its own goroutine. func (sc *serverConn) readFrames() { - gate := make(gate) - gateDone := gate.Done + sc.srv.markNewGoroutine() + gate := make(chan struct{}) + gateDone := func() { gate <- struct{}{} } for { f, err := sc.framer.ReadFrame() select { @@ -847,6 +884,7 @@ type frameWriteResult struct { // At most one goroutine can be running writeFrameAsync at a time per // serverConn. func (sc *serverConn) writeFrameAsync(wr FrameWriteRequest, wd *writeData) { + sc.srv.markNewGoroutine() var err error if wd == nil { err = wr.write.writeFrame(sc) @@ -926,13 +964,13 @@ func (sc *serverConn) serve() { sc.setConnState(http.StateIdle) if sc.srv.IdleTimeout > 0 { - sc.idleTimer = time.AfterFunc(sc.srv.IdleTimeout, sc.onIdleTimer) + sc.idleTimer = sc.srv.afterFunc(sc.srv.IdleTimeout, sc.onIdleTimer) defer sc.idleTimer.Stop() } go sc.readFrames() // closed by defer sc.conn.Close above - settingsTimer := time.AfterFunc(firstSettingsTimeout, sc.onSettingsTimer) + settingsTimer := sc.srv.afterFunc(firstSettingsTimeout, sc.onSettingsTimer) defer settingsTimer.Stop() loopNum := 0 @@ -1061,10 +1099,10 @@ func (sc *serverConn) readPreface() error { errc <- nil } }() - timer := time.NewTimer(prefaceTimeout) // TODO: configurable on *Server? + timer := sc.srv.newTimer(prefaceTimeout) // TODO: configurable on *Server? defer timer.Stop() select { - case <-timer.C: + case <-timer.C(): return errPrefaceTimeout case err := <-errc: if err == nil { @@ -1429,7 +1467,7 @@ func (sc *serverConn) goAway(code ErrCode) { func (sc *serverConn) shutDownIn(d time.Duration) { sc.serveG.check() - sc.shutdownTimer = time.AfterFunc(d, sc.onShutdownTimer) + sc.shutdownTimer = sc.srv.afterFunc(d, sc.onShutdownTimer) } func (sc *serverConn) resetStream(se StreamError) { @@ -1482,6 +1520,11 @@ func (sc *serverConn) processFrameFromReader(res readFrameResult) bool { sc.goAway(ErrCodeFlowControl) return true case ConnectionError: + if res.f != nil { + if id := res.f.Header().StreamID; id > sc.maxClientStreamID { + sc.maxClientStreamID = id + } + } sc.logf("http2: server connection error from %v: %v", sc.conn.RemoteAddr(), ev) sc.goAway(ErrCode(ev)) return true // goAway will handle shutdown @@ -1638,7 +1681,7 @@ func (sc *serverConn) closeStream(st *stream, err error) { delete(sc.streams, st.id) if len(sc.streams) == 0 { sc.setConnState(http.StateIdle) - if sc.srv.IdleTimeout > 0 { + if sc.srv.IdleTimeout > 0 && sc.idleTimer != nil { sc.idleTimer.Reset(sc.srv.IdleTimeout) } if h1ServerKeepAlivesDisabled(sc.hs) { @@ -1660,6 +1703,7 @@ func (sc *serverConn) closeStream(st *stream, err error) { } } st.closeErr = err + st.cancelCtx() st.cw.Close() // signals Handler's CloseNotifier, unblocks writes, etc sc.writeSched.CloseStream(st.id) } @@ -2020,7 +2064,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { // (in Go 1.8), though. That's a more sane option anyway. if sc.hs.ReadTimeout > 0 { sc.conn.SetReadDeadline(time.Time{}) - st.readDeadline = time.AfterFunc(sc.hs.ReadTimeout, st.onReadTimeout) + st.readDeadline = sc.srv.afterFunc(sc.hs.ReadTimeout, st.onReadTimeout) } return sc.scheduleHandler(id, rw, req, handler) @@ -2118,7 +2162,7 @@ func (sc *serverConn) newStream(id, pusherID uint32, state streamState) *stream st.flow.add(sc.initialStreamSendWindowSize) st.inflow.init(sc.srv.initialStreamRecvWindowSize()) if sc.hs.WriteTimeout > 0 { - st.writeDeadline = time.AfterFunc(sc.hs.WriteTimeout, st.onWriteTimeout) + st.writeDeadline = sc.srv.afterFunc(sc.hs.WriteTimeout, st.onWriteTimeout) } sc.streams[id] = st @@ -2342,6 +2386,7 @@ func (sc *serverConn) handlerDone() { // Run on its own goroutine. func (sc *serverConn) runHandler(rw *responseWriter, req *http.Request, handler func(http.ResponseWriter, *http.Request)) { + sc.srv.markNewGoroutine() defer sc.sendServeMsg(handlerDoneMsg) didPanic := true defer func() { @@ -2638,7 +2683,7 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { var date string if _, ok := rws.snapHeader["Date"]; !ok { // TODO(bradfitz): be faster here, like net/http? measure. - date = time.Now().UTC().Format(http.TimeFormat) + date = rws.conn.srv.now().UTC().Format(http.TimeFormat) } for _, v := range rws.snapHeader["Trailer"] { @@ -2760,7 +2805,7 @@ func (rws *responseWriterState) promoteUndeclaredTrailers() { func (w *responseWriter) SetReadDeadline(deadline time.Time) error { st := w.rws.stream - if !deadline.IsZero() && deadline.Before(time.Now()) { + if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) { // If we're setting a deadline in the past, reset the stream immediately // so writes after SetWriteDeadline returns will fail. st.onReadTimeout() @@ -2776,9 +2821,9 @@ func (w *responseWriter) SetReadDeadline(deadline time.Time) error { if deadline.IsZero() { st.readDeadline = nil } else if st.readDeadline == nil { - st.readDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onReadTimeout) + st.readDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onReadTimeout) } else { - st.readDeadline.Reset(deadline.Sub(time.Now())) + st.readDeadline.Reset(deadline.Sub(sc.srv.now())) } }) return nil @@ -2786,7 +2831,7 @@ func (w *responseWriter) SetReadDeadline(deadline time.Time) error { func (w *responseWriter) SetWriteDeadline(deadline time.Time) error { st := w.rws.stream - if !deadline.IsZero() && deadline.Before(time.Now()) { + if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) { // If we're setting a deadline in the past, reset the stream immediately // so writes after SetWriteDeadline returns will fail. st.onWriteTimeout() @@ -2802,9 +2847,9 @@ func (w *responseWriter) SetWriteDeadline(deadline time.Time) error { if deadline.IsZero() { st.writeDeadline = nil } else if st.writeDeadline == nil { - st.writeDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onWriteTimeout) + st.writeDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onWriteTimeout) } else { - st.writeDeadline.Reset(deadline.Sub(time.Now())) + st.writeDeadline.Reset(deadline.Sub(sc.srv.now())) } }) return nil diff --git a/vendor/golang.org/x/net/http2/testsync.go b/vendor/golang.org/x/net/http2/testsync.go deleted file mode 100644 index 61075bd16d..0000000000 --- a/vendor/golang.org/x/net/http2/testsync.go +++ /dev/null @@ -1,331 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -package http2 - -import ( - "context" - "sync" - "time" -) - -// testSyncHooks coordinates goroutines in tests. -// -// For example, a call to ClientConn.RoundTrip involves several goroutines, including: -// - the goroutine running RoundTrip; -// - the clientStream.doRequest goroutine, which writes the request; and -// - the clientStream.readLoop goroutine, which reads the response. -// -// Using testSyncHooks, a test can start a RoundTrip and identify when all these goroutines -// are blocked waiting for some condition such as reading the Request.Body or waiting for -// flow control to become available. -// -// The testSyncHooks also manage timers and synthetic time in tests. -// This permits us to, for example, start a request and cause it to time out waiting for -// response headers without resorting to time.Sleep calls. -type testSyncHooks struct { - // active/inactive act as a mutex and condition variable. - // - // - neither chan contains a value: testSyncHooks is locked. - // - active contains a value: unlocked, and at least one goroutine is not blocked - // - inactive contains a value: unlocked, and all goroutines are blocked - active chan struct{} - inactive chan struct{} - - // goroutine counts - total int // total goroutines - condwait map[*sync.Cond]int // blocked in sync.Cond.Wait - blocked []*testBlockedGoroutine // otherwise blocked - - // fake time - now time.Time - timers []*fakeTimer - - // Transport testing: Report various events. - newclientconn func(*ClientConn) - newstream func(*clientStream) -} - -// testBlockedGoroutine is a blocked goroutine. -type testBlockedGoroutine struct { - f func() bool // blocked until f returns true - ch chan struct{} // closed when unblocked -} - -func newTestSyncHooks() *testSyncHooks { - h := &testSyncHooks{ - active: make(chan struct{}, 1), - inactive: make(chan struct{}, 1), - condwait: map[*sync.Cond]int{}, - } - h.inactive <- struct{}{} - h.now = time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC) - return h -} - -// lock acquires the testSyncHooks mutex. -func (h *testSyncHooks) lock() { - select { - case <-h.active: - case <-h.inactive: - } -} - -// waitInactive waits for all goroutines to become inactive. -func (h *testSyncHooks) waitInactive() { - for { - <-h.inactive - if !h.unlock() { - break - } - } -} - -// unlock releases the testSyncHooks mutex. -// It reports whether any goroutines are active. -func (h *testSyncHooks) unlock() (active bool) { - // Look for a blocked goroutine which can be unblocked. - blocked := h.blocked[:0] - unblocked := false - for _, b := range h.blocked { - if !unblocked && b.f() { - unblocked = true - close(b.ch) - } else { - blocked = append(blocked, b) - } - } - h.blocked = blocked - - // Count goroutines blocked on condition variables. - condwait := 0 - for _, count := range h.condwait { - condwait += count - } - - if h.total > condwait+len(blocked) { - h.active <- struct{}{} - return true - } else { - h.inactive <- struct{}{} - return false - } -} - -// goRun starts a new goroutine. -func (h *testSyncHooks) goRun(f func()) { - h.lock() - h.total++ - h.unlock() - go func() { - defer func() { - h.lock() - h.total-- - h.unlock() - }() - f() - }() -} - -// blockUntil indicates that a goroutine is blocked waiting for some condition to become true. -// It waits until f returns true before proceeding. -// -// Example usage: -// -// h.blockUntil(func() bool { -// // Is the context done yet? -// select { -// case <-ctx.Done(): -// default: -// return false -// } -// return true -// }) -// // Wait for the context to become done. -// <-ctx.Done() -// -// The function f passed to blockUntil must be non-blocking and idempotent. -func (h *testSyncHooks) blockUntil(f func() bool) { - if f() { - return - } - ch := make(chan struct{}) - h.lock() - h.blocked = append(h.blocked, &testBlockedGoroutine{ - f: f, - ch: ch, - }) - h.unlock() - <-ch -} - -// broadcast is sync.Cond.Broadcast. -func (h *testSyncHooks) condBroadcast(cond *sync.Cond) { - h.lock() - delete(h.condwait, cond) - h.unlock() - cond.Broadcast() -} - -// broadcast is sync.Cond.Wait. -func (h *testSyncHooks) condWait(cond *sync.Cond) { - h.lock() - h.condwait[cond]++ - h.unlock() -} - -// newTimer creates a new fake timer. -func (h *testSyncHooks) newTimer(d time.Duration) timer { - h.lock() - defer h.unlock() - t := &fakeTimer{ - hooks: h, - when: h.now.Add(d), - c: make(chan time.Time), - } - h.timers = append(h.timers, t) - return t -} - -// afterFunc creates a new fake AfterFunc timer. -func (h *testSyncHooks) afterFunc(d time.Duration, f func()) timer { - h.lock() - defer h.unlock() - t := &fakeTimer{ - hooks: h, - when: h.now.Add(d), - f: f, - } - h.timers = append(h.timers, t) - return t -} - -func (h *testSyncHooks) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) { - ctx, cancel := context.WithCancel(ctx) - t := h.afterFunc(d, cancel) - return ctx, func() { - t.Stop() - cancel() - } -} - -func (h *testSyncHooks) timeUntilEvent() time.Duration { - h.lock() - defer h.unlock() - var next time.Time - for _, t := range h.timers { - if next.IsZero() || t.when.Before(next) { - next = t.when - } - } - if d := next.Sub(h.now); d > 0 { - return d - } - return 0 -} - -// advance advances time and causes synthetic timers to fire. -func (h *testSyncHooks) advance(d time.Duration) { - h.lock() - defer h.unlock() - h.now = h.now.Add(d) - timers := h.timers[:0] - for _, t := range h.timers { - t := t // remove after go.mod depends on go1.22 - t.mu.Lock() - switch { - case t.when.After(h.now): - timers = append(timers, t) - case t.when.IsZero(): - // stopped timer - default: - t.when = time.Time{} - if t.c != nil { - close(t.c) - } - if t.f != nil { - h.total++ - go func() { - defer func() { - h.lock() - h.total-- - h.unlock() - }() - t.f() - }() - } - } - t.mu.Unlock() - } - h.timers = timers -} - -// A timer wraps a time.Timer, or a synthetic equivalent in tests. -// Unlike time.Timer, timer is single-use: The timer channel is closed when the timer expires. -type timer interface { - C() <-chan time.Time - Stop() bool - Reset(d time.Duration) bool -} - -// timeTimer implements timer using real time. -type timeTimer struct { - t *time.Timer - c chan time.Time -} - -// newTimeTimer creates a new timer using real time. -func newTimeTimer(d time.Duration) timer { - ch := make(chan time.Time) - t := time.AfterFunc(d, func() { - close(ch) - }) - return &timeTimer{t, ch} -} - -// newTimeAfterFunc creates an AfterFunc timer using real time. -func newTimeAfterFunc(d time.Duration, f func()) timer { - return &timeTimer{ - t: time.AfterFunc(d, f), - } -} - -func (t timeTimer) C() <-chan time.Time { return t.c } -func (t timeTimer) Stop() bool { return t.t.Stop() } -func (t timeTimer) Reset(d time.Duration) bool { return t.t.Reset(d) } - -// fakeTimer implements timer using fake time. -type fakeTimer struct { - hooks *testSyncHooks - - mu sync.Mutex - when time.Time // when the timer will fire - c chan time.Time // closed when the timer fires; mutually exclusive with f - f func() // called when the timer fires; mutually exclusive with c -} - -func (t *fakeTimer) C() <-chan time.Time { return t.c } - -func (t *fakeTimer) Stop() bool { - t.mu.Lock() - defer t.mu.Unlock() - stopped := t.when.IsZero() - t.when = time.Time{} - return stopped -} - -func (t *fakeTimer) Reset(d time.Duration) bool { - if t.c != nil || t.f == nil { - panic("fakeTimer only supports Reset on AfterFunc timers") - } - t.mu.Lock() - defer t.mu.Unlock() - t.hooks.lock() - defer t.hooks.unlock() - active := !t.when.IsZero() - t.when = t.hooks.now.Add(d) - if !active { - t.hooks.timers = append(t.hooks.timers, t) - } - return active -} diff --git a/vendor/golang.org/x/net/http2/timer.go b/vendor/golang.org/x/net/http2/timer.go new file mode 100644 index 0000000000..0b1c17b812 --- /dev/null +++ b/vendor/golang.org/x/net/http2/timer.go @@ -0,0 +1,20 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +package http2 + +import "time" + +// A timer is a time.Timer, as an interface which can be replaced in tests. +type timer = interface { + C() <-chan time.Time + Reset(d time.Duration) bool + Stop() bool +} + +// timeTimer adapts a time.Timer to the timer interface. +type timeTimer struct { + *time.Timer +} + +func (t timeTimer) C() <-chan time.Time { return t.Timer.C } diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index ce375c8c75..61f511f97a 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -185,7 +185,45 @@ type Transport struct { connPoolOnce sync.Once connPoolOrDef ClientConnPool // non-nil version of ConnPool - syncHooks *testSyncHooks + *transportTestHooks +} + +// Hook points used for testing. +// Outside of tests, t.transportTestHooks is nil and these all have minimal implementations. +// Inside tests, see the testSyncHooks function docs. + +type transportTestHooks struct { + newclientconn func(*ClientConn) + group synctestGroupInterface +} + +func (t *Transport) markNewGoroutine() { + if t != nil && t.transportTestHooks != nil { + t.transportTestHooks.group.Join() + } +} + +// newTimer creates a new time.Timer, or a synthetic timer in tests. +func (t *Transport) newTimer(d time.Duration) timer { + if t.transportTestHooks != nil { + return t.transportTestHooks.group.NewTimer(d) + } + return timeTimer{time.NewTimer(d)} +} + +// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests. +func (t *Transport) afterFunc(d time.Duration, f func()) timer { + if t.transportTestHooks != nil { + return t.transportTestHooks.group.AfterFunc(d, f) + } + return timeTimer{time.AfterFunc(d, f)} +} + +func (t *Transport) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) { + if t.transportTestHooks != nil { + return t.transportTestHooks.group.ContextWithTimeout(ctx, d) + } + return context.WithTimeout(ctx, d) } func (t *Transport) maxHeaderListSize() uint32 { @@ -352,60 +390,6 @@ type ClientConn struct { werr error // first write error that has occurred hbuf bytes.Buffer // HPACK encoder writes into this henc *hpack.Encoder - - syncHooks *testSyncHooks // can be nil -} - -// Hook points used for testing. -// Outside of tests, cc.syncHooks is nil and these all have minimal implementations. -// Inside tests, see the testSyncHooks function docs. - -// goRun starts a new goroutine. -func (cc *ClientConn) goRun(f func()) { - if cc.syncHooks != nil { - cc.syncHooks.goRun(f) - return - } - go f() -} - -// condBroadcast is cc.cond.Broadcast. -func (cc *ClientConn) condBroadcast() { - if cc.syncHooks != nil { - cc.syncHooks.condBroadcast(cc.cond) - } - cc.cond.Broadcast() -} - -// condWait is cc.cond.Wait. -func (cc *ClientConn) condWait() { - if cc.syncHooks != nil { - cc.syncHooks.condWait(cc.cond) - } - cc.cond.Wait() -} - -// newTimer creates a new time.Timer, or a synthetic timer in tests. -func (cc *ClientConn) newTimer(d time.Duration) timer { - if cc.syncHooks != nil { - return cc.syncHooks.newTimer(d) - } - return newTimeTimer(d) -} - -// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests. -func (cc *ClientConn) afterFunc(d time.Duration, f func()) timer { - if cc.syncHooks != nil { - return cc.syncHooks.afterFunc(d, f) - } - return newTimeAfterFunc(d, f) -} - -func (cc *ClientConn) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) { - if cc.syncHooks != nil { - return cc.syncHooks.contextWithTimeout(ctx, d) - } - return context.WithTimeout(ctx, d) } // clientStream is the state for a single HTTP/2 stream. One of these @@ -487,7 +471,7 @@ func (cs *clientStream) abortStreamLocked(err error) { // TODO(dneil): Clean up tests where cs.cc.cond is nil. if cs.cc.cond != nil { // Wake up writeRequestBody if it is waiting on flow control. - cs.cc.condBroadcast() + cs.cc.cond.Broadcast() } } @@ -497,7 +481,7 @@ func (cs *clientStream) abortRequestBodyWrite() { defer cc.mu.Unlock() if cs.reqBody != nil && cs.reqBodyClosed == nil { cs.closeReqBodyLocked() - cc.condBroadcast() + cc.cond.Broadcast() } } @@ -507,10 +491,11 @@ func (cs *clientStream) closeReqBodyLocked() { } cs.reqBodyClosed = make(chan struct{}) reqBodyClosed := cs.reqBodyClosed - cs.cc.goRun(func() { + go func() { + cs.cc.t.markNewGoroutine() cs.reqBody.Close() close(reqBodyClosed) - }) + }() } type stickyErrWriter struct { @@ -626,21 +611,7 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res backoff := float64(uint(1) << (uint(retry) - 1)) backoff += backoff * (0.1 * mathrand.Float64()) d := time.Second * time.Duration(backoff) - var tm timer - if t.syncHooks != nil { - tm = t.syncHooks.newTimer(d) - t.syncHooks.blockUntil(func() bool { - select { - case <-tm.C(): - case <-req.Context().Done(): - default: - return false - } - return true - }) - } else { - tm = newTimeTimer(d) - } + tm := t.newTimer(d) select { case <-tm.C(): t.vlogf("RoundTrip retrying after failure: %v", roundTripErr) @@ -725,8 +696,8 @@ func canRetryError(err error) bool { } func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse bool) (*ClientConn, error) { - if t.syncHooks != nil { - return t.newClientConn(nil, singleUse, t.syncHooks) + if t.transportTestHooks != nil { + return t.newClientConn(nil, singleUse) } host, _, err := net.SplitHostPort(addr) if err != nil { @@ -736,7 +707,7 @@ func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse b if err != nil { return nil, err } - return t.newClientConn(tconn, singleUse, nil) + return t.newClientConn(tconn, singleUse) } func (t *Transport) newTLSConfig(host string) *tls.Config { @@ -802,10 +773,10 @@ func (t *Transport) maxEncoderHeaderTableSize() uint32 { } func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) { - return t.newClientConn(c, t.disableKeepAlives(), nil) + return t.newClientConn(c, t.disableKeepAlives()) } -func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHooks) (*ClientConn, error) { +func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, error) { cc := &ClientConn{ t: t, tconn: c, @@ -820,16 +791,12 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHoo wantSettingsAck: true, pings: make(map[[8]byte]chan struct{}), reqHeaderMu: make(chan struct{}, 1), - syncHooks: hooks, } - if hooks != nil { - hooks.newclientconn(cc) + if t.transportTestHooks != nil { + t.markNewGoroutine() + t.transportTestHooks.newclientconn(cc) c = cc.tconn } - if d := t.idleConnTimeout(); d != 0 { - cc.idleTimeout = d - cc.idleTimer = cc.afterFunc(d, cc.onIdleTimeout) - } if VerboseLogs { t.vlogf("http2: Transport creating client conn %p to %v", cc, c.RemoteAddr()) } @@ -860,10 +827,6 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHoo cc.henc.SetMaxDynamicTableSizeLimit(t.maxEncoderHeaderTableSize()) cc.peerMaxHeaderTableSize = initialHeaderTableSize - if t.AllowHTTP { - cc.nextStreamID = 3 - } - if cs, ok := c.(connectionStater); ok { state := cs.ConnectionState() cc.tlsState = &state @@ -893,7 +856,13 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHoo return nil, cc.werr } - cc.goRun(cc.readLoop) + // Start the idle timer after the connection is fully initialized. + if d := t.idleConnTimeout(); d != 0 { + cc.idleTimeout = d + cc.idleTimer = t.afterFunc(d, cc.onIdleTimeout) + } + + go cc.readLoop() return cc, nil } @@ -901,7 +870,7 @@ func (cc *ClientConn) healthCheck() { pingTimeout := cc.t.pingTimeout() // We don't need to periodically ping in the health check, because the readLoop of ClientConn will // trigger the healthCheck again if there is no frame received. - ctx, cancel := cc.contextWithTimeout(context.Background(), pingTimeout) + ctx, cancel := cc.t.contextWithTimeout(context.Background(), pingTimeout) defer cancel() cc.vlogf("http2: Transport sending health check") err := cc.Ping(ctx) @@ -936,7 +905,20 @@ func (cc *ClientConn) setGoAway(f *GoAwayFrame) { } last := f.LastStreamID for streamID, cs := range cc.streams { - if streamID > last { + if streamID <= last { + // The server's GOAWAY indicates that it received this stream. + // It will either finish processing it, or close the connection + // without doing so. Either way, leave the stream alone for now. + continue + } + if streamID == 1 && cc.goAway.ErrCode != ErrCodeNo { + // Don't retry the first stream on a connection if we get a non-NO error. + // If the server is sending an error on a new connection, + // retrying the request on a new one probably isn't going to work. + cs.abortStreamLocked(fmt.Errorf("http2: Transport received GOAWAY from server ErrCode:%v", cc.goAway.ErrCode)) + } else { + // Aborting the stream with errClentConnGotGoAway indicates that + // the request should be retried on a new connection. cs.abortStreamLocked(errClientConnGotGoAway) } } @@ -1131,7 +1113,8 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { // Wait for all in-flight streams to complete or connection to close done := make(chan struct{}) cancelled := false // guarded by cc.mu - cc.goRun(func() { + go func() { + cc.t.markNewGoroutine() cc.mu.Lock() defer cc.mu.Unlock() for { @@ -1143,9 +1126,9 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { if cancelled { break } - cc.condWait() + cc.cond.Wait() } - }) + }() shutdownEnterWaitStateHook() select { case <-done: @@ -1155,7 +1138,7 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { cc.mu.Lock() // Free the goroutine above cancelled = true - cc.condBroadcast() + cc.cond.Broadcast() cc.mu.Unlock() return ctx.Err() } @@ -1193,7 +1176,7 @@ func (cc *ClientConn) closeForError(err error) { for _, cs := range cc.streams { cs.abortStreamLocked(err) } - cc.condBroadcast() + cc.cond.Broadcast() cc.mu.Unlock() cc.closeConn() } @@ -1308,23 +1291,30 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) respHeaderRecv: make(chan struct{}), donec: make(chan struct{}), } - cc.goRun(func() { - cs.doRequest(req) - }) + + // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere? + if !cc.t.disableCompression() && + req.Header.Get("Accept-Encoding") == "" && + req.Header.Get("Range") == "" && + !cs.isHead { + // Request gzip only, not deflate. Deflate is ambiguous and + // not as universally supported anyway. + // See: https://zlib.net/zlib_faq.html#faq39 + // + // Note that we don't request this for HEAD requests, + // due to a bug in nginx: + // http://trac.nginx.org/nginx/ticket/358 + // https://golang.org/issue/5522 + // + // We don't request gzip if the request is for a range, since + // auto-decoding a portion of a gzipped document will just fail + // anyway. See https://golang.org/issue/8923 + cs.requestedGzip = true + } + + go cs.doRequest(req, streamf) waitDone := func() error { - if cc.syncHooks != nil { - cc.syncHooks.blockUntil(func() bool { - select { - case <-cs.donec: - case <-ctx.Done(): - case <-cs.reqCancel: - default: - return false - } - return true - }) - } select { case <-cs.donec: return nil @@ -1385,24 +1375,7 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) return err } - if streamf != nil { - streamf(cs) - } - for { - if cc.syncHooks != nil { - cc.syncHooks.blockUntil(func() bool { - select { - case <-cs.respHeaderRecv: - case <-cs.abort: - case <-ctx.Done(): - case <-cs.reqCancel: - default: - return false - } - return true - }) - } select { case <-cs.respHeaderRecv: return handleResponseHeaders() @@ -1432,8 +1405,9 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) // doRequest runs for the duration of the request lifetime. // // It sends the request and performs post-request cleanup (closing Request.Body, etc.). -func (cs *clientStream) doRequest(req *http.Request) { - err := cs.writeRequest(req) +func (cs *clientStream) doRequest(req *http.Request, streamf func(*clientStream)) { + cs.cc.t.markNewGoroutine() + err := cs.writeRequest(req, streamf) cs.cleanupWriteRequest(err) } @@ -1444,7 +1418,7 @@ func (cs *clientStream) doRequest(req *http.Request) { // // It returns non-nil if the request ends otherwise. // If the returned error is StreamError, the error Code may be used in resetting the stream. -func (cs *clientStream) writeRequest(req *http.Request) (err error) { +func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStream)) (err error) { cc := cs.cc ctx := cs.ctx @@ -1458,21 +1432,6 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) { if cc.reqHeaderMu == nil { panic("RoundTrip on uninitialized ClientConn") // for tests } - var newStreamHook func(*clientStream) - if cc.syncHooks != nil { - newStreamHook = cc.syncHooks.newstream - cc.syncHooks.blockUntil(func() bool { - select { - case cc.reqHeaderMu <- struct{}{}: - <-cc.reqHeaderMu - case <-cs.reqCancel: - case <-ctx.Done(): - default: - return false - } - return true - }) - } select { case cc.reqHeaderMu <- struct{}{}: case <-cs.reqCancel: @@ -1497,28 +1456,8 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) { } cc.mu.Unlock() - if newStreamHook != nil { - newStreamHook(cs) - } - - // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere? - if !cc.t.disableCompression() && - req.Header.Get("Accept-Encoding") == "" && - req.Header.Get("Range") == "" && - !cs.isHead { - // Request gzip only, not deflate. Deflate is ambiguous and - // not as universally supported anyway. - // See: https://zlib.net/zlib_faq.html#faq39 - // - // Note that we don't request this for HEAD requests, - // due to a bug in nginx: - // http://trac.nginx.org/nginx/ticket/358 - // https://golang.org/issue/5522 - // - // We don't request gzip if the request is for a range, since - // auto-decoding a portion of a gzipped document will just fail - // anyway. See https://golang.org/issue/8923 - cs.requestedGzip = true + if streamf != nil { + streamf(cs) } continueTimeout := cc.t.expectContinueTimeout() @@ -1581,7 +1520,7 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) { var respHeaderTimer <-chan time.Time var respHeaderRecv chan struct{} if d := cc.responseHeaderTimeout(); d != 0 { - timer := cc.newTimer(d) + timer := cc.t.newTimer(d) defer timer.Stop() respHeaderTimer = timer.C() respHeaderRecv = cs.respHeaderRecv @@ -1590,21 +1529,6 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) { // or until the request is aborted (via context, error, or otherwise), // whichever comes first. for { - if cc.syncHooks != nil { - cc.syncHooks.blockUntil(func() bool { - select { - case <-cs.peerClosed: - case <-respHeaderTimer: - case <-respHeaderRecv: - case <-cs.abort: - case <-ctx.Done(): - case <-cs.reqCancel: - default: - return false - } - return true - }) - } select { case <-cs.peerClosed: return nil @@ -1753,7 +1677,7 @@ func (cc *ClientConn) awaitOpenSlotForStreamLocked(cs *clientStream) error { return nil } cc.pendingRequests++ - cc.condWait() + cc.cond.Wait() cc.pendingRequests-- select { case <-cs.abort: @@ -2015,7 +1939,7 @@ func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error) cs.flow.take(take) return take, nil } - cc.condWait() + cc.cond.Wait() } } @@ -2298,7 +2222,7 @@ func (cc *ClientConn) forgetStreamID(id uint32) { } // Wake up writeRequestBody via clientStream.awaitFlowControl and // wake up RoundTrip if there is a pending request. - cc.condBroadcast() + cc.cond.Broadcast() closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives() || cc.goAway != nil if closeOnIdle && cc.streamsReserved == 0 && len(cc.streams) == 0 { @@ -2320,6 +2244,7 @@ type clientConnReadLoop struct { // readLoop runs in its own goroutine and reads and dispatches frames. func (cc *ClientConn) readLoop() { + cc.t.markNewGoroutine() rl := &clientConnReadLoop{cc: cc} defer rl.cleanup() cc.readerErr = rl.run() @@ -2386,7 +2311,7 @@ func (rl *clientConnReadLoop) cleanup() { cs.abortStreamLocked(err) } } - cc.condBroadcast() + cc.cond.Broadcast() cc.mu.Unlock() } @@ -2423,7 +2348,7 @@ func (rl *clientConnReadLoop) run() error { readIdleTimeout := cc.t.ReadIdleTimeout var t timer if readIdleTimeout != 0 { - t = cc.afterFunc(readIdleTimeout, cc.healthCheck) + t = cc.t.afterFunc(readIdleTimeout, cc.healthCheck) } for { f, err := cc.fr.ReadFrame() @@ -3021,7 +2946,7 @@ func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { for _, cs := range cc.streams { cs.flow.add(delta) } - cc.condBroadcast() + cc.cond.Broadcast() cc.initialWindowSize = s.Val case SettingHeaderTableSize: @@ -3076,7 +3001,7 @@ func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error { return ConnectionError(ErrCodeFlowControl) } - cc.condBroadcast() + cc.cond.Broadcast() return nil } @@ -3120,7 +3045,8 @@ func (cc *ClientConn) Ping(ctx context.Context) error { } var pingError error errc := make(chan struct{}) - cc.goRun(func() { + go func() { + cc.t.markNewGoroutine() cc.wmu.Lock() defer cc.wmu.Unlock() if pingError = cc.fr.WritePing(false, p); pingError != nil { @@ -3131,20 +3057,7 @@ func (cc *ClientConn) Ping(ctx context.Context) error { close(errc) return } - }) - if cc.syncHooks != nil { - cc.syncHooks.blockUntil(func() bool { - select { - case <-c: - case <-errc: - case <-ctx.Done(): - case <-cc.readerDone: - default: - return false - } - return true - }) - } + }() select { case <-c: return nil diff --git a/vendor/golang.org/x/net/http2/writesched_priority.go b/vendor/golang.org/x/net/http2/writesched_priority.go index 0a242c669e..f6783339d1 100644 --- a/vendor/golang.org/x/net/http2/writesched_priority.go +++ b/vendor/golang.org/x/net/http2/writesched_priority.go @@ -443,8 +443,8 @@ func (ws *priorityWriteScheduler) addClosedOrIdleNode(list *[]*priorityNode, max } func (ws *priorityWriteScheduler) removeNode(n *priorityNode) { - for k := n.kids; k != nil; k = k.next { - k.setParent(n.parent) + for n.kids != nil { + n.kids.setParent(n.parent) } n.setParent(nil) delete(ws.nodes, n.id) diff --git a/vendor/golang.org/x/oauth2/deviceauth.go b/vendor/golang.org/x/oauth2/deviceauth.go new file mode 100644 index 0000000000..e99c92f39c --- /dev/null +++ b/vendor/golang.org/x/oauth2/deviceauth.go @@ -0,0 +1,198 @@ +package oauth2 + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strings" + "time" + + "golang.org/x/oauth2/internal" +) + +// https://datatracker.ietf.org/doc/html/rfc8628#section-3.5 +const ( + errAuthorizationPending = "authorization_pending" + errSlowDown = "slow_down" + errAccessDenied = "access_denied" + errExpiredToken = "expired_token" +) + +// DeviceAuthResponse describes a successful RFC 8628 Device Authorization Response +// https://datatracker.ietf.org/doc/html/rfc8628#section-3.2 +type DeviceAuthResponse struct { + // DeviceCode + DeviceCode string `json:"device_code"` + // UserCode is the code the user should enter at the verification uri + UserCode string `json:"user_code"` + // VerificationURI is where user should enter the user code + VerificationURI string `json:"verification_uri"` + // VerificationURIComplete (if populated) includes the user code in the verification URI. This is typically shown to the user in non-textual form, such as a QR code. + VerificationURIComplete string `json:"verification_uri_complete,omitempty"` + // Expiry is when the device code and user code expire + Expiry time.Time `json:"expires_in,omitempty"` + // Interval is the duration in seconds that Poll should wait between requests + Interval int64 `json:"interval,omitempty"` +} + +func (d DeviceAuthResponse) MarshalJSON() ([]byte, error) { + type Alias DeviceAuthResponse + var expiresIn int64 + if !d.Expiry.IsZero() { + expiresIn = int64(time.Until(d.Expiry).Seconds()) + } + return json.Marshal(&struct { + ExpiresIn int64 `json:"expires_in,omitempty"` + *Alias + }{ + ExpiresIn: expiresIn, + Alias: (*Alias)(&d), + }) + +} + +func (c *DeviceAuthResponse) UnmarshalJSON(data []byte) error { + type Alias DeviceAuthResponse + aux := &struct { + ExpiresIn int64 `json:"expires_in"` + // workaround misspelling of verification_uri + VerificationURL string `json:"verification_url"` + *Alias + }{ + Alias: (*Alias)(c), + } + if err := json.Unmarshal(data, &aux); err != nil { + return err + } + if aux.ExpiresIn != 0 { + c.Expiry = time.Now().UTC().Add(time.Second * time.Duration(aux.ExpiresIn)) + } + if c.VerificationURI == "" { + c.VerificationURI = aux.VerificationURL + } + return nil +} + +// DeviceAuth returns a device auth struct which contains a device code +// and authorization information provided for users to enter on another device. +func (c *Config) DeviceAuth(ctx context.Context, opts ...AuthCodeOption) (*DeviceAuthResponse, error) { + // https://datatracker.ietf.org/doc/html/rfc8628#section-3.1 + v := url.Values{ + "client_id": {c.ClientID}, + } + if len(c.Scopes) > 0 { + v.Set("scope", strings.Join(c.Scopes, " ")) + } + for _, opt := range opts { + opt.setValue(v) + } + return retrieveDeviceAuth(ctx, c, v) +} + +func retrieveDeviceAuth(ctx context.Context, c *Config, v url.Values) (*DeviceAuthResponse, error) { + if c.Endpoint.DeviceAuthURL == "" { + return nil, errors.New("endpoint missing DeviceAuthURL") + } + + req, err := http.NewRequest("POST", c.Endpoint.DeviceAuthURL, strings.NewReader(v.Encode())) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + req.Header.Set("Accept", "application/json") + + t := time.Now() + r, err := internal.ContextClient(ctx).Do(req) + if err != nil { + return nil, err + } + + body, err := io.ReadAll(io.LimitReader(r.Body, 1<<20)) + if err != nil { + return nil, fmt.Errorf("oauth2: cannot auth device: %v", err) + } + if code := r.StatusCode; code < 200 || code > 299 { + return nil, &RetrieveError{ + Response: r, + Body: body, + } + } + + da := &DeviceAuthResponse{} + err = json.Unmarshal(body, &da) + if err != nil { + return nil, fmt.Errorf("unmarshal %s", err) + } + + if !da.Expiry.IsZero() { + // Make a small adjustment to account for time taken by the request + da.Expiry = da.Expiry.Add(-time.Since(t)) + } + + return da, nil +} + +// DeviceAccessToken polls the server to exchange a device code for a token. +func (c *Config) DeviceAccessToken(ctx context.Context, da *DeviceAuthResponse, opts ...AuthCodeOption) (*Token, error) { + if !da.Expiry.IsZero() { + var cancel context.CancelFunc + ctx, cancel = context.WithDeadline(ctx, da.Expiry) + defer cancel() + } + + // https://datatracker.ietf.org/doc/html/rfc8628#section-3.4 + v := url.Values{ + "client_id": {c.ClientID}, + "grant_type": {"urn:ietf:params:oauth:grant-type:device_code"}, + "device_code": {da.DeviceCode}, + } + if len(c.Scopes) > 0 { + v.Set("scope", strings.Join(c.Scopes, " ")) + } + for _, opt := range opts { + opt.setValue(v) + } + + // "If no value is provided, clients MUST use 5 as the default." + // https://datatracker.ietf.org/doc/html/rfc8628#section-3.2 + interval := da.Interval + if interval == 0 { + interval = 5 + } + + ticker := time.NewTicker(time.Duration(interval) * time.Second) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return nil, ctx.Err() + case <-ticker.C: + tok, err := retrieveToken(ctx, c, v) + if err == nil { + return tok, nil + } + + e, ok := err.(*RetrieveError) + if !ok { + return nil, err + } + switch e.ErrorCode { + case errSlowDown: + // https://datatracker.ietf.org/doc/html/rfc8628#section-3.5 + // "the interval MUST be increased by 5 seconds for this and all subsequent requests" + interval += 5 + ticker.Reset(time.Duration(interval) * time.Second) + case errAuthorizationPending: + // Do nothing. + case errAccessDenied, errExpiredToken: + fallthrough + default: + return tok, err + } + } + } +} diff --git a/vendor/golang.org/x/oauth2/google/appengine.go b/vendor/golang.org/x/oauth2/google/appengine.go index feb1157b15..564920bd42 100644 --- a/vendor/golang.org/x/oauth2/google/appengine.go +++ b/vendor/golang.org/x/oauth2/google/appengine.go @@ -6,16 +6,13 @@ package google import ( "context" - "time" + "log" + "sync" "golang.org/x/oauth2" ) -// Set at init time by appengine_gen1.go. If nil, we're not on App Engine standard first generation (<= Go 1.9) or App Engine flexible. -var appengineTokenFunc func(c context.Context, scopes ...string) (token string, expiry time.Time, err error) - -// Set at init time by appengine_gen1.go. If nil, we're not on App Engine standard first generation (<= Go 1.9) or App Engine flexible. -var appengineAppIDFunc func(c context.Context) string +var logOnce sync.Once // only spam about deprecation once // AppEngineTokenSource returns a token source that fetches tokens from either // the current application's service account or from the metadata server, @@ -23,8 +20,10 @@ var appengineAppIDFunc func(c context.Context) string // details. If you are implementing a 3-legged OAuth 2.0 flow on App Engine that // involves user accounts, see oauth2.Config instead. // -// First generation App Engine runtimes (<= Go 1.9): -// AppEngineTokenSource returns a token source that fetches tokens issued to the +// The current version of this library requires at least Go 1.17 to build, +// so first generation App Engine runtimes (<= Go 1.9) are unsupported. +// Previously, on first generation App Engine runtimes, AppEngineTokenSource +// returned a token source that fetches tokens issued to the // current App Engine application's service account. The provided context must have // come from appengine.NewContext. // @@ -34,5 +33,8 @@ var appengineAppIDFunc func(c context.Context) string // context and scopes are not used. Please use DefaultTokenSource (or ComputeTokenSource, // which DefaultTokenSource will use in this case) instead. func AppEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { - return appEngineTokenSource(ctx, scope...) + logOnce.Do(func() { + log.Print("google: AppEngineTokenSource is deprecated on App Engine standard second generation runtimes (>= Go 1.11) and App Engine flexible. Please use DefaultTokenSource or ComputeTokenSource.") + }) + return ComputeTokenSource("") } diff --git a/vendor/golang.org/x/oauth2/google/appengine_gen1.go b/vendor/golang.org/x/oauth2/google/appengine_gen1.go deleted file mode 100644 index 16c6c6b90c..0000000000 --- a/vendor/golang.org/x/oauth2/google/appengine_gen1.go +++ /dev/null @@ -1,78 +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. - -//go:build appengine -// +build appengine - -// This file applies to App Engine first generation runtimes (<= Go 1.9). - -package google - -import ( - "context" - "sort" - "strings" - "sync" - - "golang.org/x/oauth2" - "google.golang.org/appengine" -) - -func init() { - appengineTokenFunc = appengine.AccessToken - appengineAppIDFunc = appengine.AppID -} - -// See comment on AppEngineTokenSource in appengine.go. -func appEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { - scopes := append([]string{}, scope...) - sort.Strings(scopes) - return &gaeTokenSource{ - ctx: ctx, - scopes: scopes, - key: strings.Join(scopes, " "), - } -} - -// aeTokens helps the fetched tokens to be reused until their expiration. -var ( - aeTokensMu sync.Mutex - aeTokens = make(map[string]*tokenLock) // key is space-separated scopes -) - -type tokenLock struct { - mu sync.Mutex // guards t; held while fetching or updating t - t *oauth2.Token -} - -type gaeTokenSource struct { - ctx context.Context - scopes []string - key string // to aeTokens map; space-separated scopes -} - -func (ts *gaeTokenSource) Token() (*oauth2.Token, error) { - aeTokensMu.Lock() - tok, ok := aeTokens[ts.key] - if !ok { - tok = &tokenLock{} - aeTokens[ts.key] = tok - } - aeTokensMu.Unlock() - - tok.mu.Lock() - defer tok.mu.Unlock() - if tok.t.Valid() { - return tok.t, nil - } - access, exp, err := appengineTokenFunc(ts.ctx, ts.scopes...) - if err != nil { - return nil, err - } - tok.t = &oauth2.Token{ - AccessToken: access, - Expiry: exp, - } - return tok.t, nil -} diff --git a/vendor/golang.org/x/oauth2/google/appengine_gen2_flex.go b/vendor/golang.org/x/oauth2/google/appengine_gen2_flex.go deleted file mode 100644 index a7e27b3d29..0000000000 --- a/vendor/golang.org/x/oauth2/google/appengine_gen2_flex.go +++ /dev/null @@ -1,28 +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. - -//go:build !appengine -// +build !appengine - -// This file applies to App Engine second generation runtimes (>= Go 1.11) and App Engine flexible. - -package google - -import ( - "context" - "log" - "sync" - - "golang.org/x/oauth2" -) - -var logOnce sync.Once // only spam about deprecation once - -// See comment on AppEngineTokenSource in appengine.go. -func appEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { - logOnce.Do(func() { - log.Print("google: AppEngineTokenSource is deprecated on App Engine standard second generation runtimes (>= Go 1.11) and App Engine flexible. Please use DefaultTokenSource or ComputeTokenSource.") - }) - return ComputeTokenSource("") -} diff --git a/vendor/golang.org/x/oauth2/google/default.go b/vendor/golang.org/x/oauth2/google/default.go index b3e8783cc5..df958359a8 100644 --- a/vendor/golang.org/x/oauth2/google/default.go +++ b/vendor/golang.org/x/oauth2/google/default.go @@ -8,11 +8,11 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" "net/http" "os" "path/filepath" "runtime" + "sync" "time" "cloud.google.com/go/compute/metadata" @@ -20,7 +20,10 @@ import ( "golang.org/x/oauth2/authhandler" ) -const adcSetupURL = "https://cloud.google.com/docs/authentication/external/set-up-adc" +const ( + adcSetupURL = "https://cloud.google.com/docs/authentication/external/set-up-adc" + defaultUniverseDomain = "googleapis.com" +) // Credentials holds Google credentials, including "Application Default Credentials". // For more details, see: @@ -38,6 +41,64 @@ type Credentials struct { // environment and not with a credentials file, e.g. when code is // running on Google Cloud Platform. JSON []byte + + // UniverseDomainProvider returns the default service domain for a given + // Cloud universe. Optional. + // + // On GCE, UniverseDomainProvider should return the universe domain value + // from Google Compute Engine (GCE)'s metadata server. See also [The attached service + // account](https://cloud.google.com/docs/authentication/application-default-credentials#attached-sa). + // If the GCE metadata server returns a 404 error, the default universe + // domain value should be returned. If the GCE metadata server returns an + // error other than 404, the error should be returned. + UniverseDomainProvider func() (string, error) + + udMu sync.Mutex // guards universeDomain + // universeDomain is the default service domain for a given Cloud universe. + universeDomain string +} + +// UniverseDomain returns the default service domain for a given Cloud universe. +// +// The default value is "googleapis.com". +// +// Deprecated: Use instead (*Credentials).GetUniverseDomain(), which supports +// obtaining the universe domain when authenticating via the GCE metadata server. +// Unlike GetUniverseDomain, this method, UniverseDomain, will always return the +// default value when authenticating via the GCE metadata server. +// See also [The attached service account](https://cloud.google.com/docs/authentication/application-default-credentials#attached-sa). +func (c *Credentials) UniverseDomain() string { + if c.universeDomain == "" { + return defaultUniverseDomain + } + return c.universeDomain +} + +// GetUniverseDomain returns the default service domain for a given Cloud +// universe. If present, UniverseDomainProvider will be invoked and its return +// value will be cached. +// +// The default value is "googleapis.com". +func (c *Credentials) GetUniverseDomain() (string, error) { + c.udMu.Lock() + defer c.udMu.Unlock() + if c.universeDomain == "" && c.UniverseDomainProvider != nil { + // On Google Compute Engine, an App Engine standard second generation + // runtime, or App Engine flexible, use an externally provided function + // to request the universe domain from the metadata server. + ud, err := c.UniverseDomainProvider() + if err != nil { + return "", err + } + c.universeDomain = ud + } + // If no UniverseDomainProvider (meaning not on Google Compute Engine), or + // in case of any (non-error) empty return value from + // UniverseDomainProvider, set the default universe domain. + if c.universeDomain == "" { + c.universeDomain = defaultUniverseDomain + } + return c.universeDomain, nil } // DefaultCredentials is the old name of Credentials. @@ -77,6 +138,12 @@ type CredentialsParams struct { // Note: This option is currently only respected when using credentials // fetched from the GCE metadata server. EarlyTokenRefresh time.Duration + + // UniverseDomain is the default service domain for a given Cloud universe. + // Only supported in authentication flows that support universe domains. + // This value takes precedence over a universe domain explicitly specified + // in a credentials config file or by the GCE metadata server. Optional. + UniverseDomain string } func (params CredentialsParams) deepCopy() CredentialsParams { @@ -121,9 +188,7 @@ func DefaultTokenSource(ctx context.Context, scope ...string) (oauth2.TokenSourc // 2. A JSON file in a location known to the gcloud command-line tool. // On Windows, this is %APPDATA%/gcloud/application_default_credentials.json. // On other systems, $HOME/.config/gcloud/application_default_credentials.json. -// 3. On Google App Engine standard first generation runtimes (<= Go 1.9) it uses -// the appengine.AccessToken function. -// 4. On Google Compute Engine, Google App Engine standard second generation runtimes +// 3. On Google Compute Engine, Google App Engine standard second generation runtimes // (>= Go 1.11), and Google App Engine flexible environment, it fetches // credentials from the metadata server. func FindDefaultCredentialsWithParams(ctx context.Context, params CredentialsParams) (*Credentials, error) { @@ -142,29 +207,31 @@ func FindDefaultCredentialsWithParams(ctx context.Context, params CredentialsPar // Second, try a well-known file. filename := wellKnownFile() - if creds, err := readCredentialsFile(ctx, filename, params); err == nil { - return creds, nil - } else if !os.IsNotExist(err) { - return nil, fmt.Errorf("google: error getting credentials using well-known file (%v): %v", filename, err) + if b, err := os.ReadFile(filename); err == nil { + return CredentialsFromJSONWithParams(ctx, b, params) } - // Third, if we're on a Google App Engine standard first generation runtime (<= Go 1.9) - // use those credentials. App Engine standard second generation runtimes (>= Go 1.11) - // and App Engine flexible use ComputeTokenSource and the metadata server. - if appengineTokenFunc != nil { - return &Credentials{ - ProjectID: appengineAppIDFunc(ctx), - TokenSource: AppEngineTokenSource(ctx, params.Scopes...), - }, nil - } - - // Fourth, if we're on Google Compute Engine, an App Engine standard second generation runtime, + // Third, if we're on Google Compute Engine, an App Engine standard second generation runtime, // or App Engine flexible, use the metadata server. if metadata.OnGCE() { id, _ := metadata.ProjectID() + universeDomainProvider := func() (string, error) { + universeDomain, err := metadata.Get("universe/universe_domain") + if err != nil { + if _, ok := err.(metadata.NotDefinedError); ok { + // http.StatusNotFound (404) + return defaultUniverseDomain, nil + } else { + return "", err + } + } + return universeDomain, nil + } return &Credentials{ - ProjectID: id, - TokenSource: computeTokenSource("", params.EarlyTokenRefresh, params.Scopes...), + ProjectID: id, + TokenSource: computeTokenSource("", params.EarlyTokenRefresh, params.Scopes...), + UniverseDomainProvider: universeDomainProvider, + universeDomain: params.UniverseDomain, }, nil } @@ -203,15 +270,26 @@ func CredentialsFromJSONWithParams(ctx context.Context, jsonData []byte, params if err := json.Unmarshal(jsonData, &f); err != nil { return nil, err } + + universeDomain := f.UniverseDomain + if params.UniverseDomain != "" { + universeDomain = params.UniverseDomain + } + // Authorized user credentials are only supported in the googleapis.com universe. + if f.Type == userCredentialsKey { + universeDomain = defaultUniverseDomain + } + ts, err := f.tokenSource(ctx, params) if err != nil { return nil, err } ts = newErrWrappingTokenSource(ts) return &Credentials{ - ProjectID: f.ProjectID, - TokenSource: ts, - JSON: jsonData, + ProjectID: f.ProjectID, + TokenSource: ts, + JSON: jsonData, + universeDomain: universeDomain, }, nil } @@ -231,7 +309,7 @@ func wellKnownFile() string { } func readCredentialsFile(ctx context.Context, filename string, params CredentialsParams) (*Credentials, error) { - b, err := ioutil.ReadFile(filename) + b, err := os.ReadFile(filename) if err != nil { return nil, err } diff --git a/vendor/golang.org/x/oauth2/google/doc.go b/vendor/golang.org/x/oauth2/google/doc.go index ca717634a3..830d268c1e 100644 --- a/vendor/golang.org/x/oauth2/google/doc.go +++ b/vendor/golang.org/x/oauth2/google/doc.go @@ -22,89 +22,9 @@ // the other by JWTConfigFromJSON. The returned Config can be used to obtain a TokenSource or // create an http.Client. // -// # Workload Identity Federation +// # Workload and Workforce Identity Federation // -// Using workload identity federation, your application can access Google Cloud -// resources from Amazon Web Services (AWS), Microsoft Azure or any identity -// provider that supports OpenID Connect (OIDC) or SAML 2.0. -// Traditionally, applications running outside Google Cloud have used service -// account keys to access Google Cloud resources. Using identity federation, -// you can allow your workload to impersonate a service account. -// This lets you access Google Cloud resources directly, eliminating the -// maintenance and security burden associated with service account keys. -// -// Follow the detailed instructions on how to configure Workload Identity Federation -// in various platforms: -// -// Amazon Web Services (AWS): https://cloud.google.com/iam/docs/workload-identity-federation-with-other-clouds#aws -// Microsoft Azure: https://cloud.google.com/iam/docs/workload-identity-federation-with-other-clouds#azure -// OIDC identity provider: https://cloud.google.com/iam/docs/workload-identity-federation-with-other-providers#oidc -// SAML 2.0 identity provider: https://cloud.google.com/iam/docs/workload-identity-federation-with-other-providers#saml -// -// For OIDC and SAML providers, the library can retrieve tokens in three ways: -// from a local file location (file-sourced credentials), from a server -// (URL-sourced credentials), or from a local executable (executable-sourced -// credentials). -// For file-sourced credentials, a background process needs to be continuously -// refreshing the file location with a new OIDC/SAML token prior to expiration. -// For tokens with one hour lifetimes, the token needs to be updated in the file -// every hour. The token can be stored directly as plain text or in JSON format. -// For URL-sourced credentials, a local server needs to host a GET endpoint to -// return the OIDC/SAML token. The response can be in plain text or JSON. -// Additional required request headers can also be specified. -// For executable-sourced credentials, an application needs to be available to -// output the OIDC/SAML token and other information in a JSON format. -// For more information on how these work (and how to implement -// executable-sourced credentials), please check out: -// https://cloud.google.com/iam/docs/workload-identity-federation-with-other-providers#create_a_credential_configuration -// -// Note that this library does not perform any validation on the token_url, token_info_url, -// or service_account_impersonation_url fields of the credential configuration. -// It is not recommended to use a credential configuration that you did not generate with -// the gcloud CLI unless you verify that the URL fields point to a googleapis.com domain. -// -// # Workforce Identity Federation -// -// Workforce identity federation lets you use an external identity provider (IdP) to -// authenticate and authorize a workforce—a group of users, such as employees, partners, -// and contractors—using IAM, so that the users can access Google Cloud services. -// Workforce identity federation extends Google Cloud's identity capabilities to support -// syncless, attribute-based single sign on. -// -// With workforce identity federation, your workforce can access Google Cloud resources -// using an external identity provider (IdP) that supports OpenID Connect (OIDC) or -// SAML 2.0 such as Azure Active Directory (Azure AD), Active Directory Federation -// Services (AD FS), Okta, and others. -// -// Follow the detailed instructions on how to configure Workload Identity Federation -// in various platforms: -// -// Azure AD: https://cloud.google.com/iam/docs/workforce-sign-in-azure-ad -// Okta: https://cloud.google.com/iam/docs/workforce-sign-in-okta -// OIDC identity provider: https://cloud.google.com/iam/docs/configuring-workforce-identity-federation#oidc -// SAML 2.0 identity provider: https://cloud.google.com/iam/docs/configuring-workforce-identity-federation#saml -// -// For workforce identity federation, the library can retrieve tokens in three ways: -// from a local file location (file-sourced credentials), from a server -// (URL-sourced credentials), or from a local executable (executable-sourced -// credentials). -// For file-sourced credentials, a background process needs to be continuously -// refreshing the file location with a new OIDC/SAML token prior to expiration. -// For tokens with one hour lifetimes, the token needs to be updated in the file -// every hour. The token can be stored directly as plain text or in JSON format. -// For URL-sourced credentials, a local server needs to host a GET endpoint to -// return the OIDC/SAML token. The response can be in plain text or JSON. -// Additional required request headers can also be specified. -// For executable-sourced credentials, an application needs to be available to -// output the OIDC/SAML token and other information in a JSON format. -// For more information on how these work (and how to implement -// executable-sourced credentials), please check out: -// https://cloud.google.com/iam/docs/workforce-obtaining-short-lived-credentials#generate_a_configuration_file_for_non-interactive_sign-in -// -// Note that this library does not perform any validation on the token_url, token_info_url, -// or service_account_impersonation_url fields of the credential configuration. -// It is not recommended to use a credential configuration that you did not generate with -// the gcloud CLI unless you verify that the URL fields point to a googleapis.com domain. +// For information on how to use Workload and Workforce Identity Federation, see [golang.org/x/oauth2/google/externalaccount]. // // # Credentials // diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccount/aws.go b/vendor/golang.org/x/oauth2/google/externalaccount/aws.go similarity index 77% rename from vendor/golang.org/x/oauth2/google/internal/externalaccount/aws.go rename to vendor/golang.org/x/oauth2/google/externalaccount/aws.go index 2bf3202b29..ca27c2e98c 100644 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/aws.go +++ b/vendor/golang.org/x/oauth2/google/externalaccount/aws.go @@ -26,22 +26,28 @@ import ( "golang.org/x/oauth2" ) -type awsSecurityCredentials struct { - AccessKeyID string `json:"AccessKeyID"` +// AwsSecurityCredentials models AWS security credentials. +type AwsSecurityCredentials struct { + // AccessKeyId is the AWS Access Key ID - Required. + AccessKeyID string `json:"AccessKeyID"` + // SecretAccessKey is the AWS Secret Access Key - Required. SecretAccessKey string `json:"SecretAccessKey"` - SecurityToken string `json:"Token"` + // SessionToken is the AWS Session token. This should be provided for temporary AWS security credentials - Optional. + SessionToken string `json:"Token"` } // awsRequestSigner is a utility class to sign http requests using a AWS V4 signature. type awsRequestSigner struct { RegionName string - AwsSecurityCredentials awsSecurityCredentials + AwsSecurityCredentials *AwsSecurityCredentials } // getenv aliases os.Getenv for testing var getenv = os.Getenv const ( + defaultRegionalCredentialVerificationUrl = "https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15" + // AWS Signature Version 4 signing algorithm identifier. awsAlgorithm = "AWS4-HMAC-SHA256" @@ -197,8 +203,8 @@ func (rs *awsRequestSigner) SignRequest(req *http.Request) error { signedRequest.Header.Add("host", requestHost(req)) - if rs.AwsSecurityCredentials.SecurityToken != "" { - signedRequest.Header.Add(awsSecurityTokenHeader, rs.AwsSecurityCredentials.SecurityToken) + if rs.AwsSecurityCredentials.SessionToken != "" { + signedRequest.Header.Add(awsSecurityTokenHeader, rs.AwsSecurityCredentials.SessionToken) } if signedRequest.Header.Get("date") == "" { @@ -251,16 +257,18 @@ func (rs *awsRequestSigner) generateAuthentication(req *http.Request, timestamp } type awsCredentialSource struct { - EnvironmentID string - RegionURL string - RegionalCredVerificationURL string - CredVerificationURL string - IMDSv2SessionTokenURL string - TargetResource string - requestSigner *awsRequestSigner - region string - ctx context.Context - client *http.Client + environmentID string + regionURL string + regionalCredVerificationURL string + credVerificationURL string + imdsv2SessionTokenURL string + targetResource string + requestSigner *awsRequestSigner + region string + ctx context.Context + client *http.Client + awsSecurityCredentialsSupplier AwsSecurityCredentialsSupplier + supplierOptions SupplierOptions } type awsRequestHeader struct { @@ -274,49 +282,6 @@ type awsRequest struct { Headers []awsRequestHeader `json:"headers"` } -func (cs awsCredentialSource) validateMetadataServers() error { - if err := cs.validateMetadataServer(cs.RegionURL, "region_url"); err != nil { - return err - } - if err := cs.validateMetadataServer(cs.CredVerificationURL, "url"); err != nil { - return err - } - return cs.validateMetadataServer(cs.IMDSv2SessionTokenURL, "imdsv2_session_token_url") -} - -var validHostnames []string = []string{"169.254.169.254", "fd00:ec2::254"} - -func (cs awsCredentialSource) isValidMetadataServer(metadataUrl string) bool { - if metadataUrl == "" { - // Zero value means use default, which is valid. - return true - } - - u, err := url.Parse(metadataUrl) - if err != nil { - // Unparseable URL means invalid - return false - } - - for _, validHostname := range validHostnames { - if u.Hostname() == validHostname { - // If it's one of the valid hostnames, everything is good - return true - } - } - - // hostname not found in our allowlist, so not valid - return false -} - -func (cs awsCredentialSource) validateMetadataServer(metadataUrl, urlName string) error { - if !cs.isValidMetadataServer(metadataUrl) { - return fmt.Errorf("oauth2/google: invalid hostname %s for %s", metadataUrl, urlName) - } - - return nil -} - func (cs awsCredentialSource) doRequest(req *http.Request) (*http.Response, error) { if cs.client == nil { cs.client = oauth2.NewClient(cs.ctx, nil) @@ -335,14 +300,25 @@ func canRetrieveSecurityCredentialFromEnvironment() bool { return getenv(awsAccessKeyId) != "" && getenv(awsSecretAccessKey) != "" } -func shouldUseMetadataServer() bool { - return !canRetrieveRegionFromEnvironment() || !canRetrieveSecurityCredentialFromEnvironment() +func (cs awsCredentialSource) shouldUseMetadataServer() bool { + return cs.awsSecurityCredentialsSupplier == nil && (!canRetrieveRegionFromEnvironment() || !canRetrieveSecurityCredentialFromEnvironment()) +} + +func (cs awsCredentialSource) credentialSourceType() string { + if cs.awsSecurityCredentialsSupplier != nil { + return "programmatic" + } + return "aws" } func (cs awsCredentialSource) subjectToken() (string, error) { + // Set Defaults + if cs.regionalCredVerificationURL == "" { + cs.regionalCredVerificationURL = defaultRegionalCredentialVerificationUrl + } if cs.requestSigner == nil { headers := make(map[string]string) - if shouldUseMetadataServer() { + if cs.shouldUseMetadataServer() { awsSessionToken, err := cs.getAWSSessionToken() if err != nil { return "", err @@ -357,8 +333,8 @@ func (cs awsCredentialSource) subjectToken() (string, error) { if err != nil { return "", err } - - if cs.region, err = cs.getRegion(headers); err != nil { + cs.region, err = cs.getRegion(headers) + if err != nil { return "", err } @@ -370,7 +346,7 @@ func (cs awsCredentialSource) subjectToken() (string, error) { // Generate the signed request to AWS STS GetCallerIdentity API. // Use the required regional endpoint. Otherwise, the request will fail. - req, err := http.NewRequest("POST", strings.Replace(cs.RegionalCredVerificationURL, "{region}", cs.region, 1), nil) + req, err := http.NewRequest("POST", strings.Replace(cs.regionalCredVerificationURL, "{region}", cs.region, 1), nil) if err != nil { return "", err } @@ -378,8 +354,8 @@ func (cs awsCredentialSource) subjectToken() (string, error) { // provider, with or without the HTTPS prefix. // Including this header as part of the signature is recommended to // ensure data integrity. - if cs.TargetResource != "" { - req.Header.Add("x-goog-cloud-target-resource", cs.TargetResource) + if cs.targetResource != "" { + req.Header.Add("x-goog-cloud-target-resource", cs.targetResource) } cs.requestSigner.SignRequest(req) @@ -426,11 +402,11 @@ func (cs awsCredentialSource) subjectToken() (string, error) { } func (cs *awsCredentialSource) getAWSSessionToken() (string, error) { - if cs.IMDSv2SessionTokenURL == "" { + if cs.imdsv2SessionTokenURL == "" { return "", nil } - req, err := http.NewRequest("PUT", cs.IMDSv2SessionTokenURL, nil) + req, err := http.NewRequest("PUT", cs.imdsv2SessionTokenURL, nil) if err != nil { return "", err } @@ -449,25 +425,29 @@ func (cs *awsCredentialSource) getAWSSessionToken() (string, error) { } if resp.StatusCode != 200 { - return "", fmt.Errorf("oauth2/google: unable to retrieve AWS session token - %s", string(respBody)) + return "", fmt.Errorf("oauth2/google/externalaccount: unable to retrieve AWS session token - %s", string(respBody)) } return string(respBody), nil } func (cs *awsCredentialSource) getRegion(headers map[string]string) (string, error) { + if cs.awsSecurityCredentialsSupplier != nil { + return cs.awsSecurityCredentialsSupplier.AwsRegion(cs.ctx, cs.supplierOptions) + } if canRetrieveRegionFromEnvironment() { if envAwsRegion := getenv(awsRegion); envAwsRegion != "" { + cs.region = envAwsRegion return envAwsRegion, nil } return getenv("AWS_DEFAULT_REGION"), nil } - if cs.RegionURL == "" { - return "", errors.New("oauth2/google: unable to determine AWS region") + if cs.regionURL == "" { + return "", errors.New("oauth2/google/externalaccount: unable to determine AWS region") } - req, err := http.NewRequest("GET", cs.RegionURL, nil) + req, err := http.NewRequest("GET", cs.regionURL, nil) if err != nil { return "", err } @@ -488,7 +468,7 @@ func (cs *awsCredentialSource) getRegion(headers map[string]string) (string, err } if resp.StatusCode != 200 { - return "", fmt.Errorf("oauth2/google: unable to retrieve AWS region - %s", string(respBody)) + return "", fmt.Errorf("oauth2/google/externalaccount: unable to retrieve AWS region - %s", string(respBody)) } // This endpoint will return the region in format: us-east-2b. @@ -500,12 +480,15 @@ func (cs *awsCredentialSource) getRegion(headers map[string]string) (string, err return string(respBody[:respBodyEnd]), nil } -func (cs *awsCredentialSource) getSecurityCredentials(headers map[string]string) (result awsSecurityCredentials, err error) { +func (cs *awsCredentialSource) getSecurityCredentials(headers map[string]string) (result *AwsSecurityCredentials, err error) { + if cs.awsSecurityCredentialsSupplier != nil { + return cs.awsSecurityCredentialsSupplier.AwsSecurityCredentials(cs.ctx, cs.supplierOptions) + } if canRetrieveSecurityCredentialFromEnvironment() { - return awsSecurityCredentials{ + return &AwsSecurityCredentials{ AccessKeyID: getenv(awsAccessKeyId), SecretAccessKey: getenv(awsSecretAccessKey), - SecurityToken: getenv(awsSessionToken), + SessionToken: getenv(awsSessionToken), }, nil } @@ -520,24 +503,23 @@ func (cs *awsCredentialSource) getSecurityCredentials(headers map[string]string) } if credentials.AccessKeyID == "" { - return result, errors.New("oauth2/google: missing AccessKeyId credential") + return result, errors.New("oauth2/google/externalaccount: missing AccessKeyId credential") } if credentials.SecretAccessKey == "" { - return result, errors.New("oauth2/google: missing SecretAccessKey credential") + return result, errors.New("oauth2/google/externalaccount: missing SecretAccessKey credential") } - return credentials, nil + return &credentials, nil } -func (cs *awsCredentialSource) getMetadataSecurityCredentials(roleName string, headers map[string]string) (awsSecurityCredentials, error) { - var result awsSecurityCredentials +func (cs *awsCredentialSource) getMetadataSecurityCredentials(roleName string, headers map[string]string) (AwsSecurityCredentials, error) { + var result AwsSecurityCredentials - req, err := http.NewRequest("GET", fmt.Sprintf("%s/%s", cs.CredVerificationURL, roleName), nil) + req, err := http.NewRequest("GET", fmt.Sprintf("%s/%s", cs.credVerificationURL, roleName), nil) if err != nil { return result, err } - req.Header.Add("Content-Type", "application/json") for name, value := range headers { req.Header.Add(name, value) @@ -555,7 +537,7 @@ func (cs *awsCredentialSource) getMetadataSecurityCredentials(roleName string, h } if resp.StatusCode != 200 { - return result, fmt.Errorf("oauth2/google: unable to retrieve AWS security credentials - %s", string(respBody)) + return result, fmt.Errorf("oauth2/google/externalaccount: unable to retrieve AWS security credentials - %s", string(respBody)) } err = json.Unmarshal(respBody, &result) @@ -563,11 +545,11 @@ func (cs *awsCredentialSource) getMetadataSecurityCredentials(roleName string, h } func (cs *awsCredentialSource) getMetadataRoleName(headers map[string]string) (string, error) { - if cs.CredVerificationURL == "" { - return "", errors.New("oauth2/google: unable to determine the AWS metadata server security credentials endpoint") + if cs.credVerificationURL == "" { + return "", errors.New("oauth2/google/externalaccount: unable to determine the AWS metadata server security credentials endpoint") } - req, err := http.NewRequest("GET", cs.CredVerificationURL, nil) + req, err := http.NewRequest("GET", cs.credVerificationURL, nil) if err != nil { return "", err } @@ -588,7 +570,7 @@ func (cs *awsCredentialSource) getMetadataRoleName(headers map[string]string) (s } if resp.StatusCode != 200 { - return "", fmt.Errorf("oauth2/google: unable to retrieve AWS role name - %s", string(respBody)) + return "", fmt.Errorf("oauth2/google/externalaccount: unable to retrieve AWS role name - %s", string(respBody)) } return string(respBody), nil diff --git a/vendor/golang.org/x/oauth2/google/externalaccount/basecredentials.go b/vendor/golang.org/x/oauth2/google/externalaccount/basecredentials.go new file mode 100644 index 0000000000..6c81a68728 --- /dev/null +++ b/vendor/golang.org/x/oauth2/google/externalaccount/basecredentials.go @@ -0,0 +1,485 @@ +// Copyright 2020 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 externalaccount provides support for creating workload identity +federation and workforce identity federation token sources that can be +used to access Google Cloud resources from external identity providers. + +# Workload Identity Federation + +Using workload identity federation, your application can access Google Cloud +resources from Amazon Web Services (AWS), Microsoft Azure or any identity +provider that supports OpenID Connect (OIDC) or SAML 2.0. +Traditionally, applications running outside Google Cloud have used service +account keys to access Google Cloud resources. Using identity federation, +you can allow your workload to impersonate a service account. +This lets you access Google Cloud resources directly, eliminating the +maintenance and security burden associated with service account keys. + +Follow the detailed instructions on how to configure Workload Identity Federation +in various platforms: + +Amazon Web Services (AWS): https://cloud.google.com/iam/docs/workload-identity-federation-with-other-clouds#aws +Microsoft Azure: https://cloud.google.com/iam/docs/workload-identity-federation-with-other-clouds#azure +OIDC identity provider: https://cloud.google.com/iam/docs/workload-identity-federation-with-other-providers#oidc +SAML 2.0 identity provider: https://cloud.google.com/iam/docs/workload-identity-federation-with-other-providers#saml + +For OIDC and SAML providers, the library can retrieve tokens in fours ways: +from a local file location (file-sourced credentials), from a server +(URL-sourced credentials), from a local executable (executable-sourced +credentials), or from a user defined function that returns an OIDC or SAML token. +For file-sourced credentials, a background process needs to be continuously +refreshing the file location with a new OIDC/SAML token prior to expiration. +For tokens with one hour lifetimes, the token needs to be updated in the file +every hour. The token can be stored directly as plain text or in JSON format. +For URL-sourced credentials, a local server needs to host a GET endpoint to +return the OIDC/SAML token. The response can be in plain text or JSON. +Additional required request headers can also be specified. +For executable-sourced credentials, an application needs to be available to +output the OIDC/SAML token and other information in a JSON format. +For more information on how these work (and how to implement +executable-sourced credentials), please check out: +https://cloud.google.com/iam/docs/workload-identity-federation-with-other-providers#create_a_credential_configuration + +To use a custom function to supply the token, define a struct that implements the [SubjectTokenSupplier] interface for OIDC/SAML providers, +or one that implements [AwsSecurityCredentialsSupplier] for AWS providers. This can then be used when building a [Config]. +The [golang.org/x/oauth2.TokenSource] created from the config using [NewTokenSource] can then be used to access Google +Cloud resources. For instance, you can create a new client from the +[cloud.google.com/go/storage] package and pass in option.WithTokenSource(yourTokenSource)) + +Note that this library does not perform any validation on the token_url, token_info_url, +or service_account_impersonation_url fields of the credential configuration. +It is not recommended to use a credential configuration that you did not generate with +the gcloud CLI unless you verify that the URL fields point to a googleapis.com domain. + +# Workforce Identity Federation + +Workforce identity federation lets you use an external identity provider (IdP) to +authenticate and authorize a workforce—a group of users, such as employees, partners, +and contractors—using IAM, so that the users can access Google Cloud services. +Workforce identity federation extends Google Cloud's identity capabilities to support +syncless, attribute-based single sign on. + +With workforce identity federation, your workforce can access Google Cloud resources +using an external identity provider (IdP) that supports OpenID Connect (OIDC) or +SAML 2.0 such as Azure Active Directory (Azure AD), Active Directory Federation +Services (AD FS), Okta, and others. + +Follow the detailed instructions on how to configure Workload Identity Federation +in various platforms: + +Azure AD: https://cloud.google.com/iam/docs/workforce-sign-in-azure-ad +Okta: https://cloud.google.com/iam/docs/workforce-sign-in-okta +OIDC identity provider: https://cloud.google.com/iam/docs/configuring-workforce-identity-federation#oidc +SAML 2.0 identity provider: https://cloud.google.com/iam/docs/configuring-workforce-identity-federation#saml + +For workforce identity federation, the library can retrieve tokens in four ways: +from a local file location (file-sourced credentials), from a server +(URL-sourced credentials), from a local executable (executable-sourced +credentials), or from a user supplied function that returns an OIDC or SAML token. +For file-sourced credentials, a background process needs to be continuously +refreshing the file location with a new OIDC/SAML token prior to expiration. +For tokens with one hour lifetimes, the token needs to be updated in the file +every hour. The token can be stored directly as plain text or in JSON format. +For URL-sourced credentials, a local server needs to host a GET endpoint to +return the OIDC/SAML token. The response can be in plain text or JSON. +Additional required request headers can also be specified. +For executable-sourced credentials, an application needs to be available to +output the OIDC/SAML token and other information in a JSON format. +For more information on how these work (and how to implement +executable-sourced credentials), please check out: +https://cloud.google.com/iam/docs/workforce-obtaining-short-lived-credentials#generate_a_configuration_file_for_non-interactive_sign-in + +To use a custom function to supply the token, define a struct that implements the [SubjectTokenSupplier] interface for OIDC/SAML providers. +This can then be used when building a [Config]. +The [golang.org/x/oauth2.TokenSource] created from the config using [NewTokenSource] can then be used access Google +Cloud resources. For instance, you can create a new client from the +[cloud.google.com/go/storage] package and pass in option.WithTokenSource(yourTokenSource)) + +# Security considerations + +Note that this library does not perform any validation on the token_url, token_info_url, +or service_account_impersonation_url fields of the credential configuration. +It is not recommended to use a credential configuration that you did not generate with +the gcloud CLI unless you verify that the URL fields point to a googleapis.com domain. +*/ +package externalaccount + +import ( + "context" + "fmt" + "net/http" + "regexp" + "strconv" + "strings" + "time" + + "golang.org/x/oauth2" + "golang.org/x/oauth2/google/internal/impersonate" + "golang.org/x/oauth2/google/internal/stsexchange" +) + +const ( + universeDomainPlaceholder = "UNIVERSE_DOMAIN" + defaultTokenURL = "https://sts.UNIVERSE_DOMAIN/v1/token" + defaultUniverseDomain = "googleapis.com" +) + +// now aliases time.Now for testing +var now = func() time.Time { + return time.Now().UTC() +} + +// Config stores the configuration for fetching tokens with external credentials. +type Config struct { + // Audience is the Secure Token Service (STS) audience which contains the resource name for the workload + // identity pool or the workforce pool and the provider identifier in that pool. Required. + Audience string + // SubjectTokenType is the STS token type based on the Oauth2.0 token exchange spec. + // Expected values include: + // “urn:ietf:params:oauth:token-type:jwt” + // “urn:ietf:params:oauth:token-type:id-token” + // “urn:ietf:params:oauth:token-type:saml2” + // “urn:ietf:params:aws:token-type:aws4_request” + // Required. + SubjectTokenType string + // TokenURL is the STS token exchange endpoint. If not provided, will default to + // https://sts.UNIVERSE_DOMAIN/v1/token, with UNIVERSE_DOMAIN set to the + // default service domain googleapis.com unless UniverseDomain is set. + // Optional. + TokenURL string + // TokenInfoURL is the token_info endpoint used to retrieve the account related information ( + // user attributes like account identifier, eg. email, username, uid, etc). This is + // needed for gCloud session account identification. Optional. + TokenInfoURL string + // ServiceAccountImpersonationURL is the URL for the service account impersonation request. This is only + // required for workload identity pools when APIs to be accessed have not integrated with UberMint. Optional. + ServiceAccountImpersonationURL string + // ServiceAccountImpersonationLifetimeSeconds is the number of seconds the service account impersonation + // token will be valid for. If not provided, it will default to 3600. Optional. + ServiceAccountImpersonationLifetimeSeconds int + // ClientSecret is currently only required if token_info endpoint also + // needs to be called with the generated GCP access token. When provided, STS will be + // called with additional basic authentication using ClientId as username and ClientSecret as password. Optional. + ClientSecret string + // ClientID is only required in conjunction with ClientSecret, as described above. Optional. + ClientID string + // CredentialSource contains the necessary information to retrieve the token itself, as well + // as some environmental information. One of SubjectTokenSupplier, AWSSecurityCredentialSupplier or + // CredentialSource must be provided. Optional. + CredentialSource *CredentialSource + // QuotaProjectID is injected by gCloud. If the value is non-empty, the Auth libraries + // will set the x-goog-user-project header which overrides the project associated with the credentials. Optional. + QuotaProjectID string + // Scopes contains the desired scopes for the returned access token. Optional. + Scopes []string + // WorkforcePoolUserProject is the workforce pool user project number when the credential + // corresponds to a workforce pool and not a workload identity pool. + // The underlying principal must still have serviceusage.services.use IAM + // permission to use the project for billing/quota. Optional. + WorkforcePoolUserProject string + // SubjectTokenSupplier is an optional token supplier for OIDC/SAML credentials. + // One of SubjectTokenSupplier, AWSSecurityCredentialSupplier or CredentialSource must be provided. Optional. + SubjectTokenSupplier SubjectTokenSupplier + // AwsSecurityCredentialsSupplier is an AWS Security Credential supplier for AWS credentials. + // One of SubjectTokenSupplier, AWSSecurityCredentialSupplier or CredentialSource must be provided. Optional. + AwsSecurityCredentialsSupplier AwsSecurityCredentialsSupplier + // UniverseDomain is the default service domain for a given Cloud universe. + // This value will be used in the default STS token URL. The default value + // is "googleapis.com". It will not be used if TokenURL is set. Optional. + UniverseDomain string +} + +var ( + validWorkforceAudiencePattern *regexp.Regexp = regexp.MustCompile(`//iam\.googleapis\.com/locations/[^/]+/workforcePools/`) +) + +func validateWorkforceAudience(input string) bool { + return validWorkforceAudiencePattern.MatchString(input) +} + +// NewTokenSource Returns an external account TokenSource using the provided external account config. +func NewTokenSource(ctx context.Context, conf Config) (oauth2.TokenSource, error) { + if conf.Audience == "" { + return nil, fmt.Errorf("oauth2/google/externalaccount: Audience must be set") + } + if conf.SubjectTokenType == "" { + return nil, fmt.Errorf("oauth2/google/externalaccount: Subject token type must be set") + } + if conf.WorkforcePoolUserProject != "" { + valid := validateWorkforceAudience(conf.Audience) + if !valid { + return nil, fmt.Errorf("oauth2/google/externalaccount: Workforce pool user project should not be set for non-workforce pool credentials") + } + } + count := 0 + if conf.CredentialSource != nil { + count++ + } + if conf.SubjectTokenSupplier != nil { + count++ + } + if conf.AwsSecurityCredentialsSupplier != nil { + count++ + } + if count == 0 { + return nil, fmt.Errorf("oauth2/google/externalaccount: One of CredentialSource, SubjectTokenSupplier, or AwsSecurityCredentialsSupplier must be set") + } + if count > 1 { + return nil, fmt.Errorf("oauth2/google/externalaccount: Only one of CredentialSource, SubjectTokenSupplier, or AwsSecurityCredentialsSupplier must be set") + } + return conf.tokenSource(ctx, "https") +} + +// tokenSource is a private function that's directly called by some of the tests, +// because the unit test URLs are mocked, and would otherwise fail the +// validity check. +func (c *Config) tokenSource(ctx context.Context, scheme string) (oauth2.TokenSource, error) { + + ts := tokenSource{ + ctx: ctx, + conf: c, + } + if c.ServiceAccountImpersonationURL == "" { + return oauth2.ReuseTokenSource(nil, ts), nil + } + scopes := c.Scopes + ts.conf.Scopes = []string{"https://www.googleapis.com/auth/cloud-platform"} + imp := impersonate.ImpersonateTokenSource{ + Ctx: ctx, + URL: c.ServiceAccountImpersonationURL, + Scopes: scopes, + Ts: oauth2.ReuseTokenSource(nil, ts), + TokenLifetimeSeconds: c.ServiceAccountImpersonationLifetimeSeconds, + } + return oauth2.ReuseTokenSource(nil, imp), nil +} + +// Subject token file types. +const ( + fileTypeText = "text" + fileTypeJSON = "json" +) + +// Format contains information needed to retireve a subject token for URL or File sourced credentials. +type Format struct { + // Type should be either "text" or "json". This determines whether the file or URL sourced credentials + // expect a simple text subject token or if the subject token will be contained in a JSON object. + // When not provided "text" type is assumed. + Type string `json:"type"` + // SubjectTokenFieldName is only required for JSON format. This is the field name that the credentials will check + // for the subject token in the file or URL response. This would be "access_token" for azure. + SubjectTokenFieldName string `json:"subject_token_field_name"` +} + +// CredentialSource stores the information necessary to retrieve the credentials for the STS exchange. +type CredentialSource struct { + // File is the location for file sourced credentials. + // One field amongst File, URL, Executable, or EnvironmentID should be provided, depending on the kind of credential in question. + File string `json:"file"` + + // Url is the URL to call for URL sourced credentials. + // One field amongst File, URL, Executable, or EnvironmentID should be provided, depending on the kind of credential in question. + URL string `json:"url"` + // Headers are the headers to attach to the request for URL sourced credentials. + Headers map[string]string `json:"headers"` + + // Executable is the configuration object for executable sourced credentials. + // One field amongst File, URL, Executable, or EnvironmentID should be provided, depending on the kind of credential in question. + Executable *ExecutableConfig `json:"executable"` + + // EnvironmentID is the EnvironmentID used for AWS sourced credentials. This should start with "AWS". + // One field amongst File, URL, Executable, or EnvironmentID should be provided, depending on the kind of credential in question. + EnvironmentID string `json:"environment_id"` + // RegionURL is the metadata URL to retrieve the region from for EC2 AWS credentials. + RegionURL string `json:"region_url"` + // RegionalCredVerificationURL is the AWS regional credential verification URL, will default to + // "https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15" if not provided." + RegionalCredVerificationURL string `json:"regional_cred_verification_url"` + // IMDSv2SessionTokenURL is the URL to retrieve the session token when using IMDSv2 in AWS. + IMDSv2SessionTokenURL string `json:"imdsv2_session_token_url"` + // Format is the format type for the subject token. Used for File and URL sourced credentials. Expected values are "text" or "json". + Format Format `json:"format"` +} + +// ExecutableConfig contains information needed for executable sourced credentials. +type ExecutableConfig struct { + // Command is the the full command to run to retrieve the subject token. + // This can include arguments. Must be an absolute path for the program. Required. + Command string `json:"command"` + // TimeoutMillis is the timeout duration, in milliseconds. Defaults to 30000 milliseconds when not provided. Optional. + TimeoutMillis *int `json:"timeout_millis"` + // OutputFile is the absolute path to the output file where the executable will cache the response. + // If specified the auth libraries will first check this location before running the executable. Optional. + OutputFile string `json:"output_file"` +} + +// SubjectTokenSupplier can be used to supply a subject token to exchange for a GCP access token. +type SubjectTokenSupplier interface { + // SubjectToken should return a valid subject token or an error. + // The external account token source does not cache the returned subject token, so caching + // logic should be implemented in the supplier to prevent multiple requests for the same subject token. + SubjectToken(ctx context.Context, options SupplierOptions) (string, error) +} + +// AWSSecurityCredentialsSupplier can be used to supply AwsSecurityCredentials and an AWS Region to +// exchange for a GCP access token. +type AwsSecurityCredentialsSupplier interface { + // AwsRegion should return the AWS region or an error. + AwsRegion(ctx context.Context, options SupplierOptions) (string, error) + // GetAwsSecurityCredentials should return a valid set of AwsSecurityCredentials or an error. + // The external account token source does not cache the returned security credentials, so caching + // logic should be implemented in the supplier to prevent multiple requests for the same security credentials. + AwsSecurityCredentials(ctx context.Context, options SupplierOptions) (*AwsSecurityCredentials, error) +} + +// SupplierOptions contains information about the requested subject token or AWS security credentials from the +// Google external account credential. +type SupplierOptions struct { + // Audience is the requested audience for the external account credential. + Audience string + // Subject token type is the requested subject token type for the external account credential. Expected values include: + // “urn:ietf:params:oauth:token-type:jwt” + // “urn:ietf:params:oauth:token-type:id-token” + // “urn:ietf:params:oauth:token-type:saml2” + // “urn:ietf:params:aws:token-type:aws4_request” + SubjectTokenType string +} + +// tokenURL returns the default STS token endpoint with the configured universe +// domain. +func (c *Config) tokenURL() string { + if c.UniverseDomain == "" { + return strings.Replace(defaultTokenURL, universeDomainPlaceholder, defaultUniverseDomain, 1) + } + return strings.Replace(defaultTokenURL, universeDomainPlaceholder, c.UniverseDomain, 1) +} + +// parse determines the type of CredentialSource needed. +func (c *Config) parse(ctx context.Context) (baseCredentialSource, error) { + //set Defaults + if c.TokenURL == "" { + c.TokenURL = c.tokenURL() + } + supplierOptions := SupplierOptions{Audience: c.Audience, SubjectTokenType: c.SubjectTokenType} + + if c.AwsSecurityCredentialsSupplier != nil { + awsCredSource := awsCredentialSource{ + awsSecurityCredentialsSupplier: c.AwsSecurityCredentialsSupplier, + targetResource: c.Audience, + supplierOptions: supplierOptions, + ctx: ctx, + } + return awsCredSource, nil + } else if c.SubjectTokenSupplier != nil { + return programmaticRefreshCredentialSource{subjectTokenSupplier: c.SubjectTokenSupplier, supplierOptions: supplierOptions, ctx: ctx}, nil + } else if len(c.CredentialSource.EnvironmentID) > 3 && c.CredentialSource.EnvironmentID[:3] == "aws" { + if awsVersion, err := strconv.Atoi(c.CredentialSource.EnvironmentID[3:]); err == nil { + if awsVersion != 1 { + return nil, fmt.Errorf("oauth2/google/externalaccount: aws version '%d' is not supported in the current build", awsVersion) + } + + awsCredSource := awsCredentialSource{ + environmentID: c.CredentialSource.EnvironmentID, + regionURL: c.CredentialSource.RegionURL, + regionalCredVerificationURL: c.CredentialSource.RegionalCredVerificationURL, + credVerificationURL: c.CredentialSource.URL, + targetResource: c.Audience, + ctx: ctx, + } + if c.CredentialSource.IMDSv2SessionTokenURL != "" { + awsCredSource.imdsv2SessionTokenURL = c.CredentialSource.IMDSv2SessionTokenURL + } + + return awsCredSource, nil + } + } else if c.CredentialSource.File != "" { + return fileCredentialSource{File: c.CredentialSource.File, Format: c.CredentialSource.Format}, nil + } else if c.CredentialSource.URL != "" { + return urlCredentialSource{URL: c.CredentialSource.URL, Headers: c.CredentialSource.Headers, Format: c.CredentialSource.Format, ctx: ctx}, nil + } else if c.CredentialSource.Executable != nil { + return createExecutableCredential(ctx, c.CredentialSource.Executable, c) + } + return nil, fmt.Errorf("oauth2/google/externalaccount: unable to parse credential source") +} + +type baseCredentialSource interface { + credentialSourceType() string + subjectToken() (string, error) +} + +// tokenSource is the source that handles external credentials. It is used to retrieve Tokens. +type tokenSource struct { + ctx context.Context + conf *Config +} + +func getMetricsHeaderValue(conf *Config, credSource baseCredentialSource) string { + return fmt.Sprintf("gl-go/%s auth/%s google-byoid-sdk source/%s sa-impersonation/%t config-lifetime/%t", + goVersion(), + "unknown", + credSource.credentialSourceType(), + conf.ServiceAccountImpersonationURL != "", + conf.ServiceAccountImpersonationLifetimeSeconds != 0) +} + +// Token allows tokenSource to conform to the oauth2.TokenSource interface. +func (ts tokenSource) Token() (*oauth2.Token, error) { + conf := ts.conf + + credSource, err := conf.parse(ts.ctx) + if err != nil { + return nil, err + } + subjectToken, err := credSource.subjectToken() + + if err != nil { + return nil, err + } + stsRequest := stsexchange.TokenExchangeRequest{ + GrantType: "urn:ietf:params:oauth:grant-type:token-exchange", + Audience: conf.Audience, + Scope: conf.Scopes, + RequestedTokenType: "urn:ietf:params:oauth:token-type:access_token", + SubjectToken: subjectToken, + SubjectTokenType: conf.SubjectTokenType, + } + header := make(http.Header) + header.Add("Content-Type", "application/x-www-form-urlencoded") + header.Add("x-goog-api-client", getMetricsHeaderValue(conf, credSource)) + clientAuth := stsexchange.ClientAuthentication{ + AuthStyle: oauth2.AuthStyleInHeader, + ClientID: conf.ClientID, + ClientSecret: conf.ClientSecret, + } + var options map[string]interface{} + // Do not pass workforce_pool_user_project when client authentication is used. + // The client ID is sufficient for determining the user project. + if conf.WorkforcePoolUserProject != "" && conf.ClientID == "" { + options = map[string]interface{}{ + "userProject": conf.WorkforcePoolUserProject, + } + } + stsResp, err := stsexchange.ExchangeToken(ts.ctx, conf.TokenURL, &stsRequest, clientAuth, header, options) + if err != nil { + return nil, err + } + + accessToken := &oauth2.Token{ + AccessToken: stsResp.AccessToken, + TokenType: stsResp.TokenType, + } + + // The RFC8693 doesn't define the explicit 0 of "expires_in" field behavior. + if stsResp.ExpiresIn <= 0 { + return nil, fmt.Errorf("oauth2/google/externalaccount: got invalid expiry from security token service") + } + accessToken.Expiry = now().Add(time.Duration(stsResp.ExpiresIn) * time.Second) + + if stsResp.RefreshToken != "" { + accessToken.RefreshToken = stsResp.RefreshToken + } + return accessToken, nil +} diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccount/executablecredsource.go b/vendor/golang.org/x/oauth2/google/externalaccount/executablecredsource.go similarity index 83% rename from vendor/golang.org/x/oauth2/google/internal/externalaccount/executablecredsource.go rename to vendor/golang.org/x/oauth2/google/externalaccount/executablecredsource.go index 579bcce5f2..dca5681a46 100644 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/executablecredsource.go +++ b/vendor/golang.org/x/oauth2/google/externalaccount/executablecredsource.go @@ -19,7 +19,7 @@ import ( "time" ) -var serviceAccountImpersonationRE = regexp.MustCompile("https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/(.*@.*):generateAccessToken") +var serviceAccountImpersonationRE = regexp.MustCompile("https://iamcredentials\\..+/v1/projects/-/serviceAccounts/(.*@.*):generateAccessToken") const ( executableSupportedMaxVersion = 1 @@ -39,51 +39,51 @@ func (nce nonCacheableError) Error() string { } func missingFieldError(source, field string) error { - return fmt.Errorf("oauth2/google: %v missing `%q` field", source, field) + return fmt.Errorf("oauth2/google/externalaccount: %v missing `%q` field", source, field) } func jsonParsingError(source, data string) error { - return fmt.Errorf("oauth2/google: unable to parse %v\nResponse: %v", source, data) + return fmt.Errorf("oauth2/google/externalaccount: unable to parse %v\nResponse: %v", source, data) } func malformedFailureError() error { - return nonCacheableError{"oauth2/google: response must include `error` and `message` fields when unsuccessful"} + return nonCacheableError{"oauth2/google/externalaccount: response must include `error` and `message` fields when unsuccessful"} } func userDefinedError(code, message string) error { - return nonCacheableError{fmt.Sprintf("oauth2/google: response contains unsuccessful response: (%v) %v", code, message)} + return nonCacheableError{fmt.Sprintf("oauth2/google/externalaccount: response contains unsuccessful response: (%v) %v", code, message)} } func unsupportedVersionError(source string, version int) error { - return fmt.Errorf("oauth2/google: %v contains unsupported version: %v", source, version) + return fmt.Errorf("oauth2/google/externalaccount: %v contains unsupported version: %v", source, version) } func tokenExpiredError() error { - return nonCacheableError{"oauth2/google: the token returned by the executable is expired"} + return nonCacheableError{"oauth2/google/externalaccount: the token returned by the executable is expired"} } func tokenTypeError(source string) error { - return fmt.Errorf("oauth2/google: %v contains unsupported token type", source) + return fmt.Errorf("oauth2/google/externalaccount: %v contains unsupported token type", source) } func exitCodeError(exitCode int) error { - return fmt.Errorf("oauth2/google: executable command failed with exit code %v", exitCode) + return fmt.Errorf("oauth2/google/externalaccount: executable command failed with exit code %v", exitCode) } func executableError(err error) error { - return fmt.Errorf("oauth2/google: executable command failed: %v", err) + return fmt.Errorf("oauth2/google/externalaccount: executable command failed: %v", err) } func executablesDisallowedError() error { - return errors.New("oauth2/google: executables need to be explicitly allowed (set GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES to '1') to run") + return errors.New("oauth2/google/externalaccount: executables need to be explicitly allowed (set GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES to '1') to run") } func timeoutRangeError() error { - return errors.New("oauth2/google: invalid `timeout_millis` field — executable timeout must be between 5 and 120 seconds") + return errors.New("oauth2/google/externalaccount: invalid `timeout_millis` field — executable timeout must be between 5 and 120 seconds") } func commandMissingError() error { - return errors.New("oauth2/google: missing `command` field — executable command must be provided") + return errors.New("oauth2/google/externalaccount: missing `command` field — executable command must be provided") } type environment interface { @@ -146,7 +146,7 @@ type executableCredentialSource struct { // CreateExecutableCredential creates an executableCredentialSource given an ExecutableConfig. // It also performs defaulting and type conversions. -func CreateExecutableCredential(ctx context.Context, ec *ExecutableConfig, config *Config) (executableCredentialSource, error) { +func createExecutableCredential(ctx context.Context, ec *ExecutableConfig, config *Config) (executableCredentialSource, error) { if ec.Command == "" { return executableCredentialSource{}, commandMissingError() } @@ -233,6 +233,10 @@ func (cs executableCredentialSource) parseSubjectTokenFromSource(response []byte return "", tokenTypeError(source) } +func (cs executableCredentialSource) credentialSourceType() string { + return "executable" +} + func (cs executableCredentialSource) subjectToken() (string, error) { if token, err := cs.getTokenFromOutputFile(); token != "" || err != nil { return token, err diff --git a/vendor/golang.org/x/oauth2/google/externalaccount/filecredsource.go b/vendor/golang.org/x/oauth2/google/externalaccount/filecredsource.go new file mode 100644 index 0000000000..33766b9722 --- /dev/null +++ b/vendor/golang.org/x/oauth2/google/externalaccount/filecredsource.go @@ -0,0 +1,61 @@ +// Copyright 2020 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 externalaccount + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "io" + "io/ioutil" + "os" +) + +type fileCredentialSource struct { + File string + Format Format +} + +func (cs fileCredentialSource) credentialSourceType() string { + return "file" +} + +func (cs fileCredentialSource) subjectToken() (string, error) { + tokenFile, err := os.Open(cs.File) + if err != nil { + return "", fmt.Errorf("oauth2/google/externalaccount: failed to open credential file %q", cs.File) + } + defer tokenFile.Close() + tokenBytes, err := ioutil.ReadAll(io.LimitReader(tokenFile, 1<<20)) + if err != nil { + return "", fmt.Errorf("oauth2/google/externalaccount: failed to read credential file: %v", err) + } + tokenBytes = bytes.TrimSpace(tokenBytes) + switch cs.Format.Type { + case "json": + jsonData := make(map[string]interface{}) + err = json.Unmarshal(tokenBytes, &jsonData) + if err != nil { + return "", fmt.Errorf("oauth2/google/externalaccount: failed to unmarshal subject token file: %v", err) + } + val, ok := jsonData[cs.Format.SubjectTokenFieldName] + if !ok { + return "", errors.New("oauth2/google/externalaccount: provided subject_token_field_name not found in credentials") + } + token, ok := val.(string) + if !ok { + return "", errors.New("oauth2/google/externalaccount: improperly formatted subject token") + } + return token, nil + case "text": + return string(tokenBytes), nil + case "": + return string(tokenBytes), nil + default: + return "", errors.New("oauth2/google/externalaccount: invalid credential_source file format type") + } + +} diff --git a/vendor/golang.org/x/oauth2/google/externalaccount/header.go b/vendor/golang.org/x/oauth2/google/externalaccount/header.go new file mode 100644 index 0000000000..1d5aad2e2d --- /dev/null +++ b/vendor/golang.org/x/oauth2/google/externalaccount/header.go @@ -0,0 +1,64 @@ +// Copyright 2023 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 externalaccount + +import ( + "runtime" + "strings" + "unicode" +) + +var ( + // version is a package internal global variable for testing purposes. + version = runtime.Version +) + +// versionUnknown is only used when the runtime version cannot be determined. +const versionUnknown = "UNKNOWN" + +// goVersion returns a Go runtime version derived from the runtime environment +// that is modified to be suitable for reporting in a header, meaning it has no +// whitespace. If it is unable to determine the Go runtime version, it returns +// versionUnknown. +func goVersion() string { + const develPrefix = "devel +" + + s := version() + if strings.HasPrefix(s, develPrefix) { + s = s[len(develPrefix):] + if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 { + s = s[:p] + } + return s + } else if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 { + s = s[:p] + } + + notSemverRune := func(r rune) bool { + return !strings.ContainsRune("0123456789.", r) + } + + if strings.HasPrefix(s, "go1") { + s = s[2:] + var prerelease string + if p := strings.IndexFunc(s, notSemverRune); p >= 0 { + s, prerelease = s[:p], s[p:] + } + if strings.HasSuffix(s, ".") { + s += "0" + } else if strings.Count(s, ".") < 2 { + s += ".0" + } + if prerelease != "" { + // Some release candidates already have a dash in them. + if !strings.HasPrefix(prerelease, "-") { + prerelease = "-" + prerelease + } + s += prerelease + } + return s + } + return "UNKNOWN" +} diff --git a/vendor/golang.org/x/oauth2/google/externalaccount/programmaticrefreshcredsource.go b/vendor/golang.org/x/oauth2/google/externalaccount/programmaticrefreshcredsource.go new file mode 100644 index 0000000000..6c1abdf2da --- /dev/null +++ b/vendor/golang.org/x/oauth2/google/externalaccount/programmaticrefreshcredsource.go @@ -0,0 +1,21 @@ +// Copyright 2024 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 externalaccount + +import "context" + +type programmaticRefreshCredentialSource struct { + supplierOptions SupplierOptions + subjectTokenSupplier SubjectTokenSupplier + ctx context.Context +} + +func (cs programmaticRefreshCredentialSource) credentialSourceType() string { + return "programmatic" +} + +func (cs programmaticRefreshCredentialSource) subjectToken() (string, error) { + return cs.subjectTokenSupplier.SubjectToken(cs.ctx, cs.supplierOptions) +} diff --git a/vendor/golang.org/x/oauth2/google/externalaccount/urlcredsource.go b/vendor/golang.org/x/oauth2/google/externalaccount/urlcredsource.go new file mode 100644 index 0000000000..71a7184e01 --- /dev/null +++ b/vendor/golang.org/x/oauth2/google/externalaccount/urlcredsource.go @@ -0,0 +1,79 @@ +// Copyright 2020 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 externalaccount + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "io/ioutil" + "net/http" + + "golang.org/x/oauth2" +) + +type urlCredentialSource struct { + URL string + Headers map[string]string + Format Format + ctx context.Context +} + +func (cs urlCredentialSource) credentialSourceType() string { + return "url" +} + +func (cs urlCredentialSource) subjectToken() (string, error) { + client := oauth2.NewClient(cs.ctx, nil) + req, err := http.NewRequest("GET", cs.URL, nil) + if err != nil { + return "", fmt.Errorf("oauth2/google/externalaccount: HTTP request for URL-sourced credential failed: %v", err) + } + req = req.WithContext(cs.ctx) + + for key, val := range cs.Headers { + req.Header.Add(key, val) + } + resp, err := client.Do(req) + if err != nil { + return "", fmt.Errorf("oauth2/google/externalaccount: invalid response when retrieving subject token: %v", err) + } + defer resp.Body.Close() + + respBody, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) + if err != nil { + return "", fmt.Errorf("oauth2/google/externalaccount: invalid body in subject token URL query: %v", err) + } + if c := resp.StatusCode; c < 200 || c > 299 { + return "", fmt.Errorf("oauth2/google/externalaccount: status code %d: %s", c, respBody) + } + + switch cs.Format.Type { + case "json": + jsonData := make(map[string]interface{}) + err = json.Unmarshal(respBody, &jsonData) + if err != nil { + return "", fmt.Errorf("oauth2/google/externalaccount: failed to unmarshal subject token file: %v", err) + } + val, ok := jsonData[cs.Format.SubjectTokenFieldName] + if !ok { + return "", errors.New("oauth2/google/externalaccount: provided subject_token_field_name not found in credentials") + } + token, ok := val.(string) + if !ok { + return "", errors.New("oauth2/google/externalaccount: improperly formatted subject token") + } + return token, nil + case "text": + return string(respBody), nil + case "": + return string(respBody), nil + default: + return "", errors.New("oauth2/google/externalaccount: invalid credential_source file format type") + } + +} diff --git a/vendor/golang.org/x/oauth2/google/google.go b/vendor/golang.org/x/oauth2/google/google.go index cc1223889e..7b82e7a083 100644 --- a/vendor/golang.org/x/oauth2/google/google.go +++ b/vendor/golang.org/x/oauth2/google/google.go @@ -15,15 +15,18 @@ import ( "cloud.google.com/go/compute/metadata" "golang.org/x/oauth2" - "golang.org/x/oauth2/google/internal/externalaccount" + "golang.org/x/oauth2/google/externalaccount" + "golang.org/x/oauth2/google/internal/externalaccountauthorizeduser" + "golang.org/x/oauth2/google/internal/impersonate" "golang.org/x/oauth2/jwt" ) // Endpoint is Google's OAuth 2.0 default endpoint. var Endpoint = oauth2.Endpoint{ - AuthURL: "https://accounts.google.com/o/oauth2/auth", - TokenURL: "https://oauth2.googleapis.com/token", - AuthStyle: oauth2.AuthStyleInParams, + AuthURL: "https://accounts.google.com/o/oauth2/auth", + TokenURL: "https://oauth2.googleapis.com/token", + DeviceAuthURL: "https://oauth2.googleapis.com/device/code", + AuthStyle: oauth2.AuthStyleInParams, } // MTLSTokenURL is Google's OAuth 2.0 default mTLS endpoint. @@ -95,10 +98,11 @@ func JWTConfigFromJSON(jsonKey []byte, scope ...string) (*jwt.Config, error) { // JSON key file types. const ( - serviceAccountKey = "service_account" - userCredentialsKey = "authorized_user" - externalAccountKey = "external_account" - impersonatedServiceAccount = "impersonated_service_account" + serviceAccountKey = "service_account" + userCredentialsKey = "authorized_user" + externalAccountKey = "external_account" + externalAccountAuthorizedUserKey = "external_account_authorized_user" + impersonatedServiceAccount = "impersonated_service_account" ) // credentialsFile is the unmarshalled representation of a credentials file. @@ -106,12 +110,13 @@ type credentialsFile struct { Type string `json:"type"` // Service Account fields - ClientEmail string `json:"client_email"` - PrivateKeyID string `json:"private_key_id"` - PrivateKey string `json:"private_key"` - AuthURL string `json:"auth_uri"` - TokenURL string `json:"token_uri"` - ProjectID string `json:"project_id"` + ClientEmail string `json:"client_email"` + PrivateKeyID string `json:"private_key_id"` + PrivateKey string `json:"private_key"` + AuthURL string `json:"auth_uri"` + TokenURL string `json:"token_uri"` + ProjectID string `json:"project_id"` + UniverseDomain string `json:"universe_domain"` // User Credential fields // (These typically come from gcloud auth.) @@ -131,6 +136,9 @@ type credentialsFile struct { QuotaProjectID string `json:"quota_project_id"` WorkforcePoolUserProject string `json:"workforce_pool_user_project"` + // External Account Authorized User fields + RevokeURL string `json:"revoke_url"` + // Service account impersonation SourceCredentials *credentialsFile `json:"source_credentials"` } @@ -193,11 +201,24 @@ func (f *credentialsFile) tokenSource(ctx context.Context, params CredentialsPar ServiceAccountImpersonationLifetimeSeconds: f.ServiceAccountImpersonation.TokenLifetimeSeconds, ClientSecret: f.ClientSecret, ClientID: f.ClientID, - CredentialSource: f.CredentialSource, + CredentialSource: &f.CredentialSource, QuotaProjectID: f.QuotaProjectID, Scopes: params.Scopes, WorkforcePoolUserProject: f.WorkforcePoolUserProject, } + return externalaccount.NewTokenSource(ctx, *cfg) + case externalAccountAuthorizedUserKey: + cfg := &externalaccountauthorizeduser.Config{ + Audience: f.Audience, + RefreshToken: f.RefreshToken, + TokenURL: f.TokenURLExternal, + TokenInfoURL: f.TokenInfoURL, + ClientID: f.ClientID, + ClientSecret: f.ClientSecret, + RevokeURL: f.RevokeURL, + QuotaProjectID: f.QuotaProjectID, + Scopes: params.Scopes, + } return cfg.TokenSource(ctx) case impersonatedServiceAccount: if f.ServiceAccountImpersonationURL == "" || f.SourceCredentials == nil { @@ -208,7 +229,7 @@ func (f *credentialsFile) tokenSource(ctx context.Context, params CredentialsPar if err != nil { return nil, err } - imp := externalaccount.ImpersonateTokenSource{ + imp := impersonate.ImpersonateTokenSource{ Ctx: ctx, URL: f.ServiceAccountImpersonationURL, Scopes: params.Scopes, @@ -231,7 +252,10 @@ func (f *credentialsFile) tokenSource(ctx context.Context, params CredentialsPar // Further information about retrieving access tokens from the GCE metadata // server can be found at https://cloud.google.com/compute/docs/authentication. func ComputeTokenSource(account string, scope ...string) oauth2.TokenSource { - return computeTokenSource(account, 0, scope...) + // refresh 3 minutes and 45 seconds early. The shortest MDS cache is currently 4 minutes, so any + // refreshes earlier are a waste of compute. + earlyExpirySecs := 225 * time.Second + return computeTokenSource(account, earlyExpirySecs, scope...) } func computeTokenSource(account string, earlyExpiry time.Duration, scope ...string) oauth2.TokenSource { diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccount/basecredentials.go b/vendor/golang.org/x/oauth2/google/internal/externalaccount/basecredentials.go deleted file mode 100644 index dcd252a61c..0000000000 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/basecredentials.go +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright 2020 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 externalaccount - -import ( - "context" - "fmt" - "net/http" - "net/url" - "regexp" - "strconv" - "strings" - "time" - - "golang.org/x/oauth2" -) - -// now aliases time.Now for testing -var now = func() time.Time { - return time.Now().UTC() -} - -// Config stores the configuration for fetching tokens with external credentials. -type Config struct { - // Audience is the Secure Token Service (STS) audience which contains the resource name for the workload - // identity pool or the workforce pool and the provider identifier in that pool. - Audience string - // SubjectTokenType is the STS token type based on the Oauth2.0 token exchange spec - // e.g. `urn:ietf:params:oauth:token-type:jwt`. - SubjectTokenType string - // TokenURL is the STS token exchange endpoint. - TokenURL string - // TokenInfoURL is the token_info endpoint used to retrieve the account related information ( - // user attributes like account identifier, eg. email, username, uid, etc). This is - // needed for gCloud session account identification. - TokenInfoURL string - // ServiceAccountImpersonationURL is the URL for the service account impersonation request. This is only - // required for workload identity pools when APIs to be accessed have not integrated with UberMint. - ServiceAccountImpersonationURL string - // ServiceAccountImpersonationLifetimeSeconds is the number of seconds the service account impersonation - // token will be valid for. - ServiceAccountImpersonationLifetimeSeconds int - // ClientSecret is currently only required if token_info endpoint also - // needs to be called with the generated GCP access token. When provided, STS will be - // called with additional basic authentication using client_id as username and client_secret as password. - ClientSecret string - // ClientID is only required in conjunction with ClientSecret, as described above. - ClientID string - // CredentialSource contains the necessary information to retrieve the token itself, as well - // as some environmental information. - CredentialSource CredentialSource - // QuotaProjectID is injected by gCloud. If the value is non-empty, the Auth libraries - // will set the x-goog-user-project which overrides the project associated with the credentials. - QuotaProjectID string - // Scopes contains the desired scopes for the returned access token. - Scopes []string - // The optional workforce pool user project number when the credential - // corresponds to a workforce pool and not a workload identity pool. - // The underlying principal must still have serviceusage.services.use IAM - // permission to use the project for billing/quota. - WorkforcePoolUserProject string -} - -// Each element consists of a list of patterns. validateURLs checks for matches -// that include all elements in a given list, in that order. - -var ( - validWorkforceAudiencePattern *regexp.Regexp = regexp.MustCompile(`//iam\.googleapis\.com/locations/[^/]+/workforcePools/`) -) - -func validateURL(input string, patterns []*regexp.Regexp, scheme string) bool { - parsed, err := url.Parse(input) - if err != nil { - return false - } - if !strings.EqualFold(parsed.Scheme, scheme) { - return false - } - toTest := parsed.Host - - for _, pattern := range patterns { - if pattern.MatchString(toTest) { - return true - } - } - return false -} - -func validateWorkforceAudience(input string) bool { - return validWorkforceAudiencePattern.MatchString(input) -} - -// TokenSource Returns an external account TokenSource struct. This is to be called by package google to construct a google.Credentials. -func (c *Config) TokenSource(ctx context.Context) (oauth2.TokenSource, error) { - return c.tokenSource(ctx, "https") -} - -// tokenSource is a private function that's directly called by some of the tests, -// because the unit test URLs are mocked, and would otherwise fail the -// validity check. -func (c *Config) tokenSource(ctx context.Context, scheme string) (oauth2.TokenSource, error) { - if c.WorkforcePoolUserProject != "" { - valid := validateWorkforceAudience(c.Audience) - if !valid { - return nil, fmt.Errorf("oauth2/google: workforce_pool_user_project should not be set for non-workforce pool credentials") - } - } - - ts := tokenSource{ - ctx: ctx, - conf: c, - } - if c.ServiceAccountImpersonationURL == "" { - return oauth2.ReuseTokenSource(nil, ts), nil - } - scopes := c.Scopes - ts.conf.Scopes = []string{"https://www.googleapis.com/auth/cloud-platform"} - imp := ImpersonateTokenSource{ - Ctx: ctx, - URL: c.ServiceAccountImpersonationURL, - Scopes: scopes, - Ts: oauth2.ReuseTokenSource(nil, ts), - TokenLifetimeSeconds: c.ServiceAccountImpersonationLifetimeSeconds, - } - return oauth2.ReuseTokenSource(nil, imp), nil -} - -// Subject token file types. -const ( - fileTypeText = "text" - fileTypeJSON = "json" -) - -type format struct { - // Type is either "text" or "json". When not provided "text" type is assumed. - Type string `json:"type"` - // SubjectTokenFieldName is only required for JSON format. This would be "access_token" for azure. - SubjectTokenFieldName string `json:"subject_token_field_name"` -} - -// CredentialSource stores the information necessary to retrieve the credentials for the STS exchange. -// One field amongst File, URL, and Executable should be filled, depending on the kind of credential in question. -// The EnvironmentID should start with AWS if being used for an AWS credential. -type CredentialSource struct { - File string `json:"file"` - - URL string `json:"url"` - Headers map[string]string `json:"headers"` - - Executable *ExecutableConfig `json:"executable"` - - EnvironmentID string `json:"environment_id"` - RegionURL string `json:"region_url"` - RegionalCredVerificationURL string `json:"regional_cred_verification_url"` - CredVerificationURL string `json:"cred_verification_url"` - IMDSv2SessionTokenURL string `json:"imdsv2_session_token_url"` - Format format `json:"format"` -} - -type ExecutableConfig struct { - Command string `json:"command"` - TimeoutMillis *int `json:"timeout_millis"` - OutputFile string `json:"output_file"` -} - -// parse determines the type of CredentialSource needed. -func (c *Config) parse(ctx context.Context) (baseCredentialSource, error) { - if len(c.CredentialSource.EnvironmentID) > 3 && c.CredentialSource.EnvironmentID[:3] == "aws" { - if awsVersion, err := strconv.Atoi(c.CredentialSource.EnvironmentID[3:]); err == nil { - if awsVersion != 1 { - return nil, fmt.Errorf("oauth2/google: aws version '%d' is not supported in the current build", awsVersion) - } - - awsCredSource := awsCredentialSource{ - EnvironmentID: c.CredentialSource.EnvironmentID, - RegionURL: c.CredentialSource.RegionURL, - RegionalCredVerificationURL: c.CredentialSource.RegionalCredVerificationURL, - CredVerificationURL: c.CredentialSource.URL, - TargetResource: c.Audience, - ctx: ctx, - } - if c.CredentialSource.IMDSv2SessionTokenURL != "" { - awsCredSource.IMDSv2SessionTokenURL = c.CredentialSource.IMDSv2SessionTokenURL - } - - if err := awsCredSource.validateMetadataServers(); err != nil { - return nil, err - } - - return awsCredSource, nil - } - } else if c.CredentialSource.File != "" { - return fileCredentialSource{File: c.CredentialSource.File, Format: c.CredentialSource.Format}, nil - } else if c.CredentialSource.URL != "" { - return urlCredentialSource{URL: c.CredentialSource.URL, Headers: c.CredentialSource.Headers, Format: c.CredentialSource.Format, ctx: ctx}, nil - } else if c.CredentialSource.Executable != nil { - return CreateExecutableCredential(ctx, c.CredentialSource.Executable, c) - } - return nil, fmt.Errorf("oauth2/google: unable to parse credential source") -} - -type baseCredentialSource interface { - subjectToken() (string, error) -} - -// tokenSource is the source that handles external credentials. It is used to retrieve Tokens. -type tokenSource struct { - ctx context.Context - conf *Config -} - -// Token allows tokenSource to conform to the oauth2.TokenSource interface. -func (ts tokenSource) Token() (*oauth2.Token, error) { - conf := ts.conf - - credSource, err := conf.parse(ts.ctx) - if err != nil { - return nil, err - } - subjectToken, err := credSource.subjectToken() - - if err != nil { - return nil, err - } - stsRequest := stsTokenExchangeRequest{ - GrantType: "urn:ietf:params:oauth:grant-type:token-exchange", - Audience: conf.Audience, - Scope: conf.Scopes, - RequestedTokenType: "urn:ietf:params:oauth:token-type:access_token", - SubjectToken: subjectToken, - SubjectTokenType: conf.SubjectTokenType, - } - header := make(http.Header) - header.Add("Content-Type", "application/x-www-form-urlencoded") - clientAuth := clientAuthentication{ - AuthStyle: oauth2.AuthStyleInHeader, - ClientID: conf.ClientID, - ClientSecret: conf.ClientSecret, - } - var options map[string]interface{} - // Do not pass workforce_pool_user_project when client authentication is used. - // The client ID is sufficient for determining the user project. - if conf.WorkforcePoolUserProject != "" && conf.ClientID == "" { - options = map[string]interface{}{ - "userProject": conf.WorkforcePoolUserProject, - } - } - stsResp, err := exchangeToken(ts.ctx, conf.TokenURL, &stsRequest, clientAuth, header, options) - if err != nil { - return nil, err - } - - accessToken := &oauth2.Token{ - AccessToken: stsResp.AccessToken, - TokenType: stsResp.TokenType, - } - if stsResp.ExpiresIn < 0 { - return nil, fmt.Errorf("oauth2/google: got invalid expiry from security token service") - } else if stsResp.ExpiresIn >= 0 { - accessToken.Expiry = now().Add(time.Duration(stsResp.ExpiresIn) * time.Second) - } - - if stsResp.RefreshToken != "" { - accessToken.RefreshToken = stsResp.RefreshToken - } - return accessToken, nil -} diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccount/err.go b/vendor/golang.org/x/oauth2/google/internal/externalaccount/err.go deleted file mode 100644 index 233a78cef2..0000000000 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/err.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2020 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 externalaccount - -import "fmt" - -// Error for handling OAuth related error responses as stated in rfc6749#5.2. -type Error struct { - Code string - URI string - Description string -} - -func (err *Error) Error() string { - return fmt.Sprintf("got error code %s from %s: %s", err.Code, err.URI, err.Description) -} diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccount/filecredsource.go b/vendor/golang.org/x/oauth2/google/internal/externalaccount/filecredsource.go deleted file mode 100644 index e953ddb473..0000000000 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/filecredsource.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2020 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 externalaccount - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "os" -) - -type fileCredentialSource struct { - File string - Format format -} - -func (cs fileCredentialSource) subjectToken() (string, error) { - tokenFile, err := os.Open(cs.File) - if err != nil { - return "", fmt.Errorf("oauth2/google: failed to open credential file %q", cs.File) - } - defer tokenFile.Close() - tokenBytes, err := ioutil.ReadAll(io.LimitReader(tokenFile, 1<<20)) - if err != nil { - return "", fmt.Errorf("oauth2/google: failed to read credential file: %v", err) - } - tokenBytes = bytes.TrimSpace(tokenBytes) - switch cs.Format.Type { - case "json": - jsonData := make(map[string]interface{}) - err = json.Unmarshal(tokenBytes, &jsonData) - if err != nil { - return "", fmt.Errorf("oauth2/google: failed to unmarshal subject token file: %v", err) - } - val, ok := jsonData[cs.Format.SubjectTokenFieldName] - if !ok { - return "", errors.New("oauth2/google: provided subject_token_field_name not found in credentials") - } - token, ok := val.(string) - if !ok { - return "", errors.New("oauth2/google: improperly formatted subject token") - } - return token, nil - case "text": - return string(tokenBytes), nil - case "": - return string(tokenBytes), nil - default: - return "", errors.New("oauth2/google: invalid credential_source file format type") - } - -} diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccount/sts_exchange.go b/vendor/golang.org/x/oauth2/google/internal/externalaccount/sts_exchange.go deleted file mode 100644 index e6fcae5fcb..0000000000 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/sts_exchange.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2020 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 externalaccount - -import ( - "context" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "strconv" - "strings" - - "golang.org/x/oauth2" -) - -// exchangeToken performs an oauth2 token exchange with the provided endpoint. -// The first 4 fields are all mandatory. headers can be used to pass additional -// headers beyond the bare minimum required by the token exchange. options can -// be used to pass additional JSON-structured options to the remote server. -func exchangeToken(ctx context.Context, endpoint string, request *stsTokenExchangeRequest, authentication clientAuthentication, headers http.Header, options map[string]interface{}) (*stsTokenExchangeResponse, error) { - - client := oauth2.NewClient(ctx, nil) - - data := url.Values{} - data.Set("audience", request.Audience) - data.Set("grant_type", "urn:ietf:params:oauth:grant-type:token-exchange") - data.Set("requested_token_type", "urn:ietf:params:oauth:token-type:access_token") - data.Set("subject_token_type", request.SubjectTokenType) - data.Set("subject_token", request.SubjectToken) - data.Set("scope", strings.Join(request.Scope, " ")) - if options != nil { - opts, err := json.Marshal(options) - if err != nil { - return nil, fmt.Errorf("oauth2/google: failed to marshal additional options: %v", err) - } - data.Set("options", string(opts)) - } - - authentication.InjectAuthentication(data, headers) - encodedData := data.Encode() - - req, err := http.NewRequest("POST", endpoint, strings.NewReader(encodedData)) - if err != nil { - return nil, fmt.Errorf("oauth2/google: failed to properly build http request: %v", err) - - } - req = req.WithContext(ctx) - for key, list := range headers { - for _, val := range list { - req.Header.Add(key, val) - } - } - req.Header.Add("Content-Length", strconv.Itoa(len(encodedData))) - - resp, err := client.Do(req) - - if err != nil { - return nil, fmt.Errorf("oauth2/google: invalid response from Secure Token Server: %v", err) - } - defer resp.Body.Close() - - body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) - if err != nil { - return nil, err - } - if c := resp.StatusCode; c < 200 || c > 299 { - return nil, fmt.Errorf("oauth2/google: status code %d: %s", c, body) - } - var stsResp stsTokenExchangeResponse - err = json.Unmarshal(body, &stsResp) - if err != nil { - return nil, fmt.Errorf("oauth2/google: failed to unmarshal response body from Secure Token Server: %v", err) - - } - - return &stsResp, nil -} - -// stsTokenExchangeRequest contains fields necessary to make an oauth2 token exchange. -type stsTokenExchangeRequest struct { - ActingParty struct { - ActorToken string - ActorTokenType string - } - GrantType string - Resource string - Audience string - Scope []string - RequestedTokenType string - SubjectToken string - SubjectTokenType string -} - -// stsTokenExchangeResponse is used to decode the remote server response during an oauth2 token exchange. -type stsTokenExchangeResponse struct { - AccessToken string `json:"access_token"` - IssuedTokenType string `json:"issued_token_type"` - TokenType string `json:"token_type"` - ExpiresIn int `json:"expires_in"` - Scope string `json:"scope"` - RefreshToken string `json:"refresh_token"` -} diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccount/urlcredsource.go b/vendor/golang.org/x/oauth2/google/internal/externalaccount/urlcredsource.go deleted file mode 100644 index 16dca6541d..0000000000 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/urlcredsource.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2020 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 externalaccount - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "net/http" - - "golang.org/x/oauth2" -) - -type urlCredentialSource struct { - URL string - Headers map[string]string - Format format - ctx context.Context -} - -func (cs urlCredentialSource) subjectToken() (string, error) { - client := oauth2.NewClient(cs.ctx, nil) - req, err := http.NewRequest("GET", cs.URL, nil) - if err != nil { - return "", fmt.Errorf("oauth2/google: HTTP request for URL-sourced credential failed: %v", err) - } - req = req.WithContext(cs.ctx) - - for key, val := range cs.Headers { - req.Header.Add(key, val) - } - resp, err := client.Do(req) - if err != nil { - return "", fmt.Errorf("oauth2/google: invalid response when retrieving subject token: %v", err) - } - defer resp.Body.Close() - - respBody, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) - if err != nil { - return "", fmt.Errorf("oauth2/google: invalid body in subject token URL query: %v", err) - } - if c := resp.StatusCode; c < 200 || c > 299 { - return "", fmt.Errorf("oauth2/google: status code %d: %s", c, respBody) - } - - switch cs.Format.Type { - case "json": - jsonData := make(map[string]interface{}) - err = json.Unmarshal(respBody, &jsonData) - if err != nil { - return "", fmt.Errorf("oauth2/google: failed to unmarshal subject token file: %v", err) - } - val, ok := jsonData[cs.Format.SubjectTokenFieldName] - if !ok { - return "", errors.New("oauth2/google: provided subject_token_field_name not found in credentials") - } - token, ok := val.(string) - if !ok { - return "", errors.New("oauth2/google: improperly formatted subject token") - } - return token, nil - case "text": - return string(respBody), nil - case "": - return string(respBody), nil - default: - return "", errors.New("oauth2/google: invalid credential_source file format type") - } - -} diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccountauthorizeduser/externalaccountauthorizeduser.go b/vendor/golang.org/x/oauth2/google/internal/externalaccountauthorizeduser/externalaccountauthorizeduser.go new file mode 100644 index 0000000000..cb58207074 --- /dev/null +++ b/vendor/golang.org/x/oauth2/google/internal/externalaccountauthorizeduser/externalaccountauthorizeduser.go @@ -0,0 +1,114 @@ +// Copyright 2023 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 externalaccountauthorizeduser + +import ( + "context" + "errors" + "time" + + "golang.org/x/oauth2" + "golang.org/x/oauth2/google/internal/stsexchange" +) + +// now aliases time.Now for testing. +var now = func() time.Time { + return time.Now().UTC() +} + +var tokenValid = func(token oauth2.Token) bool { + return token.Valid() +} + +type Config struct { + // Audience is the Secure Token Service (STS) audience which contains the resource name for the workforce pool and + // the provider identifier in that pool. + Audience string + // RefreshToken is the optional OAuth 2.0 refresh token. If specified, credentials can be refreshed. + RefreshToken string + // TokenURL is the optional STS token exchange endpoint for refresh. Must be specified for refresh, can be left as + // None if the token can not be refreshed. + TokenURL string + // TokenInfoURL is the optional STS endpoint URL for token introspection. + TokenInfoURL string + // ClientID is only required in conjunction with ClientSecret, as described above. + ClientID string + // ClientSecret is currently only required if token_info endpoint also needs to be called with the generated GCP + // access token. When provided, STS will be called with additional basic authentication using client_id as username + // and client_secret as password. + ClientSecret string + // Token is the OAuth2.0 access token. Can be nil if refresh information is provided. + Token string + // Expiry is the optional expiration datetime of the OAuth 2.0 access token. + Expiry time.Time + // RevokeURL is the optional STS endpoint URL for revoking tokens. + RevokeURL string + // QuotaProjectID is the optional project ID used for quota and billing. This project may be different from the + // project used to create the credentials. + QuotaProjectID string + Scopes []string +} + +func (c *Config) canRefresh() bool { + return c.ClientID != "" && c.ClientSecret != "" && c.RefreshToken != "" && c.TokenURL != "" +} + +func (c *Config) TokenSource(ctx context.Context) (oauth2.TokenSource, error) { + var token oauth2.Token + if c.Token != "" && !c.Expiry.IsZero() { + token = oauth2.Token{ + AccessToken: c.Token, + Expiry: c.Expiry, + TokenType: "Bearer", + } + } + if !tokenValid(token) && !c.canRefresh() { + return nil, errors.New("oauth2/google: Token should be created with fields to make it valid (`token` and `expiry`), or fields to allow it to refresh (`refresh_token`, `token_url`, `client_id`, `client_secret`).") + } + + ts := tokenSource{ + ctx: ctx, + conf: c, + } + + return oauth2.ReuseTokenSource(&token, ts), nil +} + +type tokenSource struct { + ctx context.Context + conf *Config +} + +func (ts tokenSource) Token() (*oauth2.Token, error) { + conf := ts.conf + if !conf.canRefresh() { + return nil, errors.New("oauth2/google: The credentials do not contain the necessary fields need to refresh the access token. You must specify refresh_token, token_url, client_id, and client_secret.") + } + + clientAuth := stsexchange.ClientAuthentication{ + AuthStyle: oauth2.AuthStyleInHeader, + ClientID: conf.ClientID, + ClientSecret: conf.ClientSecret, + } + + stsResponse, err := stsexchange.RefreshAccessToken(ts.ctx, conf.TokenURL, conf.RefreshToken, clientAuth, nil) + if err != nil { + return nil, err + } + if stsResponse.ExpiresIn < 0 { + return nil, errors.New("oauth2/google: got invalid expiry from security token service") + } + + if stsResponse.RefreshToken != "" { + conf.RefreshToken = stsResponse.RefreshToken + } + + token := &oauth2.Token{ + AccessToken: stsResponse.AccessToken, + Expiry: now().Add(time.Duration(stsResponse.ExpiresIn) * time.Second), + TokenType: "Bearer", + } + return token, nil +} diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccount/impersonate.go b/vendor/golang.org/x/oauth2/google/internal/impersonate/impersonate.go similarity index 99% rename from vendor/golang.org/x/oauth2/google/internal/externalaccount/impersonate.go rename to vendor/golang.org/x/oauth2/google/internal/impersonate/impersonate.go index 54c8f209f3..6bc3af1103 100644 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/impersonate.go +++ b/vendor/golang.org/x/oauth2/google/internal/impersonate/impersonate.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package externalaccount +package impersonate import ( "bytes" diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccount/clientauth.go b/vendor/golang.org/x/oauth2/google/internal/stsexchange/clientauth.go similarity index 88% rename from vendor/golang.org/x/oauth2/google/internal/externalaccount/clientauth.go rename to vendor/golang.org/x/oauth2/google/internal/stsexchange/clientauth.go index 99987ce294..ebd520eace 100644 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/clientauth.go +++ b/vendor/golang.org/x/oauth2/google/internal/stsexchange/clientauth.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package externalaccount +package stsexchange import ( "encoding/base64" @@ -12,8 +12,8 @@ import ( "golang.org/x/oauth2" ) -// clientAuthentication represents an OAuth client ID and secret and the mechanism for passing these credentials as stated in rfc6749#2.3.1. -type clientAuthentication struct { +// ClientAuthentication represents an OAuth client ID and secret and the mechanism for passing these credentials as stated in rfc6749#2.3.1. +type ClientAuthentication struct { // AuthStyle can be either basic or request-body AuthStyle oauth2.AuthStyle ClientID string @@ -23,7 +23,7 @@ type clientAuthentication struct { // InjectAuthentication is used to add authentication to a Secure Token Service exchange // request. It modifies either the passed url.Values or http.Header depending on the desired // authentication format. -func (c *clientAuthentication) InjectAuthentication(values url.Values, headers http.Header) { +func (c *ClientAuthentication) InjectAuthentication(values url.Values, headers http.Header) { if c.ClientID == "" || c.ClientSecret == "" || values == nil || headers == nil { return } diff --git a/vendor/golang.org/x/oauth2/google/internal/stsexchange/sts_exchange.go b/vendor/golang.org/x/oauth2/google/internal/stsexchange/sts_exchange.go new file mode 100644 index 0000000000..1a0bebd159 --- /dev/null +++ b/vendor/golang.org/x/oauth2/google/internal/stsexchange/sts_exchange.go @@ -0,0 +1,125 @@ +// Copyright 2020 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 stsexchange + +import ( + "context" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "strconv" + "strings" + + "golang.org/x/oauth2" +) + +func defaultHeader() http.Header { + header := make(http.Header) + header.Add("Content-Type", "application/x-www-form-urlencoded") + return header +} + +// ExchangeToken performs an oauth2 token exchange with the provided endpoint. +// The first 4 fields are all mandatory. headers can be used to pass additional +// headers beyond the bare minimum required by the token exchange. options can +// be used to pass additional JSON-structured options to the remote server. +func ExchangeToken(ctx context.Context, endpoint string, request *TokenExchangeRequest, authentication ClientAuthentication, headers http.Header, options map[string]interface{}) (*Response, error) { + data := url.Values{} + data.Set("audience", request.Audience) + data.Set("grant_type", "urn:ietf:params:oauth:grant-type:token-exchange") + data.Set("requested_token_type", "urn:ietf:params:oauth:token-type:access_token") + data.Set("subject_token_type", request.SubjectTokenType) + data.Set("subject_token", request.SubjectToken) + data.Set("scope", strings.Join(request.Scope, " ")) + if options != nil { + opts, err := json.Marshal(options) + if err != nil { + return nil, fmt.Errorf("oauth2/google: failed to marshal additional options: %v", err) + } + data.Set("options", string(opts)) + } + + return makeRequest(ctx, endpoint, data, authentication, headers) +} + +func RefreshAccessToken(ctx context.Context, endpoint string, refreshToken string, authentication ClientAuthentication, headers http.Header) (*Response, error) { + data := url.Values{} + data.Set("grant_type", "refresh_token") + data.Set("refresh_token", refreshToken) + + return makeRequest(ctx, endpoint, data, authentication, headers) +} + +func makeRequest(ctx context.Context, endpoint string, data url.Values, authentication ClientAuthentication, headers http.Header) (*Response, error) { + if headers == nil { + headers = defaultHeader() + } + client := oauth2.NewClient(ctx, nil) + authentication.InjectAuthentication(data, headers) + encodedData := data.Encode() + + req, err := http.NewRequest("POST", endpoint, strings.NewReader(encodedData)) + if err != nil { + return nil, fmt.Errorf("oauth2/google: failed to properly build http request: %v", err) + } + req = req.WithContext(ctx) + for key, list := range headers { + for _, val := range list { + req.Header.Add(key, val) + } + } + req.Header.Add("Content-Length", strconv.Itoa(len(encodedData))) + + resp, err := client.Do(req) + + if err != nil { + return nil, fmt.Errorf("oauth2/google: invalid response from Secure Token Server: %v", err) + } + defer resp.Body.Close() + + body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) + if err != nil { + return nil, err + } + if c := resp.StatusCode; c < 200 || c > 299 { + return nil, fmt.Errorf("oauth2/google: status code %d: %s", c, body) + } + var stsResp Response + err = json.Unmarshal(body, &stsResp) + if err != nil { + return nil, fmt.Errorf("oauth2/google: failed to unmarshal response body from Secure Token Server: %v", err) + + } + + return &stsResp, nil +} + +// TokenExchangeRequest contains fields necessary to make an oauth2 token exchange. +type TokenExchangeRequest struct { + ActingParty struct { + ActorToken string + ActorTokenType string + } + GrantType string + Resource string + Audience string + Scope []string + RequestedTokenType string + SubjectToken string + SubjectTokenType string +} + +// Response is used to decode the remote server response during an oauth2 token exchange. +type Response struct { + AccessToken string `json:"access_token"` + IssuedTokenType string `json:"issued_token_type"` + TokenType string `json:"token_type"` + ExpiresIn int `json:"expires_in"` + Scope string `json:"scope"` + RefreshToken string `json:"refresh_token"` +} diff --git a/vendor/golang.org/x/oauth2/internal/client_appengine.go b/vendor/golang.org/x/oauth2/internal/client_appengine.go deleted file mode 100644 index e1755d1d9a..0000000000 --- a/vendor/golang.org/x/oauth2/internal/client_appengine.go +++ /dev/null @@ -1,14 +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. - -//go:build appengine -// +build appengine - -package internal - -import "google.golang.org/appengine/urlfetch" - -func init() { - appengineClientHook = urlfetch.Client -} diff --git a/vendor/golang.org/x/oauth2/internal/oauth2.go b/vendor/golang.org/x/oauth2/internal/oauth2.go index c0ab196cf4..14989beaf4 100644 --- a/vendor/golang.org/x/oauth2/internal/oauth2.go +++ b/vendor/golang.org/x/oauth2/internal/oauth2.go @@ -14,7 +14,7 @@ import ( // ParseKey converts the binary contents of a private key file // to an *rsa.PrivateKey. It detects whether the private key is in a -// PEM container or not. If so, it extracts the the private key +// PEM container or not. If so, it extracts the private key // from PEM container before conversion. It only supports PEM // containers with no passphrase. func ParseKey(key []byte) (*rsa.PrivateKey, error) { diff --git a/vendor/golang.org/x/oauth2/internal/token.go b/vendor/golang.org/x/oauth2/internal/token.go index b4723fcace..e83ddeef0f 100644 --- a/vendor/golang.org/x/oauth2/internal/token.go +++ b/vendor/golang.org/x/oauth2/internal/token.go @@ -18,6 +18,7 @@ import ( "strconv" "strings" "sync" + "sync/atomic" "time" ) @@ -55,12 +56,18 @@ type Token struct { } // tokenJSON is the struct representing the HTTP response from OAuth2 -// providers returning a token in JSON form. +// providers returning a token or error in JSON form. +// https://datatracker.ietf.org/doc/html/rfc6749#section-5.1 type tokenJSON struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` RefreshToken string `json:"refresh_token"` ExpiresIn expirationTime `json:"expires_in"` // at least PayPal returns string, while most return number + // error fields + // https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 + ErrorCode string `json:"error"` + ErrorDescription string `json:"error_description"` + ErrorURI string `json:"error_uri"` } func (e *tokenJSON) expiry() (t time.Time) { @@ -109,41 +116,60 @@ const ( AuthStyleInHeader AuthStyle = 2 ) -// authStyleCache is the set of tokenURLs we've successfully used via +// LazyAuthStyleCache is a backwards compatibility compromise to let Configs +// have a lazily-initialized AuthStyleCache. +// +// The two users of this, oauth2.Config and oauth2/clientcredentials.Config, +// both would ideally just embed an unexported AuthStyleCache but because both +// were historically allowed to be copied by value we can't retroactively add an +// uncopyable Mutex to them. +// +// We could use an atomic.Pointer, but that was added recently enough (in Go +// 1.18) that we'd break Go 1.17 users where the tests as of 2023-08-03 +// still pass. By using an atomic.Value, it supports both Go 1.17 and +// copying by value, even if that's not ideal. +type LazyAuthStyleCache struct { + v atomic.Value // of *AuthStyleCache +} + +func (lc *LazyAuthStyleCache) Get() *AuthStyleCache { + if c, ok := lc.v.Load().(*AuthStyleCache); ok { + return c + } + c := new(AuthStyleCache) + if !lc.v.CompareAndSwap(nil, c) { + c = lc.v.Load().(*AuthStyleCache) + } + return c +} + +// AuthStyleCache is the set of tokenURLs we've successfully used via // RetrieveToken and which style auth we ended up using. // It's called a cache, but it doesn't (yet?) shrink. It's expected that // the set of OAuth2 servers a program contacts over time is fixed and // small. -var authStyleCache struct { - sync.Mutex - m map[string]AuthStyle // keyed by tokenURL -} - -// ResetAuthCache resets the global authentication style cache used -// for AuthStyleUnknown token requests. -func ResetAuthCache() { - authStyleCache.Lock() - defer authStyleCache.Unlock() - authStyleCache.m = nil +type AuthStyleCache struct { + mu sync.Mutex + m map[string]AuthStyle // keyed by tokenURL } // lookupAuthStyle reports which auth style we last used with tokenURL // when calling RetrieveToken and whether we have ever done so. -func lookupAuthStyle(tokenURL string) (style AuthStyle, ok bool) { - authStyleCache.Lock() - defer authStyleCache.Unlock() - style, ok = authStyleCache.m[tokenURL] +func (c *AuthStyleCache) lookupAuthStyle(tokenURL string) (style AuthStyle, ok bool) { + c.mu.Lock() + defer c.mu.Unlock() + style, ok = c.m[tokenURL] return } // setAuthStyle adds an entry to authStyleCache, documented above. -func setAuthStyle(tokenURL string, v AuthStyle) { - authStyleCache.Lock() - defer authStyleCache.Unlock() - if authStyleCache.m == nil { - authStyleCache.m = make(map[string]AuthStyle) +func (c *AuthStyleCache) setAuthStyle(tokenURL string, v AuthStyle) { + c.mu.Lock() + defer c.mu.Unlock() + if c.m == nil { + c.m = make(map[string]AuthStyle) } - authStyleCache.m[tokenURL] = v + c.m[tokenURL] = v } // newTokenRequest returns a new *http.Request to retrieve a new token @@ -183,10 +209,10 @@ func cloneURLValues(v url.Values) url.Values { return v2 } -func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string, v url.Values, authStyle AuthStyle) (*Token, error) { +func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string, v url.Values, authStyle AuthStyle, styleCache *AuthStyleCache) (*Token, error) { needsAuthStyleProbe := authStyle == 0 if needsAuthStyleProbe { - if style, ok := lookupAuthStyle(tokenURL); ok { + if style, ok := styleCache.lookupAuthStyle(tokenURL); ok { authStyle = style needsAuthStyleProbe = false } else { @@ -216,7 +242,7 @@ func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string, token, err = doTokenRoundTrip(ctx, req) } if needsAuthStyleProbe && err == nil { - setAuthStyle(tokenURL, authStyle) + styleCache.setAuthStyle(tokenURL, authStyle) } // Don't overwrite `RefreshToken` with an empty value // if this was a token refreshing request. @@ -236,21 +262,29 @@ func doTokenRoundTrip(ctx context.Context, req *http.Request) (*Token, error) { if err != nil { return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) } - if code := r.StatusCode; code < 200 || code > 299 { - return nil, &RetrieveError{ - Response: r, - Body: body, - } + + failureStatus := r.StatusCode < 200 || r.StatusCode > 299 + retrieveError := &RetrieveError{ + Response: r, + Body: body, + // attempt to populate error detail below } var token *Token content, _, _ := mime.ParseMediaType(r.Header.Get("Content-Type")) switch content { case "application/x-www-form-urlencoded", "text/plain": + // some endpoints return a query string vals, err := url.ParseQuery(string(body)) if err != nil { - return nil, err + if failureStatus { + return nil, retrieveError + } + return nil, fmt.Errorf("oauth2: cannot parse response: %v", err) } + retrieveError.ErrorCode = vals.Get("error") + retrieveError.ErrorDescription = vals.Get("error_description") + retrieveError.ErrorURI = vals.Get("error_uri") token = &Token{ AccessToken: vals.Get("access_token"), TokenType: vals.Get("token_type"), @@ -265,8 +299,14 @@ func doTokenRoundTrip(ctx context.Context, req *http.Request) (*Token, error) { default: var tj tokenJSON if err = json.Unmarshal(body, &tj); err != nil { - return nil, err + if failureStatus { + return nil, retrieveError + } + return nil, fmt.Errorf("oauth2: cannot parse json: %v", err) } + retrieveError.ErrorCode = tj.ErrorCode + retrieveError.ErrorDescription = tj.ErrorDescription + retrieveError.ErrorURI = tj.ErrorURI token = &Token{ AccessToken: tj.AccessToken, TokenType: tj.TokenType, @@ -276,17 +316,37 @@ func doTokenRoundTrip(ctx context.Context, req *http.Request) (*Token, error) { } json.Unmarshal(body, &token.Raw) // no error checks for optional fields } + // according to spec, servers should respond status 400 in error case + // https://www.rfc-editor.org/rfc/rfc6749#section-5.2 + // but some unorthodox servers respond 200 in error case + if failureStatus || retrieveError.ErrorCode != "" { + return nil, retrieveError + } if token.AccessToken == "" { return nil, errors.New("oauth2: server response missing access_token") } return token, nil } +// mirrors oauth2.RetrieveError type RetrieveError struct { - Response *http.Response - Body []byte + Response *http.Response + Body []byte + ErrorCode string + ErrorDescription string + ErrorURI string } func (r *RetrieveError) Error() string { + if r.ErrorCode != "" { + s := fmt.Sprintf("oauth2: %q", r.ErrorCode) + if r.ErrorDescription != "" { + s += fmt.Sprintf(" %q", r.ErrorDescription) + } + if r.ErrorURI != "" { + s += fmt.Sprintf(" %q", r.ErrorURI) + } + return s + } return fmt.Sprintf("oauth2: cannot fetch token: %v\nResponse: %s", r.Response.Status, r.Body) } diff --git a/vendor/golang.org/x/oauth2/internal/transport.go b/vendor/golang.org/x/oauth2/internal/transport.go index 572074a637..b9db01ddfd 100644 --- a/vendor/golang.org/x/oauth2/internal/transport.go +++ b/vendor/golang.org/x/oauth2/internal/transport.go @@ -18,16 +18,11 @@ var HTTPClient ContextKey // because nobody else can create a ContextKey, being unexported. type ContextKey struct{} -var appengineClientHook func(context.Context) *http.Client - func ContextClient(ctx context.Context) *http.Client { if ctx != nil { if hc, ok := ctx.Value(HTTPClient).(*http.Client); ok { return hc } } - if appengineClientHook != nil { - return appengineClientHook(ctx) - } return http.DefaultClient } diff --git a/vendor/golang.org/x/oauth2/oauth2.go b/vendor/golang.org/x/oauth2/oauth2.go index 9085fabe34..09f6a49b80 100644 --- a/vendor/golang.org/x/oauth2/oauth2.go +++ b/vendor/golang.org/x/oauth2/oauth2.go @@ -58,6 +58,10 @@ type Config struct { // Scope specifies optional requested permissions. Scopes []string + + // authStyleCache caches which auth style to use when Endpoint.AuthStyle is + // the zero value (AuthStyleAutoDetect). + authStyleCache internal.LazyAuthStyleCache } // A TokenSource is anything that can return a token. @@ -71,8 +75,9 @@ type TokenSource interface { // Endpoint represents an OAuth 2.0 provider's authorization and token // endpoint URLs. type Endpoint struct { - AuthURL string - TokenURL string + AuthURL string + DeviceAuthURL string + TokenURL string // AuthStyle optionally specifies how the endpoint wants the // client ID & client secret sent. The zero value means to @@ -139,15 +144,19 @@ func SetAuthURLParam(key, value string) AuthCodeOption { // AuthCodeURL returns a URL to OAuth 2.0 provider's consent page // that asks for permissions for the required scopes explicitly. // -// State is a token to protect the user from CSRF attacks. You must -// always provide a non-empty string and validate that it matches the -// state query parameter on your redirect callback. -// See http://tools.ietf.org/html/rfc6749#section-10.12 for more info. +// State is an opaque value used by the client to maintain state between the +// request and callback. The authorization server includes this value when +// redirecting the user agent back to the client. // // Opts may include AccessTypeOnline or AccessTypeOffline, as well // as ApprovalForce. -// It can also be used to pass the PKCE challenge. -// See https://www.oauth.com/oauth2-servers/pkce/ for more info. +// +// To protect against CSRF attacks, opts should include a PKCE challenge +// (S256ChallengeOption). Not all servers support PKCE. An alternative is to +// generate a random state parameter and verify it after exchange. +// See https://datatracker.ietf.org/doc/html/rfc6749#section-10.12 (predating +// PKCE), https://www.oauth.com/oauth2-servers/pkce/ and +// https://www.ietf.org/archive/id/draft-ietf-oauth-v2-1-09.html#name-cross-site-request-forgery (describing both approaches) func (c *Config) AuthCodeURL(state string, opts ...AuthCodeOption) string { var buf bytes.Buffer buf.WriteString(c.Endpoint.AuthURL) @@ -162,7 +171,6 @@ func (c *Config) AuthCodeURL(state string, opts ...AuthCodeOption) string { v.Set("scope", strings.Join(c.Scopes, " ")) } if state != "" { - // TODO(light): Docs say never to omit state; don't allow empty. v.Set("state", state) } for _, opt := range opts { @@ -207,10 +215,11 @@ func (c *Config) PasswordCredentialsToken(ctx context.Context, username, passwor // The provided context optionally controls which HTTP client is used. See the HTTPClient variable. // // The code will be in the *http.Request.FormValue("code"). Before -// calling Exchange, be sure to validate FormValue("state"). +// calling Exchange, be sure to validate FormValue("state") if you are +// using it to protect against CSRF attacks. // -// Opts may include the PKCE verifier code if previously used in AuthCodeURL. -// See https://www.oauth.com/oauth2-servers/pkce/ for more info. +// If using PKCE to protect against CSRF attacks, opts should include a +// VerifierOption. func (c *Config) Exchange(ctx context.Context, code string, opts ...AuthCodeOption) (*Token, error) { v := url.Values{ "grant_type": {"authorization_code"}, @@ -384,7 +393,7 @@ func ReuseTokenSource(t *Token, src TokenSource) TokenSource { } } -// ReuseTokenSource returns a TokenSource that acts in the same manner as the +// ReuseTokenSourceWithExpiry returns a TokenSource that acts in the same manner as the // TokenSource returned by ReuseTokenSource, except the expiry buffer is // configurable. The expiration time of a token is calculated as // t.Expiry.Add(-earlyExpiry). diff --git a/vendor/golang.org/x/oauth2/pkce.go b/vendor/golang.org/x/oauth2/pkce.go new file mode 100644 index 0000000000..50593b6dfe --- /dev/null +++ b/vendor/golang.org/x/oauth2/pkce.go @@ -0,0 +1,68 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +package oauth2 + +import ( + "crypto/rand" + "crypto/sha256" + "encoding/base64" + "net/url" +) + +const ( + codeChallengeKey = "code_challenge" + codeChallengeMethodKey = "code_challenge_method" + codeVerifierKey = "code_verifier" +) + +// GenerateVerifier generates a PKCE code verifier with 32 octets of randomness. +// This follows recommendations in RFC 7636. +// +// A fresh verifier should be generated for each authorization. +// S256ChallengeOption(verifier) should then be passed to Config.AuthCodeURL +// (or Config.DeviceAccess) and VerifierOption(verifier) to Config.Exchange +// (or Config.DeviceAccessToken). +func GenerateVerifier() string { + // "RECOMMENDED that the output of a suitable random number generator be + // used to create a 32-octet sequence. The octet sequence is then + // base64url-encoded to produce a 43-octet URL-safe string to use as the + // code verifier." + // https://datatracker.ietf.org/doc/html/rfc7636#section-4.1 + data := make([]byte, 32) + if _, err := rand.Read(data); err != nil { + panic(err) + } + return base64.RawURLEncoding.EncodeToString(data) +} + +// VerifierOption returns a PKCE code verifier AuthCodeOption. It should be +// passed to Config.Exchange or Config.DeviceAccessToken only. +func VerifierOption(verifier string) AuthCodeOption { + return setParam{k: codeVerifierKey, v: verifier} +} + +// S256ChallengeFromVerifier returns a PKCE code challenge derived from verifier with method S256. +// +// Prefer to use S256ChallengeOption where possible. +func S256ChallengeFromVerifier(verifier string) string { + sha := sha256.Sum256([]byte(verifier)) + return base64.RawURLEncoding.EncodeToString(sha[:]) +} + +// S256ChallengeOption derives a PKCE code challenge derived from verifier with +// method S256. It should be passed to Config.AuthCodeURL or Config.DeviceAccess +// only. +func S256ChallengeOption(verifier string) AuthCodeOption { + return challengeOption{ + challenge_method: "S256", + challenge: S256ChallengeFromVerifier(verifier), + } +} + +type challengeOption struct{ challenge_method, challenge string } + +func (p challengeOption) setValue(m url.Values) { + m.Set(codeChallengeMethodKey, p.challenge_method) + m.Set(codeChallengeKey, p.challenge) +} diff --git a/vendor/golang.org/x/oauth2/token.go b/vendor/golang.org/x/oauth2/token.go index 7c64006de6..5bbb332174 100644 --- a/vendor/golang.org/x/oauth2/token.go +++ b/vendor/golang.org/x/oauth2/token.go @@ -164,7 +164,7 @@ func tokenFromInternal(t *internal.Token) *Token { // This token is then mapped from *internal.Token into an *oauth2.Token which is returned along // with an error.. func retrieveToken(ctx context.Context, c *Config, v url.Values) (*Token, error) { - tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.Endpoint.TokenURL, v, internal.AuthStyle(c.Endpoint.AuthStyle)) + tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.Endpoint.TokenURL, v, internal.AuthStyle(c.Endpoint.AuthStyle), c.authStyleCache.Get()) if err != nil { if rErr, ok := err.(*internal.RetrieveError); ok { return nil, (*RetrieveError)(rErr) @@ -175,14 +175,31 @@ func retrieveToken(ctx context.Context, c *Config, v url.Values) (*Token, error) } // RetrieveError is the error returned when the token endpoint returns a -// non-2XX HTTP status code. +// non-2XX HTTP status code or populates RFC 6749's 'error' parameter. +// https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 type RetrieveError struct { Response *http.Response // Body is the body that was consumed by reading Response.Body. // It may be truncated. Body []byte + // ErrorCode is RFC 6749's 'error' parameter. + ErrorCode string + // ErrorDescription is RFC 6749's 'error_description' parameter. + ErrorDescription string + // ErrorURI is RFC 6749's 'error_uri' parameter. + ErrorURI string } func (r *RetrieveError) Error() string { + if r.ErrorCode != "" { + s := fmt.Sprintf("oauth2: %q", r.ErrorCode) + if r.ErrorDescription != "" { + s += fmt.Sprintf(" %q", r.ErrorDescription) + } + if r.ErrorURI != "" { + s += fmt.Sprintf(" %q", r.ErrorURI) + } + return s + } return fmt.Sprintf("oauth2: cannot fetch token: %v\nResponse: %s", r.Response.Status, r.Body) } diff --git a/vendor/golang.org/x/sync/LICENSE b/vendor/golang.org/x/sync/LICENSE index 6a66aea5ea..2a7cf70da6 100644 --- a/vendor/golang.org/x/sync/LICENSE +++ b/vendor/golang.org/x/sync/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. 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 + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/vendor/golang.org/x/sync/errgroup/errgroup.go b/vendor/golang.org/x/sync/errgroup/errgroup.go index cbee7a4e23..948a3ee63d 100644 --- a/vendor/golang.org/x/sync/errgroup/errgroup.go +++ b/vendor/golang.org/x/sync/errgroup/errgroup.go @@ -4,6 +4,9 @@ // Package errgroup provides synchronization, error propagation, and Context // cancelation for groups of goroutines working on subtasks of a common task. +// +// [errgroup.Group] is related to [sync.WaitGroup] but adds handling of tasks +// returning errors. package errgroup import ( @@ -20,7 +23,7 @@ type token struct{} // A zero Group is valid, has no limit on the number of active goroutines, // and does not cancel on error. type Group struct { - cancel func() + cancel func(error) wg sync.WaitGroup @@ -43,7 +46,7 @@ func (g *Group) done() { // returns a non-nil error or the first time Wait returns, whichever occurs // first. func WithContext(ctx context.Context) (*Group, context.Context) { - ctx, cancel := context.WithCancel(ctx) + ctx, cancel := withCancelCause(ctx) return &Group{cancel: cancel}, ctx } @@ -52,7 +55,7 @@ func WithContext(ctx context.Context) (*Group, context.Context) { func (g *Group) Wait() error { g.wg.Wait() if g.cancel != nil { - g.cancel() + g.cancel(g.err) } return g.err } @@ -76,7 +79,7 @@ func (g *Group) Go(f func() error) { g.errOnce.Do(func() { g.err = err if g.cancel != nil { - g.cancel() + g.cancel(g.err) } }) } @@ -105,7 +108,7 @@ func (g *Group) TryGo(f func() error) bool { g.errOnce.Do(func() { g.err = err if g.cancel != nil { - g.cancel() + g.cancel(g.err) } }) } diff --git a/vendor/golang.org/x/sync/errgroup/go120.go b/vendor/golang.org/x/sync/errgroup/go120.go new file mode 100644 index 0000000000..f93c740b63 --- /dev/null +++ b/vendor/golang.org/x/sync/errgroup/go120.go @@ -0,0 +1,13 @@ +// Copyright 2023 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:build go1.20 + +package errgroup + +import "context" + +func withCancelCause(parent context.Context) (context.Context, func(error)) { + return context.WithCancelCause(parent) +} diff --git a/vendor/golang.org/x/sync/errgroup/pre_go120.go b/vendor/golang.org/x/sync/errgroup/pre_go120.go new file mode 100644 index 0000000000..88ce33434e --- /dev/null +++ b/vendor/golang.org/x/sync/errgroup/pre_go120.go @@ -0,0 +1,14 @@ +// Copyright 2023 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:build !go1.20 + +package errgroup + +import "context" + +func withCancelCause(parent context.Context) (context.Context, func(error)) { + ctx, cancel := context.WithCancel(parent) + return ctx, func(error) { cancel() } +} diff --git a/vendor/golang.org/x/sys/LICENSE b/vendor/golang.org/x/sys/LICENSE index 6a66aea5ea..2a7cf70da6 100644 --- a/vendor/golang.org/x/sys/LICENSE +++ b/vendor/golang.org/x/sys/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. 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 + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go index 4756ad5f79..ec07aab057 100644 --- a/vendor/golang.org/x/sys/cpu/cpu.go +++ b/vendor/golang.org/x/sys/cpu/cpu.go @@ -103,7 +103,10 @@ var ARM64 struct { HasASIMDDP bool // Advanced SIMD double precision instruction set HasSHA512 bool // SHA512 hardware implementation HasSVE bool // Scalable Vector Extensions + HasSVE2 bool // Scalable Vector Extensions 2 HasASIMDFHM bool // Advanced SIMD multiplication FP16 to FP32 + HasDIT bool // Data Independent Timing support + HasI8MM bool // Advanced SIMD Int8 matrix multiplication instructions _ CacheLinePad } diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_arm64.go index f3eb993bf2..af2aa99f9f 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.go @@ -28,6 +28,7 @@ func initOptions() { {Name: "sm3", Feature: &ARM64.HasSM3}, {Name: "sm4", Feature: &ARM64.HasSM4}, {Name: "sve", Feature: &ARM64.HasSVE}, + {Name: "sve2", Feature: &ARM64.HasSVE2}, {Name: "crc32", Feature: &ARM64.HasCRC32}, {Name: "atomics", Feature: &ARM64.HasATOMICS}, {Name: "asimdhp", Feature: &ARM64.HasASIMDHP}, @@ -37,6 +38,8 @@ func initOptions() { {Name: "dcpop", Feature: &ARM64.HasDCPOP}, {Name: "asimddp", Feature: &ARM64.HasASIMDDP}, {Name: "asimdfhm", Feature: &ARM64.HasASIMDFHM}, + {Name: "dit", Feature: &ARM64.HasDIT}, + {Name: "i8mm", Feature: &ARM64.HasI8MM}, } } @@ -144,6 +147,11 @@ func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) { ARM64.HasLRCPC = true } + switch extractBits(isar1, 52, 55) { + case 1: + ARM64.HasI8MM = true + } + // ID_AA64PFR0_EL1 switch extractBits(pfr0, 16, 19) { case 0: @@ -164,6 +172,20 @@ func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) { switch extractBits(pfr0, 32, 35) { case 1: ARM64.HasSVE = true + + parseARM64SVERegister(getzfr0()) + } + + switch extractBits(pfr0, 48, 51) { + case 1: + ARM64.HasDIT = true + } +} + +func parseARM64SVERegister(zfr0 uint64) { + switch extractBits(zfr0, 0, 3) { + case 1: + ARM64.HasSVE2 = true } } diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.s b/vendor/golang.org/x/sys/cpu/cpu_arm64.s index fcb9a38882..22cc99844a 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_arm64.s +++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.s @@ -29,3 +29,11 @@ TEXT ·getpfr0(SB),NOSPLIT,$0-8 WORD $0xd5380400 MOVD R0, ret+0(FP) RET + +// func getzfr0() uint64 +TEXT ·getzfr0(SB),NOSPLIT,$0-8 + // get SVE Feature Register 0 into x0 + // mrs x0, ID_AA64ZFR0_EL1 = d5380480 + WORD $0xd5380480 + MOVD R0, ret+0(FP) + RET diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go index a8acd3e328..6ac6e1efb2 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go @@ -9,3 +9,4 @@ package cpu func getisar0() uint64 func getisar1() uint64 func getpfr0() uint64 +func getzfr0() uint64 diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go index a968b80fa6..08f35ea177 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go @@ -35,6 +35,10 @@ const ( hwcap_SHA512 = 1 << 21 hwcap_SVE = 1 << 22 hwcap_ASIMDFHM = 1 << 23 + hwcap_DIT = 1 << 24 + + hwcap2_SVE2 = 1 << 1 + hwcap2_I8MM = 1 << 13 ) // linuxKernelCanEmulateCPUID reports whether we're running @@ -104,6 +108,12 @@ func doinit() { ARM64.HasSHA512 = isSet(hwCap, hwcap_SHA512) ARM64.HasSVE = isSet(hwCap, hwcap_SVE) ARM64.HasASIMDFHM = isSet(hwCap, hwcap_ASIMDFHM) + ARM64.HasDIT = isSet(hwCap, hwcap_DIT) + + + // HWCAP2 feature bits + ARM64.HasSVE2 = isSet(hwCap2, hwcap2_SVE2) + ARM64.HasI8MM = isSet(hwCap2, hwcap2_I8MM) } func isSet(hwc uint, value uint) bool { diff --git a/vendor/golang.org/x/sys/execabs/execabs.go b/vendor/golang.org/x/sys/execabs/execabs.go deleted file mode 100644 index 3bf40fdfec..0000000000 --- a/vendor/golang.org/x/sys/execabs/execabs.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2020 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 execabs is a drop-in replacement for os/exec -// that requires PATH lookups to find absolute paths. -// That is, execabs.Command("cmd") runs the same PATH lookup -// as exec.Command("cmd"), but if the result is a path -// which is relative, the Run and Start methods will report -// an error instead of running the executable. -// -// See https://blog.golang.org/path-security for more information -// about when it may be necessary or appropriate to use this package. -package execabs - -import ( - "context" - "fmt" - "os/exec" - "path/filepath" - "reflect" - "unsafe" -) - -// ErrNotFound is the error resulting if a path search failed to find an executable file. -// It is an alias for exec.ErrNotFound. -var ErrNotFound = exec.ErrNotFound - -// Cmd represents an external command being prepared or run. -// It is an alias for exec.Cmd. -type Cmd = exec.Cmd - -// Error is returned by LookPath when it fails to classify a file as an executable. -// It is an alias for exec.Error. -type Error = exec.Error - -// An ExitError reports an unsuccessful exit by a command. -// It is an alias for exec.ExitError. -type ExitError = exec.ExitError - -func relError(file, path string) error { - return fmt.Errorf("%s resolves to executable in current directory (.%c%s)", file, filepath.Separator, path) -} - -// LookPath searches for an executable named file in the directories -// named by the PATH environment variable. If file contains a slash, -// it is tried directly and the PATH is not consulted. The result will be -// an absolute path. -// -// LookPath differs from exec.LookPath in its handling of PATH lookups, -// which are used for file names without slashes. If exec.LookPath's -// PATH lookup would have returned an executable from the current directory, -// LookPath instead returns an error. -func LookPath(file string) (string, error) { - path, err := exec.LookPath(file) - if err != nil && !isGo119ErrDot(err) { - return "", err - } - if filepath.Base(file) == file && !filepath.IsAbs(path) { - return "", relError(file, path) - } - return path, nil -} - -func fixCmd(name string, cmd *exec.Cmd) { - if filepath.Base(name) == name && !filepath.IsAbs(cmd.Path) && !isGo119ErrFieldSet(cmd) { - // exec.Command was called with a bare binary name and - // exec.LookPath returned a path which is not absolute. - // Set cmd.lookPathErr and clear cmd.Path so that it - // cannot be run. - lookPathErr := (*error)(unsafe.Pointer(reflect.ValueOf(cmd).Elem().FieldByName("lookPathErr").Addr().Pointer())) - if *lookPathErr == nil { - *lookPathErr = relError(name, cmd.Path) - } - cmd.Path = "" - } -} - -// CommandContext is like Command but includes a context. -// -// The provided context is used to kill the process (by calling os.Process.Kill) -// if the context becomes done before the command completes on its own. -func CommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd { - cmd := exec.CommandContext(ctx, name, arg...) - fixCmd(name, cmd) - return cmd - -} - -// Command returns the Cmd struct to execute the named program with the given arguments. -// See exec.Command for most details. -// -// Command differs from exec.Command in its handling of PATH lookups, -// which are used when the program name contains no slashes. -// If exec.Command would have returned an exec.Cmd configured to run an -// executable from the current directory, Command instead -// returns an exec.Cmd that will return an error from Start or Run. -func Command(name string, arg ...string) *exec.Cmd { - cmd := exec.Command(name, arg...) - fixCmd(name, cmd) - return cmd -} diff --git a/vendor/golang.org/x/sys/execabs/execabs_go118.go b/vendor/golang.org/x/sys/execabs/execabs_go118.go deleted file mode 100644 index 5627d70e39..0000000000 --- a/vendor/golang.org/x/sys/execabs/execabs_go118.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2022 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:build !go1.19 - -package execabs - -import "os/exec" - -func isGo119ErrDot(err error) bool { - return false -} - -func isGo119ErrFieldSet(cmd *exec.Cmd) bool { - return false -} diff --git a/vendor/golang.org/x/sys/execabs/execabs_go119.go b/vendor/golang.org/x/sys/execabs/execabs_go119.go deleted file mode 100644 index d60ab1b419..0000000000 --- a/vendor/golang.org/x/sys/execabs/execabs_go119.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2022 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:build go1.19 - -package execabs - -import ( - "errors" - "os/exec" -) - -func isGo119ErrDot(err error) bool { - return errors.Is(err, exec.ErrDot) -} - -func isGo119ErrFieldSet(cmd *exec.Cmd) bool { - return cmd.Err != nil -} diff --git a/vendor/golang.org/x/sys/unix/asm_zos_s390x.s b/vendor/golang.org/x/sys/unix/asm_zos_s390x.s index 2f67ba86d5..813dfad7d2 100644 --- a/vendor/golang.org/x/sys/unix/asm_zos_s390x.s +++ b/vendor/golang.org/x/sys/unix/asm_zos_s390x.s @@ -9,9 +9,11 @@ #define PSALAA 1208(R0) #define GTAB64(x) 80(x) #define LCA64(x) 88(x) +#define SAVSTACK_ASYNC(x) 336(x) // in the LCA #define CAA(x) 8(x) -#define EDCHPXV(x) 1016(x) // in the CAA -#define SAVSTACK_ASYNC(x) 336(x) // in the LCA +#define CEECAATHDID(x) 976(x) // in the CAA +#define EDCHPXV(x) 1016(x) // in the CAA +#define GOCB(x) 1104(x) // in the CAA // SS_*, where x=SAVSTACK_ASYNC #define SS_LE(x) 0(x) @@ -19,405 +21,362 @@ #define SS_ERRNO(x) 16(x) #define SS_ERRNOJR(x) 20(x) -#define LE_CALL BYTE $0x0D; BYTE $0x76; // BL R7, R6 +// Function Descriptor Offsets +#define __errno 0x156*16 +#define __err2ad 0x16C*16 -TEXT ·clearErrno(SB),NOSPLIT,$0-0 - BL addrerrno<>(SB) - MOVD $0, 0(R3) +// Call Instructions +#define LE_CALL BYTE $0x0D; BYTE $0x76 // BL R7, R6 +#define SVC_LOAD BYTE $0x0A; BYTE $0x08 // SVC 08 LOAD +#define SVC_DELETE BYTE $0x0A; BYTE $0x09 // SVC 09 DELETE + +DATA zosLibVec<>(SB)/8, $0 +GLOBL zosLibVec<>(SB), NOPTR, $8 + +TEXT ·initZosLibVec(SB), NOSPLIT|NOFRAME, $0-0 + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 + MOVD CAA(R8), R8 + MOVD EDCHPXV(R8), R8 + MOVD R8, zosLibVec<>(SB) + RET + +TEXT ·GetZosLibVec(SB), NOSPLIT|NOFRAME, $0-0 + MOVD zosLibVec<>(SB), R8 + MOVD R8, ret+0(FP) + RET + +TEXT ·clearErrno(SB), NOSPLIT, $0-0 + BL addrerrno<>(SB) + MOVD $0, 0(R3) RET // Returns the address of errno in R3. -TEXT addrerrno<>(SB),NOSPLIT|NOFRAME,$0-0 +TEXT addrerrno<>(SB), NOSPLIT|NOFRAME, $0-0 // Get library control area (LCA). - MOVW PSALAA, R8 - MOVD LCA64(R8), R8 + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 // Get __errno FuncDesc. - MOVD CAA(R8), R9 - MOVD EDCHPXV(R9), R9 - ADD $(0x156*16), R9 - LMG 0(R9), R5, R6 + MOVD CAA(R8), R9 + MOVD EDCHPXV(R9), R9 + ADD $(__errno), R9 + LMG 0(R9), R5, R6 // Switch to saved LE stack. - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD 0(R9), R4 - MOVD $0, 0(R9) + MOVD SAVSTACK_ASYNC(R8), R9 + MOVD 0(R9), R4 + MOVD $0, 0(R9) // Call __errno function. LE_CALL NOPH // Switch back to Go stack. - XOR R0, R0 // Restore R0 to $0. - MOVD R4, 0(R9) // Save stack pointer. + XOR R0, R0 // Restore R0 to $0. + MOVD R4, 0(R9) // Save stack pointer. RET -TEXT ·syscall_syscall(SB),NOSPLIT,$0-56 - BL runtime·entersyscall(SB) - MOVD a1+8(FP), R1 - MOVD a2+16(FP), R2 - MOVD a3+24(FP), R3 +// func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64) +TEXT ·svcCall(SB), NOSPLIT, $0 + BL runtime·save_g(SB) // Save g and stack pointer + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 + MOVD SAVSTACK_ASYNC(R8), R9 + MOVD R15, 0(R9) - // Get library control area (LCA). - MOVW PSALAA, R8 - MOVD LCA64(R8), R8 + MOVD argv+8(FP), R1 // Move function arguments into registers + MOVD dsa+16(FP), g + MOVD fnptr+0(FP), R15 - // Get function. - MOVD CAA(R8), R9 - MOVD EDCHPXV(R9), R9 - MOVD trap+0(FP), R5 - SLD $4, R5 - ADD R5, R9 - LMG 0(R9), R5, R6 + BYTE $0x0D // Branch to function + BYTE $0xEF - // Restore LE stack. - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD 0(R9), R4 - MOVD $0, 0(R9) + BL runtime·load_g(SB) // Restore g and stack pointer + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 + MOVD SAVSTACK_ASYNC(R8), R9 + MOVD 0(R9), R15 - // Call function. - LE_CALL - NOPH - XOR R0, R0 // Restore R0 to $0. - MOVD R4, 0(R9) // Save stack pointer. - - MOVD R3, r1+32(FP) - MOVD R0, r2+40(FP) - MOVD R0, err+48(FP) - MOVW R3, R4 - CMP R4, $-1 - BNE done - BL addrerrno<>(SB) - MOVWZ 0(R3), R3 - MOVD R3, err+48(FP) -done: - BL runtime·exitsyscall(SB) RET -TEXT ·syscall_rawsyscall(SB),NOSPLIT,$0-56 - MOVD a1+8(FP), R1 - MOVD a2+16(FP), R2 - MOVD a3+24(FP), R3 - - // Get library control area (LCA). - MOVW PSALAA, R8 - MOVD LCA64(R8), R8 - - // Get function. - MOVD CAA(R8), R9 - MOVD EDCHPXV(R9), R9 - MOVD trap+0(FP), R5 - SLD $4, R5 - ADD R5, R9 - LMG 0(R9), R5, R6 +// func svcLoad(name *byte) unsafe.Pointer +TEXT ·svcLoad(SB), NOSPLIT, $0 + MOVD R15, R2 // Save go stack pointer + MOVD name+0(FP), R0 // Move SVC args into registers + MOVD $0x80000000, R1 + MOVD $0, R15 + SVC_LOAD + MOVW R15, R3 // Save return code from SVC + MOVD R2, R15 // Restore go stack pointer + CMP R3, $0 // Check SVC return code + BNE error + + MOVD $-2, R3 // Reset last bit of entry point to zero + AND R0, R3 + MOVD R3, ret+8(FP) // Return entry point returned by SVC + CMP R0, R3 // Check if last bit of entry point was set + BNE done + + MOVD R15, R2 // Save go stack pointer + MOVD $0, R15 // Move SVC args into registers (entry point still in r0 from SVC 08) + SVC_DELETE + MOVD R2, R15 // Restore go stack pointer - // Restore LE stack. - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD 0(R9), R4 - MOVD $0, 0(R9) +error: + MOVD $0, ret+8(FP) // Return 0 on failure - // Call function. - LE_CALL - NOPH - XOR R0, R0 // Restore R0 to $0. - MOVD R4, 0(R9) // Save stack pointer. - - MOVD R3, r1+32(FP) - MOVD R0, r2+40(FP) - MOVD R0, err+48(FP) - MOVW R3, R4 - CMP R4, $-1 - BNE done - BL addrerrno<>(SB) - MOVWZ 0(R3), R3 - MOVD R3, err+48(FP) done: + XOR R0, R0 // Reset r0 to 0 RET -TEXT ·syscall_syscall6(SB),NOSPLIT,$0-80 - BL runtime·entersyscall(SB) - MOVD a1+8(FP), R1 - MOVD a2+16(FP), R2 - MOVD a3+24(FP), R3 +// func svcUnload(name *byte, fnptr unsafe.Pointer) int64 +TEXT ·svcUnload(SB), NOSPLIT, $0 + MOVD R15, R2 // Save go stack pointer + MOVD name+0(FP), R0 // Move SVC args into registers + MOVD fnptr+8(FP), R15 + SVC_DELETE + XOR R0, R0 // Reset r0 to 0 + MOVD R15, R1 // Save SVC return code + MOVD R2, R15 // Restore go stack pointer + MOVD R1, ret+16(FP) // Return SVC return code + RET +// func gettid() uint64 +TEXT ·gettid(SB), NOSPLIT, $0 // Get library control area (LCA). - MOVW PSALAA, R8 - MOVD LCA64(R8), R8 + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 - // Get function. - MOVD CAA(R8), R9 - MOVD EDCHPXV(R9), R9 - MOVD trap+0(FP), R5 - SLD $4, R5 - ADD R5, R9 - LMG 0(R9), R5, R6 + // Get CEECAATHDID + MOVD CAA(R8), R9 + MOVD CEECAATHDID(R9), R9 + MOVD R9, ret+0(FP) - // Restore LE stack. - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD 0(R9), R4 - MOVD $0, 0(R9) - - // Fill in parameter list. - MOVD a4+32(FP), R12 - MOVD R12, (2176+24)(R4) - MOVD a5+40(FP), R12 - MOVD R12, (2176+32)(R4) - MOVD a6+48(FP), R12 - MOVD R12, (2176+40)(R4) - - // Call function. - LE_CALL - NOPH - XOR R0, R0 // Restore R0 to $0. - MOVD R4, 0(R9) // Save stack pointer. - - MOVD R3, r1+56(FP) - MOVD R0, r2+64(FP) - MOVD R0, err+72(FP) - MOVW R3, R4 - CMP R4, $-1 - BNE done - BL addrerrno<>(SB) - MOVWZ 0(R3), R3 - MOVD R3, err+72(FP) -done: - BL runtime·exitsyscall(SB) RET -TEXT ·syscall_rawsyscall6(SB),NOSPLIT,$0-80 - MOVD a1+8(FP), R1 - MOVD a2+16(FP), R2 - MOVD a3+24(FP), R3 - - // Get library control area (LCA). - MOVW PSALAA, R8 - MOVD LCA64(R8), R8 - - // Get function. - MOVD CAA(R8), R9 - MOVD EDCHPXV(R9), R9 - MOVD trap+0(FP), R5 - SLD $4, R5 - ADD R5, R9 - LMG 0(R9), R5, R6 +// +// Call LE function, if the return is -1 +// errno and errno2 is retrieved +// +TEXT ·CallLeFuncWithErr(SB), NOSPLIT, $0 + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 + MOVD CAA(R8), R9 + MOVD g, GOCB(R9) // Restore LE stack. - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD 0(R9), R4 - MOVD $0, 0(R9) - - // Fill in parameter list. - MOVD a4+32(FP), R12 - MOVD R12, (2176+24)(R4) - MOVD a5+40(FP), R12 - MOVD R12, (2176+32)(R4) - MOVD a6+48(FP), R12 - MOVD R12, (2176+40)(R4) - - // Call function. - LE_CALL + MOVD SAVSTACK_ASYNC(R8), R9 // R9-> LE stack frame saving address + MOVD 0(R9), R4 // R4-> restore previously saved stack frame pointer + + MOVD parms_base+8(FP), R7 // R7 -> argument array + MOVD parms_len+16(FP), R8 // R8 number of arguments + + // arg 1 ---> R1 + CMP R8, $0 + BEQ docall + SUB $1, R8 + MOVD 0(R7), R1 + + // arg 2 ---> R2 + CMP R8, $0 + BEQ docall + SUB $1, R8 + ADD $8, R7 + MOVD 0(R7), R2 + + // arg 3 --> R3 + CMP R8, $0 + BEQ docall + SUB $1, R8 + ADD $8, R7 + MOVD 0(R7), R3 + + CMP R8, $0 + BEQ docall + MOVD $2176+16, R6 // starting LE stack address-8 to store 4th argument + +repeat: + ADD $8, R7 + MOVD 0(R7), R0 // advance arg pointer by 8 byte + ADD $8, R6 // advance LE argument address by 8 byte + MOVD R0, (R4)(R6*1) // copy argument from go-slice to le-frame + SUB $1, R8 + CMP R8, $0 + BNE repeat + +docall: + MOVD funcdesc+0(FP), R8 // R8-> function descriptor + LMG 0(R8), R5, R6 + MOVD $0, 0(R9) // R9 address of SAVSTACK_ASYNC + LE_CALL // balr R7, R6 (return #1) + NOPH + MOVD R3, ret+32(FP) + CMP R3, $-1 // compare result to -1 + BNE done + + // retrieve errno and errno2 + MOVD zosLibVec<>(SB), R8 + ADD $(__errno), R8 + LMG 0(R8), R5, R6 + LE_CALL // balr R7, R6 __errno (return #3) NOPH - XOR R0, R0 // Restore R0 to $0. - MOVD R4, 0(R9) // Save stack pointer. - - MOVD R3, r1+56(FP) - MOVD R0, r2+64(FP) - MOVD R0, err+72(FP) - MOVW R3, R4 - CMP R4, $-1 - BNE done - BL ·rrno<>(SB) - MOVWZ 0(R3), R3 - MOVD R3, err+72(FP) + MOVWZ 0(R3), R3 + MOVD R3, err+48(FP) + MOVD zosLibVec<>(SB), R8 + ADD $(__err2ad), R8 + LMG 0(R8), R5, R6 + LE_CALL // balr R7, R6 __err2ad (return #2) + NOPH + MOVW (R3), R2 // retrieve errno2 + MOVD R2, errno2+40(FP) // store in return area + done: + MOVD R4, 0(R9) // Save stack pointer. RET -TEXT ·syscall_syscall9(SB),NOSPLIT,$0 - BL runtime·entersyscall(SB) - MOVD a1+8(FP), R1 - MOVD a2+16(FP), R2 - MOVD a3+24(FP), R3 - - // Get library control area (LCA). - MOVW PSALAA, R8 - MOVD LCA64(R8), R8 - - // Get function. - MOVD CAA(R8), R9 - MOVD EDCHPXV(R9), R9 - MOVD trap+0(FP), R5 - SLD $4, R5 - ADD R5, R9 - LMG 0(R9), R5, R6 +// +// Call LE function, if the return is 0 +// errno and errno2 is retrieved +// +TEXT ·CallLeFuncWithPtrReturn(SB), NOSPLIT, $0 + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 + MOVD CAA(R8), R9 + MOVD g, GOCB(R9) // Restore LE stack. - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD 0(R9), R4 - MOVD $0, 0(R9) - - // Fill in parameter list. - MOVD a4+32(FP), R12 - MOVD R12, (2176+24)(R4) - MOVD a5+40(FP), R12 - MOVD R12, (2176+32)(R4) - MOVD a6+48(FP), R12 - MOVD R12, (2176+40)(R4) - MOVD a7+56(FP), R12 - MOVD R12, (2176+48)(R4) - MOVD a8+64(FP), R12 - MOVD R12, (2176+56)(R4) - MOVD a9+72(FP), R12 - MOVD R12, (2176+64)(R4) - - // Call function. - LE_CALL + MOVD SAVSTACK_ASYNC(R8), R9 // R9-> LE stack frame saving address + MOVD 0(R9), R4 // R4-> restore previously saved stack frame pointer + + MOVD parms_base+8(FP), R7 // R7 -> argument array + MOVD parms_len+16(FP), R8 // R8 number of arguments + + // arg 1 ---> R1 + CMP R8, $0 + BEQ docall + SUB $1, R8 + MOVD 0(R7), R1 + + // arg 2 ---> R2 + CMP R8, $0 + BEQ docall + SUB $1, R8 + ADD $8, R7 + MOVD 0(R7), R2 + + // arg 3 --> R3 + CMP R8, $0 + BEQ docall + SUB $1, R8 + ADD $8, R7 + MOVD 0(R7), R3 + + CMP R8, $0 + BEQ docall + MOVD $2176+16, R6 // starting LE stack address-8 to store 4th argument + +repeat: + ADD $8, R7 + MOVD 0(R7), R0 // advance arg pointer by 8 byte + ADD $8, R6 // advance LE argument address by 8 byte + MOVD R0, (R4)(R6*1) // copy argument from go-slice to le-frame + SUB $1, R8 + CMP R8, $0 + BNE repeat + +docall: + MOVD funcdesc+0(FP), R8 // R8-> function descriptor + LMG 0(R8), R5, R6 + MOVD $0, 0(R9) // R9 address of SAVSTACK_ASYNC + LE_CALL // balr R7, R6 (return #1) NOPH - XOR R0, R0 // Restore R0 to $0. - MOVD R4, 0(R9) // Save stack pointer. - - MOVD R3, r1+80(FP) - MOVD R0, r2+88(FP) - MOVD R0, err+96(FP) - MOVW R3, R4 - CMP R4, $-1 - BNE done - BL addrerrno<>(SB) - MOVWZ 0(R3), R3 - MOVD R3, err+96(FP) -done: - BL runtime·exitsyscall(SB) - RET - -TEXT ·syscall_rawsyscall9(SB),NOSPLIT,$0 - MOVD a1+8(FP), R1 - MOVD a2+16(FP), R2 - MOVD a3+24(FP), R3 - - // Get library control area (LCA). - MOVW PSALAA, R8 - MOVD LCA64(R8), R8 - - // Get function. - MOVD CAA(R8), R9 - MOVD EDCHPXV(R9), R9 - MOVD trap+0(FP), R5 - SLD $4, R5 - ADD R5, R9 - LMG 0(R9), R5, R6 - - // Restore LE stack. - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD 0(R9), R4 - MOVD $0, 0(R9) - - // Fill in parameter list. - MOVD a4+32(FP), R12 - MOVD R12, (2176+24)(R4) - MOVD a5+40(FP), R12 - MOVD R12, (2176+32)(R4) - MOVD a6+48(FP), R12 - MOVD R12, (2176+40)(R4) - MOVD a7+56(FP), R12 - MOVD R12, (2176+48)(R4) - MOVD a8+64(FP), R12 - MOVD R12, (2176+56)(R4) - MOVD a9+72(FP), R12 - MOVD R12, (2176+64)(R4) - - // Call function. - LE_CALL + MOVD R3, ret+32(FP) + CMP R3, $0 // compare result to 0 + BNE done + + // retrieve errno and errno2 + MOVD zosLibVec<>(SB), R8 + ADD $(__errno), R8 + LMG 0(R8), R5, R6 + LE_CALL // balr R7, R6 __errno (return #3) NOPH - XOR R0, R0 // Restore R0 to $0. - MOVD R4, 0(R9) // Save stack pointer. - - MOVD R3, r1+80(FP) - MOVD R0, r2+88(FP) - MOVD R0, err+96(FP) - MOVW R3, R4 - CMP R4, $-1 - BNE done - BL addrerrno<>(SB) - MOVWZ 0(R3), R3 - MOVD R3, err+96(FP) -done: - RET - -// func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64) -TEXT ·svcCall(SB),NOSPLIT,$0 - BL runtime·save_g(SB) // Save g and stack pointer - MOVW PSALAA, R8 - MOVD LCA64(R8), R8 - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD R15, 0(R9) - - MOVD argv+8(FP), R1 // Move function arguments into registers - MOVD dsa+16(FP), g - MOVD fnptr+0(FP), R15 - - BYTE $0x0D // Branch to function - BYTE $0xEF - - BL runtime·load_g(SB) // Restore g and stack pointer - MOVW PSALAA, R8 - MOVD LCA64(R8), R8 - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD 0(R9), R15 - - RET - -// func svcLoad(name *byte) unsafe.Pointer -TEXT ·svcLoad(SB),NOSPLIT,$0 - MOVD R15, R2 // Save go stack pointer - MOVD name+0(FP), R0 // Move SVC args into registers - MOVD $0x80000000, R1 - MOVD $0, R15 - BYTE $0x0A // SVC 08 LOAD - BYTE $0x08 - MOVW R15, R3 // Save return code from SVC - MOVD R2, R15 // Restore go stack pointer - CMP R3, $0 // Check SVC return code - BNE error - - MOVD $-2, R3 // Reset last bit of entry point to zero - AND R0, R3 - MOVD R3, addr+8(FP) // Return entry point returned by SVC - CMP R0, R3 // Check if last bit of entry point was set - BNE done - - MOVD R15, R2 // Save go stack pointer - MOVD $0, R15 // Move SVC args into registers (entry point still in r0 from SVC 08) - BYTE $0x0A // SVC 09 DELETE - BYTE $0x09 - MOVD R2, R15 // Restore go stack pointer + MOVWZ 0(R3), R3 + MOVD R3, err+48(FP) + MOVD zosLibVec<>(SB), R8 + ADD $(__err2ad), R8 + LMG 0(R8), R5, R6 + LE_CALL // balr R7, R6 __err2ad (return #2) + NOPH + MOVW (R3), R2 // retrieve errno2 + MOVD R2, errno2+40(FP) // store in return area + XOR R2, R2 + MOVWZ R2, (R3) // clear errno2 -error: - MOVD $0, addr+8(FP) // Return 0 on failure done: - XOR R0, R0 // Reset r0 to 0 + MOVD R4, 0(R9) // Save stack pointer. RET -// func svcUnload(name *byte, fnptr unsafe.Pointer) int64 -TEXT ·svcUnload(SB),NOSPLIT,$0 - MOVD R15, R2 // Save go stack pointer - MOVD name+0(FP), R0 // Move SVC args into registers - MOVD addr+8(FP), R15 - BYTE $0x0A // SVC 09 - BYTE $0x09 - XOR R0, R0 // Reset r0 to 0 - MOVD R15, R1 // Save SVC return code - MOVD R2, R15 // Restore go stack pointer - MOVD R1, rc+0(FP) // Return SVC return code +// +// function to test if a pointer can be safely dereferenced (content read) +// return 0 for succces +// +TEXT ·ptrtest(SB), NOSPLIT, $0-16 + MOVD arg+0(FP), R10 // test pointer in R10 + + // set up R2 to point to CEECAADMC + BYTE $0xE3; BYTE $0x20; BYTE $0x04; BYTE $0xB8; BYTE $0x00; BYTE $0x17 // llgt 2,1208 + BYTE $0xB9; BYTE $0x17; BYTE $0x00; BYTE $0x22 // llgtr 2,2 + BYTE $0xA5; BYTE $0x26; BYTE $0x7F; BYTE $0xFF // nilh 2,32767 + BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x58; BYTE $0x00; BYTE $0x04 // lg 2,88(2) + BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x08; BYTE $0x00; BYTE $0x04 // lg 2,8(2) + BYTE $0x41; BYTE $0x22; BYTE $0x03; BYTE $0x68 // la 2,872(2) + + // set up R5 to point to the "shunt" path which set 1 to R3 (failure) + BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x33 // xgr 3,3 + BYTE $0xA7; BYTE $0x55; BYTE $0x00; BYTE $0x04 // bras 5,lbl1 + BYTE $0xA7; BYTE $0x39; BYTE $0x00; BYTE $0x01 // lghi 3,1 + + // if r3 is not zero (failed) then branch to finish + BYTE $0xB9; BYTE $0x02; BYTE $0x00; BYTE $0x33 // lbl1 ltgr 3,3 + BYTE $0xA7; BYTE $0x74; BYTE $0x00; BYTE $0x08 // brc b'0111',lbl2 + + // stomic store shunt address in R5 into CEECAADMC + BYTE $0xE3; BYTE $0x52; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 5,0(2) + + // now try reading from the test pointer in R10, if it fails it branches to the "lghi" instruction above + BYTE $0xE3; BYTE $0x9A; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x04 // lg 9,0(10) + + // finish here, restore 0 into CEECAADMC + BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x99 // lbl2 xgr 9,9 + BYTE $0xE3; BYTE $0x92; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 9,0(2) + MOVD R3, ret+8(FP) // result in R3 RET -// func gettid() uint64 -TEXT ·gettid(SB), NOSPLIT, $0 - // Get library control area (LCA). - MOVW PSALAA, R8 - MOVD LCA64(R8), R8 - - // Get CEECAATHDID - MOVD CAA(R8), R9 - MOVD 0x3D0(R9), R9 - MOVD R9, ret+0(FP) - +// +// function to test if a untptr can be loaded from a pointer +// return 1: the 8-byte content +// 2: 0 for success, 1 for failure +// +// func safeload(ptr uintptr) ( value uintptr, error uintptr) +TEXT ·safeload(SB), NOSPLIT, $0-24 + MOVD ptr+0(FP), R10 // test pointer in R10 + MOVD $0x0, R6 + BYTE $0xE3; BYTE $0x20; BYTE $0x04; BYTE $0xB8; BYTE $0x00; BYTE $0x17 // llgt 2,1208 + BYTE $0xB9; BYTE $0x17; BYTE $0x00; BYTE $0x22 // llgtr 2,2 + BYTE $0xA5; BYTE $0x26; BYTE $0x7F; BYTE $0xFF // nilh 2,32767 + BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x58; BYTE $0x00; BYTE $0x04 // lg 2,88(2) + BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x08; BYTE $0x00; BYTE $0x04 // lg 2,8(2) + BYTE $0x41; BYTE $0x22; BYTE $0x03; BYTE $0x68 // la 2,872(2) + BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x33 // xgr 3,3 + BYTE $0xA7; BYTE $0x55; BYTE $0x00; BYTE $0x04 // bras 5,lbl1 + BYTE $0xA7; BYTE $0x39; BYTE $0x00; BYTE $0x01 // lghi 3,1 + BYTE $0xB9; BYTE $0x02; BYTE $0x00; BYTE $0x33 // lbl1 ltgr 3,3 + BYTE $0xA7; BYTE $0x74; BYTE $0x00; BYTE $0x08 // brc b'0111',lbl2 + BYTE $0xE3; BYTE $0x52; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 5,0(2) + BYTE $0xE3; BYTE $0x6A; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x04 // lg 6,0(10) + BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x99 // lbl2 xgr 9,9 + BYTE $0xE3; BYTE $0x92; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 9,0(2) + MOVD R6, value+8(FP) // result in R6 + MOVD R3, error+16(FP) // error in R3 RET diff --git a/vendor/golang.org/x/sys/unix/bpxsvc_zos.go b/vendor/golang.org/x/sys/unix/bpxsvc_zos.go new file mode 100644 index 0000000000..39d647d863 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/bpxsvc_zos.go @@ -0,0 +1,657 @@ +// Copyright 2024 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:build zos + +package unix + +import ( + "bytes" + "fmt" + "unsafe" +) + +//go:noescape +func bpxcall(plist []unsafe.Pointer, bpx_offset int64) + +//go:noescape +func A2e([]byte) + +//go:noescape +func E2a([]byte) + +const ( + BPX4STA = 192 // stat + BPX4FST = 104 // fstat + BPX4LST = 132 // lstat + BPX4OPN = 156 // open + BPX4CLO = 72 // close + BPX4CHR = 500 // chattr + BPX4FCR = 504 // fchattr + BPX4LCR = 1180 // lchattr + BPX4CTW = 492 // cond_timed_wait + BPX4GTH = 1056 // __getthent + BPX4PTQ = 412 // pthread_quiesc + BPX4PTR = 320 // ptrace +) + +const ( + //options + //byte1 + BPX_OPNFHIGH = 0x80 + //byte2 + BPX_OPNFEXEC = 0x80 + //byte3 + BPX_O_NOLARGEFILE = 0x08 + BPX_O_LARGEFILE = 0x04 + BPX_O_ASYNCSIG = 0x02 + BPX_O_SYNC = 0x01 + //byte4 + BPX_O_CREXCL = 0xc0 + BPX_O_CREAT = 0x80 + BPX_O_EXCL = 0x40 + BPX_O_NOCTTY = 0x20 + BPX_O_TRUNC = 0x10 + BPX_O_APPEND = 0x08 + BPX_O_NONBLOCK = 0x04 + BPX_FNDELAY = 0x04 + BPX_O_RDWR = 0x03 + BPX_O_RDONLY = 0x02 + BPX_O_WRONLY = 0x01 + BPX_O_ACCMODE = 0x03 + BPX_O_GETFL = 0x0f + + //mode + // byte1 (file type) + BPX_FT_DIR = 1 + BPX_FT_CHARSPEC = 2 + BPX_FT_REGFILE = 3 + BPX_FT_FIFO = 4 + BPX_FT_SYMLINK = 5 + BPX_FT_SOCKET = 6 + //byte3 + BPX_S_ISUID = 0x08 + BPX_S_ISGID = 0x04 + BPX_S_ISVTX = 0x02 + BPX_S_IRWXU1 = 0x01 + BPX_S_IRUSR = 0x01 + //byte4 + BPX_S_IRWXU2 = 0xc0 + BPX_S_IWUSR = 0x80 + BPX_S_IXUSR = 0x40 + BPX_S_IRWXG = 0x38 + BPX_S_IRGRP = 0x20 + BPX_S_IWGRP = 0x10 + BPX_S_IXGRP = 0x08 + BPX_S_IRWXOX = 0x07 + BPX_S_IROTH = 0x04 + BPX_S_IWOTH = 0x02 + BPX_S_IXOTH = 0x01 + + CW_INTRPT = 1 + CW_CONDVAR = 32 + CW_TIMEOUT = 64 + + PGTHA_NEXT = 2 + PGTHA_CURRENT = 1 + PGTHA_FIRST = 0 + PGTHA_LAST = 3 + PGTHA_PROCESS = 0x80 + PGTHA_CONTTY = 0x40 + PGTHA_PATH = 0x20 + PGTHA_COMMAND = 0x10 + PGTHA_FILEDATA = 0x08 + PGTHA_THREAD = 0x04 + PGTHA_PTAG = 0x02 + PGTHA_COMMANDLONG = 0x01 + PGTHA_THREADFAST = 0x80 + PGTHA_FILEPATH = 0x40 + PGTHA_THDSIGMASK = 0x20 + // thread quiece mode + QUIESCE_TERM int32 = 1 + QUIESCE_FORCE int32 = 2 + QUIESCE_QUERY int32 = 3 + QUIESCE_FREEZE int32 = 4 + QUIESCE_UNFREEZE int32 = 5 + FREEZE_THIS_THREAD int32 = 6 + FREEZE_EXIT int32 = 8 + QUIESCE_SRB int32 = 9 +) + +type Pgtha struct { + Pid uint32 // 0 + Tid0 uint32 // 4 + Tid1 uint32 + Accesspid byte // C + Accesstid byte // D + Accessasid uint16 // E + Loginname [8]byte // 10 + Flag1 byte // 18 + Flag1b2 byte // 19 +} + +type Bpxystat_t struct { // DSECT BPXYSTAT + St_id [4]uint8 // 0 + St_length uint16 // 0x4 + St_version uint16 // 0x6 + St_mode uint32 // 0x8 + St_ino uint32 // 0xc + St_dev uint32 // 0x10 + St_nlink uint32 // 0x14 + St_uid uint32 // 0x18 + St_gid uint32 // 0x1c + St_size uint64 // 0x20 + St_atime uint32 // 0x28 + St_mtime uint32 // 0x2c + St_ctime uint32 // 0x30 + St_rdev uint32 // 0x34 + St_auditoraudit uint32 // 0x38 + St_useraudit uint32 // 0x3c + St_blksize uint32 // 0x40 + St_createtime uint32 // 0x44 + St_auditid [4]uint32 // 0x48 + St_res01 uint32 // 0x58 + Ft_ccsid uint16 // 0x5c + Ft_flags uint16 // 0x5e + St_res01a [2]uint32 // 0x60 + St_res02 uint32 // 0x68 + St_blocks uint32 // 0x6c + St_opaque [3]uint8 // 0x70 + St_visible uint8 // 0x73 + St_reftime uint32 // 0x74 + St_fid uint64 // 0x78 + St_filefmt uint8 // 0x80 + St_fspflag2 uint8 // 0x81 + St_res03 [2]uint8 // 0x82 + St_ctimemsec uint32 // 0x84 + St_seclabel [8]uint8 // 0x88 + St_res04 [4]uint8 // 0x90 + // end of version 1 + _ uint32 // 0x94 + St_atime64 uint64 // 0x98 + St_mtime64 uint64 // 0xa0 + St_ctime64 uint64 // 0xa8 + St_createtime64 uint64 // 0xb0 + St_reftime64 uint64 // 0xb8 + _ uint64 // 0xc0 + St_res05 [16]uint8 // 0xc8 + // end of version 2 +} + +type BpxFilestatus struct { + Oflag1 byte + Oflag2 byte + Oflag3 byte + Oflag4 byte +} + +type BpxMode struct { + Ftype byte + Mode1 byte + Mode2 byte + Mode3 byte +} + +// Thr attribute structure for extended attributes +type Bpxyatt_t struct { // DSECT BPXYATT + Att_id [4]uint8 + Att_version uint16 + Att_res01 [2]uint8 + Att_setflags1 uint8 + Att_setflags2 uint8 + Att_setflags3 uint8 + Att_setflags4 uint8 + Att_mode uint32 + Att_uid uint32 + Att_gid uint32 + Att_opaquemask [3]uint8 + Att_visblmaskres uint8 + Att_opaque [3]uint8 + Att_visibleres uint8 + Att_size_h uint32 + Att_size_l uint32 + Att_atime uint32 + Att_mtime uint32 + Att_auditoraudit uint32 + Att_useraudit uint32 + Att_ctime uint32 + Att_reftime uint32 + // end of version 1 + Att_filefmt uint8 + Att_res02 [3]uint8 + Att_filetag uint32 + Att_res03 [8]uint8 + // end of version 2 + Att_atime64 uint64 + Att_mtime64 uint64 + Att_ctime64 uint64 + Att_reftime64 uint64 + Att_seclabel [8]uint8 + Att_ver3res02 [8]uint8 + // end of version 3 +} + +func BpxOpen(name string, options *BpxFilestatus, mode *BpxMode) (rv int32, rc int32, rn int32) { + if len(name) < 1024 { + var namebuf [1024]byte + sz := int32(copy(namebuf[:], name)) + A2e(namebuf[:sz]) + var parms [7]unsafe.Pointer + parms[0] = unsafe.Pointer(&sz) + parms[1] = unsafe.Pointer(&namebuf[0]) + parms[2] = unsafe.Pointer(options) + parms[3] = unsafe.Pointer(mode) + parms[4] = unsafe.Pointer(&rv) + parms[5] = unsafe.Pointer(&rc) + parms[6] = unsafe.Pointer(&rn) + bpxcall(parms[:], BPX4OPN) + return rv, rc, rn + } + return -1, -1, -1 +} + +func BpxClose(fd int32) (rv int32, rc int32, rn int32) { + var parms [4]unsafe.Pointer + parms[0] = unsafe.Pointer(&fd) + parms[1] = unsafe.Pointer(&rv) + parms[2] = unsafe.Pointer(&rc) + parms[3] = unsafe.Pointer(&rn) + bpxcall(parms[:], BPX4CLO) + return rv, rc, rn +} + +func BpxFileFStat(fd int32, st *Bpxystat_t) (rv int32, rc int32, rn int32) { + st.St_id = [4]uint8{0xe2, 0xe3, 0xc1, 0xe3} + st.St_version = 2 + stat_sz := uint32(unsafe.Sizeof(*st)) + var parms [6]unsafe.Pointer + parms[0] = unsafe.Pointer(&fd) + parms[1] = unsafe.Pointer(&stat_sz) + parms[2] = unsafe.Pointer(st) + parms[3] = unsafe.Pointer(&rv) + parms[4] = unsafe.Pointer(&rc) + parms[5] = unsafe.Pointer(&rn) + bpxcall(parms[:], BPX4FST) + return rv, rc, rn +} + +func BpxFileStat(name string, st *Bpxystat_t) (rv int32, rc int32, rn int32) { + if len(name) < 1024 { + var namebuf [1024]byte + sz := int32(copy(namebuf[:], name)) + A2e(namebuf[:sz]) + st.St_id = [4]uint8{0xe2, 0xe3, 0xc1, 0xe3} + st.St_version = 2 + stat_sz := uint32(unsafe.Sizeof(*st)) + var parms [7]unsafe.Pointer + parms[0] = unsafe.Pointer(&sz) + parms[1] = unsafe.Pointer(&namebuf[0]) + parms[2] = unsafe.Pointer(&stat_sz) + parms[3] = unsafe.Pointer(st) + parms[4] = unsafe.Pointer(&rv) + parms[5] = unsafe.Pointer(&rc) + parms[6] = unsafe.Pointer(&rn) + bpxcall(parms[:], BPX4STA) + return rv, rc, rn + } + return -1, -1, -1 +} + +func BpxFileLStat(name string, st *Bpxystat_t) (rv int32, rc int32, rn int32) { + if len(name) < 1024 { + var namebuf [1024]byte + sz := int32(copy(namebuf[:], name)) + A2e(namebuf[:sz]) + st.St_id = [4]uint8{0xe2, 0xe3, 0xc1, 0xe3} + st.St_version = 2 + stat_sz := uint32(unsafe.Sizeof(*st)) + var parms [7]unsafe.Pointer + parms[0] = unsafe.Pointer(&sz) + parms[1] = unsafe.Pointer(&namebuf[0]) + parms[2] = unsafe.Pointer(&stat_sz) + parms[3] = unsafe.Pointer(st) + parms[4] = unsafe.Pointer(&rv) + parms[5] = unsafe.Pointer(&rc) + parms[6] = unsafe.Pointer(&rn) + bpxcall(parms[:], BPX4LST) + return rv, rc, rn + } + return -1, -1, -1 +} + +func BpxChattr(path string, attr *Bpxyatt_t) (rv int32, rc int32, rn int32) { + if len(path) >= 1024 { + return -1, -1, -1 + } + var namebuf [1024]byte + sz := int32(copy(namebuf[:], path)) + A2e(namebuf[:sz]) + attr_sz := uint32(unsafe.Sizeof(*attr)) + var parms [7]unsafe.Pointer + parms[0] = unsafe.Pointer(&sz) + parms[1] = unsafe.Pointer(&namebuf[0]) + parms[2] = unsafe.Pointer(&attr_sz) + parms[3] = unsafe.Pointer(attr) + parms[4] = unsafe.Pointer(&rv) + parms[5] = unsafe.Pointer(&rc) + parms[6] = unsafe.Pointer(&rn) + bpxcall(parms[:], BPX4CHR) + return rv, rc, rn +} + +func BpxLchattr(path string, attr *Bpxyatt_t) (rv int32, rc int32, rn int32) { + if len(path) >= 1024 { + return -1, -1, -1 + } + var namebuf [1024]byte + sz := int32(copy(namebuf[:], path)) + A2e(namebuf[:sz]) + attr_sz := uint32(unsafe.Sizeof(*attr)) + var parms [7]unsafe.Pointer + parms[0] = unsafe.Pointer(&sz) + parms[1] = unsafe.Pointer(&namebuf[0]) + parms[2] = unsafe.Pointer(&attr_sz) + parms[3] = unsafe.Pointer(attr) + parms[4] = unsafe.Pointer(&rv) + parms[5] = unsafe.Pointer(&rc) + parms[6] = unsafe.Pointer(&rn) + bpxcall(parms[:], BPX4LCR) + return rv, rc, rn +} + +func BpxFchattr(fd int32, attr *Bpxyatt_t) (rv int32, rc int32, rn int32) { + attr_sz := uint32(unsafe.Sizeof(*attr)) + var parms [6]unsafe.Pointer + parms[0] = unsafe.Pointer(&fd) + parms[1] = unsafe.Pointer(&attr_sz) + parms[2] = unsafe.Pointer(attr) + parms[3] = unsafe.Pointer(&rv) + parms[4] = unsafe.Pointer(&rc) + parms[5] = unsafe.Pointer(&rn) + bpxcall(parms[:], BPX4FCR) + return rv, rc, rn +} + +func BpxCondTimedWait(sec uint32, nsec uint32, events uint32, secrem *uint32, nsecrem *uint32) (rv int32, rc int32, rn int32) { + var parms [8]unsafe.Pointer + parms[0] = unsafe.Pointer(&sec) + parms[1] = unsafe.Pointer(&nsec) + parms[2] = unsafe.Pointer(&events) + parms[3] = unsafe.Pointer(secrem) + parms[4] = unsafe.Pointer(nsecrem) + parms[5] = unsafe.Pointer(&rv) + parms[6] = unsafe.Pointer(&rc) + parms[7] = unsafe.Pointer(&rn) + bpxcall(parms[:], BPX4CTW) + return rv, rc, rn +} +func BpxGetthent(in *Pgtha, outlen *uint32, out unsafe.Pointer) (rv int32, rc int32, rn int32) { + var parms [7]unsafe.Pointer + inlen := uint32(26) // nothing else will work. Go says Pgtha is 28-byte because of alignment, but Pgtha is "packed" and must be 26-byte + parms[0] = unsafe.Pointer(&inlen) + parms[1] = unsafe.Pointer(&in) + parms[2] = unsafe.Pointer(outlen) + parms[3] = unsafe.Pointer(&out) + parms[4] = unsafe.Pointer(&rv) + parms[5] = unsafe.Pointer(&rc) + parms[6] = unsafe.Pointer(&rn) + bpxcall(parms[:], BPX4GTH) + return rv, rc, rn +} +func ZosJobname() (jobname string, err error) { + var pgtha Pgtha + pgtha.Pid = uint32(Getpid()) + pgtha.Accesspid = PGTHA_CURRENT + pgtha.Flag1 = PGTHA_PROCESS + var out [256]byte + var outlen uint32 + outlen = 256 + rv, rc, rn := BpxGetthent(&pgtha, &outlen, unsafe.Pointer(&out[0])) + if rv == 0 { + gthc := []byte{0x87, 0xa3, 0x88, 0x83} // 'gthc' in ebcdic + ix := bytes.Index(out[:], gthc) + if ix == -1 { + err = fmt.Errorf("BPX4GTH: gthc return data not found") + return + } + jn := out[ix+80 : ix+88] // we didn't declare Pgthc, but jobname is 8-byte at offset 80 + E2a(jn) + jobname = string(bytes.TrimRight(jn, " ")) + + } else { + err = fmt.Errorf("BPX4GTH: rc=%d errno=%d reason=code=0x%x", rv, rc, rn) + } + return +} +func Bpx4ptq(code int32, data string) (rv int32, rc int32, rn int32) { + var userdata [8]byte + var parms [5]unsafe.Pointer + copy(userdata[:], data+" ") + A2e(userdata[:]) + parms[0] = unsafe.Pointer(&code) + parms[1] = unsafe.Pointer(&userdata[0]) + parms[2] = unsafe.Pointer(&rv) + parms[3] = unsafe.Pointer(&rc) + parms[4] = unsafe.Pointer(&rn) + bpxcall(parms[:], BPX4PTQ) + return rv, rc, rn +} + +const ( + PT_TRACE_ME = 0 // Debug this process + PT_READ_I = 1 // Read a full word + PT_READ_D = 2 // Read a full word + PT_READ_U = 3 // Read control info + PT_WRITE_I = 4 //Write a full word + PT_WRITE_D = 5 //Write a full word + PT_CONTINUE = 7 //Continue the process + PT_KILL = 8 //Terminate the process + PT_READ_GPR = 11 // Read GPR, CR, PSW + PT_READ_FPR = 12 // Read FPR + PT_READ_VR = 13 // Read VR + PT_WRITE_GPR = 14 // Write GPR, CR, PSW + PT_WRITE_FPR = 15 // Write FPR + PT_WRITE_VR = 16 // Write VR + PT_READ_BLOCK = 17 // Read storage + PT_WRITE_BLOCK = 19 // Write storage + PT_READ_GPRH = 20 // Read GPRH + PT_WRITE_GPRH = 21 // Write GPRH + PT_REGHSET = 22 // Read all GPRHs + PT_ATTACH = 30 // Attach to a process + PT_DETACH = 31 // Detach from a process + PT_REGSET = 32 // Read all GPRs + PT_REATTACH = 33 // Reattach to a process + PT_LDINFO = 34 // Read loader info + PT_MULTI = 35 // Multi process mode + PT_LD64INFO = 36 // RMODE64 Info Area + PT_BLOCKREQ = 40 // Block request + PT_THREAD_INFO = 60 // Read thread info + PT_THREAD_MODIFY = 61 + PT_THREAD_READ_FOCUS = 62 + PT_THREAD_WRITE_FOCUS = 63 + PT_THREAD_HOLD = 64 + PT_THREAD_SIGNAL = 65 + PT_EXPLAIN = 66 + PT_EVENTS = 67 + PT_THREAD_INFO_EXTENDED = 68 + PT_REATTACH2 = 71 + PT_CAPTURE = 72 + PT_UNCAPTURE = 73 + PT_GET_THREAD_TCB = 74 + PT_GET_ALET = 75 + PT_SWAPIN = 76 + PT_EXTENDED_EVENT = 98 + PT_RECOVER = 99 // Debug a program check + PT_GPR0 = 0 // General purpose register 0 + PT_GPR1 = 1 // General purpose register 1 + PT_GPR2 = 2 // General purpose register 2 + PT_GPR3 = 3 // General purpose register 3 + PT_GPR4 = 4 // General purpose register 4 + PT_GPR5 = 5 // General purpose register 5 + PT_GPR6 = 6 // General purpose register 6 + PT_GPR7 = 7 // General purpose register 7 + PT_GPR8 = 8 // General purpose register 8 + PT_GPR9 = 9 // General purpose register 9 + PT_GPR10 = 10 // General purpose register 10 + PT_GPR11 = 11 // General purpose register 11 + PT_GPR12 = 12 // General purpose register 12 + PT_GPR13 = 13 // General purpose register 13 + PT_GPR14 = 14 // General purpose register 14 + PT_GPR15 = 15 // General purpose register 15 + PT_FPR0 = 16 // Floating point register 0 + PT_FPR1 = 17 // Floating point register 1 + PT_FPR2 = 18 // Floating point register 2 + PT_FPR3 = 19 // Floating point register 3 + PT_FPR4 = 20 // Floating point register 4 + PT_FPR5 = 21 // Floating point register 5 + PT_FPR6 = 22 // Floating point register 6 + PT_FPR7 = 23 // Floating point register 7 + PT_FPR8 = 24 // Floating point register 8 + PT_FPR9 = 25 // Floating point register 9 + PT_FPR10 = 26 // Floating point register 10 + PT_FPR11 = 27 // Floating point register 11 + PT_FPR12 = 28 // Floating point register 12 + PT_FPR13 = 29 // Floating point register 13 + PT_FPR14 = 30 // Floating point register 14 + PT_FPR15 = 31 // Floating point register 15 + PT_FPC = 32 // Floating point control register + PT_PSW = 40 // PSW + PT_PSW0 = 40 // Left half of the PSW + PT_PSW1 = 41 // Right half of the PSW + PT_CR0 = 42 // Control register 0 + PT_CR1 = 43 // Control register 1 + PT_CR2 = 44 // Control register 2 + PT_CR3 = 45 // Control register 3 + PT_CR4 = 46 // Control register 4 + PT_CR5 = 47 // Control register 5 + PT_CR6 = 48 // Control register 6 + PT_CR7 = 49 // Control register 7 + PT_CR8 = 50 // Control register 8 + PT_CR9 = 51 // Control register 9 + PT_CR10 = 52 // Control register 10 + PT_CR11 = 53 // Control register 11 + PT_CR12 = 54 // Control register 12 + PT_CR13 = 55 // Control register 13 + PT_CR14 = 56 // Control register 14 + PT_CR15 = 57 // Control register 15 + PT_GPRH0 = 58 // GP High register 0 + PT_GPRH1 = 59 // GP High register 1 + PT_GPRH2 = 60 // GP High register 2 + PT_GPRH3 = 61 // GP High register 3 + PT_GPRH4 = 62 // GP High register 4 + PT_GPRH5 = 63 // GP High register 5 + PT_GPRH6 = 64 // GP High register 6 + PT_GPRH7 = 65 // GP High register 7 + PT_GPRH8 = 66 // GP High register 8 + PT_GPRH9 = 67 // GP High register 9 + PT_GPRH10 = 68 // GP High register 10 + PT_GPRH11 = 69 // GP High register 11 + PT_GPRH12 = 70 // GP High register 12 + PT_GPRH13 = 71 // GP High register 13 + PT_GPRH14 = 72 // GP High register 14 + PT_GPRH15 = 73 // GP High register 15 + PT_VR0 = 74 // Vector register 0 + PT_VR1 = 75 // Vector register 1 + PT_VR2 = 76 // Vector register 2 + PT_VR3 = 77 // Vector register 3 + PT_VR4 = 78 // Vector register 4 + PT_VR5 = 79 // Vector register 5 + PT_VR6 = 80 // Vector register 6 + PT_VR7 = 81 // Vector register 7 + PT_VR8 = 82 // Vector register 8 + PT_VR9 = 83 // Vector register 9 + PT_VR10 = 84 // Vector register 10 + PT_VR11 = 85 // Vector register 11 + PT_VR12 = 86 // Vector register 12 + PT_VR13 = 87 // Vector register 13 + PT_VR14 = 88 // Vector register 14 + PT_VR15 = 89 // Vector register 15 + PT_VR16 = 90 // Vector register 16 + PT_VR17 = 91 // Vector register 17 + PT_VR18 = 92 // Vector register 18 + PT_VR19 = 93 // Vector register 19 + PT_VR20 = 94 // Vector register 20 + PT_VR21 = 95 // Vector register 21 + PT_VR22 = 96 // Vector register 22 + PT_VR23 = 97 // Vector register 23 + PT_VR24 = 98 // Vector register 24 + PT_VR25 = 99 // Vector register 25 + PT_VR26 = 100 // Vector register 26 + PT_VR27 = 101 // Vector register 27 + PT_VR28 = 102 // Vector register 28 + PT_VR29 = 103 // Vector register 29 + PT_VR30 = 104 // Vector register 30 + PT_VR31 = 105 // Vector register 31 + PT_PSWG = 106 // PSWG + PT_PSWG0 = 106 // Bytes 0-3 + PT_PSWG1 = 107 // Bytes 4-7 + PT_PSWG2 = 108 // Bytes 8-11 (IA high word) + PT_PSWG3 = 109 // Bytes 12-15 (IA low word) +) + +func Bpx4ptr(request int32, pid int32, addr unsafe.Pointer, data unsafe.Pointer, buffer unsafe.Pointer) (rv int32, rc int32, rn int32) { + var parms [8]unsafe.Pointer + parms[0] = unsafe.Pointer(&request) + parms[1] = unsafe.Pointer(&pid) + parms[2] = unsafe.Pointer(&addr) + parms[3] = unsafe.Pointer(&data) + parms[4] = unsafe.Pointer(&buffer) + parms[5] = unsafe.Pointer(&rv) + parms[6] = unsafe.Pointer(&rc) + parms[7] = unsafe.Pointer(&rn) + bpxcall(parms[:], BPX4PTR) + return rv, rc, rn +} + +func copyU8(val uint8, dest []uint8) int { + if len(dest) < 1 { + return 0 + } + dest[0] = val + return 1 +} + +func copyU8Arr(src, dest []uint8) int { + if len(dest) < len(src) { + return 0 + } + for i, v := range src { + dest[i] = v + } + return len(src) +} + +func copyU16(val uint16, dest []uint16) int { + if len(dest) < 1 { + return 0 + } + dest[0] = val + return 1 +} + +func copyU32(val uint32, dest []uint32) int { + if len(dest) < 1 { + return 0 + } + dest[0] = val + return 1 +} + +func copyU32Arr(src, dest []uint32) int { + if len(dest) < len(src) { + return 0 + } + for i, v := range src { + dest[i] = v + } + return len(src) +} + +func copyU64(val uint64, dest []uint64) int { + if len(dest) < 1 { + return 0 + } + dest[0] = val + return 1 +} diff --git a/vendor/golang.org/x/sys/unix/bpxsvc_zos.s b/vendor/golang.org/x/sys/unix/bpxsvc_zos.s new file mode 100644 index 0000000000..4bd4a17982 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/bpxsvc_zos.s @@ -0,0 +1,192 @@ +// Copyright 2024 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. + +#include "go_asm.h" +#include "textflag.h" + +// function to call USS assembly language services +// +// doc: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_3.1.0/com.ibm.zos.v3r1.bpxb100/bit64env.htm +// +// arg1 unsafe.Pointer array that ressembles an OS PLIST +// +// arg2 function offset as in +// doc: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_3.1.0/com.ibm.zos.v3r1.bpxb100/bpx2cr_List_of_offsets.htm +// +// func bpxcall(plist []unsafe.Pointer, bpx_offset int64) + +TEXT ·bpxcall(SB), NOSPLIT|NOFRAME, $0 + MOVD plist_base+0(FP), R1 // r1 points to plist + MOVD bpx_offset+24(FP), R2 // r2 offset to BPX vector table + MOVD R14, R7 // save r14 + MOVD R15, R8 // save r15 + MOVWZ 16(R0), R9 + MOVWZ 544(R9), R9 + MOVWZ 24(R9), R9 // call vector in r9 + ADD R2, R9 // add offset to vector table + MOVWZ (R9), R9 // r9 points to entry point + BYTE $0x0D // BL R14,R9 --> basr r14,r9 + BYTE $0xE9 // clobbers 0,1,14,15 + MOVD R8, R15 // restore 15 + JMP R7 // return via saved return address + +// func A2e(arr [] byte) +// code page conversion from 819 to 1047 +TEXT ·A2e(SB), NOSPLIT|NOFRAME, $0 + MOVD arg_base+0(FP), R2 // pointer to arry of characters + MOVD arg_len+8(FP), R3 // count + XOR R0, R0 + XOR R1, R1 + BYTE $0xA7; BYTE $0x15; BYTE $0x00; BYTE $0x82 // BRAS 1,(2+(256/2)) + + // ASCII -> EBCDIC conversion table: + BYTE $0x00; BYTE $0x01; BYTE $0x02; BYTE $0x03 + BYTE $0x37; BYTE $0x2d; BYTE $0x2e; BYTE $0x2f + BYTE $0x16; BYTE $0x05; BYTE $0x15; BYTE $0x0b + BYTE $0x0c; BYTE $0x0d; BYTE $0x0e; BYTE $0x0f + BYTE $0x10; BYTE $0x11; BYTE $0x12; BYTE $0x13 + BYTE $0x3c; BYTE $0x3d; BYTE $0x32; BYTE $0x26 + BYTE $0x18; BYTE $0x19; BYTE $0x3f; BYTE $0x27 + BYTE $0x1c; BYTE $0x1d; BYTE $0x1e; BYTE $0x1f + BYTE $0x40; BYTE $0x5a; BYTE $0x7f; BYTE $0x7b + BYTE $0x5b; BYTE $0x6c; BYTE $0x50; BYTE $0x7d + BYTE $0x4d; BYTE $0x5d; BYTE $0x5c; BYTE $0x4e + BYTE $0x6b; BYTE $0x60; BYTE $0x4b; BYTE $0x61 + BYTE $0xf0; BYTE $0xf1; BYTE $0xf2; BYTE $0xf3 + BYTE $0xf4; BYTE $0xf5; BYTE $0xf6; BYTE $0xf7 + BYTE $0xf8; BYTE $0xf9; BYTE $0x7a; BYTE $0x5e + BYTE $0x4c; BYTE $0x7e; BYTE $0x6e; BYTE $0x6f + BYTE $0x7c; BYTE $0xc1; BYTE $0xc2; BYTE $0xc3 + BYTE $0xc4; BYTE $0xc5; BYTE $0xc6; BYTE $0xc7 + BYTE $0xc8; BYTE $0xc9; BYTE $0xd1; BYTE $0xd2 + BYTE $0xd3; BYTE $0xd4; BYTE $0xd5; BYTE $0xd6 + BYTE $0xd7; BYTE $0xd8; BYTE $0xd9; BYTE $0xe2 + BYTE $0xe3; BYTE $0xe4; BYTE $0xe5; BYTE $0xe6 + BYTE $0xe7; BYTE $0xe8; BYTE $0xe9; BYTE $0xad + BYTE $0xe0; BYTE $0xbd; BYTE $0x5f; BYTE $0x6d + BYTE $0x79; BYTE $0x81; BYTE $0x82; BYTE $0x83 + BYTE $0x84; BYTE $0x85; BYTE $0x86; BYTE $0x87 + BYTE $0x88; BYTE $0x89; BYTE $0x91; BYTE $0x92 + BYTE $0x93; BYTE $0x94; BYTE $0x95; BYTE $0x96 + BYTE $0x97; BYTE $0x98; BYTE $0x99; BYTE $0xa2 + BYTE $0xa3; BYTE $0xa4; BYTE $0xa5; BYTE $0xa6 + BYTE $0xa7; BYTE $0xa8; BYTE $0xa9; BYTE $0xc0 + BYTE $0x4f; BYTE $0xd0; BYTE $0xa1; BYTE $0x07 + BYTE $0x20; BYTE $0x21; BYTE $0x22; BYTE $0x23 + BYTE $0x24; BYTE $0x25; BYTE $0x06; BYTE $0x17 + BYTE $0x28; BYTE $0x29; BYTE $0x2a; BYTE $0x2b + BYTE $0x2c; BYTE $0x09; BYTE $0x0a; BYTE $0x1b + BYTE $0x30; BYTE $0x31; BYTE $0x1a; BYTE $0x33 + BYTE $0x34; BYTE $0x35; BYTE $0x36; BYTE $0x08 + BYTE $0x38; BYTE $0x39; BYTE $0x3a; BYTE $0x3b + BYTE $0x04; BYTE $0x14; BYTE $0x3e; BYTE $0xff + BYTE $0x41; BYTE $0xaa; BYTE $0x4a; BYTE $0xb1 + BYTE $0x9f; BYTE $0xb2; BYTE $0x6a; BYTE $0xb5 + BYTE $0xbb; BYTE $0xb4; BYTE $0x9a; BYTE $0x8a + BYTE $0xb0; BYTE $0xca; BYTE $0xaf; BYTE $0xbc + BYTE $0x90; BYTE $0x8f; BYTE $0xea; BYTE $0xfa + BYTE $0xbe; BYTE $0xa0; BYTE $0xb6; BYTE $0xb3 + BYTE $0x9d; BYTE $0xda; BYTE $0x9b; BYTE $0x8b + BYTE $0xb7; BYTE $0xb8; BYTE $0xb9; BYTE $0xab + BYTE $0x64; BYTE $0x65; BYTE $0x62; BYTE $0x66 + BYTE $0x63; BYTE $0x67; BYTE $0x9e; BYTE $0x68 + BYTE $0x74; BYTE $0x71; BYTE $0x72; BYTE $0x73 + BYTE $0x78; BYTE $0x75; BYTE $0x76; BYTE $0x77 + BYTE $0xac; BYTE $0x69; BYTE $0xed; BYTE $0xee + BYTE $0xeb; BYTE $0xef; BYTE $0xec; BYTE $0xbf + BYTE $0x80; BYTE $0xfd; BYTE $0xfe; BYTE $0xfb + BYTE $0xfc; BYTE $0xba; BYTE $0xae; BYTE $0x59 + BYTE $0x44; BYTE $0x45; BYTE $0x42; BYTE $0x46 + BYTE $0x43; BYTE $0x47; BYTE $0x9c; BYTE $0x48 + BYTE $0x54; BYTE $0x51; BYTE $0x52; BYTE $0x53 + BYTE $0x58; BYTE $0x55; BYTE $0x56; BYTE $0x57 + BYTE $0x8c; BYTE $0x49; BYTE $0xcd; BYTE $0xce + BYTE $0xcb; BYTE $0xcf; BYTE $0xcc; BYTE $0xe1 + BYTE $0x70; BYTE $0xdd; BYTE $0xde; BYTE $0xdb + BYTE $0xdc; BYTE $0x8d; BYTE $0x8e; BYTE $0xdf + +retry: + WORD $0xB9931022 // TROO 2,2,b'0001' + BVS retry + RET + +// func e2a(arr [] byte) +// code page conversion from 1047 to 819 +TEXT ·E2a(SB), NOSPLIT|NOFRAME, $0 + MOVD arg_base+0(FP), R2 // pointer to arry of characters + MOVD arg_len+8(FP), R3 // count + XOR R0, R0 + XOR R1, R1 + BYTE $0xA7; BYTE $0x15; BYTE $0x00; BYTE $0x82 // BRAS 1,(2+(256/2)) + + // EBCDIC -> ASCII conversion table: + BYTE $0x00; BYTE $0x01; BYTE $0x02; BYTE $0x03 + BYTE $0x9c; BYTE $0x09; BYTE $0x86; BYTE $0x7f + BYTE $0x97; BYTE $0x8d; BYTE $0x8e; BYTE $0x0b + BYTE $0x0c; BYTE $0x0d; BYTE $0x0e; BYTE $0x0f + BYTE $0x10; BYTE $0x11; BYTE $0x12; BYTE $0x13 + BYTE $0x9d; BYTE $0x0a; BYTE $0x08; BYTE $0x87 + BYTE $0x18; BYTE $0x19; BYTE $0x92; BYTE $0x8f + BYTE $0x1c; BYTE $0x1d; BYTE $0x1e; BYTE $0x1f + BYTE $0x80; BYTE $0x81; BYTE $0x82; BYTE $0x83 + BYTE $0x84; BYTE $0x85; BYTE $0x17; BYTE $0x1b + BYTE $0x88; BYTE $0x89; BYTE $0x8a; BYTE $0x8b + BYTE $0x8c; BYTE $0x05; BYTE $0x06; BYTE $0x07 + BYTE $0x90; BYTE $0x91; BYTE $0x16; BYTE $0x93 + BYTE $0x94; BYTE $0x95; BYTE $0x96; BYTE $0x04 + BYTE $0x98; BYTE $0x99; BYTE $0x9a; BYTE $0x9b + BYTE $0x14; BYTE $0x15; BYTE $0x9e; BYTE $0x1a + BYTE $0x20; BYTE $0xa0; BYTE $0xe2; BYTE $0xe4 + BYTE $0xe0; BYTE $0xe1; BYTE $0xe3; BYTE $0xe5 + BYTE $0xe7; BYTE $0xf1; BYTE $0xa2; BYTE $0x2e + BYTE $0x3c; BYTE $0x28; BYTE $0x2b; BYTE $0x7c + BYTE $0x26; BYTE $0xe9; BYTE $0xea; BYTE $0xeb + BYTE $0xe8; BYTE $0xed; BYTE $0xee; BYTE $0xef + BYTE $0xec; BYTE $0xdf; BYTE $0x21; BYTE $0x24 + BYTE $0x2a; BYTE $0x29; BYTE $0x3b; BYTE $0x5e + BYTE $0x2d; BYTE $0x2f; BYTE $0xc2; BYTE $0xc4 + BYTE $0xc0; BYTE $0xc1; BYTE $0xc3; BYTE $0xc5 + BYTE $0xc7; BYTE $0xd1; BYTE $0xa6; BYTE $0x2c + BYTE $0x25; BYTE $0x5f; BYTE $0x3e; BYTE $0x3f + BYTE $0xf8; BYTE $0xc9; BYTE $0xca; BYTE $0xcb + BYTE $0xc8; BYTE $0xcd; BYTE $0xce; BYTE $0xcf + BYTE $0xcc; BYTE $0x60; BYTE $0x3a; BYTE $0x23 + BYTE $0x40; BYTE $0x27; BYTE $0x3d; BYTE $0x22 + BYTE $0xd8; BYTE $0x61; BYTE $0x62; BYTE $0x63 + BYTE $0x64; BYTE $0x65; BYTE $0x66; BYTE $0x67 + BYTE $0x68; BYTE $0x69; BYTE $0xab; BYTE $0xbb + BYTE $0xf0; BYTE $0xfd; BYTE $0xfe; BYTE $0xb1 + BYTE $0xb0; BYTE $0x6a; BYTE $0x6b; BYTE $0x6c + BYTE $0x6d; BYTE $0x6e; BYTE $0x6f; BYTE $0x70 + BYTE $0x71; BYTE $0x72; BYTE $0xaa; BYTE $0xba + BYTE $0xe6; BYTE $0xb8; BYTE $0xc6; BYTE $0xa4 + BYTE $0xb5; BYTE $0x7e; BYTE $0x73; BYTE $0x74 + BYTE $0x75; BYTE $0x76; BYTE $0x77; BYTE $0x78 + BYTE $0x79; BYTE $0x7a; BYTE $0xa1; BYTE $0xbf + BYTE $0xd0; BYTE $0x5b; BYTE $0xde; BYTE $0xae + BYTE $0xac; BYTE $0xa3; BYTE $0xa5; BYTE $0xb7 + BYTE $0xa9; BYTE $0xa7; BYTE $0xb6; BYTE $0xbc + BYTE $0xbd; BYTE $0xbe; BYTE $0xdd; BYTE $0xa8 + BYTE $0xaf; BYTE $0x5d; BYTE $0xb4; BYTE $0xd7 + BYTE $0x7b; BYTE $0x41; BYTE $0x42; BYTE $0x43 + BYTE $0x44; BYTE $0x45; BYTE $0x46; BYTE $0x47 + BYTE $0x48; BYTE $0x49; BYTE $0xad; BYTE $0xf4 + BYTE $0xf6; BYTE $0xf2; BYTE $0xf3; BYTE $0xf5 + BYTE $0x7d; BYTE $0x4a; BYTE $0x4b; BYTE $0x4c + BYTE $0x4d; BYTE $0x4e; BYTE $0x4f; BYTE $0x50 + BYTE $0x51; BYTE $0x52; BYTE $0xb9; BYTE $0xfb + BYTE $0xfc; BYTE $0xf9; BYTE $0xfa; BYTE $0xff + BYTE $0x5c; BYTE $0xf7; BYTE $0x53; BYTE $0x54 + BYTE $0x55; BYTE $0x56; BYTE $0x57; BYTE $0x58 + BYTE $0x59; BYTE $0x5a; BYTE $0xb2; BYTE $0xd4 + BYTE $0xd6; BYTE $0xd2; BYTE $0xd3; BYTE $0xd5 + BYTE $0x30; BYTE $0x31; BYTE $0x32; BYTE $0x33 + BYTE $0x34; BYTE $0x35; BYTE $0x36; BYTE $0x37 + BYTE $0x38; BYTE $0x39; BYTE $0xb3; BYTE $0xdb + BYTE $0xdc; BYTE $0xd9; BYTE $0xda; BYTE $0x9f + +retry: + WORD $0xB9931022 // TROO 2,2,b'0001' + BVS retry + RET diff --git a/vendor/golang.org/x/sys/unix/epoll_zos.go b/vendor/golang.org/x/sys/unix/epoll_zos.go deleted file mode 100644 index 7753fddea8..0000000000 --- a/vendor/golang.org/x/sys/unix/epoll_zos.go +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright 2020 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:build zos && s390x - -package unix - -import ( - "sync" -) - -// This file simulates epoll on z/OS using poll. - -// Analogous to epoll_event on Linux. -// TODO(neeilan): Pad is because the Linux kernel expects a 96-bit struct. We never pass this to the kernel; remove? -type EpollEvent struct { - Events uint32 - Fd int32 - Pad int32 -} - -const ( - EPOLLERR = 0x8 - EPOLLHUP = 0x10 - EPOLLIN = 0x1 - EPOLLMSG = 0x400 - EPOLLOUT = 0x4 - EPOLLPRI = 0x2 - EPOLLRDBAND = 0x80 - EPOLLRDNORM = 0x40 - EPOLLWRBAND = 0x200 - EPOLLWRNORM = 0x100 - EPOLL_CTL_ADD = 0x1 - EPOLL_CTL_DEL = 0x2 - EPOLL_CTL_MOD = 0x3 - // The following constants are part of the epoll API, but represent - // currently unsupported functionality on z/OS. - // EPOLL_CLOEXEC = 0x80000 - // EPOLLET = 0x80000000 - // EPOLLONESHOT = 0x40000000 - // EPOLLRDHUP = 0x2000 // Typically used with edge-triggered notis - // EPOLLEXCLUSIVE = 0x10000000 // Exclusive wake-up mode - // EPOLLWAKEUP = 0x20000000 // Relies on Linux's BLOCK_SUSPEND capability -) - -// TODO(neeilan): We can eliminate these epToPoll / pToEpoll calls by using identical mask values for POLL/EPOLL -// constants where possible The lower 16 bits of epoll events (uint32) can fit any system poll event (int16). - -// epToPollEvt converts epoll event field to poll equivalent. -// In epoll, Events is a 32-bit field, while poll uses 16 bits. -func epToPollEvt(events uint32) int16 { - var ep2p = map[uint32]int16{ - EPOLLIN: POLLIN, - EPOLLOUT: POLLOUT, - EPOLLHUP: POLLHUP, - EPOLLPRI: POLLPRI, - EPOLLERR: POLLERR, - } - - var pollEvts int16 = 0 - for epEvt, pEvt := range ep2p { - if (events & epEvt) != 0 { - pollEvts |= pEvt - } - } - - return pollEvts -} - -// pToEpollEvt converts 16 bit poll event bitfields to 32-bit epoll event fields. -func pToEpollEvt(revents int16) uint32 { - var p2ep = map[int16]uint32{ - POLLIN: EPOLLIN, - POLLOUT: EPOLLOUT, - POLLHUP: EPOLLHUP, - POLLPRI: EPOLLPRI, - POLLERR: EPOLLERR, - } - - var epollEvts uint32 = 0 - for pEvt, epEvt := range p2ep { - if (revents & pEvt) != 0 { - epollEvts |= epEvt - } - } - - return epollEvts -} - -// Per-process epoll implementation. -type epollImpl struct { - mu sync.Mutex - epfd2ep map[int]*eventPoll - nextEpfd int -} - -// eventPoll holds a set of file descriptors being watched by the process. A process can have multiple epoll instances. -// On Linux, this is an in-kernel data structure accessed through a fd. -type eventPoll struct { - mu sync.Mutex - fds map[int]*EpollEvent -} - -// epoll impl for this process. -var impl epollImpl = epollImpl{ - epfd2ep: make(map[int]*eventPoll), - nextEpfd: 0, -} - -func (e *epollImpl) epollcreate(size int) (epfd int, err error) { - e.mu.Lock() - defer e.mu.Unlock() - epfd = e.nextEpfd - e.nextEpfd++ - - e.epfd2ep[epfd] = &eventPoll{ - fds: make(map[int]*EpollEvent), - } - return epfd, nil -} - -func (e *epollImpl) epollcreate1(flag int) (fd int, err error) { - return e.epollcreate(4) -} - -func (e *epollImpl) epollctl(epfd int, op int, fd int, event *EpollEvent) (err error) { - e.mu.Lock() - defer e.mu.Unlock() - - ep, ok := e.epfd2ep[epfd] - if !ok { - - return EBADF - } - - switch op { - case EPOLL_CTL_ADD: - // TODO(neeilan): When we make epfds and fds disjoint, detect epoll - // loops here (instances watching each other) and return ELOOP. - if _, ok := ep.fds[fd]; ok { - return EEXIST - } - ep.fds[fd] = event - case EPOLL_CTL_MOD: - if _, ok := ep.fds[fd]; !ok { - return ENOENT - } - ep.fds[fd] = event - case EPOLL_CTL_DEL: - if _, ok := ep.fds[fd]; !ok { - return ENOENT - } - delete(ep.fds, fd) - - } - return nil -} - -// Must be called while holding ep.mu -func (ep *eventPoll) getFds() []int { - fds := make([]int, len(ep.fds)) - for fd := range ep.fds { - fds = append(fds, fd) - } - return fds -} - -func (e *epollImpl) epollwait(epfd int, events []EpollEvent, msec int) (n int, err error) { - e.mu.Lock() // in [rare] case of concurrent epollcreate + epollwait - ep, ok := e.epfd2ep[epfd] - - if !ok { - e.mu.Unlock() - return 0, EBADF - } - - pollfds := make([]PollFd, 4) - for fd, epollevt := range ep.fds { - pollfds = append(pollfds, PollFd{Fd: int32(fd), Events: epToPollEvt(epollevt.Events)}) - } - e.mu.Unlock() - - n, err = Poll(pollfds, msec) - if err != nil { - return n, err - } - - i := 0 - for _, pFd := range pollfds { - if pFd.Revents != 0 { - events[i] = EpollEvent{Fd: pFd.Fd, Events: pToEpollEvt(pFd.Revents)} - i++ - } - - if i == n { - break - } - } - - return n, nil -} - -func EpollCreate(size int) (fd int, err error) { - return impl.epollcreate(size) -} - -func EpollCreate1(flag int) (fd int, err error) { - return impl.epollcreate1(flag) -} - -func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { - return impl.epollctl(epfd, op, fd, event) -} - -// Because EpollWait mutates events, the caller is expected to coordinate -// concurrent access if calling with the same epfd from multiple goroutines. -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - return impl.epollwait(epfd, events, msec) -} diff --git a/vendor/golang.org/x/sys/unix/fstatfs_zos.go b/vendor/golang.org/x/sys/unix/fstatfs_zos.go deleted file mode 100644 index c8bde601e7..0000000000 --- a/vendor/golang.org/x/sys/unix/fstatfs_zos.go +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2020 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:build zos && s390x - -package unix - -import ( - "unsafe" -) - -// This file simulates fstatfs on z/OS using fstatvfs and w_getmntent. - -func Fstatfs(fd int, stat *Statfs_t) (err error) { - var stat_v Statvfs_t - err = Fstatvfs(fd, &stat_v) - if err == nil { - // populate stat - stat.Type = 0 - stat.Bsize = stat_v.Bsize - stat.Blocks = stat_v.Blocks - stat.Bfree = stat_v.Bfree - stat.Bavail = stat_v.Bavail - stat.Files = stat_v.Files - stat.Ffree = stat_v.Ffree - stat.Fsid = stat_v.Fsid - stat.Namelen = stat_v.Namemax - stat.Frsize = stat_v.Frsize - stat.Flags = stat_v.Flag - for passn := 0; passn < 5; passn++ { - switch passn { - case 0: - err = tryGetmntent64(stat) - break - case 1: - err = tryGetmntent128(stat) - break - case 2: - err = tryGetmntent256(stat) - break - case 3: - err = tryGetmntent512(stat) - break - case 4: - err = tryGetmntent1024(stat) - break - default: - break - } - //proceed to return if: err is nil (found), err is nonnil but not ERANGE (another error occurred) - if err == nil || err != nil && err != ERANGE { - break - } - } - } - return err -} - -func tryGetmntent64(stat *Statfs_t) (err error) { - var mnt_ent_buffer struct { - header W_Mnth - filesys_info [64]W_Mntent - } - var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer)) - fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size) - if err != nil { - return err - } - err = ERANGE //return ERANGE if no match is found in this batch - for i := 0; i < fs_count; i++ { - if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) { - stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0]) - err = nil - break - } - } - return err -} - -func tryGetmntent128(stat *Statfs_t) (err error) { - var mnt_ent_buffer struct { - header W_Mnth - filesys_info [128]W_Mntent - } - var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer)) - fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size) - if err != nil { - return err - } - err = ERANGE //return ERANGE if no match is found in this batch - for i := 0; i < fs_count; i++ { - if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) { - stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0]) - err = nil - break - } - } - return err -} - -func tryGetmntent256(stat *Statfs_t) (err error) { - var mnt_ent_buffer struct { - header W_Mnth - filesys_info [256]W_Mntent - } - var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer)) - fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size) - if err != nil { - return err - } - err = ERANGE //return ERANGE if no match is found in this batch - for i := 0; i < fs_count; i++ { - if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) { - stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0]) - err = nil - break - } - } - return err -} - -func tryGetmntent512(stat *Statfs_t) (err error) { - var mnt_ent_buffer struct { - header W_Mnth - filesys_info [512]W_Mntent - } - var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer)) - fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size) - if err != nil { - return err - } - err = ERANGE //return ERANGE if no match is found in this batch - for i := 0; i < fs_count; i++ { - if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) { - stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0]) - err = nil - break - } - } - return err -} - -func tryGetmntent1024(stat *Statfs_t) (err error) { - var mnt_ent_buffer struct { - header W_Mnth - filesys_info [1024]W_Mntent - } - var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer)) - fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size) - if err != nil { - return err - } - err = ERANGE //return ERANGE if no match is found in this batch - for i := 0; i < fs_count; i++ { - if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) { - stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0]) - err = nil - break - } - } - return err -} diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index fdcaa974d2..d07dd09eb5 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -58,6 +58,7 @@ includes_Darwin=' #define _DARWIN_USE_64_BIT_INODE #define __APPLE_USE_RFC_3542 #include +#include #include #include #include @@ -263,6 +264,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -549,6 +551,7 @@ ccflags="$@" $2 !~ "NLA_TYPE_MASK" && $2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ && $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ || + $2 ~ /^SOCK_|SK_DIAG_|SKNLGRP_$/ || $2 ~ /^FIORDCHK$/ || $2 ~ /^SIOC/ || $2 ~ /^TIOC/ || diff --git a/vendor/golang.org/x/sys/unix/mmap_nomremap.go b/vendor/golang.org/x/sys/unix/mmap_nomremap.go index 4b68e59780..7f602ffd26 100644 --- a/vendor/golang.org/x/sys/unix/mmap_nomremap.go +++ b/vendor/golang.org/x/sys/unix/mmap_nomremap.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || openbsd || solaris +//go:build aix || darwin || dragonfly || freebsd || openbsd || solaris || zos package unix diff --git a/vendor/golang.org/x/sys/unix/mremap.go b/vendor/golang.org/x/sys/unix/mremap.go index fd45fe529d..3a5e776f89 100644 --- a/vendor/golang.org/x/sys/unix/mremap.go +++ b/vendor/golang.org/x/sys/unix/mremap.go @@ -50,3 +50,8 @@ func (m *mremapMmapper) Mremap(oldData []byte, newLength int, flags int) (data [ func Mremap(oldData []byte, newLength int, flags int) (data []byte, err error) { return mapper.Mremap(oldData, newLength, flags) } + +func MremapPtr(oldAddr unsafe.Pointer, oldSize uintptr, newAddr unsafe.Pointer, newSize uintptr, flags int) (ret unsafe.Pointer, err error) { + xaddr, err := mapper.mremap(uintptr(oldAddr), oldSize, newSize, flags, uintptr(newAddr)) + return unsafe.Pointer(xaddr), err +} diff --git a/vendor/golang.org/x/sys/unix/pagesize_unix.go b/vendor/golang.org/x/sys/unix/pagesize_unix.go index 4d0a3430ed..0482408d7c 100644 --- a/vendor/golang.org/x/sys/unix/pagesize_unix.go +++ b/vendor/golang.org/x/sys/unix/pagesize_unix.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos // For Unix, get the pagesize from the runtime. diff --git a/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go b/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go index 130398b6b7..b903c00604 100644 --- a/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go +++ b/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build darwin +//go:build darwin || zos package unix diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_zos.go b/vendor/golang.org/x/sys/unix/sockcmsg_zos.go new file mode 100644 index 0000000000..3e53dbc028 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/sockcmsg_zos.go @@ -0,0 +1,58 @@ +// Copyright 2024 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. + +// Socket control messages + +package unix + +import "unsafe" + +// UnixCredentials encodes credentials into a socket control message +// for sending to another process. This can be used for +// authentication. +func UnixCredentials(ucred *Ucred) []byte { + b := make([]byte, CmsgSpace(SizeofUcred)) + h := (*Cmsghdr)(unsafe.Pointer(&b[0])) + h.Level = SOL_SOCKET + h.Type = SCM_CREDENTIALS + h.SetLen(CmsgLen(SizeofUcred)) + *(*Ucred)(h.data(0)) = *ucred + return b +} + +// ParseUnixCredentials decodes a socket control message that contains +// credentials in a Ucred structure. To receive such a message, the +// SO_PASSCRED option must be enabled on the socket. +func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { + if m.Header.Level != SOL_SOCKET { + return nil, EINVAL + } + if m.Header.Type != SCM_CREDENTIALS { + return nil, EINVAL + } + ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) + return &ucred, nil +} + +// PktInfo4 encodes Inet4Pktinfo into a socket control message of type IP_PKTINFO. +func PktInfo4(info *Inet4Pktinfo) []byte { + b := make([]byte, CmsgSpace(SizeofInet4Pktinfo)) + h := (*Cmsghdr)(unsafe.Pointer(&b[0])) + h.Level = SOL_IP + h.Type = IP_PKTINFO + h.SetLen(CmsgLen(SizeofInet4Pktinfo)) + *(*Inet4Pktinfo)(h.data(0)) = *info + return b +} + +// PktInfo6 encodes Inet6Pktinfo into a socket control message of type IPV6_PKTINFO. +func PktInfo6(info *Inet6Pktinfo) []byte { + b := make([]byte, CmsgSpace(SizeofInet6Pktinfo)) + h := (*Cmsghdr)(unsafe.Pointer(&b[0])) + h.Level = SOL_IPV6 + h.Type = IPV6_PKTINFO + h.SetLen(CmsgLen(SizeofInet6Pktinfo)) + *(*Inet6Pktinfo)(h.data(0)) = *info + return b +} diff --git a/vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s b/vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s new file mode 100644 index 0000000000..3c4f33cb6a --- /dev/null +++ b/vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s @@ -0,0 +1,75 @@ +// Copyright 2024 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:build zos && s390x && gc + +#include "textflag.h" + +// provide the address of function variable to be fixed up. + +TEXT ·getPipe2Addr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Pipe2(SB), R8 + MOVD R8, ret+0(FP) + RET + +TEXT ·get_FlockAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Flock(SB), R8 + MOVD R8, ret+0(FP) + RET + +TEXT ·get_GetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Getxattr(SB), R8 + MOVD R8, ret+0(FP) + RET + +TEXT ·get_NanosleepAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Nanosleep(SB), R8 + MOVD R8, ret+0(FP) + RET + +TEXT ·get_SetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Setxattr(SB), R8 + MOVD R8, ret+0(FP) + RET + +TEXT ·get_Wait4Addr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Wait4(SB), R8 + MOVD R8, ret+0(FP) + RET + +TEXT ·get_MountAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Mount(SB), R8 + MOVD R8, ret+0(FP) + RET + +TEXT ·get_UnmountAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Unmount(SB), R8 + MOVD R8, ret+0(FP) + RET + +TEXT ·get_UtimesNanoAtAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·UtimesNanoAt(SB), R8 + MOVD R8, ret+0(FP) + RET + +TEXT ·get_UtimesNanoAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·UtimesNano(SB), R8 + MOVD R8, ret+0(FP) + RET + +TEXT ·get_MkfifoatAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Mkfifoat(SB), R8 + MOVD R8, ret+0(FP) + RET + +TEXT ·get_ChtagAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Chtag(SB), R8 + MOVD R8, ret+0(FP) + RET + +TEXT ·get_ReadlinkatAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Readlinkat(SB), R8 + MOVD R8, ret+0(FP) + RET + diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index 59542a897d..2d15200adb 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -402,6 +402,18 @@ func IoctlSetIfreqMTU(fd int, ifreq *IfreqMTU) error { return ioctlPtr(fd, SIOCSIFMTU, unsafe.Pointer(ifreq)) } +//sys renamexNp(from string, to string, flag uint32) (err error) + +func RenamexNp(from string, to string, flag uint32) (err error) { + return renamexNp(from, to, flag) +} + +//sys renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) + +func RenameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) { + return renameatxNp(fromfd, from, tofd, to, flag) +} + //sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS_SYSCTL func Uname(uname *Utsname) error { @@ -542,6 +554,18 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) { } } +//sys pthread_chdir_np(path string) (err error) + +func PthreadChdir(path string) (err error) { + return pthread_chdir_np(path) +} + +//sys pthread_fchdir_np(fd int) (err error) + +func PthreadFchdir(fd int) (err error) { + return pthread_fchdir_np(fd) +} + //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) //sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index 5682e2628a..3f1d3d4cb2 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -2592,3 +2592,4 @@ func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) { } //sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error) +//sys Mseal(b []byte, flags uint) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go index b25343c71a..b86ded549c 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -293,6 +293,7 @@ func Uname(uname *Utsname) error { //sys Mkfifoat(dirfd int, path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) +//sys Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(dirfd int, path string, mode int, perm uint32) (fd 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 77081de8c7..4e92e5aa40 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix.go @@ -154,6 +154,15 @@ func Munmap(b []byte) (err error) { return mapper.Munmap(b) } +func MmapPtr(fd int, offset int64, addr unsafe.Pointer, length uintptr, prot int, flags int) (ret unsafe.Pointer, err error) { + xaddr, err := mapper.mmap(uintptr(addr), length, prot, flags, fd, offset) + return unsafe.Pointer(xaddr), err +} + +func MunmapPtr(addr unsafe.Pointer, length uintptr) (err error) { + return mapper.munmap(uintptr(addr), length) +} + func Read(fd int, p []byte) (n int, err error) { n, err = read(fd, p) if raceenabled { diff --git a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go index b473038c61..312ae6ac1d 100644 --- a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go @@ -4,11 +4,21 @@ //go:build zos && s390x +// Many of the following syscalls are not available on all versions of z/OS. +// Some missing calls have legacy implementations/simulations but others +// will be missing completely. To achieve consistent failing behaviour on +// legacy systems, we first test the function pointer via a safeloading +// mechanism to see if the function exists on a given system. Then execution +// is branched to either continue the function call, or return an error. + package unix import ( "bytes" "fmt" + "os" + "reflect" + "regexp" "runtime" "sort" "strings" @@ -17,17 +27,205 @@ import ( "unsafe" ) +//go:noescape +func initZosLibVec() + +//go:noescape +func GetZosLibVec() uintptr + +func init() { + initZosLibVec() + r0, _, _ := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS_____GETENV_A<<4, uintptr(unsafe.Pointer(&([]byte("__ZOS_XSYSTRACE\x00"))[0]))) + if r0 != 0 { + n, _, _ := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___ATOI_A<<4, r0) + ZosTraceLevel = int(n) + r0, _, _ := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS_____GETENV_A<<4, uintptr(unsafe.Pointer(&([]byte("__ZOS_XSYSTRACEFD\x00"))[0]))) + if r0 != 0 { + fd, _, _ := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___ATOI_A<<4, r0) + f := os.NewFile(fd, "zostracefile") + if f != nil { + ZosTracefile = f + } + } + + } +} + +//go:noescape +func CallLeFuncWithErr(funcdesc uintptr, parms ...uintptr) (ret, errno2 uintptr, err Errno) + +//go:noescape +func CallLeFuncWithPtrReturn(funcdesc uintptr, parms ...uintptr) (ret, errno2 uintptr, err Errno) + +// ------------------------------- +// pointer validity test +// good pointer returns 0 +// bad pointer returns 1 +// +//go:nosplit +func ptrtest(uintptr) uint64 + +// Load memory at ptr location with error handling if the location is invalid +// +//go:noescape +func safeload(ptr uintptr) (value uintptr, error uintptr) + const ( - O_CLOEXEC = 0 // Dummy value (not supported). - AF_LOCAL = AF_UNIX // AF_LOCAL is an alias for AF_UNIX + entrypointLocationOffset = 8 // From function descriptor + + xplinkEyecatcher = 0x00c300c500c500f1 // ".C.E.E.1" + eyecatcherOffset = 16 // From function entrypoint (negative) + ppa1LocationOffset = 8 // From function entrypoint (negative) + + nameLenOffset = 0x14 // From PPA1 start + nameOffset = 0x16 // From PPA1 start ) -func syscall_syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) -func syscall_rawsyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) -func syscall_syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) -func syscall_rawsyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) -func syscall_syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) -func syscall_rawsyscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) +func getPpaOffset(funcptr uintptr) int64 { + entrypoint, err := safeload(funcptr + entrypointLocationOffset) + if err != 0 { + return -1 + } + + // XPLink functions have ".C.E.E.1" as the first 8 bytes (EBCDIC) + val, err := safeload(entrypoint - eyecatcherOffset) + if err != 0 { + return -1 + } + if val != xplinkEyecatcher { + return -1 + } + + ppaoff, err := safeload(entrypoint - ppa1LocationOffset) + if err != 0 { + return -1 + } + + ppaoff >>= 32 + return int64(ppaoff) +} + +//------------------------------- +// function descriptor pointer validity test +// good pointer returns 0 +// bad pointer returns 1 + +// TODO: currently mksyscall_zos_s390x.go generate empty string for funcName +// have correct funcName pass to the funcptrtest function +func funcptrtest(funcptr uintptr, funcName string) uint64 { + entrypoint, err := safeload(funcptr + entrypointLocationOffset) + if err != 0 { + return 1 + } + + ppaoff := getPpaOffset(funcptr) + if ppaoff == -1 { + return 1 + } + + // PPA1 offset value is from the start of the entire function block, not the entrypoint + ppa1 := (entrypoint - eyecatcherOffset) + uintptr(ppaoff) + + nameLen, err := safeload(ppa1 + nameLenOffset) + if err != 0 { + return 1 + } + + nameLen >>= 48 + if nameLen > 128 { + return 1 + } + + // no function name input to argument end here + if funcName == "" { + return 0 + } + + var funcname [128]byte + for i := 0; i < int(nameLen); i += 8 { + v, err := safeload(ppa1 + nameOffset + uintptr(i)) + if err != 0 { + return 1 + } + funcname[i] = byte(v >> 56) + funcname[i+1] = byte(v >> 48) + funcname[i+2] = byte(v >> 40) + funcname[i+3] = byte(v >> 32) + funcname[i+4] = byte(v >> 24) + funcname[i+5] = byte(v >> 16) + funcname[i+6] = byte(v >> 8) + funcname[i+7] = byte(v) + } + + runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___E2A_L<<4, // __e2a_l + []uintptr{uintptr(unsafe.Pointer(&funcname[0])), nameLen}) + + name := string(funcname[:nameLen]) + if name != funcName { + return 1 + } + + return 0 +} + +// For detection of capabilities on a system. +// Is function descriptor f a valid function? +func isValidLeFunc(f uintptr) error { + ret := funcptrtest(f, "") + if ret != 0 { + return fmt.Errorf("Bad pointer, not an LE function ") + } + return nil +} + +// Retrieve function name from descriptor +func getLeFuncName(f uintptr) (string, error) { + // assume it has been checked, only check ppa1 validity here + entry := ((*[2]uintptr)(unsafe.Pointer(f)))[1] + preamp := ((*[4]uint32)(unsafe.Pointer(entry - eyecatcherOffset))) + + offsetPpa1 := preamp[2] + if offsetPpa1 > 0x0ffff { + return "", fmt.Errorf("PPA1 offset seems too big 0x%x\n", offsetPpa1) + } + + ppa1 := uintptr(unsafe.Pointer(preamp)) + uintptr(offsetPpa1) + res := ptrtest(ppa1) + if res != 0 { + return "", fmt.Errorf("PPA1 address not valid") + } + + size := *(*uint16)(unsafe.Pointer(ppa1 + nameLenOffset)) + if size > 128 { + return "", fmt.Errorf("Function name seems too long, length=%d\n", size) + } + + var name [128]byte + funcname := (*[128]byte)(unsafe.Pointer(ppa1 + nameOffset)) + copy(name[0:size], funcname[0:size]) + + runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___E2A_L<<4, // __e2a_l + []uintptr{uintptr(unsafe.Pointer(&name[0])), uintptr(size)}) + + return string(name[:size]), nil +} + +// Check z/OS version +func zosLeVersion() (version, release uint32) { + p1 := (*(*uintptr)(unsafe.Pointer(uintptr(1208)))) >> 32 + p1 = *(*uintptr)(unsafe.Pointer(uintptr(p1 + 88))) + p1 = *(*uintptr)(unsafe.Pointer(uintptr(p1 + 8))) + p1 = *(*uintptr)(unsafe.Pointer(uintptr(p1 + 984))) + vrm := *(*uint32)(unsafe.Pointer(p1 + 80)) + version = (vrm & 0x00ff0000) >> 16 + release = (vrm & 0x0000ff00) >> 8 + return +} + +// returns a zos C FILE * for stdio fd 0, 1, 2 +func ZosStdioFilep(fd int32) uintptr { + return uintptr(*(*uint64)(unsafe.Pointer(uintptr(*(*uint64)(unsafe.Pointer(uintptr(*(*uint64)(unsafe.Pointer(uintptr(uint64(*(*uint32)(unsafe.Pointer(uintptr(1208)))) + 80))) + uint64((fd+2)<<3)))))))) +} func copyStat(stat *Stat_t, statLE *Stat_LE_t) { stat.Dev = uint64(statLE.Dev) @@ -65,6 +263,21 @@ func (d *Dirent) NameString() string { } } +func DecodeData(dest []byte, sz int, val uint64) { + for i := 0; i < sz; i++ { + dest[sz-1-i] = byte((val >> (uint64(i * 8))) & 0xff) + } +} + +func EncodeData(data []byte) uint64 { + var value uint64 + sz := len(data) + for i := 0; i < sz; i++ { + value |= uint64(data[i]) << uint64(((sz - i - 1) * 8)) + } + return value +} + func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, EINVAL @@ -74,7 +287,9 @@ func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) - sa.raw.Addr = sa.Addr + for i := 0; i < len(sa.Addr); i++ { + sa.raw.Addr[i] = sa.Addr[i] + } return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil } @@ -88,7 +303,9 @@ func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) { p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Scope_id = sa.ZoneId - sa.raw.Addr = sa.Addr + for i := 0; i < len(sa.Addr); i++ { + sa.raw.Addr[i] = sa.Addr[i] + } return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil } @@ -146,7 +363,9 @@ func anyToSockaddr(_ int, rsa *RawSockaddrAny) (Sockaddr, error) { sa := new(SockaddrInet4) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) - sa.Addr = pp.Addr + for i := 0; i < len(sa.Addr); i++ { + sa.Addr[i] = pp.Addr[i] + } return sa, nil case AF_INET6: @@ -155,7 +374,9 @@ func anyToSockaddr(_ int, rsa *RawSockaddrAny) (Sockaddr, error) { p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.ZoneId = pp.Scope_id - sa.Addr = pp.Addr + for i := 0; i < len(sa.Addr); i++ { + sa.Addr[i] = pp.Addr[i] + } return sa, nil } return nil, EAFNOSUPPORT @@ -177,6 +398,43 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) { return } +func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) { + var rsa RawSockaddrAny + var len _Socklen = SizeofSockaddrAny + nfd, err = accept4(fd, &rsa, &len, flags) + if err != nil { + return + } + if len > SizeofSockaddrAny { + panic("RawSockaddrAny too small") + } + // TODO(neeilan): Remove 0 in call + sa, err = anyToSockaddr(0, &rsa) + if err != nil { + Close(nfd) + nfd = 0 + } + return +} + +func Ctermid() (tty string, err error) { + var termdev [1025]byte + runtime.EnterSyscall() + r0, err2, err1 := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___CTERMID_A<<4, uintptr(unsafe.Pointer(&termdev[0]))) + runtime.ExitSyscall() + if r0 == 0 { + return "", fmt.Errorf("%s (errno2=0x%x)\n", err1.Error(), err2) + } + s := string(termdev[:]) + idx := strings.Index(s, string(rune(0))) + if idx == -1 { + tty = s + } else { + tty = s[:idx] + } + return +} + func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } @@ -190,10 +448,16 @@ func (cmsg *Cmsghdr) SetLen(length int) { } //sys fcntl(fd int, cmd int, arg int) (val int, err error) +//sys Flistxattr(fd int, dest []byte) (sz int, err error) = SYS___FLISTXATTR_A +//sys Fremovexattr(fd int, attr string) (err error) = SYS___FREMOVEXATTR_A //sys read(fd int, p []byte) (n int, err error) //sys write(fd int, p []byte) (n int, err error) +//sys Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) = SYS___FGETXATTR_A +//sys Fsetxattr(fd int, attr string, data []byte, flag int) (err error) = SYS___FSETXATTR_A + //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) = SYS___ACCEPT_A +//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) = SYS___ACCEPT4_A //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = SYS___BIND_A //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = SYS___CONNECT_A //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) @@ -204,6 +468,7 @@ func (cmsg *Cmsghdr) SetLen(length int) { //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = SYS___GETPEERNAME_A //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = SYS___GETSOCKNAME_A +//sys Removexattr(path string, attr string) (err error) = SYS___REMOVEXATTR_A //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) = SYS___RECVFROM_A //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = SYS___SENDTO_A //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = SYS___RECVMSG_A @@ -212,6 +477,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { //sys munmap(addr uintptr, length uintptr) (err error) = SYS_MUNMAP //sys ioctl(fd int, req int, arg uintptr) (err error) = SYS_IOCTL //sys ioctlPtr(fd int, req int, arg unsafe.Pointer) (err error) = SYS_IOCTL +//sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error) = SYS_SHMAT +//sys shmctl(id int, cmd int, buf *SysvShmDesc) (result int, err error) = SYS_SHMCTL64 +//sys shmdt(addr uintptr) (err error) = SYS_SHMDT +//sys shmget(key int, size int, flag int) (id int, err error) = SYS_SHMGET //sys Access(path string, mode uint32) (err error) = SYS___ACCESS_A //sys Chdir(path string) (err error) = SYS___CHDIR_A @@ -220,14 +489,31 @@ func (cmsg *Cmsghdr) SetLen(length int) { //sys Creat(path string, mode uint32) (fd int, err error) = SYS___CREAT_A //sys Dup(oldfd int) (fd int, err error) //sys Dup2(oldfd int, newfd int) (err error) +//sys Dup3(oldfd int, newfd int, flags int) (err error) = SYS_DUP3 +//sys Dirfd(dirp uintptr) (fd int, err error) = SYS_DIRFD +//sys EpollCreate(size int) (fd int, err error) = SYS_EPOLL_CREATE +//sys EpollCreate1(flags int) (fd int, err error) = SYS_EPOLL_CREATE1 +//sys EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) = SYS_EPOLL_CTL +//sys EpollPwait(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error) = SYS_EPOLL_PWAIT +//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_WAIT //sys Errno2() (er2 int) = SYS___ERRNO2 -//sys Err2ad() (eadd *int) = SYS___ERR2AD +//sys Eventfd(initval uint, flags int) (fd int, err error) = SYS_EVENTFD //sys Exit(code int) +//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) = SYS___FACCESSAT_A + +func Faccessat2(dirfd int, path string, mode uint32, flags int) (err error) { + return Faccessat(dirfd, path, mode, flags) +} + //sys Fchdir(fd int) (err error) //sys Fchmod(fd int, mode uint32) (err error) +//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) = SYS___FCHMODAT_A //sys Fchown(fd int, uid int, gid int) (err error) +//sys Fchownat(fd int, path string, uid int, gid int, flags int) (err error) = SYS___FCHOWNAT_A //sys FcntlInt(fd uintptr, cmd int, arg int) (retval int, err error) = SYS_FCNTL +//sys Fdatasync(fd int) (err error) = SYS_FDATASYNC //sys fstat(fd int, stat *Stat_LE_t) (err error) +//sys fstatat(dirfd int, path string, stat *Stat_LE_t, flags int) (err error) = SYS___FSTATAT_A func Fstat(fd int, stat *Stat_t) (err error) { var statLE Stat_LE_t @@ -236,28 +522,208 @@ func Fstat(fd int, stat *Stat_t) (err error) { return } +func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { + var statLE Stat_LE_t + err = fstatat(dirfd, path, &statLE, flags) + copyStat(stat, &statLE) + return +} + +func impl_Getxattr(path string, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p2 unsafe.Pointer + if len(dest) > 0 { + _p2 = unsafe.Pointer(&dest[0]) + } else { + _p2 = unsafe.Pointer(&_zero) + } + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___GETXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest))) + sz = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_GetxattrAddr() *(func(path string, attr string, dest []byte) (sz int, err error)) + +var Getxattr = enter_Getxattr + +func enter_Getxattr(path string, attr string, dest []byte) (sz int, err error) { + funcref := get_GetxattrAddr() + if validGetxattr() { + *funcref = impl_Getxattr + } else { + *funcref = error_Getxattr + } + return (*funcref)(path, attr, dest) +} + +func error_Getxattr(path string, attr string, dest []byte) (sz int, err error) { + return -1, ENOSYS +} + +func validGetxattr() bool { + if funcptrtest(GetZosLibVec()+SYS___GETXATTR_A<<4, "") == 0 { + if name, err := getLeFuncName(GetZosLibVec() + SYS___GETXATTR_A<<4); err == nil { + return name == "__getxattr_a" + } + } + return false +} + +//sys Lgetxattr(link string, attr string, dest []byte) (sz int, err error) = SYS___LGETXATTR_A +//sys Lsetxattr(path string, attr string, data []byte, flags int) (err error) = SYS___LSETXATTR_A + +func impl_Setxattr(path string, attr string, data []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p2 unsafe.Pointer + if len(data) > 0 { + _p2 = unsafe.Pointer(&data[0]) + } else { + _p2 = unsafe.Pointer(&_zero) + } + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SETXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags)) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_SetxattrAddr() *(func(path string, attr string, data []byte, flags int) (err error)) + +var Setxattr = enter_Setxattr + +func enter_Setxattr(path string, attr string, data []byte, flags int) (err error) { + funcref := get_SetxattrAddr() + if validSetxattr() { + *funcref = impl_Setxattr + } else { + *funcref = error_Setxattr + } + return (*funcref)(path, attr, data, flags) +} + +func error_Setxattr(path string, attr string, data []byte, flags int) (err error) { + return ENOSYS +} + +func validSetxattr() bool { + if funcptrtest(GetZosLibVec()+SYS___SETXATTR_A<<4, "") == 0 { + if name, err := getLeFuncName(GetZosLibVec() + SYS___SETXATTR_A<<4); err == nil { + return name == "__setxattr_a" + } + } + return false +} + +//sys Fstatfs(fd int, buf *Statfs_t) (err error) = SYS_FSTATFS //sys Fstatvfs(fd int, stat *Statvfs_t) (err error) = SYS_FSTATVFS //sys Fsync(fd int) (err error) +//sys Futimes(fd int, tv []Timeval) (err error) = SYS_FUTIMES +//sys Futimesat(dirfd int, path string, tv []Timeval) (err error) = SYS___FUTIMESAT_A //sys Ftruncate(fd int, length int64) (err error) -//sys Getpagesize() (pgsize int) = SYS_GETPAGESIZE +//sys Getrandom(buf []byte, flags int) (n int, err error) = SYS_GETRANDOM +//sys InotifyInit() (fd int, err error) = SYS_INOTIFY_INIT +//sys InotifyInit1(flags int) (fd int, err error) = SYS_INOTIFY_INIT1 +//sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) = SYS___INOTIFY_ADD_WATCH_A +//sys InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) = SYS_INOTIFY_RM_WATCH +//sys Listxattr(path string, dest []byte) (sz int, err error) = SYS___LISTXATTR_A +//sys Llistxattr(path string, dest []byte) (sz int, err error) = SYS___LLISTXATTR_A +//sys Lremovexattr(path string, attr string) (err error) = SYS___LREMOVEXATTR_A +//sys Lutimes(path string, tv []Timeval) (err error) = SYS___LUTIMES_A //sys Mprotect(b []byte, prot int) (err error) = SYS_MPROTECT //sys Msync(b []byte, flags int) (err error) = SYS_MSYNC +//sys Console2(cmsg *ConsMsg2, modstr *byte, concmd *uint32) (err error) = SYS___CONSOLE2 + +// Pipe2 begin + +//go:nosplit +func getPipe2Addr() *(func([]int, int) error) + +var Pipe2 = pipe2Enter + +func pipe2Enter(p []int, flags int) (err error) { + if funcptrtest(GetZosLibVec()+SYS_PIPE2<<4, "") == 0 { + *getPipe2Addr() = pipe2Impl + } else { + *getPipe2Addr() = pipe2Error + } + return (*getPipe2Addr())(p, flags) +} + +func pipe2Impl(p []int, flags int) (err error) { + var pp [2]_C_int + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PIPE2<<4, uintptr(unsafe.Pointer(&pp[0])), uintptr(flags)) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } else { + p[0] = int(pp[0]) + p[1] = int(pp[1]) + } + return +} +func pipe2Error(p []int, flags int) (err error) { + return fmt.Errorf("Pipe2 is not available on this system") +} + +// Pipe2 end + //sys Poll(fds []PollFd, timeout int) (n int, err error) = SYS_POLL + +func Readdir(dir uintptr) (dirent *Dirent, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___READDIR_A<<4, uintptr(dir)) + runtime.ExitSyscall() + dirent = (*Dirent)(unsafe.Pointer(r0)) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//sys Readdir_r(dirp uintptr, entry *direntLE, result **direntLE) (err error) = SYS___READDIR_R_A +//sys Statfs(path string, buf *Statfs_t) (err error) = SYS___STATFS_A +//sys Syncfs(fd int) (err error) = SYS_SYNCFS //sys Times(tms *Tms) (ticks uintptr, err error) = SYS_TIMES //sys W_Getmntent(buff *byte, size int) (lastsys int, err error) = SYS_W_GETMNTENT //sys W_Getmntent_A(buff *byte, size int) (lastsys int, err error) = SYS___W_GETMNTENT_A //sys mount_LE(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) = SYS___MOUNT_A -//sys unmount(filesystem string, mtm int) (err error) = SYS___UMOUNT_A +//sys unmount_LE(filesystem string, mtm int) (err error) = SYS___UMOUNT_A //sys Chroot(path string) (err error) = SYS___CHROOT_A //sys Select(nmsgsfds int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (ret int, err error) = SYS_SELECT -//sysnb Uname(buf *Utsname) (err error) = SYS___UNAME_A +//sysnb Uname(buf *Utsname) (err error) = SYS_____OSNAME_A +//sys Unshare(flags int) (err error) = SYS_UNSHARE func Ptsname(fd int) (name string, err error) { - r0, _, e1 := syscall_syscall(SYS___PTSNAME_A, uintptr(fd), 0, 0) - name = u2s(unsafe.Pointer(r0)) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___PTSNAME_A<<4, uintptr(fd)) + runtime.ExitSyscall() + if r0 == 0 { + err = errnoErr2(e1, e2) + } else { + name = u2s(unsafe.Pointer(r0)) } return } @@ -272,13 +738,19 @@ func u2s(cstr unsafe.Pointer) string { } func Close(fd int) (err error) { - _, _, e1 := syscall_syscall(SYS_CLOSE, uintptr(fd), 0, 0) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_CLOSE<<4, uintptr(fd)) + runtime.ExitSyscall() for i := 0; e1 == EAGAIN && i < 10; i++ { - _, _, _ = syscall_syscall(SYS_USLEEP, uintptr(10), 0, 0) - _, _, e1 = syscall_syscall(SYS_CLOSE, uintptr(fd), 0, 0) + runtime.EnterSyscall() + CallLeFuncWithErr(GetZosLibVec()+SYS_USLEEP<<4, uintptr(10)) + runtime.ExitSyscall() + runtime.EnterSyscall() + r0, e2, e1 = CallLeFuncWithErr(GetZosLibVec()+SYS_CLOSE<<4, uintptr(fd)) + runtime.ExitSyscall() } - if e1 != 0 { - err = errnoErr(e1) + if r0 != 0 { + err = errnoErr2(e1, e2) } return } @@ -288,9 +760,15 @@ func Madvise(b []byte, advice int) (err error) { return } +func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) { + return mapper.Mmap(fd, offset, length, prot, flags) +} + +func Munmap(b []byte) (err error) { + return mapper.Munmap(b) +} + //sys Gethostname(buf []byte) (err error) = SYS___GETHOSTNAME_A -//sysnb Getegid() (egid int) -//sysnb Geteuid() (uid int) //sysnb Getgid() (gid int) //sysnb Getpid() (pid int) //sysnb Getpgid(pid int) (pgid int, err error) = SYS_GETPGID @@ -317,11 +795,14 @@ func Getrusage(who int, rusage *Rusage) (err error) { return } +//sys Getegid() (egid int) = SYS_GETEGID +//sys Geteuid() (euid int) = SYS_GETEUID //sysnb Getsid(pid int) (sid int, err error) = SYS_GETSID //sysnb Getuid() (uid int) //sysnb Kill(pid int, sig Signal) (err error) //sys Lchown(path string, uid int, gid int) (err error) = SYS___LCHOWN_A //sys Link(path string, link string) (err error) = SYS___LINK_A +//sys Linkat(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error) = SYS___LINKAT_A //sys Listen(s int, n int) (err error) //sys lstat(path string, stat *Stat_LE_t) (err error) = SYS___LSTAT_A @@ -332,15 +813,150 @@ func Lstat(path string, stat *Stat_t) (err error) { return } +// for checking symlinks begins with $VERSION/ $SYSNAME/ $SYSSYMR/ $SYSSYMA/ +func isSpecialPath(path []byte) (v bool) { + var special = [4][8]byte{ + [8]byte{'V', 'E', 'R', 'S', 'I', 'O', 'N', '/'}, + [8]byte{'S', 'Y', 'S', 'N', 'A', 'M', 'E', '/'}, + [8]byte{'S', 'Y', 'S', 'S', 'Y', 'M', 'R', '/'}, + [8]byte{'S', 'Y', 'S', 'S', 'Y', 'M', 'A', '/'}} + + var i, j int + for i = 0; i < len(special); i++ { + for j = 0; j < len(special[i]); j++ { + if path[j] != special[i][j] { + break + } + } + if j == len(special[i]) { + return true + } + } + return false +} + +func realpath(srcpath string, abspath []byte) (pathlen int, errno int) { + var source [1024]byte + copy(source[:], srcpath) + source[len(srcpath)] = 0 + ret := runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___REALPATH_A<<4, //__realpath_a() + []uintptr{uintptr(unsafe.Pointer(&source[0])), + uintptr(unsafe.Pointer(&abspath[0]))}) + if ret != 0 { + index := bytes.IndexByte(abspath[:], byte(0)) + if index != -1 { + return index, 0 + } + } else { + errptr := (*int)(unsafe.Pointer(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO<<4, []uintptr{}))) //__errno() + return 0, *errptr + } + return 0, 245 // EBADDATA 245 +} + +func Readlink(path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + n = int(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___READLINK_A<<4, + []uintptr{uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))})) + runtime.KeepAlive(unsafe.Pointer(_p0)) + if n == -1 { + value := *(*int32)(unsafe.Pointer(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO<<4, []uintptr{}))) + err = errnoErr(Errno(value)) + } else { + if buf[0] == '$' { + if isSpecialPath(buf[1:9]) { + cnt, err1 := realpath(path, buf) + if err1 == 0 { + n = cnt + } + } + } + } + return +} + +func impl_Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___READLINKAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) + runtime.ExitSyscall() + n = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + return n, err + } else { + if buf[0] == '$' { + if isSpecialPath(buf[1:9]) { + cnt, err1 := realpath(path, buf) + if err1 == 0 { + n = cnt + } + } + } + } + return +} + +//go:nosplit +func get_ReadlinkatAddr() *(func(dirfd int, path string, buf []byte) (n int, err error)) + +var Readlinkat = enter_Readlinkat + +func enter_Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { + funcref := get_ReadlinkatAddr() + if funcptrtest(GetZosLibVec()+SYS___READLINKAT_A<<4, "") == 0 { + *funcref = impl_Readlinkat + } else { + *funcref = error_Readlinkat + } + return (*funcref)(dirfd, path, buf) +} + +func error_Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { + n = -1 + err = ENOSYS + return +} + //sys Mkdir(path string, mode uint32) (err error) = SYS___MKDIR_A +//sys Mkdirat(dirfd int, path string, mode uint32) (err error) = SYS___MKDIRAT_A //sys Mkfifo(path string, mode uint32) (err error) = SYS___MKFIFO_A //sys Mknod(path string, mode uint32, dev int) (err error) = SYS___MKNOD_A +//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) = SYS___MKNODAT_A +//sys PivotRoot(newroot string, oldroot string) (err error) = SYS___PIVOT_ROOT_A //sys Pread(fd int, p []byte, offset int64) (n int, err error) //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) -//sys Readlink(path string, buf []byte) (n int, err error) = SYS___READLINK_A +//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) = SYS___PRCTL_A +//sysnb Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT //sys Rename(from string, to string) (err error) = SYS___RENAME_A +//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) = SYS___RENAMEAT_A +//sys Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) = SYS___RENAMEAT2_A //sys Rmdir(path string) (err error) = SYS___RMDIR_A //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK +//sys Setegid(egid int) (err error) = SYS_SETEGID +//sys Seteuid(euid int) (err error) = SYS_SETEUID +//sys Sethostname(p []byte) (err error) = SYS___SETHOSTNAME_A +//sys Setns(fd int, nstype int) (err error) = SYS_SETNS //sys Setpriority(which int, who int, prio int) (err error) //sysnb Setpgid(pid int, pgid int) (err error) = SYS_SETPGID //sysnb Setrlimit(resource int, lim *Rlimit) (err error) @@ -360,32 +976,57 @@ func Stat(path string, sta *Stat_t) (err error) { } //sys Symlink(path string, link string) (err error) = SYS___SYMLINK_A +//sys Symlinkat(oldPath string, dirfd int, newPath string) (err error) = SYS___SYMLINKAT_A //sys Sync() = SYS_SYNC //sys Truncate(path string, length int64) (err error) = SYS___TRUNCATE_A //sys Tcgetattr(fildes int, termptr *Termios) (err error) = SYS_TCGETATTR //sys Tcsetattr(fildes int, when int, termptr *Termios) (err error) = SYS_TCSETATTR //sys Umask(mask int) (oldmask int) //sys Unlink(path string) (err error) = SYS___UNLINK_A +//sys Unlinkat(dirfd int, path string, flags int) (err error) = SYS___UNLINKAT_A //sys Utime(path string, utim *Utimbuf) (err error) = SYS___UTIME_A //sys open(path string, mode int, perm uint32) (fd int, err error) = SYS___OPEN_A func Open(path string, mode int, perm uint32) (fd int, err error) { + if mode&O_ACCMODE == 0 { + mode |= O_RDONLY + } return open(path, mode, perm) } -func Mkfifoat(dirfd int, path string, mode uint32) (err error) { - wd, err := Getwd() - if err != nil { - return err +//sys openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) = SYS___OPENAT_A + +func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { + if flags&O_ACCMODE == 0 { + flags |= O_RDONLY } + return openat(dirfd, path, flags, mode) +} - if err := Fchdir(dirfd); err != nil { - return err +//sys openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) = SYS___OPENAT2_A + +func Openat2(dirfd int, path string, how *OpenHow) (fd int, err error) { + if how.Flags&O_ACCMODE == 0 { + how.Flags |= O_RDONLY } - defer Chdir(wd) + return openat2(dirfd, path, how, SizeofOpenHow) +} - return Mkfifo(path, mode) +func ZosFdToPath(dirfd int) (path string, err error) { + var buffer [1024]byte + runtime.EnterSyscall() + ret, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_W_IOCTL<<4, uintptr(dirfd), 17, 1024, uintptr(unsafe.Pointer(&buffer[0]))) + runtime.ExitSyscall() + if ret == 0 { + zb := bytes.IndexByte(buffer[:], 0) + if zb == -1 { + zb = len(buffer) + } + CallLeFuncWithErr(GetZosLibVec()+SYS___E2A_L<<4, uintptr(unsafe.Pointer(&buffer[0])), uintptr(zb)) + return string(buffer[:zb]), nil + } + return "", errnoErr2(e1, e2) } //sys remove(path string) (err error) @@ -403,10 +1044,12 @@ func Getcwd(buf []byte) (n int, err error) { } else { p = unsafe.Pointer(&_zero) } - _, _, e := syscall_syscall(SYS___GETCWD_A, uintptr(p), uintptr(len(buf)), 0) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___GETCWD_A<<4, uintptr(p), uintptr(len(buf))) + runtime.ExitSyscall() n = clen(buf) + 1 - if e != 0 { - err = errnoErr(e) + if r0 == 0 { + err = errnoErr2(e1, e2) } return } @@ -520,9 +1163,41 @@ func (w WaitStatus) StopSignal() Signal { func (w WaitStatus) TrapCause() int { return -1 } +//sys waitid(idType int, id int, info *Siginfo, options int) (err error) + +func Waitid(idType int, id int, info *Siginfo, options int, rusage *Rusage) (err error) { + return waitid(idType, id, info, options) +} + //sys waitpid(pid int, wstatus *_C_int, options int) (wpid int, err error) -func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { +func impl_Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_WAIT4<<4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage))) + runtime.ExitSyscall() + wpid = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_Wait4Addr() *(func(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error)) + +var Wait4 = enter_Wait4 + +func enter_Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { + funcref := get_Wait4Addr() + if funcptrtest(GetZosLibVec()+SYS_WAIT4<<4, "") == 0 { + *funcref = impl_Wait4 + } else { + *funcref = legacyWait4 + } + return (*funcref)(pid, wstatus, options, rusage) +} + +func legacyWait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { // TODO(mundaym): z/OS doesn't have wait4. I don't think getrusage does what we want. // At the moment rusage will not be touched. var status _C_int @@ -571,23 +1246,62 @@ func Pipe(p []int) (err error) { } var pp [2]_C_int err = pipe(&pp) - if err == nil { - p[0] = int(pp[0]) - p[1] = int(pp[1]) - } + p[0] = int(pp[0]) + p[1] = int(pp[1]) return } //sys utimes(path string, timeval *[2]Timeval) (err error) = SYS___UTIMES_A func Utimes(path string, tv []Timeval) (err error) { + if tv == nil { + return utimes(path, nil) + } if len(tv) != 2 { return EINVAL } return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } -func UtimesNano(path string, ts []Timespec) error { +//sys utimensat(dirfd int, path string, ts *[2]Timespec, flags int) (err error) = SYS___UTIMENSAT_A + +func validUtimensat() bool { + if funcptrtest(GetZosLibVec()+SYS___UTIMENSAT_A<<4, "") == 0 { + if name, err := getLeFuncName(GetZosLibVec() + SYS___UTIMENSAT_A<<4); err == nil { + return name == "__utimensat_a" + } + } + return false +} + +// Begin UtimesNano + +//go:nosplit +func get_UtimesNanoAddr() *(func(path string, ts []Timespec) (err error)) + +var UtimesNano = enter_UtimesNano + +func enter_UtimesNano(path string, ts []Timespec) (err error) { + funcref := get_UtimesNanoAddr() + if validUtimensat() { + *funcref = utimesNanoImpl + } else { + *funcref = legacyUtimesNano + } + return (*funcref)(path, ts) +} + +func utimesNanoImpl(path string, ts []Timespec) (err error) { + if ts == nil { + return utimensat(AT_FDCWD, path, nil, 0) + } + if len(ts) != 2 { + return EINVAL + } + return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) +} + +func legacyUtimesNano(path string, ts []Timespec) (err error) { if len(ts) != 2 { return EINVAL } @@ -600,6 +1314,70 @@ func UtimesNano(path string, ts []Timespec) error { return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } +// End UtimesNano + +// Begin UtimesNanoAt + +//go:nosplit +func get_UtimesNanoAtAddr() *(func(dirfd int, path string, ts []Timespec, flags int) (err error)) + +var UtimesNanoAt = enter_UtimesNanoAt + +func enter_UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) (err error) { + funcref := get_UtimesNanoAtAddr() + if validUtimensat() { + *funcref = utimesNanoAtImpl + } else { + *funcref = legacyUtimesNanoAt + } + return (*funcref)(dirfd, path, ts, flags) +} + +func utimesNanoAtImpl(dirfd int, path string, ts []Timespec, flags int) (err error) { + if ts == nil { + return utimensat(dirfd, path, nil, flags) + } + if len(ts) != 2 { + return EINVAL + } + return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags) +} + +func legacyUtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) (err error) { + if path[0] != '/' { + dirPath, err := ZosFdToPath(dirfd) + if err != nil { + return err + } + path = dirPath + "/" + path + } + if flags == AT_SYMLINK_NOFOLLOW { + if len(ts) != 2 { + return EINVAL + } + + if ts[0].Nsec >= 5e8 { + ts[0].Sec++ + } + ts[0].Nsec = 0 + if ts[1].Nsec >= 5e8 { + ts[1].Sec++ + } + ts[1].Nsec = 0 + + // Not as efficient as it could be because Timespec and + // Timeval have different types in the different OSes + tv := []Timeval{ + NsecToTimeval(TimespecToNsec(ts[0])), + NsecToTimeval(TimespecToNsec(ts[1])), + } + return Lutimes(path, tv) + } + return UtimesNano(path, ts) +} + +// End UtimesNanoAt + func Getsockname(fd int) (sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny @@ -1186,67 +1964,46 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) return n, nil } -func Opendir(name string) (uintptr, error) { - p, err := BytePtrFromString(name) - if err != nil { - return 0, err - } - dir, _, e := syscall_syscall(SYS___OPENDIR_A, uintptr(unsafe.Pointer(p)), 0, 0) - runtime.KeepAlive(unsafe.Pointer(p)) - if e != 0 { - err = errnoErr(e) - } - return dir, err -} - -// clearsyscall.Errno resets the errno value to 0. -func clearErrno() - -func Readdir(dir uintptr) (*Dirent, error) { - var ent Dirent - var res uintptr - // __readdir_r_a returns errno at the end of the directory stream, rather than 0. - // Therefore to avoid false positives we clear errno before calling it. - - // TODO(neeilan): Commented this out to get sys/unix compiling on z/OS. Uncomment and fix. Error: "undefined: clearsyscall" - //clearsyscall.Errno() // TODO(mundaym): check pre-emption rules. - - e, _, _ := syscall_syscall(SYS___READDIR_R_A, dir, uintptr(unsafe.Pointer(&ent)), uintptr(unsafe.Pointer(&res))) - var err error - if e != 0 { - err = errnoErr(Errno(e)) - } - if res == 0 { - return nil, err - } - return &ent, err -} - -func readdir_r(dirp uintptr, entry *direntLE, result **direntLE) (err error) { - r0, _, e1 := syscall_syscall(SYS___READDIR_R_A, dirp, uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) - if int64(r0) == -1 { - err = errnoErr(Errno(e1)) +func Opendir(name string) (uintptr, error) { + p, err := BytePtrFromString(name) + if err != nil { + return 0, err } - return + err = nil + runtime.EnterSyscall() + dir, e2, e1 := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___OPENDIR_A<<4, uintptr(unsafe.Pointer(p))) + runtime.ExitSyscall() + runtime.KeepAlive(unsafe.Pointer(p)) + if dir == 0 { + err = errnoErr2(e1, e2) + } + return dir, err } +// clearsyscall.Errno resets the errno value to 0. +func clearErrno() + func Closedir(dir uintptr) error { - _, _, e := syscall_syscall(SYS_CLOSEDIR, dir, 0, 0) - if e != 0 { - return errnoErr(e) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_CLOSEDIR<<4, dir) + runtime.ExitSyscall() + if r0 != 0 { + return errnoErr2(e1, e2) } return nil } func Seekdir(dir uintptr, pos int) { - _, _, _ = syscall_syscall(SYS_SEEKDIR, dir, uintptr(pos), 0) + runtime.EnterSyscall() + CallLeFuncWithErr(GetZosLibVec()+SYS_SEEKDIR<<4, dir, uintptr(pos)) + runtime.ExitSyscall() } func Telldir(dir uintptr) (int, error) { - p, _, e := syscall_syscall(SYS_TELLDIR, dir, 0, 0) + p, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_TELLDIR<<4, dir) pos := int(p) - if pos == -1 { - return pos, errnoErr(e) + if int64(p) == -1 { + return pos, errnoErr2(e1, e2) } return pos, nil } @@ -1261,19 +2018,55 @@ func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { *(*int64)(unsafe.Pointer(&flock[4])) = lk.Start *(*int64)(unsafe.Pointer(&flock[12])) = lk.Len *(*int32)(unsafe.Pointer(&flock[20])) = lk.Pid - _, _, errno := syscall_syscall(SYS_FCNTL, fd, uintptr(cmd), uintptr(unsafe.Pointer(&flock))) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCNTL<<4, fd, uintptr(cmd), uintptr(unsafe.Pointer(&flock))) + runtime.ExitSyscall() lk.Type = *(*int16)(unsafe.Pointer(&flock[0])) lk.Whence = *(*int16)(unsafe.Pointer(&flock[2])) lk.Start = *(*int64)(unsafe.Pointer(&flock[4])) lk.Len = *(*int64)(unsafe.Pointer(&flock[12])) lk.Pid = *(*int32)(unsafe.Pointer(&flock[20])) - if errno == 0 { + if r0 == 0 { return nil } - return errno + return errnoErr2(e1, e2) +} + +func impl_Flock(fd int, how int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FLOCK<<4, uintptr(fd), uintptr(how)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_FlockAddr() *(func(fd int, how int) (err error)) + +var Flock = enter_Flock + +func validFlock(fp uintptr) bool { + if funcptrtest(GetZosLibVec()+SYS_FLOCK<<4, "") == 0 { + if name, err := getLeFuncName(GetZosLibVec() + SYS_FLOCK<<4); err == nil { + return name == "flock" + } + } + return false +} + +func enter_Flock(fd int, how int) (err error) { + funcref := get_FlockAddr() + if validFlock(GetZosLibVec() + SYS_FLOCK<<4) { + *funcref = impl_Flock + } else { + *funcref = legacyFlock + } + return (*funcref)(fd, how) } -func Flock(fd int, how int) error { +func legacyFlock(fd int, how int) error { var flock_type int16 var fcntl_cmd int @@ -1307,41 +2100,51 @@ func Flock(fd int, how int) error { } func Mlock(b []byte) (err error) { - _, _, e1 := syscall_syscall(SYS___MLOCKALL, _BPX_NONSWAP, 0, 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MLOCKALL<<4, _BPX_NONSWAP) + runtime.ExitSyscall() + if r0 != 0 { + err = errnoErr2(e1, e2) } return } func Mlock2(b []byte, flags int) (err error) { - _, _, e1 := syscall_syscall(SYS___MLOCKALL, _BPX_NONSWAP, 0, 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MLOCKALL<<4, _BPX_NONSWAP) + runtime.ExitSyscall() + if r0 != 0 { + err = errnoErr2(e1, e2) } return } func Mlockall(flags int) (err error) { - _, _, e1 := syscall_syscall(SYS___MLOCKALL, _BPX_NONSWAP, 0, 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MLOCKALL<<4, _BPX_NONSWAP) + runtime.ExitSyscall() + if r0 != 0 { + err = errnoErr2(e1, e2) } return } func Munlock(b []byte) (err error) { - _, _, e1 := syscall_syscall(SYS___MLOCKALL, _BPX_SWAP, 0, 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MLOCKALL<<4, _BPX_SWAP) + runtime.ExitSyscall() + if r0 != 0 { + err = errnoErr2(e1, e2) } return } func Munlockall() (err error) { - _, _, e1 := syscall_syscall(SYS___MLOCKALL, _BPX_SWAP, 0, 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MLOCKALL<<4, _BPX_SWAP) + runtime.ExitSyscall() + if r0 != 0 { + err = errnoErr2(e1, e2) } return } @@ -1372,15 +2175,104 @@ func ClockGettime(clockid int32, ts *Timespec) error { return nil } -func Statfs(path string, stat *Statfs_t) (err error) { - fd, err := open(path, O_RDONLY, 0) - defer Close(fd) - if err != nil { - return err +// Chtag + +//go:nosplit +func get_ChtagAddr() *(func(path string, ccsid uint64, textbit uint64) error) + +var Chtag = enter_Chtag + +func enter_Chtag(path string, ccsid uint64, textbit uint64) error { + funcref := get_ChtagAddr() + if validSetxattr() { + *funcref = impl_Chtag + } else { + *funcref = legacy_Chtag + } + return (*funcref)(path, ccsid, textbit) +} + +func legacy_Chtag(path string, ccsid uint64, textbit uint64) error { + tag := ccsid<<16 | textbit<<15 + var tag_buff [8]byte + DecodeData(tag_buff[:], 8, tag) + return Setxattr(path, "filetag", tag_buff[:], XATTR_REPLACE) +} + +func impl_Chtag(path string, ccsid uint64, textbit uint64) error { + tag := ccsid<<16 | textbit<<15 + var tag_buff [4]byte + DecodeData(tag_buff[:], 4, tag) + return Setxattr(path, "system.filetag", tag_buff[:], XATTR_REPLACE) +} + +// End of Chtag + +// Nanosleep + +//go:nosplit +func get_NanosleepAddr() *(func(time *Timespec, leftover *Timespec) error) + +var Nanosleep = enter_Nanosleep + +func enter_Nanosleep(time *Timespec, leftover *Timespec) error { + funcref := get_NanosleepAddr() + if funcptrtest(GetZosLibVec()+SYS_NANOSLEEP<<4, "") == 0 { + *funcref = impl_Nanosleep + } else { + *funcref = legacyNanosleep + } + return (*funcref)(time, leftover) +} + +func impl_Nanosleep(time *Timespec, leftover *Timespec) error { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_NANOSLEEP<<4, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover))) + runtime.ExitSyscall() + if int64(r0) == -1 { + return errnoErr2(e1, e2) + } + return nil +} + +func legacyNanosleep(time *Timespec, leftover *Timespec) error { + t0 := runtime.Nanotime1() + var secrem uint32 + var nsecrem uint32 + total := time.Sec*1000000000 + time.Nsec + elapsed := runtime.Nanotime1() - t0 + var rv int32 + var rc int32 + var err error + // repeatedly sleep for 1 second until less than 1 second left + for total-elapsed > 1000000000 { + rv, rc, _ = BpxCondTimedWait(uint32(1), uint32(0), uint32(CW_CONDVAR), &secrem, &nsecrem) + if rv != 0 && rc != 112 { // 112 is EAGAIN + if leftover != nil && rc == 120 { // 120 is EINTR + leftover.Sec = int64(secrem) + leftover.Nsec = int64(nsecrem) + } + err = Errno(rc) + return err + } + elapsed = runtime.Nanotime1() - t0 } - return Fstatfs(fd, stat) + // sleep the remainder + if total > elapsed { + rv, rc, _ = BpxCondTimedWait(uint32(0), uint32(total-elapsed), uint32(CW_CONDVAR), &secrem, &nsecrem) + } + if leftover != nil && rc == 120 { + leftover.Sec = int64(secrem) + leftover.Nsec = int64(nsecrem) + } + if rv != 0 && rc != 112 { + err = Errno(rc) + } + return err } +// End of Nanosleep + var ( Stdin = 0 Stdout = 1 @@ -1395,6 +2287,9 @@ var ( errENOENT error = syscall.ENOENT ) +var ZosTraceLevel int +var ZosTracefile *os.File + var ( signalNameMapOnce sync.Once signalNameMap map[string]syscall.Signal @@ -1416,6 +2311,56 @@ func errnoErr(e Errno) error { return e } +var reg *regexp.Regexp + +// enhanced with zos specific errno2 +func errnoErr2(e Errno, e2 uintptr) error { + switch e { + case 0: + return nil + case EAGAIN: + return errEAGAIN + /* + Allow the retrieval of errno2 for EINVAL and ENOENT on zos + case EINVAL: + return errEINVAL + case ENOENT: + return errENOENT + */ + } + if ZosTraceLevel > 0 { + var name string + if reg == nil { + reg = regexp.MustCompile("(^unix\\.[^/]+$|.*\\/unix\\.[^/]+$)") + } + i := 1 + pc, file, line, ok := runtime.Caller(i) + if ok { + name = runtime.FuncForPC(pc).Name() + } + for ok && reg.MatchString(runtime.FuncForPC(pc).Name()) { + i += 1 + pc, file, line, ok = runtime.Caller(i) + } + if ok { + if ZosTracefile == nil { + ZosConsolePrintf("From %s:%d\n", file, line) + ZosConsolePrintf("%s: %s (errno2=0x%x)\n", name, e.Error(), e2) + } else { + fmt.Fprintf(ZosTracefile, "From %s:%d\n", file, line) + fmt.Fprintf(ZosTracefile, "%s: %s (errno2=0x%x)\n", name, e.Error(), e2) + } + } else { + if ZosTracefile == nil { + ZosConsolePrintf("%s (errno2=0x%x)\n", e.Error(), e2) + } else { + fmt.Fprintf(ZosTracefile, "%s (errno2=0x%x)\n", e.Error(), e2) + } + } + } + return e +} + // ErrnoName returns the error name for error number e. func ErrnoName(e Errno) string { i := sort.Search(len(errorList), func(i int) bool { @@ -1474,6 +2419,9 @@ func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (d return nil, EINVAL } + // Set __MAP_64 by default + flags |= __MAP_64 + // Map the requested memory. addr, errno := m.mmap(0, uintptr(length), prot, flags, fd, offset) if errno != nil { @@ -1778,83 +2726,170 @@ func Exec(argv0 string, argv []string, envv []string) error { return syscall.Exec(argv0, argv, envv) } -func Mount(source string, target string, fstype string, flags uintptr, data string) (err error) { +func Getag(path string) (ccsid uint16, flag uint16, err error) { + var val [8]byte + sz, err := Getxattr(path, "ccsid", val[:]) + if err != nil { + return + } + ccsid = uint16(EncodeData(val[0:sz])) + sz, err = Getxattr(path, "flags", val[:]) + if err != nil { + return + } + flag = uint16(EncodeData(val[0:sz]) >> 15) + return +} + +// Mount begin +func impl_Mount(source string, target string, fstype string, flags uintptr, data string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(source) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(target) + if err != nil { + return + } + var _p2 *byte + _p2, err = BytePtrFromString(fstype) + if err != nil { + return + } + var _p3 *byte + _p3, err = BytePtrFromString(data) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MOUNT1_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(_p3))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_MountAddr() *(func(source string, target string, fstype string, flags uintptr, data string) (err error)) + +var Mount = enter_Mount + +func enter_Mount(source string, target string, fstype string, flags uintptr, data string) (err error) { + funcref := get_MountAddr() + if validMount() { + *funcref = impl_Mount + } else { + *funcref = legacyMount + } + return (*funcref)(source, target, fstype, flags, data) +} + +func legacyMount(source string, target string, fstype string, flags uintptr, data string) (err error) { if needspace := 8 - len(fstype); needspace <= 0 { - fstype = fstype[:8] + fstype = fstype[0:8] } else { - fstype += " "[:needspace] + fstype += " "[0:needspace] } return mount_LE(target, source, fstype, uint32(flags), int32(len(data)), data) } -func Unmount(name string, mtm int) (err error) { +func validMount() bool { + if funcptrtest(GetZosLibVec()+SYS___MOUNT1_A<<4, "") == 0 { + if name, err := getLeFuncName(GetZosLibVec() + SYS___MOUNT1_A<<4); err == nil { + return name == "__mount1_a" + } + } + return false +} + +// Mount end + +// Unmount begin +func impl_Unmount(target string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(target) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UMOUNT2_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_UnmountAddr() *(func(target string, flags int) (err error)) + +var Unmount = enter_Unmount + +func enter_Unmount(target string, flags int) (err error) { + funcref := get_UnmountAddr() + if funcptrtest(GetZosLibVec()+SYS___UMOUNT2_A<<4, "") == 0 { + *funcref = impl_Unmount + } else { + *funcref = legacyUnmount + } + return (*funcref)(target, flags) +} + +func legacyUnmount(name string, mtm int) (err error) { // mountpoint is always a full path and starts with a '/' // check if input string is not a mountpoint but a filesystem name if name[0] != '/' { - return unmount(name, mtm) + return unmount_LE(name, mtm) } // treat name as mountpoint b2s := func(arr []byte) string { - nulli := bytes.IndexByte(arr, 0) - if nulli == -1 { - return string(arr) - } else { - return string(arr[:nulli]) + var str string + for i := 0; i < len(arr); i++ { + if arr[i] == 0 { + str = string(arr[:i]) + break + } } + return str } var buffer struct { header W_Mnth fsinfo [64]W_Mntent } - fsCount, err := W_Getmntent_A((*byte)(unsafe.Pointer(&buffer)), int(unsafe.Sizeof(buffer))) - if err != nil { - return err - } - if fsCount == 0 { - return EINVAL - } - for i := 0; i < fsCount; i++ { - if b2s(buffer.fsinfo[i].Mountpoint[:]) == name { - err = unmount(b2s(buffer.fsinfo[i].Fsname[:]), mtm) - break + fs_count, err := W_Getmntent_A((*byte)(unsafe.Pointer(&buffer)), int(unsafe.Sizeof(buffer))) + if err == nil { + err = EINVAL + for i := 0; i < fs_count; i++ { + if b2s(buffer.fsinfo[i].Mountpoint[:]) == name { + err = unmount_LE(b2s(buffer.fsinfo[i].Fsname[:]), mtm) + break + } } + } else if fs_count == 0 { + err = EINVAL } return err } -func fdToPath(dirfd int) (path string, err error) { - var buffer [1024]byte - // w_ctrl() - ret := runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS_W_IOCTL<<4, - []uintptr{uintptr(dirfd), 17, 1024, uintptr(unsafe.Pointer(&buffer[0]))}) - if ret == 0 { - zb := bytes.IndexByte(buffer[:], 0) - if zb == -1 { - zb = len(buffer) - } - // __e2a_l() - runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___E2A_L<<4, - []uintptr{uintptr(unsafe.Pointer(&buffer[0])), uintptr(zb)}) - return string(buffer[:zb]), nil - } - // __errno() - errno := int(*(*int32)(unsafe.Pointer(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO<<4, - []uintptr{})))) - // __errno2() - errno2 := int(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO2<<4, - []uintptr{})) - // strerror_r() - ret = runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS_STRERROR_R<<4, - []uintptr{uintptr(errno), uintptr(unsafe.Pointer(&buffer[0])), 1024}) - if ret == 0 { - zb := bytes.IndexByte(buffer[:], 0) - if zb == -1 { - zb = len(buffer) - } - return "", fmt.Errorf("%s (errno2=0x%x)", buffer[:zb], errno2) - } else { - return "", fmt.Errorf("fdToPath errno %d (errno2=0x%x)", errno, errno2) +// Unmount end + +func direntIno(buf []byte) (uint64, bool) { + return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) +} + +func direntReclen(buf []byte) (uint64, bool) { + return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) +} + +func direntNamlen(buf []byte) (uint64, bool) { + reclen, ok := direntReclen(buf) + if !ok { + return 0, false } + return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true } func direntLeToDirentUnix(dirent *direntLE, dir uintptr, path string) (Dirent, error) { @@ -1896,7 +2931,7 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { } // Get path from fd to avoid unavailable call (fdopendir) - path, err := fdToPath(fd) + path, err := ZosFdToPath(fd) if err != nil { return 0, err } @@ -1910,7 +2945,7 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { for { var entryLE direntLE var entrypLE *direntLE - e := readdir_r(d, &entryLE, &entrypLE) + e := Readdir_r(d, &entryLE, &entrypLE) if e != nil { return n, e } @@ -1956,23 +2991,127 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { return n, nil } -func ReadDirent(fd int, buf []byte) (n int, err error) { - var base = (*uintptr)(unsafe.Pointer(new(uint64))) - return Getdirentries(fd, buf, base) +func Err2ad() (eadd *int) { + r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS___ERR2AD<<4) + eadd = (*int)(unsafe.Pointer(r0)) + return } -func direntIno(buf []byte) (uint64, bool) { - return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) +func ZosConsolePrintf(format string, v ...interface{}) (int, error) { + type __cmsg struct { + _ uint16 + _ [2]uint8 + __msg_length uint32 + __msg uintptr + _ [4]uint8 + } + msg := fmt.Sprintf(format, v...) + strptr := unsafe.Pointer((*reflect.StringHeader)(unsafe.Pointer(&msg)).Data) + len := (*reflect.StringHeader)(unsafe.Pointer(&msg)).Len + cmsg := __cmsg{__msg_length: uint32(len), __msg: uintptr(strptr)} + cmd := uint32(0) + runtime.EnterSyscall() + rc, err2, err1 := CallLeFuncWithErr(GetZosLibVec()+SYS_____CONSOLE_A<<4, uintptr(unsafe.Pointer(&cmsg)), 0, uintptr(unsafe.Pointer(&cmd))) + runtime.ExitSyscall() + if rc != 0 { + return 0, fmt.Errorf("%s (errno2=0x%x)\n", err1.Error(), err2) + } + return 0, nil +} +func ZosStringToEbcdicBytes(str string, nullterm bool) (ebcdicBytes []byte) { + if nullterm { + ebcdicBytes = []byte(str + "\x00") + } else { + ebcdicBytes = []byte(str) + } + A2e(ebcdicBytes) + return +} +func ZosEbcdicBytesToString(b []byte, trimRight bool) (str string) { + res := make([]byte, len(b)) + copy(res, b) + E2a(res) + if trimRight { + str = string(bytes.TrimRight(res, " \x00")) + } else { + str = string(res) + } + return } -func direntReclen(buf []byte) (uint64, bool) { - return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) +func fdToPath(dirfd int) (path string, err error) { + var buffer [1024]byte + // w_ctrl() + ret := runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS_W_IOCTL<<4, + []uintptr{uintptr(dirfd), 17, 1024, uintptr(unsafe.Pointer(&buffer[0]))}) + if ret == 0 { + zb := bytes.IndexByte(buffer[:], 0) + if zb == -1 { + zb = len(buffer) + } + // __e2a_l() + runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___E2A_L<<4, + []uintptr{uintptr(unsafe.Pointer(&buffer[0])), uintptr(zb)}) + return string(buffer[:zb]), nil + } + // __errno() + errno := int(*(*int32)(unsafe.Pointer(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO<<4, + []uintptr{})))) + // __errno2() + errno2 := int(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO2<<4, + []uintptr{})) + // strerror_r() + ret = runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS_STRERROR_R<<4, + []uintptr{uintptr(errno), uintptr(unsafe.Pointer(&buffer[0])), 1024}) + if ret == 0 { + zb := bytes.IndexByte(buffer[:], 0) + if zb == -1 { + zb = len(buffer) + } + return "", fmt.Errorf("%s (errno2=0x%x)", buffer[:zb], errno2) + } else { + return "", fmt.Errorf("fdToPath errno %d (errno2=0x%x)", errno, errno2) + } } -func direntNamlen(buf []byte) (uint64, bool) { - reclen, ok := direntReclen(buf) - if !ok { - return 0, false +func impl_Mkfifoat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return } - return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKFIFOAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_MkfifoatAddr() *(func(dirfd int, path string, mode uint32) (err error)) + +var Mkfifoat = enter_Mkfifoat + +func enter_Mkfifoat(dirfd int, path string, mode uint32) (err error) { + funcref := get_MkfifoatAddr() + if funcptrtest(GetZosLibVec()+SYS___MKFIFOAT_A<<4, "") == 0 { + *funcref = impl_Mkfifoat + } else { + *funcref = legacy_Mkfifoat + } + return (*funcref)(dirfd, path, mode) +} + +func legacy_Mkfifoat(dirfd int, path string, mode uint32) (err error) { + dirname, err := ZosFdToPath(dirfd) + if err != nil { + return err + } + return Mkfifo(dirname+"/"+path, mode) } + +//sys Posix_openpt(oflag int) (fd int, err error) = SYS_POSIX_OPENPT +//sys Grantpt(fildes int) (rc int, err error) = SYS_GRANTPT +//sys Unlockpt(fildes int) (rc int, err error) = SYS_UNLOCKPT diff --git a/vendor/golang.org/x/sys/unix/sysvshm_unix.go b/vendor/golang.org/x/sys/unix/sysvshm_unix.go index 79a84f18b4..672d6b0a88 100644 --- a/vendor/golang.org/x/sys/unix/sysvshm_unix.go +++ b/vendor/golang.org/x/sys/unix/sysvshm_unix.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (darwin && !ios) || linux +//go:build (darwin && !ios) || linux || zos package unix diff --git a/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go b/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go index 9eb0db664c..8b7977a28c 100644 --- a/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go +++ b/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build darwin && !ios +//go:build (darwin && !ios) || zos package unix diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go index e40fa85245..4308ac1772 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go @@ -1169,6 +1169,11 @@ const ( PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 PT_WRITE_U = 0x6 + RENAME_EXCL = 0x4 + RENAME_NOFOLLOW_ANY = 0x10 + RENAME_RESERVED1 = 0x8 + RENAME_SECLUDE = 0x1 + RENAME_SWAP = 0x2 RLIMIT_AS = 0x5 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go index bb02aa6c05..c8068a7a16 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go @@ -1169,6 +1169,11 @@ const ( PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 PT_WRITE_U = 0x6 + RENAME_EXCL = 0x4 + RENAME_NOFOLLOW_ANY = 0x10 + RENAME_RESERVED1 = 0x8 + RENAME_SECLUDE = 0x1 + RENAME_SWAP = 0x2 RLIMIT_AS = 0x5 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 36bf8399f4..01a70b2463 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -457,6 +457,7 @@ const ( B600 = 0x8 B75 = 0x2 B9600 = 0xd + BCACHEFS_SUPER_MAGIC = 0xca451a4e BDEVFS_MAGIC = 0x62646576 BINDERFS_SUPER_MAGIC = 0x6c6f6f70 BINFMTFS_MAGIC = 0x42494e4d @@ -491,6 +492,7 @@ const ( BPF_F_REPLACE = 0x4 BPF_F_SLEEPABLE = 0x10 BPF_F_STRICT_ALIGNMENT = 0x1 + BPF_F_TEST_REG_INVARIANTS = 0x80 BPF_F_TEST_RND_HI32 = 0x4 BPF_F_TEST_RUN_ON_CPU = 0x1 BPF_F_TEST_STATE_FREQ = 0x8 @@ -501,6 +503,7 @@ const ( BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 + BPF_JCOND = 0xe0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 @@ -656,6 +659,9 @@ const ( CAN_NPROTO = 0x8 CAN_RAW = 0x1 CAN_RAW_FILTER_MAX = 0x200 + CAN_RAW_XL_VCID_RX_FILTER = 0x4 + CAN_RAW_XL_VCID_TX_PASS = 0x2 + CAN_RAW_XL_VCID_TX_SET = 0x1 CAN_RTR_FLAG = 0x40000000 CAN_SFF_ID_BITS = 0xb CAN_SFF_MASK = 0x7ff @@ -923,6 +929,7 @@ const ( EPOLL_CTL_ADD = 0x1 EPOLL_CTL_DEL = 0x2 EPOLL_CTL_MOD = 0x3 + EPOLL_IOC_TYPE = 0x8a EROFS_SUPER_MAGIC_V1 = 0xe0f5e1e2 ESP_V4_FLOW = 0xa ESP_V6_FLOW = 0xc @@ -936,9 +943,6 @@ const ( ETHTOOL_FEC_OFF = 0x4 ETHTOOL_FEC_RS = 0x8 ETHTOOL_FLAG_ALL = 0x7 - ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 - ETHTOOL_FLAG_OMIT_REPLY = 0x2 - ETHTOOL_FLAG_STATS = 0x4 ETHTOOL_FLASHDEV = 0x33 ETHTOOL_FLASH_MAX_FILENAME = 0x80 ETHTOOL_FWVERS_LEN = 0x20 @@ -1338,6 +1342,7 @@ const ( F_OFD_SETLK = 0x25 F_OFD_SETLKW = 0x26 F_OK = 0x0 + F_SEAL_EXEC = 0x20 F_SEAL_FUTURE_WRITE = 0x10 F_SEAL_GROW = 0x4 F_SEAL_SEAL = 0x1 @@ -1626,6 +1631,7 @@ const ( IP_FREEBIND = 0xf IP_HDRINCL = 0x3 IP_IPSEC_POLICY = 0x10 + IP_LOCAL_PORT_RANGE = 0x33 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0x14 IP_MF = 0x2000 @@ -1652,6 +1658,7 @@ const ( IP_PMTUDISC_OMIT = 0x5 IP_PMTUDISC_PROBE = 0x3 IP_PMTUDISC_WANT = 0x1 + IP_PROTOCOL = 0x34 IP_RECVERR = 0xb IP_RECVERR_RFC4884 = 0x1a IP_RECVFRAGSIZE = 0x19 @@ -1697,6 +1704,8 @@ const ( KEXEC_ARCH_S390 = 0x160000 KEXEC_ARCH_SH = 0x2a0000 KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_CRASH_HOTPLUG_SUPPORT = 0x8 + KEXEC_FILE_DEBUG = 0x8 KEXEC_FILE_NO_INITRAMFS = 0x4 KEXEC_FILE_ON_CRASH = 0x2 KEXEC_FILE_UNLOAD = 0x1 @@ -1771,6 +1780,7 @@ const ( KEY_SPEC_USER_KEYRING = -0x4 KEY_SPEC_USER_SESSION_KEYRING = -0x5 LANDLOCK_ACCESS_FS_EXECUTE = 0x1 + LANDLOCK_ACCESS_FS_IOCTL_DEV = 0x8000 LANDLOCK_ACCESS_FS_MAKE_BLOCK = 0x800 LANDLOCK_ACCESS_FS_MAKE_CHAR = 0x40 LANDLOCK_ACCESS_FS_MAKE_DIR = 0x80 @@ -1852,6 +1862,19 @@ const ( MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_FIXED_NOREPLACE = 0x100000 + MAP_HUGE_16GB = 0x88000000 + MAP_HUGE_16KB = 0x38000000 + MAP_HUGE_16MB = 0x60000000 + MAP_HUGE_1GB = 0x78000000 + MAP_HUGE_1MB = 0x50000000 + MAP_HUGE_256MB = 0x70000000 + MAP_HUGE_2GB = 0x7c000000 + MAP_HUGE_2MB = 0x54000000 + MAP_HUGE_32MB = 0x64000000 + MAP_HUGE_512KB = 0x4c000000 + MAP_HUGE_512MB = 0x74000000 + MAP_HUGE_64KB = 0x40000000 + MAP_HUGE_8MB = 0x5c000000 MAP_HUGE_MASK = 0x3f MAP_HUGE_SHIFT = 0x1a MAP_PRIVATE = 0x2 @@ -1898,6 +1921,7 @@ const ( MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 + MNT_ID_REQ_SIZE_VER0 = 0x18 MODULE_INIT_COMPRESSED_FILE = 0x4 MODULE_INIT_IGNORE_MODVERSIONS = 0x1 MODULE_INIT_IGNORE_VERMAGIC = 0x2 @@ -2166,7 +2190,7 @@ const ( NFT_SECMARK_CTX_MAXLEN = 0x100 NFT_SET_MAXNAMELEN = 0x100 NFT_SOCKET_MAX = 0x3 - NFT_TABLE_F_MASK = 0x3 + NFT_TABLE_F_MASK = 0x7 NFT_TABLE_MAXNAMELEN = 0x100 NFT_TRACETYPE_MAX = 0x3 NFT_TUNNEL_F_MASK = 0x7 @@ -2302,6 +2326,7 @@ const ( PERF_AUX_FLAG_PARTIAL = 0x4 PERF_AUX_FLAG_PMU_FORMAT_TYPE_MASK = 0xff00 PERF_AUX_FLAG_TRUNCATED = 0x1 + PERF_BRANCH_ENTRY_INFO_BITS_MAX = 0x21 PERF_BR_ARM64_DEBUG_DATA = 0x7 PERF_BR_ARM64_DEBUG_EXIT = 0x5 PERF_BR_ARM64_DEBUG_HALT = 0x4 @@ -2399,6 +2424,7 @@ const ( PERF_RECORD_MISC_USER = 0x2 PERF_SAMPLE_BRANCH_PLM_ALL = 0x7 PERF_SAMPLE_WEIGHT_TYPE = 0x1004000 + PID_FS_MAGIC = 0x50494446 PIPEFS_MAGIC = 0x50495045 PPPIOCGNPMODE = 0xc008744c PPPIOCNEWUNIT = 0xc004743e @@ -2486,6 +2512,23 @@ const ( PR_PAC_GET_ENABLED_KEYS = 0x3d PR_PAC_RESET_KEYS = 0x36 PR_PAC_SET_ENABLED_KEYS = 0x3c + PR_PPC_DEXCR_CTRL_CLEAR = 0x4 + PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC = 0x10 + PR_PPC_DEXCR_CTRL_EDITABLE = 0x1 + PR_PPC_DEXCR_CTRL_MASK = 0x1f + PR_PPC_DEXCR_CTRL_SET = 0x2 + PR_PPC_DEXCR_CTRL_SET_ONEXEC = 0x8 + PR_PPC_DEXCR_IBRTPD = 0x1 + PR_PPC_DEXCR_NPHIE = 0x3 + PR_PPC_DEXCR_SBHE = 0x0 + PR_PPC_DEXCR_SRAPD = 0x2 + PR_PPC_GET_DEXCR = 0x48 + PR_PPC_SET_DEXCR = 0x49 + PR_RISCV_CTX_SW_FENCEI_OFF = 0x1 + PR_RISCV_CTX_SW_FENCEI_ON = 0x0 + PR_RISCV_SCOPE_PER_PROCESS = 0x0 + PR_RISCV_SCOPE_PER_THREAD = 0x1 + PR_RISCV_SET_ICACHE_FLUSH_CTX = 0x47 PR_RISCV_V_GET_CONTROL = 0x46 PR_RISCV_V_SET_CONTROL = 0x45 PR_RISCV_V_VSTATE_CTRL_CUR_MASK = 0x3 @@ -2892,8 +2935,9 @@ const ( RWF_APPEND = 0x10 RWF_DSYNC = 0x2 RWF_HIPRI = 0x1 + RWF_NOAPPEND = 0x20 RWF_NOWAIT = 0x8 - RWF_SUPPORTED = 0x1f + RWF_SUPPORTED = 0x3f RWF_SYNC = 0x4 RWF_WRITE_LIFE_NOT_SET = 0x0 SCHED_BATCH = 0x3 @@ -2914,7 +2958,9 @@ const ( SCHED_RESET_ON_FORK = 0x40000000 SCHED_RR = 0x2 SCM_CREDENTIALS = 0x2 + SCM_PIDFD = 0x4 SCM_RIGHTS = 0x1 + SCM_SECURITY = 0x3 SCM_TIMESTAMP = 0x1d SC_LOG_FLUSH = 0x100000 SECCOMP_ADDFD_FLAG_SEND = 0x2 @@ -3047,6 +3093,8 @@ const ( SIOCSMIIREG = 0x8949 SIOCSRARP = 0x8962 SIOCWANDEV = 0x894a + SK_DIAG_BPF_STORAGE_MAX = 0x3 + SK_DIAG_BPF_STORAGE_REQ_MAX = 0x1 SMACK_MAGIC = 0x43415d53 SMART_AUTOSAVE = 0xd2 SMART_AUTO_OFFLINE = 0xdb @@ -3067,6 +3115,8 @@ const ( SOCKFS_MAGIC = 0x534f434b SOCK_BUF_LOCK_MASK = 0x3 SOCK_DCCP = 0x6 + SOCK_DESTROY = 0x15 + SOCK_DIAG_BY_FAMILY = 0x14 SOCK_IOC_TYPE = 0x89 SOCK_PACKET = 0xa SOCK_RAW = 0x3 @@ -3168,10 +3218,12 @@ const ( STATX_GID = 0x10 STATX_INO = 0x100 STATX_MNT_ID = 0x1000 + STATX_MNT_ID_UNIQUE = 0x4000 STATX_MODE = 0x2 STATX_MTIME = 0x40 STATX_NLINK = 0x4 STATX_SIZE = 0x200 + STATX_SUBVOL = 0x8000 STATX_TYPE = 0x1 STATX_UID = 0x8 STATX__RESERVED = 0x80000000 @@ -3255,6 +3307,7 @@ const ( TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0xe TCP_MD5SIG_EXT = 0x20 + TCP_MD5SIG_FLAG_IFINDEX = 0x2 TCP_MD5SIG_FLAG_PREFIX = 0x1 TCP_MD5SIG_MAXKEYLEN = 0x50 TCP_MSS = 0x200 @@ -3562,12 +3615,16 @@ const ( XDP_RX_RING = 0x2 XDP_SHARED_UMEM = 0x1 XDP_STATISTICS = 0x7 + XDP_TXMD_FLAGS_CHECKSUM = 0x2 + XDP_TXMD_FLAGS_TIMESTAMP = 0x1 + XDP_TX_METADATA = 0x2 XDP_TX_RING = 0x3 XDP_UMEM_COMPLETION_RING = 0x6 XDP_UMEM_FILL_RING = 0x5 XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 XDP_UMEM_PGOFF_FILL_RING = 0x100000000 XDP_UMEM_REG = 0x4 + XDP_UMEM_TX_SW_CSUM = 0x2 XDP_UMEM_UNALIGNED_CHUNK_FLAG = 0x1 XDP_USE_NEED_WAKEUP = 0x8 XDP_USE_SG = 0x10 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 42ff8c3c1b..684a5168da 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -118,6 +120,7 @@ const ( IXOFF = 0x1000 IXON = 0x400 MAP_32BIT = 0x40 + MAP_ABOVE4G = 0x80 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 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 dca436004f..61d74b592d 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 @@ -118,6 +120,7 @@ const ( IXOFF = 0x1000 IXON = 0x400 MAP_32BIT = 0x40 + MAP_ABOVE4G = 0x80 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 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 5cca668ac3..a28c9e3e89 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 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 d8cae6d153..ab5d1fe8ea 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 ESR_MAGIC = 0x45535201 EXTPROC = 0x10000 @@ -87,6 +89,7 @@ const ( FICLONE = 0x40049409 FICLONERANGE = 0x4020940d FLUSHO = 0x1000 + FPMR_MAGIC = 0x46504d52 FPSIMD_MAGIC = 0x46508001 FS_IOC_ENABLE_VERITY = 0x40806685 FS_IOC_GETFLAGS = 0x80086601 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 28e39afdcb..c523090e7c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 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 cd66e92cb4..01e6ea7804 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 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 c1595eba78..7aa610b1e7 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 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 ee9456b0da..92af771b44 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 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 8cfca81e1b..b27ef5e6f1 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index 60b0deb3af..237a2cefb3 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 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 f90aa7281b..4a5c555a36 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 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 ba9e015033..a02fb49a5f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 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 07cdfd6e9f..e26a7c61b2 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 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 2f1dd214a7..c48f7c2103 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 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 f40519d901..ad4b9aace7 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -82,6 +82,8 @@ const ( EFD_CLOEXEC = 0x400000 EFD_NONBLOCK = 0x4000 EMT_TAGOVF = 0x1 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x400000 EXTPROC = 0x10000 FF1 = 0x8000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go index 4dfd2e051d..da08b2ab3d 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go @@ -10,41 +10,99 @@ package unix const ( - BRKINT = 0x0001 - CLOCK_MONOTONIC = 0x1 - CLOCK_PROCESS_CPUTIME_ID = 0x2 - CLOCK_REALTIME = 0x0 - CLOCK_THREAD_CPUTIME_ID = 0x3 - CS8 = 0x0030 - CSIZE = 0x0030 - ECHO = 0x00000008 - ECHONL = 0x00000001 - FD_CLOEXEC = 0x01 - FD_CLOFORK = 0x02 - FNDELAY = 0x04 - F_CLOSFD = 9 - F_CONTROL_CVT = 13 - F_DUPFD = 0 - F_DUPFD2 = 8 - F_GETFD = 1 - F_GETFL = 259 - F_GETLK = 5 - F_GETOWN = 10 - F_OK = 0x0 - F_RDLCK = 1 - F_SETFD = 2 - F_SETFL = 4 - F_SETLK = 6 - F_SETLKW = 7 - F_SETOWN = 11 - F_SETTAG = 12 - F_UNLCK = 3 - F_WRLCK = 2 - FSTYPE_ZFS = 0xe9 //"Z" - FSTYPE_HFS = 0xc8 //"H" - FSTYPE_NFS = 0xd5 //"N" - FSTYPE_TFS = 0xe3 //"T" - FSTYPE_AUTOMOUNT = 0xc1 //"A" + BRKINT = 0x0001 + CLOCAL = 0x1 + CLOCK_MONOTONIC = 0x1 + CLOCK_PROCESS_CPUTIME_ID = 0x2 + CLOCK_REALTIME = 0x0 + CLOCK_THREAD_CPUTIME_ID = 0x3 + CLONE_NEWIPC = 0x08000000 + CLONE_NEWNET = 0x40000000 + CLONE_NEWNS = 0x00020000 + CLONE_NEWPID = 0x20000000 + CLONE_NEWUTS = 0x04000000 + CLONE_PARENT = 0x00008000 + CS8 = 0x0030 + CSIZE = 0x0030 + ECHO = 0x00000008 + ECHONL = 0x00000001 + EFD_SEMAPHORE = 0x00002000 + EFD_CLOEXEC = 0x00001000 + EFD_NONBLOCK = 0x00000004 + EPOLL_CLOEXEC = 0x00001000 + EPOLL_CTL_ADD = 0 + EPOLL_CTL_MOD = 1 + EPOLL_CTL_DEL = 2 + EPOLLRDNORM = 0x0001 + EPOLLRDBAND = 0x0002 + EPOLLIN = 0x0003 + EPOLLOUT = 0x0004 + EPOLLWRBAND = 0x0008 + EPOLLPRI = 0x0010 + EPOLLERR = 0x0020 + EPOLLHUP = 0x0040 + EPOLLEXCLUSIVE = 0x20000000 + EPOLLONESHOT = 0x40000000 + FD_CLOEXEC = 0x01 + FD_CLOFORK = 0x02 + FD_SETSIZE = 0x800 + FNDELAY = 0x04 + F_CLOSFD = 9 + F_CONTROL_CVT = 13 + F_DUPFD = 0 + F_DUPFD2 = 8 + F_GETFD = 1 + F_GETFL = 259 + F_GETLK = 5 + F_GETOWN = 10 + F_OK = 0x0 + F_RDLCK = 1 + F_SETFD = 2 + F_SETFL = 4 + F_SETLK = 6 + F_SETLKW = 7 + F_SETOWN = 11 + F_SETTAG = 12 + F_UNLCK = 3 + F_WRLCK = 2 + FSTYPE_ZFS = 0xe9 //"Z" + FSTYPE_HFS = 0xc8 //"H" + FSTYPE_NFS = 0xd5 //"N" + FSTYPE_TFS = 0xe3 //"T" + FSTYPE_AUTOMOUNT = 0xc1 //"A" + GRND_NONBLOCK = 1 + GRND_RANDOM = 2 + HUPCL = 0x0100 // Hang up on last close + IN_CLOEXEC = 0x00001000 + IN_NONBLOCK = 0x00000004 + IN_ACCESS = 0x00000001 + IN_MODIFY = 0x00000002 + IN_ATTRIB = 0x00000004 + IN_CLOSE_WRITE = 0x00000008 + IN_CLOSE_NOWRITE = 0x00000010 + IN_OPEN = 0x00000020 + IN_MOVED_FROM = 0x00000040 + IN_MOVED_TO = 0x00000080 + IN_CREATE = 0x00000100 + IN_DELETE = 0x00000200 + IN_DELETE_SELF = 0x00000400 + IN_MOVE_SELF = 0x00000800 + IN_UNMOUNT = 0x00002000 + IN_Q_OVERFLOW = 0x00004000 + IN_IGNORED = 0x00008000 + IN_CLOSE = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) + IN_MOVE = (IN_MOVED_FROM | IN_MOVED_TO) + IN_ALL_EVENTS = (IN_ACCESS | IN_MODIFY | IN_ATTRIB | + IN_CLOSE | IN_OPEN | IN_MOVE | + IN_CREATE | IN_DELETE | IN_DELETE_SELF | + IN_MOVE_SELF) + IN_ONLYDIR = 0x01000000 + IN_DONT_FOLLOW = 0x02000000 + IN_EXCL_UNLINK = 0x04000000 + IN_MASK_CREATE = 0x10000000 + IN_MASK_ADD = 0x20000000 + IN_ISDIR = 0x40000000 + IN_ONESHOT = 0x80000000 IP6F_MORE_FRAG = 0x0001 IP6F_OFF_MASK = 0xfff8 IP6F_RESERVED_MASK = 0x0006 @@ -152,10 +210,18 @@ const ( IP_PKTINFO = 101 IP_RECVPKTINFO = 102 IP_TOS = 2 - IP_TTL = 3 + IP_TTL = 14 IP_UNBLOCK_SOURCE = 11 + ICMP6_FILTER = 1 + MCAST_INCLUDE = 0 + MCAST_EXCLUDE = 1 + MCAST_JOIN_GROUP = 40 + MCAST_LEAVE_GROUP = 41 + MCAST_JOIN_SOURCE_GROUP = 42 + MCAST_LEAVE_SOURCE_GROUP = 43 + MCAST_BLOCK_SOURCE = 44 + MCAST_UNBLOCK_SOURCE = 46 ICANON = 0x0010 - ICMP6_FILTER = 0x26 ICRNL = 0x0002 IEXTEN = 0x0020 IGNBRK = 0x0004 @@ -165,10 +231,10 @@ const ( ISTRIP = 0x0080 IXON = 0x0200 IXOFF = 0x0100 - LOCK_SH = 0x1 // Not exist on zOS - LOCK_EX = 0x2 // Not exist on zOS - LOCK_NB = 0x4 // Not exist on zOS - LOCK_UN = 0x8 // Not exist on zOS + LOCK_SH = 0x1 + LOCK_EX = 0x2 + LOCK_NB = 0x4 + LOCK_UN = 0x8 POLLIN = 0x0003 POLLOUT = 0x0004 POLLPRI = 0x0010 @@ -182,15 +248,29 @@ const ( MAP_PRIVATE = 0x1 // changes are private MAP_SHARED = 0x2 // changes are shared MAP_FIXED = 0x4 // place exactly - MCAST_JOIN_GROUP = 40 - MCAST_LEAVE_GROUP = 41 - MCAST_JOIN_SOURCE_GROUP = 42 - MCAST_LEAVE_SOURCE_GROUP = 43 - MCAST_BLOCK_SOURCE = 44 - MCAST_UNBLOCK_SOURCE = 45 + __MAP_MEGA = 0x8 + __MAP_64 = 0x10 + MAP_ANON = 0x20 + MAP_ANONYMOUS = 0x20 MS_SYNC = 0x1 // msync - synchronous writes MS_ASYNC = 0x2 // asynchronous writes MS_INVALIDATE = 0x4 // invalidate mappings + MS_BIND = 0x00001000 + MS_MOVE = 0x00002000 + MS_NOSUID = 0x00000002 + MS_PRIVATE = 0x00040000 + MS_REC = 0x00004000 + MS_REMOUNT = 0x00008000 + MS_RDONLY = 0x00000001 + MS_UNBINDABLE = 0x00020000 + MNT_DETACH = 0x00000004 + ZOSDSFS_SUPER_MAGIC = 0x44534653 // zOS DSFS + NFS_SUPER_MAGIC = 0x6969 // NFS + NSFS_MAGIC = 0x6e736673 // PROCNS + PROC_SUPER_MAGIC = 0x9fa0 // proc FS + ZOSTFS_SUPER_MAGIC = 0x544653 // zOS TFS + ZOSUFS_SUPER_MAGIC = 0x554653 // zOS UFS + ZOSZFS_SUPER_MAGIC = 0x5A4653 // zOS ZFS MTM_RDONLY = 0x80000000 MTM_RDWR = 0x40000000 MTM_UMOUNT = 0x10000000 @@ -205,13 +285,20 @@ const ( MTM_REMOUNT = 0x00000100 MTM_NOSECURITY = 0x00000080 NFDBITS = 0x20 + ONLRET = 0x0020 // NL performs CR function O_ACCMODE = 0x03 O_APPEND = 0x08 O_ASYNCSIG = 0x0200 O_CREAT = 0x80 + O_DIRECT = 0x00002000 + O_NOFOLLOW = 0x00004000 + O_DIRECTORY = 0x00008000 + O_PATH = 0x00080000 + O_CLOEXEC = 0x00001000 O_EXCL = 0x40 O_GETFL = 0x0F O_LARGEFILE = 0x0400 + O_NDELAY = 0x4 O_NONBLOCK = 0x04 O_RDONLY = 0x02 O_RDWR = 0x03 @@ -248,6 +335,7 @@ const ( AF_IUCV = 17 AF_LAT = 14 AF_LINK = 18 + AF_LOCAL = AF_UNIX // AF_LOCAL is an alias for AF_UNIX AF_MAX = 30 AF_NBS = 7 AF_NDD = 23 @@ -285,15 +373,33 @@ const ( RLIMIT_AS = 5 RLIMIT_NOFILE = 6 RLIMIT_MEMLIMIT = 7 + RLIMIT_MEMLOCK = 0x8 RLIM_INFINITY = 2147483647 + SCHED_FIFO = 0x2 + SCM_CREDENTIALS = 0x2 SCM_RIGHTS = 0x01 SF_CLOSE = 0x00000002 SF_REUSE = 0x00000001 + SHM_RND = 0x2 + SHM_RDONLY = 0x1 + SHMLBA = 0x1000 + IPC_STAT = 0x3 + IPC_SET = 0x2 + IPC_RMID = 0x1 + IPC_PRIVATE = 0x0 + IPC_CREAT = 0x1000000 + __IPC_MEGA = 0x4000000 + __IPC_SHAREAS = 0x20000000 + __IPC_BELOWBAR = 0x10000000 + IPC_EXCL = 0x2000000 + __IPC_GIGA = 0x8000000 SHUT_RD = 0 SHUT_RDWR = 2 SHUT_WR = 1 + SOCK_CLOEXEC = 0x00001000 SOCK_CONN_DGRAM = 6 SOCK_DGRAM = 2 + SOCK_NONBLOCK = 0x800 SOCK_RAW = 3 SOCK_RDM = 4 SOCK_SEQPACKET = 5 @@ -378,8 +484,6 @@ const ( S_IFMST = 0x00FF0000 TCP_KEEPALIVE = 0x8 TCP_NODELAY = 0x1 - TCP_INFO = 0xb - TCP_USER_TIMEOUT = 0x1 TIOCGWINSZ = 0x4008a368 TIOCSWINSZ = 0x8008a367 TIOCSBRK = 0x2000a77b @@ -427,7 +531,10 @@ const ( VSUSP = 9 VTIME = 10 WCONTINUED = 0x4 + WEXITED = 0x8 WNOHANG = 0x1 + WNOWAIT = 0x20 + WSTOPPED = 0x10 WUNTRACED = 0x2 _BPX_SWAP = 1 _BPX_NONSWAP = 2 @@ -452,8 +559,28 @@ const ( MADV_FREE = 15 // for Linux compatibility -- no zos semantics MADV_WIPEONFORK = 16 // for Linux compatibility -- no zos semantics MADV_KEEPONFORK = 17 // for Linux compatibility -- no zos semantics - AT_SYMLINK_NOFOLLOW = 1 // for Unix compatibility -- no zos semantics - AT_FDCWD = 2 // for Unix compatibility -- no zos semantics + AT_SYMLINK_FOLLOW = 0x400 + AT_SYMLINK_NOFOLLOW = 0x100 + XATTR_CREATE = 0x1 + XATTR_REPLACE = 0x2 + P_PID = 0 + P_PGID = 1 + P_ALL = 2 + PR_SET_NAME = 15 + PR_GET_NAME = 16 + PR_SET_NO_NEW_PRIVS = 38 + PR_GET_NO_NEW_PRIVS = 39 + PR_SET_DUMPABLE = 4 + PR_GET_DUMPABLE = 3 + PR_SET_PDEATHSIG = 1 + PR_GET_PDEATHSIG = 2 + PR_SET_CHILD_SUBREAPER = 36 + PR_GET_CHILD_SUBREAPER = 37 + AT_FDCWD = -100 + AT_EACCESS = 0x200 + AT_EMPTY_PATH = 0x1000 + AT_REMOVEDIR = 0x200 + RENAME_NOREPLACE = 1 << 0 ) const ( @@ -476,6 +603,7 @@ const ( EMLINK = Errno(125) ENAMETOOLONG = Errno(126) ENFILE = Errno(127) + ENOATTR = Errno(265) ENODEV = Errno(128) ENOENT = Errno(129) ENOEXEC = Errno(130) @@ -700,7 +828,7 @@ var errorList = [...]struct { {145, "EDC5145I", "The parameter list is too long, or the message to receive was too large for the buffer."}, {146, "EDC5146I", "Too many levels of symbolic links."}, {147, "EDC5147I", "Illegal byte sequence."}, - {148, "", ""}, + {148, "EDC5148I", "The named attribute or data not available."}, {149, "EDC5149I", "Value Overflow Error."}, {150, "EDC5150I", "UNIX System Services is not active."}, {151, "EDC5151I", "Dynamic allocation error."}, @@ -743,6 +871,7 @@ var errorList = [...]struct { {259, "EDC5259I", "A CUN_RS_NO_CONVERSION error was issued by Unicode Services."}, {260, "EDC5260I", "A CUN_RS_TABLE_NOT_ALIGNED error was issued by Unicode Services."}, {262, "EDC5262I", "An iconv() function encountered an unexpected error while using Unicode Services."}, + {265, "EDC5265I", "The named attribute not available."}, {1000, "EDC8000I", "A bad socket-call constant was found in the IUCV header."}, {1001, "EDC8001I", "An error was found in the IUCV header."}, {1002, "EDC8002I", "A socket descriptor is out of range."}, diff --git a/vendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s b/vendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s new file mode 100644 index 0000000000..b77ff5db90 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s @@ -0,0 +1,364 @@ +// go run mksyscall_zos_s390x.go -o_sysnum zsysnum_zos_s390x.go -o_syscall zsyscall_zos_s390x.go -i_syscall syscall_zos_s390x.go -o_asm zsymaddr_zos_s390x.s +// Code generated by the command above; see README.md. DO NOT EDIT. + +//go:build zos && s390x +#include "textflag.h" + +// provide the address of function variable to be fixed up. + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_FlistxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Flistxattr(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_FremovexattrAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Fremovexattr(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_FgetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Fgetxattr(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_FsetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Fsetxattr(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_accept4Addr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·accept4(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_RemovexattrAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Removexattr(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_Dup3Addr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Dup3(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_DirfdAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Dirfd(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_EpollCreateAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·EpollCreate(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_EpollCreate1Addr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·EpollCreate1(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_EpollCtlAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·EpollCtl(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_EpollPwaitAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·EpollPwait(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_EpollWaitAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·EpollWait(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_EventfdAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Eventfd(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_FaccessatAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Faccessat(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_FchmodatAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Fchmodat(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_FchownatAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Fchownat(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_FdatasyncAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Fdatasync(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_fstatatAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·fstatat(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_LgetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Lgetxattr(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_LsetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Lsetxattr(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_FstatfsAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Fstatfs(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_FutimesAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Futimes(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_FutimesatAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Futimesat(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_GetrandomAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Getrandom(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_InotifyInitAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·InotifyInit(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_InotifyInit1Addr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·InotifyInit1(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_InotifyAddWatchAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·InotifyAddWatch(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_InotifyRmWatchAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·InotifyRmWatch(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_ListxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Listxattr(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_LlistxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Llistxattr(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_LremovexattrAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Lremovexattr(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_LutimesAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Lutimes(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_StatfsAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Statfs(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_SyncfsAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Syncfs(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_UnshareAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Unshare(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_LinkatAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Linkat(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_MkdiratAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Mkdirat(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_MknodatAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Mknodat(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_PivotRootAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·PivotRoot(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_PrctlAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Prctl(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_PrlimitAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Prlimit(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_RenameatAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Renameat(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_Renameat2Addr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Renameat2(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_SethostnameAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Sethostname(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_SetnsAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Setns(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_SymlinkatAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Symlinkat(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_UnlinkatAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·Unlinkat(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_openatAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·openat(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_openat2Addr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·openat2(SB), R8 + MOVD R8, ret+0(FP) + RET + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +TEXT ·get_utimensatAddr(SB), NOSPLIT|NOFRAME, $0-8 + MOVD $·utimensat(SB), R8 + MOVD R8, ret+0(FP) + RET diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go index ccb02f240a..b622533ef2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -740,6 +740,54 @@ func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func renamexNp(from string, to string, flag uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := syscall_syscall(libc_renamex_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_renamex_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_renamex_np renamex_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_renameatx_np_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), uintptr(flag), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_renameatx_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_renameatx_np renameatx_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { @@ -760,6 +808,39 @@ var libc_sysctl_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func pthread_chdir_np(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(libc_pthread_chdir_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pthread_chdir_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pthread_chdir_np pthread_chdir_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pthread_fchdir_np(fd int) (err error) { + _, _, e1 := syscall_syscall(libc_pthread_fchdir_np_trampoline_addr, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pthread_fchdir_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pthread_fchdir_np pthread_fchdir_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { _, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s index 8b8bb28402..cfe6646baf 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s @@ -223,11 +223,31 @@ TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) +TEXT libc_renamex_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_renamex_np(SB) +GLOBL ·libc_renamex_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_renamex_np_trampoline_addr(SB)/8, $libc_renamex_np_trampoline<>(SB) + +TEXT libc_renameatx_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_renameatx_np(SB) +GLOBL ·libc_renameatx_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_renameatx_np_trampoline_addr(SB)/8, $libc_renameatx_np_trampoline<>(SB) + TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) +TEXT libc_pthread_chdir_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pthread_chdir_np(SB) +GLOBL ·libc_pthread_chdir_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pthread_chdir_np_trampoline_addr(SB)/8, $libc_pthread_chdir_np_trampoline<>(SB) + +TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pthread_fchdir_np(SB) +GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB) + TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendfile(SB) GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go index 1b40b997b5..13f624f69f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -740,6 +740,54 @@ func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func renamexNp(from string, to string, flag uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := syscall_syscall(libc_renamex_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_renamex_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_renamex_np renamex_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_renameatx_np_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), uintptr(flag), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_renameatx_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_renameatx_np renameatx_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { @@ -760,6 +808,39 @@ var libc_sysctl_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func pthread_chdir_np(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(libc_pthread_chdir_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pthread_chdir_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pthread_chdir_np pthread_chdir_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pthread_fchdir_np(fd int) (err error) { + _, _, e1 := syscall_syscall(libc_pthread_fchdir_np_trampoline_addr, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pthread_fchdir_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pthread_fchdir_np pthread_fchdir_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { _, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s index 08362c1ab7..fe222b75df 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s @@ -223,11 +223,31 @@ TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) +TEXT libc_renamex_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_renamex_np(SB) +GLOBL ·libc_renamex_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_renamex_np_trampoline_addr(SB)/8, $libc_renamex_np_trampoline<>(SB) + +TEXT libc_renameatx_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_renameatx_np(SB) +GLOBL ·libc_renameatx_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_renameatx_np_trampoline_addr(SB)/8, $libc_renameatx_np_trampoline<>(SB) + TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) +TEXT libc_pthread_chdir_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pthread_chdir_np(SB) +GLOBL ·libc_pthread_chdir_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pthread_chdir_np_trampoline_addr(SB)/8, $libc_pthread_chdir_np_trampoline<>(SB) + +TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pthread_fchdir_np(SB) +GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB) + TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendfile(SB) GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go index 87d8612a1d..1bc1a5adb2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -2229,3 +2229,19 @@ func Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) } return } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mseal(b []byte, flags uint) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MSEAL, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index 9dc42410b7..1851df14e8 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s index 41b5617316..0b43c69365 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $4 +DATA ·libc_mount_trampoline_addr(SB)/4, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index 0d3a0751cd..e1ec0dbe4e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s index 4019a656f6..880c6d6e31 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index c39f7776db..7c8452a63e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s index ac4af24f90..b8ef95b0fa 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $4 +DATA ·libc_mount_trampoline_addr(SB)/4, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index 57571d072f..2ffdf861f7 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s index f77d532121..2af3b5c762 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go index e62963e67e..1da08d5267 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s index fae140b62c..b7a251353b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go index 00831354c8..6e85b0aac9 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s index 9d1e0ff06d..f15dadf055 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s @@ -555,6 +555,12 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_mount(SB) + RET +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_nanosleep(SB) RET diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go index 79029ed584..28b487df25 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s index da115f9a4b..1e7f321e43 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go index 94f0112383..7ccf66b7ee 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go @@ -1,4 +1,4 @@ -// go run mksyscall.go -tags zos,s390x syscall_zos_s390x.go +// go run mksyscall_zos_s390x.go -o_sysnum zsysnum_zos_s390x.go -o_syscall zsyscall_zos_s390x.go -i_syscall syscall_zos_s390x.go -o_asm zsymaddr_zos_s390x.s // Code generated by the command above; see README.md. DO NOT EDIT. //go:build zos && s390x @@ -6,17 +6,100 @@ package unix import ( + "runtime" + "syscall" "unsafe" ) +var _ syscall.Errno + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := syscall_syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCNTL<<4, uintptr(fd), uintptr(cmd), uintptr(arg)) + runtime.ExitSyscall() val = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Flistxattr(fd int, dest []byte) (sz int, err error) { + var _p0 unsafe.Pointer + if len(dest) > 0 { + _p0 = unsafe.Pointer(&dest[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FLISTXATTR_A<<4, uintptr(fd), uintptr(_p0), uintptr(len(dest))) + runtime.ExitSyscall() + sz = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_FlistxattrAddr() *(func(fd int, dest []byte) (sz int, err error)) + +var Flistxattr = enter_Flistxattr + +func enter_Flistxattr(fd int, dest []byte) (sz int, err error) { + funcref := get_FlistxattrAddr() + if funcptrtest(GetZosLibVec()+SYS___FLISTXATTR_A<<4, "") == 0 { + *funcref = impl_Flistxattr + } else { + *funcref = error_Flistxattr + } + return (*funcref)(fd, dest) +} + +func error_Flistxattr(fd int, dest []byte) (sz int, err error) { + sz = -1 + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Fremovexattr(fd int, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FREMOVEXATTR_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_FremovexattrAddr() *(func(fd int, attr string) (err error)) + +var Fremovexattr = enter_Fremovexattr + +func enter_Fremovexattr(fd int, attr string) (err error) { + funcref := get_FremovexattrAddr() + if funcptrtest(GetZosLibVec()+SYS___FREMOVEXATTR_A<<4, "") == 0 { + *funcref = impl_Fremovexattr + } else { + *funcref = error_Fremovexattr } + return (*funcref)(fd, attr) +} + +func error_Fremovexattr(fd int, attr string) (err error) { + err = ENOSYS return } @@ -29,10 +112,12 @@ func read(fd int, p []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := syscall_syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_READ<<4, uintptr(fd), uintptr(_p0), uintptr(len(p))) + runtime.ExitSyscall() n = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -46,31 +131,159 @@ func write(fd int, p []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := syscall_syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_WRITE<<4, uintptr(fd), uintptr(_p0), uintptr(len(p))) + runtime.ExitSyscall() n = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FGETXATTR_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) + runtime.ExitSyscall() + sz = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_FgetxattrAddr() *(func(fd int, attr string, dest []byte) (sz int, err error)) + +var Fgetxattr = enter_Fgetxattr + +func enter_Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + funcref := get_FgetxattrAddr() + if funcptrtest(GetZosLibVec()+SYS___FGETXATTR_A<<4, "") == 0 { + *funcref = impl_Fgetxattr + } else { + *funcref = error_Fgetxattr + } + return (*funcref)(fd, attr, dest) +} + +func error_Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + sz = -1 + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Fsetxattr(fd int, attr string, data []byte, flag int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(data) > 0 { + _p1 = unsafe.Pointer(&data[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FSETXATTR_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(data)), uintptr(flag)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_FsetxattrAddr() *(func(fd int, attr string, data []byte, flag int) (err error)) + +var Fsetxattr = enter_Fsetxattr + +func enter_Fsetxattr(fd int, attr string, data []byte, flag int) (err error) { + funcref := get_FsetxattrAddr() + if funcptrtest(GetZosLibVec()+SYS___FSETXATTR_A<<4, "") == 0 { + *funcref = impl_Fsetxattr + } else { + *funcref = error_Fsetxattr } + return (*funcref)(fd, attr, data, flag) +} + +func error_Fsetxattr(fd int, attr string, data []byte, flag int) (err error) { + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { - r0, _, e1 := syscall_syscall(SYS___ACCEPT_A, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___ACCEPT_A<<4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + runtime.ExitSyscall() + fd = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___ACCEPT4_A<<4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags)) + runtime.ExitSyscall() fd = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_accept4Addr() *(func(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)) + +var accept4 = enter_accept4 + +func enter_accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { + funcref := get_accept4Addr() + if funcptrtest(GetZosLibVec()+SYS___ACCEPT4_A<<4, "") == 0 { + *funcref = impl_accept4 + } else { + *funcref = error_accept4 } + return (*funcref)(s, rsa, addrlen, flags) +} + +func error_accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { + fd = -1 + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { - _, _, e1 := syscall_syscall(SYS___BIND_A, uintptr(s), uintptr(addr), uintptr(addrlen)) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___BIND_A<<4, uintptr(s), uintptr(addr), uintptr(addrlen)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -78,9 +291,11 @@ func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { - _, _, e1 := syscall_syscall(SYS___CONNECT_A, uintptr(s), uintptr(addr), uintptr(addrlen)) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CONNECT_A<<4, uintptr(s), uintptr(addr), uintptr(addrlen)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -88,10 +303,10 @@ func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { - r0, _, e1 := syscall_rawsyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETGROUPS<<4, uintptr(n), uintptr(unsafe.Pointer(list))) nn = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -99,9 +314,9 @@ func getgroups(n int, list *_Gid_t) (nn int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { - _, _, e1 := syscall_rawsyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) - if e1 != 0 { - err = errnoErr(e1) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETGROUPS<<4, uintptr(n), uintptr(unsafe.Pointer(list))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -109,9 +324,11 @@ func setgroups(n int, list *_Gid_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { - _, _, e1 := syscall_syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETSOCKOPT<<4, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -119,9 +336,11 @@ func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { - _, _, e1 := syscall_syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETSOCKOPT<<4, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -129,10 +348,10 @@ func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { - r0, _, e1 := syscall_rawsyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SOCKET<<4, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -140,9 +359,9 @@ func socket(domain int, typ int, proto int) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { - _, _, e1 := syscall_rawsyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) - if e1 != 0 { - err = errnoErr(e1) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SOCKETPAIR<<4, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -150,9 +369,9 @@ func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { - _, _, e1 := syscall_rawsyscall(SYS___GETPEERNAME_A, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) - if e1 != 0 { - err = errnoErr(e1) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___GETPEERNAME_A<<4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -160,10 +379,52 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { - _, _, e1 := syscall_rawsyscall(SYS___GETSOCKNAME_A, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) - if e1 != 0 { - err = errnoErr(e1) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___GETSOCKNAME_A<<4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Removexattr(path string, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___REMOVEXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_RemovexattrAddr() *(func(path string, attr string) (err error)) + +var Removexattr = enter_Removexattr + +func enter_Removexattr(path string, attr string) (err error) { + funcref := get_RemovexattrAddr() + if funcptrtest(GetZosLibVec()+SYS___REMOVEXATTR_A<<4, "") == 0 { + *funcref = impl_Removexattr + } else { + *funcref = error_Removexattr } + return (*funcref)(path, attr) +} + +func error_Removexattr(path string, attr string) (err error) { + err = ENOSYS return } @@ -176,10 +437,12 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := syscall_syscall6(SYS___RECVFROM_A, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RECVFROM_A<<4, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + runtime.ExitSyscall() n = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -193,9 +456,11 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) ( } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := syscall_syscall6(SYS___SENDTO_A, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SENDTO_A<<4, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -203,10 +468,12 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) ( // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { - r0, _, e1 := syscall_syscall(SYS___RECVMSG_A, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RECVMSG_A<<4, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + runtime.ExitSyscall() n = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -214,10 +481,12 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { - r0, _, e1 := syscall_syscall(SYS___SENDMSG_A, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SENDMSG_A<<4, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + runtime.ExitSyscall() n = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -225,10 +494,12 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { - r0, _, e1 := syscall_syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_MMAP<<4, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) + runtime.ExitSyscall() ret = uintptr(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -236,9 +507,11 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) ( // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { - _, _, e1 := syscall_syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_MUNMAP<<4, uintptr(addr), uintptr(length)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -246,9 +519,11 @@ func munmap(addr uintptr, length uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req int, arg uintptr) (err error) { - _, _, e1 := syscall_syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_IOCTL<<4, uintptr(fd), uintptr(req), uintptr(arg)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -256,9 +531,62 @@ func ioctl(fd int, req int, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctlPtr(fd int, req int, arg unsafe.Pointer) (err error) { - _, _, e1 := syscall_syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_IOCTL<<4, uintptr(fd), uintptr(req), uintptr(arg)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func shmat(id int, addr uintptr, flag int) (ret uintptr, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SHMAT<<4, uintptr(id), uintptr(addr), uintptr(flag)) + runtime.ExitSyscall() + ret = uintptr(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func shmctl(id int, cmd int, buf *SysvShmDesc) (result int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SHMCTL64<<4, uintptr(id), uintptr(cmd), uintptr(unsafe.Pointer(buf))) + runtime.ExitSyscall() + result = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func shmdt(addr uintptr) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SHMDT<<4, uintptr(addr)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func shmget(key int, size int, flag int) (id int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SHMGET<<4, uintptr(key), uintptr(size), uintptr(flag)) + runtime.ExitSyscall() + id = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -271,9 +599,11 @@ func Access(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := syscall_syscall(SYS___ACCESS_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___ACCESS_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -286,9 +616,11 @@ func Chdir(path string) (err error) { if err != nil { return } - _, _, e1 := syscall_syscall(SYS___CHDIR_A, uintptr(unsafe.Pointer(_p0)), 0, 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CHDIR_A<<4, uintptr(unsafe.Pointer(_p0))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -301,9 +633,11 @@ func Chown(path string, uid int, gid int) (err error) { if err != nil { return } - _, _, e1 := syscall_syscall(SYS___CHOWN_A, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CHOWN_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -316,9 +650,11 @@ func Chmod(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := syscall_syscall(SYS___CHMOD_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CHMOD_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -331,10 +667,12 @@ func Creat(path string, mode uint32) (fd int, err error) { if err != nil { return } - r0, _, e1 := syscall_syscall(SYS___CREAT_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CREAT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + runtime.ExitSyscall() fd = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -342,10 +680,12 @@ func Creat(path string, mode uint32) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int) (fd int, err error) { - r0, _, e1 := syscall_syscall(SYS_DUP, uintptr(oldfd), 0, 0) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_DUP<<4, uintptr(oldfd)) + runtime.ExitSyscall() fd = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -353,617 +693,2216 @@ func Dup(oldfd int) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(oldfd int, newfd int) (err error) { - _, _, e1 := syscall_syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_DUP2<<4, uintptr(oldfd), uintptr(newfd)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Errno2() (er2 int) { - uer2, _, _ := syscall_syscall(SYS___ERRNO2, 0, 0, 0) - er2 = int(uer2) +func impl_Dup3(oldfd int, newfd int, flags int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_DUP3<<4, uintptr(oldfd), uintptr(newfd), uintptr(flags)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_Dup3Addr() *(func(oldfd int, newfd int, flags int) (err error)) -func Err2ad() (eadd *int) { - ueadd, _, _ := syscall_syscall(SYS___ERR2AD, 0, 0, 0) - eadd = (*int)(unsafe.Pointer(ueadd)) - return -} +var Dup3 = enter_Dup3 -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func enter_Dup3(oldfd int, newfd int, flags int) (err error) { + funcref := get_Dup3Addr() + if funcptrtest(GetZosLibVec()+SYS_DUP3<<4, "") == 0 { + *funcref = impl_Dup3 + } else { + *funcref = error_Dup3 + } + return (*funcref)(oldfd, newfd, flags) +} -func Exit(code int) { - syscall_syscall(SYS_EXIT, uintptr(code), 0, 0) +func error_Dup3(oldfd int, newfd int, flags int) (err error) { + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fchdir(fd int) (err error) { - _, _, e1 := syscall_syscall(SYS_FCHDIR, uintptr(fd), 0, 0) - if e1 != 0 { - err = errnoErr(e1) +func impl_Dirfd(dirp uintptr) (fd int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_DIRFD<<4, uintptr(dirp)) + runtime.ExitSyscall() + fd = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_DirfdAddr() *(func(dirp uintptr) (fd int, err error)) -func Fchmod(fd int, mode uint32) (err error) { - _, _, e1 := syscall_syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) - if e1 != 0 { - err = errnoErr(e1) +var Dirfd = enter_Dirfd + +func enter_Dirfd(dirp uintptr) (fd int, err error) { + funcref := get_DirfdAddr() + if funcptrtest(GetZosLibVec()+SYS_DIRFD<<4, "") == 0 { + *funcref = impl_Dirfd + } else { + *funcref = error_Dirfd } + return (*funcref)(dirp) +} + +func error_Dirfd(dirp uintptr) (fd int, err error) { + fd = -1 + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fchown(fd int, uid int, gid int) (err error) { - _, _, e1 := syscall_syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) - if e1 != 0 { - err = errnoErr(e1) +func impl_EpollCreate(size int) (fd int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_CREATE<<4, uintptr(size)) + runtime.ExitSyscall() + fd = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_EpollCreateAddr() *(func(size int) (fd int, err error)) -func FcntlInt(fd uintptr, cmd int, arg int) (retval int, err error) { - r0, _, e1 := syscall_syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - retval = int(r0) - if e1 != 0 { - err = errnoErr(e1) +var EpollCreate = enter_EpollCreate + +func enter_EpollCreate(size int) (fd int, err error) { + funcref := get_EpollCreateAddr() + if funcptrtest(GetZosLibVec()+SYS_EPOLL_CREATE<<4, "") == 0 { + *funcref = impl_EpollCreate + } else { + *funcref = error_EpollCreate } + return (*funcref)(size) +} + +func error_EpollCreate(size int) (fd int, err error) { + fd = -1 + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fstat(fd int, stat *Stat_LE_t) (err error) { - _, _, e1 := syscall_syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) +func impl_EpollCreate1(flags int) (fd int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_CREATE1<<4, uintptr(flags)) + runtime.ExitSyscall() + fd = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_EpollCreate1Addr() *(func(flags int) (fd int, err error)) -func Fstatvfs(fd int, stat *Statvfs_t) (err error) { - _, _, e1 := syscall_syscall(SYS_FSTATVFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) +var EpollCreate1 = enter_EpollCreate1 + +func enter_EpollCreate1(flags int) (fd int, err error) { + funcref := get_EpollCreate1Addr() + if funcptrtest(GetZosLibVec()+SYS_EPOLL_CREATE1<<4, "") == 0 { + *funcref = impl_EpollCreate1 + } else { + *funcref = error_EpollCreate1 } + return (*funcref)(flags) +} + +func error_EpollCreate1(flags int) (fd int, err error) { + fd = -1 + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fsync(fd int) (err error) { - _, _, e1 := syscall_syscall(SYS_FSYNC, uintptr(fd), 0, 0) - if e1 != 0 { - err = errnoErr(e1) +func impl_EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_CTL<<4, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_EpollCtlAddr() *(func(epfd int, op int, fd int, event *EpollEvent) (err error)) -func Ftruncate(fd int, length int64) (err error) { - _, _, e1 := syscall_syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) - if e1 != 0 { - err = errnoErr(e1) +var EpollCtl = enter_EpollCtl + +func enter_EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { + funcref := get_EpollCtlAddr() + if funcptrtest(GetZosLibVec()+SYS_EPOLL_CTL<<4, "") == 0 { + *funcref = impl_EpollCtl + } else { + *funcref = error_EpollCtl } - return + return (*funcref)(epfd, op, fd, event) } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Getpagesize() (pgsize int) { - r0, _, _ := syscall_syscall(SYS_GETPAGESIZE, 0, 0, 0) - pgsize = int(r0) +func error_EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Mprotect(b []byte, prot int) (err error) { +func impl_EpollPwait(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error) { var _p0 unsafe.Pointer - if len(b) > 0 { - _p0 = unsafe.Pointer(&b[0]) + if len(events) > 0 { + _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := syscall_syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_PWAIT<<4, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), uintptr(unsafe.Pointer(sigmask))) + runtime.ExitSyscall() + n = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_EpollPwaitAddr() *(func(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error)) -func Msync(b []byte, flags int) (err error) { - var _p0 unsafe.Pointer - if len(b) > 0 { - _p0 = unsafe.Pointer(&b[0]) +var EpollPwait = enter_EpollPwait + +func enter_EpollPwait(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error) { + funcref := get_EpollPwaitAddr() + if funcptrtest(GetZosLibVec()+SYS_EPOLL_PWAIT<<4, "") == 0 { + *funcref = impl_EpollPwait } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := syscall_syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) - if e1 != 0 { - err = errnoErr(e1) + *funcref = error_EpollPwait } + return (*funcref)(epfd, events, msec, sigmask) +} + +func error_EpollPwait(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error) { + n = -1 + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Poll(fds []PollFd, timeout int) (n int, err error) { +func impl_EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer - if len(fds) > 0 { - _p0 = unsafe.Pointer(&fds[0]) + if len(events) > 0 { + _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := syscall_syscall(SYS_POLL, uintptr(_p0), uintptr(len(fds)), uintptr(timeout)) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_WAIT<<4, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec)) + runtime.ExitSyscall() n = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_EpollWaitAddr() *(func(epfd int, events []EpollEvent, msec int) (n int, err error)) -func Times(tms *Tms) (ticks uintptr, err error) { - r0, _, e1 := syscall_syscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) - ticks = uintptr(r0) - if e1 != 0 { - err = errnoErr(e1) +var EpollWait = enter_EpollWait + +func enter_EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { + funcref := get_EpollWaitAddr() + if funcptrtest(GetZosLibVec()+SYS_EPOLL_WAIT<<4, "") == 0 { + *funcref = impl_EpollWait + } else { + *funcref = error_EpollWait } + return (*funcref)(epfd, events, msec) +} + +func error_EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { + n = -1 + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func W_Getmntent(buff *byte, size int) (lastsys int, err error) { - r0, _, e1 := syscall_syscall(SYS_W_GETMNTENT, uintptr(unsafe.Pointer(buff)), uintptr(size), 0) - lastsys = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } +func Errno2() (er2 int) { + runtime.EnterSyscall() + r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS___ERRNO2<<4) + runtime.ExitSyscall() + er2 = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func W_Getmntent_A(buff *byte, size int) (lastsys int, err error) { - r0, _, e1 := syscall_syscall(SYS___W_GETMNTENT_A, uintptr(unsafe.Pointer(buff)), uintptr(size), 0) - lastsys = int(r0) - if e1 != 0 { - err = errnoErr(e1) +func impl_Eventfd(initval uint, flags int) (fd int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EVENTFD<<4, uintptr(initval), uintptr(flags)) + runtime.ExitSyscall() + fd = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } +//go:nosplit +func get_EventfdAddr() *(func(initval uint, flags int) (fd int, err error)) + +var Eventfd = enter_Eventfd + +func enter_Eventfd(initval uint, flags int) (fd int, err error) { + funcref := get_EventfdAddr() + if funcptrtest(GetZosLibVec()+SYS_EVENTFD<<4, "") == 0 { + *funcref = impl_Eventfd + } else { + *funcref = error_Eventfd + } + return (*funcref)(initval, flags) +} + +func error_Eventfd(initval uint, flags int) (fd int, err error) { + fd = -1 + err = ENOSYS + return +} + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func mount_LE(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) { +func Exit(code int) { + runtime.EnterSyscall() + CallLeFuncWithErr(GetZosLibVec()+SYS_EXIT<<4, uintptr(code)) + runtime.ExitSyscall() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } - var _p1 *byte - _p1, err = BytePtrFromString(filesystem) - if err != nil { - return - } - var _p2 *byte - _p2, err = BytePtrFromString(fstype) - if err != nil { - return - } - var _p3 *byte - _p3, err = BytePtrFromString(parm) - if err != nil { - return - } - _, _, e1 := syscall_syscall6(SYS___MOUNT_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(mtm), uintptr(parmlen), uintptr(unsafe.Pointer(_p3))) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FACCESSAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_FaccessatAddr() *(func(dirfd int, path string, mode uint32, flags int) (err error)) -func unmount(filesystem string, mtm int) (err error) { +var Faccessat = enter_Faccessat + +func enter_Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { + funcref := get_FaccessatAddr() + if funcptrtest(GetZosLibVec()+SYS___FACCESSAT_A<<4, "") == 0 { + *funcref = impl_Faccessat + } else { + *funcref = error_Faccessat + } + return (*funcref)(dirfd, path, mode, flags) +} + +func error_Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchdir(fd int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCHDIR<<4, uintptr(fd)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmod(fd int, mode uint32) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCHMOD<<4, uintptr(fd), uintptr(mode)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte - _p0, err = BytePtrFromString(filesystem) + _p0, err = BytePtrFromString(path) if err != nil { return } - _, _, e1 := syscall_syscall(SYS___UMOUNT_A, uintptr(unsafe.Pointer(_p0)), uintptr(mtm), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FCHMODAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_FchmodatAddr() *(func(dirfd int, path string, mode uint32, flags int) (err error)) + +var Fchmodat = enter_Fchmodat + +func enter_Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { + funcref := get_FchmodatAddr() + if funcptrtest(GetZosLibVec()+SYS___FCHMODAT_A<<4, "") == 0 { + *funcref = impl_Fchmodat + } else { + *funcref = error_Fchmodat + } + return (*funcref)(dirfd, path, mode, flags) +} + +func error_Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchown(fd int, uid int, gid int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCHOWN<<4, uintptr(fd), uintptr(uid), uintptr(gid)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Chroot(path string) (err error) { +func impl_Fchownat(fd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } - _, _, e1 := syscall_syscall(SYS___CHROOT_A, uintptr(unsafe.Pointer(_p0)), 0, 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FCHOWNAT_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_FchownatAddr() *(func(fd int, path string, uid int, gid int, flags int) (err error)) + +var Fchownat = enter_Fchownat + +func enter_Fchownat(fd int, path string, uid int, gid int, flags int) (err error) { + funcref := get_FchownatAddr() + if funcptrtest(GetZosLibVec()+SYS___FCHOWNAT_A<<4, "") == 0 { + *funcref = impl_Fchownat + } else { + *funcref = error_Fchownat } + return (*funcref)(fd, path, uid, gid, flags) +} + +func error_Fchownat(fd int, path string, uid int, gid int, flags int) (err error) { + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Uname(buf *Utsname) (err error) { - _, _, e1 := syscall_rawsyscall(SYS___UNAME_A, uintptr(unsafe.Pointer(buf)), 0, 0) - if e1 != 0 { - err = errnoErr(e1) +func FcntlInt(fd uintptr, cmd int, arg int) (retval int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCNTL<<4, uintptr(fd), uintptr(cmd), uintptr(arg)) + runtime.ExitSyscall() + retval = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Gethostname(buf []byte) (err error) { +func impl_Fdatasync(fd int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FDATASYNC<<4, uintptr(fd)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_FdatasyncAddr() *(func(fd int) (err error)) + +var Fdatasync = enter_Fdatasync + +func enter_Fdatasync(fd int) (err error) { + funcref := get_FdatasyncAddr() + if funcptrtest(GetZosLibVec()+SYS_FDATASYNC<<4, "") == 0 { + *funcref = impl_Fdatasync + } else { + *funcref = error_Fdatasync + } + return (*funcref)(fd) +} + +func error_Fdatasync(fd int) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstat(fd int, stat *Stat_LE_t) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSTAT<<4, uintptr(fd), uintptr(unsafe.Pointer(stat))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_fstatat(dirfd int, path string, stat *Stat_LE_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FSTATAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_fstatatAddr() *(func(dirfd int, path string, stat *Stat_LE_t, flags int) (err error)) + +var fstatat = enter_fstatat + +func enter_fstatat(dirfd int, path string, stat *Stat_LE_t, flags int) (err error) { + funcref := get_fstatatAddr() + if funcptrtest(GetZosLibVec()+SYS___FSTATAT_A<<4, "") == 0 { + *funcref = impl_fstatat + } else { + *funcref = error_fstatat + } + return (*funcref)(dirfd, path, stat, flags) +} + +func error_fstatat(dirfd int, path string, stat *Stat_LE_t, flags int) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p2 unsafe.Pointer + if len(dest) > 0 { + _p2 = unsafe.Pointer(&dest[0]) + } else { + _p2 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LGETXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest))) + runtime.ExitSyscall() + sz = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_LgetxattrAddr() *(func(link string, attr string, dest []byte) (sz int, err error)) + +var Lgetxattr = enter_Lgetxattr + +func enter_Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { + funcref := get_LgetxattrAddr() + if funcptrtest(GetZosLibVec()+SYS___LGETXATTR_A<<4, "") == 0 { + *funcref = impl_Lgetxattr + } else { + *funcref = error_Lgetxattr + } + return (*funcref)(link, attr, dest) +} + +func error_Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { + sz = -1 + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Lsetxattr(path string, attr string, data []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p2 unsafe.Pointer + if len(data) > 0 { + _p2 = unsafe.Pointer(&data[0]) + } else { + _p2 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LSETXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_LsetxattrAddr() *(func(path string, attr string, data []byte, flags int) (err error)) + +var Lsetxattr = enter_Lsetxattr + +func enter_Lsetxattr(path string, attr string, data []byte, flags int) (err error) { + funcref := get_LsetxattrAddr() + if funcptrtest(GetZosLibVec()+SYS___LSETXATTR_A<<4, "") == 0 { + *funcref = impl_Lsetxattr + } else { + *funcref = error_Lsetxattr + } + return (*funcref)(path, attr, data, flags) +} + +func error_Lsetxattr(path string, attr string, data []byte, flags int) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Fstatfs(fd int, buf *Statfs_t) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSTATFS<<4, uintptr(fd), uintptr(unsafe.Pointer(buf))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_FstatfsAddr() *(func(fd int, buf *Statfs_t) (err error)) + +var Fstatfs = enter_Fstatfs + +func enter_Fstatfs(fd int, buf *Statfs_t) (err error) { + funcref := get_FstatfsAddr() + if funcptrtest(GetZosLibVec()+SYS_FSTATFS<<4, "") == 0 { + *funcref = impl_Fstatfs + } else { + *funcref = error_Fstatfs + } + return (*funcref)(fd, buf) +} + +func error_Fstatfs(fd int, buf *Statfs_t) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatvfs(fd int, stat *Statvfs_t) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSTATVFS<<4, uintptr(fd), uintptr(unsafe.Pointer(stat))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsync(fd int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSYNC<<4, uintptr(fd)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Futimes(fd int, tv []Timeval) (err error) { var _p0 unsafe.Pointer - if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) + if len(tv) > 0 { + _p0 = unsafe.Pointer(&tv[0]) } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := syscall_syscall(SYS___GETHOSTNAME_A, uintptr(_p0), uintptr(len(buf)), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FUTIMES<<4, uintptr(fd), uintptr(_p0), uintptr(len(tv))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_FutimesAddr() *(func(fd int, tv []Timeval) (err error)) -func Getegid() (egid int) { - r0, _, _ := syscall_rawsyscall(SYS_GETEGID, 0, 0, 0) - egid = int(r0) +var Futimes = enter_Futimes + +func enter_Futimes(fd int, tv []Timeval) (err error) { + funcref := get_FutimesAddr() + if funcptrtest(GetZosLibVec()+SYS_FUTIMES<<4, "") == 0 { + *funcref = impl_Futimes + } else { + *funcref = error_Futimes + } + return (*funcref)(fd, tv) +} + +func error_Futimes(fd int, tv []Timeval) (err error) { + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Geteuid() (uid int) { - r0, _, _ := syscall_rawsyscall(SYS_GETEUID, 0, 0, 0) - uid = int(r0) +func impl_Futimesat(dirfd int, path string, tv []Timeval) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(tv) > 0 { + _p1 = unsafe.Pointer(&tv[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FUTIMESAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(tv))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_FutimesatAddr() *(func(dirfd int, path string, tv []Timeval) (err error)) + +var Futimesat = enter_Futimesat + +func enter_Futimesat(dirfd int, path string, tv []Timeval) (err error) { + funcref := get_FutimesatAddr() + if funcptrtest(GetZosLibVec()+SYS___FUTIMESAT_A<<4, "") == 0 { + *funcref = impl_Futimesat + } else { + *funcref = error_Futimesat + } + return (*funcref)(dirfd, path, tv) +} + +func error_Futimesat(dirfd int, path string, tv []Timeval) (err error) { + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getgid() (gid int) { - r0, _, _ := syscall_rawsyscall(SYS_GETGID, 0, 0, 0) - gid = int(r0) +func Ftruncate(fd int, length int64) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FTRUNCATE<<4, uintptr(fd), uintptr(length)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getpid() (pid int) { - r0, _, _ := syscall_rawsyscall(SYS_GETPID, 0, 0, 0) - pid = int(r0) +func impl_Getrandom(buf []byte, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETRANDOM<<4, uintptr(_p0), uintptr(len(buf)), uintptr(flags)) + runtime.ExitSyscall() + n = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_GetrandomAddr() *(func(buf []byte, flags int) (n int, err error)) + +var Getrandom = enter_Getrandom + +func enter_Getrandom(buf []byte, flags int) (n int, err error) { + funcref := get_GetrandomAddr() + if funcptrtest(GetZosLibVec()+SYS_GETRANDOM<<4, "") == 0 { + *funcref = impl_Getrandom + } else { + *funcref = error_Getrandom + } + return (*funcref)(buf, flags) +} + +func error_Getrandom(buf []byte, flags int) (n int, err error) { + n = -1 + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getpgid(pid int) (pgid int, err error) { - r0, _, e1 := syscall_rawsyscall(SYS_GETPGID, uintptr(pid), 0, 0) - pgid = int(r0) - if e1 != 0 { - err = errnoErr(e1) +func impl_InotifyInit() (fd int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec() + SYS_INOTIFY_INIT<<4) + runtime.ExitSyscall() + fd = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_InotifyInitAddr() *(func() (fd int, err error)) + +var InotifyInit = enter_InotifyInit + +func enter_InotifyInit() (fd int, err error) { + funcref := get_InotifyInitAddr() + if funcptrtest(GetZosLibVec()+SYS_INOTIFY_INIT<<4, "") == 0 { + *funcref = impl_InotifyInit + } else { + *funcref = error_InotifyInit } + return (*funcref)() +} + +func error_InotifyInit() (fd int, err error) { + fd = -1 + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getppid() (pid int) { - r0, _, _ := syscall_rawsyscall(SYS_GETPPID, 0, 0, 0) - pid = int(r0) +func impl_InotifyInit1(flags int) (fd int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_INOTIFY_INIT1<<4, uintptr(flags)) + runtime.ExitSyscall() + fd = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_InotifyInit1Addr() *(func(flags int) (fd int, err error)) + +var InotifyInit1 = enter_InotifyInit1 + +func enter_InotifyInit1(flags int) (fd int, err error) { + funcref := get_InotifyInit1Addr() + if funcptrtest(GetZosLibVec()+SYS_INOTIFY_INIT1<<4, "") == 0 { + *funcref = impl_InotifyInit1 + } else { + *funcref = error_InotifyInit1 + } + return (*funcref)(flags) +} + +func error_InotifyInit1(flags int) (fd int, err error) { + fd = -1 + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(pathname) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___INOTIFY_ADD_WATCH_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) + runtime.ExitSyscall() + watchdesc = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_InotifyAddWatchAddr() *(func(fd int, pathname string, mask uint32) (watchdesc int, err error)) + +var InotifyAddWatch = enter_InotifyAddWatch + +func enter_InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { + funcref := get_InotifyAddWatchAddr() + if funcptrtest(GetZosLibVec()+SYS___INOTIFY_ADD_WATCH_A<<4, "") == 0 { + *funcref = impl_InotifyAddWatch + } else { + *funcref = error_InotifyAddWatch + } + return (*funcref)(fd, pathname, mask) +} + +func error_InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { + watchdesc = -1 + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_INOTIFY_RM_WATCH<<4, uintptr(fd), uintptr(watchdesc)) + runtime.ExitSyscall() + success = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_InotifyRmWatchAddr() *(func(fd int, watchdesc uint32) (success int, err error)) + +var InotifyRmWatch = enter_InotifyRmWatch + +func enter_InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { + funcref := get_InotifyRmWatchAddr() + if funcptrtest(GetZosLibVec()+SYS_INOTIFY_RM_WATCH<<4, "") == 0 { + *funcref = impl_InotifyRmWatch + } else { + *funcref = error_InotifyRmWatch + } + return (*funcref)(fd, watchdesc) +} + +func error_InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { + success = -1 + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Listxattr(path string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LISTXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) + runtime.ExitSyscall() + sz = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_ListxattrAddr() *(func(path string, dest []byte) (sz int, err error)) + +var Listxattr = enter_Listxattr + +func enter_Listxattr(path string, dest []byte) (sz int, err error) { + funcref := get_ListxattrAddr() + if funcptrtest(GetZosLibVec()+SYS___LISTXATTR_A<<4, "") == 0 { + *funcref = impl_Listxattr + } else { + *funcref = error_Listxattr + } + return (*funcref)(path, dest) +} + +func error_Listxattr(path string, dest []byte) (sz int, err error) { + sz = -1 + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Llistxattr(path string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LLISTXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) + runtime.ExitSyscall() + sz = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_LlistxattrAddr() *(func(path string, dest []byte) (sz int, err error)) + +var Llistxattr = enter_Llistxattr + +func enter_Llistxattr(path string, dest []byte) (sz int, err error) { + funcref := get_LlistxattrAddr() + if funcptrtest(GetZosLibVec()+SYS___LLISTXATTR_A<<4, "") == 0 { + *funcref = impl_Llistxattr + } else { + *funcref = error_Llistxattr + } + return (*funcref)(path, dest) +} + +func error_Llistxattr(path string, dest []byte) (sz int, err error) { + sz = -1 + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Lremovexattr(path string, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LREMOVEXATTR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_LremovexattrAddr() *(func(path string, attr string) (err error)) + +var Lremovexattr = enter_Lremovexattr + +func enter_Lremovexattr(path string, attr string) (err error) { + funcref := get_LremovexattrAddr() + if funcptrtest(GetZosLibVec()+SYS___LREMOVEXATTR_A<<4, "") == 0 { + *funcref = impl_Lremovexattr + } else { + *funcref = error_Lremovexattr + } + return (*funcref)(path, attr) +} + +func error_Lremovexattr(path string, attr string) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Lutimes(path string, tv []Timeval) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(tv) > 0 { + _p1 = unsafe.Pointer(&tv[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LUTIMES_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(tv))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_LutimesAddr() *(func(path string, tv []Timeval) (err error)) + +var Lutimes = enter_Lutimes + +func enter_Lutimes(path string, tv []Timeval) (err error) { + funcref := get_LutimesAddr() + if funcptrtest(GetZosLibVec()+SYS___LUTIMES_A<<4, "") == 0 { + *funcref = impl_Lutimes + } else { + *funcref = error_Lutimes + } + return (*funcref)(path, tv) +} + +func error_Lutimes(path string, tv []Timeval) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mprotect(b []byte, prot int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_MPROTECT<<4, uintptr(_p0), uintptr(len(b)), uintptr(prot)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Msync(b []byte, flags int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_MSYNC<<4, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Console2(cmsg *ConsMsg2, modstr *byte, concmd *uint32) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CONSOLE2<<4, uintptr(unsafe.Pointer(cmsg)), uintptr(unsafe.Pointer(modstr)), uintptr(unsafe.Pointer(concmd))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Poll(fds []PollFd, timeout int) (n int, err error) { + var _p0 unsafe.Pointer + if len(fds) > 0 { + _p0 = unsafe.Pointer(&fds[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_POLL<<4, uintptr(_p0), uintptr(len(fds)), uintptr(timeout)) + runtime.ExitSyscall() + n = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Readdir_r(dirp uintptr, entry *direntLE, result **direntLE) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___READDIR_R_A<<4, uintptr(dirp), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Statfs(path string, buf *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___STATFS_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_StatfsAddr() *(func(path string, buf *Statfs_t) (err error)) + +var Statfs = enter_Statfs + +func enter_Statfs(path string, buf *Statfs_t) (err error) { + funcref := get_StatfsAddr() + if funcptrtest(GetZosLibVec()+SYS___STATFS_A<<4, "") == 0 { + *funcref = impl_Statfs + } else { + *funcref = error_Statfs + } + return (*funcref)(path, buf) +} + +func error_Statfs(path string, buf *Statfs_t) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Syncfs(fd int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SYNCFS<<4, uintptr(fd)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_SyncfsAddr() *(func(fd int) (err error)) + +var Syncfs = enter_Syncfs + +func enter_Syncfs(fd int) (err error) { + funcref := get_SyncfsAddr() + if funcptrtest(GetZosLibVec()+SYS_SYNCFS<<4, "") == 0 { + *funcref = impl_Syncfs + } else { + *funcref = error_Syncfs + } + return (*funcref)(fd) +} + +func error_Syncfs(fd int) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Times(tms *Tms) (ticks uintptr, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_TIMES<<4, uintptr(unsafe.Pointer(tms))) + runtime.ExitSyscall() + ticks = uintptr(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func W_Getmntent(buff *byte, size int) (lastsys int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_W_GETMNTENT<<4, uintptr(unsafe.Pointer(buff)), uintptr(size)) + runtime.ExitSyscall() + lastsys = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func W_Getmntent_A(buff *byte, size int) (lastsys int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___W_GETMNTENT_A<<4, uintptr(unsafe.Pointer(buff)), uintptr(size)) + runtime.ExitSyscall() + lastsys = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mount_LE(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(filesystem) + if err != nil { + return + } + var _p2 *byte + _p2, err = BytePtrFromString(fstype) + if err != nil { + return + } + var _p3 *byte + _p3, err = BytePtrFromString(parm) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MOUNT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(mtm), uintptr(parmlen), uintptr(unsafe.Pointer(_p3))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func unmount_LE(filesystem string, mtm int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(filesystem) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UMOUNT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mtm)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chroot(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CHROOT_A<<4, uintptr(unsafe.Pointer(_p0))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Select(nmsgsfds int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (ret int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SELECT<<4, uintptr(nmsgsfds), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout))) + runtime.ExitSyscall() + ret = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Uname(buf *Utsname) (err error) { + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_____OSNAME_A<<4, uintptr(unsafe.Pointer(buf))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Unshare(flags int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_UNSHARE<<4, uintptr(flags)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_UnshareAddr() *(func(flags int) (err error)) + +var Unshare = enter_Unshare + +func enter_Unshare(flags int) (err error) { + funcref := get_UnshareAddr() + if funcptrtest(GetZosLibVec()+SYS_UNSHARE<<4, "") == 0 { + *funcref = impl_Unshare + } else { + *funcref = error_Unshare + } + return (*funcref)(flags) +} + +func error_Unshare(flags int) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Gethostname(buf []byte) (err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___GETHOSTNAME_A<<4, uintptr(_p0), uintptr(len(buf))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getgid() (gid int) { + r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETGID<<4) + gid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpid() (pid int) { + r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETPID<<4) + pid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgid(pid int) (pgid int, err error) { + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETPGID<<4, uintptr(pid)) + pgid = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getppid() (pid int) { + r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETPPID<<4) + pid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpriority(which int, who int) (prio int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETPRIORITY<<4, uintptr(which), uintptr(who)) + runtime.ExitSyscall() + prio = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrlimit(resource int, rlim *Rlimit) (err error) { + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETRLIMIT<<4, uintptr(resource), uintptr(unsafe.Pointer(rlim))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getrusage(who int, rusage *rusage_zos) (err error) { + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETRUSAGE<<4, uintptr(who), uintptr(unsafe.Pointer(rusage))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getegid() (egid int) { + runtime.EnterSyscall() + r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETEGID<<4) + runtime.ExitSyscall() + egid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Geteuid() (euid int) { + runtime.EnterSyscall() + r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETEUID<<4) + runtime.ExitSyscall() + euid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getsid(pid int) (sid int, err error) { + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETSID<<4, uintptr(pid)) + sid = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getuid() (uid int) { + r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETUID<<4) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Kill(pid int, sig Signal) (err error) { + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_KILL<<4, uintptr(pid), uintptr(sig)) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lchown(path string, uid int, gid int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LCHOWN_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Link(path string, link string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LINK_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Linkat(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldPath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newPath) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LINKAT_A<<4, uintptr(oldDirFd), uintptr(unsafe.Pointer(_p0)), uintptr(newDirFd), uintptr(unsafe.Pointer(_p1)), uintptr(flags)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_LinkatAddr() *(func(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error)) + +var Linkat = enter_Linkat + +func enter_Linkat(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error) { + funcref := get_LinkatAddr() + if funcptrtest(GetZosLibVec()+SYS___LINKAT_A<<4, "") == 0 { + *funcref = impl_Linkat + } else { + *funcref = error_Linkat + } + return (*funcref)(oldDirFd, oldPath, newDirFd, newPath, flags) +} + +func error_Linkat(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Listen(s int, n int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_LISTEN<<4, uintptr(s), uintptr(n)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func lstat(path string, stat *Stat_LE_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LSTAT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdir(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKDIR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKDIRAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_MkdiratAddr() *(func(dirfd int, path string, mode uint32) (err error)) + +var Mkdirat = enter_Mkdirat + +func enter_Mkdirat(dirfd int, path string, mode uint32) (err error) { + funcref := get_MkdiratAddr() + if funcptrtest(GetZosLibVec()+SYS___MKDIRAT_A<<4, "") == 0 { + *funcref = impl_Mkdirat + } else { + *funcref = error_Mkdirat + } + return (*funcref)(dirfd, path, mode) +} + +func error_Mkdirat(dirfd int, path string, mode uint32) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkfifo(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKFIFO_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mknod(path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKNOD_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKNODAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_MknodatAddr() *(func(dirfd int, path string, mode uint32, dev int) (err error)) + +var Mknodat = enter_Mknodat + +func enter_Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { + funcref := get_MknodatAddr() + if funcptrtest(GetZosLibVec()+SYS___MKNODAT_A<<4, "") == 0 { + *funcref = impl_Mknodat + } else { + *funcref = error_Mknodat + } + return (*funcref)(dirfd, path, mode, dev) +} + +func error_Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_PivotRoot(newroot string, oldroot string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(newroot) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(oldroot) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___PIVOT_ROOT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_PivotRootAddr() *(func(newroot string, oldroot string) (err error)) + +var PivotRoot = enter_PivotRoot + +func enter_PivotRoot(newroot string, oldroot string) (err error) { + funcref := get_PivotRootAddr() + if funcptrtest(GetZosLibVec()+SYS___PIVOT_ROOT_A<<4, "") == 0 { + *funcref = impl_PivotRoot + } else { + *funcref = error_PivotRoot + } + return (*funcref)(newroot, oldroot) +} + +func error_PivotRoot(newroot string, oldroot string) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pread(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PREAD<<4, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset)) + runtime.ExitSyscall() + n = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getpriority(which int, who int) (prio int, err error) { - r0, _, e1 := syscall_syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) - prio = int(r0) - if e1 != 0 { - err = errnoErr(e1) +func Pwrite(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PWRITE<<4, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset)) + runtime.ExitSyscall() + n = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getrlimit(resource int, rlim *Rlimit) (err error) { - _, _, e1 := syscall_rawsyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) - if e1 != 0 { - err = errnoErr(e1) +func impl_Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___PRCTL_A<<4, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_PrctlAddr() *(func(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)) -func getrusage(who int, rusage *rusage_zos) (err error) { - _, _, e1 := syscall_rawsyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) - if e1 != 0 { - err = errnoErr(e1) +var Prctl = enter_Prctl + +func enter_Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { + funcref := get_PrctlAddr() + if funcptrtest(GetZosLibVec()+SYS___PRCTL_A<<4, "") == 0 { + *funcref = impl_Prctl + } else { + *funcref = error_Prctl } - return + return (*funcref)(option, arg2, arg3, arg4, arg5) } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Getsid(pid int) (sid int, err error) { - r0, _, e1 := syscall_rawsyscall(SYS_GETSID, uintptr(pid), 0, 0) - sid = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } +func error_Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getuid() (uid int) { - r0, _, _ := syscall_rawsyscall(SYS_GETUID, 0, 0, 0) - uid = int(r0) +func impl_Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PRLIMIT<<4, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_PrlimitAddr() *(func(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error)) -func Kill(pid int, sig Signal) (err error) { - _, _, e1 := syscall_rawsyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) - if e1 != 0 { - err = errnoErr(e1) +var Prlimit = enter_Prlimit + +func enter_Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { + funcref := get_PrlimitAddr() + if funcptrtest(GetZosLibVec()+SYS_PRLIMIT<<4, "") == 0 { + *funcref = impl_Prlimit + } else { + *funcref = error_Prlimit } + return (*funcref)(pid, resource, newlimit, old) +} + +func error_Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Lchown(path string, uid int, gid int) (err error) { +func Rename(from string, to string) (err error) { var _p0 *byte - _p0, err = BytePtrFromString(path) + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) if err != nil { return } - _, _, e1 := syscall_syscall(SYS___LCHOWN_A, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RENAME_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Link(path string, link string) (err error) { +func impl_Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte - _p0, err = BytePtrFromString(path) + _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte - _p1, err = BytePtrFromString(link) + _p1, err = BytePtrFromString(newpath) if err != nil { return } - _, _, e1 := syscall_syscall(SYS___LINK_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RENAMEAT_A<<4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_RenameatAddr() *(func(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)) -func Listen(s int, n int) (err error) { - _, _, e1 := syscall_syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) - if e1 != 0 { - err = errnoErr(e1) +var Renameat = enter_Renameat + +func enter_Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { + funcref := get_RenameatAddr() + if funcptrtest(GetZosLibVec()+SYS___RENAMEAT_A<<4, "") == 0 { + *funcref = impl_Renameat + } else { + *funcref = error_Renameat } + return (*funcref)(olddirfd, oldpath, newdirfd, newpath) +} + +func error_Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func lstat(path string, stat *Stat_LE_t) (err error) { +func impl_Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { var _p0 *byte - _p0, err = BytePtrFromString(path) + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) if err != nil { return } - _, _, e1 := syscall_syscall(SYS___LSTAT_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RENAMEAT2_A<<4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_Renameat2Addr() *(func(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error)) -func Mkdir(path string, mode uint32) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall_syscall(SYS___MKDIR_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - if e1 != 0 { - err = errnoErr(e1) +var Renameat2 = enter_Renameat2 + +func enter_Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + funcref := get_Renameat2Addr() + if funcptrtest(GetZosLibVec()+SYS___RENAMEAT2_A<<4, "") == 0 { + *funcref = impl_Renameat2 + } else { + *funcref = error_Renameat2 } + return (*funcref)(olddirfd, oldpath, newdirfd, newpath, flags) +} + +func error_Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Mkfifo(path string, mode uint32) (err error) { +func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } - _, _, e1 := syscall_syscall(SYS___MKFIFO_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RMDIR_A<<4, uintptr(unsafe.Pointer(_p0))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Mknod(path string, mode uint32, dev int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall_syscall(SYS___MKNOD_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - if e1 != 0 { - err = errnoErr(e1) +func Seek(fd int, offset int64, whence int) (off int64, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_LSEEK<<4, uintptr(fd), uintptr(offset), uintptr(whence)) + runtime.ExitSyscall() + off = int64(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { - var _p0 unsafe.Pointer - if len(p) > 0 { - _p0 = unsafe.Pointer(&p[0]) - } else { - _p0 = unsafe.Pointer(&_zero) +func Setegid(egid int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETEGID<<4, uintptr(egid)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } - r0, _, e1 := syscall_syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seteuid(euid int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETEUID<<4, uintptr(euid)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func impl_Sethostname(p []byte) (err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := syscall_syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SETHOSTNAME_A<<4, uintptr(_p0), uintptr(len(p))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_SethostnameAddr() *(func(p []byte) (err error)) -func Readlink(path string, buf []byte) (n int, err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(buf) > 0 { - _p1 = unsafe.Pointer(&buf[0]) +var Sethostname = enter_Sethostname + +func enter_Sethostname(p []byte) (err error) { + funcref := get_SethostnameAddr() + if funcptrtest(GetZosLibVec()+SYS___SETHOSTNAME_A<<4, "") == 0 { + *funcref = impl_Sethostname } else { - _p1 = unsafe.Pointer(&_zero) + *funcref = error_Sethostname } - r0, _, e1 := syscall_syscall(SYS___READLINK_A, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return + return (*funcref)(p) } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Rename(from string, to string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(from) - if err != nil { - return - } - var _p1 *byte - _p1, err = BytePtrFromString(to) - if err != nil { - return - } - _, _, e1 := syscall_syscall(SYS___RENAME_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - if e1 != 0 { - err = errnoErr(e1) - } +func error_Sethostname(p []byte) (err error) { + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Rmdir(path string) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall_syscall(SYS___RMDIR_A, uintptr(unsafe.Pointer(_p0)), 0, 0) - if e1 != 0 { - err = errnoErr(e1) +func impl_Setns(fd int, nstype int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETNS<<4, uintptr(fd), uintptr(nstype)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_SetnsAddr() *(func(fd int, nstype int) (err error)) -func Seek(fd int, offset int64, whence int) (off int64, err error) { - r0, _, e1 := syscall_syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) - off = int64(r0) - if e1 != 0 { - err = errnoErr(e1) +var Setns = enter_Setns + +func enter_Setns(fd int, nstype int) (err error) { + funcref := get_SetnsAddr() + if funcptrtest(GetZosLibVec()+SYS_SETNS<<4, "") == 0 { + *funcref = impl_Setns + } else { + *funcref = error_Setns } + return (*funcref)(fd, nstype) +} + +func error_Setns(fd int, nstype int) (err error) { + err = ENOSYS return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { - _, _, e1 := syscall_syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETPRIORITY<<4, uintptr(which), uintptr(who), uintptr(prio)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -971,9 +2910,9 @@ func Setpriority(which int, who int, prio int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { - _, _, e1 := syscall_rawsyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) - if e1 != 0 { - err = errnoErr(e1) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETPGID<<4, uintptr(pid), uintptr(pgid)) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -981,9 +2920,9 @@ func Setpgid(pid int, pgid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(resource int, lim *Rlimit) (err error) { - _, _, e1 := syscall_rawsyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(lim)), 0) - if e1 != 0 { - err = errnoErr(e1) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETRLIMIT<<4, uintptr(resource), uintptr(unsafe.Pointer(lim))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -991,9 +2930,9 @@ func Setrlimit(resource int, lim *Rlimit) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { - _, _, e1 := syscall_rawsyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) - if e1 != 0 { - err = errnoErr(e1) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETREGID<<4, uintptr(rgid), uintptr(egid)) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -1001,9 +2940,9 @@ func Setregid(rgid int, egid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { - _, _, e1 := syscall_rawsyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) - if e1 != 0 { - err = errnoErr(e1) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETREUID<<4, uintptr(ruid), uintptr(euid)) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -1011,10 +2950,10 @@ func Setreuid(ruid int, euid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { - r0, _, e1 := syscall_rawsyscall(SYS_SETSID, 0, 0, 0) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec() + SYS_SETSID<<4) pid = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -1022,9 +2961,11 @@ func Setsid() (pid int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { - _, _, e1 := syscall_syscall(SYS_SETUID, uintptr(uid), 0, 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETUID<<4, uintptr(uid)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -1032,9 +2973,11 @@ func Setuid(uid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(uid int) (err error) { - _, _, e1 := syscall_syscall(SYS_SETGID, uintptr(uid), 0, 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETGID<<4, uintptr(uid)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -1042,9 +2985,11 @@ func Setgid(uid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { - _, _, e1 := syscall_syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SHUTDOWN<<4, uintptr(fd), uintptr(how)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -1057,9 +3002,11 @@ func stat(path string, statLE *Stat_LE_t) (err error) { if err != nil { return } - _, _, e1 := syscall_syscall(SYS___STAT_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(statLE)), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___STAT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(statLE))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -1077,17 +3024,63 @@ func Symlink(path string, link string) (err error) { if err != nil { return } - _, _, e1 := syscall_syscall(SYS___SYMLINK_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SYMLINK_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Symlinkat(oldPath string, dirfd int, newPath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldPath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newPath) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SYMLINKAT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(dirfd), uintptr(unsafe.Pointer(_p1))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } +//go:nosplit +func get_SymlinkatAddr() *(func(oldPath string, dirfd int, newPath string) (err error)) + +var Symlinkat = enter_Symlinkat + +func enter_Symlinkat(oldPath string, dirfd int, newPath string) (err error) { + funcref := get_SymlinkatAddr() + if funcptrtest(GetZosLibVec()+SYS___SYMLINKAT_A<<4, "") == 0 { + *funcref = impl_Symlinkat + } else { + *funcref = error_Symlinkat + } + return (*funcref)(oldPath, dirfd, newPath) +} + +func error_Symlinkat(oldPath string, dirfd int, newPath string) (err error) { + err = ENOSYS + return +} + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() { - syscall_syscall(SYS_SYNC, 0, 0, 0) + runtime.EnterSyscall() + CallLeFuncWithErr(GetZosLibVec() + SYS_SYNC<<4) + runtime.ExitSyscall() return } @@ -1099,9 +3092,11 @@ func Truncate(path string, length int64) (err error) { if err != nil { return } - _, _, e1 := syscall_syscall(SYS___TRUNCATE_A, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___TRUNCATE_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(length)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -1109,9 +3104,11 @@ func Truncate(path string, length int64) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tcgetattr(fildes int, termptr *Termios) (err error) { - _, _, e1 := syscall_syscall(SYS_TCGETATTR, uintptr(fildes), uintptr(unsafe.Pointer(termptr)), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_TCGETATTR<<4, uintptr(fildes), uintptr(unsafe.Pointer(termptr))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -1119,9 +3116,11 @@ func Tcgetattr(fildes int, termptr *Termios) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tcsetattr(fildes int, when int, termptr *Termios) (err error) { - _, _, e1 := syscall_syscall(SYS_TCSETATTR, uintptr(fildes), uintptr(when), uintptr(unsafe.Pointer(termptr))) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_TCSETATTR<<4, uintptr(fildes), uintptr(when), uintptr(unsafe.Pointer(termptr))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -1129,7 +3128,9 @@ func Tcsetattr(fildes int, when int, termptr *Termios) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(mask int) (oldmask int) { - r0, _, _ := syscall_syscall(SYS_UMASK, uintptr(mask), 0, 0) + runtime.EnterSyscall() + r0, _, _ := CallLeFuncWithErr(GetZosLibVec()+SYS_UMASK<<4, uintptr(mask)) + runtime.ExitSyscall() oldmask = int(r0) return } @@ -1142,10 +3143,49 @@ func Unlink(path string) (err error) { if err != nil { return } - _, _, e1 := syscall_syscall(SYS___UNLINK_A, uintptr(unsafe.Pointer(_p0)), 0, 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UNLINK_A<<4, uintptr(unsafe.Pointer(_p0))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UNLINKAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_UnlinkatAddr() *(func(dirfd int, path string, flags int) (err error)) + +var Unlinkat = enter_Unlinkat + +func enter_Unlinkat(dirfd int, path string, flags int) (err error) { + funcref := get_UnlinkatAddr() + if funcptrtest(GetZosLibVec()+SYS___UNLINKAT_A<<4, "") == 0 { + *funcref = impl_Unlinkat + } else { + *funcref = error_Unlinkat } + return (*funcref)(dirfd, path, flags) +} + +func error_Unlinkat(dirfd int, path string, flags int) (err error) { + err = ENOSYS return } @@ -1157,9 +3197,11 @@ func Utime(path string, utim *Utimbuf) (err error) { if err != nil { return } - _, _, e1 := syscall_syscall(SYS___UTIME_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(utim)), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UTIME_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(utim))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -1172,11 +3214,91 @@ func open(path string, mode int, perm uint32) (fd int, err error) { if err != nil { return } - r0, _, e1 := syscall_syscall(SYS___OPEN_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___OPEN_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) + runtime.ExitSyscall() + fd = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___OPENAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode)) + runtime.ExitSyscall() + fd = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_openatAddr() *(func(dirfd int, path string, flags int, mode uint32) (fd int, err error)) + +var openat = enter_openat + +func enter_openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { + funcref := get_openatAddr() + if funcptrtest(GetZosLibVec()+SYS___OPENAT_A<<4, "") == 0 { + *funcref = impl_openat + } else { + *funcref = error_openat + } + return (*funcref)(dirfd, path, flags, mode) +} + +func error_openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { + fd = -1 + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_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 + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___OPENAT2_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(open_how)), uintptr(size)) + runtime.ExitSyscall() fd = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_openat2Addr() *(func(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error)) + +var openat2 = enter_openat2 + +func enter_openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) { + funcref := get_openat2Addr() + if funcptrtest(GetZosLibVec()+SYS___OPENAT2_A<<4, "") == 0 { + *funcref = impl_openat2 + } else { + *funcref = error_openat2 } + return (*funcref)(dirfd, path, open_how, size) +} + +func error_openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) { + fd = -1 + err = ENOSYS return } @@ -1188,9 +3310,23 @@ func remove(path string) (err error) { if err != nil { return } - _, _, e1 := syscall_syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_REMOVE<<4, uintptr(unsafe.Pointer(_p0))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func waitid(idType int, id int, info *Siginfo, options int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_WAITID<<4, uintptr(idType), uintptr(id), uintptr(unsafe.Pointer(info)), uintptr(options)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -1198,10 +3334,12 @@ func remove(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func waitpid(pid int, wstatus *_C_int, options int) (wpid int, err error) { - r0, _, e1 := syscall_syscall(SYS_WAITPID, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options)) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_WAITPID<<4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options)) + runtime.ExitSyscall() wpid = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -1209,9 +3347,9 @@ func waitpid(pid int, wstatus *_C_int, options int) (wpid int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func gettimeofday(tv *timeval_zos) (err error) { - _, _, e1 := syscall_rawsyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) - if e1 != 0 { - err = errnoErr(e1) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETTIMEOFDAY<<4, uintptr(unsafe.Pointer(tv))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -1219,9 +3357,9 @@ func gettimeofday(tv *timeval_zos) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]_C_int) (err error) { - _, _, e1 := syscall_rawsyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) - if e1 != 0 { - err = errnoErr(e1) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PIPE<<4, uintptr(unsafe.Pointer(p))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } @@ -1234,20 +3372,87 @@ func utimes(path string, timeval *[2]Timeval) (err error) { if err != nil { return } - _, _, e1 := syscall_syscall(SYS___UTIMES_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UTIMES_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Select(nmsgsfds int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (ret int, err error) { - r0, _, e1 := syscall_syscall6(SYS_SELECT, uintptr(nmsgsfds), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) - ret = int(r0) - if e1 != 0 { - err = errnoErr(e1) +func impl_utimensat(dirfd int, path string, ts *[2]Timespec, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UTIMENSAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(ts)), uintptr(flags)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +//go:nosplit +func get_utimensatAddr() *(func(dirfd int, path string, ts *[2]Timespec, flags int) (err error)) + +var utimensat = enter_utimensat + +func enter_utimensat(dirfd int, path string, ts *[2]Timespec, flags int) (err error) { + funcref := get_utimensatAddr() + if funcptrtest(GetZosLibVec()+SYS___UTIMENSAT_A<<4, "") == 0 { + *funcref = impl_utimensat + } else { + *funcref = error_utimensat + } + return (*funcref)(dirfd, path, ts, flags) +} + +func error_utimensat(dirfd int, path string, ts *[2]Timespec, flags int) (err error) { + err = ENOSYS + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Posix_openpt(oflag int) (fd int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_POSIX_OPENPT<<4, uintptr(oflag)) + runtime.ExitSyscall() + fd = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Grantpt(fildes int) (rc int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GRANTPT<<4, uintptr(fildes)) + runtime.ExitSyscall() + rc = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlockpt(fildes int) (rc int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_UNLOCKPT<<4, uintptr(fildes)) + runtime.ExitSyscall() + rc = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } return } 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 0cc3ce496e..524b0820cb 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -452,4 +452,10 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 + SYS_STATMOUNT = 457 + SYS_LISTMOUNT = 458 + SYS_LSM_GET_SELF_ATTR = 459 + SYS_LSM_SET_SELF_ATTR = 460 + SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) 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 856d92d69e..d3e38f681a 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -374,4 +374,10 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 + SYS_STATMOUNT = 457 + SYS_LISTMOUNT = 458 + SYS_LSM_GET_SELF_ATTR = 459 + SYS_LSM_SET_SELF_ATTR = 460 + SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) 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 8d467094cf..70b35bf3b0 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -416,4 +416,10 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 + SYS_STATMOUNT = 457 + SYS_LISTMOUNT = 458 + SYS_LSM_GET_SELF_ATTR = 459 + SYS_LSM_SET_SELF_ATTR = 460 + SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) 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 edc173244d..6c778c2327 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -319,4 +319,10 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 + SYS_STATMOUNT = 457 + SYS_LISTMOUNT = 458 + SYS_LSM_GET_SELF_ATTR = 459 + SYS_LSM_SET_SELF_ATTR = 460 + SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go index 445eba2061..37281cf51a 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go @@ -313,4 +313,10 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 + SYS_STATMOUNT = 457 + SYS_LISTMOUNT = 458 + SYS_LSM_GET_SELF_ATTR = 459 + SYS_LSM_SET_SELF_ATTR = 460 + SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) 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 adba01bca7..7e567f1eff 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -436,4 +436,10 @@ const ( SYS_FUTEX_WAKE = 4454 SYS_FUTEX_WAIT = 4455 SYS_FUTEX_REQUEUE = 4456 + SYS_STATMOUNT = 4457 + SYS_LISTMOUNT = 4458 + SYS_LSM_GET_SELF_ATTR = 4459 + SYS_LSM_SET_SELF_ATTR = 4460 + SYS_LSM_LIST_MODULES = 4461 + SYS_MSEAL = 4462 ) 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 014c4e9c7a..38ae55e5ef 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -366,4 +366,10 @@ const ( SYS_FUTEX_WAKE = 5454 SYS_FUTEX_WAIT = 5455 SYS_FUTEX_REQUEUE = 5456 + SYS_STATMOUNT = 5457 + SYS_LISTMOUNT = 5458 + SYS_LSM_GET_SELF_ATTR = 5459 + SYS_LSM_SET_SELF_ATTR = 5460 + SYS_LSM_LIST_MODULES = 5461 + SYS_MSEAL = 5462 ) 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 ccc97d74d0..55e92e60a8 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -366,4 +366,10 @@ const ( SYS_FUTEX_WAKE = 5454 SYS_FUTEX_WAIT = 5455 SYS_FUTEX_REQUEUE = 5456 + SYS_STATMOUNT = 5457 + SYS_LISTMOUNT = 5458 + SYS_LSM_GET_SELF_ATTR = 5459 + SYS_LSM_SET_SELF_ATTR = 5460 + SYS_LSM_LIST_MODULES = 5461 + SYS_MSEAL = 5462 ) 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 ec2b64a95d..60658d6a02 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -436,4 +436,10 @@ const ( SYS_FUTEX_WAKE = 4454 SYS_FUTEX_WAIT = 4455 SYS_FUTEX_REQUEUE = 4456 + SYS_STATMOUNT = 4457 + SYS_LISTMOUNT = 4458 + SYS_LSM_GET_SELF_ATTR = 4459 + SYS_LSM_SET_SELF_ATTR = 4460 + SYS_LSM_LIST_MODULES = 4461 + SYS_MSEAL = 4462 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go index 21a839e338..e203e8a7ed 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -443,4 +443,10 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 + SYS_STATMOUNT = 457 + SYS_LISTMOUNT = 458 + SYS_LSM_GET_SELF_ATTR = 459 + SYS_LSM_SET_SELF_ATTR = 460 + SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) 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 c11121ec3b..5944b97d54 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -415,4 +415,10 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 + SYS_STATMOUNT = 457 + SYS_LISTMOUNT = 458 + SYS_LSM_GET_SELF_ATTR = 459 + SYS_LSM_SET_SELF_ATTR = 460 + SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) 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 909b631fcb..c66d416dad 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -415,4 +415,10 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 + SYS_STATMOUNT = 457 + SYS_LISTMOUNT = 458 + SYS_LSM_GET_SELF_ATTR = 459 + SYS_LSM_SET_SELF_ATTR = 460 + SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) 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 e49bed16ea..9889f6a559 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -320,4 +320,10 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 + SYS_STATMOUNT = 457 + SYS_LISTMOUNT = 458 + SYS_LSM_GET_SELF_ATTR = 459 + SYS_LSM_SET_SELF_ATTR = 460 + SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) 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 66017d2d32..01d86825bb 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -381,4 +381,10 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 + SYS_STATMOUNT = 457 + SYS_LISTMOUNT = 458 + SYS_LSM_GET_SELF_ATTR = 459 + SYS_LSM_SET_SELF_ATTR = 460 + SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) 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 47bab18dce..7b703e77cd 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -394,4 +394,10 @@ const ( SYS_FUTEX_WAKE = 454 SYS_FUTEX_WAIT = 455 SYS_FUTEX_REQUEUE = 456 + SYS_STATMOUNT = 457 + SYS_LISTMOUNT = 458 + SYS_LSM_GET_SELF_ATTR = 459 + SYS_LSM_SET_SELF_ATTR = 460 + SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go index b2e3085819..5e8c263ca9 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go @@ -1,2669 +1,2852 @@ -// Copyright 2020 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 run mksyscall_zos_s390x.go -o_sysnum zsysnum_zos_s390x.go -o_syscall zsyscall_zos_s390x.go -i_syscall syscall_zos_s390x.go -o_asm zsymaddr_zos_s390x.s +// Code generated by the command above; see README.md. DO NOT EDIT. //go:build zos && s390x package unix -// TODO: auto-generate. - const ( - SYS_ACOSD128 = 0xB80 - SYS_ACOSD32 = 0xB7E - SYS_ACOSD64 = 0xB7F - SYS_ACOSHD128 = 0xB83 - SYS_ACOSHD32 = 0xB81 - SYS_ACOSHD64 = 0xB82 - SYS_AIO_FSYNC = 0xC69 - SYS_ASCTIME = 0x0AE - SYS_ASCTIME64 = 0xCD7 - SYS_ASCTIME64_R = 0xCD8 - SYS_ASIND128 = 0xB86 - SYS_ASIND32 = 0xB84 - SYS_ASIND64 = 0xB85 - SYS_ASINHD128 = 0xB89 - SYS_ASINHD32 = 0xB87 - SYS_ASINHD64 = 0xB88 - SYS_ATAN2D128 = 0xB8F - SYS_ATAN2D32 = 0xB8D - SYS_ATAN2D64 = 0xB8E - SYS_ATAND128 = 0xB8C - SYS_ATAND32 = 0xB8A - SYS_ATAND64 = 0xB8B - SYS_ATANHD128 = 0xB92 - SYS_ATANHD32 = 0xB90 - SYS_ATANHD64 = 0xB91 - SYS_BIND2ADDRSEL = 0xD59 - SYS_C16RTOMB = 0xD40 - SYS_C32RTOMB = 0xD41 - SYS_CBRTD128 = 0xB95 - SYS_CBRTD32 = 0xB93 - SYS_CBRTD64 = 0xB94 - SYS_CEILD128 = 0xB98 - SYS_CEILD32 = 0xB96 - SYS_CEILD64 = 0xB97 - SYS_CLEARENV = 0x0C9 - SYS_CLEARERR_UNLOCKED = 0xCA1 - SYS_CLOCK = 0x0AA - SYS_CLOGL = 0xA00 - SYS_CLRMEMF = 0x0BD - SYS_CONJ = 0xA03 - SYS_CONJF = 0xA06 - SYS_CONJL = 0xA09 - SYS_COPYSIGND128 = 0xB9E - SYS_COPYSIGND32 = 0xB9C - SYS_COPYSIGND64 = 0xB9D - SYS_COSD128 = 0xBA1 - SYS_COSD32 = 0xB9F - SYS_COSD64 = 0xBA0 - SYS_COSHD128 = 0xBA4 - SYS_COSHD32 = 0xBA2 - SYS_COSHD64 = 0xBA3 - SYS_CPOW = 0xA0C - SYS_CPOWF = 0xA0F - SYS_CPOWL = 0xA12 - SYS_CPROJ = 0xA15 - SYS_CPROJF = 0xA18 - SYS_CPROJL = 0xA1B - SYS_CREAL = 0xA1E - SYS_CREALF = 0xA21 - SYS_CREALL = 0xA24 - SYS_CSIN = 0xA27 - SYS_CSINF = 0xA2A - SYS_CSINH = 0xA30 - SYS_CSINHF = 0xA33 - SYS_CSINHL = 0xA36 - SYS_CSINL = 0xA2D - SYS_CSNAP = 0x0C5 - SYS_CSQRT = 0xA39 - SYS_CSQRTF = 0xA3C - SYS_CSQRTL = 0xA3F - SYS_CTAN = 0xA42 - SYS_CTANF = 0xA45 - SYS_CTANH = 0xA4B - SYS_CTANHF = 0xA4E - SYS_CTANHL = 0xA51 - SYS_CTANL = 0xA48 - SYS_CTIME = 0x0AB - SYS_CTIME64 = 0xCD9 - SYS_CTIME64_R = 0xCDA - SYS_CTRACE = 0x0C6 - SYS_DIFFTIME = 0x0A7 - SYS_DIFFTIME64 = 0xCDB - SYS_DLADDR = 0xC82 - SYS_DYNALLOC = 0x0C3 - SYS_DYNFREE = 0x0C2 - SYS_ERFCD128 = 0xBAA - SYS_ERFCD32 = 0xBA8 - SYS_ERFCD64 = 0xBA9 - SYS_ERFD128 = 0xBA7 - SYS_ERFD32 = 0xBA5 - SYS_ERFD64 = 0xBA6 - SYS_EXP2D128 = 0xBB0 - SYS_EXP2D32 = 0xBAE - SYS_EXP2D64 = 0xBAF - SYS_EXPD128 = 0xBAD - SYS_EXPD32 = 0xBAB - SYS_EXPD64 = 0xBAC - SYS_EXPM1D128 = 0xBB3 - SYS_EXPM1D32 = 0xBB1 - SYS_EXPM1D64 = 0xBB2 - SYS_FABSD128 = 0xBB6 - SYS_FABSD32 = 0xBB4 - SYS_FABSD64 = 0xBB5 - SYS_FDELREC_UNLOCKED = 0xCA2 - SYS_FDIMD128 = 0xBB9 - SYS_FDIMD32 = 0xBB7 - SYS_FDIMD64 = 0xBB8 - SYS_FDOPEN_UNLOCKED = 0xCFC - SYS_FECLEAREXCEPT = 0xAEA - SYS_FEGETENV = 0xAEB - SYS_FEGETEXCEPTFLAG = 0xAEC - SYS_FEGETROUND = 0xAED - SYS_FEHOLDEXCEPT = 0xAEE - SYS_FEOF_UNLOCKED = 0xCA3 - SYS_FERAISEEXCEPT = 0xAEF - SYS_FERROR_UNLOCKED = 0xCA4 - SYS_FESETENV = 0xAF0 - SYS_FESETEXCEPTFLAG = 0xAF1 - SYS_FESETROUND = 0xAF2 - SYS_FETCHEP = 0x0BF - SYS_FETESTEXCEPT = 0xAF3 - SYS_FEUPDATEENV = 0xAF4 - SYS_FE_DEC_GETROUND = 0xBBA - SYS_FE_DEC_SETROUND = 0xBBB - SYS_FFLUSH_UNLOCKED = 0xCA5 - SYS_FGETC_UNLOCKED = 0xC80 - SYS_FGETPOS64 = 0xCEE - SYS_FGETPOS64_UNLOCKED = 0xCF4 - SYS_FGETPOS_UNLOCKED = 0xCA6 - SYS_FGETS_UNLOCKED = 0xC7C - SYS_FGETWC_UNLOCKED = 0xCA7 - SYS_FGETWS_UNLOCKED = 0xCA8 - SYS_FILENO_UNLOCKED = 0xCA9 - SYS_FLDATA = 0x0C1 - SYS_FLDATA_UNLOCKED = 0xCAA - SYS_FLOCATE_UNLOCKED = 0xCAB - SYS_FLOORD128 = 0xBBE - SYS_FLOORD32 = 0xBBC - SYS_FLOORD64 = 0xBBD - SYS_FMA = 0xA63 - SYS_FMAD128 = 0xBC1 - SYS_FMAD32 = 0xBBF - SYS_FMAD64 = 0xBC0 - SYS_FMAF = 0xA66 - SYS_FMAL = 0xA69 - SYS_FMAX = 0xA6C - SYS_FMAXD128 = 0xBC4 - SYS_FMAXD32 = 0xBC2 - SYS_FMAXD64 = 0xBC3 - SYS_FMAXF = 0xA6F - SYS_FMAXL = 0xA72 - SYS_FMIN = 0xA75 - SYS_FMIND128 = 0xBC7 - SYS_FMIND32 = 0xBC5 - SYS_FMIND64 = 0xBC6 - SYS_FMINF = 0xA78 - SYS_FMINL = 0xA7B - SYS_FMODD128 = 0xBCA - SYS_FMODD32 = 0xBC8 - SYS_FMODD64 = 0xBC9 - SYS_FOPEN64 = 0xD49 - SYS_FOPEN64_UNLOCKED = 0xD4A - SYS_FOPEN_UNLOCKED = 0xCFA - SYS_FPRINTF_UNLOCKED = 0xCAC - SYS_FPUTC_UNLOCKED = 0xC81 - SYS_FPUTS_UNLOCKED = 0xC7E - SYS_FPUTWC_UNLOCKED = 0xCAD - SYS_FPUTWS_UNLOCKED = 0xCAE - SYS_FREAD_NOUPDATE = 0xCEC - SYS_FREAD_NOUPDATE_UNLOCKED = 0xCED - SYS_FREAD_UNLOCKED = 0xC7B - SYS_FREEIFADDRS = 0xCE6 - SYS_FREOPEN64 = 0xD4B - SYS_FREOPEN64_UNLOCKED = 0xD4C - SYS_FREOPEN_UNLOCKED = 0xCFB - SYS_FREXPD128 = 0xBCE - SYS_FREXPD32 = 0xBCC - SYS_FREXPD64 = 0xBCD - SYS_FSCANF_UNLOCKED = 0xCAF - SYS_FSEEK64 = 0xCEF - SYS_FSEEK64_UNLOCKED = 0xCF5 - SYS_FSEEKO64 = 0xCF0 - SYS_FSEEKO64_UNLOCKED = 0xCF6 - SYS_FSEEKO_UNLOCKED = 0xCB1 - SYS_FSEEK_UNLOCKED = 0xCB0 - SYS_FSETPOS64 = 0xCF1 - SYS_FSETPOS64_UNLOCKED = 0xCF7 - SYS_FSETPOS_UNLOCKED = 0xCB3 - SYS_FTELL64 = 0xCF2 - SYS_FTELL64_UNLOCKED = 0xCF8 - SYS_FTELLO64 = 0xCF3 - SYS_FTELLO64_UNLOCKED = 0xCF9 - SYS_FTELLO_UNLOCKED = 0xCB5 - SYS_FTELL_UNLOCKED = 0xCB4 - SYS_FUPDATE = 0x0B5 - SYS_FUPDATE_UNLOCKED = 0xCB7 - SYS_FWIDE_UNLOCKED = 0xCB8 - SYS_FWPRINTF_UNLOCKED = 0xCB9 - SYS_FWRITE_UNLOCKED = 0xC7A - SYS_FWSCANF_UNLOCKED = 0xCBA - SYS_GETDATE64 = 0xD4F - SYS_GETIFADDRS = 0xCE7 - SYS_GETIPV4SOURCEFILTER = 0xC77 - SYS_GETSOURCEFILTER = 0xC79 - SYS_GETSYNTX = 0x0FD - SYS_GETS_UNLOCKED = 0xC7D - SYS_GETTIMEOFDAY64 = 0xD50 - SYS_GETWCHAR_UNLOCKED = 0xCBC - SYS_GETWC_UNLOCKED = 0xCBB - SYS_GMTIME = 0x0B0 - SYS_GMTIME64 = 0xCDC - SYS_GMTIME64_R = 0xCDD - SYS_HYPOTD128 = 0xBD1 - SYS_HYPOTD32 = 0xBCF - SYS_HYPOTD64 = 0xBD0 - SYS_ILOGBD128 = 0xBD4 - SYS_ILOGBD32 = 0xBD2 - SYS_ILOGBD64 = 0xBD3 - SYS_ILOGBF = 0xA7E - SYS_ILOGBL = 0xA81 - SYS_INET6_IS_SRCADDR = 0xD5A - SYS_ISBLANK = 0x0FE - SYS_ISWALNUM = 0x0FF - SYS_LDEXPD128 = 0xBD7 - SYS_LDEXPD32 = 0xBD5 - SYS_LDEXPD64 = 0xBD6 - SYS_LGAMMAD128 = 0xBDA - SYS_LGAMMAD32 = 0xBD8 - SYS_LGAMMAD64 = 0xBD9 - SYS_LIO_LISTIO = 0xC6A - SYS_LLRINT = 0xA84 - SYS_LLRINTD128 = 0xBDD - SYS_LLRINTD32 = 0xBDB - SYS_LLRINTD64 = 0xBDC - SYS_LLRINTF = 0xA87 - SYS_LLRINTL = 0xA8A - SYS_LLROUND = 0xA8D - SYS_LLROUNDD128 = 0xBE0 - SYS_LLROUNDD32 = 0xBDE - SYS_LLROUNDD64 = 0xBDF - SYS_LLROUNDF = 0xA90 - SYS_LLROUNDL = 0xA93 - SYS_LOCALTIM = 0x0B1 - SYS_LOCALTIME = 0x0B1 - SYS_LOCALTIME64 = 0xCDE - SYS_LOCALTIME64_R = 0xCDF - SYS_LOG10D128 = 0xBE6 - SYS_LOG10D32 = 0xBE4 - SYS_LOG10D64 = 0xBE5 - SYS_LOG1PD128 = 0xBE9 - SYS_LOG1PD32 = 0xBE7 - SYS_LOG1PD64 = 0xBE8 - SYS_LOG2D128 = 0xBEC - SYS_LOG2D32 = 0xBEA - SYS_LOG2D64 = 0xBEB - SYS_LOGBD128 = 0xBEF - SYS_LOGBD32 = 0xBED - SYS_LOGBD64 = 0xBEE - SYS_LOGBF = 0xA96 - SYS_LOGBL = 0xA99 - SYS_LOGD128 = 0xBE3 - SYS_LOGD32 = 0xBE1 - SYS_LOGD64 = 0xBE2 - SYS_LRINT = 0xA9C - SYS_LRINTD128 = 0xBF2 - SYS_LRINTD32 = 0xBF0 - SYS_LRINTD64 = 0xBF1 - SYS_LRINTF = 0xA9F - SYS_LRINTL = 0xAA2 - SYS_LROUNDD128 = 0xBF5 - SYS_LROUNDD32 = 0xBF3 - SYS_LROUNDD64 = 0xBF4 - SYS_LROUNDL = 0xAA5 - SYS_MBLEN = 0x0AF - SYS_MBRTOC16 = 0xD42 - SYS_MBRTOC32 = 0xD43 - SYS_MEMSET = 0x0A3 - SYS_MKTIME = 0x0AC - SYS_MKTIME64 = 0xCE0 - SYS_MODFD128 = 0xBF8 - SYS_MODFD32 = 0xBF6 - SYS_MODFD64 = 0xBF7 - SYS_NAN = 0xAA8 - SYS_NAND128 = 0xBFB - SYS_NAND32 = 0xBF9 - SYS_NAND64 = 0xBFA - SYS_NANF = 0xAAA - SYS_NANL = 0xAAC - SYS_NEARBYINT = 0xAAE - SYS_NEARBYINTD128 = 0xBFE - SYS_NEARBYINTD32 = 0xBFC - SYS_NEARBYINTD64 = 0xBFD - SYS_NEARBYINTF = 0xAB1 - SYS_NEARBYINTL = 0xAB4 - SYS_NEXTAFTERD128 = 0xC01 - SYS_NEXTAFTERD32 = 0xBFF - SYS_NEXTAFTERD64 = 0xC00 - SYS_NEXTAFTERF = 0xAB7 - SYS_NEXTAFTERL = 0xABA - SYS_NEXTTOWARD = 0xABD - SYS_NEXTTOWARDD128 = 0xC04 - SYS_NEXTTOWARDD32 = 0xC02 - SYS_NEXTTOWARDD64 = 0xC03 - SYS_NEXTTOWARDF = 0xAC0 - SYS_NEXTTOWARDL = 0xAC3 - SYS_NL_LANGINFO = 0x0FC - SYS_PERROR_UNLOCKED = 0xCBD - SYS_POSIX_FALLOCATE = 0xCE8 - SYS_POSIX_MEMALIGN = 0xCE9 - SYS_POSIX_OPENPT = 0xC66 - SYS_POWD128 = 0xC07 - SYS_POWD32 = 0xC05 - SYS_POWD64 = 0xC06 - SYS_PRINTF_UNLOCKED = 0xCBE - SYS_PSELECT = 0xC67 - SYS_PTHREAD_ATTR_GETSTACK = 0xB3E - SYS_PTHREAD_ATTR_SETSTACK = 0xB3F - SYS_PTHREAD_SECURITY_APPLID_NP = 0xCE4 - SYS_PUTS_UNLOCKED = 0xC7F - SYS_PUTWCHAR_UNLOCKED = 0xCC0 - SYS_PUTWC_UNLOCKED = 0xCBF - SYS_QUANTEXPD128 = 0xD46 - SYS_QUANTEXPD32 = 0xD44 - SYS_QUANTEXPD64 = 0xD45 - SYS_QUANTIZED128 = 0xC0A - SYS_QUANTIZED32 = 0xC08 - SYS_QUANTIZED64 = 0xC09 - SYS_REMAINDERD128 = 0xC0D - SYS_REMAINDERD32 = 0xC0B - SYS_REMAINDERD64 = 0xC0C - SYS_RESIZE_ALLOC = 0xCEB - SYS_REWIND_UNLOCKED = 0xCC1 - SYS_RINTD128 = 0xC13 - SYS_RINTD32 = 0xC11 - SYS_RINTD64 = 0xC12 - SYS_RINTF = 0xACB - SYS_RINTL = 0xACD - SYS_ROUND = 0xACF - SYS_ROUNDD128 = 0xC16 - SYS_ROUNDD32 = 0xC14 - SYS_ROUNDD64 = 0xC15 - SYS_ROUNDF = 0xAD2 - SYS_ROUNDL = 0xAD5 - SYS_SAMEQUANTUMD128 = 0xC19 - SYS_SAMEQUANTUMD32 = 0xC17 - SYS_SAMEQUANTUMD64 = 0xC18 - SYS_SCALBLN = 0xAD8 - SYS_SCALBLND128 = 0xC1C - SYS_SCALBLND32 = 0xC1A - SYS_SCALBLND64 = 0xC1B - SYS_SCALBLNF = 0xADB - SYS_SCALBLNL = 0xADE - SYS_SCALBND128 = 0xC1F - SYS_SCALBND32 = 0xC1D - SYS_SCALBND64 = 0xC1E - SYS_SCALBNF = 0xAE3 - SYS_SCALBNL = 0xAE6 - SYS_SCANF_UNLOCKED = 0xCC2 - SYS_SCHED_YIELD = 0xB32 - SYS_SETENV = 0x0C8 - SYS_SETIPV4SOURCEFILTER = 0xC76 - SYS_SETSOURCEFILTER = 0xC78 - SYS_SHM_OPEN = 0xC8C - SYS_SHM_UNLINK = 0xC8D - SYS_SIND128 = 0xC22 - SYS_SIND32 = 0xC20 - SYS_SIND64 = 0xC21 - SYS_SINHD128 = 0xC25 - SYS_SINHD32 = 0xC23 - SYS_SINHD64 = 0xC24 - SYS_SIZEOF_ALLOC = 0xCEA - SYS_SOCKATMARK = 0xC68 - SYS_SQRTD128 = 0xC28 - SYS_SQRTD32 = 0xC26 - SYS_SQRTD64 = 0xC27 - SYS_STRCHR = 0x0A0 - SYS_STRCSPN = 0x0A1 - SYS_STRERROR = 0x0A8 - SYS_STRERROR_R = 0xB33 - SYS_STRFTIME = 0x0B2 - SYS_STRLEN = 0x0A9 - SYS_STRPBRK = 0x0A2 - SYS_STRSPN = 0x0A4 - SYS_STRSTR = 0x0A5 - SYS_STRTOD128 = 0xC2B - SYS_STRTOD32 = 0xC29 - SYS_STRTOD64 = 0xC2A - SYS_STRTOK = 0x0A6 - SYS_TAND128 = 0xC2E - SYS_TAND32 = 0xC2C - SYS_TAND64 = 0xC2D - SYS_TANHD128 = 0xC31 - SYS_TANHD32 = 0xC2F - SYS_TANHD64 = 0xC30 - SYS_TGAMMAD128 = 0xC34 - SYS_TGAMMAD32 = 0xC32 - SYS_TGAMMAD64 = 0xC33 - SYS_TIME = 0x0AD - SYS_TIME64 = 0xCE1 - SYS_TMPFILE64 = 0xD4D - SYS_TMPFILE64_UNLOCKED = 0xD4E - SYS_TMPFILE_UNLOCKED = 0xCFD - SYS_TRUNCD128 = 0xC40 - SYS_TRUNCD32 = 0xC3E - SYS_TRUNCD64 = 0xC3F - SYS_UNGETC_UNLOCKED = 0xCC3 - SYS_UNGETWC_UNLOCKED = 0xCC4 - SYS_UNSETENV = 0xB34 - SYS_VFPRINTF_UNLOCKED = 0xCC5 - SYS_VFSCANF_UNLOCKED = 0xCC7 - SYS_VFWPRINTF_UNLOCKED = 0xCC9 - SYS_VFWSCANF_UNLOCKED = 0xCCB - SYS_VPRINTF_UNLOCKED = 0xCCD - SYS_VSCANF_UNLOCKED = 0xCCF - SYS_VWPRINTF_UNLOCKED = 0xCD1 - SYS_VWSCANF_UNLOCKED = 0xCD3 - SYS_WCSTOD128 = 0xC43 - SYS_WCSTOD32 = 0xC41 - SYS_WCSTOD64 = 0xC42 - SYS_WPRINTF_UNLOCKED = 0xCD5 - SYS_WSCANF_UNLOCKED = 0xCD6 - SYS__FLUSHLBF = 0xD68 - SYS__FLUSHLBF_UNLOCKED = 0xD6F - SYS___ACOSHF_H = 0xA54 - SYS___ACOSHL_H = 0xA55 - SYS___ASINHF_H = 0xA56 - SYS___ASINHL_H = 0xA57 - SYS___ATANPID128 = 0xC6D - SYS___ATANPID32 = 0xC6B - SYS___ATANPID64 = 0xC6C - SYS___CBRTF_H = 0xA58 - SYS___CBRTL_H = 0xA59 - SYS___CDUMP = 0x0C4 - SYS___CLASS = 0xAFA - SYS___CLASS2 = 0xB99 - SYS___CLASS2D128 = 0xC99 - SYS___CLASS2D32 = 0xC97 - SYS___CLASS2D64 = 0xC98 - SYS___CLASS2F = 0xC91 - SYS___CLASS2F_B = 0xC93 - SYS___CLASS2F_H = 0xC94 - SYS___CLASS2L = 0xC92 - SYS___CLASS2L_B = 0xC95 - SYS___CLASS2L_H = 0xC96 - SYS___CLASS2_B = 0xB9A - SYS___CLASS2_H = 0xB9B - SYS___CLASS_B = 0xAFB - SYS___CLASS_H = 0xAFC - SYS___CLOGL_B = 0xA01 - SYS___CLOGL_H = 0xA02 - SYS___CLRENV = 0x0C9 - SYS___CLRMF = 0x0BD - SYS___CODEPAGE_INFO = 0xC64 - SYS___CONJF_B = 0xA07 - SYS___CONJF_H = 0xA08 - SYS___CONJL_B = 0xA0A - SYS___CONJL_H = 0xA0B - SYS___CONJ_B = 0xA04 - SYS___CONJ_H = 0xA05 - SYS___COPYSIGN_B = 0xA5A - SYS___COPYSIGN_H = 0xAF5 - SYS___COSPID128 = 0xC70 - SYS___COSPID32 = 0xC6E - SYS___COSPID64 = 0xC6F - SYS___CPOWF_B = 0xA10 - SYS___CPOWF_H = 0xA11 - SYS___CPOWL_B = 0xA13 - SYS___CPOWL_H = 0xA14 - SYS___CPOW_B = 0xA0D - SYS___CPOW_H = 0xA0E - SYS___CPROJF_B = 0xA19 - SYS___CPROJF_H = 0xA1A - SYS___CPROJL_B = 0xA1C - SYS___CPROJL_H = 0xA1D - SYS___CPROJ_B = 0xA16 - SYS___CPROJ_H = 0xA17 - SYS___CREALF_B = 0xA22 - SYS___CREALF_H = 0xA23 - SYS___CREALL_B = 0xA25 - SYS___CREALL_H = 0xA26 - SYS___CREAL_B = 0xA1F - SYS___CREAL_H = 0xA20 - SYS___CSINF_B = 0xA2B - SYS___CSINF_H = 0xA2C - SYS___CSINHF_B = 0xA34 - SYS___CSINHF_H = 0xA35 - SYS___CSINHL_B = 0xA37 - SYS___CSINHL_H = 0xA38 - SYS___CSINH_B = 0xA31 - SYS___CSINH_H = 0xA32 - SYS___CSINL_B = 0xA2E - SYS___CSINL_H = 0xA2F - SYS___CSIN_B = 0xA28 - SYS___CSIN_H = 0xA29 - SYS___CSNAP = 0x0C5 - SYS___CSQRTF_B = 0xA3D - SYS___CSQRTF_H = 0xA3E - SYS___CSQRTL_B = 0xA40 - SYS___CSQRTL_H = 0xA41 - SYS___CSQRT_B = 0xA3A - SYS___CSQRT_H = 0xA3B - SYS___CTANF_B = 0xA46 - SYS___CTANF_H = 0xA47 - SYS___CTANHF_B = 0xA4F - SYS___CTANHF_H = 0xA50 - SYS___CTANHL_B = 0xA52 - SYS___CTANHL_H = 0xA53 - SYS___CTANH_B = 0xA4C - SYS___CTANH_H = 0xA4D - SYS___CTANL_B = 0xA49 - SYS___CTANL_H = 0xA4A - SYS___CTAN_B = 0xA43 - SYS___CTAN_H = 0xA44 - SYS___CTEST = 0x0C7 - SYS___CTRACE = 0x0C6 - SYS___D1TOP = 0xC9B - SYS___D2TOP = 0xC9C - SYS___D4TOP = 0xC9D - SYS___DYNALL = 0x0C3 - SYS___DYNFRE = 0x0C2 - SYS___EXP2F_H = 0xA5E - SYS___EXP2L_H = 0xA5F - SYS___EXP2_H = 0xA5D - SYS___EXPM1F_H = 0xA5B - SYS___EXPM1L_H = 0xA5C - SYS___FBUFSIZE = 0xD60 - SYS___FLBF = 0xD62 - SYS___FLDATA = 0x0C1 - SYS___FMAF_B = 0xA67 - SYS___FMAF_H = 0xA68 - SYS___FMAL_B = 0xA6A - SYS___FMAL_H = 0xA6B - SYS___FMAXF_B = 0xA70 - SYS___FMAXF_H = 0xA71 - SYS___FMAXL_B = 0xA73 - SYS___FMAXL_H = 0xA74 - SYS___FMAX_B = 0xA6D - SYS___FMAX_H = 0xA6E - SYS___FMA_B = 0xA64 - SYS___FMA_H = 0xA65 - SYS___FMINF_B = 0xA79 - SYS___FMINF_H = 0xA7A - SYS___FMINL_B = 0xA7C - SYS___FMINL_H = 0xA7D - SYS___FMIN_B = 0xA76 - SYS___FMIN_H = 0xA77 - SYS___FPENDING = 0xD61 - SYS___FPENDING_UNLOCKED = 0xD6C - SYS___FPURGE = 0xD69 - SYS___FPURGE_UNLOCKED = 0xD70 - SYS___FP_CAST_D = 0xBCB - SYS___FREADABLE = 0xD63 - SYS___FREADAHEAD = 0xD6A - SYS___FREADAHEAD_UNLOCKED = 0xD71 - SYS___FREADING = 0xD65 - SYS___FREADING_UNLOCKED = 0xD6D - SYS___FSEEK2 = 0xB3C - SYS___FSETERR = 0xD6B - SYS___FSETLOCKING = 0xD67 - SYS___FTCHEP = 0x0BF - SYS___FTELL2 = 0xB3B - SYS___FUPDT = 0x0B5 - SYS___FWRITABLE = 0xD64 - SYS___FWRITING = 0xD66 - SYS___FWRITING_UNLOCKED = 0xD6E - SYS___GETCB = 0x0B4 - SYS___GETGRGID1 = 0xD5B - SYS___GETGRNAM1 = 0xD5C - SYS___GETTHENT = 0xCE5 - SYS___GETTOD = 0xD3E - SYS___HYPOTF_H = 0xAF6 - SYS___HYPOTL_H = 0xAF7 - SYS___ILOGBF_B = 0xA7F - SYS___ILOGBF_H = 0xA80 - SYS___ILOGBL_B = 0xA82 - SYS___ILOGBL_H = 0xA83 - SYS___ISBLANK_A = 0xB2E - SYS___ISBLNK = 0x0FE - SYS___ISWBLANK_A = 0xB2F - SYS___LE_CEEGTJS = 0xD72 - SYS___LE_TRACEBACK = 0xB7A - SYS___LGAMMAL_H = 0xA62 - SYS___LGAMMA_B_C99 = 0xB39 - SYS___LGAMMA_H_C99 = 0xB38 - SYS___LGAMMA_R_C99 = 0xB3A - SYS___LLRINTF_B = 0xA88 - SYS___LLRINTF_H = 0xA89 - SYS___LLRINTL_B = 0xA8B - SYS___LLRINTL_H = 0xA8C - SYS___LLRINT_B = 0xA85 - SYS___LLRINT_H = 0xA86 - SYS___LLROUNDF_B = 0xA91 - SYS___LLROUNDF_H = 0xA92 - SYS___LLROUNDL_B = 0xA94 - SYS___LLROUNDL_H = 0xA95 - SYS___LLROUND_B = 0xA8E - SYS___LLROUND_H = 0xA8F - SYS___LOCALE_CTL = 0xD47 - SYS___LOG1PF_H = 0xA60 - SYS___LOG1PL_H = 0xA61 - SYS___LOGBF_B = 0xA97 - SYS___LOGBF_H = 0xA98 - SYS___LOGBL_B = 0xA9A - SYS___LOGBL_H = 0xA9B - SYS___LOGIN_APPLID = 0xCE2 - SYS___LRINTF_B = 0xAA0 - SYS___LRINTF_H = 0xAA1 - SYS___LRINTL_B = 0xAA3 - SYS___LRINTL_H = 0xAA4 - SYS___LRINT_B = 0xA9D - SYS___LRINT_H = 0xA9E - SYS___LROUNDF_FIXUP = 0xB31 - SYS___LROUNDL_B = 0xAA6 - SYS___LROUNDL_H = 0xAA7 - SYS___LROUND_FIXUP = 0xB30 - SYS___MOSERVICES = 0xD3D - SYS___MUST_STAY_CLEAN = 0xB7C - SYS___NANF_B = 0xAAB - SYS___NANL_B = 0xAAD - SYS___NAN_B = 0xAA9 - SYS___NEARBYINTF_B = 0xAB2 - SYS___NEARBYINTF_H = 0xAB3 - SYS___NEARBYINTL_B = 0xAB5 - SYS___NEARBYINTL_H = 0xAB6 - SYS___NEARBYINT_B = 0xAAF - SYS___NEARBYINT_H = 0xAB0 - SYS___NEXTAFTERF_B = 0xAB8 - SYS___NEXTAFTERF_H = 0xAB9 - SYS___NEXTAFTERL_B = 0xABB - SYS___NEXTAFTERL_H = 0xABC - SYS___NEXTTOWARDF_B = 0xAC1 - SYS___NEXTTOWARDF_H = 0xAC2 - SYS___NEXTTOWARDL_B = 0xAC4 - SYS___NEXTTOWARDL_H = 0xAC5 - SYS___NEXTTOWARD_B = 0xABE - SYS___NEXTTOWARD_H = 0xABF - SYS___O_ENV = 0xB7D - SYS___PASSWD_APPLID = 0xCE3 - SYS___PTOD1 = 0xC9E - SYS___PTOD2 = 0xC9F - SYS___PTOD4 = 0xCA0 - SYS___REGCOMP_STD = 0x0EA - SYS___REMAINDERF_H = 0xAC6 - SYS___REMAINDERL_H = 0xAC7 - SYS___REMQUOD128 = 0xC10 - SYS___REMQUOD32 = 0xC0E - SYS___REMQUOD64 = 0xC0F - SYS___REMQUOF_H = 0xAC9 - SYS___REMQUOL_H = 0xACA - SYS___REMQUO_H = 0xAC8 - SYS___RINTF_B = 0xACC - SYS___RINTL_B = 0xACE - SYS___ROUNDF_B = 0xAD3 - SYS___ROUNDF_H = 0xAD4 - SYS___ROUNDL_B = 0xAD6 - SYS___ROUNDL_H = 0xAD7 - SYS___ROUND_B = 0xAD0 - SYS___ROUND_H = 0xAD1 - SYS___SCALBLNF_B = 0xADC - SYS___SCALBLNF_H = 0xADD - SYS___SCALBLNL_B = 0xADF - SYS___SCALBLNL_H = 0xAE0 - SYS___SCALBLN_B = 0xAD9 - SYS___SCALBLN_H = 0xADA - SYS___SCALBNF_B = 0xAE4 - SYS___SCALBNF_H = 0xAE5 - SYS___SCALBNL_B = 0xAE7 - SYS___SCALBNL_H = 0xAE8 - SYS___SCALBN_B = 0xAE1 - SYS___SCALBN_H = 0xAE2 - SYS___SETENV = 0x0C8 - SYS___SINPID128 = 0xC73 - SYS___SINPID32 = 0xC71 - SYS___SINPID64 = 0xC72 - SYS___SMF_RECORD2 = 0xD48 - SYS___STATIC_REINIT = 0xB3D - SYS___TGAMMAF_H_C99 = 0xB79 - SYS___TGAMMAL_H = 0xAE9 - SYS___TGAMMA_H_C99 = 0xB78 - SYS___TOCSNAME2 = 0xC9A - SYS_CEIL = 0x01F - SYS_CHAUDIT = 0x1E0 - SYS_EXP = 0x01A - SYS_FCHAUDIT = 0x1E1 - SYS_FREXP = 0x01D - SYS_GETGROUPSBYNAME = 0x1E2 - SYS_GETPWUID = 0x1A0 - SYS_GETUID = 0x1A1 - SYS_ISATTY = 0x1A3 - SYS_KILL = 0x1A4 - SYS_LDEXP = 0x01E - SYS_LINK = 0x1A5 - SYS_LOG10 = 0x01C - SYS_LSEEK = 0x1A6 - SYS_LSTAT = 0x1A7 - SYS_MKDIR = 0x1A8 - SYS_MKFIFO = 0x1A9 - SYS_MKNOD = 0x1AA - SYS_MODF = 0x01B - SYS_MOUNT = 0x1AB - SYS_OPEN = 0x1AC - SYS_OPENDIR = 0x1AD - SYS_PATHCONF = 0x1AE - SYS_PAUSE = 0x1AF - SYS_PIPE = 0x1B0 - SYS_PTHREAD_ATTR_DESTROY = 0x1E7 - SYS_PTHREAD_ATTR_GETDETACHSTATE = 0x1EB - SYS_PTHREAD_ATTR_GETSTACKSIZE = 0x1E9 - SYS_PTHREAD_ATTR_GETWEIGHT_NP = 0x1ED - SYS_PTHREAD_ATTR_INIT = 0x1E6 - SYS_PTHREAD_ATTR_SETDETACHSTATE = 0x1EA - SYS_PTHREAD_ATTR_SETSTACKSIZE = 0x1E8 - SYS_PTHREAD_ATTR_SETWEIGHT_NP = 0x1EC - SYS_PTHREAD_CANCEL = 0x1EE - SYS_PTHREAD_CLEANUP_POP = 0x1F0 - SYS_PTHREAD_CLEANUP_PUSH = 0x1EF - SYS_PTHREAD_CONDATTR_DESTROY = 0x1F2 - SYS_PTHREAD_CONDATTR_INIT = 0x1F1 - SYS_PTHREAD_COND_BROADCAST = 0x1F6 - SYS_PTHREAD_COND_DESTROY = 0x1F4 - SYS_PTHREAD_COND_INIT = 0x1F3 - SYS_PTHREAD_COND_SIGNAL = 0x1F5 - SYS_PTHREAD_COND_TIMEDWAIT = 0x1F8 - SYS_PTHREAD_COND_WAIT = 0x1F7 - SYS_PTHREAD_CREATE = 0x1F9 - SYS_PTHREAD_DETACH = 0x1FA - SYS_PTHREAD_EQUAL = 0x1FB - SYS_PTHREAD_EXIT = 0x1E4 - SYS_PTHREAD_GETSPECIFIC = 0x1FC - SYS_PTHREAD_JOIN = 0x1FD - SYS_PTHREAD_KEY_CREATE = 0x1FE - SYS_PTHREAD_KILL = 0x1E5 - SYS_PTHREAD_MUTEXATTR_INIT = 0x1FF - SYS_READ = 0x1B2 - SYS_READDIR = 0x1B3 - SYS_READLINK = 0x1B4 - SYS_REWINDDIR = 0x1B5 - SYS_RMDIR = 0x1B6 - SYS_SETEGID = 0x1B7 - SYS_SETEUID = 0x1B8 - SYS_SETGID = 0x1B9 - SYS_SETPGID = 0x1BA - SYS_SETSID = 0x1BB - SYS_SETUID = 0x1BC - SYS_SIGACTION = 0x1BD - SYS_SIGADDSET = 0x1BE - SYS_SIGDELSET = 0x1BF - SYS_SIGEMPTYSET = 0x1C0 - SYS_SIGFILLSET = 0x1C1 - SYS_SIGISMEMBER = 0x1C2 - SYS_SIGLONGJMP = 0x1C3 - SYS_SIGPENDING = 0x1C4 - SYS_SIGPROCMASK = 0x1C5 - SYS_SIGSETJMP = 0x1C6 - SYS_SIGSUSPEND = 0x1C7 - SYS_SIGWAIT = 0x1E3 - SYS_SLEEP = 0x1C8 - SYS_STAT = 0x1C9 - SYS_SYMLINK = 0x1CB - SYS_SYSCONF = 0x1CC - SYS_TCDRAIN = 0x1CD - SYS_TCFLOW = 0x1CE - SYS_TCFLUSH = 0x1CF - SYS_TCGETATTR = 0x1D0 - SYS_TCGETPGRP = 0x1D1 - SYS_TCSENDBREAK = 0x1D2 - SYS_TCSETATTR = 0x1D3 - SYS_TCSETPGRP = 0x1D4 - SYS_TIMES = 0x1D5 - SYS_TTYNAME = 0x1D6 - SYS_TZSET = 0x1D7 - SYS_UMASK = 0x1D8 - SYS_UMOUNT = 0x1D9 - SYS_UNAME = 0x1DA - SYS_UNLINK = 0x1DB - SYS_UTIME = 0x1DC - SYS_WAIT = 0x1DD - SYS_WAITPID = 0x1DE - SYS_WRITE = 0x1DF - SYS_W_GETPSENT = 0x1B1 - SYS_W_IOCTL = 0x1A2 - SYS_W_STATFS = 0x1CA - SYS_A64L = 0x2EF - SYS_BCMP = 0x2B9 - SYS_BCOPY = 0x2BA - SYS_BZERO = 0x2BB - SYS_CATCLOSE = 0x2B6 - SYS_CATGETS = 0x2B7 - SYS_CATOPEN = 0x2B8 - SYS_CRYPT = 0x2AC - SYS_DBM_CLEARERR = 0x2F7 - SYS_DBM_CLOSE = 0x2F8 - SYS_DBM_DELETE = 0x2F9 - SYS_DBM_ERROR = 0x2FA - SYS_DBM_FETCH = 0x2FB - SYS_DBM_FIRSTKEY = 0x2FC - SYS_DBM_NEXTKEY = 0x2FD - SYS_DBM_OPEN = 0x2FE - SYS_DBM_STORE = 0x2FF - SYS_DRAND48 = 0x2B2 - SYS_ENCRYPT = 0x2AD - SYS_ENDUTXENT = 0x2E1 - SYS_ERAND48 = 0x2B3 - SYS_ERF = 0x02C - SYS_ERFC = 0x02D - SYS_FCHDIR = 0x2D9 - SYS_FFS = 0x2BC - SYS_FMTMSG = 0x2E5 - SYS_FSTATVFS = 0x2B4 - SYS_FTIME = 0x2F5 - SYS_GAMMA = 0x02E - SYS_GETDATE = 0x2A6 - SYS_GETPAGESIZE = 0x2D8 - SYS_GETTIMEOFDAY = 0x2F6 - SYS_GETUTXENT = 0x2E0 - SYS_GETUTXID = 0x2E2 - SYS_GETUTXLINE = 0x2E3 - SYS_HCREATE = 0x2C6 - SYS_HDESTROY = 0x2C7 - SYS_HSEARCH = 0x2C8 - SYS_HYPOT = 0x02B - SYS_INDEX = 0x2BD - SYS_INITSTATE = 0x2C2 - SYS_INSQUE = 0x2CF - SYS_ISASCII = 0x2ED - SYS_JRAND48 = 0x2E6 - SYS_L64A = 0x2F0 - SYS_LCONG48 = 0x2EA - SYS_LFIND = 0x2C9 - SYS_LRAND48 = 0x2E7 - SYS_LSEARCH = 0x2CA - SYS_MEMCCPY = 0x2D4 - SYS_MRAND48 = 0x2E8 - SYS_NRAND48 = 0x2E9 - SYS_PCLOSE = 0x2D2 - SYS_POPEN = 0x2D1 - SYS_PUTUTXLINE = 0x2E4 - SYS_RANDOM = 0x2C4 - SYS_REMQUE = 0x2D0 - SYS_RINDEX = 0x2BE - SYS_SEED48 = 0x2EC - SYS_SETKEY = 0x2AE - SYS_SETSTATE = 0x2C3 - SYS_SETUTXENT = 0x2DF - SYS_SRAND48 = 0x2EB - SYS_SRANDOM = 0x2C5 - SYS_STATVFS = 0x2B5 - SYS_STRCASECMP = 0x2BF - SYS_STRDUP = 0x2C0 - SYS_STRNCASECMP = 0x2C1 - SYS_SWAB = 0x2D3 - SYS_TDELETE = 0x2CB - SYS_TFIND = 0x2CC - SYS_TOASCII = 0x2EE - SYS_TSEARCH = 0x2CD - SYS_TWALK = 0x2CE - SYS_UALARM = 0x2F1 - SYS_USLEEP = 0x2F2 - SYS_WAIT3 = 0x2A7 - SYS_WAITID = 0x2A8 - SYS_Y1 = 0x02A - SYS___ATOE = 0x2DB - SYS___ATOE_L = 0x2DC - SYS___CATTRM = 0x2A9 - SYS___CNVBLK = 0x2AF - SYS___CRYTRM = 0x2B0 - SYS___DLGHT = 0x2A1 - SYS___ECRTRM = 0x2B1 - SYS___ETOA = 0x2DD - SYS___ETOA_L = 0x2DE - SYS___GDTRM = 0x2AA - SYS___OCLCK = 0x2DA - SYS___OPARGF = 0x2A2 - SYS___OPERRF = 0x2A5 - SYS___OPINDF = 0x2A4 - SYS___OPOPTF = 0x2A3 - SYS___RNDTRM = 0x2AB - SYS___SRCTRM = 0x2F4 - SYS___TZONE = 0x2A0 - SYS___UTXTRM = 0x2F3 - SYS_ASIN = 0x03E - SYS_ISXDIGIT = 0x03B - SYS_SETLOCAL = 0x03A - SYS_SETLOCALE = 0x03A - SYS_SIN = 0x03F - SYS_TOLOWER = 0x03C - SYS_TOUPPER = 0x03D - SYS_ACCEPT_AND_RECV = 0x4F7 - SYS_ATOL = 0x04E - SYS_CHECKSCH = 0x4BC - SYS_CHECKSCHENV = 0x4BC - SYS_CLEARERR = 0x04C - SYS_CONNECTS = 0x4B5 - SYS_CONNECTSERVER = 0x4B5 - SYS_CONNECTW = 0x4B4 - SYS_CONNECTWORKMGR = 0x4B4 - SYS_CONTINUE = 0x4B3 - SYS_CONTINUEWORKUNIT = 0x4B3 - SYS_COPYSIGN = 0x4C2 - SYS_CREATEWO = 0x4B2 - SYS_CREATEWORKUNIT = 0x4B2 - SYS_DELETEWO = 0x4B9 - SYS_DELETEWORKUNIT = 0x4B9 - SYS_DISCONNE = 0x4B6 - SYS_DISCONNECTSERVER = 0x4B6 - SYS_FEOF = 0x04D - SYS_FERROR = 0x04A - SYS_FINITE = 0x4C8 - SYS_GAMMA_R = 0x4E2 - SYS_JOINWORK = 0x4B7 - SYS_JOINWORKUNIT = 0x4B7 - SYS_LEAVEWOR = 0x4B8 - SYS_LEAVEWORKUNIT = 0x4B8 - SYS_LGAMMA_R = 0x4EB - SYS_MATHERR = 0x4D0 - SYS_PERROR = 0x04F - SYS_QUERYMET = 0x4BA - SYS_QUERYMETRICS = 0x4BA - SYS_QUERYSCH = 0x4BB - SYS_QUERYSCHENV = 0x4BB - SYS_REWIND = 0x04B - SYS_SCALBN = 0x4D4 - SYS_SIGNIFIC = 0x4D5 - SYS_SIGNIFICAND = 0x4D5 - SYS___ACOSH_B = 0x4DA - SYS___ACOS_B = 0x4D9 - SYS___ASINH_B = 0x4BE - SYS___ASIN_B = 0x4DB - SYS___ATAN2_B = 0x4DC - SYS___ATANH_B = 0x4DD - SYS___ATAN_B = 0x4BF - SYS___CBRT_B = 0x4C0 - SYS___CEIL_B = 0x4C1 - SYS___COSH_B = 0x4DE - SYS___COS_B = 0x4C3 - SYS___DGHT = 0x4A8 - SYS___ENVN = 0x4B0 - SYS___ERFC_B = 0x4C5 - SYS___ERF_B = 0x4C4 - SYS___EXPM1_B = 0x4C6 - SYS___EXP_B = 0x4DF - SYS___FABS_B = 0x4C7 - SYS___FLOOR_B = 0x4C9 - SYS___FMOD_B = 0x4E0 - SYS___FP_SETMODE = 0x4F8 - SYS___FREXP_B = 0x4CA - SYS___GAMMA_B = 0x4E1 - SYS___GDRR = 0x4A1 - SYS___HRRNO = 0x4A2 - SYS___HYPOT_B = 0x4E3 - SYS___ILOGB_B = 0x4CB - SYS___ISNAN_B = 0x4CC - SYS___J0_B = 0x4E4 - SYS___J1_B = 0x4E6 - SYS___JN_B = 0x4E8 - SYS___LDEXP_B = 0x4CD - SYS___LGAMMA_B = 0x4EA - SYS___LOG10_B = 0x4ED - SYS___LOG1P_B = 0x4CE - SYS___LOGB_B = 0x4CF - SYS___LOGIN = 0x4F5 - SYS___LOG_B = 0x4EC - SYS___MLOCKALL = 0x4B1 - SYS___MODF_B = 0x4D1 - SYS___NEXTAFTER_B = 0x4D2 - SYS___OPENDIR2 = 0x4F3 - SYS___OPEN_STAT = 0x4F6 - SYS___OPND = 0x4A5 - SYS___OPPT = 0x4A6 - SYS___OPRG = 0x4A3 - SYS___OPRR = 0x4A4 - SYS___PID_AFFINITY = 0x4BD - SYS___POW_B = 0x4EE - SYS___READDIR2 = 0x4F4 - SYS___REMAINDER_B = 0x4EF - SYS___RINT_B = 0x4D3 - SYS___SCALB_B = 0x4F0 - SYS___SIGACTIONSET = 0x4FB - SYS___SIGGM = 0x4A7 - SYS___SINH_B = 0x4F1 - SYS___SIN_B = 0x4D6 - SYS___SQRT_B = 0x4F2 - SYS___TANH_B = 0x4D8 - SYS___TAN_B = 0x4D7 - SYS___TRRNO = 0x4AF - SYS___TZNE = 0x4A9 - SYS___TZZN = 0x4AA - SYS___UCREATE = 0x4FC - SYS___UFREE = 0x4FE - SYS___UHEAPREPORT = 0x4FF - SYS___UMALLOC = 0x4FD - SYS___Y0_B = 0x4E5 - SYS___Y1_B = 0x4E7 - SYS___YN_B = 0x4E9 - SYS_ABORT = 0x05C - SYS_ASCTIME_R = 0x5E0 - SYS_ATEXIT = 0x05D - SYS_CONNECTE = 0x5AE - SYS_CONNECTEXPORTIMPORT = 0x5AE - SYS_CTIME_R = 0x5E1 - SYS_DN_COMP = 0x5DF - SYS_DN_EXPAND = 0x5DD - SYS_DN_SKIPNAME = 0x5DE - SYS_EXIT = 0x05A - SYS_EXPORTWO = 0x5A1 - SYS_EXPORTWORKUNIT = 0x5A1 - SYS_EXTRACTW = 0x5A5 - SYS_EXTRACTWORKUNIT = 0x5A5 - SYS_FSEEKO = 0x5C9 - SYS_FTELLO = 0x5C8 - SYS_GETGRGID_R = 0x5E7 - SYS_GETGRNAM_R = 0x5E8 - SYS_GETLOGIN_R = 0x5E9 - SYS_GETPWNAM_R = 0x5EA - SYS_GETPWUID_R = 0x5EB - SYS_GMTIME_R = 0x5E2 - SYS_IMPORTWO = 0x5A3 - SYS_IMPORTWORKUNIT = 0x5A3 - SYS_INET_NTOP = 0x5D3 - SYS_INET_PTON = 0x5D4 - SYS_LLABS = 0x5CE - SYS_LLDIV = 0x5CB - SYS_LOCALTIME_R = 0x5E3 - SYS_PTHREAD_ATFORK = 0x5ED - SYS_PTHREAD_ATTR_GETDETACHSTATE_U98 = 0x5FB - SYS_PTHREAD_ATTR_GETGUARDSIZE = 0x5EE - SYS_PTHREAD_ATTR_GETSCHEDPARAM = 0x5F9 - SYS_PTHREAD_ATTR_GETSTACKADDR = 0x5EF - SYS_PTHREAD_ATTR_SETDETACHSTATE_U98 = 0x5FC - SYS_PTHREAD_ATTR_SETGUARDSIZE = 0x5F0 - SYS_PTHREAD_ATTR_SETSCHEDPARAM = 0x5FA - SYS_PTHREAD_ATTR_SETSTACKADDR = 0x5F1 - SYS_PTHREAD_CONDATTR_GETPSHARED = 0x5F2 - SYS_PTHREAD_CONDATTR_SETPSHARED = 0x5F3 - SYS_PTHREAD_DETACH_U98 = 0x5FD - SYS_PTHREAD_GETCONCURRENCY = 0x5F4 - SYS_PTHREAD_GETSPECIFIC_U98 = 0x5FE - SYS_PTHREAD_KEY_DELETE = 0x5F5 - SYS_PTHREAD_SETCANCELSTATE = 0x5FF - SYS_PTHREAD_SETCONCURRENCY = 0x5F6 - SYS_PTHREAD_SIGMASK = 0x5F7 - SYS_QUERYENC = 0x5AD - SYS_QUERYWORKUNITCLASSIFICATION = 0x5AD - SYS_RAISE = 0x05E - SYS_RAND_R = 0x5E4 - SYS_READDIR_R = 0x5E6 - SYS_REALLOC = 0x05B - SYS_RES_INIT = 0x5D8 - SYS_RES_MKQUERY = 0x5D7 - SYS_RES_QUERY = 0x5D9 - SYS_RES_QUERYDOMAIN = 0x5DC - SYS_RES_SEARCH = 0x5DA - SYS_RES_SEND = 0x5DB - SYS_SETJMP = 0x05F - SYS_SIGQUEUE = 0x5A9 - SYS_STRTOK_R = 0x5E5 - SYS_STRTOLL = 0x5B0 - SYS_STRTOULL = 0x5B1 - SYS_TTYNAME_R = 0x5EC - SYS_UNDOEXPO = 0x5A2 - SYS_UNDOEXPORTWORKUNIT = 0x5A2 - SYS_UNDOIMPO = 0x5A4 - SYS_UNDOIMPORTWORKUNIT = 0x5A4 - SYS_WCSTOLL = 0x5CC - SYS_WCSTOULL = 0x5CD - SYS___ABORT = 0x05C - SYS___CONSOLE2 = 0x5D2 - SYS___CPL = 0x5A6 - SYS___DISCARDDATA = 0x5F8 - SYS___DSA_PREV = 0x5B2 - SYS___EP_FIND = 0x5B3 - SYS___FP_SWAPMODE = 0x5AF - SYS___GETUSERID = 0x5AB - SYS___GET_CPUID = 0x5B9 - SYS___GET_SYSTEM_SETTINGS = 0x5BA - SYS___IPDOMAINNAME = 0x5AC - SYS___MAP_INIT = 0x5A7 - SYS___MAP_SERVICE = 0x5A8 - SYS___MOUNT = 0x5AA - SYS___MSGRCV_TIMED = 0x5B7 - SYS___RES = 0x5D6 - SYS___SEMOP_TIMED = 0x5B8 - SYS___SERVER_THREADS_QUERY = 0x5B4 - SYS_FPRINTF = 0x06D - SYS_FSCANF = 0x06A - SYS_PRINTF = 0x06F - SYS_SETBUF = 0x06B - SYS_SETVBUF = 0x06C - SYS_SSCANF = 0x06E - SYS___CATGETS_A = 0x6C0 - SYS___CHAUDIT_A = 0x6F4 - SYS___CHMOD_A = 0x6E8 - SYS___COLLATE_INIT_A = 0x6AC - SYS___CREAT_A = 0x6F6 - SYS___CTYPE_INIT_A = 0x6AF - SYS___DLLLOAD_A = 0x6DF - SYS___DLLQUERYFN_A = 0x6E0 - SYS___DLLQUERYVAR_A = 0x6E1 - SYS___E2A_L = 0x6E3 - SYS___EXECLE_A = 0x6A0 - SYS___EXECLP_A = 0x6A4 - SYS___EXECVE_A = 0x6C1 - SYS___EXECVP_A = 0x6C2 - SYS___EXECV_A = 0x6B1 - SYS___FPRINTF_A = 0x6FA - SYS___GETADDRINFO_A = 0x6BF - SYS___GETNAMEINFO_A = 0x6C4 - SYS___GET_WCTYPE_STD_A = 0x6AE - SYS___ICONV_OPEN_A = 0x6DE - SYS___IF_INDEXTONAME_A = 0x6DC - SYS___IF_NAMETOINDEX_A = 0x6DB - SYS___ISWCTYPE_A = 0x6B0 - SYS___IS_WCTYPE_STD_A = 0x6B2 - SYS___LOCALECONV_A = 0x6B8 - SYS___LOCALECONV_STD_A = 0x6B9 - SYS___LOCALE_INIT_A = 0x6B7 - SYS___LSTAT_A = 0x6EE - SYS___LSTAT_O_A = 0x6EF - SYS___MKDIR_A = 0x6E9 - SYS___MKFIFO_A = 0x6EC - SYS___MKNOD_A = 0x6F0 - SYS___MONETARY_INIT_A = 0x6BC - SYS___MOUNT_A = 0x6F1 - SYS___NL_CSINFO_A = 0x6D6 - SYS___NL_LANGINFO_A = 0x6BA - SYS___NL_LNAGINFO_STD_A = 0x6BB - SYS___NL_MONINFO_A = 0x6D7 - SYS___NL_NUMINFO_A = 0x6D8 - SYS___NL_RESPINFO_A = 0x6D9 - SYS___NL_TIMINFO_A = 0x6DA - SYS___NUMERIC_INIT_A = 0x6C6 - SYS___OPEN_A = 0x6F7 - SYS___PRINTF_A = 0x6DD - SYS___RESP_INIT_A = 0x6C7 - SYS___RPMATCH_A = 0x6C8 - SYS___RPMATCH_C_A = 0x6C9 - SYS___RPMATCH_STD_A = 0x6CA - SYS___SETLOCALE_A = 0x6F9 - SYS___SPAWNP_A = 0x6C5 - SYS___SPAWN_A = 0x6C3 - SYS___SPRINTF_A = 0x6FB - SYS___STAT_A = 0x6EA - SYS___STAT_O_A = 0x6EB - SYS___STRCOLL_STD_A = 0x6A1 - SYS___STRFMON_A = 0x6BD - SYS___STRFMON_STD_A = 0x6BE - SYS___STRFTIME_A = 0x6CC - SYS___STRFTIME_STD_A = 0x6CD - SYS___STRPTIME_A = 0x6CE - SYS___STRPTIME_STD_A = 0x6CF - SYS___STRXFRM_A = 0x6A2 - SYS___STRXFRM_C_A = 0x6A3 - SYS___STRXFRM_STD_A = 0x6A5 - SYS___SYNTAX_INIT_A = 0x6D4 - SYS___TIME_INIT_A = 0x6CB - SYS___TOD_INIT_A = 0x6D5 - SYS___TOWLOWER_A = 0x6B3 - SYS___TOWLOWER_STD_A = 0x6B4 - SYS___TOWUPPER_A = 0x6B5 - SYS___TOWUPPER_STD_A = 0x6B6 - SYS___UMOUNT_A = 0x6F2 - SYS___VFPRINTF_A = 0x6FC - SYS___VPRINTF_A = 0x6FD - SYS___VSPRINTF_A = 0x6FE - SYS___VSWPRINTF_A = 0x6FF - SYS___WCSCOLL_A = 0x6A6 - SYS___WCSCOLL_C_A = 0x6A7 - SYS___WCSCOLL_STD_A = 0x6A8 - SYS___WCSFTIME_A = 0x6D0 - SYS___WCSFTIME_STD_A = 0x6D1 - SYS___WCSXFRM_A = 0x6A9 - SYS___WCSXFRM_C_A = 0x6AA - SYS___WCSXFRM_STD_A = 0x6AB - SYS___WCTYPE_A = 0x6AD - SYS___W_GETMNTENT_A = 0x6F5 - SYS_____CCSIDTYPE_A = 0x6E6 - SYS_____CHATTR_A = 0x6E2 - SYS_____CSNAMETYPE_A = 0x6E7 - SYS_____OPEN_STAT_A = 0x6ED - SYS_____SPAWN2_A = 0x6D2 - SYS_____SPAWNP2_A = 0x6D3 - SYS_____TOCCSID_A = 0x6E4 - SYS_____TOCSNAME_A = 0x6E5 - SYS_ACL_FREE = 0x7FF - SYS_ACL_INIT = 0x7FE - SYS_FWIDE = 0x7DF - SYS_FWPRINTF = 0x7D1 - SYS_FWRITE = 0x07E - SYS_FWSCANF = 0x7D5 - SYS_GETCHAR = 0x07B - SYS_GETS = 0x07C - SYS_M_CREATE_LAYOUT = 0x7C9 - SYS_M_DESTROY_LAYOUT = 0x7CA - SYS_M_GETVALUES_LAYOUT = 0x7CB - SYS_M_SETVALUES_LAYOUT = 0x7CC - SYS_M_TRANSFORM_LAYOUT = 0x7CD - SYS_M_WTRANSFORM_LAYOUT = 0x7CE - SYS_PREAD = 0x7C7 - SYS_PUTC = 0x07D - SYS_PUTCHAR = 0x07A - SYS_PUTS = 0x07F - SYS_PWRITE = 0x7C8 - SYS_TOWCTRAN = 0x7D8 - SYS_TOWCTRANS = 0x7D8 - SYS_UNATEXIT = 0x7B5 - SYS_VFWPRINT = 0x7D3 - SYS_VFWPRINTF = 0x7D3 - SYS_VWPRINTF = 0x7D4 - SYS_WCTRANS = 0x7D7 - SYS_WPRINTF = 0x7D2 - SYS_WSCANF = 0x7D6 - SYS___ASCTIME_R_A = 0x7A1 - SYS___BASENAME_A = 0x7DC - SYS___BTOWC_A = 0x7E4 - SYS___CDUMP_A = 0x7B7 - SYS___CEE3DMP_A = 0x7B6 - SYS___CEILF_H = 0x7F4 - SYS___CEILL_H = 0x7F5 - SYS___CEIL_H = 0x7EA - SYS___CRYPT_A = 0x7BE - SYS___CSNAP_A = 0x7B8 - SYS___CTEST_A = 0x7B9 - SYS___CTIME_R_A = 0x7A2 - SYS___CTRACE_A = 0x7BA - SYS___DBM_OPEN_A = 0x7E6 - SYS___DIRNAME_A = 0x7DD - SYS___FABSF_H = 0x7FA - SYS___FABSL_H = 0x7FB - SYS___FABS_H = 0x7ED - SYS___FGETWC_A = 0x7AA - SYS___FGETWS_A = 0x7AD - SYS___FLOORF_H = 0x7F6 - SYS___FLOORL_H = 0x7F7 - SYS___FLOOR_H = 0x7EB - SYS___FPUTWC_A = 0x7A5 - SYS___FPUTWS_A = 0x7A8 - SYS___GETTIMEOFDAY_A = 0x7AE - SYS___GETWCHAR_A = 0x7AC - SYS___GETWC_A = 0x7AB - SYS___GLOB_A = 0x7DE - SYS___GMTIME_A = 0x7AF - SYS___GMTIME_R_A = 0x7B0 - SYS___INET_PTON_A = 0x7BC - SYS___J0_H = 0x7EE - SYS___J1_H = 0x7EF - SYS___JN_H = 0x7F0 - SYS___LOCALTIME_A = 0x7B1 - SYS___LOCALTIME_R_A = 0x7B2 - SYS___MALLOC24 = 0x7FC - SYS___MALLOC31 = 0x7FD - SYS___MKTIME_A = 0x7B3 - SYS___MODFF_H = 0x7F8 - SYS___MODFL_H = 0x7F9 - SYS___MODF_H = 0x7EC - SYS___OPENDIR_A = 0x7C2 - SYS___OSNAME = 0x7E0 - SYS___PUTWCHAR_A = 0x7A7 - SYS___PUTWC_A = 0x7A6 - SYS___READDIR_A = 0x7C3 - SYS___STRTOLL_A = 0x7A3 - SYS___STRTOULL_A = 0x7A4 - SYS___SYSLOG_A = 0x7BD - SYS___TZZNA = 0x7B4 - SYS___UNGETWC_A = 0x7A9 - SYS___UTIME_A = 0x7A0 - SYS___VFPRINTF2_A = 0x7E7 - SYS___VPRINTF2_A = 0x7E8 - SYS___VSPRINTF2_A = 0x7E9 - SYS___VSWPRNTF2_A = 0x7BB - SYS___WCSTOD_A = 0x7D9 - SYS___WCSTOL_A = 0x7DA - SYS___WCSTOUL_A = 0x7DB - SYS___WCTOB_A = 0x7E5 - SYS___Y0_H = 0x7F1 - SYS___Y1_H = 0x7F2 - SYS___YN_H = 0x7F3 - SYS_____OPENDIR2_A = 0x7BF - SYS_____OSNAME_A = 0x7E1 - SYS_____READDIR2_A = 0x7C0 - SYS_DLCLOSE = 0x8DF - SYS_DLERROR = 0x8E0 - SYS_DLOPEN = 0x8DD - SYS_DLSYM = 0x8DE - SYS_FLOCKFILE = 0x8D3 - SYS_FTRYLOCKFILE = 0x8D4 - SYS_FUNLOCKFILE = 0x8D5 - SYS_GETCHAR_UNLOCKED = 0x8D7 - SYS_GETC_UNLOCKED = 0x8D6 - SYS_PUTCHAR_UNLOCKED = 0x8D9 - SYS_PUTC_UNLOCKED = 0x8D8 - SYS_SNPRINTF = 0x8DA - SYS_VSNPRINTF = 0x8DB - SYS_WCSCSPN = 0x08B - SYS_WCSLEN = 0x08C - SYS_WCSNCAT = 0x08D - SYS_WCSNCMP = 0x08A - SYS_WCSNCPY = 0x08F - SYS_WCSSPN = 0x08E - SYS___ABSF_H = 0x8E7 - SYS___ABSL_H = 0x8E8 - SYS___ABS_H = 0x8E6 - SYS___ACOSF_H = 0x8EA - SYS___ACOSH_H = 0x8EC - SYS___ACOSL_H = 0x8EB - SYS___ACOS_H = 0x8E9 - SYS___ASINF_H = 0x8EE - SYS___ASINH_H = 0x8F0 - SYS___ASINL_H = 0x8EF - SYS___ASIN_H = 0x8ED - SYS___ATAN2F_H = 0x8F8 - SYS___ATAN2L_H = 0x8F9 - SYS___ATAN2_H = 0x8F7 - SYS___ATANF_H = 0x8F2 - SYS___ATANHF_H = 0x8F5 - SYS___ATANHL_H = 0x8F6 - SYS___ATANH_H = 0x8F4 - SYS___ATANL_H = 0x8F3 - SYS___ATAN_H = 0x8F1 - SYS___CBRT_H = 0x8FA - SYS___COPYSIGNF_H = 0x8FB - SYS___COPYSIGNL_H = 0x8FC - SYS___COSF_H = 0x8FE - SYS___COSL_H = 0x8FF - SYS___COS_H = 0x8FD - SYS___DLERROR_A = 0x8D2 - SYS___DLOPEN_A = 0x8D0 - SYS___DLSYM_A = 0x8D1 - SYS___GETUTXENT_A = 0x8C6 - SYS___GETUTXID_A = 0x8C7 - SYS___GETUTXLINE_A = 0x8C8 - SYS___ITOA = 0x8AA - SYS___ITOA_A = 0x8B0 - SYS___LE_CONDITION_TOKEN_BUILD = 0x8A5 - SYS___LE_MSG_ADD_INSERT = 0x8A6 - SYS___LE_MSG_GET = 0x8A7 - SYS___LE_MSG_GET_AND_WRITE = 0x8A8 - SYS___LE_MSG_WRITE = 0x8A9 - SYS___LLTOA = 0x8AE - SYS___LLTOA_A = 0x8B4 - SYS___LTOA = 0x8AC - SYS___LTOA_A = 0x8B2 - SYS___PUTCHAR_UNLOCKED_A = 0x8CC - SYS___PUTC_UNLOCKED_A = 0x8CB - SYS___PUTUTXLINE_A = 0x8C9 - SYS___RESET_EXCEPTION_HANDLER = 0x8E3 - SYS___REXEC_A = 0x8C4 - SYS___REXEC_AF_A = 0x8C5 - SYS___SET_EXCEPTION_HANDLER = 0x8E2 - SYS___SNPRINTF_A = 0x8CD - SYS___SUPERKILL = 0x8A4 - SYS___TCGETATTR_A = 0x8A1 - SYS___TCSETATTR_A = 0x8A2 - SYS___ULLTOA = 0x8AF - SYS___ULLTOA_A = 0x8B5 - SYS___ULTOA = 0x8AD - SYS___ULTOA_A = 0x8B3 - SYS___UTOA = 0x8AB - SYS___UTOA_A = 0x8B1 - SYS___VHM_EVENT = 0x8E4 - SYS___VSNPRINTF_A = 0x8CE - SYS_____GETENV_A = 0x8C3 - SYS_____UTMPXNAME_A = 0x8CA - SYS_CACOSH = 0x9A0 - SYS_CACOSHF = 0x9A3 - SYS_CACOSHL = 0x9A6 - SYS_CARG = 0x9A9 - SYS_CARGF = 0x9AC - SYS_CARGL = 0x9AF - SYS_CASIN = 0x9B2 - SYS_CASINF = 0x9B5 - SYS_CASINH = 0x9BB - SYS_CASINHF = 0x9BE - SYS_CASINHL = 0x9C1 - SYS_CASINL = 0x9B8 - SYS_CATAN = 0x9C4 - SYS_CATANF = 0x9C7 - SYS_CATANH = 0x9CD - SYS_CATANHF = 0x9D0 - SYS_CATANHL = 0x9D3 - SYS_CATANL = 0x9CA - SYS_CCOS = 0x9D6 - SYS_CCOSF = 0x9D9 - SYS_CCOSH = 0x9DF - SYS_CCOSHF = 0x9E2 - SYS_CCOSHL = 0x9E5 - SYS_CCOSL = 0x9DC - SYS_CEXP = 0x9E8 - SYS_CEXPF = 0x9EB - SYS_CEXPL = 0x9EE - SYS_CIMAG = 0x9F1 - SYS_CIMAGF = 0x9F4 - SYS_CIMAGL = 0x9F7 - SYS_CLOGF = 0x9FD - SYS_MEMCHR = 0x09B - SYS_MEMCMP = 0x09A - SYS_STRCOLL = 0x09C - SYS_STRNCMP = 0x09D - SYS_STRRCHR = 0x09F - SYS_STRXFRM = 0x09E - SYS___CACOSHF_B = 0x9A4 - SYS___CACOSHF_H = 0x9A5 - SYS___CACOSHL_B = 0x9A7 - SYS___CACOSHL_H = 0x9A8 - SYS___CACOSH_B = 0x9A1 - SYS___CACOSH_H = 0x9A2 - SYS___CARGF_B = 0x9AD - SYS___CARGF_H = 0x9AE - SYS___CARGL_B = 0x9B0 - SYS___CARGL_H = 0x9B1 - SYS___CARG_B = 0x9AA - SYS___CARG_H = 0x9AB - SYS___CASINF_B = 0x9B6 - SYS___CASINF_H = 0x9B7 - SYS___CASINHF_B = 0x9BF - SYS___CASINHF_H = 0x9C0 - SYS___CASINHL_B = 0x9C2 - SYS___CASINHL_H = 0x9C3 - SYS___CASINH_B = 0x9BC - SYS___CASINH_H = 0x9BD - SYS___CASINL_B = 0x9B9 - SYS___CASINL_H = 0x9BA - SYS___CASIN_B = 0x9B3 - SYS___CASIN_H = 0x9B4 - SYS___CATANF_B = 0x9C8 - SYS___CATANF_H = 0x9C9 - SYS___CATANHF_B = 0x9D1 - SYS___CATANHF_H = 0x9D2 - SYS___CATANHL_B = 0x9D4 - SYS___CATANHL_H = 0x9D5 - SYS___CATANH_B = 0x9CE - SYS___CATANH_H = 0x9CF - SYS___CATANL_B = 0x9CB - SYS___CATANL_H = 0x9CC - SYS___CATAN_B = 0x9C5 - SYS___CATAN_H = 0x9C6 - SYS___CCOSF_B = 0x9DA - SYS___CCOSF_H = 0x9DB - SYS___CCOSHF_B = 0x9E3 - SYS___CCOSHF_H = 0x9E4 - SYS___CCOSHL_B = 0x9E6 - SYS___CCOSHL_H = 0x9E7 - SYS___CCOSH_B = 0x9E0 - SYS___CCOSH_H = 0x9E1 - SYS___CCOSL_B = 0x9DD - SYS___CCOSL_H = 0x9DE - SYS___CCOS_B = 0x9D7 - SYS___CCOS_H = 0x9D8 - SYS___CEXPF_B = 0x9EC - SYS___CEXPF_H = 0x9ED - SYS___CEXPL_B = 0x9EF - SYS___CEXPL_H = 0x9F0 - SYS___CEXP_B = 0x9E9 - SYS___CEXP_H = 0x9EA - SYS___CIMAGF_B = 0x9F5 - SYS___CIMAGF_H = 0x9F6 - SYS___CIMAGL_B = 0x9F8 - SYS___CIMAGL_H = 0x9F9 - SYS___CIMAG_B = 0x9F2 - SYS___CIMAG_H = 0x9F3 - SYS___CLOG = 0x9FA - SYS___CLOGF_B = 0x9FE - SYS___CLOGF_H = 0x9FF - SYS___CLOG_B = 0x9FB - SYS___CLOG_H = 0x9FC - SYS_ISWCTYPE = 0x10C - SYS_ISWXDIGI = 0x10A - SYS_ISWXDIGIT = 0x10A - SYS_MBSINIT = 0x10F - SYS_TOWLOWER = 0x10D - SYS_TOWUPPER = 0x10E - SYS_WCTYPE = 0x10B - SYS_WCSSTR = 0x11B - SYS___RPMTCH = 0x11A - SYS_WCSTOD = 0x12E - SYS_WCSTOK = 0x12C - SYS_WCSTOL = 0x12D - SYS_WCSTOUL = 0x12F - SYS_FGETWC = 0x13C - SYS_FGETWS = 0x13D - SYS_FPUTWC = 0x13E - SYS_FPUTWS = 0x13F - SYS_REGERROR = 0x13B - SYS_REGFREE = 0x13A - SYS_COLLEQUIV = 0x14F - SYS_COLLTOSTR = 0x14E - SYS_ISMCCOLLEL = 0x14C - SYS_STRTOCOLL = 0x14D - SYS_DLLFREE = 0x16F - SYS_DLLQUERYFN = 0x16D - SYS_DLLQUERYVAR = 0x16E - SYS_GETMCCOLL = 0x16A - SYS_GETWMCCOLL = 0x16B - SYS___ERR2AD = 0x16C - SYS_CFSETOSPEED = 0x17A - SYS_CHDIR = 0x17B - SYS_CHMOD = 0x17C - SYS_CHOWN = 0x17D - SYS_CLOSE = 0x17E - SYS_CLOSEDIR = 0x17F - SYS_LOG = 0x017 - SYS_COSH = 0x018 - SYS_FCHMOD = 0x18A - SYS_FCHOWN = 0x18B - SYS_FCNTL = 0x18C - SYS_FILENO = 0x18D - SYS_FORK = 0x18E - SYS_FPATHCONF = 0x18F - SYS_GETLOGIN = 0x19A - SYS_GETPGRP = 0x19C - SYS_GETPID = 0x19D - SYS_GETPPID = 0x19E - SYS_GETPWNAM = 0x19F - SYS_TANH = 0x019 - SYS_W_GETMNTENT = 0x19B - SYS_POW = 0x020 - SYS_PTHREAD_SELF = 0x20A - SYS_PTHREAD_SETINTR = 0x20B - SYS_PTHREAD_SETINTRTYPE = 0x20C - SYS_PTHREAD_SETSPECIFIC = 0x20D - SYS_PTHREAD_TESTINTR = 0x20E - SYS_PTHREAD_YIELD = 0x20F - SYS_SQRT = 0x021 - SYS_FLOOR = 0x022 - SYS_J1 = 0x023 - SYS_WCSPBRK = 0x23F - SYS_BSEARCH = 0x24C - SYS_FABS = 0x024 - SYS_GETENV = 0x24A - SYS_LDIV = 0x24D - SYS_SYSTEM = 0x24B - SYS_FMOD = 0x025 - SYS___RETHROW = 0x25F - SYS___THROW = 0x25E - SYS_J0 = 0x026 - SYS_PUTENV = 0x26A - SYS___GETENV = 0x26F - SYS_SEMCTL = 0x27A - SYS_SEMGET = 0x27B - SYS_SEMOP = 0x27C - SYS_SHMAT = 0x27D - SYS_SHMCTL = 0x27E - SYS_SHMDT = 0x27F - SYS_YN = 0x027 - SYS_JN = 0x028 - SYS_SIGALTSTACK = 0x28A - SYS_SIGHOLD = 0x28B - SYS_SIGIGNORE = 0x28C - SYS_SIGINTERRUPT = 0x28D - SYS_SIGPAUSE = 0x28E - SYS_SIGRELSE = 0x28F - SYS_GETOPT = 0x29A - SYS_GETSUBOPT = 0x29D - SYS_LCHOWN = 0x29B - SYS_SETPGRP = 0x29E - SYS_TRUNCATE = 0x29C - SYS_Y0 = 0x029 - SYS___GDERR = 0x29F - SYS_ISALPHA = 0x030 - SYS_VFORK = 0x30F - SYS__LONGJMP = 0x30D - SYS__SETJMP = 0x30E - SYS_GLOB = 0x31A - SYS_GLOBFREE = 0x31B - SYS_ISALNUM = 0x031 - SYS_PUTW = 0x31C - SYS_SEEKDIR = 0x31D - SYS_TELLDIR = 0x31E - SYS_TEMPNAM = 0x31F - SYS_GETTIMEOFDAY_R = 0x32E - SYS_ISLOWER = 0x032 - SYS_LGAMMA = 0x32C - SYS_REMAINDER = 0x32A - SYS_SCALB = 0x32B - SYS_SYNC = 0x32F - SYS_TTYSLOT = 0x32D - SYS_ENDPROTOENT = 0x33A - SYS_ENDSERVENT = 0x33B - SYS_GETHOSTBYADDR = 0x33D - SYS_GETHOSTBYADDR_R = 0x33C - SYS_GETHOSTBYNAME = 0x33F - SYS_GETHOSTBYNAME_R = 0x33E - SYS_ISCNTRL = 0x033 - SYS_GETSERVBYNAME = 0x34A - SYS_GETSERVBYPORT = 0x34B - SYS_GETSERVENT = 0x34C - SYS_GETSOCKNAME = 0x34D - SYS_GETSOCKOPT = 0x34E - SYS_INET_ADDR = 0x34F - SYS_ISDIGIT = 0x034 - SYS_ISGRAPH = 0x035 - SYS_SELECT = 0x35B - SYS_SELECTEX = 0x35C - SYS_SEND = 0x35D - SYS_SENDTO = 0x35F - SYS_CHROOT = 0x36A - SYS_ISNAN = 0x36D - SYS_ISUPPER = 0x036 - SYS_ULIMIT = 0x36C - SYS_UTIMES = 0x36E - SYS_W_STATVFS = 0x36B - SYS___H_ERRNO = 0x36F - SYS_GRANTPT = 0x37A - SYS_ISPRINT = 0x037 - SYS_TCGETSID = 0x37C - SYS_UNLOCKPT = 0x37B - SYS___TCGETCP = 0x37D - SYS___TCSETCP = 0x37E - SYS___TCSETTABLES = 0x37F - SYS_ISPUNCT = 0x038 - SYS_NLIST = 0x38C - SYS___IPDBCS = 0x38D - SYS___IPDSPX = 0x38E - SYS___IPMSGC = 0x38F - SYS___STHOSTENT = 0x38B - SYS___STSERVENT = 0x38A - SYS_ISSPACE = 0x039 - SYS_COS = 0x040 - SYS_T_ALLOC = 0x40A - SYS_T_BIND = 0x40B - SYS_T_CLOSE = 0x40C - SYS_T_CONNECT = 0x40D - SYS_T_ERROR = 0x40E - SYS_T_FREE = 0x40F - SYS_TAN = 0x041 - SYS_T_RCVREL = 0x41A - SYS_T_RCVUDATA = 0x41B - SYS_T_RCVUDERR = 0x41C - SYS_T_SND = 0x41D - SYS_T_SNDDIS = 0x41E - SYS_T_SNDREL = 0x41F - SYS_GETPMSG = 0x42A - SYS_ISASTREAM = 0x42B - SYS_PUTMSG = 0x42C - SYS_PUTPMSG = 0x42D - SYS_SINH = 0x042 - SYS___ISPOSIXON = 0x42E - SYS___OPENMVSREL = 0x42F - SYS_ACOS = 0x043 - SYS_ATAN = 0x044 - SYS_ATAN2 = 0x045 - SYS_FTELL = 0x046 - SYS_FGETPOS = 0x047 - SYS_SOCK_DEBUG = 0x47A - SYS_SOCK_DO_TESTSTOR = 0x47D - SYS_TAKESOCKET = 0x47E - SYS___SERVER_INIT = 0x47F - SYS_FSEEK = 0x048 - SYS___IPHOST = 0x48B - SYS___IPNODE = 0x48C - SYS___SERVER_CLASSIFY_CREATE = 0x48D - SYS___SERVER_CLASSIFY_DESTROY = 0x48E - SYS___SERVER_CLASSIFY_RESET = 0x48F - SYS___SMF_RECORD = 0x48A - SYS_FSETPOS = 0x049 - SYS___FNWSA = 0x49B - SYS___SPAWN2 = 0x49D - SYS___SPAWNP2 = 0x49E - SYS_ATOF = 0x050 - SYS_PTHREAD_MUTEXATTR_GETPSHARED = 0x50A - SYS_PTHREAD_MUTEXATTR_SETPSHARED = 0x50B - SYS_PTHREAD_RWLOCK_DESTROY = 0x50C - SYS_PTHREAD_RWLOCK_INIT = 0x50D - SYS_PTHREAD_RWLOCK_RDLOCK = 0x50E - SYS_PTHREAD_RWLOCK_TRYRDLOCK = 0x50F - SYS_ATOI = 0x051 - SYS___FP_CLASS = 0x51D - SYS___FP_CLR_FLAG = 0x51A - SYS___FP_FINITE = 0x51E - SYS___FP_ISNAN = 0x51F - SYS___FP_RAISE_XCP = 0x51C - SYS___FP_READ_FLAG = 0x51B - SYS_RAND = 0x052 - SYS_SIGTIMEDWAIT = 0x52D - SYS_SIGWAITINFO = 0x52E - SYS___CHKBFP = 0x52F - SYS___FPC_RS = 0x52C - SYS___FPC_RW = 0x52A - SYS___FPC_SM = 0x52B - SYS_STRTOD = 0x053 - SYS_STRTOL = 0x054 - SYS_STRTOUL = 0x055 - SYS_MALLOC = 0x056 - SYS_SRAND = 0x057 - SYS_CALLOC = 0x058 - SYS_FREE = 0x059 - SYS___OSENV = 0x59F - SYS___W_PIOCTL = 0x59E - SYS_LONGJMP = 0x060 - SYS___FLOORF_B = 0x60A - SYS___FLOORL_B = 0x60B - SYS___FREXPF_B = 0x60C - SYS___FREXPL_B = 0x60D - SYS___LDEXPF_B = 0x60E - SYS___LDEXPL_B = 0x60F - SYS_SIGNAL = 0x061 - SYS___ATAN2F_B = 0x61A - SYS___ATAN2L_B = 0x61B - SYS___COSHF_B = 0x61C - SYS___COSHL_B = 0x61D - SYS___EXPF_B = 0x61E - SYS___EXPL_B = 0x61F - SYS_TMPNAM = 0x062 - SYS___ABSF_B = 0x62A - SYS___ABSL_B = 0x62C - SYS___ABS_B = 0x62B - SYS___FMODF_B = 0x62D - SYS___FMODL_B = 0x62E - SYS___MODFF_B = 0x62F - SYS_ATANL = 0x63A - SYS_CEILF = 0x63B - SYS_CEILL = 0x63C - SYS_COSF = 0x63D - SYS_COSHF = 0x63F - SYS_COSL = 0x63E - SYS_REMOVE = 0x063 - SYS_POWL = 0x64A - SYS_RENAME = 0x064 - SYS_SINF = 0x64B - SYS_SINHF = 0x64F - SYS_SINL = 0x64C - SYS_SQRTF = 0x64D - SYS_SQRTL = 0x64E - SYS_BTOWC = 0x65F - SYS_FREXPL = 0x65A - SYS_LDEXPF = 0x65B - SYS_LDEXPL = 0x65C - SYS_MODFF = 0x65D - SYS_MODFL = 0x65E - SYS_TMPFILE = 0x065 - SYS_FREOPEN = 0x066 - SYS___CHARMAP_INIT_A = 0x66E - SYS___GETHOSTBYADDR_R_A = 0x66C - SYS___GETHOSTBYNAME_A = 0x66A - SYS___GETHOSTBYNAME_R_A = 0x66D - SYS___MBLEN_A = 0x66F - SYS___RES_INIT_A = 0x66B - SYS_FCLOSE = 0x067 - SYS___GETGRGID_R_A = 0x67D - SYS___WCSTOMBS_A = 0x67A - SYS___WCSTOMBS_STD_A = 0x67B - SYS___WCSWIDTH_A = 0x67C - SYS___WCSWIDTH_ASIA = 0x67F - SYS___WCSWIDTH_STD_A = 0x67E - SYS_FFLUSH = 0x068 - SYS___GETLOGIN_R_A = 0x68E - SYS___GETPWNAM_R_A = 0x68C - SYS___GETPWUID_R_A = 0x68D - SYS___TTYNAME_R_A = 0x68F - SYS___WCWIDTH_ASIA = 0x68B - SYS___WCWIDTH_STD_A = 0x68A - SYS_FOPEN = 0x069 - SYS___REGEXEC_A = 0x69A - SYS___REGEXEC_STD_A = 0x69B - SYS___REGFREE_A = 0x69C - SYS___REGFREE_STD_A = 0x69D - SYS___STRCOLL_A = 0x69E - SYS___STRCOLL_C_A = 0x69F - SYS_SCANF = 0x070 - SYS___A64L_A = 0x70C - SYS___ECVT_A = 0x70D - SYS___FCVT_A = 0x70E - SYS___GCVT_A = 0x70F - SYS___STRTOUL_A = 0x70A - SYS_____AE_CORRESTBL_QUERY_A = 0x70B - SYS_SPRINTF = 0x071 - SYS___ACCESS_A = 0x71F - SYS___CATOPEN_A = 0x71E - SYS___GETOPT_A = 0x71D - SYS___REALPATH_A = 0x71A - SYS___SETENV_A = 0x71B - SYS___SYSTEM_A = 0x71C - SYS_FGETC = 0x072 - SYS___GAI_STRERROR_A = 0x72F - SYS___RMDIR_A = 0x72A - SYS___STATVFS_A = 0x72B - SYS___SYMLINK_A = 0x72C - SYS___TRUNCATE_A = 0x72D - SYS___UNLINK_A = 0x72E - SYS_VFPRINTF = 0x073 - SYS___ISSPACE_A = 0x73A - SYS___ISUPPER_A = 0x73B - SYS___ISWALNUM_A = 0x73F - SYS___ISXDIGIT_A = 0x73C - SYS___TOLOWER_A = 0x73D - SYS___TOUPPER_A = 0x73E - SYS_VPRINTF = 0x074 - SYS___CONFSTR_A = 0x74B - SYS___FDOPEN_A = 0x74E - SYS___FLDATA_A = 0x74F - SYS___FTOK_A = 0x74C - SYS___ISWXDIGIT_A = 0x74A - SYS___MKTEMP_A = 0x74D - SYS_VSPRINTF = 0x075 - SYS___GETGRGID_A = 0x75A - SYS___GETGRNAM_A = 0x75B - SYS___GETGROUPSBYNAME_A = 0x75C - SYS___GETHOSTENT_A = 0x75D - SYS___GETHOSTNAME_A = 0x75E - SYS___GETLOGIN_A = 0x75F - SYS_GETC = 0x076 - SYS___CREATEWORKUNIT_A = 0x76A - SYS___CTERMID_A = 0x76B - SYS___FMTMSG_A = 0x76C - SYS___INITGROUPS_A = 0x76D - SYS___MSGRCV_A = 0x76F - SYS_____LOGIN_A = 0x76E - SYS_FGETS = 0x077 - SYS___STRCASECMP_A = 0x77B - SYS___STRNCASECMP_A = 0x77C - SYS___TTYNAME_A = 0x77D - SYS___UNAME_A = 0x77E - SYS___UTIMES_A = 0x77F - SYS_____SERVER_PWU_A = 0x77A - SYS_FPUTC = 0x078 - SYS___CREAT_O_A = 0x78E - SYS___ENVNA = 0x78F - SYS___FREAD_A = 0x78A - SYS___FWRITE_A = 0x78B - SYS___ISASCII = 0x78D - SYS___OPEN_O_A = 0x78C - SYS_FPUTS = 0x079 - SYS___ASCTIME_A = 0x79C - SYS___CTIME_A = 0x79D - SYS___GETDATE_A = 0x79E - SYS___GETSERVBYPORT_A = 0x79A - SYS___GETSERVENT_A = 0x79B - SYS___TZSET_A = 0x79F - SYS_ACL_FROM_TEXT = 0x80C - SYS_ACL_SET_FD = 0x80A - SYS_ACL_SET_FILE = 0x80B - SYS_ACL_SORT = 0x80E - SYS_ACL_TO_TEXT = 0x80D - SYS_UNGETC = 0x080 - SYS___SHUTDOWN_REGISTRATION = 0x80F - SYS_FREAD = 0x081 - SYS_FREEADDRINFO = 0x81A - SYS_GAI_STRERROR = 0x81B - SYS_REXEC_AF = 0x81C - SYS___DYNALLOC_A = 0x81F - SYS___POE = 0x81D - SYS_WCSTOMBS = 0x082 - SYS___INET_ADDR_A = 0x82F - SYS___NLIST_A = 0x82A - SYS_____TCGETCP_A = 0x82B - SYS_____TCSETCP_A = 0x82C - SYS_____W_PIOCTL_A = 0x82E - SYS_MBTOWC = 0x083 - SYS___CABEND = 0x83D - SYS___LE_CIB_GET = 0x83E - SYS___RECVMSG_A = 0x83B - SYS___SENDMSG_A = 0x83A - SYS___SET_LAA_FOR_JIT = 0x83F - SYS_____LCHATTR_A = 0x83C - SYS_WCTOMB = 0x084 - SYS___CBRTL_B = 0x84A - SYS___COPYSIGNF_B = 0x84B - SYS___COPYSIGNL_B = 0x84C - SYS___COTANF_B = 0x84D - SYS___COTANL_B = 0x84F - SYS___COTAN_B = 0x84E - SYS_MBSTOWCS = 0x085 - SYS___LOG1PL_B = 0x85A - SYS___LOG2F_B = 0x85B - SYS___LOG2L_B = 0x85D - SYS___LOG2_B = 0x85C - SYS___REMAINDERF_B = 0x85E - SYS___REMAINDERL_B = 0x85F - SYS_ACOSHF = 0x86E - SYS_ACOSHL = 0x86F - SYS_WCSCPY = 0x086 - SYS___ERFCF_B = 0x86D - SYS___ERFF_B = 0x86C - SYS___LROUNDF_B = 0x86A - SYS___LROUND_B = 0x86B - SYS_COTANL = 0x87A - SYS_EXP2F = 0x87B - SYS_EXP2L = 0x87C - SYS_EXPM1F = 0x87D - SYS_EXPM1L = 0x87E - SYS_FDIMF = 0x87F - SYS_WCSCAT = 0x087 - SYS___COTANL = 0x87A - SYS_REMAINDERF = 0x88A - SYS_REMAINDERL = 0x88B - SYS_REMAINDF = 0x88A - SYS_REMAINDL = 0x88B - SYS_REMQUO = 0x88D - SYS_REMQUOF = 0x88C - SYS_REMQUOL = 0x88E - SYS_TGAMMAF = 0x88F - SYS_WCSCHR = 0x088 - SYS_ERFCF = 0x89B - SYS_ERFCL = 0x89C - SYS_ERFL = 0x89A - SYS_EXP2 = 0x89E - SYS_WCSCMP = 0x089 - SYS___EXP2_B = 0x89D - SYS___FAR_JUMP = 0x89F - SYS_ABS = 0x090 - SYS___ERFCL_H = 0x90A - SYS___EXPF_H = 0x90C - SYS___EXPL_H = 0x90D - SYS___EXPM1_H = 0x90E - SYS___EXP_H = 0x90B - SYS___FDIM_H = 0x90F - SYS_DIV = 0x091 - SYS___LOG2F_H = 0x91F - SYS___LOG2_H = 0x91E - SYS___LOGB_H = 0x91D - SYS___LOGF_H = 0x91B - SYS___LOGL_H = 0x91C - SYS___LOG_H = 0x91A - SYS_LABS = 0x092 - SYS___POWL_H = 0x92A - SYS___REMAINDER_H = 0x92B - SYS___RINT_H = 0x92C - SYS___SCALB_H = 0x92D - SYS___SINF_H = 0x92F - SYS___SIN_H = 0x92E - SYS_STRNCPY = 0x093 - SYS___TANHF_H = 0x93B - SYS___TANHL_H = 0x93C - SYS___TANH_H = 0x93A - SYS___TGAMMAF_H = 0x93E - SYS___TGAMMA_H = 0x93D - SYS___TRUNC_H = 0x93F - SYS_MEMCPY = 0x094 - SYS_VFWSCANF = 0x94A - SYS_VSWSCANF = 0x94E - SYS_VWSCANF = 0x94C - SYS_INET6_RTH_ADD = 0x95D - SYS_INET6_RTH_INIT = 0x95C - SYS_INET6_RTH_REVERSE = 0x95E - SYS_INET6_RTH_SEGMENTS = 0x95F - SYS_INET6_RTH_SPACE = 0x95B - SYS_MEMMOVE = 0x095 - SYS_WCSTOLD = 0x95A - SYS_STRCPY = 0x096 - SYS_STRCMP = 0x097 - SYS_CABS = 0x98E - SYS_STRCAT = 0x098 - SYS___CABS_B = 0x98F - SYS___POW_II = 0x98A - SYS___POW_II_B = 0x98B - SYS___POW_II_H = 0x98C - SYS_CACOSF = 0x99A - SYS_CACOSL = 0x99D - SYS_STRNCAT = 0x099 - SYS___CACOSF_B = 0x99B - SYS___CACOSF_H = 0x99C - SYS___CACOSL_B = 0x99E - SYS___CACOSL_H = 0x99F - SYS_ISWALPHA = 0x100 - SYS_ISWBLANK = 0x101 - SYS___ISWBLK = 0x101 - SYS_ISWCNTRL = 0x102 - SYS_ISWDIGIT = 0x103 - SYS_ISWGRAPH = 0x104 - SYS_ISWLOWER = 0x105 - SYS_ISWPRINT = 0x106 - SYS_ISWPUNCT = 0x107 - SYS_ISWSPACE = 0x108 - SYS_ISWUPPER = 0x109 - SYS_WCTOB = 0x110 - SYS_MBRLEN = 0x111 - SYS_MBRTOWC = 0x112 - SYS_MBSRTOWC = 0x113 - SYS_MBSRTOWCS = 0x113 - SYS_WCRTOMB = 0x114 - SYS_WCSRTOMB = 0x115 - SYS_WCSRTOMBS = 0x115 - SYS___CSID = 0x116 - SYS___WCSID = 0x117 - SYS_STRPTIME = 0x118 - SYS___STRPTM = 0x118 - SYS_STRFMON = 0x119 - SYS_WCSCOLL = 0x130 - SYS_WCSXFRM = 0x131 - SYS_WCSWIDTH = 0x132 - SYS_WCWIDTH = 0x133 - SYS_WCSFTIME = 0x134 - SYS_SWPRINTF = 0x135 - SYS_VSWPRINT = 0x136 - SYS_VSWPRINTF = 0x136 - SYS_SWSCANF = 0x137 - SYS_REGCOMP = 0x138 - SYS_REGEXEC = 0x139 - SYS_GETWC = 0x140 - SYS_GETWCHAR = 0x141 - SYS_PUTWC = 0x142 - SYS_PUTWCHAR = 0x143 - SYS_UNGETWC = 0x144 - SYS_ICONV_OPEN = 0x145 - SYS_ICONV = 0x146 - SYS_ICONV_CLOSE = 0x147 - SYS_COLLRANGE = 0x150 - SYS_CCLASS = 0x151 - SYS_COLLORDER = 0x152 - SYS___DEMANGLE = 0x154 - SYS_FDOPEN = 0x155 - SYS___ERRNO = 0x156 - SYS___ERRNO2 = 0x157 - SYS___TERROR = 0x158 - SYS_MAXCOLL = 0x169 - SYS_DLLLOAD = 0x170 - SYS__EXIT = 0x174 - SYS_ACCESS = 0x175 - SYS_ALARM = 0x176 - SYS_CFGETISPEED = 0x177 - SYS_CFGETOSPEED = 0x178 - SYS_CFSETISPEED = 0x179 - SYS_CREAT = 0x180 - SYS_CTERMID = 0x181 - SYS_DUP = 0x182 - SYS_DUP2 = 0x183 - SYS_EXECL = 0x184 - SYS_EXECLE = 0x185 - SYS_EXECLP = 0x186 - SYS_EXECV = 0x187 - SYS_EXECVE = 0x188 - SYS_EXECVP = 0x189 - SYS_FSTAT = 0x190 - SYS_FSYNC = 0x191 - SYS_FTRUNCATE = 0x192 - SYS_GETCWD = 0x193 - SYS_GETEGID = 0x194 - SYS_GETEUID = 0x195 - SYS_GETGID = 0x196 - SYS_GETGRGID = 0x197 - SYS_GETGRNAM = 0x198 - SYS_GETGROUPS = 0x199 - SYS_PTHREAD_MUTEXATTR_DESTROY = 0x200 - SYS_PTHREAD_MUTEXATTR_SETKIND_NP = 0x201 - SYS_PTHREAD_MUTEXATTR_GETKIND_NP = 0x202 - SYS_PTHREAD_MUTEX_INIT = 0x203 - SYS_PTHREAD_MUTEX_DESTROY = 0x204 - SYS_PTHREAD_MUTEX_LOCK = 0x205 - SYS_PTHREAD_MUTEX_TRYLOCK = 0x206 - SYS_PTHREAD_MUTEX_UNLOCK = 0x207 - SYS_PTHREAD_ONCE = 0x209 - SYS_TW_OPEN = 0x210 - SYS_TW_FCNTL = 0x211 - SYS_PTHREAD_JOIN_D4_NP = 0x212 - SYS_PTHREAD_CONDATTR_SETKIND_NP = 0x213 - SYS_PTHREAD_CONDATTR_GETKIND_NP = 0x214 - SYS_EXTLINK_NP = 0x215 - SYS___PASSWD = 0x216 - SYS_SETGROUPS = 0x217 - SYS_INITGROUPS = 0x218 - SYS_WCSRCHR = 0x240 - SYS_SVC99 = 0x241 - SYS___SVC99 = 0x241 - SYS_WCSWCS = 0x242 - SYS_LOCALECO = 0x243 - SYS_LOCALECONV = 0x243 - SYS___LIBREL = 0x244 - SYS_RELEASE = 0x245 - SYS___RLSE = 0x245 - SYS_FLOCATE = 0x246 - SYS___FLOCT = 0x246 - SYS_FDELREC = 0x247 - SYS___FDLREC = 0x247 - SYS_FETCH = 0x248 - SYS___FETCH = 0x248 - SYS_QSORT = 0x249 - SYS___CLEANUPCATCH = 0x260 - SYS___CATCHMATCH = 0x261 - SYS___CLEAN2UPCATCH = 0x262 - SYS_GETPRIORITY = 0x270 - SYS_NICE = 0x271 - SYS_SETPRIORITY = 0x272 - SYS_GETITIMER = 0x273 - SYS_SETITIMER = 0x274 - SYS_MSGCTL = 0x275 - SYS_MSGGET = 0x276 - SYS_MSGRCV = 0x277 - SYS_MSGSND = 0x278 - SYS_MSGXRCV = 0x279 - SYS___MSGXR = 0x279 - SYS_SHMGET = 0x280 - SYS___GETIPC = 0x281 - SYS_SETGRENT = 0x282 - SYS_GETGRENT = 0x283 - SYS_ENDGRENT = 0x284 - SYS_SETPWENT = 0x285 - SYS_GETPWENT = 0x286 - SYS_ENDPWENT = 0x287 - SYS_BSD_SIGNAL = 0x288 - SYS_KILLPG = 0x289 - SYS_SIGSET = 0x290 - SYS_SIGSTACK = 0x291 - SYS_GETRLIMIT = 0x292 - SYS_SETRLIMIT = 0x293 - SYS_GETRUSAGE = 0x294 - SYS_MMAP = 0x295 - SYS_MPROTECT = 0x296 - SYS_MSYNC = 0x297 - SYS_MUNMAP = 0x298 - SYS_CONFSTR = 0x299 - SYS___NDMTRM = 0x300 - SYS_FTOK = 0x301 - SYS_BASENAME = 0x302 - SYS_DIRNAME = 0x303 - SYS_GETDTABLESIZE = 0x304 - SYS_MKSTEMP = 0x305 - SYS_MKTEMP = 0x306 - SYS_NFTW = 0x307 - SYS_GETWD = 0x308 - SYS_LOCKF = 0x309 - SYS_WORDEXP = 0x310 - SYS_WORDFREE = 0x311 - SYS_GETPGID = 0x312 - SYS_GETSID = 0x313 - SYS___UTMPXNAME = 0x314 - SYS_CUSERID = 0x315 - SYS_GETPASS = 0x316 - SYS_FNMATCH = 0x317 - SYS_FTW = 0x318 - SYS_GETW = 0x319 - SYS_ACOSH = 0x320 - SYS_ASINH = 0x321 - SYS_ATANH = 0x322 - SYS_CBRT = 0x323 - SYS_EXPM1 = 0x324 - SYS_ILOGB = 0x325 - SYS_LOGB = 0x326 - SYS_LOG1P = 0x327 - SYS_NEXTAFTER = 0x328 - SYS_RINT = 0x329 - SYS_SPAWN = 0x330 - SYS_SPAWNP = 0x331 - SYS_GETLOGIN_UU = 0x332 - SYS_ECVT = 0x333 - SYS_FCVT = 0x334 - SYS_GCVT = 0x335 - SYS_ACCEPT = 0x336 - SYS_BIND = 0x337 - SYS_CONNECT = 0x338 - SYS_ENDHOSTENT = 0x339 - SYS_GETHOSTENT = 0x340 - SYS_GETHOSTID = 0x341 - SYS_GETHOSTNAME = 0x342 - SYS_GETNETBYADDR = 0x343 - SYS_GETNETBYNAME = 0x344 - SYS_GETNETENT = 0x345 - SYS_GETPEERNAME = 0x346 - SYS_GETPROTOBYNAME = 0x347 - SYS_GETPROTOBYNUMBER = 0x348 - SYS_GETPROTOENT = 0x349 - SYS_INET_LNAOF = 0x350 - SYS_INET_MAKEADDR = 0x351 - SYS_INET_NETOF = 0x352 - SYS_INET_NETWORK = 0x353 - SYS_INET_NTOA = 0x354 - SYS_IOCTL = 0x355 - SYS_LISTEN = 0x356 - SYS_READV = 0x357 - SYS_RECV = 0x358 - SYS_RECVFROM = 0x359 - SYS_SETHOSTENT = 0x360 - SYS_SETNETENT = 0x361 - SYS_SETPEER = 0x362 - SYS_SETPROTOENT = 0x363 - SYS_SETSERVENT = 0x364 - SYS_SETSOCKOPT = 0x365 - SYS_SHUTDOWN = 0x366 - SYS_SOCKET = 0x367 - SYS_SOCKETPAIR = 0x368 - SYS_WRITEV = 0x369 - SYS_ENDNETENT = 0x370 - SYS_CLOSELOG = 0x371 - SYS_OPENLOG = 0x372 - SYS_SETLOGMASK = 0x373 - SYS_SYSLOG = 0x374 - SYS_PTSNAME = 0x375 - SYS_SETREUID = 0x376 - SYS_SETREGID = 0x377 - SYS_REALPATH = 0x378 - SYS___SIGNGAM = 0x379 - SYS_POLL = 0x380 - SYS_REXEC = 0x381 - SYS___ISASCII2 = 0x382 - SYS___TOASCII2 = 0x383 - SYS_CHPRIORITY = 0x384 - SYS_PTHREAD_ATTR_SETSYNCTYPE_NP = 0x385 - SYS_PTHREAD_ATTR_GETSYNCTYPE_NP = 0x386 - SYS_PTHREAD_SET_LIMIT_NP = 0x387 - SYS___STNETENT = 0x388 - SYS___STPROTOENT = 0x389 - SYS___SELECT1 = 0x390 - SYS_PTHREAD_SECURITY_NP = 0x391 - SYS___CHECK_RESOURCE_AUTH_NP = 0x392 - SYS___CONVERT_ID_NP = 0x393 - SYS___OPENVMREL = 0x394 - SYS_WMEMCHR = 0x395 - SYS_WMEMCMP = 0x396 - SYS_WMEMCPY = 0x397 - SYS_WMEMMOVE = 0x398 - SYS_WMEMSET = 0x399 - SYS___FPUTWC = 0x400 - SYS___PUTWC = 0x401 - SYS___PWCHAR = 0x402 - SYS___WCSFTM = 0x403 - SYS___WCSTOK = 0x404 - SYS___WCWDTH = 0x405 - SYS_T_ACCEPT = 0x409 - SYS_T_GETINFO = 0x410 - SYS_T_GETPROTADDR = 0x411 - SYS_T_GETSTATE = 0x412 - SYS_T_LISTEN = 0x413 - SYS_T_LOOK = 0x414 - SYS_T_OPEN = 0x415 - SYS_T_OPTMGMT = 0x416 - SYS_T_RCV = 0x417 - SYS_T_RCVCONNECT = 0x418 - SYS_T_RCVDIS = 0x419 - SYS_T_SNDUDATA = 0x420 - SYS_T_STRERROR = 0x421 - SYS_T_SYNC = 0x422 - SYS_T_UNBIND = 0x423 - SYS___T_ERRNO = 0x424 - SYS___RECVMSG2 = 0x425 - SYS___SENDMSG2 = 0x426 - SYS_FATTACH = 0x427 - SYS_FDETACH = 0x428 - SYS_GETMSG = 0x429 - SYS_GETCONTEXT = 0x430 - SYS_SETCONTEXT = 0x431 - SYS_MAKECONTEXT = 0x432 - SYS_SWAPCONTEXT = 0x433 - SYS_PTHREAD_GETSPECIFIC_D8_NP = 0x434 - SYS_GETCLIENTID = 0x470 - SYS___GETCLIENTID = 0x471 - SYS_GETSTABLESIZE = 0x472 - SYS_GETIBMOPT = 0x473 - SYS_GETIBMSOCKOPT = 0x474 - SYS_GIVESOCKET = 0x475 - SYS_IBMSFLUSH = 0x476 - SYS_MAXDESC = 0x477 - SYS_SETIBMOPT = 0x478 - SYS_SETIBMSOCKOPT = 0x479 - SYS___SERVER_PWU = 0x480 - SYS_PTHREAD_TAG_NP = 0x481 - SYS___CONSOLE = 0x482 - SYS___WSINIT = 0x483 - SYS___IPTCPN = 0x489 - SYS___SERVER_CLASSIFY = 0x490 - SYS___HEAPRPT = 0x496 - SYS___ISBFP = 0x500 - SYS___FP_CAST = 0x501 - SYS___CERTIFICATE = 0x502 - SYS_SEND_FILE = 0x503 - SYS_AIO_CANCEL = 0x504 - SYS_AIO_ERROR = 0x505 - SYS_AIO_READ = 0x506 - SYS_AIO_RETURN = 0x507 - SYS_AIO_SUSPEND = 0x508 - SYS_AIO_WRITE = 0x509 - SYS_PTHREAD_RWLOCK_TRYWRLOCK = 0x510 - SYS_PTHREAD_RWLOCK_UNLOCK = 0x511 - SYS_PTHREAD_RWLOCK_WRLOCK = 0x512 - SYS_PTHREAD_RWLOCKATTR_GETPSHARED = 0x513 - SYS_PTHREAD_RWLOCKATTR_SETPSHARED = 0x514 - SYS_PTHREAD_RWLOCKATTR_INIT = 0x515 - SYS_PTHREAD_RWLOCKATTR_DESTROY = 0x516 - SYS___CTTBL = 0x517 - SYS_PTHREAD_MUTEXATTR_SETTYPE = 0x518 - SYS_PTHREAD_MUTEXATTR_GETTYPE = 0x519 - SYS___FP_UNORDERED = 0x520 - SYS___FP_READ_RND = 0x521 - SYS___FP_READ_RND_B = 0x522 - SYS___FP_SWAP_RND = 0x523 - SYS___FP_SWAP_RND_B = 0x524 - SYS___FP_LEVEL = 0x525 - SYS___FP_BTOH = 0x526 - SYS___FP_HTOB = 0x527 - SYS___FPC_RD = 0x528 - SYS___FPC_WR = 0x529 - SYS_PTHREAD_SETCANCELTYPE = 0x600 - SYS_PTHREAD_TESTCANCEL = 0x601 - SYS___ATANF_B = 0x602 - SYS___ATANL_B = 0x603 - SYS___CEILF_B = 0x604 - SYS___CEILL_B = 0x605 - SYS___COSF_B = 0x606 - SYS___COSL_B = 0x607 - SYS___FABSF_B = 0x608 - SYS___FABSL_B = 0x609 - SYS___SINF_B = 0x610 - SYS___SINL_B = 0x611 - SYS___TANF_B = 0x612 - SYS___TANL_B = 0x613 - SYS___TANHF_B = 0x614 - SYS___TANHL_B = 0x615 - SYS___ACOSF_B = 0x616 - SYS___ACOSL_B = 0x617 - SYS___ASINF_B = 0x618 - SYS___ASINL_B = 0x619 - SYS___LOGF_B = 0x620 - SYS___LOGL_B = 0x621 - SYS___LOG10F_B = 0x622 - SYS___LOG10L_B = 0x623 - SYS___POWF_B = 0x624 - SYS___POWL_B = 0x625 - SYS___SINHF_B = 0x626 - SYS___SINHL_B = 0x627 - SYS___SQRTF_B = 0x628 - SYS___SQRTL_B = 0x629 - SYS___MODFL_B = 0x630 - SYS_ABSF = 0x631 - SYS_ABSL = 0x632 - SYS_ACOSF = 0x633 - SYS_ACOSL = 0x634 - SYS_ASINF = 0x635 - SYS_ASINL = 0x636 - SYS_ATAN2F = 0x637 - SYS_ATAN2L = 0x638 - SYS_ATANF = 0x639 - SYS_COSHL = 0x640 - SYS_EXPF = 0x641 - SYS_EXPL = 0x642 - SYS_TANHF = 0x643 - SYS_TANHL = 0x644 - SYS_LOG10F = 0x645 - SYS_LOG10L = 0x646 - SYS_LOGF = 0x647 - SYS_LOGL = 0x648 - SYS_POWF = 0x649 - SYS_SINHL = 0x650 - SYS_TANF = 0x651 - SYS_TANL = 0x652 - SYS_FABSF = 0x653 - SYS_FABSL = 0x654 - SYS_FLOORF = 0x655 - SYS_FLOORL = 0x656 - SYS_FMODF = 0x657 - SYS_FMODL = 0x658 - SYS_FREXPF = 0x659 - SYS___CHATTR = 0x660 - SYS___FCHATTR = 0x661 - SYS___TOCCSID = 0x662 - SYS___CSNAMETYPE = 0x663 - SYS___TOCSNAME = 0x664 - SYS___CCSIDTYPE = 0x665 - SYS___AE_CORRESTBL_QUERY = 0x666 - SYS___AE_AUTOCONVERT_STATE = 0x667 - SYS_DN_FIND = 0x668 - SYS___GETHOSTBYADDR_A = 0x669 - SYS___MBLEN_SB_A = 0x670 - SYS___MBLEN_STD_A = 0x671 - SYS___MBLEN_UTF = 0x672 - SYS___MBSTOWCS_A = 0x673 - SYS___MBSTOWCS_STD_A = 0x674 - SYS___MBTOWC_A = 0x675 - SYS___MBTOWC_ISO1 = 0x676 - SYS___MBTOWC_SBCS = 0x677 - SYS___MBTOWC_MBCS = 0x678 - SYS___MBTOWC_UTF = 0x679 - SYS___CSID_A = 0x680 - SYS___CSID_STD_A = 0x681 - SYS___WCSID_A = 0x682 - SYS___WCSID_STD_A = 0x683 - SYS___WCTOMB_A = 0x684 - SYS___WCTOMB_ISO1 = 0x685 - SYS___WCTOMB_STD_A = 0x686 - SYS___WCTOMB_UTF = 0x687 - SYS___WCWIDTH_A = 0x688 - SYS___GETGRNAM_R_A = 0x689 - SYS___READDIR_R_A = 0x690 - SYS___E2A_S = 0x691 - SYS___FNMATCH_A = 0x692 - SYS___FNMATCH_C_A = 0x693 - SYS___EXECL_A = 0x694 - SYS___FNMATCH_STD_A = 0x695 - SYS___REGCOMP_A = 0x696 - SYS___REGCOMP_STD_A = 0x697 - SYS___REGERROR_A = 0x698 - SYS___REGERROR_STD_A = 0x699 - SYS___SWPRINTF_A = 0x700 - SYS___FSCANF_A = 0x701 - SYS___SCANF_A = 0x702 - SYS___SSCANF_A = 0x703 - SYS___SWSCANF_A = 0x704 - SYS___ATOF_A = 0x705 - SYS___ATOI_A = 0x706 - SYS___ATOL_A = 0x707 - SYS___STRTOD_A = 0x708 - SYS___STRTOL_A = 0x709 - SYS___L64A_A = 0x710 - SYS___STRERROR_A = 0x711 - SYS___PERROR_A = 0x712 - SYS___FETCH_A = 0x713 - SYS___GETENV_A = 0x714 - SYS___MKSTEMP_A = 0x717 - SYS___PTSNAME_A = 0x718 - SYS___PUTENV_A = 0x719 - SYS___CHDIR_A = 0x720 - SYS___CHOWN_A = 0x721 - SYS___CHROOT_A = 0x722 - SYS___GETCWD_A = 0x723 - SYS___GETWD_A = 0x724 - SYS___LCHOWN_A = 0x725 - SYS___LINK_A = 0x726 - SYS___PATHCONF_A = 0x727 - SYS___IF_NAMEINDEX_A = 0x728 - SYS___READLINK_A = 0x729 - SYS___EXTLINK_NP_A = 0x730 - SYS___ISALNUM_A = 0x731 - SYS___ISALPHA_A = 0x732 - SYS___A2E_S = 0x733 - SYS___ISCNTRL_A = 0x734 - SYS___ISDIGIT_A = 0x735 - SYS___ISGRAPH_A = 0x736 - SYS___ISLOWER_A = 0x737 - SYS___ISPRINT_A = 0x738 - SYS___ISPUNCT_A = 0x739 - SYS___ISWALPHA_A = 0x740 - SYS___A2E_L = 0x741 - SYS___ISWCNTRL_A = 0x742 - SYS___ISWDIGIT_A = 0x743 - SYS___ISWGRAPH_A = 0x744 - SYS___ISWLOWER_A = 0x745 - SYS___ISWPRINT_A = 0x746 - SYS___ISWPUNCT_A = 0x747 - SYS___ISWSPACE_A = 0x748 - SYS___ISWUPPER_A = 0x749 - SYS___REMOVE_A = 0x750 - SYS___RENAME_A = 0x751 - SYS___TMPNAM_A = 0x752 - SYS___FOPEN_A = 0x753 - SYS___FREOPEN_A = 0x754 - SYS___CUSERID_A = 0x755 - SYS___POPEN_A = 0x756 - SYS___TEMPNAM_A = 0x757 - SYS___FTW_A = 0x758 - SYS___GETGRENT_A = 0x759 - SYS___INET_NTOP_A = 0x760 - SYS___GETPASS_A = 0x761 - SYS___GETPWENT_A = 0x762 - SYS___GETPWNAM_A = 0x763 - SYS___GETPWUID_A = 0x764 - SYS_____CHECK_RESOURCE_AUTH_NP_A = 0x765 - SYS___CHECKSCHENV_A = 0x766 - SYS___CONNECTSERVER_A = 0x767 - SYS___CONNECTWORKMGR_A = 0x768 - SYS_____CONSOLE_A = 0x769 - SYS___MSGSND_A = 0x770 - SYS___MSGXRCV_A = 0x771 - SYS___NFTW_A = 0x772 - SYS_____PASSWD_A = 0x773 - SYS___PTHREAD_SECURITY_NP_A = 0x774 - SYS___QUERYMETRICS_A = 0x775 - SYS___QUERYSCHENV = 0x776 - SYS___READV_A = 0x777 - SYS_____SERVER_CLASSIFY_A = 0x778 - SYS_____SERVER_INIT_A = 0x779 - SYS___W_GETPSENT_A = 0x780 - SYS___WRITEV_A = 0x781 - SYS___W_STATFS_A = 0x782 - SYS___W_STATVFS_A = 0x783 - SYS___FPUTC_A = 0x784 - SYS___PUTCHAR_A = 0x785 - SYS___PUTS_A = 0x786 - SYS___FGETS_A = 0x787 - SYS___GETS_A = 0x788 - SYS___FPUTS_A = 0x789 - SYS___PUTC_A = 0x790 - SYS___AE_THREAD_SETMODE = 0x791 - SYS___AE_THREAD_SWAPMODE = 0x792 - SYS___GETNETBYADDR_A = 0x793 - SYS___GETNETBYNAME_A = 0x794 - SYS___GETNETENT_A = 0x795 - SYS___GETPROTOBYNAME_A = 0x796 - SYS___GETPROTOBYNUMBER_A = 0x797 - SYS___GETPROTOENT_A = 0x798 - SYS___GETSERVBYNAME_A = 0x799 - SYS_ACL_FIRST_ENTRY = 0x800 - SYS_ACL_GET_ENTRY = 0x801 - SYS_ACL_VALID = 0x802 - SYS_ACL_CREATE_ENTRY = 0x803 - SYS_ACL_DELETE_ENTRY = 0x804 - SYS_ACL_UPDATE_ENTRY = 0x805 - SYS_ACL_DELETE_FD = 0x806 - SYS_ACL_DELETE_FILE = 0x807 - SYS_ACL_GET_FD = 0x808 - SYS_ACL_GET_FILE = 0x809 - SYS___ERFL_B = 0x810 - SYS___ERFCL_B = 0x811 - SYS___LGAMMAL_B = 0x812 - SYS___SETHOOKEVENTS = 0x813 - SYS_IF_NAMETOINDEX = 0x814 - SYS_IF_INDEXTONAME = 0x815 - SYS_IF_NAMEINDEX = 0x816 - SYS_IF_FREENAMEINDEX = 0x817 - SYS_GETADDRINFO = 0x818 - SYS_GETNAMEINFO = 0x819 - SYS___DYNFREE_A = 0x820 - SYS___RES_QUERY_A = 0x821 - SYS___RES_SEARCH_A = 0x822 - SYS___RES_QUERYDOMAIN_A = 0x823 - SYS___RES_MKQUERY_A = 0x824 - SYS___RES_SEND_A = 0x825 - SYS___DN_EXPAND_A = 0x826 - SYS___DN_SKIPNAME_A = 0x827 - SYS___DN_COMP_A = 0x828 - SYS___DN_FIND_A = 0x829 - SYS___INET_NTOA_A = 0x830 - SYS___INET_NETWORK_A = 0x831 - SYS___ACCEPT_A = 0x832 - SYS___ACCEPT_AND_RECV_A = 0x833 - SYS___BIND_A = 0x834 - SYS___CONNECT_A = 0x835 - SYS___GETPEERNAME_A = 0x836 - SYS___GETSOCKNAME_A = 0x837 - SYS___RECVFROM_A = 0x838 - SYS___SENDTO_A = 0x839 - SYS___LCHATTR = 0x840 - SYS___WRITEDOWN = 0x841 - SYS_PTHREAD_MUTEX_INIT2 = 0x842 - SYS___ACOSHF_B = 0x843 - SYS___ACOSHL_B = 0x844 - SYS___ASINHF_B = 0x845 - SYS___ASINHL_B = 0x846 - SYS___ATANHF_B = 0x847 - SYS___ATANHL_B = 0x848 - SYS___CBRTF_B = 0x849 - SYS___EXP2F_B = 0x850 - SYS___EXP2L_B = 0x851 - SYS___EXPM1F_B = 0x852 - SYS___EXPM1L_B = 0x853 - SYS___FDIMF_B = 0x854 - SYS___FDIM_B = 0x855 - SYS___FDIML_B = 0x856 - SYS___HYPOTF_B = 0x857 - SYS___HYPOTL_B = 0x858 - SYS___LOG1PF_B = 0x859 - SYS___REMQUOF_B = 0x860 - SYS___REMQUO_B = 0x861 - SYS___REMQUOL_B = 0x862 - SYS___TGAMMAF_B = 0x863 - SYS___TGAMMA_B = 0x864 - SYS___TGAMMAL_B = 0x865 - SYS___TRUNCF_B = 0x866 - SYS___TRUNC_B = 0x867 - SYS___TRUNCL_B = 0x868 - SYS___LGAMMAF_B = 0x869 - SYS_ASINHF = 0x870 - SYS_ASINHL = 0x871 - SYS_ATANHF = 0x872 - SYS_ATANHL = 0x873 - SYS_CBRTF = 0x874 - SYS_CBRTL = 0x875 - SYS_COPYSIGNF = 0x876 - SYS_CPYSIGNF = 0x876 - SYS_COPYSIGNL = 0x877 - SYS_CPYSIGNL = 0x877 - SYS_COTANF = 0x878 - SYS___COTANF = 0x878 - SYS_COTAN = 0x879 - SYS___COTAN = 0x879 - SYS_FDIM = 0x881 - SYS_FDIML = 0x882 - SYS_HYPOTF = 0x883 - SYS_HYPOTL = 0x884 - SYS_LOG1PF = 0x885 - SYS_LOG1PL = 0x886 - SYS_LOG2F = 0x887 - SYS_LOG2 = 0x888 - SYS_LOG2L = 0x889 - SYS_TGAMMA = 0x890 - SYS_TGAMMAL = 0x891 - SYS_TRUNCF = 0x892 - SYS_TRUNC = 0x893 - SYS_TRUNCL = 0x894 - SYS_LGAMMAF = 0x895 - SYS_LGAMMAL = 0x896 - SYS_LROUNDF = 0x897 - SYS_LROUND = 0x898 - SYS_ERFF = 0x899 - SYS___COSHF_H = 0x900 - SYS___COSHL_H = 0x901 - SYS___COTAN_H = 0x902 - SYS___COTANF_H = 0x903 - SYS___COTANL_H = 0x904 - SYS___ERF_H = 0x905 - SYS___ERFF_H = 0x906 - SYS___ERFL_H = 0x907 - SYS___ERFC_H = 0x908 - SYS___ERFCF_H = 0x909 - SYS___FDIMF_H = 0x910 - SYS___FDIML_H = 0x911 - SYS___FMOD_H = 0x912 - SYS___FMODF_H = 0x913 - SYS___FMODL_H = 0x914 - SYS___GAMMA_H = 0x915 - SYS___HYPOT_H = 0x916 - SYS___ILOGB_H = 0x917 - SYS___LGAMMA_H = 0x918 - SYS___LGAMMAF_H = 0x919 - SYS___LOG2L_H = 0x920 - SYS___LOG1P_H = 0x921 - SYS___LOG10_H = 0x922 - SYS___LOG10F_H = 0x923 - SYS___LOG10L_H = 0x924 - SYS___LROUND_H = 0x925 - SYS___LROUNDF_H = 0x926 - SYS___NEXTAFTER_H = 0x927 - SYS___POW_H = 0x928 - SYS___POWF_H = 0x929 - SYS___SINL_H = 0x930 - SYS___SINH_H = 0x931 - SYS___SINHF_H = 0x932 - SYS___SINHL_H = 0x933 - SYS___SQRT_H = 0x934 - SYS___SQRTF_H = 0x935 - SYS___SQRTL_H = 0x936 - SYS___TAN_H = 0x937 - SYS___TANF_H = 0x938 - SYS___TANL_H = 0x939 - SYS___TRUNCF_H = 0x940 - SYS___TRUNCL_H = 0x941 - SYS___COSH_H = 0x942 - SYS___LE_DEBUG_SET_RESUME_MCH = 0x943 - SYS_VFSCANF = 0x944 - SYS_VSCANF = 0x946 - SYS_VSSCANF = 0x948 - SYS_IMAXABS = 0x950 - SYS_IMAXDIV = 0x951 - SYS_STRTOIMAX = 0x952 - SYS_STRTOUMAX = 0x953 - SYS_WCSTOIMAX = 0x954 - SYS_WCSTOUMAX = 0x955 - SYS_ATOLL = 0x956 - SYS_STRTOF = 0x957 - SYS_STRTOLD = 0x958 - SYS_WCSTOF = 0x959 - SYS_INET6_RTH_GETADDR = 0x960 - SYS_INET6_OPT_INIT = 0x961 - SYS_INET6_OPT_APPEND = 0x962 - SYS_INET6_OPT_FINISH = 0x963 - SYS_INET6_OPT_SET_VAL = 0x964 - SYS_INET6_OPT_NEXT = 0x965 - SYS_INET6_OPT_FIND = 0x966 - SYS_INET6_OPT_GET_VAL = 0x967 - SYS___POW_I = 0x987 - SYS___POW_I_B = 0x988 - SYS___POW_I_H = 0x989 - SYS___CABS_H = 0x990 - SYS_CABSF = 0x991 - SYS___CABSF_B = 0x992 - SYS___CABSF_H = 0x993 - SYS_CABSL = 0x994 - SYS___CABSL_B = 0x995 - SYS___CABSL_H = 0x996 - SYS_CACOS = 0x997 - SYS___CACOS_B = 0x998 - SYS___CACOS_H = 0x999 + SYS_LOG = 0x17 // 23 + SYS_COSH = 0x18 // 24 + SYS_TANH = 0x19 // 25 + SYS_EXP = 0x1A // 26 + SYS_MODF = 0x1B // 27 + SYS_LOG10 = 0x1C // 28 + SYS_FREXP = 0x1D // 29 + SYS_LDEXP = 0x1E // 30 + SYS_CEIL = 0x1F // 31 + SYS_POW = 0x20 // 32 + SYS_SQRT = 0x21 // 33 + SYS_FLOOR = 0x22 // 34 + SYS_J1 = 0x23 // 35 + SYS_FABS = 0x24 // 36 + SYS_FMOD = 0x25 // 37 + SYS_J0 = 0x26 // 38 + SYS_YN = 0x27 // 39 + SYS_JN = 0x28 // 40 + SYS_Y0 = 0x29 // 41 + SYS_Y1 = 0x2A // 42 + SYS_HYPOT = 0x2B // 43 + SYS_ERF = 0x2C // 44 + SYS_ERFC = 0x2D // 45 + SYS_GAMMA = 0x2E // 46 + SYS_ISALPHA = 0x30 // 48 + SYS_ISALNUM = 0x31 // 49 + SYS_ISLOWER = 0x32 // 50 + SYS_ISCNTRL = 0x33 // 51 + SYS_ISDIGIT = 0x34 // 52 + SYS_ISGRAPH = 0x35 // 53 + SYS_ISUPPER = 0x36 // 54 + SYS_ISPRINT = 0x37 // 55 + SYS_ISPUNCT = 0x38 // 56 + SYS_ISSPACE = 0x39 // 57 + SYS_SETLOCAL = 0x3A // 58 + SYS_SETLOCALE = 0x3A // 58 + SYS_ISXDIGIT = 0x3B // 59 + SYS_TOLOWER = 0x3C // 60 + SYS_TOUPPER = 0x3D // 61 + SYS_ASIN = 0x3E // 62 + SYS_SIN = 0x3F // 63 + SYS_COS = 0x40 // 64 + SYS_TAN = 0x41 // 65 + SYS_SINH = 0x42 // 66 + SYS_ACOS = 0x43 // 67 + SYS_ATAN = 0x44 // 68 + SYS_ATAN2 = 0x45 // 69 + SYS_FTELL = 0x46 // 70 + SYS_FGETPOS = 0x47 // 71 + SYS_FSEEK = 0x48 // 72 + SYS_FSETPOS = 0x49 // 73 + SYS_FERROR = 0x4A // 74 + SYS_REWIND = 0x4B // 75 + SYS_CLEARERR = 0x4C // 76 + SYS_FEOF = 0x4D // 77 + SYS_ATOL = 0x4E // 78 + SYS_PERROR = 0x4F // 79 + SYS_ATOF = 0x50 // 80 + SYS_ATOI = 0x51 // 81 + SYS_RAND = 0x52 // 82 + SYS_STRTOD = 0x53 // 83 + SYS_STRTOL = 0x54 // 84 + SYS_STRTOUL = 0x55 // 85 + SYS_MALLOC = 0x56 // 86 + SYS_SRAND = 0x57 // 87 + SYS_CALLOC = 0x58 // 88 + SYS_FREE = 0x59 // 89 + SYS_EXIT = 0x5A // 90 + SYS_REALLOC = 0x5B // 91 + SYS_ABORT = 0x5C // 92 + SYS___ABORT = 0x5C // 92 + SYS_ATEXIT = 0x5D // 93 + SYS_RAISE = 0x5E // 94 + SYS_SETJMP = 0x5F // 95 + SYS_LONGJMP = 0x60 // 96 + SYS_SIGNAL = 0x61 // 97 + SYS_TMPNAM = 0x62 // 98 + SYS_REMOVE = 0x63 // 99 + SYS_RENAME = 0x64 // 100 + SYS_TMPFILE = 0x65 // 101 + SYS_FREOPEN = 0x66 // 102 + SYS_FCLOSE = 0x67 // 103 + SYS_FFLUSH = 0x68 // 104 + SYS_FOPEN = 0x69 // 105 + SYS_FSCANF = 0x6A // 106 + SYS_SETBUF = 0x6B // 107 + SYS_SETVBUF = 0x6C // 108 + SYS_FPRINTF = 0x6D // 109 + SYS_SSCANF = 0x6E // 110 + SYS_PRINTF = 0x6F // 111 + SYS_SCANF = 0x70 // 112 + SYS_SPRINTF = 0x71 // 113 + SYS_FGETC = 0x72 // 114 + SYS_VFPRINTF = 0x73 // 115 + SYS_VPRINTF = 0x74 // 116 + SYS_VSPRINTF = 0x75 // 117 + SYS_GETC = 0x76 // 118 + SYS_FGETS = 0x77 // 119 + SYS_FPUTC = 0x78 // 120 + SYS_FPUTS = 0x79 // 121 + SYS_PUTCHAR = 0x7A // 122 + SYS_GETCHAR = 0x7B // 123 + SYS_GETS = 0x7C // 124 + SYS_PUTC = 0x7D // 125 + SYS_FWRITE = 0x7E // 126 + SYS_PUTS = 0x7F // 127 + SYS_UNGETC = 0x80 // 128 + SYS_FREAD = 0x81 // 129 + SYS_WCSTOMBS = 0x82 // 130 + SYS_MBTOWC = 0x83 // 131 + SYS_WCTOMB = 0x84 // 132 + SYS_MBSTOWCS = 0x85 // 133 + SYS_WCSCPY = 0x86 // 134 + SYS_WCSCAT = 0x87 // 135 + SYS_WCSCHR = 0x88 // 136 + SYS_WCSCMP = 0x89 // 137 + SYS_WCSNCMP = 0x8A // 138 + SYS_WCSCSPN = 0x8B // 139 + SYS_WCSLEN = 0x8C // 140 + SYS_WCSNCAT = 0x8D // 141 + SYS_WCSSPN = 0x8E // 142 + SYS_WCSNCPY = 0x8F // 143 + SYS_ABS = 0x90 // 144 + SYS_DIV = 0x91 // 145 + SYS_LABS = 0x92 // 146 + SYS_STRNCPY = 0x93 // 147 + SYS_MEMCPY = 0x94 // 148 + SYS_MEMMOVE = 0x95 // 149 + SYS_STRCPY = 0x96 // 150 + SYS_STRCMP = 0x97 // 151 + SYS_STRCAT = 0x98 // 152 + SYS_STRNCAT = 0x99 // 153 + SYS_MEMCMP = 0x9A // 154 + SYS_MEMCHR = 0x9B // 155 + SYS_STRCOLL = 0x9C // 156 + SYS_STRNCMP = 0x9D // 157 + SYS_STRXFRM = 0x9E // 158 + SYS_STRRCHR = 0x9F // 159 + SYS_STRCHR = 0xA0 // 160 + SYS_STRCSPN = 0xA1 // 161 + SYS_STRPBRK = 0xA2 // 162 + SYS_MEMSET = 0xA3 // 163 + SYS_STRSPN = 0xA4 // 164 + SYS_STRSTR = 0xA5 // 165 + SYS_STRTOK = 0xA6 // 166 + SYS_DIFFTIME = 0xA7 // 167 + SYS_STRERROR = 0xA8 // 168 + SYS_STRLEN = 0xA9 // 169 + SYS_CLOCK = 0xAA // 170 + SYS_CTIME = 0xAB // 171 + SYS_MKTIME = 0xAC // 172 + SYS_TIME = 0xAD // 173 + SYS_ASCTIME = 0xAE // 174 + SYS_MBLEN = 0xAF // 175 + SYS_GMTIME = 0xB0 // 176 + SYS_LOCALTIM = 0xB1 // 177 + SYS_LOCALTIME = 0xB1 // 177 + SYS_STRFTIME = 0xB2 // 178 + SYS___GETCB = 0xB4 // 180 + SYS_FUPDATE = 0xB5 // 181 + SYS___FUPDT = 0xB5 // 181 + SYS_CLRMEMF = 0xBD // 189 + SYS___CLRMF = 0xBD // 189 + SYS_FETCHEP = 0xBF // 191 + SYS___FTCHEP = 0xBF // 191 + SYS_FLDATA = 0xC1 // 193 + SYS___FLDATA = 0xC1 // 193 + SYS_DYNFREE = 0xC2 // 194 + SYS___DYNFRE = 0xC2 // 194 + SYS_DYNALLOC = 0xC3 // 195 + SYS___DYNALL = 0xC3 // 195 + SYS___CDUMP = 0xC4 // 196 + SYS_CSNAP = 0xC5 // 197 + SYS___CSNAP = 0xC5 // 197 + SYS_CTRACE = 0xC6 // 198 + SYS___CTRACE = 0xC6 // 198 + SYS___CTEST = 0xC7 // 199 + SYS_SETENV = 0xC8 // 200 + SYS___SETENV = 0xC8 // 200 + SYS_CLEARENV = 0xC9 // 201 + SYS___CLRENV = 0xC9 // 201 + SYS___REGCOMP_STD = 0xEA // 234 + SYS_NL_LANGINFO = 0xFC // 252 + SYS_GETSYNTX = 0xFD // 253 + SYS_ISBLANK = 0xFE // 254 + SYS___ISBLNK = 0xFE // 254 + SYS_ISWALNUM = 0xFF // 255 + SYS_ISWALPHA = 0x100 // 256 + SYS_ISWBLANK = 0x101 // 257 + SYS___ISWBLK = 0x101 // 257 + SYS_ISWCNTRL = 0x102 // 258 + SYS_ISWDIGIT = 0x103 // 259 + SYS_ISWGRAPH = 0x104 // 260 + SYS_ISWLOWER = 0x105 // 261 + SYS_ISWPRINT = 0x106 // 262 + SYS_ISWPUNCT = 0x107 // 263 + SYS_ISWSPACE = 0x108 // 264 + SYS_ISWUPPER = 0x109 // 265 + SYS_ISWXDIGI = 0x10A // 266 + SYS_ISWXDIGIT = 0x10A // 266 + SYS_WCTYPE = 0x10B // 267 + SYS_ISWCTYPE = 0x10C // 268 + SYS_TOWLOWER = 0x10D // 269 + SYS_TOWUPPER = 0x10E // 270 + SYS_MBSINIT = 0x10F // 271 + SYS_WCTOB = 0x110 // 272 + SYS_MBRLEN = 0x111 // 273 + SYS_MBRTOWC = 0x112 // 274 + SYS_MBSRTOWC = 0x113 // 275 + SYS_MBSRTOWCS = 0x113 // 275 + SYS_WCRTOMB = 0x114 // 276 + SYS_WCSRTOMB = 0x115 // 277 + SYS_WCSRTOMBS = 0x115 // 277 + SYS___CSID = 0x116 // 278 + SYS___WCSID = 0x117 // 279 + SYS_STRPTIME = 0x118 // 280 + SYS___STRPTM = 0x118 // 280 + SYS_STRFMON = 0x119 // 281 + SYS___RPMTCH = 0x11A // 282 + SYS_WCSSTR = 0x11B // 283 + SYS_WCSTOK = 0x12C // 300 + SYS_WCSTOL = 0x12D // 301 + SYS_WCSTOD = 0x12E // 302 + SYS_WCSTOUL = 0x12F // 303 + SYS_WCSCOLL = 0x130 // 304 + SYS_WCSXFRM = 0x131 // 305 + SYS_WCSWIDTH = 0x132 // 306 + SYS_WCWIDTH = 0x133 // 307 + SYS_WCSFTIME = 0x134 // 308 + SYS_SWPRINTF = 0x135 // 309 + SYS_VSWPRINT = 0x136 // 310 + SYS_VSWPRINTF = 0x136 // 310 + SYS_SWSCANF = 0x137 // 311 + SYS_REGCOMP = 0x138 // 312 + SYS_REGEXEC = 0x139 // 313 + SYS_REGFREE = 0x13A // 314 + SYS_REGERROR = 0x13B // 315 + SYS_FGETWC = 0x13C // 316 + SYS_FGETWS = 0x13D // 317 + SYS_FPUTWC = 0x13E // 318 + SYS_FPUTWS = 0x13F // 319 + SYS_GETWC = 0x140 // 320 + SYS_GETWCHAR = 0x141 // 321 + SYS_PUTWC = 0x142 // 322 + SYS_PUTWCHAR = 0x143 // 323 + SYS_UNGETWC = 0x144 // 324 + SYS_ICONV_OPEN = 0x145 // 325 + SYS_ICONV = 0x146 // 326 + SYS_ICONV_CLOSE = 0x147 // 327 + SYS_ISMCCOLLEL = 0x14C // 332 + SYS_STRTOCOLL = 0x14D // 333 + SYS_COLLTOSTR = 0x14E // 334 + SYS_COLLEQUIV = 0x14F // 335 + SYS_COLLRANGE = 0x150 // 336 + SYS_CCLASS = 0x151 // 337 + SYS_COLLORDER = 0x152 // 338 + SYS___DEMANGLE = 0x154 // 340 + SYS_FDOPEN = 0x155 // 341 + SYS___ERRNO = 0x156 // 342 + SYS___ERRNO2 = 0x157 // 343 + SYS___TERROR = 0x158 // 344 + SYS_MAXCOLL = 0x169 // 361 + SYS_GETMCCOLL = 0x16A // 362 + SYS_GETWMCCOLL = 0x16B // 363 + SYS___ERR2AD = 0x16C // 364 + SYS_DLLQUERYFN = 0x16D // 365 + SYS_DLLQUERYVAR = 0x16E // 366 + SYS_DLLFREE = 0x16F // 367 + SYS_DLLLOAD = 0x170 // 368 + SYS__EXIT = 0x174 // 372 + SYS_ACCESS = 0x175 // 373 + SYS_ALARM = 0x176 // 374 + SYS_CFGETISPEED = 0x177 // 375 + SYS_CFGETOSPEED = 0x178 // 376 + SYS_CFSETISPEED = 0x179 // 377 + SYS_CFSETOSPEED = 0x17A // 378 + SYS_CHDIR = 0x17B // 379 + SYS_CHMOD = 0x17C // 380 + SYS_CHOWN = 0x17D // 381 + SYS_CLOSE = 0x17E // 382 + SYS_CLOSEDIR = 0x17F // 383 + SYS_CREAT = 0x180 // 384 + SYS_CTERMID = 0x181 // 385 + SYS_DUP = 0x182 // 386 + SYS_DUP2 = 0x183 // 387 + SYS_EXECL = 0x184 // 388 + SYS_EXECLE = 0x185 // 389 + SYS_EXECLP = 0x186 // 390 + SYS_EXECV = 0x187 // 391 + SYS_EXECVE = 0x188 // 392 + SYS_EXECVP = 0x189 // 393 + SYS_FCHMOD = 0x18A // 394 + SYS_FCHOWN = 0x18B // 395 + SYS_FCNTL = 0x18C // 396 + SYS_FILENO = 0x18D // 397 + SYS_FORK = 0x18E // 398 + SYS_FPATHCONF = 0x18F // 399 + SYS_FSTAT = 0x190 // 400 + SYS_FSYNC = 0x191 // 401 + SYS_FTRUNCATE = 0x192 // 402 + SYS_GETCWD = 0x193 // 403 + SYS_GETEGID = 0x194 // 404 + SYS_GETEUID = 0x195 // 405 + SYS_GETGID = 0x196 // 406 + SYS_GETGRGID = 0x197 // 407 + SYS_GETGRNAM = 0x198 // 408 + SYS_GETGROUPS = 0x199 // 409 + SYS_GETLOGIN = 0x19A // 410 + SYS_W_GETMNTENT = 0x19B // 411 + SYS_GETPGRP = 0x19C // 412 + SYS_GETPID = 0x19D // 413 + SYS_GETPPID = 0x19E // 414 + SYS_GETPWNAM = 0x19F // 415 + SYS_GETPWUID = 0x1A0 // 416 + SYS_GETUID = 0x1A1 // 417 + SYS_W_IOCTL = 0x1A2 // 418 + SYS_ISATTY = 0x1A3 // 419 + SYS_KILL = 0x1A4 // 420 + SYS_LINK = 0x1A5 // 421 + SYS_LSEEK = 0x1A6 // 422 + SYS_LSTAT = 0x1A7 // 423 + SYS_MKDIR = 0x1A8 // 424 + SYS_MKFIFO = 0x1A9 // 425 + SYS_MKNOD = 0x1AA // 426 + SYS_MOUNT = 0x1AB // 427 + SYS_OPEN = 0x1AC // 428 + SYS_OPENDIR = 0x1AD // 429 + SYS_PATHCONF = 0x1AE // 430 + SYS_PAUSE = 0x1AF // 431 + SYS_PIPE = 0x1B0 // 432 + SYS_W_GETPSENT = 0x1B1 // 433 + SYS_READ = 0x1B2 // 434 + SYS_READDIR = 0x1B3 // 435 + SYS_READLINK = 0x1B4 // 436 + SYS_REWINDDIR = 0x1B5 // 437 + SYS_RMDIR = 0x1B6 // 438 + SYS_SETEGID = 0x1B7 // 439 + SYS_SETEUID = 0x1B8 // 440 + SYS_SETGID = 0x1B9 // 441 + SYS_SETPGID = 0x1BA // 442 + SYS_SETSID = 0x1BB // 443 + SYS_SETUID = 0x1BC // 444 + SYS_SIGACTION = 0x1BD // 445 + SYS_SIGADDSET = 0x1BE // 446 + SYS_SIGDELSET = 0x1BF // 447 + SYS_SIGEMPTYSET = 0x1C0 // 448 + SYS_SIGFILLSET = 0x1C1 // 449 + SYS_SIGISMEMBER = 0x1C2 // 450 + SYS_SIGLONGJMP = 0x1C3 // 451 + SYS_SIGPENDING = 0x1C4 // 452 + SYS_SIGPROCMASK = 0x1C5 // 453 + SYS_SIGSETJMP = 0x1C6 // 454 + SYS_SIGSUSPEND = 0x1C7 // 455 + SYS_SLEEP = 0x1C8 // 456 + SYS_STAT = 0x1C9 // 457 + SYS_W_STATFS = 0x1CA // 458 + SYS_SYMLINK = 0x1CB // 459 + SYS_SYSCONF = 0x1CC // 460 + SYS_TCDRAIN = 0x1CD // 461 + SYS_TCFLOW = 0x1CE // 462 + SYS_TCFLUSH = 0x1CF // 463 + SYS_TCGETATTR = 0x1D0 // 464 + SYS_TCGETPGRP = 0x1D1 // 465 + SYS_TCSENDBREAK = 0x1D2 // 466 + SYS_TCSETATTR = 0x1D3 // 467 + SYS_TCSETPGRP = 0x1D4 // 468 + SYS_TIMES = 0x1D5 // 469 + SYS_TTYNAME = 0x1D6 // 470 + SYS_TZSET = 0x1D7 // 471 + SYS_UMASK = 0x1D8 // 472 + SYS_UMOUNT = 0x1D9 // 473 + SYS_UNAME = 0x1DA // 474 + SYS_UNLINK = 0x1DB // 475 + SYS_UTIME = 0x1DC // 476 + SYS_WAIT = 0x1DD // 477 + SYS_WAITPID = 0x1DE // 478 + SYS_WRITE = 0x1DF // 479 + SYS_CHAUDIT = 0x1E0 // 480 + SYS_FCHAUDIT = 0x1E1 // 481 + SYS_GETGROUPSBYNAME = 0x1E2 // 482 + SYS_SIGWAIT = 0x1E3 // 483 + SYS_PTHREAD_EXIT = 0x1E4 // 484 + SYS_PTHREAD_KILL = 0x1E5 // 485 + SYS_PTHREAD_ATTR_INIT = 0x1E6 // 486 + SYS_PTHREAD_ATTR_DESTROY = 0x1E7 // 487 + SYS_PTHREAD_ATTR_SETSTACKSIZE = 0x1E8 // 488 + SYS_PTHREAD_ATTR_GETSTACKSIZE = 0x1E9 // 489 + SYS_PTHREAD_ATTR_SETDETACHSTATE = 0x1EA // 490 + SYS_PTHREAD_ATTR_GETDETACHSTATE = 0x1EB // 491 + SYS_PTHREAD_ATTR_SETWEIGHT_NP = 0x1EC // 492 + SYS_PTHREAD_ATTR_GETWEIGHT_NP = 0x1ED // 493 + SYS_PTHREAD_CANCEL = 0x1EE // 494 + SYS_PTHREAD_CLEANUP_PUSH = 0x1EF // 495 + SYS_PTHREAD_CLEANUP_POP = 0x1F0 // 496 + SYS_PTHREAD_CONDATTR_INIT = 0x1F1 // 497 + SYS_PTHREAD_CONDATTR_DESTROY = 0x1F2 // 498 + SYS_PTHREAD_COND_INIT = 0x1F3 // 499 + SYS_PTHREAD_COND_DESTROY = 0x1F4 // 500 + SYS_PTHREAD_COND_SIGNAL = 0x1F5 // 501 + SYS_PTHREAD_COND_BROADCAST = 0x1F6 // 502 + SYS_PTHREAD_COND_WAIT = 0x1F7 // 503 + SYS_PTHREAD_COND_TIMEDWAIT = 0x1F8 // 504 + SYS_PTHREAD_CREATE = 0x1F9 // 505 + SYS_PTHREAD_DETACH = 0x1FA // 506 + SYS_PTHREAD_EQUAL = 0x1FB // 507 + SYS_PTHREAD_GETSPECIFIC = 0x1FC // 508 + SYS_PTHREAD_JOIN = 0x1FD // 509 + SYS_PTHREAD_KEY_CREATE = 0x1FE // 510 + SYS_PTHREAD_MUTEXATTR_INIT = 0x1FF // 511 + SYS_PTHREAD_MUTEXATTR_DESTROY = 0x200 // 512 + SYS_PTHREAD_MUTEXATTR_SETKIND_NP = 0x201 // 513 + SYS_PTHREAD_MUTEXATTR_GETKIND_NP = 0x202 // 514 + SYS_PTHREAD_MUTEX_INIT = 0x203 // 515 + SYS_PTHREAD_MUTEX_DESTROY = 0x204 // 516 + SYS_PTHREAD_MUTEX_LOCK = 0x205 // 517 + SYS_PTHREAD_MUTEX_TRYLOCK = 0x206 // 518 + SYS_PTHREAD_MUTEX_UNLOCK = 0x207 // 519 + SYS_PTHREAD_ONCE = 0x209 // 521 + SYS_PTHREAD_SELF = 0x20A // 522 + SYS_PTHREAD_SETINTR = 0x20B // 523 + SYS_PTHREAD_SETINTRTYPE = 0x20C // 524 + SYS_PTHREAD_SETSPECIFIC = 0x20D // 525 + SYS_PTHREAD_TESTINTR = 0x20E // 526 + SYS_PTHREAD_YIELD = 0x20F // 527 + SYS_TW_OPEN = 0x210 // 528 + SYS_TW_FCNTL = 0x211 // 529 + SYS_PTHREAD_JOIN_D4_NP = 0x212 // 530 + SYS_PTHREAD_CONDATTR_SETKIND_NP = 0x213 // 531 + SYS_PTHREAD_CONDATTR_GETKIND_NP = 0x214 // 532 + SYS_EXTLINK_NP = 0x215 // 533 + SYS___PASSWD = 0x216 // 534 + SYS_SETGROUPS = 0x217 // 535 + SYS_INITGROUPS = 0x218 // 536 + SYS_WCSPBRK = 0x23F // 575 + SYS_WCSRCHR = 0x240 // 576 + SYS_SVC99 = 0x241 // 577 + SYS___SVC99 = 0x241 // 577 + SYS_WCSWCS = 0x242 // 578 + SYS_LOCALECO = 0x243 // 579 + SYS_LOCALECONV = 0x243 // 579 + SYS___LIBREL = 0x244 // 580 + SYS_RELEASE = 0x245 // 581 + SYS___RLSE = 0x245 // 581 + SYS_FLOCATE = 0x246 // 582 + SYS___FLOCT = 0x246 // 582 + SYS_FDELREC = 0x247 // 583 + SYS___FDLREC = 0x247 // 583 + SYS_FETCH = 0x248 // 584 + SYS___FETCH = 0x248 // 584 + SYS_QSORT = 0x249 // 585 + SYS_GETENV = 0x24A // 586 + SYS_SYSTEM = 0x24B // 587 + SYS_BSEARCH = 0x24C // 588 + SYS_LDIV = 0x24D // 589 + SYS___THROW = 0x25E // 606 + SYS___RETHROW = 0x25F // 607 + SYS___CLEANUPCATCH = 0x260 // 608 + SYS___CATCHMATCH = 0x261 // 609 + SYS___CLEAN2UPCATCH = 0x262 // 610 + SYS_PUTENV = 0x26A // 618 + SYS___GETENV = 0x26F // 623 + SYS_GETPRIORITY = 0x270 // 624 + SYS_NICE = 0x271 // 625 + SYS_SETPRIORITY = 0x272 // 626 + SYS_GETITIMER = 0x273 // 627 + SYS_SETITIMER = 0x274 // 628 + SYS_MSGCTL = 0x275 // 629 + SYS_MSGGET = 0x276 // 630 + SYS_MSGRCV = 0x277 // 631 + SYS_MSGSND = 0x278 // 632 + SYS_MSGXRCV = 0x279 // 633 + SYS___MSGXR = 0x279 // 633 + SYS_SEMCTL = 0x27A // 634 + SYS_SEMGET = 0x27B // 635 + SYS_SEMOP = 0x27C // 636 + SYS_SHMAT = 0x27D // 637 + SYS_SHMCTL = 0x27E // 638 + SYS_SHMDT = 0x27F // 639 + SYS_SHMGET = 0x280 // 640 + SYS___GETIPC = 0x281 // 641 + SYS_SETGRENT = 0x282 // 642 + SYS_GETGRENT = 0x283 // 643 + SYS_ENDGRENT = 0x284 // 644 + SYS_SETPWENT = 0x285 // 645 + SYS_GETPWENT = 0x286 // 646 + SYS_ENDPWENT = 0x287 // 647 + SYS_BSD_SIGNAL = 0x288 // 648 + SYS_KILLPG = 0x289 // 649 + SYS_SIGALTSTACK = 0x28A // 650 + SYS_SIGHOLD = 0x28B // 651 + SYS_SIGIGNORE = 0x28C // 652 + SYS_SIGINTERRUPT = 0x28D // 653 + SYS_SIGPAUSE = 0x28E // 654 + SYS_SIGRELSE = 0x28F // 655 + SYS_SIGSET = 0x290 // 656 + SYS_SIGSTACK = 0x291 // 657 + SYS_GETRLIMIT = 0x292 // 658 + SYS_SETRLIMIT = 0x293 // 659 + SYS_GETRUSAGE = 0x294 // 660 + SYS_MMAP = 0x295 // 661 + SYS_MPROTECT = 0x296 // 662 + SYS_MSYNC = 0x297 // 663 + SYS_MUNMAP = 0x298 // 664 + SYS_CONFSTR = 0x299 // 665 + SYS_GETOPT = 0x29A // 666 + SYS_LCHOWN = 0x29B // 667 + SYS_TRUNCATE = 0x29C // 668 + SYS_GETSUBOPT = 0x29D // 669 + SYS_SETPGRP = 0x29E // 670 + SYS___GDERR = 0x29F // 671 + SYS___TZONE = 0x2A0 // 672 + SYS___DLGHT = 0x2A1 // 673 + SYS___OPARGF = 0x2A2 // 674 + SYS___OPOPTF = 0x2A3 // 675 + SYS___OPINDF = 0x2A4 // 676 + SYS___OPERRF = 0x2A5 // 677 + SYS_GETDATE = 0x2A6 // 678 + SYS_WAIT3 = 0x2A7 // 679 + SYS_WAITID = 0x2A8 // 680 + SYS___CATTRM = 0x2A9 // 681 + SYS___GDTRM = 0x2AA // 682 + SYS___RNDTRM = 0x2AB // 683 + SYS_CRYPT = 0x2AC // 684 + SYS_ENCRYPT = 0x2AD // 685 + SYS_SETKEY = 0x2AE // 686 + SYS___CNVBLK = 0x2AF // 687 + SYS___CRYTRM = 0x2B0 // 688 + SYS___ECRTRM = 0x2B1 // 689 + SYS_DRAND48 = 0x2B2 // 690 + SYS_ERAND48 = 0x2B3 // 691 + SYS_FSTATVFS = 0x2B4 // 692 + SYS_STATVFS = 0x2B5 // 693 + SYS_CATCLOSE = 0x2B6 // 694 + SYS_CATGETS = 0x2B7 // 695 + SYS_CATOPEN = 0x2B8 // 696 + SYS_BCMP = 0x2B9 // 697 + SYS_BCOPY = 0x2BA // 698 + SYS_BZERO = 0x2BB // 699 + SYS_FFS = 0x2BC // 700 + SYS_INDEX = 0x2BD // 701 + SYS_RINDEX = 0x2BE // 702 + SYS_STRCASECMP = 0x2BF // 703 + SYS_STRDUP = 0x2C0 // 704 + SYS_STRNCASECMP = 0x2C1 // 705 + SYS_INITSTATE = 0x2C2 // 706 + SYS_SETSTATE = 0x2C3 // 707 + SYS_RANDOM = 0x2C4 // 708 + SYS_SRANDOM = 0x2C5 // 709 + SYS_HCREATE = 0x2C6 // 710 + SYS_HDESTROY = 0x2C7 // 711 + SYS_HSEARCH = 0x2C8 // 712 + SYS_LFIND = 0x2C9 // 713 + SYS_LSEARCH = 0x2CA // 714 + SYS_TDELETE = 0x2CB // 715 + SYS_TFIND = 0x2CC // 716 + SYS_TSEARCH = 0x2CD // 717 + SYS_TWALK = 0x2CE // 718 + SYS_INSQUE = 0x2CF // 719 + SYS_REMQUE = 0x2D0 // 720 + SYS_POPEN = 0x2D1 // 721 + SYS_PCLOSE = 0x2D2 // 722 + SYS_SWAB = 0x2D3 // 723 + SYS_MEMCCPY = 0x2D4 // 724 + SYS_GETPAGESIZE = 0x2D8 // 728 + SYS_FCHDIR = 0x2D9 // 729 + SYS___OCLCK = 0x2DA // 730 + SYS___ATOE = 0x2DB // 731 + SYS___ATOE_L = 0x2DC // 732 + SYS___ETOA = 0x2DD // 733 + SYS___ETOA_L = 0x2DE // 734 + SYS_SETUTXENT = 0x2DF // 735 + SYS_GETUTXENT = 0x2E0 // 736 + SYS_ENDUTXENT = 0x2E1 // 737 + SYS_GETUTXID = 0x2E2 // 738 + SYS_GETUTXLINE = 0x2E3 // 739 + SYS_PUTUTXLINE = 0x2E4 // 740 + SYS_FMTMSG = 0x2E5 // 741 + SYS_JRAND48 = 0x2E6 // 742 + SYS_LRAND48 = 0x2E7 // 743 + SYS_MRAND48 = 0x2E8 // 744 + SYS_NRAND48 = 0x2E9 // 745 + SYS_LCONG48 = 0x2EA // 746 + SYS_SRAND48 = 0x2EB // 747 + SYS_SEED48 = 0x2EC // 748 + SYS_ISASCII = 0x2ED // 749 + SYS_TOASCII = 0x2EE // 750 + SYS_A64L = 0x2EF // 751 + SYS_L64A = 0x2F0 // 752 + SYS_UALARM = 0x2F1 // 753 + SYS_USLEEP = 0x2F2 // 754 + SYS___UTXTRM = 0x2F3 // 755 + SYS___SRCTRM = 0x2F4 // 756 + SYS_FTIME = 0x2F5 // 757 + SYS_GETTIMEOFDAY = 0x2F6 // 758 + SYS_DBM_CLEARERR = 0x2F7 // 759 + SYS_DBM_CLOSE = 0x2F8 // 760 + SYS_DBM_DELETE = 0x2F9 // 761 + SYS_DBM_ERROR = 0x2FA // 762 + SYS_DBM_FETCH = 0x2FB // 763 + SYS_DBM_FIRSTKEY = 0x2FC // 764 + SYS_DBM_NEXTKEY = 0x2FD // 765 + SYS_DBM_OPEN = 0x2FE // 766 + SYS_DBM_STORE = 0x2FF // 767 + SYS___NDMTRM = 0x300 // 768 + SYS_FTOK = 0x301 // 769 + SYS_BASENAME = 0x302 // 770 + SYS_DIRNAME = 0x303 // 771 + SYS_GETDTABLESIZE = 0x304 // 772 + SYS_MKSTEMP = 0x305 // 773 + SYS_MKTEMP = 0x306 // 774 + SYS_NFTW = 0x307 // 775 + SYS_GETWD = 0x308 // 776 + SYS_LOCKF = 0x309 // 777 + SYS__LONGJMP = 0x30D // 781 + SYS__SETJMP = 0x30E // 782 + SYS_VFORK = 0x30F // 783 + SYS_WORDEXP = 0x310 // 784 + SYS_WORDFREE = 0x311 // 785 + SYS_GETPGID = 0x312 // 786 + SYS_GETSID = 0x313 // 787 + SYS___UTMPXNAME = 0x314 // 788 + SYS_CUSERID = 0x315 // 789 + SYS_GETPASS = 0x316 // 790 + SYS_FNMATCH = 0x317 // 791 + SYS_FTW = 0x318 // 792 + SYS_GETW = 0x319 // 793 + SYS_GLOB = 0x31A // 794 + SYS_GLOBFREE = 0x31B // 795 + SYS_PUTW = 0x31C // 796 + SYS_SEEKDIR = 0x31D // 797 + SYS_TELLDIR = 0x31E // 798 + SYS_TEMPNAM = 0x31F // 799 + SYS_ACOSH = 0x320 // 800 + SYS_ASINH = 0x321 // 801 + SYS_ATANH = 0x322 // 802 + SYS_CBRT = 0x323 // 803 + SYS_EXPM1 = 0x324 // 804 + SYS_ILOGB = 0x325 // 805 + SYS_LOGB = 0x326 // 806 + SYS_LOG1P = 0x327 // 807 + SYS_NEXTAFTER = 0x328 // 808 + SYS_RINT = 0x329 // 809 + SYS_REMAINDER = 0x32A // 810 + SYS_SCALB = 0x32B // 811 + SYS_LGAMMA = 0x32C // 812 + SYS_TTYSLOT = 0x32D // 813 + SYS_GETTIMEOFDAY_R = 0x32E // 814 + SYS_SYNC = 0x32F // 815 + SYS_SPAWN = 0x330 // 816 + SYS_SPAWNP = 0x331 // 817 + SYS_GETLOGIN_UU = 0x332 // 818 + SYS_ECVT = 0x333 // 819 + SYS_FCVT = 0x334 // 820 + SYS_GCVT = 0x335 // 821 + SYS_ACCEPT = 0x336 // 822 + SYS_BIND = 0x337 // 823 + SYS_CONNECT = 0x338 // 824 + SYS_ENDHOSTENT = 0x339 // 825 + SYS_ENDPROTOENT = 0x33A // 826 + SYS_ENDSERVENT = 0x33B // 827 + SYS_GETHOSTBYADDR_R = 0x33C // 828 + SYS_GETHOSTBYADDR = 0x33D // 829 + SYS_GETHOSTBYNAME_R = 0x33E // 830 + SYS_GETHOSTBYNAME = 0x33F // 831 + SYS_GETHOSTENT = 0x340 // 832 + SYS_GETHOSTID = 0x341 // 833 + SYS_GETHOSTNAME = 0x342 // 834 + SYS_GETNETBYADDR = 0x343 // 835 + SYS_GETNETBYNAME = 0x344 // 836 + SYS_GETNETENT = 0x345 // 837 + SYS_GETPEERNAME = 0x346 // 838 + SYS_GETPROTOBYNAME = 0x347 // 839 + SYS_GETPROTOBYNUMBER = 0x348 // 840 + SYS_GETPROTOENT = 0x349 // 841 + SYS_GETSERVBYNAME = 0x34A // 842 + SYS_GETSERVBYPORT = 0x34B // 843 + SYS_GETSERVENT = 0x34C // 844 + SYS_GETSOCKNAME = 0x34D // 845 + SYS_GETSOCKOPT = 0x34E // 846 + SYS_INET_ADDR = 0x34F // 847 + SYS_INET_LNAOF = 0x350 // 848 + SYS_INET_MAKEADDR = 0x351 // 849 + SYS_INET_NETOF = 0x352 // 850 + SYS_INET_NETWORK = 0x353 // 851 + SYS_INET_NTOA = 0x354 // 852 + SYS_IOCTL = 0x355 // 853 + SYS_LISTEN = 0x356 // 854 + SYS_READV = 0x357 // 855 + SYS_RECV = 0x358 // 856 + SYS_RECVFROM = 0x359 // 857 + SYS_SELECT = 0x35B // 859 + SYS_SELECTEX = 0x35C // 860 + SYS_SEND = 0x35D // 861 + SYS_SENDTO = 0x35F // 863 + SYS_SETHOSTENT = 0x360 // 864 + SYS_SETNETENT = 0x361 // 865 + SYS_SETPEER = 0x362 // 866 + SYS_SETPROTOENT = 0x363 // 867 + SYS_SETSERVENT = 0x364 // 868 + SYS_SETSOCKOPT = 0x365 // 869 + SYS_SHUTDOWN = 0x366 // 870 + SYS_SOCKET = 0x367 // 871 + SYS_SOCKETPAIR = 0x368 // 872 + SYS_WRITEV = 0x369 // 873 + SYS_CHROOT = 0x36A // 874 + SYS_W_STATVFS = 0x36B // 875 + SYS_ULIMIT = 0x36C // 876 + SYS_ISNAN = 0x36D // 877 + SYS_UTIMES = 0x36E // 878 + SYS___H_ERRNO = 0x36F // 879 + SYS_ENDNETENT = 0x370 // 880 + SYS_CLOSELOG = 0x371 // 881 + SYS_OPENLOG = 0x372 // 882 + SYS_SETLOGMASK = 0x373 // 883 + SYS_SYSLOG = 0x374 // 884 + SYS_PTSNAME = 0x375 // 885 + SYS_SETREUID = 0x376 // 886 + SYS_SETREGID = 0x377 // 887 + SYS_REALPATH = 0x378 // 888 + SYS___SIGNGAM = 0x379 // 889 + SYS_GRANTPT = 0x37A // 890 + SYS_UNLOCKPT = 0x37B // 891 + SYS_TCGETSID = 0x37C // 892 + SYS___TCGETCP = 0x37D // 893 + SYS___TCSETCP = 0x37E // 894 + SYS___TCSETTABLES = 0x37F // 895 + SYS_POLL = 0x380 // 896 + SYS_REXEC = 0x381 // 897 + SYS___ISASCII2 = 0x382 // 898 + SYS___TOASCII2 = 0x383 // 899 + SYS_CHPRIORITY = 0x384 // 900 + SYS_PTHREAD_ATTR_SETSYNCTYPE_NP = 0x385 // 901 + SYS_PTHREAD_ATTR_GETSYNCTYPE_NP = 0x386 // 902 + SYS_PTHREAD_SET_LIMIT_NP = 0x387 // 903 + SYS___STNETENT = 0x388 // 904 + SYS___STPROTOENT = 0x389 // 905 + SYS___STSERVENT = 0x38A // 906 + SYS___STHOSTENT = 0x38B // 907 + SYS_NLIST = 0x38C // 908 + SYS___IPDBCS = 0x38D // 909 + SYS___IPDSPX = 0x38E // 910 + SYS___IPMSGC = 0x38F // 911 + SYS___SELECT1 = 0x390 // 912 + SYS_PTHREAD_SECURITY_NP = 0x391 // 913 + SYS___CHECK_RESOURCE_AUTH_NP = 0x392 // 914 + SYS___CONVERT_ID_NP = 0x393 // 915 + SYS___OPENVMREL = 0x394 // 916 + SYS_WMEMCHR = 0x395 // 917 + SYS_WMEMCMP = 0x396 // 918 + SYS_WMEMCPY = 0x397 // 919 + SYS_WMEMMOVE = 0x398 // 920 + SYS_WMEMSET = 0x399 // 921 + SYS___FPUTWC = 0x400 // 1024 + SYS___PUTWC = 0x401 // 1025 + SYS___PWCHAR = 0x402 // 1026 + SYS___WCSFTM = 0x403 // 1027 + SYS___WCSTOK = 0x404 // 1028 + SYS___WCWDTH = 0x405 // 1029 + SYS_T_ACCEPT = 0x409 // 1033 + SYS_T_ALLOC = 0x40A // 1034 + SYS_T_BIND = 0x40B // 1035 + SYS_T_CLOSE = 0x40C // 1036 + SYS_T_CONNECT = 0x40D // 1037 + SYS_T_ERROR = 0x40E // 1038 + SYS_T_FREE = 0x40F // 1039 + SYS_T_GETINFO = 0x410 // 1040 + SYS_T_GETPROTADDR = 0x411 // 1041 + SYS_T_GETSTATE = 0x412 // 1042 + SYS_T_LISTEN = 0x413 // 1043 + SYS_T_LOOK = 0x414 // 1044 + SYS_T_OPEN = 0x415 // 1045 + SYS_T_OPTMGMT = 0x416 // 1046 + SYS_T_RCV = 0x417 // 1047 + SYS_T_RCVCONNECT = 0x418 // 1048 + SYS_T_RCVDIS = 0x419 // 1049 + SYS_T_RCVREL = 0x41A // 1050 + SYS_T_RCVUDATA = 0x41B // 1051 + SYS_T_RCVUDERR = 0x41C // 1052 + SYS_T_SND = 0x41D // 1053 + SYS_T_SNDDIS = 0x41E // 1054 + SYS_T_SNDREL = 0x41F // 1055 + SYS_T_SNDUDATA = 0x420 // 1056 + SYS_T_STRERROR = 0x421 // 1057 + SYS_T_SYNC = 0x422 // 1058 + SYS_T_UNBIND = 0x423 // 1059 + SYS___T_ERRNO = 0x424 // 1060 + SYS___RECVMSG2 = 0x425 // 1061 + SYS___SENDMSG2 = 0x426 // 1062 + SYS_FATTACH = 0x427 // 1063 + SYS_FDETACH = 0x428 // 1064 + SYS_GETMSG = 0x429 // 1065 + SYS_GETPMSG = 0x42A // 1066 + SYS_ISASTREAM = 0x42B // 1067 + SYS_PUTMSG = 0x42C // 1068 + SYS_PUTPMSG = 0x42D // 1069 + SYS___ISPOSIXON = 0x42E // 1070 + SYS___OPENMVSREL = 0x42F // 1071 + SYS_GETCONTEXT = 0x430 // 1072 + SYS_SETCONTEXT = 0x431 // 1073 + SYS_MAKECONTEXT = 0x432 // 1074 + SYS_SWAPCONTEXT = 0x433 // 1075 + SYS_PTHREAD_GETSPECIFIC_D8_NP = 0x434 // 1076 + SYS_GETCLIENTID = 0x470 // 1136 + SYS___GETCLIENTID = 0x471 // 1137 + SYS_GETSTABLESIZE = 0x472 // 1138 + SYS_GETIBMOPT = 0x473 // 1139 + SYS_GETIBMSOCKOPT = 0x474 // 1140 + SYS_GIVESOCKET = 0x475 // 1141 + SYS_IBMSFLUSH = 0x476 // 1142 + SYS_MAXDESC = 0x477 // 1143 + SYS_SETIBMOPT = 0x478 // 1144 + SYS_SETIBMSOCKOPT = 0x479 // 1145 + SYS_SOCK_DEBUG = 0x47A // 1146 + SYS_SOCK_DO_TESTSTOR = 0x47D // 1149 + SYS_TAKESOCKET = 0x47E // 1150 + SYS___SERVER_INIT = 0x47F // 1151 + SYS___SERVER_PWU = 0x480 // 1152 + SYS_PTHREAD_TAG_NP = 0x481 // 1153 + SYS___CONSOLE = 0x482 // 1154 + SYS___WSINIT = 0x483 // 1155 + SYS___IPTCPN = 0x489 // 1161 + SYS___SMF_RECORD = 0x48A // 1162 + SYS___IPHOST = 0x48B // 1163 + SYS___IPNODE = 0x48C // 1164 + SYS___SERVER_CLASSIFY_CREATE = 0x48D // 1165 + SYS___SERVER_CLASSIFY_DESTROY = 0x48E // 1166 + SYS___SERVER_CLASSIFY_RESET = 0x48F // 1167 + SYS___SERVER_CLASSIFY = 0x490 // 1168 + SYS___HEAPRPT = 0x496 // 1174 + SYS___FNWSA = 0x49B // 1179 + SYS___SPAWN2 = 0x49D // 1181 + SYS___SPAWNP2 = 0x49E // 1182 + SYS___GDRR = 0x4A1 // 1185 + SYS___HRRNO = 0x4A2 // 1186 + SYS___OPRG = 0x4A3 // 1187 + SYS___OPRR = 0x4A4 // 1188 + SYS___OPND = 0x4A5 // 1189 + SYS___OPPT = 0x4A6 // 1190 + SYS___SIGGM = 0x4A7 // 1191 + SYS___DGHT = 0x4A8 // 1192 + SYS___TZNE = 0x4A9 // 1193 + SYS___TZZN = 0x4AA // 1194 + SYS___TRRNO = 0x4AF // 1199 + SYS___ENVN = 0x4B0 // 1200 + SYS___MLOCKALL = 0x4B1 // 1201 + SYS_CREATEWO = 0x4B2 // 1202 + SYS_CREATEWORKUNIT = 0x4B2 // 1202 + SYS_CONTINUE = 0x4B3 // 1203 + SYS_CONTINUEWORKUNIT = 0x4B3 // 1203 + SYS_CONNECTW = 0x4B4 // 1204 + SYS_CONNECTWORKMGR = 0x4B4 // 1204 + SYS_CONNECTS = 0x4B5 // 1205 + SYS_CONNECTSERVER = 0x4B5 // 1205 + SYS_DISCONNE = 0x4B6 // 1206 + SYS_DISCONNECTSERVER = 0x4B6 // 1206 + SYS_JOINWORK = 0x4B7 // 1207 + SYS_JOINWORKUNIT = 0x4B7 // 1207 + SYS_LEAVEWOR = 0x4B8 // 1208 + SYS_LEAVEWORKUNIT = 0x4B8 // 1208 + SYS_DELETEWO = 0x4B9 // 1209 + SYS_DELETEWORKUNIT = 0x4B9 // 1209 + SYS_QUERYMET = 0x4BA // 1210 + SYS_QUERYMETRICS = 0x4BA // 1210 + SYS_QUERYSCH = 0x4BB // 1211 + SYS_QUERYSCHENV = 0x4BB // 1211 + SYS_CHECKSCH = 0x4BC // 1212 + SYS_CHECKSCHENV = 0x4BC // 1212 + SYS___PID_AFFINITY = 0x4BD // 1213 + SYS___ASINH_B = 0x4BE // 1214 + SYS___ATAN_B = 0x4BF // 1215 + SYS___CBRT_B = 0x4C0 // 1216 + SYS___CEIL_B = 0x4C1 // 1217 + SYS_COPYSIGN = 0x4C2 // 1218 + SYS___COS_B = 0x4C3 // 1219 + SYS___ERF_B = 0x4C4 // 1220 + SYS___ERFC_B = 0x4C5 // 1221 + SYS___EXPM1_B = 0x4C6 // 1222 + SYS___FABS_B = 0x4C7 // 1223 + SYS_FINITE = 0x4C8 // 1224 + SYS___FLOOR_B = 0x4C9 // 1225 + SYS___FREXP_B = 0x4CA // 1226 + SYS___ILOGB_B = 0x4CB // 1227 + SYS___ISNAN_B = 0x4CC // 1228 + SYS___LDEXP_B = 0x4CD // 1229 + SYS___LOG1P_B = 0x4CE // 1230 + SYS___LOGB_B = 0x4CF // 1231 + SYS_MATHERR = 0x4D0 // 1232 + SYS___MODF_B = 0x4D1 // 1233 + SYS___NEXTAFTER_B = 0x4D2 // 1234 + SYS___RINT_B = 0x4D3 // 1235 + SYS_SCALBN = 0x4D4 // 1236 + SYS_SIGNIFIC = 0x4D5 // 1237 + SYS_SIGNIFICAND = 0x4D5 // 1237 + SYS___SIN_B = 0x4D6 // 1238 + SYS___TAN_B = 0x4D7 // 1239 + SYS___TANH_B = 0x4D8 // 1240 + SYS___ACOS_B = 0x4D9 // 1241 + SYS___ACOSH_B = 0x4DA // 1242 + SYS___ASIN_B = 0x4DB // 1243 + SYS___ATAN2_B = 0x4DC // 1244 + SYS___ATANH_B = 0x4DD // 1245 + SYS___COSH_B = 0x4DE // 1246 + SYS___EXP_B = 0x4DF // 1247 + SYS___FMOD_B = 0x4E0 // 1248 + SYS___GAMMA_B = 0x4E1 // 1249 + SYS_GAMMA_R = 0x4E2 // 1250 + SYS___HYPOT_B = 0x4E3 // 1251 + SYS___J0_B = 0x4E4 // 1252 + SYS___Y0_B = 0x4E5 // 1253 + SYS___J1_B = 0x4E6 // 1254 + SYS___Y1_B = 0x4E7 // 1255 + SYS___JN_B = 0x4E8 // 1256 + SYS___YN_B = 0x4E9 // 1257 + SYS___LGAMMA_B = 0x4EA // 1258 + SYS_LGAMMA_R = 0x4EB // 1259 + SYS___LOG_B = 0x4EC // 1260 + SYS___LOG10_B = 0x4ED // 1261 + SYS___POW_B = 0x4EE // 1262 + SYS___REMAINDER_B = 0x4EF // 1263 + SYS___SCALB_B = 0x4F0 // 1264 + SYS___SINH_B = 0x4F1 // 1265 + SYS___SQRT_B = 0x4F2 // 1266 + SYS___OPENDIR2 = 0x4F3 // 1267 + SYS___READDIR2 = 0x4F4 // 1268 + SYS___LOGIN = 0x4F5 // 1269 + SYS___OPEN_STAT = 0x4F6 // 1270 + SYS_ACCEPT_AND_RECV = 0x4F7 // 1271 + SYS___FP_SETMODE = 0x4F8 // 1272 + SYS___SIGACTIONSET = 0x4FB // 1275 + SYS___UCREATE = 0x4FC // 1276 + SYS___UMALLOC = 0x4FD // 1277 + SYS___UFREE = 0x4FE // 1278 + SYS___UHEAPREPORT = 0x4FF // 1279 + SYS___ISBFP = 0x500 // 1280 + SYS___FP_CAST = 0x501 // 1281 + SYS___CERTIFICATE = 0x502 // 1282 + SYS_SEND_FILE = 0x503 // 1283 + SYS_AIO_CANCEL = 0x504 // 1284 + SYS_AIO_ERROR = 0x505 // 1285 + SYS_AIO_READ = 0x506 // 1286 + SYS_AIO_RETURN = 0x507 // 1287 + SYS_AIO_SUSPEND = 0x508 // 1288 + SYS_AIO_WRITE = 0x509 // 1289 + SYS_PTHREAD_MUTEXATTR_GETPSHARED = 0x50A // 1290 + SYS_PTHREAD_MUTEXATTR_SETPSHARED = 0x50B // 1291 + SYS_PTHREAD_RWLOCK_DESTROY = 0x50C // 1292 + SYS_PTHREAD_RWLOCK_INIT = 0x50D // 1293 + SYS_PTHREAD_RWLOCK_RDLOCK = 0x50E // 1294 + SYS_PTHREAD_RWLOCK_TRYRDLOCK = 0x50F // 1295 + SYS_PTHREAD_RWLOCK_TRYWRLOCK = 0x510 // 1296 + SYS_PTHREAD_RWLOCK_UNLOCK = 0x511 // 1297 + SYS_PTHREAD_RWLOCK_WRLOCK = 0x512 // 1298 + SYS_PTHREAD_RWLOCKATTR_GETPSHARED = 0x513 // 1299 + SYS_PTHREAD_RWLOCKATTR_SETPSHARED = 0x514 // 1300 + SYS_PTHREAD_RWLOCKATTR_INIT = 0x515 // 1301 + SYS_PTHREAD_RWLOCKATTR_DESTROY = 0x516 // 1302 + SYS___CTTBL = 0x517 // 1303 + SYS_PTHREAD_MUTEXATTR_SETTYPE = 0x518 // 1304 + SYS_PTHREAD_MUTEXATTR_GETTYPE = 0x519 // 1305 + SYS___FP_CLR_FLAG = 0x51A // 1306 + SYS___FP_READ_FLAG = 0x51B // 1307 + SYS___FP_RAISE_XCP = 0x51C // 1308 + SYS___FP_CLASS = 0x51D // 1309 + SYS___FP_FINITE = 0x51E // 1310 + SYS___FP_ISNAN = 0x51F // 1311 + SYS___FP_UNORDERED = 0x520 // 1312 + SYS___FP_READ_RND = 0x521 // 1313 + SYS___FP_READ_RND_B = 0x522 // 1314 + SYS___FP_SWAP_RND = 0x523 // 1315 + SYS___FP_SWAP_RND_B = 0x524 // 1316 + SYS___FP_LEVEL = 0x525 // 1317 + SYS___FP_BTOH = 0x526 // 1318 + SYS___FP_HTOB = 0x527 // 1319 + SYS___FPC_RD = 0x528 // 1320 + SYS___FPC_WR = 0x529 // 1321 + SYS___FPC_RW = 0x52A // 1322 + SYS___FPC_SM = 0x52B // 1323 + SYS___FPC_RS = 0x52C // 1324 + SYS_SIGTIMEDWAIT = 0x52D // 1325 + SYS_SIGWAITINFO = 0x52E // 1326 + SYS___CHKBFP = 0x52F // 1327 + SYS___W_PIOCTL = 0x59E // 1438 + SYS___OSENV = 0x59F // 1439 + SYS_EXPORTWO = 0x5A1 // 1441 + SYS_EXPORTWORKUNIT = 0x5A1 // 1441 + SYS_UNDOEXPO = 0x5A2 // 1442 + SYS_UNDOEXPORTWORKUNIT = 0x5A2 // 1442 + SYS_IMPORTWO = 0x5A3 // 1443 + SYS_IMPORTWORKUNIT = 0x5A3 // 1443 + SYS_UNDOIMPO = 0x5A4 // 1444 + SYS_UNDOIMPORTWORKUNIT = 0x5A4 // 1444 + SYS_EXTRACTW = 0x5A5 // 1445 + SYS_EXTRACTWORKUNIT = 0x5A5 // 1445 + SYS___CPL = 0x5A6 // 1446 + SYS___MAP_INIT = 0x5A7 // 1447 + SYS___MAP_SERVICE = 0x5A8 // 1448 + SYS_SIGQUEUE = 0x5A9 // 1449 + SYS___MOUNT = 0x5AA // 1450 + SYS___GETUSERID = 0x5AB // 1451 + SYS___IPDOMAINNAME = 0x5AC // 1452 + SYS_QUERYENC = 0x5AD // 1453 + SYS_QUERYWORKUNITCLASSIFICATION = 0x5AD // 1453 + SYS_CONNECTE = 0x5AE // 1454 + SYS_CONNECTEXPORTIMPORT = 0x5AE // 1454 + SYS___FP_SWAPMODE = 0x5AF // 1455 + SYS_STRTOLL = 0x5B0 // 1456 + SYS_STRTOULL = 0x5B1 // 1457 + SYS___DSA_PREV = 0x5B2 // 1458 + SYS___EP_FIND = 0x5B3 // 1459 + SYS___SERVER_THREADS_QUERY = 0x5B4 // 1460 + SYS___MSGRCV_TIMED = 0x5B7 // 1463 + SYS___SEMOP_TIMED = 0x5B8 // 1464 + SYS___GET_CPUID = 0x5B9 // 1465 + SYS___GET_SYSTEM_SETTINGS = 0x5BA // 1466 + SYS_FTELLO = 0x5C8 // 1480 + SYS_FSEEKO = 0x5C9 // 1481 + SYS_LLDIV = 0x5CB // 1483 + SYS_WCSTOLL = 0x5CC // 1484 + SYS_WCSTOULL = 0x5CD // 1485 + SYS_LLABS = 0x5CE // 1486 + SYS___CONSOLE2 = 0x5D2 // 1490 + SYS_INET_NTOP = 0x5D3 // 1491 + SYS_INET_PTON = 0x5D4 // 1492 + SYS___RES = 0x5D6 // 1494 + SYS_RES_MKQUERY = 0x5D7 // 1495 + SYS_RES_INIT = 0x5D8 // 1496 + SYS_RES_QUERY = 0x5D9 // 1497 + SYS_RES_SEARCH = 0x5DA // 1498 + SYS_RES_SEND = 0x5DB // 1499 + SYS_RES_QUERYDOMAIN = 0x5DC // 1500 + SYS_DN_EXPAND = 0x5DD // 1501 + SYS_DN_SKIPNAME = 0x5DE // 1502 + SYS_DN_COMP = 0x5DF // 1503 + SYS_ASCTIME_R = 0x5E0 // 1504 + SYS_CTIME_R = 0x5E1 // 1505 + SYS_GMTIME_R = 0x5E2 // 1506 + SYS_LOCALTIME_R = 0x5E3 // 1507 + SYS_RAND_R = 0x5E4 // 1508 + SYS_STRTOK_R = 0x5E5 // 1509 + SYS_READDIR_R = 0x5E6 // 1510 + SYS_GETGRGID_R = 0x5E7 // 1511 + SYS_GETGRNAM_R = 0x5E8 // 1512 + SYS_GETLOGIN_R = 0x5E9 // 1513 + SYS_GETPWNAM_R = 0x5EA // 1514 + SYS_GETPWUID_R = 0x5EB // 1515 + SYS_TTYNAME_R = 0x5EC // 1516 + SYS_PTHREAD_ATFORK = 0x5ED // 1517 + SYS_PTHREAD_ATTR_GETGUARDSIZE = 0x5EE // 1518 + SYS_PTHREAD_ATTR_GETSTACKADDR = 0x5EF // 1519 + SYS_PTHREAD_ATTR_SETGUARDSIZE = 0x5F0 // 1520 + SYS_PTHREAD_ATTR_SETSTACKADDR = 0x5F1 // 1521 + SYS_PTHREAD_CONDATTR_GETPSHARED = 0x5F2 // 1522 + SYS_PTHREAD_CONDATTR_SETPSHARED = 0x5F3 // 1523 + SYS_PTHREAD_GETCONCURRENCY = 0x5F4 // 1524 + SYS_PTHREAD_KEY_DELETE = 0x5F5 // 1525 + SYS_PTHREAD_SETCONCURRENCY = 0x5F6 // 1526 + SYS_PTHREAD_SIGMASK = 0x5F7 // 1527 + SYS___DISCARDDATA = 0x5F8 // 1528 + SYS_PTHREAD_ATTR_GETSCHEDPARAM = 0x5F9 // 1529 + SYS_PTHREAD_ATTR_SETSCHEDPARAM = 0x5FA // 1530 + SYS_PTHREAD_ATTR_GETDETACHSTATE_U98 = 0x5FB // 1531 + SYS_PTHREAD_ATTR_SETDETACHSTATE_U98 = 0x5FC // 1532 + SYS_PTHREAD_DETACH_U98 = 0x5FD // 1533 + SYS_PTHREAD_GETSPECIFIC_U98 = 0x5FE // 1534 + SYS_PTHREAD_SETCANCELSTATE = 0x5FF // 1535 + SYS_PTHREAD_SETCANCELTYPE = 0x600 // 1536 + SYS_PTHREAD_TESTCANCEL = 0x601 // 1537 + SYS___ATANF_B = 0x602 // 1538 + SYS___ATANL_B = 0x603 // 1539 + SYS___CEILF_B = 0x604 // 1540 + SYS___CEILL_B = 0x605 // 1541 + SYS___COSF_B = 0x606 // 1542 + SYS___COSL_B = 0x607 // 1543 + SYS___FABSF_B = 0x608 // 1544 + SYS___FABSL_B = 0x609 // 1545 + SYS___FLOORF_B = 0x60A // 1546 + SYS___FLOORL_B = 0x60B // 1547 + SYS___FREXPF_B = 0x60C // 1548 + SYS___FREXPL_B = 0x60D // 1549 + SYS___LDEXPF_B = 0x60E // 1550 + SYS___LDEXPL_B = 0x60F // 1551 + SYS___SINF_B = 0x610 // 1552 + SYS___SINL_B = 0x611 // 1553 + SYS___TANF_B = 0x612 // 1554 + SYS___TANL_B = 0x613 // 1555 + SYS___TANHF_B = 0x614 // 1556 + SYS___TANHL_B = 0x615 // 1557 + SYS___ACOSF_B = 0x616 // 1558 + SYS___ACOSL_B = 0x617 // 1559 + SYS___ASINF_B = 0x618 // 1560 + SYS___ASINL_B = 0x619 // 1561 + SYS___ATAN2F_B = 0x61A // 1562 + SYS___ATAN2L_B = 0x61B // 1563 + SYS___COSHF_B = 0x61C // 1564 + SYS___COSHL_B = 0x61D // 1565 + SYS___EXPF_B = 0x61E // 1566 + SYS___EXPL_B = 0x61F // 1567 + SYS___LOGF_B = 0x620 // 1568 + SYS___LOGL_B = 0x621 // 1569 + SYS___LOG10F_B = 0x622 // 1570 + SYS___LOG10L_B = 0x623 // 1571 + SYS___POWF_B = 0x624 // 1572 + SYS___POWL_B = 0x625 // 1573 + SYS___SINHF_B = 0x626 // 1574 + SYS___SINHL_B = 0x627 // 1575 + SYS___SQRTF_B = 0x628 // 1576 + SYS___SQRTL_B = 0x629 // 1577 + SYS___ABSF_B = 0x62A // 1578 + SYS___ABS_B = 0x62B // 1579 + SYS___ABSL_B = 0x62C // 1580 + SYS___FMODF_B = 0x62D // 1581 + SYS___FMODL_B = 0x62E // 1582 + SYS___MODFF_B = 0x62F // 1583 + SYS___MODFL_B = 0x630 // 1584 + SYS_ABSF = 0x631 // 1585 + SYS_ABSL = 0x632 // 1586 + SYS_ACOSF = 0x633 // 1587 + SYS_ACOSL = 0x634 // 1588 + SYS_ASINF = 0x635 // 1589 + SYS_ASINL = 0x636 // 1590 + SYS_ATAN2F = 0x637 // 1591 + SYS_ATAN2L = 0x638 // 1592 + SYS_ATANF = 0x639 // 1593 + SYS_ATANL = 0x63A // 1594 + SYS_CEILF = 0x63B // 1595 + SYS_CEILL = 0x63C // 1596 + SYS_COSF = 0x63D // 1597 + SYS_COSL = 0x63E // 1598 + SYS_COSHF = 0x63F // 1599 + SYS_COSHL = 0x640 // 1600 + SYS_EXPF = 0x641 // 1601 + SYS_EXPL = 0x642 // 1602 + SYS_TANHF = 0x643 // 1603 + SYS_TANHL = 0x644 // 1604 + SYS_LOG10F = 0x645 // 1605 + SYS_LOG10L = 0x646 // 1606 + SYS_LOGF = 0x647 // 1607 + SYS_LOGL = 0x648 // 1608 + SYS_POWF = 0x649 // 1609 + SYS_POWL = 0x64A // 1610 + SYS_SINF = 0x64B // 1611 + SYS_SINL = 0x64C // 1612 + SYS_SQRTF = 0x64D // 1613 + SYS_SQRTL = 0x64E // 1614 + SYS_SINHF = 0x64F // 1615 + SYS_SINHL = 0x650 // 1616 + SYS_TANF = 0x651 // 1617 + SYS_TANL = 0x652 // 1618 + SYS_FABSF = 0x653 // 1619 + SYS_FABSL = 0x654 // 1620 + SYS_FLOORF = 0x655 // 1621 + SYS_FLOORL = 0x656 // 1622 + SYS_FMODF = 0x657 // 1623 + SYS_FMODL = 0x658 // 1624 + SYS_FREXPF = 0x659 // 1625 + SYS_FREXPL = 0x65A // 1626 + SYS_LDEXPF = 0x65B // 1627 + SYS_LDEXPL = 0x65C // 1628 + SYS_MODFF = 0x65D // 1629 + SYS_MODFL = 0x65E // 1630 + SYS_BTOWC = 0x65F // 1631 + SYS___CHATTR = 0x660 // 1632 + SYS___FCHATTR = 0x661 // 1633 + SYS___TOCCSID = 0x662 // 1634 + SYS___CSNAMETYPE = 0x663 // 1635 + SYS___TOCSNAME = 0x664 // 1636 + SYS___CCSIDTYPE = 0x665 // 1637 + SYS___AE_CORRESTBL_QUERY = 0x666 // 1638 + SYS___AE_AUTOCONVERT_STATE = 0x667 // 1639 + SYS_DN_FIND = 0x668 // 1640 + SYS___GETHOSTBYADDR_A = 0x669 // 1641 + SYS___GETHOSTBYNAME_A = 0x66A // 1642 + SYS___RES_INIT_A = 0x66B // 1643 + SYS___GETHOSTBYADDR_R_A = 0x66C // 1644 + SYS___GETHOSTBYNAME_R_A = 0x66D // 1645 + SYS___CHARMAP_INIT_A = 0x66E // 1646 + SYS___MBLEN_A = 0x66F // 1647 + SYS___MBLEN_SB_A = 0x670 // 1648 + SYS___MBLEN_STD_A = 0x671 // 1649 + SYS___MBLEN_UTF = 0x672 // 1650 + SYS___MBSTOWCS_A = 0x673 // 1651 + SYS___MBSTOWCS_STD_A = 0x674 // 1652 + SYS___MBTOWC_A = 0x675 // 1653 + SYS___MBTOWC_ISO1 = 0x676 // 1654 + SYS___MBTOWC_SBCS = 0x677 // 1655 + SYS___MBTOWC_MBCS = 0x678 // 1656 + SYS___MBTOWC_UTF = 0x679 // 1657 + SYS___WCSTOMBS_A = 0x67A // 1658 + SYS___WCSTOMBS_STD_A = 0x67B // 1659 + SYS___WCSWIDTH_A = 0x67C // 1660 + SYS___GETGRGID_R_A = 0x67D // 1661 + SYS___WCSWIDTH_STD_A = 0x67E // 1662 + SYS___WCSWIDTH_ASIA = 0x67F // 1663 + SYS___CSID_A = 0x680 // 1664 + SYS___CSID_STD_A = 0x681 // 1665 + SYS___WCSID_A = 0x682 // 1666 + SYS___WCSID_STD_A = 0x683 // 1667 + SYS___WCTOMB_A = 0x684 // 1668 + SYS___WCTOMB_ISO1 = 0x685 // 1669 + SYS___WCTOMB_STD_A = 0x686 // 1670 + SYS___WCTOMB_UTF = 0x687 // 1671 + SYS___WCWIDTH_A = 0x688 // 1672 + SYS___GETGRNAM_R_A = 0x689 // 1673 + SYS___WCWIDTH_STD_A = 0x68A // 1674 + SYS___WCWIDTH_ASIA = 0x68B // 1675 + SYS___GETPWNAM_R_A = 0x68C // 1676 + SYS___GETPWUID_R_A = 0x68D // 1677 + SYS___GETLOGIN_R_A = 0x68E // 1678 + SYS___TTYNAME_R_A = 0x68F // 1679 + SYS___READDIR_R_A = 0x690 // 1680 + SYS___E2A_S = 0x691 // 1681 + SYS___FNMATCH_A = 0x692 // 1682 + SYS___FNMATCH_C_A = 0x693 // 1683 + SYS___EXECL_A = 0x694 // 1684 + SYS___FNMATCH_STD_A = 0x695 // 1685 + SYS___REGCOMP_A = 0x696 // 1686 + SYS___REGCOMP_STD_A = 0x697 // 1687 + SYS___REGERROR_A = 0x698 // 1688 + SYS___REGERROR_STD_A = 0x699 // 1689 + SYS___REGEXEC_A = 0x69A // 1690 + SYS___REGEXEC_STD_A = 0x69B // 1691 + SYS___REGFREE_A = 0x69C // 1692 + SYS___REGFREE_STD_A = 0x69D // 1693 + SYS___STRCOLL_A = 0x69E // 1694 + SYS___STRCOLL_C_A = 0x69F // 1695 + SYS___EXECLE_A = 0x6A0 // 1696 + SYS___STRCOLL_STD_A = 0x6A1 // 1697 + SYS___STRXFRM_A = 0x6A2 // 1698 + SYS___STRXFRM_C_A = 0x6A3 // 1699 + SYS___EXECLP_A = 0x6A4 // 1700 + SYS___STRXFRM_STD_A = 0x6A5 // 1701 + SYS___WCSCOLL_A = 0x6A6 // 1702 + SYS___WCSCOLL_C_A = 0x6A7 // 1703 + SYS___WCSCOLL_STD_A = 0x6A8 // 1704 + SYS___WCSXFRM_A = 0x6A9 // 1705 + SYS___WCSXFRM_C_A = 0x6AA // 1706 + SYS___WCSXFRM_STD_A = 0x6AB // 1707 + SYS___COLLATE_INIT_A = 0x6AC // 1708 + SYS___WCTYPE_A = 0x6AD // 1709 + SYS___GET_WCTYPE_STD_A = 0x6AE // 1710 + SYS___CTYPE_INIT_A = 0x6AF // 1711 + SYS___ISWCTYPE_A = 0x6B0 // 1712 + SYS___EXECV_A = 0x6B1 // 1713 + SYS___IS_WCTYPE_STD_A = 0x6B2 // 1714 + SYS___TOWLOWER_A = 0x6B3 // 1715 + SYS___TOWLOWER_STD_A = 0x6B4 // 1716 + SYS___TOWUPPER_A = 0x6B5 // 1717 + SYS___TOWUPPER_STD_A = 0x6B6 // 1718 + SYS___LOCALE_INIT_A = 0x6B7 // 1719 + SYS___LOCALECONV_A = 0x6B8 // 1720 + SYS___LOCALECONV_STD_A = 0x6B9 // 1721 + SYS___NL_LANGINFO_A = 0x6BA // 1722 + SYS___NL_LNAGINFO_STD_A = 0x6BB // 1723 + SYS___MONETARY_INIT_A = 0x6BC // 1724 + SYS___STRFMON_A = 0x6BD // 1725 + SYS___STRFMON_STD_A = 0x6BE // 1726 + SYS___GETADDRINFO_A = 0x6BF // 1727 + SYS___CATGETS_A = 0x6C0 // 1728 + SYS___EXECVE_A = 0x6C1 // 1729 + SYS___EXECVP_A = 0x6C2 // 1730 + SYS___SPAWN_A = 0x6C3 // 1731 + SYS___GETNAMEINFO_A = 0x6C4 // 1732 + SYS___SPAWNP_A = 0x6C5 // 1733 + SYS___NUMERIC_INIT_A = 0x6C6 // 1734 + SYS___RESP_INIT_A = 0x6C7 // 1735 + SYS___RPMATCH_A = 0x6C8 // 1736 + SYS___RPMATCH_C_A = 0x6C9 // 1737 + SYS___RPMATCH_STD_A = 0x6CA // 1738 + SYS___TIME_INIT_A = 0x6CB // 1739 + SYS___STRFTIME_A = 0x6CC // 1740 + SYS___STRFTIME_STD_A = 0x6CD // 1741 + SYS___STRPTIME_A = 0x6CE // 1742 + SYS___STRPTIME_STD_A = 0x6CF // 1743 + SYS___WCSFTIME_A = 0x6D0 // 1744 + SYS___WCSFTIME_STD_A = 0x6D1 // 1745 + SYS_____SPAWN2_A = 0x6D2 // 1746 + SYS_____SPAWNP2_A = 0x6D3 // 1747 + SYS___SYNTAX_INIT_A = 0x6D4 // 1748 + SYS___TOD_INIT_A = 0x6D5 // 1749 + SYS___NL_CSINFO_A = 0x6D6 // 1750 + SYS___NL_MONINFO_A = 0x6D7 // 1751 + SYS___NL_NUMINFO_A = 0x6D8 // 1752 + SYS___NL_RESPINFO_A = 0x6D9 // 1753 + SYS___NL_TIMINFO_A = 0x6DA // 1754 + SYS___IF_NAMETOINDEX_A = 0x6DB // 1755 + SYS___IF_INDEXTONAME_A = 0x6DC // 1756 + SYS___PRINTF_A = 0x6DD // 1757 + SYS___ICONV_OPEN_A = 0x6DE // 1758 + SYS___DLLLOAD_A = 0x6DF // 1759 + SYS___DLLQUERYFN_A = 0x6E0 // 1760 + SYS___DLLQUERYVAR_A = 0x6E1 // 1761 + SYS_____CHATTR_A = 0x6E2 // 1762 + SYS___E2A_L = 0x6E3 // 1763 + SYS_____TOCCSID_A = 0x6E4 // 1764 + SYS_____TOCSNAME_A = 0x6E5 // 1765 + SYS_____CCSIDTYPE_A = 0x6E6 // 1766 + SYS_____CSNAMETYPE_A = 0x6E7 // 1767 + SYS___CHMOD_A = 0x6E8 // 1768 + SYS___MKDIR_A = 0x6E9 // 1769 + SYS___STAT_A = 0x6EA // 1770 + SYS___STAT_O_A = 0x6EB // 1771 + SYS___MKFIFO_A = 0x6EC // 1772 + SYS_____OPEN_STAT_A = 0x6ED // 1773 + SYS___LSTAT_A = 0x6EE // 1774 + SYS___LSTAT_O_A = 0x6EF // 1775 + SYS___MKNOD_A = 0x6F0 // 1776 + SYS___MOUNT_A = 0x6F1 // 1777 + SYS___UMOUNT_A = 0x6F2 // 1778 + SYS___CHAUDIT_A = 0x6F4 // 1780 + SYS___W_GETMNTENT_A = 0x6F5 // 1781 + SYS___CREAT_A = 0x6F6 // 1782 + SYS___OPEN_A = 0x6F7 // 1783 + SYS___SETLOCALE_A = 0x6F9 // 1785 + SYS___FPRINTF_A = 0x6FA // 1786 + SYS___SPRINTF_A = 0x6FB // 1787 + SYS___VFPRINTF_A = 0x6FC // 1788 + SYS___VPRINTF_A = 0x6FD // 1789 + SYS___VSPRINTF_A = 0x6FE // 1790 + SYS___VSWPRINTF_A = 0x6FF // 1791 + SYS___SWPRINTF_A = 0x700 // 1792 + SYS___FSCANF_A = 0x701 // 1793 + SYS___SCANF_A = 0x702 // 1794 + SYS___SSCANF_A = 0x703 // 1795 + SYS___SWSCANF_A = 0x704 // 1796 + SYS___ATOF_A = 0x705 // 1797 + SYS___ATOI_A = 0x706 // 1798 + SYS___ATOL_A = 0x707 // 1799 + SYS___STRTOD_A = 0x708 // 1800 + SYS___STRTOL_A = 0x709 // 1801 + SYS___STRTOUL_A = 0x70A // 1802 + SYS_____AE_CORRESTBL_QUERY_A = 0x70B // 1803 + SYS___A64L_A = 0x70C // 1804 + SYS___ECVT_A = 0x70D // 1805 + SYS___FCVT_A = 0x70E // 1806 + SYS___GCVT_A = 0x70F // 1807 + SYS___L64A_A = 0x710 // 1808 + SYS___STRERROR_A = 0x711 // 1809 + SYS___PERROR_A = 0x712 // 1810 + SYS___FETCH_A = 0x713 // 1811 + SYS___GETENV_A = 0x714 // 1812 + SYS___MKSTEMP_A = 0x717 // 1815 + SYS___PTSNAME_A = 0x718 // 1816 + SYS___PUTENV_A = 0x719 // 1817 + SYS___REALPATH_A = 0x71A // 1818 + SYS___SETENV_A = 0x71B // 1819 + SYS___SYSTEM_A = 0x71C // 1820 + SYS___GETOPT_A = 0x71D // 1821 + SYS___CATOPEN_A = 0x71E // 1822 + SYS___ACCESS_A = 0x71F // 1823 + SYS___CHDIR_A = 0x720 // 1824 + SYS___CHOWN_A = 0x721 // 1825 + SYS___CHROOT_A = 0x722 // 1826 + SYS___GETCWD_A = 0x723 // 1827 + SYS___GETWD_A = 0x724 // 1828 + SYS___LCHOWN_A = 0x725 // 1829 + SYS___LINK_A = 0x726 // 1830 + SYS___PATHCONF_A = 0x727 // 1831 + SYS___IF_NAMEINDEX_A = 0x728 // 1832 + SYS___READLINK_A = 0x729 // 1833 + SYS___RMDIR_A = 0x72A // 1834 + SYS___STATVFS_A = 0x72B // 1835 + SYS___SYMLINK_A = 0x72C // 1836 + SYS___TRUNCATE_A = 0x72D // 1837 + SYS___UNLINK_A = 0x72E // 1838 + SYS___GAI_STRERROR_A = 0x72F // 1839 + SYS___EXTLINK_NP_A = 0x730 // 1840 + SYS___ISALNUM_A = 0x731 // 1841 + SYS___ISALPHA_A = 0x732 // 1842 + SYS___A2E_S = 0x733 // 1843 + SYS___ISCNTRL_A = 0x734 // 1844 + SYS___ISDIGIT_A = 0x735 // 1845 + SYS___ISGRAPH_A = 0x736 // 1846 + SYS___ISLOWER_A = 0x737 // 1847 + SYS___ISPRINT_A = 0x738 // 1848 + SYS___ISPUNCT_A = 0x739 // 1849 + SYS___ISSPACE_A = 0x73A // 1850 + SYS___ISUPPER_A = 0x73B // 1851 + SYS___ISXDIGIT_A = 0x73C // 1852 + SYS___TOLOWER_A = 0x73D // 1853 + SYS___TOUPPER_A = 0x73E // 1854 + SYS___ISWALNUM_A = 0x73F // 1855 + SYS___ISWALPHA_A = 0x740 // 1856 + SYS___A2E_L = 0x741 // 1857 + SYS___ISWCNTRL_A = 0x742 // 1858 + SYS___ISWDIGIT_A = 0x743 // 1859 + SYS___ISWGRAPH_A = 0x744 // 1860 + SYS___ISWLOWER_A = 0x745 // 1861 + SYS___ISWPRINT_A = 0x746 // 1862 + SYS___ISWPUNCT_A = 0x747 // 1863 + SYS___ISWSPACE_A = 0x748 // 1864 + SYS___ISWUPPER_A = 0x749 // 1865 + SYS___ISWXDIGIT_A = 0x74A // 1866 + SYS___CONFSTR_A = 0x74B // 1867 + SYS___FTOK_A = 0x74C // 1868 + SYS___MKTEMP_A = 0x74D // 1869 + SYS___FDOPEN_A = 0x74E // 1870 + SYS___FLDATA_A = 0x74F // 1871 + SYS___REMOVE_A = 0x750 // 1872 + SYS___RENAME_A = 0x751 // 1873 + SYS___TMPNAM_A = 0x752 // 1874 + SYS___FOPEN_A = 0x753 // 1875 + SYS___FREOPEN_A = 0x754 // 1876 + SYS___CUSERID_A = 0x755 // 1877 + SYS___POPEN_A = 0x756 // 1878 + SYS___TEMPNAM_A = 0x757 // 1879 + SYS___FTW_A = 0x758 // 1880 + SYS___GETGRENT_A = 0x759 // 1881 + SYS___GETGRGID_A = 0x75A // 1882 + SYS___GETGRNAM_A = 0x75B // 1883 + SYS___GETGROUPSBYNAME_A = 0x75C // 1884 + SYS___GETHOSTENT_A = 0x75D // 1885 + SYS___GETHOSTNAME_A = 0x75E // 1886 + SYS___GETLOGIN_A = 0x75F // 1887 + SYS___INET_NTOP_A = 0x760 // 1888 + SYS___GETPASS_A = 0x761 // 1889 + SYS___GETPWENT_A = 0x762 // 1890 + SYS___GETPWNAM_A = 0x763 // 1891 + SYS___GETPWUID_A = 0x764 // 1892 + SYS_____CHECK_RESOURCE_AUTH_NP_A = 0x765 // 1893 + SYS___CHECKSCHENV_A = 0x766 // 1894 + SYS___CONNECTSERVER_A = 0x767 // 1895 + SYS___CONNECTWORKMGR_A = 0x768 // 1896 + SYS_____CONSOLE_A = 0x769 // 1897 + SYS___CREATEWORKUNIT_A = 0x76A // 1898 + SYS___CTERMID_A = 0x76B // 1899 + SYS___FMTMSG_A = 0x76C // 1900 + SYS___INITGROUPS_A = 0x76D // 1901 + SYS_____LOGIN_A = 0x76E // 1902 + SYS___MSGRCV_A = 0x76F // 1903 + SYS___MSGSND_A = 0x770 // 1904 + SYS___MSGXRCV_A = 0x771 // 1905 + SYS___NFTW_A = 0x772 // 1906 + SYS_____PASSWD_A = 0x773 // 1907 + SYS___PTHREAD_SECURITY_NP_A = 0x774 // 1908 + SYS___QUERYMETRICS_A = 0x775 // 1909 + SYS___QUERYSCHENV = 0x776 // 1910 + SYS___READV_A = 0x777 // 1911 + SYS_____SERVER_CLASSIFY_A = 0x778 // 1912 + SYS_____SERVER_INIT_A = 0x779 // 1913 + SYS_____SERVER_PWU_A = 0x77A // 1914 + SYS___STRCASECMP_A = 0x77B // 1915 + SYS___STRNCASECMP_A = 0x77C // 1916 + SYS___TTYNAME_A = 0x77D // 1917 + SYS___UNAME_A = 0x77E // 1918 + SYS___UTIMES_A = 0x77F // 1919 + SYS___W_GETPSENT_A = 0x780 // 1920 + SYS___WRITEV_A = 0x781 // 1921 + SYS___W_STATFS_A = 0x782 // 1922 + SYS___W_STATVFS_A = 0x783 // 1923 + SYS___FPUTC_A = 0x784 // 1924 + SYS___PUTCHAR_A = 0x785 // 1925 + SYS___PUTS_A = 0x786 // 1926 + SYS___FGETS_A = 0x787 // 1927 + SYS___GETS_A = 0x788 // 1928 + SYS___FPUTS_A = 0x789 // 1929 + SYS___FREAD_A = 0x78A // 1930 + SYS___FWRITE_A = 0x78B // 1931 + SYS___OPEN_O_A = 0x78C // 1932 + SYS___ISASCII = 0x78D // 1933 + SYS___CREAT_O_A = 0x78E // 1934 + SYS___ENVNA = 0x78F // 1935 + SYS___PUTC_A = 0x790 // 1936 + SYS___AE_THREAD_SETMODE = 0x791 // 1937 + SYS___AE_THREAD_SWAPMODE = 0x792 // 1938 + SYS___GETNETBYADDR_A = 0x793 // 1939 + SYS___GETNETBYNAME_A = 0x794 // 1940 + SYS___GETNETENT_A = 0x795 // 1941 + SYS___GETPROTOBYNAME_A = 0x796 // 1942 + SYS___GETPROTOBYNUMBER_A = 0x797 // 1943 + SYS___GETPROTOENT_A = 0x798 // 1944 + SYS___GETSERVBYNAME_A = 0x799 // 1945 + SYS___GETSERVBYPORT_A = 0x79A // 1946 + SYS___GETSERVENT_A = 0x79B // 1947 + SYS___ASCTIME_A = 0x79C // 1948 + SYS___CTIME_A = 0x79D // 1949 + SYS___GETDATE_A = 0x79E // 1950 + SYS___TZSET_A = 0x79F // 1951 + SYS___UTIME_A = 0x7A0 // 1952 + SYS___ASCTIME_R_A = 0x7A1 // 1953 + SYS___CTIME_R_A = 0x7A2 // 1954 + SYS___STRTOLL_A = 0x7A3 // 1955 + SYS___STRTOULL_A = 0x7A4 // 1956 + SYS___FPUTWC_A = 0x7A5 // 1957 + SYS___PUTWC_A = 0x7A6 // 1958 + SYS___PUTWCHAR_A = 0x7A7 // 1959 + SYS___FPUTWS_A = 0x7A8 // 1960 + SYS___UNGETWC_A = 0x7A9 // 1961 + SYS___FGETWC_A = 0x7AA // 1962 + SYS___GETWC_A = 0x7AB // 1963 + SYS___GETWCHAR_A = 0x7AC // 1964 + SYS___FGETWS_A = 0x7AD // 1965 + SYS___GETTIMEOFDAY_A = 0x7AE // 1966 + SYS___GMTIME_A = 0x7AF // 1967 + SYS___GMTIME_R_A = 0x7B0 // 1968 + SYS___LOCALTIME_A = 0x7B1 // 1969 + SYS___LOCALTIME_R_A = 0x7B2 // 1970 + SYS___MKTIME_A = 0x7B3 // 1971 + SYS___TZZNA = 0x7B4 // 1972 + SYS_UNATEXIT = 0x7B5 // 1973 + SYS___CEE3DMP_A = 0x7B6 // 1974 + SYS___CDUMP_A = 0x7B7 // 1975 + SYS___CSNAP_A = 0x7B8 // 1976 + SYS___CTEST_A = 0x7B9 // 1977 + SYS___CTRACE_A = 0x7BA // 1978 + SYS___VSWPRNTF2_A = 0x7BB // 1979 + SYS___INET_PTON_A = 0x7BC // 1980 + SYS___SYSLOG_A = 0x7BD // 1981 + SYS___CRYPT_A = 0x7BE // 1982 + SYS_____OPENDIR2_A = 0x7BF // 1983 + SYS_____READDIR2_A = 0x7C0 // 1984 + SYS___OPENDIR_A = 0x7C2 // 1986 + SYS___READDIR_A = 0x7C3 // 1987 + SYS_PREAD = 0x7C7 // 1991 + SYS_PWRITE = 0x7C8 // 1992 + SYS_M_CREATE_LAYOUT = 0x7C9 // 1993 + SYS_M_DESTROY_LAYOUT = 0x7CA // 1994 + SYS_M_GETVALUES_LAYOUT = 0x7CB // 1995 + SYS_M_SETVALUES_LAYOUT = 0x7CC // 1996 + SYS_M_TRANSFORM_LAYOUT = 0x7CD // 1997 + SYS_M_WTRANSFORM_LAYOUT = 0x7CE // 1998 + SYS_FWPRINTF = 0x7D1 // 2001 + SYS_WPRINTF = 0x7D2 // 2002 + SYS_VFWPRINT = 0x7D3 // 2003 + SYS_VFWPRINTF = 0x7D3 // 2003 + SYS_VWPRINTF = 0x7D4 // 2004 + SYS_FWSCANF = 0x7D5 // 2005 + SYS_WSCANF = 0x7D6 // 2006 + SYS_WCTRANS = 0x7D7 // 2007 + SYS_TOWCTRAN = 0x7D8 // 2008 + SYS_TOWCTRANS = 0x7D8 // 2008 + SYS___WCSTOD_A = 0x7D9 // 2009 + SYS___WCSTOL_A = 0x7DA // 2010 + SYS___WCSTOUL_A = 0x7DB // 2011 + SYS___BASENAME_A = 0x7DC // 2012 + SYS___DIRNAME_A = 0x7DD // 2013 + SYS___GLOB_A = 0x7DE // 2014 + SYS_FWIDE = 0x7DF // 2015 + SYS___OSNAME = 0x7E0 // 2016 + SYS_____OSNAME_A = 0x7E1 // 2017 + SYS___BTOWC_A = 0x7E4 // 2020 + SYS___WCTOB_A = 0x7E5 // 2021 + SYS___DBM_OPEN_A = 0x7E6 // 2022 + SYS___VFPRINTF2_A = 0x7E7 // 2023 + SYS___VPRINTF2_A = 0x7E8 // 2024 + SYS___VSPRINTF2_A = 0x7E9 // 2025 + SYS___CEIL_H = 0x7EA // 2026 + SYS___FLOOR_H = 0x7EB // 2027 + SYS___MODF_H = 0x7EC // 2028 + SYS___FABS_H = 0x7ED // 2029 + SYS___J0_H = 0x7EE // 2030 + SYS___J1_H = 0x7EF // 2031 + SYS___JN_H = 0x7F0 // 2032 + SYS___Y0_H = 0x7F1 // 2033 + SYS___Y1_H = 0x7F2 // 2034 + SYS___YN_H = 0x7F3 // 2035 + SYS___CEILF_H = 0x7F4 // 2036 + SYS___CEILL_H = 0x7F5 // 2037 + SYS___FLOORF_H = 0x7F6 // 2038 + SYS___FLOORL_H = 0x7F7 // 2039 + SYS___MODFF_H = 0x7F8 // 2040 + SYS___MODFL_H = 0x7F9 // 2041 + SYS___FABSF_H = 0x7FA // 2042 + SYS___FABSL_H = 0x7FB // 2043 + SYS___MALLOC24 = 0x7FC // 2044 + SYS___MALLOC31 = 0x7FD // 2045 + SYS_ACL_INIT = 0x7FE // 2046 + SYS_ACL_FREE = 0x7FF // 2047 + SYS_ACL_FIRST_ENTRY = 0x800 // 2048 + SYS_ACL_GET_ENTRY = 0x801 // 2049 + SYS_ACL_VALID = 0x802 // 2050 + SYS_ACL_CREATE_ENTRY = 0x803 // 2051 + SYS_ACL_DELETE_ENTRY = 0x804 // 2052 + SYS_ACL_UPDATE_ENTRY = 0x805 // 2053 + SYS_ACL_DELETE_FD = 0x806 // 2054 + SYS_ACL_DELETE_FILE = 0x807 // 2055 + SYS_ACL_GET_FD = 0x808 // 2056 + SYS_ACL_GET_FILE = 0x809 // 2057 + SYS_ACL_SET_FD = 0x80A // 2058 + SYS_ACL_SET_FILE = 0x80B // 2059 + SYS_ACL_FROM_TEXT = 0x80C // 2060 + SYS_ACL_TO_TEXT = 0x80D // 2061 + SYS_ACL_SORT = 0x80E // 2062 + SYS___SHUTDOWN_REGISTRATION = 0x80F // 2063 + SYS___ERFL_B = 0x810 // 2064 + SYS___ERFCL_B = 0x811 // 2065 + SYS___LGAMMAL_B = 0x812 // 2066 + SYS___SETHOOKEVENTS = 0x813 // 2067 + SYS_IF_NAMETOINDEX = 0x814 // 2068 + SYS_IF_INDEXTONAME = 0x815 // 2069 + SYS_IF_NAMEINDEX = 0x816 // 2070 + SYS_IF_FREENAMEINDEX = 0x817 // 2071 + SYS_GETADDRINFO = 0x818 // 2072 + SYS_GETNAMEINFO = 0x819 // 2073 + SYS_FREEADDRINFO = 0x81A // 2074 + SYS_GAI_STRERROR = 0x81B // 2075 + SYS_REXEC_AF = 0x81C // 2076 + SYS___POE = 0x81D // 2077 + SYS___DYNALLOC_A = 0x81F // 2079 + SYS___DYNFREE_A = 0x820 // 2080 + SYS___RES_QUERY_A = 0x821 // 2081 + SYS___RES_SEARCH_A = 0x822 // 2082 + SYS___RES_QUERYDOMAIN_A = 0x823 // 2083 + SYS___RES_MKQUERY_A = 0x824 // 2084 + SYS___RES_SEND_A = 0x825 // 2085 + SYS___DN_EXPAND_A = 0x826 // 2086 + SYS___DN_SKIPNAME_A = 0x827 // 2087 + SYS___DN_COMP_A = 0x828 // 2088 + SYS___DN_FIND_A = 0x829 // 2089 + SYS___NLIST_A = 0x82A // 2090 + SYS_____TCGETCP_A = 0x82B // 2091 + SYS_____TCSETCP_A = 0x82C // 2092 + SYS_____W_PIOCTL_A = 0x82E // 2094 + SYS___INET_ADDR_A = 0x82F // 2095 + SYS___INET_NTOA_A = 0x830 // 2096 + SYS___INET_NETWORK_A = 0x831 // 2097 + SYS___ACCEPT_A = 0x832 // 2098 + SYS___ACCEPT_AND_RECV_A = 0x833 // 2099 + SYS___BIND_A = 0x834 // 2100 + SYS___CONNECT_A = 0x835 // 2101 + SYS___GETPEERNAME_A = 0x836 // 2102 + SYS___GETSOCKNAME_A = 0x837 // 2103 + SYS___RECVFROM_A = 0x838 // 2104 + SYS___SENDTO_A = 0x839 // 2105 + SYS___SENDMSG_A = 0x83A // 2106 + SYS___RECVMSG_A = 0x83B // 2107 + SYS_____LCHATTR_A = 0x83C // 2108 + SYS___CABEND = 0x83D // 2109 + SYS___LE_CIB_GET = 0x83E // 2110 + SYS___SET_LAA_FOR_JIT = 0x83F // 2111 + SYS___LCHATTR = 0x840 // 2112 + SYS___WRITEDOWN = 0x841 // 2113 + SYS_PTHREAD_MUTEX_INIT2 = 0x842 // 2114 + SYS___ACOSHF_B = 0x843 // 2115 + SYS___ACOSHL_B = 0x844 // 2116 + SYS___ASINHF_B = 0x845 // 2117 + SYS___ASINHL_B = 0x846 // 2118 + SYS___ATANHF_B = 0x847 // 2119 + SYS___ATANHL_B = 0x848 // 2120 + SYS___CBRTF_B = 0x849 // 2121 + SYS___CBRTL_B = 0x84A // 2122 + SYS___COPYSIGNF_B = 0x84B // 2123 + SYS___COPYSIGNL_B = 0x84C // 2124 + SYS___COTANF_B = 0x84D // 2125 + SYS___COTAN_B = 0x84E // 2126 + SYS___COTANL_B = 0x84F // 2127 + SYS___EXP2F_B = 0x850 // 2128 + SYS___EXP2L_B = 0x851 // 2129 + SYS___EXPM1F_B = 0x852 // 2130 + SYS___EXPM1L_B = 0x853 // 2131 + SYS___FDIMF_B = 0x854 // 2132 + SYS___FDIM_B = 0x855 // 2133 + SYS___FDIML_B = 0x856 // 2134 + SYS___HYPOTF_B = 0x857 // 2135 + SYS___HYPOTL_B = 0x858 // 2136 + SYS___LOG1PF_B = 0x859 // 2137 + SYS___LOG1PL_B = 0x85A // 2138 + SYS___LOG2F_B = 0x85B // 2139 + SYS___LOG2_B = 0x85C // 2140 + SYS___LOG2L_B = 0x85D // 2141 + SYS___REMAINDERF_B = 0x85E // 2142 + SYS___REMAINDERL_B = 0x85F // 2143 + SYS___REMQUOF_B = 0x860 // 2144 + SYS___REMQUO_B = 0x861 // 2145 + SYS___REMQUOL_B = 0x862 // 2146 + SYS___TGAMMAF_B = 0x863 // 2147 + SYS___TGAMMA_B = 0x864 // 2148 + SYS___TGAMMAL_B = 0x865 // 2149 + SYS___TRUNCF_B = 0x866 // 2150 + SYS___TRUNC_B = 0x867 // 2151 + SYS___TRUNCL_B = 0x868 // 2152 + SYS___LGAMMAF_B = 0x869 // 2153 + SYS___LROUNDF_B = 0x86A // 2154 + SYS___LROUND_B = 0x86B // 2155 + SYS___ERFF_B = 0x86C // 2156 + SYS___ERFCF_B = 0x86D // 2157 + SYS_ACOSHF = 0x86E // 2158 + SYS_ACOSHL = 0x86F // 2159 + SYS_ASINHF = 0x870 // 2160 + SYS_ASINHL = 0x871 // 2161 + SYS_ATANHF = 0x872 // 2162 + SYS_ATANHL = 0x873 // 2163 + SYS_CBRTF = 0x874 // 2164 + SYS_CBRTL = 0x875 // 2165 + SYS_COPYSIGNF = 0x876 // 2166 + SYS_CPYSIGNF = 0x876 // 2166 + SYS_COPYSIGNL = 0x877 // 2167 + SYS_CPYSIGNL = 0x877 // 2167 + SYS_COTANF = 0x878 // 2168 + SYS___COTANF = 0x878 // 2168 + SYS_COTAN = 0x879 // 2169 + SYS___COTAN = 0x879 // 2169 + SYS_COTANL = 0x87A // 2170 + SYS___COTANL = 0x87A // 2170 + SYS_EXP2F = 0x87B // 2171 + SYS_EXP2L = 0x87C // 2172 + SYS_EXPM1F = 0x87D // 2173 + SYS_EXPM1L = 0x87E // 2174 + SYS_FDIMF = 0x87F // 2175 + SYS_FDIM = 0x881 // 2177 + SYS_FDIML = 0x882 // 2178 + SYS_HYPOTF = 0x883 // 2179 + SYS_HYPOTL = 0x884 // 2180 + SYS_LOG1PF = 0x885 // 2181 + SYS_LOG1PL = 0x886 // 2182 + SYS_LOG2F = 0x887 // 2183 + SYS_LOG2 = 0x888 // 2184 + SYS_LOG2L = 0x889 // 2185 + SYS_REMAINDERF = 0x88A // 2186 + SYS_REMAINDF = 0x88A // 2186 + SYS_REMAINDERL = 0x88B // 2187 + SYS_REMAINDL = 0x88B // 2187 + SYS_REMQUOF = 0x88C // 2188 + SYS_REMQUO = 0x88D // 2189 + SYS_REMQUOL = 0x88E // 2190 + SYS_TGAMMAF = 0x88F // 2191 + SYS_TGAMMA = 0x890 // 2192 + SYS_TGAMMAL = 0x891 // 2193 + SYS_TRUNCF = 0x892 // 2194 + SYS_TRUNC = 0x893 // 2195 + SYS_TRUNCL = 0x894 // 2196 + SYS_LGAMMAF = 0x895 // 2197 + SYS_LGAMMAL = 0x896 // 2198 + SYS_LROUNDF = 0x897 // 2199 + SYS_LROUND = 0x898 // 2200 + SYS_ERFF = 0x899 // 2201 + SYS_ERFL = 0x89A // 2202 + SYS_ERFCF = 0x89B // 2203 + SYS_ERFCL = 0x89C // 2204 + SYS___EXP2_B = 0x89D // 2205 + SYS_EXP2 = 0x89E // 2206 + SYS___FAR_JUMP = 0x89F // 2207 + SYS___TCGETATTR_A = 0x8A1 // 2209 + SYS___TCSETATTR_A = 0x8A2 // 2210 + SYS___SUPERKILL = 0x8A4 // 2212 + SYS___LE_CONDITION_TOKEN_BUILD = 0x8A5 // 2213 + SYS___LE_MSG_ADD_INSERT = 0x8A6 // 2214 + SYS___LE_MSG_GET = 0x8A7 // 2215 + SYS___LE_MSG_GET_AND_WRITE = 0x8A8 // 2216 + SYS___LE_MSG_WRITE = 0x8A9 // 2217 + SYS___ITOA = 0x8AA // 2218 + SYS___UTOA = 0x8AB // 2219 + SYS___LTOA = 0x8AC // 2220 + SYS___ULTOA = 0x8AD // 2221 + SYS___LLTOA = 0x8AE // 2222 + SYS___ULLTOA = 0x8AF // 2223 + SYS___ITOA_A = 0x8B0 // 2224 + SYS___UTOA_A = 0x8B1 // 2225 + SYS___LTOA_A = 0x8B2 // 2226 + SYS___ULTOA_A = 0x8B3 // 2227 + SYS___LLTOA_A = 0x8B4 // 2228 + SYS___ULLTOA_A = 0x8B5 // 2229 + SYS_____GETENV_A = 0x8C3 // 2243 + SYS___REXEC_A = 0x8C4 // 2244 + SYS___REXEC_AF_A = 0x8C5 // 2245 + SYS___GETUTXENT_A = 0x8C6 // 2246 + SYS___GETUTXID_A = 0x8C7 // 2247 + SYS___GETUTXLINE_A = 0x8C8 // 2248 + SYS___PUTUTXLINE_A = 0x8C9 // 2249 + SYS_____UTMPXNAME_A = 0x8CA // 2250 + SYS___PUTC_UNLOCKED_A = 0x8CB // 2251 + SYS___PUTCHAR_UNLOCKED_A = 0x8CC // 2252 + SYS___SNPRINTF_A = 0x8CD // 2253 + SYS___VSNPRINTF_A = 0x8CE // 2254 + SYS___DLOPEN_A = 0x8D0 // 2256 + SYS___DLSYM_A = 0x8D1 // 2257 + SYS___DLERROR_A = 0x8D2 // 2258 + SYS_FLOCKFILE = 0x8D3 // 2259 + SYS_FTRYLOCKFILE = 0x8D4 // 2260 + SYS_FUNLOCKFILE = 0x8D5 // 2261 + SYS_GETC_UNLOCKED = 0x8D6 // 2262 + SYS_GETCHAR_UNLOCKED = 0x8D7 // 2263 + SYS_PUTC_UNLOCKED = 0x8D8 // 2264 + SYS_PUTCHAR_UNLOCKED = 0x8D9 // 2265 + SYS_SNPRINTF = 0x8DA // 2266 + SYS_VSNPRINTF = 0x8DB // 2267 + SYS_DLOPEN = 0x8DD // 2269 + SYS_DLSYM = 0x8DE // 2270 + SYS_DLCLOSE = 0x8DF // 2271 + SYS_DLERROR = 0x8E0 // 2272 + SYS___SET_EXCEPTION_HANDLER = 0x8E2 // 2274 + SYS___RESET_EXCEPTION_HANDLER = 0x8E3 // 2275 + SYS___VHM_EVENT = 0x8E4 // 2276 + SYS___ABS_H = 0x8E6 // 2278 + SYS___ABSF_H = 0x8E7 // 2279 + SYS___ABSL_H = 0x8E8 // 2280 + SYS___ACOS_H = 0x8E9 // 2281 + SYS___ACOSF_H = 0x8EA // 2282 + SYS___ACOSL_H = 0x8EB // 2283 + SYS___ACOSH_H = 0x8EC // 2284 + SYS___ASIN_H = 0x8ED // 2285 + SYS___ASINF_H = 0x8EE // 2286 + SYS___ASINL_H = 0x8EF // 2287 + SYS___ASINH_H = 0x8F0 // 2288 + SYS___ATAN_H = 0x8F1 // 2289 + SYS___ATANF_H = 0x8F2 // 2290 + SYS___ATANL_H = 0x8F3 // 2291 + SYS___ATANH_H = 0x8F4 // 2292 + SYS___ATANHF_H = 0x8F5 // 2293 + SYS___ATANHL_H = 0x8F6 // 2294 + SYS___ATAN2_H = 0x8F7 // 2295 + SYS___ATAN2F_H = 0x8F8 // 2296 + SYS___ATAN2L_H = 0x8F9 // 2297 + SYS___CBRT_H = 0x8FA // 2298 + SYS___COPYSIGNF_H = 0x8FB // 2299 + SYS___COPYSIGNL_H = 0x8FC // 2300 + SYS___COS_H = 0x8FD // 2301 + SYS___COSF_H = 0x8FE // 2302 + SYS___COSL_H = 0x8FF // 2303 + SYS___COSHF_H = 0x900 // 2304 + SYS___COSHL_H = 0x901 // 2305 + SYS___COTAN_H = 0x902 // 2306 + SYS___COTANF_H = 0x903 // 2307 + SYS___COTANL_H = 0x904 // 2308 + SYS___ERF_H = 0x905 // 2309 + SYS___ERFF_H = 0x906 // 2310 + SYS___ERFL_H = 0x907 // 2311 + SYS___ERFC_H = 0x908 // 2312 + SYS___ERFCF_H = 0x909 // 2313 + SYS___ERFCL_H = 0x90A // 2314 + SYS___EXP_H = 0x90B // 2315 + SYS___EXPF_H = 0x90C // 2316 + SYS___EXPL_H = 0x90D // 2317 + SYS___EXPM1_H = 0x90E // 2318 + SYS___FDIM_H = 0x90F // 2319 + SYS___FDIMF_H = 0x910 // 2320 + SYS___FDIML_H = 0x911 // 2321 + SYS___FMOD_H = 0x912 // 2322 + SYS___FMODF_H = 0x913 // 2323 + SYS___FMODL_H = 0x914 // 2324 + SYS___GAMMA_H = 0x915 // 2325 + SYS___HYPOT_H = 0x916 // 2326 + SYS___ILOGB_H = 0x917 // 2327 + SYS___LGAMMA_H = 0x918 // 2328 + SYS___LGAMMAF_H = 0x919 // 2329 + SYS___LOG_H = 0x91A // 2330 + SYS___LOGF_H = 0x91B // 2331 + SYS___LOGL_H = 0x91C // 2332 + SYS___LOGB_H = 0x91D // 2333 + SYS___LOG2_H = 0x91E // 2334 + SYS___LOG2F_H = 0x91F // 2335 + SYS___LOG2L_H = 0x920 // 2336 + SYS___LOG1P_H = 0x921 // 2337 + SYS___LOG10_H = 0x922 // 2338 + SYS___LOG10F_H = 0x923 // 2339 + SYS___LOG10L_H = 0x924 // 2340 + SYS___LROUND_H = 0x925 // 2341 + SYS___LROUNDF_H = 0x926 // 2342 + SYS___NEXTAFTER_H = 0x927 // 2343 + SYS___POW_H = 0x928 // 2344 + SYS___POWF_H = 0x929 // 2345 + SYS___POWL_H = 0x92A // 2346 + SYS___REMAINDER_H = 0x92B // 2347 + SYS___RINT_H = 0x92C // 2348 + SYS___SCALB_H = 0x92D // 2349 + SYS___SIN_H = 0x92E // 2350 + SYS___SINF_H = 0x92F // 2351 + SYS___SINL_H = 0x930 // 2352 + SYS___SINH_H = 0x931 // 2353 + SYS___SINHF_H = 0x932 // 2354 + SYS___SINHL_H = 0x933 // 2355 + SYS___SQRT_H = 0x934 // 2356 + SYS___SQRTF_H = 0x935 // 2357 + SYS___SQRTL_H = 0x936 // 2358 + SYS___TAN_H = 0x937 // 2359 + SYS___TANF_H = 0x938 // 2360 + SYS___TANL_H = 0x939 // 2361 + SYS___TANH_H = 0x93A // 2362 + SYS___TANHF_H = 0x93B // 2363 + SYS___TANHL_H = 0x93C // 2364 + SYS___TGAMMA_H = 0x93D // 2365 + SYS___TGAMMAF_H = 0x93E // 2366 + SYS___TRUNC_H = 0x93F // 2367 + SYS___TRUNCF_H = 0x940 // 2368 + SYS___TRUNCL_H = 0x941 // 2369 + SYS___COSH_H = 0x942 // 2370 + SYS___LE_DEBUG_SET_RESUME_MCH = 0x943 // 2371 + SYS_VFSCANF = 0x944 // 2372 + SYS_VSCANF = 0x946 // 2374 + SYS_VSSCANF = 0x948 // 2376 + SYS_VFWSCANF = 0x94A // 2378 + SYS_VWSCANF = 0x94C // 2380 + SYS_VSWSCANF = 0x94E // 2382 + SYS_IMAXABS = 0x950 // 2384 + SYS_IMAXDIV = 0x951 // 2385 + SYS_STRTOIMAX = 0x952 // 2386 + SYS_STRTOUMAX = 0x953 // 2387 + SYS_WCSTOIMAX = 0x954 // 2388 + SYS_WCSTOUMAX = 0x955 // 2389 + SYS_ATOLL = 0x956 // 2390 + SYS_STRTOF = 0x957 // 2391 + SYS_STRTOLD = 0x958 // 2392 + SYS_WCSTOF = 0x959 // 2393 + SYS_WCSTOLD = 0x95A // 2394 + SYS_INET6_RTH_SPACE = 0x95B // 2395 + SYS_INET6_RTH_INIT = 0x95C // 2396 + SYS_INET6_RTH_ADD = 0x95D // 2397 + SYS_INET6_RTH_REVERSE = 0x95E // 2398 + SYS_INET6_RTH_SEGMENTS = 0x95F // 2399 + SYS_INET6_RTH_GETADDR = 0x960 // 2400 + SYS_INET6_OPT_INIT = 0x961 // 2401 + SYS_INET6_OPT_APPEND = 0x962 // 2402 + SYS_INET6_OPT_FINISH = 0x963 // 2403 + SYS_INET6_OPT_SET_VAL = 0x964 // 2404 + SYS_INET6_OPT_NEXT = 0x965 // 2405 + SYS_INET6_OPT_FIND = 0x966 // 2406 + SYS_INET6_OPT_GET_VAL = 0x967 // 2407 + SYS___POW_I = 0x987 // 2439 + SYS___POW_I_B = 0x988 // 2440 + SYS___POW_I_H = 0x989 // 2441 + SYS___POW_II = 0x98A // 2442 + SYS___POW_II_B = 0x98B // 2443 + SYS___POW_II_H = 0x98C // 2444 + SYS_CABS = 0x98E // 2446 + SYS___CABS_B = 0x98F // 2447 + SYS___CABS_H = 0x990 // 2448 + SYS_CABSF = 0x991 // 2449 + SYS___CABSF_B = 0x992 // 2450 + SYS___CABSF_H = 0x993 // 2451 + SYS_CABSL = 0x994 // 2452 + SYS___CABSL_B = 0x995 // 2453 + SYS___CABSL_H = 0x996 // 2454 + SYS_CACOS = 0x997 // 2455 + SYS___CACOS_B = 0x998 // 2456 + SYS___CACOS_H = 0x999 // 2457 + SYS_CACOSF = 0x99A // 2458 + SYS___CACOSF_B = 0x99B // 2459 + SYS___CACOSF_H = 0x99C // 2460 + SYS_CACOSL = 0x99D // 2461 + SYS___CACOSL_B = 0x99E // 2462 + SYS___CACOSL_H = 0x99F // 2463 + SYS_CACOSH = 0x9A0 // 2464 + SYS___CACOSH_B = 0x9A1 // 2465 + SYS___CACOSH_H = 0x9A2 // 2466 + SYS_CACOSHF = 0x9A3 // 2467 + SYS___CACOSHF_B = 0x9A4 // 2468 + SYS___CACOSHF_H = 0x9A5 // 2469 + SYS_CACOSHL = 0x9A6 // 2470 + SYS___CACOSHL_B = 0x9A7 // 2471 + SYS___CACOSHL_H = 0x9A8 // 2472 + SYS_CARG = 0x9A9 // 2473 + SYS___CARG_B = 0x9AA // 2474 + SYS___CARG_H = 0x9AB // 2475 + SYS_CARGF = 0x9AC // 2476 + SYS___CARGF_B = 0x9AD // 2477 + SYS___CARGF_H = 0x9AE // 2478 + SYS_CARGL = 0x9AF // 2479 + SYS___CARGL_B = 0x9B0 // 2480 + SYS___CARGL_H = 0x9B1 // 2481 + SYS_CASIN = 0x9B2 // 2482 + SYS___CASIN_B = 0x9B3 // 2483 + SYS___CASIN_H = 0x9B4 // 2484 + SYS_CASINF = 0x9B5 // 2485 + SYS___CASINF_B = 0x9B6 // 2486 + SYS___CASINF_H = 0x9B7 // 2487 + SYS_CASINL = 0x9B8 // 2488 + SYS___CASINL_B = 0x9B9 // 2489 + SYS___CASINL_H = 0x9BA // 2490 + SYS_CASINH = 0x9BB // 2491 + SYS___CASINH_B = 0x9BC // 2492 + SYS___CASINH_H = 0x9BD // 2493 + SYS_CASINHF = 0x9BE // 2494 + SYS___CASINHF_B = 0x9BF // 2495 + SYS___CASINHF_H = 0x9C0 // 2496 + SYS_CASINHL = 0x9C1 // 2497 + SYS___CASINHL_B = 0x9C2 // 2498 + SYS___CASINHL_H = 0x9C3 // 2499 + SYS_CATAN = 0x9C4 // 2500 + SYS___CATAN_B = 0x9C5 // 2501 + SYS___CATAN_H = 0x9C6 // 2502 + SYS_CATANF = 0x9C7 // 2503 + SYS___CATANF_B = 0x9C8 // 2504 + SYS___CATANF_H = 0x9C9 // 2505 + SYS_CATANL = 0x9CA // 2506 + SYS___CATANL_B = 0x9CB // 2507 + SYS___CATANL_H = 0x9CC // 2508 + SYS_CATANH = 0x9CD // 2509 + SYS___CATANH_B = 0x9CE // 2510 + SYS___CATANH_H = 0x9CF // 2511 + SYS_CATANHF = 0x9D0 // 2512 + SYS___CATANHF_B = 0x9D1 // 2513 + SYS___CATANHF_H = 0x9D2 // 2514 + SYS_CATANHL = 0x9D3 // 2515 + SYS___CATANHL_B = 0x9D4 // 2516 + SYS___CATANHL_H = 0x9D5 // 2517 + SYS_CCOS = 0x9D6 // 2518 + SYS___CCOS_B = 0x9D7 // 2519 + SYS___CCOS_H = 0x9D8 // 2520 + SYS_CCOSF = 0x9D9 // 2521 + SYS___CCOSF_B = 0x9DA // 2522 + SYS___CCOSF_H = 0x9DB // 2523 + SYS_CCOSL = 0x9DC // 2524 + SYS___CCOSL_B = 0x9DD // 2525 + SYS___CCOSL_H = 0x9DE // 2526 + SYS_CCOSH = 0x9DF // 2527 + SYS___CCOSH_B = 0x9E0 // 2528 + SYS___CCOSH_H = 0x9E1 // 2529 + SYS_CCOSHF = 0x9E2 // 2530 + SYS___CCOSHF_B = 0x9E3 // 2531 + SYS___CCOSHF_H = 0x9E4 // 2532 + SYS_CCOSHL = 0x9E5 // 2533 + SYS___CCOSHL_B = 0x9E6 // 2534 + SYS___CCOSHL_H = 0x9E7 // 2535 + SYS_CEXP = 0x9E8 // 2536 + SYS___CEXP_B = 0x9E9 // 2537 + SYS___CEXP_H = 0x9EA // 2538 + SYS_CEXPF = 0x9EB // 2539 + SYS___CEXPF_B = 0x9EC // 2540 + SYS___CEXPF_H = 0x9ED // 2541 + SYS_CEXPL = 0x9EE // 2542 + SYS___CEXPL_B = 0x9EF // 2543 + SYS___CEXPL_H = 0x9F0 // 2544 + SYS_CIMAG = 0x9F1 // 2545 + SYS___CIMAG_B = 0x9F2 // 2546 + SYS___CIMAG_H = 0x9F3 // 2547 + SYS_CIMAGF = 0x9F4 // 2548 + SYS___CIMAGF_B = 0x9F5 // 2549 + SYS___CIMAGF_H = 0x9F6 // 2550 + SYS_CIMAGL = 0x9F7 // 2551 + SYS___CIMAGL_B = 0x9F8 // 2552 + SYS___CIMAGL_H = 0x9F9 // 2553 + SYS___CLOG = 0x9FA // 2554 + SYS___CLOG_B = 0x9FB // 2555 + SYS___CLOG_H = 0x9FC // 2556 + SYS_CLOGF = 0x9FD // 2557 + SYS___CLOGF_B = 0x9FE // 2558 + SYS___CLOGF_H = 0x9FF // 2559 + SYS_CLOGL = 0xA00 // 2560 + SYS___CLOGL_B = 0xA01 // 2561 + SYS___CLOGL_H = 0xA02 // 2562 + SYS_CONJ = 0xA03 // 2563 + SYS___CONJ_B = 0xA04 // 2564 + SYS___CONJ_H = 0xA05 // 2565 + SYS_CONJF = 0xA06 // 2566 + SYS___CONJF_B = 0xA07 // 2567 + SYS___CONJF_H = 0xA08 // 2568 + SYS_CONJL = 0xA09 // 2569 + SYS___CONJL_B = 0xA0A // 2570 + SYS___CONJL_H = 0xA0B // 2571 + SYS_CPOW = 0xA0C // 2572 + SYS___CPOW_B = 0xA0D // 2573 + SYS___CPOW_H = 0xA0E // 2574 + SYS_CPOWF = 0xA0F // 2575 + SYS___CPOWF_B = 0xA10 // 2576 + SYS___CPOWF_H = 0xA11 // 2577 + SYS_CPOWL = 0xA12 // 2578 + SYS___CPOWL_B = 0xA13 // 2579 + SYS___CPOWL_H = 0xA14 // 2580 + SYS_CPROJ = 0xA15 // 2581 + SYS___CPROJ_B = 0xA16 // 2582 + SYS___CPROJ_H = 0xA17 // 2583 + SYS_CPROJF = 0xA18 // 2584 + SYS___CPROJF_B = 0xA19 // 2585 + SYS___CPROJF_H = 0xA1A // 2586 + SYS_CPROJL = 0xA1B // 2587 + SYS___CPROJL_B = 0xA1C // 2588 + SYS___CPROJL_H = 0xA1D // 2589 + SYS_CREAL = 0xA1E // 2590 + SYS___CREAL_B = 0xA1F // 2591 + SYS___CREAL_H = 0xA20 // 2592 + SYS_CREALF = 0xA21 // 2593 + SYS___CREALF_B = 0xA22 // 2594 + SYS___CREALF_H = 0xA23 // 2595 + SYS_CREALL = 0xA24 // 2596 + SYS___CREALL_B = 0xA25 // 2597 + SYS___CREALL_H = 0xA26 // 2598 + SYS_CSIN = 0xA27 // 2599 + SYS___CSIN_B = 0xA28 // 2600 + SYS___CSIN_H = 0xA29 // 2601 + SYS_CSINF = 0xA2A // 2602 + SYS___CSINF_B = 0xA2B // 2603 + SYS___CSINF_H = 0xA2C // 2604 + SYS_CSINL = 0xA2D // 2605 + SYS___CSINL_B = 0xA2E // 2606 + SYS___CSINL_H = 0xA2F // 2607 + SYS_CSINH = 0xA30 // 2608 + SYS___CSINH_B = 0xA31 // 2609 + SYS___CSINH_H = 0xA32 // 2610 + SYS_CSINHF = 0xA33 // 2611 + SYS___CSINHF_B = 0xA34 // 2612 + SYS___CSINHF_H = 0xA35 // 2613 + SYS_CSINHL = 0xA36 // 2614 + SYS___CSINHL_B = 0xA37 // 2615 + SYS___CSINHL_H = 0xA38 // 2616 + SYS_CSQRT = 0xA39 // 2617 + SYS___CSQRT_B = 0xA3A // 2618 + SYS___CSQRT_H = 0xA3B // 2619 + SYS_CSQRTF = 0xA3C // 2620 + SYS___CSQRTF_B = 0xA3D // 2621 + SYS___CSQRTF_H = 0xA3E // 2622 + SYS_CSQRTL = 0xA3F // 2623 + SYS___CSQRTL_B = 0xA40 // 2624 + SYS___CSQRTL_H = 0xA41 // 2625 + SYS_CTAN = 0xA42 // 2626 + SYS___CTAN_B = 0xA43 // 2627 + SYS___CTAN_H = 0xA44 // 2628 + SYS_CTANF = 0xA45 // 2629 + SYS___CTANF_B = 0xA46 // 2630 + SYS___CTANF_H = 0xA47 // 2631 + SYS_CTANL = 0xA48 // 2632 + SYS___CTANL_B = 0xA49 // 2633 + SYS___CTANL_H = 0xA4A // 2634 + SYS_CTANH = 0xA4B // 2635 + SYS___CTANH_B = 0xA4C // 2636 + SYS___CTANH_H = 0xA4D // 2637 + SYS_CTANHF = 0xA4E // 2638 + SYS___CTANHF_B = 0xA4F // 2639 + SYS___CTANHF_H = 0xA50 // 2640 + SYS_CTANHL = 0xA51 // 2641 + SYS___CTANHL_B = 0xA52 // 2642 + SYS___CTANHL_H = 0xA53 // 2643 + SYS___ACOSHF_H = 0xA54 // 2644 + SYS___ACOSHL_H = 0xA55 // 2645 + SYS___ASINHF_H = 0xA56 // 2646 + SYS___ASINHL_H = 0xA57 // 2647 + SYS___CBRTF_H = 0xA58 // 2648 + SYS___CBRTL_H = 0xA59 // 2649 + SYS___COPYSIGN_B = 0xA5A // 2650 + SYS___EXPM1F_H = 0xA5B // 2651 + SYS___EXPM1L_H = 0xA5C // 2652 + SYS___EXP2_H = 0xA5D // 2653 + SYS___EXP2F_H = 0xA5E // 2654 + SYS___EXP2L_H = 0xA5F // 2655 + SYS___LOG1PF_H = 0xA60 // 2656 + SYS___LOG1PL_H = 0xA61 // 2657 + SYS___LGAMMAL_H = 0xA62 // 2658 + SYS_FMA = 0xA63 // 2659 + SYS___FMA_B = 0xA64 // 2660 + SYS___FMA_H = 0xA65 // 2661 + SYS_FMAF = 0xA66 // 2662 + SYS___FMAF_B = 0xA67 // 2663 + SYS___FMAF_H = 0xA68 // 2664 + SYS_FMAL = 0xA69 // 2665 + SYS___FMAL_B = 0xA6A // 2666 + SYS___FMAL_H = 0xA6B // 2667 + SYS_FMAX = 0xA6C // 2668 + SYS___FMAX_B = 0xA6D // 2669 + SYS___FMAX_H = 0xA6E // 2670 + SYS_FMAXF = 0xA6F // 2671 + SYS___FMAXF_B = 0xA70 // 2672 + SYS___FMAXF_H = 0xA71 // 2673 + SYS_FMAXL = 0xA72 // 2674 + SYS___FMAXL_B = 0xA73 // 2675 + SYS___FMAXL_H = 0xA74 // 2676 + SYS_FMIN = 0xA75 // 2677 + SYS___FMIN_B = 0xA76 // 2678 + SYS___FMIN_H = 0xA77 // 2679 + SYS_FMINF = 0xA78 // 2680 + SYS___FMINF_B = 0xA79 // 2681 + SYS___FMINF_H = 0xA7A // 2682 + SYS_FMINL = 0xA7B // 2683 + SYS___FMINL_B = 0xA7C // 2684 + SYS___FMINL_H = 0xA7D // 2685 + SYS_ILOGBF = 0xA7E // 2686 + SYS___ILOGBF_B = 0xA7F // 2687 + SYS___ILOGBF_H = 0xA80 // 2688 + SYS_ILOGBL = 0xA81 // 2689 + SYS___ILOGBL_B = 0xA82 // 2690 + SYS___ILOGBL_H = 0xA83 // 2691 + SYS_LLRINT = 0xA84 // 2692 + SYS___LLRINT_B = 0xA85 // 2693 + SYS___LLRINT_H = 0xA86 // 2694 + SYS_LLRINTF = 0xA87 // 2695 + SYS___LLRINTF_B = 0xA88 // 2696 + SYS___LLRINTF_H = 0xA89 // 2697 + SYS_LLRINTL = 0xA8A // 2698 + SYS___LLRINTL_B = 0xA8B // 2699 + SYS___LLRINTL_H = 0xA8C // 2700 + SYS_LLROUND = 0xA8D // 2701 + SYS___LLROUND_B = 0xA8E // 2702 + SYS___LLROUND_H = 0xA8F // 2703 + SYS_LLROUNDF = 0xA90 // 2704 + SYS___LLROUNDF_B = 0xA91 // 2705 + SYS___LLROUNDF_H = 0xA92 // 2706 + SYS_LLROUNDL = 0xA93 // 2707 + SYS___LLROUNDL_B = 0xA94 // 2708 + SYS___LLROUNDL_H = 0xA95 // 2709 + SYS_LOGBF = 0xA96 // 2710 + SYS___LOGBF_B = 0xA97 // 2711 + SYS___LOGBF_H = 0xA98 // 2712 + SYS_LOGBL = 0xA99 // 2713 + SYS___LOGBL_B = 0xA9A // 2714 + SYS___LOGBL_H = 0xA9B // 2715 + SYS_LRINT = 0xA9C // 2716 + SYS___LRINT_B = 0xA9D // 2717 + SYS___LRINT_H = 0xA9E // 2718 + SYS_LRINTF = 0xA9F // 2719 + SYS___LRINTF_B = 0xAA0 // 2720 + SYS___LRINTF_H = 0xAA1 // 2721 + SYS_LRINTL = 0xAA2 // 2722 + SYS___LRINTL_B = 0xAA3 // 2723 + SYS___LRINTL_H = 0xAA4 // 2724 + SYS_LROUNDL = 0xAA5 // 2725 + SYS___LROUNDL_B = 0xAA6 // 2726 + SYS___LROUNDL_H = 0xAA7 // 2727 + SYS_NAN = 0xAA8 // 2728 + SYS___NAN_B = 0xAA9 // 2729 + SYS_NANF = 0xAAA // 2730 + SYS___NANF_B = 0xAAB // 2731 + SYS_NANL = 0xAAC // 2732 + SYS___NANL_B = 0xAAD // 2733 + SYS_NEARBYINT = 0xAAE // 2734 + SYS___NEARBYINT_B = 0xAAF // 2735 + SYS___NEARBYINT_H = 0xAB0 // 2736 + SYS_NEARBYINTF = 0xAB1 // 2737 + SYS___NEARBYINTF_B = 0xAB2 // 2738 + SYS___NEARBYINTF_H = 0xAB3 // 2739 + SYS_NEARBYINTL = 0xAB4 // 2740 + SYS___NEARBYINTL_B = 0xAB5 // 2741 + SYS___NEARBYINTL_H = 0xAB6 // 2742 + SYS_NEXTAFTERF = 0xAB7 // 2743 + SYS___NEXTAFTERF_B = 0xAB8 // 2744 + SYS___NEXTAFTERF_H = 0xAB9 // 2745 + SYS_NEXTAFTERL = 0xABA // 2746 + SYS___NEXTAFTERL_B = 0xABB // 2747 + SYS___NEXTAFTERL_H = 0xABC // 2748 + SYS_NEXTTOWARD = 0xABD // 2749 + SYS___NEXTTOWARD_B = 0xABE // 2750 + SYS___NEXTTOWARD_H = 0xABF // 2751 + SYS_NEXTTOWARDF = 0xAC0 // 2752 + SYS___NEXTTOWARDF_B = 0xAC1 // 2753 + SYS___NEXTTOWARDF_H = 0xAC2 // 2754 + SYS_NEXTTOWARDL = 0xAC3 // 2755 + SYS___NEXTTOWARDL_B = 0xAC4 // 2756 + SYS___NEXTTOWARDL_H = 0xAC5 // 2757 + SYS___REMAINDERF_H = 0xAC6 // 2758 + SYS___REMAINDERL_H = 0xAC7 // 2759 + SYS___REMQUO_H = 0xAC8 // 2760 + SYS___REMQUOF_H = 0xAC9 // 2761 + SYS___REMQUOL_H = 0xACA // 2762 + SYS_RINTF = 0xACB // 2763 + SYS___RINTF_B = 0xACC // 2764 + SYS_RINTL = 0xACD // 2765 + SYS___RINTL_B = 0xACE // 2766 + SYS_ROUND = 0xACF // 2767 + SYS___ROUND_B = 0xAD0 // 2768 + SYS___ROUND_H = 0xAD1 // 2769 + SYS_ROUNDF = 0xAD2 // 2770 + SYS___ROUNDF_B = 0xAD3 // 2771 + SYS___ROUNDF_H = 0xAD4 // 2772 + SYS_ROUNDL = 0xAD5 // 2773 + SYS___ROUNDL_B = 0xAD6 // 2774 + SYS___ROUNDL_H = 0xAD7 // 2775 + SYS_SCALBLN = 0xAD8 // 2776 + SYS___SCALBLN_B = 0xAD9 // 2777 + SYS___SCALBLN_H = 0xADA // 2778 + SYS_SCALBLNF = 0xADB // 2779 + SYS___SCALBLNF_B = 0xADC // 2780 + SYS___SCALBLNF_H = 0xADD // 2781 + SYS_SCALBLNL = 0xADE // 2782 + SYS___SCALBLNL_B = 0xADF // 2783 + SYS___SCALBLNL_H = 0xAE0 // 2784 + SYS___SCALBN_B = 0xAE1 // 2785 + SYS___SCALBN_H = 0xAE2 // 2786 + SYS_SCALBNF = 0xAE3 // 2787 + SYS___SCALBNF_B = 0xAE4 // 2788 + SYS___SCALBNF_H = 0xAE5 // 2789 + SYS_SCALBNL = 0xAE6 // 2790 + SYS___SCALBNL_B = 0xAE7 // 2791 + SYS___SCALBNL_H = 0xAE8 // 2792 + SYS___TGAMMAL_H = 0xAE9 // 2793 + SYS_FECLEAREXCEPT = 0xAEA // 2794 + SYS_FEGETENV = 0xAEB // 2795 + SYS_FEGETEXCEPTFLAG = 0xAEC // 2796 + SYS_FEGETROUND = 0xAED // 2797 + SYS_FEHOLDEXCEPT = 0xAEE // 2798 + SYS_FERAISEEXCEPT = 0xAEF // 2799 + SYS_FESETENV = 0xAF0 // 2800 + SYS_FESETEXCEPTFLAG = 0xAF1 // 2801 + SYS_FESETROUND = 0xAF2 // 2802 + SYS_FETESTEXCEPT = 0xAF3 // 2803 + SYS_FEUPDATEENV = 0xAF4 // 2804 + SYS___COPYSIGN_H = 0xAF5 // 2805 + SYS___HYPOTF_H = 0xAF6 // 2806 + SYS___HYPOTL_H = 0xAF7 // 2807 + SYS___CLASS = 0xAFA // 2810 + SYS___CLASS_B = 0xAFB // 2811 + SYS___CLASS_H = 0xAFC // 2812 + SYS___ISBLANK_A = 0xB2E // 2862 + SYS___ISWBLANK_A = 0xB2F // 2863 + SYS___LROUND_FIXUP = 0xB30 // 2864 + SYS___LROUNDF_FIXUP = 0xB31 // 2865 + SYS_SCHED_YIELD = 0xB32 // 2866 + SYS_STRERROR_R = 0xB33 // 2867 + SYS_UNSETENV = 0xB34 // 2868 + SYS___LGAMMA_H_C99 = 0xB38 // 2872 + SYS___LGAMMA_B_C99 = 0xB39 // 2873 + SYS___LGAMMA_R_C99 = 0xB3A // 2874 + SYS___FTELL2 = 0xB3B // 2875 + SYS___FSEEK2 = 0xB3C // 2876 + SYS___STATIC_REINIT = 0xB3D // 2877 + SYS_PTHREAD_ATTR_GETSTACK = 0xB3E // 2878 + SYS_PTHREAD_ATTR_SETSTACK = 0xB3F // 2879 + SYS___TGAMMA_H_C99 = 0xB78 // 2936 + SYS___TGAMMAF_H_C99 = 0xB79 // 2937 + SYS___LE_TRACEBACK = 0xB7A // 2938 + SYS___MUST_STAY_CLEAN = 0xB7C // 2940 + SYS___O_ENV = 0xB7D // 2941 + SYS_ACOSD32 = 0xB7E // 2942 + SYS_ACOSD64 = 0xB7F // 2943 + SYS_ACOSD128 = 0xB80 // 2944 + SYS_ACOSHD32 = 0xB81 // 2945 + SYS_ACOSHD64 = 0xB82 // 2946 + SYS_ACOSHD128 = 0xB83 // 2947 + SYS_ASIND32 = 0xB84 // 2948 + SYS_ASIND64 = 0xB85 // 2949 + SYS_ASIND128 = 0xB86 // 2950 + SYS_ASINHD32 = 0xB87 // 2951 + SYS_ASINHD64 = 0xB88 // 2952 + SYS_ASINHD128 = 0xB89 // 2953 + SYS_ATAND32 = 0xB8A // 2954 + SYS_ATAND64 = 0xB8B // 2955 + SYS_ATAND128 = 0xB8C // 2956 + SYS_ATAN2D32 = 0xB8D // 2957 + SYS_ATAN2D64 = 0xB8E // 2958 + SYS_ATAN2D128 = 0xB8F // 2959 + SYS_ATANHD32 = 0xB90 // 2960 + SYS_ATANHD64 = 0xB91 // 2961 + SYS_ATANHD128 = 0xB92 // 2962 + SYS_CBRTD32 = 0xB93 // 2963 + SYS_CBRTD64 = 0xB94 // 2964 + SYS_CBRTD128 = 0xB95 // 2965 + SYS_CEILD32 = 0xB96 // 2966 + SYS_CEILD64 = 0xB97 // 2967 + SYS_CEILD128 = 0xB98 // 2968 + SYS___CLASS2 = 0xB99 // 2969 + SYS___CLASS2_B = 0xB9A // 2970 + SYS___CLASS2_H = 0xB9B // 2971 + SYS_COPYSIGND32 = 0xB9C // 2972 + SYS_COPYSIGND64 = 0xB9D // 2973 + SYS_COPYSIGND128 = 0xB9E // 2974 + SYS_COSD32 = 0xB9F // 2975 + SYS_COSD64 = 0xBA0 // 2976 + SYS_COSD128 = 0xBA1 // 2977 + SYS_COSHD32 = 0xBA2 // 2978 + SYS_COSHD64 = 0xBA3 // 2979 + SYS_COSHD128 = 0xBA4 // 2980 + SYS_ERFD32 = 0xBA5 // 2981 + SYS_ERFD64 = 0xBA6 // 2982 + SYS_ERFD128 = 0xBA7 // 2983 + SYS_ERFCD32 = 0xBA8 // 2984 + SYS_ERFCD64 = 0xBA9 // 2985 + SYS_ERFCD128 = 0xBAA // 2986 + SYS_EXPD32 = 0xBAB // 2987 + SYS_EXPD64 = 0xBAC // 2988 + SYS_EXPD128 = 0xBAD // 2989 + SYS_EXP2D32 = 0xBAE // 2990 + SYS_EXP2D64 = 0xBAF // 2991 + SYS_EXP2D128 = 0xBB0 // 2992 + SYS_EXPM1D32 = 0xBB1 // 2993 + SYS_EXPM1D64 = 0xBB2 // 2994 + SYS_EXPM1D128 = 0xBB3 // 2995 + SYS_FABSD32 = 0xBB4 // 2996 + SYS_FABSD64 = 0xBB5 // 2997 + SYS_FABSD128 = 0xBB6 // 2998 + SYS_FDIMD32 = 0xBB7 // 2999 + SYS_FDIMD64 = 0xBB8 // 3000 + SYS_FDIMD128 = 0xBB9 // 3001 + SYS_FE_DEC_GETROUND = 0xBBA // 3002 + SYS_FE_DEC_SETROUND = 0xBBB // 3003 + SYS_FLOORD32 = 0xBBC // 3004 + SYS_FLOORD64 = 0xBBD // 3005 + SYS_FLOORD128 = 0xBBE // 3006 + SYS_FMAD32 = 0xBBF // 3007 + SYS_FMAD64 = 0xBC0 // 3008 + SYS_FMAD128 = 0xBC1 // 3009 + SYS_FMAXD32 = 0xBC2 // 3010 + SYS_FMAXD64 = 0xBC3 // 3011 + SYS_FMAXD128 = 0xBC4 // 3012 + SYS_FMIND32 = 0xBC5 // 3013 + SYS_FMIND64 = 0xBC6 // 3014 + SYS_FMIND128 = 0xBC7 // 3015 + SYS_FMODD32 = 0xBC8 // 3016 + SYS_FMODD64 = 0xBC9 // 3017 + SYS_FMODD128 = 0xBCA // 3018 + SYS___FP_CAST_D = 0xBCB // 3019 + SYS_FREXPD32 = 0xBCC // 3020 + SYS_FREXPD64 = 0xBCD // 3021 + SYS_FREXPD128 = 0xBCE // 3022 + SYS_HYPOTD32 = 0xBCF // 3023 + SYS_HYPOTD64 = 0xBD0 // 3024 + SYS_HYPOTD128 = 0xBD1 // 3025 + SYS_ILOGBD32 = 0xBD2 // 3026 + SYS_ILOGBD64 = 0xBD3 // 3027 + SYS_ILOGBD128 = 0xBD4 // 3028 + SYS_LDEXPD32 = 0xBD5 // 3029 + SYS_LDEXPD64 = 0xBD6 // 3030 + SYS_LDEXPD128 = 0xBD7 // 3031 + SYS_LGAMMAD32 = 0xBD8 // 3032 + SYS_LGAMMAD64 = 0xBD9 // 3033 + SYS_LGAMMAD128 = 0xBDA // 3034 + SYS_LLRINTD32 = 0xBDB // 3035 + SYS_LLRINTD64 = 0xBDC // 3036 + SYS_LLRINTD128 = 0xBDD // 3037 + SYS_LLROUNDD32 = 0xBDE // 3038 + SYS_LLROUNDD64 = 0xBDF // 3039 + SYS_LLROUNDD128 = 0xBE0 // 3040 + SYS_LOGD32 = 0xBE1 // 3041 + SYS_LOGD64 = 0xBE2 // 3042 + SYS_LOGD128 = 0xBE3 // 3043 + SYS_LOG10D32 = 0xBE4 // 3044 + SYS_LOG10D64 = 0xBE5 // 3045 + SYS_LOG10D128 = 0xBE6 // 3046 + SYS_LOG1PD32 = 0xBE7 // 3047 + SYS_LOG1PD64 = 0xBE8 // 3048 + SYS_LOG1PD128 = 0xBE9 // 3049 + SYS_LOG2D32 = 0xBEA // 3050 + SYS_LOG2D64 = 0xBEB // 3051 + SYS_LOG2D128 = 0xBEC // 3052 + SYS_LOGBD32 = 0xBED // 3053 + SYS_LOGBD64 = 0xBEE // 3054 + SYS_LOGBD128 = 0xBEF // 3055 + SYS_LRINTD32 = 0xBF0 // 3056 + SYS_LRINTD64 = 0xBF1 // 3057 + SYS_LRINTD128 = 0xBF2 // 3058 + SYS_LROUNDD32 = 0xBF3 // 3059 + SYS_LROUNDD64 = 0xBF4 // 3060 + SYS_LROUNDD128 = 0xBF5 // 3061 + SYS_MODFD32 = 0xBF6 // 3062 + SYS_MODFD64 = 0xBF7 // 3063 + SYS_MODFD128 = 0xBF8 // 3064 + SYS_NAND32 = 0xBF9 // 3065 + SYS_NAND64 = 0xBFA // 3066 + SYS_NAND128 = 0xBFB // 3067 + SYS_NEARBYINTD32 = 0xBFC // 3068 + SYS_NEARBYINTD64 = 0xBFD // 3069 + SYS_NEARBYINTD128 = 0xBFE // 3070 + SYS_NEXTAFTERD32 = 0xBFF // 3071 + SYS_NEXTAFTERD64 = 0xC00 // 3072 + SYS_NEXTAFTERD128 = 0xC01 // 3073 + SYS_NEXTTOWARDD32 = 0xC02 // 3074 + SYS_NEXTTOWARDD64 = 0xC03 // 3075 + SYS_NEXTTOWARDD128 = 0xC04 // 3076 + SYS_POWD32 = 0xC05 // 3077 + SYS_POWD64 = 0xC06 // 3078 + SYS_POWD128 = 0xC07 // 3079 + SYS_QUANTIZED32 = 0xC08 // 3080 + SYS_QUANTIZED64 = 0xC09 // 3081 + SYS_QUANTIZED128 = 0xC0A // 3082 + SYS_REMAINDERD32 = 0xC0B // 3083 + SYS_REMAINDERD64 = 0xC0C // 3084 + SYS_REMAINDERD128 = 0xC0D // 3085 + SYS___REMQUOD32 = 0xC0E // 3086 + SYS___REMQUOD64 = 0xC0F // 3087 + SYS___REMQUOD128 = 0xC10 // 3088 + SYS_RINTD32 = 0xC11 // 3089 + SYS_RINTD64 = 0xC12 // 3090 + SYS_RINTD128 = 0xC13 // 3091 + SYS_ROUNDD32 = 0xC14 // 3092 + SYS_ROUNDD64 = 0xC15 // 3093 + SYS_ROUNDD128 = 0xC16 // 3094 + SYS_SAMEQUANTUMD32 = 0xC17 // 3095 + SYS_SAMEQUANTUMD64 = 0xC18 // 3096 + SYS_SAMEQUANTUMD128 = 0xC19 // 3097 + SYS_SCALBLND32 = 0xC1A // 3098 + SYS_SCALBLND64 = 0xC1B // 3099 + SYS_SCALBLND128 = 0xC1C // 3100 + SYS_SCALBND32 = 0xC1D // 3101 + SYS_SCALBND64 = 0xC1E // 3102 + SYS_SCALBND128 = 0xC1F // 3103 + SYS_SIND32 = 0xC20 // 3104 + SYS_SIND64 = 0xC21 // 3105 + SYS_SIND128 = 0xC22 // 3106 + SYS_SINHD32 = 0xC23 // 3107 + SYS_SINHD64 = 0xC24 // 3108 + SYS_SINHD128 = 0xC25 // 3109 + SYS_SQRTD32 = 0xC26 // 3110 + SYS_SQRTD64 = 0xC27 // 3111 + SYS_SQRTD128 = 0xC28 // 3112 + SYS_STRTOD32 = 0xC29 // 3113 + SYS_STRTOD64 = 0xC2A // 3114 + SYS_STRTOD128 = 0xC2B // 3115 + SYS_TAND32 = 0xC2C // 3116 + SYS_TAND64 = 0xC2D // 3117 + SYS_TAND128 = 0xC2E // 3118 + SYS_TANHD32 = 0xC2F // 3119 + SYS_TANHD64 = 0xC30 // 3120 + SYS_TANHD128 = 0xC31 // 3121 + SYS_TGAMMAD32 = 0xC32 // 3122 + SYS_TGAMMAD64 = 0xC33 // 3123 + SYS_TGAMMAD128 = 0xC34 // 3124 + SYS_TRUNCD32 = 0xC3E // 3134 + SYS_TRUNCD64 = 0xC3F // 3135 + SYS_TRUNCD128 = 0xC40 // 3136 + SYS_WCSTOD32 = 0xC41 // 3137 + SYS_WCSTOD64 = 0xC42 // 3138 + SYS_WCSTOD128 = 0xC43 // 3139 + SYS___CODEPAGE_INFO = 0xC64 // 3172 + SYS_POSIX_OPENPT = 0xC66 // 3174 + SYS_PSELECT = 0xC67 // 3175 + SYS_SOCKATMARK = 0xC68 // 3176 + SYS_AIO_FSYNC = 0xC69 // 3177 + SYS_LIO_LISTIO = 0xC6A // 3178 + SYS___ATANPID32 = 0xC6B // 3179 + SYS___ATANPID64 = 0xC6C // 3180 + SYS___ATANPID128 = 0xC6D // 3181 + SYS___COSPID32 = 0xC6E // 3182 + SYS___COSPID64 = 0xC6F // 3183 + SYS___COSPID128 = 0xC70 // 3184 + SYS___SINPID32 = 0xC71 // 3185 + SYS___SINPID64 = 0xC72 // 3186 + SYS___SINPID128 = 0xC73 // 3187 + SYS_SETIPV4SOURCEFILTER = 0xC76 // 3190 + SYS_GETIPV4SOURCEFILTER = 0xC77 // 3191 + SYS_SETSOURCEFILTER = 0xC78 // 3192 + SYS_GETSOURCEFILTER = 0xC79 // 3193 + SYS_FWRITE_UNLOCKED = 0xC7A // 3194 + SYS_FREAD_UNLOCKED = 0xC7B // 3195 + SYS_FGETS_UNLOCKED = 0xC7C // 3196 + SYS_GETS_UNLOCKED = 0xC7D // 3197 + SYS_FPUTS_UNLOCKED = 0xC7E // 3198 + SYS_PUTS_UNLOCKED = 0xC7F // 3199 + SYS_FGETC_UNLOCKED = 0xC80 // 3200 + SYS_FPUTC_UNLOCKED = 0xC81 // 3201 + SYS_DLADDR = 0xC82 // 3202 + SYS_SHM_OPEN = 0xC8C // 3212 + SYS_SHM_UNLINK = 0xC8D // 3213 + SYS___CLASS2F = 0xC91 // 3217 + SYS___CLASS2L = 0xC92 // 3218 + SYS___CLASS2F_B = 0xC93 // 3219 + SYS___CLASS2F_H = 0xC94 // 3220 + SYS___CLASS2L_B = 0xC95 // 3221 + SYS___CLASS2L_H = 0xC96 // 3222 + SYS___CLASS2D32 = 0xC97 // 3223 + SYS___CLASS2D64 = 0xC98 // 3224 + SYS___CLASS2D128 = 0xC99 // 3225 + SYS___TOCSNAME2 = 0xC9A // 3226 + SYS___D1TOP = 0xC9B // 3227 + SYS___D2TOP = 0xC9C // 3228 + SYS___D4TOP = 0xC9D // 3229 + SYS___PTOD1 = 0xC9E // 3230 + SYS___PTOD2 = 0xC9F // 3231 + SYS___PTOD4 = 0xCA0 // 3232 + SYS_CLEARERR_UNLOCKED = 0xCA1 // 3233 + SYS_FDELREC_UNLOCKED = 0xCA2 // 3234 + SYS_FEOF_UNLOCKED = 0xCA3 // 3235 + SYS_FERROR_UNLOCKED = 0xCA4 // 3236 + SYS_FFLUSH_UNLOCKED = 0xCA5 // 3237 + SYS_FGETPOS_UNLOCKED = 0xCA6 // 3238 + SYS_FGETWC_UNLOCKED = 0xCA7 // 3239 + SYS_FGETWS_UNLOCKED = 0xCA8 // 3240 + SYS_FILENO_UNLOCKED = 0xCA9 // 3241 + SYS_FLDATA_UNLOCKED = 0xCAA // 3242 + SYS_FLOCATE_UNLOCKED = 0xCAB // 3243 + SYS_FPRINTF_UNLOCKED = 0xCAC // 3244 + SYS_FPUTWC_UNLOCKED = 0xCAD // 3245 + SYS_FPUTWS_UNLOCKED = 0xCAE // 3246 + SYS_FSCANF_UNLOCKED = 0xCAF // 3247 + SYS_FSEEK_UNLOCKED = 0xCB0 // 3248 + SYS_FSEEKO_UNLOCKED = 0xCB1 // 3249 + SYS_FSETPOS_UNLOCKED = 0xCB3 // 3251 + SYS_FTELL_UNLOCKED = 0xCB4 // 3252 + SYS_FTELLO_UNLOCKED = 0xCB5 // 3253 + SYS_FUPDATE_UNLOCKED = 0xCB7 // 3255 + SYS_FWIDE_UNLOCKED = 0xCB8 // 3256 + SYS_FWPRINTF_UNLOCKED = 0xCB9 // 3257 + SYS_FWSCANF_UNLOCKED = 0xCBA // 3258 + SYS_GETWC_UNLOCKED = 0xCBB // 3259 + SYS_GETWCHAR_UNLOCKED = 0xCBC // 3260 + SYS_PERROR_UNLOCKED = 0xCBD // 3261 + SYS_PRINTF_UNLOCKED = 0xCBE // 3262 + SYS_PUTWC_UNLOCKED = 0xCBF // 3263 + SYS_PUTWCHAR_UNLOCKED = 0xCC0 // 3264 + SYS_REWIND_UNLOCKED = 0xCC1 // 3265 + SYS_SCANF_UNLOCKED = 0xCC2 // 3266 + SYS_UNGETC_UNLOCKED = 0xCC3 // 3267 + SYS_UNGETWC_UNLOCKED = 0xCC4 // 3268 + SYS_VFPRINTF_UNLOCKED = 0xCC5 // 3269 + SYS_VFSCANF_UNLOCKED = 0xCC7 // 3271 + SYS_VFWPRINTF_UNLOCKED = 0xCC9 // 3273 + SYS_VFWSCANF_UNLOCKED = 0xCCB // 3275 + SYS_VPRINTF_UNLOCKED = 0xCCD // 3277 + SYS_VSCANF_UNLOCKED = 0xCCF // 3279 + SYS_VWPRINTF_UNLOCKED = 0xCD1 // 3281 + SYS_VWSCANF_UNLOCKED = 0xCD3 // 3283 + SYS_WPRINTF_UNLOCKED = 0xCD5 // 3285 + SYS_WSCANF_UNLOCKED = 0xCD6 // 3286 + SYS_ASCTIME64 = 0xCD7 // 3287 + SYS_ASCTIME64_R = 0xCD8 // 3288 + SYS_CTIME64 = 0xCD9 // 3289 + SYS_CTIME64_R = 0xCDA // 3290 + SYS_DIFFTIME64 = 0xCDB // 3291 + SYS_GMTIME64 = 0xCDC // 3292 + SYS_GMTIME64_R = 0xCDD // 3293 + SYS_LOCALTIME64 = 0xCDE // 3294 + SYS_LOCALTIME64_R = 0xCDF // 3295 + SYS_MKTIME64 = 0xCE0 // 3296 + SYS_TIME64 = 0xCE1 // 3297 + SYS___LOGIN_APPLID = 0xCE2 // 3298 + SYS___PASSWD_APPLID = 0xCE3 // 3299 + SYS_PTHREAD_SECURITY_APPLID_NP = 0xCE4 // 3300 + SYS___GETTHENT = 0xCE5 // 3301 + SYS_FREEIFADDRS = 0xCE6 // 3302 + SYS_GETIFADDRS = 0xCE7 // 3303 + SYS_POSIX_FALLOCATE = 0xCE8 // 3304 + SYS_POSIX_MEMALIGN = 0xCE9 // 3305 + SYS_SIZEOF_ALLOC = 0xCEA // 3306 + SYS_RESIZE_ALLOC = 0xCEB // 3307 + SYS_FREAD_NOUPDATE = 0xCEC // 3308 + SYS_FREAD_NOUPDATE_UNLOCKED = 0xCED // 3309 + SYS_FGETPOS64 = 0xCEE // 3310 + SYS_FSEEK64 = 0xCEF // 3311 + SYS_FSEEKO64 = 0xCF0 // 3312 + SYS_FSETPOS64 = 0xCF1 // 3313 + SYS_FTELL64 = 0xCF2 // 3314 + SYS_FTELLO64 = 0xCF3 // 3315 + SYS_FGETPOS64_UNLOCKED = 0xCF4 // 3316 + SYS_FSEEK64_UNLOCKED = 0xCF5 // 3317 + SYS_FSEEKO64_UNLOCKED = 0xCF6 // 3318 + SYS_FSETPOS64_UNLOCKED = 0xCF7 // 3319 + SYS_FTELL64_UNLOCKED = 0xCF8 // 3320 + SYS_FTELLO64_UNLOCKED = 0xCF9 // 3321 + SYS_FOPEN_UNLOCKED = 0xCFA // 3322 + SYS_FREOPEN_UNLOCKED = 0xCFB // 3323 + SYS_FDOPEN_UNLOCKED = 0xCFC // 3324 + SYS_TMPFILE_UNLOCKED = 0xCFD // 3325 + SYS___MOSERVICES = 0xD3D // 3389 + SYS___GETTOD = 0xD3E // 3390 + SYS_C16RTOMB = 0xD40 // 3392 + SYS_C32RTOMB = 0xD41 // 3393 + SYS_MBRTOC16 = 0xD42 // 3394 + SYS_MBRTOC32 = 0xD43 // 3395 + SYS_QUANTEXPD32 = 0xD44 // 3396 + SYS_QUANTEXPD64 = 0xD45 // 3397 + SYS_QUANTEXPD128 = 0xD46 // 3398 + SYS___LOCALE_CTL = 0xD47 // 3399 + SYS___SMF_RECORD2 = 0xD48 // 3400 + SYS_FOPEN64 = 0xD49 // 3401 + SYS_FOPEN64_UNLOCKED = 0xD4A // 3402 + SYS_FREOPEN64 = 0xD4B // 3403 + SYS_FREOPEN64_UNLOCKED = 0xD4C // 3404 + SYS_TMPFILE64 = 0xD4D // 3405 + SYS_TMPFILE64_UNLOCKED = 0xD4E // 3406 + SYS_GETDATE64 = 0xD4F // 3407 + SYS_GETTIMEOFDAY64 = 0xD50 // 3408 + SYS_BIND2ADDRSEL = 0xD59 // 3417 + SYS_INET6_IS_SRCADDR = 0xD5A // 3418 + SYS___GETGRGID1 = 0xD5B // 3419 + SYS___GETGRNAM1 = 0xD5C // 3420 + SYS___FBUFSIZE = 0xD60 // 3424 + SYS___FPENDING = 0xD61 // 3425 + SYS___FLBF = 0xD62 // 3426 + SYS___FREADABLE = 0xD63 // 3427 + SYS___FWRITABLE = 0xD64 // 3428 + SYS___FREADING = 0xD65 // 3429 + SYS___FWRITING = 0xD66 // 3430 + SYS___FSETLOCKING = 0xD67 // 3431 + SYS__FLUSHLBF = 0xD68 // 3432 + SYS___FPURGE = 0xD69 // 3433 + SYS___FREADAHEAD = 0xD6A // 3434 + SYS___FSETERR = 0xD6B // 3435 + SYS___FPENDING_UNLOCKED = 0xD6C // 3436 + SYS___FREADING_UNLOCKED = 0xD6D // 3437 + SYS___FWRITING_UNLOCKED = 0xD6E // 3438 + SYS__FLUSHLBF_UNLOCKED = 0xD6F // 3439 + SYS___FPURGE_UNLOCKED = 0xD70 // 3440 + SYS___FREADAHEAD_UNLOCKED = 0xD71 // 3441 + SYS___LE_CEEGTJS = 0xD72 // 3442 + SYS___LE_RECORD_DUMP = 0xD73 // 3443 + SYS_FSTAT64 = 0xD74 // 3444 + SYS_LSTAT64 = 0xD75 // 3445 + SYS_STAT64 = 0xD76 // 3446 + SYS___READDIR2_64 = 0xD77 // 3447 + SYS___OPEN_STAT64 = 0xD78 // 3448 + SYS_FTW64 = 0xD79 // 3449 + SYS_NFTW64 = 0xD7A // 3450 + SYS_UTIME64 = 0xD7B // 3451 + SYS_UTIMES64 = 0xD7C // 3452 + SYS___GETIPC64 = 0xD7D // 3453 + SYS_MSGCTL64 = 0xD7E // 3454 + SYS_SEMCTL64 = 0xD7F // 3455 + SYS_SHMCTL64 = 0xD80 // 3456 + SYS_MSGXRCV64 = 0xD81 // 3457 + SYS___MGXR64 = 0xD81 // 3457 + SYS_W_GETPSENT64 = 0xD82 // 3458 + SYS_PTHREAD_COND_TIMEDWAIT64 = 0xD83 // 3459 + SYS_FTIME64 = 0xD85 // 3461 + SYS_GETUTXENT64 = 0xD86 // 3462 + SYS_GETUTXID64 = 0xD87 // 3463 + SYS_GETUTXLINE64 = 0xD88 // 3464 + SYS_PUTUTXLINE64 = 0xD89 // 3465 + SYS_NEWLOCALE = 0xD8A // 3466 + SYS_FREELOCALE = 0xD8B // 3467 + SYS_USELOCALE = 0xD8C // 3468 + SYS_DUPLOCALE = 0xD8D // 3469 + SYS___CHATTR64 = 0xD9C // 3484 + SYS___LCHATTR64 = 0xD9D // 3485 + SYS___FCHATTR64 = 0xD9E // 3486 + SYS_____CHATTR64_A = 0xD9F // 3487 + SYS_____LCHATTR64_A = 0xDA0 // 3488 + SYS___LE_CEEUSGD = 0xDA1 // 3489 + SYS___LE_IFAM_CON = 0xDA2 // 3490 + SYS___LE_IFAM_DSC = 0xDA3 // 3491 + SYS___LE_IFAM_GET = 0xDA4 // 3492 + SYS___LE_IFAM_QRY = 0xDA5 // 3493 + SYS_ALIGNED_ALLOC = 0xDA6 // 3494 + SYS_ACCEPT4 = 0xDA7 // 3495 + SYS___ACCEPT4_A = 0xDA8 // 3496 + SYS_COPYFILERANGE = 0xDA9 // 3497 + SYS_GETLINE = 0xDAA // 3498 + SYS___GETLINE_A = 0xDAB // 3499 + SYS_DIRFD = 0xDAC // 3500 + SYS_CLOCK_GETTIME = 0xDAD // 3501 + SYS_DUP3 = 0xDAE // 3502 + SYS_EPOLL_CREATE = 0xDAF // 3503 + SYS_EPOLL_CREATE1 = 0xDB0 // 3504 + SYS_EPOLL_CTL = 0xDB1 // 3505 + SYS_EPOLL_WAIT = 0xDB2 // 3506 + SYS_EPOLL_PWAIT = 0xDB3 // 3507 + SYS_EVENTFD = 0xDB4 // 3508 + SYS_STATFS = 0xDB5 // 3509 + SYS___STATFS_A = 0xDB6 // 3510 + SYS_FSTATFS = 0xDB7 // 3511 + SYS_INOTIFY_INIT = 0xDB8 // 3512 + SYS_INOTIFY_INIT1 = 0xDB9 // 3513 + SYS_INOTIFY_ADD_WATCH = 0xDBA // 3514 + SYS___INOTIFY_ADD_WATCH_A = 0xDBB // 3515 + SYS_INOTIFY_RM_WATCH = 0xDBC // 3516 + SYS_PIPE2 = 0xDBD // 3517 + SYS_PIVOT_ROOT = 0xDBE // 3518 + SYS___PIVOT_ROOT_A = 0xDBF // 3519 + SYS_PRCTL = 0xDC0 // 3520 + SYS_PRLIMIT = 0xDC1 // 3521 + SYS_SETHOSTNAME = 0xDC2 // 3522 + SYS___SETHOSTNAME_A = 0xDC3 // 3523 + SYS_SETRESUID = 0xDC4 // 3524 + SYS_SETRESGID = 0xDC5 // 3525 + SYS_PTHREAD_CONDATTR_GETCLOCK = 0xDC6 // 3526 + SYS_FLOCK = 0xDC7 // 3527 + SYS_FGETXATTR = 0xDC8 // 3528 + SYS___FGETXATTR_A = 0xDC9 // 3529 + SYS_FLISTXATTR = 0xDCA // 3530 + SYS___FLISTXATTR_A = 0xDCB // 3531 + SYS_FREMOVEXATTR = 0xDCC // 3532 + SYS___FREMOVEXATTR_A = 0xDCD // 3533 + SYS_FSETXATTR = 0xDCE // 3534 + SYS___FSETXATTR_A = 0xDCF // 3535 + SYS_GETXATTR = 0xDD0 // 3536 + SYS___GETXATTR_A = 0xDD1 // 3537 + SYS_LGETXATTR = 0xDD2 // 3538 + SYS___LGETXATTR_A = 0xDD3 // 3539 + SYS_LISTXATTR = 0xDD4 // 3540 + SYS___LISTXATTR_A = 0xDD5 // 3541 + SYS_LLISTXATTR = 0xDD6 // 3542 + SYS___LLISTXATTR_A = 0xDD7 // 3543 + SYS_LREMOVEXATTR = 0xDD8 // 3544 + SYS___LREMOVEXATTR_A = 0xDD9 // 3545 + SYS_LSETXATTR = 0xDDA // 3546 + SYS___LSETXATTR_A = 0xDDB // 3547 + SYS_REMOVEXATTR = 0xDDC // 3548 + SYS___REMOVEXATTR_A = 0xDDD // 3549 + SYS_SETXATTR = 0xDDE // 3550 + SYS___SETXATTR_A = 0xDDF // 3551 + SYS_FDATASYNC = 0xDE0 // 3552 + SYS_SYNCFS = 0xDE1 // 3553 + SYS_FUTIMES = 0xDE2 // 3554 + SYS_FUTIMESAT = 0xDE3 // 3555 + SYS___FUTIMESAT_A = 0xDE4 // 3556 + SYS_LUTIMES = 0xDE5 // 3557 + SYS___LUTIMES_A = 0xDE6 // 3558 + SYS_INET_ATON = 0xDE7 // 3559 + SYS_GETRANDOM = 0xDE8 // 3560 + SYS_GETTID = 0xDE9 // 3561 + SYS_MEMFD_CREATE = 0xDEA // 3562 + SYS___MEMFD_CREATE_A = 0xDEB // 3563 + SYS_FACCESSAT = 0xDEC // 3564 + SYS___FACCESSAT_A = 0xDED // 3565 + SYS_FCHMODAT = 0xDEE // 3566 + SYS___FCHMODAT_A = 0xDEF // 3567 + SYS_FCHOWNAT = 0xDF0 // 3568 + SYS___FCHOWNAT_A = 0xDF1 // 3569 + SYS_FSTATAT = 0xDF2 // 3570 + SYS___FSTATAT_A = 0xDF3 // 3571 + SYS_LINKAT = 0xDF4 // 3572 + SYS___LINKAT_A = 0xDF5 // 3573 + SYS_MKDIRAT = 0xDF6 // 3574 + SYS___MKDIRAT_A = 0xDF7 // 3575 + SYS_MKFIFOAT = 0xDF8 // 3576 + SYS___MKFIFOAT_A = 0xDF9 // 3577 + SYS_MKNODAT = 0xDFA // 3578 + SYS___MKNODAT_A = 0xDFB // 3579 + SYS_OPENAT = 0xDFC // 3580 + SYS___OPENAT_A = 0xDFD // 3581 + SYS_READLINKAT = 0xDFE // 3582 + SYS___READLINKAT_A = 0xDFF // 3583 + SYS_RENAMEAT = 0xE00 // 3584 + SYS___RENAMEAT_A = 0xE01 // 3585 + SYS_RENAMEAT2 = 0xE02 // 3586 + SYS___RENAMEAT2_A = 0xE03 // 3587 + SYS_SYMLINKAT = 0xE04 // 3588 + SYS___SYMLINKAT_A = 0xE05 // 3589 + SYS_UNLINKAT = 0xE06 // 3590 + SYS___UNLINKAT_A = 0xE07 // 3591 + SYS_SYSINFO = 0xE08 // 3592 + SYS_WAIT4 = 0xE0A // 3594 + SYS_CLONE = 0xE0B // 3595 + SYS_UNSHARE = 0xE0C // 3596 + SYS_SETNS = 0xE0D // 3597 + SYS_CAPGET = 0xE0E // 3598 + SYS_CAPSET = 0xE0F // 3599 + SYS_STRCHRNUL = 0xE10 // 3600 + SYS_PTHREAD_CONDATTR_SETCLOCK = 0xE12 // 3602 + SYS_OPEN_BY_HANDLE_AT = 0xE13 // 3603 + SYS___OPEN_BY_HANDLE_AT_A = 0xE14 // 3604 + SYS___INET_ATON_A = 0xE15 // 3605 + SYS_MOUNT1 = 0xE16 // 3606 + SYS___MOUNT1_A = 0xE17 // 3607 + SYS_UMOUNT1 = 0xE18 // 3608 + SYS___UMOUNT1_A = 0xE19 // 3609 + SYS_UMOUNT2 = 0xE1A // 3610 + SYS___UMOUNT2_A = 0xE1B // 3611 + SYS___PRCTL_A = 0xE1C // 3612 + SYS_LOCALTIME_R2 = 0xE1D // 3613 + SYS___LOCALTIME_R2_A = 0xE1E // 3614 + SYS_OPENAT2 = 0xE1F // 3615 + SYS___OPENAT2_A = 0xE20 // 3616 + SYS___LE_CEEMICT = 0xE21 // 3617 + SYS_GETENTROPY = 0xE22 // 3618 + SYS_NANOSLEEP = 0xE23 // 3619 + SYS_UTIMENSAT = 0xE24 // 3620 + SYS___UTIMENSAT_A = 0xE25 // 3621 + SYS_ASPRINTF = 0xE26 // 3622 + SYS___ASPRINTF_A = 0xE27 // 3623 + SYS_VASPRINTF = 0xE28 // 3624 + SYS___VASPRINTF_A = 0xE29 // 3625 + SYS_DPRINTF = 0xE2A // 3626 + SYS___DPRINTF_A = 0xE2B // 3627 + SYS_GETOPT_LONG = 0xE2C // 3628 + SYS___GETOPT_LONG_A = 0xE2D // 3629 + SYS_PSIGNAL = 0xE2E // 3630 + SYS___PSIGNAL_A = 0xE2F // 3631 + SYS_PSIGNAL_UNLOCKED = 0xE30 // 3632 + SYS___PSIGNAL_UNLOCKED_A = 0xE31 // 3633 + SYS_FSTATAT_O = 0xE32 // 3634 + SYS___FSTATAT_O_A = 0xE33 // 3635 + SYS_FSTATAT64 = 0xE34 // 3636 + SYS___FSTATAT64_A = 0xE35 // 3637 + SYS___CHATTRAT = 0xE36 // 3638 + SYS_____CHATTRAT_A = 0xE37 // 3639 + SYS___CHATTRAT64 = 0xE38 // 3640 + SYS_____CHATTRAT64_A = 0xE39 // 3641 + SYS_MADVISE = 0xE3A // 3642 + SYS___AUTHENTICATE = 0xE3B // 3643 + ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index eff6bcdef8..7f1961b907 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -110,7 +110,8 @@ type Statx_t struct { Mnt_id uint64 Dio_mem_align uint32 Dio_offset_align uint32 - _ [12]uint64 + Subvol uint64 + _ [11]uint64 } type Fsid struct { @@ -1178,7 +1179,8 @@ const ( PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT = 0x10 PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 0x11 PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT = 0x12 - PERF_SAMPLE_BRANCH_MAX_SHIFT = 0x13 + PERF_SAMPLE_BRANCH_COUNTERS = 0x80000 + PERF_SAMPLE_BRANCH_MAX_SHIFT = 0x14 PERF_SAMPLE_BRANCH_USER = 0x1 PERF_SAMPLE_BRANCH_KERNEL = 0x2 PERF_SAMPLE_BRANCH_HV = 0x4 @@ -1198,7 +1200,7 @@ const ( PERF_SAMPLE_BRANCH_TYPE_SAVE = 0x10000 PERF_SAMPLE_BRANCH_HW_INDEX = 0x20000 PERF_SAMPLE_BRANCH_PRIV_SAVE = 0x40000 - PERF_SAMPLE_BRANCH_MAX = 0x80000 + PERF_SAMPLE_BRANCH_MAX = 0x100000 PERF_BR_UNKNOWN = 0x0 PERF_BR_COND = 0x1 PERF_BR_UNCOND = 0x2 @@ -2481,6 +2483,15 @@ type XDPMmapOffsets struct { Cr XDPRingOffset } +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Chunk_size uint32 + Headroom uint32 + Flags uint32 + Tx_metadata_len uint32 +} + type XDPStatistics struct { Rx_dropped uint64 Rx_invalid_descs uint64 @@ -2935,7 +2946,7 @@ const ( BPF_TCP_LISTEN = 0xa BPF_TCP_CLOSING = 0xb BPF_TCP_NEW_SYN_RECV = 0xc - BPF_TCP_MAX_STATES = 0xd + BPF_TCP_MAX_STATES = 0xe TCP_BPF_IW = 0x3e9 TCP_BPF_SNDCWND_CLAMP = 0x3ea TCP_BPF_DELACK_MAX = 0x3eb @@ -3211,7 +3222,7 @@ const ( DEVLINK_CMD_LINECARD_NEW = 0x50 DEVLINK_CMD_LINECARD_DEL = 0x51 DEVLINK_CMD_SELFTESTS_GET = 0x52 - DEVLINK_CMD_MAX = 0x53 + DEVLINK_CMD_MAX = 0x54 DEVLINK_PORT_TYPE_NOTSET = 0x0 DEVLINK_PORT_TYPE_AUTO = 0x1 DEVLINK_PORT_TYPE_ETH = 0x2 @@ -3463,7 +3474,7 @@ const ( DEVLINK_PORT_FN_ATTR_STATE = 0x2 DEVLINK_PORT_FN_ATTR_OPSTATE = 0x3 DEVLINK_PORT_FN_ATTR_CAPS = 0x4 - DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x5 + DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x6 ) type FsverityDigest struct { @@ -3796,6 +3807,9 @@ const ( ETHTOOL_MSG_PSE_GET_REPLY = 0x25 ETHTOOL_MSG_RSS_GET_REPLY = 0x26 ETHTOOL_MSG_KERNEL_MAX = 0x2b + ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 + ETHTOOL_FLAG_OMIT_REPLY = 0x2 + ETHTOOL_FLAG_STATS = 0x4 ETHTOOL_A_HEADER_UNSPEC = 0x0 ETHTOOL_A_HEADER_DEV_INDEX = 0x1 ETHTOOL_A_HEADER_DEV_NAME = 0x2 @@ -3965,7 +3979,7 @@ const ( ETHTOOL_A_TSINFO_TX_TYPES = 0x3 ETHTOOL_A_TSINFO_RX_FILTERS = 0x4 ETHTOOL_A_TSINFO_PHC_INDEX = 0x5 - ETHTOOL_A_TSINFO_MAX = 0x5 + ETHTOOL_A_TSINFO_MAX = 0x6 ETHTOOL_A_CABLE_TEST_UNSPEC = 0x0 ETHTOOL_A_CABLE_TEST_HEADER = 0x1 ETHTOOL_A_CABLE_TEST_MAX = 0x1 @@ -4595,7 +4609,7 @@ const ( NL80211_ATTR_MAC_HINT = 0xc8 NL80211_ATTR_MAC_MASK = 0xd7 NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca - NL80211_ATTR_MAX = 0x146 + NL80211_ATTR_MAX = 0x14a NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4 NL80211_ATTR_MAX_CSA_COUNTERS = 0xce NL80211_ATTR_MAX_MATCH_SETS = 0x85 @@ -4861,7 +4875,7 @@ const ( NL80211_BSS_FREQUENCY_OFFSET = 0x14 NL80211_BSS_INFORMATION_ELEMENTS = 0x6 NL80211_BSS_LAST_SEEN_BOOTTIME = 0xf - NL80211_BSS_MAX = 0x16 + NL80211_BSS_MAX = 0x18 NL80211_BSS_MLD_ADDR = 0x16 NL80211_BSS_MLO_LINK_ID = 0x15 NL80211_BSS_PAD = 0x10 @@ -4965,7 +4979,7 @@ const ( NL80211_CMD_LEAVE_IBSS = 0x2c NL80211_CMD_LEAVE_MESH = 0x45 NL80211_CMD_LEAVE_OCB = 0x6d - NL80211_CMD_MAX = 0x9a + NL80211_CMD_MAX = 0x9b NL80211_CMD_MICHAEL_MIC_FAILURE = 0x29 NL80211_CMD_MODIFY_LINK_STA = 0x97 NL80211_CMD_NAN_MATCH = 0x78 @@ -5199,7 +5213,7 @@ const ( NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf - NL80211_FREQUENCY_ATTR_MAX = 0x1c + NL80211_FREQUENCY_ATTR_MAX = 0x20 NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6 NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11 NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc @@ -5693,7 +5707,7 @@ const ( NL80211_STA_FLAG_ASSOCIATED = 0x7 NL80211_STA_FLAG_AUTHENTICATED = 0x5 NL80211_STA_FLAG_AUTHORIZED = 0x1 - NL80211_STA_FLAG_MAX = 0x7 + NL80211_STA_FLAG_MAX = 0x8 NL80211_STA_FLAG_MAX_OLD_API = 0x6 NL80211_STA_FLAG_MFP = 0x4 NL80211_STA_FLAG_SHORT_PREAMBLE = 0x2 @@ -5991,3 +6005,34 @@ type CachestatRange struct { Off uint64 Len uint64 } + +const ( + SK_MEMINFO_RMEM_ALLOC = 0x0 + SK_MEMINFO_RCVBUF = 0x1 + SK_MEMINFO_WMEM_ALLOC = 0x2 + SK_MEMINFO_SNDBUF = 0x3 + SK_MEMINFO_FWD_ALLOC = 0x4 + SK_MEMINFO_WMEM_QUEUED = 0x5 + SK_MEMINFO_OPTMEM = 0x6 + SK_MEMINFO_BACKLOG = 0x7 + SK_MEMINFO_DROPS = 0x8 + SK_MEMINFO_VARS = 0x9 + SKNLGRP_NONE = 0x0 + SKNLGRP_INET_TCP_DESTROY = 0x1 + SKNLGRP_INET_UDP_DESTROY = 0x2 + SKNLGRP_INET6_TCP_DESTROY = 0x3 + SKNLGRP_INET6_UDP_DESTROY = 0x4 + SK_DIAG_BPF_STORAGE_REQ_NONE = 0x0 + SK_DIAG_BPF_STORAGE_REQ_MAP_FD = 0x1 + SK_DIAG_BPF_STORAGE_REP_NONE = 0x0 + SK_DIAG_BPF_STORAGE = 0x1 + SK_DIAG_BPF_STORAGE_NONE = 0x0 + SK_DIAG_BPF_STORAGE_PAD = 0x1 + SK_DIAG_BPF_STORAGE_MAP_ID = 0x2 + SK_DIAG_BPF_STORAGE_MAP_VALUE = 0x3 +) + +type SockDiagReq struct { + Family uint8 + Protocol uint8 +} 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 438a30affa..fd402da43f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -477,14 +477,6 @@ const ( BLKPG = 0x1269 ) -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 -} - type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 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 adceca3553..eb7a5e1864 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -492,15 +492,6 @@ const ( BLKPG = 0x1269 ) -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 - _ [4]byte -} - type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 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 eeaa00a37d..d78ac108b6 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -470,15 +470,6 @@ const ( BLKPG = 0x1269 ) -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 - _ [4]byte -} - type CryptoUserAlg struct { Name [64]uint8 Driver_name [64]uint8 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 6739aa91d4..cd06d47f1f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -471,15 +471,6 @@ const ( BLKPG = 0x1269 ) -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 - _ [4]byte -} - type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go index 9920ef6317..2f28fe26c1 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go @@ -472,15 +472,6 @@ const ( BLKPG = 0x1269 ) -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 - _ [4]byte -} - type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 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 2923b799a4..71d6cac2f1 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -476,15 +476,6 @@ const ( BLKPG = 0x20001269 ) -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 - _ [4]byte -} - type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 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 ce2750ee41..8596d45356 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -474,15 +474,6 @@ const ( BLKPG = 0x20001269 ) -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 - _ [4]byte -} - type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 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 3038811d70..cd60ea1866 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -474,15 +474,6 @@ const ( BLKPG = 0x20001269 ) -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 - _ [4]byte -} - type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 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 efc6fed18c..b0ae420c48 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -476,15 +476,6 @@ const ( BLKPG = 0x20001269 ) -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 - _ [4]byte -} - type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go index 9a654b75a9..8359728759 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -482,15 +482,6 @@ const ( BLKPG = 0x20001269 ) -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 - _ [4]byte -} - type CryptoUserAlg struct { Name [64]uint8 Driver_name [64]uint8 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 40d358e33e..69eb6a5c68 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -481,15 +481,6 @@ const ( BLKPG = 0x20001269 ) -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 - _ [4]byte -} - type CryptoUserAlg struct { Name [64]uint8 Driver_name [64]uint8 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 148c6ceb86..5f583cb62b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -481,15 +481,6 @@ const ( BLKPG = 0x20001269 ) -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 - _ [4]byte -} - type CryptoUserAlg struct { Name [64]uint8 Driver_name [64]uint8 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 72ba81543e..15adc04142 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -499,15 +499,6 @@ const ( BLKPG = 0x1269 ) -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 - _ [4]byte -} - type CryptoUserAlg struct { Name [64]uint8 Driver_name [64]uint8 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 71e765508e..cf3ce90037 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -495,15 +495,6 @@ const ( BLKPG = 0x1269 ) -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 - _ [4]byte -} - type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 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 4abbdb9de9..590b56739c 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -476,15 +476,6 @@ const ( BLKPG = 0x20001269 ) -type XDPUmemReg struct { - Addr uint64 - Len uint64 - Size uint32 - Headroom uint32 - Flags uint32 - _ [4]byte -} - type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go index 54f31be637..d9a13af468 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go @@ -25,10 +25,13 @@ const ( SizeofIPv6Mreq = 20 SizeofICMPv6Filter = 32 SizeofIPv6MTUInfo = 32 + SizeofInet4Pktinfo = 8 + SizeofInet6Pktinfo = 20 SizeofLinger = 8 SizeofSockaddrInet4 = 16 SizeofSockaddrInet6 = 28 SizeofTCPInfo = 0x68 + SizeofUcred = 12 ) type ( @@ -69,12 +72,17 @@ type Utimbuf struct { } type Utsname struct { - Sysname [65]byte - Nodename [65]byte - Release [65]byte - Version [65]byte - Machine [65]byte - Domainname [65]byte + Sysname [16]byte + Nodename [32]byte + Release [8]byte + Version [8]byte + Machine [16]byte +} + +type Ucred struct { + Pid int32 + Uid uint32 + Gid uint32 } type RawSockaddrInet4 struct { @@ -325,7 +333,7 @@ type Statvfs_t struct { } type Statfs_t struct { - Type uint32 + Type uint64 Bsize uint64 Blocks uint64 Bfree uint64 @@ -336,6 +344,7 @@ type Statfs_t struct { Namelen uint64 Frsize uint64 Flags uint64 + _ [4]uint64 } type direntLE struct { @@ -412,3 +421,126 @@ type W_Mntent struct { Quiesceowner [8]byte _ [38]byte } + +type EpollEvent struct { + Events uint32 + _ int32 + Fd int32 + Pad int32 +} + +type InotifyEvent struct { + Wd int32 + Mask uint32 + Cookie uint32 + Len uint32 + Name string +} + +const ( + SizeofInotifyEvent = 0x10 +) + +type ConsMsg2 struct { + Cm2Format uint16 + Cm2R1 uint16 + Cm2Msglength uint32 + Cm2Msg *byte + Cm2R2 [4]byte + Cm2R3 [4]byte + Cm2Routcde *uint32 + Cm2Descr *uint32 + Cm2Msgflag uint32 + Cm2Token uint32 + Cm2Msgid *uint32 + Cm2R4 [4]byte + Cm2DomToken uint32 + Cm2DomMsgid *uint32 + Cm2ModCartptr *byte + Cm2ModConsidptr *byte + Cm2MsgCart [8]byte + Cm2MsgConsid [4]byte + Cm2R5 [12]byte +} + +const ( + CC_modify = 1 + CC_stop = 2 + CONSOLE_FORMAT_2 = 2 + CONSOLE_FORMAT_3 = 3 + CONSOLE_HRDCPY = 0x80000000 +) + +type OpenHow struct { + Flags uint64 + Mode uint64 + Resolve uint64 +} + +const SizeofOpenHow = 0x18 + +const ( + RESOLVE_CACHED = 0x20 + RESOLVE_BENEATH = 0x8 + RESOLVE_IN_ROOT = 0x10 + RESOLVE_NO_MAGICLINKS = 0x2 + RESOLVE_NO_SYMLINKS = 0x4 + RESOLVE_NO_XDEV = 0x1 +) + +type Siginfo struct { + Signo int32 + Errno int32 + Code int32 + Pid int32 + Uid uint32 + _ [44]byte +} + +type SysvIpcPerm struct { + Uid uint32 + Gid uint32 + Cuid uint32 + Cgid uint32 + Mode int32 +} + +type SysvShmDesc struct { + Perm SysvIpcPerm + _ [4]byte + Lpid int32 + Cpid int32 + Nattch uint32 + _ [4]byte + _ [4]byte + _ [4]byte + _ int32 + _ uint8 + _ uint8 + _ uint16 + _ *byte + Segsz uint64 + Atime Time_t + Dtime Time_t + Ctime Time_t +} + +type SysvShmDesc64 struct { + Perm SysvIpcPerm + _ [4]byte + Lpid int32 + Cpid int32 + Nattch uint32 + _ [4]byte + _ [4]byte + _ [4]byte + _ int32 + _ byte + _ uint8 + _ uint16 + _ *byte + Segsz uint64 + Atime int64 + Dtime int64 + Ctime int64 +} diff --git a/vendor/golang.org/x/sys/windows/aliases.go b/vendor/golang.org/x/sys/windows/aliases.go index ce2d713d62..16f90560a2 100644 --- a/vendor/golang.org/x/sys/windows/aliases.go +++ b/vendor/golang.org/x/sys/windows/aliases.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build windows && go1.9 +//go:build windows package windows diff --git a/vendor/golang.org/x/sys/windows/empty.s b/vendor/golang.org/x/sys/windows/empty.s deleted file mode 100644 index ba64caca5d..0000000000 --- a/vendor/golang.org/x/sys/windows/empty.s +++ /dev/null @@ -1,8 +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. - -//go:build !go1.12 - -// This file is here to allow bodyless functions with go:linkname for Go 1.11 -// and earlier (see https://golang.org/issue/23311). diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index 26be94a8a7..b6e1ab76f8 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -68,6 +68,7 @@ type UserInfo10 struct { //sys NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) = netapi32.NetUserGetInfo //sys NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) = netapi32.NetGetJoinInformation //sys NetApiBufferFree(buf *byte) (neterr error) = netapi32.NetApiBufferFree +//sys NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) = netapi32.NetUserEnum const ( // do not reorder @@ -893,7 +894,7 @@ type ACL struct { aclRevision byte sbz1 byte aclSize uint16 - aceCount uint16 + AceCount uint16 sbz2 uint16 } @@ -1086,6 +1087,27 @@ type EXPLICIT_ACCESS struct { Trustee TRUSTEE } +// https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-ace_header +type ACE_HEADER struct { + AceType uint8 + AceFlags uint8 + AceSize uint16 +} + +// https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-access_allowed_ace +type ACCESS_ALLOWED_ACE struct { + Header ACE_HEADER + Mask ACCESS_MASK + SidStart uint32 +} + +const ( + // Constants for AceType + // https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-ace_header + ACCESS_ALLOWED_ACE_TYPE = 0 + ACCESS_DENIED_ACE_TYPE = 1 +) + // This type is the union inside of TRUSTEE and must be created using one of the TrusteeValueFrom* functions. type TrusteeValue uintptr @@ -1157,6 +1179,7 @@ type OBJECTS_AND_NAME struct { //sys makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURITY_DESCRIPTOR, selfRelativeSDSize *uint32) (err error) = advapi32.MakeSelfRelativeSD //sys setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) = advapi32.SetEntriesInAclW +//sys GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) = advapi32.GetAce // Control returns the security descriptor control bits. func (sd *SECURITY_DESCRIPTOR) Control() (control SECURITY_DESCRIPTOR_CONTROL, revision uint32, err error) { diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 6395a031d4..1fa34fd17c 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -17,8 +17,10 @@ import ( "unsafe" ) -type Handle uintptr -type HWND uintptr +type ( + Handle uintptr + HWND uintptr +) const ( InvalidHandle = ^Handle(0) @@ -165,6 +167,7 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile Handle) (handle Handle, err error) [failretval==InvalidHandle] = CreateFileW //sys CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *SecurityAttributes) (handle Handle, err error) [failretval==InvalidHandle] = CreateNamedPipeW //sys ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) +//sys DisconnectNamedPipe(pipe Handle) (err error) //sys GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) //sys GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW //sys SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32) (err error) = SetNamedPipeHandleState @@ -210,6 +213,10 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (handle Handle, err error) //sys ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) [failretval<=32] = shell32.ShellExecuteW //sys GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) = user32.GetWindowThreadProcessId +//sys LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) [failretval==0] = user32.LoadKeyboardLayoutW +//sys UnloadKeyboardLayout(hkl Handle) (err error) = user32.UnloadKeyboardLayout +//sys GetKeyboardLayout(tid uint32) (hkl Handle) = user32.GetKeyboardLayout +//sys ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) = user32.ToUnicodeEx //sys GetShellWindow() (shellWindow HWND) = user32.GetShellWindow //sys MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) [failretval==0] = user32.MessageBoxW //sys ExitWindowsEx(flags uint32, reason uint32) (err error) = user32.ExitWindowsEx @@ -348,8 +355,19 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys SetProcessPriorityBoost(process Handle, disable bool) (err error) = kernel32.SetProcessPriorityBoost //sys GetProcessWorkingSetSizeEx(hProcess Handle, lpMinimumWorkingSetSize *uintptr, lpMaximumWorkingSetSize *uintptr, flags *uint32) //sys SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr, dwMaximumWorkingSetSize uintptr, flags uint32) (err error) +//sys ClearCommBreak(handle Handle) (err error) +//sys ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error) +//sys EscapeCommFunction(handle Handle, dwFunc uint32) (err error) +//sys GetCommState(handle Handle, lpDCB *DCB) (err error) +//sys GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error) //sys GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) +//sys PurgeComm(handle Handle, dwFlags uint32) (err error) +//sys SetCommBreak(handle Handle) (err error) +//sys SetCommMask(handle Handle, dwEvtMask uint32) (err error) +//sys SetCommState(handle Handle, lpDCB *DCB) (err error) //sys SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) +//sys SetupComm(handle Handle, dwInQueue uint32, dwOutQueue uint32) (err error) +//sys WaitCommEvent(handle Handle, lpEvtMask *uint32, lpOverlapped *Overlapped) (err error) //sys GetActiveProcessorCount(groupNumber uint16) (ret uint32) //sys GetMaximumProcessorCount(groupNumber uint16) (ret uint32) //sys EnumWindows(enumFunc uintptr, param unsafe.Pointer) (err error) = user32.EnumWindows @@ -1356,9 +1374,11 @@ func SetsockoptLinger(fd Handle, level, opt int, l *Linger) (err error) { func SetsockoptInet4Addr(fd Handle, level, opt int, value [4]byte) (err error) { return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&value[0])), 4) } + func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (err error) { return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(mreq)), int32(unsafe.Sizeof(*mreq))) } + func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) { return syscall.EWINDOWS } @@ -1834,3 +1854,73 @@ func ResizePseudoConsole(pconsole Handle, size Coord) error { // accept arguments that can be casted to uintptr, and Coord can't. return resizePseudoConsole(pconsole, *((*uint32)(unsafe.Pointer(&size)))) } + +// DCB constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-dcb. +const ( + CBR_110 = 110 + CBR_300 = 300 + CBR_600 = 600 + CBR_1200 = 1200 + CBR_2400 = 2400 + CBR_4800 = 4800 + CBR_9600 = 9600 + CBR_14400 = 14400 + CBR_19200 = 19200 + CBR_38400 = 38400 + CBR_57600 = 57600 + CBR_115200 = 115200 + CBR_128000 = 128000 + CBR_256000 = 256000 + + DTR_CONTROL_DISABLE = 0x00000000 + DTR_CONTROL_ENABLE = 0x00000010 + DTR_CONTROL_HANDSHAKE = 0x00000020 + + RTS_CONTROL_DISABLE = 0x00000000 + RTS_CONTROL_ENABLE = 0x00001000 + RTS_CONTROL_HANDSHAKE = 0x00002000 + RTS_CONTROL_TOGGLE = 0x00003000 + + NOPARITY = 0 + ODDPARITY = 1 + EVENPARITY = 2 + MARKPARITY = 3 + SPACEPARITY = 4 + + ONESTOPBIT = 0 + ONE5STOPBITS = 1 + TWOSTOPBITS = 2 +) + +// EscapeCommFunction constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-escapecommfunction. +const ( + SETXOFF = 1 + SETXON = 2 + SETRTS = 3 + CLRRTS = 4 + SETDTR = 5 + CLRDTR = 6 + SETBREAK = 8 + CLRBREAK = 9 +) + +// PurgeComm constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-purgecomm. +const ( + PURGE_TXABORT = 0x0001 + PURGE_RXABORT = 0x0002 + PURGE_TXCLEAR = 0x0004 + PURGE_RXCLEAR = 0x0008 +) + +// SetCommMask constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setcommmask. +const ( + EV_RXCHAR = 0x0001 + EV_RXFLAG = 0x0002 + EV_TXEMPTY = 0x0004 + EV_CTS = 0x0008 + EV_DSR = 0x0010 + EV_RLSD = 0x0020 + EV_BREAK = 0x0040 + EV_ERR = 0x0080 + EV_RING = 0x0100 +) diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index 359780f6ac..3f03b3d57c 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -2003,7 +2003,21 @@ const ( MOVEFILE_FAIL_IF_NOT_TRACKABLE = 0x20 ) -const GAA_FLAG_INCLUDE_PREFIX = 0x00000010 +// Flags for GetAdaptersAddresses, see +// https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses. +const ( + GAA_FLAG_SKIP_UNICAST = 0x1 + GAA_FLAG_SKIP_ANYCAST = 0x2 + GAA_FLAG_SKIP_MULTICAST = 0x4 + GAA_FLAG_SKIP_DNS_SERVER = 0x8 + GAA_FLAG_INCLUDE_PREFIX = 0x10 + GAA_FLAG_SKIP_FRIENDLY_NAME = 0x20 + GAA_FLAG_INCLUDE_WINS_INFO = 0x40 + GAA_FLAG_INCLUDE_GATEWAYS = 0x80 + GAA_FLAG_INCLUDE_ALL_INTERFACES = 0x100 + GAA_FLAG_INCLUDE_ALL_COMPARTMENTS = 0x200 + GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER = 0x400 +) const ( IF_TYPE_OTHER = 1 @@ -2017,6 +2031,50 @@ const ( IF_TYPE_IEEE1394 = 144 ) +// Enum NL_PREFIX_ORIGIN for [IpAdapterUnicastAddress], see +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_prefix_origin +const ( + IpPrefixOriginOther = 0 + IpPrefixOriginManual = 1 + IpPrefixOriginWellKnown = 2 + IpPrefixOriginDhcp = 3 + IpPrefixOriginRouterAdvertisement = 4 + IpPrefixOriginUnchanged = 1 << 4 +) + +// Enum NL_SUFFIX_ORIGIN for [IpAdapterUnicastAddress], see +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_suffix_origin +const ( + NlsoOther = 0 + NlsoManual = 1 + NlsoWellKnown = 2 + NlsoDhcp = 3 + NlsoLinkLayerAddress = 4 + NlsoRandom = 5 + IpSuffixOriginOther = 0 + IpSuffixOriginManual = 1 + IpSuffixOriginWellKnown = 2 + IpSuffixOriginDhcp = 3 + IpSuffixOriginLinkLayerAddress = 4 + IpSuffixOriginRandom = 5 + IpSuffixOriginUnchanged = 1 << 4 +) + +// Enum NL_DAD_STATE for [IpAdapterUnicastAddress], see +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_dad_state +const ( + NldsInvalid = 0 + NldsTentative = 1 + NldsDuplicate = 2 + NldsDeprecated = 3 + NldsPreferred = 4 + IpDadStateInvalid = 0 + IpDadStateTentative = 1 + IpDadStateDuplicate = 2 + IpDadStateDeprecated = 3 + IpDadStatePreferred = 4 +) + type SocketAddress struct { Sockaddr *syscall.RawSockaddrAny SockaddrLength int32 @@ -3380,3 +3438,38 @@ type BLOB struct { Size uint32 BlobData *byte } + +type ComStat struct { + Flags uint32 + CBInQue uint32 + CBOutQue uint32 +} + +type DCB struct { + DCBlength uint32 + BaudRate uint32 + Flags uint32 + wReserved uint16 + XonLim uint16 + XoffLim uint16 + ByteSize uint8 + Parity uint8 + StopBits uint8 + XonChar byte + XoffChar byte + ErrorChar byte + EofChar byte + EvtChar byte + wReserved1 uint16 +} + +// Keyboard Layout Flags. +// See https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadkeyboardlayoutw +const ( + KLF_ACTIVATE = 0x00000001 + KLF_SUBSTITUTE_OK = 0x00000002 + KLF_REORDER = 0x00000008 + KLF_REPLACELANG = 0x00000010 + KLF_NOTELLSHELL = 0x00000080 + KLF_SETFORPROCESS = 0x00000100 +) diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index e8791c82c3..9bb979a3e4 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -91,6 +91,7 @@ var ( procEnumServicesStatusExW = modadvapi32.NewProc("EnumServicesStatusExW") procEqualSid = modadvapi32.NewProc("EqualSid") procFreeSid = modadvapi32.NewProc("FreeSid") + procGetAce = modadvapi32.NewProc("GetAce") procGetLengthSid = modadvapi32.NewProc("GetLengthSid") procGetNamedSecurityInfoW = modadvapi32.NewProc("GetNamedSecurityInfoW") procGetSecurityDescriptorControl = modadvapi32.NewProc("GetSecurityDescriptorControl") @@ -188,6 +189,8 @@ var ( procAssignProcessToJobObject = modkernel32.NewProc("AssignProcessToJobObject") procCancelIo = modkernel32.NewProc("CancelIo") procCancelIoEx = modkernel32.NewProc("CancelIoEx") + procClearCommBreak = modkernel32.NewProc("ClearCommBreak") + procClearCommError = modkernel32.NewProc("ClearCommError") procCloseHandle = modkernel32.NewProc("CloseHandle") procClosePseudoConsole = modkernel32.NewProc("ClosePseudoConsole") procConnectNamedPipe = modkernel32.NewProc("ConnectNamedPipe") @@ -212,7 +215,9 @@ var ( procDeleteProcThreadAttributeList = modkernel32.NewProc("DeleteProcThreadAttributeList") procDeleteVolumeMountPointW = modkernel32.NewProc("DeleteVolumeMountPointW") procDeviceIoControl = modkernel32.NewProc("DeviceIoControl") + procDisconnectNamedPipe = modkernel32.NewProc("DisconnectNamedPipe") procDuplicateHandle = modkernel32.NewProc("DuplicateHandle") + procEscapeCommFunction = modkernel32.NewProc("EscapeCommFunction") procExitProcess = modkernel32.NewProc("ExitProcess") procExpandEnvironmentStringsW = modkernel32.NewProc("ExpandEnvironmentStringsW") procFindClose = modkernel32.NewProc("FindClose") @@ -236,6 +241,8 @@ var ( procGenerateConsoleCtrlEvent = modkernel32.NewProc("GenerateConsoleCtrlEvent") procGetACP = modkernel32.NewProc("GetACP") procGetActiveProcessorCount = modkernel32.NewProc("GetActiveProcessorCount") + procGetCommModemStatus = modkernel32.NewProc("GetCommModemStatus") + procGetCommState = modkernel32.NewProc("GetCommState") procGetCommTimeouts = modkernel32.NewProc("GetCommTimeouts") procGetCommandLineW = modkernel32.NewProc("GetCommandLineW") procGetComputerNameExW = modkernel32.NewProc("GetComputerNameExW") @@ -322,6 +329,7 @@ var ( procProcess32NextW = modkernel32.NewProc("Process32NextW") procProcessIdToSessionId = modkernel32.NewProc("ProcessIdToSessionId") procPulseEvent = modkernel32.NewProc("PulseEvent") + procPurgeComm = modkernel32.NewProc("PurgeComm") procQueryDosDeviceW = modkernel32.NewProc("QueryDosDeviceW") procQueryFullProcessImageNameW = modkernel32.NewProc("QueryFullProcessImageNameW") procQueryInformationJobObject = modkernel32.NewProc("QueryInformationJobObject") @@ -335,6 +343,9 @@ var ( procResetEvent = modkernel32.NewProc("ResetEvent") procResizePseudoConsole = modkernel32.NewProc("ResizePseudoConsole") procResumeThread = modkernel32.NewProc("ResumeThread") + procSetCommBreak = modkernel32.NewProc("SetCommBreak") + procSetCommMask = modkernel32.NewProc("SetCommMask") + procSetCommState = modkernel32.NewProc("SetCommState") procSetCommTimeouts = modkernel32.NewProc("SetCommTimeouts") procSetConsoleCursorPosition = modkernel32.NewProc("SetConsoleCursorPosition") procSetConsoleMode = modkernel32.NewProc("SetConsoleMode") @@ -342,7 +353,6 @@ var ( procSetDefaultDllDirectories = modkernel32.NewProc("SetDefaultDllDirectories") procSetDllDirectoryW = modkernel32.NewProc("SetDllDirectoryW") procSetEndOfFile = modkernel32.NewProc("SetEndOfFile") - procSetFileValidData = modkernel32.NewProc("SetFileValidData") procSetEnvironmentVariableW = modkernel32.NewProc("SetEnvironmentVariableW") procSetErrorMode = modkernel32.NewProc("SetErrorMode") procSetEvent = modkernel32.NewProc("SetEvent") @@ -351,6 +361,7 @@ var ( procSetFileInformationByHandle = modkernel32.NewProc("SetFileInformationByHandle") procSetFilePointer = modkernel32.NewProc("SetFilePointer") procSetFileTime = modkernel32.NewProc("SetFileTime") + procSetFileValidData = modkernel32.NewProc("SetFileValidData") procSetHandleInformation = modkernel32.NewProc("SetHandleInformation") procSetInformationJobObject = modkernel32.NewProc("SetInformationJobObject") procSetNamedPipeHandleState = modkernel32.NewProc("SetNamedPipeHandleState") @@ -361,6 +372,7 @@ var ( procSetStdHandle = modkernel32.NewProc("SetStdHandle") procSetVolumeLabelW = modkernel32.NewProc("SetVolumeLabelW") procSetVolumeMountPointW = modkernel32.NewProc("SetVolumeMountPointW") + procSetupComm = modkernel32.NewProc("SetupComm") procSizeofResource = modkernel32.NewProc("SizeofResource") procSleepEx = modkernel32.NewProc("SleepEx") procTerminateJobObject = modkernel32.NewProc("TerminateJobObject") @@ -379,6 +391,7 @@ var ( procVirtualQueryEx = modkernel32.NewProc("VirtualQueryEx") procVirtualUnlock = modkernel32.NewProc("VirtualUnlock") procWTSGetActiveConsoleSessionId = modkernel32.NewProc("WTSGetActiveConsoleSessionId") + procWaitCommEvent = modkernel32.NewProc("WaitCommEvent") procWaitForMultipleObjects = modkernel32.NewProc("WaitForMultipleObjects") procWaitForSingleObject = modkernel32.NewProc("WaitForSingleObject") procWriteConsoleW = modkernel32.NewProc("WriteConsoleW") @@ -389,6 +402,7 @@ var ( procTransmitFile = modmswsock.NewProc("TransmitFile") procNetApiBufferFree = modnetapi32.NewProc("NetApiBufferFree") procNetGetJoinInformation = modnetapi32.NewProc("NetGetJoinInformation") + procNetUserEnum = modnetapi32.NewProc("NetUserEnum") procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo") procNtCreateFile = modntdll.NewProc("NtCreateFile") procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") @@ -464,12 +478,16 @@ var ( procGetDesktopWindow = moduser32.NewProc("GetDesktopWindow") procGetForegroundWindow = moduser32.NewProc("GetForegroundWindow") procGetGUIThreadInfo = moduser32.NewProc("GetGUIThreadInfo") + procGetKeyboardLayout = moduser32.NewProc("GetKeyboardLayout") procGetShellWindow = moduser32.NewProc("GetShellWindow") procGetWindowThreadProcessId = moduser32.NewProc("GetWindowThreadProcessId") procIsWindow = moduser32.NewProc("IsWindow") procIsWindowUnicode = moduser32.NewProc("IsWindowUnicode") procIsWindowVisible = moduser32.NewProc("IsWindowVisible") + procLoadKeyboardLayoutW = moduser32.NewProc("LoadKeyboardLayoutW") procMessageBoxW = moduser32.NewProc("MessageBoxW") + procToUnicodeEx = moduser32.NewProc("ToUnicodeEx") + procUnloadKeyboardLayout = moduser32.NewProc("UnloadKeyboardLayout") procCreateEnvironmentBlock = moduserenv.NewProc("CreateEnvironmentBlock") procDestroyEnvironmentBlock = moduserenv.NewProc("DestroyEnvironmentBlock") procGetUserProfileDirectoryW = moduserenv.NewProc("GetUserProfileDirectoryW") @@ -775,6 +793,14 @@ func FreeSid(sid *SID) (err error) { return } +func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) { + r1, _, e1 := syscall.Syscall(procGetAce.Addr(), 3, uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce))) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func GetLengthSid(sid *SID) (len uint32) { r0, _, _ := syscall.Syscall(procGetLengthSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) len = uint32(r0) @@ -1641,6 +1667,22 @@ func CancelIoEx(s Handle, o *Overlapped) (err error) { return } +func ClearCommBreak(handle Handle) (err error) { + r1, _, e1 := syscall.Syscall(procClearCommBreak.Addr(), 1, uintptr(handle), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + +func ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error) { + r1, _, e1 := syscall.Syscall(procClearCommError.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(lpErrors)), uintptr(unsafe.Pointer(lpStat))) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func CloseHandle(handle Handle) (err error) { r1, _, e1 := syscall.Syscall(procCloseHandle.Addr(), 1, uintptr(handle), 0, 0) if r1 == 0 { @@ -1845,6 +1887,14 @@ func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBuff return } +func DisconnectNamedPipe(pipe Handle) (err error) { + r1, _, e1 := syscall.Syscall(procDisconnectNamedPipe.Addr(), 1, uintptr(pipe), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error) { var _p0 uint32 if bInheritHandle { @@ -1857,6 +1907,14 @@ func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetP return } +func EscapeCommFunction(handle Handle, dwFunc uint32) (err error) { + r1, _, e1 := syscall.Syscall(procEscapeCommFunction.Addr(), 2, uintptr(handle), uintptr(dwFunc), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func ExitProcess(exitcode uint32) { syscall.Syscall(procExitProcess.Addr(), 1, uintptr(exitcode), 0, 0) return @@ -2058,6 +2116,22 @@ func GetActiveProcessorCount(groupNumber uint16) (ret uint32) { return } +func GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error) { + r1, _, e1 := syscall.Syscall(procGetCommModemStatus.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(lpModemStat)), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + +func GetCommState(handle Handle, lpDCB *DCB) (err error) { + r1, _, e1 := syscall.Syscall(procGetCommState.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(lpDCB)), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { r1, _, e1 := syscall.Syscall(procGetCommTimeouts.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(timeouts)), 0) if r1 == 0 { @@ -2810,6 +2884,14 @@ func PulseEvent(event Handle) (err error) { return } +func PurgeComm(handle Handle, dwFlags uint32) (err error) { + r1, _, e1 := syscall.Syscall(procPurgeComm.Addr(), 2, uintptr(handle), uintptr(dwFlags), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint32, err error) { r0, _, e1 := syscall.Syscall(procQueryDosDeviceW.Addr(), 3, uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath)), uintptr(max)) n = uint32(r0) @@ -2924,6 +3006,30 @@ func ResumeThread(thread Handle) (ret uint32, err error) { return } +func SetCommBreak(handle Handle) (err error) { + r1, _, e1 := syscall.Syscall(procSetCommBreak.Addr(), 1, uintptr(handle), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + +func SetCommMask(handle Handle, dwEvtMask uint32) (err error) { + r1, _, e1 := syscall.Syscall(procSetCommMask.Addr(), 2, uintptr(handle), uintptr(dwEvtMask), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + +func SetCommState(handle Handle, lpDCB *DCB) (err error) { + r1, _, e1 := syscall.Syscall(procSetCommState.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(lpDCB)), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { r1, _, e1 := syscall.Syscall(procSetCommTimeouts.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(timeouts)), 0) if r1 == 0 { @@ -2989,14 +3095,6 @@ func SetEndOfFile(handle Handle) (err error) { return } -func SetFileValidData(handle Handle, validDataLength int64) (err error) { - r1, _, e1 := syscall.Syscall(procSetFileValidData.Addr(), 2, uintptr(handle), uintptr(validDataLength), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - func SetEnvironmentVariable(name *uint16, value *uint16) (err error) { r1, _, e1 := syscall.Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0) if r1 == 0 { @@ -3060,6 +3158,14 @@ func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetim return } +func SetFileValidData(handle Handle, validDataLength int64) (err error) { + r1, _, e1 := syscall.Syscall(procSetFileValidData.Addr(), 2, uintptr(handle), uintptr(validDataLength), 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) { r1, _, e1 := syscall.Syscall(procSetHandleInformation.Addr(), 3, uintptr(handle), uintptr(mask), uintptr(flags)) if r1 == 0 { @@ -3145,6 +3251,14 @@ func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err erro return } +func SetupComm(handle Handle, dwInQueue uint32, dwOutQueue uint32) (err error) { + r1, _, e1 := syscall.Syscall(procSetupComm.Addr(), 3, uintptr(handle), uintptr(dwInQueue), uintptr(dwOutQueue)) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func SizeofResource(module Handle, resInfo Handle) (size uint32, err error) { r0, _, e1 := syscall.Syscall(procSizeofResource.Addr(), 2, uintptr(module), uintptr(resInfo), 0) size = uint32(r0) @@ -3291,6 +3405,14 @@ func WTSGetActiveConsoleSessionId() (sessionID uint32) { return } +func WaitCommEvent(handle Handle, lpEvtMask *uint32, lpOverlapped *Overlapped) (err error) { + r1, _, e1 := syscall.Syscall(procWaitCommEvent.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(lpEvtMask)), uintptr(unsafe.Pointer(lpOverlapped))) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func waitForMultipleObjects(count uint32, handles uintptr, waitAll bool, waitMilliseconds uint32) (event uint32, err error) { var _p0 uint32 if waitAll { @@ -3378,6 +3500,14 @@ func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (nete return } +func NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) { + r0, _, _ := syscall.Syscall9(procNetUserEnum.Addr(), 8, uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(filter), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), uintptr(unsafe.Pointer(resumeHandle)), 0) + if r0 != 0 { + neterr = syscall.Errno(r0) + } + return +} + func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) { r0, _, _ := syscall.Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0) if r0 != 0 { @@ -3956,6 +4086,12 @@ func GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error) { return } +func GetKeyboardLayout(tid uint32) (hkl Handle) { + r0, _, _ := syscall.Syscall(procGetKeyboardLayout.Addr(), 1, uintptr(tid), 0, 0) + hkl = Handle(r0) + return +} + func GetShellWindow() (shellWindow HWND) { r0, _, _ := syscall.Syscall(procGetShellWindow.Addr(), 0, 0, 0, 0) shellWindow = HWND(r0) @@ -3989,6 +4125,15 @@ func IsWindowVisible(hwnd HWND) (isVisible bool) { return } +func LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) { + r0, _, e1 := syscall.Syscall(procLoadKeyboardLayoutW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(flags), 0) + hkl = Handle(r0) + if hkl == 0 { + err = errnoErr(e1) + } + return +} + func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) { r0, _, e1 := syscall.Syscall6(procMessageBoxW.Addr(), 4, uintptr(hwnd), uintptr(unsafe.Pointer(text)), uintptr(unsafe.Pointer(caption)), uintptr(boxtype), 0, 0) ret = int32(r0) @@ -3998,6 +4143,20 @@ func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret i return } +func ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) { + r0, _, _ := syscall.Syscall9(procToUnicodeEx.Addr(), 7, uintptr(vkey), uintptr(scancode), uintptr(unsafe.Pointer(keystate)), uintptr(unsafe.Pointer(pwszBuff)), uintptr(cchBuff), uintptr(flags), uintptr(hkl), 0, 0) + ret = int32(r0) + return +} + +func UnloadKeyboardLayout(hkl Handle) (err error) { + r1, _, e1 := syscall.Syscall(procUnloadKeyboardLayout.Addr(), 1, uintptr(hkl), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) (err error) { var _p0 uint32 if inheritExisting { diff --git a/vendor/golang.org/x/term/LICENSE b/vendor/golang.org/x/term/LICENSE index 6a66aea5ea..2a7cf70da6 100644 --- a/vendor/golang.org/x/term/LICENSE +++ b/vendor/golang.org/x/term/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. 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 + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/vendor/golang.org/x/text/LICENSE b/vendor/golang.org/x/text/LICENSE index 6a66aea5ea..2a7cf70da6 100644 --- a/vendor/golang.org/x/text/LICENSE +++ b/vendor/golang.org/x/text/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. 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 + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 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 dd3febd43b..0000000000 --- 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 07c1cb17af..0000000000 --- a/vendor/golang.org/x/text/width/tables10.0.0.go +++ /dev/null @@ -1,1328 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -//go: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 89288b3dae..0000000000 --- a/vendor/golang.org/x/text/width/tables11.0.0.go +++ /dev/null @@ -1,1340 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -//go:build go1.13 && !go1.14 - -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/tables12.0.0.go b/vendor/golang.org/x/text/width/tables12.0.0.go deleted file mode 100644 index 755ee91221..0000000000 --- a/vendor/golang.org/x/text/width/tables12.0.0.go +++ /dev/null @@ -1,1360 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -//go:build go1.14 && !go1.16 - -package width - -// UnicodeVersion is the Unicode version from which the tables in this package are derived. -const UnicodeVersion = "12.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: 14720 bytes (14.38 KiB). Checksum: 3f4f2516ded5489b. -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: 104 blocks, 6656 entries, 13312 bytes -// The third block is the zero block. -var widthValues = [6656]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, 0x11e2: 0x4000, 0x11e3: 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, 0x1232: 0x4000, 0x1233: 0x4000, 0x1234: 0x4000, 0x1235: 0x4000, - 0x1236: 0x4000, 0x1237: 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 - 0x12d0: 0x4000, 0x12d1: 0x4000, - 0x12d2: 0x4000, - 0x12e4: 0x4000, 0x12e5: 0x4000, 0x12e6: 0x4000, 0x12e7: 0x4000, - 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, 0x17d5: 0x4000, - 0x17eb: 0x4000, 0x17ec: 0x4000, - 0x17f4: 0x4000, 0x17f5: 0x4000, - 0x17f6: 0x4000, 0x17f7: 0x4000, 0x17f8: 0x4000, 0x17f9: 0x4000, 0x17fa: 0x4000, - // Block 0x60, offset 0x1800 - 0x1820: 0x4000, 0x1821: 0x4000, 0x1822: 0x4000, 0x1823: 0x4000, - 0x1824: 0x4000, 0x1825: 0x4000, 0x1826: 0x4000, 0x1827: 0x4000, 0x1828: 0x4000, 0x1829: 0x4000, - 0x182a: 0x4000, 0x182b: 0x4000, - // Block 0x61, offset 0x1840 - 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, 0x1871: 0x4000, 0x1872: 0x4000, 0x1873: 0x4000, 0x1874: 0x4000, 0x1875: 0x4000, - 0x1876: 0x4000, 0x1877: 0x4000, 0x1878: 0x4000, 0x1879: 0x4000, 0x187a: 0x4000, 0x187b: 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, 0x18a3: 0x4000, - 0x18a4: 0x4000, 0x18a5: 0x4000, 0x18a6: 0x4000, 0x18a7: 0x4000, 0x18a8: 0x4000, 0x18a9: 0x4000, - 0x18aa: 0x4000, 0x18ab: 0x4000, 0x18ac: 0x4000, 0x18ad: 0x4000, 0x18ae: 0x4000, 0x18af: 0x4000, - 0x18b0: 0x4000, 0x18b1: 0x4000, 0x18b3: 0x4000, 0x18b4: 0x4000, 0x18b5: 0x4000, - 0x18b6: 0x4000, 0x18ba: 0x4000, 0x18bb: 0x4000, - 0x18bc: 0x4000, 0x18bd: 0x4000, 0x18be: 0x4000, 0x18bf: 0x4000, - // Block 0x63, offset 0x18c0 - 0x18c0: 0x4000, 0x18c1: 0x4000, 0x18c2: 0x4000, 0x18c3: 0x4000, 0x18c4: 0x4000, 0x18c5: 0x4000, - 0x18c6: 0x4000, 0x18c7: 0x4000, 0x18c8: 0x4000, 0x18c9: 0x4000, 0x18ca: 0x4000, 0x18cb: 0x4000, - 0x18cc: 0x4000, 0x18cd: 0x4000, 0x18ce: 0x4000, 0x18cf: 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, - 0x18e5: 0x4000, 0x18e6: 0x4000, 0x18e7: 0x4000, 0x18e8: 0x4000, 0x18e9: 0x4000, - 0x18ea: 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: 0x4000, 0x1901: 0x4000, 0x1902: 0x4000, 0x1903: 0x4000, 0x1904: 0x4000, 0x1905: 0x4000, - 0x1906: 0x4000, 0x1907: 0x4000, 0x1908: 0x4000, 0x1909: 0x4000, 0x190a: 0x4000, - 0x190d: 0x4000, 0x190e: 0x4000, 0x190f: 0x4000, 0x1910: 0x4000, 0x1911: 0x4000, - 0x1912: 0x4000, 0x1913: 0x4000, 0x1914: 0x4000, 0x1915: 0x4000, 0x1916: 0x4000, 0x1917: 0x4000, - 0x1918: 0x4000, 0x1919: 0x4000, 0x191a: 0x4000, 0x191b: 0x4000, 0x191c: 0x4000, 0x191d: 0x4000, - 0x191e: 0x4000, 0x191f: 0x4000, 0x1920: 0x4000, 0x1921: 0x4000, 0x1922: 0x4000, 0x1923: 0x4000, - 0x1924: 0x4000, 0x1925: 0x4000, 0x1926: 0x4000, 0x1927: 0x4000, 0x1928: 0x4000, 0x1929: 0x4000, - 0x192a: 0x4000, 0x192b: 0x4000, 0x192c: 0x4000, 0x192d: 0x4000, 0x192e: 0x4000, 0x192f: 0x4000, - 0x1930: 0x4000, 0x1931: 0x4000, 0x1932: 0x4000, 0x1933: 0x4000, 0x1934: 0x4000, 0x1935: 0x4000, - 0x1936: 0x4000, 0x1937: 0x4000, 0x1938: 0x4000, 0x1939: 0x4000, 0x193a: 0x4000, 0x193b: 0x4000, - 0x193c: 0x4000, 0x193d: 0x4000, 0x193e: 0x4000, 0x193f: 0x4000, - // Block 0x65, offset 0x1940 - 0x1970: 0x4000, 0x1971: 0x4000, 0x1972: 0x4000, 0x1973: 0x4000, - 0x1978: 0x4000, 0x1979: 0x4000, 0x197a: 0x4000, - // Block 0x66, offset 0x1980 - 0x1980: 0x4000, 0x1981: 0x4000, 0x1982: 0x4000, - 0x1990: 0x4000, 0x1991: 0x4000, - 0x1992: 0x4000, 0x1993: 0x4000, 0x1994: 0x4000, 0x1995: 0x4000, - // Block 0x67, offset 0x19c0 - 0x19c0: 0x2000, 0x19c1: 0x2000, 0x19c2: 0x2000, 0x19c3: 0x2000, 0x19c4: 0x2000, 0x19c5: 0x2000, - 0x19c6: 0x2000, 0x19c7: 0x2000, 0x19c8: 0x2000, 0x19c9: 0x2000, 0x19ca: 0x2000, 0x19cb: 0x2000, - 0x19cc: 0x2000, 0x19cd: 0x2000, 0x19ce: 0x2000, 0x19cf: 0x2000, 0x19d0: 0x2000, 0x19d1: 0x2000, - 0x19d2: 0x2000, 0x19d3: 0x2000, 0x19d4: 0x2000, 0x19d5: 0x2000, 0x19d6: 0x2000, 0x19d7: 0x2000, - 0x19d8: 0x2000, 0x19d9: 0x2000, 0x19da: 0x2000, 0x19db: 0x2000, 0x19dc: 0x2000, 0x19dd: 0x2000, - 0x19de: 0x2000, 0x19df: 0x2000, 0x19e0: 0x2000, 0x19e1: 0x2000, 0x19e2: 0x2000, 0x19e3: 0x2000, - 0x19e4: 0x2000, 0x19e5: 0x2000, 0x19e6: 0x2000, 0x19e7: 0x2000, 0x19e8: 0x2000, 0x19e9: 0x2000, - 0x19ea: 0x2000, 0x19eb: 0x2000, 0x19ec: 0x2000, 0x19ed: 0x2000, 0x19ee: 0x2000, 0x19ef: 0x2000, - 0x19f0: 0x2000, 0x19f1: 0x2000, 0x19f2: 0x2000, 0x19f3: 0x2000, 0x19f4: 0x2000, 0x19f5: 0x2000, - 0x19f6: 0x2000, 0x19f7: 0x2000, 0x19f8: 0x2000, 0x19f9: 0x2000, 0x19fa: 0x2000, 0x19fb: 0x2000, - 0x19fc: 0x2000, 0x19fd: 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, 0x41f: 0x5e, - 0x424: 0x5f, 0x425: 0x60, 0x426: 0x61, 0x427: 0x62, - 0x429: 0x63, 0x42a: 0x64, - // 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: 0x65, - // 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 15320 bytes (14KiB) diff --git a/vendor/golang.org/x/text/width/tables13.0.0.go b/vendor/golang.org/x/text/width/tables13.0.0.go deleted file mode 100644 index 40c169edf6..0000000000 --- a/vendor/golang.org/x/text/width/tables13.0.0.go +++ /dev/null @@ -1,1361 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -//go:build go1.16 && !go1.21 - -package width - -// UnicodeVersion is the Unicode version from which the tables in this package are derived. -const UnicodeVersion = "13.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: 14848 bytes (14.50 KiB). Checksum: 17e24343536472f6. -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: 105 blocks, 6720 entries, 13440 bytes -// The third block is the zero block. -var widthValues = [6720]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, 0xe3b: 0x4000, - 0xe3c: 0x4000, 0xe3d: 0x4000, 0xe3e: 0x4000, 0xe3f: 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, 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, 0xf3f: 0x4000, - // Block 0x3d, offset 0xf40 - 0xf40: 0x4000, 0xf41: 0x4000, 0xf42: 0x4000, 0xf43: 0x4000, 0xf44: 0x4000, 0xf45: 0x4000, - 0xf46: 0x4000, - // Block 0x3e, offset 0xf80 - 0xfa0: 0x4000, 0xfa1: 0x4000, 0xfa2: 0x4000, 0xfa3: 0x4000, - 0xfa4: 0x4000, 0xfa5: 0x4000, 0xfa6: 0x4000, 0xfa7: 0x4000, 0xfa8: 0x4000, 0xfa9: 0x4000, - 0xfaa: 0x4000, 0xfab: 0x4000, 0xfac: 0x4000, 0xfad: 0x4000, 0xfae: 0x4000, 0xfaf: 0x4000, - 0xfb0: 0x4000, 0xfb1: 0x4000, 0xfb2: 0x4000, 0xfb3: 0x4000, 0xfb4: 0x4000, 0xfb5: 0x4000, - 0xfb6: 0x4000, 0xfb7: 0x4000, 0xfb8: 0x4000, 0xfb9: 0x4000, 0xfba: 0x4000, 0xfbb: 0x4000, - 0xfbc: 0x4000, - // Block 0x3f, offset 0xfc0 - 0xfc0: 0x4000, 0xfc1: 0x4000, 0xfc2: 0x4000, 0xfc3: 0x4000, 0xfc4: 0x4000, 0xfc5: 0x4000, - 0xfc6: 0x4000, 0xfc7: 0x4000, 0xfc8: 0x4000, 0xfc9: 0x4000, 0xfca: 0x4000, 0xfcb: 0x4000, - 0xfcc: 0x4000, 0xfcd: 0x4000, 0xfce: 0x4000, 0xfcf: 0x4000, 0xfd0: 0x4000, 0xfd1: 0x4000, - 0xfd2: 0x4000, 0xfd3: 0x4000, 0xfd4: 0x4000, 0xfd5: 0x4000, 0xfd6: 0x4000, 0xfd7: 0x4000, - 0xfd8: 0x4000, 0xfd9: 0x4000, 0xfda: 0x4000, 0xfdb: 0x4000, 0xfdc: 0x4000, 0xfdd: 0x4000, - 0xfde: 0x4000, 0xfdf: 0x4000, 0xfe0: 0x4000, 0xfe1: 0x4000, 0xfe2: 0x4000, 0xfe3: 0x4000, - // Block 0x40, offset 0x1000 - 0x1000: 0x2000, 0x1001: 0x2000, 0x1002: 0x2000, 0x1003: 0x2000, 0x1004: 0x2000, 0x1005: 0x2000, - 0x1006: 0x2000, 0x1007: 0x2000, 0x1008: 0x2000, 0x1009: 0x2000, 0x100a: 0x2000, 0x100b: 0x2000, - 0x100c: 0x2000, 0x100d: 0x2000, 0x100e: 0x2000, 0x100f: 0x2000, 0x1010: 0x4000, 0x1011: 0x4000, - 0x1012: 0x4000, 0x1013: 0x4000, 0x1014: 0x4000, 0x1015: 0x4000, 0x1016: 0x4000, 0x1017: 0x4000, - 0x1018: 0x4000, 0x1019: 0x4000, - 0x1030: 0x4000, 0x1031: 0x4000, 0x1032: 0x4000, 0x1033: 0x4000, 0x1034: 0x4000, 0x1035: 0x4000, - 0x1036: 0x4000, 0x1037: 0x4000, 0x1038: 0x4000, 0x1039: 0x4000, 0x103a: 0x4000, 0x103b: 0x4000, - 0x103c: 0x4000, 0x103d: 0x4000, 0x103e: 0x4000, 0x103f: 0x4000, - // Block 0x41, offset 0x1040 - 0x1040: 0x4000, 0x1041: 0x4000, 0x1042: 0x4000, 0x1043: 0x4000, 0x1044: 0x4000, 0x1045: 0x4000, - 0x1046: 0x4000, 0x1047: 0x4000, 0x1048: 0x4000, 0x1049: 0x4000, 0x104a: 0x4000, 0x104b: 0x4000, - 0x104c: 0x4000, 0x104d: 0x4000, 0x104e: 0x4000, 0x104f: 0x4000, 0x1050: 0x4000, 0x1051: 0x4000, - 0x1052: 0x4000, 0x1054: 0x4000, 0x1055: 0x4000, 0x1056: 0x4000, 0x1057: 0x4000, - 0x1058: 0x4000, 0x1059: 0x4000, 0x105a: 0x4000, 0x105b: 0x4000, 0x105c: 0x4000, 0x105d: 0x4000, - 0x105e: 0x4000, 0x105f: 0x4000, 0x1060: 0x4000, 0x1061: 0x4000, 0x1062: 0x4000, 0x1063: 0x4000, - 0x1064: 0x4000, 0x1065: 0x4000, 0x1066: 0x4000, 0x1068: 0x4000, 0x1069: 0x4000, - 0x106a: 0x4000, 0x106b: 0x4000, - // Block 0x42, offset 0x1080 - 0x1081: 0x9012, 0x1082: 0x9012, 0x1083: 0x9012, 0x1084: 0x9012, 0x1085: 0x9012, - 0x1086: 0x9012, 0x1087: 0x9012, 0x1088: 0x9012, 0x1089: 0x9012, 0x108a: 0x9012, 0x108b: 0x9012, - 0x108c: 0x9012, 0x108d: 0x9012, 0x108e: 0x9012, 0x108f: 0x9012, 0x1090: 0x9012, 0x1091: 0x9012, - 0x1092: 0x9012, 0x1093: 0x9012, 0x1094: 0x9012, 0x1095: 0x9012, 0x1096: 0x9012, 0x1097: 0x9012, - 0x1098: 0x9012, 0x1099: 0x9012, 0x109a: 0x9012, 0x109b: 0x9012, 0x109c: 0x9012, 0x109d: 0x9012, - 0x109e: 0x9012, 0x109f: 0x9012, 0x10a0: 0x9049, 0x10a1: 0x9049, 0x10a2: 0x9049, 0x10a3: 0x9049, - 0x10a4: 0x9049, 0x10a5: 0x9049, 0x10a6: 0x9049, 0x10a7: 0x9049, 0x10a8: 0x9049, 0x10a9: 0x9049, - 0x10aa: 0x9049, 0x10ab: 0x9049, 0x10ac: 0x9049, 0x10ad: 0x9049, 0x10ae: 0x9049, 0x10af: 0x9049, - 0x10b0: 0x9049, 0x10b1: 0x9049, 0x10b2: 0x9049, 0x10b3: 0x9049, 0x10b4: 0x9049, 0x10b5: 0x9049, - 0x10b6: 0x9049, 0x10b7: 0x9049, 0x10b8: 0x9049, 0x10b9: 0x9049, 0x10ba: 0x9049, 0x10bb: 0x9049, - 0x10bc: 0x9049, 0x10bd: 0x9049, 0x10be: 0x9049, 0x10bf: 0x9049, - // Block 0x43, offset 0x10c0 - 0x10c0: 0x9049, 0x10c1: 0x9049, 0x10c2: 0x9049, 0x10c3: 0x9049, 0x10c4: 0x9049, 0x10c5: 0x9049, - 0x10c6: 0x9049, 0x10c7: 0x9049, 0x10c8: 0x9049, 0x10c9: 0x9049, 0x10ca: 0x9049, 0x10cb: 0x9049, - 0x10cc: 0x9049, 0x10cd: 0x9049, 0x10ce: 0x9049, 0x10cf: 0x9049, 0x10d0: 0x9049, 0x10d1: 0x9049, - 0x10d2: 0x9049, 0x10d3: 0x9049, 0x10d4: 0x9049, 0x10d5: 0x9049, 0x10d6: 0x9049, 0x10d7: 0x9049, - 0x10d8: 0x9049, 0x10d9: 0x9049, 0x10da: 0x9049, 0x10db: 0x9049, 0x10dc: 0x9049, 0x10dd: 0x9049, - 0x10de: 0x9049, 0x10df: 0x904a, 0x10e0: 0x904b, 0x10e1: 0xb04c, 0x10e2: 0xb04d, 0x10e3: 0xb04d, - 0x10e4: 0xb04e, 0x10e5: 0xb04f, 0x10e6: 0xb050, 0x10e7: 0xb051, 0x10e8: 0xb052, 0x10e9: 0xb053, - 0x10ea: 0xb054, 0x10eb: 0xb055, 0x10ec: 0xb056, 0x10ed: 0xb057, 0x10ee: 0xb058, 0x10ef: 0xb059, - 0x10f0: 0xb05a, 0x10f1: 0xb05b, 0x10f2: 0xb05c, 0x10f3: 0xb05d, 0x10f4: 0xb05e, 0x10f5: 0xb05f, - 0x10f6: 0xb060, 0x10f7: 0xb061, 0x10f8: 0xb062, 0x10f9: 0xb063, 0x10fa: 0xb064, 0x10fb: 0xb065, - 0x10fc: 0xb052, 0x10fd: 0xb066, 0x10fe: 0xb067, 0x10ff: 0xb055, - // Block 0x44, offset 0x1100 - 0x1100: 0xb068, 0x1101: 0xb069, 0x1102: 0xb06a, 0x1103: 0xb06b, 0x1104: 0xb05a, 0x1105: 0xb056, - 0x1106: 0xb06c, 0x1107: 0xb06d, 0x1108: 0xb06b, 0x1109: 0xb06e, 0x110a: 0xb06b, 0x110b: 0xb06f, - 0x110c: 0xb06f, 0x110d: 0xb070, 0x110e: 0xb070, 0x110f: 0xb071, 0x1110: 0xb056, 0x1111: 0xb072, - 0x1112: 0xb073, 0x1113: 0xb072, 0x1114: 0xb074, 0x1115: 0xb073, 0x1116: 0xb075, 0x1117: 0xb075, - 0x1118: 0xb076, 0x1119: 0xb076, 0x111a: 0xb077, 0x111b: 0xb077, 0x111c: 0xb073, 0x111d: 0xb078, - 0x111e: 0xb079, 0x111f: 0xb067, 0x1120: 0xb07a, 0x1121: 0xb07b, 0x1122: 0xb07b, 0x1123: 0xb07b, - 0x1124: 0xb07b, 0x1125: 0xb07b, 0x1126: 0xb07b, 0x1127: 0xb07b, 0x1128: 0xb07b, 0x1129: 0xb07b, - 0x112a: 0xb07b, 0x112b: 0xb07b, 0x112c: 0xb07b, 0x112d: 0xb07b, 0x112e: 0xb07b, 0x112f: 0xb07b, - 0x1130: 0xb07c, 0x1131: 0xb07c, 0x1132: 0xb07c, 0x1133: 0xb07c, 0x1134: 0xb07c, 0x1135: 0xb07c, - 0x1136: 0xb07c, 0x1137: 0xb07c, 0x1138: 0xb07c, 0x1139: 0xb07c, 0x113a: 0xb07c, 0x113b: 0xb07c, - 0x113c: 0xb07c, 0x113d: 0xb07c, 0x113e: 0xb07c, - // Block 0x45, offset 0x1140 - 0x1142: 0xb07d, 0x1143: 0xb07e, 0x1144: 0xb07f, 0x1145: 0xb080, - 0x1146: 0xb07f, 0x1147: 0xb07e, 0x114a: 0xb081, 0x114b: 0xb082, - 0x114c: 0xb083, 0x114d: 0xb07f, 0x114e: 0xb080, 0x114f: 0xb07f, - 0x1152: 0xb084, 0x1153: 0xb085, 0x1154: 0xb084, 0x1155: 0xb086, 0x1156: 0xb084, 0x1157: 0xb087, - 0x115a: 0xb088, 0x115b: 0xb089, 0x115c: 0xb08a, - 0x1160: 0x908b, 0x1161: 0x908b, 0x1162: 0x908c, 0x1163: 0x908d, - 0x1164: 0x908b, 0x1165: 0x908e, 0x1166: 0x908f, 0x1168: 0xb090, 0x1169: 0xb091, - 0x116a: 0xb092, 0x116b: 0xb091, 0x116c: 0xb093, 0x116d: 0xb094, 0x116e: 0xb095, - 0x117d: 0x2000, - // Block 0x46, offset 0x1180 - 0x11a0: 0x4000, 0x11a1: 0x4000, 0x11a2: 0x4000, 0x11a3: 0x4000, - 0x11a4: 0x4000, - 0x11b0: 0x4000, 0x11b1: 0x4000, - // Block 0x47, offset 0x11c0 - 0x11c0: 0x4000, 0x11c1: 0x4000, 0x11c2: 0x4000, 0x11c3: 0x4000, 0x11c4: 0x4000, 0x11c5: 0x4000, - 0x11c6: 0x4000, 0x11c7: 0x4000, 0x11c8: 0x4000, 0x11c9: 0x4000, 0x11ca: 0x4000, 0x11cb: 0x4000, - 0x11cc: 0x4000, 0x11cd: 0x4000, 0x11ce: 0x4000, 0x11cf: 0x4000, 0x11d0: 0x4000, 0x11d1: 0x4000, - 0x11d2: 0x4000, 0x11d3: 0x4000, 0x11d4: 0x4000, 0x11d5: 0x4000, 0x11d6: 0x4000, 0x11d7: 0x4000, - 0x11d8: 0x4000, 0x11d9: 0x4000, 0x11da: 0x4000, 0x11db: 0x4000, 0x11dc: 0x4000, 0x11dd: 0x4000, - 0x11de: 0x4000, 0x11df: 0x4000, 0x11e0: 0x4000, 0x11e1: 0x4000, 0x11e2: 0x4000, 0x11e3: 0x4000, - 0x11e4: 0x4000, 0x11e5: 0x4000, 0x11e6: 0x4000, 0x11e7: 0x4000, 0x11e8: 0x4000, 0x11e9: 0x4000, - 0x11ea: 0x4000, 0x11eb: 0x4000, 0x11ec: 0x4000, 0x11ed: 0x4000, 0x11ee: 0x4000, 0x11ef: 0x4000, - 0x11f0: 0x4000, 0x11f1: 0x4000, 0x11f2: 0x4000, 0x11f3: 0x4000, 0x11f4: 0x4000, 0x11f5: 0x4000, - 0x11f6: 0x4000, 0x11f7: 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, - // Block 0x49, offset 0x1240 - 0x1240: 0x4000, 0x1241: 0x4000, 0x1242: 0x4000, 0x1243: 0x4000, 0x1244: 0x4000, 0x1245: 0x4000, - 0x1246: 0x4000, 0x1247: 0x4000, 0x1248: 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 - 0x12d0: 0x4000, 0x12d1: 0x4000, - 0x12d2: 0x4000, - 0x12e4: 0x4000, 0x12e5: 0x4000, 0x12e6: 0x4000, 0x12e7: 0x4000, - 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, 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, 0x163e: 0x4000, - // Block 0x59, offset 0x1640 - 0x1640: 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, 0x167d: 0x4000, 0x167e: 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, 0x16bf: 0x4000, - // Block 0x5b, offset 0x16c0 - 0x16c0: 0x4000, 0x16c1: 0x4000, 0x16c2: 0x4000, 0x16c3: 0x4000, 0x16c4: 0x4000, 0x16c5: 0x4000, - 0x16c6: 0x4000, 0x16c7: 0x4000, 0x16c8: 0x4000, 0x16c9: 0x4000, 0x16ca: 0x4000, 0x16cb: 0x4000, - 0x16cc: 0x4000, 0x16cd: 0x4000, 0x16ce: 0x4000, 0x16cf: 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, 0x16e8: 0x4000, 0x16e9: 0x4000, - 0x16ea: 0x4000, 0x16eb: 0x4000, 0x16ec: 0x4000, 0x16ed: 0x4000, 0x16ee: 0x4000, 0x16ef: 0x4000, - 0x16f0: 0x4000, 0x16f1: 0x4000, 0x16f2: 0x4000, 0x16f3: 0x4000, 0x16f4: 0x4000, 0x16f5: 0x4000, - 0x16f6: 0x4000, 0x16f7: 0x4000, 0x16f8: 0x4000, 0x16f9: 0x4000, 0x16fa: 0x4000, 0x16fb: 0x4000, - 0x16fc: 0x4000, 0x16fd: 0x4000, - // Block 0x5c, offset 0x1700 - 0x170b: 0x4000, - 0x170c: 0x4000, 0x170d: 0x4000, 0x170e: 0x4000, 0x1710: 0x4000, 0x1711: 0x4000, - 0x1712: 0x4000, 0x1713: 0x4000, 0x1714: 0x4000, 0x1715: 0x4000, 0x1716: 0x4000, 0x1717: 0x4000, - 0x1718: 0x4000, 0x1719: 0x4000, 0x171a: 0x4000, 0x171b: 0x4000, 0x171c: 0x4000, 0x171d: 0x4000, - 0x171e: 0x4000, 0x171f: 0x4000, 0x1720: 0x4000, 0x1721: 0x4000, 0x1722: 0x4000, 0x1723: 0x4000, - 0x1724: 0x4000, 0x1725: 0x4000, 0x1726: 0x4000, 0x1727: 0x4000, - 0x173a: 0x4000, - // Block 0x5d, offset 0x1740 - 0x1755: 0x4000, 0x1756: 0x4000, - 0x1764: 0x4000, - // Block 0x5e, offset 0x1780 - 0x17bb: 0x4000, - 0x17bc: 0x4000, 0x17bd: 0x4000, 0x17be: 0x4000, 0x17bf: 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, - 0x17cc: 0x4000, 0x17cd: 0x4000, 0x17ce: 0x4000, 0x17cf: 0x4000, - // Block 0x60, offset 0x1800 - 0x1800: 0x4000, 0x1801: 0x4000, 0x1802: 0x4000, 0x1803: 0x4000, 0x1804: 0x4000, 0x1805: 0x4000, - 0x180c: 0x4000, 0x1810: 0x4000, 0x1811: 0x4000, - 0x1812: 0x4000, 0x1815: 0x4000, 0x1816: 0x4000, 0x1817: 0x4000, - 0x182b: 0x4000, 0x182c: 0x4000, - 0x1834: 0x4000, 0x1835: 0x4000, - 0x1836: 0x4000, 0x1837: 0x4000, 0x1838: 0x4000, 0x1839: 0x4000, 0x183a: 0x4000, 0x183b: 0x4000, - 0x183c: 0x4000, - // Block 0x61, offset 0x1840 - 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 - 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, 0x18a3: 0x4000, - 0x18a4: 0x4000, 0x18a5: 0x4000, 0x18a6: 0x4000, 0x18a7: 0x4000, 0x18a8: 0x4000, 0x18a9: 0x4000, - 0x18aa: 0x4000, 0x18ab: 0x4000, 0x18ac: 0x4000, 0x18ad: 0x4000, 0x18ae: 0x4000, 0x18af: 0x4000, - 0x18b0: 0x4000, 0x18b1: 0x4000, 0x18b2: 0x4000, 0x18b3: 0x4000, 0x18b4: 0x4000, 0x18b5: 0x4000, - 0x18b6: 0x4000, 0x18b7: 0x4000, 0x18b8: 0x4000, 0x18b9: 0x4000, 0x18ba: 0x4000, - 0x18bc: 0x4000, 0x18bd: 0x4000, 0x18be: 0x4000, 0x18bf: 0x4000, - // Block 0x63, offset 0x18c0 - 0x18c0: 0x4000, 0x18c1: 0x4000, 0x18c2: 0x4000, 0x18c3: 0x4000, 0x18c4: 0x4000, 0x18c5: 0x4000, - 0x18c7: 0x4000, 0x18c8: 0x4000, 0x18c9: 0x4000, 0x18ca: 0x4000, 0x18cb: 0x4000, - 0x18cc: 0x4000, 0x18cd: 0x4000, 0x18ce: 0x4000, 0x18cf: 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, 0x18fa: 0x4000, 0x18fb: 0x4000, - 0x18fc: 0x4000, 0x18fd: 0x4000, 0x18fe: 0x4000, 0x18ff: 0x4000, - // Block 0x64, offset 0x1900 - 0x1900: 0x4000, 0x1901: 0x4000, 0x1902: 0x4000, 0x1903: 0x4000, 0x1904: 0x4000, 0x1905: 0x4000, - 0x1906: 0x4000, 0x1907: 0x4000, 0x1908: 0x4000, 0x1909: 0x4000, 0x190a: 0x4000, 0x190b: 0x4000, - 0x190d: 0x4000, 0x190e: 0x4000, 0x190f: 0x4000, 0x1910: 0x4000, 0x1911: 0x4000, - 0x1912: 0x4000, 0x1913: 0x4000, 0x1914: 0x4000, 0x1915: 0x4000, 0x1916: 0x4000, 0x1917: 0x4000, - 0x1918: 0x4000, 0x1919: 0x4000, 0x191a: 0x4000, 0x191b: 0x4000, 0x191c: 0x4000, 0x191d: 0x4000, - 0x191e: 0x4000, 0x191f: 0x4000, 0x1920: 0x4000, 0x1921: 0x4000, 0x1922: 0x4000, 0x1923: 0x4000, - 0x1924: 0x4000, 0x1925: 0x4000, 0x1926: 0x4000, 0x1927: 0x4000, 0x1928: 0x4000, 0x1929: 0x4000, - 0x192a: 0x4000, 0x192b: 0x4000, 0x192c: 0x4000, 0x192d: 0x4000, 0x192e: 0x4000, 0x192f: 0x4000, - 0x1930: 0x4000, 0x1931: 0x4000, 0x1932: 0x4000, 0x1933: 0x4000, 0x1934: 0x4000, 0x1935: 0x4000, - 0x1936: 0x4000, 0x1937: 0x4000, 0x1938: 0x4000, 0x1939: 0x4000, 0x193a: 0x4000, 0x193b: 0x4000, - 0x193c: 0x4000, 0x193d: 0x4000, 0x193e: 0x4000, 0x193f: 0x4000, - // Block 0x65, offset 0x1940 - 0x1970: 0x4000, 0x1971: 0x4000, 0x1972: 0x4000, 0x1973: 0x4000, 0x1974: 0x4000, - 0x1978: 0x4000, 0x1979: 0x4000, 0x197a: 0x4000, - // Block 0x66, offset 0x1980 - 0x1980: 0x4000, 0x1981: 0x4000, 0x1982: 0x4000, 0x1983: 0x4000, 0x1984: 0x4000, 0x1985: 0x4000, - 0x1986: 0x4000, - 0x1990: 0x4000, 0x1991: 0x4000, - 0x1992: 0x4000, 0x1993: 0x4000, 0x1994: 0x4000, 0x1995: 0x4000, 0x1996: 0x4000, 0x1997: 0x4000, - 0x1998: 0x4000, 0x1999: 0x4000, 0x199a: 0x4000, 0x199b: 0x4000, 0x199c: 0x4000, 0x199d: 0x4000, - 0x199e: 0x4000, 0x199f: 0x4000, 0x19a0: 0x4000, 0x19a1: 0x4000, 0x19a2: 0x4000, 0x19a3: 0x4000, - 0x19a4: 0x4000, 0x19a5: 0x4000, 0x19a6: 0x4000, 0x19a7: 0x4000, 0x19a8: 0x4000, - 0x19b0: 0x4000, 0x19b1: 0x4000, 0x19b2: 0x4000, 0x19b3: 0x4000, 0x19b4: 0x4000, 0x19b5: 0x4000, - 0x19b6: 0x4000, - // Block 0x67, offset 0x19c0 - 0x19c0: 0x4000, 0x19c1: 0x4000, 0x19c2: 0x4000, - 0x19d0: 0x4000, 0x19d1: 0x4000, - 0x19d2: 0x4000, 0x19d3: 0x4000, 0x19d4: 0x4000, 0x19d5: 0x4000, 0x19d6: 0x4000, - // Block 0x68, offset 0x1a00 - 0x1a00: 0x2000, 0x1a01: 0x2000, 0x1a02: 0x2000, 0x1a03: 0x2000, 0x1a04: 0x2000, 0x1a05: 0x2000, - 0x1a06: 0x2000, 0x1a07: 0x2000, 0x1a08: 0x2000, 0x1a09: 0x2000, 0x1a0a: 0x2000, 0x1a0b: 0x2000, - 0x1a0c: 0x2000, 0x1a0d: 0x2000, 0x1a0e: 0x2000, 0x1a0f: 0x2000, 0x1a10: 0x2000, 0x1a11: 0x2000, - 0x1a12: 0x2000, 0x1a13: 0x2000, 0x1a14: 0x2000, 0x1a15: 0x2000, 0x1a16: 0x2000, 0x1a17: 0x2000, - 0x1a18: 0x2000, 0x1a19: 0x2000, 0x1a1a: 0x2000, 0x1a1b: 0x2000, 0x1a1c: 0x2000, 0x1a1d: 0x2000, - 0x1a1e: 0x2000, 0x1a1f: 0x2000, 0x1a20: 0x2000, 0x1a21: 0x2000, 0x1a22: 0x2000, 0x1a23: 0x2000, - 0x1a24: 0x2000, 0x1a25: 0x2000, 0x1a26: 0x2000, 0x1a27: 0x2000, 0x1a28: 0x2000, 0x1a29: 0x2000, - 0x1a2a: 0x2000, 0x1a2b: 0x2000, 0x1a2c: 0x2000, 0x1a2d: 0x2000, 0x1a2e: 0x2000, 0x1a2f: 0x2000, - 0x1a30: 0x2000, 0x1a31: 0x2000, 0x1a32: 0x2000, 0x1a33: 0x2000, 0x1a34: 0x2000, 0x1a35: 0x2000, - 0x1a36: 0x2000, 0x1a37: 0x2000, 0x1a38: 0x2000, 0x1a39: 0x2000, 0x1a3a: 0x2000, 0x1a3b: 0x2000, - 0x1a3c: 0x2000, 0x1a3d: 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: 0x0e, 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: 0x3a, 0x253: 0x3b, - 0x265: 0x3c, - 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: 0x3d, - // 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: 0x3e, 0x339: 0x3f, 0x33c: 0x40, 0x33d: 0x41, 0x33e: 0x42, 0x33f: 0x43, - // Block 0xd, offset 0x340 - 0x37f: 0x44, - // 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: 0x45, - 0x3a0: 0x0e, 0x3a1: 0x0e, 0x3a2: 0x0e, 0x3a3: 0x0e, 0x3a4: 0x0e, 0x3a5: 0x0e, 0x3a6: 0x0e, 0x3a7: 0x0e, - 0x3a8: 0x0e, 0x3a9: 0x0e, 0x3aa: 0x0e, 0x3ab: 0x0e, 0x3ac: 0x0e, 0x3ad: 0x0e, 0x3ae: 0x0e, 0x3af: 0x0e, - 0x3b0: 0x0e, 0x3b1: 0x0e, 0x3b2: 0x0e, 0x3b3: 0x46, 0x3b4: 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: 0x56, 0x411: 0x57, 0x412: 0x0e, 0x413: 0x58, 0x414: 0x59, 0x415: 0x5a, 0x416: 0x5b, 0x417: 0x5c, - 0x418: 0x0e, 0x419: 0x5d, 0x41a: 0x0e, 0x41b: 0x5e, 0x41f: 0x5f, - 0x424: 0x60, 0x425: 0x61, 0x426: 0x0e, 0x427: 0x62, - 0x429: 0x63, 0x42a: 0x64, 0x42b: 0x65, - // 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: 0x66, - // 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 15448 bytes (15KiB) diff --git a/vendor/golang.org/x/text/width/tables15.0.0.go b/vendor/golang.org/x/text/width/tables15.0.0.go deleted file mode 100644 index 2b85289675..0000000000 --- a/vendor/golang.org/x/text/width/tables15.0.0.go +++ /dev/null @@ -1,1367 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -//go:build go1.21 - -package width - -// UnicodeVersion is the Unicode version from which the tables in this package are derived. -const UnicodeVersion = "15.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: 14912 bytes (14.56 KiB). Checksum: 4468b6cd178303d2. -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: 105 blocks, 6720 entries, 13440 bytes -// The third block is the zero block. -var widthValues = [6720]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, 0xe3b: 0x4000, - 0xe3c: 0x4000, 0xe3d: 0x4000, 0xe3e: 0x4000, 0xe3f: 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, 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, 0xf3f: 0x4000, - // Block 0x3d, offset 0xf40 - 0xf40: 0x4000, 0xf41: 0x4000, 0xf42: 0x4000, 0xf43: 0x4000, 0xf44: 0x4000, 0xf45: 0x4000, - 0xf46: 0x4000, - // Block 0x3e, offset 0xf80 - 0xfa0: 0x4000, 0xfa1: 0x4000, 0xfa2: 0x4000, 0xfa3: 0x4000, - 0xfa4: 0x4000, 0xfa5: 0x4000, 0xfa6: 0x4000, 0xfa7: 0x4000, 0xfa8: 0x4000, 0xfa9: 0x4000, - 0xfaa: 0x4000, 0xfab: 0x4000, 0xfac: 0x4000, 0xfad: 0x4000, 0xfae: 0x4000, 0xfaf: 0x4000, - 0xfb0: 0x4000, 0xfb1: 0x4000, 0xfb2: 0x4000, 0xfb3: 0x4000, 0xfb4: 0x4000, 0xfb5: 0x4000, - 0xfb6: 0x4000, 0xfb7: 0x4000, 0xfb8: 0x4000, 0xfb9: 0x4000, 0xfba: 0x4000, 0xfbb: 0x4000, - 0xfbc: 0x4000, - // Block 0x3f, offset 0xfc0 - 0xfc0: 0x4000, 0xfc1: 0x4000, 0xfc2: 0x4000, 0xfc3: 0x4000, 0xfc4: 0x4000, 0xfc5: 0x4000, - 0xfc6: 0x4000, 0xfc7: 0x4000, 0xfc8: 0x4000, 0xfc9: 0x4000, 0xfca: 0x4000, 0xfcb: 0x4000, - 0xfcc: 0x4000, 0xfcd: 0x4000, 0xfce: 0x4000, 0xfcf: 0x4000, 0xfd0: 0x4000, 0xfd1: 0x4000, - 0xfd2: 0x4000, 0xfd3: 0x4000, 0xfd4: 0x4000, 0xfd5: 0x4000, 0xfd6: 0x4000, 0xfd7: 0x4000, - 0xfd8: 0x4000, 0xfd9: 0x4000, 0xfda: 0x4000, 0xfdb: 0x4000, 0xfdc: 0x4000, 0xfdd: 0x4000, - 0xfde: 0x4000, 0xfdf: 0x4000, 0xfe0: 0x4000, 0xfe1: 0x4000, 0xfe2: 0x4000, 0xfe3: 0x4000, - // Block 0x40, offset 0x1000 - 0x1000: 0x2000, 0x1001: 0x2000, 0x1002: 0x2000, 0x1003: 0x2000, 0x1004: 0x2000, 0x1005: 0x2000, - 0x1006: 0x2000, 0x1007: 0x2000, 0x1008: 0x2000, 0x1009: 0x2000, 0x100a: 0x2000, 0x100b: 0x2000, - 0x100c: 0x2000, 0x100d: 0x2000, 0x100e: 0x2000, 0x100f: 0x2000, 0x1010: 0x4000, 0x1011: 0x4000, - 0x1012: 0x4000, 0x1013: 0x4000, 0x1014: 0x4000, 0x1015: 0x4000, 0x1016: 0x4000, 0x1017: 0x4000, - 0x1018: 0x4000, 0x1019: 0x4000, - 0x1030: 0x4000, 0x1031: 0x4000, 0x1032: 0x4000, 0x1033: 0x4000, 0x1034: 0x4000, 0x1035: 0x4000, - 0x1036: 0x4000, 0x1037: 0x4000, 0x1038: 0x4000, 0x1039: 0x4000, 0x103a: 0x4000, 0x103b: 0x4000, - 0x103c: 0x4000, 0x103d: 0x4000, 0x103e: 0x4000, 0x103f: 0x4000, - // Block 0x41, offset 0x1040 - 0x1040: 0x4000, 0x1041: 0x4000, 0x1042: 0x4000, 0x1043: 0x4000, 0x1044: 0x4000, 0x1045: 0x4000, - 0x1046: 0x4000, 0x1047: 0x4000, 0x1048: 0x4000, 0x1049: 0x4000, 0x104a: 0x4000, 0x104b: 0x4000, - 0x104c: 0x4000, 0x104d: 0x4000, 0x104e: 0x4000, 0x104f: 0x4000, 0x1050: 0x4000, 0x1051: 0x4000, - 0x1052: 0x4000, 0x1054: 0x4000, 0x1055: 0x4000, 0x1056: 0x4000, 0x1057: 0x4000, - 0x1058: 0x4000, 0x1059: 0x4000, 0x105a: 0x4000, 0x105b: 0x4000, 0x105c: 0x4000, 0x105d: 0x4000, - 0x105e: 0x4000, 0x105f: 0x4000, 0x1060: 0x4000, 0x1061: 0x4000, 0x1062: 0x4000, 0x1063: 0x4000, - 0x1064: 0x4000, 0x1065: 0x4000, 0x1066: 0x4000, 0x1068: 0x4000, 0x1069: 0x4000, - 0x106a: 0x4000, 0x106b: 0x4000, - // Block 0x42, offset 0x1080 - 0x1081: 0x9012, 0x1082: 0x9012, 0x1083: 0x9012, 0x1084: 0x9012, 0x1085: 0x9012, - 0x1086: 0x9012, 0x1087: 0x9012, 0x1088: 0x9012, 0x1089: 0x9012, 0x108a: 0x9012, 0x108b: 0x9012, - 0x108c: 0x9012, 0x108d: 0x9012, 0x108e: 0x9012, 0x108f: 0x9012, 0x1090: 0x9012, 0x1091: 0x9012, - 0x1092: 0x9012, 0x1093: 0x9012, 0x1094: 0x9012, 0x1095: 0x9012, 0x1096: 0x9012, 0x1097: 0x9012, - 0x1098: 0x9012, 0x1099: 0x9012, 0x109a: 0x9012, 0x109b: 0x9012, 0x109c: 0x9012, 0x109d: 0x9012, - 0x109e: 0x9012, 0x109f: 0x9012, 0x10a0: 0x9049, 0x10a1: 0x9049, 0x10a2: 0x9049, 0x10a3: 0x9049, - 0x10a4: 0x9049, 0x10a5: 0x9049, 0x10a6: 0x9049, 0x10a7: 0x9049, 0x10a8: 0x9049, 0x10a9: 0x9049, - 0x10aa: 0x9049, 0x10ab: 0x9049, 0x10ac: 0x9049, 0x10ad: 0x9049, 0x10ae: 0x9049, 0x10af: 0x9049, - 0x10b0: 0x9049, 0x10b1: 0x9049, 0x10b2: 0x9049, 0x10b3: 0x9049, 0x10b4: 0x9049, 0x10b5: 0x9049, - 0x10b6: 0x9049, 0x10b7: 0x9049, 0x10b8: 0x9049, 0x10b9: 0x9049, 0x10ba: 0x9049, 0x10bb: 0x9049, - 0x10bc: 0x9049, 0x10bd: 0x9049, 0x10be: 0x9049, 0x10bf: 0x9049, - // Block 0x43, offset 0x10c0 - 0x10c0: 0x9049, 0x10c1: 0x9049, 0x10c2: 0x9049, 0x10c3: 0x9049, 0x10c4: 0x9049, 0x10c5: 0x9049, - 0x10c6: 0x9049, 0x10c7: 0x9049, 0x10c8: 0x9049, 0x10c9: 0x9049, 0x10ca: 0x9049, 0x10cb: 0x9049, - 0x10cc: 0x9049, 0x10cd: 0x9049, 0x10ce: 0x9049, 0x10cf: 0x9049, 0x10d0: 0x9049, 0x10d1: 0x9049, - 0x10d2: 0x9049, 0x10d3: 0x9049, 0x10d4: 0x9049, 0x10d5: 0x9049, 0x10d6: 0x9049, 0x10d7: 0x9049, - 0x10d8: 0x9049, 0x10d9: 0x9049, 0x10da: 0x9049, 0x10db: 0x9049, 0x10dc: 0x9049, 0x10dd: 0x9049, - 0x10de: 0x9049, 0x10df: 0x904a, 0x10e0: 0x904b, 0x10e1: 0xb04c, 0x10e2: 0xb04d, 0x10e3: 0xb04d, - 0x10e4: 0xb04e, 0x10e5: 0xb04f, 0x10e6: 0xb050, 0x10e7: 0xb051, 0x10e8: 0xb052, 0x10e9: 0xb053, - 0x10ea: 0xb054, 0x10eb: 0xb055, 0x10ec: 0xb056, 0x10ed: 0xb057, 0x10ee: 0xb058, 0x10ef: 0xb059, - 0x10f0: 0xb05a, 0x10f1: 0xb05b, 0x10f2: 0xb05c, 0x10f3: 0xb05d, 0x10f4: 0xb05e, 0x10f5: 0xb05f, - 0x10f6: 0xb060, 0x10f7: 0xb061, 0x10f8: 0xb062, 0x10f9: 0xb063, 0x10fa: 0xb064, 0x10fb: 0xb065, - 0x10fc: 0xb052, 0x10fd: 0xb066, 0x10fe: 0xb067, 0x10ff: 0xb055, - // Block 0x44, offset 0x1100 - 0x1100: 0xb068, 0x1101: 0xb069, 0x1102: 0xb06a, 0x1103: 0xb06b, 0x1104: 0xb05a, 0x1105: 0xb056, - 0x1106: 0xb06c, 0x1107: 0xb06d, 0x1108: 0xb06b, 0x1109: 0xb06e, 0x110a: 0xb06b, 0x110b: 0xb06f, - 0x110c: 0xb06f, 0x110d: 0xb070, 0x110e: 0xb070, 0x110f: 0xb071, 0x1110: 0xb056, 0x1111: 0xb072, - 0x1112: 0xb073, 0x1113: 0xb072, 0x1114: 0xb074, 0x1115: 0xb073, 0x1116: 0xb075, 0x1117: 0xb075, - 0x1118: 0xb076, 0x1119: 0xb076, 0x111a: 0xb077, 0x111b: 0xb077, 0x111c: 0xb073, 0x111d: 0xb078, - 0x111e: 0xb079, 0x111f: 0xb067, 0x1120: 0xb07a, 0x1121: 0xb07b, 0x1122: 0xb07b, 0x1123: 0xb07b, - 0x1124: 0xb07b, 0x1125: 0xb07b, 0x1126: 0xb07b, 0x1127: 0xb07b, 0x1128: 0xb07b, 0x1129: 0xb07b, - 0x112a: 0xb07b, 0x112b: 0xb07b, 0x112c: 0xb07b, 0x112d: 0xb07b, 0x112e: 0xb07b, 0x112f: 0xb07b, - 0x1130: 0xb07c, 0x1131: 0xb07c, 0x1132: 0xb07c, 0x1133: 0xb07c, 0x1134: 0xb07c, 0x1135: 0xb07c, - 0x1136: 0xb07c, 0x1137: 0xb07c, 0x1138: 0xb07c, 0x1139: 0xb07c, 0x113a: 0xb07c, 0x113b: 0xb07c, - 0x113c: 0xb07c, 0x113d: 0xb07c, 0x113e: 0xb07c, - // Block 0x45, offset 0x1140 - 0x1142: 0xb07d, 0x1143: 0xb07e, 0x1144: 0xb07f, 0x1145: 0xb080, - 0x1146: 0xb07f, 0x1147: 0xb07e, 0x114a: 0xb081, 0x114b: 0xb082, - 0x114c: 0xb083, 0x114d: 0xb07f, 0x114e: 0xb080, 0x114f: 0xb07f, - 0x1152: 0xb084, 0x1153: 0xb085, 0x1154: 0xb084, 0x1155: 0xb086, 0x1156: 0xb084, 0x1157: 0xb087, - 0x115a: 0xb088, 0x115b: 0xb089, 0x115c: 0xb08a, - 0x1160: 0x908b, 0x1161: 0x908b, 0x1162: 0x908c, 0x1163: 0x908d, - 0x1164: 0x908b, 0x1165: 0x908e, 0x1166: 0x908f, 0x1168: 0xb090, 0x1169: 0xb091, - 0x116a: 0xb092, 0x116b: 0xb091, 0x116c: 0xb093, 0x116d: 0xb094, 0x116e: 0xb095, - 0x117d: 0x2000, - // Block 0x46, offset 0x1180 - 0x11a0: 0x4000, 0x11a1: 0x4000, 0x11a2: 0x4000, 0x11a3: 0x4000, - 0x11a4: 0x4000, - 0x11b0: 0x4000, 0x11b1: 0x4000, - // Block 0x47, offset 0x11c0 - 0x11c0: 0x4000, 0x11c1: 0x4000, 0x11c2: 0x4000, 0x11c3: 0x4000, 0x11c4: 0x4000, 0x11c5: 0x4000, - 0x11c6: 0x4000, 0x11c7: 0x4000, 0x11c8: 0x4000, 0x11c9: 0x4000, 0x11ca: 0x4000, 0x11cb: 0x4000, - 0x11cc: 0x4000, 0x11cd: 0x4000, 0x11ce: 0x4000, 0x11cf: 0x4000, 0x11d0: 0x4000, 0x11d1: 0x4000, - 0x11d2: 0x4000, 0x11d3: 0x4000, 0x11d4: 0x4000, 0x11d5: 0x4000, 0x11d6: 0x4000, 0x11d7: 0x4000, - 0x11d8: 0x4000, 0x11d9: 0x4000, 0x11da: 0x4000, 0x11db: 0x4000, 0x11dc: 0x4000, 0x11dd: 0x4000, - 0x11de: 0x4000, 0x11df: 0x4000, 0x11e0: 0x4000, 0x11e1: 0x4000, 0x11e2: 0x4000, 0x11e3: 0x4000, - 0x11e4: 0x4000, 0x11e5: 0x4000, 0x11e6: 0x4000, 0x11e7: 0x4000, 0x11e8: 0x4000, 0x11e9: 0x4000, - 0x11ea: 0x4000, 0x11eb: 0x4000, 0x11ec: 0x4000, 0x11ed: 0x4000, 0x11ee: 0x4000, 0x11ef: 0x4000, - 0x11f0: 0x4000, 0x11f1: 0x4000, 0x11f2: 0x4000, 0x11f3: 0x4000, 0x11f4: 0x4000, 0x11f5: 0x4000, - 0x11f6: 0x4000, 0x11f7: 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, - // Block 0x49, offset 0x1240 - 0x1240: 0x4000, 0x1241: 0x4000, 0x1242: 0x4000, 0x1243: 0x4000, 0x1244: 0x4000, 0x1245: 0x4000, - 0x1246: 0x4000, 0x1247: 0x4000, 0x1248: 0x4000, - // Block 0x4a, offset 0x1280 - 0x12b0: 0x4000, 0x12b1: 0x4000, 0x12b2: 0x4000, 0x12b3: 0x4000, 0x12b5: 0x4000, - 0x12b6: 0x4000, 0x12b7: 0x4000, 0x12b8: 0x4000, 0x12b9: 0x4000, 0x12ba: 0x4000, 0x12bb: 0x4000, - 0x12bd: 0x4000, 0x12be: 0x4000, - // Block 0x4b, offset 0x12c0 - 0x12c0: 0x4000, 0x12c1: 0x4000, 0x12c2: 0x4000, 0x12c3: 0x4000, 0x12c4: 0x4000, 0x12c5: 0x4000, - 0x12c6: 0x4000, 0x12c7: 0x4000, 0x12c8: 0x4000, 0x12c9: 0x4000, 0x12ca: 0x4000, 0x12cb: 0x4000, - 0x12cc: 0x4000, 0x12cd: 0x4000, 0x12ce: 0x4000, 0x12cf: 0x4000, 0x12d0: 0x4000, 0x12d1: 0x4000, - 0x12d2: 0x4000, 0x12d3: 0x4000, 0x12d4: 0x4000, 0x12d5: 0x4000, 0x12d6: 0x4000, 0x12d7: 0x4000, - 0x12d8: 0x4000, 0x12d9: 0x4000, 0x12da: 0x4000, 0x12db: 0x4000, 0x12dc: 0x4000, 0x12dd: 0x4000, - 0x12de: 0x4000, 0x12df: 0x4000, 0x12e0: 0x4000, 0x12e1: 0x4000, 0x12e2: 0x4000, - 0x12f2: 0x4000, - // Block 0x4c, offset 0x1300 - 0x1310: 0x4000, 0x1311: 0x4000, - 0x1312: 0x4000, 0x1315: 0x4000, - 0x1324: 0x4000, 0x1325: 0x4000, 0x1326: 0x4000, 0x1327: 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, - 0x133c: 0x4000, 0x133d: 0x4000, 0x133e: 0x4000, 0x133f: 0x4000, - // Block 0x4d, offset 0x1340 - 0x1340: 0x4000, 0x1341: 0x4000, 0x1342: 0x4000, 0x1343: 0x4000, 0x1344: 0x4000, 0x1345: 0x4000, - 0x1346: 0x4000, 0x1347: 0x4000, 0x1348: 0x4000, 0x1349: 0x4000, 0x134a: 0x4000, 0x134b: 0x4000, - 0x134c: 0x4000, 0x134d: 0x4000, 0x134e: 0x4000, 0x134f: 0x4000, 0x1350: 0x4000, 0x1351: 0x4000, - 0x1352: 0x4000, 0x1353: 0x4000, 0x1354: 0x4000, 0x1355: 0x4000, 0x1356: 0x4000, 0x1357: 0x4000, - 0x1358: 0x4000, 0x1359: 0x4000, 0x135a: 0x4000, 0x135b: 0x4000, 0x135c: 0x4000, 0x135d: 0x4000, - 0x135e: 0x4000, 0x135f: 0x4000, 0x1360: 0x4000, 0x1361: 0x4000, 0x1362: 0x4000, 0x1363: 0x4000, - 0x1364: 0x4000, 0x1365: 0x4000, 0x1366: 0x4000, 0x1367: 0x4000, 0x1368: 0x4000, 0x1369: 0x4000, - 0x136a: 0x4000, 0x136b: 0x4000, 0x136c: 0x4000, 0x136d: 0x4000, 0x136e: 0x4000, 0x136f: 0x4000, - 0x1370: 0x4000, 0x1371: 0x4000, 0x1372: 0x4000, 0x1373: 0x4000, 0x1374: 0x4000, 0x1375: 0x4000, - 0x1376: 0x4000, 0x1377: 0x4000, 0x1378: 0x4000, 0x1379: 0x4000, 0x137a: 0x4000, 0x137b: 0x4000, - // Block 0x4e, offset 0x1380 - 0x1384: 0x4000, - // Block 0x4f, offset 0x13c0 - 0x13cf: 0x4000, - // 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, - 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, - 0x142a: 0x2000, 0x142b: 0x2000, 0x142c: 0x2000, 0x142d: 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: 0x2000, 0x144f: 0x2000, 0x1450: 0x2000, 0x1451: 0x2000, - 0x1452: 0x2000, 0x1453: 0x2000, 0x1454: 0x2000, 0x1455: 0x2000, 0x1456: 0x2000, 0x1457: 0x2000, - 0x1458: 0x2000, 0x1459: 0x2000, 0x145a: 0x2000, 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, - 0x1470: 0x2000, 0x1471: 0x2000, 0x1472: 0x2000, 0x1473: 0x2000, 0x1474: 0x2000, 0x1475: 0x2000, - 0x1476: 0x2000, 0x1477: 0x2000, 0x1478: 0x2000, 0x1479: 0x2000, 0x147a: 0x2000, 0x147b: 0x2000, - 0x147c: 0x2000, 0x147d: 0x2000, 0x147e: 0x2000, 0x147f: 0x2000, - // Block 0x52, offset 0x1480 - 0x1480: 0x2000, 0x1481: 0x2000, 0x1482: 0x2000, 0x1483: 0x2000, 0x1484: 0x2000, 0x1485: 0x2000, - 0x1486: 0x2000, 0x1487: 0x2000, 0x1488: 0x2000, 0x1489: 0x2000, 0x148a: 0x2000, 0x148b: 0x2000, - 0x148c: 0x2000, 0x148d: 0x2000, 0x148e: 0x4000, 0x148f: 0x2000, 0x1490: 0x2000, 0x1491: 0x4000, - 0x1492: 0x4000, 0x1493: 0x4000, 0x1494: 0x4000, 0x1495: 0x4000, 0x1496: 0x4000, 0x1497: 0x4000, - 0x1498: 0x4000, 0x1499: 0x4000, 0x149a: 0x4000, 0x149b: 0x2000, 0x149c: 0x2000, 0x149d: 0x2000, - 0x149e: 0x2000, 0x149f: 0x2000, 0x14a0: 0x2000, 0x14a1: 0x2000, 0x14a2: 0x2000, 0x14a3: 0x2000, - 0x14a4: 0x2000, 0x14a5: 0x2000, 0x14a6: 0x2000, 0x14a7: 0x2000, 0x14a8: 0x2000, 0x14a9: 0x2000, - 0x14aa: 0x2000, 0x14ab: 0x2000, 0x14ac: 0x2000, - // Block 0x53, offset 0x14c0 - 0x14c0: 0x4000, 0x14c1: 0x4000, 0x14c2: 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, - // Block 0x54, offset 0x1500 - 0x1500: 0x4000, 0x1501: 0x4000, 0x1502: 0x4000, 0x1503: 0x4000, 0x1504: 0x4000, 0x1505: 0x4000, - 0x1506: 0x4000, 0x1507: 0x4000, 0x1508: 0x4000, - 0x1510: 0x4000, 0x1511: 0x4000, - 0x1520: 0x4000, 0x1521: 0x4000, 0x1522: 0x4000, 0x1523: 0x4000, - 0x1524: 0x4000, 0x1525: 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, - 0x156d: 0x4000, 0x156e: 0x4000, 0x156f: 0x4000, - 0x1570: 0x4000, 0x1571: 0x4000, 0x1572: 0x4000, 0x1573: 0x4000, 0x1574: 0x4000, 0x1575: 0x4000, - 0x1577: 0x4000, 0x1578: 0x4000, 0x1579: 0x4000, 0x157a: 0x4000, 0x157b: 0x4000, - 0x157c: 0x4000, 0x157d: 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, 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, 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, - 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, 0x15fd: 0x4000, 0x15fe: 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, - 0x160f: 0x4000, 0x1610: 0x4000, 0x1611: 0x4000, - 0x1612: 0x4000, 0x1613: 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, 0x1634: 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, 0x167d: 0x4000, 0x167e: 0x4000, - // Block 0x5a, offset 0x1680 - 0x1680: 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, 0x16be: 0x4000, 0x16bf: 0x4000, - // Block 0x5b, offset 0x16c0 - 0x16c0: 0x4000, 0x16c1: 0x4000, 0x16c2: 0x4000, 0x16c3: 0x4000, 0x16c4: 0x4000, 0x16c5: 0x4000, - 0x16c6: 0x4000, 0x16c7: 0x4000, 0x16c8: 0x4000, 0x16c9: 0x4000, 0x16ca: 0x4000, 0x16cb: 0x4000, - 0x16cc: 0x4000, 0x16cd: 0x4000, 0x16ce: 0x4000, 0x16cf: 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, 0x16e8: 0x4000, 0x16e9: 0x4000, - 0x16ea: 0x4000, 0x16eb: 0x4000, 0x16ec: 0x4000, 0x16ed: 0x4000, 0x16ee: 0x4000, 0x16ef: 0x4000, - 0x16f0: 0x4000, 0x16f1: 0x4000, 0x16f2: 0x4000, 0x16f3: 0x4000, 0x16f4: 0x4000, 0x16f5: 0x4000, - 0x16f6: 0x4000, 0x16f7: 0x4000, 0x16f8: 0x4000, 0x16f9: 0x4000, 0x16fa: 0x4000, 0x16fb: 0x4000, - 0x16fc: 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, 0x1710: 0x4000, 0x1711: 0x4000, - 0x1712: 0x4000, 0x1713: 0x4000, 0x1714: 0x4000, 0x1715: 0x4000, 0x1716: 0x4000, 0x1717: 0x4000, - 0x1718: 0x4000, 0x1719: 0x4000, 0x171a: 0x4000, 0x171b: 0x4000, 0x171c: 0x4000, 0x171d: 0x4000, - 0x171e: 0x4000, 0x171f: 0x4000, 0x1720: 0x4000, 0x1721: 0x4000, 0x1722: 0x4000, 0x1723: 0x4000, - 0x1724: 0x4000, 0x1725: 0x4000, 0x1726: 0x4000, 0x1727: 0x4000, 0x1728: 0x4000, 0x1729: 0x4000, - 0x172a: 0x4000, 0x172b: 0x4000, 0x172c: 0x4000, 0x172d: 0x4000, 0x172e: 0x4000, 0x172f: 0x4000, - 0x1730: 0x4000, 0x1731: 0x4000, 0x1732: 0x4000, 0x1733: 0x4000, 0x1734: 0x4000, 0x1735: 0x4000, - 0x1736: 0x4000, 0x1737: 0x4000, 0x1738: 0x4000, 0x1739: 0x4000, 0x173a: 0x4000, 0x173b: 0x4000, - 0x173c: 0x4000, 0x173d: 0x4000, - // Block 0x5d, offset 0x1740 - 0x174b: 0x4000, - 0x174c: 0x4000, 0x174d: 0x4000, 0x174e: 0x4000, 0x1750: 0x4000, 0x1751: 0x4000, - 0x1752: 0x4000, 0x1753: 0x4000, 0x1754: 0x4000, 0x1755: 0x4000, 0x1756: 0x4000, 0x1757: 0x4000, - 0x1758: 0x4000, 0x1759: 0x4000, 0x175a: 0x4000, 0x175b: 0x4000, 0x175c: 0x4000, 0x175d: 0x4000, - 0x175e: 0x4000, 0x175f: 0x4000, 0x1760: 0x4000, 0x1761: 0x4000, 0x1762: 0x4000, 0x1763: 0x4000, - 0x1764: 0x4000, 0x1765: 0x4000, 0x1766: 0x4000, 0x1767: 0x4000, - 0x177a: 0x4000, - // Block 0x5e, offset 0x1780 - 0x1795: 0x4000, 0x1796: 0x4000, - 0x17a4: 0x4000, - // Block 0x5f, offset 0x17c0 - 0x17fb: 0x4000, - 0x17fc: 0x4000, 0x17fd: 0x4000, 0x17fe: 0x4000, 0x17ff: 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, - // Block 0x61, offset 0x1840 - 0x1840: 0x4000, 0x1841: 0x4000, 0x1842: 0x4000, 0x1843: 0x4000, 0x1844: 0x4000, 0x1845: 0x4000, - 0x184c: 0x4000, 0x1850: 0x4000, 0x1851: 0x4000, - 0x1852: 0x4000, 0x1855: 0x4000, 0x1856: 0x4000, 0x1857: 0x4000, - 0x185c: 0x4000, 0x185d: 0x4000, - 0x185e: 0x4000, 0x185f: 0x4000, - 0x186b: 0x4000, 0x186c: 0x4000, - 0x1874: 0x4000, 0x1875: 0x4000, - 0x1876: 0x4000, 0x1877: 0x4000, 0x1878: 0x4000, 0x1879: 0x4000, 0x187a: 0x4000, 0x187b: 0x4000, - 0x187c: 0x4000, - // Block 0x62, offset 0x1880 - 0x18a0: 0x4000, 0x18a1: 0x4000, 0x18a2: 0x4000, 0x18a3: 0x4000, - 0x18a4: 0x4000, 0x18a5: 0x4000, 0x18a6: 0x4000, 0x18a7: 0x4000, 0x18a8: 0x4000, 0x18a9: 0x4000, - 0x18aa: 0x4000, 0x18ab: 0x4000, - 0x18b0: 0x4000, - // Block 0x63, offset 0x18c0 - 0x18cc: 0x4000, 0x18cd: 0x4000, 0x18ce: 0x4000, 0x18cf: 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, - 0x18fc: 0x4000, 0x18fd: 0x4000, 0x18fe: 0x4000, 0x18ff: 0x4000, - // Block 0x64, offset 0x1900 - 0x1900: 0x4000, 0x1901: 0x4000, 0x1902: 0x4000, 0x1903: 0x4000, 0x1904: 0x4000, 0x1905: 0x4000, - 0x1907: 0x4000, 0x1908: 0x4000, 0x1909: 0x4000, 0x190a: 0x4000, 0x190b: 0x4000, - 0x190c: 0x4000, 0x190d: 0x4000, 0x190e: 0x4000, 0x190f: 0x4000, 0x1910: 0x4000, 0x1911: 0x4000, - 0x1912: 0x4000, 0x1913: 0x4000, 0x1914: 0x4000, 0x1915: 0x4000, 0x1916: 0x4000, 0x1917: 0x4000, - 0x1918: 0x4000, 0x1919: 0x4000, 0x191a: 0x4000, 0x191b: 0x4000, 0x191c: 0x4000, 0x191d: 0x4000, - 0x191e: 0x4000, 0x191f: 0x4000, 0x1920: 0x4000, 0x1921: 0x4000, 0x1922: 0x4000, 0x1923: 0x4000, - 0x1924: 0x4000, 0x1925: 0x4000, 0x1926: 0x4000, 0x1927: 0x4000, 0x1928: 0x4000, 0x1929: 0x4000, - 0x192a: 0x4000, 0x192b: 0x4000, 0x192c: 0x4000, 0x192d: 0x4000, 0x192e: 0x4000, 0x192f: 0x4000, - 0x1930: 0x4000, 0x1931: 0x4000, 0x1932: 0x4000, 0x1933: 0x4000, 0x1934: 0x4000, 0x1935: 0x4000, - 0x1936: 0x4000, 0x1937: 0x4000, 0x1938: 0x4000, 0x1939: 0x4000, 0x193a: 0x4000, 0x193b: 0x4000, - 0x193c: 0x4000, 0x193d: 0x4000, 0x193e: 0x4000, 0x193f: 0x4000, - // Block 0x65, offset 0x1940 - 0x1970: 0x4000, 0x1971: 0x4000, 0x1972: 0x4000, 0x1973: 0x4000, 0x1974: 0x4000, 0x1975: 0x4000, - 0x1976: 0x4000, 0x1977: 0x4000, 0x1978: 0x4000, 0x1979: 0x4000, 0x197a: 0x4000, 0x197b: 0x4000, - 0x197c: 0x4000, - // Block 0x66, offset 0x1980 - 0x1980: 0x4000, 0x1981: 0x4000, 0x1982: 0x4000, 0x1983: 0x4000, 0x1984: 0x4000, 0x1985: 0x4000, - 0x1986: 0x4000, 0x1987: 0x4000, 0x1988: 0x4000, - 0x1990: 0x4000, 0x1991: 0x4000, - 0x1992: 0x4000, 0x1993: 0x4000, 0x1994: 0x4000, 0x1995: 0x4000, 0x1996: 0x4000, 0x1997: 0x4000, - 0x1998: 0x4000, 0x1999: 0x4000, 0x199a: 0x4000, 0x199b: 0x4000, 0x199c: 0x4000, 0x199d: 0x4000, - 0x199e: 0x4000, 0x199f: 0x4000, 0x19a0: 0x4000, 0x19a1: 0x4000, 0x19a2: 0x4000, 0x19a3: 0x4000, - 0x19a4: 0x4000, 0x19a5: 0x4000, 0x19a6: 0x4000, 0x19a7: 0x4000, 0x19a8: 0x4000, 0x19a9: 0x4000, - 0x19aa: 0x4000, 0x19ab: 0x4000, 0x19ac: 0x4000, 0x19ad: 0x4000, 0x19ae: 0x4000, 0x19af: 0x4000, - 0x19b0: 0x4000, 0x19b1: 0x4000, 0x19b2: 0x4000, 0x19b3: 0x4000, 0x19b4: 0x4000, 0x19b5: 0x4000, - 0x19b6: 0x4000, 0x19b7: 0x4000, 0x19b8: 0x4000, 0x19b9: 0x4000, 0x19ba: 0x4000, 0x19bb: 0x4000, - 0x19bc: 0x4000, 0x19bd: 0x4000, 0x19bf: 0x4000, - // Block 0x67, offset 0x19c0 - 0x19c0: 0x4000, 0x19c1: 0x4000, 0x19c2: 0x4000, 0x19c3: 0x4000, 0x19c4: 0x4000, 0x19c5: 0x4000, - 0x19ce: 0x4000, 0x19cf: 0x4000, 0x19d0: 0x4000, 0x19d1: 0x4000, - 0x19d2: 0x4000, 0x19d3: 0x4000, 0x19d4: 0x4000, 0x19d5: 0x4000, 0x19d6: 0x4000, 0x19d7: 0x4000, - 0x19d8: 0x4000, 0x19d9: 0x4000, 0x19da: 0x4000, 0x19db: 0x4000, - 0x19e0: 0x4000, 0x19e1: 0x4000, 0x19e2: 0x4000, 0x19e3: 0x4000, - 0x19e4: 0x4000, 0x19e5: 0x4000, 0x19e6: 0x4000, 0x19e7: 0x4000, 0x19e8: 0x4000, - 0x19f0: 0x4000, 0x19f1: 0x4000, 0x19f2: 0x4000, 0x19f3: 0x4000, 0x19f4: 0x4000, 0x19f5: 0x4000, - 0x19f6: 0x4000, 0x19f7: 0x4000, 0x19f8: 0x4000, - // Block 0x68, offset 0x1a00 - 0x1a00: 0x2000, 0x1a01: 0x2000, 0x1a02: 0x2000, 0x1a03: 0x2000, 0x1a04: 0x2000, 0x1a05: 0x2000, - 0x1a06: 0x2000, 0x1a07: 0x2000, 0x1a08: 0x2000, 0x1a09: 0x2000, 0x1a0a: 0x2000, 0x1a0b: 0x2000, - 0x1a0c: 0x2000, 0x1a0d: 0x2000, 0x1a0e: 0x2000, 0x1a0f: 0x2000, 0x1a10: 0x2000, 0x1a11: 0x2000, - 0x1a12: 0x2000, 0x1a13: 0x2000, 0x1a14: 0x2000, 0x1a15: 0x2000, 0x1a16: 0x2000, 0x1a17: 0x2000, - 0x1a18: 0x2000, 0x1a19: 0x2000, 0x1a1a: 0x2000, 0x1a1b: 0x2000, 0x1a1c: 0x2000, 0x1a1d: 0x2000, - 0x1a1e: 0x2000, 0x1a1f: 0x2000, 0x1a20: 0x2000, 0x1a21: 0x2000, 0x1a22: 0x2000, 0x1a23: 0x2000, - 0x1a24: 0x2000, 0x1a25: 0x2000, 0x1a26: 0x2000, 0x1a27: 0x2000, 0x1a28: 0x2000, 0x1a29: 0x2000, - 0x1a2a: 0x2000, 0x1a2b: 0x2000, 0x1a2c: 0x2000, 0x1a2d: 0x2000, 0x1a2e: 0x2000, 0x1a2f: 0x2000, - 0x1a30: 0x2000, 0x1a31: 0x2000, 0x1a32: 0x2000, 0x1a33: 0x2000, 0x1a34: 0x2000, 0x1a35: 0x2000, - 0x1a36: 0x2000, 0x1a37: 0x2000, 0x1a38: 0x2000, 0x1a39: 0x2000, 0x1a3a: 0x2000, 0x1a3b: 0x2000, - 0x1a3c: 0x2000, 0x1a3d: 0x2000, -} - -// widthIndex: 23 blocks, 1472 entries, 1472 bytes -// Block 0 is the zero block. -var widthIndex = [1472]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: 0x10, 0xf3: 0x13, 0xf4: 0x14, - // 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: 0x0e, 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: 0x3a, 0x253: 0x3b, - 0x265: 0x3c, - 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: 0x3d, - // 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: 0x3e, 0x339: 0x3f, 0x33c: 0x40, 0x33d: 0x41, 0x33e: 0x42, 0x33f: 0x43, - // Block 0xd, offset 0x340 - 0x37f: 0x44, - // 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: 0x45, - 0x3a0: 0x0e, 0x3a1: 0x0e, 0x3a2: 0x0e, 0x3a3: 0x0e, 0x3a4: 0x0e, 0x3a5: 0x0e, 0x3a6: 0x0e, 0x3a7: 0x0e, - 0x3a8: 0x0e, 0x3a9: 0x0e, 0x3aa: 0x0e, 0x3ab: 0x0e, 0x3ac: 0x0e, 0x3ad: 0x0e, 0x3ae: 0x0e, 0x3af: 0x0e, - 0x3b0: 0x0e, 0x3b1: 0x0e, 0x3b2: 0x0e, 0x3b3: 0x46, 0x3b4: 0x47, - // Block 0xf, offset 0x3c0 - 0x3ff: 0x48, - // Block 0x10, offset 0x400 - 0x400: 0x0e, 0x401: 0x0e, 0x402: 0x0e, 0x403: 0x0e, 0x404: 0x49, 0x405: 0x4a, 0x406: 0x0e, 0x407: 0x0e, - 0x408: 0x0e, 0x409: 0x0e, 0x40a: 0x0e, 0x40b: 0x4b, - // Block 0x11, offset 0x440 - 0x440: 0x4c, 0x443: 0x4d, 0x444: 0x4e, 0x445: 0x4f, 0x446: 0x50, - 0x448: 0x51, 0x449: 0x52, 0x44c: 0x53, 0x44d: 0x54, 0x44e: 0x55, 0x44f: 0x56, - 0x450: 0x57, 0x451: 0x58, 0x452: 0x0e, 0x453: 0x59, 0x454: 0x5a, 0x455: 0x5b, 0x456: 0x5c, 0x457: 0x5d, - 0x458: 0x0e, 0x459: 0x5e, 0x45a: 0x0e, 0x45b: 0x5f, 0x45f: 0x60, - 0x464: 0x61, 0x465: 0x62, 0x466: 0x0e, 0x467: 0x0e, - 0x469: 0x63, 0x46a: 0x64, 0x46b: 0x65, - // Block 0x12, offset 0x480 - 0x496: 0x0b, 0x497: 0x06, - 0x498: 0x0c, 0x49a: 0x0d, 0x49b: 0x0e, 0x49f: 0x0f, - 0x4a0: 0x06, 0x4a1: 0x06, 0x4a2: 0x06, 0x4a3: 0x06, 0x4a4: 0x06, 0x4a5: 0x06, 0x4a6: 0x06, 0x4a7: 0x06, - 0x4a8: 0x06, 0x4a9: 0x06, 0x4aa: 0x06, 0x4ab: 0x06, 0x4ac: 0x06, 0x4ad: 0x06, 0x4ae: 0x06, 0x4af: 0x06, - 0x4b0: 0x06, 0x4b1: 0x06, 0x4b2: 0x06, 0x4b3: 0x06, 0x4b4: 0x06, 0x4b5: 0x06, 0x4b6: 0x06, 0x4b7: 0x06, - 0x4b8: 0x06, 0x4b9: 0x06, 0x4ba: 0x06, 0x4bb: 0x06, 0x4bc: 0x06, 0x4bd: 0x06, 0x4be: 0x06, 0x4bf: 0x06, - // Block 0x13, offset 0x4c0 - 0x4c4: 0x08, 0x4c5: 0x08, 0x4c6: 0x08, 0x4c7: 0x09, - // Block 0x14, offset 0x500 - 0x500: 0x08, 0x501: 0x08, 0x502: 0x08, 0x503: 0x08, 0x504: 0x08, 0x505: 0x08, 0x506: 0x08, 0x507: 0x08, - 0x508: 0x08, 0x509: 0x08, 0x50a: 0x08, 0x50b: 0x08, 0x50c: 0x08, 0x50d: 0x08, 0x50e: 0x08, 0x50f: 0x08, - 0x510: 0x08, 0x511: 0x08, 0x512: 0x08, 0x513: 0x08, 0x514: 0x08, 0x515: 0x08, 0x516: 0x08, 0x517: 0x08, - 0x518: 0x08, 0x519: 0x08, 0x51a: 0x08, 0x51b: 0x08, 0x51c: 0x08, 0x51d: 0x08, 0x51e: 0x08, 0x51f: 0x08, - 0x520: 0x08, 0x521: 0x08, 0x522: 0x08, 0x523: 0x08, 0x524: 0x08, 0x525: 0x08, 0x526: 0x08, 0x527: 0x08, - 0x528: 0x08, 0x529: 0x08, 0x52a: 0x08, 0x52b: 0x08, 0x52c: 0x08, 0x52d: 0x08, 0x52e: 0x08, 0x52f: 0x08, - 0x530: 0x08, 0x531: 0x08, 0x532: 0x08, 0x533: 0x08, 0x534: 0x08, 0x535: 0x08, 0x536: 0x08, 0x537: 0x08, - 0x538: 0x08, 0x539: 0x08, 0x53a: 0x08, 0x53b: 0x08, 0x53c: 0x08, 0x53d: 0x08, 0x53e: 0x08, 0x53f: 0x66, - // Block 0x15, offset 0x540 - 0x560: 0x11, - 0x570: 0x09, 0x571: 0x09, 0x572: 0x09, 0x573: 0x09, 0x574: 0x09, 0x575: 0x09, 0x576: 0x09, 0x577: 0x09, - 0x578: 0x09, 0x579: 0x09, 0x57a: 0x09, 0x57b: 0x09, 0x57c: 0x09, 0x57d: 0x09, 0x57e: 0x09, 0x57f: 0x12, - // Block 0x16, offset 0x580 - 0x580: 0x09, 0x581: 0x09, 0x582: 0x09, 0x583: 0x09, 0x584: 0x09, 0x585: 0x09, 0x586: 0x09, 0x587: 0x09, - 0x588: 0x09, 0x589: 0x09, 0x58a: 0x09, 0x58b: 0x09, 0x58c: 0x09, 0x58d: 0x09, 0x58e: 0x09, 0x58f: 0x12, -} - -// 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 15512 bytes (15KiB) 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 d981330a9f..0000000000 --- a/vendor/golang.org/x/text/width/tables9.0.0.go +++ /dev/null @@ -1,1296 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -//go: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 0049f700a2..0000000000 --- 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 ca8e45fd19..0000000000 --- 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 29c7509be7..0000000000 --- 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/tools/LICENSE b/vendor/golang.org/x/tools/LICENSE index 6a66aea5ea..2a7cf70da6 100644 --- a/vendor/golang.org/x/tools/LICENSE +++ b/vendor/golang.org/x/tools/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. 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 + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go b/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go index 9fa5aa192c..6e34df4613 100644 --- a/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go +++ b/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go @@ -11,8 +11,6 @@ import ( "go/ast" "go/token" "sort" - - "golang.org/x/tools/internal/typeparams" ) // PathEnclosingInterval returns the node that encloses the source @@ -108,8 +106,21 @@ func PathEnclosingInterval(root *ast.File, start, end token.Pos) (path []ast.Nod // Does augmented child strictly contain [start, end)? if augPos <= start && end <= augEnd { - _, isToken := child.(tokenNode) - return isToken || visit(child) + if is[tokenNode](child) { + return true + } + + // childrenOf elides the FuncType node beneath FuncDecl. + // Add it back here for TypeParams, Params, Results, + // all FieldLists). But we don't add it back for the "func" token + // even though it is is the tree at FuncDecl.Type.Func. + if decl, ok := node.(*ast.FuncDecl); ok { + if fields, ok := child.(*ast.FieldList); ok && fields != decl.Recv { + path = append(path, decl.Type) + } + } + + return visit(child) } // Does [start, end) overlap multiple children? @@ -315,6 +326,8 @@ func childrenOf(n ast.Node) []ast.Node { // // As a workaround, we inline the case for FuncType // here and order things correctly. + // We also need to insert the elided FuncType just + // before the 'visit' recursion. // children = nil // discard ast.Walk(FuncDecl) info subtrees children = append(children, tok(n.Type.Func, len("func"))) @@ -322,7 +335,7 @@ func childrenOf(n ast.Node) []ast.Node { children = append(children, n.Recv) } children = append(children, n.Name) - if tparams := typeparams.ForFuncType(n.Type); tparams != nil { + if tparams := n.Type.TypeParams; tparams != nil { children = append(children, tparams) } if n.Type.Params != nil { @@ -377,7 +390,7 @@ func childrenOf(n ast.Node) []ast.Node { tok(n.Lbrack, len("[")), tok(n.Rbrack, len("]"))) - case *typeparams.IndexListExpr: + case *ast.IndexListExpr: children = append(children, tok(n.Lbrack, len("[")), tok(n.Rbrack, len("]"))) @@ -588,7 +601,7 @@ func NodeDescription(n ast.Node) string { return "decrement statement" case *ast.IndexExpr: return "index expression" - case *typeparams.IndexListExpr: + case *ast.IndexListExpr: return "index list expression" case *ast.InterfaceType: return "interface type" @@ -634,3 +647,8 @@ func NodeDescription(n ast.Node) string { } panic(fmt.Sprintf("unexpected node type: %T", n)) } + +func is[T any](x any) bool { + _, ok := x.(T) + return ok +} diff --git a/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go b/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go index f430b21b9b..58934f7663 100644 --- a/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go +++ b/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go @@ -9,8 +9,6 @@ import ( "go/ast" "reflect" "sort" - - "golang.org/x/tools/internal/typeparams" ) // An ApplyFunc is invoked by Apply for each node n, even if n is nil, @@ -252,7 +250,7 @@ func (a *application) apply(parent ast.Node, name string, iter *iterator, n ast. a.apply(n, "X", nil, n.X) a.apply(n, "Index", nil, n.Index) - case *typeparams.IndexListExpr: + case *ast.IndexListExpr: a.apply(n, "X", nil, n.X) a.applyList(n, "Indices") @@ -293,7 +291,7 @@ func (a *application) apply(parent ast.Node, name string, iter *iterator, n ast. a.apply(n, "Fields", nil, n.Fields) case *ast.FuncType: - if tparams := typeparams.ForFuncType(n); tparams != nil { + if tparams := n.TypeParams; tparams != nil { a.apply(n, "TypeParams", nil, tparams) } a.apply(n, "Params", nil, n.Params) @@ -408,7 +406,7 @@ func (a *application) apply(parent ast.Node, name string, iter *iterator, n ast. case *ast.TypeSpec: a.apply(n, "Doc", nil, n.Doc) a.apply(n, "Name", nil, n.Name) - if tparams := typeparams.ForTypeSpec(n); tparams != nil { + if tparams := n.TypeParams; tparams != nil { a.apply(n, "TypeParams", nil, tparams) } a.apply(n, "Type", nil, n.Type) diff --git a/vendor/golang.org/x/tools/go/ast/astutil/util.go b/vendor/golang.org/x/tools/go/ast/astutil/util.go index 919d5305ab..6bdcf70ac2 100644 --- a/vendor/golang.org/x/tools/go/ast/astutil/util.go +++ b/vendor/golang.org/x/tools/go/ast/astutil/util.go @@ -7,6 +7,7 @@ package astutil import "go/ast" // Unparen returns e with any enclosing parentheses stripped. +// TODO(adonovan): use go1.22's ast.Unparen. func Unparen(e ast.Expr) ast.Expr { for { p, ok := e.(*ast.ParenExpr) diff --git a/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go b/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go index 03543bd4bb..137cc8df1d 100644 --- a/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go +++ b/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go @@ -47,7 +47,7 @@ import ( func Find(importPath, srcDir string) (filename, path string) { cmd := exec.Command("go", "list", "-json", "-export", "--", importPath) cmd.Dir = srcDir - out, err := cmd.CombinedOutput() + out, err := cmd.Output() if err != nil { return "", "" } diff --git a/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go b/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go new file mode 100644 index 0000000000..9ada177758 --- /dev/null +++ b/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go @@ -0,0 +1,788 @@ +// 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 objectpath defines a naming scheme for types.Objects +// (that is, named entities in Go programs) relative to their enclosing +// package. +// +// Type-checker objects are canonical, so they are usually identified by +// their address in memory (a pointer), but a pointer has meaning only +// within one address space. By contrast, objectpath names allow the +// identity of an object to be sent from one program to another, +// establishing a correspondence between types.Object variables that are +// distinct but logically equivalent. +// +// A single object may have multiple paths. In this example, +// +// type A struct{ X int } +// type B A +// +// the field X has two paths due to its membership of both A and B. +// The For(obj) function always returns one of these paths, arbitrarily +// but consistently. +package objectpath + +import ( + "fmt" + "go/types" + "strconv" + "strings" + + "golang.org/x/tools/internal/aliases" + "golang.org/x/tools/internal/typesinternal" +) + +// TODO(adonovan): think about generic aliases. + +// A Path is an opaque name that identifies a types.Object +// relative to its package. Conceptually, the name consists of a +// sequence of destructuring operations applied to the package scope +// to obtain the original object. +// The name does not include the package itself. +type Path string + +// Encoding +// +// An object path is a textual and (with training) human-readable encoding +// of a sequence of destructuring operators, starting from a types.Package. +// The sequences represent a path through the package/object/type graph. +// We classify these operators by their type: +// +// PO package->object Package.Scope.Lookup +// OT object->type Object.Type +// TT type->type Type.{Elem,Key,{,{,Recv}Type}Params,Results,Underlying,Rhs} [EKPRUTrCa] +// TO type->object Type.{At,Field,Method,Obj} [AFMO] +// +// All valid paths start with a package and end at an object +// and thus may be defined by the regular language: +// +// objectpath = PO (OT TT* TO)* +// +// The concrete encoding follows directly: +// - The only PO operator is Package.Scope.Lookup, which requires an identifier. +// - The only OT operator is Object.Type, +// which we encode as '.' because dot cannot appear in an identifier. +// - The TT operators are encoded as [EKPRUTrCa]; +// two of these ({,Recv}TypeParams) require an integer operand, +// which is encoded as a string of decimal digits. +// - The TO operators are encoded as [AFMO]; +// three of these (At,Field,Method) require an integer operand, +// which is encoded as a string of decimal digits. +// These indices are stable across different representations +// of the same package, even source and export data. +// The indices used are implementation specific and may not correspond to +// the argument to the go/types function. +// +// In the example below, +// +// package p +// +// type T interface { +// f() (a string, b struct{ X int }) +// } +// +// field X has the path "T.UM0.RA1.F0", +// representing the following sequence of operations: +// +// p.Lookup("T") T +// .Type().Underlying().Method(0). f +// .Type().Results().At(1) b +// .Type().Field(0) X +// +// The encoding is not maximally compact---every R or P is +// followed by an A, for example---but this simplifies the +// encoder and decoder. +const ( + // object->type operators + opType = '.' // .Type() (Object) + + // type->type operators + opElem = 'E' // .Elem() (Pointer, Slice, Array, Chan, Map) + opKey = 'K' // .Key() (Map) + opParams = 'P' // .Params() (Signature) + opResults = 'R' // .Results() (Signature) + opUnderlying = 'U' // .Underlying() (Named) + opTypeParam = 'T' // .TypeParams.At(i) (Named, Signature) + opRecvTypeParam = 'r' // .RecvTypeParams.At(i) (Signature) + opConstraint = 'C' // .Constraint() (TypeParam) + opRhs = 'a' // .Rhs() (Alias) + + // type->object operators + opAt = 'A' // .At(i) (Tuple) + opField = 'F' // .Field(i) (Struct) + opMethod = 'M' // .Method(i) (Named or Interface; not Struct: "promoted" names are ignored) + opObj = 'O' // .Obj() (Named, TypeParam) +) + +// For is equivalent to new(Encoder).For(obj). +// +// It may be more efficient to reuse a single Encoder across several calls. +func For(obj types.Object) (Path, error) { + return new(Encoder).For(obj) +} + +// An Encoder amortizes the cost of encoding the paths of multiple objects. +// The zero value of an Encoder is ready to use. +type Encoder struct { + scopeMemo map[*types.Scope][]types.Object // memoization of scopeObjects +} + +// For returns the path to an object relative to its package, +// or an error if the object is not accessible from the package's Scope. +// +// The For function guarantees to return a path only for the following objects: +// - package-level types +// - exported package-level non-types +// - methods +// - parameter and result variables +// - struct fields +// These objects are sufficient to define the API of their package. +// The objects described by a package's export data are drawn from this set. +// +// The set of objects accessible from a package's Scope depends on +// whether the package was produced by type-checking syntax, or +// reading export data; the latter may have a smaller Scope since +// export data trims objects that are not reachable from an exported +// declaration. For example, the For function will return a path for +// an exported method of an unexported type that is not reachable +// from any public declaration; this path will cause the Object +// function to fail if called on a package loaded from export data. +// TODO(adonovan): is this a bug or feature? Should this package +// compute accessibility in the same way? +// +// For does not return a path for predeclared names, imported package +// names, local names, and unexported package-level names (except +// types). +// +// Example: given this definition, +// +// package p +// +// type T interface { +// f() (a string, b struct{ X int }) +// } +// +// For(X) would return a path that denotes the following sequence of operations: +// +// p.Scope().Lookup("T") (TypeName T) +// .Type().Underlying().Method(0). (method Func f) +// .Type().Results().At(1) (field Var b) +// .Type().Field(0) (field Var X) +// +// where p is the package (*types.Package) to which X belongs. +func (enc *Encoder) For(obj types.Object) (Path, error) { + pkg := obj.Pkg() + + // This table lists the cases of interest. + // + // Object Action + // ------ ------ + // nil reject + // builtin reject + // pkgname reject + // label reject + // var + // package-level accept + // func param/result accept + // local reject + // struct field accept + // const + // package-level accept + // local reject + // func + // package-level accept + // init functions reject + // concrete method accept + // interface method accept + // type + // package-level accept + // local reject + // + // The only accessible package-level objects are members of pkg itself. + // + // The cases are handled in four steps: + // + // 1. reject nil and builtin + // 2. accept package-level objects + // 3. reject obviously invalid objects + // 4. search the API for the path to the param/result/field/method. + + // 1. reference to nil or builtin? + if pkg == nil { + return "", fmt.Errorf("predeclared %s has no path", obj) + } + scope := pkg.Scope() + + // 2. package-level object? + if scope.Lookup(obj.Name()) == obj { + // Only exported objects (and non-exported types) have a path. + // Non-exported types may be referenced by other objects. + if _, ok := obj.(*types.TypeName); !ok && !obj.Exported() { + return "", fmt.Errorf("no path for non-exported %v", obj) + } + return Path(obj.Name()), nil + } + + // 3. Not a package-level object. + // Reject obviously non-viable cases. + switch obj := obj.(type) { + case *types.TypeName: + if _, ok := aliases.Unalias(obj.Type()).(*types.TypeParam); !ok { + // With the exception of type parameters, only package-level type names + // have a path. + return "", fmt.Errorf("no path for %v", obj) + } + case *types.Const, // Only package-level constants have a path. + *types.Label, // Labels are function-local. + *types.PkgName: // PkgNames are file-local. + return "", fmt.Errorf("no path for %v", obj) + + case *types.Var: + // Could be: + // - a field (obj.IsField()) + // - a func parameter or result + // - a local var. + // Sadly there is no way to distinguish + // a param/result from a local + // so we must proceed to the find. + + case *types.Func: + // A func, if not package-level, must be a method. + if recv := obj.Type().(*types.Signature).Recv(); recv == nil { + return "", fmt.Errorf("func is not a method: %v", obj) + } + + if path, ok := enc.concreteMethod(obj); ok { + // Fast path for concrete methods that avoids looping over scope. + return path, nil + } + + default: + panic(obj) + } + + // 4. Search the API for the path to the var (field/param/result) or method. + + // First inspect package-level named types. + // In the presence of path aliases, these give + // the best paths because non-types may + // refer to types, but not the reverse. + empty := make([]byte, 0, 48) // initial space + objs := enc.scopeObjects(scope) + for _, o := range objs { + tname, ok := o.(*types.TypeName) + if !ok { + continue // handle non-types in second pass + } + + path := append(empty, o.Name()...) + path = append(path, opType) + + T := o.Type() + if alias, ok := T.(*aliases.Alias); ok { + if r := findTypeParam(obj, aliases.TypeParams(alias), path, opTypeParam, nil); r != nil { + return Path(r), nil + } + if r := find(obj, aliases.Rhs(alias), append(path, opRhs), nil); r != nil { + return Path(r), nil + } + + } else if tname.IsAlias() { + // legacy alias + if r := find(obj, T, path, nil); r != nil { + return Path(r), nil + } + + } else if named, ok := T.(*types.Named); ok { + // defined (named) type + if r := findTypeParam(obj, named.TypeParams(), path, opTypeParam, nil); r != nil { + return Path(r), nil + } + if r := find(obj, named.Underlying(), append(path, opUnderlying), nil); r != nil { + return Path(r), nil + } + } + } + + // Then inspect everything else: + // non-types, and declared methods of defined types. + for _, o := range objs { + path := append(empty, o.Name()...) + if _, ok := o.(*types.TypeName); !ok { + if o.Exported() { + // exported non-type (const, var, func) + if r := find(obj, o.Type(), append(path, opType), nil); r != nil { + return Path(r), nil + } + } + continue + } + + // Inspect declared methods of defined types. + if T, ok := aliases.Unalias(o.Type()).(*types.Named); ok { + path = append(path, opType) + // The method index here is always with respect + // to the underlying go/types data structures, + // which ultimately derives from source order + // and must be preserved by export data. + for i := 0; i < T.NumMethods(); i++ { + m := T.Method(i) + path2 := appendOpArg(path, opMethod, i) + if m == obj { + return Path(path2), nil // found declared method + } + if r := find(obj, m.Type(), append(path2, opType), nil); r != nil { + return Path(r), nil + } + } + } + } + + return "", fmt.Errorf("can't find path for %v in %s", obj, pkg.Path()) +} + +func appendOpArg(path []byte, op byte, arg int) []byte { + path = append(path, op) + path = strconv.AppendInt(path, int64(arg), 10) + return path +} + +// concreteMethod returns the path for meth, which must have a non-nil receiver. +// The second return value indicates success and may be false if the method is +// an interface method or if it is an instantiated method. +// +// This function is just an optimization that avoids the general scope walking +// approach. You are expected to fall back to the general approach if this +// function fails. +func (enc *Encoder) concreteMethod(meth *types.Func) (Path, bool) { + // Concrete methods can only be declared on package-scoped named types. For + // that reason we can skip the expensive walk over the package scope: the + // path will always be package -> named type -> method. We can trivially get + // the type name from the receiver, and only have to look over the type's + // methods to find the method index. + // + // Methods on generic types require special consideration, however. Consider + // the following package: + // + // L1: type S[T any] struct{} + // L2: func (recv S[A]) Foo() { recv.Bar() } + // L3: func (recv S[B]) Bar() { } + // L4: type Alias = S[int] + // L5: func _[T any]() { var s S[int]; s.Foo() } + // + // The receivers of methods on generic types are instantiations. L2 and L3 + // instantiate S with the type-parameters A and B, which are scoped to the + // respective methods. L4 and L5 each instantiate S with int. Each of these + // instantiations has its own method set, full of methods (and thus objects) + // with receivers whose types are the respective instantiations. In other + // words, we have + // + // S[A].Foo, S[A].Bar + // S[B].Foo, S[B].Bar + // S[int].Foo, S[int].Bar + // + // We may thus be trying to produce object paths for any of these objects. + // + // S[A].Foo and S[B].Bar are the origin methods, and their paths are S.Foo + // and S.Bar, which are the paths that this function naturally produces. + // + // S[A].Bar, S[B].Foo, and both methods on S[int] are instantiations that + // don't correspond to the origin methods. For S[int], this is significant. + // The most precise object path for S[int].Foo, for example, is Alias.Foo, + // not S.Foo. Our function, however, would produce S.Foo, which would + // resolve to a different object. + // + // For S[A].Bar and S[B].Foo it could be argued that S.Bar and S.Foo are + // still the correct paths, since only the origin methods have meaningful + // paths. But this is likely only true for trivial cases and has edge cases. + // Since this function is only an optimization, we err on the side of giving + // up, deferring to the slower but definitely correct algorithm. Most users + // of objectpath will only be giving us origin methods, anyway, as referring + // to instantiated methods is usually not useful. + + if meth.Origin() != meth { + return "", false + } + + _, named := typesinternal.ReceiverNamed(meth.Type().(*types.Signature).Recv()) + if named == nil { + return "", false + } + + if types.IsInterface(named) { + // Named interfaces don't have to be package-scoped + // + // TODO(dominikh): opt: if scope.Lookup(name) == named, then we can apply this optimization to interface + // methods, too, I think. + return "", false + } + + // Preallocate space for the name, opType, opMethod, and some digits. + name := named.Obj().Name() + path := make([]byte, 0, len(name)+8) + path = append(path, name...) + path = append(path, opType) + + // Method indices are w.r.t. the go/types data structures, + // ultimately deriving from source order, + // which is preserved by export data. + for i := 0; i < named.NumMethods(); i++ { + if named.Method(i) == meth { + path = appendOpArg(path, opMethod, i) + return Path(path), true + } + } + + // Due to golang/go#59944, go/types fails to associate the receiver with + // certain methods on cgo types. + // + // TODO(rfindley): replace this panic once golang/go#59944 is fixed in all Go + // versions gopls supports. + return "", false + // panic(fmt.Sprintf("couldn't find method %s on type %s; methods: %#v", meth, named, enc.namedMethods(named))) +} + +// find finds obj within type T, returning the path to it, or nil if not found. +// +// The seen map is used to short circuit cycles through type parameters. If +// nil, it will be allocated as necessary. +func find(obj types.Object, T types.Type, path []byte, seen map[*types.TypeName]bool) []byte { + switch T := T.(type) { + case *aliases.Alias: + return find(obj, aliases.Unalias(T), path, seen) + case *types.Basic, *types.Named: + // Named types belonging to pkg were handled already, + // so T must belong to another package. No path. + return nil + case *types.Pointer: + return find(obj, T.Elem(), append(path, opElem), seen) + case *types.Slice: + return find(obj, T.Elem(), append(path, opElem), seen) + case *types.Array: + return find(obj, T.Elem(), append(path, opElem), seen) + case *types.Chan: + return find(obj, T.Elem(), append(path, opElem), seen) + case *types.Map: + if r := find(obj, T.Key(), append(path, opKey), seen); r != nil { + return r + } + return find(obj, T.Elem(), append(path, opElem), seen) + case *types.Signature: + if r := findTypeParam(obj, T.RecvTypeParams(), path, opRecvTypeParam, nil); r != nil { + return r + } + if r := findTypeParam(obj, T.TypeParams(), path, opTypeParam, seen); r != nil { + return r + } + if r := find(obj, T.Params(), append(path, opParams), seen); r != nil { + return r + } + return find(obj, T.Results(), append(path, opResults), seen) + case *types.Struct: + for i := 0; i < T.NumFields(); i++ { + fld := T.Field(i) + path2 := appendOpArg(path, opField, i) + if fld == obj { + return path2 // found field var + } + if r := find(obj, fld.Type(), append(path2, opType), seen); r != nil { + return r + } + } + return nil + case *types.Tuple: + for i := 0; i < T.Len(); i++ { + v := T.At(i) + path2 := appendOpArg(path, opAt, i) + if v == obj { + return path2 // found param/result var + } + if r := find(obj, v.Type(), append(path2, opType), seen); r != nil { + return r + } + } + return nil + case *types.Interface: + for i := 0; i < T.NumMethods(); i++ { + m := T.Method(i) + path2 := appendOpArg(path, opMethod, i) + if m == obj { + return path2 // found interface method + } + if r := find(obj, m.Type(), append(path2, opType), seen); r != nil { + return r + } + } + return nil + case *types.TypeParam: + name := T.Obj() + if name == obj { + return append(path, opObj) + } + if seen[name] { + return nil + } + if seen == nil { + seen = make(map[*types.TypeName]bool) + } + seen[name] = true + if r := find(obj, T.Constraint(), append(path, opConstraint), seen); r != nil { + return r + } + return nil + } + panic(T) +} + +func findTypeParam(obj types.Object, list *types.TypeParamList, path []byte, op byte, seen map[*types.TypeName]bool) []byte { + for i := 0; i < list.Len(); i++ { + tparam := list.At(i) + path2 := appendOpArg(path, op, i) + if r := find(obj, tparam, path2, seen); r != nil { + return r + } + } + return nil +} + +// Object returns the object denoted by path p within the package pkg. +func Object(pkg *types.Package, p Path) (types.Object, error) { + pathstr := string(p) + if pathstr == "" { + return nil, fmt.Errorf("empty path") + } + + var pkgobj, suffix string + if dot := strings.IndexByte(pathstr, opType); dot < 0 { + pkgobj = pathstr + } else { + pkgobj = pathstr[:dot] + suffix = pathstr[dot:] // suffix starts with "." + } + + obj := pkg.Scope().Lookup(pkgobj) + if obj == nil { + return nil, fmt.Errorf("package %s does not contain %q", pkg.Path(), pkgobj) + } + + // abstraction of *types.{Pointer,Slice,Array,Chan,Map} + type hasElem interface { + Elem() types.Type + } + // abstraction of *types.{Named,Signature} + type hasTypeParams interface { + TypeParams() *types.TypeParamList + } + // abstraction of *types.{Named,TypeParam} + type hasObj interface { + Obj() *types.TypeName + } + + // The loop state is the pair (t, obj), + // exactly one of which is non-nil, initially obj. + // All suffixes start with '.' (the only object->type operation), + // followed by optional type->type operations, + // then a type->object operation. + // The cycle then repeats. + var t types.Type + for suffix != "" { + code := suffix[0] + suffix = suffix[1:] + + // Codes [AFMTr] have an integer operand. + var index int + switch code { + case opAt, opField, opMethod, opTypeParam, opRecvTypeParam: + rest := strings.TrimLeft(suffix, "0123456789") + numerals := suffix[:len(suffix)-len(rest)] + suffix = rest + i, err := strconv.Atoi(numerals) + if err != nil { + return nil, fmt.Errorf("invalid path: bad numeric operand %q for code %q", numerals, code) + } + index = int(i) + case opObj: + // no operand + default: + // The suffix must end with a type->object operation. + if suffix == "" { + return nil, fmt.Errorf("invalid path: ends with %q, want [AFMO]", code) + } + } + + if code == opType { + if t != nil { + return nil, fmt.Errorf("invalid path: unexpected %q in type context", opType) + } + t = obj.Type() + obj = nil + continue + } + + if t == nil { + return nil, fmt.Errorf("invalid path: code %q in object context", code) + } + + // Inv: t != nil, obj == nil + + t = aliases.Unalias(t) + switch code { + case opElem: + hasElem, ok := t.(hasElem) // Pointer, Slice, Array, Chan, Map + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want pointer, slice, array, chan or map)", code, t, t) + } + t = hasElem.Elem() + + case opKey: + mapType, ok := t.(*types.Map) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want map)", code, t, t) + } + t = mapType.Key() + + case opParams: + sig, ok := t.(*types.Signature) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t) + } + t = sig.Params() + + case opResults: + sig, ok := t.(*types.Signature) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t) + } + t = sig.Results() + + case opUnderlying: + named, ok := t.(*types.Named) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named)", code, t, t) + } + t = named.Underlying() + + case opRhs: + if alias, ok := t.(*aliases.Alias); ok { + t = aliases.Rhs(alias) + } else if false && aliases.Enabled() { + // The Enabled check is too expensive, so for now we + // simply assume that aliases are not enabled. + // TODO(adonovan): replace with "if true {" when go1.24 is assured. + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want alias)", code, t, t) + } + + case opTypeParam: + hasTypeParams, ok := t.(hasTypeParams) // Named, Signature + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named or signature)", code, t, t) + } + tparams := hasTypeParams.TypeParams() + if n := tparams.Len(); index >= n { + return nil, fmt.Errorf("tuple index %d out of range [0-%d)", index, n) + } + t = tparams.At(index) + + case opRecvTypeParam: + sig, ok := t.(*types.Signature) // Signature + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t) + } + rtparams := sig.RecvTypeParams() + if n := rtparams.Len(); index >= n { + return nil, fmt.Errorf("tuple index %d out of range [0-%d)", index, n) + } + t = rtparams.At(index) + + case opConstraint: + tparam, ok := t.(*types.TypeParam) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want type parameter)", code, t, t) + } + t = tparam.Constraint() + + case opAt: + tuple, ok := t.(*types.Tuple) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want tuple)", code, t, t) + } + if n := tuple.Len(); index >= n { + return nil, fmt.Errorf("tuple index %d out of range [0-%d)", index, n) + } + obj = tuple.At(index) + t = nil + + case opField: + structType, ok := t.(*types.Struct) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want struct)", code, t, t) + } + if n := structType.NumFields(); index >= n { + return nil, fmt.Errorf("field index %d out of range [0-%d)", index, n) + } + obj = structType.Field(index) + t = nil + + case opMethod: + switch t := t.(type) { + case *types.Interface: + if index >= t.NumMethods() { + return nil, fmt.Errorf("method index %d out of range [0-%d)", index, t.NumMethods()) + } + obj = t.Method(index) // Id-ordered + + case *types.Named: + if index >= t.NumMethods() { + return nil, fmt.Errorf("method index %d out of range [0-%d)", index, t.NumMethods()) + } + obj = t.Method(index) + + default: + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want interface or named)", code, t, t) + } + t = nil + + case opObj: + hasObj, ok := t.(hasObj) + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named or type param)", code, t, t) + } + obj = hasObj.Obj() + t = nil + + default: + return nil, fmt.Errorf("invalid path: unknown code %q", code) + } + } + + if obj == nil { + panic(p) // path does not end in an object-valued operator + } + + if obj.Pkg() != pkg { + return nil, fmt.Errorf("path denotes %s, which belongs to a different package", obj) + } + + return obj, nil // success +} + +// scopeObjects is a memoization of scope objects. +// Callers must not modify the result. +func (enc *Encoder) scopeObjects(scope *types.Scope) []types.Object { + m := enc.scopeMemo + if m == nil { + m = make(map[*types.Scope][]types.Object) + enc.scopeMemo = m + } + objs, ok := m[scope] + if !ok { + names := scope.Names() // allocates and sorts + objs = make([]types.Object, len(names)) + for i, name := range names { + objs[i] = scope.Lookup(name) + } + m[scope] = objs + } + return objs +} diff --git a/vendor/golang.org/x/tools/imports/forward.go b/vendor/golang.org/x/tools/imports/forward.go index d2547c7433..cb6db8893f 100644 --- a/vendor/golang.org/x/tools/imports/forward.go +++ b/vendor/golang.org/x/tools/imports/forward.go @@ -7,8 +7,8 @@ package imports // import "golang.org/x/tools/imports" import ( - "io/ioutil" "log" + "os" "golang.org/x/tools/internal/gocommand" intimp "golang.org/x/tools/internal/imports" @@ -44,7 +44,7 @@ var LocalPrefix string func Process(filename string, src []byte, opt *Options) ([]byte, error) { var err error if src == nil { - src, err = ioutil.ReadFile(filename) + src, err = os.ReadFile(filename) if err != nil { return nil, err } diff --git a/vendor/golang.org/x/tools/internal/aliases/aliases.go b/vendor/golang.org/x/tools/internal/aliases/aliases.go new file mode 100644 index 0000000000..c24c2eee45 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/aliases/aliases.go @@ -0,0 +1,32 @@ +// Copyright 2024 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 aliases + +import ( + "go/token" + "go/types" +) + +// Package aliases defines backward compatible shims +// for the types.Alias type representation added in 1.22. +// This defines placeholders for x/tools until 1.26. + +// NewAlias creates a new TypeName in Package pkg that +// is an alias for the type rhs. +// +// The enabled parameter determines whether the resulting [TypeName]'s +// type is an [types.Alias]. Its value must be the result of a call to +// [Enabled], which computes the effective value of +// GODEBUG=gotypesalias=... by invoking the type checker. The Enabled +// function is expensive and should be called once per task (e.g. +// package import), not once per call to NewAlias. +func NewAlias(enabled bool, pos token.Pos, pkg *types.Package, name string, rhs types.Type) *types.TypeName { + if enabled { + tname := types.NewTypeName(pos, pkg, name, nil) + newAlias(tname, rhs) + return tname + } + return types.NewTypeName(pos, pkg, name, rhs) +} diff --git a/vendor/golang.org/x/tools/internal/aliases/aliases_go121.go b/vendor/golang.org/x/tools/internal/aliases/aliases_go121.go new file mode 100644 index 0000000000..6652f7db0f --- /dev/null +++ b/vendor/golang.org/x/tools/internal/aliases/aliases_go121.go @@ -0,0 +1,35 @@ +// Copyright 2024 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:build !go1.22 +// +build !go1.22 + +package aliases + +import ( + "go/types" +) + +// Alias is a placeholder for a go/types.Alias for <=1.21. +// It will never be created by go/types. +type Alias struct{} + +func (*Alias) String() string { panic("unreachable") } +func (*Alias) Underlying() types.Type { panic("unreachable") } +func (*Alias) Obj() *types.TypeName { panic("unreachable") } +func Rhs(alias *Alias) types.Type { panic("unreachable") } +func TypeParams(alias *Alias) *types.TypeParamList { panic("unreachable") } +func SetTypeParams(alias *Alias, tparams []*types.TypeParam) { panic("unreachable") } +func TypeArgs(alias *Alias) *types.TypeList { panic("unreachable") } +func Origin(alias *Alias) *Alias { panic("unreachable") } + +// Unalias returns the type t for go <=1.21. +func Unalias(t types.Type) types.Type { return t } + +func newAlias(name *types.TypeName, rhs types.Type) *Alias { panic("unreachable") } + +// Enabled reports whether [NewAlias] should create [types.Alias] types. +// +// Before go1.22, this function always returns false. +func Enabled() bool { return false } diff --git a/vendor/golang.org/x/tools/internal/aliases/aliases_go122.go b/vendor/golang.org/x/tools/internal/aliases/aliases_go122.go new file mode 100644 index 0000000000..3ef1afeb40 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/aliases/aliases_go122.go @@ -0,0 +1,99 @@ +// Copyright 2024 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:build go1.22 +// +build go1.22 + +package aliases + +import ( + "go/ast" + "go/parser" + "go/token" + "go/types" +) + +// Alias is an alias of types.Alias. +type Alias = types.Alias + +// Rhs returns the type on the right-hand side of the alias declaration. +func Rhs(alias *Alias) types.Type { + if alias, ok := any(alias).(interface{ Rhs() types.Type }); ok { + return alias.Rhs() // go1.23+ + } + + // go1.22's Alias didn't have the Rhs method, + // so Unalias is the best we can do. + return Unalias(alias) +} + +// TypeParams returns the type parameter list of the alias. +func TypeParams(alias *Alias) *types.TypeParamList { + if alias, ok := any(alias).(interface{ TypeParams() *types.TypeParamList }); ok { + return alias.TypeParams() // go1.23+ + } + return nil +} + +// SetTypeParams sets the type parameters of the alias type. +func SetTypeParams(alias *Alias, tparams []*types.TypeParam) { + if alias, ok := any(alias).(interface { + SetTypeParams(tparams []*types.TypeParam) + }); ok { + alias.SetTypeParams(tparams) // go1.23+ + } else if len(tparams) > 0 { + panic("cannot set type parameters of an Alias type in go1.22") + } +} + +// TypeArgs returns the type arguments used to instantiate the Alias type. +func TypeArgs(alias *Alias) *types.TypeList { + if alias, ok := any(alias).(interface{ TypeArgs() *types.TypeList }); ok { + return alias.TypeArgs() // go1.23+ + } + return nil // empty (go1.22) +} + +// Origin returns the generic Alias type of which alias is an instance. +// If alias is not an instance of a generic alias, Origin returns alias. +func Origin(alias *Alias) *Alias { + if alias, ok := any(alias).(interface{ Origin() *types.Alias }); ok { + return alias.Origin() // go1.23+ + } + return alias // not an instance of a generic alias (go1.22) +} + +// Unalias is a wrapper of types.Unalias. +func Unalias(t types.Type) types.Type { return types.Unalias(t) } + +// newAlias is an internal alias around types.NewAlias. +// Direct usage is discouraged as the moment. +// Try to use NewAlias instead. +func newAlias(tname *types.TypeName, rhs types.Type) *Alias { + a := types.NewAlias(tname, rhs) + // TODO(go.dev/issue/65455): Remove kludgy workaround to set a.actual as a side-effect. + Unalias(a) + return a +} + +// Enabled reports whether [NewAlias] should create [types.Alias] types. +// +// This function is expensive! Call it sparingly. +func Enabled() bool { + // The only reliable way to compute the answer is to invoke go/types. + // We don't parse the GODEBUG environment variable, because + // (a) it's tricky to do so in a manner that is consistent + // with the godebug package; in particular, a simple + // substring check is not good enough. The value is a + // rightmost-wins list of options. But more importantly: + // (b) it is impossible to detect changes to the effective + // setting caused by os.Setenv("GODEBUG"), as happens in + // many tests. Therefore any attempt to cache the result + // is just incorrect. + fset := token.NewFileSet() + f, _ := parser.ParseFile(fset, "a.go", "package p; type A = int", 0) + pkg, _ := new(types.Config).Check("p", fset, []*ast.File{f}, nil) + _, enabled := pkg.Scope().Lookup("A").Type().(*types.Alias) + return enabled +} diff --git a/vendor/golang.org/x/tools/internal/event/keys/util.go b/vendor/golang.org/x/tools/internal/event/keys/util.go new file mode 100644 index 0000000000..c0e8e731c9 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/event/keys/util.go @@ -0,0 +1,21 @@ +// Copyright 2023 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 keys + +import ( + "sort" + "strings" +) + +// Join returns a canonical join of the keys in S: +// a sorted comma-separated string list. +func Join[S ~[]T, T ~string](s S) string { + strs := make([]string, 0, len(s)) + for _, v := range s { + strs = append(strs, string(v)) + } + sort.Strings(strs) + return strings.Join(strs, ",") +} diff --git a/vendor/golang.org/x/tools/internal/event/tag/tag.go b/vendor/golang.org/x/tools/internal/event/tag/tag.go deleted file mode 100644 index ff2f2ecd38..0000000000 --- a/vendor/golang.org/x/tools/internal/event/tag/tag.go +++ /dev/null @@ -1,59 +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 tag provides the labels used for telemetry throughout gopls. -package tag - -import ( - "golang.org/x/tools/internal/event/keys" -) - -var ( - // create the label keys we use - Method = keys.NewString("method", "") - StatusCode = keys.NewString("status.code", "") - StatusMessage = keys.NewString("status.message", "") - RPCID = keys.NewString("id", "") - RPCDirection = keys.NewString("direction", "") - File = keys.NewString("file", "") - Directory = keys.New("directory", "") - URI = keys.New("URI", "") - Package = keys.NewString("package", "") // Package ID - PackagePath = keys.NewString("package_path", "") - Query = keys.New("query", "") - Snapshot = keys.NewUInt64("snapshot", "") - Operation = keys.NewString("operation", "") - - Position = keys.New("position", "") - Category = keys.NewString("category", "") - PackageCount = keys.NewInt("packages", "") - Files = keys.New("files", "") - Port = keys.NewInt("port", "") - Type = keys.New("type", "") - HoverKind = keys.NewString("hoverkind", "") - - NewServer = keys.NewString("new_server", "A new server was added") - EndServer = keys.NewString("end_server", "A server was shut down") - - ServerID = keys.NewString("server", "The server ID an event is related to") - Logfile = keys.NewString("logfile", "") - DebugAddress = keys.NewString("debug_address", "") - GoplsPath = keys.NewString("gopls_path", "") - ClientID = keys.NewString("client_id", "") - - Level = keys.NewInt("level", "The logging level") -) - -var ( - // create the stats we measure - Started = keys.NewInt64("started", "Count of started RPCs.") - ReceivedBytes = keys.NewInt64("received_bytes", "Bytes received.") //, unit.Bytes) - SentBytes = keys.NewInt64("sent_bytes", "Bytes sent.") //, unit.Bytes) - Latency = keys.NewFloat64("latency_ms", "Elapsed time in milliseconds") //, unit.Milliseconds) -) - -const ( - Inbound = "in" - Outbound = "out" -) 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 798fe599be..0000000000 --- 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_darwin.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_darwin.go deleted file mode 100644 index 0ca55e0d56..0000000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_darwin.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2022 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:build darwin && cgo -// +build darwin,cgo - -package fastwalk - -/* -#include - -// fastwalk_readdir_r wraps readdir_r so that we don't have to pass a dirent** -// result pointer which triggers CGO's "Go pointer to Go pointer" check unless -// we allocat the result dirent* with malloc. -// -// fastwalk_readdir_r returns 0 on success, -1 upon reaching the end of the -// directory, or a positive error number to indicate failure. -static int fastwalk_readdir_r(DIR *fd, struct dirent *entry) { - struct dirent *result; - int ret = readdir_r(fd, entry, &result); - if (ret == 0 && result == NULL) { - ret = -1; // EOF - } - return ret; -} -*/ -import "C" - -import ( - "os" - "syscall" - "unsafe" -) - -func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) error) error { - fd, err := openDir(dirName) - if err != nil { - return &os.PathError{Op: "opendir", Path: dirName, Err: err} - } - defer C.closedir(fd) - - skipFiles := false - var dirent syscall.Dirent - for { - ret := int(C.fastwalk_readdir_r(fd, (*C.struct_dirent)(unsafe.Pointer(&dirent)))) - if ret != 0 { - if ret == -1 { - break // EOF - } - if ret == int(syscall.EINTR) { - continue - } - return &os.PathError{Op: "readdir", Path: dirName, Err: syscall.Errno(ret)} - } - if dirent.Ino == 0 { - continue - } - typ := dtToType(dirent.Type) - if skipFiles && typ.IsRegular() { - continue - } - name := (*[len(syscall.Dirent{}.Name)]byte)(unsafe.Pointer(&dirent.Name))[:] - name = name[:dirent.Namlen] - for i, c := range name { - if c == 0 { - name = name[:i] - break - } - } - // Check for useless names before allocating a string. - if string(name) == "." || string(name) == ".." { - continue - } - if err := fn(dirName, string(name), typ); err != nil { - if err != ErrSkipFiles { - return err - } - skipFiles = true - } - } - - return nil -} - -func dtToType(typ uint8) os.FileMode { - switch typ { - case syscall.DT_BLK: - return os.ModeDevice - case syscall.DT_CHR: - return os.ModeDevice | os.ModeCharDevice - case syscall.DT_DIR: - return os.ModeDir - case syscall.DT_FIFO: - return os.ModeNamedPipe - case syscall.DT_LNK: - return os.ModeSymlink - case syscall.DT_REG: - return 0 - case syscall.DT_SOCK: - return os.ModeSocket - } - return ^os.FileMode(0) -} - -// openDir wraps opendir(3) and handles any EINTR errors. The returned *DIR -// needs to be closed with closedir(3). -func openDir(path string) (*C.DIR, error) { - name, err := syscall.BytePtrFromString(path) - if err != nil { - return nil, err - } - for { - fd, err := C.opendir((*C.char)(unsafe.Pointer(name))) - if err != syscall.EINTR { - return fd, err - } - } -} 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 d58595dbd3..0000000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.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. - -//go:build freebsd || openbsd || netbsd -// +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 d3922890b0..0000000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go +++ /dev/null @@ -1,15 +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. - -//go:build (linux || (darwin && !cgo)) && !appengine -// +build linux darwin,!cgo -// +build !appengine - -package fastwalk - -import "syscall" - -func direntInode(dirent *syscall.Dirent) uint64 { - return 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 38a4db6af3..0000000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go +++ /dev/null @@ -1,14 +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. - -//go:build (darwin && !cgo) || freebsd || openbsd || netbsd -// +build darwin,!cgo 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 c82e57df85..0000000000 --- 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. - -//go:build linux && !appengine -// +build linux,!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 085d311600..0000000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go +++ /dev/null @@ -1,38 +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. - -//go:build appengine || (!linux && !darwin && !freebsd && !openbsd && !netbsd) -// +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 f12f1a734c..0000000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go +++ /dev/null @@ -1,153 +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. - -//go:build (linux || freebsd || openbsd || netbsd || (darwin && !cgo)) && !appengine -// +build linux freebsd openbsd netbsd darwin,!cgo -// +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 := 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 = 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 -} - -// According to https://golang.org/doc/go1.14#runtime -// A consequence of the implementation of preemption is that on Unix systems, including Linux and macOS -// systems, programs built with Go 1.14 will receive more signals than programs built with earlier releases. -// -// This causes syscall.Open and syscall.ReadDirent sometimes fail with EINTR errors. -// We need to retry in this case. -func open(path string, mode int, perm uint32) (fd int, err error) { - for { - fd, err := syscall.Open(path, mode, perm) - if err != syscall.EINTR { - return fd, err - } - } -} - -func readDirent(fd int, buf []byte) (n int, err error) { - for { - nbuf, err := syscall.ReadDirent(fd, buf) - if err != syscall.EINTR { - return nbuf, err - } - } -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go b/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go index b1223713b9..39df91124a 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go @@ -29,7 +29,6 @@ import ( "go/token" "go/types" "io" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -221,7 +220,7 @@ func Import(packages map[string]*types.Package, path, srcDir string, lookup func switch hdr { case "$$B\n": var data []byte - data, err = ioutil.ReadAll(buf) + data, err = io.ReadAll(buf) if err != nil { break } @@ -260,13 +259,6 @@ func Import(packages map[string]*types.Package, path, srcDir string, lookup func return } -func deref(typ types.Type) types.Type { - if p, _ := typ.(*types.Pointer); p != nil { - return p.Elem() - } - return typ -} - type byPath []*types.Package func (a byPath) Len() int { return len(a) } diff --git a/vendor/golang.org/x/tools/internal/gcimporter/iexport.go b/vendor/golang.org/x/tools/internal/gcimporter/iexport.go index 9930d8c36a..deeb67f315 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/iexport.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/iexport.go @@ -22,17 +22,23 @@ import ( "strconv" "strings" + "golang.org/x/tools/go/types/objectpath" + "golang.org/x/tools/internal/aliases" "golang.org/x/tools/internal/tokeninternal" - "golang.org/x/tools/internal/typeparams" ) // IExportShallow encodes "shallow" export data for the specified package. // -// No promises are made about the encoding other than that it can be -// decoded by the same version of IIExportShallow. If you plan to save -// export data in the file system, be sure to include a cryptographic -// digest of the executable in the key to avoid version skew. -func IExportShallow(fset *token.FileSet, pkg *types.Package) ([]byte, error) { +// No promises are made about the encoding other than that it can be decoded by +// the same version of IIExportShallow. If you plan to save export data in the +// file system, be sure to include a cryptographic digest of the executable in +// the key to avoid version skew. +// +// If the provided reportf func is non-nil, it will be used for reporting bugs +// encountered during export. +// TODO(rfindley): remove reportf when we are confident enough in the new +// objectpath encoding. +func IExportShallow(fset *token.FileSet, pkg *types.Package, reportf ReportFunc) ([]byte, error) { // In principle this operation can only fail if out.Write fails, // but that's impossible for bytes.Buffer---and as a matter of // fact iexportCommon doesn't even check for I/O errors. @@ -47,19 +53,27 @@ func IExportShallow(fset *token.FileSet, pkg *types.Package) ([]byte, error) { // IImportShallow decodes "shallow" types.Package data encoded by // IExportShallow in the same executable. This function cannot import data from // cmd/compile or gcexportdata.Write. -func IImportShallow(fset *token.FileSet, getPackage GetPackageFunc, data []byte, path string, insert InsertType) (*types.Package, error) { +// +// The importer calls getPackages to obtain package symbols for all +// packages mentioned in the export data, including the one being +// decoded. +// +// If the provided reportf func is non-nil, it will be used for reporting bugs +// encountered during import. +// TODO(rfindley): remove reportf when we are confident enough in the new +// objectpath encoding. +func IImportShallow(fset *token.FileSet, getPackages GetPackagesFunc, data []byte, path string, reportf ReportFunc) (*types.Package, error) { const bundle = false - pkgs, err := iimportCommon(fset, getPackage, data, bundle, path, insert) + const shallow = true + pkgs, err := iimportCommon(fset, getPackages, data, bundle, path, shallow, reportf) if err != nil { return nil, err } return pkgs[0], nil } -// InsertType is the type of a function that creates a types.TypeName -// object for a named type and inserts it into the scope of the -// specified Package. -type InsertType = func(pkg *types.Package, name string) +// ReportFunc is the type of a function used to report formatted bugs. +type ReportFunc = func(string, ...interface{}) // Current bundled export format version. Increase with each format change. // 0: initial implementation @@ -313,8 +327,9 @@ type iexporter struct { out *bytes.Buffer version int - shallow bool // don't put types from other packages in the index - localpkg *types.Package // (nil in bundle mode) + shallow bool // don't put types from other packages in the index + objEncoder *objectpath.Encoder // encodes objects from other packages in shallow mode; lazily allocated + localpkg *types.Package // (nil in bundle mode) // allPkgs tracks all packages that have been referenced by // the export data, so we can ensure to include them in the @@ -354,6 +369,17 @@ func (p *iexporter) trace(format string, args ...interface{}) { fmt.Printf(strings.Repeat("..", p.indent)+format+"\n", args...) } +// objectpathEncoder returns the lazily allocated objectpath.Encoder to use +// when encoding objects in other packages during shallow export. +// +// Using a shared Encoder amortizes some of cost of objectpath search. +func (p *iexporter) objectpathEncoder() *objectpath.Encoder { + if p.objEncoder == nil { + p.objEncoder = new(objectpath.Encoder) + } + return p.objEncoder +} + // stringOff returns the offset of s within the string section. // If not already present, it's added to the end. func (p *iexporter) stringOff(s string) uint64 { @@ -413,7 +439,6 @@ type exportWriter struct { p *iexporter data intWriter - currPkg *types.Package prevFile string prevLine int64 prevColumn int64 @@ -436,11 +461,10 @@ func (p *iexporter) doDecl(obj types.Object) { }() } w := p.newWriter() - w.setPkg(obj.Pkg(), false) switch obj := obj.(type) { case *types.Var: - w.tag('V') + w.tag(varTag) w.pos(obj.Pos()) w.typ(obj.Type(), obj.Pkg()) @@ -457,10 +481,10 @@ func (p *iexporter) doDecl(obj types.Object) { } // Function. - if typeparams.ForSignature(sig).Len() == 0 { - w.tag('F') + if sig.TypeParams().Len() == 0 { + w.tag(funcTag) } else { - w.tag('G') + w.tag(genericFuncTag) } w.pos(obj.Pos()) // The tparam list of the function type is the declaration of the type @@ -470,27 +494,27 @@ func (p *iexporter) doDecl(obj types.Object) { // // While importing the type parameters, tparamList computes and records // their export name, so that it can be later used when writing the index. - if tparams := typeparams.ForSignature(sig); tparams.Len() > 0 { + if tparams := sig.TypeParams(); tparams.Len() > 0 { w.tparamList(obj.Name(), tparams, obj.Pkg()) } w.signature(sig) case *types.Const: - w.tag('C') + w.tag(constTag) w.pos(obj.Pos()) w.value(obj.Type(), obj.Val()) case *types.TypeName: t := obj.Type() - if tparam, ok := t.(*typeparams.TypeParam); ok { - w.tag('P') + if tparam, ok := aliases.Unalias(t).(*types.TypeParam); ok { + w.tag(typeParamTag) w.pos(obj.Pos()) constraint := tparam.Constraint() if p.version >= iexportVersionGo1_18 { implicit := false - if iface, _ := constraint.(*types.Interface); iface != nil { - implicit = typeparams.IsImplicit(iface) + if iface, _ := aliases.Unalias(constraint).(*types.Interface); iface != nil { + implicit = iface.IsImplicit() } w.bool(implicit) } @@ -499,8 +523,13 @@ func (p *iexporter) doDecl(obj types.Object) { } if obj.IsAlias() { - w.tag('A') + w.tag(aliasTag) w.pos(obj.Pos()) + if alias, ok := t.(*aliases.Alias); ok { + // Preserve materialized aliases, + // even of non-exported types. + t = aliases.Rhs(alias) + } w.typ(t, obj.Pkg()) break } @@ -511,20 +540,20 @@ func (p *iexporter) doDecl(obj types.Object) { panic(internalErrorf("%s is not a defined type", t)) } - if typeparams.ForNamed(named).Len() == 0 { - w.tag('T') + if named.TypeParams().Len() == 0 { + w.tag(typeTag) } else { - w.tag('U') + w.tag(genericTypeTag) } w.pos(obj.Pos()) - if typeparams.ForNamed(named).Len() > 0 { + if named.TypeParams().Len() > 0 { // While importing the type parameters, tparamList computes and records // their export name, so that it can be later used when writing the index. - w.tparamList(obj.Name(), typeparams.ForNamed(named), obj.Pkg()) + w.tparamList(obj.Name(), named.TypeParams(), obj.Pkg()) } - underlying := obj.Type().Underlying() + underlying := named.Underlying() w.typ(underlying, obj.Pkg()) if types.IsInterface(t) { @@ -541,7 +570,7 @@ func (p *iexporter) doDecl(obj types.Object) { // Receiver type parameters are type arguments of the receiver type, so // their name must be qualified before exporting recv. - if rparams := typeparams.RecvTypeParams(sig); rparams.Len() > 0 { + if rparams := sig.RecvTypeParams(); rparams.Len() > 0 { prefix := obj.Name() + "." + m.Name() for i := 0; i < rparams.Len(); i++ { rparam := rparams.At(i) @@ -673,6 +702,9 @@ func (w *exportWriter) qualifiedType(obj *types.TypeName) { w.pkg(obj.Pkg()) } +// TODO(rfindley): what does 'pkg' even mean here? It would be better to pass +// it in explicitly into signatures and structs that may use it for +// constructing fields. func (w *exportWriter) typ(t types.Type, pkg *types.Package) { w.data.uint64(w.p.typOff(t, pkg)) } @@ -712,20 +744,25 @@ func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { }() } switch t := t.(type) { + case *aliases.Alias: + // TODO(adonovan): support parameterized aliases, following *types.Named. + w.startType(aliasType) + w.qualifiedType(t.Obj()) + case *types.Named: - if targs := typeparams.NamedTypeArgs(t); targs.Len() > 0 { + if targs := t.TypeArgs(); targs.Len() > 0 { w.startType(instanceType) // TODO(rfindley): investigate if this position is correct, and if it // matters. w.pos(t.Obj().Pos()) w.typeList(targs, pkg) - w.typ(typeparams.NamedTypeOrigin(t), pkg) + w.typ(t.Origin(), pkg) return } w.startType(definedType) w.qualifiedType(t.Obj()) - case *typeparams.TypeParam: + case *types.TypeParam: w.startType(typeParamType) w.qualifiedType(t.Obj()) @@ -764,37 +801,60 @@ func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { case *types.Signature: w.startType(signatureType) - w.setPkg(pkg, true) + w.pkg(pkg) w.signature(t) case *types.Struct: w.startType(structType) n := t.NumFields() + // Even for struct{} we must emit some qualifying package, because that's + // what the compiler does, and thus that's what the importer expects. + fieldPkg := pkg if n > 0 { - w.setPkg(t.Field(0).Pkg(), true) // qualifying package for field objects - } else { - w.setPkg(pkg, true) + fieldPkg = t.Field(0).Pkg() + } + if fieldPkg == nil { + // TODO(rfindley): improve this very hacky logic. + // + // The importer expects a package to be set for all struct types, even + // those with no fields. A better encoding might be to set NumFields + // before pkg. setPkg panics with a nil package, which may be possible + // to reach with invalid packages (and perhaps valid packages, too?), so + // (arbitrarily) set the localpkg if available. + // + // Alternatively, we may be able to simply guarantee that pkg != nil, by + // reconsidering the encoding of constant values. + if w.p.shallow { + fieldPkg = w.p.localpkg + } else { + panic(internalErrorf("no package to set for empty struct")) + } } + w.pkg(fieldPkg) w.uint64(uint64(n)) + for i := 0; i < n; i++ { f := t.Field(i) + if w.p.shallow { + w.objectPath(f) + } w.pos(f.Pos()) w.string(f.Name()) // unexported fields implicitly qualified by prior setPkg - w.typ(f.Type(), pkg) + w.typ(f.Type(), fieldPkg) w.bool(f.Anonymous()) w.string(t.Tag(i)) // note (or tag) } case *types.Interface: w.startType(interfaceType) - w.setPkg(pkg, true) + w.pkg(pkg) n := t.NumEmbeddeds() w.uint64(uint64(n)) for i := 0; i < n; i++ { ft := t.EmbeddedType(i) tPkg := pkg - if named, _ := ft.(*types.Named); named != nil { + if named, _ := aliases.Unalias(ft).(*types.Named); named != nil { w.pos(named.Obj().Pos()) } else { w.pos(token.NoPos) @@ -802,17 +862,23 @@ func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { w.typ(ft, tPkg) } + // See comment for struct fields. In shallow mode we change the encoding + // for interface methods that are promoted from other packages. + n = t.NumExplicitMethods() w.uint64(uint64(n)) for i := 0; i < n; i++ { m := t.ExplicitMethod(i) + if w.p.shallow { + w.objectPath(m) + } w.pos(m.Pos()) w.string(m.Name()) sig, _ := m.Type().(*types.Signature) w.signature(sig) } - case *typeparams.Union: + case *types.Union: w.startType(unionType) nt := t.Len() w.uint64(uint64(nt)) @@ -827,12 +893,61 @@ func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { } } -func (w *exportWriter) setPkg(pkg *types.Package, write bool) { - if write { - w.pkg(pkg) +// objectPath writes the package and objectPath to use to look up obj in a +// different package, when encoding in "shallow" mode. +// +// When doing a shallow import, the importer creates only the local package, +// and requests package symbols for dependencies from the client. +// However, certain types defined in the local package may hold objects defined +// (perhaps deeply) within another package. +// +// For example, consider the following: +// +// package a +// func F() chan * map[string] struct { X int } +// +// package b +// import "a" +// var B = a.F() +// +// In this example, the type of b.B holds fields defined in package a. +// In order to have the correct canonical objects for the field defined in the +// type of B, they are encoded as objectPaths and later looked up in the +// importer. The same problem applies to interface methods. +func (w *exportWriter) objectPath(obj types.Object) { + if obj.Pkg() == nil || obj.Pkg() == w.p.localpkg { + // obj.Pkg() may be nil for the builtin error.Error. + // In this case, or if obj is declared in the local package, no need to + // encode. + w.string("") + return } - - w.currPkg = pkg + objectPath, err := w.p.objectpathEncoder().For(obj) + if err != nil { + // Fall back to the empty string, which will cause the importer to create a + // new object, which matches earlier behavior. Creating a new object is + // sufficient for many purposes (such as type checking), but causes certain + // references algorithms to fail (golang/go#60819). However, we didn't + // notice this problem during months of gopls@v0.12.0 testing. + // + // TODO(golang/go#61674): this workaround is insufficient, as in the case + // where the field forwarded from an instantiated type that may not appear + // in the export data of the original package: + // + // // package a + // type A[P any] struct{ F P } + // + // // package b + // type B a.A[int] + // + // We need to update references algorithms not to depend on this + // de-duplication, at which point we may want to simply remove the + // workaround here. + w.string("") + return + } + w.string(string(objectPath)) + w.pkg(obj.Pkg()) } func (w *exportWriter) signature(sig *types.Signature) { @@ -843,14 +958,14 @@ func (w *exportWriter) signature(sig *types.Signature) { } } -func (w *exportWriter) typeList(ts *typeparams.TypeList, pkg *types.Package) { +func (w *exportWriter) typeList(ts *types.TypeList, pkg *types.Package) { w.uint64(uint64(ts.Len())) for i := 0; i < ts.Len(); i++ { w.typ(ts.At(i), pkg) } } -func (w *exportWriter) tparamList(prefix string, list *typeparams.TypeParamList, pkg *types.Package) { +func (w *exportWriter) tparamList(prefix string, list *types.TypeParamList, pkg *types.Package) { ll := uint64(list.Len()) w.uint64(ll) for i := 0; i < list.Len(); i++ { @@ -868,7 +983,7 @@ const blankMarker = "$" // differs from its actual object name: it is prefixed with a qualifier, and // blank type parameter names are disambiguated by their index in the type // parameter list. -func tparamExportName(prefix string, tparam *typeparams.TypeParam) string { +func tparamExportName(prefix string, tparam *types.TypeParam) string { assert(prefix != "") name := tparam.Obj().Name() if name == "_" { @@ -913,6 +1028,17 @@ func (w *exportWriter) value(typ types.Type, v constant.Value) { w.int64(int64(v.Kind())) } + if v.Kind() == constant.Unknown { + // golang/go#60605: treat unknown constant values as if they have invalid type + // + // This loses some fidelity over the package type-checked from source, but that + // is acceptable. + // + // TODO(rfindley): we should switch on the recorded constant kind rather + // than the constant type + return + } + switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { case types.IsBoolean: w.bool(constant.BoolVal(v)) @@ -1194,6 +1320,13 @@ type internalError string func (e internalError) Error() string { return "gcimporter: " + string(e) } +// TODO(adonovan): make this call panic, so that it's symmetric with errorf. +// Otherwise it's easy to forget to do anything with the error. +// +// TODO(adonovan): also, consider switching the names "errorf" and +// "internalErrorf" as the former is used for bugs, whose cause is +// internal inconsistency, whereas the latter is used for ordinary +// situations like bad input, whose cause is external. func internalErrorf(format string, args ...interface{}) error { return internalError(fmt.Sprintf(format, args...)) } diff --git a/vendor/golang.org/x/tools/internal/gcimporter/iimport.go b/vendor/golang.org/x/tools/internal/gcimporter/iimport.go index 94a5eba333..136aa03653 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/iimport.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/iimport.go @@ -21,7 +21,9 @@ import ( "sort" "strings" - "golang.org/x/tools/internal/typeparams" + "golang.org/x/tools/go/types/objectpath" + "golang.org/x/tools/internal/aliases" + "golang.org/x/tools/internal/typesinternal" ) type intReader struct { @@ -78,6 +80,20 @@ const ( typeParamType instanceType unionType + aliasType +) + +// Object tags +const ( + varTag = 'V' + funcTag = 'F' + genericFuncTag = 'G' + constTag = 'C' + aliasTag = 'A' + genericAliasTag = 'B' + typeParamTag = 'P' + typeTag = 'T' + genericTypeTag = 'U' ) // IImportData imports a package from the serialized package data @@ -85,7 +101,7 @@ const ( // If the export data version is not recognized or the format is otherwise // compromised, an error is returned. func IImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (int, *types.Package, error) { - pkgs, err := iimportCommon(fset, GetPackageFromMap(imports), data, false, path, nil) + pkgs, err := iimportCommon(fset, GetPackagesFromMap(imports), data, false, path, false, nil) if err != nil { return 0, nil, err } @@ -94,33 +110,49 @@ func IImportData(fset *token.FileSet, imports map[string]*types.Package, data [] // IImportBundle imports a set of packages from the serialized package bundle. func IImportBundle(fset *token.FileSet, imports map[string]*types.Package, data []byte) ([]*types.Package, error) { - return iimportCommon(fset, GetPackageFromMap(imports), data, true, "", nil) + return iimportCommon(fset, GetPackagesFromMap(imports), data, true, "", false, nil) } -// A GetPackageFunc is a function that gets the package with the given path -// from the importer state, creating it (with the specified name) if necessary. -// It is an abstraction of the map historically used to memoize package creation. -// -// Two calls with the same path must return the same package. +// A GetPackagesFunc function obtains the non-nil symbols for a set of +// packages, creating and recursively importing them as needed. An +// implementation should store each package symbol is in the Pkg +// field of the items array. // -// If the given getPackage func returns nil, the import will fail. -type GetPackageFunc = func(path, name string) *types.Package +// Any error causes importing to fail. This can be used to quickly read +// the import manifest of an export data file without fully decoding it. +type GetPackagesFunc = func(items []GetPackagesItem) error + +// A GetPackagesItem is a request from the importer for the package +// symbol of the specified name and path. +type GetPackagesItem struct { + Name, Path string + Pkg *types.Package // to be filled in by GetPackagesFunc call + + // private importer state + pathOffset uint64 + nameIndex map[string]uint64 +} -// GetPackageFromMap returns a GetPackageFunc that retrieves packages from the -// given map of package path -> package. +// GetPackagesFromMap returns a GetPackagesFunc that retrieves +// packages from the given map of package path to package. // -// The resulting func may mutate m: if a requested package is not found, a new -// package will be inserted into m. -func GetPackageFromMap(m map[string]*types.Package) GetPackageFunc { - return func(path, name string) *types.Package { - if _, ok := m[path]; !ok { - m[path] = types.NewPackage(path, name) +// The returned function may mutate m: each requested package that is not +// found is created with types.NewPackage and inserted into m. +func GetPackagesFromMap(m map[string]*types.Package) GetPackagesFunc { + return func(items []GetPackagesItem) error { + for i, item := range items { + pkg, ok := m[item.Path] + if !ok { + pkg = types.NewPackage(item.Path, item.Name) + m[item.Path] = pkg + } + items[i].Pkg = pkg } - return m[path] + return nil } } -func iimportCommon(fset *token.FileSet, getPackage GetPackageFunc, data []byte, bundle bool, path string, insert InsertType) (pkgs []*types.Package, err error) { +func iimportCommon(fset *token.FileSet, getPackages GetPackagesFunc, data []byte, bundle bool, path string, shallow bool, reportf ReportFunc) (pkgs []*types.Package, err error) { const currentVersion = iexportVersionCurrent version := int64(-1) if !debug { @@ -159,7 +191,7 @@ func iimportCommon(fset *token.FileSet, getPackage GetPackageFunc, data []byte, sLen := int64(r.uint64()) var fLen int64 var fileOffset []uint64 - if insert != nil { + if shallow { // Shallow mode uses a different position encoding. fLen = int64(r.uint64()) fileOffset = make([]uint64, r.uint64()) @@ -178,7 +210,9 @@ func iimportCommon(fset *token.FileSet, getPackage GetPackageFunc, data []byte, p := iimporter{ version: int(version), ipath: path, - insert: insert, + aliases: aliases.Enabled(), + shallow: shallow, + reportf: reportf, stringData: stringData, stringCache: make(map[uint64]string), @@ -205,8 +239,10 @@ func iimportCommon(fset *token.FileSet, getPackage GetPackageFunc, data []byte, p.typCache[uint64(i)] = pt } - pkgList := make([]*types.Package, r.uint64()) - for i := range pkgList { + // Gather the relevant packages from the manifest. + items := make([]GetPackagesItem, r.uint64()) + uniquePkgPaths := make(map[string]bool) + for i := range items { pkgPathOff := r.uint64() pkgPath := p.stringAt(pkgPathOff) pkgName := p.stringAt(r.uint64()) @@ -215,29 +251,48 @@ func iimportCommon(fset *token.FileSet, getPackage GetPackageFunc, data []byte, if pkgPath == "" { pkgPath = path } - pkg := getPackage(pkgPath, pkgName) - if pkg == nil { - errorf("internal error: getPackage returned nil package for %s", pkgPath) - } else if pkg.Name() != pkgName { - errorf("conflicting names %s and %s for package %q", pkg.Name(), pkgName, path) - } - if i == 0 && !bundle { - p.localpkg = pkg - } - - p.pkgCache[pkgPathOff] = pkg + items[i].Name = pkgName + items[i].Path = pkgPath + items[i].pathOffset = pkgPathOff // Read index for package. nameIndex := make(map[string]uint64) nSyms := r.uint64() - // In shallow mode we don't expect an index for other packages. - assert(nSyms == 0 || p.localpkg == pkg || p.insert == nil) + // In shallow mode, only the current package (i=0) has an index. + assert(!(shallow && i > 0 && nSyms != 0)) for ; nSyms > 0; nSyms-- { name := p.stringAt(r.uint64()) nameIndex[name] = r.uint64() } - p.pkgIndex[pkg] = nameIndex + items[i].nameIndex = nameIndex + + uniquePkgPaths[pkgPath] = true + } + // Debugging #63822; hypothesis: there are duplicate PkgPaths. + if len(uniquePkgPaths) != len(items) { + reportf("found duplicate PkgPaths while reading export data manifest: %v", items) + } + + // Request packages all at once from the client, + // enabling a parallel implementation. + if err := getPackages(items); err != nil { + return nil, err // don't wrap this error + } + + // Check the results and complete the index. + pkgList := make([]*types.Package, len(items)) + for i, item := range items { + pkg := item.Pkg + if pkg == nil { + errorf("internal error: getPackages returned nil package for %q", item.Path) + } else if pkg.Path() != item.Path { + errorf("internal error: getPackages returned wrong path %q, want %q", pkg.Path(), item.Path) + } else if pkg.Name() != item.Name { + errorf("internal error: getPackages returned wrong name %s for package %q, want %s", pkg.Name(), item.Path, item.Name) + } + p.pkgCache[item.pathOffset] = pkg + p.pkgIndex[pkg] = item.nameIndex pkgList[i] = pkg } @@ -284,23 +339,30 @@ func iimportCommon(fset *token.FileSet, getPackage GetPackageFunc, data []byte, } // SetConstraint can't be called if the constraint type is not yet complete. - // When type params are created in the 'P' case of (*importReader).obj(), + // When type params are created in the typeParamTag case of (*importReader).obj(), // the associated constraint type may not be complete due to recursion. // Therefore, we defer calling SetConstraint there, and call it here instead // after all types are complete. for _, d := range p.later { - typeparams.SetTypeParamConstraint(d.t, d.constraint) + d.t.SetConstraint(d.constraint) } for _, typ := range p.interfaceList { typ.Complete() } + // Workaround for golang/go#61561. See the doc for instanceList for details. + for _, typ := range p.instanceList { + if iface, _ := typ.Underlying().(*types.Interface); iface != nil { + iface.Complete() + } + } + return pkgs, nil } type setConstraintArgs struct { - t *typeparams.TypeParam + t *types.TypeParam constraint types.Type } @@ -308,8 +370,9 @@ type iimporter struct { version int ipath string - localpkg *types.Package - insert func(pkg *types.Package, name string) // "shallow" mode only + aliases bool + shallow bool + reportf ReportFunc // if non-nil, used to report bugs stringData []byte stringCache map[uint64]string @@ -326,6 +389,12 @@ type iimporter struct { fake fakeFileSet interfaceList []*types.Interface + // Workaround for the go/types bug golang/go#61561: instances produced during + // instantiation may contain incomplete interfaces. Here we only complete the + // underlying type of the instance, which is the most common case but doesn't + // handle parameterized interface literals defined deeper in the type. + instanceList []types.Type // instances for later completion (see golang/go#61561) + // Arguments for calls to SetConstraint that are deferred due to recursive types later []setConstraintArgs @@ -357,13 +426,9 @@ func (p *iimporter) doDecl(pkg *types.Package, name string) { off, ok := p.pkgIndex[pkg][name] if !ok { - // In "shallow" mode, call back to the application to - // find the object and insert it into the package scope. - if p.insert != nil { - assert(pkg != p.localpkg) - p.insert(pkg, name) // "can't fail" - return - } + // In deep mode, the index should be complete. In shallow + // mode, we should have already recursively loaded necessary + // dependencies so the above Lookup succeeds. errorf("%v.%v not in index", pkg, name) } @@ -475,7 +540,7 @@ func canReuse(def *types.Named, rhs types.Type) bool { if def == nil { return true } - iface, _ := rhs.(*types.Interface) + iface, _ := aliases.Unalias(rhs).(*types.Interface) if iface == nil { return true } @@ -497,25 +562,29 @@ func (r *importReader) obj(name string) { pos := r.pos() switch tag { - case 'A': + case aliasTag: typ := r.typ() - - r.declare(types.NewTypeName(pos, r.currPkg, name, typ)) - - case 'C': + // TODO(adonovan): support generic aliases: + // if tag == genericAliasTag { + // tparams := r.tparamList() + // alias.SetTypeParams(tparams) + // } + r.declare(aliases.NewAlias(r.p.aliases, pos, r.currPkg, name, typ)) + + case constTag: typ, val := r.value() r.declare(types.NewConst(pos, r.currPkg, name, typ, val)) - case 'F', 'G': - var tparams []*typeparams.TypeParam - if tag == 'G' { + case funcTag, genericFuncTag: + var tparams []*types.TypeParam + if tag == genericFuncTag { tparams = r.tparamList() } sig := r.signature(nil, nil, tparams) r.declare(types.NewFunc(pos, r.currPkg, name, sig)) - case 'T', 'U': + case typeTag, genericTypeTag: // Types can be recursive. We need to setup a stub // declaration before recursing. obj := types.NewTypeName(pos, r.currPkg, name, nil) @@ -523,9 +592,9 @@ func (r *importReader) obj(name string) { // Declare obj before calling r.tparamList, so the new type name is recognized // if used in the constraint of one of its own typeparams (see #48280). r.declare(obj) - if tag == 'U' { + if tag == genericTypeTag { tparams := r.tparamList() - typeparams.SetForNamed(named, tparams) + named.SetTypeParams(tparams) } underlying := r.p.typAt(r.uint64(), named).Underlying() @@ -540,14 +609,13 @@ func (r *importReader) obj(name string) { // If the receiver has any targs, set those as the // rparams of the method (since those are the // typeparams being used in the method sig/body). - base := baseType(recv.Type()) - assert(base != nil) - targs := typeparams.NamedTypeArgs(base) - var rparams []*typeparams.TypeParam + _, recvNamed := typesinternal.ReceiverNamed(recv) + targs := recvNamed.TypeArgs() + var rparams []*types.TypeParam if targs.Len() > 0 { - rparams = make([]*typeparams.TypeParam, targs.Len()) + rparams = make([]*types.TypeParam, targs.Len()) for i := range rparams { - rparams[i] = targs.At(i).(*typeparams.TypeParam) + rparams[i] = aliases.Unalias(targs.At(i)).(*types.TypeParam) } } msig := r.signature(recv, rparams, nil) @@ -556,7 +624,7 @@ func (r *importReader) obj(name string) { } } - case 'P': + case typeParamTag: // We need to "declare" a typeparam in order to have a name that // can be referenced recursively (if needed) in the type param's // bound. @@ -565,7 +633,7 @@ func (r *importReader) obj(name string) { } name0 := tparamName(name) tn := types.NewTypeName(pos, r.currPkg, name0, nil) - t := typeparams.NewTypeParam(tn, nil) + t := types.NewTypeParam(tn, nil) // To handle recursive references to the typeparam within its // bound, save the partial type in tparamIndex before reading the bounds. @@ -577,11 +645,11 @@ func (r *importReader) obj(name string) { } constraint := r.typ() if implicit { - iface, _ := constraint.(*types.Interface) + iface, _ := aliases.Unalias(constraint).(*types.Interface) if iface == nil { errorf("non-interface constraint marked implicit") } - typeparams.MarkImplicit(iface) + iface.MarkImplicit() } // The constraint type may not be complete, if we // are in the middle of a type recursion involving type @@ -589,7 +657,7 @@ func (r *importReader) obj(name string) { // completely set up all types in ImportData. r.p.later = append(r.p.later, setConstraintArgs{t: t, constraint: constraint}) - case 'V': + case varTag: typ := r.typ() r.declare(types.NewVar(pos, r.currPkg, name, typ)) @@ -730,7 +798,8 @@ func (r *importReader) qualifiedIdent() (*types.Package, string) { } func (r *importReader) pos() token.Pos { - if r.p.insert != nil { // shallow mode + if r.p.shallow { + // precise offsets are encoded only in shallow mode return r.posv2() } if r.p.version >= iexportVersionPosCol { @@ -783,7 +852,7 @@ func (r *importReader) typ() types.Type { } func isInterface(t types.Type) bool { - _, ok := t.(*types.Interface) + _, ok := aliases.Unalias(t).(*types.Interface) return ok } @@ -805,7 +874,7 @@ func (r *importReader) doType(base *types.Named) (res types.Type) { errorf("unexpected kind tag in %q: %v", r.p.ipath, k) return nil - case definedType: + case aliasType, definedType: pkg, name := r.qualifiedIdent() r.p.doDecl(pkg, name) return pkg.Scope().Lookup(name).(*types.TypeName).Type() @@ -831,13 +900,28 @@ func (r *importReader) doType(base *types.Named) (res types.Type) { fields := make([]*types.Var, r.uint64()) tags := make([]string, len(fields)) for i := range fields { + var field *types.Var + if r.p.shallow { + field, _ = r.objectPathObject().(*types.Var) + } + fpos := r.pos() fname := r.ident() ftyp := r.typ() emb := r.bool() tag := r.string() - fields[i] = types.NewField(fpos, r.currPkg, fname, ftyp, emb) + // Either this is not a shallow import, the field is local, or the + // encoded objectPath failed to produce an object (a bug). + // + // Even in this last, buggy case, fall back on creating a new field. As + // discussed in iexport.go, this is not correct, but mostly works and is + // preferable to failing (for now at least). + if field == nil { + field = types.NewField(fpos, r.currPkg, fname, ftyp, emb) + } + + fields[i] = field tags[i] = tag } return types.NewStruct(fields, tags) @@ -853,6 +937,11 @@ func (r *importReader) doType(base *types.Named) (res types.Type) { methods := make([]*types.Func, r.uint64()) for i := range methods { + var method *types.Func + if r.p.shallow { + method, _ = r.objectPathObject().(*types.Func) + } + mpos := r.pos() mname := r.ident() @@ -862,9 +951,12 @@ func (r *importReader) doType(base *types.Named) (res types.Type) { if base != nil { recv = types.NewVar(token.NoPos, r.currPkg, "", base) } - msig := r.signature(recv, nil, nil) - methods[i] = types.NewFunc(mpos, r.currPkg, mname, msig) + + if method == nil { + method = types.NewFunc(mpos, r.currPkg, mname, msig) + } + methods[i] = method } typ := newInterface(methods, embeddeds) @@ -901,18 +993,21 @@ func (r *importReader) doType(base *types.Named) (res types.Type) { // The imported instantiated type doesn't include any methods, so // we must always use the methods of the base (orig) type. // TODO provide a non-nil *Environment - t, _ := typeparams.Instantiate(nil, baseType, targs, false) + t, _ := types.Instantiate(nil, baseType, targs, false) + + // Workaround for golang/go#61561. See the doc for instanceList for details. + r.p.instanceList = append(r.p.instanceList, t) return t case unionType: if r.p.version < iexportVersionGenerics { errorf("unexpected instantiation type") } - terms := make([]*typeparams.Term, r.uint64()) + terms := make([]*types.Term, r.uint64()) for i := range terms { - terms[i] = typeparams.NewTerm(r.bool(), r.typ()) + terms[i] = types.NewTerm(r.bool(), r.typ()) } - return typeparams.NewUnion(terms) + return types.NewUnion(terms) } } @@ -920,23 +1015,43 @@ func (r *importReader) kind() itag { return itag(r.uint64()) } -func (r *importReader) signature(recv *types.Var, rparams []*typeparams.TypeParam, tparams []*typeparams.TypeParam) *types.Signature { +// objectPathObject is the inverse of exportWriter.objectPath. +// +// In shallow mode, certain fields and methods may need to be looked up in an +// imported package. See the doc for exportWriter.objectPath for a full +// explanation. +func (r *importReader) objectPathObject() types.Object { + objPath := objectpath.Path(r.string()) + if objPath == "" { + return nil + } + pkg := r.pkg() + obj, err := objectpath.Object(pkg, objPath) + if err != nil { + if r.p.reportf != nil { + r.p.reportf("failed to find object for objectPath %q: %v", objPath, err) + } + } + return obj +} + +func (r *importReader) signature(recv *types.Var, rparams []*types.TypeParam, tparams []*types.TypeParam) *types.Signature { params := r.paramList() results := r.paramList() variadic := params.Len() > 0 && r.bool() - return typeparams.NewSignatureType(recv, rparams, tparams, params, results, variadic) + return types.NewSignatureType(recv, rparams, tparams, params, results, variadic) } -func (r *importReader) tparamList() []*typeparams.TypeParam { +func (r *importReader) tparamList() []*types.TypeParam { n := r.uint64() if n == 0 { return nil } - xs := make([]*typeparams.TypeParam, n) + xs := make([]*types.TypeParam, n) for i := range xs { // Note: the standard library importer is tolerant of nil types here, // though would panic in SetTypeParams. - xs[i] = r.typ().(*typeparams.TypeParam) + xs[i] = aliases.Unalias(r.typ()).(*types.TypeParam) } return xs } @@ -983,13 +1098,3 @@ func (r *importReader) byte() byte { } return x } - -func baseType(typ types.Type) *types.Named { - // pointer receivers are never types.Named types - if p, _ := typ.(*types.Pointer); p != nil { - typ = p.Elem() - } - // receiver base types are always (possibly generic) types.Named types - n, _ := typ.(*types.Named) - return n -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/support_go117.go b/vendor/golang.org/x/tools/internal/gcimporter/support_go117.go deleted file mode 100644 index d892273efb..0000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/support_go117.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2021 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:build !go1.18 -// +build !go1.18 - -package gcimporter - -import "go/types" - -const iexportVersion = iexportVersionGo1_11 - -func additionalPredeclared() []types.Type { - return nil -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/support_go118.go b/vendor/golang.org/x/tools/internal/gcimporter/support_go118.go index edbe6ea704..0cd3b91b65 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/support_go118.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/support_go118.go @@ -2,9 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.18 -// +build go1.18 - package gcimporter import "go/types" diff --git a/vendor/golang.org/x/tools/internal/gcimporter/unified_no.go b/vendor/golang.org/x/tools/internal/gcimporter/unified_no.go index 286bf44548..38b624cada 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/unified_no.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/unified_no.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !(go1.18 && goexperiment.unified) -// +build !go1.18 !goexperiment.unified +//go:build !goexperiment.unified +// +build !goexperiment.unified package gcimporter diff --git a/vendor/golang.org/x/tools/internal/gcimporter/unified_yes.go b/vendor/golang.org/x/tools/internal/gcimporter/unified_yes.go index b5d69ffbe6..b5118d0b3a 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/unified_yes.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/unified_yes.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.18 && goexperiment.unified -// +build go1.18,goexperiment.unified +//go:build goexperiment.unified +// +build goexperiment.unified package gcimporter diff --git a/vendor/golang.org/x/tools/internal/gcimporter/ureader_no.go b/vendor/golang.org/x/tools/internal/gcimporter/ureader_no.go deleted file mode 100644 index 8eb20729c2..0000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/ureader_no.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2022 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:build !go1.18 -// +build !go1.18 - -package gcimporter - -import ( - "fmt" - "go/token" - "go/types" -) - -func UImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { - err = fmt.Errorf("go/tools compiled with a Go version earlier than 1.18 cannot read unified IR export data") - return -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go b/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go index b977435f62..2c07706887 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go @@ -4,9 +4,6 @@ // Derived from go/internal/gcimporter/ureader.go -//go:build go1.18 -// +build go1.18 - package gcimporter import ( @@ -16,6 +13,7 @@ import ( "sort" "strings" + "golang.org/x/tools/internal/aliases" "golang.org/x/tools/internal/pkgbits" ) @@ -28,6 +26,7 @@ type pkgReader struct { ctxt *types.Context imports map[string]*types.Package // previously imported packages, indexed by path + aliases bool // create types.Alias nodes // lazily initialized arrays corresponding to the unified IR // PosBase, Pkg, and Type sections, respectively. @@ -101,6 +100,7 @@ func readUnifiedPackage(fset *token.FileSet, ctxt *types.Context, imports map[st ctxt: ctxt, imports: imports, + aliases: aliases.Enabled(), posBases: make([]string, input.NumElems(pkgbits.RelocPosBase)), pkgs: make([]*types.Package, input.NumElems(pkgbits.RelocPkg)), @@ -526,7 +526,7 @@ func (pr *pkgReader) objIdx(idx pkgbits.Index) (*types.Package, string) { case pkgbits.ObjAlias: pos := r.pos() typ := r.typ() - declare(types.NewTypeName(pos, objPkg, objName, typ)) + declare(aliases.NewAlias(r.p.aliases, pos, objPkg, objName, typ)) case pkgbits.ObjConst: pos := r.pos() @@ -553,7 +553,7 @@ func (pr *pkgReader) objIdx(idx pkgbits.Index) (*types.Package, string) { // If the underlying type is an interface, we need to // duplicate its methods so we can replace the receiver // parameter's type (#49906). - if iface, ok := underlying.(*types.Interface); ok && iface.NumExplicitMethods() != 0 { + if iface, ok := aliases.Unalias(underlying).(*types.Interface); ok && iface.NumExplicitMethods() != 0 { methods := make([]*types.Func, iface.NumExplicitMethods()) for i := range methods { fn := iface.ExplicitMethod(i) diff --git a/vendor/golang.org/x/tools/internal/gocommand/invoke.go b/vendor/golang.org/x/tools/internal/gocommand/invoke.go index 8d9fc98d8f..2e59ff8558 100644 --- a/vendor/golang.org/x/tools/internal/gocommand/invoke.go +++ b/vendor/golang.org/x/tools/internal/gocommand/invoke.go @@ -8,11 +8,14 @@ package gocommand import ( "bytes" "context" + "encoding/json" "errors" "fmt" "io" "log" "os" + "os/exec" + "path/filepath" "reflect" "regexp" "runtime" @@ -21,12 +24,9 @@ import ( "sync" "time" - exec "golang.org/x/sys/execabs" - "golang.org/x/tools/internal/event" "golang.org/x/tools/internal/event/keys" "golang.org/x/tools/internal/event/label" - "golang.org/x/tools/internal/event/tag" ) // An Runner will run go command invocations and serialize @@ -56,11 +56,14 @@ func (runner *Runner) initialize() { // 1.14: go: updating go.mod: existing contents have changed since last read var modConcurrencyError = regexp.MustCompile(`go:.*go.mod.*contents have changed`) -// verb is an event label for the go command verb. -var verb = keys.NewString("verb", "go command verb") +// event keys for go command invocations +var ( + verb = keys.NewString("verb", "go command verb") + directory = keys.NewString("directory", "") +) func invLabels(inv Invocation) []label.Label { - return []label.Label{verb.Of(inv.Verb), tag.Directory.Of(inv.WorkingDir)} + return []label.Label{verb.Of(inv.Verb), directory.Of(inv.WorkingDir)} } // Run is a convenience wrapper around RunRaw. @@ -85,6 +88,7 @@ func (runner *Runner) RunPiped(ctx context.Context, inv Invocation, stdout, stde // RunRaw runs the invocation, serializing requests only if they fight over // go.mod changes. +// Postcondition: both error results have same nilness. func (runner *Runner) RunRaw(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { ctx, done := event.Start(ctx, "gocommand.Runner.RunRaw", invLabels(inv)...) defer done() @@ -95,23 +99,24 @@ func (runner *Runner) RunRaw(ctx context.Context, inv Invocation) (*bytes.Buffer stdout, stderr, friendlyErr, err := runner.runConcurrent(ctx, inv) // If we encounter a load concurrency error, we need to retry serially. - if friendlyErr == nil || !modConcurrencyError.MatchString(friendlyErr.Error()) { - return stdout, stderr, friendlyErr, err + if friendlyErr != nil && modConcurrencyError.MatchString(friendlyErr.Error()) { + event.Error(ctx, "Load concurrency error, will retry serially", err) + + // Run serially by calling runPiped. + stdout.Reset() + stderr.Reset() + friendlyErr, err = runner.runPiped(ctx, inv, stdout, stderr) } - event.Error(ctx, "Load concurrency error, will retry serially", err) - // Run serially by calling runPiped. - stdout.Reset() - stderr.Reset() - friendlyErr, err = runner.runPiped(ctx, inv, stdout, stderr) return stdout, stderr, friendlyErr, err } +// Postcondition: both error results have same nilness. func (runner *Runner) runConcurrent(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { // Wait for 1 worker to become available. select { case <-ctx.Done(): - return nil, nil, nil, ctx.Err() + return nil, nil, ctx.Err(), ctx.Err() case runner.inFlight <- struct{}{}: defer func() { <-runner.inFlight }() } @@ -121,6 +126,7 @@ func (runner *Runner) runConcurrent(ctx context.Context, inv Invocation) (*bytes return stdout, stderr, friendlyErr, err } +// Postcondition: both error results have same nilness. func (runner *Runner) runPiped(ctx context.Context, inv Invocation, stdout, stderr io.Writer) (error, error) { // Make sure the runner is always initialized. runner.initialize() @@ -129,7 +135,7 @@ func (runner *Runner) runPiped(ctx context.Context, inv Invocation, stdout, stde // runPiped commands. select { case <-ctx.Done(): - return nil, ctx.Err() + return ctx.Err(), ctx.Err() case runner.serialized <- struct{}{}: defer func() { <-runner.serialized }() } @@ -139,7 +145,7 @@ func (runner *Runner) runPiped(ctx context.Context, inv Invocation, stdout, stde for i := 0; i < maxInFlight; i++ { select { case <-ctx.Done(): - return nil, ctx.Err() + return ctx.Err(), ctx.Err() case runner.inFlight <- struct{}{}: // Make sure we always "return" any workers we took. defer func() { <-runner.inFlight }() @@ -156,12 +162,17 @@ type Invocation struct { BuildFlags []string // If ModFlag is set, the go command is invoked with -mod=ModFlag. + // TODO(rfindley): remove, in favor of Args. ModFlag string // If ModFile is set, the go command is invoked with -modfile=ModFile. + // TODO(rfindley): remove, in favor of Args. ModFile string - // If Overlay is set, the go command is invoked with -overlay=Overlay. + // Overlay is the name of the JSON overlay file that describes + // unsaved editor buffers; see [WriteOverlays]. + // If set, the go command is invoked with -overlay=Overlay. + // TODO(rfindley): remove, in favor of Args. Overlay string // If CleanEnv is set, the invocation will run only with the environment @@ -172,6 +183,7 @@ type Invocation struct { Logf func(format string, args ...interface{}) } +// Postcondition: both error results have same nilness. func (i *Invocation) runWithFriendlyError(ctx context.Context, stdout, stderr io.Writer) (friendlyError error, rawError error) { rawError = i.run(ctx, stdout, stderr) if rawError != nil { @@ -188,12 +200,14 @@ func (i *Invocation) runWithFriendlyError(ctx context.Context, stdout, stderr io return } -func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error { - log := i.Logf - if log == nil { - log = func(string, ...interface{}) {} +// logf logs if i.Logf is non-nil. +func (i *Invocation) logf(format string, args ...any) { + if i.Logf != nil { + i.Logf(format, args...) } +} +func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error { goArgs := []string{i.Verb} appendModFile := func() { @@ -247,12 +261,15 @@ func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error { waitDelay.Set(reflect.ValueOf(30 * time.Second)) } - // 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 + // The cwd gets resolved to the real path. On Darwin, where + // /tmp is a symlink, this 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. + // + // os.Getwd 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. if !i.CleanEnv { cmd.Env = os.Environ() } @@ -262,7 +279,12 @@ func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error { cmd.Dir = i.WorkingDir } - defer func(start time.Time) { log("%s for %v", time.Since(start), cmdDebugStr(cmd)) }(time.Now()) + debugStr := cmdDebugStr(cmd) + i.logf("starting %v", debugStr) + start := time.Now() + defer func() { + i.logf("%s for %v", time.Since(start), debugStr) + }() return runCmdContext(ctx, cmd) } @@ -319,7 +341,7 @@ func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) { // Per https://pkg.go.dev/os#File.Close, the call to stdoutR.Close // should cause the Read call in io.Copy to unblock and return // immediately, but we still need to receive from stdoutErr to confirm - // that that has happened. + // that it has happened. <-stdoutErr err2 = ctx.Err() } @@ -333,7 +355,7 @@ func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) { // one goroutine at a time will call Write.” // // Since we're starting a goroutine that writes to cmd.Stdout, we must - // also update cmd.Stderr so that that still holds. + // also update cmd.Stderr so that it still holds. func() { defer func() { recover() }() if cmd.Stderr == prevStdout { @@ -343,6 +365,7 @@ func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) { } } + startTime := time.Now() err = cmd.Start() if stdoutW != nil { // The child process has inherited the pipe file, @@ -369,7 +392,7 @@ func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) { case err := <-resChan: return err case <-timer.C: - HandleHangingGoCommand(cmd.Process) + HandleHangingGoCommand(startTime, cmd) case <-ctx.Done(): } } else { @@ -403,7 +426,7 @@ func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) { return <-resChan } -func HandleHangingGoCommand(proc *os.Process) { +func HandleHangingGoCommand(start time.Time, cmd *exec.Cmd) { switch runtime.GOOS { case "linux", "darwin", "freebsd", "netbsd": fmt.Fprintln(os.Stderr, `DETECTED A HANGING GO COMMAND @@ -436,7 +459,7 @@ See golang/go#54461 for more details.`) panic(fmt.Sprintf("running %s: %v", listFiles, err)) } } - panic(fmt.Sprintf("detected hanging go command (pid %d): see golang/go#54461 for more details", proc.Pid)) + panic(fmt.Sprintf("detected hanging go command (golang/go#54461); waited %s\n\tcommand:%s\n\tpid:%d", time.Since(start), cmd, cmd.Process.Pid)) } func cmdDebugStr(cmd *exec.Cmd) string { @@ -460,3 +483,73 @@ func cmdDebugStr(cmd *exec.Cmd) string { } return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], strings.Join(args, " ")) } + +// WriteOverlays writes each value in the overlay (see the Overlay +// field of go/packages.Config) to a temporary file and returns the name +// of a JSON file describing the mapping that is suitable for the "go +// list -overlay" flag. +// +// On success, the caller must call the cleanup function exactly once +// when the files are no longer needed. +func WriteOverlays(overlay map[string][]byte) (filename string, cleanup func(), err error) { + // Do nothing if there are no overlays in the config. + if len(overlay) == 0 { + return "", func() {}, nil + } + + dir, err := os.MkdirTemp("", "gocommand-*") + if err != nil { + return "", nil, err + } + + // The caller must clean up this directory, + // unless this function returns an error. + // (The cleanup operand of each return + // statement below is ignored.) + defer func() { + cleanup = func() { + os.RemoveAll(dir) + } + if err != nil { + cleanup() + cleanup = nil + } + }() + + // Write each map entry to a temporary file. + overlays := make(map[string]string) + for k, v := range overlay { + // Use a unique basename for each file (001-foo.go), + // to avoid creating nested directories. + base := fmt.Sprintf("%d-%s", 1+len(overlays), filepath.Base(k)) + filename := filepath.Join(dir, base) + err := os.WriteFile(filename, v, 0666) + if err != nil { + return "", nil, err + } + overlays[k] = filename + } + + // Write the JSON overlay file that maps logical file names to temp files. + // + // OverlayJSON is the format overlay files are expected to be in. + // The Replace map maps from overlaid paths to replacement paths: + // the Go command will forward all reads trying to open + // each overlaid path to its replacement path, or consider the overlaid + // path not to exist if the replacement path is empty. + // + // From golang/go#39958. + type OverlayJSON struct { + Replace map[string]string `json:"replace,omitempty"` + } + b, err := json.Marshal(OverlayJSON{Replace: overlays}) + if err != nil { + return "", nil, err + } + filename = filepath.Join(dir, "overlay.json") + if err := os.WriteFile(filename, b, 0666); err != nil { + return "", nil, err + } + + return filename, nil, nil +} diff --git a/vendor/golang.org/x/tools/internal/gocommand/vendor.go b/vendor/golang.org/x/tools/internal/gocommand/vendor.go index 2d3d408c0b..e38d1fb488 100644 --- a/vendor/golang.org/x/tools/internal/gocommand/vendor.go +++ b/vendor/golang.org/x/tools/internal/gocommand/vendor.go @@ -107,3 +107,57 @@ func getMainModuleAnd114(ctx context.Context, inv Invocation, r *Runner) (*Modul } return mod, lines[4] == "go1.14", nil } + +// WorkspaceVendorEnabled reports whether workspace vendoring is enabled. It takes a *Runner to execute Go commands +// with the supplied context.Context and Invocation. The Invocation can contain pre-defined fields, +// of which only Verb and Args are modified to run the appropriate Go command. +// Inspired by setDefaultBuildMod in modload/init.go +func WorkspaceVendorEnabled(ctx context.Context, inv Invocation, r *Runner) (bool, []*ModuleJSON, error) { + inv.Verb = "env" + inv.Args = []string{"GOWORK"} + stdout, err := r.Run(ctx, inv) + if err != nil { + return false, nil, err + } + goWork := string(bytes.TrimSpace(stdout.Bytes())) + if fi, err := os.Stat(filepath.Join(filepath.Dir(goWork), "vendor")); err == nil && fi.IsDir() { + mainMods, err := getWorkspaceMainModules(ctx, inv, r) + if err != nil { + return false, nil, err + } + return true, mainMods, nil + } + return false, nil, nil +} + +// getWorkspaceMainModules gets the main modules' information. +// This is the information needed to figure out if vendoring should be enabled. +func getWorkspaceMainModules(ctx context.Context, inv Invocation, r *Runner) ([]*ModuleJSON, error) { + const format = `{{.Path}} +{{.Dir}} +{{.GoMod}} +{{.GoVersion}} +` + inv.Verb = "list" + inv.Args = []string{"-m", "-f", format} + stdout, err := r.Run(ctx, inv) + if err != nil { + return nil, err + } + + lines := strings.Split(strings.TrimSuffix(stdout.String(), "\n"), "\n") + if len(lines) < 4 { + return nil, fmt.Errorf("unexpected stdout: %q", stdout.String()) + } + mods := make([]*ModuleJSON, 0, len(lines)/4) + for i := 0; i < len(lines); i += 4 { + mods = append(mods, &ModuleJSON{ + Path: lines[i], + Dir: lines[i+1], + GoMod: lines[i+2], + GoVersion: lines[i+3], + Main: true, + }) + } + return mods, nil +} diff --git a/vendor/golang.org/x/tools/internal/gopathwalk/walk.go b/vendor/golang.org/x/tools/internal/gopathwalk/walk.go index 1684053226..8361515519 100644 --- a/vendor/golang.org/x/tools/internal/gopathwalk/walk.go +++ b/vendor/golang.org/x/tools/internal/gopathwalk/walk.go @@ -9,23 +9,27 @@ package gopathwalk import ( "bufio" "bytes" - "fmt" - "io/ioutil" - "log" + "io" + "io/fs" "os" "path/filepath" + "runtime" "strings" + "sync" "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 + + // Maximum number of concurrent calls to user-provided callbacks, + // or 0 for GOMAXPROCS. + Concurrency int } // RootType indicates the type of a Root. @@ -46,22 +50,28 @@ type Root struct { Type RootType } -// Walk walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. -// For each package found, add will be called (concurrently) with the absolute +// Walk concurrently walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. +// +// For each package found, add will be called with the absolute // paths of the containing source directory and the package directory. -// add will be called concurrently. +// +// Unlike filepath.WalkDir, Walk follows symbolic links +// (while guarding against cycles). 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 +// WalkSkip concurrently walks Go source directories ($GOROOT, $GOPATH, etc) to +// find packages. +// +// For each package found, add will be called 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) +// For each directory that will be scanned, skip will be called // 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. +// +// Unlike filepath.WalkDir, WalkSkip follows symbolic links +// (while guarding against cycles). 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) @@ -70,30 +80,51 @@ func WalkSkip(roots []Root, add func(root Root, dir string), skip func(root Root // 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 opts.Logf == nil { + opts.Logf = func(format string, args ...interface{}) {} + } if _, err := os.Stat(root.Path); os.IsNotExist(err) { - if opts.Logf != nil { - opts.Logf("skipping nonexistent directory: %v", root.Path) - } + opts.Logf("skipping nonexistent directory: %v", root.Path) return } start := time.Now() - if opts.Logf != nil { - opts.Logf("gopathwalk: scanning %s", root.Path) + opts.Logf("scanning %s", root.Path) + + concurrency := opts.Concurrency + if concurrency == 0 { + // The walk be either CPU-bound or I/O-bound, depending on what the + // caller-supplied add function does and the details of the user's platform + // and machine. Rather than trying to fine-tune the concurrency level for a + // specific environment, we default to GOMAXPROCS: it is likely to be a good + // choice for a CPU-bound add function, and if it is instead I/O-bound, then + // dealing with I/O saturation is arguably the job of the kernel and/or + // runtime. (Oversaturating I/O seems unlikely to harm performance as badly + // as failing to saturate would.) + concurrency = runtime.GOMAXPROCS(0) } w := &walker{ root: root, add: add, skip: skip, opts: opts, + sem: make(chan struct{}, concurrency), } 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)) + w.sem <- struct{}{} + path := root.Path + if path == "" { + path = "." + } + if fi, err := os.Lstat(path); err == nil { + w.walk(path, nil, fs.FileInfoToDirEntry(fi)) + } else { + w.opts.Logf("scanning directory %v: %v", root.Path, err) } + <-w.sem + w.walking.Wait() + + opts.Logf("scanned %s in %v", root.Path, time.Since(start)) } // walker is the callback for fastwalk.Walk. @@ -103,7 +134,18 @@ type walker struct { 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. + walking sync.WaitGroup + sem chan struct{} // Channel of semaphore tokens; send to acquire, receive to release. + ignoredDirs []string + + added sync.Map // map[string]bool +} + +// A symlinkList is a linked list of os.FileInfos for parent directories +// reached via symlinks. +type symlinkList struct { + info os.FileInfo + prev *symlinkList } // init initializes the walker based on its Options @@ -119,14 +161,8 @@ func (w *walker) init() { 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) - } + w.ignoredDirs = append(w.ignoredDirs, full) + w.opts.Logf("Directory added to ignore list: %s", full) } } @@ -135,13 +171,11 @@ func (w *walker) init() { // 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) - } + slurp, err := os.ReadFile(file) + if err != nil { + w.opts.Logf("%v", err) + } else { + w.opts.Logf("Read %s", file) } if err != nil { return nil @@ -160,9 +194,9 @@ func (w *walker) getIgnoredDirs(path string) []string { } // shouldSkipDir reports whether the file should be skipped or not. -func (w *walker) shouldSkipDir(fi os.FileInfo, dir string) bool { +func (w *walker) shouldSkipDir(dir string) bool { for _, ignoredDir := range w.ignoredDirs { - if os.SameFile(fi, ignoredDir) { + if dir == ignoredDir { return true } } @@ -174,81 +208,130 @@ func (w *walker) shouldSkipDir(fi os.FileInfo, dir string) bool { } // walk walks through the given path. -func (w *walker) walk(path string, typ os.FileMode) error { - if typ.IsRegular() { - dir := filepath.Dir(path) - 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 +// +// Errors are logged if w.opts.Logf is non-nil, but otherwise ignored. +func (w *walker) walk(path string, pathSymlinks *symlinkList, d fs.DirEntry) { + if d.Type()&os.ModeSymlink != 0 { + // Walk the symlink's target rather than the symlink itself. + // + // (Note that os.Stat, unlike the lower-lever os.Readlink, + // follows arbitrarily many layers of symlinks, so it will eventually + // reach either a non-symlink or a nonexistent target.) + // + // TODO(bcmills): 'go list all' itself ignores symlinks within GOROOT/src + // and GOPATH/src. Do we really need to traverse them here? If so, why? + + fi, err := os.Stat(path) + if err != nil { + w.opts.Logf("%v", err) + return } - 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 + // Avoid walking symlink cycles: if we have already followed a symlink to + // this directory as a parent of itself, don't follow it again. + // + // This doesn't catch the first time through a cycle, but it also minimizes + // the number of extra stat calls we make if we *don't* encounter a cycle. + // Since we don't actually expect to encounter symlink cycles in practice, + // this seems like the right tradeoff. + for parent := pathSymlinks; parent != nil; parent = parent.prev { + if os.SameFile(fi, parent.info) { + return + } } - fi, err := os.Lstat(path) - if err == nil && w.shouldSkipDir(fi, path) { - return filepath.SkipDir + + pathSymlinks = &symlinkList{ + info: fi, + prev: pathSymlinks, } - return nil + d = fs.FileInfoToDirEntry(fi) } - if typ == os.ModeSymlink { - base := filepath.Base(path) - if strings.HasPrefix(base, ".#") { - // Emacs noise. - return nil + + if d.Type().IsRegular() { + if !strings.HasSuffix(path, ".go") { + return } - if w.shouldTraverse(path) { - return fastwalk.ErrTraverseLink + + dir := filepath.Dir(path) + 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. + // + // TODO(bcmills): there are many levels of directory within + // RootModuleCache where this also wouldn't make sense, + // Can we generalize this to any directory without a corresponding + // import path? + return + } + + if _, dup := w.added.LoadOrStore(dir, true); !dup { + w.add(w.root, dir) } } - 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(path string) bool { - ts, err := os.Stat(path) - if err != nil { - fmt.Fprintln(os.Stderr, err) - return false + if !d.IsDir() { + return } - if !ts.IsDir() { - return false + + 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") || + w.shouldSkipDir(path) { + return } - if w.shouldSkipDir(ts, filepath.Dir(path)) { - return false + + // Read the directory and walk its entries. + + f, err := os.Open(path) + if err != nil { + w.opts.Logf("%v", err) + return } - // Check for symlink loops by statting each directory component - // and seeing if any are the same file as ts. + defer f.Close() + 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) + // We impose an arbitrary limit on the number of ReadDir results per + // directory to limit the amount of memory consumed for stale or upcoming + // directory entries. The limit trades off CPU (number of syscalls to read + // the whole directory) against RAM (reachable directory entries other than + // the one currently being processed). + // + // Since we process the directories recursively, we will end up maintaining + // a slice of entries for each level of the directory tree. + // (Compare https://go.dev/issue/36197.) + ents, err := f.ReadDir(1024) if err != nil { - return false + if err != io.EOF { + w.opts.Logf("%v", err) + } + break } - if os.SameFile(ts, parentInfo) { - // Cycle. Don't traverse. - return false + + for _, d := range ents { + nextPath := filepath.Join(path, d.Name()) + if d.IsDir() { + select { + case w.sem <- struct{}{}: + // Got a new semaphore token, so we can traverse the directory concurrently. + d := d + w.walking.Add(1) + go func() { + defer func() { + <-w.sem + w.walking.Done() + }() + w.walk(nextPath, pathSymlinks, d) + }() + continue + + default: + // No tokens available, so traverse serially. + } + } + + w.walk(nextPath, pathSymlinks, d) } - path = parent } - } diff --git a/vendor/golang.org/x/tools/internal/imports/fix.go b/vendor/golang.org/x/tools/internal/imports/fix.go index d4f1b4e8a0..dc7d50a7a4 100644 --- a/vendor/golang.org/x/tools/internal/imports/fix.go +++ b/vendor/golang.org/x/tools/internal/imports/fix.go @@ -13,6 +13,8 @@ import ( "go/build" "go/parser" "go/token" + "go/types" + "io/fs" "io/ioutil" "os" "path" @@ -25,10 +27,12 @@ import ( "unicode" "unicode/utf8" + "golang.org/x/sync/errgroup" "golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/internal/event" "golang.org/x/tools/internal/gocommand" "golang.org/x/tools/internal/gopathwalk" + "golang.org/x/tools/internal/stdlib" ) // importToGroup is a list of functions which map from an import path to @@ -101,19 +105,25 @@ type packageInfo struct { // 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 { +// +// It returns an error only if ctx is cancelled. Files with parse errors are +// ignored. +func parseOtherFiles(ctx context.Context, fset *token.FileSet, srcDir, filename string) ([]*ast.File, error) { // 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) + packageFileInfos, err := os.ReadDir(srcDir) if err != nil { - return nil + return nil, ctx.Err() } var files []*ast.File for _, fi := range packageFileInfos { + if ctx.Err() != nil { + return nil, ctx.Err() + } if fi.Name() == fileBase || !strings.HasSuffix(fi.Name(), ".go") { continue } @@ -129,7 +139,7 @@ func parseOtherFiles(fset *token.FileSet, srcDir, filename string) []*ast.File { files = append(files, f) } - return files + return files, ctx.Err() } // addGlobals puts the names of package vars into the provided map. @@ -253,7 +263,7 @@ type pass struct { otherFiles []*ast.File // sibling files. // Intermediate state, generated by load. - existingImports map[string]*ImportInfo + existingImports map[string][]*ImportInfo allRefs references missingRefs references @@ -298,6 +308,20 @@ func (p *pass) loadPackageNames(imports []*ImportInfo) error { return nil } +// if there is a trailing major version, remove it +func withoutVersion(nm string) string { + if v := path.Base(nm); len(v) > 0 && v[0] == 'v' { + if _, err := strconv.Atoi(v[1:]); err == nil { + // this is, for instance, called with rand/v2 and returns rand + if len(v) < len(nm) { + xnm := nm[:len(nm)-len(v)-1] + return path.Base(xnm) + } + } + } + return nm +} + // 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. @@ -307,7 +331,7 @@ func (p *pass) importIdentifier(imp *ImportInfo) string { } known := p.knownPackages[imp.ImportPath] if known != nil && known.name != "" { - return known.name + return withoutVersion(known.name) } return ImportPathToAssumedName(imp.ImportPath) } @@ -318,7 +342,7 @@ func (p *pass) importIdentifier(imp *ImportInfo) string { func (p *pass) load() ([]*ImportFix, bool) { p.knownPackages = map[string]*packageInfo{} p.missingRefs = references{} - p.existingImports = map[string]*ImportInfo{} + p.existingImports = map[string][]*ImportInfo{} // Load basic information about the file in question. p.allRefs = collectReferences(p.f) @@ -342,14 +366,12 @@ func (p *pass) load() ([]*ImportFix, bool) { 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) - } + p.env.logf("loading package names: %v", err) return nil, false } } for _, imp := range imports { - p.existingImports[p.importIdentifier(imp)] = imp + p.existingImports[p.importIdentifier(imp)] = append(p.existingImports[p.importIdentifier(imp)], imp) } // Find missing references. @@ -388,31 +410,33 @@ func (p *pass) fix() ([]*ImportFix, bool) { // 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 - } + for _, identifierImports := range p.existingImports { + for _, imp := range identifierImports { + // 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, - }) + // 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, + }) + } } } // Collecting fixes involved map iteration, so sort for stability. See @@ -507,9 +531,9 @@ func (p *pass) assumeSiblingImportsValid() { } for left, rights := range refs { if imp, ok := importsByName[left]; ok { - if m, ok := stdlib[imp.ImportPath]; ok { + if m, ok := stdlib.PackageSymbols[imp.ImportPath]; ok { // We have the stdlib in memory; no need to guess. - rights = copyExports(m) + rights = symbolNameSet(m) } p.addCandidate(imp, &packageInfo{ // no name; we already know it. @@ -541,6 +565,8 @@ func (p *pass) addCandidate(imp *ImportInfo, pkg *packageInfo) { // // This is declared as a variable rather than a function so goimports can // easily be extended by adding a file with an init function. +// +// DO NOT REMOVE: used internally at Google. var fixImports = fixImportsDefault func fixImportsDefault(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) error { @@ -560,9 +586,7 @@ func getFixes(ctx context.Context, fset *token.FileSet, f *ast.File, filename st return nil, err } srcDir := filepath.Dir(abs) - if env.Logf != nil { - env.Logf("fixImports(filename=%q), abs=%q, srcDir=%q ...", filename, abs, srcDir) - } + 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 @@ -573,7 +597,10 @@ func getFixes(ctx context.Context, fset *token.FileSet, f *ast.File, filename st return fixes, nil } - otherFiles := parseOtherFiles(fset, srcDir, filename) + otherFiles, err := parseOtherFiles(ctx, fset, srcDir, filename) + if err != nil { + return nil, err + } // Second pass: add information from other files in the same package, // like their package vars and imports. @@ -637,7 +664,7 @@ func getCandidatePkgs(ctx context.Context, wrappedCallback *scanCallback, filena dupCheck := map[string]struct{}{} // Start off with the standard library. - for importPath, exports := range stdlib { + for importPath, symbols := range stdlib.PackageSymbols { p := &pkg{ dir: filepath.Join(goenv["GOROOT"], "src", importPath), importPathShort: importPath, @@ -646,6 +673,13 @@ func getCandidatePkgs(ctx context.Context, wrappedCallback *scanCallback, filena } dupCheck[importPath] = struct{}{} if notSelf(p) && wrappedCallback.dirFound(p) && wrappedCallback.packageNameLoaded(p) { + var exports []stdlib.Symbol + for _, sym := range symbols { + switch sym.Kind { + case stdlib.Func, stdlib.Type, stdlib.Var, stdlib.Const: + exports = append(exports, sym) + } + } wrappedCallback.exportsLoaded(p, exports) } } @@ -666,7 +700,7 @@ func getCandidatePkgs(ctx context.Context, wrappedCallback *scanCallback, filena dupCheck[pkg.importPathShort] = struct{}{} return notSelf(pkg) && wrappedCallback.packageNameLoaded(pkg) }, - exportsLoaded: func(pkg *pkg, exports []string) { + exportsLoaded: func(pkg *pkg, exports []stdlib.Symbol) { // 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 @@ -697,20 +731,21 @@ func ScoreImportPaths(ctx context.Context, env *ProcessEnv, paths []string) (map return result, nil } -func PrimeCache(ctx context.Context, env *ProcessEnv) error { +func PrimeCache(ctx context.Context, resolver Resolver) error { // Fully scan the disk for directories, but don't actually read any Go files. callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true + rootFound: func(root gopathwalk.Root) bool { + // See getCandidatePkgs: walking GOROOT is apparently expensive and + // unnecessary. + return root.Type != gopathwalk.RootGOROOT }, dirFound: func(pkg *pkg) bool { return false }, - packageNameLoaded: func(pkg *pkg) bool { - return false - }, + // packageNameLoaded and exportsLoaded must never be called. } - return getCandidatePkgs(ctx, callback, "", "", env) + + return resolver.scan(ctx, callback) } func candidateImportName(pkg *pkg) string { @@ -790,7 +825,7 @@ func GetImportPaths(ctx context.Context, wrapped func(ImportFix), searchPrefix, // A PackageExport is a package and its exports. type PackageExport struct { Fix *ImportFix - Exports []string + Exports []stdlib.Symbol } // GetPackageExports returns all known packages with name pkg and their exports. @@ -805,8 +840,8 @@ func GetPackageExports(ctx context.Context, wrapped func(PackageExport), searchP packageNameLoaded: func(pkg *pkg) bool { return pkg.packageName == searchPkg }, - exportsLoaded: func(pkg *pkg, exports []string) { - sort.Strings(exports) + exportsLoaded: func(pkg *pkg, exports []stdlib.Symbol) { + sortSymbols(exports) wrapped(PackageExport{ Fix: &ImportFix{ StmtInfo: ImportInfo{ @@ -824,16 +859,45 @@ func GetPackageExports(ctx context.Context, wrapped func(PackageExport), searchP return getCandidatePkgs(ctx, callback, filename, filePkg, env) } -var requiredGoEnvVars = []string{"GO111MODULE", "GOFLAGS", "GOINSECURE", "GOMOD", "GOMODCACHE", "GONOPROXY", "GONOSUMDB", "GOPATH", "GOPROXY", "GOROOT", "GOSUMDB", "GOWORK"} +// TODO(rfindley): we should depend on GOOS and GOARCH, to provide accurate +// imports when doing cross-platform development. +var requiredGoEnvVars = []string{ + "GO111MODULE", + "GOFLAGS", + "GOINSECURE", + "GOMOD", + "GOMODCACHE", + "GONOPROXY", + "GONOSUMDB", + "GOPATH", + "GOPROXY", + "GOROOT", + "GOSUMDB", + "GOWORK", +} // ProcessEnv contains environment variables and settings that affect the use of // the go command, the go/build package, etc. +// +// ...a ProcessEnv *also* overwrites its Env along with derived state in the +// form of the resolver. And because it is lazily initialized, an env may just +// be broken and unusable, but there is no way for the caller to detect that: +// all queries will just fail. +// +// TODO(rfindley): refactor this package so that this type (perhaps renamed to +// just Env or Config) is an immutable configuration struct, to be exchanged +// for an initialized object via a constructor that returns an error. Perhaps +// the signature should be `func NewResolver(*Env) (*Resolver, error)`, where +// resolver is a concrete type used for resolving imports. Via this +// refactoring, we can avoid the need to call ProcessEnv.init and +// ProcessEnv.GoEnv everywhere, and implicitly fix all the places where this +// these are misused. Also, we'd delegate the caller the decision of how to +// handle a broken environment. type ProcessEnv struct { GocmdRunner *gocommand.Runner BuildFlags []string ModFlag string - ModFile string // SkipPathInScan returns true if the path should be skipped from scans of // the RootCurrentModule root type. The function argument is a clean, @@ -843,7 +907,7 @@ type ProcessEnv struct { // Env overrides the OS environment, and can be used to specify // GOPROXY, GO111MODULE, etc. PATH cannot be set here, because // exec.Command will not honor it. - // Specifying all of RequiredGoEnvVars avoids a call to `go env`. + // Specifying all of requiredGoEnvVars avoids a call to `go env`. Env map[string]string WorkingDir string @@ -851,9 +915,17 @@ type ProcessEnv struct { // If Logf is non-nil, debug logging is enabled through this function. Logf func(format string, args ...interface{}) - initialized bool + // If set, ModCache holds a shared cache of directory info to use across + // multiple ProcessEnvs. + ModCache *DirInfoCache + + initialized bool // see TODO above - resolver Resolver + // resolver and resolverErr are lazily evaluated (see GetResolver). + // This is unclean, but see the big TODO in the docstring for ProcessEnv + // above: for now, we can't be sure that the ProcessEnv is fully initialized. + resolver Resolver + resolverErr error } func (e *ProcessEnv) goEnv() (map[string]string, error) { @@ -933,20 +1005,43 @@ func (e *ProcessEnv) env() []string { } func (e *ProcessEnv) GetResolver() (Resolver, error) { - if e.resolver != nil { - return e.resolver, nil - } if err := e.init(); err != nil { return nil, err } - if len(e.Env["GOMOD"]) == 0 && len(e.Env["GOWORK"]) == 0 { - e.resolver = newGopathResolver(e) - return e.resolver, nil + + if e.resolver == nil && e.resolverErr == nil { + // TODO(rfindley): we should only use a gopathResolver here if the working + // directory is actually *in* GOPATH. (I seem to recall an open gopls issue + // for this behavior, but I can't find it). + // + // For gopls, we can optionally explicitly choose a resolver type, since we + // already know the view type. + if len(e.Env["GOMOD"]) == 0 && len(e.Env["GOWORK"]) == 0 { + e.resolver = newGopathResolver(e) + e.logf("created gopath resolver") + } else if r, err := newModuleResolver(e, e.ModCache); err != nil { + e.resolverErr = err + e.logf("failed to create module resolver: %v", err) + } else { + e.resolver = Resolver(r) + e.logf("created module resolver") + } + } + + return e.resolver, e.resolverErr +} + +// logf logs if e.Logf is non-nil. +func (e *ProcessEnv) logf(format string, args ...any) { + if e.Logf != nil { + e.Logf(format, args...) } - e.resolver = newModuleResolver(e) - return e.resolver, nil } +// buildContext returns the build.Context to use for matching files. +// +// TODO(rfindley): support dynamic GOOS, GOARCH here, when doing cross-platform +// development. func (e *ProcessEnv) buildContext() (*build.Context, error) { ctx := build.Default goenv, err := e.goEnv() @@ -996,24 +1091,40 @@ func addStdlibCandidates(pass *pass, refs references) error { if err != nil { return err } + localbase := func(nm string) string { + ans := path.Base(nm) + if ans[0] == 'v' { + // this is called, for instance, with math/rand/v2 and returns rand/v2 + if _, err := strconv.Atoi(ans[1:]); err == nil { + ix := strings.LastIndex(nm, ans) + more := path.Base(nm[:ix]) + ans = path.Join(more, ans) + } + } + return ans + } add := func(pkg string) { // Prevent self-imports. if path.Base(pkg) == pass.f.Name.Name && filepath.Join(goenv["GOROOT"], "src", pkg) == pass.srcDir { return } - exports := copyExports(stdlib[pkg]) + exports := symbolNameSet(stdlib.PackageSymbols[pkg]) pass.addCandidate( &ImportInfo{ImportPath: pkg}, - &packageInfo{name: path.Base(pkg), exports: exports}) + &packageInfo{name: localbase(pkg), exports: exports}) } for left := range refs { if left == "rand" { - // Make sure we try crypto/rand before math/rand. + // Make sure we try crypto/rand before any version of math/rand as both have Int() + // and our policy is to recommend crypto add("crypto/rand") - add("math/rand") + // if the user's no later than go1.21, this should be "math/rand" + // but we have no way of figuring out what the user is using + // TODO: investigate using the toolchain version to disambiguate in the stdlib + add("math/rand/v2") continue } - for importPath := range stdlib { + for importPath := range stdlib.PackageSymbols { if path.Base(importPath) == left { add(importPath) } @@ -1026,15 +1137,23 @@ func addStdlibCandidates(pass *pass, refs references) error { 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) + + // loadExports returns the package name and set of exported symbols in the + // package at dir. loadExports may be called concurrently. + loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []stdlib.Symbol, error) + // scoreImportPath returns the relevance for an import path. scoreImportPath(ctx context.Context, path string) float64 - ClearForNewScan() + // ClearForNewScan returns a new Resolver based on the receiver that has + // cleared its internal caches of directory contents. + // + // The new resolver should be primed and then set via + // [ProcessEnv.UpdateResolver]. + ClearForNewScan() Resolver } // A scanCallback controls a call to scan and receives its results. @@ -1053,7 +1172,7 @@ type scanCallback struct { // 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) + exportsLoaded func(pkg *pkg, exports []stdlib.Symbol) } func addExternalCandidates(ctx context.Context, pass *pass, refs references, filename string) error { @@ -1091,7 +1210,7 @@ func addExternalCandidates(ctx context.Context, pass *pass, refs references, fil if err != nil { return err } - if err = resolver.scan(context.Background(), callback); err != nil { + if err = resolver.scan(ctx, callback); err != nil { return err } @@ -1100,57 +1219,66 @@ func addExternalCandidates(ctx context.Context, pass *pass, refs references, fil imp *ImportInfo pkg *packageInfo } - results := make(chan result, len(refs)) + results := make([]*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() + g, ctx := errgroup.WithContext(ctx) + + searcher := symbolSearcher{ + logf: pass.env.logf, + srcDir: pass.srcDir, + xtest: strings.HasSuffix(pass.f.Name.Name, "_test"), + loadExports: resolver.loadExports, + } - found, err := findImport(ctx, pass, found[pkgName], pkgName, symbols, filename) + i := 0 + for pkgName, symbols := range refs { + index := i // claim an index in results + i++ + pkgName := pkgName + symbols := symbols + g.Go(func() error { + found, err := searcher.search(ctx, found[pkgName], pkgName, symbols) if err != nil { - firstErrOnce.Do(func() { - firstErr = err - cancel() - }) - return + return err } - if found == nil { - return // No matching package. + return nil // No matching package. } imp := &ImportInfo{ ImportPath: found.importPathShort, } - pkg := &packageInfo{ name: pkgName, exports: symbols, } - results <- result{imp, pkg} - }(pkgName, symbols) + results[index] = &result{imp, pkg} + return nil + }) + } + if err := g.Wait(); err != nil { + return err } - go func() { - wg.Wait() - close(results) - }() - for result := range results { + for _, result := range results { + if result == nil { + continue + } + // Don't offer completions that would shadow predeclared + // names, such as github.com/coreos/etcd/error. + if types.Universe.Lookup(result.pkg.name) != nil { // predeclared + // Ideally we would skip this candidate only + // if the predeclared name is actually + // referenced by the file, but that's a lot + // trickier to compute and would still create + // an import that is likely to surprise the + // user before long. + continue + } pass.addCandidate(result.imp, result.pkg) } - return firstErr + return nil } // notIdentifier reports whether ch is an invalid identifier character. @@ -1190,31 +1318,22 @@ func ImportPathToAssumedName(importPath string) string { type gopathResolver struct { env *ProcessEnv walked bool - cache *dirInfoCache + 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{}, - }, + env: env, + cache: NewDirInfoCache(), 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) ClearForNewScan() Resolver { + return newGopathResolver(r.env) } func (r *gopathResolver) loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) { @@ -1232,7 +1351,7 @@ func (r *gopathResolver) loadPackageNames(importPaths []string, srcDir string) ( // importPathToName finds out the actual package name, as declared in its .go files. func importPathToName(bctx *build.Context, importPath, srcDir string) string { // Fast path for standard library without going to disk. - if _, ok := stdlib[importPath]; ok { + if stdlib.HasPackage(importPath) { return path.Base(importPath) // stdlib packages always match their paths. } @@ -1430,7 +1549,7 @@ func (r *gopathResolver) scan(ctx context.Context, callback *scanCallback) error } func (r *gopathResolver) scoreImportPath(ctx context.Context, path string) float64 { - if _, ok := stdlib[path]; ok { + if stdlib.HasPackage(path) { return MaxRelevance } return MaxRelevance - 1 @@ -1447,7 +1566,7 @@ func filterRoots(roots []gopathwalk.Root, include func(gopathwalk.Root) bool) [] return result } -func (r *gopathResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) { +func (r *gopathResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []stdlib.Symbol, error) { if info, ok := r.cache.Load(pkg.dir); ok && !includeTest { return r.cache.CacheExports(ctx, r.env, info) } @@ -1467,13 +1586,13 @@ func VendorlessPath(ipath string) string { return ipath } -func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, includeTest bool) (string, []string, error) { +func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, includeTest bool) (string, []stdlib.Symbol, error) { // Look for non-test, buildable .go files which could provide exports. - all, err := ioutil.ReadDir(dir) + all, err := os.ReadDir(dir) if err != nil { return "", nil, err } - var files []os.FileInfo + var files []fs.DirEntry for _, fi := range all { name := fi.Name() if !strings.HasSuffix(name, ".go") || (!includeTest && strings.HasSuffix(name, "_test.go")) { @@ -1491,7 +1610,7 @@ func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, incl } var pkgName string - var exports []string + var exports []stdlib.Symbol fset := token.NewFileSet() for _, fi := range files { select { @@ -1503,9 +1622,7 @@ func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, incl fullFile := filepath.Join(dir, fi.Name()) f, err := parser.ParseFile(fset, fullFile, nil, 0) if err != nil { - if env.Logf != nil { - env.Logf("error parsing %v: %v", fullFile, err) - } + env.logf("error parsing %v: %v", fullFile, err) continue } if f.Name.Name == "documentation" { @@ -1518,40 +1635,72 @@ func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, incl continue } pkgName = f.Name.Name - for name := range f.Scope.Objects { + for name, obj := range f.Scope.Objects { if ast.IsExported(name) { - exports = append(exports, name) + var kind stdlib.Kind + switch obj.Kind { + case ast.Con: + kind = stdlib.Const + case ast.Typ: + kind = stdlib.Type + case ast.Var: + kind = stdlib.Var + case ast.Fun: + kind = stdlib.Func + } + exports = append(exports, stdlib.Symbol{ + Name: name, + Kind: kind, + Version: 0, // unknown; be permissive + }) } } } + sortSymbols(exports) - 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, ", ")) - } + env.logf("loaded exports in dir %v (package %v): %v", dir, pkgName, exports) 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) { +func sortSymbols(syms []stdlib.Symbol) { + sort.Slice(syms, func(i, j int) bool { + return syms[i].Name < syms[j].Name + }) +} + +// A symbolSearcher searches for a package with a set of symbols, among a set +// of candidates. See [symbolSearcher.search]. +// +// The search occurs within the scope of a single file, with context captured +// in srcDir and xtest. +type symbolSearcher struct { + logf func(string, ...any) + srcDir string // directory containing the file + xtest bool // if set, the file containing is an x_test file + loadExports func(ctx context.Context, pkg *pkg, includeTest bool) (string, []stdlib.Symbol, error) +} + +// search searches the provided candidates for a package containing all +// exported symbols. +// +// If successful, returns the resulting package. +func (s *symbolSearcher) search(ctx context.Context, candidates []pkgDistance, pkgName string, symbols map[string]bool) (*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 { + if s.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) + s.logf("%s candidate %d/%d: %v in %v", pkgName, i+1, len(candidates), c.pkg.importPathShort, c.pkg.dir) } } - resolver, err := pass.env.GetResolver() - if err != nil { - return nil, err - } - // Collect exports for packages with matching names. + // Arrange rescv so that we can we can await results in order of relevance + // and exit as soon as we find the first match. + // + // Search with bounded concurrency, returning as soon as the first result + // among rescv is non-nil. rescv := make([]chan *pkg, len(candidates)) for i := range candidates { rescv[i] = make(chan *pkg, 1) @@ -1559,6 +1708,7 @@ func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgNa const maxConcurrentPackageImport = 4 loadExportsSem := make(chan struct{}, maxConcurrentPackageImport) + // Ensure that all work is completed at exit. ctx, cancel := context.WithCancel(ctx) var wg sync.WaitGroup defer func() { @@ -1566,6 +1716,7 @@ func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgNa wg.Wait() }() + // Start the search. wg.Add(1) go func() { defer wg.Done() @@ -1576,55 +1727,67 @@ func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgNa return } + i := i + c := c wg.Add(1) - go func(c pkgDistance, resc chan<- *pkg) { + go func() { 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 s.logf != nil { + s.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 := resolver.loadExports(ctx, c.pkg, includeTest) + pkg, err := s.searchOne(ctx, c, symbols) 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 + if s.logf != nil && ctx.Err() == nil { + s.logf("loading exports in dir %s (seeking package %s): %v", c.pkg.dir, pkgName, err) } + pkg = nil } - resc <- c.pkg - }(c, rescv[i]) + rescv[i] <- pkg // may be nil + }() } }() + // Await the first (best) result. for _, resc := range rescv { - pkg := <-resc - if pkg == nil { - continue + select { + case r := <-resc: + if r != nil { + return r, nil + } + case <-ctx.Done(): + return nil, ctx.Err() } - return pkg, nil } return nil, nil } +func (s *symbolSearcher) searchOne(ctx context.Context, c pkgDistance, symbols map[string]bool) (*pkg, error) { + if ctx.Err() != nil { + return nil, ctx.Err() + } + // If we're considering the package under test from an x_test, load the + // test variant. + includeTest := s.xtest && c.pkg.dir == s.srcDir + _, exports, err := s.loadExports(ctx, c.pkg, includeTest) + if err != nil { + return nil, err + } + + exportsMap := make(map[string]bool, len(exports)) + for _, sym := range exports { + exportsMap[sym.Name] = true + } + for symbol := range symbols { + if !exportsMap[symbol] { + return nil, nil // no match + } + } + return c.pkg, 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. @@ -1644,58 +1807,24 @@ func pkgIsCandidate(filename string, refs references, pkg *pkg) bool { } // 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. + // Use the matchesPath heuristic to filter to package paths that could + // reasonably match a dangling reference. + // + // 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) { + if matchesPath(pkgIdent, pkg.importPathShort) { 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 { @@ -1736,19 +1865,84 @@ func canUse(filename, dir string) bool { 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 { +// matchesPath reports whether ident may match a potential package name +// referred to by path, using heuristics to filter out unidiomatic package +// names. +// +// Specifically, it checks whether either of the last two '/'- or '\'-delimited +// path segments matches the identifier. The segment-matching heuristic must +// allow for various conventions around segment naming, including go-foo, +// foo-go, and foo.v3. To handle all of these, matching considers both (1) the +// entire segment, ignoring '-' and '.', as well as (2) the last subsegment +// separated by '-' or '.'. So the segment foo-go matches all of the following +// identifiers: foo, go, and foogo. All matches are case insensitive (for ASCII +// identifiers). +// +// See the docstring for [pkgIsCandidate] for an explanation of how this +// heuristic filters potential candidate packages. +func matchesPath(ident, path string) bool { + // Ignore case, for ASCII. + lowerIfASCII := func(b byte) byte { + if 'A' <= b && b <= 'Z' { + return b + ('a' - 'A') + } + return b + } + + // match reports whether path[start:end] matches ident, ignoring [.-]. + match := func(start, end int) bool { + ii := len(ident) - 1 // current byte in ident + pi := end - 1 // current byte in path + for ; pi >= start && ii >= 0; pi-- { + pb := path[pi] + if pb == '-' || pb == '.' { + continue + } + pb = lowerIfASCII(pb) + ib := lowerIfASCII(ident[ii]) + if pb != ib { + return false + } + ii-- + } + return ii < 0 && pi < start // all bytes matched + } + + // segmentEnd and subsegmentEnd hold the end points of the current segment + // and subsegment intervals. + segmentEnd := len(path) + subsegmentEnd := len(path) + + // Count slashes; we only care about the last two segments. nslash := 0 - for i := len(v) - 1; i >= 0; i-- { - if v[i] == '/' || v[i] == '\\' { + + for i := len(path) - 1; i >= 0; i-- { + switch b := path[i]; b { + // TODO(rfindley): we handle backlashes here only because the previous + // heuristic handled backslashes. This is perhaps overly defensive, but is + // the result of many lessons regarding Chesterton's fence and the + // goimports codebase. + // + // However, this function is only ever called with something called an + // 'importPath'. Is it possible that this is a real import path, and + // therefore we need only consider forward slashes? + case '/', '\\': + if match(i+1, segmentEnd) || match(i+1, subsegmentEnd) { + return true + } nslash++ if nslash == 2 { - return v[i:] + return false // did not match above + } + segmentEnd, subsegmentEnd = i, i // reset + case '-', '.': + if match(i+1, subsegmentEnd) { + return true } + subsegmentEnd = i } } - return v + return match(0, segmentEnd) || match(0, subsegmentEnd) } type visitFn func(node ast.Node) ast.Visitor @@ -1757,10 +1951,13 @@ 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 +func symbolNameSet(symbols []stdlib.Symbol) map[string]bool { + names := make(map[string]bool) + for _, sym := range symbols { + switch sym.Kind { + case stdlib.Const, stdlib.Var, stdlib.Type, stdlib.Func: + names[sym.Name] = true + } } - return m + return names } diff --git a/vendor/golang.org/x/tools/internal/imports/imports.go b/vendor/golang.org/x/tools/internal/imports/imports.go index 58e637b90f..f83465520a 100644 --- a/vendor/golang.org/x/tools/internal/imports/imports.go +++ b/vendor/golang.org/x/tools/internal/imports/imports.go @@ -2,8 +2,6 @@ // 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 @@ -109,7 +107,7 @@ func ApplyFixes(fixes []*ImportFix, filename string, src []byte, opt *Options, e } // formatFile formats the file syntax tree. -// It may mutate the token.FileSet. +// It may mutate the token.FileSet and the ast.File. // // If an adjust function is provided, it is called after formatting // with the original source (formatFile's src parameter) and the @@ -236,7 +234,7 @@ func parse(fset *token.FileSet, filename string, src []byte, opt *Options) (*ast 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) + src = bytes.ReplaceAll(src, []byte("\n\t"), []byte("\n")) return matchSpace(orig, src) } return file, adjust, nil diff --git a/vendor/golang.org/x/tools/internal/imports/mod.go b/vendor/golang.org/x/tools/internal/imports/mod.go index 1389d38b21..91221fda32 100644 --- a/vendor/golang.org/x/tools/internal/imports/mod.go +++ b/vendor/golang.org/x/tools/internal/imports/mod.go @@ -9,7 +9,6 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" "os" "path" "path/filepath" @@ -22,78 +21,138 @@ import ( "golang.org/x/tools/internal/event" "golang.org/x/tools/internal/gocommand" "golang.org/x/tools/internal/gopathwalk" + "golang.org/x/tools/internal/stdlib" ) -// ModuleResolver implements resolver for modules using the go command as little -// as feasible. +// Notes(rfindley): ModuleResolver appears to be heavily optimized for scanning +// as fast as possible, which is desirable for a call to goimports from the +// command line, but it doesn't work as well for gopls, where it suffers from +// slow startup (golang/go#44863) and intermittent hanging (golang/go#59216), +// both caused by populating the cache, albeit in slightly different ways. +// +// A high level list of TODOs: +// - Optimize the scan itself, as there is some redundancy statting and +// reading go.mod files. +// - Invert the relationship between ProcessEnv and Resolver (see the +// docstring of ProcessEnv). +// - Make it easier to use an external resolver implementation. +// +// Smaller TODOs are annotated in the code below. + +// ModuleResolver implements the Resolver interface for a workspace using +// modules. +// +// A goal of the ModuleResolver is to invoke the Go command as little as +// possible. To this end, it runs the Go command only for listing module +// information (i.e. `go list -m -e -json ...`). Package scanning, the process +// of loading package information for the modules, is implemented internally +// via the scan method. +// +// It has two types of state: the state derived from the go command, which +// is populated by init, and the state derived from scans, which is populated +// via scan. A root is considered scanned if it has been walked to discover +// directories. However, if the scan did not require additional information +// from the directory (such as package name or exports), the directory +// information itself may be partially populated. It will be lazily filled in +// as needed by scans, using the scanCallback. type ModuleResolver struct { - env *ProcessEnv - moduleCacheDir string - dummyVendorMod *gocommand.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 - mains []*gocommand.ModuleJSON - mainByDir map[string]*gocommand.ModuleJSON - modsByModPath []*gocommand.ModuleJSON // All modules, ordered by # of path components in module Path... - modsByDir []*gocommand.ModuleJSON // ...or Dir. - - // moduleCacheCache stores information about the module cache. - moduleCacheCache *dirInfoCache - otherCache *dirInfoCache + env *ProcessEnv + + // Module state, populated during construction + dummyVendorMod *gocommand.ModuleJSON // if vendoring is enabled, a pseudo-module to represent the /vendor directory + moduleCacheDir string // GOMODCACHE, inferred from GOPATH if unset + roots []gopathwalk.Root // roots to scan, in approximate order of importance + mains []*gocommand.ModuleJSON // main modules + mainByDir map[string]*gocommand.ModuleJSON // module information by dir, to join with roots + modsByModPath []*gocommand.ModuleJSON // all modules, ordered by # of path components in their module path + modsByDir []*gocommand.ModuleJSON // ...or by the number of path components in their Dir. + + // Scanning state, populated by scan + + // scanSema prevents concurrent scans, and guards scannedRoots and the cache + // fields below (though the caches themselves are concurrency safe). + // Receive to acquire, send to release. + scanSema chan struct{} + scannedRoots map[gopathwalk.Root]bool // if true, root has been walked + + // Caches of directory info, populated by scans and scan callbacks + // + // moduleCacheCache stores cached information about roots in the module + // cache, which are immutable and therefore do not need to be invalidated. + // + // otherCache stores information about all other roots (even GOROOT), which + // may change. + moduleCacheCache *DirInfoCache + otherCache *DirInfoCache } -func newModuleResolver(e *ProcessEnv) *ModuleResolver { +// newModuleResolver returns a new module-aware goimports resolver. +// +// Note: use caution when modifying this constructor: changes must also be +// reflected in ModuleResolver.ClearForNewScan. +func newModuleResolver(e *ProcessEnv, moduleCacheCache *DirInfoCache) (*ModuleResolver, error) { r := &ModuleResolver{ env: e, scanSema: make(chan struct{}, 1), } - r.scanSema <- struct{}{} - return r -} - -func (r *ModuleResolver) init() error { - if r.initialized { - return nil - } + r.scanSema <- struct{}{} // release goenv, err := r.env.goEnv() if err != nil { - return err + return nil, err } + + // TODO(rfindley): can we refactor to share logic with r.env.invokeGo? inv := gocommand.Invocation{ BuildFlags: r.env.BuildFlags, ModFlag: r.env.ModFlag, - ModFile: r.env.ModFile, Env: r.env.env(), Logf: r.env.Logf, WorkingDir: r.env.WorkingDir, } vendorEnabled := false - var mainModVendor *gocommand.ModuleJSON - - // Module vendor directories are ignored in workspace mode: - // https://go.googlesource.com/proposal/+/master/design/45713-workspace.md - if len(r.env.Env["GOWORK"]) == 0 { + var mainModVendor *gocommand.ModuleJSON // for module vendoring + var mainModsVendor []*gocommand.ModuleJSON // for workspace vendoring + + goWork := r.env.Env["GOWORK"] + if len(goWork) == 0 { + // TODO(rfindley): VendorEnabled runs the go command to get GOFLAGS, but + // they should be available from the ProcessEnv. Can we avoid the redundant + // invocation? vendorEnabled, mainModVendor, err = gocommand.VendorEnabled(context.TODO(), inv, r.env.GocmdRunner) if err != nil { - return err + return nil, err + } + } else { + vendorEnabled, mainModsVendor, err = gocommand.WorkspaceVendorEnabled(context.Background(), inv, r.env.GocmdRunner) + if err != nil { + return nil, err } } - if mainModVendor != nil && vendorEnabled { - // Vendor mode is on, so all the non-Main modules are irrelevant, - // and we need to search /vendor for everything. - r.mains = []*gocommand.ModuleJSON{mainModVendor} - r.dummyVendorMod = &gocommand.ModuleJSON{ - Path: "", - Dir: filepath.Join(mainModVendor.Dir, "vendor"), + if vendorEnabled { + if mainModVendor != nil { + // Module vendor mode is on, so all the non-Main modules are irrelevant, + // and we need to search /vendor for everything. + r.mains = []*gocommand.ModuleJSON{mainModVendor} + r.dummyVendorMod = &gocommand.ModuleJSON{ + Path: "", + Dir: filepath.Join(mainModVendor.Dir, "vendor"), + } + r.modsByModPath = []*gocommand.ModuleJSON{mainModVendor, r.dummyVendorMod} + r.modsByDir = []*gocommand.ModuleJSON{mainModVendor, r.dummyVendorMod} + } else { + // Workspace vendor mode is on, so all the non-Main modules are irrelevant, + // and we need to search /vendor for everything. + r.mains = mainModsVendor + r.dummyVendorMod = &gocommand.ModuleJSON{ + Path: "", + Dir: filepath.Join(filepath.Dir(goWork), "vendor"), + } + r.modsByModPath = append(append([]*gocommand.ModuleJSON{}, mainModsVendor...), r.dummyVendorMod) + r.modsByDir = append(append([]*gocommand.ModuleJSON{}, mainModsVendor...), r.dummyVendorMod) } - r.modsByModPath = []*gocommand.ModuleJSON{mainModVendor, r.dummyVendorMod} - r.modsByDir = []*gocommand.ModuleJSON{mainModVendor, r.dummyVendorMod} } else { // Vendor mode is off, so run go list -m ... to find everything. err := r.initAllMods() @@ -101,19 +160,14 @@ func (r *ModuleResolver) init() error { // GO111MODULE=on. Other errors are fatal. if err != nil { if errMsg := err.Error(); !strings.Contains(errMsg, "working directory is not part of a module") && !strings.Contains(errMsg, "go.mod file not found") { - return err + return nil, err } } } - if gmc := r.env.Env["GOMODCACHE"]; gmc != "" { - r.moduleCacheDir = gmc - } else { - gopaths := filepath.SplitList(goenv["GOPATH"]) - if len(gopaths) == 0 { - return fmt.Errorf("empty GOPATH") - } - r.moduleCacheDir = filepath.Join(gopaths[0], "/pkg/mod") + r.moduleCacheDir = gomodcacheForEnv(goenv) + if r.moduleCacheDir == "" { + return nil, fmt.Errorf("cannot resolve GOMODCACHE") } sort.Slice(r.modsByModPath, func(i, j int) bool { @@ -124,13 +178,14 @@ func (r *ModuleResolver) init() error { }) sort.Slice(r.modsByDir, func(i, j int) bool { count := func(x int) int { - return strings.Count(r.modsByDir[x].Dir, "/") + return strings.Count(r.modsByDir[x].Dir, string(filepath.Separator)) } return count(j) < count(i) // descending order }) - r.roots = []gopathwalk.Root{ - {Path: filepath.Join(goenv["GOROOT"], "/src"), Type: gopathwalk.RootGOROOT}, + r.roots = []gopathwalk.Root{} + if goenv["GOROOT"] != "" { // "" happens in tests + r.roots = append(r.roots, gopathwalk.Root{Path: filepath.Join(goenv["GOROOT"], "/src"), Type: gopathwalk.RootGOROOT}) } r.mainByDir = make(map[string]*gocommand.ModuleJSON) for _, main := range r.mains { @@ -142,7 +197,11 @@ func (r *ModuleResolver) init() error { } else { addDep := func(mod *gocommand.ModuleJSON) { if mod.Replace == nil { - // This is redundant with the cache, but we'll skip it cheaply enough. + // This is redundant with the cache, but we'll skip it cheaply enough + // when we encounter it in the module cache scan. + // + // Including it at a lower index in r.roots than the module cache dir + // helps prioritize matches from within existing dependencies. r.roots = append(r.roots, gopathwalk.Root{Path: mod.Dir, Type: gopathwalk.RootModuleCache}) } else { r.roots = append(r.roots, gopathwalk.Root{Path: mod.Dir, Type: gopathwalk.RootOther}) @@ -159,24 +218,40 @@ func (r *ModuleResolver) init() error { addDep(mod) } } + // If provided, share the moduleCacheCache. + // + // TODO(rfindley): The module cache is immutable. However, the loaded + // exports do depend on GOOS and GOARCH. Fortunately, the + // ProcessEnv.buildContext does not adjust these from build.DefaultContext + // (even though it should). So for now, this is OK to share, but we need to + // add logic for handling GOOS/GOARCH. + r.moduleCacheCache = moduleCacheCache r.roots = append(r.roots, gopathwalk.Root{Path: r.moduleCacheDir, Type: 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.moduleCacheCache = NewDirInfoCache() } - r.initialized = true - return nil + r.otherCache = NewDirInfoCache() + return r, nil +} + +// gomodcacheForEnv returns the GOMODCACHE value to use based on the given env +// map, which must have GOMODCACHE and GOPATH populated. +// +// TODO(rfindley): this is defensive refactoring. +// 1. Is this even relevant anymore? Can't we just read GOMODCACHE. +// 2. Use this to separate module cache scanning from other scanning. +func gomodcacheForEnv(goenv map[string]string) string { + if gmc := goenv["GOMODCACHE"]; gmc != "" { + return gmc + } + gopaths := filepath.SplitList(goenv["GOPATH"]) + if len(gopaths) == 0 { + return "" + } + return filepath.Join(gopaths[0], "/pkg/mod") } func (r *ModuleResolver) initAllMods() error { @@ -190,9 +265,7 @@ func (r *ModuleResolver) initAllMods() error { 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) - } + 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 } @@ -207,30 +280,86 @@ func (r *ModuleResolver) initAllMods() error { 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{}, +// ClearForNewScan invalidates the last scan. +// +// It preserves the set of roots, but forgets about the set of directories. +// Though it forgets the set of module cache directories, it remembers their +// contents, since they are assumed to be immutable. +func (r *ModuleResolver) ClearForNewScan() Resolver { + <-r.scanSema // acquire r, to guard scannedRoots + r2 := &ModuleResolver{ + env: r.env, + dummyVendorMod: r.dummyVendorMod, + moduleCacheDir: r.moduleCacheDir, + roots: r.roots, + mains: r.mains, + mainByDir: r.mainByDir, + modsByModPath: r.modsByModPath, + + scanSema: make(chan struct{}, 1), + scannedRoots: make(map[gopathwalk.Root]bool), + otherCache: NewDirInfoCache(), + moduleCacheCache: r.moduleCacheCache, } - r.scanSema <- struct{}{} + r2.scanSema <- struct{}{} // r2 must start released + // Invalidate root scans. We don't need to invalidate module cache roots, + // because they are immutable. + // (We don't support a use case where GOMODCACHE is cleaned in the middle of + // e.g. a gopls session: the user must restart gopls to get accurate + // imports.) + // + // Scanning for new directories in GOMODCACHE should be handled elsewhere, + // via a call to ScanModuleCache. + for _, root := range r.roots { + if root.Type == gopathwalk.RootModuleCache && r.scannedRoots[root] { + r2.scannedRoots[root] = true + } + } + r.scanSema <- struct{}{} // release r + return r2 } -func (r *ModuleResolver) ClearForNewMod() { - <-r.scanSema - *r = ModuleResolver{ - env: r.env, - moduleCacheCache: r.moduleCacheCache, - otherCache: r.otherCache, - scanSema: r.scanSema, +// ClearModuleInfo invalidates resolver state that depends on go.mod file +// contents (essentially, the output of go list -m -json ...). +// +// Notably, it does not forget directory contents, which are reset +// asynchronously via ClearForNewScan. +// +// If the ProcessEnv is a GOPATH environment, ClearModuleInfo is a no op. +// +// TODO(rfindley): move this to a new env.go, consolidating ProcessEnv methods. +func (e *ProcessEnv) ClearModuleInfo() { + if r, ok := e.resolver.(*ModuleResolver); ok { + resolver, err := newModuleResolver(e, e.ModCache) + if err != nil { + e.resolver = nil + e.resolverErr = err + return + } + + <-r.scanSema // acquire (guards caches) + resolver.moduleCacheCache = r.moduleCacheCache + resolver.otherCache = r.otherCache + r.scanSema <- struct{}{} // release + + e.UpdateResolver(resolver) } - 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. +// UpdateResolver sets the resolver for the ProcessEnv to use in imports +// operations. Only for use with the result of [Resolver.ClearForNewScan]. +// +// TODO(rfindley): this awkward API is a result of the (arguably) inverted +// relationship between configuration and state described in the doc comment +// for [ProcessEnv]. +func (e *ProcessEnv) UpdateResolver(r Resolver) { + e.resolver = r + e.resolverErr = nil +} + +// findPackage returns the module and directory from within the main modules +// and their dependencies that contains the package at the given import path, +// or returns nil, "" if no module is in scope. func (r *ModuleResolver) findPackage(importPath string) (*gocommand.ModuleJSON, string) { // This can't find packages in the stdlib, but that's harmless for all // the existing code paths. @@ -265,7 +394,7 @@ func (r *ModuleResolver) findPackage(importPath string) (*gocommand.ModuleJSON, } // Not cached. Read the filesystem. - pkgFiles, err := ioutil.ReadDir(pkgDir) + pkgFiles, err := os.ReadDir(pkgDir) if err != nil { continue } @@ -296,10 +425,6 @@ func (r *ModuleResolver) cacheStore(info directoryPackageInfo) { } } -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 { @@ -308,7 +433,7 @@ func (r *ModuleResolver) cachePackageName(info directoryPackageInfo) (string, er return r.otherCache.CachePackageName(info) } -func (r *ModuleResolver) cacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { +func (r *ModuleResolver) cacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []stdlib.Symbol, error) { if info.rootType == gopathwalk.RootModuleCache { return r.moduleCacheCache.CacheExports(ctx, env, info) } @@ -328,6 +453,10 @@ func (r *ModuleResolver) findModuleByDir(dir string) *gocommand.ModuleJSON { // - in /vendor/ in -mod=vendor mode. // - nested module? Dunno. // Rumor has it that replace targets cannot contain other replace targets. + // + // Note that it is critical here that modsByDir is sorted to have deeper dirs + // first. This ensures that findModuleByDir finds the innermost module. + // See also golang/go#56291. for _, m := range r.modsByDir { if !strings.HasPrefix(dir, m.Dir) { continue @@ -364,15 +493,15 @@ func (r *ModuleResolver) dirIsNestedModule(dir string, mod *gocommand.ModuleJSON 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) +func readModName(modFile string) string { + modBytes, err := os.ReadFile(modFile) + if err != nil { + return "" } + return modulePath(modBytes) +} +func (r *ModuleResolver) modInfo(dir string) (modDir, modName string) { if r.dirInModuleCache(dir) { if matches := modCacheRegexp.FindStringSubmatch(dir); len(matches) == 3 { index := strings.Index(dir, matches[1]+"@"+matches[2]) @@ -406,11 +535,9 @@ func (r *ModuleResolver) dirInModuleCache(dir string) bool { } 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 { + // TODO(rfindley): shouldn't this use the dirInfoCache? _, packageDir := r.findPackage(path) if packageDir == "" { continue @@ -428,10 +555,6 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error ctx, done := event.Start(ctx, "imports.ModuleResolver.scan") defer done() - 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 { @@ -441,18 +564,18 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error 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 @@ -491,7 +614,6 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error 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)) } @@ -506,9 +628,9 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error select { case <-ctx.Done(): return - case <-r.scanSema: + case <-r.scanSema: // acquire } - defer func() { r.scanSema <- struct{}{} }() + defer func() { r.scanSema <- struct{}{} }() // release // We have the lock on r.scannedRoots, and no other scans can run. for _, root := range roots { if ctx.Err() != nil { @@ -531,7 +653,7 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error } func (r *ModuleResolver) scoreImportPath(ctx context.Context, path string) float64 { - if _, ok := stdlib[path]; ok { + if stdlib.HasPackage(path) { return MaxRelevance } mod, _ := r.findPackage(path) @@ -609,10 +731,7 @@ func (r *ModuleResolver) canonicalize(info directoryPackageInfo) (*pkg, error) { 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 - } +func (r *ModuleResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []stdlib.Symbol, error) { if info, ok := r.cacheLoad(pkg.dir); ok && !includeTest { return r.cacheExports(ctx, r.env, info) } @@ -645,9 +764,7 @@ func (r *ModuleResolver) scanDirForPackage(root gopathwalk.Root, dir string) dir } 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) - } + 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), diff --git a/vendor/golang.org/x/tools/internal/imports/mod_cache.go b/vendor/golang.org/x/tools/internal/imports/mod_cache.go index 18dada495c..b1192696b2 100644 --- a/vendor/golang.org/x/tools/internal/imports/mod_cache.go +++ b/vendor/golang.org/x/tools/internal/imports/mod_cache.go @@ -7,12 +7,17 @@ package imports import ( "context" "fmt" + "path" + "path/filepath" + "strings" "sync" + "golang.org/x/mod/module" "golang.org/x/tools/internal/gopathwalk" + "golang.org/x/tools/internal/stdlib" ) -// To find packages to import, the resolver needs to know about all of the +// To find packages to import, the resolver needs to know about all of // 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 @@ -39,6 +44,8 @@ const ( exportsLoaded ) +// directoryPackageInfo holds (possibly incomplete) information about packages +// contained in a given directory. type directoryPackageInfo struct { // status indicates the extent to which this struct has been filled in. status directoryPackageStatus @@ -63,8 +70,11 @@ type directoryPackageInfo struct { packageName string // the package name, as declared in the source. // Set when status >= exportsLoaded. - - exports []string + // TODO(rfindley): it's hard to see this, but exports depend implicitly on + // the default build context GOOS and GOARCH. + // + // We can make this explicit, and key exports by GOOS, GOARCH. + exports []stdlib.Symbol } // reachedStatus returns true when info has a status at least target and any error associated with @@ -79,7 +89,7 @@ func (info *directoryPackageInfo) reachedStatus(target directoryPackageStatus) ( return true, nil } -// dirInfoCache is a concurrency safe map for storing information about +// 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. @@ -92,21 +102,26 @@ func (info *directoryPackageInfo) reachedStatus(target directoryPackageStatus) ( // 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 { +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 } +func NewDirInfoCache() *DirInfoCache { + return &DirInfoCache{ + dirs: make(map[string]*directoryPackageInfo), + listeners: make(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() { +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 @@ -162,8 +177,10 @@ func (d *dirInfoCache) ScanAndListen(ctx context.Context, listener cacheListener } // Store stores the package info for dir. -func (d *dirInfoCache) Store(dir string, info directoryPackageInfo) { +func (d *DirInfoCache) Store(dir string, info directoryPackageInfo) { d.mu.Lock() + // TODO(rfindley, golang/go#59216): should we overwrite an existing entry? + // That seems incorrect as the cache should be idempotent. _, old := d.dirs[dir] d.dirs[dir] = &info var listeners []cacheListener @@ -180,7 +197,7 @@ func (d *dirInfoCache) Store(dir string, info directoryPackageInfo) { } // Load returns a copy of the directoryPackageInfo for absolute directory dir. -func (d *dirInfoCache) Load(dir string) (directoryPackageInfo, bool) { +func (d *DirInfoCache) Load(dir string) (directoryPackageInfo, bool) { d.mu.Lock() defer d.mu.Unlock() info, ok := d.dirs[dir] @@ -191,7 +208,7 @@ func (d *dirInfoCache) Load(dir string) (directoryPackageInfo, bool) { } // Keys returns the keys currently present in d. -func (d *dirInfoCache) Keys() (keys []string) { +func (d *DirInfoCache) Keys() (keys []string) { d.mu.Lock() defer d.mu.Unlock() for key := range d.dirs { @@ -200,7 +217,7 @@ func (d *dirInfoCache) Keys() (keys []string) { return keys } -func (d *dirInfoCache) CachePackageName(info directoryPackageInfo) (string, error) { +func (d *DirInfoCache) CachePackageName(info directoryPackageInfo) (string, error) { if loaded, err := info.reachedStatus(nameLoaded); loaded { return info.packageName, err } @@ -213,7 +230,7 @@ func (d *dirInfoCache) CachePackageName(info directoryPackageInfo) (string, erro return info.packageName, info.err } -func (d *dirInfoCache) CacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { +func (d *DirInfoCache) CacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []stdlib.Symbol, error) { if reached, _ := info.reachedStatus(exportsLoaded); reached { return info.packageName, info.exports, info.err } @@ -234,3 +251,81 @@ func (d *dirInfoCache) CacheExports(ctx context.Context, env *ProcessEnv, info d d.Store(info.dir, info) return info.packageName, info.exports, info.err } + +// ScanModuleCache walks the given directory, which must be a GOMODCACHE value, +// for directory package information, storing the results in cache. +func ScanModuleCache(dir string, cache *DirInfoCache, logf func(string, ...any)) { + // Note(rfindley): it's hard to see, but this function attempts to implement + // just the side effects on cache of calling PrimeCache with a ProcessEnv + // that has the given dir as its GOMODCACHE. + // + // Teasing out the control flow, we see that we can avoid any handling of + // vendor/ and can infer module info entirely from the path, simplifying the + // logic here. + + root := gopathwalk.Root{ + Path: filepath.Clean(dir), + Type: gopathwalk.RootModuleCache, + } + + directoryInfo := func(root gopathwalk.Root, dir string) directoryPackageInfo { + // This is a copy of ModuleResolver.scanDirForPackage, trimmed down to + // logic that applies to a module cache directory. + + subdir := "" + if dir != root.Path { + subdir = dir[len(root.Path)+len("/"):] + } + + 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 logf != nil { + 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])) + index := strings.Index(dir, matches[1]+"@"+matches[2]) + modDir := filepath.Join(dir[:index], matches[1]+"@"+matches[2]) + modName := readModName(filepath.Join(modDir, "go.mod")) + return directoryPackageInfo{ + status: directoryScanned, + dir: dir, + rootType: root.Type, + nonCanonicalImportPath: importPath, + moduleDir: modDir, + moduleName: modName, + } + } + + add := func(root gopathwalk.Root, dir string) { + info := directoryInfo(root, dir) + cache.Store(info.dir, info) + } + + skip := func(_ gopathwalk.Root, dir string) bool { + // Skip directories that have already been scanned. + // + // Note that gopathwalk only adds "package" directories, which must contain + // a .go file, and all such package directories in the module cache are + // immutable. So if we can load a dir, it can be skipped. + info, ok := cache.Load(dir) + if !ok { + return false + } + packageScanned, _ := info.reachedStatus(directoryScanned) + return packageScanned + } + + gopathwalk.WalkSkip([]gopathwalk.Root{root}, add, skip, gopathwalk.Options{Logf: logf, ModulesEnabled: true}) +} diff --git a/vendor/golang.org/x/tools/internal/imports/sortimports.go b/vendor/golang.org/x/tools/internal/imports/sortimports.go index 1a0a7ebd9e..da8194fd96 100644 --- a/vendor/golang.org/x/tools/internal/imports/sortimports.go +++ b/vendor/golang.org/x/tools/internal/imports/sortimports.go @@ -18,7 +18,7 @@ import ( // 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. // -// It may mutate the token.File. +// It may mutate the token.File and the ast.File. func sortImports(localPrefix string, tokFile *token.File, f *ast.File) { for i, d := range f.Decls { d, ok := d.(*ast.GenDecl) 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 31a75949cd..0000000000 --- a/vendor/golang.org/x/tools/internal/imports/zstdlib.go +++ /dev/null @@ -1,11115 +0,0 @@ -// Copyright 2022 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. - -// Code generated by mkstdlib.go. DO NOT EDIT. - -package imports - -var stdlib = map[string][]string{ - "archive/tar": { - "ErrFieldTooLong", - "ErrHeader", - "ErrInsecurePath", - "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": { - "Compressor", - "Decompressor", - "Deflate", - "ErrAlgorithm", - "ErrChecksum", - "ErrFormat", - "ErrInsecurePath", - "File", - "FileHeader", - "FileInfoHeader", - "NewReader", - "NewWriter", - "OpenReader", - "ReadCloser", - "Reader", - "RegisterCompressor", - "RegisterDecompressor", - "Store", - "Writer", - }, - "bufio": { - "ErrAdvanceTooFar", - "ErrBadReadCount", - "ErrBufferFull", - "ErrFinalToken", - "ErrInvalidUnreadByte", - "ErrInvalidUnreadRune", - "ErrNegativeAdvance", - "ErrNegativeCount", - "ErrTooLong", - "MaxScanTokenSize", - "NewReadWriter", - "NewReader", - "NewReaderSize", - "NewScanner", - "NewWriter", - "NewWriterSize", - "ReadWriter", - "Reader", - "ScanBytes", - "ScanLines", - "ScanRunes", - "ScanWords", - "Scanner", - "SplitFunc", - "Writer", - }, - "bytes": { - "Buffer", - "Clone", - "Compare", - "Contains", - "ContainsAny", - "ContainsRune", - "Count", - "Cut", - "CutPrefix", - "CutSuffix", - "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": { - "NewReader", - "StructuralError", - }, - "compress/flate": { - "BestCompression", - "BestSpeed", - "CorruptInputError", - "DefaultCompression", - "HuffmanOnly", - "InternalError", - "NewReader", - "NewReaderDict", - "NewWriter", - "NewWriterDict", - "NoCompression", - "ReadError", - "Reader", - "Resetter", - "WriteError", - "Writer", - }, - "compress/gzip": { - "BestCompression", - "BestSpeed", - "DefaultCompression", - "ErrChecksum", - "ErrHeader", - "Header", - "HuffmanOnly", - "NewReader", - "NewWriter", - "NewWriterLevel", - "NoCompression", - "Reader", - "Writer", - }, - "compress/lzw": { - "LSB", - "MSB", - "NewReader", - "NewWriter", - "Order", - "Reader", - "Writer", - }, - "compress/zlib": { - "BestCompression", - "BestSpeed", - "DefaultCompression", - "ErrChecksum", - "ErrDictionary", - "ErrHeader", - "HuffmanOnly", - "NewReader", - "NewReaderDict", - "NewWriter", - "NewWriterLevel", - "NewWriterLevelDict", - "NoCompression", - "Resetter", - "Writer", - }, - "container/heap": { - "Fix", - "Init", - "Interface", - "Pop", - "Push", - "Remove", - }, - "container/list": { - "Element", - "List", - "New", - }, - "container/ring": { - "New", - "Ring", - }, - "context": { - "Background", - "CancelCauseFunc", - "CancelFunc", - "Canceled", - "Cause", - "Context", - "DeadlineExceeded", - "TODO", - "WithCancel", - "WithCancelCause", - "WithDeadline", - "WithTimeout", - "WithValue", - }, - "crypto": { - "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": { - "BlockSize", - "KeySizeError", - "NewCipher", - }, - "crypto/cipher": { - "AEAD", - "Block", - "BlockMode", - "NewCBCDecrypter", - "NewCBCEncrypter", - "NewCFBDecrypter", - "NewCFBEncrypter", - "NewCTR", - "NewGCM", - "NewGCMWithNonceSize", - "NewGCMWithTagSize", - "NewOFB", - "Stream", - "StreamReader", - "StreamWriter", - }, - "crypto/des": { - "BlockSize", - "KeySizeError", - "NewCipher", - "NewTripleDESCipher", - }, - "crypto/dsa": { - "ErrInvalidPublicKey", - "GenerateKey", - "GenerateParameters", - "L1024N160", - "L2048N224", - "L2048N256", - "L3072N256", - "ParameterSizes", - "Parameters", - "PrivateKey", - "PublicKey", - "Sign", - "Verify", - }, - "crypto/ecdh": { - "Curve", - "P256", - "P384", - "P521", - "PrivateKey", - "PublicKey", - "X25519", - }, - "crypto/ecdsa": { - "GenerateKey", - "PrivateKey", - "PublicKey", - "Sign", - "SignASN1", - "Verify", - "VerifyASN1", - }, - "crypto/ed25519": { - "GenerateKey", - "NewKeyFromSeed", - "Options", - "PrivateKey", - "PrivateKeySize", - "PublicKey", - "PublicKeySize", - "SeedSize", - "Sign", - "SignatureSize", - "Verify", - "VerifyWithOptions", - }, - "crypto/elliptic": { - "Curve", - "CurveParams", - "GenerateKey", - "Marshal", - "MarshalCompressed", - "P224", - "P256", - "P384", - "P521", - "Unmarshal", - "UnmarshalCompressed", - }, - "crypto/hmac": { - "Equal", - "New", - }, - "crypto/md5": { - "BlockSize", - "New", - "Size", - "Sum", - }, - "crypto/rand": { - "Int", - "Prime", - "Read", - "Reader", - }, - "crypto/rc4": { - "Cipher", - "KeySizeError", - "NewCipher", - }, - "crypto/rsa": { - "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": { - "BlockSize", - "New", - "Size", - "Sum", - }, - "crypto/sha256": { - "BlockSize", - "New", - "New224", - "Size", - "Size224", - "Sum224", - "Sum256", - }, - "crypto/sha512": { - "BlockSize", - "New", - "New384", - "New512_224", - "New512_256", - "Size", - "Size224", - "Size256", - "Size384", - "Sum384", - "Sum512", - "Sum512_224", - "Sum512_256", - }, - "crypto/subtle": { - "ConstantTimeByteEq", - "ConstantTimeCompare", - "ConstantTimeCopy", - "ConstantTimeEq", - "ConstantTimeLessOrEq", - "ConstantTimeSelect", - "XORBytes", - }, - "crypto/tls": { - "Certificate", - "CertificateRequestInfo", - "CertificateVerificationError", - "CipherSuite", - "CipherSuiteName", - "CipherSuites", - "Client", - "ClientAuthType", - "ClientHelloInfo", - "ClientSessionCache", - "ClientSessionState", - "Config", - "Conn", - "ConnectionState", - "CurveID", - "CurveP256", - "CurveP384", - "CurveP521", - "Dial", - "DialWithDialer", - "Dialer", - "ECDSAWithP256AndSHA256", - "ECDSAWithP384AndSHA384", - "ECDSAWithP521AndSHA512", - "ECDSAWithSHA1", - "Ed25519", - "InsecureCipherSuites", - "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_CHACHA20_POLY1305_SHA256", - "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_CHACHA20_POLY1305_SHA256", - "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": { - "CANotAuthorizedForExtKeyUsage", - "CANotAuthorizedForThisName", - "CertPool", - "Certificate", - "CertificateInvalidError", - "CertificateRequest", - "ConstraintViolationError", - "CreateCertificate", - "CreateCertificateRequest", - "CreateRevocationList", - "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", - "ParseRevocationList", - "PublicKeyAlgorithm", - "PureEd25519", - "RSA", - "RevocationList", - "SHA1WithRSA", - "SHA256WithRSA", - "SHA256WithRSAPSS", - "SHA384WithRSA", - "SHA384WithRSAPSS", - "SHA512WithRSA", - "SHA512WithRSAPSS", - "SetFallbackRoots", - "SignatureAlgorithm", - "SystemCertPool", - "SystemRootsError", - "TooManyConstraints", - "TooManyIntermediates", - "UnconstrainedName", - "UnhandledCriticalExtension", - "UnknownAuthorityError", - "UnknownPublicKeyAlgorithm", - "UnknownSignatureAlgorithm", - "VerifyOptions", - }, - "crypto/x509/pkix": { - "AlgorithmIdentifier", - "AttributeTypeAndValue", - "AttributeTypeAndValueSET", - "CertificateList", - "Extension", - "Name", - "RDNSequence", - "RelativeDistinguishedNameSET", - "RevokedCertificate", - "TBSCertificateList", - }, - "database/sql": { - "ColumnType", - "Conn", - "DB", - "DBStats", - "Drivers", - "ErrConnDone", - "ErrNoRows", - "ErrTxDone", - "IsolationLevel", - "LevelDefault", - "LevelLinearizable", - "LevelReadCommitted", - "LevelReadUncommitted", - "LevelRepeatableRead", - "LevelSerializable", - "LevelSnapshot", - "LevelWriteCommitted", - "Named", - "NamedArg", - "NullBool", - "NullByte", - "NullFloat64", - "NullInt16", - "NullInt32", - "NullInt64", - "NullString", - "NullTime", - "Open", - "OpenDB", - "Out", - "RawBytes", - "Register", - "Result", - "Row", - "Rows", - "Scanner", - "Stmt", - "Tx", - "TxOptions", - }, - "database/sql/driver": { - "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", - "Validator", - "Value", - "ValueConverter", - "Valuer", - }, - "debug/buildinfo": { - "BuildInfo", - "Read", - "ReadFile", - }, - "debug/dwarf": { - "AddrType", - "ArrayType", - "Attr", - "AttrAbstractOrigin", - "AttrAccessibility", - "AttrAddrBase", - "AttrAddrClass", - "AttrAlignment", - "AttrAllocated", - "AttrArtificial", - "AttrAssociated", - "AttrBaseTypes", - "AttrBinaryScale", - "AttrBitOffset", - "AttrBitSize", - "AttrByteSize", - "AttrCallAllCalls", - "AttrCallAllSourceCalls", - "AttrCallAllTailCalls", - "AttrCallColumn", - "AttrCallDataLocation", - "AttrCallDataValue", - "AttrCallFile", - "AttrCallLine", - "AttrCallOrigin", - "AttrCallPC", - "AttrCallParameter", - "AttrCallReturnPC", - "AttrCallTailCall", - "AttrCallTarget", - "AttrCallTargetClobbered", - "AttrCallValue", - "AttrCalling", - "AttrCommonRef", - "AttrCompDir", - "AttrConstExpr", - "AttrConstValue", - "AttrContainingType", - "AttrCount", - "AttrDataBitOffset", - "AttrDataLocation", - "AttrDataMemberLoc", - "AttrDecimalScale", - "AttrDecimalSign", - "AttrDeclColumn", - "AttrDeclFile", - "AttrDeclLine", - "AttrDeclaration", - "AttrDefaultValue", - "AttrDefaulted", - "AttrDeleted", - "AttrDescription", - "AttrDigitCount", - "AttrDiscr", - "AttrDiscrList", - "AttrDiscrValue", - "AttrDwoName", - "AttrElemental", - "AttrEncoding", - "AttrEndianity", - "AttrEntrypc", - "AttrEnumClass", - "AttrExplicit", - "AttrExportSymbols", - "AttrExtension", - "AttrExternal", - "AttrFrameBase", - "AttrFriend", - "AttrHighpc", - "AttrIdentifierCase", - "AttrImport", - "AttrInline", - "AttrIsOptional", - "AttrLanguage", - "AttrLinkageName", - "AttrLocation", - "AttrLoclistsBase", - "AttrLowerBound", - "AttrLowpc", - "AttrMacroInfo", - "AttrMacros", - "AttrMainSubprogram", - "AttrMutable", - "AttrName", - "AttrNamelistItem", - "AttrNoreturn", - "AttrObjectPointer", - "AttrOrdering", - "AttrPictureString", - "AttrPriority", - "AttrProducer", - "AttrPrototyped", - "AttrPure", - "AttrRanges", - "AttrRank", - "AttrRecursive", - "AttrReference", - "AttrReturnAddr", - "AttrRnglistsBase", - "AttrRvalueReference", - "AttrSegment", - "AttrSibling", - "AttrSignature", - "AttrSmall", - "AttrSpecification", - "AttrStartScope", - "AttrStaticLink", - "AttrStmtList", - "AttrStrOffsetsBase", - "AttrStride", - "AttrStrideSize", - "AttrStringLength", - "AttrStringLengthBitSize", - "AttrStringLengthByteSize", - "AttrThreadsScaled", - "AttrTrampoline", - "AttrType", - "AttrUpperBound", - "AttrUseLocation", - "AttrUseUTF8", - "AttrVarParam", - "AttrVirtuality", - "AttrVisibility", - "AttrVtableElemLoc", - "BasicType", - "BoolType", - "CharType", - "Class", - "ClassAddrPtr", - "ClassAddress", - "ClassBlock", - "ClassConstant", - "ClassExprLoc", - "ClassFlag", - "ClassLinePtr", - "ClassLocList", - "ClassLocListPtr", - "ClassMacPtr", - "ClassRangeListPtr", - "ClassReference", - "ClassReferenceAlt", - "ClassReferenceSig", - "ClassRngList", - "ClassRngListsPtr", - "ClassStrOffsetsPtr", - "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", - "TagAtomicType", - "TagBaseType", - "TagCallSite", - "TagCallSiteParameter", - "TagCatchDwarfBlock", - "TagClassType", - "TagCoarrayType", - "TagCommonDwarfBlock", - "TagCommonInclusion", - "TagCompileUnit", - "TagCondition", - "TagConstType", - "TagConstant", - "TagDwarfProcedure", - "TagDynamicType", - "TagEntryPoint", - "TagEnumerationType", - "TagEnumerator", - "TagFileType", - "TagFormalParameter", - "TagFriend", - "TagGenericSubrange", - "TagImmutableType", - "TagImportedDeclaration", - "TagImportedModule", - "TagImportedUnit", - "TagInheritance", - "TagInlinedSubroutine", - "TagInterfaceType", - "TagLabel", - "TagLexDwarfBlock", - "TagMember", - "TagModule", - "TagMutableType", - "TagNamelist", - "TagNamelistItem", - "TagNamespace", - "TagPackedType", - "TagPartialUnit", - "TagPointerType", - "TagPtrToMemberType", - "TagReferenceType", - "TagRestrictType", - "TagRvalueReferenceType", - "TagSetType", - "TagSharedType", - "TagSkeletonUnit", - "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": { - "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_ADDRRNGHI", - "DT_ADDRRNGLO", - "DT_AUDIT", - "DT_AUXILIARY", - "DT_BIND_NOW", - "DT_CHECKSUM", - "DT_CONFIG", - "DT_DEBUG", - "DT_DEPAUDIT", - "DT_ENCODING", - "DT_FEATURE", - "DT_FILTER", - "DT_FINI", - "DT_FINI_ARRAY", - "DT_FINI_ARRAYSZ", - "DT_FLAGS", - "DT_FLAGS_1", - "DT_GNU_CONFLICT", - "DT_GNU_CONFLICTSZ", - "DT_GNU_HASH", - "DT_GNU_LIBLIST", - "DT_GNU_LIBLISTSZ", - "DT_GNU_PRELINKED", - "DT_HASH", - "DT_HIOS", - "DT_HIPROC", - "DT_INIT", - "DT_INIT_ARRAY", - "DT_INIT_ARRAYSZ", - "DT_JMPREL", - "DT_LOOS", - "DT_LOPROC", - "DT_MIPS_AUX_DYNAMIC", - "DT_MIPS_BASE_ADDRESS", - "DT_MIPS_COMPACT_SIZE", - "DT_MIPS_CONFLICT", - "DT_MIPS_CONFLICTNO", - "DT_MIPS_CXX_FLAGS", - "DT_MIPS_DELTA_CLASS", - "DT_MIPS_DELTA_CLASSSYM", - "DT_MIPS_DELTA_CLASSSYM_NO", - "DT_MIPS_DELTA_CLASS_NO", - "DT_MIPS_DELTA_INSTANCE", - "DT_MIPS_DELTA_INSTANCE_NO", - "DT_MIPS_DELTA_RELOC", - "DT_MIPS_DELTA_RELOC_NO", - "DT_MIPS_DELTA_SYM", - "DT_MIPS_DELTA_SYM_NO", - "DT_MIPS_DYNSTR_ALIGN", - "DT_MIPS_FLAGS", - "DT_MIPS_GOTSYM", - "DT_MIPS_GP_VALUE", - "DT_MIPS_HIDDEN_GOTIDX", - "DT_MIPS_HIPAGENO", - "DT_MIPS_ICHECKSUM", - "DT_MIPS_INTERFACE", - "DT_MIPS_INTERFACE_SIZE", - "DT_MIPS_IVERSION", - "DT_MIPS_LIBLIST", - "DT_MIPS_LIBLISTNO", - "DT_MIPS_LOCALPAGE_GOTIDX", - "DT_MIPS_LOCAL_GOTIDX", - "DT_MIPS_LOCAL_GOTNO", - "DT_MIPS_MSYM", - "DT_MIPS_OPTIONS", - "DT_MIPS_PERF_SUFFIX", - "DT_MIPS_PIXIE_INIT", - "DT_MIPS_PLTGOT", - "DT_MIPS_PROTECTED_GOTIDX", - "DT_MIPS_RLD_MAP", - "DT_MIPS_RLD_MAP_REL", - "DT_MIPS_RLD_TEXT_RESOLVE_ADDR", - "DT_MIPS_RLD_VERSION", - "DT_MIPS_RWPLT", - "DT_MIPS_SYMBOL_LIB", - "DT_MIPS_SYMTABNO", - "DT_MIPS_TIME_STAMP", - "DT_MIPS_UNREFEXTNO", - "DT_MOVEENT", - "DT_MOVESZ", - "DT_MOVETAB", - "DT_NEEDED", - "DT_NULL", - "DT_PLTGOT", - "DT_PLTPAD", - "DT_PLTPADSZ", - "DT_PLTREL", - "DT_PLTRELSZ", - "DT_POSFLAG_1", - "DT_PPC64_GLINK", - "DT_PPC64_OPD", - "DT_PPC64_OPDSZ", - "DT_PPC64_OPT", - "DT_PPC_GOT", - "DT_PPC_OPT", - "DT_PREINIT_ARRAY", - "DT_PREINIT_ARRAYSZ", - "DT_REL", - "DT_RELA", - "DT_RELACOUNT", - "DT_RELAENT", - "DT_RELASZ", - "DT_RELCOUNT", - "DT_RELENT", - "DT_RELSZ", - "DT_RPATH", - "DT_RUNPATH", - "DT_SONAME", - "DT_SPARC_REGISTER", - "DT_STRSZ", - "DT_STRTAB", - "DT_SYMBOLIC", - "DT_SYMENT", - "DT_SYMINENT", - "DT_SYMINFO", - "DT_SYMINSZ", - "DT_SYMTAB", - "DT_SYMTAB_SHNDX", - "DT_TEXTREL", - "DT_TLSDESC_GOT", - "DT_TLSDESC_PLT", - "DT_USED", - "DT_VALRNGHI", - "DT_VALRNGLO", - "DT_VERDEF", - "DT_VERDEFNUM", - "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_LOONGARCH", - "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_AARCH64_ARCHEXT", - "PT_AARCH64_UNWIND", - "PT_ARM_ARCHEXT", - "PT_ARM_EXIDX", - "PT_DYNAMIC", - "PT_GNU_EH_FRAME", - "PT_GNU_MBIND_HI", - "PT_GNU_MBIND_LO", - "PT_GNU_PROPERTY", - "PT_GNU_RELRO", - "PT_GNU_STACK", - "PT_HIOS", - "PT_HIPROC", - "PT_INTERP", - "PT_LOAD", - "PT_LOOS", - "PT_LOPROC", - "PT_MIPS_ABIFLAGS", - "PT_MIPS_OPTIONS", - "PT_MIPS_REGINFO", - "PT_MIPS_RTPROC", - "PT_NOTE", - "PT_NULL", - "PT_OPENBSD_BOOTDATA", - "PT_OPENBSD_RANDOMIZE", - "PT_OPENBSD_WXNEEDED", - "PT_PAX_FLAGS", - "PT_PHDR", - "PT_S390_PGSTE", - "PT_SHLIB", - "PT_SUNWSTACK", - "PT_SUNW_EH_FRAME", - "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_LARCH", - "R_LARCH_32", - "R_LARCH_32_PCREL", - "R_LARCH_64", - "R_LARCH_ABS64_HI12", - "R_LARCH_ABS64_LO20", - "R_LARCH_ABS_HI20", - "R_LARCH_ABS_LO12", - "R_LARCH_ADD16", - "R_LARCH_ADD24", - "R_LARCH_ADD32", - "R_LARCH_ADD64", - "R_LARCH_ADD8", - "R_LARCH_B16", - "R_LARCH_B21", - "R_LARCH_B26", - "R_LARCH_COPY", - "R_LARCH_GNU_VTENTRY", - "R_LARCH_GNU_VTINHERIT", - "R_LARCH_GOT64_HI12", - "R_LARCH_GOT64_LO20", - "R_LARCH_GOT64_PC_HI12", - "R_LARCH_GOT64_PC_LO20", - "R_LARCH_GOT_HI20", - "R_LARCH_GOT_LO12", - "R_LARCH_GOT_PC_HI20", - "R_LARCH_GOT_PC_LO12", - "R_LARCH_IRELATIVE", - "R_LARCH_JUMP_SLOT", - "R_LARCH_MARK_LA", - "R_LARCH_MARK_PCREL", - "R_LARCH_NONE", - "R_LARCH_PCALA64_HI12", - "R_LARCH_PCALA64_LO20", - "R_LARCH_PCALA_HI20", - "R_LARCH_PCALA_LO12", - "R_LARCH_RELATIVE", - "R_LARCH_RELAX", - "R_LARCH_SOP_ADD", - "R_LARCH_SOP_AND", - "R_LARCH_SOP_ASSERT", - "R_LARCH_SOP_IF_ELSE", - "R_LARCH_SOP_NOT", - "R_LARCH_SOP_POP_32_S_0_10_10_16_S2", - "R_LARCH_SOP_POP_32_S_0_5_10_16_S2", - "R_LARCH_SOP_POP_32_S_10_12", - "R_LARCH_SOP_POP_32_S_10_16", - "R_LARCH_SOP_POP_32_S_10_16_S2", - "R_LARCH_SOP_POP_32_S_10_5", - "R_LARCH_SOP_POP_32_S_5_20", - "R_LARCH_SOP_POP_32_U", - "R_LARCH_SOP_POP_32_U_10_12", - "R_LARCH_SOP_PUSH_ABSOLUTE", - "R_LARCH_SOP_PUSH_DUP", - "R_LARCH_SOP_PUSH_GPREL", - "R_LARCH_SOP_PUSH_PCREL", - "R_LARCH_SOP_PUSH_PLT_PCREL", - "R_LARCH_SOP_PUSH_TLS_GD", - "R_LARCH_SOP_PUSH_TLS_GOT", - "R_LARCH_SOP_PUSH_TLS_TPREL", - "R_LARCH_SOP_SL", - "R_LARCH_SOP_SR", - "R_LARCH_SOP_SUB", - "R_LARCH_SUB16", - "R_LARCH_SUB24", - "R_LARCH_SUB32", - "R_LARCH_SUB64", - "R_LARCH_SUB8", - "R_LARCH_TLS_DTPMOD32", - "R_LARCH_TLS_DTPMOD64", - "R_LARCH_TLS_DTPREL32", - "R_LARCH_TLS_DTPREL64", - "R_LARCH_TLS_GD_HI20", - "R_LARCH_TLS_GD_PC_HI20", - "R_LARCH_TLS_IE64_HI12", - "R_LARCH_TLS_IE64_LO20", - "R_LARCH_TLS_IE64_PC_HI12", - "R_LARCH_TLS_IE64_PC_LO20", - "R_LARCH_TLS_IE_HI20", - "R_LARCH_TLS_IE_LO12", - "R_LARCH_TLS_IE_PC_HI20", - "R_LARCH_TLS_IE_PC_LO12", - "R_LARCH_TLS_LD_HI20", - "R_LARCH_TLS_LD_PC_HI20", - "R_LARCH_TLS_LE64_HI12", - "R_LARCH_TLS_LE64_LO20", - "R_LARCH_TLS_LE_HI20", - "R_LARCH_TLS_LE_LO12", - "R_LARCH_TLS_TPREL32", - "R_LARCH_TLS_TPREL64", - "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_HIGHER34", - "R_PPC64_ADDR16_HIGHERA", - "R_PPC64_ADDR16_HIGHERA34", - "R_PPC64_ADDR16_HIGHEST", - "R_PPC64_ADDR16_HIGHEST34", - "R_PPC64_ADDR16_HIGHESTA", - "R_PPC64_ADDR16_HIGHESTA34", - "R_PPC64_ADDR16_LO", - "R_PPC64_ADDR16_LO_DS", - "R_PPC64_ADDR24", - "R_PPC64_ADDR32", - "R_PPC64_ADDR64", - "R_PPC64_ADDR64_LOCAL", - "R_PPC64_COPY", - "R_PPC64_D28", - "R_PPC64_D34", - "R_PPC64_D34_HA30", - "R_PPC64_D34_HI30", - "R_PPC64_D34_LO", - "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_DTPREL34", - "R_PPC64_DTPREL64", - "R_PPC64_ENTRY", - "R_PPC64_GLOB_DAT", - "R_PPC64_GNU_VTENTRY", - "R_PPC64_GNU_VTINHERIT", - "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_DTPREL_PCREL34", - "R_PPC64_GOT_PCREL34", - "R_PPC64_GOT_TLSGD16", - "R_PPC64_GOT_TLSGD16_HA", - "R_PPC64_GOT_TLSGD16_HI", - "R_PPC64_GOT_TLSGD16_LO", - "R_PPC64_GOT_TLSGD_PCREL34", - "R_PPC64_GOT_TLSLD16", - "R_PPC64_GOT_TLSLD16_HA", - "R_PPC64_GOT_TLSLD16_HI", - "R_PPC64_GOT_TLSLD16_LO", - "R_PPC64_GOT_TLSLD_PCREL34", - "R_PPC64_GOT_TPREL16_DS", - "R_PPC64_GOT_TPREL16_HA", - "R_PPC64_GOT_TPREL16_HI", - "R_PPC64_GOT_TPREL16_LO_DS", - "R_PPC64_GOT_TPREL_PCREL34", - "R_PPC64_IRELATIVE", - "R_PPC64_JMP_IREL", - "R_PPC64_JMP_SLOT", - "R_PPC64_NONE", - "R_PPC64_PCREL28", - "R_PPC64_PCREL34", - "R_PPC64_PCREL_OPT", - "R_PPC64_PLT16_HA", - "R_PPC64_PLT16_HI", - "R_PPC64_PLT16_LO", - "R_PPC64_PLT16_LO_DS", - "R_PPC64_PLT32", - "R_PPC64_PLT64", - "R_PPC64_PLTCALL", - "R_PPC64_PLTCALL_NOTOC", - "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_PLTREL32", - "R_PPC64_PLTREL64", - "R_PPC64_PLTSEQ", - "R_PPC64_PLTSEQ_NOTOC", - "R_PPC64_PLT_PCREL34", - "R_PPC64_PLT_PCREL34_NOTOC", - "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_HIGH", - "R_PPC64_REL16_HIGHA", - "R_PPC64_REL16_HIGHER", - "R_PPC64_REL16_HIGHER34", - "R_PPC64_REL16_HIGHERA", - "R_PPC64_REL16_HIGHERA34", - "R_PPC64_REL16_HIGHEST", - "R_PPC64_REL16_HIGHEST34", - "R_PPC64_REL16_HIGHESTA", - "R_PPC64_REL16_HIGHESTA34", - "R_PPC64_REL16_LO", - "R_PPC64_REL24", - "R_PPC64_REL24_NOTOC", - "R_PPC64_REL30", - "R_PPC64_REL32", - "R_PPC64_REL64", - "R_PPC64_RELATIVE", - "R_PPC64_SECTOFF", - "R_PPC64_SECTOFF_DS", - "R_PPC64_SECTOFF_HA", - "R_PPC64_SECTOFF_HI", - "R_PPC64_SECTOFF_LO", - "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_TPREL34", - "R_PPC64_TPREL64", - "R_PPC64_UADDR16", - "R_PPC64_UADDR32", - "R_PPC64_UADDR64", - "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_MIPS_ABIFLAGS", - "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": { - "DecodingError", - "Func", - "LineTable", - "NewLineTable", - "NewTable", - "Obj", - "Sym", - "Table", - "UnknownFileError", - "UnknownLineError", - }, - "debug/macho": { - "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": { - "COFFSymbol", - "COFFSymbolAuxFormat5", - "COFFSymbolSize", - "DataDirectory", - "File", - "FileHeader", - "FormatError", - "IMAGE_COMDAT_SELECT_ANY", - "IMAGE_COMDAT_SELECT_ASSOCIATIVE", - "IMAGE_COMDAT_SELECT_EXACT_MATCH", - "IMAGE_COMDAT_SELECT_LARGEST", - "IMAGE_COMDAT_SELECT_NODUPLICATES", - "IMAGE_COMDAT_SELECT_SAME_SIZE", - "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_DLLCHARACTERISTICS_APPCONTAINER", - "IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE", - "IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY", - "IMAGE_DLLCHARACTERISTICS_GUARD_CF", - "IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA", - "IMAGE_DLLCHARACTERISTICS_NO_BIND", - "IMAGE_DLLCHARACTERISTICS_NO_ISOLATION", - "IMAGE_DLLCHARACTERISTICS_NO_SEH", - "IMAGE_DLLCHARACTERISTICS_NX_COMPAT", - "IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE", - "IMAGE_DLLCHARACTERISTICS_WDM_DRIVER", - "IMAGE_FILE_32BIT_MACHINE", - "IMAGE_FILE_AGGRESIVE_WS_TRIM", - "IMAGE_FILE_BYTES_REVERSED_HI", - "IMAGE_FILE_BYTES_REVERSED_LO", - "IMAGE_FILE_DEBUG_STRIPPED", - "IMAGE_FILE_DLL", - "IMAGE_FILE_EXECUTABLE_IMAGE", - "IMAGE_FILE_LARGE_ADDRESS_AWARE", - "IMAGE_FILE_LINE_NUMS_STRIPPED", - "IMAGE_FILE_LOCAL_SYMS_STRIPPED", - "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_LOONGARCH32", - "IMAGE_FILE_MACHINE_LOONGARCH64", - "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_RISCV128", - "IMAGE_FILE_MACHINE_RISCV32", - "IMAGE_FILE_MACHINE_RISCV64", - "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", - "IMAGE_FILE_NET_RUN_FROM_SWAP", - "IMAGE_FILE_RELOCS_STRIPPED", - "IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP", - "IMAGE_FILE_SYSTEM", - "IMAGE_FILE_UP_SYSTEM_ONLY", - "IMAGE_SCN_CNT_CODE", - "IMAGE_SCN_CNT_INITIALIZED_DATA", - "IMAGE_SCN_CNT_UNINITIALIZED_DATA", - "IMAGE_SCN_LNK_COMDAT", - "IMAGE_SCN_MEM_DISCARDABLE", - "IMAGE_SCN_MEM_EXECUTE", - "IMAGE_SCN_MEM_READ", - "IMAGE_SCN_MEM_WRITE", - "IMAGE_SUBSYSTEM_EFI_APPLICATION", - "IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER", - "IMAGE_SUBSYSTEM_EFI_ROM", - "IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER", - "IMAGE_SUBSYSTEM_NATIVE", - "IMAGE_SUBSYSTEM_NATIVE_WINDOWS", - "IMAGE_SUBSYSTEM_OS2_CUI", - "IMAGE_SUBSYSTEM_POSIX_CUI", - "IMAGE_SUBSYSTEM_UNKNOWN", - "IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION", - "IMAGE_SUBSYSTEM_WINDOWS_CE_GUI", - "IMAGE_SUBSYSTEM_WINDOWS_CUI", - "IMAGE_SUBSYSTEM_WINDOWS_GUI", - "IMAGE_SUBSYSTEM_XBOX", - "ImportDirectory", - "NewFile", - "Open", - "OptionalHeader32", - "OptionalHeader64", - "Reloc", - "Section", - "SectionHeader", - "SectionHeader32", - "StringTable", - "Symbol", - }, - "debug/plan9obj": { - "ErrNoSymbols", - "File", - "FileHeader", - "Magic386", - "Magic64", - "MagicAMD64", - "MagicARM", - "NewFile", - "Open", - "Section", - "SectionHeader", - "Sym", - }, - "embed": { - "FS", - }, - "encoding": { - "BinaryMarshaler", - "BinaryUnmarshaler", - "TextMarshaler", - "TextUnmarshaler", - }, - "encoding/ascii85": { - "CorruptInputError", - "Decode", - "Encode", - "MaxEncodedLen", - "NewDecoder", - "NewEncoder", - }, - "encoding/asn1": { - "BitString", - "ClassApplication", - "ClassContextSpecific", - "ClassPrivate", - "ClassUniversal", - "Enumerated", - "Flag", - "Marshal", - "MarshalWithParams", - "NullBytes", - "NullRawValue", - "ObjectIdentifier", - "RawContent", - "RawValue", - "StructuralError", - "SyntaxError", - "TagBMPString", - "TagBitString", - "TagBoolean", - "TagEnum", - "TagGeneralString", - "TagGeneralizedTime", - "TagIA5String", - "TagInteger", - "TagNull", - "TagNumericString", - "TagOID", - "TagOctetString", - "TagPrintableString", - "TagSequence", - "TagSet", - "TagT61String", - "TagUTCTime", - "TagUTF8String", - "Unmarshal", - "UnmarshalWithParams", - }, - "encoding/base32": { - "CorruptInputError", - "Encoding", - "HexEncoding", - "NewDecoder", - "NewEncoder", - "NewEncoding", - "NoPadding", - "StdEncoding", - "StdPadding", - }, - "encoding/base64": { - "CorruptInputError", - "Encoding", - "NewDecoder", - "NewEncoder", - "NewEncoding", - "NoPadding", - "RawStdEncoding", - "RawURLEncoding", - "StdEncoding", - "StdPadding", - "URLEncoding", - }, - "encoding/binary": { - "AppendByteOrder", - "AppendUvarint", - "AppendVarint", - "BigEndian", - "ByteOrder", - "LittleEndian", - "MaxVarintLen16", - "MaxVarintLen32", - "MaxVarintLen64", - "PutUvarint", - "PutVarint", - "Read", - "ReadUvarint", - "ReadVarint", - "Size", - "Uvarint", - "Varint", - "Write", - }, - "encoding/csv": { - "ErrBareQuote", - "ErrFieldCount", - "ErrQuote", - "ErrTrailingComma", - "NewReader", - "NewWriter", - "ParseError", - "Reader", - "Writer", - }, - "encoding/gob": { - "CommonType", - "Decoder", - "Encoder", - "GobDecoder", - "GobEncoder", - "NewDecoder", - "NewEncoder", - "Register", - "RegisterName", - }, - "encoding/hex": { - "Decode", - "DecodeString", - "DecodedLen", - "Dump", - "Dumper", - "Encode", - "EncodeToString", - "EncodedLen", - "ErrLength", - "InvalidByteError", - "NewDecoder", - "NewEncoder", - }, - "encoding/json": { - "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": { - "Block", - "Decode", - "Encode", - "EncodeToMemory", - }, - "encoding/xml": { - "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": { - "As", - "Is", - "Join", - "New", - "Unwrap", - }, - "expvar": { - "Do", - "Float", - "Func", - "Get", - "Handler", - "Int", - "KeyValue", - "Map", - "NewFloat", - "NewInt", - "NewMap", - "NewString", - "Publish", - "String", - "Var", - }, - "flag": { - "Arg", - "Args", - "Bool", - "BoolVar", - "CommandLine", - "ContinueOnError", - "Duration", - "DurationVar", - "ErrHelp", - "ErrorHandling", - "ExitOnError", - "Flag", - "FlagSet", - "Float64", - "Float64Var", - "Func", - "Getter", - "Int", - "Int64", - "Int64Var", - "IntVar", - "Lookup", - "NArg", - "NFlag", - "NewFlagSet", - "PanicOnError", - "Parse", - "Parsed", - "PrintDefaults", - "Set", - "String", - "StringVar", - "TextVar", - "Uint", - "Uint64", - "Uint64Var", - "UintVar", - "UnquoteUsage", - "Usage", - "Value", - "Var", - "Visit", - "VisitAll", - }, - "fmt": { - "Append", - "Appendf", - "Appendln", - "Errorf", - "FormatString", - "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": { - "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", - "IndexListExpr", - "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": { - "AllowBinary", - "ArchChar", - "Context", - "Default", - "FindOnly", - "IgnoreVendor", - "Import", - "ImportComment", - "ImportDir", - "ImportMode", - "IsLocalImport", - "MultiplePackageError", - "NoGoError", - "Package", - "ToolDir", - }, - "go/build/constraint": { - "AndExpr", - "Expr", - "IsGoBuild", - "IsPlusBuild", - "NotExpr", - "OrExpr", - "Parse", - "PlusBuildLines", - "SyntaxError", - "TagExpr", - }, - "go/constant": { - "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": { - "AllDecls", - "AllMethods", - "Example", - "Examples", - "Filter", - "Func", - "IllegalPrefixes", - "IsPredeclared", - "Mode", - "New", - "NewFromFiles", - "Note", - "Package", - "PreserveAST", - "Synopsis", - "ToHTML", - "ToText", - "Type", - "Value", - }, - "go/doc/comment": { - "Block", - "Code", - "DefaultLookupPackage", - "Doc", - "DocLink", - "Heading", - "Italic", - "Link", - "LinkDef", - "List", - "ListItem", - "Paragraph", - "Parser", - "Plain", - "Printer", - "Text", - }, - "go/format": { - "Node", - "Source", - }, - "go/importer": { - "Default", - "For", - "ForCompiler", - "Lookup", - }, - "go/parser": { - "AllErrors", - "DeclarationErrors", - "ImportsOnly", - "Mode", - "PackageClauseOnly", - "ParseComments", - "ParseDir", - "ParseExpr", - "ParseExprFrom", - "ParseFile", - "SkipObjectResolution", - "SpuriousErrors", - "Trace", - }, - "go/printer": { - "CommentedNode", - "Config", - "Fprint", - "Mode", - "RawFormat", - "SourcePos", - "TabIndent", - "UseSpaces", - }, - "go/scanner": { - "Error", - "ErrorHandler", - "ErrorList", - "Mode", - "PrintError", - "ScanComments", - "Scanner", - }, - "go/token": { - "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", - "TILDE", - "TYPE", - "Token", - "UnaryPrec", - "VAR", - "XOR", - "XOR_ASSIGN", - }, - "go/types": { - "ArgumentError", - "Array", - "AssertableTo", - "AssignableTo", - "Basic", - "BasicInfo", - "BasicKind", - "Bool", - "Builtin", - "Byte", - "Chan", - "ChanDir", - "CheckExpr", - "Checker", - "Comparable", - "Complex128", - "Complex64", - "Config", - "Const", - "Context", - "ConvertibleTo", - "DefPredeclaredTestFuncs", - "Default", - "Error", - "Eval", - "ExprString", - "FieldVal", - "Float32", - "Float64", - "Func", - "Id", - "Identical", - "IdenticalIgnoreTags", - "Implements", - "ImportMode", - "Importer", - "ImporterFrom", - "Info", - "Initializer", - "Instance", - "Instantiate", - "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", - "NewContext", - "NewField", - "NewFunc", - "NewInterface", - "NewInterfaceType", - "NewLabel", - "NewMap", - "NewMethodSet", - "NewNamed", - "NewPackage", - "NewParam", - "NewPkgName", - "NewPointer", - "NewScope", - "NewSignature", - "NewSignatureType", - "NewSlice", - "NewStruct", - "NewTerm", - "NewTuple", - "NewTypeName", - "NewTypeParam", - "NewUnion", - "NewVar", - "Nil", - "Object", - "ObjectString", - "Package", - "PkgName", - "Pointer", - "Qualifier", - "RecvOnly", - "RelativeTo", - "Rune", - "Satisfies", - "Scope", - "Selection", - "SelectionKind", - "SelectionString", - "SendOnly", - "SendRecv", - "Signature", - "Sizes", - "SizesFor", - "Slice", - "StdSizes", - "String", - "Struct", - "Term", - "Tuple", - "Typ", - "Type", - "TypeAndValue", - "TypeList", - "TypeName", - "TypeParam", - "TypeParamList", - "TypeString", - "Uint", - "Uint16", - "Uint32", - "Uint64", - "Uint8", - "Uintptr", - "Union", - "Universe", - "Unsafe", - "UnsafePointer", - "UntypedBool", - "UntypedComplex", - "UntypedFloat", - "UntypedInt", - "UntypedNil", - "UntypedRune", - "UntypedString", - "Var", - "WriteExpr", - "WriteSignature", - "WriteType", - }, - "hash": { - "Hash", - "Hash32", - "Hash64", - }, - "hash/adler32": { - "Checksum", - "New", - "Size", - }, - "hash/crc32": { - "Castagnoli", - "Checksum", - "ChecksumIEEE", - "IEEE", - "IEEETable", - "Koopman", - "MakeTable", - "New", - "NewIEEE", - "Size", - "Table", - "Update", - }, - "hash/crc64": { - "Checksum", - "ECMA", - "ISO", - "MakeTable", - "New", - "Size", - "Table", - "Update", - }, - "hash/fnv": { - "New128", - "New128a", - "New32", - "New32a", - "New64", - "New64a", - }, - "hash/maphash": { - "Bytes", - "Hash", - "MakeSeed", - "Seed", - "String", - }, - "html": { - "EscapeString", - "UnescapeString", - }, - "html/template": { - "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", - "ParseFS", - "ParseFiles", - "ParseGlob", - "Srcset", - "Template", - "URL", - "URLQueryEscaper", - }, - "image": { - "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", - "RGBA64Image", - "Rect", - "Rectangle", - "RegisterFormat", - "Transparent", - "Uniform", - "White", - "YCbCr", - "YCbCrSubsampleRatio", - "YCbCrSubsampleRatio410", - "YCbCrSubsampleRatio411", - "YCbCrSubsampleRatio420", - "YCbCrSubsampleRatio422", - "YCbCrSubsampleRatio440", - "YCbCrSubsampleRatio444", - "ZP", - "ZR", - }, - "image/color": { - "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": { - "Plan9", - "WebSafe", - }, - "image/draw": { - "Draw", - "DrawMask", - "Drawer", - "FloydSteinberg", - "Image", - "Op", - "Over", - "Quantizer", - "RGBA64Image", - "Src", - }, - "image/gif": { - "Decode", - "DecodeAll", - "DecodeConfig", - "DisposalBackground", - "DisposalNone", - "DisposalPrevious", - "Encode", - "EncodeAll", - "GIF", - "Options", - }, - "image/jpeg": { - "Decode", - "DecodeConfig", - "DefaultQuality", - "Encode", - "FormatError", - "Options", - "Reader", - "UnsupportedError", - }, - "image/png": { - "BestCompression", - "BestSpeed", - "CompressionLevel", - "Decode", - "DecodeConfig", - "DefaultCompression", - "Encode", - "Encoder", - "EncoderBuffer", - "EncoderBufferPool", - "FormatError", - "NoCompression", - "UnsupportedError", - }, - "index/suffixarray": { - "Index", - "New", - }, - "io": { - "ByteReader", - "ByteScanner", - "ByteWriter", - "Closer", - "Copy", - "CopyBuffer", - "CopyN", - "Discard", - "EOF", - "ErrClosedPipe", - "ErrNoProgress", - "ErrShortBuffer", - "ErrShortWrite", - "ErrUnexpectedEOF", - "LimitReader", - "LimitedReader", - "MultiReader", - "MultiWriter", - "NewOffsetWriter", - "NewSectionReader", - "NopCloser", - "OffsetWriter", - "Pipe", - "PipeReader", - "PipeWriter", - "ReadAll", - "ReadAtLeast", - "ReadCloser", - "ReadFull", - "ReadSeekCloser", - "ReadSeeker", - "ReadWriteCloser", - "ReadWriteSeeker", - "ReadWriter", - "Reader", - "ReaderAt", - "ReaderFrom", - "RuneReader", - "RuneScanner", - "SectionReader", - "SeekCurrent", - "SeekEnd", - "SeekStart", - "Seeker", - "StringWriter", - "TeeReader", - "WriteCloser", - "WriteSeeker", - "WriteString", - "Writer", - "WriterAt", - "WriterTo", - }, - "io/fs": { - "DirEntry", - "ErrClosed", - "ErrExist", - "ErrInvalid", - "ErrNotExist", - "ErrPermission", - "FS", - "File", - "FileInfo", - "FileInfoToDirEntry", - "FileMode", - "Glob", - "GlobFS", - "ModeAppend", - "ModeCharDevice", - "ModeDevice", - "ModeDir", - "ModeExclusive", - "ModeIrregular", - "ModeNamedPipe", - "ModePerm", - "ModeSetgid", - "ModeSetuid", - "ModeSocket", - "ModeSticky", - "ModeSymlink", - "ModeTemporary", - "ModeType", - "PathError", - "ReadDir", - "ReadDirFS", - "ReadDirFile", - "ReadFile", - "ReadFileFS", - "SkipAll", - "SkipDir", - "Stat", - "StatFS", - "Sub", - "SubFS", - "ValidPath", - "WalkDir", - "WalkDirFunc", - }, - "io/ioutil": { - "Discard", - "NopCloser", - "ReadAll", - "ReadDir", - "ReadFile", - "TempDir", - "TempFile", - "WriteFile", - }, - "log": { - "Default", - "Fatal", - "Fatalf", - "Fatalln", - "Flags", - "LUTC", - "Ldate", - "Llongfile", - "Lmicroseconds", - "Lmsgprefix", - "Logger", - "Lshortfile", - "LstdFlags", - "Ltime", - "New", - "Output", - "Panic", - "Panicf", - "Panicln", - "Prefix", - "Print", - "Printf", - "Println", - "SetFlags", - "SetOutput", - "SetPrefix", - "Writer", - }, - "log/syslog": { - "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": { - "Abs", - "Acos", - "Acosh", - "Asin", - "Asinh", - "Atan", - "Atan2", - "Atanh", - "Cbrt", - "Ceil", - "Copysign", - "Cos", - "Cosh", - "Dim", - "E", - "Erf", - "Erfc", - "Erfcinv", - "Erfinv", - "Exp", - "Exp2", - "Expm1", - "FMA", - "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", - "MaxInt", - "MaxInt16", - "MaxInt32", - "MaxInt64", - "MaxInt8", - "MaxUint", - "MaxUint16", - "MaxUint32", - "MaxUint64", - "MaxUint8", - "Min", - "MinInt", - "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": { - "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": { - "Add", - "Add32", - "Add64", - "Div", - "Div32", - "Div64", - "LeadingZeros", - "LeadingZeros16", - "LeadingZeros32", - "LeadingZeros64", - "LeadingZeros8", - "Len", - "Len16", - "Len32", - "Len64", - "Len8", - "Mul", - "Mul32", - "Mul64", - "OnesCount", - "OnesCount16", - "OnesCount32", - "OnesCount64", - "OnesCount8", - "Rem", - "Rem32", - "Rem64", - "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": { - "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": { - "ExpFloat64", - "Float32", - "Float64", - "Int", - "Int31", - "Int31n", - "Int63", - "Int63n", - "Intn", - "New", - "NewSource", - "NewZipf", - "NormFloat64", - "Perm", - "Rand", - "Read", - "Seed", - "Shuffle", - "Source", - "Source64", - "Uint32", - "Uint64", - "Zipf", - }, - "mime": { - "AddExtensionType", - "BEncoding", - "ErrInvalidMediaParameter", - "ExtensionsByType", - "FormatMediaType", - "ParseMediaType", - "QEncoding", - "TypeByExtension", - "WordDecoder", - "WordEncoder", - }, - "mime/multipart": { - "ErrMessageTooLarge", - "File", - "FileHeader", - "Form", - "NewReader", - "NewWriter", - "Part", - "Reader", - "Writer", - }, - "mime/quotedprintable": { - "NewReader", - "NewWriter", - "Reader", - "Writer", - }, - "net": { - "Addr", - "AddrError", - "Buffers", - "CIDRMask", - "Conn", - "DNSConfigError", - "DNSError", - "DefaultResolver", - "Dial", - "DialIP", - "DialTCP", - "DialTimeout", - "DialUDP", - "DialUnix", - "Dialer", - "ErrClosed", - "ErrWriteToConnected", - "Error", - "FileConn", - "FileListener", - "FilePacketConn", - "FlagBroadcast", - "FlagLoopback", - "FlagMulticast", - "FlagPointToPoint", - "FlagRunning", - "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", - "TCPAddrFromAddrPort", - "TCPConn", - "TCPListener", - "UDPAddr", - "UDPAddrFromAddrPort", - "UDPConn", - "UnixAddr", - "UnixConn", - "UnixListener", - "UnknownNetworkError", - }, - "net/http": { - "AllowQuerySemicolons", - "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", - "FS", - "File", - "FileServer", - "FileSystem", - "Flusher", - "Get", - "Handle", - "HandleFunc", - "Handler", - "HandlerFunc", - "Head", - "Header", - "Hijacker", - "ListenAndServe", - "ListenAndServeTLS", - "LocalAddrContextKey", - "MaxBytesError", - "MaxBytesHandler", - "MaxBytesReader", - "MethodConnect", - "MethodDelete", - "MethodGet", - "MethodHead", - "MethodOptions", - "MethodPatch", - "MethodPost", - "MethodPut", - "MethodTrace", - "NewFileTransport", - "NewRequest", - "NewRequestWithContext", - "NewResponseController", - "NewServeMux", - "NoBody", - "NotFound", - "NotFoundHandler", - "ParseHTTPVersion", - "ParseTime", - "Post", - "PostForm", - "ProtocolError", - "ProxyFromEnvironment", - "ProxyURL", - "PushOptions", - "Pusher", - "ReadRequest", - "ReadResponse", - "Redirect", - "RedirectHandler", - "Request", - "Response", - "ResponseController", - "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": { - "Handler", - "Request", - "RequestFromMap", - "Serve", - }, - "net/http/cookiejar": { - "Jar", - "New", - "Options", - "PublicSuffixList", - }, - "net/http/fcgi": { - "ErrConnClosed", - "ErrRequestAborted", - "ProcessEnv", - "Serve", - }, - "net/http/httptest": { - "DefaultRemoteAddr", - "NewRecorder", - "NewRequest", - "NewServer", - "NewTLSServer", - "NewUnstartedServer", - "ResponseRecorder", - "Server", - }, - "net/http/httptrace": { - "ClientTrace", - "ContextClientTrace", - "DNSDoneInfo", - "DNSStartInfo", - "GotConnInfo", - "WithClientTrace", - "WroteRequestInfo", - }, - "net/http/httputil": { - "BufferPool", - "ClientConn", - "DumpRequest", - "DumpRequestOut", - "DumpResponse", - "ErrClosed", - "ErrLineTooLong", - "ErrPersistEOF", - "ErrPipeline", - "NewChunkedReader", - "NewChunkedWriter", - "NewClientConn", - "NewProxyClientConn", - "NewServerConn", - "NewSingleHostReverseProxy", - "ProxyRequest", - "ReverseProxy", - "ServerConn", - }, - "net/http/pprof": { - "Cmdline", - "Handler", - "Index", - "Profile", - "Symbol", - "Trace", - }, - "net/mail": { - "Address", - "AddressParser", - "ErrHeaderNotPresent", - "Header", - "Message", - "ParseAddress", - "ParseAddressList", - "ParseDate", - "ReadMessage", - }, - "net/netip": { - "Addr", - "AddrFrom16", - "AddrFrom4", - "AddrFromSlice", - "AddrPort", - "AddrPortFrom", - "IPv4Unspecified", - "IPv6LinkLocalAllNodes", - "IPv6LinkLocalAllRouters", - "IPv6Loopback", - "IPv6Unspecified", - "MustParseAddr", - "MustParseAddrPort", - "MustParsePrefix", - "ParseAddr", - "ParseAddrPort", - "ParsePrefix", - "Prefix", - "PrefixFrom", - }, - "net/rpc": { - "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": { - "Dial", - "NewClient", - "NewClientCodec", - "NewServerCodec", - "ServeConn", - }, - "net/smtp": { - "Auth", - "CRAMMD5Auth", - "Client", - "Dial", - "NewClient", - "PlainAuth", - "SendMail", - "ServerInfo", - }, - "net/textproto": { - "CanonicalMIMEHeaderKey", - "Conn", - "Dial", - "Error", - "MIMEHeader", - "NewConn", - "NewReader", - "NewWriter", - "Pipeline", - "ProtocolError", - "Reader", - "TrimBytes", - "TrimString", - "Writer", - }, - "net/url": { - "Error", - "EscapeError", - "InvalidHostError", - "JoinPath", - "Parse", - "ParseQuery", - "ParseRequestURI", - "PathEscape", - "PathUnescape", - "QueryEscape", - "QueryUnescape", - "URL", - "User", - "UserPassword", - "Userinfo", - "Values", - }, - "os": { - "Args", - "Chdir", - "Chmod", - "Chown", - "Chtimes", - "Clearenv", - "Create", - "CreateTemp", - "DevNull", - "DirEntry", - "DirFS", - "Environ", - "ErrClosed", - "ErrDeadlineExceeded", - "ErrExist", - "ErrInvalid", - "ErrNoDeadline", - "ErrNotExist", - "ErrPermission", - "ErrProcessDone", - "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", - "MkdirTemp", - "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", - "ReadDir", - "ReadFile", - "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", - "WriteFile", - }, - "os/exec": { - "Cmd", - "Command", - "CommandContext", - "ErrDot", - "ErrNotFound", - "ErrWaitDelay", - "Error", - "ExitError", - "LookPath", - }, - "os/signal": { - "Ignore", - "Ignored", - "Notify", - "NotifyContext", - "Reset", - "Stop", - }, - "os/user": { - "Current", - "Group", - "Lookup", - "LookupGroup", - "LookupGroupId", - "LookupId", - "UnknownGroupError", - "UnknownGroupIdError", - "UnknownUserError", - "UnknownUserIdError", - "User", - }, - "path": { - "Base", - "Clean", - "Dir", - "ErrBadPattern", - "Ext", - "IsAbs", - "Join", - "Match", - "Split", - }, - "path/filepath": { - "Abs", - "Base", - "Clean", - "Dir", - "ErrBadPattern", - "EvalSymlinks", - "Ext", - "FromSlash", - "Glob", - "HasPrefix", - "IsAbs", - "IsLocal", - "Join", - "ListSeparator", - "Match", - "Rel", - "Separator", - "SkipAll", - "SkipDir", - "Split", - "SplitList", - "ToSlash", - "VolumeName", - "Walk", - "WalkDir", - "WalkFunc", - }, - "plugin": { - "Open", - "Plugin", - "Symbol", - }, - "reflect": { - "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", - "Pointer", - "PointerTo", - "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", - "VisibleFields", - "Zero", - }, - "regexp": { - "Compile", - "CompilePOSIX", - "Match", - "MatchReader", - "MatchString", - "MustCompile", - "MustCompilePOSIX", - "QuoteMeta", - "Regexp", - }, - "regexp/syntax": { - "ClassNL", - "Compile", - "DotNL", - "EmptyBeginLine", - "EmptyBeginText", - "EmptyEndLine", - "EmptyEndText", - "EmptyNoWordBoundary", - "EmptyOp", - "EmptyOpContext", - "EmptyWordBoundary", - "ErrInternalError", - "ErrInvalidCharClass", - "ErrInvalidCharRange", - "ErrInvalidEscape", - "ErrInvalidNamedCapture", - "ErrInvalidPerlOp", - "ErrInvalidRepeatOp", - "ErrInvalidRepeatSize", - "ErrInvalidUTF8", - "ErrLarge", - "ErrMissingBracket", - "ErrMissingParen", - "ErrMissingRepeatArgument", - "ErrNestingDepth", - "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": { - "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/cgo": { - "Handle", - "Incomplete", - "NewHandle", - }, - "runtime/coverage": { - "ClearCounters", - "WriteCounters", - "WriteCountersDir", - "WriteMeta", - "WriteMetaDir", - }, - "runtime/debug": { - "BuildInfo", - "BuildSetting", - "FreeOSMemory", - "GCStats", - "Module", - "ParseBuildInfo", - "PrintStack", - "ReadBuildInfo", - "ReadGCStats", - "SetGCPercent", - "SetMaxStack", - "SetMaxThreads", - "SetMemoryLimit", - "SetPanicOnFault", - "SetTraceback", - "Stack", - "WriteHeapDump", - }, - "runtime/metrics": { - "All", - "Description", - "Float64Histogram", - "KindBad", - "KindFloat64", - "KindFloat64Histogram", - "KindUint64", - "Read", - "Sample", - "Value", - "ValueKind", - }, - "runtime/pprof": { - "Do", - "ForLabels", - "Label", - "LabelSet", - "Labels", - "Lookup", - "NewProfile", - "Profile", - "Profiles", - "SetGoroutineLabels", - "StartCPUProfile", - "StopCPUProfile", - "WithLabels", - "WriteHeapProfile", - }, - "runtime/trace": { - "IsEnabled", - "Log", - "Logf", - "NewTask", - "Region", - "Start", - "StartRegion", - "Stop", - "Task", - "WithRegion", - }, - "sort": { - "Find", - "Float64Slice", - "Float64s", - "Float64sAreSorted", - "IntSlice", - "Interface", - "Ints", - "IntsAreSorted", - "IsSorted", - "Reverse", - "Search", - "SearchFloat64s", - "SearchInts", - "SearchStrings", - "Slice", - "SliceIsSorted", - "SliceStable", - "Sort", - "Stable", - "StringSlice", - "Strings", - "StringsAreSorted", - }, - "strconv": { - "AppendBool", - "AppendFloat", - "AppendInt", - "AppendQuote", - "AppendQuoteRune", - "AppendQuoteRuneToASCII", - "AppendQuoteRuneToGraphic", - "AppendQuoteToASCII", - "AppendQuoteToGraphic", - "AppendUint", - "Atoi", - "CanBackquote", - "ErrRange", - "ErrSyntax", - "FormatBool", - "FormatComplex", - "FormatFloat", - "FormatInt", - "FormatUint", - "IntSize", - "IsGraphic", - "IsPrint", - "Itoa", - "NumError", - "ParseBool", - "ParseComplex", - "ParseFloat", - "ParseInt", - "ParseUint", - "Quote", - "QuoteRune", - "QuoteRuneToASCII", - "QuoteRuneToGraphic", - "QuoteToASCII", - "QuoteToGraphic", - "QuotedPrefix", - "Unquote", - "UnquoteChar", - }, - "strings": { - "Builder", - "Clone", - "Compare", - "Contains", - "ContainsAny", - "ContainsRune", - "Count", - "Cut", - "CutPrefix", - "CutSuffix", - "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": { - "Cond", - "Locker", - "Map", - "Mutex", - "NewCond", - "Once", - "Pool", - "RWMutex", - "WaitGroup", - }, - "sync/atomic": { - "AddInt32", - "AddInt64", - "AddUint32", - "AddUint64", - "AddUintptr", - "Bool", - "CompareAndSwapInt32", - "CompareAndSwapInt64", - "CompareAndSwapPointer", - "CompareAndSwapUint32", - "CompareAndSwapUint64", - "CompareAndSwapUintptr", - "Int32", - "Int64", - "LoadInt32", - "LoadInt64", - "LoadPointer", - "LoadUint32", - "LoadUint64", - "LoadUintptr", - "Pointer", - "StoreInt32", - "StoreInt64", - "StorePointer", - "StoreUint32", - "StoreUint64", - "StoreUintptr", - "SwapInt32", - "SwapInt64", - "SwapPointer", - "SwapUint32", - "SwapUint64", - "SwapUintptr", - "Uint32", - "Uint64", - "Uintptr", - "Value", - }, - "syscall": { - "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_UTUN", - "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", - "AllThreadsSyscall", - "AllThreadsSyscall6", - "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_CLEAR_SIGHAND", - "CLONE_CSIGNAL", - "CLONE_DETACHED", - "CLONE_FILES", - "CLONE_FS", - "CLONE_INTO_CGROUP", - "CLONE_IO", - "CLONE_NEWCGROUP", - "CLONE_NEWIPC", - "CLONE_NEWNET", - "CLONE_NEWNS", - "CLONE_NEWPID", - "CLONE_NEWTIME", - "CLONE_NEWUSER", - "CLONE_NEWUTS", - "CLONE_PARENT", - "CLONE_PARENT_SETTID", - "CLONE_PID", - "CLONE_PIDFD", - "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_CLOSE_EVENT", - "CTRL_C_EVENT", - "CTRL_LOGOFF_EVENT", - "CTRL_SHUTDOWN_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", - "EQFULL", - "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_FINDSIGS", - "F_FLUSH_DATA", - "F_FREEZE_FS", - "F_FSCTL", - "F_FSDIRMASK", - "F_FSIN", - "F_FSINOUT", - "F_FSOUT", - "F_FSPRIV", - "F_FSVOID", - "F_FULLFSYNC", - "F_GETCODEDIR", - "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_GETPROTECTIONLEVEL", - "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_SETLKWTIMEOUT", - "F_SETLK_REMOTE", - "F_SETNOSIGPIPE", - "F_SETOWN", - "F_SETOWN_EX", - "F_SETPIPE_SZ", - "F_SETPROTECTIONCLASS", - "F_SETSIG", - "F_SETSIZE", - "F_SHLCK", - "F_SINGLE_WRITER", - "F_TEST", - "F_THAW_FS", - "F_TLOCK", - "F_TRANSCODEKEY", - "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_BACKGROUND", - "NOTE_CHILD", - "NOTE_CRITICAL", - "NOTE_DELETE", - "NOTE_EOF", - "NOTE_EXEC", - "NOTE_EXIT", - "NOTE_EXITSTATUS", - "NOTE_EXIT_CSERROR", - "NOTE_EXIT_DECRYPTFAIL", - "NOTE_EXIT_DETAIL", - "NOTE_EXIT_DETAIL_MASK", - "NOTE_EXIT_MEMORY", - "NOTE_EXIT_REPARENTED", - "NOTE_EXTEND", - "NOTE_FFAND", - "NOTE_FFCOPY", - "NOTE_FFCTRLMASK", - "NOTE_FFLAGSMASK", - "NOTE_FFNOP", - "NOTE_FFOR", - "NOTE_FORK", - "NOTE_LEEWAY", - "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_DP_GETRAWENCRYPTED", - "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_CPU_USAGE_MONITOR", - "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_PROXY", - "RTF_REINSTATE", - "RTF_REJECT", - "RTF_RNH_LOCKED", - "RTF_ROUTER", - "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_NUMRCVPKT", - "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_CSOPS_AUDITTOKEN", - "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_KAS_INFO", - "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_LEDGER", - "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_DPROTECTED_NP", - "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", - "SyscallN", - "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_ENABLE_ECN", - "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_NOTSENT_LOWAT", - "TCP_NSTATES", - "TCP_QUICKACK", - "TCP_RXT_CONNDROPTIME", - "TCP_RXT_FINDROP", - "TCP_SACK_ENABLE", - "TCP_SENDMOREACKS", - "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": { - "CopyBytesToGo", - "CopyBytesToJS", - "Error", - "Func", - "FuncOf", - "Global", - "Null", - "Type", - "TypeBoolean", - "TypeFunction", - "TypeNull", - "TypeNumber", - "TypeObject", - "TypeString", - "TypeSymbol", - "TypeUndefined", - "Undefined", - "Value", - "ValueError", - "ValueOf", - }, - "testing": { - "AllocsPerRun", - "B", - "Benchmark", - "BenchmarkResult", - "Cover", - "CoverBlock", - "CoverMode", - "Coverage", - "F", - "Init", - "InternalBenchmark", - "InternalExample", - "InternalFuzzTarget", - "InternalTest", - "M", - "Main", - "MainStart", - "PB", - "RegisterCover", - "RunBenchmarks", - "RunExamples", - "RunTests", - "Short", - "T", - "TB", - "Verbose", - }, - "testing/fstest": { - "MapFS", - "MapFile", - "TestFS", - }, - "testing/iotest": { - "DataErrReader", - "ErrReader", - "ErrTimeout", - "HalfReader", - "NewReadLogger", - "NewWriteLogger", - "OneByteReader", - "TestReader", - "TimeoutReader", - "TruncateWriter", - }, - "testing/quick": { - "Check", - "CheckEqual", - "CheckEqualError", - "CheckError", - "Config", - "Generator", - "SetupError", - "Value", - }, - "text/scanner": { - "Char", - "Comment", - "EOF", - "Float", - "GoTokens", - "GoWhitespace", - "Ident", - "Int", - "Position", - "RawString", - "ScanChars", - "ScanComments", - "ScanFloats", - "ScanIdents", - "ScanInts", - "ScanRawStrings", - "ScanStrings", - "Scanner", - "SkipComments", - "String", - "TokenString", - }, - "text/tabwriter": { - "AlignRight", - "Debug", - "DiscardEmptyColumns", - "Escape", - "FilterHTML", - "NewWriter", - "StripEscape", - "TabIndent", - "Writer", - }, - "text/template": { - "ExecError", - "FuncMap", - "HTMLEscape", - "HTMLEscapeString", - "HTMLEscaper", - "IsTrue", - "JSEscape", - "JSEscapeString", - "JSEscaper", - "Must", - "New", - "ParseFS", - "ParseFiles", - "ParseGlob", - "Template", - "URLQueryEscaper", - }, - "text/template/parse": { - "ActionNode", - "BoolNode", - "BranchNode", - "BreakNode", - "ChainNode", - "CommandNode", - "CommentNode", - "ContinueNode", - "DotNode", - "FieldNode", - "IdentifierNode", - "IfNode", - "IsEmptyTree", - "ListNode", - "Mode", - "New", - "NewIdentifier", - "NilNode", - "Node", - "NodeAction", - "NodeBool", - "NodeBreak", - "NodeChain", - "NodeCommand", - "NodeComment", - "NodeContinue", - "NodeDot", - "NodeField", - "NodeIdentifier", - "NodeIf", - "NodeList", - "NodeNil", - "NodeNumber", - "NodePipe", - "NodeRange", - "NodeString", - "NodeTemplate", - "NodeText", - "NodeType", - "NodeVariable", - "NodeWith", - "NumberNode", - "Parse", - "ParseComments", - "PipeNode", - "Pos", - "RangeNode", - "SkipFuncCheck", - "StringNode", - "TemplateNode", - "TextNode", - "Tree", - "VariableNode", - "WithNode", - }, - "time": { - "ANSIC", - "After", - "AfterFunc", - "April", - "August", - "Date", - "DateOnly", - "DateTime", - "December", - "Duration", - "February", - "FixedZone", - "Friday", - "Hour", - "January", - "July", - "June", - "Kitchen", - "Layout", - "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", - "TimeOnly", - "Timer", - "Tuesday", - "UTC", - "Unix", - "UnixDate", - "UnixMicro", - "UnixMilli", - "Until", - "Wednesday", - "Weekday", - }, - "unicode": { - "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", - "Chorasmian", - "Co", - "Common", - "Coptic", - "Cs", - "Cuneiform", - "Cypriot", - "Cyrillic", - "Dash", - "Deprecated", - "Deseret", - "Devanagari", - "Diacritic", - "Digit", - "Dives_Akuru", - "Dogra", - "Duployan", - "Egyptian_Hieroglyphs", - "Elbasan", - "Elymaic", - "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", - "Khitan_Small_Script", - "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", - "Nandinagari", - "Nd", - "New_Tai_Lue", - "Newa", - "Nko", - "Nl", - "No", - "Noncharacter_Code_Point", - "Number", - "Nushu", - "Nyiakeng_Puachue_Hmong", - "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", - "Wancho", - "Warang_Citi", - "White_Space", - "Yezidi", - "Yi", - "Z", - "Zanabazar_Square", - "Zl", - "Zp", - "Zs", - }, - "unicode/utf16": { - "AppendRune", - "Decode", - "DecodeRune", - "Encode", - "EncodeRune", - "IsSurrogate", - }, - "unicode/utf8": { - "AppendRune", - "DecodeLastRune", - "DecodeLastRuneInString", - "DecodeRune", - "DecodeRuneInString", - "EncodeRune", - "FullRune", - "FullRuneInString", - "MaxRune", - "RuneCount", - "RuneCountInString", - "RuneError", - "RuneLen", - "RuneSelf", - "RuneStart", - "UTFMax", - "Valid", - "ValidRune", - "ValidString", - }, - "unsafe": { - "Add", - "Alignof", - "Offsetof", - "Pointer", - "Sizeof", - "Slice", - "SliceData", - "String", - "StringData", - }, -} diff --git a/vendor/golang.org/x/tools/internal/stdlib/manifest.go b/vendor/golang.org/x/tools/internal/stdlib/manifest.go new file mode 100644 index 0000000000..a928acf29f --- /dev/null +++ b/vendor/golang.org/x/tools/internal/stdlib/manifest.go @@ -0,0 +1,17431 @@ +// Copyright 2024 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. + +// Code generated by generate.go. DO NOT EDIT. + +package stdlib + +var PackageSymbols = map[string][]Symbol{ + "archive/tar": { + {"(*Header).FileInfo", Method, 1}, + {"(*Reader).Next", Method, 0}, + {"(*Reader).Read", Method, 0}, + {"(*Writer).AddFS", Method, 22}, + {"(*Writer).Close", Method, 0}, + {"(*Writer).Flush", Method, 0}, + {"(*Writer).Write", Method, 0}, + {"(*Writer).WriteHeader", Method, 0}, + {"(Format).String", Method, 10}, + {"ErrFieldTooLong", Var, 0}, + {"ErrHeader", Var, 0}, + {"ErrInsecurePath", Var, 20}, + {"ErrWriteAfterClose", Var, 0}, + {"ErrWriteTooLong", Var, 0}, + {"FileInfoHeader", Func, 1}, + {"FileInfoNames", Type, 23}, + {"Format", Type, 10}, + {"FormatGNU", Const, 10}, + {"FormatPAX", Const, 10}, + {"FormatUSTAR", Const, 10}, + {"FormatUnknown", Const, 10}, + {"Header", Type, 0}, + {"Header.AccessTime", Field, 0}, + {"Header.ChangeTime", Field, 0}, + {"Header.Devmajor", Field, 0}, + {"Header.Devminor", Field, 0}, + {"Header.Format", Field, 10}, + {"Header.Gid", Field, 0}, + {"Header.Gname", Field, 0}, + {"Header.Linkname", Field, 0}, + {"Header.ModTime", Field, 0}, + {"Header.Mode", Field, 0}, + {"Header.Name", Field, 0}, + {"Header.PAXRecords", Field, 10}, + {"Header.Size", Field, 0}, + {"Header.Typeflag", Field, 0}, + {"Header.Uid", Field, 0}, + {"Header.Uname", Field, 0}, + {"Header.Xattrs", Field, 3}, + {"NewReader", Func, 0}, + {"NewWriter", Func, 0}, + {"Reader", Type, 0}, + {"TypeBlock", Const, 0}, + {"TypeChar", Const, 0}, + {"TypeCont", Const, 0}, + {"TypeDir", Const, 0}, + {"TypeFifo", Const, 0}, + {"TypeGNULongLink", Const, 1}, + {"TypeGNULongName", Const, 1}, + {"TypeGNUSparse", Const, 3}, + {"TypeLink", Const, 0}, + {"TypeReg", Const, 0}, + {"TypeRegA", Const, 0}, + {"TypeSymlink", Const, 0}, + {"TypeXGlobalHeader", Const, 0}, + {"TypeXHeader", Const, 0}, + {"Writer", Type, 0}, + }, + "archive/zip": { + {"(*File).DataOffset", Method, 2}, + {"(*File).FileInfo", Method, 0}, + {"(*File).ModTime", Method, 0}, + {"(*File).Mode", Method, 0}, + {"(*File).Open", Method, 0}, + {"(*File).OpenRaw", Method, 17}, + {"(*File).SetModTime", Method, 0}, + {"(*File).SetMode", Method, 0}, + {"(*FileHeader).FileInfo", Method, 0}, + {"(*FileHeader).ModTime", Method, 0}, + {"(*FileHeader).Mode", Method, 0}, + {"(*FileHeader).SetModTime", Method, 0}, + {"(*FileHeader).SetMode", Method, 0}, + {"(*ReadCloser).Close", Method, 0}, + {"(*ReadCloser).Open", Method, 16}, + {"(*ReadCloser).RegisterDecompressor", Method, 6}, + {"(*Reader).Open", Method, 16}, + {"(*Reader).RegisterDecompressor", Method, 6}, + {"(*Writer).AddFS", Method, 22}, + {"(*Writer).Close", Method, 0}, + {"(*Writer).Copy", Method, 17}, + {"(*Writer).Create", Method, 0}, + {"(*Writer).CreateHeader", Method, 0}, + {"(*Writer).CreateRaw", Method, 17}, + {"(*Writer).Flush", Method, 4}, + {"(*Writer).RegisterCompressor", Method, 6}, + {"(*Writer).SetComment", Method, 10}, + {"(*Writer).SetOffset", Method, 5}, + {"Compressor", Type, 2}, + {"Decompressor", Type, 2}, + {"Deflate", Const, 0}, + {"ErrAlgorithm", Var, 0}, + {"ErrChecksum", Var, 0}, + {"ErrFormat", Var, 0}, + {"ErrInsecurePath", Var, 20}, + {"File", Type, 0}, + {"File.FileHeader", Field, 0}, + {"FileHeader", Type, 0}, + {"FileHeader.CRC32", Field, 0}, + {"FileHeader.Comment", Field, 0}, + {"FileHeader.CompressedSize", Field, 0}, + {"FileHeader.CompressedSize64", Field, 1}, + {"FileHeader.CreatorVersion", Field, 0}, + {"FileHeader.ExternalAttrs", Field, 0}, + {"FileHeader.Extra", Field, 0}, + {"FileHeader.Flags", Field, 0}, + {"FileHeader.Method", Field, 0}, + {"FileHeader.Modified", Field, 10}, + {"FileHeader.ModifiedDate", Field, 0}, + {"FileHeader.ModifiedTime", Field, 0}, + {"FileHeader.Name", Field, 0}, + {"FileHeader.NonUTF8", Field, 10}, + {"FileHeader.ReaderVersion", Field, 0}, + {"FileHeader.UncompressedSize", Field, 0}, + {"FileHeader.UncompressedSize64", Field, 1}, + {"FileInfoHeader", Func, 0}, + {"NewReader", Func, 0}, + {"NewWriter", Func, 0}, + {"OpenReader", Func, 0}, + {"ReadCloser", Type, 0}, + {"ReadCloser.Reader", Field, 0}, + {"Reader", Type, 0}, + {"Reader.Comment", Field, 0}, + {"Reader.File", Field, 0}, + {"RegisterCompressor", Func, 2}, + {"RegisterDecompressor", Func, 2}, + {"Store", Const, 0}, + {"Writer", Type, 0}, + }, + "bufio": { + {"(*Reader).Buffered", Method, 0}, + {"(*Reader).Discard", Method, 5}, + {"(*Reader).Peek", Method, 0}, + {"(*Reader).Read", Method, 0}, + {"(*Reader).ReadByte", Method, 0}, + {"(*Reader).ReadBytes", Method, 0}, + {"(*Reader).ReadLine", Method, 0}, + {"(*Reader).ReadRune", Method, 0}, + {"(*Reader).ReadSlice", Method, 0}, + {"(*Reader).ReadString", Method, 0}, + {"(*Reader).Reset", Method, 2}, + {"(*Reader).Size", Method, 10}, + {"(*Reader).UnreadByte", Method, 0}, + {"(*Reader).UnreadRune", Method, 0}, + {"(*Reader).WriteTo", Method, 1}, + {"(*Scanner).Buffer", Method, 6}, + {"(*Scanner).Bytes", Method, 1}, + {"(*Scanner).Err", Method, 1}, + {"(*Scanner).Scan", Method, 1}, + {"(*Scanner).Split", Method, 1}, + {"(*Scanner).Text", Method, 1}, + {"(*Writer).Available", Method, 0}, + {"(*Writer).AvailableBuffer", Method, 18}, + {"(*Writer).Buffered", Method, 0}, + {"(*Writer).Flush", Method, 0}, + {"(*Writer).ReadFrom", Method, 1}, + {"(*Writer).Reset", Method, 2}, + {"(*Writer).Size", Method, 10}, + {"(*Writer).Write", Method, 0}, + {"(*Writer).WriteByte", Method, 0}, + {"(*Writer).WriteRune", Method, 0}, + {"(*Writer).WriteString", Method, 0}, + {"(ReadWriter).Available", Method, 0}, + {"(ReadWriter).AvailableBuffer", Method, 18}, + {"(ReadWriter).Discard", Method, 5}, + {"(ReadWriter).Flush", Method, 0}, + {"(ReadWriter).Peek", Method, 0}, + {"(ReadWriter).Read", Method, 0}, + {"(ReadWriter).ReadByte", Method, 0}, + {"(ReadWriter).ReadBytes", Method, 0}, + {"(ReadWriter).ReadFrom", Method, 1}, + {"(ReadWriter).ReadLine", Method, 0}, + {"(ReadWriter).ReadRune", Method, 0}, + {"(ReadWriter).ReadSlice", Method, 0}, + {"(ReadWriter).ReadString", Method, 0}, + {"(ReadWriter).UnreadByte", Method, 0}, + {"(ReadWriter).UnreadRune", Method, 0}, + {"(ReadWriter).Write", Method, 0}, + {"(ReadWriter).WriteByte", Method, 0}, + {"(ReadWriter).WriteRune", Method, 0}, + {"(ReadWriter).WriteString", Method, 0}, + {"(ReadWriter).WriteTo", Method, 1}, + {"ErrAdvanceTooFar", Var, 1}, + {"ErrBadReadCount", Var, 15}, + {"ErrBufferFull", Var, 0}, + {"ErrFinalToken", Var, 6}, + {"ErrInvalidUnreadByte", Var, 0}, + {"ErrInvalidUnreadRune", Var, 0}, + {"ErrNegativeAdvance", Var, 1}, + {"ErrNegativeCount", Var, 0}, + {"ErrTooLong", Var, 1}, + {"MaxScanTokenSize", Const, 1}, + {"NewReadWriter", Func, 0}, + {"NewReader", Func, 0}, + {"NewReaderSize", Func, 0}, + {"NewScanner", Func, 1}, + {"NewWriter", Func, 0}, + {"NewWriterSize", Func, 0}, + {"ReadWriter", Type, 0}, + {"ReadWriter.Reader", Field, 0}, + {"ReadWriter.Writer", Field, 0}, + {"Reader", Type, 0}, + {"ScanBytes", Func, 1}, + {"ScanLines", Func, 1}, + {"ScanRunes", Func, 1}, + {"ScanWords", Func, 1}, + {"Scanner", Type, 1}, + {"SplitFunc", Type, 1}, + {"Writer", Type, 0}, + }, + "bytes": { + {"(*Buffer).Available", Method, 21}, + {"(*Buffer).AvailableBuffer", Method, 21}, + {"(*Buffer).Bytes", Method, 0}, + {"(*Buffer).Cap", Method, 5}, + {"(*Buffer).Grow", Method, 1}, + {"(*Buffer).Len", Method, 0}, + {"(*Buffer).Next", Method, 0}, + {"(*Buffer).Read", Method, 0}, + {"(*Buffer).ReadByte", Method, 0}, + {"(*Buffer).ReadBytes", Method, 0}, + {"(*Buffer).ReadFrom", Method, 0}, + {"(*Buffer).ReadRune", Method, 0}, + {"(*Buffer).ReadString", Method, 0}, + {"(*Buffer).Reset", Method, 0}, + {"(*Buffer).String", Method, 0}, + {"(*Buffer).Truncate", Method, 0}, + {"(*Buffer).UnreadByte", Method, 0}, + {"(*Buffer).UnreadRune", Method, 0}, + {"(*Buffer).Write", Method, 0}, + {"(*Buffer).WriteByte", Method, 0}, + {"(*Buffer).WriteRune", Method, 0}, + {"(*Buffer).WriteString", Method, 0}, + {"(*Buffer).WriteTo", Method, 0}, + {"(*Reader).Len", Method, 0}, + {"(*Reader).Read", Method, 0}, + {"(*Reader).ReadAt", Method, 0}, + {"(*Reader).ReadByte", Method, 0}, + {"(*Reader).ReadRune", Method, 0}, + {"(*Reader).Reset", Method, 7}, + {"(*Reader).Seek", Method, 0}, + {"(*Reader).Size", Method, 5}, + {"(*Reader).UnreadByte", Method, 0}, + {"(*Reader).UnreadRune", Method, 0}, + {"(*Reader).WriteTo", Method, 1}, + {"Buffer", Type, 0}, + {"Clone", Func, 20}, + {"Compare", Func, 0}, + {"Contains", Func, 0}, + {"ContainsAny", Func, 7}, + {"ContainsFunc", Func, 21}, + {"ContainsRune", Func, 7}, + {"Count", Func, 0}, + {"Cut", Func, 18}, + {"CutPrefix", Func, 20}, + {"CutSuffix", Func, 20}, + {"Equal", Func, 0}, + {"EqualFold", Func, 0}, + {"ErrTooLarge", Var, 0}, + {"Fields", Func, 0}, + {"FieldsFunc", Func, 0}, + {"HasPrefix", Func, 0}, + {"HasSuffix", Func, 0}, + {"Index", Func, 0}, + {"IndexAny", Func, 0}, + {"IndexByte", Func, 0}, + {"IndexFunc", Func, 0}, + {"IndexRune", Func, 0}, + {"Join", Func, 0}, + {"LastIndex", Func, 0}, + {"LastIndexAny", Func, 0}, + {"LastIndexByte", Func, 5}, + {"LastIndexFunc", Func, 0}, + {"Map", Func, 0}, + {"MinRead", Const, 0}, + {"NewBuffer", Func, 0}, + {"NewBufferString", Func, 0}, + {"NewReader", Func, 0}, + {"Reader", Type, 0}, + {"Repeat", Func, 0}, + {"Replace", Func, 0}, + {"ReplaceAll", Func, 12}, + {"Runes", Func, 0}, + {"Split", Func, 0}, + {"SplitAfter", Func, 0}, + {"SplitAfterN", Func, 0}, + {"SplitN", Func, 0}, + {"Title", Func, 0}, + {"ToLower", Func, 0}, + {"ToLowerSpecial", Func, 0}, + {"ToTitle", Func, 0}, + {"ToTitleSpecial", Func, 0}, + {"ToUpper", Func, 0}, + {"ToUpperSpecial", Func, 0}, + {"ToValidUTF8", Func, 13}, + {"Trim", Func, 0}, + {"TrimFunc", Func, 0}, + {"TrimLeft", Func, 0}, + {"TrimLeftFunc", Func, 0}, + {"TrimPrefix", Func, 1}, + {"TrimRight", Func, 0}, + {"TrimRightFunc", Func, 0}, + {"TrimSpace", Func, 0}, + {"TrimSuffix", Func, 1}, + }, + "cmp": { + {"Compare", Func, 21}, + {"Less", Func, 21}, + {"Or", Func, 22}, + {"Ordered", Type, 21}, + }, + "compress/bzip2": { + {"(StructuralError).Error", Method, 0}, + {"NewReader", Func, 0}, + {"StructuralError", Type, 0}, + }, + "compress/flate": { + {"(*ReadError).Error", Method, 0}, + {"(*WriteError).Error", Method, 0}, + {"(*Writer).Close", Method, 0}, + {"(*Writer).Flush", Method, 0}, + {"(*Writer).Reset", Method, 2}, + {"(*Writer).Write", Method, 0}, + {"(CorruptInputError).Error", Method, 0}, + {"(InternalError).Error", Method, 0}, + {"BestCompression", Const, 0}, + {"BestSpeed", Const, 0}, + {"CorruptInputError", Type, 0}, + {"DefaultCompression", Const, 0}, + {"HuffmanOnly", Const, 7}, + {"InternalError", Type, 0}, + {"NewReader", Func, 0}, + {"NewReaderDict", Func, 0}, + {"NewWriter", Func, 0}, + {"NewWriterDict", Func, 0}, + {"NoCompression", Const, 0}, + {"ReadError", Type, 0}, + {"ReadError.Err", Field, 0}, + {"ReadError.Offset", Field, 0}, + {"Reader", Type, 0}, + {"Resetter", Type, 4}, + {"WriteError", Type, 0}, + {"WriteError.Err", Field, 0}, + {"WriteError.Offset", Field, 0}, + {"Writer", Type, 0}, + }, + "compress/gzip": { + {"(*Reader).Close", Method, 0}, + {"(*Reader).Multistream", Method, 4}, + {"(*Reader).Read", Method, 0}, + {"(*Reader).Reset", Method, 3}, + {"(*Writer).Close", Method, 0}, + {"(*Writer).Flush", Method, 1}, + {"(*Writer).Reset", Method, 2}, + {"(*Writer).Write", Method, 0}, + {"BestCompression", Const, 0}, + {"BestSpeed", Const, 0}, + {"DefaultCompression", Const, 0}, + {"ErrChecksum", Var, 0}, + {"ErrHeader", Var, 0}, + {"Header", Type, 0}, + {"Header.Comment", Field, 0}, + {"Header.Extra", Field, 0}, + {"Header.ModTime", Field, 0}, + {"Header.Name", Field, 0}, + {"Header.OS", Field, 0}, + {"HuffmanOnly", Const, 8}, + {"NewReader", Func, 0}, + {"NewWriter", Func, 0}, + {"NewWriterLevel", Func, 0}, + {"NoCompression", Const, 0}, + {"Reader", Type, 0}, + {"Reader.Header", Field, 0}, + {"Writer", Type, 0}, + {"Writer.Header", Field, 0}, + }, + "compress/lzw": { + {"(*Reader).Close", Method, 17}, + {"(*Reader).Read", Method, 17}, + {"(*Reader).Reset", Method, 17}, + {"(*Writer).Close", Method, 17}, + {"(*Writer).Reset", Method, 17}, + {"(*Writer).Write", Method, 17}, + {"LSB", Const, 0}, + {"MSB", Const, 0}, + {"NewReader", Func, 0}, + {"NewWriter", Func, 0}, + {"Order", Type, 0}, + {"Reader", Type, 17}, + {"Writer", Type, 17}, + }, + "compress/zlib": { + {"(*Writer).Close", Method, 0}, + {"(*Writer).Flush", Method, 0}, + {"(*Writer).Reset", Method, 2}, + {"(*Writer).Write", Method, 0}, + {"BestCompression", Const, 0}, + {"BestSpeed", Const, 0}, + {"DefaultCompression", Const, 0}, + {"ErrChecksum", Var, 0}, + {"ErrDictionary", Var, 0}, + {"ErrHeader", Var, 0}, + {"HuffmanOnly", Const, 8}, + {"NewReader", Func, 0}, + {"NewReaderDict", Func, 0}, + {"NewWriter", Func, 0}, + {"NewWriterLevel", Func, 0}, + {"NewWriterLevelDict", Func, 0}, + {"NoCompression", Const, 0}, + {"Resetter", Type, 4}, + {"Writer", Type, 0}, + }, + "container/heap": { + {"Fix", Func, 2}, + {"Init", Func, 0}, + {"Interface", Type, 0}, + {"Pop", Func, 0}, + {"Push", Func, 0}, + {"Remove", Func, 0}, + }, + "container/list": { + {"(*Element).Next", Method, 0}, + {"(*Element).Prev", Method, 0}, + {"(*List).Back", Method, 0}, + {"(*List).Front", Method, 0}, + {"(*List).Init", Method, 0}, + {"(*List).InsertAfter", Method, 0}, + {"(*List).InsertBefore", Method, 0}, + {"(*List).Len", Method, 0}, + {"(*List).MoveAfter", Method, 2}, + {"(*List).MoveBefore", Method, 2}, + {"(*List).MoveToBack", Method, 0}, + {"(*List).MoveToFront", Method, 0}, + {"(*List).PushBack", Method, 0}, + {"(*List).PushBackList", Method, 0}, + {"(*List).PushFront", Method, 0}, + {"(*List).PushFrontList", Method, 0}, + {"(*List).Remove", Method, 0}, + {"Element", Type, 0}, + {"Element.Value", Field, 0}, + {"List", Type, 0}, + {"New", Func, 0}, + }, + "container/ring": { + {"(*Ring).Do", Method, 0}, + {"(*Ring).Len", Method, 0}, + {"(*Ring).Link", Method, 0}, + {"(*Ring).Move", Method, 0}, + {"(*Ring).Next", Method, 0}, + {"(*Ring).Prev", Method, 0}, + {"(*Ring).Unlink", Method, 0}, + {"New", Func, 0}, + {"Ring", Type, 0}, + {"Ring.Value", Field, 0}, + }, + "context": { + {"AfterFunc", Func, 21}, + {"Background", Func, 7}, + {"CancelCauseFunc", Type, 20}, + {"CancelFunc", Type, 7}, + {"Canceled", Var, 7}, + {"Cause", Func, 20}, + {"Context", Type, 7}, + {"DeadlineExceeded", Var, 7}, + {"TODO", Func, 7}, + {"WithCancel", Func, 7}, + {"WithCancelCause", Func, 20}, + {"WithDeadline", Func, 7}, + {"WithDeadlineCause", Func, 21}, + {"WithTimeout", Func, 7}, + {"WithTimeoutCause", Func, 21}, + {"WithValue", Func, 7}, + {"WithoutCancel", Func, 21}, + }, + "crypto": { + {"(Hash).Available", Method, 0}, + {"(Hash).HashFunc", Method, 4}, + {"(Hash).New", Method, 0}, + {"(Hash).Size", Method, 0}, + {"(Hash).String", Method, 15}, + {"BLAKE2b_256", Const, 9}, + {"BLAKE2b_384", Const, 9}, + {"BLAKE2b_512", Const, 9}, + {"BLAKE2s_256", Const, 9}, + {"Decrypter", Type, 5}, + {"DecrypterOpts", Type, 5}, + {"Hash", Type, 0}, + {"MD4", Const, 0}, + {"MD5", Const, 0}, + {"MD5SHA1", Const, 0}, + {"PrivateKey", Type, 0}, + {"PublicKey", Type, 2}, + {"RIPEMD160", Const, 0}, + {"RegisterHash", Func, 0}, + {"SHA1", Const, 0}, + {"SHA224", Const, 0}, + {"SHA256", Const, 0}, + {"SHA384", Const, 0}, + {"SHA3_224", Const, 4}, + {"SHA3_256", Const, 4}, + {"SHA3_384", Const, 4}, + {"SHA3_512", Const, 4}, + {"SHA512", Const, 0}, + {"SHA512_224", Const, 5}, + {"SHA512_256", Const, 5}, + {"Signer", Type, 4}, + {"SignerOpts", Type, 4}, + }, + "crypto/aes": { + {"(KeySizeError).Error", Method, 0}, + {"BlockSize", Const, 0}, + {"KeySizeError", Type, 0}, + {"NewCipher", Func, 0}, + }, + "crypto/cipher": { + {"(StreamReader).Read", Method, 0}, + {"(StreamWriter).Close", Method, 0}, + {"(StreamWriter).Write", Method, 0}, + {"AEAD", Type, 2}, + {"Block", Type, 0}, + {"BlockMode", Type, 0}, + {"NewCBCDecrypter", Func, 0}, + {"NewCBCEncrypter", Func, 0}, + {"NewCFBDecrypter", Func, 0}, + {"NewCFBEncrypter", Func, 0}, + {"NewCTR", Func, 0}, + {"NewGCM", Func, 2}, + {"NewGCMWithNonceSize", Func, 5}, + {"NewGCMWithTagSize", Func, 11}, + {"NewOFB", Func, 0}, + {"Stream", Type, 0}, + {"StreamReader", Type, 0}, + {"StreamReader.R", Field, 0}, + {"StreamReader.S", Field, 0}, + {"StreamWriter", Type, 0}, + {"StreamWriter.Err", Field, 0}, + {"StreamWriter.S", Field, 0}, + {"StreamWriter.W", Field, 0}, + }, + "crypto/des": { + {"(KeySizeError).Error", Method, 0}, + {"BlockSize", Const, 0}, + {"KeySizeError", Type, 0}, + {"NewCipher", Func, 0}, + {"NewTripleDESCipher", Func, 0}, + }, + "crypto/dsa": { + {"ErrInvalidPublicKey", Var, 0}, + {"GenerateKey", Func, 0}, + {"GenerateParameters", Func, 0}, + {"L1024N160", Const, 0}, + {"L2048N224", Const, 0}, + {"L2048N256", Const, 0}, + {"L3072N256", Const, 0}, + {"ParameterSizes", Type, 0}, + {"Parameters", Type, 0}, + {"Parameters.G", Field, 0}, + {"Parameters.P", Field, 0}, + {"Parameters.Q", Field, 0}, + {"PrivateKey", Type, 0}, + {"PrivateKey.PublicKey", Field, 0}, + {"PrivateKey.X", Field, 0}, + {"PublicKey", Type, 0}, + {"PublicKey.Parameters", Field, 0}, + {"PublicKey.Y", Field, 0}, + {"Sign", Func, 0}, + {"Verify", Func, 0}, + }, + "crypto/ecdh": { + {"(*PrivateKey).Bytes", Method, 20}, + {"(*PrivateKey).Curve", Method, 20}, + {"(*PrivateKey).ECDH", Method, 20}, + {"(*PrivateKey).Equal", Method, 20}, + {"(*PrivateKey).Public", Method, 20}, + {"(*PrivateKey).PublicKey", Method, 20}, + {"(*PublicKey).Bytes", Method, 20}, + {"(*PublicKey).Curve", Method, 20}, + {"(*PublicKey).Equal", Method, 20}, + {"Curve", Type, 20}, + {"P256", Func, 20}, + {"P384", Func, 20}, + {"P521", Func, 20}, + {"PrivateKey", Type, 20}, + {"PublicKey", Type, 20}, + {"X25519", Func, 20}, + }, + "crypto/ecdsa": { + {"(*PrivateKey).ECDH", Method, 20}, + {"(*PrivateKey).Equal", Method, 15}, + {"(*PrivateKey).Public", Method, 4}, + {"(*PrivateKey).Sign", Method, 4}, + {"(*PublicKey).ECDH", Method, 20}, + {"(*PublicKey).Equal", Method, 15}, + {"(PrivateKey).Add", Method, 0}, + {"(PrivateKey).Double", Method, 0}, + {"(PrivateKey).IsOnCurve", Method, 0}, + {"(PrivateKey).Params", Method, 0}, + {"(PrivateKey).ScalarBaseMult", Method, 0}, + {"(PrivateKey).ScalarMult", Method, 0}, + {"(PublicKey).Add", Method, 0}, + {"(PublicKey).Double", Method, 0}, + {"(PublicKey).IsOnCurve", Method, 0}, + {"(PublicKey).Params", Method, 0}, + {"(PublicKey).ScalarBaseMult", Method, 0}, + {"(PublicKey).ScalarMult", Method, 0}, + {"GenerateKey", Func, 0}, + {"PrivateKey", Type, 0}, + {"PrivateKey.D", Field, 0}, + {"PrivateKey.PublicKey", Field, 0}, + {"PublicKey", Type, 0}, + {"PublicKey.Curve", Field, 0}, + {"PublicKey.X", Field, 0}, + {"PublicKey.Y", Field, 0}, + {"Sign", Func, 0}, + {"SignASN1", Func, 15}, + {"Verify", Func, 0}, + {"VerifyASN1", Func, 15}, + }, + "crypto/ed25519": { + {"(*Options).HashFunc", Method, 20}, + {"(PrivateKey).Equal", Method, 15}, + {"(PrivateKey).Public", Method, 13}, + {"(PrivateKey).Seed", Method, 13}, + {"(PrivateKey).Sign", Method, 13}, + {"(PublicKey).Equal", Method, 15}, + {"GenerateKey", Func, 13}, + {"NewKeyFromSeed", Func, 13}, + {"Options", Type, 20}, + {"Options.Context", Field, 20}, + {"Options.Hash", Field, 20}, + {"PrivateKey", Type, 13}, + {"PrivateKeySize", Const, 13}, + {"PublicKey", Type, 13}, + {"PublicKeySize", Const, 13}, + {"SeedSize", Const, 13}, + {"Sign", Func, 13}, + {"SignatureSize", Const, 13}, + {"Verify", Func, 13}, + {"VerifyWithOptions", Func, 20}, + }, + "crypto/elliptic": { + {"(*CurveParams).Add", Method, 0}, + {"(*CurveParams).Double", Method, 0}, + {"(*CurveParams).IsOnCurve", Method, 0}, + {"(*CurveParams).Params", Method, 0}, + {"(*CurveParams).ScalarBaseMult", Method, 0}, + {"(*CurveParams).ScalarMult", Method, 0}, + {"Curve", Type, 0}, + {"CurveParams", Type, 0}, + {"CurveParams.B", Field, 0}, + {"CurveParams.BitSize", Field, 0}, + {"CurveParams.Gx", Field, 0}, + {"CurveParams.Gy", Field, 0}, + {"CurveParams.N", Field, 0}, + {"CurveParams.Name", Field, 5}, + {"CurveParams.P", Field, 0}, + {"GenerateKey", Func, 0}, + {"Marshal", Func, 0}, + {"MarshalCompressed", Func, 15}, + {"P224", Func, 0}, + {"P256", Func, 0}, + {"P384", Func, 0}, + {"P521", Func, 0}, + {"Unmarshal", Func, 0}, + {"UnmarshalCompressed", Func, 15}, + }, + "crypto/hmac": { + {"Equal", Func, 1}, + {"New", Func, 0}, + }, + "crypto/md5": { + {"BlockSize", Const, 0}, + {"New", Func, 0}, + {"Size", Const, 0}, + {"Sum", Func, 2}, + }, + "crypto/rand": { + {"Int", Func, 0}, + {"Prime", Func, 0}, + {"Read", Func, 0}, + {"Reader", Var, 0}, + }, + "crypto/rc4": { + {"(*Cipher).Reset", Method, 0}, + {"(*Cipher).XORKeyStream", Method, 0}, + {"(KeySizeError).Error", Method, 0}, + {"Cipher", Type, 0}, + {"KeySizeError", Type, 0}, + {"NewCipher", Func, 0}, + }, + "crypto/rsa": { + {"(*PSSOptions).HashFunc", Method, 4}, + {"(*PrivateKey).Decrypt", Method, 5}, + {"(*PrivateKey).Equal", Method, 15}, + {"(*PrivateKey).Precompute", Method, 0}, + {"(*PrivateKey).Public", Method, 4}, + {"(*PrivateKey).Sign", Method, 4}, + {"(*PrivateKey).Size", Method, 11}, + {"(*PrivateKey).Validate", Method, 0}, + {"(*PublicKey).Equal", Method, 15}, + {"(*PublicKey).Size", Method, 11}, + {"CRTValue", Type, 0}, + {"CRTValue.Coeff", Field, 0}, + {"CRTValue.Exp", Field, 0}, + {"CRTValue.R", Field, 0}, + {"DecryptOAEP", Func, 0}, + {"DecryptPKCS1v15", Func, 0}, + {"DecryptPKCS1v15SessionKey", Func, 0}, + {"EncryptOAEP", Func, 0}, + {"EncryptPKCS1v15", Func, 0}, + {"ErrDecryption", Var, 0}, + {"ErrMessageTooLong", Var, 0}, + {"ErrVerification", Var, 0}, + {"GenerateKey", Func, 0}, + {"GenerateMultiPrimeKey", Func, 0}, + {"OAEPOptions", Type, 5}, + {"OAEPOptions.Hash", Field, 5}, + {"OAEPOptions.Label", Field, 5}, + {"OAEPOptions.MGFHash", Field, 20}, + {"PKCS1v15DecryptOptions", Type, 5}, + {"PKCS1v15DecryptOptions.SessionKeyLen", Field, 5}, + {"PSSOptions", Type, 2}, + {"PSSOptions.Hash", Field, 4}, + {"PSSOptions.SaltLength", Field, 2}, + {"PSSSaltLengthAuto", Const, 2}, + {"PSSSaltLengthEqualsHash", Const, 2}, + {"PrecomputedValues", Type, 0}, + {"PrecomputedValues.CRTValues", Field, 0}, + {"PrecomputedValues.Dp", Field, 0}, + {"PrecomputedValues.Dq", Field, 0}, + {"PrecomputedValues.Qinv", Field, 0}, + {"PrivateKey", Type, 0}, + {"PrivateKey.D", Field, 0}, + {"PrivateKey.Precomputed", Field, 0}, + {"PrivateKey.Primes", Field, 0}, + {"PrivateKey.PublicKey", Field, 0}, + {"PublicKey", Type, 0}, + {"PublicKey.E", Field, 0}, + {"PublicKey.N", Field, 0}, + {"SignPKCS1v15", Func, 0}, + {"SignPSS", Func, 2}, + {"VerifyPKCS1v15", Func, 0}, + {"VerifyPSS", Func, 2}, + }, + "crypto/sha1": { + {"BlockSize", Const, 0}, + {"New", Func, 0}, + {"Size", Const, 0}, + {"Sum", Func, 2}, + }, + "crypto/sha256": { + {"BlockSize", Const, 0}, + {"New", Func, 0}, + {"New224", Func, 0}, + {"Size", Const, 0}, + {"Size224", Const, 0}, + {"Sum224", Func, 2}, + {"Sum256", Func, 2}, + }, + "crypto/sha512": { + {"BlockSize", Const, 0}, + {"New", Func, 0}, + {"New384", Func, 0}, + {"New512_224", Func, 5}, + {"New512_256", Func, 5}, + {"Size", Const, 0}, + {"Size224", Const, 5}, + {"Size256", Const, 5}, + {"Size384", Const, 0}, + {"Sum384", Func, 2}, + {"Sum512", Func, 2}, + {"Sum512_224", Func, 5}, + {"Sum512_256", Func, 5}, + }, + "crypto/subtle": { + {"ConstantTimeByteEq", Func, 0}, + {"ConstantTimeCompare", Func, 0}, + {"ConstantTimeCopy", Func, 0}, + {"ConstantTimeEq", Func, 0}, + {"ConstantTimeLessOrEq", Func, 2}, + {"ConstantTimeSelect", Func, 0}, + {"XORBytes", Func, 20}, + }, + "crypto/tls": { + {"(*CertificateRequestInfo).Context", Method, 17}, + {"(*CertificateRequestInfo).SupportsCertificate", Method, 14}, + {"(*CertificateVerificationError).Error", Method, 20}, + {"(*CertificateVerificationError).Unwrap", Method, 20}, + {"(*ClientHelloInfo).Context", Method, 17}, + {"(*ClientHelloInfo).SupportsCertificate", Method, 14}, + {"(*ClientSessionState).ResumptionState", Method, 21}, + {"(*Config).BuildNameToCertificate", Method, 0}, + {"(*Config).Clone", Method, 8}, + {"(*Config).DecryptTicket", Method, 21}, + {"(*Config).EncryptTicket", Method, 21}, + {"(*Config).SetSessionTicketKeys", Method, 5}, + {"(*Conn).Close", Method, 0}, + {"(*Conn).CloseWrite", Method, 8}, + {"(*Conn).ConnectionState", Method, 0}, + {"(*Conn).Handshake", Method, 0}, + {"(*Conn).HandshakeContext", Method, 17}, + {"(*Conn).LocalAddr", Method, 0}, + {"(*Conn).NetConn", Method, 18}, + {"(*Conn).OCSPResponse", Method, 0}, + {"(*Conn).Read", Method, 0}, + {"(*Conn).RemoteAddr", Method, 0}, + {"(*Conn).SetDeadline", Method, 0}, + {"(*Conn).SetReadDeadline", Method, 0}, + {"(*Conn).SetWriteDeadline", Method, 0}, + {"(*Conn).VerifyHostname", Method, 0}, + {"(*Conn).Write", Method, 0}, + {"(*ConnectionState).ExportKeyingMaterial", Method, 11}, + {"(*Dialer).Dial", Method, 15}, + {"(*Dialer).DialContext", Method, 15}, + {"(*ECHRejectionError).Error", Method, 23}, + {"(*QUICConn).Close", Method, 21}, + {"(*QUICConn).ConnectionState", Method, 21}, + {"(*QUICConn).HandleData", Method, 21}, + {"(*QUICConn).NextEvent", Method, 21}, + {"(*QUICConn).SendSessionTicket", Method, 21}, + {"(*QUICConn).SetTransportParameters", Method, 21}, + {"(*QUICConn).Start", Method, 21}, + {"(*QUICConn).StoreSession", Method, 23}, + {"(*SessionState).Bytes", Method, 21}, + {"(AlertError).Error", Method, 21}, + {"(ClientAuthType).String", Method, 15}, + {"(CurveID).String", Method, 15}, + {"(QUICEncryptionLevel).String", Method, 21}, + {"(RecordHeaderError).Error", Method, 6}, + {"(SignatureScheme).String", Method, 15}, + {"AlertError", Type, 21}, + {"Certificate", Type, 0}, + {"Certificate.Certificate", Field, 0}, + {"Certificate.Leaf", Field, 0}, + {"Certificate.OCSPStaple", Field, 0}, + {"Certificate.PrivateKey", Field, 0}, + {"Certificate.SignedCertificateTimestamps", Field, 5}, + {"Certificate.SupportedSignatureAlgorithms", Field, 14}, + {"CertificateRequestInfo", Type, 8}, + {"CertificateRequestInfo.AcceptableCAs", Field, 8}, + {"CertificateRequestInfo.SignatureSchemes", Field, 8}, + {"CertificateRequestInfo.Version", Field, 14}, + {"CertificateVerificationError", Type, 20}, + {"CertificateVerificationError.Err", Field, 20}, + {"CertificateVerificationError.UnverifiedCertificates", Field, 20}, + {"CipherSuite", Type, 14}, + {"CipherSuite.ID", Field, 14}, + {"CipherSuite.Insecure", Field, 14}, + {"CipherSuite.Name", Field, 14}, + {"CipherSuite.SupportedVersions", Field, 14}, + {"CipherSuiteName", Func, 14}, + {"CipherSuites", Func, 14}, + {"Client", Func, 0}, + {"ClientAuthType", Type, 0}, + {"ClientHelloInfo", Type, 4}, + {"ClientHelloInfo.CipherSuites", Field, 4}, + {"ClientHelloInfo.Conn", Field, 8}, + {"ClientHelloInfo.ServerName", Field, 4}, + {"ClientHelloInfo.SignatureSchemes", Field, 8}, + {"ClientHelloInfo.SupportedCurves", Field, 4}, + {"ClientHelloInfo.SupportedPoints", Field, 4}, + {"ClientHelloInfo.SupportedProtos", Field, 8}, + {"ClientHelloInfo.SupportedVersions", Field, 8}, + {"ClientSessionCache", Type, 3}, + {"ClientSessionState", Type, 3}, + {"Config", Type, 0}, + {"Config.Certificates", Field, 0}, + {"Config.CipherSuites", Field, 0}, + {"Config.ClientAuth", Field, 0}, + {"Config.ClientCAs", Field, 0}, + {"Config.ClientSessionCache", Field, 3}, + {"Config.CurvePreferences", Field, 3}, + {"Config.DynamicRecordSizingDisabled", Field, 7}, + {"Config.EncryptedClientHelloConfigList", Field, 23}, + {"Config.EncryptedClientHelloRejectionVerify", Field, 23}, + {"Config.GetCertificate", Field, 4}, + {"Config.GetClientCertificate", Field, 8}, + {"Config.GetConfigForClient", Field, 8}, + {"Config.InsecureSkipVerify", Field, 0}, + {"Config.KeyLogWriter", Field, 8}, + {"Config.MaxVersion", Field, 2}, + {"Config.MinVersion", Field, 2}, + {"Config.NameToCertificate", Field, 0}, + {"Config.NextProtos", Field, 0}, + {"Config.PreferServerCipherSuites", Field, 1}, + {"Config.Rand", Field, 0}, + {"Config.Renegotiation", Field, 7}, + {"Config.RootCAs", Field, 0}, + {"Config.ServerName", Field, 0}, + {"Config.SessionTicketKey", Field, 1}, + {"Config.SessionTicketsDisabled", Field, 1}, + {"Config.Time", Field, 0}, + {"Config.UnwrapSession", Field, 21}, + {"Config.VerifyConnection", Field, 15}, + {"Config.VerifyPeerCertificate", Field, 8}, + {"Config.WrapSession", Field, 21}, + {"Conn", Type, 0}, + {"ConnectionState", Type, 0}, + {"ConnectionState.CipherSuite", Field, 0}, + {"ConnectionState.DidResume", Field, 1}, + {"ConnectionState.ECHAccepted", Field, 23}, + {"ConnectionState.HandshakeComplete", Field, 0}, + {"ConnectionState.NegotiatedProtocol", Field, 0}, + {"ConnectionState.NegotiatedProtocolIsMutual", Field, 0}, + {"ConnectionState.OCSPResponse", Field, 5}, + {"ConnectionState.PeerCertificates", Field, 0}, + {"ConnectionState.ServerName", Field, 0}, + {"ConnectionState.SignedCertificateTimestamps", Field, 5}, + {"ConnectionState.TLSUnique", Field, 4}, + {"ConnectionState.VerifiedChains", Field, 0}, + {"ConnectionState.Version", Field, 3}, + {"CurveID", Type, 3}, + {"CurveP256", Const, 3}, + {"CurveP384", Const, 3}, + {"CurveP521", Const, 3}, + {"Dial", Func, 0}, + {"DialWithDialer", Func, 3}, + {"Dialer", Type, 15}, + {"Dialer.Config", Field, 15}, + {"Dialer.NetDialer", Field, 15}, + {"ECDSAWithP256AndSHA256", Const, 8}, + {"ECDSAWithP384AndSHA384", Const, 8}, + {"ECDSAWithP521AndSHA512", Const, 8}, + {"ECDSAWithSHA1", Const, 10}, + {"ECHRejectionError", Type, 23}, + {"ECHRejectionError.RetryConfigList", Field, 23}, + {"Ed25519", Const, 13}, + {"InsecureCipherSuites", Func, 14}, + {"Listen", Func, 0}, + {"LoadX509KeyPair", Func, 0}, + {"NewLRUClientSessionCache", Func, 3}, + {"NewListener", Func, 0}, + {"NewResumptionState", Func, 21}, + {"NoClientCert", Const, 0}, + {"PKCS1WithSHA1", Const, 8}, + {"PKCS1WithSHA256", Const, 8}, + {"PKCS1WithSHA384", Const, 8}, + {"PKCS1WithSHA512", Const, 8}, + {"PSSWithSHA256", Const, 8}, + {"PSSWithSHA384", Const, 8}, + {"PSSWithSHA512", Const, 8}, + {"ParseSessionState", Func, 21}, + {"QUICClient", Func, 21}, + {"QUICConfig", Type, 21}, + {"QUICConfig.EnableStoreSessionEvent", Field, 23}, + {"QUICConfig.TLSConfig", Field, 21}, + {"QUICConn", Type, 21}, + {"QUICEncryptionLevel", Type, 21}, + {"QUICEncryptionLevelApplication", Const, 21}, + {"QUICEncryptionLevelEarly", Const, 21}, + {"QUICEncryptionLevelHandshake", Const, 21}, + {"QUICEncryptionLevelInitial", Const, 21}, + {"QUICEvent", Type, 21}, + {"QUICEvent.Data", Field, 21}, + {"QUICEvent.Kind", Field, 21}, + {"QUICEvent.Level", Field, 21}, + {"QUICEvent.SessionState", Field, 23}, + {"QUICEvent.Suite", Field, 21}, + {"QUICEventKind", Type, 21}, + {"QUICHandshakeDone", Const, 21}, + {"QUICNoEvent", Const, 21}, + {"QUICRejectedEarlyData", Const, 21}, + {"QUICResumeSession", Const, 23}, + {"QUICServer", Func, 21}, + {"QUICSessionTicketOptions", Type, 21}, + {"QUICSessionTicketOptions.EarlyData", Field, 21}, + {"QUICSessionTicketOptions.Extra", Field, 23}, + {"QUICSetReadSecret", Const, 21}, + {"QUICSetWriteSecret", Const, 21}, + {"QUICStoreSession", Const, 23}, + {"QUICTransportParameters", Const, 21}, + {"QUICTransportParametersRequired", Const, 21}, + {"QUICWriteData", Const, 21}, + {"RecordHeaderError", Type, 6}, + {"RecordHeaderError.Conn", Field, 12}, + {"RecordHeaderError.Msg", Field, 6}, + {"RecordHeaderError.RecordHeader", Field, 6}, + {"RenegotiateFreelyAsClient", Const, 7}, + {"RenegotiateNever", Const, 7}, + {"RenegotiateOnceAsClient", Const, 7}, + {"RenegotiationSupport", Type, 7}, + {"RequestClientCert", Const, 0}, + {"RequireAndVerifyClientCert", Const, 0}, + {"RequireAnyClientCert", Const, 0}, + {"Server", Func, 0}, + {"SessionState", Type, 21}, + {"SessionState.EarlyData", Field, 21}, + {"SessionState.Extra", Field, 21}, + {"SignatureScheme", Type, 8}, + {"TLS_AES_128_GCM_SHA256", Const, 12}, + {"TLS_AES_256_GCM_SHA384", Const, 12}, + {"TLS_CHACHA20_POLY1305_SHA256", Const, 12}, + {"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", Const, 2}, + {"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", Const, 8}, + {"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", Const, 2}, + {"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", Const, 2}, + {"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", Const, 5}, + {"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", Const, 8}, + {"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", Const, 14}, + {"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", Const, 2}, + {"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", Const, 0}, + {"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", Const, 0}, + {"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", Const, 8}, + {"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", Const, 2}, + {"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", Const, 1}, + {"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", Const, 5}, + {"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", Const, 8}, + {"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", Const, 14}, + {"TLS_ECDHE_RSA_WITH_RC4_128_SHA", Const, 0}, + {"TLS_FALLBACK_SCSV", Const, 4}, + {"TLS_RSA_WITH_3DES_EDE_CBC_SHA", Const, 0}, + {"TLS_RSA_WITH_AES_128_CBC_SHA", Const, 0}, + {"TLS_RSA_WITH_AES_128_CBC_SHA256", Const, 8}, + {"TLS_RSA_WITH_AES_128_GCM_SHA256", Const, 6}, + {"TLS_RSA_WITH_AES_256_CBC_SHA", Const, 1}, + {"TLS_RSA_WITH_AES_256_GCM_SHA384", Const, 6}, + {"TLS_RSA_WITH_RC4_128_SHA", Const, 0}, + {"VerifyClientCertIfGiven", Const, 0}, + {"VersionName", Func, 21}, + {"VersionSSL30", Const, 2}, + {"VersionTLS10", Const, 2}, + {"VersionTLS11", Const, 2}, + {"VersionTLS12", Const, 2}, + {"VersionTLS13", Const, 12}, + {"X25519", Const, 8}, + {"X509KeyPair", Func, 0}, + }, + "crypto/x509": { + {"(*CertPool).AddCert", Method, 0}, + {"(*CertPool).AddCertWithConstraint", Method, 22}, + {"(*CertPool).AppendCertsFromPEM", Method, 0}, + {"(*CertPool).Clone", Method, 19}, + {"(*CertPool).Equal", Method, 19}, + {"(*CertPool).Subjects", Method, 0}, + {"(*Certificate).CheckCRLSignature", Method, 0}, + {"(*Certificate).CheckSignature", Method, 0}, + {"(*Certificate).CheckSignatureFrom", Method, 0}, + {"(*Certificate).CreateCRL", Method, 0}, + {"(*Certificate).Equal", Method, 0}, + {"(*Certificate).Verify", Method, 0}, + {"(*Certificate).VerifyHostname", Method, 0}, + {"(*CertificateRequest).CheckSignature", Method, 5}, + {"(*OID).UnmarshalBinary", Method, 23}, + {"(*OID).UnmarshalText", Method, 23}, + {"(*RevocationList).CheckSignatureFrom", Method, 19}, + {"(CertificateInvalidError).Error", Method, 0}, + {"(ConstraintViolationError).Error", Method, 0}, + {"(HostnameError).Error", Method, 0}, + {"(InsecureAlgorithmError).Error", Method, 6}, + {"(OID).Equal", Method, 22}, + {"(OID).EqualASN1OID", Method, 22}, + {"(OID).MarshalBinary", Method, 23}, + {"(OID).MarshalText", Method, 23}, + {"(OID).String", Method, 22}, + {"(PublicKeyAlgorithm).String", Method, 10}, + {"(SignatureAlgorithm).String", Method, 6}, + {"(SystemRootsError).Error", Method, 1}, + {"(SystemRootsError).Unwrap", Method, 16}, + {"(UnhandledCriticalExtension).Error", Method, 0}, + {"(UnknownAuthorityError).Error", Method, 0}, + {"CANotAuthorizedForExtKeyUsage", Const, 10}, + {"CANotAuthorizedForThisName", Const, 0}, + {"CertPool", Type, 0}, + {"Certificate", Type, 0}, + {"Certificate.AuthorityKeyId", Field, 0}, + {"Certificate.BasicConstraintsValid", Field, 0}, + {"Certificate.CRLDistributionPoints", Field, 2}, + {"Certificate.DNSNames", Field, 0}, + {"Certificate.EmailAddresses", Field, 0}, + {"Certificate.ExcludedDNSDomains", Field, 9}, + {"Certificate.ExcludedEmailAddresses", Field, 10}, + {"Certificate.ExcludedIPRanges", Field, 10}, + {"Certificate.ExcludedURIDomains", Field, 10}, + {"Certificate.ExtKeyUsage", Field, 0}, + {"Certificate.Extensions", Field, 2}, + {"Certificate.ExtraExtensions", Field, 2}, + {"Certificate.IPAddresses", Field, 1}, + {"Certificate.IsCA", Field, 0}, + {"Certificate.Issuer", Field, 0}, + {"Certificate.IssuingCertificateURL", Field, 2}, + {"Certificate.KeyUsage", Field, 0}, + {"Certificate.MaxPathLen", Field, 0}, + {"Certificate.MaxPathLenZero", Field, 4}, + {"Certificate.NotAfter", Field, 0}, + {"Certificate.NotBefore", Field, 0}, + {"Certificate.OCSPServer", Field, 2}, + {"Certificate.PermittedDNSDomains", Field, 0}, + {"Certificate.PermittedDNSDomainsCritical", Field, 0}, + {"Certificate.PermittedEmailAddresses", Field, 10}, + {"Certificate.PermittedIPRanges", Field, 10}, + {"Certificate.PermittedURIDomains", Field, 10}, + {"Certificate.Policies", Field, 22}, + {"Certificate.PolicyIdentifiers", Field, 0}, + {"Certificate.PublicKey", Field, 0}, + {"Certificate.PublicKeyAlgorithm", Field, 0}, + {"Certificate.Raw", Field, 0}, + {"Certificate.RawIssuer", Field, 0}, + {"Certificate.RawSubject", Field, 0}, + {"Certificate.RawSubjectPublicKeyInfo", Field, 0}, + {"Certificate.RawTBSCertificate", Field, 0}, + {"Certificate.SerialNumber", Field, 0}, + {"Certificate.Signature", Field, 0}, + {"Certificate.SignatureAlgorithm", Field, 0}, + {"Certificate.Subject", Field, 0}, + {"Certificate.SubjectKeyId", Field, 0}, + {"Certificate.URIs", Field, 10}, + {"Certificate.UnhandledCriticalExtensions", Field, 5}, + {"Certificate.UnknownExtKeyUsage", Field, 0}, + {"Certificate.Version", Field, 0}, + {"CertificateInvalidError", Type, 0}, + {"CertificateInvalidError.Cert", Field, 0}, + {"CertificateInvalidError.Detail", Field, 10}, + {"CertificateInvalidError.Reason", Field, 0}, + {"CertificateRequest", Type, 3}, + {"CertificateRequest.Attributes", Field, 3}, + {"CertificateRequest.DNSNames", Field, 3}, + {"CertificateRequest.EmailAddresses", Field, 3}, + {"CertificateRequest.Extensions", Field, 3}, + {"CertificateRequest.ExtraExtensions", Field, 3}, + {"CertificateRequest.IPAddresses", Field, 3}, + {"CertificateRequest.PublicKey", Field, 3}, + {"CertificateRequest.PublicKeyAlgorithm", Field, 3}, + {"CertificateRequest.Raw", Field, 3}, + {"CertificateRequest.RawSubject", Field, 3}, + {"CertificateRequest.RawSubjectPublicKeyInfo", Field, 3}, + {"CertificateRequest.RawTBSCertificateRequest", Field, 3}, + {"CertificateRequest.Signature", Field, 3}, + {"CertificateRequest.SignatureAlgorithm", Field, 3}, + {"CertificateRequest.Subject", Field, 3}, + {"CertificateRequest.URIs", Field, 10}, + {"CertificateRequest.Version", Field, 3}, + {"ConstraintViolationError", Type, 0}, + {"CreateCertificate", Func, 0}, + {"CreateCertificateRequest", Func, 3}, + {"CreateRevocationList", Func, 15}, + {"DSA", Const, 0}, + {"DSAWithSHA1", Const, 0}, + {"DSAWithSHA256", Const, 0}, + {"DecryptPEMBlock", Func, 1}, + {"ECDSA", Const, 1}, + {"ECDSAWithSHA1", Const, 1}, + {"ECDSAWithSHA256", Const, 1}, + {"ECDSAWithSHA384", Const, 1}, + {"ECDSAWithSHA512", Const, 1}, + {"Ed25519", Const, 13}, + {"EncryptPEMBlock", Func, 1}, + {"ErrUnsupportedAlgorithm", Var, 0}, + {"Expired", Const, 0}, + {"ExtKeyUsage", Type, 0}, + {"ExtKeyUsageAny", Const, 0}, + {"ExtKeyUsageClientAuth", Const, 0}, + {"ExtKeyUsageCodeSigning", Const, 0}, + {"ExtKeyUsageEmailProtection", Const, 0}, + {"ExtKeyUsageIPSECEndSystem", Const, 1}, + {"ExtKeyUsageIPSECTunnel", Const, 1}, + {"ExtKeyUsageIPSECUser", Const, 1}, + {"ExtKeyUsageMicrosoftCommercialCodeSigning", Const, 10}, + {"ExtKeyUsageMicrosoftKernelCodeSigning", Const, 10}, + {"ExtKeyUsageMicrosoftServerGatedCrypto", Const, 1}, + {"ExtKeyUsageNetscapeServerGatedCrypto", Const, 1}, + {"ExtKeyUsageOCSPSigning", Const, 0}, + {"ExtKeyUsageServerAuth", Const, 0}, + {"ExtKeyUsageTimeStamping", Const, 0}, + {"HostnameError", Type, 0}, + {"HostnameError.Certificate", Field, 0}, + {"HostnameError.Host", Field, 0}, + {"IncompatibleUsage", Const, 1}, + {"IncorrectPasswordError", Var, 1}, + {"InsecureAlgorithmError", Type, 6}, + {"InvalidReason", Type, 0}, + {"IsEncryptedPEMBlock", Func, 1}, + {"KeyUsage", Type, 0}, + {"KeyUsageCRLSign", Const, 0}, + {"KeyUsageCertSign", Const, 0}, + {"KeyUsageContentCommitment", Const, 0}, + {"KeyUsageDataEncipherment", Const, 0}, + {"KeyUsageDecipherOnly", Const, 0}, + {"KeyUsageDigitalSignature", Const, 0}, + {"KeyUsageEncipherOnly", Const, 0}, + {"KeyUsageKeyAgreement", Const, 0}, + {"KeyUsageKeyEncipherment", Const, 0}, + {"MD2WithRSA", Const, 0}, + {"MD5WithRSA", Const, 0}, + {"MarshalECPrivateKey", Func, 2}, + {"MarshalPKCS1PrivateKey", Func, 0}, + {"MarshalPKCS1PublicKey", Func, 10}, + {"MarshalPKCS8PrivateKey", Func, 10}, + {"MarshalPKIXPublicKey", Func, 0}, + {"NameConstraintsWithoutSANs", Const, 10}, + {"NameMismatch", Const, 8}, + {"NewCertPool", Func, 0}, + {"NotAuthorizedToSign", Const, 0}, + {"OID", Type, 22}, + {"OIDFromInts", Func, 22}, + {"PEMCipher", Type, 1}, + {"PEMCipher3DES", Const, 1}, + {"PEMCipherAES128", Const, 1}, + {"PEMCipherAES192", Const, 1}, + {"PEMCipherAES256", Const, 1}, + {"PEMCipherDES", Const, 1}, + {"ParseCRL", Func, 0}, + {"ParseCertificate", Func, 0}, + {"ParseCertificateRequest", Func, 3}, + {"ParseCertificates", Func, 0}, + {"ParseDERCRL", Func, 0}, + {"ParseECPrivateKey", Func, 1}, + {"ParseOID", Func, 23}, + {"ParsePKCS1PrivateKey", Func, 0}, + {"ParsePKCS1PublicKey", Func, 10}, + {"ParsePKCS8PrivateKey", Func, 0}, + {"ParsePKIXPublicKey", Func, 0}, + {"ParseRevocationList", Func, 19}, + {"PublicKeyAlgorithm", Type, 0}, + {"PureEd25519", Const, 13}, + {"RSA", Const, 0}, + {"RevocationList", Type, 15}, + {"RevocationList.AuthorityKeyId", Field, 19}, + {"RevocationList.Extensions", Field, 19}, + {"RevocationList.ExtraExtensions", Field, 15}, + {"RevocationList.Issuer", Field, 19}, + {"RevocationList.NextUpdate", Field, 15}, + {"RevocationList.Number", Field, 15}, + {"RevocationList.Raw", Field, 19}, + {"RevocationList.RawIssuer", Field, 19}, + {"RevocationList.RawTBSRevocationList", Field, 19}, + {"RevocationList.RevokedCertificateEntries", Field, 21}, + {"RevocationList.RevokedCertificates", Field, 15}, + {"RevocationList.Signature", Field, 19}, + {"RevocationList.SignatureAlgorithm", Field, 15}, + {"RevocationList.ThisUpdate", Field, 15}, + {"RevocationListEntry", Type, 21}, + {"RevocationListEntry.Extensions", Field, 21}, + {"RevocationListEntry.ExtraExtensions", Field, 21}, + {"RevocationListEntry.Raw", Field, 21}, + {"RevocationListEntry.ReasonCode", Field, 21}, + {"RevocationListEntry.RevocationTime", Field, 21}, + {"RevocationListEntry.SerialNumber", Field, 21}, + {"SHA1WithRSA", Const, 0}, + {"SHA256WithRSA", Const, 0}, + {"SHA256WithRSAPSS", Const, 8}, + {"SHA384WithRSA", Const, 0}, + {"SHA384WithRSAPSS", Const, 8}, + {"SHA512WithRSA", Const, 0}, + {"SHA512WithRSAPSS", Const, 8}, + {"SetFallbackRoots", Func, 20}, + {"SignatureAlgorithm", Type, 0}, + {"SystemCertPool", Func, 7}, + {"SystemRootsError", Type, 1}, + {"SystemRootsError.Err", Field, 7}, + {"TooManyConstraints", Const, 10}, + {"TooManyIntermediates", Const, 0}, + {"UnconstrainedName", Const, 10}, + {"UnhandledCriticalExtension", Type, 0}, + {"UnknownAuthorityError", Type, 0}, + {"UnknownAuthorityError.Cert", Field, 8}, + {"UnknownPublicKeyAlgorithm", Const, 0}, + {"UnknownSignatureAlgorithm", Const, 0}, + {"VerifyOptions", Type, 0}, + {"VerifyOptions.CurrentTime", Field, 0}, + {"VerifyOptions.DNSName", Field, 0}, + {"VerifyOptions.Intermediates", Field, 0}, + {"VerifyOptions.KeyUsages", Field, 1}, + {"VerifyOptions.MaxConstraintComparisions", Field, 10}, + {"VerifyOptions.Roots", Field, 0}, + }, + "crypto/x509/pkix": { + {"(*CertificateList).HasExpired", Method, 0}, + {"(*Name).FillFromRDNSequence", Method, 0}, + {"(Name).String", Method, 10}, + {"(Name).ToRDNSequence", Method, 0}, + {"(RDNSequence).String", Method, 10}, + {"AlgorithmIdentifier", Type, 0}, + {"AlgorithmIdentifier.Algorithm", Field, 0}, + {"AlgorithmIdentifier.Parameters", Field, 0}, + {"AttributeTypeAndValue", Type, 0}, + {"AttributeTypeAndValue.Type", Field, 0}, + {"AttributeTypeAndValue.Value", Field, 0}, + {"AttributeTypeAndValueSET", Type, 3}, + {"AttributeTypeAndValueSET.Type", Field, 3}, + {"AttributeTypeAndValueSET.Value", Field, 3}, + {"CertificateList", Type, 0}, + {"CertificateList.SignatureAlgorithm", Field, 0}, + {"CertificateList.SignatureValue", Field, 0}, + {"CertificateList.TBSCertList", Field, 0}, + {"Extension", Type, 0}, + {"Extension.Critical", Field, 0}, + {"Extension.Id", Field, 0}, + {"Extension.Value", Field, 0}, + {"Name", Type, 0}, + {"Name.CommonName", Field, 0}, + {"Name.Country", Field, 0}, + {"Name.ExtraNames", Field, 5}, + {"Name.Locality", Field, 0}, + {"Name.Names", Field, 0}, + {"Name.Organization", Field, 0}, + {"Name.OrganizationalUnit", Field, 0}, + {"Name.PostalCode", Field, 0}, + {"Name.Province", Field, 0}, + {"Name.SerialNumber", Field, 0}, + {"Name.StreetAddress", Field, 0}, + {"RDNSequence", Type, 0}, + {"RelativeDistinguishedNameSET", Type, 0}, + {"RevokedCertificate", Type, 0}, + {"RevokedCertificate.Extensions", Field, 0}, + {"RevokedCertificate.RevocationTime", Field, 0}, + {"RevokedCertificate.SerialNumber", Field, 0}, + {"TBSCertificateList", Type, 0}, + {"TBSCertificateList.Extensions", Field, 0}, + {"TBSCertificateList.Issuer", Field, 0}, + {"TBSCertificateList.NextUpdate", Field, 0}, + {"TBSCertificateList.Raw", Field, 0}, + {"TBSCertificateList.RevokedCertificates", Field, 0}, + {"TBSCertificateList.Signature", Field, 0}, + {"TBSCertificateList.ThisUpdate", Field, 0}, + {"TBSCertificateList.Version", Field, 0}, + }, + "database/sql": { + {"(*ColumnType).DatabaseTypeName", Method, 8}, + {"(*ColumnType).DecimalSize", Method, 8}, + {"(*ColumnType).Length", Method, 8}, + {"(*ColumnType).Name", Method, 8}, + {"(*ColumnType).Nullable", Method, 8}, + {"(*ColumnType).ScanType", Method, 8}, + {"(*Conn).BeginTx", Method, 9}, + {"(*Conn).Close", Method, 9}, + {"(*Conn).ExecContext", Method, 9}, + {"(*Conn).PingContext", Method, 9}, + {"(*Conn).PrepareContext", Method, 9}, + {"(*Conn).QueryContext", Method, 9}, + {"(*Conn).QueryRowContext", Method, 9}, + {"(*Conn).Raw", Method, 13}, + {"(*DB).Begin", Method, 0}, + {"(*DB).BeginTx", Method, 8}, + {"(*DB).Close", Method, 0}, + {"(*DB).Conn", Method, 9}, + {"(*DB).Driver", Method, 0}, + {"(*DB).Exec", Method, 0}, + {"(*DB).ExecContext", Method, 8}, + {"(*DB).Ping", Method, 1}, + {"(*DB).PingContext", Method, 8}, + {"(*DB).Prepare", Method, 0}, + {"(*DB).PrepareContext", Method, 8}, + {"(*DB).Query", Method, 0}, + {"(*DB).QueryContext", Method, 8}, + {"(*DB).QueryRow", Method, 0}, + {"(*DB).QueryRowContext", Method, 8}, + {"(*DB).SetConnMaxIdleTime", Method, 15}, + {"(*DB).SetConnMaxLifetime", Method, 6}, + {"(*DB).SetMaxIdleConns", Method, 1}, + {"(*DB).SetMaxOpenConns", Method, 2}, + {"(*DB).Stats", Method, 5}, + {"(*Null).Scan", Method, 22}, + {"(*NullBool).Scan", Method, 0}, + {"(*NullByte).Scan", Method, 17}, + {"(*NullFloat64).Scan", Method, 0}, + {"(*NullInt16).Scan", Method, 17}, + {"(*NullInt32).Scan", Method, 13}, + {"(*NullInt64).Scan", Method, 0}, + {"(*NullString).Scan", Method, 0}, + {"(*NullTime).Scan", Method, 13}, + {"(*Row).Err", Method, 15}, + {"(*Row).Scan", Method, 0}, + {"(*Rows).Close", Method, 0}, + {"(*Rows).ColumnTypes", Method, 8}, + {"(*Rows).Columns", Method, 0}, + {"(*Rows).Err", Method, 0}, + {"(*Rows).Next", Method, 0}, + {"(*Rows).NextResultSet", Method, 8}, + {"(*Rows).Scan", Method, 0}, + {"(*Stmt).Close", Method, 0}, + {"(*Stmt).Exec", Method, 0}, + {"(*Stmt).ExecContext", Method, 8}, + {"(*Stmt).Query", Method, 0}, + {"(*Stmt).QueryContext", Method, 8}, + {"(*Stmt).QueryRow", Method, 0}, + {"(*Stmt).QueryRowContext", Method, 8}, + {"(*Tx).Commit", Method, 0}, + {"(*Tx).Exec", Method, 0}, + {"(*Tx).ExecContext", Method, 8}, + {"(*Tx).Prepare", Method, 0}, + {"(*Tx).PrepareContext", Method, 8}, + {"(*Tx).Query", Method, 0}, + {"(*Tx).QueryContext", Method, 8}, + {"(*Tx).QueryRow", Method, 0}, + {"(*Tx).QueryRowContext", Method, 8}, + {"(*Tx).Rollback", Method, 0}, + {"(*Tx).Stmt", Method, 0}, + {"(*Tx).StmtContext", Method, 8}, + {"(IsolationLevel).String", Method, 11}, + {"(Null).Value", Method, 22}, + {"(NullBool).Value", Method, 0}, + {"(NullByte).Value", Method, 17}, + {"(NullFloat64).Value", Method, 0}, + {"(NullInt16).Value", Method, 17}, + {"(NullInt32).Value", Method, 13}, + {"(NullInt64).Value", Method, 0}, + {"(NullString).Value", Method, 0}, + {"(NullTime).Value", Method, 13}, + {"ColumnType", Type, 8}, + {"Conn", Type, 9}, + {"DB", Type, 0}, + {"DBStats", Type, 5}, + {"DBStats.Idle", Field, 11}, + {"DBStats.InUse", Field, 11}, + {"DBStats.MaxIdleClosed", Field, 11}, + {"DBStats.MaxIdleTimeClosed", Field, 15}, + {"DBStats.MaxLifetimeClosed", Field, 11}, + {"DBStats.MaxOpenConnections", Field, 11}, + {"DBStats.OpenConnections", Field, 5}, + {"DBStats.WaitCount", Field, 11}, + {"DBStats.WaitDuration", Field, 11}, + {"Drivers", Func, 4}, + {"ErrConnDone", Var, 9}, + {"ErrNoRows", Var, 0}, + {"ErrTxDone", Var, 0}, + {"IsolationLevel", Type, 8}, + {"LevelDefault", Const, 8}, + {"LevelLinearizable", Const, 8}, + {"LevelReadCommitted", Const, 8}, + {"LevelReadUncommitted", Const, 8}, + {"LevelRepeatableRead", Const, 8}, + {"LevelSerializable", Const, 8}, + {"LevelSnapshot", Const, 8}, + {"LevelWriteCommitted", Const, 8}, + {"Named", Func, 8}, + {"NamedArg", Type, 8}, + {"NamedArg.Name", Field, 8}, + {"NamedArg.Value", Field, 8}, + {"Null", Type, 22}, + {"Null.V", Field, 22}, + {"Null.Valid", Field, 22}, + {"NullBool", Type, 0}, + {"NullBool.Bool", Field, 0}, + {"NullBool.Valid", Field, 0}, + {"NullByte", Type, 17}, + {"NullByte.Byte", Field, 17}, + {"NullByte.Valid", Field, 17}, + {"NullFloat64", Type, 0}, + {"NullFloat64.Float64", Field, 0}, + {"NullFloat64.Valid", Field, 0}, + {"NullInt16", Type, 17}, + {"NullInt16.Int16", Field, 17}, + {"NullInt16.Valid", Field, 17}, + {"NullInt32", Type, 13}, + {"NullInt32.Int32", Field, 13}, + {"NullInt32.Valid", Field, 13}, + {"NullInt64", Type, 0}, + {"NullInt64.Int64", Field, 0}, + {"NullInt64.Valid", Field, 0}, + {"NullString", Type, 0}, + {"NullString.String", Field, 0}, + {"NullString.Valid", Field, 0}, + {"NullTime", Type, 13}, + {"NullTime.Time", Field, 13}, + {"NullTime.Valid", Field, 13}, + {"Open", Func, 0}, + {"OpenDB", Func, 10}, + {"Out", Type, 9}, + {"Out.Dest", Field, 9}, + {"Out.In", Field, 9}, + {"RawBytes", Type, 0}, + {"Register", Func, 0}, + {"Result", Type, 0}, + {"Row", Type, 0}, + {"Rows", Type, 0}, + {"Scanner", Type, 0}, + {"Stmt", Type, 0}, + {"Tx", Type, 0}, + {"TxOptions", Type, 8}, + {"TxOptions.Isolation", Field, 8}, + {"TxOptions.ReadOnly", Field, 8}, + }, + "database/sql/driver": { + {"(NotNull).ConvertValue", Method, 0}, + {"(Null).ConvertValue", Method, 0}, + {"(RowsAffected).LastInsertId", Method, 0}, + {"(RowsAffected).RowsAffected", Method, 0}, + {"Bool", Var, 0}, + {"ColumnConverter", Type, 0}, + {"Conn", Type, 0}, + {"ConnBeginTx", Type, 8}, + {"ConnPrepareContext", Type, 8}, + {"Connector", Type, 10}, + {"DefaultParameterConverter", Var, 0}, + {"Driver", Type, 0}, + {"DriverContext", Type, 10}, + {"ErrBadConn", Var, 0}, + {"ErrRemoveArgument", Var, 9}, + {"ErrSkip", Var, 0}, + {"Execer", Type, 0}, + {"ExecerContext", Type, 8}, + {"Int32", Var, 0}, + {"IsScanValue", Func, 0}, + {"IsValue", Func, 0}, + {"IsolationLevel", Type, 8}, + {"NamedValue", Type, 8}, + {"NamedValue.Name", Field, 8}, + {"NamedValue.Ordinal", Field, 8}, + {"NamedValue.Value", Field, 8}, + {"NamedValueChecker", Type, 9}, + {"NotNull", Type, 0}, + {"NotNull.Converter", Field, 0}, + {"Null", Type, 0}, + {"Null.Converter", Field, 0}, + {"Pinger", Type, 8}, + {"Queryer", Type, 1}, + {"QueryerContext", Type, 8}, + {"Result", Type, 0}, + {"ResultNoRows", Var, 0}, + {"Rows", Type, 0}, + {"RowsAffected", Type, 0}, + {"RowsColumnTypeDatabaseTypeName", Type, 8}, + {"RowsColumnTypeLength", Type, 8}, + {"RowsColumnTypeNullable", Type, 8}, + {"RowsColumnTypePrecisionScale", Type, 8}, + {"RowsColumnTypeScanType", Type, 8}, + {"RowsNextResultSet", Type, 8}, + {"SessionResetter", Type, 10}, + {"Stmt", Type, 0}, + {"StmtExecContext", Type, 8}, + {"StmtQueryContext", Type, 8}, + {"String", Var, 0}, + {"Tx", Type, 0}, + {"TxOptions", Type, 8}, + {"TxOptions.Isolation", Field, 8}, + {"TxOptions.ReadOnly", Field, 8}, + {"Validator", Type, 15}, + {"Value", Type, 0}, + {"ValueConverter", Type, 0}, + {"Valuer", Type, 0}, + }, + "debug/buildinfo": { + {"BuildInfo", Type, 18}, + {"Read", Func, 18}, + {"ReadFile", Func, 18}, + }, + "debug/dwarf": { + {"(*AddrType).Basic", Method, 0}, + {"(*AddrType).Common", Method, 0}, + {"(*AddrType).Size", Method, 0}, + {"(*AddrType).String", Method, 0}, + {"(*ArrayType).Common", Method, 0}, + {"(*ArrayType).Size", Method, 0}, + {"(*ArrayType).String", Method, 0}, + {"(*BasicType).Basic", Method, 0}, + {"(*BasicType).Common", Method, 0}, + {"(*BasicType).Size", Method, 0}, + {"(*BasicType).String", Method, 0}, + {"(*BoolType).Basic", Method, 0}, + {"(*BoolType).Common", Method, 0}, + {"(*BoolType).Size", Method, 0}, + {"(*BoolType).String", Method, 0}, + {"(*CharType).Basic", Method, 0}, + {"(*CharType).Common", Method, 0}, + {"(*CharType).Size", Method, 0}, + {"(*CharType).String", Method, 0}, + {"(*CommonType).Common", Method, 0}, + {"(*CommonType).Size", Method, 0}, + {"(*ComplexType).Basic", Method, 0}, + {"(*ComplexType).Common", Method, 0}, + {"(*ComplexType).Size", Method, 0}, + {"(*ComplexType).String", Method, 0}, + {"(*Data).AddSection", Method, 14}, + {"(*Data).AddTypes", Method, 3}, + {"(*Data).LineReader", Method, 5}, + {"(*Data).Ranges", Method, 7}, + {"(*Data).Reader", Method, 0}, + {"(*Data).Type", Method, 0}, + {"(*DotDotDotType).Common", Method, 0}, + {"(*DotDotDotType).Size", Method, 0}, + {"(*DotDotDotType).String", Method, 0}, + {"(*Entry).AttrField", Method, 5}, + {"(*Entry).Val", Method, 0}, + {"(*EnumType).Common", Method, 0}, + {"(*EnumType).Size", Method, 0}, + {"(*EnumType).String", Method, 0}, + {"(*FloatType).Basic", Method, 0}, + {"(*FloatType).Common", Method, 0}, + {"(*FloatType).Size", Method, 0}, + {"(*FloatType).String", Method, 0}, + {"(*FuncType).Common", Method, 0}, + {"(*FuncType).Size", Method, 0}, + {"(*FuncType).String", Method, 0}, + {"(*IntType).Basic", Method, 0}, + {"(*IntType).Common", Method, 0}, + {"(*IntType).Size", Method, 0}, + {"(*IntType).String", Method, 0}, + {"(*LineReader).Files", Method, 14}, + {"(*LineReader).Next", Method, 5}, + {"(*LineReader).Reset", Method, 5}, + {"(*LineReader).Seek", Method, 5}, + {"(*LineReader).SeekPC", Method, 5}, + {"(*LineReader).Tell", Method, 5}, + {"(*PtrType).Common", Method, 0}, + {"(*PtrType).Size", Method, 0}, + {"(*PtrType).String", Method, 0}, + {"(*QualType).Common", Method, 0}, + {"(*QualType).Size", Method, 0}, + {"(*QualType).String", Method, 0}, + {"(*Reader).AddressSize", Method, 5}, + {"(*Reader).ByteOrder", Method, 14}, + {"(*Reader).Next", Method, 0}, + {"(*Reader).Seek", Method, 0}, + {"(*Reader).SeekPC", Method, 7}, + {"(*Reader).SkipChildren", Method, 0}, + {"(*StructType).Common", Method, 0}, + {"(*StructType).Defn", Method, 0}, + {"(*StructType).Size", Method, 0}, + {"(*StructType).String", Method, 0}, + {"(*TypedefType).Common", Method, 0}, + {"(*TypedefType).Size", Method, 0}, + {"(*TypedefType).String", Method, 0}, + {"(*UcharType).Basic", Method, 0}, + {"(*UcharType).Common", Method, 0}, + {"(*UcharType).Size", Method, 0}, + {"(*UcharType).String", Method, 0}, + {"(*UintType).Basic", Method, 0}, + {"(*UintType).Common", Method, 0}, + {"(*UintType).Size", Method, 0}, + {"(*UintType).String", Method, 0}, + {"(*UnspecifiedType).Basic", Method, 4}, + {"(*UnspecifiedType).Common", Method, 4}, + {"(*UnspecifiedType).Size", Method, 4}, + {"(*UnspecifiedType).String", Method, 4}, + {"(*UnsupportedType).Common", Method, 13}, + {"(*UnsupportedType).Size", Method, 13}, + {"(*UnsupportedType).String", Method, 13}, + {"(*VoidType).Common", Method, 0}, + {"(*VoidType).Size", Method, 0}, + {"(*VoidType).String", Method, 0}, + {"(Attr).GoString", Method, 0}, + {"(Attr).String", Method, 0}, + {"(Class).GoString", Method, 5}, + {"(Class).String", Method, 5}, + {"(DecodeError).Error", Method, 0}, + {"(Tag).GoString", Method, 0}, + {"(Tag).String", Method, 0}, + {"AddrType", Type, 0}, + {"AddrType.BasicType", Field, 0}, + {"ArrayType", Type, 0}, + {"ArrayType.CommonType", Field, 0}, + {"ArrayType.Count", Field, 0}, + {"ArrayType.StrideBitSize", Field, 0}, + {"ArrayType.Type", Field, 0}, + {"Attr", Type, 0}, + {"AttrAbstractOrigin", Const, 0}, + {"AttrAccessibility", Const, 0}, + {"AttrAddrBase", Const, 14}, + {"AttrAddrClass", Const, 0}, + {"AttrAlignment", Const, 14}, + {"AttrAllocated", Const, 0}, + {"AttrArtificial", Const, 0}, + {"AttrAssociated", Const, 0}, + {"AttrBaseTypes", Const, 0}, + {"AttrBinaryScale", Const, 14}, + {"AttrBitOffset", Const, 0}, + {"AttrBitSize", Const, 0}, + {"AttrByteSize", Const, 0}, + {"AttrCallAllCalls", Const, 14}, + {"AttrCallAllSourceCalls", Const, 14}, + {"AttrCallAllTailCalls", Const, 14}, + {"AttrCallColumn", Const, 0}, + {"AttrCallDataLocation", Const, 14}, + {"AttrCallDataValue", Const, 14}, + {"AttrCallFile", Const, 0}, + {"AttrCallLine", Const, 0}, + {"AttrCallOrigin", Const, 14}, + {"AttrCallPC", Const, 14}, + {"AttrCallParameter", Const, 14}, + {"AttrCallReturnPC", Const, 14}, + {"AttrCallTailCall", Const, 14}, + {"AttrCallTarget", Const, 14}, + {"AttrCallTargetClobbered", Const, 14}, + {"AttrCallValue", Const, 14}, + {"AttrCalling", Const, 0}, + {"AttrCommonRef", Const, 0}, + {"AttrCompDir", Const, 0}, + {"AttrConstExpr", Const, 14}, + {"AttrConstValue", Const, 0}, + {"AttrContainingType", Const, 0}, + {"AttrCount", Const, 0}, + {"AttrDataBitOffset", Const, 14}, + {"AttrDataLocation", Const, 0}, + {"AttrDataMemberLoc", Const, 0}, + {"AttrDecimalScale", Const, 14}, + {"AttrDecimalSign", Const, 14}, + {"AttrDeclColumn", Const, 0}, + {"AttrDeclFile", Const, 0}, + {"AttrDeclLine", Const, 0}, + {"AttrDeclaration", Const, 0}, + {"AttrDefaultValue", Const, 0}, + {"AttrDefaulted", Const, 14}, + {"AttrDeleted", Const, 14}, + {"AttrDescription", Const, 0}, + {"AttrDigitCount", Const, 14}, + {"AttrDiscr", Const, 0}, + {"AttrDiscrList", Const, 0}, + {"AttrDiscrValue", Const, 0}, + {"AttrDwoName", Const, 14}, + {"AttrElemental", Const, 14}, + {"AttrEncoding", Const, 0}, + {"AttrEndianity", Const, 14}, + {"AttrEntrypc", Const, 0}, + {"AttrEnumClass", Const, 14}, + {"AttrExplicit", Const, 14}, + {"AttrExportSymbols", Const, 14}, + {"AttrExtension", Const, 0}, + {"AttrExternal", Const, 0}, + {"AttrFrameBase", Const, 0}, + {"AttrFriend", Const, 0}, + {"AttrHighpc", Const, 0}, + {"AttrIdentifierCase", Const, 0}, + {"AttrImport", Const, 0}, + {"AttrInline", Const, 0}, + {"AttrIsOptional", Const, 0}, + {"AttrLanguage", Const, 0}, + {"AttrLinkageName", Const, 14}, + {"AttrLocation", Const, 0}, + {"AttrLoclistsBase", Const, 14}, + {"AttrLowerBound", Const, 0}, + {"AttrLowpc", Const, 0}, + {"AttrMacroInfo", Const, 0}, + {"AttrMacros", Const, 14}, + {"AttrMainSubprogram", Const, 14}, + {"AttrMutable", Const, 14}, + {"AttrName", Const, 0}, + {"AttrNamelistItem", Const, 0}, + {"AttrNoreturn", Const, 14}, + {"AttrObjectPointer", Const, 14}, + {"AttrOrdering", Const, 0}, + {"AttrPictureString", Const, 14}, + {"AttrPriority", Const, 0}, + {"AttrProducer", Const, 0}, + {"AttrPrototyped", Const, 0}, + {"AttrPure", Const, 14}, + {"AttrRanges", Const, 0}, + {"AttrRank", Const, 14}, + {"AttrRecursive", Const, 14}, + {"AttrReference", Const, 14}, + {"AttrReturnAddr", Const, 0}, + {"AttrRnglistsBase", Const, 14}, + {"AttrRvalueReference", Const, 14}, + {"AttrSegment", Const, 0}, + {"AttrSibling", Const, 0}, + {"AttrSignature", Const, 14}, + {"AttrSmall", Const, 14}, + {"AttrSpecification", Const, 0}, + {"AttrStartScope", Const, 0}, + {"AttrStaticLink", Const, 0}, + {"AttrStmtList", Const, 0}, + {"AttrStrOffsetsBase", Const, 14}, + {"AttrStride", Const, 0}, + {"AttrStrideSize", Const, 0}, + {"AttrStringLength", Const, 0}, + {"AttrStringLengthBitSize", Const, 14}, + {"AttrStringLengthByteSize", Const, 14}, + {"AttrThreadsScaled", Const, 14}, + {"AttrTrampoline", Const, 0}, + {"AttrType", Const, 0}, + {"AttrUpperBound", Const, 0}, + {"AttrUseLocation", Const, 0}, + {"AttrUseUTF8", Const, 0}, + {"AttrVarParam", Const, 0}, + {"AttrVirtuality", Const, 0}, + {"AttrVisibility", Const, 0}, + {"AttrVtableElemLoc", Const, 0}, + {"BasicType", Type, 0}, + {"BasicType.BitOffset", Field, 0}, + {"BasicType.BitSize", Field, 0}, + {"BasicType.CommonType", Field, 0}, + {"BasicType.DataBitOffset", Field, 18}, + {"BoolType", Type, 0}, + {"BoolType.BasicType", Field, 0}, + {"CharType", Type, 0}, + {"CharType.BasicType", Field, 0}, + {"Class", Type, 5}, + {"ClassAddrPtr", Const, 14}, + {"ClassAddress", Const, 5}, + {"ClassBlock", Const, 5}, + {"ClassConstant", Const, 5}, + {"ClassExprLoc", Const, 5}, + {"ClassFlag", Const, 5}, + {"ClassLinePtr", Const, 5}, + {"ClassLocList", Const, 14}, + {"ClassLocListPtr", Const, 5}, + {"ClassMacPtr", Const, 5}, + {"ClassRangeListPtr", Const, 5}, + {"ClassReference", Const, 5}, + {"ClassReferenceAlt", Const, 5}, + {"ClassReferenceSig", Const, 5}, + {"ClassRngList", Const, 14}, + {"ClassRngListsPtr", Const, 14}, + {"ClassStrOffsetsPtr", Const, 14}, + {"ClassString", Const, 5}, + {"ClassStringAlt", Const, 5}, + {"ClassUnknown", Const, 6}, + {"CommonType", Type, 0}, + {"CommonType.ByteSize", Field, 0}, + {"CommonType.Name", Field, 0}, + {"ComplexType", Type, 0}, + {"ComplexType.BasicType", Field, 0}, + {"Data", Type, 0}, + {"DecodeError", Type, 0}, + {"DecodeError.Err", Field, 0}, + {"DecodeError.Name", Field, 0}, + {"DecodeError.Offset", Field, 0}, + {"DotDotDotType", Type, 0}, + {"DotDotDotType.CommonType", Field, 0}, + {"Entry", Type, 0}, + {"Entry.Children", Field, 0}, + {"Entry.Field", Field, 0}, + {"Entry.Offset", Field, 0}, + {"Entry.Tag", Field, 0}, + {"EnumType", Type, 0}, + {"EnumType.CommonType", Field, 0}, + {"EnumType.EnumName", Field, 0}, + {"EnumType.Val", Field, 0}, + {"EnumValue", Type, 0}, + {"EnumValue.Name", Field, 0}, + {"EnumValue.Val", Field, 0}, + {"ErrUnknownPC", Var, 5}, + {"Field", Type, 0}, + {"Field.Attr", Field, 0}, + {"Field.Class", Field, 5}, + {"Field.Val", Field, 0}, + {"FloatType", Type, 0}, + {"FloatType.BasicType", Field, 0}, + {"FuncType", Type, 0}, + {"FuncType.CommonType", Field, 0}, + {"FuncType.ParamType", Field, 0}, + {"FuncType.ReturnType", Field, 0}, + {"IntType", Type, 0}, + {"IntType.BasicType", Field, 0}, + {"LineEntry", Type, 5}, + {"LineEntry.Address", Field, 5}, + {"LineEntry.BasicBlock", Field, 5}, + {"LineEntry.Column", Field, 5}, + {"LineEntry.Discriminator", Field, 5}, + {"LineEntry.EndSequence", Field, 5}, + {"LineEntry.EpilogueBegin", Field, 5}, + {"LineEntry.File", Field, 5}, + {"LineEntry.ISA", Field, 5}, + {"LineEntry.IsStmt", Field, 5}, + {"LineEntry.Line", Field, 5}, + {"LineEntry.OpIndex", Field, 5}, + {"LineEntry.PrologueEnd", Field, 5}, + {"LineFile", Type, 5}, + {"LineFile.Length", Field, 5}, + {"LineFile.Mtime", Field, 5}, + {"LineFile.Name", Field, 5}, + {"LineReader", Type, 5}, + {"LineReaderPos", Type, 5}, + {"New", Func, 0}, + {"Offset", Type, 0}, + {"PtrType", Type, 0}, + {"PtrType.CommonType", Field, 0}, + {"PtrType.Type", Field, 0}, + {"QualType", Type, 0}, + {"QualType.CommonType", Field, 0}, + {"QualType.Qual", Field, 0}, + {"QualType.Type", Field, 0}, + {"Reader", Type, 0}, + {"StructField", Type, 0}, + {"StructField.BitOffset", Field, 0}, + {"StructField.BitSize", Field, 0}, + {"StructField.ByteOffset", Field, 0}, + {"StructField.ByteSize", Field, 0}, + {"StructField.DataBitOffset", Field, 18}, + {"StructField.Name", Field, 0}, + {"StructField.Type", Field, 0}, + {"StructType", Type, 0}, + {"StructType.CommonType", Field, 0}, + {"StructType.Field", Field, 0}, + {"StructType.Incomplete", Field, 0}, + {"StructType.Kind", Field, 0}, + {"StructType.StructName", Field, 0}, + {"Tag", Type, 0}, + {"TagAccessDeclaration", Const, 0}, + {"TagArrayType", Const, 0}, + {"TagAtomicType", Const, 14}, + {"TagBaseType", Const, 0}, + {"TagCallSite", Const, 14}, + {"TagCallSiteParameter", Const, 14}, + {"TagCatchDwarfBlock", Const, 0}, + {"TagClassType", Const, 0}, + {"TagCoarrayType", Const, 14}, + {"TagCommonDwarfBlock", Const, 0}, + {"TagCommonInclusion", Const, 0}, + {"TagCompileUnit", Const, 0}, + {"TagCondition", Const, 3}, + {"TagConstType", Const, 0}, + {"TagConstant", Const, 0}, + {"TagDwarfProcedure", Const, 0}, + {"TagDynamicType", Const, 14}, + {"TagEntryPoint", Const, 0}, + {"TagEnumerationType", Const, 0}, + {"TagEnumerator", Const, 0}, + {"TagFileType", Const, 0}, + {"TagFormalParameter", Const, 0}, + {"TagFriend", Const, 0}, + {"TagGenericSubrange", Const, 14}, + {"TagImmutableType", Const, 14}, + {"TagImportedDeclaration", Const, 0}, + {"TagImportedModule", Const, 0}, + {"TagImportedUnit", Const, 0}, + {"TagInheritance", Const, 0}, + {"TagInlinedSubroutine", Const, 0}, + {"TagInterfaceType", Const, 0}, + {"TagLabel", Const, 0}, + {"TagLexDwarfBlock", Const, 0}, + {"TagMember", Const, 0}, + {"TagModule", Const, 0}, + {"TagMutableType", Const, 0}, + {"TagNamelist", Const, 0}, + {"TagNamelistItem", Const, 0}, + {"TagNamespace", Const, 0}, + {"TagPackedType", Const, 0}, + {"TagPartialUnit", Const, 0}, + {"TagPointerType", Const, 0}, + {"TagPtrToMemberType", Const, 0}, + {"TagReferenceType", Const, 0}, + {"TagRestrictType", Const, 0}, + {"TagRvalueReferenceType", Const, 3}, + {"TagSetType", Const, 0}, + {"TagSharedType", Const, 3}, + {"TagSkeletonUnit", Const, 14}, + {"TagStringType", Const, 0}, + {"TagStructType", Const, 0}, + {"TagSubprogram", Const, 0}, + {"TagSubrangeType", Const, 0}, + {"TagSubroutineType", Const, 0}, + {"TagTemplateAlias", Const, 3}, + {"TagTemplateTypeParameter", Const, 0}, + {"TagTemplateValueParameter", Const, 0}, + {"TagThrownType", Const, 0}, + {"TagTryDwarfBlock", Const, 0}, + {"TagTypeUnit", Const, 3}, + {"TagTypedef", Const, 0}, + {"TagUnionType", Const, 0}, + {"TagUnspecifiedParameters", Const, 0}, + {"TagUnspecifiedType", Const, 0}, + {"TagVariable", Const, 0}, + {"TagVariant", Const, 0}, + {"TagVariantPart", Const, 0}, + {"TagVolatileType", Const, 0}, + {"TagWithStmt", Const, 0}, + {"Type", Type, 0}, + {"TypedefType", Type, 0}, + {"TypedefType.CommonType", Field, 0}, + {"TypedefType.Type", Field, 0}, + {"UcharType", Type, 0}, + {"UcharType.BasicType", Field, 0}, + {"UintType", Type, 0}, + {"UintType.BasicType", Field, 0}, + {"UnspecifiedType", Type, 4}, + {"UnspecifiedType.BasicType", Field, 4}, + {"UnsupportedType", Type, 13}, + {"UnsupportedType.CommonType", Field, 13}, + {"UnsupportedType.Tag", Field, 13}, + {"VoidType", Type, 0}, + {"VoidType.CommonType", Field, 0}, + }, + "debug/elf": { + {"(*File).Close", Method, 0}, + {"(*File).DWARF", Method, 0}, + {"(*File).DynString", Method, 1}, + {"(*File).DynValue", Method, 21}, + {"(*File).DynamicSymbols", Method, 4}, + {"(*File).ImportedLibraries", Method, 0}, + {"(*File).ImportedSymbols", Method, 0}, + {"(*File).Section", Method, 0}, + {"(*File).SectionByType", Method, 0}, + {"(*File).Symbols", Method, 0}, + {"(*FormatError).Error", Method, 0}, + {"(*Prog).Open", Method, 0}, + {"(*Section).Data", Method, 0}, + {"(*Section).Open", Method, 0}, + {"(Class).GoString", Method, 0}, + {"(Class).String", Method, 0}, + {"(CompressionType).GoString", Method, 6}, + {"(CompressionType).String", Method, 6}, + {"(Data).GoString", Method, 0}, + {"(Data).String", Method, 0}, + {"(DynFlag).GoString", Method, 0}, + {"(DynFlag).String", Method, 0}, + {"(DynFlag1).GoString", Method, 21}, + {"(DynFlag1).String", Method, 21}, + {"(DynTag).GoString", Method, 0}, + {"(DynTag).String", Method, 0}, + {"(Machine).GoString", Method, 0}, + {"(Machine).String", Method, 0}, + {"(NType).GoString", Method, 0}, + {"(NType).String", Method, 0}, + {"(OSABI).GoString", Method, 0}, + {"(OSABI).String", Method, 0}, + {"(Prog).ReadAt", Method, 0}, + {"(ProgFlag).GoString", Method, 0}, + {"(ProgFlag).String", Method, 0}, + {"(ProgType).GoString", Method, 0}, + {"(ProgType).String", Method, 0}, + {"(R_386).GoString", Method, 0}, + {"(R_386).String", Method, 0}, + {"(R_390).GoString", Method, 7}, + {"(R_390).String", Method, 7}, + {"(R_AARCH64).GoString", Method, 4}, + {"(R_AARCH64).String", Method, 4}, + {"(R_ALPHA).GoString", Method, 0}, + {"(R_ALPHA).String", Method, 0}, + {"(R_ARM).GoString", Method, 0}, + {"(R_ARM).String", Method, 0}, + {"(R_LARCH).GoString", Method, 19}, + {"(R_LARCH).String", Method, 19}, + {"(R_MIPS).GoString", Method, 6}, + {"(R_MIPS).String", Method, 6}, + {"(R_PPC).GoString", Method, 0}, + {"(R_PPC).String", Method, 0}, + {"(R_PPC64).GoString", Method, 5}, + {"(R_PPC64).String", Method, 5}, + {"(R_RISCV).GoString", Method, 11}, + {"(R_RISCV).String", Method, 11}, + {"(R_SPARC).GoString", Method, 0}, + {"(R_SPARC).String", Method, 0}, + {"(R_X86_64).GoString", Method, 0}, + {"(R_X86_64).String", Method, 0}, + {"(Section).ReadAt", Method, 0}, + {"(SectionFlag).GoString", Method, 0}, + {"(SectionFlag).String", Method, 0}, + {"(SectionIndex).GoString", Method, 0}, + {"(SectionIndex).String", Method, 0}, + {"(SectionType).GoString", Method, 0}, + {"(SectionType).String", Method, 0}, + {"(SymBind).GoString", Method, 0}, + {"(SymBind).String", Method, 0}, + {"(SymType).GoString", Method, 0}, + {"(SymType).String", Method, 0}, + {"(SymVis).GoString", Method, 0}, + {"(SymVis).String", Method, 0}, + {"(Type).GoString", Method, 0}, + {"(Type).String", Method, 0}, + {"(Version).GoString", Method, 0}, + {"(Version).String", Method, 0}, + {"ARM_MAGIC_TRAMP_NUMBER", Const, 0}, + {"COMPRESS_HIOS", Const, 6}, + {"COMPRESS_HIPROC", Const, 6}, + {"COMPRESS_LOOS", Const, 6}, + {"COMPRESS_LOPROC", Const, 6}, + {"COMPRESS_ZLIB", Const, 6}, + {"COMPRESS_ZSTD", Const, 21}, + {"Chdr32", Type, 6}, + {"Chdr32.Addralign", Field, 6}, + {"Chdr32.Size", Field, 6}, + {"Chdr32.Type", Field, 6}, + {"Chdr64", Type, 6}, + {"Chdr64.Addralign", Field, 6}, + {"Chdr64.Size", Field, 6}, + {"Chdr64.Type", Field, 6}, + {"Class", Type, 0}, + {"CompressionType", Type, 6}, + {"DF_1_CONFALT", Const, 21}, + {"DF_1_DIRECT", Const, 21}, + {"DF_1_DISPRELDNE", Const, 21}, + {"DF_1_DISPRELPND", Const, 21}, + {"DF_1_EDITED", Const, 21}, + {"DF_1_ENDFILTEE", Const, 21}, + {"DF_1_GLOBAL", Const, 21}, + {"DF_1_GLOBAUDIT", Const, 21}, + {"DF_1_GROUP", Const, 21}, + {"DF_1_IGNMULDEF", Const, 21}, + {"DF_1_INITFIRST", Const, 21}, + {"DF_1_INTERPOSE", Const, 21}, + {"DF_1_KMOD", Const, 21}, + {"DF_1_LOADFLTR", Const, 21}, + {"DF_1_NOCOMMON", Const, 21}, + {"DF_1_NODEFLIB", Const, 21}, + {"DF_1_NODELETE", Const, 21}, + {"DF_1_NODIRECT", Const, 21}, + {"DF_1_NODUMP", Const, 21}, + {"DF_1_NOHDR", Const, 21}, + {"DF_1_NOKSYMS", Const, 21}, + {"DF_1_NOOPEN", Const, 21}, + {"DF_1_NORELOC", Const, 21}, + {"DF_1_NOW", Const, 21}, + {"DF_1_ORIGIN", Const, 21}, + {"DF_1_PIE", Const, 21}, + {"DF_1_SINGLETON", Const, 21}, + {"DF_1_STUB", Const, 21}, + {"DF_1_SYMINTPOSE", Const, 21}, + {"DF_1_TRANS", Const, 21}, + {"DF_1_WEAKFILTER", Const, 21}, + {"DF_BIND_NOW", Const, 0}, + {"DF_ORIGIN", Const, 0}, + {"DF_STATIC_TLS", Const, 0}, + {"DF_SYMBOLIC", Const, 0}, + {"DF_TEXTREL", Const, 0}, + {"DT_ADDRRNGHI", Const, 16}, + {"DT_ADDRRNGLO", Const, 16}, + {"DT_AUDIT", Const, 16}, + {"DT_AUXILIARY", Const, 16}, + {"DT_BIND_NOW", Const, 0}, + {"DT_CHECKSUM", Const, 16}, + {"DT_CONFIG", Const, 16}, + {"DT_DEBUG", Const, 0}, + {"DT_DEPAUDIT", Const, 16}, + {"DT_ENCODING", Const, 0}, + {"DT_FEATURE", Const, 16}, + {"DT_FILTER", Const, 16}, + {"DT_FINI", Const, 0}, + {"DT_FINI_ARRAY", Const, 0}, + {"DT_FINI_ARRAYSZ", Const, 0}, + {"DT_FLAGS", Const, 0}, + {"DT_FLAGS_1", Const, 16}, + {"DT_GNU_CONFLICT", Const, 16}, + {"DT_GNU_CONFLICTSZ", Const, 16}, + {"DT_GNU_HASH", Const, 16}, + {"DT_GNU_LIBLIST", Const, 16}, + {"DT_GNU_LIBLISTSZ", Const, 16}, + {"DT_GNU_PRELINKED", Const, 16}, + {"DT_HASH", Const, 0}, + {"DT_HIOS", Const, 0}, + {"DT_HIPROC", Const, 0}, + {"DT_INIT", Const, 0}, + {"DT_INIT_ARRAY", Const, 0}, + {"DT_INIT_ARRAYSZ", Const, 0}, + {"DT_JMPREL", Const, 0}, + {"DT_LOOS", Const, 0}, + {"DT_LOPROC", Const, 0}, + {"DT_MIPS_AUX_DYNAMIC", Const, 16}, + {"DT_MIPS_BASE_ADDRESS", Const, 16}, + {"DT_MIPS_COMPACT_SIZE", Const, 16}, + {"DT_MIPS_CONFLICT", Const, 16}, + {"DT_MIPS_CONFLICTNO", Const, 16}, + {"DT_MIPS_CXX_FLAGS", Const, 16}, + {"DT_MIPS_DELTA_CLASS", Const, 16}, + {"DT_MIPS_DELTA_CLASSSYM", Const, 16}, + {"DT_MIPS_DELTA_CLASSSYM_NO", Const, 16}, + {"DT_MIPS_DELTA_CLASS_NO", Const, 16}, + {"DT_MIPS_DELTA_INSTANCE", Const, 16}, + {"DT_MIPS_DELTA_INSTANCE_NO", Const, 16}, + {"DT_MIPS_DELTA_RELOC", Const, 16}, + {"DT_MIPS_DELTA_RELOC_NO", Const, 16}, + {"DT_MIPS_DELTA_SYM", Const, 16}, + {"DT_MIPS_DELTA_SYM_NO", Const, 16}, + {"DT_MIPS_DYNSTR_ALIGN", Const, 16}, + {"DT_MIPS_FLAGS", Const, 16}, + {"DT_MIPS_GOTSYM", Const, 16}, + {"DT_MIPS_GP_VALUE", Const, 16}, + {"DT_MIPS_HIDDEN_GOTIDX", Const, 16}, + {"DT_MIPS_HIPAGENO", Const, 16}, + {"DT_MIPS_ICHECKSUM", Const, 16}, + {"DT_MIPS_INTERFACE", Const, 16}, + {"DT_MIPS_INTERFACE_SIZE", Const, 16}, + {"DT_MIPS_IVERSION", Const, 16}, + {"DT_MIPS_LIBLIST", Const, 16}, + {"DT_MIPS_LIBLISTNO", Const, 16}, + {"DT_MIPS_LOCALPAGE_GOTIDX", Const, 16}, + {"DT_MIPS_LOCAL_GOTIDX", Const, 16}, + {"DT_MIPS_LOCAL_GOTNO", Const, 16}, + {"DT_MIPS_MSYM", Const, 16}, + {"DT_MIPS_OPTIONS", Const, 16}, + {"DT_MIPS_PERF_SUFFIX", Const, 16}, + {"DT_MIPS_PIXIE_INIT", Const, 16}, + {"DT_MIPS_PLTGOT", Const, 16}, + {"DT_MIPS_PROTECTED_GOTIDX", Const, 16}, + {"DT_MIPS_RLD_MAP", Const, 16}, + {"DT_MIPS_RLD_MAP_REL", Const, 16}, + {"DT_MIPS_RLD_TEXT_RESOLVE_ADDR", Const, 16}, + {"DT_MIPS_RLD_VERSION", Const, 16}, + {"DT_MIPS_RWPLT", Const, 16}, + {"DT_MIPS_SYMBOL_LIB", Const, 16}, + {"DT_MIPS_SYMTABNO", Const, 16}, + {"DT_MIPS_TIME_STAMP", Const, 16}, + {"DT_MIPS_UNREFEXTNO", Const, 16}, + {"DT_MOVEENT", Const, 16}, + {"DT_MOVESZ", Const, 16}, + {"DT_MOVETAB", Const, 16}, + {"DT_NEEDED", Const, 0}, + {"DT_NULL", Const, 0}, + {"DT_PLTGOT", Const, 0}, + {"DT_PLTPAD", Const, 16}, + {"DT_PLTPADSZ", Const, 16}, + {"DT_PLTREL", Const, 0}, + {"DT_PLTRELSZ", Const, 0}, + {"DT_POSFLAG_1", Const, 16}, + {"DT_PPC64_GLINK", Const, 16}, + {"DT_PPC64_OPD", Const, 16}, + {"DT_PPC64_OPDSZ", Const, 16}, + {"DT_PPC64_OPT", Const, 16}, + {"DT_PPC_GOT", Const, 16}, + {"DT_PPC_OPT", Const, 16}, + {"DT_PREINIT_ARRAY", Const, 0}, + {"DT_PREINIT_ARRAYSZ", Const, 0}, + {"DT_REL", Const, 0}, + {"DT_RELA", Const, 0}, + {"DT_RELACOUNT", Const, 16}, + {"DT_RELAENT", Const, 0}, + {"DT_RELASZ", Const, 0}, + {"DT_RELCOUNT", Const, 16}, + {"DT_RELENT", Const, 0}, + {"DT_RELSZ", Const, 0}, + {"DT_RPATH", Const, 0}, + {"DT_RUNPATH", Const, 0}, + {"DT_SONAME", Const, 0}, + {"DT_SPARC_REGISTER", Const, 16}, + {"DT_STRSZ", Const, 0}, + {"DT_STRTAB", Const, 0}, + {"DT_SYMBOLIC", Const, 0}, + {"DT_SYMENT", Const, 0}, + {"DT_SYMINENT", Const, 16}, + {"DT_SYMINFO", Const, 16}, + {"DT_SYMINSZ", Const, 16}, + {"DT_SYMTAB", Const, 0}, + {"DT_SYMTAB_SHNDX", Const, 16}, + {"DT_TEXTREL", Const, 0}, + {"DT_TLSDESC_GOT", Const, 16}, + {"DT_TLSDESC_PLT", Const, 16}, + {"DT_USED", Const, 16}, + {"DT_VALRNGHI", Const, 16}, + {"DT_VALRNGLO", Const, 16}, + {"DT_VERDEF", Const, 16}, + {"DT_VERDEFNUM", Const, 16}, + {"DT_VERNEED", Const, 0}, + {"DT_VERNEEDNUM", Const, 0}, + {"DT_VERSYM", Const, 0}, + {"Data", Type, 0}, + {"Dyn32", Type, 0}, + {"Dyn32.Tag", Field, 0}, + {"Dyn32.Val", Field, 0}, + {"Dyn64", Type, 0}, + {"Dyn64.Tag", Field, 0}, + {"Dyn64.Val", Field, 0}, + {"DynFlag", Type, 0}, + {"DynFlag1", Type, 21}, + {"DynTag", Type, 0}, + {"EI_ABIVERSION", Const, 0}, + {"EI_CLASS", Const, 0}, + {"EI_DATA", Const, 0}, + {"EI_NIDENT", Const, 0}, + {"EI_OSABI", Const, 0}, + {"EI_PAD", Const, 0}, + {"EI_VERSION", Const, 0}, + {"ELFCLASS32", Const, 0}, + {"ELFCLASS64", Const, 0}, + {"ELFCLASSNONE", Const, 0}, + {"ELFDATA2LSB", Const, 0}, + {"ELFDATA2MSB", Const, 0}, + {"ELFDATANONE", Const, 0}, + {"ELFMAG", Const, 0}, + {"ELFOSABI_86OPEN", Const, 0}, + {"ELFOSABI_AIX", Const, 0}, + {"ELFOSABI_ARM", Const, 0}, + {"ELFOSABI_AROS", Const, 11}, + {"ELFOSABI_CLOUDABI", Const, 11}, + {"ELFOSABI_FENIXOS", Const, 11}, + {"ELFOSABI_FREEBSD", Const, 0}, + {"ELFOSABI_HPUX", Const, 0}, + {"ELFOSABI_HURD", Const, 0}, + {"ELFOSABI_IRIX", Const, 0}, + {"ELFOSABI_LINUX", Const, 0}, + {"ELFOSABI_MODESTO", Const, 0}, + {"ELFOSABI_NETBSD", Const, 0}, + {"ELFOSABI_NONE", Const, 0}, + {"ELFOSABI_NSK", Const, 0}, + {"ELFOSABI_OPENBSD", Const, 0}, + {"ELFOSABI_OPENVMS", Const, 0}, + {"ELFOSABI_SOLARIS", Const, 0}, + {"ELFOSABI_STANDALONE", Const, 0}, + {"ELFOSABI_TRU64", Const, 0}, + {"EM_386", Const, 0}, + {"EM_486", Const, 0}, + {"EM_56800EX", Const, 11}, + {"EM_68HC05", Const, 11}, + {"EM_68HC08", Const, 11}, + {"EM_68HC11", Const, 11}, + {"EM_68HC12", Const, 0}, + {"EM_68HC16", Const, 11}, + {"EM_68K", Const, 0}, + {"EM_78KOR", Const, 11}, + {"EM_8051", Const, 11}, + {"EM_860", Const, 0}, + {"EM_88K", Const, 0}, + {"EM_960", Const, 0}, + {"EM_AARCH64", Const, 4}, + {"EM_ALPHA", Const, 0}, + {"EM_ALPHA_STD", Const, 0}, + {"EM_ALTERA_NIOS2", Const, 11}, + {"EM_AMDGPU", Const, 11}, + {"EM_ARC", Const, 0}, + {"EM_ARCA", Const, 11}, + {"EM_ARC_COMPACT", Const, 11}, + {"EM_ARC_COMPACT2", Const, 11}, + {"EM_ARM", Const, 0}, + {"EM_AVR", Const, 11}, + {"EM_AVR32", Const, 11}, + {"EM_BA1", Const, 11}, + {"EM_BA2", Const, 11}, + {"EM_BLACKFIN", Const, 11}, + {"EM_BPF", Const, 11}, + {"EM_C166", Const, 11}, + {"EM_CDP", Const, 11}, + {"EM_CE", Const, 11}, + {"EM_CLOUDSHIELD", Const, 11}, + {"EM_COGE", Const, 11}, + {"EM_COLDFIRE", Const, 0}, + {"EM_COOL", Const, 11}, + {"EM_COREA_1ST", Const, 11}, + {"EM_COREA_2ND", Const, 11}, + {"EM_CR", Const, 11}, + {"EM_CR16", Const, 11}, + {"EM_CRAYNV2", Const, 11}, + {"EM_CRIS", Const, 11}, + {"EM_CRX", Const, 11}, + {"EM_CSR_KALIMBA", Const, 11}, + {"EM_CUDA", Const, 11}, + {"EM_CYPRESS_M8C", Const, 11}, + {"EM_D10V", Const, 11}, + {"EM_D30V", Const, 11}, + {"EM_DSP24", Const, 11}, + {"EM_DSPIC30F", Const, 11}, + {"EM_DXP", Const, 11}, + {"EM_ECOG1", Const, 11}, + {"EM_ECOG16", Const, 11}, + {"EM_ECOG1X", Const, 11}, + {"EM_ECOG2", Const, 11}, + {"EM_ETPU", Const, 11}, + {"EM_EXCESS", Const, 11}, + {"EM_F2MC16", Const, 11}, + {"EM_FIREPATH", Const, 11}, + {"EM_FR20", Const, 0}, + {"EM_FR30", Const, 11}, + {"EM_FT32", Const, 11}, + {"EM_FX66", Const, 11}, + {"EM_H8S", Const, 0}, + {"EM_H8_300", Const, 0}, + {"EM_H8_300H", Const, 0}, + {"EM_H8_500", Const, 0}, + {"EM_HUANY", Const, 11}, + {"EM_IA_64", Const, 0}, + {"EM_INTEL205", Const, 11}, + {"EM_INTEL206", Const, 11}, + {"EM_INTEL207", Const, 11}, + {"EM_INTEL208", Const, 11}, + {"EM_INTEL209", Const, 11}, + {"EM_IP2K", Const, 11}, + {"EM_JAVELIN", Const, 11}, + {"EM_K10M", Const, 11}, + {"EM_KM32", Const, 11}, + {"EM_KMX16", Const, 11}, + {"EM_KMX32", Const, 11}, + {"EM_KMX8", Const, 11}, + {"EM_KVARC", Const, 11}, + {"EM_L10M", Const, 11}, + {"EM_LANAI", Const, 11}, + {"EM_LATTICEMICO32", Const, 11}, + {"EM_LOONGARCH", Const, 19}, + {"EM_M16C", Const, 11}, + {"EM_M32", Const, 0}, + {"EM_M32C", Const, 11}, + {"EM_M32R", Const, 11}, + {"EM_MANIK", Const, 11}, + {"EM_MAX", Const, 11}, + {"EM_MAXQ30", Const, 11}, + {"EM_MCHP_PIC", Const, 11}, + {"EM_MCST_ELBRUS", Const, 11}, + {"EM_ME16", Const, 0}, + {"EM_METAG", Const, 11}, + {"EM_MICROBLAZE", Const, 11}, + {"EM_MIPS", Const, 0}, + {"EM_MIPS_RS3_LE", Const, 0}, + {"EM_MIPS_RS4_BE", Const, 0}, + {"EM_MIPS_X", Const, 0}, + {"EM_MMA", Const, 0}, + {"EM_MMDSP_PLUS", Const, 11}, + {"EM_MMIX", Const, 11}, + {"EM_MN10200", Const, 11}, + {"EM_MN10300", Const, 11}, + {"EM_MOXIE", Const, 11}, + {"EM_MSP430", Const, 11}, + {"EM_NCPU", Const, 0}, + {"EM_NDR1", Const, 0}, + {"EM_NDS32", Const, 11}, + {"EM_NONE", Const, 0}, + {"EM_NORC", Const, 11}, + {"EM_NS32K", Const, 11}, + {"EM_OPEN8", Const, 11}, + {"EM_OPENRISC", Const, 11}, + {"EM_PARISC", Const, 0}, + {"EM_PCP", Const, 0}, + {"EM_PDP10", Const, 11}, + {"EM_PDP11", Const, 11}, + {"EM_PDSP", Const, 11}, + {"EM_PJ", Const, 11}, + {"EM_PPC", Const, 0}, + {"EM_PPC64", Const, 0}, + {"EM_PRISM", Const, 11}, + {"EM_QDSP6", Const, 11}, + {"EM_R32C", Const, 11}, + {"EM_RCE", Const, 0}, + {"EM_RH32", Const, 0}, + {"EM_RISCV", Const, 11}, + {"EM_RL78", Const, 11}, + {"EM_RS08", Const, 11}, + {"EM_RX", Const, 11}, + {"EM_S370", Const, 0}, + {"EM_S390", Const, 0}, + {"EM_SCORE7", Const, 11}, + {"EM_SEP", Const, 11}, + {"EM_SE_C17", Const, 11}, + {"EM_SE_C33", Const, 11}, + {"EM_SH", Const, 0}, + {"EM_SHARC", Const, 11}, + {"EM_SLE9X", Const, 11}, + {"EM_SNP1K", Const, 11}, + {"EM_SPARC", Const, 0}, + {"EM_SPARC32PLUS", Const, 0}, + {"EM_SPARCV9", Const, 0}, + {"EM_ST100", Const, 0}, + {"EM_ST19", Const, 11}, + {"EM_ST200", Const, 11}, + {"EM_ST7", Const, 11}, + {"EM_ST9PLUS", Const, 11}, + {"EM_STARCORE", Const, 0}, + {"EM_STM8", Const, 11}, + {"EM_STXP7X", Const, 11}, + {"EM_SVX", Const, 11}, + {"EM_TILE64", Const, 11}, + {"EM_TILEGX", Const, 11}, + {"EM_TILEPRO", Const, 11}, + {"EM_TINYJ", Const, 0}, + {"EM_TI_ARP32", Const, 11}, + {"EM_TI_C2000", Const, 11}, + {"EM_TI_C5500", Const, 11}, + {"EM_TI_C6000", Const, 11}, + {"EM_TI_PRU", Const, 11}, + {"EM_TMM_GPP", Const, 11}, + {"EM_TPC", Const, 11}, + {"EM_TRICORE", Const, 0}, + {"EM_TRIMEDIA", Const, 11}, + {"EM_TSK3000", Const, 11}, + {"EM_UNICORE", Const, 11}, + {"EM_V800", Const, 0}, + {"EM_V850", Const, 11}, + {"EM_VAX", Const, 11}, + {"EM_VIDEOCORE", Const, 11}, + {"EM_VIDEOCORE3", Const, 11}, + {"EM_VIDEOCORE5", Const, 11}, + {"EM_VISIUM", Const, 11}, + {"EM_VPP500", Const, 0}, + {"EM_X86_64", Const, 0}, + {"EM_XCORE", Const, 11}, + {"EM_XGATE", Const, 11}, + {"EM_XIMO16", Const, 11}, + {"EM_XTENSA", Const, 11}, + {"EM_Z80", Const, 11}, + {"EM_ZSP", Const, 11}, + {"ET_CORE", Const, 0}, + {"ET_DYN", Const, 0}, + {"ET_EXEC", Const, 0}, + {"ET_HIOS", Const, 0}, + {"ET_HIPROC", Const, 0}, + {"ET_LOOS", Const, 0}, + {"ET_LOPROC", Const, 0}, + {"ET_NONE", Const, 0}, + {"ET_REL", Const, 0}, + {"EV_CURRENT", Const, 0}, + {"EV_NONE", Const, 0}, + {"ErrNoSymbols", Var, 4}, + {"File", Type, 0}, + {"File.FileHeader", Field, 0}, + {"File.Progs", Field, 0}, + {"File.Sections", Field, 0}, + {"FileHeader", Type, 0}, + {"FileHeader.ABIVersion", Field, 0}, + {"FileHeader.ByteOrder", Field, 0}, + {"FileHeader.Class", Field, 0}, + {"FileHeader.Data", Field, 0}, + {"FileHeader.Entry", Field, 1}, + {"FileHeader.Machine", Field, 0}, + {"FileHeader.OSABI", Field, 0}, + {"FileHeader.Type", Field, 0}, + {"FileHeader.Version", Field, 0}, + {"FormatError", Type, 0}, + {"Header32", Type, 0}, + {"Header32.Ehsize", Field, 0}, + {"Header32.Entry", Field, 0}, + {"Header32.Flags", Field, 0}, + {"Header32.Ident", Field, 0}, + {"Header32.Machine", Field, 0}, + {"Header32.Phentsize", Field, 0}, + {"Header32.Phnum", Field, 0}, + {"Header32.Phoff", Field, 0}, + {"Header32.Shentsize", Field, 0}, + {"Header32.Shnum", Field, 0}, + {"Header32.Shoff", Field, 0}, + {"Header32.Shstrndx", Field, 0}, + {"Header32.Type", Field, 0}, + {"Header32.Version", Field, 0}, + {"Header64", Type, 0}, + {"Header64.Ehsize", Field, 0}, + {"Header64.Entry", Field, 0}, + {"Header64.Flags", Field, 0}, + {"Header64.Ident", Field, 0}, + {"Header64.Machine", Field, 0}, + {"Header64.Phentsize", Field, 0}, + {"Header64.Phnum", Field, 0}, + {"Header64.Phoff", Field, 0}, + {"Header64.Shentsize", Field, 0}, + {"Header64.Shnum", Field, 0}, + {"Header64.Shoff", Field, 0}, + {"Header64.Shstrndx", Field, 0}, + {"Header64.Type", Field, 0}, + {"Header64.Version", Field, 0}, + {"ImportedSymbol", Type, 0}, + {"ImportedSymbol.Library", Field, 0}, + {"ImportedSymbol.Name", Field, 0}, + {"ImportedSymbol.Version", Field, 0}, + {"Machine", Type, 0}, + {"NT_FPREGSET", Const, 0}, + {"NT_PRPSINFO", Const, 0}, + {"NT_PRSTATUS", Const, 0}, + {"NType", Type, 0}, + {"NewFile", Func, 0}, + {"OSABI", Type, 0}, + {"Open", Func, 0}, + {"PF_MASKOS", Const, 0}, + {"PF_MASKPROC", Const, 0}, + {"PF_R", Const, 0}, + {"PF_W", Const, 0}, + {"PF_X", Const, 0}, + {"PT_AARCH64_ARCHEXT", Const, 16}, + {"PT_AARCH64_UNWIND", Const, 16}, + {"PT_ARM_ARCHEXT", Const, 16}, + {"PT_ARM_EXIDX", Const, 16}, + {"PT_DYNAMIC", Const, 0}, + {"PT_GNU_EH_FRAME", Const, 16}, + {"PT_GNU_MBIND_HI", Const, 16}, + {"PT_GNU_MBIND_LO", Const, 16}, + {"PT_GNU_PROPERTY", Const, 16}, + {"PT_GNU_RELRO", Const, 16}, + {"PT_GNU_STACK", Const, 16}, + {"PT_HIOS", Const, 0}, + {"PT_HIPROC", Const, 0}, + {"PT_INTERP", Const, 0}, + {"PT_LOAD", Const, 0}, + {"PT_LOOS", Const, 0}, + {"PT_LOPROC", Const, 0}, + {"PT_MIPS_ABIFLAGS", Const, 16}, + {"PT_MIPS_OPTIONS", Const, 16}, + {"PT_MIPS_REGINFO", Const, 16}, + {"PT_MIPS_RTPROC", Const, 16}, + {"PT_NOTE", Const, 0}, + {"PT_NULL", Const, 0}, + {"PT_OPENBSD_BOOTDATA", Const, 16}, + {"PT_OPENBSD_NOBTCFI", Const, 23}, + {"PT_OPENBSD_RANDOMIZE", Const, 16}, + {"PT_OPENBSD_WXNEEDED", Const, 16}, + {"PT_PAX_FLAGS", Const, 16}, + {"PT_PHDR", Const, 0}, + {"PT_S390_PGSTE", Const, 16}, + {"PT_SHLIB", Const, 0}, + {"PT_SUNWSTACK", Const, 16}, + {"PT_SUNW_EH_FRAME", Const, 16}, + {"PT_TLS", Const, 0}, + {"Prog", Type, 0}, + {"Prog.ProgHeader", Field, 0}, + {"Prog.ReaderAt", Field, 0}, + {"Prog32", Type, 0}, + {"Prog32.Align", Field, 0}, + {"Prog32.Filesz", Field, 0}, + {"Prog32.Flags", Field, 0}, + {"Prog32.Memsz", Field, 0}, + {"Prog32.Off", Field, 0}, + {"Prog32.Paddr", Field, 0}, + {"Prog32.Type", Field, 0}, + {"Prog32.Vaddr", Field, 0}, + {"Prog64", Type, 0}, + {"Prog64.Align", Field, 0}, + {"Prog64.Filesz", Field, 0}, + {"Prog64.Flags", Field, 0}, + {"Prog64.Memsz", Field, 0}, + {"Prog64.Off", Field, 0}, + {"Prog64.Paddr", Field, 0}, + {"Prog64.Type", Field, 0}, + {"Prog64.Vaddr", Field, 0}, + {"ProgFlag", Type, 0}, + {"ProgHeader", Type, 0}, + {"ProgHeader.Align", Field, 0}, + {"ProgHeader.Filesz", Field, 0}, + {"ProgHeader.Flags", Field, 0}, + {"ProgHeader.Memsz", Field, 0}, + {"ProgHeader.Off", Field, 0}, + {"ProgHeader.Paddr", Field, 0}, + {"ProgHeader.Type", Field, 0}, + {"ProgHeader.Vaddr", Field, 0}, + {"ProgType", Type, 0}, + {"R_386", Type, 0}, + {"R_386_16", Const, 10}, + {"R_386_32", Const, 0}, + {"R_386_32PLT", Const, 10}, + {"R_386_8", Const, 10}, + {"R_386_COPY", Const, 0}, + {"R_386_GLOB_DAT", Const, 0}, + {"R_386_GOT32", Const, 0}, + {"R_386_GOT32X", Const, 10}, + {"R_386_GOTOFF", Const, 0}, + {"R_386_GOTPC", Const, 0}, + {"R_386_IRELATIVE", Const, 10}, + {"R_386_JMP_SLOT", Const, 0}, + {"R_386_NONE", Const, 0}, + {"R_386_PC16", Const, 10}, + {"R_386_PC32", Const, 0}, + {"R_386_PC8", Const, 10}, + {"R_386_PLT32", Const, 0}, + {"R_386_RELATIVE", Const, 0}, + {"R_386_SIZE32", Const, 10}, + {"R_386_TLS_DESC", Const, 10}, + {"R_386_TLS_DESC_CALL", Const, 10}, + {"R_386_TLS_DTPMOD32", Const, 0}, + {"R_386_TLS_DTPOFF32", Const, 0}, + {"R_386_TLS_GD", Const, 0}, + {"R_386_TLS_GD_32", Const, 0}, + {"R_386_TLS_GD_CALL", Const, 0}, + {"R_386_TLS_GD_POP", Const, 0}, + {"R_386_TLS_GD_PUSH", Const, 0}, + {"R_386_TLS_GOTDESC", Const, 10}, + {"R_386_TLS_GOTIE", Const, 0}, + {"R_386_TLS_IE", Const, 0}, + {"R_386_TLS_IE_32", Const, 0}, + {"R_386_TLS_LDM", Const, 0}, + {"R_386_TLS_LDM_32", Const, 0}, + {"R_386_TLS_LDM_CALL", Const, 0}, + {"R_386_TLS_LDM_POP", Const, 0}, + {"R_386_TLS_LDM_PUSH", Const, 0}, + {"R_386_TLS_LDO_32", Const, 0}, + {"R_386_TLS_LE", Const, 0}, + {"R_386_TLS_LE_32", Const, 0}, + {"R_386_TLS_TPOFF", Const, 0}, + {"R_386_TLS_TPOFF32", Const, 0}, + {"R_390", Type, 7}, + {"R_390_12", Const, 7}, + {"R_390_16", Const, 7}, + {"R_390_20", Const, 7}, + {"R_390_32", Const, 7}, + {"R_390_64", Const, 7}, + {"R_390_8", Const, 7}, + {"R_390_COPY", Const, 7}, + {"R_390_GLOB_DAT", Const, 7}, + {"R_390_GOT12", Const, 7}, + {"R_390_GOT16", Const, 7}, + {"R_390_GOT20", Const, 7}, + {"R_390_GOT32", Const, 7}, + {"R_390_GOT64", Const, 7}, + {"R_390_GOTENT", Const, 7}, + {"R_390_GOTOFF", Const, 7}, + {"R_390_GOTOFF16", Const, 7}, + {"R_390_GOTOFF64", Const, 7}, + {"R_390_GOTPC", Const, 7}, + {"R_390_GOTPCDBL", Const, 7}, + {"R_390_GOTPLT12", Const, 7}, + {"R_390_GOTPLT16", Const, 7}, + {"R_390_GOTPLT20", Const, 7}, + {"R_390_GOTPLT32", Const, 7}, + {"R_390_GOTPLT64", Const, 7}, + {"R_390_GOTPLTENT", Const, 7}, + {"R_390_GOTPLTOFF16", Const, 7}, + {"R_390_GOTPLTOFF32", Const, 7}, + {"R_390_GOTPLTOFF64", Const, 7}, + {"R_390_JMP_SLOT", Const, 7}, + {"R_390_NONE", Const, 7}, + {"R_390_PC16", Const, 7}, + {"R_390_PC16DBL", Const, 7}, + {"R_390_PC32", Const, 7}, + {"R_390_PC32DBL", Const, 7}, + {"R_390_PC64", Const, 7}, + {"R_390_PLT16DBL", Const, 7}, + {"R_390_PLT32", Const, 7}, + {"R_390_PLT32DBL", Const, 7}, + {"R_390_PLT64", Const, 7}, + {"R_390_RELATIVE", Const, 7}, + {"R_390_TLS_DTPMOD", Const, 7}, + {"R_390_TLS_DTPOFF", Const, 7}, + {"R_390_TLS_GD32", Const, 7}, + {"R_390_TLS_GD64", Const, 7}, + {"R_390_TLS_GDCALL", Const, 7}, + {"R_390_TLS_GOTIE12", Const, 7}, + {"R_390_TLS_GOTIE20", Const, 7}, + {"R_390_TLS_GOTIE32", Const, 7}, + {"R_390_TLS_GOTIE64", Const, 7}, + {"R_390_TLS_IE32", Const, 7}, + {"R_390_TLS_IE64", Const, 7}, + {"R_390_TLS_IEENT", Const, 7}, + {"R_390_TLS_LDCALL", Const, 7}, + {"R_390_TLS_LDM32", Const, 7}, + {"R_390_TLS_LDM64", Const, 7}, + {"R_390_TLS_LDO32", Const, 7}, + {"R_390_TLS_LDO64", Const, 7}, + {"R_390_TLS_LE32", Const, 7}, + {"R_390_TLS_LE64", Const, 7}, + {"R_390_TLS_LOAD", Const, 7}, + {"R_390_TLS_TPOFF", Const, 7}, + {"R_AARCH64", Type, 4}, + {"R_AARCH64_ABS16", Const, 4}, + {"R_AARCH64_ABS32", Const, 4}, + {"R_AARCH64_ABS64", Const, 4}, + {"R_AARCH64_ADD_ABS_LO12_NC", Const, 4}, + {"R_AARCH64_ADR_GOT_PAGE", Const, 4}, + {"R_AARCH64_ADR_PREL_LO21", Const, 4}, + {"R_AARCH64_ADR_PREL_PG_HI21", Const, 4}, + {"R_AARCH64_ADR_PREL_PG_HI21_NC", Const, 4}, + {"R_AARCH64_CALL26", Const, 4}, + {"R_AARCH64_CONDBR19", Const, 4}, + {"R_AARCH64_COPY", Const, 4}, + {"R_AARCH64_GLOB_DAT", Const, 4}, + {"R_AARCH64_GOT_LD_PREL19", Const, 4}, + {"R_AARCH64_IRELATIVE", Const, 4}, + {"R_AARCH64_JUMP26", Const, 4}, + {"R_AARCH64_JUMP_SLOT", Const, 4}, + {"R_AARCH64_LD64_GOTOFF_LO15", Const, 10}, + {"R_AARCH64_LD64_GOTPAGE_LO15", Const, 10}, + {"R_AARCH64_LD64_GOT_LO12_NC", Const, 4}, + {"R_AARCH64_LDST128_ABS_LO12_NC", Const, 4}, + {"R_AARCH64_LDST16_ABS_LO12_NC", Const, 4}, + {"R_AARCH64_LDST32_ABS_LO12_NC", Const, 4}, + {"R_AARCH64_LDST64_ABS_LO12_NC", Const, 4}, + {"R_AARCH64_LDST8_ABS_LO12_NC", Const, 4}, + {"R_AARCH64_LD_PREL_LO19", Const, 4}, + {"R_AARCH64_MOVW_SABS_G0", Const, 4}, + {"R_AARCH64_MOVW_SABS_G1", Const, 4}, + {"R_AARCH64_MOVW_SABS_G2", Const, 4}, + {"R_AARCH64_MOVW_UABS_G0", Const, 4}, + {"R_AARCH64_MOVW_UABS_G0_NC", Const, 4}, + {"R_AARCH64_MOVW_UABS_G1", Const, 4}, + {"R_AARCH64_MOVW_UABS_G1_NC", Const, 4}, + {"R_AARCH64_MOVW_UABS_G2", Const, 4}, + {"R_AARCH64_MOVW_UABS_G2_NC", Const, 4}, + {"R_AARCH64_MOVW_UABS_G3", Const, 4}, + {"R_AARCH64_NONE", Const, 4}, + {"R_AARCH64_NULL", Const, 4}, + {"R_AARCH64_P32_ABS16", Const, 4}, + {"R_AARCH64_P32_ABS32", Const, 4}, + {"R_AARCH64_P32_ADD_ABS_LO12_NC", Const, 4}, + {"R_AARCH64_P32_ADR_GOT_PAGE", Const, 4}, + {"R_AARCH64_P32_ADR_PREL_LO21", Const, 4}, + {"R_AARCH64_P32_ADR_PREL_PG_HI21", Const, 4}, + {"R_AARCH64_P32_CALL26", Const, 4}, + {"R_AARCH64_P32_CONDBR19", Const, 4}, + {"R_AARCH64_P32_COPY", Const, 4}, + {"R_AARCH64_P32_GLOB_DAT", Const, 4}, + {"R_AARCH64_P32_GOT_LD_PREL19", Const, 4}, + {"R_AARCH64_P32_IRELATIVE", Const, 4}, + {"R_AARCH64_P32_JUMP26", Const, 4}, + {"R_AARCH64_P32_JUMP_SLOT", Const, 4}, + {"R_AARCH64_P32_LD32_GOT_LO12_NC", Const, 4}, + {"R_AARCH64_P32_LDST128_ABS_LO12_NC", Const, 4}, + {"R_AARCH64_P32_LDST16_ABS_LO12_NC", Const, 4}, + {"R_AARCH64_P32_LDST32_ABS_LO12_NC", Const, 4}, + {"R_AARCH64_P32_LDST64_ABS_LO12_NC", Const, 4}, + {"R_AARCH64_P32_LDST8_ABS_LO12_NC", Const, 4}, + {"R_AARCH64_P32_LD_PREL_LO19", Const, 4}, + {"R_AARCH64_P32_MOVW_SABS_G0", Const, 4}, + {"R_AARCH64_P32_MOVW_UABS_G0", Const, 4}, + {"R_AARCH64_P32_MOVW_UABS_G0_NC", Const, 4}, + {"R_AARCH64_P32_MOVW_UABS_G1", Const, 4}, + {"R_AARCH64_P32_PREL16", Const, 4}, + {"R_AARCH64_P32_PREL32", Const, 4}, + {"R_AARCH64_P32_RELATIVE", Const, 4}, + {"R_AARCH64_P32_TLSDESC", Const, 4}, + {"R_AARCH64_P32_TLSDESC_ADD_LO12_NC", Const, 4}, + {"R_AARCH64_P32_TLSDESC_ADR_PAGE21", Const, 4}, + {"R_AARCH64_P32_TLSDESC_ADR_PREL21", Const, 4}, + {"R_AARCH64_P32_TLSDESC_CALL", Const, 4}, + {"R_AARCH64_P32_TLSDESC_LD32_LO12_NC", Const, 4}, + {"R_AARCH64_P32_TLSDESC_LD_PREL19", Const, 4}, + {"R_AARCH64_P32_TLSGD_ADD_LO12_NC", Const, 4}, + {"R_AARCH64_P32_TLSGD_ADR_PAGE21", Const, 4}, + {"R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21", Const, 4}, + {"R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC", Const, 4}, + {"R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19", Const, 4}, + {"R_AARCH64_P32_TLSLE_ADD_TPREL_HI12", Const, 4}, + {"R_AARCH64_P32_TLSLE_ADD_TPREL_LO12", Const, 4}, + {"R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC", Const, 4}, + {"R_AARCH64_P32_TLSLE_MOVW_TPREL_G0", Const, 4}, + {"R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC", Const, 4}, + {"R_AARCH64_P32_TLSLE_MOVW_TPREL_G1", Const, 4}, + {"R_AARCH64_P32_TLS_DTPMOD", Const, 4}, + {"R_AARCH64_P32_TLS_DTPREL", Const, 4}, + {"R_AARCH64_P32_TLS_TPREL", Const, 4}, + {"R_AARCH64_P32_TSTBR14", Const, 4}, + {"R_AARCH64_PREL16", Const, 4}, + {"R_AARCH64_PREL32", Const, 4}, + {"R_AARCH64_PREL64", Const, 4}, + {"R_AARCH64_RELATIVE", Const, 4}, + {"R_AARCH64_TLSDESC", Const, 4}, + {"R_AARCH64_TLSDESC_ADD", Const, 4}, + {"R_AARCH64_TLSDESC_ADD_LO12_NC", Const, 4}, + {"R_AARCH64_TLSDESC_ADR_PAGE21", Const, 4}, + {"R_AARCH64_TLSDESC_ADR_PREL21", Const, 4}, + {"R_AARCH64_TLSDESC_CALL", Const, 4}, + {"R_AARCH64_TLSDESC_LD64_LO12_NC", Const, 4}, + {"R_AARCH64_TLSDESC_LDR", Const, 4}, + {"R_AARCH64_TLSDESC_LD_PREL19", Const, 4}, + {"R_AARCH64_TLSDESC_OFF_G0_NC", Const, 4}, + {"R_AARCH64_TLSDESC_OFF_G1", Const, 4}, + {"R_AARCH64_TLSGD_ADD_LO12_NC", Const, 4}, + {"R_AARCH64_TLSGD_ADR_PAGE21", Const, 4}, + {"R_AARCH64_TLSGD_ADR_PREL21", Const, 10}, + {"R_AARCH64_TLSGD_MOVW_G0_NC", Const, 10}, + {"R_AARCH64_TLSGD_MOVW_G1", Const, 10}, + {"R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21", Const, 4}, + {"R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC", Const, 4}, + {"R_AARCH64_TLSIE_LD_GOTTPREL_PREL19", Const, 4}, + {"R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC", Const, 4}, + {"R_AARCH64_TLSIE_MOVW_GOTTPREL_G1", Const, 4}, + {"R_AARCH64_TLSLD_ADR_PAGE21", Const, 10}, + {"R_AARCH64_TLSLD_ADR_PREL21", Const, 10}, + {"R_AARCH64_TLSLD_LDST128_DTPREL_LO12", Const, 10}, + {"R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC", Const, 10}, + {"R_AARCH64_TLSLE_ADD_TPREL_HI12", Const, 4}, + {"R_AARCH64_TLSLE_ADD_TPREL_LO12", Const, 4}, + {"R_AARCH64_TLSLE_ADD_TPREL_LO12_NC", Const, 4}, + {"R_AARCH64_TLSLE_LDST128_TPREL_LO12", Const, 10}, + {"R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC", Const, 10}, + {"R_AARCH64_TLSLE_MOVW_TPREL_G0", Const, 4}, + {"R_AARCH64_TLSLE_MOVW_TPREL_G0_NC", Const, 4}, + {"R_AARCH64_TLSLE_MOVW_TPREL_G1", Const, 4}, + {"R_AARCH64_TLSLE_MOVW_TPREL_G1_NC", Const, 4}, + {"R_AARCH64_TLSLE_MOVW_TPREL_G2", Const, 4}, + {"R_AARCH64_TLS_DTPMOD64", Const, 4}, + {"R_AARCH64_TLS_DTPREL64", Const, 4}, + {"R_AARCH64_TLS_TPREL64", Const, 4}, + {"R_AARCH64_TSTBR14", Const, 4}, + {"R_ALPHA", Type, 0}, + {"R_ALPHA_BRADDR", Const, 0}, + {"R_ALPHA_COPY", Const, 0}, + {"R_ALPHA_GLOB_DAT", Const, 0}, + {"R_ALPHA_GPDISP", Const, 0}, + {"R_ALPHA_GPREL32", Const, 0}, + {"R_ALPHA_GPRELHIGH", Const, 0}, + {"R_ALPHA_GPRELLOW", Const, 0}, + {"R_ALPHA_GPVALUE", Const, 0}, + {"R_ALPHA_HINT", Const, 0}, + {"R_ALPHA_IMMED_BR_HI32", Const, 0}, + {"R_ALPHA_IMMED_GP_16", Const, 0}, + {"R_ALPHA_IMMED_GP_HI32", Const, 0}, + {"R_ALPHA_IMMED_LO32", Const, 0}, + {"R_ALPHA_IMMED_SCN_HI32", Const, 0}, + {"R_ALPHA_JMP_SLOT", Const, 0}, + {"R_ALPHA_LITERAL", Const, 0}, + {"R_ALPHA_LITUSE", Const, 0}, + {"R_ALPHA_NONE", Const, 0}, + {"R_ALPHA_OP_PRSHIFT", Const, 0}, + {"R_ALPHA_OP_PSUB", Const, 0}, + {"R_ALPHA_OP_PUSH", Const, 0}, + {"R_ALPHA_OP_STORE", Const, 0}, + {"R_ALPHA_REFLONG", Const, 0}, + {"R_ALPHA_REFQUAD", Const, 0}, + {"R_ALPHA_RELATIVE", Const, 0}, + {"R_ALPHA_SREL16", Const, 0}, + {"R_ALPHA_SREL32", Const, 0}, + {"R_ALPHA_SREL64", Const, 0}, + {"R_ARM", Type, 0}, + {"R_ARM_ABS12", Const, 0}, + {"R_ARM_ABS16", Const, 0}, + {"R_ARM_ABS32", Const, 0}, + {"R_ARM_ABS32_NOI", Const, 10}, + {"R_ARM_ABS8", Const, 0}, + {"R_ARM_ALU_PCREL_15_8", Const, 10}, + {"R_ARM_ALU_PCREL_23_15", Const, 10}, + {"R_ARM_ALU_PCREL_7_0", Const, 10}, + {"R_ARM_ALU_PC_G0", Const, 10}, + {"R_ARM_ALU_PC_G0_NC", Const, 10}, + {"R_ARM_ALU_PC_G1", Const, 10}, + {"R_ARM_ALU_PC_G1_NC", Const, 10}, + {"R_ARM_ALU_PC_G2", Const, 10}, + {"R_ARM_ALU_SBREL_19_12_NC", Const, 10}, + {"R_ARM_ALU_SBREL_27_20_CK", Const, 10}, + {"R_ARM_ALU_SB_G0", Const, 10}, + {"R_ARM_ALU_SB_G0_NC", Const, 10}, + {"R_ARM_ALU_SB_G1", Const, 10}, + {"R_ARM_ALU_SB_G1_NC", Const, 10}, + {"R_ARM_ALU_SB_G2", Const, 10}, + {"R_ARM_AMP_VCALL9", Const, 0}, + {"R_ARM_BASE_ABS", Const, 10}, + {"R_ARM_CALL", Const, 10}, + {"R_ARM_COPY", Const, 0}, + {"R_ARM_GLOB_DAT", Const, 0}, + {"R_ARM_GNU_VTENTRY", Const, 0}, + {"R_ARM_GNU_VTINHERIT", Const, 0}, + {"R_ARM_GOT32", Const, 0}, + {"R_ARM_GOTOFF", Const, 0}, + {"R_ARM_GOTOFF12", Const, 10}, + {"R_ARM_GOTPC", Const, 0}, + {"R_ARM_GOTRELAX", Const, 10}, + {"R_ARM_GOT_ABS", Const, 10}, + {"R_ARM_GOT_BREL12", Const, 10}, + {"R_ARM_GOT_PREL", Const, 10}, + {"R_ARM_IRELATIVE", Const, 10}, + {"R_ARM_JUMP24", Const, 10}, + {"R_ARM_JUMP_SLOT", Const, 0}, + {"R_ARM_LDC_PC_G0", Const, 10}, + {"R_ARM_LDC_PC_G1", Const, 10}, + {"R_ARM_LDC_PC_G2", Const, 10}, + {"R_ARM_LDC_SB_G0", Const, 10}, + {"R_ARM_LDC_SB_G1", Const, 10}, + {"R_ARM_LDC_SB_G2", Const, 10}, + {"R_ARM_LDRS_PC_G0", Const, 10}, + {"R_ARM_LDRS_PC_G1", Const, 10}, + {"R_ARM_LDRS_PC_G2", Const, 10}, + {"R_ARM_LDRS_SB_G0", Const, 10}, + {"R_ARM_LDRS_SB_G1", Const, 10}, + {"R_ARM_LDRS_SB_G2", Const, 10}, + {"R_ARM_LDR_PC_G1", Const, 10}, + {"R_ARM_LDR_PC_G2", Const, 10}, + {"R_ARM_LDR_SBREL_11_10_NC", Const, 10}, + {"R_ARM_LDR_SB_G0", Const, 10}, + {"R_ARM_LDR_SB_G1", Const, 10}, + {"R_ARM_LDR_SB_G2", Const, 10}, + {"R_ARM_ME_TOO", Const, 10}, + {"R_ARM_MOVT_ABS", Const, 10}, + {"R_ARM_MOVT_BREL", Const, 10}, + {"R_ARM_MOVT_PREL", Const, 10}, + {"R_ARM_MOVW_ABS_NC", Const, 10}, + {"R_ARM_MOVW_BREL", Const, 10}, + {"R_ARM_MOVW_BREL_NC", Const, 10}, + {"R_ARM_MOVW_PREL_NC", Const, 10}, + {"R_ARM_NONE", Const, 0}, + {"R_ARM_PC13", Const, 0}, + {"R_ARM_PC24", Const, 0}, + {"R_ARM_PLT32", Const, 0}, + {"R_ARM_PLT32_ABS", Const, 10}, + {"R_ARM_PREL31", Const, 10}, + {"R_ARM_PRIVATE_0", Const, 10}, + {"R_ARM_PRIVATE_1", Const, 10}, + {"R_ARM_PRIVATE_10", Const, 10}, + {"R_ARM_PRIVATE_11", Const, 10}, + {"R_ARM_PRIVATE_12", Const, 10}, + {"R_ARM_PRIVATE_13", Const, 10}, + {"R_ARM_PRIVATE_14", Const, 10}, + {"R_ARM_PRIVATE_15", Const, 10}, + {"R_ARM_PRIVATE_2", Const, 10}, + {"R_ARM_PRIVATE_3", Const, 10}, + {"R_ARM_PRIVATE_4", Const, 10}, + {"R_ARM_PRIVATE_5", Const, 10}, + {"R_ARM_PRIVATE_6", Const, 10}, + {"R_ARM_PRIVATE_7", Const, 10}, + {"R_ARM_PRIVATE_8", Const, 10}, + {"R_ARM_PRIVATE_9", Const, 10}, + {"R_ARM_RABS32", Const, 0}, + {"R_ARM_RBASE", Const, 0}, + {"R_ARM_REL32", Const, 0}, + {"R_ARM_REL32_NOI", Const, 10}, + {"R_ARM_RELATIVE", Const, 0}, + {"R_ARM_RPC24", Const, 0}, + {"R_ARM_RREL32", Const, 0}, + {"R_ARM_RSBREL32", Const, 0}, + {"R_ARM_RXPC25", Const, 10}, + {"R_ARM_SBREL31", Const, 10}, + {"R_ARM_SBREL32", Const, 0}, + {"R_ARM_SWI24", Const, 0}, + {"R_ARM_TARGET1", Const, 10}, + {"R_ARM_TARGET2", Const, 10}, + {"R_ARM_THM_ABS5", Const, 0}, + {"R_ARM_THM_ALU_ABS_G0_NC", Const, 10}, + {"R_ARM_THM_ALU_ABS_G1_NC", Const, 10}, + {"R_ARM_THM_ALU_ABS_G2_NC", Const, 10}, + {"R_ARM_THM_ALU_ABS_G3", Const, 10}, + {"R_ARM_THM_ALU_PREL_11_0", Const, 10}, + {"R_ARM_THM_GOT_BREL12", Const, 10}, + {"R_ARM_THM_JUMP11", Const, 10}, + {"R_ARM_THM_JUMP19", Const, 10}, + {"R_ARM_THM_JUMP24", Const, 10}, + {"R_ARM_THM_JUMP6", Const, 10}, + {"R_ARM_THM_JUMP8", Const, 10}, + {"R_ARM_THM_MOVT_ABS", Const, 10}, + {"R_ARM_THM_MOVT_BREL", Const, 10}, + {"R_ARM_THM_MOVT_PREL", Const, 10}, + {"R_ARM_THM_MOVW_ABS_NC", Const, 10}, + {"R_ARM_THM_MOVW_BREL", Const, 10}, + {"R_ARM_THM_MOVW_BREL_NC", Const, 10}, + {"R_ARM_THM_MOVW_PREL_NC", Const, 10}, + {"R_ARM_THM_PC12", Const, 10}, + {"R_ARM_THM_PC22", Const, 0}, + {"R_ARM_THM_PC8", Const, 0}, + {"R_ARM_THM_RPC22", Const, 0}, + {"R_ARM_THM_SWI8", Const, 0}, + {"R_ARM_THM_TLS_CALL", Const, 10}, + {"R_ARM_THM_TLS_DESCSEQ16", Const, 10}, + {"R_ARM_THM_TLS_DESCSEQ32", Const, 10}, + {"R_ARM_THM_XPC22", Const, 0}, + {"R_ARM_TLS_CALL", Const, 10}, + {"R_ARM_TLS_DESCSEQ", Const, 10}, + {"R_ARM_TLS_DTPMOD32", Const, 10}, + {"R_ARM_TLS_DTPOFF32", Const, 10}, + {"R_ARM_TLS_GD32", Const, 10}, + {"R_ARM_TLS_GOTDESC", Const, 10}, + {"R_ARM_TLS_IE12GP", Const, 10}, + {"R_ARM_TLS_IE32", Const, 10}, + {"R_ARM_TLS_LDM32", Const, 10}, + {"R_ARM_TLS_LDO12", Const, 10}, + {"R_ARM_TLS_LDO32", Const, 10}, + {"R_ARM_TLS_LE12", Const, 10}, + {"R_ARM_TLS_LE32", Const, 10}, + {"R_ARM_TLS_TPOFF32", Const, 10}, + {"R_ARM_V4BX", Const, 10}, + {"R_ARM_XPC25", Const, 0}, + {"R_INFO", Func, 0}, + {"R_INFO32", Func, 0}, + {"R_LARCH", Type, 19}, + {"R_LARCH_32", Const, 19}, + {"R_LARCH_32_PCREL", Const, 20}, + {"R_LARCH_64", Const, 19}, + {"R_LARCH_64_PCREL", Const, 22}, + {"R_LARCH_ABS64_HI12", Const, 20}, + {"R_LARCH_ABS64_LO20", Const, 20}, + {"R_LARCH_ABS_HI20", Const, 20}, + {"R_LARCH_ABS_LO12", Const, 20}, + {"R_LARCH_ADD16", Const, 19}, + {"R_LARCH_ADD24", Const, 19}, + {"R_LARCH_ADD32", Const, 19}, + {"R_LARCH_ADD6", Const, 22}, + {"R_LARCH_ADD64", Const, 19}, + {"R_LARCH_ADD8", Const, 19}, + {"R_LARCH_ADD_ULEB128", Const, 22}, + {"R_LARCH_ALIGN", Const, 22}, + {"R_LARCH_B16", Const, 20}, + {"R_LARCH_B21", Const, 20}, + {"R_LARCH_B26", Const, 20}, + {"R_LARCH_CFA", Const, 22}, + {"R_LARCH_COPY", Const, 19}, + {"R_LARCH_DELETE", Const, 22}, + {"R_LARCH_GNU_VTENTRY", Const, 20}, + {"R_LARCH_GNU_VTINHERIT", Const, 20}, + {"R_LARCH_GOT64_HI12", Const, 20}, + {"R_LARCH_GOT64_LO20", Const, 20}, + {"R_LARCH_GOT64_PC_HI12", Const, 20}, + {"R_LARCH_GOT64_PC_LO20", Const, 20}, + {"R_LARCH_GOT_HI20", Const, 20}, + {"R_LARCH_GOT_LO12", Const, 20}, + {"R_LARCH_GOT_PC_HI20", Const, 20}, + {"R_LARCH_GOT_PC_LO12", Const, 20}, + {"R_LARCH_IRELATIVE", Const, 19}, + {"R_LARCH_JUMP_SLOT", Const, 19}, + {"R_LARCH_MARK_LA", Const, 19}, + {"R_LARCH_MARK_PCREL", Const, 19}, + {"R_LARCH_NONE", Const, 19}, + {"R_LARCH_PCALA64_HI12", Const, 20}, + {"R_LARCH_PCALA64_LO20", Const, 20}, + {"R_LARCH_PCALA_HI20", Const, 20}, + {"R_LARCH_PCALA_LO12", Const, 20}, + {"R_LARCH_PCREL20_S2", Const, 22}, + {"R_LARCH_RELATIVE", Const, 19}, + {"R_LARCH_RELAX", Const, 20}, + {"R_LARCH_SOP_ADD", Const, 19}, + {"R_LARCH_SOP_AND", Const, 19}, + {"R_LARCH_SOP_ASSERT", Const, 19}, + {"R_LARCH_SOP_IF_ELSE", Const, 19}, + {"R_LARCH_SOP_NOT", Const, 19}, + {"R_LARCH_SOP_POP_32_S_0_10_10_16_S2", Const, 19}, + {"R_LARCH_SOP_POP_32_S_0_5_10_16_S2", Const, 19}, + {"R_LARCH_SOP_POP_32_S_10_12", Const, 19}, + {"R_LARCH_SOP_POP_32_S_10_16", Const, 19}, + {"R_LARCH_SOP_POP_32_S_10_16_S2", Const, 19}, + {"R_LARCH_SOP_POP_32_S_10_5", Const, 19}, + {"R_LARCH_SOP_POP_32_S_5_20", Const, 19}, + {"R_LARCH_SOP_POP_32_U", Const, 19}, + {"R_LARCH_SOP_POP_32_U_10_12", Const, 19}, + {"R_LARCH_SOP_PUSH_ABSOLUTE", Const, 19}, + {"R_LARCH_SOP_PUSH_DUP", Const, 19}, + {"R_LARCH_SOP_PUSH_GPREL", Const, 19}, + {"R_LARCH_SOP_PUSH_PCREL", Const, 19}, + {"R_LARCH_SOP_PUSH_PLT_PCREL", Const, 19}, + {"R_LARCH_SOP_PUSH_TLS_GD", Const, 19}, + {"R_LARCH_SOP_PUSH_TLS_GOT", Const, 19}, + {"R_LARCH_SOP_PUSH_TLS_TPREL", Const, 19}, + {"R_LARCH_SOP_SL", Const, 19}, + {"R_LARCH_SOP_SR", Const, 19}, + {"R_LARCH_SOP_SUB", Const, 19}, + {"R_LARCH_SUB16", Const, 19}, + {"R_LARCH_SUB24", Const, 19}, + {"R_LARCH_SUB32", Const, 19}, + {"R_LARCH_SUB6", Const, 22}, + {"R_LARCH_SUB64", Const, 19}, + {"R_LARCH_SUB8", Const, 19}, + {"R_LARCH_SUB_ULEB128", Const, 22}, + {"R_LARCH_TLS_DTPMOD32", Const, 19}, + {"R_LARCH_TLS_DTPMOD64", Const, 19}, + {"R_LARCH_TLS_DTPREL32", Const, 19}, + {"R_LARCH_TLS_DTPREL64", Const, 19}, + {"R_LARCH_TLS_GD_HI20", Const, 20}, + {"R_LARCH_TLS_GD_PC_HI20", Const, 20}, + {"R_LARCH_TLS_IE64_HI12", Const, 20}, + {"R_LARCH_TLS_IE64_LO20", Const, 20}, + {"R_LARCH_TLS_IE64_PC_HI12", Const, 20}, + {"R_LARCH_TLS_IE64_PC_LO20", Const, 20}, + {"R_LARCH_TLS_IE_HI20", Const, 20}, + {"R_LARCH_TLS_IE_LO12", Const, 20}, + {"R_LARCH_TLS_IE_PC_HI20", Const, 20}, + {"R_LARCH_TLS_IE_PC_LO12", Const, 20}, + {"R_LARCH_TLS_LD_HI20", Const, 20}, + {"R_LARCH_TLS_LD_PC_HI20", Const, 20}, + {"R_LARCH_TLS_LE64_HI12", Const, 20}, + {"R_LARCH_TLS_LE64_LO20", Const, 20}, + {"R_LARCH_TLS_LE_HI20", Const, 20}, + {"R_LARCH_TLS_LE_LO12", Const, 20}, + {"R_LARCH_TLS_TPREL32", Const, 19}, + {"R_LARCH_TLS_TPREL64", Const, 19}, + {"R_MIPS", Type, 6}, + {"R_MIPS_16", Const, 6}, + {"R_MIPS_26", Const, 6}, + {"R_MIPS_32", Const, 6}, + {"R_MIPS_64", Const, 6}, + {"R_MIPS_ADD_IMMEDIATE", Const, 6}, + {"R_MIPS_CALL16", Const, 6}, + {"R_MIPS_CALL_HI16", Const, 6}, + {"R_MIPS_CALL_LO16", Const, 6}, + {"R_MIPS_DELETE", Const, 6}, + {"R_MIPS_GOT16", Const, 6}, + {"R_MIPS_GOT_DISP", Const, 6}, + {"R_MIPS_GOT_HI16", Const, 6}, + {"R_MIPS_GOT_LO16", Const, 6}, + {"R_MIPS_GOT_OFST", Const, 6}, + {"R_MIPS_GOT_PAGE", Const, 6}, + {"R_MIPS_GPREL16", Const, 6}, + {"R_MIPS_GPREL32", Const, 6}, + {"R_MIPS_HI16", Const, 6}, + {"R_MIPS_HIGHER", Const, 6}, + {"R_MIPS_HIGHEST", Const, 6}, + {"R_MIPS_INSERT_A", Const, 6}, + {"R_MIPS_INSERT_B", Const, 6}, + {"R_MIPS_JALR", Const, 6}, + {"R_MIPS_LITERAL", Const, 6}, + {"R_MIPS_LO16", Const, 6}, + {"R_MIPS_NONE", Const, 6}, + {"R_MIPS_PC16", Const, 6}, + {"R_MIPS_PC32", Const, 22}, + {"R_MIPS_PJUMP", Const, 6}, + {"R_MIPS_REL16", Const, 6}, + {"R_MIPS_REL32", Const, 6}, + {"R_MIPS_RELGOT", Const, 6}, + {"R_MIPS_SCN_DISP", Const, 6}, + {"R_MIPS_SHIFT5", Const, 6}, + {"R_MIPS_SHIFT6", Const, 6}, + {"R_MIPS_SUB", Const, 6}, + {"R_MIPS_TLS_DTPMOD32", Const, 6}, + {"R_MIPS_TLS_DTPMOD64", Const, 6}, + {"R_MIPS_TLS_DTPREL32", Const, 6}, + {"R_MIPS_TLS_DTPREL64", Const, 6}, + {"R_MIPS_TLS_DTPREL_HI16", Const, 6}, + {"R_MIPS_TLS_DTPREL_LO16", Const, 6}, + {"R_MIPS_TLS_GD", Const, 6}, + {"R_MIPS_TLS_GOTTPREL", Const, 6}, + {"R_MIPS_TLS_LDM", Const, 6}, + {"R_MIPS_TLS_TPREL32", Const, 6}, + {"R_MIPS_TLS_TPREL64", Const, 6}, + {"R_MIPS_TLS_TPREL_HI16", Const, 6}, + {"R_MIPS_TLS_TPREL_LO16", Const, 6}, + {"R_PPC", Type, 0}, + {"R_PPC64", Type, 5}, + {"R_PPC64_ADDR14", Const, 5}, + {"R_PPC64_ADDR14_BRNTAKEN", Const, 5}, + {"R_PPC64_ADDR14_BRTAKEN", Const, 5}, + {"R_PPC64_ADDR16", Const, 5}, + {"R_PPC64_ADDR16_DS", Const, 5}, + {"R_PPC64_ADDR16_HA", Const, 5}, + {"R_PPC64_ADDR16_HI", Const, 5}, + {"R_PPC64_ADDR16_HIGH", Const, 10}, + {"R_PPC64_ADDR16_HIGHA", Const, 10}, + {"R_PPC64_ADDR16_HIGHER", Const, 5}, + {"R_PPC64_ADDR16_HIGHER34", Const, 20}, + {"R_PPC64_ADDR16_HIGHERA", Const, 5}, + {"R_PPC64_ADDR16_HIGHERA34", Const, 20}, + {"R_PPC64_ADDR16_HIGHEST", Const, 5}, + {"R_PPC64_ADDR16_HIGHEST34", Const, 20}, + {"R_PPC64_ADDR16_HIGHESTA", Const, 5}, + {"R_PPC64_ADDR16_HIGHESTA34", Const, 20}, + {"R_PPC64_ADDR16_LO", Const, 5}, + {"R_PPC64_ADDR16_LO_DS", Const, 5}, + {"R_PPC64_ADDR24", Const, 5}, + {"R_PPC64_ADDR32", Const, 5}, + {"R_PPC64_ADDR64", Const, 5}, + {"R_PPC64_ADDR64_LOCAL", Const, 10}, + {"R_PPC64_COPY", Const, 20}, + {"R_PPC64_D28", Const, 20}, + {"R_PPC64_D34", Const, 20}, + {"R_PPC64_D34_HA30", Const, 20}, + {"R_PPC64_D34_HI30", Const, 20}, + {"R_PPC64_D34_LO", Const, 20}, + {"R_PPC64_DTPMOD64", Const, 5}, + {"R_PPC64_DTPREL16", Const, 5}, + {"R_PPC64_DTPREL16_DS", Const, 5}, + {"R_PPC64_DTPREL16_HA", Const, 5}, + {"R_PPC64_DTPREL16_HI", Const, 5}, + {"R_PPC64_DTPREL16_HIGH", Const, 10}, + {"R_PPC64_DTPREL16_HIGHA", Const, 10}, + {"R_PPC64_DTPREL16_HIGHER", Const, 5}, + {"R_PPC64_DTPREL16_HIGHERA", Const, 5}, + {"R_PPC64_DTPREL16_HIGHEST", Const, 5}, + {"R_PPC64_DTPREL16_HIGHESTA", Const, 5}, + {"R_PPC64_DTPREL16_LO", Const, 5}, + {"R_PPC64_DTPREL16_LO_DS", Const, 5}, + {"R_PPC64_DTPREL34", Const, 20}, + {"R_PPC64_DTPREL64", Const, 5}, + {"R_PPC64_ENTRY", Const, 10}, + {"R_PPC64_GLOB_DAT", Const, 20}, + {"R_PPC64_GNU_VTENTRY", Const, 20}, + {"R_PPC64_GNU_VTINHERIT", Const, 20}, + {"R_PPC64_GOT16", Const, 5}, + {"R_PPC64_GOT16_DS", Const, 5}, + {"R_PPC64_GOT16_HA", Const, 5}, + {"R_PPC64_GOT16_HI", Const, 5}, + {"R_PPC64_GOT16_LO", Const, 5}, + {"R_PPC64_GOT16_LO_DS", Const, 5}, + {"R_PPC64_GOT_DTPREL16_DS", Const, 5}, + {"R_PPC64_GOT_DTPREL16_HA", Const, 5}, + {"R_PPC64_GOT_DTPREL16_HI", Const, 5}, + {"R_PPC64_GOT_DTPREL16_LO_DS", Const, 5}, + {"R_PPC64_GOT_DTPREL_PCREL34", Const, 20}, + {"R_PPC64_GOT_PCREL34", Const, 20}, + {"R_PPC64_GOT_TLSGD16", Const, 5}, + {"R_PPC64_GOT_TLSGD16_HA", Const, 5}, + {"R_PPC64_GOT_TLSGD16_HI", Const, 5}, + {"R_PPC64_GOT_TLSGD16_LO", Const, 5}, + {"R_PPC64_GOT_TLSGD_PCREL34", Const, 20}, + {"R_PPC64_GOT_TLSLD16", Const, 5}, + {"R_PPC64_GOT_TLSLD16_HA", Const, 5}, + {"R_PPC64_GOT_TLSLD16_HI", Const, 5}, + {"R_PPC64_GOT_TLSLD16_LO", Const, 5}, + {"R_PPC64_GOT_TLSLD_PCREL34", Const, 20}, + {"R_PPC64_GOT_TPREL16_DS", Const, 5}, + {"R_PPC64_GOT_TPREL16_HA", Const, 5}, + {"R_PPC64_GOT_TPREL16_HI", Const, 5}, + {"R_PPC64_GOT_TPREL16_LO_DS", Const, 5}, + {"R_PPC64_GOT_TPREL_PCREL34", Const, 20}, + {"R_PPC64_IRELATIVE", Const, 10}, + {"R_PPC64_JMP_IREL", Const, 10}, + {"R_PPC64_JMP_SLOT", Const, 5}, + {"R_PPC64_NONE", Const, 5}, + {"R_PPC64_PCREL28", Const, 20}, + {"R_PPC64_PCREL34", Const, 20}, + {"R_PPC64_PCREL_OPT", Const, 20}, + {"R_PPC64_PLT16_HA", Const, 20}, + {"R_PPC64_PLT16_HI", Const, 20}, + {"R_PPC64_PLT16_LO", Const, 20}, + {"R_PPC64_PLT16_LO_DS", Const, 10}, + {"R_PPC64_PLT32", Const, 20}, + {"R_PPC64_PLT64", Const, 20}, + {"R_PPC64_PLTCALL", Const, 20}, + {"R_PPC64_PLTCALL_NOTOC", Const, 20}, + {"R_PPC64_PLTGOT16", Const, 10}, + {"R_PPC64_PLTGOT16_DS", Const, 10}, + {"R_PPC64_PLTGOT16_HA", Const, 10}, + {"R_PPC64_PLTGOT16_HI", Const, 10}, + {"R_PPC64_PLTGOT16_LO", Const, 10}, + {"R_PPC64_PLTGOT_LO_DS", Const, 10}, + {"R_PPC64_PLTREL32", Const, 20}, + {"R_PPC64_PLTREL64", Const, 20}, + {"R_PPC64_PLTSEQ", Const, 20}, + {"R_PPC64_PLTSEQ_NOTOC", Const, 20}, + {"R_PPC64_PLT_PCREL34", Const, 20}, + {"R_PPC64_PLT_PCREL34_NOTOC", Const, 20}, + {"R_PPC64_REL14", Const, 5}, + {"R_PPC64_REL14_BRNTAKEN", Const, 5}, + {"R_PPC64_REL14_BRTAKEN", Const, 5}, + {"R_PPC64_REL16", Const, 5}, + {"R_PPC64_REL16DX_HA", Const, 10}, + {"R_PPC64_REL16_HA", Const, 5}, + {"R_PPC64_REL16_HI", Const, 5}, + {"R_PPC64_REL16_HIGH", Const, 20}, + {"R_PPC64_REL16_HIGHA", Const, 20}, + {"R_PPC64_REL16_HIGHER", Const, 20}, + {"R_PPC64_REL16_HIGHER34", Const, 20}, + {"R_PPC64_REL16_HIGHERA", Const, 20}, + {"R_PPC64_REL16_HIGHERA34", Const, 20}, + {"R_PPC64_REL16_HIGHEST", Const, 20}, + {"R_PPC64_REL16_HIGHEST34", Const, 20}, + {"R_PPC64_REL16_HIGHESTA", Const, 20}, + {"R_PPC64_REL16_HIGHESTA34", Const, 20}, + {"R_PPC64_REL16_LO", Const, 5}, + {"R_PPC64_REL24", Const, 5}, + {"R_PPC64_REL24_NOTOC", Const, 10}, + {"R_PPC64_REL24_P9NOTOC", Const, 21}, + {"R_PPC64_REL30", Const, 20}, + {"R_PPC64_REL32", Const, 5}, + {"R_PPC64_REL64", Const, 5}, + {"R_PPC64_RELATIVE", Const, 18}, + {"R_PPC64_SECTOFF", Const, 20}, + {"R_PPC64_SECTOFF_DS", Const, 10}, + {"R_PPC64_SECTOFF_HA", Const, 20}, + {"R_PPC64_SECTOFF_HI", Const, 20}, + {"R_PPC64_SECTOFF_LO", Const, 20}, + {"R_PPC64_SECTOFF_LO_DS", Const, 10}, + {"R_PPC64_TLS", Const, 5}, + {"R_PPC64_TLSGD", Const, 5}, + {"R_PPC64_TLSLD", Const, 5}, + {"R_PPC64_TOC", Const, 5}, + {"R_PPC64_TOC16", Const, 5}, + {"R_PPC64_TOC16_DS", Const, 5}, + {"R_PPC64_TOC16_HA", Const, 5}, + {"R_PPC64_TOC16_HI", Const, 5}, + {"R_PPC64_TOC16_LO", Const, 5}, + {"R_PPC64_TOC16_LO_DS", Const, 5}, + {"R_PPC64_TOCSAVE", Const, 10}, + {"R_PPC64_TPREL16", Const, 5}, + {"R_PPC64_TPREL16_DS", Const, 5}, + {"R_PPC64_TPREL16_HA", Const, 5}, + {"R_PPC64_TPREL16_HI", Const, 5}, + {"R_PPC64_TPREL16_HIGH", Const, 10}, + {"R_PPC64_TPREL16_HIGHA", Const, 10}, + {"R_PPC64_TPREL16_HIGHER", Const, 5}, + {"R_PPC64_TPREL16_HIGHERA", Const, 5}, + {"R_PPC64_TPREL16_HIGHEST", Const, 5}, + {"R_PPC64_TPREL16_HIGHESTA", Const, 5}, + {"R_PPC64_TPREL16_LO", Const, 5}, + {"R_PPC64_TPREL16_LO_DS", Const, 5}, + {"R_PPC64_TPREL34", Const, 20}, + {"R_PPC64_TPREL64", Const, 5}, + {"R_PPC64_UADDR16", Const, 20}, + {"R_PPC64_UADDR32", Const, 20}, + {"R_PPC64_UADDR64", Const, 20}, + {"R_PPC_ADDR14", Const, 0}, + {"R_PPC_ADDR14_BRNTAKEN", Const, 0}, + {"R_PPC_ADDR14_BRTAKEN", Const, 0}, + {"R_PPC_ADDR16", Const, 0}, + {"R_PPC_ADDR16_HA", Const, 0}, + {"R_PPC_ADDR16_HI", Const, 0}, + {"R_PPC_ADDR16_LO", Const, 0}, + {"R_PPC_ADDR24", Const, 0}, + {"R_PPC_ADDR32", Const, 0}, + {"R_PPC_COPY", Const, 0}, + {"R_PPC_DTPMOD32", Const, 0}, + {"R_PPC_DTPREL16", Const, 0}, + {"R_PPC_DTPREL16_HA", Const, 0}, + {"R_PPC_DTPREL16_HI", Const, 0}, + {"R_PPC_DTPREL16_LO", Const, 0}, + {"R_PPC_DTPREL32", Const, 0}, + {"R_PPC_EMB_BIT_FLD", Const, 0}, + {"R_PPC_EMB_MRKREF", Const, 0}, + {"R_PPC_EMB_NADDR16", Const, 0}, + {"R_PPC_EMB_NADDR16_HA", Const, 0}, + {"R_PPC_EMB_NADDR16_HI", Const, 0}, + {"R_PPC_EMB_NADDR16_LO", Const, 0}, + {"R_PPC_EMB_NADDR32", Const, 0}, + {"R_PPC_EMB_RELSDA", Const, 0}, + {"R_PPC_EMB_RELSEC16", Const, 0}, + {"R_PPC_EMB_RELST_HA", Const, 0}, + {"R_PPC_EMB_RELST_HI", Const, 0}, + {"R_PPC_EMB_RELST_LO", Const, 0}, + {"R_PPC_EMB_SDA21", Const, 0}, + {"R_PPC_EMB_SDA2I16", Const, 0}, + {"R_PPC_EMB_SDA2REL", Const, 0}, + {"R_PPC_EMB_SDAI16", Const, 0}, + {"R_PPC_GLOB_DAT", Const, 0}, + {"R_PPC_GOT16", Const, 0}, + {"R_PPC_GOT16_HA", Const, 0}, + {"R_PPC_GOT16_HI", Const, 0}, + {"R_PPC_GOT16_LO", Const, 0}, + {"R_PPC_GOT_TLSGD16", Const, 0}, + {"R_PPC_GOT_TLSGD16_HA", Const, 0}, + {"R_PPC_GOT_TLSGD16_HI", Const, 0}, + {"R_PPC_GOT_TLSGD16_LO", Const, 0}, + {"R_PPC_GOT_TLSLD16", Const, 0}, + {"R_PPC_GOT_TLSLD16_HA", Const, 0}, + {"R_PPC_GOT_TLSLD16_HI", Const, 0}, + {"R_PPC_GOT_TLSLD16_LO", Const, 0}, + {"R_PPC_GOT_TPREL16", Const, 0}, + {"R_PPC_GOT_TPREL16_HA", Const, 0}, + {"R_PPC_GOT_TPREL16_HI", Const, 0}, + {"R_PPC_GOT_TPREL16_LO", Const, 0}, + {"R_PPC_JMP_SLOT", Const, 0}, + {"R_PPC_LOCAL24PC", Const, 0}, + {"R_PPC_NONE", Const, 0}, + {"R_PPC_PLT16_HA", Const, 0}, + {"R_PPC_PLT16_HI", Const, 0}, + {"R_PPC_PLT16_LO", Const, 0}, + {"R_PPC_PLT32", Const, 0}, + {"R_PPC_PLTREL24", Const, 0}, + {"R_PPC_PLTREL32", Const, 0}, + {"R_PPC_REL14", Const, 0}, + {"R_PPC_REL14_BRNTAKEN", Const, 0}, + {"R_PPC_REL14_BRTAKEN", Const, 0}, + {"R_PPC_REL24", Const, 0}, + {"R_PPC_REL32", Const, 0}, + {"R_PPC_RELATIVE", Const, 0}, + {"R_PPC_SDAREL16", Const, 0}, + {"R_PPC_SECTOFF", Const, 0}, + {"R_PPC_SECTOFF_HA", Const, 0}, + {"R_PPC_SECTOFF_HI", Const, 0}, + {"R_PPC_SECTOFF_LO", Const, 0}, + {"R_PPC_TLS", Const, 0}, + {"R_PPC_TPREL16", Const, 0}, + {"R_PPC_TPREL16_HA", Const, 0}, + {"R_PPC_TPREL16_HI", Const, 0}, + {"R_PPC_TPREL16_LO", Const, 0}, + {"R_PPC_TPREL32", Const, 0}, + {"R_PPC_UADDR16", Const, 0}, + {"R_PPC_UADDR32", Const, 0}, + {"R_RISCV", Type, 11}, + {"R_RISCV_32", Const, 11}, + {"R_RISCV_32_PCREL", Const, 12}, + {"R_RISCV_64", Const, 11}, + {"R_RISCV_ADD16", Const, 11}, + {"R_RISCV_ADD32", Const, 11}, + {"R_RISCV_ADD64", Const, 11}, + {"R_RISCV_ADD8", Const, 11}, + {"R_RISCV_ALIGN", Const, 11}, + {"R_RISCV_BRANCH", Const, 11}, + {"R_RISCV_CALL", Const, 11}, + {"R_RISCV_CALL_PLT", Const, 11}, + {"R_RISCV_COPY", Const, 11}, + {"R_RISCV_GNU_VTENTRY", Const, 11}, + {"R_RISCV_GNU_VTINHERIT", Const, 11}, + {"R_RISCV_GOT_HI20", Const, 11}, + {"R_RISCV_GPREL_I", Const, 11}, + {"R_RISCV_GPREL_S", Const, 11}, + {"R_RISCV_HI20", Const, 11}, + {"R_RISCV_JAL", Const, 11}, + {"R_RISCV_JUMP_SLOT", Const, 11}, + {"R_RISCV_LO12_I", Const, 11}, + {"R_RISCV_LO12_S", Const, 11}, + {"R_RISCV_NONE", Const, 11}, + {"R_RISCV_PCREL_HI20", Const, 11}, + {"R_RISCV_PCREL_LO12_I", Const, 11}, + {"R_RISCV_PCREL_LO12_S", Const, 11}, + {"R_RISCV_RELATIVE", Const, 11}, + {"R_RISCV_RELAX", Const, 11}, + {"R_RISCV_RVC_BRANCH", Const, 11}, + {"R_RISCV_RVC_JUMP", Const, 11}, + {"R_RISCV_RVC_LUI", Const, 11}, + {"R_RISCV_SET16", Const, 11}, + {"R_RISCV_SET32", Const, 11}, + {"R_RISCV_SET6", Const, 11}, + {"R_RISCV_SET8", Const, 11}, + {"R_RISCV_SUB16", Const, 11}, + {"R_RISCV_SUB32", Const, 11}, + {"R_RISCV_SUB6", Const, 11}, + {"R_RISCV_SUB64", Const, 11}, + {"R_RISCV_SUB8", Const, 11}, + {"R_RISCV_TLS_DTPMOD32", Const, 11}, + {"R_RISCV_TLS_DTPMOD64", Const, 11}, + {"R_RISCV_TLS_DTPREL32", Const, 11}, + {"R_RISCV_TLS_DTPREL64", Const, 11}, + {"R_RISCV_TLS_GD_HI20", Const, 11}, + {"R_RISCV_TLS_GOT_HI20", Const, 11}, + {"R_RISCV_TLS_TPREL32", Const, 11}, + {"R_RISCV_TLS_TPREL64", Const, 11}, + {"R_RISCV_TPREL_ADD", Const, 11}, + {"R_RISCV_TPREL_HI20", Const, 11}, + {"R_RISCV_TPREL_I", Const, 11}, + {"R_RISCV_TPREL_LO12_I", Const, 11}, + {"R_RISCV_TPREL_LO12_S", Const, 11}, + {"R_RISCV_TPREL_S", Const, 11}, + {"R_SPARC", Type, 0}, + {"R_SPARC_10", Const, 0}, + {"R_SPARC_11", Const, 0}, + {"R_SPARC_13", Const, 0}, + {"R_SPARC_16", Const, 0}, + {"R_SPARC_22", Const, 0}, + {"R_SPARC_32", Const, 0}, + {"R_SPARC_5", Const, 0}, + {"R_SPARC_6", Const, 0}, + {"R_SPARC_64", Const, 0}, + {"R_SPARC_7", Const, 0}, + {"R_SPARC_8", Const, 0}, + {"R_SPARC_COPY", Const, 0}, + {"R_SPARC_DISP16", Const, 0}, + {"R_SPARC_DISP32", Const, 0}, + {"R_SPARC_DISP64", Const, 0}, + {"R_SPARC_DISP8", Const, 0}, + {"R_SPARC_GLOB_DAT", Const, 0}, + {"R_SPARC_GLOB_JMP", Const, 0}, + {"R_SPARC_GOT10", Const, 0}, + {"R_SPARC_GOT13", Const, 0}, + {"R_SPARC_GOT22", Const, 0}, + {"R_SPARC_H44", Const, 0}, + {"R_SPARC_HH22", Const, 0}, + {"R_SPARC_HI22", Const, 0}, + {"R_SPARC_HIPLT22", Const, 0}, + {"R_SPARC_HIX22", Const, 0}, + {"R_SPARC_HM10", Const, 0}, + {"R_SPARC_JMP_SLOT", Const, 0}, + {"R_SPARC_L44", Const, 0}, + {"R_SPARC_LM22", Const, 0}, + {"R_SPARC_LO10", Const, 0}, + {"R_SPARC_LOPLT10", Const, 0}, + {"R_SPARC_LOX10", Const, 0}, + {"R_SPARC_M44", Const, 0}, + {"R_SPARC_NONE", Const, 0}, + {"R_SPARC_OLO10", Const, 0}, + {"R_SPARC_PC10", Const, 0}, + {"R_SPARC_PC22", Const, 0}, + {"R_SPARC_PCPLT10", Const, 0}, + {"R_SPARC_PCPLT22", Const, 0}, + {"R_SPARC_PCPLT32", Const, 0}, + {"R_SPARC_PC_HH22", Const, 0}, + {"R_SPARC_PC_HM10", Const, 0}, + {"R_SPARC_PC_LM22", Const, 0}, + {"R_SPARC_PLT32", Const, 0}, + {"R_SPARC_PLT64", Const, 0}, + {"R_SPARC_REGISTER", Const, 0}, + {"R_SPARC_RELATIVE", Const, 0}, + {"R_SPARC_UA16", Const, 0}, + {"R_SPARC_UA32", Const, 0}, + {"R_SPARC_UA64", Const, 0}, + {"R_SPARC_WDISP16", Const, 0}, + {"R_SPARC_WDISP19", Const, 0}, + {"R_SPARC_WDISP22", Const, 0}, + {"R_SPARC_WDISP30", Const, 0}, + {"R_SPARC_WPLT30", Const, 0}, + {"R_SYM32", Func, 0}, + {"R_SYM64", Func, 0}, + {"R_TYPE32", Func, 0}, + {"R_TYPE64", Func, 0}, + {"R_X86_64", Type, 0}, + {"R_X86_64_16", Const, 0}, + {"R_X86_64_32", Const, 0}, + {"R_X86_64_32S", Const, 0}, + {"R_X86_64_64", Const, 0}, + {"R_X86_64_8", Const, 0}, + {"R_X86_64_COPY", Const, 0}, + {"R_X86_64_DTPMOD64", Const, 0}, + {"R_X86_64_DTPOFF32", Const, 0}, + {"R_X86_64_DTPOFF64", Const, 0}, + {"R_X86_64_GLOB_DAT", Const, 0}, + {"R_X86_64_GOT32", Const, 0}, + {"R_X86_64_GOT64", Const, 10}, + {"R_X86_64_GOTOFF64", Const, 10}, + {"R_X86_64_GOTPC32", Const, 10}, + {"R_X86_64_GOTPC32_TLSDESC", Const, 10}, + {"R_X86_64_GOTPC64", Const, 10}, + {"R_X86_64_GOTPCREL", Const, 0}, + {"R_X86_64_GOTPCREL64", Const, 10}, + {"R_X86_64_GOTPCRELX", Const, 10}, + {"R_X86_64_GOTPLT64", Const, 10}, + {"R_X86_64_GOTTPOFF", Const, 0}, + {"R_X86_64_IRELATIVE", Const, 10}, + {"R_X86_64_JMP_SLOT", Const, 0}, + {"R_X86_64_NONE", Const, 0}, + {"R_X86_64_PC16", Const, 0}, + {"R_X86_64_PC32", Const, 0}, + {"R_X86_64_PC32_BND", Const, 10}, + {"R_X86_64_PC64", Const, 10}, + {"R_X86_64_PC8", Const, 0}, + {"R_X86_64_PLT32", Const, 0}, + {"R_X86_64_PLT32_BND", Const, 10}, + {"R_X86_64_PLTOFF64", Const, 10}, + {"R_X86_64_RELATIVE", Const, 0}, + {"R_X86_64_RELATIVE64", Const, 10}, + {"R_X86_64_REX_GOTPCRELX", Const, 10}, + {"R_X86_64_SIZE32", Const, 10}, + {"R_X86_64_SIZE64", Const, 10}, + {"R_X86_64_TLSDESC", Const, 10}, + {"R_X86_64_TLSDESC_CALL", Const, 10}, + {"R_X86_64_TLSGD", Const, 0}, + {"R_X86_64_TLSLD", Const, 0}, + {"R_X86_64_TPOFF32", Const, 0}, + {"R_X86_64_TPOFF64", Const, 0}, + {"Rel32", Type, 0}, + {"Rel32.Info", Field, 0}, + {"Rel32.Off", Field, 0}, + {"Rel64", Type, 0}, + {"Rel64.Info", Field, 0}, + {"Rel64.Off", Field, 0}, + {"Rela32", Type, 0}, + {"Rela32.Addend", Field, 0}, + {"Rela32.Info", Field, 0}, + {"Rela32.Off", Field, 0}, + {"Rela64", Type, 0}, + {"Rela64.Addend", Field, 0}, + {"Rela64.Info", Field, 0}, + {"Rela64.Off", Field, 0}, + {"SHF_ALLOC", Const, 0}, + {"SHF_COMPRESSED", Const, 6}, + {"SHF_EXECINSTR", Const, 0}, + {"SHF_GROUP", Const, 0}, + {"SHF_INFO_LINK", Const, 0}, + {"SHF_LINK_ORDER", Const, 0}, + {"SHF_MASKOS", Const, 0}, + {"SHF_MASKPROC", Const, 0}, + {"SHF_MERGE", Const, 0}, + {"SHF_OS_NONCONFORMING", Const, 0}, + {"SHF_STRINGS", Const, 0}, + {"SHF_TLS", Const, 0}, + {"SHF_WRITE", Const, 0}, + {"SHN_ABS", Const, 0}, + {"SHN_COMMON", Const, 0}, + {"SHN_HIOS", Const, 0}, + {"SHN_HIPROC", Const, 0}, + {"SHN_HIRESERVE", Const, 0}, + {"SHN_LOOS", Const, 0}, + {"SHN_LOPROC", Const, 0}, + {"SHN_LORESERVE", Const, 0}, + {"SHN_UNDEF", Const, 0}, + {"SHN_XINDEX", Const, 0}, + {"SHT_DYNAMIC", Const, 0}, + {"SHT_DYNSYM", Const, 0}, + {"SHT_FINI_ARRAY", Const, 0}, + {"SHT_GNU_ATTRIBUTES", Const, 0}, + {"SHT_GNU_HASH", Const, 0}, + {"SHT_GNU_LIBLIST", Const, 0}, + {"SHT_GNU_VERDEF", Const, 0}, + {"SHT_GNU_VERNEED", Const, 0}, + {"SHT_GNU_VERSYM", Const, 0}, + {"SHT_GROUP", Const, 0}, + {"SHT_HASH", Const, 0}, + {"SHT_HIOS", Const, 0}, + {"SHT_HIPROC", Const, 0}, + {"SHT_HIUSER", Const, 0}, + {"SHT_INIT_ARRAY", Const, 0}, + {"SHT_LOOS", Const, 0}, + {"SHT_LOPROC", Const, 0}, + {"SHT_LOUSER", Const, 0}, + {"SHT_MIPS_ABIFLAGS", Const, 17}, + {"SHT_NOBITS", Const, 0}, + {"SHT_NOTE", Const, 0}, + {"SHT_NULL", Const, 0}, + {"SHT_PREINIT_ARRAY", Const, 0}, + {"SHT_PROGBITS", Const, 0}, + {"SHT_REL", Const, 0}, + {"SHT_RELA", Const, 0}, + {"SHT_SHLIB", Const, 0}, + {"SHT_STRTAB", Const, 0}, + {"SHT_SYMTAB", Const, 0}, + {"SHT_SYMTAB_SHNDX", Const, 0}, + {"STB_GLOBAL", Const, 0}, + {"STB_HIOS", Const, 0}, + {"STB_HIPROC", Const, 0}, + {"STB_LOCAL", Const, 0}, + {"STB_LOOS", Const, 0}, + {"STB_LOPROC", Const, 0}, + {"STB_WEAK", Const, 0}, + {"STT_COMMON", Const, 0}, + {"STT_FILE", Const, 0}, + {"STT_FUNC", Const, 0}, + {"STT_GNU_IFUNC", Const, 23}, + {"STT_HIOS", Const, 0}, + {"STT_HIPROC", Const, 0}, + {"STT_LOOS", Const, 0}, + {"STT_LOPROC", Const, 0}, + {"STT_NOTYPE", Const, 0}, + {"STT_OBJECT", Const, 0}, + {"STT_RELC", Const, 23}, + {"STT_SECTION", Const, 0}, + {"STT_SRELC", Const, 23}, + {"STT_TLS", Const, 0}, + {"STV_DEFAULT", Const, 0}, + {"STV_HIDDEN", Const, 0}, + {"STV_INTERNAL", Const, 0}, + {"STV_PROTECTED", Const, 0}, + {"ST_BIND", Func, 0}, + {"ST_INFO", Func, 0}, + {"ST_TYPE", Func, 0}, + {"ST_VISIBILITY", Func, 0}, + {"Section", Type, 0}, + {"Section.ReaderAt", Field, 0}, + {"Section.SectionHeader", Field, 0}, + {"Section32", Type, 0}, + {"Section32.Addr", Field, 0}, + {"Section32.Addralign", Field, 0}, + {"Section32.Entsize", Field, 0}, + {"Section32.Flags", Field, 0}, + {"Section32.Info", Field, 0}, + {"Section32.Link", Field, 0}, + {"Section32.Name", Field, 0}, + {"Section32.Off", Field, 0}, + {"Section32.Size", Field, 0}, + {"Section32.Type", Field, 0}, + {"Section64", Type, 0}, + {"Section64.Addr", Field, 0}, + {"Section64.Addralign", Field, 0}, + {"Section64.Entsize", Field, 0}, + {"Section64.Flags", Field, 0}, + {"Section64.Info", Field, 0}, + {"Section64.Link", Field, 0}, + {"Section64.Name", Field, 0}, + {"Section64.Off", Field, 0}, + {"Section64.Size", Field, 0}, + {"Section64.Type", Field, 0}, + {"SectionFlag", Type, 0}, + {"SectionHeader", Type, 0}, + {"SectionHeader.Addr", Field, 0}, + {"SectionHeader.Addralign", Field, 0}, + {"SectionHeader.Entsize", Field, 0}, + {"SectionHeader.FileSize", Field, 6}, + {"SectionHeader.Flags", Field, 0}, + {"SectionHeader.Info", Field, 0}, + {"SectionHeader.Link", Field, 0}, + {"SectionHeader.Name", Field, 0}, + {"SectionHeader.Offset", Field, 0}, + {"SectionHeader.Size", Field, 0}, + {"SectionHeader.Type", Field, 0}, + {"SectionIndex", Type, 0}, + {"SectionType", Type, 0}, + {"Sym32", Type, 0}, + {"Sym32.Info", Field, 0}, + {"Sym32.Name", Field, 0}, + {"Sym32.Other", Field, 0}, + {"Sym32.Shndx", Field, 0}, + {"Sym32.Size", Field, 0}, + {"Sym32.Value", Field, 0}, + {"Sym32Size", Const, 0}, + {"Sym64", Type, 0}, + {"Sym64.Info", Field, 0}, + {"Sym64.Name", Field, 0}, + {"Sym64.Other", Field, 0}, + {"Sym64.Shndx", Field, 0}, + {"Sym64.Size", Field, 0}, + {"Sym64.Value", Field, 0}, + {"Sym64Size", Const, 0}, + {"SymBind", Type, 0}, + {"SymType", Type, 0}, + {"SymVis", Type, 0}, + {"Symbol", Type, 0}, + {"Symbol.Info", Field, 0}, + {"Symbol.Library", Field, 13}, + {"Symbol.Name", Field, 0}, + {"Symbol.Other", Field, 0}, + {"Symbol.Section", Field, 0}, + {"Symbol.Size", Field, 0}, + {"Symbol.Value", Field, 0}, + {"Symbol.Version", Field, 13}, + {"Type", Type, 0}, + {"Version", Type, 0}, + }, + "debug/gosym": { + {"(*DecodingError).Error", Method, 0}, + {"(*LineTable).LineToPC", Method, 0}, + {"(*LineTable).PCToLine", Method, 0}, + {"(*Sym).BaseName", Method, 0}, + {"(*Sym).PackageName", Method, 0}, + {"(*Sym).ReceiverName", Method, 0}, + {"(*Sym).Static", Method, 0}, + {"(*Table).LineToPC", Method, 0}, + {"(*Table).LookupFunc", Method, 0}, + {"(*Table).LookupSym", Method, 0}, + {"(*Table).PCToFunc", Method, 0}, + {"(*Table).PCToLine", Method, 0}, + {"(*Table).SymByAddr", Method, 0}, + {"(*UnknownLineError).Error", Method, 0}, + {"(Func).BaseName", Method, 0}, + {"(Func).PackageName", Method, 0}, + {"(Func).ReceiverName", Method, 0}, + {"(Func).Static", Method, 0}, + {"(UnknownFileError).Error", Method, 0}, + {"DecodingError", Type, 0}, + {"Func", Type, 0}, + {"Func.End", Field, 0}, + {"Func.Entry", Field, 0}, + {"Func.FrameSize", Field, 0}, + {"Func.LineTable", Field, 0}, + {"Func.Locals", Field, 0}, + {"Func.Obj", Field, 0}, + {"Func.Params", Field, 0}, + {"Func.Sym", Field, 0}, + {"LineTable", Type, 0}, + {"LineTable.Data", Field, 0}, + {"LineTable.Line", Field, 0}, + {"LineTable.PC", Field, 0}, + {"NewLineTable", Func, 0}, + {"NewTable", Func, 0}, + {"Obj", Type, 0}, + {"Obj.Funcs", Field, 0}, + {"Obj.Paths", Field, 0}, + {"Sym", Type, 0}, + {"Sym.Func", Field, 0}, + {"Sym.GoType", Field, 0}, + {"Sym.Name", Field, 0}, + {"Sym.Type", Field, 0}, + {"Sym.Value", Field, 0}, + {"Table", Type, 0}, + {"Table.Files", Field, 0}, + {"Table.Funcs", Field, 0}, + {"Table.Objs", Field, 0}, + {"Table.Syms", Field, 0}, + {"UnknownFileError", Type, 0}, + {"UnknownLineError", Type, 0}, + {"UnknownLineError.File", Field, 0}, + {"UnknownLineError.Line", Field, 0}, + }, + "debug/macho": { + {"(*FatFile).Close", Method, 3}, + {"(*File).Close", Method, 0}, + {"(*File).DWARF", Method, 0}, + {"(*File).ImportedLibraries", Method, 0}, + {"(*File).ImportedSymbols", Method, 0}, + {"(*File).Section", Method, 0}, + {"(*File).Segment", Method, 0}, + {"(*FormatError).Error", Method, 0}, + {"(*Section).Data", Method, 0}, + {"(*Section).Open", Method, 0}, + {"(*Segment).Data", Method, 0}, + {"(*Segment).Open", Method, 0}, + {"(Cpu).GoString", Method, 0}, + {"(Cpu).String", Method, 0}, + {"(Dylib).Raw", Method, 0}, + {"(Dysymtab).Raw", Method, 0}, + {"(FatArch).Close", Method, 3}, + {"(FatArch).DWARF", Method, 3}, + {"(FatArch).ImportedLibraries", Method, 3}, + {"(FatArch).ImportedSymbols", Method, 3}, + {"(FatArch).Section", Method, 3}, + {"(FatArch).Segment", Method, 3}, + {"(LoadBytes).Raw", Method, 0}, + {"(LoadCmd).GoString", Method, 0}, + {"(LoadCmd).String", Method, 0}, + {"(RelocTypeARM).GoString", Method, 10}, + {"(RelocTypeARM).String", Method, 10}, + {"(RelocTypeARM64).GoString", Method, 10}, + {"(RelocTypeARM64).String", Method, 10}, + {"(RelocTypeGeneric).GoString", Method, 10}, + {"(RelocTypeGeneric).String", Method, 10}, + {"(RelocTypeX86_64).GoString", Method, 10}, + {"(RelocTypeX86_64).String", Method, 10}, + {"(Rpath).Raw", Method, 10}, + {"(Section).ReadAt", Method, 0}, + {"(Segment).Raw", Method, 0}, + {"(Segment).ReadAt", Method, 0}, + {"(Symtab).Raw", Method, 0}, + {"(Type).GoString", Method, 10}, + {"(Type).String", Method, 10}, + {"ARM64_RELOC_ADDEND", Const, 10}, + {"ARM64_RELOC_BRANCH26", Const, 10}, + {"ARM64_RELOC_GOT_LOAD_PAGE21", Const, 10}, + {"ARM64_RELOC_GOT_LOAD_PAGEOFF12", Const, 10}, + {"ARM64_RELOC_PAGE21", Const, 10}, + {"ARM64_RELOC_PAGEOFF12", Const, 10}, + {"ARM64_RELOC_POINTER_TO_GOT", Const, 10}, + {"ARM64_RELOC_SUBTRACTOR", Const, 10}, + {"ARM64_RELOC_TLVP_LOAD_PAGE21", Const, 10}, + {"ARM64_RELOC_TLVP_LOAD_PAGEOFF12", Const, 10}, + {"ARM64_RELOC_UNSIGNED", Const, 10}, + {"ARM_RELOC_BR24", Const, 10}, + {"ARM_RELOC_HALF", Const, 10}, + {"ARM_RELOC_HALF_SECTDIFF", Const, 10}, + {"ARM_RELOC_LOCAL_SECTDIFF", Const, 10}, + {"ARM_RELOC_PAIR", Const, 10}, + {"ARM_RELOC_PB_LA_PTR", Const, 10}, + {"ARM_RELOC_SECTDIFF", Const, 10}, + {"ARM_RELOC_VANILLA", Const, 10}, + {"ARM_THUMB_32BIT_BRANCH", Const, 10}, + {"ARM_THUMB_RELOC_BR22", Const, 10}, + {"Cpu", Type, 0}, + {"Cpu386", Const, 0}, + {"CpuAmd64", Const, 0}, + {"CpuArm", Const, 3}, + {"CpuArm64", Const, 11}, + {"CpuPpc", Const, 3}, + {"CpuPpc64", Const, 3}, + {"Dylib", Type, 0}, + {"Dylib.CompatVersion", Field, 0}, + {"Dylib.CurrentVersion", Field, 0}, + {"Dylib.LoadBytes", Field, 0}, + {"Dylib.Name", Field, 0}, + {"Dylib.Time", Field, 0}, + {"DylibCmd", Type, 0}, + {"DylibCmd.Cmd", Field, 0}, + {"DylibCmd.CompatVersion", Field, 0}, + {"DylibCmd.CurrentVersion", Field, 0}, + {"DylibCmd.Len", Field, 0}, + {"DylibCmd.Name", Field, 0}, + {"DylibCmd.Time", Field, 0}, + {"Dysymtab", Type, 0}, + {"Dysymtab.DysymtabCmd", Field, 0}, + {"Dysymtab.IndirectSyms", Field, 0}, + {"Dysymtab.LoadBytes", Field, 0}, + {"DysymtabCmd", Type, 0}, + {"DysymtabCmd.Cmd", Field, 0}, + {"DysymtabCmd.Extrefsymoff", Field, 0}, + {"DysymtabCmd.Extreloff", Field, 0}, + {"DysymtabCmd.Iextdefsym", Field, 0}, + {"DysymtabCmd.Ilocalsym", Field, 0}, + {"DysymtabCmd.Indirectsymoff", Field, 0}, + {"DysymtabCmd.Iundefsym", Field, 0}, + {"DysymtabCmd.Len", Field, 0}, + {"DysymtabCmd.Locreloff", Field, 0}, + {"DysymtabCmd.Modtaboff", Field, 0}, + {"DysymtabCmd.Nextdefsym", Field, 0}, + {"DysymtabCmd.Nextrefsyms", Field, 0}, + {"DysymtabCmd.Nextrel", Field, 0}, + {"DysymtabCmd.Nindirectsyms", Field, 0}, + {"DysymtabCmd.Nlocalsym", Field, 0}, + {"DysymtabCmd.Nlocrel", Field, 0}, + {"DysymtabCmd.Nmodtab", Field, 0}, + {"DysymtabCmd.Ntoc", Field, 0}, + {"DysymtabCmd.Nundefsym", Field, 0}, + {"DysymtabCmd.Tocoffset", Field, 0}, + {"ErrNotFat", Var, 3}, + {"FatArch", Type, 3}, + {"FatArch.FatArchHeader", Field, 3}, + {"FatArch.File", Field, 3}, + {"FatArchHeader", Type, 3}, + {"FatArchHeader.Align", Field, 3}, + {"FatArchHeader.Cpu", Field, 3}, + {"FatArchHeader.Offset", Field, 3}, + {"FatArchHeader.Size", Field, 3}, + {"FatArchHeader.SubCpu", Field, 3}, + {"FatFile", Type, 3}, + {"FatFile.Arches", Field, 3}, + {"FatFile.Magic", Field, 3}, + {"File", Type, 0}, + {"File.ByteOrder", Field, 0}, + {"File.Dysymtab", Field, 0}, + {"File.FileHeader", Field, 0}, + {"File.Loads", Field, 0}, + {"File.Sections", Field, 0}, + {"File.Symtab", Field, 0}, + {"FileHeader", Type, 0}, + {"FileHeader.Cmdsz", Field, 0}, + {"FileHeader.Cpu", Field, 0}, + {"FileHeader.Flags", Field, 0}, + {"FileHeader.Magic", Field, 0}, + {"FileHeader.Ncmd", Field, 0}, + {"FileHeader.SubCpu", Field, 0}, + {"FileHeader.Type", Field, 0}, + {"FlagAllModsBound", Const, 10}, + {"FlagAllowStackExecution", Const, 10}, + {"FlagAppExtensionSafe", Const, 10}, + {"FlagBindAtLoad", Const, 10}, + {"FlagBindsToWeak", Const, 10}, + {"FlagCanonical", Const, 10}, + {"FlagDeadStrippableDylib", Const, 10}, + {"FlagDyldLink", Const, 10}, + {"FlagForceFlat", Const, 10}, + {"FlagHasTLVDescriptors", Const, 10}, + {"FlagIncrLink", Const, 10}, + {"FlagLazyInit", Const, 10}, + {"FlagNoFixPrebinding", Const, 10}, + {"FlagNoHeapExecution", Const, 10}, + {"FlagNoMultiDefs", Const, 10}, + {"FlagNoReexportedDylibs", Const, 10}, + {"FlagNoUndefs", Const, 10}, + {"FlagPIE", Const, 10}, + {"FlagPrebindable", Const, 10}, + {"FlagPrebound", Const, 10}, + {"FlagRootSafe", Const, 10}, + {"FlagSetuidSafe", Const, 10}, + {"FlagSplitSegs", Const, 10}, + {"FlagSubsectionsViaSymbols", Const, 10}, + {"FlagTwoLevel", Const, 10}, + {"FlagWeakDefines", Const, 10}, + {"FormatError", Type, 0}, + {"GENERIC_RELOC_LOCAL_SECTDIFF", Const, 10}, + {"GENERIC_RELOC_PAIR", Const, 10}, + {"GENERIC_RELOC_PB_LA_PTR", Const, 10}, + {"GENERIC_RELOC_SECTDIFF", Const, 10}, + {"GENERIC_RELOC_TLV", Const, 10}, + {"GENERIC_RELOC_VANILLA", Const, 10}, + {"Load", Type, 0}, + {"LoadBytes", Type, 0}, + {"LoadCmd", Type, 0}, + {"LoadCmdDylib", Const, 0}, + {"LoadCmdDylinker", Const, 0}, + {"LoadCmdDysymtab", Const, 0}, + {"LoadCmdRpath", Const, 10}, + {"LoadCmdSegment", Const, 0}, + {"LoadCmdSegment64", Const, 0}, + {"LoadCmdSymtab", Const, 0}, + {"LoadCmdThread", Const, 0}, + {"LoadCmdUnixThread", Const, 0}, + {"Magic32", Const, 0}, + {"Magic64", Const, 0}, + {"MagicFat", Const, 3}, + {"NewFatFile", Func, 3}, + {"NewFile", Func, 0}, + {"Nlist32", Type, 0}, + {"Nlist32.Desc", Field, 0}, + {"Nlist32.Name", Field, 0}, + {"Nlist32.Sect", Field, 0}, + {"Nlist32.Type", Field, 0}, + {"Nlist32.Value", Field, 0}, + {"Nlist64", Type, 0}, + {"Nlist64.Desc", Field, 0}, + {"Nlist64.Name", Field, 0}, + {"Nlist64.Sect", Field, 0}, + {"Nlist64.Type", Field, 0}, + {"Nlist64.Value", Field, 0}, + {"Open", Func, 0}, + {"OpenFat", Func, 3}, + {"Regs386", Type, 0}, + {"Regs386.AX", Field, 0}, + {"Regs386.BP", Field, 0}, + {"Regs386.BX", Field, 0}, + {"Regs386.CS", Field, 0}, + {"Regs386.CX", Field, 0}, + {"Regs386.DI", Field, 0}, + {"Regs386.DS", Field, 0}, + {"Regs386.DX", Field, 0}, + {"Regs386.ES", Field, 0}, + {"Regs386.FLAGS", Field, 0}, + {"Regs386.FS", Field, 0}, + {"Regs386.GS", Field, 0}, + {"Regs386.IP", Field, 0}, + {"Regs386.SI", Field, 0}, + {"Regs386.SP", Field, 0}, + {"Regs386.SS", Field, 0}, + {"RegsAMD64", Type, 0}, + {"RegsAMD64.AX", Field, 0}, + {"RegsAMD64.BP", Field, 0}, + {"RegsAMD64.BX", Field, 0}, + {"RegsAMD64.CS", Field, 0}, + {"RegsAMD64.CX", Field, 0}, + {"RegsAMD64.DI", Field, 0}, + {"RegsAMD64.DX", Field, 0}, + {"RegsAMD64.FLAGS", Field, 0}, + {"RegsAMD64.FS", Field, 0}, + {"RegsAMD64.GS", Field, 0}, + {"RegsAMD64.IP", Field, 0}, + {"RegsAMD64.R10", Field, 0}, + {"RegsAMD64.R11", Field, 0}, + {"RegsAMD64.R12", Field, 0}, + {"RegsAMD64.R13", Field, 0}, + {"RegsAMD64.R14", Field, 0}, + {"RegsAMD64.R15", Field, 0}, + {"RegsAMD64.R8", Field, 0}, + {"RegsAMD64.R9", Field, 0}, + {"RegsAMD64.SI", Field, 0}, + {"RegsAMD64.SP", Field, 0}, + {"Reloc", Type, 10}, + {"Reloc.Addr", Field, 10}, + {"Reloc.Extern", Field, 10}, + {"Reloc.Len", Field, 10}, + {"Reloc.Pcrel", Field, 10}, + {"Reloc.Scattered", Field, 10}, + {"Reloc.Type", Field, 10}, + {"Reloc.Value", Field, 10}, + {"RelocTypeARM", Type, 10}, + {"RelocTypeARM64", Type, 10}, + {"RelocTypeGeneric", Type, 10}, + {"RelocTypeX86_64", Type, 10}, + {"Rpath", Type, 10}, + {"Rpath.LoadBytes", Field, 10}, + {"Rpath.Path", Field, 10}, + {"RpathCmd", Type, 10}, + {"RpathCmd.Cmd", Field, 10}, + {"RpathCmd.Len", Field, 10}, + {"RpathCmd.Path", Field, 10}, + {"Section", Type, 0}, + {"Section.ReaderAt", Field, 0}, + {"Section.Relocs", Field, 10}, + {"Section.SectionHeader", Field, 0}, + {"Section32", Type, 0}, + {"Section32.Addr", Field, 0}, + {"Section32.Align", Field, 0}, + {"Section32.Flags", Field, 0}, + {"Section32.Name", Field, 0}, + {"Section32.Nreloc", Field, 0}, + {"Section32.Offset", Field, 0}, + {"Section32.Reloff", Field, 0}, + {"Section32.Reserve1", Field, 0}, + {"Section32.Reserve2", Field, 0}, + {"Section32.Seg", Field, 0}, + {"Section32.Size", Field, 0}, + {"Section64", Type, 0}, + {"Section64.Addr", Field, 0}, + {"Section64.Align", Field, 0}, + {"Section64.Flags", Field, 0}, + {"Section64.Name", Field, 0}, + {"Section64.Nreloc", Field, 0}, + {"Section64.Offset", Field, 0}, + {"Section64.Reloff", Field, 0}, + {"Section64.Reserve1", Field, 0}, + {"Section64.Reserve2", Field, 0}, + {"Section64.Reserve3", Field, 0}, + {"Section64.Seg", Field, 0}, + {"Section64.Size", Field, 0}, + {"SectionHeader", Type, 0}, + {"SectionHeader.Addr", Field, 0}, + {"SectionHeader.Align", Field, 0}, + {"SectionHeader.Flags", Field, 0}, + {"SectionHeader.Name", Field, 0}, + {"SectionHeader.Nreloc", Field, 0}, + {"SectionHeader.Offset", Field, 0}, + {"SectionHeader.Reloff", Field, 0}, + {"SectionHeader.Seg", Field, 0}, + {"SectionHeader.Size", Field, 0}, + {"Segment", Type, 0}, + {"Segment.LoadBytes", Field, 0}, + {"Segment.ReaderAt", Field, 0}, + {"Segment.SegmentHeader", Field, 0}, + {"Segment32", Type, 0}, + {"Segment32.Addr", Field, 0}, + {"Segment32.Cmd", Field, 0}, + {"Segment32.Filesz", Field, 0}, + {"Segment32.Flag", Field, 0}, + {"Segment32.Len", Field, 0}, + {"Segment32.Maxprot", Field, 0}, + {"Segment32.Memsz", Field, 0}, + {"Segment32.Name", Field, 0}, + {"Segment32.Nsect", Field, 0}, + {"Segment32.Offset", Field, 0}, + {"Segment32.Prot", Field, 0}, + {"Segment64", Type, 0}, + {"Segment64.Addr", Field, 0}, + {"Segment64.Cmd", Field, 0}, + {"Segment64.Filesz", Field, 0}, + {"Segment64.Flag", Field, 0}, + {"Segment64.Len", Field, 0}, + {"Segment64.Maxprot", Field, 0}, + {"Segment64.Memsz", Field, 0}, + {"Segment64.Name", Field, 0}, + {"Segment64.Nsect", Field, 0}, + {"Segment64.Offset", Field, 0}, + {"Segment64.Prot", Field, 0}, + {"SegmentHeader", Type, 0}, + {"SegmentHeader.Addr", Field, 0}, + {"SegmentHeader.Cmd", Field, 0}, + {"SegmentHeader.Filesz", Field, 0}, + {"SegmentHeader.Flag", Field, 0}, + {"SegmentHeader.Len", Field, 0}, + {"SegmentHeader.Maxprot", Field, 0}, + {"SegmentHeader.Memsz", Field, 0}, + {"SegmentHeader.Name", Field, 0}, + {"SegmentHeader.Nsect", Field, 0}, + {"SegmentHeader.Offset", Field, 0}, + {"SegmentHeader.Prot", Field, 0}, + {"Symbol", Type, 0}, + {"Symbol.Desc", Field, 0}, + {"Symbol.Name", Field, 0}, + {"Symbol.Sect", Field, 0}, + {"Symbol.Type", Field, 0}, + {"Symbol.Value", Field, 0}, + {"Symtab", Type, 0}, + {"Symtab.LoadBytes", Field, 0}, + {"Symtab.Syms", Field, 0}, + {"Symtab.SymtabCmd", Field, 0}, + {"SymtabCmd", Type, 0}, + {"SymtabCmd.Cmd", Field, 0}, + {"SymtabCmd.Len", Field, 0}, + {"SymtabCmd.Nsyms", Field, 0}, + {"SymtabCmd.Stroff", Field, 0}, + {"SymtabCmd.Strsize", Field, 0}, + {"SymtabCmd.Symoff", Field, 0}, + {"Thread", Type, 0}, + {"Thread.Cmd", Field, 0}, + {"Thread.Data", Field, 0}, + {"Thread.Len", Field, 0}, + {"Thread.Type", Field, 0}, + {"Type", Type, 0}, + {"TypeBundle", Const, 3}, + {"TypeDylib", Const, 3}, + {"TypeExec", Const, 0}, + {"TypeObj", Const, 0}, + {"X86_64_RELOC_BRANCH", Const, 10}, + {"X86_64_RELOC_GOT", Const, 10}, + {"X86_64_RELOC_GOT_LOAD", Const, 10}, + {"X86_64_RELOC_SIGNED", Const, 10}, + {"X86_64_RELOC_SIGNED_1", Const, 10}, + {"X86_64_RELOC_SIGNED_2", Const, 10}, + {"X86_64_RELOC_SIGNED_4", Const, 10}, + {"X86_64_RELOC_SUBTRACTOR", Const, 10}, + {"X86_64_RELOC_TLV", Const, 10}, + {"X86_64_RELOC_UNSIGNED", Const, 10}, + }, + "debug/pe": { + {"(*COFFSymbol).FullName", Method, 8}, + {"(*File).COFFSymbolReadSectionDefAux", Method, 19}, + {"(*File).Close", Method, 0}, + {"(*File).DWARF", Method, 0}, + {"(*File).ImportedLibraries", Method, 0}, + {"(*File).ImportedSymbols", Method, 0}, + {"(*File).Section", Method, 0}, + {"(*FormatError).Error", Method, 0}, + {"(*Section).Data", Method, 0}, + {"(*Section).Open", Method, 0}, + {"(Section).ReadAt", Method, 0}, + {"(StringTable).String", Method, 8}, + {"COFFSymbol", Type, 1}, + {"COFFSymbol.Name", Field, 1}, + {"COFFSymbol.NumberOfAuxSymbols", Field, 1}, + {"COFFSymbol.SectionNumber", Field, 1}, + {"COFFSymbol.StorageClass", Field, 1}, + {"COFFSymbol.Type", Field, 1}, + {"COFFSymbol.Value", Field, 1}, + {"COFFSymbolAuxFormat5", Type, 19}, + {"COFFSymbolAuxFormat5.Checksum", Field, 19}, + {"COFFSymbolAuxFormat5.NumLineNumbers", Field, 19}, + {"COFFSymbolAuxFormat5.NumRelocs", Field, 19}, + {"COFFSymbolAuxFormat5.SecNum", Field, 19}, + {"COFFSymbolAuxFormat5.Selection", Field, 19}, + {"COFFSymbolAuxFormat5.Size", Field, 19}, + {"COFFSymbolSize", Const, 1}, + {"DataDirectory", Type, 3}, + {"DataDirectory.Size", Field, 3}, + {"DataDirectory.VirtualAddress", Field, 3}, + {"File", Type, 0}, + {"File.COFFSymbols", Field, 8}, + {"File.FileHeader", Field, 0}, + {"File.OptionalHeader", Field, 3}, + {"File.Sections", Field, 0}, + {"File.StringTable", Field, 8}, + {"File.Symbols", Field, 1}, + {"FileHeader", Type, 0}, + {"FileHeader.Characteristics", Field, 0}, + {"FileHeader.Machine", Field, 0}, + {"FileHeader.NumberOfSections", Field, 0}, + {"FileHeader.NumberOfSymbols", Field, 0}, + {"FileHeader.PointerToSymbolTable", Field, 0}, + {"FileHeader.SizeOfOptionalHeader", Field, 0}, + {"FileHeader.TimeDateStamp", Field, 0}, + {"FormatError", Type, 0}, + {"IMAGE_COMDAT_SELECT_ANY", Const, 19}, + {"IMAGE_COMDAT_SELECT_ASSOCIATIVE", Const, 19}, + {"IMAGE_COMDAT_SELECT_EXACT_MATCH", Const, 19}, + {"IMAGE_COMDAT_SELECT_LARGEST", Const, 19}, + {"IMAGE_COMDAT_SELECT_NODUPLICATES", Const, 19}, + {"IMAGE_COMDAT_SELECT_SAME_SIZE", Const, 19}, + {"IMAGE_DIRECTORY_ENTRY_ARCHITECTURE", Const, 11}, + {"IMAGE_DIRECTORY_ENTRY_BASERELOC", Const, 11}, + {"IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT", Const, 11}, + {"IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR", Const, 11}, + {"IMAGE_DIRECTORY_ENTRY_DEBUG", Const, 11}, + {"IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT", Const, 11}, + {"IMAGE_DIRECTORY_ENTRY_EXCEPTION", Const, 11}, + {"IMAGE_DIRECTORY_ENTRY_EXPORT", Const, 11}, + {"IMAGE_DIRECTORY_ENTRY_GLOBALPTR", Const, 11}, + {"IMAGE_DIRECTORY_ENTRY_IAT", Const, 11}, + {"IMAGE_DIRECTORY_ENTRY_IMPORT", Const, 11}, + {"IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG", Const, 11}, + {"IMAGE_DIRECTORY_ENTRY_RESOURCE", Const, 11}, + {"IMAGE_DIRECTORY_ENTRY_SECURITY", Const, 11}, + {"IMAGE_DIRECTORY_ENTRY_TLS", Const, 11}, + {"IMAGE_DLLCHARACTERISTICS_APPCONTAINER", Const, 15}, + {"IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE", Const, 15}, + {"IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY", Const, 15}, + {"IMAGE_DLLCHARACTERISTICS_GUARD_CF", Const, 15}, + {"IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA", Const, 15}, + {"IMAGE_DLLCHARACTERISTICS_NO_BIND", Const, 15}, + {"IMAGE_DLLCHARACTERISTICS_NO_ISOLATION", Const, 15}, + {"IMAGE_DLLCHARACTERISTICS_NO_SEH", Const, 15}, + {"IMAGE_DLLCHARACTERISTICS_NX_COMPAT", Const, 15}, + {"IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE", Const, 15}, + {"IMAGE_DLLCHARACTERISTICS_WDM_DRIVER", Const, 15}, + {"IMAGE_FILE_32BIT_MACHINE", Const, 15}, + {"IMAGE_FILE_AGGRESIVE_WS_TRIM", Const, 15}, + {"IMAGE_FILE_BYTES_REVERSED_HI", Const, 15}, + {"IMAGE_FILE_BYTES_REVERSED_LO", Const, 15}, + {"IMAGE_FILE_DEBUG_STRIPPED", Const, 15}, + {"IMAGE_FILE_DLL", Const, 15}, + {"IMAGE_FILE_EXECUTABLE_IMAGE", Const, 15}, + {"IMAGE_FILE_LARGE_ADDRESS_AWARE", Const, 15}, + {"IMAGE_FILE_LINE_NUMS_STRIPPED", Const, 15}, + {"IMAGE_FILE_LOCAL_SYMS_STRIPPED", Const, 15}, + {"IMAGE_FILE_MACHINE_AM33", Const, 0}, + {"IMAGE_FILE_MACHINE_AMD64", Const, 0}, + {"IMAGE_FILE_MACHINE_ARM", Const, 0}, + {"IMAGE_FILE_MACHINE_ARM64", Const, 11}, + {"IMAGE_FILE_MACHINE_ARMNT", Const, 12}, + {"IMAGE_FILE_MACHINE_EBC", Const, 0}, + {"IMAGE_FILE_MACHINE_I386", Const, 0}, + {"IMAGE_FILE_MACHINE_IA64", Const, 0}, + {"IMAGE_FILE_MACHINE_LOONGARCH32", Const, 19}, + {"IMAGE_FILE_MACHINE_LOONGARCH64", Const, 19}, + {"IMAGE_FILE_MACHINE_M32R", Const, 0}, + {"IMAGE_FILE_MACHINE_MIPS16", Const, 0}, + {"IMAGE_FILE_MACHINE_MIPSFPU", Const, 0}, + {"IMAGE_FILE_MACHINE_MIPSFPU16", Const, 0}, + {"IMAGE_FILE_MACHINE_POWERPC", Const, 0}, + {"IMAGE_FILE_MACHINE_POWERPCFP", Const, 0}, + {"IMAGE_FILE_MACHINE_R4000", Const, 0}, + {"IMAGE_FILE_MACHINE_RISCV128", Const, 20}, + {"IMAGE_FILE_MACHINE_RISCV32", Const, 20}, + {"IMAGE_FILE_MACHINE_RISCV64", Const, 20}, + {"IMAGE_FILE_MACHINE_SH3", Const, 0}, + {"IMAGE_FILE_MACHINE_SH3DSP", Const, 0}, + {"IMAGE_FILE_MACHINE_SH4", Const, 0}, + {"IMAGE_FILE_MACHINE_SH5", Const, 0}, + {"IMAGE_FILE_MACHINE_THUMB", Const, 0}, + {"IMAGE_FILE_MACHINE_UNKNOWN", Const, 0}, + {"IMAGE_FILE_MACHINE_WCEMIPSV2", Const, 0}, + {"IMAGE_FILE_NET_RUN_FROM_SWAP", Const, 15}, + {"IMAGE_FILE_RELOCS_STRIPPED", Const, 15}, + {"IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP", Const, 15}, + {"IMAGE_FILE_SYSTEM", Const, 15}, + {"IMAGE_FILE_UP_SYSTEM_ONLY", Const, 15}, + {"IMAGE_SCN_CNT_CODE", Const, 19}, + {"IMAGE_SCN_CNT_INITIALIZED_DATA", Const, 19}, + {"IMAGE_SCN_CNT_UNINITIALIZED_DATA", Const, 19}, + {"IMAGE_SCN_LNK_COMDAT", Const, 19}, + {"IMAGE_SCN_MEM_DISCARDABLE", Const, 19}, + {"IMAGE_SCN_MEM_EXECUTE", Const, 19}, + {"IMAGE_SCN_MEM_READ", Const, 19}, + {"IMAGE_SCN_MEM_WRITE", Const, 19}, + {"IMAGE_SUBSYSTEM_EFI_APPLICATION", Const, 15}, + {"IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER", Const, 15}, + {"IMAGE_SUBSYSTEM_EFI_ROM", Const, 15}, + {"IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER", Const, 15}, + {"IMAGE_SUBSYSTEM_NATIVE", Const, 15}, + {"IMAGE_SUBSYSTEM_NATIVE_WINDOWS", Const, 15}, + {"IMAGE_SUBSYSTEM_OS2_CUI", Const, 15}, + {"IMAGE_SUBSYSTEM_POSIX_CUI", Const, 15}, + {"IMAGE_SUBSYSTEM_UNKNOWN", Const, 15}, + {"IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION", Const, 15}, + {"IMAGE_SUBSYSTEM_WINDOWS_CE_GUI", Const, 15}, + {"IMAGE_SUBSYSTEM_WINDOWS_CUI", Const, 15}, + {"IMAGE_SUBSYSTEM_WINDOWS_GUI", Const, 15}, + {"IMAGE_SUBSYSTEM_XBOX", Const, 15}, + {"ImportDirectory", Type, 0}, + {"ImportDirectory.FirstThunk", Field, 0}, + {"ImportDirectory.ForwarderChain", Field, 0}, + {"ImportDirectory.Name", Field, 0}, + {"ImportDirectory.OriginalFirstThunk", Field, 0}, + {"ImportDirectory.TimeDateStamp", Field, 0}, + {"NewFile", Func, 0}, + {"Open", Func, 0}, + {"OptionalHeader32", Type, 3}, + {"OptionalHeader32.AddressOfEntryPoint", Field, 3}, + {"OptionalHeader32.BaseOfCode", Field, 3}, + {"OptionalHeader32.BaseOfData", Field, 3}, + {"OptionalHeader32.CheckSum", Field, 3}, + {"OptionalHeader32.DataDirectory", Field, 3}, + {"OptionalHeader32.DllCharacteristics", Field, 3}, + {"OptionalHeader32.FileAlignment", Field, 3}, + {"OptionalHeader32.ImageBase", Field, 3}, + {"OptionalHeader32.LoaderFlags", Field, 3}, + {"OptionalHeader32.Magic", Field, 3}, + {"OptionalHeader32.MajorImageVersion", Field, 3}, + {"OptionalHeader32.MajorLinkerVersion", Field, 3}, + {"OptionalHeader32.MajorOperatingSystemVersion", Field, 3}, + {"OptionalHeader32.MajorSubsystemVersion", Field, 3}, + {"OptionalHeader32.MinorImageVersion", Field, 3}, + {"OptionalHeader32.MinorLinkerVersion", Field, 3}, + {"OptionalHeader32.MinorOperatingSystemVersion", Field, 3}, + {"OptionalHeader32.MinorSubsystemVersion", Field, 3}, + {"OptionalHeader32.NumberOfRvaAndSizes", Field, 3}, + {"OptionalHeader32.SectionAlignment", Field, 3}, + {"OptionalHeader32.SizeOfCode", Field, 3}, + {"OptionalHeader32.SizeOfHeaders", Field, 3}, + {"OptionalHeader32.SizeOfHeapCommit", Field, 3}, + {"OptionalHeader32.SizeOfHeapReserve", Field, 3}, + {"OptionalHeader32.SizeOfImage", Field, 3}, + {"OptionalHeader32.SizeOfInitializedData", Field, 3}, + {"OptionalHeader32.SizeOfStackCommit", Field, 3}, + {"OptionalHeader32.SizeOfStackReserve", Field, 3}, + {"OptionalHeader32.SizeOfUninitializedData", Field, 3}, + {"OptionalHeader32.Subsystem", Field, 3}, + {"OptionalHeader32.Win32VersionValue", Field, 3}, + {"OptionalHeader64", Type, 3}, + {"OptionalHeader64.AddressOfEntryPoint", Field, 3}, + {"OptionalHeader64.BaseOfCode", Field, 3}, + {"OptionalHeader64.CheckSum", Field, 3}, + {"OptionalHeader64.DataDirectory", Field, 3}, + {"OptionalHeader64.DllCharacteristics", Field, 3}, + {"OptionalHeader64.FileAlignment", Field, 3}, + {"OptionalHeader64.ImageBase", Field, 3}, + {"OptionalHeader64.LoaderFlags", Field, 3}, + {"OptionalHeader64.Magic", Field, 3}, + {"OptionalHeader64.MajorImageVersion", Field, 3}, + {"OptionalHeader64.MajorLinkerVersion", Field, 3}, + {"OptionalHeader64.MajorOperatingSystemVersion", Field, 3}, + {"OptionalHeader64.MajorSubsystemVersion", Field, 3}, + {"OptionalHeader64.MinorImageVersion", Field, 3}, + {"OptionalHeader64.MinorLinkerVersion", Field, 3}, + {"OptionalHeader64.MinorOperatingSystemVersion", Field, 3}, + {"OptionalHeader64.MinorSubsystemVersion", Field, 3}, + {"OptionalHeader64.NumberOfRvaAndSizes", Field, 3}, + {"OptionalHeader64.SectionAlignment", Field, 3}, + {"OptionalHeader64.SizeOfCode", Field, 3}, + {"OptionalHeader64.SizeOfHeaders", Field, 3}, + {"OptionalHeader64.SizeOfHeapCommit", Field, 3}, + {"OptionalHeader64.SizeOfHeapReserve", Field, 3}, + {"OptionalHeader64.SizeOfImage", Field, 3}, + {"OptionalHeader64.SizeOfInitializedData", Field, 3}, + {"OptionalHeader64.SizeOfStackCommit", Field, 3}, + {"OptionalHeader64.SizeOfStackReserve", Field, 3}, + {"OptionalHeader64.SizeOfUninitializedData", Field, 3}, + {"OptionalHeader64.Subsystem", Field, 3}, + {"OptionalHeader64.Win32VersionValue", Field, 3}, + {"Reloc", Type, 8}, + {"Reloc.SymbolTableIndex", Field, 8}, + {"Reloc.Type", Field, 8}, + {"Reloc.VirtualAddress", Field, 8}, + {"Section", Type, 0}, + {"Section.ReaderAt", Field, 0}, + {"Section.Relocs", Field, 8}, + {"Section.SectionHeader", Field, 0}, + {"SectionHeader", Type, 0}, + {"SectionHeader.Characteristics", Field, 0}, + {"SectionHeader.Name", Field, 0}, + {"SectionHeader.NumberOfLineNumbers", Field, 0}, + {"SectionHeader.NumberOfRelocations", Field, 0}, + {"SectionHeader.Offset", Field, 0}, + {"SectionHeader.PointerToLineNumbers", Field, 0}, + {"SectionHeader.PointerToRelocations", Field, 0}, + {"SectionHeader.Size", Field, 0}, + {"SectionHeader.VirtualAddress", Field, 0}, + {"SectionHeader.VirtualSize", Field, 0}, + {"SectionHeader32", Type, 0}, + {"SectionHeader32.Characteristics", Field, 0}, + {"SectionHeader32.Name", Field, 0}, + {"SectionHeader32.NumberOfLineNumbers", Field, 0}, + {"SectionHeader32.NumberOfRelocations", Field, 0}, + {"SectionHeader32.PointerToLineNumbers", Field, 0}, + {"SectionHeader32.PointerToRawData", Field, 0}, + {"SectionHeader32.PointerToRelocations", Field, 0}, + {"SectionHeader32.SizeOfRawData", Field, 0}, + {"SectionHeader32.VirtualAddress", Field, 0}, + {"SectionHeader32.VirtualSize", Field, 0}, + {"StringTable", Type, 8}, + {"Symbol", Type, 1}, + {"Symbol.Name", Field, 1}, + {"Symbol.SectionNumber", Field, 1}, + {"Symbol.StorageClass", Field, 1}, + {"Symbol.Type", Field, 1}, + {"Symbol.Value", Field, 1}, + }, + "debug/plan9obj": { + {"(*File).Close", Method, 3}, + {"(*File).Section", Method, 3}, + {"(*File).Symbols", Method, 3}, + {"(*Section).Data", Method, 3}, + {"(*Section).Open", Method, 3}, + {"(Section).ReadAt", Method, 3}, + {"ErrNoSymbols", Var, 18}, + {"File", Type, 3}, + {"File.FileHeader", Field, 3}, + {"File.Sections", Field, 3}, + {"FileHeader", Type, 3}, + {"FileHeader.Bss", Field, 3}, + {"FileHeader.Entry", Field, 3}, + {"FileHeader.HdrSize", Field, 4}, + {"FileHeader.LoadAddress", Field, 4}, + {"FileHeader.Magic", Field, 3}, + {"FileHeader.PtrSize", Field, 3}, + {"Magic386", Const, 3}, + {"Magic64", Const, 3}, + {"MagicAMD64", Const, 3}, + {"MagicARM", Const, 3}, + {"NewFile", Func, 3}, + {"Open", Func, 3}, + {"Section", Type, 3}, + {"Section.ReaderAt", Field, 3}, + {"Section.SectionHeader", Field, 3}, + {"SectionHeader", Type, 3}, + {"SectionHeader.Name", Field, 3}, + {"SectionHeader.Offset", Field, 3}, + {"SectionHeader.Size", Field, 3}, + {"Sym", Type, 3}, + {"Sym.Name", Field, 3}, + {"Sym.Type", Field, 3}, + {"Sym.Value", Field, 3}, + }, + "embed": { + {"(FS).Open", Method, 16}, + {"(FS).ReadDir", Method, 16}, + {"(FS).ReadFile", Method, 16}, + {"FS", Type, 16}, + }, + "encoding": { + {"BinaryMarshaler", Type, 2}, + {"BinaryUnmarshaler", Type, 2}, + {"TextMarshaler", Type, 2}, + {"TextUnmarshaler", Type, 2}, + }, + "encoding/ascii85": { + {"(CorruptInputError).Error", Method, 0}, + {"CorruptInputError", Type, 0}, + {"Decode", Func, 0}, + {"Encode", Func, 0}, + {"MaxEncodedLen", Func, 0}, + {"NewDecoder", Func, 0}, + {"NewEncoder", Func, 0}, + }, + "encoding/asn1": { + {"(BitString).At", Method, 0}, + {"(BitString).RightAlign", Method, 0}, + {"(ObjectIdentifier).Equal", Method, 0}, + {"(ObjectIdentifier).String", Method, 3}, + {"(StructuralError).Error", Method, 0}, + {"(SyntaxError).Error", Method, 0}, + {"BitString", Type, 0}, + {"BitString.BitLength", Field, 0}, + {"BitString.Bytes", Field, 0}, + {"ClassApplication", Const, 6}, + {"ClassContextSpecific", Const, 6}, + {"ClassPrivate", Const, 6}, + {"ClassUniversal", Const, 6}, + {"Enumerated", Type, 0}, + {"Flag", Type, 0}, + {"Marshal", Func, 0}, + {"MarshalWithParams", Func, 10}, + {"NullBytes", Var, 9}, + {"NullRawValue", Var, 9}, + {"ObjectIdentifier", Type, 0}, + {"RawContent", Type, 0}, + {"RawValue", Type, 0}, + {"RawValue.Bytes", Field, 0}, + {"RawValue.Class", Field, 0}, + {"RawValue.FullBytes", Field, 0}, + {"RawValue.IsCompound", Field, 0}, + {"RawValue.Tag", Field, 0}, + {"StructuralError", Type, 0}, + {"StructuralError.Msg", Field, 0}, + {"SyntaxError", Type, 0}, + {"SyntaxError.Msg", Field, 0}, + {"TagBMPString", Const, 14}, + {"TagBitString", Const, 6}, + {"TagBoolean", Const, 6}, + {"TagEnum", Const, 6}, + {"TagGeneralString", Const, 6}, + {"TagGeneralizedTime", Const, 6}, + {"TagIA5String", Const, 6}, + {"TagInteger", Const, 6}, + {"TagNull", Const, 9}, + {"TagNumericString", Const, 10}, + {"TagOID", Const, 6}, + {"TagOctetString", Const, 6}, + {"TagPrintableString", Const, 6}, + {"TagSequence", Const, 6}, + {"TagSet", Const, 6}, + {"TagT61String", Const, 6}, + {"TagUTCTime", Const, 6}, + {"TagUTF8String", Const, 6}, + {"Unmarshal", Func, 0}, + {"UnmarshalWithParams", Func, 0}, + }, + "encoding/base32": { + {"(*Encoding).AppendDecode", Method, 22}, + {"(*Encoding).AppendEncode", Method, 22}, + {"(*Encoding).Decode", Method, 0}, + {"(*Encoding).DecodeString", Method, 0}, + {"(*Encoding).DecodedLen", Method, 0}, + {"(*Encoding).Encode", Method, 0}, + {"(*Encoding).EncodeToString", Method, 0}, + {"(*Encoding).EncodedLen", Method, 0}, + {"(CorruptInputError).Error", Method, 0}, + {"(Encoding).WithPadding", Method, 9}, + {"CorruptInputError", Type, 0}, + {"Encoding", Type, 0}, + {"HexEncoding", Var, 0}, + {"NewDecoder", Func, 0}, + {"NewEncoder", Func, 0}, + {"NewEncoding", Func, 0}, + {"NoPadding", Const, 9}, + {"StdEncoding", Var, 0}, + {"StdPadding", Const, 9}, + }, + "encoding/base64": { + {"(*Encoding).AppendDecode", Method, 22}, + {"(*Encoding).AppendEncode", Method, 22}, + {"(*Encoding).Decode", Method, 0}, + {"(*Encoding).DecodeString", Method, 0}, + {"(*Encoding).DecodedLen", Method, 0}, + {"(*Encoding).Encode", Method, 0}, + {"(*Encoding).EncodeToString", Method, 0}, + {"(*Encoding).EncodedLen", Method, 0}, + {"(CorruptInputError).Error", Method, 0}, + {"(Encoding).Strict", Method, 8}, + {"(Encoding).WithPadding", Method, 5}, + {"CorruptInputError", Type, 0}, + {"Encoding", Type, 0}, + {"NewDecoder", Func, 0}, + {"NewEncoder", Func, 0}, + {"NewEncoding", Func, 0}, + {"NoPadding", Const, 5}, + {"RawStdEncoding", Var, 5}, + {"RawURLEncoding", Var, 5}, + {"StdEncoding", Var, 0}, + {"StdPadding", Const, 5}, + {"URLEncoding", Var, 0}, + }, + "encoding/binary": { + {"Append", Func, 23}, + {"AppendByteOrder", Type, 19}, + {"AppendUvarint", Func, 19}, + {"AppendVarint", Func, 19}, + {"BigEndian", Var, 0}, + {"ByteOrder", Type, 0}, + {"Decode", Func, 23}, + {"Encode", Func, 23}, + {"LittleEndian", Var, 0}, + {"MaxVarintLen16", Const, 0}, + {"MaxVarintLen32", Const, 0}, + {"MaxVarintLen64", Const, 0}, + {"NativeEndian", Var, 21}, + {"PutUvarint", Func, 0}, + {"PutVarint", Func, 0}, + {"Read", Func, 0}, + {"ReadUvarint", Func, 0}, + {"ReadVarint", Func, 0}, + {"Size", Func, 0}, + {"Uvarint", Func, 0}, + {"Varint", Func, 0}, + {"Write", Func, 0}, + }, + "encoding/csv": { + {"(*ParseError).Error", Method, 0}, + {"(*ParseError).Unwrap", Method, 13}, + {"(*Reader).FieldPos", Method, 17}, + {"(*Reader).InputOffset", Method, 19}, + {"(*Reader).Read", Method, 0}, + {"(*Reader).ReadAll", Method, 0}, + {"(*Writer).Error", Method, 1}, + {"(*Writer).Flush", Method, 0}, + {"(*Writer).Write", Method, 0}, + {"(*Writer).WriteAll", Method, 0}, + {"ErrBareQuote", Var, 0}, + {"ErrFieldCount", Var, 0}, + {"ErrQuote", Var, 0}, + {"ErrTrailingComma", Var, 0}, + {"NewReader", Func, 0}, + {"NewWriter", Func, 0}, + {"ParseError", Type, 0}, + {"ParseError.Column", Field, 0}, + {"ParseError.Err", Field, 0}, + {"ParseError.Line", Field, 0}, + {"ParseError.StartLine", Field, 10}, + {"Reader", Type, 0}, + {"Reader.Comma", Field, 0}, + {"Reader.Comment", Field, 0}, + {"Reader.FieldsPerRecord", Field, 0}, + {"Reader.LazyQuotes", Field, 0}, + {"Reader.ReuseRecord", Field, 9}, + {"Reader.TrailingComma", Field, 0}, + {"Reader.TrimLeadingSpace", Field, 0}, + {"Writer", Type, 0}, + {"Writer.Comma", Field, 0}, + {"Writer.UseCRLF", Field, 0}, + }, + "encoding/gob": { + {"(*Decoder).Decode", Method, 0}, + {"(*Decoder).DecodeValue", Method, 0}, + {"(*Encoder).Encode", Method, 0}, + {"(*Encoder).EncodeValue", Method, 0}, + {"CommonType", Type, 0}, + {"CommonType.Id", Field, 0}, + {"CommonType.Name", Field, 0}, + {"Decoder", Type, 0}, + {"Encoder", Type, 0}, + {"GobDecoder", Type, 0}, + {"GobEncoder", Type, 0}, + {"NewDecoder", Func, 0}, + {"NewEncoder", Func, 0}, + {"Register", Func, 0}, + {"RegisterName", Func, 0}, + }, + "encoding/hex": { + {"(InvalidByteError).Error", Method, 0}, + {"AppendDecode", Func, 22}, + {"AppendEncode", Func, 22}, + {"Decode", Func, 0}, + {"DecodeString", Func, 0}, + {"DecodedLen", Func, 0}, + {"Dump", Func, 0}, + {"Dumper", Func, 0}, + {"Encode", Func, 0}, + {"EncodeToString", Func, 0}, + {"EncodedLen", Func, 0}, + {"ErrLength", Var, 0}, + {"InvalidByteError", Type, 0}, + {"NewDecoder", Func, 10}, + {"NewEncoder", Func, 10}, + }, + "encoding/json": { + {"(*Decoder).Buffered", Method, 1}, + {"(*Decoder).Decode", Method, 0}, + {"(*Decoder).DisallowUnknownFields", Method, 10}, + {"(*Decoder).InputOffset", Method, 14}, + {"(*Decoder).More", Method, 5}, + {"(*Decoder).Token", Method, 5}, + {"(*Decoder).UseNumber", Method, 1}, + {"(*Encoder).Encode", Method, 0}, + {"(*Encoder).SetEscapeHTML", Method, 7}, + {"(*Encoder).SetIndent", Method, 7}, + {"(*InvalidUTF8Error).Error", Method, 0}, + {"(*InvalidUnmarshalError).Error", Method, 0}, + {"(*MarshalerError).Error", Method, 0}, + {"(*MarshalerError).Unwrap", Method, 13}, + {"(*RawMessage).MarshalJSON", Method, 0}, + {"(*RawMessage).UnmarshalJSON", Method, 0}, + {"(*SyntaxError).Error", Method, 0}, + {"(*UnmarshalFieldError).Error", Method, 0}, + {"(*UnmarshalTypeError).Error", Method, 0}, + {"(*UnsupportedTypeError).Error", Method, 0}, + {"(*UnsupportedValueError).Error", Method, 0}, + {"(Delim).String", Method, 5}, + {"(Number).Float64", Method, 1}, + {"(Number).Int64", Method, 1}, + {"(Number).String", Method, 1}, + {"(RawMessage).MarshalJSON", Method, 8}, + {"Compact", Func, 0}, + {"Decoder", Type, 0}, + {"Delim", Type, 5}, + {"Encoder", Type, 0}, + {"HTMLEscape", Func, 0}, + {"Indent", Func, 0}, + {"InvalidUTF8Error", Type, 0}, + {"InvalidUTF8Error.S", Field, 0}, + {"InvalidUnmarshalError", Type, 0}, + {"InvalidUnmarshalError.Type", Field, 0}, + {"Marshal", Func, 0}, + {"MarshalIndent", Func, 0}, + {"Marshaler", Type, 0}, + {"MarshalerError", Type, 0}, + {"MarshalerError.Err", Field, 0}, + {"MarshalerError.Type", Field, 0}, + {"NewDecoder", Func, 0}, + {"NewEncoder", Func, 0}, + {"Number", Type, 1}, + {"RawMessage", Type, 0}, + {"SyntaxError", Type, 0}, + {"SyntaxError.Offset", Field, 0}, + {"Token", Type, 5}, + {"Unmarshal", Func, 0}, + {"UnmarshalFieldError", Type, 0}, + {"UnmarshalFieldError.Field", Field, 0}, + {"UnmarshalFieldError.Key", Field, 0}, + {"UnmarshalFieldError.Type", Field, 0}, + {"UnmarshalTypeError", Type, 0}, + {"UnmarshalTypeError.Field", Field, 8}, + {"UnmarshalTypeError.Offset", Field, 5}, + {"UnmarshalTypeError.Struct", Field, 8}, + {"UnmarshalTypeError.Type", Field, 0}, + {"UnmarshalTypeError.Value", Field, 0}, + {"Unmarshaler", Type, 0}, + {"UnsupportedTypeError", Type, 0}, + {"UnsupportedTypeError.Type", Field, 0}, + {"UnsupportedValueError", Type, 0}, + {"UnsupportedValueError.Str", Field, 0}, + {"UnsupportedValueError.Value", Field, 0}, + {"Valid", Func, 9}, + }, + "encoding/pem": { + {"Block", Type, 0}, + {"Block.Bytes", Field, 0}, + {"Block.Headers", Field, 0}, + {"Block.Type", Field, 0}, + {"Decode", Func, 0}, + {"Encode", Func, 0}, + {"EncodeToMemory", Func, 0}, + }, + "encoding/xml": { + {"(*Decoder).Decode", Method, 0}, + {"(*Decoder).DecodeElement", Method, 0}, + {"(*Decoder).InputOffset", Method, 4}, + {"(*Decoder).InputPos", Method, 19}, + {"(*Decoder).RawToken", Method, 0}, + {"(*Decoder).Skip", Method, 0}, + {"(*Decoder).Token", Method, 0}, + {"(*Encoder).Close", Method, 20}, + {"(*Encoder).Encode", Method, 0}, + {"(*Encoder).EncodeElement", Method, 2}, + {"(*Encoder).EncodeToken", Method, 2}, + {"(*Encoder).Flush", Method, 2}, + {"(*Encoder).Indent", Method, 1}, + {"(*SyntaxError).Error", Method, 0}, + {"(*TagPathError).Error", Method, 0}, + {"(*UnsupportedTypeError).Error", Method, 0}, + {"(CharData).Copy", Method, 0}, + {"(Comment).Copy", Method, 0}, + {"(Directive).Copy", Method, 0}, + {"(ProcInst).Copy", Method, 0}, + {"(StartElement).Copy", Method, 0}, + {"(StartElement).End", Method, 2}, + {"(UnmarshalError).Error", Method, 0}, + {"Attr", Type, 0}, + {"Attr.Name", Field, 0}, + {"Attr.Value", Field, 0}, + {"CharData", Type, 0}, + {"Comment", Type, 0}, + {"CopyToken", Func, 0}, + {"Decoder", Type, 0}, + {"Decoder.AutoClose", Field, 0}, + {"Decoder.CharsetReader", Field, 0}, + {"Decoder.DefaultSpace", Field, 1}, + {"Decoder.Entity", Field, 0}, + {"Decoder.Strict", Field, 0}, + {"Directive", Type, 0}, + {"Encoder", Type, 0}, + {"EndElement", Type, 0}, + {"EndElement.Name", Field, 0}, + {"Escape", Func, 0}, + {"EscapeText", Func, 1}, + {"HTMLAutoClose", Var, 0}, + {"HTMLEntity", Var, 0}, + {"Header", Const, 0}, + {"Marshal", Func, 0}, + {"MarshalIndent", Func, 0}, + {"Marshaler", Type, 2}, + {"MarshalerAttr", Type, 2}, + {"Name", Type, 0}, + {"Name.Local", Field, 0}, + {"Name.Space", Field, 0}, + {"NewDecoder", Func, 0}, + {"NewEncoder", Func, 0}, + {"NewTokenDecoder", Func, 10}, + {"ProcInst", Type, 0}, + {"ProcInst.Inst", Field, 0}, + {"ProcInst.Target", Field, 0}, + {"StartElement", Type, 0}, + {"StartElement.Attr", Field, 0}, + {"StartElement.Name", Field, 0}, + {"SyntaxError", Type, 0}, + {"SyntaxError.Line", Field, 0}, + {"SyntaxError.Msg", Field, 0}, + {"TagPathError", Type, 0}, + {"TagPathError.Field1", Field, 0}, + {"TagPathError.Field2", Field, 0}, + {"TagPathError.Struct", Field, 0}, + {"TagPathError.Tag1", Field, 0}, + {"TagPathError.Tag2", Field, 0}, + {"Token", Type, 0}, + {"TokenReader", Type, 10}, + {"Unmarshal", Func, 0}, + {"UnmarshalError", Type, 0}, + {"Unmarshaler", Type, 2}, + {"UnmarshalerAttr", Type, 2}, + {"UnsupportedTypeError", Type, 0}, + {"UnsupportedTypeError.Type", Field, 0}, + }, + "errors": { + {"As", Func, 13}, + {"ErrUnsupported", Var, 21}, + {"Is", Func, 13}, + {"Join", Func, 20}, + {"New", Func, 0}, + {"Unwrap", Func, 13}, + }, + "expvar": { + {"(*Float).Add", Method, 0}, + {"(*Float).Set", Method, 0}, + {"(*Float).String", Method, 0}, + {"(*Float).Value", Method, 8}, + {"(*Int).Add", Method, 0}, + {"(*Int).Set", Method, 0}, + {"(*Int).String", Method, 0}, + {"(*Int).Value", Method, 8}, + {"(*Map).Add", Method, 0}, + {"(*Map).AddFloat", Method, 0}, + {"(*Map).Delete", Method, 12}, + {"(*Map).Do", Method, 0}, + {"(*Map).Get", Method, 0}, + {"(*Map).Init", Method, 0}, + {"(*Map).Set", Method, 0}, + {"(*Map).String", Method, 0}, + {"(*String).Set", Method, 0}, + {"(*String).String", Method, 0}, + {"(*String).Value", Method, 8}, + {"(Func).String", Method, 0}, + {"(Func).Value", Method, 8}, + {"Do", Func, 0}, + {"Float", Type, 0}, + {"Func", Type, 0}, + {"Get", Func, 0}, + {"Handler", Func, 8}, + {"Int", Type, 0}, + {"KeyValue", Type, 0}, + {"KeyValue.Key", Field, 0}, + {"KeyValue.Value", Field, 0}, + {"Map", Type, 0}, + {"NewFloat", Func, 0}, + {"NewInt", Func, 0}, + {"NewMap", Func, 0}, + {"NewString", Func, 0}, + {"Publish", Func, 0}, + {"String", Type, 0}, + {"Var", Type, 0}, + }, + "flag": { + {"(*FlagSet).Arg", Method, 0}, + {"(*FlagSet).Args", Method, 0}, + {"(*FlagSet).Bool", Method, 0}, + {"(*FlagSet).BoolFunc", Method, 21}, + {"(*FlagSet).BoolVar", Method, 0}, + {"(*FlagSet).Duration", Method, 0}, + {"(*FlagSet).DurationVar", Method, 0}, + {"(*FlagSet).ErrorHandling", Method, 10}, + {"(*FlagSet).Float64", Method, 0}, + {"(*FlagSet).Float64Var", Method, 0}, + {"(*FlagSet).Func", Method, 16}, + {"(*FlagSet).Init", Method, 0}, + {"(*FlagSet).Int", Method, 0}, + {"(*FlagSet).Int64", Method, 0}, + {"(*FlagSet).Int64Var", Method, 0}, + {"(*FlagSet).IntVar", Method, 0}, + {"(*FlagSet).Lookup", Method, 0}, + {"(*FlagSet).NArg", Method, 0}, + {"(*FlagSet).NFlag", Method, 0}, + {"(*FlagSet).Name", Method, 10}, + {"(*FlagSet).Output", Method, 10}, + {"(*FlagSet).Parse", Method, 0}, + {"(*FlagSet).Parsed", Method, 0}, + {"(*FlagSet).PrintDefaults", Method, 0}, + {"(*FlagSet).Set", Method, 0}, + {"(*FlagSet).SetOutput", Method, 0}, + {"(*FlagSet).String", Method, 0}, + {"(*FlagSet).StringVar", Method, 0}, + {"(*FlagSet).TextVar", Method, 19}, + {"(*FlagSet).Uint", Method, 0}, + {"(*FlagSet).Uint64", Method, 0}, + {"(*FlagSet).Uint64Var", Method, 0}, + {"(*FlagSet).UintVar", Method, 0}, + {"(*FlagSet).Var", Method, 0}, + {"(*FlagSet).Visit", Method, 0}, + {"(*FlagSet).VisitAll", Method, 0}, + {"Arg", Func, 0}, + {"Args", Func, 0}, + {"Bool", Func, 0}, + {"BoolFunc", Func, 21}, + {"BoolVar", Func, 0}, + {"CommandLine", Var, 2}, + {"ContinueOnError", Const, 0}, + {"Duration", Func, 0}, + {"DurationVar", Func, 0}, + {"ErrHelp", Var, 0}, + {"ErrorHandling", Type, 0}, + {"ExitOnError", Const, 0}, + {"Flag", Type, 0}, + {"Flag.DefValue", Field, 0}, + {"Flag.Name", Field, 0}, + {"Flag.Usage", Field, 0}, + {"Flag.Value", Field, 0}, + {"FlagSet", Type, 0}, + {"FlagSet.Usage", Field, 0}, + {"Float64", Func, 0}, + {"Float64Var", Func, 0}, + {"Func", Func, 16}, + {"Getter", Type, 2}, + {"Int", Func, 0}, + {"Int64", Func, 0}, + {"Int64Var", Func, 0}, + {"IntVar", Func, 0}, + {"Lookup", Func, 0}, + {"NArg", Func, 0}, + {"NFlag", Func, 0}, + {"NewFlagSet", Func, 0}, + {"PanicOnError", Const, 0}, + {"Parse", Func, 0}, + {"Parsed", Func, 0}, + {"PrintDefaults", Func, 0}, + {"Set", Func, 0}, + {"String", Func, 0}, + {"StringVar", Func, 0}, + {"TextVar", Func, 19}, + {"Uint", Func, 0}, + {"Uint64", Func, 0}, + {"Uint64Var", Func, 0}, + {"UintVar", Func, 0}, + {"UnquoteUsage", Func, 5}, + {"Usage", Var, 0}, + {"Value", Type, 0}, + {"Var", Func, 0}, + {"Visit", Func, 0}, + {"VisitAll", Func, 0}, + }, + "fmt": { + {"Append", Func, 19}, + {"Appendf", Func, 19}, + {"Appendln", Func, 19}, + {"Errorf", Func, 0}, + {"FormatString", Func, 20}, + {"Formatter", Type, 0}, + {"Fprint", Func, 0}, + {"Fprintf", Func, 0}, + {"Fprintln", Func, 0}, + {"Fscan", Func, 0}, + {"Fscanf", Func, 0}, + {"Fscanln", Func, 0}, + {"GoStringer", Type, 0}, + {"Print", Func, 0}, + {"Printf", Func, 0}, + {"Println", Func, 0}, + {"Scan", Func, 0}, + {"ScanState", Type, 0}, + {"Scanf", Func, 0}, + {"Scanln", Func, 0}, + {"Scanner", Type, 0}, + {"Sprint", Func, 0}, + {"Sprintf", Func, 0}, + {"Sprintln", Func, 0}, + {"Sscan", Func, 0}, + {"Sscanf", Func, 0}, + {"Sscanln", Func, 0}, + {"State", Type, 0}, + {"Stringer", Type, 0}, + }, + "go/ast": { + {"(*ArrayType).End", Method, 0}, + {"(*ArrayType).Pos", Method, 0}, + {"(*AssignStmt).End", Method, 0}, + {"(*AssignStmt).Pos", Method, 0}, + {"(*BadDecl).End", Method, 0}, + {"(*BadDecl).Pos", Method, 0}, + {"(*BadExpr).End", Method, 0}, + {"(*BadExpr).Pos", Method, 0}, + {"(*BadStmt).End", Method, 0}, + {"(*BadStmt).Pos", Method, 0}, + {"(*BasicLit).End", Method, 0}, + {"(*BasicLit).Pos", Method, 0}, + {"(*BinaryExpr).End", Method, 0}, + {"(*BinaryExpr).Pos", Method, 0}, + {"(*BlockStmt).End", Method, 0}, + {"(*BlockStmt).Pos", Method, 0}, + {"(*BranchStmt).End", Method, 0}, + {"(*BranchStmt).Pos", Method, 0}, + {"(*CallExpr).End", Method, 0}, + {"(*CallExpr).Pos", Method, 0}, + {"(*CaseClause).End", Method, 0}, + {"(*CaseClause).Pos", Method, 0}, + {"(*ChanType).End", Method, 0}, + {"(*ChanType).Pos", Method, 0}, + {"(*CommClause).End", Method, 0}, + {"(*CommClause).Pos", Method, 0}, + {"(*Comment).End", Method, 0}, + {"(*Comment).Pos", Method, 0}, + {"(*CommentGroup).End", Method, 0}, + {"(*CommentGroup).Pos", Method, 0}, + {"(*CommentGroup).Text", Method, 0}, + {"(*CompositeLit).End", Method, 0}, + {"(*CompositeLit).Pos", Method, 0}, + {"(*DeclStmt).End", Method, 0}, + {"(*DeclStmt).Pos", Method, 0}, + {"(*DeferStmt).End", Method, 0}, + {"(*DeferStmt).Pos", Method, 0}, + {"(*Ellipsis).End", Method, 0}, + {"(*Ellipsis).Pos", Method, 0}, + {"(*EmptyStmt).End", Method, 0}, + {"(*EmptyStmt).Pos", Method, 0}, + {"(*ExprStmt).End", Method, 0}, + {"(*ExprStmt).Pos", Method, 0}, + {"(*Field).End", Method, 0}, + {"(*Field).Pos", Method, 0}, + {"(*FieldList).End", Method, 0}, + {"(*FieldList).NumFields", Method, 0}, + {"(*FieldList).Pos", Method, 0}, + {"(*File).End", Method, 0}, + {"(*File).Pos", Method, 0}, + {"(*ForStmt).End", Method, 0}, + {"(*ForStmt).Pos", Method, 0}, + {"(*FuncDecl).End", Method, 0}, + {"(*FuncDecl).Pos", Method, 0}, + {"(*FuncLit).End", Method, 0}, + {"(*FuncLit).Pos", Method, 0}, + {"(*FuncType).End", Method, 0}, + {"(*FuncType).Pos", Method, 0}, + {"(*GenDecl).End", Method, 0}, + {"(*GenDecl).Pos", Method, 0}, + {"(*GoStmt).End", Method, 0}, + {"(*GoStmt).Pos", Method, 0}, + {"(*Ident).End", Method, 0}, + {"(*Ident).IsExported", Method, 0}, + {"(*Ident).Pos", Method, 0}, + {"(*Ident).String", Method, 0}, + {"(*IfStmt).End", Method, 0}, + {"(*IfStmt).Pos", Method, 0}, + {"(*ImportSpec).End", Method, 0}, + {"(*ImportSpec).Pos", Method, 0}, + {"(*IncDecStmt).End", Method, 0}, + {"(*IncDecStmt).Pos", Method, 0}, + {"(*IndexExpr).End", Method, 0}, + {"(*IndexExpr).Pos", Method, 0}, + {"(*IndexListExpr).End", Method, 18}, + {"(*IndexListExpr).Pos", Method, 18}, + {"(*InterfaceType).End", Method, 0}, + {"(*InterfaceType).Pos", Method, 0}, + {"(*KeyValueExpr).End", Method, 0}, + {"(*KeyValueExpr).Pos", Method, 0}, + {"(*LabeledStmt).End", Method, 0}, + {"(*LabeledStmt).Pos", Method, 0}, + {"(*MapType).End", Method, 0}, + {"(*MapType).Pos", Method, 0}, + {"(*Object).Pos", Method, 0}, + {"(*Package).End", Method, 0}, + {"(*Package).Pos", Method, 0}, + {"(*ParenExpr).End", Method, 0}, + {"(*ParenExpr).Pos", Method, 0}, + {"(*RangeStmt).End", Method, 0}, + {"(*RangeStmt).Pos", Method, 0}, + {"(*ReturnStmt).End", Method, 0}, + {"(*ReturnStmt).Pos", Method, 0}, + {"(*Scope).Insert", Method, 0}, + {"(*Scope).Lookup", Method, 0}, + {"(*Scope).String", Method, 0}, + {"(*SelectStmt).End", Method, 0}, + {"(*SelectStmt).Pos", Method, 0}, + {"(*SelectorExpr).End", Method, 0}, + {"(*SelectorExpr).Pos", Method, 0}, + {"(*SendStmt).End", Method, 0}, + {"(*SendStmt).Pos", Method, 0}, + {"(*SliceExpr).End", Method, 0}, + {"(*SliceExpr).Pos", Method, 0}, + {"(*StarExpr).End", Method, 0}, + {"(*StarExpr).Pos", Method, 0}, + {"(*StructType).End", Method, 0}, + {"(*StructType).Pos", Method, 0}, + {"(*SwitchStmt).End", Method, 0}, + {"(*SwitchStmt).Pos", Method, 0}, + {"(*TypeAssertExpr).End", Method, 0}, + {"(*TypeAssertExpr).Pos", Method, 0}, + {"(*TypeSpec).End", Method, 0}, + {"(*TypeSpec).Pos", Method, 0}, + {"(*TypeSwitchStmt).End", Method, 0}, + {"(*TypeSwitchStmt).Pos", Method, 0}, + {"(*UnaryExpr).End", Method, 0}, + {"(*UnaryExpr).Pos", Method, 0}, + {"(*ValueSpec).End", Method, 0}, + {"(*ValueSpec).Pos", Method, 0}, + {"(CommentMap).Comments", Method, 1}, + {"(CommentMap).Filter", Method, 1}, + {"(CommentMap).String", Method, 1}, + {"(CommentMap).Update", Method, 1}, + {"(ObjKind).String", Method, 0}, + {"ArrayType", Type, 0}, + {"ArrayType.Elt", Field, 0}, + {"ArrayType.Lbrack", Field, 0}, + {"ArrayType.Len", Field, 0}, + {"AssignStmt", Type, 0}, + {"AssignStmt.Lhs", Field, 0}, + {"AssignStmt.Rhs", Field, 0}, + {"AssignStmt.Tok", Field, 0}, + {"AssignStmt.TokPos", Field, 0}, + {"Bad", Const, 0}, + {"BadDecl", Type, 0}, + {"BadDecl.From", Field, 0}, + {"BadDecl.To", Field, 0}, + {"BadExpr", Type, 0}, + {"BadExpr.From", Field, 0}, + {"BadExpr.To", Field, 0}, + {"BadStmt", Type, 0}, + {"BadStmt.From", Field, 0}, + {"BadStmt.To", Field, 0}, + {"BasicLit", Type, 0}, + {"BasicLit.Kind", Field, 0}, + {"BasicLit.Value", Field, 0}, + {"BasicLit.ValuePos", Field, 0}, + {"BinaryExpr", Type, 0}, + {"BinaryExpr.Op", Field, 0}, + {"BinaryExpr.OpPos", Field, 0}, + {"BinaryExpr.X", Field, 0}, + {"BinaryExpr.Y", Field, 0}, + {"BlockStmt", Type, 0}, + {"BlockStmt.Lbrace", Field, 0}, + {"BlockStmt.List", Field, 0}, + {"BlockStmt.Rbrace", Field, 0}, + {"BranchStmt", Type, 0}, + {"BranchStmt.Label", Field, 0}, + {"BranchStmt.Tok", Field, 0}, + {"BranchStmt.TokPos", Field, 0}, + {"CallExpr", Type, 0}, + {"CallExpr.Args", Field, 0}, + {"CallExpr.Ellipsis", Field, 0}, + {"CallExpr.Fun", Field, 0}, + {"CallExpr.Lparen", Field, 0}, + {"CallExpr.Rparen", Field, 0}, + {"CaseClause", Type, 0}, + {"CaseClause.Body", Field, 0}, + {"CaseClause.Case", Field, 0}, + {"CaseClause.Colon", Field, 0}, + {"CaseClause.List", Field, 0}, + {"ChanDir", Type, 0}, + {"ChanType", Type, 0}, + {"ChanType.Arrow", Field, 1}, + {"ChanType.Begin", Field, 0}, + {"ChanType.Dir", Field, 0}, + {"ChanType.Value", Field, 0}, + {"CommClause", Type, 0}, + {"CommClause.Body", Field, 0}, + {"CommClause.Case", Field, 0}, + {"CommClause.Colon", Field, 0}, + {"CommClause.Comm", Field, 0}, + {"Comment", Type, 0}, + {"Comment.Slash", Field, 0}, + {"Comment.Text", Field, 0}, + {"CommentGroup", Type, 0}, + {"CommentGroup.List", Field, 0}, + {"CommentMap", Type, 1}, + {"CompositeLit", Type, 0}, + {"CompositeLit.Elts", Field, 0}, + {"CompositeLit.Incomplete", Field, 11}, + {"CompositeLit.Lbrace", Field, 0}, + {"CompositeLit.Rbrace", Field, 0}, + {"CompositeLit.Type", Field, 0}, + {"Con", Const, 0}, + {"Decl", Type, 0}, + {"DeclStmt", Type, 0}, + {"DeclStmt.Decl", Field, 0}, + {"DeferStmt", Type, 0}, + {"DeferStmt.Call", Field, 0}, + {"DeferStmt.Defer", Field, 0}, + {"Ellipsis", Type, 0}, + {"Ellipsis.Ellipsis", Field, 0}, + {"Ellipsis.Elt", Field, 0}, + {"EmptyStmt", Type, 0}, + {"EmptyStmt.Implicit", Field, 5}, + {"EmptyStmt.Semicolon", Field, 0}, + {"Expr", Type, 0}, + {"ExprStmt", Type, 0}, + {"ExprStmt.X", Field, 0}, + {"Field", Type, 0}, + {"Field.Comment", Field, 0}, + {"Field.Doc", Field, 0}, + {"Field.Names", Field, 0}, + {"Field.Tag", Field, 0}, + {"Field.Type", Field, 0}, + {"FieldFilter", Type, 0}, + {"FieldList", Type, 0}, + {"FieldList.Closing", Field, 0}, + {"FieldList.List", Field, 0}, + {"FieldList.Opening", Field, 0}, + {"File", Type, 0}, + {"File.Comments", Field, 0}, + {"File.Decls", Field, 0}, + {"File.Doc", Field, 0}, + {"File.FileEnd", Field, 20}, + {"File.FileStart", Field, 20}, + {"File.GoVersion", Field, 21}, + {"File.Imports", Field, 0}, + {"File.Name", Field, 0}, + {"File.Package", Field, 0}, + {"File.Scope", Field, 0}, + {"File.Unresolved", Field, 0}, + {"FileExports", Func, 0}, + {"Filter", Type, 0}, + {"FilterDecl", Func, 0}, + {"FilterFile", Func, 0}, + {"FilterFuncDuplicates", Const, 0}, + {"FilterImportDuplicates", Const, 0}, + {"FilterPackage", Func, 0}, + {"FilterUnassociatedComments", Const, 0}, + {"ForStmt", Type, 0}, + {"ForStmt.Body", Field, 0}, + {"ForStmt.Cond", Field, 0}, + {"ForStmt.For", Field, 0}, + {"ForStmt.Init", Field, 0}, + {"ForStmt.Post", Field, 0}, + {"Fprint", Func, 0}, + {"Fun", Const, 0}, + {"FuncDecl", Type, 0}, + {"FuncDecl.Body", Field, 0}, + {"FuncDecl.Doc", Field, 0}, + {"FuncDecl.Name", Field, 0}, + {"FuncDecl.Recv", Field, 0}, + {"FuncDecl.Type", Field, 0}, + {"FuncLit", Type, 0}, + {"FuncLit.Body", Field, 0}, + {"FuncLit.Type", Field, 0}, + {"FuncType", Type, 0}, + {"FuncType.Func", Field, 0}, + {"FuncType.Params", Field, 0}, + {"FuncType.Results", Field, 0}, + {"FuncType.TypeParams", Field, 18}, + {"GenDecl", Type, 0}, + {"GenDecl.Doc", Field, 0}, + {"GenDecl.Lparen", Field, 0}, + {"GenDecl.Rparen", Field, 0}, + {"GenDecl.Specs", Field, 0}, + {"GenDecl.Tok", Field, 0}, + {"GenDecl.TokPos", Field, 0}, + {"GoStmt", Type, 0}, + {"GoStmt.Call", Field, 0}, + {"GoStmt.Go", Field, 0}, + {"Ident", Type, 0}, + {"Ident.Name", Field, 0}, + {"Ident.NamePos", Field, 0}, + {"Ident.Obj", Field, 0}, + {"IfStmt", Type, 0}, + {"IfStmt.Body", Field, 0}, + {"IfStmt.Cond", Field, 0}, + {"IfStmt.Else", Field, 0}, + {"IfStmt.If", Field, 0}, + {"IfStmt.Init", Field, 0}, + {"ImportSpec", Type, 0}, + {"ImportSpec.Comment", Field, 0}, + {"ImportSpec.Doc", Field, 0}, + {"ImportSpec.EndPos", Field, 0}, + {"ImportSpec.Name", Field, 0}, + {"ImportSpec.Path", Field, 0}, + {"Importer", Type, 0}, + {"IncDecStmt", Type, 0}, + {"IncDecStmt.Tok", Field, 0}, + {"IncDecStmt.TokPos", Field, 0}, + {"IncDecStmt.X", Field, 0}, + {"IndexExpr", Type, 0}, + {"IndexExpr.Index", Field, 0}, + {"IndexExpr.Lbrack", Field, 0}, + {"IndexExpr.Rbrack", Field, 0}, + {"IndexExpr.X", Field, 0}, + {"IndexListExpr", Type, 18}, + {"IndexListExpr.Indices", Field, 18}, + {"IndexListExpr.Lbrack", Field, 18}, + {"IndexListExpr.Rbrack", Field, 18}, + {"IndexListExpr.X", Field, 18}, + {"Inspect", Func, 0}, + {"InterfaceType", Type, 0}, + {"InterfaceType.Incomplete", Field, 0}, + {"InterfaceType.Interface", Field, 0}, + {"InterfaceType.Methods", Field, 0}, + {"IsExported", Func, 0}, + {"IsGenerated", Func, 21}, + {"KeyValueExpr", Type, 0}, + {"KeyValueExpr.Colon", Field, 0}, + {"KeyValueExpr.Key", Field, 0}, + {"KeyValueExpr.Value", Field, 0}, + {"LabeledStmt", Type, 0}, + {"LabeledStmt.Colon", Field, 0}, + {"LabeledStmt.Label", Field, 0}, + {"LabeledStmt.Stmt", Field, 0}, + {"Lbl", Const, 0}, + {"MapType", Type, 0}, + {"MapType.Key", Field, 0}, + {"MapType.Map", Field, 0}, + {"MapType.Value", Field, 0}, + {"MergeMode", Type, 0}, + {"MergePackageFiles", Func, 0}, + {"NewCommentMap", Func, 1}, + {"NewIdent", Func, 0}, + {"NewObj", Func, 0}, + {"NewPackage", Func, 0}, + {"NewScope", Func, 0}, + {"Node", Type, 0}, + {"NotNilFilter", Func, 0}, + {"ObjKind", Type, 0}, + {"Object", Type, 0}, + {"Object.Data", Field, 0}, + {"Object.Decl", Field, 0}, + {"Object.Kind", Field, 0}, + {"Object.Name", Field, 0}, + {"Object.Type", Field, 0}, + {"Package", Type, 0}, + {"Package.Files", Field, 0}, + {"Package.Imports", Field, 0}, + {"Package.Name", Field, 0}, + {"Package.Scope", Field, 0}, + {"PackageExports", Func, 0}, + {"ParenExpr", Type, 0}, + {"ParenExpr.Lparen", Field, 0}, + {"ParenExpr.Rparen", Field, 0}, + {"ParenExpr.X", Field, 0}, + {"Pkg", Const, 0}, + {"Preorder", Func, 23}, + {"Print", Func, 0}, + {"RECV", Const, 0}, + {"RangeStmt", Type, 0}, + {"RangeStmt.Body", Field, 0}, + {"RangeStmt.For", Field, 0}, + {"RangeStmt.Key", Field, 0}, + {"RangeStmt.Range", Field, 20}, + {"RangeStmt.Tok", Field, 0}, + {"RangeStmt.TokPos", Field, 0}, + {"RangeStmt.Value", Field, 0}, + {"RangeStmt.X", Field, 0}, + {"ReturnStmt", Type, 0}, + {"ReturnStmt.Results", Field, 0}, + {"ReturnStmt.Return", Field, 0}, + {"SEND", Const, 0}, + {"Scope", Type, 0}, + {"Scope.Objects", Field, 0}, + {"Scope.Outer", Field, 0}, + {"SelectStmt", Type, 0}, + {"SelectStmt.Body", Field, 0}, + {"SelectStmt.Select", Field, 0}, + {"SelectorExpr", Type, 0}, + {"SelectorExpr.Sel", Field, 0}, + {"SelectorExpr.X", Field, 0}, + {"SendStmt", Type, 0}, + {"SendStmt.Arrow", Field, 0}, + {"SendStmt.Chan", Field, 0}, + {"SendStmt.Value", Field, 0}, + {"SliceExpr", Type, 0}, + {"SliceExpr.High", Field, 0}, + {"SliceExpr.Lbrack", Field, 0}, + {"SliceExpr.Low", Field, 0}, + {"SliceExpr.Max", Field, 2}, + {"SliceExpr.Rbrack", Field, 0}, + {"SliceExpr.Slice3", Field, 2}, + {"SliceExpr.X", Field, 0}, + {"SortImports", Func, 0}, + {"Spec", Type, 0}, + {"StarExpr", Type, 0}, + {"StarExpr.Star", Field, 0}, + {"StarExpr.X", Field, 0}, + {"Stmt", Type, 0}, + {"StructType", Type, 0}, + {"StructType.Fields", Field, 0}, + {"StructType.Incomplete", Field, 0}, + {"StructType.Struct", Field, 0}, + {"SwitchStmt", Type, 0}, + {"SwitchStmt.Body", Field, 0}, + {"SwitchStmt.Init", Field, 0}, + {"SwitchStmt.Switch", Field, 0}, + {"SwitchStmt.Tag", Field, 0}, + {"Typ", Const, 0}, + {"TypeAssertExpr", Type, 0}, + {"TypeAssertExpr.Lparen", Field, 2}, + {"TypeAssertExpr.Rparen", Field, 2}, + {"TypeAssertExpr.Type", Field, 0}, + {"TypeAssertExpr.X", Field, 0}, + {"TypeSpec", Type, 0}, + {"TypeSpec.Assign", Field, 9}, + {"TypeSpec.Comment", Field, 0}, + {"TypeSpec.Doc", Field, 0}, + {"TypeSpec.Name", Field, 0}, + {"TypeSpec.Type", Field, 0}, + {"TypeSpec.TypeParams", Field, 18}, + {"TypeSwitchStmt", Type, 0}, + {"TypeSwitchStmt.Assign", Field, 0}, + {"TypeSwitchStmt.Body", Field, 0}, + {"TypeSwitchStmt.Init", Field, 0}, + {"TypeSwitchStmt.Switch", Field, 0}, + {"UnaryExpr", Type, 0}, + {"UnaryExpr.Op", Field, 0}, + {"UnaryExpr.OpPos", Field, 0}, + {"UnaryExpr.X", Field, 0}, + {"Unparen", Func, 22}, + {"ValueSpec", Type, 0}, + {"ValueSpec.Comment", Field, 0}, + {"ValueSpec.Doc", Field, 0}, + {"ValueSpec.Names", Field, 0}, + {"ValueSpec.Type", Field, 0}, + {"ValueSpec.Values", Field, 0}, + {"Var", Const, 0}, + {"Visitor", Type, 0}, + {"Walk", Func, 0}, + }, + "go/build": { + {"(*Context).Import", Method, 0}, + {"(*Context).ImportDir", Method, 0}, + {"(*Context).MatchFile", Method, 2}, + {"(*Context).SrcDirs", Method, 0}, + {"(*MultiplePackageError).Error", Method, 4}, + {"(*NoGoError).Error", Method, 0}, + {"(*Package).IsCommand", Method, 0}, + {"AllowBinary", Const, 0}, + {"ArchChar", Func, 0}, + {"Context", Type, 0}, + {"Context.BuildTags", Field, 0}, + {"Context.CgoEnabled", Field, 0}, + {"Context.Compiler", Field, 0}, + {"Context.Dir", Field, 14}, + {"Context.GOARCH", Field, 0}, + {"Context.GOOS", Field, 0}, + {"Context.GOPATH", Field, 0}, + {"Context.GOROOT", Field, 0}, + {"Context.HasSubdir", Field, 0}, + {"Context.InstallSuffix", Field, 1}, + {"Context.IsAbsPath", Field, 0}, + {"Context.IsDir", Field, 0}, + {"Context.JoinPath", Field, 0}, + {"Context.OpenFile", Field, 0}, + {"Context.ReadDir", Field, 0}, + {"Context.ReleaseTags", Field, 1}, + {"Context.SplitPathList", Field, 0}, + {"Context.ToolTags", Field, 17}, + {"Context.UseAllFiles", Field, 0}, + {"Default", Var, 0}, + {"Directive", Type, 21}, + {"Directive.Pos", Field, 21}, + {"Directive.Text", Field, 21}, + {"FindOnly", Const, 0}, + {"IgnoreVendor", Const, 6}, + {"Import", Func, 0}, + {"ImportComment", Const, 4}, + {"ImportDir", Func, 0}, + {"ImportMode", Type, 0}, + {"IsLocalImport", Func, 0}, + {"MultiplePackageError", Type, 4}, + {"MultiplePackageError.Dir", Field, 4}, + {"MultiplePackageError.Files", Field, 4}, + {"MultiplePackageError.Packages", Field, 4}, + {"NoGoError", Type, 0}, + {"NoGoError.Dir", Field, 0}, + {"Package", Type, 0}, + {"Package.AllTags", Field, 2}, + {"Package.BinDir", Field, 0}, + {"Package.BinaryOnly", Field, 7}, + {"Package.CFiles", Field, 0}, + {"Package.CXXFiles", Field, 2}, + {"Package.CgoCFLAGS", Field, 0}, + {"Package.CgoCPPFLAGS", Field, 2}, + {"Package.CgoCXXFLAGS", Field, 2}, + {"Package.CgoFFLAGS", Field, 7}, + {"Package.CgoFiles", Field, 0}, + {"Package.CgoLDFLAGS", Field, 0}, + {"Package.CgoPkgConfig", Field, 0}, + {"Package.ConflictDir", Field, 2}, + {"Package.Dir", Field, 0}, + {"Package.Directives", Field, 21}, + {"Package.Doc", Field, 0}, + {"Package.EmbedPatternPos", Field, 16}, + {"Package.EmbedPatterns", Field, 16}, + {"Package.FFiles", Field, 7}, + {"Package.GoFiles", Field, 0}, + {"Package.Goroot", Field, 0}, + {"Package.HFiles", Field, 0}, + {"Package.IgnoredGoFiles", Field, 1}, + {"Package.IgnoredOtherFiles", Field, 16}, + {"Package.ImportComment", Field, 4}, + {"Package.ImportPath", Field, 0}, + {"Package.ImportPos", Field, 0}, + {"Package.Imports", Field, 0}, + {"Package.InvalidGoFiles", Field, 6}, + {"Package.MFiles", Field, 3}, + {"Package.Name", Field, 0}, + {"Package.PkgObj", Field, 0}, + {"Package.PkgRoot", Field, 0}, + {"Package.PkgTargetRoot", Field, 5}, + {"Package.Root", Field, 0}, + {"Package.SFiles", Field, 0}, + {"Package.SrcRoot", Field, 0}, + {"Package.SwigCXXFiles", Field, 1}, + {"Package.SwigFiles", Field, 1}, + {"Package.SysoFiles", Field, 0}, + {"Package.TestDirectives", Field, 21}, + {"Package.TestEmbedPatternPos", Field, 16}, + {"Package.TestEmbedPatterns", Field, 16}, + {"Package.TestGoFiles", Field, 0}, + {"Package.TestImportPos", Field, 0}, + {"Package.TestImports", Field, 0}, + {"Package.XTestDirectives", Field, 21}, + {"Package.XTestEmbedPatternPos", Field, 16}, + {"Package.XTestEmbedPatterns", Field, 16}, + {"Package.XTestGoFiles", Field, 0}, + {"Package.XTestImportPos", Field, 0}, + {"Package.XTestImports", Field, 0}, + {"ToolDir", Var, 0}, + }, + "go/build/constraint": { + {"(*AndExpr).Eval", Method, 16}, + {"(*AndExpr).String", Method, 16}, + {"(*NotExpr).Eval", Method, 16}, + {"(*NotExpr).String", Method, 16}, + {"(*OrExpr).Eval", Method, 16}, + {"(*OrExpr).String", Method, 16}, + {"(*SyntaxError).Error", Method, 16}, + {"(*TagExpr).Eval", Method, 16}, + {"(*TagExpr).String", Method, 16}, + {"AndExpr", Type, 16}, + {"AndExpr.X", Field, 16}, + {"AndExpr.Y", Field, 16}, + {"Expr", Type, 16}, + {"GoVersion", Func, 21}, + {"IsGoBuild", Func, 16}, + {"IsPlusBuild", Func, 16}, + {"NotExpr", Type, 16}, + {"NotExpr.X", Field, 16}, + {"OrExpr", Type, 16}, + {"OrExpr.X", Field, 16}, + {"OrExpr.Y", Field, 16}, + {"Parse", Func, 16}, + {"PlusBuildLines", Func, 16}, + {"SyntaxError", Type, 16}, + {"SyntaxError.Err", Field, 16}, + {"SyntaxError.Offset", Field, 16}, + {"TagExpr", Type, 16}, + {"TagExpr.Tag", Field, 16}, + }, + "go/constant": { + {"(Kind).String", Method, 18}, + {"BinaryOp", Func, 5}, + {"BitLen", Func, 5}, + {"Bool", Const, 5}, + {"BoolVal", Func, 5}, + {"Bytes", Func, 5}, + {"Compare", Func, 5}, + {"Complex", Const, 5}, + {"Denom", Func, 5}, + {"Float", Const, 5}, + {"Float32Val", Func, 5}, + {"Float64Val", Func, 5}, + {"Imag", Func, 5}, + {"Int", Const, 5}, + {"Int64Val", Func, 5}, + {"Kind", Type, 5}, + {"Make", Func, 13}, + {"MakeBool", Func, 5}, + {"MakeFloat64", Func, 5}, + {"MakeFromBytes", Func, 5}, + {"MakeFromLiteral", Func, 5}, + {"MakeImag", Func, 5}, + {"MakeInt64", Func, 5}, + {"MakeString", Func, 5}, + {"MakeUint64", Func, 5}, + {"MakeUnknown", Func, 5}, + {"Num", Func, 5}, + {"Real", Func, 5}, + {"Shift", Func, 5}, + {"Sign", Func, 5}, + {"String", Const, 5}, + {"StringVal", Func, 5}, + {"ToComplex", Func, 6}, + {"ToFloat", Func, 6}, + {"ToInt", Func, 6}, + {"Uint64Val", Func, 5}, + {"UnaryOp", Func, 5}, + {"Unknown", Const, 5}, + {"Val", Func, 13}, + {"Value", Type, 5}, + }, + "go/doc": { + {"(*Package).Filter", Method, 0}, + {"(*Package).HTML", Method, 19}, + {"(*Package).Markdown", Method, 19}, + {"(*Package).Parser", Method, 19}, + {"(*Package).Printer", Method, 19}, + {"(*Package).Synopsis", Method, 19}, + {"(*Package).Text", Method, 19}, + {"AllDecls", Const, 0}, + {"AllMethods", Const, 0}, + {"Example", Type, 0}, + {"Example.Code", Field, 0}, + {"Example.Comments", Field, 0}, + {"Example.Doc", Field, 0}, + {"Example.EmptyOutput", Field, 1}, + {"Example.Name", Field, 0}, + {"Example.Order", Field, 1}, + {"Example.Output", Field, 0}, + {"Example.Play", Field, 1}, + {"Example.Suffix", Field, 14}, + {"Example.Unordered", Field, 7}, + {"Examples", Func, 0}, + {"Filter", Type, 0}, + {"Func", Type, 0}, + {"Func.Decl", Field, 0}, + {"Func.Doc", Field, 0}, + {"Func.Examples", Field, 14}, + {"Func.Level", Field, 0}, + {"Func.Name", Field, 0}, + {"Func.Orig", Field, 0}, + {"Func.Recv", Field, 0}, + {"IllegalPrefixes", Var, 1}, + {"IsPredeclared", Func, 8}, + {"Mode", Type, 0}, + {"New", Func, 0}, + {"NewFromFiles", Func, 14}, + {"Note", Type, 1}, + {"Note.Body", Field, 1}, + {"Note.End", Field, 1}, + {"Note.Pos", Field, 1}, + {"Note.UID", Field, 1}, + {"Package", Type, 0}, + {"Package.Bugs", Field, 0}, + {"Package.Consts", Field, 0}, + {"Package.Doc", Field, 0}, + {"Package.Examples", Field, 14}, + {"Package.Filenames", Field, 0}, + {"Package.Funcs", Field, 0}, + {"Package.ImportPath", Field, 0}, + {"Package.Imports", Field, 0}, + {"Package.Name", Field, 0}, + {"Package.Notes", Field, 1}, + {"Package.Types", Field, 0}, + {"Package.Vars", Field, 0}, + {"PreserveAST", Const, 12}, + {"Synopsis", Func, 0}, + {"ToHTML", Func, 0}, + {"ToText", Func, 0}, + {"Type", Type, 0}, + {"Type.Consts", Field, 0}, + {"Type.Decl", Field, 0}, + {"Type.Doc", Field, 0}, + {"Type.Examples", Field, 14}, + {"Type.Funcs", Field, 0}, + {"Type.Methods", Field, 0}, + {"Type.Name", Field, 0}, + {"Type.Vars", Field, 0}, + {"Value", Type, 0}, + {"Value.Decl", Field, 0}, + {"Value.Doc", Field, 0}, + {"Value.Names", Field, 0}, + }, + "go/doc/comment": { + {"(*DocLink).DefaultURL", Method, 19}, + {"(*Heading).DefaultID", Method, 19}, + {"(*List).BlankBefore", Method, 19}, + {"(*List).BlankBetween", Method, 19}, + {"(*Parser).Parse", Method, 19}, + {"(*Printer).Comment", Method, 19}, + {"(*Printer).HTML", Method, 19}, + {"(*Printer).Markdown", Method, 19}, + {"(*Printer).Text", Method, 19}, + {"Block", Type, 19}, + {"Code", Type, 19}, + {"Code.Text", Field, 19}, + {"DefaultLookupPackage", Func, 19}, + {"Doc", Type, 19}, + {"Doc.Content", Field, 19}, + {"Doc.Links", Field, 19}, + {"DocLink", Type, 19}, + {"DocLink.ImportPath", Field, 19}, + {"DocLink.Name", Field, 19}, + {"DocLink.Recv", Field, 19}, + {"DocLink.Text", Field, 19}, + {"Heading", Type, 19}, + {"Heading.Text", Field, 19}, + {"Italic", Type, 19}, + {"Link", Type, 19}, + {"Link.Auto", Field, 19}, + {"Link.Text", Field, 19}, + {"Link.URL", Field, 19}, + {"LinkDef", Type, 19}, + {"LinkDef.Text", Field, 19}, + {"LinkDef.URL", Field, 19}, + {"LinkDef.Used", Field, 19}, + {"List", Type, 19}, + {"List.ForceBlankBefore", Field, 19}, + {"List.ForceBlankBetween", Field, 19}, + {"List.Items", Field, 19}, + {"ListItem", Type, 19}, + {"ListItem.Content", Field, 19}, + {"ListItem.Number", Field, 19}, + {"Paragraph", Type, 19}, + {"Paragraph.Text", Field, 19}, + {"Parser", Type, 19}, + {"Parser.LookupPackage", Field, 19}, + {"Parser.LookupSym", Field, 19}, + {"Parser.Words", Field, 19}, + {"Plain", Type, 19}, + {"Printer", Type, 19}, + {"Printer.DocLinkBaseURL", Field, 19}, + {"Printer.DocLinkURL", Field, 19}, + {"Printer.HeadingID", Field, 19}, + {"Printer.HeadingLevel", Field, 19}, + {"Printer.TextCodePrefix", Field, 19}, + {"Printer.TextPrefix", Field, 19}, + {"Printer.TextWidth", Field, 19}, + {"Text", Type, 19}, + }, + "go/format": { + {"Node", Func, 1}, + {"Source", Func, 1}, + }, + "go/importer": { + {"Default", Func, 5}, + {"For", Func, 5}, + {"ForCompiler", Func, 12}, + {"Lookup", Type, 5}, + }, + "go/parser": { + {"AllErrors", Const, 1}, + {"DeclarationErrors", Const, 0}, + {"ImportsOnly", Const, 0}, + {"Mode", Type, 0}, + {"PackageClauseOnly", Const, 0}, + {"ParseComments", Const, 0}, + {"ParseDir", Func, 0}, + {"ParseExpr", Func, 0}, + {"ParseExprFrom", Func, 5}, + {"ParseFile", Func, 0}, + {"SkipObjectResolution", Const, 17}, + {"SpuriousErrors", Const, 0}, + {"Trace", Const, 0}, + }, + "go/printer": { + {"(*Config).Fprint", Method, 0}, + {"CommentedNode", Type, 0}, + {"CommentedNode.Comments", Field, 0}, + {"CommentedNode.Node", Field, 0}, + {"Config", Type, 0}, + {"Config.Indent", Field, 1}, + {"Config.Mode", Field, 0}, + {"Config.Tabwidth", Field, 0}, + {"Fprint", Func, 0}, + {"Mode", Type, 0}, + {"RawFormat", Const, 0}, + {"SourcePos", Const, 0}, + {"TabIndent", Const, 0}, + {"UseSpaces", Const, 0}, + }, + "go/scanner": { + {"(*ErrorList).Add", Method, 0}, + {"(*ErrorList).RemoveMultiples", Method, 0}, + {"(*ErrorList).Reset", Method, 0}, + {"(*Scanner).Init", Method, 0}, + {"(*Scanner).Scan", Method, 0}, + {"(Error).Error", Method, 0}, + {"(ErrorList).Err", Method, 0}, + {"(ErrorList).Error", Method, 0}, + {"(ErrorList).Len", Method, 0}, + {"(ErrorList).Less", Method, 0}, + {"(ErrorList).Sort", Method, 0}, + {"(ErrorList).Swap", Method, 0}, + {"Error", Type, 0}, + {"Error.Msg", Field, 0}, + {"Error.Pos", Field, 0}, + {"ErrorHandler", Type, 0}, + {"ErrorList", Type, 0}, + {"Mode", Type, 0}, + {"PrintError", Func, 0}, + {"ScanComments", Const, 0}, + {"Scanner", Type, 0}, + {"Scanner.ErrorCount", Field, 0}, + }, + "go/token": { + {"(*File).AddLine", Method, 0}, + {"(*File).AddLineColumnInfo", Method, 11}, + {"(*File).AddLineInfo", Method, 0}, + {"(*File).Base", Method, 0}, + {"(*File).Line", Method, 0}, + {"(*File).LineCount", Method, 0}, + {"(*File).LineStart", Method, 12}, + {"(*File).Lines", Method, 21}, + {"(*File).MergeLine", Method, 2}, + {"(*File).Name", Method, 0}, + {"(*File).Offset", Method, 0}, + {"(*File).Pos", Method, 0}, + {"(*File).Position", Method, 0}, + {"(*File).PositionFor", Method, 4}, + {"(*File).SetLines", Method, 0}, + {"(*File).SetLinesForContent", Method, 0}, + {"(*File).Size", Method, 0}, + {"(*FileSet).AddFile", Method, 0}, + {"(*FileSet).Base", Method, 0}, + {"(*FileSet).File", Method, 0}, + {"(*FileSet).Iterate", Method, 0}, + {"(*FileSet).Position", Method, 0}, + {"(*FileSet).PositionFor", Method, 4}, + {"(*FileSet).Read", Method, 0}, + {"(*FileSet).RemoveFile", Method, 20}, + {"(*FileSet).Write", Method, 0}, + {"(*Position).IsValid", Method, 0}, + {"(Pos).IsValid", Method, 0}, + {"(Position).String", Method, 0}, + {"(Token).IsKeyword", Method, 0}, + {"(Token).IsLiteral", Method, 0}, + {"(Token).IsOperator", Method, 0}, + {"(Token).Precedence", Method, 0}, + {"(Token).String", Method, 0}, + {"ADD", Const, 0}, + {"ADD_ASSIGN", Const, 0}, + {"AND", Const, 0}, + {"AND_ASSIGN", Const, 0}, + {"AND_NOT", Const, 0}, + {"AND_NOT_ASSIGN", Const, 0}, + {"ARROW", Const, 0}, + {"ASSIGN", Const, 0}, + {"BREAK", Const, 0}, + {"CASE", Const, 0}, + {"CHAN", Const, 0}, + {"CHAR", Const, 0}, + {"COLON", Const, 0}, + {"COMMA", Const, 0}, + {"COMMENT", Const, 0}, + {"CONST", Const, 0}, + {"CONTINUE", Const, 0}, + {"DEC", Const, 0}, + {"DEFAULT", Const, 0}, + {"DEFER", Const, 0}, + {"DEFINE", Const, 0}, + {"ELLIPSIS", Const, 0}, + {"ELSE", Const, 0}, + {"EOF", Const, 0}, + {"EQL", Const, 0}, + {"FALLTHROUGH", Const, 0}, + {"FLOAT", Const, 0}, + {"FOR", Const, 0}, + {"FUNC", Const, 0}, + {"File", Type, 0}, + {"FileSet", Type, 0}, + {"GEQ", Const, 0}, + {"GO", Const, 0}, + {"GOTO", Const, 0}, + {"GTR", Const, 0}, + {"HighestPrec", Const, 0}, + {"IDENT", Const, 0}, + {"IF", Const, 0}, + {"ILLEGAL", Const, 0}, + {"IMAG", Const, 0}, + {"IMPORT", Const, 0}, + {"INC", Const, 0}, + {"INT", Const, 0}, + {"INTERFACE", Const, 0}, + {"IsExported", Func, 13}, + {"IsIdentifier", Func, 13}, + {"IsKeyword", Func, 13}, + {"LAND", Const, 0}, + {"LBRACE", Const, 0}, + {"LBRACK", Const, 0}, + {"LEQ", Const, 0}, + {"LOR", Const, 0}, + {"LPAREN", Const, 0}, + {"LSS", Const, 0}, + {"Lookup", Func, 0}, + {"LowestPrec", Const, 0}, + {"MAP", Const, 0}, + {"MUL", Const, 0}, + {"MUL_ASSIGN", Const, 0}, + {"NEQ", Const, 0}, + {"NOT", Const, 0}, + {"NewFileSet", Func, 0}, + {"NoPos", Const, 0}, + {"OR", Const, 0}, + {"OR_ASSIGN", Const, 0}, + {"PACKAGE", Const, 0}, + {"PERIOD", Const, 0}, + {"Pos", Type, 0}, + {"Position", Type, 0}, + {"Position.Column", Field, 0}, + {"Position.Filename", Field, 0}, + {"Position.Line", Field, 0}, + {"Position.Offset", Field, 0}, + {"QUO", Const, 0}, + {"QUO_ASSIGN", Const, 0}, + {"RANGE", Const, 0}, + {"RBRACE", Const, 0}, + {"RBRACK", Const, 0}, + {"REM", Const, 0}, + {"REM_ASSIGN", Const, 0}, + {"RETURN", Const, 0}, + {"RPAREN", Const, 0}, + {"SELECT", Const, 0}, + {"SEMICOLON", Const, 0}, + {"SHL", Const, 0}, + {"SHL_ASSIGN", Const, 0}, + {"SHR", Const, 0}, + {"SHR_ASSIGN", Const, 0}, + {"STRING", Const, 0}, + {"STRUCT", Const, 0}, + {"SUB", Const, 0}, + {"SUB_ASSIGN", Const, 0}, + {"SWITCH", Const, 0}, + {"TILDE", Const, 18}, + {"TYPE", Const, 0}, + {"Token", Type, 0}, + {"UnaryPrec", Const, 0}, + {"VAR", Const, 0}, + {"XOR", Const, 0}, + {"XOR_ASSIGN", Const, 0}, + }, + "go/types": { + {"(*Alias).Obj", Method, 22}, + {"(*Alias).Origin", Method, 23}, + {"(*Alias).Rhs", Method, 23}, + {"(*Alias).SetTypeParams", Method, 23}, + {"(*Alias).String", Method, 22}, + {"(*Alias).TypeArgs", Method, 23}, + {"(*Alias).TypeParams", Method, 23}, + {"(*Alias).Underlying", Method, 22}, + {"(*ArgumentError).Error", Method, 18}, + {"(*ArgumentError).Unwrap", Method, 18}, + {"(*Array).Elem", Method, 5}, + {"(*Array).Len", Method, 5}, + {"(*Array).String", Method, 5}, + {"(*Array).Underlying", Method, 5}, + {"(*Basic).Info", Method, 5}, + {"(*Basic).Kind", Method, 5}, + {"(*Basic).Name", Method, 5}, + {"(*Basic).String", Method, 5}, + {"(*Basic).Underlying", Method, 5}, + {"(*Builtin).Exported", Method, 5}, + {"(*Builtin).Id", Method, 5}, + {"(*Builtin).Name", Method, 5}, + {"(*Builtin).Parent", Method, 5}, + {"(*Builtin).Pkg", Method, 5}, + {"(*Builtin).Pos", Method, 5}, + {"(*Builtin).String", Method, 5}, + {"(*Builtin).Type", Method, 5}, + {"(*Chan).Dir", Method, 5}, + {"(*Chan).Elem", Method, 5}, + {"(*Chan).String", Method, 5}, + {"(*Chan).Underlying", Method, 5}, + {"(*Checker).Files", Method, 5}, + {"(*Config).Check", Method, 5}, + {"(*Const).Exported", Method, 5}, + {"(*Const).Id", Method, 5}, + {"(*Const).Name", Method, 5}, + {"(*Const).Parent", Method, 5}, + {"(*Const).Pkg", Method, 5}, + {"(*Const).Pos", Method, 5}, + {"(*Const).String", Method, 5}, + {"(*Const).Type", Method, 5}, + {"(*Const).Val", Method, 5}, + {"(*Func).Exported", Method, 5}, + {"(*Func).FullName", Method, 5}, + {"(*Func).Id", Method, 5}, + {"(*Func).Name", Method, 5}, + {"(*Func).Origin", Method, 19}, + {"(*Func).Parent", Method, 5}, + {"(*Func).Pkg", Method, 5}, + {"(*Func).Pos", Method, 5}, + {"(*Func).Scope", Method, 5}, + {"(*Func).Signature", Method, 23}, + {"(*Func).String", Method, 5}, + {"(*Func).Type", Method, 5}, + {"(*Info).ObjectOf", Method, 5}, + {"(*Info).PkgNameOf", Method, 22}, + {"(*Info).TypeOf", Method, 5}, + {"(*Initializer).String", Method, 5}, + {"(*Interface).Complete", Method, 5}, + {"(*Interface).Embedded", Method, 5}, + {"(*Interface).EmbeddedType", Method, 11}, + {"(*Interface).Empty", Method, 5}, + {"(*Interface).ExplicitMethod", Method, 5}, + {"(*Interface).IsComparable", Method, 18}, + {"(*Interface).IsImplicit", Method, 18}, + {"(*Interface).IsMethodSet", Method, 18}, + {"(*Interface).MarkImplicit", Method, 18}, + {"(*Interface).Method", Method, 5}, + {"(*Interface).NumEmbeddeds", Method, 5}, + {"(*Interface).NumExplicitMethods", Method, 5}, + {"(*Interface).NumMethods", Method, 5}, + {"(*Interface).String", Method, 5}, + {"(*Interface).Underlying", Method, 5}, + {"(*Label).Exported", Method, 5}, + {"(*Label).Id", Method, 5}, + {"(*Label).Name", Method, 5}, + {"(*Label).Parent", Method, 5}, + {"(*Label).Pkg", Method, 5}, + {"(*Label).Pos", Method, 5}, + {"(*Label).String", Method, 5}, + {"(*Label).Type", Method, 5}, + {"(*Map).Elem", Method, 5}, + {"(*Map).Key", Method, 5}, + {"(*Map).String", Method, 5}, + {"(*Map).Underlying", Method, 5}, + {"(*MethodSet).At", Method, 5}, + {"(*MethodSet).Len", Method, 5}, + {"(*MethodSet).Lookup", Method, 5}, + {"(*MethodSet).String", Method, 5}, + {"(*Named).AddMethod", Method, 5}, + {"(*Named).Method", Method, 5}, + {"(*Named).NumMethods", Method, 5}, + {"(*Named).Obj", Method, 5}, + {"(*Named).Origin", Method, 18}, + {"(*Named).SetTypeParams", Method, 18}, + {"(*Named).SetUnderlying", Method, 5}, + {"(*Named).String", Method, 5}, + {"(*Named).TypeArgs", Method, 18}, + {"(*Named).TypeParams", Method, 18}, + {"(*Named).Underlying", Method, 5}, + {"(*Nil).Exported", Method, 5}, + {"(*Nil).Id", Method, 5}, + {"(*Nil).Name", Method, 5}, + {"(*Nil).Parent", Method, 5}, + {"(*Nil).Pkg", Method, 5}, + {"(*Nil).Pos", Method, 5}, + {"(*Nil).String", Method, 5}, + {"(*Nil).Type", Method, 5}, + {"(*Package).Complete", Method, 5}, + {"(*Package).GoVersion", Method, 21}, + {"(*Package).Imports", Method, 5}, + {"(*Package).MarkComplete", Method, 5}, + {"(*Package).Name", Method, 5}, + {"(*Package).Path", Method, 5}, + {"(*Package).Scope", Method, 5}, + {"(*Package).SetImports", Method, 5}, + {"(*Package).SetName", Method, 6}, + {"(*Package).String", Method, 5}, + {"(*PkgName).Exported", Method, 5}, + {"(*PkgName).Id", Method, 5}, + {"(*PkgName).Imported", Method, 5}, + {"(*PkgName).Name", Method, 5}, + {"(*PkgName).Parent", Method, 5}, + {"(*PkgName).Pkg", Method, 5}, + {"(*PkgName).Pos", Method, 5}, + {"(*PkgName).String", Method, 5}, + {"(*PkgName).Type", Method, 5}, + {"(*Pointer).Elem", Method, 5}, + {"(*Pointer).String", Method, 5}, + {"(*Pointer).Underlying", Method, 5}, + {"(*Scope).Child", Method, 5}, + {"(*Scope).Contains", Method, 5}, + {"(*Scope).End", Method, 5}, + {"(*Scope).Innermost", Method, 5}, + {"(*Scope).Insert", Method, 5}, + {"(*Scope).Len", Method, 5}, + {"(*Scope).Lookup", Method, 5}, + {"(*Scope).LookupParent", Method, 5}, + {"(*Scope).Names", Method, 5}, + {"(*Scope).NumChildren", Method, 5}, + {"(*Scope).Parent", Method, 5}, + {"(*Scope).Pos", Method, 5}, + {"(*Scope).String", Method, 5}, + {"(*Scope).WriteTo", Method, 5}, + {"(*Selection).Index", Method, 5}, + {"(*Selection).Indirect", Method, 5}, + {"(*Selection).Kind", Method, 5}, + {"(*Selection).Obj", Method, 5}, + {"(*Selection).Recv", Method, 5}, + {"(*Selection).String", Method, 5}, + {"(*Selection).Type", Method, 5}, + {"(*Signature).Params", Method, 5}, + {"(*Signature).Recv", Method, 5}, + {"(*Signature).RecvTypeParams", Method, 18}, + {"(*Signature).Results", Method, 5}, + {"(*Signature).String", Method, 5}, + {"(*Signature).TypeParams", Method, 18}, + {"(*Signature).Underlying", Method, 5}, + {"(*Signature).Variadic", Method, 5}, + {"(*Slice).Elem", Method, 5}, + {"(*Slice).String", Method, 5}, + {"(*Slice).Underlying", Method, 5}, + {"(*StdSizes).Alignof", Method, 5}, + {"(*StdSizes).Offsetsof", Method, 5}, + {"(*StdSizes).Sizeof", Method, 5}, + {"(*Struct).Field", Method, 5}, + {"(*Struct).NumFields", Method, 5}, + {"(*Struct).String", Method, 5}, + {"(*Struct).Tag", Method, 5}, + {"(*Struct).Underlying", Method, 5}, + {"(*Term).String", Method, 18}, + {"(*Term).Tilde", Method, 18}, + {"(*Term).Type", Method, 18}, + {"(*Tuple).At", Method, 5}, + {"(*Tuple).Len", Method, 5}, + {"(*Tuple).String", Method, 5}, + {"(*Tuple).Underlying", Method, 5}, + {"(*TypeList).At", Method, 18}, + {"(*TypeList).Len", Method, 18}, + {"(*TypeName).Exported", Method, 5}, + {"(*TypeName).Id", Method, 5}, + {"(*TypeName).IsAlias", Method, 9}, + {"(*TypeName).Name", Method, 5}, + {"(*TypeName).Parent", Method, 5}, + {"(*TypeName).Pkg", Method, 5}, + {"(*TypeName).Pos", Method, 5}, + {"(*TypeName).String", Method, 5}, + {"(*TypeName).Type", Method, 5}, + {"(*TypeParam).Constraint", Method, 18}, + {"(*TypeParam).Index", Method, 18}, + {"(*TypeParam).Obj", Method, 18}, + {"(*TypeParam).SetConstraint", Method, 18}, + {"(*TypeParam).String", Method, 18}, + {"(*TypeParam).Underlying", Method, 18}, + {"(*TypeParamList).At", Method, 18}, + {"(*TypeParamList).Len", Method, 18}, + {"(*Union).Len", Method, 18}, + {"(*Union).String", Method, 18}, + {"(*Union).Term", Method, 18}, + {"(*Union).Underlying", Method, 18}, + {"(*Var).Anonymous", Method, 5}, + {"(*Var).Embedded", Method, 11}, + {"(*Var).Exported", Method, 5}, + {"(*Var).Id", Method, 5}, + {"(*Var).IsField", Method, 5}, + {"(*Var).Name", Method, 5}, + {"(*Var).Origin", Method, 19}, + {"(*Var).Parent", Method, 5}, + {"(*Var).Pkg", Method, 5}, + {"(*Var).Pos", Method, 5}, + {"(*Var).String", Method, 5}, + {"(*Var).Type", Method, 5}, + {"(Checker).ObjectOf", Method, 5}, + {"(Checker).PkgNameOf", Method, 22}, + {"(Checker).TypeOf", Method, 5}, + {"(Error).Error", Method, 5}, + {"(TypeAndValue).Addressable", Method, 5}, + {"(TypeAndValue).Assignable", Method, 5}, + {"(TypeAndValue).HasOk", Method, 5}, + {"(TypeAndValue).IsBuiltin", Method, 5}, + {"(TypeAndValue).IsNil", Method, 5}, + {"(TypeAndValue).IsType", Method, 5}, + {"(TypeAndValue).IsValue", Method, 5}, + {"(TypeAndValue).IsVoid", Method, 5}, + {"Alias", Type, 22}, + {"ArgumentError", Type, 18}, + {"ArgumentError.Err", Field, 18}, + {"ArgumentError.Index", Field, 18}, + {"Array", Type, 5}, + {"AssertableTo", Func, 5}, + {"AssignableTo", Func, 5}, + {"Basic", Type, 5}, + {"BasicInfo", Type, 5}, + {"BasicKind", Type, 5}, + {"Bool", Const, 5}, + {"Builtin", Type, 5}, + {"Byte", Const, 5}, + {"Chan", Type, 5}, + {"ChanDir", Type, 5}, + {"CheckExpr", Func, 13}, + {"Checker", Type, 5}, + {"Checker.Info", Field, 5}, + {"Comparable", Func, 5}, + {"Complex128", Const, 5}, + {"Complex64", Const, 5}, + {"Config", Type, 5}, + {"Config.Context", Field, 18}, + {"Config.DisableUnusedImportCheck", Field, 5}, + {"Config.Error", Field, 5}, + {"Config.FakeImportC", Field, 5}, + {"Config.GoVersion", Field, 18}, + {"Config.IgnoreFuncBodies", Field, 5}, + {"Config.Importer", Field, 5}, + {"Config.Sizes", Field, 5}, + {"Const", Type, 5}, + {"Context", Type, 18}, + {"ConvertibleTo", Func, 5}, + {"DefPredeclaredTestFuncs", Func, 5}, + {"Default", Func, 8}, + {"Error", Type, 5}, + {"Error.Fset", Field, 5}, + {"Error.Msg", Field, 5}, + {"Error.Pos", Field, 5}, + {"Error.Soft", Field, 5}, + {"Eval", Func, 5}, + {"ExprString", Func, 5}, + {"FieldVal", Const, 5}, + {"Float32", Const, 5}, + {"Float64", Const, 5}, + {"Func", Type, 5}, + {"Id", Func, 5}, + {"Identical", Func, 5}, + {"IdenticalIgnoreTags", Func, 8}, + {"Implements", Func, 5}, + {"ImportMode", Type, 6}, + {"Importer", Type, 5}, + {"ImporterFrom", Type, 6}, + {"Info", Type, 5}, + {"Info.Defs", Field, 5}, + {"Info.FileVersions", Field, 22}, + {"Info.Implicits", Field, 5}, + {"Info.InitOrder", Field, 5}, + {"Info.Instances", Field, 18}, + {"Info.Scopes", Field, 5}, + {"Info.Selections", Field, 5}, + {"Info.Types", Field, 5}, + {"Info.Uses", Field, 5}, + {"Initializer", Type, 5}, + {"Initializer.Lhs", Field, 5}, + {"Initializer.Rhs", Field, 5}, + {"Instance", Type, 18}, + {"Instance.Type", Field, 18}, + {"Instance.TypeArgs", Field, 18}, + {"Instantiate", Func, 18}, + {"Int", Const, 5}, + {"Int16", Const, 5}, + {"Int32", Const, 5}, + {"Int64", Const, 5}, + {"Int8", Const, 5}, + {"Interface", Type, 5}, + {"Invalid", Const, 5}, + {"IsBoolean", Const, 5}, + {"IsComplex", Const, 5}, + {"IsConstType", Const, 5}, + {"IsFloat", Const, 5}, + {"IsInteger", Const, 5}, + {"IsInterface", Func, 5}, + {"IsNumeric", Const, 5}, + {"IsOrdered", Const, 5}, + {"IsString", Const, 5}, + {"IsUnsigned", Const, 5}, + {"IsUntyped", Const, 5}, + {"Label", Type, 5}, + {"LookupFieldOrMethod", Func, 5}, + {"Map", Type, 5}, + {"MethodExpr", Const, 5}, + {"MethodSet", Type, 5}, + {"MethodVal", Const, 5}, + {"MissingMethod", Func, 5}, + {"Named", Type, 5}, + {"NewAlias", Func, 22}, + {"NewArray", Func, 5}, + {"NewChan", Func, 5}, + {"NewChecker", Func, 5}, + {"NewConst", Func, 5}, + {"NewContext", Func, 18}, + {"NewField", Func, 5}, + {"NewFunc", Func, 5}, + {"NewInterface", Func, 5}, + {"NewInterfaceType", Func, 11}, + {"NewLabel", Func, 5}, + {"NewMap", Func, 5}, + {"NewMethodSet", Func, 5}, + {"NewNamed", Func, 5}, + {"NewPackage", Func, 5}, + {"NewParam", Func, 5}, + {"NewPkgName", Func, 5}, + {"NewPointer", Func, 5}, + {"NewScope", Func, 5}, + {"NewSignature", Func, 5}, + {"NewSignatureType", Func, 18}, + {"NewSlice", Func, 5}, + {"NewStruct", Func, 5}, + {"NewTerm", Func, 18}, + {"NewTuple", Func, 5}, + {"NewTypeName", Func, 5}, + {"NewTypeParam", Func, 18}, + {"NewUnion", Func, 18}, + {"NewVar", Func, 5}, + {"Nil", Type, 5}, + {"Object", Type, 5}, + {"ObjectString", Func, 5}, + {"Package", Type, 5}, + {"PkgName", Type, 5}, + {"Pointer", Type, 5}, + {"Qualifier", Type, 5}, + {"RecvOnly", Const, 5}, + {"RelativeTo", Func, 5}, + {"Rune", Const, 5}, + {"Satisfies", Func, 20}, + {"Scope", Type, 5}, + {"Selection", Type, 5}, + {"SelectionKind", Type, 5}, + {"SelectionString", Func, 5}, + {"SendOnly", Const, 5}, + {"SendRecv", Const, 5}, + {"Signature", Type, 5}, + {"Sizes", Type, 5}, + {"SizesFor", Func, 9}, + {"Slice", Type, 5}, + {"StdSizes", Type, 5}, + {"StdSizes.MaxAlign", Field, 5}, + {"StdSizes.WordSize", Field, 5}, + {"String", Const, 5}, + {"Struct", Type, 5}, + {"Term", Type, 18}, + {"Tuple", Type, 5}, + {"Typ", Var, 5}, + {"Type", Type, 5}, + {"TypeAndValue", Type, 5}, + {"TypeAndValue.Type", Field, 5}, + {"TypeAndValue.Value", Field, 5}, + {"TypeList", Type, 18}, + {"TypeName", Type, 5}, + {"TypeParam", Type, 18}, + {"TypeParamList", Type, 18}, + {"TypeString", Func, 5}, + {"Uint", Const, 5}, + {"Uint16", Const, 5}, + {"Uint32", Const, 5}, + {"Uint64", Const, 5}, + {"Uint8", Const, 5}, + {"Uintptr", Const, 5}, + {"Unalias", Func, 22}, + {"Union", Type, 18}, + {"Universe", Var, 5}, + {"Unsafe", Var, 5}, + {"UnsafePointer", Const, 5}, + {"UntypedBool", Const, 5}, + {"UntypedComplex", Const, 5}, + {"UntypedFloat", Const, 5}, + {"UntypedInt", Const, 5}, + {"UntypedNil", Const, 5}, + {"UntypedRune", Const, 5}, + {"UntypedString", Const, 5}, + {"Var", Type, 5}, + {"WriteExpr", Func, 5}, + {"WriteSignature", Func, 5}, + {"WriteType", Func, 5}, + }, + "go/version": { + {"Compare", Func, 22}, + {"IsValid", Func, 22}, + {"Lang", Func, 22}, + }, + "hash": { + {"Hash", Type, 0}, + {"Hash32", Type, 0}, + {"Hash64", Type, 0}, + }, + "hash/adler32": { + {"Checksum", Func, 0}, + {"New", Func, 0}, + {"Size", Const, 0}, + }, + "hash/crc32": { + {"Castagnoli", Const, 0}, + {"Checksum", Func, 0}, + {"ChecksumIEEE", Func, 0}, + {"IEEE", Const, 0}, + {"IEEETable", Var, 0}, + {"Koopman", Const, 0}, + {"MakeTable", Func, 0}, + {"New", Func, 0}, + {"NewIEEE", Func, 0}, + {"Size", Const, 0}, + {"Table", Type, 0}, + {"Update", Func, 0}, + }, + "hash/crc64": { + {"Checksum", Func, 0}, + {"ECMA", Const, 0}, + {"ISO", Const, 0}, + {"MakeTable", Func, 0}, + {"New", Func, 0}, + {"Size", Const, 0}, + {"Table", Type, 0}, + {"Update", Func, 0}, + }, + "hash/fnv": { + {"New128", Func, 9}, + {"New128a", Func, 9}, + {"New32", Func, 0}, + {"New32a", Func, 0}, + {"New64", Func, 0}, + {"New64a", Func, 0}, + }, + "hash/maphash": { + {"(*Hash).BlockSize", Method, 14}, + {"(*Hash).Reset", Method, 14}, + {"(*Hash).Seed", Method, 14}, + {"(*Hash).SetSeed", Method, 14}, + {"(*Hash).Size", Method, 14}, + {"(*Hash).Sum", Method, 14}, + {"(*Hash).Sum64", Method, 14}, + {"(*Hash).Write", Method, 14}, + {"(*Hash).WriteByte", Method, 14}, + {"(*Hash).WriteString", Method, 14}, + {"Bytes", Func, 19}, + {"Hash", Type, 14}, + {"MakeSeed", Func, 14}, + {"Seed", Type, 14}, + {"String", Func, 19}, + }, + "html": { + {"EscapeString", Func, 0}, + {"UnescapeString", Func, 0}, + }, + "html/template": { + {"(*Error).Error", Method, 0}, + {"(*Template).AddParseTree", Method, 0}, + {"(*Template).Clone", Method, 0}, + {"(*Template).DefinedTemplates", Method, 6}, + {"(*Template).Delims", Method, 0}, + {"(*Template).Execute", Method, 0}, + {"(*Template).ExecuteTemplate", Method, 0}, + {"(*Template).Funcs", Method, 0}, + {"(*Template).Lookup", Method, 0}, + {"(*Template).Name", Method, 0}, + {"(*Template).New", Method, 0}, + {"(*Template).Option", Method, 5}, + {"(*Template).Parse", Method, 0}, + {"(*Template).ParseFS", Method, 16}, + {"(*Template).ParseFiles", Method, 0}, + {"(*Template).ParseGlob", Method, 0}, + {"(*Template).Templates", Method, 0}, + {"CSS", Type, 0}, + {"ErrAmbigContext", Const, 0}, + {"ErrBadHTML", Const, 0}, + {"ErrBranchEnd", Const, 0}, + {"ErrEndContext", Const, 0}, + {"ErrJSTemplate", Const, 21}, + {"ErrNoSuchTemplate", Const, 0}, + {"ErrOutputContext", Const, 0}, + {"ErrPartialCharset", Const, 0}, + {"ErrPartialEscape", Const, 0}, + {"ErrPredefinedEscaper", Const, 9}, + {"ErrRangeLoopReentry", Const, 0}, + {"ErrSlashAmbig", Const, 0}, + {"Error", Type, 0}, + {"Error.Description", Field, 0}, + {"Error.ErrorCode", Field, 0}, + {"Error.Line", Field, 0}, + {"Error.Name", Field, 0}, + {"Error.Node", Field, 4}, + {"ErrorCode", Type, 0}, + {"FuncMap", Type, 0}, + {"HTML", Type, 0}, + {"HTMLAttr", Type, 0}, + {"HTMLEscape", Func, 0}, + {"HTMLEscapeString", Func, 0}, + {"HTMLEscaper", Func, 0}, + {"IsTrue", Func, 6}, + {"JS", Type, 0}, + {"JSEscape", Func, 0}, + {"JSEscapeString", Func, 0}, + {"JSEscaper", Func, 0}, + {"JSStr", Type, 0}, + {"Must", Func, 0}, + {"New", Func, 0}, + {"OK", Const, 0}, + {"ParseFS", Func, 16}, + {"ParseFiles", Func, 0}, + {"ParseGlob", Func, 0}, + {"Srcset", Type, 10}, + {"Template", Type, 0}, + {"Template.Tree", Field, 2}, + {"URL", Type, 0}, + {"URLQueryEscaper", Func, 0}, + }, + "image": { + {"(*Alpha).AlphaAt", Method, 4}, + {"(*Alpha).At", Method, 0}, + {"(*Alpha).Bounds", Method, 0}, + {"(*Alpha).ColorModel", Method, 0}, + {"(*Alpha).Opaque", Method, 0}, + {"(*Alpha).PixOffset", Method, 0}, + {"(*Alpha).RGBA64At", Method, 17}, + {"(*Alpha).Set", Method, 0}, + {"(*Alpha).SetAlpha", Method, 0}, + {"(*Alpha).SetRGBA64", Method, 17}, + {"(*Alpha).SubImage", Method, 0}, + {"(*Alpha16).Alpha16At", Method, 4}, + {"(*Alpha16).At", Method, 0}, + {"(*Alpha16).Bounds", Method, 0}, + {"(*Alpha16).ColorModel", Method, 0}, + {"(*Alpha16).Opaque", Method, 0}, + {"(*Alpha16).PixOffset", Method, 0}, + {"(*Alpha16).RGBA64At", Method, 17}, + {"(*Alpha16).Set", Method, 0}, + {"(*Alpha16).SetAlpha16", Method, 0}, + {"(*Alpha16).SetRGBA64", Method, 17}, + {"(*Alpha16).SubImage", Method, 0}, + {"(*CMYK).At", Method, 5}, + {"(*CMYK).Bounds", Method, 5}, + {"(*CMYK).CMYKAt", Method, 5}, + {"(*CMYK).ColorModel", Method, 5}, + {"(*CMYK).Opaque", Method, 5}, + {"(*CMYK).PixOffset", Method, 5}, + {"(*CMYK).RGBA64At", Method, 17}, + {"(*CMYK).Set", Method, 5}, + {"(*CMYK).SetCMYK", Method, 5}, + {"(*CMYK).SetRGBA64", Method, 17}, + {"(*CMYK).SubImage", Method, 5}, + {"(*Gray).At", Method, 0}, + {"(*Gray).Bounds", Method, 0}, + {"(*Gray).ColorModel", Method, 0}, + {"(*Gray).GrayAt", Method, 4}, + {"(*Gray).Opaque", Method, 0}, + {"(*Gray).PixOffset", Method, 0}, + {"(*Gray).RGBA64At", Method, 17}, + {"(*Gray).Set", Method, 0}, + {"(*Gray).SetGray", Method, 0}, + {"(*Gray).SetRGBA64", Method, 17}, + {"(*Gray).SubImage", Method, 0}, + {"(*Gray16).At", Method, 0}, + {"(*Gray16).Bounds", Method, 0}, + {"(*Gray16).ColorModel", Method, 0}, + {"(*Gray16).Gray16At", Method, 4}, + {"(*Gray16).Opaque", Method, 0}, + {"(*Gray16).PixOffset", Method, 0}, + {"(*Gray16).RGBA64At", Method, 17}, + {"(*Gray16).Set", Method, 0}, + {"(*Gray16).SetGray16", Method, 0}, + {"(*Gray16).SetRGBA64", Method, 17}, + {"(*Gray16).SubImage", Method, 0}, + {"(*NRGBA).At", Method, 0}, + {"(*NRGBA).Bounds", Method, 0}, + {"(*NRGBA).ColorModel", Method, 0}, + {"(*NRGBA).NRGBAAt", Method, 4}, + {"(*NRGBA).Opaque", Method, 0}, + {"(*NRGBA).PixOffset", Method, 0}, + {"(*NRGBA).RGBA64At", Method, 17}, + {"(*NRGBA).Set", Method, 0}, + {"(*NRGBA).SetNRGBA", Method, 0}, + {"(*NRGBA).SetRGBA64", Method, 17}, + {"(*NRGBA).SubImage", Method, 0}, + {"(*NRGBA64).At", Method, 0}, + {"(*NRGBA64).Bounds", Method, 0}, + {"(*NRGBA64).ColorModel", Method, 0}, + {"(*NRGBA64).NRGBA64At", Method, 4}, + {"(*NRGBA64).Opaque", Method, 0}, + {"(*NRGBA64).PixOffset", Method, 0}, + {"(*NRGBA64).RGBA64At", Method, 17}, + {"(*NRGBA64).Set", Method, 0}, + {"(*NRGBA64).SetNRGBA64", Method, 0}, + {"(*NRGBA64).SetRGBA64", Method, 17}, + {"(*NRGBA64).SubImage", Method, 0}, + {"(*NYCbCrA).AOffset", Method, 6}, + {"(*NYCbCrA).At", Method, 6}, + {"(*NYCbCrA).Bounds", Method, 6}, + {"(*NYCbCrA).COffset", Method, 6}, + {"(*NYCbCrA).ColorModel", Method, 6}, + {"(*NYCbCrA).NYCbCrAAt", Method, 6}, + {"(*NYCbCrA).Opaque", Method, 6}, + {"(*NYCbCrA).RGBA64At", Method, 17}, + {"(*NYCbCrA).SubImage", Method, 6}, + {"(*NYCbCrA).YCbCrAt", Method, 6}, + {"(*NYCbCrA).YOffset", Method, 6}, + {"(*Paletted).At", Method, 0}, + {"(*Paletted).Bounds", Method, 0}, + {"(*Paletted).ColorIndexAt", Method, 0}, + {"(*Paletted).ColorModel", Method, 0}, + {"(*Paletted).Opaque", Method, 0}, + {"(*Paletted).PixOffset", Method, 0}, + {"(*Paletted).RGBA64At", Method, 17}, + {"(*Paletted).Set", Method, 0}, + {"(*Paletted).SetColorIndex", Method, 0}, + {"(*Paletted).SetRGBA64", Method, 17}, + {"(*Paletted).SubImage", Method, 0}, + {"(*RGBA).At", Method, 0}, + {"(*RGBA).Bounds", Method, 0}, + {"(*RGBA).ColorModel", Method, 0}, + {"(*RGBA).Opaque", Method, 0}, + {"(*RGBA).PixOffset", Method, 0}, + {"(*RGBA).RGBA64At", Method, 17}, + {"(*RGBA).RGBAAt", Method, 4}, + {"(*RGBA).Set", Method, 0}, + {"(*RGBA).SetRGBA", Method, 0}, + {"(*RGBA).SetRGBA64", Method, 17}, + {"(*RGBA).SubImage", Method, 0}, + {"(*RGBA64).At", Method, 0}, + {"(*RGBA64).Bounds", Method, 0}, + {"(*RGBA64).ColorModel", Method, 0}, + {"(*RGBA64).Opaque", Method, 0}, + {"(*RGBA64).PixOffset", Method, 0}, + {"(*RGBA64).RGBA64At", Method, 4}, + {"(*RGBA64).Set", Method, 0}, + {"(*RGBA64).SetRGBA64", Method, 0}, + {"(*RGBA64).SubImage", Method, 0}, + {"(*Uniform).At", Method, 0}, + {"(*Uniform).Bounds", Method, 0}, + {"(*Uniform).ColorModel", Method, 0}, + {"(*Uniform).Convert", Method, 0}, + {"(*Uniform).Opaque", Method, 0}, + {"(*Uniform).RGBA", Method, 0}, + {"(*Uniform).RGBA64At", Method, 17}, + {"(*YCbCr).At", Method, 0}, + {"(*YCbCr).Bounds", Method, 0}, + {"(*YCbCr).COffset", Method, 0}, + {"(*YCbCr).ColorModel", Method, 0}, + {"(*YCbCr).Opaque", Method, 0}, + {"(*YCbCr).RGBA64At", Method, 17}, + {"(*YCbCr).SubImage", Method, 0}, + {"(*YCbCr).YCbCrAt", Method, 4}, + {"(*YCbCr).YOffset", Method, 0}, + {"(Point).Add", Method, 0}, + {"(Point).Div", Method, 0}, + {"(Point).Eq", Method, 0}, + {"(Point).In", Method, 0}, + {"(Point).Mod", Method, 0}, + {"(Point).Mul", Method, 0}, + {"(Point).String", Method, 0}, + {"(Point).Sub", Method, 0}, + {"(Rectangle).Add", Method, 0}, + {"(Rectangle).At", Method, 5}, + {"(Rectangle).Bounds", Method, 5}, + {"(Rectangle).Canon", Method, 0}, + {"(Rectangle).ColorModel", Method, 5}, + {"(Rectangle).Dx", Method, 0}, + {"(Rectangle).Dy", Method, 0}, + {"(Rectangle).Empty", Method, 0}, + {"(Rectangle).Eq", Method, 0}, + {"(Rectangle).In", Method, 0}, + {"(Rectangle).Inset", Method, 0}, + {"(Rectangle).Intersect", Method, 0}, + {"(Rectangle).Overlaps", Method, 0}, + {"(Rectangle).RGBA64At", Method, 17}, + {"(Rectangle).Size", Method, 0}, + {"(Rectangle).String", Method, 0}, + {"(Rectangle).Sub", Method, 0}, + {"(Rectangle).Union", Method, 0}, + {"(YCbCrSubsampleRatio).String", Method, 0}, + {"Alpha", Type, 0}, + {"Alpha.Pix", Field, 0}, + {"Alpha.Rect", Field, 0}, + {"Alpha.Stride", Field, 0}, + {"Alpha16", Type, 0}, + {"Alpha16.Pix", Field, 0}, + {"Alpha16.Rect", Field, 0}, + {"Alpha16.Stride", Field, 0}, + {"Black", Var, 0}, + {"CMYK", Type, 5}, + {"CMYK.Pix", Field, 5}, + {"CMYK.Rect", Field, 5}, + {"CMYK.Stride", Field, 5}, + {"Config", Type, 0}, + {"Config.ColorModel", Field, 0}, + {"Config.Height", Field, 0}, + {"Config.Width", Field, 0}, + {"Decode", Func, 0}, + {"DecodeConfig", Func, 0}, + {"ErrFormat", Var, 0}, + {"Gray", Type, 0}, + {"Gray.Pix", Field, 0}, + {"Gray.Rect", Field, 0}, + {"Gray.Stride", Field, 0}, + {"Gray16", Type, 0}, + {"Gray16.Pix", Field, 0}, + {"Gray16.Rect", Field, 0}, + {"Gray16.Stride", Field, 0}, + {"Image", Type, 0}, + {"NRGBA", Type, 0}, + {"NRGBA.Pix", Field, 0}, + {"NRGBA.Rect", Field, 0}, + {"NRGBA.Stride", Field, 0}, + {"NRGBA64", Type, 0}, + {"NRGBA64.Pix", Field, 0}, + {"NRGBA64.Rect", Field, 0}, + {"NRGBA64.Stride", Field, 0}, + {"NYCbCrA", Type, 6}, + {"NYCbCrA.A", Field, 6}, + {"NYCbCrA.AStride", Field, 6}, + {"NYCbCrA.YCbCr", Field, 6}, + {"NewAlpha", Func, 0}, + {"NewAlpha16", Func, 0}, + {"NewCMYK", Func, 5}, + {"NewGray", Func, 0}, + {"NewGray16", Func, 0}, + {"NewNRGBA", Func, 0}, + {"NewNRGBA64", Func, 0}, + {"NewNYCbCrA", Func, 6}, + {"NewPaletted", Func, 0}, + {"NewRGBA", Func, 0}, + {"NewRGBA64", Func, 0}, + {"NewUniform", Func, 0}, + {"NewYCbCr", Func, 0}, + {"Opaque", Var, 0}, + {"Paletted", Type, 0}, + {"Paletted.Palette", Field, 0}, + {"Paletted.Pix", Field, 0}, + {"Paletted.Rect", Field, 0}, + {"Paletted.Stride", Field, 0}, + {"PalettedImage", Type, 0}, + {"Point", Type, 0}, + {"Point.X", Field, 0}, + {"Point.Y", Field, 0}, + {"Pt", Func, 0}, + {"RGBA", Type, 0}, + {"RGBA.Pix", Field, 0}, + {"RGBA.Rect", Field, 0}, + {"RGBA.Stride", Field, 0}, + {"RGBA64", Type, 0}, + {"RGBA64.Pix", Field, 0}, + {"RGBA64.Rect", Field, 0}, + {"RGBA64.Stride", Field, 0}, + {"RGBA64Image", Type, 17}, + {"Rect", Func, 0}, + {"Rectangle", Type, 0}, + {"Rectangle.Max", Field, 0}, + {"Rectangle.Min", Field, 0}, + {"RegisterFormat", Func, 0}, + {"Transparent", Var, 0}, + {"Uniform", Type, 0}, + {"Uniform.C", Field, 0}, + {"White", Var, 0}, + {"YCbCr", Type, 0}, + {"YCbCr.CStride", Field, 0}, + {"YCbCr.Cb", Field, 0}, + {"YCbCr.Cr", Field, 0}, + {"YCbCr.Rect", Field, 0}, + {"YCbCr.SubsampleRatio", Field, 0}, + {"YCbCr.Y", Field, 0}, + {"YCbCr.YStride", Field, 0}, + {"YCbCrSubsampleRatio", Type, 0}, + {"YCbCrSubsampleRatio410", Const, 5}, + {"YCbCrSubsampleRatio411", Const, 5}, + {"YCbCrSubsampleRatio420", Const, 0}, + {"YCbCrSubsampleRatio422", Const, 0}, + {"YCbCrSubsampleRatio440", Const, 1}, + {"YCbCrSubsampleRatio444", Const, 0}, + {"ZP", Var, 0}, + {"ZR", Var, 0}, + }, + "image/color": { + {"(Alpha).RGBA", Method, 0}, + {"(Alpha16).RGBA", Method, 0}, + {"(CMYK).RGBA", Method, 5}, + {"(Gray).RGBA", Method, 0}, + {"(Gray16).RGBA", Method, 0}, + {"(NRGBA).RGBA", Method, 0}, + {"(NRGBA64).RGBA", Method, 0}, + {"(NYCbCrA).RGBA", Method, 6}, + {"(Palette).Convert", Method, 0}, + {"(Palette).Index", Method, 0}, + {"(RGBA).RGBA", Method, 0}, + {"(RGBA64).RGBA", Method, 0}, + {"(YCbCr).RGBA", Method, 0}, + {"Alpha", Type, 0}, + {"Alpha.A", Field, 0}, + {"Alpha16", Type, 0}, + {"Alpha16.A", Field, 0}, + {"Alpha16Model", Var, 0}, + {"AlphaModel", Var, 0}, + {"Black", Var, 0}, + {"CMYK", Type, 5}, + {"CMYK.C", Field, 5}, + {"CMYK.K", Field, 5}, + {"CMYK.M", Field, 5}, + {"CMYK.Y", Field, 5}, + {"CMYKModel", Var, 5}, + {"CMYKToRGB", Func, 5}, + {"Color", Type, 0}, + {"Gray", Type, 0}, + {"Gray.Y", Field, 0}, + {"Gray16", Type, 0}, + {"Gray16.Y", Field, 0}, + {"Gray16Model", Var, 0}, + {"GrayModel", Var, 0}, + {"Model", Type, 0}, + {"ModelFunc", Func, 0}, + {"NRGBA", Type, 0}, + {"NRGBA.A", Field, 0}, + {"NRGBA.B", Field, 0}, + {"NRGBA.G", Field, 0}, + {"NRGBA.R", Field, 0}, + {"NRGBA64", Type, 0}, + {"NRGBA64.A", Field, 0}, + {"NRGBA64.B", Field, 0}, + {"NRGBA64.G", Field, 0}, + {"NRGBA64.R", Field, 0}, + {"NRGBA64Model", Var, 0}, + {"NRGBAModel", Var, 0}, + {"NYCbCrA", Type, 6}, + {"NYCbCrA.A", Field, 6}, + {"NYCbCrA.YCbCr", Field, 6}, + {"NYCbCrAModel", Var, 6}, + {"Opaque", Var, 0}, + {"Palette", Type, 0}, + {"RGBA", Type, 0}, + {"RGBA.A", Field, 0}, + {"RGBA.B", Field, 0}, + {"RGBA.G", Field, 0}, + {"RGBA.R", Field, 0}, + {"RGBA64", Type, 0}, + {"RGBA64.A", Field, 0}, + {"RGBA64.B", Field, 0}, + {"RGBA64.G", Field, 0}, + {"RGBA64.R", Field, 0}, + {"RGBA64Model", Var, 0}, + {"RGBAModel", Var, 0}, + {"RGBToCMYK", Func, 5}, + {"RGBToYCbCr", Func, 0}, + {"Transparent", Var, 0}, + {"White", Var, 0}, + {"YCbCr", Type, 0}, + {"YCbCr.Cb", Field, 0}, + {"YCbCr.Cr", Field, 0}, + {"YCbCr.Y", Field, 0}, + {"YCbCrModel", Var, 0}, + {"YCbCrToRGB", Func, 0}, + }, + "image/color/palette": { + {"Plan9", Var, 2}, + {"WebSafe", Var, 2}, + }, + "image/draw": { + {"(Op).Draw", Method, 2}, + {"Draw", Func, 0}, + {"DrawMask", Func, 0}, + {"Drawer", Type, 2}, + {"FloydSteinberg", Var, 2}, + {"Image", Type, 0}, + {"Op", Type, 0}, + {"Over", Const, 0}, + {"Quantizer", Type, 2}, + {"RGBA64Image", Type, 17}, + {"Src", Const, 0}, + }, + "image/gif": { + {"Decode", Func, 0}, + {"DecodeAll", Func, 0}, + {"DecodeConfig", Func, 0}, + {"DisposalBackground", Const, 5}, + {"DisposalNone", Const, 5}, + {"DisposalPrevious", Const, 5}, + {"Encode", Func, 2}, + {"EncodeAll", Func, 2}, + {"GIF", Type, 0}, + {"GIF.BackgroundIndex", Field, 5}, + {"GIF.Config", Field, 5}, + {"GIF.Delay", Field, 0}, + {"GIF.Disposal", Field, 5}, + {"GIF.Image", Field, 0}, + {"GIF.LoopCount", Field, 0}, + {"Options", Type, 2}, + {"Options.Drawer", Field, 2}, + {"Options.NumColors", Field, 2}, + {"Options.Quantizer", Field, 2}, + }, + "image/jpeg": { + {"(FormatError).Error", Method, 0}, + {"(UnsupportedError).Error", Method, 0}, + {"Decode", Func, 0}, + {"DecodeConfig", Func, 0}, + {"DefaultQuality", Const, 0}, + {"Encode", Func, 0}, + {"FormatError", Type, 0}, + {"Options", Type, 0}, + {"Options.Quality", Field, 0}, + {"Reader", Type, 0}, + {"UnsupportedError", Type, 0}, + }, + "image/png": { + {"(*Encoder).Encode", Method, 4}, + {"(FormatError).Error", Method, 0}, + {"(UnsupportedError).Error", Method, 0}, + {"BestCompression", Const, 4}, + {"BestSpeed", Const, 4}, + {"CompressionLevel", Type, 4}, + {"Decode", Func, 0}, + {"DecodeConfig", Func, 0}, + {"DefaultCompression", Const, 4}, + {"Encode", Func, 0}, + {"Encoder", Type, 4}, + {"Encoder.BufferPool", Field, 9}, + {"Encoder.CompressionLevel", Field, 4}, + {"EncoderBuffer", Type, 9}, + {"EncoderBufferPool", Type, 9}, + {"FormatError", Type, 0}, + {"NoCompression", Const, 4}, + {"UnsupportedError", Type, 0}, + }, + "index/suffixarray": { + {"(*Index).Bytes", Method, 0}, + {"(*Index).FindAllIndex", Method, 0}, + {"(*Index).Lookup", Method, 0}, + {"(*Index).Read", Method, 0}, + {"(*Index).Write", Method, 0}, + {"Index", Type, 0}, + {"New", Func, 0}, + }, + "io": { + {"(*LimitedReader).Read", Method, 0}, + {"(*OffsetWriter).Seek", Method, 20}, + {"(*OffsetWriter).Write", Method, 20}, + {"(*OffsetWriter).WriteAt", Method, 20}, + {"(*PipeReader).Close", Method, 0}, + {"(*PipeReader).CloseWithError", Method, 0}, + {"(*PipeReader).Read", Method, 0}, + {"(*PipeWriter).Close", Method, 0}, + {"(*PipeWriter).CloseWithError", Method, 0}, + {"(*PipeWriter).Write", Method, 0}, + {"(*SectionReader).Outer", Method, 22}, + {"(*SectionReader).Read", Method, 0}, + {"(*SectionReader).ReadAt", Method, 0}, + {"(*SectionReader).Seek", Method, 0}, + {"(*SectionReader).Size", Method, 0}, + {"ByteReader", Type, 0}, + {"ByteScanner", Type, 0}, + {"ByteWriter", Type, 1}, + {"Closer", Type, 0}, + {"Copy", Func, 0}, + {"CopyBuffer", Func, 5}, + {"CopyN", Func, 0}, + {"Discard", Var, 16}, + {"EOF", Var, 0}, + {"ErrClosedPipe", Var, 0}, + {"ErrNoProgress", Var, 1}, + {"ErrShortBuffer", Var, 0}, + {"ErrShortWrite", Var, 0}, + {"ErrUnexpectedEOF", Var, 0}, + {"LimitReader", Func, 0}, + {"LimitedReader", Type, 0}, + {"LimitedReader.N", Field, 0}, + {"LimitedReader.R", Field, 0}, + {"MultiReader", Func, 0}, + {"MultiWriter", Func, 0}, + {"NewOffsetWriter", Func, 20}, + {"NewSectionReader", Func, 0}, + {"NopCloser", Func, 16}, + {"OffsetWriter", Type, 20}, + {"Pipe", Func, 0}, + {"PipeReader", Type, 0}, + {"PipeWriter", Type, 0}, + {"ReadAll", Func, 16}, + {"ReadAtLeast", Func, 0}, + {"ReadCloser", Type, 0}, + {"ReadFull", Func, 0}, + {"ReadSeekCloser", Type, 16}, + {"ReadSeeker", Type, 0}, + {"ReadWriteCloser", Type, 0}, + {"ReadWriteSeeker", Type, 0}, + {"ReadWriter", Type, 0}, + {"Reader", Type, 0}, + {"ReaderAt", Type, 0}, + {"ReaderFrom", Type, 0}, + {"RuneReader", Type, 0}, + {"RuneScanner", Type, 0}, + {"SectionReader", Type, 0}, + {"SeekCurrent", Const, 7}, + {"SeekEnd", Const, 7}, + {"SeekStart", Const, 7}, + {"Seeker", Type, 0}, + {"StringWriter", Type, 12}, + {"TeeReader", Func, 0}, + {"WriteCloser", Type, 0}, + {"WriteSeeker", Type, 0}, + {"WriteString", Func, 0}, + {"Writer", Type, 0}, + {"WriterAt", Type, 0}, + {"WriterTo", Type, 0}, + }, + "io/fs": { + {"(*PathError).Error", Method, 16}, + {"(*PathError).Timeout", Method, 16}, + {"(*PathError).Unwrap", Method, 16}, + {"(FileMode).IsDir", Method, 16}, + {"(FileMode).IsRegular", Method, 16}, + {"(FileMode).Perm", Method, 16}, + {"(FileMode).String", Method, 16}, + {"(FileMode).Type", Method, 16}, + {"DirEntry", Type, 16}, + {"ErrClosed", Var, 16}, + {"ErrExist", Var, 16}, + {"ErrInvalid", Var, 16}, + {"ErrNotExist", Var, 16}, + {"ErrPermission", Var, 16}, + {"FS", Type, 16}, + {"File", Type, 16}, + {"FileInfo", Type, 16}, + {"FileInfoToDirEntry", Func, 17}, + {"FileMode", Type, 16}, + {"FormatDirEntry", Func, 21}, + {"FormatFileInfo", Func, 21}, + {"Glob", Func, 16}, + {"GlobFS", Type, 16}, + {"ModeAppend", Const, 16}, + {"ModeCharDevice", Const, 16}, + {"ModeDevice", Const, 16}, + {"ModeDir", Const, 16}, + {"ModeExclusive", Const, 16}, + {"ModeIrregular", Const, 16}, + {"ModeNamedPipe", Const, 16}, + {"ModePerm", Const, 16}, + {"ModeSetgid", Const, 16}, + {"ModeSetuid", Const, 16}, + {"ModeSocket", Const, 16}, + {"ModeSticky", Const, 16}, + {"ModeSymlink", Const, 16}, + {"ModeTemporary", Const, 16}, + {"ModeType", Const, 16}, + {"PathError", Type, 16}, + {"PathError.Err", Field, 16}, + {"PathError.Op", Field, 16}, + {"PathError.Path", Field, 16}, + {"ReadDir", Func, 16}, + {"ReadDirFS", Type, 16}, + {"ReadDirFile", Type, 16}, + {"ReadFile", Func, 16}, + {"ReadFileFS", Type, 16}, + {"SkipAll", Var, 20}, + {"SkipDir", Var, 16}, + {"Stat", Func, 16}, + {"StatFS", Type, 16}, + {"Sub", Func, 16}, + {"SubFS", Type, 16}, + {"ValidPath", Func, 16}, + {"WalkDir", Func, 16}, + {"WalkDirFunc", Type, 16}, + }, + "io/ioutil": { + {"Discard", Var, 0}, + {"NopCloser", Func, 0}, + {"ReadAll", Func, 0}, + {"ReadDir", Func, 0}, + {"ReadFile", Func, 0}, + {"TempDir", Func, 0}, + {"TempFile", Func, 0}, + {"WriteFile", Func, 0}, + }, + "iter": { + {"Pull", Func, 23}, + {"Pull2", Func, 23}, + {"Seq", Type, 23}, + {"Seq2", Type, 23}, + }, + "log": { + {"(*Logger).Fatal", Method, 0}, + {"(*Logger).Fatalf", Method, 0}, + {"(*Logger).Fatalln", Method, 0}, + {"(*Logger).Flags", Method, 0}, + {"(*Logger).Output", Method, 0}, + {"(*Logger).Panic", Method, 0}, + {"(*Logger).Panicf", Method, 0}, + {"(*Logger).Panicln", Method, 0}, + {"(*Logger).Prefix", Method, 0}, + {"(*Logger).Print", Method, 0}, + {"(*Logger).Printf", Method, 0}, + {"(*Logger).Println", Method, 0}, + {"(*Logger).SetFlags", Method, 0}, + {"(*Logger).SetOutput", Method, 5}, + {"(*Logger).SetPrefix", Method, 0}, + {"(*Logger).Writer", Method, 12}, + {"Default", Func, 16}, + {"Fatal", Func, 0}, + {"Fatalf", Func, 0}, + {"Fatalln", Func, 0}, + {"Flags", Func, 0}, + {"LUTC", Const, 5}, + {"Ldate", Const, 0}, + {"Llongfile", Const, 0}, + {"Lmicroseconds", Const, 0}, + {"Lmsgprefix", Const, 14}, + {"Logger", Type, 0}, + {"Lshortfile", Const, 0}, + {"LstdFlags", Const, 0}, + {"Ltime", Const, 0}, + {"New", Func, 0}, + {"Output", Func, 5}, + {"Panic", Func, 0}, + {"Panicf", Func, 0}, + {"Panicln", Func, 0}, + {"Prefix", Func, 0}, + {"Print", Func, 0}, + {"Printf", Func, 0}, + {"Println", Func, 0}, + {"SetFlags", Func, 0}, + {"SetOutput", Func, 0}, + {"SetPrefix", Func, 0}, + {"Writer", Func, 13}, + }, + "log/slog": { + {"(*JSONHandler).Enabled", Method, 21}, + {"(*JSONHandler).Handle", Method, 21}, + {"(*JSONHandler).WithAttrs", Method, 21}, + {"(*JSONHandler).WithGroup", Method, 21}, + {"(*Level).UnmarshalJSON", Method, 21}, + {"(*Level).UnmarshalText", Method, 21}, + {"(*LevelVar).Level", Method, 21}, + {"(*LevelVar).MarshalText", Method, 21}, + {"(*LevelVar).Set", Method, 21}, + {"(*LevelVar).String", Method, 21}, + {"(*LevelVar).UnmarshalText", Method, 21}, + {"(*Logger).Debug", Method, 21}, + {"(*Logger).DebugContext", Method, 21}, + {"(*Logger).Enabled", Method, 21}, + {"(*Logger).Error", Method, 21}, + {"(*Logger).ErrorContext", Method, 21}, + {"(*Logger).Handler", Method, 21}, + {"(*Logger).Info", Method, 21}, + {"(*Logger).InfoContext", Method, 21}, + {"(*Logger).Log", Method, 21}, + {"(*Logger).LogAttrs", Method, 21}, + {"(*Logger).Warn", Method, 21}, + {"(*Logger).WarnContext", Method, 21}, + {"(*Logger).With", Method, 21}, + {"(*Logger).WithGroup", Method, 21}, + {"(*Record).Add", Method, 21}, + {"(*Record).AddAttrs", Method, 21}, + {"(*TextHandler).Enabled", Method, 21}, + {"(*TextHandler).Handle", Method, 21}, + {"(*TextHandler).WithAttrs", Method, 21}, + {"(*TextHandler).WithGroup", Method, 21}, + {"(Attr).Equal", Method, 21}, + {"(Attr).String", Method, 21}, + {"(Kind).String", Method, 21}, + {"(Level).Level", Method, 21}, + {"(Level).MarshalJSON", Method, 21}, + {"(Level).MarshalText", Method, 21}, + {"(Level).String", Method, 21}, + {"(Record).Attrs", Method, 21}, + {"(Record).Clone", Method, 21}, + {"(Record).NumAttrs", Method, 21}, + {"(Value).Any", Method, 21}, + {"(Value).Bool", Method, 21}, + {"(Value).Duration", Method, 21}, + {"(Value).Equal", Method, 21}, + {"(Value).Float64", Method, 21}, + {"(Value).Group", Method, 21}, + {"(Value).Int64", Method, 21}, + {"(Value).Kind", Method, 21}, + {"(Value).LogValuer", Method, 21}, + {"(Value).Resolve", Method, 21}, + {"(Value).String", Method, 21}, + {"(Value).Time", Method, 21}, + {"(Value).Uint64", Method, 21}, + {"Any", Func, 21}, + {"AnyValue", Func, 21}, + {"Attr", Type, 21}, + {"Attr.Key", Field, 21}, + {"Attr.Value", Field, 21}, + {"Bool", Func, 21}, + {"BoolValue", Func, 21}, + {"Debug", Func, 21}, + {"DebugContext", Func, 21}, + {"Default", Func, 21}, + {"Duration", Func, 21}, + {"DurationValue", Func, 21}, + {"Error", Func, 21}, + {"ErrorContext", Func, 21}, + {"Float64", Func, 21}, + {"Float64Value", Func, 21}, + {"Group", Func, 21}, + {"GroupValue", Func, 21}, + {"Handler", Type, 21}, + {"HandlerOptions", Type, 21}, + {"HandlerOptions.AddSource", Field, 21}, + {"HandlerOptions.Level", Field, 21}, + {"HandlerOptions.ReplaceAttr", Field, 21}, + {"Info", Func, 21}, + {"InfoContext", Func, 21}, + {"Int", Func, 21}, + {"Int64", Func, 21}, + {"Int64Value", Func, 21}, + {"IntValue", Func, 21}, + {"JSONHandler", Type, 21}, + {"Kind", Type, 21}, + {"KindAny", Const, 21}, + {"KindBool", Const, 21}, + {"KindDuration", Const, 21}, + {"KindFloat64", Const, 21}, + {"KindGroup", Const, 21}, + {"KindInt64", Const, 21}, + {"KindLogValuer", Const, 21}, + {"KindString", Const, 21}, + {"KindTime", Const, 21}, + {"KindUint64", Const, 21}, + {"Level", Type, 21}, + {"LevelDebug", Const, 21}, + {"LevelError", Const, 21}, + {"LevelInfo", Const, 21}, + {"LevelKey", Const, 21}, + {"LevelVar", Type, 21}, + {"LevelWarn", Const, 21}, + {"Leveler", Type, 21}, + {"Log", Func, 21}, + {"LogAttrs", Func, 21}, + {"LogValuer", Type, 21}, + {"Logger", Type, 21}, + {"MessageKey", Const, 21}, + {"New", Func, 21}, + {"NewJSONHandler", Func, 21}, + {"NewLogLogger", Func, 21}, + {"NewRecord", Func, 21}, + {"NewTextHandler", Func, 21}, + {"Record", Type, 21}, + {"Record.Level", Field, 21}, + {"Record.Message", Field, 21}, + {"Record.PC", Field, 21}, + {"Record.Time", Field, 21}, + {"SetDefault", Func, 21}, + {"SetLogLoggerLevel", Func, 22}, + {"Source", Type, 21}, + {"Source.File", Field, 21}, + {"Source.Function", Field, 21}, + {"Source.Line", Field, 21}, + {"SourceKey", Const, 21}, + {"String", Func, 21}, + {"StringValue", Func, 21}, + {"TextHandler", Type, 21}, + {"Time", Func, 21}, + {"TimeKey", Const, 21}, + {"TimeValue", Func, 21}, + {"Uint64", Func, 21}, + {"Uint64Value", Func, 21}, + {"Value", Type, 21}, + {"Warn", Func, 21}, + {"WarnContext", Func, 21}, + {"With", Func, 21}, + }, + "log/syslog": { + {"(*Writer).Alert", Method, 0}, + {"(*Writer).Close", Method, 0}, + {"(*Writer).Crit", Method, 0}, + {"(*Writer).Debug", Method, 0}, + {"(*Writer).Emerg", Method, 0}, + {"(*Writer).Err", Method, 0}, + {"(*Writer).Info", Method, 0}, + {"(*Writer).Notice", Method, 0}, + {"(*Writer).Warning", Method, 0}, + {"(*Writer).Write", Method, 0}, + {"Dial", Func, 0}, + {"LOG_ALERT", Const, 0}, + {"LOG_AUTH", Const, 1}, + {"LOG_AUTHPRIV", Const, 1}, + {"LOG_CRIT", Const, 0}, + {"LOG_CRON", Const, 1}, + {"LOG_DAEMON", Const, 1}, + {"LOG_DEBUG", Const, 0}, + {"LOG_EMERG", Const, 0}, + {"LOG_ERR", Const, 0}, + {"LOG_FTP", Const, 1}, + {"LOG_INFO", Const, 0}, + {"LOG_KERN", Const, 1}, + {"LOG_LOCAL0", Const, 1}, + {"LOG_LOCAL1", Const, 1}, + {"LOG_LOCAL2", Const, 1}, + {"LOG_LOCAL3", Const, 1}, + {"LOG_LOCAL4", Const, 1}, + {"LOG_LOCAL5", Const, 1}, + {"LOG_LOCAL6", Const, 1}, + {"LOG_LOCAL7", Const, 1}, + {"LOG_LPR", Const, 1}, + {"LOG_MAIL", Const, 1}, + {"LOG_NEWS", Const, 1}, + {"LOG_NOTICE", Const, 0}, + {"LOG_SYSLOG", Const, 1}, + {"LOG_USER", Const, 1}, + {"LOG_UUCP", Const, 1}, + {"LOG_WARNING", Const, 0}, + {"New", Func, 0}, + {"NewLogger", Func, 0}, + {"Priority", Type, 0}, + {"Writer", Type, 0}, + }, + "maps": { + {"All", Func, 23}, + {"Clone", Func, 21}, + {"Collect", Func, 23}, + {"Copy", Func, 21}, + {"DeleteFunc", Func, 21}, + {"Equal", Func, 21}, + {"EqualFunc", Func, 21}, + {"Insert", Func, 23}, + {"Keys", Func, 23}, + {"Values", Func, 23}, + }, + "math": { + {"Abs", Func, 0}, + {"Acos", Func, 0}, + {"Acosh", Func, 0}, + {"Asin", Func, 0}, + {"Asinh", Func, 0}, + {"Atan", Func, 0}, + {"Atan2", Func, 0}, + {"Atanh", Func, 0}, + {"Cbrt", Func, 0}, + {"Ceil", Func, 0}, + {"Copysign", Func, 0}, + {"Cos", Func, 0}, + {"Cosh", Func, 0}, + {"Dim", Func, 0}, + {"E", Const, 0}, + {"Erf", Func, 0}, + {"Erfc", Func, 0}, + {"Erfcinv", Func, 10}, + {"Erfinv", Func, 10}, + {"Exp", Func, 0}, + {"Exp2", Func, 0}, + {"Expm1", Func, 0}, + {"FMA", Func, 14}, + {"Float32bits", Func, 0}, + {"Float32frombits", Func, 0}, + {"Float64bits", Func, 0}, + {"Float64frombits", Func, 0}, + {"Floor", Func, 0}, + {"Frexp", Func, 0}, + {"Gamma", Func, 0}, + {"Hypot", Func, 0}, + {"Ilogb", Func, 0}, + {"Inf", Func, 0}, + {"IsInf", Func, 0}, + {"IsNaN", Func, 0}, + {"J0", Func, 0}, + {"J1", Func, 0}, + {"Jn", Func, 0}, + {"Ldexp", Func, 0}, + {"Lgamma", Func, 0}, + {"Ln10", Const, 0}, + {"Ln2", Const, 0}, + {"Log", Func, 0}, + {"Log10", Func, 0}, + {"Log10E", Const, 0}, + {"Log1p", Func, 0}, + {"Log2", Func, 0}, + {"Log2E", Const, 0}, + {"Logb", Func, 0}, + {"Max", Func, 0}, + {"MaxFloat32", Const, 0}, + {"MaxFloat64", Const, 0}, + {"MaxInt", Const, 17}, + {"MaxInt16", Const, 0}, + {"MaxInt32", Const, 0}, + {"MaxInt64", Const, 0}, + {"MaxInt8", Const, 0}, + {"MaxUint", Const, 17}, + {"MaxUint16", Const, 0}, + {"MaxUint32", Const, 0}, + {"MaxUint64", Const, 0}, + {"MaxUint8", Const, 0}, + {"Min", Func, 0}, + {"MinInt", Const, 17}, + {"MinInt16", Const, 0}, + {"MinInt32", Const, 0}, + {"MinInt64", Const, 0}, + {"MinInt8", Const, 0}, + {"Mod", Func, 0}, + {"Modf", Func, 0}, + {"NaN", Func, 0}, + {"Nextafter", Func, 0}, + {"Nextafter32", Func, 4}, + {"Phi", Const, 0}, + {"Pi", Const, 0}, + {"Pow", Func, 0}, + {"Pow10", Func, 0}, + {"Remainder", Func, 0}, + {"Round", Func, 10}, + {"RoundToEven", Func, 10}, + {"Signbit", Func, 0}, + {"Sin", Func, 0}, + {"Sincos", Func, 0}, + {"Sinh", Func, 0}, + {"SmallestNonzeroFloat32", Const, 0}, + {"SmallestNonzeroFloat64", Const, 0}, + {"Sqrt", Func, 0}, + {"Sqrt2", Const, 0}, + {"SqrtE", Const, 0}, + {"SqrtPhi", Const, 0}, + {"SqrtPi", Const, 0}, + {"Tan", Func, 0}, + {"Tanh", Func, 0}, + {"Trunc", Func, 0}, + {"Y0", Func, 0}, + {"Y1", Func, 0}, + {"Yn", Func, 0}, + }, + "math/big": { + {"(*Float).Abs", Method, 5}, + {"(*Float).Acc", Method, 5}, + {"(*Float).Add", Method, 5}, + {"(*Float).Append", Method, 5}, + {"(*Float).Cmp", Method, 5}, + {"(*Float).Copy", Method, 5}, + {"(*Float).Float32", Method, 5}, + {"(*Float).Float64", Method, 5}, + {"(*Float).Format", Method, 5}, + {"(*Float).GobDecode", Method, 7}, + {"(*Float).GobEncode", Method, 7}, + {"(*Float).Int", Method, 5}, + {"(*Float).Int64", Method, 5}, + {"(*Float).IsInf", Method, 5}, + {"(*Float).IsInt", Method, 5}, + {"(*Float).MantExp", Method, 5}, + {"(*Float).MarshalText", Method, 6}, + {"(*Float).MinPrec", Method, 5}, + {"(*Float).Mode", Method, 5}, + {"(*Float).Mul", Method, 5}, + {"(*Float).Neg", Method, 5}, + {"(*Float).Parse", Method, 5}, + {"(*Float).Prec", Method, 5}, + {"(*Float).Quo", Method, 5}, + {"(*Float).Rat", Method, 5}, + {"(*Float).Scan", Method, 8}, + {"(*Float).Set", Method, 5}, + {"(*Float).SetFloat64", Method, 5}, + {"(*Float).SetInf", Method, 5}, + {"(*Float).SetInt", Method, 5}, + {"(*Float).SetInt64", Method, 5}, + {"(*Float).SetMantExp", Method, 5}, + {"(*Float).SetMode", Method, 5}, + {"(*Float).SetPrec", Method, 5}, + {"(*Float).SetRat", Method, 5}, + {"(*Float).SetString", Method, 5}, + {"(*Float).SetUint64", Method, 5}, + {"(*Float).Sign", Method, 5}, + {"(*Float).Signbit", Method, 5}, + {"(*Float).Sqrt", Method, 10}, + {"(*Float).String", Method, 5}, + {"(*Float).Sub", Method, 5}, + {"(*Float).Text", Method, 5}, + {"(*Float).Uint64", Method, 5}, + {"(*Float).UnmarshalText", Method, 6}, + {"(*Int).Abs", Method, 0}, + {"(*Int).Add", Method, 0}, + {"(*Int).And", Method, 0}, + {"(*Int).AndNot", Method, 0}, + {"(*Int).Append", Method, 6}, + {"(*Int).Binomial", Method, 0}, + {"(*Int).Bit", Method, 0}, + {"(*Int).BitLen", Method, 0}, + {"(*Int).Bits", Method, 0}, + {"(*Int).Bytes", Method, 0}, + {"(*Int).Cmp", Method, 0}, + {"(*Int).CmpAbs", Method, 10}, + {"(*Int).Div", Method, 0}, + {"(*Int).DivMod", Method, 0}, + {"(*Int).Exp", Method, 0}, + {"(*Int).FillBytes", Method, 15}, + {"(*Int).Float64", Method, 21}, + {"(*Int).Format", Method, 0}, + {"(*Int).GCD", Method, 0}, + {"(*Int).GobDecode", Method, 0}, + {"(*Int).GobEncode", Method, 0}, + {"(*Int).Int64", Method, 0}, + {"(*Int).IsInt64", Method, 9}, + {"(*Int).IsUint64", Method, 9}, + {"(*Int).Lsh", Method, 0}, + {"(*Int).MarshalJSON", Method, 1}, + {"(*Int).MarshalText", Method, 3}, + {"(*Int).Mod", Method, 0}, + {"(*Int).ModInverse", Method, 0}, + {"(*Int).ModSqrt", Method, 5}, + {"(*Int).Mul", Method, 0}, + {"(*Int).MulRange", Method, 0}, + {"(*Int).Neg", Method, 0}, + {"(*Int).Not", Method, 0}, + {"(*Int).Or", Method, 0}, + {"(*Int).ProbablyPrime", Method, 0}, + {"(*Int).Quo", Method, 0}, + {"(*Int).QuoRem", Method, 0}, + {"(*Int).Rand", Method, 0}, + {"(*Int).Rem", Method, 0}, + {"(*Int).Rsh", Method, 0}, + {"(*Int).Scan", Method, 0}, + {"(*Int).Set", Method, 0}, + {"(*Int).SetBit", Method, 0}, + {"(*Int).SetBits", Method, 0}, + {"(*Int).SetBytes", Method, 0}, + {"(*Int).SetInt64", Method, 0}, + {"(*Int).SetString", Method, 0}, + {"(*Int).SetUint64", Method, 1}, + {"(*Int).Sign", Method, 0}, + {"(*Int).Sqrt", Method, 8}, + {"(*Int).String", Method, 0}, + {"(*Int).Sub", Method, 0}, + {"(*Int).Text", Method, 6}, + {"(*Int).TrailingZeroBits", Method, 13}, + {"(*Int).Uint64", Method, 1}, + {"(*Int).UnmarshalJSON", Method, 1}, + {"(*Int).UnmarshalText", Method, 3}, + {"(*Int).Xor", Method, 0}, + {"(*Rat).Abs", Method, 0}, + {"(*Rat).Add", Method, 0}, + {"(*Rat).Cmp", Method, 0}, + {"(*Rat).Denom", Method, 0}, + {"(*Rat).Float32", Method, 4}, + {"(*Rat).Float64", Method, 1}, + {"(*Rat).FloatPrec", Method, 22}, + {"(*Rat).FloatString", Method, 0}, + {"(*Rat).GobDecode", Method, 0}, + {"(*Rat).GobEncode", Method, 0}, + {"(*Rat).Inv", Method, 0}, + {"(*Rat).IsInt", Method, 0}, + {"(*Rat).MarshalText", Method, 3}, + {"(*Rat).Mul", Method, 0}, + {"(*Rat).Neg", Method, 0}, + {"(*Rat).Num", Method, 0}, + {"(*Rat).Quo", Method, 0}, + {"(*Rat).RatString", Method, 0}, + {"(*Rat).Scan", Method, 0}, + {"(*Rat).Set", Method, 0}, + {"(*Rat).SetFloat64", Method, 1}, + {"(*Rat).SetFrac", Method, 0}, + {"(*Rat).SetFrac64", Method, 0}, + {"(*Rat).SetInt", Method, 0}, + {"(*Rat).SetInt64", Method, 0}, + {"(*Rat).SetString", Method, 0}, + {"(*Rat).SetUint64", Method, 13}, + {"(*Rat).Sign", Method, 0}, + {"(*Rat).String", Method, 0}, + {"(*Rat).Sub", Method, 0}, + {"(*Rat).UnmarshalText", Method, 3}, + {"(Accuracy).String", Method, 5}, + {"(ErrNaN).Error", Method, 5}, + {"(RoundingMode).String", Method, 5}, + {"Above", Const, 5}, + {"Accuracy", Type, 5}, + {"AwayFromZero", Const, 5}, + {"Below", Const, 5}, + {"ErrNaN", Type, 5}, + {"Exact", Const, 5}, + {"Float", Type, 5}, + {"Int", Type, 0}, + {"Jacobi", Func, 5}, + {"MaxBase", Const, 0}, + {"MaxExp", Const, 5}, + {"MaxPrec", Const, 5}, + {"MinExp", Const, 5}, + {"NewFloat", Func, 5}, + {"NewInt", Func, 0}, + {"NewRat", Func, 0}, + {"ParseFloat", Func, 5}, + {"Rat", Type, 0}, + {"RoundingMode", Type, 5}, + {"ToNearestAway", Const, 5}, + {"ToNearestEven", Const, 5}, + {"ToNegativeInf", Const, 5}, + {"ToPositiveInf", Const, 5}, + {"ToZero", Const, 5}, + {"Word", Type, 0}, + }, + "math/bits": { + {"Add", Func, 12}, + {"Add32", Func, 12}, + {"Add64", Func, 12}, + {"Div", Func, 12}, + {"Div32", Func, 12}, + {"Div64", Func, 12}, + {"LeadingZeros", Func, 9}, + {"LeadingZeros16", Func, 9}, + {"LeadingZeros32", Func, 9}, + {"LeadingZeros64", Func, 9}, + {"LeadingZeros8", Func, 9}, + {"Len", Func, 9}, + {"Len16", Func, 9}, + {"Len32", Func, 9}, + {"Len64", Func, 9}, + {"Len8", Func, 9}, + {"Mul", Func, 12}, + {"Mul32", Func, 12}, + {"Mul64", Func, 12}, + {"OnesCount", Func, 9}, + {"OnesCount16", Func, 9}, + {"OnesCount32", Func, 9}, + {"OnesCount64", Func, 9}, + {"OnesCount8", Func, 9}, + {"Rem", Func, 14}, + {"Rem32", Func, 14}, + {"Rem64", Func, 14}, + {"Reverse", Func, 9}, + {"Reverse16", Func, 9}, + {"Reverse32", Func, 9}, + {"Reverse64", Func, 9}, + {"Reverse8", Func, 9}, + {"ReverseBytes", Func, 9}, + {"ReverseBytes16", Func, 9}, + {"ReverseBytes32", Func, 9}, + {"ReverseBytes64", Func, 9}, + {"RotateLeft", Func, 9}, + {"RotateLeft16", Func, 9}, + {"RotateLeft32", Func, 9}, + {"RotateLeft64", Func, 9}, + {"RotateLeft8", Func, 9}, + {"Sub", Func, 12}, + {"Sub32", Func, 12}, + {"Sub64", Func, 12}, + {"TrailingZeros", Func, 9}, + {"TrailingZeros16", Func, 9}, + {"TrailingZeros32", Func, 9}, + {"TrailingZeros64", Func, 9}, + {"TrailingZeros8", Func, 9}, + {"UintSize", Const, 9}, + }, + "math/cmplx": { + {"Abs", Func, 0}, + {"Acos", Func, 0}, + {"Acosh", Func, 0}, + {"Asin", Func, 0}, + {"Asinh", Func, 0}, + {"Atan", Func, 0}, + {"Atanh", Func, 0}, + {"Conj", Func, 0}, + {"Cos", Func, 0}, + {"Cosh", Func, 0}, + {"Cot", Func, 0}, + {"Exp", Func, 0}, + {"Inf", Func, 0}, + {"IsInf", Func, 0}, + {"IsNaN", Func, 0}, + {"Log", Func, 0}, + {"Log10", Func, 0}, + {"NaN", Func, 0}, + {"Phase", Func, 0}, + {"Polar", Func, 0}, + {"Pow", Func, 0}, + {"Rect", Func, 0}, + {"Sin", Func, 0}, + {"Sinh", Func, 0}, + {"Sqrt", Func, 0}, + {"Tan", Func, 0}, + {"Tanh", Func, 0}, + }, + "math/rand": { + {"(*Rand).ExpFloat64", Method, 0}, + {"(*Rand).Float32", Method, 0}, + {"(*Rand).Float64", Method, 0}, + {"(*Rand).Int", Method, 0}, + {"(*Rand).Int31", Method, 0}, + {"(*Rand).Int31n", Method, 0}, + {"(*Rand).Int63", Method, 0}, + {"(*Rand).Int63n", Method, 0}, + {"(*Rand).Intn", Method, 0}, + {"(*Rand).NormFloat64", Method, 0}, + {"(*Rand).Perm", Method, 0}, + {"(*Rand).Read", Method, 6}, + {"(*Rand).Seed", Method, 0}, + {"(*Rand).Shuffle", Method, 10}, + {"(*Rand).Uint32", Method, 0}, + {"(*Rand).Uint64", Method, 8}, + {"(*Zipf).Uint64", Method, 0}, + {"ExpFloat64", Func, 0}, + {"Float32", Func, 0}, + {"Float64", Func, 0}, + {"Int", Func, 0}, + {"Int31", Func, 0}, + {"Int31n", Func, 0}, + {"Int63", Func, 0}, + {"Int63n", Func, 0}, + {"Intn", Func, 0}, + {"New", Func, 0}, + {"NewSource", Func, 0}, + {"NewZipf", Func, 0}, + {"NormFloat64", Func, 0}, + {"Perm", Func, 0}, + {"Rand", Type, 0}, + {"Read", Func, 6}, + {"Seed", Func, 0}, + {"Shuffle", Func, 10}, + {"Source", Type, 0}, + {"Source64", Type, 8}, + {"Uint32", Func, 0}, + {"Uint64", Func, 8}, + {"Zipf", Type, 0}, + }, + "math/rand/v2": { + {"(*ChaCha8).MarshalBinary", Method, 22}, + {"(*ChaCha8).Read", Method, 23}, + {"(*ChaCha8).Seed", Method, 22}, + {"(*ChaCha8).Uint64", Method, 22}, + {"(*ChaCha8).UnmarshalBinary", Method, 22}, + {"(*PCG).MarshalBinary", Method, 22}, + {"(*PCG).Seed", Method, 22}, + {"(*PCG).Uint64", Method, 22}, + {"(*PCG).UnmarshalBinary", Method, 22}, + {"(*Rand).ExpFloat64", Method, 22}, + {"(*Rand).Float32", Method, 22}, + {"(*Rand).Float64", Method, 22}, + {"(*Rand).Int", Method, 22}, + {"(*Rand).Int32", Method, 22}, + {"(*Rand).Int32N", Method, 22}, + {"(*Rand).Int64", Method, 22}, + {"(*Rand).Int64N", Method, 22}, + {"(*Rand).IntN", Method, 22}, + {"(*Rand).NormFloat64", Method, 22}, + {"(*Rand).Perm", Method, 22}, + {"(*Rand).Shuffle", Method, 22}, + {"(*Rand).Uint", Method, 23}, + {"(*Rand).Uint32", Method, 22}, + {"(*Rand).Uint32N", Method, 22}, + {"(*Rand).Uint64", Method, 22}, + {"(*Rand).Uint64N", Method, 22}, + {"(*Rand).UintN", Method, 22}, + {"(*Zipf).Uint64", Method, 22}, + {"ChaCha8", Type, 22}, + {"ExpFloat64", Func, 22}, + {"Float32", Func, 22}, + {"Float64", Func, 22}, + {"Int", Func, 22}, + {"Int32", Func, 22}, + {"Int32N", Func, 22}, + {"Int64", Func, 22}, + {"Int64N", Func, 22}, + {"IntN", Func, 22}, + {"N", Func, 22}, + {"New", Func, 22}, + {"NewChaCha8", Func, 22}, + {"NewPCG", Func, 22}, + {"NewZipf", Func, 22}, + {"NormFloat64", Func, 22}, + {"PCG", Type, 22}, + {"Perm", Func, 22}, + {"Rand", Type, 22}, + {"Shuffle", Func, 22}, + {"Source", Type, 22}, + {"Uint", Func, 23}, + {"Uint32", Func, 22}, + {"Uint32N", Func, 22}, + {"Uint64", Func, 22}, + {"Uint64N", Func, 22}, + {"UintN", Func, 22}, + {"Zipf", Type, 22}, + }, + "mime": { + {"(*WordDecoder).Decode", Method, 5}, + {"(*WordDecoder).DecodeHeader", Method, 5}, + {"(WordEncoder).Encode", Method, 5}, + {"AddExtensionType", Func, 0}, + {"BEncoding", Const, 5}, + {"ErrInvalidMediaParameter", Var, 9}, + {"ExtensionsByType", Func, 5}, + {"FormatMediaType", Func, 0}, + {"ParseMediaType", Func, 0}, + {"QEncoding", Const, 5}, + {"TypeByExtension", Func, 0}, + {"WordDecoder", Type, 5}, + {"WordDecoder.CharsetReader", Field, 5}, + {"WordEncoder", Type, 5}, + }, + "mime/multipart": { + {"(*FileHeader).Open", Method, 0}, + {"(*Form).RemoveAll", Method, 0}, + {"(*Part).Close", Method, 0}, + {"(*Part).FileName", Method, 0}, + {"(*Part).FormName", Method, 0}, + {"(*Part).Read", Method, 0}, + {"(*Reader).NextPart", Method, 0}, + {"(*Reader).NextRawPart", Method, 14}, + {"(*Reader).ReadForm", Method, 0}, + {"(*Writer).Boundary", Method, 0}, + {"(*Writer).Close", Method, 0}, + {"(*Writer).CreateFormField", Method, 0}, + {"(*Writer).CreateFormFile", Method, 0}, + {"(*Writer).CreatePart", Method, 0}, + {"(*Writer).FormDataContentType", Method, 0}, + {"(*Writer).SetBoundary", Method, 1}, + {"(*Writer).WriteField", Method, 0}, + {"ErrMessageTooLarge", Var, 9}, + {"File", Type, 0}, + {"FileHeader", Type, 0}, + {"FileHeader.Filename", Field, 0}, + {"FileHeader.Header", Field, 0}, + {"FileHeader.Size", Field, 9}, + {"Form", Type, 0}, + {"Form.File", Field, 0}, + {"Form.Value", Field, 0}, + {"NewReader", Func, 0}, + {"NewWriter", Func, 0}, + {"Part", Type, 0}, + {"Part.Header", Field, 0}, + {"Reader", Type, 0}, + {"Writer", Type, 0}, + }, + "mime/quotedprintable": { + {"(*Reader).Read", Method, 5}, + {"(*Writer).Close", Method, 5}, + {"(*Writer).Write", Method, 5}, + {"NewReader", Func, 5}, + {"NewWriter", Func, 5}, + {"Reader", Type, 5}, + {"Writer", Type, 5}, + {"Writer.Binary", Field, 5}, + }, + "net": { + {"(*AddrError).Error", Method, 0}, + {"(*AddrError).Temporary", Method, 0}, + {"(*AddrError).Timeout", Method, 0}, + {"(*Buffers).Read", Method, 8}, + {"(*Buffers).WriteTo", Method, 8}, + {"(*DNSConfigError).Error", Method, 0}, + {"(*DNSConfigError).Temporary", Method, 0}, + {"(*DNSConfigError).Timeout", Method, 0}, + {"(*DNSConfigError).Unwrap", Method, 13}, + {"(*DNSError).Error", Method, 0}, + {"(*DNSError).Temporary", Method, 0}, + {"(*DNSError).Timeout", Method, 0}, + {"(*DNSError).Unwrap", Method, 23}, + {"(*Dialer).Dial", Method, 1}, + {"(*Dialer).DialContext", Method, 7}, + {"(*Dialer).MultipathTCP", Method, 21}, + {"(*Dialer).SetMultipathTCP", Method, 21}, + {"(*IP).UnmarshalText", Method, 2}, + {"(*IPAddr).Network", Method, 0}, + {"(*IPAddr).String", Method, 0}, + {"(*IPConn).Close", Method, 0}, + {"(*IPConn).File", Method, 0}, + {"(*IPConn).LocalAddr", Method, 0}, + {"(*IPConn).Read", Method, 0}, + {"(*IPConn).ReadFrom", Method, 0}, + {"(*IPConn).ReadFromIP", Method, 0}, + {"(*IPConn).ReadMsgIP", Method, 1}, + {"(*IPConn).RemoteAddr", Method, 0}, + {"(*IPConn).SetDeadline", Method, 0}, + {"(*IPConn).SetReadBuffer", Method, 0}, + {"(*IPConn).SetReadDeadline", Method, 0}, + {"(*IPConn).SetWriteBuffer", Method, 0}, + {"(*IPConn).SetWriteDeadline", Method, 0}, + {"(*IPConn).SyscallConn", Method, 9}, + {"(*IPConn).Write", Method, 0}, + {"(*IPConn).WriteMsgIP", Method, 1}, + {"(*IPConn).WriteTo", Method, 0}, + {"(*IPConn).WriteToIP", Method, 0}, + {"(*IPNet).Contains", Method, 0}, + {"(*IPNet).Network", Method, 0}, + {"(*IPNet).String", Method, 0}, + {"(*Interface).Addrs", Method, 0}, + {"(*Interface).MulticastAddrs", Method, 0}, + {"(*ListenConfig).Listen", Method, 11}, + {"(*ListenConfig).ListenPacket", Method, 11}, + {"(*ListenConfig).MultipathTCP", Method, 21}, + {"(*ListenConfig).SetMultipathTCP", Method, 21}, + {"(*OpError).Error", Method, 0}, + {"(*OpError).Temporary", Method, 0}, + {"(*OpError).Timeout", Method, 0}, + {"(*OpError).Unwrap", Method, 13}, + {"(*ParseError).Error", Method, 0}, + {"(*ParseError).Temporary", Method, 17}, + {"(*ParseError).Timeout", Method, 17}, + {"(*Resolver).LookupAddr", Method, 8}, + {"(*Resolver).LookupCNAME", Method, 8}, + {"(*Resolver).LookupHost", Method, 8}, + {"(*Resolver).LookupIP", Method, 15}, + {"(*Resolver).LookupIPAddr", Method, 8}, + {"(*Resolver).LookupMX", Method, 8}, + {"(*Resolver).LookupNS", Method, 8}, + {"(*Resolver).LookupNetIP", Method, 18}, + {"(*Resolver).LookupPort", Method, 8}, + {"(*Resolver).LookupSRV", Method, 8}, + {"(*Resolver).LookupTXT", Method, 8}, + {"(*TCPAddr).AddrPort", Method, 18}, + {"(*TCPAddr).Network", Method, 0}, + {"(*TCPAddr).String", Method, 0}, + {"(*TCPConn).Close", Method, 0}, + {"(*TCPConn).CloseRead", Method, 0}, + {"(*TCPConn).CloseWrite", Method, 0}, + {"(*TCPConn).File", Method, 0}, + {"(*TCPConn).LocalAddr", Method, 0}, + {"(*TCPConn).MultipathTCP", Method, 21}, + {"(*TCPConn).Read", Method, 0}, + {"(*TCPConn).ReadFrom", Method, 0}, + {"(*TCPConn).RemoteAddr", Method, 0}, + {"(*TCPConn).SetDeadline", Method, 0}, + {"(*TCPConn).SetKeepAlive", Method, 0}, + {"(*TCPConn).SetKeepAliveConfig", Method, 23}, + {"(*TCPConn).SetKeepAlivePeriod", Method, 2}, + {"(*TCPConn).SetLinger", Method, 0}, + {"(*TCPConn).SetNoDelay", Method, 0}, + {"(*TCPConn).SetReadBuffer", Method, 0}, + {"(*TCPConn).SetReadDeadline", Method, 0}, + {"(*TCPConn).SetWriteBuffer", Method, 0}, + {"(*TCPConn).SetWriteDeadline", Method, 0}, + {"(*TCPConn).SyscallConn", Method, 9}, + {"(*TCPConn).Write", Method, 0}, + {"(*TCPConn).WriteTo", Method, 22}, + {"(*TCPListener).Accept", Method, 0}, + {"(*TCPListener).AcceptTCP", Method, 0}, + {"(*TCPListener).Addr", Method, 0}, + {"(*TCPListener).Close", Method, 0}, + {"(*TCPListener).File", Method, 0}, + {"(*TCPListener).SetDeadline", Method, 0}, + {"(*TCPListener).SyscallConn", Method, 10}, + {"(*UDPAddr).AddrPort", Method, 18}, + {"(*UDPAddr).Network", Method, 0}, + {"(*UDPAddr).String", Method, 0}, + {"(*UDPConn).Close", Method, 0}, + {"(*UDPConn).File", Method, 0}, + {"(*UDPConn).LocalAddr", Method, 0}, + {"(*UDPConn).Read", Method, 0}, + {"(*UDPConn).ReadFrom", Method, 0}, + {"(*UDPConn).ReadFromUDP", Method, 0}, + {"(*UDPConn).ReadFromUDPAddrPort", Method, 18}, + {"(*UDPConn).ReadMsgUDP", Method, 1}, + {"(*UDPConn).ReadMsgUDPAddrPort", Method, 18}, + {"(*UDPConn).RemoteAddr", Method, 0}, + {"(*UDPConn).SetDeadline", Method, 0}, + {"(*UDPConn).SetReadBuffer", Method, 0}, + {"(*UDPConn).SetReadDeadline", Method, 0}, + {"(*UDPConn).SetWriteBuffer", Method, 0}, + {"(*UDPConn).SetWriteDeadline", Method, 0}, + {"(*UDPConn).SyscallConn", Method, 9}, + {"(*UDPConn).Write", Method, 0}, + {"(*UDPConn).WriteMsgUDP", Method, 1}, + {"(*UDPConn).WriteMsgUDPAddrPort", Method, 18}, + {"(*UDPConn).WriteTo", Method, 0}, + {"(*UDPConn).WriteToUDP", Method, 0}, + {"(*UDPConn).WriteToUDPAddrPort", Method, 18}, + {"(*UnixAddr).Network", Method, 0}, + {"(*UnixAddr).String", Method, 0}, + {"(*UnixConn).Close", Method, 0}, + {"(*UnixConn).CloseRead", Method, 1}, + {"(*UnixConn).CloseWrite", Method, 1}, + {"(*UnixConn).File", Method, 0}, + {"(*UnixConn).LocalAddr", Method, 0}, + {"(*UnixConn).Read", Method, 0}, + {"(*UnixConn).ReadFrom", Method, 0}, + {"(*UnixConn).ReadFromUnix", Method, 0}, + {"(*UnixConn).ReadMsgUnix", Method, 0}, + {"(*UnixConn).RemoteAddr", Method, 0}, + {"(*UnixConn).SetDeadline", Method, 0}, + {"(*UnixConn).SetReadBuffer", Method, 0}, + {"(*UnixConn).SetReadDeadline", Method, 0}, + {"(*UnixConn).SetWriteBuffer", Method, 0}, + {"(*UnixConn).SetWriteDeadline", Method, 0}, + {"(*UnixConn).SyscallConn", Method, 9}, + {"(*UnixConn).Write", Method, 0}, + {"(*UnixConn).WriteMsgUnix", Method, 0}, + {"(*UnixConn).WriteTo", Method, 0}, + {"(*UnixConn).WriteToUnix", Method, 0}, + {"(*UnixListener).Accept", Method, 0}, + {"(*UnixListener).AcceptUnix", Method, 0}, + {"(*UnixListener).Addr", Method, 0}, + {"(*UnixListener).Close", Method, 0}, + {"(*UnixListener).File", Method, 0}, + {"(*UnixListener).SetDeadline", Method, 0}, + {"(*UnixListener).SetUnlinkOnClose", Method, 8}, + {"(*UnixListener).SyscallConn", Method, 10}, + {"(Flags).String", Method, 0}, + {"(HardwareAddr).String", Method, 0}, + {"(IP).DefaultMask", Method, 0}, + {"(IP).Equal", Method, 0}, + {"(IP).IsGlobalUnicast", Method, 0}, + {"(IP).IsInterfaceLocalMulticast", Method, 0}, + {"(IP).IsLinkLocalMulticast", Method, 0}, + {"(IP).IsLinkLocalUnicast", Method, 0}, + {"(IP).IsLoopback", Method, 0}, + {"(IP).IsMulticast", Method, 0}, + {"(IP).IsPrivate", Method, 17}, + {"(IP).IsUnspecified", Method, 0}, + {"(IP).MarshalText", Method, 2}, + {"(IP).Mask", Method, 0}, + {"(IP).String", Method, 0}, + {"(IP).To16", Method, 0}, + {"(IP).To4", Method, 0}, + {"(IPMask).Size", Method, 0}, + {"(IPMask).String", Method, 0}, + {"(InvalidAddrError).Error", Method, 0}, + {"(InvalidAddrError).Temporary", Method, 0}, + {"(InvalidAddrError).Timeout", Method, 0}, + {"(UnknownNetworkError).Error", Method, 0}, + {"(UnknownNetworkError).Temporary", Method, 0}, + {"(UnknownNetworkError).Timeout", Method, 0}, + {"Addr", Type, 0}, + {"AddrError", Type, 0}, + {"AddrError.Addr", Field, 0}, + {"AddrError.Err", Field, 0}, + {"Buffers", Type, 8}, + {"CIDRMask", Func, 0}, + {"Conn", Type, 0}, + {"DNSConfigError", Type, 0}, + {"DNSConfigError.Err", Field, 0}, + {"DNSError", Type, 0}, + {"DNSError.Err", Field, 0}, + {"DNSError.IsNotFound", Field, 13}, + {"DNSError.IsTemporary", Field, 6}, + {"DNSError.IsTimeout", Field, 0}, + {"DNSError.Name", Field, 0}, + {"DNSError.Server", Field, 0}, + {"DNSError.UnwrapErr", Field, 23}, + {"DefaultResolver", Var, 8}, + {"Dial", Func, 0}, + {"DialIP", Func, 0}, + {"DialTCP", Func, 0}, + {"DialTimeout", Func, 0}, + {"DialUDP", Func, 0}, + {"DialUnix", Func, 0}, + {"Dialer", Type, 1}, + {"Dialer.Cancel", Field, 6}, + {"Dialer.Control", Field, 11}, + {"Dialer.ControlContext", Field, 20}, + {"Dialer.Deadline", Field, 1}, + {"Dialer.DualStack", Field, 2}, + {"Dialer.FallbackDelay", Field, 5}, + {"Dialer.KeepAlive", Field, 3}, + {"Dialer.KeepAliveConfig", Field, 23}, + {"Dialer.LocalAddr", Field, 1}, + {"Dialer.Resolver", Field, 8}, + {"Dialer.Timeout", Field, 1}, + {"ErrClosed", Var, 16}, + {"ErrWriteToConnected", Var, 0}, + {"Error", Type, 0}, + {"FileConn", Func, 0}, + {"FileListener", Func, 0}, + {"FilePacketConn", Func, 0}, + {"FlagBroadcast", Const, 0}, + {"FlagLoopback", Const, 0}, + {"FlagMulticast", Const, 0}, + {"FlagPointToPoint", Const, 0}, + {"FlagRunning", Const, 20}, + {"FlagUp", Const, 0}, + {"Flags", Type, 0}, + {"HardwareAddr", Type, 0}, + {"IP", Type, 0}, + {"IPAddr", Type, 0}, + {"IPAddr.IP", Field, 0}, + {"IPAddr.Zone", Field, 1}, + {"IPConn", Type, 0}, + {"IPMask", Type, 0}, + {"IPNet", Type, 0}, + {"IPNet.IP", Field, 0}, + {"IPNet.Mask", Field, 0}, + {"IPv4", Func, 0}, + {"IPv4Mask", Func, 0}, + {"IPv4allrouter", Var, 0}, + {"IPv4allsys", Var, 0}, + {"IPv4bcast", Var, 0}, + {"IPv4len", Const, 0}, + {"IPv4zero", Var, 0}, + {"IPv6interfacelocalallnodes", Var, 0}, + {"IPv6len", Const, 0}, + {"IPv6linklocalallnodes", Var, 0}, + {"IPv6linklocalallrouters", Var, 0}, + {"IPv6loopback", Var, 0}, + {"IPv6unspecified", Var, 0}, + {"IPv6zero", Var, 0}, + {"Interface", Type, 0}, + {"Interface.Flags", Field, 0}, + {"Interface.HardwareAddr", Field, 0}, + {"Interface.Index", Field, 0}, + {"Interface.MTU", Field, 0}, + {"Interface.Name", Field, 0}, + {"InterfaceAddrs", Func, 0}, + {"InterfaceByIndex", Func, 0}, + {"InterfaceByName", Func, 0}, + {"Interfaces", Func, 0}, + {"InvalidAddrError", Type, 0}, + {"JoinHostPort", Func, 0}, + {"KeepAliveConfig", Type, 23}, + {"KeepAliveConfig.Count", Field, 23}, + {"KeepAliveConfig.Enable", Field, 23}, + {"KeepAliveConfig.Idle", Field, 23}, + {"KeepAliveConfig.Interval", Field, 23}, + {"Listen", Func, 0}, + {"ListenConfig", Type, 11}, + {"ListenConfig.Control", Field, 11}, + {"ListenConfig.KeepAlive", Field, 13}, + {"ListenConfig.KeepAliveConfig", Field, 23}, + {"ListenIP", Func, 0}, + {"ListenMulticastUDP", Func, 0}, + {"ListenPacket", Func, 0}, + {"ListenTCP", Func, 0}, + {"ListenUDP", Func, 0}, + {"ListenUnix", Func, 0}, + {"ListenUnixgram", Func, 0}, + {"Listener", Type, 0}, + {"LookupAddr", Func, 0}, + {"LookupCNAME", Func, 0}, + {"LookupHost", Func, 0}, + {"LookupIP", Func, 0}, + {"LookupMX", Func, 0}, + {"LookupNS", Func, 1}, + {"LookupPort", Func, 0}, + {"LookupSRV", Func, 0}, + {"LookupTXT", Func, 0}, + {"MX", Type, 0}, + {"MX.Host", Field, 0}, + {"MX.Pref", Field, 0}, + {"NS", Type, 1}, + {"NS.Host", Field, 1}, + {"OpError", Type, 0}, + {"OpError.Addr", Field, 0}, + {"OpError.Err", Field, 0}, + {"OpError.Net", Field, 0}, + {"OpError.Op", Field, 0}, + {"OpError.Source", Field, 5}, + {"PacketConn", Type, 0}, + {"ParseCIDR", Func, 0}, + {"ParseError", Type, 0}, + {"ParseError.Text", Field, 0}, + {"ParseError.Type", Field, 0}, + {"ParseIP", Func, 0}, + {"ParseMAC", Func, 0}, + {"Pipe", Func, 0}, + {"ResolveIPAddr", Func, 0}, + {"ResolveTCPAddr", Func, 0}, + {"ResolveUDPAddr", Func, 0}, + {"ResolveUnixAddr", Func, 0}, + {"Resolver", Type, 8}, + {"Resolver.Dial", Field, 9}, + {"Resolver.PreferGo", Field, 8}, + {"Resolver.StrictErrors", Field, 9}, + {"SRV", Type, 0}, + {"SRV.Port", Field, 0}, + {"SRV.Priority", Field, 0}, + {"SRV.Target", Field, 0}, + {"SRV.Weight", Field, 0}, + {"SplitHostPort", Func, 0}, + {"TCPAddr", Type, 0}, + {"TCPAddr.IP", Field, 0}, + {"TCPAddr.Port", Field, 0}, + {"TCPAddr.Zone", Field, 1}, + {"TCPAddrFromAddrPort", Func, 18}, + {"TCPConn", Type, 0}, + {"TCPListener", Type, 0}, + {"UDPAddr", Type, 0}, + {"UDPAddr.IP", Field, 0}, + {"UDPAddr.Port", Field, 0}, + {"UDPAddr.Zone", Field, 1}, + {"UDPAddrFromAddrPort", Func, 18}, + {"UDPConn", Type, 0}, + {"UnixAddr", Type, 0}, + {"UnixAddr.Name", Field, 0}, + {"UnixAddr.Net", Field, 0}, + {"UnixConn", Type, 0}, + {"UnixListener", Type, 0}, + {"UnknownNetworkError", Type, 0}, + }, + "net/http": { + {"(*Client).CloseIdleConnections", Method, 12}, + {"(*Client).Do", Method, 0}, + {"(*Client).Get", Method, 0}, + {"(*Client).Head", Method, 0}, + {"(*Client).Post", Method, 0}, + {"(*Client).PostForm", Method, 0}, + {"(*Cookie).String", Method, 0}, + {"(*Cookie).Valid", Method, 18}, + {"(*MaxBytesError).Error", Method, 19}, + {"(*ProtocolError).Error", Method, 0}, + {"(*ProtocolError).Is", Method, 21}, + {"(*Request).AddCookie", Method, 0}, + {"(*Request).BasicAuth", Method, 4}, + {"(*Request).Clone", Method, 13}, + {"(*Request).Context", Method, 7}, + {"(*Request).Cookie", Method, 0}, + {"(*Request).Cookies", Method, 0}, + {"(*Request).CookiesNamed", Method, 23}, + {"(*Request).FormFile", Method, 0}, + {"(*Request).FormValue", Method, 0}, + {"(*Request).MultipartReader", Method, 0}, + {"(*Request).ParseForm", Method, 0}, + {"(*Request).ParseMultipartForm", Method, 0}, + {"(*Request).PathValue", Method, 22}, + {"(*Request).PostFormValue", Method, 1}, + {"(*Request).ProtoAtLeast", Method, 0}, + {"(*Request).Referer", Method, 0}, + {"(*Request).SetBasicAuth", Method, 0}, + {"(*Request).SetPathValue", Method, 22}, + {"(*Request).UserAgent", Method, 0}, + {"(*Request).WithContext", Method, 7}, + {"(*Request).Write", Method, 0}, + {"(*Request).WriteProxy", Method, 0}, + {"(*Response).Cookies", Method, 0}, + {"(*Response).Location", Method, 0}, + {"(*Response).ProtoAtLeast", Method, 0}, + {"(*Response).Write", Method, 0}, + {"(*ResponseController).EnableFullDuplex", Method, 21}, + {"(*ResponseController).Flush", Method, 20}, + {"(*ResponseController).Hijack", Method, 20}, + {"(*ResponseController).SetReadDeadline", Method, 20}, + {"(*ResponseController).SetWriteDeadline", Method, 20}, + {"(*ServeMux).Handle", Method, 0}, + {"(*ServeMux).HandleFunc", Method, 0}, + {"(*ServeMux).Handler", Method, 1}, + {"(*ServeMux).ServeHTTP", Method, 0}, + {"(*Server).Close", Method, 8}, + {"(*Server).ListenAndServe", Method, 0}, + {"(*Server).ListenAndServeTLS", Method, 0}, + {"(*Server).RegisterOnShutdown", Method, 9}, + {"(*Server).Serve", Method, 0}, + {"(*Server).ServeTLS", Method, 9}, + {"(*Server).SetKeepAlivesEnabled", Method, 3}, + {"(*Server).Shutdown", Method, 8}, + {"(*Transport).CancelRequest", Method, 1}, + {"(*Transport).Clone", Method, 13}, + {"(*Transport).CloseIdleConnections", Method, 0}, + {"(*Transport).RegisterProtocol", Method, 0}, + {"(*Transport).RoundTrip", Method, 0}, + {"(ConnState).String", Method, 3}, + {"(Dir).Open", Method, 0}, + {"(HandlerFunc).ServeHTTP", Method, 0}, + {"(Header).Add", Method, 0}, + {"(Header).Clone", Method, 13}, + {"(Header).Del", Method, 0}, + {"(Header).Get", Method, 0}, + {"(Header).Set", Method, 0}, + {"(Header).Values", Method, 14}, + {"(Header).Write", Method, 0}, + {"(Header).WriteSubset", Method, 0}, + {"AllowQuerySemicolons", Func, 17}, + {"CanonicalHeaderKey", Func, 0}, + {"Client", Type, 0}, + {"Client.CheckRedirect", Field, 0}, + {"Client.Jar", Field, 0}, + {"Client.Timeout", Field, 3}, + {"Client.Transport", Field, 0}, + {"CloseNotifier", Type, 1}, + {"ConnState", Type, 3}, + {"Cookie", Type, 0}, + {"Cookie.Domain", Field, 0}, + {"Cookie.Expires", Field, 0}, + {"Cookie.HttpOnly", Field, 0}, + {"Cookie.MaxAge", Field, 0}, + {"Cookie.Name", Field, 0}, + {"Cookie.Partitioned", Field, 23}, + {"Cookie.Path", Field, 0}, + {"Cookie.Quoted", Field, 23}, + {"Cookie.Raw", Field, 0}, + {"Cookie.RawExpires", Field, 0}, + {"Cookie.SameSite", Field, 11}, + {"Cookie.Secure", Field, 0}, + {"Cookie.Unparsed", Field, 0}, + {"Cookie.Value", Field, 0}, + {"CookieJar", Type, 0}, + {"DefaultClient", Var, 0}, + {"DefaultMaxHeaderBytes", Const, 0}, + {"DefaultMaxIdleConnsPerHost", Const, 0}, + {"DefaultServeMux", Var, 0}, + {"DefaultTransport", Var, 0}, + {"DetectContentType", Func, 0}, + {"Dir", Type, 0}, + {"ErrAbortHandler", Var, 8}, + {"ErrBodyNotAllowed", Var, 0}, + {"ErrBodyReadAfterClose", Var, 0}, + {"ErrContentLength", Var, 0}, + {"ErrHandlerTimeout", Var, 0}, + {"ErrHeaderTooLong", Var, 0}, + {"ErrHijacked", Var, 0}, + {"ErrLineTooLong", Var, 0}, + {"ErrMissingBoundary", Var, 0}, + {"ErrMissingContentLength", Var, 0}, + {"ErrMissingFile", Var, 0}, + {"ErrNoCookie", Var, 0}, + {"ErrNoLocation", Var, 0}, + {"ErrNotMultipart", Var, 0}, + {"ErrNotSupported", Var, 0}, + {"ErrSchemeMismatch", Var, 21}, + {"ErrServerClosed", Var, 8}, + {"ErrShortBody", Var, 0}, + {"ErrSkipAltProtocol", Var, 6}, + {"ErrUnexpectedTrailer", Var, 0}, + {"ErrUseLastResponse", Var, 7}, + {"ErrWriteAfterFlush", Var, 0}, + {"Error", Func, 0}, + {"FS", Func, 16}, + {"File", Type, 0}, + {"FileServer", Func, 0}, + {"FileServerFS", Func, 22}, + {"FileSystem", Type, 0}, + {"Flusher", Type, 0}, + {"Get", Func, 0}, + {"Handle", Func, 0}, + {"HandleFunc", Func, 0}, + {"Handler", Type, 0}, + {"HandlerFunc", Type, 0}, + {"Head", Func, 0}, + {"Header", Type, 0}, + {"Hijacker", Type, 0}, + {"ListenAndServe", Func, 0}, + {"ListenAndServeTLS", Func, 0}, + {"LocalAddrContextKey", Var, 7}, + {"MaxBytesError", Type, 19}, + {"MaxBytesError.Limit", Field, 19}, + {"MaxBytesHandler", Func, 18}, + {"MaxBytesReader", Func, 0}, + {"MethodConnect", Const, 6}, + {"MethodDelete", Const, 6}, + {"MethodGet", Const, 6}, + {"MethodHead", Const, 6}, + {"MethodOptions", Const, 6}, + {"MethodPatch", Const, 6}, + {"MethodPost", Const, 6}, + {"MethodPut", Const, 6}, + {"MethodTrace", Const, 6}, + {"NewFileTransport", Func, 0}, + {"NewFileTransportFS", Func, 22}, + {"NewRequest", Func, 0}, + {"NewRequestWithContext", Func, 13}, + {"NewResponseController", Func, 20}, + {"NewServeMux", Func, 0}, + {"NoBody", Var, 8}, + {"NotFound", Func, 0}, + {"NotFoundHandler", Func, 0}, + {"ParseCookie", Func, 23}, + {"ParseHTTPVersion", Func, 0}, + {"ParseSetCookie", Func, 23}, + {"ParseTime", Func, 1}, + {"Post", Func, 0}, + {"PostForm", Func, 0}, + {"ProtocolError", Type, 0}, + {"ProtocolError.ErrorString", Field, 0}, + {"ProxyFromEnvironment", Func, 0}, + {"ProxyURL", Func, 0}, + {"PushOptions", Type, 8}, + {"PushOptions.Header", Field, 8}, + {"PushOptions.Method", Field, 8}, + {"Pusher", Type, 8}, + {"ReadRequest", Func, 0}, + {"ReadResponse", Func, 0}, + {"Redirect", Func, 0}, + {"RedirectHandler", Func, 0}, + {"Request", Type, 0}, + {"Request.Body", Field, 0}, + {"Request.Cancel", Field, 5}, + {"Request.Close", Field, 0}, + {"Request.ContentLength", Field, 0}, + {"Request.Form", Field, 0}, + {"Request.GetBody", Field, 8}, + {"Request.Header", Field, 0}, + {"Request.Host", Field, 0}, + {"Request.Method", Field, 0}, + {"Request.MultipartForm", Field, 0}, + {"Request.Pattern", Field, 23}, + {"Request.PostForm", Field, 1}, + {"Request.Proto", Field, 0}, + {"Request.ProtoMajor", Field, 0}, + {"Request.ProtoMinor", Field, 0}, + {"Request.RemoteAddr", Field, 0}, + {"Request.RequestURI", Field, 0}, + {"Request.Response", Field, 7}, + {"Request.TLS", Field, 0}, + {"Request.Trailer", Field, 0}, + {"Request.TransferEncoding", Field, 0}, + {"Request.URL", Field, 0}, + {"Response", Type, 0}, + {"Response.Body", Field, 0}, + {"Response.Close", Field, 0}, + {"Response.ContentLength", Field, 0}, + {"Response.Header", Field, 0}, + {"Response.Proto", Field, 0}, + {"Response.ProtoMajor", Field, 0}, + {"Response.ProtoMinor", Field, 0}, + {"Response.Request", Field, 0}, + {"Response.Status", Field, 0}, + {"Response.StatusCode", Field, 0}, + {"Response.TLS", Field, 3}, + {"Response.Trailer", Field, 0}, + {"Response.TransferEncoding", Field, 0}, + {"Response.Uncompressed", Field, 7}, + {"ResponseController", Type, 20}, + {"ResponseWriter", Type, 0}, + {"RoundTripper", Type, 0}, + {"SameSite", Type, 11}, + {"SameSiteDefaultMode", Const, 11}, + {"SameSiteLaxMode", Const, 11}, + {"SameSiteNoneMode", Const, 13}, + {"SameSiteStrictMode", Const, 11}, + {"Serve", Func, 0}, + {"ServeContent", Func, 0}, + {"ServeFile", Func, 0}, + {"ServeFileFS", Func, 22}, + {"ServeMux", Type, 0}, + {"ServeTLS", Func, 9}, + {"Server", Type, 0}, + {"Server.Addr", Field, 0}, + {"Server.BaseContext", Field, 13}, + {"Server.ConnContext", Field, 13}, + {"Server.ConnState", Field, 3}, + {"Server.DisableGeneralOptionsHandler", Field, 20}, + {"Server.ErrorLog", Field, 3}, + {"Server.Handler", Field, 0}, + {"Server.IdleTimeout", Field, 8}, + {"Server.MaxHeaderBytes", Field, 0}, + {"Server.ReadHeaderTimeout", Field, 8}, + {"Server.ReadTimeout", Field, 0}, + {"Server.TLSConfig", Field, 0}, + {"Server.TLSNextProto", Field, 1}, + {"Server.WriteTimeout", Field, 0}, + {"ServerContextKey", Var, 7}, + {"SetCookie", Func, 0}, + {"StateActive", Const, 3}, + {"StateClosed", Const, 3}, + {"StateHijacked", Const, 3}, + {"StateIdle", Const, 3}, + {"StateNew", Const, 3}, + {"StatusAccepted", Const, 0}, + {"StatusAlreadyReported", Const, 7}, + {"StatusBadGateway", Const, 0}, + {"StatusBadRequest", Const, 0}, + {"StatusConflict", Const, 0}, + {"StatusContinue", Const, 0}, + {"StatusCreated", Const, 0}, + {"StatusEarlyHints", Const, 13}, + {"StatusExpectationFailed", Const, 0}, + {"StatusFailedDependency", Const, 7}, + {"StatusForbidden", Const, 0}, + {"StatusFound", Const, 0}, + {"StatusGatewayTimeout", Const, 0}, + {"StatusGone", Const, 0}, + {"StatusHTTPVersionNotSupported", Const, 0}, + {"StatusIMUsed", Const, 7}, + {"StatusInsufficientStorage", Const, 7}, + {"StatusInternalServerError", Const, 0}, + {"StatusLengthRequired", Const, 0}, + {"StatusLocked", Const, 7}, + {"StatusLoopDetected", Const, 7}, + {"StatusMethodNotAllowed", Const, 0}, + {"StatusMisdirectedRequest", Const, 11}, + {"StatusMovedPermanently", Const, 0}, + {"StatusMultiStatus", Const, 7}, + {"StatusMultipleChoices", Const, 0}, + {"StatusNetworkAuthenticationRequired", Const, 6}, + {"StatusNoContent", Const, 0}, + {"StatusNonAuthoritativeInfo", Const, 0}, + {"StatusNotAcceptable", Const, 0}, + {"StatusNotExtended", Const, 7}, + {"StatusNotFound", Const, 0}, + {"StatusNotImplemented", Const, 0}, + {"StatusNotModified", Const, 0}, + {"StatusOK", Const, 0}, + {"StatusPartialContent", Const, 0}, + {"StatusPaymentRequired", Const, 0}, + {"StatusPermanentRedirect", Const, 7}, + {"StatusPreconditionFailed", Const, 0}, + {"StatusPreconditionRequired", Const, 6}, + {"StatusProcessing", Const, 7}, + {"StatusProxyAuthRequired", Const, 0}, + {"StatusRequestEntityTooLarge", Const, 0}, + {"StatusRequestHeaderFieldsTooLarge", Const, 6}, + {"StatusRequestTimeout", Const, 0}, + {"StatusRequestURITooLong", Const, 0}, + {"StatusRequestedRangeNotSatisfiable", Const, 0}, + {"StatusResetContent", Const, 0}, + {"StatusSeeOther", Const, 0}, + {"StatusServiceUnavailable", Const, 0}, + {"StatusSwitchingProtocols", Const, 0}, + {"StatusTeapot", Const, 0}, + {"StatusTemporaryRedirect", Const, 0}, + {"StatusText", Func, 0}, + {"StatusTooEarly", Const, 12}, + {"StatusTooManyRequests", Const, 6}, + {"StatusUnauthorized", Const, 0}, + {"StatusUnavailableForLegalReasons", Const, 6}, + {"StatusUnprocessableEntity", Const, 7}, + {"StatusUnsupportedMediaType", Const, 0}, + {"StatusUpgradeRequired", Const, 7}, + {"StatusUseProxy", Const, 0}, + {"StatusVariantAlsoNegotiates", Const, 7}, + {"StripPrefix", Func, 0}, + {"TimeFormat", Const, 0}, + {"TimeoutHandler", Func, 0}, + {"TrailerPrefix", Const, 8}, + {"Transport", Type, 0}, + {"Transport.Dial", Field, 0}, + {"Transport.DialContext", Field, 7}, + {"Transport.DialTLS", Field, 4}, + {"Transport.DialTLSContext", Field, 14}, + {"Transport.DisableCompression", Field, 0}, + {"Transport.DisableKeepAlives", Field, 0}, + {"Transport.ExpectContinueTimeout", Field, 6}, + {"Transport.ForceAttemptHTTP2", Field, 13}, + {"Transport.GetProxyConnectHeader", Field, 16}, + {"Transport.IdleConnTimeout", Field, 7}, + {"Transport.MaxConnsPerHost", Field, 11}, + {"Transport.MaxIdleConns", Field, 7}, + {"Transport.MaxIdleConnsPerHost", Field, 0}, + {"Transport.MaxResponseHeaderBytes", Field, 7}, + {"Transport.OnProxyConnectResponse", Field, 20}, + {"Transport.Proxy", Field, 0}, + {"Transport.ProxyConnectHeader", Field, 8}, + {"Transport.ReadBufferSize", Field, 13}, + {"Transport.ResponseHeaderTimeout", Field, 1}, + {"Transport.TLSClientConfig", Field, 0}, + {"Transport.TLSHandshakeTimeout", Field, 3}, + {"Transport.TLSNextProto", Field, 6}, + {"Transport.WriteBufferSize", Field, 13}, + }, + "net/http/cgi": { + {"(*Handler).ServeHTTP", Method, 0}, + {"Handler", Type, 0}, + {"Handler.Args", Field, 0}, + {"Handler.Dir", Field, 0}, + {"Handler.Env", Field, 0}, + {"Handler.InheritEnv", Field, 0}, + {"Handler.Logger", Field, 0}, + {"Handler.Path", Field, 0}, + {"Handler.PathLocationHandler", Field, 0}, + {"Handler.Root", Field, 0}, + {"Handler.Stderr", Field, 7}, + {"Request", Func, 0}, + {"RequestFromMap", Func, 0}, + {"Serve", Func, 0}, + }, + "net/http/cookiejar": { + {"(*Jar).Cookies", Method, 1}, + {"(*Jar).SetCookies", Method, 1}, + {"Jar", Type, 1}, + {"New", Func, 1}, + {"Options", Type, 1}, + {"Options.PublicSuffixList", Field, 1}, + {"PublicSuffixList", Type, 1}, + }, + "net/http/fcgi": { + {"ErrConnClosed", Var, 5}, + {"ErrRequestAborted", Var, 5}, + {"ProcessEnv", Func, 9}, + {"Serve", Func, 0}, + }, + "net/http/httptest": { + {"(*ResponseRecorder).Flush", Method, 0}, + {"(*ResponseRecorder).Header", Method, 0}, + {"(*ResponseRecorder).Result", Method, 7}, + {"(*ResponseRecorder).Write", Method, 0}, + {"(*ResponseRecorder).WriteHeader", Method, 0}, + {"(*ResponseRecorder).WriteString", Method, 6}, + {"(*Server).Certificate", Method, 9}, + {"(*Server).Client", Method, 9}, + {"(*Server).Close", Method, 0}, + {"(*Server).CloseClientConnections", Method, 0}, + {"(*Server).Start", Method, 0}, + {"(*Server).StartTLS", Method, 0}, + {"DefaultRemoteAddr", Const, 0}, + {"NewRecorder", Func, 0}, + {"NewRequest", Func, 7}, + {"NewRequestWithContext", Func, 23}, + {"NewServer", Func, 0}, + {"NewTLSServer", Func, 0}, + {"NewUnstartedServer", Func, 0}, + {"ResponseRecorder", Type, 0}, + {"ResponseRecorder.Body", Field, 0}, + {"ResponseRecorder.Code", Field, 0}, + {"ResponseRecorder.Flushed", Field, 0}, + {"ResponseRecorder.HeaderMap", Field, 0}, + {"Server", Type, 0}, + {"Server.Config", Field, 0}, + {"Server.EnableHTTP2", Field, 14}, + {"Server.Listener", Field, 0}, + {"Server.TLS", Field, 0}, + {"Server.URL", Field, 0}, + }, + "net/http/httptrace": { + {"ClientTrace", Type, 7}, + {"ClientTrace.ConnectDone", Field, 7}, + {"ClientTrace.ConnectStart", Field, 7}, + {"ClientTrace.DNSDone", Field, 7}, + {"ClientTrace.DNSStart", Field, 7}, + {"ClientTrace.GetConn", Field, 7}, + {"ClientTrace.Got100Continue", Field, 7}, + {"ClientTrace.Got1xxResponse", Field, 11}, + {"ClientTrace.GotConn", Field, 7}, + {"ClientTrace.GotFirstResponseByte", Field, 7}, + {"ClientTrace.PutIdleConn", Field, 7}, + {"ClientTrace.TLSHandshakeDone", Field, 8}, + {"ClientTrace.TLSHandshakeStart", Field, 8}, + {"ClientTrace.Wait100Continue", Field, 7}, + {"ClientTrace.WroteHeaderField", Field, 11}, + {"ClientTrace.WroteHeaders", Field, 7}, + {"ClientTrace.WroteRequest", Field, 7}, + {"ContextClientTrace", Func, 7}, + {"DNSDoneInfo", Type, 7}, + {"DNSDoneInfo.Addrs", Field, 7}, + {"DNSDoneInfo.Coalesced", Field, 7}, + {"DNSDoneInfo.Err", Field, 7}, + {"DNSStartInfo", Type, 7}, + {"DNSStartInfo.Host", Field, 7}, + {"GotConnInfo", Type, 7}, + {"GotConnInfo.Conn", Field, 7}, + {"GotConnInfo.IdleTime", Field, 7}, + {"GotConnInfo.Reused", Field, 7}, + {"GotConnInfo.WasIdle", Field, 7}, + {"WithClientTrace", Func, 7}, + {"WroteRequestInfo", Type, 7}, + {"WroteRequestInfo.Err", Field, 7}, + }, + "net/http/httputil": { + {"(*ClientConn).Close", Method, 0}, + {"(*ClientConn).Do", Method, 0}, + {"(*ClientConn).Hijack", Method, 0}, + {"(*ClientConn).Pending", Method, 0}, + {"(*ClientConn).Read", Method, 0}, + {"(*ClientConn).Write", Method, 0}, + {"(*ProxyRequest).SetURL", Method, 20}, + {"(*ProxyRequest).SetXForwarded", Method, 20}, + {"(*ReverseProxy).ServeHTTP", Method, 0}, + {"(*ServerConn).Close", Method, 0}, + {"(*ServerConn).Hijack", Method, 0}, + {"(*ServerConn).Pending", Method, 0}, + {"(*ServerConn).Read", Method, 0}, + {"(*ServerConn).Write", Method, 0}, + {"BufferPool", Type, 6}, + {"ClientConn", Type, 0}, + {"DumpRequest", Func, 0}, + {"DumpRequestOut", Func, 0}, + {"DumpResponse", Func, 0}, + {"ErrClosed", Var, 0}, + {"ErrLineTooLong", Var, 0}, + {"ErrPersistEOF", Var, 0}, + {"ErrPipeline", Var, 0}, + {"NewChunkedReader", Func, 0}, + {"NewChunkedWriter", Func, 0}, + {"NewClientConn", Func, 0}, + {"NewProxyClientConn", Func, 0}, + {"NewServerConn", Func, 0}, + {"NewSingleHostReverseProxy", Func, 0}, + {"ProxyRequest", Type, 20}, + {"ProxyRequest.In", Field, 20}, + {"ProxyRequest.Out", Field, 20}, + {"ReverseProxy", Type, 0}, + {"ReverseProxy.BufferPool", Field, 6}, + {"ReverseProxy.Director", Field, 0}, + {"ReverseProxy.ErrorHandler", Field, 11}, + {"ReverseProxy.ErrorLog", Field, 4}, + {"ReverseProxy.FlushInterval", Field, 0}, + {"ReverseProxy.ModifyResponse", Field, 8}, + {"ReverseProxy.Rewrite", Field, 20}, + {"ReverseProxy.Transport", Field, 0}, + {"ServerConn", Type, 0}, + }, + "net/http/pprof": { + {"Cmdline", Func, 0}, + {"Handler", Func, 0}, + {"Index", Func, 0}, + {"Profile", Func, 0}, + {"Symbol", Func, 0}, + {"Trace", Func, 5}, + }, + "net/mail": { + {"(*Address).String", Method, 0}, + {"(*AddressParser).Parse", Method, 5}, + {"(*AddressParser).ParseList", Method, 5}, + {"(Header).AddressList", Method, 0}, + {"(Header).Date", Method, 0}, + {"(Header).Get", Method, 0}, + {"Address", Type, 0}, + {"Address.Address", Field, 0}, + {"Address.Name", Field, 0}, + {"AddressParser", Type, 5}, + {"AddressParser.WordDecoder", Field, 5}, + {"ErrHeaderNotPresent", Var, 0}, + {"Header", Type, 0}, + {"Message", Type, 0}, + {"Message.Body", Field, 0}, + {"Message.Header", Field, 0}, + {"ParseAddress", Func, 1}, + {"ParseAddressList", Func, 1}, + {"ParseDate", Func, 8}, + {"ReadMessage", Func, 0}, + }, + "net/netip": { + {"(*Addr).UnmarshalBinary", Method, 18}, + {"(*Addr).UnmarshalText", Method, 18}, + {"(*AddrPort).UnmarshalBinary", Method, 18}, + {"(*AddrPort).UnmarshalText", Method, 18}, + {"(*Prefix).UnmarshalBinary", Method, 18}, + {"(*Prefix).UnmarshalText", Method, 18}, + {"(Addr).AppendTo", Method, 18}, + {"(Addr).As16", Method, 18}, + {"(Addr).As4", Method, 18}, + {"(Addr).AsSlice", Method, 18}, + {"(Addr).BitLen", Method, 18}, + {"(Addr).Compare", Method, 18}, + {"(Addr).Is4", Method, 18}, + {"(Addr).Is4In6", Method, 18}, + {"(Addr).Is6", Method, 18}, + {"(Addr).IsGlobalUnicast", Method, 18}, + {"(Addr).IsInterfaceLocalMulticast", Method, 18}, + {"(Addr).IsLinkLocalMulticast", Method, 18}, + {"(Addr).IsLinkLocalUnicast", Method, 18}, + {"(Addr).IsLoopback", Method, 18}, + {"(Addr).IsMulticast", Method, 18}, + {"(Addr).IsPrivate", Method, 18}, + {"(Addr).IsUnspecified", Method, 18}, + {"(Addr).IsValid", Method, 18}, + {"(Addr).Less", Method, 18}, + {"(Addr).MarshalBinary", Method, 18}, + {"(Addr).MarshalText", Method, 18}, + {"(Addr).Next", Method, 18}, + {"(Addr).Prefix", Method, 18}, + {"(Addr).Prev", Method, 18}, + {"(Addr).String", Method, 18}, + {"(Addr).StringExpanded", Method, 18}, + {"(Addr).Unmap", Method, 18}, + {"(Addr).WithZone", Method, 18}, + {"(Addr).Zone", Method, 18}, + {"(AddrPort).Addr", Method, 18}, + {"(AddrPort).AppendTo", Method, 18}, + {"(AddrPort).Compare", Method, 22}, + {"(AddrPort).IsValid", Method, 18}, + {"(AddrPort).MarshalBinary", Method, 18}, + {"(AddrPort).MarshalText", Method, 18}, + {"(AddrPort).Port", Method, 18}, + {"(AddrPort).String", Method, 18}, + {"(Prefix).Addr", Method, 18}, + {"(Prefix).AppendTo", Method, 18}, + {"(Prefix).Bits", Method, 18}, + {"(Prefix).Contains", Method, 18}, + {"(Prefix).IsSingleIP", Method, 18}, + {"(Prefix).IsValid", Method, 18}, + {"(Prefix).MarshalBinary", Method, 18}, + {"(Prefix).MarshalText", Method, 18}, + {"(Prefix).Masked", Method, 18}, + {"(Prefix).Overlaps", Method, 18}, + {"(Prefix).String", Method, 18}, + {"Addr", Type, 18}, + {"AddrFrom16", Func, 18}, + {"AddrFrom4", Func, 18}, + {"AddrFromSlice", Func, 18}, + {"AddrPort", Type, 18}, + {"AddrPortFrom", Func, 18}, + {"IPv4Unspecified", Func, 18}, + {"IPv6LinkLocalAllNodes", Func, 18}, + {"IPv6LinkLocalAllRouters", Func, 20}, + {"IPv6Loopback", Func, 20}, + {"IPv6Unspecified", Func, 18}, + {"MustParseAddr", Func, 18}, + {"MustParseAddrPort", Func, 18}, + {"MustParsePrefix", Func, 18}, + {"ParseAddr", Func, 18}, + {"ParseAddrPort", Func, 18}, + {"ParsePrefix", Func, 18}, + {"Prefix", Type, 18}, + {"PrefixFrom", Func, 18}, + }, + "net/rpc": { + {"(*Client).Call", Method, 0}, + {"(*Client).Close", Method, 0}, + {"(*Client).Go", Method, 0}, + {"(*Server).Accept", Method, 0}, + {"(*Server).HandleHTTP", Method, 0}, + {"(*Server).Register", Method, 0}, + {"(*Server).RegisterName", Method, 0}, + {"(*Server).ServeCodec", Method, 0}, + {"(*Server).ServeConn", Method, 0}, + {"(*Server).ServeHTTP", Method, 0}, + {"(*Server).ServeRequest", Method, 0}, + {"(ServerError).Error", Method, 0}, + {"Accept", Func, 0}, + {"Call", Type, 0}, + {"Call.Args", Field, 0}, + {"Call.Done", Field, 0}, + {"Call.Error", Field, 0}, + {"Call.Reply", Field, 0}, + {"Call.ServiceMethod", Field, 0}, + {"Client", Type, 0}, + {"ClientCodec", Type, 0}, + {"DefaultDebugPath", Const, 0}, + {"DefaultRPCPath", Const, 0}, + {"DefaultServer", Var, 0}, + {"Dial", Func, 0}, + {"DialHTTP", Func, 0}, + {"DialHTTPPath", Func, 0}, + {"ErrShutdown", Var, 0}, + {"HandleHTTP", Func, 0}, + {"NewClient", Func, 0}, + {"NewClientWithCodec", Func, 0}, + {"NewServer", Func, 0}, + {"Register", Func, 0}, + {"RegisterName", Func, 0}, + {"Request", Type, 0}, + {"Request.Seq", Field, 0}, + {"Request.ServiceMethod", Field, 0}, + {"Response", Type, 0}, + {"Response.Error", Field, 0}, + {"Response.Seq", Field, 0}, + {"Response.ServiceMethod", Field, 0}, + {"ServeCodec", Func, 0}, + {"ServeConn", Func, 0}, + {"ServeRequest", Func, 0}, + {"Server", Type, 0}, + {"ServerCodec", Type, 0}, + {"ServerError", Type, 0}, + }, + "net/rpc/jsonrpc": { + {"Dial", Func, 0}, + {"NewClient", Func, 0}, + {"NewClientCodec", Func, 0}, + {"NewServerCodec", Func, 0}, + {"ServeConn", Func, 0}, + }, + "net/smtp": { + {"(*Client).Auth", Method, 0}, + {"(*Client).Close", Method, 2}, + {"(*Client).Data", Method, 0}, + {"(*Client).Extension", Method, 0}, + {"(*Client).Hello", Method, 1}, + {"(*Client).Mail", Method, 0}, + {"(*Client).Noop", Method, 10}, + {"(*Client).Quit", Method, 0}, + {"(*Client).Rcpt", Method, 0}, + {"(*Client).Reset", Method, 0}, + {"(*Client).StartTLS", Method, 0}, + {"(*Client).TLSConnectionState", Method, 5}, + {"(*Client).Verify", Method, 0}, + {"Auth", Type, 0}, + {"CRAMMD5Auth", Func, 0}, + {"Client", Type, 0}, + {"Client.Text", Field, 0}, + {"Dial", Func, 0}, + {"NewClient", Func, 0}, + {"PlainAuth", Func, 0}, + {"SendMail", Func, 0}, + {"ServerInfo", Type, 0}, + {"ServerInfo.Auth", Field, 0}, + {"ServerInfo.Name", Field, 0}, + {"ServerInfo.TLS", Field, 0}, + }, + "net/textproto": { + {"(*Conn).Close", Method, 0}, + {"(*Conn).Cmd", Method, 0}, + {"(*Conn).DotReader", Method, 0}, + {"(*Conn).DotWriter", Method, 0}, + {"(*Conn).EndRequest", Method, 0}, + {"(*Conn).EndResponse", Method, 0}, + {"(*Conn).Next", Method, 0}, + {"(*Conn).PrintfLine", Method, 0}, + {"(*Conn).ReadCodeLine", Method, 0}, + {"(*Conn).ReadContinuedLine", Method, 0}, + {"(*Conn).ReadContinuedLineBytes", Method, 0}, + {"(*Conn).ReadDotBytes", Method, 0}, + {"(*Conn).ReadDotLines", Method, 0}, + {"(*Conn).ReadLine", Method, 0}, + {"(*Conn).ReadLineBytes", Method, 0}, + {"(*Conn).ReadMIMEHeader", Method, 0}, + {"(*Conn).ReadResponse", Method, 0}, + {"(*Conn).StartRequest", Method, 0}, + {"(*Conn).StartResponse", Method, 0}, + {"(*Error).Error", Method, 0}, + {"(*Pipeline).EndRequest", Method, 0}, + {"(*Pipeline).EndResponse", Method, 0}, + {"(*Pipeline).Next", Method, 0}, + {"(*Pipeline).StartRequest", Method, 0}, + {"(*Pipeline).StartResponse", Method, 0}, + {"(*Reader).DotReader", Method, 0}, + {"(*Reader).ReadCodeLine", Method, 0}, + {"(*Reader).ReadContinuedLine", Method, 0}, + {"(*Reader).ReadContinuedLineBytes", Method, 0}, + {"(*Reader).ReadDotBytes", Method, 0}, + {"(*Reader).ReadDotLines", Method, 0}, + {"(*Reader).ReadLine", Method, 0}, + {"(*Reader).ReadLineBytes", Method, 0}, + {"(*Reader).ReadMIMEHeader", Method, 0}, + {"(*Reader).ReadResponse", Method, 0}, + {"(*Writer).DotWriter", Method, 0}, + {"(*Writer).PrintfLine", Method, 0}, + {"(MIMEHeader).Add", Method, 0}, + {"(MIMEHeader).Del", Method, 0}, + {"(MIMEHeader).Get", Method, 0}, + {"(MIMEHeader).Set", Method, 0}, + {"(MIMEHeader).Values", Method, 14}, + {"(ProtocolError).Error", Method, 0}, + {"CanonicalMIMEHeaderKey", Func, 0}, + {"Conn", Type, 0}, + {"Conn.Pipeline", Field, 0}, + {"Conn.Reader", Field, 0}, + {"Conn.Writer", Field, 0}, + {"Dial", Func, 0}, + {"Error", Type, 0}, + {"Error.Code", Field, 0}, + {"Error.Msg", Field, 0}, + {"MIMEHeader", Type, 0}, + {"NewConn", Func, 0}, + {"NewReader", Func, 0}, + {"NewWriter", Func, 0}, + {"Pipeline", Type, 0}, + {"ProtocolError", Type, 0}, + {"Reader", Type, 0}, + {"Reader.R", Field, 0}, + {"TrimBytes", Func, 1}, + {"TrimString", Func, 1}, + {"Writer", Type, 0}, + {"Writer.W", Field, 0}, + }, + "net/url": { + {"(*Error).Error", Method, 0}, + {"(*Error).Temporary", Method, 6}, + {"(*Error).Timeout", Method, 6}, + {"(*Error).Unwrap", Method, 13}, + {"(*URL).EscapedFragment", Method, 15}, + {"(*URL).EscapedPath", Method, 5}, + {"(*URL).Hostname", Method, 8}, + {"(*URL).IsAbs", Method, 0}, + {"(*URL).JoinPath", Method, 19}, + {"(*URL).MarshalBinary", Method, 8}, + {"(*URL).Parse", Method, 0}, + {"(*URL).Port", Method, 8}, + {"(*URL).Query", Method, 0}, + {"(*URL).Redacted", Method, 15}, + {"(*URL).RequestURI", Method, 0}, + {"(*URL).ResolveReference", Method, 0}, + {"(*URL).String", Method, 0}, + {"(*URL).UnmarshalBinary", Method, 8}, + {"(*Userinfo).Password", Method, 0}, + {"(*Userinfo).String", Method, 0}, + {"(*Userinfo).Username", Method, 0}, + {"(EscapeError).Error", Method, 0}, + {"(InvalidHostError).Error", Method, 6}, + {"(Values).Add", Method, 0}, + {"(Values).Del", Method, 0}, + {"(Values).Encode", Method, 0}, + {"(Values).Get", Method, 0}, + {"(Values).Has", Method, 17}, + {"(Values).Set", Method, 0}, + {"Error", Type, 0}, + {"Error.Err", Field, 0}, + {"Error.Op", Field, 0}, + {"Error.URL", Field, 0}, + {"EscapeError", Type, 0}, + {"InvalidHostError", Type, 6}, + {"JoinPath", Func, 19}, + {"Parse", Func, 0}, + {"ParseQuery", Func, 0}, + {"ParseRequestURI", Func, 0}, + {"PathEscape", Func, 8}, + {"PathUnescape", Func, 8}, + {"QueryEscape", Func, 0}, + {"QueryUnescape", Func, 0}, + {"URL", Type, 0}, + {"URL.ForceQuery", Field, 7}, + {"URL.Fragment", Field, 0}, + {"URL.Host", Field, 0}, + {"URL.OmitHost", Field, 19}, + {"URL.Opaque", Field, 0}, + {"URL.Path", Field, 0}, + {"URL.RawFragment", Field, 15}, + {"URL.RawPath", Field, 5}, + {"URL.RawQuery", Field, 0}, + {"URL.Scheme", Field, 0}, + {"URL.User", Field, 0}, + {"User", Func, 0}, + {"UserPassword", Func, 0}, + {"Userinfo", Type, 0}, + {"Values", Type, 0}, + }, + "os": { + {"(*File).Chdir", Method, 0}, + {"(*File).Chmod", Method, 0}, + {"(*File).Chown", Method, 0}, + {"(*File).Close", Method, 0}, + {"(*File).Fd", Method, 0}, + {"(*File).Name", Method, 0}, + {"(*File).Read", Method, 0}, + {"(*File).ReadAt", Method, 0}, + {"(*File).ReadDir", Method, 16}, + {"(*File).ReadFrom", Method, 15}, + {"(*File).Readdir", Method, 0}, + {"(*File).Readdirnames", Method, 0}, + {"(*File).Seek", Method, 0}, + {"(*File).SetDeadline", Method, 10}, + {"(*File).SetReadDeadline", Method, 10}, + {"(*File).SetWriteDeadline", Method, 10}, + {"(*File).Stat", Method, 0}, + {"(*File).Sync", Method, 0}, + {"(*File).SyscallConn", Method, 12}, + {"(*File).Truncate", Method, 0}, + {"(*File).Write", Method, 0}, + {"(*File).WriteAt", Method, 0}, + {"(*File).WriteString", Method, 0}, + {"(*File).WriteTo", Method, 22}, + {"(*LinkError).Error", Method, 0}, + {"(*LinkError).Unwrap", Method, 13}, + {"(*PathError).Error", Method, 0}, + {"(*PathError).Timeout", Method, 10}, + {"(*PathError).Unwrap", Method, 13}, + {"(*Process).Kill", Method, 0}, + {"(*Process).Release", Method, 0}, + {"(*Process).Signal", Method, 0}, + {"(*Process).Wait", Method, 0}, + {"(*ProcessState).ExitCode", Method, 12}, + {"(*ProcessState).Exited", Method, 0}, + {"(*ProcessState).Pid", Method, 0}, + {"(*ProcessState).String", Method, 0}, + {"(*ProcessState).Success", Method, 0}, + {"(*ProcessState).Sys", Method, 0}, + {"(*ProcessState).SysUsage", Method, 0}, + {"(*ProcessState).SystemTime", Method, 0}, + {"(*ProcessState).UserTime", Method, 0}, + {"(*SyscallError).Error", Method, 0}, + {"(*SyscallError).Timeout", Method, 10}, + {"(*SyscallError).Unwrap", Method, 13}, + {"(FileMode).IsDir", Method, 0}, + {"(FileMode).IsRegular", Method, 1}, + {"(FileMode).Perm", Method, 0}, + {"(FileMode).String", Method, 0}, + {"Args", Var, 0}, + {"Chdir", Func, 0}, + {"Chmod", Func, 0}, + {"Chown", Func, 0}, + {"Chtimes", Func, 0}, + {"Clearenv", Func, 0}, + {"CopyFS", Func, 23}, + {"Create", Func, 0}, + {"CreateTemp", Func, 16}, + {"DevNull", Const, 0}, + {"DirEntry", Type, 16}, + {"DirFS", Func, 16}, + {"Environ", Func, 0}, + {"ErrClosed", Var, 8}, + {"ErrDeadlineExceeded", Var, 15}, + {"ErrExist", Var, 0}, + {"ErrInvalid", Var, 0}, + {"ErrNoDeadline", Var, 10}, + {"ErrNotExist", Var, 0}, + {"ErrPermission", Var, 0}, + {"ErrProcessDone", Var, 16}, + {"Executable", Func, 8}, + {"Exit", Func, 0}, + {"Expand", Func, 0}, + {"ExpandEnv", Func, 0}, + {"File", Type, 0}, + {"FileInfo", Type, 0}, + {"FileMode", Type, 0}, + {"FindProcess", Func, 0}, + {"Getegid", Func, 0}, + {"Getenv", Func, 0}, + {"Geteuid", Func, 0}, + {"Getgid", Func, 0}, + {"Getgroups", Func, 0}, + {"Getpagesize", Func, 0}, + {"Getpid", Func, 0}, + {"Getppid", Func, 0}, + {"Getuid", Func, 0}, + {"Getwd", Func, 0}, + {"Hostname", Func, 0}, + {"Interrupt", Var, 0}, + {"IsExist", Func, 0}, + {"IsNotExist", Func, 0}, + {"IsPathSeparator", Func, 0}, + {"IsPermission", Func, 0}, + {"IsTimeout", Func, 10}, + {"Kill", Var, 0}, + {"Lchown", Func, 0}, + {"Link", Func, 0}, + {"LinkError", Type, 0}, + {"LinkError.Err", Field, 0}, + {"LinkError.New", Field, 0}, + {"LinkError.Old", Field, 0}, + {"LinkError.Op", Field, 0}, + {"LookupEnv", Func, 5}, + {"Lstat", Func, 0}, + {"Mkdir", Func, 0}, + {"MkdirAll", Func, 0}, + {"MkdirTemp", Func, 16}, + {"ModeAppend", Const, 0}, + {"ModeCharDevice", Const, 0}, + {"ModeDevice", Const, 0}, + {"ModeDir", Const, 0}, + {"ModeExclusive", Const, 0}, + {"ModeIrregular", Const, 11}, + {"ModeNamedPipe", Const, 0}, + {"ModePerm", Const, 0}, + {"ModeSetgid", Const, 0}, + {"ModeSetuid", Const, 0}, + {"ModeSocket", Const, 0}, + {"ModeSticky", Const, 0}, + {"ModeSymlink", Const, 0}, + {"ModeTemporary", Const, 0}, + {"ModeType", Const, 0}, + {"NewFile", Func, 0}, + {"NewSyscallError", Func, 0}, + {"O_APPEND", Const, 0}, + {"O_CREATE", Const, 0}, + {"O_EXCL", Const, 0}, + {"O_RDONLY", Const, 0}, + {"O_RDWR", Const, 0}, + {"O_SYNC", Const, 0}, + {"O_TRUNC", Const, 0}, + {"O_WRONLY", Const, 0}, + {"Open", Func, 0}, + {"OpenFile", Func, 0}, + {"PathError", Type, 0}, + {"PathError.Err", Field, 0}, + {"PathError.Op", Field, 0}, + {"PathError.Path", Field, 0}, + {"PathListSeparator", Const, 0}, + {"PathSeparator", Const, 0}, + {"Pipe", Func, 0}, + {"ProcAttr", Type, 0}, + {"ProcAttr.Dir", Field, 0}, + {"ProcAttr.Env", Field, 0}, + {"ProcAttr.Files", Field, 0}, + {"ProcAttr.Sys", Field, 0}, + {"Process", Type, 0}, + {"Process.Pid", Field, 0}, + {"ProcessState", Type, 0}, + {"ReadDir", Func, 16}, + {"ReadFile", Func, 16}, + {"Readlink", Func, 0}, + {"Remove", Func, 0}, + {"RemoveAll", Func, 0}, + {"Rename", Func, 0}, + {"SEEK_CUR", Const, 0}, + {"SEEK_END", Const, 0}, + {"SEEK_SET", Const, 0}, + {"SameFile", Func, 0}, + {"Setenv", Func, 0}, + {"Signal", Type, 0}, + {"StartProcess", Func, 0}, + {"Stat", Func, 0}, + {"Stderr", Var, 0}, + {"Stdin", Var, 0}, + {"Stdout", Var, 0}, + {"Symlink", Func, 0}, + {"SyscallError", Type, 0}, + {"SyscallError.Err", Field, 0}, + {"SyscallError.Syscall", Field, 0}, + {"TempDir", Func, 0}, + {"Truncate", Func, 0}, + {"Unsetenv", Func, 4}, + {"UserCacheDir", Func, 11}, + {"UserConfigDir", Func, 13}, + {"UserHomeDir", Func, 12}, + {"WriteFile", Func, 16}, + }, + "os/exec": { + {"(*Cmd).CombinedOutput", Method, 0}, + {"(*Cmd).Environ", Method, 19}, + {"(*Cmd).Output", Method, 0}, + {"(*Cmd).Run", Method, 0}, + {"(*Cmd).Start", Method, 0}, + {"(*Cmd).StderrPipe", Method, 0}, + {"(*Cmd).StdinPipe", Method, 0}, + {"(*Cmd).StdoutPipe", Method, 0}, + {"(*Cmd).String", Method, 13}, + {"(*Cmd).Wait", Method, 0}, + {"(*Error).Error", Method, 0}, + {"(*Error).Unwrap", Method, 13}, + {"(*ExitError).Error", Method, 0}, + {"(ExitError).ExitCode", Method, 12}, + {"(ExitError).Exited", Method, 0}, + {"(ExitError).Pid", Method, 0}, + {"(ExitError).String", Method, 0}, + {"(ExitError).Success", Method, 0}, + {"(ExitError).Sys", Method, 0}, + {"(ExitError).SysUsage", Method, 0}, + {"(ExitError).SystemTime", Method, 0}, + {"(ExitError).UserTime", Method, 0}, + {"Cmd", Type, 0}, + {"Cmd.Args", Field, 0}, + {"Cmd.Cancel", Field, 20}, + {"Cmd.Dir", Field, 0}, + {"Cmd.Env", Field, 0}, + {"Cmd.Err", Field, 19}, + {"Cmd.ExtraFiles", Field, 0}, + {"Cmd.Path", Field, 0}, + {"Cmd.Process", Field, 0}, + {"Cmd.ProcessState", Field, 0}, + {"Cmd.Stderr", Field, 0}, + {"Cmd.Stdin", Field, 0}, + {"Cmd.Stdout", Field, 0}, + {"Cmd.SysProcAttr", Field, 0}, + {"Cmd.WaitDelay", Field, 20}, + {"Command", Func, 0}, + {"CommandContext", Func, 7}, + {"ErrDot", Var, 19}, + {"ErrNotFound", Var, 0}, + {"ErrWaitDelay", Var, 20}, + {"Error", Type, 0}, + {"Error.Err", Field, 0}, + {"Error.Name", Field, 0}, + {"ExitError", Type, 0}, + {"ExitError.ProcessState", Field, 0}, + {"ExitError.Stderr", Field, 6}, + {"LookPath", Func, 0}, + }, + "os/signal": { + {"Ignore", Func, 5}, + {"Ignored", Func, 11}, + {"Notify", Func, 0}, + {"NotifyContext", Func, 16}, + {"Reset", Func, 5}, + {"Stop", Func, 1}, + }, + "os/user": { + {"(*User).GroupIds", Method, 7}, + {"(UnknownGroupError).Error", Method, 7}, + {"(UnknownGroupIdError).Error", Method, 7}, + {"(UnknownUserError).Error", Method, 0}, + {"(UnknownUserIdError).Error", Method, 0}, + {"Current", Func, 0}, + {"Group", Type, 7}, + {"Group.Gid", Field, 7}, + {"Group.Name", Field, 7}, + {"Lookup", Func, 0}, + {"LookupGroup", Func, 7}, + {"LookupGroupId", Func, 7}, + {"LookupId", Func, 0}, + {"UnknownGroupError", Type, 7}, + {"UnknownGroupIdError", Type, 7}, + {"UnknownUserError", Type, 0}, + {"UnknownUserIdError", Type, 0}, + {"User", Type, 0}, + {"User.Gid", Field, 0}, + {"User.HomeDir", Field, 0}, + {"User.Name", Field, 0}, + {"User.Uid", Field, 0}, + {"User.Username", Field, 0}, + }, + "path": { + {"Base", Func, 0}, + {"Clean", Func, 0}, + {"Dir", Func, 0}, + {"ErrBadPattern", Var, 0}, + {"Ext", Func, 0}, + {"IsAbs", Func, 0}, + {"Join", Func, 0}, + {"Match", Func, 0}, + {"Split", Func, 0}, + }, + "path/filepath": { + {"Abs", Func, 0}, + {"Base", Func, 0}, + {"Clean", Func, 0}, + {"Dir", Func, 0}, + {"ErrBadPattern", Var, 0}, + {"EvalSymlinks", Func, 0}, + {"Ext", Func, 0}, + {"FromSlash", Func, 0}, + {"Glob", Func, 0}, + {"HasPrefix", Func, 0}, + {"IsAbs", Func, 0}, + {"IsLocal", Func, 20}, + {"Join", Func, 0}, + {"ListSeparator", Const, 0}, + {"Localize", Func, 23}, + {"Match", Func, 0}, + {"Rel", Func, 0}, + {"Separator", Const, 0}, + {"SkipAll", Var, 20}, + {"SkipDir", Var, 0}, + {"Split", Func, 0}, + {"SplitList", Func, 0}, + {"ToSlash", Func, 0}, + {"VolumeName", Func, 0}, + {"Walk", Func, 0}, + {"WalkDir", Func, 16}, + {"WalkFunc", Type, 0}, + }, + "plugin": { + {"(*Plugin).Lookup", Method, 8}, + {"Open", Func, 8}, + {"Plugin", Type, 8}, + {"Symbol", Type, 8}, + }, + "reflect": { + {"(*MapIter).Key", Method, 12}, + {"(*MapIter).Next", Method, 12}, + {"(*MapIter).Reset", Method, 18}, + {"(*MapIter).Value", Method, 12}, + {"(*ValueError).Error", Method, 0}, + {"(ChanDir).String", Method, 0}, + {"(Kind).String", Method, 0}, + {"(Method).IsExported", Method, 17}, + {"(StructField).IsExported", Method, 17}, + {"(StructTag).Get", Method, 0}, + {"(StructTag).Lookup", Method, 7}, + {"(Value).Addr", Method, 0}, + {"(Value).Bool", Method, 0}, + {"(Value).Bytes", Method, 0}, + {"(Value).Call", Method, 0}, + {"(Value).CallSlice", Method, 0}, + {"(Value).CanAddr", Method, 0}, + {"(Value).CanComplex", Method, 18}, + {"(Value).CanConvert", Method, 17}, + {"(Value).CanFloat", Method, 18}, + {"(Value).CanInt", Method, 18}, + {"(Value).CanInterface", Method, 0}, + {"(Value).CanSet", Method, 0}, + {"(Value).CanUint", Method, 18}, + {"(Value).Cap", Method, 0}, + {"(Value).Clear", Method, 21}, + {"(Value).Close", Method, 0}, + {"(Value).Comparable", Method, 20}, + {"(Value).Complex", Method, 0}, + {"(Value).Convert", Method, 1}, + {"(Value).Elem", Method, 0}, + {"(Value).Equal", Method, 20}, + {"(Value).Field", Method, 0}, + {"(Value).FieldByIndex", Method, 0}, + {"(Value).FieldByIndexErr", Method, 18}, + {"(Value).FieldByName", Method, 0}, + {"(Value).FieldByNameFunc", Method, 0}, + {"(Value).Float", Method, 0}, + {"(Value).Grow", Method, 20}, + {"(Value).Index", Method, 0}, + {"(Value).Int", Method, 0}, + {"(Value).Interface", Method, 0}, + {"(Value).InterfaceData", Method, 0}, + {"(Value).IsNil", Method, 0}, + {"(Value).IsValid", Method, 0}, + {"(Value).IsZero", Method, 13}, + {"(Value).Kind", Method, 0}, + {"(Value).Len", Method, 0}, + {"(Value).MapIndex", Method, 0}, + {"(Value).MapKeys", Method, 0}, + {"(Value).MapRange", Method, 12}, + {"(Value).Method", Method, 0}, + {"(Value).MethodByName", Method, 0}, + {"(Value).NumField", Method, 0}, + {"(Value).NumMethod", Method, 0}, + {"(Value).OverflowComplex", Method, 0}, + {"(Value).OverflowFloat", Method, 0}, + {"(Value).OverflowInt", Method, 0}, + {"(Value).OverflowUint", Method, 0}, + {"(Value).Pointer", Method, 0}, + {"(Value).Recv", Method, 0}, + {"(Value).Send", Method, 0}, + {"(Value).Seq", Method, 23}, + {"(Value).Seq2", Method, 23}, + {"(Value).Set", Method, 0}, + {"(Value).SetBool", Method, 0}, + {"(Value).SetBytes", Method, 0}, + {"(Value).SetCap", Method, 2}, + {"(Value).SetComplex", Method, 0}, + {"(Value).SetFloat", Method, 0}, + {"(Value).SetInt", Method, 0}, + {"(Value).SetIterKey", Method, 18}, + {"(Value).SetIterValue", Method, 18}, + {"(Value).SetLen", Method, 0}, + {"(Value).SetMapIndex", Method, 0}, + {"(Value).SetPointer", Method, 0}, + {"(Value).SetString", Method, 0}, + {"(Value).SetUint", Method, 0}, + {"(Value).SetZero", Method, 20}, + {"(Value).Slice", Method, 0}, + {"(Value).Slice3", Method, 2}, + {"(Value).String", Method, 0}, + {"(Value).TryRecv", Method, 0}, + {"(Value).TrySend", Method, 0}, + {"(Value).Type", Method, 0}, + {"(Value).Uint", Method, 0}, + {"(Value).UnsafeAddr", Method, 0}, + {"(Value).UnsafePointer", Method, 18}, + {"Append", Func, 0}, + {"AppendSlice", Func, 0}, + {"Array", Const, 0}, + {"ArrayOf", Func, 5}, + {"Bool", Const, 0}, + {"BothDir", Const, 0}, + {"Chan", Const, 0}, + {"ChanDir", Type, 0}, + {"ChanOf", Func, 1}, + {"Complex128", Const, 0}, + {"Complex64", Const, 0}, + {"Copy", Func, 0}, + {"DeepEqual", Func, 0}, + {"Float32", Const, 0}, + {"Float64", Const, 0}, + {"Func", Const, 0}, + {"FuncOf", Func, 5}, + {"Indirect", Func, 0}, + {"Int", Const, 0}, + {"Int16", Const, 0}, + {"Int32", Const, 0}, + {"Int64", Const, 0}, + {"Int8", Const, 0}, + {"Interface", Const, 0}, + {"Invalid", Const, 0}, + {"Kind", Type, 0}, + {"MakeChan", Func, 0}, + {"MakeFunc", Func, 1}, + {"MakeMap", Func, 0}, + {"MakeMapWithSize", Func, 9}, + {"MakeSlice", Func, 0}, + {"Map", Const, 0}, + {"MapIter", Type, 12}, + {"MapOf", Func, 1}, + {"Method", Type, 0}, + {"Method.Func", Field, 0}, + {"Method.Index", Field, 0}, + {"Method.Name", Field, 0}, + {"Method.PkgPath", Field, 0}, + {"Method.Type", Field, 0}, + {"New", Func, 0}, + {"NewAt", Func, 0}, + {"Pointer", Const, 18}, + {"PointerTo", Func, 18}, + {"Ptr", Const, 0}, + {"PtrTo", Func, 0}, + {"RecvDir", Const, 0}, + {"Select", Func, 1}, + {"SelectCase", Type, 1}, + {"SelectCase.Chan", Field, 1}, + {"SelectCase.Dir", Field, 1}, + {"SelectCase.Send", Field, 1}, + {"SelectDefault", Const, 1}, + {"SelectDir", Type, 1}, + {"SelectRecv", Const, 1}, + {"SelectSend", Const, 1}, + {"SendDir", Const, 0}, + {"Slice", Const, 0}, + {"SliceAt", Func, 23}, + {"SliceHeader", Type, 0}, + {"SliceHeader.Cap", Field, 0}, + {"SliceHeader.Data", Field, 0}, + {"SliceHeader.Len", Field, 0}, + {"SliceOf", Func, 1}, + {"String", Const, 0}, + {"StringHeader", Type, 0}, + {"StringHeader.Data", Field, 0}, + {"StringHeader.Len", Field, 0}, + {"Struct", Const, 0}, + {"StructField", Type, 0}, + {"StructField.Anonymous", Field, 0}, + {"StructField.Index", Field, 0}, + {"StructField.Name", Field, 0}, + {"StructField.Offset", Field, 0}, + {"StructField.PkgPath", Field, 0}, + {"StructField.Tag", Field, 0}, + {"StructField.Type", Field, 0}, + {"StructOf", Func, 7}, + {"StructTag", Type, 0}, + {"Swapper", Func, 8}, + {"Type", Type, 0}, + {"TypeFor", Func, 22}, + {"TypeOf", Func, 0}, + {"Uint", Const, 0}, + {"Uint16", Const, 0}, + {"Uint32", Const, 0}, + {"Uint64", Const, 0}, + {"Uint8", Const, 0}, + {"Uintptr", Const, 0}, + {"UnsafePointer", Const, 0}, + {"Value", Type, 0}, + {"ValueError", Type, 0}, + {"ValueError.Kind", Field, 0}, + {"ValueError.Method", Field, 0}, + {"ValueOf", Func, 0}, + {"VisibleFields", Func, 17}, + {"Zero", Func, 0}, + }, + "regexp": { + {"(*Regexp).Copy", Method, 6}, + {"(*Regexp).Expand", Method, 0}, + {"(*Regexp).ExpandString", Method, 0}, + {"(*Regexp).Find", Method, 0}, + {"(*Regexp).FindAll", Method, 0}, + {"(*Regexp).FindAllIndex", Method, 0}, + {"(*Regexp).FindAllString", Method, 0}, + {"(*Regexp).FindAllStringIndex", Method, 0}, + {"(*Regexp).FindAllStringSubmatch", Method, 0}, + {"(*Regexp).FindAllStringSubmatchIndex", Method, 0}, + {"(*Regexp).FindAllSubmatch", Method, 0}, + {"(*Regexp).FindAllSubmatchIndex", Method, 0}, + {"(*Regexp).FindIndex", Method, 0}, + {"(*Regexp).FindReaderIndex", Method, 0}, + {"(*Regexp).FindReaderSubmatchIndex", Method, 0}, + {"(*Regexp).FindString", Method, 0}, + {"(*Regexp).FindStringIndex", Method, 0}, + {"(*Regexp).FindStringSubmatch", Method, 0}, + {"(*Regexp).FindStringSubmatchIndex", Method, 0}, + {"(*Regexp).FindSubmatch", Method, 0}, + {"(*Regexp).FindSubmatchIndex", Method, 0}, + {"(*Regexp).LiteralPrefix", Method, 0}, + {"(*Regexp).Longest", Method, 1}, + {"(*Regexp).MarshalText", Method, 21}, + {"(*Regexp).Match", Method, 0}, + {"(*Regexp).MatchReader", Method, 0}, + {"(*Regexp).MatchString", Method, 0}, + {"(*Regexp).NumSubexp", Method, 0}, + {"(*Regexp).ReplaceAll", Method, 0}, + {"(*Regexp).ReplaceAllFunc", Method, 0}, + {"(*Regexp).ReplaceAllLiteral", Method, 0}, + {"(*Regexp).ReplaceAllLiteralString", Method, 0}, + {"(*Regexp).ReplaceAllString", Method, 0}, + {"(*Regexp).ReplaceAllStringFunc", Method, 0}, + {"(*Regexp).Split", Method, 1}, + {"(*Regexp).String", Method, 0}, + {"(*Regexp).SubexpIndex", Method, 15}, + {"(*Regexp).SubexpNames", Method, 0}, + {"(*Regexp).UnmarshalText", Method, 21}, + {"Compile", Func, 0}, + {"CompilePOSIX", Func, 0}, + {"Match", Func, 0}, + {"MatchReader", Func, 0}, + {"MatchString", Func, 0}, + {"MustCompile", Func, 0}, + {"MustCompilePOSIX", Func, 0}, + {"QuoteMeta", Func, 0}, + {"Regexp", Type, 0}, + }, + "regexp/syntax": { + {"(*Error).Error", Method, 0}, + {"(*Inst).MatchEmptyWidth", Method, 0}, + {"(*Inst).MatchRune", Method, 0}, + {"(*Inst).MatchRunePos", Method, 3}, + {"(*Inst).String", Method, 0}, + {"(*Prog).Prefix", Method, 0}, + {"(*Prog).StartCond", Method, 0}, + {"(*Prog).String", Method, 0}, + {"(*Regexp).CapNames", Method, 0}, + {"(*Regexp).Equal", Method, 0}, + {"(*Regexp).MaxCap", Method, 0}, + {"(*Regexp).Simplify", Method, 0}, + {"(*Regexp).String", Method, 0}, + {"(ErrorCode).String", Method, 0}, + {"(InstOp).String", Method, 3}, + {"(Op).String", Method, 11}, + {"ClassNL", Const, 0}, + {"Compile", Func, 0}, + {"DotNL", Const, 0}, + {"EmptyBeginLine", Const, 0}, + {"EmptyBeginText", Const, 0}, + {"EmptyEndLine", Const, 0}, + {"EmptyEndText", Const, 0}, + {"EmptyNoWordBoundary", Const, 0}, + {"EmptyOp", Type, 0}, + {"EmptyOpContext", Func, 0}, + {"EmptyWordBoundary", Const, 0}, + {"ErrInternalError", Const, 0}, + {"ErrInvalidCharClass", Const, 0}, + {"ErrInvalidCharRange", Const, 0}, + {"ErrInvalidEscape", Const, 0}, + {"ErrInvalidNamedCapture", Const, 0}, + {"ErrInvalidPerlOp", Const, 0}, + {"ErrInvalidRepeatOp", Const, 0}, + {"ErrInvalidRepeatSize", Const, 0}, + {"ErrInvalidUTF8", Const, 0}, + {"ErrLarge", Const, 20}, + {"ErrMissingBracket", Const, 0}, + {"ErrMissingParen", Const, 0}, + {"ErrMissingRepeatArgument", Const, 0}, + {"ErrNestingDepth", Const, 19}, + {"ErrTrailingBackslash", Const, 0}, + {"ErrUnexpectedParen", Const, 1}, + {"Error", Type, 0}, + {"Error.Code", Field, 0}, + {"Error.Expr", Field, 0}, + {"ErrorCode", Type, 0}, + {"Flags", Type, 0}, + {"FoldCase", Const, 0}, + {"Inst", Type, 0}, + {"Inst.Arg", Field, 0}, + {"Inst.Op", Field, 0}, + {"Inst.Out", Field, 0}, + {"Inst.Rune", Field, 0}, + {"InstAlt", Const, 0}, + {"InstAltMatch", Const, 0}, + {"InstCapture", Const, 0}, + {"InstEmptyWidth", Const, 0}, + {"InstFail", Const, 0}, + {"InstMatch", Const, 0}, + {"InstNop", Const, 0}, + {"InstOp", Type, 0}, + {"InstRune", Const, 0}, + {"InstRune1", Const, 0}, + {"InstRuneAny", Const, 0}, + {"InstRuneAnyNotNL", Const, 0}, + {"IsWordChar", Func, 0}, + {"Literal", Const, 0}, + {"MatchNL", Const, 0}, + {"NonGreedy", Const, 0}, + {"OneLine", Const, 0}, + {"Op", Type, 0}, + {"OpAlternate", Const, 0}, + {"OpAnyChar", Const, 0}, + {"OpAnyCharNotNL", Const, 0}, + {"OpBeginLine", Const, 0}, + {"OpBeginText", Const, 0}, + {"OpCapture", Const, 0}, + {"OpCharClass", Const, 0}, + {"OpConcat", Const, 0}, + {"OpEmptyMatch", Const, 0}, + {"OpEndLine", Const, 0}, + {"OpEndText", Const, 0}, + {"OpLiteral", Const, 0}, + {"OpNoMatch", Const, 0}, + {"OpNoWordBoundary", Const, 0}, + {"OpPlus", Const, 0}, + {"OpQuest", Const, 0}, + {"OpRepeat", Const, 0}, + {"OpStar", Const, 0}, + {"OpWordBoundary", Const, 0}, + {"POSIX", Const, 0}, + {"Parse", Func, 0}, + {"Perl", Const, 0}, + {"PerlX", Const, 0}, + {"Prog", Type, 0}, + {"Prog.Inst", Field, 0}, + {"Prog.NumCap", Field, 0}, + {"Prog.Start", Field, 0}, + {"Regexp", Type, 0}, + {"Regexp.Cap", Field, 0}, + {"Regexp.Flags", Field, 0}, + {"Regexp.Max", Field, 0}, + {"Regexp.Min", Field, 0}, + {"Regexp.Name", Field, 0}, + {"Regexp.Op", Field, 0}, + {"Regexp.Rune", Field, 0}, + {"Regexp.Rune0", Field, 0}, + {"Regexp.Sub", Field, 0}, + {"Regexp.Sub0", Field, 0}, + {"Simple", Const, 0}, + {"UnicodeGroups", Const, 0}, + {"WasDollar", Const, 0}, + }, + "runtime": { + {"(*BlockProfileRecord).Stack", Method, 1}, + {"(*Frames).Next", Method, 7}, + {"(*Func).Entry", Method, 0}, + {"(*Func).FileLine", Method, 0}, + {"(*Func).Name", Method, 0}, + {"(*MemProfileRecord).InUseBytes", Method, 0}, + {"(*MemProfileRecord).InUseObjects", Method, 0}, + {"(*MemProfileRecord).Stack", Method, 0}, + {"(*PanicNilError).Error", Method, 21}, + {"(*PanicNilError).RuntimeError", Method, 21}, + {"(*Pinner).Pin", Method, 21}, + {"(*Pinner).Unpin", Method, 21}, + {"(*StackRecord).Stack", Method, 0}, + {"(*TypeAssertionError).Error", Method, 0}, + {"(*TypeAssertionError).RuntimeError", Method, 0}, + {"BlockProfile", Func, 1}, + {"BlockProfileRecord", Type, 1}, + {"BlockProfileRecord.Count", Field, 1}, + {"BlockProfileRecord.Cycles", Field, 1}, + {"BlockProfileRecord.StackRecord", Field, 1}, + {"Breakpoint", Func, 0}, + {"CPUProfile", Func, 0}, + {"Caller", Func, 0}, + {"Callers", Func, 0}, + {"CallersFrames", Func, 7}, + {"Compiler", Const, 0}, + {"Error", Type, 0}, + {"Frame", Type, 7}, + {"Frame.Entry", Field, 7}, + {"Frame.File", Field, 7}, + {"Frame.Func", Field, 7}, + {"Frame.Function", Field, 7}, + {"Frame.Line", Field, 7}, + {"Frame.PC", Field, 7}, + {"Frames", Type, 7}, + {"Func", Type, 0}, + {"FuncForPC", Func, 0}, + {"GC", Func, 0}, + {"GOARCH", Const, 0}, + {"GOMAXPROCS", Func, 0}, + {"GOOS", Const, 0}, + {"GOROOT", Func, 0}, + {"Goexit", Func, 0}, + {"GoroutineProfile", Func, 0}, + {"Gosched", Func, 0}, + {"KeepAlive", Func, 7}, + {"LockOSThread", Func, 0}, + {"MemProfile", Func, 0}, + {"MemProfileRate", Var, 0}, + {"MemProfileRecord", Type, 0}, + {"MemProfileRecord.AllocBytes", Field, 0}, + {"MemProfileRecord.AllocObjects", Field, 0}, + {"MemProfileRecord.FreeBytes", Field, 0}, + {"MemProfileRecord.FreeObjects", Field, 0}, + {"MemProfileRecord.Stack0", Field, 0}, + {"MemStats", Type, 0}, + {"MemStats.Alloc", Field, 0}, + {"MemStats.BuckHashSys", Field, 0}, + {"MemStats.BySize", Field, 0}, + {"MemStats.DebugGC", Field, 0}, + {"MemStats.EnableGC", Field, 0}, + {"MemStats.Frees", Field, 0}, + {"MemStats.GCCPUFraction", Field, 5}, + {"MemStats.GCSys", Field, 2}, + {"MemStats.HeapAlloc", Field, 0}, + {"MemStats.HeapIdle", Field, 0}, + {"MemStats.HeapInuse", Field, 0}, + {"MemStats.HeapObjects", Field, 0}, + {"MemStats.HeapReleased", Field, 0}, + {"MemStats.HeapSys", Field, 0}, + {"MemStats.LastGC", Field, 0}, + {"MemStats.Lookups", Field, 0}, + {"MemStats.MCacheInuse", Field, 0}, + {"MemStats.MCacheSys", Field, 0}, + {"MemStats.MSpanInuse", Field, 0}, + {"MemStats.MSpanSys", Field, 0}, + {"MemStats.Mallocs", Field, 0}, + {"MemStats.NextGC", Field, 0}, + {"MemStats.NumForcedGC", Field, 8}, + {"MemStats.NumGC", Field, 0}, + {"MemStats.OtherSys", Field, 2}, + {"MemStats.PauseEnd", Field, 4}, + {"MemStats.PauseNs", Field, 0}, + {"MemStats.PauseTotalNs", Field, 0}, + {"MemStats.StackInuse", Field, 0}, + {"MemStats.StackSys", Field, 0}, + {"MemStats.Sys", Field, 0}, + {"MemStats.TotalAlloc", Field, 0}, + {"MutexProfile", Func, 8}, + {"NumCPU", Func, 0}, + {"NumCgoCall", Func, 0}, + {"NumGoroutine", Func, 0}, + {"PanicNilError", Type, 21}, + {"Pinner", Type, 21}, + {"ReadMemStats", Func, 0}, + {"ReadTrace", Func, 5}, + {"SetBlockProfileRate", Func, 1}, + {"SetCPUProfileRate", Func, 0}, + {"SetCgoTraceback", Func, 7}, + {"SetFinalizer", Func, 0}, + {"SetMutexProfileFraction", Func, 8}, + {"Stack", Func, 0}, + {"StackRecord", Type, 0}, + {"StackRecord.Stack0", Field, 0}, + {"StartTrace", Func, 5}, + {"StopTrace", Func, 5}, + {"ThreadCreateProfile", Func, 0}, + {"TypeAssertionError", Type, 0}, + {"UnlockOSThread", Func, 0}, + {"Version", Func, 0}, + }, + "runtime/cgo": { + {"(Handle).Delete", Method, 17}, + {"(Handle).Value", Method, 17}, + {"Handle", Type, 17}, + {"Incomplete", Type, 20}, + {"NewHandle", Func, 17}, + }, + "runtime/coverage": { + {"ClearCounters", Func, 20}, + {"WriteCounters", Func, 20}, + {"WriteCountersDir", Func, 20}, + {"WriteMeta", Func, 20}, + {"WriteMetaDir", Func, 20}, + }, + "runtime/debug": { + {"(*BuildInfo).String", Method, 18}, + {"BuildInfo", Type, 12}, + {"BuildInfo.Deps", Field, 12}, + {"BuildInfo.GoVersion", Field, 18}, + {"BuildInfo.Main", Field, 12}, + {"BuildInfo.Path", Field, 12}, + {"BuildInfo.Settings", Field, 18}, + {"BuildSetting", Type, 18}, + {"BuildSetting.Key", Field, 18}, + {"BuildSetting.Value", Field, 18}, + {"CrashOptions", Type, 23}, + {"FreeOSMemory", Func, 1}, + {"GCStats", Type, 1}, + {"GCStats.LastGC", Field, 1}, + {"GCStats.NumGC", Field, 1}, + {"GCStats.Pause", Field, 1}, + {"GCStats.PauseEnd", Field, 4}, + {"GCStats.PauseQuantiles", Field, 1}, + {"GCStats.PauseTotal", Field, 1}, + {"Module", Type, 12}, + {"Module.Path", Field, 12}, + {"Module.Replace", Field, 12}, + {"Module.Sum", Field, 12}, + {"Module.Version", Field, 12}, + {"ParseBuildInfo", Func, 18}, + {"PrintStack", Func, 0}, + {"ReadBuildInfo", Func, 12}, + {"ReadGCStats", Func, 1}, + {"SetCrashOutput", Func, 23}, + {"SetGCPercent", Func, 1}, + {"SetMaxStack", Func, 2}, + {"SetMaxThreads", Func, 2}, + {"SetMemoryLimit", Func, 19}, + {"SetPanicOnFault", Func, 3}, + {"SetTraceback", Func, 6}, + {"Stack", Func, 0}, + {"WriteHeapDump", Func, 3}, + }, + "runtime/metrics": { + {"(Value).Float64", Method, 16}, + {"(Value).Float64Histogram", Method, 16}, + {"(Value).Kind", Method, 16}, + {"(Value).Uint64", Method, 16}, + {"All", Func, 16}, + {"Description", Type, 16}, + {"Description.Cumulative", Field, 16}, + {"Description.Description", Field, 16}, + {"Description.Kind", Field, 16}, + {"Description.Name", Field, 16}, + {"Float64Histogram", Type, 16}, + {"Float64Histogram.Buckets", Field, 16}, + {"Float64Histogram.Counts", Field, 16}, + {"KindBad", Const, 16}, + {"KindFloat64", Const, 16}, + {"KindFloat64Histogram", Const, 16}, + {"KindUint64", Const, 16}, + {"Read", Func, 16}, + {"Sample", Type, 16}, + {"Sample.Name", Field, 16}, + {"Sample.Value", Field, 16}, + {"Value", Type, 16}, + {"ValueKind", Type, 16}, + }, + "runtime/pprof": { + {"(*Profile).Add", Method, 0}, + {"(*Profile).Count", Method, 0}, + {"(*Profile).Name", Method, 0}, + {"(*Profile).Remove", Method, 0}, + {"(*Profile).WriteTo", Method, 0}, + {"Do", Func, 9}, + {"ForLabels", Func, 9}, + {"Label", Func, 9}, + {"LabelSet", Type, 9}, + {"Labels", Func, 9}, + {"Lookup", Func, 0}, + {"NewProfile", Func, 0}, + {"Profile", Type, 0}, + {"Profiles", Func, 0}, + {"SetGoroutineLabels", Func, 9}, + {"StartCPUProfile", Func, 0}, + {"StopCPUProfile", Func, 0}, + {"WithLabels", Func, 9}, + {"WriteHeapProfile", Func, 0}, + }, + "runtime/trace": { + {"(*Region).End", Method, 11}, + {"(*Task).End", Method, 11}, + {"IsEnabled", Func, 11}, + {"Log", Func, 11}, + {"Logf", Func, 11}, + {"NewTask", Func, 11}, + {"Region", Type, 11}, + {"Start", Func, 5}, + {"StartRegion", Func, 11}, + {"Stop", Func, 5}, + {"Task", Type, 11}, + {"WithRegion", Func, 11}, + }, + "slices": { + {"All", Func, 23}, + {"AppendSeq", Func, 23}, + {"Backward", Func, 23}, + {"BinarySearch", Func, 21}, + {"BinarySearchFunc", Func, 21}, + {"Chunk", Func, 23}, + {"Clip", Func, 21}, + {"Clone", Func, 21}, + {"Collect", Func, 23}, + {"Compact", Func, 21}, + {"CompactFunc", Func, 21}, + {"Compare", Func, 21}, + {"CompareFunc", Func, 21}, + {"Concat", Func, 22}, + {"Contains", Func, 21}, + {"ContainsFunc", Func, 21}, + {"Delete", Func, 21}, + {"DeleteFunc", Func, 21}, + {"Equal", Func, 21}, + {"EqualFunc", Func, 21}, + {"Grow", Func, 21}, + {"Index", Func, 21}, + {"IndexFunc", Func, 21}, + {"Insert", Func, 21}, + {"IsSorted", Func, 21}, + {"IsSortedFunc", Func, 21}, + {"Max", Func, 21}, + {"MaxFunc", Func, 21}, + {"Min", Func, 21}, + {"MinFunc", Func, 21}, + {"Repeat", Func, 23}, + {"Replace", Func, 21}, + {"Reverse", Func, 21}, + {"Sort", Func, 21}, + {"SortFunc", Func, 21}, + {"SortStableFunc", Func, 21}, + {"Sorted", Func, 23}, + {"SortedFunc", Func, 23}, + {"SortedStableFunc", Func, 23}, + {"Values", Func, 23}, + }, + "sort": { + {"(Float64Slice).Len", Method, 0}, + {"(Float64Slice).Less", Method, 0}, + {"(Float64Slice).Search", Method, 0}, + {"(Float64Slice).Sort", Method, 0}, + {"(Float64Slice).Swap", Method, 0}, + {"(IntSlice).Len", Method, 0}, + {"(IntSlice).Less", Method, 0}, + {"(IntSlice).Search", Method, 0}, + {"(IntSlice).Sort", Method, 0}, + {"(IntSlice).Swap", Method, 0}, + {"(StringSlice).Len", Method, 0}, + {"(StringSlice).Less", Method, 0}, + {"(StringSlice).Search", Method, 0}, + {"(StringSlice).Sort", Method, 0}, + {"(StringSlice).Swap", Method, 0}, + {"Find", Func, 19}, + {"Float64Slice", Type, 0}, + {"Float64s", Func, 0}, + {"Float64sAreSorted", Func, 0}, + {"IntSlice", Type, 0}, + {"Interface", Type, 0}, + {"Ints", Func, 0}, + {"IntsAreSorted", Func, 0}, + {"IsSorted", Func, 0}, + {"Reverse", Func, 1}, + {"Search", Func, 0}, + {"SearchFloat64s", Func, 0}, + {"SearchInts", Func, 0}, + {"SearchStrings", Func, 0}, + {"Slice", Func, 8}, + {"SliceIsSorted", Func, 8}, + {"SliceStable", Func, 8}, + {"Sort", Func, 0}, + {"Stable", Func, 2}, + {"StringSlice", Type, 0}, + {"Strings", Func, 0}, + {"StringsAreSorted", Func, 0}, + }, + "strconv": { + {"(*NumError).Error", Method, 0}, + {"(*NumError).Unwrap", Method, 14}, + {"AppendBool", Func, 0}, + {"AppendFloat", Func, 0}, + {"AppendInt", Func, 0}, + {"AppendQuote", Func, 0}, + {"AppendQuoteRune", Func, 0}, + {"AppendQuoteRuneToASCII", Func, 0}, + {"AppendQuoteRuneToGraphic", Func, 6}, + {"AppendQuoteToASCII", Func, 0}, + {"AppendQuoteToGraphic", Func, 6}, + {"AppendUint", Func, 0}, + {"Atoi", Func, 0}, + {"CanBackquote", Func, 0}, + {"ErrRange", Var, 0}, + {"ErrSyntax", Var, 0}, + {"FormatBool", Func, 0}, + {"FormatComplex", Func, 15}, + {"FormatFloat", Func, 0}, + {"FormatInt", Func, 0}, + {"FormatUint", Func, 0}, + {"IntSize", Const, 0}, + {"IsGraphic", Func, 6}, + {"IsPrint", Func, 0}, + {"Itoa", Func, 0}, + {"NumError", Type, 0}, + {"NumError.Err", Field, 0}, + {"NumError.Func", Field, 0}, + {"NumError.Num", Field, 0}, + {"ParseBool", Func, 0}, + {"ParseComplex", Func, 15}, + {"ParseFloat", Func, 0}, + {"ParseInt", Func, 0}, + {"ParseUint", Func, 0}, + {"Quote", Func, 0}, + {"QuoteRune", Func, 0}, + {"QuoteRuneToASCII", Func, 0}, + {"QuoteRuneToGraphic", Func, 6}, + {"QuoteToASCII", Func, 0}, + {"QuoteToGraphic", Func, 6}, + {"QuotedPrefix", Func, 17}, + {"Unquote", Func, 0}, + {"UnquoteChar", Func, 0}, + }, + "strings": { + {"(*Builder).Cap", Method, 12}, + {"(*Builder).Grow", Method, 10}, + {"(*Builder).Len", Method, 10}, + {"(*Builder).Reset", Method, 10}, + {"(*Builder).String", Method, 10}, + {"(*Builder).Write", Method, 10}, + {"(*Builder).WriteByte", Method, 10}, + {"(*Builder).WriteRune", Method, 10}, + {"(*Builder).WriteString", Method, 10}, + {"(*Reader).Len", Method, 0}, + {"(*Reader).Read", Method, 0}, + {"(*Reader).ReadAt", Method, 0}, + {"(*Reader).ReadByte", Method, 0}, + {"(*Reader).ReadRune", Method, 0}, + {"(*Reader).Reset", Method, 7}, + {"(*Reader).Seek", Method, 0}, + {"(*Reader).Size", Method, 5}, + {"(*Reader).UnreadByte", Method, 0}, + {"(*Reader).UnreadRune", Method, 0}, + {"(*Reader).WriteTo", Method, 1}, + {"(*Replacer).Replace", Method, 0}, + {"(*Replacer).WriteString", Method, 0}, + {"Builder", Type, 10}, + {"Clone", Func, 18}, + {"Compare", Func, 5}, + {"Contains", Func, 0}, + {"ContainsAny", Func, 0}, + {"ContainsFunc", Func, 21}, + {"ContainsRune", Func, 0}, + {"Count", Func, 0}, + {"Cut", Func, 18}, + {"CutPrefix", Func, 20}, + {"CutSuffix", Func, 20}, + {"EqualFold", Func, 0}, + {"Fields", Func, 0}, + {"FieldsFunc", Func, 0}, + {"HasPrefix", Func, 0}, + {"HasSuffix", Func, 0}, + {"Index", Func, 0}, + {"IndexAny", Func, 0}, + {"IndexByte", Func, 2}, + {"IndexFunc", Func, 0}, + {"IndexRune", Func, 0}, + {"Join", Func, 0}, + {"LastIndex", Func, 0}, + {"LastIndexAny", Func, 0}, + {"LastIndexByte", Func, 5}, + {"LastIndexFunc", Func, 0}, + {"Map", Func, 0}, + {"NewReader", Func, 0}, + {"NewReplacer", Func, 0}, + {"Reader", Type, 0}, + {"Repeat", Func, 0}, + {"Replace", Func, 0}, + {"ReplaceAll", Func, 12}, + {"Replacer", Type, 0}, + {"Split", Func, 0}, + {"SplitAfter", Func, 0}, + {"SplitAfterN", Func, 0}, + {"SplitN", Func, 0}, + {"Title", Func, 0}, + {"ToLower", Func, 0}, + {"ToLowerSpecial", Func, 0}, + {"ToTitle", Func, 0}, + {"ToTitleSpecial", Func, 0}, + {"ToUpper", Func, 0}, + {"ToUpperSpecial", Func, 0}, + {"ToValidUTF8", Func, 13}, + {"Trim", Func, 0}, + {"TrimFunc", Func, 0}, + {"TrimLeft", Func, 0}, + {"TrimLeftFunc", Func, 0}, + {"TrimPrefix", Func, 1}, + {"TrimRight", Func, 0}, + {"TrimRightFunc", Func, 0}, + {"TrimSpace", Func, 0}, + {"TrimSuffix", Func, 1}, + }, + "structs": { + {"HostLayout", Type, 23}, + }, + "sync": { + {"(*Cond).Broadcast", Method, 0}, + {"(*Cond).Signal", Method, 0}, + {"(*Cond).Wait", Method, 0}, + {"(*Map).Clear", Method, 23}, + {"(*Map).CompareAndDelete", Method, 20}, + {"(*Map).CompareAndSwap", Method, 20}, + {"(*Map).Delete", Method, 9}, + {"(*Map).Load", Method, 9}, + {"(*Map).LoadAndDelete", Method, 15}, + {"(*Map).LoadOrStore", Method, 9}, + {"(*Map).Range", Method, 9}, + {"(*Map).Store", Method, 9}, + {"(*Map).Swap", Method, 20}, + {"(*Mutex).Lock", Method, 0}, + {"(*Mutex).TryLock", Method, 18}, + {"(*Mutex).Unlock", Method, 0}, + {"(*Once).Do", Method, 0}, + {"(*Pool).Get", Method, 3}, + {"(*Pool).Put", Method, 3}, + {"(*RWMutex).Lock", Method, 0}, + {"(*RWMutex).RLock", Method, 0}, + {"(*RWMutex).RLocker", Method, 0}, + {"(*RWMutex).RUnlock", Method, 0}, + {"(*RWMutex).TryLock", Method, 18}, + {"(*RWMutex).TryRLock", Method, 18}, + {"(*RWMutex).Unlock", Method, 0}, + {"(*WaitGroup).Add", Method, 0}, + {"(*WaitGroup).Done", Method, 0}, + {"(*WaitGroup).Wait", Method, 0}, + {"Cond", Type, 0}, + {"Cond.L", Field, 0}, + {"Locker", Type, 0}, + {"Map", Type, 9}, + {"Mutex", Type, 0}, + {"NewCond", Func, 0}, + {"Once", Type, 0}, + {"OnceFunc", Func, 21}, + {"OnceValue", Func, 21}, + {"OnceValues", Func, 21}, + {"Pool", Type, 3}, + {"Pool.New", Field, 3}, + {"RWMutex", Type, 0}, + {"WaitGroup", Type, 0}, + }, + "sync/atomic": { + {"(*Bool).CompareAndSwap", Method, 19}, + {"(*Bool).Load", Method, 19}, + {"(*Bool).Store", Method, 19}, + {"(*Bool).Swap", Method, 19}, + {"(*Int32).Add", Method, 19}, + {"(*Int32).And", Method, 23}, + {"(*Int32).CompareAndSwap", Method, 19}, + {"(*Int32).Load", Method, 19}, + {"(*Int32).Or", Method, 23}, + {"(*Int32).Store", Method, 19}, + {"(*Int32).Swap", Method, 19}, + {"(*Int64).Add", Method, 19}, + {"(*Int64).And", Method, 23}, + {"(*Int64).CompareAndSwap", Method, 19}, + {"(*Int64).Load", Method, 19}, + {"(*Int64).Or", Method, 23}, + {"(*Int64).Store", Method, 19}, + {"(*Int64).Swap", Method, 19}, + {"(*Pointer).CompareAndSwap", Method, 19}, + {"(*Pointer).Load", Method, 19}, + {"(*Pointer).Store", Method, 19}, + {"(*Pointer).Swap", Method, 19}, + {"(*Uint32).Add", Method, 19}, + {"(*Uint32).And", Method, 23}, + {"(*Uint32).CompareAndSwap", Method, 19}, + {"(*Uint32).Load", Method, 19}, + {"(*Uint32).Or", Method, 23}, + {"(*Uint32).Store", Method, 19}, + {"(*Uint32).Swap", Method, 19}, + {"(*Uint64).Add", Method, 19}, + {"(*Uint64).And", Method, 23}, + {"(*Uint64).CompareAndSwap", Method, 19}, + {"(*Uint64).Load", Method, 19}, + {"(*Uint64).Or", Method, 23}, + {"(*Uint64).Store", Method, 19}, + {"(*Uint64).Swap", Method, 19}, + {"(*Uintptr).Add", Method, 19}, + {"(*Uintptr).And", Method, 23}, + {"(*Uintptr).CompareAndSwap", Method, 19}, + {"(*Uintptr).Load", Method, 19}, + {"(*Uintptr).Or", Method, 23}, + {"(*Uintptr).Store", Method, 19}, + {"(*Uintptr).Swap", Method, 19}, + {"(*Value).CompareAndSwap", Method, 17}, + {"(*Value).Load", Method, 4}, + {"(*Value).Store", Method, 4}, + {"(*Value).Swap", Method, 17}, + {"AddInt32", Func, 0}, + {"AddInt64", Func, 0}, + {"AddUint32", Func, 0}, + {"AddUint64", Func, 0}, + {"AddUintptr", Func, 0}, + {"AndInt32", Func, 23}, + {"AndInt64", Func, 23}, + {"AndUint32", Func, 23}, + {"AndUint64", Func, 23}, + {"AndUintptr", Func, 23}, + {"Bool", Type, 19}, + {"CompareAndSwapInt32", Func, 0}, + {"CompareAndSwapInt64", Func, 0}, + {"CompareAndSwapPointer", Func, 0}, + {"CompareAndSwapUint32", Func, 0}, + {"CompareAndSwapUint64", Func, 0}, + {"CompareAndSwapUintptr", Func, 0}, + {"Int32", Type, 19}, + {"Int64", Type, 19}, + {"LoadInt32", Func, 0}, + {"LoadInt64", Func, 0}, + {"LoadPointer", Func, 0}, + {"LoadUint32", Func, 0}, + {"LoadUint64", Func, 0}, + {"LoadUintptr", Func, 0}, + {"OrInt32", Func, 23}, + {"OrInt64", Func, 23}, + {"OrUint32", Func, 23}, + {"OrUint64", Func, 23}, + {"OrUintptr", Func, 23}, + {"Pointer", Type, 19}, + {"StoreInt32", Func, 0}, + {"StoreInt64", Func, 0}, + {"StorePointer", Func, 0}, + {"StoreUint32", Func, 0}, + {"StoreUint64", Func, 0}, + {"StoreUintptr", Func, 0}, + {"SwapInt32", Func, 2}, + {"SwapInt64", Func, 2}, + {"SwapPointer", Func, 2}, + {"SwapUint32", Func, 2}, + {"SwapUint64", Func, 2}, + {"SwapUintptr", Func, 2}, + {"Uint32", Type, 19}, + {"Uint64", Type, 19}, + {"Uintptr", Type, 19}, + {"Value", Type, 4}, + }, + "syscall": { + {"(*Cmsghdr).SetLen", Method, 0}, + {"(*DLL).FindProc", Method, 0}, + {"(*DLL).MustFindProc", Method, 0}, + {"(*DLL).Release", Method, 0}, + {"(*DLLError).Error", Method, 0}, + {"(*DLLError).Unwrap", Method, 16}, + {"(*Filetime).Nanoseconds", Method, 0}, + {"(*Iovec).SetLen", Method, 0}, + {"(*LazyDLL).Handle", Method, 0}, + {"(*LazyDLL).Load", Method, 0}, + {"(*LazyDLL).NewProc", Method, 0}, + {"(*LazyProc).Addr", Method, 0}, + {"(*LazyProc).Call", Method, 0}, + {"(*LazyProc).Find", Method, 0}, + {"(*Msghdr).SetControllen", Method, 0}, + {"(*Proc).Addr", Method, 0}, + {"(*Proc).Call", Method, 0}, + {"(*PtraceRegs).PC", Method, 0}, + {"(*PtraceRegs).SetPC", Method, 0}, + {"(*RawSockaddrAny).Sockaddr", Method, 0}, + {"(*SID).Copy", Method, 0}, + {"(*SID).Len", Method, 0}, + {"(*SID).LookupAccount", Method, 0}, + {"(*SID).String", Method, 0}, + {"(*Timespec).Nano", Method, 0}, + {"(*Timespec).Unix", Method, 0}, + {"(*Timeval).Nano", Method, 0}, + {"(*Timeval).Nanoseconds", Method, 0}, + {"(*Timeval).Unix", Method, 0}, + {"(Errno).Error", Method, 0}, + {"(Errno).Is", Method, 13}, + {"(Errno).Temporary", Method, 0}, + {"(Errno).Timeout", Method, 0}, + {"(Signal).Signal", Method, 0}, + {"(Signal).String", Method, 0}, + {"(Token).Close", Method, 0}, + {"(Token).GetTokenPrimaryGroup", Method, 0}, + {"(Token).GetTokenUser", Method, 0}, + {"(Token).GetUserProfileDirectory", Method, 0}, + {"(WaitStatus).Continued", Method, 0}, + {"(WaitStatus).CoreDump", Method, 0}, + {"(WaitStatus).ExitStatus", Method, 0}, + {"(WaitStatus).Exited", Method, 0}, + {"(WaitStatus).Signal", Method, 0}, + {"(WaitStatus).Signaled", Method, 0}, + {"(WaitStatus).StopSignal", Method, 0}, + {"(WaitStatus).Stopped", Method, 0}, + {"(WaitStatus).TrapCause", Method, 0}, + {"AF_ALG", Const, 0}, + {"AF_APPLETALK", Const, 0}, + {"AF_ARP", Const, 0}, + {"AF_ASH", Const, 0}, + {"AF_ATM", Const, 0}, + {"AF_ATMPVC", Const, 0}, + {"AF_ATMSVC", Const, 0}, + {"AF_AX25", Const, 0}, + {"AF_BLUETOOTH", Const, 0}, + {"AF_BRIDGE", Const, 0}, + {"AF_CAIF", Const, 0}, + {"AF_CAN", Const, 0}, + {"AF_CCITT", Const, 0}, + {"AF_CHAOS", Const, 0}, + {"AF_CNT", Const, 0}, + {"AF_COIP", Const, 0}, + {"AF_DATAKIT", Const, 0}, + {"AF_DECnet", Const, 0}, + {"AF_DLI", Const, 0}, + {"AF_E164", Const, 0}, + {"AF_ECMA", Const, 0}, + {"AF_ECONET", Const, 0}, + {"AF_ENCAP", Const, 1}, + {"AF_FILE", Const, 0}, + {"AF_HYLINK", Const, 0}, + {"AF_IEEE80211", Const, 0}, + {"AF_IEEE802154", Const, 0}, + {"AF_IMPLINK", Const, 0}, + {"AF_INET", Const, 0}, + {"AF_INET6", Const, 0}, + {"AF_INET6_SDP", Const, 3}, + {"AF_INET_SDP", Const, 3}, + {"AF_IPX", Const, 0}, + {"AF_IRDA", Const, 0}, + {"AF_ISDN", Const, 0}, + {"AF_ISO", Const, 0}, + {"AF_IUCV", Const, 0}, + {"AF_KEY", Const, 0}, + {"AF_LAT", Const, 0}, + {"AF_LINK", Const, 0}, + {"AF_LLC", Const, 0}, + {"AF_LOCAL", Const, 0}, + {"AF_MAX", Const, 0}, + {"AF_MPLS", Const, 1}, + {"AF_NATM", Const, 0}, + {"AF_NDRV", Const, 0}, + {"AF_NETBEUI", Const, 0}, + {"AF_NETBIOS", Const, 0}, + {"AF_NETGRAPH", Const, 0}, + {"AF_NETLINK", Const, 0}, + {"AF_NETROM", Const, 0}, + {"AF_NS", Const, 0}, + {"AF_OROUTE", Const, 1}, + {"AF_OSI", Const, 0}, + {"AF_PACKET", Const, 0}, + {"AF_PHONET", Const, 0}, + {"AF_PPP", Const, 0}, + {"AF_PPPOX", Const, 0}, + {"AF_PUP", Const, 0}, + {"AF_RDS", Const, 0}, + {"AF_RESERVED_36", Const, 0}, + {"AF_ROSE", Const, 0}, + {"AF_ROUTE", Const, 0}, + {"AF_RXRPC", Const, 0}, + {"AF_SCLUSTER", Const, 0}, + {"AF_SECURITY", Const, 0}, + {"AF_SIP", Const, 0}, + {"AF_SLOW", Const, 0}, + {"AF_SNA", Const, 0}, + {"AF_SYSTEM", Const, 0}, + {"AF_TIPC", Const, 0}, + {"AF_UNIX", Const, 0}, + {"AF_UNSPEC", Const, 0}, + {"AF_UTUN", Const, 16}, + {"AF_VENDOR00", Const, 0}, + {"AF_VENDOR01", Const, 0}, + {"AF_VENDOR02", Const, 0}, + {"AF_VENDOR03", Const, 0}, + {"AF_VENDOR04", Const, 0}, + {"AF_VENDOR05", Const, 0}, + {"AF_VENDOR06", Const, 0}, + {"AF_VENDOR07", Const, 0}, + {"AF_VENDOR08", Const, 0}, + {"AF_VENDOR09", Const, 0}, + {"AF_VENDOR10", Const, 0}, + {"AF_VENDOR11", Const, 0}, + {"AF_VENDOR12", Const, 0}, + {"AF_VENDOR13", Const, 0}, + {"AF_VENDOR14", Const, 0}, + {"AF_VENDOR15", Const, 0}, + {"AF_VENDOR16", Const, 0}, + {"AF_VENDOR17", Const, 0}, + {"AF_VENDOR18", Const, 0}, + {"AF_VENDOR19", Const, 0}, + {"AF_VENDOR20", Const, 0}, + {"AF_VENDOR21", Const, 0}, + {"AF_VENDOR22", Const, 0}, + {"AF_VENDOR23", Const, 0}, + {"AF_VENDOR24", Const, 0}, + {"AF_VENDOR25", Const, 0}, + {"AF_VENDOR26", Const, 0}, + {"AF_VENDOR27", Const, 0}, + {"AF_VENDOR28", Const, 0}, + {"AF_VENDOR29", Const, 0}, + {"AF_VENDOR30", Const, 0}, + {"AF_VENDOR31", Const, 0}, + {"AF_VENDOR32", Const, 0}, + {"AF_VENDOR33", Const, 0}, + {"AF_VENDOR34", Const, 0}, + {"AF_VENDOR35", Const, 0}, + {"AF_VENDOR36", Const, 0}, + {"AF_VENDOR37", Const, 0}, + {"AF_VENDOR38", Const, 0}, + {"AF_VENDOR39", Const, 0}, + {"AF_VENDOR40", Const, 0}, + {"AF_VENDOR41", Const, 0}, + {"AF_VENDOR42", Const, 0}, + {"AF_VENDOR43", Const, 0}, + {"AF_VENDOR44", Const, 0}, + {"AF_VENDOR45", Const, 0}, + {"AF_VENDOR46", Const, 0}, + {"AF_VENDOR47", Const, 0}, + {"AF_WANPIPE", Const, 0}, + {"AF_X25", Const, 0}, + {"AI_CANONNAME", Const, 1}, + {"AI_NUMERICHOST", Const, 1}, + {"AI_PASSIVE", Const, 1}, + {"APPLICATION_ERROR", Const, 0}, + {"ARPHRD_ADAPT", Const, 0}, + {"ARPHRD_APPLETLK", Const, 0}, + {"ARPHRD_ARCNET", Const, 0}, + {"ARPHRD_ASH", Const, 0}, + {"ARPHRD_ATM", Const, 0}, + {"ARPHRD_AX25", Const, 0}, + {"ARPHRD_BIF", Const, 0}, + {"ARPHRD_CHAOS", Const, 0}, + {"ARPHRD_CISCO", Const, 0}, + {"ARPHRD_CSLIP", Const, 0}, + {"ARPHRD_CSLIP6", Const, 0}, + {"ARPHRD_DDCMP", Const, 0}, + {"ARPHRD_DLCI", Const, 0}, + {"ARPHRD_ECONET", Const, 0}, + {"ARPHRD_EETHER", Const, 0}, + {"ARPHRD_ETHER", Const, 0}, + {"ARPHRD_EUI64", Const, 0}, + {"ARPHRD_FCAL", Const, 0}, + {"ARPHRD_FCFABRIC", Const, 0}, + {"ARPHRD_FCPL", Const, 0}, + {"ARPHRD_FCPP", Const, 0}, + {"ARPHRD_FDDI", Const, 0}, + {"ARPHRD_FRAD", Const, 0}, + {"ARPHRD_FRELAY", Const, 1}, + {"ARPHRD_HDLC", Const, 0}, + {"ARPHRD_HIPPI", Const, 0}, + {"ARPHRD_HWX25", Const, 0}, + {"ARPHRD_IEEE1394", Const, 0}, + {"ARPHRD_IEEE802", Const, 0}, + {"ARPHRD_IEEE80211", Const, 0}, + {"ARPHRD_IEEE80211_PRISM", Const, 0}, + {"ARPHRD_IEEE80211_RADIOTAP", Const, 0}, + {"ARPHRD_IEEE802154", Const, 0}, + {"ARPHRD_IEEE802154_PHY", Const, 0}, + {"ARPHRD_IEEE802_TR", Const, 0}, + {"ARPHRD_INFINIBAND", Const, 0}, + {"ARPHRD_IPDDP", Const, 0}, + {"ARPHRD_IPGRE", Const, 0}, + {"ARPHRD_IRDA", Const, 0}, + {"ARPHRD_LAPB", Const, 0}, + {"ARPHRD_LOCALTLK", Const, 0}, + {"ARPHRD_LOOPBACK", Const, 0}, + {"ARPHRD_METRICOM", Const, 0}, + {"ARPHRD_NETROM", Const, 0}, + {"ARPHRD_NONE", Const, 0}, + {"ARPHRD_PIMREG", Const, 0}, + {"ARPHRD_PPP", Const, 0}, + {"ARPHRD_PRONET", Const, 0}, + {"ARPHRD_RAWHDLC", Const, 0}, + {"ARPHRD_ROSE", Const, 0}, + {"ARPHRD_RSRVD", Const, 0}, + {"ARPHRD_SIT", Const, 0}, + {"ARPHRD_SKIP", Const, 0}, + {"ARPHRD_SLIP", Const, 0}, + {"ARPHRD_SLIP6", Const, 0}, + {"ARPHRD_STRIP", Const, 1}, + {"ARPHRD_TUNNEL", Const, 0}, + {"ARPHRD_TUNNEL6", Const, 0}, + {"ARPHRD_VOID", Const, 0}, + {"ARPHRD_X25", Const, 0}, + {"AUTHTYPE_CLIENT", Const, 0}, + {"AUTHTYPE_SERVER", Const, 0}, + {"Accept", Func, 0}, + {"Accept4", Func, 1}, + {"AcceptEx", Func, 0}, + {"Access", Func, 0}, + {"Acct", Func, 0}, + {"AddrinfoW", Type, 1}, + {"AddrinfoW.Addr", Field, 1}, + {"AddrinfoW.Addrlen", Field, 1}, + {"AddrinfoW.Canonname", Field, 1}, + {"AddrinfoW.Family", Field, 1}, + {"AddrinfoW.Flags", Field, 1}, + {"AddrinfoW.Next", Field, 1}, + {"AddrinfoW.Protocol", Field, 1}, + {"AddrinfoW.Socktype", Field, 1}, + {"Adjtime", Func, 0}, + {"Adjtimex", Func, 0}, + {"AllThreadsSyscall", Func, 16}, + {"AllThreadsSyscall6", Func, 16}, + {"AttachLsf", Func, 0}, + {"B0", Const, 0}, + {"B1000000", Const, 0}, + {"B110", Const, 0}, + {"B115200", Const, 0}, + {"B1152000", Const, 0}, + {"B1200", Const, 0}, + {"B134", Const, 0}, + {"B14400", Const, 1}, + {"B150", Const, 0}, + {"B1500000", Const, 0}, + {"B1800", Const, 0}, + {"B19200", Const, 0}, + {"B200", Const, 0}, + {"B2000000", Const, 0}, + {"B230400", Const, 0}, + {"B2400", Const, 0}, + {"B2500000", Const, 0}, + {"B28800", Const, 1}, + {"B300", Const, 0}, + {"B3000000", Const, 0}, + {"B3500000", Const, 0}, + {"B38400", Const, 0}, + {"B4000000", Const, 0}, + {"B460800", Const, 0}, + {"B4800", Const, 0}, + {"B50", Const, 0}, + {"B500000", Const, 0}, + {"B57600", Const, 0}, + {"B576000", Const, 0}, + {"B600", Const, 0}, + {"B7200", Const, 1}, + {"B75", Const, 0}, + {"B76800", Const, 1}, + {"B921600", Const, 0}, + {"B9600", Const, 0}, + {"BASE_PROTOCOL", Const, 2}, + {"BIOCFEEDBACK", Const, 0}, + {"BIOCFLUSH", Const, 0}, + {"BIOCGBLEN", Const, 0}, + {"BIOCGDIRECTION", Const, 0}, + {"BIOCGDIRFILT", Const, 1}, + {"BIOCGDLT", Const, 0}, + {"BIOCGDLTLIST", Const, 0}, + {"BIOCGETBUFMODE", Const, 0}, + {"BIOCGETIF", Const, 0}, + {"BIOCGETZMAX", Const, 0}, + {"BIOCGFEEDBACK", Const, 1}, + {"BIOCGFILDROP", Const, 1}, + {"BIOCGHDRCMPLT", Const, 0}, + {"BIOCGRSIG", Const, 0}, + {"BIOCGRTIMEOUT", Const, 0}, + {"BIOCGSEESENT", Const, 0}, + {"BIOCGSTATS", Const, 0}, + {"BIOCGSTATSOLD", Const, 1}, + {"BIOCGTSTAMP", Const, 1}, + {"BIOCIMMEDIATE", Const, 0}, + {"BIOCLOCK", Const, 0}, + {"BIOCPROMISC", Const, 0}, + {"BIOCROTZBUF", Const, 0}, + {"BIOCSBLEN", Const, 0}, + {"BIOCSDIRECTION", Const, 0}, + {"BIOCSDIRFILT", Const, 1}, + {"BIOCSDLT", Const, 0}, + {"BIOCSETBUFMODE", Const, 0}, + {"BIOCSETF", Const, 0}, + {"BIOCSETFNR", Const, 0}, + {"BIOCSETIF", Const, 0}, + {"BIOCSETWF", Const, 0}, + {"BIOCSETZBUF", Const, 0}, + {"BIOCSFEEDBACK", Const, 1}, + {"BIOCSFILDROP", Const, 1}, + {"BIOCSHDRCMPLT", Const, 0}, + {"BIOCSRSIG", Const, 0}, + {"BIOCSRTIMEOUT", Const, 0}, + {"BIOCSSEESENT", Const, 0}, + {"BIOCSTCPF", Const, 1}, + {"BIOCSTSTAMP", Const, 1}, + {"BIOCSUDPF", Const, 1}, + {"BIOCVERSION", Const, 0}, + {"BPF_A", Const, 0}, + {"BPF_ABS", Const, 0}, + {"BPF_ADD", Const, 0}, + {"BPF_ALIGNMENT", Const, 0}, + {"BPF_ALIGNMENT32", Const, 1}, + {"BPF_ALU", Const, 0}, + {"BPF_AND", Const, 0}, + {"BPF_B", Const, 0}, + {"BPF_BUFMODE_BUFFER", Const, 0}, + {"BPF_BUFMODE_ZBUF", Const, 0}, + {"BPF_DFLTBUFSIZE", Const, 1}, + {"BPF_DIRECTION_IN", Const, 1}, + {"BPF_DIRECTION_OUT", Const, 1}, + {"BPF_DIV", Const, 0}, + {"BPF_H", Const, 0}, + {"BPF_IMM", Const, 0}, + {"BPF_IND", Const, 0}, + {"BPF_JA", Const, 0}, + {"BPF_JEQ", Const, 0}, + {"BPF_JGE", Const, 0}, + {"BPF_JGT", Const, 0}, + {"BPF_JMP", Const, 0}, + {"BPF_JSET", Const, 0}, + {"BPF_K", Const, 0}, + {"BPF_LD", Const, 0}, + {"BPF_LDX", Const, 0}, + {"BPF_LEN", Const, 0}, + {"BPF_LSH", Const, 0}, + {"BPF_MAJOR_VERSION", Const, 0}, + {"BPF_MAXBUFSIZE", Const, 0}, + {"BPF_MAXINSNS", Const, 0}, + {"BPF_MEM", Const, 0}, + {"BPF_MEMWORDS", Const, 0}, + {"BPF_MINBUFSIZE", Const, 0}, + {"BPF_MINOR_VERSION", Const, 0}, + {"BPF_MISC", Const, 0}, + {"BPF_MSH", Const, 0}, + {"BPF_MUL", Const, 0}, + {"BPF_NEG", Const, 0}, + {"BPF_OR", Const, 0}, + {"BPF_RELEASE", Const, 0}, + {"BPF_RET", Const, 0}, + {"BPF_RSH", Const, 0}, + {"BPF_ST", Const, 0}, + {"BPF_STX", Const, 0}, + {"BPF_SUB", Const, 0}, + {"BPF_TAX", Const, 0}, + {"BPF_TXA", Const, 0}, + {"BPF_T_BINTIME", Const, 1}, + {"BPF_T_BINTIME_FAST", Const, 1}, + {"BPF_T_BINTIME_MONOTONIC", Const, 1}, + {"BPF_T_BINTIME_MONOTONIC_FAST", Const, 1}, + {"BPF_T_FAST", Const, 1}, + {"BPF_T_FLAG_MASK", Const, 1}, + {"BPF_T_FORMAT_MASK", Const, 1}, + {"BPF_T_MICROTIME", Const, 1}, + {"BPF_T_MICROTIME_FAST", Const, 1}, + {"BPF_T_MICROTIME_MONOTONIC", Const, 1}, + {"BPF_T_MICROTIME_MONOTONIC_FAST", Const, 1}, + {"BPF_T_MONOTONIC", Const, 1}, + {"BPF_T_MONOTONIC_FAST", Const, 1}, + {"BPF_T_NANOTIME", Const, 1}, + {"BPF_T_NANOTIME_FAST", Const, 1}, + {"BPF_T_NANOTIME_MONOTONIC", Const, 1}, + {"BPF_T_NANOTIME_MONOTONIC_FAST", Const, 1}, + {"BPF_T_NONE", Const, 1}, + {"BPF_T_NORMAL", Const, 1}, + {"BPF_W", Const, 0}, + {"BPF_X", Const, 0}, + {"BRKINT", Const, 0}, + {"Bind", Func, 0}, + {"BindToDevice", Func, 0}, + {"BpfBuflen", Func, 0}, + {"BpfDatalink", Func, 0}, + {"BpfHdr", Type, 0}, + {"BpfHdr.Caplen", Field, 0}, + {"BpfHdr.Datalen", Field, 0}, + {"BpfHdr.Hdrlen", Field, 0}, + {"BpfHdr.Pad_cgo_0", Field, 0}, + {"BpfHdr.Tstamp", Field, 0}, + {"BpfHeadercmpl", Func, 0}, + {"BpfInsn", Type, 0}, + {"BpfInsn.Code", Field, 0}, + {"BpfInsn.Jf", Field, 0}, + {"BpfInsn.Jt", Field, 0}, + {"BpfInsn.K", Field, 0}, + {"BpfInterface", Func, 0}, + {"BpfJump", Func, 0}, + {"BpfProgram", Type, 0}, + {"BpfProgram.Insns", Field, 0}, + {"BpfProgram.Len", Field, 0}, + {"BpfProgram.Pad_cgo_0", Field, 0}, + {"BpfStat", Type, 0}, + {"BpfStat.Capt", Field, 2}, + {"BpfStat.Drop", Field, 0}, + {"BpfStat.Padding", Field, 2}, + {"BpfStat.Recv", Field, 0}, + {"BpfStats", Func, 0}, + {"BpfStmt", Func, 0}, + {"BpfTimeout", Func, 0}, + {"BpfTimeval", Type, 2}, + {"BpfTimeval.Sec", Field, 2}, + {"BpfTimeval.Usec", Field, 2}, + {"BpfVersion", Type, 0}, + {"BpfVersion.Major", Field, 0}, + {"BpfVersion.Minor", Field, 0}, + {"BpfZbuf", Type, 0}, + {"BpfZbuf.Bufa", Field, 0}, + {"BpfZbuf.Bufb", Field, 0}, + {"BpfZbuf.Buflen", Field, 0}, + {"BpfZbufHeader", Type, 0}, + {"BpfZbufHeader.Kernel_gen", Field, 0}, + {"BpfZbufHeader.Kernel_len", Field, 0}, + {"BpfZbufHeader.User_gen", Field, 0}, + {"BpfZbufHeader.X_bzh_pad", Field, 0}, + {"ByHandleFileInformation", Type, 0}, + {"ByHandleFileInformation.CreationTime", Field, 0}, + {"ByHandleFileInformation.FileAttributes", Field, 0}, + {"ByHandleFileInformation.FileIndexHigh", Field, 0}, + {"ByHandleFileInformation.FileIndexLow", Field, 0}, + {"ByHandleFileInformation.FileSizeHigh", Field, 0}, + {"ByHandleFileInformation.FileSizeLow", Field, 0}, + {"ByHandleFileInformation.LastAccessTime", Field, 0}, + {"ByHandleFileInformation.LastWriteTime", Field, 0}, + {"ByHandleFileInformation.NumberOfLinks", Field, 0}, + {"ByHandleFileInformation.VolumeSerialNumber", Field, 0}, + {"BytePtrFromString", Func, 1}, + {"ByteSliceFromString", Func, 1}, + {"CCR0_FLUSH", Const, 1}, + {"CERT_CHAIN_POLICY_AUTHENTICODE", Const, 0}, + {"CERT_CHAIN_POLICY_AUTHENTICODE_TS", Const, 0}, + {"CERT_CHAIN_POLICY_BASE", Const, 0}, + {"CERT_CHAIN_POLICY_BASIC_CONSTRAINTS", Const, 0}, + {"CERT_CHAIN_POLICY_EV", Const, 0}, + {"CERT_CHAIN_POLICY_MICROSOFT_ROOT", Const, 0}, + {"CERT_CHAIN_POLICY_NT_AUTH", Const, 0}, + {"CERT_CHAIN_POLICY_SSL", Const, 0}, + {"CERT_E_CN_NO_MATCH", Const, 0}, + {"CERT_E_EXPIRED", Const, 0}, + {"CERT_E_PURPOSE", Const, 0}, + {"CERT_E_ROLE", Const, 0}, + {"CERT_E_UNTRUSTEDROOT", Const, 0}, + {"CERT_STORE_ADD_ALWAYS", Const, 0}, + {"CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG", Const, 0}, + {"CERT_STORE_PROV_MEMORY", Const, 0}, + {"CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT", Const, 0}, + {"CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT", Const, 0}, + {"CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT", Const, 0}, + {"CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT", Const, 0}, + {"CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT", Const, 0}, + {"CERT_TRUST_INVALID_BASIC_CONSTRAINTS", Const, 0}, + {"CERT_TRUST_INVALID_EXTENSION", Const, 0}, + {"CERT_TRUST_INVALID_NAME_CONSTRAINTS", Const, 0}, + {"CERT_TRUST_INVALID_POLICY_CONSTRAINTS", Const, 0}, + {"CERT_TRUST_IS_CYCLIC", Const, 0}, + {"CERT_TRUST_IS_EXPLICIT_DISTRUST", Const, 0}, + {"CERT_TRUST_IS_NOT_SIGNATURE_VALID", Const, 0}, + {"CERT_TRUST_IS_NOT_TIME_VALID", Const, 0}, + {"CERT_TRUST_IS_NOT_VALID_FOR_USAGE", Const, 0}, + {"CERT_TRUST_IS_OFFLINE_REVOCATION", Const, 0}, + {"CERT_TRUST_IS_REVOKED", Const, 0}, + {"CERT_TRUST_IS_UNTRUSTED_ROOT", Const, 0}, + {"CERT_TRUST_NO_ERROR", Const, 0}, + {"CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY", Const, 0}, + {"CERT_TRUST_REVOCATION_STATUS_UNKNOWN", Const, 0}, + {"CFLUSH", Const, 1}, + {"CLOCAL", Const, 0}, + {"CLONE_CHILD_CLEARTID", Const, 2}, + {"CLONE_CHILD_SETTID", Const, 2}, + {"CLONE_CLEAR_SIGHAND", Const, 20}, + {"CLONE_CSIGNAL", Const, 3}, + {"CLONE_DETACHED", Const, 2}, + {"CLONE_FILES", Const, 2}, + {"CLONE_FS", Const, 2}, + {"CLONE_INTO_CGROUP", Const, 20}, + {"CLONE_IO", Const, 2}, + {"CLONE_NEWCGROUP", Const, 20}, + {"CLONE_NEWIPC", Const, 2}, + {"CLONE_NEWNET", Const, 2}, + {"CLONE_NEWNS", Const, 2}, + {"CLONE_NEWPID", Const, 2}, + {"CLONE_NEWTIME", Const, 20}, + {"CLONE_NEWUSER", Const, 2}, + {"CLONE_NEWUTS", Const, 2}, + {"CLONE_PARENT", Const, 2}, + {"CLONE_PARENT_SETTID", Const, 2}, + {"CLONE_PID", Const, 3}, + {"CLONE_PIDFD", Const, 20}, + {"CLONE_PTRACE", Const, 2}, + {"CLONE_SETTLS", Const, 2}, + {"CLONE_SIGHAND", Const, 2}, + {"CLONE_SYSVSEM", Const, 2}, + {"CLONE_THREAD", Const, 2}, + {"CLONE_UNTRACED", Const, 2}, + {"CLONE_VFORK", Const, 2}, + {"CLONE_VM", Const, 2}, + {"CPUID_CFLUSH", Const, 1}, + {"CREAD", Const, 0}, + {"CREATE_ALWAYS", Const, 0}, + {"CREATE_NEW", Const, 0}, + {"CREATE_NEW_PROCESS_GROUP", Const, 1}, + {"CREATE_UNICODE_ENVIRONMENT", Const, 0}, + {"CRYPT_DEFAULT_CONTAINER_OPTIONAL", Const, 0}, + {"CRYPT_DELETEKEYSET", Const, 0}, + {"CRYPT_MACHINE_KEYSET", Const, 0}, + {"CRYPT_NEWKEYSET", Const, 0}, + {"CRYPT_SILENT", Const, 0}, + {"CRYPT_VERIFYCONTEXT", Const, 0}, + {"CS5", Const, 0}, + {"CS6", Const, 0}, + {"CS7", Const, 0}, + {"CS8", Const, 0}, + {"CSIZE", Const, 0}, + {"CSTART", Const, 1}, + {"CSTATUS", Const, 1}, + {"CSTOP", Const, 1}, + {"CSTOPB", Const, 0}, + {"CSUSP", Const, 1}, + {"CTL_MAXNAME", Const, 0}, + {"CTL_NET", Const, 0}, + {"CTL_QUERY", Const, 1}, + {"CTRL_BREAK_EVENT", Const, 1}, + {"CTRL_CLOSE_EVENT", Const, 14}, + {"CTRL_C_EVENT", Const, 1}, + {"CTRL_LOGOFF_EVENT", Const, 14}, + {"CTRL_SHUTDOWN_EVENT", Const, 14}, + {"CancelIo", Func, 0}, + {"CancelIoEx", Func, 1}, + {"CertAddCertificateContextToStore", Func, 0}, + {"CertChainContext", Type, 0}, + {"CertChainContext.ChainCount", Field, 0}, + {"CertChainContext.Chains", Field, 0}, + {"CertChainContext.HasRevocationFreshnessTime", Field, 0}, + {"CertChainContext.LowerQualityChainCount", Field, 0}, + {"CertChainContext.LowerQualityChains", Field, 0}, + {"CertChainContext.RevocationFreshnessTime", Field, 0}, + {"CertChainContext.Size", Field, 0}, + {"CertChainContext.TrustStatus", Field, 0}, + {"CertChainElement", Type, 0}, + {"CertChainElement.ApplicationUsage", Field, 0}, + {"CertChainElement.CertContext", Field, 0}, + {"CertChainElement.ExtendedErrorInfo", Field, 0}, + {"CertChainElement.IssuanceUsage", Field, 0}, + {"CertChainElement.RevocationInfo", Field, 0}, + {"CertChainElement.Size", Field, 0}, + {"CertChainElement.TrustStatus", Field, 0}, + {"CertChainPara", Type, 0}, + {"CertChainPara.CacheResync", Field, 0}, + {"CertChainPara.CheckRevocationFreshnessTime", Field, 0}, + {"CertChainPara.RequestedUsage", Field, 0}, + {"CertChainPara.RequstedIssuancePolicy", Field, 0}, + {"CertChainPara.RevocationFreshnessTime", Field, 0}, + {"CertChainPara.Size", Field, 0}, + {"CertChainPara.URLRetrievalTimeout", Field, 0}, + {"CertChainPolicyPara", Type, 0}, + {"CertChainPolicyPara.ExtraPolicyPara", Field, 0}, + {"CertChainPolicyPara.Flags", Field, 0}, + {"CertChainPolicyPara.Size", Field, 0}, + {"CertChainPolicyStatus", Type, 0}, + {"CertChainPolicyStatus.ChainIndex", Field, 0}, + {"CertChainPolicyStatus.ElementIndex", Field, 0}, + {"CertChainPolicyStatus.Error", Field, 0}, + {"CertChainPolicyStatus.ExtraPolicyStatus", Field, 0}, + {"CertChainPolicyStatus.Size", Field, 0}, + {"CertCloseStore", Func, 0}, + {"CertContext", Type, 0}, + {"CertContext.CertInfo", Field, 0}, + {"CertContext.EncodedCert", Field, 0}, + {"CertContext.EncodingType", Field, 0}, + {"CertContext.Length", Field, 0}, + {"CertContext.Store", Field, 0}, + {"CertCreateCertificateContext", Func, 0}, + {"CertEnhKeyUsage", Type, 0}, + {"CertEnhKeyUsage.Length", Field, 0}, + {"CertEnhKeyUsage.UsageIdentifiers", Field, 0}, + {"CertEnumCertificatesInStore", Func, 0}, + {"CertFreeCertificateChain", Func, 0}, + {"CertFreeCertificateContext", Func, 0}, + {"CertGetCertificateChain", Func, 0}, + {"CertInfo", Type, 11}, + {"CertOpenStore", Func, 0}, + {"CertOpenSystemStore", Func, 0}, + {"CertRevocationCrlInfo", Type, 11}, + {"CertRevocationInfo", Type, 0}, + {"CertRevocationInfo.CrlInfo", Field, 0}, + {"CertRevocationInfo.FreshnessTime", Field, 0}, + {"CertRevocationInfo.HasFreshnessTime", Field, 0}, + {"CertRevocationInfo.OidSpecificInfo", Field, 0}, + {"CertRevocationInfo.RevocationOid", Field, 0}, + {"CertRevocationInfo.RevocationResult", Field, 0}, + {"CertRevocationInfo.Size", Field, 0}, + {"CertSimpleChain", Type, 0}, + {"CertSimpleChain.Elements", Field, 0}, + {"CertSimpleChain.HasRevocationFreshnessTime", Field, 0}, + {"CertSimpleChain.NumElements", Field, 0}, + {"CertSimpleChain.RevocationFreshnessTime", Field, 0}, + {"CertSimpleChain.Size", Field, 0}, + {"CertSimpleChain.TrustListInfo", Field, 0}, + {"CertSimpleChain.TrustStatus", Field, 0}, + {"CertTrustListInfo", Type, 11}, + {"CertTrustStatus", Type, 0}, + {"CertTrustStatus.ErrorStatus", Field, 0}, + {"CertTrustStatus.InfoStatus", Field, 0}, + {"CertUsageMatch", Type, 0}, + {"CertUsageMatch.Type", Field, 0}, + {"CertUsageMatch.Usage", Field, 0}, + {"CertVerifyCertificateChainPolicy", Func, 0}, + {"Chdir", Func, 0}, + {"CheckBpfVersion", Func, 0}, + {"Chflags", Func, 0}, + {"Chmod", Func, 0}, + {"Chown", Func, 0}, + {"Chroot", Func, 0}, + {"Clearenv", Func, 0}, + {"Close", Func, 0}, + {"CloseHandle", Func, 0}, + {"CloseOnExec", Func, 0}, + {"Closesocket", Func, 0}, + {"CmsgLen", Func, 0}, + {"CmsgSpace", Func, 0}, + {"Cmsghdr", Type, 0}, + {"Cmsghdr.Len", Field, 0}, + {"Cmsghdr.Level", Field, 0}, + {"Cmsghdr.Type", Field, 0}, + {"Cmsghdr.X__cmsg_data", Field, 0}, + {"CommandLineToArgv", Func, 0}, + {"ComputerName", Func, 0}, + {"Conn", Type, 9}, + {"Connect", Func, 0}, + {"ConnectEx", Func, 1}, + {"ConvertSidToStringSid", Func, 0}, + {"ConvertStringSidToSid", Func, 0}, + {"CopySid", Func, 0}, + {"Creat", Func, 0}, + {"CreateDirectory", Func, 0}, + {"CreateFile", Func, 0}, + {"CreateFileMapping", Func, 0}, + {"CreateHardLink", Func, 4}, + {"CreateIoCompletionPort", Func, 0}, + {"CreatePipe", Func, 0}, + {"CreateProcess", Func, 0}, + {"CreateProcessAsUser", Func, 10}, + {"CreateSymbolicLink", Func, 4}, + {"CreateToolhelp32Snapshot", Func, 4}, + {"Credential", Type, 0}, + {"Credential.Gid", Field, 0}, + {"Credential.Groups", Field, 0}, + {"Credential.NoSetGroups", Field, 9}, + {"Credential.Uid", Field, 0}, + {"CryptAcquireContext", Func, 0}, + {"CryptGenRandom", Func, 0}, + {"CryptReleaseContext", Func, 0}, + {"DIOCBSFLUSH", Const, 1}, + {"DIOCOSFPFLUSH", Const, 1}, + {"DLL", Type, 0}, + {"DLL.Handle", Field, 0}, + {"DLL.Name", Field, 0}, + {"DLLError", Type, 0}, + {"DLLError.Err", Field, 0}, + {"DLLError.Msg", Field, 0}, + {"DLLError.ObjName", Field, 0}, + {"DLT_A429", Const, 0}, + {"DLT_A653_ICM", Const, 0}, + {"DLT_AIRONET_HEADER", Const, 0}, + {"DLT_AOS", Const, 1}, + {"DLT_APPLE_IP_OVER_IEEE1394", Const, 0}, + {"DLT_ARCNET", Const, 0}, + {"DLT_ARCNET_LINUX", Const, 0}, + {"DLT_ATM_CLIP", Const, 0}, + {"DLT_ATM_RFC1483", Const, 0}, + {"DLT_AURORA", Const, 0}, + {"DLT_AX25", Const, 0}, + {"DLT_AX25_KISS", Const, 0}, + {"DLT_BACNET_MS_TP", Const, 0}, + {"DLT_BLUETOOTH_HCI_H4", Const, 0}, + {"DLT_BLUETOOTH_HCI_H4_WITH_PHDR", Const, 0}, + {"DLT_CAN20B", Const, 0}, + {"DLT_CAN_SOCKETCAN", Const, 1}, + {"DLT_CHAOS", Const, 0}, + {"DLT_CHDLC", Const, 0}, + {"DLT_CISCO_IOS", Const, 0}, + {"DLT_C_HDLC", Const, 0}, + {"DLT_C_HDLC_WITH_DIR", Const, 0}, + {"DLT_DBUS", Const, 1}, + {"DLT_DECT", Const, 1}, + {"DLT_DOCSIS", Const, 0}, + {"DLT_DVB_CI", Const, 1}, + {"DLT_ECONET", Const, 0}, + {"DLT_EN10MB", Const, 0}, + {"DLT_EN3MB", Const, 0}, + {"DLT_ENC", Const, 0}, + {"DLT_ERF", Const, 0}, + {"DLT_ERF_ETH", Const, 0}, + {"DLT_ERF_POS", Const, 0}, + {"DLT_FC_2", Const, 1}, + {"DLT_FC_2_WITH_FRAME_DELIMS", Const, 1}, + {"DLT_FDDI", Const, 0}, + {"DLT_FLEXRAY", Const, 0}, + {"DLT_FRELAY", Const, 0}, + {"DLT_FRELAY_WITH_DIR", Const, 0}, + {"DLT_GCOM_SERIAL", Const, 0}, + {"DLT_GCOM_T1E1", Const, 0}, + {"DLT_GPF_F", Const, 0}, + {"DLT_GPF_T", Const, 0}, + {"DLT_GPRS_LLC", Const, 0}, + {"DLT_GSMTAP_ABIS", Const, 1}, + {"DLT_GSMTAP_UM", Const, 1}, + {"DLT_HDLC", Const, 1}, + {"DLT_HHDLC", Const, 0}, + {"DLT_HIPPI", Const, 1}, + {"DLT_IBM_SN", Const, 0}, + {"DLT_IBM_SP", Const, 0}, + {"DLT_IEEE802", Const, 0}, + {"DLT_IEEE802_11", Const, 0}, + {"DLT_IEEE802_11_RADIO", Const, 0}, + {"DLT_IEEE802_11_RADIO_AVS", Const, 0}, + {"DLT_IEEE802_15_4", Const, 0}, + {"DLT_IEEE802_15_4_LINUX", Const, 0}, + {"DLT_IEEE802_15_4_NOFCS", Const, 1}, + {"DLT_IEEE802_15_4_NONASK_PHY", Const, 0}, + {"DLT_IEEE802_16_MAC_CPS", Const, 0}, + {"DLT_IEEE802_16_MAC_CPS_RADIO", Const, 0}, + {"DLT_IPFILTER", Const, 0}, + {"DLT_IPMB", Const, 0}, + {"DLT_IPMB_LINUX", Const, 0}, + {"DLT_IPNET", Const, 1}, + {"DLT_IPOIB", Const, 1}, + {"DLT_IPV4", Const, 1}, + {"DLT_IPV6", Const, 1}, + {"DLT_IP_OVER_FC", Const, 0}, + {"DLT_JUNIPER_ATM1", Const, 0}, + {"DLT_JUNIPER_ATM2", Const, 0}, + {"DLT_JUNIPER_ATM_CEMIC", Const, 1}, + {"DLT_JUNIPER_CHDLC", Const, 0}, + {"DLT_JUNIPER_ES", Const, 0}, + {"DLT_JUNIPER_ETHER", Const, 0}, + {"DLT_JUNIPER_FIBRECHANNEL", Const, 1}, + {"DLT_JUNIPER_FRELAY", Const, 0}, + {"DLT_JUNIPER_GGSN", Const, 0}, + {"DLT_JUNIPER_ISM", Const, 0}, + {"DLT_JUNIPER_MFR", Const, 0}, + {"DLT_JUNIPER_MLFR", Const, 0}, + {"DLT_JUNIPER_MLPPP", Const, 0}, + {"DLT_JUNIPER_MONITOR", Const, 0}, + {"DLT_JUNIPER_PIC_PEER", Const, 0}, + {"DLT_JUNIPER_PPP", Const, 0}, + {"DLT_JUNIPER_PPPOE", Const, 0}, + {"DLT_JUNIPER_PPPOE_ATM", Const, 0}, + {"DLT_JUNIPER_SERVICES", Const, 0}, + {"DLT_JUNIPER_SRX_E2E", Const, 1}, + {"DLT_JUNIPER_ST", Const, 0}, + {"DLT_JUNIPER_VP", Const, 0}, + {"DLT_JUNIPER_VS", Const, 1}, + {"DLT_LAPB_WITH_DIR", Const, 0}, + {"DLT_LAPD", Const, 0}, + {"DLT_LIN", Const, 0}, + {"DLT_LINUX_EVDEV", Const, 1}, + {"DLT_LINUX_IRDA", Const, 0}, + {"DLT_LINUX_LAPD", Const, 0}, + {"DLT_LINUX_PPP_WITHDIRECTION", Const, 0}, + {"DLT_LINUX_SLL", Const, 0}, + {"DLT_LOOP", Const, 0}, + {"DLT_LTALK", Const, 0}, + {"DLT_MATCHING_MAX", Const, 1}, + {"DLT_MATCHING_MIN", Const, 1}, + {"DLT_MFR", Const, 0}, + {"DLT_MOST", Const, 0}, + {"DLT_MPEG_2_TS", Const, 1}, + {"DLT_MPLS", Const, 1}, + {"DLT_MTP2", Const, 0}, + {"DLT_MTP2_WITH_PHDR", Const, 0}, + {"DLT_MTP3", Const, 0}, + {"DLT_MUX27010", Const, 1}, + {"DLT_NETANALYZER", Const, 1}, + {"DLT_NETANALYZER_TRANSPARENT", Const, 1}, + {"DLT_NFC_LLCP", Const, 1}, + {"DLT_NFLOG", Const, 1}, + {"DLT_NG40", Const, 1}, + {"DLT_NULL", Const, 0}, + {"DLT_PCI_EXP", Const, 0}, + {"DLT_PFLOG", Const, 0}, + {"DLT_PFSYNC", Const, 0}, + {"DLT_PPI", Const, 0}, + {"DLT_PPP", Const, 0}, + {"DLT_PPP_BSDOS", Const, 0}, + {"DLT_PPP_ETHER", Const, 0}, + {"DLT_PPP_PPPD", Const, 0}, + {"DLT_PPP_SERIAL", Const, 0}, + {"DLT_PPP_WITH_DIR", Const, 0}, + {"DLT_PPP_WITH_DIRECTION", Const, 0}, + {"DLT_PRISM_HEADER", Const, 0}, + {"DLT_PRONET", Const, 0}, + {"DLT_RAIF1", Const, 0}, + {"DLT_RAW", Const, 0}, + {"DLT_RAWAF_MASK", Const, 1}, + {"DLT_RIO", Const, 0}, + {"DLT_SCCP", Const, 0}, + {"DLT_SITA", Const, 0}, + {"DLT_SLIP", Const, 0}, + {"DLT_SLIP_BSDOS", Const, 0}, + {"DLT_STANAG_5066_D_PDU", Const, 1}, + {"DLT_SUNATM", Const, 0}, + {"DLT_SYMANTEC_FIREWALL", Const, 0}, + {"DLT_TZSP", Const, 0}, + {"DLT_USB", Const, 0}, + {"DLT_USB_LINUX", Const, 0}, + {"DLT_USB_LINUX_MMAPPED", Const, 1}, + {"DLT_USER0", Const, 0}, + {"DLT_USER1", Const, 0}, + {"DLT_USER10", Const, 0}, + {"DLT_USER11", Const, 0}, + {"DLT_USER12", Const, 0}, + {"DLT_USER13", Const, 0}, + {"DLT_USER14", Const, 0}, + {"DLT_USER15", Const, 0}, + {"DLT_USER2", Const, 0}, + {"DLT_USER3", Const, 0}, + {"DLT_USER4", Const, 0}, + {"DLT_USER5", Const, 0}, + {"DLT_USER6", Const, 0}, + {"DLT_USER7", Const, 0}, + {"DLT_USER8", Const, 0}, + {"DLT_USER9", Const, 0}, + {"DLT_WIHART", Const, 1}, + {"DLT_X2E_SERIAL", Const, 0}, + {"DLT_X2E_XORAYA", Const, 0}, + {"DNSMXData", Type, 0}, + {"DNSMXData.NameExchange", Field, 0}, + {"DNSMXData.Pad", Field, 0}, + {"DNSMXData.Preference", Field, 0}, + {"DNSPTRData", Type, 0}, + {"DNSPTRData.Host", Field, 0}, + {"DNSRecord", Type, 0}, + {"DNSRecord.Data", Field, 0}, + {"DNSRecord.Dw", Field, 0}, + {"DNSRecord.Length", Field, 0}, + {"DNSRecord.Name", Field, 0}, + {"DNSRecord.Next", Field, 0}, + {"DNSRecord.Reserved", Field, 0}, + {"DNSRecord.Ttl", Field, 0}, + {"DNSRecord.Type", Field, 0}, + {"DNSSRVData", Type, 0}, + {"DNSSRVData.Pad", Field, 0}, + {"DNSSRVData.Port", Field, 0}, + {"DNSSRVData.Priority", Field, 0}, + {"DNSSRVData.Target", Field, 0}, + {"DNSSRVData.Weight", Field, 0}, + {"DNSTXTData", Type, 0}, + {"DNSTXTData.StringArray", Field, 0}, + {"DNSTXTData.StringCount", Field, 0}, + {"DNS_INFO_NO_RECORDS", Const, 4}, + {"DNS_TYPE_A", Const, 0}, + {"DNS_TYPE_A6", Const, 0}, + {"DNS_TYPE_AAAA", Const, 0}, + {"DNS_TYPE_ADDRS", Const, 0}, + {"DNS_TYPE_AFSDB", Const, 0}, + {"DNS_TYPE_ALL", Const, 0}, + {"DNS_TYPE_ANY", Const, 0}, + {"DNS_TYPE_ATMA", Const, 0}, + {"DNS_TYPE_AXFR", Const, 0}, + {"DNS_TYPE_CERT", Const, 0}, + {"DNS_TYPE_CNAME", Const, 0}, + {"DNS_TYPE_DHCID", Const, 0}, + {"DNS_TYPE_DNAME", Const, 0}, + {"DNS_TYPE_DNSKEY", Const, 0}, + {"DNS_TYPE_DS", Const, 0}, + {"DNS_TYPE_EID", Const, 0}, + {"DNS_TYPE_GID", Const, 0}, + {"DNS_TYPE_GPOS", Const, 0}, + {"DNS_TYPE_HINFO", Const, 0}, + {"DNS_TYPE_ISDN", Const, 0}, + {"DNS_TYPE_IXFR", Const, 0}, + {"DNS_TYPE_KEY", Const, 0}, + {"DNS_TYPE_KX", Const, 0}, + {"DNS_TYPE_LOC", Const, 0}, + {"DNS_TYPE_MAILA", Const, 0}, + {"DNS_TYPE_MAILB", Const, 0}, + {"DNS_TYPE_MB", Const, 0}, + {"DNS_TYPE_MD", Const, 0}, + {"DNS_TYPE_MF", Const, 0}, + {"DNS_TYPE_MG", Const, 0}, + {"DNS_TYPE_MINFO", Const, 0}, + {"DNS_TYPE_MR", Const, 0}, + {"DNS_TYPE_MX", Const, 0}, + {"DNS_TYPE_NAPTR", Const, 0}, + {"DNS_TYPE_NBSTAT", Const, 0}, + {"DNS_TYPE_NIMLOC", Const, 0}, + {"DNS_TYPE_NS", Const, 0}, + {"DNS_TYPE_NSAP", Const, 0}, + {"DNS_TYPE_NSAPPTR", Const, 0}, + {"DNS_TYPE_NSEC", Const, 0}, + {"DNS_TYPE_NULL", Const, 0}, + {"DNS_TYPE_NXT", Const, 0}, + {"DNS_TYPE_OPT", Const, 0}, + {"DNS_TYPE_PTR", Const, 0}, + {"DNS_TYPE_PX", Const, 0}, + {"DNS_TYPE_RP", Const, 0}, + {"DNS_TYPE_RRSIG", Const, 0}, + {"DNS_TYPE_RT", Const, 0}, + {"DNS_TYPE_SIG", Const, 0}, + {"DNS_TYPE_SINK", Const, 0}, + {"DNS_TYPE_SOA", Const, 0}, + {"DNS_TYPE_SRV", Const, 0}, + {"DNS_TYPE_TEXT", Const, 0}, + {"DNS_TYPE_TKEY", Const, 0}, + {"DNS_TYPE_TSIG", Const, 0}, + {"DNS_TYPE_UID", Const, 0}, + {"DNS_TYPE_UINFO", Const, 0}, + {"DNS_TYPE_UNSPEC", Const, 0}, + {"DNS_TYPE_WINS", Const, 0}, + {"DNS_TYPE_WINSR", Const, 0}, + {"DNS_TYPE_WKS", Const, 0}, + {"DNS_TYPE_X25", Const, 0}, + {"DT_BLK", Const, 0}, + {"DT_CHR", Const, 0}, + {"DT_DIR", Const, 0}, + {"DT_FIFO", Const, 0}, + {"DT_LNK", Const, 0}, + {"DT_REG", Const, 0}, + {"DT_SOCK", Const, 0}, + {"DT_UNKNOWN", Const, 0}, + {"DT_WHT", Const, 0}, + {"DUPLICATE_CLOSE_SOURCE", Const, 0}, + {"DUPLICATE_SAME_ACCESS", Const, 0}, + {"DeleteFile", Func, 0}, + {"DetachLsf", Func, 0}, + {"DeviceIoControl", Func, 4}, + {"Dirent", Type, 0}, + {"Dirent.Fileno", Field, 0}, + {"Dirent.Ino", Field, 0}, + {"Dirent.Name", Field, 0}, + {"Dirent.Namlen", Field, 0}, + {"Dirent.Off", Field, 0}, + {"Dirent.Pad0", Field, 12}, + {"Dirent.Pad1", Field, 12}, + {"Dirent.Pad_cgo_0", Field, 0}, + {"Dirent.Reclen", Field, 0}, + {"Dirent.Seekoff", Field, 0}, + {"Dirent.Type", Field, 0}, + {"Dirent.X__d_padding", Field, 3}, + {"DnsNameCompare", Func, 4}, + {"DnsQuery", Func, 0}, + {"DnsRecordListFree", Func, 0}, + {"DnsSectionAdditional", Const, 4}, + {"DnsSectionAnswer", Const, 4}, + {"DnsSectionAuthority", Const, 4}, + {"DnsSectionQuestion", Const, 4}, + {"Dup", Func, 0}, + {"Dup2", Func, 0}, + {"Dup3", Func, 2}, + {"DuplicateHandle", Func, 0}, + {"E2BIG", Const, 0}, + {"EACCES", Const, 0}, + {"EADDRINUSE", Const, 0}, + {"EADDRNOTAVAIL", Const, 0}, + {"EADV", Const, 0}, + {"EAFNOSUPPORT", Const, 0}, + {"EAGAIN", Const, 0}, + {"EALREADY", Const, 0}, + {"EAUTH", Const, 0}, + {"EBADARCH", Const, 0}, + {"EBADE", Const, 0}, + {"EBADEXEC", Const, 0}, + {"EBADF", Const, 0}, + {"EBADFD", Const, 0}, + {"EBADMACHO", Const, 0}, + {"EBADMSG", Const, 0}, + {"EBADR", Const, 0}, + {"EBADRPC", Const, 0}, + {"EBADRQC", Const, 0}, + {"EBADSLT", Const, 0}, + {"EBFONT", Const, 0}, + {"EBUSY", Const, 0}, + {"ECANCELED", Const, 0}, + {"ECAPMODE", Const, 1}, + {"ECHILD", Const, 0}, + {"ECHO", Const, 0}, + {"ECHOCTL", Const, 0}, + {"ECHOE", Const, 0}, + {"ECHOK", Const, 0}, + {"ECHOKE", Const, 0}, + {"ECHONL", Const, 0}, + {"ECHOPRT", Const, 0}, + {"ECHRNG", Const, 0}, + {"ECOMM", Const, 0}, + {"ECONNABORTED", Const, 0}, + {"ECONNREFUSED", Const, 0}, + {"ECONNRESET", Const, 0}, + {"EDEADLK", Const, 0}, + {"EDEADLOCK", Const, 0}, + {"EDESTADDRREQ", Const, 0}, + {"EDEVERR", Const, 0}, + {"EDOM", Const, 0}, + {"EDOOFUS", Const, 0}, + {"EDOTDOT", Const, 0}, + {"EDQUOT", Const, 0}, + {"EEXIST", Const, 0}, + {"EFAULT", Const, 0}, + {"EFBIG", Const, 0}, + {"EFER_LMA", Const, 1}, + {"EFER_LME", Const, 1}, + {"EFER_NXE", Const, 1}, + {"EFER_SCE", Const, 1}, + {"EFTYPE", Const, 0}, + {"EHOSTDOWN", Const, 0}, + {"EHOSTUNREACH", Const, 0}, + {"EHWPOISON", Const, 0}, + {"EIDRM", Const, 0}, + {"EILSEQ", Const, 0}, + {"EINPROGRESS", Const, 0}, + {"EINTR", Const, 0}, + {"EINVAL", Const, 0}, + {"EIO", Const, 0}, + {"EIPSEC", Const, 1}, + {"EISCONN", Const, 0}, + {"EISDIR", Const, 0}, + {"EISNAM", Const, 0}, + {"EKEYEXPIRED", Const, 0}, + {"EKEYREJECTED", Const, 0}, + {"EKEYREVOKED", Const, 0}, + {"EL2HLT", Const, 0}, + {"EL2NSYNC", Const, 0}, + {"EL3HLT", Const, 0}, + {"EL3RST", Const, 0}, + {"ELAST", Const, 0}, + {"ELF_NGREG", Const, 0}, + {"ELF_PRARGSZ", Const, 0}, + {"ELIBACC", Const, 0}, + {"ELIBBAD", Const, 0}, + {"ELIBEXEC", Const, 0}, + {"ELIBMAX", Const, 0}, + {"ELIBSCN", Const, 0}, + {"ELNRNG", Const, 0}, + {"ELOOP", Const, 0}, + {"EMEDIUMTYPE", Const, 0}, + {"EMFILE", Const, 0}, + {"EMLINK", Const, 0}, + {"EMSGSIZE", Const, 0}, + {"EMT_TAGOVF", Const, 1}, + {"EMULTIHOP", Const, 0}, + {"EMUL_ENABLED", Const, 1}, + {"EMUL_LINUX", Const, 1}, + {"EMUL_LINUX32", Const, 1}, + {"EMUL_MAXID", Const, 1}, + {"EMUL_NATIVE", Const, 1}, + {"ENAMETOOLONG", Const, 0}, + {"ENAVAIL", Const, 0}, + {"ENDRUNDISC", Const, 1}, + {"ENEEDAUTH", Const, 0}, + {"ENETDOWN", Const, 0}, + {"ENETRESET", Const, 0}, + {"ENETUNREACH", Const, 0}, + {"ENFILE", Const, 0}, + {"ENOANO", Const, 0}, + {"ENOATTR", Const, 0}, + {"ENOBUFS", Const, 0}, + {"ENOCSI", Const, 0}, + {"ENODATA", Const, 0}, + {"ENODEV", Const, 0}, + {"ENOENT", Const, 0}, + {"ENOEXEC", Const, 0}, + {"ENOKEY", Const, 0}, + {"ENOLCK", Const, 0}, + {"ENOLINK", Const, 0}, + {"ENOMEDIUM", Const, 0}, + {"ENOMEM", Const, 0}, + {"ENOMSG", Const, 0}, + {"ENONET", Const, 0}, + {"ENOPKG", Const, 0}, + {"ENOPOLICY", Const, 0}, + {"ENOPROTOOPT", Const, 0}, + {"ENOSPC", Const, 0}, + {"ENOSR", Const, 0}, + {"ENOSTR", Const, 0}, + {"ENOSYS", Const, 0}, + {"ENOTBLK", Const, 0}, + {"ENOTCAPABLE", Const, 0}, + {"ENOTCONN", Const, 0}, + {"ENOTDIR", Const, 0}, + {"ENOTEMPTY", Const, 0}, + {"ENOTNAM", Const, 0}, + {"ENOTRECOVERABLE", Const, 0}, + {"ENOTSOCK", Const, 0}, + {"ENOTSUP", Const, 0}, + {"ENOTTY", Const, 0}, + {"ENOTUNIQ", Const, 0}, + {"ENXIO", Const, 0}, + {"EN_SW_CTL_INF", Const, 1}, + {"EN_SW_CTL_PREC", Const, 1}, + {"EN_SW_CTL_ROUND", Const, 1}, + {"EN_SW_DATACHAIN", Const, 1}, + {"EN_SW_DENORM", Const, 1}, + {"EN_SW_INVOP", Const, 1}, + {"EN_SW_OVERFLOW", Const, 1}, + {"EN_SW_PRECLOSS", Const, 1}, + {"EN_SW_UNDERFLOW", Const, 1}, + {"EN_SW_ZERODIV", Const, 1}, + {"EOPNOTSUPP", Const, 0}, + {"EOVERFLOW", Const, 0}, + {"EOWNERDEAD", Const, 0}, + {"EPERM", Const, 0}, + {"EPFNOSUPPORT", Const, 0}, + {"EPIPE", Const, 0}, + {"EPOLLERR", Const, 0}, + {"EPOLLET", Const, 0}, + {"EPOLLHUP", Const, 0}, + {"EPOLLIN", Const, 0}, + {"EPOLLMSG", Const, 0}, + {"EPOLLONESHOT", Const, 0}, + {"EPOLLOUT", Const, 0}, + {"EPOLLPRI", Const, 0}, + {"EPOLLRDBAND", Const, 0}, + {"EPOLLRDHUP", Const, 0}, + {"EPOLLRDNORM", Const, 0}, + {"EPOLLWRBAND", Const, 0}, + {"EPOLLWRNORM", Const, 0}, + {"EPOLL_CLOEXEC", Const, 0}, + {"EPOLL_CTL_ADD", Const, 0}, + {"EPOLL_CTL_DEL", Const, 0}, + {"EPOLL_CTL_MOD", Const, 0}, + {"EPOLL_NONBLOCK", Const, 0}, + {"EPROCLIM", Const, 0}, + {"EPROCUNAVAIL", Const, 0}, + {"EPROGMISMATCH", Const, 0}, + {"EPROGUNAVAIL", Const, 0}, + {"EPROTO", Const, 0}, + {"EPROTONOSUPPORT", Const, 0}, + {"EPROTOTYPE", Const, 0}, + {"EPWROFF", Const, 0}, + {"EQFULL", Const, 16}, + {"ERANGE", Const, 0}, + {"EREMCHG", Const, 0}, + {"EREMOTE", Const, 0}, + {"EREMOTEIO", Const, 0}, + {"ERESTART", Const, 0}, + {"ERFKILL", Const, 0}, + {"EROFS", Const, 0}, + {"ERPCMISMATCH", Const, 0}, + {"ERROR_ACCESS_DENIED", Const, 0}, + {"ERROR_ALREADY_EXISTS", Const, 0}, + {"ERROR_BROKEN_PIPE", Const, 0}, + {"ERROR_BUFFER_OVERFLOW", Const, 0}, + {"ERROR_DIR_NOT_EMPTY", Const, 8}, + {"ERROR_ENVVAR_NOT_FOUND", Const, 0}, + {"ERROR_FILE_EXISTS", Const, 0}, + {"ERROR_FILE_NOT_FOUND", Const, 0}, + {"ERROR_HANDLE_EOF", Const, 2}, + {"ERROR_INSUFFICIENT_BUFFER", Const, 0}, + {"ERROR_IO_PENDING", Const, 0}, + {"ERROR_MOD_NOT_FOUND", Const, 0}, + {"ERROR_MORE_DATA", Const, 3}, + {"ERROR_NETNAME_DELETED", Const, 3}, + {"ERROR_NOT_FOUND", Const, 1}, + {"ERROR_NO_MORE_FILES", Const, 0}, + {"ERROR_OPERATION_ABORTED", Const, 0}, + {"ERROR_PATH_NOT_FOUND", Const, 0}, + {"ERROR_PRIVILEGE_NOT_HELD", Const, 4}, + {"ERROR_PROC_NOT_FOUND", Const, 0}, + {"ESHLIBVERS", Const, 0}, + {"ESHUTDOWN", Const, 0}, + {"ESOCKTNOSUPPORT", Const, 0}, + {"ESPIPE", Const, 0}, + {"ESRCH", Const, 0}, + {"ESRMNT", Const, 0}, + {"ESTALE", Const, 0}, + {"ESTRPIPE", Const, 0}, + {"ETHERCAP_JUMBO_MTU", Const, 1}, + {"ETHERCAP_VLAN_HWTAGGING", Const, 1}, + {"ETHERCAP_VLAN_MTU", Const, 1}, + {"ETHERMIN", Const, 1}, + {"ETHERMTU", Const, 1}, + {"ETHERMTU_JUMBO", Const, 1}, + {"ETHERTYPE_8023", Const, 1}, + {"ETHERTYPE_AARP", Const, 1}, + {"ETHERTYPE_ACCTON", Const, 1}, + {"ETHERTYPE_AEONIC", Const, 1}, + {"ETHERTYPE_ALPHA", Const, 1}, + {"ETHERTYPE_AMBER", Const, 1}, + {"ETHERTYPE_AMOEBA", Const, 1}, + {"ETHERTYPE_AOE", Const, 1}, + {"ETHERTYPE_APOLLO", Const, 1}, + {"ETHERTYPE_APOLLODOMAIN", Const, 1}, + {"ETHERTYPE_APPLETALK", Const, 1}, + {"ETHERTYPE_APPLITEK", Const, 1}, + {"ETHERTYPE_ARGONAUT", Const, 1}, + {"ETHERTYPE_ARP", Const, 1}, + {"ETHERTYPE_AT", Const, 1}, + {"ETHERTYPE_ATALK", Const, 1}, + {"ETHERTYPE_ATOMIC", Const, 1}, + {"ETHERTYPE_ATT", Const, 1}, + {"ETHERTYPE_ATTSTANFORD", Const, 1}, + {"ETHERTYPE_AUTOPHON", Const, 1}, + {"ETHERTYPE_AXIS", Const, 1}, + {"ETHERTYPE_BCLOOP", Const, 1}, + {"ETHERTYPE_BOFL", Const, 1}, + {"ETHERTYPE_CABLETRON", Const, 1}, + {"ETHERTYPE_CHAOS", Const, 1}, + {"ETHERTYPE_COMDESIGN", Const, 1}, + {"ETHERTYPE_COMPUGRAPHIC", Const, 1}, + {"ETHERTYPE_COUNTERPOINT", Const, 1}, + {"ETHERTYPE_CRONUS", Const, 1}, + {"ETHERTYPE_CRONUSVLN", Const, 1}, + {"ETHERTYPE_DCA", Const, 1}, + {"ETHERTYPE_DDE", Const, 1}, + {"ETHERTYPE_DEBNI", Const, 1}, + {"ETHERTYPE_DECAM", Const, 1}, + {"ETHERTYPE_DECCUST", Const, 1}, + {"ETHERTYPE_DECDIAG", Const, 1}, + {"ETHERTYPE_DECDNS", Const, 1}, + {"ETHERTYPE_DECDTS", Const, 1}, + {"ETHERTYPE_DECEXPER", Const, 1}, + {"ETHERTYPE_DECLAST", Const, 1}, + {"ETHERTYPE_DECLTM", Const, 1}, + {"ETHERTYPE_DECMUMPS", Const, 1}, + {"ETHERTYPE_DECNETBIOS", Const, 1}, + {"ETHERTYPE_DELTACON", Const, 1}, + {"ETHERTYPE_DIDDLE", Const, 1}, + {"ETHERTYPE_DLOG1", Const, 1}, + {"ETHERTYPE_DLOG2", Const, 1}, + {"ETHERTYPE_DN", Const, 1}, + {"ETHERTYPE_DOGFIGHT", Const, 1}, + {"ETHERTYPE_DSMD", Const, 1}, + {"ETHERTYPE_ECMA", Const, 1}, + {"ETHERTYPE_ENCRYPT", Const, 1}, + {"ETHERTYPE_ES", Const, 1}, + {"ETHERTYPE_EXCELAN", Const, 1}, + {"ETHERTYPE_EXPERDATA", Const, 1}, + {"ETHERTYPE_FLIP", Const, 1}, + {"ETHERTYPE_FLOWCONTROL", Const, 1}, + {"ETHERTYPE_FRARP", Const, 1}, + {"ETHERTYPE_GENDYN", Const, 1}, + {"ETHERTYPE_HAYES", Const, 1}, + {"ETHERTYPE_HIPPI_FP", Const, 1}, + {"ETHERTYPE_HITACHI", Const, 1}, + {"ETHERTYPE_HP", Const, 1}, + {"ETHERTYPE_IEEEPUP", Const, 1}, + {"ETHERTYPE_IEEEPUPAT", Const, 1}, + {"ETHERTYPE_IMLBL", Const, 1}, + {"ETHERTYPE_IMLBLDIAG", Const, 1}, + {"ETHERTYPE_IP", Const, 1}, + {"ETHERTYPE_IPAS", Const, 1}, + {"ETHERTYPE_IPV6", Const, 1}, + {"ETHERTYPE_IPX", Const, 1}, + {"ETHERTYPE_IPXNEW", Const, 1}, + {"ETHERTYPE_KALPANA", Const, 1}, + {"ETHERTYPE_LANBRIDGE", Const, 1}, + {"ETHERTYPE_LANPROBE", Const, 1}, + {"ETHERTYPE_LAT", Const, 1}, + {"ETHERTYPE_LBACK", Const, 1}, + {"ETHERTYPE_LITTLE", Const, 1}, + {"ETHERTYPE_LLDP", Const, 1}, + {"ETHERTYPE_LOGICRAFT", Const, 1}, + {"ETHERTYPE_LOOPBACK", Const, 1}, + {"ETHERTYPE_MATRA", Const, 1}, + {"ETHERTYPE_MAX", Const, 1}, + {"ETHERTYPE_MERIT", Const, 1}, + {"ETHERTYPE_MICP", Const, 1}, + {"ETHERTYPE_MOPDL", Const, 1}, + {"ETHERTYPE_MOPRC", Const, 1}, + {"ETHERTYPE_MOTOROLA", Const, 1}, + {"ETHERTYPE_MPLS", Const, 1}, + {"ETHERTYPE_MPLS_MCAST", Const, 1}, + {"ETHERTYPE_MUMPS", Const, 1}, + {"ETHERTYPE_NBPCC", Const, 1}, + {"ETHERTYPE_NBPCLAIM", Const, 1}, + {"ETHERTYPE_NBPCLREQ", Const, 1}, + {"ETHERTYPE_NBPCLRSP", Const, 1}, + {"ETHERTYPE_NBPCREQ", Const, 1}, + {"ETHERTYPE_NBPCRSP", Const, 1}, + {"ETHERTYPE_NBPDG", Const, 1}, + {"ETHERTYPE_NBPDGB", Const, 1}, + {"ETHERTYPE_NBPDLTE", Const, 1}, + {"ETHERTYPE_NBPRAR", Const, 1}, + {"ETHERTYPE_NBPRAS", Const, 1}, + {"ETHERTYPE_NBPRST", Const, 1}, + {"ETHERTYPE_NBPSCD", Const, 1}, + {"ETHERTYPE_NBPVCD", Const, 1}, + {"ETHERTYPE_NBS", Const, 1}, + {"ETHERTYPE_NCD", Const, 1}, + {"ETHERTYPE_NESTAR", Const, 1}, + {"ETHERTYPE_NETBEUI", Const, 1}, + {"ETHERTYPE_NOVELL", Const, 1}, + {"ETHERTYPE_NS", Const, 1}, + {"ETHERTYPE_NSAT", Const, 1}, + {"ETHERTYPE_NSCOMPAT", Const, 1}, + {"ETHERTYPE_NTRAILER", Const, 1}, + {"ETHERTYPE_OS9", Const, 1}, + {"ETHERTYPE_OS9NET", Const, 1}, + {"ETHERTYPE_PACER", Const, 1}, + {"ETHERTYPE_PAE", Const, 1}, + {"ETHERTYPE_PCS", Const, 1}, + {"ETHERTYPE_PLANNING", Const, 1}, + {"ETHERTYPE_PPP", Const, 1}, + {"ETHERTYPE_PPPOE", Const, 1}, + {"ETHERTYPE_PPPOEDISC", Const, 1}, + {"ETHERTYPE_PRIMENTS", Const, 1}, + {"ETHERTYPE_PUP", Const, 1}, + {"ETHERTYPE_PUPAT", Const, 1}, + {"ETHERTYPE_QINQ", Const, 1}, + {"ETHERTYPE_RACAL", Const, 1}, + {"ETHERTYPE_RATIONAL", Const, 1}, + {"ETHERTYPE_RAWFR", Const, 1}, + {"ETHERTYPE_RCL", Const, 1}, + {"ETHERTYPE_RDP", Const, 1}, + {"ETHERTYPE_RETIX", Const, 1}, + {"ETHERTYPE_REVARP", Const, 1}, + {"ETHERTYPE_SCA", Const, 1}, + {"ETHERTYPE_SECTRA", Const, 1}, + {"ETHERTYPE_SECUREDATA", Const, 1}, + {"ETHERTYPE_SGITW", Const, 1}, + {"ETHERTYPE_SG_BOUNCE", Const, 1}, + {"ETHERTYPE_SG_DIAG", Const, 1}, + {"ETHERTYPE_SG_NETGAMES", Const, 1}, + {"ETHERTYPE_SG_RESV", Const, 1}, + {"ETHERTYPE_SIMNET", Const, 1}, + {"ETHERTYPE_SLOW", Const, 1}, + {"ETHERTYPE_SLOWPROTOCOLS", Const, 1}, + {"ETHERTYPE_SNA", Const, 1}, + {"ETHERTYPE_SNMP", Const, 1}, + {"ETHERTYPE_SONIX", Const, 1}, + {"ETHERTYPE_SPIDER", Const, 1}, + {"ETHERTYPE_SPRITE", Const, 1}, + {"ETHERTYPE_STP", Const, 1}, + {"ETHERTYPE_TALARIS", Const, 1}, + {"ETHERTYPE_TALARISMC", Const, 1}, + {"ETHERTYPE_TCPCOMP", Const, 1}, + {"ETHERTYPE_TCPSM", Const, 1}, + {"ETHERTYPE_TEC", Const, 1}, + {"ETHERTYPE_TIGAN", Const, 1}, + {"ETHERTYPE_TRAIL", Const, 1}, + {"ETHERTYPE_TRANSETHER", Const, 1}, + {"ETHERTYPE_TYMSHARE", Const, 1}, + {"ETHERTYPE_UBBST", Const, 1}, + {"ETHERTYPE_UBDEBUG", Const, 1}, + {"ETHERTYPE_UBDIAGLOOP", Const, 1}, + {"ETHERTYPE_UBDL", Const, 1}, + {"ETHERTYPE_UBNIU", Const, 1}, + {"ETHERTYPE_UBNMC", Const, 1}, + {"ETHERTYPE_VALID", Const, 1}, + {"ETHERTYPE_VARIAN", Const, 1}, + {"ETHERTYPE_VAXELN", Const, 1}, + {"ETHERTYPE_VEECO", Const, 1}, + {"ETHERTYPE_VEXP", Const, 1}, + {"ETHERTYPE_VGLAB", Const, 1}, + {"ETHERTYPE_VINES", Const, 1}, + {"ETHERTYPE_VINESECHO", Const, 1}, + {"ETHERTYPE_VINESLOOP", Const, 1}, + {"ETHERTYPE_VITAL", Const, 1}, + {"ETHERTYPE_VLAN", Const, 1}, + {"ETHERTYPE_VLTLMAN", Const, 1}, + {"ETHERTYPE_VPROD", Const, 1}, + {"ETHERTYPE_VURESERVED", Const, 1}, + {"ETHERTYPE_WATERLOO", Const, 1}, + {"ETHERTYPE_WELLFLEET", Const, 1}, + {"ETHERTYPE_X25", Const, 1}, + {"ETHERTYPE_X75", Const, 1}, + {"ETHERTYPE_XNSSM", Const, 1}, + {"ETHERTYPE_XTP", Const, 1}, + {"ETHER_ADDR_LEN", Const, 1}, + {"ETHER_ALIGN", Const, 1}, + {"ETHER_CRC_LEN", Const, 1}, + {"ETHER_CRC_POLY_BE", Const, 1}, + {"ETHER_CRC_POLY_LE", Const, 1}, + {"ETHER_HDR_LEN", Const, 1}, + {"ETHER_MAX_DIX_LEN", Const, 1}, + {"ETHER_MAX_LEN", Const, 1}, + {"ETHER_MAX_LEN_JUMBO", Const, 1}, + {"ETHER_MIN_LEN", Const, 1}, + {"ETHER_PPPOE_ENCAP_LEN", Const, 1}, + {"ETHER_TYPE_LEN", Const, 1}, + {"ETHER_VLAN_ENCAP_LEN", Const, 1}, + {"ETH_P_1588", Const, 0}, + {"ETH_P_8021Q", Const, 0}, + {"ETH_P_802_2", Const, 0}, + {"ETH_P_802_3", Const, 0}, + {"ETH_P_AARP", Const, 0}, + {"ETH_P_ALL", Const, 0}, + {"ETH_P_AOE", Const, 0}, + {"ETH_P_ARCNET", Const, 0}, + {"ETH_P_ARP", Const, 0}, + {"ETH_P_ATALK", Const, 0}, + {"ETH_P_ATMFATE", Const, 0}, + {"ETH_P_ATMMPOA", Const, 0}, + {"ETH_P_AX25", Const, 0}, + {"ETH_P_BPQ", Const, 0}, + {"ETH_P_CAIF", Const, 0}, + {"ETH_P_CAN", Const, 0}, + {"ETH_P_CONTROL", Const, 0}, + {"ETH_P_CUST", Const, 0}, + {"ETH_P_DDCMP", Const, 0}, + {"ETH_P_DEC", Const, 0}, + {"ETH_P_DIAG", Const, 0}, + {"ETH_P_DNA_DL", Const, 0}, + {"ETH_P_DNA_RC", Const, 0}, + {"ETH_P_DNA_RT", Const, 0}, + {"ETH_P_DSA", Const, 0}, + {"ETH_P_ECONET", Const, 0}, + {"ETH_P_EDSA", Const, 0}, + {"ETH_P_FCOE", Const, 0}, + {"ETH_P_FIP", Const, 0}, + {"ETH_P_HDLC", Const, 0}, + {"ETH_P_IEEE802154", Const, 0}, + {"ETH_P_IEEEPUP", Const, 0}, + {"ETH_P_IEEEPUPAT", Const, 0}, + {"ETH_P_IP", Const, 0}, + {"ETH_P_IPV6", Const, 0}, + {"ETH_P_IPX", Const, 0}, + {"ETH_P_IRDA", Const, 0}, + {"ETH_P_LAT", Const, 0}, + {"ETH_P_LINK_CTL", Const, 0}, + {"ETH_P_LOCALTALK", Const, 0}, + {"ETH_P_LOOP", Const, 0}, + {"ETH_P_MOBITEX", Const, 0}, + {"ETH_P_MPLS_MC", Const, 0}, + {"ETH_P_MPLS_UC", Const, 0}, + {"ETH_P_PAE", Const, 0}, + {"ETH_P_PAUSE", Const, 0}, + {"ETH_P_PHONET", Const, 0}, + {"ETH_P_PPPTALK", Const, 0}, + {"ETH_P_PPP_DISC", Const, 0}, + {"ETH_P_PPP_MP", Const, 0}, + {"ETH_P_PPP_SES", Const, 0}, + {"ETH_P_PUP", Const, 0}, + {"ETH_P_PUPAT", Const, 0}, + {"ETH_P_RARP", Const, 0}, + {"ETH_P_SCA", Const, 0}, + {"ETH_P_SLOW", Const, 0}, + {"ETH_P_SNAP", Const, 0}, + {"ETH_P_TEB", Const, 0}, + {"ETH_P_TIPC", Const, 0}, + {"ETH_P_TRAILER", Const, 0}, + {"ETH_P_TR_802_2", Const, 0}, + {"ETH_P_WAN_PPP", Const, 0}, + {"ETH_P_WCCP", Const, 0}, + {"ETH_P_X25", Const, 0}, + {"ETIME", Const, 0}, + {"ETIMEDOUT", Const, 0}, + {"ETOOMANYREFS", Const, 0}, + {"ETXTBSY", Const, 0}, + {"EUCLEAN", Const, 0}, + {"EUNATCH", Const, 0}, + {"EUSERS", Const, 0}, + {"EVFILT_AIO", Const, 0}, + {"EVFILT_FS", Const, 0}, + {"EVFILT_LIO", Const, 0}, + {"EVFILT_MACHPORT", Const, 0}, + {"EVFILT_PROC", Const, 0}, + {"EVFILT_READ", Const, 0}, + {"EVFILT_SIGNAL", Const, 0}, + {"EVFILT_SYSCOUNT", Const, 0}, + {"EVFILT_THREADMARKER", Const, 0}, + {"EVFILT_TIMER", Const, 0}, + {"EVFILT_USER", Const, 0}, + {"EVFILT_VM", Const, 0}, + {"EVFILT_VNODE", Const, 0}, + {"EVFILT_WRITE", Const, 0}, + {"EV_ADD", Const, 0}, + {"EV_CLEAR", Const, 0}, + {"EV_DELETE", Const, 0}, + {"EV_DISABLE", Const, 0}, + {"EV_DISPATCH", Const, 0}, + {"EV_DROP", Const, 3}, + {"EV_ENABLE", Const, 0}, + {"EV_EOF", Const, 0}, + {"EV_ERROR", Const, 0}, + {"EV_FLAG0", Const, 0}, + {"EV_FLAG1", Const, 0}, + {"EV_ONESHOT", Const, 0}, + {"EV_OOBAND", Const, 0}, + {"EV_POLL", Const, 0}, + {"EV_RECEIPT", Const, 0}, + {"EV_SYSFLAGS", Const, 0}, + {"EWINDOWS", Const, 0}, + {"EWOULDBLOCK", Const, 0}, + {"EXDEV", Const, 0}, + {"EXFULL", Const, 0}, + {"EXTA", Const, 0}, + {"EXTB", Const, 0}, + {"EXTPROC", Const, 0}, + {"Environ", Func, 0}, + {"EpollCreate", Func, 0}, + {"EpollCreate1", Func, 0}, + {"EpollCtl", Func, 0}, + {"EpollEvent", Type, 0}, + {"EpollEvent.Events", Field, 0}, + {"EpollEvent.Fd", Field, 0}, + {"EpollEvent.Pad", Field, 0}, + {"EpollEvent.PadFd", Field, 0}, + {"EpollWait", Func, 0}, + {"Errno", Type, 0}, + {"EscapeArg", Func, 0}, + {"Exchangedata", Func, 0}, + {"Exec", Func, 0}, + {"Exit", Func, 0}, + {"ExitProcess", Func, 0}, + {"FD_CLOEXEC", Const, 0}, + {"FD_SETSIZE", Const, 0}, + {"FILE_ACTION_ADDED", Const, 0}, + {"FILE_ACTION_MODIFIED", Const, 0}, + {"FILE_ACTION_REMOVED", Const, 0}, + {"FILE_ACTION_RENAMED_NEW_NAME", Const, 0}, + {"FILE_ACTION_RENAMED_OLD_NAME", Const, 0}, + {"FILE_APPEND_DATA", Const, 0}, + {"FILE_ATTRIBUTE_ARCHIVE", Const, 0}, + {"FILE_ATTRIBUTE_DIRECTORY", Const, 0}, + {"FILE_ATTRIBUTE_HIDDEN", Const, 0}, + {"FILE_ATTRIBUTE_NORMAL", Const, 0}, + {"FILE_ATTRIBUTE_READONLY", Const, 0}, + {"FILE_ATTRIBUTE_REPARSE_POINT", Const, 4}, + {"FILE_ATTRIBUTE_SYSTEM", Const, 0}, + {"FILE_BEGIN", Const, 0}, + {"FILE_CURRENT", Const, 0}, + {"FILE_END", Const, 0}, + {"FILE_FLAG_BACKUP_SEMANTICS", Const, 0}, + {"FILE_FLAG_OPEN_REPARSE_POINT", Const, 4}, + {"FILE_FLAG_OVERLAPPED", Const, 0}, + {"FILE_LIST_DIRECTORY", Const, 0}, + {"FILE_MAP_COPY", Const, 0}, + {"FILE_MAP_EXECUTE", Const, 0}, + {"FILE_MAP_READ", Const, 0}, + {"FILE_MAP_WRITE", Const, 0}, + {"FILE_NOTIFY_CHANGE_ATTRIBUTES", Const, 0}, + {"FILE_NOTIFY_CHANGE_CREATION", Const, 0}, + {"FILE_NOTIFY_CHANGE_DIR_NAME", Const, 0}, + {"FILE_NOTIFY_CHANGE_FILE_NAME", Const, 0}, + {"FILE_NOTIFY_CHANGE_LAST_ACCESS", Const, 0}, + {"FILE_NOTIFY_CHANGE_LAST_WRITE", Const, 0}, + {"FILE_NOTIFY_CHANGE_SIZE", Const, 0}, + {"FILE_SHARE_DELETE", Const, 0}, + {"FILE_SHARE_READ", Const, 0}, + {"FILE_SHARE_WRITE", Const, 0}, + {"FILE_SKIP_COMPLETION_PORT_ON_SUCCESS", Const, 2}, + {"FILE_SKIP_SET_EVENT_ON_HANDLE", Const, 2}, + {"FILE_TYPE_CHAR", Const, 0}, + {"FILE_TYPE_DISK", Const, 0}, + {"FILE_TYPE_PIPE", Const, 0}, + {"FILE_TYPE_REMOTE", Const, 0}, + {"FILE_TYPE_UNKNOWN", Const, 0}, + {"FILE_WRITE_ATTRIBUTES", Const, 0}, + {"FLUSHO", Const, 0}, + {"FORMAT_MESSAGE_ALLOCATE_BUFFER", Const, 0}, + {"FORMAT_MESSAGE_ARGUMENT_ARRAY", Const, 0}, + {"FORMAT_MESSAGE_FROM_HMODULE", Const, 0}, + {"FORMAT_MESSAGE_FROM_STRING", Const, 0}, + {"FORMAT_MESSAGE_FROM_SYSTEM", Const, 0}, + {"FORMAT_MESSAGE_IGNORE_INSERTS", Const, 0}, + {"FORMAT_MESSAGE_MAX_WIDTH_MASK", Const, 0}, + {"FSCTL_GET_REPARSE_POINT", Const, 4}, + {"F_ADDFILESIGS", Const, 0}, + {"F_ADDSIGS", Const, 0}, + {"F_ALLOCATEALL", Const, 0}, + {"F_ALLOCATECONTIG", Const, 0}, + {"F_CANCEL", Const, 0}, + {"F_CHKCLEAN", Const, 0}, + {"F_CLOSEM", Const, 1}, + {"F_DUP2FD", Const, 0}, + {"F_DUP2FD_CLOEXEC", Const, 1}, + {"F_DUPFD", Const, 0}, + {"F_DUPFD_CLOEXEC", Const, 0}, + {"F_EXLCK", Const, 0}, + {"F_FINDSIGS", Const, 16}, + {"F_FLUSH_DATA", Const, 0}, + {"F_FREEZE_FS", Const, 0}, + {"F_FSCTL", Const, 1}, + {"F_FSDIRMASK", Const, 1}, + {"F_FSIN", Const, 1}, + {"F_FSINOUT", Const, 1}, + {"F_FSOUT", Const, 1}, + {"F_FSPRIV", Const, 1}, + {"F_FSVOID", Const, 1}, + {"F_FULLFSYNC", Const, 0}, + {"F_GETCODEDIR", Const, 16}, + {"F_GETFD", Const, 0}, + {"F_GETFL", Const, 0}, + {"F_GETLEASE", Const, 0}, + {"F_GETLK", Const, 0}, + {"F_GETLK64", Const, 0}, + {"F_GETLKPID", Const, 0}, + {"F_GETNOSIGPIPE", Const, 0}, + {"F_GETOWN", Const, 0}, + {"F_GETOWN_EX", Const, 0}, + {"F_GETPATH", Const, 0}, + {"F_GETPATH_MTMINFO", Const, 0}, + {"F_GETPIPE_SZ", Const, 0}, + {"F_GETPROTECTIONCLASS", Const, 0}, + {"F_GETPROTECTIONLEVEL", Const, 16}, + {"F_GETSIG", Const, 0}, + {"F_GLOBAL_NOCACHE", Const, 0}, + {"F_LOCK", Const, 0}, + {"F_LOG2PHYS", Const, 0}, + {"F_LOG2PHYS_EXT", Const, 0}, + {"F_MARKDEPENDENCY", Const, 0}, + {"F_MAXFD", Const, 1}, + {"F_NOCACHE", Const, 0}, + {"F_NODIRECT", Const, 0}, + {"F_NOTIFY", Const, 0}, + {"F_OGETLK", Const, 0}, + {"F_OK", Const, 0}, + {"F_OSETLK", Const, 0}, + {"F_OSETLKW", Const, 0}, + {"F_PARAM_MASK", Const, 1}, + {"F_PARAM_MAX", Const, 1}, + {"F_PATHPKG_CHECK", Const, 0}, + {"F_PEOFPOSMODE", Const, 0}, + {"F_PREALLOCATE", Const, 0}, + {"F_RDADVISE", Const, 0}, + {"F_RDAHEAD", Const, 0}, + {"F_RDLCK", Const, 0}, + {"F_READAHEAD", Const, 0}, + {"F_READBOOTSTRAP", Const, 0}, + {"F_SETBACKINGSTORE", Const, 0}, + {"F_SETFD", Const, 0}, + {"F_SETFL", Const, 0}, + {"F_SETLEASE", Const, 0}, + {"F_SETLK", Const, 0}, + {"F_SETLK64", Const, 0}, + {"F_SETLKW", Const, 0}, + {"F_SETLKW64", Const, 0}, + {"F_SETLKWTIMEOUT", Const, 16}, + {"F_SETLK_REMOTE", Const, 0}, + {"F_SETNOSIGPIPE", Const, 0}, + {"F_SETOWN", Const, 0}, + {"F_SETOWN_EX", Const, 0}, + {"F_SETPIPE_SZ", Const, 0}, + {"F_SETPROTECTIONCLASS", Const, 0}, + {"F_SETSIG", Const, 0}, + {"F_SETSIZE", Const, 0}, + {"F_SHLCK", Const, 0}, + {"F_SINGLE_WRITER", Const, 16}, + {"F_TEST", Const, 0}, + {"F_THAW_FS", Const, 0}, + {"F_TLOCK", Const, 0}, + {"F_TRANSCODEKEY", Const, 16}, + {"F_ULOCK", Const, 0}, + {"F_UNLCK", Const, 0}, + {"F_UNLCKSYS", Const, 0}, + {"F_VOLPOSMODE", Const, 0}, + {"F_WRITEBOOTSTRAP", Const, 0}, + {"F_WRLCK", Const, 0}, + {"Faccessat", Func, 0}, + {"Fallocate", Func, 0}, + {"Fbootstraptransfer_t", Type, 0}, + {"Fbootstraptransfer_t.Buffer", Field, 0}, + {"Fbootstraptransfer_t.Length", Field, 0}, + {"Fbootstraptransfer_t.Offset", Field, 0}, + {"Fchdir", Func, 0}, + {"Fchflags", Func, 0}, + {"Fchmod", Func, 0}, + {"Fchmodat", Func, 0}, + {"Fchown", Func, 0}, + {"Fchownat", Func, 0}, + {"FcntlFlock", Func, 3}, + {"FdSet", Type, 0}, + {"FdSet.Bits", Field, 0}, + {"FdSet.X__fds_bits", Field, 0}, + {"Fdatasync", Func, 0}, + {"FileNotifyInformation", Type, 0}, + {"FileNotifyInformation.Action", Field, 0}, + {"FileNotifyInformation.FileName", Field, 0}, + {"FileNotifyInformation.FileNameLength", Field, 0}, + {"FileNotifyInformation.NextEntryOffset", Field, 0}, + {"Filetime", Type, 0}, + {"Filetime.HighDateTime", Field, 0}, + {"Filetime.LowDateTime", Field, 0}, + {"FindClose", Func, 0}, + {"FindFirstFile", Func, 0}, + {"FindNextFile", Func, 0}, + {"Flock", Func, 0}, + {"Flock_t", Type, 0}, + {"Flock_t.Len", Field, 0}, + {"Flock_t.Pad_cgo_0", Field, 0}, + {"Flock_t.Pad_cgo_1", Field, 3}, + {"Flock_t.Pid", Field, 0}, + {"Flock_t.Start", Field, 0}, + {"Flock_t.Sysid", Field, 0}, + {"Flock_t.Type", Field, 0}, + {"Flock_t.Whence", Field, 0}, + {"FlushBpf", Func, 0}, + {"FlushFileBuffers", Func, 0}, + {"FlushViewOfFile", Func, 0}, + {"ForkExec", Func, 0}, + {"ForkLock", Var, 0}, + {"FormatMessage", Func, 0}, + {"Fpathconf", Func, 0}, + {"FreeAddrInfoW", Func, 1}, + {"FreeEnvironmentStrings", Func, 0}, + {"FreeLibrary", Func, 0}, + {"Fsid", Type, 0}, + {"Fsid.Val", Field, 0}, + {"Fsid.X__fsid_val", Field, 2}, + {"Fsid.X__val", Field, 0}, + {"Fstat", Func, 0}, + {"Fstatat", Func, 12}, + {"Fstatfs", Func, 0}, + {"Fstore_t", Type, 0}, + {"Fstore_t.Bytesalloc", Field, 0}, + {"Fstore_t.Flags", Field, 0}, + {"Fstore_t.Length", Field, 0}, + {"Fstore_t.Offset", Field, 0}, + {"Fstore_t.Posmode", Field, 0}, + {"Fsync", Func, 0}, + {"Ftruncate", Func, 0}, + {"FullPath", Func, 4}, + {"Futimes", Func, 0}, + {"Futimesat", Func, 0}, + {"GENERIC_ALL", Const, 0}, + {"GENERIC_EXECUTE", Const, 0}, + {"GENERIC_READ", Const, 0}, + {"GENERIC_WRITE", Const, 0}, + {"GUID", Type, 1}, + {"GUID.Data1", Field, 1}, + {"GUID.Data2", Field, 1}, + {"GUID.Data3", Field, 1}, + {"GUID.Data4", Field, 1}, + {"GetAcceptExSockaddrs", Func, 0}, + {"GetAdaptersInfo", Func, 0}, + {"GetAddrInfoW", Func, 1}, + {"GetCommandLine", Func, 0}, + {"GetComputerName", Func, 0}, + {"GetConsoleMode", Func, 1}, + {"GetCurrentDirectory", Func, 0}, + {"GetCurrentProcess", Func, 0}, + {"GetEnvironmentStrings", Func, 0}, + {"GetEnvironmentVariable", Func, 0}, + {"GetExitCodeProcess", Func, 0}, + {"GetFileAttributes", Func, 0}, + {"GetFileAttributesEx", Func, 0}, + {"GetFileExInfoStandard", Const, 0}, + {"GetFileExMaxInfoLevel", Const, 0}, + {"GetFileInformationByHandle", Func, 0}, + {"GetFileType", Func, 0}, + {"GetFullPathName", Func, 0}, + {"GetHostByName", Func, 0}, + {"GetIfEntry", Func, 0}, + {"GetLastError", Func, 0}, + {"GetLengthSid", Func, 0}, + {"GetLongPathName", Func, 0}, + {"GetProcAddress", Func, 0}, + {"GetProcessTimes", Func, 0}, + {"GetProtoByName", Func, 0}, + {"GetQueuedCompletionStatus", Func, 0}, + {"GetServByName", Func, 0}, + {"GetShortPathName", Func, 0}, + {"GetStartupInfo", Func, 0}, + {"GetStdHandle", Func, 0}, + {"GetSystemTimeAsFileTime", Func, 0}, + {"GetTempPath", Func, 0}, + {"GetTimeZoneInformation", Func, 0}, + {"GetTokenInformation", Func, 0}, + {"GetUserNameEx", Func, 0}, + {"GetUserProfileDirectory", Func, 0}, + {"GetVersion", Func, 0}, + {"Getcwd", Func, 0}, + {"Getdents", Func, 0}, + {"Getdirentries", Func, 0}, + {"Getdtablesize", Func, 0}, + {"Getegid", Func, 0}, + {"Getenv", Func, 0}, + {"Geteuid", Func, 0}, + {"Getfsstat", Func, 0}, + {"Getgid", Func, 0}, + {"Getgroups", Func, 0}, + {"Getpagesize", Func, 0}, + {"Getpeername", Func, 0}, + {"Getpgid", Func, 0}, + {"Getpgrp", Func, 0}, + {"Getpid", Func, 0}, + {"Getppid", Func, 0}, + {"Getpriority", Func, 0}, + {"Getrlimit", Func, 0}, + {"Getrusage", Func, 0}, + {"Getsid", Func, 0}, + {"Getsockname", Func, 0}, + {"Getsockopt", Func, 1}, + {"GetsockoptByte", Func, 0}, + {"GetsockoptICMPv6Filter", Func, 2}, + {"GetsockoptIPMreq", Func, 0}, + {"GetsockoptIPMreqn", Func, 0}, + {"GetsockoptIPv6MTUInfo", Func, 2}, + {"GetsockoptIPv6Mreq", Func, 0}, + {"GetsockoptInet4Addr", Func, 0}, + {"GetsockoptInt", Func, 0}, + {"GetsockoptUcred", Func, 1}, + {"Gettid", Func, 0}, + {"Gettimeofday", Func, 0}, + {"Getuid", Func, 0}, + {"Getwd", Func, 0}, + {"Getxattr", Func, 1}, + {"HANDLE_FLAG_INHERIT", Const, 0}, + {"HKEY_CLASSES_ROOT", Const, 0}, + {"HKEY_CURRENT_CONFIG", Const, 0}, + {"HKEY_CURRENT_USER", Const, 0}, + {"HKEY_DYN_DATA", Const, 0}, + {"HKEY_LOCAL_MACHINE", Const, 0}, + {"HKEY_PERFORMANCE_DATA", Const, 0}, + {"HKEY_USERS", Const, 0}, + {"HUPCL", Const, 0}, + {"Handle", Type, 0}, + {"Hostent", Type, 0}, + {"Hostent.AddrList", Field, 0}, + {"Hostent.AddrType", Field, 0}, + {"Hostent.Aliases", Field, 0}, + {"Hostent.Length", Field, 0}, + {"Hostent.Name", Field, 0}, + {"ICANON", Const, 0}, + {"ICMP6_FILTER", Const, 2}, + {"ICMPV6_FILTER", Const, 2}, + {"ICMPv6Filter", Type, 2}, + {"ICMPv6Filter.Data", Field, 2}, + {"ICMPv6Filter.Filt", Field, 2}, + {"ICRNL", Const, 0}, + {"IEXTEN", Const, 0}, + {"IFAN_ARRIVAL", Const, 1}, + {"IFAN_DEPARTURE", Const, 1}, + {"IFA_ADDRESS", Const, 0}, + {"IFA_ANYCAST", Const, 0}, + {"IFA_BROADCAST", Const, 0}, + {"IFA_CACHEINFO", Const, 0}, + {"IFA_F_DADFAILED", Const, 0}, + {"IFA_F_DEPRECATED", Const, 0}, + {"IFA_F_HOMEADDRESS", Const, 0}, + {"IFA_F_NODAD", Const, 0}, + {"IFA_F_OPTIMISTIC", Const, 0}, + {"IFA_F_PERMANENT", Const, 0}, + {"IFA_F_SECONDARY", Const, 0}, + {"IFA_F_TEMPORARY", Const, 0}, + {"IFA_F_TENTATIVE", Const, 0}, + {"IFA_LABEL", Const, 0}, + {"IFA_LOCAL", Const, 0}, + {"IFA_MAX", Const, 0}, + {"IFA_MULTICAST", Const, 0}, + {"IFA_ROUTE", Const, 1}, + {"IFA_UNSPEC", Const, 0}, + {"IFF_ALLMULTI", Const, 0}, + {"IFF_ALTPHYS", Const, 0}, + {"IFF_AUTOMEDIA", Const, 0}, + {"IFF_BROADCAST", Const, 0}, + {"IFF_CANTCHANGE", Const, 0}, + {"IFF_CANTCONFIG", Const, 1}, + {"IFF_DEBUG", Const, 0}, + {"IFF_DRV_OACTIVE", Const, 0}, + {"IFF_DRV_RUNNING", Const, 0}, + {"IFF_DYING", Const, 0}, + {"IFF_DYNAMIC", Const, 0}, + {"IFF_LINK0", Const, 0}, + {"IFF_LINK1", Const, 0}, + {"IFF_LINK2", Const, 0}, + {"IFF_LOOPBACK", Const, 0}, + {"IFF_MASTER", Const, 0}, + {"IFF_MONITOR", Const, 0}, + {"IFF_MULTICAST", Const, 0}, + {"IFF_NOARP", Const, 0}, + {"IFF_NOTRAILERS", Const, 0}, + {"IFF_NO_PI", Const, 0}, + {"IFF_OACTIVE", Const, 0}, + {"IFF_ONE_QUEUE", Const, 0}, + {"IFF_POINTOPOINT", Const, 0}, + {"IFF_POINTTOPOINT", Const, 0}, + {"IFF_PORTSEL", Const, 0}, + {"IFF_PPROMISC", Const, 0}, + {"IFF_PROMISC", Const, 0}, + {"IFF_RENAMING", Const, 0}, + {"IFF_RUNNING", Const, 0}, + {"IFF_SIMPLEX", Const, 0}, + {"IFF_SLAVE", Const, 0}, + {"IFF_SMART", Const, 0}, + {"IFF_STATICARP", Const, 0}, + {"IFF_TAP", Const, 0}, + {"IFF_TUN", Const, 0}, + {"IFF_TUN_EXCL", Const, 0}, + {"IFF_UP", Const, 0}, + {"IFF_VNET_HDR", Const, 0}, + {"IFLA_ADDRESS", Const, 0}, + {"IFLA_BROADCAST", Const, 0}, + {"IFLA_COST", Const, 0}, + {"IFLA_IFALIAS", Const, 0}, + {"IFLA_IFNAME", Const, 0}, + {"IFLA_LINK", Const, 0}, + {"IFLA_LINKINFO", Const, 0}, + {"IFLA_LINKMODE", Const, 0}, + {"IFLA_MAP", Const, 0}, + {"IFLA_MASTER", Const, 0}, + {"IFLA_MAX", Const, 0}, + {"IFLA_MTU", Const, 0}, + {"IFLA_NET_NS_PID", Const, 0}, + {"IFLA_OPERSTATE", Const, 0}, + {"IFLA_PRIORITY", Const, 0}, + {"IFLA_PROTINFO", Const, 0}, + {"IFLA_QDISC", Const, 0}, + {"IFLA_STATS", Const, 0}, + {"IFLA_TXQLEN", Const, 0}, + {"IFLA_UNSPEC", Const, 0}, + {"IFLA_WEIGHT", Const, 0}, + {"IFLA_WIRELESS", Const, 0}, + {"IFNAMSIZ", Const, 0}, + {"IFT_1822", Const, 0}, + {"IFT_A12MPPSWITCH", Const, 0}, + {"IFT_AAL2", Const, 0}, + {"IFT_AAL5", Const, 0}, + {"IFT_ADSL", Const, 0}, + {"IFT_AFLANE8023", Const, 0}, + {"IFT_AFLANE8025", Const, 0}, + {"IFT_ARAP", Const, 0}, + {"IFT_ARCNET", Const, 0}, + {"IFT_ARCNETPLUS", Const, 0}, + {"IFT_ASYNC", Const, 0}, + {"IFT_ATM", Const, 0}, + {"IFT_ATMDXI", Const, 0}, + {"IFT_ATMFUNI", Const, 0}, + {"IFT_ATMIMA", Const, 0}, + {"IFT_ATMLOGICAL", Const, 0}, + {"IFT_ATMRADIO", Const, 0}, + {"IFT_ATMSUBINTERFACE", Const, 0}, + {"IFT_ATMVCIENDPT", Const, 0}, + {"IFT_ATMVIRTUAL", Const, 0}, + {"IFT_BGPPOLICYACCOUNTING", Const, 0}, + {"IFT_BLUETOOTH", Const, 1}, + {"IFT_BRIDGE", Const, 0}, + {"IFT_BSC", Const, 0}, + {"IFT_CARP", Const, 0}, + {"IFT_CCTEMUL", Const, 0}, + {"IFT_CELLULAR", Const, 0}, + {"IFT_CEPT", Const, 0}, + {"IFT_CES", Const, 0}, + {"IFT_CHANNEL", Const, 0}, + {"IFT_CNR", Const, 0}, + {"IFT_COFFEE", Const, 0}, + {"IFT_COMPOSITELINK", Const, 0}, + {"IFT_DCN", Const, 0}, + {"IFT_DIGITALPOWERLINE", Const, 0}, + {"IFT_DIGITALWRAPPEROVERHEADCHANNEL", Const, 0}, + {"IFT_DLSW", Const, 0}, + {"IFT_DOCSCABLEDOWNSTREAM", Const, 0}, + {"IFT_DOCSCABLEMACLAYER", Const, 0}, + {"IFT_DOCSCABLEUPSTREAM", Const, 0}, + {"IFT_DOCSCABLEUPSTREAMCHANNEL", Const, 1}, + {"IFT_DS0", Const, 0}, + {"IFT_DS0BUNDLE", Const, 0}, + {"IFT_DS1FDL", Const, 0}, + {"IFT_DS3", Const, 0}, + {"IFT_DTM", Const, 0}, + {"IFT_DUMMY", Const, 1}, + {"IFT_DVBASILN", Const, 0}, + {"IFT_DVBASIOUT", Const, 0}, + {"IFT_DVBRCCDOWNSTREAM", Const, 0}, + {"IFT_DVBRCCMACLAYER", Const, 0}, + {"IFT_DVBRCCUPSTREAM", Const, 0}, + {"IFT_ECONET", Const, 1}, + {"IFT_ENC", Const, 0}, + {"IFT_EON", Const, 0}, + {"IFT_EPLRS", Const, 0}, + {"IFT_ESCON", Const, 0}, + {"IFT_ETHER", Const, 0}, + {"IFT_FAITH", Const, 0}, + {"IFT_FAST", Const, 0}, + {"IFT_FASTETHER", Const, 0}, + {"IFT_FASTETHERFX", Const, 0}, + {"IFT_FDDI", Const, 0}, + {"IFT_FIBRECHANNEL", Const, 0}, + {"IFT_FRAMERELAYINTERCONNECT", Const, 0}, + {"IFT_FRAMERELAYMPI", Const, 0}, + {"IFT_FRDLCIENDPT", Const, 0}, + {"IFT_FRELAY", Const, 0}, + {"IFT_FRELAYDCE", Const, 0}, + {"IFT_FRF16MFRBUNDLE", Const, 0}, + {"IFT_FRFORWARD", Const, 0}, + {"IFT_G703AT2MB", Const, 0}, + {"IFT_G703AT64K", Const, 0}, + {"IFT_GIF", Const, 0}, + {"IFT_GIGABITETHERNET", Const, 0}, + {"IFT_GR303IDT", Const, 0}, + {"IFT_GR303RDT", Const, 0}, + {"IFT_H323GATEKEEPER", Const, 0}, + {"IFT_H323PROXY", Const, 0}, + {"IFT_HDH1822", Const, 0}, + {"IFT_HDLC", Const, 0}, + {"IFT_HDSL2", Const, 0}, + {"IFT_HIPERLAN2", Const, 0}, + {"IFT_HIPPI", Const, 0}, + {"IFT_HIPPIINTERFACE", Const, 0}, + {"IFT_HOSTPAD", Const, 0}, + {"IFT_HSSI", Const, 0}, + {"IFT_HY", Const, 0}, + {"IFT_IBM370PARCHAN", Const, 0}, + {"IFT_IDSL", Const, 0}, + {"IFT_IEEE1394", Const, 0}, + {"IFT_IEEE80211", Const, 0}, + {"IFT_IEEE80212", Const, 0}, + {"IFT_IEEE8023ADLAG", Const, 0}, + {"IFT_IFGSN", Const, 0}, + {"IFT_IMT", Const, 0}, + {"IFT_INFINIBAND", Const, 1}, + {"IFT_INTERLEAVE", Const, 0}, + {"IFT_IP", Const, 0}, + {"IFT_IPFORWARD", Const, 0}, + {"IFT_IPOVERATM", Const, 0}, + {"IFT_IPOVERCDLC", Const, 0}, + {"IFT_IPOVERCLAW", Const, 0}, + {"IFT_IPSWITCH", Const, 0}, + {"IFT_IPXIP", Const, 0}, + {"IFT_ISDN", Const, 0}, + {"IFT_ISDNBASIC", Const, 0}, + {"IFT_ISDNPRIMARY", Const, 0}, + {"IFT_ISDNS", Const, 0}, + {"IFT_ISDNU", Const, 0}, + {"IFT_ISO88022LLC", Const, 0}, + {"IFT_ISO88023", Const, 0}, + {"IFT_ISO88024", Const, 0}, + {"IFT_ISO88025", Const, 0}, + {"IFT_ISO88025CRFPINT", Const, 0}, + {"IFT_ISO88025DTR", Const, 0}, + {"IFT_ISO88025FIBER", Const, 0}, + {"IFT_ISO88026", Const, 0}, + {"IFT_ISUP", Const, 0}, + {"IFT_L2VLAN", Const, 0}, + {"IFT_L3IPVLAN", Const, 0}, + {"IFT_L3IPXVLAN", Const, 0}, + {"IFT_LAPB", Const, 0}, + {"IFT_LAPD", Const, 0}, + {"IFT_LAPF", Const, 0}, + {"IFT_LINEGROUP", Const, 1}, + {"IFT_LOCALTALK", Const, 0}, + {"IFT_LOOP", Const, 0}, + {"IFT_MEDIAMAILOVERIP", Const, 0}, + {"IFT_MFSIGLINK", Const, 0}, + {"IFT_MIOX25", Const, 0}, + {"IFT_MODEM", Const, 0}, + {"IFT_MPC", Const, 0}, + {"IFT_MPLS", Const, 0}, + {"IFT_MPLSTUNNEL", Const, 0}, + {"IFT_MSDSL", Const, 0}, + {"IFT_MVL", Const, 0}, + {"IFT_MYRINET", Const, 0}, + {"IFT_NFAS", Const, 0}, + {"IFT_NSIP", Const, 0}, + {"IFT_OPTICALCHANNEL", Const, 0}, + {"IFT_OPTICALTRANSPORT", Const, 0}, + {"IFT_OTHER", Const, 0}, + {"IFT_P10", Const, 0}, + {"IFT_P80", Const, 0}, + {"IFT_PARA", Const, 0}, + {"IFT_PDP", Const, 0}, + {"IFT_PFLOG", Const, 0}, + {"IFT_PFLOW", Const, 1}, + {"IFT_PFSYNC", Const, 0}, + {"IFT_PLC", Const, 0}, + {"IFT_PON155", Const, 1}, + {"IFT_PON622", Const, 1}, + {"IFT_POS", Const, 0}, + {"IFT_PPP", Const, 0}, + {"IFT_PPPMULTILINKBUNDLE", Const, 0}, + {"IFT_PROPATM", Const, 1}, + {"IFT_PROPBWAP2MP", Const, 0}, + {"IFT_PROPCNLS", Const, 0}, + {"IFT_PROPDOCSWIRELESSDOWNSTREAM", Const, 0}, + {"IFT_PROPDOCSWIRELESSMACLAYER", Const, 0}, + {"IFT_PROPDOCSWIRELESSUPSTREAM", Const, 0}, + {"IFT_PROPMUX", Const, 0}, + {"IFT_PROPVIRTUAL", Const, 0}, + {"IFT_PROPWIRELESSP2P", Const, 0}, + {"IFT_PTPSERIAL", Const, 0}, + {"IFT_PVC", Const, 0}, + {"IFT_Q2931", Const, 1}, + {"IFT_QLLC", Const, 0}, + {"IFT_RADIOMAC", Const, 0}, + {"IFT_RADSL", Const, 0}, + {"IFT_REACHDSL", Const, 0}, + {"IFT_RFC1483", Const, 0}, + {"IFT_RS232", Const, 0}, + {"IFT_RSRB", Const, 0}, + {"IFT_SDLC", Const, 0}, + {"IFT_SDSL", Const, 0}, + {"IFT_SHDSL", Const, 0}, + {"IFT_SIP", Const, 0}, + {"IFT_SIPSIG", Const, 1}, + {"IFT_SIPTG", Const, 1}, + {"IFT_SLIP", Const, 0}, + {"IFT_SMDSDXI", Const, 0}, + {"IFT_SMDSICIP", Const, 0}, + {"IFT_SONET", Const, 0}, + {"IFT_SONETOVERHEADCHANNEL", Const, 0}, + {"IFT_SONETPATH", Const, 0}, + {"IFT_SONETVT", Const, 0}, + {"IFT_SRP", Const, 0}, + {"IFT_SS7SIGLINK", Const, 0}, + {"IFT_STACKTOSTACK", Const, 0}, + {"IFT_STARLAN", Const, 0}, + {"IFT_STF", Const, 0}, + {"IFT_T1", Const, 0}, + {"IFT_TDLC", Const, 0}, + {"IFT_TELINK", Const, 1}, + {"IFT_TERMPAD", Const, 0}, + {"IFT_TR008", Const, 0}, + {"IFT_TRANSPHDLC", Const, 0}, + {"IFT_TUNNEL", Const, 0}, + {"IFT_ULTRA", Const, 0}, + {"IFT_USB", Const, 0}, + {"IFT_V11", Const, 0}, + {"IFT_V35", Const, 0}, + {"IFT_V36", Const, 0}, + {"IFT_V37", Const, 0}, + {"IFT_VDSL", Const, 0}, + {"IFT_VIRTUALIPADDRESS", Const, 0}, + {"IFT_VIRTUALTG", Const, 1}, + {"IFT_VOICEDID", Const, 1}, + {"IFT_VOICEEM", Const, 0}, + {"IFT_VOICEEMFGD", Const, 1}, + {"IFT_VOICEENCAP", Const, 0}, + {"IFT_VOICEFGDEANA", Const, 1}, + {"IFT_VOICEFXO", Const, 0}, + {"IFT_VOICEFXS", Const, 0}, + {"IFT_VOICEOVERATM", Const, 0}, + {"IFT_VOICEOVERCABLE", Const, 1}, + {"IFT_VOICEOVERFRAMERELAY", Const, 0}, + {"IFT_VOICEOVERIP", Const, 0}, + {"IFT_X213", Const, 0}, + {"IFT_X25", Const, 0}, + {"IFT_X25DDN", Const, 0}, + {"IFT_X25HUNTGROUP", Const, 0}, + {"IFT_X25MLP", Const, 0}, + {"IFT_X25PLE", Const, 0}, + {"IFT_XETHER", Const, 0}, + {"IGNBRK", Const, 0}, + {"IGNCR", Const, 0}, + {"IGNORE", Const, 0}, + {"IGNPAR", Const, 0}, + {"IMAXBEL", Const, 0}, + {"INFINITE", Const, 0}, + {"INLCR", Const, 0}, + {"INPCK", Const, 0}, + {"INVALID_FILE_ATTRIBUTES", Const, 0}, + {"IN_ACCESS", Const, 0}, + {"IN_ALL_EVENTS", Const, 0}, + {"IN_ATTRIB", Const, 0}, + {"IN_CLASSA_HOST", Const, 0}, + {"IN_CLASSA_MAX", Const, 0}, + {"IN_CLASSA_NET", Const, 0}, + {"IN_CLASSA_NSHIFT", Const, 0}, + {"IN_CLASSB_HOST", Const, 0}, + {"IN_CLASSB_MAX", Const, 0}, + {"IN_CLASSB_NET", Const, 0}, + {"IN_CLASSB_NSHIFT", Const, 0}, + {"IN_CLASSC_HOST", Const, 0}, + {"IN_CLASSC_NET", Const, 0}, + {"IN_CLASSC_NSHIFT", Const, 0}, + {"IN_CLASSD_HOST", Const, 0}, + {"IN_CLASSD_NET", Const, 0}, + {"IN_CLASSD_NSHIFT", Const, 0}, + {"IN_CLOEXEC", Const, 0}, + {"IN_CLOSE", Const, 0}, + {"IN_CLOSE_NOWRITE", Const, 0}, + {"IN_CLOSE_WRITE", Const, 0}, + {"IN_CREATE", Const, 0}, + {"IN_DELETE", Const, 0}, + {"IN_DELETE_SELF", Const, 0}, + {"IN_DONT_FOLLOW", Const, 0}, + {"IN_EXCL_UNLINK", Const, 0}, + {"IN_IGNORED", Const, 0}, + {"IN_ISDIR", Const, 0}, + {"IN_LINKLOCALNETNUM", Const, 0}, + {"IN_LOOPBACKNET", Const, 0}, + {"IN_MASK_ADD", Const, 0}, + {"IN_MODIFY", Const, 0}, + {"IN_MOVE", Const, 0}, + {"IN_MOVED_FROM", Const, 0}, + {"IN_MOVED_TO", Const, 0}, + {"IN_MOVE_SELF", Const, 0}, + {"IN_NONBLOCK", Const, 0}, + {"IN_ONESHOT", Const, 0}, + {"IN_ONLYDIR", Const, 0}, + {"IN_OPEN", Const, 0}, + {"IN_Q_OVERFLOW", Const, 0}, + {"IN_RFC3021_HOST", Const, 1}, + {"IN_RFC3021_MASK", Const, 1}, + {"IN_RFC3021_NET", Const, 1}, + {"IN_RFC3021_NSHIFT", Const, 1}, + {"IN_UNMOUNT", Const, 0}, + {"IOC_IN", Const, 1}, + {"IOC_INOUT", Const, 1}, + {"IOC_OUT", Const, 1}, + {"IOC_VENDOR", Const, 3}, + {"IOC_WS2", Const, 1}, + {"IO_REPARSE_TAG_SYMLINK", Const, 4}, + {"IPMreq", Type, 0}, + {"IPMreq.Interface", Field, 0}, + {"IPMreq.Multiaddr", Field, 0}, + {"IPMreqn", Type, 0}, + {"IPMreqn.Address", Field, 0}, + {"IPMreqn.Ifindex", Field, 0}, + {"IPMreqn.Multiaddr", Field, 0}, + {"IPPROTO_3PC", Const, 0}, + {"IPPROTO_ADFS", Const, 0}, + {"IPPROTO_AH", Const, 0}, + {"IPPROTO_AHIP", Const, 0}, + {"IPPROTO_APES", Const, 0}, + {"IPPROTO_ARGUS", Const, 0}, + {"IPPROTO_AX25", Const, 0}, + {"IPPROTO_BHA", Const, 0}, + {"IPPROTO_BLT", Const, 0}, + {"IPPROTO_BRSATMON", Const, 0}, + {"IPPROTO_CARP", Const, 0}, + {"IPPROTO_CFTP", Const, 0}, + {"IPPROTO_CHAOS", Const, 0}, + {"IPPROTO_CMTP", Const, 0}, + {"IPPROTO_COMP", Const, 0}, + {"IPPROTO_CPHB", Const, 0}, + {"IPPROTO_CPNX", Const, 0}, + {"IPPROTO_DCCP", Const, 0}, + {"IPPROTO_DDP", Const, 0}, + {"IPPROTO_DGP", Const, 0}, + {"IPPROTO_DIVERT", Const, 0}, + {"IPPROTO_DIVERT_INIT", Const, 3}, + {"IPPROTO_DIVERT_RESP", Const, 3}, + {"IPPROTO_DONE", Const, 0}, + {"IPPROTO_DSTOPTS", Const, 0}, + {"IPPROTO_EGP", Const, 0}, + {"IPPROTO_EMCON", Const, 0}, + {"IPPROTO_ENCAP", Const, 0}, + {"IPPROTO_EON", Const, 0}, + {"IPPROTO_ESP", Const, 0}, + {"IPPROTO_ETHERIP", Const, 0}, + {"IPPROTO_FRAGMENT", Const, 0}, + {"IPPROTO_GGP", Const, 0}, + {"IPPROTO_GMTP", Const, 0}, + {"IPPROTO_GRE", Const, 0}, + {"IPPROTO_HELLO", Const, 0}, + {"IPPROTO_HMP", Const, 0}, + {"IPPROTO_HOPOPTS", Const, 0}, + {"IPPROTO_ICMP", Const, 0}, + {"IPPROTO_ICMPV6", Const, 0}, + {"IPPROTO_IDP", Const, 0}, + {"IPPROTO_IDPR", Const, 0}, + {"IPPROTO_IDRP", Const, 0}, + {"IPPROTO_IGMP", Const, 0}, + {"IPPROTO_IGP", Const, 0}, + {"IPPROTO_IGRP", Const, 0}, + {"IPPROTO_IL", Const, 0}, + {"IPPROTO_INLSP", Const, 0}, + {"IPPROTO_INP", Const, 0}, + {"IPPROTO_IP", Const, 0}, + {"IPPROTO_IPCOMP", Const, 0}, + {"IPPROTO_IPCV", Const, 0}, + {"IPPROTO_IPEIP", Const, 0}, + {"IPPROTO_IPIP", Const, 0}, + {"IPPROTO_IPPC", Const, 0}, + {"IPPROTO_IPV4", Const, 0}, + {"IPPROTO_IPV6", Const, 0}, + {"IPPROTO_IPV6_ICMP", Const, 1}, + {"IPPROTO_IRTP", Const, 0}, + {"IPPROTO_KRYPTOLAN", Const, 0}, + {"IPPROTO_LARP", Const, 0}, + {"IPPROTO_LEAF1", Const, 0}, + {"IPPROTO_LEAF2", Const, 0}, + {"IPPROTO_MAX", Const, 0}, + {"IPPROTO_MAXID", Const, 0}, + {"IPPROTO_MEAS", Const, 0}, + {"IPPROTO_MH", Const, 1}, + {"IPPROTO_MHRP", Const, 0}, + {"IPPROTO_MICP", Const, 0}, + {"IPPROTO_MOBILE", Const, 0}, + {"IPPROTO_MPLS", Const, 1}, + {"IPPROTO_MTP", Const, 0}, + {"IPPROTO_MUX", Const, 0}, + {"IPPROTO_ND", Const, 0}, + {"IPPROTO_NHRP", Const, 0}, + {"IPPROTO_NONE", Const, 0}, + {"IPPROTO_NSP", Const, 0}, + {"IPPROTO_NVPII", Const, 0}, + {"IPPROTO_OLD_DIVERT", Const, 0}, + {"IPPROTO_OSPFIGP", Const, 0}, + {"IPPROTO_PFSYNC", Const, 0}, + {"IPPROTO_PGM", Const, 0}, + {"IPPROTO_PIGP", Const, 0}, + {"IPPROTO_PIM", Const, 0}, + {"IPPROTO_PRM", Const, 0}, + {"IPPROTO_PUP", Const, 0}, + {"IPPROTO_PVP", Const, 0}, + {"IPPROTO_RAW", Const, 0}, + {"IPPROTO_RCCMON", Const, 0}, + {"IPPROTO_RDP", Const, 0}, + {"IPPROTO_ROUTING", Const, 0}, + {"IPPROTO_RSVP", Const, 0}, + {"IPPROTO_RVD", Const, 0}, + {"IPPROTO_SATEXPAK", Const, 0}, + {"IPPROTO_SATMON", Const, 0}, + {"IPPROTO_SCCSP", Const, 0}, + {"IPPROTO_SCTP", Const, 0}, + {"IPPROTO_SDRP", Const, 0}, + {"IPPROTO_SEND", Const, 1}, + {"IPPROTO_SEP", Const, 0}, + {"IPPROTO_SKIP", Const, 0}, + {"IPPROTO_SPACER", Const, 0}, + {"IPPROTO_SRPC", Const, 0}, + {"IPPROTO_ST", Const, 0}, + {"IPPROTO_SVMTP", Const, 0}, + {"IPPROTO_SWIPE", Const, 0}, + {"IPPROTO_TCF", Const, 0}, + {"IPPROTO_TCP", Const, 0}, + {"IPPROTO_TLSP", Const, 0}, + {"IPPROTO_TP", Const, 0}, + {"IPPROTO_TPXX", Const, 0}, + {"IPPROTO_TRUNK1", Const, 0}, + {"IPPROTO_TRUNK2", Const, 0}, + {"IPPROTO_TTP", Const, 0}, + {"IPPROTO_UDP", Const, 0}, + {"IPPROTO_UDPLITE", Const, 0}, + {"IPPROTO_VINES", Const, 0}, + {"IPPROTO_VISA", Const, 0}, + {"IPPROTO_VMTP", Const, 0}, + {"IPPROTO_VRRP", Const, 1}, + {"IPPROTO_WBEXPAK", Const, 0}, + {"IPPROTO_WBMON", Const, 0}, + {"IPPROTO_WSN", Const, 0}, + {"IPPROTO_XNET", Const, 0}, + {"IPPROTO_XTP", Const, 0}, + {"IPV6_2292DSTOPTS", Const, 0}, + {"IPV6_2292HOPLIMIT", Const, 0}, + {"IPV6_2292HOPOPTS", Const, 0}, + {"IPV6_2292NEXTHOP", Const, 0}, + {"IPV6_2292PKTINFO", Const, 0}, + {"IPV6_2292PKTOPTIONS", Const, 0}, + {"IPV6_2292RTHDR", Const, 0}, + {"IPV6_ADDRFORM", Const, 0}, + {"IPV6_ADD_MEMBERSHIP", Const, 0}, + {"IPV6_AUTHHDR", Const, 0}, + {"IPV6_AUTH_LEVEL", Const, 1}, + {"IPV6_AUTOFLOWLABEL", Const, 0}, + {"IPV6_BINDANY", Const, 0}, + {"IPV6_BINDV6ONLY", Const, 0}, + {"IPV6_BOUND_IF", Const, 0}, + {"IPV6_CHECKSUM", Const, 0}, + {"IPV6_DEFAULT_MULTICAST_HOPS", Const, 0}, + {"IPV6_DEFAULT_MULTICAST_LOOP", Const, 0}, + {"IPV6_DEFHLIM", Const, 0}, + {"IPV6_DONTFRAG", Const, 0}, + {"IPV6_DROP_MEMBERSHIP", Const, 0}, + {"IPV6_DSTOPTS", Const, 0}, + {"IPV6_ESP_NETWORK_LEVEL", Const, 1}, + {"IPV6_ESP_TRANS_LEVEL", Const, 1}, + {"IPV6_FAITH", Const, 0}, + {"IPV6_FLOWINFO_MASK", Const, 0}, + {"IPV6_FLOWLABEL_MASK", Const, 0}, + {"IPV6_FRAGTTL", Const, 0}, + {"IPV6_FW_ADD", Const, 0}, + {"IPV6_FW_DEL", Const, 0}, + {"IPV6_FW_FLUSH", Const, 0}, + {"IPV6_FW_GET", Const, 0}, + {"IPV6_FW_ZERO", Const, 0}, + {"IPV6_HLIMDEC", Const, 0}, + {"IPV6_HOPLIMIT", Const, 0}, + {"IPV6_HOPOPTS", Const, 0}, + {"IPV6_IPCOMP_LEVEL", Const, 1}, + {"IPV6_IPSEC_POLICY", Const, 0}, + {"IPV6_JOIN_ANYCAST", Const, 0}, + {"IPV6_JOIN_GROUP", Const, 0}, + {"IPV6_LEAVE_ANYCAST", Const, 0}, + {"IPV6_LEAVE_GROUP", Const, 0}, + {"IPV6_MAXHLIM", Const, 0}, + {"IPV6_MAXOPTHDR", Const, 0}, + {"IPV6_MAXPACKET", Const, 0}, + {"IPV6_MAX_GROUP_SRC_FILTER", Const, 0}, + {"IPV6_MAX_MEMBERSHIPS", Const, 0}, + {"IPV6_MAX_SOCK_SRC_FILTER", Const, 0}, + {"IPV6_MIN_MEMBERSHIPS", Const, 0}, + {"IPV6_MMTU", Const, 0}, + {"IPV6_MSFILTER", Const, 0}, + {"IPV6_MTU", Const, 0}, + {"IPV6_MTU_DISCOVER", Const, 0}, + {"IPV6_MULTICAST_HOPS", Const, 0}, + {"IPV6_MULTICAST_IF", Const, 0}, + {"IPV6_MULTICAST_LOOP", Const, 0}, + {"IPV6_NEXTHOP", Const, 0}, + {"IPV6_OPTIONS", Const, 1}, + {"IPV6_PATHMTU", Const, 0}, + {"IPV6_PIPEX", Const, 1}, + {"IPV6_PKTINFO", Const, 0}, + {"IPV6_PMTUDISC_DO", Const, 0}, + {"IPV6_PMTUDISC_DONT", Const, 0}, + {"IPV6_PMTUDISC_PROBE", Const, 0}, + {"IPV6_PMTUDISC_WANT", Const, 0}, + {"IPV6_PORTRANGE", Const, 0}, + {"IPV6_PORTRANGE_DEFAULT", Const, 0}, + {"IPV6_PORTRANGE_HIGH", Const, 0}, + {"IPV6_PORTRANGE_LOW", Const, 0}, + {"IPV6_PREFER_TEMPADDR", Const, 0}, + {"IPV6_RECVDSTOPTS", Const, 0}, + {"IPV6_RECVDSTPORT", Const, 3}, + {"IPV6_RECVERR", Const, 0}, + {"IPV6_RECVHOPLIMIT", Const, 0}, + {"IPV6_RECVHOPOPTS", Const, 0}, + {"IPV6_RECVPATHMTU", Const, 0}, + {"IPV6_RECVPKTINFO", Const, 0}, + {"IPV6_RECVRTHDR", Const, 0}, + {"IPV6_RECVTCLASS", Const, 0}, + {"IPV6_ROUTER_ALERT", Const, 0}, + {"IPV6_RTABLE", Const, 1}, + {"IPV6_RTHDR", Const, 0}, + {"IPV6_RTHDRDSTOPTS", Const, 0}, + {"IPV6_RTHDR_LOOSE", Const, 0}, + {"IPV6_RTHDR_STRICT", Const, 0}, + {"IPV6_RTHDR_TYPE_0", Const, 0}, + {"IPV6_RXDSTOPTS", Const, 0}, + {"IPV6_RXHOPOPTS", Const, 0}, + {"IPV6_SOCKOPT_RESERVED1", Const, 0}, + {"IPV6_TCLASS", Const, 0}, + {"IPV6_UNICAST_HOPS", Const, 0}, + {"IPV6_USE_MIN_MTU", Const, 0}, + {"IPV6_V6ONLY", Const, 0}, + {"IPV6_VERSION", Const, 0}, + {"IPV6_VERSION_MASK", Const, 0}, + {"IPV6_XFRM_POLICY", Const, 0}, + {"IP_ADD_MEMBERSHIP", Const, 0}, + {"IP_ADD_SOURCE_MEMBERSHIP", Const, 0}, + {"IP_AUTH_LEVEL", Const, 1}, + {"IP_BINDANY", Const, 0}, + {"IP_BLOCK_SOURCE", Const, 0}, + {"IP_BOUND_IF", Const, 0}, + {"IP_DEFAULT_MULTICAST_LOOP", Const, 0}, + {"IP_DEFAULT_MULTICAST_TTL", Const, 0}, + {"IP_DF", Const, 0}, + {"IP_DIVERTFL", Const, 3}, + {"IP_DONTFRAG", Const, 0}, + {"IP_DROP_MEMBERSHIP", Const, 0}, + {"IP_DROP_SOURCE_MEMBERSHIP", Const, 0}, + {"IP_DUMMYNET3", Const, 0}, + {"IP_DUMMYNET_CONFIGURE", Const, 0}, + {"IP_DUMMYNET_DEL", Const, 0}, + {"IP_DUMMYNET_FLUSH", Const, 0}, + {"IP_DUMMYNET_GET", Const, 0}, + {"IP_EF", Const, 1}, + {"IP_ERRORMTU", Const, 1}, + {"IP_ESP_NETWORK_LEVEL", Const, 1}, + {"IP_ESP_TRANS_LEVEL", Const, 1}, + {"IP_FAITH", Const, 0}, + {"IP_FREEBIND", Const, 0}, + {"IP_FW3", Const, 0}, + {"IP_FW_ADD", Const, 0}, + {"IP_FW_DEL", Const, 0}, + {"IP_FW_FLUSH", Const, 0}, + {"IP_FW_GET", Const, 0}, + {"IP_FW_NAT_CFG", Const, 0}, + {"IP_FW_NAT_DEL", Const, 0}, + {"IP_FW_NAT_GET_CONFIG", Const, 0}, + {"IP_FW_NAT_GET_LOG", Const, 0}, + {"IP_FW_RESETLOG", Const, 0}, + {"IP_FW_TABLE_ADD", Const, 0}, + {"IP_FW_TABLE_DEL", Const, 0}, + {"IP_FW_TABLE_FLUSH", Const, 0}, + {"IP_FW_TABLE_GETSIZE", Const, 0}, + {"IP_FW_TABLE_LIST", Const, 0}, + {"IP_FW_ZERO", Const, 0}, + {"IP_HDRINCL", Const, 0}, + {"IP_IPCOMP_LEVEL", Const, 1}, + {"IP_IPSECFLOWINFO", Const, 1}, + {"IP_IPSEC_LOCAL_AUTH", Const, 1}, + {"IP_IPSEC_LOCAL_CRED", Const, 1}, + {"IP_IPSEC_LOCAL_ID", Const, 1}, + {"IP_IPSEC_POLICY", Const, 0}, + {"IP_IPSEC_REMOTE_AUTH", Const, 1}, + {"IP_IPSEC_REMOTE_CRED", Const, 1}, + {"IP_IPSEC_REMOTE_ID", Const, 1}, + {"IP_MAXPACKET", Const, 0}, + {"IP_MAX_GROUP_SRC_FILTER", Const, 0}, + {"IP_MAX_MEMBERSHIPS", Const, 0}, + {"IP_MAX_SOCK_MUTE_FILTER", Const, 0}, + {"IP_MAX_SOCK_SRC_FILTER", Const, 0}, + {"IP_MAX_SOURCE_FILTER", Const, 0}, + {"IP_MF", Const, 0}, + {"IP_MINFRAGSIZE", Const, 1}, + {"IP_MINTTL", Const, 0}, + {"IP_MIN_MEMBERSHIPS", Const, 0}, + {"IP_MSFILTER", Const, 0}, + {"IP_MSS", Const, 0}, + {"IP_MTU", Const, 0}, + {"IP_MTU_DISCOVER", Const, 0}, + {"IP_MULTICAST_IF", Const, 0}, + {"IP_MULTICAST_IFINDEX", Const, 0}, + {"IP_MULTICAST_LOOP", Const, 0}, + {"IP_MULTICAST_TTL", Const, 0}, + {"IP_MULTICAST_VIF", Const, 0}, + {"IP_NAT__XXX", Const, 0}, + {"IP_OFFMASK", Const, 0}, + {"IP_OLD_FW_ADD", Const, 0}, + {"IP_OLD_FW_DEL", Const, 0}, + {"IP_OLD_FW_FLUSH", Const, 0}, + {"IP_OLD_FW_GET", Const, 0}, + {"IP_OLD_FW_RESETLOG", Const, 0}, + {"IP_OLD_FW_ZERO", Const, 0}, + {"IP_ONESBCAST", Const, 0}, + {"IP_OPTIONS", Const, 0}, + {"IP_ORIGDSTADDR", Const, 0}, + {"IP_PASSSEC", Const, 0}, + {"IP_PIPEX", Const, 1}, + {"IP_PKTINFO", Const, 0}, + {"IP_PKTOPTIONS", Const, 0}, + {"IP_PMTUDISC", Const, 0}, + {"IP_PMTUDISC_DO", Const, 0}, + {"IP_PMTUDISC_DONT", Const, 0}, + {"IP_PMTUDISC_PROBE", Const, 0}, + {"IP_PMTUDISC_WANT", Const, 0}, + {"IP_PORTRANGE", Const, 0}, + {"IP_PORTRANGE_DEFAULT", Const, 0}, + {"IP_PORTRANGE_HIGH", Const, 0}, + {"IP_PORTRANGE_LOW", Const, 0}, + {"IP_RECVDSTADDR", Const, 0}, + {"IP_RECVDSTPORT", Const, 1}, + {"IP_RECVERR", Const, 0}, + {"IP_RECVIF", Const, 0}, + {"IP_RECVOPTS", Const, 0}, + {"IP_RECVORIGDSTADDR", Const, 0}, + {"IP_RECVPKTINFO", Const, 0}, + {"IP_RECVRETOPTS", Const, 0}, + {"IP_RECVRTABLE", Const, 1}, + {"IP_RECVTOS", Const, 0}, + {"IP_RECVTTL", Const, 0}, + {"IP_RETOPTS", Const, 0}, + {"IP_RF", Const, 0}, + {"IP_ROUTER_ALERT", Const, 0}, + {"IP_RSVP_OFF", Const, 0}, + {"IP_RSVP_ON", Const, 0}, + {"IP_RSVP_VIF_OFF", Const, 0}, + {"IP_RSVP_VIF_ON", Const, 0}, + {"IP_RTABLE", Const, 1}, + {"IP_SENDSRCADDR", Const, 0}, + {"IP_STRIPHDR", Const, 0}, + {"IP_TOS", Const, 0}, + {"IP_TRAFFIC_MGT_BACKGROUND", Const, 0}, + {"IP_TRANSPARENT", Const, 0}, + {"IP_TTL", Const, 0}, + {"IP_UNBLOCK_SOURCE", Const, 0}, + {"IP_XFRM_POLICY", Const, 0}, + {"IPv6MTUInfo", Type, 2}, + {"IPv6MTUInfo.Addr", Field, 2}, + {"IPv6MTUInfo.Mtu", Field, 2}, + {"IPv6Mreq", Type, 0}, + {"IPv6Mreq.Interface", Field, 0}, + {"IPv6Mreq.Multiaddr", Field, 0}, + {"ISIG", Const, 0}, + {"ISTRIP", Const, 0}, + {"IUCLC", Const, 0}, + {"IUTF8", Const, 0}, + {"IXANY", Const, 0}, + {"IXOFF", Const, 0}, + {"IXON", Const, 0}, + {"IfAddrmsg", Type, 0}, + {"IfAddrmsg.Family", Field, 0}, + {"IfAddrmsg.Flags", Field, 0}, + {"IfAddrmsg.Index", Field, 0}, + {"IfAddrmsg.Prefixlen", Field, 0}, + {"IfAddrmsg.Scope", Field, 0}, + {"IfAnnounceMsghdr", Type, 1}, + {"IfAnnounceMsghdr.Hdrlen", Field, 2}, + {"IfAnnounceMsghdr.Index", Field, 1}, + {"IfAnnounceMsghdr.Msglen", Field, 1}, + {"IfAnnounceMsghdr.Name", Field, 1}, + {"IfAnnounceMsghdr.Type", Field, 1}, + {"IfAnnounceMsghdr.Version", Field, 1}, + {"IfAnnounceMsghdr.What", Field, 1}, + {"IfData", Type, 0}, + {"IfData.Addrlen", Field, 0}, + {"IfData.Baudrate", Field, 0}, + {"IfData.Capabilities", Field, 2}, + {"IfData.Collisions", Field, 0}, + {"IfData.Datalen", Field, 0}, + {"IfData.Epoch", Field, 0}, + {"IfData.Hdrlen", Field, 0}, + {"IfData.Hwassist", Field, 0}, + {"IfData.Ibytes", Field, 0}, + {"IfData.Ierrors", Field, 0}, + {"IfData.Imcasts", Field, 0}, + {"IfData.Ipackets", Field, 0}, + {"IfData.Iqdrops", Field, 0}, + {"IfData.Lastchange", Field, 0}, + {"IfData.Link_state", Field, 0}, + {"IfData.Mclpool", Field, 2}, + {"IfData.Metric", Field, 0}, + {"IfData.Mtu", Field, 0}, + {"IfData.Noproto", Field, 0}, + {"IfData.Obytes", Field, 0}, + {"IfData.Oerrors", Field, 0}, + {"IfData.Omcasts", Field, 0}, + {"IfData.Opackets", Field, 0}, + {"IfData.Pad", Field, 2}, + {"IfData.Pad_cgo_0", Field, 2}, + {"IfData.Pad_cgo_1", Field, 2}, + {"IfData.Physical", Field, 0}, + {"IfData.Recvquota", Field, 0}, + {"IfData.Recvtiming", Field, 0}, + {"IfData.Reserved1", Field, 0}, + {"IfData.Reserved2", Field, 0}, + {"IfData.Spare_char1", Field, 0}, + {"IfData.Spare_char2", Field, 0}, + {"IfData.Type", Field, 0}, + {"IfData.Typelen", Field, 0}, + {"IfData.Unused1", Field, 0}, + {"IfData.Unused2", Field, 0}, + {"IfData.Xmitquota", Field, 0}, + {"IfData.Xmittiming", Field, 0}, + {"IfInfomsg", Type, 0}, + {"IfInfomsg.Change", Field, 0}, + {"IfInfomsg.Family", Field, 0}, + {"IfInfomsg.Flags", Field, 0}, + {"IfInfomsg.Index", Field, 0}, + {"IfInfomsg.Type", Field, 0}, + {"IfInfomsg.X__ifi_pad", Field, 0}, + {"IfMsghdr", Type, 0}, + {"IfMsghdr.Addrs", Field, 0}, + {"IfMsghdr.Data", Field, 0}, + {"IfMsghdr.Flags", Field, 0}, + {"IfMsghdr.Hdrlen", Field, 2}, + {"IfMsghdr.Index", Field, 0}, + {"IfMsghdr.Msglen", Field, 0}, + {"IfMsghdr.Pad1", Field, 2}, + {"IfMsghdr.Pad2", Field, 2}, + {"IfMsghdr.Pad_cgo_0", Field, 0}, + {"IfMsghdr.Pad_cgo_1", Field, 2}, + {"IfMsghdr.Tableid", Field, 2}, + {"IfMsghdr.Type", Field, 0}, + {"IfMsghdr.Version", Field, 0}, + {"IfMsghdr.Xflags", Field, 2}, + {"IfaMsghdr", Type, 0}, + {"IfaMsghdr.Addrs", Field, 0}, + {"IfaMsghdr.Flags", Field, 0}, + {"IfaMsghdr.Hdrlen", Field, 2}, + {"IfaMsghdr.Index", Field, 0}, + {"IfaMsghdr.Metric", Field, 0}, + {"IfaMsghdr.Msglen", Field, 0}, + {"IfaMsghdr.Pad1", Field, 2}, + {"IfaMsghdr.Pad2", Field, 2}, + {"IfaMsghdr.Pad_cgo_0", Field, 0}, + {"IfaMsghdr.Tableid", Field, 2}, + {"IfaMsghdr.Type", Field, 0}, + {"IfaMsghdr.Version", Field, 0}, + {"IfmaMsghdr", Type, 0}, + {"IfmaMsghdr.Addrs", Field, 0}, + {"IfmaMsghdr.Flags", Field, 0}, + {"IfmaMsghdr.Index", Field, 0}, + {"IfmaMsghdr.Msglen", Field, 0}, + {"IfmaMsghdr.Pad_cgo_0", Field, 0}, + {"IfmaMsghdr.Type", Field, 0}, + {"IfmaMsghdr.Version", Field, 0}, + {"IfmaMsghdr2", Type, 0}, + {"IfmaMsghdr2.Addrs", Field, 0}, + {"IfmaMsghdr2.Flags", Field, 0}, + {"IfmaMsghdr2.Index", Field, 0}, + {"IfmaMsghdr2.Msglen", Field, 0}, + {"IfmaMsghdr2.Pad_cgo_0", Field, 0}, + {"IfmaMsghdr2.Refcount", Field, 0}, + {"IfmaMsghdr2.Type", Field, 0}, + {"IfmaMsghdr2.Version", Field, 0}, + {"ImplementsGetwd", Const, 0}, + {"Inet4Pktinfo", Type, 0}, + {"Inet4Pktinfo.Addr", Field, 0}, + {"Inet4Pktinfo.Ifindex", Field, 0}, + {"Inet4Pktinfo.Spec_dst", Field, 0}, + {"Inet6Pktinfo", Type, 0}, + {"Inet6Pktinfo.Addr", Field, 0}, + {"Inet6Pktinfo.Ifindex", Field, 0}, + {"InotifyAddWatch", Func, 0}, + {"InotifyEvent", Type, 0}, + {"InotifyEvent.Cookie", Field, 0}, + {"InotifyEvent.Len", Field, 0}, + {"InotifyEvent.Mask", Field, 0}, + {"InotifyEvent.Name", Field, 0}, + {"InotifyEvent.Wd", Field, 0}, + {"InotifyInit", Func, 0}, + {"InotifyInit1", Func, 0}, + {"InotifyRmWatch", Func, 0}, + {"InterfaceAddrMessage", Type, 0}, + {"InterfaceAddrMessage.Data", Field, 0}, + {"InterfaceAddrMessage.Header", Field, 0}, + {"InterfaceAnnounceMessage", Type, 1}, + {"InterfaceAnnounceMessage.Header", Field, 1}, + {"InterfaceInfo", Type, 0}, + {"InterfaceInfo.Address", Field, 0}, + {"InterfaceInfo.BroadcastAddress", Field, 0}, + {"InterfaceInfo.Flags", Field, 0}, + {"InterfaceInfo.Netmask", Field, 0}, + {"InterfaceMessage", Type, 0}, + {"InterfaceMessage.Data", Field, 0}, + {"InterfaceMessage.Header", Field, 0}, + {"InterfaceMulticastAddrMessage", Type, 0}, + {"InterfaceMulticastAddrMessage.Data", Field, 0}, + {"InterfaceMulticastAddrMessage.Header", Field, 0}, + {"InvalidHandle", Const, 0}, + {"Ioperm", Func, 0}, + {"Iopl", Func, 0}, + {"Iovec", Type, 0}, + {"Iovec.Base", Field, 0}, + {"Iovec.Len", Field, 0}, + {"IpAdapterInfo", Type, 0}, + {"IpAdapterInfo.AdapterName", Field, 0}, + {"IpAdapterInfo.Address", Field, 0}, + {"IpAdapterInfo.AddressLength", Field, 0}, + {"IpAdapterInfo.ComboIndex", Field, 0}, + {"IpAdapterInfo.CurrentIpAddress", Field, 0}, + {"IpAdapterInfo.Description", Field, 0}, + {"IpAdapterInfo.DhcpEnabled", Field, 0}, + {"IpAdapterInfo.DhcpServer", Field, 0}, + {"IpAdapterInfo.GatewayList", Field, 0}, + {"IpAdapterInfo.HaveWins", Field, 0}, + {"IpAdapterInfo.Index", Field, 0}, + {"IpAdapterInfo.IpAddressList", Field, 0}, + {"IpAdapterInfo.LeaseExpires", Field, 0}, + {"IpAdapterInfo.LeaseObtained", Field, 0}, + {"IpAdapterInfo.Next", Field, 0}, + {"IpAdapterInfo.PrimaryWinsServer", Field, 0}, + {"IpAdapterInfo.SecondaryWinsServer", Field, 0}, + {"IpAdapterInfo.Type", Field, 0}, + {"IpAddrString", Type, 0}, + {"IpAddrString.Context", Field, 0}, + {"IpAddrString.IpAddress", Field, 0}, + {"IpAddrString.IpMask", Field, 0}, + {"IpAddrString.Next", Field, 0}, + {"IpAddressString", Type, 0}, + {"IpAddressString.String", Field, 0}, + {"IpMaskString", Type, 0}, + {"IpMaskString.String", Field, 2}, + {"Issetugid", Func, 0}, + {"KEY_ALL_ACCESS", Const, 0}, + {"KEY_CREATE_LINK", Const, 0}, + {"KEY_CREATE_SUB_KEY", Const, 0}, + {"KEY_ENUMERATE_SUB_KEYS", Const, 0}, + {"KEY_EXECUTE", Const, 0}, + {"KEY_NOTIFY", Const, 0}, + {"KEY_QUERY_VALUE", Const, 0}, + {"KEY_READ", Const, 0}, + {"KEY_SET_VALUE", Const, 0}, + {"KEY_WOW64_32KEY", Const, 0}, + {"KEY_WOW64_64KEY", Const, 0}, + {"KEY_WRITE", Const, 0}, + {"Kevent", Func, 0}, + {"Kevent_t", Type, 0}, + {"Kevent_t.Data", Field, 0}, + {"Kevent_t.Fflags", Field, 0}, + {"Kevent_t.Filter", Field, 0}, + {"Kevent_t.Flags", Field, 0}, + {"Kevent_t.Ident", Field, 0}, + {"Kevent_t.Pad_cgo_0", Field, 2}, + {"Kevent_t.Udata", Field, 0}, + {"Kill", Func, 0}, + {"Klogctl", Func, 0}, + {"Kqueue", Func, 0}, + {"LANG_ENGLISH", Const, 0}, + {"LAYERED_PROTOCOL", Const, 2}, + {"LCNT_OVERLOAD_FLUSH", Const, 1}, + {"LINUX_REBOOT_CMD_CAD_OFF", Const, 0}, + {"LINUX_REBOOT_CMD_CAD_ON", Const, 0}, + {"LINUX_REBOOT_CMD_HALT", Const, 0}, + {"LINUX_REBOOT_CMD_KEXEC", Const, 0}, + {"LINUX_REBOOT_CMD_POWER_OFF", Const, 0}, + {"LINUX_REBOOT_CMD_RESTART", Const, 0}, + {"LINUX_REBOOT_CMD_RESTART2", Const, 0}, + {"LINUX_REBOOT_CMD_SW_SUSPEND", Const, 0}, + {"LINUX_REBOOT_MAGIC1", Const, 0}, + {"LINUX_REBOOT_MAGIC2", Const, 0}, + {"LOCK_EX", Const, 0}, + {"LOCK_NB", Const, 0}, + {"LOCK_SH", Const, 0}, + {"LOCK_UN", Const, 0}, + {"LazyDLL", Type, 0}, + {"LazyDLL.Name", Field, 0}, + {"LazyProc", Type, 0}, + {"LazyProc.Name", Field, 0}, + {"Lchown", Func, 0}, + {"Linger", Type, 0}, + {"Linger.Linger", Field, 0}, + {"Linger.Onoff", Field, 0}, + {"Link", Func, 0}, + {"Listen", Func, 0}, + {"Listxattr", Func, 1}, + {"LoadCancelIoEx", Func, 1}, + {"LoadConnectEx", Func, 1}, + {"LoadCreateSymbolicLink", Func, 4}, + {"LoadDLL", Func, 0}, + {"LoadGetAddrInfo", Func, 1}, + {"LoadLibrary", Func, 0}, + {"LoadSetFileCompletionNotificationModes", Func, 2}, + {"LocalFree", Func, 0}, + {"Log2phys_t", Type, 0}, + {"Log2phys_t.Contigbytes", Field, 0}, + {"Log2phys_t.Devoffset", Field, 0}, + {"Log2phys_t.Flags", Field, 0}, + {"LookupAccountName", Func, 0}, + {"LookupAccountSid", Func, 0}, + {"LookupSID", Func, 0}, + {"LsfJump", Func, 0}, + {"LsfSocket", Func, 0}, + {"LsfStmt", Func, 0}, + {"Lstat", Func, 0}, + {"MADV_AUTOSYNC", Const, 1}, + {"MADV_CAN_REUSE", Const, 0}, + {"MADV_CORE", Const, 1}, + {"MADV_DOFORK", Const, 0}, + {"MADV_DONTFORK", Const, 0}, + {"MADV_DONTNEED", Const, 0}, + {"MADV_FREE", Const, 0}, + {"MADV_FREE_REUSABLE", Const, 0}, + {"MADV_FREE_REUSE", Const, 0}, + {"MADV_HUGEPAGE", Const, 0}, + {"MADV_HWPOISON", Const, 0}, + {"MADV_MERGEABLE", Const, 0}, + {"MADV_NOCORE", Const, 1}, + {"MADV_NOHUGEPAGE", Const, 0}, + {"MADV_NORMAL", Const, 0}, + {"MADV_NOSYNC", Const, 1}, + {"MADV_PROTECT", Const, 1}, + {"MADV_RANDOM", Const, 0}, + {"MADV_REMOVE", Const, 0}, + {"MADV_SEQUENTIAL", Const, 0}, + {"MADV_SPACEAVAIL", Const, 3}, + {"MADV_UNMERGEABLE", Const, 0}, + {"MADV_WILLNEED", Const, 0}, + {"MADV_ZERO_WIRED_PAGES", Const, 0}, + {"MAP_32BIT", Const, 0}, + {"MAP_ALIGNED_SUPER", Const, 3}, + {"MAP_ALIGNMENT_16MB", Const, 3}, + {"MAP_ALIGNMENT_1TB", Const, 3}, + {"MAP_ALIGNMENT_256TB", Const, 3}, + {"MAP_ALIGNMENT_4GB", Const, 3}, + {"MAP_ALIGNMENT_64KB", Const, 3}, + {"MAP_ALIGNMENT_64PB", Const, 3}, + {"MAP_ALIGNMENT_MASK", Const, 3}, + {"MAP_ALIGNMENT_SHIFT", Const, 3}, + {"MAP_ANON", Const, 0}, + {"MAP_ANONYMOUS", Const, 0}, + {"MAP_COPY", Const, 0}, + {"MAP_DENYWRITE", Const, 0}, + {"MAP_EXECUTABLE", Const, 0}, + {"MAP_FILE", Const, 0}, + {"MAP_FIXED", Const, 0}, + {"MAP_FLAGMASK", Const, 3}, + {"MAP_GROWSDOWN", Const, 0}, + {"MAP_HASSEMAPHORE", Const, 0}, + {"MAP_HUGETLB", Const, 0}, + {"MAP_INHERIT", Const, 3}, + {"MAP_INHERIT_COPY", Const, 3}, + {"MAP_INHERIT_DEFAULT", Const, 3}, + {"MAP_INHERIT_DONATE_COPY", Const, 3}, + {"MAP_INHERIT_NONE", Const, 3}, + {"MAP_INHERIT_SHARE", Const, 3}, + {"MAP_JIT", Const, 0}, + {"MAP_LOCKED", Const, 0}, + {"MAP_NOCACHE", Const, 0}, + {"MAP_NOCORE", Const, 1}, + {"MAP_NOEXTEND", Const, 0}, + {"MAP_NONBLOCK", Const, 0}, + {"MAP_NORESERVE", Const, 0}, + {"MAP_NOSYNC", Const, 1}, + {"MAP_POPULATE", Const, 0}, + {"MAP_PREFAULT_READ", Const, 1}, + {"MAP_PRIVATE", Const, 0}, + {"MAP_RENAME", Const, 0}, + {"MAP_RESERVED0080", Const, 0}, + {"MAP_RESERVED0100", Const, 1}, + {"MAP_SHARED", Const, 0}, + {"MAP_STACK", Const, 0}, + {"MAP_TRYFIXED", Const, 3}, + {"MAP_TYPE", Const, 0}, + {"MAP_WIRED", Const, 3}, + {"MAXIMUM_REPARSE_DATA_BUFFER_SIZE", Const, 4}, + {"MAXLEN_IFDESCR", Const, 0}, + {"MAXLEN_PHYSADDR", Const, 0}, + {"MAX_ADAPTER_ADDRESS_LENGTH", Const, 0}, + {"MAX_ADAPTER_DESCRIPTION_LENGTH", Const, 0}, + {"MAX_ADAPTER_NAME_LENGTH", Const, 0}, + {"MAX_COMPUTERNAME_LENGTH", Const, 0}, + {"MAX_INTERFACE_NAME_LEN", Const, 0}, + {"MAX_LONG_PATH", Const, 0}, + {"MAX_PATH", Const, 0}, + {"MAX_PROTOCOL_CHAIN", Const, 2}, + {"MCL_CURRENT", Const, 0}, + {"MCL_FUTURE", Const, 0}, + {"MNT_DETACH", Const, 0}, + {"MNT_EXPIRE", Const, 0}, + {"MNT_FORCE", Const, 0}, + {"MSG_BCAST", Const, 1}, + {"MSG_CMSG_CLOEXEC", Const, 0}, + {"MSG_COMPAT", Const, 0}, + {"MSG_CONFIRM", Const, 0}, + {"MSG_CONTROLMBUF", Const, 1}, + {"MSG_CTRUNC", Const, 0}, + {"MSG_DONTROUTE", Const, 0}, + {"MSG_DONTWAIT", Const, 0}, + {"MSG_EOF", Const, 0}, + {"MSG_EOR", Const, 0}, + {"MSG_ERRQUEUE", Const, 0}, + {"MSG_FASTOPEN", Const, 1}, + {"MSG_FIN", Const, 0}, + {"MSG_FLUSH", Const, 0}, + {"MSG_HAVEMORE", Const, 0}, + {"MSG_HOLD", Const, 0}, + {"MSG_IOVUSRSPACE", Const, 1}, + {"MSG_LENUSRSPACE", Const, 1}, + {"MSG_MCAST", Const, 1}, + {"MSG_MORE", Const, 0}, + {"MSG_NAMEMBUF", Const, 1}, + {"MSG_NBIO", Const, 0}, + {"MSG_NEEDSA", Const, 0}, + {"MSG_NOSIGNAL", Const, 0}, + {"MSG_NOTIFICATION", Const, 0}, + {"MSG_OOB", Const, 0}, + {"MSG_PEEK", Const, 0}, + {"MSG_PROXY", Const, 0}, + {"MSG_RCVMORE", Const, 0}, + {"MSG_RST", Const, 0}, + {"MSG_SEND", Const, 0}, + {"MSG_SYN", Const, 0}, + {"MSG_TRUNC", Const, 0}, + {"MSG_TRYHARD", Const, 0}, + {"MSG_USERFLAGS", Const, 1}, + {"MSG_WAITALL", Const, 0}, + {"MSG_WAITFORONE", Const, 0}, + {"MSG_WAITSTREAM", Const, 0}, + {"MS_ACTIVE", Const, 0}, + {"MS_ASYNC", Const, 0}, + {"MS_BIND", Const, 0}, + {"MS_DEACTIVATE", Const, 0}, + {"MS_DIRSYNC", Const, 0}, + {"MS_INVALIDATE", Const, 0}, + {"MS_I_VERSION", Const, 0}, + {"MS_KERNMOUNT", Const, 0}, + {"MS_KILLPAGES", Const, 0}, + {"MS_MANDLOCK", Const, 0}, + {"MS_MGC_MSK", Const, 0}, + {"MS_MGC_VAL", Const, 0}, + {"MS_MOVE", Const, 0}, + {"MS_NOATIME", Const, 0}, + {"MS_NODEV", Const, 0}, + {"MS_NODIRATIME", Const, 0}, + {"MS_NOEXEC", Const, 0}, + {"MS_NOSUID", Const, 0}, + {"MS_NOUSER", Const, 0}, + {"MS_POSIXACL", Const, 0}, + {"MS_PRIVATE", Const, 0}, + {"MS_RDONLY", Const, 0}, + {"MS_REC", Const, 0}, + {"MS_RELATIME", Const, 0}, + {"MS_REMOUNT", Const, 0}, + {"MS_RMT_MASK", Const, 0}, + {"MS_SHARED", Const, 0}, + {"MS_SILENT", Const, 0}, + {"MS_SLAVE", Const, 0}, + {"MS_STRICTATIME", Const, 0}, + {"MS_SYNC", Const, 0}, + {"MS_SYNCHRONOUS", Const, 0}, + {"MS_UNBINDABLE", Const, 0}, + {"Madvise", Func, 0}, + {"MapViewOfFile", Func, 0}, + {"MaxTokenInfoClass", Const, 0}, + {"Mclpool", Type, 2}, + {"Mclpool.Alive", Field, 2}, + {"Mclpool.Cwm", Field, 2}, + {"Mclpool.Grown", Field, 2}, + {"Mclpool.Hwm", Field, 2}, + {"Mclpool.Lwm", Field, 2}, + {"MibIfRow", Type, 0}, + {"MibIfRow.AdminStatus", Field, 0}, + {"MibIfRow.Descr", Field, 0}, + {"MibIfRow.DescrLen", Field, 0}, + {"MibIfRow.InDiscards", Field, 0}, + {"MibIfRow.InErrors", Field, 0}, + {"MibIfRow.InNUcastPkts", Field, 0}, + {"MibIfRow.InOctets", Field, 0}, + {"MibIfRow.InUcastPkts", Field, 0}, + {"MibIfRow.InUnknownProtos", Field, 0}, + {"MibIfRow.Index", Field, 0}, + {"MibIfRow.LastChange", Field, 0}, + {"MibIfRow.Mtu", Field, 0}, + {"MibIfRow.Name", Field, 0}, + {"MibIfRow.OperStatus", Field, 0}, + {"MibIfRow.OutDiscards", Field, 0}, + {"MibIfRow.OutErrors", Field, 0}, + {"MibIfRow.OutNUcastPkts", Field, 0}, + {"MibIfRow.OutOctets", Field, 0}, + {"MibIfRow.OutQLen", Field, 0}, + {"MibIfRow.OutUcastPkts", Field, 0}, + {"MibIfRow.PhysAddr", Field, 0}, + {"MibIfRow.PhysAddrLen", Field, 0}, + {"MibIfRow.Speed", Field, 0}, + {"MibIfRow.Type", Field, 0}, + {"Mkdir", Func, 0}, + {"Mkdirat", Func, 0}, + {"Mkfifo", Func, 0}, + {"Mknod", Func, 0}, + {"Mknodat", Func, 0}, + {"Mlock", Func, 0}, + {"Mlockall", Func, 0}, + {"Mmap", Func, 0}, + {"Mount", Func, 0}, + {"MoveFile", Func, 0}, + {"Mprotect", Func, 0}, + {"Msghdr", Type, 0}, + {"Msghdr.Control", Field, 0}, + {"Msghdr.Controllen", Field, 0}, + {"Msghdr.Flags", Field, 0}, + {"Msghdr.Iov", Field, 0}, + {"Msghdr.Iovlen", Field, 0}, + {"Msghdr.Name", Field, 0}, + {"Msghdr.Namelen", Field, 0}, + {"Msghdr.Pad_cgo_0", Field, 0}, + {"Msghdr.Pad_cgo_1", Field, 0}, + {"Munlock", Func, 0}, + {"Munlockall", Func, 0}, + {"Munmap", Func, 0}, + {"MustLoadDLL", Func, 0}, + {"NAME_MAX", Const, 0}, + {"NETLINK_ADD_MEMBERSHIP", Const, 0}, + {"NETLINK_AUDIT", Const, 0}, + {"NETLINK_BROADCAST_ERROR", Const, 0}, + {"NETLINK_CONNECTOR", Const, 0}, + {"NETLINK_DNRTMSG", Const, 0}, + {"NETLINK_DROP_MEMBERSHIP", Const, 0}, + {"NETLINK_ECRYPTFS", Const, 0}, + {"NETLINK_FIB_LOOKUP", Const, 0}, + {"NETLINK_FIREWALL", Const, 0}, + {"NETLINK_GENERIC", Const, 0}, + {"NETLINK_INET_DIAG", Const, 0}, + {"NETLINK_IP6_FW", Const, 0}, + {"NETLINK_ISCSI", Const, 0}, + {"NETLINK_KOBJECT_UEVENT", Const, 0}, + {"NETLINK_NETFILTER", Const, 0}, + {"NETLINK_NFLOG", Const, 0}, + {"NETLINK_NO_ENOBUFS", Const, 0}, + {"NETLINK_PKTINFO", Const, 0}, + {"NETLINK_RDMA", Const, 0}, + {"NETLINK_ROUTE", Const, 0}, + {"NETLINK_SCSITRANSPORT", Const, 0}, + {"NETLINK_SELINUX", Const, 0}, + {"NETLINK_UNUSED", Const, 0}, + {"NETLINK_USERSOCK", Const, 0}, + {"NETLINK_XFRM", Const, 0}, + {"NET_RT_DUMP", Const, 0}, + {"NET_RT_DUMP2", Const, 0}, + {"NET_RT_FLAGS", Const, 0}, + {"NET_RT_IFLIST", Const, 0}, + {"NET_RT_IFLIST2", Const, 0}, + {"NET_RT_IFLISTL", Const, 1}, + {"NET_RT_IFMALIST", Const, 0}, + {"NET_RT_MAXID", Const, 0}, + {"NET_RT_OIFLIST", Const, 1}, + {"NET_RT_OOIFLIST", Const, 1}, + {"NET_RT_STAT", Const, 0}, + {"NET_RT_STATS", Const, 1}, + {"NET_RT_TABLE", Const, 1}, + {"NET_RT_TRASH", Const, 0}, + {"NLA_ALIGNTO", Const, 0}, + {"NLA_F_NESTED", Const, 0}, + {"NLA_F_NET_BYTEORDER", Const, 0}, + {"NLA_HDRLEN", Const, 0}, + {"NLMSG_ALIGNTO", Const, 0}, + {"NLMSG_DONE", Const, 0}, + {"NLMSG_ERROR", Const, 0}, + {"NLMSG_HDRLEN", Const, 0}, + {"NLMSG_MIN_TYPE", Const, 0}, + {"NLMSG_NOOP", Const, 0}, + {"NLMSG_OVERRUN", Const, 0}, + {"NLM_F_ACK", Const, 0}, + {"NLM_F_APPEND", Const, 0}, + {"NLM_F_ATOMIC", Const, 0}, + {"NLM_F_CREATE", Const, 0}, + {"NLM_F_DUMP", Const, 0}, + {"NLM_F_ECHO", Const, 0}, + {"NLM_F_EXCL", Const, 0}, + {"NLM_F_MATCH", Const, 0}, + {"NLM_F_MULTI", Const, 0}, + {"NLM_F_REPLACE", Const, 0}, + {"NLM_F_REQUEST", Const, 0}, + {"NLM_F_ROOT", Const, 0}, + {"NOFLSH", Const, 0}, + {"NOTE_ABSOLUTE", Const, 0}, + {"NOTE_ATTRIB", Const, 0}, + {"NOTE_BACKGROUND", Const, 16}, + {"NOTE_CHILD", Const, 0}, + {"NOTE_CRITICAL", Const, 16}, + {"NOTE_DELETE", Const, 0}, + {"NOTE_EOF", Const, 1}, + {"NOTE_EXEC", Const, 0}, + {"NOTE_EXIT", Const, 0}, + {"NOTE_EXITSTATUS", Const, 0}, + {"NOTE_EXIT_CSERROR", Const, 16}, + {"NOTE_EXIT_DECRYPTFAIL", Const, 16}, + {"NOTE_EXIT_DETAIL", Const, 16}, + {"NOTE_EXIT_DETAIL_MASK", Const, 16}, + {"NOTE_EXIT_MEMORY", Const, 16}, + {"NOTE_EXIT_REPARENTED", Const, 16}, + {"NOTE_EXTEND", Const, 0}, + {"NOTE_FFAND", Const, 0}, + {"NOTE_FFCOPY", Const, 0}, + {"NOTE_FFCTRLMASK", Const, 0}, + {"NOTE_FFLAGSMASK", Const, 0}, + {"NOTE_FFNOP", Const, 0}, + {"NOTE_FFOR", Const, 0}, + {"NOTE_FORK", Const, 0}, + {"NOTE_LEEWAY", Const, 16}, + {"NOTE_LINK", Const, 0}, + {"NOTE_LOWAT", Const, 0}, + {"NOTE_NONE", Const, 0}, + {"NOTE_NSECONDS", Const, 0}, + {"NOTE_PCTRLMASK", Const, 0}, + {"NOTE_PDATAMASK", Const, 0}, + {"NOTE_REAP", Const, 0}, + {"NOTE_RENAME", Const, 0}, + {"NOTE_RESOURCEEND", Const, 0}, + {"NOTE_REVOKE", Const, 0}, + {"NOTE_SECONDS", Const, 0}, + {"NOTE_SIGNAL", Const, 0}, + {"NOTE_TRACK", Const, 0}, + {"NOTE_TRACKERR", Const, 0}, + {"NOTE_TRIGGER", Const, 0}, + {"NOTE_TRUNCATE", Const, 1}, + {"NOTE_USECONDS", Const, 0}, + {"NOTE_VM_ERROR", Const, 0}, + {"NOTE_VM_PRESSURE", Const, 0}, + {"NOTE_VM_PRESSURE_SUDDEN_TERMINATE", Const, 0}, + {"NOTE_VM_PRESSURE_TERMINATE", Const, 0}, + {"NOTE_WRITE", Const, 0}, + {"NameCanonical", Const, 0}, + {"NameCanonicalEx", Const, 0}, + {"NameDisplay", Const, 0}, + {"NameDnsDomain", Const, 0}, + {"NameFullyQualifiedDN", Const, 0}, + {"NameSamCompatible", Const, 0}, + {"NameServicePrincipal", Const, 0}, + {"NameUniqueId", Const, 0}, + {"NameUnknown", Const, 0}, + {"NameUserPrincipal", Const, 0}, + {"Nanosleep", Func, 0}, + {"NetApiBufferFree", Func, 0}, + {"NetGetJoinInformation", Func, 2}, + {"NetSetupDomainName", Const, 2}, + {"NetSetupUnjoined", Const, 2}, + {"NetSetupUnknownStatus", Const, 2}, + {"NetSetupWorkgroupName", Const, 2}, + {"NetUserGetInfo", Func, 0}, + {"NetlinkMessage", Type, 0}, + {"NetlinkMessage.Data", Field, 0}, + {"NetlinkMessage.Header", Field, 0}, + {"NetlinkRIB", Func, 0}, + {"NetlinkRouteAttr", Type, 0}, + {"NetlinkRouteAttr.Attr", Field, 0}, + {"NetlinkRouteAttr.Value", Field, 0}, + {"NetlinkRouteRequest", Type, 0}, + {"NetlinkRouteRequest.Data", Field, 0}, + {"NetlinkRouteRequest.Header", Field, 0}, + {"NewCallback", Func, 0}, + {"NewCallbackCDecl", Func, 3}, + {"NewLazyDLL", Func, 0}, + {"NlAttr", Type, 0}, + {"NlAttr.Len", Field, 0}, + {"NlAttr.Type", Field, 0}, + {"NlMsgerr", Type, 0}, + {"NlMsgerr.Error", Field, 0}, + {"NlMsgerr.Msg", Field, 0}, + {"NlMsghdr", Type, 0}, + {"NlMsghdr.Flags", Field, 0}, + {"NlMsghdr.Len", Field, 0}, + {"NlMsghdr.Pid", Field, 0}, + {"NlMsghdr.Seq", Field, 0}, + {"NlMsghdr.Type", Field, 0}, + {"NsecToFiletime", Func, 0}, + {"NsecToTimespec", Func, 0}, + {"NsecToTimeval", Func, 0}, + {"Ntohs", Func, 0}, + {"OCRNL", Const, 0}, + {"OFDEL", Const, 0}, + {"OFILL", Const, 0}, + {"OFIOGETBMAP", Const, 1}, + {"OID_PKIX_KP_SERVER_AUTH", Var, 0}, + {"OID_SERVER_GATED_CRYPTO", Var, 0}, + {"OID_SGC_NETSCAPE", Var, 0}, + {"OLCUC", Const, 0}, + {"ONLCR", Const, 0}, + {"ONLRET", Const, 0}, + {"ONOCR", Const, 0}, + {"ONOEOT", Const, 1}, + {"OPEN_ALWAYS", Const, 0}, + {"OPEN_EXISTING", Const, 0}, + {"OPOST", Const, 0}, + {"O_ACCMODE", Const, 0}, + {"O_ALERT", Const, 0}, + {"O_ALT_IO", Const, 1}, + {"O_APPEND", Const, 0}, + {"O_ASYNC", Const, 0}, + {"O_CLOEXEC", Const, 0}, + {"O_CREAT", Const, 0}, + {"O_DIRECT", Const, 0}, + {"O_DIRECTORY", Const, 0}, + {"O_DP_GETRAWENCRYPTED", Const, 16}, + {"O_DSYNC", Const, 0}, + {"O_EVTONLY", Const, 0}, + {"O_EXCL", Const, 0}, + {"O_EXEC", Const, 0}, + {"O_EXLOCK", Const, 0}, + {"O_FSYNC", Const, 0}, + {"O_LARGEFILE", Const, 0}, + {"O_NDELAY", Const, 0}, + {"O_NOATIME", Const, 0}, + {"O_NOCTTY", Const, 0}, + {"O_NOFOLLOW", Const, 0}, + {"O_NONBLOCK", Const, 0}, + {"O_NOSIGPIPE", Const, 1}, + {"O_POPUP", Const, 0}, + {"O_RDONLY", Const, 0}, + {"O_RDWR", Const, 0}, + {"O_RSYNC", Const, 0}, + {"O_SHLOCK", Const, 0}, + {"O_SYMLINK", Const, 0}, + {"O_SYNC", Const, 0}, + {"O_TRUNC", Const, 0}, + {"O_TTY_INIT", Const, 0}, + {"O_WRONLY", Const, 0}, + {"Open", Func, 0}, + {"OpenCurrentProcessToken", Func, 0}, + {"OpenProcess", Func, 0}, + {"OpenProcessToken", Func, 0}, + {"Openat", Func, 0}, + {"Overlapped", Type, 0}, + {"Overlapped.HEvent", Field, 0}, + {"Overlapped.Internal", Field, 0}, + {"Overlapped.InternalHigh", Field, 0}, + {"Overlapped.Offset", Field, 0}, + {"Overlapped.OffsetHigh", Field, 0}, + {"PACKET_ADD_MEMBERSHIP", Const, 0}, + {"PACKET_BROADCAST", Const, 0}, + {"PACKET_DROP_MEMBERSHIP", Const, 0}, + {"PACKET_FASTROUTE", Const, 0}, + {"PACKET_HOST", Const, 0}, + {"PACKET_LOOPBACK", Const, 0}, + {"PACKET_MR_ALLMULTI", Const, 0}, + {"PACKET_MR_MULTICAST", Const, 0}, + {"PACKET_MR_PROMISC", Const, 0}, + {"PACKET_MULTICAST", Const, 0}, + {"PACKET_OTHERHOST", Const, 0}, + {"PACKET_OUTGOING", Const, 0}, + {"PACKET_RECV_OUTPUT", Const, 0}, + {"PACKET_RX_RING", Const, 0}, + {"PACKET_STATISTICS", Const, 0}, + {"PAGE_EXECUTE_READ", Const, 0}, + {"PAGE_EXECUTE_READWRITE", Const, 0}, + {"PAGE_EXECUTE_WRITECOPY", Const, 0}, + {"PAGE_READONLY", Const, 0}, + {"PAGE_READWRITE", Const, 0}, + {"PAGE_WRITECOPY", Const, 0}, + {"PARENB", Const, 0}, + {"PARMRK", Const, 0}, + {"PARODD", Const, 0}, + {"PENDIN", Const, 0}, + {"PFL_HIDDEN", Const, 2}, + {"PFL_MATCHES_PROTOCOL_ZERO", Const, 2}, + {"PFL_MULTIPLE_PROTO_ENTRIES", Const, 2}, + {"PFL_NETWORKDIRECT_PROVIDER", Const, 2}, + {"PFL_RECOMMENDED_PROTO_ENTRY", Const, 2}, + {"PF_FLUSH", Const, 1}, + {"PKCS_7_ASN_ENCODING", Const, 0}, + {"PMC5_PIPELINE_FLUSH", Const, 1}, + {"PRIO_PGRP", Const, 2}, + {"PRIO_PROCESS", Const, 2}, + {"PRIO_USER", Const, 2}, + {"PRI_IOFLUSH", Const, 1}, + {"PROCESS_QUERY_INFORMATION", Const, 0}, + {"PROCESS_TERMINATE", Const, 2}, + {"PROT_EXEC", Const, 0}, + {"PROT_GROWSDOWN", Const, 0}, + {"PROT_GROWSUP", Const, 0}, + {"PROT_NONE", Const, 0}, + {"PROT_READ", Const, 0}, + {"PROT_WRITE", Const, 0}, + {"PROV_DH_SCHANNEL", Const, 0}, + {"PROV_DSS", Const, 0}, + {"PROV_DSS_DH", Const, 0}, + {"PROV_EC_ECDSA_FULL", Const, 0}, + {"PROV_EC_ECDSA_SIG", Const, 0}, + {"PROV_EC_ECNRA_FULL", Const, 0}, + {"PROV_EC_ECNRA_SIG", Const, 0}, + {"PROV_FORTEZZA", Const, 0}, + {"PROV_INTEL_SEC", Const, 0}, + {"PROV_MS_EXCHANGE", Const, 0}, + {"PROV_REPLACE_OWF", Const, 0}, + {"PROV_RNG", Const, 0}, + {"PROV_RSA_AES", Const, 0}, + {"PROV_RSA_FULL", Const, 0}, + {"PROV_RSA_SCHANNEL", Const, 0}, + {"PROV_RSA_SIG", Const, 0}, + {"PROV_SPYRUS_LYNKS", Const, 0}, + {"PROV_SSL", Const, 0}, + {"PR_CAPBSET_DROP", Const, 0}, + {"PR_CAPBSET_READ", Const, 0}, + {"PR_CLEAR_SECCOMP_FILTER", Const, 0}, + {"PR_ENDIAN_BIG", Const, 0}, + {"PR_ENDIAN_LITTLE", Const, 0}, + {"PR_ENDIAN_PPC_LITTLE", Const, 0}, + {"PR_FPEMU_NOPRINT", Const, 0}, + {"PR_FPEMU_SIGFPE", Const, 0}, + {"PR_FP_EXC_ASYNC", Const, 0}, + {"PR_FP_EXC_DISABLED", Const, 0}, + {"PR_FP_EXC_DIV", Const, 0}, + {"PR_FP_EXC_INV", Const, 0}, + {"PR_FP_EXC_NONRECOV", Const, 0}, + {"PR_FP_EXC_OVF", Const, 0}, + {"PR_FP_EXC_PRECISE", Const, 0}, + {"PR_FP_EXC_RES", Const, 0}, + {"PR_FP_EXC_SW_ENABLE", Const, 0}, + {"PR_FP_EXC_UND", Const, 0}, + {"PR_GET_DUMPABLE", Const, 0}, + {"PR_GET_ENDIAN", Const, 0}, + {"PR_GET_FPEMU", Const, 0}, + {"PR_GET_FPEXC", Const, 0}, + {"PR_GET_KEEPCAPS", Const, 0}, + {"PR_GET_NAME", Const, 0}, + {"PR_GET_PDEATHSIG", Const, 0}, + {"PR_GET_SECCOMP", Const, 0}, + {"PR_GET_SECCOMP_FILTER", Const, 0}, + {"PR_GET_SECUREBITS", Const, 0}, + {"PR_GET_TIMERSLACK", Const, 0}, + {"PR_GET_TIMING", Const, 0}, + {"PR_GET_TSC", Const, 0}, + {"PR_GET_UNALIGN", Const, 0}, + {"PR_MCE_KILL", Const, 0}, + {"PR_MCE_KILL_CLEAR", Const, 0}, + {"PR_MCE_KILL_DEFAULT", Const, 0}, + {"PR_MCE_KILL_EARLY", Const, 0}, + {"PR_MCE_KILL_GET", Const, 0}, + {"PR_MCE_KILL_LATE", Const, 0}, + {"PR_MCE_KILL_SET", Const, 0}, + {"PR_SECCOMP_FILTER_EVENT", Const, 0}, + {"PR_SECCOMP_FILTER_SYSCALL", Const, 0}, + {"PR_SET_DUMPABLE", Const, 0}, + {"PR_SET_ENDIAN", Const, 0}, + {"PR_SET_FPEMU", Const, 0}, + {"PR_SET_FPEXC", Const, 0}, + {"PR_SET_KEEPCAPS", Const, 0}, + {"PR_SET_NAME", Const, 0}, + {"PR_SET_PDEATHSIG", Const, 0}, + {"PR_SET_PTRACER", Const, 0}, + {"PR_SET_SECCOMP", Const, 0}, + {"PR_SET_SECCOMP_FILTER", Const, 0}, + {"PR_SET_SECUREBITS", Const, 0}, + {"PR_SET_TIMERSLACK", Const, 0}, + {"PR_SET_TIMING", Const, 0}, + {"PR_SET_TSC", Const, 0}, + {"PR_SET_UNALIGN", Const, 0}, + {"PR_TASK_PERF_EVENTS_DISABLE", Const, 0}, + {"PR_TASK_PERF_EVENTS_ENABLE", Const, 0}, + {"PR_TIMING_STATISTICAL", Const, 0}, + {"PR_TIMING_TIMESTAMP", Const, 0}, + {"PR_TSC_ENABLE", Const, 0}, + {"PR_TSC_SIGSEGV", Const, 0}, + {"PR_UNALIGN_NOPRINT", Const, 0}, + {"PR_UNALIGN_SIGBUS", Const, 0}, + {"PTRACE_ARCH_PRCTL", Const, 0}, + {"PTRACE_ATTACH", Const, 0}, + {"PTRACE_CONT", Const, 0}, + {"PTRACE_DETACH", Const, 0}, + {"PTRACE_EVENT_CLONE", Const, 0}, + {"PTRACE_EVENT_EXEC", Const, 0}, + {"PTRACE_EVENT_EXIT", Const, 0}, + {"PTRACE_EVENT_FORK", Const, 0}, + {"PTRACE_EVENT_VFORK", Const, 0}, + {"PTRACE_EVENT_VFORK_DONE", Const, 0}, + {"PTRACE_GETCRUNCHREGS", Const, 0}, + {"PTRACE_GETEVENTMSG", Const, 0}, + {"PTRACE_GETFPREGS", Const, 0}, + {"PTRACE_GETFPXREGS", Const, 0}, + {"PTRACE_GETHBPREGS", Const, 0}, + {"PTRACE_GETREGS", Const, 0}, + {"PTRACE_GETREGSET", Const, 0}, + {"PTRACE_GETSIGINFO", Const, 0}, + {"PTRACE_GETVFPREGS", Const, 0}, + {"PTRACE_GETWMMXREGS", Const, 0}, + {"PTRACE_GET_THREAD_AREA", Const, 0}, + {"PTRACE_KILL", Const, 0}, + {"PTRACE_OLDSETOPTIONS", Const, 0}, + {"PTRACE_O_MASK", Const, 0}, + {"PTRACE_O_TRACECLONE", Const, 0}, + {"PTRACE_O_TRACEEXEC", Const, 0}, + {"PTRACE_O_TRACEEXIT", Const, 0}, + {"PTRACE_O_TRACEFORK", Const, 0}, + {"PTRACE_O_TRACESYSGOOD", Const, 0}, + {"PTRACE_O_TRACEVFORK", Const, 0}, + {"PTRACE_O_TRACEVFORKDONE", Const, 0}, + {"PTRACE_PEEKDATA", Const, 0}, + {"PTRACE_PEEKTEXT", Const, 0}, + {"PTRACE_PEEKUSR", Const, 0}, + {"PTRACE_POKEDATA", Const, 0}, + {"PTRACE_POKETEXT", Const, 0}, + {"PTRACE_POKEUSR", Const, 0}, + {"PTRACE_SETCRUNCHREGS", Const, 0}, + {"PTRACE_SETFPREGS", Const, 0}, + {"PTRACE_SETFPXREGS", Const, 0}, + {"PTRACE_SETHBPREGS", Const, 0}, + {"PTRACE_SETOPTIONS", Const, 0}, + {"PTRACE_SETREGS", Const, 0}, + {"PTRACE_SETREGSET", Const, 0}, + {"PTRACE_SETSIGINFO", Const, 0}, + {"PTRACE_SETVFPREGS", Const, 0}, + {"PTRACE_SETWMMXREGS", Const, 0}, + {"PTRACE_SET_SYSCALL", Const, 0}, + {"PTRACE_SET_THREAD_AREA", Const, 0}, + {"PTRACE_SINGLEBLOCK", Const, 0}, + {"PTRACE_SINGLESTEP", Const, 0}, + {"PTRACE_SYSCALL", Const, 0}, + {"PTRACE_SYSEMU", Const, 0}, + {"PTRACE_SYSEMU_SINGLESTEP", Const, 0}, + {"PTRACE_TRACEME", Const, 0}, + {"PT_ATTACH", Const, 0}, + {"PT_ATTACHEXC", Const, 0}, + {"PT_CONTINUE", Const, 0}, + {"PT_DATA_ADDR", Const, 0}, + {"PT_DENY_ATTACH", Const, 0}, + {"PT_DETACH", Const, 0}, + {"PT_FIRSTMACH", Const, 0}, + {"PT_FORCEQUOTA", Const, 0}, + {"PT_KILL", Const, 0}, + {"PT_MASK", Const, 1}, + {"PT_READ_D", Const, 0}, + {"PT_READ_I", Const, 0}, + {"PT_READ_U", Const, 0}, + {"PT_SIGEXC", Const, 0}, + {"PT_STEP", Const, 0}, + {"PT_TEXT_ADDR", Const, 0}, + {"PT_TEXT_END_ADDR", Const, 0}, + {"PT_THUPDATE", Const, 0}, + {"PT_TRACE_ME", Const, 0}, + {"PT_WRITE_D", Const, 0}, + {"PT_WRITE_I", Const, 0}, + {"PT_WRITE_U", Const, 0}, + {"ParseDirent", Func, 0}, + {"ParseNetlinkMessage", Func, 0}, + {"ParseNetlinkRouteAttr", Func, 0}, + {"ParseRoutingMessage", Func, 0}, + {"ParseRoutingSockaddr", Func, 0}, + {"ParseSocketControlMessage", Func, 0}, + {"ParseUnixCredentials", Func, 0}, + {"ParseUnixRights", Func, 0}, + {"PathMax", Const, 0}, + {"Pathconf", Func, 0}, + {"Pause", Func, 0}, + {"Pipe", Func, 0}, + {"Pipe2", Func, 1}, + {"PivotRoot", Func, 0}, + {"Pointer", Type, 11}, + {"PostQueuedCompletionStatus", Func, 0}, + {"Pread", Func, 0}, + {"Proc", Type, 0}, + {"Proc.Dll", Field, 0}, + {"Proc.Name", Field, 0}, + {"ProcAttr", Type, 0}, + {"ProcAttr.Dir", Field, 0}, + {"ProcAttr.Env", Field, 0}, + {"ProcAttr.Files", Field, 0}, + {"ProcAttr.Sys", Field, 0}, + {"Process32First", Func, 4}, + {"Process32Next", Func, 4}, + {"ProcessEntry32", Type, 4}, + {"ProcessEntry32.DefaultHeapID", Field, 4}, + {"ProcessEntry32.ExeFile", Field, 4}, + {"ProcessEntry32.Flags", Field, 4}, + {"ProcessEntry32.ModuleID", Field, 4}, + {"ProcessEntry32.ParentProcessID", Field, 4}, + {"ProcessEntry32.PriClassBase", Field, 4}, + {"ProcessEntry32.ProcessID", Field, 4}, + {"ProcessEntry32.Size", Field, 4}, + {"ProcessEntry32.Threads", Field, 4}, + {"ProcessEntry32.Usage", Field, 4}, + {"ProcessInformation", Type, 0}, + {"ProcessInformation.Process", Field, 0}, + {"ProcessInformation.ProcessId", Field, 0}, + {"ProcessInformation.Thread", Field, 0}, + {"ProcessInformation.ThreadId", Field, 0}, + {"Protoent", Type, 0}, + {"Protoent.Aliases", Field, 0}, + {"Protoent.Name", Field, 0}, + {"Protoent.Proto", Field, 0}, + {"PtraceAttach", Func, 0}, + {"PtraceCont", Func, 0}, + {"PtraceDetach", Func, 0}, + {"PtraceGetEventMsg", Func, 0}, + {"PtraceGetRegs", Func, 0}, + {"PtracePeekData", Func, 0}, + {"PtracePeekText", Func, 0}, + {"PtracePokeData", Func, 0}, + {"PtracePokeText", Func, 0}, + {"PtraceRegs", Type, 0}, + {"PtraceRegs.Cs", Field, 0}, + {"PtraceRegs.Ds", Field, 0}, + {"PtraceRegs.Eax", Field, 0}, + {"PtraceRegs.Ebp", Field, 0}, + {"PtraceRegs.Ebx", Field, 0}, + {"PtraceRegs.Ecx", Field, 0}, + {"PtraceRegs.Edi", Field, 0}, + {"PtraceRegs.Edx", Field, 0}, + {"PtraceRegs.Eflags", Field, 0}, + {"PtraceRegs.Eip", Field, 0}, + {"PtraceRegs.Es", Field, 0}, + {"PtraceRegs.Esi", Field, 0}, + {"PtraceRegs.Esp", Field, 0}, + {"PtraceRegs.Fs", Field, 0}, + {"PtraceRegs.Fs_base", Field, 0}, + {"PtraceRegs.Gs", Field, 0}, + {"PtraceRegs.Gs_base", Field, 0}, + {"PtraceRegs.Orig_eax", Field, 0}, + {"PtraceRegs.Orig_rax", Field, 0}, + {"PtraceRegs.R10", Field, 0}, + {"PtraceRegs.R11", Field, 0}, + {"PtraceRegs.R12", Field, 0}, + {"PtraceRegs.R13", Field, 0}, + {"PtraceRegs.R14", Field, 0}, + {"PtraceRegs.R15", Field, 0}, + {"PtraceRegs.R8", Field, 0}, + {"PtraceRegs.R9", Field, 0}, + {"PtraceRegs.Rax", Field, 0}, + {"PtraceRegs.Rbp", Field, 0}, + {"PtraceRegs.Rbx", Field, 0}, + {"PtraceRegs.Rcx", Field, 0}, + {"PtraceRegs.Rdi", Field, 0}, + {"PtraceRegs.Rdx", Field, 0}, + {"PtraceRegs.Rip", Field, 0}, + {"PtraceRegs.Rsi", Field, 0}, + {"PtraceRegs.Rsp", Field, 0}, + {"PtraceRegs.Ss", Field, 0}, + {"PtraceRegs.Uregs", Field, 0}, + {"PtraceRegs.Xcs", Field, 0}, + {"PtraceRegs.Xds", Field, 0}, + {"PtraceRegs.Xes", Field, 0}, + {"PtraceRegs.Xfs", Field, 0}, + {"PtraceRegs.Xgs", Field, 0}, + {"PtraceRegs.Xss", Field, 0}, + {"PtraceSetOptions", Func, 0}, + {"PtraceSetRegs", Func, 0}, + {"PtraceSingleStep", Func, 0}, + {"PtraceSyscall", Func, 1}, + {"Pwrite", Func, 0}, + {"REG_BINARY", Const, 0}, + {"REG_DWORD", Const, 0}, + {"REG_DWORD_BIG_ENDIAN", Const, 0}, + {"REG_DWORD_LITTLE_ENDIAN", Const, 0}, + {"REG_EXPAND_SZ", Const, 0}, + {"REG_FULL_RESOURCE_DESCRIPTOR", Const, 0}, + {"REG_LINK", Const, 0}, + {"REG_MULTI_SZ", Const, 0}, + {"REG_NONE", Const, 0}, + {"REG_QWORD", Const, 0}, + {"REG_QWORD_LITTLE_ENDIAN", Const, 0}, + {"REG_RESOURCE_LIST", Const, 0}, + {"REG_RESOURCE_REQUIREMENTS_LIST", Const, 0}, + {"REG_SZ", Const, 0}, + {"RLIMIT_AS", Const, 0}, + {"RLIMIT_CORE", Const, 0}, + {"RLIMIT_CPU", Const, 0}, + {"RLIMIT_CPU_USAGE_MONITOR", Const, 16}, + {"RLIMIT_DATA", Const, 0}, + {"RLIMIT_FSIZE", Const, 0}, + {"RLIMIT_NOFILE", Const, 0}, + {"RLIMIT_STACK", Const, 0}, + {"RLIM_INFINITY", Const, 0}, + {"RTAX_ADVMSS", Const, 0}, + {"RTAX_AUTHOR", Const, 0}, + {"RTAX_BRD", Const, 0}, + {"RTAX_CWND", Const, 0}, + {"RTAX_DST", Const, 0}, + {"RTAX_FEATURES", Const, 0}, + {"RTAX_FEATURE_ALLFRAG", Const, 0}, + {"RTAX_FEATURE_ECN", Const, 0}, + {"RTAX_FEATURE_SACK", Const, 0}, + {"RTAX_FEATURE_TIMESTAMP", Const, 0}, + {"RTAX_GATEWAY", Const, 0}, + {"RTAX_GENMASK", Const, 0}, + {"RTAX_HOPLIMIT", Const, 0}, + {"RTAX_IFA", Const, 0}, + {"RTAX_IFP", Const, 0}, + {"RTAX_INITCWND", Const, 0}, + {"RTAX_INITRWND", Const, 0}, + {"RTAX_LABEL", Const, 1}, + {"RTAX_LOCK", Const, 0}, + {"RTAX_MAX", Const, 0}, + {"RTAX_MTU", Const, 0}, + {"RTAX_NETMASK", Const, 0}, + {"RTAX_REORDERING", Const, 0}, + {"RTAX_RTO_MIN", Const, 0}, + {"RTAX_RTT", Const, 0}, + {"RTAX_RTTVAR", Const, 0}, + {"RTAX_SRC", Const, 1}, + {"RTAX_SRCMASK", Const, 1}, + {"RTAX_SSTHRESH", Const, 0}, + {"RTAX_TAG", Const, 1}, + {"RTAX_UNSPEC", Const, 0}, + {"RTAX_WINDOW", Const, 0}, + {"RTA_ALIGNTO", Const, 0}, + {"RTA_AUTHOR", Const, 0}, + {"RTA_BRD", Const, 0}, + {"RTA_CACHEINFO", Const, 0}, + {"RTA_DST", Const, 0}, + {"RTA_FLOW", Const, 0}, + {"RTA_GATEWAY", Const, 0}, + {"RTA_GENMASK", Const, 0}, + {"RTA_IFA", Const, 0}, + {"RTA_IFP", Const, 0}, + {"RTA_IIF", Const, 0}, + {"RTA_LABEL", Const, 1}, + {"RTA_MAX", Const, 0}, + {"RTA_METRICS", Const, 0}, + {"RTA_MULTIPATH", Const, 0}, + {"RTA_NETMASK", Const, 0}, + {"RTA_OIF", Const, 0}, + {"RTA_PREFSRC", Const, 0}, + {"RTA_PRIORITY", Const, 0}, + {"RTA_SRC", Const, 0}, + {"RTA_SRCMASK", Const, 1}, + {"RTA_TABLE", Const, 0}, + {"RTA_TAG", Const, 1}, + {"RTA_UNSPEC", Const, 0}, + {"RTCF_DIRECTSRC", Const, 0}, + {"RTCF_DOREDIRECT", Const, 0}, + {"RTCF_LOG", Const, 0}, + {"RTCF_MASQ", Const, 0}, + {"RTCF_NAT", Const, 0}, + {"RTCF_VALVE", Const, 0}, + {"RTF_ADDRCLASSMASK", Const, 0}, + {"RTF_ADDRCONF", Const, 0}, + {"RTF_ALLONLINK", Const, 0}, + {"RTF_ANNOUNCE", Const, 1}, + {"RTF_BLACKHOLE", Const, 0}, + {"RTF_BROADCAST", Const, 0}, + {"RTF_CACHE", Const, 0}, + {"RTF_CLONED", Const, 1}, + {"RTF_CLONING", Const, 0}, + {"RTF_CONDEMNED", Const, 0}, + {"RTF_DEFAULT", Const, 0}, + {"RTF_DELCLONE", Const, 0}, + {"RTF_DONE", Const, 0}, + {"RTF_DYNAMIC", Const, 0}, + {"RTF_FLOW", Const, 0}, + {"RTF_FMASK", Const, 0}, + {"RTF_GATEWAY", Const, 0}, + {"RTF_GWFLAG_COMPAT", Const, 3}, + {"RTF_HOST", Const, 0}, + {"RTF_IFREF", Const, 0}, + {"RTF_IFSCOPE", Const, 0}, + {"RTF_INTERFACE", Const, 0}, + {"RTF_IRTT", Const, 0}, + {"RTF_LINKRT", Const, 0}, + {"RTF_LLDATA", Const, 0}, + {"RTF_LLINFO", Const, 0}, + {"RTF_LOCAL", Const, 0}, + {"RTF_MASK", Const, 1}, + {"RTF_MODIFIED", Const, 0}, + {"RTF_MPATH", Const, 1}, + {"RTF_MPLS", Const, 1}, + {"RTF_MSS", Const, 0}, + {"RTF_MTU", Const, 0}, + {"RTF_MULTICAST", Const, 0}, + {"RTF_NAT", Const, 0}, + {"RTF_NOFORWARD", Const, 0}, + {"RTF_NONEXTHOP", Const, 0}, + {"RTF_NOPMTUDISC", Const, 0}, + {"RTF_PERMANENT_ARP", Const, 1}, + {"RTF_PINNED", Const, 0}, + {"RTF_POLICY", Const, 0}, + {"RTF_PRCLONING", Const, 0}, + {"RTF_PROTO1", Const, 0}, + {"RTF_PROTO2", Const, 0}, + {"RTF_PROTO3", Const, 0}, + {"RTF_PROXY", Const, 16}, + {"RTF_REINSTATE", Const, 0}, + {"RTF_REJECT", Const, 0}, + {"RTF_RNH_LOCKED", Const, 0}, + {"RTF_ROUTER", Const, 16}, + {"RTF_SOURCE", Const, 1}, + {"RTF_SRC", Const, 1}, + {"RTF_STATIC", Const, 0}, + {"RTF_STICKY", Const, 0}, + {"RTF_THROW", Const, 0}, + {"RTF_TUNNEL", Const, 1}, + {"RTF_UP", Const, 0}, + {"RTF_USETRAILERS", Const, 1}, + {"RTF_WASCLONED", Const, 0}, + {"RTF_WINDOW", Const, 0}, + {"RTF_XRESOLVE", Const, 0}, + {"RTM_ADD", Const, 0}, + {"RTM_BASE", Const, 0}, + {"RTM_CHANGE", Const, 0}, + {"RTM_CHGADDR", Const, 1}, + {"RTM_DELACTION", Const, 0}, + {"RTM_DELADDR", Const, 0}, + {"RTM_DELADDRLABEL", Const, 0}, + {"RTM_DELETE", Const, 0}, + {"RTM_DELLINK", Const, 0}, + {"RTM_DELMADDR", Const, 0}, + {"RTM_DELNEIGH", Const, 0}, + {"RTM_DELQDISC", Const, 0}, + {"RTM_DELROUTE", Const, 0}, + {"RTM_DELRULE", Const, 0}, + {"RTM_DELTCLASS", Const, 0}, + {"RTM_DELTFILTER", Const, 0}, + {"RTM_DESYNC", Const, 1}, + {"RTM_F_CLONED", Const, 0}, + {"RTM_F_EQUALIZE", Const, 0}, + {"RTM_F_NOTIFY", Const, 0}, + {"RTM_F_PREFIX", Const, 0}, + {"RTM_GET", Const, 0}, + {"RTM_GET2", Const, 0}, + {"RTM_GETACTION", Const, 0}, + {"RTM_GETADDR", Const, 0}, + {"RTM_GETADDRLABEL", Const, 0}, + {"RTM_GETANYCAST", Const, 0}, + {"RTM_GETDCB", Const, 0}, + {"RTM_GETLINK", Const, 0}, + {"RTM_GETMULTICAST", Const, 0}, + {"RTM_GETNEIGH", Const, 0}, + {"RTM_GETNEIGHTBL", Const, 0}, + {"RTM_GETQDISC", Const, 0}, + {"RTM_GETROUTE", Const, 0}, + {"RTM_GETRULE", Const, 0}, + {"RTM_GETTCLASS", Const, 0}, + {"RTM_GETTFILTER", Const, 0}, + {"RTM_IEEE80211", Const, 0}, + {"RTM_IFANNOUNCE", Const, 0}, + {"RTM_IFINFO", Const, 0}, + {"RTM_IFINFO2", Const, 0}, + {"RTM_LLINFO_UPD", Const, 1}, + {"RTM_LOCK", Const, 0}, + {"RTM_LOSING", Const, 0}, + {"RTM_MAX", Const, 0}, + {"RTM_MAXSIZE", Const, 1}, + {"RTM_MISS", Const, 0}, + {"RTM_NEWACTION", Const, 0}, + {"RTM_NEWADDR", Const, 0}, + {"RTM_NEWADDRLABEL", Const, 0}, + {"RTM_NEWLINK", Const, 0}, + {"RTM_NEWMADDR", Const, 0}, + {"RTM_NEWMADDR2", Const, 0}, + {"RTM_NEWNDUSEROPT", Const, 0}, + {"RTM_NEWNEIGH", Const, 0}, + {"RTM_NEWNEIGHTBL", Const, 0}, + {"RTM_NEWPREFIX", Const, 0}, + {"RTM_NEWQDISC", Const, 0}, + {"RTM_NEWROUTE", Const, 0}, + {"RTM_NEWRULE", Const, 0}, + {"RTM_NEWTCLASS", Const, 0}, + {"RTM_NEWTFILTER", Const, 0}, + {"RTM_NR_FAMILIES", Const, 0}, + {"RTM_NR_MSGTYPES", Const, 0}, + {"RTM_OIFINFO", Const, 1}, + {"RTM_OLDADD", Const, 0}, + {"RTM_OLDDEL", Const, 0}, + {"RTM_OOIFINFO", Const, 1}, + {"RTM_REDIRECT", Const, 0}, + {"RTM_RESOLVE", Const, 0}, + {"RTM_RTTUNIT", Const, 0}, + {"RTM_SETDCB", Const, 0}, + {"RTM_SETGATE", Const, 1}, + {"RTM_SETLINK", Const, 0}, + {"RTM_SETNEIGHTBL", Const, 0}, + {"RTM_VERSION", Const, 0}, + {"RTNH_ALIGNTO", Const, 0}, + {"RTNH_F_DEAD", Const, 0}, + {"RTNH_F_ONLINK", Const, 0}, + {"RTNH_F_PERVASIVE", Const, 0}, + {"RTNLGRP_IPV4_IFADDR", Const, 1}, + {"RTNLGRP_IPV4_MROUTE", Const, 1}, + {"RTNLGRP_IPV4_ROUTE", Const, 1}, + {"RTNLGRP_IPV4_RULE", Const, 1}, + {"RTNLGRP_IPV6_IFADDR", Const, 1}, + {"RTNLGRP_IPV6_IFINFO", Const, 1}, + {"RTNLGRP_IPV6_MROUTE", Const, 1}, + {"RTNLGRP_IPV6_PREFIX", Const, 1}, + {"RTNLGRP_IPV6_ROUTE", Const, 1}, + {"RTNLGRP_IPV6_RULE", Const, 1}, + {"RTNLGRP_LINK", Const, 1}, + {"RTNLGRP_ND_USEROPT", Const, 1}, + {"RTNLGRP_NEIGH", Const, 1}, + {"RTNLGRP_NONE", Const, 1}, + {"RTNLGRP_NOTIFY", Const, 1}, + {"RTNLGRP_TC", Const, 1}, + {"RTN_ANYCAST", Const, 0}, + {"RTN_BLACKHOLE", Const, 0}, + {"RTN_BROADCAST", Const, 0}, + {"RTN_LOCAL", Const, 0}, + {"RTN_MAX", Const, 0}, + {"RTN_MULTICAST", Const, 0}, + {"RTN_NAT", Const, 0}, + {"RTN_PROHIBIT", Const, 0}, + {"RTN_THROW", Const, 0}, + {"RTN_UNICAST", Const, 0}, + {"RTN_UNREACHABLE", Const, 0}, + {"RTN_UNSPEC", Const, 0}, + {"RTN_XRESOLVE", Const, 0}, + {"RTPROT_BIRD", Const, 0}, + {"RTPROT_BOOT", Const, 0}, + {"RTPROT_DHCP", Const, 0}, + {"RTPROT_DNROUTED", Const, 0}, + {"RTPROT_GATED", Const, 0}, + {"RTPROT_KERNEL", Const, 0}, + {"RTPROT_MRT", Const, 0}, + {"RTPROT_NTK", Const, 0}, + {"RTPROT_RA", Const, 0}, + {"RTPROT_REDIRECT", Const, 0}, + {"RTPROT_STATIC", Const, 0}, + {"RTPROT_UNSPEC", Const, 0}, + {"RTPROT_XORP", Const, 0}, + {"RTPROT_ZEBRA", Const, 0}, + {"RTV_EXPIRE", Const, 0}, + {"RTV_HOPCOUNT", Const, 0}, + {"RTV_MTU", Const, 0}, + {"RTV_RPIPE", Const, 0}, + {"RTV_RTT", Const, 0}, + {"RTV_RTTVAR", Const, 0}, + {"RTV_SPIPE", Const, 0}, + {"RTV_SSTHRESH", Const, 0}, + {"RTV_WEIGHT", Const, 0}, + {"RT_CACHING_CONTEXT", Const, 1}, + {"RT_CLASS_DEFAULT", Const, 0}, + {"RT_CLASS_LOCAL", Const, 0}, + {"RT_CLASS_MAIN", Const, 0}, + {"RT_CLASS_MAX", Const, 0}, + {"RT_CLASS_UNSPEC", Const, 0}, + {"RT_DEFAULT_FIB", Const, 1}, + {"RT_NORTREF", Const, 1}, + {"RT_SCOPE_HOST", Const, 0}, + {"RT_SCOPE_LINK", Const, 0}, + {"RT_SCOPE_NOWHERE", Const, 0}, + {"RT_SCOPE_SITE", Const, 0}, + {"RT_SCOPE_UNIVERSE", Const, 0}, + {"RT_TABLEID_MAX", Const, 1}, + {"RT_TABLE_COMPAT", Const, 0}, + {"RT_TABLE_DEFAULT", Const, 0}, + {"RT_TABLE_LOCAL", Const, 0}, + {"RT_TABLE_MAIN", Const, 0}, + {"RT_TABLE_MAX", Const, 0}, + {"RT_TABLE_UNSPEC", Const, 0}, + {"RUSAGE_CHILDREN", Const, 0}, + {"RUSAGE_SELF", Const, 0}, + {"RUSAGE_THREAD", Const, 0}, + {"Radvisory_t", Type, 0}, + {"Radvisory_t.Count", Field, 0}, + {"Radvisory_t.Offset", Field, 0}, + {"Radvisory_t.Pad_cgo_0", Field, 0}, + {"RawConn", Type, 9}, + {"RawSockaddr", Type, 0}, + {"RawSockaddr.Data", Field, 0}, + {"RawSockaddr.Family", Field, 0}, + {"RawSockaddr.Len", Field, 0}, + {"RawSockaddrAny", Type, 0}, + {"RawSockaddrAny.Addr", Field, 0}, + {"RawSockaddrAny.Pad", Field, 0}, + {"RawSockaddrDatalink", Type, 0}, + {"RawSockaddrDatalink.Alen", Field, 0}, + {"RawSockaddrDatalink.Data", Field, 0}, + {"RawSockaddrDatalink.Family", Field, 0}, + {"RawSockaddrDatalink.Index", Field, 0}, + {"RawSockaddrDatalink.Len", Field, 0}, + {"RawSockaddrDatalink.Nlen", Field, 0}, + {"RawSockaddrDatalink.Pad_cgo_0", Field, 2}, + {"RawSockaddrDatalink.Slen", Field, 0}, + {"RawSockaddrDatalink.Type", Field, 0}, + {"RawSockaddrInet4", Type, 0}, + {"RawSockaddrInet4.Addr", Field, 0}, + {"RawSockaddrInet4.Family", Field, 0}, + {"RawSockaddrInet4.Len", Field, 0}, + {"RawSockaddrInet4.Port", Field, 0}, + {"RawSockaddrInet4.Zero", Field, 0}, + {"RawSockaddrInet6", Type, 0}, + {"RawSockaddrInet6.Addr", Field, 0}, + {"RawSockaddrInet6.Family", Field, 0}, + {"RawSockaddrInet6.Flowinfo", Field, 0}, + {"RawSockaddrInet6.Len", Field, 0}, + {"RawSockaddrInet6.Port", Field, 0}, + {"RawSockaddrInet6.Scope_id", Field, 0}, + {"RawSockaddrLinklayer", Type, 0}, + {"RawSockaddrLinklayer.Addr", Field, 0}, + {"RawSockaddrLinklayer.Family", Field, 0}, + {"RawSockaddrLinklayer.Halen", Field, 0}, + {"RawSockaddrLinklayer.Hatype", Field, 0}, + {"RawSockaddrLinklayer.Ifindex", Field, 0}, + {"RawSockaddrLinklayer.Pkttype", Field, 0}, + {"RawSockaddrLinklayer.Protocol", Field, 0}, + {"RawSockaddrNetlink", Type, 0}, + {"RawSockaddrNetlink.Family", Field, 0}, + {"RawSockaddrNetlink.Groups", Field, 0}, + {"RawSockaddrNetlink.Pad", Field, 0}, + {"RawSockaddrNetlink.Pid", Field, 0}, + {"RawSockaddrUnix", Type, 0}, + {"RawSockaddrUnix.Family", Field, 0}, + {"RawSockaddrUnix.Len", Field, 0}, + {"RawSockaddrUnix.Pad_cgo_0", Field, 2}, + {"RawSockaddrUnix.Path", Field, 0}, + {"RawSyscall", Func, 0}, + {"RawSyscall6", Func, 0}, + {"Read", Func, 0}, + {"ReadConsole", Func, 1}, + {"ReadDirectoryChanges", Func, 0}, + {"ReadDirent", Func, 0}, + {"ReadFile", Func, 0}, + {"Readlink", Func, 0}, + {"Reboot", Func, 0}, + {"Recvfrom", Func, 0}, + {"Recvmsg", Func, 0}, + {"RegCloseKey", Func, 0}, + {"RegEnumKeyEx", Func, 0}, + {"RegOpenKeyEx", Func, 0}, + {"RegQueryInfoKey", Func, 0}, + {"RegQueryValueEx", Func, 0}, + {"RemoveDirectory", Func, 0}, + {"Removexattr", Func, 1}, + {"Rename", Func, 0}, + {"Renameat", Func, 0}, + {"Revoke", Func, 0}, + {"Rlimit", Type, 0}, + {"Rlimit.Cur", Field, 0}, + {"Rlimit.Max", Field, 0}, + {"Rmdir", Func, 0}, + {"RouteMessage", Type, 0}, + {"RouteMessage.Data", Field, 0}, + {"RouteMessage.Header", Field, 0}, + {"RouteRIB", Func, 0}, + {"RoutingMessage", Type, 0}, + {"RtAttr", Type, 0}, + {"RtAttr.Len", Field, 0}, + {"RtAttr.Type", Field, 0}, + {"RtGenmsg", Type, 0}, + {"RtGenmsg.Family", Field, 0}, + {"RtMetrics", Type, 0}, + {"RtMetrics.Expire", Field, 0}, + {"RtMetrics.Filler", Field, 0}, + {"RtMetrics.Hopcount", Field, 0}, + {"RtMetrics.Locks", Field, 0}, + {"RtMetrics.Mtu", Field, 0}, + {"RtMetrics.Pad", Field, 3}, + {"RtMetrics.Pksent", Field, 0}, + {"RtMetrics.Recvpipe", Field, 0}, + {"RtMetrics.Refcnt", Field, 2}, + {"RtMetrics.Rtt", Field, 0}, + {"RtMetrics.Rttvar", Field, 0}, + {"RtMetrics.Sendpipe", Field, 0}, + {"RtMetrics.Ssthresh", Field, 0}, + {"RtMetrics.Weight", Field, 0}, + {"RtMsg", Type, 0}, + {"RtMsg.Dst_len", Field, 0}, + {"RtMsg.Family", Field, 0}, + {"RtMsg.Flags", Field, 0}, + {"RtMsg.Protocol", Field, 0}, + {"RtMsg.Scope", Field, 0}, + {"RtMsg.Src_len", Field, 0}, + {"RtMsg.Table", Field, 0}, + {"RtMsg.Tos", Field, 0}, + {"RtMsg.Type", Field, 0}, + {"RtMsghdr", Type, 0}, + {"RtMsghdr.Addrs", Field, 0}, + {"RtMsghdr.Errno", Field, 0}, + {"RtMsghdr.Flags", Field, 0}, + {"RtMsghdr.Fmask", Field, 0}, + {"RtMsghdr.Hdrlen", Field, 2}, + {"RtMsghdr.Index", Field, 0}, + {"RtMsghdr.Inits", Field, 0}, + {"RtMsghdr.Mpls", Field, 2}, + {"RtMsghdr.Msglen", Field, 0}, + {"RtMsghdr.Pad_cgo_0", Field, 0}, + {"RtMsghdr.Pad_cgo_1", Field, 2}, + {"RtMsghdr.Pid", Field, 0}, + {"RtMsghdr.Priority", Field, 2}, + {"RtMsghdr.Rmx", Field, 0}, + {"RtMsghdr.Seq", Field, 0}, + {"RtMsghdr.Tableid", Field, 2}, + {"RtMsghdr.Type", Field, 0}, + {"RtMsghdr.Use", Field, 0}, + {"RtMsghdr.Version", Field, 0}, + {"RtNexthop", Type, 0}, + {"RtNexthop.Flags", Field, 0}, + {"RtNexthop.Hops", Field, 0}, + {"RtNexthop.Ifindex", Field, 0}, + {"RtNexthop.Len", Field, 0}, + {"Rusage", Type, 0}, + {"Rusage.CreationTime", Field, 0}, + {"Rusage.ExitTime", Field, 0}, + {"Rusage.Idrss", Field, 0}, + {"Rusage.Inblock", Field, 0}, + {"Rusage.Isrss", Field, 0}, + {"Rusage.Ixrss", Field, 0}, + {"Rusage.KernelTime", Field, 0}, + {"Rusage.Majflt", Field, 0}, + {"Rusage.Maxrss", Field, 0}, + {"Rusage.Minflt", Field, 0}, + {"Rusage.Msgrcv", Field, 0}, + {"Rusage.Msgsnd", Field, 0}, + {"Rusage.Nivcsw", Field, 0}, + {"Rusage.Nsignals", Field, 0}, + {"Rusage.Nswap", Field, 0}, + {"Rusage.Nvcsw", Field, 0}, + {"Rusage.Oublock", Field, 0}, + {"Rusage.Stime", Field, 0}, + {"Rusage.UserTime", Field, 0}, + {"Rusage.Utime", Field, 0}, + {"SCM_BINTIME", Const, 0}, + {"SCM_CREDENTIALS", Const, 0}, + {"SCM_CREDS", Const, 0}, + {"SCM_RIGHTS", Const, 0}, + {"SCM_TIMESTAMP", Const, 0}, + {"SCM_TIMESTAMPING", Const, 0}, + {"SCM_TIMESTAMPNS", Const, 0}, + {"SCM_TIMESTAMP_MONOTONIC", Const, 0}, + {"SHUT_RD", Const, 0}, + {"SHUT_RDWR", Const, 0}, + {"SHUT_WR", Const, 0}, + {"SID", Type, 0}, + {"SIDAndAttributes", Type, 0}, + {"SIDAndAttributes.Attributes", Field, 0}, + {"SIDAndAttributes.Sid", Field, 0}, + {"SIGABRT", Const, 0}, + {"SIGALRM", Const, 0}, + {"SIGBUS", Const, 0}, + {"SIGCHLD", Const, 0}, + {"SIGCLD", Const, 0}, + {"SIGCONT", Const, 0}, + {"SIGEMT", Const, 0}, + {"SIGFPE", Const, 0}, + {"SIGHUP", Const, 0}, + {"SIGILL", Const, 0}, + {"SIGINFO", Const, 0}, + {"SIGINT", Const, 0}, + {"SIGIO", Const, 0}, + {"SIGIOT", Const, 0}, + {"SIGKILL", Const, 0}, + {"SIGLIBRT", Const, 1}, + {"SIGLWP", Const, 0}, + {"SIGPIPE", Const, 0}, + {"SIGPOLL", Const, 0}, + {"SIGPROF", Const, 0}, + {"SIGPWR", Const, 0}, + {"SIGQUIT", Const, 0}, + {"SIGSEGV", Const, 0}, + {"SIGSTKFLT", Const, 0}, + {"SIGSTOP", Const, 0}, + {"SIGSYS", Const, 0}, + {"SIGTERM", Const, 0}, + {"SIGTHR", Const, 0}, + {"SIGTRAP", Const, 0}, + {"SIGTSTP", Const, 0}, + {"SIGTTIN", Const, 0}, + {"SIGTTOU", Const, 0}, + {"SIGUNUSED", Const, 0}, + {"SIGURG", Const, 0}, + {"SIGUSR1", Const, 0}, + {"SIGUSR2", Const, 0}, + {"SIGVTALRM", Const, 0}, + {"SIGWINCH", Const, 0}, + {"SIGXCPU", Const, 0}, + {"SIGXFSZ", Const, 0}, + {"SIOCADDDLCI", Const, 0}, + {"SIOCADDMULTI", Const, 0}, + {"SIOCADDRT", Const, 0}, + {"SIOCAIFADDR", Const, 0}, + {"SIOCAIFGROUP", Const, 0}, + {"SIOCALIFADDR", Const, 0}, + {"SIOCARPIPLL", Const, 0}, + {"SIOCATMARK", Const, 0}, + {"SIOCAUTOADDR", Const, 0}, + {"SIOCAUTONETMASK", Const, 0}, + {"SIOCBRDGADD", Const, 1}, + {"SIOCBRDGADDS", Const, 1}, + {"SIOCBRDGARL", Const, 1}, + {"SIOCBRDGDADDR", Const, 1}, + {"SIOCBRDGDEL", Const, 1}, + {"SIOCBRDGDELS", Const, 1}, + {"SIOCBRDGFLUSH", Const, 1}, + {"SIOCBRDGFRL", Const, 1}, + {"SIOCBRDGGCACHE", Const, 1}, + {"SIOCBRDGGFD", Const, 1}, + {"SIOCBRDGGHT", Const, 1}, + {"SIOCBRDGGIFFLGS", Const, 1}, + {"SIOCBRDGGMA", Const, 1}, + {"SIOCBRDGGPARAM", Const, 1}, + {"SIOCBRDGGPRI", Const, 1}, + {"SIOCBRDGGRL", Const, 1}, + {"SIOCBRDGGSIFS", Const, 1}, + {"SIOCBRDGGTO", Const, 1}, + {"SIOCBRDGIFS", Const, 1}, + {"SIOCBRDGRTS", Const, 1}, + {"SIOCBRDGSADDR", Const, 1}, + {"SIOCBRDGSCACHE", Const, 1}, + {"SIOCBRDGSFD", Const, 1}, + {"SIOCBRDGSHT", Const, 1}, + {"SIOCBRDGSIFCOST", Const, 1}, + {"SIOCBRDGSIFFLGS", Const, 1}, + {"SIOCBRDGSIFPRIO", Const, 1}, + {"SIOCBRDGSMA", Const, 1}, + {"SIOCBRDGSPRI", Const, 1}, + {"SIOCBRDGSPROTO", Const, 1}, + {"SIOCBRDGSTO", Const, 1}, + {"SIOCBRDGSTXHC", Const, 1}, + {"SIOCDARP", Const, 0}, + {"SIOCDELDLCI", Const, 0}, + {"SIOCDELMULTI", Const, 0}, + {"SIOCDELRT", Const, 0}, + {"SIOCDEVPRIVATE", Const, 0}, + {"SIOCDIFADDR", Const, 0}, + {"SIOCDIFGROUP", Const, 0}, + {"SIOCDIFPHYADDR", Const, 0}, + {"SIOCDLIFADDR", Const, 0}, + {"SIOCDRARP", Const, 0}, + {"SIOCGARP", Const, 0}, + {"SIOCGDRVSPEC", Const, 0}, + {"SIOCGETKALIVE", Const, 1}, + {"SIOCGETLABEL", Const, 1}, + {"SIOCGETPFLOW", Const, 1}, + {"SIOCGETPFSYNC", Const, 1}, + {"SIOCGETSGCNT", Const, 0}, + {"SIOCGETVIFCNT", Const, 0}, + {"SIOCGETVLAN", Const, 0}, + {"SIOCGHIWAT", Const, 0}, + {"SIOCGIFADDR", Const, 0}, + {"SIOCGIFADDRPREF", Const, 1}, + {"SIOCGIFALIAS", Const, 1}, + {"SIOCGIFALTMTU", Const, 0}, + {"SIOCGIFASYNCMAP", Const, 0}, + {"SIOCGIFBOND", Const, 0}, + {"SIOCGIFBR", Const, 0}, + {"SIOCGIFBRDADDR", Const, 0}, + {"SIOCGIFCAP", Const, 0}, + {"SIOCGIFCONF", Const, 0}, + {"SIOCGIFCOUNT", Const, 0}, + {"SIOCGIFDATA", Const, 1}, + {"SIOCGIFDESCR", Const, 0}, + {"SIOCGIFDEVMTU", Const, 0}, + {"SIOCGIFDLT", Const, 1}, + {"SIOCGIFDSTADDR", Const, 0}, + {"SIOCGIFENCAP", Const, 0}, + {"SIOCGIFFIB", Const, 1}, + {"SIOCGIFFLAGS", Const, 0}, + {"SIOCGIFGATTR", Const, 1}, + {"SIOCGIFGENERIC", Const, 0}, + {"SIOCGIFGMEMB", Const, 0}, + {"SIOCGIFGROUP", Const, 0}, + {"SIOCGIFHARDMTU", Const, 3}, + {"SIOCGIFHWADDR", Const, 0}, + {"SIOCGIFINDEX", Const, 0}, + {"SIOCGIFKPI", Const, 0}, + {"SIOCGIFMAC", Const, 0}, + {"SIOCGIFMAP", Const, 0}, + {"SIOCGIFMEDIA", Const, 0}, + {"SIOCGIFMEM", Const, 0}, + {"SIOCGIFMETRIC", Const, 0}, + {"SIOCGIFMTU", Const, 0}, + {"SIOCGIFNAME", Const, 0}, + {"SIOCGIFNETMASK", Const, 0}, + {"SIOCGIFPDSTADDR", Const, 0}, + {"SIOCGIFPFLAGS", Const, 0}, + {"SIOCGIFPHYS", Const, 0}, + {"SIOCGIFPRIORITY", Const, 1}, + {"SIOCGIFPSRCADDR", Const, 0}, + {"SIOCGIFRDOMAIN", Const, 1}, + {"SIOCGIFRTLABEL", Const, 1}, + {"SIOCGIFSLAVE", Const, 0}, + {"SIOCGIFSTATUS", Const, 0}, + {"SIOCGIFTIMESLOT", Const, 1}, + {"SIOCGIFTXQLEN", Const, 0}, + {"SIOCGIFVLAN", Const, 0}, + {"SIOCGIFWAKEFLAGS", Const, 0}, + {"SIOCGIFXFLAGS", Const, 1}, + {"SIOCGLIFADDR", Const, 0}, + {"SIOCGLIFPHYADDR", Const, 0}, + {"SIOCGLIFPHYRTABLE", Const, 1}, + {"SIOCGLIFPHYTTL", Const, 3}, + {"SIOCGLINKSTR", Const, 1}, + {"SIOCGLOWAT", Const, 0}, + {"SIOCGPGRP", Const, 0}, + {"SIOCGPRIVATE_0", Const, 0}, + {"SIOCGPRIVATE_1", Const, 0}, + {"SIOCGRARP", Const, 0}, + {"SIOCGSPPPPARAMS", Const, 3}, + {"SIOCGSTAMP", Const, 0}, + {"SIOCGSTAMPNS", Const, 0}, + {"SIOCGVH", Const, 1}, + {"SIOCGVNETID", Const, 3}, + {"SIOCIFCREATE", Const, 0}, + {"SIOCIFCREATE2", Const, 0}, + {"SIOCIFDESTROY", Const, 0}, + {"SIOCIFGCLONERS", Const, 0}, + {"SIOCINITIFADDR", Const, 1}, + {"SIOCPROTOPRIVATE", Const, 0}, + {"SIOCRSLVMULTI", Const, 0}, + {"SIOCRTMSG", Const, 0}, + {"SIOCSARP", Const, 0}, + {"SIOCSDRVSPEC", Const, 0}, + {"SIOCSETKALIVE", Const, 1}, + {"SIOCSETLABEL", Const, 1}, + {"SIOCSETPFLOW", Const, 1}, + {"SIOCSETPFSYNC", Const, 1}, + {"SIOCSETVLAN", Const, 0}, + {"SIOCSHIWAT", Const, 0}, + {"SIOCSIFADDR", Const, 0}, + {"SIOCSIFADDRPREF", Const, 1}, + {"SIOCSIFALTMTU", Const, 0}, + {"SIOCSIFASYNCMAP", Const, 0}, + {"SIOCSIFBOND", Const, 0}, + {"SIOCSIFBR", Const, 0}, + {"SIOCSIFBRDADDR", Const, 0}, + {"SIOCSIFCAP", Const, 0}, + {"SIOCSIFDESCR", Const, 0}, + {"SIOCSIFDSTADDR", Const, 0}, + {"SIOCSIFENCAP", Const, 0}, + {"SIOCSIFFIB", Const, 1}, + {"SIOCSIFFLAGS", Const, 0}, + {"SIOCSIFGATTR", Const, 1}, + {"SIOCSIFGENERIC", Const, 0}, + {"SIOCSIFHWADDR", Const, 0}, + {"SIOCSIFHWBROADCAST", Const, 0}, + {"SIOCSIFKPI", Const, 0}, + {"SIOCSIFLINK", Const, 0}, + {"SIOCSIFLLADDR", Const, 0}, + {"SIOCSIFMAC", Const, 0}, + {"SIOCSIFMAP", Const, 0}, + {"SIOCSIFMEDIA", Const, 0}, + {"SIOCSIFMEM", Const, 0}, + {"SIOCSIFMETRIC", Const, 0}, + {"SIOCSIFMTU", Const, 0}, + {"SIOCSIFNAME", Const, 0}, + {"SIOCSIFNETMASK", Const, 0}, + {"SIOCSIFPFLAGS", Const, 0}, + {"SIOCSIFPHYADDR", Const, 0}, + {"SIOCSIFPHYS", Const, 0}, + {"SIOCSIFPRIORITY", Const, 1}, + {"SIOCSIFRDOMAIN", Const, 1}, + {"SIOCSIFRTLABEL", Const, 1}, + {"SIOCSIFRVNET", Const, 0}, + {"SIOCSIFSLAVE", Const, 0}, + {"SIOCSIFTIMESLOT", Const, 1}, + {"SIOCSIFTXQLEN", Const, 0}, + {"SIOCSIFVLAN", Const, 0}, + {"SIOCSIFVNET", Const, 0}, + {"SIOCSIFXFLAGS", Const, 1}, + {"SIOCSLIFPHYADDR", Const, 0}, + {"SIOCSLIFPHYRTABLE", Const, 1}, + {"SIOCSLIFPHYTTL", Const, 3}, + {"SIOCSLINKSTR", Const, 1}, + {"SIOCSLOWAT", Const, 0}, + {"SIOCSPGRP", Const, 0}, + {"SIOCSRARP", Const, 0}, + {"SIOCSSPPPPARAMS", Const, 3}, + {"SIOCSVH", Const, 1}, + {"SIOCSVNETID", Const, 3}, + {"SIOCZIFDATA", Const, 1}, + {"SIO_GET_EXTENSION_FUNCTION_POINTER", Const, 1}, + {"SIO_GET_INTERFACE_LIST", Const, 0}, + {"SIO_KEEPALIVE_VALS", Const, 3}, + {"SIO_UDP_CONNRESET", Const, 4}, + {"SOCK_CLOEXEC", Const, 0}, + {"SOCK_DCCP", Const, 0}, + {"SOCK_DGRAM", Const, 0}, + {"SOCK_FLAGS_MASK", Const, 1}, + {"SOCK_MAXADDRLEN", Const, 0}, + {"SOCK_NONBLOCK", Const, 0}, + {"SOCK_NOSIGPIPE", Const, 1}, + {"SOCK_PACKET", Const, 0}, + {"SOCK_RAW", Const, 0}, + {"SOCK_RDM", Const, 0}, + {"SOCK_SEQPACKET", Const, 0}, + {"SOCK_STREAM", Const, 0}, + {"SOL_AAL", Const, 0}, + {"SOL_ATM", Const, 0}, + {"SOL_DECNET", Const, 0}, + {"SOL_ICMPV6", Const, 0}, + {"SOL_IP", Const, 0}, + {"SOL_IPV6", Const, 0}, + {"SOL_IRDA", Const, 0}, + {"SOL_PACKET", Const, 0}, + {"SOL_RAW", Const, 0}, + {"SOL_SOCKET", Const, 0}, + {"SOL_TCP", Const, 0}, + {"SOL_X25", Const, 0}, + {"SOMAXCONN", Const, 0}, + {"SO_ACCEPTCONN", Const, 0}, + {"SO_ACCEPTFILTER", Const, 0}, + {"SO_ATTACH_FILTER", Const, 0}, + {"SO_BINDANY", Const, 1}, + {"SO_BINDTODEVICE", Const, 0}, + {"SO_BINTIME", Const, 0}, + {"SO_BROADCAST", Const, 0}, + {"SO_BSDCOMPAT", Const, 0}, + {"SO_DEBUG", Const, 0}, + {"SO_DETACH_FILTER", Const, 0}, + {"SO_DOMAIN", Const, 0}, + {"SO_DONTROUTE", Const, 0}, + {"SO_DONTTRUNC", Const, 0}, + {"SO_ERROR", Const, 0}, + {"SO_KEEPALIVE", Const, 0}, + {"SO_LABEL", Const, 0}, + {"SO_LINGER", Const, 0}, + {"SO_LINGER_SEC", Const, 0}, + {"SO_LISTENINCQLEN", Const, 0}, + {"SO_LISTENQLEN", Const, 0}, + {"SO_LISTENQLIMIT", Const, 0}, + {"SO_MARK", Const, 0}, + {"SO_NETPROC", Const, 1}, + {"SO_NKE", Const, 0}, + {"SO_NOADDRERR", Const, 0}, + {"SO_NOHEADER", Const, 1}, + {"SO_NOSIGPIPE", Const, 0}, + {"SO_NOTIFYCONFLICT", Const, 0}, + {"SO_NO_CHECK", Const, 0}, + {"SO_NO_DDP", Const, 0}, + {"SO_NO_OFFLOAD", Const, 0}, + {"SO_NP_EXTENSIONS", Const, 0}, + {"SO_NREAD", Const, 0}, + {"SO_NUMRCVPKT", Const, 16}, + {"SO_NWRITE", Const, 0}, + {"SO_OOBINLINE", Const, 0}, + {"SO_OVERFLOWED", Const, 1}, + {"SO_PASSCRED", Const, 0}, + {"SO_PASSSEC", Const, 0}, + {"SO_PEERCRED", Const, 0}, + {"SO_PEERLABEL", Const, 0}, + {"SO_PEERNAME", Const, 0}, + {"SO_PEERSEC", Const, 0}, + {"SO_PRIORITY", Const, 0}, + {"SO_PROTOCOL", Const, 0}, + {"SO_PROTOTYPE", Const, 1}, + {"SO_RANDOMPORT", Const, 0}, + {"SO_RCVBUF", Const, 0}, + {"SO_RCVBUFFORCE", Const, 0}, + {"SO_RCVLOWAT", Const, 0}, + {"SO_RCVTIMEO", Const, 0}, + {"SO_RESTRICTIONS", Const, 0}, + {"SO_RESTRICT_DENYIN", Const, 0}, + {"SO_RESTRICT_DENYOUT", Const, 0}, + {"SO_RESTRICT_DENYSET", Const, 0}, + {"SO_REUSEADDR", Const, 0}, + {"SO_REUSEPORT", Const, 0}, + {"SO_REUSESHAREUID", Const, 0}, + {"SO_RTABLE", Const, 1}, + {"SO_RXQ_OVFL", Const, 0}, + {"SO_SECURITY_AUTHENTICATION", Const, 0}, + {"SO_SECURITY_ENCRYPTION_NETWORK", Const, 0}, + {"SO_SECURITY_ENCRYPTION_TRANSPORT", Const, 0}, + {"SO_SETFIB", Const, 0}, + {"SO_SNDBUF", Const, 0}, + {"SO_SNDBUFFORCE", Const, 0}, + {"SO_SNDLOWAT", Const, 0}, + {"SO_SNDTIMEO", Const, 0}, + {"SO_SPLICE", Const, 1}, + {"SO_TIMESTAMP", Const, 0}, + {"SO_TIMESTAMPING", Const, 0}, + {"SO_TIMESTAMPNS", Const, 0}, + {"SO_TIMESTAMP_MONOTONIC", Const, 0}, + {"SO_TYPE", Const, 0}, + {"SO_UPCALLCLOSEWAIT", Const, 0}, + {"SO_UPDATE_ACCEPT_CONTEXT", Const, 0}, + {"SO_UPDATE_CONNECT_CONTEXT", Const, 1}, + {"SO_USELOOPBACK", Const, 0}, + {"SO_USER_COOKIE", Const, 1}, + {"SO_VENDOR", Const, 3}, + {"SO_WANTMORE", Const, 0}, + {"SO_WANTOOBFLAG", Const, 0}, + {"SSLExtraCertChainPolicyPara", Type, 0}, + {"SSLExtraCertChainPolicyPara.AuthType", Field, 0}, + {"SSLExtraCertChainPolicyPara.Checks", Field, 0}, + {"SSLExtraCertChainPolicyPara.ServerName", Field, 0}, + {"SSLExtraCertChainPolicyPara.Size", Field, 0}, + {"STANDARD_RIGHTS_ALL", Const, 0}, + {"STANDARD_RIGHTS_EXECUTE", Const, 0}, + {"STANDARD_RIGHTS_READ", Const, 0}, + {"STANDARD_RIGHTS_REQUIRED", Const, 0}, + {"STANDARD_RIGHTS_WRITE", Const, 0}, + {"STARTF_USESHOWWINDOW", Const, 0}, + {"STARTF_USESTDHANDLES", Const, 0}, + {"STD_ERROR_HANDLE", Const, 0}, + {"STD_INPUT_HANDLE", Const, 0}, + {"STD_OUTPUT_HANDLE", Const, 0}, + {"SUBLANG_ENGLISH_US", Const, 0}, + {"SW_FORCEMINIMIZE", Const, 0}, + {"SW_HIDE", Const, 0}, + {"SW_MAXIMIZE", Const, 0}, + {"SW_MINIMIZE", Const, 0}, + {"SW_NORMAL", Const, 0}, + {"SW_RESTORE", Const, 0}, + {"SW_SHOW", Const, 0}, + {"SW_SHOWDEFAULT", Const, 0}, + {"SW_SHOWMAXIMIZED", Const, 0}, + {"SW_SHOWMINIMIZED", Const, 0}, + {"SW_SHOWMINNOACTIVE", Const, 0}, + {"SW_SHOWNA", Const, 0}, + {"SW_SHOWNOACTIVATE", Const, 0}, + {"SW_SHOWNORMAL", Const, 0}, + {"SYMBOLIC_LINK_FLAG_DIRECTORY", Const, 4}, + {"SYNCHRONIZE", Const, 0}, + {"SYSCTL_VERSION", Const, 1}, + {"SYSCTL_VERS_0", Const, 1}, + {"SYSCTL_VERS_1", Const, 1}, + {"SYSCTL_VERS_MASK", Const, 1}, + {"SYS_ABORT2", Const, 0}, + {"SYS_ACCEPT", Const, 0}, + {"SYS_ACCEPT4", Const, 0}, + {"SYS_ACCEPT_NOCANCEL", Const, 0}, + {"SYS_ACCESS", Const, 0}, + {"SYS_ACCESS_EXTENDED", Const, 0}, + {"SYS_ACCT", Const, 0}, + {"SYS_ADD_KEY", Const, 0}, + {"SYS_ADD_PROFIL", Const, 0}, + {"SYS_ADJFREQ", Const, 1}, + {"SYS_ADJTIME", Const, 0}, + {"SYS_ADJTIMEX", Const, 0}, + {"SYS_AFS_SYSCALL", Const, 0}, + {"SYS_AIO_CANCEL", Const, 0}, + {"SYS_AIO_ERROR", Const, 0}, + {"SYS_AIO_FSYNC", Const, 0}, + {"SYS_AIO_MLOCK", Const, 14}, + {"SYS_AIO_READ", Const, 0}, + {"SYS_AIO_RETURN", Const, 0}, + {"SYS_AIO_SUSPEND", Const, 0}, + {"SYS_AIO_SUSPEND_NOCANCEL", Const, 0}, + {"SYS_AIO_WAITCOMPLETE", Const, 14}, + {"SYS_AIO_WRITE", Const, 0}, + {"SYS_ALARM", Const, 0}, + {"SYS_ARCH_PRCTL", Const, 0}, + {"SYS_ARM_FADVISE64_64", Const, 0}, + {"SYS_ARM_SYNC_FILE_RANGE", Const, 0}, + {"SYS_ATGETMSG", Const, 0}, + {"SYS_ATPGETREQ", Const, 0}, + {"SYS_ATPGETRSP", Const, 0}, + {"SYS_ATPSNDREQ", Const, 0}, + {"SYS_ATPSNDRSP", Const, 0}, + {"SYS_ATPUTMSG", Const, 0}, + {"SYS_ATSOCKET", Const, 0}, + {"SYS_AUDIT", Const, 0}, + {"SYS_AUDITCTL", Const, 0}, + {"SYS_AUDITON", Const, 0}, + {"SYS_AUDIT_SESSION_JOIN", Const, 0}, + {"SYS_AUDIT_SESSION_PORT", Const, 0}, + {"SYS_AUDIT_SESSION_SELF", Const, 0}, + {"SYS_BDFLUSH", Const, 0}, + {"SYS_BIND", Const, 0}, + {"SYS_BINDAT", Const, 3}, + {"SYS_BREAK", Const, 0}, + {"SYS_BRK", Const, 0}, + {"SYS_BSDTHREAD_CREATE", Const, 0}, + {"SYS_BSDTHREAD_REGISTER", Const, 0}, + {"SYS_BSDTHREAD_TERMINATE", Const, 0}, + {"SYS_CAPGET", Const, 0}, + {"SYS_CAPSET", Const, 0}, + {"SYS_CAP_ENTER", Const, 0}, + {"SYS_CAP_FCNTLS_GET", Const, 1}, + {"SYS_CAP_FCNTLS_LIMIT", Const, 1}, + {"SYS_CAP_GETMODE", Const, 0}, + {"SYS_CAP_GETRIGHTS", Const, 0}, + {"SYS_CAP_IOCTLS_GET", Const, 1}, + {"SYS_CAP_IOCTLS_LIMIT", Const, 1}, + {"SYS_CAP_NEW", Const, 0}, + {"SYS_CAP_RIGHTS_GET", Const, 1}, + {"SYS_CAP_RIGHTS_LIMIT", Const, 1}, + {"SYS_CHDIR", Const, 0}, + {"SYS_CHFLAGS", Const, 0}, + {"SYS_CHFLAGSAT", Const, 3}, + {"SYS_CHMOD", Const, 0}, + {"SYS_CHMOD_EXTENDED", Const, 0}, + {"SYS_CHOWN", Const, 0}, + {"SYS_CHOWN32", Const, 0}, + {"SYS_CHROOT", Const, 0}, + {"SYS_CHUD", Const, 0}, + {"SYS_CLOCK_ADJTIME", Const, 0}, + {"SYS_CLOCK_GETCPUCLOCKID2", Const, 1}, + {"SYS_CLOCK_GETRES", Const, 0}, + {"SYS_CLOCK_GETTIME", Const, 0}, + {"SYS_CLOCK_NANOSLEEP", Const, 0}, + {"SYS_CLOCK_SETTIME", Const, 0}, + {"SYS_CLONE", Const, 0}, + {"SYS_CLOSE", Const, 0}, + {"SYS_CLOSEFROM", Const, 0}, + {"SYS_CLOSE_NOCANCEL", Const, 0}, + {"SYS_CONNECT", Const, 0}, + {"SYS_CONNECTAT", Const, 3}, + {"SYS_CONNECT_NOCANCEL", Const, 0}, + {"SYS_COPYFILE", Const, 0}, + {"SYS_CPUSET", Const, 0}, + {"SYS_CPUSET_GETAFFINITY", Const, 0}, + {"SYS_CPUSET_GETID", Const, 0}, + {"SYS_CPUSET_SETAFFINITY", Const, 0}, + {"SYS_CPUSET_SETID", Const, 0}, + {"SYS_CREAT", Const, 0}, + {"SYS_CREATE_MODULE", Const, 0}, + {"SYS_CSOPS", Const, 0}, + {"SYS_CSOPS_AUDITTOKEN", Const, 16}, + {"SYS_DELETE", Const, 0}, + {"SYS_DELETE_MODULE", Const, 0}, + {"SYS_DUP", Const, 0}, + {"SYS_DUP2", Const, 0}, + {"SYS_DUP3", Const, 0}, + {"SYS_EACCESS", Const, 0}, + {"SYS_EPOLL_CREATE", Const, 0}, + {"SYS_EPOLL_CREATE1", Const, 0}, + {"SYS_EPOLL_CTL", Const, 0}, + {"SYS_EPOLL_CTL_OLD", Const, 0}, + {"SYS_EPOLL_PWAIT", Const, 0}, + {"SYS_EPOLL_WAIT", Const, 0}, + {"SYS_EPOLL_WAIT_OLD", Const, 0}, + {"SYS_EVENTFD", Const, 0}, + {"SYS_EVENTFD2", Const, 0}, + {"SYS_EXCHANGEDATA", Const, 0}, + {"SYS_EXECVE", Const, 0}, + {"SYS_EXIT", Const, 0}, + {"SYS_EXIT_GROUP", Const, 0}, + {"SYS_EXTATTRCTL", Const, 0}, + {"SYS_EXTATTR_DELETE_FD", Const, 0}, + {"SYS_EXTATTR_DELETE_FILE", Const, 0}, + {"SYS_EXTATTR_DELETE_LINK", Const, 0}, + {"SYS_EXTATTR_GET_FD", Const, 0}, + {"SYS_EXTATTR_GET_FILE", Const, 0}, + {"SYS_EXTATTR_GET_LINK", Const, 0}, + {"SYS_EXTATTR_LIST_FD", Const, 0}, + {"SYS_EXTATTR_LIST_FILE", Const, 0}, + {"SYS_EXTATTR_LIST_LINK", Const, 0}, + {"SYS_EXTATTR_SET_FD", Const, 0}, + {"SYS_EXTATTR_SET_FILE", Const, 0}, + {"SYS_EXTATTR_SET_LINK", Const, 0}, + {"SYS_FACCESSAT", Const, 0}, + {"SYS_FADVISE64", Const, 0}, + {"SYS_FADVISE64_64", Const, 0}, + {"SYS_FALLOCATE", Const, 0}, + {"SYS_FANOTIFY_INIT", Const, 0}, + {"SYS_FANOTIFY_MARK", Const, 0}, + {"SYS_FCHDIR", Const, 0}, + {"SYS_FCHFLAGS", Const, 0}, + {"SYS_FCHMOD", Const, 0}, + {"SYS_FCHMODAT", Const, 0}, + {"SYS_FCHMOD_EXTENDED", Const, 0}, + {"SYS_FCHOWN", Const, 0}, + {"SYS_FCHOWN32", Const, 0}, + {"SYS_FCHOWNAT", Const, 0}, + {"SYS_FCHROOT", Const, 1}, + {"SYS_FCNTL", Const, 0}, + {"SYS_FCNTL64", Const, 0}, + {"SYS_FCNTL_NOCANCEL", Const, 0}, + {"SYS_FDATASYNC", Const, 0}, + {"SYS_FEXECVE", Const, 0}, + {"SYS_FFCLOCK_GETCOUNTER", Const, 0}, + {"SYS_FFCLOCK_GETESTIMATE", Const, 0}, + {"SYS_FFCLOCK_SETESTIMATE", Const, 0}, + {"SYS_FFSCTL", Const, 0}, + {"SYS_FGETATTRLIST", Const, 0}, + {"SYS_FGETXATTR", Const, 0}, + {"SYS_FHOPEN", Const, 0}, + {"SYS_FHSTAT", Const, 0}, + {"SYS_FHSTATFS", Const, 0}, + {"SYS_FILEPORT_MAKEFD", Const, 0}, + {"SYS_FILEPORT_MAKEPORT", Const, 0}, + {"SYS_FKTRACE", Const, 1}, + {"SYS_FLISTXATTR", Const, 0}, + {"SYS_FLOCK", Const, 0}, + {"SYS_FORK", Const, 0}, + {"SYS_FPATHCONF", Const, 0}, + {"SYS_FREEBSD6_FTRUNCATE", Const, 0}, + {"SYS_FREEBSD6_LSEEK", Const, 0}, + {"SYS_FREEBSD6_MMAP", Const, 0}, + {"SYS_FREEBSD6_PREAD", Const, 0}, + {"SYS_FREEBSD6_PWRITE", Const, 0}, + {"SYS_FREEBSD6_TRUNCATE", Const, 0}, + {"SYS_FREMOVEXATTR", Const, 0}, + {"SYS_FSCTL", Const, 0}, + {"SYS_FSETATTRLIST", Const, 0}, + {"SYS_FSETXATTR", Const, 0}, + {"SYS_FSGETPATH", Const, 0}, + {"SYS_FSTAT", Const, 0}, + {"SYS_FSTAT64", Const, 0}, + {"SYS_FSTAT64_EXTENDED", Const, 0}, + {"SYS_FSTATAT", Const, 0}, + {"SYS_FSTATAT64", Const, 0}, + {"SYS_FSTATFS", Const, 0}, + {"SYS_FSTATFS64", Const, 0}, + {"SYS_FSTATV", Const, 0}, + {"SYS_FSTATVFS1", Const, 1}, + {"SYS_FSTAT_EXTENDED", Const, 0}, + {"SYS_FSYNC", Const, 0}, + {"SYS_FSYNC_NOCANCEL", Const, 0}, + {"SYS_FSYNC_RANGE", Const, 1}, + {"SYS_FTIME", Const, 0}, + {"SYS_FTRUNCATE", Const, 0}, + {"SYS_FTRUNCATE64", Const, 0}, + {"SYS_FUTEX", Const, 0}, + {"SYS_FUTIMENS", Const, 1}, + {"SYS_FUTIMES", Const, 0}, + {"SYS_FUTIMESAT", Const, 0}, + {"SYS_GETATTRLIST", Const, 0}, + {"SYS_GETAUDIT", Const, 0}, + {"SYS_GETAUDIT_ADDR", Const, 0}, + {"SYS_GETAUID", Const, 0}, + {"SYS_GETCONTEXT", Const, 0}, + {"SYS_GETCPU", Const, 0}, + {"SYS_GETCWD", Const, 0}, + {"SYS_GETDENTS", Const, 0}, + {"SYS_GETDENTS64", Const, 0}, + {"SYS_GETDIRENTRIES", Const, 0}, + {"SYS_GETDIRENTRIES64", Const, 0}, + {"SYS_GETDIRENTRIESATTR", Const, 0}, + {"SYS_GETDTABLECOUNT", Const, 1}, + {"SYS_GETDTABLESIZE", Const, 0}, + {"SYS_GETEGID", Const, 0}, + {"SYS_GETEGID32", Const, 0}, + {"SYS_GETEUID", Const, 0}, + {"SYS_GETEUID32", Const, 0}, + {"SYS_GETFH", Const, 0}, + {"SYS_GETFSSTAT", Const, 0}, + {"SYS_GETFSSTAT64", Const, 0}, + {"SYS_GETGID", Const, 0}, + {"SYS_GETGID32", Const, 0}, + {"SYS_GETGROUPS", Const, 0}, + {"SYS_GETGROUPS32", Const, 0}, + {"SYS_GETHOSTUUID", Const, 0}, + {"SYS_GETITIMER", Const, 0}, + {"SYS_GETLCID", Const, 0}, + {"SYS_GETLOGIN", Const, 0}, + {"SYS_GETLOGINCLASS", Const, 0}, + {"SYS_GETPEERNAME", Const, 0}, + {"SYS_GETPGID", Const, 0}, + {"SYS_GETPGRP", Const, 0}, + {"SYS_GETPID", Const, 0}, + {"SYS_GETPMSG", Const, 0}, + {"SYS_GETPPID", Const, 0}, + {"SYS_GETPRIORITY", Const, 0}, + {"SYS_GETRESGID", Const, 0}, + {"SYS_GETRESGID32", Const, 0}, + {"SYS_GETRESUID", Const, 0}, + {"SYS_GETRESUID32", Const, 0}, + {"SYS_GETRLIMIT", Const, 0}, + {"SYS_GETRTABLE", Const, 1}, + {"SYS_GETRUSAGE", Const, 0}, + {"SYS_GETSGROUPS", Const, 0}, + {"SYS_GETSID", Const, 0}, + {"SYS_GETSOCKNAME", Const, 0}, + {"SYS_GETSOCKOPT", Const, 0}, + {"SYS_GETTHRID", Const, 1}, + {"SYS_GETTID", Const, 0}, + {"SYS_GETTIMEOFDAY", Const, 0}, + {"SYS_GETUID", Const, 0}, + {"SYS_GETUID32", Const, 0}, + {"SYS_GETVFSSTAT", Const, 1}, + {"SYS_GETWGROUPS", Const, 0}, + {"SYS_GETXATTR", Const, 0}, + {"SYS_GET_KERNEL_SYMS", Const, 0}, + {"SYS_GET_MEMPOLICY", Const, 0}, + {"SYS_GET_ROBUST_LIST", Const, 0}, + {"SYS_GET_THREAD_AREA", Const, 0}, + {"SYS_GSSD_SYSCALL", Const, 14}, + {"SYS_GTTY", Const, 0}, + {"SYS_IDENTITYSVC", Const, 0}, + {"SYS_IDLE", Const, 0}, + {"SYS_INITGROUPS", Const, 0}, + {"SYS_INIT_MODULE", Const, 0}, + {"SYS_INOTIFY_ADD_WATCH", Const, 0}, + {"SYS_INOTIFY_INIT", Const, 0}, + {"SYS_INOTIFY_INIT1", Const, 0}, + {"SYS_INOTIFY_RM_WATCH", Const, 0}, + {"SYS_IOCTL", Const, 0}, + {"SYS_IOPERM", Const, 0}, + {"SYS_IOPL", Const, 0}, + {"SYS_IOPOLICYSYS", Const, 0}, + {"SYS_IOPRIO_GET", Const, 0}, + {"SYS_IOPRIO_SET", Const, 0}, + {"SYS_IO_CANCEL", Const, 0}, + {"SYS_IO_DESTROY", Const, 0}, + {"SYS_IO_GETEVENTS", Const, 0}, + {"SYS_IO_SETUP", Const, 0}, + {"SYS_IO_SUBMIT", Const, 0}, + {"SYS_IPC", Const, 0}, + {"SYS_ISSETUGID", Const, 0}, + {"SYS_JAIL", Const, 0}, + {"SYS_JAIL_ATTACH", Const, 0}, + {"SYS_JAIL_GET", Const, 0}, + {"SYS_JAIL_REMOVE", Const, 0}, + {"SYS_JAIL_SET", Const, 0}, + {"SYS_KAS_INFO", Const, 16}, + {"SYS_KDEBUG_TRACE", Const, 0}, + {"SYS_KENV", Const, 0}, + {"SYS_KEVENT", Const, 0}, + {"SYS_KEVENT64", Const, 0}, + {"SYS_KEXEC_LOAD", Const, 0}, + {"SYS_KEYCTL", Const, 0}, + {"SYS_KILL", Const, 0}, + {"SYS_KLDFIND", Const, 0}, + {"SYS_KLDFIRSTMOD", Const, 0}, + {"SYS_KLDLOAD", Const, 0}, + {"SYS_KLDNEXT", Const, 0}, + {"SYS_KLDSTAT", Const, 0}, + {"SYS_KLDSYM", Const, 0}, + {"SYS_KLDUNLOAD", Const, 0}, + {"SYS_KLDUNLOADF", Const, 0}, + {"SYS_KMQ_NOTIFY", Const, 14}, + {"SYS_KMQ_OPEN", Const, 14}, + {"SYS_KMQ_SETATTR", Const, 14}, + {"SYS_KMQ_TIMEDRECEIVE", Const, 14}, + {"SYS_KMQ_TIMEDSEND", Const, 14}, + {"SYS_KMQ_UNLINK", Const, 14}, + {"SYS_KQUEUE", Const, 0}, + {"SYS_KQUEUE1", Const, 1}, + {"SYS_KSEM_CLOSE", Const, 14}, + {"SYS_KSEM_DESTROY", Const, 14}, + {"SYS_KSEM_GETVALUE", Const, 14}, + {"SYS_KSEM_INIT", Const, 14}, + {"SYS_KSEM_OPEN", Const, 14}, + {"SYS_KSEM_POST", Const, 14}, + {"SYS_KSEM_TIMEDWAIT", Const, 14}, + {"SYS_KSEM_TRYWAIT", Const, 14}, + {"SYS_KSEM_UNLINK", Const, 14}, + {"SYS_KSEM_WAIT", Const, 14}, + {"SYS_KTIMER_CREATE", Const, 0}, + {"SYS_KTIMER_DELETE", Const, 0}, + {"SYS_KTIMER_GETOVERRUN", Const, 0}, + {"SYS_KTIMER_GETTIME", Const, 0}, + {"SYS_KTIMER_SETTIME", Const, 0}, + {"SYS_KTRACE", Const, 0}, + {"SYS_LCHFLAGS", Const, 0}, + {"SYS_LCHMOD", Const, 0}, + {"SYS_LCHOWN", Const, 0}, + {"SYS_LCHOWN32", Const, 0}, + {"SYS_LEDGER", Const, 16}, + {"SYS_LGETFH", Const, 0}, + {"SYS_LGETXATTR", Const, 0}, + {"SYS_LINK", Const, 0}, + {"SYS_LINKAT", Const, 0}, + {"SYS_LIO_LISTIO", Const, 0}, + {"SYS_LISTEN", Const, 0}, + {"SYS_LISTXATTR", Const, 0}, + {"SYS_LLISTXATTR", Const, 0}, + {"SYS_LOCK", Const, 0}, + {"SYS_LOOKUP_DCOOKIE", Const, 0}, + {"SYS_LPATHCONF", Const, 0}, + {"SYS_LREMOVEXATTR", Const, 0}, + {"SYS_LSEEK", Const, 0}, + {"SYS_LSETXATTR", Const, 0}, + {"SYS_LSTAT", Const, 0}, + {"SYS_LSTAT64", Const, 0}, + {"SYS_LSTAT64_EXTENDED", Const, 0}, + {"SYS_LSTATV", Const, 0}, + {"SYS_LSTAT_EXTENDED", Const, 0}, + {"SYS_LUTIMES", Const, 0}, + {"SYS_MAC_SYSCALL", Const, 0}, + {"SYS_MADVISE", Const, 0}, + {"SYS_MADVISE1", Const, 0}, + {"SYS_MAXSYSCALL", Const, 0}, + {"SYS_MBIND", Const, 0}, + {"SYS_MIGRATE_PAGES", Const, 0}, + {"SYS_MINCORE", Const, 0}, + {"SYS_MINHERIT", Const, 0}, + {"SYS_MKCOMPLEX", Const, 0}, + {"SYS_MKDIR", Const, 0}, + {"SYS_MKDIRAT", Const, 0}, + {"SYS_MKDIR_EXTENDED", Const, 0}, + {"SYS_MKFIFO", Const, 0}, + {"SYS_MKFIFOAT", Const, 0}, + {"SYS_MKFIFO_EXTENDED", Const, 0}, + {"SYS_MKNOD", Const, 0}, + {"SYS_MKNODAT", Const, 0}, + {"SYS_MLOCK", Const, 0}, + {"SYS_MLOCKALL", Const, 0}, + {"SYS_MMAP", Const, 0}, + {"SYS_MMAP2", Const, 0}, + {"SYS_MODCTL", Const, 1}, + {"SYS_MODFIND", Const, 0}, + {"SYS_MODFNEXT", Const, 0}, + {"SYS_MODIFY_LDT", Const, 0}, + {"SYS_MODNEXT", Const, 0}, + {"SYS_MODSTAT", Const, 0}, + {"SYS_MODWATCH", Const, 0}, + {"SYS_MOUNT", Const, 0}, + {"SYS_MOVE_PAGES", Const, 0}, + {"SYS_MPROTECT", Const, 0}, + {"SYS_MPX", Const, 0}, + {"SYS_MQUERY", Const, 1}, + {"SYS_MQ_GETSETATTR", Const, 0}, + {"SYS_MQ_NOTIFY", Const, 0}, + {"SYS_MQ_OPEN", Const, 0}, + {"SYS_MQ_TIMEDRECEIVE", Const, 0}, + {"SYS_MQ_TIMEDSEND", Const, 0}, + {"SYS_MQ_UNLINK", Const, 0}, + {"SYS_MREMAP", Const, 0}, + {"SYS_MSGCTL", Const, 0}, + {"SYS_MSGGET", Const, 0}, + {"SYS_MSGRCV", Const, 0}, + {"SYS_MSGRCV_NOCANCEL", Const, 0}, + {"SYS_MSGSND", Const, 0}, + {"SYS_MSGSND_NOCANCEL", Const, 0}, + {"SYS_MSGSYS", Const, 0}, + {"SYS_MSYNC", Const, 0}, + {"SYS_MSYNC_NOCANCEL", Const, 0}, + {"SYS_MUNLOCK", Const, 0}, + {"SYS_MUNLOCKALL", Const, 0}, + {"SYS_MUNMAP", Const, 0}, + {"SYS_NAME_TO_HANDLE_AT", Const, 0}, + {"SYS_NANOSLEEP", Const, 0}, + {"SYS_NEWFSTATAT", Const, 0}, + {"SYS_NFSCLNT", Const, 0}, + {"SYS_NFSSERVCTL", Const, 0}, + {"SYS_NFSSVC", Const, 0}, + {"SYS_NFSTAT", Const, 0}, + {"SYS_NICE", Const, 0}, + {"SYS_NLM_SYSCALL", Const, 14}, + {"SYS_NLSTAT", Const, 0}, + {"SYS_NMOUNT", Const, 0}, + {"SYS_NSTAT", Const, 0}, + {"SYS_NTP_ADJTIME", Const, 0}, + {"SYS_NTP_GETTIME", Const, 0}, + {"SYS_NUMA_GETAFFINITY", Const, 14}, + {"SYS_NUMA_SETAFFINITY", Const, 14}, + {"SYS_OABI_SYSCALL_BASE", Const, 0}, + {"SYS_OBREAK", Const, 0}, + {"SYS_OLDFSTAT", Const, 0}, + {"SYS_OLDLSTAT", Const, 0}, + {"SYS_OLDOLDUNAME", Const, 0}, + {"SYS_OLDSTAT", Const, 0}, + {"SYS_OLDUNAME", Const, 0}, + {"SYS_OPEN", Const, 0}, + {"SYS_OPENAT", Const, 0}, + {"SYS_OPENBSD_POLL", Const, 0}, + {"SYS_OPEN_BY_HANDLE_AT", Const, 0}, + {"SYS_OPEN_DPROTECTED_NP", Const, 16}, + {"SYS_OPEN_EXTENDED", Const, 0}, + {"SYS_OPEN_NOCANCEL", Const, 0}, + {"SYS_OVADVISE", Const, 0}, + {"SYS_PACCEPT", Const, 1}, + {"SYS_PATHCONF", Const, 0}, + {"SYS_PAUSE", Const, 0}, + {"SYS_PCICONFIG_IOBASE", Const, 0}, + {"SYS_PCICONFIG_READ", Const, 0}, + {"SYS_PCICONFIG_WRITE", Const, 0}, + {"SYS_PDFORK", Const, 0}, + {"SYS_PDGETPID", Const, 0}, + {"SYS_PDKILL", Const, 0}, + {"SYS_PERF_EVENT_OPEN", Const, 0}, + {"SYS_PERSONALITY", Const, 0}, + {"SYS_PID_HIBERNATE", Const, 0}, + {"SYS_PID_RESUME", Const, 0}, + {"SYS_PID_SHUTDOWN_SOCKETS", Const, 0}, + {"SYS_PID_SUSPEND", Const, 0}, + {"SYS_PIPE", Const, 0}, + {"SYS_PIPE2", Const, 0}, + {"SYS_PIVOT_ROOT", Const, 0}, + {"SYS_PMC_CONTROL", Const, 1}, + {"SYS_PMC_GET_INFO", Const, 1}, + {"SYS_POLL", Const, 0}, + {"SYS_POLLTS", Const, 1}, + {"SYS_POLL_NOCANCEL", Const, 0}, + {"SYS_POSIX_FADVISE", Const, 0}, + {"SYS_POSIX_FALLOCATE", Const, 0}, + {"SYS_POSIX_OPENPT", Const, 0}, + {"SYS_POSIX_SPAWN", Const, 0}, + {"SYS_PPOLL", Const, 0}, + {"SYS_PRCTL", Const, 0}, + {"SYS_PREAD", Const, 0}, + {"SYS_PREAD64", Const, 0}, + {"SYS_PREADV", Const, 0}, + {"SYS_PREAD_NOCANCEL", Const, 0}, + {"SYS_PRLIMIT64", Const, 0}, + {"SYS_PROCCTL", Const, 3}, + {"SYS_PROCESS_POLICY", Const, 0}, + {"SYS_PROCESS_VM_READV", Const, 0}, + {"SYS_PROCESS_VM_WRITEV", Const, 0}, + {"SYS_PROC_INFO", Const, 0}, + {"SYS_PROF", Const, 0}, + {"SYS_PROFIL", Const, 0}, + {"SYS_PSELECT", Const, 0}, + {"SYS_PSELECT6", Const, 0}, + {"SYS_PSET_ASSIGN", Const, 1}, + {"SYS_PSET_CREATE", Const, 1}, + {"SYS_PSET_DESTROY", Const, 1}, + {"SYS_PSYNCH_CVBROAD", Const, 0}, + {"SYS_PSYNCH_CVCLRPREPOST", Const, 0}, + {"SYS_PSYNCH_CVSIGNAL", Const, 0}, + {"SYS_PSYNCH_CVWAIT", Const, 0}, + {"SYS_PSYNCH_MUTEXDROP", Const, 0}, + {"SYS_PSYNCH_MUTEXWAIT", Const, 0}, + {"SYS_PSYNCH_RW_DOWNGRADE", Const, 0}, + {"SYS_PSYNCH_RW_LONGRDLOCK", Const, 0}, + {"SYS_PSYNCH_RW_RDLOCK", Const, 0}, + {"SYS_PSYNCH_RW_UNLOCK", Const, 0}, + {"SYS_PSYNCH_RW_UNLOCK2", Const, 0}, + {"SYS_PSYNCH_RW_UPGRADE", Const, 0}, + {"SYS_PSYNCH_RW_WRLOCK", Const, 0}, + {"SYS_PSYNCH_RW_YIELDWRLOCK", Const, 0}, + {"SYS_PTRACE", Const, 0}, + {"SYS_PUTPMSG", Const, 0}, + {"SYS_PWRITE", Const, 0}, + {"SYS_PWRITE64", Const, 0}, + {"SYS_PWRITEV", Const, 0}, + {"SYS_PWRITE_NOCANCEL", Const, 0}, + {"SYS_QUERY_MODULE", Const, 0}, + {"SYS_QUOTACTL", Const, 0}, + {"SYS_RASCTL", Const, 1}, + {"SYS_RCTL_ADD_RULE", Const, 0}, + {"SYS_RCTL_GET_LIMITS", Const, 0}, + {"SYS_RCTL_GET_RACCT", Const, 0}, + {"SYS_RCTL_GET_RULES", Const, 0}, + {"SYS_RCTL_REMOVE_RULE", Const, 0}, + {"SYS_READ", Const, 0}, + {"SYS_READAHEAD", Const, 0}, + {"SYS_READDIR", Const, 0}, + {"SYS_READLINK", Const, 0}, + {"SYS_READLINKAT", Const, 0}, + {"SYS_READV", Const, 0}, + {"SYS_READV_NOCANCEL", Const, 0}, + {"SYS_READ_NOCANCEL", Const, 0}, + {"SYS_REBOOT", Const, 0}, + {"SYS_RECV", Const, 0}, + {"SYS_RECVFROM", Const, 0}, + {"SYS_RECVFROM_NOCANCEL", Const, 0}, + {"SYS_RECVMMSG", Const, 0}, + {"SYS_RECVMSG", Const, 0}, + {"SYS_RECVMSG_NOCANCEL", Const, 0}, + {"SYS_REMAP_FILE_PAGES", Const, 0}, + {"SYS_REMOVEXATTR", Const, 0}, + {"SYS_RENAME", Const, 0}, + {"SYS_RENAMEAT", Const, 0}, + {"SYS_REQUEST_KEY", Const, 0}, + {"SYS_RESTART_SYSCALL", Const, 0}, + {"SYS_REVOKE", Const, 0}, + {"SYS_RFORK", Const, 0}, + {"SYS_RMDIR", Const, 0}, + {"SYS_RTPRIO", Const, 0}, + {"SYS_RTPRIO_THREAD", Const, 0}, + {"SYS_RT_SIGACTION", Const, 0}, + {"SYS_RT_SIGPENDING", Const, 0}, + {"SYS_RT_SIGPROCMASK", Const, 0}, + {"SYS_RT_SIGQUEUEINFO", Const, 0}, + {"SYS_RT_SIGRETURN", Const, 0}, + {"SYS_RT_SIGSUSPEND", Const, 0}, + {"SYS_RT_SIGTIMEDWAIT", Const, 0}, + {"SYS_RT_TGSIGQUEUEINFO", Const, 0}, + {"SYS_SBRK", Const, 0}, + {"SYS_SCHED_GETAFFINITY", Const, 0}, + {"SYS_SCHED_GETPARAM", Const, 0}, + {"SYS_SCHED_GETSCHEDULER", Const, 0}, + {"SYS_SCHED_GET_PRIORITY_MAX", Const, 0}, + {"SYS_SCHED_GET_PRIORITY_MIN", Const, 0}, + {"SYS_SCHED_RR_GET_INTERVAL", Const, 0}, + {"SYS_SCHED_SETAFFINITY", Const, 0}, + {"SYS_SCHED_SETPARAM", Const, 0}, + {"SYS_SCHED_SETSCHEDULER", Const, 0}, + {"SYS_SCHED_YIELD", Const, 0}, + {"SYS_SCTP_GENERIC_RECVMSG", Const, 0}, + {"SYS_SCTP_GENERIC_SENDMSG", Const, 0}, + {"SYS_SCTP_GENERIC_SENDMSG_IOV", Const, 0}, + {"SYS_SCTP_PEELOFF", Const, 0}, + {"SYS_SEARCHFS", Const, 0}, + {"SYS_SECURITY", Const, 0}, + {"SYS_SELECT", Const, 0}, + {"SYS_SELECT_NOCANCEL", Const, 0}, + {"SYS_SEMCONFIG", Const, 1}, + {"SYS_SEMCTL", Const, 0}, + {"SYS_SEMGET", Const, 0}, + {"SYS_SEMOP", Const, 0}, + {"SYS_SEMSYS", Const, 0}, + {"SYS_SEMTIMEDOP", Const, 0}, + {"SYS_SEM_CLOSE", Const, 0}, + {"SYS_SEM_DESTROY", Const, 0}, + {"SYS_SEM_GETVALUE", Const, 0}, + {"SYS_SEM_INIT", Const, 0}, + {"SYS_SEM_OPEN", Const, 0}, + {"SYS_SEM_POST", Const, 0}, + {"SYS_SEM_TRYWAIT", Const, 0}, + {"SYS_SEM_UNLINK", Const, 0}, + {"SYS_SEM_WAIT", Const, 0}, + {"SYS_SEM_WAIT_NOCANCEL", Const, 0}, + {"SYS_SEND", Const, 0}, + {"SYS_SENDFILE", Const, 0}, + {"SYS_SENDFILE64", Const, 0}, + {"SYS_SENDMMSG", Const, 0}, + {"SYS_SENDMSG", Const, 0}, + {"SYS_SENDMSG_NOCANCEL", Const, 0}, + {"SYS_SENDTO", Const, 0}, + {"SYS_SENDTO_NOCANCEL", Const, 0}, + {"SYS_SETATTRLIST", Const, 0}, + {"SYS_SETAUDIT", Const, 0}, + {"SYS_SETAUDIT_ADDR", Const, 0}, + {"SYS_SETAUID", Const, 0}, + {"SYS_SETCONTEXT", Const, 0}, + {"SYS_SETDOMAINNAME", Const, 0}, + {"SYS_SETEGID", Const, 0}, + {"SYS_SETEUID", Const, 0}, + {"SYS_SETFIB", Const, 0}, + {"SYS_SETFSGID", Const, 0}, + {"SYS_SETFSGID32", Const, 0}, + {"SYS_SETFSUID", Const, 0}, + {"SYS_SETFSUID32", Const, 0}, + {"SYS_SETGID", Const, 0}, + {"SYS_SETGID32", Const, 0}, + {"SYS_SETGROUPS", Const, 0}, + {"SYS_SETGROUPS32", Const, 0}, + {"SYS_SETHOSTNAME", Const, 0}, + {"SYS_SETITIMER", Const, 0}, + {"SYS_SETLCID", Const, 0}, + {"SYS_SETLOGIN", Const, 0}, + {"SYS_SETLOGINCLASS", Const, 0}, + {"SYS_SETNS", Const, 0}, + {"SYS_SETPGID", Const, 0}, + {"SYS_SETPRIORITY", Const, 0}, + {"SYS_SETPRIVEXEC", Const, 0}, + {"SYS_SETREGID", Const, 0}, + {"SYS_SETREGID32", Const, 0}, + {"SYS_SETRESGID", Const, 0}, + {"SYS_SETRESGID32", Const, 0}, + {"SYS_SETRESUID", Const, 0}, + {"SYS_SETRESUID32", Const, 0}, + {"SYS_SETREUID", Const, 0}, + {"SYS_SETREUID32", Const, 0}, + {"SYS_SETRLIMIT", Const, 0}, + {"SYS_SETRTABLE", Const, 1}, + {"SYS_SETSGROUPS", Const, 0}, + {"SYS_SETSID", Const, 0}, + {"SYS_SETSOCKOPT", Const, 0}, + {"SYS_SETTID", Const, 0}, + {"SYS_SETTID_WITH_PID", Const, 0}, + {"SYS_SETTIMEOFDAY", Const, 0}, + {"SYS_SETUID", Const, 0}, + {"SYS_SETUID32", Const, 0}, + {"SYS_SETWGROUPS", Const, 0}, + {"SYS_SETXATTR", Const, 0}, + {"SYS_SET_MEMPOLICY", Const, 0}, + {"SYS_SET_ROBUST_LIST", Const, 0}, + {"SYS_SET_THREAD_AREA", Const, 0}, + {"SYS_SET_TID_ADDRESS", Const, 0}, + {"SYS_SGETMASK", Const, 0}, + {"SYS_SHARED_REGION_CHECK_NP", Const, 0}, + {"SYS_SHARED_REGION_MAP_AND_SLIDE_NP", Const, 0}, + {"SYS_SHMAT", Const, 0}, + {"SYS_SHMCTL", Const, 0}, + {"SYS_SHMDT", Const, 0}, + {"SYS_SHMGET", Const, 0}, + {"SYS_SHMSYS", Const, 0}, + {"SYS_SHM_OPEN", Const, 0}, + {"SYS_SHM_UNLINK", Const, 0}, + {"SYS_SHUTDOWN", Const, 0}, + {"SYS_SIGACTION", Const, 0}, + {"SYS_SIGALTSTACK", Const, 0}, + {"SYS_SIGNAL", Const, 0}, + {"SYS_SIGNALFD", Const, 0}, + {"SYS_SIGNALFD4", Const, 0}, + {"SYS_SIGPENDING", Const, 0}, + {"SYS_SIGPROCMASK", Const, 0}, + {"SYS_SIGQUEUE", Const, 0}, + {"SYS_SIGQUEUEINFO", Const, 1}, + {"SYS_SIGRETURN", Const, 0}, + {"SYS_SIGSUSPEND", Const, 0}, + {"SYS_SIGSUSPEND_NOCANCEL", Const, 0}, + {"SYS_SIGTIMEDWAIT", Const, 0}, + {"SYS_SIGWAIT", Const, 0}, + {"SYS_SIGWAITINFO", Const, 0}, + {"SYS_SOCKET", Const, 0}, + {"SYS_SOCKETCALL", Const, 0}, + {"SYS_SOCKETPAIR", Const, 0}, + {"SYS_SPLICE", Const, 0}, + {"SYS_SSETMASK", Const, 0}, + {"SYS_SSTK", Const, 0}, + {"SYS_STACK_SNAPSHOT", Const, 0}, + {"SYS_STAT", Const, 0}, + {"SYS_STAT64", Const, 0}, + {"SYS_STAT64_EXTENDED", Const, 0}, + {"SYS_STATFS", Const, 0}, + {"SYS_STATFS64", Const, 0}, + {"SYS_STATV", Const, 0}, + {"SYS_STATVFS1", Const, 1}, + {"SYS_STAT_EXTENDED", Const, 0}, + {"SYS_STIME", Const, 0}, + {"SYS_STTY", Const, 0}, + {"SYS_SWAPCONTEXT", Const, 0}, + {"SYS_SWAPCTL", Const, 1}, + {"SYS_SWAPOFF", Const, 0}, + {"SYS_SWAPON", Const, 0}, + {"SYS_SYMLINK", Const, 0}, + {"SYS_SYMLINKAT", Const, 0}, + {"SYS_SYNC", Const, 0}, + {"SYS_SYNCFS", Const, 0}, + {"SYS_SYNC_FILE_RANGE", Const, 0}, + {"SYS_SYSARCH", Const, 0}, + {"SYS_SYSCALL", Const, 0}, + {"SYS_SYSCALL_BASE", Const, 0}, + {"SYS_SYSFS", Const, 0}, + {"SYS_SYSINFO", Const, 0}, + {"SYS_SYSLOG", Const, 0}, + {"SYS_TEE", Const, 0}, + {"SYS_TGKILL", Const, 0}, + {"SYS_THREAD_SELFID", Const, 0}, + {"SYS_THR_CREATE", Const, 0}, + {"SYS_THR_EXIT", Const, 0}, + {"SYS_THR_KILL", Const, 0}, + {"SYS_THR_KILL2", Const, 0}, + {"SYS_THR_NEW", Const, 0}, + {"SYS_THR_SELF", Const, 0}, + {"SYS_THR_SET_NAME", Const, 0}, + {"SYS_THR_SUSPEND", Const, 0}, + {"SYS_THR_WAKE", Const, 0}, + {"SYS_TIME", Const, 0}, + {"SYS_TIMERFD_CREATE", Const, 0}, + {"SYS_TIMERFD_GETTIME", Const, 0}, + {"SYS_TIMERFD_SETTIME", Const, 0}, + {"SYS_TIMER_CREATE", Const, 0}, + {"SYS_TIMER_DELETE", Const, 0}, + {"SYS_TIMER_GETOVERRUN", Const, 0}, + {"SYS_TIMER_GETTIME", Const, 0}, + {"SYS_TIMER_SETTIME", Const, 0}, + {"SYS_TIMES", Const, 0}, + {"SYS_TKILL", Const, 0}, + {"SYS_TRUNCATE", Const, 0}, + {"SYS_TRUNCATE64", Const, 0}, + {"SYS_TUXCALL", Const, 0}, + {"SYS_UGETRLIMIT", Const, 0}, + {"SYS_ULIMIT", Const, 0}, + {"SYS_UMASK", Const, 0}, + {"SYS_UMASK_EXTENDED", Const, 0}, + {"SYS_UMOUNT", Const, 0}, + {"SYS_UMOUNT2", Const, 0}, + {"SYS_UNAME", Const, 0}, + {"SYS_UNDELETE", Const, 0}, + {"SYS_UNLINK", Const, 0}, + {"SYS_UNLINKAT", Const, 0}, + {"SYS_UNMOUNT", Const, 0}, + {"SYS_UNSHARE", Const, 0}, + {"SYS_USELIB", Const, 0}, + {"SYS_USTAT", Const, 0}, + {"SYS_UTIME", Const, 0}, + {"SYS_UTIMENSAT", Const, 0}, + {"SYS_UTIMES", Const, 0}, + {"SYS_UTRACE", Const, 0}, + {"SYS_UUIDGEN", Const, 0}, + {"SYS_VADVISE", Const, 1}, + {"SYS_VFORK", Const, 0}, + {"SYS_VHANGUP", Const, 0}, + {"SYS_VM86", Const, 0}, + {"SYS_VM86OLD", Const, 0}, + {"SYS_VMSPLICE", Const, 0}, + {"SYS_VM_PRESSURE_MONITOR", Const, 0}, + {"SYS_VSERVER", Const, 0}, + {"SYS_WAIT4", Const, 0}, + {"SYS_WAIT4_NOCANCEL", Const, 0}, + {"SYS_WAIT6", Const, 1}, + {"SYS_WAITEVENT", Const, 0}, + {"SYS_WAITID", Const, 0}, + {"SYS_WAITID_NOCANCEL", Const, 0}, + {"SYS_WAITPID", Const, 0}, + {"SYS_WATCHEVENT", Const, 0}, + {"SYS_WORKQ_KERNRETURN", Const, 0}, + {"SYS_WORKQ_OPEN", Const, 0}, + {"SYS_WRITE", Const, 0}, + {"SYS_WRITEV", Const, 0}, + {"SYS_WRITEV_NOCANCEL", Const, 0}, + {"SYS_WRITE_NOCANCEL", Const, 0}, + {"SYS_YIELD", Const, 0}, + {"SYS__LLSEEK", Const, 0}, + {"SYS__LWP_CONTINUE", Const, 1}, + {"SYS__LWP_CREATE", Const, 1}, + {"SYS__LWP_CTL", Const, 1}, + {"SYS__LWP_DETACH", Const, 1}, + {"SYS__LWP_EXIT", Const, 1}, + {"SYS__LWP_GETNAME", Const, 1}, + {"SYS__LWP_GETPRIVATE", Const, 1}, + {"SYS__LWP_KILL", Const, 1}, + {"SYS__LWP_PARK", Const, 1}, + {"SYS__LWP_SELF", Const, 1}, + {"SYS__LWP_SETNAME", Const, 1}, + {"SYS__LWP_SETPRIVATE", Const, 1}, + {"SYS__LWP_SUSPEND", Const, 1}, + {"SYS__LWP_UNPARK", Const, 1}, + {"SYS__LWP_UNPARK_ALL", Const, 1}, + {"SYS__LWP_WAIT", Const, 1}, + {"SYS__LWP_WAKEUP", Const, 1}, + {"SYS__NEWSELECT", Const, 0}, + {"SYS__PSET_BIND", Const, 1}, + {"SYS__SCHED_GETAFFINITY", Const, 1}, + {"SYS__SCHED_GETPARAM", Const, 1}, + {"SYS__SCHED_SETAFFINITY", Const, 1}, + {"SYS__SCHED_SETPARAM", Const, 1}, + {"SYS__SYSCTL", Const, 0}, + {"SYS__UMTX_LOCK", Const, 0}, + {"SYS__UMTX_OP", Const, 0}, + {"SYS__UMTX_UNLOCK", Const, 0}, + {"SYS___ACL_ACLCHECK_FD", Const, 0}, + {"SYS___ACL_ACLCHECK_FILE", Const, 0}, + {"SYS___ACL_ACLCHECK_LINK", Const, 0}, + {"SYS___ACL_DELETE_FD", Const, 0}, + {"SYS___ACL_DELETE_FILE", Const, 0}, + {"SYS___ACL_DELETE_LINK", Const, 0}, + {"SYS___ACL_GET_FD", Const, 0}, + {"SYS___ACL_GET_FILE", Const, 0}, + {"SYS___ACL_GET_LINK", Const, 0}, + {"SYS___ACL_SET_FD", Const, 0}, + {"SYS___ACL_SET_FILE", Const, 0}, + {"SYS___ACL_SET_LINK", Const, 0}, + {"SYS___CAP_RIGHTS_GET", Const, 14}, + {"SYS___CLONE", Const, 1}, + {"SYS___DISABLE_THREADSIGNAL", Const, 0}, + {"SYS___GETCWD", Const, 0}, + {"SYS___GETLOGIN", Const, 1}, + {"SYS___GET_TCB", Const, 1}, + {"SYS___MAC_EXECVE", Const, 0}, + {"SYS___MAC_GETFSSTAT", Const, 0}, + {"SYS___MAC_GET_FD", Const, 0}, + {"SYS___MAC_GET_FILE", Const, 0}, + {"SYS___MAC_GET_LCID", Const, 0}, + {"SYS___MAC_GET_LCTX", Const, 0}, + {"SYS___MAC_GET_LINK", Const, 0}, + {"SYS___MAC_GET_MOUNT", Const, 0}, + {"SYS___MAC_GET_PID", Const, 0}, + {"SYS___MAC_GET_PROC", Const, 0}, + {"SYS___MAC_MOUNT", Const, 0}, + {"SYS___MAC_SET_FD", Const, 0}, + {"SYS___MAC_SET_FILE", Const, 0}, + {"SYS___MAC_SET_LCTX", Const, 0}, + {"SYS___MAC_SET_LINK", Const, 0}, + {"SYS___MAC_SET_PROC", Const, 0}, + {"SYS___MAC_SYSCALL", Const, 0}, + {"SYS___OLD_SEMWAIT_SIGNAL", Const, 0}, + {"SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL", Const, 0}, + {"SYS___POSIX_CHOWN", Const, 1}, + {"SYS___POSIX_FCHOWN", Const, 1}, + {"SYS___POSIX_LCHOWN", Const, 1}, + {"SYS___POSIX_RENAME", Const, 1}, + {"SYS___PTHREAD_CANCELED", Const, 0}, + {"SYS___PTHREAD_CHDIR", Const, 0}, + {"SYS___PTHREAD_FCHDIR", Const, 0}, + {"SYS___PTHREAD_KILL", Const, 0}, + {"SYS___PTHREAD_MARKCANCEL", Const, 0}, + {"SYS___PTHREAD_SIGMASK", Const, 0}, + {"SYS___QUOTACTL", Const, 1}, + {"SYS___SEMCTL", Const, 1}, + {"SYS___SEMWAIT_SIGNAL", Const, 0}, + {"SYS___SEMWAIT_SIGNAL_NOCANCEL", Const, 0}, + {"SYS___SETLOGIN", Const, 1}, + {"SYS___SETUGID", Const, 0}, + {"SYS___SET_TCB", Const, 1}, + {"SYS___SIGACTION_SIGTRAMP", Const, 1}, + {"SYS___SIGTIMEDWAIT", Const, 1}, + {"SYS___SIGWAIT", Const, 0}, + {"SYS___SIGWAIT_NOCANCEL", Const, 0}, + {"SYS___SYSCTL", Const, 0}, + {"SYS___TFORK", Const, 1}, + {"SYS___THREXIT", Const, 1}, + {"SYS___THRSIGDIVERT", Const, 1}, + {"SYS___THRSLEEP", Const, 1}, + {"SYS___THRWAKEUP", Const, 1}, + {"S_ARCH1", Const, 1}, + {"S_ARCH2", Const, 1}, + {"S_BLKSIZE", Const, 0}, + {"S_IEXEC", Const, 0}, + {"S_IFBLK", Const, 0}, + {"S_IFCHR", Const, 0}, + {"S_IFDIR", Const, 0}, + {"S_IFIFO", Const, 0}, + {"S_IFLNK", Const, 0}, + {"S_IFMT", Const, 0}, + {"S_IFREG", Const, 0}, + {"S_IFSOCK", Const, 0}, + {"S_IFWHT", Const, 0}, + {"S_IREAD", Const, 0}, + {"S_IRGRP", Const, 0}, + {"S_IROTH", Const, 0}, + {"S_IRUSR", Const, 0}, + {"S_IRWXG", Const, 0}, + {"S_IRWXO", Const, 0}, + {"S_IRWXU", Const, 0}, + {"S_ISGID", Const, 0}, + {"S_ISTXT", Const, 0}, + {"S_ISUID", Const, 0}, + {"S_ISVTX", Const, 0}, + {"S_IWGRP", Const, 0}, + {"S_IWOTH", Const, 0}, + {"S_IWRITE", Const, 0}, + {"S_IWUSR", Const, 0}, + {"S_IXGRP", Const, 0}, + {"S_IXOTH", Const, 0}, + {"S_IXUSR", Const, 0}, + {"S_LOGIN_SET", Const, 1}, + {"SecurityAttributes", Type, 0}, + {"SecurityAttributes.InheritHandle", Field, 0}, + {"SecurityAttributes.Length", Field, 0}, + {"SecurityAttributes.SecurityDescriptor", Field, 0}, + {"Seek", Func, 0}, + {"Select", Func, 0}, + {"Sendfile", Func, 0}, + {"Sendmsg", Func, 0}, + {"SendmsgN", Func, 3}, + {"Sendto", Func, 0}, + {"Servent", Type, 0}, + {"Servent.Aliases", Field, 0}, + {"Servent.Name", Field, 0}, + {"Servent.Port", Field, 0}, + {"Servent.Proto", Field, 0}, + {"SetBpf", Func, 0}, + {"SetBpfBuflen", Func, 0}, + {"SetBpfDatalink", Func, 0}, + {"SetBpfHeadercmpl", Func, 0}, + {"SetBpfImmediate", Func, 0}, + {"SetBpfInterface", Func, 0}, + {"SetBpfPromisc", Func, 0}, + {"SetBpfTimeout", Func, 0}, + {"SetCurrentDirectory", Func, 0}, + {"SetEndOfFile", Func, 0}, + {"SetEnvironmentVariable", Func, 0}, + {"SetFileAttributes", Func, 0}, + {"SetFileCompletionNotificationModes", Func, 2}, + {"SetFilePointer", Func, 0}, + {"SetFileTime", Func, 0}, + {"SetHandleInformation", Func, 0}, + {"SetKevent", Func, 0}, + {"SetLsfPromisc", Func, 0}, + {"SetNonblock", Func, 0}, + {"Setdomainname", Func, 0}, + {"Setegid", Func, 0}, + {"Setenv", Func, 0}, + {"Seteuid", Func, 0}, + {"Setfsgid", Func, 0}, + {"Setfsuid", Func, 0}, + {"Setgid", Func, 0}, + {"Setgroups", Func, 0}, + {"Sethostname", Func, 0}, + {"Setlogin", Func, 0}, + {"Setpgid", Func, 0}, + {"Setpriority", Func, 0}, + {"Setprivexec", Func, 0}, + {"Setregid", Func, 0}, + {"Setresgid", Func, 0}, + {"Setresuid", Func, 0}, + {"Setreuid", Func, 0}, + {"Setrlimit", Func, 0}, + {"Setsid", Func, 0}, + {"Setsockopt", Func, 0}, + {"SetsockoptByte", Func, 0}, + {"SetsockoptICMPv6Filter", Func, 2}, + {"SetsockoptIPMreq", Func, 0}, + {"SetsockoptIPMreqn", Func, 0}, + {"SetsockoptIPv6Mreq", Func, 0}, + {"SetsockoptInet4Addr", Func, 0}, + {"SetsockoptInt", Func, 0}, + {"SetsockoptLinger", Func, 0}, + {"SetsockoptString", Func, 0}, + {"SetsockoptTimeval", Func, 0}, + {"Settimeofday", Func, 0}, + {"Setuid", Func, 0}, + {"Setxattr", Func, 1}, + {"Shutdown", Func, 0}, + {"SidTypeAlias", Const, 0}, + {"SidTypeComputer", Const, 0}, + {"SidTypeDeletedAccount", Const, 0}, + {"SidTypeDomain", Const, 0}, + {"SidTypeGroup", Const, 0}, + {"SidTypeInvalid", Const, 0}, + {"SidTypeLabel", Const, 0}, + {"SidTypeUnknown", Const, 0}, + {"SidTypeUser", Const, 0}, + {"SidTypeWellKnownGroup", Const, 0}, + {"Signal", Type, 0}, + {"SizeofBpfHdr", Const, 0}, + {"SizeofBpfInsn", Const, 0}, + {"SizeofBpfProgram", Const, 0}, + {"SizeofBpfStat", Const, 0}, + {"SizeofBpfVersion", Const, 0}, + {"SizeofBpfZbuf", Const, 0}, + {"SizeofBpfZbufHeader", Const, 0}, + {"SizeofCmsghdr", Const, 0}, + {"SizeofICMPv6Filter", Const, 2}, + {"SizeofIPMreq", Const, 0}, + {"SizeofIPMreqn", Const, 0}, + {"SizeofIPv6MTUInfo", Const, 2}, + {"SizeofIPv6Mreq", Const, 0}, + {"SizeofIfAddrmsg", Const, 0}, + {"SizeofIfAnnounceMsghdr", Const, 1}, + {"SizeofIfData", Const, 0}, + {"SizeofIfInfomsg", Const, 0}, + {"SizeofIfMsghdr", Const, 0}, + {"SizeofIfaMsghdr", Const, 0}, + {"SizeofIfmaMsghdr", Const, 0}, + {"SizeofIfmaMsghdr2", Const, 0}, + {"SizeofInet4Pktinfo", Const, 0}, + {"SizeofInet6Pktinfo", Const, 0}, + {"SizeofInotifyEvent", Const, 0}, + {"SizeofLinger", Const, 0}, + {"SizeofMsghdr", Const, 0}, + {"SizeofNlAttr", Const, 0}, + {"SizeofNlMsgerr", Const, 0}, + {"SizeofNlMsghdr", Const, 0}, + {"SizeofRtAttr", Const, 0}, + {"SizeofRtGenmsg", Const, 0}, + {"SizeofRtMetrics", Const, 0}, + {"SizeofRtMsg", Const, 0}, + {"SizeofRtMsghdr", Const, 0}, + {"SizeofRtNexthop", Const, 0}, + {"SizeofSockFilter", Const, 0}, + {"SizeofSockFprog", Const, 0}, + {"SizeofSockaddrAny", Const, 0}, + {"SizeofSockaddrDatalink", Const, 0}, + {"SizeofSockaddrInet4", Const, 0}, + {"SizeofSockaddrInet6", Const, 0}, + {"SizeofSockaddrLinklayer", Const, 0}, + {"SizeofSockaddrNetlink", Const, 0}, + {"SizeofSockaddrUnix", Const, 0}, + {"SizeofTCPInfo", Const, 1}, + {"SizeofUcred", Const, 0}, + {"SlicePtrFromStrings", Func, 1}, + {"SockFilter", Type, 0}, + {"SockFilter.Code", Field, 0}, + {"SockFilter.Jf", Field, 0}, + {"SockFilter.Jt", Field, 0}, + {"SockFilter.K", Field, 0}, + {"SockFprog", Type, 0}, + {"SockFprog.Filter", Field, 0}, + {"SockFprog.Len", Field, 0}, + {"SockFprog.Pad_cgo_0", Field, 0}, + {"Sockaddr", Type, 0}, + {"SockaddrDatalink", Type, 0}, + {"SockaddrDatalink.Alen", Field, 0}, + {"SockaddrDatalink.Data", Field, 0}, + {"SockaddrDatalink.Family", Field, 0}, + {"SockaddrDatalink.Index", Field, 0}, + {"SockaddrDatalink.Len", Field, 0}, + {"SockaddrDatalink.Nlen", Field, 0}, + {"SockaddrDatalink.Slen", Field, 0}, + {"SockaddrDatalink.Type", Field, 0}, + {"SockaddrGen", Type, 0}, + {"SockaddrInet4", Type, 0}, + {"SockaddrInet4.Addr", Field, 0}, + {"SockaddrInet4.Port", Field, 0}, + {"SockaddrInet6", Type, 0}, + {"SockaddrInet6.Addr", Field, 0}, + {"SockaddrInet6.Port", Field, 0}, + {"SockaddrInet6.ZoneId", Field, 0}, + {"SockaddrLinklayer", Type, 0}, + {"SockaddrLinklayer.Addr", Field, 0}, + {"SockaddrLinklayer.Halen", Field, 0}, + {"SockaddrLinklayer.Hatype", Field, 0}, + {"SockaddrLinklayer.Ifindex", Field, 0}, + {"SockaddrLinklayer.Pkttype", Field, 0}, + {"SockaddrLinklayer.Protocol", Field, 0}, + {"SockaddrNetlink", Type, 0}, + {"SockaddrNetlink.Family", Field, 0}, + {"SockaddrNetlink.Groups", Field, 0}, + {"SockaddrNetlink.Pad", Field, 0}, + {"SockaddrNetlink.Pid", Field, 0}, + {"SockaddrUnix", Type, 0}, + {"SockaddrUnix.Name", Field, 0}, + {"Socket", Func, 0}, + {"SocketControlMessage", Type, 0}, + {"SocketControlMessage.Data", Field, 0}, + {"SocketControlMessage.Header", Field, 0}, + {"SocketDisableIPv6", Var, 0}, + {"Socketpair", Func, 0}, + {"Splice", Func, 0}, + {"StartProcess", Func, 0}, + {"StartupInfo", Type, 0}, + {"StartupInfo.Cb", Field, 0}, + {"StartupInfo.Desktop", Field, 0}, + {"StartupInfo.FillAttribute", Field, 0}, + {"StartupInfo.Flags", Field, 0}, + {"StartupInfo.ShowWindow", Field, 0}, + {"StartupInfo.StdErr", Field, 0}, + {"StartupInfo.StdInput", Field, 0}, + {"StartupInfo.StdOutput", Field, 0}, + {"StartupInfo.Title", Field, 0}, + {"StartupInfo.X", Field, 0}, + {"StartupInfo.XCountChars", Field, 0}, + {"StartupInfo.XSize", Field, 0}, + {"StartupInfo.Y", Field, 0}, + {"StartupInfo.YCountChars", Field, 0}, + {"StartupInfo.YSize", Field, 0}, + {"Stat", Func, 0}, + {"Stat_t", Type, 0}, + {"Stat_t.Atim", Field, 0}, + {"Stat_t.Atim_ext", Field, 12}, + {"Stat_t.Atimespec", Field, 0}, + {"Stat_t.Birthtimespec", Field, 0}, + {"Stat_t.Blksize", Field, 0}, + {"Stat_t.Blocks", Field, 0}, + {"Stat_t.Btim_ext", Field, 12}, + {"Stat_t.Ctim", Field, 0}, + {"Stat_t.Ctim_ext", Field, 12}, + {"Stat_t.Ctimespec", Field, 0}, + {"Stat_t.Dev", Field, 0}, + {"Stat_t.Flags", Field, 0}, + {"Stat_t.Gen", Field, 0}, + {"Stat_t.Gid", Field, 0}, + {"Stat_t.Ino", Field, 0}, + {"Stat_t.Lspare", Field, 0}, + {"Stat_t.Lspare0", Field, 2}, + {"Stat_t.Lspare1", Field, 2}, + {"Stat_t.Mode", Field, 0}, + {"Stat_t.Mtim", Field, 0}, + {"Stat_t.Mtim_ext", Field, 12}, + {"Stat_t.Mtimespec", Field, 0}, + {"Stat_t.Nlink", Field, 0}, + {"Stat_t.Pad_cgo_0", Field, 0}, + {"Stat_t.Pad_cgo_1", Field, 0}, + {"Stat_t.Pad_cgo_2", Field, 0}, + {"Stat_t.Padding0", Field, 12}, + {"Stat_t.Padding1", Field, 12}, + {"Stat_t.Qspare", Field, 0}, + {"Stat_t.Rdev", Field, 0}, + {"Stat_t.Size", Field, 0}, + {"Stat_t.Spare", Field, 2}, + {"Stat_t.Uid", Field, 0}, + {"Stat_t.X__pad0", Field, 0}, + {"Stat_t.X__pad1", Field, 0}, + {"Stat_t.X__pad2", Field, 0}, + {"Stat_t.X__st_birthtim", Field, 2}, + {"Stat_t.X__st_ino", Field, 0}, + {"Stat_t.X__unused", Field, 0}, + {"Statfs", Func, 0}, + {"Statfs_t", Type, 0}, + {"Statfs_t.Asyncreads", Field, 0}, + {"Statfs_t.Asyncwrites", Field, 0}, + {"Statfs_t.Bavail", Field, 0}, + {"Statfs_t.Bfree", Field, 0}, + {"Statfs_t.Blocks", Field, 0}, + {"Statfs_t.Bsize", Field, 0}, + {"Statfs_t.Charspare", Field, 0}, + {"Statfs_t.F_asyncreads", Field, 2}, + {"Statfs_t.F_asyncwrites", Field, 2}, + {"Statfs_t.F_bavail", Field, 2}, + {"Statfs_t.F_bfree", Field, 2}, + {"Statfs_t.F_blocks", Field, 2}, + {"Statfs_t.F_bsize", Field, 2}, + {"Statfs_t.F_ctime", Field, 2}, + {"Statfs_t.F_favail", Field, 2}, + {"Statfs_t.F_ffree", Field, 2}, + {"Statfs_t.F_files", Field, 2}, + {"Statfs_t.F_flags", Field, 2}, + {"Statfs_t.F_fsid", Field, 2}, + {"Statfs_t.F_fstypename", Field, 2}, + {"Statfs_t.F_iosize", Field, 2}, + {"Statfs_t.F_mntfromname", Field, 2}, + {"Statfs_t.F_mntfromspec", Field, 3}, + {"Statfs_t.F_mntonname", Field, 2}, + {"Statfs_t.F_namemax", Field, 2}, + {"Statfs_t.F_owner", Field, 2}, + {"Statfs_t.F_spare", Field, 2}, + {"Statfs_t.F_syncreads", Field, 2}, + {"Statfs_t.F_syncwrites", Field, 2}, + {"Statfs_t.Ffree", Field, 0}, + {"Statfs_t.Files", Field, 0}, + {"Statfs_t.Flags", Field, 0}, + {"Statfs_t.Frsize", Field, 0}, + {"Statfs_t.Fsid", Field, 0}, + {"Statfs_t.Fssubtype", Field, 0}, + {"Statfs_t.Fstypename", Field, 0}, + {"Statfs_t.Iosize", Field, 0}, + {"Statfs_t.Mntfromname", Field, 0}, + {"Statfs_t.Mntonname", Field, 0}, + {"Statfs_t.Mount_info", Field, 2}, + {"Statfs_t.Namelen", Field, 0}, + {"Statfs_t.Namemax", Field, 0}, + {"Statfs_t.Owner", Field, 0}, + {"Statfs_t.Pad_cgo_0", Field, 0}, + {"Statfs_t.Pad_cgo_1", Field, 2}, + {"Statfs_t.Reserved", Field, 0}, + {"Statfs_t.Spare", Field, 0}, + {"Statfs_t.Syncreads", Field, 0}, + {"Statfs_t.Syncwrites", Field, 0}, + {"Statfs_t.Type", Field, 0}, + {"Statfs_t.Version", Field, 0}, + {"Stderr", Var, 0}, + {"Stdin", Var, 0}, + {"Stdout", Var, 0}, + {"StringBytePtr", Func, 0}, + {"StringByteSlice", Func, 0}, + {"StringSlicePtr", Func, 0}, + {"StringToSid", Func, 0}, + {"StringToUTF16", Func, 0}, + {"StringToUTF16Ptr", Func, 0}, + {"Symlink", Func, 0}, + {"Sync", Func, 0}, + {"SyncFileRange", Func, 0}, + {"SysProcAttr", Type, 0}, + {"SysProcAttr.AdditionalInheritedHandles", Field, 17}, + {"SysProcAttr.AmbientCaps", Field, 9}, + {"SysProcAttr.CgroupFD", Field, 20}, + {"SysProcAttr.Chroot", Field, 0}, + {"SysProcAttr.Cloneflags", Field, 2}, + {"SysProcAttr.CmdLine", Field, 0}, + {"SysProcAttr.CreationFlags", Field, 1}, + {"SysProcAttr.Credential", Field, 0}, + {"SysProcAttr.Ctty", Field, 1}, + {"SysProcAttr.Foreground", Field, 5}, + {"SysProcAttr.GidMappings", Field, 4}, + {"SysProcAttr.GidMappingsEnableSetgroups", Field, 5}, + {"SysProcAttr.HideWindow", Field, 0}, + {"SysProcAttr.Jail", Field, 21}, + {"SysProcAttr.NoInheritHandles", Field, 16}, + {"SysProcAttr.Noctty", Field, 0}, + {"SysProcAttr.ParentProcess", Field, 17}, + {"SysProcAttr.Pdeathsig", Field, 0}, + {"SysProcAttr.Pgid", Field, 5}, + {"SysProcAttr.PidFD", Field, 22}, + {"SysProcAttr.ProcessAttributes", Field, 13}, + {"SysProcAttr.Ptrace", Field, 0}, + {"SysProcAttr.Setctty", Field, 0}, + {"SysProcAttr.Setpgid", Field, 0}, + {"SysProcAttr.Setsid", Field, 0}, + {"SysProcAttr.ThreadAttributes", Field, 13}, + {"SysProcAttr.Token", Field, 10}, + {"SysProcAttr.UidMappings", Field, 4}, + {"SysProcAttr.Unshareflags", Field, 7}, + {"SysProcAttr.UseCgroupFD", Field, 20}, + {"SysProcIDMap", Type, 4}, + {"SysProcIDMap.ContainerID", Field, 4}, + {"SysProcIDMap.HostID", Field, 4}, + {"SysProcIDMap.Size", Field, 4}, + {"Syscall", Func, 0}, + {"Syscall12", Func, 0}, + {"Syscall15", Func, 0}, + {"Syscall18", Func, 12}, + {"Syscall6", Func, 0}, + {"Syscall9", Func, 0}, + {"SyscallN", Func, 18}, + {"Sysctl", Func, 0}, + {"SysctlUint32", Func, 0}, + {"Sysctlnode", Type, 2}, + {"Sysctlnode.Flags", Field, 2}, + {"Sysctlnode.Name", Field, 2}, + {"Sysctlnode.Num", Field, 2}, + {"Sysctlnode.Un", Field, 2}, + {"Sysctlnode.Ver", Field, 2}, + {"Sysctlnode.X__rsvd", Field, 2}, + {"Sysctlnode.X_sysctl_desc", Field, 2}, + {"Sysctlnode.X_sysctl_func", Field, 2}, + {"Sysctlnode.X_sysctl_parent", Field, 2}, + {"Sysctlnode.X_sysctl_size", Field, 2}, + {"Sysinfo", Func, 0}, + {"Sysinfo_t", Type, 0}, + {"Sysinfo_t.Bufferram", Field, 0}, + {"Sysinfo_t.Freehigh", Field, 0}, + {"Sysinfo_t.Freeram", Field, 0}, + {"Sysinfo_t.Freeswap", Field, 0}, + {"Sysinfo_t.Loads", Field, 0}, + {"Sysinfo_t.Pad", Field, 0}, + {"Sysinfo_t.Pad_cgo_0", Field, 0}, + {"Sysinfo_t.Pad_cgo_1", Field, 0}, + {"Sysinfo_t.Procs", Field, 0}, + {"Sysinfo_t.Sharedram", Field, 0}, + {"Sysinfo_t.Totalhigh", Field, 0}, + {"Sysinfo_t.Totalram", Field, 0}, + {"Sysinfo_t.Totalswap", Field, 0}, + {"Sysinfo_t.Unit", Field, 0}, + {"Sysinfo_t.Uptime", Field, 0}, + {"Sysinfo_t.X_f", Field, 0}, + {"Systemtime", Type, 0}, + {"Systemtime.Day", Field, 0}, + {"Systemtime.DayOfWeek", Field, 0}, + {"Systemtime.Hour", Field, 0}, + {"Systemtime.Milliseconds", Field, 0}, + {"Systemtime.Minute", Field, 0}, + {"Systemtime.Month", Field, 0}, + {"Systemtime.Second", Field, 0}, + {"Systemtime.Year", Field, 0}, + {"TCGETS", Const, 0}, + {"TCIFLUSH", Const, 1}, + {"TCIOFLUSH", Const, 1}, + {"TCOFLUSH", Const, 1}, + {"TCPInfo", Type, 1}, + {"TCPInfo.Advmss", Field, 1}, + {"TCPInfo.Ato", Field, 1}, + {"TCPInfo.Backoff", Field, 1}, + {"TCPInfo.Ca_state", Field, 1}, + {"TCPInfo.Fackets", Field, 1}, + {"TCPInfo.Last_ack_recv", Field, 1}, + {"TCPInfo.Last_ack_sent", Field, 1}, + {"TCPInfo.Last_data_recv", Field, 1}, + {"TCPInfo.Last_data_sent", Field, 1}, + {"TCPInfo.Lost", Field, 1}, + {"TCPInfo.Options", Field, 1}, + {"TCPInfo.Pad_cgo_0", Field, 1}, + {"TCPInfo.Pmtu", Field, 1}, + {"TCPInfo.Probes", Field, 1}, + {"TCPInfo.Rcv_mss", Field, 1}, + {"TCPInfo.Rcv_rtt", Field, 1}, + {"TCPInfo.Rcv_space", Field, 1}, + {"TCPInfo.Rcv_ssthresh", Field, 1}, + {"TCPInfo.Reordering", Field, 1}, + {"TCPInfo.Retrans", Field, 1}, + {"TCPInfo.Retransmits", Field, 1}, + {"TCPInfo.Rto", Field, 1}, + {"TCPInfo.Rtt", Field, 1}, + {"TCPInfo.Rttvar", Field, 1}, + {"TCPInfo.Sacked", Field, 1}, + {"TCPInfo.Snd_cwnd", Field, 1}, + {"TCPInfo.Snd_mss", Field, 1}, + {"TCPInfo.Snd_ssthresh", Field, 1}, + {"TCPInfo.State", Field, 1}, + {"TCPInfo.Total_retrans", Field, 1}, + {"TCPInfo.Unacked", Field, 1}, + {"TCPKeepalive", Type, 3}, + {"TCPKeepalive.Interval", Field, 3}, + {"TCPKeepalive.OnOff", Field, 3}, + {"TCPKeepalive.Time", Field, 3}, + {"TCP_CA_NAME_MAX", Const, 0}, + {"TCP_CONGCTL", Const, 1}, + {"TCP_CONGESTION", Const, 0}, + {"TCP_CONNECTIONTIMEOUT", Const, 0}, + {"TCP_CORK", Const, 0}, + {"TCP_DEFER_ACCEPT", Const, 0}, + {"TCP_ENABLE_ECN", Const, 16}, + {"TCP_INFO", Const, 0}, + {"TCP_KEEPALIVE", Const, 0}, + {"TCP_KEEPCNT", Const, 0}, + {"TCP_KEEPIDLE", Const, 0}, + {"TCP_KEEPINIT", Const, 1}, + {"TCP_KEEPINTVL", Const, 0}, + {"TCP_LINGER2", Const, 0}, + {"TCP_MAXBURST", Const, 0}, + {"TCP_MAXHLEN", Const, 0}, + {"TCP_MAXOLEN", Const, 0}, + {"TCP_MAXSEG", Const, 0}, + {"TCP_MAXWIN", Const, 0}, + {"TCP_MAX_SACK", Const, 0}, + {"TCP_MAX_WINSHIFT", Const, 0}, + {"TCP_MD5SIG", Const, 0}, + {"TCP_MD5SIG_MAXKEYLEN", Const, 0}, + {"TCP_MINMSS", Const, 0}, + {"TCP_MINMSSOVERLOAD", Const, 0}, + {"TCP_MSS", Const, 0}, + {"TCP_NODELAY", Const, 0}, + {"TCP_NOOPT", Const, 0}, + {"TCP_NOPUSH", Const, 0}, + {"TCP_NOTSENT_LOWAT", Const, 16}, + {"TCP_NSTATES", Const, 1}, + {"TCP_QUICKACK", Const, 0}, + {"TCP_RXT_CONNDROPTIME", Const, 0}, + {"TCP_RXT_FINDROP", Const, 0}, + {"TCP_SACK_ENABLE", Const, 1}, + {"TCP_SENDMOREACKS", Const, 16}, + {"TCP_SYNCNT", Const, 0}, + {"TCP_VENDOR", Const, 3}, + {"TCP_WINDOW_CLAMP", Const, 0}, + {"TCSAFLUSH", Const, 1}, + {"TCSETS", Const, 0}, + {"TF_DISCONNECT", Const, 0}, + {"TF_REUSE_SOCKET", Const, 0}, + {"TF_USE_DEFAULT_WORKER", Const, 0}, + {"TF_USE_KERNEL_APC", Const, 0}, + {"TF_USE_SYSTEM_THREAD", Const, 0}, + {"TF_WRITE_BEHIND", Const, 0}, + {"TH32CS_INHERIT", Const, 4}, + {"TH32CS_SNAPALL", Const, 4}, + {"TH32CS_SNAPHEAPLIST", Const, 4}, + {"TH32CS_SNAPMODULE", Const, 4}, + {"TH32CS_SNAPMODULE32", Const, 4}, + {"TH32CS_SNAPPROCESS", Const, 4}, + {"TH32CS_SNAPTHREAD", Const, 4}, + {"TIME_ZONE_ID_DAYLIGHT", Const, 0}, + {"TIME_ZONE_ID_STANDARD", Const, 0}, + {"TIME_ZONE_ID_UNKNOWN", Const, 0}, + {"TIOCCBRK", Const, 0}, + {"TIOCCDTR", Const, 0}, + {"TIOCCONS", Const, 0}, + {"TIOCDCDTIMESTAMP", Const, 0}, + {"TIOCDRAIN", Const, 0}, + {"TIOCDSIMICROCODE", Const, 0}, + {"TIOCEXCL", Const, 0}, + {"TIOCEXT", Const, 0}, + {"TIOCFLAG_CDTRCTS", Const, 1}, + {"TIOCFLAG_CLOCAL", Const, 1}, + {"TIOCFLAG_CRTSCTS", Const, 1}, + {"TIOCFLAG_MDMBUF", Const, 1}, + {"TIOCFLAG_PPS", Const, 1}, + {"TIOCFLAG_SOFTCAR", Const, 1}, + {"TIOCFLUSH", Const, 0}, + {"TIOCGDEV", Const, 0}, + {"TIOCGDRAINWAIT", Const, 0}, + {"TIOCGETA", Const, 0}, + {"TIOCGETD", Const, 0}, + {"TIOCGFLAGS", Const, 1}, + {"TIOCGICOUNT", Const, 0}, + {"TIOCGLCKTRMIOS", Const, 0}, + {"TIOCGLINED", Const, 1}, + {"TIOCGPGRP", Const, 0}, + {"TIOCGPTN", Const, 0}, + {"TIOCGQSIZE", Const, 1}, + {"TIOCGRANTPT", Const, 1}, + {"TIOCGRS485", Const, 0}, + {"TIOCGSERIAL", Const, 0}, + {"TIOCGSID", Const, 0}, + {"TIOCGSIZE", Const, 1}, + {"TIOCGSOFTCAR", Const, 0}, + {"TIOCGTSTAMP", Const, 1}, + {"TIOCGWINSZ", Const, 0}, + {"TIOCINQ", Const, 0}, + {"TIOCIXOFF", Const, 0}, + {"TIOCIXON", Const, 0}, + {"TIOCLINUX", Const, 0}, + {"TIOCMBIC", Const, 0}, + {"TIOCMBIS", Const, 0}, + {"TIOCMGDTRWAIT", Const, 0}, + {"TIOCMGET", Const, 0}, + {"TIOCMIWAIT", Const, 0}, + {"TIOCMODG", Const, 0}, + {"TIOCMODS", Const, 0}, + {"TIOCMSDTRWAIT", Const, 0}, + {"TIOCMSET", Const, 0}, + {"TIOCM_CAR", Const, 0}, + {"TIOCM_CD", Const, 0}, + {"TIOCM_CTS", Const, 0}, + {"TIOCM_DCD", Const, 0}, + {"TIOCM_DSR", Const, 0}, + {"TIOCM_DTR", Const, 0}, + {"TIOCM_LE", Const, 0}, + {"TIOCM_RI", Const, 0}, + {"TIOCM_RNG", Const, 0}, + {"TIOCM_RTS", Const, 0}, + {"TIOCM_SR", Const, 0}, + {"TIOCM_ST", Const, 0}, + {"TIOCNOTTY", Const, 0}, + {"TIOCNXCL", Const, 0}, + {"TIOCOUTQ", Const, 0}, + {"TIOCPKT", Const, 0}, + {"TIOCPKT_DATA", Const, 0}, + {"TIOCPKT_DOSTOP", Const, 0}, + {"TIOCPKT_FLUSHREAD", Const, 0}, + {"TIOCPKT_FLUSHWRITE", Const, 0}, + {"TIOCPKT_IOCTL", Const, 0}, + {"TIOCPKT_NOSTOP", Const, 0}, + {"TIOCPKT_START", Const, 0}, + {"TIOCPKT_STOP", Const, 0}, + {"TIOCPTMASTER", Const, 0}, + {"TIOCPTMGET", Const, 1}, + {"TIOCPTSNAME", Const, 1}, + {"TIOCPTYGNAME", Const, 0}, + {"TIOCPTYGRANT", Const, 0}, + {"TIOCPTYUNLK", Const, 0}, + {"TIOCRCVFRAME", Const, 1}, + {"TIOCREMOTE", Const, 0}, + {"TIOCSBRK", Const, 0}, + {"TIOCSCONS", Const, 0}, + {"TIOCSCTTY", Const, 0}, + {"TIOCSDRAINWAIT", Const, 0}, + {"TIOCSDTR", Const, 0}, + {"TIOCSERCONFIG", Const, 0}, + {"TIOCSERGETLSR", Const, 0}, + {"TIOCSERGETMULTI", Const, 0}, + {"TIOCSERGSTRUCT", Const, 0}, + {"TIOCSERGWILD", Const, 0}, + {"TIOCSERSETMULTI", Const, 0}, + {"TIOCSERSWILD", Const, 0}, + {"TIOCSER_TEMT", Const, 0}, + {"TIOCSETA", Const, 0}, + {"TIOCSETAF", Const, 0}, + {"TIOCSETAW", Const, 0}, + {"TIOCSETD", Const, 0}, + {"TIOCSFLAGS", Const, 1}, + {"TIOCSIG", Const, 0}, + {"TIOCSLCKTRMIOS", Const, 0}, + {"TIOCSLINED", Const, 1}, + {"TIOCSPGRP", Const, 0}, + {"TIOCSPTLCK", Const, 0}, + {"TIOCSQSIZE", Const, 1}, + {"TIOCSRS485", Const, 0}, + {"TIOCSSERIAL", Const, 0}, + {"TIOCSSIZE", Const, 1}, + {"TIOCSSOFTCAR", Const, 0}, + {"TIOCSTART", Const, 0}, + {"TIOCSTAT", Const, 0}, + {"TIOCSTI", Const, 0}, + {"TIOCSTOP", Const, 0}, + {"TIOCSTSTAMP", Const, 1}, + {"TIOCSWINSZ", Const, 0}, + {"TIOCTIMESTAMP", Const, 0}, + {"TIOCUCNTL", Const, 0}, + {"TIOCVHANGUP", Const, 0}, + {"TIOCXMTFRAME", Const, 1}, + {"TOKEN_ADJUST_DEFAULT", Const, 0}, + {"TOKEN_ADJUST_GROUPS", Const, 0}, + {"TOKEN_ADJUST_PRIVILEGES", Const, 0}, + {"TOKEN_ADJUST_SESSIONID", Const, 11}, + {"TOKEN_ALL_ACCESS", Const, 0}, + {"TOKEN_ASSIGN_PRIMARY", Const, 0}, + {"TOKEN_DUPLICATE", Const, 0}, + {"TOKEN_EXECUTE", Const, 0}, + {"TOKEN_IMPERSONATE", Const, 0}, + {"TOKEN_QUERY", Const, 0}, + {"TOKEN_QUERY_SOURCE", Const, 0}, + {"TOKEN_READ", Const, 0}, + {"TOKEN_WRITE", Const, 0}, + {"TOSTOP", Const, 0}, + {"TRUNCATE_EXISTING", Const, 0}, + {"TUNATTACHFILTER", Const, 0}, + {"TUNDETACHFILTER", Const, 0}, + {"TUNGETFEATURES", Const, 0}, + {"TUNGETIFF", Const, 0}, + {"TUNGETSNDBUF", Const, 0}, + {"TUNGETVNETHDRSZ", Const, 0}, + {"TUNSETDEBUG", Const, 0}, + {"TUNSETGROUP", Const, 0}, + {"TUNSETIFF", Const, 0}, + {"TUNSETLINK", Const, 0}, + {"TUNSETNOCSUM", Const, 0}, + {"TUNSETOFFLOAD", Const, 0}, + {"TUNSETOWNER", Const, 0}, + {"TUNSETPERSIST", Const, 0}, + {"TUNSETSNDBUF", Const, 0}, + {"TUNSETTXFILTER", Const, 0}, + {"TUNSETVNETHDRSZ", Const, 0}, + {"Tee", Func, 0}, + {"TerminateProcess", Func, 0}, + {"Termios", Type, 0}, + {"Termios.Cc", Field, 0}, + {"Termios.Cflag", Field, 0}, + {"Termios.Iflag", Field, 0}, + {"Termios.Ispeed", Field, 0}, + {"Termios.Lflag", Field, 0}, + {"Termios.Line", Field, 0}, + {"Termios.Oflag", Field, 0}, + {"Termios.Ospeed", Field, 0}, + {"Termios.Pad_cgo_0", Field, 0}, + {"Tgkill", Func, 0}, + {"Time", Func, 0}, + {"Time_t", Type, 0}, + {"Times", Func, 0}, + {"Timespec", Type, 0}, + {"Timespec.Nsec", Field, 0}, + {"Timespec.Pad_cgo_0", Field, 2}, + {"Timespec.Sec", Field, 0}, + {"TimespecToNsec", Func, 0}, + {"Timeval", Type, 0}, + {"Timeval.Pad_cgo_0", Field, 0}, + {"Timeval.Sec", Field, 0}, + {"Timeval.Usec", Field, 0}, + {"Timeval32", Type, 0}, + {"Timeval32.Sec", Field, 0}, + {"Timeval32.Usec", Field, 0}, + {"TimevalToNsec", Func, 0}, + {"Timex", Type, 0}, + {"Timex.Calcnt", Field, 0}, + {"Timex.Constant", Field, 0}, + {"Timex.Errcnt", Field, 0}, + {"Timex.Esterror", Field, 0}, + {"Timex.Freq", Field, 0}, + {"Timex.Jitcnt", Field, 0}, + {"Timex.Jitter", Field, 0}, + {"Timex.Maxerror", Field, 0}, + {"Timex.Modes", Field, 0}, + {"Timex.Offset", Field, 0}, + {"Timex.Pad_cgo_0", Field, 0}, + {"Timex.Pad_cgo_1", Field, 0}, + {"Timex.Pad_cgo_2", Field, 0}, + {"Timex.Pad_cgo_3", Field, 0}, + {"Timex.Ppsfreq", Field, 0}, + {"Timex.Precision", Field, 0}, + {"Timex.Shift", Field, 0}, + {"Timex.Stabil", Field, 0}, + {"Timex.Status", Field, 0}, + {"Timex.Stbcnt", Field, 0}, + {"Timex.Tai", Field, 0}, + {"Timex.Tick", Field, 0}, + {"Timex.Time", Field, 0}, + {"Timex.Tolerance", Field, 0}, + {"Timezoneinformation", Type, 0}, + {"Timezoneinformation.Bias", Field, 0}, + {"Timezoneinformation.DaylightBias", Field, 0}, + {"Timezoneinformation.DaylightDate", Field, 0}, + {"Timezoneinformation.DaylightName", Field, 0}, + {"Timezoneinformation.StandardBias", Field, 0}, + {"Timezoneinformation.StandardDate", Field, 0}, + {"Timezoneinformation.StandardName", Field, 0}, + {"Tms", Type, 0}, + {"Tms.Cstime", Field, 0}, + {"Tms.Cutime", Field, 0}, + {"Tms.Stime", Field, 0}, + {"Tms.Utime", Field, 0}, + {"Token", Type, 0}, + {"TokenAccessInformation", Const, 0}, + {"TokenAuditPolicy", Const, 0}, + {"TokenDefaultDacl", Const, 0}, + {"TokenElevation", Const, 0}, + {"TokenElevationType", Const, 0}, + {"TokenGroups", Const, 0}, + {"TokenGroupsAndPrivileges", Const, 0}, + {"TokenHasRestrictions", Const, 0}, + {"TokenImpersonationLevel", Const, 0}, + {"TokenIntegrityLevel", Const, 0}, + {"TokenLinkedToken", Const, 0}, + {"TokenLogonSid", Const, 0}, + {"TokenMandatoryPolicy", Const, 0}, + {"TokenOrigin", Const, 0}, + {"TokenOwner", Const, 0}, + {"TokenPrimaryGroup", Const, 0}, + {"TokenPrivileges", Const, 0}, + {"TokenRestrictedSids", Const, 0}, + {"TokenSandBoxInert", Const, 0}, + {"TokenSessionId", Const, 0}, + {"TokenSessionReference", Const, 0}, + {"TokenSource", Const, 0}, + {"TokenStatistics", Const, 0}, + {"TokenType", Const, 0}, + {"TokenUIAccess", Const, 0}, + {"TokenUser", Const, 0}, + {"TokenVirtualizationAllowed", Const, 0}, + {"TokenVirtualizationEnabled", Const, 0}, + {"Tokenprimarygroup", Type, 0}, + {"Tokenprimarygroup.PrimaryGroup", Field, 0}, + {"Tokenuser", Type, 0}, + {"Tokenuser.User", Field, 0}, + {"TranslateAccountName", Func, 0}, + {"TranslateName", Func, 0}, + {"TransmitFile", Func, 0}, + {"TransmitFileBuffers", Type, 0}, + {"TransmitFileBuffers.Head", Field, 0}, + {"TransmitFileBuffers.HeadLength", Field, 0}, + {"TransmitFileBuffers.Tail", Field, 0}, + {"TransmitFileBuffers.TailLength", Field, 0}, + {"Truncate", Func, 0}, + {"UNIX_PATH_MAX", Const, 12}, + {"USAGE_MATCH_TYPE_AND", Const, 0}, + {"USAGE_MATCH_TYPE_OR", Const, 0}, + {"UTF16FromString", Func, 1}, + {"UTF16PtrFromString", Func, 1}, + {"UTF16ToString", Func, 0}, + {"Ucred", Type, 0}, + {"Ucred.Gid", Field, 0}, + {"Ucred.Pid", Field, 0}, + {"Ucred.Uid", Field, 0}, + {"Umask", Func, 0}, + {"Uname", Func, 0}, + {"Undelete", Func, 0}, + {"UnixCredentials", Func, 0}, + {"UnixRights", Func, 0}, + {"Unlink", Func, 0}, + {"Unlinkat", Func, 0}, + {"UnmapViewOfFile", Func, 0}, + {"Unmount", Func, 0}, + {"Unsetenv", Func, 4}, + {"Unshare", Func, 0}, + {"UserInfo10", Type, 0}, + {"UserInfo10.Comment", Field, 0}, + {"UserInfo10.FullName", Field, 0}, + {"UserInfo10.Name", Field, 0}, + {"UserInfo10.UsrComment", Field, 0}, + {"Ustat", Func, 0}, + {"Ustat_t", Type, 0}, + {"Ustat_t.Fname", Field, 0}, + {"Ustat_t.Fpack", Field, 0}, + {"Ustat_t.Pad_cgo_0", Field, 0}, + {"Ustat_t.Pad_cgo_1", Field, 0}, + {"Ustat_t.Tfree", Field, 0}, + {"Ustat_t.Tinode", Field, 0}, + {"Utimbuf", Type, 0}, + {"Utimbuf.Actime", Field, 0}, + {"Utimbuf.Modtime", Field, 0}, + {"Utime", Func, 0}, + {"Utimes", Func, 0}, + {"UtimesNano", Func, 1}, + {"Utsname", Type, 0}, + {"Utsname.Domainname", Field, 0}, + {"Utsname.Machine", Field, 0}, + {"Utsname.Nodename", Field, 0}, + {"Utsname.Release", Field, 0}, + {"Utsname.Sysname", Field, 0}, + {"Utsname.Version", Field, 0}, + {"VDISCARD", Const, 0}, + {"VDSUSP", Const, 1}, + {"VEOF", Const, 0}, + {"VEOL", Const, 0}, + {"VEOL2", Const, 0}, + {"VERASE", Const, 0}, + {"VERASE2", Const, 1}, + {"VINTR", Const, 0}, + {"VKILL", Const, 0}, + {"VLNEXT", Const, 0}, + {"VMIN", Const, 0}, + {"VQUIT", Const, 0}, + {"VREPRINT", Const, 0}, + {"VSTART", Const, 0}, + {"VSTATUS", Const, 1}, + {"VSTOP", Const, 0}, + {"VSUSP", Const, 0}, + {"VSWTC", Const, 0}, + {"VT0", Const, 1}, + {"VT1", Const, 1}, + {"VTDLY", Const, 1}, + {"VTIME", Const, 0}, + {"VWERASE", Const, 0}, + {"VirtualLock", Func, 0}, + {"VirtualUnlock", Func, 0}, + {"WAIT_ABANDONED", Const, 0}, + {"WAIT_FAILED", Const, 0}, + {"WAIT_OBJECT_0", Const, 0}, + {"WAIT_TIMEOUT", Const, 0}, + {"WALL", Const, 0}, + {"WALLSIG", Const, 1}, + {"WALTSIG", Const, 1}, + {"WCLONE", Const, 0}, + {"WCONTINUED", Const, 0}, + {"WCOREFLAG", Const, 0}, + {"WEXITED", Const, 0}, + {"WLINUXCLONE", Const, 0}, + {"WNOHANG", Const, 0}, + {"WNOTHREAD", Const, 0}, + {"WNOWAIT", Const, 0}, + {"WNOZOMBIE", Const, 1}, + {"WOPTSCHECKED", Const, 1}, + {"WORDSIZE", Const, 0}, + {"WSABuf", Type, 0}, + {"WSABuf.Buf", Field, 0}, + {"WSABuf.Len", Field, 0}, + {"WSACleanup", Func, 0}, + {"WSADESCRIPTION_LEN", Const, 0}, + {"WSAData", Type, 0}, + {"WSAData.Description", Field, 0}, + {"WSAData.HighVersion", Field, 0}, + {"WSAData.MaxSockets", Field, 0}, + {"WSAData.MaxUdpDg", Field, 0}, + {"WSAData.SystemStatus", Field, 0}, + {"WSAData.VendorInfo", Field, 0}, + {"WSAData.Version", Field, 0}, + {"WSAEACCES", Const, 2}, + {"WSAECONNABORTED", Const, 9}, + {"WSAECONNRESET", Const, 3}, + {"WSAENOPROTOOPT", Const, 23}, + {"WSAEnumProtocols", Func, 2}, + {"WSAID_CONNECTEX", Var, 1}, + {"WSAIoctl", Func, 0}, + {"WSAPROTOCOL_LEN", Const, 2}, + {"WSAProtocolChain", Type, 2}, + {"WSAProtocolChain.ChainEntries", Field, 2}, + {"WSAProtocolChain.ChainLen", Field, 2}, + {"WSAProtocolInfo", Type, 2}, + {"WSAProtocolInfo.AddressFamily", Field, 2}, + {"WSAProtocolInfo.CatalogEntryId", Field, 2}, + {"WSAProtocolInfo.MaxSockAddr", Field, 2}, + {"WSAProtocolInfo.MessageSize", Field, 2}, + {"WSAProtocolInfo.MinSockAddr", Field, 2}, + {"WSAProtocolInfo.NetworkByteOrder", Field, 2}, + {"WSAProtocolInfo.Protocol", Field, 2}, + {"WSAProtocolInfo.ProtocolChain", Field, 2}, + {"WSAProtocolInfo.ProtocolMaxOffset", Field, 2}, + {"WSAProtocolInfo.ProtocolName", Field, 2}, + {"WSAProtocolInfo.ProviderFlags", Field, 2}, + {"WSAProtocolInfo.ProviderId", Field, 2}, + {"WSAProtocolInfo.ProviderReserved", Field, 2}, + {"WSAProtocolInfo.SecurityScheme", Field, 2}, + {"WSAProtocolInfo.ServiceFlags1", Field, 2}, + {"WSAProtocolInfo.ServiceFlags2", Field, 2}, + {"WSAProtocolInfo.ServiceFlags3", Field, 2}, + {"WSAProtocolInfo.ServiceFlags4", Field, 2}, + {"WSAProtocolInfo.SocketType", Field, 2}, + {"WSAProtocolInfo.Version", Field, 2}, + {"WSARecv", Func, 0}, + {"WSARecvFrom", Func, 0}, + {"WSASYS_STATUS_LEN", Const, 0}, + {"WSASend", Func, 0}, + {"WSASendTo", Func, 0}, + {"WSASendto", Func, 0}, + {"WSAStartup", Func, 0}, + {"WSTOPPED", Const, 0}, + {"WTRAPPED", Const, 1}, + {"WUNTRACED", Const, 0}, + {"Wait4", Func, 0}, + {"WaitForSingleObject", Func, 0}, + {"WaitStatus", Type, 0}, + {"WaitStatus.ExitCode", Field, 0}, + {"Win32FileAttributeData", Type, 0}, + {"Win32FileAttributeData.CreationTime", Field, 0}, + {"Win32FileAttributeData.FileAttributes", Field, 0}, + {"Win32FileAttributeData.FileSizeHigh", Field, 0}, + {"Win32FileAttributeData.FileSizeLow", Field, 0}, + {"Win32FileAttributeData.LastAccessTime", Field, 0}, + {"Win32FileAttributeData.LastWriteTime", Field, 0}, + {"Win32finddata", Type, 0}, + {"Win32finddata.AlternateFileName", Field, 0}, + {"Win32finddata.CreationTime", Field, 0}, + {"Win32finddata.FileAttributes", Field, 0}, + {"Win32finddata.FileName", Field, 0}, + {"Win32finddata.FileSizeHigh", Field, 0}, + {"Win32finddata.FileSizeLow", Field, 0}, + {"Win32finddata.LastAccessTime", Field, 0}, + {"Win32finddata.LastWriteTime", Field, 0}, + {"Win32finddata.Reserved0", Field, 0}, + {"Win32finddata.Reserved1", Field, 0}, + {"Write", Func, 0}, + {"WriteConsole", Func, 1}, + {"WriteFile", Func, 0}, + {"X509_ASN_ENCODING", Const, 0}, + {"XCASE", Const, 0}, + {"XP1_CONNECTIONLESS", Const, 2}, + {"XP1_CONNECT_DATA", Const, 2}, + {"XP1_DISCONNECT_DATA", Const, 2}, + {"XP1_EXPEDITED_DATA", Const, 2}, + {"XP1_GRACEFUL_CLOSE", Const, 2}, + {"XP1_GUARANTEED_DELIVERY", Const, 2}, + {"XP1_GUARANTEED_ORDER", Const, 2}, + {"XP1_IFS_HANDLES", Const, 2}, + {"XP1_MESSAGE_ORIENTED", Const, 2}, + {"XP1_MULTIPOINT_CONTROL_PLANE", Const, 2}, + {"XP1_MULTIPOINT_DATA_PLANE", Const, 2}, + {"XP1_PARTIAL_MESSAGE", Const, 2}, + {"XP1_PSEUDO_STREAM", Const, 2}, + {"XP1_QOS_SUPPORTED", Const, 2}, + {"XP1_SAN_SUPPORT_SDP", Const, 2}, + {"XP1_SUPPORT_BROADCAST", Const, 2}, + {"XP1_SUPPORT_MULTIPOINT", Const, 2}, + {"XP1_UNI_RECV", Const, 2}, + {"XP1_UNI_SEND", Const, 2}, + }, + "syscall/js": { + {"CopyBytesToGo", Func, 0}, + {"CopyBytesToJS", Func, 0}, + {"Error", Type, 0}, + {"Func", Type, 0}, + {"FuncOf", Func, 0}, + {"Global", Func, 0}, + {"Null", Func, 0}, + {"Type", Type, 0}, + {"TypeBoolean", Const, 0}, + {"TypeFunction", Const, 0}, + {"TypeNull", Const, 0}, + {"TypeNumber", Const, 0}, + {"TypeObject", Const, 0}, + {"TypeString", Const, 0}, + {"TypeSymbol", Const, 0}, + {"TypeUndefined", Const, 0}, + {"Undefined", Func, 0}, + {"Value", Type, 0}, + {"ValueError", Type, 0}, + {"ValueOf", Func, 0}, + }, + "testing": { + {"(*B).Cleanup", Method, 14}, + {"(*B).Elapsed", Method, 20}, + {"(*B).Error", Method, 0}, + {"(*B).Errorf", Method, 0}, + {"(*B).Fail", Method, 0}, + {"(*B).FailNow", Method, 0}, + {"(*B).Failed", Method, 0}, + {"(*B).Fatal", Method, 0}, + {"(*B).Fatalf", Method, 0}, + {"(*B).Helper", Method, 9}, + {"(*B).Log", Method, 0}, + {"(*B).Logf", Method, 0}, + {"(*B).Name", Method, 8}, + {"(*B).ReportAllocs", Method, 1}, + {"(*B).ReportMetric", Method, 13}, + {"(*B).ResetTimer", Method, 0}, + {"(*B).Run", Method, 7}, + {"(*B).RunParallel", Method, 3}, + {"(*B).SetBytes", Method, 0}, + {"(*B).SetParallelism", Method, 3}, + {"(*B).Setenv", Method, 17}, + {"(*B).Skip", Method, 1}, + {"(*B).SkipNow", Method, 1}, + {"(*B).Skipf", Method, 1}, + {"(*B).Skipped", Method, 1}, + {"(*B).StartTimer", Method, 0}, + {"(*B).StopTimer", Method, 0}, + {"(*B).TempDir", Method, 15}, + {"(*F).Add", Method, 18}, + {"(*F).Cleanup", Method, 18}, + {"(*F).Error", Method, 18}, + {"(*F).Errorf", Method, 18}, + {"(*F).Fail", Method, 18}, + {"(*F).FailNow", Method, 18}, + {"(*F).Failed", Method, 18}, + {"(*F).Fatal", Method, 18}, + {"(*F).Fatalf", Method, 18}, + {"(*F).Fuzz", Method, 18}, + {"(*F).Helper", Method, 18}, + {"(*F).Log", Method, 18}, + {"(*F).Logf", Method, 18}, + {"(*F).Name", Method, 18}, + {"(*F).Setenv", Method, 18}, + {"(*F).Skip", Method, 18}, + {"(*F).SkipNow", Method, 18}, + {"(*F).Skipf", Method, 18}, + {"(*F).Skipped", Method, 18}, + {"(*F).TempDir", Method, 18}, + {"(*M).Run", Method, 4}, + {"(*PB).Next", Method, 3}, + {"(*T).Cleanup", Method, 14}, + {"(*T).Deadline", Method, 15}, + {"(*T).Error", Method, 0}, + {"(*T).Errorf", Method, 0}, + {"(*T).Fail", Method, 0}, + {"(*T).FailNow", Method, 0}, + {"(*T).Failed", Method, 0}, + {"(*T).Fatal", Method, 0}, + {"(*T).Fatalf", Method, 0}, + {"(*T).Helper", Method, 9}, + {"(*T).Log", Method, 0}, + {"(*T).Logf", Method, 0}, + {"(*T).Name", Method, 8}, + {"(*T).Parallel", Method, 0}, + {"(*T).Run", Method, 7}, + {"(*T).Setenv", Method, 17}, + {"(*T).Skip", Method, 1}, + {"(*T).SkipNow", Method, 1}, + {"(*T).Skipf", Method, 1}, + {"(*T).Skipped", Method, 1}, + {"(*T).TempDir", Method, 15}, + {"(BenchmarkResult).AllocedBytesPerOp", Method, 1}, + {"(BenchmarkResult).AllocsPerOp", Method, 1}, + {"(BenchmarkResult).MemString", Method, 1}, + {"(BenchmarkResult).NsPerOp", Method, 0}, + {"(BenchmarkResult).String", Method, 0}, + {"AllocsPerRun", Func, 1}, + {"B", Type, 0}, + {"B.N", Field, 0}, + {"Benchmark", Func, 0}, + {"BenchmarkResult", Type, 0}, + {"BenchmarkResult.Bytes", Field, 0}, + {"BenchmarkResult.Extra", Field, 13}, + {"BenchmarkResult.MemAllocs", Field, 1}, + {"BenchmarkResult.MemBytes", Field, 1}, + {"BenchmarkResult.N", Field, 0}, + {"BenchmarkResult.T", Field, 0}, + {"Cover", Type, 2}, + {"Cover.Blocks", Field, 2}, + {"Cover.Counters", Field, 2}, + {"Cover.CoveredPackages", Field, 2}, + {"Cover.Mode", Field, 2}, + {"CoverBlock", Type, 2}, + {"CoverBlock.Col0", Field, 2}, + {"CoverBlock.Col1", Field, 2}, + {"CoverBlock.Line0", Field, 2}, + {"CoverBlock.Line1", Field, 2}, + {"CoverBlock.Stmts", Field, 2}, + {"CoverMode", Func, 8}, + {"Coverage", Func, 4}, + {"F", Type, 18}, + {"Init", Func, 13}, + {"InternalBenchmark", Type, 0}, + {"InternalBenchmark.F", Field, 0}, + {"InternalBenchmark.Name", Field, 0}, + {"InternalExample", Type, 0}, + {"InternalExample.F", Field, 0}, + {"InternalExample.Name", Field, 0}, + {"InternalExample.Output", Field, 0}, + {"InternalExample.Unordered", Field, 7}, + {"InternalFuzzTarget", Type, 18}, + {"InternalFuzzTarget.Fn", Field, 18}, + {"InternalFuzzTarget.Name", Field, 18}, + {"InternalTest", Type, 0}, + {"InternalTest.F", Field, 0}, + {"InternalTest.Name", Field, 0}, + {"M", Type, 4}, + {"Main", Func, 0}, + {"MainStart", Func, 4}, + {"PB", Type, 3}, + {"RegisterCover", Func, 2}, + {"RunBenchmarks", Func, 0}, + {"RunExamples", Func, 0}, + {"RunTests", Func, 0}, + {"Short", Func, 0}, + {"T", Type, 0}, + {"TB", Type, 2}, + {"Testing", Func, 21}, + {"Verbose", Func, 1}, + }, + "testing/fstest": { + {"(MapFS).Glob", Method, 16}, + {"(MapFS).Open", Method, 16}, + {"(MapFS).ReadDir", Method, 16}, + {"(MapFS).ReadFile", Method, 16}, + {"(MapFS).Stat", Method, 16}, + {"(MapFS).Sub", Method, 16}, + {"MapFS", Type, 16}, + {"MapFile", Type, 16}, + {"MapFile.Data", Field, 16}, + {"MapFile.ModTime", Field, 16}, + {"MapFile.Mode", Field, 16}, + {"MapFile.Sys", Field, 16}, + {"TestFS", Func, 16}, + }, + "testing/iotest": { + {"DataErrReader", Func, 0}, + {"ErrReader", Func, 16}, + {"ErrTimeout", Var, 0}, + {"HalfReader", Func, 0}, + {"NewReadLogger", Func, 0}, + {"NewWriteLogger", Func, 0}, + {"OneByteReader", Func, 0}, + {"TestReader", Func, 16}, + {"TimeoutReader", Func, 0}, + {"TruncateWriter", Func, 0}, + }, + "testing/quick": { + {"(*CheckEqualError).Error", Method, 0}, + {"(*CheckError).Error", Method, 0}, + {"(SetupError).Error", Method, 0}, + {"Check", Func, 0}, + {"CheckEqual", Func, 0}, + {"CheckEqualError", Type, 0}, + {"CheckEqualError.CheckError", Field, 0}, + {"CheckEqualError.Out1", Field, 0}, + {"CheckEqualError.Out2", Field, 0}, + {"CheckError", Type, 0}, + {"CheckError.Count", Field, 0}, + {"CheckError.In", Field, 0}, + {"Config", Type, 0}, + {"Config.MaxCount", Field, 0}, + {"Config.MaxCountScale", Field, 0}, + {"Config.Rand", Field, 0}, + {"Config.Values", Field, 0}, + {"Generator", Type, 0}, + {"SetupError", Type, 0}, + {"Value", Func, 0}, + }, + "testing/slogtest": { + {"Run", Func, 22}, + {"TestHandler", Func, 21}, + }, + "text/scanner": { + {"(*Position).IsValid", Method, 0}, + {"(*Scanner).Init", Method, 0}, + {"(*Scanner).IsValid", Method, 0}, + {"(*Scanner).Next", Method, 0}, + {"(*Scanner).Peek", Method, 0}, + {"(*Scanner).Pos", Method, 0}, + {"(*Scanner).Scan", Method, 0}, + {"(*Scanner).TokenText", Method, 0}, + {"(Position).String", Method, 0}, + {"(Scanner).String", Method, 0}, + {"Char", Const, 0}, + {"Comment", Const, 0}, + {"EOF", Const, 0}, + {"Float", Const, 0}, + {"GoTokens", Const, 0}, + {"GoWhitespace", Const, 0}, + {"Ident", Const, 0}, + {"Int", Const, 0}, + {"Position", Type, 0}, + {"Position.Column", Field, 0}, + {"Position.Filename", Field, 0}, + {"Position.Line", Field, 0}, + {"Position.Offset", Field, 0}, + {"RawString", Const, 0}, + {"ScanChars", Const, 0}, + {"ScanComments", Const, 0}, + {"ScanFloats", Const, 0}, + {"ScanIdents", Const, 0}, + {"ScanInts", Const, 0}, + {"ScanRawStrings", Const, 0}, + {"ScanStrings", Const, 0}, + {"Scanner", Type, 0}, + {"Scanner.Error", Field, 0}, + {"Scanner.ErrorCount", Field, 0}, + {"Scanner.IsIdentRune", Field, 4}, + {"Scanner.Mode", Field, 0}, + {"Scanner.Position", Field, 0}, + {"Scanner.Whitespace", Field, 0}, + {"SkipComments", Const, 0}, + {"String", Const, 0}, + {"TokenString", Func, 0}, + }, + "text/tabwriter": { + {"(*Writer).Flush", Method, 0}, + {"(*Writer).Init", Method, 0}, + {"(*Writer).Write", Method, 0}, + {"AlignRight", Const, 0}, + {"Debug", Const, 0}, + {"DiscardEmptyColumns", Const, 0}, + {"Escape", Const, 0}, + {"FilterHTML", Const, 0}, + {"NewWriter", Func, 0}, + {"StripEscape", Const, 0}, + {"TabIndent", Const, 0}, + {"Writer", Type, 0}, + }, + "text/template": { + {"(*Template).AddParseTree", Method, 0}, + {"(*Template).Clone", Method, 0}, + {"(*Template).DefinedTemplates", Method, 5}, + {"(*Template).Delims", Method, 0}, + {"(*Template).Execute", Method, 0}, + {"(*Template).ExecuteTemplate", Method, 0}, + {"(*Template).Funcs", Method, 0}, + {"(*Template).Lookup", Method, 0}, + {"(*Template).Name", Method, 0}, + {"(*Template).New", Method, 0}, + {"(*Template).Option", Method, 5}, + {"(*Template).Parse", Method, 0}, + {"(*Template).ParseFS", Method, 16}, + {"(*Template).ParseFiles", Method, 0}, + {"(*Template).ParseGlob", Method, 0}, + {"(*Template).Templates", Method, 0}, + {"(ExecError).Error", Method, 6}, + {"(ExecError).Unwrap", Method, 13}, + {"(Template).Copy", Method, 2}, + {"(Template).ErrorContext", Method, 1}, + {"ExecError", Type, 6}, + {"ExecError.Err", Field, 6}, + {"ExecError.Name", Field, 6}, + {"FuncMap", Type, 0}, + {"HTMLEscape", Func, 0}, + {"HTMLEscapeString", Func, 0}, + {"HTMLEscaper", Func, 0}, + {"IsTrue", Func, 6}, + {"JSEscape", Func, 0}, + {"JSEscapeString", Func, 0}, + {"JSEscaper", Func, 0}, + {"Must", Func, 0}, + {"New", Func, 0}, + {"ParseFS", Func, 16}, + {"ParseFiles", Func, 0}, + {"ParseGlob", Func, 0}, + {"Template", Type, 0}, + {"Template.Tree", Field, 0}, + {"URLQueryEscaper", Func, 0}, + }, + "text/template/parse": { + {"(*ActionNode).Copy", Method, 0}, + {"(*ActionNode).String", Method, 0}, + {"(*BoolNode).Copy", Method, 0}, + {"(*BoolNode).String", Method, 0}, + {"(*BranchNode).Copy", Method, 4}, + {"(*BranchNode).String", Method, 0}, + {"(*BreakNode).Copy", Method, 18}, + {"(*BreakNode).String", Method, 18}, + {"(*ChainNode).Add", Method, 1}, + {"(*ChainNode).Copy", Method, 1}, + {"(*ChainNode).String", Method, 1}, + {"(*CommandNode).Copy", Method, 0}, + {"(*CommandNode).String", Method, 0}, + {"(*CommentNode).Copy", Method, 16}, + {"(*CommentNode).String", Method, 16}, + {"(*ContinueNode).Copy", Method, 18}, + {"(*ContinueNode).String", Method, 18}, + {"(*DotNode).Copy", Method, 0}, + {"(*DotNode).String", Method, 0}, + {"(*DotNode).Type", Method, 0}, + {"(*FieldNode).Copy", Method, 0}, + {"(*FieldNode).String", Method, 0}, + {"(*IdentifierNode).Copy", Method, 0}, + {"(*IdentifierNode).SetPos", Method, 1}, + {"(*IdentifierNode).SetTree", Method, 4}, + {"(*IdentifierNode).String", Method, 0}, + {"(*IfNode).Copy", Method, 0}, + {"(*IfNode).String", Method, 0}, + {"(*ListNode).Copy", Method, 0}, + {"(*ListNode).CopyList", Method, 0}, + {"(*ListNode).String", Method, 0}, + {"(*NilNode).Copy", Method, 1}, + {"(*NilNode).String", Method, 1}, + {"(*NilNode).Type", Method, 1}, + {"(*NumberNode).Copy", Method, 0}, + {"(*NumberNode).String", Method, 0}, + {"(*PipeNode).Copy", Method, 0}, + {"(*PipeNode).CopyPipe", Method, 0}, + {"(*PipeNode).String", Method, 0}, + {"(*RangeNode).Copy", Method, 0}, + {"(*RangeNode).String", Method, 0}, + {"(*StringNode).Copy", Method, 0}, + {"(*StringNode).String", Method, 0}, + {"(*TemplateNode).Copy", Method, 0}, + {"(*TemplateNode).String", Method, 0}, + {"(*TextNode).Copy", Method, 0}, + {"(*TextNode).String", Method, 0}, + {"(*Tree).Copy", Method, 2}, + {"(*Tree).ErrorContext", Method, 1}, + {"(*Tree).Parse", Method, 0}, + {"(*VariableNode).Copy", Method, 0}, + {"(*VariableNode).String", Method, 0}, + {"(*WithNode).Copy", Method, 0}, + {"(*WithNode).String", Method, 0}, + {"(ActionNode).Position", Method, 1}, + {"(ActionNode).Type", Method, 0}, + {"(BoolNode).Position", Method, 1}, + {"(BoolNode).Type", Method, 0}, + {"(BranchNode).Position", Method, 1}, + {"(BranchNode).Type", Method, 0}, + {"(BreakNode).Position", Method, 18}, + {"(BreakNode).Type", Method, 18}, + {"(ChainNode).Position", Method, 1}, + {"(ChainNode).Type", Method, 1}, + {"(CommandNode).Position", Method, 1}, + {"(CommandNode).Type", Method, 0}, + {"(CommentNode).Position", Method, 16}, + {"(CommentNode).Type", Method, 16}, + {"(ContinueNode).Position", Method, 18}, + {"(ContinueNode).Type", Method, 18}, + {"(DotNode).Position", Method, 1}, + {"(FieldNode).Position", Method, 1}, + {"(FieldNode).Type", Method, 0}, + {"(IdentifierNode).Position", Method, 1}, + {"(IdentifierNode).Type", Method, 0}, + {"(IfNode).Position", Method, 1}, + {"(IfNode).Type", Method, 0}, + {"(ListNode).Position", Method, 1}, + {"(ListNode).Type", Method, 0}, + {"(NilNode).Position", Method, 1}, + {"(NodeType).Type", Method, 0}, + {"(NumberNode).Position", Method, 1}, + {"(NumberNode).Type", Method, 0}, + {"(PipeNode).Position", Method, 1}, + {"(PipeNode).Type", Method, 0}, + {"(Pos).Position", Method, 1}, + {"(RangeNode).Position", Method, 1}, + {"(RangeNode).Type", Method, 0}, + {"(StringNode).Position", Method, 1}, + {"(StringNode).Type", Method, 0}, + {"(TemplateNode).Position", Method, 1}, + {"(TemplateNode).Type", Method, 0}, + {"(TextNode).Position", Method, 1}, + {"(TextNode).Type", Method, 0}, + {"(VariableNode).Position", Method, 1}, + {"(VariableNode).Type", Method, 0}, + {"(WithNode).Position", Method, 1}, + {"(WithNode).Type", Method, 0}, + {"ActionNode", Type, 0}, + {"ActionNode.Line", Field, 0}, + {"ActionNode.NodeType", Field, 0}, + {"ActionNode.Pipe", Field, 0}, + {"ActionNode.Pos", Field, 1}, + {"BoolNode", Type, 0}, + {"BoolNode.NodeType", Field, 0}, + {"BoolNode.Pos", Field, 1}, + {"BoolNode.True", Field, 0}, + {"BranchNode", Type, 0}, + {"BranchNode.ElseList", Field, 0}, + {"BranchNode.Line", Field, 0}, + {"BranchNode.List", Field, 0}, + {"BranchNode.NodeType", Field, 0}, + {"BranchNode.Pipe", Field, 0}, + {"BranchNode.Pos", Field, 1}, + {"BreakNode", Type, 18}, + {"BreakNode.Line", Field, 18}, + {"BreakNode.NodeType", Field, 18}, + {"BreakNode.Pos", Field, 18}, + {"ChainNode", Type, 1}, + {"ChainNode.Field", Field, 1}, + {"ChainNode.Node", Field, 1}, + {"ChainNode.NodeType", Field, 1}, + {"ChainNode.Pos", Field, 1}, + {"CommandNode", Type, 0}, + {"CommandNode.Args", Field, 0}, + {"CommandNode.NodeType", Field, 0}, + {"CommandNode.Pos", Field, 1}, + {"CommentNode", Type, 16}, + {"CommentNode.NodeType", Field, 16}, + {"CommentNode.Pos", Field, 16}, + {"CommentNode.Text", Field, 16}, + {"ContinueNode", Type, 18}, + {"ContinueNode.Line", Field, 18}, + {"ContinueNode.NodeType", Field, 18}, + {"ContinueNode.Pos", Field, 18}, + {"DotNode", Type, 0}, + {"DotNode.NodeType", Field, 4}, + {"DotNode.Pos", Field, 1}, + {"FieldNode", Type, 0}, + {"FieldNode.Ident", Field, 0}, + {"FieldNode.NodeType", Field, 0}, + {"FieldNode.Pos", Field, 1}, + {"IdentifierNode", Type, 0}, + {"IdentifierNode.Ident", Field, 0}, + {"IdentifierNode.NodeType", Field, 0}, + {"IdentifierNode.Pos", Field, 1}, + {"IfNode", Type, 0}, + {"IfNode.BranchNode", Field, 0}, + {"IsEmptyTree", Func, 0}, + {"ListNode", Type, 0}, + {"ListNode.NodeType", Field, 0}, + {"ListNode.Nodes", Field, 0}, + {"ListNode.Pos", Field, 1}, + {"Mode", Type, 16}, + {"New", Func, 0}, + {"NewIdentifier", Func, 0}, + {"NilNode", Type, 1}, + {"NilNode.NodeType", Field, 4}, + {"NilNode.Pos", Field, 1}, + {"Node", Type, 0}, + {"NodeAction", Const, 0}, + {"NodeBool", Const, 0}, + {"NodeBreak", Const, 18}, + {"NodeChain", Const, 1}, + {"NodeCommand", Const, 0}, + {"NodeComment", Const, 16}, + {"NodeContinue", Const, 18}, + {"NodeDot", Const, 0}, + {"NodeField", Const, 0}, + {"NodeIdentifier", Const, 0}, + {"NodeIf", Const, 0}, + {"NodeList", Const, 0}, + {"NodeNil", Const, 1}, + {"NodeNumber", Const, 0}, + {"NodePipe", Const, 0}, + {"NodeRange", Const, 0}, + {"NodeString", Const, 0}, + {"NodeTemplate", Const, 0}, + {"NodeText", Const, 0}, + {"NodeType", Type, 0}, + {"NodeVariable", Const, 0}, + {"NodeWith", Const, 0}, + {"NumberNode", Type, 0}, + {"NumberNode.Complex128", Field, 0}, + {"NumberNode.Float64", Field, 0}, + {"NumberNode.Int64", Field, 0}, + {"NumberNode.IsComplex", Field, 0}, + {"NumberNode.IsFloat", Field, 0}, + {"NumberNode.IsInt", Field, 0}, + {"NumberNode.IsUint", Field, 0}, + {"NumberNode.NodeType", Field, 0}, + {"NumberNode.Pos", Field, 1}, + {"NumberNode.Text", Field, 0}, + {"NumberNode.Uint64", Field, 0}, + {"Parse", Func, 0}, + {"ParseComments", Const, 16}, + {"PipeNode", Type, 0}, + {"PipeNode.Cmds", Field, 0}, + {"PipeNode.Decl", Field, 0}, + {"PipeNode.IsAssign", Field, 11}, + {"PipeNode.Line", Field, 0}, + {"PipeNode.NodeType", Field, 0}, + {"PipeNode.Pos", Field, 1}, + {"Pos", Type, 1}, + {"RangeNode", Type, 0}, + {"RangeNode.BranchNode", Field, 0}, + {"SkipFuncCheck", Const, 17}, + {"StringNode", Type, 0}, + {"StringNode.NodeType", Field, 0}, + {"StringNode.Pos", Field, 1}, + {"StringNode.Quoted", Field, 0}, + {"StringNode.Text", Field, 0}, + {"TemplateNode", Type, 0}, + {"TemplateNode.Line", Field, 0}, + {"TemplateNode.Name", Field, 0}, + {"TemplateNode.NodeType", Field, 0}, + {"TemplateNode.Pipe", Field, 0}, + {"TemplateNode.Pos", Field, 1}, + {"TextNode", Type, 0}, + {"TextNode.NodeType", Field, 0}, + {"TextNode.Pos", Field, 1}, + {"TextNode.Text", Field, 0}, + {"Tree", Type, 0}, + {"Tree.Mode", Field, 16}, + {"Tree.Name", Field, 0}, + {"Tree.ParseName", Field, 1}, + {"Tree.Root", Field, 0}, + {"VariableNode", Type, 0}, + {"VariableNode.Ident", Field, 0}, + {"VariableNode.NodeType", Field, 0}, + {"VariableNode.Pos", Field, 1}, + {"WithNode", Type, 0}, + {"WithNode.BranchNode", Field, 0}, + }, + "time": { + {"(*Location).String", Method, 0}, + {"(*ParseError).Error", Method, 0}, + {"(*Ticker).Reset", Method, 15}, + {"(*Ticker).Stop", Method, 0}, + {"(*Time).GobDecode", Method, 0}, + {"(*Time).UnmarshalBinary", Method, 2}, + {"(*Time).UnmarshalJSON", Method, 0}, + {"(*Time).UnmarshalText", Method, 2}, + {"(*Timer).Reset", Method, 1}, + {"(*Timer).Stop", Method, 0}, + {"(Duration).Abs", Method, 19}, + {"(Duration).Hours", Method, 0}, + {"(Duration).Microseconds", Method, 13}, + {"(Duration).Milliseconds", Method, 13}, + {"(Duration).Minutes", Method, 0}, + {"(Duration).Nanoseconds", Method, 0}, + {"(Duration).Round", Method, 9}, + {"(Duration).Seconds", Method, 0}, + {"(Duration).String", Method, 0}, + {"(Duration).Truncate", Method, 9}, + {"(Month).String", Method, 0}, + {"(Time).Add", Method, 0}, + {"(Time).AddDate", Method, 0}, + {"(Time).After", Method, 0}, + {"(Time).AppendFormat", Method, 5}, + {"(Time).Before", Method, 0}, + {"(Time).Clock", Method, 0}, + {"(Time).Compare", Method, 20}, + {"(Time).Date", Method, 0}, + {"(Time).Day", Method, 0}, + {"(Time).Equal", Method, 0}, + {"(Time).Format", Method, 0}, + {"(Time).GoString", Method, 17}, + {"(Time).GobEncode", Method, 0}, + {"(Time).Hour", Method, 0}, + {"(Time).ISOWeek", Method, 0}, + {"(Time).In", Method, 0}, + {"(Time).IsDST", Method, 17}, + {"(Time).IsZero", Method, 0}, + {"(Time).Local", Method, 0}, + {"(Time).Location", Method, 0}, + {"(Time).MarshalBinary", Method, 2}, + {"(Time).MarshalJSON", Method, 0}, + {"(Time).MarshalText", Method, 2}, + {"(Time).Minute", Method, 0}, + {"(Time).Month", Method, 0}, + {"(Time).Nanosecond", Method, 0}, + {"(Time).Round", Method, 1}, + {"(Time).Second", Method, 0}, + {"(Time).String", Method, 0}, + {"(Time).Sub", Method, 0}, + {"(Time).Truncate", Method, 1}, + {"(Time).UTC", Method, 0}, + {"(Time).Unix", Method, 0}, + {"(Time).UnixMicro", Method, 17}, + {"(Time).UnixMilli", Method, 17}, + {"(Time).UnixNano", Method, 0}, + {"(Time).Weekday", Method, 0}, + {"(Time).Year", Method, 0}, + {"(Time).YearDay", Method, 1}, + {"(Time).Zone", Method, 0}, + {"(Time).ZoneBounds", Method, 19}, + {"(Weekday).String", Method, 0}, + {"ANSIC", Const, 0}, + {"After", Func, 0}, + {"AfterFunc", Func, 0}, + {"April", Const, 0}, + {"August", Const, 0}, + {"Date", Func, 0}, + {"DateOnly", Const, 20}, + {"DateTime", Const, 20}, + {"December", Const, 0}, + {"Duration", Type, 0}, + {"February", Const, 0}, + {"FixedZone", Func, 0}, + {"Friday", Const, 0}, + {"Hour", Const, 0}, + {"January", Const, 0}, + {"July", Const, 0}, + {"June", Const, 0}, + {"Kitchen", Const, 0}, + {"Layout", Const, 17}, + {"LoadLocation", Func, 0}, + {"LoadLocationFromTZData", Func, 10}, + {"Local", Var, 0}, + {"Location", Type, 0}, + {"March", Const, 0}, + {"May", Const, 0}, + {"Microsecond", Const, 0}, + {"Millisecond", Const, 0}, + {"Minute", Const, 0}, + {"Monday", Const, 0}, + {"Month", Type, 0}, + {"Nanosecond", Const, 0}, + {"NewTicker", Func, 0}, + {"NewTimer", Func, 0}, + {"November", Const, 0}, + {"Now", Func, 0}, + {"October", Const, 0}, + {"Parse", Func, 0}, + {"ParseDuration", Func, 0}, + {"ParseError", Type, 0}, + {"ParseError.Layout", Field, 0}, + {"ParseError.LayoutElem", Field, 0}, + {"ParseError.Message", Field, 0}, + {"ParseError.Value", Field, 0}, + {"ParseError.ValueElem", Field, 0}, + {"ParseInLocation", Func, 1}, + {"RFC1123", Const, 0}, + {"RFC1123Z", Const, 0}, + {"RFC3339", Const, 0}, + {"RFC3339Nano", Const, 0}, + {"RFC822", Const, 0}, + {"RFC822Z", Const, 0}, + {"RFC850", Const, 0}, + {"RubyDate", Const, 0}, + {"Saturday", Const, 0}, + {"Second", Const, 0}, + {"September", Const, 0}, + {"Since", Func, 0}, + {"Sleep", Func, 0}, + {"Stamp", Const, 0}, + {"StampMicro", Const, 0}, + {"StampMilli", Const, 0}, + {"StampNano", Const, 0}, + {"Sunday", Const, 0}, + {"Thursday", Const, 0}, + {"Tick", Func, 0}, + {"Ticker", Type, 0}, + {"Ticker.C", Field, 0}, + {"Time", Type, 0}, + {"TimeOnly", Const, 20}, + {"Timer", Type, 0}, + {"Timer.C", Field, 0}, + {"Tuesday", Const, 0}, + {"UTC", Var, 0}, + {"Unix", Func, 0}, + {"UnixDate", Const, 0}, + {"UnixMicro", Func, 17}, + {"UnixMilli", Func, 17}, + {"Until", Func, 8}, + {"Wednesday", Const, 0}, + {"Weekday", Type, 0}, + }, + "unicode": { + {"(SpecialCase).ToLower", Method, 0}, + {"(SpecialCase).ToTitle", Method, 0}, + {"(SpecialCase).ToUpper", Method, 0}, + {"ASCII_Hex_Digit", Var, 0}, + {"Adlam", Var, 7}, + {"Ahom", Var, 5}, + {"Anatolian_Hieroglyphs", Var, 5}, + {"Arabic", Var, 0}, + {"Armenian", Var, 0}, + {"Avestan", Var, 0}, + {"AzeriCase", Var, 0}, + {"Balinese", Var, 0}, + {"Bamum", Var, 0}, + {"Bassa_Vah", Var, 4}, + {"Batak", Var, 0}, + {"Bengali", Var, 0}, + {"Bhaiksuki", Var, 7}, + {"Bidi_Control", Var, 0}, + {"Bopomofo", Var, 0}, + {"Brahmi", Var, 0}, + {"Braille", Var, 0}, + {"Buginese", Var, 0}, + {"Buhid", Var, 0}, + {"C", Var, 0}, + {"Canadian_Aboriginal", Var, 0}, + {"Carian", Var, 0}, + {"CaseRange", Type, 0}, + {"CaseRange.Delta", Field, 0}, + {"CaseRange.Hi", Field, 0}, + {"CaseRange.Lo", Field, 0}, + {"CaseRanges", Var, 0}, + {"Categories", Var, 0}, + {"Caucasian_Albanian", Var, 4}, + {"Cc", Var, 0}, + {"Cf", Var, 0}, + {"Chakma", Var, 1}, + {"Cham", Var, 0}, + {"Cherokee", Var, 0}, + {"Chorasmian", Var, 16}, + {"Co", Var, 0}, + {"Common", Var, 0}, + {"Coptic", Var, 0}, + {"Cs", Var, 0}, + {"Cuneiform", Var, 0}, + {"Cypriot", Var, 0}, + {"Cypro_Minoan", Var, 21}, + {"Cyrillic", Var, 0}, + {"Dash", Var, 0}, + {"Deprecated", Var, 0}, + {"Deseret", Var, 0}, + {"Devanagari", Var, 0}, + {"Diacritic", Var, 0}, + {"Digit", Var, 0}, + {"Dives_Akuru", Var, 16}, + {"Dogra", Var, 13}, + {"Duployan", Var, 4}, + {"Egyptian_Hieroglyphs", Var, 0}, + {"Elbasan", Var, 4}, + {"Elymaic", Var, 14}, + {"Ethiopic", Var, 0}, + {"Extender", Var, 0}, + {"FoldCategory", Var, 0}, + {"FoldScript", Var, 0}, + {"Georgian", Var, 0}, + {"Glagolitic", Var, 0}, + {"Gothic", Var, 0}, + {"Grantha", Var, 4}, + {"GraphicRanges", Var, 0}, + {"Greek", Var, 0}, + {"Gujarati", Var, 0}, + {"Gunjala_Gondi", Var, 13}, + {"Gurmukhi", Var, 0}, + {"Han", Var, 0}, + {"Hangul", Var, 0}, + {"Hanifi_Rohingya", Var, 13}, + {"Hanunoo", Var, 0}, + {"Hatran", Var, 5}, + {"Hebrew", Var, 0}, + {"Hex_Digit", Var, 0}, + {"Hiragana", Var, 0}, + {"Hyphen", Var, 0}, + {"IDS_Binary_Operator", Var, 0}, + {"IDS_Trinary_Operator", Var, 0}, + {"Ideographic", Var, 0}, + {"Imperial_Aramaic", Var, 0}, + {"In", Func, 2}, + {"Inherited", Var, 0}, + {"Inscriptional_Pahlavi", Var, 0}, + {"Inscriptional_Parthian", Var, 0}, + {"Is", Func, 0}, + {"IsControl", Func, 0}, + {"IsDigit", Func, 0}, + {"IsGraphic", Func, 0}, + {"IsLetter", Func, 0}, + {"IsLower", Func, 0}, + {"IsMark", Func, 0}, + {"IsNumber", Func, 0}, + {"IsOneOf", Func, 0}, + {"IsPrint", Func, 0}, + {"IsPunct", Func, 0}, + {"IsSpace", Func, 0}, + {"IsSymbol", Func, 0}, + {"IsTitle", Func, 0}, + {"IsUpper", Func, 0}, + {"Javanese", Var, 0}, + {"Join_Control", Var, 0}, + {"Kaithi", Var, 0}, + {"Kannada", Var, 0}, + {"Katakana", Var, 0}, + {"Kawi", Var, 21}, + {"Kayah_Li", Var, 0}, + {"Kharoshthi", Var, 0}, + {"Khitan_Small_Script", Var, 16}, + {"Khmer", Var, 0}, + {"Khojki", Var, 4}, + {"Khudawadi", Var, 4}, + {"L", Var, 0}, + {"Lao", Var, 0}, + {"Latin", Var, 0}, + {"Lepcha", Var, 0}, + {"Letter", Var, 0}, + {"Limbu", Var, 0}, + {"Linear_A", Var, 4}, + {"Linear_B", Var, 0}, + {"Lisu", Var, 0}, + {"Ll", Var, 0}, + {"Lm", Var, 0}, + {"Lo", Var, 0}, + {"Logical_Order_Exception", Var, 0}, + {"Lower", Var, 0}, + {"LowerCase", Const, 0}, + {"Lt", Var, 0}, + {"Lu", Var, 0}, + {"Lycian", Var, 0}, + {"Lydian", Var, 0}, + {"M", Var, 0}, + {"Mahajani", Var, 4}, + {"Makasar", Var, 13}, + {"Malayalam", Var, 0}, + {"Mandaic", Var, 0}, + {"Manichaean", Var, 4}, + {"Marchen", Var, 7}, + {"Mark", Var, 0}, + {"Masaram_Gondi", Var, 10}, + {"MaxASCII", Const, 0}, + {"MaxCase", Const, 0}, + {"MaxLatin1", Const, 0}, + {"MaxRune", Const, 0}, + {"Mc", Var, 0}, + {"Me", Var, 0}, + {"Medefaidrin", Var, 13}, + {"Meetei_Mayek", Var, 0}, + {"Mende_Kikakui", Var, 4}, + {"Meroitic_Cursive", Var, 1}, + {"Meroitic_Hieroglyphs", Var, 1}, + {"Miao", Var, 1}, + {"Mn", Var, 0}, + {"Modi", Var, 4}, + {"Mongolian", Var, 0}, + {"Mro", Var, 4}, + {"Multani", Var, 5}, + {"Myanmar", Var, 0}, + {"N", Var, 0}, + {"Nabataean", Var, 4}, + {"Nag_Mundari", Var, 21}, + {"Nandinagari", Var, 14}, + {"Nd", Var, 0}, + {"New_Tai_Lue", Var, 0}, + {"Newa", Var, 7}, + {"Nko", Var, 0}, + {"Nl", Var, 0}, + {"No", Var, 0}, + {"Noncharacter_Code_Point", Var, 0}, + {"Number", Var, 0}, + {"Nushu", Var, 10}, + {"Nyiakeng_Puachue_Hmong", Var, 14}, + {"Ogham", Var, 0}, + {"Ol_Chiki", Var, 0}, + {"Old_Hungarian", Var, 5}, + {"Old_Italic", Var, 0}, + {"Old_North_Arabian", Var, 4}, + {"Old_Permic", Var, 4}, + {"Old_Persian", Var, 0}, + {"Old_Sogdian", Var, 13}, + {"Old_South_Arabian", Var, 0}, + {"Old_Turkic", Var, 0}, + {"Old_Uyghur", Var, 21}, + {"Oriya", Var, 0}, + {"Osage", Var, 7}, + {"Osmanya", Var, 0}, + {"Other", Var, 0}, + {"Other_Alphabetic", Var, 0}, + {"Other_Default_Ignorable_Code_Point", Var, 0}, + {"Other_Grapheme_Extend", Var, 0}, + {"Other_ID_Continue", Var, 0}, + {"Other_ID_Start", Var, 0}, + {"Other_Lowercase", Var, 0}, + {"Other_Math", Var, 0}, + {"Other_Uppercase", Var, 0}, + {"P", Var, 0}, + {"Pahawh_Hmong", Var, 4}, + {"Palmyrene", Var, 4}, + {"Pattern_Syntax", Var, 0}, + {"Pattern_White_Space", Var, 0}, + {"Pau_Cin_Hau", Var, 4}, + {"Pc", Var, 0}, + {"Pd", Var, 0}, + {"Pe", Var, 0}, + {"Pf", Var, 0}, + {"Phags_Pa", Var, 0}, + {"Phoenician", Var, 0}, + {"Pi", Var, 0}, + {"Po", Var, 0}, + {"Prepended_Concatenation_Mark", Var, 7}, + {"PrintRanges", Var, 0}, + {"Properties", Var, 0}, + {"Ps", Var, 0}, + {"Psalter_Pahlavi", Var, 4}, + {"Punct", Var, 0}, + {"Quotation_Mark", Var, 0}, + {"Radical", Var, 0}, + {"Range16", Type, 0}, + {"Range16.Hi", Field, 0}, + {"Range16.Lo", Field, 0}, + {"Range16.Stride", Field, 0}, + {"Range32", Type, 0}, + {"Range32.Hi", Field, 0}, + {"Range32.Lo", Field, 0}, + {"Range32.Stride", Field, 0}, + {"RangeTable", Type, 0}, + {"RangeTable.LatinOffset", Field, 1}, + {"RangeTable.R16", Field, 0}, + {"RangeTable.R32", Field, 0}, + {"Regional_Indicator", Var, 10}, + {"Rejang", Var, 0}, + {"ReplacementChar", Const, 0}, + {"Runic", Var, 0}, + {"S", Var, 0}, + {"STerm", Var, 0}, + {"Samaritan", Var, 0}, + {"Saurashtra", Var, 0}, + {"Sc", Var, 0}, + {"Scripts", Var, 0}, + {"Sentence_Terminal", Var, 7}, + {"Sharada", Var, 1}, + {"Shavian", Var, 0}, + {"Siddham", Var, 4}, + {"SignWriting", Var, 5}, + {"SimpleFold", Func, 0}, + {"Sinhala", Var, 0}, + {"Sk", Var, 0}, + {"Sm", Var, 0}, + {"So", Var, 0}, + {"Soft_Dotted", Var, 0}, + {"Sogdian", Var, 13}, + {"Sora_Sompeng", Var, 1}, + {"Soyombo", Var, 10}, + {"Space", Var, 0}, + {"SpecialCase", Type, 0}, + {"Sundanese", Var, 0}, + {"Syloti_Nagri", Var, 0}, + {"Symbol", Var, 0}, + {"Syriac", Var, 0}, + {"Tagalog", Var, 0}, + {"Tagbanwa", Var, 0}, + {"Tai_Le", Var, 0}, + {"Tai_Tham", Var, 0}, + {"Tai_Viet", Var, 0}, + {"Takri", Var, 1}, + {"Tamil", Var, 0}, + {"Tangsa", Var, 21}, + {"Tangut", Var, 7}, + {"Telugu", Var, 0}, + {"Terminal_Punctuation", Var, 0}, + {"Thaana", Var, 0}, + {"Thai", Var, 0}, + {"Tibetan", Var, 0}, + {"Tifinagh", Var, 0}, + {"Tirhuta", Var, 4}, + {"Title", Var, 0}, + {"TitleCase", Const, 0}, + {"To", Func, 0}, + {"ToLower", Func, 0}, + {"ToTitle", Func, 0}, + {"ToUpper", Func, 0}, + {"Toto", Var, 21}, + {"TurkishCase", Var, 0}, + {"Ugaritic", Var, 0}, + {"Unified_Ideograph", Var, 0}, + {"Upper", Var, 0}, + {"UpperCase", Const, 0}, + {"UpperLower", Const, 0}, + {"Vai", Var, 0}, + {"Variation_Selector", Var, 0}, + {"Version", Const, 0}, + {"Vithkuqi", Var, 21}, + {"Wancho", Var, 14}, + {"Warang_Citi", Var, 4}, + {"White_Space", Var, 0}, + {"Yezidi", Var, 16}, + {"Yi", Var, 0}, + {"Z", Var, 0}, + {"Zanabazar_Square", Var, 10}, + {"Zl", Var, 0}, + {"Zp", Var, 0}, + {"Zs", Var, 0}, + }, + "unicode/utf16": { + {"AppendRune", Func, 20}, + {"Decode", Func, 0}, + {"DecodeRune", Func, 0}, + {"Encode", Func, 0}, + {"EncodeRune", Func, 0}, + {"IsSurrogate", Func, 0}, + {"RuneLen", Func, 23}, + }, + "unicode/utf8": { + {"AppendRune", Func, 18}, + {"DecodeLastRune", Func, 0}, + {"DecodeLastRuneInString", Func, 0}, + {"DecodeRune", Func, 0}, + {"DecodeRuneInString", Func, 0}, + {"EncodeRune", Func, 0}, + {"FullRune", Func, 0}, + {"FullRuneInString", Func, 0}, + {"MaxRune", Const, 0}, + {"RuneCount", Func, 0}, + {"RuneCountInString", Func, 0}, + {"RuneError", Const, 0}, + {"RuneLen", Func, 0}, + {"RuneSelf", Const, 0}, + {"RuneStart", Func, 0}, + {"UTFMax", Const, 0}, + {"Valid", Func, 0}, + {"ValidRune", Func, 1}, + {"ValidString", Func, 0}, + }, + "unique": { + {"(Handle).Value", Method, 23}, + {"Handle", Type, 23}, + {"Make", Func, 23}, + }, + "unsafe": { + {"Add", Func, 0}, + {"Alignof", Func, 0}, + {"Offsetof", Func, 0}, + {"Pointer", Type, 0}, + {"Sizeof", Func, 0}, + {"Slice", Func, 0}, + {"SliceData", Func, 0}, + {"String", Func, 0}, + {"StringData", Func, 0}, + }, +} diff --git a/vendor/golang.org/x/tools/internal/stdlib/stdlib.go b/vendor/golang.org/x/tools/internal/stdlib/stdlib.go new file mode 100644 index 0000000000..98904017f2 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/stdlib/stdlib.go @@ -0,0 +1,97 @@ +// Copyright 2022 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 generate.go + +// Package stdlib provides a table of all exported symbols in the +// standard library, along with the version at which they first +// appeared. +package stdlib + +import ( + "fmt" + "strings" +) + +type Symbol struct { + Name string + Kind Kind + Version Version // Go version that first included the symbol +} + +// A Kind indicates the kind of a symbol: +// function, variable, constant, type, and so on. +type Kind int8 + +const ( + Invalid Kind = iota // Example name: + Type // "Buffer" + Func // "Println" + Var // "EOF" + Const // "Pi" + Field // "Point.X" + Method // "(*Buffer).Grow" +) + +func (kind Kind) String() string { + return [...]string{ + Invalid: "invalid", + Type: "type", + Func: "func", + Var: "var", + Const: "const", + Field: "field", + Method: "method", + }[kind] +} + +// A Version represents a version of Go of the form "go1.%d". +type Version int8 + +// String returns a version string of the form "go1.23", without allocating. +func (v Version) String() string { return versions[v] } + +var versions [30]string // (increase constant as needed) + +func init() { + for i := range versions { + versions[i] = fmt.Sprintf("go1.%d", i) + } +} + +// HasPackage reports whether the specified package path is part of +// the standard library's public API. +func HasPackage(path string) bool { + _, ok := PackageSymbols[path] + return ok +} + +// SplitField splits the field symbol name into type and field +// components. It must be called only on Field symbols. +// +// Example: "File.Package" -> ("File", "Package") +func (sym *Symbol) SplitField() (typename, name string) { + if sym.Kind != Field { + panic("not a field") + } + typename, name, _ = strings.Cut(sym.Name, ".") + return +} + +// SplitMethod splits the method symbol name into pointer, receiver, +// and method components. It must be called only on Method symbols. +// +// Example: "(*Buffer).Grow" -> (true, "Buffer", "Grow") +func (sym *Symbol) SplitMethod() (ptr bool, recv, name string) { + if sym.Kind != Method { + panic("not a method") + } + recv, name, _ = strings.Cut(sym.Name, ".") + recv = recv[len("(") : len(recv)-len(")")] + ptr = recv[0] == '*' + if ptr { + recv = recv[len("*"):] + } + return +} diff --git a/vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go b/vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go index 7e638ec24f..ff9437a36c 100644 --- a/vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go +++ b/vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go @@ -34,30 +34,16 @@ func GetLines(file *token.File) []int { lines []int _ []struct{} } - type tokenFile118 struct { - _ *token.FileSet // deleted in go1.19 - tokenFile119 - } - - type uP = unsafe.Pointer - switch unsafe.Sizeof(*file) { - case unsafe.Sizeof(tokenFile118{}): - var ptr *tokenFile118 - *(*uP)(uP(&ptr)) = uP(file) - ptr.mu.Lock() - defer ptr.mu.Unlock() - return ptr.lines - case unsafe.Sizeof(tokenFile119{}): - var ptr *tokenFile119 - *(*uP)(uP(&ptr)) = uP(file) - ptr.mu.Lock() - defer ptr.mu.Unlock() - return ptr.lines - - default: + if unsafe.Sizeof(*file) != unsafe.Sizeof(tokenFile119{}) { panic("unexpected token.File size") } + var ptr *tokenFile119 + type uP = unsafe.Pointer + *(*uP)(uP(&ptr)) = uP(file) + ptr.mu.Lock() + defer ptr.mu.Unlock() + return ptr.lines } // AddExistingFiles adds the specified files to the FileSet if they diff --git a/vendor/golang.org/x/tools/internal/typeparams/common.go b/vendor/golang.org/x/tools/internal/typeparams/common.go deleted file mode 100644 index cfba8189f1..0000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/common.go +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright 2021 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 typeparams contains common utilities for writing tools that interact -// with generic Go code, as introduced with Go 1.18. -// -// Many of the types and functions in this package are proxies for the new APIs -// introduced in the standard library with Go 1.18. For example, the -// typeparams.Union type is an alias for go/types.Union, and the ForTypeSpec -// function returns the value of the go/ast.TypeSpec.TypeParams field. At Go -// versions older than 1.18 these helpers are implemented as stubs, allowing -// users of this package to write code that handles generic constructs inline, -// even if the Go version being used to compile does not support generics. -// -// Additionally, this package contains common utilities for working with the -// new generic constructs, to supplement the standard library APIs. Notably, -// the StructuralTerms API computes a minimal representation of the structural -// restrictions on a type parameter. -// -// An external version of these APIs is available in the -// golang.org/x/exp/typeparams module. -package typeparams - -import ( - "go/ast" - "go/token" - "go/types" -) - -// UnpackIndexExpr extracts data from AST nodes that represent index -// expressions. -// -// For an ast.IndexExpr, the resulting indices slice will contain exactly one -// index expression. For an ast.IndexListExpr (go1.18+), it may have a variable -// number of index expressions. -// -// For nodes that don't represent index expressions, the first return value of -// UnpackIndexExpr will be nil. -func UnpackIndexExpr(n ast.Node) (x ast.Expr, lbrack token.Pos, indices []ast.Expr, rbrack token.Pos) { - switch e := n.(type) { - case *ast.IndexExpr: - return e.X, e.Lbrack, []ast.Expr{e.Index}, e.Rbrack - case *IndexListExpr: - return e.X, e.Lbrack, e.Indices, e.Rbrack - } - return nil, token.NoPos, nil, token.NoPos -} - -// PackIndexExpr returns an *ast.IndexExpr or *ast.IndexListExpr, depending on -// the cardinality of indices. Calling PackIndexExpr with len(indices) == 0 -// will panic. -func PackIndexExpr(x ast.Expr, lbrack token.Pos, indices []ast.Expr, rbrack token.Pos) ast.Expr { - switch len(indices) { - case 0: - panic("empty indices") - case 1: - return &ast.IndexExpr{ - X: x, - Lbrack: lbrack, - Index: indices[0], - Rbrack: rbrack, - } - default: - return &IndexListExpr{ - X: x, - Lbrack: lbrack, - Indices: indices, - Rbrack: rbrack, - } - } -} - -// IsTypeParam reports whether t is a type parameter. -func IsTypeParam(t types.Type) bool { - _, ok := t.(*TypeParam) - return ok -} - -// OriginMethod returns the origin method associated with the method fn. -// For methods on a non-generic receiver base type, this is just -// fn. However, for methods with a generic receiver, OriginMethod returns the -// corresponding method in the method set of the origin type. -// -// As a special case, if fn is not a method (has no receiver), OriginMethod -// returns fn. -func OriginMethod(fn *types.Func) *types.Func { - recv := fn.Type().(*types.Signature).Recv() - if recv == nil { - return fn - } - base := recv.Type() - p, isPtr := base.(*types.Pointer) - if isPtr { - base = p.Elem() - } - named, isNamed := base.(*types.Named) - if !isNamed { - // Receiver is a *types.Interface. - return fn - } - if ForNamed(named).Len() == 0 { - // Receiver base has no type parameters, so we can avoid the lookup below. - return fn - } - orig := NamedTypeOrigin(named) - gfn, _, _ := types.LookupFieldOrMethod(orig, true, fn.Pkg(), fn.Name()) - return gfn.(*types.Func) -} - -// GenericAssignableTo is a generalization of types.AssignableTo that -// implements the following rule for uninstantiated generic types: -// -// If V and T are generic named types, then V is considered assignable to T if, -// for every possible instantation of V[A_1, ..., A_N], the instantiation -// T[A_1, ..., A_N] is valid and V[A_1, ..., A_N] implements T[A_1, ..., A_N]. -// -// If T has structural constraints, they must be satisfied by V. -// -// For example, consider the following type declarations: -// -// type Interface[T any] interface { -// Accept(T) -// } -// -// type Container[T any] struct { -// Element T -// } -// -// func (c Container[T]) Accept(t T) { c.Element = t } -// -// In this case, GenericAssignableTo reports that instantiations of Container -// are assignable to the corresponding instantiation of Interface. -func GenericAssignableTo(ctxt *Context, V, T types.Type) bool { - // If V and T are not both named, or do not have matching non-empty type - // parameter lists, fall back on types.AssignableTo. - - VN, Vnamed := V.(*types.Named) - TN, Tnamed := T.(*types.Named) - if !Vnamed || !Tnamed { - return types.AssignableTo(V, T) - } - - vtparams := ForNamed(VN) - ttparams := ForNamed(TN) - if vtparams.Len() == 0 || vtparams.Len() != ttparams.Len() || NamedTypeArgs(VN).Len() != 0 || NamedTypeArgs(TN).Len() != 0 { - return types.AssignableTo(V, T) - } - - // V and T have the same (non-zero) number of type params. Instantiate both - // with the type parameters of V. This must always succeed for V, and will - // succeed for T if and only if the type set of each type parameter of V is a - // subset of the type set of the corresponding type parameter of T, meaning - // that every instantiation of V corresponds to a valid instantiation of T. - - // Minor optimization: ensure we share a context across the two - // instantiations below. - if ctxt == nil { - ctxt = NewContext() - } - - var targs []types.Type - for i := 0; i < vtparams.Len(); i++ { - targs = append(targs, vtparams.At(i)) - } - - vinst, err := Instantiate(ctxt, V, targs, true) - if err != nil { - panic("type parameters should satisfy their own constraints") - } - - tinst, err := Instantiate(ctxt, T, targs, true) - if err != nil { - return false - } - - return types.AssignableTo(vinst, tinst) -} diff --git a/vendor/golang.org/x/tools/internal/typeparams/coretype.go b/vendor/golang.org/x/tools/internal/typeparams/coretype.go deleted file mode 100644 index 993135ec90..0000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/coretype.go +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2022 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 typeparams - -import ( - "go/types" -) - -// CoreType returns the core type of T or nil if T does not have a core type. -// -// See https://go.dev/ref/spec#Core_types for the definition of a core type. -func CoreType(T types.Type) types.Type { - U := T.Underlying() - if _, ok := U.(*types.Interface); !ok { - return U // for non-interface types, - } - - terms, err := _NormalTerms(U) - if len(terms) == 0 || err != nil { - // len(terms) -> empty type set of interface. - // err != nil => U is invalid, exceeds complexity bounds, or has an empty type set. - return nil // no core type. - } - - U = terms[0].Type().Underlying() - var identical int // i in [0,identical) => Identical(U, terms[i].Type().Underlying()) - for identical = 1; identical < len(terms); identical++ { - if !types.Identical(U, terms[identical].Type().Underlying()) { - break - } - } - - if identical == len(terms) { - // https://go.dev/ref/spec#Core_types - // "There is a single type U which is the underlying type of all types in the type set of T" - return U - } - ch, ok := U.(*types.Chan) - if !ok { - return nil // no core type as identical < len(terms) and U is not a channel. - } - // https://go.dev/ref/spec#Core_types - // "the type chan E if T contains only bidirectional channels, or the type chan<- E or - // <-chan E depending on the direction of the directional channels present." - for chans := identical; chans < len(terms); chans++ { - curr, ok := terms[chans].Type().Underlying().(*types.Chan) - if !ok { - return nil - } - if !types.Identical(ch.Elem(), curr.Elem()) { - return nil // channel elements are not identical. - } - if ch.Dir() == types.SendRecv { - // ch is bidirectional. We can safely always use curr's direction. - ch = curr - } else if curr.Dir() != types.SendRecv && ch.Dir() != curr.Dir() { - // ch and curr are not bidirectional and not the same direction. - return nil - } - } - return ch -} - -// _NormalTerms returns a slice of terms representing the normalized structural -// type restrictions of a type, if any. -// -// For all types other than *types.TypeParam, *types.Interface, and -// *types.Union, this is just a single term with Tilde() == false and -// Type() == typ. For *types.TypeParam, *types.Interface, and *types.Union, see -// below. -// -// Structural type restrictions of a type parameter are created via -// non-interface types embedded in its constraint interface (directly, or via a -// chain of interface embeddings). For example, in the declaration type -// T[P interface{~int; m()}] int the structural restriction of the type -// parameter P is ~int. -// -// With interface embedding and unions, the specification of structural type -// restrictions may be arbitrarily complex. For example, consider the -// following: -// -// type A interface{ ~string|~[]byte } -// -// type B interface{ int|string } -// -// type C interface { ~string|~int } -// -// type T[P interface{ A|B; C }] int -// -// In this example, the structural type restriction of P is ~string|int: A|B -// expands to ~string|~[]byte|int|string, which reduces to ~string|~[]byte|int, -// which when intersected with C (~string|~int) yields ~string|int. -// -// _NormalTerms computes these expansions and reductions, producing a -// "normalized" form of the embeddings. A structural restriction is normalized -// if it is a single union containing no interface terms, and is minimal in the -// sense that removing any term changes the set of types satisfying the -// constraint. It is left as a proof for the reader that, modulo sorting, there -// is exactly one such normalized form. -// -// Because the minimal representation always takes this form, _NormalTerms -// returns a slice of tilde terms corresponding to the terms of the union in -// the normalized structural restriction. An error is returned if the type is -// invalid, exceeds complexity bounds, or has an empty type set. In the latter -// case, _NormalTerms returns ErrEmptyTypeSet. -// -// _NormalTerms makes no guarantees about the order of terms, except that it -// is deterministic. -func _NormalTerms(typ types.Type) ([]*Term, error) { - switch typ := typ.(type) { - case *TypeParam: - return StructuralTerms(typ) - case *Union: - return UnionTermSet(typ) - case *types.Interface: - return InterfaceTermSet(typ) - default: - return []*Term{NewTerm(false, typ)}, nil - } -} diff --git a/vendor/golang.org/x/tools/internal/typeparams/enabled_go117.go b/vendor/golang.org/x/tools/internal/typeparams/enabled_go117.go deleted file mode 100644 index 18212390e1..0000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/enabled_go117.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2021 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:build !go1.18 -// +build !go1.18 - -package typeparams - -// Enabled reports whether type parameters are enabled in the current build -// environment. -const Enabled = false diff --git a/vendor/golang.org/x/tools/internal/typeparams/enabled_go118.go b/vendor/golang.org/x/tools/internal/typeparams/enabled_go118.go deleted file mode 100644 index d67148823c..0000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/enabled_go118.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2021 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:build go1.18 -// +build go1.18 - -package typeparams - -// Note: this constant is in a separate file as this is the only acceptable -// diff between the <1.18 API of this package and the 1.18 API. - -// Enabled reports whether type parameters are enabled in the current build -// environment. -const Enabled = true diff --git a/vendor/golang.org/x/tools/internal/typeparams/normalize.go b/vendor/golang.org/x/tools/internal/typeparams/normalize.go deleted file mode 100644 index 9c631b6512..0000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/normalize.go +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright 2021 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 typeparams - -import ( - "errors" - "fmt" - "go/types" - "os" - "strings" -) - -//go:generate go run copytermlist.go - -const debug = false - -var ErrEmptyTypeSet = errors.New("empty type set") - -// StructuralTerms returns a slice of terms representing the normalized -// structural type restrictions of a type parameter, if any. -// -// Structural type restrictions of a type parameter are created via -// non-interface types embedded in its constraint interface (directly, or via a -// chain of interface embeddings). For example, in the declaration -// -// type T[P interface{~int; m()}] int -// -// the structural restriction of the type parameter P is ~int. -// -// With interface embedding and unions, the specification of structural type -// restrictions may be arbitrarily complex. For example, consider the -// following: -// -// type A interface{ ~string|~[]byte } -// -// type B interface{ int|string } -// -// type C interface { ~string|~int } -// -// type T[P interface{ A|B; C }] int -// -// In this example, the structural type restriction of P is ~string|int: A|B -// expands to ~string|~[]byte|int|string, which reduces to ~string|~[]byte|int, -// which when intersected with C (~string|~int) yields ~string|int. -// -// StructuralTerms computes these expansions and reductions, producing a -// "normalized" form of the embeddings. A structural restriction is normalized -// if it is a single union containing no interface terms, and is minimal in the -// sense that removing any term changes the set of types satisfying the -// constraint. It is left as a proof for the reader that, modulo sorting, there -// is exactly one such normalized form. -// -// Because the minimal representation always takes this form, StructuralTerms -// returns a slice of tilde terms corresponding to the terms of the union in -// the normalized structural restriction. An error is returned if the -// constraint interface is invalid, exceeds complexity bounds, or has an empty -// type set. In the latter case, StructuralTerms returns ErrEmptyTypeSet. -// -// StructuralTerms makes no guarantees about the order of terms, except that it -// is deterministic. -func StructuralTerms(tparam *TypeParam) ([]*Term, error) { - constraint := tparam.Constraint() - if constraint == nil { - return nil, fmt.Errorf("%s has nil constraint", tparam) - } - iface, _ := constraint.Underlying().(*types.Interface) - if iface == nil { - return nil, fmt.Errorf("constraint is %T, not *types.Interface", constraint.Underlying()) - } - return InterfaceTermSet(iface) -} - -// InterfaceTermSet computes the normalized terms for a constraint interface, -// returning an error if the term set cannot be computed or is empty. In the -// latter case, the error will be ErrEmptyTypeSet. -// -// See the documentation of StructuralTerms for more information on -// normalization. -func InterfaceTermSet(iface *types.Interface) ([]*Term, error) { - return computeTermSet(iface) -} - -// UnionTermSet computes the normalized terms for a union, returning an error -// if the term set cannot be computed or is empty. In the latter case, the -// error will be ErrEmptyTypeSet. -// -// See the documentation of StructuralTerms for more information on -// normalization. -func UnionTermSet(union *Union) ([]*Term, error) { - return computeTermSet(union) -} - -func computeTermSet(typ types.Type) ([]*Term, error) { - tset, err := computeTermSetInternal(typ, make(map[types.Type]*termSet), 0) - if err != nil { - return nil, err - } - if tset.terms.isEmpty() { - return nil, ErrEmptyTypeSet - } - if tset.terms.isAll() { - return nil, nil - } - var terms []*Term - for _, term := range tset.terms { - terms = append(terms, NewTerm(term.tilde, term.typ)) - } - return terms, nil -} - -// A termSet holds the normalized set of terms for a given type. -// -// The name termSet is intentionally distinct from 'type set': a type set is -// all types that implement a type (and includes method restrictions), whereas -// a term set just represents the structural restrictions on a type. -type termSet struct { - complete bool - terms termlist -} - -func indentf(depth int, format string, args ...interface{}) { - fmt.Fprintf(os.Stderr, strings.Repeat(".", depth)+format+"\n", args...) -} - -func computeTermSetInternal(t types.Type, seen map[types.Type]*termSet, depth int) (res *termSet, err error) { - if t == nil { - panic("nil type") - } - - if debug { - indentf(depth, "%s", t.String()) - defer func() { - if err != nil { - indentf(depth, "=> %s", err) - } else { - indentf(depth, "=> %s", res.terms.String()) - } - }() - } - - const maxTermCount = 100 - if tset, ok := seen[t]; ok { - if !tset.complete { - return nil, fmt.Errorf("cycle detected in the declaration of %s", t) - } - return tset, nil - } - - // Mark the current type as seen to avoid infinite recursion. - tset := new(termSet) - defer func() { - tset.complete = true - }() - seen[t] = tset - - switch u := t.Underlying().(type) { - case *types.Interface: - // The term set of an interface is the intersection of the term sets of its - // embedded types. - tset.terms = allTermlist - for i := 0; i < u.NumEmbeddeds(); i++ { - embedded := u.EmbeddedType(i) - if _, ok := embedded.Underlying().(*TypeParam); ok { - return nil, fmt.Errorf("invalid embedded type %T", embedded) - } - tset2, err := computeTermSetInternal(embedded, seen, depth+1) - if err != nil { - return nil, err - } - tset.terms = tset.terms.intersect(tset2.terms) - } - case *Union: - // The term set of a union is the union of term sets of its terms. - tset.terms = nil - for i := 0; i < u.Len(); i++ { - t := u.Term(i) - var terms termlist - switch t.Type().Underlying().(type) { - case *types.Interface: - tset2, err := computeTermSetInternal(t.Type(), seen, depth+1) - if err != nil { - return nil, err - } - terms = tset2.terms - case *TypeParam, *Union: - // A stand-alone type parameter or union is not permitted as union - // term. - return nil, fmt.Errorf("invalid union term %T", t) - default: - if t.Type() == types.Typ[types.Invalid] { - continue - } - terms = termlist{{t.Tilde(), t.Type()}} - } - tset.terms = tset.terms.union(terms) - if len(tset.terms) > maxTermCount { - return nil, fmt.Errorf("exceeded max term count %d", maxTermCount) - } - } - case *TypeParam: - panic("unreachable") - default: - // For all other types, the term set is just a single non-tilde term - // holding the type itself. - if u != types.Typ[types.Invalid] { - tset.terms = termlist{{false, t}} - } - } - return tset, nil -} - -// under is a facade for the go/types internal function of the same name. It is -// used by typeterm.go. -func under(t types.Type) types.Type { - return t.Underlying() -} diff --git a/vendor/golang.org/x/tools/internal/typeparams/termlist.go b/vendor/golang.org/x/tools/internal/typeparams/termlist.go deleted file mode 100644 index 933106a23d..0000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/termlist.go +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2021 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. - -// Code generated by copytermlist.go DO NOT EDIT. - -package typeparams - -import ( - "bytes" - "go/types" -) - -// A termlist represents the type set represented by the union -// t1 ∪ y2 ∪ ... tn of the type sets of the terms t1 to tn. -// A termlist is in normal form if all terms are disjoint. -// termlist operations don't require the operands to be in -// normal form. -type termlist []*term - -// allTermlist represents the set of all types. -// It is in normal form. -var allTermlist = termlist{new(term)} - -// String prints the termlist exactly (without normalization). -func (xl termlist) String() string { - if len(xl) == 0 { - return "∅" - } - var buf bytes.Buffer - for i, x := range xl { - if i > 0 { - buf.WriteString(" ∪ ") - } - buf.WriteString(x.String()) - } - return buf.String() -} - -// isEmpty reports whether the termlist xl represents the empty set of types. -func (xl termlist) isEmpty() bool { - // If there's a non-nil term, the entire list is not empty. - // If the termlist is in normal form, this requires at most - // one iteration. - for _, x := range xl { - if x != nil { - return false - } - } - return true -} - -// isAll reports whether the termlist xl represents the set of all types. -func (xl termlist) isAll() bool { - // If there's a 𝓤 term, the entire list is 𝓤. - // If the termlist is in normal form, this requires at most - // one iteration. - for _, x := range xl { - if x != nil && x.typ == nil { - return true - } - } - return false -} - -// norm returns the normal form of xl. -func (xl termlist) norm() termlist { - // Quadratic algorithm, but good enough for now. - // TODO(gri) fix asymptotic performance - used := make([]bool, len(xl)) - var rl termlist - for i, xi := range xl { - if xi == nil || used[i] { - continue - } - for j := i + 1; j < len(xl); j++ { - xj := xl[j] - if xj == nil || used[j] { - continue - } - if u1, u2 := xi.union(xj); u2 == nil { - // If we encounter a 𝓤 term, the entire list is 𝓤. - // Exit early. - // (Note that this is not just an optimization; - // if we continue, we may end up with a 𝓤 term - // and other terms and the result would not be - // in normal form.) - if u1.typ == nil { - return allTermlist - } - xi = u1 - used[j] = true // xj is now unioned into xi - ignore it in future iterations - } - } - rl = append(rl, xi) - } - return rl -} - -// union returns the union xl ∪ yl. -func (xl termlist) union(yl termlist) termlist { - return append(xl, yl...).norm() -} - -// intersect returns the intersection xl ∩ yl. -func (xl termlist) intersect(yl termlist) termlist { - if xl.isEmpty() || yl.isEmpty() { - return nil - } - - // Quadratic algorithm, but good enough for now. - // TODO(gri) fix asymptotic performance - var rl termlist - for _, x := range xl { - for _, y := range yl { - if r := x.intersect(y); r != nil { - rl = append(rl, r) - } - } - } - return rl.norm() -} - -// equal reports whether xl and yl represent the same type set. -func (xl termlist) equal(yl termlist) bool { - // TODO(gri) this should be more efficient - return xl.subsetOf(yl) && yl.subsetOf(xl) -} - -// includes reports whether t ∈ xl. -func (xl termlist) includes(t types.Type) bool { - for _, x := range xl { - if x.includes(t) { - return true - } - } - return false -} - -// supersetOf reports whether y ⊆ xl. -func (xl termlist) supersetOf(y *term) bool { - for _, x := range xl { - if y.subsetOf(x) { - return true - } - } - return false -} - -// subsetOf reports whether xl ⊆ yl. -func (xl termlist) subsetOf(yl termlist) bool { - if yl.isEmpty() { - return xl.isEmpty() - } - - // each term x of xl must be a subset of yl - for _, x := range xl { - if !yl.supersetOf(x) { - return false // x is not a subset yl - } - } - return true -} diff --git a/vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go b/vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go deleted file mode 100644 index b4788978ff..0000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2021 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:build !go1.18 -// +build !go1.18 - -package typeparams - -import ( - "go/ast" - "go/token" - "go/types" -) - -func unsupported() { - panic("type parameters are unsupported at this go version") -} - -// IndexListExpr is a placeholder type, as type parameters are not supported at -// this Go version. Its methods panic on use. -type IndexListExpr struct { - ast.Expr - X ast.Expr // expression - Lbrack token.Pos // position of "[" - Indices []ast.Expr // index expressions - Rbrack token.Pos // position of "]" -} - -// ForTypeSpec returns an empty field list, as type parameters on not supported -// at this Go version. -func ForTypeSpec(*ast.TypeSpec) *ast.FieldList { - return nil -} - -// ForFuncType returns an empty field list, as type parameters are not -// supported at this Go version. -func ForFuncType(*ast.FuncType) *ast.FieldList { - return nil -} - -// TypeParam is a placeholder type, as type parameters are not supported at -// this Go version. Its methods panic on use. -type TypeParam struct{ types.Type } - -func (*TypeParam) Index() int { unsupported(); return 0 } -func (*TypeParam) Constraint() types.Type { unsupported(); return nil } -func (*TypeParam) Obj() *types.TypeName { unsupported(); return nil } - -// TypeParamList is a placeholder for an empty type parameter list. -type TypeParamList struct{} - -func (*TypeParamList) Len() int { return 0 } -func (*TypeParamList) At(int) *TypeParam { unsupported(); return nil } - -// TypeList is a placeholder for an empty type list. -type TypeList struct{} - -func (*TypeList) Len() int { return 0 } -func (*TypeList) At(int) types.Type { unsupported(); return nil } - -// NewTypeParam is unsupported at this Go version, and panics. -func NewTypeParam(name *types.TypeName, constraint types.Type) *TypeParam { - unsupported() - return nil -} - -// SetTypeParamConstraint is unsupported at this Go version, and panics. -func SetTypeParamConstraint(tparam *TypeParam, constraint types.Type) { - unsupported() -} - -// NewSignatureType calls types.NewSignature, panicking if recvTypeParams or -// typeParams is non-empty. -func NewSignatureType(recv *types.Var, recvTypeParams, typeParams []*TypeParam, params, results *types.Tuple, variadic bool) *types.Signature { - if len(recvTypeParams) != 0 || len(typeParams) != 0 { - panic("signatures cannot have type parameters at this Go version") - } - return types.NewSignature(recv, params, results, variadic) -} - -// ForSignature returns an empty slice. -func ForSignature(*types.Signature) *TypeParamList { - return nil -} - -// RecvTypeParams returns a nil slice. -func RecvTypeParams(sig *types.Signature) *TypeParamList { - return nil -} - -// IsComparable returns false, as no interfaces are type-restricted at this Go -// version. -func IsComparable(*types.Interface) bool { - return false -} - -// IsMethodSet returns true, as no interfaces are type-restricted at this Go -// version. -func IsMethodSet(*types.Interface) bool { - return true -} - -// IsImplicit returns false, as no interfaces are implicit at this Go version. -func IsImplicit(*types.Interface) bool { - return false -} - -// MarkImplicit does nothing, because this Go version does not have implicit -// interfaces. -func MarkImplicit(*types.Interface) {} - -// ForNamed returns an empty type parameter list, as type parameters are not -// supported at this Go version. -func ForNamed(*types.Named) *TypeParamList { - return nil -} - -// SetForNamed panics if tparams is non-empty. -func SetForNamed(_ *types.Named, tparams []*TypeParam) { - if len(tparams) > 0 { - unsupported() - } -} - -// NamedTypeArgs returns nil. -func NamedTypeArgs(*types.Named) *TypeList { - return nil -} - -// NamedTypeOrigin is the identity method at this Go version. -func NamedTypeOrigin(named *types.Named) types.Type { - return named -} - -// Term holds information about a structural type restriction. -type Term struct { - tilde bool - typ types.Type -} - -func (m *Term) Tilde() bool { return m.tilde } -func (m *Term) Type() types.Type { return m.typ } -func (m *Term) String() string { - pre := "" - if m.tilde { - pre = "~" - } - return pre + m.typ.String() -} - -// NewTerm is unsupported at this Go version, and panics. -func NewTerm(tilde bool, typ types.Type) *Term { - return &Term{tilde, typ} -} - -// Union is a placeholder type, as type parameters are not supported at this Go -// version. Its methods panic on use. -type Union struct{ types.Type } - -func (*Union) Len() int { return 0 } -func (*Union) Term(i int) *Term { unsupported(); return nil } - -// NewUnion is unsupported at this Go version, and panics. -func NewUnion(terms []*Term) *Union { - unsupported() - return nil -} - -// InitInstanceInfo is a noop at this Go version. -func InitInstanceInfo(*types.Info) {} - -// Instance is a placeholder type, as type parameters are not supported at this -// Go version. -type Instance struct { - TypeArgs *TypeList - Type types.Type -} - -// GetInstances returns a nil map, as type parameters are not supported at this -// Go version. -func GetInstances(info *types.Info) map[*ast.Ident]Instance { return nil } - -// Context is a placeholder type, as type parameters are not supported at -// this Go version. -type Context struct{} - -// NewContext returns a placeholder Context instance. -func NewContext() *Context { - return &Context{} -} - -// Instantiate is unsupported on this Go version, and panics. -func Instantiate(ctxt *Context, typ types.Type, targs []types.Type, validate bool) (types.Type, error) { - unsupported() - return nil, nil -} diff --git a/vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go b/vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go deleted file mode 100644 index 114a36b866..0000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2021 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:build go1.18 -// +build go1.18 - -package typeparams - -import ( - "go/ast" - "go/types" -) - -// IndexListExpr is an alias for ast.IndexListExpr. -type IndexListExpr = ast.IndexListExpr - -// ForTypeSpec returns n.TypeParams. -func ForTypeSpec(n *ast.TypeSpec) *ast.FieldList { - if n == nil { - return nil - } - return n.TypeParams -} - -// ForFuncType returns n.TypeParams. -func ForFuncType(n *ast.FuncType) *ast.FieldList { - if n == nil { - return nil - } - return n.TypeParams -} - -// TypeParam is an alias for types.TypeParam -type TypeParam = types.TypeParam - -// TypeParamList is an alias for types.TypeParamList -type TypeParamList = types.TypeParamList - -// TypeList is an alias for types.TypeList -type TypeList = types.TypeList - -// NewTypeParam calls types.NewTypeParam. -func NewTypeParam(name *types.TypeName, constraint types.Type) *TypeParam { - return types.NewTypeParam(name, constraint) -} - -// SetTypeParamConstraint calls tparam.SetConstraint(constraint). -func SetTypeParamConstraint(tparam *TypeParam, constraint types.Type) { - tparam.SetConstraint(constraint) -} - -// NewSignatureType calls types.NewSignatureType. -func NewSignatureType(recv *types.Var, recvTypeParams, typeParams []*TypeParam, params, results *types.Tuple, variadic bool) *types.Signature { - return types.NewSignatureType(recv, recvTypeParams, typeParams, params, results, variadic) -} - -// ForSignature returns sig.TypeParams() -func ForSignature(sig *types.Signature) *TypeParamList { - return sig.TypeParams() -} - -// RecvTypeParams returns sig.RecvTypeParams(). -func RecvTypeParams(sig *types.Signature) *TypeParamList { - return sig.RecvTypeParams() -} - -// IsComparable calls iface.IsComparable(). -func IsComparable(iface *types.Interface) bool { - return iface.IsComparable() -} - -// IsMethodSet calls iface.IsMethodSet(). -func IsMethodSet(iface *types.Interface) bool { - return iface.IsMethodSet() -} - -// IsImplicit calls iface.IsImplicit(). -func IsImplicit(iface *types.Interface) bool { - return iface.IsImplicit() -} - -// MarkImplicit calls iface.MarkImplicit(). -func MarkImplicit(iface *types.Interface) { - iface.MarkImplicit() -} - -// ForNamed extracts the (possibly empty) type parameter object list from -// named. -func ForNamed(named *types.Named) *TypeParamList { - return named.TypeParams() -} - -// SetForNamed sets the type params tparams on n. Each tparam must be of -// dynamic type *types.TypeParam. -func SetForNamed(n *types.Named, tparams []*TypeParam) { - n.SetTypeParams(tparams) -} - -// NamedTypeArgs returns named.TypeArgs(). -func NamedTypeArgs(named *types.Named) *TypeList { - return named.TypeArgs() -} - -// NamedTypeOrigin returns named.Orig(). -func NamedTypeOrigin(named *types.Named) types.Type { - return named.Origin() -} - -// Term is an alias for types.Term. -type Term = types.Term - -// NewTerm calls types.NewTerm. -func NewTerm(tilde bool, typ types.Type) *Term { - return types.NewTerm(tilde, typ) -} - -// Union is an alias for types.Union -type Union = types.Union - -// NewUnion calls types.NewUnion. -func NewUnion(terms []*Term) *Union { - return types.NewUnion(terms) -} - -// InitInstanceInfo initializes info to record information about type and -// function instances. -func InitInstanceInfo(info *types.Info) { - info.Instances = make(map[*ast.Ident]types.Instance) -} - -// Instance is an alias for types.Instance. -type Instance = types.Instance - -// GetInstances returns info.Instances. -func GetInstances(info *types.Info) map[*ast.Ident]Instance { - return info.Instances -} - -// Context is an alias for types.Context. -type Context = types.Context - -// NewContext calls types.NewContext. -func NewContext() *Context { - return types.NewContext() -} - -// Instantiate calls types.Instantiate. -func Instantiate(ctxt *Context, typ types.Type, targs []types.Type, validate bool) (types.Type, error) { - return types.Instantiate(ctxt, typ, targs, validate) -} diff --git a/vendor/golang.org/x/tools/internal/typeparams/typeterm.go b/vendor/golang.org/x/tools/internal/typeparams/typeterm.go deleted file mode 100644 index 7ddee28d98..0000000000 --- a/vendor/golang.org/x/tools/internal/typeparams/typeterm.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2021 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. - -// Code generated by copytermlist.go DO NOT EDIT. - -package typeparams - -import "go/types" - -// A term describes elementary type sets: -// -// ∅: (*term)(nil) == ∅ // set of no types (empty set) -// 𝓤: &term{} == 𝓤 // set of all types (𝓤niverse) -// T: &term{false, T} == {T} // set of type T -// ~t: &term{true, t} == {t' | under(t') == t} // set of types with underlying type t -// -type term struct { - tilde bool // valid if typ != nil - typ types.Type -} - -func (x *term) String() string { - switch { - case x == nil: - return "∅" - case x.typ == nil: - return "𝓤" - case x.tilde: - return "~" + x.typ.String() - default: - return x.typ.String() - } -} - -// equal reports whether x and y represent the same type set. -func (x *term) equal(y *term) bool { - // easy cases - switch { - case x == nil || y == nil: - return x == y - case x.typ == nil || y.typ == nil: - return x.typ == y.typ - } - // ∅ ⊂ x, y ⊂ 𝓤 - - return x.tilde == y.tilde && types.Identical(x.typ, y.typ) -} - -// union returns the union x ∪ y: zero, one, or two non-nil terms. -func (x *term) union(y *term) (_, _ *term) { - // easy cases - switch { - case x == nil && y == nil: - return nil, nil // ∅ ∪ ∅ == ∅ - case x == nil: - return y, nil // ∅ ∪ y == y - case y == nil: - return x, nil // x ∪ ∅ == x - case x.typ == nil: - return x, nil // 𝓤 ∪ y == 𝓤 - case y.typ == nil: - return y, nil // x ∪ 𝓤 == 𝓤 - } - // ∅ ⊂ x, y ⊂ 𝓤 - - if x.disjoint(y) { - return x, y // x ∪ y == (x, y) if x ∩ y == ∅ - } - // x.typ == y.typ - - // ~t ∪ ~t == ~t - // ~t ∪ T == ~t - // T ∪ ~t == ~t - // T ∪ T == T - if x.tilde || !y.tilde { - return x, nil - } - return y, nil -} - -// intersect returns the intersection x ∩ y. -func (x *term) intersect(y *term) *term { - // easy cases - switch { - case x == nil || y == nil: - return nil // ∅ ∩ y == ∅ and ∩ ∅ == ∅ - case x.typ == nil: - return y // 𝓤 ∩ y == y - case y.typ == nil: - return x // x ∩ 𝓤 == x - } - // ∅ ⊂ x, y ⊂ 𝓤 - - if x.disjoint(y) { - return nil // x ∩ y == ∅ if x ∩ y == ∅ - } - // x.typ == y.typ - - // ~t ∩ ~t == ~t - // ~t ∩ T == T - // T ∩ ~t == T - // T ∩ T == T - if !x.tilde || y.tilde { - return x - } - return y -} - -// includes reports whether t ∈ x. -func (x *term) includes(t types.Type) bool { - // easy cases - switch { - case x == nil: - return false // t ∈ ∅ == false - case x.typ == nil: - return true // t ∈ 𝓤 == true - } - // ∅ ⊂ x ⊂ 𝓤 - - u := t - if x.tilde { - u = under(u) - } - return types.Identical(x.typ, u) -} - -// subsetOf reports whether x ⊆ y. -func (x *term) subsetOf(y *term) bool { - // easy cases - switch { - case x == nil: - return true // ∅ ⊆ y == true - case y == nil: - return false // x ⊆ ∅ == false since x != ∅ - case y.typ == nil: - return true // x ⊆ 𝓤 == true - case x.typ == nil: - return false // 𝓤 ⊆ y == false since y != 𝓤 - } - // ∅ ⊂ x, y ⊂ 𝓤 - - if x.disjoint(y) { - return false // x ⊆ y == false if x ∩ y == ∅ - } - // x.typ == y.typ - - // ~t ⊆ ~t == true - // ~t ⊆ T == false - // T ⊆ ~t == true - // T ⊆ T == true - return !x.tilde || y.tilde -} - -// disjoint reports whether x ∩ y == ∅. -// x.typ and y.typ must not be nil. -func (x *term) disjoint(y *term) bool { - if debug && (x.typ == nil || y.typ == nil) { - panic("invalid argument(s)") - } - ux := x.typ - if y.tilde { - ux = under(ux) - } - uy := y.typ - if x.tilde { - uy = under(uy) - } - return !types.Identical(ux, uy) -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go b/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go new file mode 100644 index 0000000000..834e05381c --- /dev/null +++ b/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go @@ -0,0 +1,1560 @@ +// Copyright 2020 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 typesinternal + +//go:generate stringer -type=ErrorCode + +type ErrorCode int + +// This file defines the error codes that can be produced during type-checking. +// Collectively, these codes provide an identifier that may be used to +// implement special handling for certain types of errors. +// +// Error codes should be fine-grained enough that the exact nature of the error +// can be easily determined, but coarse enough that they are not an +// implementation detail of the type checking algorithm. As a rule-of-thumb, +// errors should be considered equivalent if there is a theoretical refactoring +// of the type checker in which they are emitted in exactly one place. For +// example, the type checker emits different error messages for "too many +// arguments" and "too few arguments", but one can imagine an alternative type +// checker where this check instead just emits a single "wrong number of +// arguments", so these errors should have the same code. +// +// Error code names should be as brief as possible while retaining accuracy and +// distinctiveness. In most cases names should start with an adjective +// describing the nature of the error (e.g. "invalid", "unused", "misplaced"), +// and end with a noun identifying the relevant language object. For example, +// "DuplicateDecl" or "InvalidSliceExpr". For brevity, naming follows the +// convention that "bad" implies a problem with syntax, and "invalid" implies a +// problem with types. + +const ( + // InvalidSyntaxTree occurs if an invalid syntax tree is provided + // to the type checker. It should never happen. + InvalidSyntaxTree ErrorCode = -1 +) + +const ( + _ ErrorCode = iota + + // Test is reserved for errors that only apply while in self-test mode. + Test + + /* package names */ + + // BlankPkgName occurs when a package name is the blank identifier "_". + // + // Per the spec: + // "The PackageName must not be the blank identifier." + BlankPkgName + + // MismatchedPkgName occurs when a file's package name doesn't match the + // package name already established by other files. + MismatchedPkgName + + // InvalidPkgUse occurs when a package identifier is used outside of a + // selector expression. + // + // Example: + // import "fmt" + // + // var _ = fmt + InvalidPkgUse + + /* imports */ + + // BadImportPath occurs when an import path is not valid. + BadImportPath + + // BrokenImport occurs when importing a package fails. + // + // Example: + // import "amissingpackage" + BrokenImport + + // ImportCRenamed occurs when the special import "C" is renamed. "C" is a + // pseudo-package, and must not be renamed. + // + // Example: + // import _ "C" + ImportCRenamed + + // UnusedImport occurs when an import is unused. + // + // Example: + // import "fmt" + // + // func main() {} + UnusedImport + + /* initialization */ + + // InvalidInitCycle occurs when an invalid cycle is detected within the + // initialization graph. + // + // Example: + // var x int = f() + // + // func f() int { return x } + InvalidInitCycle + + /* decls */ + + // DuplicateDecl occurs when an identifier is declared multiple times. + // + // Example: + // var x = 1 + // var x = 2 + DuplicateDecl + + // InvalidDeclCycle occurs when a declaration cycle is not valid. + // + // Example: + // import "unsafe" + // + // type T struct { + // a [n]int + // } + // + // var n = unsafe.Sizeof(T{}) + InvalidDeclCycle + + // InvalidTypeCycle occurs when a cycle in type definitions results in a + // type that is not well-defined. + // + // Example: + // import "unsafe" + // + // type T [unsafe.Sizeof(T{})]int + InvalidTypeCycle + + /* decls > const */ + + // InvalidConstInit occurs when a const declaration has a non-constant + // initializer. + // + // Example: + // var x int + // const _ = x + InvalidConstInit + + // InvalidConstVal occurs when a const value cannot be converted to its + // target type. + // + // TODO(findleyr): this error code and example are not very clear. Consider + // removing it. + // + // Example: + // const _ = 1 << "hello" + InvalidConstVal + + // InvalidConstType occurs when the underlying type in a const declaration + // is not a valid constant type. + // + // Example: + // const c *int = 4 + InvalidConstType + + /* decls > var (+ other variable assignment codes) */ + + // UntypedNilUse occurs when the predeclared (untyped) value nil is used to + // initialize a variable declared without an explicit type. + // + // Example: + // var x = nil + UntypedNilUse + + // WrongAssignCount occurs when the number of values on the right-hand side + // of an assignment or initialization expression does not match the number + // of variables on the left-hand side. + // + // Example: + // var x = 1, 2 + WrongAssignCount + + // UnassignableOperand occurs when the left-hand side of an assignment is + // not assignable. + // + // Example: + // func f() { + // const c = 1 + // c = 2 + // } + UnassignableOperand + + // NoNewVar occurs when a short variable declaration (':=') does not declare + // new variables. + // + // Example: + // func f() { + // x := 1 + // x := 2 + // } + NoNewVar + + // MultiValAssignOp occurs when an assignment operation (+=, *=, etc) does + // not have single-valued left-hand or right-hand side. + // + // Per the spec: + // "In assignment operations, both the left- and right-hand expression lists + // must contain exactly one single-valued expression" + // + // Example: + // func f() int { + // x, y := 1, 2 + // x, y += 1 + // return x + y + // } + MultiValAssignOp + + // InvalidIfaceAssign occurs when a value of type T is used as an + // interface, but T does not implement a method of the expected interface. + // + // Example: + // type I interface { + // f() + // } + // + // type T int + // + // var x I = T(1) + InvalidIfaceAssign + + // InvalidChanAssign occurs when a chan assignment is invalid. + // + // Per the spec, a value x is assignable to a channel type T if: + // "x is a bidirectional channel value, T is a channel type, x's type V and + // T have identical element types, and at least one of V or T is not a + // defined type." + // + // Example: + // type T1 chan int + // type T2 chan int + // + // var x T1 + // // Invalid assignment because both types are named + // var _ T2 = x + InvalidChanAssign + + // IncompatibleAssign occurs when the type of the right-hand side expression + // in an assignment cannot be assigned to the type of the variable being + // assigned. + // + // Example: + // var x []int + // var _ int = x + IncompatibleAssign + + // UnaddressableFieldAssign occurs when trying to assign to a struct field + // in a map value. + // + // Example: + // func f() { + // m := make(map[string]struct{i int}) + // m["foo"].i = 42 + // } + UnaddressableFieldAssign + + /* decls > type (+ other type expression codes) */ + + // NotAType occurs when the identifier used as the underlying type in a type + // declaration or the right-hand side of a type alias does not denote a type. + // + // Example: + // var S = 2 + // + // type T S + NotAType + + // InvalidArrayLen occurs when an array length is not a constant value. + // + // Example: + // var n = 3 + // var _ = [n]int{} + InvalidArrayLen + + // BlankIfaceMethod occurs when a method name is '_'. + // + // Per the spec: + // "The name of each explicitly specified method must be unique and not + // blank." + // + // Example: + // type T interface { + // _(int) + // } + BlankIfaceMethod + + // IncomparableMapKey occurs when a map key type does not support the == and + // != operators. + // + // Per the spec: + // "The comparison operators == and != must be fully defined for operands of + // the key type; thus the key type must not be a function, map, or slice." + // + // Example: + // var x map[T]int + // + // type T []int + IncomparableMapKey + + // InvalidIfaceEmbed occurs when a non-interface type is embedded in an + // interface. + // + // Example: + // type T struct {} + // + // func (T) m() + // + // type I interface { + // T + // } + InvalidIfaceEmbed + + // InvalidPtrEmbed occurs when an embedded field is of the pointer form *T, + // and T itself is itself a pointer, an unsafe.Pointer, or an interface. + // + // Per the spec: + // "An embedded field must be specified as a type name T or as a pointer to + // a non-interface type name *T, and T itself may not be a pointer type." + // + // Example: + // type T *int + // + // type S struct { + // *T + // } + InvalidPtrEmbed + + /* decls > func and method */ + + // BadRecv occurs when a method declaration does not have exactly one + // receiver parameter. + // + // Example: + // func () _() {} + BadRecv + + // InvalidRecv occurs when a receiver type expression is not of the form T + // or *T, or T is a pointer type. + // + // Example: + // type T struct {} + // + // func (**T) m() {} + InvalidRecv + + // DuplicateFieldAndMethod occurs when an identifier appears as both a field + // and method name. + // + // Example: + // type T struct { + // m int + // } + // + // func (T) m() {} + DuplicateFieldAndMethod + + // DuplicateMethod occurs when two methods on the same receiver type have + // the same name. + // + // Example: + // type T struct {} + // func (T) m() {} + // func (T) m(i int) int { return i } + DuplicateMethod + + /* decls > special */ + + // InvalidBlank occurs when a blank identifier is used as a value or type. + // + // Per the spec: + // "The blank identifier may appear as an operand only on the left-hand side + // of an assignment." + // + // Example: + // var x = _ + InvalidBlank + + // InvalidIota occurs when the predeclared identifier iota is used outside + // of a constant declaration. + // + // Example: + // var x = iota + InvalidIota + + // MissingInitBody occurs when an init function is missing its body. + // + // Example: + // func init() + MissingInitBody + + // InvalidInitSig occurs when an init function declares parameters or + // results. + // + // Example: + // func init() int { return 1 } + InvalidInitSig + + // InvalidInitDecl occurs when init is declared as anything other than a + // function. + // + // Example: + // var init = 1 + InvalidInitDecl + + // InvalidMainDecl occurs when main is declared as anything other than a + // function, in a main package. + InvalidMainDecl + + /* exprs */ + + // TooManyValues occurs when a function returns too many values for the + // expression context in which it is used. + // + // Example: + // func ReturnTwo() (int, int) { + // return 1, 2 + // } + // + // var x = ReturnTwo() + TooManyValues + + // NotAnExpr occurs when a type expression is used where a value expression + // is expected. + // + // Example: + // type T struct {} + // + // func f() { + // T + // } + NotAnExpr + + /* exprs > const */ + + // TruncatedFloat occurs when a float constant is truncated to an integer + // value. + // + // Example: + // var _ int = 98.6 + TruncatedFloat + + // NumericOverflow occurs when a numeric constant overflows its target type. + // + // Example: + // var x int8 = 1000 + NumericOverflow + + /* exprs > operation */ + + // UndefinedOp occurs when an operator is not defined for the type(s) used + // in an operation. + // + // Example: + // var c = "a" - "b" + UndefinedOp + + // MismatchedTypes occurs when operand types are incompatible in a binary + // operation. + // + // Example: + // var a = "hello" + // var b = 1 + // var c = a - b + MismatchedTypes + + // DivByZero occurs when a division operation is provable at compile + // time to be a division by zero. + // + // Example: + // const divisor = 0 + // var x int = 1/divisor + DivByZero + + // NonNumericIncDec occurs when an increment or decrement operator is + // applied to a non-numeric value. + // + // Example: + // func f() { + // var c = "c" + // c++ + // } + NonNumericIncDec + + /* exprs > ptr */ + + // UnaddressableOperand occurs when the & operator is applied to an + // unaddressable expression. + // + // Example: + // var x = &1 + UnaddressableOperand + + // InvalidIndirection occurs when a non-pointer value is indirected via the + // '*' operator. + // + // Example: + // var x int + // var y = *x + InvalidIndirection + + /* exprs > [] */ + + // NonIndexableOperand occurs when an index operation is applied to a value + // that cannot be indexed. + // + // Example: + // var x = 1 + // var y = x[1] + NonIndexableOperand + + // InvalidIndex occurs when an index argument is not of integer type, + // negative, or out-of-bounds. + // + // Example: + // var s = [...]int{1,2,3} + // var x = s[5] + // + // Example: + // var s = []int{1,2,3} + // var _ = s[-1] + // + // Example: + // var s = []int{1,2,3} + // var i string + // var _ = s[i] + InvalidIndex + + // SwappedSliceIndices occurs when constant indices in a slice expression + // are decreasing in value. + // + // Example: + // var _ = []int{1,2,3}[2:1] + SwappedSliceIndices + + /* operators > slice */ + + // NonSliceableOperand occurs when a slice operation is applied to a value + // whose type is not sliceable, or is unaddressable. + // + // Example: + // var x = [...]int{1, 2, 3}[:1] + // + // Example: + // var x = 1 + // var y = 1[:1] + NonSliceableOperand + + // InvalidSliceExpr occurs when a three-index slice expression (a[x:y:z]) is + // applied to a string. + // + // Example: + // var s = "hello" + // var x = s[1:2:3] + InvalidSliceExpr + + /* exprs > shift */ + + // InvalidShiftCount occurs when the right-hand side of a shift operation is + // either non-integer, negative, or too large. + // + // Example: + // var ( + // x string + // y int = 1 << x + // ) + InvalidShiftCount + + // InvalidShiftOperand occurs when the shifted operand is not an integer. + // + // Example: + // var s = "hello" + // var x = s << 2 + InvalidShiftOperand + + /* exprs > chan */ + + // InvalidReceive occurs when there is a channel receive from a value that + // is either not a channel, or is a send-only channel. + // + // Example: + // func f() { + // var x = 1 + // <-x + // } + InvalidReceive + + // InvalidSend occurs when there is a channel send to a value that is not a + // channel, or is a receive-only channel. + // + // Example: + // func f() { + // var x = 1 + // x <- "hello!" + // } + InvalidSend + + /* exprs > literal */ + + // DuplicateLitKey occurs when an index is duplicated in a slice, array, or + // map literal. + // + // Example: + // var _ = []int{0:1, 0:2} + // + // Example: + // var _ = map[string]int{"a": 1, "a": 2} + DuplicateLitKey + + // MissingLitKey occurs when a map literal is missing a key expression. + // + // Example: + // var _ = map[string]int{1} + MissingLitKey + + // InvalidLitIndex occurs when the key in a key-value element of a slice or + // array literal is not an integer constant. + // + // Example: + // var i = 0 + // var x = []string{i: "world"} + InvalidLitIndex + + // OversizeArrayLit occurs when an array literal exceeds its length. + // + // Example: + // var _ = [2]int{1,2,3} + OversizeArrayLit + + // MixedStructLit occurs when a struct literal contains a mix of positional + // and named elements. + // + // Example: + // var _ = struct{i, j int}{i: 1, 2} + MixedStructLit + + // InvalidStructLit occurs when a positional struct literal has an incorrect + // number of values. + // + // Example: + // var _ = struct{i, j int}{1,2,3} + InvalidStructLit + + // MissingLitField occurs when a struct literal refers to a field that does + // not exist on the struct type. + // + // Example: + // var _ = struct{i int}{j: 2} + MissingLitField + + // DuplicateLitField occurs when a struct literal contains duplicated + // fields. + // + // Example: + // var _ = struct{i int}{i: 1, i: 2} + DuplicateLitField + + // UnexportedLitField occurs when a positional struct literal implicitly + // assigns an unexported field of an imported type. + UnexportedLitField + + // InvalidLitField occurs when a field name is not a valid identifier. + // + // Example: + // var _ = struct{i int}{1: 1} + InvalidLitField + + // UntypedLit occurs when a composite literal omits a required type + // identifier. + // + // Example: + // type outer struct{ + // inner struct { i int } + // } + // + // var _ = outer{inner: {1}} + UntypedLit + + // InvalidLit occurs when a composite literal expression does not match its + // type. + // + // Example: + // type P *struct{ + // x int + // } + // var _ = P {} + InvalidLit + + /* exprs > selector */ + + // AmbiguousSelector occurs when a selector is ambiguous. + // + // Example: + // type E1 struct { i int } + // type E2 struct { i int } + // type T struct { E1; E2 } + // + // var x T + // var _ = x.i + AmbiguousSelector + + // UndeclaredImportedName occurs when a package-qualified identifier is + // undeclared by the imported package. + // + // Example: + // import "go/types" + // + // var _ = types.NotAnActualIdentifier + UndeclaredImportedName + + // UnexportedName occurs when a selector refers to an unexported identifier + // of an imported package. + // + // Example: + // import "reflect" + // + // type _ reflect.flag + UnexportedName + + // UndeclaredName occurs when an identifier is not declared in the current + // scope. + // + // Example: + // var x T + UndeclaredName + + // MissingFieldOrMethod occurs when a selector references a field or method + // that does not exist. + // + // Example: + // type T struct {} + // + // var x = T{}.f + MissingFieldOrMethod + + /* exprs > ... */ + + // BadDotDotDotSyntax occurs when a "..." occurs in a context where it is + // not valid. + // + // Example: + // var _ = map[int][...]int{0: {}} + BadDotDotDotSyntax + + // NonVariadicDotDotDot occurs when a "..." is used on the final argument to + // a non-variadic function. + // + // Example: + // func printArgs(s []string) { + // for _, a := range s { + // println(a) + // } + // } + // + // func f() { + // s := []string{"a", "b", "c"} + // printArgs(s...) + // } + NonVariadicDotDotDot + + // MisplacedDotDotDot occurs when a "..." is used somewhere other than the + // final argument to a function call. + // + // Example: + // func printArgs(args ...int) { + // for _, a := range args { + // println(a) + // } + // } + // + // func f() { + // a := []int{1,2,3} + // printArgs(0, a...) + // } + MisplacedDotDotDot + + // InvalidDotDotDotOperand occurs when a "..." operator is applied to a + // single-valued operand. + // + // Example: + // func printArgs(args ...int) { + // for _, a := range args { + // println(a) + // } + // } + // + // func f() { + // a := 1 + // printArgs(a...) + // } + // + // Example: + // func args() (int, int) { + // return 1, 2 + // } + // + // func printArgs(args ...int) { + // for _, a := range args { + // println(a) + // } + // } + // + // func g() { + // printArgs(args()...) + // } + InvalidDotDotDotOperand + + // InvalidDotDotDot occurs when a "..." is used in a non-variadic built-in + // function. + // + // Example: + // var s = []int{1, 2, 3} + // var l = len(s...) + InvalidDotDotDot + + /* exprs > built-in */ + + // UncalledBuiltin occurs when a built-in function is used as a + // function-valued expression, instead of being called. + // + // Per the spec: + // "The built-in functions do not have standard Go types, so they can only + // appear in call expressions; they cannot be used as function values." + // + // Example: + // var _ = copy + UncalledBuiltin + + // InvalidAppend occurs when append is called with a first argument that is + // not a slice. + // + // Example: + // var _ = append(1, 2) + InvalidAppend + + // InvalidCap occurs when an argument to the cap built-in function is not of + // supported type. + // + // See https://golang.org/ref/spec#Lengthand_capacity for information on + // which underlying types are supported as arguments to cap and len. + // + // Example: + // var s = 2 + // var x = cap(s) + InvalidCap + + // InvalidClose occurs when close(...) is called with an argument that is + // not of channel type, or that is a receive-only channel. + // + // Example: + // func f() { + // var x int + // close(x) + // } + InvalidClose + + // InvalidCopy occurs when the arguments are not of slice type or do not + // have compatible type. + // + // See https://golang.org/ref/spec#Appendingand_copying_slices for more + // information on the type requirements for the copy built-in. + // + // Example: + // func f() { + // var x []int + // y := []int64{1,2,3} + // copy(x, y) + // } + InvalidCopy + + // InvalidComplex occurs when the complex built-in function is called with + // arguments with incompatible types. + // + // Example: + // var _ = complex(float32(1), float64(2)) + InvalidComplex + + // InvalidDelete occurs when the delete built-in function is called with a + // first argument that is not a map. + // + // Example: + // func f() { + // m := "hello" + // delete(m, "e") + // } + InvalidDelete + + // InvalidImag occurs when the imag built-in function is called with an + // argument that does not have complex type. + // + // Example: + // var _ = imag(int(1)) + InvalidImag + + // InvalidLen occurs when an argument to the len built-in function is not of + // supported type. + // + // See https://golang.org/ref/spec#Lengthand_capacity for information on + // which underlying types are supported as arguments to cap and len. + // + // Example: + // var s = 2 + // var x = len(s) + InvalidLen + + // SwappedMakeArgs occurs when make is called with three arguments, and its + // length argument is larger than its capacity argument. + // + // Example: + // var x = make([]int, 3, 2) + SwappedMakeArgs + + // InvalidMake occurs when make is called with an unsupported type argument. + // + // See https://golang.org/ref/spec#Makingslices_maps_and_channels for + // information on the types that may be created using make. + // + // Example: + // var x = make(int) + InvalidMake + + // InvalidReal occurs when the real built-in function is called with an + // argument that does not have complex type. + // + // Example: + // var _ = real(int(1)) + InvalidReal + + /* exprs > assertion */ + + // InvalidAssert occurs when a type assertion is applied to a + // value that is not of interface type. + // + // Example: + // var x = 1 + // var _ = x.(float64) + InvalidAssert + + // ImpossibleAssert occurs for a type assertion x.(T) when the value x of + // interface cannot have dynamic type T, due to a missing or mismatching + // method on T. + // + // Example: + // type T int + // + // func (t *T) m() int { return int(*t) } + // + // type I interface { m() int } + // + // var x I + // var _ = x.(T) + ImpossibleAssert + + /* exprs > conversion */ + + // InvalidConversion occurs when the argument type cannot be converted to the + // target. + // + // See https://golang.org/ref/spec#Conversions for the rules of + // convertibility. + // + // Example: + // var x float64 + // var _ = string(x) + InvalidConversion + + // InvalidUntypedConversion occurs when an there is no valid implicit + // conversion from an untyped value satisfying the type constraints of the + // context in which it is used. + // + // Example: + // var _ = 1 + "" + InvalidUntypedConversion + + /* offsetof */ + + // BadOffsetofSyntax occurs when unsafe.Offsetof is called with an argument + // that is not a selector expression. + // + // Example: + // import "unsafe" + // + // var x int + // var _ = unsafe.Offsetof(x) + BadOffsetofSyntax + + // InvalidOffsetof occurs when unsafe.Offsetof is called with a method + // selector, rather than a field selector, or when the field is embedded via + // a pointer. + // + // Per the spec: + // + // "If f is an embedded field, it must be reachable without pointer + // indirections through fields of the struct. " + // + // Example: + // import "unsafe" + // + // type T struct { f int } + // type S struct { *T } + // var s S + // var _ = unsafe.Offsetof(s.f) + // + // Example: + // import "unsafe" + // + // type S struct{} + // + // func (S) m() {} + // + // var s S + // var _ = unsafe.Offsetof(s.m) + InvalidOffsetof + + /* control flow > scope */ + + // UnusedExpr occurs when a side-effect free expression is used as a + // statement. Such a statement has no effect. + // + // Example: + // func f(i int) { + // i*i + // } + UnusedExpr + + // UnusedVar occurs when a variable is declared but unused. + // + // Example: + // func f() { + // x := 1 + // } + UnusedVar + + // MissingReturn occurs when a function with results is missing a return + // statement. + // + // Example: + // func f() int {} + MissingReturn + + // WrongResultCount occurs when a return statement returns an incorrect + // number of values. + // + // Example: + // func ReturnOne() int { + // return 1, 2 + // } + WrongResultCount + + // OutOfScopeResult occurs when the name of a value implicitly returned by + // an empty return statement is shadowed in a nested scope. + // + // Example: + // func factor(n int) (i int) { + // for i := 2; i < n; i++ { + // if n%i == 0 { + // return + // } + // } + // return 0 + // } + OutOfScopeResult + + /* control flow > if */ + + // InvalidCond occurs when an if condition is not a boolean expression. + // + // Example: + // func checkReturn(i int) { + // if i { + // panic("non-zero return") + // } + // } + InvalidCond + + /* control flow > for */ + + // InvalidPostDecl occurs when there is a declaration in a for-loop post + // statement. + // + // Example: + // func f() { + // for i := 0; i < 10; j := 0 {} + // } + InvalidPostDecl + + // InvalidChanRange occurs when a send-only channel used in a range + // expression. + // + // Example: + // func sum(c chan<- int) { + // s := 0 + // for i := range c { + // s += i + // } + // } + InvalidChanRange + + // InvalidIterVar occurs when two iteration variables are used while ranging + // over a channel. + // + // Example: + // func f(c chan int) { + // for k, v := range c { + // println(k, v) + // } + // } + InvalidIterVar + + // InvalidRangeExpr occurs when the type of a range expression is not array, + // slice, string, map, or channel. + // + // Example: + // func f(i int) { + // for j := range i { + // println(j) + // } + // } + InvalidRangeExpr + + /* control flow > switch */ + + // MisplacedBreak occurs when a break statement is not within a for, switch, + // or select statement of the innermost function definition. + // + // Example: + // func f() { + // break + // } + MisplacedBreak + + // MisplacedContinue occurs when a continue statement is not within a for + // loop of the innermost function definition. + // + // Example: + // func sumeven(n int) int { + // proceed := func() { + // continue + // } + // sum := 0 + // for i := 1; i <= n; i++ { + // if i % 2 != 0 { + // proceed() + // } + // sum += i + // } + // return sum + // } + MisplacedContinue + + // MisplacedFallthrough occurs when a fallthrough statement is not within an + // expression switch. + // + // Example: + // func typename(i interface{}) string { + // switch i.(type) { + // case int64: + // fallthrough + // case int: + // return "int" + // } + // return "unsupported" + // } + MisplacedFallthrough + + // DuplicateCase occurs when a type or expression switch has duplicate + // cases. + // + // Example: + // func printInt(i int) { + // switch i { + // case 1: + // println("one") + // case 1: + // println("One") + // } + // } + DuplicateCase + + // DuplicateDefault occurs when a type or expression switch has multiple + // default clauses. + // + // Example: + // func printInt(i int) { + // switch i { + // case 1: + // println("one") + // default: + // println("One") + // default: + // println("1") + // } + // } + DuplicateDefault + + // BadTypeKeyword occurs when a .(type) expression is used anywhere other + // than a type switch. + // + // Example: + // type I interface { + // m() + // } + // var t I + // var _ = t.(type) + BadTypeKeyword + + // InvalidTypeSwitch occurs when .(type) is used on an expression that is + // not of interface type. + // + // Example: + // func f(i int) { + // switch x := i.(type) {} + // } + InvalidTypeSwitch + + // InvalidExprSwitch occurs when a switch expression is not comparable. + // + // Example: + // func _() { + // var a struct{ _ func() } + // switch a /* ERROR cannot switch on a */ { + // } + // } + InvalidExprSwitch + + /* control flow > select */ + + // InvalidSelectCase occurs when a select case is not a channel send or + // receive. + // + // Example: + // func checkChan(c <-chan int) bool { + // select { + // case c: + // return true + // default: + // return false + // } + // } + InvalidSelectCase + + /* control flow > labels and jumps */ + + // UndeclaredLabel occurs when an undeclared label is jumped to. + // + // Example: + // func f() { + // goto L + // } + UndeclaredLabel + + // DuplicateLabel occurs when a label is declared more than once. + // + // Example: + // func f() int { + // L: + // L: + // return 1 + // } + DuplicateLabel + + // MisplacedLabel occurs when a break or continue label is not on a for, + // switch, or select statement. + // + // Example: + // func f() { + // L: + // a := []int{1,2,3} + // for _, e := range a { + // if e > 10 { + // break L + // } + // println(a) + // } + // } + MisplacedLabel + + // UnusedLabel occurs when a label is declared but not used. + // + // Example: + // func f() { + // L: + // } + UnusedLabel + + // JumpOverDecl occurs when a label jumps over a variable declaration. + // + // Example: + // func f() int { + // goto L + // x := 2 + // L: + // x++ + // return x + // } + JumpOverDecl + + // JumpIntoBlock occurs when a forward jump goes to a label inside a nested + // block. + // + // Example: + // func f(x int) { + // goto L + // if x > 0 { + // L: + // print("inside block") + // } + // } + JumpIntoBlock + + /* control flow > calls */ + + // InvalidMethodExpr occurs when a pointer method is called but the argument + // is not addressable. + // + // Example: + // type T struct {} + // + // func (*T) m() int { return 1 } + // + // var _ = T.m(T{}) + InvalidMethodExpr + + // WrongArgCount occurs when too few or too many arguments are passed by a + // function call. + // + // Example: + // func f(i int) {} + // var x = f() + WrongArgCount + + // InvalidCall occurs when an expression is called that is not of function + // type. + // + // Example: + // var x = "x" + // var y = x() + InvalidCall + + /* control flow > suspended */ + + // UnusedResults occurs when a restricted expression-only built-in function + // is suspended via go or defer. Such a suspension discards the results of + // these side-effect free built-in functions, and therefore is ineffectual. + // + // Example: + // func f(a []int) int { + // defer len(a) + // return i + // } + UnusedResults + + // InvalidDefer occurs when a deferred expression is not a function call, + // for example if the expression is a type conversion. + // + // Example: + // func f(i int) int { + // defer int32(i) + // return i + // } + InvalidDefer + + // InvalidGo occurs when a go expression is not a function call, for example + // if the expression is a type conversion. + // + // Example: + // func f(i int) int { + // go int32(i) + // return i + // } + InvalidGo + + // All codes below were added in Go 1.17. + + /* decl */ + + // BadDecl occurs when a declaration has invalid syntax. + BadDecl + + // RepeatedDecl occurs when an identifier occurs more than once on the left + // hand side of a short variable declaration. + // + // Example: + // func _() { + // x, y, y := 1, 2, 3 + // } + RepeatedDecl + + /* unsafe */ + + // InvalidUnsafeAdd occurs when unsafe.Add is called with a + // length argument that is not of integer type. + // + // Example: + // import "unsafe" + // + // var p unsafe.Pointer + // var _ = unsafe.Add(p, float64(1)) + InvalidUnsafeAdd + + // InvalidUnsafeSlice occurs when unsafe.Slice is called with a + // pointer argument that is not of pointer type or a length argument + // that is not of integer type, negative, or out of bounds. + // + // Example: + // import "unsafe" + // + // var x int + // var _ = unsafe.Slice(x, 1) + // + // Example: + // import "unsafe" + // + // var x int + // var _ = unsafe.Slice(&x, float64(1)) + // + // Example: + // import "unsafe" + // + // var x int + // var _ = unsafe.Slice(&x, -1) + // + // Example: + // import "unsafe" + // + // var x int + // var _ = unsafe.Slice(&x, uint64(1) << 63) + InvalidUnsafeSlice + + // All codes below were added in Go 1.18. + + /* features */ + + // UnsupportedFeature occurs when a language feature is used that is not + // supported at this Go version. + UnsupportedFeature + + /* type params */ + + // NotAGenericType occurs when a non-generic type is used where a generic + // type is expected: in type or function instantiation. + // + // Example: + // type T int + // + // var _ T[int] + NotAGenericType + + // WrongTypeArgCount occurs when a type or function is instantiated with an + // incorrect number of type arguments, including when a generic type or + // function is used without instantiation. + // + // Errors involving failed type inference are assigned other error codes. + // + // Example: + // type T[p any] int + // + // var _ T[int, string] + // + // Example: + // func f[T any]() {} + // + // var x = f + WrongTypeArgCount + + // CannotInferTypeArgs occurs when type or function type argument inference + // fails to infer all type arguments. + // + // Example: + // func f[T any]() {} + // + // func _() { + // f() + // } + // + // Example: + // type N[P, Q any] struct{} + // + // var _ N[int] + CannotInferTypeArgs + + // InvalidTypeArg occurs when a type argument does not satisfy its + // corresponding type parameter constraints. + // + // Example: + // type T[P ~int] struct{} + // + // var _ T[string] + InvalidTypeArg // arguments? InferenceFailed + + // InvalidInstanceCycle occurs when an invalid cycle is detected + // within the instantiation graph. + // + // Example: + // func f[T any]() { f[*T]() } + InvalidInstanceCycle + + // InvalidUnion occurs when an embedded union or approximation element is + // not valid. + // + // Example: + // type _ interface { + // ~int | interface{ m() } + // } + InvalidUnion + + // MisplacedConstraintIface occurs when a constraint-type interface is used + // outside of constraint position. + // + // Example: + // type I interface { ~int } + // + // var _ I + MisplacedConstraintIface + + // InvalidMethodTypeParams occurs when methods have type parameters. + // + // It cannot be encountered with an AST parsed using go/parser. + InvalidMethodTypeParams + + // MisplacedTypeParam occurs when a type parameter is used in a place where + // it is not permitted. + // + // Example: + // type T[P any] P + // + // Example: + // type T[P any] struct{ *P } + MisplacedTypeParam + + // InvalidUnsafeSliceData occurs when unsafe.SliceData is called with + // an argument that is not of slice type. It also occurs if it is used + // in a package compiled for a language version before go1.20. + // + // Example: + // import "unsafe" + // + // var x int + // var _ = unsafe.SliceData(x) + InvalidUnsafeSliceData + + // InvalidUnsafeString occurs when unsafe.String is called with + // a length argument that is not of integer type, negative, or + // out of bounds. It also occurs if it is used in a package + // compiled for a language version before go1.20. + // + // Example: + // import "unsafe" + // + // var b [10]byte + // var _ = unsafe.String(&b[0], -1) + InvalidUnsafeString + + // InvalidUnsafeStringData occurs if it is used in a package + // compiled for a language version before go1.20. + _ // not used anymore + +) diff --git a/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go b/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go new file mode 100644 index 0000000000..15ecf7c5de --- /dev/null +++ b/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go @@ -0,0 +1,179 @@ +// Code generated by "stringer -type=ErrorCode"; DO NOT EDIT. + +package typesinternal + +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[InvalidSyntaxTree - -1] + _ = x[Test-1] + _ = x[BlankPkgName-2] + _ = x[MismatchedPkgName-3] + _ = x[InvalidPkgUse-4] + _ = x[BadImportPath-5] + _ = x[BrokenImport-6] + _ = x[ImportCRenamed-7] + _ = x[UnusedImport-8] + _ = x[InvalidInitCycle-9] + _ = x[DuplicateDecl-10] + _ = x[InvalidDeclCycle-11] + _ = x[InvalidTypeCycle-12] + _ = x[InvalidConstInit-13] + _ = x[InvalidConstVal-14] + _ = x[InvalidConstType-15] + _ = x[UntypedNilUse-16] + _ = x[WrongAssignCount-17] + _ = x[UnassignableOperand-18] + _ = x[NoNewVar-19] + _ = x[MultiValAssignOp-20] + _ = x[InvalidIfaceAssign-21] + _ = x[InvalidChanAssign-22] + _ = x[IncompatibleAssign-23] + _ = x[UnaddressableFieldAssign-24] + _ = x[NotAType-25] + _ = x[InvalidArrayLen-26] + _ = x[BlankIfaceMethod-27] + _ = x[IncomparableMapKey-28] + _ = x[InvalidIfaceEmbed-29] + _ = x[InvalidPtrEmbed-30] + _ = x[BadRecv-31] + _ = x[InvalidRecv-32] + _ = x[DuplicateFieldAndMethod-33] + _ = x[DuplicateMethod-34] + _ = x[InvalidBlank-35] + _ = x[InvalidIota-36] + _ = x[MissingInitBody-37] + _ = x[InvalidInitSig-38] + _ = x[InvalidInitDecl-39] + _ = x[InvalidMainDecl-40] + _ = x[TooManyValues-41] + _ = x[NotAnExpr-42] + _ = x[TruncatedFloat-43] + _ = x[NumericOverflow-44] + _ = x[UndefinedOp-45] + _ = x[MismatchedTypes-46] + _ = x[DivByZero-47] + _ = x[NonNumericIncDec-48] + _ = x[UnaddressableOperand-49] + _ = x[InvalidIndirection-50] + _ = x[NonIndexableOperand-51] + _ = x[InvalidIndex-52] + _ = x[SwappedSliceIndices-53] + _ = x[NonSliceableOperand-54] + _ = x[InvalidSliceExpr-55] + _ = x[InvalidShiftCount-56] + _ = x[InvalidShiftOperand-57] + _ = x[InvalidReceive-58] + _ = x[InvalidSend-59] + _ = x[DuplicateLitKey-60] + _ = x[MissingLitKey-61] + _ = x[InvalidLitIndex-62] + _ = x[OversizeArrayLit-63] + _ = x[MixedStructLit-64] + _ = x[InvalidStructLit-65] + _ = x[MissingLitField-66] + _ = x[DuplicateLitField-67] + _ = x[UnexportedLitField-68] + _ = x[InvalidLitField-69] + _ = x[UntypedLit-70] + _ = x[InvalidLit-71] + _ = x[AmbiguousSelector-72] + _ = x[UndeclaredImportedName-73] + _ = x[UnexportedName-74] + _ = x[UndeclaredName-75] + _ = x[MissingFieldOrMethod-76] + _ = x[BadDotDotDotSyntax-77] + _ = x[NonVariadicDotDotDot-78] + _ = x[MisplacedDotDotDot-79] + _ = x[InvalidDotDotDotOperand-80] + _ = x[InvalidDotDotDot-81] + _ = x[UncalledBuiltin-82] + _ = x[InvalidAppend-83] + _ = x[InvalidCap-84] + _ = x[InvalidClose-85] + _ = x[InvalidCopy-86] + _ = x[InvalidComplex-87] + _ = x[InvalidDelete-88] + _ = x[InvalidImag-89] + _ = x[InvalidLen-90] + _ = x[SwappedMakeArgs-91] + _ = x[InvalidMake-92] + _ = x[InvalidReal-93] + _ = x[InvalidAssert-94] + _ = x[ImpossibleAssert-95] + _ = x[InvalidConversion-96] + _ = x[InvalidUntypedConversion-97] + _ = x[BadOffsetofSyntax-98] + _ = x[InvalidOffsetof-99] + _ = x[UnusedExpr-100] + _ = x[UnusedVar-101] + _ = x[MissingReturn-102] + _ = x[WrongResultCount-103] + _ = x[OutOfScopeResult-104] + _ = x[InvalidCond-105] + _ = x[InvalidPostDecl-106] + _ = x[InvalidChanRange-107] + _ = x[InvalidIterVar-108] + _ = x[InvalidRangeExpr-109] + _ = x[MisplacedBreak-110] + _ = x[MisplacedContinue-111] + _ = x[MisplacedFallthrough-112] + _ = x[DuplicateCase-113] + _ = x[DuplicateDefault-114] + _ = x[BadTypeKeyword-115] + _ = x[InvalidTypeSwitch-116] + _ = x[InvalidExprSwitch-117] + _ = x[InvalidSelectCase-118] + _ = x[UndeclaredLabel-119] + _ = x[DuplicateLabel-120] + _ = x[MisplacedLabel-121] + _ = x[UnusedLabel-122] + _ = x[JumpOverDecl-123] + _ = x[JumpIntoBlock-124] + _ = x[InvalidMethodExpr-125] + _ = x[WrongArgCount-126] + _ = x[InvalidCall-127] + _ = x[UnusedResults-128] + _ = x[InvalidDefer-129] + _ = x[InvalidGo-130] + _ = x[BadDecl-131] + _ = x[RepeatedDecl-132] + _ = x[InvalidUnsafeAdd-133] + _ = x[InvalidUnsafeSlice-134] + _ = x[UnsupportedFeature-135] + _ = x[NotAGenericType-136] + _ = x[WrongTypeArgCount-137] + _ = x[CannotInferTypeArgs-138] + _ = x[InvalidTypeArg-139] + _ = x[InvalidInstanceCycle-140] + _ = x[InvalidUnion-141] + _ = x[MisplacedConstraintIface-142] + _ = x[InvalidMethodTypeParams-143] + _ = x[MisplacedTypeParam-144] + _ = x[InvalidUnsafeSliceData-145] + _ = x[InvalidUnsafeString-146] +} + +const ( + _ErrorCode_name_0 = "InvalidSyntaxTree" + _ErrorCode_name_1 = "TestBlankPkgNameMismatchedPkgNameInvalidPkgUseBadImportPathBrokenImportImportCRenamedUnusedImportInvalidInitCycleDuplicateDeclInvalidDeclCycleInvalidTypeCycleInvalidConstInitInvalidConstValInvalidConstTypeUntypedNilUseWrongAssignCountUnassignableOperandNoNewVarMultiValAssignOpInvalidIfaceAssignInvalidChanAssignIncompatibleAssignUnaddressableFieldAssignNotATypeInvalidArrayLenBlankIfaceMethodIncomparableMapKeyInvalidIfaceEmbedInvalidPtrEmbedBadRecvInvalidRecvDuplicateFieldAndMethodDuplicateMethodInvalidBlankInvalidIotaMissingInitBodyInvalidInitSigInvalidInitDeclInvalidMainDeclTooManyValuesNotAnExprTruncatedFloatNumericOverflowUndefinedOpMismatchedTypesDivByZeroNonNumericIncDecUnaddressableOperandInvalidIndirectionNonIndexableOperandInvalidIndexSwappedSliceIndicesNonSliceableOperandInvalidSliceExprInvalidShiftCountInvalidShiftOperandInvalidReceiveInvalidSendDuplicateLitKeyMissingLitKeyInvalidLitIndexOversizeArrayLitMixedStructLitInvalidStructLitMissingLitFieldDuplicateLitFieldUnexportedLitFieldInvalidLitFieldUntypedLitInvalidLitAmbiguousSelectorUndeclaredImportedNameUnexportedNameUndeclaredNameMissingFieldOrMethodBadDotDotDotSyntaxNonVariadicDotDotDotMisplacedDotDotDotInvalidDotDotDotOperandInvalidDotDotDotUncalledBuiltinInvalidAppendInvalidCapInvalidCloseInvalidCopyInvalidComplexInvalidDeleteInvalidImagInvalidLenSwappedMakeArgsInvalidMakeInvalidRealInvalidAssertImpossibleAssertInvalidConversionInvalidUntypedConversionBadOffsetofSyntaxInvalidOffsetofUnusedExprUnusedVarMissingReturnWrongResultCountOutOfScopeResultInvalidCondInvalidPostDeclInvalidChanRangeInvalidIterVarInvalidRangeExprMisplacedBreakMisplacedContinueMisplacedFallthroughDuplicateCaseDuplicateDefaultBadTypeKeywordInvalidTypeSwitchInvalidExprSwitchInvalidSelectCaseUndeclaredLabelDuplicateLabelMisplacedLabelUnusedLabelJumpOverDeclJumpIntoBlockInvalidMethodExprWrongArgCountInvalidCallUnusedResultsInvalidDeferInvalidGoBadDeclRepeatedDeclInvalidUnsafeAddInvalidUnsafeSliceUnsupportedFeatureNotAGenericTypeWrongTypeArgCountCannotInferTypeArgsInvalidTypeArgInvalidInstanceCycleInvalidUnionMisplacedConstraintIfaceInvalidMethodTypeParamsMisplacedTypeParamInvalidUnsafeSliceDataInvalidUnsafeString" +) + +var ( + _ErrorCode_index_1 = [...]uint16{0, 4, 16, 33, 46, 59, 71, 85, 97, 113, 126, 142, 158, 174, 189, 205, 218, 234, 253, 261, 277, 295, 312, 330, 354, 362, 377, 393, 411, 428, 443, 450, 461, 484, 499, 511, 522, 537, 551, 566, 581, 594, 603, 617, 632, 643, 658, 667, 683, 703, 721, 740, 752, 771, 790, 806, 823, 842, 856, 867, 882, 895, 910, 926, 940, 956, 971, 988, 1006, 1021, 1031, 1041, 1058, 1080, 1094, 1108, 1128, 1146, 1166, 1184, 1207, 1223, 1238, 1251, 1261, 1273, 1284, 1298, 1311, 1322, 1332, 1347, 1358, 1369, 1382, 1398, 1415, 1439, 1456, 1471, 1481, 1490, 1503, 1519, 1535, 1546, 1561, 1577, 1591, 1607, 1621, 1638, 1658, 1671, 1687, 1701, 1718, 1735, 1752, 1767, 1781, 1795, 1806, 1818, 1831, 1848, 1861, 1872, 1885, 1897, 1906, 1913, 1925, 1941, 1959, 1977, 1992, 2009, 2028, 2042, 2062, 2074, 2098, 2121, 2139, 2161, 2180} +) + +func (i ErrorCode) String() string { + switch { + case i == -1: + return _ErrorCode_name_0 + case 1 <= i && i <= 146: + i -= 1 + return _ErrorCode_name_1[_ErrorCode_index_1[i]:_ErrorCode_index_1[i+1]] + default: + return "ErrorCode(" + strconv.FormatInt(int64(i), 10) + ")" + } +} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/recv.go b/vendor/golang.org/x/tools/internal/typesinternal/recv.go new file mode 100644 index 0000000000..fea7c8b75e --- /dev/null +++ b/vendor/golang.org/x/tools/internal/typesinternal/recv.go @@ -0,0 +1,43 @@ +// Copyright 2024 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 typesinternal + +import ( + "go/types" + + "golang.org/x/tools/internal/aliases" +) + +// ReceiverNamed returns the named type (if any) associated with the +// type of recv, which may be of the form N or *N, or aliases thereof. +// It also reports whether a Pointer was present. +func ReceiverNamed(recv *types.Var) (isPtr bool, named *types.Named) { + t := recv.Type() + if ptr, ok := aliases.Unalias(t).(*types.Pointer); ok { + isPtr = true + t = ptr.Elem() + } + named, _ = aliases.Unalias(t).(*types.Named) + return +} + +// Unpointer returns T given *T or an alias thereof. +// For all other types it is the identity function. +// It does not look at underlying types. +// The result may be an alias. +// +// Use this function to strip off the optional pointer on a receiver +// in a field or method selection, without losing the named type +// (which is needed to compute the method set). +// +// See also [typeparams.MustDeref], which removes one level of +// indirection from the type, regardless of named types (analogous to +// a LOAD instruction). +func Unpointer(t types.Type) types.Type { + if ptr, ok := aliases.Unalias(t).(*types.Pointer); ok { + return ptr.Elem() + } + return t +} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/toonew.go b/vendor/golang.org/x/tools/internal/typesinternal/toonew.go new file mode 100644 index 0000000000..cc86487eaa --- /dev/null +++ b/vendor/golang.org/x/tools/internal/typesinternal/toonew.go @@ -0,0 +1,89 @@ +// Copyright 2024 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 typesinternal + +import ( + "go/types" + + "golang.org/x/tools/internal/stdlib" + "golang.org/x/tools/internal/versions" +) + +// TooNewStdSymbols computes the set of package-level symbols +// exported by pkg that are not available at the specified version. +// The result maps each symbol to its minimum version. +// +// The pkg is allowed to contain type errors. +func TooNewStdSymbols(pkg *types.Package, version string) map[types.Object]string { + disallowed := make(map[types.Object]string) + + // Pass 1: package-level symbols. + symbols := stdlib.PackageSymbols[pkg.Path()] + for _, sym := range symbols { + symver := sym.Version.String() + if versions.Before(version, symver) { + switch sym.Kind { + case stdlib.Func, stdlib.Var, stdlib.Const, stdlib.Type: + disallowed[pkg.Scope().Lookup(sym.Name)] = symver + } + } + } + + // Pass 2: fields and methods. + // + // We allow fields and methods if their associated type is + // disallowed, as otherwise we would report false positives + // for compatibility shims. Consider: + // + // //go:build go1.22 + // type T struct { F std.Real } // correct new API + // + // //go:build !go1.22 + // type T struct { F fake } // shim + // type fake struct { ... } + // func (fake) M () {} + // + // These alternative declarations of T use either the std.Real + // type, introduced in go1.22, or a fake type, for the field + // F. (The fakery could be arbitrarily deep, involving more + // nested fields and methods than are shown here.) Clients + // that use the compatibility shim T will compile with any + // version of go, whether older or newer than go1.22, but only + // the newer version will use the std.Real implementation. + // + // Now consider a reference to method M in new(T).F.M() in a + // module that requires a minimum of go1.21. The analysis may + // occur using a version of Go higher than 1.21, selecting the + // first version of T, so the method M is Real.M. This would + // spuriously cause the analyzer to report a reference to a + // too-new symbol even though this expression compiles just + // fine (with the fake implementation) using go1.21. + for _, sym := range symbols { + symVersion := sym.Version.String() + if !versions.Before(version, symVersion) { + continue // allowed + } + + var obj types.Object + switch sym.Kind { + case stdlib.Field: + typename, name := sym.SplitField() + if t := pkg.Scope().Lookup(typename); t != nil && disallowed[t] == "" { + obj, _, _ = types.LookupFieldOrMethod(t.Type(), false, pkg, name) + } + + case stdlib.Method: + ptr, recvname, name := sym.SplitMethod() + if t := pkg.Scope().Lookup(recvname); t != nil && disallowed[t] == "" { + obj, _, _ = types.LookupFieldOrMethod(t.Type(), ptr, pkg, name) + } + } + if obj != nil { + disallowed[obj] = symVersion + } + } + + return disallowed +} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/types.go b/vendor/golang.org/x/tools/internal/typesinternal/types.go new file mode 100644 index 0000000000..8392328612 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/typesinternal/types.go @@ -0,0 +1,65 @@ +// Copyright 2020 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 typesinternal provides access to internal go/types APIs that are not +// yet exported. +package typesinternal + +import ( + "go/token" + "go/types" + "reflect" + "unsafe" +) + +func SetUsesCgo(conf *types.Config) bool { + v := reflect.ValueOf(conf).Elem() + + f := v.FieldByName("go115UsesCgo") + if !f.IsValid() { + f = v.FieldByName("UsesCgo") + if !f.IsValid() { + return false + } + } + + addr := unsafe.Pointer(f.UnsafeAddr()) + *(*bool)(addr) = true + + return true +} + +// ReadGo116ErrorData extracts additional information from types.Error values +// generated by Go version 1.16 and later: the error code, start position, and +// end position. If all positions are valid, start <= err.Pos <= end. +// +// If the data could not be read, the final result parameter will be false. +func ReadGo116ErrorData(err types.Error) (code ErrorCode, start, end token.Pos, ok bool) { + var data [3]int + // By coincidence all of these fields are ints, which simplifies things. + v := reflect.ValueOf(err) + for i, name := range []string{"go116code", "go116start", "go116end"} { + f := v.FieldByName(name) + if !f.IsValid() { + return 0, 0, 0, false + } + data[i] = int(f.Int()) + } + return ErrorCode(data[0]), token.Pos(data[1]), token.Pos(data[2]), true +} + +// NameRelativeTo returns a types.Qualifier that qualifies members of +// all packages other than pkg, using only the package name. +// (By contrast, [types.RelativeTo] uses the complete package path, +// which is often excessive.) +// +// If pkg is nil, it is equivalent to [*types.Package.Name]. +func NameRelativeTo(pkg *types.Package) types.Qualifier { + return func(other *types.Package) string { + if pkg != nil && pkg == other { + return "" // same package; unqualified + } + return other.Name() + } +} diff --git a/vendor/golang.org/x/tools/internal/versions/constraint.go b/vendor/golang.org/x/tools/internal/versions/constraint.go new file mode 100644 index 0000000000..179063d484 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/constraint.go @@ -0,0 +1,13 @@ +// Copyright 2024 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 versions + +import "go/build/constraint" + +// ConstraintGoVersion is constraint.GoVersion (if built with go1.21+). +// Otherwise nil. +// +// Deprecate once x/tools is after go1.21. +var ConstraintGoVersion func(x constraint.Expr) string diff --git a/vendor/golang.org/x/tools/internal/versions/constraint_go121.go b/vendor/golang.org/x/tools/internal/versions/constraint_go121.go new file mode 100644 index 0000000000..38011407d5 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/constraint_go121.go @@ -0,0 +1,14 @@ +// Copyright 2024 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:build go1.21 +// +build go1.21 + +package versions + +import "go/build/constraint" + +func init() { + ConstraintGoVersion = constraint.GoVersion +} diff --git a/vendor/golang.org/x/tools/internal/versions/features.go b/vendor/golang.org/x/tools/internal/versions/features.go new file mode 100644 index 0000000000..b53f178616 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/features.go @@ -0,0 +1,43 @@ +// Copyright 2023 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 versions + +// This file contains predicates for working with file versions to +// decide when a tool should consider a language feature enabled. + +// GoVersions that features in x/tools can be gated to. +const ( + Go1_18 = "go1.18" + Go1_19 = "go1.19" + Go1_20 = "go1.20" + Go1_21 = "go1.21" + Go1_22 = "go1.22" +) + +// Future is an invalid unknown Go version sometime in the future. +// Do not use directly with Compare. +const Future = "" + +// AtLeast reports whether the file version v comes after a Go release. +// +// Use this predicate to enable a behavior once a certain Go release +// has happened (and stays enabled in the future). +func AtLeast(v, release string) bool { + if v == Future { + return true // an unknown future version is always after y. + } + return Compare(Lang(v), Lang(release)) >= 0 +} + +// Before reports whether the file version v is strictly before a Go release. +// +// Use this predicate to disable a behavior once a certain Go release +// has happened (and stays enabled in the future). +func Before(v, release string) bool { + if v == Future { + return false // an unknown future version happens after y. + } + return Compare(Lang(v), Lang(release)) < 0 +} diff --git a/vendor/golang.org/x/tools/internal/versions/gover.go b/vendor/golang.org/x/tools/internal/versions/gover.go new file mode 100644 index 0000000000..bbabcd22e9 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/gover.go @@ -0,0 +1,172 @@ +// Copyright 2023 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 is a fork of internal/gover for use by x/tools until +// go1.21 and earlier are no longer supported by x/tools. + +package versions + +import "strings" + +// A gover is a parsed Go gover: major[.Minor[.Patch]][kind[pre]] +// The numbers are the original decimal strings to avoid integer overflows +// and since there is very little actual math. (Probably overflow doesn't matter in practice, +// but at the time this code was written, there was an existing test that used +// go1.99999999999, which does not fit in an int on 32-bit platforms. +// The "big decimal" representation avoids the problem entirely.) +type gover struct { + major string // decimal + minor string // decimal or "" + patch string // decimal or "" + kind string // "", "alpha", "beta", "rc" + pre string // decimal or "" +} + +// compare returns -1, 0, or +1 depending on whether +// x < y, x == y, or x > y, interpreted as toolchain versions. +// The versions x and y must not begin with a "go" prefix: just "1.21" not "go1.21". +// Malformed versions compare less than well-formed versions and equal to each other. +// The language version "1.21" compares less than the release candidate and eventual releases "1.21rc1" and "1.21.0". +func compare(x, y string) int { + vx := parse(x) + vy := parse(y) + + if c := cmpInt(vx.major, vy.major); c != 0 { + return c + } + if c := cmpInt(vx.minor, vy.minor); c != 0 { + return c + } + if c := cmpInt(vx.patch, vy.patch); c != 0 { + return c + } + if c := strings.Compare(vx.kind, vy.kind); c != 0 { // "" < alpha < beta < rc + return c + } + if c := cmpInt(vx.pre, vy.pre); c != 0 { + return c + } + return 0 +} + +// lang returns the Go language version. For example, lang("1.2.3") == "1.2". +func lang(x string) string { + v := parse(x) + if v.minor == "" || v.major == "1" && v.minor == "0" { + return v.major + } + return v.major + "." + v.minor +} + +// isValid reports whether the version x is valid. +func isValid(x string) bool { + return parse(x) != gover{} +} + +// parse parses the Go version string x into a version. +// It returns the zero version if x is malformed. +func parse(x string) gover { + var v gover + + // Parse major version. + var ok bool + v.major, x, ok = cutInt(x) + if !ok { + return gover{} + } + if x == "" { + // Interpret "1" as "1.0.0". + v.minor = "0" + v.patch = "0" + return v + } + + // Parse . before minor version. + if x[0] != '.' { + return gover{} + } + + // Parse minor version. + v.minor, x, ok = cutInt(x[1:]) + if !ok { + return gover{} + } + if x == "" { + // Patch missing is same as "0" for older versions. + // Starting in Go 1.21, patch missing is different from explicit .0. + if cmpInt(v.minor, "21") < 0 { + v.patch = "0" + } + return v + } + + // Parse patch if present. + if x[0] == '.' { + v.patch, x, ok = cutInt(x[1:]) + if !ok || x != "" { + // Note that we are disallowing prereleases (alpha, beta, rc) for patch releases here (x != ""). + // Allowing them would be a bit confusing because we already have: + // 1.21 < 1.21rc1 + // But a prerelease of a patch would have the opposite effect: + // 1.21.3rc1 < 1.21.3 + // We've never needed them before, so let's not start now. + return gover{} + } + return v + } + + // Parse prerelease. + i := 0 + for i < len(x) && (x[i] < '0' || '9' < x[i]) { + if x[i] < 'a' || 'z' < x[i] { + return gover{} + } + i++ + } + if i == 0 { + return gover{} + } + v.kind, x = x[:i], x[i:] + if x == "" { + return v + } + v.pre, x, ok = cutInt(x) + if !ok || x != "" { + return gover{} + } + + return v +} + +// cutInt scans the leading decimal number at the start of x to an integer +// and returns that value and the rest of the string. +func cutInt(x string) (n, rest string, ok bool) { + i := 0 + for i < len(x) && '0' <= x[i] && x[i] <= '9' { + i++ + } + if i == 0 || x[0] == '0' && i != 1 { // no digits or unnecessary leading zero + return "", "", false + } + return x[:i], x[i:], true +} + +// cmpInt returns cmp.Compare(x, y) interpreting x and y as decimal numbers. +// (Copied from golang.org/x/mod/semver's compareInt.) +func cmpInt(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 + } +} diff --git a/vendor/golang.org/x/tools/internal/versions/toolchain.go b/vendor/golang.org/x/tools/internal/versions/toolchain.go new file mode 100644 index 0000000000..377bf7a53b --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/toolchain.go @@ -0,0 +1,14 @@ +// Copyright 2024 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 versions + +// toolchain is maximum version (<1.22) that the go toolchain used +// to build the current tool is known to support. +// +// When a tool is built with >=1.22, the value of toolchain is unused. +// +// x/tools does not support building with go <1.18. So we take this +// as the minimum possible maximum. +var toolchain string = Go1_18 diff --git a/vendor/golang.org/x/tools/internal/versions/toolchain_go119.go b/vendor/golang.org/x/tools/internal/versions/toolchain_go119.go new file mode 100644 index 0000000000..f65beed9d8 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/toolchain_go119.go @@ -0,0 +1,14 @@ +// Copyright 2024 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:build go1.19 +// +build go1.19 + +package versions + +func init() { + if Compare(toolchain, Go1_19) < 0 { + toolchain = Go1_19 + } +} diff --git a/vendor/golang.org/x/tools/internal/versions/toolchain_go120.go b/vendor/golang.org/x/tools/internal/versions/toolchain_go120.go new file mode 100644 index 0000000000..1a9efa126c --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/toolchain_go120.go @@ -0,0 +1,14 @@ +// Copyright 2024 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:build go1.20 +// +build go1.20 + +package versions + +func init() { + if Compare(toolchain, Go1_20) < 0 { + toolchain = Go1_20 + } +} diff --git a/vendor/golang.org/x/tools/internal/versions/toolchain_go121.go b/vendor/golang.org/x/tools/internal/versions/toolchain_go121.go new file mode 100644 index 0000000000..b7ef216dfe --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/toolchain_go121.go @@ -0,0 +1,14 @@ +// Copyright 2024 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:build go1.21 +// +build go1.21 + +package versions + +func init() { + if Compare(toolchain, Go1_21) < 0 { + toolchain = Go1_21 + } +} diff --git a/vendor/golang.org/x/tools/internal/versions/types.go b/vendor/golang.org/x/tools/internal/versions/types.go new file mode 100644 index 0000000000..562eef21fa --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/types.go @@ -0,0 +1,19 @@ +// Copyright 2023 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 versions + +import ( + "go/types" +) + +// GoVersion returns the Go version of the type package. +// It returns zero if no version can be determined. +func GoVersion(pkg *types.Package) string { + // TODO(taking): x/tools can call GoVersion() [from 1.21] after 1.25. + if pkg, ok := any(pkg).(interface{ GoVersion() string }); ok { + return pkg.GoVersion() + } + return "" +} diff --git a/vendor/golang.org/x/tools/internal/versions/types_go121.go b/vendor/golang.org/x/tools/internal/versions/types_go121.go new file mode 100644 index 0000000000..b4345d3349 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/types_go121.go @@ -0,0 +1,30 @@ +// Copyright 2023 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:build !go1.22 +// +build !go1.22 + +package versions + +import ( + "go/ast" + "go/types" +) + +// FileVersion returns a language version (<=1.21) derived from runtime.Version() +// or an unknown future version. +func FileVersion(info *types.Info, file *ast.File) string { + // In x/tools built with Go <= 1.21, we do not have Info.FileVersions + // available. We use a go version derived from the toolchain used to + // compile the tool by default. + // This will be <= go1.21. We take this as the maximum version that + // this tool can support. + // + // There are no features currently in x/tools that need to tell fine grained + // differences for versions <1.22. + return toolchain +} + +// InitFileVersions is a noop when compiled with this Go version. +func InitFileVersions(*types.Info) {} diff --git a/vendor/golang.org/x/tools/internal/versions/types_go122.go b/vendor/golang.org/x/tools/internal/versions/types_go122.go new file mode 100644 index 0000000000..aac5db62c9 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/types_go122.go @@ -0,0 +1,41 @@ +// Copyright 2023 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:build go1.22 +// +build go1.22 + +package versions + +import ( + "go/ast" + "go/types" +) + +// FileVersion returns a file's Go version. +// The reported version is an unknown Future version if a +// version cannot be determined. +func FileVersion(info *types.Info, file *ast.File) string { + // In tools built with Go >= 1.22, the Go version of a file + // follow a cascades of sources: + // 1) types.Info.FileVersion, which follows the cascade: + // 1.a) file version (ast.File.GoVersion), + // 1.b) the package version (types.Config.GoVersion), or + // 2) is some unknown Future version. + // + // File versions require a valid package version to be provided to types + // in Config.GoVersion. Config.GoVersion is either from the package's module + // or the toolchain (go run). This value should be provided by go/packages + // or unitchecker.Config.GoVersion. + if v := info.FileVersions[file]; IsValid(v) { + return v + } + // Note: we could instead return runtime.Version() [if valid]. + // This would act as a max version on what a tool can support. + return Future +} + +// InitFileVersions initializes info to record Go versions for Go files. +func InitFileVersions(info *types.Info) { + info.FileVersions = make(map[*ast.File]string) +} diff --git a/vendor/golang.org/x/tools/internal/versions/versions.go b/vendor/golang.org/x/tools/internal/versions/versions.go new file mode 100644 index 0000000000..8d1f7453db --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/versions.go @@ -0,0 +1,57 @@ +// Copyright 2023 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 versions + +import ( + "strings" +) + +// Note: If we use build tags to use go/versions when go >=1.22, +// we run into go.dev/issue/53737. Under some operations users would see an +// import of "go/versions" even if they would not compile the file. +// For example, during `go get -u ./...` (go.dev/issue/64490) we do not try to include +// For this reason, this library just a clone of go/versions for the moment. + +// Lang returns the Go language version for version x. +// If x is not a valid version, Lang returns the empty string. +// For example: +// +// Lang("go1.21rc2") = "go1.21" +// Lang("go1.21.2") = "go1.21" +// Lang("go1.21") = "go1.21" +// Lang("go1") = "go1" +// Lang("bad") = "" +// Lang("1.21") = "" +func Lang(x string) string { + v := lang(stripGo(x)) + if v == "" { + return "" + } + return x[:2+len(v)] // "go"+v without allocation +} + +// Compare returns -1, 0, or +1 depending on whether +// x < y, x == y, or x > y, interpreted as Go versions. +// The versions x and y must begin with a "go" prefix: "go1.21" not "1.21". +// Invalid versions, including the empty string, compare less than +// valid versions and equal to each other. +// The language version "go1.21" compares less than the +// release candidate and eventual releases "go1.21rc1" and "go1.21.0". +// Custom toolchain suffixes are ignored during comparison: +// "go1.21.0" and "go1.21.0-bigcorp" are equal. +func Compare(x, y string) int { return compare(stripGo(x), stripGo(y)) } + +// IsValid reports whether the version x is valid. +func IsValid(x string) bool { return isValid(stripGo(x)) } + +// stripGo converts from a "go1.21" version to a "1.21" version. +// If v does not start with "go", stripGo returns the empty string (a known invalid version). +func stripGo(v string) string { + v, _, _ = strings.Cut(v, "-") // strip -bigcorp suffix. + if len(v) < 2 || v[:2] != "go" { + return "" + } + return v[2:] +} diff --git a/vendor/google.golang.org/appengine/.travis.yml b/vendor/google.golang.org/appengine/.travis.yml deleted file mode 100644 index 6d03f4d36e..0000000000 --- a/vendor/google.golang.org/appengine/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: go - -go_import_path: google.golang.org/appengine - -install: - - ./travis_install.sh - -script: - - ./travis_test.sh - -matrix: - include: - - 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 ffc2985208..0000000000 --- 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 9fdbacd3c6..0000000000 --- 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/appengine.go b/vendor/google.golang.org/appengine/appengine.go deleted file mode 100644 index 8c9697674f..0000000000 --- a/vendor/google.golang.org/appengine/appengine.go +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -// Package appengine provides basic functionality for Google App Engine. -// -// For more information on how to write Go apps for Google App Engine, see: -// https://cloud.google.com/appengine/docs/go/ -package appengine // import "google.golang.org/appengine" - -import ( - "net/http" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" -) - -// The gophers party all night; the rabbits provide the beats. - -// Main is the principal entry point for an app running in App Engine. -// -// On App Engine Flexible it installs a trivial health checker if one isn't -// already registered, and starts listening on port 8080 (overridden by the -// $PORT environment variable). -// -// See https://cloud.google.com/appengine/docs/flexible/custom-runtimes#health_check_requests -// for details on how to do your own health checking. -// -// On App Engine Standard it ensures the server has started and is prepared to -// receive requests. -// -// Main never returns. -// -// Main is designed so that the app's main package looks like this: -// -// package main -// -// import ( -// "google.golang.org/appengine" -// -// _ "myapp/package0" -// _ "myapp/package1" -// ) -// -// func main() { -// appengine.Main() -// } -// -// The "myapp/packageX" packages are expected to register HTTP handlers -// in their init functions. -func Main() { - internal.Main() -} - -// IsDevAppServer reports whether the App Engine app is running in the -// development App Server. -func IsDevAppServer() bool { - return internal.IsDevAppServer() -} - -// IsStandard reports whether the App Engine app is running in the standard -// environment. This includes both the first generation runtimes (<= Go 1.9) -// and the second generation runtimes (>= Go 1.11). -func IsStandard() bool { - return internal.IsStandard() -} - -// IsFlex reports whether the App Engine app is running in the flexible environment. -func IsFlex() bool { - return internal.IsFlex() -} - -// IsAppEngine reports whether the App Engine app is running on App Engine, in either -// the standard or flexible environment. -func IsAppEngine() bool { - return internal.IsAppEngine() -} - -// IsSecondGen reports whether the App Engine app is running on the second generation -// runtimes (>= Go 1.11). -func IsSecondGen() bool { - return internal.IsSecondGen() -} - -// NewContext returns a context for an in-flight HTTP request. -// This function is cheap. -func NewContext(req *http.Request) context.Context { - return internal.ReqContext(req) -} - -// WithContext returns a copy of the parent context -// and associates it with an in-flight HTTP request. -// This function is cheap. -func WithContext(parent context.Context, req *http.Request) context.Context { - return internal.WithContext(parent, req) -} - -// BlobKey is a key for a blobstore blob. -// -// Conceptually, this type belongs in the blobstore package, but it lives in -// the appengine package to avoid a circular dependency: blobstore depends on -// datastore, and datastore needs to refer to the BlobKey type. -type BlobKey string - -// GeoPoint represents a location as latitude/longitude in degrees. -type GeoPoint struct { - Lat, Lng float64 -} - -// Valid returns whether a GeoPoint is within [-90, 90] latitude and [-180, 180] longitude. -func (g GeoPoint) Valid() bool { - return -90 <= g.Lat && g.Lat <= 90 && -180 <= g.Lng && g.Lng <= 180 -} - -// APICallFunc defines a function type for handling an API call. -// See WithCallOverride. -type APICallFunc func(ctx context.Context, service, method string, in, out proto.Message) error - -// WithAPICallFunc returns a copy of the parent context -// that will cause API calls to invoke f instead of their normal operation. -// -// This is intended for advanced users only. -func WithAPICallFunc(ctx context.Context, f APICallFunc) context.Context { - return internal.WithCallOverride(ctx, internal.CallOverrideFunc(f)) -} - -// APICall performs an API call. -// -// This is not intended for general use; it is exported for use in conjunction -// with WithAPICallFunc. -func APICall(ctx context.Context, service, method string, in, out proto.Message) error { - return internal.Call(ctx, service, method, in, out) -} diff --git a/vendor/google.golang.org/appengine/appengine_vm.go b/vendor/google.golang.org/appengine/appengine_vm.go deleted file mode 100644 index f4b645aad3..0000000000 --- a/vendor/google.golang.org/appengine/appengine_vm.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -// +build !appengine - -package appengine - -import ( - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" -) - -// BackgroundContext returns a context not associated with a request. -// This should only be used when not servicing a request. -// This only works in App Engine "flexible environment". -func BackgroundContext() context.Context { - return internal.BackgroundContext() -} diff --git a/vendor/google.golang.org/appengine/errors.go b/vendor/google.golang.org/appengine/errors.go deleted file mode 100644 index 16d0772e2a..0000000000 --- a/vendor/google.golang.org/appengine/errors.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -// This file provides error functions for common API failure modes. - -package appengine - -import ( - "fmt" - - "google.golang.org/appengine/internal" -) - -// IsOverQuota reports whether err represents an API call failure -// due to insufficient available quota. -func IsOverQuota(err error) bool { - callErr, ok := err.(*internal.CallError) - return ok && callErr.Code == 4 -} - -// MultiError is returned by batch operations when there are errors with -// particular elements. Errors will be in a one-to-one correspondence with -// the input elements; successful elements will have a nil entry. -type MultiError []error - -func (m MultiError) Error() string { - s, n := "", 0 - for _, e := range m { - if e != nil { - if n == 0 { - s = e.Error() - } - n++ - } - } - switch n { - case 0: - return "(0 errors)" - case 1: - return s - case 2: - return s + " (and 1 other error)" - } - return fmt.Sprintf("%s (and %d other errors)", s, n-1) -} diff --git a/vendor/google.golang.org/appengine/identity.go b/vendor/google.golang.org/appengine/identity.go deleted file mode 100644 index b8dcf8f361..0000000000 --- a/vendor/google.golang.org/appengine/identity.go +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package appengine - -import ( - "time" - - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" - pb "google.golang.org/appengine/internal/app_identity" - modpb "google.golang.org/appengine/internal/modules" -) - -// AppID returns the application ID for the current application. -// The string will be a plain application ID (e.g. "appid"), with a -// domain prefix for custom domain deployments (e.g. "example.com:appid"). -func AppID(c context.Context) string { return internal.AppID(c) } - -// DefaultVersionHostname returns the standard hostname of the default version -// of the current application (e.g. "my-app.appspot.com"). This is suitable for -// use in constructing URLs. -func DefaultVersionHostname(c context.Context) string { - return internal.DefaultVersionHostname(c) -} - -// ModuleName returns the module name of the current instance. -func ModuleName(c context.Context) string { - return internal.ModuleName(c) -} - -// ModuleHostname returns a hostname of a module instance. -// If module is the empty string, it refers to the module of the current instance. -// If version is empty, it refers to the version of the current instance if valid, -// or the default version of the module of the current instance. -// If instance is empty, ModuleHostname returns the load-balancing hostname. -func ModuleHostname(c context.Context, module, version, instance string) (string, error) { - req := &modpb.GetHostnameRequest{} - if module != "" { - req.Module = &module - } - if version != "" { - req.Version = &version - } - if instance != "" { - req.Instance = &instance - } - res := &modpb.GetHostnameResponse{} - if err := internal.Call(c, "modules", "GetHostname", req, res); err != nil { - return "", err - } - return *res.Hostname, nil -} - -// VersionID returns the version ID for the current application. -// It will be of the form "X.Y", where X is specified in app.yaml, -// and Y is a number generated when each version of the app is uploaded. -// It does not include a module name. -func VersionID(c context.Context) string { return internal.VersionID(c) } - -// InstanceID returns a mostly-unique identifier for this instance. -func InstanceID() string { return internal.InstanceID() } - -// Datacenter returns an identifier for the datacenter that the instance is running in. -func Datacenter(c context.Context) string { return internal.Datacenter(c) } - -// ServerSoftware returns the App Engine release version. -// In production, it looks like "Google App Engine/X.Y.Z". -// In the development appserver, it looks like "Development/X.Y". -func ServerSoftware() string { return internal.ServerSoftware() } - -// RequestID returns a string that uniquely identifies the request. -func RequestID(c context.Context) string { return internal.RequestID(c) } - -// AccessToken generates an OAuth2 access token for the specified scopes on -// behalf of service account of this application. This token will expire after -// the returned time. -func AccessToken(c context.Context, scopes ...string) (token string, expiry time.Time, err error) { - req := &pb.GetAccessTokenRequest{Scope: scopes} - res := &pb.GetAccessTokenResponse{} - - err = internal.Call(c, "app_identity_service", "GetAccessToken", req, res) - if err != nil { - return "", time.Time{}, err - } - return res.GetAccessToken(), time.Unix(res.GetExpirationTime(), 0), nil -} - -// Certificate represents a public certificate for the app. -type Certificate struct { - KeyName string - Data []byte // PEM-encoded X.509 certificate -} - -// PublicCertificates retrieves the public certificates for the app. -// They can be used to verify a signature returned by SignBytes. -func PublicCertificates(c context.Context) ([]Certificate, error) { - req := &pb.GetPublicCertificateForAppRequest{} - res := &pb.GetPublicCertificateForAppResponse{} - if err := internal.Call(c, "app_identity_service", "GetPublicCertificatesForApp", req, res); err != nil { - return nil, err - } - var cs []Certificate - for _, pc := range res.PublicCertificateList { - cs = append(cs, Certificate{ - KeyName: pc.GetKeyName(), - Data: []byte(pc.GetX509CertificatePem()), - }) - } - return cs, nil -} - -// ServiceAccount returns a string representing the service account name, in -// the form of an email address (typically app_id@appspot.gserviceaccount.com). -func ServiceAccount(c context.Context) (string, error) { - req := &pb.GetServiceAccountNameRequest{} - res := &pb.GetServiceAccountNameResponse{} - - err := internal.Call(c, "app_identity_service", "GetServiceAccountName", req, res) - if err != nil { - return "", err - } - return res.GetServiceAccountName(), err -} - -// SignBytes signs bytes using a private key unique to your application. -func SignBytes(c context.Context, bytes []byte) (keyName string, signature []byte, err error) { - req := &pb.SignForAppRequest{BytesToSign: bytes} - res := &pb.SignForAppResponse{} - - if err := internal.Call(c, "app_identity_service", "SignForApp", req, res); err != nil { - return "", nil, err - } - return res.GetKeyName(), res.GetSignatureBytes(), nil -} - -func init() { - internal.RegisterErrorCodeMap("app_identity_service", pb.AppIdentityServiceError_ErrorCode_name) - internal.RegisterErrorCodeMap("modules", modpb.ModulesServiceError_ErrorCode_name) -} diff --git a/vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.pb.go b/vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.pb.go deleted file mode 100644 index 9a2ff77ab5..0000000000 --- a/vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.pb.go +++ /dev/null @@ -1,611 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google.golang.org/appengine/internal/app_identity/app_identity_service.proto - -package app_identity - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type AppIdentityServiceError_ErrorCode int32 - -const ( - AppIdentityServiceError_SUCCESS AppIdentityServiceError_ErrorCode = 0 - AppIdentityServiceError_UNKNOWN_SCOPE AppIdentityServiceError_ErrorCode = 9 - AppIdentityServiceError_BLOB_TOO_LARGE AppIdentityServiceError_ErrorCode = 1000 - AppIdentityServiceError_DEADLINE_EXCEEDED AppIdentityServiceError_ErrorCode = 1001 - AppIdentityServiceError_NOT_A_VALID_APP AppIdentityServiceError_ErrorCode = 1002 - AppIdentityServiceError_UNKNOWN_ERROR AppIdentityServiceError_ErrorCode = 1003 - AppIdentityServiceError_NOT_ALLOWED AppIdentityServiceError_ErrorCode = 1005 - AppIdentityServiceError_NOT_IMPLEMENTED AppIdentityServiceError_ErrorCode = 1006 -) - -var AppIdentityServiceError_ErrorCode_name = map[int32]string{ - 0: "SUCCESS", - 9: "UNKNOWN_SCOPE", - 1000: "BLOB_TOO_LARGE", - 1001: "DEADLINE_EXCEEDED", - 1002: "NOT_A_VALID_APP", - 1003: "UNKNOWN_ERROR", - 1005: "NOT_ALLOWED", - 1006: "NOT_IMPLEMENTED", -} -var AppIdentityServiceError_ErrorCode_value = map[string]int32{ - "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, -} - -func (x AppIdentityServiceError_ErrorCode) Enum() *AppIdentityServiceError_ErrorCode { - p := new(AppIdentityServiceError_ErrorCode) - *p = x - return p -} -func (x AppIdentityServiceError_ErrorCode) String() string { - return proto.EnumName(AppIdentityServiceError_ErrorCode_name, int32(x)) -} -func (x *AppIdentityServiceError_ErrorCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(AppIdentityServiceError_ErrorCode_value, data, "AppIdentityServiceError_ErrorCode") - if err != nil { - return err - } - *x = AppIdentityServiceError_ErrorCode(value) - return nil -} -func (AppIdentityServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{0, 0} -} - -type AppIdentityServiceError struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AppIdentityServiceError) Reset() { *m = AppIdentityServiceError{} } -func (m *AppIdentityServiceError) String() string { return proto.CompactTextString(m) } -func (*AppIdentityServiceError) ProtoMessage() {} -func (*AppIdentityServiceError) Descriptor() ([]byte, []int) { - return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{0} -} -func (m *AppIdentityServiceError) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AppIdentityServiceError.Unmarshal(m, b) -} -func (m *AppIdentityServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AppIdentityServiceError.Marshal(b, m, deterministic) -} -func (dst *AppIdentityServiceError) XXX_Merge(src proto.Message) { - xxx_messageInfo_AppIdentityServiceError.Merge(dst, src) -} -func (m *AppIdentityServiceError) XXX_Size() int { - return xxx_messageInfo_AppIdentityServiceError.Size(m) -} -func (m *AppIdentityServiceError) XXX_DiscardUnknown() { - xxx_messageInfo_AppIdentityServiceError.DiscardUnknown(m) -} - -var xxx_messageInfo_AppIdentityServiceError proto.InternalMessageInfo - -type SignForAppRequest struct { - BytesToSign []byte `protobuf:"bytes,1,opt,name=bytes_to_sign,json=bytesToSign" json:"bytes_to_sign,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SignForAppRequest) Reset() { *m = SignForAppRequest{} } -func (m *SignForAppRequest) String() string { return proto.CompactTextString(m) } -func (*SignForAppRequest) ProtoMessage() {} -func (*SignForAppRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{1} -} -func (m *SignForAppRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignForAppRequest.Unmarshal(m, b) -} -func (m *SignForAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignForAppRequest.Marshal(b, m, deterministic) -} -func (dst *SignForAppRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignForAppRequest.Merge(dst, src) -} -func (m *SignForAppRequest) XXX_Size() int { - return xxx_messageInfo_SignForAppRequest.Size(m) -} -func (m *SignForAppRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SignForAppRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SignForAppRequest proto.InternalMessageInfo - -func (m *SignForAppRequest) GetBytesToSign() []byte { - if m != nil { - return m.BytesToSign - } - return nil -} - -type SignForAppResponse struct { - KeyName *string `protobuf:"bytes,1,opt,name=key_name,json=keyName" json:"key_name,omitempty"` - SignatureBytes []byte `protobuf:"bytes,2,opt,name=signature_bytes,json=signatureBytes" json:"signature_bytes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SignForAppResponse) Reset() { *m = SignForAppResponse{} } -func (m *SignForAppResponse) String() string { return proto.CompactTextString(m) } -func (*SignForAppResponse) ProtoMessage() {} -func (*SignForAppResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{2} -} -func (m *SignForAppResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignForAppResponse.Unmarshal(m, b) -} -func (m *SignForAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignForAppResponse.Marshal(b, m, deterministic) -} -func (dst *SignForAppResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignForAppResponse.Merge(dst, src) -} -func (m *SignForAppResponse) XXX_Size() int { - return xxx_messageInfo_SignForAppResponse.Size(m) -} -func (m *SignForAppResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SignForAppResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SignForAppResponse proto.InternalMessageInfo - -func (m *SignForAppResponse) GetKeyName() string { - if m != nil && m.KeyName != nil { - return *m.KeyName - } - return "" -} - -func (m *SignForAppResponse) GetSignatureBytes() []byte { - if m != nil { - return m.SignatureBytes - } - return nil -} - -type GetPublicCertificateForAppRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetPublicCertificateForAppRequest) Reset() { *m = GetPublicCertificateForAppRequest{} } -func (m *GetPublicCertificateForAppRequest) String() string { return proto.CompactTextString(m) } -func (*GetPublicCertificateForAppRequest) ProtoMessage() {} -func (*GetPublicCertificateForAppRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{3} -} -func (m *GetPublicCertificateForAppRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetPublicCertificateForAppRequest.Unmarshal(m, b) -} -func (m *GetPublicCertificateForAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetPublicCertificateForAppRequest.Marshal(b, m, deterministic) -} -func (dst *GetPublicCertificateForAppRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetPublicCertificateForAppRequest.Merge(dst, src) -} -func (m *GetPublicCertificateForAppRequest) XXX_Size() int { - return xxx_messageInfo_GetPublicCertificateForAppRequest.Size(m) -} -func (m *GetPublicCertificateForAppRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetPublicCertificateForAppRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetPublicCertificateForAppRequest proto.InternalMessageInfo - -type PublicCertificate struct { - KeyName *string `protobuf:"bytes,1,opt,name=key_name,json=keyName" json:"key_name,omitempty"` - X509CertificatePem *string `protobuf:"bytes,2,opt,name=x509_certificate_pem,json=x509CertificatePem" json:"x509_certificate_pem,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PublicCertificate) Reset() { *m = PublicCertificate{} } -func (m *PublicCertificate) String() string { return proto.CompactTextString(m) } -func (*PublicCertificate) ProtoMessage() {} -func (*PublicCertificate) Descriptor() ([]byte, []int) { - return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{4} -} -func (m *PublicCertificate) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PublicCertificate.Unmarshal(m, b) -} -func (m *PublicCertificate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PublicCertificate.Marshal(b, m, deterministic) -} -func (dst *PublicCertificate) XXX_Merge(src proto.Message) { - xxx_messageInfo_PublicCertificate.Merge(dst, src) -} -func (m *PublicCertificate) XXX_Size() int { - return xxx_messageInfo_PublicCertificate.Size(m) -} -func (m *PublicCertificate) XXX_DiscardUnknown() { - xxx_messageInfo_PublicCertificate.DiscardUnknown(m) -} - -var xxx_messageInfo_PublicCertificate proto.InternalMessageInfo - -func (m *PublicCertificate) GetKeyName() string { - if m != nil && m.KeyName != nil { - return *m.KeyName - } - return "" -} - -func (m *PublicCertificate) GetX509CertificatePem() string { - if m != nil && m.X509CertificatePem != nil { - return *m.X509CertificatePem - } - return "" -} - -type GetPublicCertificateForAppResponse struct { - PublicCertificateList []*PublicCertificate `protobuf:"bytes,1,rep,name=public_certificate_list,json=publicCertificateList" json:"public_certificate_list,omitempty"` - MaxClientCacheTimeInSecond *int64 `protobuf:"varint,2,opt,name=max_client_cache_time_in_second,json=maxClientCacheTimeInSecond" json:"max_client_cache_time_in_second,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetPublicCertificateForAppResponse) Reset() { *m = GetPublicCertificateForAppResponse{} } -func (m *GetPublicCertificateForAppResponse) String() string { return proto.CompactTextString(m) } -func (*GetPublicCertificateForAppResponse) ProtoMessage() {} -func (*GetPublicCertificateForAppResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{5} -} -func (m *GetPublicCertificateForAppResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetPublicCertificateForAppResponse.Unmarshal(m, b) -} -func (m *GetPublicCertificateForAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetPublicCertificateForAppResponse.Marshal(b, m, deterministic) -} -func (dst *GetPublicCertificateForAppResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetPublicCertificateForAppResponse.Merge(dst, src) -} -func (m *GetPublicCertificateForAppResponse) XXX_Size() int { - return xxx_messageInfo_GetPublicCertificateForAppResponse.Size(m) -} -func (m *GetPublicCertificateForAppResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetPublicCertificateForAppResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetPublicCertificateForAppResponse proto.InternalMessageInfo - -func (m *GetPublicCertificateForAppResponse) GetPublicCertificateList() []*PublicCertificate { - if m != nil { - return m.PublicCertificateList - } - return nil -} - -func (m *GetPublicCertificateForAppResponse) GetMaxClientCacheTimeInSecond() int64 { - if m != nil && m.MaxClientCacheTimeInSecond != nil { - return *m.MaxClientCacheTimeInSecond - } - return 0 -} - -type GetServiceAccountNameRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetServiceAccountNameRequest) Reset() { *m = GetServiceAccountNameRequest{} } -func (m *GetServiceAccountNameRequest) String() string { return proto.CompactTextString(m) } -func (*GetServiceAccountNameRequest) ProtoMessage() {} -func (*GetServiceAccountNameRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{6} -} -func (m *GetServiceAccountNameRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetServiceAccountNameRequest.Unmarshal(m, b) -} -func (m *GetServiceAccountNameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetServiceAccountNameRequest.Marshal(b, m, deterministic) -} -func (dst *GetServiceAccountNameRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetServiceAccountNameRequest.Merge(dst, src) -} -func (m *GetServiceAccountNameRequest) XXX_Size() int { - return xxx_messageInfo_GetServiceAccountNameRequest.Size(m) -} -func (m *GetServiceAccountNameRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetServiceAccountNameRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetServiceAccountNameRequest proto.InternalMessageInfo - -type GetServiceAccountNameResponse struct { - ServiceAccountName *string `protobuf:"bytes,1,opt,name=service_account_name,json=serviceAccountName" json:"service_account_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetServiceAccountNameResponse) Reset() { *m = GetServiceAccountNameResponse{} } -func (m *GetServiceAccountNameResponse) String() string { return proto.CompactTextString(m) } -func (*GetServiceAccountNameResponse) ProtoMessage() {} -func (*GetServiceAccountNameResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{7} -} -func (m *GetServiceAccountNameResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetServiceAccountNameResponse.Unmarshal(m, b) -} -func (m *GetServiceAccountNameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetServiceAccountNameResponse.Marshal(b, m, deterministic) -} -func (dst *GetServiceAccountNameResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetServiceAccountNameResponse.Merge(dst, src) -} -func (m *GetServiceAccountNameResponse) XXX_Size() int { - return xxx_messageInfo_GetServiceAccountNameResponse.Size(m) -} -func (m *GetServiceAccountNameResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetServiceAccountNameResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetServiceAccountNameResponse proto.InternalMessageInfo - -func (m *GetServiceAccountNameResponse) GetServiceAccountName() string { - if m != nil && m.ServiceAccountName != nil { - return *m.ServiceAccountName - } - return "" -} - -type GetAccessTokenRequest struct { - Scope []string `protobuf:"bytes,1,rep,name=scope" json:"scope,omitempty"` - ServiceAccountId *int64 `protobuf:"varint,2,opt,name=service_account_id,json=serviceAccountId" json:"service_account_id,omitempty"` - ServiceAccountName *string `protobuf:"bytes,3,opt,name=service_account_name,json=serviceAccountName" json:"service_account_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAccessTokenRequest) Reset() { *m = GetAccessTokenRequest{} } -func (m *GetAccessTokenRequest) String() string { return proto.CompactTextString(m) } -func (*GetAccessTokenRequest) ProtoMessage() {} -func (*GetAccessTokenRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{8} -} -func (m *GetAccessTokenRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAccessTokenRequest.Unmarshal(m, b) -} -func (m *GetAccessTokenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAccessTokenRequest.Marshal(b, m, deterministic) -} -func (dst *GetAccessTokenRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAccessTokenRequest.Merge(dst, src) -} -func (m *GetAccessTokenRequest) XXX_Size() int { - return xxx_messageInfo_GetAccessTokenRequest.Size(m) -} -func (m *GetAccessTokenRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetAccessTokenRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAccessTokenRequest proto.InternalMessageInfo - -func (m *GetAccessTokenRequest) GetScope() []string { - if m != nil { - return m.Scope - } - return nil -} - -func (m *GetAccessTokenRequest) GetServiceAccountId() int64 { - if m != nil && m.ServiceAccountId != nil { - return *m.ServiceAccountId - } - return 0 -} - -func (m *GetAccessTokenRequest) GetServiceAccountName() string { - if m != nil && m.ServiceAccountName != nil { - return *m.ServiceAccountName - } - return "" -} - -type GetAccessTokenResponse struct { - AccessToken *string `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"` - ExpirationTime *int64 `protobuf:"varint,2,opt,name=expiration_time,json=expirationTime" json:"expiration_time,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAccessTokenResponse) Reset() { *m = GetAccessTokenResponse{} } -func (m *GetAccessTokenResponse) String() string { return proto.CompactTextString(m) } -func (*GetAccessTokenResponse) ProtoMessage() {} -func (*GetAccessTokenResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{9} -} -func (m *GetAccessTokenResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAccessTokenResponse.Unmarshal(m, b) -} -func (m *GetAccessTokenResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAccessTokenResponse.Marshal(b, m, deterministic) -} -func (dst *GetAccessTokenResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAccessTokenResponse.Merge(dst, src) -} -func (m *GetAccessTokenResponse) XXX_Size() int { - return xxx_messageInfo_GetAccessTokenResponse.Size(m) -} -func (m *GetAccessTokenResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetAccessTokenResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAccessTokenResponse proto.InternalMessageInfo - -func (m *GetAccessTokenResponse) GetAccessToken() string { - if m != nil && m.AccessToken != nil { - return *m.AccessToken - } - return "" -} - -func (m *GetAccessTokenResponse) GetExpirationTime() int64 { - if m != nil && m.ExpirationTime != nil { - return *m.ExpirationTime - } - return 0 -} - -type GetDefaultGcsBucketNameRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetDefaultGcsBucketNameRequest) Reset() { *m = GetDefaultGcsBucketNameRequest{} } -func (m *GetDefaultGcsBucketNameRequest) String() string { return proto.CompactTextString(m) } -func (*GetDefaultGcsBucketNameRequest) ProtoMessage() {} -func (*GetDefaultGcsBucketNameRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{10} -} -func (m *GetDefaultGcsBucketNameRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetDefaultGcsBucketNameRequest.Unmarshal(m, b) -} -func (m *GetDefaultGcsBucketNameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetDefaultGcsBucketNameRequest.Marshal(b, m, deterministic) -} -func (dst *GetDefaultGcsBucketNameRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetDefaultGcsBucketNameRequest.Merge(dst, src) -} -func (m *GetDefaultGcsBucketNameRequest) XXX_Size() int { - return xxx_messageInfo_GetDefaultGcsBucketNameRequest.Size(m) -} -func (m *GetDefaultGcsBucketNameRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetDefaultGcsBucketNameRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetDefaultGcsBucketNameRequest proto.InternalMessageInfo - -type GetDefaultGcsBucketNameResponse struct { - DefaultGcsBucketName *string `protobuf:"bytes,1,opt,name=default_gcs_bucket_name,json=defaultGcsBucketName" json:"default_gcs_bucket_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetDefaultGcsBucketNameResponse) Reset() { *m = GetDefaultGcsBucketNameResponse{} } -func (m *GetDefaultGcsBucketNameResponse) String() string { return proto.CompactTextString(m) } -func (*GetDefaultGcsBucketNameResponse) ProtoMessage() {} -func (*GetDefaultGcsBucketNameResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{11} -} -func (m *GetDefaultGcsBucketNameResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetDefaultGcsBucketNameResponse.Unmarshal(m, b) -} -func (m *GetDefaultGcsBucketNameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetDefaultGcsBucketNameResponse.Marshal(b, m, deterministic) -} -func (dst *GetDefaultGcsBucketNameResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetDefaultGcsBucketNameResponse.Merge(dst, src) -} -func (m *GetDefaultGcsBucketNameResponse) XXX_Size() int { - return xxx_messageInfo_GetDefaultGcsBucketNameResponse.Size(m) -} -func (m *GetDefaultGcsBucketNameResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetDefaultGcsBucketNameResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetDefaultGcsBucketNameResponse proto.InternalMessageInfo - -func (m *GetDefaultGcsBucketNameResponse) GetDefaultGcsBucketName() string { - if m != nil && m.DefaultGcsBucketName != nil { - return *m.DefaultGcsBucketName - } - return "" -} - -func init() { - proto.RegisterType((*AppIdentityServiceError)(nil), "appengine.AppIdentityServiceError") - proto.RegisterType((*SignForAppRequest)(nil), "appengine.SignForAppRequest") - proto.RegisterType((*SignForAppResponse)(nil), "appengine.SignForAppResponse") - proto.RegisterType((*GetPublicCertificateForAppRequest)(nil), "appengine.GetPublicCertificateForAppRequest") - proto.RegisterType((*PublicCertificate)(nil), "appengine.PublicCertificate") - proto.RegisterType((*GetPublicCertificateForAppResponse)(nil), "appengine.GetPublicCertificateForAppResponse") - proto.RegisterType((*GetServiceAccountNameRequest)(nil), "appengine.GetServiceAccountNameRequest") - proto.RegisterType((*GetServiceAccountNameResponse)(nil), "appengine.GetServiceAccountNameResponse") - proto.RegisterType((*GetAccessTokenRequest)(nil), "appengine.GetAccessTokenRequest") - proto.RegisterType((*GetAccessTokenResponse)(nil), "appengine.GetAccessTokenResponse") - proto.RegisterType((*GetDefaultGcsBucketNameRequest)(nil), "appengine.GetDefaultGcsBucketNameRequest") - proto.RegisterType((*GetDefaultGcsBucketNameResponse)(nil), "appengine.GetDefaultGcsBucketNameResponse") -} - -func init() { - proto.RegisterFile("google.golang.org/appengine/internal/app_identity/app_identity_service.proto", fileDescriptor_app_identity_service_08a6e3f74b04cfa4) -} - -var fileDescriptor_app_identity_service_08a6e3f74b04cfa4 = []byte{ - // 676 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xdb, 0x6e, 0xda, 0x58, - 0x14, 0x1d, 0x26, 0x1a, 0x31, 0x6c, 0x12, 0x62, 0xce, 0x90, 0xcb, 0x8c, 0x32, 0xb9, 0x78, 0x1e, - 0x26, 0x0f, 0x15, 0x89, 0x2a, 0x45, 0x55, 0x1f, 0x8d, 0xed, 0x22, 0x54, 0x07, 0x53, 0x43, 0x9a, - 0xa8, 0x2f, 0xa7, 0xce, 0x61, 0xc7, 0x3d, 0x02, 0x9f, 0xe3, 0xda, 0x87, 0x0a, 0x3e, 0xa2, 0x3f, - 0xd2, 0x9f, 0xe8, 0x5b, 0xbf, 0xa5, 0x17, 0xb5, 0xdf, 0x50, 0xd9, 0x38, 0x5c, 0x92, 0x92, 0x37, - 0xbc, 0xf6, 0x5a, 0xcb, 0x6b, 0x2f, 0x6d, 0x0c, 0x4e, 0x20, 0x65, 0x30, 0xc4, 0x7a, 0x20, 0x87, - 0xbe, 0x08, 0xea, 0x32, 0x0e, 0x4e, 0xfc, 0x28, 0x42, 0x11, 0x70, 0x81, 0x27, 0x5c, 0x28, 0x8c, - 0x85, 0x3f, 0x4c, 0x21, 0xca, 0xfb, 0x28, 0x14, 0x57, 0x93, 0xa5, 0x07, 0x9a, 0x60, 0xfc, 0x8e, - 0x33, 0xac, 0x47, 0xb1, 0x54, 0x92, 0x94, 0x66, 0x5a, 0xfd, 0x53, 0x01, 0x76, 0x8c, 0x28, 0x6a, - 0xe5, 0xc4, 0xee, 0x94, 0x67, 0xc7, 0xb1, 0x8c, 0xf5, 0x0f, 0x05, 0x28, 0x65, 0xbf, 0x4c, 0xd9, - 0x47, 0x52, 0x86, 0x62, 0xf7, 0xc2, 0x34, 0xed, 0x6e, 0x57, 0xfb, 0x8d, 0x54, 0x61, 0xe3, 0xa2, - 0xfd, 0xbc, 0xed, 0x5e, 0xb6, 0x69, 0xd7, 0x74, 0x3b, 0xb6, 0x56, 0x22, 0x7f, 0x41, 0xa5, 0xe1, - 0xb8, 0x0d, 0xda, 0x73, 0x5d, 0xea, 0x18, 0x5e, 0xd3, 0xd6, 0x3e, 0x17, 0xc9, 0x36, 0x54, 0x2d, - 0xdb, 0xb0, 0x9c, 0x56, 0xdb, 0xa6, 0xf6, 0x95, 0x69, 0xdb, 0x96, 0x6d, 0x69, 0x5f, 0x8a, 0xa4, - 0x06, 0x9b, 0x6d, 0xb7, 0x47, 0x0d, 0xfa, 0xd2, 0x70, 0x5a, 0x16, 0x35, 0x3a, 0x1d, 0xed, 0x6b, - 0x91, 0x90, 0xb9, 0xab, 0xed, 0x79, 0xae, 0xa7, 0x7d, 0x2b, 0x12, 0x0d, 0xca, 0x19, 0xd3, 0x71, - 0xdc, 0x4b, 0xdb, 0xd2, 0xbe, 0xcf, 0xb4, 0xad, 0xf3, 0x8e, 0x63, 0x9f, 0xdb, 0xed, 0x9e, 0x6d, - 0x69, 0x3f, 0x8a, 0xfa, 0x13, 0xa8, 0x76, 0x79, 0x20, 0x9e, 0xc9, 0xd8, 0x88, 0x22, 0x0f, 0xdf, - 0x8e, 0x30, 0x51, 0x44, 0x87, 0x8d, 0xeb, 0x89, 0xc2, 0x84, 0x2a, 0x49, 0x13, 0x1e, 0x88, 0xdd, - 0xc2, 0x61, 0xe1, 0x78, 0xdd, 0x2b, 0x67, 0x60, 0x4f, 0xa6, 0x02, 0xfd, 0x0a, 0xc8, 0xa2, 0x30, - 0x89, 0xa4, 0x48, 0x90, 0xfc, 0x0d, 0x7f, 0x0e, 0x70, 0x42, 0x85, 0x1f, 0x62, 0x26, 0x2a, 0x79, - 0xc5, 0x01, 0x4e, 0xda, 0x7e, 0x88, 0xe4, 0x7f, 0xd8, 0x4c, 0xbd, 0x7c, 0x35, 0x8a, 0x91, 0x66, - 0x4e, 0xbb, 0xbf, 0x67, 0xb6, 0x95, 0x19, 0xdc, 0x48, 0x51, 0xfd, 0x3f, 0x38, 0x6a, 0xa2, 0xea, - 0x8c, 0xae, 0x87, 0x9c, 0x99, 0x18, 0x2b, 0x7e, 0xc3, 0x99, 0xaf, 0x70, 0x29, 0xa2, 0xfe, 0x1a, - 0xaa, 0xf7, 0x18, 0x0f, 0xbd, 0xfd, 0x14, 0x6a, 0xe3, 0xb3, 0xd3, 0xa7, 0x94, 0xcd, 0xe9, 0x34, - 0xc2, 0x30, 0x8b, 0x50, 0xf2, 0x48, 0x3a, 0x5b, 0x70, 0xea, 0x60, 0xa8, 0x7f, 0x2c, 0x80, 0xfe, - 0x50, 0x8e, 0x7c, 0xe3, 0x1e, 0xec, 0x44, 0x19, 0x65, 0xc9, 0x7a, 0xc8, 0x13, 0xb5, 0x5b, 0x38, - 0x5c, 0x3b, 0x2e, 0x3f, 0xde, 0xab, 0xcf, 0xce, 0xa6, 0x7e, 0xcf, 0xcc, 0xdb, 0x8a, 0xee, 0x42, - 0x0e, 0x4f, 0x14, 0x31, 0xe1, 0x20, 0xf4, 0xc7, 0x94, 0x0d, 0x39, 0x0a, 0x45, 0x99, 0xcf, 0xde, - 0x20, 0x55, 0x3c, 0x44, 0xca, 0x05, 0x4d, 0x90, 0x49, 0xd1, 0xcf, 0x92, 0xaf, 0x79, 0xff, 0x84, - 0xfe, 0xd8, 0xcc, 0x58, 0x66, 0x4a, 0xea, 0xf1, 0x10, 0x5b, 0xa2, 0x9b, 0x31, 0xf4, 0x7d, 0xd8, - 0x6b, 0xa2, 0xca, 0x6f, 0xd3, 0x60, 0x4c, 0x8e, 0x84, 0x4a, 0xcb, 0xb8, 0xed, 0xf0, 0x05, 0xfc, - 0xbb, 0x62, 0x9e, 0xef, 0x76, 0x0a, 0xb5, 0xfc, 0x1f, 0x40, 0xfd, 0xe9, 0x78, 0xb1, 0x5b, 0x92, - 0xdc, 0x53, 0xea, 0xef, 0x0b, 0xb0, 0xd5, 0x44, 0x65, 0x30, 0x86, 0x49, 0xd2, 0x93, 0x03, 0x14, - 0xb7, 0x37, 0x55, 0x83, 0x3f, 0x12, 0x26, 0x23, 0xcc, 0x5a, 0x29, 0x79, 0xd3, 0x07, 0xf2, 0x08, - 0xc8, 0xdd, 0x37, 0xf0, 0xdb, 0xd5, 0xb4, 0x65, 0xff, 0x56, 0x7f, 0x65, 0x9e, 0xb5, 0x95, 0x79, - 0xfa, 0xb0, 0x7d, 0x37, 0x4e, 0xbe, 0xdb, 0x11, 0xac, 0xfb, 0x19, 0x4c, 0x55, 0x8a, 0xe7, 0x3b, - 0x95, 0xfd, 0x39, 0x35, 0xbd, 0x58, 0x1c, 0x47, 0x3c, 0xf6, 0x15, 0x97, 0x22, 0xab, 0x3f, 0x4f, - 0x56, 0x99, 0xc3, 0x69, 0xe1, 0xfa, 0x21, 0xec, 0x37, 0x51, 0x59, 0x78, 0xe3, 0x8f, 0x86, 0xaa, - 0xc9, 0x92, 0xc6, 0x88, 0x0d, 0x70, 0xa9, 0xea, 0x2b, 0x38, 0x58, 0xc9, 0xc8, 0x03, 0x9d, 0xc1, - 0x4e, 0x7f, 0x3a, 0xa7, 0x01, 0x4b, 0xe8, 0x75, 0xc6, 0x58, 0xec, 0xbb, 0xd6, 0xff, 0x85, 0xbc, - 0x51, 0x79, 0xb5, 0xbe, 0xf8, 0xc9, 0xfa, 0x19, 0x00, 0x00, 0xff, 0xff, 0x37, 0x4c, 0x56, 0x38, - 0xf3, 0x04, 0x00, 0x00, -} 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 19610ca5b7..0000000000 --- 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/modules/modules_service.pb.go b/vendor/google.golang.org/appengine/internal/modules/modules_service.pb.go deleted file mode 100644 index ddfc0c04a1..0000000000 --- a/vendor/google.golang.org/appengine/internal/modules/modules_service.pb.go +++ /dev/null @@ -1,786 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google.golang.org/appengine/internal/modules/modules_service.proto - -package modules - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type ModulesServiceError_ErrorCode int32 - -const ( - ModulesServiceError_OK ModulesServiceError_ErrorCode = 0 - ModulesServiceError_INVALID_MODULE ModulesServiceError_ErrorCode = 1 - ModulesServiceError_INVALID_VERSION ModulesServiceError_ErrorCode = 2 - ModulesServiceError_INVALID_INSTANCES ModulesServiceError_ErrorCode = 3 - ModulesServiceError_TRANSIENT_ERROR ModulesServiceError_ErrorCode = 4 - ModulesServiceError_UNEXPECTED_STATE ModulesServiceError_ErrorCode = 5 -) - -var ModulesServiceError_ErrorCode_name = map[int32]string{ - 0: "OK", - 1: "INVALID_MODULE", - 2: "INVALID_VERSION", - 3: "INVALID_INSTANCES", - 4: "TRANSIENT_ERROR", - 5: "UNEXPECTED_STATE", -} -var ModulesServiceError_ErrorCode_value = map[string]int32{ - "OK": 0, - "INVALID_MODULE": 1, - "INVALID_VERSION": 2, - "INVALID_INSTANCES": 3, - "TRANSIENT_ERROR": 4, - "UNEXPECTED_STATE": 5, -} - -func (x ModulesServiceError_ErrorCode) Enum() *ModulesServiceError_ErrorCode { - p := new(ModulesServiceError_ErrorCode) - *p = x - return p -} -func (x ModulesServiceError_ErrorCode) String() string { - return proto.EnumName(ModulesServiceError_ErrorCode_name, int32(x)) -} -func (x *ModulesServiceError_ErrorCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ModulesServiceError_ErrorCode_value, data, "ModulesServiceError_ErrorCode") - if err != nil { - return err - } - *x = ModulesServiceError_ErrorCode(value) - return nil -} -func (ModulesServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{0, 0} -} - -type ModulesServiceError struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ModulesServiceError) Reset() { *m = ModulesServiceError{} } -func (m *ModulesServiceError) String() string { return proto.CompactTextString(m) } -func (*ModulesServiceError) ProtoMessage() {} -func (*ModulesServiceError) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{0} -} -func (m *ModulesServiceError) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ModulesServiceError.Unmarshal(m, b) -} -func (m *ModulesServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ModulesServiceError.Marshal(b, m, deterministic) -} -func (dst *ModulesServiceError) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModulesServiceError.Merge(dst, src) -} -func (m *ModulesServiceError) XXX_Size() int { - return xxx_messageInfo_ModulesServiceError.Size(m) -} -func (m *ModulesServiceError) XXX_DiscardUnknown() { - xxx_messageInfo_ModulesServiceError.DiscardUnknown(m) -} - -var xxx_messageInfo_ModulesServiceError proto.InternalMessageInfo - -type GetModulesRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetModulesRequest) Reset() { *m = GetModulesRequest{} } -func (m *GetModulesRequest) String() string { return proto.CompactTextString(m) } -func (*GetModulesRequest) ProtoMessage() {} -func (*GetModulesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{1} -} -func (m *GetModulesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetModulesRequest.Unmarshal(m, b) -} -func (m *GetModulesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetModulesRequest.Marshal(b, m, deterministic) -} -func (dst *GetModulesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetModulesRequest.Merge(dst, src) -} -func (m *GetModulesRequest) XXX_Size() int { - return xxx_messageInfo_GetModulesRequest.Size(m) -} -func (m *GetModulesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetModulesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetModulesRequest proto.InternalMessageInfo - -type GetModulesResponse struct { - Module []string `protobuf:"bytes,1,rep,name=module" json:"module,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetModulesResponse) Reset() { *m = GetModulesResponse{} } -func (m *GetModulesResponse) String() string { return proto.CompactTextString(m) } -func (*GetModulesResponse) ProtoMessage() {} -func (*GetModulesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{2} -} -func (m *GetModulesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetModulesResponse.Unmarshal(m, b) -} -func (m *GetModulesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetModulesResponse.Marshal(b, m, deterministic) -} -func (dst *GetModulesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetModulesResponse.Merge(dst, src) -} -func (m *GetModulesResponse) XXX_Size() int { - return xxx_messageInfo_GetModulesResponse.Size(m) -} -func (m *GetModulesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetModulesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetModulesResponse proto.InternalMessageInfo - -func (m *GetModulesResponse) GetModule() []string { - if m != nil { - return m.Module - } - return nil -} - -type GetVersionsRequest struct { - Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetVersionsRequest) Reset() { *m = GetVersionsRequest{} } -func (m *GetVersionsRequest) String() string { return proto.CompactTextString(m) } -func (*GetVersionsRequest) ProtoMessage() {} -func (*GetVersionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{3} -} -func (m *GetVersionsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetVersionsRequest.Unmarshal(m, b) -} -func (m *GetVersionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetVersionsRequest.Marshal(b, m, deterministic) -} -func (dst *GetVersionsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetVersionsRequest.Merge(dst, src) -} -func (m *GetVersionsRequest) XXX_Size() int { - return xxx_messageInfo_GetVersionsRequest.Size(m) -} -func (m *GetVersionsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetVersionsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetVersionsRequest proto.InternalMessageInfo - -func (m *GetVersionsRequest) GetModule() string { - if m != nil && m.Module != nil { - return *m.Module - } - return "" -} - -type GetVersionsResponse struct { - Version []string `protobuf:"bytes,1,rep,name=version" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetVersionsResponse) Reset() { *m = GetVersionsResponse{} } -func (m *GetVersionsResponse) String() string { return proto.CompactTextString(m) } -func (*GetVersionsResponse) ProtoMessage() {} -func (*GetVersionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{4} -} -func (m *GetVersionsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetVersionsResponse.Unmarshal(m, b) -} -func (m *GetVersionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetVersionsResponse.Marshal(b, m, deterministic) -} -func (dst *GetVersionsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetVersionsResponse.Merge(dst, src) -} -func (m *GetVersionsResponse) XXX_Size() int { - return xxx_messageInfo_GetVersionsResponse.Size(m) -} -func (m *GetVersionsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetVersionsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetVersionsResponse proto.InternalMessageInfo - -func (m *GetVersionsResponse) GetVersion() []string { - if m != nil { - return m.Version - } - return nil -} - -type GetDefaultVersionRequest struct { - Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetDefaultVersionRequest) Reset() { *m = GetDefaultVersionRequest{} } -func (m *GetDefaultVersionRequest) String() string { return proto.CompactTextString(m) } -func (*GetDefaultVersionRequest) ProtoMessage() {} -func (*GetDefaultVersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{5} -} -func (m *GetDefaultVersionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetDefaultVersionRequest.Unmarshal(m, b) -} -func (m *GetDefaultVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetDefaultVersionRequest.Marshal(b, m, deterministic) -} -func (dst *GetDefaultVersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetDefaultVersionRequest.Merge(dst, src) -} -func (m *GetDefaultVersionRequest) XXX_Size() int { - return xxx_messageInfo_GetDefaultVersionRequest.Size(m) -} -func (m *GetDefaultVersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetDefaultVersionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetDefaultVersionRequest proto.InternalMessageInfo - -func (m *GetDefaultVersionRequest) GetModule() string { - if m != nil && m.Module != nil { - return *m.Module - } - return "" -} - -type GetDefaultVersionResponse struct { - Version *string `protobuf:"bytes,1,req,name=version" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetDefaultVersionResponse) Reset() { *m = GetDefaultVersionResponse{} } -func (m *GetDefaultVersionResponse) String() string { return proto.CompactTextString(m) } -func (*GetDefaultVersionResponse) ProtoMessage() {} -func (*GetDefaultVersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{6} -} -func (m *GetDefaultVersionResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetDefaultVersionResponse.Unmarshal(m, b) -} -func (m *GetDefaultVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetDefaultVersionResponse.Marshal(b, m, deterministic) -} -func (dst *GetDefaultVersionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetDefaultVersionResponse.Merge(dst, src) -} -func (m *GetDefaultVersionResponse) XXX_Size() int { - return xxx_messageInfo_GetDefaultVersionResponse.Size(m) -} -func (m *GetDefaultVersionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetDefaultVersionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetDefaultVersionResponse proto.InternalMessageInfo - -func (m *GetDefaultVersionResponse) GetVersion() string { - if m != nil && m.Version != nil { - return *m.Version - } - return "" -} - -type GetNumInstancesRequest struct { - Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` - Version *string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetNumInstancesRequest) Reset() { *m = GetNumInstancesRequest{} } -func (m *GetNumInstancesRequest) String() string { return proto.CompactTextString(m) } -func (*GetNumInstancesRequest) ProtoMessage() {} -func (*GetNumInstancesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{7} -} -func (m *GetNumInstancesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetNumInstancesRequest.Unmarshal(m, b) -} -func (m *GetNumInstancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetNumInstancesRequest.Marshal(b, m, deterministic) -} -func (dst *GetNumInstancesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNumInstancesRequest.Merge(dst, src) -} -func (m *GetNumInstancesRequest) XXX_Size() int { - return xxx_messageInfo_GetNumInstancesRequest.Size(m) -} -func (m *GetNumInstancesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetNumInstancesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetNumInstancesRequest proto.InternalMessageInfo - -func (m *GetNumInstancesRequest) GetModule() string { - if m != nil && m.Module != nil { - return *m.Module - } - return "" -} - -func (m *GetNumInstancesRequest) GetVersion() string { - if m != nil && m.Version != nil { - return *m.Version - } - return "" -} - -type GetNumInstancesResponse struct { - Instances *int64 `protobuf:"varint,1,req,name=instances" json:"instances,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetNumInstancesResponse) Reset() { *m = GetNumInstancesResponse{} } -func (m *GetNumInstancesResponse) String() string { return proto.CompactTextString(m) } -func (*GetNumInstancesResponse) ProtoMessage() {} -func (*GetNumInstancesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{8} -} -func (m *GetNumInstancesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetNumInstancesResponse.Unmarshal(m, b) -} -func (m *GetNumInstancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetNumInstancesResponse.Marshal(b, m, deterministic) -} -func (dst *GetNumInstancesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNumInstancesResponse.Merge(dst, src) -} -func (m *GetNumInstancesResponse) XXX_Size() int { - return xxx_messageInfo_GetNumInstancesResponse.Size(m) -} -func (m *GetNumInstancesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetNumInstancesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetNumInstancesResponse proto.InternalMessageInfo - -func (m *GetNumInstancesResponse) GetInstances() int64 { - if m != nil && m.Instances != nil { - return *m.Instances - } - return 0 -} - -type SetNumInstancesRequest struct { - Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` - Version *string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` - Instances *int64 `protobuf:"varint,3,req,name=instances" json:"instances,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SetNumInstancesRequest) Reset() { *m = SetNumInstancesRequest{} } -func (m *SetNumInstancesRequest) String() string { return proto.CompactTextString(m) } -func (*SetNumInstancesRequest) ProtoMessage() {} -func (*SetNumInstancesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{9} -} -func (m *SetNumInstancesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetNumInstancesRequest.Unmarshal(m, b) -} -func (m *SetNumInstancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetNumInstancesRequest.Marshal(b, m, deterministic) -} -func (dst *SetNumInstancesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetNumInstancesRequest.Merge(dst, src) -} -func (m *SetNumInstancesRequest) XXX_Size() int { - return xxx_messageInfo_SetNumInstancesRequest.Size(m) -} -func (m *SetNumInstancesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SetNumInstancesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SetNumInstancesRequest proto.InternalMessageInfo - -func (m *SetNumInstancesRequest) GetModule() string { - if m != nil && m.Module != nil { - return *m.Module - } - return "" -} - -func (m *SetNumInstancesRequest) GetVersion() string { - if m != nil && m.Version != nil { - return *m.Version - } - return "" -} - -func (m *SetNumInstancesRequest) GetInstances() int64 { - if m != nil && m.Instances != nil { - return *m.Instances - } - return 0 -} - -type SetNumInstancesResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SetNumInstancesResponse) Reset() { *m = SetNumInstancesResponse{} } -func (m *SetNumInstancesResponse) String() string { return proto.CompactTextString(m) } -func (*SetNumInstancesResponse) ProtoMessage() {} -func (*SetNumInstancesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{10} -} -func (m *SetNumInstancesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetNumInstancesResponse.Unmarshal(m, b) -} -func (m *SetNumInstancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetNumInstancesResponse.Marshal(b, m, deterministic) -} -func (dst *SetNumInstancesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetNumInstancesResponse.Merge(dst, src) -} -func (m *SetNumInstancesResponse) XXX_Size() int { - return xxx_messageInfo_SetNumInstancesResponse.Size(m) -} -func (m *SetNumInstancesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SetNumInstancesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SetNumInstancesResponse proto.InternalMessageInfo - -type StartModuleRequest struct { - Module *string `protobuf:"bytes,1,req,name=module" json:"module,omitempty"` - Version *string `protobuf:"bytes,2,req,name=version" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StartModuleRequest) Reset() { *m = StartModuleRequest{} } -func (m *StartModuleRequest) String() string { return proto.CompactTextString(m) } -func (*StartModuleRequest) ProtoMessage() {} -func (*StartModuleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{11} -} -func (m *StartModuleRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StartModuleRequest.Unmarshal(m, b) -} -func (m *StartModuleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StartModuleRequest.Marshal(b, m, deterministic) -} -func (dst *StartModuleRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StartModuleRequest.Merge(dst, src) -} -func (m *StartModuleRequest) XXX_Size() int { - return xxx_messageInfo_StartModuleRequest.Size(m) -} -func (m *StartModuleRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StartModuleRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_StartModuleRequest proto.InternalMessageInfo - -func (m *StartModuleRequest) GetModule() string { - if m != nil && m.Module != nil { - return *m.Module - } - return "" -} - -func (m *StartModuleRequest) GetVersion() string { - if m != nil && m.Version != nil { - return *m.Version - } - return "" -} - -type StartModuleResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StartModuleResponse) Reset() { *m = StartModuleResponse{} } -func (m *StartModuleResponse) String() string { return proto.CompactTextString(m) } -func (*StartModuleResponse) ProtoMessage() {} -func (*StartModuleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{12} -} -func (m *StartModuleResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StartModuleResponse.Unmarshal(m, b) -} -func (m *StartModuleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StartModuleResponse.Marshal(b, m, deterministic) -} -func (dst *StartModuleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StartModuleResponse.Merge(dst, src) -} -func (m *StartModuleResponse) XXX_Size() int { - return xxx_messageInfo_StartModuleResponse.Size(m) -} -func (m *StartModuleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StartModuleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_StartModuleResponse proto.InternalMessageInfo - -type StopModuleRequest struct { - Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` - Version *string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StopModuleRequest) Reset() { *m = StopModuleRequest{} } -func (m *StopModuleRequest) String() string { return proto.CompactTextString(m) } -func (*StopModuleRequest) ProtoMessage() {} -func (*StopModuleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{13} -} -func (m *StopModuleRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StopModuleRequest.Unmarshal(m, b) -} -func (m *StopModuleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StopModuleRequest.Marshal(b, m, deterministic) -} -func (dst *StopModuleRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StopModuleRequest.Merge(dst, src) -} -func (m *StopModuleRequest) XXX_Size() int { - return xxx_messageInfo_StopModuleRequest.Size(m) -} -func (m *StopModuleRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StopModuleRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_StopModuleRequest proto.InternalMessageInfo - -func (m *StopModuleRequest) GetModule() string { - if m != nil && m.Module != nil { - return *m.Module - } - return "" -} - -func (m *StopModuleRequest) GetVersion() string { - if m != nil && m.Version != nil { - return *m.Version - } - return "" -} - -type StopModuleResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StopModuleResponse) Reset() { *m = StopModuleResponse{} } -func (m *StopModuleResponse) String() string { return proto.CompactTextString(m) } -func (*StopModuleResponse) ProtoMessage() {} -func (*StopModuleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{14} -} -func (m *StopModuleResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StopModuleResponse.Unmarshal(m, b) -} -func (m *StopModuleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StopModuleResponse.Marshal(b, m, deterministic) -} -func (dst *StopModuleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StopModuleResponse.Merge(dst, src) -} -func (m *StopModuleResponse) XXX_Size() int { - return xxx_messageInfo_StopModuleResponse.Size(m) -} -func (m *StopModuleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StopModuleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_StopModuleResponse proto.InternalMessageInfo - -type GetHostnameRequest struct { - Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` - Version *string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` - Instance *string `protobuf:"bytes,3,opt,name=instance" json:"instance,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetHostnameRequest) Reset() { *m = GetHostnameRequest{} } -func (m *GetHostnameRequest) String() string { return proto.CompactTextString(m) } -func (*GetHostnameRequest) ProtoMessage() {} -func (*GetHostnameRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{15} -} -func (m *GetHostnameRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetHostnameRequest.Unmarshal(m, b) -} -func (m *GetHostnameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetHostnameRequest.Marshal(b, m, deterministic) -} -func (dst *GetHostnameRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetHostnameRequest.Merge(dst, src) -} -func (m *GetHostnameRequest) XXX_Size() int { - return xxx_messageInfo_GetHostnameRequest.Size(m) -} -func (m *GetHostnameRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetHostnameRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetHostnameRequest proto.InternalMessageInfo - -func (m *GetHostnameRequest) GetModule() string { - if m != nil && m.Module != nil { - return *m.Module - } - return "" -} - -func (m *GetHostnameRequest) GetVersion() string { - if m != nil && m.Version != nil { - return *m.Version - } - return "" -} - -func (m *GetHostnameRequest) GetInstance() string { - if m != nil && m.Instance != nil { - return *m.Instance - } - return "" -} - -type GetHostnameResponse struct { - Hostname *string `protobuf:"bytes,1,req,name=hostname" json:"hostname,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetHostnameResponse) Reset() { *m = GetHostnameResponse{} } -func (m *GetHostnameResponse) String() string { return proto.CompactTextString(m) } -func (*GetHostnameResponse) ProtoMessage() {} -func (*GetHostnameResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{16} -} -func (m *GetHostnameResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetHostnameResponse.Unmarshal(m, b) -} -func (m *GetHostnameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetHostnameResponse.Marshal(b, m, deterministic) -} -func (dst *GetHostnameResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetHostnameResponse.Merge(dst, src) -} -func (m *GetHostnameResponse) XXX_Size() int { - return xxx_messageInfo_GetHostnameResponse.Size(m) -} -func (m *GetHostnameResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetHostnameResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetHostnameResponse proto.InternalMessageInfo - -func (m *GetHostnameResponse) GetHostname() string { - if m != nil && m.Hostname != nil { - return *m.Hostname - } - return "" -} - -func init() { - proto.RegisterType((*ModulesServiceError)(nil), "appengine.ModulesServiceError") - proto.RegisterType((*GetModulesRequest)(nil), "appengine.GetModulesRequest") - proto.RegisterType((*GetModulesResponse)(nil), "appengine.GetModulesResponse") - proto.RegisterType((*GetVersionsRequest)(nil), "appengine.GetVersionsRequest") - proto.RegisterType((*GetVersionsResponse)(nil), "appengine.GetVersionsResponse") - proto.RegisterType((*GetDefaultVersionRequest)(nil), "appengine.GetDefaultVersionRequest") - proto.RegisterType((*GetDefaultVersionResponse)(nil), "appengine.GetDefaultVersionResponse") - proto.RegisterType((*GetNumInstancesRequest)(nil), "appengine.GetNumInstancesRequest") - proto.RegisterType((*GetNumInstancesResponse)(nil), "appengine.GetNumInstancesResponse") - proto.RegisterType((*SetNumInstancesRequest)(nil), "appengine.SetNumInstancesRequest") - proto.RegisterType((*SetNumInstancesResponse)(nil), "appengine.SetNumInstancesResponse") - proto.RegisterType((*StartModuleRequest)(nil), "appengine.StartModuleRequest") - proto.RegisterType((*StartModuleResponse)(nil), "appengine.StartModuleResponse") - proto.RegisterType((*StopModuleRequest)(nil), "appengine.StopModuleRequest") - proto.RegisterType((*StopModuleResponse)(nil), "appengine.StopModuleResponse") - proto.RegisterType((*GetHostnameRequest)(nil), "appengine.GetHostnameRequest") - proto.RegisterType((*GetHostnameResponse)(nil), "appengine.GetHostnameResponse") -} - -func init() { - proto.RegisterFile("google.golang.org/appengine/internal/modules/modules_service.proto", fileDescriptor_modules_service_9cd3bffe4e91c59a) -} - -var fileDescriptor_modules_service_9cd3bffe4e91c59a = []byte{ - // 457 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xc1, 0x6f, 0xd3, 0x30, - 0x14, 0xc6, 0x69, 0x02, 0xdb, 0xf2, 0x0e, 0x90, 0x3a, 0x5b, 0xd7, 0x4d, 0x1c, 0x50, 0x4e, 0x1c, - 0x50, 0x2b, 0x90, 0x10, 0xe7, 0xae, 0x35, 0x25, 0xb0, 0xa5, 0x28, 0xce, 0x2a, 0xc4, 0xa5, 0x0a, - 0xdb, 0x23, 0x8b, 0x94, 0xda, 0xc1, 0x76, 0x77, 0xe4, 0xbf, 0xe0, 0xff, 0x45, 0x4b, 0xed, 0xb6, - 0x81, 0x4e, 0x45, 0x68, 0xa7, 0xe4, 0x7d, 0xfe, 0xfc, 0x7b, 0x9f, 0x5f, 0xac, 0xc0, 0x59, 0x2e, - 0x44, 0x5e, 0x62, 0x2f, 0x17, 0x65, 0xc6, 0xf3, 0x9e, 0x90, 0x79, 0x3f, 0xab, 0x2a, 0xe4, 0x79, - 0xc1, 0xb1, 0x5f, 0x70, 0x8d, 0x92, 0x67, 0x65, 0x7f, 0x2e, 0xae, 0x17, 0x25, 0x2a, 0xfb, 0x9c, - 0x29, 0x94, 0xb7, 0xc5, 0x15, 0xf6, 0x2a, 0x29, 0xb4, 0x20, 0xde, 0x6a, 0x47, 0xf8, 0xab, 0x05, - 0xc1, 0xc5, 0xd2, 0xc4, 0x96, 0x1e, 0x2a, 0xa5, 0x90, 0xe1, 0x4f, 0xf0, 0xea, 0x97, 0xa1, 0xb8, - 0x46, 0xb2, 0x07, 0xce, 0xe4, 0x93, 0xff, 0x88, 0x10, 0x78, 0x1a, 0xc5, 0xd3, 0xc1, 0x79, 0x34, - 0x9a, 0x5d, 0x4c, 0x46, 0x97, 0xe7, 0xd4, 0x6f, 0x91, 0x00, 0x9e, 0x59, 0x6d, 0x4a, 0x13, 0x16, - 0x4d, 0x62, 0xdf, 0x21, 0x47, 0xd0, 0xb6, 0x62, 0x14, 0xb3, 0x74, 0x10, 0x0f, 0x29, 0xf3, 0xdd, - 0x3b, 0x6f, 0x9a, 0x0c, 0x62, 0x16, 0xd1, 0x38, 0x9d, 0xd1, 0x24, 0x99, 0x24, 0xfe, 0x63, 0x72, - 0x08, 0xfe, 0x65, 0x4c, 0xbf, 0x7c, 0xa6, 0xc3, 0x94, 0x8e, 0x66, 0x2c, 0x1d, 0xa4, 0xd4, 0x7f, - 0x12, 0x06, 0xd0, 0x1e, 0xa3, 0x36, 0xc9, 0x12, 0xfc, 0xb1, 0x40, 0xa5, 0xc3, 0x57, 0x40, 0x36, - 0x45, 0x55, 0x09, 0xae, 0x90, 0x74, 0x60, 0x6f, 0x79, 0xcc, 0x6e, 0xeb, 0x85, 0xfb, 0xd2, 0x4b, - 0x4c, 0x65, 0xdc, 0x53, 0x94, 0xaa, 0x10, 0xdc, 0x32, 0x1a, 0xee, 0xd6, 0x86, 0xbb, 0x0f, 0x41, - 0xc3, 0x6d, 0xe0, 0x5d, 0xd8, 0xbf, 0x5d, 0x6a, 0x86, 0x6e, 0xcb, 0xf0, 0x0d, 0x74, 0xc7, 0xa8, - 0x47, 0xf8, 0x3d, 0x5b, 0x94, 0x76, 0xdf, 0xae, 0x26, 0x6f, 0xe1, 0x64, 0xcb, 0x9e, 0x6d, 0xad, - 0x9c, 0xcd, 0x56, 0x1f, 0xa1, 0x33, 0x46, 0x1d, 0x2f, 0xe6, 0x11, 0x57, 0x3a, 0xe3, 0x57, 0xb8, - 0xeb, 0x34, 0x9b, 0x2c, 0xa7, 0x5e, 0x58, 0xb1, 0xde, 0xc1, 0xf1, 0x5f, 0x2c, 0x13, 0xe0, 0x39, - 0x78, 0x85, 0x15, 0xeb, 0x08, 0x6e, 0xb2, 0x16, 0xc2, 0x1b, 0xe8, 0xb0, 0x07, 0x0a, 0xd1, 0xec, - 0xe4, 0xfe, 0xd9, 0xe9, 0x04, 0x8e, 0xd9, 0xf6, 0x88, 0xe1, 0x7b, 0x20, 0x4c, 0x67, 0xd2, 0xdc, - 0x81, 0x6d, 0x01, 0x9c, 0xfb, 0x02, 0x34, 0x26, 0x7a, 0x04, 0x41, 0x83, 0x63, 0xf0, 0x14, 0xda, - 0x4c, 0x8b, 0xea, 0x7e, 0xfa, 0xbf, 0xcd, 0xf8, 0xf0, 0x2e, 0xe5, 0x1a, 0x63, 0xe0, 0xdf, 0xea, - 0xfb, 0xf8, 0x41, 0x28, 0xcd, 0xb3, 0xf9, 0xff, 0xd3, 0xc9, 0x29, 0x1c, 0xd8, 0x59, 0x75, 0xdd, - 0x7a, 0x69, 0x55, 0x87, 0xaf, 0xeb, 0x5b, 0xbc, 0xee, 0x61, 0xbe, 0xec, 0x29, 0x1c, 0xdc, 0x18, - 0xcd, 0x8c, 0x68, 0x55, 0x9f, 0x79, 0x5f, 0xf7, 0xcd, 0x5f, 0xe2, 0x77, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x6e, 0xbc, 0xe0, 0x61, 0x5c, 0x04, 0x00, 0x00, -} 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 d29f0065a2..0000000000 --- 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/namespace.go b/vendor/google.golang.org/appengine/namespace.go deleted file mode 100644 index 21860ca082..0000000000 --- a/vendor/google.golang.org/appengine/namespace.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2012 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package appengine - -import ( - "fmt" - "regexp" - - "golang.org/x/net/context" - - "google.golang.org/appengine/internal" -) - -// Namespace returns a replacement context that operates within the given namespace. -func Namespace(c context.Context, namespace string) (context.Context, error) { - if !validNamespace.MatchString(namespace) { - return nil, fmt.Errorf("appengine: namespace %q does not match /%s/", namespace, validNamespace) - } - return internal.NamespacedContext(c, namespace), nil -} - -// validNamespace matches valid namespace names. -var validNamespace = regexp.MustCompile(`^[0-9A-Za-z._-]{0,100}$`) diff --git a/vendor/google.golang.org/appengine/timeout.go b/vendor/google.golang.org/appengine/timeout.go deleted file mode 100644 index 05642a992a..0000000000 --- a/vendor/google.golang.org/appengine/timeout.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2013 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package appengine - -import "golang.org/x/net/context" - -// IsTimeoutError reports whether err is a timeout error. -func IsTimeoutError(err error) bool { - if err == context.DeadlineExceeded { - return true - } - if t, ok := err.(interface { - IsTimeout() bool - }); ok { - return t.IsTimeout() - } - return false -} diff --git a/vendor/google.golang.org/appengine/travis_install.sh b/vendor/google.golang.org/appengine/travis_install.sh deleted file mode 100644 index 785b62f46e..0000000000 --- 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 100644 index d4390f045b..0000000000 --- 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/google.golang.org/protobuf/encoding/protodelim/protodelim.go b/vendor/google.golang.org/protobuf/encoding/protodelim/protodelim.go new file mode 100644 index 0000000000..2ef36bbcf9 --- /dev/null +++ b/vendor/google.golang.org/protobuf/encoding/protodelim/protodelim.go @@ -0,0 +1,160 @@ +// Copyright 2022 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 protodelim marshals and unmarshals varint size-delimited messages. +package protodelim + +import ( + "bufio" + "encoding/binary" + "fmt" + "io" + + "google.golang.org/protobuf/encoding/protowire" + "google.golang.org/protobuf/internal/errors" + "google.golang.org/protobuf/proto" +) + +// MarshalOptions is a configurable varint size-delimited marshaler. +type MarshalOptions struct{ proto.MarshalOptions } + +// MarshalTo writes a varint size-delimited wire-format message to w. +// If w returns an error, MarshalTo returns it unchanged. +func (o MarshalOptions) MarshalTo(w io.Writer, m proto.Message) (int, error) { + msgBytes, err := o.MarshalOptions.Marshal(m) + if err != nil { + return 0, err + } + + sizeBytes := protowire.AppendVarint(nil, uint64(len(msgBytes))) + sizeWritten, err := w.Write(sizeBytes) + if err != nil { + return sizeWritten, err + } + msgWritten, err := w.Write(msgBytes) + if err != nil { + return sizeWritten + msgWritten, err + } + return sizeWritten + msgWritten, nil +} + +// MarshalTo writes a varint size-delimited wire-format message to w +// with the default options. +// +// See the documentation for [MarshalOptions.MarshalTo]. +func MarshalTo(w io.Writer, m proto.Message) (int, error) { + return MarshalOptions{}.MarshalTo(w, m) +} + +// UnmarshalOptions is a configurable varint size-delimited unmarshaler. +type UnmarshalOptions struct { + proto.UnmarshalOptions + + // MaxSize is the maximum size in wire-format bytes of a single message. + // Unmarshaling a message larger than MaxSize will return an error. + // A zero MaxSize will default to 4 MiB. + // Setting MaxSize to -1 disables the limit. + MaxSize int64 +} + +const defaultMaxSize = 4 << 20 // 4 MiB, corresponds to the default gRPC max request/response size + +// SizeTooLargeError is an error that is returned when the unmarshaler encounters a message size +// that is larger than its configured [UnmarshalOptions.MaxSize]. +type SizeTooLargeError struct { + // Size is the varint size of the message encountered + // that was larger than the provided MaxSize. + Size uint64 + + // MaxSize is the MaxSize limit configured in UnmarshalOptions, which Size exceeded. + MaxSize uint64 +} + +func (e *SizeTooLargeError) Error() string { + return fmt.Sprintf("message size %d exceeded unmarshaler's maximum configured size %d", e.Size, e.MaxSize) +} + +// Reader is the interface expected by [UnmarshalFrom]. +// It is implemented by *[bufio.Reader]. +type Reader interface { + io.Reader + io.ByteReader +} + +// UnmarshalFrom parses and consumes a varint size-delimited wire-format message +// from r. +// The provided message must be mutable (e.g., a non-nil pointer to a message). +// +// The error is [io.EOF] error only if no bytes are read. +// If an EOF happens after reading some but not all the bytes, +// UnmarshalFrom returns a non-io.EOF error. +// In particular if r returns a non-io.EOF error, UnmarshalFrom returns it unchanged, +// and if only a size is read with no subsequent message, [io.ErrUnexpectedEOF] is returned. +func (o UnmarshalOptions) UnmarshalFrom(r Reader, m proto.Message) error { + var sizeArr [binary.MaxVarintLen64]byte + sizeBuf := sizeArr[:0] + for i := range sizeArr { + b, err := r.ReadByte() + if err != nil { + // Immediate EOF is unexpected. + if err == io.EOF && i != 0 { + break + } + return err + } + sizeBuf = append(sizeBuf, b) + if b < 0x80 { + break + } + } + size, n := protowire.ConsumeVarint(sizeBuf) + if n < 0 { + return protowire.ParseError(n) + } + + maxSize := o.MaxSize + if maxSize == 0 { + maxSize = defaultMaxSize + } + if maxSize != -1 && size > uint64(maxSize) { + return errors.Wrap(&SizeTooLargeError{Size: size, MaxSize: uint64(maxSize)}, "") + } + + var b []byte + var err error + if br, ok := r.(*bufio.Reader); ok { + // Use the []byte from the bufio.Reader instead of having to allocate one. + // This reduces CPU usage and allocated bytes. + b, err = br.Peek(int(size)) + if err == nil { + defer br.Discard(int(size)) + } else { + b = nil + } + } + if b == nil { + b = make([]byte, size) + _, err = io.ReadFull(r, b) + } + + if err == io.EOF { + return io.ErrUnexpectedEOF + } + if err != nil { + return err + } + if err := o.Unmarshal(b, m); err != nil { + return err + } + return nil +} + +// UnmarshalFrom parses and consumes a varint size-delimited wire-format message +// from r with the default options. +// The provided message must be mutable (e.g., a non-nil pointer to a message). +// +// See the documentation for [UnmarshalOptions.UnmarshalFrom]. +func UnmarshalFrom(r Reader, m proto.Message) error { + return UnmarshalOptions{}.UnmarshalFrom(r, m) +} diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/decode.go b/vendor/google.golang.org/protobuf/encoding/protojson/decode.go index f47902371a..bb2966e3b4 100644 --- a/vendor/google.golang.org/protobuf/encoding/protojson/decode.go +++ b/vendor/google.golang.org/protobuf/encoding/protojson/decode.go @@ -102,7 +102,7 @@ type decoder struct { } // newError returns an error object with position info. -func (d decoder) newError(pos int, f string, x ...interface{}) error { +func (d decoder) newError(pos int, f string, x ...any) error { line, column := d.Position(pos) head := fmt.Sprintf("(line %d:%d): ", line, column) return errors.New(head+f, x...) @@ -114,7 +114,7 @@ func (d decoder) unexpectedTokenError(tok json.Token) error { } // syntaxError returns a syntax error for given position. -func (d decoder) syntaxError(pos int, f string, x ...interface{}) error { +func (d decoder) syntaxError(pos int, f string, x ...any) error { line, column := d.Position(pos) head := fmt.Sprintf("syntax error (line %d:%d): ", line, column) return errors.New(head+f, x...) diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/encode.go b/vendor/google.golang.org/protobuf/encoding/protojson/encode.go index 3f75098b6f..29846df222 100644 --- a/vendor/google.golang.org/protobuf/encoding/protojson/encode.go +++ b/vendor/google.golang.org/protobuf/encoding/protojson/encode.go @@ -25,15 +25,17 @@ const defaultIndent = " " // Format formats the message as a multiline string. // This function is only intended for human consumption and ignores errors. -// Do not depend on the output being stable. It may change over time across -// different versions of the program. +// Do not depend on the output being stable. Its output will change across +// different builds of your program, even when using the same version of the +// protobuf module. func Format(m proto.Message) string { return MarshalOptions{Multiline: true}.Format(m) } // Marshal writes the given [proto.Message] in JSON format using default options. -// Do not depend on the output being stable. It may change over time across -// different versions of the program. +// Do not depend on the output being stable. Its output will change across +// different builds of your program, even when using the same version of the +// protobuf module. func Marshal(m proto.Message) ([]byte, error) { return MarshalOptions{}.Marshal(m) } @@ -110,8 +112,9 @@ type MarshalOptions struct { // Format formats the message as a string. // This method is only intended for human consumption and ignores errors. -// Do not depend on the output being stable. It may change over time across -// different versions of the program. +// Do not depend on the output being stable. Its output will change across +// different builds of your program, even when using the same version of the +// protobuf module. func (o MarshalOptions) Format(m proto.Message) string { if m == nil || !m.ProtoReflect().IsValid() { return "" // invalid syntax, but okay since this is for debugging @@ -122,8 +125,9 @@ func (o MarshalOptions) Format(m proto.Message) string { } // Marshal marshals the given [proto.Message] in the JSON format using options in -// MarshalOptions. Do not depend on the output being stable. It may change over -// time across different versions of the program. +// Do not depend on the output being stable. Its output will change across +// different builds of your program, even when using the same version of the +// protobuf module. func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) { return o.marshal(nil, m) } diff --git a/vendor/google.golang.org/protobuf/encoding/prototext/decode.go b/vendor/google.golang.org/protobuf/encoding/prototext/decode.go index a45f112bce..24bc98ac42 100644 --- a/vendor/google.golang.org/protobuf/encoding/prototext/decode.go +++ b/vendor/google.golang.org/protobuf/encoding/prototext/decode.go @@ -84,7 +84,7 @@ type decoder struct { } // newError returns an error object with position info. -func (d decoder) newError(pos int, f string, x ...interface{}) error { +func (d decoder) newError(pos int, f string, x ...any) error { line, column := d.Position(pos) head := fmt.Sprintf("(line %d:%d): ", line, column) return errors.New(head+f, x...) @@ -96,7 +96,7 @@ func (d decoder) unexpectedTokenError(tok text.Token) error { } // syntaxError returns a syntax error for given position. -func (d decoder) syntaxError(pos int, f string, x ...interface{}) error { +func (d decoder) syntaxError(pos int, f string, x ...any) error { line, column := d.Position(pos) head := fmt.Sprintf("syntax error (line %d:%d): ", line, column) return errors.New(head+f, x...) diff --git a/vendor/google.golang.org/protobuf/encoding/prototext/encode.go b/vendor/google.golang.org/protobuf/encoding/prototext/encode.go index 95967e8112..1f57e6610a 100644 --- a/vendor/google.golang.org/protobuf/encoding/prototext/encode.go +++ b/vendor/google.golang.org/protobuf/encoding/prototext/encode.go @@ -27,15 +27,17 @@ const defaultIndent = " " // Format formats the message as a multiline string. // This function is only intended for human consumption and ignores errors. -// Do not depend on the output being stable. It may change over time across -// different versions of the program. +// Do not depend on the output being stable. Its output will change across +// different builds of your program, even when using the same version of the +// protobuf module. func Format(m proto.Message) string { return MarshalOptions{Multiline: true}.Format(m) } // Marshal writes the given [proto.Message] in textproto format using default -// options. Do not depend on the output being stable. It may change over time -// across different versions of the program. +// options. Do not depend on the output being stable. Its output will change +// across different builds of your program, even when using the same version of +// the protobuf module. func Marshal(m proto.Message) ([]byte, error) { return MarshalOptions{}.Marshal(m) } @@ -84,8 +86,9 @@ type MarshalOptions struct { // Format formats the message as a string. // This method is only intended for human consumption and ignores errors. -// Do not depend on the output being stable. It may change over time across -// different versions of the program. +// Do not depend on the output being stable. Its output will change across +// different builds of your program, even when using the same version of the +// protobuf module. func (o MarshalOptions) Format(m proto.Message) string { if m == nil || !m.ProtoReflect().IsValid() { return "" // invalid syntax, but okay since this is for debugging @@ -98,8 +101,9 @@ func (o MarshalOptions) Format(m proto.Message) string { } // Marshal writes the given [proto.Message] in textproto format using options in -// MarshalOptions object. Do not depend on the output being stable. It may -// change over time across different versions of the program. +// MarshalOptions object. Do not depend on the output being stable. Its output +// will change across different builds of your program, even when using the +// same version of the protobuf module. func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) { return o.marshal(nil, m) } diff --git a/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go b/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go index a45625c8d1..87e46bd4df 100644 --- a/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go +++ b/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go @@ -252,6 +252,7 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool, record fu {rv.MethodByName("Values"), "Values"}, {rv.MethodByName("ReservedNames"), "ReservedNames"}, {rv.MethodByName("ReservedRanges"), "ReservedRanges"}, + {rv.MethodByName("IsClosed"), "IsClosed"}, }...) case protoreflect.EnumValueDescriptor: diff --git a/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb b/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb index 18f0756874..ff6a38360a 100644 Binary files a/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb and b/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb differ diff --git a/vendor/google.golang.org/protobuf/internal/editionssupport/editions.go b/vendor/google.golang.org/protobuf/internal/editionssupport/editions.go new file mode 100644 index 0000000000..029a6a12d7 --- /dev/null +++ b/vendor/google.golang.org/protobuf/internal/editionssupport/editions.go @@ -0,0 +1,13 @@ +// Copyright 2024 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 editionssupport defines constants for editions that are supported. +package editionssupport + +import descriptorpb "google.golang.org/protobuf/types/descriptorpb" + +const ( + Minimum = descriptorpb.Edition_EDITION_PROTO2 + Maximum = descriptorpb.Edition_EDITION_2023 +) diff --git a/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go b/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go index d2b3ac031e..ea1d3e65a5 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go @@ -214,7 +214,7 @@ func (d *Decoder) parseNext() (Token, error) { // newSyntaxError returns an error with line and column information useful for // syntax errors. -func (d *Decoder) newSyntaxError(pos int, f string, x ...interface{}) error { +func (d *Decoder) newSyntaxError(pos int, f string, x ...any) error { e := errors.New(f, x...) line, column := d.Position(pos) return errors.New("syntax error (line %d:%d): %v", line, column, e) diff --git a/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go b/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go index 373d208374..7e87c76044 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go @@ -32,6 +32,7 @@ var byteType = reflect.TypeOf(byte(0)) func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescriptors) protoreflect.FieldDescriptor { f := new(filedesc.Field) f.L0.ParentFile = filedesc.SurrogateProto2 + f.L1.EditionFeatures = f.L0.ParentFile.L1.EditionFeatures for len(tag) > 0 { i := strings.IndexByte(tag, ',') if i < 0 { @@ -107,8 +108,7 @@ func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescri f.L1.StringName.InitJSON(jsonName) } case s == "packed": - f.L1.HasPacked = true - f.L1.IsPacked = true + f.L1.EditionFeatures.IsPacked = true case strings.HasPrefix(s, "weak="): f.L1.IsWeak = true f.L1.Message = filedesc.PlaceholderMessage(protoreflect.FullName(s[len("weak="):])) diff --git a/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go b/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go index 87853e786d..099b2bf451 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go @@ -601,7 +601,7 @@ func (d *Decoder) consumeToken(kind Kind, size int, attrs uint8) Token { // newSyntaxError returns a syntax error with line and column information for // current position. -func (d *Decoder) newSyntaxError(f string, x ...interface{}) error { +func (d *Decoder) newSyntaxError(f string, x ...any) error { e := errors.New(f, x...) line, column := d.Position(len(d.orig) - len(d.in)) return errors.New("syntax error (line %d:%d): %v", line, column, e) diff --git a/vendor/google.golang.org/protobuf/internal/errors/errors.go b/vendor/google.golang.org/protobuf/internal/errors/errors.go index 20c17b35e3..c2d6bd5265 100644 --- a/vendor/google.golang.org/protobuf/internal/errors/errors.go +++ b/vendor/google.golang.org/protobuf/internal/errors/errors.go @@ -17,7 +17,7 @@ var Error = errors.New("protobuf error") // New formats a string according to the format specifier and arguments and // returns an error that has a "proto" prefix. -func New(f string, x ...interface{}) error { +func New(f string, x ...any) error { return &prefixError{s: format(f, x...)} } @@ -43,7 +43,7 @@ func (e *prefixError) Unwrap() error { // Wrap returns an error that has a "proto" prefix, the formatted string described // by the format specifier and arguments, and a suffix of err. The error wraps err. -func Wrap(err error, f string, x ...interface{}) error { +func Wrap(err error, f string, x ...any) error { return &wrapError{ s: format(f, x...), err: err, @@ -67,7 +67,7 @@ func (e *wrapError) Is(target error) bool { return target == Error } -func format(f string, x ...interface{}) string { +func format(f string, x ...any) string { // avoid "proto: " prefix when chaining for i := 0; i < len(x); i++ { switch e := x[i].(type) { @@ -87,3 +87,18 @@ func InvalidUTF8(name string) error { func RequiredNotSet(name string) error { return New("required field %v not set", name) } + +type SizeMismatchError struct { + Calculated, Measured int +} + +func (e *SizeMismatchError) Error() string { + return fmt.Sprintf("size mismatch (see https://github.com/golang/protobuf/issues/1609): calculated=%d, measured=%d", e.Calculated, e.Measured) +} + +func MismatchedSizeCalculation(calculated, measured int) error { + return &SizeMismatchError{ + Calculated: calculated, + Measured: measured, + } +} diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc.go index 8826bcf402..df53ff40b2 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/desc.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc.go @@ -7,6 +7,7 @@ package filedesc import ( "bytes" "fmt" + "strings" "sync" "sync/atomic" @@ -108,9 +109,12 @@ func (fd *File) ParentFile() protoreflect.FileDescriptor { return fd } func (fd *File) Parent() protoreflect.Descriptor { return nil } func (fd *File) Index() int { return 0 } func (fd *File) Syntax() protoreflect.Syntax { return fd.L1.Syntax } -func (fd *File) Name() protoreflect.Name { return fd.L1.Package.Name() } -func (fd *File) FullName() protoreflect.FullName { return fd.L1.Package } -func (fd *File) IsPlaceholder() bool { return false } + +// Not exported and just used to reconstruct the original FileDescriptor proto +func (fd *File) Edition() int32 { return int32(fd.L1.Edition) } +func (fd *File) Name() protoreflect.Name { return fd.L1.Package.Name() } +func (fd *File) FullName() protoreflect.FullName { return fd.L1.Package } +func (fd *File) IsPlaceholder() bool { return false } func (fd *File) Options() protoreflect.ProtoMessage { if f := fd.lazyInit().Options; f != nil { return f() @@ -202,6 +206,9 @@ func (ed *Enum) lazyInit() *EnumL2 { ed.L0.ParentFile.lazyInit() // implicitly initializes L2 return ed.L2 } +func (ed *Enum) IsClosed() bool { + return !ed.L1.EditionFeatures.IsOpenEnum +} func (ed *EnumValue) Options() protoreflect.ProtoMessage { if f := ed.L1.Options; f != nil { @@ -251,10 +258,6 @@ type ( StringName stringName IsProto3Optional bool // promoted from google.protobuf.FieldDescriptorProto IsWeak bool // promoted from google.protobuf.FieldOptions - HasPacked bool // promoted from google.protobuf.FieldOptions - IsPacked bool // promoted from google.protobuf.FieldOptions - HasEnforceUTF8 bool // promoted from google.protobuf.FieldOptions - EnforceUTF8 bool // promoted from google.protobuf.FieldOptions Default defaultValue ContainingOneof protoreflect.OneofDescriptor // must be consistent with Message.Oneofs.Fields Enum protoreflect.EnumDescriptor @@ -331,8 +334,7 @@ func (fd *Field) HasPresence() bool { if fd.L1.Cardinality == protoreflect.Repeated { return false } - explicitFieldPresence := fd.Syntax() == protoreflect.Editions && fd.L1.EditionFeatures.IsFieldPresence - return fd.Syntax() == protoreflect.Proto2 || explicitFieldPresence || fd.L1.Message != nil || fd.L1.ContainingOneof != nil + return fd.IsExtension() || fd.L1.EditionFeatures.IsFieldPresence || fd.L1.Message != nil || fd.L1.ContainingOneof != nil } func (fd *Field) HasOptionalKeyword() bool { return (fd.L0.ParentFile.L1.Syntax == protoreflect.Proto2 && fd.L1.Cardinality == protoreflect.Optional && fd.L1.ContainingOneof == nil) || fd.L1.IsProto3Optional @@ -345,14 +347,7 @@ func (fd *Field) IsPacked() bool { case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind, protoreflect.GroupKind: return false } - if fd.L0.ParentFile.L1.Syntax == protoreflect.Editions { - return fd.L1.EditionFeatures.IsPacked - } - if fd.L0.ParentFile.L1.Syntax == protoreflect.Proto3 { - // proto3 repeated fields are packed by default. - return !fd.L1.HasPacked || fd.L1.IsPacked - } - return fd.L1.IsPacked + return fd.L1.EditionFeatures.IsPacked } func (fd *Field) IsExtension() bool { return false } func (fd *Field) IsWeak() bool { return fd.L1.IsWeak } @@ -388,6 +383,10 @@ func (fd *Field) Message() protoreflect.MessageDescriptor { } return fd.L1.Message } +func (fd *Field) IsMapEntry() bool { + parent, ok := fd.L0.Parent.(protoreflect.MessageDescriptor) + return ok && parent.IsMapEntry() +} func (fd *Field) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, fd) } func (fd *Field) ProtoType(protoreflect.FieldDescriptor) {} @@ -399,13 +398,7 @@ func (fd *Field) ProtoType(protoreflect.FieldDescriptor) {} // WARNING: This method is exempt from the compatibility promise and may be // removed in the future without warning. func (fd *Field) EnforceUTF8() bool { - if fd.L0.ParentFile.L1.Syntax == protoreflect.Editions { - return fd.L1.EditionFeatures.IsUTF8Validated - } - if fd.L1.HasEnforceUTF8 { - return fd.L1.EnforceUTF8 - } - return fd.L0.ParentFile.L1.Syntax == protoreflect.Proto3 + return fd.L1.EditionFeatures.IsUTF8Validated } func (od *Oneof) IsSynthetic() bool { @@ -438,7 +431,6 @@ type ( Options func() protoreflect.ProtoMessage StringName stringName IsProto3Optional bool // promoted from google.protobuf.FieldDescriptorProto - IsPacked bool // promoted from google.protobuf.FieldOptions Default defaultValue Enum protoreflect.EnumDescriptor Message protoreflect.MessageDescriptor @@ -461,7 +453,16 @@ func (xd *Extension) HasPresence() bool { return xd.L1.Cardi func (xd *Extension) HasOptionalKeyword() bool { return (xd.L0.ParentFile.L1.Syntax == protoreflect.Proto2 && xd.L1.Cardinality == protoreflect.Optional) || xd.lazyInit().IsProto3Optional } -func (xd *Extension) IsPacked() bool { return xd.lazyInit().IsPacked } +func (xd *Extension) IsPacked() bool { + if xd.L1.Cardinality != protoreflect.Repeated { + return false + } + switch xd.L1.Kind { + case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind, protoreflect.GroupKind: + return false + } + return xd.L1.EditionFeatures.IsPacked +} func (xd *Extension) IsExtension() bool { return true } func (xd *Extension) IsWeak() bool { return false } func (xd *Extension) IsList() bool { return xd.Cardinality() == protoreflect.Repeated } @@ -542,8 +543,9 @@ func (md *Method) ProtoInternal(pragma.DoNotImplement) {} // Surrogate files are can be used to create standalone descriptors // where the syntax is only information derived from the parent file. var ( - SurrogateProto2 = &File{L1: FileL1{Syntax: protoreflect.Proto2}, L2: &FileL2{}} - SurrogateProto3 = &File{L1: FileL1{Syntax: protoreflect.Proto3}, L2: &FileL2{}} + SurrogateProto2 = &File{L1: FileL1{Syntax: protoreflect.Proto2}, L2: &FileL2{}} + SurrogateProto3 = &File{L1: FileL1{Syntax: protoreflect.Proto3}, L2: &FileL2{}} + SurrogateEdition2023 = &File{L1: FileL1{Syntax: protoreflect.Editions, Edition: Edition2023}, L2: &FileL2{}} ) type ( @@ -585,6 +587,34 @@ func (s *stringName) InitJSON(name string) { s.nameJSON = name } +// Returns true if this field is structured like the synthetic field of a proto2 +// group. This allows us to expand our treatment of delimited fields without +// breaking proto2 files that have been upgraded to editions. +func isGroupLike(fd protoreflect.FieldDescriptor) bool { + // Groups are always group types. + if fd.Kind() != protoreflect.GroupKind { + return false + } + + // Group fields are always the lowercase type name. + if strings.ToLower(string(fd.Message().Name())) != string(fd.Name()) { + return false + } + + // Groups could only be defined in the same file they're used. + if fd.Message().ParentFile() != fd.ParentFile() { + return false + } + + // Group messages are always defined in the same scope as the field. File + // level extensions will compare NULL == NULL here, which is why the file + // comparison above is necessary to ensure both come from the same file. + if fd.IsExtension() { + return fd.Parent() == fd.Message().Parent() + } + return fd.ContainingMessage() == fd.Message().Parent() +} + func (s *stringName) lazyInit(fd protoreflect.FieldDescriptor) *stringName { s.once.Do(func() { if fd.IsExtension() { @@ -605,7 +635,7 @@ func (s *stringName) lazyInit(fd protoreflect.FieldDescriptor) *stringName { // Format the text name. s.nameText = string(fd.Name()) - if fd.Kind() == protoreflect.GroupKind { + if isGroupLike(fd) { s.nameText = string(fd.Message().Name()) } } diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go index 237e64fd23..8a57d60b08 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go @@ -113,8 +113,10 @@ func (fd *File) unmarshalSeed(b []byte) { switch string(v) { case "proto2": fd.L1.Syntax = protoreflect.Proto2 + fd.L1.Edition = EditionProto2 case "proto3": fd.L1.Syntax = protoreflect.Proto3 + fd.L1.Edition = EditionProto3 case "editions": fd.L1.Syntax = protoreflect.Editions default: @@ -177,11 +179,10 @@ func (fd *File) unmarshalSeed(b []byte) { // If syntax is missing, it is assumed to be proto2. if fd.L1.Syntax == 0 { fd.L1.Syntax = protoreflect.Proto2 + fd.L1.Edition = EditionProto2 } - if fd.L1.Syntax == protoreflect.Editions { - fd.L1.EditionFeatures = getFeaturesFor(fd.L1.Edition) - } + fd.L1.EditionFeatures = getFeaturesFor(fd.L1.Edition) // Parse editions features from options if any if options != nil { @@ -267,6 +268,7 @@ func (ed *Enum) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protorefl ed.L0.ParentFile = pf ed.L0.Parent = pd ed.L0.Index = i + ed.L1.EditionFeatures = featuresFromParentDesc(ed.Parent()) var numValues int for b := b; len(b) > 0; { @@ -443,6 +445,7 @@ func (xd *Extension) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd prot xd.L0.ParentFile = pf xd.L0.Parent = pd xd.L0.Index = i + xd.L1.EditionFeatures = featuresFromParentDesc(pd) for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) @@ -467,6 +470,38 @@ func (xd *Extension) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd prot xd.L0.FullName = appendFullName(sb, pd.FullName(), v) case genid.FieldDescriptorProto_Extendee_field_number: xd.L1.Extendee = PlaceholderMessage(makeFullName(sb, v)) + case genid.FieldDescriptorProto_Options_field_number: + xd.unmarshalOptions(v) + } + default: + m := protowire.ConsumeFieldValue(num, typ, b) + b = b[m:] + } + } + + if xd.L1.Kind == protoreflect.MessageKind && xd.L1.EditionFeatures.IsDelimitedEncoded { + xd.L1.Kind = protoreflect.GroupKind + } +} + +func (xd *Extension) unmarshalOptions(b []byte) { + for len(b) > 0 { + num, typ, n := protowire.ConsumeTag(b) + b = b[n:] + switch typ { + case protowire.VarintType: + v, m := protowire.ConsumeVarint(b) + b = b[m:] + switch num { + case genid.FieldOptions_Packed_field_number: + xd.L1.EditionFeatures.IsPacked = protowire.DecodeBool(v) + } + case protowire.BytesType: + v, m := protowire.ConsumeBytes(b) + b = b[m:] + switch num { + case genid.FieldOptions_Features_field_number: + xd.L1.EditionFeatures = unmarshalFeatureSet(v, xd.L1.EditionFeatures) } default: m := protowire.ConsumeFieldValue(num, typ, b) @@ -499,7 +534,7 @@ func (sd *Service) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protor } var nameBuilderPool = sync.Pool{ - New: func() interface{} { return new(strs.Builder) }, + New: func() any { return new(strs.Builder) }, } func getBuilder() *strs.Builder { diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go index 482a61cc10..e56c91a8db 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go @@ -45,6 +45,11 @@ func (file *File) resolveMessages() { case protoreflect.MessageKind, protoreflect.GroupKind: fd.L1.Message = file.resolveMessageDependency(fd.L1.Message, listFieldDeps, depIdx) depIdx++ + if fd.L1.Kind == protoreflect.GroupKind && (fd.IsMap() || fd.IsMapEntry()) { + // A map field might inherit delimited encoding from a file-wide default feature. + // But maps never actually use delimited encoding. (At least for now...) + fd.L1.Kind = protoreflect.MessageKind + } } // Default is resolved here since it depends on Enum being resolved. @@ -466,10 +471,10 @@ func (fd *Field) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd protoref b = b[m:] } } - if fd.Syntax() == protoreflect.Editions && fd.L1.Kind == protoreflect.MessageKind && fd.L1.EditionFeatures.IsDelimitedEncoded { + if fd.L1.Kind == protoreflect.MessageKind && fd.L1.EditionFeatures.IsDelimitedEncoded { fd.L1.Kind = protoreflect.GroupKind } - if fd.Syntax() == protoreflect.Editions && fd.L1.EditionFeatures.IsLegacyRequired { + if fd.L1.EditionFeatures.IsLegacyRequired { fd.L1.Cardinality = protoreflect.Required } if rawTypeName != nil { @@ -496,13 +501,11 @@ func (fd *Field) unmarshalOptions(b []byte) { b = b[m:] switch num { case genid.FieldOptions_Packed_field_number: - fd.L1.HasPacked = true - fd.L1.IsPacked = protowire.DecodeBool(v) + fd.L1.EditionFeatures.IsPacked = protowire.DecodeBool(v) case genid.FieldOptions_Weak_field_number: fd.L1.IsWeak = protowire.DecodeBool(v) case FieldOptions_EnforceUTF8: - fd.L1.HasEnforceUTF8 = true - fd.L1.EnforceUTF8 = protowire.DecodeBool(v) + fd.L1.EditionFeatures.IsUTF8Validated = protowire.DecodeBool(v) } case protowire.BytesType: v, m := protowire.ConsumeBytes(b) @@ -548,7 +551,6 @@ func (od *Oneof) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd protoref func (xd *Extension) unmarshalFull(b []byte, sb *strs.Builder) { var rawTypeName []byte var rawOptions []byte - xd.L1.EditionFeatures = featuresFromParentDesc(xd.L1.Extendee) xd.L2 = new(ExtensionL2) for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) @@ -572,7 +574,6 @@ func (xd *Extension) unmarshalFull(b []byte, sb *strs.Builder) { case genid.FieldDescriptorProto_TypeName_field_number: rawTypeName = v case genid.FieldDescriptorProto_Options_field_number: - xd.unmarshalOptions(v) rawOptions = appendOptions(rawOptions, v) } default: @@ -580,12 +581,6 @@ func (xd *Extension) unmarshalFull(b []byte, sb *strs.Builder) { b = b[m:] } } - if xd.Syntax() == protoreflect.Editions && xd.L1.Kind == protoreflect.MessageKind && xd.L1.EditionFeatures.IsDelimitedEncoded { - xd.L1.Kind = protoreflect.GroupKind - } - if xd.Syntax() == protoreflect.Editions && xd.L1.EditionFeatures.IsLegacyRequired { - xd.L1.Cardinality = protoreflect.Required - } if rawTypeName != nil { name := makeFullName(sb, rawTypeName) switch xd.L1.Kind { @@ -598,32 +593,6 @@ func (xd *Extension) unmarshalFull(b []byte, sb *strs.Builder) { xd.L2.Options = xd.L0.ParentFile.builder.optionsUnmarshaler(&descopts.Field, rawOptions) } -func (xd *Extension) unmarshalOptions(b []byte) { - for len(b) > 0 { - num, typ, n := protowire.ConsumeTag(b) - b = b[n:] - switch typ { - case protowire.VarintType: - v, m := protowire.ConsumeVarint(b) - b = b[m:] - switch num { - case genid.FieldOptions_Packed_field_number: - xd.L2.IsPacked = protowire.DecodeBool(v) - } - case protowire.BytesType: - v, m := protowire.ConsumeBytes(b) - b = b[m:] - switch num { - case genid.FieldOptions_Features_field_number: - xd.L1.EditionFeatures = unmarshalFeatureSet(v, xd.L1.EditionFeatures) - } - default: - m := protowire.ConsumeFieldValue(num, typ, b) - b = b[m:] - } - } -} - func (sd *Service) unmarshalFull(b []byte, sb *strs.Builder) { var rawMethods [][]byte var rawOptions []byte diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go index 30db19fdc7..f4107c05f4 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go @@ -8,6 +8,7 @@ package filedesc import ( "fmt" + "strings" "sync" "google.golang.org/protobuf/internal/descfmt" @@ -198,6 +199,16 @@ func (p *Fields) lazyInit() *Fields { if _, ok := p.byText[d.TextName()]; !ok { p.byText[d.TextName()] = d } + if isGroupLike(d) { + lowerJSONName := strings.ToLower(d.JSONName()) + if _, ok := p.byJSON[lowerJSONName]; !ok { + p.byJSON[lowerJSONName] = d + } + lowerTextName := strings.ToLower(d.TextName()) + if _, ok := p.byText[lowerTextName]; !ok { + p.byText[lowerTextName] = d + } + } if _, ok := p.byNum[d.Number()]; !ok { p.byNum[d.Number()] = d } diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/editions.go b/vendor/google.golang.org/protobuf/internal/filedesc/editions.go index 0375a49d40..11f5f356b6 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/editions.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/editions.go @@ -14,9 +14,13 @@ import ( ) var defaultsCache = make(map[Edition]EditionFeatures) +var defaultsKeys = []Edition{} func init() { unmarshalEditionDefaults(editiondefaults.Defaults) + SurrogateProto2.L1.EditionFeatures = getFeaturesFor(EditionProto2) + SurrogateProto3.L1.EditionFeatures = getFeaturesFor(EditionProto3) + SurrogateEdition2023.L1.EditionFeatures = getFeaturesFor(Edition2023) } func unmarshalGoFeature(b []byte, parent EditionFeatures) EditionFeatures { @@ -104,12 +108,15 @@ func unmarshalEditionDefault(b []byte) { v, m := protowire.ConsumeBytes(b) b = b[m:] switch num { - case genid.FeatureSetDefaults_FeatureSetEditionDefault_Features_field_number: + case genid.FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_number: + fs = unmarshalFeatureSet(v, fs) + case genid.FeatureSetDefaults_FeatureSetEditionDefault_OverridableFeatures_field_number: fs = unmarshalFeatureSet(v, fs) } } } defaultsCache[ed] = fs + defaultsKeys = append(defaultsKeys, ed) } func unmarshalEditionDefaults(b []byte) { @@ -135,8 +142,15 @@ func unmarshalEditionDefaults(b []byte) { } func getFeaturesFor(ed Edition) EditionFeatures { - if def, ok := defaultsCache[ed]; ok { - return def + match := EditionUnknown + for _, key := range defaultsKeys { + if key > ed { + break + } + match = key + } + if match == EditionUnknown { + panic(fmt.Sprintf("unsupported edition: %v", ed)) } - panic(fmt.Sprintf("unsupported edition: %v", ed)) + return defaultsCache[match] } diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go b/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go index 28240ebc5c..bfb3b84170 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go @@ -63,6 +63,7 @@ func (e PlaceholderEnum) Options() protoreflect.ProtoMessage { return des func (e PlaceholderEnum) Values() protoreflect.EnumValueDescriptors { return emptyEnumValues } func (e PlaceholderEnum) ReservedNames() protoreflect.Names { return emptyNames } func (e PlaceholderEnum) ReservedRanges() protoreflect.EnumRanges { return emptyEnumRanges } +func (e PlaceholderEnum) IsClosed() bool { return false } func (e PlaceholderEnum) ProtoType(protoreflect.EnumDescriptor) { return } func (e PlaceholderEnum) ProtoInternal(pragma.DoNotImplement) { return } diff --git a/vendor/google.golang.org/protobuf/internal/filetype/build.go b/vendor/google.golang.org/protobuf/internal/filetype/build.go index f0e38c4ef4..ba83fea44c 100644 --- a/vendor/google.golang.org/protobuf/internal/filetype/build.go +++ b/vendor/google.golang.org/protobuf/internal/filetype/build.go @@ -68,7 +68,7 @@ type Builder struct { // and for input and output messages referenced by service methods. // Dependencies must come after declarations, but the ordering of // dependencies themselves is unspecified. - GoTypes []interface{} + GoTypes []any // DependencyIndexes is an ordered list of indexes into GoTypes for the // dependencies of messages, extensions, or services. @@ -268,7 +268,7 @@ func (x depIdxs) Get(i, j int32) int32 { type ( resolverByIndex struct { - goTypes []interface{} + goTypes []any depIdxs depIdxs fileRegistry } diff --git a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go index 40272c893f..f30ab6b586 100644 --- a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +++ b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go @@ -21,6 +21,7 @@ const ( // Enum values for google.protobuf.Edition. const ( Edition_EDITION_UNKNOWN_enum_value = 0 + Edition_EDITION_LEGACY_enum_value = 900 Edition_EDITION_PROTO2_enum_value = 998 Edition_EDITION_PROTO3_enum_value = 999 Edition_EDITION_2023_enum_value = 1000 @@ -653,6 +654,7 @@ const ( FieldOptions_Targets_field_name protoreflect.Name = "targets" FieldOptions_EditionDefaults_field_name protoreflect.Name = "edition_defaults" FieldOptions_Features_field_name protoreflect.Name = "features" + FieldOptions_FeatureSupport_field_name protoreflect.Name = "feature_support" FieldOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" FieldOptions_Ctype_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.ctype" @@ -667,6 +669,7 @@ const ( FieldOptions_Targets_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.targets" FieldOptions_EditionDefaults_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.edition_defaults" FieldOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.features" + FieldOptions_FeatureSupport_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.feature_support" FieldOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.uninterpreted_option" ) @@ -684,6 +687,7 @@ const ( FieldOptions_Targets_field_number protoreflect.FieldNumber = 19 FieldOptions_EditionDefaults_field_number protoreflect.FieldNumber = 20 FieldOptions_Features_field_number protoreflect.FieldNumber = 21 + FieldOptions_FeatureSupport_field_number protoreflect.FieldNumber = 22 FieldOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -767,6 +771,33 @@ const ( FieldOptions_EditionDefault_Value_field_number protoreflect.FieldNumber = 2 ) +// Names for google.protobuf.FieldOptions.FeatureSupport. +const ( + FieldOptions_FeatureSupport_message_name protoreflect.Name = "FeatureSupport" + FieldOptions_FeatureSupport_message_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport" +) + +// Field names for google.protobuf.FieldOptions.FeatureSupport. +const ( + FieldOptions_FeatureSupport_EditionIntroduced_field_name protoreflect.Name = "edition_introduced" + FieldOptions_FeatureSupport_EditionDeprecated_field_name protoreflect.Name = "edition_deprecated" + FieldOptions_FeatureSupport_DeprecationWarning_field_name protoreflect.Name = "deprecation_warning" + FieldOptions_FeatureSupport_EditionRemoved_field_name protoreflect.Name = "edition_removed" + + FieldOptions_FeatureSupport_EditionIntroduced_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_introduced" + FieldOptions_FeatureSupport_EditionDeprecated_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_deprecated" + FieldOptions_FeatureSupport_DeprecationWarning_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.deprecation_warning" + FieldOptions_FeatureSupport_EditionRemoved_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_removed" +) + +// Field numbers for google.protobuf.FieldOptions.FeatureSupport. +const ( + FieldOptions_FeatureSupport_EditionIntroduced_field_number protoreflect.FieldNumber = 1 + FieldOptions_FeatureSupport_EditionDeprecated_field_number protoreflect.FieldNumber = 2 + FieldOptions_FeatureSupport_DeprecationWarning_field_number protoreflect.FieldNumber = 3 + FieldOptions_FeatureSupport_EditionRemoved_field_number protoreflect.FieldNumber = 4 +) + // Names for google.protobuf.OneofOptions. const ( OneofOptions_message_name protoreflect.Name = "OneofOptions" @@ -829,11 +860,13 @@ const ( EnumValueOptions_Deprecated_field_name protoreflect.Name = "deprecated" EnumValueOptions_Features_field_name protoreflect.Name = "features" EnumValueOptions_DebugRedact_field_name protoreflect.Name = "debug_redact" + EnumValueOptions_FeatureSupport_field_name protoreflect.Name = "feature_support" EnumValueOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" EnumValueOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.deprecated" EnumValueOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.features" EnumValueOptions_DebugRedact_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.debug_redact" + EnumValueOptions_FeatureSupport_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.feature_support" EnumValueOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.uninterpreted_option" ) @@ -842,6 +875,7 @@ const ( EnumValueOptions_Deprecated_field_number protoreflect.FieldNumber = 1 EnumValueOptions_Features_field_number protoreflect.FieldNumber = 2 EnumValueOptions_DebugRedact_field_number protoreflect.FieldNumber = 3 + EnumValueOptions_FeatureSupport_field_number protoreflect.FieldNumber = 4 EnumValueOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -1110,17 +1144,20 @@ const ( // Field names for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. const ( - FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_name protoreflect.Name = "edition" - FeatureSetDefaults_FeatureSetEditionDefault_Features_field_name protoreflect.Name = "features" + FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_name protoreflect.Name = "edition" + FeatureSetDefaults_FeatureSetEditionDefault_OverridableFeatures_field_name protoreflect.Name = "overridable_features" + FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_name protoreflect.Name = "fixed_features" - FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition" - FeatureSetDefaults_FeatureSetEditionDefault_Features_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features" + FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition" + FeatureSetDefaults_FeatureSetEditionDefault_OverridableFeatures_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridable_features" + FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixed_features" ) // Field numbers for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. const ( - FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_number protoreflect.FieldNumber = 3 - FeatureSetDefaults_FeatureSetEditionDefault_Features_field_number protoreflect.FieldNumber = 2 + FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_number protoreflect.FieldNumber = 3 + FeatureSetDefaults_FeatureSetEditionDefault_OverridableFeatures_field_number protoreflect.FieldNumber = 4 + FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_number protoreflect.FieldNumber = 5 ) // Names for google.protobuf.SourceCodeInfo. diff --git a/vendor/google.golang.org/protobuf/internal/genid/go_features_gen.go b/vendor/google.golang.org/protobuf/internal/genid/go_features_gen.go index fd9015e8ee..9a652a2b42 100644 --- a/vendor/google.golang.org/protobuf/internal/genid/go_features_gen.go +++ b/vendor/google.golang.org/protobuf/internal/genid/go_features_gen.go @@ -10,7 +10,7 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" ) -const File_reflect_protodesc_proto_go_features_proto = "reflect/protodesc/proto/go_features.proto" +const File_google_protobuf_go_features_proto = "google/protobuf/go_features.proto" // Names for google.protobuf.GoFeatures. const ( diff --git a/vendor/google.golang.org/protobuf/internal/impl/api_export.go b/vendor/google.golang.org/protobuf/internal/impl/api_export.go index a371f98de1..5d5771c2ed 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/api_export.go +++ b/vendor/google.golang.org/protobuf/internal/impl/api_export.go @@ -22,13 +22,13 @@ type Export struct{} // NewError formats a string according to the format specifier and arguments and // returns an error that has a "proto" prefix. -func (Export) NewError(f string, x ...interface{}) error { +func (Export) NewError(f string, x ...any) error { return errors.New(f, x...) } // enum is any enum type generated by protoc-gen-go // and must be a named int32 type. -type enum = interface{} +type enum = any // EnumOf returns the protoreflect.Enum interface over e. // It returns nil if e is nil. @@ -81,7 +81,7 @@ func (Export) EnumStringOf(ed protoreflect.EnumDescriptor, n protoreflect.EnumNu // message is any message type generated by protoc-gen-go // and must be a pointer to a named struct type. -type message = interface{} +type message = any // legacyMessageWrapper wraps a v2 message as a v1 message. type legacyMessageWrapper struct{ m protoreflect.ProtoMessage } diff --git a/vendor/google.golang.org/protobuf/internal/impl/checkinit.go b/vendor/google.golang.org/protobuf/internal/impl/checkinit.go index bff041edc9..f29e6a8fa8 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/checkinit.go +++ b/vendor/google.golang.org/protobuf/internal/impl/checkinit.go @@ -68,7 +68,7 @@ func (mi *MessageInfo) isInitExtensions(ext *map[int32]ExtensionField) error { } for _, x := range *ext { ei := getExtensionFieldInfo(x.Type()) - if ei.funcs.isInit == nil { + if ei.funcs.isInit == nil || x.isUnexpandedLazy() { continue } v := x.Value() diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go b/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go index 2b8f122c27..4bb0a7a20c 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go @@ -99,6 +99,28 @@ func (f *ExtensionField) canLazy(xt protoreflect.ExtensionType) bool { return false } +// isUnexpandedLazy returns true if the ExensionField is lazy and not +// yet expanded, which means it's present and already checked for +// initialized required fields. +func (f *ExtensionField) isUnexpandedLazy() bool { + return f.lazy != nil && atomic.LoadUint32(&f.lazy.atomicOnce) == 0 +} + +// lazyBuffer retrieves the buffer for a lazy extension if it's not yet expanded. +// +// The returned buffer has to be kept over whatever operation we're planning, +// as re-retrieving it will fail after the message is lazily decoded. +func (f *ExtensionField) lazyBuffer() []byte { + // This function might be in the critical path, so check the atomic without + // taking a look first, then only take the lock if needed. + if !f.isUnexpandedLazy() { + return nil + } + f.lazy.mu.Lock() + defer f.lazy.mu.Unlock() + return f.lazy.b +} + func (f *ExtensionField) lazyInit() { f.lazy.mu.Lock() defer f.lazy.mu.Unlock() diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_field.go b/vendor/google.golang.org/protobuf/internal/impl/codec_field.go index 3fadd241e1..78ee47e44b 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_field.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_field.go @@ -233,9 +233,15 @@ func sizeMessageInfo(p pointer, f *coderFieldInfo, opts marshalOptions) int { } func appendMessageInfo(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { + calculatedSize := f.mi.sizePointer(p.Elem(), opts) b = protowire.AppendVarint(b, f.wiretag) - b = protowire.AppendVarint(b, uint64(f.mi.sizePointer(p.Elem(), opts))) - return f.mi.marshalAppendPointer(b, p.Elem(), opts) + b = protowire.AppendVarint(b, uint64(calculatedSize)) + before := len(b) + b, err := f.mi.marshalAppendPointer(b, p.Elem(), opts) + if measuredSize := len(b) - before; calculatedSize != measuredSize && err == nil { + return nil, errors.MismatchedSizeCalculation(calculatedSize, measuredSize) + } + return b, err } func consumeMessageInfo(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { @@ -262,14 +268,21 @@ func isInitMessageInfo(p pointer, f *coderFieldInfo) error { return f.mi.checkInitializedPointer(p.Elem()) } -func sizeMessage(m proto.Message, tagsize int, _ marshalOptions) int { - return protowire.SizeBytes(proto.Size(m)) + tagsize +func sizeMessage(m proto.Message, tagsize int, opts marshalOptions) int { + return protowire.SizeBytes(opts.Options().Size(m)) + tagsize } func appendMessage(b []byte, m proto.Message, wiretag uint64, opts marshalOptions) ([]byte, error) { + mopts := opts.Options() + calculatedSize := mopts.Size(m) b = protowire.AppendVarint(b, wiretag) - b = protowire.AppendVarint(b, uint64(proto.Size(m))) - return opts.Options().MarshalAppend(b, m) + b = protowire.AppendVarint(b, uint64(calculatedSize)) + before := len(b) + b, err := mopts.MarshalAppend(b, m) + if measuredSize := len(b) - before; calculatedSize != measuredSize && err == nil { + return nil, errors.MismatchedSizeCalculation(calculatedSize, measuredSize) + } + return b, err } func consumeMessage(b []byte, m proto.Message, wtyp protowire.Type, opts unmarshalOptions) (out unmarshalOutput, err error) { @@ -405,8 +418,8 @@ func consumeGroupType(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInf return f.mi.unmarshalPointer(b, p.Elem(), f.num, opts) } -func sizeGroup(m proto.Message, tagsize int, _ marshalOptions) int { - return 2*tagsize + proto.Size(m) +func sizeGroup(m proto.Message, tagsize int, opts marshalOptions) int { + return 2*tagsize + opts.Options().Size(m) } func appendGroup(b []byte, m proto.Message, wiretag uint64, opts marshalOptions) ([]byte, error) { @@ -482,10 +495,14 @@ func appendMessageSliceInfo(b []byte, p pointer, f *coderFieldInfo, opts marshal b = protowire.AppendVarint(b, f.wiretag) siz := f.mi.sizePointer(v, opts) b = protowire.AppendVarint(b, uint64(siz)) + before := len(b) b, err = f.mi.marshalAppendPointer(b, v, opts) if err != nil { return b, err } + if measuredSize := len(b) - before; siz != measuredSize { + return nil, errors.MismatchedSizeCalculation(siz, measuredSize) + } } return b, nil } @@ -520,28 +537,34 @@ func isInitMessageSliceInfo(p pointer, f *coderFieldInfo) error { return nil } -func sizeMessageSlice(p pointer, goType reflect.Type, tagsize int, _ marshalOptions) int { +func sizeMessageSlice(p pointer, goType reflect.Type, tagsize int, opts marshalOptions) int { + mopts := opts.Options() s := p.PointerSlice() n := 0 for _, v := range s { m := asMessage(v.AsValueOf(goType.Elem())) - n += protowire.SizeBytes(proto.Size(m)) + tagsize + n += protowire.SizeBytes(mopts.Size(m)) + tagsize } return n } func appendMessageSlice(b []byte, p pointer, wiretag uint64, goType reflect.Type, opts marshalOptions) ([]byte, error) { + mopts := opts.Options() s := p.PointerSlice() var err error for _, v := range s { m := asMessage(v.AsValueOf(goType.Elem())) b = protowire.AppendVarint(b, wiretag) - siz := proto.Size(m) + siz := mopts.Size(m) b = protowire.AppendVarint(b, uint64(siz)) - b, err = opts.Options().MarshalAppend(b, m) + before := len(b) + b, err = mopts.MarshalAppend(b, m) if err != nil { return b, err } + if measuredSize := len(b) - before; siz != measuredSize { + return nil, errors.MismatchedSizeCalculation(siz, measuredSize) + } } return b, nil } @@ -582,11 +605,12 @@ func isInitMessageSlice(p pointer, goType reflect.Type) error { // Slices of messages func sizeMessageSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) int { + mopts := opts.Options() list := listv.List() n := 0 for i, llen := 0, list.Len(); i < llen; i++ { m := list.Get(i).Message().Interface() - n += protowire.SizeBytes(proto.Size(m)) + tagsize + n += protowire.SizeBytes(mopts.Size(m)) + tagsize } return n } @@ -597,13 +621,17 @@ func appendMessageSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, for i, llen := 0, list.Len(); i < llen; i++ { m := list.Get(i).Message().Interface() b = protowire.AppendVarint(b, wiretag) - siz := proto.Size(m) + siz := mopts.Size(m) b = protowire.AppendVarint(b, uint64(siz)) + before := len(b) var err error b, err = mopts.MarshalAppend(b, m) if err != nil { return b, err } + if measuredSize := len(b) - before; siz != measuredSize { + return nil, errors.MismatchedSizeCalculation(siz, measuredSize) + } } return b, nil } @@ -651,11 +679,12 @@ var coderMessageSliceValue = valueCoderFuncs{ } func sizeGroupSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) int { + mopts := opts.Options() list := listv.List() n := 0 for i, llen := 0, list.Len(); i < llen; i++ { m := list.Get(i).Message().Interface() - n += 2*tagsize + proto.Size(m) + n += 2*tagsize + mopts.Size(m) } return n } @@ -738,12 +767,13 @@ func makeGroupSliceFieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type) } } -func sizeGroupSlice(p pointer, messageType reflect.Type, tagsize int, _ marshalOptions) int { +func sizeGroupSlice(p pointer, messageType reflect.Type, tagsize int, opts marshalOptions) int { + mopts := opts.Options() s := p.PointerSlice() n := 0 for _, v := range s { m := asMessage(v.AsValueOf(messageType.Elem())) - n += 2*tagsize + proto.Size(m) + n += 2*tagsize + mopts.Size(m) } return n } diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_map.go b/vendor/google.golang.org/protobuf/internal/impl/codec_map.go index 111b9d16f9..fb35f0bae9 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_map.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_map.go @@ -9,6 +9,7 @@ import ( "sort" "google.golang.org/protobuf/encoding/protowire" + "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/genid" "google.golang.org/protobuf/reflect/protoreflect" ) @@ -240,11 +241,16 @@ func appendMapItem(b []byte, keyrv, valrv reflect.Value, mapi *mapInfo, f *coder size += mapi.keyFuncs.size(key.Value(), mapKeyTagSize, opts) size += mapi.valFuncs.size(val, mapValTagSize, opts) b = protowire.AppendVarint(b, uint64(size)) + before := len(b) b, err := mapi.keyFuncs.marshal(b, key.Value(), mapi.keyWiretag, opts) if err != nil { return nil, err } - return mapi.valFuncs.marshal(b, val, mapi.valWiretag, opts) + b, err = mapi.valFuncs.marshal(b, val, mapi.valWiretag, opts) + if measuredSize := len(b) - before; size != measuredSize && err == nil { + return nil, errors.MismatchedSizeCalculation(size, measuredSize) + } + return b, err } else { key := mapi.conv.keyConv.PBValueOf(keyrv).MapKey() val := pointerOfValue(valrv) @@ -259,7 +265,12 @@ func appendMapItem(b []byte, keyrv, valrv reflect.Value, mapi *mapInfo, f *coder } b = protowire.AppendVarint(b, mapi.valWiretag) b = protowire.AppendVarint(b, uint64(valSize)) - return f.mi.marshalAppendPointer(b, val, opts) + before := len(b) + b, err = f.mi.marshalAppendPointer(b, val, opts) + if measuredSize := len(b) - before; valSize != measuredSize && err == nil { + return nil, errors.MismatchedSizeCalculation(valSize, measuredSize) + } + return b, err } } diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_messageset.go b/vendor/google.golang.org/protobuf/internal/impl/codec_messageset.go index b7a23faf1e..7a16ec13dd 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_messageset.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_messageset.go @@ -26,6 +26,15 @@ func sizeMessageSet(mi *MessageInfo, p pointer, opts marshalOptions) (size int) } num, _ := protowire.DecodeTag(xi.wiretag) size += messageset.SizeField(num) + if fullyLazyExtensions(opts) { + // Don't expand the extension, instead use the buffer to calculate size + if lb := x.lazyBuffer(); lb != nil { + // We got hold of the buffer, so it's still lazy. + // Don't count the tag size in the extension buffer, it's already added. + size += protowire.SizeTag(messageset.FieldMessage) + len(lb) - xi.tagsize + continue + } + } size += xi.funcs.size(x.Value(), protowire.SizeTag(messageset.FieldMessage), opts) } @@ -85,6 +94,19 @@ func marshalMessageSetField(mi *MessageInfo, b []byte, x ExtensionField, opts ma xi := getExtensionFieldInfo(x.Type()) num, _ := protowire.DecodeTag(xi.wiretag) b = messageset.AppendFieldStart(b, num) + + if fullyLazyExtensions(opts) { + // Don't expand the extension if it's still in wire format, instead use the buffer content. + if lb := x.lazyBuffer(); lb != nil { + // The tag inside the lazy buffer is a different tag (the extension + // number), but what we need here is the tag for FieldMessage: + b = protowire.AppendVarint(b, protowire.EncodeTag(messageset.FieldMessage, protowire.BytesType)) + b = append(b, lb[xi.tagsize:]...) + b = messageset.AppendFieldEnd(b) + return b, nil + } + } + b, err := xi.funcs.marshal(b, x.Value(), protowire.EncodeTag(messageset.FieldMessage, protowire.BytesType), opts) if err != nil { return b, err diff --git a/vendor/google.golang.org/protobuf/internal/impl/convert.go b/vendor/google.golang.org/protobuf/internal/impl/convert.go index 185ef2efa5..e06ece55a2 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/convert.go +++ b/vendor/google.golang.org/protobuf/internal/impl/convert.go @@ -14,7 +14,7 @@ import ( // unwrapper unwraps the value to the underlying value. // This is implemented by List and Map. type unwrapper interface { - protoUnwrap() interface{} + protoUnwrap() any } // A Converter coverts to/from Go reflect.Value types and protobuf protoreflect.Value types. diff --git a/vendor/google.golang.org/protobuf/internal/impl/convert_list.go b/vendor/google.golang.org/protobuf/internal/impl/convert_list.go index f89136516f..18cb96fd70 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/convert_list.go +++ b/vendor/google.golang.org/protobuf/internal/impl/convert_list.go @@ -136,6 +136,6 @@ func (ls *listReflect) NewElement() protoreflect.Value { func (ls *listReflect) IsValid() bool { return !ls.v.IsNil() } -func (ls *listReflect) protoUnwrap() interface{} { +func (ls *listReflect) protoUnwrap() any { return ls.v.Interface() } diff --git a/vendor/google.golang.org/protobuf/internal/impl/convert_map.go b/vendor/google.golang.org/protobuf/internal/impl/convert_map.go index f30b0a0576..304244a651 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/convert_map.go +++ b/vendor/google.golang.org/protobuf/internal/impl/convert_map.go @@ -116,6 +116,6 @@ func (ms *mapReflect) NewValue() protoreflect.Value { func (ms *mapReflect) IsValid() bool { return !ms.v.IsNil() } -func (ms *mapReflect) protoUnwrap() interface{} { +func (ms *mapReflect) protoUnwrap() any { return ms.v.Interface() } diff --git a/vendor/google.golang.org/protobuf/internal/impl/encode.go b/vendor/google.golang.org/protobuf/internal/impl/encode.go index 845c67d6e7..febd212247 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/encode.go +++ b/vendor/google.golang.org/protobuf/internal/impl/encode.go @@ -49,8 +49,11 @@ func (mi *MessageInfo) sizePointer(p pointer, opts marshalOptions) (size int) { return 0 } if opts.UseCachedSize() && mi.sizecacheOffset.IsValid() { - if size := atomic.LoadInt32(p.Apply(mi.sizecacheOffset).Int32()); size >= 0 { - return int(size) + // The size cache contains the size + 1, to allow the + // zero value to be invalid, while also allowing for a + // 0 size to be cached. + if size := atomic.LoadInt32(p.Apply(mi.sizecacheOffset).Int32()); size > 0 { + return int(size - 1) } } return mi.sizePointerSlow(p, opts) @@ -60,7 +63,7 @@ func (mi *MessageInfo) sizePointerSlow(p pointer, opts marshalOptions) (size int if flags.ProtoLegacy && mi.isMessageSet { size = sizeMessageSet(mi, p, opts) if mi.sizecacheOffset.IsValid() { - atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), int32(size)) + atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), int32(size+1)) } return size } @@ -84,13 +87,16 @@ func (mi *MessageInfo) sizePointerSlow(p pointer, opts marshalOptions) (size int } } if mi.sizecacheOffset.IsValid() { - if size > math.MaxInt32 { + if size > (math.MaxInt32 - 1) { // The size is too large for the int32 sizecache field. // We will need to recompute the size when encoding; // unfortunately expensive, but better than invalid output. - atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), -1) + atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), 0) } else { - atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), int32(size)) + // The size cache contains the size + 1, to allow the + // zero value to be invalid, while also allowing for a + // 0 size to be cached. + atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), int32(size+1)) } } return size @@ -149,6 +155,14 @@ func (mi *MessageInfo) marshalAppendPointer(b []byte, p pointer, opts marshalOpt return b, nil } +// fullyLazyExtensions returns true if we should attempt to keep extensions lazy over size and marshal. +func fullyLazyExtensions(opts marshalOptions) bool { + // When deterministic marshaling is requested, force an unmarshal for lazy + // extensions to produce a deterministic result, instead of passing through + // bytes lazily that may or may not match what Go Protobuf would produce. + return opts.flags&piface.MarshalDeterministic == 0 +} + func (mi *MessageInfo) sizeExtensions(ext *map[int32]ExtensionField, opts marshalOptions) (n int) { if ext == nil { return 0 @@ -158,6 +172,14 @@ func (mi *MessageInfo) sizeExtensions(ext *map[int32]ExtensionField, opts marsha if xi.funcs.size == nil { continue } + if fullyLazyExtensions(opts) { + // Don't expand the extension, instead use the buffer to calculate size + if lb := x.lazyBuffer(); lb != nil { + // We got hold of the buffer, so it's still lazy. + n += len(lb) + continue + } + } n += xi.funcs.size(x.Value(), xi.tagsize, opts) } return n @@ -176,6 +198,13 @@ func (mi *MessageInfo) appendExtensions(b []byte, ext *map[int32]ExtensionField, var err error for _, x := range *ext { xi := getExtensionFieldInfo(x.Type()) + if fullyLazyExtensions(opts) { + // Don't expand the extension if it's still in wire format, instead use the buffer content. + if lb := x.lazyBuffer(); lb != nil { + b = append(b, lb...) + continue + } + } b, err = xi.funcs.marshal(b, x.Value(), xi.wiretag, opts) } return b, err @@ -191,6 +220,13 @@ func (mi *MessageInfo) appendExtensions(b []byte, ext *map[int32]ExtensionField, for _, k := range keys { x := (*ext)[int32(k)] xi := getExtensionFieldInfo(x.Type()) + if fullyLazyExtensions(opts) { + // Don't expand the extension if it's still in wire format, instead use the buffer content. + if lb := x.lazyBuffer(); lb != nil { + b = append(b, lb...) + continue + } + } b, err = xi.funcs.marshal(b, x.Value(), xi.wiretag, opts) if err != nil { return b, err diff --git a/vendor/google.golang.org/protobuf/internal/impl/extension.go b/vendor/google.golang.org/protobuf/internal/impl/extension.go index cb25b0bae1..e31249f64f 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/extension.go +++ b/vendor/google.golang.org/protobuf/internal/impl/extension.go @@ -53,7 +53,7 @@ type ExtensionInfo struct { // type returned by InterfaceOf may not be identical. // // Deprecated: Use InterfaceOf(xt.Zero()) instead. - ExtensionType interface{} + ExtensionType any // Field is the field number of the extension. // @@ -95,16 +95,16 @@ func (xi *ExtensionInfo) New() protoreflect.Value { func (xi *ExtensionInfo) Zero() protoreflect.Value { return xi.lazyInit().Zero() } -func (xi *ExtensionInfo) ValueOf(v interface{}) protoreflect.Value { +func (xi *ExtensionInfo) ValueOf(v any) protoreflect.Value { return xi.lazyInit().PBValueOf(reflect.ValueOf(v)) } -func (xi *ExtensionInfo) InterfaceOf(v protoreflect.Value) interface{} { +func (xi *ExtensionInfo) InterfaceOf(v protoreflect.Value) any { return xi.lazyInit().GoValueOf(v).Interface() } func (xi *ExtensionInfo) IsValidValue(v protoreflect.Value) bool { return xi.lazyInit().IsValidPB(v) } -func (xi *ExtensionInfo) IsValidInterface(v interface{}) bool { +func (xi *ExtensionInfo) IsValidInterface(v any) bool { return xi.lazyInit().IsValidGo(reflect.ValueOf(v)) } func (xi *ExtensionInfo) TypeDescriptor() protoreflect.ExtensionTypeDescriptor { diff --git a/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go b/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go index c2a803bb2f..81b2b1a763 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go +++ b/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go @@ -97,7 +97,7 @@ func (e *legacyEnumWrapper) Number() protoreflect.EnumNumber { func (e *legacyEnumWrapper) ProtoReflect() protoreflect.Enum { return e } -func (e *legacyEnumWrapper) protoUnwrap() interface{} { +func (e *legacyEnumWrapper) protoUnwrap() any { v := reflect.New(e.goTyp).Elem() v.SetInt(int64(e.num)) return v.Interface() @@ -167,6 +167,7 @@ func aberrantLoadEnumDesc(t reflect.Type) protoreflect.EnumDescriptor { ed := &filedesc.Enum{L2: new(filedesc.EnumL2)} ed.L0.FullName = AberrantDeriveFullName(t) // e.g., github_com.user.repo.MyEnum ed.L0.ParentFile = filedesc.SurrogateProto3 + ed.L1.EditionFeatures = ed.L0.ParentFile.L1.EditionFeatures ed.L2.Values.List = append(ed.L2.Values.List, filedesc.EnumValue{}) // TODO: Use the presence of a UnmarshalJSON method to determine proto2? diff --git a/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go b/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go index 87b30d0504..6e8677ee63 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go +++ b/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go @@ -118,7 +118,7 @@ func (xi *ExtensionInfo) initFromLegacy() { xd.L1.Number = protoreflect.FieldNumber(xi.Field) xd.L1.Cardinality = fd.L1.Cardinality xd.L1.Kind = fd.L1.Kind - xd.L2.IsPacked = fd.L1.IsPacked + xd.L1.EditionFeatures = fd.L1.EditionFeatures xd.L2.Default = fd.L1.Default xd.L1.Extendee = Export{}.MessageDescriptorOf(xi.ExtendedType) xd.L2.Enum = ed diff --git a/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go b/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go index 9ab091086c..b649f1124b 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go +++ b/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go @@ -7,7 +7,7 @@ package impl import ( "bytes" "compress/gzip" - "io/ioutil" + "io" "sync" "google.golang.org/protobuf/internal/filedesc" @@ -51,7 +51,7 @@ func legacyLoadFileDesc(b []byte) protoreflect.FileDescriptor { if err != nil { panic(err) } - b2, err := ioutil.ReadAll(zr) + b2, err := io.ReadAll(zr) if err != nil { panic(err) } diff --git a/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go b/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go index 2ab2c62978..bf0b6049b4 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go +++ b/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go @@ -204,6 +204,7 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName } } + md.L1.EditionFeatures = md.L0.ParentFile.L1.EditionFeatures // Obtain a list of oneof wrapper types. var oneofWrappers []reflect.Type methods := make([]reflect.Method, 0, 2) @@ -215,7 +216,7 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName } for _, fn := range methods { for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { - if vs, ok := v.Interface().([]interface{}); ok { + if vs, ok := v.Interface().([]any); ok { for _, v := range vs { oneofWrappers = append(oneofWrappers, reflect.TypeOf(v)) } @@ -250,6 +251,7 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName od := &md.L2.Oneofs.List[n] od.L0.FullName = md.FullName().Append(protoreflect.Name(tag)) od.L0.ParentFile = md.L0.ParentFile + od.L1.EditionFeatures = md.L1.EditionFeatures od.L0.Parent = md od.L0.Index = n @@ -260,6 +262,7 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName aberrantAppendField(md, f.Type, tag, "", "") fd := &md.L2.Fields.List[len(md.L2.Fields.List)-1] fd.L1.ContainingOneof = od + fd.L1.EditionFeatures = od.L1.EditionFeatures od.L1.Fields.List = append(od.L1.Fields.List, fd) } } @@ -307,14 +310,14 @@ func aberrantAppendField(md *filedesc.Message, goType reflect.Type, tag, tagKey, fd.L0.Parent = md fd.L0.Index = n - if fd.L1.IsWeak || fd.L1.HasPacked { + if fd.L1.IsWeak || fd.L1.EditionFeatures.IsPacked { fd.L1.Options = func() protoreflect.ProtoMessage { opts := descopts.Field.ProtoReflect().New() if fd.L1.IsWeak { opts.Set(opts.Descriptor().Fields().ByName("weak"), protoreflect.ValueOfBool(true)) } - if fd.L1.HasPacked { - opts.Set(opts.Descriptor().Fields().ByName("packed"), protoreflect.ValueOfBool(fd.L1.IsPacked)) + if fd.L1.EditionFeatures.IsPacked { + opts.Set(opts.Descriptor().Fields().ByName("packed"), protoreflect.ValueOfBool(fd.L1.EditionFeatures.IsPacked)) } return opts.Interface() } @@ -344,6 +347,7 @@ func aberrantAppendField(md *filedesc.Message, goType reflect.Type, tag, tagKey, md2.L0.ParentFile = md.L0.ParentFile md2.L0.Parent = md md2.L0.Index = n + md2.L1.EditionFeatures = md.L1.EditionFeatures md2.L1.IsMapEntry = true md2.L2.Options = func() protoreflect.ProtoMessage { @@ -563,6 +567,6 @@ func (m aberrantMessage) IsValid() bool { func (m aberrantMessage) ProtoMethods() *protoiface.Methods { return aberrantProtoMethods } -func (m aberrantMessage) protoUnwrap() interface{} { +func (m aberrantMessage) protoUnwrap() any { return m.v.Interface() } diff --git a/vendor/google.golang.org/protobuf/internal/impl/message.go b/vendor/google.golang.org/protobuf/internal/impl/message.go index 629bacdced..019399d454 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/message.go +++ b/vendor/google.golang.org/protobuf/internal/impl/message.go @@ -35,7 +35,7 @@ type MessageInfo struct { Exporter exporter // OneofWrappers is list of pointers to oneof wrapper struct types. - OneofWrappers []interface{} + OneofWrappers []any initMu sync.Mutex // protects all unexported fields initDone uint32 @@ -47,7 +47,7 @@ type MessageInfo struct { // exporter is a function that returns a reference to the ith field of v, // where v is a pointer to a struct. It returns nil if it does not support // exporting the requested field (e.g., already exported). -type exporter func(v interface{}, i int) interface{} +type exporter func(v any, i int) any // getMessageInfo returns the MessageInfo for any message type that // is generated by our implementation of protoc-gen-go (for v2 and on). @@ -201,7 +201,7 @@ fieldLoop: } for _, fn := range methods { for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { - if vs, ok := v.Interface().([]interface{}); ok { + if vs, ok := v.Interface().([]any); ok { oneofWrappers = vs } } @@ -256,7 +256,7 @@ func (mi *MessageInfo) Message(i int) protoreflect.MessageType { type mapEntryType struct { desc protoreflect.MessageDescriptor - valType interface{} // zero value of enum or message type + valType any // zero value of enum or message type } func (mt mapEntryType) New() protoreflect.Message { diff --git a/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go b/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go index d9ea010bef..ecb4623d70 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go +++ b/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go @@ -20,7 +20,7 @@ type reflectMessageInfo struct { // fieldTypes contains the zero value of an enum or message field. // For lists, it contains the element type. // For maps, it contains the entry value type. - fieldTypes map[protoreflect.FieldNumber]interface{} + fieldTypes map[protoreflect.FieldNumber]any // denseFields is a subset of fields where: // 0 < fieldDesc.Number() < len(denseFields) @@ -28,7 +28,7 @@ type reflectMessageInfo struct { denseFields []*fieldInfo // rangeInfos is a list of all fields (not belonging to a oneof) and oneofs. - rangeInfos []interface{} // either *fieldInfo or *oneofInfo + rangeInfos []any // either *fieldInfo or *oneofInfo getUnknown func(pointer) protoreflect.RawFields setUnknown func(pointer, protoreflect.RawFields) @@ -224,7 +224,7 @@ func (mi *MessageInfo) makeFieldTypes(si structInfo) { } if ft != nil { if mi.fieldTypes == nil { - mi.fieldTypes = make(map[protoreflect.FieldNumber]interface{}) + mi.fieldTypes = make(map[protoreflect.FieldNumber]any) } mi.fieldTypes[fd.Number()] = reflect.Zero(ft).Interface() } @@ -247,39 +247,39 @@ func (m *extensionMap) Range(f func(protoreflect.FieldDescriptor, protoreflect.V } } } -func (m *extensionMap) Has(xt protoreflect.ExtensionType) (ok bool) { +func (m *extensionMap) Has(xd protoreflect.ExtensionTypeDescriptor) (ok bool) { if m == nil { return false } - xd := xt.TypeDescriptor() x, ok := (*m)[int32(xd.Number())] if !ok { return false } + if x.isUnexpandedLazy() { + // Avoid calling x.Value(), which triggers a lazy unmarshal. + return true + } switch { case xd.IsList(): return x.Value().List().Len() > 0 case xd.IsMap(): return x.Value().Map().Len() > 0 - case xd.Message() != nil: - return x.Value().Message().IsValid() } return true } -func (m *extensionMap) Clear(xt protoreflect.ExtensionType) { - delete(*m, int32(xt.TypeDescriptor().Number())) +func (m *extensionMap) Clear(xd protoreflect.ExtensionTypeDescriptor) { + delete(*m, int32(xd.Number())) } -func (m *extensionMap) Get(xt protoreflect.ExtensionType) protoreflect.Value { - xd := xt.TypeDescriptor() +func (m *extensionMap) Get(xd protoreflect.ExtensionTypeDescriptor) protoreflect.Value { if m != nil { if x, ok := (*m)[int32(xd.Number())]; ok { return x.Value() } } - return xt.Zero() + return xd.Type().Zero() } -func (m *extensionMap) Set(xt protoreflect.ExtensionType, v protoreflect.Value) { - xd := xt.TypeDescriptor() +func (m *extensionMap) Set(xd protoreflect.ExtensionTypeDescriptor, v protoreflect.Value) { + xt := xd.Type() isValid := true switch { case !xt.IsValidValue(v): @@ -292,7 +292,7 @@ func (m *extensionMap) Set(xt protoreflect.ExtensionType, v protoreflect.Value) isValid = v.Message().IsValid() } if !isValid { - panic(fmt.Sprintf("%v: assigning invalid value", xt.TypeDescriptor().FullName())) + panic(fmt.Sprintf("%v: assigning invalid value", xd.FullName())) } if *m == nil { @@ -302,16 +302,15 @@ func (m *extensionMap) Set(xt protoreflect.ExtensionType, v protoreflect.Value) x.Set(xt, v) (*m)[int32(xd.Number())] = x } -func (m *extensionMap) Mutable(xt protoreflect.ExtensionType) protoreflect.Value { - xd := xt.TypeDescriptor() +func (m *extensionMap) Mutable(xd protoreflect.ExtensionTypeDescriptor) protoreflect.Value { if xd.Kind() != protoreflect.MessageKind && xd.Kind() != protoreflect.GroupKind && !xd.IsList() && !xd.IsMap() { panic("invalid Mutable on field with non-composite type") } if x, ok := (*m)[int32(xd.Number())]; ok { return x.Value() } - v := xt.New() - m.Set(xt, v) + v := xd.Type().New() + m.Set(xd, v) return v } @@ -394,7 +393,7 @@ var ( // MessageOf returns a reflective view over a message. The input must be a // pointer to a named Go struct. If the provided type has a ProtoReflect method, // it must be implemented by calling this method. -func (mi *MessageInfo) MessageOf(m interface{}) protoreflect.Message { +func (mi *MessageInfo) MessageOf(m any) protoreflect.Message { if reflect.TypeOf(m) != mi.GoReflectType { panic(fmt.Sprintf("type mismatch: got %T, want %v", m, mi.GoReflectType)) } @@ -422,13 +421,13 @@ func (m *messageIfaceWrapper) Reset() { func (m *messageIfaceWrapper) ProtoReflect() protoreflect.Message { return (*messageReflectWrapper)(m) } -func (m *messageIfaceWrapper) protoUnwrap() interface{} { +func (m *messageIfaceWrapper) protoUnwrap() any { return m.p.AsIfaceOf(m.mi.GoReflectType.Elem()) } // checkField verifies that the provided field descriptor is valid. // Exactly one of the returned values is populated. -func (mi *MessageInfo) checkField(fd protoreflect.FieldDescriptor) (*fieldInfo, protoreflect.ExtensionType) { +func (mi *MessageInfo) checkField(fd protoreflect.FieldDescriptor) (*fieldInfo, protoreflect.ExtensionTypeDescriptor) { var fi *fieldInfo if n := fd.Number(); 0 < n && int(n) < len(mi.denseFields) { fi = mi.denseFields[n] @@ -457,7 +456,7 @@ func (mi *MessageInfo) checkField(fd protoreflect.FieldDescriptor) (*fieldInfo, if !ok { panic(fmt.Sprintf("extension %v does not implement protoreflect.ExtensionTypeDescriptor", fd.FullName())) } - return nil, xtd.Type() + return nil, xtd } panic(fmt.Sprintf("field %v is invalid", fd.FullName())) } diff --git a/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go b/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go index 741d6e5b6b..99dc23c6f0 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go +++ b/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go @@ -23,12 +23,13 @@ func (m *messageState) New() protoreflect.Message { func (m *messageState) Interface() protoreflect.ProtoMessage { return m.protoUnwrap().(protoreflect.ProtoMessage) } -func (m *messageState) protoUnwrap() interface{} { +func (m *messageState) protoUnwrap() any { return m.pointer().AsIfaceOf(m.messageInfo().GoReflectType.Elem()) } func (m *messageState) ProtoMethods() *protoiface.Methods { - m.messageInfo().init() - return &m.messageInfo().methods + mi := m.messageInfo() + mi.init() + return &mi.methods } // ProtoMessageInfo is a pseudo-internal API for allowing the v1 code @@ -41,8 +42,9 @@ func (m *messageState) ProtoMessageInfo() *MessageInfo { } func (m *messageState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - m.messageInfo().init() - for _, ri := range m.messageInfo().rangeInfos { + mi := m.messageInfo() + mi.init() + for _, ri := range mi.rangeInfos { switch ri := ri.(type) { case *fieldInfo: if ri.has(m.pointer()) { @@ -52,77 +54,86 @@ func (m *messageState) Range(f func(protoreflect.FieldDescriptor, protoreflect.V } case *oneofInfo: if n := ri.which(m.pointer()); n > 0 { - fi := m.messageInfo().fields[n] + fi := mi.fields[n] if !f(fi.fieldDesc, fi.get(m.pointer())) { return } } } } - m.messageInfo().extensionMap(m.pointer()).Range(f) + mi.extensionMap(m.pointer()).Range(f) } func (m *messageState) Has(fd protoreflect.FieldDescriptor) bool { - m.messageInfo().init() - if fi, xt := m.messageInfo().checkField(fd); fi != nil { + mi := m.messageInfo() + mi.init() + if fi, xd := mi.checkField(fd); fi != nil { return fi.has(m.pointer()) } else { - return m.messageInfo().extensionMap(m.pointer()).Has(xt) + return mi.extensionMap(m.pointer()).Has(xd) } } func (m *messageState) Clear(fd protoreflect.FieldDescriptor) { - m.messageInfo().init() - if fi, xt := m.messageInfo().checkField(fd); fi != nil { + mi := m.messageInfo() + mi.init() + if fi, xd := mi.checkField(fd); fi != nil { fi.clear(m.pointer()) } else { - m.messageInfo().extensionMap(m.pointer()).Clear(xt) + mi.extensionMap(m.pointer()).Clear(xd) } } func (m *messageState) Get(fd protoreflect.FieldDescriptor) protoreflect.Value { - m.messageInfo().init() - if fi, xt := m.messageInfo().checkField(fd); fi != nil { + mi := m.messageInfo() + mi.init() + if fi, xd := mi.checkField(fd); fi != nil { return fi.get(m.pointer()) } else { - return m.messageInfo().extensionMap(m.pointer()).Get(xt) + return mi.extensionMap(m.pointer()).Get(xd) } } func (m *messageState) Set(fd protoreflect.FieldDescriptor, v protoreflect.Value) { - m.messageInfo().init() - if fi, xt := m.messageInfo().checkField(fd); fi != nil { + mi := m.messageInfo() + mi.init() + if fi, xd := mi.checkField(fd); fi != nil { fi.set(m.pointer(), v) } else { - m.messageInfo().extensionMap(m.pointer()).Set(xt, v) + mi.extensionMap(m.pointer()).Set(xd, v) } } func (m *messageState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - m.messageInfo().init() - if fi, xt := m.messageInfo().checkField(fd); fi != nil { + mi := m.messageInfo() + mi.init() + if fi, xd := mi.checkField(fd); fi != nil { return fi.mutable(m.pointer()) } else { - return m.messageInfo().extensionMap(m.pointer()).Mutable(xt) + return mi.extensionMap(m.pointer()).Mutable(xd) } } func (m *messageState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - m.messageInfo().init() - if fi, xt := m.messageInfo().checkField(fd); fi != nil { + mi := m.messageInfo() + mi.init() + if fi, xd := mi.checkField(fd); fi != nil { return fi.newField() } else { - return xt.New() + return xd.Type().New() } } func (m *messageState) WhichOneof(od protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - m.messageInfo().init() - if oi := m.messageInfo().oneofs[od.Name()]; oi != nil && oi.oneofDesc == od { + mi := m.messageInfo() + mi.init() + if oi := mi.oneofs[od.Name()]; oi != nil && oi.oneofDesc == od { return od.Fields().ByNumber(oi.which(m.pointer())) } panic("invalid oneof descriptor " + string(od.FullName()) + " for message " + string(m.Descriptor().FullName())) } func (m *messageState) GetUnknown() protoreflect.RawFields { - m.messageInfo().init() - return m.messageInfo().getUnknown(m.pointer()) + mi := m.messageInfo() + mi.init() + return mi.getUnknown(m.pointer()) } func (m *messageState) SetUnknown(b protoreflect.RawFields) { - m.messageInfo().init() - m.messageInfo().setUnknown(m.pointer(), b) + mi := m.messageInfo() + mi.init() + mi.setUnknown(m.pointer(), b) } func (m *messageState) IsValid() bool { return !m.pointer().IsNil() @@ -143,12 +154,13 @@ func (m *messageReflectWrapper) Interface() protoreflect.ProtoMessage { } return (*messageIfaceWrapper)(m) } -func (m *messageReflectWrapper) protoUnwrap() interface{} { +func (m *messageReflectWrapper) protoUnwrap() any { return m.pointer().AsIfaceOf(m.messageInfo().GoReflectType.Elem()) } func (m *messageReflectWrapper) ProtoMethods() *protoiface.Methods { - m.messageInfo().init() - return &m.messageInfo().methods + mi := m.messageInfo() + mi.init() + return &mi.methods } // ProtoMessageInfo is a pseudo-internal API for allowing the v1 code @@ -161,8 +173,9 @@ func (m *messageReflectWrapper) ProtoMessageInfo() *MessageInfo { } func (m *messageReflectWrapper) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - m.messageInfo().init() - for _, ri := range m.messageInfo().rangeInfos { + mi := m.messageInfo() + mi.init() + for _, ri := range mi.rangeInfos { switch ri := ri.(type) { case *fieldInfo: if ri.has(m.pointer()) { @@ -172,77 +185,86 @@ func (m *messageReflectWrapper) Range(f func(protoreflect.FieldDescriptor, proto } case *oneofInfo: if n := ri.which(m.pointer()); n > 0 { - fi := m.messageInfo().fields[n] + fi := mi.fields[n] if !f(fi.fieldDesc, fi.get(m.pointer())) { return } } } } - m.messageInfo().extensionMap(m.pointer()).Range(f) + mi.extensionMap(m.pointer()).Range(f) } func (m *messageReflectWrapper) Has(fd protoreflect.FieldDescriptor) bool { - m.messageInfo().init() - if fi, xt := m.messageInfo().checkField(fd); fi != nil { + mi := m.messageInfo() + mi.init() + if fi, xd := mi.checkField(fd); fi != nil { return fi.has(m.pointer()) } else { - return m.messageInfo().extensionMap(m.pointer()).Has(xt) + return mi.extensionMap(m.pointer()).Has(xd) } } func (m *messageReflectWrapper) Clear(fd protoreflect.FieldDescriptor) { - m.messageInfo().init() - if fi, xt := m.messageInfo().checkField(fd); fi != nil { + mi := m.messageInfo() + mi.init() + if fi, xd := mi.checkField(fd); fi != nil { fi.clear(m.pointer()) } else { - m.messageInfo().extensionMap(m.pointer()).Clear(xt) + mi.extensionMap(m.pointer()).Clear(xd) } } func (m *messageReflectWrapper) Get(fd protoreflect.FieldDescriptor) protoreflect.Value { - m.messageInfo().init() - if fi, xt := m.messageInfo().checkField(fd); fi != nil { + mi := m.messageInfo() + mi.init() + if fi, xd := mi.checkField(fd); fi != nil { return fi.get(m.pointer()) } else { - return m.messageInfo().extensionMap(m.pointer()).Get(xt) + return mi.extensionMap(m.pointer()).Get(xd) } } func (m *messageReflectWrapper) Set(fd protoreflect.FieldDescriptor, v protoreflect.Value) { - m.messageInfo().init() - if fi, xt := m.messageInfo().checkField(fd); fi != nil { + mi := m.messageInfo() + mi.init() + if fi, xd := mi.checkField(fd); fi != nil { fi.set(m.pointer(), v) } else { - m.messageInfo().extensionMap(m.pointer()).Set(xt, v) + mi.extensionMap(m.pointer()).Set(xd, v) } } func (m *messageReflectWrapper) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - m.messageInfo().init() - if fi, xt := m.messageInfo().checkField(fd); fi != nil { + mi := m.messageInfo() + mi.init() + if fi, xd := mi.checkField(fd); fi != nil { return fi.mutable(m.pointer()) } else { - return m.messageInfo().extensionMap(m.pointer()).Mutable(xt) + return mi.extensionMap(m.pointer()).Mutable(xd) } } func (m *messageReflectWrapper) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - m.messageInfo().init() - if fi, xt := m.messageInfo().checkField(fd); fi != nil { + mi := m.messageInfo() + mi.init() + if fi, xd := mi.checkField(fd); fi != nil { return fi.newField() } else { - return xt.New() + return xd.Type().New() } } func (m *messageReflectWrapper) WhichOneof(od protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - m.messageInfo().init() - if oi := m.messageInfo().oneofs[od.Name()]; oi != nil && oi.oneofDesc == od { + mi := m.messageInfo() + mi.init() + if oi := mi.oneofs[od.Name()]; oi != nil && oi.oneofDesc == od { return od.Fields().ByNumber(oi.which(m.pointer())) } panic("invalid oneof descriptor " + string(od.FullName()) + " for message " + string(m.Descriptor().FullName())) } func (m *messageReflectWrapper) GetUnknown() protoreflect.RawFields { - m.messageInfo().init() - return m.messageInfo().getUnknown(m.pointer()) + mi := m.messageInfo() + mi.init() + return mi.getUnknown(m.pointer()) } func (m *messageReflectWrapper) SetUnknown(b protoreflect.RawFields) { - m.messageInfo().init() - m.messageInfo().setUnknown(m.pointer(), b) + mi := m.messageInfo() + mi.init() + mi.setUnknown(m.pointer(), b) } func (m *messageReflectWrapper) IsValid() bool { return !m.pointer().IsNil() diff --git a/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go b/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go index 517e94434c..da685e8a29 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go +++ b/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go @@ -16,7 +16,7 @@ import ( const UnsafeEnabled = false // Pointer is an opaque pointer type. -type Pointer interface{} +type Pointer any // offset represents the offset to a struct field, accessible from a pointer. // The offset is the field index into a struct. @@ -62,7 +62,7 @@ func pointerOfValue(v reflect.Value) pointer { } // pointerOfIface returns the pointer portion of an interface. -func pointerOfIface(v interface{}) pointer { +func pointerOfIface(v any) pointer { return pointer{v: reflect.ValueOf(v)} } @@ -93,7 +93,7 @@ func (p pointer) AsValueOf(t reflect.Type) reflect.Value { // AsIfaceOf treats p as a pointer to an object of type t and returns the value. // It is equivalent to p.AsValueOf(t).Interface() -func (p pointer) AsIfaceOf(t reflect.Type) interface{} { +func (p pointer) AsIfaceOf(t reflect.Type) any { return p.AsValueOf(t).Interface() } diff --git a/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go b/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go index 4b020e3116..5f20ca5d8a 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go +++ b/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go @@ -50,7 +50,7 @@ func pointerOfValue(v reflect.Value) pointer { } // pointerOfIface returns the pointer portion of an interface. -func pointerOfIface(v interface{}) pointer { +func pointerOfIface(v any) pointer { type ifaceHeader struct { Type unsafe.Pointer Data unsafe.Pointer @@ -80,7 +80,7 @@ func (p pointer) AsValueOf(t reflect.Type) reflect.Value { // AsIfaceOf treats p as a pointer to an object of type t and returns the value. // It is equivalent to p.AsValueOf(t).Interface() -func (p pointer) AsIfaceOf(t reflect.Type) interface{} { +func (p pointer) AsIfaceOf(t reflect.Type) any { // TODO: Use tricky unsafe magic to directly create ifaceHeader. return p.AsValueOf(t).Interface() } diff --git a/vendor/google.golang.org/protobuf/internal/order/range.go b/vendor/google.golang.org/protobuf/internal/order/range.go index 1665a68e5b..a1f09162d0 100644 --- a/vendor/google.golang.org/protobuf/internal/order/range.go +++ b/vendor/google.golang.org/protobuf/internal/order/range.go @@ -18,7 +18,7 @@ type messageField struct { } var messageFieldPool = sync.Pool{ - New: func() interface{} { return new([]messageField) }, + New: func() any { return new([]messageField) }, } type ( @@ -69,7 +69,7 @@ type mapEntry struct { } var mapEntryPool = sync.Pool{ - New: func() interface{} { return new([]mapEntry) }, + New: func() any { return new([]mapEntry) }, } type ( diff --git a/vendor/google.golang.org/protobuf/internal/version/version.go b/vendor/google.golang.org/protobuf/internal/version/version.go index a50fcfb49b..dbbf1f6862 100644 --- a/vendor/google.golang.org/protobuf/internal/version/version.go +++ b/vendor/google.golang.org/protobuf/internal/version/version.go @@ -51,8 +51,8 @@ import ( // 10. Send out the CL for review and submit it. const ( Major = 1 - Minor = 33 - Patch = 0 + Minor = 34 + Patch = 2 PreRelease = "" ) diff --git a/vendor/google.golang.org/protobuf/proto/decode.go b/vendor/google.golang.org/protobuf/proto/decode.go index e5b03b5677..d75a6534c1 100644 --- a/vendor/google.golang.org/protobuf/proto/decode.go +++ b/vendor/google.golang.org/protobuf/proto/decode.go @@ -51,6 +51,8 @@ type UnmarshalOptions struct { // Unmarshal parses the wire-format message in b and places the result in m. // The provided message must be mutable (e.g., a non-nil pointer to a message). +// +// See the [UnmarshalOptions] type if you need more control. func Unmarshal(b []byte, m Message) error { _, err := UnmarshalOptions{RecursionLimit: protowire.DefaultRecursionLimit}.unmarshal(b, m.ProtoReflect()) return err diff --git a/vendor/google.golang.org/protobuf/proto/encode.go b/vendor/google.golang.org/protobuf/proto/encode.go index 4fed202f9f..1f847bcc35 100644 --- a/vendor/google.golang.org/protobuf/proto/encode.go +++ b/vendor/google.golang.org/protobuf/proto/encode.go @@ -5,12 +5,17 @@ package proto import ( + "errors" + "fmt" + "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/order" "google.golang.org/protobuf/internal/pragma" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoiface" + + protoerrors "google.golang.org/protobuf/internal/errors" ) // MarshalOptions configures the marshaler. @@ -70,7 +75,32 @@ type MarshalOptions struct { UseCachedSize bool } +// flags turns the specified MarshalOptions (user-facing) into +// protoiface.MarshalInputFlags (used internally by the marshaler). +// +// See impl.marshalOptions.Options for the inverse operation. +func (o MarshalOptions) flags() protoiface.MarshalInputFlags { + var flags protoiface.MarshalInputFlags + + // Note: o.AllowPartial is always forced to true by MarshalOptions.marshal, + // which is why it is not a part of MarshalInputFlags. + + if o.Deterministic { + flags |= protoiface.MarshalDeterministic + } + + if o.UseCachedSize { + flags |= protoiface.MarshalUseCachedSize + } + + return flags +} + // Marshal returns the wire-format encoding of m. +// +// This is the most common entry point for encoding a Protobuf message. +// +// See the [MarshalOptions] type if you need more control. func Marshal(m Message) ([]byte, error) { // Treat nil message interface as an empty message; nothing to output. if m == nil { @@ -116,6 +146,9 @@ func emptyBytesForMessage(m Message) []byte { // MarshalAppend appends the wire-format encoding of m to b, // returning the result. +// +// This is a less common entry point than [Marshal], which is only needed if you +// need to supply your own buffers for performance reasons. func (o MarshalOptions) MarshalAppend(b []byte, m Message) ([]byte, error) { // Treat nil message interface as an empty message; nothing to append. if m == nil { @@ -145,12 +178,7 @@ func (o MarshalOptions) marshal(b []byte, m protoreflect.Message) (out protoifac in := protoiface.MarshalInput{ Message: m, Buf: b, - } - if o.Deterministic { - in.Flags |= protoiface.MarshalDeterministic - } - if o.UseCachedSize { - in.Flags |= protoiface.MarshalUseCachedSize + Flags: o.flags(), } if methods.Size != nil { sout := methods.Size(protoiface.SizeInput{ @@ -168,6 +196,10 @@ func (o MarshalOptions) marshal(b []byte, m protoreflect.Message) (out protoifac out.Buf, err = o.marshalMessageSlow(b, m) } if err != nil { + var mismatch *protoerrors.SizeMismatchError + if errors.As(err, &mismatch) { + return out, fmt.Errorf("marshaling %s: %v", string(m.Descriptor().FullName()), err) + } return out, err } if allowPartial { diff --git a/vendor/google.golang.org/protobuf/proto/extension.go b/vendor/google.golang.org/protobuf/proto/extension.go index 17899a3a76..d248f29284 100644 --- a/vendor/google.golang.org/protobuf/proto/extension.go +++ b/vendor/google.golang.org/protobuf/proto/extension.go @@ -11,18 +11,21 @@ import ( // HasExtension reports whether an extension field is populated. // It returns false if m is invalid or if xt does not extend m. func HasExtension(m Message, xt protoreflect.ExtensionType) bool { - // Treat nil message interface as an empty message; no populated fields. - if m == nil { + // Treat nil message interface or descriptor as an empty message; no populated + // fields. + if m == nil || xt == nil { return false } // As a special-case, we reports invalid or mismatching descriptors // as always not being populated (since they aren't). - if xt == nil || m.ProtoReflect().Descriptor() != xt.TypeDescriptor().ContainingMessage() { + mr := m.ProtoReflect() + xd := xt.TypeDescriptor() + if mr.Descriptor() != xd.ContainingMessage() { return false } - return m.ProtoReflect().Has(xt.TypeDescriptor()) + return mr.Has(xd) } // ClearExtension clears an extension field such that subsequent @@ -36,7 +39,7 @@ func ClearExtension(m Message, xt protoreflect.ExtensionType) { // If the field is unpopulated, it returns the default value for // scalars and an immutable, empty value for lists or messages. // It panics if xt does not extend m. -func GetExtension(m Message, xt protoreflect.ExtensionType) interface{} { +func GetExtension(m Message, xt protoreflect.ExtensionType) any { // Treat nil message interface as an empty message; return the default. if m == nil { return xt.InterfaceOf(xt.Zero()) @@ -48,7 +51,7 @@ func GetExtension(m Message, xt protoreflect.ExtensionType) interface{} { // SetExtension stores the value of an extension field. // It panics if m is invalid, xt does not extend m, or if type of v // is invalid for the specified extension field. -func SetExtension(m Message, xt protoreflect.ExtensionType, v interface{}) { +func SetExtension(m Message, xt protoreflect.ExtensionType, v any) { xd := xt.TypeDescriptor() pv := xt.ValueOf(v) @@ -75,7 +78,7 @@ func SetExtension(m Message, xt protoreflect.ExtensionType, v interface{}) { // It returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current extension field. -func RangeExtensions(m Message, f func(protoreflect.ExtensionType, interface{}) bool) { +func RangeExtensions(m Message, f func(protoreflect.ExtensionType, any) bool) { // Treat nil message interface as an empty message; nothing to range over. if m == nil { return diff --git a/vendor/google.golang.org/protobuf/proto/messageset.go b/vendor/google.golang.org/protobuf/proto/messageset.go index 312d5d45c6..575d14831f 100644 --- a/vendor/google.golang.org/protobuf/proto/messageset.go +++ b/vendor/google.golang.org/protobuf/proto/messageset.go @@ -47,11 +47,16 @@ func (o MarshalOptions) marshalMessageSet(b []byte, m protoreflect.Message) ([]b func (o MarshalOptions) marshalMessageSetField(b []byte, fd protoreflect.FieldDescriptor, value protoreflect.Value) ([]byte, error) { b = messageset.AppendFieldStart(b, fd.Number()) b = protowire.AppendTag(b, messageset.FieldMessage, protowire.BytesType) - b = protowire.AppendVarint(b, uint64(o.Size(value.Message().Interface()))) + calculatedSize := o.Size(value.Message().Interface()) + b = protowire.AppendVarint(b, uint64(calculatedSize)) + before := len(b) b, err := o.marshalMessage(b, value.Message()) if err != nil { return b, err } + if measuredSize := len(b) - before; calculatedSize != measuredSize { + return nil, errors.MismatchedSizeCalculation(calculatedSize, measuredSize) + } b = messageset.AppendFieldEnd(b) return b, nil } diff --git a/vendor/google.golang.org/protobuf/proto/size.go b/vendor/google.golang.org/protobuf/proto/size.go index f1692b49b6..052fb5ae31 100644 --- a/vendor/google.golang.org/protobuf/proto/size.go +++ b/vendor/google.golang.org/protobuf/proto/size.go @@ -34,6 +34,7 @@ func (o MarshalOptions) size(m protoreflect.Message) (size int) { if methods != nil && methods.Size != nil { out := methods.Size(protoiface.SizeInput{ Message: m, + Flags: o.flags(), }) return out.Size } @@ -42,6 +43,7 @@ func (o MarshalOptions) size(m protoreflect.Message) (size int) { // This case is mainly used for legacy types with a Marshal method. out, _ := methods.Marshal(protoiface.MarshalInput{ Message: m, + Flags: o.flags(), }) return len(out.Buf) } diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go index baa0cc6218..8fbecb4f58 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go @@ -13,6 +13,7 @@ package protodesc import ( + "google.golang.org/protobuf/internal/editionssupport" "google.golang.org/protobuf/internal/errors" "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/internal/pragma" @@ -91,15 +92,17 @@ func (o FileOptions) New(fd *descriptorpb.FileDescriptorProto, r Resolver) (prot switch fd.GetSyntax() { case "proto2", "": f.L1.Syntax = protoreflect.Proto2 + f.L1.Edition = filedesc.EditionProto2 case "proto3": f.L1.Syntax = protoreflect.Proto3 + f.L1.Edition = filedesc.EditionProto3 case "editions": f.L1.Syntax = protoreflect.Editions f.L1.Edition = fromEditionProto(fd.GetEdition()) default: return nil, errors.New("invalid syntax: %q", fd.GetSyntax()) } - if f.L1.Syntax == protoreflect.Editions && (fd.GetEdition() < SupportedEditionsMinimum || fd.GetEdition() > SupportedEditionsMaximum) { + if f.L1.Syntax == protoreflect.Editions && (fd.GetEdition() < editionssupport.Minimum || fd.GetEdition() > editionssupport.Maximum) { return nil, errors.New("use of edition %v not yet supported by the Go Protobuf runtime", fd.GetEdition()) } f.L1.Path = fd.GetName() @@ -114,9 +117,7 @@ func (o FileOptions) New(fd *descriptorpb.FileDescriptorProto, r Resolver) (prot opts = proto.Clone(opts).(*descriptorpb.FileOptions) f.L2.Options = func() protoreflect.ProtoMessage { return opts } } - if f.L1.Syntax == protoreflect.Editions { - initFileDescFromFeatureSet(f, fd.GetOptions().GetFeatures()) - } + initFileDescFromFeatureSet(f, fd.GetOptions().GetFeatures()) f.L2.Imports = make(filedesc.FileImports, len(fd.GetDependency())) for _, i := range fd.GetPublicDependency() { @@ -219,10 +220,10 @@ func (o FileOptions) New(fd *descriptorpb.FileDescriptorProto, r Resolver) (prot if err := validateEnumDeclarations(f.L1.Enums.List, fd.GetEnumType()); err != nil { return nil, err } - if err := validateMessageDeclarations(f.L1.Messages.List, fd.GetMessageType()); err != nil { + if err := validateMessageDeclarations(f, f.L1.Messages.List, fd.GetMessageType()); err != nil { return nil, err } - if err := validateExtensionDeclarations(f.L1.Extensions.List, fd.GetExtension()); err != nil { + if err := validateExtensionDeclarations(f, f.L1.Extensions.List, fd.GetExtension()); err != nil { return nil, err } diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go index b3278163c5..8561755427 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go @@ -69,9 +69,7 @@ func (r descsByName) initMessagesDeclarations(mds []*descriptorpb.DescriptorProt if m.L0, err = r.makeBase(m, parent, md.GetName(), i, sb); err != nil { return nil, err } - if m.Base.L0.ParentFile.Syntax() == protoreflect.Editions { - m.L1.EditionFeatures = mergeEditionFeatures(parent, md.GetOptions().GetFeatures()) - } + m.L1.EditionFeatures = mergeEditionFeatures(parent, md.GetOptions().GetFeatures()) if opts := md.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.MessageOptions) m.L2.Options = func() protoreflect.ProtoMessage { return opts } @@ -146,13 +144,15 @@ func (r descsByName) initFieldsFromDescriptorProto(fds []*descriptorpb.FieldDesc if f.L0, err = r.makeBase(f, parent, fd.GetName(), i, sb); err != nil { return nil, err } + f.L1.EditionFeatures = mergeEditionFeatures(parent, fd.GetOptions().GetFeatures()) f.L1.IsProto3Optional = fd.GetProto3Optional() if opts := fd.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.FieldOptions) f.L1.Options = func() protoreflect.ProtoMessage { return opts } f.L1.IsWeak = opts.GetWeak() - f.L1.HasPacked = opts.Packed != nil - f.L1.IsPacked = opts.GetPacked() + if opts.Packed != nil { + f.L1.EditionFeatures.IsPacked = opts.GetPacked() + } } f.L1.Number = protoreflect.FieldNumber(fd.GetNumber()) f.L1.Cardinality = protoreflect.Cardinality(fd.GetLabel()) @@ -163,32 +163,12 @@ func (r descsByName) initFieldsFromDescriptorProto(fds []*descriptorpb.FieldDesc f.L1.StringName.InitJSON(fd.GetJsonName()) } - if f.Base.L0.ParentFile.Syntax() == protoreflect.Editions { - f.L1.EditionFeatures = mergeEditionFeatures(parent, fd.GetOptions().GetFeatures()) - - if f.L1.EditionFeatures.IsLegacyRequired { - f.L1.Cardinality = protoreflect.Required - } - // We reuse the existing field because the old option `[packed = - // true]` is mutually exclusive with the editions feature. - if canBePacked(fd) { - f.L1.HasPacked = true - f.L1.IsPacked = f.L1.EditionFeatures.IsPacked - } - - // We pretend this option is always explicitly set because the only - // use of HasEnforceUTF8 is to determine whether to use EnforceUTF8 - // or to return the appropriate default. - // When using editions we either parse the option or resolve the - // appropriate default here (instead of later when this option is - // requested from the descriptor). - // In proto2/proto3 syntax HasEnforceUTF8 might be false. - f.L1.HasEnforceUTF8 = true - f.L1.EnforceUTF8 = f.L1.EditionFeatures.IsUTF8Validated + if f.L1.EditionFeatures.IsLegacyRequired { + f.L1.Cardinality = protoreflect.Required + } - if f.L1.Kind == protoreflect.MessageKind && f.L1.EditionFeatures.IsDelimitedEncoded { - f.L1.Kind = protoreflect.GroupKind - } + if f.L1.Kind == protoreflect.MessageKind && f.L1.EditionFeatures.IsDelimitedEncoded { + f.L1.Kind = protoreflect.GroupKind } } return fs, nil @@ -201,12 +181,10 @@ func (r descsByName) initOneofsFromDescriptorProto(ods []*descriptorpb.OneofDesc if o.L0, err = r.makeBase(o, parent, od.GetName(), i, sb); err != nil { return nil, err } + o.L1.EditionFeatures = mergeEditionFeatures(parent, od.GetOptions().GetFeatures()) if opts := od.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.OneofOptions) o.L1.Options = func() protoreflect.ProtoMessage { return opts } - if parent.Syntax() == protoreflect.Editions { - o.L1.EditionFeatures = mergeEditionFeatures(parent, opts.GetFeatures()) - } } } return os, nil @@ -220,10 +198,13 @@ func (r descsByName) initExtensionDeclarations(xds []*descriptorpb.FieldDescript if x.L0, err = r.makeBase(x, parent, xd.GetName(), i, sb); err != nil { return nil, err } + x.L1.EditionFeatures = mergeEditionFeatures(parent, xd.GetOptions().GetFeatures()) if opts := xd.GetOptions(); opts != nil { opts = proto.Clone(opts).(*descriptorpb.FieldOptions) x.L2.Options = func() protoreflect.ProtoMessage { return opts } - x.L2.IsPacked = opts.GetPacked() + if opts.Packed != nil { + x.L1.EditionFeatures.IsPacked = opts.GetPacked() + } } x.L1.Number = protoreflect.FieldNumber(xd.GetNumber()) x.L1.Cardinality = protoreflect.Cardinality(xd.GetLabel()) diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go index 254ca58542..f3cebab29c 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go @@ -46,6 +46,11 @@ func (r *resolver) resolveMessageDependencies(ms []filedesc.Message, mds []*desc if f.L1.Kind, f.L1.Enum, f.L1.Message, err = r.findTarget(f.Kind(), f.Parent().FullName(), partialName(fd.GetTypeName()), f.IsWeak()); err != nil { return errors.New("message field %q cannot resolve type: %v", f.FullName(), err) } + if f.L1.Kind == protoreflect.GroupKind && (f.IsMap() || f.IsMapEntry()) { + // A map field might inherit delimited encoding from a file-wide default feature. + // But maps never actually use delimited encoding. (At least for now...) + f.L1.Kind = protoreflect.MessageKind + } if fd.DefaultValue != nil { v, ev, err := unmarshalDefault(fd.GetDefaultValue(), f, r.allowUnresolvable) if err != nil { diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go index e4dcaf876c..6de31c2ebd 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go @@ -45,11 +45,11 @@ func validateEnumDeclarations(es []filedesc.Enum, eds []*descriptorpb.EnumDescri if allowAlias && !foundAlias { return errors.New("enum %q allows aliases, but none were found", e.FullName()) } - if e.Syntax() == protoreflect.Proto3 { + if !e.IsClosed() { if v := e.Values().Get(0); v.Number() != 0 { - return errors.New("enum %q using proto3 semantics must have zero number for the first value", v.FullName()) + return errors.New("enum %q using open semantics must have zero number for the first value", v.FullName()) } - // Verify that value names in proto3 do not conflict if the + // Verify that value names in open enums do not conflict if the // case-insensitive prefix is removed. // See protoc v3.8.0: src/google/protobuf/descriptor.cc:4991-5055 names := map[string]protoreflect.EnumValueDescriptor{} @@ -58,7 +58,7 @@ func validateEnumDeclarations(es []filedesc.Enum, eds []*descriptorpb.EnumDescri v1 := e.Values().Get(i) s := strs.EnumValueName(strs.TrimEnumPrefix(string(v1.Name()), prefix)) if v2, ok := names[s]; ok && v1.Number() != v2.Number() { - return errors.New("enum %q using proto3 semantics has conflict: %q with %q", e.FullName(), v1.Name(), v2.Name()) + return errors.New("enum %q using open semantics has conflict: %q with %q", e.FullName(), v1.Name(), v2.Name()) } names[s] = v1 } @@ -80,7 +80,9 @@ func validateEnumDeclarations(es []filedesc.Enum, eds []*descriptorpb.EnumDescri return nil } -func validateMessageDeclarations(ms []filedesc.Message, mds []*descriptorpb.DescriptorProto) error { +func validateMessageDeclarations(file *filedesc.File, ms []filedesc.Message, mds []*descriptorpb.DescriptorProto) error { + // There are a few limited exceptions only for proto3 + isProto3 := file.L1.Edition == fromEditionProto(descriptorpb.Edition_EDITION_PROTO3) for i, md := range mds { m := &ms[i] @@ -107,25 +109,13 @@ func validateMessageDeclarations(ms []filedesc.Message, mds []*descriptorpb.Desc if isMessageSet && !flags.ProtoLegacy { return errors.New("message %q is a MessageSet, which is a legacy proto1 feature that is no longer supported", m.FullName()) } - if isMessageSet && (m.Syntax() == protoreflect.Proto3 || m.Fields().Len() > 0 || m.ExtensionRanges().Len() == 0) { + if isMessageSet && (isProto3 || m.Fields().Len() > 0 || m.ExtensionRanges().Len() == 0) { return errors.New("message %q is an invalid proto1 MessageSet", m.FullName()) } - if m.Syntax() == protoreflect.Proto3 { + if isProto3 { if m.ExtensionRanges().Len() > 0 { return errors.New("message %q using proto3 semantics cannot have extension ranges", m.FullName()) } - // Verify that field names in proto3 do not conflict if lowercased - // with all underscores removed. - // See protoc v3.8.0: src/google/protobuf/descriptor.cc:5830-5847 - names := map[string]protoreflect.FieldDescriptor{} - for i := 0; i < m.Fields().Len(); i++ { - f1 := m.Fields().Get(i) - s := strings.Replace(strings.ToLower(string(f1.Name())), "_", "", -1) - if f2, ok := names[s]; ok { - return errors.New("message %q using proto3 semantics has conflict: %q with %q", m.FullName(), f1.Name(), f2.Name()) - } - names[s] = f1 - } } for j, fd := range md.GetField() { @@ -149,7 +139,7 @@ func validateMessageDeclarations(ms []filedesc.Message, mds []*descriptorpb.Desc return errors.New("message field %q may not have extendee: %q", f.FullName(), fd.GetExtendee()) } if f.L1.IsProto3Optional { - if f.Syntax() != protoreflect.Proto3 { + if !isProto3 { return errors.New("message field %q under proto3 optional semantics must be specified in the proto3 syntax", f.FullName()) } if f.Cardinality() != protoreflect.Optional { @@ -162,26 +152,29 @@ func validateMessageDeclarations(ms []filedesc.Message, mds []*descriptorpb.Desc if f.IsWeak() && !flags.ProtoLegacy { return errors.New("message field %q is a weak field, which is a legacy proto1 feature that is no longer supported", f.FullName()) } - if f.IsWeak() && (f.Syntax() != protoreflect.Proto2 || !isOptionalMessage(f) || f.ContainingOneof() != nil) { + if f.IsWeak() && (!f.HasPresence() || !isOptionalMessage(f) || f.ContainingOneof() != nil) { return errors.New("message field %q may only be weak for an optional message", f.FullName()) } if f.IsPacked() && !isPackable(f) { return errors.New("message field %q is not packable", f.FullName()) } - if err := checkValidGroup(f); err != nil { + if err := checkValidGroup(file, f); err != nil { return errors.New("message field %q is an invalid group: %v", f.FullName(), err) } if err := checkValidMap(f); err != nil { return errors.New("message field %q is an invalid map: %v", f.FullName(), err) } - if f.Syntax() == protoreflect.Proto3 { + if isProto3 { if f.Cardinality() == protoreflect.Required { return errors.New("message field %q using proto3 semantics cannot be required", f.FullName()) } - if f.Enum() != nil && !f.Enum().IsPlaceholder() && f.Enum().Syntax() != protoreflect.Proto3 { - return errors.New("message field %q using proto3 semantics may only depend on a proto3 enum", f.FullName()) + if f.Enum() != nil && !f.Enum().IsPlaceholder() && f.Enum().IsClosed() { + return errors.New("message field %q using proto3 semantics may only depend on open enums", f.FullName()) } } + if f.Cardinality() == protoreflect.Optional && !f.HasPresence() && f.Enum() != nil && !f.Enum().IsPlaceholder() && f.Enum().IsClosed() { + return errors.New("message field %q with implicit presence may only use open enums", f.FullName()) + } } seenSynthetic := false // synthetic oneofs for proto3 optional must come after real oneofs for j := range md.GetOneofDecl() { @@ -215,17 +208,17 @@ func validateMessageDeclarations(ms []filedesc.Message, mds []*descriptorpb.Desc if err := validateEnumDeclarations(m.L1.Enums.List, md.GetEnumType()); err != nil { return err } - if err := validateMessageDeclarations(m.L1.Messages.List, md.GetNestedType()); err != nil { + if err := validateMessageDeclarations(file, m.L1.Messages.List, md.GetNestedType()); err != nil { return err } - if err := validateExtensionDeclarations(m.L1.Extensions.List, md.GetExtension()); err != nil { + if err := validateExtensionDeclarations(file, m.L1.Extensions.List, md.GetExtension()); err != nil { return err } } return nil } -func validateExtensionDeclarations(xs []filedesc.Extension, xds []*descriptorpb.FieldDescriptorProto) error { +func validateExtensionDeclarations(f *filedesc.File, xs []filedesc.Extension, xds []*descriptorpb.FieldDescriptorProto) error { for i, xd := range xds { x := &xs[i] // NOTE: Avoid using the IsValid method since extensions to MessageSet @@ -267,13 +260,13 @@ func validateExtensionDeclarations(xs []filedesc.Extension, xds []*descriptorpb. if x.IsPacked() && !isPackable(x) { return errors.New("extension field %q is not packable", x.FullName()) } - if err := checkValidGroup(x); err != nil { + if err := checkValidGroup(f, x); err != nil { return errors.New("extension field %q is an invalid group: %v", x.FullName(), err) } if md := x.Message(); md != nil && md.IsMapEntry() { return errors.New("extension field %q cannot be a map entry", x.FullName()) } - if x.Syntax() == protoreflect.Proto3 { + if f.L1.Edition == fromEditionProto(descriptorpb.Edition_EDITION_PROTO3) { switch x.ContainingMessage().FullName() { case (*descriptorpb.FileOptions)(nil).ProtoReflect().Descriptor().FullName(): case (*descriptorpb.EnumOptions)(nil).ProtoReflect().Descriptor().FullName(): @@ -309,21 +302,25 @@ func isPackable(fd protoreflect.FieldDescriptor) bool { // checkValidGroup reports whether fd is a valid group according to the same // rules that protoc imposes. -func checkValidGroup(fd protoreflect.FieldDescriptor) error { +func checkValidGroup(f *filedesc.File, fd protoreflect.FieldDescriptor) error { md := fd.Message() switch { case fd.Kind() != protoreflect.GroupKind: return nil - case fd.Syntax() == protoreflect.Proto3: + case f.L1.Edition == fromEditionProto(descriptorpb.Edition_EDITION_PROTO3): return errors.New("invalid under proto3 semantics") case md == nil || md.IsPlaceholder(): return errors.New("message must be resolvable") - case fd.FullName().Parent() != md.FullName().Parent(): - return errors.New("message and field must be declared in the same scope") - case !unicode.IsUpper(rune(md.Name()[0])): - return errors.New("message name must start with an uppercase") - case fd.Name() != protoreflect.Name(strings.ToLower(string(md.Name()))): - return errors.New("field name must be lowercased form of the message name") + } + if f.L1.Edition < fromEditionProto(descriptorpb.Edition_EDITION_2023) { + switch { + case fd.FullName().Parent() != md.FullName().Parent(): + return errors.New("message and field must be declared in the same scope") + case !unicode.IsUpper(rune(md.Name()[0])): + return errors.New("message name must start with an uppercase") + case fd.Name() != protoreflect.Name(strings.ToLower(string(md.Name()))): + return errors.New("field name must be lowercased form of the message name") + } } return nil } diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go b/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go index 2a6b29d179..804830eda3 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go @@ -17,11 +17,6 @@ import ( gofeaturespb "google.golang.org/protobuf/types/gofeaturespb" ) -const ( - SupportedEditionsMinimum = descriptorpb.Edition_EDITION_PROTO2 - SupportedEditionsMaximum = descriptorpb.Edition_EDITION_2023 -) - var defaults = &descriptorpb.FeatureSetDefaults{} var defaultsCacheMu sync.Mutex var defaultsCache = make(map[filedesc.Edition]*descriptorpb.FeatureSet) @@ -67,18 +62,20 @@ func getFeatureSetFor(ed filedesc.Edition) *descriptorpb.FeatureSet { fmt.Fprintf(os.Stderr, "internal error: unsupported edition %v (did you forget to update the embedded defaults (i.e. the bootstrap descriptor proto)?)\n", edpb) os.Exit(1) } - fs := defaults.GetDefaults()[0].GetFeatures() + fsed := defaults.GetDefaults()[0] // Using a linear search for now. // Editions are guaranteed to be sorted and thus we could use a binary search. // Given that there are only a handful of editions (with one more per year) // there is not much reason to use a binary search. for _, def := range defaults.GetDefaults() { if def.GetEdition() <= edpb { - fs = def.GetFeatures() + fsed = def } else { break } } + fs := proto.Clone(fsed.GetFixedFeatures()).(*descriptorpb.FeatureSet) + proto.Merge(fs, fsed.GetOverridableFeatures()) defaultsCache[ed] = fs return fs } diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go b/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go index 9d6e05420f..a5de8d4001 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go @@ -73,6 +73,16 @@ func ToFileDescriptorProto(file protoreflect.FileDescriptor) *descriptorpb.FileD if syntax := file.Syntax(); syntax != protoreflect.Proto2 && syntax.IsValid() { p.Syntax = proto.String(file.Syntax().String()) } + if file.Syntax() == protoreflect.Editions { + desc := file + if fileImportDesc, ok := file.(protoreflect.FileImport); ok { + desc = fileImportDesc.FileDescriptor + } + + if editionsInterface, ok := desc.(interface{ Edition() int32 }); ok { + p.Edition = descriptorpb.Edition(editionsInterface.Edition()).Enum() + } + } return p } @@ -153,6 +163,18 @@ func ToFieldDescriptorProto(field protoreflect.FieldDescriptor) *descriptorpb.Fi if field.Syntax() == protoreflect.Proto3 && field.HasOptionalKeyword() { p.Proto3Optional = proto.Bool(true) } + if field.Syntax() == protoreflect.Editions { + // Editions have no group keyword, this type is only set so that downstream users continue + // treating this as delimited encoding. + if p.GetType() == descriptorpb.FieldDescriptorProto_TYPE_GROUP { + p.Type = descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum() + } + // Editions have no required keyword, this label is only set so that downstream users continue + // treating it as required. + if p.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_REQUIRED { + p.Label = descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum() + } + } if field.HasDefault() { def, err := defval.Marshal(field.Default(), field.DefaultEnumValue(), field.Kind(), defval.Descriptor) if err != nil && field.DefaultEnumValue() != nil { diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go index 00b01fbd8c..c85bfaa5bb 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go @@ -161,7 +161,7 @@ const ( // IsValid reports whether the syntax is valid. func (s Syntax) IsValid() bool { switch s { - case Proto2, Proto3: + case Proto2, Proto3, Editions: return true default: return false diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go index 7dcc2ff09e..ea154eec44 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go @@ -373,6 +373,8 @@ func (p *SourcePath) appendFieldOptions(b []byte) []byte { b = p.appendRepeatedField(b, "edition_defaults", (*SourcePath).appendFieldOptions_EditionDefault) case 21: b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) + case 22: + b = p.appendSingularField(b, "feature_support", (*SourcePath).appendFieldOptions_FeatureSupport) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } @@ -483,6 +485,8 @@ func (p *SourcePath) appendEnumValueOptions(b []byte) []byte { b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 3: b = p.appendSingularField(b, "debug_redact", nil) + case 4: + b = p.appendSingularField(b, "feature_support", (*SourcePath).appendFieldOptions_FeatureSupport) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } @@ -519,6 +523,23 @@ func (p *SourcePath) appendFieldOptions_EditionDefault(b []byte) []byte { return b } +func (p *SourcePath) appendFieldOptions_FeatureSupport(b []byte) []byte { + if len(*p) == 0 { + return b + } + switch (*p)[0] { + case 1: + b = p.appendSingularField(b, "edition_introduced", nil) + case 2: + b = p.appendSingularField(b, "edition_deprecated", nil) + case 3: + b = p.appendSingularField(b, "deprecation_warning", nil) + case 4: + b = p.appendSingularField(b, "edition_removed", nil) + } + return b +} + func (p *SourcePath) appendUninterpretedOption_NamePart(b []byte) []byte { if len(*p) == 0 { return b diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go index 60ff62b4c8..cd8fadbaf8 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go @@ -510,7 +510,7 @@ type ExtensionType interface { // // ValueOf is more extensive than protoreflect.ValueOf for a given field's // value as it has more type information available. - ValueOf(interface{}) Value + ValueOf(any) Value // InterfaceOf completely unwraps the Value to the underlying Go type. // InterfaceOf panics if the input is nil or does not represent the @@ -519,13 +519,13 @@ type ExtensionType interface { // // InterfaceOf is able to unwrap the Value further than Value.Interface // as it has more type information available. - InterfaceOf(Value) interface{} + InterfaceOf(Value) any // IsValidValue reports whether the Value is valid to assign to the field. IsValidValue(Value) bool // IsValidInterface reports whether the input is valid to assign to the field. - IsValidInterface(interface{}) bool + IsValidInterface(any) bool } // EnumDescriptor describes an enum and @@ -544,6 +544,12 @@ type EnumDescriptor interface { // ReservedRanges is a list of reserved ranges of enum numbers. ReservedRanges() EnumRanges + // IsClosed reports whether this enum uses closed semantics. + // See https://protobuf.dev/programming-guides/enum/#definitions. + // Note: the Go protobuf implementation is not spec compliant and treats + // all enums as open enums. + IsClosed() bool + isEnumDescriptor } type isEnumDescriptor interface{ ProtoType(EnumDescriptor) } diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go index 7ced876f4e..75f83a2af0 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go @@ -32,11 +32,11 @@ const ( type value struct { pragma.DoNotCompare // 0B - typ valueType // 8B - num uint64 // 8B - str string // 16B - bin []byte // 24B - iface interface{} // 16B + typ valueType // 8B + num uint64 // 8B + str string // 16B + bin []byte // 24B + iface any // 16B } func valueOfString(v string) Value { @@ -45,7 +45,7 @@ func valueOfString(v string) Value { func valueOfBytes(v []byte) Value { return Value{typ: bytesType, bin: v} } -func valueOfIface(v interface{}) Value { +func valueOfIface(v any) Value { return Value{typ: ifaceType, iface: v} } @@ -55,6 +55,6 @@ func (v Value) getString() string { func (v Value) getBytes() []byte { return v.bin } -func (v Value) getIface() interface{} { +func (v Value) getIface() any { return v.iface } diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go index 1603097311..9fe83cef5a 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go @@ -69,8 +69,8 @@ import ( // composite Value. Modifying an empty, read-only value panics. type Value value -// The protoreflect API uses a custom Value union type instead of interface{} -// to keep the future open for performance optimizations. Using an interface{} +// The protoreflect API uses a custom Value union type instead of any +// to keep the future open for performance optimizations. Using an any // always incurs an allocation for primitives (e.g., int64) since it needs to // be boxed on the heap (as interfaces can only contain pointers natively). // Instead, we represent the Value union as a flat struct that internally keeps @@ -85,7 +85,7 @@ type Value value // ValueOf returns a Value initialized with the concrete value stored in v. // This panics if the type does not match one of the allowed types in the // Value union. -func ValueOf(v interface{}) Value { +func ValueOf(v any) Value { switch v := v.(type) { case nil: return Value{} @@ -192,10 +192,10 @@ func (v Value) IsValid() bool { return v.typ != nilType } -// Interface returns v as an interface{}. +// Interface returns v as an any. // // Invariant: v == ValueOf(v).Interface() -func (v Value) Interface() interface{} { +func (v Value) Interface() any { switch v.typ { case nilType: return nil @@ -406,8 +406,8 @@ func (k MapKey) IsValid() bool { return Value(k).IsValid() } -// Interface returns k as an interface{}. -func (k MapKey) Interface() interface{} { +// Interface returns k as an any. +func (k MapKey) Interface() any { return Value(k).Interface() } diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go index b1fdbe3e8e..7f3583ead8 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go @@ -45,7 +45,7 @@ var ( // typeOf returns a pointer to the Go type information. // The pointer is comparable and equal if and only if the types are identical. -func typeOf(t interface{}) unsafe.Pointer { +func typeOf(t any) unsafe.Pointer { return (*ifaceHeader)(unsafe.Pointer(&t)).Type } @@ -80,7 +80,7 @@ func valueOfBytes(v []byte) Value { p := (*sliceHeader)(unsafe.Pointer(&v)) return Value{typ: bytesType, ptr: p.Data, num: uint64(len(v))} } -func valueOfIface(v interface{}) Value { +func valueOfIface(v any) Value { p := (*ifaceHeader)(unsafe.Pointer(&v)) return Value{typ: p.Type, ptr: p.Data} } @@ -93,7 +93,7 @@ func (v Value) getBytes() (x []byte) { *(*sliceHeader)(unsafe.Pointer(&x)) = sliceHeader{Data: v.ptr, Len: int(v.num), Cap: int(v.num)} return x } -func (v Value) getIface() (x interface{}) { +func (v Value) getIface() (x any) { *(*ifaceHeader)(unsafe.Pointer(&x)) = ifaceHeader{Type: v.typ, Data: v.ptr} return x } diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go index 4354701117..f7d386990a 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go @@ -15,7 +15,7 @@ import ( type ( ifaceHeader struct { - _ [0]interface{} // if interfaces have greater alignment than unsafe.Pointer, this will enforce it. + _ [0]any // if interfaces have greater alignment than unsafe.Pointer, this will enforce it. Type unsafe.Pointer Data unsafe.Pointer } @@ -37,7 +37,7 @@ var ( // typeOf returns a pointer to the Go type information. // The pointer is comparable and equal if and only if the types are identical. -func typeOf(t interface{}) unsafe.Pointer { +func typeOf(t any) unsafe.Pointer { return (*ifaceHeader)(unsafe.Pointer(&t)).Type } @@ -70,7 +70,7 @@ func valueOfString(v string) Value { func valueOfBytes(v []byte) Value { return Value{typ: bytesType, ptr: unsafe.Pointer(unsafe.SliceData(v)), num: uint64(len(v))} } -func valueOfIface(v interface{}) Value { +func valueOfIface(v any) Value { p := (*ifaceHeader)(unsafe.Pointer(&v)) return Value{typ: p.Type, ptr: p.Data} } @@ -81,7 +81,7 @@ func (v Value) getString() string { func (v Value) getBytes() []byte { return unsafe.Slice((*byte)(v.ptr), v.num) } -func (v Value) getIface() (x interface{}) { +func (v Value) getIface() (x any) { *(*ifaceHeader)(unsafe.Pointer(&x)) = ifaceHeader{Type: v.typ, Data: v.ptr} return x } diff --git a/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go b/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go index 6267dc52a6..de17773391 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go +++ b/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go @@ -95,7 +95,7 @@ type Files struct { // multiple files. Only top-level declarations are registered. // Note that enum values are in the top-level since that are in the same // scope as the parent enum. - descsByName map[protoreflect.FullName]interface{} + descsByName map[protoreflect.FullName]any filesByPath map[string][]protoreflect.FileDescriptor numFiles int } @@ -117,7 +117,7 @@ func (r *Files) RegisterFile(file protoreflect.FileDescriptor) error { defer globalMutex.Unlock() } if r.descsByName == nil { - r.descsByName = map[protoreflect.FullName]interface{}{ + r.descsByName = map[protoreflect.FullName]any{ "": &packageDescriptor{}, } r.filesByPath = make(map[string][]protoreflect.FileDescriptor) @@ -485,7 +485,7 @@ type Types struct { } type ( - typesByName map[protoreflect.FullName]interface{} + typesByName map[protoreflect.FullName]any extensionsByMessage map[protoreflect.FullName]extensionsByNumber extensionsByNumber map[protoreflect.FieldNumber]protoreflect.ExtensionType ) @@ -570,7 +570,7 @@ func (r *Types) RegisterExtension(xt protoreflect.ExtensionType) error { return nil } -func (r *Types) register(kind string, desc protoreflect.Descriptor, typ interface{}) error { +func (r *Types) register(kind string, desc protoreflect.Descriptor, typ any) error { name := desc.FullName() prev := r.typesByName[name] if prev != nil { @@ -841,7 +841,7 @@ func (r *Types) RangeExtensionsByMessage(message protoreflect.FullName, f func(p } } -func typeName(t interface{}) string { +func typeName(t any) string { switch t.(type) { case protoreflect.EnumType: return "enum" @@ -854,7 +854,7 @@ func typeName(t interface{}) string { } } -func amendErrorWithCaller(err error, prev, curr interface{}) error { +func amendErrorWithCaller(err error, prev, curr any) error { prevPkg := goPackage(prev) currPkg := goPackage(curr) if prevPkg == "" || currPkg == "" || prevPkg == currPkg { @@ -863,7 +863,7 @@ func amendErrorWithCaller(err error, prev, curr interface{}) error { return errors.New("%s\n\tpreviously from: %q\n\tcurrently from: %q", err, prevPkg, currPkg) } -func goPackage(v interface{}) string { +func goPackage(v any) string { switch d := v.(type) { case protoreflect.EnumType: v = d.Descriptor() diff --git a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go index 78624cf60b..9403eb0750 100644 --- a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go +++ b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go @@ -54,6 +54,9 @@ type Edition int32 const ( // A placeholder for an unknown edition value. Edition_EDITION_UNKNOWN Edition = 0 + // A placeholder edition for specifying default behaviors *before* a feature + // was first introduced. This is effectively an "infinite past". + Edition_EDITION_LEGACY Edition = 900 // Legacy syntax "editions". These pre-date editions, but behave much like // distinct editions. These can't be used to specify the edition of proto // files, but feature definitions must supply proto2/proto3 defaults for @@ -82,6 +85,7 @@ const ( var ( Edition_name = map[int32]string{ 0: "EDITION_UNKNOWN", + 900: "EDITION_LEGACY", 998: "EDITION_PROTO2", 999: "EDITION_PROTO3", 1000: "EDITION_2023", @@ -95,6 +99,7 @@ var ( } Edition_value = map[string]int32{ "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, "EDITION_PROTO2": 998, "EDITION_PROTO3": 999, "EDITION_2023": 1000, @@ -2177,12 +2182,16 @@ type FileOptions struct { // // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. JavaGenerateEqualsAndHash *bool `protobuf:"varint,20,opt,name=java_generate_equals_and_hash,json=javaGenerateEqualsAndHash" json:"java_generate_equals_and_hash,omitempty"` - // If set true, then the Java2 code generator will generate code that - // throws an exception whenever an attempt is made to assign a non-UTF-8 - // byte sequence to a string field. - // Message reflection will do the same. - // However, an extension field still accepts non-UTF-8 byte sequences. - // This option has no effect on when used with the lite runtime. + // A proto2 file can set this to true to opt in to UTF-8 checking for Java, + // which will throw an exception if invalid UTF-8 is parsed from the wire or + // assigned to a string field. + // + // TODO: clarify exactly what kinds of field types this option + // applies to, and update these docs accordingly. + // + // Proto3 files already perform these checks. Setting the option explicitly to + // false has no effect: it cannot be used to opt proto3 files out of UTF-8 + // checks. JavaStringCheckUtf8 *bool `protobuf:"varint,27,opt,name=java_string_check_utf8,json=javaStringCheckUtf8,def=0" json:"java_string_check_utf8,omitempty"` OptimizeFor *FileOptions_OptimizeMode `protobuf:"varint,9,opt,name=optimize_for,json=optimizeFor,enum=google.protobuf.FileOptions_OptimizeMode,def=1" json:"optimize_for,omitempty"` // Sets the Go package where structs generated from this .proto will be @@ -2679,7 +2688,8 @@ type FieldOptions struct { Targets []FieldOptions_OptionTargetType `protobuf:"varint,19,rep,name=targets,enum=google.protobuf.FieldOptions_OptionTargetType" json:"targets,omitempty"` EditionDefaults []*FieldOptions_EditionDefault `protobuf:"bytes,20,rep,name=edition_defaults,json=editionDefaults" json:"edition_defaults,omitempty"` // Any features defined in the specific edition. - Features *FeatureSet `protobuf:"bytes,21,opt,name=features" json:"features,omitempty"` + Features *FeatureSet `protobuf:"bytes,21,opt,name=features" json:"features,omitempty"` + FeatureSupport *FieldOptions_FeatureSupport `protobuf:"bytes,22,opt,name=feature_support,json=featureSupport" json:"feature_support,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } @@ -2811,6 +2821,13 @@ func (x *FieldOptions) GetFeatures() *FeatureSet { return nil } +func (x *FieldOptions) GetFeatureSupport() *FieldOptions_FeatureSupport { + if x != nil { + return x.FeatureSupport + } + return nil +} + func (x *FieldOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -2995,6 +3012,8 @@ type EnumValueOptions struct { // out when using debug formats, e.g. when the field contains sensitive // credentials. DebugRedact *bool `protobuf:"varint,3,opt,name=debug_redact,json=debugRedact,def=0" json:"debug_redact,omitempty"` + // Information about the support window of a feature value. + FeatureSupport *FieldOptions_FeatureSupport `protobuf:"bytes,4,opt,name=feature_support,json=featureSupport" json:"feature_support,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } @@ -3058,6 +3077,13 @@ func (x *EnumValueOptions) GetDebugRedact() bool { return Default_EnumValueOptions_DebugRedact } +func (x *EnumValueOptions) GetFeatureSupport() *FieldOptions_FeatureSupport { + if x != nil { + return x.FeatureSupport + } + return nil +} + func (x *EnumValueOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -3968,6 +3994,88 @@ func (x *FieldOptions_EditionDefault) GetValue() string { return "" } +// Information about the support window of a feature. +type FieldOptions_FeatureSupport struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The edition that this feature was first available in. In editions + // earlier than this one, the default assigned to EDITION_LEGACY will be + // used, and proto files will not be able to override it. + EditionIntroduced *Edition `protobuf:"varint,1,opt,name=edition_introduced,json=editionIntroduced,enum=google.protobuf.Edition" json:"edition_introduced,omitempty"` + // The edition this feature becomes deprecated in. Using this after this + // edition may trigger warnings. + EditionDeprecated *Edition `protobuf:"varint,2,opt,name=edition_deprecated,json=editionDeprecated,enum=google.protobuf.Edition" json:"edition_deprecated,omitempty"` + // The deprecation warning text if this feature is used after the edition it + // was marked deprecated in. + DeprecationWarning *string `protobuf:"bytes,3,opt,name=deprecation_warning,json=deprecationWarning" json:"deprecation_warning,omitempty"` + // The edition this feature is no longer available in. In editions after + // this one, the last default assigned will be used, and proto files will + // not be able to override it. + EditionRemoved *Edition `protobuf:"varint,4,opt,name=edition_removed,json=editionRemoved,enum=google.protobuf.Edition" json:"edition_removed,omitempty"` +} + +func (x *FieldOptions_FeatureSupport) Reset() { + *x = FieldOptions_FeatureSupport{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_descriptor_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FieldOptions_FeatureSupport) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldOptions_FeatureSupport) ProtoMessage() {} + +func (x *FieldOptions_FeatureSupport) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_descriptor_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FieldOptions_FeatureSupport.ProtoReflect.Descriptor instead. +func (*FieldOptions_FeatureSupport) Descriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{12, 1} +} + +func (x *FieldOptions_FeatureSupport) GetEditionIntroduced() Edition { + if x != nil && x.EditionIntroduced != nil { + return *x.EditionIntroduced + } + return Edition_EDITION_UNKNOWN +} + +func (x *FieldOptions_FeatureSupport) GetEditionDeprecated() Edition { + if x != nil && x.EditionDeprecated != nil { + return *x.EditionDeprecated + } + return Edition_EDITION_UNKNOWN +} + +func (x *FieldOptions_FeatureSupport) GetDeprecationWarning() string { + if x != nil && x.DeprecationWarning != nil { + return *x.DeprecationWarning + } + return "" +} + +func (x *FieldOptions_FeatureSupport) GetEditionRemoved() Edition { + if x != nil && x.EditionRemoved != nil { + return *x.EditionRemoved + } + return Edition_EDITION_UNKNOWN +} + // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). @@ -3985,7 +4093,7 @@ type UninterpretedOption_NamePart struct { func (x *UninterpretedOption_NamePart) Reset() { *x = UninterpretedOption_NamePart{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[28] + mi := &file_google_protobuf_descriptor_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3998,7 +4106,7 @@ func (x *UninterpretedOption_NamePart) String() string { func (*UninterpretedOption_NamePart) ProtoMessage() {} func (x *UninterpretedOption_NamePart) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[28] + mi := &file_google_protobuf_descriptor_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4037,14 +4145,17 @@ type FeatureSetDefaults_FeatureSetEditionDefault struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Edition *Edition `protobuf:"varint,3,opt,name=edition,enum=google.protobuf.Edition" json:"edition,omitempty"` - Features *FeatureSet `protobuf:"bytes,2,opt,name=features" json:"features,omitempty"` + Edition *Edition `protobuf:"varint,3,opt,name=edition,enum=google.protobuf.Edition" json:"edition,omitempty"` + // Defaults of features that can be overridden in this edition. + OverridableFeatures *FeatureSet `protobuf:"bytes,4,opt,name=overridable_features,json=overridableFeatures" json:"overridable_features,omitempty"` + // Defaults of features that can't be overridden in this edition. + FixedFeatures *FeatureSet `protobuf:"bytes,5,opt,name=fixed_features,json=fixedFeatures" json:"fixed_features,omitempty"` } func (x *FeatureSetDefaults_FeatureSetEditionDefault) Reset() { *x = FeatureSetDefaults_FeatureSetEditionDefault{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[29] + mi := &file_google_protobuf_descriptor_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4057,7 +4168,7 @@ func (x *FeatureSetDefaults_FeatureSetEditionDefault) String() string { func (*FeatureSetDefaults_FeatureSetEditionDefault) ProtoMessage() {} func (x *FeatureSetDefaults_FeatureSetEditionDefault) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[29] + mi := &file_google_protobuf_descriptor_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4080,9 +4191,16 @@ func (x *FeatureSetDefaults_FeatureSetEditionDefault) GetEdition() Edition { return Edition_EDITION_UNKNOWN } -func (x *FeatureSetDefaults_FeatureSetEditionDefault) GetFeatures() *FeatureSet { +func (x *FeatureSetDefaults_FeatureSetEditionDefault) GetOverridableFeatures() *FeatureSet { if x != nil { - return x.Features + return x.OverridableFeatures + } + return nil +} + +func (x *FeatureSetDefaults_FeatureSetEditionDefault) GetFixedFeatures() *FeatureSet { + if x != nil { + return x.FixedFeatures } return nil } @@ -4188,7 +4306,7 @@ type SourceCodeInfo_Location struct { func (x *SourceCodeInfo_Location) Reset() { *x = SourceCodeInfo_Location{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[30] + mi := &file_google_protobuf_descriptor_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4201,7 +4319,7 @@ func (x *SourceCodeInfo_Location) String() string { func (*SourceCodeInfo_Location) ProtoMessage() {} func (x *SourceCodeInfo_Location) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[30] + mi := &file_google_protobuf_descriptor_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4275,7 +4393,7 @@ type GeneratedCodeInfo_Annotation struct { func (x *GeneratedCodeInfo_Annotation) Reset() { *x = GeneratedCodeInfo_Annotation{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[31] + mi := &file_google_protobuf_descriptor_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4288,7 +4406,7 @@ func (x *GeneratedCodeInfo_Annotation) String() string { func (*GeneratedCodeInfo_Annotation) ProtoMessage() {} func (x *GeneratedCodeInfo_Annotation) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[31] + mi := &file_google_protobuf_descriptor_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4597,7 +4715,7 @@ var file_google_protobuf_descriptor_proto_rawDesc = []byte{ 0x67, 0x12, 0x30, 0x0a, 0x10, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x69, 0x6e, 0x67, 0x22, 0x97, 0x09, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x69, 0x6e, 0x67, 0x22, 0xad, 0x09, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6a, 0x61, 0x76, 0x61, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, @@ -4670,405 +4788,445 @@ var file_google_protobuf_descriptor_proto_rawDesc = []byte{ 0x45, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x4c, 0x49, 0x54, 0x45, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x03, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, - 0x02, 0x4a, 0x04, 0x08, 0x2a, 0x10, 0x2b, 0x4a, 0x04, 0x08, 0x26, 0x10, 0x27, 0x22, 0xf4, 0x03, - 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x3c, 0x0a, 0x17, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x5f, - 0x77, 0x69, 0x72, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x14, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x53, 0x65, 0x74, 0x57, 0x69, 0x72, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x4c, - 0x0a, 0x1f, 0x6e, 0x6f, 0x5f, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x5f, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x1c, - 0x6e, 0x6f, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x0a, - 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, - 0x74, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x56, 0x0a, 0x26, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, - 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, - 0x42, 0x02, 0x18, 0x01, 0x52, 0x22, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, - 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x43, - 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, - 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, - 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, - 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, - 0x10, 0x06, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x4a, 0x04, - 0x08, 0x09, 0x10, 0x0a, 0x22, 0xad, 0x0a, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x0a, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, - 0x47, 0x52, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x63, 0x6b, - 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, - 0x12, 0x47, 0x0a, 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x4a, 0x53, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, - 0x4c, 0x52, 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x04, 0x6c, 0x61, 0x7a, - 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x04, - 0x6c, 0x61, 0x7a, 0x79, 0x12, 0x2e, 0x0a, 0x0f, 0x75, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x65, 0x64, 0x5f, 0x6c, 0x61, 0x7a, 0x79, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, - 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0e, 0x75, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, - 0x4c, 0x61, 0x7a, 0x79, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, - 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, - 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x04, 0x77, - 0x65, 0x61, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, - 0x52, 0x04, 0x77, 0x65, 0x61, 0x6b, 0x12, 0x28, 0x0a, 0x0c, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, - 0x72, 0x65, 0x64, 0x61, 0x63, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, - 0x6c, 0x73, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x64, 0x61, 0x63, 0x74, - 0x12, 0x4b, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, - 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2e, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x57, 0x0a, 0x10, 0x65, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, - 0x0f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, - 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x15, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, - 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, - 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x1a, 0x5a, 0x0a, 0x0e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0x2f, 0x0a, 0x05, 0x43, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, - 0x4e, 0x47, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, 0x52, 0x44, 0x10, 0x01, 0x12, 0x10, - 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x49, 0x45, 0x43, 0x45, 0x10, 0x02, - 0x22, 0x35, 0x0a, 0x06, 0x4a, 0x53, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, - 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, - 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, - 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x02, 0x22, 0x55, 0x0a, 0x0f, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, - 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, - 0x00, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, - 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x45, 0x54, 0x45, - 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x02, 0x22, 0x8c, - 0x02, 0x0a, 0x10, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, - 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, - 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x4e, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x41, 0x4e, 0x47, - 0x45, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, - 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, - 0x44, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x10, 0x05, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, - 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x06, - 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, - 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, - 0x49, 0x43, 0x45, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x10, 0x09, 0x2a, 0x09, 0x08, - 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, - 0x08, 0x12, 0x10, 0x13, 0x22, 0xac, 0x01, 0x0a, 0x0c, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, - 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, - 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, - 0x80, 0x80, 0x02, 0x22, 0xd1, 0x02, 0x0a, 0x0b, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x61, 0x6c, 0x69, - 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, - 0x6c, 0x69, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, - 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, - 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x56, 0x0a, 0x26, 0x64, - 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, - 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, - 0x6c, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, - 0x22, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x4c, 0x65, 0x67, 0x61, 0x63, - 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x6c, 0x69, - 0x63, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, - 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, - 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, + 0x02, 0x4a, 0x04, 0x08, 0x2a, 0x10, 0x2b, 0x4a, 0x04, 0x08, 0x26, 0x10, 0x27, 0x52, 0x14, 0x70, + 0x68, 0x70, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x22, 0xf4, 0x03, 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3c, 0x0a, 0x17, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x77, 0x69, 0x72, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x14, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x57, 0x69, 0x72, 0x65, 0x46, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x12, 0x4c, 0x0a, 0x1f, 0x6e, 0x6f, 0x5f, 0x73, 0x74, 0x61, 0x6e, 0x64, + 0x61, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, + 0x61, 0x6c, 0x73, 0x65, 0x52, 0x1c, 0x6e, 0x6f, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, + 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x70, + 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x61, + 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x56, 0x0a, 0x26, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, + 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x22, 0x64, 0x65, 0x70, 0x72, + 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x4a, 0x73, 0x6f, 0x6e, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x12, 0x37, + 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, - 0x02, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0x81, 0x02, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, - 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, - 0x74, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, - 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x0c, - 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, 0x64, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x04, + 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x4a, 0x04, + 0x08, 0x08, 0x10, 0x09, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, 0x22, 0x9d, 0x0d, 0x0a, 0x0c, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x0a, 0x05, 0x63, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x54, 0x79, 0x70, 0x65, 0x3a, + 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x52, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x47, 0x0a, 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4a, 0x53, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x09, 0x4a, 0x53, + 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x52, 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x19, 0x0a, 0x04, 0x6c, 0x61, 0x7a, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, + 0x61, 0x6c, 0x73, 0x65, 0x52, 0x04, 0x6c, 0x61, 0x7a, 0x79, 0x12, 0x2e, 0x0a, 0x0f, 0x75, 0x6e, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x6c, 0x61, 0x7a, 0x79, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0e, 0x75, 0x6e, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x4c, 0x61, 0x7a, 0x79, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, + 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, + 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, + 0x64, 0x12, 0x19, 0x0a, 0x04, 0x77, 0x65, 0x61, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x3a, + 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x04, 0x77, 0x65, 0x61, 0x6b, 0x12, 0x28, 0x0a, 0x0c, + 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, 0x64, 0x61, 0x63, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x62, 0x75, 0x67, - 0x52, 0x65, 0x64, 0x61, 0x63, 0x74, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, + 0x52, 0x65, 0x64, 0x61, 0x63, 0x74, 0x12, 0x4b, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x13, + 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x57, 0x0a, + 0x10, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, + 0x55, 0x0a, 0x0f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, + 0x72, 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, + 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x0e, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, + 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0xd5, 0x01, 0x0a, 0x0e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x37, - 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, - 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, - 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, - 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x58, - 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x1a, 0x5a, 0x0a, 0x0e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x65, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x96, 0x02, 0x0a, + 0x0e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x12, + 0x47, 0x0a, 0x12, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, + 0x64, 0x75, 0x63, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, + 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x12, 0x47, 0x0a, 0x12, 0x65, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, + 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, + 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, + 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x61, 0x72, 0x6e, 0x69, + 0x6e, 0x67, 0x12, 0x41, 0x0a, 0x0f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x22, 0x2f, 0x0a, 0x05, 0x43, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, + 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, + 0x52, 0x44, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x50, + 0x49, 0x45, 0x43, 0x45, 0x10, 0x02, 0x22, 0x35, 0x0a, 0x06, 0x4a, 0x53, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, + 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0d, + 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x02, 0x22, 0x55, 0x0a, + 0x0f, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, + 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, 0x54, 0x45, 0x4e, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x14, + 0x0a, 0x10, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, + 0x43, 0x45, 0x10, 0x02, 0x22, 0x8c, 0x02, 0x0a, 0x10, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, + 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, + 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x54, 0x41, 0x52, 0x47, + 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x4e, 0x53, 0x49, 0x4f, + 0x4e, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, + 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, + 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, 0x52, + 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x10, 0x05, + 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x06, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, + 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x54, + 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, + 0x44, 0x10, 0x09, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, + 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x12, 0x10, 0x13, 0x22, 0xac, 0x01, 0x0a, 0x0c, 0x4f, + 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, - 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, - 0x80, 0x80, 0x02, 0x22, 0x99, 0x03, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, - 0x74, 0x65, 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, - 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x71, 0x0a, 0x11, - 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, - 0x6c, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, - 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x3a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, - 0x54, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x52, 0x10, 0x69, - 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, - 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x23, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, - 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, - 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x50, 0x0a, 0x10, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, - 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x17, 0x0a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, - 0x54, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, - 0x13, 0x0a, 0x0f, 0x4e, 0x4f, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x45, 0x46, 0x46, 0x45, 0x43, - 0x54, 0x53, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, - 0x4e, 0x54, 0x10, 0x02, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, - 0x9a, 0x03, 0x0a, 0x13, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, - 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, - 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4e, 0x61, 0x6d, 0x65, - 0x50, 0x61, 0x72, 0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x10, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, - 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x10, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x1a, 0x4a, 0x0a, 0x08, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, - 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, - 0x08, 0x6e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x02, 0x28, 0x08, 0x52, - 0x0b, 0x69, 0x73, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8c, 0x0a, 0x0a, - 0x0a, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x12, 0x8b, 0x01, 0x0a, 0x0e, - 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, - 0x74, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x42, - 0x39, 0x88, 0x01, 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, - 0x58, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x49, - 0x4d, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x18, 0xe7, 0x07, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, - 0x58, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x18, 0xe8, 0x07, 0x52, 0x0d, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x66, 0x0a, 0x09, 0x65, 0x6e, 0x75, - 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, + 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, + 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, + 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0xd1, 0x02, 0x0a, 0x0b, 0x45, 0x6e, + 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, + 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, + 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, + 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, + 0x64, 0x12, 0x56, 0x0a, 0x26, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x22, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, + 0x64, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x43, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, + 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, + 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, + 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0xd8, 0x02, + 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, + 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x12, 0x28, 0x0a, 0x0c, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, 0x64, 0x61, + 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, + 0x0b, 0x64, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x64, 0x61, 0x63, 0x74, 0x12, 0x55, 0x0a, 0x0f, + 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x75, 0x70, 0x70, + 0x6f, 0x72, 0x74, 0x52, 0x0e, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x75, 0x70, 0x70, + 0x6f, 0x72, 0x74, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, + 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, + 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, + 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0xd5, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, + 0x65, 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, + 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x58, 0x0a, 0x14, 0x75, + 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, + 0x22, 0x99, 0x03, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, + 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, + 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x71, 0x0a, 0x11, 0x69, 0x64, 0x65, + 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x22, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x3a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, 0x4e, + 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x52, 0x10, 0x69, 0x64, 0x65, 0x6d, + 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x37, 0x0a, 0x08, + 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x23, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, + 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x50, 0x0a, 0x10, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x12, 0x17, 0x0a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, 0x4e, + 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, + 0x4e, 0x4f, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x45, 0x46, 0x46, 0x45, 0x43, 0x54, 0x53, 0x10, + 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, 0x4e, 0x54, 0x10, + 0x02, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0x9a, 0x03, 0x0a, + 0x13, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, + 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, + 0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, + 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x74, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6e, 0x65, + 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x4a, 0x0a, + 0x08, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x61, 0x6d, + 0x65, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x61, + 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x02, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, + 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xa7, 0x0a, 0x0a, 0x0a, 0x46, 0x65, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x12, 0x91, 0x01, 0x0a, 0x0e, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x3f, 0x88, 0x01, + 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, 0x58, 0x50, 0x4c, + 0x49, 0x43, 0x49, 0x54, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x49, 0x4d, 0x50, 0x4c, + 0x49, 0x43, 0x49, 0x54, 0x18, 0xe7, 0x07, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, 0x58, 0x50, 0x4c, + 0x49, 0x43, 0x49, 0x54, 0x18, 0xe8, 0x07, 0xb2, 0x01, 0x03, 0x08, 0xe8, 0x07, 0x52, 0x0d, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x6c, 0x0a, 0x09, + 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x75, + 0x6d, 0x54, 0x79, 0x70, 0x65, 0x42, 0x29, 0x88, 0x01, 0x01, 0x98, 0x01, 0x06, 0x98, 0x01, 0x01, + 0xa2, 0x01, 0x0b, 0x12, 0x06, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x18, 0xe6, 0x07, 0xa2, 0x01, + 0x09, 0x12, 0x04, 0x4f, 0x50, 0x45, 0x4e, 0x18, 0xe7, 0x07, 0xb2, 0x01, 0x03, 0x08, 0xe8, 0x07, + 0x52, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x98, 0x01, 0x0a, 0x17, 0x72, + 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x65, 0x6e, + 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x54, 0x79, - 0x70, 0x65, 0x42, 0x23, 0x88, 0x01, 0x01, 0x98, 0x01, 0x06, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x0b, - 0x12, 0x06, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x09, 0x12, 0x04, - 0x4f, 0x50, 0x45, 0x4e, 0x18, 0xe7, 0x07, 0x52, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x92, 0x01, 0x0a, 0x17, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, - 0x2e, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, - 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x27, 0x88, 0x01, 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, - 0x01, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, 0x58, 0x50, 0x41, 0x4e, 0x44, 0x45, 0x44, 0x18, 0xe6, - 0x07, 0xa2, 0x01, 0x0b, 0x12, 0x06, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x44, 0x18, 0xe7, 0x07, 0x52, - 0x15, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, - 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x78, 0x0a, 0x0f, 0x75, 0x74, 0x66, 0x38, 0x5f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x55, 0x74, 0x66, - 0x38, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x23, 0x88, 0x01, 0x01, - 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x09, 0x12, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x18, - 0xe6, 0x07, 0xa2, 0x01, 0x0b, 0x12, 0x06, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x18, 0xe7, 0x07, - 0x52, 0x0e, 0x75, 0x74, 0x66, 0x38, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x78, 0x0a, 0x10, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x6f, - 0x64, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, - 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x20, 0x88, 0x01, 0x01, 0x98, 0x01, 0x04, 0x98, - 0x01, 0x01, 0xa2, 0x01, 0x14, 0x12, 0x0f, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x5f, 0x50, 0x52, - 0x45, 0x46, 0x49, 0x58, 0x45, 0x44, 0x18, 0xe6, 0x07, 0x52, 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x7c, 0x0a, 0x0b, 0x6a, 0x73, - 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x4a, 0x73, 0x6f, - 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x42, 0x33, 0x88, 0x01, 0x01, 0x98, 0x01, 0x03, 0x98, - 0x01, 0x06, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x17, 0x12, 0x12, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, - 0x5f, 0x42, 0x45, 0x53, 0x54, 0x5f, 0x45, 0x46, 0x46, 0x4f, 0x52, 0x54, 0x18, 0xe6, 0x07, 0xa2, - 0x01, 0x0a, 0x12, 0x05, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x18, 0xe7, 0x07, 0x52, 0x0a, 0x6a, 0x73, - 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0x5c, 0x0a, 0x0d, 0x46, 0x69, 0x65, 0x6c, - 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x46, 0x49, 0x45, - 0x4c, 0x44, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, - 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, 0x4c, 0x49, 0x43, 0x49, - 0x54, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x10, - 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, - 0x49, 0x52, 0x45, 0x44, 0x10, 0x03, 0x22, 0x37, 0x0a, 0x08, 0x45, 0x6e, 0x75, 0x6d, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x50, 0x45, - 0x4e, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x10, 0x02, 0x22, - 0x56, 0x0a, 0x15, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x0a, 0x1f, 0x52, 0x45, 0x50, 0x45, - 0x41, 0x54, 0x45, 0x44, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, - 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, - 0x06, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, - 0x41, 0x4e, 0x44, 0x45, 0x44, 0x10, 0x02, 0x22, 0x43, 0x0a, 0x0e, 0x55, 0x74, 0x66, 0x38, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x55, 0x54, 0x46, - 0x38, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, - 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, - 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x03, 0x22, 0x53, 0x0a, 0x0f, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, - 0x1c, 0x0a, 0x18, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, - 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, - 0x0f, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x45, 0x44, - 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x10, - 0x02, 0x22, 0x48, 0x0a, 0x0a, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, - 0x17, 0x0a, 0x13, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, - 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x4c, 0x4f, - 0x57, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x42, 0x45, - 0x53, 0x54, 0x5f, 0x45, 0x46, 0x46, 0x4f, 0x52, 0x54, 0x10, 0x02, 0x2a, 0x06, 0x08, 0xe8, 0x07, - 0x10, 0xe9, 0x07, 0x2a, 0x06, 0x08, 0xe9, 0x07, 0x10, 0xea, 0x07, 0x2a, 0x06, 0x08, 0xea, 0x07, - 0x10, 0xeb, 0x07, 0x2a, 0x06, 0x08, 0x8b, 0x4e, 0x10, 0x90, 0x4e, 0x2a, 0x06, 0x08, 0x90, 0x4e, - 0x10, 0x91, 0x4e, 0x4a, 0x06, 0x08, 0xe7, 0x07, 0x10, 0xe8, 0x07, 0x22, 0xfe, 0x02, 0x0a, 0x12, - 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x73, 0x12, 0x58, 0x0a, 0x08, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, - 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x53, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x52, 0x08, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x0f, - 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0e, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x41, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x45, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x1a, 0x87, 0x01, 0x0a, 0x18, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, - 0x74, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, - 0x32, 0x0a, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, - 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0xa7, 0x02, 0x0a, - 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x44, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xce, 0x01, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, - 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x04, 0x73, 0x70, - 0x61, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x73, 0x70, - 0x61, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x65, - 0x61, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2b, 0x0a, - 0x11, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, - 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x6c, 0x65, - 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x17, 0x6c, - 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x43, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xd0, 0x02, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x4d, 0x0a, 0x0a, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0a, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xeb, 0x01, 0x0a, 0x0a, - 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, - 0x69, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x52, 0x0a, 0x08, 0x73, - 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x42, + 0x2d, 0x88, 0x01, 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, + 0x58, 0x50, 0x41, 0x4e, 0x44, 0x45, 0x44, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x0b, 0x12, 0x06, 0x50, + 0x41, 0x43, 0x4b, 0x45, 0x44, 0x18, 0xe7, 0x07, 0xb2, 0x01, 0x03, 0x08, 0xe8, 0x07, 0x52, 0x15, + 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x63, + 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x7e, 0x0a, 0x0f, 0x75, 0x74, 0x66, 0x38, 0x5f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x55, 0x74, 0x66, 0x38, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x29, 0x88, 0x01, 0x01, 0x98, + 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x09, 0x12, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x18, 0xe6, + 0x07, 0xa2, 0x01, 0x0b, 0x12, 0x06, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x18, 0xe7, 0x07, 0xb2, + 0x01, 0x03, 0x08, 0xe8, 0x07, 0x52, 0x0e, 0x75, 0x74, 0x66, 0x38, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x7e, 0x0a, 0x10, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x26, 0x88, 0x01, + 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x14, 0x12, 0x0f, 0x4c, 0x45, 0x4e, 0x47, + 0x54, 0x48, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x45, 0x44, 0x18, 0xe6, 0x07, 0xb2, 0x01, + 0x03, 0x08, 0xe8, 0x07, 0x52, 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x63, + 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x82, 0x01, 0x0a, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x6f, 0x72, + 0x6d, 0x61, 0x74, 0x42, 0x39, 0x88, 0x01, 0x01, 0x98, 0x01, 0x03, 0x98, 0x01, 0x06, 0x98, 0x01, + 0x01, 0xa2, 0x01, 0x17, 0x12, 0x12, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x42, 0x45, 0x53, + 0x54, 0x5f, 0x45, 0x46, 0x46, 0x4f, 0x52, 0x54, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x0a, 0x12, 0x05, + 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x18, 0xe7, 0x07, 0xb2, 0x01, 0x03, 0x08, 0xe8, 0x07, 0x52, 0x0a, + 0x6a, 0x73, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0x5c, 0x0a, 0x0d, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x46, + 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x55, 0x4e, + 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, 0x4c, 0x49, + 0x43, 0x49, 0x54, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x43, 0x49, + 0x54, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x52, 0x45, + 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x03, 0x22, 0x37, 0x0a, 0x08, 0x45, 0x6e, 0x75, 0x6d, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4f, + 0x50, 0x45, 0x4e, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x10, + 0x02, 0x22, 0x56, 0x0a, 0x15, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x0a, 0x1f, 0x52, 0x45, + 0x50, 0x45, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x45, 0x4e, 0x43, + 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, + 0x0a, 0x0a, 0x06, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x45, + 0x58, 0x50, 0x41, 0x4e, 0x44, 0x45, 0x44, 0x10, 0x02, 0x22, 0x49, 0x0a, 0x0e, 0x55, 0x74, 0x66, + 0x38, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x55, + 0x54, 0x46, 0x38, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x56, 0x45, 0x52, 0x49, + 0x46, 0x59, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x03, 0x22, 0x04, + 0x08, 0x01, 0x10, 0x01, 0x22, 0x53, 0x0a, 0x0f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, + 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x18, 0x4d, 0x45, 0x53, 0x53, 0x41, + 0x47, 0x45, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x5f, + 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, + 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x10, 0x02, 0x22, 0x48, 0x0a, 0x0a, 0x4a, 0x73, 0x6f, + 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x17, 0x0a, 0x13, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, + 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, + 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4c, + 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x42, 0x45, 0x53, 0x54, 0x5f, 0x45, 0x46, 0x46, 0x4f, 0x52, + 0x54, 0x10, 0x02, 0x2a, 0x06, 0x08, 0xe8, 0x07, 0x10, 0x8b, 0x4e, 0x2a, 0x06, 0x08, 0x8b, 0x4e, + 0x10, 0x90, 0x4e, 0x2a, 0x06, 0x08, 0x90, 0x4e, 0x10, 0x91, 0x4e, 0x4a, 0x06, 0x08, 0xe7, 0x07, + 0x10, 0xe8, 0x07, 0x22, 0xef, 0x03, 0x0a, 0x12, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, + 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x58, 0x0a, 0x08, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x73, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x08, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, + 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6d, - 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x08, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x22, - 0x28, 0x0a, 0x08, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x12, 0x08, 0x0a, 0x04, 0x4e, - 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x45, 0x54, 0x10, 0x01, 0x12, 0x09, - 0x0a, 0x05, 0x41, 0x4c, 0x49, 0x41, 0x53, 0x10, 0x02, 0x2a, 0x92, 0x02, 0x0a, 0x07, 0x45, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0e, 0x45, 0x44, - 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x32, 0x10, 0xe6, 0x07, 0x12, - 0x13, 0x0a, 0x0e, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, - 0x33, 0x10, 0xe7, 0x07, 0x12, 0x11, 0x0a, 0x0c, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x32, 0x30, 0x32, 0x33, 0x10, 0xe8, 0x07, 0x12, 0x11, 0x0a, 0x0c, 0x45, 0x44, 0x49, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x34, 0x10, 0xe9, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x44, - 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, - 0x59, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, - 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x17, - 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x37, 0x5f, 0x54, 0x45, - 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x9d, 0x8d, 0x06, 0x12, 0x1d, 0x0a, 0x17, 0x45, - 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x38, 0x5f, 0x54, 0x45, 0x53, - 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x9e, 0x8d, 0x06, 0x12, 0x1d, 0x0a, 0x17, 0x45, 0x44, - 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x39, 0x5f, 0x54, 0x45, 0x53, 0x54, - 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x9f, 0x8d, 0x06, 0x12, 0x13, 0x0a, 0x0b, 0x45, 0x44, 0x49, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x41, 0x58, 0x10, 0xff, 0xff, 0xff, 0xff, 0x07, 0x42, 0x7e, - 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x10, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x48, 0x01, 0x5a, 0x2d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, - 0x42, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, + 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x69, 0x6d, + 0x75, 0x6d, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x69, + 0x6d, 0x75, 0x6d, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xf8, 0x01, 0x0a, 0x18, 0x46, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4e, 0x0a, 0x14, 0x6f, + 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x13, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x61, + 0x62, 0x6c, 0x65, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x0e, 0x66, + 0x69, 0x78, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, + 0x52, 0x0d, 0x66, 0x69, 0x78, 0x65, 0x64, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x4a, + 0x04, 0x08, 0x01, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x52, 0x08, 0x66, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0xa7, 0x02, 0x0a, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x44, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xce, + 0x01, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x04, 0x70, + 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, + 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x04, 0x73, 0x70, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x73, 0x70, 0x61, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x6c, + 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, + 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x64, + 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x17, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x44, + 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, + 0xd0, 0x02, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x4d, 0x0a, 0x0a, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xeb, 0x01, 0x0a, 0x0a, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x62, 0x65, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x62, 0x65, 0x67, + 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x03, 0x65, 0x6e, 0x64, 0x12, 0x52, 0x0a, 0x08, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x08, + 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x22, 0x28, 0x0a, 0x08, 0x53, 0x65, 0x6d, 0x61, + 0x6e, 0x74, 0x69, 0x63, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x07, + 0x0a, 0x03, 0x53, 0x45, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x49, 0x41, 0x53, + 0x10, 0x02, 0x2a, 0xa7, 0x02, 0x0a, 0x07, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x13, + 0x0a, 0x0f, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0e, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, + 0x45, 0x47, 0x41, 0x43, 0x59, 0x10, 0x84, 0x07, 0x12, 0x13, 0x0a, 0x0e, 0x45, 0x44, 0x49, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x32, 0x10, 0xe6, 0x07, 0x12, 0x13, 0x0a, + 0x0e, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x10, + 0xe7, 0x07, 0x12, 0x11, 0x0a, 0x0c, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, + 0x32, 0x33, 0x10, 0xe8, 0x07, 0x12, 0x11, 0x0a, 0x0c, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x32, 0x30, 0x32, 0x34, 0x10, 0xe9, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x44, 0x49, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, + 0x01, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x5f, 0x54, + 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x17, 0x45, 0x44, + 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x37, 0x5f, 0x54, 0x45, 0x53, 0x54, + 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x9d, 0x8d, 0x06, 0x12, 0x1d, 0x0a, 0x17, 0x45, 0x44, 0x49, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x38, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, + 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x9e, 0x8d, 0x06, 0x12, 0x1d, 0x0a, 0x17, 0x45, 0x44, 0x49, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x39, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, + 0x4e, 0x4c, 0x59, 0x10, 0x9f, 0x8d, 0x06, 0x12, 0x13, 0x0a, 0x0b, 0x45, 0x44, 0x49, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x4d, 0x41, 0x58, 0x10, 0xff, 0xff, 0xff, 0xff, 0x07, 0x42, 0x7e, 0x0a, 0x13, + 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x42, 0x10, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x48, 0x01, 0x5a, 0x2d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, + 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, } var ( @@ -5084,8 +5242,8 @@ func file_google_protobuf_descriptor_proto_rawDescGZIP() []byte { } var file_google_protobuf_descriptor_proto_enumTypes = make([]protoimpl.EnumInfo, 17) -var file_google_protobuf_descriptor_proto_msgTypes = make([]protoimpl.MessageInfo, 32) -var file_google_protobuf_descriptor_proto_goTypes = []interface{}{ +var file_google_protobuf_descriptor_proto_msgTypes = make([]protoimpl.MessageInfo, 33) +var file_google_protobuf_descriptor_proto_goTypes = []any{ (Edition)(0), // 0: google.protobuf.Edition (ExtensionRangeOptions_VerificationState)(0), // 1: google.protobuf.ExtensionRangeOptions.VerificationState (FieldDescriptorProto_Type)(0), // 2: google.protobuf.FieldDescriptorProto.Type @@ -5131,10 +5289,11 @@ var file_google_protobuf_descriptor_proto_goTypes = []interface{}{ (*ExtensionRangeOptions_Declaration)(nil), // 42: google.protobuf.ExtensionRangeOptions.Declaration (*EnumDescriptorProto_EnumReservedRange)(nil), // 43: google.protobuf.EnumDescriptorProto.EnumReservedRange (*FieldOptions_EditionDefault)(nil), // 44: google.protobuf.FieldOptions.EditionDefault - (*UninterpretedOption_NamePart)(nil), // 45: google.protobuf.UninterpretedOption.NamePart - (*FeatureSetDefaults_FeatureSetEditionDefault)(nil), // 46: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - (*SourceCodeInfo_Location)(nil), // 47: google.protobuf.SourceCodeInfo.Location - (*GeneratedCodeInfo_Annotation)(nil), // 48: google.protobuf.GeneratedCodeInfo.Annotation + (*FieldOptions_FeatureSupport)(nil), // 45: google.protobuf.FieldOptions.FeatureSupport + (*UninterpretedOption_NamePart)(nil), // 46: google.protobuf.UninterpretedOption.NamePart + (*FeatureSetDefaults_FeatureSetEditionDefault)(nil), // 47: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + (*SourceCodeInfo_Location)(nil), // 48: google.protobuf.SourceCodeInfo.Location + (*GeneratedCodeInfo_Annotation)(nil), // 49: google.protobuf.GeneratedCodeInfo.Annotation } var file_google_protobuf_descriptor_proto_depIdxs = []int32{ 18, // 0: google.protobuf.FileDescriptorSet.file:type_name -> google.protobuf.FileDescriptorProto @@ -5179,40 +5338,46 @@ var file_google_protobuf_descriptor_proto_depIdxs = []int32{ 8, // 39: google.protobuf.FieldOptions.targets:type_name -> google.protobuf.FieldOptions.OptionTargetType 44, // 40: google.protobuf.FieldOptions.edition_defaults:type_name -> google.protobuf.FieldOptions.EditionDefault 36, // 41: google.protobuf.FieldOptions.features:type_name -> google.protobuf.FeatureSet - 35, // 42: google.protobuf.FieldOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 36, // 43: google.protobuf.OneofOptions.features:type_name -> google.protobuf.FeatureSet - 35, // 44: google.protobuf.OneofOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 36, // 45: google.protobuf.EnumOptions.features:type_name -> google.protobuf.FeatureSet - 35, // 46: google.protobuf.EnumOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 36, // 47: google.protobuf.EnumValueOptions.features:type_name -> google.protobuf.FeatureSet - 35, // 48: google.protobuf.EnumValueOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 36, // 49: google.protobuf.ServiceOptions.features:type_name -> google.protobuf.FeatureSet - 35, // 50: google.protobuf.ServiceOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 9, // 51: google.protobuf.MethodOptions.idempotency_level:type_name -> google.protobuf.MethodOptions.IdempotencyLevel - 36, // 52: google.protobuf.MethodOptions.features:type_name -> google.protobuf.FeatureSet - 35, // 53: google.protobuf.MethodOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 45, // 54: google.protobuf.UninterpretedOption.name:type_name -> google.protobuf.UninterpretedOption.NamePart - 10, // 55: google.protobuf.FeatureSet.field_presence:type_name -> google.protobuf.FeatureSet.FieldPresence - 11, // 56: google.protobuf.FeatureSet.enum_type:type_name -> google.protobuf.FeatureSet.EnumType - 12, // 57: google.protobuf.FeatureSet.repeated_field_encoding:type_name -> google.protobuf.FeatureSet.RepeatedFieldEncoding - 13, // 58: google.protobuf.FeatureSet.utf8_validation:type_name -> google.protobuf.FeatureSet.Utf8Validation - 14, // 59: google.protobuf.FeatureSet.message_encoding:type_name -> google.protobuf.FeatureSet.MessageEncoding - 15, // 60: google.protobuf.FeatureSet.json_format:type_name -> google.protobuf.FeatureSet.JsonFormat - 46, // 61: google.protobuf.FeatureSetDefaults.defaults:type_name -> google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - 0, // 62: google.protobuf.FeatureSetDefaults.minimum_edition:type_name -> google.protobuf.Edition - 0, // 63: google.protobuf.FeatureSetDefaults.maximum_edition:type_name -> google.protobuf.Edition - 47, // 64: google.protobuf.SourceCodeInfo.location:type_name -> google.protobuf.SourceCodeInfo.Location - 48, // 65: google.protobuf.GeneratedCodeInfo.annotation:type_name -> google.protobuf.GeneratedCodeInfo.Annotation - 20, // 66: google.protobuf.DescriptorProto.ExtensionRange.options:type_name -> google.protobuf.ExtensionRangeOptions - 0, // 67: google.protobuf.FieldOptions.EditionDefault.edition:type_name -> google.protobuf.Edition - 0, // 68: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition:type_name -> google.protobuf.Edition - 36, // 69: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features:type_name -> google.protobuf.FeatureSet - 16, // 70: google.protobuf.GeneratedCodeInfo.Annotation.semantic:type_name -> google.protobuf.GeneratedCodeInfo.Annotation.Semantic - 71, // [71:71] is the sub-list for method output_type - 71, // [71:71] is the sub-list for method input_type - 71, // [71:71] is the sub-list for extension type_name - 71, // [71:71] is the sub-list for extension extendee - 0, // [0:71] is the sub-list for field type_name + 45, // 42: google.protobuf.FieldOptions.feature_support:type_name -> google.protobuf.FieldOptions.FeatureSupport + 35, // 43: google.protobuf.FieldOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 44: google.protobuf.OneofOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 45: google.protobuf.OneofOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 46: google.protobuf.EnumOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 47: google.protobuf.EnumOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 48: google.protobuf.EnumValueOptions.features:type_name -> google.protobuf.FeatureSet + 45, // 49: google.protobuf.EnumValueOptions.feature_support:type_name -> google.protobuf.FieldOptions.FeatureSupport + 35, // 50: google.protobuf.EnumValueOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 51: google.protobuf.ServiceOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 52: google.protobuf.ServiceOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 9, // 53: google.protobuf.MethodOptions.idempotency_level:type_name -> google.protobuf.MethodOptions.IdempotencyLevel + 36, // 54: google.protobuf.MethodOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 55: google.protobuf.MethodOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 46, // 56: google.protobuf.UninterpretedOption.name:type_name -> google.protobuf.UninterpretedOption.NamePart + 10, // 57: google.protobuf.FeatureSet.field_presence:type_name -> google.protobuf.FeatureSet.FieldPresence + 11, // 58: google.protobuf.FeatureSet.enum_type:type_name -> google.protobuf.FeatureSet.EnumType + 12, // 59: google.protobuf.FeatureSet.repeated_field_encoding:type_name -> google.protobuf.FeatureSet.RepeatedFieldEncoding + 13, // 60: google.protobuf.FeatureSet.utf8_validation:type_name -> google.protobuf.FeatureSet.Utf8Validation + 14, // 61: google.protobuf.FeatureSet.message_encoding:type_name -> google.protobuf.FeatureSet.MessageEncoding + 15, // 62: google.protobuf.FeatureSet.json_format:type_name -> google.protobuf.FeatureSet.JsonFormat + 47, // 63: google.protobuf.FeatureSetDefaults.defaults:type_name -> google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + 0, // 64: google.protobuf.FeatureSetDefaults.minimum_edition:type_name -> google.protobuf.Edition + 0, // 65: google.protobuf.FeatureSetDefaults.maximum_edition:type_name -> google.protobuf.Edition + 48, // 66: google.protobuf.SourceCodeInfo.location:type_name -> google.protobuf.SourceCodeInfo.Location + 49, // 67: google.protobuf.GeneratedCodeInfo.annotation:type_name -> google.protobuf.GeneratedCodeInfo.Annotation + 20, // 68: google.protobuf.DescriptorProto.ExtensionRange.options:type_name -> google.protobuf.ExtensionRangeOptions + 0, // 69: google.protobuf.FieldOptions.EditionDefault.edition:type_name -> google.protobuf.Edition + 0, // 70: google.protobuf.FieldOptions.FeatureSupport.edition_introduced:type_name -> google.protobuf.Edition + 0, // 71: google.protobuf.FieldOptions.FeatureSupport.edition_deprecated:type_name -> google.protobuf.Edition + 0, // 72: google.protobuf.FieldOptions.FeatureSupport.edition_removed:type_name -> google.protobuf.Edition + 0, // 73: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition:type_name -> google.protobuf.Edition + 36, // 74: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridable_features:type_name -> google.protobuf.FeatureSet + 36, // 75: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixed_features:type_name -> google.protobuf.FeatureSet + 16, // 76: google.protobuf.GeneratedCodeInfo.Annotation.semantic:type_name -> google.protobuf.GeneratedCodeInfo.Annotation.Semantic + 77, // [77:77] is the sub-list for method output_type + 77, // [77:77] is the sub-list for method input_type + 77, // [77:77] is the sub-list for extension type_name + 77, // [77:77] is the sub-list for extension extendee + 0, // [0:77] is the sub-list for field type_name } func init() { file_google_protobuf_descriptor_proto_init() } @@ -5221,7 +5386,7 @@ func file_google_protobuf_descriptor_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_google_protobuf_descriptor_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*FileDescriptorSet); i { case 0: return &v.state @@ -5233,7 +5398,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*FileDescriptorProto); i { case 0: return &v.state @@ -5245,7 +5410,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*DescriptorProto); i { case 0: return &v.state @@ -5257,7 +5422,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*ExtensionRangeOptions); i { case 0: return &v.state @@ -5271,7 +5436,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*FieldDescriptorProto); i { case 0: return &v.state @@ -5283,7 +5448,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*OneofDescriptorProto); i { case 0: return &v.state @@ -5295,7 +5460,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*EnumDescriptorProto); i { case 0: return &v.state @@ -5307,7 +5472,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*EnumValueDescriptorProto); i { case 0: return &v.state @@ -5319,7 +5484,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*ServiceDescriptorProto); i { case 0: return &v.state @@ -5331,7 +5496,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*MethodDescriptorProto); i { case 0: return &v.state @@ -5343,7 +5508,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*FileOptions); i { case 0: return &v.state @@ -5357,7 +5522,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*MessageOptions); i { case 0: return &v.state @@ -5371,7 +5536,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*FieldOptions); i { case 0: return &v.state @@ -5385,7 +5550,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*OneofOptions); i { case 0: return &v.state @@ -5399,7 +5564,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[14].Exporter = func(v any, i int) any { switch v := v.(*EnumOptions); i { case 0: return &v.state @@ -5413,7 +5578,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[15].Exporter = func(v any, i int) any { switch v := v.(*EnumValueOptions); i { case 0: return &v.state @@ -5427,7 +5592,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[16].Exporter = func(v any, i int) any { switch v := v.(*ServiceOptions); i { case 0: return &v.state @@ -5441,7 +5606,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[17].Exporter = func(v any, i int) any { switch v := v.(*MethodOptions); i { case 0: return &v.state @@ -5455,7 +5620,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[18].Exporter = func(v any, i int) any { switch v := v.(*UninterpretedOption); i { case 0: return &v.state @@ -5467,7 +5632,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[19].Exporter = func(v any, i int) any { switch v := v.(*FeatureSet); i { case 0: return &v.state @@ -5481,7 +5646,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[20].Exporter = func(v any, i int) any { switch v := v.(*FeatureSetDefaults); i { case 0: return &v.state @@ -5493,7 +5658,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[21].Exporter = func(v any, i int) any { switch v := v.(*SourceCodeInfo); i { case 0: return &v.state @@ -5505,7 +5670,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[22].Exporter = func(v any, i int) any { switch v := v.(*GeneratedCodeInfo); i { case 0: return &v.state @@ -5517,7 +5682,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[23].Exporter = func(v any, i int) any { switch v := v.(*DescriptorProto_ExtensionRange); i { case 0: return &v.state @@ -5529,7 +5694,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[24].Exporter = func(v any, i int) any { switch v := v.(*DescriptorProto_ReservedRange); i { case 0: return &v.state @@ -5541,7 +5706,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[25].Exporter = func(v any, i int) any { switch v := v.(*ExtensionRangeOptions_Declaration); i { case 0: return &v.state @@ -5553,7 +5718,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[26].Exporter = func(v any, i int) any { switch v := v.(*EnumDescriptorProto_EnumReservedRange); i { case 0: return &v.state @@ -5565,7 +5730,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[27].Exporter = func(v any, i int) any { switch v := v.(*FieldOptions_EditionDefault); i { case 0: return &v.state @@ -5577,7 +5742,19 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[28].Exporter = func(v any, i int) any { + switch v := v.(*FieldOptions_FeatureSupport); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_descriptor_proto_msgTypes[29].Exporter = func(v any, i int) any { switch v := v.(*UninterpretedOption_NamePart); i { case 0: return &v.state @@ -5589,7 +5766,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[30].Exporter = func(v any, i int) any { switch v := v.(*FeatureSetDefaults_FeatureSetEditionDefault); i { case 0: return &v.state @@ -5601,7 +5778,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[31].Exporter = func(v any, i int) any { switch v := v.(*SourceCodeInfo_Location); i { case 0: return &v.state @@ -5613,7 +5790,7 @@ func file_google_protobuf_descriptor_proto_init() { return nil } } - file_google_protobuf_descriptor_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_descriptor_proto_msgTypes[32].Exporter = func(v any, i int) any { switch v := v.(*GeneratedCodeInfo_Annotation); i { case 0: return &v.state @@ -5632,7 +5809,7 @@ func file_google_protobuf_descriptor_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_protobuf_descriptor_proto_rawDesc, NumEnums: 17, - NumMessages: 32, + NumMessages: 33, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go b/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go index 25de5ae008..a2ca940c50 100644 --- a/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go +++ b/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go @@ -6,9 +6,9 @@ // https://developers.google.com/open-source/licenses/bsd // Code generated by protoc-gen-go. DO NOT EDIT. -// source: reflect/protodesc/proto/go_features.proto +// source: google/protobuf/go_features.proto -package proto +package gofeaturespb import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -30,7 +30,7 @@ type GoFeatures struct { func (x *GoFeatures) Reset() { *x = GoFeatures{} if protoimpl.UnsafeEnabled { - mi := &file_reflect_protodesc_proto_go_features_proto_msgTypes[0] + mi := &file_google_protobuf_go_features_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -43,7 +43,7 @@ func (x *GoFeatures) String() string { func (*GoFeatures) ProtoMessage() {} func (x *GoFeatures) ProtoReflect() protoreflect.Message { - mi := &file_reflect_protodesc_proto_go_features_proto_msgTypes[0] + mi := &file_google_protobuf_go_features_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -56,7 +56,7 @@ func (x *GoFeatures) ProtoReflect() protoreflect.Message { // Deprecated: Use GoFeatures.ProtoReflect.Descriptor instead. func (*GoFeatures) Descriptor() ([]byte, []int) { - return file_reflect_protodesc_proto_go_features_proto_rawDescGZIP(), []int{0} + return file_google_protobuf_go_features_proto_rawDescGZIP(), []int{0} } func (x *GoFeatures) GetLegacyUnmarshalJsonEnum() bool { @@ -66,69 +66,73 @@ func (x *GoFeatures) GetLegacyUnmarshalJsonEnum() bool { return false } -var file_reflect_protodesc_proto_go_features_proto_extTypes = []protoimpl.ExtensionInfo{ +var file_google_protobuf_go_features_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.FeatureSet)(nil), ExtensionType: (*GoFeatures)(nil), Field: 1002, - Name: "google.protobuf.go", + Name: "pb.go", Tag: "bytes,1002,opt,name=go", - Filename: "reflect/protodesc/proto/go_features.proto", + Filename: "google/protobuf/go_features.proto", }, } // Extension fields to descriptorpb.FeatureSet. var ( - // optional google.protobuf.GoFeatures go = 1002; - E_Go = &file_reflect_protodesc_proto_go_features_proto_extTypes[0] + // optional pb.GoFeatures go = 1002; + E_Go = &file_google_protobuf_go_features_proto_extTypes[0] ) -var File_reflect_protodesc_proto_go_features_proto protoreflect.FileDescriptor - -var file_reflect_protodesc_proto_go_features_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x64, - 0x65, 0x73, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x5f, 0x66, 0x65, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x1a, 0x20, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6a, - 0x0a, 0x0a, 0x47, 0x6f, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x1a, - 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, - 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x42, 0x1f, 0x88, 0x01, 0x01, 0x98, 0x01, 0x06, 0xa2, 0x01, 0x09, 0x12, 0x04, 0x74, 0x72, 0x75, - 0x65, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x0a, 0x12, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x18, 0xe7, - 0x07, 0x52, 0x17, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, - 0x61, 0x6c, 0x4a, 0x73, 0x6f, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x49, 0x0a, 0x02, 0x67, 0x6f, - 0x12, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x18, 0xea, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x6f, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x52, 0x02, 0x67, 0x6f, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x64, 0x65, 0x73, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, +var File_google_protobuf_go_features_proto protoreflect.FileDescriptor + +var file_google_protobuf_go_features_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x67, 0x6f, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcd, 0x01, 0x0a, 0x0a, 0x47, 0x6f, + 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0xbe, 0x01, 0x0a, 0x1a, 0x6c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x5f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x5f, 0x6a, 0x73, + 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x80, 0x01, + 0x88, 0x01, 0x01, 0x98, 0x01, 0x06, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x09, 0x12, 0x04, 0x74, 0x72, + 0x75, 0x65, 0x18, 0x84, 0x07, 0xa2, 0x01, 0x0a, 0x12, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x18, + 0xe7, 0x07, 0xb2, 0x01, 0x5b, 0x08, 0xe8, 0x07, 0x10, 0xe8, 0x07, 0x1a, 0x53, 0x54, 0x68, 0x65, + 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, + 0x6c, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x41, 0x50, 0x49, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x70, + 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, + 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x61, + 0x20, 0x66, 0x75, 0x74, 0x75, 0x72, 0x65, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x52, 0x17, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, + 0x6c, 0x4a, 0x73, 0x6f, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x3c, 0x0a, 0x02, 0x67, 0x6f, 0x12, + 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x18, 0xea, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x46, 0x65, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x73, 0x52, 0x02, 0x67, 0x6f, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x67, 0x6f, 0x66, 0x65, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x70, 0x62, } var ( - file_reflect_protodesc_proto_go_features_proto_rawDescOnce sync.Once - file_reflect_protodesc_proto_go_features_proto_rawDescData = file_reflect_protodesc_proto_go_features_proto_rawDesc + file_google_protobuf_go_features_proto_rawDescOnce sync.Once + file_google_protobuf_go_features_proto_rawDescData = file_google_protobuf_go_features_proto_rawDesc ) -func file_reflect_protodesc_proto_go_features_proto_rawDescGZIP() []byte { - file_reflect_protodesc_proto_go_features_proto_rawDescOnce.Do(func() { - file_reflect_protodesc_proto_go_features_proto_rawDescData = protoimpl.X.CompressGZIP(file_reflect_protodesc_proto_go_features_proto_rawDescData) +func file_google_protobuf_go_features_proto_rawDescGZIP() []byte { + file_google_protobuf_go_features_proto_rawDescOnce.Do(func() { + file_google_protobuf_go_features_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_protobuf_go_features_proto_rawDescData) }) - return file_reflect_protodesc_proto_go_features_proto_rawDescData + return file_google_protobuf_go_features_proto_rawDescData } -var file_reflect_protodesc_proto_go_features_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_reflect_protodesc_proto_go_features_proto_goTypes = []interface{}{ - (*GoFeatures)(nil), // 0: google.protobuf.GoFeatures +var file_google_protobuf_go_features_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_google_protobuf_go_features_proto_goTypes = []any{ + (*GoFeatures)(nil), // 0: pb.GoFeatures (*descriptorpb.FeatureSet)(nil), // 1: google.protobuf.FeatureSet } -var file_reflect_protodesc_proto_go_features_proto_depIdxs = []int32{ - 1, // 0: google.protobuf.go:extendee -> google.protobuf.FeatureSet - 0, // 1: google.protobuf.go:type_name -> google.protobuf.GoFeatures +var file_google_protobuf_go_features_proto_depIdxs = []int32{ + 1, // 0: pb.go:extendee -> google.protobuf.FeatureSet + 0, // 1: pb.go:type_name -> pb.GoFeatures 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 1, // [1:2] is the sub-list for extension type_name @@ -136,13 +140,13 @@ var file_reflect_protodesc_proto_go_features_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_reflect_protodesc_proto_go_features_proto_init() } -func file_reflect_protodesc_proto_go_features_proto_init() { - if File_reflect_protodesc_proto_go_features_proto != nil { +func init() { file_google_protobuf_go_features_proto_init() } +func file_google_protobuf_go_features_proto_init() { + if File_google_protobuf_go_features_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_reflect_protodesc_proto_go_features_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_go_features_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*GoFeatures); i { case 0: return &v.state @@ -159,19 +163,19 @@ func file_reflect_protodesc_proto_go_features_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_reflect_protodesc_proto_go_features_proto_rawDesc, + RawDescriptor: file_google_protobuf_go_features_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 1, NumServices: 0, }, - GoTypes: file_reflect_protodesc_proto_go_features_proto_goTypes, - DependencyIndexes: file_reflect_protodesc_proto_go_features_proto_depIdxs, - MessageInfos: file_reflect_protodesc_proto_go_features_proto_msgTypes, - ExtensionInfos: file_reflect_protodesc_proto_go_features_proto_extTypes, + GoTypes: file_google_protobuf_go_features_proto_goTypes, + DependencyIndexes: file_google_protobuf_go_features_proto_depIdxs, + MessageInfos: file_google_protobuf_go_features_proto_msgTypes, + ExtensionInfos: file_google_protobuf_go_features_proto_extTypes, }.Build() - File_reflect_protodesc_proto_go_features_proto = out.File - file_reflect_protodesc_proto_go_features_proto_rawDesc = nil - file_reflect_protodesc_proto_go_features_proto_goTypes = nil - file_reflect_protodesc_proto_go_features_proto_depIdxs = nil + File_google_protobuf_go_features_proto = out.File + file_google_protobuf_go_features_proto_rawDesc = nil + file_google_protobuf_go_features_proto_goTypes = nil + file_google_protobuf_go_features_proto_depIdxs = nil } diff --git a/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.proto b/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.proto deleted file mode 100644 index d246571296..0000000000 --- a/vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.proto +++ /dev/null @@ -1,28 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -syntax = "proto2"; - -package google.protobuf; - -import "google/protobuf/descriptor.proto"; - -option go_package = "google.golang.org/protobuf/types/gofeaturespb"; - -extend google.protobuf.FeatureSet { - optional GoFeatures go = 1002; -} - -message GoFeatures { - // Whether or not to generate the deprecated UnmarshalJSON method for enums. - optional bool legacy_unmarshal_json_enum = 1 [ - retention = RETENTION_RUNTIME, - targets = TARGET_TYPE_ENUM, - edition_defaults = { edition: EDITION_PROTO2, value: "true" }, - edition_defaults = { edition: EDITION_PROTO3, value: "false" } - ]; -} diff --git a/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go b/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go index 9de51be540..7172b43d38 100644 --- a/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go @@ -445,7 +445,7 @@ func file_google_protobuf_any_proto_rawDescGZIP() []byte { } var file_google_protobuf_any_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_google_protobuf_any_proto_goTypes = []interface{}{ +var file_google_protobuf_any_proto_goTypes = []any{ (*Any)(nil), // 0: google.protobuf.Any } var file_google_protobuf_any_proto_depIdxs = []int32{ @@ -462,7 +462,7 @@ func file_google_protobuf_any_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_google_protobuf_any_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_any_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*Any); i { case 0: return &v.state diff --git a/vendor/google.golang.org/protobuf/types/known/durationpb/duration.pb.go b/vendor/google.golang.org/protobuf/types/known/durationpb/duration.pb.go index df709a8dd4..1b71bcd910 100644 --- a/vendor/google.golang.org/protobuf/types/known/durationpb/duration.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/durationpb/duration.pb.go @@ -323,7 +323,7 @@ func file_google_protobuf_duration_proto_rawDescGZIP() []byte { } var file_google_protobuf_duration_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_google_protobuf_duration_proto_goTypes = []interface{}{ +var file_google_protobuf_duration_proto_goTypes = []any{ (*Duration)(nil), // 0: google.protobuf.Duration } var file_google_protobuf_duration_proto_depIdxs = []int32{ @@ -340,7 +340,7 @@ func file_google_protobuf_duration_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_google_protobuf_duration_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_duration_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*Duration); i { case 0: return &v.state diff --git a/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go b/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go index 81511a3363..83a5a645b0 100644 --- a/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go @@ -332,7 +332,7 @@ func file_google_protobuf_timestamp_proto_rawDescGZIP() []byte { } var file_google_protobuf_timestamp_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_google_protobuf_timestamp_proto_goTypes = []interface{}{ +var file_google_protobuf_timestamp_proto_goTypes = []any{ (*Timestamp)(nil), // 0: google.protobuf.Timestamp } var file_google_protobuf_timestamp_proto_depIdxs = []int32{ @@ -349,7 +349,7 @@ func file_google_protobuf_timestamp_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_google_protobuf_timestamp_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_google_protobuf_timestamp_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*Timestamp); i { case 0: return &v.state diff --git a/vendor/modules.txt b/vendor/modules.txt index 02a7c47aa2..872411b651 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,7 +1,4 @@ -# cloud.google.com/go/compute v1.19.1 -## explicit; go 1.19 -cloud.google.com/go/compute/internal -# cloud.google.com/go/compute/metadata v0.2.3 +# cloud.google.com/go/compute/metadata v0.3.0 ## explicit; go 1.19 cloud.google.com/go/compute/metadata # github.com/Azure/azure-pipeline-go v0.2.3 @@ -22,12 +19,6 @@ github.com/Azure/go-autorest/autorest/date # github.com/Azure/go-autorest/tracing v0.6.0 ## explicit; go 1.12 github.com/Azure/go-autorest/tracing -# github.com/PuerkitoBio/purell v1.1.1 -## explicit -github.com/PuerkitoBio/purell -# github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 -## explicit -github.com/PuerkitoBio/urlesc # github.com/Unknwon/goconfig v0.0.0-20200908083735-df7de6a44db8 ## explicit github.com/Unknwon/goconfig @@ -37,8 +28,8 @@ github.com/aalpar/deheap # github.com/abbot/go-http-auth v0.4.0 ## explicit github.com/abbot/go-http-auth -# github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 -## explicit; go 1.12 +# github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 +## explicit; go 1.13 github.com/asaskevich/govalidator # github.com/aws/aws-sdk-go v1.35.17 ## explicit; go 1.11 @@ -92,10 +83,10 @@ github.com/aws/aws-sdk-go/service/sts/stsiface # github.com/beorn7/perks v1.0.1 ## explicit; go 1.11 github.com/beorn7/perks/quantile -# github.com/cenkalti/backoff/v4 v4.2.1 +# github.com/cenkalti/backoff/v4 v4.3.0 ## explicit; go 1.18 github.com/cenkalti/backoff/v4 -# github.com/cespare/xxhash/v2 v2.2.0 +# github.com/cespare/xxhash/v2 v2.3.0 ## explicit; go 1.11 github.com/cespare/xxhash/v2 # github.com/coreos/go-semver v0.3.0 @@ -107,31 +98,44 @@ github.com/cpuguy83/go-md2man/v2/md2man # github.com/form3tech-oss/jwt-go v3.2.2+incompatible ## explicit github.com/form3tech-oss/jwt-go -# github.com/go-chi/chi/v5 v5.0.0 -## explicit; go 1.16 +# github.com/go-chi/chi/v5 v5.1.0 +## explicit; go 1.14 github.com/go-chi/chi/v5 github.com/go-chi/chi/v5/middleware # github.com/go-chi/render v1.0.0 ## explicit github.com/go-chi/render -# github.com/go-openapi/analysis v0.19.10 -## explicit; go 1.13 +# github.com/go-logr/logr v1.4.1 +## explicit; go 1.18 +github.com/go-logr/logr +github.com/go-logr/logr/funcr +# github.com/go-logr/stdr v1.2.2 +## explicit; go 1.16 +github.com/go-logr/stdr +# github.com/go-openapi/analysis v0.23.0 +## explicit; go 1.20 github.com/go-openapi/analysis -github.com/go-openapi/analysis/internal -# github.com/go-openapi/errors v0.19.6 -## explicit; go 1.14 +github.com/go-openapi/analysis/internal/debug +github.com/go-openapi/analysis/internal/flatten/normalize +github.com/go-openapi/analysis/internal/flatten/operations +github.com/go-openapi/analysis/internal/flatten/replace +github.com/go-openapi/analysis/internal/flatten/schutils +github.com/go-openapi/analysis/internal/flatten/sortref +# github.com/go-openapi/errors v0.22.0 +## explicit; go 1.20 github.com/go-openapi/errors -# github.com/go-openapi/jsonpointer v0.19.3 -## explicit; go 1.13 +# github.com/go-openapi/jsonpointer v0.21.0 +## explicit; go 1.20 github.com/go-openapi/jsonpointer -# github.com/go-openapi/jsonreference v0.19.4 -## explicit; go 1.13 +# github.com/go-openapi/jsonreference v0.21.0 +## explicit; go 1.20 github.com/go-openapi/jsonreference -# github.com/go-openapi/loads v0.19.5 -## explicit; go 1.13 +github.com/go-openapi/jsonreference/internal +# github.com/go-openapi/loads v0.22.0 +## explicit; go 1.20 github.com/go-openapi/loads -# github.com/go-openapi/runtime v0.19.20 -## explicit; go 1.13 +# github.com/go-openapi/runtime v0.28.0 +## explicit; go 1.20 github.com/go-openapi/runtime github.com/go-openapi/runtime/client github.com/go-openapi/runtime/logger @@ -140,21 +144,19 @@ github.com/go-openapi/runtime/middleware/denco github.com/go-openapi/runtime/middleware/header github.com/go-openapi/runtime/middleware/untyped github.com/go-openapi/runtime/security -# github.com/go-openapi/spec v0.19.8 -## explicit; go 1.13 +github.com/go-openapi/runtime/yamlpc +# github.com/go-openapi/spec v0.21.0 +## explicit; go 1.20 github.com/go-openapi/spec -# github.com/go-openapi/strfmt v0.19.5 -## explicit; go 1.13 +# github.com/go-openapi/strfmt v0.23.0 +## explicit; go 1.20 github.com/go-openapi/strfmt -# github.com/go-openapi/swag v0.19.9 -## explicit; go 1.13 +# github.com/go-openapi/swag v0.23.0 +## explicit; go 1.20 github.com/go-openapi/swag -# github.com/go-openapi/validate v0.19.10 -## explicit; go 1.14 +# github.com/go-openapi/validate v0.24.0 +## explicit; go 1.20 github.com/go-openapi/validate -# github.com/go-stack/stack v1.8.0 -## explicit -github.com/go-stack/stack # github.com/gobwas/glob v0.2.3 ## explicit github.com/gobwas/glob @@ -165,7 +167,7 @@ github.com/gobwas/glob/syntax/ast github.com/gobwas/glob/syntax/lexer github.com/gobwas/glob/util/runes github.com/gobwas/glob/util/strings -# github.com/gocql/gocql v1.5.2 => github.com/scylladb/gocql v1.12.0 +# github.com/gocql/gocql v1.6.0 => github.com/scylladb/gocql v1.12.0 ## explicit; go 1.13 github.com/gocql/gocql github.com/gocql/gocql/internal/lru @@ -190,7 +192,7 @@ github.com/golang/protobuf/ptypes/timestamp # github.com/golang/snappy v0.0.4 ## explicit github.com/golang/snappy -# github.com/google/go-cmp v0.5.9 +# github.com/google/go-cmp v0.6.0 ## explicit; go 1.13 github.com/google/go-cmp/cmp github.com/google/go-cmp/cmp/cmpopts @@ -198,7 +200,7 @@ github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/uuid v1.3.0 +# github.com/google/uuid v1.6.0 ## explicit github.com/google/uuid # github.com/googleapis/gax-go/v2 v2.7.1 @@ -210,10 +212,10 @@ github.com/googleapis/gax-go/v2/internal # github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed ## explicit github.com/hailocab/go-hostpool -# github.com/hashicorp/go-version v1.2.0 +# github.com/hashicorp/go-version v1.7.0 ## explicit github.com/hashicorp/go-version -# github.com/hbollon/go-edlib v1.5.0 +# github.com/hbollon/go-edlib v1.6.0 ## explicit; go 1.13 github.com/hbollon/go-edlib github.com/hbollon/go-edlib/internal/orderedmap @@ -224,17 +226,29 @@ github.com/inconshreveable/mousetrap # github.com/jmespath/go-jmespath v0.4.0 ## explicit; go 1.14 github.com/jmespath/go-jmespath -# github.com/json-iterator/go v1.1.11 +# github.com/josharian/intern v1.0.0 +## explicit; go 1.5 +github.com/josharian/intern +# github.com/json-iterator/go v1.1.12 ## explicit; go 1.12 github.com/json-iterator/go # github.com/jzelinskie/whirlpool v0.0.0-20201016144138-0675e54bb004 ## explicit github.com/jzelinskie/whirlpool +# github.com/klauspost/compress v1.17.9 +## explicit; go 1.20 +github.com/klauspost/compress +github.com/klauspost/compress/fse +github.com/klauspost/compress/huff0 +github.com/klauspost/compress/internal/cpuinfo +github.com/klauspost/compress/internal/snapref +github.com/klauspost/compress/zstd +github.com/klauspost/compress/zstd/internal/xxhash # github.com/lnquy/cron v1.1.1 ## explicit; go 1.11 github.com/lnquy/cron github.com/lnquy/cron/i18n -# github.com/mailru/easyjson v0.7.1 +# github.com/mailru/easyjson v0.7.7 ## explicit; go 1.12 github.com/mailru/easyjson/buffer github.com/mailru/easyjson/jlexer @@ -248,45 +262,54 @@ github.com/mattn/go-ieproxy # github.com/mattn/go-isatty v0.0.16 ## explicit; go 1.15 github.com/mattn/go-isatty -# github.com/mattn/go-runewidth v0.0.9 +# github.com/mattn/go-runewidth v0.0.16 ## explicit; go 1.9 github.com/mattn/go-runewidth -# github.com/matttproud/golang_protobuf_extensions v1.0.1 -## explicit -github.com/matttproud/golang_protobuf_extensions/pbutil # github.com/mitchellh/go-homedir v1.1.0 ## explicit github.com/mitchellh/go-homedir -# github.com/mitchellh/mapstructure v1.3.2 +# github.com/mitchellh/mapstructure v1.5.0 ## explicit; go 1.14 github.com/mitchellh/mapstructure # github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd ## explicit github.com/modern-go/concurrent -# github.com/modern-go/reflect2 v1.0.1 -## explicit +# github.com/modern-go/reflect2 v1.0.2 +## explicit; go 1.12 github.com/modern-go/reflect2 +# github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 +## explicit +github.com/munnerz/goautoneg # github.com/ncw/swift v1.0.52 ## explicit github.com/ncw/swift +# github.com/oklog/ulid v1.3.1 +## explicit +github.com/oklog/ulid +# github.com/opentracing/opentracing-go v1.2.0 +## explicit; go 1.14 +github.com/opentracing/opentracing-go +github.com/opentracing/opentracing-go/ext +github.com/opentracing/opentracing-go/log # github.com/pkg/errors v0.9.1 ## explicit github.com/pkg/errors -# github.com/prometheus/client_golang v1.11.1 -## explicit; go 1.13 +# github.com/prometheus/client_golang v1.20.0 +## explicit; go 1.20 +github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil +github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header github.com/prometheus/client_golang/prometheus github.com/prometheus/client_golang/prometheus/internal github.com/prometheus/client_golang/prometheus/promhttp -# github.com/prometheus/client_model v0.3.0 -## explicit; go 1.9 +# github.com/prometheus/client_model v0.6.1 +## explicit; go 1.19 github.com/prometheus/client_model/go -# github.com/prometheus/common v0.26.0 -## explicit; go 1.11 +# github.com/prometheus/common v0.57.0 +## explicit; go 1.20 github.com/prometheus/common/expfmt -github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg github.com/prometheus/common/model -# github.com/prometheus/procfs v0.6.0 -## explicit; go 1.13 +# github.com/prometheus/procfs v0.15.1 +## explicit; go 1.20 github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util @@ -342,6 +365,9 @@ github.com/rclone/rclone/lib/terminal # github.com/rfjakob/eme v1.1.1 ## explicit github.com/rfjakob/eme +# github.com/rivo/uniseg v0.2.0 +## explicit; go 1.12 +github.com/rivo/uniseg # github.com/robfig/cron/v3 v3.0.1 ## explicit; go 1.12 github.com/robfig/cron/v3 @@ -369,6 +395,55 @@ github.com/scylladb/gocqlx/v2/dbutil github.com/scylladb/gocqlx/v2/migrate github.com/scylladb/gocqlx/v2/qb github.com/scylladb/gocqlx/v2/table +# github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20240902123022-df2d6812cdb0 +## explicit; go 1.21.1 +github.com/scylladb/scylla-manager/v3/pkg/managerclient +github.com/scylladb/scylla-manager/v3/pkg/managerclient/table +# github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20240902115944-7914bb0d3b80 +## explicit; go 1.21.1 +github.com/scylladb/scylla-manager/v3/pkg/util +github.com/scylladb/scylla-manager/v3/pkg/util/certutil +github.com/scylladb/scylla-manager/v3/pkg/util/cfgutil +github.com/scylladb/scylla-manager/v3/pkg/util/clipper +github.com/scylladb/scylla-manager/v3/pkg/util/cpuset +github.com/scylladb/scylla-manager/v3/pkg/util/duration +github.com/scylladb/scylla-manager/v3/pkg/util/fsutil +github.com/scylladb/scylla-manager/v3/pkg/util/httplog +github.com/scylladb/scylla-manager/v3/pkg/util/httppprof +github.com/scylladb/scylla-manager/v3/pkg/util/httpx +github.com/scylladb/scylla-manager/v3/pkg/util/inexlist +github.com/scylladb/scylla-manager/v3/pkg/util/inexlist/dcfilter +github.com/scylladb/scylla-manager/v3/pkg/util/inexlist/ksfilter +github.com/scylladb/scylla-manager/v3/pkg/util/jsonutil +github.com/scylladb/scylla-manager/v3/pkg/util/logutil +github.com/scylladb/scylla-manager/v3/pkg/util/maputil +github.com/scylladb/scylla-manager/v3/pkg/util/netwait +github.com/scylladb/scylla-manager/v3/pkg/util/osutil +github.com/scylladb/scylla-manager/v3/pkg/util/parallel +github.com/scylladb/scylla-manager/v3/pkg/util/pathparser +github.com/scylladb/scylla-manager/v3/pkg/util/pointer +github.com/scylladb/scylla-manager/v3/pkg/util/prom +github.com/scylladb/scylla-manager/v3/pkg/util/query +github.com/scylladb/scylla-manager/v3/pkg/util/retry +github.com/scylladb/scylla-manager/v3/pkg/util/schedules +github.com/scylladb/scylla-manager/v3/pkg/util/slice +github.com/scylladb/scylla-manager/v3/pkg/util/timeutc +github.com/scylladb/scylla-manager/v3/pkg/util/uuid +github.com/scylladb/scylla-manager/v3/pkg/util/version +github.com/scylladb/scylla-manager/v3/pkg/util/workerpool +# github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20240902115944-7914bb0d3b80 +## explicit; go 1.21.1 +github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client +github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations +github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models +github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/client/operations +github.com/scylladb/scylla-manager/v3/swagger/gen/scylla-manager/models +github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client +github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations +github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models +github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client +github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/client/config +github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models # github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4 ## explicit github.com/scylladb/termtables @@ -391,8 +466,8 @@ github.com/spf13/pflag # github.com/stoewer/go-strcase v1.3.0 ## explicit; go 1.11 github.com/stoewer/go-strcase -# go.mongodb.org/mongo-driver v1.5.1 -## explicit; go 1.10 +# go.mongodb.org/mongo-driver v1.14.0 +## explicit; go 1.18 go.mongodb.org/mongo-driver/bson go.mongodb.org/mongo-driver/bson/bsoncodec go.mongodb.org/mongo-driver/bson/bsonoptions @@ -418,8 +493,30 @@ go.opencensus.io/trace go.opencensus.io/trace/internal go.opencensus.io/trace/propagation go.opencensus.io/trace/tracestate -# go.uber.org/atomic v1.7.0 -## explicit; go 1.13 +# go.opentelemetry.io/otel v1.24.0 +## explicit; go 1.20 +go.opentelemetry.io/otel +go.opentelemetry.io/otel/attribute +go.opentelemetry.io/otel/baggage +go.opentelemetry.io/otel/codes +go.opentelemetry.io/otel/internal +go.opentelemetry.io/otel/internal/attribute +go.opentelemetry.io/otel/internal/baggage +go.opentelemetry.io/otel/internal/global +go.opentelemetry.io/otel/propagation +go.opentelemetry.io/otel/semconv/internal/v2 +go.opentelemetry.io/otel/semconv/v1.17.0 +go.opentelemetry.io/otel/semconv/v1.17.0/httpconv +# go.opentelemetry.io/otel/metric v1.24.0 +## explicit; go 1.20 +go.opentelemetry.io/otel/metric +go.opentelemetry.io/otel/metric/embedded +# go.opentelemetry.io/otel/trace v1.24.0 +## explicit; go 1.20 +go.opentelemetry.io/otel/trace +go.opentelemetry.io/otel/trace/embedded +# go.uber.org/atomic v1.11.0 +## explicit; go 1.18 go.uber.org/atomic # go.uber.org/config v1.4.0 ## explicit; go 1.13 @@ -430,8 +527,8 @@ go.uber.org/config/internal/unreachable ## explicit; go 1.13 go.uber.org/goleak go.uber.org/goleak/internal/stack -# go.uber.org/multierr v1.6.0 -## explicit; go 1.12 +# go.uber.org/multierr v1.11.0 +## explicit; go 1.19 go.uber.org/multierr # go.uber.org/zap v1.21.0 ## explicit; go 1.13 @@ -441,13 +538,12 @@ go.uber.org/zap/internal/bufferpool go.uber.org/zap/internal/color go.uber.org/zap/internal/exit go.uber.org/zap/zapcore -# golang.org/x/crypto v0.21.0 -## explicit; go 1.18 +# golang.org/x/crypto v0.26.0 +## explicit; go 1.20 golang.org/x/crypto/bcrypt golang.org/x/crypto/blowfish golang.org/x/crypto/chacha20 golang.org/x/crypto/curve25519 -golang.org/x/crypto/curve25519/internal/field golang.org/x/crypto/internal/alias golang.org/x/crypto/internal/poly1305 golang.org/x/crypto/nacl/secretbox @@ -463,13 +559,13 @@ golang.org/x/crypto/ssh/terminal ## explicit; go 1.11 golang.org/x/lint golang.org/x/lint/golint -# golang.org/x/mod v0.10.0 -## explicit; go 1.17 +# golang.org/x/mod v0.20.0 +## explicit; go 1.18 golang.org/x/mod/internal/lazyregexp golang.org/x/mod/modfile golang.org/x/mod/module golang.org/x/mod/semver -# golang.org/x/net v0.23.0 +# golang.org/x/net v0.28.0 ## explicit; go 1.18 golang.org/x/net/context golang.org/x/net/http/httpguts @@ -480,57 +576,60 @@ golang.org/x/net/idna golang.org/x/net/internal/timeseries golang.org/x/net/publicsuffix golang.org/x/net/trace -# golang.org/x/oauth2 v0.7.0 -## explicit; go 1.17 +# golang.org/x/oauth2 v0.21.0 +## explicit; go 1.18 golang.org/x/oauth2 golang.org/x/oauth2/authhandler golang.org/x/oauth2/google -golang.org/x/oauth2/google/internal/externalaccount +golang.org/x/oauth2/google/externalaccount +golang.org/x/oauth2/google/internal/externalaccountauthorizeduser +golang.org/x/oauth2/google/internal/impersonate +golang.org/x/oauth2/google/internal/stsexchange golang.org/x/oauth2/internal golang.org/x/oauth2/jws golang.org/x/oauth2/jwt -# golang.org/x/sync v0.2.0 -## explicit +# golang.org/x/sync v0.8.0 +## explicit; go 1.18 golang.org/x/sync/errgroup -# golang.org/x/sys v0.18.0 +# golang.org/x/sys v0.24.0 ## explicit; go 1.18 golang.org/x/sys/cpu -golang.org/x/sys/execabs golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry -# golang.org/x/term v0.18.0 +# golang.org/x/term v0.23.0 ## explicit; go 1.18 golang.org/x/term -# golang.org/x/text v0.14.0 +# golang.org/x/text v0.17.0 ## explicit; go 1.18 golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm -golang.org/x/text/width # golang.org/x/time v0.3.0 ## explicit golang.org/x/time/rate -# golang.org/x/tools v0.9.3 -## explicit; go 1.18 +# golang.org/x/tools v0.24.0 +## explicit; go 1.19 golang.org/x/tools/go/ast/astutil golang.org/x/tools/go/gcexportdata +golang.org/x/tools/go/types/objectpath golang.org/x/tools/imports +golang.org/x/tools/internal/aliases golang.org/x/tools/internal/event golang.org/x/tools/internal/event/core golang.org/x/tools/internal/event/keys golang.org/x/tools/internal/event/label -golang.org/x/tools/internal/event/tag -golang.org/x/tools/internal/fastwalk golang.org/x/tools/internal/gcimporter golang.org/x/tools/internal/gocommand golang.org/x/tools/internal/gopathwalk golang.org/x/tools/internal/imports golang.org/x/tools/internal/pkgbits +golang.org/x/tools/internal/stdlib golang.org/x/tools/internal/tokeninternal -golang.org/x/tools/internal/typeparams +golang.org/x/tools/internal/typesinternal +golang.org/x/tools/internal/versions # google.golang.org/api v0.114.0 => github.com/scylladb/google-api-go-client v0.34.1-patched ## explicit; go 1.11 google.golang.org/api/googleapi @@ -548,13 +647,10 @@ google.golang.org/api/transport/http/internal/propagation google.golang.org/api/transport/internal/dca # google.golang.org/appengine v1.6.7 ## explicit; go 1.11 -google.golang.org/appengine google.golang.org/appengine/internal -google.golang.org/appengine/internal/app_identity google.golang.org/appengine/internal/base google.golang.org/appengine/internal/datastore google.golang.org/appengine/internal/log -google.golang.org/appengine/internal/modules google.golang.org/appengine/internal/remote_api google.golang.org/appengine/internal/urlfetch google.golang.org/appengine/urlfetch @@ -613,8 +709,9 @@ google.golang.org/grpc/serviceconfig google.golang.org/grpc/stats google.golang.org/grpc/status google.golang.org/grpc/tap -# google.golang.org/protobuf v1.33.0 -## explicit; go 1.17 +# google.golang.org/protobuf v1.34.2 +## explicit; go 1.20 +google.golang.org/protobuf/encoding/protodelim google.golang.org/protobuf/encoding/protojson google.golang.org/protobuf/encoding/prototext google.golang.org/protobuf/encoding/protowire @@ -622,6 +719,7 @@ google.golang.org/protobuf/internal/descfmt google.golang.org/protobuf/internal/descopts google.golang.org/protobuf/internal/detrand google.golang.org/protobuf/internal/editiondefaults +google.golang.org/protobuf/internal/editionssupport google.golang.org/protobuf/internal/encoding/defval google.golang.org/protobuf/internal/encoding/json google.golang.org/protobuf/internal/encoding/messageset